@html-graph/html-graph 8.2.0 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,20 @@
1
- var ze = Object.defineProperty;
2
- var ke = (r, e, t) => e in r ? ze(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var o = (r, e, t) => ke(r, typeof e != "symbol" ? e + "" : e, t);
1
+ var He = Object.defineProperty;
2
+ var Xe = (r, e, t) => e in r ? He(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var o = (r, e, t) => Xe(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  var M = /* @__PURE__ */ ((r) => (r.Line = "line", r.NodeCycle = "node-cycle", r.PortCycle = "port-cycle", r))(M || {});
5
- const He = () => {
5
+ const Ye = () => {
6
6
  const r = document.createElement("div");
7
7
  return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r.style.overflow = "hidden", r;
8
- }, Xe = () => {
8
+ }, Ge = () => {
9
9
  const r = document.createElement("div");
10
10
  return r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.width = "0", r.style.height = "0", r;
11
- }, Ye = (r) => {
11
+ }, je = (r) => {
12
12
  r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.visibility = "hidden";
13
13
  };
14
- class me {
14
+ class Ae {
15
15
  constructor(e, t, s) {
16
- o(this, "host", He());
17
- o(this, "container", Xe());
16
+ o(this, "host", Ye());
17
+ o(this, "container", Ge());
18
18
  o(this, "edgeIdToElementMap", /* @__PURE__ */ new Map());
19
19
  o(this, "attachedNodeIds", /* @__PURE__ */ new Set());
20
20
  o(this, "applyTransform", () => {
@@ -25,7 +25,7 @@ class me {
25
25
  }
26
26
  attachNode(e) {
27
27
  const t = this.graphStore.getNode(e);
28
- Ye(t.element), this.attachedNodeIds.add(e), this.container.appendChild(t.element), this.updateNodePosition(e), this.updateNodePriority(e), t.element.style.visibility = "visible";
28
+ je(t.element), this.attachedNodeIds.add(e), this.container.appendChild(t.element), this.updateNodePosition(e), this.updateNodePriority(e), t.element.style.visibility = "visible";
29
29
  }
30
30
  detachNode(e) {
31
31
  const t = this.graphStore.getNode(e);
@@ -91,7 +91,7 @@ class me {
91
91
  };
92
92
  }
93
93
  }
94
- class Ge {
94
+ class qe {
95
95
  constructor(e) {
96
96
  o(this, "xFrom", 1 / 0);
97
97
  o(this, "yFrom", 1 / 0);
@@ -111,7 +111,7 @@ class Ge {
111
111
  return h <= this.xTo && d >= this.xFrom && c <= this.yTo && g >= this.yFrom;
112
112
  }
113
113
  }
114
- class je {
114
+ class Ke {
115
115
  constructor(e, t, s, i) {
116
116
  o(this, "attachedNodes", /* @__PURE__ */ new Set());
117
117
  o(this, "attachedEdges", /* @__PURE__ */ new Set());
@@ -135,7 +135,7 @@ class je {
135
135
  this.handleAttachEdge(a);
136
136
  });
137
137
  });
138
- this.htmlView = e, this.graphStore = t, this.trigger = s, this.params = i, this.renderingBox = new Ge(this.graphStore), this.trigger.subscribe(this.updateViewport);
138
+ this.htmlView = e, this.graphStore = t, this.trigger = s, this.params = i, this.renderingBox = new qe(this.graphStore), this.trigger.subscribe(this.updateViewport);
139
139
  }
140
140
  attachNode(e) {
141
141
  this.renderingBox.hasNode(e) && this.handleAttachNode(e);
@@ -189,7 +189,7 @@ class je {
189
189
  this.htmlView.detachEdge(e), this.attachedEdges.delete(e);
190
190
  }
191
191
  }
192
- class Ke {
192
+ class Qe {
193
193
  constructor(e, t) {
194
194
  o(this, "deferredNodes", /* @__PURE__ */ new Set());
195
195
  o(this, "deferredEdges", /* @__PURE__ */ new Set());
@@ -243,7 +243,7 @@ class Ke {
243
243
  this.isEdgeValid(e) && (this.deferredEdges.delete(e), this.htmlView.attachEdge(e));
244
244
  }
245
245
  }
246
- class j {
246
+ class K {
247
247
  constructor() {
248
248
  o(this, "callbacks", /* @__PURE__ */ new Set());
249
249
  }
@@ -260,10 +260,10 @@ class j {
260
260
  }
261
261
  }
262
262
  const x = () => {
263
- const r = new j();
263
+ const r = new K();
264
264
  return [r, r];
265
265
  };
266
- class X {
266
+ class Y {
267
267
  constructor(e) {
268
268
  o(this, "counter", 0);
269
269
  this.checkExists = e;
@@ -279,15 +279,15 @@ class X {
279
279
  this.counter = 0;
280
280
  }
281
281
  }
282
- class ve {
282
+ class Ee {
283
283
  constructor(e, t, s, i, n, a) {
284
- o(this, "nodeIdGenerator", new X(
284
+ o(this, "nodeIdGenerator", new Y(
285
285
  (e) => this.graphStore.hasNode(e)
286
286
  ));
287
- o(this, "portIdGenerator", new X(
287
+ o(this, "portIdGenerator", new Y(
288
288
  (e) => this.graphStore.hasPort(e)
289
289
  ));
290
- o(this, "edgeIdGenerator", new X(
290
+ o(this, "edgeIdGenerator", new Y(
291
291
  (e) => this.graphStore.hasEdge(e)
292
292
  ));
293
293
  o(this, "onAfterNodeAdded", (e) => {
@@ -467,7 +467,7 @@ class ve {
467
467
  ), this.graphStore.onBeforeEdgeRemoved.unsubscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.unsubscribe(this.onBeforeClear), this.htmlView.destroy(), this.viewportStore.destroy(), this.destroyed = !0);
468
468
  }
469
469
  }
470
- class Qe {
470
+ class Ze {
471
471
  constructor() {
472
472
  o(this, "singleToMultiMap", /* @__PURE__ */ new Map());
473
473
  o(this, "multiToSingleMap", /* @__PURE__ */ new Map());
@@ -513,7 +513,7 @@ class A extends Error {
513
513
  o(this, "name", "CanvasError");
514
514
  }
515
515
  }
516
- class Ae {
516
+ class xe {
517
517
  constructor() {
518
518
  o(this, "nodes", /* @__PURE__ */ new Map());
519
519
  o(this, "ports", /* @__PURE__ */ new Map());
@@ -522,7 +522,7 @@ class Ae {
522
522
  o(this, "portIncomingEdges", /* @__PURE__ */ new Map());
523
523
  o(this, "portOutcomingEdges", /* @__PURE__ */ new Map());
524
524
  o(this, "portCycleEdges", /* @__PURE__ */ new Map());
525
- o(this, "elementPorts", new Qe());
525
+ o(this, "elementPorts", new Ze());
526
526
  o(this, "afterNodeAddedEmitter");
527
527
  o(this, "onAfterNodeAdded");
528
528
  o(this, "afterNodeUpdatedEmitter");
@@ -776,22 +776,22 @@ class Ae {
776
776
  this.portCycleEdges.get(s).delete(e), this.portCycleEdges.get(i).delete(e), this.portIncomingEdges.get(s).delete(e), this.portIncomingEdges.get(i).delete(e), this.portOutcomingEdges.get(s).delete(e), this.portOutcomingEdges.get(i).delete(e), this.edges.delete(e);
777
777
  }
778
778
  }
779
- const de = (r) => ({
779
+ const le = (r) => ({
780
780
  scale: 1 / r.scale,
781
781
  x: -r.x / r.scale,
782
782
  y: -r.y / r.scale
783
- }), ce = {
783
+ }), ge = {
784
784
  scale: 1,
785
785
  x: 0,
786
786
  y: 0
787
- }, le = (r, e) => ({
787
+ }, ue = (r, e) => ({
788
788
  x: r.scale * e.x + r.x,
789
789
  y: r.scale * e.y + r.y
790
790
  });
791
- class Ze {
791
+ class Je {
792
792
  constructor(e) {
793
- o(this, "viewportMatrix", ce);
794
- o(this, "contentMatrix", ce);
793
+ o(this, "viewportMatrix", ge);
794
+ o(this, "contentMatrix", ge);
795
795
  o(this, "beforeUpdateEmitter");
796
796
  o(this, "onBeforeUpdated");
797
797
  o(this, "afterUpdateEmitter");
@@ -814,30 +814,30 @@ class Ze {
814
814
  scale: e.scale ?? this.viewportMatrix.scale,
815
815
  x: e.x ?? this.viewportMatrix.x,
816
816
  y: e.y ?? this.viewportMatrix.y
817
- }, this.beforeUpdateEmitter.emit(), this.contentMatrix = de(this.viewportMatrix), this.afterUpdateEmitter.emit();
817
+ }, this.beforeUpdateEmitter.emit(), this.contentMatrix = le(this.viewportMatrix), this.afterUpdateEmitter.emit();
818
818
  }
819
819
  patchContentMatrix(e) {
820
820
  this.contentMatrix = {
821
821
  scale: e.scale ?? this.contentMatrix.scale,
822
822
  x: e.x ?? this.contentMatrix.x,
823
823
  y: e.y ?? this.contentMatrix.y
824
- }, this.beforeUpdateEmitter.emit(), this.viewportMatrix = de(this.contentMatrix), this.afterUpdateEmitter.emit();
824
+ }, this.beforeUpdateEmitter.emit(), this.viewportMatrix = le(this.contentMatrix), this.afterUpdateEmitter.emit();
825
825
  }
826
826
  getDimensions() {
827
827
  const { width: e, height: t } = this.host.getBoundingClientRect();
828
828
  return { width: e, height: t };
829
829
  }
830
830
  createContentCoords(e) {
831
- return le(this.viewportMatrix, e);
831
+ return ue(this.viewportMatrix, e);
832
832
  }
833
833
  createViewportCoords(e) {
834
- return le(this.contentMatrix, e);
834
+ return ue(this.contentMatrix, e);
835
835
  }
836
836
  destroy() {
837
837
  this.observer.disconnect();
838
838
  }
839
839
  }
840
- class K {
840
+ class Q {
841
841
  constructor(e) {
842
842
  o(this, "elementToNodeId", /* @__PURE__ */ new Map());
843
843
  o(this, "nodesResizeObserver");
@@ -860,17 +860,17 @@ class K {
860
860
  }), this.canvas.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.canvas.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.canvas.graph.onBeforeClear.subscribe(this.onBeforeClear);
861
861
  }
862
862
  static configure(e) {
863
- new K(e);
863
+ new Q(e);
864
864
  }
865
865
  handleNodeResize(e) {
866
866
  const t = this.elementToNodeId.get(e);
867
867
  this.canvas.updateNode(t);
868
868
  }
869
869
  }
870
- const qe = (r, e, t) => {
870
+ const _e = (r, e, t) => {
871
871
  const { x: s, y: i, width: n, height: a } = r.getBoundingClientRect();
872
872
  return e >= s && e <= s + n && t >= i && t <= i + a;
873
- }, Je = (r, e, t) => e >= 0 && e <= r.innerWidth && t >= 0 && t <= r.innerHeight, L = (r, e, t, s) => qe(e, t, s) && Je(r, t, s), $ = (r, e) => {
873
+ }, et = (r, e, t) => e >= 0 && e <= r.innerWidth && t >= 0 && t <= r.innerHeight, R = (r, e, t, s) => _e(e, t, s) && et(r, t, s), $ = (r, e) => {
874
874
  e !== null ? r.style.cursor = e : r.style.removeProperty("cursor");
875
875
  }, U = (r) => {
876
876
  const e = document.createElement("div");
@@ -887,7 +887,7 @@ const qe = (r, e, t) => {
887
887
  }
888
888
  ]
889
889
  };
890
- }, _e = (r, e) => {
890
+ }, tt = (r, e) => {
891
891
  let t = e;
892
892
  for (; t !== null; ) {
893
893
  const s = r.findPortIdsByElement(t)[0] ?? null;
@@ -906,21 +906,21 @@ const qe = (r, e, t) => {
906
906
  status: "notFound"
907
907
  };
908
908
  };
909
- function* Ee(r, e) {
909
+ function* Se(r, e) {
910
910
  const t = r.elementsFromPoint(e.x, e.y);
911
911
  for (const s of t) {
912
912
  if (s.shadowRoot !== null) {
913
- const i = Ee(s.shadowRoot, e);
913
+ const i = Se(s.shadowRoot, e);
914
914
  for (const n of i)
915
915
  yield n;
916
916
  }
917
917
  yield s;
918
918
  }
919
919
  }
920
- const xe = (r, e) => {
921
- const t = Ee(document, e);
920
+ const be = (r, e) => {
921
+ const t = Se(document, e);
922
922
  for (const s of t) {
923
- const i = _e(r, s);
923
+ const i = tt(r, s);
924
924
  if (i.status === "portFound")
925
925
  return i.portId;
926
926
  if (i.status === "nodeEncountered")
@@ -929,16 +929,16 @@ const xe = (r, e) => {
929
929
  return null;
930
930
  };
931
931
  var N = /* @__PURE__ */ ((r) => (r.StaticNodeId = "static", r.DraggingNodeId = "dragging", r.EdgeId = "edge", r))(N || {});
932
- const Se = (r, e) => ({
932
+ const Pe = (r, e) => ({
933
933
  x: r / 2,
934
934
  y: e / 2
935
- }), p = {
935
+ }), w = {
936
936
  x: 0,
937
937
  y: 0
938
938
  }, m = (r, e, t) => ({
939
939
  x: e.x * r.x - e.y * r.y + ((1 - e.x) * t.x + e.y * t.y),
940
940
  y: e.y * r.x + e.x * r.y + ((1 - e.x) * t.y - e.y * t.x)
941
- }), be = (r, e) => {
941
+ }), Ne = (r, e) => {
942
942
  const t = {
943
943
  x: r.x + r.width / 2,
944
944
  y: r.y + r.height / 2
@@ -954,11 +954,11 @@ const Se = (r, e) => ({
954
954
  flipX: d,
955
955
  flipY: c
956
956
  };
957
- }, W = (r, e, t, s) => ({
957
+ }, z = (r, e, t, s) => ({
958
958
  x: e * r.x + (1 - e) / 2 * s.x,
959
959
  y: t * r.y + (1 - t) / 2 * s.y
960
960
  });
961
- class et {
961
+ class rt {
962
962
  constructor(e) {
963
963
  o(this, "path");
964
964
  o(this, "midpoint");
@@ -966,9 +966,9 @@ class et {
966
966
  const t = this.params.to;
967
967
  this.midpoint = { x: t.x / 2, y: t.y / 2 };
968
968
  const s = m(
969
- { x: this.params.arrowLength, y: p.y },
969
+ { x: this.params.arrowLength, y: w.y },
970
970
  this.params.sourceDirection,
971
- p
971
+ w
972
972
  ), i = m(
973
973
  { x: this.params.to.x - this.params.arrowLength, y: this.params.to.y },
974
974
  this.params.targetDirection,
@@ -979,20 +979,20 @@ class et {
979
979
  }, a = {
980
980
  x: i.x - this.params.targetDirection.x * this.params.curvature,
981
981
  y: i.y - this.params.targetDirection.y * this.params.curvature
982
- }, h = `M ${s.x} ${s.y} C ${n.x} ${n.y}, ${a.x} ${a.y}, ${i.x} ${i.y}`, d = this.params.hasSourceArrow ? "" : `M ${p.x} ${p.y} L ${s.x} ${s.y} `, c = this.params.hasTargetArrow ? "" : ` M ${i.x} ${i.y} L ${this.params.to.x} ${this.params.to.y}`;
982
+ }, h = `M ${s.x} ${s.y} C ${n.x} ${n.y}, ${a.x} ${a.y}, ${i.x} ${i.y}`, d = this.params.hasSourceArrow ? "" : `M ${w.x} ${w.y} L ${s.x} ${s.y} `, c = this.params.hasTargetArrow ? "" : ` M ${i.x} ${i.y} L ${this.params.to.x} ${this.params.to.y}`;
983
983
  this.path = `${d}${h}${c}`;
984
984
  }
985
985
  }
986
- class tt {
986
+ class st {
987
987
  constructor(e) {
988
988
  o(this, "path");
989
989
  o(this, "midpoint");
990
990
  this.params = e;
991
991
  const t = this.params.hasSourceArrow ? m(
992
- { x: this.params.arrowLength, y: p.y },
992
+ { x: this.params.arrowLength, y: w.y },
993
993
  this.params.sourceDirection,
994
- p
995
- ) : p, s = this.params.hasTargetArrow ? m(
994
+ w
995
+ ) : w, s = this.params.hasTargetArrow ? m(
996
996
  {
997
997
  x: this.params.to.x - this.params.arrowLength,
998
998
  y: this.params.to.y
@@ -1000,9 +1000,9 @@ class tt {
1000
1000
  this.params.targetDirection,
1001
1001
  this.params.to
1002
1002
  ) : this.params.to, i = this.params.arrowLength, n = Math.cos(this.params.detourDirection) * this.params.detourDistance, a = Math.sin(this.params.detourDirection) * this.params.detourDistance, h = n * this.params.flipX, d = a * this.params.flipY, c = m(
1003
- { x: i, y: p.y },
1003
+ { x: i, y: w.y },
1004
1004
  this.params.sourceDirection,
1005
- p
1005
+ w
1006
1006
  ), g = {
1007
1007
  x: c.x + h,
1008
1008
  y: c.y + d
@@ -1013,10 +1013,10 @@ class tt {
1013
1013
  ), u = {
1014
1014
  x: l.x + h,
1015
1015
  y: l.y + d
1016
- }, w = {
1016
+ }, p = {
1017
1017
  x: (g.x + u.x) / 2,
1018
1018
  y: (g.y + u.y) / 2
1019
- }, y = {
1019
+ }, f = {
1020
1020
  x: c.x + this.params.curvature * this.params.sourceDirection.x,
1021
1021
  y: c.y + this.params.curvature * this.params.sourceDirection.y
1022
1022
  }, E = {
@@ -1032,27 +1032,27 @@ class tt {
1032
1032
  this.path = [
1033
1033
  `M ${t.x} ${t.y}`,
1034
1034
  `L ${c.x} ${c.y}`,
1035
- `C ${y.x} ${y.y} ${S.x} ${S.y} ${w.x} ${w.y}`,
1035
+ `C ${f.x} ${f.y} ${S.x} ${S.y} ${p.x} ${p.y}`,
1036
1036
  `C ${b.x} ${b.y} ${E.x} ${E.y} ${l.x} ${l.y}`,
1037
1037
  `L ${s.x} ${s.y}`
1038
- ].join(" "), this.midpoint = W(w, e.flipX, e.flipY, e.to);
1038
+ ].join(" "), this.midpoint = z(p, e.flipX, e.flipY, e.to);
1039
1039
  }
1040
1040
  }
1041
- const Q = Object.freeze({
1041
+ const Z = Object.freeze({
1042
1042
  edgeColor: "--edge-color"
1043
- }), Pe = (r) => {
1043
+ }), Ce = (r) => {
1044
1044
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1045
- return e.style.pointerEvents = "none", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.overflow = "visible", e.style.setProperty(Q.edgeColor, r), e;
1046
- }, Ne = (r) => {
1045
+ return e.style.pointerEvents = "none", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.overflow = "visible", e.style.setProperty(Z.edgeColor, r), e;
1046
+ }, Te = (r) => {
1047
1047
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
1048
- return e.setAttribute("stroke", `var(${Q.edgeColor})`), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e;
1049
- }, B = () => {
1048
+ return e.setAttribute("stroke", `var(${Z.edgeColor})`), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e;
1049
+ }, O = () => {
1050
1050
  const r = document.createElementNS("http://www.w3.org/2000/svg", "path");
1051
- return r.setAttribute("fill", `var(${Q.edgeColor})`), r;
1052
- }, Te = () => {
1051
+ return r.setAttribute("fill", `var(${Z.edgeColor})`), r;
1052
+ }, De = () => {
1053
1053
  const r = document.createElementNS("http://www.w3.org/2000/svg", "g");
1054
1054
  return r.style.transformOrigin = "50% 50%", r;
1055
- }, Ce = (r, e) => {
1055
+ }, Me = (r, e) => {
1056
1056
  r.style.transform = `translate(${e.x}px, ${e.y}px)`, r.style.width = `${Math.max(e.width, 1)}px`, r.style.height = `${Math.max(e.height, 1)}px`;
1057
1057
  }, D = (r, e) => {
1058
1058
  const t = [];
@@ -1061,20 +1061,20 @@ const Q = Object.freeze({
1061
1061
  let i = 0, n = 0, a = 0;
1062
1062
  r.forEach((h, d) => {
1063
1063
  let c = 0, g = 0, l = 0;
1064
- const u = d > 0, w = d < s, y = u && w;
1065
- if (u && (c = -i, g = -n, l = a), w) {
1064
+ const u = d > 0, p = d < s, f = u && p;
1065
+ if (u && (c = -i, g = -n, l = a), p) {
1066
1066
  const V = r[d + 1];
1067
1067
  i = V.x - h.x, n = V.y - h.y, a = Math.sqrt(i * i + n * n);
1068
1068
  }
1069
- const S = a !== 0 ? Math.min((y ? e : 0) / a, d < s - 1 ? 0.5 : 1) : 0, b = y ? { x: h.x + i * S, y: h.y + n * S } : h, P = l !== 0 ? Math.min((y ? e : 0) / l, d > 1 ? 0.5 : 1) : 0, R = y ? { x: h.x + c * P, y: h.y + g * P } : h;
1070
- d > 0 && t.push(`L ${R.x} ${R.y}`), y && t.push(
1069
+ const S = a !== 0 ? Math.min((f ? e : 0) / a, d < s - 1 ? 0.5 : 1) : 0, b = f ? { x: h.x + i * S, y: h.y + n * S } : h, P = l !== 0 ? Math.min((f ? e : 0) / l, d > 1 ? 0.5 : 1) : 0, L = f ? { x: h.x + c * P, y: h.y + g * P } : h;
1070
+ d > 0 && t.push(`L ${L.x} ${L.y}`), f && t.push(
1071
1071
  `C ${h.x} ${h.y} ${h.x} ${h.y} ${b.x} ${b.y}`
1072
1072
  );
1073
1073
  });
1074
1074
  }
1075
1075
  return t.join(" ");
1076
1076
  };
1077
- class rt {
1077
+ class ot {
1078
1078
  constructor(e) {
1079
1079
  o(this, "path");
1080
1080
  o(this, "midpoint");
@@ -1082,10 +1082,10 @@ class rt {
1082
1082
  const t = this.params.to;
1083
1083
  this.midpoint = { x: t.x / 2, y: t.y / 2 };
1084
1084
  const s = this.params.hasSourceArrow ? m(
1085
- { x: this.params.arrowLength, y: p.y },
1085
+ { x: this.params.arrowLength, y: w.y },
1086
1086
  this.params.sourceDirection,
1087
- p
1088
- ) : p, i = this.params.hasTargetArrow ? m(
1087
+ w
1088
+ ) : w, i = this.params.hasTargetArrow ? m(
1089
1089
  {
1090
1090
  x: this.params.to.x - this.params.arrowLength,
1091
1091
  y: this.params.to.y
@@ -1093,9 +1093,9 @@ class rt {
1093
1093
  this.params.targetDirection,
1094
1094
  this.params.to
1095
1095
  ) : this.params.to, n = this.params.arrowLength + this.params.arrowOffset, a = n - this.params.roundness, h = m(
1096
- { x: a, y: p.y },
1096
+ { x: a, y: w.y },
1097
1097
  this.params.sourceDirection,
1098
- p
1098
+ w
1099
1099
  ), d = m(
1100
1100
  { x: this.params.to.x - a, y: this.params.to.y },
1101
1101
  this.params.targetDirection,
@@ -1103,26 +1103,26 @@ class rt {
1103
1103
  ), c = Math.max((h.x + d.x) / 2, n), g = this.params.to.y / 2, l = {
1104
1104
  x: this.params.flipX > 0 ? c : -n,
1105
1105
  y: h.y
1106
- }, u = { x: l.x, y: g }, w = {
1106
+ }, u = { x: l.x, y: g }, p = {
1107
1107
  x: this.params.flipX > 0 ? this.params.to.x - c : this.params.to.x + n,
1108
1108
  y: d.y
1109
- }, y = { x: w.x, y: g };
1109
+ }, f = { x: p.x, y: g };
1110
1110
  this.path = D(
1111
- [s, h, l, u, y, w, d, i],
1111
+ [s, h, l, u, f, p, d, i],
1112
1112
  this.params.roundness
1113
1113
  );
1114
1114
  }
1115
1115
  }
1116
- class st {
1116
+ class it {
1117
1117
  constructor(e) {
1118
1118
  o(this, "path");
1119
1119
  o(this, "midpoint");
1120
1120
  this.params = e;
1121
1121
  const t = this.params.hasSourceArrow ? m(
1122
- { x: this.params.arrowLength, y: p.y },
1122
+ { x: this.params.arrowLength, y: w.y },
1123
1123
  this.params.sourceDirection,
1124
- p
1125
- ) : p, s = this.params.hasTargetArrow ? m(
1124
+ w
1125
+ ) : w, s = this.params.hasTargetArrow ? m(
1126
1126
  {
1127
1127
  x: this.params.to.x - this.params.arrowLength,
1128
1128
  y: this.params.to.y
@@ -1130,21 +1130,21 @@ class st {
1130
1130
  this.params.targetDirection,
1131
1131
  this.params.to
1132
1132
  ) : this.params.to, i = this.params.arrowLength + this.params.arrowOffset, n = m(
1133
- { x: i, y: p.y },
1133
+ { x: i, y: w.y },
1134
1134
  this.params.sourceDirection,
1135
- p
1135
+ w
1136
1136
  ), a = Math.cos(this.params.detourDirection) * this.params.detourDistance, h = Math.sin(this.params.detourDirection) * this.params.detourDistance, d = a * this.params.flipX, c = h * this.params.flipY, g = { x: n.x + d, y: n.y + c }, l = m(
1137
1137
  { x: this.params.to.x - i, y: this.params.to.y },
1138
1138
  this.params.targetDirection,
1139
1139
  this.params.to
1140
- ), u = { x: l.x + d, y: l.y + c }, w = { x: (g.x + u.x) / 2, y: (g.y + u.y) / 2 };
1141
- this.midpoint = W(w, e.flipX, e.flipY, e.to), this.path = D(
1140
+ ), u = { x: l.x + d, y: l.y + c }, p = { x: (g.x + u.x) / 2, y: (g.y + u.y) / 2 };
1141
+ this.midpoint = z(p, e.flipX, e.flipY, e.to), this.path = D(
1142
1142
  [t, n, g, u, l, s],
1143
1143
  this.params.roundness
1144
1144
  );
1145
1145
  }
1146
1146
  }
1147
- class ot {
1147
+ class nt {
1148
1148
  constructor(e) {
1149
1149
  o(this, "path");
1150
1150
  o(this, "midpoint");
@@ -1152,10 +1152,10 @@ class ot {
1152
1152
  const t = this.params.to;
1153
1153
  this.midpoint = { x: t.x / 2, y: t.y / 2 };
1154
1154
  const s = this.params.hasSourceArrow ? m(
1155
- { x: this.params.arrowLength, y: p.y },
1155
+ { x: this.params.arrowLength, y: w.y },
1156
1156
  this.params.sourceDirection,
1157
- p
1158
- ) : p, i = this.params.hasTargetArrow ? m(
1157
+ w
1158
+ ) : w, i = this.params.hasTargetArrow ? m(
1159
1159
  {
1160
1160
  x: this.params.to.x - this.params.arrowLength,
1161
1161
  y: this.params.to.y
@@ -1163,9 +1163,9 @@ class ot {
1163
1163
  this.params.targetDirection,
1164
1164
  this.params.to
1165
1165
  ) : this.params.to, n = this.params.arrowLength + this.params.arrowOffset, a = m(
1166
- { x: n, y: p.y },
1166
+ { x: n, y: w.y },
1167
1167
  this.params.sourceDirection,
1168
- p
1168
+ w
1169
1169
  ), h = m(
1170
1170
  { x: this.params.to.x - n, y: this.params.to.y },
1171
1171
  this.params.targetDirection,
@@ -1174,7 +1174,7 @@ class ot {
1174
1174
  this.path = D([s, a, h, i], this.params.roundness);
1175
1175
  }
1176
1176
  }
1177
- class it {
1177
+ class at {
1178
1178
  constructor(e) {
1179
1179
  o(this, "path");
1180
1180
  o(this, "midpoint");
@@ -1182,10 +1182,10 @@ class it {
1182
1182
  const t = this.params.to;
1183
1183
  this.midpoint = { x: t.x / 2, y: t.y / 2 };
1184
1184
  const s = this.params.hasSourceArrow ? m(
1185
- { x: this.params.arrowLength, y: p.y },
1185
+ { x: this.params.arrowLength, y: w.y },
1186
1186
  this.params.sourceDirection,
1187
- p
1188
- ) : p, i = this.params.hasTargetArrow ? m(
1187
+ w
1188
+ ) : w, i = this.params.hasTargetArrow ? m(
1189
1189
  {
1190
1190
  x: this.params.to.x - this.params.arrowLength,
1191
1191
  y: this.params.to.y
@@ -1193,9 +1193,9 @@ class it {
1193
1193
  this.params.targetDirection,
1194
1194
  this.params.to
1195
1195
  ) : this.params.to, n = this.params.arrowLength + this.params.arrowOffset, a = n - this.params.roundness, h = m(
1196
- { x: a, y: p.y },
1196
+ { x: a, y: w.y },
1197
1197
  this.params.sourceDirection,
1198
- p
1198
+ w
1199
1199
  ), d = m(
1200
1200
  { x: this.params.to.x - a, y: this.params.to.y },
1201
1201
  this.params.targetDirection,
@@ -1203,58 +1203,58 @@ class it {
1203
1203
  ), c = Math.max((h.y + d.y) / 2, n), g = this.params.to.x / 2, l = {
1204
1204
  x: h.x,
1205
1205
  y: this.params.flipY > 0 ? c : -n
1206
- }, u = { x: g, y: l.y }, w = {
1206
+ }, u = { x: g, y: l.y }, p = {
1207
1207
  x: d.x,
1208
1208
  y: this.params.flipY > 0 ? this.params.to.y - c : this.params.to.y + n
1209
- }, y = { x: g, y: w.y };
1209
+ }, f = { x: g, y: p.y };
1210
1210
  this.path = D(
1211
- [s, h, l, u, y, w, d, i],
1211
+ [s, h, l, u, f, p, d, i],
1212
1212
  this.params.roundness
1213
1213
  );
1214
1214
  }
1215
1215
  }
1216
- class Z {
1216
+ class J {
1217
1217
  constructor(e) {
1218
1218
  o(this, "path");
1219
1219
  o(this, "midpoint");
1220
1220
  this.params = e;
1221
1221
  const t = this.params.arrowOffset, s = this.params.side, i = this.params.arrowLength + t, n = i + 2 * s, h = [
1222
- { x: this.params.arrowLength, y: p.y },
1223
- { x: i, y: p.y },
1222
+ { x: this.params.arrowLength, y: w.y },
1223
+ { x: i, y: w.y },
1224
1224
  { x: i, y: this.params.side },
1225
1225
  { x: n, y: this.params.side },
1226
1226
  { x: n, y: -this.params.side },
1227
1227
  { x: i, y: -this.params.side },
1228
- { x: i, y: p.y },
1229
- { x: this.params.arrowLength, y: p.y }
1228
+ { x: i, y: w.y },
1229
+ { x: this.params.arrowLength, y: w.y }
1230
1230
  ].map(
1231
- (c) => m(c, this.params.sourceDirection, p)
1232
- ), d = `M ${p.x} ${p.y} L ${h[0].x} ${h[0].y} `;
1231
+ (c) => m(c, this.params.sourceDirection, w)
1232
+ ), d = `M ${w.x} ${w.y} L ${h[0].x} ${h[0].y} `;
1233
1233
  this.path = `${this.params.hasSourceArrow || this.params.hasTargetArrow ? "" : d}${D(h, this.params.roundness)}`, this.midpoint = { x: (h[3].x + h[4].x) / 2, y: (h[3].y + h[4].y) / 2 };
1234
1234
  }
1235
1235
  }
1236
- class nt {
1236
+ class ht {
1237
1237
  constructor(e) {
1238
1238
  o(this, "path");
1239
1239
  o(this, "midpoint");
1240
1240
  this.params = e;
1241
1241
  const t = this.params.smallRadius, s = this.params.radius, i = t + s, n = t * s / i, a = Math.sqrt(i * i - t * t), h = a * t / i, d = a + s + this.params.arrowLength, c = this.params.arrowLength + h, l = [
1242
- { x: this.params.arrowLength, y: p.y },
1242
+ { x: this.params.arrowLength, y: w.y },
1243
1243
  { x: c, y: n },
1244
1244
  { x: c, y: -n },
1245
1245
  { x: d, y: 0 }
1246
1246
  ].map(
1247
- (y) => m(y, this.params.sourceDirection, p)
1247
+ (f) => m(f, this.params.sourceDirection, w)
1248
1248
  ), u = [
1249
1249
  `M ${l[0].x} ${l[0].y}`,
1250
1250
  `A ${t} ${t} 0 0 1 ${l[1].x} ${l[1].y}`,
1251
1251
  `A ${s} ${s} 0 1 0 ${l[2].x} ${l[2].y}`,
1252
1252
  `A ${t} ${t} 0 0 1 ${l[0].x} ${l[0].y}`
1253
- ].join(" "), w = `M 0 0 L ${l[0].x} ${l[0].y} `;
1254
- this.path = `${this.params.hasSourceArrow || this.params.hasTargetArrow ? "" : w}${u}`, this.midpoint = l[3];
1253
+ ].join(" "), p = `M 0 0 L ${l[0].x} ${l[0].y} `;
1254
+ this.path = `${this.params.hasSourceArrow || this.params.hasTargetArrow ? "" : p}${u}`, this.midpoint = l[3];
1255
1255
  }
1256
1256
  }
1257
- class at {
1257
+ class dt {
1258
1258
  constructor(e) {
1259
1259
  o(this, "path");
1260
1260
  o(this, "midpoint");
@@ -1273,7 +1273,7 @@ class at {
1273
1273
  offset: this.params.sourceOffset,
1274
1274
  hasArrow: this.params.hasSourceArrow,
1275
1275
  flip: 1,
1276
- shift: p
1276
+ shift: w
1277
1277
  }), n = this.createDirectLinePoint({
1278
1278
  offset: this.params.targetOffset,
1279
1279
  hasArrow: this.params.hasTargetArrow,
@@ -1290,16 +1290,16 @@ class at {
1290
1290
  };
1291
1291
  }
1292
1292
  }
1293
- class ht {
1293
+ class ct {
1294
1294
  constructor(e) {
1295
1295
  o(this, "path");
1296
1296
  o(this, "midpoint");
1297
1297
  this.params = e;
1298
1298
  const t = this.params.hasSourceArrow ? m(
1299
- { x: this.params.arrowLength, y: p.y },
1299
+ { x: this.params.arrowLength, y: w.y },
1300
1300
  this.params.sourceDirection,
1301
- p
1302
- ) : p, s = this.params.hasTargetArrow ? m(
1301
+ w
1302
+ ) : w, s = this.params.hasTargetArrow ? m(
1303
1303
  {
1304
1304
  x: this.params.to.x - this.params.arrowLength,
1305
1305
  y: this.params.to.y
@@ -1307,9 +1307,9 @@ class ht {
1307
1307
  this.params.targetDirection,
1308
1308
  this.params.to
1309
1309
  ) : this.params.to, i = this.params.arrowLength + this.params.arrowOffset, n = m(
1310
- { x: i, y: p.y },
1310
+ { x: i, y: w.y },
1311
1311
  this.params.sourceDirection,
1312
- p
1312
+ w
1313
1313
  ), a = m(
1314
1314
  { x: this.params.to.x - i, y: this.params.to.y },
1315
1315
  this.params.targetDirection,
@@ -1318,7 +1318,7 @@ class ht {
1318
1318
  x: (n.x + a.x) / 2,
1319
1319
  y: g
1320
1320
  };
1321
- this.midpoint = W(l, e.flipX, e.flipY, e.to), this.path = D(
1321
+ this.midpoint = z(l, e.flipX, e.flipY, e.to), this.path = D(
1322
1322
  [
1323
1323
  t,
1324
1324
  n,
@@ -1331,16 +1331,16 @@ class ht {
1331
1331
  );
1332
1332
  }
1333
1333
  }
1334
- class dt {
1334
+ class lt {
1335
1335
  constructor(e) {
1336
1336
  o(this, "path");
1337
1337
  o(this, "midpoint");
1338
1338
  this.params = e;
1339
1339
  const t = this.params.hasSourceArrow ? m(
1340
- { x: this.params.arrowLength, y: p.y },
1340
+ { x: this.params.arrowLength, y: w.y },
1341
1341
  this.params.sourceDirection,
1342
- p
1343
- ) : p, s = this.params.hasTargetArrow ? m(
1342
+ w
1343
+ ) : w, s = this.params.hasTargetArrow ? m(
1344
1344
  {
1345
1345
  x: this.params.to.x - this.params.arrowLength,
1346
1346
  y: this.params.to.y
@@ -1348,9 +1348,9 @@ class dt {
1348
1348
  this.params.targetDirection,
1349
1349
  this.params.to
1350
1350
  ) : this.params.to, i = this.params.arrowLength + this.params.arrowOffset, n = m(
1351
- { x: i, y: p.y },
1351
+ { x: i, y: w.y },
1352
1352
  this.params.sourceDirection,
1353
- p
1353
+ w
1354
1354
  ), a = m(
1355
1355
  { x: this.params.to.x - i, y: this.params.to.y },
1356
1356
  this.params.targetDirection,
@@ -1359,7 +1359,7 @@ class dt {
1359
1359
  x: g,
1360
1360
  y: (n.y + a.y) / 2
1361
1361
  };
1362
- this.midpoint = W(l, e.flipX, e.flipY, e.to), this.path = D(
1362
+ this.midpoint = z(l, e.flipX, e.flipY, e.to), this.path = D(
1363
1363
  [
1364
1364
  t,
1365
1365
  n,
@@ -1372,7 +1372,7 @@ class dt {
1372
1372
  );
1373
1373
  }
1374
1374
  }
1375
- const f = Object.freeze({
1375
+ const y = Object.freeze({
1376
1376
  color: "#777777",
1377
1377
  width: 1,
1378
1378
  arrowLength: 20,
@@ -1394,30 +1394,30 @@ const f = Object.freeze({
1394
1394
  curvature: 90,
1395
1395
  interactiveWidth: 10,
1396
1396
  preOffset: 0
1397
- }), ge = (r, e, t) => ({ x: e * Math.cos(r), y: t * Math.sin(r) });
1398
- class z {
1397
+ }), pe = (r, e, t) => ({ x: e * Math.cos(r), y: t * Math.sin(r) });
1398
+ class k {
1399
1399
  constructor(e) {
1400
1400
  o(this, "svg");
1401
- o(this, "group", Te());
1401
+ o(this, "group", De());
1402
1402
  o(this, "line");
1403
1403
  o(this, "sourceArrow", null);
1404
1404
  o(this, "targetArrow", null);
1405
1405
  o(this, "onAfterRender");
1406
1406
  o(this, "afterRenderEmitter");
1407
1407
  o(this, "arrowRenderer");
1408
- this.params = e, [this.afterRenderEmitter, this.onAfterRender] = x(), this.arrowRenderer = this.params.arrowRenderer, this.svg = Pe(e.color), this.svg.appendChild(this.group), this.line = Ne(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = B(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = B(), this.group.appendChild(this.targetArrow));
1408
+ this.params = e, [this.afterRenderEmitter, this.onAfterRender] = x(), this.arrowRenderer = this.params.arrowRenderer, this.svg = Ce(e.color), this.svg.appendChild(this.group), this.line = Te(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = O(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = O(), this.group.appendChild(this.targetArrow));
1409
1409
  }
1410
1410
  render(e) {
1411
- const { x: t, y: s, width: i, height: n, flipX: a, flipY: h } = be(
1411
+ const { x: t, y: s, width: i, height: n, flipX: a, flipY: h } = Ne(
1412
1412
  e.from,
1413
1413
  e.to
1414
1414
  );
1415
- Ce(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${a}, ${h})`;
1416
- const d = ge(
1415
+ Me(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${a}, ${h})`;
1416
+ const d = pe(
1417
1417
  e.from.direction,
1418
1418
  a,
1419
1419
  h
1420
- ), c = ge(
1420
+ ), c = pe(
1421
1421
  e.to.direction,
1422
1422
  a,
1423
1423
  h
@@ -1427,53 +1427,53 @@ class z {
1427
1427
  };
1428
1428
  let l = { x: -c.x, y: -c.y }, u;
1429
1429
  e.category === M.PortCycle ? (u = this.params.createCyclePath, l = d) : e.category === M.NodeCycle ? u = this.params.createDetourPath : u = this.params.createLinePath;
1430
- const w = u(
1430
+ const p = u(
1431
1431
  d,
1432
1432
  c,
1433
1433
  g,
1434
1434
  a,
1435
1435
  h
1436
1436
  );
1437
- this.line.setAttribute("d", w.path);
1438
- let y = null;
1439
- this.sourceArrow && (y = this.arrowRenderer({
1437
+ this.line.setAttribute("d", p.path);
1438
+ let f = null;
1439
+ this.sourceArrow && (f = this.arrowRenderer({
1440
1440
  direction: d,
1441
- shift: p,
1441
+ shift: w,
1442
1442
  arrowLength: this.params.arrowLength
1443
- }), this.sourceArrow.setAttribute("d", y));
1443
+ }), this.sourceArrow.setAttribute("d", f));
1444
1444
  let E = null;
1445
1445
  this.targetArrow && (E = this.arrowRenderer({
1446
1446
  direction: l,
1447
1447
  shift: g,
1448
1448
  arrowLength: this.params.arrowLength
1449
1449
  }), this.targetArrow.setAttribute("d", E)), this.afterRenderEmitter.emit({
1450
- edgePath: w,
1451
- sourceArrowPath: y,
1450
+ edgePath: p,
1451
+ sourceArrowPath: f,
1452
1452
  targetArrowPath: E
1453
1453
  });
1454
1454
  }
1455
1455
  }
1456
- const ct = (r) => (e) => {
1456
+ const gt = (r) => (e) => {
1457
1457
  const s = [
1458
- p,
1458
+ w,
1459
1459
  { x: e.arrowLength, y: r.radius },
1460
1460
  { x: e.arrowLength, y: -r.radius }
1461
1461
  ].map(
1462
- (h) => m(h, e.direction, p)
1462
+ (h) => m(h, e.direction, w)
1463
1463
  ).map((h) => ({
1464
1464
  x: h.x + e.shift.x,
1465
1465
  y: h.y + e.shift.y
1466
1466
  })), i = `M ${s[0].x} ${s[0].y}`, n = `L ${s[1].x} ${s[1].y}`, a = `L ${s[2].x} ${s[2].y}`;
1467
1467
  return `${i} ${n} ${a} Z`;
1468
- }, lt = (r) => (e) => {
1469
- const t = r.radius, s = e.arrowLength, i = (s * s + 2 * s * t) / (2 * t), n = i + t, a = s + t - t * (s + t) / n, h = t * i / n, c = [p, { x: a, y: -h }, { x: a, y: h }].map(
1470
- (y) => m(y, e.direction, p)
1471
- ).map((y) => ({
1472
- x: y.x + e.shift.x,
1473
- y: y.y + e.shift.y
1474
- })), g = `M ${c[0].x} ${c[0].y}`, l = `A ${i} ${i} 0 0 0 ${c[1].x} ${c[1].y}`, u = `A ${t} ${t} 0 0 0 ${c[2].x} ${c[2].y}`, w = `A ${i} ${i} 0 0 0 ${c[0].x} ${c[0].y}`;
1475
- return `${g} ${l} ${u} ${w}`;
1476
- }, gt = (r) => (e) => {
1468
+ }, ut = (r) => (e) => {
1469
+ const t = r.radius, s = e.arrowLength, i = (s * s + 2 * s * t) / (2 * t), n = i + t, a = s + t - t * (s + t) / n, h = t * i / n, c = [w, { x: a, y: -h }, { x: a, y: h }].map(
1470
+ (f) => m(f, e.direction, w)
1471
+ ).map((f) => ({
1472
+ x: f.x + e.shift.x,
1473
+ y: f.y + e.shift.y
1474
+ })), g = `M ${c[0].x} ${c[0].y}`, l = `A ${i} ${i} 0 0 0 ${c[1].x} ${c[1].y}`, u = `A ${t} ${t} 0 0 0 ${c[2].x} ${c[2].y}`, p = `A ${i} ${i} 0 0 0 ${c[0].x} ${c[0].y}`;
1475
+ return `${g} ${l} ${u} ${p}`;
1476
+ }, pt = (r) => (e) => {
1477
1477
  const t = r.smallRadius, s = r.radius, i = m(
1478
1478
  {
1479
1479
  x: e.arrowLength,
@@ -1487,34 +1487,34 @@ const ct = (r) => (e) => {
1487
1487
  x: e.arrowLength + r.smallRadius,
1488
1488
  y: 0
1489
1489
  }
1490
- ), a = [p, { x: i.x, y: -i.y }, i].map(
1491
- (l) => m(l, e.direction, p)
1490
+ ), a = [w, { x: i.x, y: -i.y }, i].map(
1491
+ (l) => m(l, e.direction, w)
1492
1492
  ).map((l) => ({
1493
1493
  x: l.x + e.shift.x,
1494
1494
  y: l.y + e.shift.y
1495
1495
  })), h = `M ${a[0].x} ${a[0].y}`, d = `A ${s} ${s} 0 0 1 ${a[1].x} ${a[1].y}`, c = `A ${t} ${t} 0 0 1 ${a[2].x} ${a[2].y}`, g = `A ${s} ${s} 0 0 1 ${a[0].x} ${a[0].y}`;
1496
1496
  return `${h} ${d} ${c} ${g}`;
1497
- }, F = (r) => {
1497
+ }, I = (r) => {
1498
1498
  if (typeof r == "function")
1499
1499
  return r;
1500
1500
  switch (r.type) {
1501
1501
  case "triangle":
1502
- return ct({
1503
- radius: r.radius ?? f.polygonArrowRadius
1502
+ return gt({
1503
+ radius: r.radius ?? y.polygonArrowRadius
1504
1504
  });
1505
1505
  case "arc":
1506
- return lt({
1507
- radius: r.radius ?? f.circleArrowRadius
1506
+ return ut({
1507
+ radius: r.radius ?? y.circleArrowRadius
1508
1508
  });
1509
1509
  default:
1510
- return gt({
1511
- smallRadius: r.smallRadius ?? f.wedgeArrowSmallRadius,
1512
- angle: r.angle ?? f.wedgeArrowAngle,
1513
- radius: r.radius ?? f.wedgeArrowRadius
1510
+ return pt({
1511
+ smallRadius: r.smallRadius ?? y.wedgeArrowSmallRadius,
1512
+ angle: r.angle ?? y.wedgeArrowAngle,
1513
+ radius: r.radius ?? y.wedgeArrowRadius
1514
1514
  });
1515
1515
  }
1516
1516
  };
1517
- class ut {
1517
+ class wt {
1518
1518
  constructor(e) {
1519
1519
  o(this, "svg");
1520
1520
  o(this, "group");
@@ -1531,7 +1531,7 @@ class ut {
1531
1531
  o(this, "hasSourceArrow");
1532
1532
  o(this, "hasTargetArrow");
1533
1533
  o(this, "pathShape");
1534
- o(this, "createCyclePath", (e) => new nt({
1534
+ o(this, "createCyclePath", (e) => new ht({
1535
1535
  sourceDirection: e,
1536
1536
  radius: this.portCycleRadius,
1537
1537
  smallRadius: this.portCycleSmallRadius,
@@ -1539,7 +1539,7 @@ class ut {
1539
1539
  hasSourceArrow: this.hasSourceArrow,
1540
1540
  hasTargetArrow: this.hasTargetArrow
1541
1541
  }));
1542
- o(this, "createDetourPath", (e, t, s, i, n) => new tt({
1542
+ o(this, "createDetourPath", (e, t, s, i, n) => new st({
1543
1543
  to: s,
1544
1544
  sourceDirection: e,
1545
1545
  targetDirection: t,
@@ -1552,7 +1552,7 @@ class ut {
1552
1552
  hasSourceArrow: this.hasSourceArrow,
1553
1553
  hasTargetArrow: this.hasTargetArrow
1554
1554
  }));
1555
- o(this, "createLinePath", (e, t, s) => new et({
1555
+ o(this, "createLinePath", (e, t, s) => new rt({
1556
1556
  to: s,
1557
1557
  sourceDirection: e,
1558
1558
  targetDirection: t,
@@ -1561,10 +1561,10 @@ class ut {
1561
1561
  hasSourceArrow: this.hasSourceArrow,
1562
1562
  hasTargetArrow: this.hasTargetArrow
1563
1563
  }));
1564
- this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? f.arrowLength, this.curvature = (e == null ? void 0 : e.curvature) ?? f.curvature, this.portCycleRadius = (e == null ? void 0 : e.cycleRadius) ?? f.cycleRadius, this.portCycleSmallRadius = (e == null ? void 0 : e.smallCycleRadius) ?? f.smallCycleRadius, this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? f.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? f.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? f.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? f.hasTargetArrow, this.pathShape = new z({
1565
- color: (e == null ? void 0 : e.color) ?? f.color,
1566
- width: (e == null ? void 0 : e.width) ?? f.width,
1567
- arrowRenderer: F((e == null ? void 0 : e.arrowRenderer) ?? {}),
1564
+ this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? y.arrowLength, this.curvature = (e == null ? void 0 : e.curvature) ?? y.curvature, this.portCycleRadius = (e == null ? void 0 : e.cycleRadius) ?? y.cycleRadius, this.portCycleSmallRadius = (e == null ? void 0 : e.smallCycleRadius) ?? y.smallCycleRadius, this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? y.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? y.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? y.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? y.hasTargetArrow, this.pathShape = new k({
1565
+ color: (e == null ? void 0 : e.color) ?? y.color,
1566
+ width: (e == null ? void 0 : e.width) ?? y.width,
1567
+ arrowRenderer: I((e == null ? void 0 : e.arrowRenderer) ?? {}),
1568
1568
  arrowLength: this.arrowLength,
1569
1569
  hasSourceArrow: this.hasSourceArrow,
1570
1570
  hasTargetArrow: this.hasTargetArrow,
@@ -1577,7 +1577,7 @@ class ut {
1577
1577
  this.pathShape.render(e);
1578
1578
  }
1579
1579
  }
1580
- class pt {
1580
+ class ft {
1581
1581
  constructor(e) {
1582
1582
  o(this, "svg");
1583
1583
  o(this, "group");
@@ -1593,7 +1593,7 @@ class pt {
1593
1593
  o(this, "hasSourceArrow");
1594
1594
  o(this, "hasTargetArrow");
1595
1595
  o(this, "pathShape");
1596
- o(this, "createCyclePath", (e) => new Z({
1596
+ o(this, "createCyclePath", (e) => new J({
1597
1597
  sourceDirection: e,
1598
1598
  arrowLength: this.arrowLength,
1599
1599
  side: this.cycleSquareSide,
@@ -1602,7 +1602,7 @@ class pt {
1602
1602
  hasSourceArrow: this.hasSourceArrow,
1603
1603
  hasTargetArrow: this.hasTargetArrow
1604
1604
  }));
1605
- o(this, "createDetourPath", (e, t, s, i, n) => new ht({
1605
+ o(this, "createDetourPath", (e, t, s, i, n) => new ct({
1606
1606
  to: s,
1607
1607
  sourceDirection: e,
1608
1608
  targetDirection: t,
@@ -1615,7 +1615,7 @@ class pt {
1615
1615
  hasSourceArrow: this.hasSourceArrow,
1616
1616
  hasTargetArrow: this.hasTargetArrow
1617
1617
  }));
1618
- o(this, "createLinePath", (e, t, s, i) => new rt({
1618
+ o(this, "createLinePath", (e, t, s, i) => new ot({
1619
1619
  to: s,
1620
1620
  sourceDirection: e,
1621
1621
  targetDirection: t,
@@ -1626,16 +1626,16 @@ class pt {
1626
1626
  hasSourceArrow: this.hasSourceArrow,
1627
1627
  hasTargetArrow: this.hasTargetArrow
1628
1628
  }));
1629
- this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? f.arrowLength, this.arrowOffset = (e == null ? void 0 : e.arrowOffset) ?? f.arrowOffset, this.cycleSquareSide = (e == null ? void 0 : e.cycleSquareSide) ?? f.cycleSquareSide;
1630
- const t = (e == null ? void 0 : e.roundness) ?? f.roundness;
1629
+ this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? y.arrowLength, this.arrowOffset = (e == null ? void 0 : e.arrowOffset) ?? y.arrowOffset, this.cycleSquareSide = (e == null ? void 0 : e.cycleSquareSide) ?? y.cycleSquareSide;
1630
+ const t = (e == null ? void 0 : e.roundness) ?? y.roundness;
1631
1631
  this.roundness = Math.min(
1632
1632
  t,
1633
1633
  this.arrowOffset,
1634
1634
  this.cycleSquareSide / 2
1635
- ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? f.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? f.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? f.hasTargetArrow, this.pathShape = new z({
1636
- color: (e == null ? void 0 : e.color) ?? f.color,
1637
- width: (e == null ? void 0 : e.width) ?? f.width,
1638
- arrowRenderer: F((e == null ? void 0 : e.arrowRenderer) ?? {}),
1635
+ ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? y.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? y.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? y.hasTargetArrow, this.pathShape = new k({
1636
+ color: (e == null ? void 0 : e.color) ?? y.color,
1637
+ width: (e == null ? void 0 : e.width) ?? y.width,
1638
+ arrowRenderer: I((e == null ? void 0 : e.arrowRenderer) ?? {}),
1639
1639
  arrowLength: this.arrowLength,
1640
1640
  hasSourceArrow: this.hasSourceArrow,
1641
1641
  hasTargetArrow: this.hasTargetArrow,
@@ -1648,7 +1648,7 @@ class pt {
1648
1648
  this.pathShape.render(e);
1649
1649
  }
1650
1650
  }
1651
- class wt {
1651
+ class yt {
1652
1652
  constructor(e) {
1653
1653
  o(this, "svg");
1654
1654
  o(this, "group");
@@ -1665,7 +1665,7 @@ class wt {
1665
1665
  o(this, "hasSourceArrow");
1666
1666
  o(this, "hasTargetArrow");
1667
1667
  o(this, "pathShape");
1668
- o(this, "createCyclePath", (e) => new Z({
1668
+ o(this, "createCyclePath", (e) => new J({
1669
1669
  sourceDirection: e,
1670
1670
  arrowLength: this.arrowLength,
1671
1671
  side: this.cycleSquareSide,
@@ -1674,7 +1674,7 @@ class wt {
1674
1674
  hasSourceArrow: this.hasSourceArrow,
1675
1675
  hasTargetArrow: this.hasTargetArrow
1676
1676
  }));
1677
- o(this, "createDetourPath", (e, t, s, i, n) => new st({
1677
+ o(this, "createDetourPath", (e, t, s, i, n) => new it({
1678
1678
  to: s,
1679
1679
  sourceDirection: e,
1680
1680
  targetDirection: t,
@@ -1688,7 +1688,7 @@ class wt {
1688
1688
  hasSourceArrow: this.hasSourceArrow,
1689
1689
  hasTargetArrow: this.hasTargetArrow
1690
1690
  }));
1691
- o(this, "createLinePath", (e, t, s) => new ot({
1691
+ o(this, "createLinePath", (e, t, s) => new nt({
1692
1692
  to: s,
1693
1693
  sourceDirection: e,
1694
1694
  targetDirection: t,
@@ -1698,16 +1698,16 @@ class wt {
1698
1698
  hasSourceArrow: this.hasSourceArrow,
1699
1699
  hasTargetArrow: this.hasTargetArrow
1700
1700
  }));
1701
- this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? f.arrowLength, this.arrowOffset = (e == null ? void 0 : e.arrowOffset) ?? f.arrowOffset, this.cycleSquareSide = (e == null ? void 0 : e.cycleSquareSide) ?? f.cycleSquareSide;
1702
- const t = (e == null ? void 0 : e.roundness) ?? f.roundness;
1701
+ this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? y.arrowLength, this.arrowOffset = (e == null ? void 0 : e.arrowOffset) ?? y.arrowOffset, this.cycleSquareSide = (e == null ? void 0 : e.cycleSquareSide) ?? y.cycleSquareSide;
1702
+ const t = (e == null ? void 0 : e.roundness) ?? y.roundness;
1703
1703
  this.roundness = Math.min(
1704
1704
  t,
1705
1705
  this.arrowOffset,
1706
1706
  this.cycleSquareSide / 2
1707
- ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? f.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? f.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? f.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? f.hasTargetArrow, this.pathShape = new z({
1708
- color: (e == null ? void 0 : e.color) ?? f.color,
1709
- width: (e == null ? void 0 : e.width) ?? f.width,
1710
- arrowRenderer: F((e == null ? void 0 : e.arrowRenderer) ?? {}),
1707
+ ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? y.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? y.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? y.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? y.hasTargetArrow, this.pathShape = new k({
1708
+ color: (e == null ? void 0 : e.color) ?? y.color,
1709
+ width: (e == null ? void 0 : e.width) ?? y.width,
1710
+ arrowRenderer: I((e == null ? void 0 : e.arrowRenderer) ?? {}),
1711
1711
  arrowLength: this.arrowLength,
1712
1712
  hasSourceArrow: this.hasSourceArrow,
1713
1713
  hasTargetArrow: this.hasTargetArrow,
@@ -1720,7 +1720,7 @@ class wt {
1720
1720
  this.pathShape.render(e);
1721
1721
  }
1722
1722
  }
1723
- class yt {
1723
+ class mt {
1724
1724
  constructor(e) {
1725
1725
  o(this, "svg");
1726
1726
  o(this, "group");
@@ -1736,7 +1736,7 @@ class yt {
1736
1736
  o(this, "hasSourceArrow");
1737
1737
  o(this, "hasTargetArrow");
1738
1738
  o(this, "pathShape");
1739
- o(this, "createCyclePath", (e) => new Z({
1739
+ o(this, "createCyclePath", (e) => new J({
1740
1740
  sourceDirection: e,
1741
1741
  arrowLength: this.arrowLength,
1742
1742
  side: this.cycleSquareSide,
@@ -1745,7 +1745,7 @@ class yt {
1745
1745
  hasSourceArrow: this.hasSourceArrow,
1746
1746
  hasTargetArrow: this.hasTargetArrow
1747
1747
  }));
1748
- o(this, "createDetourPath", (e, t, s, i, n) => new dt({
1748
+ o(this, "createDetourPath", (e, t, s, i, n) => new lt({
1749
1749
  to: s,
1750
1750
  sourceDirection: e,
1751
1751
  targetDirection: t,
@@ -1758,7 +1758,7 @@ class yt {
1758
1758
  hasSourceArrow: this.hasSourceArrow,
1759
1759
  hasTargetArrow: this.hasTargetArrow
1760
1760
  }));
1761
- o(this, "createLinePath", (e, t, s, i, n) => new it({
1761
+ o(this, "createLinePath", (e, t, s, i, n) => new at({
1762
1762
  to: s,
1763
1763
  sourceDirection: e,
1764
1764
  targetDirection: t,
@@ -1769,16 +1769,16 @@ class yt {
1769
1769
  hasSourceArrow: this.hasSourceArrow,
1770
1770
  hasTargetArrow: this.hasTargetArrow
1771
1771
  }));
1772
- this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? f.arrowLength, this.arrowOffset = (e == null ? void 0 : e.arrowOffset) ?? f.arrowOffset, this.cycleSquareSide = (e == null ? void 0 : e.cycleSquareSide) ?? f.cycleSquareSide;
1773
- const t = (e == null ? void 0 : e.roundness) ?? f.roundness;
1772
+ this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? y.arrowLength, this.arrowOffset = (e == null ? void 0 : e.arrowOffset) ?? y.arrowOffset, this.cycleSquareSide = (e == null ? void 0 : e.cycleSquareSide) ?? y.cycleSquareSide;
1773
+ const t = (e == null ? void 0 : e.roundness) ?? y.roundness;
1774
1774
  this.roundness = Math.min(
1775
1775
  t,
1776
1776
  this.arrowOffset,
1777
1777
  this.cycleSquareSide / 2
1778
- ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? f.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? f.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? f.hasTargetArrow, this.pathShape = new z({
1779
- color: (e == null ? void 0 : e.color) ?? f.color,
1780
- width: (e == null ? void 0 : e.width) ?? f.width,
1781
- arrowRenderer: F((e == null ? void 0 : e.arrowRenderer) ?? {}),
1778
+ ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? y.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? y.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? y.hasTargetArrow, this.pathShape = new k({
1779
+ color: (e == null ? void 0 : e.color) ?? y.color,
1780
+ width: (e == null ? void 0 : e.width) ?? y.width,
1781
+ arrowRenderer: I((e == null ? void 0 : e.arrowRenderer) ?? {}),
1782
1782
  arrowLength: this.arrowLength,
1783
1783
  hasSourceArrow: this.hasSourceArrow,
1784
1784
  hasTargetArrow: this.hasTargetArrow,
@@ -1791,10 +1791,10 @@ class yt {
1791
1791
  this.pathShape.render(e);
1792
1792
  }
1793
1793
  }
1794
- class De {
1794
+ class Re {
1795
1795
  constructor(e) {
1796
1796
  o(this, "svg");
1797
- o(this, "group", Te());
1797
+ o(this, "group", De());
1798
1798
  o(this, "line");
1799
1799
  o(this, "sourceArrow", null);
1800
1800
  o(this, "targetArrow", null);
@@ -1806,15 +1806,15 @@ class De {
1806
1806
  o(this, "onAfterRender");
1807
1807
  o(this, "afterRenderEmitter");
1808
1808
  o(this, "arrowRenderer");
1809
- [this.afterRenderEmitter, this.onAfterRender] = x(), this.color = (e == null ? void 0 : e.color) ?? f.color, this.width = (e == null ? void 0 : e.width) ?? f.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? f.arrowLength, this.arrowRenderer = F((e == null ? void 0 : e.arrowRenderer) ?? {}), this.sourceOffset = (e == null ? void 0 : e.sourceOffset) ?? f.preOffset, this.targetOffset = (e == null ? void 0 : e.targetOffset) ?? f.preOffset, this.svg = Pe(this.color), this.svg.appendChild(this.group), this.line = Ne(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = B(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = B(), this.group.appendChild(this.targetArrow));
1809
+ [this.afterRenderEmitter, this.onAfterRender] = x(), this.color = (e == null ? void 0 : e.color) ?? y.color, this.width = (e == null ? void 0 : e.width) ?? y.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? y.arrowLength, this.arrowRenderer = I((e == null ? void 0 : e.arrowRenderer) ?? {}), this.sourceOffset = (e == null ? void 0 : e.sourceOffset) ?? y.preOffset, this.targetOffset = (e == null ? void 0 : e.targetOffset) ?? y.preOffset, this.svg = Ce(this.color), this.svg.appendChild(this.group), this.line = Te(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = O(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = O(), this.group.appendChild(this.targetArrow));
1810
1810
  }
1811
1811
  render(e) {
1812
- const { x: t, y: s, width: i, height: n, flipX: a, flipY: h } = be(
1812
+ const { x: t, y: s, width: i, height: n, flipX: a, flipY: h } = Ne(
1813
1813
  e.from,
1814
1814
  e.to
1815
1815
  );
1816
- Ce(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${a}, ${h})`;
1817
- const d = { x: i, y: n }, c = new at({
1816
+ Me(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${a}, ${h})`;
1817
+ const d = { x: i, y: n }, c = new dt({
1818
1818
  to: d,
1819
1819
  sourceOffset: this.sourceOffset,
1820
1820
  targetOffset: this.targetOffset,
@@ -1828,31 +1828,31 @@ class De {
1828
1828
  if (u === 0)
1829
1829
  this.sourceArrow !== null && (g = "", this.sourceArrow.setAttribute("d", g)), this.targetArrow !== null && (l = "", this.targetArrow.setAttribute("d", l));
1830
1830
  else {
1831
- const w = {
1831
+ const p = {
1832
1832
  x: d.x / u,
1833
1833
  y: d.y / u
1834
1834
  };
1835
1835
  if (this.sourceArrow) {
1836
- const y = {
1837
- x: w.x * this.sourceOffset,
1838
- y: w.y * this.sourceOffset
1836
+ const f = {
1837
+ x: p.x * this.sourceOffset,
1838
+ y: p.y * this.sourceOffset
1839
1839
  };
1840
1840
  g = this.arrowRenderer({
1841
- direction: w,
1842
- shift: y,
1841
+ direction: p,
1842
+ shift: f,
1843
1843
  arrowLength: this.arrowLength
1844
1844
  }), this.sourceArrow.setAttribute("d", g);
1845
1845
  }
1846
1846
  if (this.targetArrow) {
1847
- const y = {
1848
- x: w.x * this.targetOffset,
1849
- y: w.y * this.targetOffset
1847
+ const f = {
1848
+ x: p.x * this.targetOffset,
1849
+ y: p.y * this.targetOffset
1850
1850
  };
1851
1851
  l = this.arrowRenderer({
1852
- direction: { x: -w.x, y: -w.y },
1852
+ direction: { x: -p.x, y: -p.y },
1853
1853
  shift: {
1854
- x: d.x - y.x,
1855
- y: d.y - y.y
1854
+ x: d.x - f.x,
1855
+ y: d.y - f.y
1856
1856
  },
1857
1857
  arrowLength: this.arrowLength
1858
1858
  }), this.targetArrow.setAttribute("d", l);
@@ -1865,40 +1865,40 @@ class De {
1865
1865
  });
1866
1866
  }
1867
1867
  }
1868
- const ft = () => {
1868
+ const vt = () => {
1869
1869
  const r = document.createElementNS("http://www.w3.org/2000/svg", "g");
1870
1870
  return r.style.pointerEvents = "auto", r.style.cursor = "pointer", r;
1871
- }, mt = (r) => {
1871
+ }, At = (r) => {
1872
1872
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
1873
1873
  return e.setAttribute("stroke", "transparent"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e.setAttribute("stroke-linecap", "round"), e;
1874
- }, ue = (r) => {
1874
+ }, we = (r) => {
1875
1875
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
1876
1876
  return e.setAttribute("stroke-linejoin", "round"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "transparent"), e.setAttribute("stroke", "transparent"), e;
1877
1877
  };
1878
- class vt extends Error {
1878
+ class Et extends Error {
1879
1879
  constructor(e) {
1880
1880
  super(e), this.name = "InteractiveEdgeError";
1881
1881
  }
1882
1882
  }
1883
- class Me {
1883
+ class Le {
1884
1884
  constructor(e, t) {
1885
1885
  o(this, "svg");
1886
1886
  o(this, "group");
1887
1887
  o(this, "line");
1888
1888
  o(this, "sourceArrow");
1889
1889
  o(this, "targetArrow");
1890
- o(this, "handle", ft());
1890
+ o(this, "handle", vt());
1891
1891
  o(this, "onAfterRender");
1892
1892
  o(this, "interactiveLine");
1893
1893
  o(this, "interactiveSourceArrow", null);
1894
1894
  o(this, "interactiveTargetArrow", null);
1895
- if (this.baseEdge = e, e instanceof Me)
1896
- throw new vt(
1895
+ if (this.baseEdge = e, e instanceof Le)
1896
+ throw new Et(
1897
1897
  "interactive edge can be configured only once"
1898
1898
  );
1899
1899
  this.svg = this.baseEdge.svg, this.group = this.baseEdge.group, this.line = this.baseEdge.line, this.sourceArrow = this.baseEdge.sourceArrow, this.targetArrow = this.baseEdge.targetArrow, this.onAfterRender = this.baseEdge.onAfterRender;
1900
- const s = (t == null ? void 0 : t.distance) ?? f.interactiveWidth;
1901
- this.interactiveLine = mt(s), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = ue(s), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = ue(s), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((i) => {
1900
+ const s = (t == null ? void 0 : t.distance) ?? y.interactiveWidth;
1901
+ this.interactiveLine = At(s), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = we(s), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = we(s), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((i) => {
1902
1902
  this.interactiveLine.setAttribute("d", i.edgePath.path), this.interactiveSourceArrow && this.interactiveSourceArrow.setAttribute("d", i.sourceArrowPath), this.interactiveTargetArrow && this.interactiveTargetArrow.setAttribute("d", i.targetArrowPath);
1903
1903
  });
1904
1904
  }
@@ -1906,7 +1906,7 @@ class Me {
1906
1906
  this.baseEdge.render(e);
1907
1907
  }
1908
1908
  }
1909
- class dr {
1909
+ class ur {
1910
1910
  constructor(e, t) {
1911
1911
  o(this, "group");
1912
1912
  o(this, "line");
@@ -1923,7 +1923,7 @@ class dr {
1923
1923
  this.baseShape.render(e);
1924
1924
  }
1925
1925
  }
1926
- class Le {
1926
+ class Ve {
1927
1927
  constructor(e) {
1928
1928
  o(this, "onAfterNodeAdded");
1929
1929
  o(this, "onAfterNodeUpdated");
@@ -2019,7 +2019,7 @@ class Le {
2019
2019
  return this.graphStore.getNodeAdjacentEdgeIds(e);
2020
2020
  }
2021
2021
  }
2022
- class Re {
2022
+ class Fe {
2023
2023
  constructor(e) {
2024
2024
  o(this, "onBeforeUpdated");
2025
2025
  o(this, "onAfterUpdated");
@@ -2042,21 +2042,21 @@ class Re {
2042
2042
  return this.viewportStore.createViewportCoords(e);
2043
2043
  }
2044
2044
  }
2045
- const Ve = (r, e) => {
2046
- const t = new Ae(), s = new Le(t), i = new Re(e), n = new me(t, e, r), a = {
2045
+ const Ie = (r, e) => {
2046
+ const t = new xe(), s = new Ve(t), i = new Fe(e), n = new Ae(t, e, r), a = {
2047
2047
  nodes: {
2048
- centerFn: Se,
2048
+ centerFn: Pe,
2049
2049
  priorityFn: () => 0
2050
2050
  },
2051
2051
  edges: {
2052
- shapeFactory: () => new De(),
2052
+ shapeFactory: () => new Re(),
2053
2053
  priorityFn: () => 0
2054
2054
  },
2055
2055
  ports: {
2056
2056
  direction: 0
2057
2057
  }
2058
2058
  };
2059
- return new ve(
2059
+ return new Ee(
2060
2060
  s,
2061
2061
  i,
2062
2062
  t,
@@ -2065,7 +2065,7 @@ const Ve = (r, e) => {
2065
2065
  a
2066
2066
  );
2067
2067
  };
2068
- class k {
2068
+ class H {
2069
2069
  constructor(e, t, s, i) {
2070
2070
  o(this, "onAfterPortMarked", (e) => {
2071
2071
  const t = this.canvas.graph.getPort(e);
@@ -2090,7 +2090,7 @@ class k {
2090
2090
  }));
2091
2091
  });
2092
2092
  o(this, "onWindowMouseMove", (e) => {
2093
- if (!L(
2093
+ if (!R(
2094
2094
  this.window,
2095
2095
  this.element,
2096
2096
  e.clientX,
@@ -2122,7 +2122,7 @@ class k {
2122
2122
  });
2123
2123
  o(this, "onWindowTouchMove", (e) => {
2124
2124
  const t = e.touches[0];
2125
- if (!L(
2125
+ if (!R(
2126
2126
  this.window,
2127
2127
  this.element,
2128
2128
  t.clientX,
@@ -2149,7 +2149,7 @@ class k {
2149
2149
  this.canvas = e, this.element = t, this.window = s, this.params = i, this.canvas.graph.onAfterPortMarked.subscribe(this.onAfterPortMarked), this.canvas.graph.onBeforePortUnmarked.subscribe(this.onBeforePortUnmarked), this.canvas.graph.onBeforeClear.subscribe(this.onBeforeClear), this.canvas.onBeforeDestroy.subscribe(this.onBeforeDestroy);
2150
2150
  }
2151
2151
  static configure(e, t, s, i) {
2152
- new k(e, t, s, i);
2152
+ new H(e, t, s, i);
2153
2153
  }
2154
2154
  hookPortEvents(e) {
2155
2155
  e.addEventListener("mousedown", this.onPortMouseDown, {
@@ -2174,34 +2174,36 @@ class k {
2174
2174
  this.window.removeEventListener("touchmove", this.onWindowTouchMove), this.window.removeEventListener("touchend", this.onWindowTouchFinish), this.window.removeEventListener("touchcancel", this.onWindowTouchFinish);
2175
2175
  }
2176
2176
  }
2177
- class At {
2177
+ class xt {
2178
2178
  constructor(e, t, s) {
2179
2179
  this.canvas = e, this.layoutAlgorithm = t, this.params = s;
2180
2180
  }
2181
2181
  apply() {
2182
- this.layoutAlgorithm.calculateCoordinates({
2182
+ const e = this.layoutAlgorithm.calculateCoordinates({
2183
2183
  graph: this.canvas.graph,
2184
2184
  viewport: this.canvas.viewport
2185
- }).forEach((t, s) => {
2186
- this.params.staticNodeResolver(s) || this.canvas.updateNode(s, t);
2187
2185
  });
2186
+ this.params.onBeforeApplied(), e.forEach((t, s) => {
2187
+ this.params.staticNodeResolver(s) || this.canvas.updateNode(s, t);
2188
+ }), this.params.onAfterApplied();
2188
2189
  }
2189
2190
  }
2190
- class Et {
2191
+ class St {
2191
2192
  constructor(e, t, s) {
2192
2193
  this.canvas = e, this.layoutAlgorithm = t, this.params = s;
2193
2194
  }
2194
2195
  apply(e) {
2195
- this.layoutAlgorithm.calculateNextCoordinates({
2196
+ const t = this.layoutAlgorithm.calculateNextCoordinates({
2196
2197
  graph: this.canvas.graph,
2197
2198
  viewport: this.canvas.viewport,
2198
2199
  dt: e
2199
- }).forEach((s, i) => {
2200
- this.params.staticNodeResolver(i) || this.canvas.updateNode(i, s);
2201
2200
  });
2201
+ this.params.onBeforeApplied(), t.forEach((s, i) => {
2202
+ this.params.staticNodeResolver(i) || this.canvas.updateNode(i, s);
2203
+ }), this.params.onAfterApplied();
2202
2204
  }
2203
2205
  }
2204
- class q {
2206
+ class _ {
2205
2207
  constructor(e, t, s, i) {
2206
2208
  o(this, "grabbedNode", null);
2207
2209
  o(this, "maxNodePriority", 0);
@@ -2283,7 +2285,7 @@ class q {
2283
2285
  });
2284
2286
  });
2285
2287
  o(this, "onWindowMouseMove", (e) => {
2286
- if (!L(
2288
+ if (!R(
2287
2289
  this.window,
2288
2290
  this.element,
2289
2291
  e.clientX,
@@ -2304,7 +2306,7 @@ class q {
2304
2306
  if (e.touches.length !== 1)
2305
2307
  return;
2306
2308
  const t = e.touches[0];
2307
- if (!L(
2309
+ if (!R(
2308
2310
  this.window,
2309
2311
  this.element,
2310
2312
  t.clientX,
@@ -2324,7 +2326,7 @@ class q {
2324
2326
  this.canvas = e, this.element = t, this.window = s, this.params = i, this.graph = e.graph, this.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.graph.onAfterNodeUpdated.subscribe(this.onAfterNodeUpdated), this.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.graph.onBeforeClear.subscribe(this.onBeforeClear), this.canvas.onBeforeDestroy.subscribe(this.onBeforeDestroy);
2325
2327
  }
2326
2328
  static configure(e, t, s, i) {
2327
- new q(e, t, s, i);
2329
+ new _(e, t, s, i);
2328
2330
  }
2329
2331
  moveNode(e, t) {
2330
2332
  if (!this.graph.hasNode(e.nodeId))
@@ -2393,15 +2395,15 @@ class q {
2393
2395
  return e;
2394
2396
  }
2395
2397
  }
2396
- const xt = (r, e, t) => ({
2398
+ const bt = (r, e, t) => ({
2397
2399
  scale: r.scale,
2398
2400
  x: r.x + r.scale * e,
2399
2401
  y: r.y + r.scale * t
2400
- }), St = (r, e, t, s) => ({
2402
+ }), Pt = (r, e, t, s) => ({
2401
2403
  scale: r.scale * e,
2402
2404
  x: r.scale * (1 - e) * t + r.x,
2403
2405
  y: r.scale * (1 - e) * s + r.y
2404
- }), I = (r) => {
2406
+ }), B = (r) => {
2405
2407
  const e = [], t = r.touches.length;
2406
2408
  for (let h = 0; h < t; h++)
2407
2409
  e.push([r.touches[h].clientX, r.touches[h].clientY]);
@@ -2420,7 +2422,7 @@ const xt = (r, e, t) => ({
2420
2422
  touches: e
2421
2423
  };
2422
2424
  };
2423
- class H {
2425
+ class X {
2424
2426
  constructor(e, t, s, i) {
2425
2427
  o(this, "viewport");
2426
2428
  o(this, "prevTouches", null);
@@ -2430,14 +2432,14 @@ class H {
2430
2432
  this.removeMouseDragListeners(), this.removeTouchDragListeners();
2431
2433
  });
2432
2434
  o(this, "onMouseDown", (e) => {
2433
- this.element === null || !this.params.mouseDownEventVerifier(e) || ($(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
2435
+ this.params.mouseDownEventVerifier(e) && ($(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
2434
2436
  passive: !0
2435
2437
  }), this.window.addEventListener("mouseup", this.onWindowMouseUp, {
2436
2438
  passive: !0
2437
2439
  }), this.startRegisteredTransform());
2438
2440
  });
2439
2441
  o(this, "onWindowMouseMove", (e) => {
2440
- const t = L(
2442
+ const t = R(
2441
2443
  this.window,
2442
2444
  this.element,
2443
2445
  e.clientX,
@@ -2463,10 +2465,10 @@ class H {
2463
2465
  });
2464
2466
  o(this, "onTouchStart", (e) => {
2465
2467
  if (this.prevTouches !== null) {
2466
- this.prevTouches = I(e);
2468
+ this.prevTouches = B(e);
2467
2469
  return;
2468
2470
  }
2469
- this.prevTouches = I(e), this.window.addEventListener("touchmove", this.onWindowTouchMove, {
2471
+ this.prevTouches = B(e), this.window.addEventListener("touchmove", this.onWindowTouchMove, {
2470
2472
  passive: !0
2471
2473
  }), this.window.addEventListener("touchend", this.onWindowTouchFinish, {
2472
2474
  passive: !0
@@ -2475,9 +2477,9 @@ class H {
2475
2477
  }), this.startRegisteredTransform();
2476
2478
  });
2477
2479
  o(this, "onWindowTouchMove", (e) => {
2478
- const t = I(e);
2480
+ const t = B(e);
2479
2481
  if (!t.touches.every(
2480
- (i) => L(this.window, this.element, i[0], i[1])
2482
+ (i) => R(this.window, this.element, i[0], i[1])
2481
2483
  )) {
2482
2484
  this.stopTouchDrag();
2483
2485
  return;
@@ -2492,7 +2494,7 @@ class H {
2492
2494
  this.prevTouches = t;
2493
2495
  });
2494
2496
  o(this, "onWindowTouchFinish", (e) => {
2495
- e.touches.length > 0 ? this.prevTouches = I(e) : this.stopTouchDrag();
2497
+ e.touches.length > 0 ? this.prevTouches = B(e) : this.stopTouchDrag();
2496
2498
  });
2497
2499
  o(this, "preventWheelScaleListener", (e) => {
2498
2500
  e.preventDefault();
@@ -2510,10 +2512,10 @@ class H {
2510
2512
  }), e.onBeforeDestroy.subscribe(this.onBeforeDestroy);
2511
2513
  }
2512
2514
  static configure(e, t, s, i) {
2513
- new H(e, t, s, i);
2515
+ new X(e, t, s, i);
2514
2516
  }
2515
2517
  moveViewport(e, t) {
2516
- const s = this.viewport.getViewportMatrix(), i = xt(s, e, t), { width: n, height: a } = this.viewport.getDimensions(), h = this.params.transformPreprocessor({
2518
+ const s = this.viewport.getViewportMatrix(), i = bt(s, e, t), { width: n, height: a } = this.viewport.getDimensions(), h = this.params.transformPreprocessor({
2517
2519
  prevTransform: s,
2518
2520
  nextTransform: i,
2519
2521
  canvasWidth: n,
@@ -2522,7 +2524,7 @@ class H {
2522
2524
  this.performTransform(h);
2523
2525
  }
2524
2526
  scaleViewport(e, t, s) {
2525
- const i = this.canvas.viewport.getViewportMatrix(), n = St(i, e, t, s), { width: a, height: h } = this.viewport.getDimensions(), d = this.params.transformPreprocessor({
2527
+ const i = this.canvas.viewport.getViewportMatrix(), n = Pt(i, e, t, s), { width: a, height: h } = this.viewport.getDimensions(), d = this.params.transformPreprocessor({
2526
2528
  prevTransform: i,
2527
2529
  nextTransform: n,
2528
2530
  canvasWidth: a,
@@ -2561,7 +2563,7 @@ class H {
2561
2563
  this.params.onResizeTransformStarted(), this.canvas.patchViewportMatrix(i), this.params.onResizeTransformFinished();
2562
2564
  }
2563
2565
  }
2564
- class J {
2566
+ class ee {
2565
2567
  constructor(e, t, s, i, n, a) {
2566
2568
  o(this, "nodeHorizontal");
2567
2569
  o(this, "nodeVertical");
@@ -2608,7 +2610,7 @@ class J {
2608
2610
  this.scheduleLoadAreaAroundViewport(), i.onTransformFinished();
2609
2611
  }
2610
2612
  };
2611
- H.configure(
2613
+ X.configure(
2612
2614
  e,
2613
2615
  this.element,
2614
2616
  this.window,
@@ -2616,7 +2618,7 @@ class J {
2616
2618
  ), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
2617
2619
  }
2618
2620
  static configure(e, t, s, i, n, a) {
2619
- new J(
2621
+ new ee(
2620
2622
  e,
2621
2623
  t,
2622
2624
  s,
@@ -2646,24 +2648,24 @@ class J {
2646
2648
  });
2647
2649
  }
2648
2650
  }
2649
- const bt = () => {
2651
+ const Nt = () => {
2650
2652
  const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
2651
2653
  return r.style.position = "absolute", r.style.inset = "0", r;
2652
- }, Pt = () => {
2654
+ }, Ct = () => {
2653
2655
  const r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2654
2656
  return r.setAttribute("fill", "url(#pattern)"), r;
2655
- }, Nt = () => {
2657
+ }, Tt = () => {
2656
2658
  const r = document.createElementNS(
2657
2659
  "http://www.w3.org/2000/svg",
2658
2660
  "pattern"
2659
2661
  );
2660
2662
  return r.setAttribute("id", "pattern"), r;
2661
2663
  };
2662
- class _ {
2664
+ class te {
2663
2665
  constructor(e, t, s) {
2664
- o(this, "svg", bt());
2665
- o(this, "patternRenderingRectangle", Pt());
2666
- o(this, "pattern", Nt());
2666
+ o(this, "svg", Nt());
2667
+ o(this, "patternRenderingRectangle", Ct());
2668
+ o(this, "pattern", Tt());
2667
2669
  o(this, "patternContent");
2668
2670
  o(this, "tileWidth");
2669
2671
  o(this, "tileHeight");
@@ -2684,7 +2686,7 @@ class _ {
2684
2686
  }), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterTransformUpdated), this.onAfterTransformUpdated();
2685
2687
  }
2686
2688
  static configure(e, t, s) {
2687
- new _(e, t, s);
2689
+ new te(e, t, s);
2688
2690
  }
2689
2691
  updateVisibility() {
2690
2692
  const t = this.canvas.viewport.getViewportMatrix().scale > this.maxViewportScale;
@@ -2697,7 +2699,7 @@ class _ {
2697
2699
  this.pattern.setAttribute("width", `${s}`), this.pattern.setAttribute("height", `${i}`);
2698
2700
  }
2699
2701
  }
2700
- class ee {
2702
+ class re {
2701
2703
  constructor(e, t, s, i, n) {
2702
2704
  o(this, "overlayCanvas");
2703
2705
  o(this, "staticPortId", null);
@@ -2705,10 +2707,10 @@ class ee {
2705
2707
  o(this, "onEdgeCreated", (e) => {
2706
2708
  this.params.onAfterEdgeCreated(e);
2707
2709
  });
2708
- this.canvas = e, this.overlayLayer = t, this.viewportStore = s, this.window = i, this.params = n, this.overlayCanvas = Ve(
2710
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = s, this.window = i, this.params = n, this.overlayCanvas = Ie(
2709
2711
  this.overlayLayer,
2710
2712
  this.viewportStore
2711
- ), k.configure(
2713
+ ), H.configure(
2712
2714
  this.canvas,
2713
2715
  this.overlayLayer,
2714
2716
  this.window,
@@ -2732,7 +2734,7 @@ class ee {
2732
2734
  );
2733
2735
  }
2734
2736
  static configure(e, t, s, i, n) {
2735
- new ee(
2737
+ new re(
2736
2738
  e,
2737
2739
  t,
2738
2740
  s,
@@ -2759,10 +2761,10 @@ class ee {
2759
2761
  portDirection: this.params.dragPortDirection
2760
2762
  };
2761
2763
  this.isTargetDragging = s === "direct";
2762
- const [w, y] = this.isTargetDragging ? [l, u] : [u, l];
2763
- this.overlayCanvas.addNode(U(w)), this.overlayCanvas.addNode(U(y)), this.overlayCanvas.addEdge({
2764
- from: w.overlayNodeId,
2765
- to: y.overlayNodeId,
2764
+ const [p, f] = this.isTargetDragging ? [l, u] : [u, l];
2765
+ this.overlayCanvas.addNode(U(p)), this.overlayCanvas.addNode(U(f)), this.overlayCanvas.addEdge({
2766
+ from: p.overlayNodeId,
2767
+ to: f.overlayNodeId,
2766
2768
  shape: this.params.edgeShapeFactory(N.EdgeId)
2767
2769
  });
2768
2770
  }
@@ -2770,7 +2772,7 @@ class ee {
2770
2772
  this.staticPortId = null, this.isTargetDragging = !0, this.overlayCanvas.clear();
2771
2773
  }
2772
2774
  tryCreateConnection(e) {
2773
- const t = xe(this.canvas.graph, e), s = this.staticPortId;
2775
+ const t = be(this.canvas.graph, e), s = this.staticPortId;
2774
2776
  if (t === null) {
2775
2777
  this.params.onEdgeCreationInterrupted({
2776
2778
  staticPortId: s,
@@ -2792,7 +2794,7 @@ class ee {
2792
2794
  });
2793
2795
  }
2794
2796
  }
2795
- class te {
2797
+ class se {
2796
2798
  constructor(e, t, s, i, n) {
2797
2799
  o(this, "overlayCanvas");
2798
2800
  o(this, "staticPortId", null);
@@ -2801,10 +2803,10 @@ class te {
2801
2803
  o(this, "onEdgeReattached", (e) => {
2802
2804
  this.params.onAfterEdgeReattached(e);
2803
2805
  });
2804
- this.canvas = e, this.overlayLayer = t, this.viewportStore = s, this.window = i, this.params = n, this.overlayCanvas = Ve(
2806
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = s, this.window = i, this.params = n, this.overlayCanvas = Ie(
2805
2807
  this.overlayLayer,
2806
2808
  this.viewportStore
2807
- ), k.configure(
2809
+ ), H.configure(
2808
2810
  this.canvas,
2809
2811
  this.overlayLayer,
2810
2812
  this.window,
@@ -2825,7 +2827,7 @@ class te {
2825
2827
  );
2826
2828
  }
2827
2829
  static configure(e, t, s, i, n) {
2828
- new te(
2830
+ new se(
2829
2831
  e,
2830
2832
  t,
2831
2833
  s,
@@ -2842,10 +2844,10 @@ class te {
2842
2844
  const d = this.canvas.graph.getPort(e), c = this.canvas.graph.getPort(h), g = c.element.getBoundingClientRect(), l = {
2843
2845
  x: g.x + g.width / 2,
2844
2846
  y: g.y + g.height / 2
2845
- }, u = this.overlayLayer.getBoundingClientRect(), w = this.canvas.viewport.createContentCoords({
2847
+ }, u = this.overlayLayer.getBoundingClientRect(), p = this.canvas.viewport.createContentCoords({
2846
2848
  x: l.x - u.x,
2847
2849
  y: l.y - u.y
2848
- }), y = this.canvas.viewport.createContentCoords({
2850
+ }), f = this.canvas.viewport.createContentCoords({
2849
2851
  x: t.x - u.x,
2850
2852
  y: t.y - u.y
2851
2853
  });
@@ -2858,19 +2860,19 @@ class te {
2858
2860
  }, this.canvas.removeEdge(s);
2859
2861
  const E = {
2860
2862
  overlayNodeId: N.StaticNodeId,
2861
- portCoords: w,
2863
+ portCoords: p,
2862
2864
  portDirection: c.direction
2863
2865
  }, S = {
2864
2866
  overlayNodeId: N.DraggingNodeId,
2865
- portCoords: y,
2867
+ portCoords: f,
2866
2868
  portDirection: d.direction
2867
- }, [b, T] = this.isTargetDragging ? [E, S] : [S, E];
2868
- this.overlayCanvas.addNode(U(b)), this.overlayCanvas.addNode(U(T));
2869
+ }, [b, C] = this.isTargetDragging ? [E, S] : [S, E];
2870
+ this.overlayCanvas.addNode(U(b)), this.overlayCanvas.addNode(U(C));
2869
2871
  const P = this.params.draggingEdgeShapeFactory !== null ? this.params.draggingEdgeShapeFactory(N.EdgeId) : i.shape;
2870
2872
  return this.overlayCanvas.addEdge({
2871
2873
  id: N.EdgeId,
2872
2874
  from: b.overlayNodeId,
2873
- to: T.overlayNodeId,
2875
+ to: C.overlayNodeId,
2874
2876
  shape: P
2875
2877
  }), !0;
2876
2878
  }
@@ -2888,7 +2890,7 @@ class te {
2888
2890
  });
2889
2891
  }
2890
2892
  tryCreateConnection(e) {
2891
- const t = xe(this.canvas.graph, e);
2893
+ const t = be(this.canvas.graph, e);
2892
2894
  if (this.overlayCanvas.removeEdge(N.EdgeId), t === null) {
2893
2895
  const d = this.draggingEdgePayload;
2894
2896
  this.params.onEdgeReattachInterrupted({
@@ -2921,17 +2923,17 @@ class te {
2921
2923
  }
2922
2924
  }
2923
2925
  }
2924
- class re {
2926
+ class oe {
2925
2927
  constructor(e, t) {
2926
2928
  this.applier = e, this.trigger = t, this.trigger.subscribe(() => {
2927
2929
  this.applier.apply();
2928
2930
  });
2929
2931
  }
2930
2932
  static configure(e, t) {
2931
- new re(e, t);
2933
+ new oe(e, t);
2932
2934
  }
2933
2935
  }
2934
- class O {
2936
+ class W {
2935
2937
  constructor(e, t, s) {
2936
2938
  o(this, "applyScheduled", !1);
2937
2939
  o(this, "apply", () => {
@@ -2948,7 +2950,7 @@ class O {
2948
2950
  });
2949
2951
  }
2950
2952
  static configure(e, t, s) {
2951
- new O(
2953
+ new W(
2952
2954
  e,
2953
2955
  t,
2954
2956
  s
@@ -2958,21 +2960,23 @@ class O {
2958
2960
  this.applyScheduled || (this.applyScheduled = !0, this.defererFn(this.apply));
2959
2961
  }
2960
2962
  }
2961
- class Tt {
2963
+ class Dt {
2962
2964
  static configure(e, t) {
2963
- const s = t.applyOn, i = new At(e, t.algorithm, {
2964
- staticNodeResolver: t.staticNodeResolver
2965
+ const s = t.applyOn, i = new xt(e, t.algorithm, {
2966
+ staticNodeResolver: t.staticNodeResolver,
2967
+ onBeforeApplied: t.onBeforeApplied,
2968
+ onAfterApplied: t.onAfterApplied
2965
2969
  });
2966
2970
  switch (s.type) {
2967
2971
  case "manual": {
2968
- re.configure(
2972
+ oe.configure(
2969
2973
  i,
2970
2974
  s.trigger
2971
2975
  );
2972
2976
  break;
2973
2977
  }
2974
2978
  case "topologyChangeMacrotask": {
2975
- O.configure(
2979
+ W.configure(
2976
2980
  e.graph,
2977
2981
  i,
2978
2982
  (n) => {
@@ -2984,7 +2988,7 @@ class Tt {
2984
2988
  break;
2985
2989
  }
2986
2990
  case "topologyChangeMicrotask": {
2987
- O.configure(
2991
+ W.configure(
2988
2992
  e.graph,
2989
2993
  i,
2990
2994
  (n) => {
@@ -2998,7 +3002,7 @@ class Tt {
2998
3002
  }
2999
3003
  }
3000
3004
  }
3001
- class Ct {
3005
+ class Mt {
3002
3006
  constructor(e, t) {
3003
3007
  o(this, "previousTimeStamp");
3004
3008
  o(this, "step", (e) => {
@@ -3013,59 +3017,61 @@ class Ct {
3013
3017
  this.win = e, this.callback = t, this.win.requestAnimationFrame(this.step);
3014
3018
  }
3015
3019
  }
3016
- class se {
3020
+ class ie {
3017
3021
  constructor(e, t, s) {
3018
3022
  o(this, "applier");
3019
3023
  o(this, "step", (e) => {
3020
3024
  this.applier.apply(e);
3021
3025
  });
3022
- this.win = s, this.applier = new Et(e, t.algorithm, {
3023
- staticNodeResolver: t.staticNodeResolver
3024
- }), new Ct(this.win, this.step);
3026
+ this.win = s, this.applier = new St(e, t.algorithm, {
3027
+ staticNodeResolver: t.staticNodeResolver,
3028
+ onBeforeApplied: t.onBeforeApplied,
3029
+ onAfterApplied: t.onAfterApplied
3030
+ }), new Mt(this.win, this.step);
3025
3031
  }
3026
3032
  static configure(e, t, s) {
3027
- new se(e, t, s);
3033
+ new ie(e, t, s);
3028
3034
  }
3029
3035
  }
3030
- const Dt = () => {
3036
+ const Rt = () => {
3031
3037
  const r = document.createElement("div");
3032
3038
  return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r;
3033
- }, Y = () => {
3039
+ }, j = () => {
3034
3040
  const r = document.createElement("div");
3035
3041
  return r.style.position = "absolute", r.style.inset = "0", r;
3036
- }, pe = () => {
3037
- const r = Y();
3042
+ }, fe = () => {
3043
+ const r = j();
3038
3044
  return r.style.pointerEvents = "none", r;
3039
3045
  };
3040
- class Mt {
3046
+ class Lt {
3041
3047
  constructor(e) {
3042
- o(this, "background", Y());
3043
- o(this, "main", Y());
3044
- o(this, "overlayConnectablePorts", pe());
3045
- o(this, "overlayDraggableEdges", pe());
3046
- o(this, "host", Dt());
3048
+ o(this, "background", j());
3049
+ o(this, "main", j());
3050
+ o(this, "overlayConnectablePorts", fe());
3051
+ o(this, "overlayDraggableEdges", fe());
3052
+ o(this, "host", Rt());
3047
3053
  this.element = e, this.element.appendChild(this.host), this.host.appendChild(this.background), this.host.appendChild(this.main), this.host.appendChild(this.overlayConnectablePorts), this.host.appendChild(this.overlayDraggableEdges);
3048
3054
  }
3049
3055
  destroy() {
3050
3056
  this.host.removeChild(this.background), this.host.removeChild(this.main), this.host.removeChild(this.overlayConnectablePorts), this.host.removeChild(this.overlayDraggableEdges), this.element.removeChild(this.host);
3051
3057
  }
3052
3058
  }
3053
- const G = (r) => () => r, we = G(0), Lt = () => {
3059
+ const q = (r) => () => r, ye = q(0), Vt = () => {
3054
3060
  let r = 0;
3055
3061
  return () => r++;
3056
- }, Rt = (r, e) => {
3057
- let t = we, s = we;
3058
- const i = Lt();
3059
- return r === "incremental" && (t = i), e === "incremental" && (s = i), typeof r == "number" && (t = G(r)), typeof e == "number" && (s = G(e)), typeof r == "function" && (t = r), typeof e == "function" && (s = e), {
3062
+ }, Ft = (r, e) => {
3063
+ let t = ye, s = ye;
3064
+ const i = Vt();
3065
+ return r === "incremental" && (t = i), e === "incremental" && (s = i), typeof r == "number" && (t = q(r)), typeof e == "number" && (s = q(e)), typeof r == "function" && (t = r), typeof e == "function" && (s = e), {
3060
3066
  nodesPriorityFn: t,
3061
3067
  edgesPriorityFn: s
3062
3068
  };
3063
- }, oe = (r) => {
3069
+ }, ne = (r) => {
3064
3070
  if (typeof r == "function")
3065
3071
  return r;
3066
3072
  switch (r.type) {
3067
3073
  case "straight":
3068
- return () => new wt({
3074
+ return () => new yt({
3069
3075
  color: r.color,
3070
3076
  width: r.width,
3071
3077
  arrowLength: r.arrowLength,
@@ -3079,7 +3085,7 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3079
3085
  detourDirection: r.detourDirection
3080
3086
  });
3081
3087
  case "horizontal":
3082
- return () => new pt({
3088
+ return () => new ft({
3083
3089
  color: r.color,
3084
3090
  width: r.width,
3085
3091
  arrowLength: r.arrowLength,
@@ -3092,7 +3098,7 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3092
3098
  detourDistance: r.detourDistance
3093
3099
  });
3094
3100
  case "vertical":
3095
- return () => new yt({
3101
+ return () => new mt({
3096
3102
  color: r.color,
3097
3103
  width: r.width,
3098
3104
  arrowLength: r.arrowLength,
@@ -3105,7 +3111,7 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3105
3111
  detourDistance: r.detourDistance
3106
3112
  });
3107
3113
  case "direct":
3108
- return () => new De({
3114
+ return () => new Re({
3109
3115
  color: r.color,
3110
3116
  width: r.width,
3111
3117
  arrowLength: r.arrowLength,
@@ -3116,7 +3122,7 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3116
3122
  targetOffset: r.targetOffset
3117
3123
  });
3118
3124
  default:
3119
- return () => new ut({
3125
+ return () => new wt({
3120
3126
  color: r.color,
3121
3127
  width: r.width,
3122
3128
  arrowLength: r.arrowLength,
@@ -3130,31 +3136,31 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3130
3136
  detourDirection: r.detourDirection
3131
3137
  });
3132
3138
  }
3133
- }, Vt = (r) => {
3139
+ }, It = (r) => {
3134
3140
  var t, s, i, n, a;
3135
- const e = Rt(
3141
+ const e = Ft(
3136
3142
  (t = r.nodes) == null ? void 0 : t.priority,
3137
3143
  (s = r.edges) == null ? void 0 : s.priority
3138
3144
  );
3139
3145
  return {
3140
3146
  nodes: {
3141
- centerFn: ((i = r.nodes) == null ? void 0 : i.centerFn) ?? Se,
3147
+ centerFn: ((i = r.nodes) == null ? void 0 : i.centerFn) ?? Pe,
3142
3148
  priorityFn: e.nodesPriorityFn
3143
3149
  },
3144
3150
  ports: {
3145
3151
  direction: ((n = r.ports) == null ? void 0 : n.direction) ?? 0
3146
3152
  },
3147
3153
  edges: {
3148
- shapeFactory: oe(((a = r.edges) == null ? void 0 : a.shape) ?? {}),
3154
+ shapeFactory: ne(((a = r.edges) == null ? void 0 : a.shape) ?? {}),
3149
3155
  priorityFn: e.edgesPriorityFn
3150
3156
  }
3151
3157
  };
3152
- }, Ft = (r) => {
3153
- var w, y, E, S, b, T;
3154
- const e = ((w = r.events) == null ? void 0 : w.onNodeDragStarted) ?? (() => {
3155
- }), t = ((y = r.events) == null ? void 0 : y.onNodeDrag) ?? (() => {
3158
+ }, Bt = (r) => {
3159
+ var p, f, E, S, b, C;
3160
+ const e = ((p = r.events) == null ? void 0 : p.onNodeDragStarted) ?? (() => {
3161
+ }), t = ((f = r.events) == null ? void 0 : f.onNodeDrag) ?? (() => {
3156
3162
  }), s = r.nodeDragVerifier ?? (() => !0), i = ((E = r.events) == null ? void 0 : E.onNodeDragFinished) ?? (() => {
3157
- }), n = r.moveOnTop !== !1, a = r.moveEdgesOnTop !== !1 && n, h = (S = r.mouse) == null ? void 0 : S.dragCursor, d = h !== void 0 ? h : "grab", c = (b = r.mouse) == null ? void 0 : b.mouseDownEventVerifier, g = c !== void 0 ? c : (P) => P.button === 0, l = (T = r.mouse) == null ? void 0 : T.mouseUpEventVerifier, u = l !== void 0 ? l : (P) => P.button === 0;
3163
+ }), n = r.moveOnTop !== !1, a = r.moveEdgesOnTop !== !1 && n, h = (S = r.mouse) == null ? void 0 : S.dragCursor, d = h !== void 0 ? h : "grab", c = (b = r.mouse) == null ? void 0 : b.mouseDownEventVerifier, g = c !== void 0 ? c : (P) => P.button === 0, l = (C = r.mouse) == null ? void 0 : C.mouseUpEventVerifier, u = l !== void 0 ? l : (P) => P.button === 0;
3158
3164
  return {
3159
3165
  moveOnTop: n,
3160
3166
  moveEdgesOnTop: a,
@@ -3167,7 +3173,7 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3167
3173
  nodeDragVerifier: s,
3168
3174
  onNodeDragFinished: i
3169
3175
  };
3170
- }, It = (r) => {
3176
+ }, $t = (r) => {
3171
3177
  const e = r.minX !== null ? r.minX : -1 / 0, t = r.maxX !== null ? r.maxX : 1 / 0, s = r.minY !== null ? r.minY : -1 / 0, i = r.maxY !== null ? r.maxY : 1 / 0;
3172
3178
  return (n) => {
3173
3179
  let a = n.nextTransform.x, h = n.nextTransform.y;
@@ -3177,7 +3183,7 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3177
3183
  const g = n.canvasHeight * n.prevTransform.scale, l = i - g;
3178
3184
  return h > l && h > n.prevTransform.y && (h = Math.max(n.prevTransform.y, l)), { scale: n.nextTransform.scale, x: a, y: h };
3179
3185
  };
3180
- }, $t = (r) => {
3186
+ }, Ut = (r) => {
3181
3187
  const e = r.maxContentScale, t = r.minContentScale, s = e !== null ? 1 / e : 0, i = t !== null ? 1 / t : 1 / 0;
3182
3188
  return (n) => {
3183
3189
  const a = n.prevTransform, h = n.nextTransform;
@@ -3198,7 +3204,7 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3198
3204
  y: g
3199
3205
  };
3200
3206
  };
3201
- }, Ut = (r) => (e) => r.reduce(
3207
+ }, Ot = (r) => (e) => r.reduce(
3202
3208
  (t, s) => s({
3203
3209
  prevTransform: e.prevTransform,
3204
3210
  nextTransform: t,
@@ -3206,40 +3212,40 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3206
3212
  canvasHeight: e.canvasHeight
3207
3213
  }),
3208
3214
  e.nextTransform
3209
- ), ye = (r) => {
3215
+ ), me = (r) => {
3210
3216
  if (typeof r == "function")
3211
3217
  return r;
3212
3218
  switch (r.type) {
3213
3219
  case "scale-limit":
3214
- return $t({
3220
+ return Ut({
3215
3221
  minContentScale: r.minContentScale ?? 0,
3216
3222
  maxContentScale: r.maxContentScale ?? 1 / 0
3217
3223
  });
3218
3224
  case "shift-limit":
3219
- return It({
3225
+ return $t({
3220
3226
  minX: r.minX ?? -1 / 0,
3221
3227
  maxX: r.maxX ?? 1 / 0,
3222
3228
  minY: r.minY ?? -1 / 0,
3223
3229
  maxY: r.maxY ?? 1 / 0
3224
3230
  });
3225
3231
  }
3226
- }, fe = (r) => {
3227
- var y, E, S, b, T, P, R, V, ie, ne, ae, he;
3228
- const e = (y = r == null ? void 0 : r.scale) == null ? void 0 : y.mouseWheelSensitivity, t = e !== void 0 ? e : 1.2, s = r == null ? void 0 : r.transformPreprocessor;
3232
+ }, ve = (r) => {
3233
+ var f, E, S, b, C, P, L, V, ae, he, de, ce;
3234
+ const e = (f = r == null ? void 0 : r.scale) == null ? void 0 : f.mouseWheelSensitivity, t = e !== void 0 ? e : 1.2, s = r == null ? void 0 : r.transformPreprocessor;
3229
3235
  let i;
3230
- s !== void 0 ? Array.isArray(s) ? i = Ut(
3236
+ s !== void 0 ? Array.isArray(s) ? i = Ot(
3231
3237
  s.map(
3232
- (C) => ye(C)
3238
+ (T) => me(T)
3233
3239
  )
3234
- ) : i = ye(s) : i = (C) => C.nextTransform;
3240
+ ) : i = me(s) : i = (T) => T.nextTransform;
3235
3241
  const n = ((E = r == null ? void 0 : r.shift) == null ? void 0 : E.cursor) !== void 0 ? r.shift.cursor : "grab", a = ((S = r == null ? void 0 : r.events) == null ? void 0 : S.onBeforeTransformChange) ?? (() => {
3236
3242
  }), h = ((b = r == null ? void 0 : r.events) == null ? void 0 : b.onTransformChange) ?? (() => {
3237
- }), d = (T = r == null ? void 0 : r.shift) == null ? void 0 : T.mouseDownEventVerifier, c = d !== void 0 ? d : (C) => C.button === 0, g = (P = r == null ? void 0 : r.shift) == null ? void 0 : P.mouseUpEventVerifier, l = g !== void 0 ? g : (C) => C.button === 0, u = (R = r == null ? void 0 : r.scale) == null ? void 0 : R.mouseWheelEventVerifier, w = u !== void 0 ? u : () => !0;
3243
+ }), d = (C = r == null ? void 0 : r.shift) == null ? void 0 : C.mouseDownEventVerifier, c = d !== void 0 ? d : (T) => T.button === 0, g = (P = r == null ? void 0 : r.shift) == null ? void 0 : P.mouseUpEventVerifier, l = g !== void 0 ? g : (T) => T.button === 0, u = (L = r == null ? void 0 : r.scale) == null ? void 0 : L.mouseWheelEventVerifier, p = u !== void 0 ? u : () => !0;
3238
3244
  return {
3239
3245
  wheelSensitivity: t,
3240
3246
  onTransformStarted: ((V = r == null ? void 0 : r.events) == null ? void 0 : V.onTransformStarted) ?? (() => {
3241
3247
  }),
3242
- onTransformFinished: ((ie = r == null ? void 0 : r.events) == null ? void 0 : ie.onTransformFinished) ?? (() => {
3248
+ onTransformFinished: ((ae = r == null ? void 0 : r.events) == null ? void 0 : ae.onTransformFinished) ?? (() => {
3243
3249
  }),
3244
3250
  onBeforeTransformChange: a,
3245
3251
  onTransformChange: h,
@@ -3247,31 +3253,31 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3247
3253
  shiftCursor: n,
3248
3254
  mouseDownEventVerifier: c,
3249
3255
  mouseUpEventVerifier: l,
3250
- mouseWheelEventVerifier: w,
3251
- scaleWheelFinishTimeout: ((ne = r == null ? void 0 : r.scale) == null ? void 0 : ne.wheelFinishTimeout) ?? 500,
3252
- onResizeTransformStarted: ((ae = r == null ? void 0 : r.events) == null ? void 0 : ae.onResizeTransformStarted) ?? (() => {
3256
+ mouseWheelEventVerifier: p,
3257
+ scaleWheelFinishTimeout: ((he = r == null ? void 0 : r.scale) == null ? void 0 : he.wheelFinishTimeout) ?? 500,
3258
+ onResizeTransformStarted: ((de = r == null ? void 0 : r.events) == null ? void 0 : de.onResizeTransformStarted) ?? (() => {
3253
3259
  }),
3254
- onResizeTransformFinished: ((he = r == null ? void 0 : r.events) == null ? void 0 : he.onResizeTransformFinished) ?? (() => {
3260
+ onResizeTransformFinished: ((ce = r == null ? void 0 : r.events) == null ? void 0 : ce.onResizeTransformFinished) ?? (() => {
3255
3261
  })
3256
3262
  };
3257
- }, Bt = (r, e) => {
3263
+ }, Wt = (r, e) => {
3258
3264
  const t = document.createElementNS(
3259
3265
  "http://www.w3.org/2000/svg",
3260
3266
  "circle"
3261
3267
  );
3262
3268
  return t.setAttribute("cx", "0"), t.setAttribute("cy", "0"), t.setAttribute("r", `${r}`), t.setAttribute("fill", `${e}`), t;
3263
- }, Ot = (r) => r instanceof SVGElement ? r : Bt(
3269
+ }, zt = (r) => r instanceof SVGElement ? r : Wt(
3264
3270
  (r == null ? void 0 : r.radius) ?? 1.5,
3265
3271
  (r == null ? void 0 : r.color) ?? "#d8d8d8"
3266
- ), Wt = (r) => {
3267
- const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, s = (e == null ? void 0 : e.height) ?? 25, i = Ot(r.renderer ?? {});
3272
+ ), kt = (r) => {
3273
+ const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, s = (e == null ? void 0 : e.height) ?? 25, i = zt(r.renderer ?? {});
3268
3274
  return {
3269
3275
  tileWidth: t,
3270
3276
  tileHeight: s,
3271
3277
  renderer: i,
3272
3278
  maxViewportScale: r.maxViewportScale ?? 10
3273
3279
  };
3274
- }, zt = (r, e, t) => {
3280
+ }, Ht = (r, e, t) => {
3275
3281
  var c, g, l;
3276
3282
  const s = () => "direct", i = (u) => u, n = (u) => u.button === 0, a = () => {
3277
3283
  }, h = () => {
@@ -3286,13 +3292,13 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3286
3292
  onEdgeCreationInterrupted: ((g = r.events) == null ? void 0 : g.onEdgeCreationInterrupted) ?? d,
3287
3293
  onEdgeCreationPrevented: ((l = r.events) == null ? void 0 : l.onEdgeCreationPrevented) ?? h,
3288
3294
  dragPortDirection: r.dragPortDirection ?? t,
3289
- edgeShapeFactory: r.edgeShape !== void 0 ? oe(r.edgeShape) : e
3295
+ edgeShapeFactory: r.edgeShape !== void 0 ? ne(r.edgeShape) : e
3290
3296
  };
3291
- }, kt = (r, e) => {
3297
+ }, Xt = (r, e) => {
3292
3298
  var c, g, l;
3293
3299
  const t = (u) => u, s = (u) => u.button === 0 && u.ctrlKey, i = (u) => u.button === 0, n = (u) => {
3294
- const w = e.getPortAdjacentEdgeIds(u);
3295
- return w.length > 0 ? w[w.length - 1] : null;
3300
+ const p = e.getPortAdjacentEdgeIds(u);
3301
+ return p.length > 0 ? p[p.length - 1] : null;
3296
3302
  }, a = () => {
3297
3303
  }, h = () => {
3298
3304
  }, d = () => {
@@ -3302,15 +3308,15 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3302
3308
  mouseDownEventVerifier: r.mouseDownEventVerifier ?? s,
3303
3309
  mouseUpEventVerifier: r.mouseUpEventVerifier ?? i,
3304
3310
  draggingEdgeResolver: r.draggingEdgeResolver ?? n,
3305
- draggingEdgeShapeFactory: r.draggingEdgeShape !== void 0 ? oe(r.draggingEdgeShape) : null,
3311
+ draggingEdgeShapeFactory: r.draggingEdgeShape !== void 0 ? ne(r.draggingEdgeShape) : null,
3306
3312
  onAfterEdgeReattached: ((c = r.events) == null ? void 0 : c.onAfterEdgeReattached) ?? a,
3307
3313
  onEdgeReattachInterrupted: ((g = r.events) == null ? void 0 : g.onEdgeReattachInterrupted) ?? d,
3308
3314
  onEdgeReattachPrevented: ((l = r.events) == null ? void 0 : l.onEdgeReattachPrevented) ?? h
3309
3315
  };
3310
- }, Ht = (r) => ({
3316
+ }, Yt = (r) => ({
3311
3317
  nodeVerticalRadius: r.nodeContainingRadius.vertical,
3312
3318
  nodeHorizontalRadius: r.nodeContainingRadius.horizontal
3313
- }), Xt = (r) => {
3319
+ }), Gt = (r) => {
3314
3320
  var e, t;
3315
3321
  return {
3316
3322
  onAfterNodeDetached: ((e = r == null ? void 0 : r.events) == null ? void 0 : e.onAfterNodeDetached) ?? (() => {
@@ -3319,28 +3325,13 @@ const G = (r) => () => r, we = G(0), Lt = () => {
3319
3325
  })
3320
3326
  };
3321
3327
  };
3322
- class Yt extends Error {
3328
+ class jt extends Error {
3323
3329
  constructor() {
3324
3330
  super(...arguments);
3325
3331
  o(this, "name", "CanvasBuilderError");
3326
3332
  }
3327
3333
  }
3328
- const v = Object.freeze({
3329
- seed: "HTMLGraph is awesome",
3330
- maxTimeDeltaSec: 0.01,
3331
- nodeCharge: 1e5,
3332
- nodeMass: 1,
3333
- edgeEquilibriumLength: 300,
3334
- edgeStiffness: 1e3,
3335
- dtSec: 0.01,
3336
- maxIterations: 1e3,
3337
- convergenceVelocity: 10,
3338
- maxForce: 1e7,
3339
- nodeForceCoefficient: 1,
3340
- barnesHutAreaRadiusThreshold: 0.01,
3341
- barnesHutTheta: 1
3342
- });
3343
- class Fe {
3334
+ class Be {
3344
3335
  constructor(e, t, s) {
3345
3336
  o(this, "dt");
3346
3337
  o(this, "nodeMass");
@@ -3373,12 +3364,12 @@ class Fe {
3373
3364
  const s = this.graph.getEdge(t), i = this.graph.getPort(s.from), n = this.graph.getPort(s.to), a = this.currentCoords.get(i.nodeId), h = this.currentCoords.get(n.nodeId), d = this.distanceVectorGenerator.create(
3374
3365
  a,
3375
3366
  h
3376
- ), g = (d.d - this.edgeEquilibriumLength) * this.edgeStiffness, l = d.ex * g, u = d.ey * g, w = e.get(i.nodeId), y = e.get(n.nodeId);
3377
- w.x += l, w.y += u, y.x -= l, y.y -= u;
3367
+ ), g = (d.d - this.edgeEquilibriumLength) * this.edgeStiffness, l = d.ex * g, u = d.ey * g, p = e.get(i.nodeId), f = e.get(n.nodeId);
3368
+ p.x += l, p.y += u, f.x -= l, f.y -= u;
3378
3369
  });
3379
3370
  }
3380
3371
  }
3381
- class Ie {
3372
+ class $e {
3382
3373
  constructor(e) {
3383
3374
  o(this, "PI2", 2 * Math.PI);
3384
3375
  this.rand = e;
@@ -3397,13 +3388,13 @@ class Ie {
3397
3388
  return { ex: h, ey: d, d: a };
3398
3389
  }
3399
3390
  }
3400
- const $e = (r) => {
3391
+ const Ue = (r) => {
3401
3392
  if (r.distance === 0)
3402
3393
  return r.maxForce;
3403
3394
  const e = r.coefficient * (r.sourceCharge * r.targetCharge / (r.distance * r.distance));
3404
3395
  return Math.min(e, r.maxForce);
3405
3396
  };
3406
- class Gt {
3397
+ class qt {
3407
3398
  constructor(e) {
3408
3399
  o(this, "nodeCharge");
3409
3400
  o(this, "distanceVectorGenerator");
@@ -3418,19 +3409,19 @@ class Gt {
3418
3409
  const d = s[h], c = e.get(a), g = e.get(d), l = this.distanceVectorGenerator.create(
3419
3410
  c,
3420
3411
  g
3421
- ), u = $e({
3412
+ ), u = Ue({
3422
3413
  coefficient: 1,
3423
3414
  sourceCharge: this.nodeCharge,
3424
3415
  targetCharge: this.nodeCharge,
3425
3416
  distance: l.d,
3426
3417
  maxForce: this.maxForce
3427
- }), w = u * l.ex, y = u * l.ey, E = t.get(a), S = t.get(d);
3428
- E.x -= w, E.y -= y, S.x += w, S.y += y;
3418
+ }), p = u * l.ex, f = u * l.ey, E = t.get(a), S = t.get(d);
3419
+ E.x -= p, E.y -= f, S.x += p, S.y += f;
3429
3420
  }
3430
3421
  }
3431
3422
  }
3432
3423
  }
3433
- const jt = (r) => {
3424
+ const Kt = (r) => {
3434
3425
  if (r.size === 0)
3435
3426
  return {
3436
3427
  centerX: 0,
@@ -3448,7 +3439,7 @@ const jt = (r) => {
3448
3439
  radius: h / 2
3449
3440
  };
3450
3441
  };
3451
- class Kt {
3442
+ class Qt {
3452
3443
  constructor(e) {
3453
3444
  o(this, "root");
3454
3445
  o(this, "leaves", /* @__PURE__ */ new Map());
@@ -3503,8 +3494,8 @@ class Kt {
3503
3494
  this.sortedParentNodes.push(e);
3504
3495
  const n = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), c = i / 2;
3505
3496
  e.nodeIds.forEach((u) => {
3506
- const { x: w, y } = this.coords.get(u);
3507
- w < t ? y < s ? d.add(u) : h.add(u) : y < s ? a.add(u) : n.add(u), e.nodeIds.delete(u);
3497
+ const { x: p, y: f } = this.coords.get(u);
3498
+ p < t ? f < s ? d.add(u) : h.add(u) : f < s ? a.add(u) : n.add(u), e.nodeIds.delete(u);
3508
3499
  });
3509
3500
  const g = {
3510
3501
  parent: e,
@@ -3605,7 +3596,7 @@ class Kt {
3605
3596
  }), { x: t / e.size, y: s / e.size };
3606
3597
  }
3607
3598
  }
3608
- class Qt {
3599
+ class Zt {
3609
3600
  constructor(e) {
3610
3601
  o(this, "areaRadiusThreshold");
3611
3602
  o(this, "nodeMass");
@@ -3617,7 +3608,7 @@ class Qt {
3617
3608
  this.areaRadiusThreshold = e.areaRadiusThreshold, this.nodeMass = e.nodeMass, this.nodeCharge = e.nodeCharge, this.theta = e.theta, this.distanceVectorGenerator = e.distanceVectorGenerator, this.nodeForceCoefficient = e.nodeForceCoefficient, this.maxForce = e.maxForce;
3618
3609
  }
3619
3610
  apply(e, t) {
3620
- const s = jt(e), i = new Kt({
3611
+ const s = Kt(e), i = new Qt({
3621
3612
  box: s,
3622
3613
  coords: e,
3623
3614
  areaRadiusThreshold: this.areaRadiusThreshold,
@@ -3732,7 +3723,7 @@ class Qt {
3732
3723
  const t = this.distanceVectorGenerator.create(
3733
3724
  e.sourceCoords,
3734
3725
  e.targetCoords
3735
- ), s = $e({
3726
+ ), s = Ue({
3736
3727
  coefficient: this.nodeForceCoefficient,
3737
3728
  sourceCharge: e.sourceCharge,
3738
3729
  targetCharge: e.targetCharge,
@@ -3767,7 +3758,7 @@ class Qt {
3767
3758
  }
3768
3759
  }
3769
3760
  }
3770
- const Ue = (r) => r.theta !== 0 ? new Qt({
3761
+ const Oe = (r) => r.theta !== 0 ? new Zt({
3771
3762
  nodeCharge: r.nodeCharge,
3772
3763
  nodeForceCoefficient: r.nodeForceCoefficient,
3773
3764
  distanceVectorGenerator: r.distanceVectorGenerator,
@@ -3775,13 +3766,13 @@ const Ue = (r) => r.theta !== 0 ? new Qt({
3775
3766
  theta: r.theta,
3776
3767
  nodeMass: r.nodeMass,
3777
3768
  areaRadiusThreshold: r.areaRadiusThreshold
3778
- }) : new Gt({
3769
+ }) : new qt({
3779
3770
  nodeCharge: r.nodeCharge,
3780
3771
  nodeForceCoefficient: r.nodeForceCoefficient,
3781
3772
  distanceVectorGenerator: r.distanceVectorGenerator,
3782
3773
  maxForce: r.maxForce
3783
3774
  });
3784
- class Be {
3775
+ class We {
3785
3776
  constructor(e) {
3786
3777
  o(this, "rand");
3787
3778
  o(this, "sparsity");
@@ -3792,16 +3783,16 @@ class Be {
3792
3783
  x: g.x - l,
3793
3784
  y: g.y - l
3794
3785
  };
3795
- return n.forEach((w) => {
3796
- const y = t.getNode(w);
3797
- i.set(w, {
3798
- x: y.x ?? u.x + a * this.rand(),
3799
- y: y.y ?? u.y + a * this.rand()
3786
+ return n.forEach((p) => {
3787
+ const f = t.getNode(p);
3788
+ i.set(p, {
3789
+ x: f.x ?? u.x + a * this.rand(),
3790
+ y: f.y ?? u.y + a * this.rand()
3800
3791
  });
3801
3792
  }), i;
3802
3793
  }
3803
3794
  }
3804
- class Zt {
3795
+ class Jt {
3805
3796
  constructor(e) {
3806
3797
  o(this, "distanceVectorGenerator");
3807
3798
  o(this, "nodeForcesApplicationStrategy");
@@ -3812,7 +3803,7 @@ class Zt {
3812
3803
  o(this, "edgeEquilibriumLength");
3813
3804
  o(this, "edgeStiffness");
3814
3805
  o(this, "convergenceVelocity");
3815
- this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.convergenceVelocity, this.distanceVectorGenerator = new Ie(e.rand), this.nodeForcesApplicationStrategy = Ue({
3806
+ this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.convergenceVelocity, this.distanceVectorGenerator = new $e(e.rand), this.nodeForcesApplicationStrategy = Oe({
3816
3807
  distanceVectorGenerator: this.distanceVectorGenerator,
3817
3808
  nodeCharge: e.nodeCharge,
3818
3809
  maxForce: e.maxForce,
@@ -3820,7 +3811,7 @@ class Zt {
3820
3811
  theta: e.barnesHutTheta,
3821
3812
  areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
3822
3813
  nodeMass: e.nodeMass
3823
- }), this.fillerLayoutAlgorithm = new Be({
3814
+ }), this.fillerLayoutAlgorithm = new We({
3824
3815
  rand: e.rand,
3825
3816
  sparsity: e.edgeEquilibriumLength
3826
3817
  });
@@ -3830,7 +3821,7 @@ class Zt {
3830
3821
  graph: t,
3831
3822
  viewport: s
3832
3823
  });
3833
- for (let n = 0; n < this.maxIterations && !(new Fe(
3824
+ for (let n = 0; n < this.maxIterations && !(new Be(
3834
3825
  t,
3835
3826
  i,
3836
3827
  {
@@ -3846,7 +3837,132 @@ class Zt {
3846
3837
  return i;
3847
3838
  }
3848
3839
  }
3849
- class qt {
3840
+ class _t {
3841
+ constructor(e) {
3842
+ o(this, "forest", /* @__PURE__ */ new Set());
3843
+ o(this, "remainingNodeIds");
3844
+ for (this.graph = e, this.remainingNodeIds = new Set(this.graph.getAllNodeIds()); this.remainingNodeIds.size > 0; ) {
3845
+ const [t] = this.remainingNodeIds;
3846
+ this.traverse(t);
3847
+ }
3848
+ }
3849
+ generate() {
3850
+ return this.forest;
3851
+ }
3852
+ traverse(e) {
3853
+ const t = {
3854
+ nodeId: e,
3855
+ children: /* @__PURE__ */ new Set()
3856
+ }, s = [];
3857
+ this.forest.add({ root: t, sequence: s });
3858
+ let i = [t];
3859
+ for (; i.length > 0; ) {
3860
+ const n = [];
3861
+ i.forEach((a) => {
3862
+ s.push(a), this.remainingNodeIds.delete(a.nodeId);
3863
+ const h = this.graph.getNodeOutgoingEdgeIds(a.nodeId).map((g) => {
3864
+ const l = this.graph.getEdge(g);
3865
+ return this.graph.getPort(l.to).nodeId;
3866
+ }), d = this.graph.getNodeIncomingEdgeIds(a.nodeId).map((g) => {
3867
+ const l = this.graph.getEdge(g);
3868
+ return this.graph.getPort(l.from).nodeId;
3869
+ });
3870
+ [...h, ...d].forEach((g) => {
3871
+ if (!this.remainingNodeIds.has(g))
3872
+ return;
3873
+ const l = {
3874
+ nodeId: g,
3875
+ children: /* @__PURE__ */ new Set()
3876
+ };
3877
+ a.children.add(l), n.push(l);
3878
+ });
3879
+ }), i = n;
3880
+ }
3881
+ }
3882
+ }
3883
+ class er {
3884
+ constructor(e) {
3885
+ o(this, "baseRadius");
3886
+ this.baseRadius = e.radius;
3887
+ }
3888
+ resolve(e) {
3889
+ let t = 0, s = -1 / 0;
3890
+ const i = [];
3891
+ e.forEach((h) => {
3892
+ h === null ? (t += this.baseRadius, i.push(t), t += this.baseRadius) : t + this.baseRadius - h < s ? (s += h, i.push(s), t = s + this.baseRadius, s += h) : (t += this.baseRadius, i.push(t), s = t + h, t += this.baseRadius);
3893
+ });
3894
+ const n = t / 2;
3895
+ let a = 0;
3896
+ if (e.length > 0) {
3897
+ const h = e[e.length - 1] ?? 0, d = i[i.length - 1];
3898
+ a = Math.max(
3899
+ a,
3900
+ d + h - t
3901
+ );
3902
+ const c = e[0] ?? 0, g = i[0];
3903
+ a = Math.max(a, c - g);
3904
+ }
3905
+ return {
3906
+ offsets: i.map((h) => h - n),
3907
+ radius: n + a
3908
+ };
3909
+ }
3910
+ }
3911
+ class tr {
3912
+ constructor(e, t) {
3913
+ o(this, "offsets", /* @__PURE__ */ new Map());
3914
+ o(this, "childrenRadii", /* @__PURE__ */ new Map());
3915
+ o(this, "layerNodePlacementResolver");
3916
+ this.tree = e, this.layerNodePlacementResolver = new er({
3917
+ radius: t.spaceAroundRadius
3918
+ }), [...this.tree.sequence].reverse().forEach((s) => {
3919
+ if (s.children.size === 0)
3920
+ this.childrenRadii.set(s.nodeId, null);
3921
+ else {
3922
+ const i = Array.from(s.children).map(
3923
+ (h) => this.childrenRadii.get(h.nodeId)
3924
+ ), n = this.layerNodePlacementResolver.resolve(i);
3925
+ this.childrenRadii.set(s.nodeId, n.radius);
3926
+ let a = 0;
3927
+ s.children.forEach((h) => {
3928
+ this.offsets.set(h.nodeId, n.offsets[a]), a++;
3929
+ });
3930
+ }
3931
+ }), this.offsets.set(this.tree.root.nodeId, 0);
3932
+ }
3933
+ generate() {
3934
+ return this.offsets;
3935
+ }
3936
+ }
3937
+ class rr {
3938
+ constructor(e) {
3939
+ this.params = e;
3940
+ }
3941
+ calculateCoordinates(e) {
3942
+ const t = /* @__PURE__ */ new Map(), i = new _t(e.graph).generate();
3943
+ let n = 0;
3944
+ return i.forEach((a) => {
3945
+ t.set(a.root.nodeId, { x: n, y: 0 });
3946
+ const d = new tr(a, {
3947
+ spaceAroundRadius: this.params.layerSpace / 2
3948
+ }).generate();
3949
+ let c = [a.root];
3950
+ for (; c.length > 0; ) {
3951
+ const g = [];
3952
+ n += this.params.layerWidth, c.forEach((l) => {
3953
+ l.children.forEach((u) => {
3954
+ const p = t.get(l.nodeId).y;
3955
+ t.set(u.nodeId, {
3956
+ y: p + d.get(u.nodeId),
3957
+ x: n
3958
+ }), g.push(u);
3959
+ });
3960
+ }), c = g;
3961
+ }
3962
+ }), t;
3963
+ }
3964
+ }
3965
+ class sr {
3850
3966
  constructor(e) {
3851
3967
  o(this, "distanceVectorGenerator");
3852
3968
  o(this, "nodeForcesApplicationStrategy");
@@ -3856,7 +3972,7 @@ class qt {
3856
3972
  o(this, "edgeEquilibriumLength");
3857
3973
  o(this, "edgeStiffness");
3858
3974
  o(this, "fillerLayoutAlgorithm");
3859
- this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new Ie(e.rand), this.nodeForcesApplicationStrategy = Ue({
3975
+ this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new $e(e.rand), this.nodeForcesApplicationStrategy = Oe({
3860
3976
  distanceVectorGenerator: this.distanceVectorGenerator,
3861
3977
  nodeCharge: e.nodeCharge,
3862
3978
  maxForce: e.maxForce,
@@ -3864,7 +3980,7 @@ class qt {
3864
3980
  theta: e.barnesHutTheta,
3865
3981
  areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
3866
3982
  nodeMass: e.nodeMass
3867
- }), this.fillerLayoutAlgorithm = new Be({
3983
+ }), this.fillerLayoutAlgorithm = new We({
3868
3984
  rand: e.rand,
3869
3985
  sparsity: e.edgeEquilibriumLength
3870
3986
  });
@@ -3874,7 +3990,7 @@ class qt {
3874
3990
  graph: t,
3875
3991
  viewport: s
3876
3992
  });
3877
- return new Fe(
3993
+ return new Be(
3878
3994
  t,
3879
3995
  n,
3880
3996
  {
@@ -3891,23 +4007,37 @@ class qt {
3891
4007
  }) ? /* @__PURE__ */ new Map() : n;
3892
4008
  }
3893
4009
  }
3894
- const Oe = (r) => {
4010
+ const ze = (r) => {
3895
4011
  let e = 1779033703, t = 3144134277, s = 1013904242, i = 2773480762;
3896
4012
  for (let n = 0, a; n < r.length; n++)
3897
4013
  a = r.charCodeAt(n), e = t ^ Math.imul(e ^ a, 597399067), t = s ^ Math.imul(t ^ a, 2869860233), s = i ^ Math.imul(s ^ a, 951274213), i = e ^ Math.imul(i ^ a, 2716044179);
3898
4014
  return e = Math.imul(s ^ e >>> 18, 597399067), t = Math.imul(i ^ t >>> 22, 2869860233), s = Math.imul(e ^ s >>> 17, 951274213), i = Math.imul(t ^ i >>> 19, 2716044179), e ^= t ^ s ^ i, t ^= e, s ^= e, i ^= e, [e >>> 0, t >>> 0, s >>> 0, i >>> 0];
3899
- }, We = (r, e, t, s) => function() {
4015
+ }, ke = (r, e, t, s) => function() {
3900
4016
  r |= 0, e |= 0, t |= 0, s |= 0;
3901
4017
  const i = (r + e | 0) + s | 0;
3902
4018
  return s = s + 1 | 0, r = e ^ e >>> 9, e = t + (t << 3) | 0, t = t << 21 | t >>> 11, t = t + i | 0, (i >>> 0) / 4294967296;
3903
- }, Jt = (r) => {
4019
+ }, v = Object.freeze({
4020
+ seed: "HTMLGraph is awesome",
4021
+ maxTimeDeltaSec: 0.01,
4022
+ nodeCharge: 1e5,
4023
+ nodeMass: 1,
4024
+ edgeEquilibriumLength: 300,
4025
+ edgeStiffness: 1e3,
4026
+ dtSec: 0.01,
4027
+ maxIterations: 1e3,
4028
+ convergenceVelocity: 10,
4029
+ maxForce: 1e7,
4030
+ nodeForceCoefficient: 1,
4031
+ barnesHutAreaRadiusThreshold: 0.01,
4032
+ barnesHutTheta: 1
4033
+ }), or = (r) => {
3904
4034
  var e, t;
3905
4035
  switch (r == null ? void 0 : r.type) {
3906
4036
  case "custom":
3907
4037
  return r.instance;
3908
4038
  default: {
3909
- const s = Oe((r == null ? void 0 : r.seed) ?? v.seed), i = We(s[0], s[1], s[2], s[3]);
3910
- return new qt({
4039
+ const s = ze((r == null ? void 0 : r.seed) ?? v.seed), i = ke(s[0], s[1], s[2], s[3]);
4040
+ return new sr({
3911
4041
  rand: i,
3912
4042
  maxTimeDeltaSec: (r == null ? void 0 : r.maxTimeDeltaSec) ?? v.maxTimeDeltaSec,
3913
4043
  nodeCharge: (r == null ? void 0 : r.nodeCharge) ?? v.nodeCharge,
@@ -3922,26 +4052,50 @@ const Oe = (r) => {
3922
4052
  });
3923
4053
  }
3924
4054
  }
3925
- }, _t = {
3926
- staticNodeResolver: () => !1
3927
- }, er = (r) => ({
3928
- algorithm: Jt((r == null ? void 0 : r.algorithm) ?? {}),
3929
- staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? _t.staticNodeResolver
3930
- }), tr = (r) => r instanceof j ? {
4055
+ }, G = {
4056
+ staticNodeResolver: () => !1,
4057
+ onBeforeApplied: () => {
4058
+ },
4059
+ onAfterApplied: () => {
4060
+ }
4061
+ }, ir = (r) => {
4062
+ var t, s;
4063
+ return {
4064
+ algorithm: or((r == null ? void 0 : r.algorithm) ?? {}),
4065
+ staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? G.staticNodeResolver,
4066
+ onBeforeApplied: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeApplied) ?? G.onBeforeApplied,
4067
+ onAfterApplied: ((s = r == null ? void 0 : r.events) == null ? void 0 : s.onAfterApplied) ?? G.onAfterApplied
4068
+ };
4069
+ }, nr = (r) => r instanceof K ? {
3931
4070
  type: "manual",
3932
4071
  trigger: r
3933
4072
  } : (r == null ? void 0 : r.type) === "topologyChangeMacrotask" ? {
3934
4073
  type: "topologyChangeMacrotask"
3935
4074
  } : {
3936
4075
  type: "topologyChangeMicrotask"
3937
- }, rr = (r) => {
4076
+ }, F = Object.freeze({
4077
+ staticNodeResolver: () => !1,
4078
+ onBeforeApplied: () => {
4079
+ },
4080
+ onAfterApplied: () => {
4081
+ },
4082
+ hierarchicalLayout: {
4083
+ layerWidth: 300,
4084
+ layerSpace: 300
4085
+ }
4086
+ }), ar = (r) => {
3938
4087
  var e, t;
3939
4088
  switch (r == null ? void 0 : r.type) {
3940
4089
  case "custom":
3941
4090
  return r.instance;
4091
+ case "hierarchical":
4092
+ return new rr({
4093
+ layerWidth: r.layerWidth ?? F.hierarchicalLayout.layerWidth,
4094
+ layerSpace: r.layerSpace ?? F.hierarchicalLayout.layerSpace
4095
+ });
3942
4096
  default: {
3943
- const s = Oe((r == null ? void 0 : r.seed) ?? v.seed), i = We(s[0], s[1], s[2], s[3]);
3944
- return new Zt({
4097
+ const s = ze((r == null ? void 0 : r.seed) ?? v.seed), i = ke(s[0], s[1], s[2], s[3]);
4098
+ return new Jt({
3945
4099
  dtSec: (r == null ? void 0 : r.dtSec) ?? v.dtSec,
3946
4100
  maxIterations: (r == null ? void 0 : r.maxIterations) ?? v.maxIterations,
3947
4101
  rand: i,
@@ -3957,13 +4111,16 @@ const Oe = (r) => {
3957
4111
  });
3958
4112
  }
3959
4113
  }
3960
- }, sr = {
3961
- staticNodeResolver: () => !1
3962
- }, or = (r) => ({
3963
- algorithm: rr(r == null ? void 0 : r.algorithm),
3964
- applyOn: tr(r == null ? void 0 : r.applyOn),
3965
- staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? sr.staticNodeResolver
3966
- }), ir = (r, e) => ({
4114
+ }, hr = (r) => {
4115
+ var e, t;
4116
+ return {
4117
+ algorithm: ar(r == null ? void 0 : r.algorithm),
4118
+ applyOn: nr(r == null ? void 0 : r.applyOn),
4119
+ staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? F.staticNodeResolver,
4120
+ onBeforeApplied: ((e = r == null ? void 0 : r.events) == null ? void 0 : e.onBeforeApplied) ?? F.onBeforeApplied,
4121
+ onAfterApplied: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onAfterApplied) ?? F.onAfterApplied
4122
+ };
4123
+ }, dr = (r, e) => ({
3967
4124
  ...r,
3968
4125
  onNodeDragStarted: (t) => {
3969
4126
  e.add(t), r.onNodeDragStarted(t);
@@ -3971,17 +4128,17 @@ const Oe = (r) => {
3971
4128
  onNodeDragFinished: (t) => {
3972
4129
  e.delete(t), r.onNodeDragFinished(t);
3973
4130
  }
3974
- }), nr = (r, e) => {
4131
+ }), cr = (r, e) => {
3975
4132
  r.onBeforeNodeRemoved.subscribe((t) => {
3976
4133
  e.delete(t);
3977
4134
  }), r.onBeforeClear.subscribe(() => {
3978
4135
  e.clear();
3979
4136
  });
3980
- }, ar = (r, e) => ({
4137
+ }, lr = (r, e) => ({
3981
4138
  ...r,
3982
4139
  staticNodeResolver: (t) => r.staticNodeResolver(t) || e.has(t)
3983
4140
  });
3984
- class cr {
4141
+ class pr {
3985
4142
  constructor(e) {
3986
4143
  o(this, "used", !1);
3987
4144
  o(this, "canvasDefaults", {});
@@ -4001,14 +4158,14 @@ class cr {
4001
4158
  o(this, "hasUserDraggableEdges", !1);
4002
4159
  o(this, "hasAnimatedLayout", !1);
4003
4160
  o(this, "hasLayout", !1);
4004
- o(this, "boxRenderingTrigger", new j());
4161
+ o(this, "boxRenderingTrigger", new K());
4005
4162
  o(this, "graphStore");
4006
4163
  o(this, "viewportStore");
4007
4164
  o(this, "graph");
4008
4165
  o(this, "viewport");
4009
4166
  o(this, "window", window);
4010
4167
  o(this, "animationStaticNodes", /* @__PURE__ */ new Set());
4011
- this.element = e, this.viewportStore = new Ze(this.element), this.viewport = new Re(this.viewportStore), this.graphStore = new Ae(), this.graph = new Le(this.graphStore);
4168
+ this.element = e, this.viewportStore = new Je(this.element), this.viewport = new Fe(this.viewportStore), this.graphStore = new xe(), this.graph = new Ve(this.graphStore);
4012
4169
  }
4013
4170
  /**
4014
4171
  * specifies default values for graph entities
@@ -4076,9 +4233,9 @@ class cr {
4076
4233
  */
4077
4234
  build() {
4078
4235
  if (this.used)
4079
- throw new Yt("CanvasBuilder is a single use object");
4236
+ throw new jt("CanvasBuilder is a single use object");
4080
4237
  this.used = !0;
4081
- const e = new Mt(this.element), t = this.createHtmlView(e.main), s = Vt(this.canvasDefaults), i = new ve(
4238
+ const e = new Lt(this.element), t = this.createHtmlView(e.main), s = It(this.canvasDefaults), i = new Ee(
4082
4239
  this.graph,
4083
4240
  this.viewport,
4084
4241
  this.graphStore,
@@ -4086,16 +4243,16 @@ class cr {
4086
4243
  t,
4087
4244
  s
4088
4245
  );
4089
- if (this.hasBackground && _.configure(
4246
+ if (this.hasBackground && te.configure(
4090
4247
  i,
4091
- Wt(this.backgroundConfig),
4248
+ kt(this.backgroundConfig),
4092
4249
  e.background
4093
- ), this.hasNodeResizeReactiveEdges && K.configure(i), this.hasDraggableNodes) {
4094
- let a = Ft(this.dragConfig);
4095
- this.hasAnimatedLayout && (a = ir(
4250
+ ), this.hasNodeResizeReactiveEdges && Q.configure(i), this.hasDraggableNodes) {
4251
+ let a = Bt(this.dragConfig);
4252
+ this.hasAnimatedLayout && (a = dr(
4096
4253
  a,
4097
4254
  this.animationStaticNodes
4098
- )), q.configure(
4255
+ )), _.configure(
4099
4256
  i,
4100
4257
  e.main,
4101
4258
  this.window,
@@ -4103,12 +4260,12 @@ class cr {
4103
4260
  );
4104
4261
  }
4105
4262
  if (this.hasUserConnectablePorts) {
4106
- const a = zt(
4263
+ const a = Ht(
4107
4264
  this.connectablePortsConfig,
4108
4265
  s.edges.shapeFactory,
4109
4266
  s.ports.direction
4110
4267
  );
4111
- ee.configure(
4268
+ re.configure(
4112
4269
  i,
4113
4270
  e.overlayConnectablePorts,
4114
4271
  this.viewportStore,
@@ -4117,11 +4274,11 @@ class cr {
4117
4274
  );
4118
4275
  }
4119
4276
  if (this.hasUserDraggableEdges) {
4120
- const a = kt(
4277
+ const a = Xt(
4121
4278
  this.draggableEdgesConfig,
4122
4279
  i.graph
4123
4280
  );
4124
- te.configure(
4281
+ se.configure(
4125
4282
  i,
4126
4283
  e.overlayDraggableEdges,
4127
4284
  this.viewportStore,
@@ -4129,32 +4286,32 @@ class cr {
4129
4286
  a
4130
4287
  );
4131
4288
  }
4132
- if (this.virtualScrollConfig !== void 0 ? J.configure(
4289
+ if (this.virtualScrollConfig !== void 0 ? ee.configure(
4133
4290
  i,
4134
4291
  e.main,
4135
4292
  this.window,
4136
- fe(this.transformConfig),
4293
+ ve(this.transformConfig),
4137
4294
  this.boxRenderingTrigger,
4138
- Ht(this.virtualScrollConfig)
4139
- ) : this.hasTransformableViewport && H.configure(
4295
+ Yt(this.virtualScrollConfig)
4296
+ ) : this.hasTransformableViewport && X.configure(
4140
4297
  i,
4141
4298
  e.main,
4142
4299
  this.window,
4143
- fe(this.transformConfig)
4144
- ), this.hasLayout && Tt.configure(
4300
+ ve(this.transformConfig)
4301
+ ), this.hasLayout && Dt.configure(
4145
4302
  i,
4146
- or(this.layoutConfig)
4303
+ hr(this.layoutConfig)
4147
4304
  ), this.hasAnimatedLayout) {
4148
- let a = er(
4305
+ let a = ir(
4149
4306
  this.animatedLayoutConfig
4150
4307
  );
4151
- this.hasDraggableNodes && (nr(
4308
+ this.hasDraggableNodes && (cr(
4152
4309
  i.graph,
4153
4310
  this.animationStaticNodes
4154
- ), a = ar(
4311
+ ), a = lr(
4155
4312
  a,
4156
4313
  this.animationStaticNodes
4157
- )), se.configure(i, a, this.window);
4314
+ )), ie.configure(i, a, this.window);
4158
4315
  }
4159
4316
  const n = () => {
4160
4317
  e.destroy(), i.onBeforeDestroy.unsubscribe(n);
@@ -4162,31 +4319,31 @@ class cr {
4162
4319
  return i.onBeforeDestroy.subscribe(n), i;
4163
4320
  }
4164
4321
  createHtmlView(e) {
4165
- let t = new me(
4322
+ let t = new Ae(
4166
4323
  this.graphStore,
4167
4324
  this.viewportStore,
4168
4325
  e
4169
4326
  );
4170
- return this.virtualScrollConfig !== void 0 && (t = new je(
4327
+ return this.virtualScrollConfig !== void 0 && (t = new Ke(
4171
4328
  t,
4172
4329
  this.graphStore,
4173
4330
  this.boxRenderingTrigger,
4174
- Xt(this.virtualScrollConfig)
4175
- )), new Ke(t, this.graphStore);
4331
+ Gt(this.virtualScrollConfig)
4332
+ )), new Qe(t, this.graphStore);
4176
4333
  }
4177
4334
  }
4178
4335
  export {
4179
- ut as BezierEdgeShape,
4180
- cr as CanvasBuilder,
4181
- Yt as CanvasBuilderError,
4336
+ wt as BezierEdgeShape,
4337
+ pr as CanvasBuilder,
4338
+ jt as CanvasBuilderError,
4182
4339
  A as CanvasError,
4183
4340
  M as ConnectionCategory,
4184
- De as DirectEdgeShape,
4185
- j as EventSubject,
4186
- pt as HorizontalEdgeShape,
4187
- vt as InteractiveEdgeError,
4188
- Me as InteractiveEdgeShape,
4189
- dr as MidpointEdgeShape,
4190
- wt as StraightEdgeShape,
4191
- yt as VerticalEdgeShape
4341
+ Re as DirectEdgeShape,
4342
+ K as EventSubject,
4343
+ ft as HorizontalEdgeShape,
4344
+ Et as InteractiveEdgeError,
4345
+ Le as InteractiveEdgeShape,
4346
+ ur as MidpointEdgeShape,
4347
+ yt as StraightEdgeShape,
4348
+ mt as VerticalEdgeShape
4192
4349
  };