@infinit-canvas/react 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { jsx as S, jsxs as $t, Fragment as Le } from "react/jsx-runtime";
2
- import { useRef as tt, useState as Gt, useMemo as St, useEffect as ht, useCallback as F, useContext as qe, createContext as Fn, memo as Zt, useLayoutEffect as kr } from "react";
1
+ import { jsx as S, jsxs as $t, Fragment as Ne } from "react/jsx-runtime";
2
+ import { useRef as tt, useState as Gt, useMemo as St, useEffect as ft, useCallback as F, useContext as qe, createContext as Fn, memo as Zt, useLayoutEffect as kr } from "react";
3
3
  import { createPortal as Yn } from "react-dom";
4
4
  const Un = 160, qn = 60;
5
5
  function ho(t) {
@@ -949,8 +949,8 @@ function Cr(t, e) {
949
949
  const s = { worker: r };
950
950
  return mn.set(t, s), s;
951
951
  }
952
- const Vt = 160, jt = 60, Nr = 10;
953
- function Lr({
952
+ const Vt = 160, jt = 60, Lr = 10;
953
+ function Nr({
954
954
  cards: t = [],
955
955
  nodes: e = [],
956
956
  edges: n = [],
@@ -967,7 +967,7 @@ function Lr({
967
967
  onEdgeDoubleClick: z,
968
968
  onEdgeMouseEnter: M,
969
969
  onEdgeMouseMove: $,
970
- onEdgeMouseLeave: k,
970
+ onEdgeMouseLeave: R,
971
971
  onEdgeContextMenu: E,
972
972
  onNodeDoubleClick: _,
973
973
  onNodeMouseEnter: D,
@@ -975,32 +975,32 @@ function Lr({
975
975
  onNodeMouseLeave: f,
976
976
  onNodeContextMenu: p,
977
977
  onPaneClick: v,
978
- onPaneContextMenu: N,
978
+ onPaneContextMenu: L,
979
979
  onPaneMouseEnter: w,
980
980
  onPaneMouseMove: P,
981
- onPaneMouseLeave: R,
981
+ onPaneMouseLeave: k,
982
982
  onSelectionChange: B,
983
- onConnectStart: q,
983
+ onConnectStart: j,
984
984
  onConnectEnd: X,
985
- onInit: K,
986
- onMoveStart: at,
985
+ onInit: xt,
986
+ onMoveStart: K,
987
987
  onMove: rt,
988
- onMoveEnd: G,
989
- onDelete: j,
990
- onBeforeDelete: it,
991
- onError: dt,
992
- isValidConnection: ot,
993
- dark: ft,
988
+ onMoveEnd: q,
989
+ onDelete: G,
990
+ onBeforeDelete: ot,
991
+ onError: lt,
992
+ isValidConnection: ut,
993
+ dark: st,
994
994
  gridSize: It = 40,
995
- zoomMin: st = 0.1,
996
- zoomMax: xt = 4,
997
- initialCamera: Nt = { x: 0, y: 0, zoom: 1 },
998
- fitView: gt = !1,
999
- fitViewOptions: ct,
1000
- nodesDraggable: zt = !0,
995
+ zoomMin: it = 0.1,
996
+ zoomMax: mt = 4,
997
+ initialCamera: Lt = { x: 0, y: 0, zoom: 1 },
998
+ fitView: zt = !1,
999
+ fitViewOptions: dt,
1000
+ nodesDraggable: ht = !0,
1001
1001
  nodesConnectable: Rt = !0,
1002
- elementsSelectable: Lt = !0,
1003
- multiSelectionKeyCode: wt = "Shift",
1002
+ elementsSelectable: Nt = !0,
1003
+ multiSelectionKeyCode: gt = "Shift",
1004
1004
  selectionOnDrag: ne = !1,
1005
1005
  selectionMode: Ie = "partial",
1006
1006
  connectionMode: Bt = "loose",
@@ -1023,11 +1023,11 @@ function Lr({
1023
1023
  autoPanOnNodeDrag: dn = !0,
1024
1024
  autoPanOnConnect: fn = !0,
1025
1025
  autoPanSpeed: Qt = 5,
1026
- edgesReconnectable: Nn = !1,
1026
+ edgesReconnectable: Ln = !1,
1027
1027
  elevateNodesOnSelect: hn = !1,
1028
1028
  edgeRouting: fe = !0
1029
1029
  } = {}) {
1030
- const mt = tt(null), Te = tt(null), Et = tt(null), pt = tt({ ...Nt }), se = tt([...t]), Z = tt([...e]), Pt = tt([...n]), yn = tt(/* @__PURE__ */ new Map()), Se = tt(!1), te = tt(null), [gn, pn] = Gt(!1), _t = tt(null), Wt = tt(null), Me = tt(null), ie = tt(null), Ut = tt(!1), Re = tt(null), [Be, Je] = Gt({ x: Nt.x, y: Nt.y, zoom: Nt.zoom }), [Ve, ae] = Gt(null), Kt = St(() => /* @__PURE__ */ new Set(), []), he = St(() => /* @__PURE__ */ new Set(), []), ke = tt(!1), O = tt({});
1030
+ const vt = tt(null), Te = tt(null), Et = tt(null), pt = tt({ ...Lt }), se = tt([...t]), Z = tt([...e]), Pt = tt([...n]), yn = tt(/* @__PURE__ */ new Map()), Se = tt(!1), te = tt(null), [gn, pn] = Gt(!1), _t = tt(null), Wt = tt(null), Me = tt(null), ie = tt(null), Ut = tt(!1), Re = tt(null), [Be, Je] = Gt({ x: Lt.x, y: Lt.y, zoom: Lt.zoom }), [Ve, ae] = Gt(null), Kt = St(() => /* @__PURE__ */ new Set(), []), he = St(() => /* @__PURE__ */ new Set(), []), ke = tt(!1), O = tt({});
1031
1031
  O.current = {
1032
1032
  onHudUpdate: r,
1033
1033
  onNodesProcessed: s,
@@ -1042,7 +1042,7 @@ function Lr({
1042
1042
  onEdgeDoubleClick: z,
1043
1043
  onEdgeMouseEnter: M,
1044
1044
  onEdgeMouseMove: $,
1045
- onEdgeMouseLeave: k,
1045
+ onEdgeMouseLeave: R,
1046
1046
  onEdgeContextMenu: E,
1047
1047
  onNodeDoubleClick: _,
1048
1048
  onNodeMouseEnter: D,
@@ -1050,21 +1050,21 @@ function Lr({
1050
1050
  onNodeMouseLeave: f,
1051
1051
  onNodeContextMenu: p,
1052
1052
  onPaneClick: v,
1053
- onPaneContextMenu: N,
1053
+ onPaneContextMenu: L,
1054
1054
  onPaneMouseEnter: w,
1055
1055
  onPaneMouseMove: P,
1056
- onPaneMouseLeave: R,
1056
+ onPaneMouseLeave: k,
1057
1057
  onSelectionChange: B,
1058
- onConnectStart: q,
1058
+ onConnectStart: j,
1059
1059
  onConnectEnd: X,
1060
- onInit: K,
1061
- onMoveStart: at,
1060
+ onInit: xt,
1061
+ onMoveStart: K,
1062
1062
  onMove: rt,
1063
- onMoveEnd: G,
1064
- onDelete: j,
1065
- onBeforeDelete: it,
1066
- onError: dt,
1067
- isValidConnection: ot
1063
+ onMoveEnd: q,
1064
+ onDelete: G,
1065
+ onBeforeDelete: ot,
1066
+ onError: lt,
1067
+ isValidConnection: ut
1068
1068
  };
1069
1069
  const bt = { get current() {
1070
1070
  return O.current.onNodesChange;
@@ -1091,23 +1091,23 @@ function Lr({
1091
1091
  } }, pe = { get current() {
1092
1092
  return O.current.onNodesProcessed;
1093
1093
  } };
1094
- ht(() => {
1094
+ ft(() => {
1095
1095
  const a = (d) => {
1096
- d.key === wt && (Ut.current = !0), d.key === we && (ke.current = !0);
1096
+ d.key === gt && (Ut.current = !0), d.key === we && (ke.current = !0);
1097
1097
  }, x = (d) => {
1098
- d.key === wt && (Ut.current = !1), d.key === we && (ke.current = !1);
1098
+ d.key === gt && (Ut.current = !1), d.key === we && (ke.current = !1);
1099
1099
  };
1100
1100
  return window.addEventListener("keydown", a), window.addEventListener("keyup", x), () => {
1101
1101
  window.removeEventListener("keydown", a), window.removeEventListener("keyup", x);
1102
1102
  };
1103
- }, [wt, we]);
1103
+ }, [gt, we]);
1104
1104
  const Jt = F(() => {
1105
1105
  var b;
1106
- const a = Z.current.filter((L) => L.selected), x = Pt.current.filter((L) => L.selected), d = { nodes: a, edges: x };
1106
+ const a = Z.current.filter((N) => N.selected), x = Pt.current.filter((N) => N.selected), d = { nodes: a, edges: x };
1107
1107
  (b = ye.current) == null || b.call(ye, d);
1108
- for (const L of he) L(d);
1108
+ for (const N of he) N(d);
1109
1109
  }, [he]);
1110
- ht(() => {
1110
+ ft(() => {
1111
1111
  var a;
1112
1112
  se.current = [...t], (a = Et.current) == null || a.postMessage({ type: "cards", data: { cards: [...t] } });
1113
1113
  }, [t]);
@@ -1118,10 +1118,10 @@ function Lr({
1118
1118
  if (!d.parentId) return d;
1119
1119
  const b = x[d.parentId];
1120
1120
  if (!b) return d;
1121
- let L = d.position.x, I = d.position.y, h = b;
1121
+ let N = d.position.x, I = d.position.y, h = b;
1122
1122
  for (; h; )
1123
- L += h.position.x, I += h.position.y, h = h.parentId ? x[h.parentId] : null;
1124
- return { ...d, _absolutePosition: { x: L, y: I } };
1123
+ N += h.position.x, I += h.position.y, h = h.parentId ? x[h.parentId] : null;
1124
+ return { ...d, _absolutePosition: { x: N, y: I } };
1125
1125
  });
1126
1126
  }, []), ee = tt([]), Q = F((a) => {
1127
1127
  const x = yn.current;
@@ -1130,8 +1130,8 @@ function Lr({
1130
1130
  for (const [, b] of x)
1131
1131
  d[b.nodeId] || (d[b.nodeId] = []), d[b.nodeId].push({ id: b.id, type: b.type, position: b.position, x: b.x, y: b.y });
1132
1132
  return a.map((b) => {
1133
- const L = d[b.id];
1134
- return L && L.length > 0 ? { ...b, handles: L } : b;
1133
+ const N = d[b.id];
1134
+ return N && N.length > 0 ? { ...b, handles: N } : b;
1135
1135
  });
1136
1136
  }, []), Ft = F(() => {
1137
1137
  var x;
@@ -1139,12 +1139,12 @@ function Lr({
1139
1139
  const a = Q(ee.current);
1140
1140
  (x = Et.current) == null || x.postMessage({ type: "nodes", data: { nodes: a } });
1141
1141
  }, [Q]);
1142
- ht(() => {
1142
+ ft(() => {
1143
1143
  var d;
1144
1144
  if (_t.current) {
1145
- const b = _t.current.id, L = /* @__PURE__ */ new Set([b, ..._t.current.selectedStarts.map((h) => h.id)]), I = {};
1145
+ const b = _t.current.id, N = /* @__PURE__ */ new Set([b, ..._t.current.selectedStarts.map((h) => h.id)]), I = {};
1146
1146
  for (const h of Z.current)
1147
- L.has(h.id) && (I[h.id] = { ...h.position });
1147
+ N.has(h.id) && (I[h.id] = { ...h.position });
1148
1148
  Z.current = [...e];
1149
1149
  for (const h of Z.current)
1150
1150
  I[h.id] && (h.position = I[h.id]);
@@ -1156,23 +1156,23 @@ function Lr({
1156
1156
  ee.current = a;
1157
1157
  const x = Q(a);
1158
1158
  (d = Et.current) == null || d.postMessage({ type: "nodes", data: { nodes: x } });
1159
- }, [e, ze, Q]), ht(() => {
1159
+ }, [e, ze, Q]), ft(() => {
1160
1160
  var a;
1161
1161
  Pt.current = [...n], (a = Et.current) == null || a.postMessage({ type: "edges", data: { edges: [...n] } });
1162
1162
  }, [n]);
1163
- const lt = F((a, x) => {
1164
- const d = mt.current;
1163
+ const at = F((a, x) => {
1164
+ const d = vt.current;
1165
1165
  if (!d) return { x: 0, y: 0 };
1166
- const b = d.getBoundingClientRect(), L = pt.current;
1166
+ const b = d.getBoundingClientRect(), N = pt.current;
1167
1167
  return {
1168
- x: (a - b.left - L.x) / L.zoom,
1169
- y: (x - b.top - L.y) / L.zoom
1168
+ x: (a - b.left - N.x) / N.zoom,
1169
+ y: (x - b.top - N.y) / N.zoom
1170
1170
  };
1171
1171
  }, []), Tt = F((a, x) => {
1172
1172
  const d = ee.current.length > 0 ? ee.current : Z.current;
1173
1173
  let b = null;
1174
- for (let L = d.length - 1; L >= 0; L--) {
1175
- const I = d[L];
1174
+ for (let N = d.length - 1; N >= 0; N--) {
1175
+ const I = d[N];
1176
1176
  if (I.hidden) continue;
1177
1177
  const h = I._absolutePosition || I.position, A = I.width || Vt, T = I.height || jt;
1178
1178
  if (a >= h.x && a <= h.x + A && x >= h.y && x <= h.y + T) {
@@ -1203,39 +1203,39 @@ function Lr({
1203
1203
  }, []), Ee = F((a) => {
1204
1204
  const x = a.width || Vt, d = a.height || jt;
1205
1205
  return a.handles && a.handles.length > 0 ? a.handles.map((b) => {
1206
- const L = xe(b, a);
1207
- return { id: b.id || null, type: b.type, x: L.x, y: L.y };
1206
+ const N = xe(b, a);
1207
+ return { id: b.id || null, type: b.type, x: N.x, y: N.y };
1208
1208
  }) : [
1209
1209
  { id: null, type: "target", x: a.position.x, y: a.position.y + d / 2 },
1210
1210
  { id: null, type: "source", x: a.position.x + x, y: a.position.y + d / 2 }
1211
1211
  ];
1212
1212
  }, [xe]), tn = F((a, x) => {
1213
- const d = Z.current, b = pt.current, L = Math.max(Nr, Ot) / b.zoom;
1213
+ const d = Z.current, b = pt.current, N = Math.max(Lr, Ot) / b.zoom;
1214
1214
  for (let I = d.length - 1; I >= 0; I--) {
1215
1215
  const h = d[I];
1216
1216
  if (h.hidden) continue;
1217
1217
  const A = Ee(h);
1218
1218
  for (const T of A)
1219
- if (Math.abs(a - T.x) < L && Math.abs(x - T.y) < L)
1219
+ if (Math.abs(a - T.x) < N && Math.abs(x - T.y) < N)
1220
1220
  return { nodeId: h.id, handleId: T.id, type: T.type, x: T.x, y: T.y };
1221
1221
  }
1222
1222
  return null;
1223
1223
  }, [Ee]), ue = F((a, x) => {
1224
1224
  const b = 8 / pt.current.zoom;
1225
- for (let L = Pt.current.length - 1; L >= 0; L--) {
1226
- const I = Pt.current[L], h = Z.current.find((Mt) => Mt.id === I.source), A = Z.current.find((Mt) => Mt.id === I.target);
1225
+ for (let N = Pt.current.length - 1; N >= 0; N--) {
1226
+ const I = Pt.current[N], h = Z.current.find((Mt) => Mt.id === I.source), A = Z.current.find((Mt) => Mt.id === I.target);
1227
1227
  if (!h || !A) continue;
1228
- const T = h.width || Vt, Y = h.height || jt, H = A.height || jt, J = h.position.x + T, ut = h.position.y + Y / 2, U = A.position.x, nt = A.position.y + H / 2;
1229
- if (Ir(a, x, J, ut, U, nt) < b) return I;
1228
+ const T = h.width || Vt, Y = h.height || jt, H = A.height || jt, J = h.position.x + T, ct = h.position.y + Y / 2, U = A.position.x, nt = A.position.y + H / 2;
1229
+ if (Ir(a, x, J, ct, U, nt) < b) return I;
1230
1230
  }
1231
1231
  return null;
1232
1232
  }, []);
1233
- ht(() => {
1234
- const a = Te.current, x = mt.current;
1233
+ ft(() => {
1234
+ const a = Te.current, x = vt.current;
1235
1235
  if (!a || !x) return;
1236
- const d = x.getBoundingClientRect(), b = ft !== void 0 ? ft : matchMedia("(prefers-color-scheme: dark)").matches, L = ze(Z.current);
1237
- ee.current = L;
1238
- const I = Q(L), { worker: h } = Cr(a, {
1236
+ const d = x.getBoundingClientRect(), b = st !== void 0 ? st : matchMedia("(prefers-color-scheme: dark)").matches, N = ze(Z.current);
1237
+ ee.current = N;
1238
+ const I = Q(N), { worker: h } = Cr(a, {
1239
1239
  width: d.width,
1240
1240
  height: d.height,
1241
1241
  camera: pt.current,
@@ -1247,30 +1247,30 @@ function Lr({
1247
1247
  edgeRouting: fe
1248
1248
  });
1249
1249
  h.onmessage = (H) => {
1250
- var J, ut;
1251
- H.data.type === "hud" && ((J = ge.current) == null || J.call(ge, H.data.data)), H.data.type === "ready" && pn(!0), H.data.type === "nodesProcessed" && ((ut = pe.current) == null || ut.call(pe, H.data.data));
1250
+ var J, ct;
1251
+ H.data.type === "hud" && ((J = ge.current) == null || J.call(ge, H.data.data)), H.data.type === "ready" && pn(!0), H.data.type === "nodesProcessed" && ((ct = pe.current) == null || ct.call(pe, H.data.data));
1252
1252
  }, Et.current = h;
1253
1253
  const A = new ResizeObserver((H) => {
1254
- const { width: J, height: ut } = H[0].contentRect;
1255
- h.postMessage({ type: "resize", data: { width: J, height: ut } });
1254
+ const { width: J, height: ct } = H[0].contentRect;
1255
+ h.postMessage({ type: "resize", data: { width: J, height: ct } });
1256
1256
  });
1257
1257
  A.observe(x);
1258
1258
  let T, Y;
1259
- return ft === void 0 && (T = matchMedia("(prefers-color-scheme: dark)"), Y = (H) => h.postMessage({ type: "theme", data: { dark: H.matches } }), T.addEventListener("change", Y)), () => {
1259
+ return st === void 0 && (T = matchMedia("(prefers-color-scheme: dark)"), Y = (H) => h.postMessage({ type: "theme", data: { dark: H.matches } }), T.addEventListener("change", Y)), () => {
1260
1260
  A.disconnect(), T && Y && T.removeEventListener("change", Y), Et.current = null;
1261
1261
  };
1262
- }, []), ht(() => {
1262
+ }, []), ft(() => {
1263
1263
  var a;
1264
- ft !== void 0 && ((a = Et.current) == null || a.postMessage({ type: "theme", data: { dark: ft } }));
1265
- }, [ft]), ht(() => {
1264
+ st !== void 0 && ((a = Et.current) == null || a.postMessage({ type: "theme", data: { dark: st } }));
1265
+ }, [st]), ft(() => {
1266
1266
  var a;
1267
1267
  (a = Et.current) == null || a.postMessage({ type: "edgeRouting", data: { enabled: fe } });
1268
1268
  }, [fe]);
1269
- const Ln = tt(0), Ct = F((a = null) => {
1270
- var b, L, I;
1269
+ const Nn = tt(0), Ct = F((a = null) => {
1270
+ var b, N, I;
1271
1271
  const x = pt.current;
1272
1272
  if (re) {
1273
- const h = mt.current;
1273
+ const h = vt.current;
1274
1274
  if (h) {
1275
1275
  const A = h.getBoundingClientRect(), T = -re[1][0] * x.zoom + A.width, Y = -re[1][1] * x.zoom + A.height, H = -re[0][0] * x.zoom, J = -re[0][1] * x.zoom;
1276
1276
  x.x = Math.min(H, Math.max(T, x.x)), x.y = Math.min(J, Math.max(Y, x.y));
@@ -1278,29 +1278,29 @@ function Lr({
1278
1278
  }
1279
1279
  (b = Et.current) == null || b.postMessage({ type: "camera", data: { camera: { ...x } } });
1280
1280
  const d = { x: x.x, y: x.y, zoom: x.zoom };
1281
- (I = (L = O.current).onMove) == null || I.call(L, a, d);
1281
+ (I = (N = O.current).onMove) == null || I.call(N, a, d);
1282
1282
  for (const h of Kt) h(d);
1283
- cancelAnimationFrame(Ln.current), Ln.current = requestAnimationFrame(() => {
1283
+ cancelAnimationFrame(Nn.current), Nn.current = requestAnimationFrame(() => {
1284
1284
  Je({ x: x.x, y: x.y, zoom: x.zoom });
1285
1285
  });
1286
1286
  }, [Kt, re]), Ce = F(() => {
1287
1287
  var d, b;
1288
1288
  const a = Wt.current, x = Me.current;
1289
1289
  a && x ? ((d = Et.current) == null || d.postMessage({ type: "connecting", data: { from: a.startPos, to: x, _routedPoints: null } }), ae({ source: a.sourceId, sourceHandle: a.sourceHandle, target: null, targetHandle: null })) : ((b = Et.current) == null || b.postMessage({ type: "connecting", data: null }), ae(null));
1290
- }, []), Ne = F(() => {
1290
+ }, []), Le = F(() => {
1291
1291
  var x, d;
1292
1292
  const a = ie.current;
1293
1293
  a ? (x = Et.current) == null || x.postMessage({ type: "selectionBox", data: a }) : (d = Et.current) == null || d.postMessage({ type: "selectionBox", data: null });
1294
1294
  }, []), dr = F((a) => {
1295
- var L, I, h, A, T, Y, H, J, ut, U, nt, vt, Mt, At, Xt, Ht;
1296
- const x = Z.current.length > 0, d = lt(a.clientX, a.clientY), b = Ut.current;
1295
+ var N, I, h, A, T, Y, H, J, ct, U, nt, wt, Mt, At, Xt, Ht;
1296
+ const x = Z.current.length > 0, d = at(a.clientX, a.clientY), b = Ut.current;
1297
1297
  if (x && Rt) {
1298
1298
  const W = tn(d.x, d.y);
1299
1299
  if (Yt && Re.current && W) {
1300
1300
  const V = Re.current;
1301
1301
  if (W.nodeId !== V.nodeId) {
1302
1302
  const qt = V.handleType === "target" ? { source: W.nodeId, target: V.nodeId, sourceHandle: W.handleId || null, targetHandle: V.handleId } : { source: V.nodeId, target: W.nodeId, sourceHandle: V.handleId, targetHandle: W.handleId || null };
1303
- (O.current.isValidConnection ? O.current.isValidConnection(qt) : !0) && ((L = ce.current) == null || L.call(ce, { ...qt, ...be }));
1303
+ (O.current.isValidConnection ? O.current.isValidConnection(qt) : !0) && ((N = ce.current) == null || N.call(ce, { ...qt, ...be }));
1304
1304
  }
1305
1305
  Re.current = null;
1306
1306
  return;
@@ -1315,14 +1315,14 @@ function Lr({
1315
1315
  sourceHandle: W.handleId || null,
1316
1316
  sourceType: W.type,
1317
1317
  startPos: { x: W.x, y: W.y }
1318
- }, Me.current = { x: d.x, y: d.y }, (A = mt.current) == null || A.setPointerCapture(a.pointerId), (Y = (T = O.current).onConnectStart) == null || Y.call(T, a, { nodeId: W.nodeId, handleId: W.handleId, handleType: W.type }), Ce();
1318
+ }, Me.current = { x: d.x, y: d.y }, (A = vt.current) == null || A.setPointerCapture(a.pointerId), (Y = (T = O.current).onConnectStart) == null || Y.call(T, a, { nodeId: W.nodeId, handleId: W.handleId, handleType: W.type }), Ce();
1319
1319
  return;
1320
1320
  }
1321
1321
  }
1322
1322
  if (x) {
1323
1323
  const W = Tt(d.x, d.y);
1324
1324
  if (W) {
1325
- if (bt.current && Lt) {
1325
+ if (bt.current && Nt) {
1326
1326
  const kt = [];
1327
1327
  if (b)
1328
1328
  kt.push({ id: W.id, type: "select", selected: !W.selected });
@@ -1345,13 +1345,13 @@ function Lr({
1345
1345
  Jt();
1346
1346
  }
1347
1347
  }
1348
- if ((H = De.current) == null || H.call(De, a, W), zt) {
1348
+ if ((H = De.current) == null || H.call(De, a, W), ht) {
1349
1349
  const kt = b && W.selected;
1350
1350
  let V = null;
1351
1351
  if (W.parentId && W.extent === "parent") {
1352
1352
  const et = Z.current.find((qt) => qt.id === W.parentId);
1353
1353
  if (et) {
1354
- const qt = et.width || Vt, Xe = et.height || jt, en = W.width || ((J = W.measured) == null ? void 0 : J.width) || Vt, Fe = W.height || ((ut = W.measured) == null ? void 0 : ut.height) || jt;
1354
+ const qt = et.width || Vt, Xe = et.height || jt, en = W.width || ((J = W.measured) == null ? void 0 : J.width) || Vt, Fe = W.height || ((ct = W.measured) == null ? void 0 : ct.height) || jt;
1355
1355
  V = { minX: 0, minY: 0, maxX: qt - en, maxY: Xe - Fe };
1356
1356
  }
1357
1357
  }
@@ -1373,7 +1373,7 @@ function Lr({
1373
1373
  }
1374
1374
  return { id: et.id, startPos: { ...et.position }, parentClamp: qt, parentId: et.parentId || null };
1375
1375
  }) : []
1376
- }, (U = mt.current) == null || U.setPointerCapture(a.pointerId), (nt = Ae.current) == null || nt.call(Ae, a, W), bt.current) {
1376
+ }, (U = vt.current) == null || U.setPointerCapture(a.pointerId), (nt = Ae.current) == null || nt.call(Ae, a, W), bt.current) {
1377
1377
  const et = [{ id: W.id, type: "position", dragging: !0 }];
1378
1378
  for (const qt of _t.current.selectedStarts)
1379
1379
  et.push({ id: qt.id, type: "position", dragging: !0 });
@@ -1383,7 +1383,7 @@ function Lr({
1383
1383
  return;
1384
1384
  }
1385
1385
  }
1386
- if (Pt.current.length > 0 && Lt) {
1386
+ if (Pt.current.length > 0 && Nt) {
1387
1387
  const W = ue(d.x, d.y);
1388
1388
  if (W) {
1389
1389
  if (Dt.current) {
@@ -1400,7 +1400,7 @@ function Lr({
1400
1400
  }
1401
1401
  kt.length && (Dt.current(kt), Jt());
1402
1402
  }
1403
- (vt = le.current) == null || vt.call(le, a, W);
1403
+ (wt = le.current) == null || wt.call(le, a, W);
1404
1404
  return;
1405
1405
  }
1406
1406
  }
@@ -1409,17 +1409,17 @@ function Lr({
1409
1409
  W.length && bt.current && bt.current(W), kt.length && Dt.current && Dt.current(kt), (W.length || kt.length) && Jt();
1410
1410
  }
1411
1411
  if ((Mt = We.current) == null || Mt.call(We, a), ne || b) {
1412
- ie.current = { startWorld: { ...d }, endWorld: { ...d } }, (At = mt.current) == null || At.setPointerCapture(a.pointerId), Ne();
1412
+ ie.current = { startWorld: { ...d }, endWorld: { ...d } }, (At = vt.current) == null || At.setPointerCapture(a.pointerId), Le();
1413
1413
  return;
1414
1414
  }
1415
- Se.current = !0, te.current = { x: a.clientX, y: a.clientY }, (Xt = mt.current) == null || Xt.classList.add("dragging"), (Ht = mt.current) == null || Ht.setPointerCapture(a.pointerId);
1416
- }, [lt, Tt, tn, ue, zt, Rt, Lt, ne, Ce, Ne, Jt]), fr = F((a) => {
1415
+ Se.current = !0, te.current = { x: a.clientX, y: a.clientY }, (Xt = vt.current) == null || Xt.classList.add("dragging"), (Ht = vt.current) == null || Ht.setPointerCapture(a.pointerId);
1416
+ }, [at, Tt, tn, ue, ht, Rt, Nt, ne, Ce, Le, Jt]), fr = F((a) => {
1417
1417
  var d, b;
1418
1418
  if (Wt.current) {
1419
- if (Me.current = lt(a.clientX, a.clientY), Ce(), fn) {
1420
- const L = mt.current;
1421
- if (L) {
1422
- const I = L.getBoundingClientRect(), h = 40, A = a.clientX - I.left, T = a.clientY - I.top;
1419
+ if (Me.current = at(a.clientX, a.clientY), Ce(), fn) {
1420
+ const N = vt.current;
1421
+ if (N) {
1422
+ const I = N.getBoundingClientRect(), h = 40, A = a.clientX - I.left, T = a.clientY - I.top;
1423
1423
  let Y = 0, H = 0;
1424
1424
  A < h ? Y = Qt : A > I.width - h && (Y = -Qt), T < h ? H = Qt : T > I.height - h && (H = -Qt), (Y || H) && (pt.current.x += Y, pt.current.y += H, Ct(a));
1425
1425
  }
@@ -1427,13 +1427,13 @@ function Lr({
1427
1427
  return;
1428
1428
  }
1429
1429
  if (ie.current) {
1430
- ie.current.endWorld = lt(a.clientX, a.clientY), Ne();
1431
- const L = ie.current, I = Math.min(L.startWorld.x, L.endWorld.x), h = Math.min(L.startWorld.y, L.endWorld.y), A = Math.max(L.startWorld.x, L.endWorld.x), T = Math.max(L.startWorld.y, L.endWorld.y);
1430
+ ie.current.endWorld = at(a.clientX, a.clientY), Le();
1431
+ const N = ie.current, I = Math.min(N.startWorld.x, N.endWorld.x), h = Math.min(N.startWorld.y, N.endWorld.y), A = Math.max(N.startWorld.x, N.endWorld.x), T = Math.max(N.startWorld.y, N.endWorld.y);
1432
1432
  if (bt.current) {
1433
1433
  const Y = [];
1434
1434
  for (const H of Z.current) {
1435
1435
  if (H.hidden) continue;
1436
- const J = H.width || Vt, ut = H.height || jt, U = Ie === "full" ? H.position.x >= I && H.position.x + J <= A && H.position.y >= h && H.position.y + ut <= T : H.position.x + J > I && H.position.x < A && H.position.y + ut > h && H.position.y < T;
1436
+ const J = H.width || Vt, ct = H.height || jt, U = Ie === "full" ? H.position.x >= I && H.position.x + J <= A && H.position.y >= h && H.position.y + ct <= T : H.position.x + J > I && H.position.x < A && H.position.y + ct > h && H.position.y < T;
1437
1437
  U !== !!H.selected && Y.push({ id: H.id, type: "select", selected: U });
1438
1438
  }
1439
1439
  Y.length && bt.current(Y);
@@ -1441,7 +1441,7 @@ function Lr({
1441
1441
  return;
1442
1442
  }
1443
1443
  if (_t.current) {
1444
- const L = lt(a.clientX, a.clientY), I = _t.current, h = L.x - I.startMouse.x, A = L.y - I.startMouse.y;
1444
+ const N = at(a.clientX, a.clientY), I = _t.current, h = N.x - I.startMouse.x, A = N.y - I.startMouse.y;
1445
1445
  let T = { x: I.startPos.x + h, y: I.startPos.y + A };
1446
1446
  if (me && (T = Pn(T, de)), oe && (T = Tn(T, oe)), I.parentClamp) {
1447
1447
  const U = I.parentClamp;
@@ -1451,27 +1451,27 @@ function Lr({
1451
1451
  for (const U of I.selectedStarts) {
1452
1452
  let nt = { x: U.startPos.x + h, y: U.startPos.y + A };
1453
1453
  if (me && (nt = Pn(nt, de)), oe && (nt = Tn(nt, oe)), U.parentClamp) {
1454
- const vt = U.parentClamp;
1455
- nt = { x: Math.max(vt.minX, Math.min(nt.x, vt.maxX)), y: Math.max(vt.minY, Math.min(nt.y, vt.maxY)) };
1454
+ const wt = U.parentClamp;
1455
+ nt = { x: Math.max(wt.minX, Math.min(nt.x, wt.maxX)), y: Math.max(wt.minY, Math.min(nt.y, wt.maxY)) };
1456
1456
  }
1457
1457
  Y.push({ id: U.id, position: nt });
1458
1458
  }
1459
1459
  const H = [];
1460
1460
  for (const U of Y) {
1461
- const nt = Z.current.find((vt) => vt.id === U.id);
1461
+ const nt = Z.current.find((wt) => wt.id === U.id);
1462
1462
  if (nt) {
1463
1463
  nt.position = U.position, nt.dragging = !0;
1464
- let vt = U.position;
1464
+ let wt = U.position;
1465
1465
  if (nt.parentId) {
1466
1466
  let Mt = Z.current.find((Ht) => Ht.id === nt.parentId), At = U.position.x, Xt = U.position.y;
1467
1467
  for (; Mt; )
1468
1468
  At += Mt.position.x, Xt += Mt.position.y, Mt = Mt.parentId ? Z.current.find((Ht) => Ht.id === Mt.parentId) : null;
1469
- vt = { x: At, y: Xt };
1469
+ wt = { x: At, y: Xt };
1470
1470
  }
1471
1471
  H.push({
1472
1472
  id: U.id,
1473
1473
  position: U.position,
1474
- _absolutePosition: vt,
1474
+ _absolutePosition: wt,
1475
1475
  width: nt.width,
1476
1476
  height: nt.height,
1477
1477
  dragging: !0,
@@ -1482,13 +1482,13 @@ function Lr({
1482
1482
  const J = new Set(Y.map((U) => U.id));
1483
1483
  for (const U of Z.current)
1484
1484
  if (U.parentId && J.has(U.parentId) && !J.has(U.id)) {
1485
- let nt = Z.current.find((At) => At.id === U.parentId), vt = U.position.x, Mt = U.position.y;
1485
+ let nt = Z.current.find((At) => At.id === U.parentId), wt = U.position.x, Mt = U.position.y;
1486
1486
  for (; nt; )
1487
- vt += nt.position.x, Mt += nt.position.y, nt = nt.parentId ? Z.current.find((At) => At.id === nt.parentId) : null;
1487
+ wt += nt.position.x, Mt += nt.position.y, nt = nt.parentId ? Z.current.find((At) => At.id === nt.parentId) : null;
1488
1488
  H.push({
1489
1489
  id: U.id,
1490
1490
  position: U.position,
1491
- _absolutePosition: { x: vt, y: Mt },
1491
+ _absolutePosition: { x: wt, y: Mt },
1492
1492
  width: U.width,
1493
1493
  height: U.height,
1494
1494
  dragging: !1,
@@ -1496,24 +1496,24 @@ function Lr({
1496
1496
  });
1497
1497
  }
1498
1498
  if ((d = Et.current) == null || d.postMessage({ type: "nodePositions", data: { updates: H } }), dn) {
1499
- const U = mt.current;
1499
+ const U = vt.current;
1500
1500
  if (U) {
1501
- const nt = U.getBoundingClientRect(), vt = 40, Mt = a.clientX - nt.left, At = a.clientY - nt.top;
1501
+ const nt = U.getBoundingClientRect(), wt = 40, Mt = a.clientX - nt.left, At = a.clientY - nt.top;
1502
1502
  let Xt = 0, Ht = 0;
1503
- Mt < vt ? Xt = Qt : Mt > nt.width - vt && (Xt = -Qt), At < vt ? Ht = Qt : At > nt.height - vt && (Ht = -Qt), (Xt || Ht) && (pt.current.x += Xt, pt.current.y += Ht, Ct(a));
1503
+ Mt < wt ? Xt = Qt : Mt > nt.width - wt && (Xt = -Qt), At < wt ? Ht = Qt : At > nt.height - wt && (Ht = -Qt), (Xt || Ht) && (pt.current.x += Xt, pt.current.y += Ht, Ct(a));
1504
1504
  }
1505
1505
  }
1506
- const ut = Z.current.find((U) => U.id === I.id);
1507
- ut && ((b = He.current) == null || b.call(He, a, ut));
1506
+ const ct = Z.current.find((U) => U.id === I.id);
1507
+ ct && ((b = He.current) == null || b.call(He, a, ct));
1508
1508
  return;
1509
1509
  }
1510
1510
  if (!Se.current) return;
1511
1511
  const x = pt.current;
1512
1512
  x.x += a.clientX - te.current.x, x.y += a.clientY - te.current.y, te.current = { x: a.clientX, y: a.clientY }, Ct();
1513
- }, [Ct, lt, Ce, Ne]), hr = F((a) => {
1514
- var x, d, b, L, I;
1513
+ }, [Ct, at, Ce, Le]), hr = F((a) => {
1514
+ var x, d, b, N, I;
1515
1515
  if (Wt.current) {
1516
- const h = lt(a.clientX, a.clientY), A = tn(h.x, h.y);
1516
+ const h = at(a.clientX, a.clientY), A = tn(h.x, h.y);
1517
1517
  if (A && A.nodeId !== Wt.current.sourceId && (Bt === "loose" || A.type === "target")) {
1518
1518
  const H = Wt.current.sourceType === "target" ? {
1519
1519
  source: A.nodeId,
@@ -1532,7 +1532,7 @@ function Lr({
1532
1532
  return;
1533
1533
  }
1534
1534
  if (ie.current) {
1535
- ie.current = null, Ne(), Jt();
1535
+ ie.current = null, Le(), Jt();
1536
1536
  return;
1537
1537
  }
1538
1538
  if (_t.current) {
@@ -1545,7 +1545,7 @@ function Lr({
1545
1545
  dragging: !1
1546
1546
  }];
1547
1547
  for (const H of h.selectedStarts) {
1548
- const J = Z.current.find((ut) => ut.id === H.id);
1548
+ const J = Z.current.find((ct) => ct.id === H.id);
1549
1549
  Y.push({
1550
1550
  id: H.id,
1551
1551
  type: "position",
@@ -1559,13 +1559,13 @@ function Lr({
1559
1559
  _t.current = null;
1560
1560
  });
1561
1561
  const A = Z.current.find((T) => T.id === h.id);
1562
- A && ((L = _e.current) == null || L.call(_e, a, A));
1562
+ A && ((N = _e.current) == null || N.call(_e, a, A));
1563
1563
  return;
1564
1564
  }
1565
- Se.current = !1, (I = mt.current) == null || I.classList.remove("dragging");
1566
- }, [lt, tn, Ce, Ne, Jt]);
1567
- ht(() => {
1568
- const a = mt.current;
1565
+ Se.current = !1, (I = vt.current) == null || I.classList.remove("dragging");
1566
+ }, [at, tn, Ce, Le, Jt]);
1567
+ ft(() => {
1568
+ const a = vt.current;
1569
1569
  if (!a) return;
1570
1570
  const x = (d) => {
1571
1571
  Pe && d.preventDefault();
@@ -1576,13 +1576,13 @@ function Lr({
1576
1576
  return;
1577
1577
  }
1578
1578
  if (!Oe) return;
1579
- const L = d.deltaY > 0 ? 0.92 : 1.08, I = a.getBoundingClientRect(), h = d.clientX - I.left, A = d.clientY - I.top;
1580
- b.x = h - (h - b.x) * L, b.y = A - (A - b.y) * L, b.zoom = Math.min(xt, Math.max(st, b.zoom * L)), Ct(d);
1579
+ const N = d.deltaY > 0 ? 0.92 : 1.08, I = a.getBoundingClientRect(), h = d.clientX - I.left, A = d.clientY - I.top;
1580
+ b.x = h - (h - b.x) * N, b.y = A - (A - b.y) * N, b.zoom = Math.min(mt, Math.max(it, b.zoom * N)), Ct(d);
1581
1581
  };
1582
1582
  return a.addEventListener("wheel", x, { passive: !Pe }), () => a.removeEventListener("wheel", x);
1583
- }, [Ct, st, xt, Ge, $e, Ze, Oe, Pe]), ht(() => {
1583
+ }, [Ct, it, mt, Ge, $e, Ze, Oe, Pe]), ft(() => {
1584
1584
  if (!Ke) return;
1585
- const a = mt.current;
1585
+ const a = vt.current;
1586
1586
  if (!a) return;
1587
1587
  let x = 0, d = null;
1588
1588
  const b = (h) => {
@@ -1595,48 +1595,48 @@ function Lr({
1595
1595
  y: (h.touches[0].clientY + h.touches[1].clientY) / 2 - Y.top
1596
1596
  }, h.preventDefault();
1597
1597
  }
1598
- }, L = (h) => {
1598
+ }, N = (h) => {
1599
1599
  if (h.touches.length === 2 && x > 0) {
1600
1600
  h.preventDefault();
1601
1601
  const A = h.touches[0].clientX - h.touches[1].clientX, T = h.touches[0].clientY - h.touches[1].clientY, Y = Math.hypot(A, T), H = Y / x;
1602
1602
  x = Y;
1603
- const J = pt.current, ut = d.x, U = d.y;
1604
- J.x = ut - (ut - J.x) * H, J.y = U - (U - J.y) * H, J.zoom = Math.min(xt, Math.max(st, J.zoom * H)), Ct(h);
1603
+ const J = pt.current, ct = d.x, U = d.y;
1604
+ J.x = ct - (ct - J.x) * H, J.y = U - (U - J.y) * H, J.zoom = Math.min(mt, Math.max(it, J.zoom * H)), Ct(h);
1605
1605
  }
1606
1606
  }, I = () => {
1607
1607
  x = 0, d = null;
1608
1608
  };
1609
- return a.addEventListener("touchstart", b, { passive: !1 }), a.addEventListener("touchmove", L, { passive: !1 }), a.addEventListener("touchend", I), () => {
1610
- a.removeEventListener("touchstart", b), a.removeEventListener("touchmove", L), a.removeEventListener("touchend", I);
1609
+ return a.addEventListener("touchstart", b, { passive: !1 }), a.addEventListener("touchmove", N, { passive: !1 }), a.addEventListener("touchend", I), () => {
1610
+ a.removeEventListener("touchstart", b), a.removeEventListener("touchmove", N), a.removeEventListener("touchend", I);
1611
1611
  };
1612
- }, [Ke, Ct, st, xt]), ht(() => {
1612
+ }, [Ke, Ct, it, mt]), ft(() => {
1613
1613
  if (!Qe) return;
1614
- const a = mt.current;
1614
+ const a = vt.current;
1615
1615
  if (!a) return;
1616
1616
  const x = (d) => {
1617
- var H, J, ut, U;
1618
- const b = lt(d.clientX, d.clientY);
1617
+ var H, J, ct, U;
1618
+ const b = at(d.clientX, d.clientY);
1619
1619
  if (Tt(b.x, b.y)) {
1620
1620
  (J = (H = O.current).onNodeDoubleClick) == null || J.call(H, d, Tt(b.x, b.y));
1621
1621
  return;
1622
1622
  }
1623
- const L = ue(b.x, b.y);
1624
- if (L) {
1625
- (U = (ut = O.current).onEdgeDoubleClick) == null || U.call(ut, d, L);
1623
+ const N = ue(b.x, b.y);
1624
+ if (N) {
1625
+ (U = (ct = O.current).onEdgeDoubleClick) == null || U.call(ct, d, N);
1626
1626
  return;
1627
1627
  }
1628
1628
  const I = 1.5, h = a.getBoundingClientRect(), A = d.clientX - h.left, T = d.clientY - h.top, Y = pt.current;
1629
- Y.x = A - (A - Y.x) * I, Y.y = T - (T - Y.y) * I, Y.zoom = Math.min(xt, Math.max(st, Y.zoom * I)), Ct(d);
1629
+ Y.x = A - (A - Y.x) * I, Y.y = T - (T - Y.y) * I, Y.zoom = Math.min(mt, Math.max(it, Y.zoom * I)), Ct(d);
1630
1630
  };
1631
1631
  return a.addEventListener("dblclick", x), () => a.removeEventListener("dblclick", x);
1632
- }, [Qe, Ct, st, xt, lt, Tt, ue]), ht(() => {
1633
- const a = mt.current;
1632
+ }, [Qe, Ct, it, mt, at, Tt, ue]), ft(() => {
1633
+ const a = vt.current;
1634
1634
  if (!a) return;
1635
1635
  const x = (d) => {
1636
1636
  var h, A, T, Y, H, J;
1637
- const b = lt(d.clientX, d.clientY), L = Tt(b.x, b.y);
1638
- if (L) {
1639
- (A = (h = O.current).onNodeContextMenu) == null || A.call(h, d, L);
1637
+ const b = at(d.clientX, d.clientY), N = Tt(b.x, b.y);
1638
+ if (N) {
1639
+ (A = (h = O.current).onNodeContextMenu) == null || A.call(h, d, N);
1640
1640
  return;
1641
1641
  }
1642
1642
  const I = ue(b.x, b.y);
@@ -1647,31 +1647,31 @@ function Lr({
1647
1647
  (J = (H = O.current).onPaneContextMenu) == null || J.call(H, d);
1648
1648
  };
1649
1649
  return a.addEventListener("contextmenu", x), () => a.removeEventListener("contextmenu", x);
1650
- }, [lt, Tt, ue]), ht(() => {
1651
- const a = mt.current;
1650
+ }, [at, Tt, ue]), ft(() => {
1651
+ const a = vt.current;
1652
1652
  if (!a) return;
1653
1653
  let x = null, d = null;
1654
1654
  const b = (h) => {
1655
- var Y, H, J, ut, U, nt, vt, Mt, At, Xt, Ht, W, kt, V;
1655
+ var Y, H, J, ct, U, nt, wt, Mt, At, Xt, Ht, W, kt, V;
1656
1656
  (H = (Y = O.current).onPaneMouseMove) == null || H.call(Y, h);
1657
- const A = lt(h.clientX, h.clientY), T = Tt(A.x, A.y);
1658
- if (T !== x && (x && ((ut = (J = O.current).onNodeMouseLeave) == null || ut.call(J, h, x)), T && ((nt = (U = O.current).onNodeMouseEnter) == null || nt.call(U, h, T)), x = T), T && ((Mt = (vt = O.current).onNodeMouseMove) == null || Mt.call(vt, h, T)), !T) {
1657
+ const A = at(h.clientX, h.clientY), T = Tt(A.x, A.y);
1658
+ if (T !== x && (x && ((ct = (J = O.current).onNodeMouseLeave) == null || ct.call(J, h, x)), T && ((nt = (U = O.current).onNodeMouseEnter) == null || nt.call(U, h, T)), x = T), T && ((Mt = (wt = O.current).onNodeMouseMove) == null || Mt.call(wt, h, T)), !T) {
1659
1659
  const et = ue(A.x, A.y);
1660
1660
  et !== d && (d && ((Xt = (At = O.current).onEdgeMouseLeave) == null || Xt.call(At, h, d)), et && ((W = (Ht = O.current).onEdgeMouseEnter) == null || W.call(Ht, h, et)), d = et), et && ((V = (kt = O.current).onEdgeMouseMove) == null || V.call(kt, h, et));
1661
1661
  }
1662
- }, L = (h) => {
1662
+ }, N = (h) => {
1663
1663
  var A, T;
1664
1664
  return (T = (A = O.current).onPaneMouseEnter) == null ? void 0 : T.call(A, h);
1665
1665
  }, I = (h) => {
1666
- var A, T, Y, H, J, ut;
1667
- (T = (A = O.current).onPaneMouseLeave) == null || T.call(A, h), x && ((H = (Y = O.current).onNodeMouseLeave) == null || H.call(Y, h, x), x = null), d && ((ut = (J = O.current).onEdgeMouseLeave) == null || ut.call(J, h, d), d = null);
1666
+ var A, T, Y, H, J, ct;
1667
+ (T = (A = O.current).onPaneMouseLeave) == null || T.call(A, h), x && ((H = (Y = O.current).onNodeMouseLeave) == null || H.call(Y, h, x), x = null), d && ((ct = (J = O.current).onEdgeMouseLeave) == null || ct.call(J, h, d), d = null);
1668
1668
  };
1669
- return a.addEventListener("mousemove", b), a.addEventListener("mouseenter", L), a.addEventListener("mouseleave", I), () => {
1670
- a.removeEventListener("mousemove", b), a.removeEventListener("mouseenter", L), a.removeEventListener("mouseleave", I);
1669
+ return a.addEventListener("mousemove", b), a.addEventListener("mouseenter", N), a.addEventListener("mouseleave", I), () => {
1670
+ a.removeEventListener("mousemove", b), a.removeEventListener("mouseenter", N), a.removeEventListener("mouseleave", I);
1671
1671
  };
1672
- }, [lt, Tt, ue]), ht(() => {
1672
+ }, [at, Tt, ue]), ft(() => {
1673
1673
  const a = Array.isArray(ve) ? ve : [ve], x = async (d) => {
1674
- var b, L;
1674
+ var b, N;
1675
1675
  if (a.includes(d.key)) {
1676
1676
  if (d.target.tagName === "INPUT" || d.target.tagName === "TEXTAREA" || d.target.isContentEditable) return;
1677
1677
  const I = Z.current.filter((T) => T.selected), h = Pt.current.filter((T) => T.selected);
@@ -1682,7 +1682,7 @@ function Lr({
1682
1682
  const T = Pt.current.filter((Y) => A.has(Y.source) || A.has(Y.target));
1683
1683
  T.length && Dt.current(T.map((Y) => ({ id: Y.id, type: "remove" })));
1684
1684
  }
1685
- h.length && Dt.current && Dt.current(h.map((T) => ({ id: T.id, type: "remove" }))), (L = (b = O.current).onDelete) == null || L.call(b, { nodes: I, edges: h });
1685
+ h.length && Dt.current && Dt.current(h.map((T) => ({ id: T.id, type: "remove" }))), (N = (b = O.current).onDelete) == null || N.call(b, { nodes: I, edges: h });
1686
1686
  }
1687
1687
  if ((d.ctrlKey || d.metaKey) && d.key === "a") {
1688
1688
  if (d.target.tagName === "INPUT" || d.target.tagName === "TEXTAREA") return;
@@ -1699,14 +1699,14 @@ function Lr({
1699
1699
  return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
1700
1700
  }, [ve]);
1701
1701
  const In = tt(!1);
1702
- ht(() => {
1702
+ ft(() => {
1703
1703
  var a, x;
1704
1704
  if (!In.current && Et.current) {
1705
- if (In.current = !0, gt && Z.current.length > 0) {
1706
- const d = mt.current;
1705
+ if (In.current = !0, zt && Z.current.length > 0) {
1706
+ const d = vt.current;
1707
1707
  if (d) {
1708
- const b = d.getBoundingClientRect(), L = (ct == null ? void 0 : ct.padding) ?? 0.1, I = Mn(Z.current), h = Rn(I, b.width, b.height, L);
1709
- ct != null && ct.maxZoom && (h.zoom = Math.min(h.zoom, ct.maxZoom)), ct != null && ct.minZoom && (h.zoom = Math.max(h.zoom, ct.minZoom)), pt.current = h, Ct();
1708
+ const b = d.getBoundingClientRect(), N = (dt == null ? void 0 : dt.padding) ?? 0.1, I = Mn(Z.current), h = Rn(I, b.width, b.height, N);
1709
+ dt != null && dt.maxZoom && (h.zoom = Math.min(h.zoom, dt.maxZoom)), dt != null && dt.minZoom && (h.zoom = Math.max(h.zoom, dt.minZoom)), pt.current = h, Ct();
1710
1710
  }
1711
1711
  }
1712
1712
  (x = (a = O.current).onInit) == null || x.call(a, {
@@ -1714,24 +1714,24 @@ function Lr({
1714
1714
  getEdges: () => [...Pt.current],
1715
1715
  getViewport: () => ({ ...pt.current }),
1716
1716
  fitView: (d = {}) => {
1717
- const b = mt.current;
1717
+ const b = vt.current;
1718
1718
  if (!b || !Z.current.length) return;
1719
- const L = b.getBoundingClientRect(), I = Mn(Z.current), h = Rn(I, L.width, L.height, d.padding ?? 0.1);
1719
+ const N = b.getBoundingClientRect(), I = Mn(Z.current), h = Rn(I, N.width, N.height, d.padding ?? 0.1);
1720
1720
  pt.current = h, Ct();
1721
1721
  }
1722
1722
  });
1723
1723
  }
1724
1724
  });
1725
1725
  const yr = F(() => {
1726
- pt.current = { ...Nt }, Ct();
1727
- }, [Ct, Nt]), gr = F((a) => {
1726
+ pt.current = { ...Lt }, Ct();
1727
+ }, [Ct, Lt]), gr = F((a) => {
1728
1728
  var x;
1729
1729
  if (a)
1730
1730
  se.current.push(a);
1731
1731
  else {
1732
- const d = pt.current, b = mt.current;
1732
+ const d = pt.current, b = vt.current;
1733
1733
  if (!b) return;
1734
- const L = b.getBoundingClientRect(), I = Math.round(-d.x / d.zoom + L.width / 2 / d.zoom), h = Math.round(-d.y / d.zoom + L.height / 2 / d.zoom);
1734
+ const N = b.getBoundingClientRect(), I = Math.round(-d.x / d.zoom + N.width / 2 / d.zoom), h = Math.round(-d.y / d.zoom + N.height / 2 / d.zoom);
1735
1735
  se.current.push({
1736
1736
  x: I - 80,
1737
1737
  y: h - 45,
@@ -1744,7 +1744,7 @@ function Lr({
1744
1744
  (x = Et.current) == null || x.postMessage({ type: "cards", data: { cards: [...se.current] } });
1745
1745
  }, []), pr = F((a) => {
1746
1746
  if (a.id || (a.id = "node-" + Date.now()), !a.position) {
1747
- const x = pt.current, d = mt.current;
1747
+ const x = pt.current, d = vt.current;
1748
1748
  if (!d) return;
1749
1749
  const b = d.getBoundingClientRect();
1750
1750
  a.position = {
@@ -1755,8 +1755,8 @@ function Lr({
1755
1755
  a.data || (a.data = { label: a.id }), bt.current && bt.current([{ type: "add", item: a }]);
1756
1756
  }, []), xr = F(() => ({ ...pt.current }), []), mr = F((a) => {
1757
1757
  pt.current = { ...pt.current, ...a }, Ct();
1758
- }, [Ct]), vr = F((a) => lt(a.x, a.y), [lt]), $n = n, wr = St(() => ({
1759
- wrapRef: mt,
1758
+ }, [Ct]), vr = F((a) => at(a.x, a.y), [at]), $n = n, wr = St(() => ({
1759
+ wrapRef: vt,
1760
1760
  canvasRef: Te,
1761
1761
  workerRef: Et,
1762
1762
  cameraRef: pt,
@@ -1767,11 +1767,11 @@ function Lr({
1767
1767
  onNodesChangeRef: bt,
1768
1768
  onEdgesChangeRef: Dt,
1769
1769
  sendCamera: Ct,
1770
- screenToWorld: lt,
1770
+ screenToWorld: at,
1771
1771
  viewportListeners: Kt,
1772
1772
  selectionListeners: he,
1773
- zoomMin: st,
1774
- zoomMax: xt,
1773
+ zoomMin: it,
1774
+ zoomMax: mt,
1775
1775
  snapToGrid: me,
1776
1776
  snapGrid: de,
1777
1777
  nodeExtent: oe,
@@ -1793,9 +1793,9 @@ function Lr({
1793
1793
  get connection() {
1794
1794
  return Ve;
1795
1795
  }
1796
- }), [e, n, $n, Be, Ve, Ct, lt, Ft, Kt, he, st, xt, me, de, oe, be, fe]);
1796
+ }), [e, n, $n, Be, Ve, Ct, at, Ft, Kt, he, it, mt, me, de, oe, be, fe]);
1797
1797
  return {
1798
- wrapRef: mt,
1798
+ wrapRef: vt,
1799
1799
  canvasRef: Te,
1800
1800
  canvasReady: gn,
1801
1801
  onPointerDown: dr,
@@ -1830,15 +1830,15 @@ function Ro() {
1830
1830
  function $r({ node: t, nodeType: e }) {
1831
1831
  var m, C, z;
1832
1832
  const n = yt(), r = tt(null), s = t._absolutePosition || t.position, o = tt(null);
1833
- ht(() => {
1833
+ ft(() => {
1834
1834
  const M = r.current;
1835
1835
  if (!M) return;
1836
- const $ = new ResizeObserver((k) => {
1836
+ const $ = new ResizeObserver((R) => {
1837
1837
  var D, g, f, p;
1838
- const { width: E, height: _ } = k[0].contentRect;
1838
+ const { width: E, height: _ } = R[0].contentRect;
1839
1839
  if (E > 0 && _ > 0) {
1840
- const v = n.nodesRef.current.find((P) => P.id === t.id), N = (v == null ? void 0 : v.width) || ((D = v == null ? void 0 : v.measured) == null ? void 0 : D.width), w = (v == null ? void 0 : v.height) || ((g = v == null ? void 0 : v.measured) == null ? void 0 : g.height);
1841
- (Math.abs((N || 0) - E) > 1 || Math.abs((w || 0) - _) > 1) && ((p = (f = n.onNodesChangeRef).current) == null || p.call(f, [
1840
+ const v = n.nodesRef.current.find((P) => P.id === t.id), L = (v == null ? void 0 : v.width) || ((D = v == null ? void 0 : v.measured) == null ? void 0 : D.width), w = (v == null ? void 0 : v.height) || ((g = v == null ? void 0 : v.measured) == null ? void 0 : g.height);
1841
+ (Math.abs((L || 0) - E) > 1 || Math.abs((w || 0) - _) > 1) && ((p = (f = n.onNodesChangeRef).current) == null || p.call(f, [
1842
1842
  { id: t.id, type: "dimensions", dimensions: { width: E, height: _ }, setAttributes: !0 }
1843
1843
  ]));
1844
1844
  }
@@ -1846,21 +1846,22 @@ function $r({ node: t, nodeType: e }) {
1846
1846
  return $.observe(M), () => $.disconnect();
1847
1847
  }, [t.id, n]);
1848
1848
  const i = F((M) => {
1849
- var B, q, X;
1849
+ var B, j, X, xt;
1850
+ M.stopPropagation();
1850
1851
  const $ = M.target.tagName;
1851
- if ($ === "INPUT" || $ === "TEXTAREA" || $ === "SELECT" || $ === "BUTTON" || $ === "A" || M.target.isContentEditable) return;
1852
- let k = M.target;
1853
- for (; k && k !== r.current; ) {
1854
- if ((B = k.classList) != null && B.contains("nodrag")) return;
1855
- k = k.parentElement;
1852
+ if ($ === "INPUT" || $ === "TEXTAREA" || $ === "SELECT" || $ === "BUTTON" || $ === "A" || $ === "LABEL" || M.target.isContentEditable) return;
1853
+ let R = M.target;
1854
+ for (; R && R !== r.current; ) {
1855
+ if ((B = R.classList) != null && B.contains("nodrag") || (j = R.classList) != null && j.contains("nopan")) return;
1856
+ R = R.parentElement;
1856
1857
  }
1857
- if (M.stopPropagation(), n.onNodesChangeRef.current) {
1858
+ if (n.onNodesChangeRef.current) {
1858
1859
  const K = [];
1859
1860
  if (M.shiftKey)
1860
1861
  K.push({ id: t.id, type: "select", selected: !t.selected });
1861
1862
  else
1862
- for (const rt of n.nodesRef.current)
1863
- rt.id === t.id && !rt.selected ? K.push({ id: rt.id, type: "select", selected: !0 }) : rt.id !== t.id && rt.selected && K.push({ id: rt.id, type: "select", selected: !1 });
1863
+ for (const q of n.nodesRef.current)
1864
+ q.id === t.id && !q.selected ? K.push({ id: q.id, type: "select", selected: !0 }) : q.id !== t.id && q.selected && K.push({ id: q.id, type: "select", selected: !1 });
1864
1865
  K.length && n.onNodesChangeRef.current(K);
1865
1866
  }
1866
1867
  const E = n.cameraRef.current, _ = n.wrapRef.current;
@@ -1871,53 +1872,53 @@ function $r({ node: t, nodeType: e }) {
1871
1872
  startMouse: { x: g, y: f },
1872
1873
  selectedStarts: v
1873
1874
  };
1874
- const N = [{ id: t.id, type: "position", dragging: !0 }];
1875
+ const L = [{ id: t.id, type: "position", dragging: !0 }];
1875
1876
  for (const K of v)
1876
- N.push({ id: K.id, type: "position", dragging: !0 });
1877
- (X = (q = n.onNodesChangeRef).current) == null || X.call(q, N);
1877
+ L.push({ id: K.id, type: "position", dragging: !0 });
1878
+ (xt = (X = n.onNodesChangeRef).current) == null || xt.call(X, L);
1878
1879
  const w = r.current;
1879
1880
  w && w.setPointerCapture(M.pointerId);
1880
1881
  const P = (K) => {
1881
- var It, st, xt, Nt;
1882
+ var it, mt, Lt, zt;
1882
1883
  if (!o.current) return;
1883
- const at = n.cameraRef.current, rt = _.getBoundingClientRect(), G = (K.clientX - rt.left - at.x) / at.zoom, j = (K.clientY - rt.top - at.y) / at.zoom, it = G - o.current.startMouse.x, dt = j - o.current.startMouse.y;
1884
- let ot = { x: o.current.startPos.x + it, y: o.current.startPos.y + dt };
1885
- if (n.snapToGrid && n.snapGrid && (ot = {
1886
- x: n.snapGrid[0] * Math.round(ot.x / n.snapGrid[0]),
1887
- y: n.snapGrid[1] * Math.round(ot.y / n.snapGrid[1])
1884
+ const rt = n.cameraRef.current, q = _.getBoundingClientRect(), G = (K.clientX - q.left - rt.x) / rt.zoom, ot = (K.clientY - q.top - rt.y) / rt.zoom, lt = G - o.current.startMouse.x, ut = ot - o.current.startMouse.y;
1885
+ let st = { x: o.current.startPos.x + lt, y: o.current.startPos.y + ut };
1886
+ if (n.snapToGrid && n.snapGrid && (st = {
1887
+ x: n.snapGrid[0] * Math.round(st.x / n.snapGrid[0]),
1888
+ y: n.snapGrid[1] * Math.round(st.y / n.snapGrid[1])
1888
1889
  }), t.parentId && t.extent === "parent") {
1889
- const gt = n.nodesRef.current.find((ct) => ct.id === t.parentId);
1890
- if (gt) {
1891
- const ct = gt.width || 160, zt = gt.height || 60, Rt = t.width || ((It = t.measured) == null ? void 0 : It.width) || 160, Lt = t.height || ((st = t.measured) == null ? void 0 : st.height) || 60;
1892
- ot = {
1893
- x: Math.max(0, Math.min(ot.x, ct - Rt)),
1894
- y: Math.max(0, Math.min(ot.y, zt - Lt))
1890
+ const dt = n.nodesRef.current.find((ht) => ht.id === t.parentId);
1891
+ if (dt) {
1892
+ const ht = dt.width || 160, Rt = dt.height || 60, Nt = t.width || ((it = t.measured) == null ? void 0 : it.width) || 160, gt = t.height || ((mt = t.measured) == null ? void 0 : mt.height) || 60;
1893
+ st = {
1894
+ x: Math.max(0, Math.min(st.x, ht - Nt)),
1895
+ y: Math.max(0, Math.min(st.y, Rt - gt))
1895
1896
  };
1896
1897
  }
1897
1898
  }
1898
- const ft = [{ id: t.id, type: "position", position: ot, dragging: !0 }];
1899
- for (const gt of o.current.selectedStarts) {
1900
- let ct = { x: gt.startPos.x + it, y: gt.startPos.y + dt };
1901
- n.snapToGrid && n.snapGrid && (ct = {
1902
- x: n.snapGrid[0] * Math.round(ct.x / n.snapGrid[0]),
1903
- y: n.snapGrid[1] * Math.round(ct.y / n.snapGrid[1])
1904
- }), ft.push({ id: gt.id, type: "position", position: ct, dragging: !0 });
1899
+ const It = [{ id: t.id, type: "position", position: st, dragging: !0 }];
1900
+ for (const dt of o.current.selectedStarts) {
1901
+ let ht = { x: dt.startPos.x + lt, y: dt.startPos.y + ut };
1902
+ n.snapToGrid && n.snapGrid && (ht = {
1903
+ x: n.snapGrid[0] * Math.round(ht.x / n.snapGrid[0]),
1904
+ y: n.snapGrid[1] * Math.round(ht.y / n.snapGrid[1])
1905
+ }), It.push({ id: dt.id, type: "position", position: ht, dragging: !0 });
1905
1906
  }
1906
- (Nt = (xt = n.onNodesChangeRef).current) == null || Nt.call(xt, ft);
1907
- }, R = (K) => {
1908
- var rt, G;
1907
+ (zt = (Lt = n.onNodesChangeRef).current) == null || zt.call(Lt, It);
1908
+ }, k = (K) => {
1909
+ var q, G;
1909
1910
  if (!o.current) return;
1910
- const at = [{ id: t.id, type: "position", dragging: !1 }];
1911
- for (const j of o.current.selectedStarts)
1912
- at.push({ id: j.id, type: "position", dragging: !1 });
1913
- (G = (rt = n.onNodesChangeRef).current) == null || G.call(rt, at), o.current = null, w && w.releasePointerCapture(K.pointerId), w == null || w.removeEventListener("pointermove", P), w == null || w.removeEventListener("pointerup", R);
1911
+ const rt = [{ id: t.id, type: "position", dragging: !1 }];
1912
+ for (const ot of o.current.selectedStarts)
1913
+ rt.push({ id: ot.id, type: "position", dragging: !1 });
1914
+ (G = (q = n.onNodesChangeRef).current) == null || G.call(q, rt), o.current = null, w && w.releasePointerCapture(K.pointerId), w == null || w.removeEventListener("pointermove", P), w == null || w.removeEventListener("pointerup", k);
1914
1915
  };
1915
- w == null || w.addEventListener("pointermove", P), w == null || w.addEventListener("pointerup", R);
1916
+ w == null || w.addEventListener("pointermove", P), w == null || w.addEventListener("pointerup", k);
1916
1917
  }, [t, n]), c = F((M) => {
1917
- var g, f, p, v, N, w;
1918
+ var g, f, p, v, L, w;
1918
1919
  if (!t.selected) return;
1919
1920
  const $ = M.shiftKey ? 10 : 1;
1920
- let k = 0, E = 0;
1921
+ let R = 0, E = 0;
1921
1922
  switch (M.key) {
1922
1923
  case "ArrowUp":
1923
1924
  E = -$;
@@ -1926,10 +1927,10 @@ function $r({ node: t, nodeType: e }) {
1926
1927
  E = $;
1927
1928
  break;
1928
1929
  case "ArrowLeft":
1929
- k = -$;
1930
+ R = -$;
1930
1931
  break;
1931
1932
  case "ArrowRight":
1932
- k = $;
1933
+ R = $;
1933
1934
  break;
1934
1935
  case "Escape":
1935
1936
  (f = (g = n.onNodesChangeRef).current) == null || f.call(g, [{ id: t.id, type: "select", selected: !1 }]);
@@ -1942,10 +1943,10 @@ function $r({ node: t, nodeType: e }) {
1942
1943
  return;
1943
1944
  }
1944
1945
  M.preventDefault();
1945
- const _ = { x: t.position.x + k, y: t.position.y + E }, D = [{ id: t.id, type: "position", position: _ }];
1946
+ const _ = { x: t.position.x + R, y: t.position.y + E }, D = [{ id: t.id, type: "position", position: _ }];
1946
1947
  for (const P of n.nodesRef.current)
1947
- P.selected && P.id !== t.id && D.push({ id: P.id, type: "position", position: { x: P.position.x + k, y: P.position.y + E } });
1948
- (w = (N = n.onNodesChangeRef).current) == null || w.call(N, D);
1948
+ P.selected && P.id !== t.id && D.push({ id: P.id, type: "position", position: { x: P.position.x + R, y: P.position.y + E } });
1949
+ (w = (L = n.onNodesChangeRef).current) == null || w.call(L, D);
1949
1950
  }, [t, n]), u = t.width || ((m = t.measured) == null ? void 0 : m.width), l = t.height || ((C = t.measured) == null ? void 0 : C.height), y = !!(u && l);
1950
1951
  return /* @__PURE__ */ S(je.Provider, { value: t.id, children: /* @__PURE__ */ S(
1951
1952
  "div",
@@ -1958,9 +1959,7 @@ function $r({ node: t, nodeType: e }) {
1958
1959
  top: s.y,
1959
1960
  zIndex: t.type === "group" ? 0 : t.zIndex || 1,
1960
1961
  pointerEvents: t.type === "group" ? "none" : "all",
1961
- cursor: t.dragging ? "grabbing" : "grab",
1962
1962
  visibility: y ? "visible" : "hidden",
1963
- userSelect: "none",
1964
1963
  outline: "none"
1965
1964
  },
1966
1965
  "data-nodeid": t.id,
@@ -2055,75 +2054,75 @@ function Dn({ x: t, y: e, position: n, type: r, onPointerDown: s }) {
2055
2054
  }
2056
2055
  function Br({ edge: t, edgeType: e, nodes: n, reconnectable: r }) {
2057
2056
  var g, f, p;
2058
- const s = yt(), [o, i] = Gt(null), c = F((v, N, w, P) => {
2057
+ const s = yt(), [o, i] = Gt(null), c = F((v, L, w, P) => {
2059
2058
  var rt;
2060
- N.stopPropagation(), N.preventDefault();
2061
- const R = s.wrapRef.current;
2062
- if (!R) return;
2063
- const B = v === "source" ? P : w, q = v === "source" ? t.target : t.source;
2059
+ L.stopPropagation(), L.preventDefault();
2060
+ const k = s.wrapRef.current;
2061
+ if (!k) return;
2062
+ const B = v === "source" ? P : w, j = v === "source" ? t.target : t.source;
2064
2063
  (rt = s.workerRef.current) == null || rt.postMessage({
2065
2064
  type: "connecting",
2066
2065
  data: { from: { x: B.x, y: B.y }, to: { x: B.x, y: B.y } }
2067
2066
  });
2068
- const X = R.getBoundingClientRect(), K = (G) => {
2069
- var ot;
2070
- const j = s.cameraRef.current, it = (G.clientX - X.left - j.x) / j.zoom, dt = (G.clientY - X.top - j.y) / j.zoom;
2071
- (ot = s.workerRef.current) == null || ot.postMessage({
2067
+ const X = k.getBoundingClientRect(), xt = (q) => {
2068
+ var ut;
2069
+ const G = s.cameraRef.current, ot = (q.clientX - X.left - G.x) / G.zoom, lt = (q.clientY - X.top - G.y) / G.zoom;
2070
+ (ut = s.workerRef.current) == null || ut.postMessage({
2072
2071
  type: "connecting",
2073
- data: { from: { x: B.x, y: B.y }, to: { x: it, y: dt } }
2072
+ data: { from: { x: B.x, y: B.y }, to: { x: ot, y: lt } }
2074
2073
  });
2075
- }, at = (G) => {
2076
- var xt, Nt, gt, ct;
2077
- const j = s.cameraRef.current, it = (G.clientX - X.left - j.x) / j.zoom, dt = (G.clientY - X.top - j.y) / j.zoom, ot = 20 / j.zoom;
2078
- let ft = null, It = null;
2079
- const st = (xt = s.handleRegistryRef) == null ? void 0 : xt.current;
2080
- for (const zt of s.nodesRef.current) {
2081
- if (zt.hidden) continue;
2082
- const Rt = zt.width || On, Lt = zt.height || Qn, wt = zt._absolutePosition || zt.position, ne = [];
2083
- if (st)
2084
- for (const [, Bt] of st)
2085
- Bt.nodeId === zt.id && ne.push(Bt);
2086
- const Ie = ne.length > 0 ? ne : zt.handles || [
2074
+ }, K = (q) => {
2075
+ var mt, Lt, zt, dt;
2076
+ const G = s.cameraRef.current, ot = (q.clientX - X.left - G.x) / G.zoom, lt = (q.clientY - X.top - G.y) / G.zoom, ut = 20 / G.zoom;
2077
+ let st = null, It = null;
2078
+ const it = (mt = s.handleRegistryRef) == null ? void 0 : mt.current;
2079
+ for (const ht of s.nodesRef.current) {
2080
+ if (ht.hidden) continue;
2081
+ const Rt = ht.width || On, Nt = ht.height || Qn, gt = ht._absolutePosition || ht.position, ne = [];
2082
+ if (it)
2083
+ for (const [, Bt] of it)
2084
+ Bt.nodeId === ht.id && ne.push(Bt);
2085
+ const Ie = ne.length > 0 ? ne : ht.handles || [
2087
2086
  { type: "target", position: "left" },
2088
2087
  { type: "source", position: "right" }
2089
2088
  ];
2090
2089
  for (const Bt of Ie) {
2091
2090
  let Ot, Yt;
2092
2091
  if (Bt.x !== void 0 && Bt.y !== void 0)
2093
- Ot = wt.x + Bt.x, Yt = wt.y + Bt.y;
2092
+ Ot = gt.x + Bt.x, Yt = gt.y + Bt.y;
2094
2093
  else
2095
2094
  switch (Bt.position || (Bt.type === "source" ? "right" : "left")) {
2096
2095
  case "top":
2097
- Ot = wt.x + Rt / 2, Yt = wt.y;
2096
+ Ot = gt.x + Rt / 2, Yt = gt.y;
2098
2097
  break;
2099
2098
  case "bottom":
2100
- Ot = wt.x + Rt / 2, Yt = wt.y + Lt;
2099
+ Ot = gt.x + Rt / 2, Yt = gt.y + Nt;
2101
2100
  break;
2102
2101
  case "left":
2103
- Ot = wt.x, Yt = wt.y + Lt / 2;
2102
+ Ot = gt.x, Yt = gt.y + Nt / 2;
2104
2103
  break;
2105
2104
  default:
2106
- Ot = wt.x + Rt, Yt = wt.y + Lt / 2;
2105
+ Ot = gt.x + Rt, Yt = gt.y + Nt / 2;
2107
2106
  break;
2108
2107
  }
2109
- if (Math.abs(it - Ot) < ot && Math.abs(dt - Yt) < ot) {
2110
- ft = zt, It = Bt.id || null;
2108
+ if (Math.abs(ot - Ot) < ut && Math.abs(lt - Yt) < ut) {
2109
+ st = ht, It = Bt.id || null;
2111
2110
  break;
2112
2111
  }
2113
2112
  }
2114
- if (ft) break;
2113
+ if (st) break;
2115
2114
  }
2116
- if (ft) {
2117
- const zt = v === "source" ? { source: ft.id, target: q, sourceHandle: It, targetHandle: t.targetHandle } : { source: q, target: ft.id, sourceHandle: t.sourceHandle, targetHandle: It };
2118
- (gt = (Nt = s.onEdgesChangeRef).current) == null || gt.call(Nt, [
2115
+ if (st) {
2116
+ const ht = v === "source" ? { source: st.id, target: j, sourceHandle: It, targetHandle: t.targetHandle } : { source: j, target: st.id, sourceHandle: t.sourceHandle, targetHandle: It };
2117
+ (zt = (Lt = s.onEdgesChangeRef).current) == null || zt.call(Lt, [
2119
2118
  { id: t.id, type: "remove" },
2120
- { type: "add", item: { id: t.id, ...zt } }
2119
+ { type: "add", item: { id: t.id, ...ht } }
2121
2120
  ]);
2122
2121
  }
2123
- (ct = s.workerRef.current) == null || ct.postMessage({ type: "connecting", data: null }), R.removeEventListener("pointermove", K), R.removeEventListener("pointerup", at);
2122
+ (dt = s.workerRef.current) == null || dt.postMessage({ type: "connecting", data: null }), k.removeEventListener("pointermove", xt), k.removeEventListener("pointerup", K);
2124
2123
  };
2125
- R.addEventListener("pointermove", K), R.addEventListener("pointerup", at);
2126
- }, [t, s]), u = n.find((v) => v.id === t.source), l = n.find((v) => v.id === t.target), y = u && !!(u.width || (g = u.measured) != null && g.width), m = l && !!(l.width || (f = l.measured) != null && f.width), C = (p = s.handleRegistryRef) == null ? void 0 : p.current, z = y ? Bn(u, "source", t.sourceHandle, C) : null, M = m ? Bn(l, "target", t.targetHandle, C) : null, $ = t.type === "bezier" || t.type === "simplebezier" || t.type === "default", k = s.routedEdges || s.edges, E = k == null ? void 0 : k.find((v) => v.id === t.id), _ = $ ? null : (E == null ? void 0 : E._routedPoints) || t._routedPoints || null, D = r !== !1 && t.reconnectable !== !1;
2124
+ k.addEventListener("pointermove", xt), k.addEventListener("pointerup", K);
2125
+ }, [t, s]), u = n.find((v) => v.id === t.source), l = n.find((v) => v.id === t.target), y = u && !!(u.width || (g = u.measured) != null && g.width), m = l && !!(l.width || (f = l.measured) != null && f.width), C = (p = s.handleRegistryRef) == null ? void 0 : p.current, z = y ? Bn(u, "source", t.sourceHandle, C) : null, M = m ? Bn(l, "target", t.targetHandle, C) : null, $ = t.type === "bezier" || t.type === "simplebezier" || t.type === "default", R = s.routedEdges || s.edges, E = R == null ? void 0 : R.find((v) => v.id === t.id), _ = $ ? null : (E == null ? void 0 : E._routedPoints) || t._routedPoints || null, D = r !== !1 && t.reconnectable !== !1;
2127
2126
  return !z || !M ? null : /* @__PURE__ */ $t(
2128
2127
  "g",
2129
2128
  {
@@ -2157,7 +2156,7 @@ function Br({ edge: t, edgeType: e, nodes: n, reconnectable: r }) {
2157
2156
  routedPoints: _
2158
2157
  }
2159
2158
  ),
2160
- D && (o || t.selected) && /* @__PURE__ */ $t(Le, { children: [
2159
+ D && (o || t.selected) && /* @__PURE__ */ $t(Ne, { children: [
2161
2160
  /* @__PURE__ */ S(
2162
2161
  Dn,
2163
2162
  {
@@ -2187,9 +2186,9 @@ const Dr = Zt(Br);
2187
2186
  function Kn({ selectionKeyCode: t = "Shift", selectionMode: e = "partial" }) {
2188
2187
  var $;
2189
2188
  const n = yt(), [r, s] = Gt(null), o = tt(null);
2190
- if (ht(() => {
2191
- const k = n.wrapRef.current;
2192
- if (!k) return;
2189
+ if (ft(() => {
2190
+ const R = n.wrapRef.current;
2191
+ if (!R) return;
2193
2192
  let E = !1, _ = null, D = !1;
2194
2193
  const g = (w) => {
2195
2194
  w.key === t && (D = !0);
@@ -2200,31 +2199,31 @@ function Kn({ selectionKeyCode: t = "Shift", selectionMode: e = "partial" }) {
2200
2199
  const P = w.target;
2201
2200
  if (P.closest(".ric-node-wrapper") || P.closest(".ric-handle")) return;
2202
2201
  E = !0;
2203
- const R = n.cameraRef.current, B = k.getBoundingClientRect(), q = (w.clientX - B.left - R.x) / R.zoom, X = (w.clientY - B.top - R.y) / R.zoom;
2204
- _ = { x: q, y: X }, s({ startX: q, startY: X, endX: q, endY: X }), w.stopPropagation();
2202
+ const k = n.cameraRef.current, B = R.getBoundingClientRect(), j = (w.clientX - B.left - k.x) / k.zoom, X = (w.clientY - B.top - k.y) / k.zoom;
2203
+ _ = { x: j, y: X }, s({ startX: j, startY: X, endX: j, endY: X }), w.stopPropagation();
2205
2204
  }, v = (w) => {
2206
2205
  if (!E || !_) return;
2207
- const P = n.cameraRef.current, R = k.getBoundingClientRect(), B = (w.clientX - R.left - P.x) / P.zoom, q = (w.clientY - R.top - P.y) / P.zoom;
2208
- s({ startX: _.x, startY: _.y, endX: B, endY: q });
2209
- }, N = (w) => {
2210
- var at, rt;
2206
+ const P = n.cameraRef.current, k = R.getBoundingClientRect(), B = (w.clientX - k.left - P.x) / P.zoom, j = (w.clientY - k.top - P.y) / P.zoom;
2207
+ s({ startX: _.x, startY: _.y, endX: B, endY: j });
2208
+ }, L = (w) => {
2209
+ var K, rt;
2211
2210
  if (!E || !_) return;
2212
2211
  E = !1;
2213
- const P = n.cameraRef.current, R = k.getBoundingClientRect(), B = (w.clientX - R.left - P.x) / P.zoom, q = (w.clientY - R.top - P.y) / P.zoom, X = {
2212
+ const P = n.cameraRef.current, k = R.getBoundingClientRect(), B = (w.clientX - k.left - P.x) / P.zoom, j = (w.clientY - k.top - P.y) / P.zoom, X = {
2214
2213
  x: Math.min(_.x, B),
2215
- y: Math.min(_.y, q),
2214
+ y: Math.min(_.y, j),
2216
2215
  width: Math.abs(B - _.x),
2217
- height: Math.abs(q - _.y)
2218
- }, K = [];
2219
- for (const G of n.nodesRef.current) {
2220
- const j = G._absolutePosition || G.position, it = G.width || 160, dt = G.height || 60;
2221
- let ot;
2222
- e === "full" ? ot = j.x >= X.x && j.y >= X.y && j.x + it <= X.x + X.width && j.y + dt <= X.y + X.height : ot = j.x + it > X.x && j.x < X.x + X.width && j.y + dt > X.y && j.y < X.y + X.height, K.push({ id: G.id, type: "select", selected: ot });
2216
+ height: Math.abs(j - _.y)
2217
+ }, xt = [];
2218
+ for (const q of n.nodesRef.current) {
2219
+ const G = q._absolutePosition || q.position, ot = q.width || 160, lt = q.height || 60;
2220
+ let ut;
2221
+ e === "full" ? ut = G.x >= X.x && G.y >= X.y && G.x + ot <= X.x + X.width && G.y + lt <= X.y + X.height : ut = G.x + ot > X.x && G.x < X.x + X.width && G.y + lt > X.y && G.y < X.y + X.height, xt.push({ id: q.id, type: "select", selected: ut });
2223
2222
  }
2224
- K.length && ((rt = (at = n.onNodesChangeRef).current) == null || rt.call(at, K)), _ = null, s(null);
2223
+ xt.length && ((rt = (K = n.onNodesChangeRef).current) == null || rt.call(K, xt)), _ = null, s(null);
2225
2224
  };
2226
- return k.addEventListener("pointerdown", p, !0), k.addEventListener("pointermove", v), k.addEventListener("pointerup", N), window.addEventListener("keydown", g), window.addEventListener("keyup", f), () => {
2227
- k.removeEventListener("pointerdown", p, !0), k.removeEventListener("pointermove", v), k.removeEventListener("pointerup", N), window.removeEventListener("keydown", g), window.removeEventListener("keyup", f);
2225
+ return R.addEventListener("pointerdown", p, !0), R.addEventListener("pointermove", v), R.addEventListener("pointerup", L), window.addEventListener("keydown", g), window.addEventListener("keyup", f), () => {
2226
+ R.removeEventListener("pointerdown", p, !0), R.removeEventListener("pointermove", v), R.removeEventListener("pointerup", L), window.removeEventListener("keydown", g), window.removeEventListener("keyup", f);
2228
2227
  };
2229
2228
  }, [n, t, e]), !r) return null;
2230
2229
  const i = (($ = n.cameraRef) == null ? void 0 : $.current) || { x: 0, y: 0, zoom: 1 }, c = Math.min(r.startX, r.endX), u = Math.min(r.startY, r.endY), l = Math.abs(r.endX - r.startX), y = Math.abs(r.endY - r.startY), m = c * i.zoom + i.x, C = u * i.zoom + i.y, z = l * i.zoom, M = y * i.zoom;
@@ -2294,20 +2293,20 @@ function on({
2294
2293
  const m = qe(je), C = yt(), z = tt(null), M = tt(C);
2295
2294
  M.current = C;
2296
2295
  const $ = F(() => {
2297
- var w, P, R;
2296
+ var w, P, k;
2298
2297
  const D = z.current;
2299
2298
  if (!D || !m) return;
2300
2299
  const g = M.current, f = (w = g.handleRegistryRef) == null ? void 0 : w.current;
2301
2300
  if (!f) return;
2302
- const p = `${m}__${n || t}`, v = (R = (P = g.cameraRef) == null ? void 0 : P.current) == null ? void 0 : R.zoom, N = Hr(D, v);
2303
- if (N) {
2304
- const B = { nodeId: m, id: n || null, type: t, position: e, x: N.x, y: N.y };
2301
+ const p = `${m}__${n || t}`, v = (k = (P = g.cameraRef) == null ? void 0 : P.current) == null ? void 0 : k.zoom, L = Hr(D, v);
2302
+ if (L) {
2303
+ const B = { nodeId: m, id: n || null, type: t, position: e, x: L.x, y: L.y };
2305
2304
  f.set(p, B);
2306
2305
  }
2307
2306
  }, [m, n, t, e]);
2308
2307
  kr(() => {
2309
2308
  $();
2310
- }, [$]), ht(() => {
2309
+ }, [$]), ft(() => {
2311
2310
  if (!m) return;
2312
2311
  const D = M.current;
2313
2312
  An(D, m);
@@ -2317,17 +2316,17 @@ function on({
2317
2316
  return f && p.observe(f), () => {
2318
2317
  var P;
2319
2318
  p.disconnect();
2320
- const v = M.current, N = (P = v.handleRegistryRef) == null ? void 0 : P.current, w = `${m}__${n || t}`;
2321
- N == null || N.delete(w), Jn(v, m);
2319
+ const v = M.current, L = (P = v.handleRegistryRef) == null ? void 0 : P.current, w = `${m}__${n || t}`;
2320
+ L == null || L.delete(w), Jn(v, m);
2322
2321
  };
2323
2322
  }, [m, n, t, e, $]);
2324
- const k = F(() => {
2325
- var R;
2323
+ const R = F(() => {
2324
+ var k;
2326
2325
  const D = M.current, g = D.nodesRef.current.find((B) => B.id === m);
2327
2326
  if (!g) return null;
2328
- const f = g._absolutePosition || g.position, p = (R = D.handleRegistryRef) == null ? void 0 : R.current, v = `${m}__${n || t}`, N = p == null ? void 0 : p.get(v);
2329
- if (N && N.x !== void 0 && N.y !== void 0)
2330
- return { x: f.x + N.x, y: f.y + N.y };
2327
+ const f = g._absolutePosition || g.position, p = (k = D.handleRegistryRef) == null ? void 0 : k.current, v = `${m}__${n || t}`, L = p == null ? void 0 : p.get(v);
2328
+ if (L && L.x !== void 0 && L.y !== void 0)
2329
+ return { x: f.x + L.x, y: f.y + L.y };
2331
2330
  const w = g.width || 160, P = g.height || 60;
2332
2331
  switch (e) {
2333
2332
  case "top":
@@ -2340,79 +2339,79 @@ function on({
2340
2339
  return { x: f.x + w, y: f.y + P / 2 };
2341
2340
  }
2342
2341
  }, [m, n, t, e]), E = F((D) => {
2343
- var q;
2342
+ var j;
2344
2343
  if (!r || !s) return;
2345
2344
  D.stopPropagation(), D.preventDefault();
2346
2345
  const g = M.current, f = g.cameraRef.current, p = g.wrapRef.current;
2347
2346
  if (!p) return;
2348
- const v = p.getBoundingClientRect(), N = k();
2349
- if (!N) return;
2350
- const w = N.x, P = N.y;
2351
- (q = g.workerRef.current) == null || q.postMessage({
2347
+ const v = p.getBoundingClientRect(), L = R();
2348
+ if (!L) return;
2349
+ const w = L.x, P = L.y;
2350
+ (j = g.workerRef.current) == null || j.postMessage({
2352
2351
  type: "connecting",
2353
2352
  data: { from: { x: w, y: P }, to: { x: w, y: P } }
2354
2353
  }), p.setPointerCapture(D.pointerId);
2355
- const R = (X) => {
2354
+ const k = (X) => {
2356
2355
  var rt;
2357
- const K = (X.clientX - v.left - f.x) / f.zoom, at = (X.clientY - v.top - f.y) / f.zoom;
2356
+ const xt = (X.clientX - v.left - f.x) / f.zoom, K = (X.clientY - v.top - f.y) / f.zoom;
2358
2357
  (rt = g.workerRef.current) == null || rt.postMessage({
2359
2358
  type: "connecting",
2360
- data: { from: { x: w, y: P }, to: { x: K, y: at } }
2359
+ data: { from: { x: w, y: P }, to: { x: xt, y: K } }
2361
2360
  });
2362
2361
  }, B = (X) => {
2363
- var dt, ot, ft, It;
2364
- const K = (X.clientX - v.left - f.x) / f.zoom, at = (X.clientY - v.top - f.y) / f.zoom, rt = 20 / f.zoom;
2365
- let G = null, j = null;
2366
- const it = (dt = g.handleRegistryRef) == null ? void 0 : dt.current;
2367
- for (const st of g.nodesRef.current) {
2368
- if (st.id === m || st.hidden) continue;
2369
- const xt = st.width || 160, Nt = st.height || 60, gt = st._absolutePosition || st.position, ct = [];
2370
- if (it)
2371
- for (const [, Rt] of it)
2372
- Rt.nodeId === st.id && ct.push(Rt);
2373
- const zt = ct.length > 0 ? ct : st.handles || [
2362
+ var lt, ut, st, It;
2363
+ const xt = (X.clientX - v.left - f.x) / f.zoom, K = (X.clientY - v.top - f.y) / f.zoom, rt = 20 / f.zoom;
2364
+ let q = null, G = null;
2365
+ const ot = (lt = g.handleRegistryRef) == null ? void 0 : lt.current;
2366
+ for (const it of g.nodesRef.current) {
2367
+ if (it.id === m || it.hidden) continue;
2368
+ const mt = it.width || 160, Lt = it.height || 60, zt = it._absolutePosition || it.position, dt = [];
2369
+ if (ot)
2370
+ for (const [, Rt] of ot)
2371
+ Rt.nodeId === it.id && dt.push(Rt);
2372
+ const ht = dt.length > 0 ? dt : it.handles || [
2374
2373
  { type: "target", position: "left" },
2375
2374
  { type: "source", position: "right" }
2376
2375
  ];
2377
- for (const Rt of zt) {
2378
- let Lt, wt;
2376
+ for (const Rt of ht) {
2377
+ let Nt, gt;
2379
2378
  if (Rt.x !== void 0 && Rt.y !== void 0)
2380
- Lt = gt.x + Rt.x, wt = gt.y + Rt.y;
2379
+ Nt = zt.x + Rt.x, gt = zt.y + Rt.y;
2381
2380
  else
2382
2381
  switch (Rt.position || (Rt.type === "source" ? "right" : "left")) {
2383
2382
  case "top":
2384
- Lt = gt.x + xt / 2, wt = gt.y;
2383
+ Nt = zt.x + mt / 2, gt = zt.y;
2385
2384
  break;
2386
2385
  case "bottom":
2387
- Lt = gt.x + xt / 2, wt = gt.y + Nt;
2386
+ Nt = zt.x + mt / 2, gt = zt.y + Lt;
2388
2387
  break;
2389
2388
  case "left":
2390
- Lt = gt.x, wt = gt.y + Nt / 2;
2389
+ Nt = zt.x, gt = zt.y + Lt / 2;
2391
2390
  break;
2392
2391
  default:
2393
- Lt = gt.x + xt, wt = gt.y + Nt / 2;
2392
+ Nt = zt.x + mt, gt = zt.y + Lt / 2;
2394
2393
  break;
2395
2394
  }
2396
- if (Math.abs(K - Lt) < rt && Math.abs(at - wt) < rt) {
2397
- G = st, j = Rt.id || null;
2395
+ if (Math.abs(xt - Nt) < rt && Math.abs(K - gt) < rt) {
2396
+ q = it, G = Rt.id || null;
2398
2397
  break;
2399
2398
  }
2400
2399
  }
2401
- if (G) break;
2400
+ if (q) break;
2402
2401
  }
2403
- if (G) {
2404
- const st = {
2405
- source: t === "source" ? m : G.id,
2406
- target: t === "source" ? G.id : m,
2407
- sourceHandle: t === "source" ? n || null : j,
2408
- targetHandle: t === "source" ? j : n || null
2402
+ if (q) {
2403
+ const it = {
2404
+ source: t === "source" ? m : q.id,
2405
+ target: t === "source" ? q.id : m,
2406
+ sourceHandle: t === "source" ? n || null : G,
2407
+ targetHandle: t === "source" ? G : n || null
2409
2408
  };
2410
- (ft = (ot = g.onEdgesChangeRef) == null ? void 0 : ot.current) == null || ft.call(ot, [{ type: "add", item: { id: `e-${st.source}-${st.target}`, ...st } }]);
2409
+ (st = (ut = g.onEdgesChangeRef) == null ? void 0 : ut.current) == null || st.call(ut, [{ type: "add", item: { id: `e-${it.source}-${it.target}`, ...it } }]);
2411
2410
  }
2412
- (It = g.workerRef.current) == null || It.postMessage({ type: "connecting", data: null }), p.removeEventListener("pointermove", R), p.removeEventListener("pointerup", B);
2411
+ (It = g.workerRef.current) == null || It.postMessage({ type: "connecting", data: null }), p.removeEventListener("pointermove", k), p.removeEventListener("pointerup", B);
2413
2412
  };
2414
- p.addEventListener("pointermove", R), p.addEventListener("pointerup", B);
2415
- }, [m, n, t, e, r, s, k]), _ = {
2413
+ p.addEventListener("pointermove", k), p.addEventListener("pointerup", B);
2414
+ }, [m, n, t, e, r, s, R]), _ = {
2416
2415
  top: { top: 0, left: "50%", transform: "translate(-50%, -50%)" },
2417
2416
  bottom: { bottom: 0, left: "50%", transform: "translate(-50%, 50%)" },
2418
2417
  left: { top: "50%", left: 0, transform: "translate(-50%, -50%)" },
@@ -2578,7 +2577,7 @@ function Vn({
2578
2577
  ...y
2579
2578
  }) {
2580
2579
  const [m, C] = Gt({ x: 1, y: 0, width: 0, height: 0 }), z = tt(null);
2581
- return ht(() => {
2580
+ return ft(() => {
2582
2581
  if (z.current) {
2583
2582
  const M = z.current.getBBox();
2584
2583
  C({
@@ -2648,7 +2647,7 @@ function un({
2648
2647
  className: M = "",
2649
2648
  ...$
2650
2649
  }) {
2651
- return /* @__PURE__ */ $t(Le, { children: [
2650
+ return /* @__PURE__ */ $t(Ne, { children: [
2652
2651
  /* @__PURE__ */ S(
2653
2652
  "path",
2654
2653
  {
@@ -2721,43 +2720,43 @@ const tr = Zt(function({
2721
2720
  labelBgBorderRadius: z,
2722
2721
  style: M,
2723
2722
  markerEnd: $,
2724
- markerStart: k,
2723
+ markerStart: R,
2725
2724
  interactionWidth: E
2726
2725
  }) {
2727
2726
  let _, D, g;
2728
- const f = _n(n, r, i), p = _n(s, o, c), v = Math.abs(p.x - f.x), N = Math.max(50, v * 0.5);
2729
- let w, P, R, B;
2727
+ const f = _n(n, r, i), p = _n(s, o, c), v = Math.abs(p.x - f.x), L = Math.max(50, v * 0.5);
2728
+ let w, P, k, B;
2730
2729
  switch (i) {
2731
2730
  case "left":
2732
- w = f.x - N, P = f.y;
2731
+ w = f.x - L, P = f.y;
2733
2732
  break;
2734
2733
  case "top":
2735
- w = f.x, P = f.y - N;
2734
+ w = f.x, P = f.y - L;
2736
2735
  break;
2737
2736
  case "bottom":
2738
- w = f.x, P = f.y + N;
2737
+ w = f.x, P = f.y + L;
2739
2738
  break;
2740
2739
  default:
2741
- w = f.x + N, P = f.y;
2740
+ w = f.x + L, P = f.y;
2742
2741
  break;
2743
2742
  }
2744
2743
  switch (c) {
2745
2744
  case "right":
2746
- R = p.x + N, B = p.y;
2745
+ k = p.x + L, B = p.y;
2747
2746
  break;
2748
2747
  case "top":
2749
- R = p.x, B = p.y - N;
2748
+ k = p.x, B = p.y - L;
2750
2749
  break;
2751
2750
  case "bottom":
2752
- R = p.x, B = p.y + N;
2751
+ k = p.x, B = p.y + L;
2753
2752
  break;
2754
2753
  default:
2755
- R = p.x - N, B = p.y;
2754
+ k = p.x - L, B = p.y;
2756
2755
  break;
2757
2756
  }
2758
- _ = `M ${n},${r} L ${f.x},${f.y} C ${w},${P} ${R},${B} ${p.x},${p.y} L ${s},${o}`;
2759
- const q = 0.5, X = 0.5;
2760
- return D = X * X * X * f.x + 3 * X * X * q * w + 3 * X * q * q * R + q * q * q * p.x, g = X * X * X * f.y + 3 * X * X * q * P + 3 * X * q * q * B + q * q * q * p.y, /* @__PURE__ */ S(
2757
+ _ = `M ${n},${r} L ${f.x},${f.y} C ${w},${P} ${k},${B} ${p.x},${p.y} L ${s},${o}`;
2758
+ const j = 0.5, X = 0.5;
2759
+ return D = X * X * X * f.x + 3 * X * X * j * w + 3 * X * j * j * k + j * j * j * p.x, g = X * X * X * f.y + 3 * X * X * j * P + 3 * X * j * j * B + j * j * j * p.y, /* @__PURE__ */ S(
2761
2760
  un,
2762
2761
  {
2763
2762
  id: e,
@@ -2772,7 +2771,7 @@ const tr = Zt(function({
2772
2771
  labelBgBorderRadius: z,
2773
2772
  style: M,
2774
2773
  markerEnd: $,
2775
- markerStart: k,
2774
+ markerStart: R,
2776
2775
  interactionWidth: E
2777
2776
  }
2778
2777
  );
@@ -2821,7 +2820,7 @@ function nr({
2821
2820
  z = n - y, M = r;
2822
2821
  break;
2823
2822
  }
2824
- const $ = `M ${t},${e} C ${m},${C} ${z},${M} ${n},${r}`, k = 0.5, E = 1 - k, _ = E * E * E * t + 3 * E * E * k * m + 3 * E * k * k * z + k * k * k * n, D = E * E * E * e + 3 * E * E * k * C + 3 * E * k * k * M + k * k * k * r;
2823
+ const $ = `M ${t},${e} C ${m},${C} ${z},${M} ${n},${r}`, R = 0.5, E = 1 - R, _ = E * E * E * t + 3 * E * E * R * m + 3 * E * R * R * z + R * R * R * n, D = E * E * E * e + 3 * E * E * R * C + 3 * E * R * R * M + R * R * R * r;
2825
2824
  return [$, _, D, 0, 0];
2826
2825
  }
2827
2826
  function rr({ sourceX: t, sourceY: e, targetX: n, targetY: r }) {
@@ -2911,8 +2910,8 @@ function Yr(t, e, n, r, s, o, i, c) {
2911
2910
  const z = (t + n) / 2, M = (e + r) / 2;
2912
2911
  if (z > s + C && z < s + i - C && M > o + C && M < o + c - C) return !0;
2913
2912
  const $ = [[s, o], [s + i, o], [s + i, o + c], [s, o + c]];
2914
- for (let k = 0; k < 4; k++)
2915
- if (Ur(t, e, n, r, $[k][0], $[k][1], $[(k + 1) % 4][0], $[(k + 1) % 4][1])) return !0;
2913
+ for (let R = 0; R < 4; R++)
2914
+ if (Ur(t, e, n, r, $[R][0], $[R][1], $[(R + 1) % 4][0], $[(R + 1) % 4][1])) return !0;
2916
2915
  return !1;
2917
2916
  }
2918
2917
  function Ur(t, e, n, r, s, o, i, c) {
@@ -2957,44 +2956,44 @@ function sr(t, e, n) {
2957
2956
  r.add(t.x), r.add(e.x), s.add(t.y), s.add(e.y);
2958
2957
  const o = Ue + 5;
2959
2958
  t.dir === "right" ? r.add(t.x + o) : t.dir === "left" ? r.add(t.x - o) : t.dir === "top" ? s.add(t.y - o) : t.dir === "bottom" && s.add(t.y + o), e.dir === "right" ? r.add(e.x + o) : e.dir === "left" ? r.add(e.x - o) : e.dir === "top" ? s.add(e.y - o) : e.dir === "bottom" && s.add(e.y + o);
2960
- for (let R = 0; R < n.length; R++) {
2961
- const B = n[R];
2959
+ for (let k = 0; k < n.length; k++) {
2960
+ const B = n[k];
2962
2961
  r.add(B.x), r.add(B.x + B.w), s.add(B.y), s.add(B.y + B.h);
2963
2962
  }
2964
- const i = [...r].sort((R, B) => R - B), c = [...s].sort((R, B) => R - B), u = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
2965
- for (let R = 0; R < i.length; R++) u.set(i[R], R);
2966
- for (let R = 0; R < c.length; R++) l.set(c[R], R);
2967
- const y = i.length, m = c.length, C = (R, B) => B * y + R, z = u.get(t.x), M = l.get(t.y), $ = u.get(e.x), k = l.get(e.y);
2968
- if (z === void 0 || M === void 0 || $ === void 0 || k === void 0) return null;
2969
- const E = C(z, M), _ = C($, k), D = new Float64Array(y * m).fill(1 / 0), g = new Float64Array(y * m).fill(1 / 0), f = new Int32Array(y * m).fill(-1), p = new Int8Array(y * m).fill(-1), v = new Uint8Array(y * m);
2970
- D[E] = 0, g[E] = Math.abs(i[$] - t.x) + Math.abs(c[k] - t.y);
2971
- const N = [E], w = 15, P = [[1, 0], [-1, 0], [0, 1], [0, -1]];
2972
- for (; N.length > 0; ) {
2973
- let R = 0;
2974
- for (let G = 1; G < N.length; G++)
2975
- g[N[G]] < g[N[R]] && (R = G);
2976
- const B = N[R];
2977
- if (N[R] = N[N.length - 1], N.pop(), B === _) {
2978
- const G = [];
2979
- let j = _;
2980
- for (; j !== -1 && j !== E; ) {
2981
- const it = j / y | 0, dt = j % y;
2982
- G.unshift({ x: i[dt], y: c[it] }), j = f[j];
2963
+ const i = [...r].sort((k, B) => k - B), c = [...s].sort((k, B) => k - B), u = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
2964
+ for (let k = 0; k < i.length; k++) u.set(i[k], k);
2965
+ for (let k = 0; k < c.length; k++) l.set(c[k], k);
2966
+ const y = i.length, m = c.length, C = (k, B) => B * y + k, z = u.get(t.x), M = l.get(t.y), $ = u.get(e.x), R = l.get(e.y);
2967
+ if (z === void 0 || M === void 0 || $ === void 0 || R === void 0) return null;
2968
+ const E = C(z, M), _ = C($, R), D = new Float64Array(y * m).fill(1 / 0), g = new Float64Array(y * m).fill(1 / 0), f = new Int32Array(y * m).fill(-1), p = new Int8Array(y * m).fill(-1), v = new Uint8Array(y * m);
2969
+ D[E] = 0, g[E] = Math.abs(i[$] - t.x) + Math.abs(c[R] - t.y);
2970
+ const L = [E], w = 15, P = [[1, 0], [-1, 0], [0, 1], [0, -1]];
2971
+ for (; L.length > 0; ) {
2972
+ let k = 0;
2973
+ for (let q = 1; q < L.length; q++)
2974
+ g[L[q]] < g[L[k]] && (k = q);
2975
+ const B = L[k];
2976
+ if (L[k] = L[L.length - 1], L.pop(), B === _) {
2977
+ const q = [];
2978
+ let G = _;
2979
+ for (; G !== -1 && G !== E; ) {
2980
+ const ot = G / y | 0, lt = G % y;
2981
+ q.unshift({ x: i[lt], y: c[ot] }), G = f[G];
2983
2982
  }
2984
- return G.unshift({ x: t.x, y: t.y }), jr(G, n);
2983
+ return q.unshift({ x: t.x, y: t.y }), jr(q, n);
2985
2984
  }
2986
2985
  if (v[B]) continue;
2987
2986
  v[B] = 1;
2988
- const q = B / y | 0, X = B % y, K = i[X], at = c[q], rt = p[B];
2989
- for (let G = 0; G < 4; G++) {
2990
- const j = X + P[G][0], it = q + P[G][1];
2991
- if (j < 0 || j >= y || it < 0 || it >= m) continue;
2992
- const dt = C(j, it);
2993
- if (v[dt]) continue;
2994
- const ot = i[j], ft = c[it];
2995
- if (qr(ot, ft, n) || !zn(K, at, ot, ft, n)) continue;
2996
- const It = Math.abs(ot - K) + Math.abs(ft - at), st = rt >= 0 && rt !== G ? w : 0, xt = D[B] + It + st;
2997
- xt < D[dt] && (f[dt] = B, p[dt] = G, D[dt] = xt, g[dt] = xt + Math.abs(i[$] - ot) + Math.abs(c[k] - ft), N.push(dt));
2987
+ const j = B / y | 0, X = B % y, xt = i[X], K = c[j], rt = p[B];
2988
+ for (let q = 0; q < 4; q++) {
2989
+ const G = X + P[q][0], ot = j + P[q][1];
2990
+ if (G < 0 || G >= y || ot < 0 || ot >= m) continue;
2991
+ const lt = C(G, ot);
2992
+ if (v[lt]) continue;
2993
+ const ut = i[G], st = c[ot];
2994
+ if (qr(ut, st, n) || !zn(xt, K, ut, st, n)) continue;
2995
+ const It = Math.abs(ut - xt) + Math.abs(st - K), it = rt >= 0 && rt !== q ? w : 0, mt = D[B] + It + it;
2996
+ mt < D[lt] && (f[lt] = B, p[lt] = q, D[lt] = mt, g[lt] = mt + Math.abs(i[$] - ut) + Math.abs(c[R] - st), L.push(lt));
2998
2997
  }
2999
2998
  }
3000
2999
  return null;
@@ -3074,8 +3073,8 @@ function En(t, e = 6, n = !1) {
3074
3073
  for (let o = 1; o < t.length - 1; o++) {
3075
3074
  const i = t[o - 1], c = t[o], u = t[o + 1], l = Math.abs(c.x - i.x) + Math.abs(c.y - i.y), y = Math.abs(u.x - c.x) + Math.abs(u.y - c.y), m = Math.min(r, l / 2, y / 2);
3076
3075
  if (m > 0.5) {
3077
- const C = c.x - i.x, z = c.y - i.y, M = u.x - c.x, $ = u.y - c.y, k = Math.sqrt(C * C + z * z) || 1, E = Math.sqrt(M * M + $ * $) || 1;
3078
- s += ` L ${c.x - C / k * m},${c.y - z / k * m}`, s += ` Q ${c.x},${c.y} ${c.x + M / E * m},${c.y + $ / E * m}`;
3076
+ const C = c.x - i.x, z = c.y - i.y, M = u.x - c.x, $ = u.y - c.y, R = Math.sqrt(C * C + z * z) || 1, E = Math.sqrt(M * M + $ * $) || 1;
3077
+ s += ` L ${c.x - C / R * m},${c.y - z / R * m}`, s += ` Q ${c.x},${c.y} ${c.x + M / E * m},${c.y + $ / E * m}`;
3079
3078
  } else
3080
3079
  s += ` L ${c.x},${c.y}`;
3081
3080
  }
@@ -3113,26 +3112,26 @@ function Cn(t) {
3113
3112
  }
3114
3113
  return { x: t[0].x, y: t[0].y };
3115
3114
  }
3116
- function No(t, e) {
3115
+ function Lo(t, e) {
3117
3116
  if (!t || !e || t.length === 0 || e.length === 0) return e;
3118
3117
  const n = {};
3119
3118
  for (const o of t) n[o.id] = o;
3120
3119
  const r = or(t, null), s = e.map((o) => {
3121
- var p, v, N, w;
3120
+ var p, v, L, w;
3122
3121
  const i = o.type || "default";
3123
3122
  if (i === "bezier" || i === "simplebezier" || i === "default") return o;
3124
3123
  const c = n[o.source], u = n[o.target];
3125
3124
  if (!c || !u || c.hidden || u.hidden) return o;
3126
- const l = Wn(c, "source", o.sourceHandle), y = Wn(u, "target", o.targetHandle), m = ln(l, cn), C = ln(y, cn), z = 5, M = r.filter((P) => P.id !== o.source && P.id !== o.target), $ = c._absolutePosition || c.position, k = c.width || ((p = c.measured) == null ? void 0 : p.width) || sn, E = c.height || ((v = c.measured) == null ? void 0 : v.height) || an;
3127
- M.push({ id: o.source, x: $.x - z, y: $.y - z, w: k + 2 * z, h: E + 2 * z });
3128
- const _ = u._absolutePosition || u.position, D = u.width || ((N = u.measured) == null ? void 0 : N.width) || sn, g = u.height || ((w = u.measured) == null ? void 0 : w.height) || an;
3125
+ const l = Wn(c, "source", o.sourceHandle), y = Wn(u, "target", o.targetHandle), m = ln(l, cn), C = ln(y, cn), z = 5, M = r.filter((P) => P.id !== o.source && P.id !== o.target), $ = c._absolutePosition || c.position, R = c.width || ((p = c.measured) == null ? void 0 : p.width) || sn, E = c.height || ((v = c.measured) == null ? void 0 : v.height) || an;
3126
+ M.push({ id: o.source, x: $.x - z, y: $.y - z, w: R + 2 * z, h: E + 2 * z });
3127
+ const _ = u._absolutePosition || u.position, D = u.width || ((L = u.measured) == null ? void 0 : L.width) || sn, g = u.height || ((w = u.measured) == null ? void 0 : w.height) || an;
3129
3128
  if (M.push({ id: o.target, x: _.x - z, y: _.y - z, w: D + 2 * z, h: g + 2 * z }), M.length === 0) return o;
3130
3129
  const f = sr(m, C, M);
3131
3130
  return f && f.length >= 2 ? (f.unshift({ x: l.x, y: l.y }), f.push({ x: y.x, y: y.y }), { ...o, _routedPoints: f }) : o;
3132
3131
  });
3133
3132
  return Gr(s);
3134
3133
  }
3135
- function Lo(t, e, n, r, s, o, i, c) {
3134
+ function No(t, e, n, r, s, o, i, c) {
3136
3135
  const u = or(i, c ? new Set(c) : null);
3137
3136
  if (u.length === 0) return null;
3138
3137
  const l = { x: t, y: e, dir: s || "right" }, y = { x: n, y: r, dir: o || "left" }, m = ln(l, cn), C = ln(y, cn), z = sr(m, C, u);
@@ -3154,12 +3153,12 @@ const ir = Zt(function({
3154
3153
  markerEnd: z,
3155
3154
  markerStart: M,
3156
3155
  interactionWidth: $,
3157
- routedPoints: k
3156
+ routedPoints: R
3158
3157
  }) {
3159
3158
  let E, _, D;
3160
- if (k && k.length >= 2) {
3161
- E = En(k);
3162
- const g = Cn(k);
3159
+ if (R && R.length >= 2) {
3160
+ E = En(R);
3161
+ const g = Cn(R);
3163
3162
  _ = g.x, D = g.y;
3164
3163
  } else
3165
3164
  [E, _, D] = er({ sourceX: n, sourceY: r, targetX: s, targetY: o });
@@ -3200,7 +3199,7 @@ const ar = Zt(function({
3200
3199
  labelBgBorderRadius: z,
3201
3200
  style: M,
3202
3201
  markerEnd: $,
3203
- markerStart: k,
3202
+ markerStart: R,
3204
3203
  pathOptions: E,
3205
3204
  interactionWidth: _,
3206
3205
  routedPoints: D
@@ -3236,7 +3235,7 @@ const ar = Zt(function({
3236
3235
  labelBgBorderRadius: z,
3237
3236
  style: M,
3238
3237
  markerEnd: $,
3239
- markerStart: k,
3238
+ markerStart: R,
3240
3239
  interactionWidth: _
3241
3240
  }
3242
3241
  );
@@ -3270,7 +3269,7 @@ const cr = Zt(function({
3270
3269
  labelBgBorderRadius: z,
3271
3270
  style: M,
3272
3271
  markerEnd: $,
3273
- markerStart: k,
3272
+ markerStart: R,
3274
3273
  interactionWidth: E,
3275
3274
  routedPoints: _
3276
3275
  }) {
@@ -3301,7 +3300,7 @@ const cr = Zt(function({
3301
3300
  labelBgBorderRadius: z,
3302
3301
  style: M,
3303
3302
  markerEnd: $,
3304
- markerStart: k,
3303
+ markerStart: R,
3305
3304
  interactionWidth: E
3306
3305
  }
3307
3306
  );
@@ -3339,7 +3338,7 @@ function Io({
3339
3338
  fitView: M,
3340
3339
  fitViewOptions: $,
3341
3340
  // Node/Edge callbacks
3342
- onNodesChange: k,
3341
+ onNodesChange: R,
3343
3342
  onEdgesChange: E,
3344
3343
  onConnect: _,
3345
3344
  onConnectStart: D,
@@ -3347,33 +3346,33 @@ function Io({
3347
3346
  onNodeClick: f,
3348
3347
  onNodeDoubleClick: p,
3349
3348
  onNodeMouseEnter: v,
3350
- onNodeMouseMove: N,
3349
+ onNodeMouseMove: L,
3351
3350
  onNodeMouseLeave: w,
3352
3351
  onNodeContextMenu: P,
3353
- onNodeDragStart: R,
3352
+ onNodeDragStart: k,
3354
3353
  onNodeDrag: B,
3355
- onNodeDragStop: q,
3354
+ onNodeDragStop: j,
3356
3355
  onEdgeClick: X,
3357
- onEdgeDoubleClick: K,
3358
- onEdgeMouseEnter: at,
3356
+ onEdgeDoubleClick: xt,
3357
+ onEdgeMouseEnter: K,
3359
3358
  onEdgeMouseMove: rt,
3360
- onEdgeMouseLeave: G,
3361
- onEdgeContextMenu: j,
3362
- onPaneClick: it,
3363
- onPaneContextMenu: dt,
3364
- onPaneMouseEnter: ot,
3365
- onPaneMouseMove: ft,
3359
+ onEdgeMouseLeave: q,
3360
+ onEdgeContextMenu: G,
3361
+ onPaneClick: ot,
3362
+ onPaneContextMenu: lt,
3363
+ onPaneMouseEnter: ut,
3364
+ onPaneMouseMove: st,
3366
3365
  onPaneMouseLeave: It,
3367
- onSelectionChange: st,
3368
- onInit: xt,
3369
- onMoveStart: Nt,
3370
- onMove: gt,
3371
- onMoveEnd: ct,
3372
- onDelete: zt,
3366
+ onSelectionChange: it,
3367
+ onInit: mt,
3368
+ onMoveStart: Lt,
3369
+ onMove: zt,
3370
+ onMoveEnd: dt,
3371
+ onDelete: ht,
3373
3372
  onBeforeDelete: Rt,
3374
- onError: Lt,
3373
+ onError: Nt,
3375
3374
  // Drag and drop
3376
- onDragOver: wt,
3375
+ onDragOver: gt,
3377
3376
  onDrop: ne,
3378
3377
  onDragEnter: Ie,
3379
3378
  onDragLeave: Bt,
@@ -3397,10 +3396,10 @@ function Io({
3397
3396
  panOnScrollMode: dn,
3398
3397
  panOnScrollSpeed: fn,
3399
3398
  zoomOnScroll: Qt,
3400
- zoomOnDoubleClick: Nn,
3399
+ zoomOnDoubleClick: Ln,
3401
3400
  zoomOnPinch: hn,
3402
3401
  preventScrolling: fe,
3403
- translateExtent: mt,
3402
+ translateExtent: vt,
3404
3403
  nodeExtent: Te,
3405
3404
  autoPanOnNodeDrag: Et,
3406
3405
  autoPanOnConnect: pt,
@@ -3426,8 +3425,8 @@ function Io({
3426
3425
  [te]
3427
3426
  ), ae = St(() => ({ ...Qr, ...r }), [r]), Kt = St(() => ({ ...Kr, ...s }), [s]), he = St(() => {
3428
3427
  const Q = e.filter((Ft) => Ft.type && ae[Ft.type]);
3429
- return Q.sort((Ft, lt) => {
3430
- const Tt = Ft.type === "group" || !Ft.parentId && Q.some((Ee) => Ee.parentId === Ft.id), xe = lt.type === "group" || !lt.parentId && Q.some((Ee) => Ee.parentId === lt.id);
3428
+ return Q.sort((Ft, at) => {
3429
+ const Tt = Ft.type === "group" || !Ft.parentId && Q.some((Ee) => Ee.parentId === Ft.id), xe = at.type === "group" || !at.parentId && Q.some((Ee) => Ee.parentId === at.id);
3431
3430
  return Tt && !xe ? -1 : !Tt && xe ? 1 : 0;
3432
3431
  });
3433
3432
  }, [e, ae]), ke = St(() => n.filter((Q) => Q.type && Kt[Q.type]), [n, Kt]), O = St(() => e.map((Q) => Q.type && ae[Q.type] ? { ...Q, _customRendered: !0 } : Q), [e, ae]), bt = St(() => n.map((Q) => Q.type && Kt[Q.type] ? { ...Q, _customRendered: !0 } : Q), [n, Kt]), {
@@ -3438,7 +3437,7 @@ function Io({
3438
3437
  onPointerMove: He,
3439
3438
  onPointerUp: _e,
3440
3439
  store: le
3441
- } = Lr({
3440
+ } = Nr({
3442
3441
  cards: t,
3443
3442
  nodes: O,
3444
3443
  edges: bt,
@@ -3451,7 +3450,7 @@ function Io({
3451
3450
  fitViewOptions: $,
3452
3451
  onHudUpdate: Ve,
3453
3452
  onNodesProcessed: gn,
3454
- onNodesChange: k,
3453
+ onNodesChange: R,
3455
3454
  onEdgesChange: E,
3456
3455
  onConnect: _,
3457
3456
  onConnectStart: D,
@@ -3459,31 +3458,31 @@ function Io({
3459
3458
  onNodeClick: f,
3460
3459
  onNodeDoubleClick: p,
3461
3460
  onNodeMouseEnter: v,
3462
- onNodeMouseMove: N,
3461
+ onNodeMouseMove: L,
3463
3462
  onNodeMouseLeave: w,
3464
3463
  onNodeContextMenu: P,
3465
- onNodeDragStart: R,
3464
+ onNodeDragStart: k,
3466
3465
  onNodeDrag: B,
3467
- onNodeDragStop: q,
3466
+ onNodeDragStop: j,
3468
3467
  onEdgeClick: X,
3469
- onEdgeDoubleClick: K,
3470
- onEdgeMouseEnter: at,
3468
+ onEdgeDoubleClick: xt,
3469
+ onEdgeMouseEnter: K,
3471
3470
  onEdgeMouseMove: rt,
3472
- onEdgeMouseLeave: G,
3473
- onEdgeContextMenu: j,
3474
- onPaneClick: it,
3475
- onPaneContextMenu: dt,
3476
- onPaneMouseEnter: ot,
3477
- onPaneMouseMove: ft,
3471
+ onEdgeMouseLeave: q,
3472
+ onEdgeContextMenu: G,
3473
+ onPaneClick: ot,
3474
+ onPaneContextMenu: lt,
3475
+ onPaneMouseEnter: ut,
3476
+ onPaneMouseMove: st,
3478
3477
  onPaneMouseLeave: It,
3479
- onSelectionChange: st,
3480
- onInit: xt,
3481
- onMoveStart: Nt,
3482
- onMove: gt,
3483
- onMoveEnd: ct,
3484
- onDelete: zt,
3478
+ onSelectionChange: it,
3479
+ onInit: mt,
3480
+ onMoveStart: Lt,
3481
+ onMove: zt,
3482
+ onMoveEnd: dt,
3483
+ onDelete: ht,
3485
3484
  onBeforeDelete: Rt,
3486
- onError: Lt,
3485
+ onError: Nt,
3487
3486
  nodesDraggable: Ot,
3488
3487
  nodesConnectable: Yt,
3489
3488
  elementsSelectable: me,
@@ -3503,10 +3502,10 @@ function Io({
3503
3502
  panOnScrollMode: dn,
3504
3503
  panOnScrollSpeed: fn,
3505
3504
  zoomOnScroll: Qt,
3506
- zoomOnDoubleClick: Nn,
3505
+ zoomOnDoubleClick: Ln,
3507
3506
  zoomOnPinch: hn,
3508
3507
  preventScrolling: fe,
3509
- translateExtent: mt,
3508
+ translateExtent: vt,
3510
3509
  nodeExtent: Te,
3511
3510
  autoPanOnNodeDrag: Et,
3512
3511
  autoPanOnConnect: pt,
@@ -3526,10 +3525,10 @@ function Io({
3526
3525
  return n;
3527
3526
  }
3528
3527
  }), [le, e, n]), ye = tt(null), ge = tt(null), pe = tt(null), Jt = tt(null);
3529
- ht(() => {
3528
+ ft(() => {
3530
3529
  let Q;
3531
3530
  const Ft = () => {
3532
- const lt = le.cameraRef.current, Tt = `translate(${lt.x}px, ${lt.y}px) scale(${lt.zoom})`, xe = `translate(${lt.x}, ${lt.y}) scale(${lt.zoom})`;
3531
+ const at = le.cameraRef.current, Tt = `translate(${at.x}px, ${at.y}px) scale(${at.zoom})`, xe = `translate(${at.x}, ${at.y}) scale(${at.zoom})`;
3533
3532
  ye.current && (ye.current.style.transform = Tt), ge.current && ge.current.setAttribute("transform", xe), pe.current && (pe.current.style.transform = Tt), Jt.current && (Jt.current.style.transform = Tt), Q = requestAnimationFrame(Ft);
3534
3533
  };
3535
3534
  return Q = requestAnimationFrame(Ft), () => cancelAnimationFrame(Q);
@@ -3544,7 +3543,7 @@ function Io({
3544
3543
  onPointerDown: Ae,
3545
3544
  onPointerMove: He,
3546
3545
  onPointerUp: _e,
3547
- onDragOver: wt,
3546
+ onDragOver: gt,
3548
3547
  onDrop: ne,
3549
3548
  onDragEnter: Ie,
3550
3549
  onDragLeave: Bt,
@@ -3649,11 +3648,11 @@ function Io({
3649
3648
  ")   zoom: ",
3650
3649
  Ut.zoom,
3651
3650
  "x",
3652
- Ut.nodeCount > 0 && /* @__PURE__ */ $t(Le, { children: [
3651
+ Ut.nodeCount > 0 && /* @__PURE__ */ $t(Ne, { children: [
3653
3652
  "   nodes: ",
3654
3653
  Ut.nodeCount
3655
3654
  ] }),
3656
- Ut.edgeCount > 0 && /* @__PURE__ */ $t(Le, { children: [
3655
+ Ut.edgeCount > 0 && /* @__PURE__ */ $t(Ne, { children: [
3657
3656
  "   edges: ",
3658
3657
  Ut.edgeCount
3659
3658
  ] })
@@ -3747,7 +3746,7 @@ function So(t) {
3747
3746
  }
3748
3747
  function eo() {
3749
3748
  const t = yt(), e = F(() => [...t.nodesRef.current], [t]), n = F(() => [...t.edgesRef.current], [t]), r = F((g) => t.nodesRef.current.find((f) => f.id === g), [t]), s = F((g) => t.edgesRef.current.find((f) => f.id === g), [t]), o = F((g) => {
3750
- var f, p, v, N;
3749
+ var f, p, v, L;
3751
3750
  if (typeof g == "function") {
3752
3751
  const w = g(t.nodesRef.current);
3753
3752
  (p = (f = t.onNodesChangeRef).current) == null || p.call(f, [
@@ -3755,12 +3754,12 @@ function eo() {
3755
3754
  ...w.map((P) => ({ type: "add", item: P }))
3756
3755
  ]);
3757
3756
  } else
3758
- (N = (v = t.onNodesChangeRef).current) == null || N.call(v, [
3757
+ (L = (v = t.onNodesChangeRef).current) == null || L.call(v, [
3759
3758
  ...t.nodesRef.current.map((w) => ({ id: w.id, type: "remove" })),
3760
3759
  ...g.map((w) => ({ type: "add", item: w }))
3761
3760
  ]);
3762
3761
  }, [t]), i = F((g) => {
3763
- var f, p, v, N;
3762
+ var f, p, v, L;
3764
3763
  if (typeof g == "function") {
3765
3764
  const w = g(t.edgesRef.current);
3766
3765
  (p = (f = t.onEdgesChangeRef).current) == null || p.call(f, [
@@ -3768,18 +3767,18 @@ function eo() {
3768
3767
  ...w.map((P) => ({ type: "add", item: P }))
3769
3768
  ]);
3770
3769
  } else
3771
- (N = (v = t.onEdgesChangeRef).current) == null || N.call(v, [
3770
+ (L = (v = t.onEdgesChangeRef).current) == null || L.call(v, [
3772
3771
  ...t.edgesRef.current.map((w) => ({ id: w.id, type: "remove" })),
3773
3772
  ...g.map((w) => ({ type: "add", item: w }))
3774
3773
  ]);
3775
3774
  }, [t]), c = F((g) => {
3776
3775
  var p, v;
3777
3776
  const f = Array.isArray(g) ? g : [g];
3778
- (v = (p = t.onNodesChangeRef).current) == null || v.call(p, f.map((N) => ({ type: "add", item: N })));
3777
+ (v = (p = t.onNodesChangeRef).current) == null || v.call(p, f.map((L) => ({ type: "add", item: L })));
3779
3778
  }, [t]), u = F((g) => {
3780
3779
  var p, v;
3781
3780
  const f = Array.isArray(g) ? g : [g];
3782
- (v = (p = t.onEdgesChangeRef).current) == null || v.call(p, f.map((N) => ({ type: "add", item: N })));
3781
+ (v = (p = t.onEdgesChangeRef).current) == null || v.call(p, f.map((L) => ({ type: "add", item: L })));
3783
3782
  }, [t]), l = F(({ nodes: g = [], edges: f = [] }) => {
3784
3783
  if (g.length && t.onNodesChangeRef.current) {
3785
3784
  t.onNodesChangeRef.current(g.map((v) => ({ id: v.id, type: "remove" })));
@@ -3799,34 +3798,34 @@ function eo() {
3799
3798
  }, [t]), C = F(() => t.cameraRef.current.zoom, [t]), z = F((g) => {
3800
3799
  const f = t.cameraRef.current, p = t.wrapRef.current;
3801
3800
  if (!p) return;
3802
- const v = p.getBoundingClientRect(), N = v.width / 2, w = v.height / 2, P = 1.2;
3803
- f.x = N - (N - f.x) * P, f.y = w - (w - f.y) * P, f.zoom = Math.min(t.zoomMax, f.zoom * P), t.sendCamera();
3801
+ const v = p.getBoundingClientRect(), L = v.width / 2, w = v.height / 2, P = 1.2;
3802
+ f.x = L - (L - f.x) * P, f.y = w - (w - f.y) * P, f.zoom = Math.min(t.zoomMax, f.zoom * P), t.sendCamera();
3804
3803
  }, [t]), M = F((g) => {
3805
3804
  const f = t.cameraRef.current, p = t.wrapRef.current;
3806
3805
  if (!p) return;
3807
- const v = p.getBoundingClientRect(), N = v.width / 2, w = v.height / 2, P = 1 / 1.2;
3808
- f.x = N - (N - f.x) * P, f.y = w - (w - f.y) * P, f.zoom = Math.max(t.zoomMin, f.zoom * P), t.sendCamera();
3806
+ const v = p.getBoundingClientRect(), L = v.width / 2, w = v.height / 2, P = 1 / 1.2;
3807
+ f.x = L - (L - f.x) * P, f.y = w - (w - f.y) * P, f.zoom = Math.max(t.zoomMin, f.zoom * P), t.sendCamera();
3809
3808
  }, [t]), $ = F((g) => {
3810
3809
  const f = t.cameraRef.current, p = t.wrapRef.current;
3811
3810
  if (!p) return;
3812
- const v = p.getBoundingClientRect(), N = v.width / 2, w = v.height / 2, P = g / f.zoom;
3813
- f.x = N - (N - f.x) * P, f.y = w - (w - f.y) * P, f.zoom = Math.min(t.zoomMax, Math.max(t.zoomMin, g)), t.sendCamera();
3814
- }, [t]), k = F((g = {}) => {
3811
+ const v = p.getBoundingClientRect(), L = v.width / 2, w = v.height / 2, P = g / f.zoom;
3812
+ f.x = L - (L - f.x) * P, f.y = w - (w - f.y) * P, f.zoom = Math.min(t.zoomMax, Math.max(t.zoomMin, g)), t.sendCamera();
3813
+ }, [t]), R = F((g = {}) => {
3815
3814
  const f = t.nodesRef.current;
3816
3815
  if (!f.length) return;
3817
3816
  const p = t.wrapRef.current;
3818
3817
  if (!p) return;
3819
- const v = p.getBoundingClientRect(), N = g.padding ?? 0.1, w = g.nodes ? f.filter((B) => g.nodes.some((q) => q.id === B.id)) : f;
3818
+ const v = p.getBoundingClientRect(), L = g.padding ?? 0.1, w = g.nodes ? f.filter((B) => g.nodes.some((j) => j.id === B.id)) : f;
3820
3819
  if (!w.length) return;
3821
- const P = Mn(w), R = Rn(P, v.width, v.height, N);
3822
- g.maxZoom && (R.zoom = Math.min(R.zoom, g.maxZoom)), g.minZoom && (R.zoom = Math.max(R.zoom, g.minZoom)), t.cameraRef.current = R, t.sendCamera();
3820
+ const P = Mn(w), k = Rn(P, v.width, v.height, L);
3821
+ g.maxZoom && (k.zoom = Math.min(k.zoom, g.maxZoom)), g.minZoom && (k.zoom = Math.max(k.zoom, g.minZoom)), t.cameraRef.current = k, t.sendCamera();
3823
3822
  }, [t]), E = F((g, f, p = {}) => {
3824
3823
  const v = t.wrapRef.current;
3825
3824
  if (!v) return;
3826
- const N = v.getBoundingClientRect(), w = p.zoom ?? t.cameraRef.current.zoom;
3825
+ const L = v.getBoundingClientRect(), w = p.zoom ?? t.cameraRef.current.zoom;
3827
3826
  t.cameraRef.current = {
3828
- x: N.width / 2 - g * w,
3829
- y: N.height / 2 - f * w,
3827
+ x: L.width / 2 - g * w,
3828
+ y: L.height / 2 - f * w,
3830
3829
  zoom: w
3831
3830
  }, t.sendCamera();
3832
3831
  }, [t]), _ = F((g) => t.screenToWorld(g.x, g.y), [t]), D = F((g) => {
@@ -3854,7 +3853,7 @@ function eo() {
3854
3853
  zoomIn: z,
3855
3854
  zoomOut: M,
3856
3855
  zoomTo: $,
3857
- fitView: k,
3856
+ fitView: R,
3858
3857
  setCenter: E,
3859
3858
  screenToFlowPosition: _,
3860
3859
  flowToScreenPosition: D
@@ -3889,13 +3888,13 @@ function Xo({ nodeId: t, type: e, handleId: n }) {
3889
3888
  }
3890
3889
  function Fo({ onChange: t, onStart: e, onEnd: n }) {
3891
3890
  const r = yt(), s = tt(t), o = tt(e), i = tt(n);
3892
- ht(() => {
3891
+ ft(() => {
3893
3892
  s.current = t;
3894
- }, [t]), ht(() => {
3893
+ }, [t]), ft(() => {
3895
3894
  o.current = e;
3896
- }, [e]), ht(() => {
3895
+ }, [e]), ft(() => {
3897
3896
  i.current = n;
3898
- }, [n]), ht(() => {
3897
+ }, [n]), ft(() => {
3899
3898
  const c = (u) => {
3900
3899
  var l;
3901
3900
  (l = s.current) == null || l.call(s, { x: u.x, y: u.y, zoom: u.zoom });
@@ -3905,9 +3904,9 @@ function Fo({ onChange: t, onStart: e, onEnd: n }) {
3905
3904
  }
3906
3905
  function Yo({ onChange: t }) {
3907
3906
  const e = yt(), n = tt(t);
3908
- ht(() => {
3907
+ ft(() => {
3909
3908
  n.current = t;
3910
- }, [t]), ht(() => {
3909
+ }, [t]), ft(() => {
3911
3910
  const r = (s) => {
3912
3911
  var o;
3913
3912
  (o = n.current) == null || o.call(n, s);
@@ -3917,7 +3916,7 @@ function Yo({ onChange: t }) {
3917
3916
  }
3918
3917
  function Uo(t) {
3919
3918
  const [e, n] = Gt(!1), r = Array.isArray(t) ? t : [t];
3920
- return ht(() => {
3919
+ return ft(() => {
3921
3920
  const s = (i) => {
3922
3921
  r.includes(i.key) && n(!0);
3923
3922
  }, o = (i) => {
@@ -3975,34 +3974,34 @@ function Qo({
3975
3974
  m.width = t * z, m.height = e * z, C.scale(z, z), C.clearRect(0, 0, t, e);
3976
3975
  const M = c.nodesRef.current;
3977
3976
  if (!M.length) return;
3978
- let $ = 1 / 0, k = 1 / 0, E = -1 / 0, _ = -1 / 0;
3979
- for (const R of M) {
3980
- const B = R.width || wn, q = R.height || bn;
3981
- R.position.x < $ && ($ = R.position.x), R.position.y < k && (k = R.position.y), R.position.x + B > E && (E = R.position.x + B), R.position.y + q > _ && (_ = R.position.y + q);
3977
+ let $ = 1 / 0, R = 1 / 0, E = -1 / 0, _ = -1 / 0;
3978
+ for (const k of M) {
3979
+ const B = k.width || wn, j = k.height || bn;
3980
+ k.position.x < $ && ($ = k.position.x), k.position.y < R && (R = k.position.y), k.position.x + B > E && (E = k.position.x + B), k.position.y + j > _ && (_ = k.position.y + j);
3982
3981
  }
3983
3982
  const D = 40;
3984
- $ -= D, k -= D, E += D, _ += D;
3985
- const g = E - $, f = _ - k, p = Math.min(t / g, e / f), v = (t - g * p) / 2, N = (e - f * p) / 2;
3986
- for (const R of M) {
3987
- if (R.hidden) continue;
3988
- const B = R.width || wn, q = R.height || bn, X = (R.position.x - $) * p + v, K = (R.position.y - k) * p + N, at = B * p, rt = q * p;
3989
- C.fillStyle = R.selected ? "#f59e0b" : typeof n == "function" ? n(R) : n, C.fillRect(X, K, Math.max(at, 2), Math.max(rt, 2));
3983
+ $ -= D, R -= D, E += D, _ += D;
3984
+ const g = E - $, f = _ - R, p = Math.min(t / g, e / f), v = (t - g * p) / 2, L = (e - f * p) / 2;
3985
+ for (const k of M) {
3986
+ if (k.hidden) continue;
3987
+ const B = k.width || wn, j = k.height || bn, X = (k.position.x - $) * p + v, xt = (k.position.y - R) * p + L, K = B * p, rt = j * p;
3988
+ C.fillStyle = k.selected ? "#f59e0b" : typeof n == "function" ? n(k) : n, C.fillRect(X, xt, Math.max(K, 2), Math.max(rt, 2));
3990
3989
  }
3991
3990
  const w = c.cameraRef.current, P = c.wrapRef.current;
3992
3991
  if (P) {
3993
- const R = P.getBoundingClientRect(), B = -w.x / w.zoom, q = -w.y / w.zoom, X = R.width / w.zoom, K = R.height / w.zoom;
3992
+ const k = P.getBoundingClientRect(), B = -w.x / w.zoom, j = -w.y / w.zoom, X = k.width / w.zoom, xt = k.height / w.zoom;
3994
3993
  C.fillStyle = s, C.fillRect(0, 0, t, e);
3995
- const at = (B - $) * p + v, rt = (q - k) * p + N, G = X * p, j = K * p;
3996
- C.clearRect(at, rt, G, j);
3997
- for (const it of M) {
3998
- if (it.hidden) continue;
3999
- const dt = it.width || wn, ot = it.height || bn, ft = (it.position.x - $) * p + v, It = (it.position.y - k) * p + N;
4000
- C.fillStyle = it.selected ? "#f59e0b" : typeof n == "function" ? n(it) : n, C.fillRect(ft, It, Math.max(dt * p, 2), Math.max(ot * p, 2));
3994
+ const K = (B - $) * p + v, rt = (j - R) * p + L, q = X * p, G = xt * p;
3995
+ C.clearRect(K, rt, q, G);
3996
+ for (const ot of M) {
3997
+ if (ot.hidden) continue;
3998
+ const lt = ot.width || wn, ut = ot.height || bn, st = (ot.position.x - $) * p + v, It = (ot.position.y - R) * p + L;
3999
+ C.fillStyle = ot.selected ? "#f59e0b" : typeof n == "function" ? n(ot) : n, C.fillRect(st, It, Math.max(lt * p, 2), Math.max(ut * p, 2));
4001
4000
  }
4002
- C.strokeStyle = "#3b82f6", C.lineWidth = 1.5, C.strokeRect(at, rt, G, j);
4001
+ C.strokeStyle = "#3b82f6", C.lineWidth = 1.5, C.strokeRect(K, rt, q, G);
4003
4002
  }
4004
4003
  }, [c, t, e, n, r, s]);
4005
- return ht(() => {
4004
+ return ft(() => {
4006
4005
  let m = !0;
4007
4006
  function C() {
4008
4007
  m && (y(), l.current = requestAnimationFrame(C));
@@ -4084,16 +4083,16 @@ function ao({
4084
4083
  "aria-label": C = "Canvas controls",
4085
4084
  children: z
4086
4085
  }) {
4087
- const M = yt(), { zoomIn: $, zoomOut: k, fitView: E, getZoom: _ } = eo(), [D, g] = Gt(!0), f = _() <= M.zoomMin, p = _() >= M.zoomMax, v = F(() => {
4086
+ const M = yt(), { zoomIn: $, zoomOut: R, fitView: E, getZoom: _ } = eo(), [D, g] = Gt(!0), f = _() <= M.zoomMin, p = _() >= M.zoomMax, v = F(() => {
4088
4087
  $(), s == null || s();
4089
- }, [$, s]), N = F(() => {
4090
- k(), o == null || o();
4091
- }, [k, o]), w = F(() => {
4088
+ }, [$, s]), L = F(() => {
4089
+ R(), o == null || o();
4090
+ }, [R, o]), w = F(() => {
4092
4091
  E(r || { padding: 0.1 }), i == null || i();
4093
4092
  }, [E, r, i]), P = F(() => {
4094
4093
  const B = !D;
4095
4094
  g(B), c == null || c(B);
4096
- }, [D, c]), R = {
4095
+ }, [D, c]), k = {
4097
4096
  "top-left": { top: 10, left: 10 },
4098
4097
  "top-right": { top: 10, right: 10 },
4099
4098
  "top-center": { top: 10, left: "50%", transform: "translateX(-50%)" },
@@ -4111,13 +4110,13 @@ function ao({
4111
4110
  flexDirection: l === "horizontal" ? "row" : "column",
4112
4111
  gap: 2,
4113
4112
  zIndex: 5,
4114
- ...R,
4113
+ ...k,
4115
4114
  ...y
4116
4115
  },
4117
4116
  role: "toolbar",
4118
4117
  "aria-label": C,
4119
4118
  children: [
4120
- t && /* @__PURE__ */ $t(Le, { children: [
4119
+ t && /* @__PURE__ */ $t(Ne, { children: [
4121
4120
  /* @__PURE__ */ S(
4122
4121
  rn,
4123
4122
  {
@@ -4132,7 +4131,7 @@ function ao({
4132
4131
  /* @__PURE__ */ S(
4133
4132
  rn,
4134
4133
  {
4135
- onClick: N,
4134
+ onClick: L,
4136
4135
  disabled: f,
4137
4136
  title: "Zoom out",
4138
4137
  "aria-label": "Zoom out",
@@ -4250,20 +4249,20 @@ function ts({
4250
4249
  height: D.height || 60
4251
4250
  }, u == null || u(E, { width: z.current.width, height: z.current.height });
4252
4251
  const g = (p) => {
4253
- var q, X;
4252
+ var j, X;
4254
4253
  if (!z.current) return;
4255
- const v = z.current, N = C.cameraRef.current, w = (p.clientX - v.startX) / N.zoom, P = (p.clientY - v.startY) / N.zoom;
4256
- let R = v.width, B = v.height;
4257
- v.direction.includes("e") && (R = Math.min(n, Math.max(t, v.width + w))), v.direction.includes("w") && (R = Math.min(n, Math.max(t, v.width - w))), v.direction.includes("s") && (B = Math.min(r, Math.max(e, v.height + P))), v.direction.includes("n") && (B = Math.min(r, Math.max(e, v.height - P))), (X = (q = C.onNodesChangeRef).current) == null || X.call(q, [
4258
- { id: m, type: "dimensions", dimensions: { width: R, height: B }, setAttributes: !0 }
4259
- ]), l == null || l(p, { width: R, height: B });
4254
+ const v = z.current, L = C.cameraRef.current, w = (p.clientX - v.startX) / L.zoom, P = (p.clientY - v.startY) / L.zoom;
4255
+ let k = v.width, B = v.height;
4256
+ v.direction.includes("e") && (k = Math.min(n, Math.max(t, v.width + w))), v.direction.includes("w") && (k = Math.min(n, Math.max(t, v.width - w))), v.direction.includes("s") && (B = Math.min(r, Math.max(e, v.height + P))), v.direction.includes("n") && (B = Math.min(r, Math.max(e, v.height - P))), (X = (j = C.onNodesChangeRef).current) == null || X.call(j, [
4257
+ { id: m, type: "dimensions", dimensions: { width: k, height: B }, setAttributes: !0 }
4258
+ ]), l == null || l(p, { width: k, height: B });
4260
4259
  }, f = (p) => {
4261
4260
  z.current = null, y == null || y(p, {}), window.removeEventListener("pointermove", g), window.removeEventListener("pointerup", f);
4262
4261
  };
4263
4262
  window.addEventListener("pointermove", g), window.addEventListener("pointerup", f);
4264
4263
  }, [m, C, t, e, n, r, u, l, y]);
4265
4264
  if (!s) return null;
4266
- const $ = 8, k = {
4265
+ const $ = 8, R = {
4267
4266
  position: "absolute",
4268
4267
  width: $,
4269
4268
  height: $,
@@ -4273,60 +4272,60 @@ function ts({
4273
4272
  zIndex: 20,
4274
4273
  ...o
4275
4274
  };
4276
- return /* @__PURE__ */ $t(Le, { children: [
4275
+ return /* @__PURE__ */ $t(Ne, { children: [
4277
4276
  /* @__PURE__ */ S(
4278
4277
  "div",
4279
4278
  {
4280
- style: { ...k, bottom: -$ / 2, right: -$ / 2, cursor: "nwse-resize" },
4279
+ style: { ...R, bottom: -$ / 2, right: -$ / 2, cursor: "nwse-resize" },
4281
4280
  onPointerDown: (E) => M(E, "se")
4282
4281
  }
4283
4282
  ),
4284
4283
  /* @__PURE__ */ S(
4285
4284
  "div",
4286
4285
  {
4287
- style: { ...k, bottom: -$ / 2, left: -$ / 2, cursor: "nesw-resize" },
4286
+ style: { ...R, bottom: -$ / 2, left: -$ / 2, cursor: "nesw-resize" },
4288
4287
  onPointerDown: (E) => M(E, "sw")
4289
4288
  }
4290
4289
  ),
4291
4290
  /* @__PURE__ */ S(
4292
4291
  "div",
4293
4292
  {
4294
- style: { ...k, top: -$ / 2, right: -$ / 2, cursor: "nesw-resize" },
4293
+ style: { ...R, top: -$ / 2, right: -$ / 2, cursor: "nesw-resize" },
4295
4294
  onPointerDown: (E) => M(E, "ne")
4296
4295
  }
4297
4296
  ),
4298
4297
  /* @__PURE__ */ S(
4299
4298
  "div",
4300
4299
  {
4301
- style: { ...k, top: -$ / 2, left: -$ / 2, cursor: "nwse-resize" },
4300
+ style: { ...R, top: -$ / 2, left: -$ / 2, cursor: "nwse-resize" },
4302
4301
  onPointerDown: (E) => M(E, "nw")
4303
4302
  }
4304
4303
  ),
4305
4304
  /* @__PURE__ */ S(
4306
4305
  "div",
4307
4306
  {
4308
- style: { ...k, top: "50%", right: -$ / 2, cursor: "ew-resize", transform: "translateY(-50%)" },
4307
+ style: { ...R, top: "50%", right: -$ / 2, cursor: "ew-resize", transform: "translateY(-50%)" },
4309
4308
  onPointerDown: (E) => M(E, "e")
4310
4309
  }
4311
4310
  ),
4312
4311
  /* @__PURE__ */ S(
4313
4312
  "div",
4314
4313
  {
4315
- style: { ...k, top: "50%", left: -$ / 2, cursor: "ew-resize", transform: "translateY(-50%)" },
4314
+ style: { ...R, top: "50%", left: -$ / 2, cursor: "ew-resize", transform: "translateY(-50%)" },
4316
4315
  onPointerDown: (E) => M(E, "w")
4317
4316
  }
4318
4317
  ),
4319
4318
  /* @__PURE__ */ S(
4320
4319
  "div",
4321
4320
  {
4322
- style: { ...k, left: "50%", top: -$ / 2, cursor: "ns-resize", transform: "translateX(-50%)" },
4321
+ style: { ...R, left: "50%", top: -$ / 2, cursor: "ns-resize", transform: "translateX(-50%)" },
4323
4322
  onPointerDown: (E) => M(E, "n")
4324
4323
  }
4325
4324
  ),
4326
4325
  /* @__PURE__ */ S(
4327
4326
  "div",
4328
4327
  {
4329
- style: { ...k, left: "50%", bottom: -$ / 2, cursor: "ns-resize", transform: "translateX(-50%)" },
4328
+ style: { ...R, left: "50%", bottom: -$ / 2, cursor: "ns-resize", transform: "translateX(-50%)" },
4330
4329
  onPointerDown: (E) => M(E, "s")
4331
4330
  }
4332
4331
  )
@@ -4528,7 +4527,7 @@ export {
4528
4527
  vo as boxToRect,
4529
4528
  or as buildObstacles,
4530
4529
  Tn as clampPosition,
4531
- No as computeRoutedEdges,
4530
+ Lo as computeRoutedEdges,
4532
4531
  zo as getBezierEdgeCenter,
4533
4532
  nr as getBezierPath,
4534
4533
  wo as getBoundsOfBoxes,
@@ -4551,14 +4550,14 @@ export {
4551
4550
  Mo as nodeToRect,
4552
4551
  Co as reconnectEdge,
4553
4552
  mo as rectToBox,
4554
- Lo as routeSinglePath,
4553
+ No as routeSinglePath,
4555
4554
  En as routedPointsToPath,
4556
4555
  Pn as snapPosition,
4557
4556
  Ho as useConnection,
4558
4557
  Do as useEdges,
4559
4558
  So as useEdgesState,
4560
4559
  Xo as useHandleConnections,
4561
- Lr as useInfiniteCanvas,
4560
+ Nr as useInfiniteCanvas,
4562
4561
  Go as useInternalNode,
4563
4562
  Uo as useKeyPress,
4564
4563
  Wo as useNodeConnections,