@html-graph/html-graph 3.11.0 → 3.11.1

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,13 +1,13 @@
1
- var fe = Object.defineProperty;
2
- var ve = (r, e, t) => e in r ? fe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var o = (r, e, t) => ve(r, typeof e != "symbol" ? e + "" : e, t);
4
- const ye = () => {
1
+ var ve = Object.defineProperty;
2
+ var ye = (r, e, t) => e in r ? ve(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var o = (r, e, t) => ye(r, typeof e != "symbol" ? e + "" : e, t);
4
+ const me = () => {
5
5
  const r = document.createElement("div");
6
6
  return r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.width = "0", r.style.height = "0", r;
7
- }, me = () => {
7
+ }, Ae = () => {
8
8
  const r = document.createElement("div");
9
9
  return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r.style.overflow = "hidden", r;
10
- }, Ae = (r) => {
10
+ }, Ee = (r) => {
11
11
  r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.visibility = "hidden";
12
12
  }, D = (r, e) => ({
13
13
  x: r.scale * e.x + r.x,
@@ -15,8 +15,8 @@ const ye = () => {
15
15
  });
16
16
  class ne {
17
17
  constructor(e, t, s) {
18
- o(this, "host", me());
19
- o(this, "container", ye());
18
+ o(this, "host", Ae());
19
+ o(this, "container", me());
20
20
  o(this, "edgeIdToElementMap", /* @__PURE__ */ new Map());
21
21
  o(this, "applyTransform", () => {
22
22
  const e = this.viewportStore.getContentMatrix();
@@ -26,7 +26,7 @@ class ne {
26
26
  }
27
27
  attachNode(e) {
28
28
  const t = this.graphStore.getNode(e);
29
- Ae(t.element), this.container.appendChild(t.element), this.updateNodePosition(e), this.updateNodePriority(e), t.element.style.visibility = "visible";
29
+ Ee(t.element), this.container.appendChild(t.element), this.updateNodePosition(e), this.updateNodePriority(e), t.element.style.visibility = "visible";
30
30
  }
31
31
  detachNode(e) {
32
32
  const t = this.graphStore.getNode(e);
@@ -100,7 +100,7 @@ class ne {
100
100
  };
101
101
  }
102
102
  }
103
- class Ee {
103
+ class xe {
104
104
  constructor(e) {
105
105
  o(this, "xFrom", 1 / 0);
106
106
  o(this, "yFrom", 1 / 0);
@@ -120,7 +120,7 @@ class Ee {
120
120
  return a <= this.xTo && d >= this.xFrom && c <= this.yTo && g >= this.yFrom;
121
121
  }
122
122
  }
123
- class xe {
123
+ class Se {
124
124
  constructor(e, t, s) {
125
125
  o(this, "attachedNodes", /* @__PURE__ */ new Set());
126
126
  o(this, "attachedEdges", /* @__PURE__ */ new Set());
@@ -144,7 +144,7 @@ class xe {
144
144
  this.handleAttachEdge(h);
145
145
  });
146
146
  });
147
- this.htmlView = e, this.graphStore = t, this.trigger = s, this.renderingBox = new Ee(this.graphStore), this.trigger.subscribe(this.updateViewport);
147
+ this.htmlView = e, this.graphStore = t, this.trigger = s, this.renderingBox = new xe(this.graphStore), this.trigger.subscribe(this.updateViewport);
148
148
  }
149
149
  attachNode(e) {
150
150
  this.renderingBox.hasNode(e) && this.handleAttachNode(e);
@@ -218,7 +218,7 @@ const E = () => {
218
218
  const r = new he();
219
219
  return [r, r];
220
220
  };
221
- class Se {
221
+ class be {
222
222
  constructor(e) {
223
223
  o(this, "onBeforeUpdated");
224
224
  o(this, "onAfterUpdated");
@@ -231,7 +231,7 @@ class Se {
231
231
  return { ...this.viewportStore.getContentMatrix() };
232
232
  }
233
233
  }
234
- class be {
234
+ class Te {
235
235
  constructor(e) {
236
236
  o(this, "onAfterNodeAdded");
237
237
  o(this, "onAfterNodeUpdated");
@@ -342,7 +342,7 @@ class $ {
342
342
  this.counter = 0;
343
343
  }
344
344
  }
345
- class x extends Error {
345
+ class S extends Error {
346
346
  constructor() {
347
347
  super(...arguments);
348
348
  o(this, "name", "HtmlGraphError");
@@ -416,7 +416,7 @@ class ae {
416
416
  * emits event just before destruction of canvas
417
417
  */
418
418
  o(this, "onBeforeDestroy");
419
- this.element = e, this.graphStore = t, this.viewportStore = s, this.htmlView = i, this.defaults = n, this.graph = new be(this.graphStore), this.viewport = new Se(this.viewportStore), this.graphStore.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.graphStore.onAfterNodeUpdated.subscribe(this.onAfterNodeUpdated), this.graphStore.onAfterNodePriorityUpdated.subscribe(
419
+ this.element = e, this.graphStore = t, this.viewportStore = s, this.htmlView = i, this.defaults = n, this.graph = new Te(this.graphStore), this.viewport = new be(this.viewportStore), this.graphStore.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.graphStore.onAfterNodeUpdated.subscribe(this.onAfterNodeUpdated), this.graphStore.onAfterNodePriorityUpdated.subscribe(
420
420
  this.onAfterNodePriorityUpdated
421
421
  ), this.graphStore.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.graphStore.onAfterPortUpdated.subscribe(this.onAfterPortUpdated), this.graphStore.onBeforePortRemoved.subscribe(this.onBeforePortUnmarked), this.graphStore.onAfterEdgeAdded.subscribe(this.onAfterEdgeAdded), this.graphStore.onAfterEdgeShapeUpdated.subscribe(
422
422
  this.onAfterEdgeShapeUpdated
@@ -430,9 +430,9 @@ class ae {
430
430
  addNode(e) {
431
431
  const t = this.nodeIdGenerator.create(e.id);
432
432
  if (this.graph.getNode(t) !== null)
433
- throw new x("failed to add node with existing id");
433
+ throw new S("failed to add node with existing id");
434
434
  if (this.graphStore.getElementNodeId(e.element) !== void 0)
435
- throw new x(
435
+ throw new S(
436
436
  "failed to add node with html element already in use by another node"
437
437
  );
438
438
  if (this.graphStore.addNode({
@@ -457,7 +457,7 @@ class ae {
457
457
  */
458
458
  updateNode(e, t) {
459
459
  if (this.graph.getNode(e) === null)
460
- throw new x("failed to update non existing node");
460
+ throw new S("failed to update non existing node");
461
461
  return this.graphStore.updateNode(e, t ?? {}), this;
462
462
  }
463
463
  /**
@@ -467,7 +467,7 @@ class ae {
467
467
  */
468
468
  removeNode(e) {
469
469
  if (this.graph.getNode(e) === null)
470
- throw new x("failed to remove non existing node");
470
+ throw new S("failed to remove non existing node");
471
471
  return this.graphStore.removeNode(e), this;
472
472
  }
473
473
  /**
@@ -476,9 +476,9 @@ class ae {
476
476
  markPort(e) {
477
477
  const t = this.portIdGenerator.create(e.id);
478
478
  if (this.graph.getPort(t) !== null)
479
- throw new x("failed to add port with existing id");
479
+ throw new S("failed to add port with existing id");
480
480
  if (this.graph.getNode(e.nodeId) === null)
481
- throw new x("failed to mark port for nonexistent node");
481
+ throw new S("failed to mark port for nonexistent node");
482
482
  return this.graphStore.addPort({
483
483
  id: t,
484
484
  element: e.element,
@@ -491,7 +491,7 @@ class ae {
491
491
  */
492
492
  updatePort(e, t) {
493
493
  if (this.graph.getPort(e) === null)
494
- throw new x("failed to update nonexistent port");
494
+ throw new S("failed to update nonexistent port");
495
495
  return this.graphStore.updatePort(e, t ?? {}), this;
496
496
  }
497
497
  /**
@@ -500,7 +500,7 @@ class ae {
500
500
  */
501
501
  unmarkPort(e) {
502
502
  if (this.graph.getPort(e) === null)
503
- throw new x("failed to unmark non existing port");
503
+ throw new S("failed to unmark non existing port");
504
504
  return this.graphStore.removePort(e), this;
505
505
  }
506
506
  /**
@@ -509,11 +509,11 @@ class ae {
509
509
  addEdge(e) {
510
510
  const t = this.edgeIdGenerator.create(e.id);
511
511
  if (this.graph.getEdge(t) !== null)
512
- throw new x("failed to add edge with existing id");
512
+ throw new S("failed to add edge with existing id");
513
513
  if (this.graph.getPort(e.from) === null)
514
- throw new x("failed to add edge from nonexistent port");
514
+ throw new S("failed to add edge from nonexistent port");
515
515
  if (this.graph.getPort(e.to) === null)
516
- throw new x("failed to add edge to nonexistent port");
516
+ throw new S("failed to add edge to nonexistent port");
517
517
  return this.graphStore.addEdge({
518
518
  id: t,
519
519
  from: e.from,
@@ -527,7 +527,7 @@ class ae {
527
527
  */
528
528
  updateEdge(e, t) {
529
529
  if (this.graph.getEdge(e) === null)
530
- throw new x("failed to update nonexistent edge");
530
+ throw new S("failed to update nonexistent edge");
531
531
  return this.graphStore.updateEdge(e, t ?? {}), this;
532
532
  }
533
533
  /**
@@ -535,7 +535,7 @@ class ae {
535
535
  */
536
536
  removeEdge(e) {
537
537
  if (this.graph.getEdge(e) === null)
538
- throw new x("failed to remove nonexistent edge");
538
+ throw new S("failed to remove nonexistent edge");
539
539
  return this.graphStore.removeEdge(e), this;
540
540
  }
541
541
  /**
@@ -571,7 +571,7 @@ class ae {
571
571
  ), this.graphStore.onBeforeEdgeRemoved.unsubscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.unsubscribe(this.onBeforeClear), this.htmlView.destroy();
572
572
  }
573
573
  }
574
- class Te {
574
+ class Pe {
575
575
  constructor() {
576
576
  o(this, "singleToMultiMap", /* @__PURE__ */ new Map());
577
577
  o(this, "multiToSingleMap", /* @__PURE__ */ new Map());
@@ -620,7 +620,7 @@ class de {
620
620
  o(this, "incomingEdges", /* @__PURE__ */ new Map());
621
621
  o(this, "outcomingEdges", /* @__PURE__ */ new Map());
622
622
  o(this, "cycleEdges", /* @__PURE__ */ new Map());
623
- o(this, "elementPorts", new Te());
623
+ o(this, "elementPorts", new Pe());
624
624
  o(this, "afterNodeAddedEmitter");
625
625
  o(this, "onAfterNodeAdded");
626
626
  o(this, "afterNodeUpdatedEmitter");
@@ -802,7 +802,7 @@ const q = (r) => ({
802
802
  x: 0,
803
803
  y: 0
804
804
  };
805
- class Pe {
805
+ class De {
806
806
  constructor() {
807
807
  o(this, "viewportMatrix", ee);
808
808
  o(this, "contentMatrix", ee);
@@ -866,11 +866,11 @@ class k {
866
866
  this.canvas.updateNode(t);
867
867
  }
868
868
  }
869
- const De = (r) => {
870
- var v, p, f, A, m, S;
869
+ const Ne = (r) => {
870
+ var v, p, f, A, m, x;
871
871
  const e = ((v = r == null ? void 0 : r.events) == null ? void 0 : v.onNodeDrag) ?? (() => {
872
872
  }), t = ((p = r == null ? void 0 : r.events) == null ? void 0 : p.onBeforeNodeDrag) ?? (() => !0), s = ((f = r == null ? void 0 : r.events) == null ? void 0 : f.onNodeDragFinished) ?? (() => {
873
- }), i = (r == null ? void 0 : r.moveOnTop) !== !1, n = (r == null ? void 0 : r.moveEdgesOnTop) !== !1 && i, h = (A = r == null ? void 0 : r.mouse) == null ? void 0 : A.dragCursor, a = h !== void 0 ? h : "grab", d = (m = r == null ? void 0 : r.mouse) == null ? void 0 : m.mouseDownEventVerifier, c = d !== void 0 ? d : (b) => b.button === 0, g = (S = r == null ? void 0 : r.mouse) == null ? void 0 : S.mouseUpEventVerifier;
873
+ }), i = (r == null ? void 0 : r.moveOnTop) !== !1, n = (r == null ? void 0 : r.moveEdgesOnTop) !== !1 && i, h = (A = r == null ? void 0 : r.mouse) == null ? void 0 : A.dragCursor, a = h !== void 0 ? h : "grab", d = (m = r == null ? void 0 : r.mouse) == null ? void 0 : m.mouseDownEventVerifier, c = d !== void 0 ? d : (b) => b.button === 0, g = (x = r == null ? void 0 : r.mouse) == null ? void 0 : x.mouseUpEventVerifier;
874
874
  return {
875
875
  moveOnTop: i,
876
876
  moveEdgesOnTop: n,
@@ -881,10 +881,10 @@ const De = (r) => {
881
881
  onBeforeNodeDrag: t,
882
882
  onNodeDragFinished: s
883
883
  };
884
- }, Ne = (r, e, t) => {
884
+ }, Me = (r, e, t) => {
885
885
  const { x: s, y: i, width: n, height: h } = r.getBoundingClientRect();
886
886
  return e >= s && e <= s + n && t >= i && t <= i + h;
887
- }, Me = (r, e, t) => e >= 0 && e <= r.innerWidth && t >= 0 && t <= r.innerHeight, N = (r, e, t, s) => Ne(e, t, s) && Me(r, t, s), B = (r, e) => {
887
+ }, Le = (r, e, t) => e >= 0 && e <= r.innerWidth && t >= 0 && t <= r.innerHeight, N = (r, e, t, s) => Me(e, t, s) && Le(r, t, s), B = (r, e) => {
888
888
  e !== null ? r.style.cursor = e : r.style.removeProperty("cursor");
889
889
  };
890
890
  class z {
@@ -994,7 +994,7 @@ class z {
994
994
  this.previousTouchCoordinates = null, this.cancelTouchDrag();
995
995
  });
996
996
  o(this, "config");
997
- this.canvas = e, this.element = t, this.window = s, this.config = De(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);
997
+ this.canvas = e, this.element = t, this.window = s, this.config = Ne(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);
998
998
  }
999
999
  static configure(e, t, s, i) {
1000
1000
  new z(e, t, s, i);
@@ -1058,7 +1058,7 @@ class z {
1058
1058
  this.maxNodePriority = Math.max(this.maxNodePriority, t);
1059
1059
  }
1060
1060
  }
1061
- const Le = (r) => {
1061
+ const Re = (r) => {
1062
1062
  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;
1063
1063
  return (n) => {
1064
1064
  let h = n.nextTransform.x, a = n.nextTransform.y;
@@ -1068,7 +1068,7 @@ const Le = (r) => {
1068
1068
  const g = n.canvasHeight * n.prevTransform.scale, l = i - g;
1069
1069
  return a > l && a > n.prevTransform.y && (a = Math.max(n.prevTransform.y, l)), { scale: n.nextTransform.scale, x: h, y: a };
1070
1070
  };
1071
- }, Re = (r) => {
1071
+ }, Ie = (r) => {
1072
1072
  const e = r.maxContentScale, t = r.minContentScale, s = e !== null ? 1 / e : 0, i = t !== null ? 1 / t : 1 / 0;
1073
1073
  return (n) => {
1074
1074
  const h = n.prevTransform, a = n.nextTransform;
@@ -1089,7 +1089,7 @@ const Le = (r) => {
1089
1089
  y: g
1090
1090
  };
1091
1091
  };
1092
- }, Ie = (r) => (e) => r.reduce(
1092
+ }, Be = (r) => (e) => r.reduce(
1093
1093
  (t, s) => s({
1094
1094
  prevTransform: e.prevTransform,
1095
1095
  nextTransform: t,
@@ -1102,29 +1102,29 @@ const Le = (r) => {
1102
1102
  return r;
1103
1103
  switch (r.type) {
1104
1104
  case "scale-limit":
1105
- return Re({
1105
+ return Ie({
1106
1106
  minContentScale: r.minContentScale ?? 0,
1107
1107
  maxContentScale: r.maxContentScale ?? 1 / 0
1108
1108
  });
1109
1109
  case "shift-limit":
1110
- return Le({
1110
+ return Re({
1111
1111
  minX: r.minX ?? -1 / 0,
1112
1112
  maxX: r.maxX ?? 1 / 0,
1113
1113
  minY: r.minY ?? -1 / 0,
1114
1114
  maxY: r.maxY ?? 1 / 0
1115
1115
  });
1116
1116
  }
1117
- }, Be = (r) => {
1118
- var f, A, m, S, b, T, M, L, J, K, Q, _;
1117
+ }, Ve = (r) => {
1118
+ var f, A, m, x, b, T, M, L, J, K, Q, _;
1119
1119
  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;
1120
1120
  let i;
1121
- s !== void 0 ? Array.isArray(s) ? i = Ie(
1121
+ s !== void 0 ? Array.isArray(s) ? i = Be(
1122
1122
  s.map(
1123
1123
  (P) => te(P)
1124
1124
  )
1125
1125
  ) : i = te(s) : i = (P) => P.nextTransform;
1126
1126
  const n = ((A = r == null ? void 0 : r.shift) == null ? void 0 : A.cursor) !== void 0 ? r.shift.cursor : "grab", h = ((m = r == null ? void 0 : r.events) == null ? void 0 : m.onBeforeTransformChange) ?? (() => {
1127
- }), a = ((S = r == null ? void 0 : r.events) == null ? void 0 : S.onTransformChange) ?? (() => {
1127
+ }), a = ((x = r == null ? void 0 : r.events) == null ? void 0 : x.onTransformChange) ?? (() => {
1128
1128
  }), d = (b = r == null ? void 0 : r.shift) == null ? void 0 : b.mouseDownEventVerifier, c = d !== void 0 ? d : (P) => P.button === 0, g = (T = r == null ? void 0 : r.shift) == null ? void 0 : T.mouseUpEventVerifier, l = g !== void 0 ? g : (P) => P.button === 0, v = (M = r == null ? void 0 : r.scale) == null ? void 0 : M.mouseWheelEventVerifier, p = v !== void 0 ? v : () => !0;
1129
1129
  return {
1130
1130
  wheelSensitivity: t,
@@ -1145,7 +1145,7 @@ const Le = (r) => {
1145
1145
  onResizeTransformFinished: ((_ = r == null ? void 0 : r.events) == null ? void 0 : _.onResizeTransformFinished) ?? (() => {
1146
1146
  })
1147
1147
  };
1148
- }, Ve = (r, e, t) => ({
1148
+ }, Ce = (r, e, t) => ({
1149
1149
  scale: r.scale,
1150
1150
  x: r.x + r.scale * e,
1151
1151
  y: r.y + r.scale * t
@@ -1172,7 +1172,7 @@ const Le = (r) => {
1172
1172
  touches: e
1173
1173
  };
1174
1174
  };
1175
- class U {
1175
+ class C {
1176
1176
  constructor(e, t, s, i) {
1177
1177
  o(this, "viewport");
1178
1178
  o(this, "prevTouches", null);
@@ -1261,7 +1261,7 @@ class U {
1261
1261
  });
1262
1262
  this.canvas = e, this.element = t, this.window = s, this.element.addEventListener("wheel", this.preventWheelScaleListener, {
1263
1263
  passive: !1
1264
- }), this.config = Be(i), this.viewport = e.viewport, this.observer.observe(this.element), this.element.addEventListener("mousedown", this.onMouseDown, {
1264
+ }), this.config = Ve(i), this.viewport = e.viewport, this.observer.observe(this.element), this.element.addEventListener("mousedown", this.onMouseDown, {
1265
1265
  passive: !0
1266
1266
  }), this.element.addEventListener("wheel", this.onWheelScroll, {
1267
1267
  passive: !0
@@ -1270,7 +1270,7 @@ class U {
1270
1270
  }), e.onBeforeDestroy.subscribe(this.onBeforeDestroy);
1271
1271
  }
1272
1272
  static configure(e, t, s, i) {
1273
- new U(
1273
+ new C(
1274
1274
  e,
1275
1275
  t,
1276
1276
  s,
@@ -1278,7 +1278,7 @@ class U {
1278
1278
  );
1279
1279
  }
1280
1280
  moveViewport(e, t) {
1281
- const s = this.viewport.getViewportMatrix(), i = Ve(s, e, t), { width: n, height: h } = this.element.getBoundingClientRect(), a = this.config.transformPreprocessor({
1281
+ const s = this.viewport.getViewportMatrix(), i = Ce(s, e, t), { width: n, height: h } = this.element.getBoundingClientRect(), a = this.config.transformPreprocessor({
1282
1282
  prevTransform: s,
1283
1283
  nextTransform: i,
1284
1284
  canvasWidth: n,
@@ -1349,7 +1349,7 @@ class X {
1349
1349
  this.userTransformInProgress || (this.viewportMatrix = this.viewport.getViewportMatrix(), this.loadAreaAroundViewport());
1350
1350
  });
1351
1351
  o(this, "userTransformInProgress", !1);
1352
- var p, f, A, m, S;
1352
+ var p, f, A, m, x;
1353
1353
  this.canvas = e, this.element = t, this.window = s, this.trigger = n, this.virtualScrollOptions = h, this.nodeHorizontal = this.virtualScrollOptions.nodeContainingRadius.horizontal, this.nodeVertical = this.virtualScrollOptions.nodeContainingRadius.vertical, this.canvasResizeObserver = new ResizeObserver((b) => {
1354
1354
  const T = b[0];
1355
1355
  this.viewportWidth = T.contentRect.width, this.viewportHeight = T.contentRect.height, this.scheduleLoadAreaAroundViewport();
@@ -1358,7 +1358,7 @@ class X {
1358
1358
  }), d = ((f = i == null ? void 0 : i.events) == null ? void 0 : f.onResizeTransformFinished) ?? (() => {
1359
1359
  }), c = ((A = i == null ? void 0 : i.events) == null ? void 0 : A.onTransformChange) ?? (() => {
1360
1360
  }), g = ((m = i == null ? void 0 : i.events) == null ? void 0 : m.onBeforeTransformChange) ?? (() => {
1361
- }), l = ((S = i == null ? void 0 : i.events) == null ? void 0 : S.onTransformFinished) ?? (() => {
1361
+ }), l = ((x = i == null ? void 0 : i.events) == null ? void 0 : x.onTransformFinished) ?? (() => {
1362
1362
  }), v = {
1363
1363
  ...i,
1364
1364
  events: {
@@ -1382,7 +1382,7 @@ class X {
1382
1382
  }
1383
1383
  }
1384
1384
  };
1385
- U.configure(
1385
+ C.configure(
1386
1386
  e,
1387
1387
  this.element,
1388
1388
  this.window,
@@ -1413,29 +1413,29 @@ class X {
1413
1413
  this.trigger.emit({ x: s, y: i, width: n, height: h });
1414
1414
  }
1415
1415
  }
1416
- const Ce = () => {
1416
+ const $e = () => {
1417
1417
  const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1418
1418
  return r.style.position = "absolute", r.style.inset = "0", r;
1419
- }, $e = () => {
1419
+ }, We = () => {
1420
1420
  const r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
1421
1421
  return r.setAttribute("fill", "url(#pattern)"), r;
1422
- }, We = () => {
1422
+ }, Fe = () => {
1423
1423
  const r = document.createElementNS(
1424
1424
  "http://www.w3.org/2000/svg",
1425
1425
  "pattern"
1426
1426
  );
1427
1427
  return r.setAttribute("id", "pattern"), r;
1428
- }, Fe = (r, e) => {
1428
+ }, Oe = (r, e) => {
1429
1429
  const t = document.createElementNS(
1430
1430
  "http://www.w3.org/2000/svg",
1431
1431
  "circle"
1432
1432
  );
1433
1433
  return t.setAttribute("cx", "0"), t.setAttribute("cy", "0"), t.setAttribute("r", `${r}`), t.setAttribute("fill", `${e}`), t;
1434
- }, Oe = (r) => r instanceof SVGElement ? r : Fe(
1434
+ }, ke = (r) => r instanceof SVGElement ? r : Oe(
1435
1435
  (r == null ? void 0 : r.radius) ?? 1.5,
1436
1436
  (r == null ? void 0 : r.color) ?? "#d8d8d8"
1437
- ), ke = (r) => {
1438
- const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, s = (e == null ? void 0 : e.height) ?? 25, i = Oe(r.renderer ?? {});
1437
+ ), ze = (r) => {
1438
+ const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, s = (e == null ? void 0 : e.height) ?? 25, i = ke(r.renderer ?? {});
1439
1439
  return {
1440
1440
  tileWidth: t,
1441
1441
  tileHeight: s,
@@ -1445,9 +1445,9 @@ const Ce = () => {
1445
1445
  };
1446
1446
  class Y {
1447
1447
  constructor(e, t, s) {
1448
- o(this, "svg", Ce());
1449
- o(this, "patternRenderingRectangle", $e());
1450
- o(this, "pattern", We());
1448
+ o(this, "svg", $e());
1449
+ o(this, "patternRenderingRectangle", We());
1450
+ o(this, "pattern", Fe());
1451
1451
  o(this, "patternContent");
1452
1452
  o(this, "tileWidth");
1453
1453
  o(this, "tileHeight");
@@ -1471,7 +1471,7 @@ class Y {
1471
1471
  ), this.canvas.onBeforeDestroy.unsubscribe(this.onBeforeDestroy);
1472
1472
  });
1473
1473
  this.canvas = e, this.host = s;
1474
- const i = ke(t);
1474
+ const i = ze(t);
1475
1475
  this.tileWidth = i.tileWidth, this.tileHeight = i.tileHeight, this.halfTileWidth = this.tileWidth / 2, this.halfTileHeight = this.tileHeight / 2, this.patternContent = i.renderer, this.maxViewportScale = i.maxViewportScale;
1476
1476
  const n = `translate(${this.halfTileWidth}, ${this.halfTileHeight})`;
1477
1477
  this.patternContent.setAttribute("transform", n), this.pattern.appendChild(this.patternContent);
@@ -1486,7 +1486,7 @@ class Y {
1486
1486
  t && this.visible ? (this.visible = !1, this.host.removeChild(this.svg)) : !t && !this.visible && (this.visible = !0, this.host.appendChild(this.svg));
1487
1487
  }
1488
1488
  }
1489
- const ze = (r) => {
1489
+ const Xe = (r) => {
1490
1490
  var a, d, c;
1491
1491
  const e = () => "direct", t = (g) => g, s = (g) => g.button === 0, i = () => {
1492
1492
  }, n = () => {
@@ -1587,7 +1587,7 @@ class H {
1587
1587
  o(this, "onEdgeCreated", (e) => {
1588
1588
  this.config.onAfterEdgeCreated(e);
1589
1589
  });
1590
- this.canvas = e, this.overlayLayer = t, this.viewportStore = s, this.window = i, this.config = ze(h);
1590
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = s, this.window = i, this.config = Xe(h);
1591
1591
  const a = new de(), d = new ne(
1592
1592
  a,
1593
1593
  this.viewportStore,
@@ -1716,34 +1716,34 @@ class H {
1716
1716
  return this.config.connectionTypeResolver(t) !== null;
1717
1717
  }
1718
1718
  }
1719
- const Xe = () => {
1719
+ const Ye = () => {
1720
1720
  const r = document.createElement("div");
1721
1721
  return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r;
1722
1722
  }, W = () => {
1723
1723
  const r = document.createElement("div");
1724
1724
  return r.style.position = "absolute", r.style.inset = "0", r;
1725
1725
  };
1726
- class Ye {
1726
+ class He {
1727
1727
  constructor(e) {
1728
1728
  o(this, "background", W());
1729
1729
  o(this, "main", W());
1730
1730
  o(this, "overlay", W());
1731
- o(this, "host", Xe());
1731
+ o(this, "host", Ye());
1732
1732
  this.element = e, this.element.appendChild(this.host), this.host.appendChild(this.background), this.host.appendChild(this.main), this.overlay.style.pointerEvents = "none", this.host.appendChild(this.overlay);
1733
1733
  }
1734
1734
  destroy() {
1735
1735
  this.host.removeChild(this.background), this.host.removeChild(this.main), this.host.removeChild(this.overlay), this.element.removeChild(this.host);
1736
1736
  }
1737
1737
  }
1738
- const He = (r, e) => ({
1738
+ const je = (r, e) => ({
1739
1739
  x: r / 2,
1740
1740
  y: e / 2
1741
- }), F = (r) => () => r, re = F(0), je = () => {
1741
+ }), F = (r) => () => r, re = F(0), Ge = () => {
1742
1742
  let r = 0;
1743
1743
  return () => r++;
1744
- }, Ge = (r, e) => {
1744
+ }, Ze = (r, e) => {
1745
1745
  let t = re, s = re;
1746
- const i = je();
1746
+ const i = Ge();
1747
1747
  return r === "incremental" && (t = i), e === "incremental" && (s = i), typeof r == "number" && (t = F(r)), typeof e == "number" && (s = F(e)), typeof r == "function" && (t = r), typeof e == "function" && (s = e), {
1748
1748
  nodesPriorityFn: t,
1749
1749
  edgesPriorityFn: s
@@ -1755,7 +1755,7 @@ const He = (r, e) => ({
1755
1755
  x: 0,
1756
1756
  y: 0
1757
1757
  };
1758
- class Ze {
1758
+ class Je {
1759
1759
  constructor(e) {
1760
1760
  o(this, "path");
1761
1761
  o(this, "median");
@@ -1780,7 +1780,11 @@ class Ze {
1780
1780
  this.path = `${d}${a}${c}`;
1781
1781
  }
1782
1782
  }
1783
- class Je {
1783
+ const ce = (r, e, t, s) => ({
1784
+ x: e * r.x + (1 - e) / 2 * s.x,
1785
+ y: t * r.y + (1 - t) / 2 * s.y
1786
+ });
1787
+ class Ke {
1784
1788
  constructor(e) {
1785
1789
  o(this, "path");
1786
1790
  o(this, "median");
@@ -1810,28 +1814,29 @@ class Je {
1810
1814
  ), v = {
1811
1815
  x: l.x + a,
1812
1816
  y: l.y + d
1813
- };
1814
- this.median = { x: (g.x + v.x) / 2, y: (g.y + v.y) / 2 };
1815
- const p = {
1817
+ }, p = {
1818
+ x: (g.x + v.x) / 2,
1819
+ y: (g.y + v.y) / 2
1820
+ }, f = {
1816
1821
  x: c.x + this.params.curvature * this.params.sourceDirection.x,
1817
1822
  y: c.y + this.params.curvature * this.params.sourceDirection.y
1818
- }, f = {
1823
+ }, A = {
1819
1824
  x: l.x - this.params.curvature * this.params.targetDirection.x,
1820
1825
  y: l.y - this.params.curvature * this.params.targetDirection.y
1821
- }, A = {
1826
+ }, m = {
1822
1827
  x: c.x + a,
1823
1828
  y: c.y + d
1824
- }, m = {
1829
+ }, x = {
1825
1830
  x: l.x + a,
1826
1831
  y: l.y + d
1827
1832
  };
1828
1833
  this.path = [
1829
1834
  `M ${t.x} ${t.y}`,
1830
1835
  `L ${c.x} ${c.y}`,
1831
- `C ${p.x} ${p.y} ${A.x} ${A.y} ${this.median.x} ${this.median.y}`,
1832
- `C ${m.x} ${m.y} ${f.x} ${f.y} ${l.x} ${l.y}`,
1836
+ `C ${f.x} ${f.y} ${m.x} ${m.y} ${p.x} ${p.y}`,
1837
+ `C ${x.x} ${x.y} ${A.x} ${A.y} ${l.x} ${l.y}`,
1833
1838
  `L ${s.x} ${s.y}`
1834
- ].join(" ");
1839
+ ].join(" "), this.median = ce(p, e.flipX, e.flipY, e.to);
1835
1840
  }
1836
1841
  }
1837
1842
  const R = (r, e) => {
@@ -1846,15 +1851,15 @@ const R = (r, e) => {
1846
1851
  const L = r[d + 1];
1847
1852
  i = L.x - a.x, n = L.y - a.y, h = Math.sqrt(i * i + n * n);
1848
1853
  }
1849
- const m = h !== 0 ? Math.min((f ? e : 0) / h, d < s - 1 ? 0.5 : 1) : 0, S = f ? { x: a.x + i * m, y: a.y + n * m } : a, T = l !== 0 ? Math.min((f ? e : 0) / l, d > 1 ? 0.5 : 1) : 0, M = f ? { x: a.x + c * T, y: a.y + g * T } : a;
1854
+ const m = h !== 0 ? Math.min((f ? e : 0) / h, d < s - 1 ? 0.5 : 1) : 0, x = f ? { x: a.x + i * m, y: a.y + n * m } : a, T = l !== 0 ? Math.min((f ? e : 0) / l, d > 1 ? 0.5 : 1) : 0, M = f ? { x: a.x + c * T, y: a.y + g * T } : a;
1850
1855
  d > 0 && t.push(`L ${M.x} ${M.y}`), f && t.push(
1851
- `C ${a.x} ${a.y} ${a.x} ${a.y} ${S.x} ${S.y}`
1856
+ `C ${a.x} ${a.y} ${a.x} ${a.y} ${x.x} ${x.y}`
1852
1857
  );
1853
1858
  });
1854
1859
  }
1855
1860
  return t.join(" ");
1856
1861
  };
1857
- class Ke {
1862
+ class Qe {
1858
1863
  constructor(e) {
1859
1864
  o(this, "path");
1860
1865
  o(this, "median");
@@ -1917,14 +1922,14 @@ class j {
1917
1922
  { x: this.params.to.x - i, y: this.params.to.y },
1918
1923
  this.params.targetDirection,
1919
1924
  this.params.to
1920
- ), v = { x: l.x + d, y: l.y + c };
1921
- this.median = { x: (g.x + v.x) / 2, y: (g.y + v.y) / 2 }, this.path = R(
1925
+ ), v = { x: l.x + d, y: l.y + c }, p = { x: (g.x + v.x) / 2, y: (g.y + v.y) / 2 };
1926
+ this.median = ce(p, e.flipX, e.flipY, e.to), this.path = R(
1922
1927
  [t, n, g, v, l, s],
1923
1928
  this.params.roundness
1924
1929
  );
1925
1930
  }
1926
1931
  }
1927
- class Qe {
1932
+ class _e {
1928
1933
  constructor(e) {
1929
1934
  o(this, "path");
1930
1935
  o(this, "median");
@@ -1954,7 +1959,7 @@ class Qe {
1954
1959
  this.path = R([s, h, a, i], this.params.roundness);
1955
1960
  }
1956
1961
  }
1957
- class _e {
1962
+ class qe {
1958
1963
  constructor(e) {
1959
1964
  o(this, "path");
1960
1965
  o(this, "median");
@@ -2013,7 +2018,7 @@ class G {
2013
2018
  this.path = `${this.params.hasSourceArrow || this.params.hasTargetArrow ? "" : d}${R(a, this.params.roundness)}`, this.median = { x: (a[3].x + a[4].x) / 2, y: (a[3].y + a[4].y) / 2 };
2014
2019
  }
2015
2020
  }
2016
- class qe {
2021
+ class et {
2017
2022
  constructor(e) {
2018
2023
  o(this, "path");
2019
2024
  o(this, "median");
@@ -2034,7 +2039,7 @@ class qe {
2034
2039
  this.path = `${this.params.hasSourceArrow || this.params.hasTargetArrow ? "" : p}${v}`, this.median = l[3];
2035
2040
  }
2036
2041
  }
2037
- class et {
2042
+ class tt {
2038
2043
  constructor(e) {
2039
2044
  o(this, "path");
2040
2045
  o(this, "median");
@@ -2070,23 +2075,23 @@ class et {
2070
2075
  };
2071
2076
  }
2072
2077
  }
2073
- const ce = (r, e) => {
2078
+ const le = (r, e) => {
2074
2079
  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`;
2075
2080
  }, Z = Object.freeze({
2076
2081
  edgeColor: "--edge-color"
2077
- }), le = (r) => {
2082
+ }), ge = (r) => {
2078
2083
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
2079
2084
  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;
2080
2085
  }, V = () => {
2081
2086
  const r = document.createElementNS("http://www.w3.org/2000/svg", "path");
2082
2087
  return r.setAttribute("fill", `var(${Z.edgeColor})`), r;
2083
- }, ge = () => {
2088
+ }, ue = () => {
2084
2089
  const r = document.createElementNS("http://www.w3.org/2000/svg", "g");
2085
2090
  return r.style.transformOrigin = "50% 50%", r;
2086
- }, ue = (r) => {
2091
+ }, we = (r) => {
2087
2092
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
2088
2093
  return e.setAttribute("stroke", `var(${Z.edgeColor})`), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e;
2089
- }, we = (r, e) => {
2094
+ }, pe = (r, e) => {
2090
2095
  const t = {
2091
2096
  x: r.x + r.width / 2,
2092
2097
  y: r.y + r.height / 2
@@ -2128,23 +2133,23 @@ const ce = (r, e) => {
2128
2133
  interactiveWidth: 10,
2129
2134
  preOffset: 0
2130
2135
  }), oe = (r, e, t) => ({ x: e * Math.cos(r), y: t * Math.sin(r) });
2131
- class C {
2136
+ class U {
2132
2137
  constructor(e) {
2133
2138
  o(this, "svg");
2134
- o(this, "group", ge());
2139
+ o(this, "group", ue());
2135
2140
  o(this, "line");
2136
2141
  o(this, "sourceArrow", null);
2137
2142
  o(this, "targetArrow", null);
2138
2143
  o(this, "onAfterRender");
2139
2144
  o(this, "afterRenderEmitter");
2140
- this.params = e, [this.afterRenderEmitter, this.onAfterRender] = E(), this.svg = le(e.color), this.svg.appendChild(this.group), this.line = ue(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = V(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = V(), this.group.appendChild(this.targetArrow));
2145
+ this.params = e, [this.afterRenderEmitter, this.onAfterRender] = E(), this.svg = ge(e.color), this.svg.appendChild(this.group), this.line = we(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = V(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = V(), this.group.appendChild(this.targetArrow));
2141
2146
  }
2142
2147
  render(e) {
2143
- const { x: t, y: s, width: i, height: n, flipX: h, flipY: a } = we(
2148
+ const { x: t, y: s, width: i, height: n, flipX: h, flipY: a } = pe(
2144
2149
  e.from,
2145
2150
  e.to
2146
2151
  );
2147
- ce(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${h}, ${a})`;
2152
+ le(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${h}, ${a})`;
2148
2153
  const d = oe(
2149
2154
  e.from.direction,
2150
2155
  h,
@@ -2187,7 +2192,7 @@ class C {
2187
2192
  });
2188
2193
  }
2189
2194
  }
2190
- class tt {
2195
+ class rt {
2191
2196
  constructor(e) {
2192
2197
  o(this, "svg");
2193
2198
  o(this, "group");
@@ -2205,7 +2210,7 @@ class tt {
2205
2210
  o(this, "hasSourceArrow");
2206
2211
  o(this, "hasTargetArrow");
2207
2212
  o(this, "pathShape");
2208
- o(this, "createCyclePath", (e) => new qe({
2213
+ o(this, "createCyclePath", (e) => new et({
2209
2214
  sourceDirection: e,
2210
2215
  radius: this.portCycleRadius,
2211
2216
  smallRadius: this.portCycleSmallRadius,
@@ -2213,7 +2218,7 @@ class tt {
2213
2218
  hasSourceArrow: this.hasSourceArrow,
2214
2219
  hasTargetArrow: this.hasTargetArrow
2215
2220
  }));
2216
- o(this, "createDetourPath", (e, t, s, i, n) => new Je({
2221
+ o(this, "createDetourPath", (e, t, s, i, n) => new Ke({
2217
2222
  to: s,
2218
2223
  sourceDirection: e,
2219
2224
  targetDirection: t,
@@ -2226,7 +2231,7 @@ class tt {
2226
2231
  hasSourceArrow: this.hasSourceArrow,
2227
2232
  hasTargetArrow: this.hasTargetArrow
2228
2233
  }));
2229
- o(this, "createLinePath", (e, t, s) => new Ze({
2234
+ o(this, "createLinePath", (e, t, s) => new Je({
2230
2235
  to: s,
2231
2236
  sourceDirection: e,
2232
2237
  targetDirection: t,
@@ -2235,7 +2240,7 @@ class tt {
2235
2240
  hasSourceArrow: this.hasSourceArrow,
2236
2241
  hasTargetArrow: this.hasTargetArrow
2237
2242
  }));
2238
- this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? u.arrowLength, this.arrowWidth = (e == null ? void 0 : e.arrowWidth) ?? u.arrowWidth, this.curvature = (e == null ? void 0 : e.curvature) ?? u.curvature, this.portCycleRadius = (e == null ? void 0 : e.cycleRadius) ?? u.cycleRadius, this.portCycleSmallRadius = (e == null ? void 0 : e.smallCycleRadius) ?? u.smallCycleRadius, this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow, this.pathShape = new C({
2243
+ this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? u.arrowLength, this.arrowWidth = (e == null ? void 0 : e.arrowWidth) ?? u.arrowWidth, this.curvature = (e == null ? void 0 : e.curvature) ?? u.curvature, this.portCycleRadius = (e == null ? void 0 : e.cycleRadius) ?? u.cycleRadius, this.portCycleSmallRadius = (e == null ? void 0 : e.smallCycleRadius) ?? u.smallCycleRadius, this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow, this.pathShape = new U({
2239
2244
  color: (e == null ? void 0 : e.color) ?? u.color,
2240
2245
  width: (e == null ? void 0 : e.width) ?? u.width,
2241
2246
  arrowLength: this.arrowLength,
@@ -2251,7 +2256,7 @@ class tt {
2251
2256
  this.pathShape.render(e);
2252
2257
  }
2253
2258
  }
2254
- class rt {
2259
+ class ot {
2255
2260
  constructor(e) {
2256
2261
  o(this, "svg");
2257
2262
  o(this, "group");
@@ -2292,7 +2297,7 @@ class rt {
2292
2297
  hasSourceArrow: this.hasSourceArrow,
2293
2298
  hasTargetArrow: this.hasTargetArrow
2294
2299
  }));
2295
- o(this, "createLinePath", (e, t, s, i) => new Ke({
2300
+ o(this, "createLinePath", (e, t, s, i) => new Qe({
2296
2301
  to: s,
2297
2302
  sourceDirection: e,
2298
2303
  targetDirection: t,
@@ -2309,7 +2314,7 @@ class rt {
2309
2314
  t,
2310
2315
  this.arrowOffset,
2311
2316
  this.cycleSquareSide / 2
2312
- ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow, this.pathShape = new C({
2317
+ ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow, this.pathShape = new U({
2313
2318
  color: (e == null ? void 0 : e.color) ?? u.color,
2314
2319
  width: (e == null ? void 0 : e.width) ?? u.width,
2315
2320
  arrowLength: this.arrowLength,
@@ -2325,7 +2330,7 @@ class rt {
2325
2330
  this.pathShape.render(e);
2326
2331
  }
2327
2332
  }
2328
- class ot {
2333
+ class st {
2329
2334
  constructor(e) {
2330
2335
  o(this, "svg");
2331
2336
  o(this, "group");
@@ -2366,7 +2371,7 @@ class ot {
2366
2371
  hasSourceArrow: this.hasSourceArrow,
2367
2372
  hasTargetArrow: this.hasTargetArrow
2368
2373
  }));
2369
- o(this, "createLinePath", (e, t, s) => new Qe({
2374
+ o(this, "createLinePath", (e, t, s) => new _e({
2370
2375
  to: s,
2371
2376
  sourceDirection: e,
2372
2377
  targetDirection: t,
@@ -2382,7 +2387,7 @@ class ot {
2382
2387
  t,
2383
2388
  this.arrowOffset,
2384
2389
  this.cycleSquareSide / 2
2385
- ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow, this.pathShape = new C({
2390
+ ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow, this.pathShape = new U({
2386
2391
  color: (e == null ? void 0 : e.color) ?? u.color,
2387
2392
  width: (e == null ? void 0 : e.width) ?? u.width,
2388
2393
  arrowLength: this.arrowLength,
@@ -2398,7 +2403,7 @@ class ot {
2398
2403
  this.pathShape.render(e);
2399
2404
  }
2400
2405
  }
2401
- class st {
2406
+ class it {
2402
2407
  constructor(e) {
2403
2408
  o(this, "svg");
2404
2409
  o(this, "group");
@@ -2439,7 +2444,7 @@ class st {
2439
2444
  hasSourceArrow: this.hasSourceArrow,
2440
2445
  hasTargetArrow: this.hasTargetArrow
2441
2446
  }));
2442
- o(this, "createLinePath", (e, t, s, i, n) => new _e({
2447
+ o(this, "createLinePath", (e, t, s, i, n) => new qe({
2443
2448
  to: s,
2444
2449
  sourceDirection: e,
2445
2450
  targetDirection: t,
@@ -2456,7 +2461,7 @@ class st {
2456
2461
  t,
2457
2462
  this.arrowOffset,
2458
2463
  this.cycleSquareSide / 2
2459
- ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirectionVertical, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow, this.pathShape = new C({
2464
+ ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? u.detourDirectionVertical, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? u.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? u.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? u.hasTargetArrow, this.pathShape = new U({
2460
2465
  color: (e == null ? void 0 : e.color) ?? u.color,
2461
2466
  width: (e == null ? void 0 : e.width) ?? u.width,
2462
2467
  arrowLength: this.arrowLength,
@@ -2489,10 +2494,10 @@ const se = (r) => {
2489
2494
  r.arrowWidth
2490
2495
  );
2491
2496
  };
2492
- class it {
2497
+ class nt {
2493
2498
  constructor(e) {
2494
2499
  o(this, "svg");
2495
- o(this, "group", ge());
2500
+ o(this, "group", ue());
2496
2501
  o(this, "line");
2497
2502
  o(this, "sourceArrow", null);
2498
2503
  o(this, "targetArrow", null);
@@ -2504,15 +2509,15 @@ class it {
2504
2509
  o(this, "targetOffset");
2505
2510
  o(this, "onAfterRender");
2506
2511
  o(this, "afterRenderEmitter");
2507
- [this.afterRenderEmitter, this.onAfterRender] = E(), this.color = (e == null ? void 0 : e.color) ?? u.color, this.width = (e == null ? void 0 : e.width) ?? u.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? u.arrowLength, this.arrowWidth = (e == null ? void 0 : e.arrowWidth) ?? u.arrowWidth, this.sourceOffset = (e == null ? void 0 : e.sourceOffset) ?? u.preOffset, this.targetOffset = (e == null ? void 0 : e.targetOffset) ?? u.preOffset, this.svg = le(this.color), this.svg.appendChild(this.group), this.line = ue(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = V(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = V(), this.group.appendChild(this.targetArrow));
2512
+ [this.afterRenderEmitter, this.onAfterRender] = E(), this.color = (e == null ? void 0 : e.color) ?? u.color, this.width = (e == null ? void 0 : e.width) ?? u.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? u.arrowLength, this.arrowWidth = (e == null ? void 0 : e.arrowWidth) ?? u.arrowWidth, this.sourceOffset = (e == null ? void 0 : e.sourceOffset) ?? u.preOffset, this.targetOffset = (e == null ? void 0 : e.targetOffset) ?? u.preOffset, this.svg = ge(this.color), this.svg.appendChild(this.group), this.line = we(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = V(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = V(), this.group.appendChild(this.targetArrow));
2508
2513
  }
2509
2514
  render(e) {
2510
- const { x: t, y: s, width: i, height: n, flipX: h, flipY: a } = we(
2515
+ const { x: t, y: s, width: i, height: n, flipX: h, flipY: a } = pe(
2511
2516
  e.from,
2512
2517
  e.to
2513
2518
  );
2514
- ce(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${h}, ${a})`;
2515
- const d = { x: i, y: n }, c = new et({
2519
+ le(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${h}, ${a})`;
2520
+ const d = { x: i, y: n }, c = new tt({
2516
2521
  to: d,
2517
2522
  sourceOffset: this.sourceOffset,
2518
2523
  targetOffset: this.targetOffset,
@@ -2547,40 +2552,40 @@ class it {
2547
2552
  });
2548
2553
  }
2549
2554
  }
2550
- const nt = () => {
2555
+ const ht = () => {
2551
2556
  const r = document.createElementNS("http://www.w3.org/2000/svg", "g");
2552
2557
  return r.style.pointerEvents = "auto", r.style.cursor = "pointer", r;
2553
- }, ht = (r) => {
2558
+ }, at = (r) => {
2554
2559
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
2555
2560
  return e.setAttribute("stroke", "transparent"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e.setAttribute("stroke-linecap", "round"), e;
2556
2561
  }, ie = (r) => {
2557
2562
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
2558
2563
  return e.setAttribute("stroke-linejoin", "round"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "transparent"), e.setAttribute("stroke", "transparent"), e;
2559
2564
  };
2560
- class at extends Error {
2565
+ class dt extends Error {
2561
2566
  constructor(e) {
2562
2567
  super(e), this.name = "InteractiveEdgeError";
2563
2568
  }
2564
2569
  }
2565
- class pe {
2570
+ class fe {
2566
2571
  constructor(e, t) {
2567
2572
  o(this, "svg");
2568
2573
  o(this, "group");
2569
2574
  o(this, "line");
2570
2575
  o(this, "sourceArrow");
2571
2576
  o(this, "targetArrow");
2572
- o(this, "handle", nt());
2577
+ o(this, "handle", ht());
2573
2578
  o(this, "onAfterRender");
2574
2579
  o(this, "interactiveLine");
2575
2580
  o(this, "interactiveSourceArrow", null);
2576
2581
  o(this, "interactiveTargetArrow", null);
2577
- if (this.baseEdge = e, e instanceof pe)
2578
- throw new at(
2582
+ if (this.baseEdge = e, e instanceof fe)
2583
+ throw new dt(
2579
2584
  "interactive edge can be configured only once"
2580
2585
  );
2581
2586
  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;
2582
2587
  const s = (t == null ? void 0 : t.width) ?? u.interactiveWidth;
2583
- this.interactiveLine = ht(s), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = ie(s), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = ie(s), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((i) => {
2588
+ this.interactiveLine = at(s), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = ie(s), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = ie(s), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((i) => {
2584
2589
  this.interactiveLine.setAttribute("d", i.edgePath.path), this.interactiveSourceArrow && this.interactiveSourceArrow.setAttribute("d", i.sourceArrowPath), this.interactiveTargetArrow && this.interactiveTargetArrow.setAttribute("d", i.targetArrowPath);
2585
2590
  });
2586
2591
  }
@@ -2588,7 +2593,7 @@ class pe {
2588
2593
  this.baseEdge.render(e);
2589
2594
  }
2590
2595
  }
2591
- class gt {
2596
+ class ut {
2592
2597
  constructor(e, t) {
2593
2598
  o(this, "group");
2594
2599
  o(this, "line");
@@ -2605,12 +2610,12 @@ class gt {
2605
2610
  this.baseShape.render(e);
2606
2611
  }
2607
2612
  }
2608
- const dt = (r) => {
2613
+ const ct = (r) => {
2609
2614
  if (typeof r == "function")
2610
2615
  return r;
2611
2616
  switch (r == null ? void 0 : r.type) {
2612
2617
  case "straight":
2613
- return () => new ot({
2618
+ return () => new st({
2614
2619
  color: r.color,
2615
2620
  width: r.width,
2616
2621
  arrowLength: r.arrowLength,
@@ -2624,7 +2629,7 @@ const dt = (r) => {
2624
2629
  detourDirection: r.detourDirection
2625
2630
  });
2626
2631
  case "horizontal":
2627
- return () => new rt({
2632
+ return () => new ot({
2628
2633
  color: r.color,
2629
2634
  width: r.width,
2630
2635
  arrowLength: r.arrowLength,
@@ -2638,7 +2643,7 @@ const dt = (r) => {
2638
2643
  detourDirection: r.detourDirection
2639
2644
  });
2640
2645
  case "vertical":
2641
- return () => new st({
2646
+ return () => new it({
2642
2647
  color: r.color,
2643
2648
  width: r.width,
2644
2649
  arrowLength: r.arrowLength,
@@ -2652,7 +2657,7 @@ const dt = (r) => {
2652
2657
  detourDirection: r.detourDirection
2653
2658
  });
2654
2659
  case "direct":
2655
- return () => new it({
2660
+ return () => new nt({
2656
2661
  color: r.color,
2657
2662
  width: r.width,
2658
2663
  arrowLength: r.arrowLength,
@@ -2663,7 +2668,7 @@ const dt = (r) => {
2663
2668
  targetOffset: r.targetOffset
2664
2669
  });
2665
2670
  default:
2666
- return () => new tt({
2671
+ return () => new rt({
2667
2672
  color: r.color,
2668
2673
  width: r.width,
2669
2674
  arrowLength: r.arrowLength,
@@ -2677,27 +2682,27 @@ const dt = (r) => {
2677
2682
  detourDirection: r.detourDirection
2678
2683
  });
2679
2684
  }
2680
- }, ct = (r) => {
2685
+ }, lt = (r) => {
2681
2686
  var t, s, i, n, h;
2682
- const e = Ge(
2687
+ const e = Ze(
2683
2688
  (t = r.nodes) == null ? void 0 : t.priority,
2684
2689
  (s = r.edges) == null ? void 0 : s.priority
2685
2690
  );
2686
2691
  return {
2687
2692
  nodes: {
2688
- centerFn: ((i = r.nodes) == null ? void 0 : i.centerFn) ?? He,
2693
+ centerFn: ((i = r.nodes) == null ? void 0 : i.centerFn) ?? je,
2689
2694
  priorityFn: e.nodesPriorityFn
2690
2695
  },
2691
2696
  ports: {
2692
2697
  direction: ((n = r.ports) == null ? void 0 : n.direction) ?? 0
2693
2698
  },
2694
2699
  edges: {
2695
- shapeFactory: dt(((h = r.edges) == null ? void 0 : h.shape) ?? {}),
2700
+ shapeFactory: ct(((h = r.edges) == null ? void 0 : h.shape) ?? {}),
2696
2701
  priorityFn: e.edgesPriorityFn
2697
2702
  }
2698
2703
  };
2699
2704
  };
2700
- class ut {
2705
+ class wt {
2701
2706
  constructor(e) {
2702
2707
  o(this, "element", null);
2703
2708
  o(this, "canvasDefaults", {});
@@ -2776,19 +2781,19 @@ class ut {
2776
2781
  */
2777
2782
  build() {
2778
2783
  if (this.element === null)
2779
- throw new x(
2784
+ throw new S(
2780
2785
  "unable to build canvas when no attach element specified"
2781
2786
  );
2782
2787
  let e = this.boxRenderingTrigger;
2783
2788
  this.virtualScrollConfig !== void 0 && e === void 0 && (e = new he());
2784
- const t = new de(), s = new Pe(), i = new Ye(this.element);
2789
+ const t = new de(), s = new De(), i = new He(this.element);
2785
2790
  let n = new ne(
2786
2791
  t,
2787
2792
  s,
2788
2793
  i.main
2789
2794
  );
2790
- e !== void 0 && (n = new xe(n, t, e));
2791
- const h = ct(this.canvasDefaults), a = new ae(
2795
+ e !== void 0 && (n = new Se(n, t, e));
2796
+ const h = lt(this.canvasDefaults), a = new ae(
2792
2797
  this.element,
2793
2798
  t,
2794
2799
  s,
@@ -2820,7 +2825,7 @@ class ut {
2820
2825
  this.transformConfig,
2821
2826
  e,
2822
2827
  this.virtualScrollConfig
2823
- ) : this.hasTransformableViewport && U.configure(
2828
+ ) : this.hasTransformableViewport && C.configure(
2824
2829
  a,
2825
2830
  i.main,
2826
2831
  this.window,
@@ -2836,16 +2841,16 @@ class ut {
2836
2841
  }
2837
2842
  }
2838
2843
  export {
2839
- tt as BezierEdgeShape,
2840
- ut as CanvasBuilder,
2841
- it as DirectEdgeShape,
2844
+ rt as BezierEdgeShape,
2845
+ wt as CanvasBuilder,
2846
+ nt as DirectEdgeShape,
2842
2847
  he as EventSubject,
2843
- rt as HorizontalEdgeShape,
2844
- x as HtmlGraphError,
2845
- at as InteractiveEdgeError,
2846
- pe as InteractiveEdgeShape,
2847
- C as LineEdgeShape,
2848
- gt as MedianEdgeShape,
2849
- ot as StraightEdgeShape,
2850
- st as VerticalEdgeShape
2848
+ ot as HorizontalEdgeShape,
2849
+ S as HtmlGraphError,
2850
+ dt as InteractiveEdgeError,
2851
+ fe as InteractiveEdgeShape,
2852
+ U as LineEdgeShape,
2853
+ ut as MedianEdgeShape,
2854
+ st as StraightEdgeShape,
2855
+ it as VerticalEdgeShape
2851
2856
  };