@pennsieve-viz/tsviewer 1.1.11 → 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.
Files changed (37) hide show
  1. package/dist/{BFLibraryButton-xRreF1qz.cjs → BFLibraryButton-B_TaDdTw.cjs} +1 -1
  2. package/dist/{BFLibraryButton-Dyws9SHi.js → BFLibraryButton-DTcYY6VD.js} +14 -14
  3. package/dist/{IconSelection-Cu7rNGza.cjs → IconSelection-BPTLv8Go.cjs} +1 -1
  4. package/dist/{IconSelection-BXkQ-HI2.js → IconSelection-BocyglLO.js} +3 -3
  5. package/dist/{TSAnnotationCanvas-vq4ZhQlM.js → TSAnnotationCanvas-DErBDH0Y.js} +4 -4
  6. package/dist/{TSAnnotationCanvas-DT1-oLwQ.cjs → TSAnnotationCanvas-DaDdtIB4.cjs} +1 -1
  7. package/dist/{TSAnnotationModal-BIihkWMN.js → TSAnnotationModal-B3OSl05U.js} +13 -13
  8. package/dist/{TSAnnotationModal-yiS6Inu7.cjs → TSAnnotationModal-DevUUWys.cjs} +1 -1
  9. package/dist/{TSFilterModal-Bg3Vl8ld.js → TSFilterModal-DHBpbDNp.js} +8 -8
  10. package/dist/{TSFilterModal-B9DK2z2R.cjs → TSFilterModal-DoqvKSUT.cjs} +1 -1
  11. package/dist/{TSScrubber-CRfsVW3j.cjs → TSScrubber-E03DDcMn.cjs} +1 -1
  12. package/dist/{TSScrubber-Dz4oujge.js → TSScrubber-hN5JY-DA.js} +3 -3
  13. package/dist/{TSViewerCanvas-B-uFOBba.js → TSViewerCanvas-2Jz9ZgqW.js} +1482 -1481
  14. package/dist/{TSViewerCanvas-5xGT95ay.cjs → TSViewerCanvas-Dc5cwQzK.cjs} +9 -9
  15. package/dist/{TSViewerLayerWindow-Ch0_2TBh.js → TSViewerLayerWindow-CalBmhT6.js} +6 -6
  16. package/dist/{TSViewerLayerWindow-yUINAqI2.cjs → TSViewerLayerWindow-PAfR31ZO.cjs} +1 -1
  17. package/dist/{TSViewerToolbar-WhD8V4Ex.cjs → TSViewerToolbar-C1wTQDPC.cjs} +1 -1
  18. package/dist/{TSViewerToolbar-BzM9uh9P.js → TSViewerToolbar-DL9XKYbV.js} +9 -9
  19. package/dist/{TsAnnotationDeleteDialog-CLRHSeYL.cjs → TsAnnotationDeleteDialog-Cv3z3dFh.cjs} +1 -1
  20. package/dist/{TsAnnotationDeleteDialog-2EHUvGW1.js → TsAnnotationDeleteDialog-DXgN07Wj.js} +5 -5
  21. package/dist/{base-CEBDkSsZ.cjs → base-BQSnEcNP.cjs} +1 -1
  22. package/dist/{base-B8HYDRlA.js → base-VCnLhxie.js} +9 -9
  23. package/dist/{el-input-DFAVTpkr.cjs → el-input-BDEG_6zp.cjs} +1 -1
  24. package/dist/{el-input-v5gK8U8C.js → el-input-Ct4WOqYx.js} +10 -10
  25. package/dist/{el-input-number-F_eDnZFO.cjs → el-input-number-B_bFGgma.cjs} +1 -1
  26. package/dist/{el-input-number-DSVzNAfT.js → el-input-number-DXBs74eH.js} +6 -6
  27. package/dist/{el-overlay-4ljdPakB.js → el-overlay-BMUWCEw_.js} +14 -14
  28. package/dist/{el-overlay-DFtIA0N9.cjs → el-overlay-D192MFpl.cjs} +1 -1
  29. package/dist/{index-BJOVbX31.js → index-BAtTJnp_.js} +1 -1
  30. package/dist/{index-qrig8S0H.js → index-BsH36ax4.js} +504 -503
  31. package/dist/{index-2QS1iKBu.cjs → index-TDc5sP-n.cjs} +1 -1
  32. package/dist/index-yiwCKzNX.cjs +1 -0
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.js +1 -1
  35. package/dist/style.css +1 -1
  36. package/package.json +2 -2
  37. package/dist/index-CQTgJYdx.cjs +0 -1
@@ -1,6 +1,6 @@
1
- import { ref, onUnmounted, readonly, reactive, computed, watch, inject, onMounted, openBlock, createElementBlock, createElementVNode, normalizeStyle, renderSlot, defineAsyncComponent, nextTick, createVNode, withCtx, unref } from "vue";
1
+ import { ref, onUnmounted, readonly, reactive, computed, watch, inject, onMounted, createElementBlock, openBlock, createElementVNode, renderSlot, normalizeStyle, defineAsyncComponent, nextTick, createVNode, withCtx, unref } from "vue";
2
2
  import { storeToRefs } from "pinia";
3
- import { n as nth, b as _curry2, d as _xfBase, l as _reduced, e as _dispatchable, m as commonjsGlobal, o as getDefaultExportFromCjs, u as useToken, p as propOr, g as _export_sfc, h as createViewerStore, q as propEq } from "./index-qrig8S0H.js";
3
+ import { n as nth, b as _curry2, d as _xfBase, l as _reduced, e as _dispatchable, m as commonjsGlobal, o as getDefaultExportFromCjs, u as useToken, p as propOr, g as _export_sfc, h as createViewerStore, q as propEq } from "./index-BsH36ax4.js";
4
4
  var head = /* @__PURE__ */ nth(0), XFind = /* @__PURE__ */ (function() {
5
5
  function f(c, v) {
6
6
  this.xf = v, this.f = c, this.found = !1;
@@ -227,15 +227,15 @@ function requireFloat() {
227
227
  if (s < 22250738585072014e-324)
228
228
  m = s / 5e-324, r(m >>> 0, u, o + n), r((h << 31 | m / 4294967296) >>> 0, u, o + d);
229
229
  else {
230
- var S = Math.floor(Math.log(s) / Math.LN2);
231
- S === 1024 && (S = 1023), m = s * Math.pow(2, -S), r(m * 4503599627370496 >>> 0, u, o + n), r((h << 31 | S + 1023 << 20 | m * 1048576 & 1048575) >>> 0, u, o + d);
230
+ var R = Math.floor(Math.log(s) / Math.LN2);
231
+ R === 1024 && (R = 1023), m = s * Math.pow(2, -R), r(m * 4503599627370496 >>> 0, u, o + n), r((h << 31 | R + 1023 << 20 | m * 1048576 & 1048575) >>> 0, u, o + d);
232
232
  }
233
233
  }
234
234
  }
235
235
  i.writeDoubleLE = e.bind(null, c, 0, 4), i.writeDoubleBE = e.bind(null, v, 4, 0);
236
236
  function t(r, n, d, s, u) {
237
- var o = r(s, u + n), h = r(s, u + d), m = (h >> 31) * 2 + 1, S = h >>> 20 & 2047, y = 4294967296 * (h & 1048575) + o;
238
- return S === 2047 ? y ? NaN : m * (1 / 0) : S === 0 ? m * 5e-324 * y : m * Math.pow(2, S - 1075) * (y + 4503599627370496);
237
+ var o = r(s, u + n), h = r(s, u + d), m = (h >> 31) * 2 + 1, R = h >>> 20 & 2047, y = 4294967296 * (h & 1048575) + o;
238
+ return R === 2047 ? y ? NaN : m * (1 / 0) : R === 0 ? m * 5e-324 * y : m * Math.pow(2, R - 1075) * (y + 4503599627370496);
239
239
  }
240
240
  i.readDoubleLE = t.bind(null, l, 0, 4), i.readDoubleBE = t.bind(null, a, 4, 0);
241
241
  })(), i;
@@ -508,13 +508,13 @@ function requireWriter() {
508
508
  if (hasRequiredWriter) return writer;
509
509
  hasRequiredWriter = 1, writer = r;
510
510
  var f = requireMinimal(), c, v = f.LongBits, l = f.base64, a = f.utf8;
511
- function i(S, y, g) {
512
- this.fn = S, this.len = y, this.next = void 0, this.val = g;
511
+ function i(R, y, g) {
512
+ this.fn = R, this.len = y, this.next = void 0, this.val = g;
513
513
  }
514
514
  function e() {
515
515
  }
516
- function t(S) {
517
- this.head = S.head, this.tail = S.tail, this.len = S.len, this.next = S.states;
516
+ function t(R) {
517
+ this.head = R.head, this.tail = R.tail, this.len = R.len, this.next = R.states;
518
518
  }
519
519
  function r() {
520
520
  this.len = 0, this.head = new i(e, 0, 0), this.tail = this.head, this.states = null;
@@ -530,19 +530,19 @@ function requireWriter() {
530
530
  };
531
531
  r.create = n(), r.alloc = function(y) {
532
532
  return new f.Array(y);
533
- }, f.Array !== Array && (r.alloc = f.pool(r.alloc, f.Array.prototype.subarray)), r.prototype._push = function(y, g, O) {
534
- return this.tail = this.tail.next = new i(y, g, O), this.len += g, this;
533
+ }, f.Array !== Array && (r.alloc = f.pool(r.alloc, f.Array.prototype.subarray)), r.prototype._push = function(y, g, S) {
534
+ return this.tail = this.tail.next = new i(y, g, S), this.len += g, this;
535
535
  };
536
- function d(S, y, g) {
537
- y[g] = S & 255;
536
+ function d(R, y, g) {
537
+ y[g] = R & 255;
538
538
  }
539
- function s(S, y, g) {
540
- for (; S > 127; )
541
- y[g++] = S & 127 | 128, S >>>= 7;
542
- y[g] = S;
539
+ function s(R, y, g) {
540
+ for (; R > 127; )
541
+ y[g++] = R & 127 | 128, R >>>= 7;
542
+ y[g] = R;
543
543
  }
544
- function u(S, y) {
545
- this.len = S, this.next = void 0, this.val = y;
544
+ function u(R, y) {
545
+ this.len = R, this.next = void 0, this.val = y;
546
546
  }
547
547
  u.prototype = Object.create(i.prototype), u.prototype.fn = s, r.prototype.uint32 = function(y) {
548
548
  return this.len += (this.tail = this.tail.next = new u(
@@ -554,12 +554,12 @@ function requireWriter() {
554
554
  }, r.prototype.sint32 = function(y) {
555
555
  return this.uint32((y << 1 ^ y >> 31) >>> 0);
556
556
  };
557
- function o(S, y, g) {
558
- for (; S.hi; )
559
- y[g++] = S.lo & 127 | 128, S.lo = (S.lo >>> 7 | S.hi << 25) >>> 0, S.hi >>>= 7;
560
- for (; S.lo > 127; )
561
- y[g++] = S.lo & 127 | 128, S.lo = S.lo >>> 7;
562
- y[g++] = S.lo;
557
+ function o(R, y, g) {
558
+ for (; R.hi; )
559
+ y[g++] = R.lo & 127 | 128, R.lo = (R.lo >>> 7 | R.hi << 25) >>> 0, R.hi >>>= 7;
560
+ for (; R.lo > 127; )
561
+ y[g++] = R.lo & 127 | 128, R.lo = R.lo >>> 7;
562
+ y[g++] = R.lo;
563
563
  }
564
564
  r.prototype.uint64 = function(y) {
565
565
  var g = v.from(y);
@@ -570,8 +570,8 @@ function requireWriter() {
570
570
  }, r.prototype.bool = function(y) {
571
571
  return this._push(d, 1, y ? 1 : 0);
572
572
  };
573
- function h(S, y, g) {
574
- y[g] = S & 255, y[g + 1] = S >>> 8 & 255, y[g + 2] = S >>> 16 & 255, y[g + 3] = S >>> 24;
573
+ function h(R, y, g) {
574
+ y[g] = R & 255, y[g + 1] = R >>> 8 & 255, y[g + 2] = R >>> 16 & 255, y[g + 3] = R >>> 24;
575
575
  }
576
576
  r.prototype.fixed32 = function(y) {
577
577
  return this._push(h, 4, y >>> 0);
@@ -583,19 +583,19 @@ function requireWriter() {
583
583
  }, r.prototype.double = function(y) {
584
584
  return this._push(f.float.writeDoubleLE, 8, y);
585
585
  };
586
- var m = f.Array.prototype.set ? function(y, g, O) {
587
- g.set(y, O);
588
- } : function(y, g, O) {
589
- for (var k = 0; k < y.length; ++k)
590
- g[O + k] = y[k];
586
+ var m = f.Array.prototype.set ? function(y, g, S) {
587
+ g.set(y, S);
588
+ } : function(y, g, S) {
589
+ for (var x = 0; x < y.length; ++x)
590
+ g[S + x] = y[x];
591
591
  };
592
592
  return r.prototype.bytes = function(y) {
593
593
  var g = y.length >>> 0;
594
594
  if (!g)
595
595
  return this._push(d, 1, 0);
596
596
  if (f.isString(y)) {
597
- var O = r.alloc(g = l.length(y));
598
- l.decode(y, O, 0), y = O;
597
+ var S = r.alloc(g = l.length(y));
598
+ l.decode(y, S, 0), y = S;
599
599
  }
600
600
  return this.uint32(g)._push(m, g, y);
601
601
  }, r.prototype.string = function(y) {
@@ -606,14 +606,14 @@ function requireWriter() {
606
606
  }, r.prototype.reset = function() {
607
607
  return this.states ? (this.head = this.states.head, this.tail = this.states.tail, this.len = this.states.len, this.states = this.states.next) : (this.head = this.tail = new i(e, 0, 0), this.len = 0), this;
608
608
  }, r.prototype.ldelim = function() {
609
- var y = this.head, g = this.tail, O = this.len;
610
- return this.reset().uint32(O), O && (this.tail.next = y.next, this.tail = g, this.len += O), this;
609
+ var y = this.head, g = this.tail, S = this.len;
610
+ return this.reset().uint32(S), S && (this.tail.next = y.next, this.tail = g, this.len += S), this;
611
611
  }, r.prototype.finish = function() {
612
- for (var y = this.head.next, g = this.constructor.alloc(this.len), O = 0; y; )
613
- y.fn(y.val, g, O), O += y.len, y = y.next;
612
+ for (var y = this.head.next, g = this.constructor.alloc(this.len), S = 0; y; )
613
+ y.fn(y.val, g, S), S += y.len, y = y.next;
614
614
  return g;
615
- }, r._configure = function(S) {
616
- c = S, r.create = n(), c._configure();
615
+ }, r._configure = function(R) {
616
+ c = R, r.create = n(), c._configure();
617
617
  }, writer;
618
618
  }
619
619
  var writer_buffer, hasRequiredWriter_buffer;
@@ -937,9 +937,9 @@ function requireCodegen() {
937
937
  }
938
938
  for (var u = new Array(arguments.length - 1), o = 0; o < u.length; )
939
939
  u[o] = arguments[++o];
940
- if (o = 0, e = e.replace(/%([%dfijs])/g, function(m, S) {
940
+ if (o = 0, e = e.replace(/%([%dfijs])/g, function(m, R) {
941
941
  var y = u[o++];
942
- switch (S) {
942
+ switch (R) {
943
943
  case "d":
944
944
  case "f":
945
945
  return String(Number(y));
@@ -1161,10 +1161,10 @@ function requireNamespace() {
1161
1161
  return m;
1162
1162
  if (o)
1163
1163
  return null;
1164
- for (var S = this; S.parent; ) {
1165
- if (m = S.parent._lookupImpl(s, h), m && (!u || u.indexOf(m.constructor) > -1))
1164
+ for (var R = this; R.parent; ) {
1165
+ if (m = R.parent._lookupImpl(s, h), m && (!u || u.indexOf(m.constructor) > -1))
1166
1166
  return m;
1167
- S = S.parent;
1167
+ R = R.parent;
1168
1168
  }
1169
1169
  return null;
1170
1170
  }, r.prototype._lookupImpl = function(s, u) {
@@ -1636,8 +1636,8 @@ function requireConverter() {
1636
1636
  if (h.resolvedType instanceof v) n("d%s=o.enums===String?%j:%j", m, h.resolvedType.valuesById[h.typeDefault], h.typeDefault);
1637
1637
  else if (h.long) n("if(util.Long){")("var n=new util.Long(%i,%i,%j)", h.typeDefault.low, h.typeDefault.high, h.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n", m)("}else")("d%s=o.longs===String?%j:%i", m, h.typeDefault.toString(), h.typeDefault.toNumber());
1638
1638
  else if (h.bytes) {
1639
- var S = "[" + Array.prototype.slice.call(h.typeDefault).join(",") + "]";
1640
- n("if(o.bytes===String)d%s=%j", m, String.fromCharCode.apply(String, h.typeDefault))("else{")("d%s=%s", m, S)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", m, m)("}");
1639
+ var R = "[" + Array.prototype.slice.call(h.typeDefault).join(",") + "]";
1640
+ n("if(o.bytes===String)d%s=%j", m, String.fromCharCode.apply(String, h.typeDefault))("else{")("d%s=%s", m, R)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", m, m)("}");
1641
1641
  } else n("d%s=%j", m, h.typeDefault);
1642
1642
  }
1643
1643
  n("}");
@@ -1726,10 +1726,10 @@ function requireType() {
1726
1726
  return this._fieldsById;
1727
1727
  this._fieldsById = {};
1728
1728
  for (var y = Object.keys(this.fields), g = 0; g < y.length; ++g) {
1729
- var O = this.fields[y[g]], k = O.id;
1730
- if (this._fieldsById[k])
1731
- throw Error("duplicate id " + k + " in " + this);
1732
- this._fieldsById[k] = O;
1729
+ var S = this.fields[y[g]], x = S.id;
1730
+ if (this._fieldsById[x])
1731
+ throw Error("duplicate id " + x + " in " + this);
1732
+ this._fieldsById[x] = S;
1733
1733
  }
1734
1734
  return this._fieldsById;
1735
1735
  }
@@ -1769,58 +1769,58 @@ function requireType() {
1769
1769
  set: function(y) {
1770
1770
  var g = y.prototype;
1771
1771
  g instanceof e || ((y.prototype = new e()).constructor = y, n.merge(y.prototype, g)), y.$type = y.prototype.$type = this, n.merge(y, e, !0), this._ctor = y;
1772
- for (var O = 0; O < /* initializes */
1773
- this.fieldsArray.length; ++O)
1774
- this._fieldsArray[O].resolve();
1775
- var k = {};
1776
- for (O = 0; O < /* initializes */
1777
- this.oneofsArray.length; ++O)
1778
- k[this._oneofsArray[O].resolve().name] = {
1779
- get: n.oneOfGetter(this._oneofsArray[O].oneof),
1780
- set: n.oneOfSetter(this._oneofsArray[O].oneof)
1772
+ for (var S = 0; S < /* initializes */
1773
+ this.fieldsArray.length; ++S)
1774
+ this._fieldsArray[S].resolve();
1775
+ var x = {};
1776
+ for (S = 0; S < /* initializes */
1777
+ this.oneofsArray.length; ++S)
1778
+ x[this._oneofsArray[S].resolve().name] = {
1779
+ get: n.oneOfGetter(this._oneofsArray[S].oneof),
1780
+ set: n.oneOfSetter(this._oneofsArray[S].oneof)
1781
1781
  };
1782
- O && Object.defineProperties(y.prototype, k);
1782
+ S && Object.defineProperties(y.prototype, x);
1783
1783
  }
1784
1784
  }
1785
1785
  }), m.generateConstructor = function(g) {
1786
- for (var O = n.codegen(["p"], g.name), k = 0, R; k < g.fieldsArray.length; ++k)
1787
- (R = g._fieldsArray[k]).map ? O("this%s={}", n.safeProp(R.name)) : R.repeated && O("this%s=[]", n.safeProp(R.name));
1788
- return O("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]");
1786
+ for (var S = n.codegen(["p"], g.name), x = 0, _; x < g.fieldsArray.length; ++x)
1787
+ (_ = g._fieldsArray[x]).map ? S("this%s={}", n.safeProp(_.name)) : _.repeated && S("this%s=[]", n.safeProp(_.name));
1788
+ return S("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]");
1789
1789
  };
1790
- function S(y) {
1790
+ function R(y) {
1791
1791
  return y._fieldsById = y._fieldsArray = y._oneofsArray = null, delete y.encode, delete y.decode, delete y.verify, y;
1792
1792
  }
1793
- return m.fromJSON = function(g, O) {
1794
- var k = new m(g, O.options);
1795
- k.extensions = O.extensions, k.reserved = O.reserved;
1796
- for (var R = Object.keys(O.fields), P = 0; P < R.length; ++P)
1797
- k.add(
1798
- (typeof O.fields[R[P]].keyType < "u" ? a.fromJSON : l.fromJSON)(R[P], O.fields[R[P]])
1793
+ return m.fromJSON = function(g, S) {
1794
+ var x = new m(g, S.options);
1795
+ x.extensions = S.extensions, x.reserved = S.reserved;
1796
+ for (var _ = Object.keys(S.fields), N = 0; N < _.length; ++N)
1797
+ x.add(
1798
+ (typeof S.fields[_[N]].keyType < "u" ? a.fromJSON : l.fromJSON)(_[N], S.fields[_[N]])
1799
1799
  );
1800
- if (O.oneofs)
1801
- for (R = Object.keys(O.oneofs), P = 0; P < R.length; ++P)
1802
- k.add(v.fromJSON(R[P], O.oneofs[R[P]]));
1803
- if (O.nested)
1804
- for (R = Object.keys(O.nested), P = 0; P < R.length; ++P) {
1805
- var j = O.nested[R[P]];
1806
- k.add(
1800
+ if (S.oneofs)
1801
+ for (_ = Object.keys(S.oneofs), N = 0; N < _.length; ++N)
1802
+ x.add(v.fromJSON(_[N], S.oneofs[_[N]]));
1803
+ if (S.nested)
1804
+ for (_ = Object.keys(S.nested), N = 0; N < _.length; ++N) {
1805
+ var z = S.nested[_[N]];
1806
+ x.add(
1807
1807
  // most to least likely
1808
- (j.id !== void 0 ? l.fromJSON : j.fields !== void 0 ? m.fromJSON : j.values !== void 0 ? c.fromJSON : j.methods !== void 0 ? i.fromJSON : f.fromJSON)(R[P], j)
1808
+ (z.id !== void 0 ? l.fromJSON : z.fields !== void 0 ? m.fromJSON : z.values !== void 0 ? c.fromJSON : z.methods !== void 0 ? i.fromJSON : f.fromJSON)(_[N], z)
1809
1809
  );
1810
1810
  }
1811
- return O.extensions && O.extensions.length && (k.extensions = O.extensions), O.reserved && O.reserved.length && (k.reserved = O.reserved), O.group && (k.group = !0), O.comment && (k.comment = O.comment), O.edition && (k._edition = O.edition), k._defaultEdition = "proto3", k;
1811
+ return S.extensions && S.extensions.length && (x.extensions = S.extensions), S.reserved && S.reserved.length && (x.reserved = S.reserved), S.group && (x.group = !0), S.comment && (x.comment = S.comment), S.edition && (x._edition = S.edition), x._defaultEdition = "proto3", x;
1812
1812
  }, m.prototype.toJSON = function(g) {
1813
- var O = f.prototype.toJSON.call(this, g), k = g ? !!g.keepComments : !1;
1813
+ var S = f.prototype.toJSON.call(this, g), x = g ? !!g.keepComments : !1;
1814
1814
  return n.toObject([
1815
1815
  "edition",
1816
1816
  this._editionToJSON(),
1817
1817
  "options",
1818
- O && O.options || void 0,
1818
+ S && S.options || void 0,
1819
1819
  "oneofs",
1820
1820
  f.arrayToJSON(this.oneofsArray, g),
1821
1821
  "fields",
1822
- f.arrayToJSON(this.fieldsArray.filter(function(R) {
1823
- return !R.declaringField;
1822
+ f.arrayToJSON(this.fieldsArray.filter(function(_) {
1823
+ return !_.declaringField;
1824
1824
  }), g) || {},
1825
1825
  "extensions",
1826
1826
  this.extensions && this.extensions.length ? this.extensions : void 0,
@@ -1829,24 +1829,24 @@ function requireType() {
1829
1829
  "group",
1830
1830
  this.group || void 0,
1831
1831
  "nested",
1832
- O && O.nested || void 0,
1832
+ S && S.nested || void 0,
1833
1833
  "comment",
1834
- k ? this.comment : void 0
1834
+ x ? this.comment : void 0
1835
1835
  ]);
1836
1836
  }, m.prototype.resolveAll = function() {
1837
1837
  if (!this._needsRecursiveResolve) return this;
1838
1838
  f.prototype.resolveAll.call(this);
1839
1839
  var g = this.oneofsArray;
1840
- for (k = 0; k < g.length; )
1841
- g[k++].resolve();
1842
- for (var O = this.fieldsArray, k = 0; k < O.length; )
1843
- O[k++].resolve();
1840
+ for (x = 0; x < g.length; )
1841
+ g[x++].resolve();
1842
+ for (var S = this.fieldsArray, x = 0; x < S.length; )
1843
+ S[x++].resolve();
1844
1844
  return this;
1845
1845
  }, m.prototype._resolveFeaturesRecursive = function(g) {
1846
- return this._needsRecursiveFeatureResolution ? (g = this._edition || g, f.prototype._resolveFeaturesRecursive.call(this, g), this.oneofsArray.forEach((O) => {
1847
- O._resolveFeatures(g);
1848
- }), this.fieldsArray.forEach((O) => {
1849
- O._resolveFeatures(g);
1846
+ return this._needsRecursiveFeatureResolution ? (g = this._edition || g, f.prototype._resolveFeaturesRecursive.call(this, g), this.oneofsArray.forEach((S) => {
1847
+ S._resolveFeatures(g);
1848
+ }), this.fieldsArray.forEach((S) => {
1849
+ S._resolveFeatures(g);
1850
1850
  }), this) : this;
1851
1851
  }, m.prototype.get = function(g) {
1852
1852
  return this.fields[g] || this.oneofs && this.oneofs[g] || this.nested && this.nested[g] || null;
@@ -1863,19 +1863,19 @@ function requireType() {
1863
1863
  throw Error("id " + g.id + " is reserved in " + this);
1864
1864
  if (this.isReservedName(g.name))
1865
1865
  throw Error("name '" + g.name + "' is reserved in " + this);
1866
- return g.parent && g.parent.remove(g), this.fields[g.name] = g, g.message = this, g.onAdd(this), S(this);
1866
+ return g.parent && g.parent.remove(g), this.fields[g.name] = g, g.message = this, g.onAdd(this), R(this);
1867
1867
  }
1868
- return g instanceof v ? (this.oneofs || (this.oneofs = {}), this.oneofs[g.name] = g, g.onAdd(this), S(this)) : f.prototype.add.call(this, g);
1868
+ return g instanceof v ? (this.oneofs || (this.oneofs = {}), this.oneofs[g.name] = g, g.onAdd(this), R(this)) : f.prototype.add.call(this, g);
1869
1869
  }, m.prototype.remove = function(g) {
1870
1870
  if (g instanceof l && g.extend === void 0) {
1871
1871
  if (!this.fields || this.fields[g.name] !== g)
1872
1872
  throw Error(g + " is not a member of " + this);
1873
- return delete this.fields[g.name], g.parent = null, g.onRemove(this), S(this);
1873
+ return delete this.fields[g.name], g.parent = null, g.onRemove(this), R(this);
1874
1874
  }
1875
1875
  if (g instanceof v) {
1876
1876
  if (!this.oneofs || this.oneofs[g.name] !== g)
1877
1877
  throw Error(g + " is not a member of " + this);
1878
- return delete this.oneofs[g.name], g.parent = null, g.onRemove(this), S(this);
1878
+ return delete this.oneofs[g.name], g.parent = null, g.onRemove(this), R(this);
1879
1879
  }
1880
1880
  return f.prototype.remove.call(this, g);
1881
1881
  }, m.prototype.isReservedId = function(g) {
@@ -1885,50 +1885,50 @@ function requireType() {
1885
1885
  }, m.prototype.create = function(g) {
1886
1886
  return new this.ctor(g);
1887
1887
  }, m.prototype.setup = function() {
1888
- for (var g = this.fullName, O = [], k = 0; k < /* initializes */
1889
- this.fieldsArray.length; ++k)
1890
- O.push(this._fieldsArray[k].resolve().resolvedType);
1888
+ for (var g = this.fullName, S = [], x = 0; x < /* initializes */
1889
+ this.fieldsArray.length; ++x)
1890
+ S.push(this._fieldsArray[x].resolve().resolvedType);
1891
1891
  this.encode = d(this)({
1892
1892
  Writer: r,
1893
- types: O,
1893
+ types: S,
1894
1894
  util: n
1895
1895
  }), this.decode = s(this)({
1896
1896
  Reader: t,
1897
- types: O,
1897
+ types: S,
1898
1898
  util: n
1899
1899
  }), this.verify = u(this)({
1900
- types: O,
1900
+ types: S,
1901
1901
  util: n
1902
1902
  }), this.fromObject = o.fromObject(this)({
1903
- types: O,
1903
+ types: S,
1904
1904
  util: n
1905
1905
  }), this.toObject = o.toObject(this)({
1906
- types: O,
1906
+ types: S,
1907
1907
  util: n
1908
1908
  });
1909
- var R = h[g];
1910
- if (R) {
1911
- var P = Object.create(this);
1912
- P.fromObject = this.fromObject, this.fromObject = R.fromObject.bind(P), P.toObject = this.toObject, this.toObject = R.toObject.bind(P);
1909
+ var _ = h[g];
1910
+ if (_) {
1911
+ var N = Object.create(this);
1912
+ N.fromObject = this.fromObject, this.fromObject = _.fromObject.bind(N), N.toObject = this.toObject, this.toObject = _.toObject.bind(N);
1913
1913
  }
1914
1914
  return this;
1915
- }, m.prototype.encode = function(g, O) {
1916
- return this.setup().encode(g, O);
1917
- }, m.prototype.encodeDelimited = function(g, O) {
1918
- return this.encode(g, O && O.len ? O.fork() : O).ldelim();
1919
- }, m.prototype.decode = function(g, O) {
1920
- return this.setup().decode(g, O);
1915
+ }, m.prototype.encode = function(g, S) {
1916
+ return this.setup().encode(g, S);
1917
+ }, m.prototype.encodeDelimited = function(g, S) {
1918
+ return this.encode(g, S && S.len ? S.fork() : S).ldelim();
1919
+ }, m.prototype.decode = function(g, S) {
1920
+ return this.setup().decode(g, S);
1921
1921
  }, m.prototype.decodeDelimited = function(g) {
1922
1922
  return g instanceof t || (g = t.create(g)), this.decode(g, g.uint32());
1923
1923
  }, m.prototype.verify = function(g) {
1924
1924
  return this.setup().verify(g);
1925
1925
  }, m.prototype.fromObject = function(g) {
1926
1926
  return this.setup().fromObject(g);
1927
- }, m.prototype.toObject = function(g, O) {
1928
- return this.setup().toObject(g, O);
1927
+ }, m.prototype.toObject = function(g, S) {
1928
+ return this.setup().toObject(g, S);
1929
1929
  }, m.d = function(g) {
1930
- return function(k) {
1931
- n.decorateType(k, g);
1930
+ return function(x) {
1931
+ n.decorateType(x, g);
1932
1932
  };
1933
1933
  }, type;
1934
1934
  }
@@ -1949,80 +1949,80 @@ function requireRoot() {
1949
1949
  }
1950
1950
  r.prototype.load = function u(o, h, m) {
1951
1951
  typeof h == "function" && (m = h, h = void 0);
1952
- var S = this;
1952
+ var R = this;
1953
1953
  if (!m)
1954
- return a.asPromise(u, S, o, h);
1954
+ return a.asPromise(u, R, o, h);
1955
1955
  var y = m === n;
1956
- function g(L, W) {
1956
+ function g(B, V) {
1957
1957
  if (m) {
1958
1958
  if (y)
1959
- throw L;
1960
- W && W.resolveAll();
1959
+ throw B;
1960
+ V && V.resolveAll();
1961
1961
  var b = m;
1962
- m = null, b(L, W);
1962
+ m = null, b(B, V);
1963
1963
  }
1964
1964
  }
1965
- function O(L) {
1966
- var W = L.lastIndexOf("google/protobuf/");
1967
- if (W > -1) {
1968
- var b = L.substring(W);
1965
+ function S(B) {
1966
+ var V = B.lastIndexOf("google/protobuf/");
1967
+ if (V > -1) {
1968
+ var b = B.substring(V);
1969
1969
  if (b in t) return b;
1970
1970
  }
1971
1971
  return null;
1972
1972
  }
1973
- function k(L, W) {
1973
+ function x(B, V) {
1974
1974
  try {
1975
- if (a.isString(W) && W.charAt(0) === "{" && (W = JSON.parse(W)), !a.isString(W))
1976
- S.setOptions(W.options).addJSON(W.nested);
1975
+ if (a.isString(V) && V.charAt(0) === "{" && (V = JSON.parse(V)), !a.isString(V))
1976
+ R.setOptions(V.options).addJSON(V.nested);
1977
1977
  else {
1978
- e.filename = L;
1979
- var b = e(W, S, h), T, E = 0;
1978
+ e.filename = B;
1979
+ var b = e(V, R, h), q, k = 0;
1980
1980
  if (b.imports)
1981
- for (; E < b.imports.length; ++E)
1982
- (T = O(b.imports[E]) || S.resolvePath(L, b.imports[E])) && R(T);
1981
+ for (; k < b.imports.length; ++k)
1982
+ (q = S(b.imports[k]) || R.resolvePath(B, b.imports[k])) && _(q);
1983
1983
  if (b.weakImports)
1984
- for (E = 0; E < b.weakImports.length; ++E)
1985
- (T = O(b.weakImports[E]) || S.resolvePath(L, b.weakImports[E])) && R(T, !0);
1984
+ for (k = 0; k < b.weakImports.length; ++k)
1985
+ (q = S(b.weakImports[k]) || R.resolvePath(B, b.weakImports[k])) && _(q, !0);
1986
1986
  }
1987
- } catch (A) {
1988
- g(A);
1987
+ } catch (T) {
1988
+ g(T);
1989
1989
  }
1990
- !y && !P && g(null, S);
1990
+ !y && !N && g(null, R);
1991
1991
  }
1992
- function R(L, W) {
1993
- if (L = O(L) || L, !(S.files.indexOf(L) > -1)) {
1994
- if (S.files.push(L), L in t) {
1995
- y ? k(L, t[L]) : (++P, setTimeout(function() {
1996
- --P, k(L, t[L]);
1992
+ function _(B, V) {
1993
+ if (B = S(B) || B, !(R.files.indexOf(B) > -1)) {
1994
+ if (R.files.push(B), B in t) {
1995
+ y ? x(B, t[B]) : (++N, setTimeout(function() {
1996
+ --N, x(B, t[B]);
1997
1997
  }));
1998
1998
  return;
1999
1999
  }
2000
2000
  if (y) {
2001
2001
  var b;
2002
2002
  try {
2003
- b = a.fs.readFileSync(L).toString("utf8");
2004
- } catch (T) {
2005
- W || g(T);
2003
+ b = a.fs.readFileSync(B).toString("utf8");
2004
+ } catch (q) {
2005
+ V || g(q);
2006
2006
  return;
2007
2007
  }
2008
- k(L, b);
2008
+ x(B, b);
2009
2009
  } else
2010
- ++P, S.fetch(L, function(T, E) {
2011
- if (--P, !!m) {
2012
- if (T) {
2013
- W ? P || g(null, S) : g(T);
2010
+ ++N, R.fetch(B, function(q, k) {
2011
+ if (--N, !!m) {
2012
+ if (q) {
2013
+ V ? N || g(null, R) : g(q);
2014
2014
  return;
2015
2015
  }
2016
- k(L, E);
2016
+ x(B, k);
2017
2017
  }
2018
2018
  });
2019
2019
  }
2020
2020
  }
2021
- var P = 0;
2021
+ var N = 0;
2022
2022
  a.isString(o) && (o = [o]);
2023
- for (var j = 0, J; j < o.length; ++j)
2024
- (J = S.resolvePath("", o[j])) && R(J);
2025
- return y ? (S.resolveAll(), S) : (P || g(null, S), S);
2023
+ for (var z = 0, H; z < o.length; ++z)
2024
+ (H = R.resolvePath("", o[z])) && _(H);
2025
+ return y ? (R.resolveAll(), R) : (N || g(null, R), R);
2026
2026
  }, r.prototype.loadSync = function(o, h) {
2027
2027
  if (!a.isNode)
2028
2028
  throw Error("not supported");
@@ -2138,17 +2138,17 @@ function requireUtil() {
2138
2138
  var d = new l("Enum" + t++, n);
2139
2139
  return f.decorateRoot.add(d), Object.defineProperty(n, "$type", { value: d, enumerable: !1 }), d;
2140
2140
  }, f.setProperty = function(n, d, s, u) {
2141
- function o(h, m, S) {
2141
+ function o(h, m, R) {
2142
2142
  var y = m.shift();
2143
2143
  if (y === "__proto__" || y === "prototype")
2144
2144
  return h;
2145
2145
  if (m.length > 0)
2146
- h[y] = o(h[y] || {}, m, S);
2146
+ h[y] = o(h[y] || {}, m, R);
2147
2147
  else {
2148
2148
  var g = h[y];
2149
2149
  if (g && u)
2150
2150
  return h;
2151
- g && (S = [].concat(g).concat(S)), h[y] = S;
2151
+ g && (R = [].concat(g).concat(R)), h[y] = R;
2152
2152
  }
2153
2153
  return h;
2154
2154
  }
@@ -2754,137 +2754,137 @@ function requireTokenize() {
2754
2754
  d.unescape = n;
2755
2755
  function d(s, u) {
2756
2756
  s = s.toString();
2757
- var o = 0, h = s.length, m = 1, S = 0, y = {}, g = [], O = null;
2758
- function k(w) {
2759
- return Error("illegal " + w + " (line " + m + ")");
2760
- }
2761
- function R() {
2762
- var w = O === "'" ? v : c;
2763
- w.lastIndex = o - 1;
2764
- var N = w.exec(s);
2765
- if (!N)
2766
- throw k("string");
2767
- return o = w.lastIndex, b(O), O = null, n(N[1]);
2768
- }
2769
- function P(w) {
2770
- return s.charAt(w);
2771
- }
2772
- function j(w, N, I) {
2773
- var V = {
2774
- type: s.charAt(w++),
2757
+ var o = 0, h = s.length, m = 1, R = 0, y = {}, g = [], S = null;
2758
+ function x(A) {
2759
+ return Error("illegal " + A + " (line " + m + ")");
2760
+ }
2761
+ function _() {
2762
+ var A = S === "'" ? v : c;
2763
+ A.lastIndex = o - 1;
2764
+ var E = A.exec(s);
2765
+ if (!E)
2766
+ throw x("string");
2767
+ return o = A.lastIndex, b(S), S = null, n(E[1]);
2768
+ }
2769
+ function N(A) {
2770
+ return s.charAt(A);
2771
+ }
2772
+ function z(A, E, D) {
2773
+ var L = {
2774
+ type: s.charAt(A++),
2775
2775
  lineEmpty: !1,
2776
- leading: I
2777
- }, B;
2778
- u ? B = 2 : B = 3;
2779
- var $ = w - B, z;
2776
+ leading: D
2777
+ }, W;
2778
+ u ? W = 2 : W = 3;
2779
+ var J = A - W, $;
2780
2780
  do
2781
- if (--$ < 0 || (z = s.charAt($)) === `
2781
+ if (--J < 0 || ($ = s.charAt(J)) === `
2782
2782
  `) {
2783
- V.lineEmpty = !0;
2783
+ L.lineEmpty = !0;
2784
2784
  break;
2785
2785
  }
2786
- while (z === " " || z === " ");
2787
- for (var D = s.substring(w, N).split(i), Y = 0; Y < D.length; ++Y)
2788
- D[Y] = D[Y].replace(u ? a : l, "").trim();
2789
- V.text = D.join(`
2790
- `).trim(), y[m] = V, S = m;
2791
- }
2792
- function J(w) {
2793
- var N = L(w), I = s.substring(w, N), V = /^\s*\/\//.test(I);
2794
- return V;
2795
- }
2796
- function L(w) {
2797
- for (var N = w; N < h && P(N) !== `
2786
+ while ($ === " " || $ === " ");
2787
+ for (var I = s.substring(A, E).split(i), Y = 0; Y < I.length; ++Y)
2788
+ I[Y] = I[Y].replace(u ? a : l, "").trim();
2789
+ L.text = I.join(`
2790
+ `).trim(), y[m] = L, R = m;
2791
+ }
2792
+ function H(A) {
2793
+ var E = B(A), D = s.substring(A, E), L = /^\s*\/\//.test(D);
2794
+ return L;
2795
+ }
2796
+ function B(A) {
2797
+ for (var E = A; E < h && N(E) !== `
2798
2798
  `; )
2799
- N++;
2800
- return N;
2799
+ E++;
2800
+ return E;
2801
2801
  }
2802
- function W() {
2802
+ function V() {
2803
2803
  if (g.length > 0)
2804
2804
  return g.shift();
2805
- if (O)
2806
- return R();
2807
- var w, N, I, V, B, $ = o === 0;
2805
+ if (S)
2806
+ return _();
2807
+ var A, E, D, L, W, J = o === 0;
2808
2808
  do {
2809
2809
  if (o === h)
2810
2810
  return null;
2811
- for (w = !1; e.test(I = P(o)); )
2812
- if (I === `
2813
- ` && ($ = !0, ++m), ++o === h)
2811
+ for (A = !1; e.test(D = N(o)); )
2812
+ if (D === `
2813
+ ` && (J = !0, ++m), ++o === h)
2814
2814
  return null;
2815
- if (P(o) === "/") {
2815
+ if (N(o) === "/") {
2816
2816
  if (++o === h)
2817
- throw k("comment");
2818
- if (P(o) === "/")
2817
+ throw x("comment");
2818
+ if (N(o) === "/")
2819
2819
  if (u) {
2820
- if (V = o, B = !1, J(o - 1)) {
2821
- B = !0;
2820
+ if (L = o, W = !1, H(o - 1)) {
2821
+ W = !0;
2822
2822
  do
2823
- if (o = L(o), o === h || (o++, !$))
2823
+ if (o = B(o), o === h || (o++, !J))
2824
2824
  break;
2825
- while (J(o));
2825
+ while (H(o));
2826
2826
  } else
2827
- o = Math.min(h, L(o) + 1);
2828
- B && (j(V, o, $), $ = !0), m++, w = !0;
2827
+ o = Math.min(h, B(o) + 1);
2828
+ W && (z(L, o, J), J = !0), m++, A = !0;
2829
2829
  } else {
2830
- for (B = P(V = o + 1) === "/"; P(++o) !== `
2830
+ for (W = N(L = o + 1) === "/"; N(++o) !== `
2831
2831
  `; )
2832
2832
  if (o === h)
2833
2833
  return null;
2834
- ++o, B && (j(V, o - 1, $), $ = !0), ++m, w = !0;
2834
+ ++o, W && (z(L, o - 1, J), J = !0), ++m, A = !0;
2835
2835
  }
2836
- else if ((I = P(o)) === "*") {
2837
- V = o + 1, B = u || P(V) === "*";
2836
+ else if ((D = N(o)) === "*") {
2837
+ L = o + 1, W = u || N(L) === "*";
2838
2838
  do {
2839
- if (I === `
2839
+ if (D === `
2840
2840
  ` && ++m, ++o === h)
2841
- throw k("comment");
2842
- N = I, I = P(o);
2843
- } while (N !== "*" || I !== "/");
2844
- ++o, B && (j(V, o - 2, $), $ = !0), w = !0;
2841
+ throw x("comment");
2842
+ E = D, D = N(o);
2843
+ } while (E !== "*" || D !== "/");
2844
+ ++o, W && (z(L, o - 2, J), J = !0), A = !0;
2845
2845
  } else
2846
2846
  return "/";
2847
2847
  }
2848
- } while (w);
2849
- var z = o;
2848
+ } while (A);
2849
+ var $ = o;
2850
2850
  f.lastIndex = 0;
2851
- var D = f.test(P(z++));
2852
- if (!D)
2853
- for (; z < h && !f.test(P(z)); )
2854
- ++z;
2855
- var Y = s.substring(o, o = z);
2856
- return (Y === '"' || Y === "'") && (O = Y), Y;
2851
+ var I = f.test(N($++));
2852
+ if (!I)
2853
+ for (; $ < h && !f.test(N($)); )
2854
+ ++$;
2855
+ var Y = s.substring(o, o = $);
2856
+ return (Y === '"' || Y === "'") && (S = Y), Y;
2857
2857
  }
2858
- function b(w) {
2859
- g.push(w);
2858
+ function b(A) {
2859
+ g.push(A);
2860
2860
  }
2861
- function T() {
2861
+ function q() {
2862
2862
  if (!g.length) {
2863
- var w = W();
2864
- if (w === null)
2863
+ var A = V();
2864
+ if (A === null)
2865
2865
  return null;
2866
- b(w);
2866
+ b(A);
2867
2867
  }
2868
2868
  return g[0];
2869
2869
  }
2870
- function E(w, N) {
2871
- var I = T(), V = I === w;
2872
- if (V)
2873
- return W(), !0;
2874
- if (!N)
2875
- throw k("token '" + I + "', '" + w + "' expected");
2870
+ function k(A, E) {
2871
+ var D = q(), L = D === A;
2872
+ if (L)
2873
+ return V(), !0;
2874
+ if (!E)
2875
+ throw x("token '" + D + "', '" + A + "' expected");
2876
2876
  return !1;
2877
2877
  }
2878
- function A(w) {
2879
- var N = null, I;
2880
- return w === void 0 ? (I = y[m - 1], delete y[m - 1], I && (u || I.type === "*" || I.lineEmpty) && (N = I.leading ? I.text : null)) : (S < w && T(), I = y[w], delete y[w], I && !I.lineEmpty && (u || I.type === "/") && (N = I.leading ? null : I.text)), N;
2878
+ function T(A) {
2879
+ var E = null, D;
2880
+ return A === void 0 ? (D = y[m - 1], delete y[m - 1], D && (u || D.type === "*" || D.lineEmpty) && (E = D.leading ? D.text : null)) : (R < A && q(), D = y[A], delete y[A], D && !D.lineEmpty && (u || D.type === "/") && (E = D.leading ? null : D.text)), E;
2881
2881
  }
2882
2882
  return Object.defineProperty({
2883
- next: W,
2884
- peek: T,
2883
+ next: V,
2884
+ peek: q,
2885
2885
  push: b,
2886
- skip: E,
2887
- cmnt: A
2886
+ skip: k,
2887
+ cmnt: T
2888
2888
  }, "line", {
2889
2889
  get: function() {
2890
2890
  return m;
@@ -2896,39 +2896,39 @@ function requireTokenize() {
2896
2896
  var parse_1, hasRequiredParse;
2897
2897
  function requireParse() {
2898
2898
  if (hasRequiredParse) return parse_1;
2899
- hasRequiredParse = 1, parse_1 = R, R.filename = null, R.defaults = { keepCase: !1 };
2900
- var f = requireTokenize(), c = requireRoot(), v = requireType(), l = requireField(), a = requireMapfield(), i = requireOneof(), e = require_enum(), t = requireService(), r = requireMethod(), n = requireObject(), d = requireTypes(), s = requireUtil(), u = /^[1-9][0-9]*$/, o = /^-?[1-9][0-9]*$/, h = /^0[x][0-9a-fA-F]+$/, m = /^-?0[x][0-9a-fA-F]+$/, S = /^0[0-7]+$/, y = /^-?0[0-7]+$/, g = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, O = /^[a-zA-Z_][a-zA-Z_0-9]*$/, k = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
2901
- function R(P, j, J) {
2902
- j instanceof c || (J = j, j = new c()), J || (J = R.defaults);
2903
- var L = J.preferTrailingComment || !1, W = f(P, J.alternateCommentMode || !1), b = W.next, T = W.push, E = W.peek, A = W.skip, w = W.cmnt, N = !0, I, V, B, $ = "proto2", z = j, D = [], Y = {}, X = J.keepCase ? function(C) {
2904
- return C;
2899
+ hasRequiredParse = 1, parse_1 = _, _.filename = null, _.defaults = { keepCase: !1 };
2900
+ var f = requireTokenize(), c = requireRoot(), v = requireType(), l = requireField(), a = requireMapfield(), i = requireOneof(), e = require_enum(), t = requireService(), r = requireMethod(), n = requireObject(), d = requireTypes(), s = requireUtil(), u = /^[1-9][0-9]*$/, o = /^-?[1-9][0-9]*$/, h = /^0[x][0-9a-fA-F]+$/, m = /^-?0[x][0-9a-fA-F]+$/, R = /^0[0-7]+$/, y = /^-?0[0-7]+$/, g = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/, S = /^[a-zA-Z_][a-zA-Z_0-9]*$/, x = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
2901
+ function _(N, z, H) {
2902
+ z instanceof c || (H = z, z = new c()), H || (H = _.defaults);
2903
+ var B = H.preferTrailingComment || !1, V = f(N, H.alternateCommentMode || !1), b = V.next, q = V.push, k = V.peek, T = V.skip, A = V.cmnt, E = !0, D, L, W, J = "proto2", $ = z, I = [], Y = {}, U = H.keepCase ? function(P) {
2904
+ return P;
2905
2905
  } : s.camelCase;
2906
- function de() {
2907
- D.forEach((C) => {
2908
- C._edition = $, Object.keys(Y).forEach((x) => {
2909
- C.getOption(x) === void 0 && C.setOption(x, Y[x], !0);
2906
+ function ce() {
2907
+ I.forEach((P) => {
2908
+ P._edition = J, Object.keys(Y).forEach((C) => {
2909
+ P.getOption(C) === void 0 && P.setOption(C, Y[C], !0);
2910
2910
  });
2911
2911
  });
2912
2912
  }
2913
- function U(C, x, p) {
2914
- var _ = R.filename;
2915
- return p || (R.filename = null), Error("illegal " + (x || "token") + " '" + C + "' (" + (_ ? _ + ", " : "") + "line " + W.line + ")");
2913
+ function j(P, C, p) {
2914
+ var w = _.filename;
2915
+ return p || (_.filename = null), Error("illegal " + (C || "token") + " '" + P + "' (" + (w ? w + ", " : "") + "line " + V.line + ")");
2916
2916
  }
2917
2917
  function re() {
2918
- var C = [], x;
2918
+ var P = [], C;
2919
2919
  do {
2920
- if ((x = b()) !== '"' && x !== "'")
2921
- throw U(x);
2922
- C.push(b()), A(x), x = E();
2923
- } while (x === '"' || x === "'");
2924
- return C.join("");
2925
- }
2926
- function le(C) {
2927
- var x = b();
2928
- switch (x) {
2920
+ if ((C = b()) !== '"' && C !== "'")
2921
+ throw j(C);
2922
+ P.push(b()), T(C), C = k();
2923
+ } while (C === '"' || C === "'");
2924
+ return P.join("");
2925
+ }
2926
+ function se(P) {
2927
+ var C = b();
2928
+ switch (C) {
2929
2929
  case "'":
2930
2930
  case '"':
2931
- return T(x), re();
2931
+ return q(C), re();
2932
2932
  case "true":
2933
2933
  case "TRUE":
2934
2934
  return !0;
@@ -2937,53 +2937,53 @@ function requireParse() {
2937
2937
  return !1;
2938
2938
  }
2939
2939
  try {
2940
- return ce(
2941
- x,
2940
+ return oe(
2941
+ C,
2942
2942
  /* insideTryCatch */
2943
2943
  !0
2944
2944
  );
2945
2945
  } catch {
2946
- if (k.test(x))
2947
- return x;
2948
- throw U(x, "value");
2946
+ if (x.test(C))
2947
+ return C;
2948
+ throw j(C, "value");
2949
2949
  }
2950
2950
  }
2951
- function ae(C, x) {
2952
- var p, _;
2951
+ function fe(P, C) {
2952
+ var p, w;
2953
2953
  do
2954
- if (x && ((p = E()) === '"' || p === "'")) {
2955
- var q = re();
2956
- if (C.push(q), $ >= 2023)
2957
- throw U(q, "id");
2954
+ if (C && ((p = k()) === '"' || p === "'")) {
2955
+ var O = re();
2956
+ if (P.push(O), J >= 2023)
2957
+ throw j(O, "id");
2958
2958
  } else
2959
2959
  try {
2960
- C.push([_ = ye(b()), A("to", !0) ? ye(b()) : _]);
2960
+ P.push([w = ye(b()), T("to", !0) ? ye(b()) : w]);
2961
2961
  } catch (F) {
2962
- if (x && k.test(p) && $ >= 2023)
2963
- C.push(p);
2962
+ if (C && x.test(p) && J >= 2023)
2963
+ P.push(p);
2964
2964
  else
2965
2965
  throw F;
2966
2966
  }
2967
- while (A(",", !0));
2967
+ while (T(",", !0));
2968
2968
  var M = { options: void 0 };
2969
- M.setOption = function(F, H) {
2970
- this.options === void 0 && (this.options = {}), this.options[F] = H;
2969
+ M.setOption = function(F, G) {
2970
+ this.options === void 0 && (this.options = {}), this.options[F] = G;
2971
2971
  }, me(
2972
2972
  M,
2973
- function(H) {
2974
- if (H === "option")
2975
- pe(M, H), A(";");
2973
+ function(G) {
2974
+ if (G === "option")
2975
+ pe(M, G), T(";");
2976
2976
  else
2977
- throw U(H);
2977
+ throw j(G);
2978
2978
  },
2979
2979
  function() {
2980
- be(M);
2980
+ _e(M);
2981
2981
  }
2982
2982
  );
2983
2983
  }
2984
- function ce(C, x) {
2984
+ function oe(P, C) {
2985
2985
  var p = 1;
2986
- switch (C.charAt(0) === "-" && (p = -1, C = C.substring(1)), C) {
2986
+ switch (P.charAt(0) === "-" && (p = -1, P = P.substring(1)), P) {
2987
2987
  case "inf":
2988
2988
  case "INF":
2989
2989
  case "Inf":
@@ -2996,18 +2996,18 @@ function requireParse() {
2996
2996
  case "0":
2997
2997
  return 0;
2998
2998
  }
2999
- if (u.test(C))
3000
- return p * parseInt(C, 10);
3001
- if (h.test(C))
3002
- return p * parseInt(C, 16);
3003
- if (S.test(C))
3004
- return p * parseInt(C, 8);
3005
- if (g.test(C))
3006
- return p * parseFloat(C);
3007
- throw U(C, "number", x);
3008
- }
3009
- function ye(C, x) {
3010
- switch (C) {
2999
+ if (u.test(P))
3000
+ return p * parseInt(P, 10);
3001
+ if (h.test(P))
3002
+ return p * parseInt(P, 16);
3003
+ if (R.test(P))
3004
+ return p * parseInt(P, 8);
3005
+ if (g.test(P))
3006
+ return p * parseFloat(P);
3007
+ throw j(P, "number", C);
3008
+ }
3009
+ function ye(P, C) {
3010
+ switch (P) {
3011
3011
  case "max":
3012
3012
  case "MAX":
3013
3013
  case "Max":
@@ -3015,366 +3015,366 @@ function requireParse() {
3015
3015
  case "0":
3016
3016
  return 0;
3017
3017
  }
3018
- if (!x && C.charAt(0) === "-")
3019
- throw U(C, "id");
3020
- if (o.test(C))
3021
- return parseInt(C, 10);
3022
- if (m.test(C))
3023
- return parseInt(C, 16);
3024
- if (y.test(C))
3025
- return parseInt(C, 8);
3026
- throw U(C, "id");
3018
+ if (!C && P.charAt(0) === "-")
3019
+ throw j(P, "id");
3020
+ if (o.test(P))
3021
+ return parseInt(P, 10);
3022
+ if (m.test(P))
3023
+ return parseInt(P, 16);
3024
+ if (y.test(P))
3025
+ return parseInt(P, 8);
3026
+ throw j(P, "id");
3027
+ }
3028
+ function Re() {
3029
+ if (D !== void 0)
3030
+ throw j("package");
3031
+ if (D = b(), !x.test(D))
3032
+ throw j(D, "name");
3033
+ $ = $.define(D), T(";");
3027
3034
  }
3028
3035
  function ue() {
3029
- if (I !== void 0)
3030
- throw U("package");
3031
- if (I = b(), !k.test(I))
3032
- throw U(I, "name");
3033
- z = z.define(I), A(";");
3034
- }
3035
- function he() {
3036
- var C = E(), x;
3037
- switch (C) {
3036
+ var P = k(), C;
3037
+ switch (P) {
3038
3038
  case "weak":
3039
- x = B || (B = []), b();
3039
+ C = W || (W = []), b();
3040
3040
  break;
3041
3041
  case "public":
3042
3042
  b();
3043
3043
  // eslint-disable-next-line no-fallthrough
3044
3044
  default:
3045
- x = V || (V = []);
3045
+ C = L || (L = []);
3046
3046
  break;
3047
3047
  }
3048
- C = re(), A(";"), x.push(C);
3048
+ P = re(), T(";"), C.push(P);
3049
3049
  }
3050
- function we() {
3051
- if (A("="), $ = re(), $ < 2023)
3052
- throw U($, "syntax");
3053
- A(";");
3050
+ function he() {
3051
+ if (T("="), J = re(), J < 2023)
3052
+ throw j(J, "syntax");
3053
+ T(";");
3054
3054
  }
3055
- function _e() {
3056
- if (A("="), $ = re(), !["2023"].includes($))
3057
- throw U($, "edition");
3058
- A(";");
3055
+ function we() {
3056
+ if (T("="), J = re(), !["2023"].includes(J))
3057
+ throw j(J, "edition");
3058
+ T(";");
3059
3059
  }
3060
- function Re(C, x) {
3061
- switch (x) {
3060
+ function ge(P, C) {
3061
+ switch (C) {
3062
3062
  case "option":
3063
- return pe(C, x), A(";"), !0;
3063
+ return pe(P, C), T(";"), !0;
3064
3064
  case "message":
3065
- return ke(C, x), !0;
3065
+ return ke(P, C), !0;
3066
3066
  case "enum":
3067
- return se(C, x), !0;
3067
+ return ae(P, C), !0;
3068
3068
  case "service":
3069
- return Ee(C, x), !0;
3069
+ return Ee(P, C), !0;
3070
3070
  case "extend":
3071
- return Ce(C, x), !0;
3071
+ return Ce(P, C), !0;
3072
3072
  }
3073
3073
  return !1;
3074
3074
  }
3075
- function me(C, x, p) {
3076
- var _ = W.line;
3077
- if (C && (typeof C.comment != "string" && (C.comment = w()), C.filename = R.filename), A("{", !0)) {
3078
- for (var q; (q = b()) !== "}"; )
3079
- x(q);
3080
- A(";", !0);
3075
+ function me(P, C, p) {
3076
+ var w = V.line;
3077
+ if (P && (typeof P.comment != "string" && (P.comment = A()), P.filename = _.filename), T("{", !0)) {
3078
+ for (var O; (O = b()) !== "}"; )
3079
+ C(O);
3080
+ T(";", !0);
3081
3081
  } else
3082
- p && p(), A(";"), C && (typeof C.comment != "string" || L) && (C.comment = w(_) || C.comment);
3083
- }
3084
- function ke(C, x) {
3085
- if (!O.test(x = b()))
3086
- throw U(x, "type name");
3087
- var p = new v(x);
3088
- me(p, function(q) {
3089
- if (!Re(p, q))
3090
- switch (q) {
3082
+ p && p(), T(";"), P && (typeof P.comment != "string" || B) && (P.comment = A(w) || P.comment);
3083
+ }
3084
+ function ke(P, C) {
3085
+ if (!S.test(C = b()))
3086
+ throw j(C, "type name");
3087
+ var p = new v(C);
3088
+ me(p, function(O) {
3089
+ if (!ge(p, O))
3090
+ switch (O) {
3091
3091
  case "map":
3092
3092
  Oe(p);
3093
3093
  break;
3094
3094
  case "required":
3095
- if ($ !== "proto2")
3096
- throw U(q);
3095
+ if (J !== "proto2")
3096
+ throw j(O);
3097
3097
  /* eslint-disable no-fallthrough */
3098
3098
  case "repeated":
3099
- fe(p, q);
3099
+ de(p, O);
3100
3100
  break;
3101
3101
  case "optional":
3102
- if ($ === "proto3")
3103
- fe(p, "proto3_optional");
3102
+ if (J === "proto3")
3103
+ de(p, "proto3_optional");
3104
3104
  else {
3105
- if ($ !== "proto2")
3106
- throw U(q);
3107
- fe(p, "optional");
3105
+ if (J !== "proto2")
3106
+ throw j(O);
3107
+ de(p, "optional");
3108
3108
  }
3109
3109
  break;
3110
3110
  case "oneof":
3111
- Te(p, q);
3111
+ Te(p, O);
3112
3112
  break;
3113
3113
  case "extensions":
3114
- ae(p.extensions || (p.extensions = []));
3114
+ fe(p.extensions || (p.extensions = []));
3115
3115
  break;
3116
3116
  case "reserved":
3117
- ae(p.reserved || (p.reserved = []), !0);
3117
+ fe(p.reserved || (p.reserved = []), !0);
3118
3118
  break;
3119
3119
  default:
3120
- if ($ === "proto2" || !k.test(q))
3121
- throw U(q);
3122
- T(q), fe(p, "optional");
3120
+ if (J === "proto2" || !x.test(O))
3121
+ throw j(O);
3122
+ q(O), de(p, "optional");
3123
3123
  break;
3124
3124
  }
3125
- }), C.add(p), C === z && D.push(p);
3125
+ }), P.add(p), P === $ && I.push(p);
3126
3126
  }
3127
- function fe(C, x, p) {
3128
- var _ = b();
3129
- if (_ === "group") {
3130
- Se(C, x);
3127
+ function de(P, C, p) {
3128
+ var w = b();
3129
+ if (w === "group") {
3130
+ Se(P, C);
3131
3131
  return;
3132
3132
  }
3133
- for (; _.endsWith(".") || E().startsWith("."); )
3134
- _ += b();
3135
- if (!k.test(_))
3136
- throw U(_, "type");
3137
- var q = b();
3138
- if (!O.test(q))
3139
- throw U(q, "name");
3140
- q = X(q), A("=");
3141
- var M = new l(q, ye(b()), _, x, p);
3133
+ for (; w.endsWith(".") || k().startsWith("."); )
3134
+ w += b();
3135
+ if (!x.test(w))
3136
+ throw j(w, "type");
3137
+ var O = b();
3138
+ if (!S.test(O))
3139
+ throw j(O, "name");
3140
+ O = U(O), T("=");
3141
+ var M = new l(O, ye(b()), w, C, p);
3142
3142
  if (me(M, function(Z) {
3143
3143
  if (Z === "option")
3144
- pe(M, Z), A(";");
3144
+ pe(M, Z), T(";");
3145
3145
  else
3146
- throw U(Z);
3146
+ throw j(Z);
3147
3147
  }, function() {
3148
- be(M);
3149
- }), x === "proto3_optional") {
3150
- var F = new i("_" + q);
3151
- M.setOption("proto3_optional", !0), F.add(M), C.add(F);
3148
+ _e(M);
3149
+ }), C === "proto3_optional") {
3150
+ var F = new i("_" + O);
3151
+ M.setOption("proto3_optional", !0), F.add(M), P.add(F);
3152
3152
  } else
3153
- C.add(M);
3154
- C === z && D.push(M);
3153
+ P.add(M);
3154
+ P === $ && I.push(M);
3155
3155
  }
3156
- function Se(C, x) {
3157
- if ($ >= 2023)
3158
- throw U("group");
3156
+ function Se(P, C) {
3157
+ if (J >= 2023)
3158
+ throw j("group");
3159
3159
  var p = b();
3160
- if (!O.test(p))
3161
- throw U(p, "name");
3162
- var _ = s.lcFirst(p);
3163
- p === _ && (p = s.ucFirst(p)), A("=");
3164
- var q = ye(b()), M = new v(p);
3160
+ if (!S.test(p))
3161
+ throw j(p, "name");
3162
+ var w = s.lcFirst(p);
3163
+ p === w && (p = s.ucFirst(p)), T("=");
3164
+ var O = ye(b()), M = new v(p);
3165
3165
  M.group = !0;
3166
- var F = new l(_, q, p, x);
3167
- F.filename = R.filename, me(M, function(Z) {
3166
+ var F = new l(w, O, p, C);
3167
+ F.filename = _.filename, me(M, function(Z) {
3168
3168
  switch (Z) {
3169
3169
  case "option":
3170
- pe(M, Z), A(";");
3170
+ pe(M, Z), T(";");
3171
3171
  break;
3172
3172
  case "required":
3173
3173
  case "repeated":
3174
- fe(M, Z);
3174
+ de(M, Z);
3175
3175
  break;
3176
3176
  case "optional":
3177
- $ === "proto3" ? fe(M, "proto3_optional") : fe(M, "optional");
3177
+ J === "proto3" ? de(M, "proto3_optional") : de(M, "optional");
3178
3178
  break;
3179
3179
  case "message":
3180
3180
  ke(M, Z);
3181
3181
  break;
3182
3182
  case "enum":
3183
- se(M, Z);
3183
+ ae(M, Z);
3184
3184
  break;
3185
3185
  case "reserved":
3186
- ae(M.reserved || (M.reserved = []), !0);
3186
+ fe(M.reserved || (M.reserved = []), !0);
3187
3187
  break;
3188
3188
  /* istanbul ignore next */
3189
3189
  default:
3190
- throw U(Z);
3190
+ throw j(Z);
3191
3191
  }
3192
- }), C.add(M).add(F);
3193
- }
3194
- function Oe(C) {
3195
- A("<");
3196
- var x = b();
3197
- if (d.mapKey[x] === void 0)
3198
- throw U(x, "type");
3199
- A(",");
3192
+ }), P.add(M).add(F);
3193
+ }
3194
+ function Oe(P) {
3195
+ T("<");
3196
+ var C = b();
3197
+ if (d.mapKey[C] === void 0)
3198
+ throw j(C, "type");
3199
+ T(",");
3200
3200
  var p = b();
3201
- if (!k.test(p))
3202
- throw U(p, "type");
3203
- A(">");
3204
- var _ = b();
3205
- if (!O.test(_))
3206
- throw U(_, "name");
3207
- A("=");
3208
- var q = new a(X(_), ye(b()), x, p);
3209
- me(q, function(F) {
3201
+ if (!x.test(p))
3202
+ throw j(p, "type");
3203
+ T(">");
3204
+ var w = b();
3205
+ if (!S.test(w))
3206
+ throw j(w, "name");
3207
+ T("=");
3208
+ var O = new a(U(w), ye(b()), C, p);
3209
+ me(O, function(F) {
3210
3210
  if (F === "option")
3211
- pe(q, F), A(";");
3211
+ pe(O, F), T(";");
3212
3212
  else
3213
- throw U(F);
3213
+ throw j(F);
3214
3214
  }, function() {
3215
- be(q);
3216
- }), C.add(q);
3217
- }
3218
- function Te(C, x) {
3219
- if (!O.test(x = b()))
3220
- throw U(x, "name");
3221
- var p = new i(X(x));
3222
- me(p, function(q) {
3223
- q === "option" ? (pe(p, q), A(";")) : (T(q), fe(p, "optional"));
3224
- }), C.add(p);
3225
- }
3226
- function se(C, x) {
3227
- if (!O.test(x = b()))
3228
- throw U(x, "name");
3229
- var p = new e(x);
3230
- me(p, function(q) {
3231
- switch (q) {
3215
+ _e(O);
3216
+ }), P.add(O);
3217
+ }
3218
+ function Te(P, C) {
3219
+ if (!S.test(C = b()))
3220
+ throw j(C, "name");
3221
+ var p = new i(U(C));
3222
+ me(p, function(O) {
3223
+ O === "option" ? (pe(p, O), T(";")) : (q(O), de(p, "optional"));
3224
+ }), P.add(p);
3225
+ }
3226
+ function ae(P, C) {
3227
+ if (!S.test(C = b()))
3228
+ throw j(C, "name");
3229
+ var p = new e(C);
3230
+ me(p, function(O) {
3231
+ switch (O) {
3232
3232
  case "option":
3233
- pe(p, q), A(";");
3233
+ pe(p, O), T(";");
3234
3234
  break;
3235
3235
  case "reserved":
3236
- ae(p.reserved || (p.reserved = []), !0), p.reserved === void 0 && (p.reserved = []);
3236
+ fe(p.reserved || (p.reserved = []), !0), p.reserved === void 0 && (p.reserved = []);
3237
3237
  break;
3238
3238
  default:
3239
- ge(p, q);
3239
+ be(p, O);
3240
3240
  }
3241
- }), C.add(p), C === z && D.push(p);
3241
+ }), P.add(p), P === $ && I.push(p);
3242
3242
  }
3243
- function ge(C, x) {
3244
- if (!O.test(x))
3245
- throw U(x, "name");
3246
- A("=");
3247
- var p = ye(b(), !0), _ = {
3243
+ function be(P, C) {
3244
+ if (!S.test(C))
3245
+ throw j(C, "name");
3246
+ T("=");
3247
+ var p = ye(b(), !0), w = {
3248
3248
  options: void 0
3249
3249
  };
3250
- _.getOption = function(q) {
3251
- return this.options[q];
3252
- }, _.setOption = function(q, M) {
3253
- n.prototype.setOption.call(_, q, M);
3254
- }, _.setParsedOption = function() {
3255
- }, me(_, function(M) {
3250
+ w.getOption = function(O) {
3251
+ return this.options[O];
3252
+ }, w.setOption = function(O, M) {
3253
+ n.prototype.setOption.call(w, O, M);
3254
+ }, w.setParsedOption = function() {
3255
+ }, me(w, function(M) {
3256
3256
  if (M === "option")
3257
- pe(_, M), A(";");
3257
+ pe(w, M), T(";");
3258
3258
  else
3259
- throw U(M);
3259
+ throw j(M);
3260
3260
  }, function() {
3261
- be(_);
3262
- }), C.add(x, p, _.comment, _.parsedOptions || _.options);
3261
+ _e(w);
3262
+ }), P.add(C, p, w.comment, w.parsedOptions || w.options);
3263
3263
  }
3264
- function pe(C, x) {
3265
- var p, _, q = !0;
3266
- for (x === "option" && (x = b()); x !== "="; ) {
3267
- if (x === "(") {
3264
+ function pe(P, C) {
3265
+ var p, w, O = !0;
3266
+ for (C === "option" && (C = b()); C !== "="; ) {
3267
+ if (C === "(") {
3268
3268
  var M = b();
3269
- A(")"), x = "(" + M + ")";
3269
+ T(")"), C = "(" + M + ")";
3270
3270
  }
3271
- if (q) {
3272
- if (q = !1, x.includes(".") && !x.includes("(")) {
3273
- var F = x.split(".");
3274
- p = F[0] + ".", x = F[1];
3271
+ if (O) {
3272
+ if (O = !1, C.includes(".") && !C.includes("(")) {
3273
+ var F = C.split(".");
3274
+ p = F[0] + ".", C = F[1];
3275
3275
  continue;
3276
3276
  }
3277
- p = x;
3277
+ p = C;
3278
3278
  } else
3279
- _ = _ ? _ += x : x;
3280
- x = b();
3279
+ w = w ? w += C : C;
3280
+ C = b();
3281
3281
  }
3282
- var H = _ ? p.concat(_) : p, Z = qe(C, H);
3283
- _ = _ && _[0] === "." ? _.slice(1) : _, p = p && p[p.length - 1] === "." ? p.slice(0, -1) : p, ve(C, p, Z, _);
3284
- }
3285
- function qe(C, x) {
3286
- if (A("{", !0)) {
3287
- for (var p = {}; !A("}", !0); ) {
3288
- if (!O.test(ie = b()))
3289
- throw U(ie, "name");
3282
+ var G = w ? p.concat(w) : p, Z = qe(P, G);
3283
+ w = w && w[0] === "." ? w.slice(1) : w, p = p && p[p.length - 1] === "." ? p.slice(0, -1) : p, ve(P, p, Z, w);
3284
+ }
3285
+ function qe(P, C) {
3286
+ if (T("{", !0)) {
3287
+ for (var p = {}; !T("}", !0); ) {
3288
+ if (!S.test(ie = b()))
3289
+ throw j(ie, "name");
3290
3290
  if (ie === null)
3291
- throw U(ie, "end of input");
3292
- var _, q = ie;
3293
- if (A(":", !0), E() === "{")
3294
- _ = qe(C, x + "." + ie);
3295
- else if (E() === "[") {
3296
- _ = [];
3291
+ throw j(ie, "end of input");
3292
+ var w, O = ie;
3293
+ if (T(":", !0), k() === "{")
3294
+ w = qe(P, C + "." + ie);
3295
+ else if (k() === "[") {
3296
+ w = [];
3297
3297
  var M;
3298
- if (A("[", !0)) {
3298
+ if (T("[", !0)) {
3299
3299
  do
3300
- M = le(), _.push(M);
3301
- while (A(",", !0));
3302
- A("]"), typeof M < "u" && Ae(C, x + "." + ie, M);
3300
+ M = se(), w.push(M);
3301
+ while (T(",", !0));
3302
+ T("]"), typeof M < "u" && Ae(P, C + "." + ie, M);
3303
3303
  }
3304
3304
  } else
3305
- _ = le(), Ae(C, x + "." + ie, _);
3306
- var F = p[q];
3307
- F && (_ = [].concat(F).concat(_)), p[q] = _, A(",", !0), A(";", !0);
3305
+ w = se(), Ae(P, C + "." + ie, w);
3306
+ var F = p[O];
3307
+ F && (w = [].concat(F).concat(w)), p[O] = w, T(",", !0), T(";", !0);
3308
3308
  }
3309
3309
  return p;
3310
3310
  }
3311
- var H = le();
3312
- return Ae(C, x, H), H;
3311
+ var G = se();
3312
+ return Ae(P, C, G), G;
3313
3313
  }
3314
- function Ae(C, x, p) {
3315
- if (z === C && /^features\./.test(x)) {
3316
- Y[x] = p;
3314
+ function Ae(P, C, p) {
3315
+ if ($ === P && /^features\./.test(C)) {
3316
+ Y[C] = p;
3317
3317
  return;
3318
3318
  }
3319
- C.setOption && C.setOption(x, p);
3319
+ P.setOption && P.setOption(C, p);
3320
3320
  }
3321
- function ve(C, x, p, _) {
3322
- C.setParsedOption && C.setParsedOption(x, p, _);
3321
+ function ve(P, C, p, w) {
3322
+ P.setParsedOption && P.setParsedOption(C, p, w);
3323
3323
  }
3324
- function be(C) {
3325
- if (A("[", !0)) {
3324
+ function _e(P) {
3325
+ if (T("[", !0)) {
3326
3326
  do
3327
- pe(C, "option");
3328
- while (A(",", !0));
3329
- A("]");
3327
+ pe(P, "option");
3328
+ while (T(",", !0));
3329
+ T("]");
3330
3330
  }
3331
- return C;
3332
- }
3333
- function Ee(C, x) {
3334
- if (!O.test(x = b()))
3335
- throw U(x, "service name");
3336
- var p = new t(x);
3337
- me(p, function(q) {
3338
- if (!Re(p, q))
3339
- if (q === "rpc")
3340
- xe(p, q);
3331
+ return P;
3332
+ }
3333
+ function Ee(P, C) {
3334
+ if (!S.test(C = b()))
3335
+ throw j(C, "service name");
3336
+ var p = new t(C);
3337
+ me(p, function(O) {
3338
+ if (!ge(p, O))
3339
+ if (O === "rpc")
3340
+ xe(p, O);
3341
3341
  else
3342
- throw U(q);
3343
- }), C.add(p), C === z && D.push(p);
3344
- }
3345
- function xe(C, x) {
3346
- var p = w(), _ = x;
3347
- if (!O.test(x = b()))
3348
- throw U(x, "name");
3349
- var q = x, M, F, H, Z;
3350
- if (A("("), A("stream", !0) && (F = !0), !k.test(x = b()) || (M = x, A(")"), A("returns"), A("("), A("stream", !0) && (Z = !0), !k.test(x = b())))
3351
- throw U(x);
3352
- H = x, A(")");
3353
- var Q = new r(q, _, M, H, F, Z);
3342
+ throw j(O);
3343
+ }), P.add(p), P === $ && I.push(p);
3344
+ }
3345
+ function xe(P, C) {
3346
+ var p = A(), w = C;
3347
+ if (!S.test(C = b()))
3348
+ throw j(C, "name");
3349
+ var O = C, M, F, G, Z;
3350
+ if (T("("), T("stream", !0) && (F = !0), !x.test(C = b()) || (M = C, T(")"), T("returns"), T("("), T("stream", !0) && (Z = !0), !x.test(C = b())))
3351
+ throw j(C);
3352
+ G = C, T(")");
3353
+ var Q = new r(O, w, M, G, F, Z);
3354
3354
  Q.comment = p, me(Q, function(K) {
3355
3355
  if (K === "option")
3356
- pe(Q, K), A(";");
3356
+ pe(Q, K), T(";");
3357
3357
  else
3358
- throw U(K);
3359
- }), C.add(Q);
3360
- }
3361
- function Ce(C, x) {
3362
- if (!k.test(x = b()))
3363
- throw U(x, "reference");
3364
- var p = x;
3365
- me(null, function(q) {
3366
- switch (q) {
3358
+ throw j(K);
3359
+ }), P.add(Q);
3360
+ }
3361
+ function Ce(P, C) {
3362
+ if (!x.test(C = b()))
3363
+ throw j(C, "reference");
3364
+ var p = C;
3365
+ me(null, function(O) {
3366
+ switch (O) {
3367
3367
  case "required":
3368
3368
  case "repeated":
3369
- fe(C, q, p);
3369
+ de(P, O, p);
3370
3370
  break;
3371
3371
  case "optional":
3372
- $ === "proto3" ? fe(C, "proto3_optional", p) : fe(C, "optional", p);
3372
+ J === "proto3" ? de(P, "proto3_optional", p) : de(P, "optional", p);
3373
3373
  break;
3374
3374
  default:
3375
- if ($ === "proto2" || !k.test(q))
3376
- throw U(q);
3377
- T(q), fe(C, "optional", p);
3375
+ if (J === "proto2" || !x.test(O))
3376
+ throw j(O);
3377
+ q(O), de(P, "optional", p);
3378
3378
  break;
3379
3379
  }
3380
3380
  });
@@ -3382,40 +3382,40 @@ function requireParse() {
3382
3382
  for (var ie; (ie = b()) !== null; )
3383
3383
  switch (ie) {
3384
3384
  case "package":
3385
- if (!N)
3386
- throw U(ie);
3387
- ue();
3385
+ if (!E)
3386
+ throw j(ie);
3387
+ Re();
3388
3388
  break;
3389
3389
  case "import":
3390
- if (!N)
3391
- throw U(ie);
3392
- he();
3390
+ if (!E)
3391
+ throw j(ie);
3392
+ ue();
3393
3393
  break;
3394
3394
  case "syntax":
3395
- if (!N)
3396
- throw U(ie);
3397
- we();
3395
+ if (!E)
3396
+ throw j(ie);
3397
+ he();
3398
3398
  break;
3399
3399
  case "edition":
3400
- if (!N)
3401
- throw U(ie);
3402
- _e();
3400
+ if (!E)
3401
+ throw j(ie);
3402
+ we();
3403
3403
  break;
3404
3404
  case "option":
3405
- pe(z, ie), A(";", !0);
3405
+ pe($, ie), T(";", !0);
3406
3406
  break;
3407
3407
  default:
3408
- if (Re(z, ie)) {
3409
- N = !1;
3408
+ if (ge($, ie)) {
3409
+ E = !1;
3410
3410
  continue;
3411
3411
  }
3412
- throw U(ie);
3412
+ throw j(ie);
3413
3413
  }
3414
- return de(), R.filename = null, {
3415
- package: I,
3416
- imports: V,
3417
- weakImports: B,
3418
- root: j
3414
+ return ce(), _.filename = null, {
3415
+ package: D,
3416
+ imports: L,
3417
+ weakImports: W,
3418
+ root: z
3419
3419
  };
3420
3420
  }
3421
3421
  return parse_1;
@@ -3811,217 +3811,217 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
3811
3811
  }
3812
3812
  }
3813
3813
  }, i = protobuf.Root.fromJSON(l).TimeSeriesMessage;
3814
- let e = null, t = null, r = null, n = null, d = null, s = null, u = !1, o = null;
3815
- const h = (w, N = 2e3) => new Promise((I) => {
3816
- if (!w || w.readyState === WebSocket.CLOSED) {
3817
- I();
3814
+ let e = null, t = null, r = null, n = null, d = null, s = null, u = "viewerAsset", o = !1, h = null;
3815
+ const m = (E, D = 2e3) => new Promise((L) => {
3816
+ if (!E || E.readyState === WebSocket.CLOSED) {
3817
+ L();
3818
3818
  return;
3819
3819
  }
3820
- const V = Date.now(), B = () => {
3821
- w.readyState === WebSocket.CLOSED || Date.now() - V > N ? I() : setTimeout(B, 50);
3820
+ const W = Date.now(), J = () => {
3821
+ E.readyState === WebSocket.CLOSED || Date.now() - W > D ? L() : setTimeout(J, 50);
3822
3822
  };
3823
- B();
3824
- }), m = async () => {
3823
+ J();
3824
+ }), R = async () => {
3825
3825
  if (f.value) {
3826
- const w = f.value;
3827
- f.value = null, c.value = "disconnected", (w.readyState === WebSocket.OPEN || w.readyState === WebSocket.CONNECTING) && (w.close(), await h(w));
3826
+ const E = f.value;
3827
+ f.value = null, c.value = "disconnected", (E.readyState === WebSocket.OPEN || E.readyState === WebSocket.CONNECTING) && (E.close(), await m(E));
3828
3828
  }
3829
- o = null;
3830
- }, S = async (w, N, I) => {
3831
- if (o && await o, f.value) {
3832
- const V = f.value.readyState;
3833
- (V === WebSocket.CONNECTING || V === WebSocket.OPEN || V === WebSocket.CLOSING) && (await m(), await new Promise((B) => setTimeout(B, 100)));
3829
+ h = null;
3830
+ }, y = async (E, D, L, W = "viewerAsset") => {
3831
+ if (h && await h, f.value) {
3832
+ const J = f.value.readyState;
3833
+ (J === WebSocket.CONNECTING || J === WebSocket.OPEN || J === WebSocket.CLOSING) && (await R(), await new Promise(($) => setTimeout($, 100)));
3834
3834
  }
3835
- s = N, v.value = !0, o = new Promise(async (V, B) => {
3835
+ s = D, u = W, v.value = !0, h = new Promise(async (J, $) => {
3836
3836
  try {
3837
- const $ = I || await useToken(), z = w + "?session=" + $ + "&package=" + s, D = new WebSocket(z);
3838
- f.value = D, D.onopen = () => {
3839
- y(), V(D);
3840
- }, D.onclose = () => {
3841
- g(), V(null);
3842
- }, D.onmessage = O, D.onerror = (Y) => {
3843
- console.error("WebSocket error:", Y), c.value = "disconnected", B(Y);
3837
+ const I = L || await useToken(), Y = E + "?session=" + I + "&" + u + "=" + s, U = new WebSocket(Y);
3838
+ f.value = U, U.onopen = () => {
3839
+ g(), J(U);
3840
+ }, U.onclose = () => {
3841
+ S(), J(null);
3842
+ }, U.onmessage = x, U.onerror = (ce) => {
3843
+ console.error("WebSocket error:", ce), c.value = "disconnected", $(ce);
3844
3844
  }, setTimeout(() => {
3845
- D.readyState === WebSocket.CONNECTING && (D.close(), B(new Error("WebSocket connection timeout")));
3845
+ U.readyState === WebSocket.CONNECTING && (U.close(), $(new Error("WebSocket connection timeout")));
3846
3846
  }, 1e4);
3847
- } catch ($) {
3848
- console.error("Failed to create WebSocket:", $), B($);
3847
+ } catch (I) {
3848
+ console.error("Failed to create WebSocket:", I), $(I);
3849
3849
  }
3850
3850
  });
3851
3851
  try {
3852
- await o;
3853
- } catch (V) {
3854
- console.error("WebSocket connection failed:", V), o = null;
3852
+ await h;
3853
+ } catch (J) {
3854
+ console.error("WebSocket connection failed:", J), h = null;
3855
3855
  }
3856
- }, y = () => {
3856
+ }, g = () => {
3857
3857
  if (c.value = "connected", v.value) {
3858
3858
  if (d && d(), s) {
3859
- const w = { montage: "NOT_MONTAGED", packageId: s };
3860
- f.value.send(JSON.stringify(w));
3859
+ const E = { montage: "NOT_MONTAGED", packageId: s };
3860
+ f.value.send(JSON.stringify(E));
3861
3861
  }
3862
3862
  v.value = !1;
3863
3863
  }
3864
- }, g = () => {
3864
+ }, S = () => {
3865
3865
  c.value = "disconnected";
3866
- }, O = (w) => {
3867
- if (typeof w.data == "string") {
3868
- let I = {};
3866
+ }, x = (E) => {
3867
+ if (typeof E.data == "string") {
3868
+ let L = {};
3869
3869
  try {
3870
- I = JSON.parse(w.data);
3870
+ L = JSON.parse(E.data);
3871
3871
  } catch {
3872
3872
  n == null || n({ error: "JSON Parse Error" });
3873
3873
  return;
3874
3874
  }
3875
- I.channelDetails ? r == null || r(I.channelDetails) : I.error && (n == null || n(I));
3875
+ L.channelDetails ? r == null || r(L.channelDetails) : L.error && (n == null || n(L));
3876
3876
  return;
3877
3877
  }
3878
- const N = new FileReader();
3879
- N.addEventListener("loadend", function(I) {
3880
- const V = I.target.result, B = new Uint8Array(V), $ = i.decode(B), z = $.segment;
3878
+ const D = new FileReader();
3879
+ D.addEventListener("loadend", function(L) {
3880
+ const W = L.target.result, J = new Uint8Array(W), $ = i.decode(J), I = $.segment;
3881
3881
  if ($.event && $.event.length > 0 && $.event[0].pageStart) {
3882
- const D = $.event[0], Y = [[], []], X = D.times.length / 2;
3883
- let de = 0;
3884
- for (let ae = 0; ae < X; ae++)
3885
- Y[0].push(D.times[de]), Y[1].push(D.times[de + 1]), de += 2;
3886
- let U = new Array(3), re = 0;
3887
- for (; re < 3; )
3888
- U[re] = new Float32Array(Y[0].length), re++;
3889
- const le = {
3890
- chId: D.source,
3882
+ const Y = $.event[0], U = [[], []], ce = Y.times.length / 2;
3883
+ let j = 0;
3884
+ for (let oe = 0; oe < ce; oe++)
3885
+ U[0].push(Y.times[j]), U[1].push(Y.times[j + 1]), j += 2;
3886
+ let re = new Array(3), se = 0;
3887
+ for (; se < 3; )
3888
+ re[se] = new Float32Array(U[0].length), se++;
3889
+ const fe = {
3890
+ chId: Y.source,
3891
3891
  lastUsed: 0,
3892
3892
  unit: "uV",
3893
- samplePeriod: D.samplePeriod,
3894
- pageStart: D.pageStart,
3895
- pageEnd: D.pageEnd,
3896
- startTs: D.pageStart,
3897
- isMinMax: D.isResampled,
3893
+ samplePeriod: Y.samplePeriod,
3894
+ pageStart: Y.pageStart,
3895
+ pageEnd: Y.pageEnd,
3896
+ startTs: Y.pageStart,
3897
+ isMinMax: Y.isResampled,
3898
3898
  unitM: 1,
3899
3899
  type: "Neural",
3900
- nrPoints: X,
3901
- parsedData: Y,
3902
- cData: U
3900
+ nrPoints: ce,
3901
+ parsedData: U,
3902
+ cData: re
3903
3903
  };
3904
3904
  t == null || t({
3905
- pageStart: D.pageStart,
3906
- data: le,
3905
+ pageStart: Y.pageStart,
3906
+ data: fe,
3907
3907
  type: "Neural",
3908
3908
  nrResponses: $.totalResponses
3909
3909
  });
3910
3910
  }
3911
- if (z !== null) {
3912
- let D = null;
3913
- z.isMinMax ? D = z.data.length / 2 : D = z.data.length;
3914
- const Y = new Array(3), X = z.startTs;
3915
- let de = 0, U = 0, re = 0;
3916
- for (; re < 3; )
3917
- Y[re] = new Float64Array(D), re++;
3918
- if (z.isMinMax) {
3911
+ if (I !== null) {
3912
+ let Y = null;
3913
+ I.isMinMax ? Y = I.data.length / 2 : Y = I.data.length;
3914
+ const U = new Array(3), ce = I.startTs;
3915
+ let j = 0, re = 0, se = 0;
3916
+ for (; se < 3; )
3917
+ U[se] = new Float64Array(Y), se++;
3918
+ if (I.isMinMax) {
3919
3919
  let ue = 0;
3920
- for (let he = 0; he < D; he++) {
3921
- let we = -z.data[ue], _e = -z.data[ue + 1];
3922
- Y[0][he] = X + he * z.samplePeriod, Y[1][he] = we, Y[2][he] = _e, isNaN(we) || (U++, de += we + (_e - we) / 2), ue += 2;
3920
+ for (let he = 0; he < Y; he++) {
3921
+ let we = -I.data[ue], ge = -I.data[ue + 1];
3922
+ U[0][he] = ce + he * I.samplePeriod, U[1][he] = we, U[2][he] = ge, isNaN(we) || (re++, j += we + (ge - we) / 2), ue += 2;
3923
3923
  }
3924
3924
  } else
3925
- for (let ue = 0; ue < D; ue++) {
3926
- let he = -z.data[ue];
3927
- Y[0][ue] = X + ue * z.samplePeriod, Y[1][ue] = he, isNaN(he) || (U++, de += he);
3925
+ for (let ue = 0; ue < Y; ue++) {
3926
+ let he = -I.data[ue];
3927
+ U[0][ue] = ce + ue * I.samplePeriod, U[1][ue] = he, isNaN(he) || (re++, j += he);
3928
3928
  }
3929
- let le = 0;
3930
- if (u) {
3931
- const ue = Array.prototype.slice.call(Y[1]).sort();
3932
- le = ue[Math.round(ue.length / 2)];
3929
+ let fe = 0;
3930
+ if (o) {
3931
+ const ue = Array.prototype.slice.call(U[1]).sort();
3932
+ fe = ue[Math.round(ue.length / 2)];
3933
3933
  }
3934
- let ae = new Array(3), ce = 0;
3935
- for (; ce < 3; )
3936
- ae[ce] = new Float32Array(Y[0].length), ce++;
3937
- const ye = {
3938
- chId: z.source,
3939
- lastUsed: z.lastUsed,
3940
- unit: z.unit,
3941
- samplePeriod: z.samplePeriod,
3942
- pageStart: z.pageStart,
3943
- pageEnd: z.pageEnd,
3944
- startTs: X,
3945
- isMinMax: z.isMinMax,
3946
- unitM: z.unitM,
3947
- type: z.segmentType,
3948
- nrPoints: D,
3949
- cData: ae,
3950
- parsedData: Y,
3951
- median: le,
3952
- sumElem: de,
3953
- nrValidPoints: U,
3954
- name: z.channelName,
3955
- label: z.channelName
3934
+ let oe = new Array(3), ye = 0;
3935
+ for (; ye < 3; )
3936
+ oe[ye] = new Float32Array(U[0].length), ye++;
3937
+ const Re = {
3938
+ chId: I.source,
3939
+ lastUsed: I.lastUsed,
3940
+ unit: I.unit,
3941
+ samplePeriod: I.samplePeriod,
3942
+ pageStart: I.pageStart,
3943
+ pageEnd: I.pageEnd,
3944
+ startTs: ce,
3945
+ isMinMax: I.isMinMax,
3946
+ unitM: I.unitM,
3947
+ type: I.segmentType,
3948
+ nrPoints: Y,
3949
+ cData: oe,
3950
+ parsedData: U,
3951
+ median: fe,
3952
+ sumElem: j,
3953
+ nrValidPoints: re,
3954
+ name: I.channelName,
3955
+ label: I.channelName
3956
3956
  };
3957
- ye.nrPoints > 0 ? e == null || e({
3958
- pageStart: z.pageStart,
3959
- data: ye,
3960
- type: z.segmentType,
3957
+ Re.nrPoints > 0 ? e == null || e({
3958
+ pageStart: I.pageStart,
3959
+ data: Re,
3960
+ type: I.segmentType,
3961
3961
  nrResponses: $.totalResponses
3962
3962
  }) : e == null || e({
3963
- pageStart: z.pageStart,
3964
- data: ye,
3963
+ pageStart: I.pageStart,
3964
+ data: Re,
3965
3965
  nrResponses: $.totalResponses,
3966
3966
  type: "gap"
3967
3967
  });
3968
3968
  }
3969
- }), N.readAsArrayBuffer(w.data);
3970
- }, k = (w) => f.value && f.value.readyState === 1 ? (f.value.send(JSON.stringify(w)), !0) : !1, R = (w) => {
3971
- let N;
3972
- switch (w) {
3969
+ }), D.readAsArrayBuffer(E.data);
3970
+ }, _ = (E) => f.value && f.value.readyState === 1 ? (f.value.send(JSON.stringify(E)), !0) : !1, N = (E) => {
3971
+ let D;
3972
+ switch (E) {
3973
3973
  case "NOT_MONTAGED":
3974
- N = { montage: "NOT_MONTAGED", packageId: s };
3974
+ D = { montage: "NOT_MONTAGED", packageId: s };
3975
3975
  break;
3976
3976
  default:
3977
- N = { montage: "CUSTOM_MONTAGE", packageId: s, montageMap: w };
3977
+ D = { montage: "CUSTOM_MONTAGE", packageId: s, montageMap: E };
3978
3978
  }
3979
- k(N);
3980
- }, P = (w) => {
3981
- f.value && f.value.readyState === 1 ? f.value.send(JSON.stringify(w)) : setTimeout(() => P(w), 200);
3982
- }, j = () => {
3979
+ _(D);
3980
+ }, z = (E) => {
3981
+ f.value && f.value.readyState === 1 ? f.value.send(JSON.stringify(E)) : setTimeout(() => z(E), 200);
3982
+ }, H = () => {
3983
3983
  if (f.value && f.value.readyState === 1) {
3984
- const w = {
3984
+ const E = {
3985
3985
  requestType: "DumpBufferRequest"
3986
3986
  };
3987
- return f.value.send(JSON.stringify(w)), !0;
3987
+ return f.value.send(JSON.stringify(E)), !0;
3988
3988
  }
3989
3989
  return console.warn("⚠️ Cannot send dump buffer request - WebSocket not connected"), !1;
3990
- }, J = (w) => {
3991
- e = w;
3992
- }, L = (w) => {
3993
- t = w;
3994
- }, W = (w) => {
3995
- r = w;
3996
- }, b = (w) => {
3997
- n = w;
3990
+ }, B = (E) => {
3991
+ e = E;
3992
+ }, V = (E) => {
3993
+ t = E;
3994
+ }, b = (E) => {
3995
+ r = E;
3996
+ }, q = (E) => {
3997
+ n = E;
3998
3998
  };
3999
3999
  onUnmounted(async () => {
4000
- await m();
4000
+ await R();
4001
4001
  });
4002
- const T = (w) => {
4003
- d = w;
4004
- }, E = (w) => {
4005
- s = w;
4006
- }, A = (w) => {
4007
- u = w;
4002
+ const k = (E) => {
4003
+ d = E;
4004
+ }, T = (E) => {
4005
+ s = E;
4006
+ }, A = (E) => {
4007
+ o = E;
4008
4008
  };
4009
4009
  return {
4010
4010
  websocket: readonly(f),
4011
4011
  connectionStatus: readonly(c),
4012
- openWebsocket: S,
4013
- send: k,
4014
- sendMontageMessage: R,
4015
- sendFilterMessage: P,
4016
- sendDumpBufferRequest: j,
4017
- disconnect: m,
4018
- setClearChannelsCallback: T,
4019
- setPackageId: E,
4012
+ openWebsocket: y,
4013
+ send: _,
4014
+ sendMontageMessage: N,
4015
+ sendFilterMessage: z,
4016
+ sendDumpBufferRequest: H,
4017
+ disconnect: R,
4018
+ setClearChannelsCallback: k,
4019
+ setActiveId: T,
4020
4020
  setUseMedian: A,
4021
- onSegment: J,
4022
- onEvent: L,
4023
- onChannelDetails: W,
4024
- onError: b
4021
+ onSegment: B,
4022
+ onEvent: V,
4023
+ onChannelDetails: b,
4024
+ onError: q
4025
4025
  };
4026
4026
  }, useCanvasRenderer = () => {
4027
4027
  const f = ref(null), c = ref(null), v = (t, r, n) => r * (t + n), l = (t = 1) => t, a = (t, r, n, d, s, u, o = !1) => {
@@ -4036,84 +4036,84 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4036
4036
  return;
4037
4037
  }
4038
4038
  m.setTransform(u, 0, 0, u, 0, 0), m.fillStyle = "rgb(220,220,220)";
4039
- const S = f.value;
4040
- if (!S) {
4039
+ const R = f.value;
4040
+ if (!R) {
4041
4041
  console.warn("plotArea ref is missing, skipping drawing.");
4042
4042
  return;
4043
4043
  }
4044
- const y = S.getContext("2d");
4044
+ const y = R.getContext("2d");
4045
4045
  if (!y) {
4046
4046
  console.warn("Unable to get 2D context for plotArea, skipping drawing.");
4047
4047
  return;
4048
4048
  }
4049
4049
  y.setTransform(u, 0, 0, u, 0, 0), y.clearRect(0, 0, d.cWidth, d.cHeight), m.clearRect(0, 0, d.cWidth, d.cHeight);
4050
- const g = r.reduce((O, k) => k.visible ? O + 1 : O, 0);
4050
+ const g = r.reduce((S, x) => x.visible ? S + 1 : S, 0);
4051
4051
  i(r, d.pHeight, g), y.save();
4052
- for (let O in t.channels)
4053
- if (t.channels.hasOwnProperty(O)) {
4054
- const k = t.channels[O];
4055
- let R = null;
4056
- if (R = r.find((w) => w.id === k.id), !R || !R.visible)
4052
+ for (let S in t.channels)
4053
+ if (t.channels.hasOwnProperty(S)) {
4054
+ const x = t.channels[S];
4055
+ let _ = null;
4056
+ if (_ = r.find((A) => A.id === x.id), !_ || !_.visible)
4057
4057
  continue;
4058
- const P = d.start, j = d.rsPeriod, J = n.XOFFSET, L = Math.min(Math.round(d.cHeight / t.channels.length - 2), 10);
4059
- for (let w = 0; w < R.dataSegments.length; w += 2) {
4060
- if (R.dataSegments[w + 1] < P)
4058
+ const N = d.start, z = d.rsPeriod, H = n.XOFFSET, B = Math.min(Math.round(d.cHeight / t.channels.length - 2), 10);
4059
+ for (let A = 0; A < _.dataSegments.length; A += 2) {
4060
+ if (_.dataSegments[A + 1] < N)
4061
4061
  continue;
4062
- if (R.dataSegments[w] > P + d.duration)
4062
+ if (_.dataSegments[A] > N + d.duration)
4063
4063
  break;
4064
- let N = Math.floor(J + (R.dataSegments[w] - P) / j), I = Math.floor(J + (R.dataSegments[w + 1] - P) / j), V = Math.floor(R.rowBaseline - L / 2);
4065
- m.fillRect(N, V, I - N, L);
4064
+ let E = Math.floor(H + (_.dataSegments[A] - N) / z), D = Math.floor(H + (_.dataSegments[A + 1] - N) / z), L = Math.floor(_.rowBaseline - B / 2);
4065
+ m.fillRect(E, L, D - E, B);
4066
4066
  }
4067
- e(R, k, d, n, s, o);
4068
- const W = k.blocks.length;
4067
+ e(_, x, d, n, s, o);
4068
+ const V = x.blocks.length;
4069
4069
  let b = "Continuous";
4070
- W && (b = k.blocks[0].type), R.hover ? R.selected ? (y.strokeStyle = "rgba(39,96,255,0.70)", y.fillStyle = "rgba(39,96,255,0.70)") : (y.strokeStyle = "rgba(39,96,255,0.60)", y.fillStyle = "rgba(39,96,255,0.60)") : R.selected ? (y.strokeStyle = "rgb(249,162,58)", y.fillStyle = "rgb(3249,162,58)") : b === "Neural" ? y.strokeStyle = "rgb(249,162,58)" : (y.strokeStyle = "black", y.fillStyle = "black");
4071
- let T = null, E = !0, A = 1e6 * (1 / R.sf);
4072
- for (let w = 0; w < W; w++) {
4073
- const N = k.blocks[w];
4074
- if (N.nrPoints === 0)
4070
+ V && (b = x.blocks[0].type), _.hover ? _.selected ? (y.strokeStyle = "rgba(39,96,255,0.70)", y.fillStyle = "rgba(39,96,255,0.70)") : (y.strokeStyle = "rgba(39,96,255,0.60)", y.fillStyle = "rgba(39,96,255,0.60)") : _.selected ? (y.strokeStyle = "rgb(249,162,58)", y.fillStyle = "rgb(3249,162,58)") : b === "Neural" ? y.strokeStyle = "rgb(249,162,58)" : (y.strokeStyle = "black", y.fillStyle = "black");
4071
+ let q = null, k = !0, T = 1e6 * (1 / _.sf);
4072
+ for (let A = 0; A < V; A++) {
4073
+ const E = x.blocks[A];
4074
+ if (E.nrPoints === 0)
4075
4075
  continue;
4076
- const I = N.cData, V = N.nrPoints, B = I[0], $ = I[1], z = I[2];
4077
- let D = N.renderStartIndex, Y = N.renderEndIndex;
4078
- switch (m.clearRect(Math.floor(B[D]), Math.floor(R.rowBaseline - L / 2), Math.ceil(B[Y] - B[D] + 2), L + 1), N.type) {
4076
+ const D = E.cData, L = E.nrPoints, W = D[0], J = D[1], $ = D[2];
4077
+ let I = E.renderStartIndex, Y = E.renderEndIndex;
4078
+ switch (m.clearRect(Math.floor(W[I]), Math.floor(_.rowBaseline - B / 2), Math.ceil(W[Y] - W[I] + 2), B + 1), E.type) {
4079
4079
  case "Continuous":
4080
4080
  case "realtime":
4081
- if (N.isMinMax) {
4082
- if (N.samplePeriod / A < 3 && (E = !1), E) {
4083
- y.beginPath(), w > 0 && B[D] < T.x + 3 ? y.moveTo(T.x, T.y) : y.moveTo(B[D], $[D]);
4084
- for (let X = D; X < Y + 1; X++)
4085
- y.lineTo(B[X], $[X]);
4086
- for (let X = Y - 1; X >= D; X--)
4087
- y.lineTo(B[X], z[X]);
4088
- w > 0 && B[D] < T.x + 3 && y.lineTo(T.x, T.y2), y.closePath(), y.fill();
4081
+ if (E.isMinMax) {
4082
+ if (E.samplePeriod / T < 3 && (k = !1), k) {
4083
+ y.beginPath(), A > 0 && W[I] < q.x + 3 ? y.moveTo(q.x, q.y) : y.moveTo(W[I], J[I]);
4084
+ for (let U = I; U < Y + 1; U++)
4085
+ y.lineTo(W[U], J[U]);
4086
+ for (let U = Y - 1; U >= I; U--)
4087
+ y.lineTo(W[U], $[U]);
4088
+ A > 0 && W[I] < q.x + 3 && y.lineTo(q.x, q.y2), y.closePath(), y.fill();
4089
4089
  } else {
4090
4090
  y.beginPath();
4091
- for (let X = D; X < Y + 1; X++)
4092
- y.lineTo(B[X], $[X]), y.lineTo(B[X], z[X]), y.moveTo(B[X], $[X]);
4091
+ for (let U = I; U < Y + 1; U++)
4092
+ y.lineTo(W[U], J[U]), y.lineTo(W[U], $[U]), y.moveTo(W[U], J[U]);
4093
4093
  y.stroke();
4094
4094
  }
4095
- y.beginPath(), y.moveTo(B[D], $[D]);
4096
- for (let X = D; X < Y + 1; X++)
4097
- y.lineTo(B[X], $[X]);
4095
+ y.beginPath(), y.moveTo(W[I], J[I]);
4096
+ for (let U = I; U < Y + 1; U++)
4097
+ y.lineTo(W[U], J[U]);
4098
4098
  y.stroke();
4099
4099
  } else {
4100
- w === 0 ? (y.beginPath(), y.moveTo(B[D], $[D])) : B[D] > T.x + 2 && y.moveTo(B[D], $[D]);
4101
- for (let X = D; X < Y + 1; X++)
4102
- y.lineTo(B[X], $[X]);
4103
- w === W - 1 && y.stroke();
4100
+ A === 0 ? (y.beginPath(), y.moveTo(W[I], J[I])) : W[I] > q.x + 2 && y.moveTo(W[I], J[I]);
4101
+ for (let U = I; U < Y + 1; U++)
4102
+ y.lineTo(W[U], J[U]);
4103
+ A === V - 1 && y.stroke();
4104
4104
  }
4105
4105
  break;
4106
4106
  case "Neural":
4107
4107
  y.beginPath();
4108
- for (let X = 0; X < V; X++)
4109
- y.moveTo(B[X], $[X]), y.lineTo(B[X], z[X]);
4108
+ for (let U = 0; U < L; U++)
4109
+ y.moveTo(W[U], J[U]), y.lineTo(W[U], $[U]);
4110
4110
  y.stroke();
4111
4111
  break;
4112
4112
  }
4113
- T = {
4114
- x: B[V - 1],
4115
- y: $[V - 1],
4116
- y2: z[V - 1]
4113
+ q = {
4114
+ x: W[L - 1],
4115
+ y: J[L - 1],
4116
+ y2: $[L - 1]
4117
4117
  };
4118
4118
  }
4119
4119
  }
@@ -4139,9 +4139,9 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4139
4139
  case "UNIT":
4140
4140
  if (!u)
4141
4141
  for (let m = 0; m < o; m++) {
4142
- const S = r.blocks[m], y = S.cData, g = S.parsedData, O = d.XOFFSET, k = S.parsedData[0].length, R = y[0], P = y[1], j = y[2], J = g[0], L = t.rowBaseline | 0, W = n.start, b = n.rsPeriod, T = n.cHeight / (2 * (n.nrVisibleChannels + 1)) | 0;
4143
- for (let E = 0; E < k; E++)
4144
- R[E] = O + (J[E] - W) / b, P[E] = L - T, j[E] = L + T;
4142
+ const R = r.blocks[m], y = R.cData, g = R.parsedData, S = d.XOFFSET, x = R.parsedData[0].length, _ = y[0], N = y[1], z = y[2], H = g[0], B = t.rowBaseline | 0, V = n.start, b = n.rsPeriod, q = n.cHeight / (2 * (n.nrVisibleChannels + 1)) | 0;
4143
+ for (let k = 0; k < x; k++)
4144
+ _[k] = S + (H[k] - V) / b, N[k] = B - q, z[k] = B + q;
4145
4145
  }
4146
4146
  break;
4147
4147
  case "CONTINUOUS":
@@ -4149,22 +4149,22 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4149
4149
  if (!u) {
4150
4150
  r.mean = 0, r.median = 0;
4151
4151
  for (let m = 0; m < o; m++) {
4152
- const S = r.blocks[m];
4153
- S.nrValidPoints > 0 && (r.mean = (S.sumElem + h * r.mean) / (h + S.nrValidPoints), r.median = (S.median + h * r.median) / (h + S.nrValidPoints), h += S.nrValidPoints);
4152
+ const R = r.blocks[m];
4153
+ R.nrValidPoints > 0 && (r.mean = (R.sumElem + h * r.mean) / (h + R.nrValidPoints), r.median = (R.median + h * r.median) / (h + R.nrValidPoints), h += R.nrValidPoints);
4154
4154
  }
4155
4155
  }
4156
4156
  for (let m = 0; m < o; m++) {
4157
- const S = r.blocks[m];
4158
- let y = Math.floor((n.start - S.startTs) / S.samplePeriod);
4159
- S.renderStartIndex = y > 0 ? y : 0;
4160
- let g = Math.floor((n.start + n.duration - (S.startTs + S.nrPoints * S.samplePeriod)) / S.samplePeriod);
4161
- S.renderEndIndex = g >= 0 ? S.nrPoints - 1 : S.nrPoints + g;
4162
- const O = S.cData, k = S.parsedData, R = s * t.rowScale, P = d.XOFFSET, j = S.parsedData[0].length, J = O[0], L = O[1], W = O[2], b = k[0], T = k[1], E = k[2], A = t.rowBaseline;
4163
- let w = 0;
4164
- d.USEMEDIAN ? w = r.median : w = r.mean;
4165
- const N = n.rsPeriod, I = n.start;
4166
- for (let V = 0; V < j; V++)
4167
- J[V] = P + (b[V] - I) / N, L[V] = A - (T[V] - w) * R, S.isMinMax && (T[V] === E[V] ? W[V] = L[V] + 1 : W[V] = A - (E[V] - w) * R);
4157
+ const R = r.blocks[m];
4158
+ let y = Math.floor((n.start - R.startTs) / R.samplePeriod);
4159
+ R.renderStartIndex = y > 0 ? y : 0;
4160
+ let g = Math.floor((n.start + n.duration - (R.startTs + R.nrPoints * R.samplePeriod)) / R.samplePeriod);
4161
+ R.renderEndIndex = g >= 0 ? R.nrPoints - 1 : R.nrPoints + g;
4162
+ const S = R.cData, x = R.parsedData, _ = s * t.rowScale, N = d.XOFFSET, z = R.parsedData[0].length, H = S[0], B = S[1], V = S[2], b = x[0], q = x[1], k = x[2], T = t.rowBaseline;
4163
+ let A = 0;
4164
+ d.USEMEDIAN ? A = r.median : A = r.mean;
4165
+ const E = n.rsPeriod, D = n.start;
4166
+ for (let L = 0; L < z; L++)
4167
+ H[L] = N + (b[L] - D) / E, B[L] = T - (q[L] - A) * _, R.isMinMax && (q[L] === k[L] ? V[L] = B[L] + 1 : V[L] = T - (k[L] - A) * _);
4168
4168
  }
4169
4169
  break;
4170
4170
  }
@@ -4183,47 +4183,47 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4183
4183
  start: 0,
4184
4184
  duration: 0,
4185
4185
  channels: []
4186
- }), l = ref(!1), a = ref(0), i = ref(null), e = ref(1), t = ref(!1), r = 15e6, n = 3, d = (R, P, j, J) => {
4187
- J || (J = 0);
4188
- let L = s(R, P, J, R.length - 1, j);
4189
- return L === -1 ? L = 0 : L < 0 && (L = -L - 2), L;
4190
- }, s = (R, P, j, J, L) => {
4191
- if (J < j) {
4186
+ }), l = ref(!1), a = ref(0), i = ref(null), e = ref(1), t = ref(!1), r = 15e6, n = 3, d = (_, N, z, H) => {
4187
+ H || (H = 0);
4188
+ let B = s(_, N, H, _.length - 1, z);
4189
+ return B === -1 ? B = 0 : B < 0 && (B = -B - 2), B;
4190
+ }, s = (_, N, z, H, B) => {
4191
+ if (H < z) {
4192
4192
  let b;
4193
- if (J >= 0 ? b = J : b = -J - 2, b === -1)
4193
+ if (H >= 0 ? b = H : b = -H - 2, b === -1)
4194
4194
  return b;
4195
- const T = R[b].pageStart;
4196
- for (; b >= 0 && R[b].pageStart === T; )
4195
+ const q = _[b].pageStart;
4196
+ for (; b >= 0 && _[b].pageStart === q; )
4197
4197
  b--;
4198
4198
  return b++, -b - 2;
4199
4199
  }
4200
- const W = parseInt((j + J) / 2);
4201
- if (R[W].pageStart > P)
4202
- return s(R, P, j, W - 1, L);
4203
- if (R[W].pageStart < P)
4204
- return s(R, P, W + 1, J, L);
4200
+ const V = parseInt((z + H) / 2);
4201
+ if (_[V].pageStart > N)
4202
+ return s(_, N, z, V - 1, B);
4203
+ if (_[V].pageStart < N)
4204
+ return s(_, N, V + 1, H, B);
4205
4205
  {
4206
- let b = W;
4207
- if (L) {
4208
- for (; b >= 0 && R[b].pageStart === P; )
4206
+ let b = V;
4207
+ if (B) {
4208
+ for (; b >= 0 && _[b].pageStart === N; )
4209
4209
  b--;
4210
4210
  b++;
4211
4211
  } else {
4212
- for (; b < R.length && R[b].pageStart === P; )
4212
+ for (; b < _.length && _[b].pageStart === N; )
4213
4213
  b++;
4214
4214
  b--;
4215
4215
  }
4216
4216
  return b;
4217
4217
  }
4218
- }, u = (R, P, j) => {
4219
- if (!R)
4218
+ }, u = (_, N, z) => {
4219
+ if (!_)
4220
4220
  return Promise.resolve();
4221
- const J = [];
4222
- if (R.length > 0) {
4223
- const L = [];
4224
- for (let W = 0; W < R.length; W++) {
4225
- const b = R[W].content, E = {
4226
- id: j ? j(b) : b.id,
4221
+ const H = [];
4222
+ if (_.length > 0) {
4223
+ const B = [];
4224
+ for (let V = 0; V < _.length; V++) {
4225
+ const b = _[V].content, k = {
4226
+ id: z ? z(b) : b.id,
4227
4227
  serverId: b.serverId,
4228
4228
  label: b.name,
4229
4229
  displayName: b.displayName,
@@ -4235,19 +4235,19 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4235
4235
  unit: b.unit,
4236
4236
  gaps: [],
4237
4237
  dataSegments: []
4238
- }, A = E.label.split("<->", 3), w = A[0];
4239
- let N = A.length > 1 ? parseFloat(A[1]) : 0;
4240
- N = isNaN(N) ? A[1] : N, L.push({
4241
- id: E.id,
4242
- serverId: E.serverId,
4243
- type: E.type,
4244
- label: E.label,
4245
- displayName: E.displayName,
4246
- label_split: A,
4247
- label_prefix: w,
4248
- label_value: N,
4238
+ }, T = k.label.split("<->", 3), A = T[0];
4239
+ let E = T.length > 1 ? parseFloat(T[1]) : 0;
4240
+ E = isNaN(E) ? T[1] : E, B.push({
4241
+ id: k.id,
4242
+ serverId: k.serverId,
4243
+ type: k.type,
4244
+ label: k.label,
4245
+ displayName: k.displayName,
4246
+ label_split: T,
4247
+ label_prefix: A,
4248
+ label_value: E,
4249
4249
  dataSegments: [],
4250
- rank: W,
4250
+ rank: V,
4251
4251
  visible: !0,
4252
4252
  plotAgainst: null,
4253
4253
  rowBaseline: null,
@@ -4260,81 +4260,81 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4260
4260
  filter: {},
4261
4261
  hideFilter: !0,
4262
4262
  isEditing: !1
4263
- }), J.push(E);
4263
+ }), H.push(k);
4264
4264
  }
4265
- P && P.setChannels(L);
4265
+ N && N.setChannels(B);
4266
4266
  }
4267
- return o(J), f.value = J, a.value = R.length, l.value = !0, Promise.resolve();
4268
- }, o = (R) => {
4269
- var P, j;
4270
- if (R.length === 0) {
4267
+ return o(H), f.value = H, a.value = _.length, l.value = !0, Promise.resolve();
4268
+ }, o = (_) => {
4269
+ var N, z;
4270
+ if (_.length === 0) {
4271
4271
  i.value = null;
4272
4272
  return;
4273
4273
  }
4274
- i.value = ((j = (P = R[0]) == null ? void 0 : P.gaps) == null ? void 0 : j[0]) || null;
4275
- }, h = (R) => {
4274
+ i.value = ((z = (N = _[0]) == null ? void 0 : N.gaps) == null ? void 0 : z[0]) || null;
4275
+ }, h = (_) => {
4276
4276
  if (t.value)
4277
4277
  return;
4278
- let P = null;
4279
- const j = R.data.chId || R.data.source, J = R.data.label || R.data.name;
4280
- if (P = f.value.find(
4281
- (L) => L.serverId === j && L.label === J
4282
- ), !!P)
4283
- switch (R.type) {
4278
+ let N = null;
4279
+ const z = _.data.chId || _.data.source, H = _.data.label || _.data.name;
4280
+ if (N = f.value.find(
4281
+ (B) => B.serverId === z && B.label === H
4282
+ ), !!N)
4283
+ switch (_.type) {
4284
4284
  case "gap":
4285
4285
  case "Neural":
4286
4286
  case "Continuous":
4287
- let L = !1, W = P && P.segments;
4288
- if (W && R.type !== "gap" && (L = !0, W.length > 0)) {
4289
- let T = d(W, R.data.startTs, !0, 0);
4290
- for (; W[T] && W[T].pageStart === R.data.pageStart; ) {
4291
- if (W[T].startTs === R.data.startTs) {
4292
- L = !1;
4287
+ let B = !1, V = N && N.segments;
4288
+ if (V && _.type !== "gap" && (B = !0, V.length > 0)) {
4289
+ let q = d(V, _.data.startTs, !0, 0);
4290
+ for (; V[q] && V[q].pageStart === _.data.pageStart; ) {
4291
+ if (V[q].startTs === _.data.startTs) {
4292
+ B = !1;
4293
4293
  break;
4294
4294
  }
4295
- T++;
4295
+ q++;
4296
4296
  }
4297
4297
  }
4298
- let b = c.value.get(R.data.pageStart);
4298
+ let b = c.value.get(_.data.pageStart);
4299
4299
  if (b) {
4300
- let T = b.counter.get(P.id);
4301
- if (isNaN(T) && (T = R.nrResponses !== void 0 ? R.nrResponses : 1, b.counter.set(P.id, T)), T > 0 && (T = T - 1, b.counter.set(P.id, T)), T === 0) {
4302
- let E = !0;
4303
- for (let [A, w] of b.counter.entries())
4304
- if (w > 0 || isNaN(w)) {
4305
- E = !1;
4300
+ let q = b.counter.get(N.id);
4301
+ if (isNaN(q) && (q = _.nrResponses !== void 0 ? _.nrResponses : 1, b.counter.set(N.id, q)), q > 0 && (q = q - 1, b.counter.set(N.id, q)), q === 0) {
4302
+ let k = !0;
4303
+ for (let [T, A] of b.counter.entries())
4304
+ if (A > 0 || isNaN(A)) {
4305
+ k = !1;
4306
4306
  break;
4307
4307
  }
4308
- E && c.value.delete(R.data.pageStart);
4308
+ k && c.value.delete(_.data.pageStart);
4309
4309
  }
4310
4310
  }
4311
- L && (W.push(R.data), W.sort((T, E) => T.startTs < E.startTs ? -1 : T.startTs > E.startTs ? 1 : 0));
4311
+ B && (V.push(_.data), V.sort((q, k) => q.startTs < k.startTs ? -1 : q.startTs > k.startTs ? 1 : 0));
4312
4312
  break;
4313
4313
  }
4314
4314
  }, m = () => {
4315
4315
  i.value = [], c.value.clear();
4316
- for (let R = 0; R < f.value.length; R++)
4317
- f.value[R].segments = [];
4318
- for (let R = 0; R < v.channels.length; R++)
4319
- v.channels[R].blocks = [];
4320
- }, S = (R) => {
4321
- let P = 0, j = 0, J = v.channels;
4322
- for (let W = 0; W < J.length; W++) {
4323
- let b = J[W].blocks;
4324
- for (let T = 0; T < b.length; T++)
4325
- b[T].type === "Continuous" && (P += y(b[T].parsedData[1]), j++);
4326
- }
4327
- const L = P / j;
4328
- return !isNaN(L) && R ? R / J.length / (2 * L) : 1;
4329
- }, y = (R) => {
4330
- const P = g(R), j = R.map(function(W) {
4331
- const b = W - P;
4316
+ for (let _ = 0; _ < f.value.length; _++)
4317
+ f.value[_].segments = [];
4318
+ for (let _ = 0; _ < v.channels.length; _++)
4319
+ v.channels[_].blocks = [];
4320
+ }, R = (_) => {
4321
+ let N = 0, z = 0, H = v.channels;
4322
+ for (let V = 0; V < H.length; V++) {
4323
+ let b = H[V].blocks;
4324
+ for (let q = 0; q < b.length; q++)
4325
+ b[q].type === "Continuous" && (N += y(b[q].parsedData[1]), z++);
4326
+ }
4327
+ const B = N / z;
4328
+ return !isNaN(B) && _ ? _ / H.length / (2 * B) : 1;
4329
+ }, y = (_) => {
4330
+ const N = g(_), z = _.map(function(V) {
4331
+ const b = V - N;
4332
4332
  return b * b;
4333
- }), J = g(j);
4334
- return Math.sqrt(J);
4335
- }, g = (R) => R.reduce(function(J, L) {
4336
- return J + L;
4337
- }, 0) / R.length;
4333
+ }), H = g(z);
4334
+ return Math.sqrt(H);
4335
+ }, g = (_) => _.reduce(function(H, B) {
4336
+ return H + B;
4337
+ }, 0) / _.length;
4338
4338
  return {
4339
4339
  // State
4340
4340
  chData: f,
@@ -4353,12 +4353,12 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4353
4353
  computeSummary: o,
4354
4354
  dataCallback: h,
4355
4355
  invalidate: m,
4356
- autoScaleViewData: S,
4356
+ autoScaleViewData: R,
4357
4357
  segmIndexOf: d,
4358
- updateCurrentRequestedSamplePeriod: (R) => {
4359
- e.value = Math.ceil(R);
4358
+ updateCurrentRequestedSamplePeriod: (_) => {
4359
+ e.value = Math.ceil(_);
4360
4360
  },
4361
- isDataCurrentForViewport: (R) => R && R.startTs && R.startTs > 0,
4361
+ isDataCurrentForViewport: (_) => _ && _.startTs && _.startTs > 0,
4362
4362
  // Helpers
4363
4363
  standardDeviation: y,
4364
4364
  average: g
@@ -4366,180 +4366,180 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4366
4366
  }, useDataRequests = () => {
4367
4367
  const f = ref([]), c = ref([]), v = ref(null), l = ref(!1), a = ref(null), i = ref(0), e = ref(0);
4368
4368
  let t = null;
4369
- const r = (g, O) => {
4369
+ const r = (g, S) => {
4370
4370
  t = function() {
4371
- var R;
4372
- c.value.length > 0 ? (((R = O.value) == null ? void 0 : R.size) || 0) < 5 && (g([c.value[0]]) ? c.value.splice(0, 1) : (console.warn("❌ Prefetch request failed"), clearInterval(v.value), l.value = !1)) : (clearInterval(v.value), l.value = !1);
4371
+ var _;
4372
+ c.value.length > 0 ? (((_ = S.value) == null ? void 0 : _.size) || 0) < 5 && (g([c.value[0]]) ? c.value.splice(0, 1) : (console.warn("❌ Prefetch request failed"), clearInterval(v.value), l.value = !1)) : (clearInterval(v.value), l.value = !1);
4373
4373
  };
4374
- }, n = (g, O, k, R, P, j, J, L, W, b) => {
4375
- R.start = O, R.duration = k;
4376
- const T = [];
4377
- for (let E = 0; E < R.channels.length; E++) {
4378
- const A = b ? b(R.channels[E]) : R.channels[E].id;
4379
- T.push(A);
4380
- }
4381
- for (let E = 0; E < g.length; E++) {
4382
- const A = g[E], w = b ? b(A) : A.id;
4383
- T.indexOf(w) < 0 && R.channels.push({
4384
- id: w,
4374
+ }, n = (g, S, x, _, N, z, H, B, V, b) => {
4375
+ _.start = S, _.duration = x;
4376
+ const q = [];
4377
+ for (let k = 0; k < _.channels.length; k++) {
4378
+ const T = b ? b(_.channels[k]) : _.channels[k].id;
4379
+ q.push(T);
4380
+ }
4381
+ for (let k = 0; k < g.length; k++) {
4382
+ const T = g[k], A = b ? b(T) : T.id;
4383
+ q.indexOf(A) < 0 && _.channels.push({
4384
+ id: A,
4385
4385
  mean: null,
4386
4386
  firstRenderedIndex: 0,
4387
4387
  lastRenderedIndex: 0,
4388
4388
  blocks: []
4389
4389
  });
4390
4390
  }
4391
- return d(g, O, k, R, P, j, J, L, W, b);
4392
- }, d = (g, O, k, R, P, j, J, L, W, b) => {
4391
+ return d(g, S, x, _, N, z, H, B, V, b);
4392
+ }, d = (g, S, x, _, N, z, H, B, V, b) => {
4393
4393
  f.value = [];
4394
- let E = !1;
4395
- (i.value !== O || e.value !== k) && (c.value = [], E = !0), i.value = O, e.value = k;
4396
- const A = [];
4397
- for (let w = 0; w < R.channels.length; w++)
4398
- A.push(R.channels[w]);
4399
- for (let w = 0; w < g.length; w++) {
4400
- let N = !1;
4401
- const I = g[w], V = I.segments, B = b ? b(I) : I.id, $ = A.findIndex((re) => (b ? b(re) : re.id) === B);
4402
- if ($ === -1)
4394
+ let k = !1;
4395
+ (i.value !== S || e.value !== x) && (c.value = [], k = !0), i.value = S, e.value = x;
4396
+ const T = [];
4397
+ for (let A = 0; A < _.channels.length; A++)
4398
+ T.push(_.channels[A]);
4399
+ for (let A = 0; A < g.length; A++) {
4400
+ let E = !1;
4401
+ const D = g[A], L = D.segments, W = b ? b(D) : D.id, J = T.findIndex((re) => (b ? b(re) : re.id) === W);
4402
+ if (J === -1)
4403
4403
  continue;
4404
- const z = R.channels[$];
4405
- if (!z)
4404
+ const $ = _.channels[J];
4405
+ if (!$)
4406
4406
  continue;
4407
- z.blocks = [];
4408
- let D = Math.floor(O / 15e6) * 15e6;
4409
- D < 0 && (D = 0);
4410
- let Y = 0, X = 0;
4411
- V.length > 0 && (Y = W(V, D, !0, 0));
4412
- let de = O + k + j.PREFETCHPAGES * 15e6;
4413
- de > L && (de = L);
4414
- let U;
4415
- for (V.length > 0 && (U = V[Y]); D < de || N; ) {
4416
- N = !1;
4407
+ $.blocks = [];
4408
+ let I = Math.floor(S / 15e6) * 15e6;
4409
+ I < 0 && (I = 0);
4410
+ let Y = 0, U = 0;
4411
+ L.length > 0 && (Y = V(L, I, !0, 0));
4412
+ let ce = S + x + z.PREFETCHPAGES * 15e6;
4413
+ ce > B && (ce = B);
4414
+ let j;
4415
+ for (L.length > 0 && (j = L[Y]); I < ce || E; ) {
4416
+ E = !1;
4417
4417
  let re = !1;
4418
- if (U && (re = D >= U.pageStart && D <= U.pageEnd), re) {
4419
- const le = U.pageStart;
4420
- for (; U && U.pageStart === le; )
4421
- U.startTs < O + k && z.blocks.push(U), X += 1, U = V[Y + X];
4422
- D += 15e6, U && U.pageStart === le && (N = !0);
4418
+ if (j && (re = I >= j.pageStart && I <= j.pageEnd), re) {
4419
+ const se = j.pageStart;
4420
+ for (; j && j.pageStart === se; )
4421
+ j.startTs < S + x && $.blocks.push(j), U += 1, j = L[Y + U];
4422
+ I += 15e6, j && j.pageStart === se && (E = !0);
4423
4423
  } else {
4424
- if (P.get(D)) {
4425
- if (D += 15e6, U && D >= U.pageEnd)
4426
- for (; U && U.pageEnd < D && (X += 1, U = V[Y + X], !!U); )
4424
+ if (N.get(I)) {
4425
+ if (I += 15e6, j && I >= j.pageEnd)
4426
+ for (; j && j.pageEnd < I && (U += 1, j = L[Y + U], !!j); )
4427
4427
  ;
4428
4428
  continue;
4429
4429
  }
4430
- if (D >= L) {
4431
- D += 15e6;
4430
+ if (I >= B) {
4431
+ I += 15e6;
4432
4432
  continue;
4433
4433
  }
4434
- let le = D < O + k, ae = !1;
4435
- if (le) {
4436
- for (let ce in c.value)
4437
- if (c.value[ce].start === D) {
4438
- c.value.splice(ce, 1);
4434
+ let se = I < S + x, fe = !1;
4435
+ if (se) {
4436
+ for (let oe in c.value)
4437
+ if (c.value[oe].start === I) {
4438
+ c.value.splice(oe, 1);
4439
4439
  break;
4440
4440
  }
4441
- for (let ce in f.value)
4442
- f.value[ce].start === D && (f.value[ce].channels.push(I), ae = !0);
4443
- ae || f.value.push({
4444
- channels: [I],
4445
- start: D,
4441
+ for (let oe in f.value)
4442
+ f.value[oe].start === I && (f.value[oe].channels.push(D), fe = !0);
4443
+ fe || f.value.push({
4444
+ channels: [D],
4445
+ start: I,
4446
4446
  duration: 15e6,
4447
4447
  isInViewport: !0,
4448
- pixelWidth: Math.ceil(J)
4448
+ pixelWidth: Math.ceil(H)
4449
4449
  });
4450
- } else if (E) {
4451
- for (let ce in c.value)
4452
- c.value[ce].start === D && (c.value[ce].channels.push(I), ae = !0);
4453
- ae || c.value.push({
4454
- channels: [I],
4455
- start: D,
4450
+ } else if (k) {
4451
+ for (let oe in c.value)
4452
+ c.value[oe].start === I && (c.value[oe].channels.push(D), fe = !0);
4453
+ fe || c.value.push({
4454
+ channels: [D],
4455
+ start: I,
4456
4456
  duration: 15e6,
4457
4457
  isInViewport: !1,
4458
- pixelWidth: Math.ceil(J)
4458
+ pixelWidth: Math.ceil(H)
4459
4459
  });
4460
4460
  }
4461
- if (D += 15e6, U && D >= U.pageEnd)
4462
- for (; U && U.pageEnd < D && (X += 1, U = V[Y + X], !!U); )
4461
+ if (I += 15e6, j && I >= j.pageEnd)
4462
+ for (; j && j.pageEnd < I && (U += 1, j = L[Y + U], !!j); )
4463
4463
  ;
4464
4464
  }
4465
4465
  }
4466
- z.blocks.sort(s);
4466
+ $.blocks.sort(s);
4467
4467
  }
4468
4468
  return {
4469
4469
  asyncRequests: f.value,
4470
4470
  asyncPreRequests: c.value
4471
4471
  };
4472
- }, s = (g, O) => g.startTs < O.startTs ? -1 : g.startTs > O.startTs ? 1 : 0, u = (g, O = 0, k, R, P, j, J, L) => {
4472
+ }, s = (g, S) => g.startTs < S.startTs ? -1 : g.startTs > S.startTs ? 1 : 0, u = (g, S = 0, x, _, N, z, H, B) => {
4473
4473
  if (g.length === 0)
4474
4474
  return !1;
4475
- const W = L;
4475
+ const V = B;
4476
4476
  for (let b = 0; b < g.length; b++) {
4477
- let T;
4478
- b === 0 ? T = g[O] : b === O ? T = g[0] : T = g[b];
4479
- let E = T.start + T.duration;
4480
- if (T.start >= W && console.error("❌ Request start time is beyond dataset end!", {
4481
- requestStart: T.start,
4482
- requestDuration: T.duration,
4483
- calculatedEndTime: E,
4484
- datasetEndTime: W,
4485
- isStartAfterEnd: T.start >= W
4486
- }), E > W && (console.warn("📊 Clamping request end time to dataset boundary:", {
4487
- original: E,
4488
- clamped: W,
4489
- requestStart: T.start,
4490
- duration: T.duration
4491
- }), E = W), E <= T.start) {
4477
+ let q;
4478
+ b === 0 ? q = g[S] : b === S ? q = g[0] : q = g[b];
4479
+ let k = q.start + q.duration;
4480
+ if (q.start >= V && console.error("❌ Request start time is beyond dataset end!", {
4481
+ requestStart: q.start,
4482
+ requestDuration: q.duration,
4483
+ calculatedEndTime: k,
4484
+ datasetEndTime: V,
4485
+ isStartAfterEnd: q.start >= V
4486
+ }), k > V && (console.warn("📊 Clamping request end time to dataset boundary:", {
4487
+ original: k,
4488
+ clamped: V,
4489
+ requestStart: q.start,
4490
+ duration: q.duration
4491
+ }), k = V), k <= q.start) {
4492
4492
  console.error("🚨 CRITICAL: Invalid request detected - endTime <= startTime! Skipping request.", {
4493
- startTime: T.start,
4494
- endTime: E,
4495
- duration: T.duration,
4496
- datasetEndTime: W,
4497
- originalEndTime: T.start + T.duration
4493
+ startTime: q.start,
4494
+ endTime: k,
4495
+ duration: q.duration,
4496
+ datasetEndTime: V,
4497
+ originalEndTime: q.start + q.duration
4498
4498
  });
4499
4499
  continue;
4500
4500
  }
4501
- const A = k;
4502
- if (A && A.readyState === 1) {
4503
- const w = T.channels.map((z) => {
4504
- const D = z.serverId || z.id, Y = z.label || z.name;
4501
+ const T = x;
4502
+ if (T && T.readyState === 1) {
4503
+ const A = q.channels.map(($) => {
4504
+ const I = $.serverId || $.id, Y = $.label || $.name;
4505
4505
  return {
4506
- id: D,
4506
+ id: I,
4507
4507
  // Server expects serverId
4508
4508
  name: Y
4509
4509
  };
4510
- }), N = {
4511
- session: R,
4510
+ }), E = {
4511
+ session: _,
4512
4512
  minMax: !0,
4513
- startTime: T.start,
4514
- endTime: E,
4515
- packageId: P.content.id,
4516
- pixelWidth: T.pixelWidth,
4517
- virtualChannels: w
4518
- }, I = JSON.stringify(N);
4519
- A.send(I);
4520
- const V = T.channels.length, B = /* @__PURE__ */ new Map();
4521
- for (let z = 0; z < V; z++) {
4522
- const D = T.channels[z].id;
4523
- B.set(D, NaN);
4513
+ startTime: q.start,
4514
+ endTime: k,
4515
+ packageId: N.content.id,
4516
+ pixelWidth: q.pixelWidth,
4517
+ virtualChannels: A
4518
+ }, D = JSON.stringify(E);
4519
+ T.send(D);
4520
+ const L = q.channels.length, W = /* @__PURE__ */ new Map();
4521
+ for (let $ = 0; $ < L; $++) {
4522
+ const I = q.channels[$].id;
4523
+ W.set(I, NaN);
4524
4524
  }
4525
- const $ = {
4526
- count: V,
4527
- counter: B,
4525
+ const J = {
4526
+ count: L,
4527
+ counter: W,
4528
4528
  subPageCount: NaN,
4529
4529
  ts: Date.now(),
4530
- inViewport: T.isInViewport,
4530
+ inViewport: q.isInViewport,
4531
4531
  // Add debug info
4532
- channels: T.channels.map((z) => ({
4533
- id: z.id,
4534
- serverId: z.serverId,
4535
- label: z.label
4532
+ channels: q.channels.map(($) => ({
4533
+ id: $.id,
4534
+ serverId: $.serverId,
4535
+ label: $.label
4536
4536
  }))
4537
4537
  };
4538
- J.set(T.start, $);
4538
+ H.set(q.start, J);
4539
4539
  } else
4540
4540
  return console.error("❌ WebSocket not ready for sending requests:", {
4541
- readyState: A == null ? void 0 : A.readyState,
4542
- wsExists: !!A
4541
+ readyState: T == null ? void 0 : T.readyState,
4542
+ wsExists: !!T
4543
4543
  }), !1;
4544
4544
  }
4545
4545
  return f.value = [], !0;
@@ -4549,25 +4549,25 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4549
4549
  v.value && (clearInterval(v.value), v.value = null), l.value = !1;
4550
4550
  }, m = () => {
4551
4551
  f.value = [], c.value = [], i.value = 0, e.value = 0, h();
4552
- }, S = () => {
4552
+ }, R = () => {
4553
4553
  const g = f.value.slice();
4554
4554
  return f.value = [], g;
4555
- }, y = (g, O, k) => {
4556
- const R = [];
4557
- return g.forEach(function(P, j) {
4558
- if (!isNaN(P.subPageCount)) {
4559
- const J = [];
4560
- P.counter.forEach(function(L, W) {
4561
- !isNaN(L) && L > 0 && J.push(W);
4562
- }), J.length > 0 && R.push({
4563
- channels: J,
4564
- start: j,
4565
- duration: O,
4555
+ }, y = (g, S, x) => {
4556
+ const _ = [];
4557
+ return g.forEach(function(N, z) {
4558
+ if (!isNaN(N.subPageCount)) {
4559
+ const H = [];
4560
+ N.counter.forEach(function(B, V) {
4561
+ !isNaN(B) && B > 0 && H.push(V);
4562
+ }), H.length > 0 && _.push({
4563
+ channels: H,
4564
+ start: z,
4565
+ duration: S,
4566
4566
  isInViewport: !0,
4567
- pixelWidth: Math.ceil(k)
4567
+ pixelWidth: Math.ceil(x)
4568
4568
  });
4569
4569
  }
4570
- }), g.clear(), R;
4570
+ }), g.clear(), _;
4571
4571
  };
4572
4572
  return onUnmounted(() => {
4573
4573
  h();
@@ -4585,7 +4585,7 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4585
4585
  startPrefetching: o,
4586
4586
  stopPrefetching: h,
4587
4587
  clearRequests: m,
4588
- getViewportRequests: S,
4588
+ getViewportRequests: R,
4589
4589
  reRequestPages: y
4590
4590
  };
4591
4591
  }, useChannelProcessing = (f, c, v, l) => {
@@ -4606,141 +4606,141 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4606
4606
  });
4607
4607
  const d = (b) => b ? propOr("", "id", b) : "", s = (b) => b ? propOr("", "serverId", b) || propOr("", "id", b) : "", u = (b) => propOr("", "id", b), o = (b) => {
4608
4608
  if (!b) return "";
4609
- let T = propOr("", "id", b);
4610
- if (t.value && typeof T == "string") {
4611
- const E = T.split("_");
4612
- T = E.length > 1 ? head(E) : T;
4613
- }
4614
- return T;
4615
- }, h = (b, T, E = null) => {
4616
- var I, V;
4617
- const A = E || c.value, w = `${b}_${T}_${A}`;
4618
- if (e.value.has(w))
4619
- return e.value.get(w);
4620
- let N = `${b}-${T}`;
4621
- if (A !== "NOT_MONTAGED") {
4622
- const B = (I = v.value) == null ? void 0 : I.find(($) => $.name === A);
4623
- if (B != null && B.channelPairs)
4624
- for (const $ of Object.keys(B.channelPairs)) {
4625
- const z = B.channelPairs[$];
4626
- if (((V = z.channels) == null ? void 0 : V.length) === 2 && z.channels[0] === b && z.channels[1] === T) {
4627
- N = z.name || N;
4609
+ let q = propOr("", "id", b);
4610
+ if (t.value && typeof q == "string") {
4611
+ const k = q.split("_");
4612
+ q = k.length > 1 ? head(k) : q;
4613
+ }
4614
+ return q;
4615
+ }, h = (b, q, k = null) => {
4616
+ var D, L;
4617
+ const T = k || c.value, A = `${b}_${q}_${T}`;
4618
+ if (e.value.has(A))
4619
+ return e.value.get(A);
4620
+ let E = `${b}-${q}`;
4621
+ if (T !== "NOT_MONTAGED") {
4622
+ const W = (D = v.value) == null ? void 0 : D.find((J) => J.name === T);
4623
+ if (W != null && W.channelPairs)
4624
+ for (const J of Object.keys(W.channelPairs)) {
4625
+ const $ = W.channelPairs[J];
4626
+ if (((L = $.channels) == null ? void 0 : L.length) === 2 && $.channels[0] === b && $.channels[1] === q) {
4627
+ E = $.name || E;
4628
4628
  break;
4629
4629
  }
4630
4630
  }
4631
4631
  }
4632
- return e.value.set(w, N), N;
4632
+ return e.value.set(A, E), E;
4633
4633
  }, m = (b) => {
4634
4634
  if (!Array.isArray(b))
4635
4635
  return console.warn("Invalid channel details provided:", b), [];
4636
- const T = performance.now();
4636
+ const q = performance.now();
4637
4637
  a.totalChannels = b.length, a.processedChannels = 0, a.errors = 0;
4638
- const E = b.map(({ id: A, name: w }) => {
4639
- var N;
4638
+ const k = b.map(({ id: T, name: A }) => {
4639
+ var E;
4640
4640
  try {
4641
- const I = S(A);
4642
- if (!I)
4641
+ const D = R(T);
4642
+ if (!D)
4643
4643
  return console.warn(
4644
- `❌ Base channel not found for ID: ${A}, available base channels:`,
4645
- ((N = f.value) == null ? void 0 : N.map((B) => ({ id: B == null ? void 0 : B.id, name: B == null ? void 0 : B.name }))) || []
4644
+ `❌ Base channel not found for ID: ${T}, available base channels:`,
4645
+ ((E = f.value) == null ? void 0 : E.map((W) => ({ id: W == null ? void 0 : W.id, name: W == null ? void 0 : W.name }))) || []
4646
4646
  ), a.errors++, null;
4647
- const V = y(A, w, I);
4648
- return a.processedChannels++, t.value && a.montageChannels++, V;
4649
- } catch (I) {
4650
- return console.error(`❌ Error processing channel ${A}:`, I), a.errors++, null;
4647
+ const L = y(T, A, D);
4648
+ return a.processedChannels++, t.value && a.montageChannels++, L;
4649
+ } catch (D) {
4650
+ return console.error(`❌ Error processing channel ${T}:`, D), a.errors++, null;
4651
4651
  }
4652
4652
  }).filter(Boolean);
4653
- return a.lastProcessingTime = performance.now() - T, E;
4654
- }, S = (b) => {
4655
- var E;
4653
+ return a.lastProcessingTime = performance.now() - q, k;
4654
+ }, R = (b) => {
4655
+ var k;
4656
4656
  if (i.value.has(b))
4657
4657
  return i.value.get(b);
4658
- const T = (E = f.value) == null ? void 0 : E.find((A) => (A == null ? void 0 : A.id) === b);
4659
- return T && i.value.set(b, T), T;
4660
- }, y = (b, T, E) => {
4661
- let A = T;
4662
- const w = b;
4663
- let N = b;
4658
+ const q = (k = f.value) == null ? void 0 : k.find((T) => (T == null ? void 0 : T.id) === b);
4659
+ return q && i.value.set(b, q), q;
4660
+ }, y = (b, q, k) => {
4661
+ let T = q;
4662
+ const A = b;
4663
+ let E = b;
4664
4664
  if (t.value) {
4665
- N = `${b}_${T}`;
4666
- const V = T.split("<->", 2);
4667
- V.length === 2 && (A = h(V[0], V[1]));
4665
+ E = `${b}_${q}`;
4666
+ const L = q.split("<->", 2);
4667
+ L.length === 2 && (T = h(L[0], L[1]));
4668
4668
  }
4669
4669
  return {
4670
4670
  content: {
4671
- id: N,
4671
+ id: E,
4672
4672
  // ✅ Unique for client-side operations
4673
- serverId: w,
4673
+ serverId: A,
4674
4674
  // ✅ What server provided/expects
4675
- name: T,
4676
- channelType: E.channelType,
4677
- label: T,
4678
- displayName: A,
4679
- unit: E.unit,
4680
- rate: E.rate,
4681
- start: E.start,
4682
- end: E.end,
4675
+ name: q,
4676
+ channelType: k.channelType,
4677
+ label: q,
4678
+ displayName: T,
4679
+ unit: k.unit,
4680
+ rate: k.rate,
4681
+ start: k.start,
4682
+ end: k.end,
4683
4683
  // Additional metadata
4684
4684
  montageScheme: t.value ? c.value : "NOT_MONTAGED",
4685
4685
  isMontaged: t.value,
4686
4686
  baseChannelId: b
4687
4687
  // Keep reference for debugging
4688
4688
  },
4689
- properties: E.properties || []
4689
+ properties: k.properties || []
4690
4690
  };
4691
4691
  }, g = (b) => {
4692
- var A, w, N;
4692
+ var T, A, E;
4693
4693
  if (b === "NOT_MONTAGED")
4694
4694
  return {
4695
4695
  montage: "NOT_MONTAGED",
4696
- packageId: (w = (A = l.value) == null ? void 0 : A.content) == null ? void 0 : w.id,
4696
+ packageId: (A = (T = l.value) == null ? void 0 : T.content) == null ? void 0 : A.id,
4697
4697
  montageMap: []
4698
4698
  };
4699
- const T = v.value.find((I) => I.name === b);
4700
- if (!T)
4699
+ const q = v.value.find((D) => D.name === b);
4700
+ if (!q)
4701
4701
  return console.warn("Montage not found:", b), null;
4702
- const E = T.channelPairs.map((I) => I.channels);
4702
+ const k = q.channelPairs.map((D) => D.channels);
4703
4703
  return {
4704
4704
  montage: "CUSTOM_MONTAGE",
4705
- packageId: (N = l.value) == null ? void 0 : N.content.id,
4706
- montageMap: E
4705
+ packageId: (E = l.value) == null ? void 0 : E.content.id,
4706
+ montageMap: k
4707
4707
  };
4708
- }, O = (b) => {
4709
- const T = [];
4708
+ }, S = (b) => {
4709
+ const q = [];
4710
4710
  if (!b)
4711
- return T.push("Channel configuration is null or undefined"), { isValid: !1, errors: T };
4712
- const E = ["id", "label", "type", "unit", "rate"];
4713
- for (const w of E)
4714
- b[w] || T.push(`Missing required field: ${w}`);
4715
- b.rate && (typeof b.rate != "number" || b.rate <= 0) && T.push("Sample rate must be a positive number"), b.start && b.end && b.start >= b.end && T.push("Channel start time must be less than end time");
4716
- const A = ["CONTINUOUS", "UNIT", "Neural"];
4717
- return b.type && !A.includes(b.type) && T.push(`Invalid channel type: ${b.type}. Must be one of: ${A.join(", ")}`), {
4718
- isValid: T.length === 0,
4719
- errors: T
4711
+ return q.push("Channel configuration is null or undefined"), { isValid: !1, errors: q };
4712
+ const k = ["id", "label", "type", "unit", "rate"];
4713
+ for (const A of k)
4714
+ b[A] || q.push(`Missing required field: ${A}`);
4715
+ b.rate && (typeof b.rate != "number" || b.rate <= 0) && q.push("Sample rate must be a positive number"), b.start && b.end && b.start >= b.end && q.push("Channel start time must be less than end time");
4716
+ const T = ["CONTINUOUS", "UNIT", "Neural"];
4717
+ return b.type && !T.includes(b.type) && q.push(`Invalid channel type: ${b.type}. Must be one of: ${T.join(", ")}`), {
4718
+ isValid: q.length === 0,
4719
+ errors: q
4720
4720
  };
4721
- }, k = (b) => b.sort((T, E) => {
4722
- const A = T.label || "", w = E.label || "", N = A.split("<->", 3), I = w.split("<->", 3);
4723
- if (N.length > 2 || I.length > 2)
4724
- return A.localeCompare(w);
4725
- const V = N[0] || "", B = I[0] || "";
4726
- if (V === B && N.length > 1 && I.length > 1) {
4727
- const $ = parseFloat(N[1]), z = parseFloat(I[1]);
4728
- return !isNaN($) && !isNaN(z) ? $ - z : N[1].localeCompare(I[1]);
4729
- }
4730
- return V.localeCompare(B);
4731
- }), R = (b, T = 0) => {
4732
- const E = b.content, A = E.label.split("<->", 3), w = A[0] || "", N = A.length > 1 ? isNaN(parseFloat(A[1])) ? A[1] : parseFloat(A[1]) : 0;
4721
+ }, x = (b) => b.sort((q, k) => {
4722
+ const T = q.label || "", A = k.label || "", E = T.split("<->", 3), D = A.split("<->", 3);
4723
+ if (E.length > 2 || D.length > 2)
4724
+ return T.localeCompare(A);
4725
+ const L = E[0] || "", W = D[0] || "";
4726
+ if (L === W && E.length > 1 && D.length > 1) {
4727
+ const J = parseFloat(E[1]), $ = parseFloat(D[1]);
4728
+ return !isNaN(J) && !isNaN($) ? J - $ : E[1].localeCompare(D[1]);
4729
+ }
4730
+ return L.localeCompare(W);
4731
+ }), _ = (b, q = 0) => {
4732
+ const k = b.content, T = k.label.split("<->", 3), A = T[0] || "", E = T.length > 1 ? isNaN(parseFloat(T[1])) ? T[1] : parseFloat(T[1]) : 0;
4733
4733
  return {
4734
- id: E.id,
4735
- serverId: E.serverId,
4736
- type: E.channelType,
4737
- label: E.label,
4738
- displayName: E.displayName,
4739
- labelParts: A,
4740
- labelPrefix: w,
4741
- labelValue: N,
4734
+ id: k.id,
4735
+ serverId: k.serverId,
4736
+ type: k.channelType,
4737
+ label: k.label,
4738
+ displayName: k.displayName,
4739
+ labelParts: T,
4740
+ labelPrefix: A,
4741
+ labelValue: E,
4742
4742
  dataSegments: [],
4743
- rank: T,
4743
+ rank: q,
4744
4744
  visible: !0,
4745
4745
  plotAgainst: null,
4746
4746
  rowBaseline: null,
@@ -4748,51 +4748,51 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4748
4748
  rowAdjust: 0,
4749
4749
  selected: !1,
4750
4750
  hover: !1,
4751
- unit: E.unit,
4752
- sf: E.rate,
4751
+ unit: k.unit,
4752
+ sf: k.rate,
4753
4753
  filter: {},
4754
4754
  hideFilter: !0,
4755
4755
  isEditing: !1,
4756
- montageScheme: E.montageScheme || "NOT_MONTAGED",
4757
- isMontaged: E.isMontaged || !1,
4758
- baseChannelId: E.baseChannelId
4756
+ montageScheme: k.montageScheme || "NOT_MONTAGED",
4757
+ isMontaged: k.isMontaged || !1,
4758
+ baseChannelId: k.baseChannelId
4759
4759
  // For debugging/reference
4760
4760
  };
4761
- }, P = (b, T = {}) => {
4761
+ }, N = (b, q = {}) => {
4762
4762
  const {
4763
- channelType: E = null,
4764
- visible: A = null,
4765
- montageScheme: w = null,
4766
- labelPattern: N = null,
4767
- sampleRate: I = null
4768
- } = T;
4769
- return b.filter((V) => !(E && V.type !== E || A !== null && V.visible !== A || w && V.montageScheme !== w || N && !new RegExp(N, "i").test(V.label) || I && V.sf !== I));
4770
- }, j = (b, T = "type") => {
4771
- const E = {};
4772
- return b.forEach((A) => {
4773
- let w;
4774
- switch (T) {
4763
+ channelType: k = null,
4764
+ visible: T = null,
4765
+ montageScheme: A = null,
4766
+ labelPattern: E = null,
4767
+ sampleRate: D = null
4768
+ } = q;
4769
+ return b.filter((L) => !(k && L.type !== k || T !== null && L.visible !== T || A && L.montageScheme !== A || E && !new RegExp(E, "i").test(L.label) || D && L.sf !== D));
4770
+ }, z = (b, q = "type") => {
4771
+ const k = {};
4772
+ return b.forEach((T) => {
4773
+ let A;
4774
+ switch (q) {
4775
4775
  case "type":
4776
- w = A.type;
4776
+ A = T.type;
4777
4777
  break;
4778
4778
  case "montage":
4779
- w = A.montageScheme || "NOT_MONTAGED";
4779
+ A = T.montageScheme || "NOT_MONTAGED";
4780
4780
  break;
4781
4781
  case "prefix":
4782
- w = A.labelPrefix;
4782
+ A = T.labelPrefix;
4783
4783
  break;
4784
4784
  case "sampleRate":
4785
- w = A.sf;
4785
+ A = T.sf;
4786
4786
  break;
4787
4787
  case "unit":
4788
- w = A.unit;
4788
+ A = T.unit;
4789
4789
  break;
4790
4790
  default:
4791
- w = "all";
4791
+ A = "all";
4792
4792
  }
4793
- E[w] || (E[w] = []), E[w].push(A);
4794
- }), E;
4795
- }, J = () => {
4793
+ k[A] || (k[A] = []), k[A].push(T);
4794
+ }), k;
4795
+ }, H = () => {
4796
4796
  var b;
4797
4797
  return {
4798
4798
  ...a,
@@ -4800,9 +4800,9 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4800
4800
  montageCacheSize: e.value.size,
4801
4801
  isViewingMontage: t.value,
4802
4802
  currentMontageScheme: c.value,
4803
- availableMontages: ((b = v.value) == null ? void 0 : b.map((T) => T.name)) || []
4803
+ availableMontages: ((b = v.value) == null ? void 0 : b.map((q) => q.name)) || []
4804
4804
  };
4805
- }, L = () => {
4805
+ }, B = () => {
4806
4806
  i.value.clear(), e.value.clear(), Object.assign(a, {
4807
4807
  totalChannels: 0,
4808
4808
  processedChannels: 0,
@@ -4810,16 +4810,16 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4810
4810
  errors: 0,
4811
4811
  lastProcessingTime: 0
4812
4812
  });
4813
- }, W = async (b) => {
4814
- const T = [];
4815
- for (const E of b)
4813
+ }, V = async (b) => {
4814
+ const q = [];
4815
+ for (const k of b)
4816
4816
  try {
4817
- const A = await E();
4818
- T.push({ success: !0, result: A });
4819
- } catch (A) {
4820
- T.push({ success: !1, error: A.message }), a.errors++;
4817
+ const T = await k();
4818
+ q.push({ success: !0, result: T });
4819
+ } catch (T) {
4820
+ q.push({ success: !1, error: T.message }), a.errors++;
4821
4821
  }
4822
- return T;
4822
+ return q;
4823
4823
  };
4824
4824
  return {
4825
4825
  // State
@@ -4836,18 +4836,18 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), use
4836
4836
  processChannelData: m,
4837
4837
  createMontagePayload: g,
4838
4838
  // Channel configuration
4839
- createChannelConfig: R,
4840
- validateChannelConfig: O,
4841
- sortChannelConfigurations: k,
4839
+ createChannelConfig: _,
4840
+ validateChannelConfig: S,
4841
+ sortChannelConfigurations: x,
4842
4842
  // Utility methods
4843
- filterChannels: P,
4844
- groupChannels: j,
4845
- findBaseChannel: S,
4843
+ filterChannels: N,
4844
+ groupChannels: z,
4845
+ findBaseChannel: R,
4846
4846
  createVirtualChannel: y,
4847
4847
  // Management
4848
- getProcessingStats: J,
4849
- clearCaches: L,
4850
- batchProcessChannels: W
4848
+ getProcessingStats: H,
4849
+ clearCaches: B,
4850
+ batchProcessChannels: V
4851
4851
  };
4852
4852
  };
4853
4853
  function createThrottle(f, c, v = {}) {
@@ -4893,48 +4893,48 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
4893
4893
  openWebsocket: o,
4894
4894
  send: h,
4895
4895
  sendFilterMessage: m,
4896
- sendDumpBufferRequest: S,
4896
+ sendDumpBufferRequest: R,
4897
4897
  disconnect: y,
4898
4898
  setClearChannelsCallback: g,
4899
- onSegment: O,
4900
- onEvent: k,
4901
- onChannelDetails: R,
4902
- onError: P
4899
+ onSegment: S,
4900
+ onEvent: x,
4901
+ onChannelDetails: _,
4902
+ onError: N
4903
4903
  } = useWebSocket(), {
4904
- plotCanvasRef: j,
4905
- blurCanvasRef: J,
4906
- initializeCanvases: L,
4907
- renderData: W,
4904
+ plotCanvasRef: z,
4905
+ blurCanvasRef: H,
4906
+ initializeCanvases: B,
4907
+ renderData: V,
4908
4908
  cpCanvasScaler: b
4909
- } = useCanvasRenderer(), T = ref(1), E = ref(!1), {
4910
- chData: A,
4911
- requestedPages: w,
4912
- viewData: N,
4913
- channelsReady: I,
4914
- autoScale: V,
4915
- initChannels: B,
4916
- dataCallback: $,
4917
- invalidate: z,
4918
- autoScaleViewData: D,
4909
+ } = useCanvasRenderer(), q = ref(1), k = ref(!1), {
4910
+ chData: T,
4911
+ requestedPages: A,
4912
+ viewData: E,
4913
+ channelsReady: D,
4914
+ autoScale: L,
4915
+ initChannels: W,
4916
+ dataCallback: J,
4917
+ invalidate: $,
4918
+ autoScaleViewData: I,
4919
4919
  segmIndexOf: Y,
4920
- updateCurrentRequestedSamplePeriod: X,
4921
- currentRequestedSamplePeriod: de,
4922
- isDataCurrentForViewport: U,
4920
+ updateCurrentRequestedSamplePeriod: U,
4921
+ currentRequestedSamplePeriod: ce,
4922
+ isDataCurrentForViewport: j,
4923
4923
  isSwitchingMontage: re
4924
4924
  } = useTimeSeriesData(), {
4925
- aSyncRequests: le,
4926
- aSyncPreRequests: ae,
4927
- isPrefetching: ce,
4925
+ aSyncRequests: se,
4926
+ aSyncPreRequests: fe,
4927
+ isPrefetching: oe,
4928
4928
  initializePrefetch: ye,
4929
- generatePoints: ue,
4930
- requestDataFromServer: he,
4931
- startPrefetching: we,
4932
- clearRequests: _e
4929
+ generatePoints: Re,
4930
+ requestDataFromServer: ue,
4931
+ startPrefetching: he,
4932
+ clearRequests: we
4933
4933
  } = useDataRequests(), {
4934
- getChannelId: Re,
4934
+ getChannelId: ge,
4935
4935
  processChannelData: me,
4936
4936
  createMontagePayload: ke
4937
- } = useChannelProcessing(e, n, d, i), fe = ref({
4937
+ } = useChannelProcessing(e, n, d, i), de = ref({
4938
4938
  totalRequests: 0,
4939
4939
  successfulRequests: 0,
4940
4940
  failedRequests: 0,
@@ -4942,7 +4942,7 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
4942
4942
  singleChannelRequests: 0,
4943
4943
  lastPrefetchTime: null,
4944
4944
  averageResponseTime: 0
4945
- }), Se = ref(null), Oe = ref(null), Te = ref(null), se = ref(0), ge = computed(() => T.value * l.cWidth), pe = computed(() => b(l.cHeight, T.value, 0)), qe = computed(() => l.cHeight - 20), Ae = computed(() => ({
4945
+ }), Se = ref(null), Oe = ref(null), Te = ref(null), ae = ref(0), be = computed(() => q.value * l.cWidth), pe = computed(() => b(l.cHeight, q.value, 0)), qe = computed(() => l.cHeight - 20), Ae = computed(() => ({
4946
4946
  width: l.cWidth + "px",
4947
4947
  height: qe.value + "px"
4948
4948
  })), ve = reactive({
@@ -4953,65 +4953,65 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
4953
4953
  pHeight: qe.value,
4954
4954
  rsPeriod: l.rsPeriod,
4955
4955
  nrVisibleChannels: 0
4956
- }), be = computed(() => l.rsPeriod > 0 ? l.rsPeriod : ve.duration > 0 && ve.cWidth > 0 ? ve.duration / ve.cWidth : (console.warn("⚠️ Using fallback rsPeriod = 1"), 1));
4957
- watch(be, (F) => {
4958
- F > 0 && X(F);
4956
+ }), _e = computed(() => l.rsPeriod > 0 ? l.rsPeriod : ve.duration > 0 && ve.cWidth > 0 ? ve.duration / ve.cWidth : (console.warn("⚠️ Using fallback rsPeriod = 1"), 1));
4957
+ watch(_e, (F) => {
4958
+ F > 0 && U(F);
4959
4959
  }, { immediate: !0 });
4960
4960
  const Ee = () => {
4961
4961
  var F;
4962
4962
  try {
4963
- if (!I.value)
4963
+ if (!D.value)
4964
4964
  return;
4965
- ve.nrVisibleChannels = ((F = r.value) == null ? void 0 : F.reduce((Q, G) => G.visible ? Q + 1 : Q, 0)) || 0;
4966
- let H = 0, Z = 0;
4967
- if (N.channels.forEach((Q, G) => {
4968
- const K = Q.blocks || [], te = K.reduce((ee, oe) => ee + (oe.nrPoints || 0), 0);
4969
- K.length > 0 && (Z++, H += K.length);
4965
+ ve.nrVisibleChannels = ((F = r.value) == null ? void 0 : F.reduce((Q, X) => X.visible ? Q + 1 : Q, 0)) || 0;
4966
+ let G = 0, Z = 0;
4967
+ if (E.channels.forEach((Q, X) => {
4968
+ const K = Q.blocks || [], te = K.reduce((ee, le) => ee + (le.nrPoints || 0), 0);
4969
+ K.length > 0 && (Z++, G += K.length);
4970
4970
  }), Z === 0)
4971
4971
  return;
4972
- W(
4973
- N,
4972
+ V(
4973
+ E,
4974
4974
  r.value || [],
4975
4975
  l.constants,
4976
4976
  ve,
4977
4977
  l.globalZoomMult,
4978
- T.value
4978
+ q.value
4979
4979
  );
4980
- } catch (H) {
4981
- console.error("💥 ERROR in renderDataInternal:", H), console.error("💥 Stack trace:", H.stack);
4980
+ } catch (G) {
4981
+ console.error("💥 ERROR in renderDataInternal:", G), console.error("💥 Stack trace:", G.stack);
4982
4982
  }
4983
4983
  }, xe = ref(), Ce = () => {
4984
4984
  xe.value = setInterval(() => {
4985
- var Q, G;
4986
- if (!I.value) return;
4985
+ var Q, X;
4986
+ if (!D.value) return;
4987
4987
  const F = {
4988
4988
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
4989
- requestedPagesSize: w.value.size,
4990
- isPrefetching: ce.value,
4991
- pendingAsyncRequests: le.value.length,
4992
- pendingPreRequests: ae.value.length,
4989
+ requestedPagesSize: A.value.size,
4990
+ isPrefetching: oe.value,
4991
+ pendingAsyncRequests: se.value.length,
4992
+ pendingPreRequests: fe.value.length,
4993
4993
  currentMontage: n.value,
4994
4994
  channelCount: ((Q = r.value) == null ? void 0 : Q.length) || 0,
4995
- visibleChannelCount: ((G = r.value) == null ? void 0 : G.filter((K) => K.visible).length) || 0,
4995
+ visibleChannelCount: ((X = r.value) == null ? void 0 : X.filter((K) => K.visible).length) || 0,
4996
4996
  connectionStatus: u.value,
4997
- requestedPages: Array.from(w.value.entries()).map(([K, te]) => {
4997
+ requestedPages: Array.from(A.value.entries()).map(([K, te]) => {
4998
4998
  var ee;
4999
4999
  return {
5000
5000
  pageStart: K,
5001
5001
  channelCount: te.count,
5002
5002
  inViewport: te.inViewport,
5003
5003
  age: Date.now() - te.ts,
5004
- channels: ((ee = te.channels) == null ? void 0 : ee.map((oe) => oe.id)) || Array.from(te.counter.keys())
5004
+ channels: ((ee = te.channels) == null ? void 0 : ee.map((le) => le.id)) || Array.from(te.counter.keys())
5005
5005
  };
5006
5006
  })
5007
- }, H = 1e4, Z = F.requestedPages.filter((K) => K.age > H);
5007
+ }, G = 1e4, Z = F.requestedPages.filter((K) => K.age > G);
5008
5008
  Z.length > 0 && (console.warn("⚠️ Detected stuck requests, cleaning up:", Z.map((K) => ({
5009
5009
  pageStart: K.pageStart,
5010
5010
  age: Math.round(K.age / 1e3) + "s",
5011
5011
  channels: K.channels
5012
5012
  }))), Z.forEach((K) => {
5013
- w.value.delete(K.pageStart);
5014
- }), se.value > 0 && (se.value = Math.max(0, se.value - 1))), F.pendingPreRequests > 0 && !F.isPrefetching && console.warn("⚠️ Prefetch is blocked with pending requests:", {
5013
+ A.value.delete(K.pageStart);
5014
+ }), ae.value > 0 && (ae.value = Math.max(0, ae.value - 1))), F.pendingPreRequests > 0 && !F.isPrefetching && console.warn("⚠️ Prefetch is blocked with pending requests:", {
5015
5015
  pendingPreRequests: F.pendingPreRequests,
5016
5016
  requestedPagesSize: F.requestedPagesSize
5017
5017
  });
@@ -5019,159 +5019,160 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5019
5019
  }, ie = async () => {
5020
5020
  if (!r.value)
5021
5021
  return;
5022
- const F = A.value.filter((ee) => {
5023
- const oe = r.value.find(
5022
+ const F = T.value.filter((ee) => {
5023
+ const le = r.value.find(
5024
5024
  (ne) => ne.id === ee.id
5025
5025
  // Direct id comparison (both are unique)
5026
5026
  );
5027
- return oe && oe.visible;
5028
- }), H = be.value, Z = ue(
5027
+ return le && le.visible;
5028
+ }), G = _e.value, Z = Re(
5029
5029
  F,
5030
5030
  l.start,
5031
5031
  l.duration,
5032
- N,
5033
- w.value,
5032
+ E,
5033
+ A.value,
5034
5034
  l.constants,
5035
- H,
5035
+ G,
5036
5036
  l.ts_end,
5037
5037
  Y,
5038
- Re
5039
- ), Q = Math.ceil(H);
5040
- let G = !1;
5041
- if (Se.value !== null && Q !== Se.value && (G = !0, `${Se.value}${Q}`), Oe.value !== null) {
5042
- const ee = Math.abs(l.start - Oe.value), oe = Math.max(l.duration, Te.value || l.duration);
5043
- ee > oe * 2 && (G = !0, `${ee}`, oe * 2, `${(ee / oe).toFixed(1)}`);
5038
+ ge
5039
+ ), Q = Math.ceil(G);
5040
+ let X = !1;
5041
+ if (Se.value !== null && Q !== Se.value && (X = !0, `${Se.value}${Q}`), Oe.value !== null) {
5042
+ const ee = Math.abs(l.start - Oe.value), le = Math.max(l.duration, Te.value || l.duration);
5043
+ ee > le * 2 && (X = !0, `${ee}`, le * 2, `${(ee / le).toFixed(1)}`);
5044
5044
  }
5045
5045
  const K = 15;
5046
- if (w.value.size > K && (G = !0, `${w.value.size}${K}`), se.value >= 5 && (G = !0, `${se.value}`), G && !E.value) {
5047
- E.value = !0;
5046
+ if (A.value.size > K && (X = !0, `${A.value.size}${K}`), ae.value >= 5 && (X = !0, `${ae.value}`), X && !k.value) {
5047
+ k.value = !0;
5048
5048
  try {
5049
- S() && (w.value.clear(), _e(), se.value = 0, await new Promise((ee) => setTimeout(ee, 50)));
5049
+ R() && (A.value.clear(), we(), ae.value = 0, await new Promise((ee) => setTimeout(ee, 50)));
5050
5050
  } finally {
5051
- E.value = !1;
5051
+ k.value = !1;
5052
5052
  }
5053
- } else if (G && E.value)
5053
+ } else if (X && k.value)
5054
5054
  return;
5055
5055
  Se.value = Q, Oe.value = l.start, Te.value = l.duration;
5056
5056
  const te = await useToken();
5057
- Z.asyncRequests.length > 0 && he(
5057
+ Z.asyncRequests.length > 0 && ue(
5058
5058
  Z.asyncRequests,
5059
5059
  0,
5060
5060
  s.value,
5061
5061
  te,
5062
5062
  i.value,
5063
- H,
5064
- w.value,
5063
+ G,
5064
+ A.value,
5065
5065
  l.ts_end
5066
- ), Z.asyncPreRequests.length > 0 && we();
5067
- }, C = () => {
5066
+ ), Z.asyncPreRequests.length > 0 && he();
5067
+ }, P = () => {
5068
5068
  ie(), Ee();
5069
- }, x = () => {
5070
- ie(), V.value === 0 ? (V.value--, p()) : Ee();
5069
+ }, C = () => {
5070
+ ie(), L.value === 0 ? (L.value--, p()) : Ee();
5071
5071
  }, p = () => {
5072
- const F = D(l.cHeight);
5072
+ const F = I(l.cHeight);
5073
5073
  F && !isNaN(F) && a("setGlobalZoom", F), Ee();
5074
- }, _ = createThrottle(x, 250, { leading: !1 }), q = createThrottle(() => C(), 50);
5075
- watch(() => l.rsPeriod, (F, H) => {
5076
- F > 0 && X(F), z(), w.value.clear();
5077
- }), watch(() => l.duration, (F, H) => {
5078
- z();
5074
+ }, w = createThrottle(C, 250, { leading: !1 }), O = createThrottle(() => P(), 50);
5075
+ watch(() => l.rsPeriod, (F, G) => {
5076
+ F > 0 && U(F), $(), A.value.clear();
5077
+ }), watch(() => l.duration, (F, G) => {
5078
+ $();
5079
5079
  }), watch(() => n.value, (F) => {
5080
5080
  if (!s.value || s.value.readyState !== 1) {
5081
5081
  console.warn("Cannot switch montage — WebSocket not connected");
5082
5082
  return;
5083
5083
  }
5084
- re.value = !0, w.value.clear(), _e(), z(), se.value = 0, Se.value = null, Oe.value = null, Te.value = null, I.value = !1;
5085
- const H = ke(F);
5086
- H ? h(H) : (console.warn("Montage definition not found for:", F), re.value = !1);
5084
+ re.value = !0, A.value.clear(), we(), $(), ae.value = 0, Se.value = null, Oe.value = null, Te.value = null, D.value = !1;
5085
+ const G = ke(F);
5086
+ G ? h(G) : (console.warn("Montage definition not found for:", F), re.value = !1);
5087
5087
  }), watch(() => [l.start, l.duration, l.cWidth, l.cHeight, l.rsPeriod], () => {
5088
5088
  ve.start = l.start, ve.duration = l.duration, ve.cWidth = l.cWidth, ve.cHeight = l.cHeight, ve.pHeight = qe.value, ve.rsPeriod = l.rsPeriod;
5089
- }), O((F) => {
5090
- F.pageStart >= l.start + l.duration && (fe.value.totalRequests++, n.value !== "NOT_MONTAGED" ? fe.value.montageRequests++ : fe.value.singleChannelRequests++), $(F), F.pageStart < l.start + l.duration && _();
5091
- }), k((F) => {
5092
- if (!U(F.data)) {
5093
- se.value++;
5089
+ }), S((F) => {
5090
+ F.pageStart >= l.start + l.duration && (de.value.totalRequests++, n.value !== "NOT_MONTAGED" ? de.value.montageRequests++ : de.value.singleChannelRequests++), J(F), F.pageStart < l.start + l.duration && w();
5091
+ }), x((F) => {
5092
+ if (!j(F.data)) {
5093
+ ae.value++;
5094
5094
  return;
5095
5095
  }
5096
- se.value = 0, $(F), F.pageStart < l.start + l.duration && _();
5097
- }), R((F) => {
5096
+ ae.value = 0, J(F), F.pageStart < l.start + l.duration && w();
5097
+ }), _((F) => {
5098
5098
  re.value = !1;
5099
5099
  try {
5100
- const H = me(F);
5101
- if (!H || H.length === 0) {
5100
+ const G = me(F);
5101
+ if (!G || G.length === 0) {
5102
5102
  console.warn("No valid channels after processing channel details");
5103
5103
  return;
5104
5104
  }
5105
- B(H, t, Re).then(() => {
5106
- z(), C(), a("channelsInitialized");
5105
+ W(G, t, ge).then(() => {
5106
+ $(), P(), a("channelsInitialized");
5107
5107
  }).catch((Z) => {
5108
5108
  console.error("Failed to initialize channels:", Z), t.setViewerErrors({ error: "Failed to initialize channels after montage switch" });
5109
5109
  });
5110
- } catch (H) {
5111
- console.error("Error processing channel details:", H), t.setViewerErrors({ error: "Error processing channel details" });
5110
+ } catch (G) {
5111
+ console.error("Error processing channel details:", G), t.setViewerErrors({ error: "Error processing channel details" });
5112
5112
  }
5113
- }), P((F) => {
5113
+ }), N((F) => {
5114
5114
  t.setViewerErrors(F);
5115
5115
  });
5116
5116
  const M = async () => {
5117
5117
  var Z, Q;
5118
- const F = be.value;
5119
- X(F), g(() => {
5120
- var G;
5121
- if ((G = r.value) != null && G.length) {
5118
+ const F = _e.value;
5119
+ U(F), g(() => {
5120
+ var X;
5121
+ if ((X = r.value) != null && X.length) {
5122
5122
  const te = { channelFiltersToClear: r.value.map((ee) => ee.id) };
5123
5123
  m(te);
5124
5124
  }
5125
5125
  });
5126
- const H = await useToken();
5126
+ const G = await useToken();
5127
5127
  if (ye(
5128
- (G) => {
5129
- const K = be.value;
5130
- return he(
5131
- G,
5128
+ (X) => {
5129
+ const K = _e.value;
5130
+ return ue(
5131
+ X,
5132
5132
  0,
5133
5133
  s.value,
5134
- H,
5134
+ G,
5135
5135
  i.value,
5136
5136
  K,
5137
- w.value,
5137
+ A.value,
5138
5138
  l.ts_end
5139
5139
  );
5140
5140
  },
5141
- w
5141
+ A
5142
5142
  ), (Q = (Z = i.value) == null ? void 0 : Z.content) != null && Q.id)
5143
5143
  try {
5144
5144
  await o(
5145
5145
  t.config.timeseriesDiscoverApi,
5146
5146
  i.value.content.id,
5147
- H
5147
+ G,
5148
+ i.value.content.idType || "viewerAsset"
5148
5149
  ), Ce();
5149
- } catch (G) {
5150
- console.error("Failed to establish WebSocket connection:", G);
5150
+ } catch (X) {
5151
+ console.error("Failed to establish WebSocket connection:", X);
5151
5152
  return;
5152
5153
  }
5153
5154
  };
5154
5155
  return onMounted(async () => {
5155
- T.value = 1, L(T.value), M();
5156
+ q.value = 1, B(q.value), M();
5156
5157
  }), onUnmounted(() => {
5157
- clearInterval(xe.value), w.value.size > 0 && S(), t.resetViewer(), _e(), y(), _.cancel && _.cancel(), q.cancel && q.cancel();
5158
+ clearInterval(xe.value), A.value.size > 0 && R(), t.resetViewer(), we(), y(), w.cancel && w.cancel(), O.cancel && O.cancel();
5158
5159
  }), c({
5159
- renderAll: C,
5160
- invalidate: z,
5161
- throttledDataRender: q,
5160
+ renderAll: P,
5161
+ invalidate: $,
5162
+ throttledDataRender: O,
5162
5163
  sendFilterMessage: m,
5163
- viewData: N,
5164
- requestedPages: w,
5165
- chData: A,
5164
+ viewData: E,
5165
+ requestedPages: A,
5166
+ chData: T,
5166
5167
  viewerChannels: r,
5167
- currentRequestedSamplePeriod: de,
5168
+ currentRequestedSamplePeriod: ce,
5168
5169
  initPlotCanvas: M
5169
- }), (F, H) => (openBlock(), createElementBlock("div", _hoisted_1$1, [
5170
+ }), (F, G) => (openBlock(), createElementBlock("div", _hoisted_1$1, [
5170
5171
  createElementVNode("canvas", {
5171
5172
  ref_key: "blurCanvasRef",
5172
- ref: J,
5173
+ ref: H,
5173
5174
  class: "canvas",
5174
- width: ge.value,
5175
+ width: be.value,
5175
5176
  height: pe.value,
5176
5177
  style: normalizeStyle(Ae.value)
5177
5178
  }, null, 12, _hoisted_2$1),
@@ -5179,15 +5180,15 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5179
5180
  renderSlot(F.$slots, "annCanvas", {}, void 0, !0),
5180
5181
  createElementVNode("canvas", {
5181
5182
  ref_key: "plotCanvasRef",
5182
- ref: j,
5183
+ ref: z,
5183
5184
  class: "canvas",
5184
- width: ge.value,
5185
+ width: be.value,
5185
5186
  height: pe.value,
5186
5187
  style: normalizeStyle(Ae.value)
5187
5188
  }, null, 12, _hoisted_3$1)
5188
5189
  ]));
5189
5190
  }
5190
- }, TSPlotCanvas = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d28a1026"]]), _hoisted_1 = { class: "timeseries-viewer-canvas" }, _hoisted_2 = { id: "canvasWrapper" }, _hoisted_3 = ["width", "height"], _hoisted_4 = ["width", "height"], _hoisted_5 = ["width", "height"], _hoisted_6 = ["width", "height"], _sfc_main = {
5191
+ }, TSPlotCanvas = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-66a33b77"]]), _hoisted_1 = { class: "timeseries-viewer-canvas" }, _hoisted_2 = { id: "canvasWrapper" }, _hoisted_3 = ["width", "height"], _hoisted_4 = ["width", "height"], _hoisted_5 = ["width", "height"], _hoisted_6 = ["width", "height"], _sfc_main = {
5191
5192
  __name: "TSViewerCanvas",
5192
5193
  props: {
5193
5194
  windowHeight: Number,
@@ -5215,44 +5216,44 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5215
5216
  ],
5216
5217
  setup(f, { expose: c, emit: v }) {
5217
5218
  const l = defineAsyncComponent(
5218
- () => import("./TSAnnotationCanvas-vq4ZhQlM.js")
5219
- ), a = f, i = v, e = inject("viewerStore", () => createViewerStore("default"), !0), { viewerChannels: t, viewerAnnotations: r, viewerActiveTool: n, viewerSelectedChannels: d } = storeToRefs(e), s = ref(null), u = ref(null), o = ref(null), h = ref(null), m = ref(null), S = ref(null);
5219
+ () => import("./TSAnnotationCanvas-DErBDH0Y.js")
5220
+ ), a = f, i = v, e = inject("viewerStore", () => createViewerStore("default"), !0), { viewerChannels: t, viewerAnnotations: r, viewerActiveTool: n, viewerSelectedChannels: d } = storeToRefs(e), s = ref(null), u = ref(null), o = ref(null), h = ref(null), m = ref(null), R = ref(null);
5220
5221
  reactive({});
5221
- const y = ref(0), g = ref(0), O = ref(0), k = ref(1), R = ref(!1), P = ref(!1), j = ref("pointer");
5222
+ const y = ref(0), g = ref(0), S = ref(0), x = ref(1), _ = ref(!1), N = ref(!1), z = ref("pointer");
5222
5223
  ref(!1);
5223
- const J = reactive({ x: 0, y: 0 }), L = ref(0), W = ref(["Event", "Artifact", "Seizure", "Mark", "Stim On", "Stim Off", "Start", "Stop"]), b = ref(0), T = ref(null), E = ref(0), A = ref(!0), w = () => {
5224
+ const H = reactive({ x: 0, y: 0 }), B = ref(0), V = ref(["Event", "Artifact", "Seizure", "Mark", "Stim On", "Stim Off", "Start", "Stop"]), b = ref(0), q = ref(null), k = ref(0), T = ref(!0), A = () => {
5224
5225
  if (r.value.length > 0) {
5225
- if (!r.value.some((_) => _.selected)) {
5226
- const _ = r.value[0];
5227
- _ && _.id && e.setActiveAnnotationLayer(_.id);
5226
+ if (!r.value.some((w) => w.selected)) {
5227
+ const w = r.value[0];
5228
+ w && w.id && e.setActiveAnnotationLayer(w.id);
5228
5229
  }
5229
5230
  } else
5230
5231
  setTimeout(() => {
5231
- r.value.length > 0 && w();
5232
+ r.value.length > 0 && A();
5232
5233
  }, 500);
5233
- }, N = (p) => {
5234
+ }, E = (p) => {
5234
5235
  if (p) {
5235
- const _ = "set" + p.charAt(0).toUpperCase() + p.slice(1), q = I[_];
5236
- typeof q == "function" && q();
5236
+ const w = "set" + p.charAt(0).toUpperCase() + p.slice(1), O = D[w];
5237
+ typeof O == "function" && O();
5237
5238
  }
5238
- }, I = {
5239
+ }, D = {
5239
5240
  setPan: () => {
5240
5241
  },
5241
5242
  setPointer: () => {
5242
5243
  },
5243
5244
  setAnnotate: () => {
5244
- w();
5245
+ A();
5245
5246
  }
5246
- }, V = computed(() => t.value.filter((p) => p.visible).length), B = computed(() => a.cHeight - 20), $ = computed(() => a.cWidth + a.constants.CURSOROFFSET);
5247
+ }, L = computed(() => t.value.filter((p) => p.visible).length), W = computed(() => a.cHeight - 20), J = computed(() => a.cWidth + a.constants.CURSOROFFSET);
5247
5248
  computed(() => u.value);
5248
- const z = computed(() => ({
5249
+ const $ = computed(() => ({
5249
5250
  width: a.cWidth + "px",
5250
5251
  height: a.cHeight + "px"
5251
- })), D = computed(() => ({
5252
+ })), I = computed(() => ({
5252
5253
  width: a.cWidth + "px",
5253
- height: B.value + "px"
5254
+ height: W.value + "px"
5254
5255
  })), Y = computed(() => ({
5255
- width: $.value + "px",
5256
+ width: J.value + "px",
5256
5257
  height: a.cHeight + "px"
5257
5258
  }));
5258
5259
  watch(() => a.cHeight, () => {
@@ -5260,23 +5261,23 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5260
5261
  }), watch(() => a.cWidth, () => {
5261
5262
  Oe();
5262
5263
  }), watch(() => a.start, () => {
5263
- ge();
5264
+ be();
5264
5265
  }), watch(() => a.duration, () => {
5265
5266
  var p;
5266
- (p = s.value) == null || p.invalidate(), Te(a.cWidth, a.duration), ge();
5267
+ (p = s.value) == null || p.invalidate(), Te(a.cWidth, a.duration), be();
5267
5268
  }), watch(() => a.globalZoomMult, () => {
5268
5269
  nextTick(() => {
5269
5270
  var p;
5270
5271
  (p = s.value) == null || p.throttledDataRender();
5271
5272
  });
5272
5273
  }), watch(n, (p) => {
5273
- p && (N(p), !R.value && !["annResize-left", "annResize-right", "annSelect"].includes(j.value) && (j.value = p));
5274
+ p && (E(p), !_.value && !["annResize-left", "annResize-right", "annSelect"].includes(z.value) && (z.value = p));
5274
5275
  }, { immediate: !0 }), watch(r, (p) => {
5275
- p.length > 0 && n.value === "annotate" && w();
5276
- }, { immediate: !0 }), watch(j, () => {
5277
- const p = S.value;
5276
+ p.length > 0 && n.value === "annotate" && A();
5277
+ }, { immediate: !0 }), watch(z, () => {
5278
+ const p = R.value;
5278
5279
  if (p) {
5279
- switch (p.removeAttribute("col_resize"), p.removeAttribute("active"), p.removeAttribute("point"), j.value) {
5280
+ switch (p.removeAttribute("col_resize"), p.removeAttribute("active"), p.removeAttribute("point"), z.value) {
5280
5281
  case "cursor_hover":
5281
5282
  p.removeAttribute("point"), p.setAttribute("cursor_hover", !0);
5282
5283
  break;
@@ -5303,246 +5304,246 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5303
5304
  });
5304
5305
  }
5305
5306
  });
5306
- const X = () => {
5307
+ const U = () => {
5307
5308
  var p;
5308
5309
  (p = m.value) == null || p.resetFocusedAnnotation();
5309
- }, de = (p) => {
5310
- var _;
5311
- (_ = m.value) == null || _.createAnnotationLayer(p);
5312
- }, U = () => {
5313
- var q;
5310
+ }, ce = (p) => {
5311
+ var w;
5312
+ (w = m.value) == null || w.createAnnotationLayer(p);
5313
+ }, j = () => {
5314
+ var O;
5314
5315
  let p = (a.cursorLoc * a.cWidth - a.constants.CURSOROFFSET) * y.value;
5315
- return ((q = m.value) == null ? void 0 : q.findNextAnnotation(a.start + p)).start - p;
5316
+ return ((O = m.value) == null ? void 0 : O.findNextAnnotation(a.start + p)).start - p;
5316
5317
  }, re = () => {
5317
- var q;
5318
+ var O;
5318
5319
  let p = (a.cursorLoc * a.cWidth - a.constants.CURSOROFFSET) * y.value;
5319
- return ((q = m.value) == null ? void 0 : q.findPreviousAnnotation(a.start + p)).start - p;
5320
- }, le = (p) => {
5320
+ return ((O = m.value) == null ? void 0 : O.findPreviousAnnotation(a.start + p)).start - p;
5321
+ }, se = (p) => {
5321
5322
  i("updateAnnotation", p);
5322
- }, ae = () => {
5323
+ }, fe = () => {
5323
5324
  i("closeAnnotationLayerWindow");
5324
- }, ce = () => {
5325
- ge(100);
5325
+ }, oe = () => {
5326
+ be(100);
5326
5327
  }, ye = () => {
5327
- n.value === "annotate" && w(), i("annLayersInitialized");
5328
- }, ue = (p) => {
5328
+ n.value === "annotate" && A(), i("annLayersInitialized");
5329
+ }, Re = (p) => {
5329
5330
  i("setGlobalZoom", p);
5330
- }, he = () => {
5331
+ }, ue = () => {
5331
5332
  i("channelsInitialized");
5332
- }, we = (p) => {
5333
+ }, he = (p) => {
5333
5334
  p.stopPropagation(), p.preventDefault(), p.shiftKey ? Math.abs(p.deltaY) > Math.abs(p.deltaX) && (p.deltaY > 0 ? i("setDuration", a.duration * 1.1) : i("setDuration", a.duration / 1.1)) : Math.abs(p.deltaY) > Math.abs(p.deltaX) && (p.deltaY > 0 ? i("setGlobalZoom", a.globalZoomMult * 1.2) : i("setGlobalZoom", a.globalZoomMult / 1.2));
5334
- }, _e = (p) => {
5335
- var _, q;
5336
- switch (P.value = !1, R.value = !1, j.value) {
5335
+ }, we = (p) => {
5336
+ var w, O;
5337
+ switch (N.value = !1, _.value = !1, z.value) {
5337
5338
  case "pointer":
5338
- Re();
5339
- const M = p.metaKey, F = p.clientY - S.value.getBoundingClientRect().top, H = J.y - S.value.getBoundingClientRect().top, Z = t.value.map((ne) => (M === !1 && (ne.selected = !1), (ne.rowBaseline > H && ne.rowBaseline < F || ne.rowBaseline < H && ne.rowBaseline > F) && (ne.selected = !0), ne));
5340
- e.setChannels(Z), ge();
5339
+ ge();
5340
+ const M = p.metaKey, F = p.clientY - R.value.getBoundingClientRect().top, G = H.y - R.value.getBoundingClientRect().top, Z = t.value.map((ne) => (M === !1 && (ne.selected = !1), (ne.rowBaseline > G && ne.rowBaseline < F || ne.rowBaseline < G && ne.rowBaseline > F) && (ne.selected = !0), ne));
5341
+ e.setChannels(Z), be();
5341
5342
  break;
5342
5343
  case "annSelect":
5343
- Re(), (_ = m.value) == null || _.selectFocusedAnn();
5344
+ ge(), (w = m.value) == null || w.selectFocusedAnn();
5344
5345
  break;
5345
5346
  case "annotate":
5346
- w();
5347
- let Q = null, G = null;
5347
+ A();
5348
+ let Q = null, X = null;
5348
5349
  for (let ne = 0; ne < r.value.length; ne++)
5349
5350
  if (r.value[ne].selected) {
5350
- Q = ne, G = r.value[ne];
5351
+ Q = ne, X = r.value[ne];
5351
5352
  break;
5352
5353
  }
5353
- if (Q === null || !G || !G.id)
5354
+ if (Q === null || !X || !X.id)
5354
5355
  if (r.value.length > 0 && r.value[0].id)
5355
- e.setActiveAnnotationLayer(r.value[0].id), G = r.value[0], Q = 0;
5356
+ e.setActiveAnnotationLayer(r.value[0].id), X = r.value[0], Q = 0;
5356
5357
  else
5357
5358
  return;
5358
5359
  const K = d.value, te = K.length === t.value.length || K.length === 0;
5359
- let ee = (p.clientX - J.x) * y.value, oe = L.value + (J.x - S.value.getBoundingClientRect().left) * y.value;
5360
- if (ee < 0 && (oe = oe + ee, ee = -ee), ee > 1e3) {
5360
+ let ee = (p.clientX - H.x) * y.value, le = B.value + (H.x - R.value.getBoundingClientRect().left) * y.value;
5361
+ if (ee < 0 && (le = le + ee, ee = -ee), ee > 1e3) {
5361
5362
  const ne = {
5362
5363
  name: "",
5363
5364
  id: null,
5364
- label: W.value[b.value],
5365
+ label: V.value[b.value],
5365
5366
  description: "",
5366
- start: oe,
5367
+ start: le,
5367
5368
  duration: ee,
5368
- end: oe + ee,
5369
+ end: le + ee,
5369
5370
  cStart: null,
5370
5371
  cEnd: null,
5371
5372
  selected: !0,
5372
5373
  channelIds: K.map((Ne) => Ne.id),
5373
5374
  allChannels: te,
5374
- layer_id: G.id,
5375
+ layer_id: X.id,
5375
5376
  // FIX: Use the validated layer ID
5376
5377
  userId: null
5377
5378
  };
5378
- e.setActiveAnnotation(ne), i("addAnnotation", oe, ee, te, ne.label, ne.description, G);
5379
+ e.setActiveAnnotation(ne), i("addAnnotation", le, ee, te, ne.label, ne.description, X);
5379
5380
  break;
5380
5381
  }
5381
5382
  break;
5382
5383
  case "annResize-left":
5383
5384
  case "annResize-right":
5384
- (q = m.value) == null || q.onMouseUp();
5385
+ (O = m.value) == null || O.onMouseUp();
5385
5386
  break;
5386
5387
  }
5387
- }, Re = () => {
5388
- S.value.getContext("2d").clearRect(0, 0, a.cWidth, a.cHeight);
5388
+ }, ge = () => {
5389
+ R.value.getContext("2d").clearRect(0, 0, a.cWidth, a.cHeight);
5389
5390
  }, me = (p) => {
5390
- var q;
5391
- R.value = !0, L.value = a.start;
5392
- const _ = S.value.getBoundingClientRect();
5393
- switch (J.x = p.clientX, J.y = p.clientY, n.value === "annotate" && !["annResize-left", "annResize-right", "annSelect"].includes(j.value) && (j.value = "annotate"), j.value) {
5391
+ var O;
5392
+ _.value = !0, B.value = a.start;
5393
+ const w = R.value.getBoundingClientRect();
5394
+ switch (H.x = p.clientX, H.y = p.clientY, n.value === "annotate" && !["annResize-left", "annResize-right", "annSelect"].includes(z.value) && (z.value = "annotate"), z.value) {
5394
5395
  case "annResize-left":
5395
5396
  case "annResize-right":
5396
- P.value = !0, (q = m.value) == null || q.onMouseDown(p.clientX - _.left, p.clientY - _.top);
5397
+ N.value = !0, (O = m.value) == null || O.onMouseDown(p.clientX - w.left, p.clientY - w.top);
5397
5398
  break;
5398
5399
  }
5399
5400
  }, ke = () => {
5400
- R.value = !1;
5401
- }, fe = (p) => {
5402
- p.buttons === 1 ? R.value = !0 : R.value = !1;
5401
+ _.value = !1;
5402
+ }, de = (p) => {
5403
+ p.buttons === 1 ? _.value = !0 : _.value = !1;
5403
5404
  }, Se = (p) => {
5404
- var F, H, Z, Q;
5405
+ var F, G, Z, Q;
5405
5406
  p.preventDefault(), p.stopPropagation();
5406
- const _ = S.value.getBoundingClientRect(), q = p.clientY - _.top, M = p.clientX - _.left;
5407
+ const w = R.value.getBoundingClientRect(), O = p.clientY - w.top, M = p.clientX - w.left;
5407
5408
  switch (n.value) {
5408
5409
  case "pan":
5409
- if (R.value) {
5410
- const G = L.value - (p.clientX - J.x) * y.value;
5411
- i("setStart", G);
5410
+ if (_.value) {
5411
+ const X = B.value - (p.clientX - H.x) * y.value;
5412
+ i("setStart", X);
5412
5413
  } else {
5413
- const G = (F = m.value) == null ? void 0 : F.onMouseMove(M, q, j.value, R.value);
5414
- j.value = G || "pan";
5414
+ const X = (F = m.value) == null ? void 0 : F.onMouseMove(M, O, z.value, _.value);
5415
+ z.value = X || "pan";
5415
5416
  }
5416
5417
  break;
5417
5418
  case "pointer":
5418
- if (R.value)
5419
- be(p.clientX, p.clientY);
5419
+ if (_.value)
5420
+ _e(p.clientX, p.clientY);
5420
5421
  else {
5421
- const G = (H = m.value) == null ? void 0 : H.onMouseMove(M, q, j.value, R.value);
5422
- j.value = G || "pointer";
5422
+ const X = (G = m.value) == null ? void 0 : G.onMouseMove(M, O, z.value, _.value);
5423
+ z.value = X || "pointer";
5423
5424
  }
5424
5425
  break;
5425
5426
  case "annotate":
5426
- if (R.value && j.value === "annotate")
5427
+ if (_.value && z.value === "annotate")
5427
5428
  xe(p.clientX);
5428
- else if (R.value && ["annResize-left", "annResize-right"].includes(j.value)) {
5429
- const G = (Z = m.value) == null ? void 0 : Z.onMouseMove(M, q, j.value, R.value);
5430
- j.value = G || j.value, ge();
5429
+ else if (_.value && ["annResize-left", "annResize-right"].includes(z.value)) {
5430
+ const X = (Z = m.value) == null ? void 0 : Z.onMouseMove(M, O, z.value, _.value);
5431
+ z.value = X || z.value, be();
5431
5432
  } else {
5432
- const G = (Q = m.value) == null ? void 0 : Q.onMouseMove(M, q, j.value, R.value);
5433
- G ? j.value = G : j.value = "annotate";
5433
+ const X = (Q = m.value) == null ? void 0 : Q.onMouseMove(M, O, z.value, _.value);
5434
+ X ? z.value = X : z.value = "annotate";
5434
5435
  }
5435
5436
  break;
5436
5437
  }
5437
5438
  }, Oe = () => {
5438
- Te(a.cWidth, a.duration), ge(25);
5439
- }, Te = (p, _) => {
5440
- const q = y.value, M = _ / p;
5441
- M !== q && (O.value = Date.now(), y.value = M, g.value = Math.floor(_ / a.constants.PAGESIZEDIVIDER));
5442
- }, se = (p, _, q) => _ * (p + q), ge = (p = 0, _ = !0) => {
5443
- (!T.value || p !== E.value || A.value !== _) && (T.value = pe(Ae, p, { leading: _ }), E.value = p, A.value = _), T.value();
5444
- }, pe = (p, _, q = {}) => {
5445
- let M, F, H, Z = null, Q = 0;
5446
- const G = function() {
5447
- Q = q.leading === !1 ? 0 : Date.now(), Z = null, H = p.apply(M, F), Z || (M = F = null);
5439
+ Te(a.cWidth, a.duration), be(25);
5440
+ }, Te = (p, w) => {
5441
+ const O = y.value, M = w / p;
5442
+ M !== O && (S.value = Date.now(), y.value = M, g.value = Math.floor(w / a.constants.PAGESIZEDIVIDER));
5443
+ }, ae = (p, w, O) => w * (p + O), be = (p = 0, w = !0) => {
5444
+ (!q.value || p !== k.value || T.value !== w) && (q.value = pe(Ae, p, { leading: w }), k.value = p, T.value = w), q.value();
5445
+ }, pe = (p, w, O = {}) => {
5446
+ let M, F, G, Z = null, Q = 0;
5447
+ const X = function() {
5448
+ Q = O.leading === !1 ? 0 : Date.now(), Z = null, G = p.apply(M, F), Z || (M = F = null);
5448
5449
  };
5449
5450
  return function() {
5450
5451
  const K = Date.now();
5451
- !Q && q.leading === !1 && (Q = K);
5452
- const te = _ - (K - Q);
5453
- return M = this, F = arguments, te <= 0 || te > _ ? (Z && (clearTimeout(Z), Z = null), Q = K, H = p.apply(M, F), Z || (M = F = null)) : !Z && q.trailing !== !1 && (Z = setTimeout(G, te)), H;
5452
+ !Q && O.leading === !1 && (Q = K);
5453
+ const te = w - (K - Q);
5454
+ return M = this, F = arguments, te <= 0 || te > w ? (Z && (clearTimeout(Z), Z = null), Q = K, G = p.apply(M, F), Z || (M = F = null)) : !Z && O.trailing !== !1 && (Z = setTimeout(X, te)), G;
5454
5455
  };
5455
5456
  }, qe = () => {
5456
5457
  var p;
5457
- Re(), (p = m.value) == null || p.render();
5458
+ ge(), (p = m.value) == null || p.render();
5458
5459
  }, Ae = () => {
5459
5460
  nextTick(() => {
5460
- var p, _;
5461
- ve(), Ee(), (p = s.value) == null || p.renderAll(), (_ = m.value) == null || _.render();
5461
+ var p, w;
5462
+ ve(), Ee(), (p = s.value) == null || p.renderAll(), (w = m.value) == null || w.render();
5462
5463
  });
5463
5464
  }, ve = () => {
5464
- const _ = u.value.getContext("2d");
5465
- _.setTransform(k.value, 0, 0, k.value, 0, 0), _.clearRect(0, 0, a.cWidth, a.cHeight), _.stroke(), _.beginPath(), _.lineWidth = 1, _.moveTo(a.constants.XOFFSET + 0.5, 0.5), _.lineTo(a.constants.XOFFSET + 0.5, B.value + 0.5), _.lineTo(a.cWidth + 0.5, B.value + 0.5), _.stroke();
5466
- let q = B.value / (2 * V.value) + 0.5 << 1 >> 1;
5467
- _.lineWidth = 0.5;
5468
- for (let Q = 0; Q < V.value; Q++)
5469
- _.beginPath(), _.moveTo(a.constants.XOFFSET - 2, q), _.lineTo(a.constants.XOFFSET + 2, q), _.stroke(), q += B.value / V.value;
5470
- const M = a.constants.XGRIDSPACING * Math.ceil(a.duration / 1e8), F = Math.ceil(a.duration / M) + 1, H = Math.ceil(a.constants.NRPXPERLABEL / (M / y.value)), Z = (M - a.start % M) % M;
5465
+ const w = u.value.getContext("2d");
5466
+ w.setTransform(x.value, 0, 0, x.value, 0, 0), w.clearRect(0, 0, a.cWidth, a.cHeight), w.stroke(), w.beginPath(), w.lineWidth = 1, w.moveTo(a.constants.XOFFSET + 0.5, 0.5), w.lineTo(a.constants.XOFFSET + 0.5, W.value + 0.5), w.lineTo(a.cWidth + 0.5, W.value + 0.5), w.stroke();
5467
+ let O = W.value / (2 * L.value) + 0.5 << 1 >> 1;
5468
+ w.lineWidth = 0.5;
5469
+ for (let Q = 0; Q < L.value; Q++)
5470
+ w.beginPath(), w.moveTo(a.constants.XOFFSET - 2, O), w.lineTo(a.constants.XOFFSET + 2, O), w.stroke(), O += W.value / L.value;
5471
+ const M = a.constants.XGRIDSPACING * Math.ceil(a.duration / 1e8), F = Math.ceil(a.duration / M) + 1, G = Math.ceil(a.constants.NRPXPERLABEL / (M / y.value)), Z = (M - a.start % M) % M;
5471
5472
  for (let Q = 0; Q < F; Q++) {
5472
- let G = a.start + Z + Q * M;
5473
- if (G > a.tsEnd)
5473
+ let X = a.start + Z + Q * M;
5474
+ if (X > a.tsEnd)
5474
5475
  break;
5475
- const K = G - a.start, te = a.constants.XOFFSET + K / y.value, ee = Math.round(te);
5476
- if (ee > 1 && (_.save(), _.beginPath(), _.lineWidth = 0.5, _.strokeStyle = "rgb(235,235,235)", _.moveTo(ee + 0.5, 0.5), _.lineTo(ee + 0.5, B.value - 0.5), _.stroke(), _.restore(), ((G / M + M / 10) % H | 0) === 1 || H === 1)) {
5477
- _.beginPath(), _.lineWidth = 1, _.moveTo(ee + 0.5, B.value - 3), _.lineTo(ee + 0.5, B.value + 3), _.stroke();
5478
- const ne = new Date(G / 1e3);
5479
- _.font = "12px sans-serif", _.fillStyle = "rgb(150,150,150)", _.fillText(C(ne), ee - 20.5, a.cHeight - 0.2);
5476
+ const K = X - a.start, te = a.constants.XOFFSET + K / y.value, ee = Math.round(te);
5477
+ if (ee > 1 && (w.save(), w.beginPath(), w.lineWidth = 0.5, w.strokeStyle = "rgb(235,235,235)", w.moveTo(ee + 0.5, 0.5), w.lineTo(ee + 0.5, W.value - 0.5), w.stroke(), w.restore(), ((X / M + M / 10) % G | 0) === 1 || G === 1)) {
5478
+ w.beginPath(), w.lineWidth = 1, w.moveTo(ee + 0.5, W.value - 3), w.lineTo(ee + 0.5, W.value + 3), w.stroke();
5479
+ const ne = new Date(X / 1e3);
5480
+ w.font = "12px sans-serif", w.fillStyle = "rgb(150,150,150)", w.fillText(P(ne), ee - 20.5, a.cHeight - 0.2);
5480
5481
  }
5481
5482
  }
5482
- }, be = (p, _) => {
5483
- const q = S.value, M = q.getContext("2d");
5484
- M.setTransform(k.value, 0, 0, k.value, 0, 0), M.clearRect(0, 0, a.cWidth, a.cHeight), M.beginPath(), M.lineWidth = 2, M.strokeStyle = "#295eff", M.setLineDash([5, 5, 15, 5]);
5485
- const F = p - q.getBoundingClientRect().left, H = _ - q.getBoundingClientRect().top;
5486
- M.rect(F, H, -p + J.x, -_ + J.y), M.stroke();
5483
+ }, _e = (p, w) => {
5484
+ const O = R.value, M = O.getContext("2d");
5485
+ M.setTransform(x.value, 0, 0, x.value, 0, 0), M.clearRect(0, 0, a.cWidth, a.cHeight), M.beginPath(), M.lineWidth = 2, M.strokeStyle = "#295eff", M.setLineDash([5, 5, 15, 5]);
5486
+ const F = p - O.getBoundingClientRect().left, G = w - O.getBoundingClientRect().top;
5487
+ M.rect(F, G, -p + H.x, -w + H.y), M.stroke();
5487
5488
  }, Ee = () => {
5488
- const _ = h.value.getContext("2d");
5489
- _.setTransform(k.value, 0, 0, k.value, 0, 0), _.clearRect(0, 0, a.cWidth + a.constants.CURSOROFFSET, a.cHeight), _.save(), _.beginPath(), _.fillStyle = "red";
5490
- const q = a.cursorLoc * a.cWidth;
5491
- q > a.constants.CURSOROFFSET ? (_.strokeStyle = "red", _.moveTo(q, 0), _.lineTo(q, B.value), _.stroke()) : _.moveTo(q, B.value), _.beginPath(), _.lineTo(q - 5, B.value + 8), _.lineTo(q + 5, B.value + 8), _.lineTo(q, B.value), _.fill(), _.restore();
5489
+ const w = h.value.getContext("2d");
5490
+ w.setTransform(x.value, 0, 0, x.value, 0, 0), w.clearRect(0, 0, a.cWidth + a.constants.CURSOROFFSET, a.cHeight), w.save(), w.beginPath(), w.fillStyle = "red";
5491
+ const O = a.cursorLoc * a.cWidth;
5492
+ O > a.constants.CURSOROFFSET ? (w.strokeStyle = "red", w.moveTo(O, 0), w.lineTo(O, W.value), w.stroke()) : w.moveTo(O, W.value), w.beginPath(), w.lineTo(O - 5, W.value + 8), w.lineTo(O + 5, W.value + 8), w.lineTo(O, W.value), w.fill(), w.restore();
5492
5493
  }, xe = (p) => {
5493
- const _ = S.value, q = _.getContext("2d");
5494
- q.setTransform(k.value, 0, 0, k.value, 0, 0);
5494
+ const w = R.value, O = w.getContext("2d");
5495
+ O.setTransform(x.value, 0, 0, x.value, 0, 0);
5495
5496
  const M = a.constants.ANNOTATIONLABELHEIGHT, F = M / 2 | 0;
5496
- let H = null;
5497
+ let G = null;
5497
5498
  for (let te = 0; te < r.value.length; te++)
5498
5499
  if (r.value[te].selected) {
5499
- H = te;
5500
+ G = te;
5500
5501
  break;
5501
5502
  }
5502
- if (H === null)
5503
+ if (G === null)
5503
5504
  return;
5504
- q.save(), q.clearRect(0, 0, a.cWidth, a.cHeight), q.lineWidth = 1;
5505
- const Z = d.value, Q = Z.length === t.value.length || Z.length === 0, G = p - _.getBoundingClientRect().left, K = -p + J.x;
5505
+ O.save(), O.clearRect(0, 0, a.cWidth, a.cHeight), O.lineWidth = 1;
5506
+ const Z = d.value, Q = Z.length === t.value.length || Z.length === 0, X = p - w.getBoundingClientRect().left, K = -p + H.x;
5506
5507
  if (Q) {
5507
- q.fillStyle = "rgba(0,0,0,0.1)", q.fillRect(G, 0, K, B.value), q.fillStyle = r.value[H].color, q.strokeStyle = q.fillStyle;
5508
- let te = G - 1, ee = K + 2;
5509
- K < 0 && (te = G + 1, ee = K - 2), q.fillRect(te, 0, ee, M), q.setLineDash([5, 5, 5, 5]), q.beginPath(), q.moveTo(G, M), q.lineTo(G, B.value), q.stroke(), q.beginPath(), q.moveTo(G + K, M), q.lineTo(G + K, B.value), q.stroke();
5508
+ O.fillStyle = "rgba(0,0,0,0.1)", O.fillRect(X, 0, K, W.value), O.fillStyle = r.value[G].color, O.strokeStyle = O.fillStyle;
5509
+ let te = X - 1, ee = K + 2;
5510
+ K < 0 && (te = X + 1, ee = K - 2), O.fillRect(te, 0, ee, M), O.setLineDash([5, 5, 5, 5]), O.beginPath(), O.moveTo(X, M), O.lineTo(X, W.value), O.stroke(), O.beginPath(), O.moveTo(X + K, M), O.lineTo(X + K, W.value), O.stroke();
5510
5511
  } else {
5511
5512
  let te = a.cHeight | 0, ee = 0;
5512
- const oe = t.value;
5513
- q.fillStyle = r.value[H].color, q.strokeStyle = q.fillStyle;
5514
- let ne = G - 1, Ne = K + 2;
5515
- K < 0 && (ne = G + 1, Ne = K - 2);
5516
- for (let Fe = 0; Fe < oe.length; Fe++) {
5517
- const Ie = oe[Fe];
5513
+ const le = t.value;
5514
+ O.fillStyle = r.value[G].color, O.strokeStyle = O.fillStyle;
5515
+ let ne = X - 1, Ne = K + 2;
5516
+ K < 0 && (ne = X + 1, Ne = K - 2);
5517
+ for (let Fe = 0; Fe < le.length; Fe++) {
5518
+ const Ie = le[Fe];
5518
5519
  if (Ie.selected && Ie.visible) {
5519
5520
  const Pe = Ie.rowBaseline | 0;
5520
- Pe < te && (te = Pe), Pe > ee && (ee = Pe), q.fillRect(ne, Pe - F, Ne, M);
5521
+ Pe < te && (te = Pe), Pe > ee && (ee = Pe), O.fillRect(ne, Pe - F, Ne, M);
5521
5522
  }
5522
5523
  }
5523
- q.fillStyle = "rgba(0,0,0,0.1)", q.setLineDash([5, 5, 5, 5]), q.fillRect(
5524
- G - 1,
5524
+ O.fillStyle = "rgba(0,0,0,0.1)", O.setLineDash([5, 5, 5, 5]), O.fillRect(
5525
+ X - 1,
5525
5526
  te + F,
5526
5527
  K + 2,
5527
5528
  ee - te - M
5528
- ), q.beginPath(), q.moveTo(G, te + F), q.lineTo(G, ee - F), q.moveTo(G + K, te + F), q.lineTo(G + K, ee - F), q.stroke();
5529
+ ), O.beginPath(), O.moveTo(X, te + F), O.lineTo(X, ee - F), O.moveTo(X + K, te + F), O.lineTo(X + K, ee - F), O.stroke();
5529
5530
  }
5530
- q.restore();
5531
+ O.restore();
5531
5532
  }, Ce = () => {
5532
5533
  var p;
5533
5534
  (p = s.value) == null || p.initPlotCanvas();
5534
5535
  }, ie = () => {
5535
- let p = S.value.getContext("2d"), _ = window.devicePixelRatio || 1, q = p.webkitBackingStorePixelRatio || p.mozBackingStorePixelRatio || p.msBackingStorePixelRatio || p.oBackingStorePixelRatio || p.backingStorePixelRatio || 1;
5536
- return _ / q;
5537
- }, C = (p) => ("0" + p.getUTCHours()).slice(-2) + ":" + ("0" + p.getUTCMinutes()).slice(-2) + ":" + ("0" + p.getUTCSeconds()).slice(-2), x = (p) => {
5538
- var F, H;
5539
- let _ = parseFloat(p.input0), q = parseFloat(p.input1), M = {};
5536
+ let p = R.value.getContext("2d"), w = window.devicePixelRatio || 1, O = p.webkitBackingStorePixelRatio || p.mozBackingStorePixelRatio || p.msBackingStorePixelRatio || p.oBackingStorePixelRatio || p.backingStorePixelRatio || 1;
5537
+ return w / O;
5538
+ }, P = (p) => ("0" + p.getUTCHours()).slice(-2) + ":" + ("0" + p.getUTCMinutes()).slice(-2) + ":" + ("0" + p.getUTCSeconds()).slice(-2), C = (p) => {
5539
+ var F, G;
5540
+ let w = parseFloat(p.input0), O = parseFloat(p.input1), M = {};
5540
5541
  switch (p.filterType) {
5541
5542
  case "clear":
5542
5543
  M = { channelFiltersToClear: p.selChannels };
5543
5544
  break;
5544
5545
  case "bandpass":
5545
- let Z = (_ + q) / 2, Q = Math.abs((q - _) / 2);
5546
+ let Z = (w + O) / 2, Q = Math.abs((O - w) / 2);
5546
5547
  M = {
5547
5548
  filter: p.filterType,
5548
5549
  filterParameters: [4, Z, Q],
@@ -5552,23 +5553,23 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5552
5553
  case "highpass":
5553
5554
  M = {
5554
5555
  filter: p.filterType,
5555
- filterParameters: [4, _],
5556
+ filterParameters: [4, w],
5556
5557
  channels: p.selChannels
5557
5558
  };
5558
5559
  break;
5559
5560
  case "lowpass":
5560
5561
  M = {
5561
5562
  filter: p.filterType,
5562
- filterParameters: [4, _],
5563
+ filterParameters: [4, w],
5563
5564
  channels: p.selChannels
5564
5565
  };
5565
5566
  break;
5566
5567
  case "bandstop":
5567
- let G = 10;
5568
+ let X = 10;
5568
5569
  const K = p.notchFreq;
5569
5570
  M = {
5570
5571
  filter: p.filterType,
5571
- filterParameters: [4, K, G],
5572
+ filterParameters: [4, K, X],
5572
5573
  channels: p.selChannels
5573
5574
  };
5574
5575
  break;
@@ -5577,30 +5578,30 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5577
5578
  }
5578
5579
  (F = s.value) == null || F.sendFilterMessage(M);
5579
5580
  for (let Z = 0; Z < p.selChannels.length; Z++) {
5580
- let Q = p.selChannels[Z], G = find(propEq("id", Q), t.value);
5581
- p.filterType === "clear" ? G.filter = {} : G.filter = {
5581
+ let Q = p.selChannels[Z], X = find(propEq("id", Q), t.value);
5582
+ p.filterType === "clear" ? X.filter = {} : X.filter = {
5582
5583
  type: p.filterType,
5583
- input0: _,
5584
- input1: q,
5584
+ input0: w,
5585
+ input1: O,
5585
5586
  notchFreq: p.notchFreq
5586
5587
  };
5587
5588
  }
5588
- (H = s.value) == null || H.invalidate(), ge();
5589
+ (G = s.value) == null || G.invalidate(), be();
5589
5590
  };
5590
5591
  return onMounted(() => {
5591
- k.value = ie();
5592
+ x.value = ie();
5592
5593
  }), c({
5593
5594
  rsPeriod: y,
5594
- resetFocusedAnnotation: X,
5595
- createAnnotationLayer: de,
5596
- getNextAnnotation: U,
5595
+ resetFocusedAnnotation: U,
5596
+ createAnnotationLayer: ce,
5597
+ getNextAnnotation: j,
5597
5598
  getPreviousAnnotation: re,
5598
- setFilters: x,
5599
- setActiveTool: N,
5600
- renderAll: ge,
5599
+ setFilters: C,
5600
+ setActiveTool: E,
5601
+ renderAll: be,
5601
5602
  renderAnnotationCanvas: qe,
5602
5603
  initViewerCanvas: Ce
5603
- }), (p, _) => (openBlock(), createElementBlock("div", _hoisted_1, [
5604
+ }), (p, w) => (openBlock(), createElementBlock("div", _hoisted_1, [
5604
5605
  createElementVNode("div", _hoisted_2, [
5605
5606
  createVNode(TSPlotCanvas, {
5606
5607
  ref_key: "plotCanvas",
@@ -5615,8 +5616,8 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5615
5616
  "rs-period": y.value,
5616
5617
  "global-zoom-mult": f.globalZoomMult,
5617
5618
  "active-viewer": f.activeViewer,
5618
- onChannelsInitialized: he,
5619
- onSetGlobalZoom: ue
5619
+ onChannelsInitialized: ue,
5620
+ onSetGlobalZoom: Re
5620
5621
  }, {
5621
5622
  axisCanvas: withCtx(() => [
5622
5623
  createElementVNode("canvas", {
@@ -5624,9 +5625,9 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5624
5625
  ref_key: "axisArea",
5625
5626
  ref: u,
5626
5627
  class: "canvas",
5627
- width: se(f.cWidth, k.value, 0),
5628
- height: se(f.cHeight, k.value, 0),
5629
- style: normalizeStyle(z.value)
5628
+ width: ae(f.cWidth, x.value, 0),
5629
+ height: ae(f.cHeight, x.value, 0),
5630
+ style: normalizeStyle($.value)
5630
5631
  }, null, 12, _hoisted_3)
5631
5632
  ]),
5632
5633
  annCanvas: withCtx(() => [
@@ -5635,9 +5636,9 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5635
5636
  ref_key: "annArea",
5636
5637
  ref: o,
5637
5638
  class: "canvas",
5638
- width: se(f.cWidth, k.value, 0),
5639
- height: se(B.value, k.value, 0),
5640
- style: normalizeStyle(D.value)
5639
+ width: ae(f.cWidth, x.value, 0),
5640
+ height: ae(W.value, x.value, 0),
5641
+ style: normalizeStyle(I.value)
5641
5642
  }, null, 12, _hoisted_4)
5642
5643
  ]),
5643
5644
  _: 1
@@ -5647,8 +5648,8 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5647
5648
  ref_key: "cursorArea",
5648
5649
  ref: h,
5649
5650
  class: "canvas",
5650
- width: se(f.cWidth + 5, k.value, 0),
5651
- height: se(f.cHeight, k.value, 0),
5651
+ width: ae(f.cWidth + 5, x.value, 0),
5652
+ height: ae(f.cHeight, x.value, 0),
5652
5653
  style: normalizeStyle(Y.value)
5653
5654
  }, null, 12, _hoisted_5),
5654
5655
  createVNode(unref(l), {
@@ -5658,34 +5659,34 @@ const _hoisted_1$1 = { class: "timeseries-plot-canvas" }, _hoisted_2$1 = ["width
5658
5659
  "c-height": f.cHeight,
5659
5660
  constants: f.constants,
5660
5661
  "annotations-canvas": o.value,
5661
- "pixel-ratio": k.value,
5662
+ "pixel-ratio": x.value,
5662
5663
  "rs-period": y.value,
5663
5664
  start: f.start,
5664
5665
  duration: f.duration,
5665
5666
  "ts-end": f.tsEnd,
5666
- "pointer-mode": j.value,
5667
+ "pointer-mode": z.value,
5667
5668
  "viewer-active-tool": unref(n),
5668
5669
  "active-viewer": f.activeViewer,
5669
5670
  onAnnLayersInitialized: ye,
5670
- onAnnotationsReceived: ce,
5671
- onCloseAnnotationLayerWindow: ae,
5672
- onUpdateAnnotation: le
5671
+ onAnnotationsReceived: oe,
5672
+ onCloseAnnotationLayerWindow: fe,
5673
+ onUpdateAnnotation: se
5673
5674
  }, null, 8, ["c-width", "c-height", "constants", "annotations-canvas", "pixel-ratio", "rs-period", "start", "duration", "ts-end", "pointer-mode", "viewer-active-tool", "active-viewer"]),
5674
5675
  createElementVNode("canvas", {
5675
5676
  id: "iArea",
5676
5677
  ref_key: "iArea",
5677
- ref: S,
5678
+ ref: R,
5678
5679
  class: "canvas",
5679
- width: se(f.cWidth, k.value, 0),
5680
- height: se(f.cHeight, k.value, 0),
5681
- style: normalizeStyle(z.value),
5680
+ width: ae(f.cWidth, x.value, 0),
5681
+ height: ae(f.cHeight, x.value, 0),
5682
+ style: normalizeStyle($.value),
5682
5683
  tabindex: "-1",
5683
- onWheel: we,
5684
+ onWheel: he,
5684
5685
  onMousemove: Se,
5685
5686
  onMousedown: me,
5686
- onMouseup: _e,
5687
+ onMouseup: we,
5687
5688
  onMouseout: ke,
5688
- onMouseenter: fe
5689
+ onMouseenter: de
5689
5690
  }, null, 44, _hoisted_6)
5690
5691
  ])
5691
5692
  ]));