@linkurious/ogma-annotations 1.1.7 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,43 +1,43 @@
1
- var kn = Object.defineProperty;
2
- var Tn = (u, l, t) => l in u ? kn(u, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[l] = t;
3
- var v = (u, l, t) => (Tn(u, typeof l != "symbol" ? l + "" : l, t), t);
4
- var In = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
- function ce(u) {
1
+ var _n = Object.defineProperty;
2
+ var In = (u, l, t) => l in u ? _n(u, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[l] = t;
3
+ var v = (u, l, t) => (In(u, typeof l != "symbol" ? l + "" : l, t), t);
4
+ var Mn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
+ function de(u) {
6
6
  return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
7
7
  }
8
- var $e = { exports: {} };
8
+ var Ne = { exports: {} };
9
9
  (function(u) {
10
10
  (function(l, t) {
11
11
  u.exports = t();
12
12
  })("Vector", function() {
13
13
  var l = function() {
14
14
  var t = Math.PI * 2, r = 180 / Math.PI, a = Math.PI / 180;
15
- function c(s) {
15
+ function h(s) {
16
16
  return Math.round(s * 1e8) / 1e8;
17
17
  }
18
- function d(s, f) {
19
- var m = f.x - s.x, A = f.y - s.y;
20
- return Math.sqrt(m * m + A * A);
18
+ function f(s, d) {
19
+ var m = d.x - s.x, S = d.y - s.y;
20
+ return Math.sqrt(m * m + S * S);
21
21
  }
22
- function g(s, f, m) {
23
- var A = f.y - s.y, T = f.x - s.x, S = Math.atan2(A, T);
22
+ function g(s, d, m) {
23
+ var S = d.y - s.y, T = d.x - s.x, b = Math.atan2(S, T);
24
24
  if (m)
25
- for (; S < 0; )
26
- S += t;
27
- return S;
25
+ for (; b < 0; )
26
+ b += t;
27
+ return b;
28
28
  }
29
- function p(s, f) {
30
- this.x = s !== void 0 ? s : 0, this.y = f !== void 0 ? f : 0;
29
+ function p(s, d) {
30
+ this.x = s !== void 0 ? s : 0, this.y = d !== void 0 ? d : 0;
31
31
  }
32
32
  return p.fromRadians = function(s) {
33
- var f = Math.cos(s), m = Math.sin(s);
34
- return new p(f, m);
33
+ var d = Math.cos(s), m = Math.sin(s);
34
+ return new p(d, m);
35
35
  }, p.fromDegrees = function(s) {
36
- var f = s * (Math.PI / 180);
37
- return p.fromRadians(f);
36
+ var d = s * (Math.PI / 180);
37
+ return p.fromRadians(d);
38
38
  }, p.fromString = function(s) {
39
- var f = s.split(",");
40
- return new p(parseFloat(f[0]), parseFloat(f[1]));
39
+ var d = s.split(",");
40
+ return new p(parseFloat(d[0]), parseFloat(d[1]));
41
41
  }, p.fromArray = function(s) {
42
42
  return new p(s[0], s[1]);
43
43
  }, p.prototype = {
@@ -100,8 +100,8 @@ var $e = { exports: {} };
100
100
  // @param x - optional x component to set.
101
101
  // @param y - optional y component to set.
102
102
  // @return self.
103
- set: function(s, f) {
104
- return s !== void 0 && (this.x = s), f !== void 0 && (this.y = f), this;
103
+ set: function(s, d) {
104
+ return s !== void 0 && (this.x = s), d !== void 0 && (this.y = d), this;
105
105
  },
106
106
  // [API]
107
107
  // [chainable, clone]
@@ -137,7 +137,7 @@ var $e = { exports: {} };
137
137
  // @param other - vector to get distance from.
138
138
  // @return distance between vectors.
139
139
  distanceFrom: function(s) {
140
- return d(this, s);
140
+ return f(this, s);
141
141
  },
142
142
  // [API]
143
143
  // []
@@ -191,8 +191,8 @@ var $e = { exports: {} };
191
191
  // @param radians - radians to rotate this vector by (can be positive or negative).
192
192
  // @return self.
193
193
  rotateRadiansSelf: function(s) {
194
- var f = Math.cos(s), m = Math.sin(s), A = this.x * f - this.y * m, T = this.x * m + this.y * f;
195
- return this.x = c(A), this.y = c(T), this;
194
+ var d = Math.cos(s), m = Math.sin(s), S = this.x * d - this.y * m, T = this.x * m + this.y * d;
195
+ return this.x = h(S), this.y = h(T), this;
196
196
  },
197
197
  // [API]
198
198
  // [chainable]
@@ -368,8 +368,8 @@ var $e = { exports: {} };
368
368
  // @param min - min value for x, y components.
369
369
  // @param max - max value for x, y components.
370
370
  // @return self.
371
- clampSelf: function(s, f) {
372
- return this.x < s.x && (this.x = s.x), this.y < s.y && (this.y = s.y), this.x > f.x && (this.x = f.x), this.y > f.y && (this.y = f.y), this;
371
+ clampSelf: function(s, d) {
372
+ return this.x < s.x && (this.x = s.x), this.y < s.y && (this.y = s.y), this.x > d.x && (this.x = d.x), this.y > d.y && (this.y = d.y), this;
373
373
  },
374
374
  // [API]
375
375
  // [chainable, clone]
@@ -378,8 +378,8 @@ var $e = { exports: {} };
378
378
  // @param min - min value for x, y components.
379
379
  // @param max - max value for x, y components.
380
380
  // @return cloned vector in range.
381
- clamp: function(s, f) {
382
- return this.clone().clampSelf(s, f);
381
+ clamp: function(s, d) {
382
+ return this.clone().clampSelf(s, d);
383
383
  },
384
384
  // [API]
385
385
  // [chainable, changeSelf]
@@ -450,8 +450,8 @@ var $e = { exports: {} };
450
450
  // @param x - default value for x if undefined (0 if not defined).
451
451
  // @param y - default value for y if undefined (0 if not defined).
452
452
  // @return self.
453
- repairSelf: function(s, f) {
454
- return (typeof this.x != "number" || isNaN(this.x + 1)) && (this.x = s || 0), (typeof this.y != "number" || isNaN(this.y + 1)) && (this.y = f || 0), this;
453
+ repairSelf: function(s, d) {
454
+ return (typeof this.x != "number" || isNaN(this.x + 1)) && (this.x = s || 0), (typeof this.y != "number" || isNaN(this.y + 1)) && (this.y = d || 0), this;
455
455
  },
456
456
  // [API]
457
457
  // [chainable, clone]
@@ -460,8 +460,8 @@ var $e = { exports: {} };
460
460
  // @param x - default value for x if undefined (0 if not defined).
461
461
  // @param y - default value for y if undefined (0 if not defined).
462
462
  // @return repaired clone.
463
- repair: function(s, f) {
464
- return this.clone().repairSelf(s, f);
463
+ repair: function(s, d) {
464
+ return this.clone().repairSelf(s, d);
465
465
  },
466
466
  // [API]
467
467
  // []
@@ -482,23 +482,23 @@ var $e = { exports: {} };
482
482
  }();
483
483
  return l.zero = new l(0, 0), l.one = new l(1, 1), l.up = new l(0, -1), l.down = new l(0, 1), l.left = new l(-1, 0), l.right = new l(1, 0), l.upLeft = new l(-1, -1), l.downLeft = new l(-1, 1), l.upRight = new l(1, -1), l.downRight = new l(1, 1), l.prototype.magnitude = l.prototype.length, Object.freeze && (Object.freeze(l.zero), Object.freeze(l.one), Object.freeze(l.up), Object.freeze(l.down), Object.freeze(l.left), Object.freeze(l.right), Object.freeze(l.upLeft), Object.freeze(l.downLeft), Object.freeze(l.upRight), Object.freeze(l.downRight)), l;
484
484
  });
485
- })($e);
486
- var _n = $e.exports;
487
- const U = /* @__PURE__ */ ce(_n);
485
+ })(Ne);
486
+ var Dn = Ne.exports;
487
+ const Y = /* @__PURE__ */ de(Dn);
488
488
  let Xt = (u = 21) => crypto.getRandomValues(new Uint8Array(u)).reduce((l, t) => (t &= 63, t < 36 ? l += t.toString(36) : t < 62 ? l += (t - 26).toString(36).toUpperCase() : t > 62 ? l += "-" : l += "_", l), "");
489
- const Lt = {
489
+ const zt = {
490
490
  strokeType: "plain",
491
491
  strokeColor: "black",
492
492
  strokeWidth: 1,
493
493
  head: "none",
494
494
  tail: "none"
495
- }, Ee = {
495
+ }, Te = {
496
496
  id: 0,
497
497
  type: "Feature",
498
498
  properties: {
499
499
  type: "arrow",
500
500
  style: {
501
- ...Lt
501
+ ...zt
502
502
  }
503
503
  },
504
504
  geometry: {
@@ -518,13 +518,13 @@ const Lt = {
518
518
  // tail: 'arrow-plain',
519
519
  // start: { x: 0, y: 0 },
520
520
  // end: { x: 100, y: 100 }
521
- }, Dn = (u = 0, l = 0, t = 0, r = 0, a = { ...Lt }) => ({
521
+ }, On = (u = 0, l = 0, t = 0, r = 0, a = { ...zt }) => ({
522
522
  id: Xt(),
523
523
  type: "Feature",
524
524
  properties: {
525
525
  type: "arrow",
526
526
  style: {
527
- ...Lt,
527
+ ...zt,
528
528
  ...a
529
529
  }
530
530
  },
@@ -535,29 +535,29 @@ const Lt = {
535
535
  [t, r]
536
536
  ]
537
537
  }
538
- }), On = "http://www.w3.org/2000/svg";
539
- function Mt(u) {
540
- return document.createElementNS(On, u);
538
+ }), Ln = "http://www.w3.org/2000/svg";
539
+ function Ot(u) {
540
+ return document.createElementNS(Ln, u);
541
541
  }
542
- function Pe(u) {
543
- return u.geometry.bbox || Mn(u), u.geometry.bbox;
542
+ function He(u) {
543
+ return u.geometry.bbox || zn(u), u.geometry.bbox;
544
544
  }
545
545
  function ut(u) {
546
- const l = Pe(u);
546
+ const l = He(u);
547
547
  return {
548
548
  width: l[2] - l[0],
549
549
  height: l[3] - l[1]
550
550
  };
551
551
  }
552
552
  function ct(u) {
553
- const l = Pe(u);
553
+ const l = He(u);
554
554
  return { x: l[0], y: l[1] };
555
555
  }
556
- function Mn(u) {
556
+ function zn(u) {
557
557
  const [l, t] = u.geometry.coordinates[0][0], [r, a] = u.geometry.coordinates[0][2];
558
558
  u.geometry.bbox = [l, t, r, a];
559
559
  }
560
- function zn(u, l, t, r, a) {
560
+ function Cn(u, l, t, r, a) {
561
561
  u.geometry.bbox = [l, t, l + r, t + a], u.geometry.coordinates = [
562
562
  [
563
563
  [l, t],
@@ -568,7 +568,7 @@ function zn(u, l, t, r, a) {
568
568
  ]
569
569
  ];
570
570
  }
571
- function zt(u) {
571
+ function Lt(u) {
572
572
  const [l, t] = u.geometry.coordinates[0];
573
573
  return { x: l, y: t };
574
574
  }
@@ -576,25 +576,25 @@ function jt(u, l) {
576
576
  const [t, r] = u.geometry.coordinates[l === "start" ? 0 : 1];
577
577
  return { x: t, y: r };
578
578
  }
579
- function qt(u) {
579
+ function Bt(u) {
580
580
  const [l, t] = u.geometry.coordinates[1];
581
581
  return { x: l, y: t };
582
582
  }
583
- function Ne(u, l, t) {
583
+ function Re(u, l, t) {
584
584
  u.geometry.coordinates[0] = [l, t];
585
585
  }
586
- function Re(u, l, t) {
586
+ function je(u, l, t) {
587
587
  u.geometry.coordinates[1] = [l, t];
588
588
  }
589
589
  function Vt(u) {
590
- return { start: zt(u), end: qt(u) };
590
+ return { start: Lt(u), end: Bt(u) };
591
591
  }
592
592
  function bt(u, l, t, r) {
593
- l === "start" ? Ne(u, t, r) : Re(u, t, r);
593
+ l === "start" ? Re(u, t, r) : je(u, t, r);
594
594
  }
595
- const He = (u) => parseInt(u.getAttribute("data-handle-id") || "-1");
596
- function Xn(u) {
597
- return Bt(u).reduce(
595
+ const Fe = (u) => parseInt(u.getAttribute("data-handle-id") || "-1");
596
+ function Gn(u) {
597
+ return qt(u).reduce(
598
598
  (l, t) => (l[0] = Math.min(t[0], l[0]), l[1] = Math.min(t[1], l[1]), l[2] = Math.max(t[0], l[2]), l[3] = Math.max(t[1], l[3]), l),
599
599
  [
600
600
  Number.POSITIVE_INFINITY,
@@ -604,18 +604,18 @@ function Xn(u) {
604
604
  ]
605
605
  );
606
606
  }
607
- function Bt(u) {
607
+ function qt(u) {
608
608
  let l = [];
609
609
  return u.type == "Point" ? l = [u.coordinates] : u.type == "LineString" || u.type == "MultiPoint" ? l = u.coordinates : u.type == "Polygon" || u.type == "MultiLineString" ? l = u.coordinates.reduce(function(t, r) {
610
610
  return t.concat(r);
611
611
  }, []) : u.type == "MultiPolygon" ? l = u.coordinates.reduce(
612
- (t, r) => t.concat(r.reduce((a, c) => a.concat(c), [])),
612
+ (t, r) => t.concat(r.reduce((a, h) => a.concat(h), [])),
613
613
  []
614
- ) : u.type == "Feature" ? l = Bt(u.geometry) : u.type == "GeometryCollection" ? l = u.geometries.reduce(
615
- (t, r) => t.concat(Bt(r)),
614
+ ) : u.type == "Feature" ? l = qt(u.geometry) : u.type == "GeometryCollection" ? l = u.geometries.reduce(
615
+ (t, r) => t.concat(qt(r)),
616
616
  []
617
617
  ) : u.type == "FeatureCollection" && (l = u.features.reduce(
618
- (t, r) => t.concat(Bt(r)),
618
+ (t, r) => t.concat(qt(r)),
619
619
  []
620
620
  )), l;
621
621
  }
@@ -626,141 +626,141 @@ function Ft(u, l, t) {
626
626
  y: l.y + t * Math.sin(r)
627
627
  };
628
628
  }
629
- function je(u, l = 5, t = 30) {
629
+ function qe(u, l = 5, t = 30) {
630
630
  var s;
631
- const { start: r, end: a } = Vt(u), c = new U(r.x, r.y), g = new U(a.x, a.y).sub(c), p = u.properties.style && u.properties.style.strokeWidth ? (s = u.properties.style) == null ? void 0 : s.strokeWidth : 0;
631
+ const { start: r, end: a } = Vt(u), h = new Y(r.x, r.y), g = new Y(a.x, a.y).sub(h), p = u.properties.style && u.properties.style.strokeWidth ? (s = u.properties.style) == null ? void 0 : s.strokeWidth : 0;
632
632
  return Math.min(t, Math.max(3 * p, g.length() * 0.1, l));
633
633
  }
634
- function ke(u, l, t, r) {
634
+ function _e(u, l, t, r) {
635
635
  const a = l.clone().normalize().invert().mul(r);
636
636
  if (!t || t === "none")
637
637
  return "";
638
- const c = u.clone().add(a.rotateRadians(Math.PI / 8)), d = u.clone().add(a.rotateRadians(-Math.PI / 8)), g = `${u.x} ${u.y}`;
639
- return `M ${c.x} ${c.y} L ${g} ${d.x} ${d.y} ${t === "arrow" ? "" : `${c.x} ${c.y}`}`;
638
+ const h = u.clone().add(a.rotateRadians(Math.PI / 8)), f = u.clone().add(a.rotateRadians(-Math.PI / 8)), g = `${u.x} ${u.y}`;
639
+ return `M ${h.x} ${h.y} L ${g} ${f.x} ${f.y} ${t === "arrow" ? "" : `${h.x} ${h.y}`}`;
640
640
  }
641
- function Ln(u, l, t, r, a) {
642
- const { start: c, end: d } = Vt(u), { tail: g, head: p, strokeColor: s, strokeWidth: f } = u.properties.style || t, m = new U(c.x, c.y), A = new U(d.x, d.y), T = A.clone().sub(m), S = je(u, r, a), C = Mt("path");
643
- C.setAttribute("data-annotation", `${u.id}`), C.setAttribute("data-annotation-type", "arrow");
644
- const k = p === "arrow-plain" || g === "arrow";
645
- C.setAttribute("stroke", s || "none"), C.setAttribute("stroke-width", `${f}`), C.setAttribute("fill", k ? s || "" : "none"), C.setAttribute("stroke-linecap", "round"), C.setAttribute("stroke-linejoin", "round");
646
- const F = ke(m, T.clone().invert(), g, S), X = ke(A, T, p, S), D = F + `M ${m.x} ${m.y} ${A.x} ${A.y}` + X;
647
- C.setAttribute("d", D), l.appendChild(C);
641
+ function $n(u, l, t, r, a) {
642
+ const { start: h, end: f } = Vt(u), { tail: g, head: p, strokeColor: s, strokeWidth: d } = u.properties.style || t, m = new Y(h.x, h.y), S = new Y(f.x, f.y), T = S.clone().sub(m), b = qe(u, r, a), D = Ot("path");
643
+ D.setAttribute("data-annotation", `${u.id}`), D.setAttribute("data-annotation-type", "arrow");
644
+ const A = p === "arrow-plain" || g === "arrow";
645
+ D.setAttribute("stroke", s || "none"), D.setAttribute("stroke-width", `${d}`), D.setAttribute("fill", A ? s || "" : "none"), D.setAttribute("stroke-linecap", "round"), D.setAttribute("stroke-linejoin", "round");
646
+ const $ = _e(m, T.clone().invert(), g, b), N = _e(S, T, p, b), _ = $ + `M ${m.x} ${m.y} ${S.x} ${S.y}` + N;
647
+ D.setAttribute("d", _), l.appendChild(D);
648
648
  }
649
- const q = -1, Ut = "dragging", Yt = "dragstart", St = "dragend", se = "select", oe = "unselect", Cn = "hover", $n = "unhover", ae = "remove", le = "add", Pn = "cancelDrawing", he = "update", Nn = "link";
650
- var Fe = { exports: {} };
649
+ const V = -1, Ut = "dragging", Yt = "dragstart", St = "dragend", ae = "select", le = "unselect", Pn = "hover", Nn = "unhover", he = "remove", ce = "add", Hn = "cancelDrawing", ue = "update", Rn = "link";
650
+ var Be = { exports: {} };
651
651
  (function(u) {
652
652
  var l = Object.prototype.hasOwnProperty, t = "~";
653
653
  function r() {
654
654
  }
655
655
  Object.create && (r.prototype = /* @__PURE__ */ Object.create(null), new r().__proto__ || (t = !1));
656
- function a(p, s, f) {
657
- this.fn = p, this.context = s, this.once = f || !1;
656
+ function a(p, s, d) {
657
+ this.fn = p, this.context = s, this.once = d || !1;
658
658
  }
659
- function c(p, s, f, m, A) {
660
- if (typeof f != "function")
659
+ function h(p, s, d, m, S) {
660
+ if (typeof d != "function")
661
661
  throw new TypeError("The listener must be a function");
662
- var T = new a(f, m || p, A), S = t ? t + s : s;
663
- return p._events[S] ? p._events[S].fn ? p._events[S] = [p._events[S], T] : p._events[S].push(T) : (p._events[S] = T, p._eventsCount++), p;
662
+ var T = new a(d, m || p, S), b = t ? t + s : s;
663
+ return p._events[b] ? p._events[b].fn ? p._events[b] = [p._events[b], T] : p._events[b].push(T) : (p._events[b] = T, p._eventsCount++), p;
664
664
  }
665
- function d(p, s) {
665
+ function f(p, s) {
666
666
  --p._eventsCount === 0 ? p._events = new r() : delete p._events[s];
667
667
  }
668
668
  function g() {
669
669
  this._events = new r(), this._eventsCount = 0;
670
670
  }
671
671
  g.prototype.eventNames = function() {
672
- var s = [], f, m;
672
+ var s = [], d, m;
673
673
  if (this._eventsCount === 0)
674
674
  return s;
675
- for (m in f = this._events)
676
- l.call(f, m) && s.push(t ? m.slice(1) : m);
677
- return Object.getOwnPropertySymbols ? s.concat(Object.getOwnPropertySymbols(f)) : s;
675
+ for (m in d = this._events)
676
+ l.call(d, m) && s.push(t ? m.slice(1) : m);
677
+ return Object.getOwnPropertySymbols ? s.concat(Object.getOwnPropertySymbols(d)) : s;
678
678
  }, g.prototype.listeners = function(s) {
679
- var f = t ? t + s : s, m = this._events[f];
679
+ var d = t ? t + s : s, m = this._events[d];
680
680
  if (!m)
681
681
  return [];
682
682
  if (m.fn)
683
683
  return [m.fn];
684
- for (var A = 0, T = m.length, S = new Array(T); A < T; A++)
685
- S[A] = m[A].fn;
686
- return S;
684
+ for (var S = 0, T = m.length, b = new Array(T); S < T; S++)
685
+ b[S] = m[S].fn;
686
+ return b;
687
687
  }, g.prototype.listenerCount = function(s) {
688
- var f = t ? t + s : s, m = this._events[f];
688
+ var d = t ? t + s : s, m = this._events[d];
689
689
  return m ? m.fn ? 1 : m.length : 0;
690
- }, g.prototype.emit = function(s, f, m, A, T, S) {
691
- var C = t ? t + s : s;
692
- if (!this._events[C])
690
+ }, g.prototype.emit = function(s, d, m, S, T, b) {
691
+ var D = t ? t + s : s;
692
+ if (!this._events[D])
693
693
  return !1;
694
- var k = this._events[C], F = arguments.length, X, D;
695
- if (k.fn) {
696
- switch (k.once && this.removeListener(s, k.fn, void 0, !0), F) {
694
+ var A = this._events[D], $ = arguments.length, N, _;
695
+ if (A.fn) {
696
+ switch (A.once && this.removeListener(s, A.fn, void 0, !0), $) {
697
697
  case 1:
698
- return k.fn.call(k.context), !0;
698
+ return A.fn.call(A.context), !0;
699
699
  case 2:
700
- return k.fn.call(k.context, f), !0;
700
+ return A.fn.call(A.context, d), !0;
701
701
  case 3:
702
- return k.fn.call(k.context, f, m), !0;
702
+ return A.fn.call(A.context, d, m), !0;
703
703
  case 4:
704
- return k.fn.call(k.context, f, m, A), !0;
704
+ return A.fn.call(A.context, d, m, S), !0;
705
705
  case 5:
706
- return k.fn.call(k.context, f, m, A, T), !0;
706
+ return A.fn.call(A.context, d, m, S, T), !0;
707
707
  case 6:
708
- return k.fn.call(k.context, f, m, A, T, S), !0;
708
+ return A.fn.call(A.context, d, m, S, T, b), !0;
709
709
  }
710
- for (D = 1, X = new Array(F - 1); D < F; D++)
711
- X[D - 1] = arguments[D];
712
- k.fn.apply(k.context, X);
710
+ for (_ = 1, N = new Array($ - 1); _ < $; _++)
711
+ N[_ - 1] = arguments[_];
712
+ A.fn.apply(A.context, N);
713
713
  } else {
714
- var Y = k.length, G;
715
- for (D = 0; D < Y; D++)
716
- switch (k[D].once && this.removeListener(s, k[D].fn, void 0, !0), F) {
714
+ var X = A.length, W;
715
+ for (_ = 0; _ < X; _++)
716
+ switch (A[_].once && this.removeListener(s, A[_].fn, void 0, !0), $) {
717
717
  case 1:
718
- k[D].fn.call(k[D].context);
718
+ A[_].fn.call(A[_].context);
719
719
  break;
720
720
  case 2:
721
- k[D].fn.call(k[D].context, f);
721
+ A[_].fn.call(A[_].context, d);
722
722
  break;
723
723
  case 3:
724
- k[D].fn.call(k[D].context, f, m);
724
+ A[_].fn.call(A[_].context, d, m);
725
725
  break;
726
726
  case 4:
727
- k[D].fn.call(k[D].context, f, m, A);
727
+ A[_].fn.call(A[_].context, d, m, S);
728
728
  break;
729
729
  default:
730
- if (!X)
731
- for (G = 1, X = new Array(F - 1); G < F; G++)
732
- X[G - 1] = arguments[G];
733
- k[D].fn.apply(k[D].context, X);
730
+ if (!N)
731
+ for (W = 1, N = new Array($ - 1); W < $; W++)
732
+ N[W - 1] = arguments[W];
733
+ A[_].fn.apply(A[_].context, N);
734
734
  }
735
735
  }
736
736
  return !0;
737
- }, g.prototype.on = function(s, f, m) {
738
- return c(this, s, f, m, !1);
739
- }, g.prototype.once = function(s, f, m) {
740
- return c(this, s, f, m, !0);
741
- }, g.prototype.removeListener = function(s, f, m, A) {
737
+ }, g.prototype.on = function(s, d, m) {
738
+ return h(this, s, d, m, !1);
739
+ }, g.prototype.once = function(s, d, m) {
740
+ return h(this, s, d, m, !0);
741
+ }, g.prototype.removeListener = function(s, d, m, S) {
742
742
  var T = t ? t + s : s;
743
743
  if (!this._events[T])
744
744
  return this;
745
- if (!f)
746
- return d(this, T), this;
747
- var S = this._events[T];
748
- if (S.fn)
749
- S.fn === f && (!A || S.once) && (!m || S.context === m) && d(this, T);
745
+ if (!d)
746
+ return f(this, T), this;
747
+ var b = this._events[T];
748
+ if (b.fn)
749
+ b.fn === d && (!S || b.once) && (!m || b.context === m) && f(this, T);
750
750
  else {
751
- for (var C = 0, k = [], F = S.length; C < F; C++)
752
- (S[C].fn !== f || A && !S[C].once || m && S[C].context !== m) && k.push(S[C]);
753
- k.length ? this._events[T] = k.length === 1 ? k[0] : k : d(this, T);
751
+ for (var D = 0, A = [], $ = b.length; D < $; D++)
752
+ (b[D].fn !== d || S && !b[D].once || m && b[D].context !== m) && A.push(b[D]);
753
+ A.length ? this._events[T] = A.length === 1 ? A[0] : A : f(this, T);
754
754
  }
755
755
  return this;
756
756
  }, g.prototype.removeAllListeners = function(s) {
757
- var f;
758
- return s ? (f = t ? t + s : s, this._events[f] && d(this, f)) : (this._events = new r(), this._eventsCount = 0), this;
757
+ var d;
758
+ return s ? (d = t ? t + s : s, this._events[d] && f(this, d)) : (this._events = new r(), this._eventsCount = 0), this;
759
759
  }, g.prototype.off = g.prototype.removeListener, g.prototype.addListener = g.prototype.on, g.prefixed = t, g.EventEmitter = g, u.exports = g;
760
- })(Fe);
761
- var Rn = Fe.exports;
762
- const Be = /* @__PURE__ */ ce(Rn);
763
- class qe extends Be {
760
+ })(Be);
761
+ var jn = Be.exports;
762
+ const Ve = /* @__PURE__ */ de(jn);
763
+ class Ue extends Ve {
764
764
  constructor(t, r) {
765
765
  super();
766
766
  v(this, "ogma");
@@ -768,8 +768,8 @@ class qe extends Be {
768
768
  // layer to draw elements
769
769
  v(this, "layer");
770
770
  v(this, "editor");
771
- v(this, "selectedId", q);
772
- v(this, "hoveredId", q);
771
+ v(this, "selectedId", V);
772
+ v(this, "hoveredId", V);
773
773
  // used to remember ogma options before we change them
774
774
  v(this, "ogmaOptions");
775
775
  v(this, "shouldDetect");
@@ -777,13 +777,13 @@ class qe extends Be {
777
777
  v(this, "showeditorOnHover");
778
778
  v(this, "maxHandleScale", 1.5);
779
779
  v(this, "_onKeyUp", (t) => {
780
- t.code === 27 && this.selectedId !== q ? this.unselect() : (t.code === 46 || t.code === 8) && this.selectedId !== q && this._canRemove() && this.remove(this.selectedId);
780
+ t.code === 27 && this.selectedId !== V ? this.unselect() : (t.code === 46 || t.code === 8) && this.selectedId !== V && this._canRemove() && this.remove(this.selectedId);
781
781
  });
782
782
  v(this, "_onClickMouseMove", (t) => {
783
- if (!t.domEvent || this.isDragging || !this.shouldDetect)
783
+ if (!t.domEvent || this.isDragging || !this.shouldDetect || t.domEvent.type !== "mousemove" && t.domEvent.target.tagName === "a")
784
784
  return;
785
785
  const r = this.ogma.view.screenToGraphCoordinates(t), a = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(r, 0) : void 0;
786
- t.domEvent.type === "mousemove" ? a ? this.hover(a.id) : this.hoveredId !== q && this.unhover() : a ? this.select(a.id) : this.selectedId !== q && this.unselect();
786
+ t.domEvent.type === "mousemove" ? a ? this.hover(a.id) : this.hoveredId !== V && this.unhover() : a ? this.select(a.id) : this.selectedId !== V && this.unselect();
787
787
  });
788
788
  this.ogma = t, this.elements = [], this.shouldDetect = !0, this.isDragging = !1, this.showeditorOnHover = !0, this.ogmaOptions = t.getOptions(), t.events.on(["click", "mousemove"], this._onClickMouseMove).on("keyup", this._onKeyUp).on("frame", () => {
789
789
  this.refreshEditor(), this.refreshDrawing();
@@ -814,7 +814,7 @@ class qe extends Be {
814
814
  ...t.geometry
815
815
  }
816
816
  });
817
- return this.elements.push(a), this.layer.refresh(), this.emit(le, a), a;
817
+ return this.elements.push(a), this.layer.refresh(), this.emit(ce, a), a;
818
818
  }
819
819
  updateStyle(t, r) {
820
820
  this.updateAnnotation(t, {
@@ -842,30 +842,31 @@ class qe extends Be {
842
842
  if (!t)
843
843
  return;
844
844
  const a = t.id;
845
- Object.keys(r).forEach((c) => {
846
- if (c !== "id")
847
- if (c === "properties") {
848
- const d = r.properties || { style: {} };
845
+ Object.keys(r).forEach((h) => {
846
+ if (h !== "id")
847
+ if (h === "properties") {
848
+ const f = r.properties || { style: {} };
849
849
  t.properties = {
850
850
  ...t.properties || {},
851
- ...d || {},
851
+ ...f || {},
852
852
  style: {
853
853
  ...t.properties.style || {},
854
- ...d.style || {}
854
+ ...f.style || {}
855
855
  }
856
856
  };
857
857
  } else
858
- c === "geometry" ? t.geometry = {
858
+ h === "geometry" ? t.geometry = {
859
859
  ...t.geometry,
860
860
  ...r.geometry
861
- } : t[c] = r[c];
861
+ } : t[h] = r[h];
862
862
  }), a === this.selectedId && this.refreshEditor(), this.layer.refresh();
863
863
  }
864
864
  getById(t) {
865
- for (let r = 0; r < this.elements.length; r++) {
866
- const a = this.elements[r];
867
- if (a.id === t)
868
- return a;
865
+ const r = Number(t);
866
+ for (let a = 0; a < this.elements.length; a++) {
867
+ const h = this.elements[a];
868
+ if (!(h.id !== t && h.id !== r))
869
+ return h;
869
870
  }
870
871
  }
871
872
  /**
@@ -875,22 +876,22 @@ class qe extends Be {
875
876
  */
876
877
  select(t) {
877
878
  const r = this.getById(t);
878
- r && (this.editor.show(), this.selectedId = t, this.refreshEditor(), this.layer.refresh(), this.emit(se, r));
879
+ r && (this.editor.show(), this.selectedId = t, this.refreshEditor(), this.layer.refresh(), this.emit(ae, r));
879
880
  }
880
881
  hover(t) {
881
882
  const r = this.getById(t);
882
- r && (this.showeditorOnHover && this.editor.show(), this.hoveredId = t, this.refreshEditor(), this.layer.refresh(), this.emit(Cn, r));
883
+ r && (this.showeditorOnHover && this.editor.show(), this.hoveredId = t, this.refreshEditor(), this.layer.refresh(), this.emit(Pn, r));
883
884
  }
884
885
  getSelectedFeature() {
885
- return this.selectedId === q ? null : this.getById(this.selectedId);
886
+ return this.selectedId === V ? null : this.getById(this.selectedId);
886
887
  }
887
888
  unselect() {
888
889
  const t = this.getById(this.selectedId);
889
- return t && this.emit(oe, t), this.selectedId = q, this.hoveredId === q && this.editor.hide(), this.layer.refresh(), this;
890
+ return t && this.emit(le, t), this.selectedId = V, this.hoveredId === V && this.editor.hide(), this.layer.refresh(), this;
890
891
  }
891
892
  unhover() {
892
893
  const t = this.getById(this.hoveredId);
893
- return this.emit($n, t), this.hoveredId = q, this.selectedId === q && this.editor.hide(), this.layer.refresh(), this;
894
+ return this.emit(Nn, t), this.hoveredId = V, this.selectedId === V && this.editor.hide(), this.layer.refresh(), this;
894
895
  }
895
896
  /**
896
897
  * @method remove
@@ -899,7 +900,7 @@ class qe extends Be {
899
900
  */
900
901
  remove(t) {
901
902
  const r = this.getById(t);
902
- t === this.hoveredId && this.unhover(), t === this.selectedId && this.unselect(), this.elements = this.elements.filter((a) => a.id !== t), r && this.emit(ae, r), this.layer.refresh();
903
+ t === this.hoveredId && this.unhover(), t === this.selectedId && this.unselect(), this.elements = this.elements.filter((a) => a.id !== t), r && this.emit(he, r), this.layer.refresh();
903
904
  }
904
905
  /**
905
906
  * @method disableDragging
@@ -949,24 +950,24 @@ class qe extends Be {
949
950
  this.ogma.events.off(this._onClickMouseMove).off(this._onKeyUp), this.layer.destroy();
950
951
  }
951
952
  }
952
- const Te = "handle-line", Ie = "handle-start", _e = "handle-end";
953
- class Hn extends qe {
953
+ const Ie = "handle-line", Me = "handle-start", De = "handle-end";
954
+ class Fn extends Ue {
954
955
  constructor(t, r = {}) {
955
956
  super(
956
957
  t,
957
958
  `
958
959
  <div class="arrow-handle">
959
- <div id="${Te}" data-handle-id="0" class="handle line"></div>
960
- <div id="${Ie}" data-handle-id="1" class="handle"></div>
961
- <div id="${_e}" data-handle-id="2" class="handle"></div>
960
+ <div id="${Ie}" data-handle-id="0" class="handle line"></div>
961
+ <div id="${Me}" data-handle-id="1" class="handle"></div>
962
+ <div id="${De}" data-handle-id="2" class="handle"></div>
962
963
  </div>
963
964
  `
964
965
  );
965
966
  // active handle id
966
- v(this, "draggedHandle", q);
967
+ v(this, "draggedHandle", V);
967
968
  v(this, "start", { x: 0, y: 0 });
968
969
  v(this, "end", { x: 0, y: 0 });
969
- v(this, "arrow", { ...Ee });
970
+ v(this, "arrow", { ...Te });
970
971
  v(this, "startX", 0);
971
972
  v(this, "startY", 0);
972
973
  v(this, "minArrowHeight", 0);
@@ -974,16 +975,16 @@ class Hn extends qe {
974
975
  v(this, "handles", []);
975
976
  v(this, "onHandleMouseDown", (t) => {
976
977
  const r = this.getById(this.selectedId) || this.getById(this.hoveredId);
977
- r && (this.startDragging(r, t.clientX, t.clientY), this.draggedHandle = He(t.target));
978
+ r && (this.startDragging(r, t.clientX, t.clientY), this.draggedHandle = Fe(t.target));
978
979
  });
979
980
  v(this, "onMouseUp", () => {
980
- this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = q, this.emit(St, this.arrow));
981
+ this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = V, this.emit(St, this.arrow));
981
982
  });
982
983
  v(this, "onMouseMove", (t) => {
983
- if (!this.isDragging || this.draggedHandle === q)
984
+ if (!this.isDragging || this.draggedHandle === V)
984
985
  return;
985
- const r = this.handles[this.draggedHandle], a = this.ogma.view.getAngle(), { x: c, y: d } = new U(t.clientX - this.startX, t.clientY - this.startY).divScalar(this.ogma.view.getZoom()).rotateRadians(a), g = r.id === Te, p = r.id === Ie, s = r.id === _e;
986
- (g || p) && Ne(this.arrow, this.start.x + c, this.start.y + d), (g || s) && Re(this.arrow, this.end.x + c, this.end.y + d), this.emit(
986
+ const r = this.handles[this.draggedHandle], a = this.ogma.view.getAngle(), { x: h, y: f } = new Y(t.clientX - this.startX, t.clientY - this.startY).divScalar(this.ogma.view.getZoom()).rotateRadians(a), g = r.id === Ie, p = r.id === Me, s = r.id === De;
987
+ (g || p) && Re(this.arrow, this.start.x + h, this.start.y + f), (g || s) && je(this.arrow, this.end.x + h, this.end.y + f), this.emit(
987
988
  Ut,
988
989
  this.arrow,
989
990
  g ? "line" : p ? "start" : "end"
@@ -1001,47 +1002,47 @@ class Hn extends qe {
1001
1002
  * @param y
1002
1003
  * @param arrow
1003
1004
  */
1004
- startDrawing(t, r, a = Dn(t, r, t, r, Lt)) {
1005
+ startDrawing(t, r, a = On(t, r, t, r, zt)) {
1005
1006
  var g;
1006
1007
  this.add(a), this.hoveredId = a.id;
1007
- const c = this.ogma.view.graphToScreenCoordinates({ x: t, y: r }), d = ((g = this.ogma.getContainer()) == null ? void 0 : g.getBoundingClientRect()) || { left: 0, top: 0 };
1008
- this.startDragging(this.getById(a.id), c.x + (d == null ? void 0 : d.left), c.y + d.top), this.draggedHandle = 2;
1008
+ const h = this.ogma.view.graphToScreenCoordinates({ x: t, y: r }), f = ((g = this.ogma.getContainer()) == null ? void 0 : g.getBoundingClientRect()) || { left: 0, top: 0 };
1009
+ this.startDragging(this.getById(a.id), h.x + (f == null ? void 0 : f.left), h.y + f.top), this.draggedHandle = 2;
1009
1010
  }
1010
1011
  cancelDrawing() {
1011
- this.isDragging && (this.remove(this.arrow.id), this.emit(St, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = q);
1012
+ this.isDragging && (this.remove(this.arrow.id), this.emit(St, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = V);
1012
1013
  }
1013
1014
  startDragging(t, r, a) {
1014
- this.selectedId !== t.id && this.select(this.hoveredId), this.arrow = t, this.startX = r, this.startY = a, this.start = zt(this.arrow), this.end = qt(this.arrow), this.disableDragging(), this.emit(Yt, this.arrow), this.isDragging = !0;
1015
+ this.selectedId !== t.id && this.select(this.hoveredId), this.arrow = t, this.startX = r, this.startY = a, this.start = Lt(this.arrow), this.end = Bt(this.arrow), this.disableDragging(), this.emit(Yt, this.arrow), this.isDragging = !0;
1015
1016
  }
1016
1017
  detect(t, r = 0) {
1017
1018
  return this.elements.find((a) => {
1018
- const { start: c, end: d } = Vt(a), g = new U(t.x, t.y).sub(
1019
- new U((c.x + d.x) / 2, (c.y + d.y) / 2)
1020
- ), p = new U(d.x, d.y).sub(new U(c.x, c.y)), s = p.length(), f = p.normalize(), m = je(a);
1021
- return Math.abs(f.dot(g)) < s / 2 + r && Math.abs(f.rotateRadians(Math.PI / 2).dot(g)) < m / 2 + r;
1019
+ const { start: h, end: f } = Vt(a), g = new Y(t.x, t.y).sub(
1020
+ new Y((h.x + f.x) / 2, (h.y + f.y) / 2)
1021
+ ), p = new Y(f.x, f.y).sub(new Y(h.x, h.y)), s = p.length(), d = p.normalize(), m = qe(a);
1022
+ return Math.abs(d.dot(g)) < s / 2 + r && Math.abs(d.rotateRadians(Math.PI / 2).dot(g)) < m / 2 + r;
1022
1023
  });
1023
1024
  }
1024
1025
  refreshEditor() {
1025
1026
  if (+this.selectedId < 0 && +this.hoveredId < 0)
1026
1027
  return;
1027
- const t = this.selectedId !== q ? this.getById(this.selectedId) : this.getById(this.hoveredId), r = Vt(t), a = this.ogma.view.graphToScreenCoordinates(r.start), c = this.ogma.view.graphToScreenCoordinates(r.end), d = Math.min(this.ogma.view.getZoom(), this.maxHandleScale), [g, p, s] = Array.prototype.slice.call(
1028
+ const t = this.selectedId !== V ? this.getById(this.selectedId) : this.getById(this.hoveredId), r = Vt(t), a = this.ogma.view.graphToScreenCoordinates(r.start), h = this.ogma.view.graphToScreenCoordinates(r.end), f = Math.min(this.ogma.view.getZoom(), this.maxHandleScale), [g, p, s] = Array.prototype.slice.call(
1028
1029
  this.editor.element.querySelectorAll(".handle")
1029
1030
  );
1030
- p.style.transform = `translate(${a.x}px, ${a.y}px) translate(-50%, -50%) scale(${d})`, s.style.transform = `translate(${c.x}px, ${c.y}px) translate(-50%, -50%) scale(${d}`;
1031
- const f = {
1032
- x: (c.x + a.x) / 2,
1033
- y: (c.y + a.y) / 2
1034
- }, m = new U(c.x - a.x, c.y - a.y), A = m.mul(1 / m.length()), T = Math.atan2(A.y, A.x);
1035
- g.style.width = `${m.length()}px`, g.style.left = `${f.x}px`, g.style.top = `${f.y}px`, g.style.transform = `translate(-50%, -50%) rotate(${T}rad)`;
1031
+ p.style.transform = `translate(${a.x}px, ${a.y}px) translate(-50%, -50%) scale(${f})`, s.style.transform = `translate(${h.x}px, ${h.y}px) translate(-50%, -50%) scale(${f}`;
1032
+ const d = {
1033
+ x: (h.x + a.x) / 2,
1034
+ y: (h.y + a.y) / 2
1035
+ }, m = new Y(h.x - a.x, h.y - a.y), S = m.mul(1 / m.length()), T = Math.atan2(S.y, S.x);
1036
+ g.style.width = `${m.length()}px`, g.style.left = `${d.x}px`, g.style.top = `${d.y}px`, g.style.transform = `translate(-50%, -50%) rotate(${T}rad)`;
1036
1037
  }
1037
1038
  getDefaultOptions() {
1038
- return Ee;
1039
+ return Te;
1039
1040
  }
1040
1041
  draw(t) {
1041
1042
  t.innerHTML = "";
1042
- const r = Mt("g"), a = this.ogma.view.getAngle();
1043
+ const r = Ot("g"), a = this.ogma.view.getAngle();
1043
1044
  r.setAttribute("transform", `rotate(${-a * (180 / Math.PI)})`), this.elements.forEach(
1044
- (c) => Ln(c, r, Lt, this.minArrowHeight, this.maxArrowHeight)
1045
+ (h) => $n(h, r, zt, this.minArrowHeight, this.maxArrowHeight)
1045
1046
  ), t.appendChild(r);
1046
1047
  }
1047
1048
  refreshDrawing() {
@@ -1082,16 +1083,16 @@ const At = {
1082
1083
  }
1083
1084
  // position: { x: 0, y: 0 },
1084
1085
  // size: { width: 100, height: 50 }
1085
- }, De = {
1086
+ }, Oe = {
1086
1087
  handleSize: 3.5,
1087
1088
  placeholder: "Your text..."
1088
- }, jn = (u = 0, l = 0, t = 100, r = 50, a = "", c = { ...At }) => ({
1089
+ }, qn = (u = 0, l = 0, t = 100, r = 50, a = "", h = { ...At }) => ({
1089
1090
  id: Xt(),
1090
1091
  type: "Feature",
1091
1092
  properties: {
1092
1093
  type: "text",
1093
1094
  content: a,
1094
- style: { ...At, ...c }
1095
+ style: { ...At, ...h }
1095
1096
  },
1096
1097
  geometry: {
1097
1098
  type: "Polygon",
@@ -1106,11 +1107,11 @@ const At = {
1106
1107
  ]
1107
1108
  }
1108
1109
  });
1109
- var Ve = { exports: {} };
1110
+ var Ye = { exports: {} };
1110
1111
  (function(u, l) {
1111
1112
  (function(t, r) {
1112
1113
  u.exports = r();
1113
- })(In, () => (() => {
1114
+ })(Mn, () => (() => {
1114
1115
  var t = { d: (e, n) => {
1115
1116
  for (var o in n)
1116
1117
  t.o(n, o) && !t.o(e, o) && Object.defineProperty(e, o, { enumerable: !0, get: n[o] });
@@ -1122,20 +1123,20 @@ var Ve = { exports: {} };
1122
1123
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1123
1124
  }, a(e);
1124
1125
  }
1125
- t.d(r, { default: () => Sn });
1126
- var c = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, d = /\bsmall-caps\b/, g = /\b(?:italic|oblique)\b/, p = /\bbold(?:er)?\b/, s = 13.3333333, f = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1126
+ t.d(r, { default: () => kn });
1127
+ var h = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, f = /\bsmall-caps\b/, g = /\b(?:italic|oblique)\b/, p = /\bbold(?:er)?\b/, s = 13.3333333, d = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1127
1128
  function m(e) {
1128
1129
  var n = "", o = this;
1129
1130
  return o.style && o.style !== "normal" && (n += o.style), o.variant && o.variant !== "normal" && (n += (n ? " " : "") + o.variant), o.weight && o.weight !== "normal" && (n += (n ? " " : "") + o.weight), o.size && (n += (n ? " " : "") + o.size + "px", o.height !== o.size && (n += "/" + o.height + "px")), o.family && (n += (n ? " " : "") + o.family), e && (n += "::" + o.baseline), e && (n += "::" + o.color), n;
1130
1131
  }
1131
- var A = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: m, valueOf: m };
1132
+ var S = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: m, valueOf: m };
1132
1133
  function T(e) {
1133
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = c.exec(e);
1134
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = h.exec(e);
1134
1135
  n.family = (o[6] || "").trim();
1135
- var i = f[o[2]] || parseFloat(o[2]);
1136
+ var i = d[o[2]] || parseFloat(o[2]);
1136
1137
  o[3] === "%" ? i *= 0.16 : o[3] === "em" ? i *= 16 : o[3] === "pt" && (i *= s), n.size = i;
1137
- var h = parseFloat(o[4]);
1138
- if (h !== "normal" && h !== "inherit" && h ? o[5] && o[5] !== "em" ? o[5] === "pt" ? n.height = h * s : o[5] === "%" ? n.height = 0.01 * i : n.height = h : n.height = h * i : n.height = Math.round(i * (7 / 6)), d.test(o[1]) && (n.variant = "small-caps"), g.test(o[1]) && (n.style = "italic"), p.test(o[1]))
1138
+ var c = parseFloat(o[4]);
1139
+ if (c !== "normal" && c !== "inherit" && c ? o[5] && o[5] !== "em" ? o[5] === "pt" ? n.height = c * s : o[5] === "%" ? n.height = 0.01 * i : n.height = c : n.height = c * i : n.height = Math.round(i * (7 / 6)), f.test(o[1]) && (n.variant = "small-caps"), g.test(o[1]) && (n.style = "italic"), p.test(o[1]))
1139
1140
  n.weight = "bold";
1140
1141
  else {
1141
1142
  var y = parseInt(/\b(\d+)\b/.exec(o[1]), 10);
@@ -1143,53 +1144,53 @@ var Ve = { exports: {} };
1143
1144
  }
1144
1145
  return n;
1145
1146
  }
1146
- function S() {
1147
- var e, n, o, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, y = 14, w = 12, x = null, b = null, E = "";
1147
+ function b() {
1148
+ var e, n, o, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, y = 14, w = 12, x = null, E = null, k = "";
1148
1149
  if (i && i.nodeType) {
1149
- var O = i && (i.ownerDocument && i.ownerDocument.defaultView || i.document && i || i.defaultView), M = O.getComputedStyle(i, null);
1150
- e = M.getPropertyValue("font-family") || "", w = parseFloat(M.getPropertyValue("font-size")), y = M.getPropertyValue("line-height"), x = M.getPropertyValue("font-weight"), b = M.getPropertyValue("font-style"), E = M.getPropertyValue("font-variant") || "";
1150
+ var O = i && (i.ownerDocument && i.ownerDocument.defaultView || i.document && i || i.defaultView), L = O.getComputedStyle(i, null);
1151
+ e = L.getPropertyValue("font-family") || "", w = parseFloat(L.getPropertyValue("font-size")), y = L.getPropertyValue("line-height"), x = L.getPropertyValue("font-weight"), E = L.getPropertyValue("font-style"), k = L.getPropertyValue("font-variant") || "";
1151
1152
  } else if (typeof i == "string") {
1152
1153
  var I = T(i);
1153
- e = I.family, w = I.size, y = I.height, E = I.variant, b = I.style, x = I.weight;
1154
+ e = I.family, w = I.size, y = I.height, k = I.variant, E = I.style, x = I.weight;
1154
1155
  } else
1155
- a(i) === "object" && (e = i.family, w = i.size, y = i.height, E = i.variant, x = i.weight, b = i.style, n = i.baseline, o = i.color);
1156
- h.size && h.size < 3 && (w *= h.size), y = y !== "normal" && y ? parseFloat(y) : w * (7 / 6), h.height && h.height < 3 && (y *= h.height);
1157
- var z = Object.create(A);
1158
- return z.family = h.family || e || "sans-serif", z.height = y ?? 14, z.size = w ?? 12, z.variant = h.variant || E || "", z.style = h.style || b || "", z.weight = h.weight || x || "", z.baseline = n || 0, h.baseline != null && (z.baseline = h.baseline), z.color = h.color || o || "", z.id = m.call(z, !0), z;
1156
+ a(i) === "object" && (e = i.family, w = i.size, y = i.height, k = i.variant, x = i.weight, E = i.style, n = i.baseline, o = i.color);
1157
+ c.size && c.size < 3 && (w *= c.size), y = y !== "normal" && y ? parseFloat(y) : w * (7 / 6), c.height && c.height < 3 && (y *= c.height);
1158
+ var z = Object.create(S);
1159
+ return z.family = c.family || e || "sans-serif", z.height = y ?? 14, z.size = w ?? 12, z.variant = c.variant || k || "", z.style = c.style || E || "", z.weight = c.weight || x || "", z.baseline = n || 0, c.baseline != null && (z.baseline = c.baseline), z.color = c.color || o || "", z.id = m.call(z, !0), z;
1159
1160
  }
1160
- const C = { "\n": 0.28, "\r": 0.28, " ": 0.28, " ": 0.28, " ": 0.28, "᠎": 0, " ": 0.5, " ": 1, " ": 0.5, " ": 1, " ": 0.33, " ": 0.25, " ": 0.16, " ": 0.56, " ": 0.28, " ": 0.2, " ": 0.15, "​": 0, " ": 0.16, " ": 0.22, " ": 1, "\uFEFF": 0 };
1161
- var k, F = function(e) {
1161
+ const D = { "\n": 0.28, "\r": 0.28, " ": 0.28, " ": 0.28, " ": 0.28, "᠎": 0, " ": 0.5, " ": 1, " ": 0.5, " ": 1, " ": 0.33, " ": 0.25, " ": 0.16, " ": 0.56, " ": 0.28, " ": 0.2, " ": 0.15, "​": 0, " ": 0.16, " ": 0.22, " ": 1, "\uFEFF": 0 };
1162
+ var A, $ = function(e) {
1162
1163
  var n = typeof OffscreenCanvas < "u" && new OffscreenCanvas(100, 100) || e && e.createElement("canvas");
1163
1164
  if (n && n.getContext) {
1164
1165
  var o = n.getContext("2d");
1165
1166
  if (o && typeof o.measureText == "function")
1166
- return function(i, h) {
1167
- return o.font = String(h), o.measureText(i).width;
1167
+ return function(i, c) {
1168
+ return o.font = String(c), o.measureText(i).width;
1168
1169
  };
1169
1170
  }
1170
- }(typeof document < "u" ? document : null) || (k = {}, function(e, n) {
1171
- if (!k[n]) {
1172
- var o = S(n);
1173
- k[n] = o, /\bmonospace\b/.test(o.family) ? o.size *= 0.6 : (o.size *= 0.45, o.weight && (o.size *= 1.18));
1171
+ }(typeof document < "u" ? document : null) || (A = {}, function(e, n) {
1172
+ if (!A[n]) {
1173
+ var o = b(n);
1174
+ A[n] = o, /\bmonospace\b/.test(o.family) ? o.size *= 0.6 : (o.size *= 0.45, o.weight && (o.size *= 1.18));
1174
1175
  }
1175
- return e.length * k[n].size;
1176
- }), X = {}, D = { trim: !0, collapse: !0 };
1177
- function Y(e, n, o) {
1178
- var i = Object.assign({}, D, o), h = String(e);
1179
- if (!h)
1176
+ return e.length * A[n].size;
1177
+ }), N = {}, _ = { trim: !0, collapse: !0 };
1178
+ function X(e, n, o) {
1179
+ var i = Object.assign({}, _, o), c = String(e);
1180
+ if (!c)
1180
1181
  return 0;
1181
- if (h in C) {
1182
- var y = n.id + "/" + h;
1183
- return y in X || (X[y] = F("_".concat(h, "_"), n) - F("__", n)), X[y];
1182
+ if (c in D) {
1183
+ var y = n.id + "/" + c;
1184
+ return y in N || (N[y] = $("_".concat(c, "_"), n) - $("__", n)), N[y];
1184
1185
  }
1185
- return i.trim && i.collapse ? i.trim ? h = h.trim() : i.collapse && (h = h.replace(/\s+/g, " ")) : h = h.replace(/\n/g, " "), F(h, n) + n.size * (e.tracking || 0);
1186
+ return i.trim && i.collapse ? i.trim ? c = c.trim() : i.collapse && (c = c.replace(/\s+/g, " ")) : c = c.replace(/\n/g, " "), $(c, n) + n.size * (e.tracking || 0);
1186
1187
  }
1187
- function G(e) {
1188
- return G = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1188
+ function W(e) {
1189
+ return W = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1189
1190
  return typeof n;
1190
1191
  } : function(n) {
1191
1192
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1192
- }, G(e);
1193
+ }, W(e);
1193
1194
  }
1194
1195
  function Et(e, n) {
1195
1196
  if (typeof n != "function" && n !== null)
@@ -1201,7 +1202,7 @@ var Ve = { exports: {} };
1201
1202
  return o.__proto__ = i, o;
1202
1203
  }, kt(e, n);
1203
1204
  }
1204
- function Gt(e) {
1205
+ function Wt(e) {
1205
1206
  var n = function() {
1206
1207
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
1207
1208
  return !1;
@@ -1217,15 +1218,15 @@ var Ve = { exports: {} };
1217
1218
  return function() {
1218
1219
  var o, i = Ct(e);
1219
1220
  if (n) {
1220
- var h = Ct(this).constructor;
1221
- o = Reflect.construct(i, arguments, h);
1221
+ var c = Ct(this).constructor;
1222
+ o = Reflect.construct(i, arguments, c);
1222
1223
  } else
1223
1224
  o = i.apply(this, arguments);
1224
- return Ue(this, o);
1225
+ return Xe(this, o);
1225
1226
  };
1226
1227
  }
1227
- function Ue(e, n) {
1228
- if (n && (G(n) === "object" || typeof n == "function"))
1228
+ function Xe(e, n) {
1229
+ if (n && (W(n) === "object" || typeof n == "function"))
1229
1230
  return n;
1230
1231
  if (n !== void 0)
1231
1232
  throw new TypeError("Derived constructors may only return object or undefined");
@@ -1244,28 +1245,28 @@ var Ve = { exports: {} };
1244
1245
  if (!(e instanceof n))
1245
1246
  throw new TypeError("Cannot call a class as a function");
1246
1247
  }
1247
- function ue(e, n) {
1248
+ function fe(e, n) {
1248
1249
  for (var o = 0; o < n.length; o++) {
1249
1250
  var i = n[o];
1250
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(y, w) {
1251
- if (G(y) !== "object" || y === null)
1251
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(y, w) {
1252
+ if (W(y) !== "object" || y === null)
1252
1253
  return y;
1253
1254
  var x = y[Symbol.toPrimitive];
1254
1255
  if (x !== void 0) {
1255
- var b = x.call(y, w);
1256
- if (G(b) !== "object")
1257
- return b;
1256
+ var E = x.call(y, w);
1257
+ if (W(E) !== "object")
1258
+ return E;
1258
1259
  throw new TypeError("@@toPrimitive must return a primitive value.");
1259
1260
  }
1260
1261
  return String(y);
1261
- }(i.key, "string"), G(h) === "symbol" ? h : String(h)), i);
1262
+ }(i.key, "string"), W(c) === "symbol" ? c : String(c)), i);
1262
1263
  }
1263
- var h;
1264
+ var c;
1264
1265
  }
1265
1266
  function Pt(e, n, o) {
1266
- return n && ue(e.prototype, n), o && ue(e, o), Object.defineProperty(e, "prototype", { writable: !1 }), e;
1267
+ return n && fe(e.prototype, n), o && fe(e, o), Object.defineProperty(e, "prototype", { writable: !1 }), e;
1267
1268
  }
1268
- var N = function() {
1269
+ var R = function() {
1269
1270
  function e() {
1270
1271
  var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
1271
1272
  $t(this, e), this.value = n, this.weight = null, this.style = null, this.font = null, this.href = null, this.sub = !1, this.sup = !1;
@@ -1280,41 +1281,41 @@ var Ve = { exports: {} };
1280
1281
  } }]), e;
1281
1282
  }(), Tt = function(e) {
1282
1283
  Et(o, e);
1283
- var n = Gt(o);
1284
+ var n = Wt(o);
1284
1285
  function o() {
1285
1286
  return $t(this, o), n.apply(this, arguments);
1286
1287
  }
1287
1288
  return Pt(o);
1288
- }(N), nt = function(e) {
1289
+ }(R), nt = function(e) {
1289
1290
  Et(o, e);
1290
- var n = Gt(o);
1291
+ var n = Wt(o);
1291
1292
  function o() {
1292
1293
  return $t(this, o), n.apply(this, arguments);
1293
1294
  }
1294
1295
  return Pt(o);
1295
- }(N), pt = function(e) {
1296
+ }(R), pt = function(e) {
1296
1297
  Et(o, e);
1297
- var n = Gt(o);
1298
+ var n = Wt(o);
1298
1299
  function o() {
1299
1300
  return $t(this, o), n.apply(this, arguments);
1300
1301
  }
1301
1302
  return Pt(o);
1302
- }(N), Zt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, Ye = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, de = /^[\xA0\u2011\u202F\u2060\uFEFF]/, Xe = /^(?:[;\xAD%?…]|,(?!\d))/, Ge = /^[´±°¢£¤$¥\u2212]/;
1303
+ }(R), Gt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, We = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, pe = /^[\xA0\u2011\u202F\u2060\uFEFF]/, Ge = /^(?:[;\xAD%?…]|,(?!\d))/, Ze = /^[´±°¢£¤$¥\u2212]/;
1303
1304
  function Nt(e, n) {
1304
1305
  n !== !1 && (e = e.trim());
1305
- for (var o, i, h = [], y = e.charAt(0), w = 0, x = 1, b = e.length; x < b; x++) {
1306
+ for (var o, i, c = [], y = e.charAt(0), w = 0, x = 1, E = e.length; x < E; x++) {
1306
1307
  o = e.charAt(x), i = e.charAt(x + 1);
1307
- var E = Zt.test(y), O = Zt.test(o), M = O || E, I = void 0;
1308
- if ((Ge.test(o) && !de.test(y) || Xe.test(y + i) && !de.test(o)) && (M = !0), y !== "-" && y !== "‐" && y !== "–" && y !== "—" || ((I = Zt.test(e.charAt(x - 2))) && !O && (M = !1), !I && Ye.test(o + i) && (M = !0)), M) {
1308
+ var k = Gt.test(y), O = Gt.test(o), L = O || k, I = void 0;
1309
+ if ((Ze.test(o) && !pe.test(y) || Ge.test(y + i) && !pe.test(o)) && (L = !0), y !== "-" && y !== "‐" && y !== "–" && y !== "—" || ((I = Gt.test(e.charAt(x - 2))) && !O && (L = !1), !I && We.test(o + i) && (L = !0)), L) {
1309
1310
  var z = e.slice(w, x);
1310
- /\u00AD$/.test(z) ? (h.push(new N(z.slice(0, -1))), h.push(new pt())) : (h.push(new N(z)), h.push(new Tt())), w = x;
1311
+ /\u00AD$/.test(z) ? (c.push(new R(z.slice(0, -1))), c.push(new pt())) : (c.push(new R(z)), c.push(new Tt())), w = x;
1311
1312
  }
1312
1313
  y = o;
1313
1314
  }
1314
- return h.push(new N(e.slice(w))), h;
1315
+ return c.push(new R(e.slice(w))), c;
1315
1316
  }
1316
- const fe = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "­", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "‌", zwj: "‍", lrm: "‎", rlm: "‏", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
1317
- var Ze = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, We = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Ke = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, Je = /^<!--(.+?)-->/, Qe = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, pe = { b: function(e) {
1317
+ const ge = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "­", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "‌", zwj: "‍", lrm: "‎", rlm: "‏", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
1318
+ var Ke = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Je = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Qe = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, tn = /^<!--(.+?)-->/, en = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, ye = { b: function(e) {
1318
1319
  e.weight = "bold";
1319
1320
  }, strong: function(e) {
1320
1321
  e.weight = "bold";
@@ -1340,26 +1341,26 @@ var Ve = { exports: {} };
1340
1341
  e.sub = !0;
1341
1342
  }, sup: function(e) {
1342
1343
  e.sup = !0;
1343
- } }, tn = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
1344
- function ge(e) {
1345
- return e.replace(Qe, function(n, o, i, h) {
1344
+ } }, nn = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
1345
+ function me(e) {
1346
+ return e.replace(en, function(n, o, i, c) {
1346
1347
  if (o || i) {
1347
1348
  var y = o ? 10 : 16;
1348
1349
  return String.fromCharCode(parseInt(o || i, y));
1349
1350
  }
1350
- return h in fe ? fe[h] : n;
1351
+ return c in ge ? ge[c] : n;
1351
1352
  });
1352
1353
  }
1353
- function en(e) {
1354
+ function rn(e) {
1354
1355
  return e && e.length > 1 && (e[0] === '"' && e[e.length - 1] === '"' || e[0] === "'" && e[e.length - 1] === "'") ? e.slice(1, -1) : e;
1355
1356
  }
1356
- var nn = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1357
- function rn(e) {
1357
+ var sn = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1358
+ function on(e) {
1358
1359
  var n, o = {};
1359
1360
  if (e) {
1360
1361
  do
1361
- if (n = nn.exec(e)) {
1362
- var i = ge(en(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1362
+ if (n = sn.exec(e)) {
1363
+ var i = me(rn(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1363
1364
  if (o[n[1]] = i, (e = e.slice(n[0].length)).length && /^\S/.test(e[0]))
1364
1365
  throw new Error("Attribute error");
1365
1366
  }
@@ -1369,8 +1370,8 @@ var Ve = { exports: {} };
1369
1370
  }
1370
1371
  return o;
1371
1372
  }
1372
- const ye = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
1373
- var sn = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, on = /^%[^\n]+(?:\n|$)/, an = /^[^#$%&~_^\\{}]+/, ln = /^\\([&{}$%#_])/, hn = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, cn = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, V = { bf: function(e) {
1373
+ const ve = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
1374
+ var an = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, ln = /^%[^\n]+(?:\n|$)/, hn = /^[^#$%&~_^\\{}]+/, cn = /^\\([&{}$%#_])/, un = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, dn = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, U = { bf: function(e) {
1374
1375
  e.weight = "bold";
1375
1376
  }, it: function(e) {
1376
1377
  e.style = "italic";
@@ -1389,115 +1390,115 @@ var Ve = { exports: {} };
1389
1390
  }, newline: function(e) {
1390
1391
  this.tokens.push(new nt());
1391
1392
  }, url: function(e, n) {
1392
- this.open_context().href = n, this.add_token(new N(n)), this.close_context();
1393
+ this.open_context().href = n, this.add_token(new R(n)), this.close_context();
1393
1394
  } };
1394
- V.textsuperscript = V["^"], V.textsubscript = V._, V.textsl = V.sl, V.mathbf = V.bf, V.mathit = V.it, V.textbf = V.bf, V.textit = V.it, V.textcolor = V.color;
1395
- var un = /[\r\n\xA0]+/g;
1396
- function dn(e, n) {
1395
+ U.textsuperscript = U["^"], U.textsubscript = U._, U.textsl = U.sl, U.mathbf = U.bf, U.mathit = U.it, U.textbf = U.bf, U.textit = U.it, U.textcolor = U.color;
1396
+ var fn = /[\r\n\xA0]+/g;
1397
+ function pn(e, n) {
1397
1398
  e.sup && (e.baseline = 0.45, e.size = 0.7), e.sub && (e.baseline = -0.3, e.size = 0.7);
1398
1399
  var o = n;
1399
- return (e.style || e.weight || e.baseline || e.color || e.size || e.family) && (o = S(n, e)), o;
1400
+ return (e.style || e.weight || e.baseline || e.color || e.size || e.family) && (o = b(n, e)), o;
1400
1401
  }
1401
- function me(e, n, o) {
1402
- for (var i, h, y = e.width; y + o.width > n && e.length; )
1403
- h = (i = e[e.length - 1]).width, i.width > o.width ? (i.value = i.value.slice(0, -1), i.width = Y(i, i.font), y += i.width) : e.pop(), y -= h;
1404
- e[e.length - 1] instanceof pt && e.pop(), i = e[e.length - 1] || i || {}, o.font = S(o.font, i.bold, i.italic, ""), o.href = e.length ? i.href : null, o.rel = e.length ? i.rel : null, o.target = e.length ? i.target : null, e.push(o);
1402
+ function xe(e, n, o) {
1403
+ for (var i, c, y = e.width; y + o.width > n && e.length; )
1404
+ c = (i = e[e.length - 1]).width, i.width > o.width ? (i.value = i.value.slice(0, -1), i.width = X(i, i.font), y += i.width) : e.pop(), y -= c;
1405
+ e[e.length - 1] instanceof pt && e.pop(), i = e[e.length - 1] || i || {}, o.font = b(o.font, i.bold, i.italic, ""), o.href = e.length ? i.href : null, o.rel = e.length ? i.rel : null, o.target = e.length ? i.target : null, e.push(o);
1405
1406
  }
1406
1407
  function vt(e) {
1407
1408
  return Math.round(1e6 * e) / 1e6;
1408
1409
  }
1409
- function ve(e) {
1410
+ function we(e) {
1410
1411
  return function(n) {
1411
1412
  if (Array.isArray(n))
1412
- return Wt(n);
1413
+ return Zt(n);
1413
1414
  }(e) || function(n) {
1414
1415
  if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
1415
1416
  return Array.from(n);
1416
1417
  }(e) || function(n, o) {
1417
1418
  if (n) {
1418
1419
  if (typeof n == "string")
1419
- return Wt(n, o);
1420
+ return Zt(n, o);
1420
1421
  var i = Object.prototype.toString.call(n).slice(8, -1);
1421
- return i === "Object" && n.constructor && (i = n.constructor.name), i === "Map" || i === "Set" ? Array.from(n) : i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? Wt(n, o) : void 0;
1422
+ return i === "Object" && n.constructor && (i = n.constructor.name), i === "Map" || i === "Set" ? Array.from(n) : i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? Zt(n, o) : void 0;
1422
1423
  }
1423
1424
  }(e) || function() {
1424
1425
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1425
1426
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1426
1427
  }();
1427
1428
  }
1428
- function Wt(e, n) {
1429
+ function Zt(e, n) {
1429
1430
  (n == null || n > e.length) && (n = e.length);
1430
1431
  for (var o = 0, i = new Array(n); o < n; o++)
1431
1432
  i[o] = e[o];
1432
1433
  return i;
1433
1434
  }
1434
- var fn = { center: "middle", right: "end" }, pn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, Kt = function(e, n) {
1435
+ var gn = { center: "middle", right: "end" }, yn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, Kt = function(e, n) {
1435
1436
  return !e && !n || e === n;
1436
1437
  };
1437
- function gn(e, n) {
1438
- var o = [], i = n.font(), h = i.size, y = i.family, w = n.align(), x = n.createElement();
1438
+ function mn(e, n) {
1439
+ var o = [], i = n.font(), c = i.size, y = i.family, w = n.align(), x = n.createElement();
1439
1440
  if (e.length) {
1440
- var b = i.height, E = n.valign(), O = n.height()(), M = n.width()(0), I = !isFinite(M) && e.length === 1, z = I ? null : n.x(), R = vt(b / h), Q = I ? null : vt(b / (1.15 * h + (b - h) / 2));
1441
- if (pn[E] && isFinite(O)) {
1442
- var $ = E === "bottom" ? 1 : 0.5;
1443
- Q += (O * $ - b * e.length * $) / h;
1441
+ var E = i.height, k = n.valign(), O = n.height()(), L = n.width()(0), I = !isFinite(L) && e.length === 1, z = I ? null : n.x(), j = vt(E / c), Q = I ? null : vt(E / (1.15 * c + (E - c) / 2));
1442
+ if (yn[k] && isFinite(O)) {
1443
+ var P = k === "bottom" ? 1 : 0.5;
1444
+ Q += (O * P - E * e.length * P) / c;
1444
1445
  }
1445
- var L = w === "justify", H = 0;
1446
- w === "right" ? H = M : w === "center" && (H = M / 2);
1447
- for (var P = [], tt = "tspan", Z = null, j = "", _ = function() {
1448
- if (j) {
1449
- var gt = x(tt, Z, j);
1450
- P.push(gt);
1446
+ var C = w === "justify", F = 0;
1447
+ w === "right" ? F = L : w === "center" && (F = L / 2);
1448
+ for (var H = [], tt = "tspan", G = null, q = "", M = function() {
1449
+ if (q) {
1450
+ var gt = x(tt, G, q);
1451
+ H.push(gt);
1451
1452
  }
1452
- tt = "tspan", Z = null, j = "";
1453
+ tt = "tspan", G = null, q = "";
1453
1454
  }, it = 0, et = e.length; it < et; it++) {
1454
1455
  var at = "", dt = "", st = 0, lt = e[it];
1455
1456
  if (lt.length) {
1456
- P = [];
1457
- for (var xt = 0, Dt = 0, ht = void 0, W = 0, Rt = lt.length; W < Rt; W++) {
1458
- var B = lt[W], K = B.font;
1459
- B.whitespace && xt++, Dt += B.width, W && !B.tracking && !st && Kt(K.id, at) && Kt(B.class, dt) && Kt(ht, B.href) ? j += B.value : (_(), j = B.value, Z = { fontFamily: K.family !== y ? K.family : null, fontSize: K.size !== h ? K.size : null, fontWeight: K.weight || null, fontStyle: K.style || null, fontVariant: K.variant !== "normal" && K.variant || null, fill: K.color || null, baselineShift: K.baseline ? 100 * K.baseline + "%" : null, className: B.class || null }, st && (Z.dx = vt(st), st = 0), B.tracking && (st = K.size * B.tracking), B.href && !ht ? (ht = B.href, tt = "a", Z.href = ht, Z.rel = B.rel, Z.target = B.target) : ht = null, at = K.id, dt = B.class);
1457
+ H = [];
1458
+ for (var xt = 0, Mt = 0, ht = void 0, Z = 0, Ht = lt.length; Z < Ht; Z++) {
1459
+ var B = lt[Z], K = B.font;
1460
+ B.whitespace && xt++, Mt += B.width, Z && !B.tracking && !st && Kt(K.id, at) && Kt(B.class, dt) && Kt(ht, B.href) ? q += B.value : (M(), q = B.value, G = { fontFamily: K.family !== y ? K.family : null, fontSize: K.size !== c ? K.size : null, fontWeight: K.weight || null, fontStyle: K.style || null, fontVariant: K.variant !== "normal" && K.variant || null, fill: K.color || null, baselineShift: K.baseline ? 100 * K.baseline + "%" : null, className: B.class || null }, st && (G.dx = vt(st), st = 0), B.tracking && (st = K.size * B.tracking), B.href && !ht ? (ht = B.href, tt = "a", G.href = ht, G.rel = B.rel, G.target = B.target) : ht = null, at = K.id, dt = B.class);
1460
1461
  }
1461
- if (_(), I)
1462
- o.push.apply(o, ve(P));
1462
+ if (M(), I)
1463
+ o.push.apply(o, we(H));
1463
1464
  else {
1464
- var Ht = null, Ot = it === et - 1 || lt[lt.length - 1] instanceof nt;
1465
- L && lt.length > 1 && !Ot && (Ht = vt((M - Dt) / xt)), o.push(x.apply(void 0, ["tspan", { wordSpacing: Ht, x: z(it) + H, dy: vt(it ? R : Q) + "em" }].concat(ve(P))));
1465
+ var Rt = null, Dt = it === et - 1 || lt[lt.length - 1] instanceof nt;
1466
+ C && lt.length > 1 && !Dt && (Rt = vt((L - Mt) / xt)), o.push(x.apply(void 0, ["tspan", { wordSpacing: Rt, x: z(it) + F, dy: vt(it ? j : Q) + "em" }].concat(we(H))));
1466
1467
  }
1467
1468
  } else
1468
- o.push(x("tspan", { x: z(it), dy: vt(it ? R : Q) + "em" }, " "));
1469
+ o.push(x("tspan", { x: z(it), dy: vt(it ? j : Q) + "em" }, " "));
1469
1470
  }
1470
1471
  }
1471
- return x.apply(void 0, ["text", { fontFamily: y, fontSize: h, textAnchor: fn[w] || "start" }].concat(o));
1472
+ return x.apply(void 0, ["text", { fontFamily: y, fontSize: c, textAnchor: gn[w] || "start" }].concat(o));
1472
1473
  }
1473
- var yn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1474
- function mn(e, n, o) {
1474
+ var vn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1475
+ function xn(e, n, o) {
1475
1476
  if (e.length) {
1476
1477
  o.textBaseline = "middle";
1477
- var i = n.font(), h = i.height, y = i.size, w = n.valign(), x = n.height()(), b = n.width()(0), E = n.align(), O = E === "justify", M = 0.5 * h, I = yn[w];
1478
+ var i = n.font(), c = i.height, y = i.size, w = n.valign(), x = n.height()(), E = n.width()(0), k = n.align(), O = k === "justify", L = 0.5 * c, I = vn[w];
1478
1479
  if (I && isFinite(x)) {
1479
- var z = e.length * h;
1480
- M += x * I - z * I;
1480
+ var z = e.length * c;
1481
+ L += x * I - z * I;
1481
1482
  }
1482
- e.forEach(function(R, Q) {
1483
- var $ = n.x()(Q), L = Q * h + M, H = 0, P = 0;
1484
- R.forEach(function(j) {
1485
- j.whitespace && H++, P += j.width;
1483
+ e.forEach(function(j, Q) {
1484
+ var P = n.x()(Q), C = Q * c + L, F = 0, H = 0;
1485
+ j.forEach(function(q) {
1486
+ q.whitespace && F++, H += q.width;
1486
1487
  });
1487
- var tt = 0, Z = Q === e.length - 1 || R[R.length - 1] instanceof nt;
1488
- O && R.length > 1 && !Z && (tt = (b - P) / H), R.forEach(function(j) {
1489
- o.font = j.font;
1490
- var _ = j.font, it = _.baseline ? y * -_.baseline + 0.15 * y : 0;
1488
+ var tt = 0, G = Q === e.length - 1 || j[j.length - 1] instanceof nt;
1489
+ O && j.length > 1 && !G && (tt = (E - H) / F), j.forEach(function(q) {
1490
+ o.font = q.font;
1491
+ var M = q.font, it = M.baseline ? y * -M.baseline + 0.15 * y : 0;
1491
1492
  o.fillStyle = function(dt, st) {
1492
1493
  return dt.color ? dt.color : st.href ? "#00C" : "#000";
1493
- }(_, j);
1494
+ }(M, q);
1494
1495
  var et = 0;
1495
- if (E === "right" ? et += b - P : E === "center" ? et += b / 2 - P / 2 : E === "justify" && (j.whitespace || j instanceof nt) && ($ += tt), o.fillText(j.value, $ + et, L + it), j.href) {
1496
+ if (k === "right" ? et += E - H : k === "center" ? et += E / 2 - H / 2 : k === "justify" && (q.whitespace || q instanceof nt) && (P += tt), o.fillText(q.value, P + et, C + it), q.href) {
1496
1497
  o.beginPath(), o.strokeStyle = o.fillStyle;
1497
- var at = Math.floor(L + 0.45 * y) + 0.5;
1498
- o.moveTo($ + et, at), o.lineTo($ + et + j.width, at), o.stroke();
1498
+ var at = Math.floor(C + 0.45 * y) + 0.5;
1499
+ o.moveTo(P + et, at), o.lineTo(P + et + q.width, at), o.stroke();
1499
1500
  }
1500
- $ += j.width;
1501
+ P += q.width;
1501
1502
  });
1502
1503
  });
1503
1504
  }
@@ -1509,39 +1510,39 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1509
1510
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1510
1511
  }, Jt(e);
1511
1512
  }
1512
- function xe(e) {
1513
+ function be(e) {
1513
1514
  for (var n = {}, o = 0; o < e.length; o++) {
1514
1515
  var i = e[o];
1515
1516
  typeof i != "number" && i != null && (typeof i == "string" ? n.text = i : typeof i == "function" ? n.fn = i : Jt(i) === "object" && i._groups ? n.d3 = i : i && i.nodeType && i.getContext ? n.ctx = i.getContext("2d") : i && i.fillText && i.beginPath ? n.ctx = i : i && (n.text = i));
1516
1517
  }
1517
1518
  return n;
1518
1519
  }
1519
- function It(e) {
1520
- return It = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1520
+ function _t(e) {
1521
+ return _t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1521
1522
  return typeof n;
1522
1523
  } : function(n) {
1523
1524
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1524
- }, It(e);
1525
+ }, _t(e);
1525
1526
  }
1526
- function vn(e, n) {
1527
+ function wn(e, n) {
1527
1528
  for (var o = 0; o < n.length; o++) {
1528
1529
  var i = n[o];
1529
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(y, w) {
1530
- if (It(y) !== "object" || y === null)
1530
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(y, w) {
1531
+ if (_t(y) !== "object" || y === null)
1531
1532
  return y;
1532
1533
  var x = y[Symbol.toPrimitive];
1533
1534
  if (x !== void 0) {
1534
- var b = x.call(y, w);
1535
- if (It(b) !== "object")
1536
- return b;
1535
+ var E = x.call(y, w);
1536
+ if (_t(E) !== "object")
1537
+ return E;
1537
1538
  throw new TypeError("@@toPrimitive must return a primitive value.");
1538
1539
  }
1539
1540
  return String(y);
1540
- }(i.key, "string"), It(h) === "symbol" ? h : String(h)), i);
1541
+ }(i.key, "string"), _t(c) === "symbol" ? c : String(c)), i);
1541
1542
  }
1542
- var h;
1543
+ var c;
1543
1544
  }
1544
- var xn = S(), Qt = function(e) {
1545
+ var bn = b(), Qt = function(e) {
1545
1546
  return typeof e == "function" ? e : function() {
1546
1547
  return e;
1547
1548
  };
@@ -1557,85 +1558,85 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1557
1558
  }, x: function() {
1558
1559
  return 0;
1559
1560
  }, font: null, tAnchor: 0, parser: e.defaultparser }, i)
1560
- for (var h in i)
1561
- typeof this[h] == "function" && this[h](i[h]);
1561
+ for (var c in i)
1562
+ typeof this[c] == "function" && this[c](i[c]);
1562
1563
  }
1563
1564
  var n, o;
1564
1565
  return n = e, o = [{ key: "linebreak", value: function(i) {
1565
- var h = this, y = this.props.parser(String(i)), w = this.font(), x = function(b, E, O) {
1566
- if (!b.length)
1566
+ var c = this, y = this.props.parser(String(i)), w = this.font(), x = function(E, k, O) {
1567
+ if (!E.length)
1567
1568
  return [];
1568
- var M = E.height(), I = E.width(), z = E.overflowLine(), R = E.overflowWrap(), Q = S(O, !0, !1), $ = isFinite(M()) ? Math.floor(M() / O.height) : 1 / 0;
1569
- if (!M() && !I(0) || !$)
1569
+ var L = k.height(), I = k.width(), z = k.overflowLine(), j = k.overflowWrap(), Q = b(O, !0, !1), P = isFinite(L()) ? Math.floor(L() / O.height) : 1 / 0;
1570
+ if (!L() && !I(0) || !P)
1570
1571
  return [];
1571
- for (var L = 0, H = 0, P = 0, tt = [], Z = [], j = !1; L < b.length && H < $; ) {
1572
- var _ = b[L], it = dn(_, O);
1573
- if (_.width = Y(_, it), _.font = it, _.line = H, _.whitespace = _.value in C, _.value && (_.value = _.value.replace(un, " ")), !(!P && _.whitespace || j && _.whitespace))
1574
- if (_ instanceof nt)
1575
- P = 0, Z = [], tt.push(L + 1), H++;
1576
- else if (_ instanceof Tt || _ instanceof pt)
1577
- Z.push({ index: L, width: P });
1578
- else if (_.whitespace || P + _.width < I(H))
1579
- P += _.width;
1580
- else if (Z.length) {
1572
+ for (var C = 0, F = 0, H = 0, tt = [], G = [], q = !1; C < E.length && F < P; ) {
1573
+ var M = E[C], it = pn(M, O);
1574
+ if (M.width = X(M, it), M.font = it, M.line = F, M.whitespace = M.value in D, M.value && (M.value = M.value.replace(fn, " ")), !(!H && M.whitespace || q && M.whitespace))
1575
+ if (M instanceof nt)
1576
+ H = 0, G = [], tt.push(C + 1), F++;
1577
+ else if (M instanceof Tt || M instanceof pt)
1578
+ G.push({ index: C, width: H });
1579
+ else if (M.whitespace || H + M.width < I(F))
1580
+ H += M.width;
1581
+ else if (G.length) {
1581
1582
  var et = void 0, at = void 0;
1582
1583
  do {
1583
- at = !0, et = Z.pop();
1584
- var dt = b[et.index], st = void 0;
1585
- dt instanceof pt && (st = Y("-", dt.font), et.width + st > I(H) && (at = !Z.length));
1584
+ at = !0, et = G.pop();
1585
+ var dt = E[et.index], st = void 0;
1586
+ dt instanceof pt && (st = X("-", dt.font), et.width + st > I(F) && (at = !G.length));
1586
1587
  } while (!at);
1587
- tt.push(et.index + 1), P = 0, H++, L = et.index, Z = [];
1588
- } else if (R === "break-word") {
1589
- var lt = I(H);
1590
- if (P + _.width > lt) {
1591
- var xt = _.clone();
1588
+ tt.push(et.index + 1), H = 0, F++, C = et.index, G = [];
1589
+ } else if (j === "break-word") {
1590
+ var lt = I(F);
1591
+ if (H + M.width > lt) {
1592
+ var xt = M.clone();
1592
1593
  do
1593
- _.value = _.value.slice(0, -1), _.width = Y(_, _.font), P += _.width;
1594
- while (_.value && _.width > lt);
1595
- xt.value = xt.value.slice(_.value.length), b.splice(L + 1, 0, new Tt(), xt);
1594
+ M.value = M.value.slice(0, -1), M.width = X(M, M.font), H += M.width;
1595
+ while (M.value && M.width > lt);
1596
+ xt.value = xt.value.slice(M.value.length), E.splice(C + 1, 0, new Tt(), xt);
1596
1597
  }
1597
- tt.push(L + 1), P = 0, H++;
1598
+ tt.push(C + 1), H = 0, F++;
1598
1599
  } else
1599
- P += _.width;
1600
- L++, j = _.whitespace;
1600
+ H += M.width;
1601
+ C++, q = M.whitespace;
1601
1602
  }
1602
- L !== tt[tt.length - 1] && tt.push(L);
1603
- var Dt = 0, ht = 0, W = tt.map(function(gt) {
1604
- for (var J, yt = Dt; (J = b[yt]) && (J.whitespace || !J.value); )
1603
+ C !== tt[tt.length - 1] && tt.push(C);
1604
+ var Mt = 0, ht = 0, Z = tt.map(function(gt) {
1605
+ for (var J, yt = Mt; (J = E[yt]) && (J.whitespace || !J.value); )
1605
1606
  yt++;
1606
- for (var ft = gt, ne = null; ft > yt && (J = b[ft - 1]) && (J.whitespace || !(J.value || J instanceof pt)); )
1607
+ for (var ft = gt, ne = null; ft > yt && (J = E[ft - 1]) && (J.whitespace || !(J.value || J instanceof pt)); )
1607
1608
  J instanceof nt && (ne = J), ft--;
1608
- J instanceof pt && (J.value = "-", J.width = Y("-", J.font)), Dt = gt;
1609
- var wt = b.slice(yt, ft).filter(function(ie) {
1609
+ J instanceof pt && (J.value = "-", J.width = X("-", J.font)), Mt = gt;
1610
+ var wt = E.slice(yt, ft).filter(function(ie) {
1610
1611
  return ie.value;
1611
1612
  });
1612
- return ne && wt.push(ne), wt.width = wt.reduce(function(ie, En) {
1613
- return ie + En.width;
1613
+ return ne && wt.push(ne), wt.width = wt.reduce(function(ie, Tn) {
1614
+ return ie + Tn.width;
1614
1615
  }, 0), wt.width > ht && (ht = wt.width), wt;
1615
1616
  });
1616
- if (W.hasLineOverflow = !1, z) {
1617
- var Rt = z === "ellipsis" ? "…" : z;
1618
- W.forEach(function(gt, J) {
1617
+ if (Z.hasLineOverflow = !1, z) {
1618
+ var Ht = z === "ellipsis" ? "…" : z;
1619
+ Z.forEach(function(gt, J) {
1619
1620
  var yt = I(J);
1620
1621
  if (gt.width > yt) {
1621
- var ft = new N(Rt);
1622
- ft.font = O, ft.width = Y(Rt, Q), me(gt, yt, ft), W.hasLineOverflow = !0;
1622
+ var ft = new R(Ht);
1623
+ ft.font = O, ft.width = X(Ht, Q), xe(gt, yt, ft), Z.hasLineOverflow = !0;
1623
1624
  }
1624
1625
  });
1625
1626
  }
1626
- var B = E.overflow() === "ellipsis" ? "…" : E.overflow();
1627
- if (B && L !== b.length) {
1628
- var K = I(W.length - 1), Ht = W[W.length - 1], Ot = new N(B);
1629
- Ot.font = O, Ot.width = Y(B, Q), me(Ht, K, Ot), W.hasOverflow = !0;
1627
+ var B = k.overflow() === "ellipsis" ? "…" : k.overflow();
1628
+ if (B && C !== E.length) {
1629
+ var K = I(Z.length - 1), Rt = Z[Z.length - 1], Dt = new R(B);
1630
+ Dt.font = O, Dt.width = X(B, Q), xe(Rt, K, Dt), Z.hasOverflow = !0;
1630
1631
  } else
1631
- W.hasOverflow = !1;
1632
- return W.font = O, W.width = ht, W;
1632
+ Z.hasOverflow = !1;
1633
+ return Z.font = O, Z.width = ht, Z;
1633
1634
  }(y, this, w);
1634
- return x.height = x.length * w.height, x.render = function(b) {
1635
- return h.render(x, b);
1635
+ return x.height = x.length * w.height, x.render = function(E) {
1636
+ return c.render(x, E);
1636
1637
  }, x.svg = x.render, x.draw = x.render, x;
1637
1638
  } }, { key: "font", value: function(i) {
1638
- return arguments.length ? (this.props.font = S(i), this) : this.props.font || S(xn);
1639
+ return arguments.length ? (this.props.font = b(i), this) : this.props.font || b(bn);
1639
1640
  } }, { key: "overflow", value: function(i) {
1640
1641
  return arguments.length ? (this.props.overflow = String(i), this) : this.props.overflow;
1641
1642
  } }, { key: "overflowLine", value: function(i) {
@@ -1645,13 +1646,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1645
1646
  } }, { key: "align", value: function(i) {
1646
1647
  if (!arguments.length)
1647
1648
  return this.props.align;
1648
- var h = String(i).toLowerCase();
1649
- return h === "left" || h === "start" ? (this.props.align = "left", this.props.tAnchor = 0) : h === "center" || h === "middle" ? (this.props.align = "center", this.props.tAnchor = -0.5) : h === "end" || h === "right" ? (this.props.align = "right", this.props.tAnchor = -1) : h === "justify" && (this.props.align = i, this.props.tAnchor = 0), this;
1649
+ var c = String(i).toLowerCase();
1650
+ return c === "left" || c === "start" ? (this.props.align = "left", this.props.tAnchor = 0) : c === "center" || c === "middle" ? (this.props.align = "center", this.props.tAnchor = -0.5) : c === "end" || c === "right" ? (this.props.align = "right", this.props.tAnchor = -1) : c === "justify" && (this.props.align = i, this.props.tAnchor = 0), this;
1650
1651
  } }, { key: "overflowWrap", value: function(i) {
1651
1652
  if (!arguments.length)
1652
1653
  return this.props.overflowWrap || "normal";
1653
- var h = String(i).toLowerCase();
1654
- return h === "break-word" ? this.props.overflowWrap = "break-word" : h !== "normal" && i != null || (this.props.overflowWrap = null), this;
1654
+ var c = String(i).toLowerCase();
1655
+ return c === "break-word" ? this.props.overflowWrap = "break-word" : c !== "normal" && i != null || (this.props.overflowWrap = null), this;
1655
1656
  } }, { key: "width", value: function(i) {
1656
1657
  return arguments.length ? (this.props.width = Qt(i), this) : this.props.width;
1657
1658
  } }, { key: "height", value: function(i) {
@@ -1662,8 +1663,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1662
1663
  if (!arguments.length)
1663
1664
  return this.props.parser;
1664
1665
  if (typeof i == "string") {
1665
- var h = e[i] || e[i + "parser"];
1666
- typeof h == "function" && (i = h);
1666
+ var c = e[i] || e[i + "parser"];
1667
+ typeof c == "function" && (i = c);
1667
1668
  }
1668
1669
  if (typeof i != "function")
1669
1670
  throw new Error("Unknown parser: " + i);
@@ -1671,16 +1672,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1671
1672
  } }, { key: "createElement", value: function(i) {
1672
1673
  return arguments.length ? (this.props.createElement = i, this) : this.props.createElement || e.createElement;
1673
1674
  } }, { key: "render", value: function() {
1674
- var i = xe(arguments);
1675
- return typeof i.text == "string" && (i.text = this.linebreak(i.text)), i.ctx ? mn(i.text, this, i.ctx) : gn(i.text, this);
1676
- } }], o && vn(n.prototype, o), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1675
+ var i = be(arguments);
1676
+ return typeof i.text == "string" && (i.text = this.linebreak(i.text)), i.ctx ? xn(i.text, this, i.ctx) : mn(i.text, this);
1677
+ } }], o && wn(n.prototype, o), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1677
1678
  }();
1678
- function _t(e) {
1679
- return _t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1679
+ function It(e) {
1680
+ return It = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1680
1681
  return typeof n;
1681
1682
  } : function(n) {
1682
1683
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1683
- }, _t(e);
1684
+ }, It(e);
1684
1685
  }
1685
1686
  function te(e, n) {
1686
1687
  (n == null || n > e.length) && (n = e.length);
@@ -1688,29 +1689,29 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1688
1689
  i[o] = e[o];
1689
1690
  return i;
1690
1691
  }
1691
- function wn(e, n) {
1692
+ function An(e, n) {
1692
1693
  for (var o = 0; o < n.length; o++) {
1693
1694
  var i = n[o];
1694
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(y, w) {
1695
- if (_t(y) !== "object" || y === null)
1695
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(y, w) {
1696
+ if (It(y) !== "object" || y === null)
1696
1697
  return y;
1697
1698
  var x = y[Symbol.toPrimitive];
1698
1699
  if (x !== void 0) {
1699
- var b = x.call(y, w);
1700
- if (_t(b) !== "object")
1701
- return b;
1700
+ var E = x.call(y, w);
1701
+ if (It(E) !== "object")
1702
+ return E;
1702
1703
  throw new TypeError("@@toPrimitive must return a primitive value.");
1703
1704
  }
1704
1705
  return String(y);
1705
- }(i.key, "string"), _t(h) === "symbol" ? h : String(h)), i);
1706
+ }(i.key, "string"), It(c) === "symbol" ? c : String(c)), i);
1706
1707
  }
1707
- var h;
1708
+ var c;
1708
1709
  }
1709
- var we = function(e) {
1710
+ var Ae = function(e) {
1710
1711
  return typeof e == "function" ? e : function() {
1711
1712
  return e;
1712
1713
  };
1713
- }, be = function() {
1714
+ }, Se = function() {
1714
1715
  function e(i) {
1715
1716
  if (function(y, w) {
1716
1717
  if (!(y instanceof w))
@@ -1720,31 +1721,31 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1720
1721
  }, height: function() {
1721
1722
  return 1 / 0;
1722
1723
  }, rotation: 0, vAnchor: 0, hAnchor: 0 }, i)
1723
- for (var h in i)
1724
- typeof this[h] == "function" && this[h](i[h]);
1724
+ for (var c in i)
1725
+ typeof this[c] == "function" && this[c](i[c]);
1725
1726
  this.render = this.render.bind(this);
1726
1727
  }
1727
1728
  var n, o;
1728
1729
  return n = e, o = [{ key: "anchor", value: function(i) {
1729
- var h = this.props, y = h.hAnchor, w = h.vAnchor, x = h.width, b = h.height;
1730
+ var c = this.props, y = c.hAnchor, w = c.vAnchor, x = c.width, E = c.height;
1730
1731
  if (!arguments.length)
1731
- return [y * x(0), w * b(0)];
1732
+ return [y * x(0), w * E(0)];
1732
1733
  if (typeof i == "string") {
1733
- var E = this.props;
1734
+ var k = this.props;
1734
1735
  i.toLowerCase().trim().split(/\s+/).forEach(function(O) {
1735
- O === "top" && (E.vAnchor = -0), O === "middle" && (E.vAnchor = -0.5), O === "bottom" && (E.vAnchor = -1), O === "left" && (E.hAnchor = -0), O === "center" && (E.hAnchor = -0.5), O === "right" && (E.hAnchor = -1);
1736
+ O === "top" && (k.vAnchor = -0), O === "middle" && (k.vAnchor = -0.5), O === "bottom" && (k.vAnchor = -1), O === "left" && (k.hAnchor = -0), O === "center" && (k.hAnchor = -0.5), O === "right" && (k.hAnchor = -1);
1736
1737
  });
1737
1738
  }
1738
1739
  return this;
1739
1740
  } }, { key: "width", value: function(i) {
1740
- return arguments.length ? (this.props.width = we(i), this) : this.props.width;
1741
+ return arguments.length ? (this.props.width = Ae(i), this) : this.props.width;
1741
1742
  } }, { key: "height", value: function(i) {
1742
- return arguments.length ? (this.props.height = we(i), this) : this.props.height;
1743
+ return arguments.length ? (this.props.height = Ae(i), this) : this.props.height;
1743
1744
  } }, { key: "rotate", value: function(i) {
1744
1745
  return arguments.length ? (this.props.rotation = i, this) : this.props.rotation;
1745
1746
  } }, { key: "createElement", value: function(i) {
1746
1747
  return arguments.length ? (this.props.createElement = i, this) : this.props.createElement || e.createElement;
1747
- } }, { key: "canvas", value: function(i, h) {
1748
+ } }, { key: "canvas", value: function(i, c) {
1748
1749
  var y, w = i.getContext ? i.getContext("2d") : i;
1749
1750
  return w.save(), w.rotate(this.rotate() * Math.PI / 180), w.translate.apply(w, function(x) {
1750
1751
  if (Array.isArray(x))
@@ -1752,187 +1753,228 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1752
1753
  }(y = this.anchor()) || function(x) {
1753
1754
  if (typeof Symbol < "u" && x[Symbol.iterator] != null || x["@@iterator"] != null)
1754
1755
  return Array.from(x);
1755
- }(y) || function(x, b) {
1756
+ }(y) || function(x, E) {
1756
1757
  if (x) {
1757
1758
  if (typeof x == "string")
1758
- return te(x, b);
1759
- var E = Object.prototype.toString.call(x).slice(8, -1);
1760
- return E === "Object" && x.constructor && (E = x.constructor.name), E === "Map" || E === "Set" ? Array.from(x) : E === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E) ? te(x, b) : void 0;
1759
+ return te(x, E);
1760
+ var k = Object.prototype.toString.call(x).slice(8, -1);
1761
+ return k === "Object" && x.constructor && (k = x.constructor.name), k === "Map" || k === "Set" ? Array.from(x) : k === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k) ? te(x, E) : void 0;
1761
1762
  }
1762
1763
  }(y) || function() {
1763
1764
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1764
1765
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1765
- }()), h(w), w.restore(), w;
1766
+ }()), c(w), w.restore(), w;
1766
1767
  } }, { key: "render", value: function() {
1767
- var i = xe(arguments);
1768
+ var i = be(arguments);
1768
1769
  if (i.d3)
1769
1770
  return i.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
1770
1771
  if (i.ctx)
1771
1772
  return this.canvas(i.ctx, i.fn);
1772
1773
  if (i.text) {
1773
- var h = typeof i.text.render == "function" ? i.text.render() : i.text;
1774
- return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, h);
1774
+ var c = typeof i.text.render == "function" ? i.text.render() : i.text;
1775
+ return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, c);
1775
1776
  }
1776
- } }], o && wn(n.prototype, o), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1777
- }(), bn = Object.prototype.hasOwnProperty, ee = {};
1778
- function An(e) {
1777
+ } }], o && An(n.prototype, o), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1778
+ }(), Sn = Object.prototype.hasOwnProperty, ee = {};
1779
+ function En(e) {
1779
1780
  return ee[e] || (ee[e] = e.replace(/([a-z])([A-Z])/g, function(n, o, i) {
1780
1781
  return o + "-" + i.toLowerCase();
1781
1782
  })), ee[e];
1782
1783
  }
1783
- function Ae(e, n) {
1784
+ function Ee(e, n) {
1784
1785
  if (Array.isArray(n))
1785
1786
  return n.forEach(function(o) {
1786
- return Ae(e, o);
1787
+ return Ee(e, o);
1787
1788
  });
1788
1789
  typeof n == "string" && (n = document.createTextNode(n)), e.appendChild(n);
1789
1790
  }
1790
- function Se(e, n) {
1791
+ function ke(e, n) {
1791
1792
  if (typeof document < "u") {
1792
1793
  var o = typeof e == "string" ? document.createElementNS("http://www.w3.org/2000/svg", e) : e;
1793
1794
  if (n && o.setAttribute)
1794
1795
  for (var i in n)
1795
- bn.call(n, i) && n[i] != null && o.setAttribute(i === "className" ? "class" : An(i), n[i]);
1796
- for (var h = arguments.length, y = new Array(h > 2 ? h - 2 : 0), w = 2; w < h; w++)
1796
+ Sn.call(n, i) && n[i] != null && o.setAttribute(i === "className" ? "class" : En(i), n[i]);
1797
+ for (var c = arguments.length, y = new Array(c > 2 ? c - 2 : 0), w = 2; w < c; w++)
1797
1798
  y[w - 2] = arguments[w];
1798
1799
  return y != null && y.length && y.forEach(function(x) {
1799
- Ae(o, x);
1800
+ Ee(o, x);
1800
1801
  }), o;
1801
1802
  }
1802
1803
  }
1803
- rt.createElement = Se, rt.textparser = Nt, rt.defaultparser = Nt, rt.htmlparser = function(e) {
1804
+ rt.createElement = ke, rt.textparser = Nt, rt.defaultparser = Nt, rt.htmlparser = function(e) {
1804
1805
  e = String(e || "").trim();
1805
- for (var n, o, i = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, h = [], y = [], w = function(M) {
1806
+ for (var n, o, i = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, c = [], y = [], w = function(L) {
1806
1807
  for (var I in i)
1807
- i[I] && (M[I] = i[I]);
1808
- h.push(M);
1809
- }, x = function(M) {
1810
- var I = h.length, z = tn[M];
1808
+ i[I] && (L[I] = i[I]);
1809
+ c.push(L);
1810
+ }, x = function(L) {
1811
+ var I = c.length, z = nn[L];
1811
1812
  if (I && z) {
1812
- for (var R = I - 1; h[R] && (h[R] instanceof Tt || Ze.test(h[R].value)); )
1813
- R--;
1814
- for (; z && h[R] && h[R] instanceof nt; )
1815
- R--, z--;
1813
+ for (var j = I - 1; c[j] && (c[j] instanceof Tt || Ke.test(c[j].value)); )
1814
+ j--;
1815
+ for (; z && c[j] && c[j] instanceof nt; )
1816
+ j--, z--;
1816
1817
  for (; z-- > 0; )
1817
- h.push(new nt());
1818
+ c.push(new nt());
1818
1819
  }
1819
1820
  }; e.length; ) {
1820
1821
  if (n = /^[^<]+/.exec(e))
1821
- Nt(ge(n[0]), !1).forEach(w);
1822
- else if (!(n = Je.exec(e)))
1823
- if (n = We.exec(e))
1822
+ Nt(me(n[0]), !1).forEach(w);
1823
+ else if (!(n = tn.exec(e)))
1824
+ if (n = Je.exec(e))
1824
1825
  y.length && (i = y.pop()), x(n[1]);
1825
- else if (n = Ke.exec(e)) {
1826
- var b = n[1];
1827
- x(b), y.push(i), i = Object.create(i), pe[b] && pe[b](i, "");
1828
- var E = rn(n[2]);
1829
- b === "a" && (E.href && (i.href = E.href), E.rel && (i.rel = E.rel), E.target && (i.target = E.target)), E.class && (i.class = i.class ? i.class + " " + E.class : E.class), E.style && (o = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(E.style)) && o[1] && (i.color = o[1]), b === "br" && h.push(new nt());
1826
+ else if (n = Qe.exec(e)) {
1827
+ var E = n[1];
1828
+ x(E), y.push(i), i = Object.create(i), ye[E] && ye[E](i, "");
1829
+ var k = on(n[2]);
1830
+ E === "a" && (k.href && (i.href = k.href), k.rel && (i.rel = k.rel), k.target && (i.target = k.target)), k.class && (i.class = i.class ? i.class + " " + k.class : k.class), k.style && (o = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(k.style)) && o[1] && (i.color = o[1]), E === "br" && c.push(new nt());
1830
1831
  } else
1831
- n = [e.slice(0, 1)], w(new N(n[0]));
1832
+ n = [e.slice(0, 1)], w(new R(n[0]));
1832
1833
  e = e.slice(n[0].length);
1833
1834
  }
1834
- for (var O = h[h.length - 1]; O instanceof nt; )
1835
- h.pop(), O = h[h.length - 1];
1836
- return h;
1835
+ for (var O = c[c.length - 1]; O instanceof nt; )
1836
+ c.pop(), O = c[c.length - 1];
1837
+ return c;
1837
1838
  }, rt.latexparser = function(e) {
1838
1839
  e = String(e || "").trim();
1839
1840
  var n = [0];
1840
- e = e.replace(/\\verb,(.*?),/, function($, L) {
1841
- return n.push(L), "\\verb," + (n.length - 1) + ",";
1841
+ e = e.replace(/\\verb,(.*?),/, function(P, C) {
1842
+ return n.push(C), "\\verb," + (n.length - 1) + ",";
1842
1843
  }).replace(/\\\\\n/g, function() {
1843
1844
  return "\\\\";
1844
- }).replace(hn, function($, L, H) {
1845
- return H.charAt(L - 1) === "\\" ? $ : cn[$];
1846
- }).replace(/\n\s+/g, function($) {
1847
- return /\n/.test($.slice(1)) ? "\\par " : $;
1848
- }).replace(/\\symbol\{(\d+)\}/, function($, L, H, P) {
1849
- return P.charAt(H - 1) === "\\" ? $ : String.fromCharCode(1 * L);
1850
- }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function($, L, H, P) {
1851
- return L + H + "{" + P + "}";
1852
- }).replace(/\\verb,(.*?),/, function($, L) {
1853
- return "\\verb,".concat(n[+L], ",");
1845
+ }).replace(un, function(P, C, F) {
1846
+ return F.charAt(C - 1) === "\\" ? P : dn[P];
1847
+ }).replace(/\n\s+/g, function(P) {
1848
+ return /\n/.test(P.slice(1)) ? "\\par " : P;
1849
+ }).replace(/\\symbol\{(\d+)\}/, function(P, C, F, H) {
1850
+ return H.charAt(F - 1) === "\\" ? P : String.fromCharCode(1 * C);
1851
+ }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(P, C, F, H) {
1852
+ return C + F + "{" + H + "}";
1853
+ }).replace(/\\verb,(.*?),/, function(P, C) {
1854
+ return "\\verb,".concat(n[+C], ",");
1854
1855
  });
1855
- for (var o, i = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, h = [], y = [], w = function($) {
1856
- for (var L in i)
1857
- i[L] && ($[L] = i[L]);
1858
- return h.push($), $;
1856
+ for (var o, i = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, c = [], y = [], w = function(P) {
1857
+ for (var C in i)
1858
+ i[C] && (P[C] = i[C]);
1859
+ return c.push(P), P;
1859
1860
  }, x = function() {
1860
1861
  y.push(i), i = Object.create(i);
1861
- }, b = function() {
1862
+ }, E = function() {
1862
1863
  if (!y.length)
1863
1864
  throw new Error("Unexpected }");
1864
1865
  i = y.pop();
1865
- }, E = { tokens: h, open_context: x, close_context: b, add_token: w }; e.length; ) {
1866
- if (o = an.exec(e))
1866
+ }, k = { tokens: c, open_context: x, close_context: E, add_token: w }; e.length; ) {
1867
+ if (o = hn.exec(e))
1867
1868
  Nt(o[0], !1).forEach(w);
1868
- else if (o = ln.exec(e))
1869
- w(new N(o[1]));
1870
- else if (!(o = on.exec(e))) {
1869
+ else if (o = cn.exec(e))
1870
+ w(new R(o[1]));
1871
+ else if (!(o = ln.exec(e))) {
1871
1872
  if (o = /^\{/.exec(e))
1872
1873
  x();
1873
1874
  else if (o = /^\}/.exec(e))
1874
- b();
1875
+ E();
1875
1876
  else if (!(o = /^\$/.exec(e)))
1876
1877
  if (o = /^\\verb,([^,]+),/.exec(e))
1877
- w(new N(o[1]));
1878
- else if (o = sn.exec(e)) {
1879
- var O = o[1].slice(1) || o[1], M = !!o[2];
1878
+ w(new R(o[1]));
1879
+ else if (o = an.exec(e)) {
1880
+ var O = o[1].slice(1) || o[1], L = !!o[2];
1880
1881
  if (/^(La)?TeX$/i.test(O)) {
1881
1882
  x(), i.family = "serif";
1882
1883
  var I = void 0;
1883
- O === "LaTeX" && ((I = w(new N("L"))).tracking = -0.25, (I = w(new N("A"))).size = 0.7, I.baseline = 0.3, I.tracking = -0.1), (I = w(new N("T"))).tracking = -0.17, (I = w(new N("E"))).baseline = -0.22, I.tracking = -0.13, I = w(new N("X")), b();
1884
- } else if (O in ye)
1885
- w(new N(ye[O])), M && x();
1886
- else if (O in V) {
1887
- var z = [], R = V[O].length - 1, Q = void 0;
1888
- if (R) {
1889
- for (M = !1, e = e.slice(o[0].length - 1); R--; ) {
1884
+ O === "LaTeX" && ((I = w(new R("L"))).tracking = -0.25, (I = w(new R("A"))).size = 0.7, I.baseline = 0.3, I.tracking = -0.1), (I = w(new R("T"))).tracking = -0.17, (I = w(new R("E"))).baseline = -0.22, I.tracking = -0.13, I = w(new R("X")), E();
1885
+ } else if (O in ve)
1886
+ w(new R(ve[O])), L && x();
1887
+ else if (O in U) {
1888
+ var z = [], j = U[O].length - 1, Q = void 0;
1889
+ if (j) {
1890
+ for (L = !1, e = e.slice(o[0].length - 1); j--; ) {
1890
1891
  if (!(Q = /^\{([^}]+)\}/.exec(e)))
1891
1892
  throw new Error(O + " is missing an argument");
1892
1893
  z.push(Q[1]), e = e.slice(Q[0].length);
1893
1894
  }
1894
- o[0] = /^\{/.exec(e) ? "{" : "", M = !!o[0];
1895
+ o[0] = /^\{/.exec(e) ? "{" : "", L = !!o[0];
1895
1896
  }
1896
- M && x(), V[O].apply(E, [i].concat(z));
1897
+ L && x(), U[O].apply(k, [i].concat(z));
1897
1898
  } else
1898
- console.warn("unknown latex command", O), w(new N(o[1])), M && x();
1899
+ console.warn("unknown latex command", O), w(new R(o[1])), L && x();
1899
1900
  } else
1900
- o = [e.slice(0, 1)], w(new N(o[0]));
1901
+ o = [e.slice(0, 1)], w(new R(o[0]));
1901
1902
  }
1902
1903
  e = e.slice(o[0].length);
1903
1904
  }
1904
- return h;
1905
+ return c;
1905
1906
  }, rt.measureText = function(e, n, o) {
1906
- return Y(e, S(n), o);
1907
- }, rt.Token = N, rt.Break = Tt, rt.LineBreak = nt, rt.SoftHyphen = pt, rt.Rotator = be, be.createElement = Se;
1908
- const Sn = rt;
1907
+ return X(e, b(n), o);
1908
+ }, rt.Token = R, rt.Break = Tt, rt.LineBreak = nt, rt.SoftHyphen = pt, rt.Rotator = Se, Se.createElement = ke;
1909
+ const kn = rt;
1909
1910
  return r.default;
1910
1911
  })());
1911
- })(Ve);
1912
- var Fn = Ve.exports;
1913
- const Oe = /* @__PURE__ */ ce(Fn);
1914
- function Bn(u, l) {
1915
- const t = ut(u), { fontSize: r, font: a, padding: c = 0 } = u.properties.style || {};
1912
+ })(Ye);
1913
+ var Bn = Ye.exports;
1914
+ const Le = /* @__PURE__ */ de(Bn);
1915
+ function se(u) {
1916
+ return u.replace(/…$/, "");
1917
+ }
1918
+ function oe(u) {
1919
+ return u.children[0].innerHTML;
1920
+ }
1921
+ function Vn(u, l) {
1922
+ const t = ut(u), { fontSize: r, font: a, padding: h = 0 } = u.properties.style || {};
1916
1923
  if (t.width === t.height && t.width === 0)
1917
1924
  return;
1918
- const p = new Oe({
1925
+ const f = new Le({
1919
1926
  font: `${r}px/${r}px ${a}`.replace(/(px)+/g, "px"),
1920
- width: t.width - c * 2,
1921
- height: t.height - c * 2,
1927
+ width: t.width - h * 2,
1928
+ height: t.height - h * 2,
1922
1929
  align: "left",
1923
1930
  valign: "top",
1924
1931
  x: 0,
1925
1932
  overflow: "ellipsis",
1926
1933
  parser: "html",
1927
- createElement: Oe.createElement
1928
- }).linebreak(
1934
+ createElement: Le.createElement
1935
+ });
1936
+ f.overflowWrap("break-word");
1937
+ const p = f.linebreak(
1929
1938
  u.properties.content.replaceAll(`
1930
1939
  `, "<br>")
1931
- ).render();
1932
- p.setAttribute("transform", `translate(${c}, ${c})`), l.appendChild(p);
1940
+ ).render(), s = [...p.children];
1941
+ let d = 0;
1942
+ const m = [];
1943
+ u.properties.content.split(`
1944
+ `).forEach((b) => {
1945
+ let D = b;
1946
+ for (; D.length && d < s.length; ) {
1947
+ if (s[d].innerHTML === "&nbsp;") {
1948
+ D.startsWith(`
1949
+ `) || m.push(d), d++;
1950
+ break;
1951
+ }
1952
+ const A = se(oe(s[d]));
1953
+ D.startsWith(A) && (D = D.slice(A.length).trim()), d++;
1954
+ }
1955
+ }), m.forEach((b) => p.removeChild(s[b]));
1956
+ const S = u.properties.content.match(/(https?:\/\/.*)/gm), T = S ? S.map((b) => b.split(" ")[0]) : [];
1957
+ p.setAttribute("transform", `translate(${h}, ${h})`), T.forEach((b) => {
1958
+ let D = b;
1959
+ const A = [];
1960
+ for (; D.length > 0; ) {
1961
+ const $ = s.find((_) => !!_.children[0] && _.children[0].tagName === "tspan" && D.startsWith(se(oe(_))));
1962
+ if (!$)
1963
+ break;
1964
+ A.push($);
1965
+ const N = se($.children[0].innerHTML).length;
1966
+ if (!N)
1967
+ break;
1968
+ D = D.slice(N);
1969
+ }
1970
+ A.forEach(($) => {
1971
+ const N = document.createElementNS("http://www.w3.org/2000/svg", "a");
1972
+ N.setAttribute("href", b), N.setAttribute("target", "_blank"), N.innerHTML = oe($), $.children[0].innerHTML = "", $.children[0].appendChild(N);
1973
+ });
1974
+ }), l.appendChild(p);
1933
1975
  }
1934
- const Me = 20;
1935
- class qn extends qe {
1976
+ const ze = 20;
1977
+ class Un extends Ue {
1936
1978
  constructor(t, r = {}) {
1937
1979
  super(
1938
1980
  t,
@@ -1946,7 +1988,7 @@ class qn extends qe {
1946
1988
  <span class="handle left top point-handle top-left" data-handle-id="5"></span>
1947
1989
  <span class="handle bottom right point-handle bottom-right" data-handle-id="6"></span>
1948
1990
  <span class="handle left bottom left-handle point-handle bottom-left" data-handle-id="7"></span>
1949
- <textarea wrap="off"></textarea>
1991
+ <textarea wrap="on"></textarea>
1950
1992
  </div>
1951
1993
  `
1952
1994
  );
@@ -1957,7 +1999,7 @@ class qn extends qe {
1957
1999
  v(this, "startX", 0);
1958
2000
  v(this, "startY", 0);
1959
2001
  v(this, "handles", []);
1960
- v(this, "draggedHandle", q);
2002
+ v(this, "draggedHandle", V);
1961
2003
  v(this, "isFocused", !1);
1962
2004
  v(this, "placeholder", "Type your text here...");
1963
2005
  v(this, "_onFocus", () => {
@@ -1966,22 +2008,22 @@ class qn extends qe {
1966
2008
  v(this, "_onBlur", () => {
1967
2009
  this.isFocused = !1;
1968
2010
  });
1969
- v(this, "startDrawing", (t, r, a = jn(t, r, 0, 0, "", At)) => {
2011
+ v(this, "startDrawing", (t, r, a = qn(t, r, 0, 0, "", At)) => {
1970
2012
  this.add(a);
1971
- const c = this.ogma.view.graphToScreenCoordinates({ x: t, y: r });
1972
- this.select(a.id), this.startDragging(this.getById(a.id), c.x, c.y), this.draggedHandle = 6;
2013
+ const h = this.ogma.view.graphToScreenCoordinates({ x: t, y: r });
2014
+ this.select(a.id), this.startDragging(this.getById(a.id), h.x, h.y), this.draggedHandle = 6;
1973
2015
  });
1974
2016
  v(this, "cancelDrawing", () => {
1975
- this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...re }, this.draggedHandle = q, this.isDragging = !1, this.emit(St, this.annotation));
2017
+ this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...re }, this.draggedHandle = V, this.isDragging = !1, this.emit(St, this.annotation));
1976
2018
  });
1977
2019
  v(this, "startDragging", (t, r, a) => {
1978
2020
  this.annotation = t;
1979
- const c = ct(this.annotation), d = ut(this.annotation);
1980
- this.rect.x = c.x, this.rect.y = c.y, this.rect.width = d.width, this.rect.height = d.height, this.startX = r, this.startY = a, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(Yt, this.annotation), this.isDragging = !0;
2021
+ const h = ct(this.annotation), f = ut(this.annotation);
2022
+ this.rect.x = h.x, this.rect.y = h.y, this.rect.width = f.width, this.rect.height = f.height, this.startX = r, this.startY = a, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(Yt, this.annotation), this.isDragging = !0;
1981
2023
  });
1982
2024
  v(this, "onHandleMouseDown", (t) => {
1983
2025
  const r = this.getById(this.selectedId) || this.getById(this.hoveredId);
1984
- r && (this.selectedId !== r.id && this.select(this.hoveredId), this.startDragging(r, t.clientX, t.clientY), this.draggedHandle = He(t.target));
2026
+ r && (this.selectedId !== r.id && this.select(this.hoveredId), this.startDragging(r, t.clientX, t.clientY), this.draggedHandle = Fe(t.target));
1985
2027
  });
1986
2028
  v(this, "onMouseMove", (t) => {
1987
2029
  requestAnimationFrame(() => this._onMouseMove(t));
@@ -1990,19 +2032,22 @@ class qn extends qe {
1990
2032
  if (!this.isDragging)
1991
2033
  return;
1992
2034
  t.stopPropagation(), t.preventDefault();
1993
- const r = this.handles[this.draggedHandle], a = r.classList.contains("top"), c = r.classList.contains("left"), d = r.classList.contains("right"), g = r.classList.contains("bottom"), p = r.classList.contains("line-handle"), s = this.ogma.view.getZoom(), f = (t.clientX - this.startX) / s, m = (t.clientY - this.startY) / s, A = this.ogma.view.getAngle(), T = new U(f, m).rotateRadians(A);
1994
- (g && c || a && d) && (T.y = 0, T.x = 0);
1995
- const S = c || p ? this.rect.x + T.x : this.rect.x, C = a || p ? this.rect.y + T.y : this.rect.y, k = Math.max(
1996
- this.rect.width + f * (p || c ? 0 : 1),
1997
- Me
1998
- ), F = Math.max(
2035
+ const r = this.handles[this.draggedHandle], a = r.classList.contains("top"), h = r.classList.contains("left"), f = r.classList.contains("right"), g = r.classList.contains("bottom"), p = r.classList.contains("line-handle"), s = this.ogma.view.getZoom(), d = (t.clientX - this.startX) / s, m = (t.clientY - this.startY) / s, S = this.ogma.view.getAngle(), T = new Y(d, m).rotateRadians(S);
2036
+ (g && h || a && f) && (T.y = 0, T.x = 0);
2037
+ const b = h || p ? this.rect.x + T.x : this.rect.x, D = a || p ? this.rect.y + T.y : this.rect.y, A = Math.max(
2038
+ this.rect.width + d * (p || h ? 0 : 1),
2039
+ ze
2040
+ ), $ = Math.max(
1999
2041
  this.rect.height + m * (p || a ? 0 : 1),
2000
- Me
2042
+ ze
2001
2043
  );
2002
- zn(this.annotation, S, C, k, F), this.emit(Ut, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2044
+ Cn(this.annotation, b, D, A, $), this.emit(Ut, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2003
2045
  });
2004
2046
  v(this, "onMouseUp", () => {
2005
- !this.isDragging || this.draggedHandle === q || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(St, this.annotation), this.isDragging = !1, this.draggedHandle = q);
2047
+ !this.isDragging || this.draggedHandle === V || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(St, this.annotation), this.isDragging = !1, this.draggedHandle = V);
2048
+ });
2049
+ v(this, "_onMousedown", (t) => {
2050
+ t.stopPropagation();
2006
2051
  });
2007
2052
  v(this, "onViewChanged", () => {
2008
2053
  const t = Math.max(2, this.handleSize / this.ogma.view.getZoom());
@@ -2010,57 +2055,60 @@ class qn extends qe {
2010
2055
  });
2011
2056
  v(this, "_onInput", () => {
2012
2057
  const t = this.getById(this.selectedId);
2013
- t && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), t.properties.content = this.textArea.value, this.emit(he, t), this.layer.refresh());
2058
+ t && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), t.properties.content = this.textArea.value, this.emit(ue, t), this.layer.refresh());
2014
2059
  });
2015
- this.showeditorOnHover = !1, this.handleSize = De.handleSize || r.textHandleSize, this.placeholder = De.placeholder || r.textPlaceholder || "";
2060
+ this.showeditorOnHover = !1, this.handleSize = Oe.handleSize || r.textHandleSize, this.placeholder = Oe.placeholder || r.textPlaceholder || "";
2016
2061
  const a = this.textArea = this.editor.element.querySelector("textarea");
2017
- a.addEventListener("input", this._onInput), a.addEventListener("focus", this._onFocus), a.addEventListener("blur", this._onBlur), a.spellcheck = !1, this.handles = Array.prototype.slice.call(
2062
+ a.addEventListener("input", this._onInput), a.addEventListener("focus", this._onFocus), a.addEventListener("blur", this._onBlur), a.addEventListener("mousedown", this._onMousedown), a.spellcheck = !1, this.handles = Array.prototype.slice.call(
2018
2063
  this.editor.element.querySelectorAll(".annotation-text-handle > .handle")
2019
2064
  ), this.handles.forEach(
2020
- (c) => c.addEventListener("mousedown", this.onHandleMouseDown)
2065
+ (h) => h.addEventListener("mousedown", this.onHandleMouseDown)
2021
2066
  ), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("mousemove", this.onMouseMove, !0), t.events.on(["viewChanged", "zoom"], this.onViewChanged);
2022
2067
  }
2023
2068
  _canRemove() {
2024
2069
  return !this.isFocused;
2025
2070
  }
2026
2071
  detect({ x: t, y: r }, a = 0) {
2027
- const c = new U(t, r), d = this.ogma.view.getAngle();
2072
+ const h = new Y(t, r), f = this.ogma.view.getAngle();
2028
2073
  return this.elements.find((g) => {
2029
- const { x: p, y: s } = ct(g), { width: f, height: m } = ut(g), A = new U(p, s), { x: T, y: S } = c.sub(A).rotateRadians(-d);
2030
- return T > -a && T < f + a && S > -a && S < m + a;
2074
+ const { x: p, y: s } = ct(g), { width: d, height: m } = ut(g), S = new Y(p, s), { x: T, y: b } = h.sub(S).rotateRadians(-f);
2075
+ return T > -a && T < d + a && b > -a && b < m + a;
2031
2076
  });
2032
2077
  }
2033
2078
  draw(t) {
2034
2079
  t.innerHTML = "";
2035
2080
  const r = "", a = this.ogma.view.getAngle();
2036
- this.elements.forEach((d, g) => {
2037
- const p = `class${g}`, s = ut(d), f = ct(d), m = d.id, {
2038
- color: A,
2081
+ this.elements.forEach((f, g) => {
2082
+ const p = `class${g}`, s = ut(f), d = ct(f), m = f.id, {
2083
+ color: S,
2039
2084
  fontSize: T,
2040
- font: S,
2041
- strokeColor: C,
2042
- strokeWidth: k,
2043
- strokeType: F,
2044
- background: X
2045
- } = d.properties.style || At;
2085
+ font: b,
2086
+ strokeColor: D,
2087
+ strokeWidth: A,
2088
+ strokeType: $,
2089
+ background: N
2090
+ } = f.properties.style || At;
2046
2091
  if (m === this.selectedId)
2047
2092
  return;
2048
- const D = Mt("g");
2049
- D.classList.add("annotation-text"), D.setAttribute("fill", `${A}`), D.setAttribute("font-size", `${T}px`), D.setAttribute("font-family", `${S}`);
2050
- const Y = Mt("rect");
2051
- let G = !1;
2052
- F && F !== "none" && (G = !0, Y.setAttribute("stroke", C || "black"), Y.setAttribute("stroke-width", `${k}`), F === "dashed" && Y.setAttribute("stroke-dasharray", "5,5")), (X && X.length || G) && (G = !0, Y.setAttribute("fill", X || "transparent")), G && (Y.setAttribute("width", `${s.width}`), Y.setAttribute("height", `${s.height}`)), D.appendChild(Y), Bn(d, D);
2053
- const { x: Et, y: kt } = new U(f.x, f.y).rotateRadians(-a);
2054
- D.setAttribute("transform", `translate(${Et},${kt})`), D.classList.add(p), D.setAttribute("data-annotation", `${d.id}`), D.setAttribute("data-annotation-type", "text"), t.appendChild(D);
2093
+ const _ = Ot("g");
2094
+ _.classList.add("annotation-text"), _.setAttribute("fill", `${S}`), _.setAttribute("font-size", `${T}px`), _.setAttribute("font-family", `${b}`);
2095
+ const X = Ot("rect");
2096
+ let W = !1;
2097
+ $ && $ !== "none" && (W = !0, X.setAttribute("stroke", D || "black"), X.setAttribute("stroke-width", `${A}`), $ === "dashed" && X.setAttribute("stroke-dasharray", "5,5")), (N && N.length || W) && (W = !0, X.setAttribute("fill", N || "transparent")), W && (X.setAttribute("width", `${s.width}`), X.setAttribute("height", `${s.height}`)), _.appendChild(X), Vn(f, _);
2098
+ const { x: Et, y: kt } = new Y(d.x, d.y).rotateRadians(-a);
2099
+ _.setAttribute("transform", `translate(${Et},${kt})`), _.classList.add(p), _.setAttribute("data-annotation", `${f.id}`), _.setAttribute("data-annotation-type", "text"), t.appendChild(_);
2055
2100
  });
2056
- const c = Mt("style");
2057
- c.innerHTML = r, t.firstChild && t.insertBefore(c, t.firstChild);
2101
+ const h = Ot("style");
2102
+ h.innerHTML = r, t.firstChild && t.insertBefore(h, t.firstChild);
2058
2103
  }
2059
2104
  refreshDrawing() {
2060
2105
  const t = this.ogma.view.getAngle();
2061
2106
  [...this.layer.element.children].forEach((r) => {
2062
- const a = ct(this.getById(+r.getAttribute("data-annotation"))), { x: c, y: d } = new U(a.x, a.y).rotateRadians(-t);
2063
- r.setAttribute("transform", `translate(${c},${d})`);
2107
+ const a = r.getAttribute("data-annotation");
2108
+ if (!a)
2109
+ return;
2110
+ const h = ct(this.getById(a)), { x: f, y: g } = new Y(h.x, h.y).rotateRadians(-t);
2111
+ r.setAttribute("transform", `translate(${f},${g})`);
2064
2112
  });
2065
2113
  }
2066
2114
  getDefaultOptions() {
@@ -2069,14 +2117,14 @@ class qn extends qe {
2069
2117
  refreshEditor() {
2070
2118
  if (+this.selectedId < 0 && +this.hoveredId < 0)
2071
2119
  return;
2072
- const t = this.getById(this.selectedId) || this.getById(this.hoveredId), r = ut(t), a = this.ogma.view.graphToScreenCoordinates(ct(t)), c = this.ogma.view.getZoom(), {
2073
- font: d,
2120
+ const t = this.getById(this.selectedId) || this.getById(this.hoveredId), r = ut(t), a = this.ogma.view.graphToScreenCoordinates(ct(t)), h = this.ogma.view.getZoom(), {
2121
+ font: f,
2074
2122
  fontSize: g,
2075
2123
  color: p,
2076
2124
  background: s,
2077
- padding: f = 0
2078
- } = t.properties.style || At, m = (g || 1) * c;
2079
- this.textArea.value = t.properties.content, this.editor.element.style.transform = `translate(${a.x}px, ${a.y}px)translate(-50%, -50%)translate(${r.width / 2 * c}px, ${r.height / 2 * c}px)`, this.editor.element.style.width = `${r.width * c}px`, this.editor.element.style.height = `${r.height * c}px`, this.textArea.style.font = `${m} ${d}`, this.textArea.style.fontFamily = d || "sans-serif", this.textArea.style.fontSize = `${m}px`, this.textArea.style.padding = `${c * f}px`, this.textArea.style.lineHeight = `${m}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = p || "black", this.textArea.style.background = s || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2125
+ padding: d = 0
2126
+ } = t.properties.style || At, m = (g || 1) * h;
2127
+ this.textArea.value = t.properties.content, this.editor.element.style.transform = `translate(${a.x}px, ${a.y}px)translate(-50%, -50%)translate(${r.width / 2 * h}px, ${r.height / 2 * h}px)`, this.editor.element.style.width = `${r.width * h}px`, this.editor.element.style.height = `${r.height * h}px`, this.textArea.style.font = `${m} ${f}`, this.textArea.style.fontFamily = f || "sans-serif", this.textArea.style.fontSize = `${m}px`, this.textArea.style.padding = `${h * d}px`, this.textArea.style.lineHeight = `${m}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = p || "black", this.textArea.style.background = s || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2080
2128
  }
2081
2129
  select(t) {
2082
2130
  super.select(t), this.textArea.focus();
@@ -2085,26 +2133,26 @@ class qn extends qe {
2085
2133
  super.destroy(), document.removeEventListener("mouseup", this.onMouseUp), document.removeEventListener("mousemove", this.onMouseMove, !0), this.ogma.events.off(this.onViewChanged);
2086
2134
  }
2087
2135
  }
2088
- class Vn {
2136
+ class Yn {
2089
2137
  constructor() {
2090
2138
  v(this, "links", {});
2091
2139
  v(this, "linksByTargetId", {});
2092
2140
  v(this, "linksByArrowId", {});
2093
2141
  }
2094
- add(l, t, r, a, c) {
2095
- const d = Xt(), g = l.id, p = {
2096
- id: d,
2142
+ add(l, t, r, a, h) {
2143
+ const f = Xt(), g = l.id, p = {
2144
+ id: f,
2097
2145
  arrow: g,
2098
2146
  target: r,
2099
2147
  targetType: a,
2100
- connectionPoint: c,
2148
+ connectionPoint: h,
2101
2149
  side: t
2102
2150
  };
2103
- return this.links[d] = p, this.linksByTargetId[r] || (this.linksByTargetId[r] = []), this.linksByTargetId[r].push(d), this.linksByArrowId[g] || (this.linksByArrowId[g] = {}), this.linksByArrowId[g][t] = d, l.properties.link = l.properties.link || {}, l.properties.link[t] = {
2151
+ return this.links[f] = p, this.linksByTargetId[r] || (this.linksByTargetId[r] = []), this.linksByTargetId[r].push(f), this.linksByArrowId[g] || (this.linksByArrowId[g] = {}), this.linksByArrowId[g][t] = f, l.properties.link = l.properties.link || {}, l.properties.link[t] = {
2104
2152
  id: r,
2105
2153
  side: t,
2106
2154
  type: a,
2107
- magnet: c
2155
+ magnet: h
2108
2156
  }, this;
2109
2157
  }
2110
2158
  arrowIsLinked(l, t) {
@@ -2117,12 +2165,12 @@ class Vn {
2117
2165
  const r = l.id, a = (g = this.linksByArrowId[r]) == null ? void 0 : g[t];
2118
2166
  if ((p = l.properties.link) == null || delete p[t], !a)
2119
2167
  return this;
2120
- const c = this.links[a];
2168
+ const h = this.links[a];
2121
2169
  delete this.links[a];
2122
- const d = this.linksByTargetId[c.target];
2123
- for (let s = 0; s < d.length; s++)
2124
- if (d[s] === a) {
2125
- d.splice(s, 1);
2170
+ const f = this.linksByTargetId[h.target];
2171
+ for (let s = 0; s < f.length; s++)
2172
+ if (f[s] === a) {
2173
+ f.splice(s, 1);
2126
2174
  break;
2127
2175
  }
2128
2176
  return delete this.linksByArrowId[r][t], this;
@@ -2140,7 +2188,7 @@ class Vn {
2140
2188
  Object.values(this.links).forEach(l);
2141
2189
  }
2142
2190
  }
2143
- const ot = (u) => u.properties.type === "arrow", mt = (u) => u.properties.type === "text", ze = (u) => u.type === "FeatureCollection", Un = {
2191
+ const ot = (u) => u.properties.type === "arrow", mt = (u) => u.properties.type === "text", Ce = (u) => u.type === "FeatureCollection", Xn = {
2144
2192
  magnetColor: "#3e8",
2145
2193
  detectMargin: 20,
2146
2194
  magnetHandleRadius: 5,
@@ -2150,7 +2198,7 @@ const ot = (u) => u.properties.type === "arrow", mt = (u) => u.properties.type =
2150
2198
  textHandleSize: 3.5,
2151
2199
  minArrowHeight: 20,
2152
2200
  maxArrowHeight: 30
2153
- }, Le = ["start", "end"], Ce = [
2201
+ }, $e = ["start", "end"], Pe = [
2154
2202
  { x: 0, y: 0 },
2155
2203
  { x: 0.5, y: 0 },
2156
2204
  { x: 1, y: 0 },
@@ -2160,12 +2208,12 @@ const ot = (u) => u.properties.type === "arrow", mt = (u) => u.properties.type =
2160
2208
  { x: 0.5, y: 1 },
2161
2209
  { x: 1, y: 1 }
2162
2210
  ];
2163
- class Gn extends Be {
2211
+ class Zn extends Ve {
2164
2212
  constructor(t, r = {}) {
2165
2213
  super();
2166
2214
  v(this, "arrows");
2167
2215
  v(this, "texts");
2168
- v(this, "links", new Vn());
2216
+ v(this, "links", new Yn());
2169
2217
  v(this, "layer");
2170
2218
  v(this, "annotations");
2171
2219
  v(this, "ogma");
@@ -2181,33 +2229,33 @@ class Gn extends Be {
2181
2229
  return;
2182
2230
  t.beginPath(), t.fillStyle = "green";
2183
2231
  const r = this.ogma.view.getZoom();
2184
- Ce.forEach((a) => {
2232
+ Pe.forEach((a) => {
2185
2233
  if (!this.textToMagnet)
2186
2234
  return;
2187
- const c = ut(this.textToMagnet), d = ct(this.textToMagnet), { x: g, y: p } = new U(a.x, a.y).mul({ x: c.width, y: c.height }).rotateRadians(this.ogma.view.getAngle()).add(d);
2235
+ const h = ut(this.textToMagnet), f = ct(this.textToMagnet), { x: g, y: p } = new Y(a.x, a.y).mul({ x: h.width, y: h.height }).rotateRadians(this.ogma.view.getAngle()).add(f);
2188
2236
  t.moveTo(g, p), t.arc(g, p, this.options.magnetHandleRadius / r, 0, Math.PI * 2);
2189
2237
  }), t.fill(), t.closePath();
2190
2238
  });
2191
2239
  v(this, "_onFeatureDrag", (t, r) => {
2192
2240
  const a = r;
2193
2241
  if (ot(t) && a === "line")
2194
- ["start", "end"].find((c) => {
2195
- const d = c === "start" ? zt(t) : qt(t);
2196
- return this._snapToText(t, a, d) || this._findAndSnapToNode(t, c, d);
2242
+ ["start", "end"].find((h) => {
2243
+ const f = h === "start" ? Lt(t) : Bt(t);
2244
+ return this._snapToText(t, a, f) || this._findAndSnapToNode(t, h, f);
2197
2245
  });
2198
2246
  else if (ot(t) && a !== "line") {
2199
- const c = a === "start" ? zt(t) : qt(t);
2200
- this._snapToText(t, a, c) || this._findAndSnapToNode(t, a, c);
2247
+ const h = a === "start" ? Lt(t) : Bt(t);
2248
+ this._snapToText(t, a, h) || this._findAndSnapToNode(t, a, h);
2201
2249
  } else
2202
- mt(t) && (this.activeLinks.forEach(({ arrow: c, side: d, connectionPoint: g }) => {
2203
- const p = this.getAnnotation(c), s = ut(t), f = ct(t), m = new U(g.x, g.y).mul({ x: s.width, y: s.height }).rotateRadians(this.ogma.view.getAngle()).add(f);
2204
- p.geometry.coordinates[d === "start" ? 0 : 1] = [m.x, m.y];
2250
+ mt(t) && (this.activeLinks.forEach(({ arrow: h, side: f, connectionPoint: g }) => {
2251
+ const p = this.getAnnotation(h), s = ut(t), d = ct(t), m = new Y(g.x, g.y).mul({ x: s.width, y: s.height }).rotateRadians(this.ogma.view.getAngle()).add(d);
2252
+ p.geometry.coordinates[f === "start" ? 0 : 1] = [m.x, m.y];
2205
2253
  }), this.activeLinks.length && this.arrows.refreshLayer());
2206
2254
  this.layer.refresh(), this.emit(Ut, t, r);
2207
2255
  });
2208
2256
  v(this, "_onFeatureDragEnd", (t) => {
2209
- this.dragged !== null && ot(t) && zt(this.dragged) && Le.forEach((r) => {
2210
- this.links.getArrowLink(t.id, r) && this.emit(Nn, {
2257
+ this.dragged !== null && ot(t) && Lt(this.dragged) && $e.forEach((r) => {
2258
+ this.links.getArrowLink(t.id, r) && this.emit(Rn, {
2211
2259
  arrow: t,
2212
2260
  link: this.links.getArrowLink(t.id, r)
2213
2261
  });
@@ -2228,26 +2276,26 @@ class Gn extends Be {
2228
2276
  });
2229
2277
  v(this, "_onLayoutEnd", (t) => {
2230
2278
  t.ids.forEach((r, a) => {
2231
- this.links.getTargetLinks(r, "node").forEach((d) => {
2232
- const g = this.getAnnotation(d.arrow), p = d.side, s = jt(
2279
+ this.links.getTargetLinks(r, "node").forEach((f) => {
2280
+ const g = this.getAnnotation(f.arrow), p = f.side, s = jt(
2233
2281
  g,
2234
2282
  p === "start" ? "end" : "start"
2235
- ), f = t.positions.current[a], m = this.ogma.getNode(r).getAttribute("radius"), A = Ft(s, f, +m);
2236
- bt(g, p, A.x, A.y);
2283
+ ), d = t.positions.current[a], m = this.ogma.getNode(r).getAttribute("radius"), S = Ft(s, d, +m);
2284
+ bt(g, p, S.x, S.y);
2237
2285
  });
2238
2286
  }), this.arrows.refreshLayer(), this.texts.refreshLayer();
2239
2287
  });
2240
2288
  v(this, "_onAdded", (t) => {
2241
- this.emit(le, t);
2289
+ this.emit(ce, t);
2242
2290
  });
2243
2291
  v(this, "_onRemoved", (t) => {
2244
- this.emit(ae, t);
2292
+ this.emit(he, t);
2245
2293
  });
2246
2294
  v(this, "_onUnselect", (t) => {
2247
- this.selected = null, this.emit(oe, t);
2295
+ this.selected = null, this.emit(le, t);
2248
2296
  });
2249
2297
  v(this, "_onSelect", (t) => {
2250
- this.selected !== t && (this.selected = t, this.emit(se, this.selected));
2298
+ this.selected !== t && (this.selected = t, this.emit(ae, this.selected));
2251
2299
  });
2252
2300
  /**
2253
2301
  * Triggers the update event on the annotation
@@ -2259,59 +2307,59 @@ class Gn extends Be {
2259
2307
  );
2260
2308
  });
2261
2309
  v(this, "_onUpdate", (t) => {
2262
- this.emit(he, t);
2310
+ this.emit(ue, t);
2263
2311
  });
2264
- this.options = this.setOptions({ ...Un, ...r }), this.ogma = t, this.arrows = new Hn(t, this.options), this.texts = new qn(t, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((a) => {
2265
- a.on(Yt, this._onFeatureDragStart).on(Ut, this._onFeatureDrag).on(St, this._onFeatureDragEnd).on(he, this.onUpdate).on(oe, this._onUnselect).on(se, this._onSelect).on(le, this._onAdded).on(ae, this._onRemoved);
2312
+ this.options = this.setOptions({ ...Xn, ...r }), this.ogma = t, this.arrows = new Fn(t, this.options), this.texts = new Un(t, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((a) => {
2313
+ a.on(Yt, this._onFeatureDragStart).on(Ut, this._onFeatureDrag).on(St, this._onFeatureDragEnd).on(ue, this.onUpdate).on(le, this._onUnselect).on(ae, this._onSelect).on(ce, this._onAdded).on(he, this._onRemoved);
2266
2314
  }), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag).on("layoutEnd", this._onLayoutEnd).on(["viewChanged", "rotate"], () => {
2267
2315
  this.refreshTextLinks();
2268
2316
  }), this.layer = t.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
2269
2317
  }
2270
2318
  _moveNodes(t, r, a) {
2271
- t.forEach((c) => {
2272
- const d = this.links.getTargetLinks(c.getId(), "node"), g = c.getPosition();
2273
- d.forEach((p) => {
2274
- const s = this.getAnnotation(p.arrow), f = p.side, m = jt(
2319
+ t.forEach((h) => {
2320
+ const f = this.links.getTargetLinks(h.getId(), "node"), g = h.getPosition();
2321
+ f.forEach((p) => {
2322
+ const s = this.getAnnotation(p.arrow), d = p.side, m = jt(
2275
2323
  s,
2276
- f === "start" ? "end" : "start"
2324
+ d === "start" ? "end" : "start"
2277
2325
  );
2278
- let A = g;
2279
- const T = +c.getAttribute("radius"), S = 1e-6;
2280
- (p.connectionPoint.x - (g.x - r) > S || p.connectionPoint.y - (g.y - a) > S) && (A = Ft(m, g, T)), bt(s, f, A.x, A.y);
2326
+ let S = g;
2327
+ const T = +h.getAttribute("radius"), b = 1e-6;
2328
+ (p.connectionPoint.x - (g.x - r) > b || p.connectionPoint.y - (g.y - a) > b) && (S = Ft(m, g, T)), bt(s, d, S.x, S.y);
2281
2329
  });
2282
2330
  }), this.arrows.refreshLayer();
2283
2331
  }
2284
2332
  _snapToText(t, r, a) {
2285
- const c = this.texts.detect(a, this.options.detectMargin);
2286
- if (this.links.remove(t, r), !c)
2333
+ const h = this.texts.detect(a, this.options.detectMargin);
2334
+ if (this.links.remove(t, r), !h)
2287
2335
  return !1;
2288
- this.textToMagnet = c;
2289
- const d = this.findMagnetPoint(Ce, c, a);
2290
- return d ? (bt(t, r, d.point.x, d.point.y), this.links.add(t, r, c.id, "text", d.magnet), !0) : !1;
2336
+ this.textToMagnet = h;
2337
+ const f = this.findMagnetPoint(Pe, h, a);
2338
+ return f ? (bt(t, r, f.point.x, f.point.y), this.links.add(t, r, h.id, "text", f.magnet), !0) : !1;
2291
2339
  }
2292
2340
  _findAndSnapToNode(t, r, a) {
2293
- const c = this.ogma.view.graphToScreenCoordinates(a), d = this.ogma.view.getElementAt(c);
2294
- this.links.remove(t, r), d && d.isNode ? (this.hoveredNode = d, this.hoveredNode.setSelected(!0), this._snapToNode(t, r, d, c)) : (this.hoveredNode && this.hoveredNode.setSelected(!1), this.hoveredNode = null);
2341
+ const h = this.ogma.view.graphToScreenCoordinates(a), f = this.ogma.view.getElementAt(h);
2342
+ this.links.remove(t, r), f && f.isNode ? (this.hoveredNode = f, this.hoveredNode.setSelected(!0), this._snapToNode(t, r, f, h)) : (this.hoveredNode && this.hoveredNode.setSelected(!1), this.hoveredNode = null);
2295
2343
  }
2296
- _snapToNode(t, r, a, c) {
2297
- const d = a.getPositionOnScreen(), g = +a.getAttribute("radius"), p = g * this.ogma.view.getZoom(), s = c.x - d.x, f = c.y - d.y, m = Math.sqrt(s * s + f * f), A = a.getPosition();
2344
+ _snapToNode(t, r, a, h) {
2345
+ const f = a.getPositionOnScreen(), g = +a.getAttribute("radius"), p = g * this.ogma.view.getZoom(), s = h.x - f.x, d = h.y - f.y, m = Math.sqrt(s * s + d * d), S = a.getPosition();
2298
2346
  if (m < p + this.options.detectMargin) {
2299
- let T = A;
2347
+ let T = S;
2300
2348
  if (m > p / 2) {
2301
- const S = jt(t, r === "end" ? "start" : "end");
2302
- T = Ft(S, T, g);
2349
+ const b = jt(t, r === "end" ? "start" : "end");
2350
+ T = Ft(b, T, g);
2303
2351
  }
2304
2352
  bt(t, r, T.x, T.y), this.links.add(t, r, a.getId(), "node", T);
2305
2353
  }
2306
2354
  }
2307
2355
  refreshTextLinks() {
2308
2356
  let t = !1;
2309
- this.links.forEach(({ connectionPoint: r, targetType: a, target: c, arrow: d, side: g }) => {
2357
+ this.links.forEach(({ connectionPoint: r, targetType: a, target: h, arrow: f, side: g }) => {
2310
2358
  if (a !== "text")
2311
2359
  return;
2312
2360
  t = !0;
2313
- const p = this.getAnnotation(c), s = this.getAnnotation(d), f = ut(p), m = ct(p), A = new U(r.x, r.y).mul({ x: f.width, y: f.height }).rotateRadians(this.ogma.view.getAngle()).add(m);
2314
- bt(s, g, A.x, A.y);
2361
+ const p = this.getAnnotation(h), s = this.getAnnotation(f), d = ut(p), m = ct(p), S = new Y(r.x, r.y).mul({ x: d.width, y: d.height }).rotateRadians(this.ogma.view.getAngle()).add(m);
2362
+ bt(s, g, S.x, S.y);
2315
2363
  }), t && this.arrows.refreshLayer();
2316
2364
  }
2317
2365
  /**
@@ -2321,23 +2369,23 @@ class Gn extends Be {
2321
2369
  return this.selected;
2322
2370
  }
2323
2371
  findMagnetPoint(t, r, a) {
2324
- let c;
2325
- for (const d of t) {
2326
- const g = ut(r), p = ct(r), s = new U(d.x, d.y).mul({ x: g.width, y: g.height }).rotateRadians(this.ogma.view.getAngle()).add(p), f = s.sub(a).length(), m = Math.min(
2372
+ let h;
2373
+ for (const f of t) {
2374
+ const g = ut(r), p = ct(r), s = new Y(f.x, f.y).mul({ x: g.width, y: g.height }).rotateRadians(this.ogma.view.getAngle()).add(p), d = s.sub(a).length(), m = Math.min(
2327
2375
  this.options.magnetRadius * this.ogma.view.getZoom(),
2328
2376
  // when really zoomed in: avoid to snap on too far away magnets
2329
2377
  g.width / 2,
2330
2378
  g.height / 2
2331
2379
  );
2332
- if (f < Math.max(m, this.options.magnetHandleRadius)) {
2333
- c = {
2380
+ if (d < Math.max(m, this.options.magnetHandleRadius)) {
2381
+ h = {
2334
2382
  point: s,
2335
- magnet: d
2383
+ magnet: f
2336
2384
  };
2337
2385
  break;
2338
2386
  }
2339
2387
  }
2340
- return c;
2388
+ return h;
2341
2389
  }
2342
2390
  /**
2343
2391
  * Set the options for the controller
@@ -2369,12 +2417,12 @@ class Gn extends Be {
2369
2417
  * @param annotation The annotation to add
2370
2418
  */
2371
2419
  add(t) {
2372
- if (ze(t)) {
2373
- const [r, a] = t.features.reduce((c, d) => (ot(d) ? c[1].push(d) : mt(d) && c[0].push(d), c), [[], []]);
2420
+ if (Ce(t)) {
2421
+ const [r, a] = t.features.reduce((h, f) => (ot(f) ? h[1].push(f) : mt(f) && h[0].push(f), h), [[], []]);
2374
2422
  return r.forEach(
2375
- (c) => this.add(c)
2423
+ (h) => this.add(h)
2376
2424
  ), a.forEach(
2377
- (c) => this.add(c)
2425
+ (h) => this.add(h)
2378
2426
  ), this.arrows.refreshLayer(), this;
2379
2427
  }
2380
2428
  switch (t.properties.type) {
@@ -2392,26 +2440,26 @@ class Gn extends Be {
2392
2440
  * @param annotation The annotation(s) to remove
2393
2441
  */
2394
2442
  remove(t) {
2395
- return ze(t) ? (t.features.forEach(
2443
+ return Ce(t) ? (t.features.forEach(
2396
2444
  (r) => this.remove(r)
2397
2445
  ), this) : (ot(t) ? (this.links.remove(t, "start"), this.links.remove(t, "end"), this.arrows.remove(t.id)) : this.texts.remove(t.id), this);
2398
2446
  }
2399
2447
  loadLink(t) {
2400
2448
  if (t.properties.link)
2401
- for (const r of Le) {
2449
+ for (const r of $e) {
2402
2450
  const a = t.properties.link[r];
2403
2451
  if (!a)
2404
2452
  continue;
2405
- const c = this.getAnnotation(a.id);
2406
- if (a.type === "text" && c)
2453
+ const h = this.getAnnotation(a.id);
2454
+ if (a.type === "text" && h)
2407
2455
  this.links.add(t, r, a.id, a.type, a.magnet);
2408
2456
  else if (a.type === "node") {
2409
- const d = this.ogma.getNode(a.id);
2410
- if (!d)
2457
+ const f = this.ogma.getNode(a.id);
2458
+ if (!f)
2411
2459
  continue;
2412
2460
  this.links.add(t, r, a.id, a.type, a.magnet);
2413
- const g = d.getPosition(), p = d.getAttribute("radius") || 0, s = jt(t, r === "start" ? "end" : "start"), f = Ft(s, g, +p);
2414
- bt(t, r, f.x, f.y);
2461
+ const g = f.getPosition(), p = f.getAttribute("radius") || 0, s = jt(t, r === "start" ? "end" : "start"), d = Ft(s, g, +p);
2462
+ bt(t, r, d.x, d.y);
2415
2463
  }
2416
2464
  }
2417
2465
  }
@@ -2437,7 +2485,7 @@ class Gn extends Be {
2437
2485
  * Cancel drawing on the current frame
2438
2486
  */
2439
2487
  cancelDrawing() {
2440
- this.annotations.forEach((t) => t.cancelDrawing()), this.emit(Pn);
2488
+ this.annotations.forEach((t) => t.cancelDrawing()), this.emit(Hn);
2441
2489
  }
2442
2490
  /**
2443
2491
  * Update the style of the annotation with the given id
@@ -2445,7 +2493,7 @@ class Gn extends Be {
2445
2493
  * @param style The new style
2446
2494
  */
2447
2495
  updateStyle(t, r) {
2448
- const a = this.getAnnotations().features.find((c) => c.id === t);
2496
+ const a = this.getAnnotations().features.find((h) => h.id === t);
2449
2497
  return a ? (ot(a) ? this.arrows.updateStyle(a, r) : mt(a) && this.texts.updateStyle(a, r), this.onUpdate(a), this) : this;
2450
2498
  }
2451
2499
  /**
@@ -2477,33 +2525,33 @@ class Gn extends Be {
2477
2525
  }
2478
2526
  }
2479
2527
  export {
2480
- Hn as Arrows,
2481
- Gn as Control,
2482
- qn as Texts,
2483
- Dn as createArrow,
2484
- Mt as createSVGElement,
2485
- jn as createText,
2486
- Ee as defaultArrowOptions,
2487
- Lt as defaultArrowStyle,
2488
- De as defaultControllerOptions,
2528
+ Fn as Arrows,
2529
+ Zn as Control,
2530
+ Un as Texts,
2531
+ On as createArrow,
2532
+ Ot as createSVGElement,
2533
+ qn as createText,
2534
+ Te as defaultArrowOptions,
2535
+ zt as defaultArrowStyle,
2536
+ Oe as defaultControllerOptions,
2489
2537
  re as defaultTextOptions,
2490
2538
  At as defaultTextStyle,
2491
- Xn as getAnnotationsBounds,
2492
- qt as getArrowEnd,
2539
+ Gn as getAnnotationsBounds,
2540
+ Bt as getArrowEnd,
2493
2541
  Vt as getArrowEndPoints,
2494
2542
  jt as getArrowSide,
2495
- zt as getArrowStart,
2543
+ Lt as getArrowStart,
2496
2544
  Ft as getAttachmentPointOnNode,
2497
- He as getHandleId,
2498
- Pe as getTextBbox,
2545
+ Fe as getHandleId,
2546
+ He as getTextBbox,
2499
2547
  ct as getTextPosition,
2500
2548
  ut as getTextSize,
2501
- ze as isAnnotationCollection,
2549
+ Ce as isAnnotationCollection,
2502
2550
  ot as isArrow,
2503
2551
  mt as isText,
2504
- Re as setArrowEnd,
2552
+ je as setArrowEnd,
2505
2553
  bt as setArrowEndPoint,
2506
- Ne as setArrowStart,
2507
- zn as setTextBbox,
2508
- Mn as updateTextBbox
2554
+ Re as setArrowStart,
2555
+ Cn as setTextBbox,
2556
+ zn as updateTextBbox
2509
2557
  };