@html-graph/html-graph 8.24.0 → 9.0.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.
@@ -63,7 +63,7 @@ var e = /* @__PURE__ */ function(e) {
63
63
  updateEdgeShape(e) {
64
64
  let t = this.edgeIdToElementMap.get(e);
65
65
  this.container.removeChild(t);
66
- let n = this.graphStore.getEdge(e).payload.shape.element;
66
+ let { element: n } = this.graphStore.getEdge(e).payload.shape;
67
67
  this.edgeIdToElementMap.set(e, n), this.container.appendChild(n);
68
68
  }
69
69
  renderEdge(t) {
@@ -726,7 +726,7 @@ var e = /* @__PURE__ */ function(e) {
726
726
  }, x = (e, t, n) => {
727
727
  let { x: r, y: i, width: a, height: o } = e.getBoundingClientRect();
728
728
  return t >= r && t <= r + a && n >= i && n <= i + o;
729
- }, S = (e, t, n) => t >= 0 && t <= e.innerWidth && n >= 0 && n <= e.innerHeight, ee = class {
729
+ }, S = (e, t, n) => t >= 0 && t <= e.innerWidth && n >= 0 && n <= e.innerHeight, C = class {
730
730
  element;
731
731
  win;
732
732
  constructor(e, t) {
@@ -735,9 +735,9 @@ var e = /* @__PURE__ */ function(e) {
735
735
  verify(e, t) {
736
736
  return x(this.element, e, t) && S(this.win, e, t);
737
737
  }
738
- }, C = (e, t) => {
738
+ }, w = (e, t) => {
739
739
  t === null ? e.style.removeProperty("cursor") : e.style.cursor = t;
740
- }, w = (e) => {
740
+ }, T = (e) => {
741
741
  let t = document.createElement("div");
742
742
  return {
743
743
  id: e.overlayNodeId,
@@ -750,7 +750,7 @@ var e = /* @__PURE__ */ function(e) {
750
750
  direction: e.portDirection
751
751
  }]
752
752
  };
753
- }, te = (e, t) => {
753
+ }, ee = (e, t) => {
754
754
  let n = t;
755
755
  for (; n !== null;) {
756
756
  let t = e.findPortIdsByElement(n)[0] ?? null;
@@ -765,11 +765,11 @@ var e = /* @__PURE__ */ function(e) {
765
765
  };
766
766
  //#endregion
767
767
  //#region src/configurators/shared/find-port-at-point/get-elements-at-point/get-elements-at-point.ts
768
- function* ne(e, t) {
768
+ function* te(e, t) {
769
769
  let n = e.elementsFromPoint(t.x, t.y);
770
770
  for (let e of n) {
771
771
  if (e.shadowRoot !== null) {
772
- let n = ne(e.shadowRoot, t);
772
+ let n = te(e.shadowRoot, t);
773
773
  for (let e of n) yield e;
774
774
  }
775
775
  yield e;
@@ -777,23 +777,23 @@ function* ne(e, t) {
777
777
  }
778
778
  //#endregion
779
779
  //#region src/configurators/shared/find-port-at-point/find-port-at-point.ts
780
- var re = (e, t) => {
781
- let n = ne(document, t);
780
+ var ne = (e, t) => {
781
+ let n = te(document, t);
782
782
  for (let t of n) {
783
- let n = te(e, t);
783
+ let n = ee(e, t);
784
784
  if (n.status === "portFound") return n.portId;
785
785
  if (n.status === "nodeEncountered") return null;
786
786
  }
787
787
  return null;
788
- }, T = /* @__PURE__ */ function(e) {
788
+ }, E = /* @__PURE__ */ function(e) {
789
789
  return e.StaticNodeId = "static", e.DraggingNodeId = "dragging", e.EdgeId = "edge", e;
790
- }({}), ie = (e, t) => ({
790
+ }({}), re = (e, t) => ({
791
791
  x: e / 2,
792
792
  y: t / 2
793
- }), E = (e, t, n) => ({
793
+ }), D = (e, t, n) => ({
794
794
  x: t.x * e.x - t.y * e.y + ((1 - t.x) * n.x + t.y * n.y),
795
795
  y: t.y * e.x + t.x * e.y + ((1 - t.x) * n.y - t.y * n.x)
796
- }), ae = (e, t, n) => {
796
+ }), ie = (e, t, n) => {
797
797
  let r = {
798
798
  x: e.x + e.width / 2,
799
799
  y: e.y + e.height / 2
@@ -815,14 +815,14 @@ var re = (e, t) => {
815
815
  y: i.y - o
816
816
  }
817
817
  };
818
- }, D = .5 * .5 * .5, O = 3 * D, oe = class {
818
+ }, O = .5 * .5 * .5, k = 3 * O, ae = class {
819
819
  path;
820
820
  midpoint;
821
821
  constructor(e) {
822
- let { from: t, to: n, arrowLength: r, fromDir: i, toDir: a, curvature: o, hasSourceArrow: s, hasTargetArrow: c } = e, l = E({
822
+ let { from: t, to: n, arrowLength: r, fromDir: i, toDir: a, curvature: o, hasSourceArrow: s, hasTargetArrow: c } = e, l = D({
823
823
  x: t.x + r,
824
824
  y: t.y
825
- }, i, t), u = E({
825
+ }, i, t), u = D({
826
826
  x: n.x - r,
827
827
  y: n.y
828
828
  }, a, n), d = {
@@ -831,7 +831,7 @@ var re = (e, t) => {
831
831
  }, f = {
832
832
  x: u.x - a.x * o,
833
833
  y: u.y - a.y * o
834
- }, p = D * l.x + O * d.x + O * f.x + D * u.x, m = D * l.y + O * d.y + O * f.y + D * u.y;
834
+ }, p = O * l.x + k * d.x + k * f.x + O * u.x, m = O * l.y + k * d.y + k * f.y + O * u.y;
835
835
  this.midpoint = {
836
836
  x: p,
837
837
  y: m
@@ -839,23 +839,23 @@ var re = (e, t) => {
839
839
  let h = `M ${l.x} ${l.y} C ${d.x} ${d.y}, ${f.x} ${f.y}, ${u.x} ${u.y}`, g = s ? "" : `M ${t.x} ${t.y} L ${l.x} ${l.y} `, _ = c ? "" : ` M ${u.x} ${u.y} L ${n.x} ${n.y}`;
840
840
  this.path = `${g}${h}${_}`;
841
841
  }
842
- }, se = class {
842
+ }, oe = class {
843
843
  path;
844
844
  midpoint;
845
845
  constructor(e) {
846
- let { hasSourceArrow: t, hasTargetArrow: n, curvature: r, fromDir: i, toDir: a, detourDir: o, from: s, to: c, arrowLength: l, detourDistance: u } = e, d = t ? E({
846
+ let { hasSourceArrow: t, hasTargetArrow: n, curvature: r, fromDir: i, toDir: a, detourDir: o, from: s, to: c, arrowLength: l, detourDistance: u } = e, d = t ? D({
847
847
  x: s.x + l,
848
848
  y: s.y
849
- }, i, s) : s, f = n ? E({
849
+ }, i, s) : s, f = n ? D({
850
850
  x: c.x - l,
851
851
  y: c.y
852
- }, a, c) : c, p = Math.cos(o) * u, m = Math.sin(o) * u, h = E({
852
+ }, a, c) : c, p = Math.cos(o) * u, m = Math.sin(o) * u, h = D({
853
853
  x: s.x + l,
854
854
  y: s.y
855
855
  }, i, s), g = {
856
856
  x: h.x + p,
857
857
  y: h.y + m
858
- }, _ = E({
858
+ }, _ = D({
859
859
  x: c.x - l,
860
860
  y: c.y
861
861
  }, a, c), v = {
@@ -873,7 +873,7 @@ var re = (e, t) => {
873
873
  }, S = {
874
874
  x: h.x + p,
875
875
  y: h.y + m
876
- }, ee = {
876
+ }, C = {
877
877
  x: _.x + p,
878
878
  y: _.y + m
879
879
  };
@@ -881,22 +881,22 @@ var re = (e, t) => {
881
881
  `M ${d.x} ${d.y}`,
882
882
  `L ${h.x} ${h.y}`,
883
883
  `C ${b.x} ${b.y} ${S.x} ${S.y} ${y.x} ${y.y}`,
884
- `C ${ee.x} ${ee.y} ${x.x} ${x.y} ${_.x} ${_.y}`,
884
+ `C ${C.x} ${C.y} ${x.x} ${x.y} ${_.x} ${_.y}`,
885
885
  `L ${f.x} ${f.y}`
886
886
  ].join(" "), this.midpoint = y;
887
887
  }
888
- }, k = Object.freeze({ edgeColor: "--edge-color" }), ce = (e) => {
888
+ }, A = Object.freeze({ edgeColor: "--edge-color" }), se = (e) => {
889
889
  let t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
890
- return t.style.pointerEvents = "none", t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.overflow = "visible", t.style.setProperty(k.edgeColor, e), t;
891
- }, le = (e) => {
890
+ return t.style.pointerEvents = "none", t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.overflow = "visible", t.style.setProperty(A.edgeColor, e), t;
891
+ }, ce = (e) => {
892
892
  let t = document.createElementNS("http://www.w3.org/2000/svg", "path");
893
- return t.setAttribute("stroke", `var(${k.edgeColor})`), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "none"), t;
894
- }, A = () => {
893
+ return t.setAttribute("stroke", `var(${A.edgeColor})`), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "none"), t;
894
+ }, j = () => {
895
895
  let e = document.createElementNS("http://www.w3.org/2000/svg", "path");
896
- return e.setAttribute("fill", `var(${k.edgeColor})`), e;
897
- }, ue = (e, t) => {
896
+ return e.setAttribute("fill", `var(${A.edgeColor})`), e;
897
+ }, le = (e, t) => {
898
898
  e.style.transform = `translate(${t.x}px, ${t.y}px)`, e.style.width = `${t.width}px`, e.style.height = `${t.height}px`;
899
- }, j = (e, t) => {
899
+ }, M = (e, t) => {
900
900
  let n = [];
901
901
  if (e.length > 0 && n.push(`M ${e[0].x} ${e[0].y}`), e.length === 2 && n.push(`L ${e[1].x} ${e[1].y}`), e.length > 2) {
902
902
  let r = e.length - 1, i = 0, a = 0, o = 0;
@@ -917,7 +917,7 @@ var re = (e, t) => {
917
917
  });
918
918
  }
919
919
  return n.join(" ");
920
- }, de = (e, t) => {
920
+ }, ue = (e, t) => {
921
921
  let n = e.linePoint, r = t.linePoint, i = r.x - n.x >= 0, a = e.dir.x >= 0;
922
922
  if (a === t.dir.x >= 0) {
923
923
  let o = a === i, s = {
@@ -991,24 +991,24 @@ var re = (e, t) => {
991
991
  y: s
992
992
  }
993
993
  };
994
- }, M = (e) => ({
994
+ }, N = (e) => ({
995
995
  x: e.y,
996
996
  y: e.x
997
- }), fe = (e, t) => {
998
- let n = de({
999
- arrowPoint: M(e.arrowPoint),
1000
- linePoint: M(e.linePoint),
1001
- dir: M(e.dir)
997
+ }), de = (e, t) => {
998
+ let n = ue({
999
+ arrowPoint: N(e.arrowPoint),
1000
+ linePoint: N(e.linePoint),
1001
+ dir: N(e.dir)
1002
1002
  }, {
1003
- arrowPoint: M(t.arrowPoint),
1004
- linePoint: M(t.linePoint),
1005
- dir: M(t.dir)
1003
+ arrowPoint: N(t.arrowPoint),
1004
+ linePoint: N(t.linePoint),
1005
+ dir: N(t.dir)
1006
1006
  });
1007
1007
  return {
1008
- points: n.points.map((e) => M(e)),
1009
- midpoint: M(n.midpoint)
1008
+ points: n.points.map((e) => N(e)),
1009
+ midpoint: N(n.midpoint)
1010
1010
  };
1011
- }, N = (e) => {
1011
+ }, P = (e) => {
1012
1012
  let t = [];
1013
1013
  for (let n = 1; n < e.length; n++) {
1014
1014
  let r = e[n - 1], i = e[n], a = i.x - r.x, o = i.y - r.y, s = Math.sqrt(a * a + o * o);
@@ -1034,7 +1034,7 @@ var re = (e, t) => {
1034
1034
  }
1035
1035
  if (r === 0 && e.length > 0) return e[0];
1036
1036
  throw Error("Failed to calculate midpoint");
1037
- }, pe = (e, t) => {
1037
+ }, fe = (e, t) => {
1038
1038
  let n = e.linePoint, r = e.arrowPoint, i = t.linePoint, a = t.arrowPoint, o = t.dir.y >= 0, s = e.dir.x >= 0, c = i.y - n.y >= 0, l = s === i.x - n.x >= 0, u = o === c;
1039
1039
  if (l) {
1040
1040
  if (u) {
@@ -1048,7 +1048,7 @@ var re = (e, t) => {
1048
1048
  e,
1049
1049
  a
1050
1050
  ],
1051
- midpoint: N([
1051
+ midpoint: P([
1052
1052
  n,
1053
1053
  e,
1054
1054
  i
@@ -1070,7 +1070,7 @@ var re = (e, t) => {
1070
1070
  i,
1071
1071
  a
1072
1072
  ],
1073
- midpoint: N([
1073
+ midpoint: P([
1074
1074
  n,
1075
1075
  t,
1076
1076
  o,
@@ -1094,7 +1094,7 @@ var re = (e, t) => {
1094
1094
  o,
1095
1095
  a
1096
1096
  ],
1097
- midpoint: N([
1097
+ midpoint: P([
1098
1098
  n,
1099
1099
  t,
1100
1100
  o,
@@ -1114,73 +1114,46 @@ var re = (e, t) => {
1114
1114
  i,
1115
1115
  a
1116
1116
  ],
1117
- midpoint: N([
1117
+ midpoint: P([
1118
1118
  n,
1119
1119
  d,
1120
1120
  i
1121
1121
  ])
1122
1122
  };
1123
- }, me = (e, t) => {
1124
- let n = pe({
1125
- arrowPoint: M(e.arrowPoint),
1126
- linePoint: M(e.linePoint),
1127
- dir: M(e.dir)
1123
+ }, pe = (e, t) => {
1124
+ let n = fe({
1125
+ arrowPoint: N(e.arrowPoint),
1126
+ linePoint: N(e.linePoint),
1127
+ dir: N(e.dir)
1128
1128
  }, {
1129
- arrowPoint: M(t.arrowPoint),
1130
- linePoint: M(t.linePoint),
1131
- dir: M(t.dir)
1129
+ arrowPoint: N(t.arrowPoint),
1130
+ linePoint: N(t.linePoint),
1131
+ dir: N(t.dir)
1132
1132
  });
1133
1133
  return {
1134
- points: n.points.map((e) => M(e)),
1135
- midpoint: M(n.midpoint)
1134
+ points: n.points.map((e) => N(e)),
1135
+ midpoint: N(n.midpoint)
1136
1136
  };
1137
- }, he = (e, t) => {
1137
+ }, me = (e, t) => {
1138
1138
  let n = Math.abs(e.dir.y) < 1e-10, r = Math.abs(t.dir.y) < 1e-10;
1139
- return n ? r ? de(e, t) : pe(e, t) : r ? me(e, t) : fe(e, t);
1140
- }, ge = class {
1141
- path;
1142
- midpoint;
1143
- constructor(e) {
1144
- let { from: t, to: n, fromDir: r, toDir: i, arrowLength: a, arrowOffset: o, roundness: s, hasSourceArrow: c, hasTargetArrow: l } = e, u = c ? E({
1145
- x: t.x + a,
1146
- y: t.y
1147
- }, r, t) : t, d = l ? E({
1148
- x: n.x - a,
1149
- y: n.y
1150
- }, i, n) : n, f = a + o, p = E({
1151
- x: t.x + f,
1152
- y: t.y
1153
- }, r, t), m = E({
1154
- x: n.x - f,
1155
- y: n.y
1156
- }, i, n), h = de({
1157
- arrowPoint: u,
1158
- linePoint: p,
1159
- dir: r
1160
- }, {
1161
- arrowPoint: d,
1162
- linePoint: m,
1163
- dir: i
1164
- });
1165
- this.path = j(h.points, s), this.midpoint = h.midpoint;
1166
- }
1167
- }, _e = class {
1139
+ return n ? r ? ue(e, t) : fe(e, t) : r ? pe(e, t) : de(e, t);
1140
+ }, he = class {
1168
1141
  path;
1169
1142
  midpoint;
1170
1143
  constructor(e) {
1171
- let { hasSourceArrow: t, hasTargetArrow: n, from: r, to: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, detourDir: l, detourDistance: u, roundness: d } = e, f = t ? E({
1144
+ let { hasSourceArrow: t, hasTargetArrow: n, from: r, to: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, detourDir: l, detourDistance: u, roundness: d } = e, f = t ? D({
1172
1145
  x: r.x + a,
1173
1146
  y: r.y
1174
- }, o, r) : r, p = n ? E({
1147
+ }, o, r) : r, p = n ? D({
1175
1148
  x: i.x - a,
1176
1149
  y: i.y
1177
- }, s, i) : i, m = a + c, h = Math.cos(l) * u, g = Math.sin(l) * u, _ = E({
1150
+ }, s, i) : i, m = a + c, h = Math.cos(l) * u, g = Math.sin(l) * u, _ = D({
1178
1151
  x: r.x + m,
1179
1152
  y: r.y
1180
1153
  }, o, r), v = {
1181
1154
  x: _.x + h,
1182
1155
  y: _.y + g
1183
- }, y = E({
1156
+ }, y = D({
1184
1157
  x: i.x - m,
1185
1158
  y: i.y
1186
1159
  }, s, i), b = {
@@ -1190,7 +1163,7 @@ var re = (e, t) => {
1190
1163
  this.midpoint = {
1191
1164
  x: (v.x + b.x) / 2,
1192
1165
  y: (v.y + b.y) / 2
1193
- }, this.path = j([
1166
+ }, this.path = M([
1194
1167
  f,
1195
1168
  _,
1196
1169
  v,
@@ -1199,18 +1172,18 @@ var re = (e, t) => {
1199
1172
  p
1200
1173
  ], d);
1201
1174
  }
1202
- }, ve = class {
1175
+ }, ge = class {
1203
1176
  path;
1204
1177
  midpoint;
1205
1178
  constructor(e) {
1206
- let { from: t, to: n, hasSourceArrow: r, hasTargetArrow: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l } = e, u = this.createArrowPoint(r, o, t, a), d = this.createArrowPoint(i, s, n, -a), f = a + c, p = E({
1179
+ let { from: t, to: n, hasSourceArrow: r, hasTargetArrow: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l } = e, u = this.createArrowPoint(r, o, t, a), d = this.createArrowPoint(i, s, n, -a), f = a + c, p = D({
1207
1180
  x: t.x + f,
1208
1181
  y: t.y
1209
- }, o, t), m = E({
1182
+ }, o, t), m = D({
1210
1183
  x: n.x - f,
1211
1184
  y: n.y
1212
1185
  }, s, n);
1213
- this.path = j([
1186
+ this.path = M([
1214
1187
  u,
1215
1188
  p,
1216
1189
  m,
@@ -1223,55 +1196,28 @@ var re = (e, t) => {
1223
1196
  };
1224
1197
  }
1225
1198
  createArrowPoint(e, t, n, r) {
1226
- return e ? E({
1199
+ return e ? D({
1227
1200
  x: n.x + r,
1228
1201
  y: n.y
1229
1202
  }, t, n) : n;
1230
1203
  }
1231
- }, ye = class {
1232
- path;
1233
- midpoint;
1234
- constructor(e) {
1235
- let { from: t, to: n, hasSourceArrow: r, hasTargetArrow: i, arrowLength: a, arrowOffset: o, fromDir: s, toDir: c, roundness: l } = e, u = r ? E({
1236
- x: t.x + a,
1237
- y: t.y
1238
- }, s, t) : t, d = i ? E({
1239
- x: n.x - a,
1240
- y: n.y
1241
- }, c, n) : n, f = a + o, p = E({
1242
- x: t.x + f,
1243
- y: t.y
1244
- }, s, t), m = E({
1245
- x: n.x - f,
1246
- y: n.y
1247
- }, c, n), h = fe({
1248
- arrowPoint: u,
1249
- linePoint: p,
1250
- dir: s
1251
- }, {
1252
- arrowPoint: d,
1253
- linePoint: m,
1254
- dir: c
1255
- });
1256
- this.path = j(h.points, l), this.midpoint = h.midpoint;
1257
- }
1258
- }, be = class {
1204
+ }, _e = class {
1259
1205
  path;
1260
1206
  midpoint;
1261
1207
  constructor(e) {
1262
- let { from: t, to: n, fromDir: r, toDir: i, arrowLength: a, arrowOffset: o, roundness: s, hasSourceArrow: c, hasTargetArrow: l } = e, u = c ? E({
1208
+ let { from: t, to: n, fromDir: r, toDir: i, arrowLength: a, arrowOffset: o, roundness: s, hasSourceArrow: c, hasTargetArrow: l } = e, u = c ? D({
1263
1209
  x: t.x + a,
1264
1210
  y: t.y
1265
- }, r, t) : t, d = l ? E({
1211
+ }, r, t) : t, d = l ? D({
1266
1212
  x: n.x - a,
1267
1213
  y: n.y
1268
- }, i, n) : n, f = a + o, p = E({
1214
+ }, i, n) : n, f = a + o, p = D({
1269
1215
  x: t.x + f,
1270
1216
  y: t.y
1271
- }, r, t), m = E({
1217
+ }, r, t), m = D({
1272
1218
  x: n.x - f,
1273
1219
  y: n.y
1274
- }, i, n), h = he({
1220
+ }, i, n), h = me({
1275
1221
  arrowPoint: u,
1276
1222
  linePoint: p,
1277
1223
  dir: r
@@ -1280,9 +1226,9 @@ var re = (e, t) => {
1280
1226
  linePoint: m,
1281
1227
  dir: i
1282
1228
  });
1283
- this.path = j(h.points, s), this.midpoint = h.midpoint;
1229
+ this.path = M(h.points, s), this.midpoint = h.midpoint;
1284
1230
  }
1285
- }, P = class {
1231
+ }, ve = class {
1286
1232
  path;
1287
1233
  midpoint;
1288
1234
  constructor(e) {
@@ -1319,19 +1265,19 @@ var re = (e, t) => {
1319
1265
  x: n,
1320
1266
  y: 0
1321
1267
  }
1322
- ].map((e) => E(e, i, {
1268
+ ].map((e) => D(e, i, {
1323
1269
  x: 0,
1324
1270
  y: 0
1325
1271
  })).map((e) => ({
1326
1272
  x: e.x + a.x,
1327
1273
  y: e.y + a.y
1328
1274
  })), u = `M ${a.x} ${a.y} L ${l[0].x} ${l[0].y} `;
1329
- this.path = `${o ? "" : u}${j(l, e.roundness)}`, this.midpoint = {
1275
+ this.path = `${o ? "" : u}${M(l, e.roundness)}`, this.midpoint = {
1330
1276
  x: (l[3].x + l[4].x) / 2,
1331
1277
  y: (l[3].y + l[4].y) / 2
1332
1278
  };
1333
1279
  }
1334
- }, xe = class {
1280
+ }, ye = class {
1335
1281
  path;
1336
1282
  midpoint;
1337
1283
  constructor(e) {
@@ -1352,7 +1298,7 @@ var re = (e, t) => {
1352
1298
  x: d,
1353
1299
  y: 0
1354
1300
  }
1355
- ].map((e) => E(e, i, {
1301
+ ].map((e) => D(e, i, {
1356
1302
  x: 0,
1357
1303
  y: 0
1358
1304
  })).map((e) => ({
@@ -1366,30 +1312,30 @@ var re = (e, t) => {
1366
1312
  ].join(" "), h = `M ${a.x} ${a.y} L ${p[0].x} ${p[0].y} `;
1367
1313
  this.path = `${o ? "" : h}${m}`, this.midpoint = p[3];
1368
1314
  }
1369
- }, Se = (e, t, n) => {
1315
+ }, be = (e, t, n) => {
1370
1316
  let r = Math.max(e.y, t.y), i = Math.min(e.y, t.y);
1371
1317
  return (n >= 0 ? r : i) + n;
1372
- }, Ce = class {
1318
+ }, xe = class {
1373
1319
  path;
1374
1320
  midpoint;
1375
1321
  constructor(e) {
1376
- let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, from: i, to: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l, detourDistance: u } = e, d = t ? E({
1322
+ let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, from: i, to: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l, detourDistance: u } = e, d = t ? D({
1377
1323
  x: i.x + r,
1378
1324
  y: i.y
1379
- }, o, i) : i, f = n ? E({
1325
+ }, o, i) : i, f = n ? D({
1380
1326
  x: a.x - r,
1381
1327
  y: a.y
1382
- }, s, a) : a, p = r + c, m = E({
1328
+ }, s, a) : a, p = r + c, m = D({
1383
1329
  x: i.x + p,
1384
1330
  y: i.y
1385
- }, o, i), h = E({
1331
+ }, o, i), h = D({
1386
1332
  x: a.x - p,
1387
1333
  y: a.y
1388
- }, s, a), g = Se(m, h, u);
1334
+ }, s, a), g = be(m, h, u);
1389
1335
  this.midpoint = {
1390
1336
  x: (m.x + h.x) / 2,
1391
1337
  y: g
1392
- }, this.path = j([
1338
+ }, this.path = M([
1393
1339
  d,
1394
1340
  m,
1395
1341
  {
@@ -1404,30 +1350,30 @@ var re = (e, t) => {
1404
1350
  f
1405
1351
  ], l);
1406
1352
  }
1407
- }, we = (e, t, n) => {
1353
+ }, Se = (e, t, n) => {
1408
1354
  let r = Math.max(e.x, t.x), i = Math.min(e.x, t.x);
1409
1355
  return (n >= 0 ? r : i) + n;
1410
- }, Te = class {
1356
+ }, Ce = class {
1411
1357
  path;
1412
1358
  midpoint;
1413
1359
  constructor(e) {
1414
- let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, fromDir: i, toDir: a, from: o, to: s, arrowOffset: c, detourDistance: l, roundness: u } = e, d = t ? E({
1360
+ let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, fromDir: i, toDir: a, from: o, to: s, arrowOffset: c, detourDistance: l, roundness: u } = e, d = t ? D({
1415
1361
  x: o.x + r,
1416
1362
  y: o.y
1417
- }, i, o) : o, f = n ? E({
1363
+ }, i, o) : o, f = n ? D({
1418
1364
  x: s.x - r,
1419
1365
  y: s.y
1420
- }, a, s) : s, p = r + c, m = E({
1366
+ }, a, s) : s, p = r + c, m = D({
1421
1367
  x: o.x + p,
1422
1368
  y: o.y
1423
- }, i, o), h = E({
1369
+ }, i, o), h = D({
1424
1370
  x: s.x - p,
1425
1371
  y: s.y
1426
- }, a, s), g = we(m, h, l);
1372
+ }, a, s), g = Se(m, h, l);
1427
1373
  this.midpoint = {
1428
1374
  x: g,
1429
1375
  y: (m.y + h.y) / 2
1430
- }, this.path = j([
1376
+ }, this.path = M([
1431
1377
  d,
1432
1378
  m,
1433
1379
  {
@@ -1442,22 +1388,22 @@ var re = (e, t) => {
1442
1388
  f
1443
1389
  ], u);
1444
1390
  }
1445
- }, Ee = class {
1391
+ }, we = class {
1446
1392
  path;
1447
1393
  midpoint;
1448
1394
  constructor(e) {
1449
1395
  let t = Math.abs(e.fromDir.y) < 1e-10, n = Math.abs(e.toDir.y) < 1e-10;
1450
1396
  if (t && n) {
1451
- let t = new Ce(e);
1397
+ let t = new xe(e);
1452
1398
  this.path = t.path, this.midpoint = t.midpoint;
1453
1399
  return;
1454
1400
  }
1455
1401
  if (!t && !n) {
1456
- let t = new Te(e);
1402
+ let t = new Ce(e);
1457
1403
  this.path = t.path, this.midpoint = t.midpoint;
1458
1404
  return;
1459
1405
  }
1460
- let r = new be(e);
1406
+ let r = new _e(e);
1461
1407
  this.path = r.path, this.midpoint = r.midpoint;
1462
1408
  }
1463
1409
  }, F = Object.freeze({
@@ -1482,13 +1428,12 @@ var re = (e, t) => {
1482
1428
  curvature: 90,
1483
1429
  interactiveWidth: 10,
1484
1430
  portOffset: 0
1485
- }), De = (e) => ({
1431
+ }), Te = (e) => ({
1486
1432
  x: Math.cos(e),
1487
1433
  y: Math.sin(e)
1488
1434
  }), I = class {
1489
1435
  params;
1490
1436
  element;
1491
- svg;
1492
1437
  group = document.createElementNS("http://www.w3.org/2000/svg", "g");
1493
1438
  line;
1494
1439
  sourceArrow = null;
@@ -1497,17 +1442,17 @@ var re = (e, t) => {
1497
1442
  afterRenderEmitter;
1498
1443
  arrowRenderer;
1499
1444
  constructor(e) {
1500
- this.params = e, [this.afterRenderEmitter, this.onAfterRender] = u(), this.arrowRenderer = this.params.arrowRenderer, this.element = ce(e.color), this.svg = this.element, this.element.appendChild(this.group), this.line = le(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = A(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = A(), this.group.appendChild(this.targetArrow));
1445
+ this.params = e, [this.afterRenderEmitter, this.onAfterRender] = u(), this.arrowRenderer = this.params.arrowRenderer, this.element = se(e.color), this.element.appendChild(this.group), this.line = ce(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = j(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = j(), this.group.appendChild(this.targetArrow));
1501
1446
  }
1502
1447
  render(t) {
1503
- let { x: n, y: r, width: i, height: a, from: o, to: s } = ae(t.from, t.to, this.params.padding);
1504
- ue(this.element, {
1448
+ let { x: n, y: r, width: i, height: a, from: o, to: s } = ie(t.from, t.to, this.params.padding);
1449
+ le(this.element, {
1505
1450
  x: n,
1506
1451
  y: r,
1507
1452
  width: i,
1508
1453
  height: a
1509
1454
  });
1510
- let c = De(t.from.direction), l = De(t.to.direction), u = {
1455
+ let c = Te(t.from.direction), l = Te(t.to.direction), u = {
1511
1456
  x: -l.x,
1512
1457
  y: -l.y
1513
1458
  }, d;
@@ -1531,7 +1476,7 @@ var re = (e, t) => {
1531
1476
  targetArrowPath: m
1532
1477
  });
1533
1478
  }
1534
- }, Oe = (e) => (t) => {
1479
+ }, Ee = (e) => (t) => {
1535
1480
  let n = [
1536
1481
  {
1537
1482
  x: 0,
@@ -1545,7 +1490,7 @@ var re = (e, t) => {
1545
1490
  x: t.arrowLength,
1546
1491
  y: -e.radius
1547
1492
  }
1548
- ].map((e) => E(e, t.direction, {
1493
+ ].map((e) => D(e, t.direction, {
1549
1494
  x: 0,
1550
1495
  y: 0
1551
1496
  })).map((e) => ({
@@ -1553,7 +1498,7 @@ var re = (e, t) => {
1553
1498
  y: e.y + t.shift.y
1554
1499
  }));
1555
1500
  return `${`M ${n[0].x} ${n[0].y}`} ${`L ${n[1].x} ${n[1].y}`} ${`L ${n[2].x} ${n[2].y}`} Z`;
1556
- }, ke = (e) => (t) => {
1501
+ }, De = (e) => (t) => {
1557
1502
  let n = e.radius, r = t.arrowLength, i = (r * r + 2 * r * n) / (2 * n), a = i + n, o = r + n - n * (r + n) / a, s = n * i / a, c = [
1558
1503
  {
1559
1504
  x: 0,
@@ -1567,7 +1512,7 @@ var re = (e, t) => {
1567
1512
  x: o,
1568
1513
  y: s
1569
1514
  }
1570
- ].map((e) => E(e, t.direction, {
1515
+ ].map((e) => D(e, t.direction, {
1571
1516
  x: 0,
1572
1517
  y: 0
1573
1518
  })).map((e) => ({
@@ -1575,8 +1520,8 @@ var re = (e, t) => {
1575
1520
  y: e.y + t.shift.y
1576
1521
  }));
1577
1522
  return `${`M ${c[0].x} ${c[0].y}`} ${`A ${i} ${i} 0 0 0 ${c[1].x} ${c[1].y}`} ${`A ${n} ${n} 0 0 0 ${c[2].x} ${c[2].y}`} ${`A ${i} ${i} 0 0 0 ${c[0].x} ${c[0].y}`}`;
1578
- }, Ae = (e) => (t) => {
1579
- let n = e.smallRadius, r = e.radius, i = E({
1523
+ }, Oe = (e) => (t) => {
1524
+ let n = e.smallRadius, r = e.radius, i = D({
1580
1525
  x: t.arrowLength,
1581
1526
  y: 0
1582
1527
  }, {
@@ -1595,7 +1540,7 @@ var re = (e, t) => {
1595
1540
  y: -i.y
1596
1541
  },
1597
1542
  i
1598
- ].map((e) => E(e, t.direction, {
1543
+ ].map((e) => D(e, t.direction, {
1599
1544
  x: 0,
1600
1545
  y: 0
1601
1546
  })).map((e) => ({
@@ -1606,17 +1551,16 @@ var re = (e, t) => {
1606
1551
  }, L = (e) => {
1607
1552
  if (typeof e == "function") return e;
1608
1553
  switch (e.type) {
1609
- case "triangle": return Oe({ radius: e.radius ?? F.polygonArrowRadius });
1610
- case "arc": return ke({ radius: e.radius ?? F.circleArrowRadius });
1611
- default: return Ae({
1554
+ case "triangle": return Ee({ radius: e.radius ?? F.polygonArrowRadius });
1555
+ case "arc": return De({ radius: e.radius ?? F.circleArrowRadius });
1556
+ default: return Oe({
1612
1557
  smallRadius: e.smallRadius ?? F.wedgeArrowSmallRadius,
1613
1558
  angle: e.angle ?? F.wedgeArrowAngle,
1614
1559
  radius: e.radius ?? F.wedgeArrowRadius
1615
1560
  });
1616
1561
  }
1617
- }, je = class {
1562
+ }, ke = class {
1618
1563
  element;
1619
- svg;
1620
1564
  group;
1621
1565
  line;
1622
1566
  sourceArrow;
@@ -1631,7 +1575,7 @@ var re = (e, t) => {
1631
1575
  hasSourceArrow;
1632
1576
  hasTargetArrow;
1633
1577
  pathShape;
1634
- createCyclePath = (e, t, n) => new xe({
1578
+ createCyclePath = (e, t, n) => new ye({
1635
1579
  origin: e,
1636
1580
  dir: n,
1637
1581
  radius: this.portCycleRadius,
@@ -1639,7 +1583,7 @@ var re = (e, t) => {
1639
1583
  arrowLength: this.arrowLength,
1640
1584
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1641
1585
  });
1642
- createDetourPath = (e, t, n, r) => new se({
1586
+ createDetourPath = (e, t, n, r) => new oe({
1643
1587
  from: e,
1644
1588
  to: t,
1645
1589
  fromDir: n,
@@ -1651,7 +1595,7 @@ var re = (e, t) => {
1651
1595
  hasSourceArrow: this.hasSourceArrow,
1652
1596
  hasTargetArrow: this.hasTargetArrow
1653
1597
  });
1654
- createLinePath = (e, t, n, r) => new oe({
1598
+ createLinePath = (e, t, n, r) => new ae({
1655
1599
  from: e,
1656
1600
  to: t,
1657
1601
  fromDir: n,
@@ -1673,92 +1617,13 @@ var re = (e, t) => {
1673
1617
  createDetourPath: this.createDetourPath,
1674
1618
  createLinePath: this.createLinePath,
1675
1619
  padding: 50
1676
- }), this.element = this.pathShape.element, this.svg = this.element, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1620
+ }), this.element = this.pathShape.element, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1677
1621
  }
1678
1622
  render(e) {
1679
1623
  this.pathShape.render(e);
1680
1624
  }
1681
- }, Me = (e) => Math.cos(e) > 0 ? 0 : Math.PI, Ne = class {
1682
- element;
1683
- svg;
1684
- group;
1685
- line;
1686
- sourceArrow;
1687
- targetArrow;
1688
- onAfterRender;
1689
- arrowLength;
1690
- arrowOffset;
1691
- roundness;
1692
- cycleSquareSide;
1693
- detourDistance;
1694
- hasSourceArrow;
1695
- hasTargetArrow;
1696
- pathShape;
1697
- createCyclePath = (e, t, n) => new P({
1698
- origin: e,
1699
- dir: n,
1700
- arrowLength: this.arrowLength,
1701
- side: this.cycleSquareSide,
1702
- arrowOffset: this.arrowOffset,
1703
- roundness: this.roundness,
1704
- hasArrow: this.hasSourceArrow || this.hasTargetArrow
1705
- });
1706
- createDetourPath = (e, t, n, r) => new Ce({
1707
- from: e,
1708
- to: t,
1709
- fromDir: n,
1710
- toDir: r,
1711
- arrowLength: this.arrowLength,
1712
- arrowOffset: this.arrowOffset,
1713
- roundness: this.roundness,
1714
- detourDistance: this.detourDistance,
1715
- hasSourceArrow: this.hasSourceArrow,
1716
- hasTargetArrow: this.hasTargetArrow
1717
- });
1718
- createLinePath = (e, t, n, r) => new ge({
1719
- from: e,
1720
- to: t,
1721
- fromDir: n,
1722
- toDir: r,
1723
- arrowLength: this.arrowLength,
1724
- arrowOffset: this.arrowOffset,
1725
- roundness: this.roundness,
1726
- hasSourceArrow: this.hasSourceArrow,
1727
- hasTargetArrow: this.hasTargetArrow
1728
- });
1729
- constructor(e) {
1730
- this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowOffset = e?.arrowOffset ?? F.arrowOffset, this.cycleSquareSide = e?.cycleSquareSide ?? F.cycleSquareSide;
1731
- let t = e?.roundness ?? F.roundness;
1732
- this.roundness = Math.min(t, this.arrowOffset, this.cycleSquareSide / 2), this.detourDistance = e?.detourDistance ?? F.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? F.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? F.hasTargetArrow, this.pathShape = new I({
1733
- color: e?.color ?? F.color,
1734
- width: e?.width ?? F.width,
1735
- arrowRenderer: L(e?.arrowRenderer ?? {}),
1736
- arrowLength: this.arrowLength,
1737
- hasSourceArrow: this.hasSourceArrow,
1738
- hasTargetArrow: this.hasTargetArrow,
1739
- createCyclePath: this.createCyclePath,
1740
- createDetourPath: this.createDetourPath,
1741
- createLinePath: this.createLinePath,
1742
- padding: 50
1743
- }), this.element = this.pathShape.element, this.svg = this.element, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1744
- }
1745
- render(e) {
1746
- let { from: t, to: n, category: r } = e;
1747
- this.pathShape.render({
1748
- category: r,
1749
- from: {
1750
- ...t,
1751
- direction: Me(t.direction)
1752
- },
1753
- to: {
1754
- ...n,
1755
- direction: Me(n.direction)
1756
- }
1757
- });
1758
- }
1759
- }, Pe = class {
1625
+ }, Ae = class {
1760
1626
  element;
1761
- svg;
1762
1627
  group;
1763
1628
  line;
1764
1629
  sourceArrow;
@@ -1773,7 +1638,7 @@ var re = (e, t) => {
1773
1638
  hasSourceArrow;
1774
1639
  hasTargetArrow;
1775
1640
  pathShape;
1776
- createCyclePath = (e, t, n) => new P({
1641
+ createCyclePath = (e, t, n) => new ve({
1777
1642
  origin: e,
1778
1643
  dir: n,
1779
1644
  arrowLength: this.arrowLength,
@@ -1782,7 +1647,7 @@ var re = (e, t) => {
1782
1647
  roundness: this.roundness,
1783
1648
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1784
1649
  });
1785
- createDetourPath = (e, t, n, r) => new _e({
1650
+ createDetourPath = (e, t, n, r) => new he({
1786
1651
  from: e,
1787
1652
  to: t,
1788
1653
  fromDir: n,
@@ -1795,7 +1660,7 @@ var re = (e, t) => {
1795
1660
  hasSourceArrow: this.hasSourceArrow,
1796
1661
  hasTargetArrow: this.hasTargetArrow
1797
1662
  });
1798
- createLinePath = (e, t, n, r) => new ve({
1663
+ createLinePath = (e, t, n, r) => new ge({
1799
1664
  from: e,
1800
1665
  to: t,
1801
1666
  fromDir: n,
@@ -1820,95 +1685,16 @@ var re = (e, t) => {
1820
1685
  createDetourPath: this.createDetourPath,
1821
1686
  createLinePath: this.createLinePath,
1822
1687
  padding: 50
1823
- }), this.element = this.pathShape.element, this.svg = this.element, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1688
+ }), this.element = this.pathShape.element, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1824
1689
  }
1825
1690
  render(e) {
1826
1691
  this.pathShape.render(e);
1827
1692
  }
1828
- }, Fe = Math.PI / 2, Ie = (e) => Math.sin(e) > 0 ? Fe : -Fe, Le = class {
1829
- element;
1830
- svg;
1831
- group;
1832
- line;
1833
- sourceArrow;
1834
- targetArrow;
1835
- onAfterRender;
1836
- arrowLength;
1837
- arrowOffset;
1838
- roundness;
1839
- cycleSquareSide;
1840
- detourDistance;
1841
- hasSourceArrow;
1842
- hasTargetArrow;
1843
- pathShape;
1844
- createCyclePath = (e, t, n) => new P({
1845
- origin: e,
1846
- dir: n,
1847
- arrowLength: this.arrowLength,
1848
- side: this.cycleSquareSide,
1849
- arrowOffset: this.arrowOffset,
1850
- roundness: this.roundness,
1851
- hasArrow: this.hasSourceArrow || this.hasTargetArrow
1852
- });
1853
- createDetourPath = (e, t, n, r) => new Te({
1854
- from: e,
1855
- to: t,
1856
- fromDir: n,
1857
- toDir: r,
1858
- arrowLength: this.arrowLength,
1859
- arrowOffset: this.arrowOffset,
1860
- roundness: this.roundness,
1861
- detourDistance: this.detourDistance,
1862
- hasSourceArrow: this.hasSourceArrow,
1863
- hasTargetArrow: this.hasTargetArrow
1864
- });
1865
- createLinePath = (e, t, n, r) => new ye({
1866
- from: e,
1867
- to: t,
1868
- fromDir: n,
1869
- toDir: r,
1870
- arrowLength: this.arrowLength,
1871
- arrowOffset: this.arrowOffset,
1872
- roundness: this.roundness,
1873
- hasSourceArrow: this.hasSourceArrow,
1874
- hasTargetArrow: this.hasTargetArrow
1875
- });
1876
- constructor(e) {
1877
- this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowOffset = e?.arrowOffset ?? F.arrowOffset, this.cycleSquareSide = e?.cycleSquareSide ?? F.cycleSquareSide;
1878
- let t = e?.roundness ?? F.roundness;
1879
- this.roundness = Math.min(t, this.arrowOffset, this.cycleSquareSide / 2), this.detourDistance = e?.detourDistance ?? F.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? F.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? F.hasTargetArrow, this.pathShape = new I({
1880
- color: e?.color ?? F.color,
1881
- width: e?.width ?? F.width,
1882
- arrowRenderer: L(e?.arrowRenderer ?? {}),
1883
- arrowLength: this.arrowLength,
1884
- hasSourceArrow: this.hasSourceArrow,
1885
- hasTargetArrow: this.hasTargetArrow,
1886
- createCyclePath: this.createCyclePath,
1887
- createDetourPath: this.createDetourPath,
1888
- createLinePath: this.createLinePath,
1889
- padding: 50
1890
- }), this.element = this.pathShape.element, this.svg = this.element, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1891
- }
1892
- render(e) {
1893
- let { from: t, to: n, category: r } = e;
1894
- this.pathShape.render({
1895
- category: r,
1896
- from: {
1897
- ...t,
1898
- direction: Ie(t.direction)
1899
- },
1900
- to: {
1901
- ...n,
1902
- direction: Ie(n.direction)
1903
- }
1904
- });
1905
- }
1906
- }, Re = (e) => {
1693
+ }, je = (e) => {
1907
1694
  let t = e + Math.PI / 4, n = Math.cos(t), r = Math.sin(t);
1908
1695
  return n > 0 ? r > 0 ? 0 : -Math.PI / 2 : r > 0 ? Math.PI / 2 : Math.PI;
1909
- }, ze = class {
1696
+ }, Me = class {
1910
1697
  element;
1911
- svg;
1912
1698
  group;
1913
1699
  line;
1914
1700
  sourceArrow;
@@ -1922,7 +1708,7 @@ var re = (e, t) => {
1922
1708
  hasSourceArrow;
1923
1709
  hasTargetArrow;
1924
1710
  pathShape;
1925
- createCyclePath = (e, t, n) => new P({
1711
+ createCyclePath = (e, t, n) => new ve({
1926
1712
  origin: e,
1927
1713
  dir: n,
1928
1714
  arrowLength: this.arrowLength,
@@ -1931,7 +1717,7 @@ var re = (e, t) => {
1931
1717
  roundness: this.roundness,
1932
1718
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1933
1719
  });
1934
- createDetourPath = (e, t, n, r) => new Ee({
1720
+ createDetourPath = (e, t, n, r) => new we({
1935
1721
  from: e,
1936
1722
  to: t,
1937
1723
  fromDir: n,
@@ -1943,7 +1729,7 @@ var re = (e, t) => {
1943
1729
  hasSourceArrow: this.hasSourceArrow,
1944
1730
  hasTargetArrow: this.hasTargetArrow
1945
1731
  });
1946
- createLinePath = (e, t, n, r) => new be({
1732
+ createLinePath = (e, t, n, r) => new _e({
1947
1733
  from: e,
1948
1734
  to: t,
1949
1735
  fromDir: n,
@@ -1968,7 +1754,7 @@ var re = (e, t) => {
1968
1754
  createDetourPath: this.createDetourPath,
1969
1755
  createLinePath: this.createLinePath,
1970
1756
  padding: 50
1971
- }), this.element = this.pathShape.element, this.svg = this.element, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1757
+ }), this.element = this.pathShape.element, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1972
1758
  }
1973
1759
  render(e) {
1974
1760
  let { from: t, to: n, category: r } = e;
@@ -1976,20 +1762,19 @@ var re = (e, t) => {
1976
1762
  category: r,
1977
1763
  from: {
1978
1764
  ...t,
1979
- direction: Re(t.direction)
1765
+ direction: je(t.direction)
1980
1766
  },
1981
1767
  to: {
1982
1768
  ...n,
1983
- direction: Re(n.direction)
1769
+ direction: je(n.direction)
1984
1770
  }
1985
1771
  });
1986
1772
  }
1987
- }, Be = (e) => {
1773
+ }, Ne = (e) => {
1988
1774
  let { direction: t, radius: n } = e, { x: r, y: i } = t, { horizontal: a, vertical: o } = n, s = i / r, c = Math.abs(o / s), l = Math.abs(a * s), u = Math.min(a, c), d = Math.min(o, l);
1989
1775
  return Math.sqrt(u * u + d * d);
1990
- }, Ve = (e) => typeof e == "number" ? () => e : e === "box" ? Be : e, He = F.portOffset, R = class {
1776
+ }, Pe = (e) => typeof e == "number" ? () => e : e === "box" ? Ne : e, Fe = F.portOffset, R = class {
1991
1777
  element;
1992
- svg;
1993
1778
  group = document.createElementNS("http://www.w3.org/2000/svg", "g");
1994
1779
  line;
1995
1780
  sourceArrow = null;
@@ -2003,11 +1788,11 @@ var re = (e, t) => {
2003
1788
  afterRenderEmitter;
2004
1789
  arrowRenderer;
2005
1790
  constructor(e) {
2006
- [this.afterRenderEmitter, this.onAfterRender] = u(), this.color = e?.color ?? F.color, this.width = e?.width ?? F.width, this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowRenderer = L(e?.arrowRenderer ?? {}), this.sourceOffsetFn = Ve(e?.sourceOffset ?? He), this.targetOffsetFn = Ve(e?.targetOffset ?? He), this.element = ce(this.color), this.svg = this.element, this.element.appendChild(this.group), this.line = le(this.width), this.group.appendChild(this.line), e?.hasSourceArrow && (this.sourceArrow = A(), this.group.appendChild(this.sourceArrow)), e?.hasTargetArrow && (this.targetArrow = A(), this.group.appendChild(this.targetArrow));
1791
+ [this.afterRenderEmitter, this.onAfterRender] = u(), this.color = e?.color ?? F.color, this.width = e?.width ?? F.width, this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowRenderer = L(e?.arrowRenderer ?? {}), this.sourceOffsetFn = Pe(e?.sourceOffset ?? Fe), this.targetOffsetFn = Pe(e?.targetOffset ?? Fe), this.element = se(this.color), this.element.appendChild(this.group), this.line = ce(this.width), this.group.appendChild(this.line), e?.hasSourceArrow && (this.sourceArrow = j(), this.group.appendChild(this.sourceArrow)), e?.hasTargetArrow && (this.targetArrow = j(), this.group.appendChild(this.targetArrow));
2007
1792
  }
2008
1793
  render(e) {
2009
- let { x: t, y: n, width: r, height: i, from: a, to: o } = ae(e.from, e.to, 50);
2010
- ue(this.element, {
1794
+ let { x: t, y: n, width: r, height: i, from: a, to: o } = ie(e.from, e.to, 50);
1795
+ le(this.element, {
2011
1796
  x: t,
2012
1797
  y: n,
2013
1798
  width: r,
@@ -2105,44 +1890,43 @@ var re = (e, t) => {
2105
1890
  targetArrowPath: n
2106
1891
  });
2107
1892
  }
2108
- }, Ue = () => {
1893
+ }, Ie = () => {
2109
1894
  let e = document.createElementNS("http://www.w3.org/2000/svg", "g");
2110
1895
  return e.style.pointerEvents = "auto", e.style.cursor = "pointer", e;
2111
- }, We = (e) => {
1896
+ }, Le = (e) => {
2112
1897
  let t = document.createElementNS("http://www.w3.org/2000/svg", "path");
2113
1898
  return t.setAttribute("stroke", "transparent"), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "none"), t.setAttribute("stroke-linecap", "round"), t;
2114
- }, Ge = (e) => {
1899
+ }, Re = (e) => {
2115
1900
  let t = document.createElementNS("http://www.w3.org/2000/svg", "path");
2116
1901
  return t.setAttribute("stroke-linejoin", "round"), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "transparent"), t.setAttribute("stroke", "transparent"), t;
2117
- }, Ke = class extends Error {
1902
+ }, ze = class extends Error {
2118
1903
  constructor(e) {
2119
1904
  super(e), this.name = "InteractiveEdgeError";
2120
1905
  }
2121
- }, qe = class e {
1906
+ }, Be = class e {
2122
1907
  baseEdge;
2123
1908
  element;
2124
- svg;
2125
1909
  group;
2126
1910
  line;
2127
1911
  sourceArrow;
2128
1912
  targetArrow;
2129
- handle = Ue();
1913
+ handle = Ie();
2130
1914
  onAfterRender;
2131
1915
  interactiveLine;
2132
1916
  interactiveSourceArrow = null;
2133
1917
  interactiveTargetArrow = null;
2134
1918
  constructor(t, n) {
2135
- if (this.baseEdge = t, t instanceof e) throw new Ke("interactive edge can be configured only once");
2136
- this.element = this.baseEdge.element, this.svg = this.element, 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;
1919
+ if (this.baseEdge = t, t instanceof e) throw new ze("interactive edge can be configured only once");
1920
+ this.element = this.baseEdge.element, 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;
2137
1921
  let r = n?.distance ?? F.interactiveWidth;
2138
- this.interactiveLine = We(r), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = Ge(r), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = Ge(r), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((e) => {
1922
+ this.interactiveLine = Le(r), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = Re(r), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = Re(r), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((e) => {
2139
1923
  this.interactiveLine.setAttribute("d", e.edgePath.path), this.interactiveSourceArrow && this.interactiveSourceArrow.setAttribute("d", e.sourceArrowPath), this.interactiveTargetArrow && this.interactiveTargetArrow.setAttribute("d", e.targetArrowPath);
2140
1924
  });
2141
1925
  }
2142
1926
  render(e) {
2143
1927
  this.baseEdge.render(e);
2144
1928
  }
2145
- }, Je = class {
1929
+ }, Ve = class {
2146
1930
  baseShape;
2147
1931
  midpointElement;
2148
1932
  group;
@@ -2151,9 +1935,8 @@ var re = (e, t) => {
2151
1935
  targetArrow;
2152
1936
  onAfterRender;
2153
1937
  element;
2154
- svg;
2155
1938
  constructor(e, t) {
2156
- this.baseShape = e, this.midpointElement = t, this.element = this.baseShape.element, this.svg = this.element, this.group = this.baseShape.group, this.line = this.baseShape.line, this.sourceArrow = this.baseShape.sourceArrow, this.targetArrow = this.baseShape.targetArrow, this.onAfterRender = this.baseShape.onAfterRender, this.element.append(this.midpointElement), this.baseShape.onAfterRender.subscribe((e) => {
1939
+ this.baseShape = e, this.midpointElement = t, this.element = this.baseShape.element, this.group = this.baseShape.group, this.line = this.baseShape.line, this.sourceArrow = this.baseShape.sourceArrow, this.targetArrow = this.baseShape.targetArrow, this.onAfterRender = this.baseShape.onAfterRender, this.element.append(this.midpointElement), this.baseShape.onAfterRender.subscribe((e) => {
2157
1940
  let t = e.edgePath.midpoint, n = `translate(${t.x}px, ${t.y}px)`;
2158
1941
  this.midpointElement.style.setProperty("transform", n);
2159
1942
  });
@@ -2161,7 +1944,7 @@ var re = (e, t) => {
2161
1944
  render(e) {
2162
1945
  this.baseShape.render(e);
2163
1946
  }
2164
- }, Ye = class {
1947
+ }, He = class {
2165
1948
  graphStore;
2166
1949
  onAfterNodeAdded;
2167
1950
  onAfterNodeUpdated;
@@ -2274,7 +2057,7 @@ var re = (e, t) => {
2274
2057
  reset() {
2275
2058
  this.counter = 0;
2276
2059
  }
2277
- }, Xe = class {
2060
+ }, Ue = class {
2278
2061
  graphStore;
2279
2062
  htmlView;
2280
2063
  params;
@@ -2387,17 +2170,13 @@ var re = (e, t) => {
2387
2170
  destroy() {
2388
2171
  this.graphStore.onAfterNodeAdded.unsubscribe(this.onAfterNodeAdded), this.graphStore.onAfterNodeUpdated.unsubscribe(this.onAfterNodeUpdated), this.graphStore.onAfterNodePriorityUpdated.unsubscribe(this.onAfterNodePriorityUpdated), this.graphStore.onBeforeNodeRemoved.unsubscribe(this.onBeforeNodeRemoved), this.graphStore.onAfterPortUpdated.unsubscribe(this.onAfterPortUpdated), this.graphStore.onBeforePortRemoved.unsubscribe(this.onBeforePortUnmarked), this.graphStore.onAfterEdgeAdded.unsubscribe(this.onAfterEdgeAdded), this.graphStore.onAfterEdgeShapeUpdated.unsubscribe(this.onAfterEdgeShapeUpdated), this.graphStore.onAfterEdgeUpdated.unsubscribe(this.onAfterEdgeUpdated), this.graphStore.onAfterEdgePriorityUpdated.unsubscribe(this.onAfterEdgePriorityUpdated), this.graphStore.onBeforeEdgeRemoved.unsubscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.unsubscribe(this.onBeforeClear), this.htmlView.destroy();
2389
2172
  }
2390
- }, Ze = (e) => {
2391
- setTimeout(() => {
2392
- e();
2393
- });
2394
- }, Qe = (e) => {
2173
+ }, We = (e) => {
2395
2174
  queueMicrotask(() => {
2396
2175
  e();
2397
2176
  });
2398
2177
  }, B = (e) => {
2399
2178
  e();
2400
- }, $e = class {
2179
+ }, Ge = class {
2401
2180
  viewportStore;
2402
2181
  onBeforeUpdated;
2403
2182
  onAfterUpdated;
@@ -2420,7 +2199,7 @@ var re = (e, t) => {
2420
2199
  createViewportCoords(e) {
2421
2200
  return this.viewportStore.createViewportCoords(e);
2422
2201
  }
2423
- }, et = (e, t) => Symbol.iterator in e ? {
2202
+ }, Ke = (e, t) => Symbol.iterator in e ? {
2424
2203
  minContentScale: t.focus.minContentScale,
2425
2204
  nodes: e,
2426
2205
  contentPadding: t.focus.contentPadding,
@@ -2428,17 +2207,17 @@ var re = (e, t) => {
2428
2207
  } : {
2429
2208
  minContentScale: e.minContentScale ?? t.focus.minContentScale,
2430
2209
  nodes: e.nodes ?? [],
2431
- contentPadding: e.contentPadding ?? e.contentOffset ?? t.focus.contentPadding,
2210
+ contentPadding: e.contentPadding ?? t.focus.contentPadding,
2432
2211
  animationDuration: e.animationDuration ?? t.focus.animationDuration
2433
- }, tt = (e, t, n) => ({
2212
+ }, qe = (e, t, n) => ({
2434
2213
  scale: e.scale,
2435
2214
  x: e.x + e.scale * t,
2436
2215
  y: e.y + e.scale * n
2437
- }), nt = (e, t, n, r) => ({
2216
+ }), Je = (e, t, n, r) => ({
2438
2217
  scale: e.scale * t,
2439
2218
  x: e.scale * (1 - t) * n + e.x,
2440
2219
  y: e.scale * (1 - t) * r + e.y
2441
- }), rt = class {
2220
+ }), Ye = class {
2442
2221
  graphStore;
2443
2222
  viewportStore;
2444
2223
  params;
@@ -2456,16 +2235,16 @@ var re = (e, t) => {
2456
2235
  let { width: n, height: r } = this.viewportStore.getDimensions(), i = {
2457
2236
  x: n / 2,
2458
2237
  y: r / 2
2459
- }, a = this.viewportStore.getViewportMatrix(), o = this.viewportStore.createViewportCoords(e), s = tt(a, o.x - i.x, o.y - i.y), c = t?.contentScale;
2238
+ }, a = this.viewportStore.getViewportMatrix(), o = this.viewportStore.createViewportCoords(e), s = qe(a, o.x - i.x, o.y - i.y), c = t?.contentScale;
2460
2239
  if (c !== void 0) {
2461
2240
  let e = 1 / c;
2462
- s = nt(s, e / a.scale, i.x, i.y);
2241
+ s = Je(s, e / a.scale, i.x, i.y);
2463
2242
  }
2464
2243
  let l = t?.animationDuration ?? 0;
2465
2244
  l > 0 ? this.animateNavigation(a, s, l) : this.viewportStore.patchViewportMatrix(s);
2466
2245
  }
2467
2246
  focus(e) {
2468
- let t = et(e ?? {}, this.params);
2247
+ let t = Ke(e ?? {}, this.params);
2469
2248
  this.params.focus.schedule(() => {
2470
2249
  this.navigate(t);
2471
2250
  });
@@ -2507,11 +2286,11 @@ var re = (e, t) => {
2507
2286
  };
2508
2287
  this.win.requestAnimationFrame(a);
2509
2288
  }
2510
- }, it = (e, t, n) => {
2289
+ }, Xe = (e, t, n) => {
2511
2290
  let r = new h();
2512
- return new d(new Ye(r), new $e(t), new Xe(r, new a(r, t, e), {
2291
+ return new d(new He(r), new Ge(t), new Ue(r, new a(r, t, e), {
2513
2292
  nodes: {
2514
- centerFn: ie,
2293
+ centerFn: re,
2515
2294
  priorityFn: () => 0
2516
2295
  },
2517
2296
  edges: {
@@ -2519,13 +2298,13 @@ var re = (e, t) => {
2519
2298
  priorityFn: () => 0
2520
2299
  },
2521
2300
  ports: { direction: 0 }
2522
- }), new rt(r, t, { focus: {
2301
+ }), new Ye(r, t, { focus: {
2523
2302
  contentPadding: 0,
2524
2303
  minContentScale: 0,
2525
2304
  schedule: B,
2526
2305
  animationDuration: 0
2527
2306
  } }, n));
2528
- }, V = Symbol(), at = class e {
2307
+ }, V = Symbol(), Ze = class e {
2529
2308
  canvas;
2530
2309
  window;
2531
2310
  pointInsideVerifier;
@@ -2619,7 +2398,7 @@ var re = (e, t) => {
2619
2398
  removeWindowTouchListeners() {
2620
2399
  this.window.removeEventListener("touchmove", this.onWindowTouchMove), this.window.removeEventListener("touchend", this.onWindowTouchFinish), this.window.removeEventListener("touchcancel", this.onWindowTouchFinish);
2621
2400
  }
2622
- }, H = Symbol(), ot = class {
2401
+ }, H = Symbol(), Qe = class {
2623
2402
  has(e, t) {
2624
2403
  let n = e[H];
2625
2404
  return n !== void 0 && n.has(t);
@@ -2709,10 +2488,10 @@ var re = (e, t) => {
2709
2488
  let r = Math.sqrt(e * e + t * t);
2710
2489
  this.movedDistance += r, this.movedDistance > this.movementThreshold && n();
2711
2490
  }
2712
- }, st = (e, t) => ({
2491
+ }, G = (e, t) => ({
2713
2492
  from: e.isDirect ? e.staticPortId : t,
2714
2493
  to: e.isDirect ? t : e.staticPortId
2715
- }), ct = class {
2494
+ }), $e = class {
2716
2495
  graph;
2717
2496
  connectionAllowedVerifier;
2718
2497
  constructor(e, t) {
@@ -2723,7 +2502,7 @@ var re = (e, t) => {
2723
2502
  return this.graph.getAllPortIds().forEach((i) => {
2724
2503
  let { element: a, direction: o, nodeId: s } = this.graph.getPort(i), { x: c, y: l } = this.graph.getNode(s);
2725
2504
  if (c === null || l === null) return;
2726
- let u = st(e, i);
2505
+ let u = G(e, i);
2727
2506
  if (!this.connectionAllowedVerifier(u)) return;
2728
2507
  let { top: d, left: f, width: p, height: m } = a.getBoundingClientRect(), h = {
2729
2508
  x: f + p / 2,
@@ -2732,7 +2511,7 @@ var re = (e, t) => {
2732
2511
  v < n && (n = v, t = o);
2733
2512
  }), t;
2734
2513
  }
2735
- }, lt = class {
2514
+ }, et = class {
2736
2515
  direction;
2737
2516
  constructor(e) {
2738
2517
  this.direction = e;
@@ -2740,7 +2519,7 @@ var re = (e, t) => {
2740
2519
  resolve() {
2741
2520
  return this.direction;
2742
2521
  }
2743
- }, ut = class e {
2522
+ }, tt = class e {
2744
2523
  canvas;
2745
2524
  element;
2746
2525
  window;
@@ -2777,19 +2556,14 @@ var re = (e, t) => {
2777
2556
  nodeId: r,
2778
2557
  dx: a.x - i.x,
2779
2558
  dy: a.y - i.y
2780
- }, C(this.element, this.params.dragCursor), this.moveNodeOnTop(r), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 });
2559
+ }, w(this.element, this.params.dragCursor), this.moveNodeOnTop(r), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 });
2781
2560
  };
2782
2561
  onTouchStart = (e) => {
2783
2562
  if (this.eventTagger.has(e, V)) return;
2784
2563
  let t = e;
2785
2564
  if (t.touches.length !== 1) return;
2786
2565
  let n = t.touches[0], r = e.currentTarget, i = this.canvas.graph.findNodeIdByElement(r), a = this.graph.getNode(i);
2787
- if (!this.params.nodeDragVerifier({
2788
- nodeId: i,
2789
- element: a.element,
2790
- x: a.x,
2791
- y: a.y
2792
- })) return;
2566
+ if (!this.params.nodeDragVerifier(i)) return;
2793
2567
  this.eventTagger.tag(e, V);
2794
2568
  let o = this.calculateContentPoint({
2795
2569
  x: n.clientX,
@@ -2867,7 +2641,7 @@ var re = (e, t) => {
2867
2641
  }
2868
2642
  }
2869
2643
  stopMouseDrag() {
2870
- this.finishDrag(), C(this.element, null), this.removeMouseDragListeners();
2644
+ this.finishDrag(), w(this.element, null), this.removeMouseDragListeners();
2871
2645
  }
2872
2646
  removeMouseDragListeners() {
2873
2647
  this.window.removeEventListener("mouseup", this.onWindowMouseUp), this.window.removeEventListener("mousemove", this.onWindowMouseMove);
@@ -2904,7 +2678,7 @@ var re = (e, t) => {
2904
2678
  let e = this.grabbedNodeState.nodeId;
2905
2679
  this.graph.hasNode(e) && this.params.onNodeDragFinished(e), this.grabbedNodeState = null;
2906
2680
  }
2907
- }, G = (e) => {
2681
+ }, K = (e) => {
2908
2682
  let t = [], n = e.touches.length;
2909
2683
  for (let r = 0; r < n; r++) t.push([e.touches[r].clientX, e.touches[r].clientY]);
2910
2684
  let r = t.reduce((e, t) => [e[0] + t[0], e[1] + t[1]], [0, 0]), i = [r[0] / n, r[1] / n], a = t.map((e) => [e[0] - i[0], e[1] - i[1]]).reduce((e, t) => e + Math.sqrt(t[0] * t[0] + t[1] * t[1]), 0);
@@ -2915,7 +2689,7 @@ var re = (e, t) => {
2915
2689
  touchesCnt: n,
2916
2690
  touches: t
2917
2691
  };
2918
- }, dt = class e {
2692
+ }, nt = class e {
2919
2693
  canvas;
2920
2694
  element;
2921
2695
  window;
@@ -2930,7 +2704,7 @@ var re = (e, t) => {
2930
2704
  this.removeMouseDragListeners(), this.removeTouchDragListeners();
2931
2705
  };
2932
2706
  onMouseDown = (e) => {
2933
- this.eventTagger.has(e, V) || this.params.mouseDownEventVerifier(e) && (C(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 }), this.startRegisteredTransform());
2707
+ this.eventTagger.has(e, V) || this.params.mouseDownEventVerifier(e) && (w(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 }), this.startRegisteredTransform());
2934
2708
  };
2935
2709
  onWindowMouseMove = (e) => {
2936
2710
  let t = this.pointInsideVerifier.verify(e.clientX, e.clientY);
@@ -2954,14 +2728,14 @@ var re = (e, t) => {
2954
2728
  onTouchStart = (e) => {
2955
2729
  if (!this.eventTagger.has(e, V)) {
2956
2730
  if (this.prevTouches !== null) {
2957
- this.prevTouches = G(e);
2731
+ this.prevTouches = K(e);
2958
2732
  return;
2959
2733
  }
2960
- this.prevTouches = G(e), this.window.addEventListener("touchmove", this.onWindowTouchMove, { passive: !0 }), this.window.addEventListener("touchend", this.onWindowTouchFinish, { passive: !0 }), this.window.addEventListener("touchcancel", this.onWindowTouchFinish, { passive: !0 }), this.startRegisteredTransform();
2734
+ this.prevTouches = K(e), this.window.addEventListener("touchmove", this.onWindowTouchMove, { passive: !0 }), this.window.addEventListener("touchend", this.onWindowTouchFinish, { passive: !0 }), this.window.addEventListener("touchcancel", this.onWindowTouchFinish, { passive: !0 }), this.startRegisteredTransform();
2961
2735
  }
2962
2736
  };
2963
2737
  onWindowTouchMove = (e) => {
2964
- let t = G(e);
2738
+ let t = K(e);
2965
2739
  if (!t.touches.every((e) => this.pointInsideVerifier.verify(e[0], e[1]))) {
2966
2740
  this.stopTouchDrag();
2967
2741
  return;
@@ -2977,7 +2751,7 @@ var re = (e, t) => {
2977
2751
  this.prevTouches = t;
2978
2752
  };
2979
2753
  onWindowTouchFinish = (e) => {
2980
- e.touches.length > 0 ? this.prevTouches = G(e) : this.stopTouchDrag();
2754
+ e.touches.length > 0 ? this.prevTouches = K(e) : this.stopTouchDrag();
2981
2755
  };
2982
2756
  preventWheelScaleListener = (e) => {
2983
2757
  e.preventDefault();
@@ -2991,25 +2765,29 @@ var re = (e, t) => {
2991
2765
  new e(t, n, r, i, a, o);
2992
2766
  }
2993
2767
  moveViewport(e, t) {
2994
- let n = this.viewport.getViewportMatrix(), r = tt(n, e, t), { width: i, height: a } = this.viewport.getDimensions(), o = this.params.transformPreprocessor({
2768
+ let n = this.viewport.getViewportMatrix(), r = qe(n, e, t), { width: i, height: a } = this.viewport.getDimensions(), o = this.params.transformPreprocessor({
2995
2769
  prevTransform: n,
2996
2770
  nextTransform: r,
2997
- canvasWidth: i,
2998
- canvasHeight: a
2771
+ viewport: {
2772
+ width: i,
2773
+ height: a
2774
+ }
2999
2775
  });
3000
2776
  this.performTransform(o);
3001
2777
  }
3002
2778
  scaleViewport(e, t, n) {
3003
- let r = this.canvas.viewport.getViewportMatrix(), i = nt(r, e, t, n), { width: a, height: o } = this.viewport.getDimensions(), s = this.params.transformPreprocessor({
2779
+ let r = this.canvas.viewport.getViewportMatrix(), i = Je(r, e, t, n), { width: a, height: o } = this.viewport.getDimensions(), s = this.params.transformPreprocessor({
3004
2780
  prevTransform: r,
3005
2781
  nextTransform: i,
3006
- canvasWidth: a,
3007
- canvasHeight: o
2782
+ viewport: {
2783
+ width: a,
2784
+ height: o
2785
+ }
3008
2786
  });
3009
2787
  this.performTransform(s);
3010
2788
  }
3011
2789
  stopMouseDrag() {
3012
- C(this.element, null), this.removeMouseDragListeners(), this.finishRegisteredTransform();
2790
+ w(this.element, null), this.removeMouseDragListeners(), this.finishRegisteredTransform();
3013
2791
  }
3014
2792
  removeMouseDragListeners() {
3015
2793
  this.window.removeEventListener("mousemove", this.onWindowMouseMove), this.window.removeEventListener("mouseup", this.onWindowMouseUp);
@@ -3033,12 +2811,14 @@ var re = (e, t) => {
3033
2811
  let e = this.viewport.getViewportMatrix(), { width: t, height: n } = this.viewport.getDimensions(), r = this.params.transformPreprocessor({
3034
2812
  prevTransform: e,
3035
2813
  nextTransform: e,
3036
- canvasWidth: t,
3037
- canvasHeight: n
2814
+ viewport: {
2815
+ width: t,
2816
+ height: n
2817
+ }
3038
2818
  });
3039
2819
  this.params.onResizeTransformStarted(), this.canvas.patchViewportMatrix(r), this.params.onResizeTransformFinished();
3040
2820
  }
3041
- }, ft = class e {
2821
+ }, rt = class e {
3042
2822
  canvas;
3043
2823
  element;
3044
2824
  window;
@@ -3091,7 +2871,7 @@ var re = (e, t) => {
3091
2871
  this.scheduleLoadAreaAroundViewport(), r.onTransformFinished();
3092
2872
  }
3093
2873
  };
3094
- dt.configure(e, this.element, this.window, this.pointInsideVerifier, o, c), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
2874
+ nt.configure(e, this.element, this.window, this.pointInsideVerifier, o, c), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
3095
2875
  }
3096
2876
  static configure(t, n, r, i, a, o, s, c) {
3097
2877
  new e(t, n, r, i, a, o, s, c);
@@ -3116,21 +2896,21 @@ var re = (e, t) => {
3116
2896
  height: u
3117
2897
  });
3118
2898
  }
3119
- }, pt = () => {
2899
+ }, it = () => {
3120
2900
  let e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3121
2901
  return e.style.position = "absolute", e.style.inset = "0", e;
3122
- }, mt = () => {
2902
+ }, at = () => {
3123
2903
  let e = document.createElementNS("http://www.w3.org/2000/svg", "rect");
3124
2904
  return e.setAttribute("fill", "url(#pattern)"), e;
3125
- }, ht = () => {
2905
+ }, ot = () => {
3126
2906
  let e = document.createElementNS("http://www.w3.org/2000/svg", "pattern");
3127
2907
  return e.setAttribute("id", "pattern"), e;
3128
- }, gt = class e {
2908
+ }, st = class e {
3129
2909
  canvas;
3130
2910
  backgroundHost;
3131
- svg = pt();
3132
- patternRenderingRectangle = mt();
3133
- pattern = ht();
2911
+ svg = it();
2912
+ patternRenderingRectangle = at();
2913
+ pattern = ot();
3134
2914
  patternContent;
3135
2915
  tileWidth;
3136
2916
  tileHeight;
@@ -3165,7 +2945,7 @@ var re = (e, t) => {
3165
2945
  this.pattern.setAttribute("width", `${n}`), this.pattern.setAttribute("height", `${r}`);
3166
2946
  }
3167
2947
  }
3168
- }, _t = class e {
2948
+ }, ct = class e {
3169
2949
  canvas;
3170
2950
  overlayLayer;
3171
2951
  viewportStore;
@@ -3179,7 +2959,7 @@ var re = (e, t) => {
3179
2959
  this.params.onAfterEdgeCreated(e);
3180
2960
  };
3181
2961
  constructor(e, t, n, r, i, a, o) {
3182
- this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = it(this.overlayLayer, this.viewportStore, this.window);
2962
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = Xe(this.overlayLayer, this.viewportStore, this.window);
3183
2963
  let s = {
3184
2964
  mouseDownEventVerifier: this.params.mouseDownEventVerifier,
3185
2965
  mouseUpEventVerifier: this.params.mouseUpEventVerifier,
@@ -3198,7 +2978,7 @@ var re = (e, t) => {
3198
2978
  this.resetDragState(), this.params.onEdgeCreationInterrupted(e);
3199
2979
  }
3200
2980
  };
3201
- at.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
2981
+ Ze.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
3202
2982
  }
3203
2983
  static configure(t, n, r, i, a, o, s) {
3204
2984
  new e(t, n, r, i, a, o, s);
@@ -3211,7 +2991,7 @@ var re = (e, t) => {
3211
2991
  x: t.x - s.x,
3212
2992
  y: t.y - s.y
3213
2993
  }), u = {
3214
- overlayNodeId: T.StaticNodeId,
2994
+ overlayNodeId: E.StaticNodeId,
3215
2995
  portCoords: c,
3216
2996
  portDirection: r.direction
3217
2997
  }, d = n === "direct";
@@ -3223,26 +3003,26 @@ var re = (e, t) => {
3223
3003
  cursor: t,
3224
3004
  ...this.edgeInProgress
3225
3005
  }), p = {
3226
- overlayNodeId: T.DraggingNodeId,
3006
+ overlayNodeId: E.DraggingNodeId,
3227
3007
  portCoords: l,
3228
3008
  portDirection: f ?? r.direction
3229
3009
  }, [m, h] = d ? [u, p] : [p, u];
3230
- this.overlayCanvas.addNode(w(m)), this.overlayCanvas.addNode(w(h)), this.overlayCanvas.addEdge({
3010
+ this.overlayCanvas.addNode(T(m)), this.overlayCanvas.addNode(T(h)), this.overlayCanvas.addEdge({
3231
3011
  from: m.overlayNodeId,
3232
3012
  to: h.overlayNodeId,
3233
- shape: this.params.edgeShapeFactory(T.EdgeId)
3013
+ shape: this.params.edgeShapeFactory(E.EdgeId)
3234
3014
  });
3235
3015
  }
3236
3016
  resetDragState() {
3237
3017
  this.edgeInProgress = null, this.overlayCanvas.clear();
3238
3018
  }
3239
3019
  tryCreateConnection(e) {
3240
- let t = re(this.canvas.graph, e);
3020
+ let t = ne(this.canvas.graph, e);
3241
3021
  if (t === null) {
3242
3022
  this.params.onEdgeCreationInterrupted(this.edgeInProgress);
3243
3023
  return;
3244
3024
  }
3245
- let n = st(this.edgeInProgress, t), r = this.params.connectionAllowedVerifier(n), i = this.params.connectionPreprocessor({
3025
+ let n = G(this.edgeInProgress, t), r = this.params.connectionAllowedVerifier(n), i = this.params.connectionPreprocessor({
3246
3026
  from: n.from,
3247
3027
  to: n.to
3248
3028
  });
@@ -3256,12 +3036,12 @@ var re = (e, t) => {
3256
3036
  cursor: e,
3257
3037
  ...this.edgeInProgress
3258
3038
  });
3259
- this.overlayCanvas.updateNode(T.DraggingNodeId, {
3039
+ this.overlayCanvas.updateNode(E.DraggingNodeId, {
3260
3040
  x: n.x,
3261
3041
  y: n.y
3262
- }).updatePort(T.DraggingNodeId, { direction: r });
3042
+ }).updatePort(E.DraggingNodeId, { direction: r });
3263
3043
  }
3264
- }, vt = class e {
3044
+ }, lt = class e {
3265
3045
  canvas;
3266
3046
  overlayLayer;
3267
3047
  viewportStore;
@@ -3276,7 +3056,7 @@ var re = (e, t) => {
3276
3056
  this.params.onAfterEdgeReattached(e);
3277
3057
  };
3278
3058
  constructor(e, t, n, r, i, a, o) {
3279
- this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = it(this.overlayLayer, this.viewportStore, this.window);
3059
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = Xe(this.overlayLayer, this.viewportStore, this.window);
3280
3060
  let s = {
3281
3061
  mouseDownEventVerifier: this.params.mouseDownEventVerifier,
3282
3062
  mouseUpEventVerifier: this.params.mouseUpEventVerifier,
@@ -3298,7 +3078,7 @@ var re = (e, t) => {
3298
3078
  });
3299
3079
  }
3300
3080
  };
3301
- at.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
3081
+ Ze.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
3302
3082
  }
3303
3083
  static configure(t, n, r, i, a, o, s) {
3304
3084
  new e(t, n, r, i, a, o, s);
@@ -3329,21 +3109,21 @@ var re = (e, t) => {
3329
3109
  priority: r.priority
3330
3110
  }, this.canvas.removeEdge(n);
3331
3111
  let m = {
3332
- overlayNodeId: T.StaticNodeId,
3112
+ overlayNodeId: E.StaticNodeId,
3333
3113
  portCoords: f,
3334
3114
  portDirection: c.direction
3335
3115
  }, h = this.params.draggingPortDirectionResolver.resolve({
3336
3116
  cursor: t,
3337
3117
  ...this.edgeInProgress
3338
3118
  }), g = {
3339
- overlayNodeId: T.DraggingNodeId,
3119
+ overlayNodeId: E.DraggingNodeId,
3340
3120
  portCoords: p,
3341
3121
  portDirection: h ?? s.direction
3342
3122
  }, [_, v] = a ? [m, g] : [g, m];
3343
- this.overlayCanvas.addNode(w(_)), this.overlayCanvas.addNode(w(v));
3344
- let y = this.params.draggingEdgeShapeFactory === null ? r.shape : this.params.draggingEdgeShapeFactory(T.EdgeId);
3123
+ this.overlayCanvas.addNode(T(_)), this.overlayCanvas.addNode(T(v));
3124
+ let y = this.params.draggingEdgeShapeFactory === null ? r.shape : this.params.draggingEdgeShapeFactory(E.EdgeId);
3345
3125
  return this.overlayCanvas.addEdge({
3346
- id: T.EdgeId,
3126
+ id: E.EdgeId,
3347
3127
  from: _.overlayNodeId,
3348
3128
  to: v.overlayNodeId,
3349
3129
  shape: y
@@ -3360,14 +3140,14 @@ var re = (e, t) => {
3360
3140
  cursor: e,
3361
3141
  ...this.edgeInProgress
3362
3142
  });
3363
- this.overlayCanvas.updateNode(T.DraggingNodeId, {
3143
+ this.overlayCanvas.updateNode(E.DraggingNodeId, {
3364
3144
  x: r.x,
3365
3145
  y: r.y
3366
- }).updatePort(T.DraggingNodeId, { direction: i });
3146
+ }).updatePort(E.DraggingNodeId, { direction: i });
3367
3147
  }
3368
3148
  tryCreateConnection(e) {
3369
- let t = re(this.canvas.graph, e);
3370
- if (this.overlayCanvas.removeEdge(T.EdgeId), t === null) {
3149
+ let t = ne(this.canvas.graph, e);
3150
+ if (this.overlayCanvas.removeEdge(E.EdgeId), t === null) {
3371
3151
  let e = this.draggingEdgePayload;
3372
3152
  this.params.onEdgeReattachInterrupted({
3373
3153
  id: e.id,
@@ -3378,7 +3158,7 @@ var re = (e, t) => {
3378
3158
  });
3379
3159
  return;
3380
3160
  }
3381
- let { from: n, to: r } = st(this.edgeInProgress, t), i = this.draggingEdgePayload, a = {
3161
+ let { from: n, to: r } = G(this.edgeInProgress, t), i = this.draggingEdgePayload, a = {
3382
3162
  id: i.id,
3383
3163
  from: n,
3384
3164
  to: r,
@@ -3400,7 +3180,7 @@ var re = (e, t) => {
3400
3180
  });
3401
3181
  }
3402
3182
  }
3403
- }, yt = class e {
3183
+ }, ut = class e {
3404
3184
  applier;
3405
3185
  trigger;
3406
3186
  constructor(e, t) {
@@ -3411,7 +3191,7 @@ var re = (e, t) => {
3411
3191
  static configure(t, n) {
3412
3192
  new e(t, n);
3413
3193
  }
3414
- }, bt = class e {
3194
+ }, dt = class e {
3415
3195
  graph;
3416
3196
  applier;
3417
3197
  defererFn;
@@ -3436,7 +3216,7 @@ var re = (e, t) => {
3436
3216
  scheduleApply() {
3437
3217
  this.applyScheduled || (this.applyScheduled = !0, this.defererFn(this.apply));
3438
3218
  }
3439
- }, xt = class {
3219
+ }, ft = class {
3440
3220
  canvas;
3441
3221
  layoutAlgorithm;
3442
3222
  params;
@@ -3452,23 +3232,23 @@ var re = (e, t) => {
3452
3232
  this.params.staticNodeResolver(t) || this.canvas.updateNode(t, e);
3453
3233
  }), this.params.onAfterApplied();
3454
3234
  }
3455
- }, St = class {
3235
+ }, pt = class {
3456
3236
  static configure(e, t) {
3457
- let n = t.applyOn, r = new xt(e, t.algorithm, {
3237
+ let n = t.applyOn, r = new ft(e, t.algorithm, {
3458
3238
  staticNodeResolver: t.staticNodeResolver,
3459
3239
  onBeforeApplied: t.onBeforeApplied,
3460
3240
  onAfterApplied: t.onAfterApplied
3461
3241
  });
3462
3242
  switch (n.type) {
3463
3243
  case "trigger":
3464
- yt.configure(r, n.trigger);
3244
+ ut.configure(r, n.trigger);
3465
3245
  break;
3466
3246
  case "topologyChangeSchedule":
3467
- bt.configure(e.graph, r, n.schedule);
3247
+ dt.configure(e.graph, r, n.schedule);
3468
3248
  break;
3469
3249
  }
3470
3250
  }
3471
- }, Ct = class {
3251
+ }, mt = class {
3472
3252
  win;
3473
3253
  callback;
3474
3254
  previousTimeStamp = void 0;
@@ -3483,7 +3263,7 @@ var re = (e, t) => {
3483
3263
  constructor(e, t) {
3484
3264
  this.win = e, this.callback = t, this.win.requestAnimationFrame(this.step);
3485
3265
  }
3486
- }, wt = class {
3266
+ }, ht = class {
3487
3267
  canvas;
3488
3268
  layoutAlgorithm;
3489
3269
  params;
@@ -3500,23 +3280,23 @@ var re = (e, t) => {
3500
3280
  this.params.staticNodeResolver(t) || this.canvas.updateNode(t, e);
3501
3281
  }), this.params.onAfterApplied();
3502
3282
  }
3503
- }, Tt = class e {
3283
+ }, gt = class e {
3504
3284
  win;
3505
3285
  applier;
3506
3286
  step = (e) => {
3507
3287
  this.applier.apply(e);
3508
3288
  };
3509
3289
  constructor(e, t, n) {
3510
- this.win = n, this.applier = new wt(e, t.algorithm, {
3290
+ this.win = n, this.applier = new ht(e, t.algorithm, {
3511
3291
  staticNodeResolver: t.staticNodeResolver,
3512
3292
  onBeforeApplied: t.onBeforeApplied,
3513
3293
  onAfterApplied: t.onAfterApplied
3514
- }), new Ct(this.win, this.step);
3294
+ }), new mt(this.win, this.step);
3515
3295
  }
3516
3296
  static configure(t, n, r) {
3517
3297
  new e(t, n, r);
3518
3298
  }
3519
- }, Et = class e {
3299
+ }, _t = class e {
3520
3300
  canvas;
3521
3301
  window;
3522
3302
  pointInsideVerifier;
@@ -3552,7 +3332,7 @@ var re = (e, t) => {
3552
3332
  static configure(t, n, r, i, a) {
3553
3333
  new e(t, n, r, i, a);
3554
3334
  }
3555
- }, Dt = class e {
3335
+ }, vt = class e {
3556
3336
  canvas;
3557
3337
  window;
3558
3338
  pointInsideVerifier;
@@ -3588,7 +3368,7 @@ var re = (e, t) => {
3588
3368
  static configure(t, n, r, i, a) {
3589
3369
  new e(t, n, r, i, a);
3590
3370
  }
3591
- }, Ot = class e {
3371
+ }, yt = class e {
3592
3372
  canvas;
3593
3373
  element;
3594
3374
  window;
@@ -3612,29 +3392,29 @@ var re = (e, t) => {
3612
3392
  static configure(t, n, r, i, a, o) {
3613
3393
  new e(t, n, r, i, a, o);
3614
3394
  }
3615
- }, kt = () => {
3395
+ }, bt = () => {
3616
3396
  let e = document.createElement("div");
3617
3397
  return e.style.width = "100%", e.style.height = "100%", e.style.position = "relative", e;
3618
- }, At = () => {
3398
+ }, q = () => {
3619
3399
  let e = document.createElement("div");
3620
3400
  return e.style.position = "absolute", e.style.inset = "0", e;
3621
- }, jt = () => {
3622
- let e = At();
3401
+ }, xt = () => {
3402
+ let e = q();
3623
3403
  return e.style.pointerEvents = "none", e;
3624
- }, Mt = class {
3404
+ }, St = class {
3625
3405
  element;
3626
- background = At();
3627
- main = At();
3628
- overlayConnectablePorts = jt();
3629
- overlayDraggableEdges = jt();
3630
- host = kt();
3406
+ background = q();
3407
+ main = q();
3408
+ overlayConnectablePorts = xt();
3409
+ overlayDraggableEdges = xt();
3410
+ host = bt();
3631
3411
  constructor(e) {
3632
3412
  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);
3633
3413
  }
3634
3414
  destroy() {
3635
3415
  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);
3636
3416
  }
3637
- }, K = Object.freeze({
3417
+ }, J = Object.freeze({
3638
3418
  seed: "HTMLGraph is awesome",
3639
3419
  maxTimeDeltaSec: .01,
3640
3420
  nodeCharge: 1e5,
@@ -3648,14 +3428,14 @@ var re = (e, t) => {
3648
3428
  nodeForceCoefficient: 1,
3649
3429
  barnesHutAreaRadiusThreshold: .01,
3650
3430
  barnesHutTheta: 1
3651
- }), q = Object.freeze({
3431
+ }), Y = Object.freeze({
3652
3432
  mouseDownEventVerifier: (e) => e.button === 0,
3653
3433
  mouseUpEventVerifier: (e) => e.button === 0,
3654
3434
  movementThreshold: 10
3655
- }), J = () => {}, Nt = (e, t, n) => e === "closest-connectable-port" || e === "nearest-connectable-port" ? new ct(t, n) : new lt(e), Y = (e) => {
3435
+ }), X = () => {}, Ct = (e, t, n) => e === "nearest-connectable-port" ? new $e(t, n) : typeof e == "number" ? new et(e) : new et(void 0), wt = (e) => {
3656
3436
  if (typeof e == "function") return e;
3657
3437
  switch (e.type) {
3658
- case "straight": return () => new Pe({
3438
+ case "straight": return () => new Ae({
3659
3439
  color: e.color,
3660
3440
  width: e.width,
3661
3441
  arrowLength: e.arrowLength,
@@ -3668,31 +3448,7 @@ var re = (e, t) => {
3668
3448
  detourDistance: e.detourDistance,
3669
3449
  detourDirection: e.detourDirection
3670
3450
  });
3671
- case "horizontal": return () => new Ne({
3672
- color: e.color,
3673
- width: e.width,
3674
- arrowLength: e.arrowLength,
3675
- arrowOffset: e.arrowOffset,
3676
- arrowRenderer: e.arrowRenderer,
3677
- hasSourceArrow: e.hasSourceArrow,
3678
- hasTargetArrow: e.hasTargetArrow,
3679
- cycleSquareSide: e.cycleSquareSide,
3680
- roundness: e.roundness,
3681
- detourDistance: e.detourDistance
3682
- });
3683
- case "vertical": return () => new Le({
3684
- color: e.color,
3685
- width: e.width,
3686
- arrowLength: e.arrowLength,
3687
- arrowOffset: e.arrowOffset,
3688
- arrowRenderer: e.arrowRenderer,
3689
- hasSourceArrow: e.hasSourceArrow,
3690
- hasTargetArrow: e.hasTargetArrow,
3691
- cycleSquareSide: e.cycleSquareSide,
3692
- roundness: e.roundness,
3693
- detourDistance: e.detourDistance
3694
- });
3695
- case "orthogonal": return () => new ze({
3451
+ case "orthogonal": return () => new Me({
3696
3452
  color: e.color,
3697
3453
  width: e.width,
3698
3454
  arrowLength: e.arrowLength,
@@ -3714,7 +3470,7 @@ var re = (e, t) => {
3714
3470
  sourceOffset: e.sourceOffset,
3715
3471
  targetOffset: e.targetOffset
3716
3472
  });
3717
- default: return () => new je({
3473
+ default: return () => new ke({
3718
3474
  color: e.color,
3719
3475
  width: e.width,
3720
3476
  arrowLength: e.arrowLength,
@@ -3728,7 +3484,7 @@ var re = (e, t) => {
3728
3484
  detourDirection: e.detourDirection
3729
3485
  });
3730
3486
  }
3731
- }, Pt = (e) => {
3487
+ }, Tt = (e) => {
3732
3488
  let t = e.nodeDragVerifier ?? (() => !0), n = e.moveOnTop !== !1, r = e.moveEdgesOnTop !== !1 && n, i = e.mouse?.dragCursor, a = i === void 0 ? "grab" : i, o = e.mouse?.mouseDownEventVerifier, s = o === void 0 ? (e) => e.button === 0 : o, c = e.mouse?.mouseUpEventVerifier, l = c === void 0 ? (e) => e.button === 0 : c;
3733
3489
  return {
3734
3490
  moveOnTop: n,
@@ -3737,26 +3493,26 @@ var re = (e, t) => {
3737
3493
  gridSize: e.gridSize ?? null,
3738
3494
  mouseDownEventVerifier: s,
3739
3495
  mouseUpEventVerifier: l,
3740
- onNodeDragStarted: e.events?.onNodeDragStarted ?? J,
3741
- onNodeDrag: e.events?.onNodeDrag ?? J,
3496
+ onNodeDragStarted: e.events?.onNodeDragStarted ?? X,
3497
+ onNodeDrag: e.events?.onNodeDrag ?? X,
3742
3498
  nodeDragVerifier: t,
3743
- onNodeDragFinished: e.events?.onNodeDragFinished ?? J
3499
+ onNodeDragFinished: e.events?.onNodeDragFinished ?? X
3744
3500
  };
3745
- }, Ft = (e) => {
3501
+ }, Et = (e) => {
3746
3502
  let t = e.minX === null ? -Infinity : e.minX, n = e.maxX === null ? Infinity : e.maxX, r = e.minY === null ? -Infinity : e.minY, i = e.maxY === null ? Infinity : e.maxY;
3747
3503
  return (e) => {
3748
3504
  let a = e.nextTransform.x, o = e.nextTransform.y;
3749
3505
  a < t && a < e.prevTransform.x && (a = Math.min(e.prevTransform.x, t));
3750
- let s = n - e.canvasWidth * e.prevTransform.scale;
3506
+ let s = n - e.viewport.width * e.prevTransform.scale;
3751
3507
  a > s && a > e.prevTransform.x && (a = Math.max(e.prevTransform.x, s)), o < r && o < e.prevTransform.y && (o = Math.min(e.prevTransform.y, r));
3752
- let c = i - e.canvasHeight * e.prevTransform.scale;
3508
+ let c = i - e.viewport.height * e.prevTransform.scale;
3753
3509
  return o > c && o > e.prevTransform.y && (o = Math.max(e.prevTransform.y, c)), {
3754
3510
  scale: e.nextTransform.scale,
3755
3511
  x: a,
3756
3512
  y: o
3757
3513
  };
3758
3514
  };
3759
- }, It = (e) => {
3515
+ }, Dt = (e) => {
3760
3516
  let t = e.maxContentScale, n = e.minContentScale, r = t === null ? 0 : 1 / t, i = n === null ? Infinity : 1 / n;
3761
3517
  return (e) => {
3762
3518
  let t = e.prevTransform, n = e.nextTransform, a = n.scale, o = n.x, s = n.y;
@@ -3776,105 +3532,104 @@ var re = (e, t) => {
3776
3532
  y: s
3777
3533
  };
3778
3534
  };
3779
- }, Lt = (e) => (t) => e.reduce((e, n) => n({
3535
+ }, Ot = (e) => (t) => e.reduce((e, n) => n({
3780
3536
  prevTransform: t.prevTransform,
3781
3537
  nextTransform: e,
3782
- canvasWidth: t.canvasWidth,
3783
- canvasHeight: t.canvasHeight
3784
- }), t.nextTransform), Rt = (e) => {
3538
+ viewport: t.viewport
3539
+ }), t.nextTransform), kt = (e) => {
3785
3540
  if (typeof e == "function") return e;
3786
3541
  switch (e.type) {
3787
- case "scale-limit": return It({
3542
+ case "scale-limit": return Dt({
3788
3543
  minContentScale: e.minContentScale ?? 0,
3789
3544
  maxContentScale: e.maxContentScale ?? Infinity
3790
3545
  });
3791
- case "shift-limit": return Ft({
3546
+ case "shift-limit": return Et({
3792
3547
  minX: e.minX ?? -Infinity,
3793
3548
  maxX: e.maxX ?? Infinity,
3794
3549
  minY: e.minY ?? -Infinity,
3795
3550
  maxY: e.maxY ?? Infinity
3796
3551
  });
3797
3552
  }
3798
- }, zt = (e) => {
3553
+ }, At = (e) => {
3799
3554
  let t = e?.scale?.mouseWheelSensitivity, n = t === void 0 ? 1.2 : t, r = e?.transformPreprocessor, i;
3800
- i = r === void 0 ? (e) => e.nextTransform : Array.isArray(r) ? Lt(r.map((e) => Rt(e))) : Rt(r);
3801
- let a = e?.shift?.cursor === void 0 ? "grab" : e.shift.cursor, o = e?.shift?.mouseDownEventVerifier, s = o === void 0 ? (e) => e.button === 0 : o, c = e?.shift?.mouseUpEventVerifier, l = c === void 0 ? (e) => e.button === 0 : c, u = e?.scale?.mouseWheelEventVerifier, d = u === void 0 ? () => !0 : u;
3555
+ i = r === void 0 ? (e) => e.nextTransform : Array.isArray(r) ? Ot(r.map((e) => kt(e))) : kt(r);
3556
+ let a = e?.pan?.cursor === void 0 ? "grab" : e.pan.cursor, o = e?.pan?.mouseDownEventVerifier, s = o === void 0 ? (e) => e.button === 0 : o, c = e?.pan?.mouseUpEventVerifier, l = c === void 0 ? (e) => e.button === 0 : c, u = e?.scale?.mouseWheelEventVerifier, d = u === void 0 ? () => !0 : u;
3802
3557
  return {
3803
3558
  wheelSensitivity: n,
3804
- onTransformStarted: e?.events?.onTransformStarted ?? J,
3805
- onTransformFinished: e?.events?.onTransformFinished ?? J,
3806
- onBeforeTransformChange: e?.events?.onBeforeTransformChange ?? J,
3807
- onTransformChange: e?.events?.onTransformChange ?? J,
3559
+ onTransformStarted: e?.events?.onTransformStarted ?? X,
3560
+ onTransformFinished: e?.events?.onTransformFinished ?? X,
3561
+ onBeforeTransformChange: e?.events?.onBeforeTransformChange ?? X,
3562
+ onTransformChange: e?.events?.onTransformChange ?? X,
3808
3563
  transformPreprocessor: i,
3809
3564
  shiftCursor: a,
3810
3565
  mouseDownEventVerifier: s,
3811
3566
  mouseUpEventVerifier: l,
3812
3567
  mouseWheelEventVerifier: d,
3813
3568
  scaleWheelFinishTimeout: e?.scale?.wheelFinishTimeout ?? 500,
3814
- onResizeTransformStarted: e?.events?.onResizeTransformStarted ?? J,
3815
- onResizeTransformFinished: e?.events?.onResizeTransformFinished ?? J
3569
+ onResizeTransformStarted: e?.events?.onResizeTransformStarted ?? X,
3570
+ onResizeTransformFinished: e?.events?.onResizeTransformFinished ?? X
3816
3571
  };
3817
- }, Bt = (e, t) => {
3572
+ }, jt = (e, t) => {
3818
3573
  let n = document.createElementNS("http://www.w3.org/2000/svg", "circle");
3819
3574
  return n.setAttribute("cx", "0"), n.setAttribute("cy", "0"), n.setAttribute("r", `${e}`), n.setAttribute("fill", `${t}`), n;
3820
- }, Vt = (e) => e instanceof SVGElement ? e : Bt(e?.radius ?? 1.5, e?.color ?? "#d8d8d8"), Ht = (e) => {
3575
+ }, Mt = (e) => e instanceof SVGElement ? e : jt(e?.radius ?? 1.5, e?.color ?? "#d8d8d8"), Nt = (e) => {
3821
3576
  let t = e.tileDimensions;
3822
3577
  return {
3823
3578
  tileWidth: t?.width ?? 25,
3824
3579
  tileHeight: t?.height ?? 25,
3825
- renderer: Vt(e.renderer ?? {}),
3580
+ renderer: Mt(e.renderer ?? {}),
3826
3581
  maxViewportScale: e.maxViewportScale ?? 10
3827
3582
  };
3828
- }, X = Object.freeze({
3583
+ }, Z = Object.freeze({
3829
3584
  connectionTypeResolver: () => "direct",
3830
3585
  connectionPreprocessor: (e) => e,
3831
3586
  connectionAllowedVerifier: () => !0,
3832
3587
  mouseEventVerifier: (e) => e.button === 0
3833
- }), Ut = (e, t, n) => {
3834
- let r = e.connectionAllowedVerifier ?? X.connectionAllowedVerifier;
3588
+ }), Pt = (e, t, n) => {
3589
+ let r = e.connectionAllowedVerifier ?? Z.connectionAllowedVerifier;
3835
3590
  return {
3836
- connectionTypeResolver: e.connectionTypeResolver ?? X.connectionTypeResolver,
3591
+ connectionTypeResolver: e.connectionTypeResolver ?? Z.connectionTypeResolver,
3837
3592
  connectionAllowedVerifier: r,
3838
- draggingPortDirectionResolver: Nt(e.dragPortDirection, n, r),
3839
- edgeShapeFactory: e.edgeShape === void 0 ? t : Y(e.edgeShape),
3840
- connectionPreprocessor: e.connectionPreprocessor ?? X.connectionPreprocessor,
3841
- mouseDownEventVerifier: e.mouseDownEventVerifier ?? X.mouseEventVerifier,
3842
- mouseUpEventVerifier: e.mouseUpEventVerifier ?? X.mouseEventVerifier,
3843
- onAfterEdgeCreated: e.events?.onAfterEdgeCreated ?? J,
3844
- onEdgeCreationInterrupted: e.events?.onEdgeCreationInterrupted ?? J,
3845
- onEdgeCreationPrevented: e.events?.onEdgeCreationPrevented ?? J
3593
+ draggingPortDirectionResolver: Ct(e.dragPortDirection, n, r),
3594
+ edgeShapeFactory: e.edgeShape === void 0 ? t : wt(e.edgeShape),
3595
+ connectionPreprocessor: e.connectionPreprocessor ?? Z.connectionPreprocessor,
3596
+ mouseDownEventVerifier: e.mouseDownEventVerifier ?? Z.mouseEventVerifier,
3597
+ mouseUpEventVerifier: e.mouseUpEventVerifier ?? Z.mouseEventVerifier,
3598
+ onAfterEdgeCreated: e.events?.onAfterEdgeCreated ?? X,
3599
+ onEdgeCreationInterrupted: e.events?.onEdgeCreationInterrupted ?? X,
3600
+ onEdgeCreationPrevented: e.events?.onEdgeCreationPrevented ?? X
3846
3601
  };
3847
- }, Z = Object.freeze({
3602
+ }, Q = Object.freeze({
3848
3603
  connectionAllowedVerifier: () => !0,
3849
3604
  connectionPreprocessor: (e) => e,
3850
- mouseDownEventVerifier: (e) => e.button === 0 && e.ctrlKey,
3605
+ mouseDownEventVerifier: (e) => e.button === 0,
3851
3606
  mouseUpEventVerifier: (e) => e.button === 0
3852
- }), Wt = (e, t) => {
3607
+ }), Ft = (e, t) => {
3853
3608
  let n = (e) => {
3854
3609
  let n = t.getPortAdjacentEdgeIds(e);
3855
3610
  return n.length > 0 ? n[n.length - 1] : null;
3856
- }, r = e.connectionAllowedVerifier ?? Z.connectionAllowedVerifier;
3611
+ }, r = e.connectionAllowedVerifier ?? Q.connectionAllowedVerifier;
3857
3612
  return {
3858
- connectionPreprocessor: e.connectionPreprocessor ?? Z.connectionPreprocessor,
3613
+ connectionPreprocessor: e.connectionPreprocessor ?? Q.connectionPreprocessor,
3859
3614
  connectionAllowedVerifier: r,
3860
- mouseDownEventVerifier: e.mouseDownEventVerifier ?? Z.mouseDownEventVerifier,
3861
- mouseUpEventVerifier: e.mouseUpEventVerifier ?? Z.mouseUpEventVerifier,
3615
+ mouseDownEventVerifier: e.mouseDownEventVerifier ?? Q.mouseDownEventVerifier,
3616
+ mouseUpEventVerifier: e.mouseUpEventVerifier ?? Q.mouseUpEventVerifier,
3862
3617
  draggingEdgeResolver: e.draggingEdgeResolver ?? n,
3863
- draggingEdgeShapeFactory: e.draggingEdgeShape === void 0 ? null : Y(e.draggingEdgeShape),
3864
- onAfterEdgeReattached: e.events?.onAfterEdgeReattached ?? J,
3865
- onEdgeReattachInterrupted: e.events?.onEdgeReattachInterrupted ?? J,
3866
- onEdgeReattachPrevented: e.events?.onEdgeReattachPrevented ?? J,
3867
- draggingPortDirectionResolver: Nt(e.dragPortDirection, t, r)
3618
+ draggingEdgeShapeFactory: e.draggingEdgeShape === void 0 ? null : wt(e.draggingEdgeShape),
3619
+ onAfterEdgeReattached: e.events?.onAfterEdgeReattached ?? X,
3620
+ onEdgeReattachInterrupted: e.events?.onEdgeReattachInterrupted ?? X,
3621
+ onEdgeReattachPrevented: e.events?.onEdgeReattachPrevented ?? X,
3622
+ draggingPortDirectionResolver: Ct(e.dragPortDirection, t, r)
3868
3623
  };
3869
- }, Gt = (e) => ({
3624
+ }, It = (e) => ({
3870
3625
  nodeVerticalRadius: e.nodeContainingRadius.vertical,
3871
3626
  nodeHorizontalRadius: e.nodeContainingRadius.horizontal
3872
- }), Kt = (e) => ({
3873
- onAfterNodeDetached: e?.events?.onAfterNodeDetached ?? J,
3874
- onBeforeNodeAttached: e?.events?.onBeforeNodeAttached ?? J
3875
- }), qt = class extends Error {
3627
+ }), Lt = (e) => ({
3628
+ onAfterNodeDetached: e?.events?.onAfterNodeDetached ?? X,
3629
+ onBeforeNodeAttached: e?.events?.onBeforeNodeAttached ?? X
3630
+ }), Rt = class extends Error {
3876
3631
  name = "CanvasBuilderError";
3877
- }, Jt = class {
3632
+ }, zt = class {
3878
3633
  graph;
3879
3634
  currentCoords;
3880
3635
  dt;
@@ -3909,7 +3664,7 @@ var re = (e, t) => {
3909
3664
  d.x += l, d.y += u, f.x -= l, f.y -= u;
3910
3665
  });
3911
3666
  }
3912
- }, Yt = class {
3667
+ }, Bt = class {
3913
3668
  rand;
3914
3669
  PI2 = 2 * Math.PI;
3915
3670
  constructor(e) {
@@ -3932,11 +3687,11 @@ var re = (e, t) => {
3932
3687
  d: a
3933
3688
  };
3934
3689
  }
3935
- }, Xt = (e) => {
3690
+ }, Vt = (e) => {
3936
3691
  if (e.distance === 0) return e.maxForce;
3937
3692
  let t = e.coefficient * (e.sourceCharge * e.targetCharge / (e.distance * e.distance));
3938
3693
  return Math.min(t, e.maxForce);
3939
- }, Zt = class {
3694
+ }, Ht = class {
3940
3695
  nodeCharge;
3941
3696
  distanceVectorGenerator;
3942
3697
  maxForce;
@@ -3948,7 +3703,7 @@ var re = (e, t) => {
3948
3703
  for (let i = 0; i < r; i++) {
3949
3704
  let a = n[i];
3950
3705
  for (let o = i + 1; o < r; o++) {
3951
- let r = n[o], i = e.get(a), s = e.get(r), c = this.distanceVectorGenerator.create(i, s), l = Xt({
3706
+ let r = n[o], i = e.get(a), s = e.get(r), c = this.distanceVectorGenerator.create(i, s), l = Vt({
3952
3707
  coefficient: 1,
3953
3708
  sourceCharge: this.nodeCharge,
3954
3709
  targetCharge: this.nodeCharge,
@@ -3959,7 +3714,7 @@ var re = (e, t) => {
3959
3714
  }
3960
3715
  }
3961
3716
  }
3962
- }, Qt = (e) => {
3717
+ }, Ut = (e) => {
3963
3718
  if (e.size === 0) return {
3964
3719
  centerX: 0,
3965
3720
  centerY: 0,
@@ -3975,7 +3730,7 @@ var re = (e, t) => {
3975
3730
  centerY: (r + i) / 2,
3976
3731
  radius: s / 2
3977
3732
  };
3978
- }, $t = class {
3733
+ }, Wt = class {
3979
3734
  root;
3980
3735
  leaves = /* @__PURE__ */ new Map();
3981
3736
  coords;
@@ -4131,7 +3886,7 @@ var re = (e, t) => {
4131
3886
  y: n / e.size
4132
3887
  };
4133
3888
  }
4134
- }, en = class {
3889
+ }, Gt = class {
4135
3890
  areaRadiusThreshold;
4136
3891
  nodeMass;
4137
3892
  nodeCharge;
@@ -4143,8 +3898,8 @@ var re = (e, t) => {
4143
3898
  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;
4144
3899
  }
4145
3900
  apply(e, t) {
4146
- let n = new $t({
4147
- box: Qt(e),
3901
+ let n = new Wt({
3902
+ box: Ut(e),
4148
3903
  coords: e,
4149
3904
  areaRadiusThreshold: this.areaRadiusThreshold,
4150
3905
  nodeMass: this.nodeMass,
@@ -4254,7 +4009,7 @@ var re = (e, t) => {
4254
4009
  });
4255
4010
  }
4256
4011
  calculateNodeRepulsiveForce(e) {
4257
- let t = this.distanceVectorGenerator.create(e.sourceCoords, e.targetCoords), n = Xt({
4012
+ let t = this.distanceVectorGenerator.create(e.sourceCoords, e.targetCoords), n = Vt({
4258
4013
  coefficient: this.nodeForceCoefficient,
4259
4014
  sourceCharge: e.sourceCharge,
4260
4015
  targetCharge: e.targetCharge,
@@ -4281,12 +4036,12 @@ var re = (e, t) => {
4281
4036
  this.applyForce(e.totalForce, t);
4282
4037
  }
4283
4038
  }
4284
- }, tn = (e) => e.theta === 0 ? new Zt({
4039
+ }, Kt = (e) => e.theta === 0 ? new Ht({
4285
4040
  nodeCharge: e.nodeCharge,
4286
4041
  nodeForceCoefficient: e.nodeForceCoefficient,
4287
4042
  distanceVectorGenerator: e.distanceVectorGenerator,
4288
4043
  maxForce: e.maxForce
4289
- }) : new en({
4044
+ }) : new Gt({
4290
4045
  nodeCharge: e.nodeCharge,
4291
4046
  nodeForceCoefficient: e.nodeForceCoefficient,
4292
4047
  distanceVectorGenerator: e.distanceVectorGenerator,
@@ -4294,7 +4049,7 @@ var re = (e, t) => {
4294
4049
  theta: e.theta,
4295
4050
  nodeMass: e.nodeMass,
4296
4051
  areaRadiusThreshold: e.areaRadiusThreshold
4297
- }), nn = class {
4052
+ }), qt = class {
4298
4053
  rand;
4299
4054
  sparsity;
4300
4055
  constructor(e) {
@@ -4319,7 +4074,7 @@ var re = (e, t) => {
4319
4074
  });
4320
4075
  }), r;
4321
4076
  }
4322
- }, rn = class {
4077
+ }, Jt = class {
4323
4078
  distanceVectorGenerator;
4324
4079
  nodeForcesApplicationStrategy;
4325
4080
  fillerLayoutAlgorithm;
@@ -4330,7 +4085,7 @@ var re = (e, t) => {
4330
4085
  edgeStiffness;
4331
4086
  convergenceVelocity;
4332
4087
  constructor(e) {
4333
- 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 Yt(e.rand), this.nodeForcesApplicationStrategy = tn({
4088
+ this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.stopVelocity, this.distanceVectorGenerator = new Bt(e.rand), this.nodeForcesApplicationStrategy = Kt({
4334
4089
  distanceVectorGenerator: this.distanceVectorGenerator,
4335
4090
  nodeCharge: e.nodeCharge,
4336
4091
  maxForce: e.maxForce,
@@ -4338,7 +4093,7 @@ var re = (e, t) => {
4338
4093
  theta: e.barnesHutTheta,
4339
4094
  areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
4340
4095
  nodeMass: e.nodeMass
4341
- }), this.fillerLayoutAlgorithm = new nn({
4096
+ }), this.fillerLayoutAlgorithm = new qt({
4342
4097
  rand: e.rand,
4343
4098
  sparsity: e.edgeEquilibriumLength
4344
4099
  });
@@ -4348,7 +4103,7 @@ var re = (e, t) => {
4348
4103
  graph: t,
4349
4104
  viewport: n
4350
4105
  });
4351
- for (let e = 0; e < this.maxIterations && !(new Jt(t, r, {
4106
+ for (let e = 0; e < this.maxIterations && !(new zt(t, r, {
4352
4107
  distanceVectorGenerator: this.distanceVectorGenerator,
4353
4108
  nodeForcesApplicationStrategy: this.nodeForcesApplicationStrategy,
4354
4109
  dtSec: this.dtSec,
@@ -4358,7 +4113,7 @@ var re = (e, t) => {
4358
4113
  }).apply() < this.convergenceVelocity); e++);
4359
4114
  return r;
4360
4115
  }
4361
- }, an = class {
4116
+ }, Yt = class {
4362
4117
  graph;
4363
4118
  nextLayerNodesResolver;
4364
4119
  forest = /* @__PURE__ */ new Set();
@@ -4402,7 +4157,7 @@ var re = (e, t) => {
4402
4157
  }), r = e;
4403
4158
  }
4404
4159
  }
4405
- }, on = class {
4160
+ }, Xt = class {
4406
4161
  params;
4407
4162
  constructor(e) {
4408
4163
  this.params = e;
@@ -4441,13 +4196,13 @@ var re = (e, t) => {
4441
4196
  }
4442
4197
  return n - 2 * this.params.spaceAroundRadius;
4443
4198
  }
4444
- }, sn = class {
4199
+ }, Zt = class {
4445
4200
  tree;
4446
4201
  offsets = /* @__PURE__ */ new Map();
4447
4202
  treeSpans = /* @__PURE__ */ new Map();
4448
4203
  constructor(e, t) {
4449
4204
  this.tree = e;
4450
- let n = t.spaceAroundRadius, r = new on({ spaceAroundRadius: n });
4205
+ let n = t.spaceAroundRadius, r = new Xt({ spaceAroundRadius: n });
4451
4206
  [...this.tree.sequence].reverse().forEach((e) => {
4452
4207
  let t = Array.from(e.children).map((e) => this.treeSpans.get(e.nodeId)), i = r.generate(t), a = 0;
4453
4208
  e.children.forEach((e) => {
@@ -4463,19 +4218,19 @@ var re = (e, t) => {
4463
4218
  generate() {
4464
4219
  return this.offsets;
4465
4220
  }
4466
- }, cn = class {
4221
+ }, Qt = class {
4467
4222
  params;
4468
4223
  constructor(e) {
4469
4224
  this.params = e;
4470
4225
  }
4471
4226
  calculateCoordinates(e) {
4472
- let t = /* @__PURE__ */ new Map(), n = new an(e.graph, this.params.nextLayerNodesResolver).generate(), r = 0;
4227
+ let t = /* @__PURE__ */ new Map(), n = new Yt(e.graph, this.params.nextLayerNodesResolver).generate(), r = 0;
4473
4228
  return n.forEach((e) => {
4474
4229
  t.set(e.root.nodeId, {
4475
4230
  x: r,
4476
4231
  y: 0
4477
4232
  });
4478
- let n = new sn(e, { spaceAroundRadius: this.params.layerSpace / 2 }).generate(), i = [e.root];
4233
+ let n = new Zt(e, { spaceAroundRadius: this.params.layerSpace / 2 }).generate(), i = [e.root];
4479
4234
  for (; i.length > 0;) {
4480
4235
  let e = [];
4481
4236
  r += this.params.layerWidth, i.forEach((i) => {
@@ -4492,7 +4247,7 @@ var re = (e, t) => {
4492
4247
  t.set(n, this.params.transform(e));
4493
4248
  }), t;
4494
4249
  }
4495
- }, ln = (e) => {
4250
+ }, $t = (e) => {
4496
4251
  let { graph: t, currentNodeId: n } = e, r = t.getNodeOutgoingEdgeIds(n).map((e) => {
4497
4252
  let n = t.getEdge(e);
4498
4253
  return t.getPort(n.to).nodeId;
@@ -4501,19 +4256,19 @@ var re = (e, t) => {
4501
4256
  return t.getPort(n.from).nodeId;
4502
4257
  });
4503
4258
  return /* @__PURE__ */ new Set([...r, ...i]);
4504
- }, un = (e) => {
4259
+ }, en = (e) => {
4505
4260
  let { graph: t, currentNodeId: n } = e, r = t.getNodeOutgoingEdgeIds(n).map((e) => {
4506
4261
  let n = t.getEdge(e);
4507
4262
  return t.getPort(n.to).nodeId;
4508
4263
  });
4509
4264
  return new Set(r);
4510
- }, dn = (e) => {
4265
+ }, tn = (e) => {
4511
4266
  let { graph: t, currentNodeId: n } = e, r = t.getNodeIncomingEdgeIds(n).map((e) => {
4512
4267
  let n = t.getEdge(e);
4513
4268
  return t.getPort(n.from).nodeId;
4514
4269
  });
4515
4270
  return new Set(r);
4516
- }, fn = class {
4271
+ }, nn = class {
4517
4272
  distanceVectorGenerator;
4518
4273
  nodeForcesApplicationStrategy;
4519
4274
  convergenceVelocity;
@@ -4523,7 +4278,7 @@ var re = (e, t) => {
4523
4278
  edgeStiffness;
4524
4279
  fillerLayoutAlgorithm;
4525
4280
  constructor(e) {
4526
- this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new Yt(e.rand), this.nodeForcesApplicationStrategy = tn({
4281
+ this.convergenceVelocity = e.stopVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new Bt(e.rand), this.nodeForcesApplicationStrategy = Kt({
4527
4282
  distanceVectorGenerator: this.distanceVectorGenerator,
4528
4283
  nodeCharge: e.nodeCharge,
4529
4284
  maxForce: e.maxForce,
@@ -4531,7 +4286,7 @@ var re = (e, t) => {
4531
4286
  theta: e.barnesHutTheta,
4532
4287
  areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
4533
4288
  nodeMass: e.nodeMass
4534
- }), this.fillerLayoutAlgorithm = new nn({
4289
+ }), this.fillerLayoutAlgorithm = new qt({
4535
4290
  rand: e.rand,
4536
4291
  sparsity: e.edgeEquilibriumLength
4537
4292
  });
@@ -4541,7 +4296,7 @@ var re = (e, t) => {
4541
4296
  graph: t,
4542
4297
  viewport: n
4543
4298
  });
4544
- return new Jt(t, i, {
4299
+ return new zt(t, i, {
4545
4300
  distanceVectorGenerator: this.distanceVectorGenerator,
4546
4301
  nodeForcesApplicationStrategy: this.nodeForcesApplicationStrategy,
4547
4302
  dtSec: Math.min(r, this.maxTimeDeltaSec),
@@ -4553,7 +4308,7 @@ var re = (e, t) => {
4553
4308
  return n.x === null || n.y === null;
4554
4309
  }) ? /* @__PURE__ */ new Map() : i;
4555
4310
  }
4556
- }, pn = (e) => {
4311
+ }, rn = (e) => {
4557
4312
  let t = 1779033703, n = 3144134277, r = 1013904242, i = 2773480762;
4558
4313
  for (let a = 0, o; a < e.length; a++) o = e.charCodeAt(a), t = n ^ Math.imul(t ^ o, 597399067), n = r ^ Math.imul(n ^ o, 2869860233), r = i ^ Math.imul(r ^ o, 951274213), i = t ^ Math.imul(i ^ o, 2716044179);
4559
4314
  return t = Math.imul(r ^ t >>> 18, 597399067), n = Math.imul(i ^ n >>> 22, 2869860233), r = Math.imul(t ^ r >>> 17, 951274213), i = Math.imul(n ^ i >>> 19, 2716044179), t ^= n ^ r ^ i, n ^= t, r ^= t, i ^= t, [
@@ -4562,61 +4317,55 @@ var re = (e, t) => {
4562
4317
  r >>> 0,
4563
4318
  i >>> 0
4564
4319
  ];
4565
- }, mn = (e, t, n, r) => function() {
4320
+ }, an = (e, t, n, r) => function() {
4566
4321
  e |= 0, t |= 0, n |= 0, r |= 0;
4567
4322
  let i = (e + t | 0) + r | 0;
4568
4323
  return r = r + 1 | 0, e = t ^ t >>> 9, t = n + (n << 3) | 0, n = n << 21 | n >>> 11, n = n + i | 0, (i >>> 0) / 4294967296;
4569
- }, hn = (e) => {
4324
+ }, on = (e) => {
4570
4325
  switch (e?.type) {
4571
4326
  case "custom": return e.instance;
4572
4327
  default: {
4573
- let t = pn(e?.seed ?? K.seed);
4574
- return new fn({
4575
- rand: mn(t[0], t[1], t[2], t[3]),
4576
- maxTimeDeltaSec: e?.maxTimeDeltaSec ?? K.maxTimeDeltaSec,
4577
- nodeCharge: e?.nodeCharge ?? K.nodeCharge,
4578
- nodeMass: e?.nodeMass ?? K.nodeMass,
4579
- edgeEquilibriumLength: e?.edgeEquilibriumLength ?? K.edgeEquilibriumLength,
4580
- edgeStiffness: e?.edgeStiffness ?? K.edgeStiffness,
4581
- convergenceVelocity: e?.convergenceVelocity ?? K.convergenceVelocity,
4582
- maxForce: e?.maxForce ?? K.maxForce,
4583
- nodeForceCoefficient: e?.nodeForceCoefficient ?? K.nodeForceCoefficient,
4584
- barnesHutTheta: e?.barnesHut?.theta ?? K.barnesHutTheta,
4585
- barnesHutAreaRadiusThreshold: e?.barnesHut?.areaRadiusThreshold ?? K.barnesHutAreaRadiusThreshold
4328
+ let t = rn(e?.seed ?? J.seed);
4329
+ return new nn({
4330
+ rand: an(t[0], t[1], t[2], t[3]),
4331
+ maxTimeDeltaSec: e?.maxTimeDeltaSec ?? J.maxTimeDeltaSec,
4332
+ nodeCharge: e?.nodeCharge ?? J.nodeCharge,
4333
+ nodeMass: e?.nodeMass ?? J.nodeMass,
4334
+ edgeEquilibriumLength: e?.edgeEquilibriumLength ?? J.edgeEquilibriumLength,
4335
+ edgeStiffness: e?.edgeStiffness ?? J.edgeStiffness,
4336
+ stopVelocity: e?.stopVelocity ?? J.convergenceVelocity,
4337
+ maxForce: e?.maxForce ?? J.maxForce,
4338
+ nodeForceCoefficient: e?.nodeForceCoefficient ?? J.nodeForceCoefficient,
4339
+ barnesHutTheta: e?.barnesHut?.theta ?? J.barnesHutTheta,
4340
+ barnesHutAreaRadiusThreshold: e?.barnesHut?.areaRadiusThreshold ?? J.barnesHutAreaRadiusThreshold
4586
4341
  });
4587
4342
  }
4588
4343
  }
4589
- }, gn = { staticNodeResolver: () => !1 }, _n = (e) => ({
4590
- algorithm: hn(e?.algorithm ?? {}),
4591
- staticNodeResolver: e?.staticNodeResolver ?? gn.staticNodeResolver,
4592
- onBeforeApplied: e?.events?.onBeforeApplied ?? J,
4593
- onAfterApplied: e?.events?.onAfterApplied ?? J
4594
- }), vn = (e) => e instanceof l ? {
4344
+ }, sn = { staticNodeResolver: () => !1 }, cn = (e) => ({
4345
+ algorithm: on(e?.algorithm ?? {}),
4346
+ staticNodeResolver: e?.staticNodeResolver ?? sn.staticNodeResolver,
4347
+ onBeforeApplied: e?.events?.onBeforeApplied ?? X,
4348
+ onAfterApplied: e?.events?.onAfterApplied ?? X
4349
+ }), ln = (e) => e instanceof l ? {
4595
4350
  type: "trigger",
4596
4351
  trigger: e
4597
- } : e === "topologyChangeMicrotask" ? {
4598
- type: "topologyChangeSchedule",
4599
- schedule: Qe
4600
- } : e?.type === "topologyChangeMacrotask" ? {
4601
- type: "topologyChangeSchedule",
4602
- schedule: Ze
4603
4352
  } : {
4604
4353
  type: "topologyChangeSchedule",
4605
- schedule: Qe
4606
- }, yn = Object.freeze({
4354
+ schedule: We
4355
+ }, un = Object.freeze({
4607
4356
  staticNodeResolver: () => !1,
4608
4357
  hierarchicalLayout: {
4609
4358
  layerWidth: 300,
4610
4359
  layerSpace: 300
4611
4360
  }
4612
- }), Q = (e, t) => ({
4361
+ }), $ = (e, t) => ({
4613
4362
  a: e.a * t.a + e.b * t.d,
4614
4363
  b: e.a * t.b + e.b * t.e,
4615
4364
  c: e.a * t.c + e.b * t.f + e.c,
4616
4365
  d: e.d * t.a + e.e * t.d,
4617
4366
  e: e.d * t.b + e.e * t.e,
4618
4367
  f: e.d * t.c + e.e * t.f + e.f
4619
- }), bn = (e) => {
4368
+ }), dn = (e) => {
4620
4369
  let { a: t, b: n, c: r, d: i, e: a, f: o } = e, s = t * a - n * i;
4621
4370
  return {
4622
4371
  a: a / s,
@@ -4626,7 +4375,7 @@ var re = (e, t) => {
4626
4375
  e: t / s,
4627
4376
  f: (r * i - t * o) / s
4628
4377
  };
4629
- }, xn = class {
4378
+ }, fn = class {
4630
4379
  resolve(e) {
4631
4380
  if ("shift" in e) return this.createShiftBaseMatrix(e.shift);
4632
4381
  if ("scale" in e) {
@@ -4668,11 +4417,11 @@ var re = (e, t) => {
4668
4417
  return this.createRelativeTransform(n, r);
4669
4418
  }
4670
4419
  createMirrorRelativeMatrix(e, t) {
4671
- let n = this.createMirrorYBaseMatrix(), r = Q(this.createShiftBaseMatrix(t), this.createRotateBaseMatrix(e));
4420
+ let n = this.createMirrorYBaseMatrix(), r = $(this.createShiftBaseMatrix(t), this.createRotateBaseMatrix(e));
4672
4421
  return this.createRelativeTransform(n, r);
4673
4422
  }
4674
4423
  createRelativeTransform(e, t) {
4675
- return Q(Q(t, e), bn(t));
4424
+ return $($(t, e), dn(t));
4676
4425
  }
4677
4426
  createShiftBaseMatrix(e) {
4678
4427
  return {
@@ -4715,7 +4464,7 @@ var re = (e, t) => {
4715
4464
  f: 0
4716
4465
  };
4717
4466
  }
4718
- }, Sn = (e) => {
4467
+ }, pn = (e) => {
4719
4468
  if (e === void 0) return (e) => e;
4720
4469
  if (typeof e == "function") return e;
4721
4470
  let t = Array.isArray(e) ? e : [e], n = {
@@ -4725,10 +4474,10 @@ var re = (e, t) => {
4725
4474
  d: 0,
4726
4475
  e: 1,
4727
4476
  f: 0
4728
- }, r = new xn();
4477
+ }, r = new fn();
4729
4478
  return t.forEach((e) => {
4730
4479
  let t = r.resolve(e);
4731
- n = Q(n, t);
4480
+ n = $(n, t);
4732
4481
  }), (e) => {
4733
4482
  let { x: t, y: r } = e;
4734
4483
  return {
@@ -4736,47 +4485,47 @@ var re = (e, t) => {
4736
4485
  y: n.d * t + n.e * r + n.f
4737
4486
  };
4738
4487
  };
4739
- }, Cn = (e) => {
4488
+ }, mn = (e) => {
4740
4489
  if (typeof e == "function") return e;
4741
4490
  switch (e) {
4742
- case "outgoing": return un;
4743
- case "incoming": return dn;
4744
- default: return ln;
4491
+ case "outgoing": return en;
4492
+ case "incoming": return tn;
4493
+ default: return $t;
4745
4494
  }
4746
- }, wn = (e) => {
4495
+ }, hn = (e) => {
4747
4496
  switch (e?.type) {
4748
4497
  case "custom": return e.instance;
4749
- case "hierarchical": return new cn({
4750
- layerWidth: e.layerWidth ?? yn.hierarchicalLayout.layerWidth,
4751
- layerSpace: e.layerSpace ?? yn.hierarchicalLayout.layerSpace,
4752
- transform: Sn(e.transform),
4753
- nextLayerNodesResolver: Cn(e.nextLayerNodesResolver)
4498
+ case "hierarchical": return new Qt({
4499
+ layerWidth: e.layerWidth ?? un.hierarchicalLayout.layerWidth,
4500
+ layerSpace: e.layerSpace ?? un.hierarchicalLayout.layerSpace,
4501
+ transform: pn(e.transform),
4502
+ nextLayerNodesResolver: mn(e.nextLayerNodesResolver)
4754
4503
  });
4755
4504
  default: {
4756
- let t = pn(e?.seed ?? K.seed), n = mn(t[0], t[1], t[2], t[3]);
4757
- return new rn({
4758
- dtSec: e?.dtSec ?? K.dtSec,
4759
- maxIterations: e?.maxIterations ?? K.maxIterations,
4505
+ let t = rn(e?.seed ?? J.seed), n = an(t[0], t[1], t[2], t[3]);
4506
+ return new Jt({
4507
+ dtSec: e?.dtSec ?? J.dtSec,
4508
+ maxIterations: e?.maxIterations ?? J.maxIterations,
4760
4509
  rand: n,
4761
- nodeCharge: e?.nodeCharge ?? K.nodeCharge,
4762
- nodeMass: e?.nodeMass ?? K.nodeMass,
4763
- edgeEquilibriumLength: e?.edgeEquilibriumLength ?? K.edgeEquilibriumLength,
4764
- edgeStiffness: e?.edgeStiffness ?? K.edgeStiffness,
4765
- convergenceVelocity: e?.convergenceVelocity ?? K.convergenceVelocity,
4766
- maxForce: e?.maxForce ?? K.maxForce,
4767
- nodeForceCoefficient: e?.nodeForceCoefficient ?? K.nodeForceCoefficient,
4768
- barnesHutTheta: e?.barnesHut?.theta ?? K.barnesHutTheta,
4769
- barnesHutAreaRadiusThreshold: e?.barnesHut?.areaRadiusThreshold ?? K.barnesHutAreaRadiusThreshold
4510
+ nodeCharge: e?.nodeCharge ?? J.nodeCharge,
4511
+ nodeMass: e?.nodeMass ?? J.nodeMass,
4512
+ edgeEquilibriumLength: e?.edgeEquilibriumLength ?? J.edgeEquilibriumLength,
4513
+ edgeStiffness: e?.edgeStiffness ?? J.edgeStiffness,
4514
+ stopVelocity: e?.stopVelocity ?? J.convergenceVelocity,
4515
+ maxForce: e?.maxForce ?? J.maxForce,
4516
+ nodeForceCoefficient: e?.nodeForceCoefficient ?? J.nodeForceCoefficient,
4517
+ barnesHutTheta: e?.barnesHut?.theta ?? J.barnesHutTheta,
4518
+ barnesHutAreaRadiusThreshold: e?.barnesHut?.areaRadiusThreshold ?? J.barnesHutAreaRadiusThreshold
4770
4519
  });
4771
4520
  }
4772
4521
  }
4773
- }, Tn = (e) => ({
4774
- algorithm: wn(e.algorithm),
4775
- applyOn: vn(e.applyOn),
4776
- staticNodeResolver: e.staticNodeResolver ?? yn.staticNodeResolver,
4777
- onBeforeApplied: e.events?.onBeforeApplied ?? J,
4778
- onAfterApplied: e.events?.onAfterApplied ?? J
4779
- }), En = (e, t) => ({
4522
+ }, gn = (e) => ({
4523
+ algorithm: hn(e.algorithm),
4524
+ applyOn: ln(e.applyOn),
4525
+ staticNodeResolver: e.staticNodeResolver ?? un.staticNodeResolver,
4526
+ onBeforeApplied: e.events?.onBeforeApplied ?? X,
4527
+ onAfterApplied: e.events?.onAfterApplied ?? X
4528
+ }), _n = (e, t) => ({
4780
4529
  ...e,
4781
4530
  onNodeDragStarted: (n) => {
4782
4531
  t.add(n), e.onNodeDragStarted(n);
@@ -4784,7 +4533,7 @@ var re = (e, t) => {
4784
4533
  onNodeDragFinished: (n) => {
4785
4534
  t.delete(n), e.onNodeDragFinished(n);
4786
4535
  }
4787
- }), Dn = (e, t) => {
4536
+ }), vn = (e, t) => {
4788
4537
  e.graph.onBeforeNodeRemoved.subscribe((e) => {
4789
4538
  t.delete(e);
4790
4539
  }), e.graph.onBeforeClear.subscribe(() => {
@@ -4792,55 +4541,55 @@ var re = (e, t) => {
4792
4541
  }), e.onBeforeDestroy.subscribe(() => {
4793
4542
  t.clear();
4794
4543
  });
4795
- }, On = (e, t) => ({
4544
+ }, yn = (e, t) => ({
4796
4545
  ...e,
4797
4546
  staticNodeResolver: (n) => e.staticNodeResolver(n) || t.has(n)
4798
- }), $ = (e) => () => e, kn = $(0), An = () => {
4547
+ }), bn = (e) => () => e, xn = bn(0), Sn = () => {
4799
4548
  let e = 0;
4800
4549
  return () => e++;
4801
- }, jn = (e, t) => {
4802
- let n = kn, r = kn, i = An();
4803
- return e === "incremental" && (n = i), t === "incremental" && (r = i), typeof e == "number" && (n = $(e)), typeof t == "number" && (r = $(t)), typeof e == "function" && (n = e), typeof t == "function" && (r = t), {
4550
+ }, Cn = (e, t) => {
4551
+ let n = xn, r = xn, i = Sn();
4552
+ return e === "incremental" && (n = i), t === "incremental" && (r = i), typeof e == "number" && (n = bn(e)), typeof t == "number" && (r = bn(t)), typeof e == "function" && (n = e), typeof t == "function" && (r = t), {
4804
4553
  nodesPriorityFn: n,
4805
4554
  edgesPriorityFn: r
4806
4555
  };
4807
- }, Mn = (e) => {
4808
- let t = jn(e.nodes?.priority, e.edges?.priority);
4556
+ }, wn = (e) => {
4557
+ let t = Cn(e.nodes?.priority, e.edges?.priority);
4809
4558
  return {
4810
4559
  nodes: {
4811
- centerFn: e.nodes?.centerFn ?? ie,
4560
+ centerFn: e.nodes?.centerFn ?? re,
4812
4561
  priorityFn: t.nodesPriorityFn
4813
4562
  },
4814
4563
  ports: { direction: e.ports?.direction ?? 0 },
4815
4564
  edges: {
4816
- shapeFactory: Y(e.edges?.shape ?? {}),
4565
+ shapeFactory: wt(e.edges?.shape ?? {}),
4817
4566
  priorityFn: t.edgesPriorityFn
4818
4567
  }
4819
4568
  };
4820
- }, Nn = (e) => e.applyOn.type === "topologyChangeSchedule" ? e.applyOn.schedule : B, Pn = (e) => {
4821
- let { canvasDefaults: t } = e, n = e.hasLayout ? Nn(e.layoutParams) : B;
4569
+ }, Tn = (e) => e.applyOn.type === "topologyChangeSchedule" ? e.applyOn.schedule : B, En = (e) => {
4570
+ let { canvasDefaults: t } = e, n = e.hasLayout ? Tn(e.layoutParams) : B;
4822
4571
  return { focus: {
4823
- contentPadding: t.focus?.contentPadding ?? t.focus?.contentOffset ?? 100,
4572
+ contentPadding: t.focus?.contentPadding ?? 100,
4824
4573
  minContentScale: t.focus?.minContentScale ?? 0,
4825
4574
  schedule: n,
4826
4575
  animationDuration: t.focus?.animationDuration ?? 0
4827
4576
  } };
4828
- }, Fn = (e) => ({
4577
+ }, Dn = (e) => ({
4829
4578
  onNodeSelected: e.onNodeSelected,
4830
- mouseDownEventVerifier: e.mouseDownEventVerifier ?? q.mouseDownEventVerifier,
4831
- mouseUpEventVerifier: e.mouseUpEventVerifier ?? q.mouseUpEventVerifier,
4832
- movementThreshold: e.movementThreshold ?? q.movementThreshold
4833
- }), In = (e) => ({
4579
+ mouseDownEventVerifier: e.mouseDownEventVerifier ?? Y.mouseDownEventVerifier,
4580
+ mouseUpEventVerifier: e.mouseUpEventVerifier ?? Y.mouseUpEventVerifier,
4581
+ movementThreshold: e.movementThreshold ?? Y.movementThreshold
4582
+ }), On = (e) => ({
4834
4583
  onCanvasSelected: e.onCanvasSelected,
4835
- mouseDownEventVerifier: e.mouseDownEventVerifier ?? q.mouseDownEventVerifier,
4836
- mouseUpEventVerifier: e.mouseUpEventVerifier ?? q.mouseUpEventVerifier,
4837
- movementThreshold: e.movementThreshold ?? q.movementThreshold
4838
- }), Ln = (e) => ({
4584
+ mouseDownEventVerifier: e.mouseDownEventVerifier ?? Y.mouseDownEventVerifier,
4585
+ mouseUpEventVerifier: e.mouseUpEventVerifier ?? Y.mouseUpEventVerifier,
4586
+ movementThreshold: e.movementThreshold ?? Y.movementThreshold
4587
+ }), kn = (e) => ({
4839
4588
  onEdgeSelected: e.onEdgeSelected,
4840
- mouseDownEventVerifier: e.mouseDownEventVerifier ?? q.mouseDownEventVerifier,
4841
- mouseUpEventVerifier: e.mouseUpEventVerifier ?? q.mouseUpEventVerifier,
4842
- movementThreshold: e.movementThreshold ?? q.movementThreshold
4843
- }), Rn = class {
4589
+ mouseDownEventVerifier: e.mouseDownEventVerifier ?? Y.mouseDownEventVerifier,
4590
+ mouseUpEventVerifier: e.mouseUpEventVerifier ?? Y.mouseUpEventVerifier,
4591
+ movementThreshold: e.movementThreshold ?? Y.movementThreshold
4592
+ }), An = class {
4844
4593
  element;
4845
4594
  used = !1;
4846
4595
  canvasDefaults = {};
@@ -4867,9 +4616,9 @@ var re = (e, t) => {
4867
4616
  window = window;
4868
4617
  animationStaticNodes = /* @__PURE__ */ new Set();
4869
4618
  pointInsideVerifier;
4870
- eventTagger = new ot();
4619
+ eventTagger = new Qe();
4871
4620
  constructor(e) {
4872
- this.element = e, this.pointInsideVerifier = new ee(e, this.window);
4621
+ this.element = e, this.pointInsideVerifier = new C(e, this.window);
4873
4622
  }
4874
4623
  setDefaults(e) {
4875
4624
  return this.canvasDefaults = e, this;
@@ -4911,40 +4660,40 @@ var re = (e, t) => {
4911
4660
  return this.userSelectableCanvasConfig = e, this;
4912
4661
  }
4913
4662
  build() {
4914
- if (this.used) throw new qt("Failed to build Canvas because CanvasBuilder is a single-use object");
4663
+ if (this.used) throw new Rt("Failed to build Canvas because CanvasBuilder is a single-use object");
4915
4664
  this.used = !0;
4916
- let e = new y(this.element), t = new h(), n = new Mt(this.element), r = this.createHtmlView(n.main, t, e), i = Mn(this.canvasDefaults), a = new Xe(t, r, i), o = Tn(this.layoutConfig), s = new rt(t, e, Pn({
4665
+ let e = new y(this.element), t = new h(), n = new St(this.element), r = this.createHtmlView(n.main, t, e), i = wn(this.canvasDefaults), a = new Ue(t, r, i), o = gn(this.layoutConfig), s = new Ye(t, e, En({
4917
4666
  canvasDefaults: this.canvasDefaults,
4918
4667
  hasLayout: this.hasLayout,
4919
4668
  layoutParams: o
4920
- }), this.window), c = new $e(e), l = new d(new Ye(t), c, a, s);
4921
- if (this.hasBackground && gt.configure(l, Ht(this.backgroundConfig), n.background), this.hasNodeResizeReactiveEdges && b.configure(l), this.userSelectableEdgesConfig !== void 0) {
4922
- let e = Ln(this.userSelectableEdgesConfig);
4923
- Dt.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4669
+ }), this.window), c = new Ge(e), l = new d(new He(t), c, a, s);
4670
+ if (this.hasBackground && st.configure(l, Nt(this.backgroundConfig), n.background), this.hasNodeResizeReactiveEdges && b.configure(l), this.userSelectableEdgesConfig !== void 0) {
4671
+ let e = kn(this.userSelectableEdgesConfig);
4672
+ vt.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4924
4673
  }
4925
4674
  if (this.userSelectableNodesConfig !== void 0) {
4926
- let e = Fn(this.userSelectableNodesConfig);
4927
- Et.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4675
+ let e = Dn(this.userSelectableNodesConfig);
4676
+ _t.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4928
4677
  }
4929
4678
  if (this.userSelectableCanvasConfig !== void 0) {
4930
- let e = In(this.userSelectableCanvasConfig);
4931
- Ot.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4679
+ let e = On(this.userSelectableCanvasConfig);
4680
+ yt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4932
4681
  }
4933
4682
  if (this.hasDraggableNodes) {
4934
- let e = Pt(this.dragConfig);
4935
- this.hasAnimatedLayout && (e = En(e, this.animationStaticNodes)), ut.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4683
+ let e = Tt(this.dragConfig);
4684
+ this.hasAnimatedLayout && (e = _n(e, this.animationStaticNodes)), tt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4936
4685
  }
4937
4686
  if (this.hasUserConnectablePorts) {
4938
- let t = Ut(this.connectablePortsConfig, i.edges.shapeFactory, l.graph);
4939
- _t.configure(l, n.overlayConnectablePorts, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4687
+ let t = Pt(this.connectablePortsConfig, i.edges.shapeFactory, l.graph);
4688
+ ct.configure(l, n.overlayConnectablePorts, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4940
4689
  }
4941
4690
  if (this.hasUserDraggableEdges) {
4942
- let t = Wt(this.draggableEdgesConfig, l.graph);
4943
- vt.configure(l, n.overlayDraggableEdges, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4691
+ let t = Ft(this.draggableEdgesConfig, l.graph);
4692
+ lt.configure(l, n.overlayDraggableEdges, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4944
4693
  }
4945
- if (this.virtualScrollConfig === void 0 ? this.hasTransformableViewport && dt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, zt(this.transformConfig)) : ft.configure(l, n.main, this.window, zt(this.transformConfig), this.boxRenderingTrigger, this.pointInsideVerifier, this.eventTagger, Gt(this.virtualScrollConfig)), this.hasLayout && St.configure(l, o), this.hasAnimatedLayout) {
4946
- let e = _n(this.animatedLayoutConfig);
4947
- this.hasDraggableNodes && (Dn(l, this.animationStaticNodes), e = On(e, this.animationStaticNodes)), Tt.configure(l, e, this.window);
4694
+ if (this.virtualScrollConfig === void 0 ? this.hasTransformableViewport && nt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, At(this.transformConfig)) : rt.configure(l, n.main, this.window, At(this.transformConfig), this.boxRenderingTrigger, this.pointInsideVerifier, this.eventTagger, It(this.virtualScrollConfig)), this.hasLayout && pt.configure(l, o), this.hasAnimatedLayout) {
4695
+ let e = cn(this.animatedLayoutConfig);
4696
+ this.hasDraggableNodes && (vn(l, this.animationStaticNodes), e = yn(e, this.animationStaticNodes)), gt.configure(l, e, this.window);
4948
4697
  }
4949
4698
  return l.onBeforeDestroy.subscribe(() => {
4950
4699
  n.destroy();
@@ -4952,8 +4701,8 @@ var re = (e, t) => {
4952
4701
  }
4953
4702
  createHtmlView(e, t, n) {
4954
4703
  let r = new a(t, n, e);
4955
- return this.virtualScrollConfig !== void 0 && (r = new s(r, t, this.boxRenderingTrigger, Kt(this.virtualScrollConfig))), r = new c(r, t), r;
4704
+ return this.virtualScrollConfig !== void 0 && (r = new s(r, t, this.boxRenderingTrigger, Lt(this.virtualScrollConfig))), r = new c(r, t), r;
4956
4705
  }
4957
4706
  };
4958
4707
  //#endregion
4959
- export { je as BezierEdgeShape, Rn as CanvasBuilder, qt as CanvasBuilderError, p as CanvasError, e as ConnectionCategory, R as DirectEdgeShape, l as EventSubject, Ne as HorizontalEdgeShape, Ke as InteractiveEdgeError, qe as InteractiveEdgeShape, Je as MidpointEdgeShape, ze as OrthogonalEdgeShape, Pe as StraightEdgeShape, Le as VerticalEdgeShape, Be as boxPortOffsetFn };
4708
+ export { ke as BezierEdgeShape, An as CanvasBuilder, Rt as CanvasBuilderError, p as CanvasError, e as ConnectionCategory, R as DirectEdgeShape, l as EventSubject, ze as InteractiveEdgeError, Be as InteractiveEdgeShape, Ve as MidpointEdgeShape, Me as OrthogonalEdgeShape, Ae as StraightEdgeShape };