@arudovwen/form-builder-react 1.9.8 → 1.9.10

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,7 +1,7 @@
1
1
  import { jsxs as ce, jsx as D, Fragment as De } from "react/jsx-runtime";
2
2
  import ht, { memo as le, useState as xe, useCallback as we, forwardRef as Oo, useRef as ne, useEffect as ie, useContext as gt, createContext as fn, useMemo as be, useLayoutEffect as Aa } from "react";
3
3
  import "react-dom";
4
- import { A as Ia } from "./index-D-zmAziH.js";
4
+ import { A as Ia } from "./index-C09au66N.js";
5
5
  function ue(e) {
6
6
  if (typeof e == "string" || typeof e == "number") return "" + e;
7
7
  let t = "";
@@ -231,11 +231,11 @@ function nc(e, t) {
231
231
  var n = t ? ec : ja, r = this._parents, o = this._groups;
232
232
  typeof e != "function" && (e = Ja(e));
233
233
  for (var i = o.length, s = new Array(i), a = new Array(i), c = new Array(i), l = 0; l < i; ++l) {
234
- var d = r[l], u = o[l], f = u.length, g = rc(e.call(d, d && d.__data__, l, r)), h = g.length, y = a[l] = new Array(h), x = s[l] = new Array(h), m = c[l] = new Array(f);
235
- n(d, u, y, x, m, g, t);
236
- for (var v = 0, p = 0, w, S; v < h; ++v)
234
+ var d = r[l], u = o[l], f = u.length, g = rc(e.call(d, d && d.__data__, l, r)), h = g.length, y = a[l] = new Array(h), x = s[l] = new Array(h), p = c[l] = new Array(f);
235
+ n(d, u, y, x, p, g, t);
236
+ for (var v = 0, m = 0, w, S; v < h; ++v)
237
237
  if (w = y[v]) {
238
- for (v >= p && (p = v + 1); !(S = x[p]) && ++p < h; ) ;
238
+ for (v >= m && (m = v + 1); !(S = x[m]) && ++m < h; ) ;
239
239
  w._next = S || null;
240
240
  }
241
241
  }
@@ -730,11 +730,11 @@ function yl() {
730
730
  function Qo() {
731
731
  var e = gl, t = pl, n = ml, r = yl, o = {}, i = hn("start", "drag", "end"), s = 0, a, c, l, d, u = 0;
732
732
  function f(w) {
733
- w.on("mousedown.drag", g).filter(r).on("touchstart.drag", x).on("touchmove.drag", m, hl).on("touchend.drag touchcancel.drag", v).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
733
+ w.on("mousedown.drag", g).filter(r).on("touchstart.drag", x).on("touchmove.drag", p, hl).on("touchend.drag touchcancel.drag", v).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
734
734
  }
735
735
  function g(w, S) {
736
736
  if (!(d || !e.call(this, w, S))) {
737
- var _ = p(this, t.call(this, w, S), w, S, "mouse");
737
+ var _ = m(this, t.call(this, w, S), w, S, "mouse");
738
738
  _ && (pe(w.view).on("mousemove.drag", h, _t).on("mouseup.drag", y, _t), Uo(w.view), Cn(w), l = !1, a = w.clientX, c = w.clientY, _("start", w));
739
739
  }
740
740
  }
@@ -750,29 +750,29 @@ function Qo() {
750
750
  }
751
751
  function x(w, S) {
752
752
  if (e.call(this, w, S)) {
753
- var _ = w.changedTouches, E = t.call(this, w, S), $ = _.length, T, B;
754
- for (T = 0; T < $; ++T)
755
- (B = p(this, E, w, S, _[T].identifier, _[T])) && (Cn(w), B("start", w, _[T]));
753
+ var _ = w.changedTouches, E = t.call(this, w, S), I = _.length, T, B;
754
+ for (T = 0; T < I; ++T)
755
+ (B = m(this, E, w, S, _[T].identifier, _[T])) && (Cn(w), B("start", w, _[T]));
756
756
  }
757
757
  }
758
- function m(w) {
759
- var S = w.changedTouches, _ = S.length, E, $;
758
+ function p(w) {
759
+ var S = w.changedTouches, _ = S.length, E, I;
760
760
  for (E = 0; E < _; ++E)
761
- ($ = o[S[E].identifier]) && (rt(w), $("drag", w, S[E]));
761
+ (I = o[S[E].identifier]) && (rt(w), I("drag", w, S[E]));
762
762
  }
763
763
  function v(w) {
764
- var S = w.changedTouches, _ = S.length, E, $;
764
+ var S = w.changedTouches, _ = S.length, E, I;
765
765
  for (d && clearTimeout(d), d = setTimeout(function() {
766
766
  d = null;
767
767
  }, 500), E = 0; E < _; ++E)
768
- ($ = o[S[E].identifier]) && (Cn(w), $("end", w, S[E]));
768
+ (I = o[S[E].identifier]) && (Cn(w), I("end", w, S[E]));
769
769
  }
770
- function p(w, S, _, E, $, T) {
770
+ function m(w, S, _, E, I, T) {
771
771
  var B = i.copy(), k = ve(T || _, S), M, L, b;
772
772
  if ((b = n.call(w, new Bn("beforestart", {
773
773
  sourceEvent: _,
774
774
  target: f,
775
- identifier: $,
775
+ identifier: I,
776
776
  active: s,
777
777
  x: k[0],
778
778
  y: k[1],
@@ -780,27 +780,27 @@ function Qo() {
780
780
  dy: 0,
781
781
  dispatch: B
782
782
  }), E)) != null)
783
- return M = b.x - k[0] || 0, L = b.y - k[1] || 0, function A(N, I, P) {
783
+ return M = b.x - k[0] || 0, L = b.y - k[1] || 0, function A(N, $, P) {
784
784
  var C = k, z;
785
785
  switch (N) {
786
786
  case "start":
787
- o[$] = A, z = s++;
787
+ o[I] = A, z = s++;
788
788
  break;
789
789
  case "end":
790
- delete o[$], --s;
790
+ delete o[I], --s;
791
791
  // falls through
792
792
  case "drag":
793
- k = ve(P || I, S), z = s;
793
+ k = ve(P || $, S), z = s;
794
794
  break;
795
795
  }
796
796
  B.call(
797
797
  N,
798
798
  w,
799
799
  new Bn(N, {
800
- sourceEvent: I,
800
+ sourceEvent: $,
801
801
  subject: b,
802
802
  target: f,
803
- identifier: $,
803
+ identifier: I,
804
804
  active: z,
805
805
  x: k[0] + M,
806
806
  y: k[1] + L,
@@ -1292,27 +1292,27 @@ function Gl(e) {
1292
1292
  }
1293
1293
  const Qt = function e(t, n, r) {
1294
1294
  function o(i, s) {
1295
- var a = i[0], c = i[1], l = i[2], d = s[0], u = s[1], f = s[2], g = d - a, h = u - c, y = g * g + h * h, x, m;
1295
+ var a = i[0], c = i[1], l = i[2], d = s[0], u = s[1], f = s[2], g = d - a, h = u - c, y = g * g + h * h, x, p;
1296
1296
  if (y < Yl)
1297
- m = Math.log(f / l) / t, x = function(E) {
1297
+ p = Math.log(f / l) / t, x = function(E) {
1298
1298
  return [
1299
1299
  a + E * g,
1300
1300
  c + E * h,
1301
- l * Math.exp(t * E * m)
1301
+ l * Math.exp(t * E * p)
1302
1302
  ];
1303
1303
  };
1304
1304
  else {
1305
- var v = Math.sqrt(y), p = (f * f - l * l + r * y) / (2 * l * n * v), w = (f * f - l * l - r * y) / (2 * f * n * v), S = Math.log(Math.sqrt(p * p + 1) - p), _ = Math.log(Math.sqrt(w * w + 1) - w);
1306
- m = (_ - S) / t, x = function(E) {
1307
- var $ = E * m, T = Or(S), B = l / (n * v) * (T * Gl(t * $ + S) - Wl(S));
1305
+ var v = Math.sqrt(y), m = (f * f - l * l + r * y) / (2 * l * n * v), w = (f * f - l * l - r * y) / (2 * f * n * v), S = Math.log(Math.sqrt(m * m + 1) - m), _ = Math.log(Math.sqrt(w * w + 1) - w);
1306
+ p = (_ - S) / t, x = function(E) {
1307
+ var I = E * p, T = Or(S), B = l / (n * v) * (T * Gl(t * I + S) - Wl(S));
1308
1308
  return [
1309
1309
  a + B * g,
1310
1310
  c + B * h,
1311
- l * T / Or(t * $ + S)
1311
+ l * T / Or(t * I + S)
1312
1312
  ];
1313
1313
  };
1314
1314
  }
1315
- return x.duration = m * 1e3 * t / Math.SQRT2, x;
1315
+ return x.duration = p * 1e3 * t / Math.SQRT2, x;
1316
1316
  }
1317
1317
  return o.rho = function(i) {
1318
1318
  var s = Math.max(1e-3, +i), a = s * s, c = a * a;
@@ -1990,57 +1990,57 @@ function ld(e, t, n) {
1990
1990
  }
1991
1991
  function fi() {
1992
1992
  var e = id, t = sd, n = ld, r = ad, o = cd, i = [0, 1 / 0], s = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], a = 250, c = Qt, l = hn("start", "zoom", "end"), d, u, f, g = 500, h = 150, y = 0, x = 10;
1993
- function m(b) {
1994
- b.property("__zoom", Vr).on("wheel.zoom", $, { passive: !1 }).on("mousedown.zoom", T).on("dblclick.zoom", B).filter(o).on("touchstart.zoom", k).on("touchmove.zoom", M).on("touchend.zoom touchcancel.zoom", L).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
1993
+ function p(b) {
1994
+ b.property("__zoom", Vr).on("wheel.zoom", I, { passive: !1 }).on("mousedown.zoom", T).on("dblclick.zoom", B).filter(o).on("touchstart.zoom", k).on("touchmove.zoom", M).on("touchend.zoom touchcancel.zoom", L).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
1995
1995
  }
1996
- m.transform = function(b, A, N, I) {
1996
+ p.transform = function(b, A, N, $) {
1997
1997
  var P = b.selection ? b.selection() : b;
1998
- P.property("__zoom", Vr), b !== P ? S(b, A, N, I) : P.interrupt().each(function() {
1999
- _(this, arguments).event(I).start().zoom(null, typeof A == "function" ? A.apply(this, arguments) : A).end();
1998
+ P.property("__zoom", Vr), b !== P ? S(b, A, N, $) : P.interrupt().each(function() {
1999
+ _(this, arguments).event($).start().zoom(null, typeof A == "function" ? A.apply(this, arguments) : A).end();
2000
2000
  });
2001
- }, m.scaleBy = function(b, A, N, I) {
2002
- m.scaleTo(b, function() {
2001
+ }, p.scaleBy = function(b, A, N, $) {
2002
+ p.scaleTo(b, function() {
2003
2003
  var P = this.__zoom.k, C = typeof A == "function" ? A.apply(this, arguments) : A;
2004
2004
  return P * C;
2005
- }, N, I);
2006
- }, m.scaleTo = function(b, A, N, I) {
2007
- m.transform(b, function() {
2005
+ }, N, $);
2006
+ }, p.scaleTo = function(b, A, N, $) {
2007
+ p.transform(b, function() {
2008
2008
  var P = t.apply(this, arguments), C = this.__zoom, z = N == null ? w(P) : typeof N == "function" ? N.apply(this, arguments) : N, R = C.invert(z), O = typeof A == "function" ? A.apply(this, arguments) : A;
2009
- return n(p(v(C, O), z, R), P, s);
2010
- }, N, I);
2011
- }, m.translateBy = function(b, A, N, I) {
2012
- m.transform(b, function() {
2009
+ return n(m(v(C, O), z, R), P, s);
2010
+ }, N, $);
2011
+ }, p.translateBy = function(b, A, N, $) {
2012
+ p.transform(b, function() {
2013
2013
  return n(this.__zoom.translate(
2014
2014
  typeof A == "function" ? A.apply(this, arguments) : A,
2015
2015
  typeof N == "function" ? N.apply(this, arguments) : N
2016
2016
  ), t.apply(this, arguments), s);
2017
- }, null, I);
2018
- }, m.translateTo = function(b, A, N, I, P) {
2019
- m.transform(b, function() {
2020
- var C = t.apply(this, arguments), z = this.__zoom, R = I == null ? w(C) : typeof I == "function" ? I.apply(this, arguments) : I;
2017
+ }, null, $);
2018
+ }, p.translateTo = function(b, A, N, $, P) {
2019
+ p.transform(b, function() {
2020
+ var C = t.apply(this, arguments), z = this.__zoom, R = $ == null ? w(C) : typeof $ == "function" ? $.apply(this, arguments) : $;
2021
2021
  return n(yn.translate(R[0], R[1]).scale(z.k).translate(
2022
2022
  typeof A == "function" ? -A.apply(this, arguments) : -A,
2023
2023
  typeof N == "function" ? -N.apply(this, arguments) : -N
2024
2024
  ), C, s);
2025
- }, I, P);
2025
+ }, $, P);
2026
2026
  };
2027
2027
  function v(b, A) {
2028
2028
  return A = Math.max(i[0], Math.min(i[1], A)), A === b.k ? b : new Pe(A, b.x, b.y);
2029
2029
  }
2030
- function p(b, A, N) {
2031
- var I = A[0] - N[0] * b.k, P = A[1] - N[1] * b.k;
2032
- return I === b.x && P === b.y ? b : new Pe(b.k, I, P);
2030
+ function m(b, A, N) {
2031
+ var $ = A[0] - N[0] * b.k, P = A[1] - N[1] * b.k;
2032
+ return $ === b.x && P === b.y ? b : new Pe(b.k, $, P);
2033
2033
  }
2034
2034
  function w(b) {
2035
2035
  return [(+b[0][0] + +b[1][0]) / 2, (+b[0][1] + +b[1][1]) / 2];
2036
2036
  }
2037
- function S(b, A, N, I) {
2037
+ function S(b, A, N, $) {
2038
2038
  b.on("start.zoom", function() {
2039
- _(this, arguments).event(I).start();
2039
+ _(this, arguments).event($).start();
2040
2040
  }).on("interrupt.zoom end.zoom", function() {
2041
- _(this, arguments).event(I).end();
2041
+ _(this, arguments).event($).end();
2042
2042
  }).tween("zoom", function() {
2043
- var P = this, C = arguments, z = _(P, C).event(I), R = t.apply(P, C), O = N == null ? w(R) : typeof N == "function" ? N.apply(P, C) : N, F = Math.max(R[1][0] - R[0][0], R[1][1] - R[0][1]), Y = P.__zoom, K = typeof A == "function" ? A.apply(P, C) : A, Z = c(Y.invert(O).concat(F / Y.k), K.invert(O).concat(F / K.k));
2043
+ var P = this, C = arguments, z = _(P, C).event($), R = t.apply(P, C), O = N == null ? w(R) : typeof N == "function" ? N.apply(P, C) : N, F = Math.max(R[1][0] - R[0][0], R[1][1] - R[0][1]), Y = P.__zoom, K = typeof A == "function" ? A.apply(P, C) : A, Z = c(Y.invert(O).concat(F / Y.k), K.invert(O).concat(F / K.k));
2044
2044
  return function(X) {
2045
2045
  if (X === 1) X = K;
2046
2046
  else {
@@ -2077,7 +2077,7 @@ function fi() {
2077
2077
  this.that,
2078
2078
  new od(b, {
2079
2079
  sourceEvent: this.sourceEvent,
2080
- target: m,
2080
+ target: p,
2081
2081
  transform: this.that.__zoom,
2082
2082
  dispatch: l
2083
2083
  }),
@@ -2085,45 +2085,45 @@ function fi() {
2085
2085
  );
2086
2086
  }
2087
2087
  };
2088
- function $(b, ...A) {
2088
+ function I(b, ...A) {
2089
2089
  if (!e.apply(this, arguments)) return;
2090
- var N = _(this, A).event(b), I = this.__zoom, P = Math.max(i[0], Math.min(i[1], I.k * Math.pow(2, r.apply(this, arguments)))), C = ve(b);
2090
+ var N = _(this, A).event(b), $ = this.__zoom, P = Math.max(i[0], Math.min(i[1], $.k * Math.pow(2, r.apply(this, arguments)))), C = ve(b);
2091
2091
  if (N.wheel)
2092
- (N.mouse[0][0] !== C[0] || N.mouse[0][1] !== C[1]) && (N.mouse[1] = I.invert(N.mouse[0] = C)), clearTimeout(N.wheel);
2092
+ (N.mouse[0][0] !== C[0] || N.mouse[0][1] !== C[1]) && (N.mouse[1] = $.invert(N.mouse[0] = C)), clearTimeout(N.wheel);
2093
2093
  else {
2094
- if (I.k === P) return;
2095
- N.mouse = [C, I.invert(C)], en(this), N.start();
2094
+ if ($.k === P) return;
2095
+ N.mouse = [C, $.invert(C)], en(this), N.start();
2096
2096
  }
2097
- yt(b), N.wheel = setTimeout(z, h), N.zoom("mouse", n(p(v(I, P), N.mouse[0], N.mouse[1]), N.extent, s));
2097
+ yt(b), N.wheel = setTimeout(z, h), N.zoom("mouse", n(m(v($, P), N.mouse[0], N.mouse[1]), N.extent, s));
2098
2098
  function z() {
2099
2099
  N.wheel = null, N.end();
2100
2100
  }
2101
2101
  }
2102
2102
  function T(b, ...A) {
2103
2103
  if (f || !e.apply(this, arguments)) return;
2104
- var N = b.currentTarget, I = _(this, A, !0).event(b), P = pe(b.view).on("mousemove.zoom", O, !0).on("mouseup.zoom", F, !0), C = ve(b, N), z = b.clientX, R = b.clientY;
2105
- Uo(b.view), An(b), I.mouse = [C, this.__zoom.invert(C)], en(this), I.start();
2104
+ var N = b.currentTarget, $ = _(this, A, !0).event(b), P = pe(b.view).on("mousemove.zoom", O, !0).on("mouseup.zoom", F, !0), C = ve(b, N), z = b.clientX, R = b.clientY;
2105
+ Uo(b.view), An(b), $.mouse = [C, this.__zoom.invert(C)], en(this), $.start();
2106
2106
  function O(Y) {
2107
- if (yt(Y), !I.moved) {
2107
+ if (yt(Y), !$.moved) {
2108
2108
  var K = Y.clientX - z, Z = Y.clientY - R;
2109
- I.moved = K * K + Z * Z > y;
2109
+ $.moved = K * K + Z * Z > y;
2110
2110
  }
2111
- I.event(Y).zoom("mouse", n(p(I.that.__zoom, I.mouse[0] = ve(Y, N), I.mouse[1]), I.extent, s));
2111
+ $.event(Y).zoom("mouse", n(m($.that.__zoom, $.mouse[0] = ve(Y, N), $.mouse[1]), $.extent, s));
2112
2112
  }
2113
2113
  function F(Y) {
2114
- P.on("mousemove.zoom mouseup.zoom", null), Zo(Y.view, I.moved), yt(Y), I.event(Y).end();
2114
+ P.on("mousemove.zoom mouseup.zoom", null), Zo(Y.view, $.moved), yt(Y), $.event(Y).end();
2115
2115
  }
2116
2116
  }
2117
2117
  function B(b, ...A) {
2118
2118
  if (e.apply(this, arguments)) {
2119
- var N = this.__zoom, I = ve(b.changedTouches ? b.changedTouches[0] : b, this), P = N.invert(I), C = N.k * (b.shiftKey ? 0.5 : 2), z = n(p(v(N, C), I, P), t.apply(this, A), s);
2120
- yt(b), a > 0 ? pe(this).transition().duration(a).call(S, z, I, b) : pe(this).call(m.transform, z, I, b);
2119
+ var N = this.__zoom, $ = ve(b.changedTouches ? b.changedTouches[0] : b, this), P = N.invert($), C = N.k * (b.shiftKey ? 0.5 : 2), z = n(m(v(N, C), $, P), t.apply(this, A), s);
2120
+ yt(b), a > 0 ? pe(this).transition().duration(a).call(S, z, $, b) : pe(this).call(p.transform, z, $, b);
2121
2121
  }
2122
2122
  }
2123
2123
  function k(b, ...A) {
2124
2124
  if (e.apply(this, arguments)) {
2125
- var N = b.touches, I = N.length, P = _(this, A, b.changedTouches.length === I).event(b), C, z, R, O;
2126
- for (An(b), z = 0; z < I; ++z)
2125
+ var N = b.touches, $ = N.length, P = _(this, A, b.changedTouches.length === $).event(b), C, z, R, O;
2126
+ for (An(b), z = 0; z < $; ++z)
2127
2127
  R = N[z], O = ve(R, this), O = [O, this.__zoom.invert(O), R.identifier], P.touch0 ? !P.touch1 && P.touch0[2] !== O[2] && (P.touch1 = O, P.taps = 0) : (P.touch0 = O, C = !0, P.taps = 1 + !!d);
2128
2128
  d && (d = clearTimeout(d)), C && (P.taps < 2 && (u = O[0], d = setTimeout(function() {
2129
2129
  d = null;
@@ -2132,24 +2132,24 @@ function fi() {
2132
2132
  }
2133
2133
  function M(b, ...A) {
2134
2134
  if (this.__zooming) {
2135
- var N = _(this, A).event(b), I = b.changedTouches, P = I.length, C, z, R, O;
2135
+ var N = _(this, A).event(b), $ = b.changedTouches, P = $.length, C, z, R, O;
2136
2136
  for (yt(b), C = 0; C < P; ++C)
2137
- z = I[C], R = ve(z, this), N.touch0 && N.touch0[2] === z.identifier ? N.touch0[0] = R : N.touch1 && N.touch1[2] === z.identifier && (N.touch1[0] = R);
2137
+ z = $[C], R = ve(z, this), N.touch0 && N.touch0[2] === z.identifier ? N.touch0[0] = R : N.touch1 && N.touch1[2] === z.identifier && (N.touch1[0] = R);
2138
2138
  if (z = N.that.__zoom, N.touch1) {
2139
2139
  var F = N.touch0[0], Y = N.touch0[1], K = N.touch1[0], Z = N.touch1[1], X = (X = K[0] - F[0]) * X + (X = K[1] - F[1]) * X, H = (H = Z[0] - Y[0]) * H + (H = Z[1] - Y[1]) * H;
2140
2140
  z = v(z, Math.sqrt(X / H)), R = [(F[0] + K[0]) / 2, (F[1] + K[1]) / 2], O = [(Y[0] + Z[0]) / 2, (Y[1] + Z[1]) / 2];
2141
2141
  } else if (N.touch0) R = N.touch0[0], O = N.touch0[1];
2142
2142
  else return;
2143
- N.zoom("touch", n(p(z, R, O), N.extent, s));
2143
+ N.zoom("touch", n(m(z, R, O), N.extent, s));
2144
2144
  }
2145
2145
  }
2146
2146
  function L(b, ...A) {
2147
2147
  if (this.__zooming) {
2148
- var N = _(this, A).event(b), I = b.changedTouches, P = I.length, C, z;
2148
+ var N = _(this, A).event(b), $ = b.changedTouches, P = $.length, C, z;
2149
2149
  for (An(b), f && clearTimeout(f), f = setTimeout(function() {
2150
2150
  f = null;
2151
2151
  }, g), C = 0; C < P; ++C)
2152
- z = I[C], N.touch0 && N.touch0[2] === z.identifier ? delete N.touch0 : N.touch1 && N.touch1[2] === z.identifier && delete N.touch1;
2152
+ z = $[C], N.touch0 && N.touch0[2] === z.identifier ? delete N.touch0 : N.touch1 && N.touch1[2] === z.identifier && delete N.touch1;
2153
2153
  if (N.touch1 && !N.touch0 && (N.touch0 = N.touch1, delete N.touch1), N.touch0) N.touch0[1] = this.__zoom.invert(N.touch0[0]);
2154
2154
  else if (N.end(), N.taps === 2 && (z = ve(z, this), Math.hypot(u[0] - z[0], u[1] - z[1]) < x)) {
2155
2155
  var R = pe(this).on("dblclick.zoom");
@@ -2157,32 +2157,32 @@ function fi() {
2157
2157
  }
2158
2158
  }
2159
2159
  }
2160
- return m.wheelDelta = function(b) {
2161
- return arguments.length ? (r = typeof b == "function" ? b : Xt(+b), m) : r;
2162
- }, m.filter = function(b) {
2163
- return arguments.length ? (e = typeof b == "function" ? b : Xt(!!b), m) : e;
2164
- }, m.touchable = function(b) {
2165
- return arguments.length ? (o = typeof b == "function" ? b : Xt(!!b), m) : o;
2166
- }, m.extent = function(b) {
2167
- return arguments.length ? (t = typeof b == "function" ? b : Xt([[+b[0][0], +b[0][1]], [+b[1][0], +b[1][1]]]), m) : t;
2168
- }, m.scaleExtent = function(b) {
2169
- return arguments.length ? (i[0] = +b[0], i[1] = +b[1], m) : [i[0], i[1]];
2170
- }, m.translateExtent = function(b) {
2171
- return arguments.length ? (s[0][0] = +b[0][0], s[1][0] = +b[1][0], s[0][1] = +b[0][1], s[1][1] = +b[1][1], m) : [[s[0][0], s[0][1]], [s[1][0], s[1][1]]];
2172
- }, m.constrain = function(b) {
2173
- return arguments.length ? (n = b, m) : n;
2174
- }, m.duration = function(b) {
2175
- return arguments.length ? (a = +b, m) : a;
2176
- }, m.interpolate = function(b) {
2177
- return arguments.length ? (c = b, m) : c;
2178
- }, m.on = function() {
2160
+ return p.wheelDelta = function(b) {
2161
+ return arguments.length ? (r = typeof b == "function" ? b : Xt(+b), p) : r;
2162
+ }, p.filter = function(b) {
2163
+ return arguments.length ? (e = typeof b == "function" ? b : Xt(!!b), p) : e;
2164
+ }, p.touchable = function(b) {
2165
+ return arguments.length ? (o = typeof b == "function" ? b : Xt(!!b), p) : o;
2166
+ }, p.extent = function(b) {
2167
+ return arguments.length ? (t = typeof b == "function" ? b : Xt([[+b[0][0], +b[0][1]], [+b[1][0], +b[1][1]]]), p) : t;
2168
+ }, p.scaleExtent = function(b) {
2169
+ return arguments.length ? (i[0] = +b[0], i[1] = +b[1], p) : [i[0], i[1]];
2170
+ }, p.translateExtent = function(b) {
2171
+ return arguments.length ? (s[0][0] = +b[0][0], s[1][0] = +b[1][0], s[0][1] = +b[0][1], s[1][1] = +b[1][1], p) : [[s[0][0], s[0][1]], [s[1][0], s[1][1]]];
2172
+ }, p.constrain = function(b) {
2173
+ return arguments.length ? (n = b, p) : n;
2174
+ }, p.duration = function(b) {
2175
+ return arguments.length ? (a = +b, p) : a;
2176
+ }, p.interpolate = function(b) {
2177
+ return arguments.length ? (c = b, p) : c;
2178
+ }, p.on = function() {
2179
2179
  var b = l.on.apply(l, arguments);
2180
- return b === l ? m : b;
2181
- }, m.clickDistance = function(b) {
2182
- return arguments.length ? (y = (b = +b) * b, m) : Math.sqrt(y);
2183
- }, m.tapDistance = function(b) {
2184
- return arguments.length ? (x = +b, m) : x;
2185
- }, m;
2180
+ return b === l ? p : b;
2181
+ }, p.clickDistance = function(b) {
2182
+ return arguments.length ? (y = (b = +b) * b, p) : Math.sqrt(y);
2183
+ }, p.tapDistance = function(b) {
2184
+ return arguments.length ? (x = +b, p) : x;
2185
+ }, p;
2186
2186
  }
2187
2187
  const ye = {
2188
2188
  error001: (e = "react") => `Seems like you have not used ${e === "svelte" ? "SvelteFlowProvider" : "ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,
@@ -2290,13 +2290,13 @@ const yi = (e) => "id" in e && "source" in e && "target" in e, ud = (e) => "id"
2290
2290
  (t.filter === void 0 || t.filter(o)) && (n = xn(n, ln(o)), r = !0);
2291
2291
  }), r ? wn(n) : { x: 0, y: 0, width: 0, height: 0 };
2292
2292
  }, ar = (e, t, [n, r, o] = [0, 0, 1], i = !1, s = !1) => {
2293
- var f, g, h, y, x, m;
2293
+ var f, g, h, y, x, p;
2294
2294
  const a = (t.x - n) / o, c = (t.y - r) / o, l = t.width / o, d = t.height / o, u = [];
2295
2295
  for (const v of e.values()) {
2296
- const { measured: p, selectable: w = !0, hidden: S = !1 } = v;
2296
+ const { measured: m, selectable: w = !0, hidden: S = !1 } = v;
2297
2297
  if (s && !w || S)
2298
2298
  continue;
2299
- const _ = (h = (g = (f = p.width) != null ? f : v.width) != null ? g : v.initialWidth) != null ? h : 0, E = (m = (x = (y = p.height) != null ? y : v.height) != null ? x : v.initialHeight) != null ? m : 0, { x: $, y: T } = v.internals.positionAbsolute, B = vi(a, c, l, d, $, T, _, E), k = _ * E, M = i && B > 0;
2299
+ const _ = (h = (g = (f = m.width) != null ? f : v.width) != null ? g : v.initialWidth) != null ? h : 0, E = (p = (x = (y = m.height) != null ? y : v.height) != null ? x : v.initialHeight) != null ? p : 0, { x: I, y: T } = v.internals.positionAbsolute, B = vi(a, c, l, d, I, T, _, E), k = _ * E, M = i && B > 0;
2300
2300
  (!v.internals.handleBounds || M || B >= k || v.dragging) && u.push(v);
2301
2301
  }
2302
2302
  return u;
@@ -2331,10 +2331,10 @@ function xi({ nodeId: e, nextPosition: t, nodeLookup: n, nodeOrigin: r = [0, 0],
2331
2331
  if (!a)
2332
2332
  i == null || i("005", ye.error005());
2333
2333
  else {
2334
- const x = a.measured.width, m = a.measured.height;
2335
- x && m && (u = [
2334
+ const x = a.measured.width, p = a.measured.height;
2335
+ x && p && (u = [
2336
2336
  [c, l],
2337
- [c + x, l + m]
2337
+ [c + x, l + p]
2338
2338
  ]);
2339
2339
  }
2340
2340
  else a && Ze(s.extent) && (u = [
@@ -2682,21 +2682,21 @@ const qr = {
2682
2682
  [G.Bottom]: { x: 0, y: 1 }
2683
2683
  }, Cd = ({ source: e, sourcePosition: t = G.Bottom, target: n }) => t === G.Left || t === G.Right ? e.x < n.x ? { x: 1, y: 0 } : { x: -1, y: 0 } : e.y < n.y ? { x: 0, y: 1 } : { x: 0, y: -1 }, Ur = (e, t) => Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2));
2684
2684
  function Md({ source: e, sourcePosition: t = G.Bottom, target: n, targetPosition: r = G.Top, center: o, offset: i, stepPosition: s }) {
2685
- var $, T, B, k;
2685
+ var I, T, B, k;
2686
2686
  const a = qr[t], c = qr[r], l = { x: e.x + a.x * i, y: e.y + a.y * i }, d = { x: n.x + c.x * i, y: n.y + c.y * i }, u = Cd({
2687
2687
  source: l,
2688
2688
  sourcePosition: t,
2689
2689
  target: d
2690
2690
  }), f = u.x !== 0 ? "x" : "y", g = u[f];
2691
2691
  let h = [], y, x;
2692
- const m = { x: 0, y: 0 }, v = { x: 0, y: 0 }, [, , p, w] = Ii({
2692
+ const p = { x: 0, y: 0 }, v = { x: 0, y: 0 }, [, , m, w] = Ii({
2693
2693
  sourceX: e.x,
2694
2694
  sourceY: e.y,
2695
2695
  targetX: n.x,
2696
2696
  targetY: n.y
2697
2697
  });
2698
2698
  if (a[f] * c[f] === -1) {
2699
- f === "x" ? (y = ($ = o.x) != null ? $ : l.x + (d.x - l.x) * s, x = (T = o.y) != null ? T : (l.y + d.y) / 2) : (y = (B = o.x) != null ? B : (l.x + d.x) / 2, x = (k = o.y) != null ? k : l.y + (d.y - l.y) * s);
2699
+ f === "x" ? (y = (I = o.x) != null ? I : l.x + (d.x - l.x) * s, x = (T = o.y) != null ? T : (l.y + d.y) / 2) : (y = (B = o.x) != null ? B : (l.x + d.x) / 2, x = (k = o.y) != null ? k : l.y + (d.y - l.y) * s);
2700
2700
  const M = [
2701
2701
  { x: y, y: l.y },
2702
2702
  { x: y, y: d.y }
@@ -2711,17 +2711,17 @@ function Md({ source: e, sourcePosition: t = G.Bottom, target: n, targetPosition
2711
2711
  const P = Math.abs(e[f] - n[f]);
2712
2712
  if (P <= i) {
2713
2713
  const C = Math.min(i - 1, i - P);
2714
- a[f] === g ? m[f] = (l[f] > e[f] ? -1 : 1) * C : v[f] = (d[f] > n[f] ? -1 : 1) * C;
2714
+ a[f] === g ? p[f] = (l[f] > e[f] ? -1 : 1) * C : v[f] = (d[f] > n[f] ? -1 : 1) * C;
2715
2715
  }
2716
2716
  }
2717
2717
  if (t !== r) {
2718
2718
  const P = f === "x" ? "y" : "x", C = a[f] === c[P], z = l[P] > d[P], R = l[P] < d[P];
2719
2719
  (a[f] === 1 && (!C && z || C && R) || a[f] !== 1 && (!C && R || C && z)) && (h = f === "x" ? M : L);
2720
2720
  }
2721
- const b = { x: l.x + m.x, y: l.y + m.y }, A = { x: d.x + v.x, y: d.y + v.y }, N = Math.max(Math.abs(b.x - h[0].x), Math.abs(A.x - h[0].x)), I = Math.max(Math.abs(b.y - h[0].y), Math.abs(A.y - h[0].y));
2722
- N >= I ? (y = (b.x + A.x) / 2, x = h[0].y) : (y = h[0].x, x = (b.y + A.y) / 2);
2721
+ const b = { x: l.x + p.x, y: l.y + p.y }, A = { x: d.x + v.x, y: d.y + v.y }, N = Math.max(Math.abs(b.x - h[0].x), Math.abs(A.x - h[0].x)), $ = Math.max(Math.abs(b.y - h[0].y), Math.abs(A.y - h[0].y));
2722
+ N >= $ ? (y = (b.x + A.x) / 2, x = h[0].y) : (y = h[0].x, x = (b.y + A.y) / 2);
2723
2723
  }
2724
- const S = { x: l.x + m.x, y: l.y + m.y }, _ = { x: d.x + v.x, y: d.y + v.y };
2724
+ const S = { x: l.x + p.x, y: l.y + p.y }, _ = { x: d.x + v.x, y: d.y + v.y };
2725
2725
  return [[
2726
2726
  e,
2727
2727
  // we only want to add the gapped source/target if they are different from the first/last point to avoid duplicates which can cause issues with the bends
@@ -2729,7 +2729,7 @@ function Md({ source: e, sourcePosition: t = G.Bottom, target: n, targetPosition
2729
2729
  ...h,
2730
2730
  ..._.x !== h[h.length - 1].x || _.y !== h[h.length - 1].y ? [_] : [],
2731
2731
  n
2732
- ], y, x, p, w];
2732
+ ], y, x, m, w];
2733
2733
  }
2734
2734
  function kd(e, t, n, r) {
2735
2735
  const o = Math.min(Ur(e, t) / 2, Ur(t, n) / 2, r), { x: i, y: s } = t;
@@ -2753,8 +2753,8 @@ function qn({ sourceX: e, sourceY: t, sourcePosition: n = G.Bottom, targetX: r,
2753
2753
  stepPosition: d
2754
2754
  });
2755
2755
  let x = `M${u[0].x} ${u[0].y}`;
2756
- for (let m = 1; m < u.length - 1; m++)
2757
- x += kd(u[m - 1], u[m], u[m + 1], s);
2756
+ for (let p = 1; p < u.length - 1; p++)
2757
+ x += kd(u[p - 1], u[p], u[p + 1], s);
2758
2758
  return x += `L${u[u.length - 1].x} ${u[u.length - 1].y}`, [x, f, g, h, y];
2759
2759
  }
2760
2760
  function Zr(e) {
@@ -2892,7 +2892,7 @@ function Zn(e, t, n, r = {}) {
2892
2892
  if (o.checkEquality && g === (h == null ? void 0 : h.internals.userNode))
2893
2893
  t.set(g.id, h);
2894
2894
  else {
2895
- const y = Tt(g, o.nodeOrigin), x = Ze(g.extent) ? g.extent : o.nodeExtent, m = Ue(y, x, Le(g));
2895
+ const y = Tt(g, o.nodeOrigin), x = Ze(g.extent) ? g.extent : o.nodeExtent, p = Ue(y, x, Le(g));
2896
2896
  h = {
2897
2897
  ...o.defaults,
2898
2898
  ...g,
@@ -2901,7 +2901,7 @@ function Zn(e, t, n, r = {}) {
2901
2901
  height: (u = g.measured) == null ? void 0 : u.height
2902
2902
  },
2903
2903
  internals: {
2904
- positionAbsolute: m,
2904
+ positionAbsolute: p,
2905
2905
  // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured
2906
2906
  handleBounds: Dd(g, h),
2907
2907
  z: Ti(g, a, o.zIndexMode),
@@ -2964,13 +2964,13 @@ function pr(e, t, n, r = [0, 0]) {
2964
2964
  }
2965
2965
  return i.size > 0 && i.forEach(({ expandedRect: c, parent: l }, d) => {
2966
2966
  var w, S;
2967
- const u = l.internals.positionAbsolute, f = Le(l), g = (w = l.origin) != null ? w : r, h = c.x < u.x ? Math.round(Math.abs(u.x - c.x)) : 0, y = c.y < u.y ? Math.round(Math.abs(u.y - c.y)) : 0, x = Math.max(f.width, Math.round(c.width)), m = Math.max(f.height, Math.round(c.height)), v = (x - f.width) * g[0], p = (m - f.height) * g[1];
2968
- (h > 0 || y > 0 || v || p) && (o.push({
2967
+ const u = l.internals.positionAbsolute, f = Le(l), g = (w = l.origin) != null ? w : r, h = c.x < u.x ? Math.round(Math.abs(u.x - c.x)) : 0, y = c.y < u.y ? Math.round(Math.abs(u.y - c.y)) : 0, x = Math.max(f.width, Math.round(c.width)), p = Math.max(f.height, Math.round(c.height)), v = (x - f.width) * g[0], m = (p - f.height) * g[1];
2968
+ (h > 0 || y > 0 || v || m) && (o.push({
2969
2969
  id: d,
2970
2970
  type: "position",
2971
2971
  position: {
2972
2972
  x: l.position.x - h + v,
2973
- y: l.position.y - y + p
2973
+ y: l.position.y - y + m
2974
2974
  }
2975
2975
  }), (S = n.get(d)) == null || S.forEach((_) => {
2976
2976
  e.some((E) => E.id === _.id) || o.push({
@@ -2987,7 +2987,7 @@ function pr(e, t, n, r = [0, 0]) {
2987
2987
  setAttributes: !0,
2988
2988
  dimensions: {
2989
2989
  width: x + (h ? g[0] * h - v : 0),
2990
- height: m + (y ? g[1] * y - p : 0)
2990
+ height: p + (y ? g[1] * y - m : 0)
2991
2991
  }
2992
2992
  });
2993
2993
  }), o;
@@ -3014,9 +3014,9 @@ function zd(e, t, n, r, o, i, s) {
3014
3014
  }
3015
3015
  const y = ur(g.nodeElement), x = h.measured.width !== y.width || h.measured.height !== y.height;
3016
3016
  if (!!(y.width && y.height && (x || !h.internals.handleBounds || g.force))) {
3017
- const v = g.nodeElement.getBoundingClientRect(), p = Ze(h.extent) ? h.extent : i;
3017
+ const v = g.nodeElement.getBoundingClientRect(), m = Ze(h.extent) ? h.extent : i;
3018
3018
  let { positionAbsolute: w } = h.internals;
3019
- h.parentId && h.extent === "parent" ? w = wi(w, y, t.get(h.parentId)) : p && (w = Ue(w, p, y));
3019
+ h.parentId && h.extent === "parent" ? w = wi(w, y, t.get(h.parentId)) : m && (w = Ue(w, m, y));
3020
3020
  const S = {
3021
3021
  ...h,
3022
3022
  measured: y,
@@ -3161,13 +3161,13 @@ function Bd({ dragItems: e, snapGrid: t, x: n, y: r }) {
3161
3161
  }
3162
3162
  function Vd({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, onDragStop: o }) {
3163
3163
  let i = { x: null, y: null }, s = 0, a = /* @__PURE__ */ new Map(), c = !1, l = { x: 0, y: 0 }, d = null, u = !1, f = null, g = !1, h = !1, y = null;
3164
- function x({ noDragClassName: v, handleSelector: p, domNode: w, isSelectable: S, nodeId: _, nodeClickDistance: E = 0 }) {
3164
+ function x({ noDragClassName: v, handleSelector: m, domNode: w, isSelectable: S, nodeId: _, nodeClickDistance: E = 0 }) {
3165
3165
  f = pe(w);
3166
- function $({ x: M, y: L }) {
3167
- const { nodeLookup: b, nodeExtent: A, snapGrid: N, snapToGrid: I, nodeOrigin: P, onNodeDrag: C, onSelectionDrag: z, onError: R, updateNodePositions: O } = t();
3166
+ function I({ x: M, y: L }) {
3167
+ const { nodeLookup: b, nodeExtent: A, snapGrid: N, snapToGrid: $, nodeOrigin: P, onNodeDrag: C, onSelectionDrag: z, onError: R, updateNodePositions: O } = t();
3168
3168
  i = { x: M, y: L };
3169
3169
  let F = !1;
3170
- const Y = a.size > 1, K = Y && A ? Kn(Dt(a)) : null, Z = Y && I ? Bd({
3170
+ const Y = a.size > 1, K = Y && A ? Kn(Dt(a)) : null, Z = Y && $ ? Bd({
3171
3171
  dragItems: a,
3172
3172
  snapGrid: N,
3173
3173
  x: M,
@@ -3177,7 +3177,7 @@ function Vd({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, o
3177
3177
  if (!b.has(X))
3178
3178
  continue;
3179
3179
  let W = { x: M - H.distance.x, y: L - H.distance.y };
3180
- I && (W = Z ? {
3180
+ $ && (W = Z ? {
3181
3181
  x: Math.round(W.x + Z.x),
3182
3182
  y: Math.round(W.y + Z.y)
3183
3183
  } : Lt(W, N));
@@ -3217,14 +3217,14 @@ function Vd({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, o
3217
3217
  c = !1, cancelAnimationFrame(s);
3218
3218
  return;
3219
3219
  }
3220
- const [N, I] = cr(l, d, b);
3221
- (N !== 0 || I !== 0) && (i.x = ((P = i.x) != null ? P : 0) - N / M[2], i.y = ((C = i.y) != null ? C : 0) - I / M[2], await L({ x: N, y: I }) && $(i)), s = requestAnimationFrame(T);
3220
+ const [N, $] = cr(l, d, b);
3221
+ (N !== 0 || $ !== 0) && (i.x = ((P = i.x) != null ? P : 0) - N / M[2], i.y = ((C = i.y) != null ? C : 0) - $ / M[2], await L({ x: N, y: $ }) && I(i)), s = requestAnimationFrame(T);
3222
3222
  }
3223
3223
  function B(M) {
3224
3224
  var Y;
3225
- const { nodeLookup: L, multiSelectionActive: b, nodesDraggable: A, transform: N, snapGrid: I, snapToGrid: P, selectNodesOnDrag: C, onNodeDragStart: z, onSelectionDragStart: R, unselectNodesAndEdges: O } = t();
3225
+ const { nodeLookup: L, multiSelectionActive: b, nodesDraggable: A, transform: N, snapGrid: $, snapToGrid: P, selectNodesOnDrag: C, onNodeDragStart: z, onSelectionDragStart: R, unselectNodesAndEdges: O } = t();
3226
3226
  u = !0, (!C || !S) && !b && _ && ((Y = L.get(_)) != null && Y.selected || O()), S && C && _ && (e == null || e(_));
3227
- const F = vt(M.sourceEvent, { transform: N, snapGrid: I, snapToGrid: P, containerBounds: d });
3227
+ const F = vt(M.sourceEvent, { transform: N, snapGrid: $, snapToGrid: P, containerBounds: d });
3228
3228
  if (i = F, a = Rd(L, A, F, _), a.size > 0 && (n || z || !_ && R)) {
3229
3229
  const [K, Z] = In({
3230
3230
  nodeId: _,
@@ -3235,17 +3235,17 @@ function Vd({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, o
3235
3235
  }
3236
3236
  }
3237
3237
  const k = Qo().clickDistance(E).on("start", (M) => {
3238
- const { domNode: L, nodeDragThreshold: b, transform: A, snapGrid: N, snapToGrid: I } = t();
3239
- d = (L == null ? void 0 : L.getBoundingClientRect()) || null, g = !1, h = !1, y = M.sourceEvent, b === 0 && B(M), i = vt(M.sourceEvent, { transform: A, snapGrid: N, snapToGrid: I, containerBounds: d }), l = Ee(M.sourceEvent, d);
3238
+ const { domNode: L, nodeDragThreshold: b, transform: A, snapGrid: N, snapToGrid: $ } = t();
3239
+ d = (L == null ? void 0 : L.getBoundingClientRect()) || null, g = !1, h = !1, y = M.sourceEvent, b === 0 && B(M), i = vt(M.sourceEvent, { transform: A, snapGrid: N, snapToGrid: $, containerBounds: d }), l = Ee(M.sourceEvent, d);
3240
3240
  }).on("drag", (M) => {
3241
- const { autoPanOnNodeDrag: L, transform: b, snapGrid: A, snapToGrid: N, nodeDragThreshold: I, nodeLookup: P } = t(), C = vt(M.sourceEvent, { transform: b, snapGrid: A, snapToGrid: N, containerBounds: d });
3241
+ const { autoPanOnNodeDrag: L, transform: b, snapGrid: A, snapToGrid: N, nodeDragThreshold: $, nodeLookup: P } = t(), C = vt(M.sourceEvent, { transform: b, snapGrid: A, snapToGrid: N, containerBounds: d });
3242
3242
  if (y = M.sourceEvent, (M.sourceEvent.type === "touchmove" && M.sourceEvent.touches.length > 1 || // if user deletes a node while dragging, we need to abort the drag to prevent errors
3243
3243
  _ && !P.has(_)) && (g = !0), !g) {
3244
3244
  if (!c && L && u && (c = !0, T()), !u) {
3245
3245
  const z = Ee(M.sourceEvent, d), R = z.x - l.x, O = z.y - l.y;
3246
- Math.sqrt(R * R + O * O) > I && B(M);
3246
+ Math.sqrt(R * R + O * O) > $ && B(M);
3247
3247
  }
3248
- (i.x !== C.xSnapped || i.y !== C.ySnapped) && a && u && (l = Ee(M.sourceEvent, d), $(C));
3248
+ (i.x !== C.xSnapped || i.y !== C.ySnapped) && a && u && (l = Ee(M.sourceEvent, d), I(C));
3249
3249
  }
3250
3250
  }).on("end", (M) => {
3251
3251
  if (!u || g) {
@@ -3255,27 +3255,27 @@ function Vd({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, o
3255
3255
  if (c = !1, u = !1, cancelAnimationFrame(s), a.size > 0) {
3256
3256
  const { nodeLookup: L, updateNodePositions: b, onNodeDragStop: A, onSelectionDragStop: N } = t();
3257
3257
  if (h && (b(a, !1), h = !1), o || A || !_ && N) {
3258
- const [I, P] = In({
3258
+ const [$, P] = In({
3259
3259
  nodeId: _,
3260
3260
  dragItems: a,
3261
3261
  nodeLookup: L,
3262
3262
  dragging: !1
3263
3263
  });
3264
- o == null || o(M.sourceEvent, a, I, P), A == null || A(M.sourceEvent, I, P), _ || N == null || N(M.sourceEvent, P);
3264
+ o == null || o(M.sourceEvent, a, $, P), A == null || A(M.sourceEvent, $, P), _ || N == null || N(M.sourceEvent, P);
3265
3265
  }
3266
3266
  }
3267
3267
  }).filter((M) => {
3268
3268
  const L = M.target;
3269
- return !M.button && (!v || !eo(L, `.${v}`, w)) && (!p || eo(L, p, w));
3269
+ return !M.button && (!v || !eo(L, `.${v}`, w)) && (!m || eo(L, m, w));
3270
3270
  });
3271
3271
  f.call(k);
3272
3272
  }
3273
- function m() {
3273
+ function p() {
3274
3274
  f == null || f.on(".drag", null);
3275
3275
  }
3276
3276
  return {
3277
3277
  update: x,
3278
- destroy: m
3278
+ destroy: p
3279
3279
  };
3280
3280
  }
3281
3281
  function Fd(e, t, n) {
@@ -3299,8 +3299,8 @@ function Yd(e, t, n, r) {
3299
3299
  for (const h of g) {
3300
3300
  if (r.nodeId === h.nodeId && r.type === h.type && r.id === h.id)
3301
3301
  continue;
3302
- const { x: y, y: x } = Qe(f, h, h.position, !0), m = Math.sqrt(Math.pow(y - e.x, 2) + Math.pow(x - e.y, 2));
3303
- m > t || (m < i ? (o = [{ ...h, x: y, y: x }], i = m) : m === i && o.push({ ...h, x: y, y: x }));
3302
+ const { x: y, y: x } = Qe(f, h, h.position, !0), p = Math.sqrt(Math.pow(y - e.x, 2) + Math.pow(x - e.y, 2));
3303
+ p > t || (p < i ? (o = [{ ...h, x: y, y: x }], i = p) : p === i && o.push({ ...h, x: y, y: x }));
3304
3304
  }
3305
3305
  }
3306
3306
  if (!o.length)
@@ -3327,15 +3327,15 @@ function Wd(e, t) {
3327
3327
  return t ? n = !0 : e && !t && (n = !1), n;
3328
3328
  }
3329
3329
  const Hi = () => !0;
3330
- function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: c, lib: l, autoPanOnConnect: d, flowId: u, panBy: f, cancelConnection: g, onConnectStart: h, onConnect: y, onConnectEnd: x, isValidConnection: m = Hi, onReconnectEnd: v, updateConnection: p, getTransform: w, getFromHandle: S, autoPanSpeed: _, dragThreshold: E = 1, handleDomNode: $ }) {
3330
+ function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o, edgeUpdaterType: i, isTarget: s, domNode: a, nodeLookup: c, lib: l, autoPanOnConnect: d, flowId: u, panBy: f, cancelConnection: g, onConnectStart: h, onConnect: y, onConnectEnd: x, isValidConnection: p = Hi, onReconnectEnd: v, updateConnection: m, getTransform: w, getFromHandle: S, autoPanSpeed: _, dragThreshold: E = 1, handleDomNode: I }) {
3331
3331
  const T = Ni(e.target);
3332
3332
  let B = 0, k;
3333
- const { x: M, y: L } = Ee(e), b = zi(i, $), A = a == null ? void 0 : a.getBoundingClientRect();
3333
+ const { x: M, y: L } = Ee(e), b = zi(i, I), A = a == null ? void 0 : a.getBoundingClientRect();
3334
3334
  let N = !1;
3335
3335
  if (!A || !b)
3336
3336
  return;
3337
- const I = Oi(o, b, r, c, t);
3338
- if (!I)
3337
+ const $ = Oi(o, b, r, c, t);
3338
+ if (!$)
3339
3339
  return;
3340
3340
  let P = Ee(e, A), C = !1, z = null, R = !1, O = null;
3341
3341
  function F() {
@@ -3345,10 +3345,10 @@ function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o,
3345
3345
  f({ x: V, y: J }), B = requestAnimationFrame(F);
3346
3346
  }
3347
3347
  const Y = {
3348
- ...I,
3348
+ ...$,
3349
3349
  nodeId: o,
3350
3350
  type: b,
3351
- position: I.position
3351
+ position: $.position
3352
3352
  }, K = c.get(o);
3353
3353
  let X = {
3354
3354
  inProgress: !0,
@@ -3364,7 +3364,7 @@ function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o,
3364
3364
  pointer: P
3365
3365
  };
3366
3366
  function H() {
3367
- N = !0, p(X), h == null || h(e, { nodeId: o, handleId: r, handleType: b });
3367
+ N = !0, m(X), h == null || h(e, { nodeId: o, handleId: r, handleType: b });
3368
3368
  }
3369
3369
  E === 0 && H();
3370
3370
  function W(V) {
@@ -3386,7 +3386,7 @@ function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o,
3386
3386
  fromNodeId: o,
3387
3387
  fromHandleId: r,
3388
3388
  fromType: s ? "target" : "source",
3389
- isValidConnection: m,
3389
+ isValidConnection: p,
3390
3390
  doc: T,
3391
3391
  lib: l,
3392
3392
  flowId: u,
@@ -3403,7 +3403,7 @@ function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o,
3403
3403
  toNode: U.toHandle ? c.get(U.toHandle.nodeId) : null,
3404
3404
  pointer: P
3405
3405
  };
3406
- p(re), X = re;
3406
+ m(re), X = re;
3407
3407
  }
3408
3408
  function Q(V) {
3409
3409
  if (!("touches" in V && V.touches.length > 0)) {
@@ -3421,27 +3421,27 @@ function Gd(e, { connectionMode: t, connectionRadius: n, handleId: r, nodeId: o,
3421
3421
  T.addEventListener("mousemove", W), T.addEventListener("mouseup", Q), T.addEventListener("touchmove", W), T.addEventListener("touchend", Q);
3422
3422
  }
3423
3423
  function Ri(e, { handle: t, connectionMode: n, fromNodeId: r, fromHandleId: o, fromType: i, doc: s, lib: a, flowId: c, isValidConnection: l = Hi, nodeLookup: d }) {
3424
- const u = i === "target", f = t ? s.querySelector(`.${a}-flow__handle[data-id="${c}-${t == null ? void 0 : t.nodeId}-${t == null ? void 0 : t.id}-${t == null ? void 0 : t.type}"]`) : null, { x: g, y: h } = Ee(e), y = s.elementFromPoint(g, h), x = y != null && y.classList.contains(`${a}-flow__handle`) ? y : f, m = {
3424
+ const u = i === "target", f = t ? s.querySelector(`.${a}-flow__handle[data-id="${c}-${t == null ? void 0 : t.nodeId}-${t == null ? void 0 : t.id}-${t == null ? void 0 : t.type}"]`) : null, { x: g, y: h } = Ee(e), y = s.elementFromPoint(g, h), x = y != null && y.classList.contains(`${a}-flow__handle`) ? y : f, p = {
3425
3425
  handleDomNode: x,
3426
3426
  isValid: !1,
3427
3427
  connection: null,
3428
3428
  toHandle: null
3429
3429
  };
3430
3430
  if (x) {
3431
- const v = zi(void 0, x), p = x.getAttribute("data-nodeid"), w = x.getAttribute("data-handleid"), S = x.classList.contains("connectable"), _ = x.classList.contains("connectableend");
3432
- if (!p || !v)
3433
- return m;
3431
+ const v = zi(void 0, x), m = x.getAttribute("data-nodeid"), w = x.getAttribute("data-handleid"), S = x.classList.contains("connectable"), _ = x.classList.contains("connectableend");
3432
+ if (!m || !v)
3433
+ return p;
3434
3434
  const E = {
3435
- source: u ? p : r,
3435
+ source: u ? m : r,
3436
3436
  sourceHandle: u ? w : o,
3437
- target: u ? r : p,
3437
+ target: u ? r : m,
3438
3438
  targetHandle: u ? o : w
3439
3439
  };
3440
- m.connection = E;
3441
- const T = S && _ && (n === at.Strict ? u && v === "source" || !u && v === "target" : p !== r || w !== o);
3442
- m.isValid = T && l(E), m.toHandle = Oi(p, v, w, d, n, !0);
3440
+ p.connection = E;
3441
+ const T = S && _ && (n === at.Strict ? u && v === "source" || !u && v === "target" : m !== r || w !== o);
3442
+ p.isValid = T && l(E), p.toHandle = Oi(m, v, w, d, n, !0);
3443
3443
  }
3444
- return m;
3444
+ return p;
3445
3445
  }
3446
3446
  const Qn = {
3447
3447
  onPointerDown: Gd,
@@ -3450,30 +3450,30 @@ const Qn = {
3450
3450
  function Kd({ domNode: e, panZoom: t, getTransform: n, getViewScale: r }) {
3451
3451
  const o = pe(e);
3452
3452
  function i({ translateExtent: a, width: c, height: l, zoomStep: d = 1, pannable: u = !0, zoomable: f = !0, inversePan: g = !1 }) {
3453
- const h = (p) => {
3454
- if (p.sourceEvent.type !== "wheel" || !t)
3453
+ const h = (m) => {
3454
+ if (m.sourceEvent.type !== "wheel" || !t)
3455
3455
  return;
3456
- const w = n(), S = p.sourceEvent.ctrlKey && At() ? 10 : 1, _ = -p.sourceEvent.deltaY * (p.sourceEvent.deltaMode === 1 ? 0.05 : p.sourceEvent.deltaMode ? 1 : 2e-3) * d, E = w[2] * Math.pow(2, _ * S);
3456
+ const w = n(), S = m.sourceEvent.ctrlKey && At() ? 10 : 1, _ = -m.sourceEvent.deltaY * (m.sourceEvent.deltaMode === 1 ? 0.05 : m.sourceEvent.deltaMode ? 1 : 2e-3) * d, E = w[2] * Math.pow(2, _ * S);
3457
3457
  t.scaleTo(E);
3458
3458
  };
3459
3459
  let y = [0, 0];
3460
- const x = (p) => {
3460
+ const x = (m) => {
3461
3461
  var w, S;
3462
- (p.sourceEvent.type === "mousedown" || p.sourceEvent.type === "touchstart") && (y = [
3463
- (w = p.sourceEvent.clientX) != null ? w : p.sourceEvent.touches[0].clientX,
3464
- (S = p.sourceEvent.clientY) != null ? S : p.sourceEvent.touches[0].clientY
3462
+ (m.sourceEvent.type === "mousedown" || m.sourceEvent.type === "touchstart") && (y = [
3463
+ (w = m.sourceEvent.clientX) != null ? w : m.sourceEvent.touches[0].clientX,
3464
+ (S = m.sourceEvent.clientY) != null ? S : m.sourceEvent.touches[0].clientY
3465
3465
  ]);
3466
- }, m = (p) => {
3466
+ }, p = (m) => {
3467
3467
  var B, k;
3468
3468
  const w = n();
3469
- if (p.sourceEvent.type !== "mousemove" && p.sourceEvent.type !== "touchmove" || !t)
3469
+ if (m.sourceEvent.type !== "mousemove" && m.sourceEvent.type !== "touchmove" || !t)
3470
3470
  return;
3471
3471
  const S = [
3472
- (B = p.sourceEvent.clientX) != null ? B : p.sourceEvent.touches[0].clientX,
3473
- (k = p.sourceEvent.clientY) != null ? k : p.sourceEvent.touches[0].clientY
3472
+ (B = m.sourceEvent.clientX) != null ? B : m.sourceEvent.touches[0].clientX,
3473
+ (k = m.sourceEvent.clientY) != null ? k : m.sourceEvent.touches[0].clientY
3474
3474
  ], _ = [S[0] - y[0], S[1] - y[1]];
3475
3475
  y = S;
3476
- const E = r() * Math.max(w[2], Math.log(w[2])) * (g ? -1 : 1), $ = {
3476
+ const E = r() * Math.max(w[2], Math.log(w[2])) * (g ? -1 : 1), I = {
3477
3477
  x: w[0] - _[0] * E,
3478
3478
  y: w[1] - _[1] * E
3479
3479
  }, T = [
@@ -3481,11 +3481,11 @@ function Kd({ domNode: e, panZoom: t, getTransform: n, getViewScale: r }) {
3481
3481
  [c, l]
3482
3482
  ];
3483
3483
  t.setViewportConstrained({
3484
- x: $.x,
3485
- y: $.y,
3484
+ x: I.x,
3485
+ y: I.y,
3486
3486
  zoom: w[2]
3487
3487
  }, T, a);
3488
- }, v = fi().on("start", x).on("zoom", u ? m : null).on("zoom.wheel", f ? h : null);
3488
+ }, v = fi().on("start", x).on("zoom", u ? p : null).on("zoom.wheel", f ? h : null);
3489
3489
  o.call(v, {});
3490
3490
  }
3491
3491
  function s() {
@@ -3516,7 +3516,7 @@ function Ud({ zoomPanValues: e, noWheelClassName: t, d3Selection: n, d3Zoom: r,
3516
3516
  d.preventDefault(), d.stopImmediatePropagation();
3517
3517
  const u = n.property("__zoom").k || 1;
3518
3518
  if (d.ctrlKey && s) {
3519
- const x = ve(d), m = Vi(d), v = u * Math.pow(2, m);
3519
+ const x = ve(d), p = Vi(d), v = u * Math.pow(2, p);
3520
3520
  r.scaleTo(n, v, x, d);
3521
3521
  return;
3522
3522
  }
@@ -3614,8 +3614,8 @@ function tf({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
3614
3614
  u == null || u.interpolate((M == null ? void 0 : M.interpolate) === "linear" ? bt : Qt).transform(Pn(f, M == null ? void 0 : M.duration, M == null ? void 0 : M.ease, () => L(!0)), k);
3615
3615
  }) : !1;
3616
3616
  }
3617
- function x({ noWheelClassName: k, noPanClassName: M, onPaneContextMenu: L, userSelectionActive: b, panOnScroll: A, panOnDrag: N, panOnScrollMode: I, panOnScrollSpeed: P, preventScrolling: C, zoomOnPinch: z, zoomOnScroll: R, zoomOnDoubleClick: O, zoomActivationKeyPressed: F, lib: Y, onTransformChange: K, connectionInProgress: Z, paneClickDistance: X, selectionOnDrag: H }) {
3618
- b && !l.isZoomingOrPanning && m();
3617
+ function x({ noWheelClassName: k, noPanClassName: M, onPaneContextMenu: L, userSelectionActive: b, panOnScroll: A, panOnDrag: N, panOnScrollMode: $, panOnScrollSpeed: P, preventScrolling: C, zoomOnPinch: z, zoomOnScroll: R, zoomOnDoubleClick: O, zoomActivationKeyPressed: F, lib: Y, onTransformChange: K, connectionInProgress: Z, paneClickDistance: X, selectionOnDrag: H }) {
3618
+ b && !l.isZoomingOrPanning && p();
3619
3619
  const W = A && !F && !b;
3620
3620
  u.clickDistance(H ? 1 / 0 : !Se(X) || X < 0 ? 0 : X);
3621
3621
  const Q = W ? Ud({
@@ -3623,7 +3623,7 @@ function tf({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
3623
3623
  noWheelClassName: k,
3624
3624
  d3Selection: f,
3625
3625
  d3Zoom: u,
3626
- panOnScrollMode: I,
3626
+ panOnScrollMode: $,
3627
3627
  panOnScrollSpeed: P,
3628
3628
  zoomOnPinch: z,
3629
3629
  onPanZoomStart: s,
@@ -3673,14 +3673,14 @@ function tf({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
3673
3673
  });
3674
3674
  u.filter(q), O ? f.on("dblclick.zoom", h) : f.on("dblclick.zoom", null);
3675
3675
  }
3676
- function m() {
3676
+ function p() {
3677
3677
  u.on("zoom", null);
3678
3678
  }
3679
3679
  async function v(k, M, L) {
3680
3680
  const b = $n(k), A = u == null ? void 0 : u.constrain()(b, M, L);
3681
3681
  return A && await y(A), A;
3682
3682
  }
3683
- async function p(k, M) {
3683
+ async function m(k, M) {
3684
3684
  const L = $n(k);
3685
3685
  return await y(L, M), L;
3686
3686
  }
@@ -3704,7 +3704,7 @@ function tf({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
3704
3704
  u == null || u.interpolate((M == null ? void 0 : M.interpolate) === "linear" ? bt : Qt).scaleBy(Pn(f, M == null ? void 0 : M.duration, M == null ? void 0 : M.ease, () => L(!0)), k);
3705
3705
  }) : !1;
3706
3706
  }
3707
- function $(k) {
3707
+ function I(k) {
3708
3708
  u == null || u.scaleExtent(k);
3709
3709
  }
3710
3710
  function T(k) {
@@ -3716,13 +3716,13 @@ function tf({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
3716
3716
  }
3717
3717
  return {
3718
3718
  update: x,
3719
- destroy: m,
3720
- setViewport: p,
3719
+ destroy: p,
3720
+ setViewport: m,
3721
3721
  setViewportConstrained: v,
3722
3722
  getViewport: S,
3723
3723
  scaleTo: _,
3724
3724
  scaleBy: E,
3725
- setScaleExtent: $,
3725
+ setScaleExtent: I,
3726
3726
  setTranslateExtent: T,
3727
3727
  syncViewport: w,
3728
3728
  setClickDistance: B
@@ -3759,49 +3759,49 @@ function no(e, t) {
3759
3759
  }
3760
3760
  function rf(e, t, n, r, o, i, s, a) {
3761
3761
  let { affectsX: c, affectsY: l } = t;
3762
- const { isHorizontal: d, isVertical: u } = t, f = d && u, { xSnapped: g, ySnapped: h } = n, { minWidth: y, maxWidth: x, minHeight: m, maxHeight: v } = r, { x: p, y: w, width: S, height: _, aspectRatio: E } = e;
3763
- let $ = Math.floor(d ? g - e.pointerX : 0), T = Math.floor(u ? h - e.pointerY : 0);
3764
- const B = S + (c ? -$ : $), k = _ + (l ? -T : T), M = -i[0] * S, L = -i[1] * _;
3765
- let b = Wt(B, y, x), A = Wt(k, m, v);
3762
+ const { isHorizontal: d, isVertical: u } = t, f = d && u, { xSnapped: g, ySnapped: h } = n, { minWidth: y, maxWidth: x, minHeight: p, maxHeight: v } = r, { x: m, y: w, width: S, height: _, aspectRatio: E } = e;
3763
+ let I = Math.floor(d ? g - e.pointerX : 0), T = Math.floor(u ? h - e.pointerY : 0);
3764
+ const B = S + (c ? -I : I), k = _ + (l ? -T : T), M = -i[0] * S, L = -i[1] * _;
3765
+ let b = Wt(B, y, x), A = Wt(k, p, v);
3766
3766
  if (s) {
3767
3767
  let P = 0, C = 0;
3768
- c && $ < 0 ? P = Oe(p + $ + M, s[0][0]) : !c && $ > 0 && (P = ze(p + B + M, s[1][0])), l && T < 0 ? C = Oe(w + T + L, s[0][1]) : !l && T > 0 && (C = ze(w + k + L, s[1][1])), b = Math.max(b, P), A = Math.max(A, C);
3768
+ c && I < 0 ? P = Oe(m + I + M, s[0][0]) : !c && I > 0 && (P = ze(m + B + M, s[1][0])), l && T < 0 ? C = Oe(w + T + L, s[0][1]) : !l && T > 0 && (C = ze(w + k + L, s[1][1])), b = Math.max(b, P), A = Math.max(A, C);
3769
3769
  }
3770
3770
  if (a) {
3771
3771
  let P = 0, C = 0;
3772
- c && $ > 0 ? P = ze(p + $, a[0][0]) : !c && $ < 0 && (P = Oe(p + B, a[1][0])), l && T > 0 ? C = ze(w + T, a[0][1]) : !l && T < 0 && (C = Oe(w + k, a[1][1])), b = Math.max(b, P), A = Math.max(A, C);
3772
+ c && I > 0 ? P = ze(m + I, a[0][0]) : !c && I < 0 && (P = Oe(m + B, a[1][0])), l && T > 0 ? C = ze(w + T, a[0][1]) : !l && T < 0 && (C = Oe(w + k, a[1][1])), b = Math.max(b, P), A = Math.max(A, C);
3773
3773
  }
3774
3774
  if (o) {
3775
3775
  if (d) {
3776
- const P = Wt(B / E, m, v) * E;
3776
+ const P = Wt(B / E, p, v) * E;
3777
3777
  if (b = Math.max(b, P), s) {
3778
3778
  let C = 0;
3779
- !c && !l || c && !l && f ? C = ze(w + L + B / E, s[1][1]) * E : C = Oe(w + L + (c ? $ : -$) / E, s[0][1]) * E, b = Math.max(b, C);
3779
+ !c && !l || c && !l && f ? C = ze(w + L + B / E, s[1][1]) * E : C = Oe(w + L + (c ? I : -I) / E, s[0][1]) * E, b = Math.max(b, C);
3780
3780
  }
3781
3781
  if (a) {
3782
3782
  let C = 0;
3783
- !c && !l || c && !l && f ? C = Oe(w + B / E, a[1][1]) * E : C = ze(w + (c ? $ : -$) / E, a[0][1]) * E, b = Math.max(b, C);
3783
+ !c && !l || c && !l && f ? C = Oe(w + B / E, a[1][1]) * E : C = ze(w + (c ? I : -I) / E, a[0][1]) * E, b = Math.max(b, C);
3784
3784
  }
3785
3785
  }
3786
3786
  if (u) {
3787
3787
  const P = Wt(k * E, y, x) / E;
3788
3788
  if (A = Math.max(A, P), s) {
3789
3789
  let C = 0;
3790
- !c && !l || l && !c && f ? C = ze(p + k * E + M, s[1][0]) / E : C = Oe(p + (l ? T : -T) * E + M, s[0][0]) / E, A = Math.max(A, C);
3790
+ !c && !l || l && !c && f ? C = ze(m + k * E + M, s[1][0]) / E : C = Oe(m + (l ? T : -T) * E + M, s[0][0]) / E, A = Math.max(A, C);
3791
3791
  }
3792
3792
  if (a) {
3793
3793
  let C = 0;
3794
- !c && !l || l && !c && f ? C = Oe(p + k * E, a[1][0]) / E : C = ze(p + (l ? T : -T) * E, a[0][0]) / E, A = Math.max(A, C);
3794
+ !c && !l || l && !c && f ? C = Oe(m + k * E, a[1][0]) / E : C = ze(m + (l ? T : -T) * E, a[0][0]) / E, A = Math.max(A, C);
3795
3795
  }
3796
3796
  }
3797
3797
  }
3798
- T = T + (T < 0 ? A : -A), $ = $ + ($ < 0 ? b : -b), o && (f ? B > k * E ? T = (no(c, l) ? -$ : $) / E : $ = (no(c, l) ? -T : T) * E : d ? (T = $ / E, l = c) : ($ = T * E, c = l));
3799
- const N = c ? p + $ : p, I = l ? w + T : w;
3798
+ T = T + (T < 0 ? A : -A), I = I + (I < 0 ? b : -b), o && (f ? B > k * E ? T = (no(c, l) ? -I : I) / E : I = (no(c, l) ? -T : T) * E : d ? (T = I / E, l = c) : (I = T * E, c = l));
3799
+ const N = c ? m + I : m, $ = l ? w + T : w;
3800
3800
  return {
3801
- width: S + (c ? -$ : $),
3801
+ width: S + (c ? -I : I),
3802
3802
  height: _ + (l ? -T : T),
3803
- x: i[0] * $ * (c ? -1 : 1) + N,
3804
- y: i[1] * T * (l ? -1 : 1) + I
3803
+ x: i[0] * I * (c ? -1 : 1) + N,
3804
+ y: i[1] * T * (l ? -1 : 1) + $
3805
3805
  };
3806
3806
  }
3807
3807
  const Fi = { width: 0, height: 0, x: 0, y: 0 }, of = {
@@ -3832,53 +3832,53 @@ function af({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: o })
3832
3832
  keepAspectRatio: !1
3833
3833
  };
3834
3834
  function a({ controlPosition: l, boundaries: d, keepAspectRatio: u, resizeDirection: f, onResizeStart: g, onResize: h, onResizeEnd: y, shouldResize: x }) {
3835
- let m = { ...Fi }, v = { ...of };
3835
+ let p = { ...Fi }, v = { ...of };
3836
3836
  s = {
3837
3837
  boundaries: d,
3838
3838
  resizeDirection: f,
3839
3839
  keepAspectRatio: u,
3840
3840
  controlDirection: to(l)
3841
3841
  };
3842
- let p, w = null, S = [], _, E, $, T = !1;
3842
+ let m, w = null, S = [], _, E, I, T = !1;
3843
3843
  const B = Qo().on("start", (k) => {
3844
3844
  var z, R, O, F, Y, K;
3845
- const { nodeLookup: M, transform: L, snapGrid: b, snapToGrid: A, nodeOrigin: N, paneDomNode: I } = n();
3846
- if (p = M.get(t), !p)
3845
+ const { nodeLookup: M, transform: L, snapGrid: b, snapToGrid: A, nodeOrigin: N, paneDomNode: $ } = n();
3846
+ if (m = M.get(t), !m)
3847
3847
  return;
3848
- w = (z = I == null ? void 0 : I.getBoundingClientRect()) != null ? z : null;
3848
+ w = (z = $ == null ? void 0 : $.getBoundingClientRect()) != null ? z : null;
3849
3849
  const { xSnapped: P, ySnapped: C } = vt(k.sourceEvent, {
3850
3850
  transform: L,
3851
3851
  snapGrid: b,
3852
3852
  snapToGrid: A,
3853
3853
  containerBounds: w
3854
3854
  });
3855
- m = {
3856
- width: (R = p.measured.width) != null ? R : 0,
3857
- height: (O = p.measured.height) != null ? O : 0,
3858
- x: (F = p.position.x) != null ? F : 0,
3859
- y: (Y = p.position.y) != null ? Y : 0
3855
+ p = {
3856
+ width: (R = m.measured.width) != null ? R : 0,
3857
+ height: (O = m.measured.height) != null ? O : 0,
3858
+ x: (F = m.position.x) != null ? F : 0,
3859
+ y: (Y = m.position.y) != null ? Y : 0
3860
3860
  }, v = {
3861
- ...m,
3861
+ ...p,
3862
3862
  pointerX: P,
3863
3863
  pointerY: C,
3864
- aspectRatio: m.width / m.height
3865
- }, _ = void 0, E = Ze(p.extent) ? p.extent : void 0, p.parentId && (p.extent === "parent" || p.expandParent) && (_ = M.get(p.parentId)), _ && p.extent === "parent" && (E = [
3864
+ aspectRatio: p.width / p.height
3865
+ }, _ = void 0, E = Ze(m.extent) ? m.extent : void 0, m.parentId && (m.extent === "parent" || m.expandParent) && (_ = M.get(m.parentId)), _ && m.extent === "parent" && (E = [
3866
3866
  [0, 0],
3867
3867
  [_.measured.width, _.measured.height]
3868
- ]), S = [], $ = void 0;
3868
+ ]), S = [], I = void 0;
3869
3869
  for (const [Z, X] of M)
3870
3870
  if (X.parentId === t && (S.push({
3871
3871
  id: Z,
3872
3872
  position: { ...X.position },
3873
3873
  extent: X.extent
3874
3874
  }), X.extent === "parent" || X.expandParent)) {
3875
- const H = sf(X, p, (K = X.origin) != null ? K : N);
3876
- $ ? $ = [
3877
- [Math.min(H[0][0], $[0][0]), Math.min(H[0][1], $[0][1])],
3878
- [Math.max(H[1][0], $[1][0]), Math.max(H[1][1], $[1][1])]
3879
- ] : $ = H;
3875
+ const H = sf(X, m, (K = X.origin) != null ? K : N);
3876
+ I ? I = [
3877
+ [Math.min(H[0][0], I[0][0]), Math.min(H[0][1], I[0][1])],
3878
+ [Math.max(H[1][0], I[1][0]), Math.max(H[1][1], I[1][1])]
3879
+ ] : I = H;
3880
3880
  }
3881
- g == null || g(k, { ...m });
3881
+ g == null || g(k, { ...p });
3882
3882
  }).on("drag", (k) => {
3883
3883
  var j, re, te;
3884
3884
  const { transform: M, snapGrid: L, snapToGrid: b, nodeOrigin: A } = n(), N = vt(k.sourceEvent, {
@@ -3886,37 +3886,37 @@ function af({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: o })
3886
3886
  snapGrid: L,
3887
3887
  snapToGrid: b,
3888
3888
  containerBounds: w
3889
- }), I = [];
3890
- if (!p)
3889
+ }), $ = [];
3890
+ if (!m)
3891
3891
  return;
3892
- const { x: P, y: C, width: z, height: R } = m, O = {}, F = (j = p.origin) != null ? j : A, { width: Y, height: K, x: Z, y: X } = rf(v, s.controlDirection, N, s.boundaries, s.keepAspectRatio, F, E, $), H = Y !== z, W = K !== R, Q = Z !== P && H, V = X !== C && W;
3892
+ const { x: P, y: C, width: z, height: R } = p, O = {}, F = (j = m.origin) != null ? j : A, { width: Y, height: K, x: Z, y: X } = rf(v, s.controlDirection, N, s.boundaries, s.keepAspectRatio, F, E, I), H = Y !== z, W = K !== R, Q = Z !== P && H, V = X !== C && W;
3893
3893
  if (!Q && !V && !H && !W)
3894
3894
  return;
3895
- if ((Q || V || F[0] === 1 || F[1] === 1) && (O.x = Q ? Z : m.x, O.y = V ? X : m.y, m.x = O.x, m.y = O.y, S.length > 0)) {
3895
+ if ((Q || V || F[0] === 1 || F[1] === 1) && (O.x = Q ? Z : p.x, O.y = V ? X : p.y, p.x = O.x, p.y = O.y, S.length > 0)) {
3896
3896
  const oe = Z - P, de = X - C;
3897
3897
  for (const fe of S)
3898
3898
  fe.position = {
3899
3899
  x: fe.position.x - oe + F[0] * (Y - z),
3900
3900
  y: fe.position.y - de + F[1] * (K - R)
3901
- }, I.push(fe);
3901
+ }, $.push(fe);
3902
3902
  }
3903
- if ((H || W) && (O.width = H && (!s.resizeDirection || s.resizeDirection === "horizontal") ? Y : m.width, O.height = W && (!s.resizeDirection || s.resizeDirection === "vertical") ? K : m.height, m.width = O.width, m.height = O.height), _ && p.expandParent) {
3903
+ if ((H || W) && (O.width = H && (!s.resizeDirection || s.resizeDirection === "horizontal") ? Y : p.width, O.height = W && (!s.resizeDirection || s.resizeDirection === "vertical") ? K : p.height, p.width = O.width, p.height = O.height), _ && m.expandParent) {
3904
3904
  const oe = F[0] * ((re = O.width) != null ? re : 0);
3905
- O.x && O.x < oe && (m.x = oe, v.x = v.x - (O.x - oe));
3905
+ O.x && O.x < oe && (p.x = oe, v.x = v.x - (O.x - oe));
3906
3906
  const de = F[1] * ((te = O.height) != null ? te : 0);
3907
- O.y && O.y < de && (m.y = de, v.y = v.y - (O.y - de));
3907
+ O.y && O.y < de && (p.y = de, v.y = v.y - (O.y - de));
3908
3908
  }
3909
3909
  const J = nf({
3910
- width: m.width,
3910
+ width: p.width,
3911
3911
  prevWidth: z,
3912
- height: m.height,
3912
+ height: p.height,
3913
3913
  prevHeight: R,
3914
3914
  affectsX: s.controlDirection.affectsX,
3915
3915
  affectsY: s.controlDirection.affectsY
3916
- }), U = { ...m, direction: J };
3917
- (x == null ? void 0 : x(k, U)) !== !1 && (T = !0, h == null || h(k, U), r(O, I));
3916
+ }), U = { ...p, direction: J };
3917
+ (x == null ? void 0 : x(k, U)) !== !1 && (T = !0, h == null || h(k, U), r(O, $));
3918
3918
  }).on("end", (k) => {
3919
- T && (y == null || y(k, { ...m }), o == null || o({ ...m }), T = !1);
3919
+ T && (y == null || y(k, { ...p }), o == null || o({ ...p }), T = !1);
3920
3920
  });
3921
3921
  i.call(B);
3922
3922
  }
@@ -4012,16 +4012,16 @@ function uf() {
4012
4012
  x = s({
4013
4013
  inst: { value: y, getSnapshot: h }
4014
4014
  });
4015
- var m = x[0].inst, v = x[1];
4015
+ var p = x[0].inst, v = x[1];
4016
4016
  return c(
4017
4017
  function() {
4018
- m.value = y, m.getSnapshot = h, n(m) && v({ inst: m });
4018
+ p.value = y, p.getSnapshot = h, n(p) && v({ inst: p });
4019
4019
  },
4020
4020
  [g, y, h]
4021
4021
  ), a(
4022
4022
  function() {
4023
- return n(m) && v({ inst: m }), g(function() {
4024
- n(m) && v({ inst: m });
4023
+ return n(p) && v({ inst: p }), g(function() {
4024
+ n(p) && v({ inst: p });
4025
4025
  });
4026
4026
  },
4027
4027
  [g]
@@ -4075,26 +4075,26 @@ function df() {
4075
4075
  } else y = h.current;
4076
4076
  h = a(
4077
4077
  function() {
4078
- function m(_) {
4078
+ function p(_) {
4079
4079
  if (!v) {
4080
- if (v = !0, p = _, _ = f(_), g !== void 0 && y.hasValue) {
4080
+ if (v = !0, m = _, _ = f(_), g !== void 0 && y.hasValue) {
4081
4081
  var E = y.value;
4082
4082
  if (g(E, _))
4083
4083
  return w = E;
4084
4084
  }
4085
4085
  return w = _;
4086
4086
  }
4087
- if (E = w, r(p, _)) return E;
4088
- var $ = f(_);
4089
- return g !== void 0 && g(E, $) ? (p = _, E) : (p = _, w = $);
4087
+ if (E = w, r(m, _)) return E;
4088
+ var I = f(_);
4089
+ return g !== void 0 && g(E, I) ? (m = _, E) : (m = _, w = I);
4090
4090
  }
4091
- var v = !1, p, w, S = u === void 0 ? null : u;
4091
+ var v = !1, m, w, S = u === void 0 ? null : u;
4092
4092
  return [
4093
4093
  function() {
4094
- return m(d());
4094
+ return p(d());
4095
4095
  },
4096
4096
  S === null ? void 0 : function() {
4097
- return m(S());
4097
+ return p(S());
4098
4098
  }
4099
4099
  ];
4100
4100
  },
@@ -4135,27 +4135,27 @@ function ff() {
4135
4135
  } else y = h.current;
4136
4136
  h = a(
4137
4137
  function() {
4138
- function m(_) {
4138
+ function p(_) {
4139
4139
  if (!v) {
4140
- if (v = !0, p = _, _ = f(_), g !== void 0 && y.hasValue) {
4140
+ if (v = !0, m = _, _ = f(_), g !== void 0 && y.hasValue) {
4141
4141
  var E = y.value;
4142
4142
  if (g(E, _))
4143
4143
  return w = E;
4144
4144
  }
4145
4145
  return w = _;
4146
4146
  }
4147
- if (E = w, r(p, _))
4147
+ if (E = w, r(m, _))
4148
4148
  return E;
4149
- var $ = f(_);
4150
- return g !== void 0 && g(E, $) ? (p = _, E) : (p = _, w = $);
4149
+ var I = f(_);
4150
+ return g !== void 0 && g(E, I) ? (m = _, E) : (m = _, w = I);
4151
4151
  }
4152
- var v = !1, p, w, S = u === void 0 ? null : u;
4152
+ var v = !1, m, w, S = u === void 0 ? null : u;
4153
4153
  return [
4154
4154
  function() {
4155
- return m(d());
4155
+ return p(d());
4156
4156
  },
4157
4157
  S === null ? void 0 : function() {
4158
- return m(S());
4158
+ return p(S());
4159
4159
  }
4160
4160
  ];
4161
4161
  },
@@ -4436,12 +4436,12 @@ function It(e = null, t = { target: yo, actInsideInputWithModifier: !0 }) {
4436
4436
  const c = (d = t == null ? void 0 : t.target) != null ? d : yo, l = (u = t == null ? void 0 : t.actInsideInputWithModifier) != null ? u : !0;
4437
4437
  if (e !== null) {
4438
4438
  const f = (y) => {
4439
- var v, p;
4439
+ var v, m;
4440
4440
  if (o.current = y.ctrlKey || y.metaKey || y.shiftKey || y.altKey, (!o.current || o.current && !l) && Ci(y))
4441
4441
  return !1;
4442
- const m = wo(y.code, a);
4443
- if (i.current.add(y[m]), xo(s, i.current, !1)) {
4444
- const w = ((p = (v = y.composedPath) == null ? void 0 : v.call(y)) == null ? void 0 : p[0]) || y.target, S = (w == null ? void 0 : w.nodeName) === "BUTTON" || (w == null ? void 0 : w.nodeName) === "A";
4442
+ const p = wo(y.code, a);
4443
+ if (i.current.add(y[p]), xo(s, i.current, !1)) {
4444
+ const w = ((m = (v = y.composedPath) == null ? void 0 : v.call(y)) == null ? void 0 : m[0]) || y.target, S = (w == null ? void 0 : w.nodeName) === "BUTTON" || (w == null ? void 0 : w.nodeName) === "A";
4445
4445
  t.preventDefault !== !1 && (o.current || !S) && y.preventDefault(), r(!0);
4446
4446
  }
4447
4447
  }, g = (y) => {
@@ -4650,17 +4650,17 @@ function Kf({ children: e }) {
4650
4650
  const t = ae(), n = we((a) => {
4651
4651
  const { nodes: c = [], setNodes: l, hasDefaultNodes: d, onNodesChange: u, nodeLookup: f, fitViewQueued: g, onNodesChangeMiddlewareMap: h } = t.getState();
4652
4652
  let y = c;
4653
- for (const m of a)
4654
- y = typeof m == "function" ? m(y) : m;
4653
+ for (const p of a)
4654
+ y = typeof p == "function" ? p(y) : p;
4655
4655
  let x = bo({
4656
4656
  items: y,
4657
4657
  lookup: f
4658
4658
  });
4659
- for (const m of h.values())
4660
- x = m(x);
4659
+ for (const p of h.values())
4660
+ x = p(x);
4661
4661
  d && l(y), x.length > 0 ? u == null || u(x) : g && window.requestAnimationFrame(() => {
4662
- const { fitViewQueued: m, nodes: v, setNodes: p } = t.getState();
4663
- m && p(v);
4662
+ const { fitViewQueued: p, nodes: v, setNodes: m } = t.getState();
4663
+ p && m(v);
4664
4664
  });
4665
4665
  }, []), r = So(n), o = we((a) => {
4666
4666
  const { edges: c = [], setEdges: l, hasDefaultEdges: d, onEdgesChange: u, edgeLookup: f } = t.getState();
@@ -4688,12 +4688,12 @@ function mr() {
4688
4688
  }, a = (u) => {
4689
4689
  n.edgeQueue.push(u);
4690
4690
  }, c = (u) => {
4691
- var m, v, p, w;
4691
+ var p, v, m, w;
4692
4692
  const { nodeLookup: f, nodeOrigin: g } = t.getState(), h = _o(u) ? u : f.get(u.id), y = h.parentId ? Ei(h.position, h.measured, h.parentId, f, g) : h.position, x = {
4693
4693
  ...h,
4694
4694
  position: y,
4695
- width: (v = (m = h.measured) == null ? void 0 : m.width) != null ? v : h.width,
4696
- height: (w = (p = h.measured) == null ? void 0 : p.height) != null ? w : h.height
4695
+ width: (v = (p = h.measured) == null ? void 0 : p.width) != null ? v : h.width,
4696
+ height: (w = (m = h.measured) == null ? void 0 : m.height) != null ? w : h.height
4697
4697
  };
4698
4698
  return kt(x);
4699
4699
  }, l = (u, f, g = { replace: !1 }) => {
@@ -4738,8 +4738,8 @@ function mr() {
4738
4738
  toObject: () => {
4739
4739
  const { nodes: u = [], edges: f = [], transform: g } = t.getState(), [h, y, x] = g;
4740
4740
  return {
4741
- nodes: u.map((m) => ({ ...m })),
4742
- edges: f.map((m) => ({ ...m })),
4741
+ nodes: u.map((p) => ({ ...p })),
4742
+ edges: f.map((p) => ({ ...p })),
4743
4743
  viewport: {
4744
4744
  x: h,
4745
4745
  y,
@@ -4748,22 +4748,22 @@ function mr() {
4748
4748
  };
4749
4749
  },
4750
4750
  deleteElements: async ({ nodes: u = [], edges: f = [] }) => {
4751
- const { nodes: g, edges: h, onNodesDelete: y, onEdgesDelete: x, triggerNodeChanges: m, triggerEdgeChanges: v, onDelete: p, onBeforeDelete: w } = t.getState(), { nodes: S, edges: _ } = await pd({
4751
+ const { nodes: g, edges: h, onNodesDelete: y, onEdgesDelete: x, triggerNodeChanges: p, triggerEdgeChanges: v, onDelete: m, onBeforeDelete: w } = t.getState(), { nodes: S, edges: _ } = await pd({
4752
4752
  nodesToRemove: u,
4753
4753
  edgesToRemove: f,
4754
4754
  nodes: g,
4755
4755
  edges: h,
4756
4756
  onBeforeDelete: w
4757
- }), E = _.length > 0, $ = S.length > 0;
4757
+ }), E = _.length > 0, I = S.length > 0;
4758
4758
  if (E) {
4759
4759
  const T = _.map(vo);
4760
4760
  x == null || x(_), v(T);
4761
4761
  }
4762
- if ($) {
4762
+ if (I) {
4763
4763
  const T = S.map(vo);
4764
- y == null || y(S), m(T);
4764
+ y == null || y(S), p(T);
4765
4765
  }
4766
- return ($ || E) && (p == null || p({ nodes: S, edges: _ })), { deletedNodes: S, deletedEdges: _ };
4766
+ return (I || E) && (m == null || m({ nodes: S, edges: _ })), { deletedNodes: S, deletedEdges: _ };
4767
4767
  },
4768
4768
  /**
4769
4769
  * Partial is defined as "the 2 nodes/areas are intersecting partially".
@@ -4772,12 +4772,12 @@ function mr() {
4772
4772
  */
4773
4773
  getIntersectingNodes: (u, f = !0, g) => {
4774
4774
  const h = Yr(u), y = h ? u : c(u), x = g !== void 0;
4775
- return y ? (g || t.getState().nodes).filter((m) => {
4776
- const v = t.getState().nodeLookup.get(m.id);
4777
- if (v && !h && (m.id === u.id || !v.internals.positionAbsolute))
4775
+ return y ? (g || t.getState().nodes).filter((p) => {
4776
+ const v = t.getState().nodeLookup.get(p.id);
4777
+ if (v && !h && (p.id === u.id || !v.internals.positionAbsolute))
4778
4778
  return !1;
4779
- const p = kt(x ? m : v), w = un(p, y);
4780
- return f && w > 0 || w >= p.width * p.height || w >= y.width * y.height;
4779
+ const m = kt(x ? p : v), w = un(m, y);
4780
+ return f && w > 0 || w >= m.width * m.height || w >= y.width * y.height;
4781
4781
  }) : [];
4782
4782
  },
4783
4783
  isNodeIntersecting: (u, f, g = !0) => {
@@ -4868,12 +4868,12 @@ const Sn = {
4868
4868
  lib: e.lib,
4869
4869
  connectionInProgress: e.connection.inProgress
4870
4870
  });
4871
- function eh({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, panOnScroll: r = !1, panOnScrollSpeed: o = 0.5, panOnScrollMode: i = Ge.Free, zoomOnDoubleClick: s = !0, panOnDrag: a = !0, defaultViewport: c, translateExtent: l, minZoom: d, maxZoom: u, zoomActivationKeyCode: f, preventScrolling: g = !0, children: h, noWheelClassName: y, noPanClassName: x, onViewportChange: m, isControlledViewport: v, paneClickDistance: p, selectionOnDrag: w }) {
4872
- const S = ae(), _ = ne(null), { userSelectionActive: E, lib: $, connectionInProgress: T } = ee(jf, se), B = It(f), k = ne();
4871
+ function eh({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, panOnScroll: r = !1, panOnScrollSpeed: o = 0.5, panOnScrollMode: i = Ge.Free, zoomOnDoubleClick: s = !0, panOnDrag: a = !0, defaultViewport: c, translateExtent: l, minZoom: d, maxZoom: u, zoomActivationKeyCode: f, preventScrolling: g = !0, children: h, noWheelClassName: y, noPanClassName: x, onViewportChange: p, isControlledViewport: v, paneClickDistance: m, selectionOnDrag: w }) {
4872
+ const S = ae(), _ = ne(null), { userSelectionActive: E, lib: I, connectionInProgress: T } = ee(jf, se), B = It(f), k = ne();
4873
4873
  Jf(_);
4874
4874
  const M = we((L) => {
4875
- m == null || m({ x: L[0], y: L[1], zoom: L[2] }), v || S.setState({ transform: L });
4876
- }, [m, v]);
4875
+ p == null || p({ x: L[0], y: L[1], zoom: L[2] }), v || S.setState({ transform: L });
4876
+ }, [p, v]);
4877
4877
  return ie(() => {
4878
4878
  if (_.current) {
4879
4879
  k.current = tf({
@@ -4882,18 +4882,18 @@ function eh({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
4882
4882
  maxZoom: u,
4883
4883
  translateExtent: l,
4884
4884
  viewport: c,
4885
- onDraggingChange: (N) => S.setState((I) => I.paneDragging === N ? I : { paneDragging: N }),
4886
- onPanZoomStart: (N, I) => {
4885
+ onDraggingChange: (N) => S.setState(($) => $.paneDragging === N ? $ : { paneDragging: N }),
4886
+ onPanZoomStart: (N, $) => {
4887
4887
  const { onViewportChangeStart: P, onMoveStart: C } = S.getState();
4888
- C == null || C(N, I), P == null || P(I);
4888
+ C == null || C(N, $), P == null || P($);
4889
4889
  },
4890
- onPanZoom: (N, I) => {
4890
+ onPanZoom: (N, $) => {
4891
4891
  const { onViewportChange: P, onMove: C } = S.getState();
4892
- C == null || C(N, I), P == null || P(I);
4892
+ C == null || C(N, $), P == null || P($);
4893
4893
  },
4894
- onPanZoomEnd: (N, I) => {
4894
+ onPanZoomEnd: (N, $) => {
4895
4895
  const { onViewportChangeEnd: P, onMoveEnd: C } = S.getState();
4896
- C == null || C(N, I), P == null || P(I);
4896
+ C == null || C(N, $), P == null || P($);
4897
4897
  }
4898
4898
  });
4899
4899
  const { x: L, y: b, zoom: A } = k.current.getViewport();
@@ -4922,11 +4922,11 @@ function eh({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
4922
4922
  noPanClassName: x,
4923
4923
  userSelectionActive: E,
4924
4924
  noWheelClassName: y,
4925
- lib: $,
4925
+ lib: I,
4926
4926
  onTransformChange: M,
4927
4927
  connectionInProgress: T,
4928
4928
  selectionOnDrag: w,
4929
- paneClickDistance: p
4929
+ paneClickDistance: m
4930
4930
  });
4931
4931
  }, [
4932
4932
  e,
@@ -4942,11 +4942,11 @@ function eh({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
4942
4942
  x,
4943
4943
  E,
4944
4944
  y,
4945
- $,
4945
+ I,
4946
4946
  M,
4947
4947
  T,
4948
4948
  w,
4949
- p
4949
+ m
4950
4950
  ]), D("div", { className: "react-flow__renderer", ref: _, style: Sn, children: h });
4951
4951
  }
4952
4952
  const th = (e) => ({
@@ -4971,13 +4971,13 @@ const zn = (e, t) => (n) => {
4971
4971
  autoPanSpeed: e.autoPanSpeed
4972
4972
  });
4973
4973
  function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full, panOnDrag: r, autoPanOnSelection: o, paneClickDistance: i, selectionOnDrag: s, onSelectionStart: a, onSelectionEnd: c, onPaneClick: l, onPaneContextMenu: d, onPaneScroll: u, onPaneMouseEnter: f, onPaneMouseMove: g, onPaneMouseLeave: h, children: y }) {
4974
- const x = ne(0), m = ae(), { userSelectionActive: v, elementsSelectable: p, dragging: w, panBy: S, autoPanSpeed: _ } = ee(rh, se), E = p && (e || v), $ = ne(null), T = ne(), B = ne(/* @__PURE__ */ new Set()), k = ne(/* @__PURE__ */ new Set()), M = ne(!1), L = ne(!1), b = ne({ x: 0, y: 0 }), A = ne(!1), N = (H) => {
4975
- if (L.current || M.current || m.getState().connection.inProgress) {
4974
+ const x = ne(0), p = ae(), { userSelectionActive: v, elementsSelectable: m, dragging: w, panBy: S, autoPanSpeed: _ } = ee(rh, se), E = m && (e || v), I = ne(null), T = ne(), B = ne(/* @__PURE__ */ new Set()), k = ne(/* @__PURE__ */ new Set()), M = ne(!1), L = ne(!1), b = ne({ x: 0, y: 0 }), A = ne(!1), N = (H) => {
4975
+ if (L.current || M.current || p.getState().connection.inProgress) {
4976
4976
  L.current = !1, M.current = !1;
4977
4977
  return;
4978
4978
  }
4979
- l == null || l(H), m.getState().resetSelectedElements(), m.setState({ nodesSelectionActive: !1 });
4980
- }, I = (H) => {
4979
+ l == null || l(H), p.getState().resetSelectedElements(), p.setState({ nodesSelectionActive: !1 });
4980
+ }, $ = (H) => {
4981
4981
  if (Array.isArray(r) && (r != null && r.includes(2))) {
4982
4982
  H.preventDefault();
4983
4983
  return;
@@ -4987,15 +4987,15 @@ function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full
4987
4987
  L.current && (H.stopPropagation(), L.current = !1);
4988
4988
  }, z = (H) => {
4989
4989
  var te, oe;
4990
- const { domNode: W, transform: Q } = m.getState();
4990
+ const { domNode: W, transform: Q } = p.getState();
4991
4991
  if (T.current = W == null ? void 0 : W.getBoundingClientRect(), !T.current)
4992
4992
  return;
4993
- const V = H.target === $.current;
4993
+ const V = H.target === I.current;
4994
4994
  if (!V && !!H.target.closest(".nokey") || !e || !(s && V || t) || H.button !== 0 || !H.isPrimary)
4995
4995
  return;
4996
4996
  (oe = (te = H.target) == null ? void 0 : te.setPointerCapture) == null || oe.call(te, H.pointerId), L.current = !1;
4997
4997
  const { x: q, y: j } = Ee(H.nativeEvent, T.current), re = Ot({ x: q, y: j }, Q);
4998
- m.setState({
4998
+ p.setState({
4999
4999
  userSelectionRect: {
5000
5000
  width: 0,
5001
5001
  height: 0,
@@ -5008,10 +5008,10 @@ function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full
5008
5008
  };
5009
5009
  function R(H, W) {
5010
5010
  var Je, Ie;
5011
- const { userSelectionRect: Q } = m.getState();
5011
+ const { userSelectionRect: Q } = p.getState();
5012
5012
  if (!Q)
5013
5013
  return;
5014
- const { transform: V, nodeLookup: J, edgeLookup: U, connectionLookup: q, triggerNodeChanges: j, triggerEdgeChanges: re, defaultEdgeOptions: te } = m.getState(), oe = { x: Q.startX, y: Q.startY }, { x: de, y: fe } = ut(oe, V), Ae = {
5014
+ const { transform: V, nodeLookup: J, edgeLookup: U, connectionLookup: q, triggerNodeChanges: j, triggerEdgeChanges: re, defaultEdgeOptions: te } = p.getState(), oe = { x: Q.startX, y: Q.startY }, { x: de, y: fe } = ut(oe, V), Ae = {
5015
5015
  startX: oe.x,
5016
5016
  startY: oe.y,
5017
5017
  x: H < de ? H : de,
@@ -5037,7 +5037,7 @@ function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full
5037
5037
  const he = nt(U, k.current);
5038
5038
  re(he);
5039
5039
  }
5040
- m.setState({
5040
+ p.setState({
5041
5041
  userSelectionRect: Ae,
5042
5042
  userSelectionActive: !0,
5043
5043
  nodesSelectionActive: !1
@@ -5061,7 +5061,7 @@ function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full
5061
5061
  };
5062
5062
  ie(() => () => F(), []);
5063
5063
  const Y = (H) => {
5064
- const { userSelectionRect: W, transform: Q, resetSelectedElements: V } = m.getState();
5064
+ const { userSelectionRect: W, transform: Q, resetSelectedElements: V } = p.getState();
5065
5065
  if (!T.current || !W)
5066
5066
  return;
5067
5067
  const { x: J, y: U } = Ee(H.nativeEvent, T.current);
@@ -5077,20 +5077,20 @@ function oh({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = Mt.Full
5077
5077
  }, K = (H) => {
5078
5078
  var W, Q;
5079
5079
  if (!E) {
5080
- H.target === $.current && m.getState().connection.inProgress && (M.current = !0);
5080
+ H.target === I.current && p.getState().connection.inProgress && (M.current = !0);
5081
5081
  return;
5082
5082
  }
5083
- H.button === 0 && ((Q = (W = H.target) == null ? void 0 : W.releasePointerCapture) == null || Q.call(W, H.pointerId), !v && H.target === $.current && m.getState().userSelectionRect && (N == null || N(H)), m.setState({
5083
+ H.button === 0 && ((Q = (W = H.target) == null ? void 0 : W.releasePointerCapture) == null || Q.call(W, H.pointerId), !v && H.target === I.current && p.getState().userSelectionRect && (N == null || N(H)), p.setState({
5084
5084
  userSelectionActive: !1,
5085
5085
  userSelectionRect: null
5086
- }), L.current && (c == null || c(H), m.setState({
5086
+ }), L.current && (c == null || c(H), p.setState({
5087
5087
  nodesSelectionActive: B.current.size > 0
5088
5088
  })), F());
5089
5089
  }, Z = (H) => {
5090
5090
  var W, Q;
5091
5091
  (Q = (W = H.target) == null ? void 0 : W.releasePointerCapture) == null || Q.call(W, H.pointerId), F();
5092
5092
  }, X = r === !0 || Array.isArray(r) && r.includes(0);
5093
- return ce("div", { className: ue(["react-flow__pane", { draggable: X, dragging: w, selection: e }]), onClick: E ? void 0 : zn(N, $), onContextMenu: zn(I, $), onWheel: zn(P, $), onPointerEnter: E ? void 0 : f, onPointerMove: E ? Y : g, onPointerUp: K, onPointerCancel: E ? Z : void 0, onPointerDownCapture: E ? z : void 0, onClickCapture: E ? C : void 0, onPointerLeave: h, ref: $, style: Sn, children: [y, D(nh, {})] });
5093
+ return ce("div", { className: ue(["react-flow__pane", { draggable: X, dragging: w, selection: e }]), onClick: E ? void 0 : zn(N, I), onContextMenu: zn($, I), onWheel: zn(P, I), onPointerEnter: E ? void 0 : f, onPointerMove: E ? Y : g, onPointerUp: K, onPointerCancel: E ? Z : void 0, onPointerDownCapture: E ? z : void 0, onClickCapture: E ? C : void 0, onPointerLeave: h, ref: I, style: Sn, children: [y, D(nh, {})] });
5094
5094
  }
5095
5095
  function Jn({ id: e, store: t, unselect: n = !1, nodeRef: r }) {
5096
5096
  const { addSelectedNodes: o, unselectNodesAndEdges: i, multiSelectionActive: s, nodeLookup: a, onError: c } = t.getState(), l = a.get(e);
@@ -5142,23 +5142,23 @@ function ts() {
5142
5142
  const e = ae();
5143
5143
  return we((n) => {
5144
5144
  const { nodeExtent: r, snapToGrid: o, snapGrid: i, nodesDraggable: s, onError: a, updateNodePositions: c, nodeLookup: l, nodeOrigin: d } = e.getState(), u = /* @__PURE__ */ new Map(), f = ih(s), g = o ? i[0] : 5, h = o ? i[1] : 5, y = n.direction.x * g * n.factor, x = n.direction.y * h * n.factor;
5145
- for (const [, m] of l) {
5146
- if (!f(m))
5145
+ for (const [, p] of l) {
5146
+ if (!f(p))
5147
5147
  continue;
5148
5148
  let v = {
5149
- x: m.internals.positionAbsolute.x + y,
5150
- y: m.internals.positionAbsolute.y + x
5149
+ x: p.internals.positionAbsolute.x + y,
5150
+ y: p.internals.positionAbsolute.y + x
5151
5151
  };
5152
5152
  o && (v = Lt(v, i));
5153
- const { position: p, positionAbsolute: w } = xi({
5154
- nodeId: m.id,
5153
+ const { position: m, positionAbsolute: w } = xi({
5154
+ nodeId: p.id,
5155
5155
  nextPosition: v,
5156
5156
  nodeLookup: l,
5157
5157
  nodeExtent: r,
5158
5158
  nodeOrigin: d,
5159
5159
  onError: a
5160
5160
  });
5161
- m.position = p, m.internals.positionAbsolute = w, u.set(m.id, m);
5161
+ p.position = m, p.internals.positionAbsolute = w, u.set(p.id, p);
5162
5162
  }
5163
5163
  c(u);
5164
5164
  }, []);
@@ -5205,26 +5205,26 @@ const uh = {
5205
5205
  };
5206
5206
  function fh({ type: e = "source", position: t = G.Top, isValidConnection: n, isConnectable: r = !0, isConnectableStart: o = !0, isConnectableEnd: i = !0, id: s, onConnect: a, children: c, className: l, onMouseDown: d, onTouchStart: u, ...f }, g) {
5207
5207
  var A, N;
5208
- const h = s || null, y = e === "target", x = ae(), m = ns(), { connectOnClick: v, noPanClassName: p, rfId: w } = lh(), { connectingFrom: S, connectingTo: _, clickConnecting: E, isPossibleEndHandle: $, connectionInProcess: T, clickConnectionInProcess: B, valid: k } = ee(dh(m, h, e), se);
5209
- m || (N = (A = x.getState()).onError) == null || N.call(A, "010", ye.error010());
5210
- const M = (I) => {
5208
+ const h = s || null, y = e === "target", x = ae(), p = ns(), { connectOnClick: v, noPanClassName: m, rfId: w } = lh(), { connectingFrom: S, connectingTo: _, clickConnecting: E, isPossibleEndHandle: I, connectionInProcess: T, clickConnectionInProcess: B, valid: k } = ee(dh(p, h, e), se);
5209
+ p || (N = (A = x.getState()).onError) == null || N.call(A, "010", ye.error010());
5210
+ const M = ($) => {
5211
5211
  const { defaultEdgeOptions: P, onConnect: C, hasDefaultEdges: z } = x.getState(), R = {
5212
5212
  ...P,
5213
- ...I
5213
+ ...$
5214
5214
  };
5215
5215
  if (z) {
5216
5216
  const { edges: O, setEdges: F, onError: Y } = x.getState();
5217
5217
  F(Xf(R, O, { onError: Y }));
5218
5218
  }
5219
5219
  C == null || C(R), a == null || a(R);
5220
- }, L = (I) => {
5221
- if (!m)
5220
+ }, L = ($) => {
5221
+ if (!p)
5222
5222
  return;
5223
- const P = Mi(I.nativeEvent);
5224
- if (o && (P && I.button === 0 || !P)) {
5223
+ const P = Mi($.nativeEvent);
5224
+ if (o && (P && $.button === 0 || !P)) {
5225
5225
  const C = x.getState();
5226
- Qn.onPointerDown(I.nativeEvent, {
5227
- handleDomNode: I.currentTarget,
5226
+ Qn.onPointerDown($.nativeEvent, {
5227
+ handleDomNode: $.currentTarget,
5228
5228
  autoPanOnConnect: C.autoPanOnConnect,
5229
5229
  connectionMode: C.connectionMode,
5230
5230
  connectionRadius: C.connectionRadius,
@@ -5233,7 +5233,7 @@ function fh({ type: e = "source", position: t = G.Top, isValidConnection: n, isC
5233
5233
  lib: C.lib,
5234
5234
  isTarget: y,
5235
5235
  handleId: h,
5236
- nodeId: m,
5236
+ nodeId: p,
5237
5237
  flowId: C.rfId,
5238
5238
  panBy: C.panBy,
5239
5239
  cancelConnection: C.cancelConnection,
@@ -5254,18 +5254,18 @@ function fh({ type: e = "source", position: t = G.Top, isValidConnection: n, isC
5254
5254
  dragThreshold: C.connectionDragThreshold
5255
5255
  });
5256
5256
  }
5257
- P ? d == null || d(I) : u == null || u(I);
5258
- }, b = (I) => {
5257
+ P ? d == null || d($) : u == null || u($);
5258
+ }, b = ($) => {
5259
5259
  const { onClickConnectStart: P, onClickConnectEnd: C, connectionClickStartHandle: z, connectionMode: R, isValidConnection: O, lib: F, rfId: Y, nodeLookup: K, connection: Z } = x.getState();
5260
- if (!m || !z && !o)
5260
+ if (!p || !z && !o)
5261
5261
  return;
5262
5262
  if (!z) {
5263
- P == null || P(I.nativeEvent, { nodeId: m, handleId: h, handleType: e }), x.setState({ connectionClickStartHandle: { nodeId: m, type: e, id: h } });
5263
+ P == null || P($.nativeEvent, { nodeId: p, handleId: h, handleType: e }), x.setState({ connectionClickStartHandle: { nodeId: p, type: e, id: h } });
5264
5264
  return;
5265
5265
  }
5266
- const X = Ni(I.target), H = n || O, { connection: W, isValid: Q } = Qn.isValid(I.nativeEvent, {
5266
+ const X = Ni($.target), H = n || O, { connection: W, isValid: Q } = Qn.isValid($.nativeEvent, {
5267
5267
  handle: {
5268
- nodeId: m,
5268
+ nodeId: p,
5269
5269
  id: h,
5270
5270
  type: e
5271
5271
  },
@@ -5281,13 +5281,13 @@ function fh({ type: e = "source", position: t = G.Top, isValidConnection: n, isC
5281
5281
  });
5282
5282
  Q && W && M(W);
5283
5283
  const V = structuredClone(Z);
5284
- delete V.inProgress, V.toPosition = V.toHandle ? V.toHandle.position : null, C == null || C(I, V), x.setState({ connectionClickStartHandle: null });
5284
+ delete V.inProgress, V.toPosition = V.toHandle ? V.toHandle.position : null, C == null || C($, V), x.setState({ connectionClickStartHandle: null });
5285
5285
  };
5286
- return D("div", { "data-handleid": h, "data-nodeid": m, "data-handlepos": t, "data-id": `${w}-${m}-${h}-${e}`, className: ue([
5286
+ return D("div", { "data-handleid": h, "data-nodeid": p, "data-handlepos": t, "data-id": `${w}-${p}-${h}-${e}`, className: ue([
5287
5287
  "react-flow__handle",
5288
5288
  `react-flow__handle-${t}`,
5289
5289
  "nodrag",
5290
- p,
5290
+ m,
5291
5291
  l,
5292
5292
  {
5293
5293
  source: !y,
@@ -5303,7 +5303,7 @@ function fh({ type: e = "source", position: t = G.Top, isValidConnection: n, isC
5303
5303
  * shows where you can start a connection from
5304
5304
  * and where you can end it while connecting
5305
5305
  */
5306
- connectionindicator: r && (!T || $) && (T || B ? i : o)
5306
+ connectionindicator: r && (!T || I) && (T || B ? i : o)
5307
5307
  }
5308
5308
  ]), onMouseDown: L, onTouchStart: L, onClick: v ? b : void 0, ref: g, ...f, children: c });
5309
5309
  }
@@ -5383,9 +5383,9 @@ function wh({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y:
5383
5383
  } }) });
5384
5384
  }
5385
5385
  const Co = typeof window != "undefined" ? window : void 0, bh = (e) => ({ nodesSelectionActive: e.nodesSelectionActive, userSelectionActive: e.userSelectionActive });
5386
- function os({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: r, onPaneMouseLeave: o, onPaneContextMenu: i, onPaneScroll: s, paneClickDistance: a, deleteKeyCode: c, selectionKeyCode: l, selectionOnDrag: d, selectionMode: u, onSelectionStart: f, onSelectionEnd: g, multiSelectionKeyCode: h, panActivationKeyCode: y, zoomActivationKeyCode: x, elementsSelectable: m, zoomOnScroll: v, zoomOnPinch: p, panOnScroll: w, panOnScrollSpeed: S, panOnScrollMode: _, zoomOnDoubleClick: E, panOnDrag: $, autoPanOnSelection: T, defaultViewport: B, translateExtent: k, minZoom: M, maxZoom: L, preventScrolling: b, onSelectionContextMenu: A, noWheelClassName: N, noPanClassName: I, disableKeyboardA11y: P, onViewportChange: C, isControlledViewport: z }) {
5387
- const { nodesSelectionActive: R, userSelectionActive: O } = ee(bh, se), F = It(l, { target: Co }), Y = It(y, { target: Co }), K = Y || $, Z = Y || w, X = d && K !== !0, H = F || O || X;
5388
- return Qf({ deleteKeyCode: c, multiSelectionKeyCode: h }), D(eh, { onPaneContextMenu: i, elementsSelectable: m, zoomOnScroll: v, zoomOnPinch: p, panOnScroll: Z, panOnScrollSpeed: S, panOnScrollMode: _, zoomOnDoubleClick: E, panOnDrag: !F && K, defaultViewport: B, translateExtent: k, minZoom: M, maxZoom: L, zoomActivationKeyCode: x, preventScrolling: b, noWheelClassName: N, noPanClassName: I, onViewportChange: C, isControlledViewport: z, paneClickDistance: a, selectionOnDrag: X, children: ce(oh, { onSelectionStart: f, onSelectionEnd: g, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: r, onPaneMouseLeave: o, onPaneContextMenu: i, onPaneScroll: s, panOnDrag: K, autoPanOnSelection: T, isSelecting: !!H, selectionMode: u, selectionKeyPressed: F, paneClickDistance: a, selectionOnDrag: X, children: [e, R && D(wh, { onSelectionContextMenu: A, noPanClassName: I, disableKeyboardA11y: P })] }) });
5386
+ function os({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: r, onPaneMouseLeave: o, onPaneContextMenu: i, onPaneScroll: s, paneClickDistance: a, deleteKeyCode: c, selectionKeyCode: l, selectionOnDrag: d, selectionMode: u, onSelectionStart: f, onSelectionEnd: g, multiSelectionKeyCode: h, panActivationKeyCode: y, zoomActivationKeyCode: x, elementsSelectable: p, zoomOnScroll: v, zoomOnPinch: m, panOnScroll: w, panOnScrollSpeed: S, panOnScrollMode: _, zoomOnDoubleClick: E, panOnDrag: I, autoPanOnSelection: T, defaultViewport: B, translateExtent: k, minZoom: M, maxZoom: L, preventScrolling: b, onSelectionContextMenu: A, noWheelClassName: N, noPanClassName: $, disableKeyboardA11y: P, onViewportChange: C, isControlledViewport: z }) {
5387
+ const { nodesSelectionActive: R, userSelectionActive: O } = ee(bh, se), F = It(l, { target: Co }), Y = It(y, { target: Co }), K = Y || I, Z = Y || w, X = d && K !== !0, H = F || O || X;
5388
+ return Qf({ deleteKeyCode: c, multiSelectionKeyCode: h }), D(eh, { onPaneContextMenu: i, elementsSelectable: p, zoomOnScroll: v, zoomOnPinch: m, panOnScroll: Z, panOnScrollSpeed: S, panOnScrollMode: _, zoomOnDoubleClick: E, panOnDrag: !F && K, defaultViewport: B, translateExtent: k, minZoom: M, maxZoom: L, zoomActivationKeyCode: x, preventScrolling: b, noWheelClassName: N, noPanClassName: $, onViewportChange: C, isControlledViewport: z, paneClickDistance: a, selectionOnDrag: X, children: ce(oh, { onSelectionStart: f, onSelectionEnd: g, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: r, onPaneMouseLeave: o, onPaneContextMenu: i, onPaneScroll: s, panOnDrag: K, autoPanOnSelection: T, isSelecting: !!H, selectionMode: u, selectionKeyPressed: F, paneClickDistance: a, selectionOnDrag: X, children: [e, R && D(wh, { onSelectionContextMenu: A, noPanClassName: $, disableKeyboardA11y: P })] }) });
5389
5389
  }
5390
5390
  os.displayName = "FlowRenderer";
5391
5391
  const vh = le(os), _h = (e) => (t) => e ? ar(t.nodeLookup, { x: 0, y: 0, width: t.width, height: t.height }, t.transform, !0).map((n) => n.id) : Array.from(t.nodeLookup.keys());
@@ -5422,9 +5422,9 @@ function Ch({ node: e, nodeType: t, hasDimensions: n, resizeObserver: r }) {
5422
5422
  }
5423
5423
  }, [e.id, t, e.sourcePosition, e.targetPosition]), i;
5424
5424
  }
5425
- function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave: o, onContextMenu: i, onDoubleClick: s, nodesDraggable: a, elementsSelectable: c, nodesConnectable: l, nodesFocusable: d, resizeObserver: u, noDragClassName: f, noPanClassName: g, disableKeyboardA11y: h, rfId: y, nodeTypes: x, nodeClickDistance: m, onError: v }) {
5425
+ function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave: o, onContextMenu: i, onDoubleClick: s, nodesDraggable: a, elementsSelectable: c, nodesConnectable: l, nodesFocusable: d, resizeObserver: u, noDragClassName: f, noPanClassName: g, disableKeyboardA11y: h, rfId: y, nodeTypes: x, nodeClickDistance: p, onError: v }) {
5426
5426
  var H, W, Q;
5427
- const { node: p, internals: w, isParent: S } = ee((V) => {
5427
+ const { node: m, internals: w, isParent: S } = ee((V) => {
5428
5428
  const J = V.nodeLookup.get(e), U = V.parentLookup.has(e);
5429
5429
  return {
5430
5430
  node: J,
@@ -5432,22 +5432,22 @@ function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
5432
5432
  isParent: U
5433
5433
  };
5434
5434
  }, se);
5435
- let _ = p.type || "default", E = (x == null ? void 0 : x[_]) || No[_];
5435
+ let _ = m.type || "default", E = (x == null ? void 0 : x[_]) || No[_];
5436
5436
  E === void 0 && (v == null || v("003", ye.error003(_)), _ = "default", E = (x == null ? void 0 : x.default) || No.default);
5437
- const $ = !!(p.draggable || a && typeof p.draggable == "undefined"), T = !!(p.selectable || c && typeof p.selectable == "undefined"), B = !!(p.connectable || l && typeof p.connectable == "undefined"), k = !!(p.focusable || d && typeof p.focusable == "undefined"), M = ae(), L = Si(p), b = Ch({ node: p, nodeType: _, hasDimensions: L, resizeObserver: u }), A = es({
5437
+ const I = !!(m.draggable || a && typeof m.draggable == "undefined"), T = !!(m.selectable || c && typeof m.selectable == "undefined"), B = !!(m.connectable || l && typeof m.connectable == "undefined"), k = !!(m.focusable || d && typeof m.focusable == "undefined"), M = ae(), L = Si(m), b = Ch({ node: m, nodeType: _, hasDimensions: L, resizeObserver: u }), A = es({
5438
5438
  nodeRef: b,
5439
- disabled: p.hidden || !$,
5439
+ disabled: m.hidden || !I,
5440
5440
  noDragClassName: f,
5441
- handleSelector: p.dragHandle,
5441
+ handleSelector: m.dragHandle,
5442
5442
  nodeId: e,
5443
5443
  isSelectable: T,
5444
- nodeClickDistance: m
5444
+ nodeClickDistance: p
5445
5445
  }), N = ts();
5446
- if (p.hidden)
5446
+ if (m.hidden)
5447
5447
  return null;
5448
- const I = Le(p), P = yh(p), C = T || $ || t || n || r || o, z = n ? (V) => n(V, { ...w.userNode }) : void 0, R = r ? (V) => r(V, { ...w.userNode }) : void 0, O = o ? (V) => o(V, { ...w.userNode }) : void 0, F = i ? (V) => i(V, { ...w.userNode }) : void 0, Y = s ? (V) => s(V, { ...w.userNode }) : void 0, K = (V) => {
5448
+ const $ = Le(m), P = yh(m), C = T || I || t || n || r || o, z = n ? (V) => n(V, { ...w.userNode }) : void 0, R = r ? (V) => r(V, { ...w.userNode }) : void 0, O = o ? (V) => o(V, { ...w.userNode }) : void 0, F = i ? (V) => i(V, { ...w.userNode }) : void 0, Y = s ? (V) => s(V, { ...w.userNode }) : void 0, K = (V) => {
5449
5449
  const { selectNodesOnDrag: J, nodeDragThreshold: U } = M.getState();
5450
- T && (!J || !$ || U > 0) && Jn({
5450
+ T && (!J || !I || U > 0) && Jn({
5451
5451
  id: e,
5452
5452
  store: M,
5453
5453
  nodeRef: b
@@ -5462,7 +5462,7 @@ function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
5462
5462
  unselect: J,
5463
5463
  nodeRef: b
5464
5464
  });
5465
- } else if ($ && p.selected && Object.prototype.hasOwnProperty.call(dn, V.key)) {
5465
+ } else if (I && m.selected && Object.prototype.hasOwnProperty.call(dn, V.key)) {
5466
5466
  V.preventDefault();
5467
5467
  const { ariaLabelConfig: J } = M.getState();
5468
5468
  M.setState({
@@ -5484,7 +5484,7 @@ function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
5484
5484
  const { transform: V, width: J, height: U, autoPanOnNodeFocus: q, setCenter: j } = M.getState();
5485
5485
  if (!q)
5486
5486
  return;
5487
- ar(/* @__PURE__ */ new Map([[e, p]]), { x: 0, y: 0, width: J, height: U }, V, !0).length > 0 || j(p.position.x + I.width / 2, p.position.y + I.height / 2, {
5487
+ ar(/* @__PURE__ */ new Map([[e, m]]), { x: 0, y: 0, width: J, height: U }, V, !0).length > 0 || j(m.position.x + $.width / 2, m.position.y + $.height / 2, {
5488
5488
  zoom: V[2]
5489
5489
  });
5490
5490
  };
@@ -5493,14 +5493,14 @@ function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
5493
5493
  `react-flow__node-${_}`,
5494
5494
  {
5495
5495
  // this is overwritable by passing `nopan` as a class name
5496
- [g]: $
5496
+ [g]: I
5497
5497
  },
5498
- p.className,
5498
+ m.className,
5499
5499
  {
5500
- selected: p.selected,
5500
+ selected: m.selected,
5501
5501
  selectable: T,
5502
5502
  parent: S,
5503
- draggable: $,
5503
+ draggable: I,
5504
5504
  dragging: A
5505
5505
  }
5506
5506
  ]), ref: b, style: {
@@ -5508,9 +5508,9 @@ function Mh({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
5508
5508
  transform: `translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,
5509
5509
  pointerEvents: C ? "all" : "none",
5510
5510
  visibility: L ? "visible" : "hidden",
5511
- ...p.style,
5511
+ ...m.style,
5512
5512
  ...P
5513
- }, "data-id": e, "data-testid": `rf__node-${e}`, onMouseEnter: z, onMouseMove: R, onMouseLeave: O, onContextMenu: F, onClick: K, onDoubleClick: Y, onKeyDown: k ? Z : void 0, tabIndex: k ? 0 : void 0, onFocus: k ? X : void 0, role: (H = p.ariaRole) != null ? H : k ? "group" : void 0, "aria-roledescription": "node", "aria-describedby": h ? void 0 : `${Gi}-${y}`, "aria-label": p.ariaLabel, ...p.domAttributes, children: D(sh, { value: e, children: D(E, { id: e, data: p.data, type: _, positionAbsoluteX: w.positionAbsolute.x, positionAbsoluteY: w.positionAbsolute.y, selected: (W = p.selected) != null ? W : !1, selectable: T, draggable: $, deletable: (Q = p.deletable) != null ? Q : !0, isConnectable: B, sourcePosition: p.sourcePosition, targetPosition: p.targetPosition, dragging: A, dragHandle: p.dragHandle, zIndex: w.z, parentId: p.parentId, ...I }) }) });
5513
+ }, "data-id": e, "data-testid": `rf__node-${e}`, onMouseEnter: z, onMouseMove: R, onMouseLeave: O, onContextMenu: F, onClick: K, onDoubleClick: Y, onKeyDown: k ? Z : void 0, tabIndex: k ? 0 : void 0, onFocus: k ? X : void 0, role: (H = m.ariaRole) != null ? H : k ? "group" : void 0, "aria-roledescription": "node", "aria-describedby": h ? void 0 : `${Gi}-${y}`, "aria-label": m.ariaLabel, ...m.domAttributes, children: D(sh, { value: e, children: D(E, { id: e, data: m.data, type: _, positionAbsoluteX: w.positionAbsolute.x, positionAbsoluteY: w.positionAbsolute.y, selected: (W = m.selected) != null ? W : !1, selectable: T, draggable: I, deletable: (Q = m.deletable) != null ? Q : !0, isConnectable: B, sourcePosition: m.sourcePosition, targetPosition: m.targetPosition, dragging: A, dragHandle: m.dragHandle, zIndex: w.z, parentId: m.parentId, ...$ }) }) });
5514
5514
  }
5515
5515
  var kh = le(Mh);
5516
5516
  const Ah = (e) => ({
@@ -5663,8 +5663,8 @@ function cs({ sourceX: e, sourceY: t, sourcePosition: n = G.Bottom, targetX: r,
5663
5663
  ];
5664
5664
  }
5665
5665
  function ls(e) {
5666
- return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, sourcePosition: s, targetPosition: a, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, interactionWidth: m }) => {
5667
- const [v, p, w] = cs({
5666
+ return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, sourcePosition: s, targetPosition: a, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, interactionWidth: p }) => {
5667
+ const [v, m, w] = cs({
5668
5668
  sourceX: n,
5669
5669
  sourceY: r,
5670
5670
  sourcePosition: s,
@@ -5672,26 +5672,26 @@ function ls(e) {
5672
5672
  targetY: i,
5673
5673
  targetPosition: a
5674
5674
  }), S = e.isInternal ? void 0 : t;
5675
- return D(En, { id: S, path: v, labelX: p, labelY: w, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, interactionWidth: m });
5675
+ return D(En, { id: S, path: v, labelX: m, labelY: w, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, interactionWidth: p });
5676
5676
  });
5677
5677
  }
5678
5678
  const Hh = ls({ isInternal: !1 }), us = ls({ isInternal: !0 });
5679
5679
  Hh.displayName = "SimpleBezierEdge";
5680
5680
  us.displayName = "SimpleBezierEdgeInternal";
5681
5681
  function ds(e) {
5682
- return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, sourcePosition: g = G.Bottom, targetPosition: h = G.Top, markerEnd: y, markerStart: x, pathOptions: m, interactionWidth: v }) => {
5683
- const [p, w, S] = qn({
5682
+ return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, sourcePosition: g = G.Bottom, targetPosition: h = G.Top, markerEnd: y, markerStart: x, pathOptions: p, interactionWidth: v }) => {
5683
+ const [m, w, S] = qn({
5684
5684
  sourceX: n,
5685
5685
  sourceY: r,
5686
5686
  sourcePosition: g,
5687
5687
  targetX: o,
5688
5688
  targetY: i,
5689
5689
  targetPosition: h,
5690
- borderRadius: m == null ? void 0 : m.borderRadius,
5691
- offset: m == null ? void 0 : m.offset,
5692
- stepPosition: m == null ? void 0 : m.stepPosition
5690
+ borderRadius: p == null ? void 0 : p.borderRadius,
5691
+ offset: p == null ? void 0 : p.offset,
5692
+ stepPosition: p == null ? void 0 : p.stepPosition
5693
5693
  }), _ = e.isInternal ? void 0 : t;
5694
- return D(En, { id: _, path: p, labelX: w, labelY: S, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: y, markerStart: x, interactionWidth: v });
5694
+ return D(En, { id: _, path: m, labelX: w, labelY: S, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: y, markerStart: x, interactionWidth: v });
5695
5695
  });
5696
5696
  }
5697
5697
  const fs = ds({ isInternal: !1 }), hs = ds({ isInternal: !0 });
@@ -5712,25 +5712,25 @@ Rh.displayName = "StepEdge";
5712
5712
  ps.displayName = "StepEdgeInternal";
5713
5713
  function ms(e) {
5714
5714
  return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: g, markerStart: h, interactionWidth: y }) => {
5715
- const [x, m, v] = $i({ sourceX: n, sourceY: r, targetX: o, targetY: i }), p = e.isInternal ? void 0 : t;
5716
- return D(En, { id: p, path: x, labelX: m, labelY: v, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: g, markerStart: h, interactionWidth: y });
5715
+ const [x, p, v] = $i({ sourceX: n, sourceY: r, targetX: o, targetY: i }), m = e.isInternal ? void 0 : t;
5716
+ return D(En, { id: m, path: x, labelX: p, labelY: v, label: s, labelStyle: a, labelShowBg: c, labelBgStyle: l, labelBgPadding: d, labelBgBorderRadius: u, style: f, markerEnd: g, markerStart: h, interactionWidth: y });
5717
5717
  });
5718
5718
  }
5719
5719
  const Bh = ms({ isInternal: !1 }), ys = ms({ isInternal: !0 });
5720
5720
  Bh.displayName = "StraightEdge";
5721
5721
  ys.displayName = "StraightEdgeInternal";
5722
5722
  function xs(e) {
5723
- return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, sourcePosition: s = G.Bottom, targetPosition: a = G.Top, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, pathOptions: m, interactionWidth: v }) => {
5724
- const [p, w, S] = Ai({
5723
+ return le(({ id: t, sourceX: n, sourceY: r, targetX: o, targetY: i, sourcePosition: s = G.Bottom, targetPosition: a = G.Top, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, pathOptions: p, interactionWidth: v }) => {
5724
+ const [m, w, S] = Ai({
5725
5725
  sourceX: n,
5726
5726
  sourceY: r,
5727
5727
  sourcePosition: s,
5728
5728
  targetX: o,
5729
5729
  targetY: i,
5730
5730
  targetPosition: a,
5731
- curvature: m == null ? void 0 : m.curvature
5731
+ curvature: p == null ? void 0 : p.curvature
5732
5732
  }), _ = e.isInternal ? void 0 : t;
5733
- return D(En, { id: _, path: p, labelX: w, labelY: S, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, interactionWidth: v });
5733
+ return D(En, { id: _, path: m, labelX: w, labelY: S, label: c, labelStyle: l, labelShowBg: d, labelBgStyle: u, labelBgPadding: f, labelBgBorderRadius: g, style: h, markerEnd: y, markerStart: x, interactionWidth: v });
5734
5734
  });
5735
5735
  }
5736
5736
  const Vh = xs({ isInternal: !1 }), ws = xs({ isInternal: !0 });
@@ -5758,20 +5758,20 @@ function Yh({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourc
5758
5758
  const h = ae(), y = (w, S) => {
5759
5759
  if (w.button !== 0)
5760
5760
  return;
5761
- const { autoPanOnConnect: _, domNode: E, connectionMode: $, connectionRadius: T, lib: B, onConnectStart: k, cancelConnection: M, nodeLookup: L, rfId: b, panBy: A, updateConnection: N } = h.getState(), I = S.type === "target", P = (R, O) => {
5761
+ const { autoPanOnConnect: _, domNode: E, connectionMode: I, connectionRadius: T, lib: B, onConnectStart: k, cancelConnection: M, nodeLookup: L, rfId: b, panBy: A, updateConnection: N } = h.getState(), $ = S.type === "target", P = (R, O) => {
5762
5762
  f(!1), u == null || u(R, n, S.type, O);
5763
5763
  }, C = (R) => l == null ? void 0 : l(n, R), z = (R, O) => {
5764
5764
  f(!0), d == null || d(w, n, S.type), k == null || k(R, O);
5765
5765
  };
5766
5766
  Qn.onPointerDown(w.nativeEvent, {
5767
5767
  autoPanOnConnect: _,
5768
- connectionMode: $,
5768
+ connectionMode: I,
5769
5769
  connectionRadius: T,
5770
5770
  domNode: E,
5771
5771
  handleId: S.id,
5772
5772
  nodeId: S.nodeId,
5773
5773
  nodeLookup: L,
5774
- isTarget: I,
5774
+ isTarget: $,
5775
5775
  edgeUpdaterType: S.type,
5776
5776
  lib: B,
5777
5777
  flowId: b,
@@ -5797,34 +5797,34 @@ function Yh({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourc
5797
5797
  }, x = (w) => {
5798
5798
  var S;
5799
5799
  return y(w, { nodeId: n.target, id: (S = n.targetHandle) != null ? S : null, type: "target" });
5800
- }, m = (w) => {
5800
+ }, p = (w) => {
5801
5801
  var S;
5802
5802
  return y(w, { nodeId: n.source, id: (S = n.sourceHandle) != null ? S : null, type: "source" });
5803
- }, v = () => g(!0), p = () => g(!1);
5804
- return ce(De, { children: [(e === !0 || e === "source") && D(Po, { position: a, centerX: r, centerY: o, radius: t, onMouseDown: x, onMouseEnter: v, onMouseOut: p, type: "source" }), (e === !0 || e === "target") && D(Po, { position: c, centerX: i, centerY: s, radius: t, onMouseDown: m, onMouseEnter: v, onMouseOut: p, type: "target" })] });
5803
+ }, v = () => g(!0), m = () => g(!1);
5804
+ return ce(De, { children: [(e === !0 || e === "source") && D(Po, { position: a, centerX: r, centerY: o, radius: t, onMouseDown: x, onMouseEnter: v, onMouseOut: m, type: "source" }), (e === !0 || e === "target") && D(Po, { position: c, centerX: i, centerY: s, radius: t, onMouseDown: p, onMouseEnter: v, onMouseOut: m, type: "target" })] });
5805
5805
  }
5806
- function Wh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectable: r, onClick: o, onDoubleClick: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: l, reconnectRadius: d, onReconnect: u, onReconnectStart: f, onReconnectEnd: g, rfId: h, edgeTypes: y, noPanClassName: x, onError: m, disableKeyboardA11y: v }) {
5806
+ function Wh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectable: r, onClick: o, onDoubleClick: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: l, reconnectRadius: d, onReconnect: u, onReconnectStart: f, onReconnectEnd: g, rfId: h, edgeTypes: y, noPanClassName: x, onError: p, disableKeyboardA11y: v }) {
5807
5807
  var J, U;
5808
- let p = ee((q) => q.edgeLookup.get(e));
5808
+ let m = ee((q) => q.edgeLookup.get(e));
5809
5809
  const w = ee((q) => q.defaultEdgeOptions);
5810
- p = w ? { ...w, ...p } : p;
5811
- let S = p.type || "default", _ = (y == null ? void 0 : y[S]) || Ao[S];
5812
- _ === void 0 && (m == null || m("011", ye.error011(S)), S = "default", _ = (y == null ? void 0 : y.default) || Ao.default);
5813
- const E = !!(p.focusable || t && typeof p.focusable == "undefined"), $ = typeof u != "undefined" && (p.reconnectable || n && typeof p.reconnectable == "undefined"), T = !!(p.selectable || r && typeof p.selectable == "undefined"), B = ne(null), [k, M] = xe(!1), [L, b] = xe(!1), A = ae(), { zIndex: N = p.zIndex, sourceX: I, sourceY: P, targetX: C, targetY: z, sourcePosition: R, targetPosition: O } = ee(we((q) => {
5814
- const j = q.nodeLookup.get(p.source), re = q.nodeLookup.get(p.target);
5810
+ m = w ? { ...w, ...m } : m;
5811
+ let S = m.type || "default", _ = (y == null ? void 0 : y[S]) || Ao[S];
5812
+ _ === void 0 && (p == null || p("011", ye.error011(S)), S = "default", _ = (y == null ? void 0 : y.default) || Ao.default);
5813
+ const E = !!(m.focusable || t && typeof m.focusable == "undefined"), I = typeof u != "undefined" && (m.reconnectable || n && typeof m.reconnectable == "undefined"), T = !!(m.selectable || r && typeof m.selectable == "undefined"), B = ne(null), [k, M] = xe(!1), [L, b] = xe(!1), A = ae(), { zIndex: N = m.zIndex, sourceX: $, sourceY: P, targetX: C, targetY: z, sourcePosition: R, targetPosition: O } = ee(we((q) => {
5814
+ const j = q.nodeLookup.get(m.source), re = q.nodeLookup.get(m.target);
5815
5815
  if (!j || !re)
5816
5816
  return Io;
5817
5817
  const te = Ad({
5818
5818
  id: e,
5819
5819
  sourceNode: j,
5820
5820
  targetNode: re,
5821
- sourceHandle: p.sourceHandle || null,
5822
- targetHandle: p.targetHandle || null,
5821
+ sourceHandle: m.sourceHandle || null,
5822
+ targetHandle: m.targetHandle || null,
5823
5823
  connectionMode: q.connectionMode,
5824
- onError: m
5824
+ onError: p
5825
5825
  }), oe = vd({
5826
- selected: p.selected,
5827
- zIndex: p.zIndex,
5826
+ selected: m.selected,
5827
+ zIndex: m.zIndex,
5828
5828
  sourceNode: j,
5829
5829
  targetNode: re,
5830
5830
  elevateOnSelect: q.elevateEdgesOnSelect,
@@ -5834,43 +5834,43 @@ function Wh({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
5834
5834
  ...te || Io,
5835
5835
  zIndex: oe
5836
5836
  };
5837
- }, [p.source, p.target, p.sourceHandle, p.targetHandle, p.selected, p.zIndex]), se), F = be(() => p.markerStart ? `url('#${Un(p.markerStart, h)}')` : void 0, [p.markerStart, h]), Y = be(() => p.markerEnd ? `url('#${Un(p.markerEnd, h)}')` : void 0, [p.markerEnd, h]);
5838
- if (p.hidden || I === null || P === null || C === null || z === null)
5837
+ }, [m.source, m.target, m.sourceHandle, m.targetHandle, m.selected, m.zIndex]), se), F = be(() => m.markerStart ? `url('#${Un(m.markerStart, h)}')` : void 0, [m.markerStart, h]), Y = be(() => m.markerEnd ? `url('#${Un(m.markerEnd, h)}')` : void 0, [m.markerEnd, h]);
5838
+ if (m.hidden || $ === null || P === null || C === null || z === null)
5839
5839
  return null;
5840
5840
  const K = (q) => {
5841
5841
  var oe;
5842
5842
  const { addSelectedEdges: j, unselectNodesAndEdges: re, multiSelectionActive: te } = A.getState();
5843
- T && (A.setState({ nodesSelectionActive: !1 }), p.selected && te ? (re({ nodes: [], edges: [p] }), (oe = B.current) == null || oe.blur()) : j([e])), o && o(q, p);
5843
+ T && (A.setState({ nodesSelectionActive: !1 }), m.selected && te ? (re({ nodes: [], edges: [m] }), (oe = B.current) == null || oe.blur()) : j([e])), o && o(q, m);
5844
5844
  }, Z = i ? (q) => {
5845
- i(q, { ...p });
5845
+ i(q, { ...m });
5846
5846
  } : void 0, X = s ? (q) => {
5847
- s(q, { ...p });
5847
+ s(q, { ...m });
5848
5848
  } : void 0, H = a ? (q) => {
5849
- a(q, { ...p });
5849
+ a(q, { ...m });
5850
5850
  } : void 0, W = c ? (q) => {
5851
- c(q, { ...p });
5851
+ c(q, { ...m });
5852
5852
  } : void 0, Q = l ? (q) => {
5853
- l(q, { ...p });
5853
+ l(q, { ...m });
5854
5854
  } : void 0, V = (q) => {
5855
5855
  var j;
5856
5856
  if (!v && hi.includes(q.key) && T) {
5857
5857
  const { unselectNodesAndEdges: re, addSelectedEdges: te } = A.getState();
5858
- q.key === "Escape" ? ((j = B.current) == null || j.blur(), re({ edges: [p] })) : te([e]);
5858
+ q.key === "Escape" ? ((j = B.current) == null || j.blur(), re({ edges: [m] })) : te([e]);
5859
5859
  }
5860
5860
  };
5861
5861
  return D("svg", { style: { zIndex: N }, children: ce("g", { className: ue([
5862
5862
  "react-flow__edge",
5863
5863
  `react-flow__edge-${S}`,
5864
- p.className,
5864
+ m.className,
5865
5865
  x,
5866
5866
  {
5867
- selected: p.selected,
5868
- animated: p.animated,
5867
+ selected: m.selected,
5868
+ animated: m.animated,
5869
5869
  inactive: !T && !o,
5870
5870
  updating: k,
5871
5871
  selectable: T
5872
5872
  }
5873
- ]), onClick: K, onDoubleClick: Z, onContextMenu: X, onMouseEnter: H, onMouseMove: W, onMouseLeave: Q, onKeyDown: E ? V : void 0, tabIndex: E ? 0 : void 0, role: (J = p.ariaRole) != null ? J : E ? "group" : "img", "aria-roledescription": "edge", "data-id": e, "data-testid": `rf__edge-${e}`, "aria-label": p.ariaLabel === null ? void 0 : p.ariaLabel || `Edge from ${p.source} to ${p.target}`, "aria-describedby": E ? `${Ki}-${h}` : void 0, ref: B, ...p.domAttributes, children: [!L && D(_, { id: e, source: p.source, target: p.target, type: p.type, selected: p.selected, animated: p.animated, selectable: T, deletable: (U = p.deletable) != null ? U : !0, label: p.label, labelStyle: p.labelStyle, labelShowBg: p.labelShowBg, labelBgStyle: p.labelBgStyle, labelBgPadding: p.labelBgPadding, labelBgBorderRadius: p.labelBgBorderRadius, sourceX: I, sourceY: P, targetX: C, targetY: z, sourcePosition: R, targetPosition: O, data: p.data, style: p.style, sourceHandleId: p.sourceHandle, targetHandleId: p.targetHandle, markerStart: F, markerEnd: Y, pathOptions: "pathOptions" in p ? p.pathOptions : void 0, interactionWidth: p.interactionWidth }), $ && D(Yh, { edge: p, isReconnectable: $, reconnectRadius: d, onReconnect: u, onReconnectStart: f, onReconnectEnd: g, sourceX: I, sourceY: P, targetX: C, targetY: z, sourcePosition: R, targetPosition: O, setUpdateHover: M, setReconnecting: b })] }) });
5873
+ ]), onClick: K, onDoubleClick: Z, onContextMenu: X, onMouseEnter: H, onMouseMove: W, onMouseLeave: Q, onKeyDown: E ? V : void 0, tabIndex: E ? 0 : void 0, role: (J = m.ariaRole) != null ? J : E ? "group" : "img", "aria-roledescription": "edge", "data-id": e, "data-testid": `rf__edge-${e}`, "aria-label": m.ariaLabel === null ? void 0 : m.ariaLabel || `Edge from ${m.source} to ${m.target}`, "aria-describedby": E ? `${Ki}-${h}` : void 0, ref: B, ...m.domAttributes, children: [!L && D(_, { id: e, source: m.source, target: m.target, type: m.type, selected: m.selected, animated: m.animated, selectable: T, deletable: (U = m.deletable) != null ? U : !0, label: m.label, labelStyle: m.labelStyle, labelShowBg: m.labelShowBg, labelBgStyle: m.labelBgStyle, labelBgPadding: m.labelBgPadding, labelBgBorderRadius: m.labelBgBorderRadius, sourceX: $, sourceY: P, targetX: C, targetY: z, sourcePosition: R, targetPosition: O, data: m.data, style: m.style, sourceHandleId: m.sourceHandle, targetHandleId: m.targetHandle, markerStart: F, markerEnd: Y, pathOptions: "pathOptions" in m ? m.pathOptions : void 0, interactionWidth: m.interactionWidth }), I && D(Yh, { edge: m, isReconnectable: I, reconnectRadius: d, onReconnect: u, onReconnectStart: f, onReconnectEnd: g, sourceX: $, sourceY: P, targetX: C, targetY: z, sourcePosition: R, targetPosition: O, setUpdateHover: M, setReconnecting: b })] }) });
5874
5874
  }
5875
5875
  var Gh = le(Wh);
5876
5876
  const Kh = (e) => ({
@@ -5881,8 +5881,8 @@ const Kh = (e) => ({
5881
5881
  onError: e.onError
5882
5882
  });
5883
5883
  function bs({ defaultMarkerColor: e, onlyRenderVisibleElements: t, rfId: n, edgeTypes: r, noPanClassName: o, onReconnect: i, onEdgeContextMenu: s, onEdgeMouseEnter: a, onEdgeMouseMove: c, onEdgeMouseLeave: l, onEdgeClick: d, reconnectRadius: u, onEdgeDoubleClick: f, onReconnectStart: g, onReconnectEnd: h, disableKeyboardA11y: y }) {
5884
- const { edgesFocusable: x, edgesReconnectable: m, elementsSelectable: v, onError: p } = ee(Kh, se), w = $h(t);
5885
- return ce("div", { className: "react-flow__edges", children: [D(Oh, { defaultColor: e, rfId: n }), w.map((S) => D(Gh, { id: S, edgesFocusable: x, edgesReconnectable: m, elementsSelectable: v, noPanClassName: o, onReconnect: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: l, onClick: d, reconnectRadius: u, onDoubleClick: f, onReconnectStart: g, onReconnectEnd: h, rfId: n, onError: p, edgeTypes: r, disableKeyboardA11y: y }, S))] });
5884
+ const { edgesFocusable: x, edgesReconnectable: p, elementsSelectable: v, onError: m } = ee(Kh, se), w = $h(t);
5885
+ return ce("div", { className: "react-flow__edges", children: [D(Oh, { defaultColor: e, rfId: n }), w.map((S) => D(Gh, { id: S, edgesFocusable: x, edgesReconnectable: p, elementsSelectable: v, noPanClassName: o, onReconnect: i, onContextMenu: s, onMouseEnter: a, onMouseMove: c, onMouseLeave: l, onClick: d, reconnectRadius: u, onDoubleClick: f, onReconnectStart: g, onReconnectEnd: h, rfId: n, onError: m, edgeTypes: r, disableKeyboardA11y: y }, S))] });
5886
5886
  }
5887
5887
  bs.displayName = "EdgeRenderer";
5888
5888
  const qh = le(bs), Uh = (e) => `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;
@@ -5990,16 +5990,16 @@ function sg() {
5990
5990
  }
5991
5991
  }, []);
5992
5992
  }
5993
- function _s({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick: o, onNodeDoubleClick: i, onEdgeDoubleClick: s, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: d, onSelectionContextMenu: u, onSelectionStart: f, onSelectionEnd: g, connectionLineType: h, connectionLineStyle: y, connectionLineComponent: x, connectionLineContainerStyle: m, selectionKeyCode: v, selectionOnDrag: p, selectionMode: w, multiSelectionKeyCode: S, panActivationKeyCode: _, zoomActivationKeyCode: E, deleteKeyCode: $, onlyRenderVisibleElements: T, elementsSelectable: B, defaultViewport: k, translateExtent: M, minZoom: L, maxZoom: b, preventScrolling: A, defaultMarkerColor: N, zoomOnScroll: I, zoomOnPinch: P, panOnScroll: C, panOnScrollSpeed: z, panOnScrollMode: R, zoomOnDoubleClick: O, panOnDrag: F, autoPanOnSelection: Y, onPaneClick: K, onPaneMouseEnter: Z, onPaneMouseMove: X, onPaneMouseLeave: H, onPaneScroll: W, onPaneContextMenu: Q, paneClickDistance: V, nodeClickDistance: J, onEdgeContextMenu: U, onEdgeMouseEnter: q, onEdgeMouseMove: j, onEdgeMouseLeave: re, reconnectRadius: te, onReconnect: oe, onReconnectStart: de, onReconnectEnd: fe, noDragClassName: Ae, noWheelClassName: pt, noPanClassName: Be, disableKeyboardA11y: Ve, nodeExtent: Je, rfId: Ie, viewport: he, onViewportChange: Fe }) {
5994
- return To(e), To(t), sg(), Qh(n), jh(he), D(vh, { onPaneClick: K, onPaneMouseEnter: Z, onPaneMouseMove: X, onPaneMouseLeave: H, onPaneContextMenu: Q, onPaneScroll: W, paneClickDistance: V, deleteKeyCode: $, selectionKeyCode: v, selectionOnDrag: p, selectionMode: w, onSelectionStart: f, onSelectionEnd: g, multiSelectionKeyCode: S, panActivationKeyCode: _, zoomActivationKeyCode: E, elementsSelectable: B, zoomOnScroll: I, zoomOnPinch: P, zoomOnDoubleClick: O, panOnScroll: C, panOnScrollSpeed: z, panOnScrollMode: R, panOnDrag: F, autoPanOnSelection: Y, defaultViewport: k, translateExtent: M, minZoom: L, maxZoom: b, onSelectionContextMenu: u, preventScrolling: A, noDragClassName: Ae, noWheelClassName: pt, noPanClassName: Be, disableKeyboardA11y: Ve, onViewportChange: Fe, isControlledViewport: !!he, children: ce(Zh, { children: [D(qh, { edgeTypes: t, onEdgeClick: o, onEdgeDoubleClick: s, onReconnect: oe, onReconnectStart: de, onReconnectEnd: fe, onlyRenderVisibleElements: T, onEdgeContextMenu: U, onEdgeMouseEnter: q, onEdgeMouseMove: j, onEdgeMouseLeave: re, reconnectRadius: te, defaultMarkerColor: N, noPanClassName: Be, disableKeyboardA11y: Ve, rfId: Ie }), D(og, { style: y, type: h, component: x, containerStyle: m }), D("div", { className: "react-flow__edgelabel-renderer" }), D(Ih, { nodeTypes: e, onNodeClick: r, onNodeDoubleClick: i, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: d, nodeClickDistance: J, onlyRenderVisibleElements: T, noPanClassName: Be, noDragClassName: Ae, disableKeyboardA11y: Ve, nodeExtent: Je, rfId: Ie }), D("div", { className: "react-flow__viewport-portal" })] }) });
5993
+ function _s({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick: o, onNodeDoubleClick: i, onEdgeDoubleClick: s, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: d, onSelectionContextMenu: u, onSelectionStart: f, onSelectionEnd: g, connectionLineType: h, connectionLineStyle: y, connectionLineComponent: x, connectionLineContainerStyle: p, selectionKeyCode: v, selectionOnDrag: m, selectionMode: w, multiSelectionKeyCode: S, panActivationKeyCode: _, zoomActivationKeyCode: E, deleteKeyCode: I, onlyRenderVisibleElements: T, elementsSelectable: B, defaultViewport: k, translateExtent: M, minZoom: L, maxZoom: b, preventScrolling: A, defaultMarkerColor: N, zoomOnScroll: $, zoomOnPinch: P, panOnScroll: C, panOnScrollSpeed: z, panOnScrollMode: R, zoomOnDoubleClick: O, panOnDrag: F, autoPanOnSelection: Y, onPaneClick: K, onPaneMouseEnter: Z, onPaneMouseMove: X, onPaneMouseLeave: H, onPaneScroll: W, onPaneContextMenu: Q, paneClickDistance: V, nodeClickDistance: J, onEdgeContextMenu: U, onEdgeMouseEnter: q, onEdgeMouseMove: j, onEdgeMouseLeave: re, reconnectRadius: te, onReconnect: oe, onReconnectStart: de, onReconnectEnd: fe, noDragClassName: Ae, noWheelClassName: pt, noPanClassName: Be, disableKeyboardA11y: Ve, nodeExtent: Je, rfId: Ie, viewport: he, onViewportChange: Fe }) {
5994
+ return To(e), To(t), sg(), Qh(n), jh(he), D(vh, { onPaneClick: K, onPaneMouseEnter: Z, onPaneMouseMove: X, onPaneMouseLeave: H, onPaneContextMenu: Q, onPaneScroll: W, paneClickDistance: V, deleteKeyCode: I, selectionKeyCode: v, selectionOnDrag: m, selectionMode: w, onSelectionStart: f, onSelectionEnd: g, multiSelectionKeyCode: S, panActivationKeyCode: _, zoomActivationKeyCode: E, elementsSelectable: B, zoomOnScroll: $, zoomOnPinch: P, zoomOnDoubleClick: O, panOnScroll: C, panOnScrollSpeed: z, panOnScrollMode: R, panOnDrag: F, autoPanOnSelection: Y, defaultViewport: k, translateExtent: M, minZoom: L, maxZoom: b, onSelectionContextMenu: u, preventScrolling: A, noDragClassName: Ae, noWheelClassName: pt, noPanClassName: Be, disableKeyboardA11y: Ve, onViewportChange: Fe, isControlledViewport: !!he, children: ce(Zh, { children: [D(qh, { edgeTypes: t, onEdgeClick: o, onEdgeDoubleClick: s, onReconnect: oe, onReconnectStart: de, onReconnectEnd: fe, onlyRenderVisibleElements: T, onEdgeContextMenu: U, onEdgeMouseEnter: q, onEdgeMouseMove: j, onEdgeMouseLeave: re, reconnectRadius: te, defaultMarkerColor: N, noPanClassName: Be, disableKeyboardA11y: Ve, rfId: Ie }), D(og, { style: y, type: h, component: x, containerStyle: p }), D("div", { className: "react-flow__edgelabel-renderer" }), D(Ih, { nodeTypes: e, onNodeClick: r, onNodeDoubleClick: i, onNodeMouseEnter: a, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: d, nodeClickDistance: J, onlyRenderVisibleElements: T, noPanClassName: Be, noDragClassName: Ae, disableKeyboardA11y: Ve, nodeExtent: Je, rfId: Ie }), D("div", { className: "react-flow__viewport-portal" })] }) });
5995
5995
  }
5996
5996
  _s.displayName = "GraphView";
5997
5997
  const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, width: o, height: i, fitView: s, fitViewOptions: a, minZoom: c = 0.5, maxZoom: l = 2, nodeOrigin: d, nodeExtent: u, zIndexMode: f = "basic" } = {}) => {
5998
- var E, $, T;
5999
- const g = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), m = (E = r != null ? r : t) != null ? E : [], v = ($ = n != null ? n : e) != null ? $ : [], p = d != null ? d : [0, 0], w = u != null ? u : Ct;
6000
- Di(y, x, m);
5998
+ var E, I, T;
5999
+ const g = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), p = (E = r != null ? r : t) != null ? E : [], v = (I = n != null ? n : e) != null ? I : [], m = d != null ? d : [0, 0], w = u != null ? u : Ct;
6000
+ Di(y, x, p);
6001
6001
  const { nodesInitialized: S } = Zn(v, g, h, {
6002
- nodeOrigin: p,
6002
+ nodeOrigin: m,
6003
6003
  nodeExtent: w,
6004
6004
  zIndexMode: f
6005
6005
  });
@@ -6019,7 +6019,7 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
6019
6019
  nodesInitialized: S,
6020
6020
  nodeLookup: g,
6021
6021
  parentLookup: h,
6022
- edges: m,
6022
+ edges: p,
6023
6023
  edgeLookup: x,
6024
6024
  connectionLookup: y,
6025
6025
  onNodesChange: null,
@@ -6038,7 +6038,7 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
6038
6038
  domNode: null,
6039
6039
  paneDragging: !1,
6040
6040
  noPanClassName: "nopan",
6041
- nodeOrigin: p,
6041
+ nodeOrigin: m,
6042
6042
  nodeDragThreshold: 1,
6043
6043
  connectionDragThreshold: 1,
6044
6044
  snapGrid: [15, 15],
@@ -6077,15 +6077,15 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
6077
6077
  };
6078
6078
  }, lg = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, width: o, height: i, fitView: s, fitViewOptions: a, minZoom: c, maxZoom: l, nodeOrigin: d, nodeExtent: u, zIndexMode: f }) => vf((g, h) => {
6079
6079
  async function y() {
6080
- const { nodeLookup: x, panZoom: m, fitViewOptions: v, fitViewResolver: p, width: w, height: S, minZoom: _, maxZoom: E } = h();
6081
- m && (await gd({
6080
+ const { nodeLookup: x, panZoom: p, fitViewOptions: v, fitViewResolver: m, width: w, height: S, minZoom: _, maxZoom: E } = h();
6081
+ p && (await gd({
6082
6082
  nodes: x,
6083
6083
  width: w,
6084
6084
  height: S,
6085
- panZoom: m,
6085
+ panZoom: p,
6086
6086
  minZoom: _,
6087
6087
  maxZoom: E
6088
- }, v), p == null || p.resolve(!0), g({ fitViewResolver: null }));
6088
+ }, v), m == null || m.resolve(!0), g({ fitViewResolver: null }));
6089
6089
  }
6090
6090
  return {
6091
6091
  ...Do({
@@ -6104,33 +6104,33 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
6104
6104
  zIndexMode: f
6105
6105
  }),
6106
6106
  setNodes: (x) => {
6107
- const { nodeLookup: m, parentLookup: v, nodeOrigin: p, elevateNodesOnSelect: w, fitViewQueued: S, zIndexMode: _, nodesSelectionActive: E } = h(), { nodesInitialized: $, hasSelectedNodes: T } = Zn(x, m, v, {
6108
- nodeOrigin: p,
6107
+ const { nodeLookup: p, parentLookup: v, nodeOrigin: m, elevateNodesOnSelect: w, fitViewQueued: S, zIndexMode: _, nodesSelectionActive: E } = h(), { nodesInitialized: I, hasSelectedNodes: T } = Zn(x, p, v, {
6108
+ nodeOrigin: m,
6109
6109
  nodeExtent: u,
6110
6110
  elevateNodesOnSelect: w,
6111
6111
  checkEquality: !0,
6112
6112
  zIndexMode: _
6113
6113
  }), B = E && T;
6114
- S && $ ? (y(), g({
6114
+ S && I ? (y(), g({
6115
6115
  nodes: x,
6116
- nodesInitialized: $,
6116
+ nodesInitialized: I,
6117
6117
  fitViewQueued: !1,
6118
6118
  fitViewOptions: void 0,
6119
6119
  nodesSelectionActive: B
6120
- })) : g({ nodes: x, nodesInitialized: $, nodesSelectionActive: B });
6120
+ })) : g({ nodes: x, nodesInitialized: I, nodesSelectionActive: B });
6121
6121
  },
6122
6122
  setEdges: (x) => {
6123
- const { connectionLookup: m, edgeLookup: v } = h();
6124
- Di(m, v, x), g({ edges: x });
6123
+ const { connectionLookup: p, edgeLookup: v } = h();
6124
+ Di(p, v, x), g({ edges: x });
6125
6125
  },
6126
- setDefaultNodesAndEdges: (x, m) => {
6126
+ setDefaultNodesAndEdges: (x, p) => {
6127
6127
  if (x) {
6128
6128
  const { setNodes: v } = h();
6129
6129
  v(x), g({ hasDefaultNodes: !0 });
6130
6130
  }
6131
- if (m) {
6131
+ if (p) {
6132
6132
  const { setEdges: v } = h();
6133
- v(m), g({ hasDefaultEdges: !0 });
6133
+ v(p), g({ hasDefaultEdges: !0 });
6134
6134
  }
6135
6135
  },
6136
6136
  /*
@@ -6139,14 +6139,14 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
6139
6139
  * new dimensions and update the nodes.
6140
6140
  */
6141
6141
  updateNodeInternals: (x) => {
6142
- const { triggerNodeChanges: m, nodeLookup: v, parentLookup: p, domNode: w, nodeOrigin: S, nodeExtent: _, debug: E, fitViewQueued: $, zIndexMode: T } = h(), { changes: B, updatedInternals: k } = zd(x, v, p, w, S, _, T);
6143
- k && (Td(v, p, { nodeOrigin: S, nodeExtent: _, zIndexMode: T }), $ ? (y(), g({ fitViewQueued: !1, fitViewOptions: void 0 })) : g({}), (B == null ? void 0 : B.length) > 0 && (E && console.log("React Flow: trigger node changes", B), m == null || m(B)));
6142
+ const { triggerNodeChanges: p, nodeLookup: v, parentLookup: m, domNode: w, nodeOrigin: S, nodeExtent: _, debug: E, fitViewQueued: I, zIndexMode: T } = h(), { changes: B, updatedInternals: k } = zd(x, v, m, w, S, _, T);
6143
+ k && (Td(v, m, { nodeOrigin: S, nodeExtent: _, zIndexMode: T }), I ? (y(), g({ fitViewQueued: !1, fitViewOptions: void 0 })) : g({}), (B == null ? void 0 : B.length) > 0 && (E && console.log("React Flow: trigger node changes", B), p == null || p(B)));
6144
6144
  },
6145
- updateNodePositions: (x, m = !1) => {
6145
+ updateNodePositions: (x, p = !1) => {
6146
6146
  var T, B;
6147
6147
  const v = [];
6148
- let p = [];
6149
- const { nodeLookup: w, triggerNodeChanges: S, connection: _, updateConnection: E, onNodesChangeMiddlewareMap: $ } = h();
6148
+ let m = [];
6149
+ const { nodeLookup: w, triggerNodeChanges: S, connection: _, updateConnection: E, onNodesChangeMiddlewareMap: I } = h();
6150
6150
  for (const [k, M] of x) {
6151
6151
  const L = w.get(k), b = !!(L != null && L.expandParent && (L != null && L.parentId) && (M != null && M.position)), A = {
6152
6152
  id: k,
@@ -6155,7 +6155,7 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
6155
6155
  x: Math.max(0, M.position.x),
6156
6156
  y: Math.max(0, M.position.y)
6157
6157
  } : M.position,
6158
- dragging: m
6158
+ dragging: p
6159
6159
  };
6160
6160
  if (L && _.inProgress && _.fromNode.id === L.id) {
6161
6161
  const N = Qe(L, _.fromHandle, G.Left, !0);
@@ -6169,56 +6169,56 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
6169
6169
  width: (T = M.measured.width) != null ? T : 0,
6170
6170
  height: (B = M.measured.height) != null ? B : 0
6171
6171
  }
6172
- }), p.push(A);
6172
+ }), m.push(A);
6173
6173
  }
6174
6174
  if (v.length > 0) {
6175
6175
  const { parentLookup: k, nodeOrigin: M } = h(), L = pr(v, w, k, M);
6176
- p.push(...L);
6176
+ m.push(...L);
6177
6177
  }
6178
- for (const k of $.values())
6179
- p = k(p);
6180
- S(p);
6178
+ for (const k of I.values())
6179
+ m = k(m);
6180
+ S(m);
6181
6181
  },
6182
6182
  triggerNodeChanges: (x) => {
6183
- const { onNodesChange: m, setNodes: v, nodes: p, hasDefaultNodes: w, debug: S } = h();
6183
+ const { onNodesChange: p, setNodes: v, nodes: m, hasDefaultNodes: w, debug: S } = h();
6184
6184
  if (x != null && x.length) {
6185
6185
  if (w) {
6186
- const _ = Zi(x, p);
6186
+ const _ = Zi(x, m);
6187
6187
  v(_);
6188
6188
  }
6189
- S && console.log("React Flow: trigger node changes", x), m == null || m(x);
6189
+ S && console.log("React Flow: trigger node changes", x), p == null || p(x);
6190
6190
  }
6191
6191
  },
6192
6192
  triggerEdgeChanges: (x) => {
6193
- const { onEdgesChange: m, setEdges: v, edges: p, hasDefaultEdges: w, debug: S } = h();
6193
+ const { onEdgesChange: p, setEdges: v, edges: m, hasDefaultEdges: w, debug: S } = h();
6194
6194
  if (x != null && x.length) {
6195
6195
  if (w) {
6196
- const _ = Qi(x, p);
6196
+ const _ = Qi(x, m);
6197
6197
  v(_);
6198
6198
  }
6199
- S && console.log("React Flow: trigger edge changes", x), m == null || m(x);
6199
+ S && console.log("React Flow: trigger edge changes", x), p == null || p(x);
6200
6200
  }
6201
6201
  },
6202
6202
  addSelectedNodes: (x) => {
6203
- const { multiSelectionActive: m, edgeLookup: v, nodeLookup: p, triggerNodeChanges: w, triggerEdgeChanges: S } = h();
6204
- if (m) {
6203
+ const { multiSelectionActive: p, edgeLookup: v, nodeLookup: m, triggerNodeChanges: w, triggerEdgeChanges: S } = h();
6204
+ if (p) {
6205
6205
  const _ = x.map((E) => Xe(E, !0));
6206
6206
  w(_);
6207
6207
  return;
6208
6208
  }
6209
- w(nt(p, /* @__PURE__ */ new Set([...x]), !0)), S(nt(v));
6209
+ w(nt(m, /* @__PURE__ */ new Set([...x]), !0)), S(nt(v));
6210
6210
  },
6211
6211
  addSelectedEdges: (x) => {
6212
- const { multiSelectionActive: m, edgeLookup: v, nodeLookup: p, triggerNodeChanges: w, triggerEdgeChanges: S } = h();
6213
- if (m) {
6212
+ const { multiSelectionActive: p, edgeLookup: v, nodeLookup: m, triggerNodeChanges: w, triggerEdgeChanges: S } = h();
6213
+ if (p) {
6214
6214
  const _ = x.map((E) => Xe(E, !0));
6215
6215
  S(_);
6216
6216
  return;
6217
6217
  }
6218
- S(nt(v, /* @__PURE__ */ new Set([...x]))), w(nt(p, /* @__PURE__ */ new Set(), !0));
6218
+ S(nt(v, /* @__PURE__ */ new Set([...x]))), w(nt(m, /* @__PURE__ */ new Set(), !0));
6219
6219
  },
6220
- unselectNodesAndEdges: ({ nodes: x, edges: m } = {}) => {
6221
- const { edges: v, nodes: p, nodeLookup: w, triggerNodeChanges: S, triggerEdgeChanges: _ } = h(), E = x || p, $ = m || v, T = [];
6220
+ unselectNodesAndEdges: ({ nodes: x, edges: p } = {}) => {
6221
+ const { edges: v, nodes: m, nodeLookup: w, triggerNodeChanges: S, triggerEdgeChanges: _ } = h(), E = x || m, I = p || v, T = [];
6222
6222
  for (const k of E) {
6223
6223
  if (!k.selected)
6224
6224
  continue;
@@ -6226,32 +6226,32 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
6226
6226
  M && (M.selected = !1), T.push(Xe(k.id, !1));
6227
6227
  }
6228
6228
  const B = [];
6229
- for (const k of $)
6229
+ for (const k of I)
6230
6230
  k.selected && B.push(Xe(k.id, !1));
6231
6231
  S(T), _(B);
6232
6232
  },
6233
6233
  setMinZoom: (x) => {
6234
- const { panZoom: m, maxZoom: v } = h();
6235
- m == null || m.setScaleExtent([x, v]), g({ minZoom: x });
6234
+ const { panZoom: p, maxZoom: v } = h();
6235
+ p == null || p.setScaleExtent([x, v]), g({ minZoom: x });
6236
6236
  },
6237
6237
  setMaxZoom: (x) => {
6238
- const { panZoom: m, minZoom: v } = h();
6239
- m == null || m.setScaleExtent([v, x]), g({ maxZoom: x });
6238
+ const { panZoom: p, minZoom: v } = h();
6239
+ p == null || p.setScaleExtent([v, x]), g({ maxZoom: x });
6240
6240
  },
6241
6241
  setTranslateExtent: (x) => {
6242
- var m;
6243
- (m = h().panZoom) == null || m.setTranslateExtent(x), g({ translateExtent: x });
6242
+ var p;
6243
+ (p = h().panZoom) == null || p.setTranslateExtent(x), g({ translateExtent: x });
6244
6244
  },
6245
6245
  resetSelectedElements: () => {
6246
- const { edges: x, nodes: m, triggerNodeChanges: v, triggerEdgeChanges: p, elementsSelectable: w } = h();
6246
+ const { edges: x, nodes: p, triggerNodeChanges: v, triggerEdgeChanges: m, elementsSelectable: w } = h();
6247
6247
  if (!w)
6248
6248
  return;
6249
- const S = m.reduce((E, $) => $.selected ? [...E, Xe($.id, !1)] : E, []), _ = x.reduce((E, $) => $.selected ? [...E, Xe($.id, !1)] : E, []);
6250
- v(S), p(_);
6249
+ const S = p.reduce((E, I) => I.selected ? [...E, Xe(I.id, !1)] : E, []), _ = x.reduce((E, I) => I.selected ? [...E, Xe(I.id, !1)] : E, []);
6250
+ v(S), m(_);
6251
6251
  },
6252
6252
  setNodeExtent: (x) => {
6253
- const { nodes: m, nodeLookup: v, parentLookup: p, nodeOrigin: w, elevateNodesOnSelect: S, nodeExtent: _, zIndexMode: E } = h();
6254
- x[0][0] === _[0][0] && x[0][1] === _[0][1] && x[1][0] === _[1][0] && x[1][1] === _[1][1] || (Zn(m, v, p, {
6253
+ const { nodes: p, nodeLookup: v, parentLookup: m, nodeOrigin: w, elevateNodesOnSelect: S, nodeExtent: _, zIndexMode: E } = h();
6254
+ x[0][0] === _[0][0] && x[0][1] === _[0][1] && x[1][0] === _[1][0] && x[1][1] === _[1][1] || (Zn(p, v, m, {
6255
6255
  nodeOrigin: w,
6256
6256
  nodeExtent: x,
6257
6257
  elevateNodesOnSelect: S,
@@ -6260,17 +6260,17 @@ const ag = le(_s), cg = _i("React Flow", "https://reactflow.dev/"), Do = ({ node
6260
6260
  }), g({ nodeExtent: x }));
6261
6261
  },
6262
6262
  panBy: (x) => {
6263
- const { transform: m, width: v, height: p, panZoom: w, translateExtent: S } = h();
6264
- return Hd({ delta: x, panZoom: w, transform: m, translateExtent: S, width: v, height: p });
6263
+ const { transform: p, width: v, height: m, panZoom: w, translateExtent: S } = h();
6264
+ return Hd({ delta: x, panZoom: w, transform: p, translateExtent: S, width: v, height: m });
6265
6265
  },
6266
- setCenter: async (x, m, v) => {
6267
- const { width: p, height: w, maxZoom: S, panZoom: _ } = h();
6266
+ setCenter: async (x, p, v) => {
6267
+ const { width: m, height: w, maxZoom: S, panZoom: _ } = h();
6268
6268
  if (!_)
6269
6269
  return !1;
6270
6270
  const E = typeof (v == null ? void 0 : v.zoom) != "undefined" ? v.zoom : S;
6271
6271
  return await _.setViewport({
6272
- x: p / 2 - x * E,
6273
- y: w / 2 - m * E,
6272
+ x: m / 2 - x * E,
6273
+ y: w / 2 - p * E,
6274
6274
  zoom: E
6275
6275
  }, { duration: v == null ? void 0 : v.duration, ease: v == null ? void 0 : v.ease, interpolate: v == null ? void 0 : v.interpolate }), !0;
6276
6276
  },
@@ -6313,11 +6313,11 @@ const fg = {
6313
6313
  position: "relative",
6314
6314
  zIndex: 0
6315
6315
  };
6316
- function hg({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: o, nodeTypes: i, edgeTypes: s, onNodeClick: a, onEdgeClick: c, onInit: l, onMove: d, onMoveStart: u, onMoveEnd: f, onConnect: g, onConnectStart: h, onConnectEnd: y, onClickConnectStart: x, onClickConnectEnd: m, onNodeMouseEnter: v, onNodeMouseMove: p, onNodeMouseLeave: w, onNodeContextMenu: S, onNodeDoubleClick: _, onNodeDragStart: E, onNodeDrag: $, onNodeDragStop: T, onNodesDelete: B, onEdgesDelete: k, onDelete: M, onSelectionChange: L, onSelectionDragStart: b, onSelectionDrag: A, onSelectionDragStop: N, onSelectionContextMenu: I, onSelectionStart: P, onSelectionEnd: C, onBeforeDelete: z, connectionMode: R, connectionLineType: O = He.Bezier, connectionLineStyle: F, connectionLineComponent: Y, connectionLineContainerStyle: K, deleteKeyCode: Z = "Backspace", selectionKeyCode: X = "Shift", selectionOnDrag: H = !1, selectionMode: W = Mt.Full, panActivationKeyCode: Q = "Space", multiSelectionKeyCode: V = At() ? "Meta" : "Control", zoomActivationKeyCode: J = At() ? "Meta" : "Control", snapToGrid: U, snapGrid: q, onlyRenderVisibleElements: j = !1, selectNodesOnDrag: re, nodesDraggable: te, autoPanOnNodeFocus: oe, nodesConnectable: de, nodesFocusable: fe, nodeOrigin: Ae = qi, edgesFocusable: pt, edgesReconnectable: Be, elementsSelectable: Ve = !0, defaultViewport: Je = Lf, minZoom: Ie = 0.5, maxZoom: he = 2, translateExtent: Fe = Ct, preventScrolling: zt = !0, nodeExtent: je, defaultMarkerColor: Cs = "#b1b1b7", zoomOnScroll: Ms = !0, zoomOnPinch: ks = !0, panOnScroll: As = !1, panOnScrollSpeed: Is = 0.5, panOnScrollMode: $s = Ge.Free, zoomOnDoubleClick: Ps = !0, panOnDrag: Ts = !0, onPaneClick: Ds, onPaneMouseEnter: Ls, onPaneMouseMove: Os, onPaneMouseLeave: zs, onPaneScroll: Hs, onPaneContextMenu: Rs, paneClickDistance: Bs = 1, nodeClickDistance: Vs = 0, children: Fs, onReconnect: Xs, onReconnectStart: Ys, onReconnectEnd: Ws, onEdgeContextMenu: Gs, onEdgeDoubleClick: Ks, onEdgeMouseEnter: qs, onEdgeMouseMove: Us, onEdgeMouseLeave: Zs, reconnectRadius: Qs = 10, onNodesChange: Js, onEdgesChange: js, noDragClassName: ea = "nodrag", noWheelClassName: ta = "nowheel", noPanClassName: xr = "nopan", fitView: wr, fitViewOptions: br, connectOnClick: na, attributionPosition: ra, proOptions: oa, defaultEdgeOptions: ia, elevateNodesOnSelect: sa = !0, elevateEdgesOnSelect: aa = !1, disableKeyboardA11y: vr = !1, autoPanOnConnect: ca, autoPanOnNodeDrag: la, autoPanOnSelection: ua = !0, autoPanSpeed: da, connectionRadius: fa, isValidConnection: ha, onError: ga, style: pa, id: _r, nodeDragThreshold: ma, connectionDragThreshold: ya, viewport: xa, onViewportChange: wa, width: ba, height: va, colorMode: _a = "light", debug: Sa, onScroll: Ht, ariaLabelConfig: Ea, zIndexMode: Sr = "basic", ...Na }, Ca) {
6316
+ function hg({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: o, nodeTypes: i, edgeTypes: s, onNodeClick: a, onEdgeClick: c, onInit: l, onMove: d, onMoveStart: u, onMoveEnd: f, onConnect: g, onConnectStart: h, onConnectEnd: y, onClickConnectStart: x, onClickConnectEnd: p, onNodeMouseEnter: v, onNodeMouseMove: m, onNodeMouseLeave: w, onNodeContextMenu: S, onNodeDoubleClick: _, onNodeDragStart: E, onNodeDrag: I, onNodeDragStop: T, onNodesDelete: B, onEdgesDelete: k, onDelete: M, onSelectionChange: L, onSelectionDragStart: b, onSelectionDrag: A, onSelectionDragStop: N, onSelectionContextMenu: $, onSelectionStart: P, onSelectionEnd: C, onBeforeDelete: z, connectionMode: R, connectionLineType: O = He.Bezier, connectionLineStyle: F, connectionLineComponent: Y, connectionLineContainerStyle: K, deleteKeyCode: Z = "Backspace", selectionKeyCode: X = "Shift", selectionOnDrag: H = !1, selectionMode: W = Mt.Full, panActivationKeyCode: Q = "Space", multiSelectionKeyCode: V = At() ? "Meta" : "Control", zoomActivationKeyCode: J = At() ? "Meta" : "Control", snapToGrid: U, snapGrid: q, onlyRenderVisibleElements: j = !1, selectNodesOnDrag: re, nodesDraggable: te, autoPanOnNodeFocus: oe, nodesConnectable: de, nodesFocusable: fe, nodeOrigin: Ae = qi, edgesFocusable: pt, edgesReconnectable: Be, elementsSelectable: Ve = !0, defaultViewport: Je = Lf, minZoom: Ie = 0.5, maxZoom: he = 2, translateExtent: Fe = Ct, preventScrolling: zt = !0, nodeExtent: je, defaultMarkerColor: Cs = "#b1b1b7", zoomOnScroll: Ms = !0, zoomOnPinch: ks = !0, panOnScroll: As = !1, panOnScrollSpeed: Is = 0.5, panOnScrollMode: $s = Ge.Free, zoomOnDoubleClick: Ps = !0, panOnDrag: Ts = !0, onPaneClick: Ds, onPaneMouseEnter: Ls, onPaneMouseMove: Os, onPaneMouseLeave: zs, onPaneScroll: Hs, onPaneContextMenu: Rs, paneClickDistance: Bs = 1, nodeClickDistance: Vs = 0, children: Fs, onReconnect: Xs, onReconnectStart: Ys, onReconnectEnd: Ws, onEdgeContextMenu: Gs, onEdgeDoubleClick: Ks, onEdgeMouseEnter: qs, onEdgeMouseMove: Us, onEdgeMouseLeave: Zs, reconnectRadius: Qs = 10, onNodesChange: Js, onEdgesChange: js, noDragClassName: ea = "nodrag", noWheelClassName: ta = "nowheel", noPanClassName: xr = "nopan", fitView: wr, fitViewOptions: br, connectOnClick: na, attributionPosition: ra, proOptions: oa, defaultEdgeOptions: ia, elevateNodesOnSelect: sa = !0, elevateEdgesOnSelect: aa = !1, disableKeyboardA11y: vr = !1, autoPanOnConnect: ca, autoPanOnNodeDrag: la, autoPanOnSelection: ua = !0, autoPanSpeed: da, connectionRadius: fa, isValidConnection: ha, onError: ga, style: pa, id: _r, nodeDragThreshold: ma, connectionDragThreshold: ya, viewport: xa, onViewportChange: wa, width: ba, height: va, colorMode: _a = "light", debug: Sa, onScroll: Ht, ariaLabelConfig: Ea, zIndexMode: Sr = "basic", ...Na }, Ca) {
6317
6317
  const Nn = _r || "1", Ma = Rf(_a), ka = we((Er) => {
6318
6318
  Er.currentTarget.scrollTo({ top: 0, left: 0, behavior: "instant" }), Ht == null || Ht(Er);
6319
6319
  }, [Ht]);
6320
- return D("div", { "data-testid": "rf__wrapper", ...Na, onScroll: ka, style: { ...pa, ...fg }, ref: Ca, className: ue(["react-flow", o, Ma]), id: _r, role: "application", children: ce(dg, { nodes: e, edges: t, width: ba, height: va, fitView: wr, fitViewOptions: br, minZoom: Ie, maxZoom: he, nodeOrigin: Ae, nodeExtent: je, zIndexMode: Sr, children: [D(Hf, { nodes: e, edges: t, defaultNodes: n, defaultEdges: r, onConnect: g, onConnectStart: h, onConnectEnd: y, onClickConnectStart: x, onClickConnectEnd: m, nodesDraggable: te, autoPanOnNodeFocus: oe, nodesConnectable: de, nodesFocusable: fe, edgesFocusable: pt, edgesReconnectable: Be, elementsSelectable: Ve, elevateNodesOnSelect: sa, elevateEdgesOnSelect: aa, minZoom: Ie, maxZoom: he, nodeExtent: je, onNodesChange: Js, onEdgesChange: js, snapToGrid: U, snapGrid: q, connectionMode: R, translateExtent: Fe, connectOnClick: na, defaultEdgeOptions: ia, fitView: wr, fitViewOptions: br, onNodesDelete: B, onEdgesDelete: k, onDelete: M, onNodeDragStart: E, onNodeDrag: $, onNodeDragStop: T, onSelectionDrag: A, onSelectionDragStart: b, onSelectionDragStop: N, onMove: d, onMoveStart: u, onMoveEnd: f, noPanClassName: xr, nodeOrigin: Ae, rfId: Nn, autoPanOnConnect: ca, autoPanOnNodeDrag: la, autoPanSpeed: da, onError: ga, connectionRadius: fa, isValidConnection: ha, selectNodesOnDrag: re, nodeDragThreshold: ma, connectionDragThreshold: ya, onBeforeDelete: z, debug: Sa, ariaLabelConfig: Ea, zIndexMode: Sr }), D(ag, { onInit: l, onNodeClick: a, onEdgeClick: c, onNodeMouseEnter: v, onNodeMouseMove: p, onNodeMouseLeave: w, onNodeContextMenu: S, onNodeDoubleClick: _, nodeTypes: i, edgeTypes: s, connectionLineType: O, connectionLineStyle: F, connectionLineComponent: Y, connectionLineContainerStyle: K, selectionKeyCode: X, selectionOnDrag: H, selectionMode: W, deleteKeyCode: Z, multiSelectionKeyCode: V, panActivationKeyCode: Q, zoomActivationKeyCode: J, onlyRenderVisibleElements: j, defaultViewport: Je, translateExtent: Fe, minZoom: Ie, maxZoom: he, preventScrolling: zt, zoomOnScroll: Ms, zoomOnPinch: ks, zoomOnDoubleClick: Ps, panOnScroll: As, panOnScrollSpeed: Is, panOnScrollMode: $s, panOnDrag: Ts, autoPanOnSelection: ua, onPaneClick: Ds, onPaneMouseEnter: Ls, onPaneMouseMove: Os, onPaneMouseLeave: zs, onPaneScroll: Hs, onPaneContextMenu: Rs, paneClickDistance: Bs, nodeClickDistance: Vs, onSelectionContextMenu: I, onSelectionStart: P, onSelectionEnd: C, onReconnect: Xs, onReconnectStart: Ys, onReconnectEnd: Ws, onEdgeContextMenu: Gs, onEdgeDoubleClick: Ks, onEdgeMouseEnter: qs, onEdgeMouseMove: Us, onEdgeMouseLeave: Zs, reconnectRadius: Qs, defaultMarkerColor: Cs, noDragClassName: ea, noWheelClassName: ta, noPanClassName: xr, rfId: Nn, disableKeyboardA11y: vr, nodeExtent: je, viewport: xa, onViewportChange: wa }), D(Df, { onSelectionChange: L }), Fs, D(Af, { proOptions: oa, position: ra }), D(kf, { rfId: Nn, disableKeyboardA11y: vr })] }) });
6320
+ return D("div", { "data-testid": "rf__wrapper", ...Na, onScroll: ka, style: { ...pa, ...fg }, ref: Ca, className: ue(["react-flow", o, Ma]), id: _r, role: "application", children: ce(dg, { nodes: e, edges: t, width: ba, height: va, fitView: wr, fitViewOptions: br, minZoom: Ie, maxZoom: he, nodeOrigin: Ae, nodeExtent: je, zIndexMode: Sr, children: [D(Hf, { nodes: e, edges: t, defaultNodes: n, defaultEdges: r, onConnect: g, onConnectStart: h, onConnectEnd: y, onClickConnectStart: x, onClickConnectEnd: p, nodesDraggable: te, autoPanOnNodeFocus: oe, nodesConnectable: de, nodesFocusable: fe, edgesFocusable: pt, edgesReconnectable: Be, elementsSelectable: Ve, elevateNodesOnSelect: sa, elevateEdgesOnSelect: aa, minZoom: Ie, maxZoom: he, nodeExtent: je, onNodesChange: Js, onEdgesChange: js, snapToGrid: U, snapGrid: q, connectionMode: R, translateExtent: Fe, connectOnClick: na, defaultEdgeOptions: ia, fitView: wr, fitViewOptions: br, onNodesDelete: B, onEdgesDelete: k, onDelete: M, onNodeDragStart: E, onNodeDrag: I, onNodeDragStop: T, onSelectionDrag: A, onSelectionDragStart: b, onSelectionDragStop: N, onMove: d, onMoveStart: u, onMoveEnd: f, noPanClassName: xr, nodeOrigin: Ae, rfId: Nn, autoPanOnConnect: ca, autoPanOnNodeDrag: la, autoPanSpeed: da, onError: ga, connectionRadius: fa, isValidConnection: ha, selectNodesOnDrag: re, nodeDragThreshold: ma, connectionDragThreshold: ya, onBeforeDelete: z, debug: Sa, ariaLabelConfig: Ea, zIndexMode: Sr }), D(ag, { onInit: l, onNodeClick: a, onEdgeClick: c, onNodeMouseEnter: v, onNodeMouseMove: m, onNodeMouseLeave: w, onNodeContextMenu: S, onNodeDoubleClick: _, nodeTypes: i, edgeTypes: s, connectionLineType: O, connectionLineStyle: F, connectionLineComponent: Y, connectionLineContainerStyle: K, selectionKeyCode: X, selectionOnDrag: H, selectionMode: W, deleteKeyCode: Z, multiSelectionKeyCode: V, panActivationKeyCode: Q, zoomActivationKeyCode: J, onlyRenderVisibleElements: j, defaultViewport: Je, translateExtent: Fe, minZoom: Ie, maxZoom: he, preventScrolling: zt, zoomOnScroll: Ms, zoomOnPinch: ks, zoomOnDoubleClick: Ps, panOnScroll: As, panOnScrollSpeed: Is, panOnScrollMode: $s, panOnDrag: Ts, autoPanOnSelection: ua, onPaneClick: Ds, onPaneMouseEnter: Ls, onPaneMouseMove: Os, onPaneMouseLeave: zs, onPaneScroll: Hs, onPaneContextMenu: Rs, paneClickDistance: Bs, nodeClickDistance: Vs, onSelectionContextMenu: $, onSelectionStart: P, onSelectionEnd: C, onReconnect: Xs, onReconnectStart: Ys, onReconnectEnd: Ws, onEdgeContextMenu: Gs, onEdgeDoubleClick: Ks, onEdgeMouseEnter: qs, onEdgeMouseMove: Us, onEdgeMouseLeave: Zs, reconnectRadius: Qs, defaultMarkerColor: Cs, noDragClassName: ea, noWheelClassName: ta, noPanClassName: xr, rfId: Nn, disableKeyboardA11y: vr, nodeExtent: je, viewport: xa, onViewportChange: wa }), D(Df, { onSelectionChange: L }), Fs, D(Af, { proOptions: oa, position: ra }), D(kf, { rfId: Nn, disableKeyboardA11y: vr })] }) });
6321
6321
  }
6322
6322
  var gg = Ji(hg);
6323
6323
  function pg(e) {
@@ -6358,7 +6358,7 @@ function Ss({
6358
6358
  className: l,
6359
6359
  patternClassName: d
6360
6360
  }) {
6361
- const u = ne(null), { transform: f, patternId: g } = ee(bg, se), h = r || wg[t], y = t === Re.Dots, x = t === Re.Cross, m = Array.isArray(n) ? n : [n, n], v = [m[0] * f[2] || 1, m[1] * f[2] || 1], p = h * f[2], w = Array.isArray(i) ? i : [i, i], S = x ? [p, p] : v, _ = [
6361
+ const u = ne(null), { transform: f, patternId: g } = ee(bg, se), h = r || wg[t], y = t === Re.Dots, x = t === Re.Cross, p = Array.isArray(n) ? n : [n, n], v = [p[0] * f[2] || 1, p[1] * f[2] || 1], m = h * f[2], w = Array.isArray(i) ? i : [i, i], S = x ? [m, m] : v, _ = [
6362
6362
  w[0] * f[2] || 1 + S[0] / 2,
6363
6363
  w[1] * f[2] || 1 + S[1] / 2
6364
6364
  ], E = `${g}${e || ""}`;
@@ -6367,7 +6367,7 @@ function Ss({
6367
6367
  ...Sn,
6368
6368
  "--xy-background-color-props": a,
6369
6369
  "--xy-background-pattern-color-props": s
6370
- }, ref: u, "data-testid": "rf__background", children: [D("pattern", { id: E, x: f[0] % v[0], y: f[1] % v[1], width: v[0], height: v[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${_[0]},-${_[1]})`, children: y ? D(xg, { radius: p / 2, className: d }) : D(yg, { dimensions: S, lineWidth: o, variant: t, className: d }) }), D("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${E})` })] });
6370
+ }, ref: u, "data-testid": "rf__background", children: [D("pattern", { id: E, x: f[0] % v[0], y: f[1] % v[1], width: v[0], height: v[1], patternUnits: "userSpaceOnUse", patternTransform: `translate(-${_[0]},-${_[1]})`, children: y ? D(xg, { radius: m / 2, className: d }) : D(yg, { dimensions: S, lineWidth: o, variant: t, className: d }) }), D("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${E})` })] });
6371
6371
  }
6372
6372
  Ss.displayName = "Background";
6373
6373
  const vg = le(Ss);
@@ -6396,11 +6396,11 @@ const Mg = (e) => ({
6396
6396
  ariaLabelConfig: e.ariaLabelConfig
6397
6397
  });
6398
6398
  function Es({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive: r = !0, fitViewOptions: o, onZoomIn: i, onZoomOut: s, onFitView: a, onInteractiveChange: c, className: l, children: d, position: u = "bottom-left", orientation: f = "vertical", "aria-label": g }) {
6399
- const h = ae(), { isInteractive: y, minZoomReached: x, maxZoomReached: m, ariaLabelConfig: v } = ee(Mg, se), { zoomIn: p, zoomOut: w, fitView: S } = mr(), _ = () => {
6400
- p(), i == null || i();
6399
+ const h = ae(), { isInteractive: y, minZoomReached: x, maxZoomReached: p, ariaLabelConfig: v } = ee(Mg, se), { zoomIn: m, zoomOut: w, fitView: S } = mr(), _ = () => {
6400
+ m(), i == null || i();
6401
6401
  }, E = () => {
6402
6402
  w(), s == null || s();
6403
- }, $ = () => {
6403
+ }, I = () => {
6404
6404
  S(o), a == null || a();
6405
6405
  }, T = () => {
6406
6406
  h.setState({
@@ -6409,7 +6409,7 @@ function Es({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
6409
6409
  elementsSelectable: !y
6410
6410
  }), c == null || c(!y);
6411
6411
  };
6412
- return ce(_n, { className: ue(["react-flow__controls", f === "horizontal" ? "horizontal" : "vertical", l]), position: u, style: e, "data-testid": "rf__controls", "aria-label": g != null ? g : v["controls.ariaLabel"], children: [t && ce(De, { children: [D(Ut, { onClick: _, className: "react-flow__controls-zoomin", title: v["controls.zoomIn.ariaLabel"], "aria-label": v["controls.zoomIn.ariaLabel"], disabled: m, children: D(_g, {}) }), D(Ut, { onClick: E, className: "react-flow__controls-zoomout", title: v["controls.zoomOut.ariaLabel"], "aria-label": v["controls.zoomOut.ariaLabel"], disabled: x, children: D(Sg, {}) })] }), n && D(Ut, { className: "react-flow__controls-fitview", onClick: $, title: v["controls.fitView.ariaLabel"], "aria-label": v["controls.fitView.ariaLabel"], children: D(Eg, {}) }), r && D(Ut, { className: "react-flow__controls-interactive", onClick: T, title: v["controls.interactive.ariaLabel"], "aria-label": v["controls.interactive.ariaLabel"], children: y ? D(Cg, {}) : D(Ng, {}) }), d] });
6412
+ return ce(_n, { className: ue(["react-flow__controls", f === "horizontal" ? "horizontal" : "vertical", l]), position: u, style: e, "data-testid": "rf__controls", "aria-label": g != null ? g : v["controls.ariaLabel"], children: [t && ce(De, { children: [D(Ut, { onClick: _, className: "react-flow__controls-zoomin", title: v["controls.zoomIn.ariaLabel"], "aria-label": v["controls.zoomIn.ariaLabel"], disabled: p, children: D(_g, {}) }), D(Ut, { onClick: E, className: "react-flow__controls-zoomout", title: v["controls.zoomOut.ariaLabel"], "aria-label": v["controls.zoomOut.ariaLabel"], disabled: x, children: D(Sg, {}) })] }), n && D(Ut, { className: "react-flow__controls-fitview", onClick: I, title: v["controls.fitView.ariaLabel"], "aria-label": v["controls.fitView.ariaLabel"], children: D(Eg, {}) }), r && D(Ut, { className: "react-flow__controls-interactive", onClick: T, title: v["controls.interactive.ariaLabel"], "aria-label": v["controls.interactive.ariaLabel"], children: y ? D(Cg, {}) : D(Ng, {}) }), d] });
6413
6413
  }
6414
6414
  Es.displayName = "Controls";
6415
6415
  const kg = le(Es);
@@ -6419,7 +6419,7 @@ function Ag({ id: e, x: t, y: n, width: r, height: o, style: i, color: s, stroke
6419
6419
  fill: x,
6420
6420
  stroke: a,
6421
6421
  strokeWidth: c
6422
- }, shapeRendering: u, onClick: g ? (m) => g(m, e) : void 0 });
6422
+ }, shapeRendering: u, onClick: g ? (p) => g(p, e) : void 0 });
6423
6423
  }
6424
6424
  const Ig = le(Ag), $g = (e) => e.nodes.map((t) => t.id), Hn = (e) => e instanceof Function ? e : () => e;
6425
6425
  function Pg({
@@ -6452,12 +6452,12 @@ function Tg({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc
6452
6452
  const y = h.nodeLookup.get(e);
6453
6453
  if (!y)
6454
6454
  return { node: void 0, x: 0, y: 0, width: 0, height: 0 };
6455
- const x = y.internals.userNode, { x: m, y: v } = y.internals.positionAbsolute, { width: p, height: w } = Le(x);
6455
+ const x = y.internals.userNode, { x: p, y: v } = y.internals.positionAbsolute, { width: m, height: w } = Le(x);
6456
6456
  return {
6457
6457
  node: x,
6458
- x: m,
6458
+ x: p,
6459
6459
  y: v,
6460
- width: p,
6460
+ width: m,
6461
6461
  height: w
6462
6462
  };
6463
6463
  }, se);
@@ -6505,13 +6505,13 @@ function Ns({
6505
6505
  onNodeClick: h,
6506
6506
  pannable: y = !1,
6507
6507
  zoomable: x = !1,
6508
- ariaLabel: m,
6508
+ ariaLabel: p,
6509
6509
  inversePan: v,
6510
- zoomStep: p = 1,
6510
+ zoomStep: m = 1,
6511
6511
  offsetScale: w = 5
6512
6512
  }) {
6513
6513
  var U, q;
6514
- const S = ae(), _ = ne(null), { boundingRect: E, viewBB: $, rfId: T, panZoom: B, translateExtent: k, flowWidth: M, flowHeight: L, ariaLabelConfig: b } = ee(Rg, se), A = (U = e == null ? void 0 : e.width) != null ? U : Og, N = (q = e == null ? void 0 : e.height) != null ? q : zg, I = E.width / A, P = E.height / N, C = Math.max(I, P), z = C * A, R = C * N, O = w * C, F = E.x - (z - E.width) / 2 - O, Y = E.y - (R - E.height) / 2 - O, K = z + O * 2, Z = R + O * 2, X = `${Bg}-${T}`, H = ne(0), W = ne();
6514
+ const S = ae(), _ = ne(null), { boundingRect: E, viewBB: I, rfId: T, panZoom: B, translateExtent: k, flowWidth: M, flowHeight: L, ariaLabelConfig: b } = ee(Rg, se), A = (U = e == null ? void 0 : e.width) != null ? U : Og, N = (q = e == null ? void 0 : e.height) != null ? q : zg, $ = E.width / A, P = E.height / N, C = Math.max($, P), z = C * A, R = C * N, O = w * C, F = E.x - (z - E.width) / 2 - O, Y = E.y - (R - E.height) / 2 - O, K = z + O * 2, Z = R + O * 2, X = `${Bg}-${T}`, H = ne(0), W = ne();
6515
6515
  H.current = C, ie(() => {
6516
6516
  if (_.current && B)
6517
6517
  return W.current = Kd({
@@ -6531,10 +6531,10 @@ function Ns({
6531
6531
  height: L,
6532
6532
  inversePan: v,
6533
6533
  pannable: y,
6534
- zoomStep: p,
6534
+ zoomStep: m,
6535
6535
  zoomable: x
6536
6536
  });
6537
- }, [y, x, v, p, k, M, L]);
6537
+ }, [y, x, v, m, k, M, L]);
6538
6538
  const Q = g ? (j) => {
6539
6539
  var oe;
6540
6540
  const [re, te] = ((oe = W.current) == null ? void 0 : oe.pointer(j)) || [0, 0];
@@ -6542,7 +6542,7 @@ function Ns({
6542
6542
  } : void 0, V = h ? we((j, re) => {
6543
6543
  const te = S.getState().nodeLookup.get(re).internals.userNode;
6544
6544
  h(j, te);
6545
- }, []) : void 0, J = m != null ? m : b["minimap.ariaLabel"];
6545
+ }, []) : void 0, J = p != null ? p : b["minimap.ariaLabel"];
6546
6546
  return D(_n, { position: f, style: {
6547
6547
  ...e,
6548
6548
  "--xy-minimap-background-color-props": typeof c == "string" ? c : void 0,
@@ -6553,20 +6553,20 @@ function Ns({
6553
6553
  "--xy-minimap-node-stroke-color-props": typeof n == "string" ? n : void 0,
6554
6554
  "--xy-minimap-node-stroke-width-props": typeof s == "number" ? s : void 0
6555
6555
  }, className: ue(["react-flow__minimap", t]), "data-testid": "rf__minimap", children: ce("svg", { width: A, height: N, viewBox: `${F} ${Y} ${K} ${Z}`, className: "react-flow__minimap-svg", role: "img", "aria-labelledby": X, ref: _, onClick: Q, children: [J && D("title", { id: X, children: J }), D(Lg, { onClick: V, nodeColor: r, nodeStrokeColor: n, nodeBorderRadius: i, nodeClassName: o, nodeStrokeWidth: s, nodeComponent: a }), D("path", { className: "react-flow__minimap-mask", d: `M${F - O},${Y - O}h${K + O * 2}v${Z + O * 2}h${-K - O * 2}z
6556
- M${$.x},${$.y}h${$.width}v${$.height}h${-$.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) });
6556
+ M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`, fillRule: "evenodd", pointerEvents: "none" })] }) });
6557
6557
  }
6558
6558
  Ns.displayName = "MiniMap";
6559
6559
  const Vg = le(Ns), Fg = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, Xg = {
6560
6560
  [dt.Line]: "right",
6561
6561
  [dt.Handle]: "bottom-right"
6562
6562
  };
6563
- function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, style: o = void 0, children: i, color: s, minWidth: a = 10, minHeight: c = 10, maxWidth: l = Number.MAX_VALUE, maxHeight: d = Number.MAX_VALUE, keepAspectRatio: u = !1, resizeDirection: f, autoScale: g = !0, shouldResize: h, onResizeStart: y, onResize: x, onResizeEnd: m }) {
6564
- const v = ns(), p = typeof e == "string" ? e : v, w = ae(), S = ne(null), _ = n === dt.Handle, E = ee(we(Fg(_ && g), [_, g]), se), $ = ne(null), T = t != null ? t : Xg[n];
6563
+ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, style: o = void 0, children: i, color: s, minWidth: a = 10, minHeight: c = 10, maxWidth: l = Number.MAX_VALUE, maxHeight: d = Number.MAX_VALUE, keepAspectRatio: u = !1, resizeDirection: f, autoScale: g = !0, shouldResize: h, onResizeStart: y, onResize: x, onResizeEnd: p }) {
6564
+ const v = ns(), m = typeof e == "string" ? e : v, w = ae(), S = ne(null), _ = n === dt.Handle, E = ee(we(Fg(_ && g), [_, g]), se), I = ne(null), T = t != null ? t : Xg[n];
6565
6565
  ie(() => {
6566
- if (!(!S.current || !p))
6567
- return $.current || ($.current = af({
6566
+ if (!(!S.current || !m))
6567
+ return I.current || (I.current = af({
6568
6568
  domNode: S.current,
6569
- nodeId: p,
6569
+ nodeId: m,
6570
6570
  getStoreItems: () => {
6571
6571
  const { nodeLookup: k, transform: M, snapGrid: L, snapToGrid: b, nodeOrigin: A, domNode: N } = w.getState();
6572
6572
  return {
@@ -6580,7 +6580,7 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
6580
6580
  },
6581
6581
  onChange: (k, M) => {
6582
6582
  var z, R, O, F, Y, K, Z;
6583
- const { triggerNodeChanges: L, nodeLookup: b, parentLookup: A, nodeOrigin: N } = w.getState(), I = [], P = { x: k.x, y: k.y }, C = b.get(p);
6583
+ const { triggerNodeChanges: L, nodeLookup: b, parentLookup: A, nodeOrigin: N } = w.getState(), $ = [], P = { x: k.x, y: k.y }, C = b.get(m);
6584
6584
  if (C && C.expandParent && C.parentId) {
6585
6585
  const X = (z = C.origin) != null ? z : N, H = (O = (R = k.width) != null ? R : C.measured.width) != null ? O : 0, W = (Y = (F = k.height) != null ? F : C.measured.height) != null ? Y : 0, Q = {
6586
6586
  id: C.id,
@@ -6594,19 +6594,19 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
6594
6594
  }, { width: H, height: W }, C.parentId, b, X)
6595
6595
  }
6596
6596
  }, V = pr([Q], b, A, N);
6597
- I.push(...V), P.x = k.x ? Math.max(X[0] * H, k.x) : void 0, P.y = k.y ? Math.max(X[1] * W, k.y) : void 0;
6597
+ $.push(...V), P.x = k.x ? Math.max(X[0] * H, k.x) : void 0, P.y = k.y ? Math.max(X[1] * W, k.y) : void 0;
6598
6598
  }
6599
6599
  if (P.x !== void 0 && P.y !== void 0) {
6600
6600
  const X = {
6601
- id: p,
6601
+ id: m,
6602
6602
  type: "position",
6603
6603
  position: { ...P }
6604
6604
  };
6605
- I.push(X);
6605
+ $.push(X);
6606
6606
  }
6607
6607
  if (k.width !== void 0 && k.height !== void 0) {
6608
6608
  const H = {
6609
- id: p,
6609
+ id: m,
6610
6610
  type: "dimensions",
6611
6611
  resizing: !0,
6612
6612
  setAttributes: f ? f === "horizontal" ? "width" : "height" : !0,
@@ -6615,20 +6615,20 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
6615
6615
  height: k.height
6616
6616
  }
6617
6617
  };
6618
- I.push(H);
6618
+ $.push(H);
6619
6619
  }
6620
6620
  for (const X of M) {
6621
6621
  const H = {
6622
6622
  ...X,
6623
6623
  type: "position"
6624
6624
  };
6625
- I.push(H);
6625
+ $.push(H);
6626
6626
  }
6627
- L(I);
6627
+ L($);
6628
6628
  },
6629
6629
  onEnd: ({ width: k, height: M }) => {
6630
6630
  const L = {
6631
- id: p,
6631
+ id: m,
6632
6632
  type: "dimensions",
6633
6633
  resizing: !1,
6634
6634
  dimensions: {
@@ -6638,7 +6638,7 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
6638
6638
  };
6639
6639
  w.getState().triggerNodeChanges([L]);
6640
6640
  }
6641
- })), $.current.update({
6641
+ })), I.current.update({
6642
6642
  controlPosition: T,
6643
6643
  boundaries: {
6644
6644
  minWidth: a,
@@ -6650,11 +6650,11 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
6650
6650
  resizeDirection: f,
6651
6651
  onResizeStart: y,
6652
6652
  onResize: x,
6653
- onResizeEnd: m,
6653
+ onResizeEnd: p,
6654
6654
  shouldResize: h
6655
6655
  }), () => {
6656
6656
  var k;
6657
- (k = $.current) == null || k.destroy();
6657
+ (k = I.current) == null || k.destroy();
6658
6658
  };
6659
6659
  }, [
6660
6660
  T,
@@ -6665,7 +6665,7 @@ function Yg({ nodeId: e, position: t, variant: n = dt.Handle, className: r, styl
6665
6665
  u,
6666
6666
  y,
6667
6667
  x,
6668
- m,
6668
+ p,
6669
6669
  h
6670
6670
  ]);
6671
6671
  const B = T.split("-");
@@ -6799,44 +6799,45 @@ const Lo = [
6799
6799
  };
6800
6800
  function Jg({ formData: e }) {
6801
6801
  const { nodes: t, edges: n } = be(() => {
6802
+ var f, g;
6802
6803
  const l = [], d = [];
6803
6804
  let u = null;
6804
- return e == null || e.forEach((f, g) => {
6805
- var p, w;
6806
- const h = Lo[g % Lo.length], y = g * 400, x = 0, m = 320, v = 60 + (((p = f == null ? void 0 : f.questionData) == null ? void 0 : p.length) || 0) * 110;
6805
+ return (f = e == null ? void 0 : e.filter((h) => !(h != null && h.isDeleted))) == null || f.forEach((h, y) => {
6806
+ var _;
6807
+ const x = Lo[y % Lo.length], p = ((_ = h == null ? void 0 : h.questionData) == null ? void 0 : _.filter((E) => !(E != null && E.isDeleted))) || [], v = y * 400, m = 0, w = 320, S = 60 + p.length * 110;
6807
6808
  l.push({
6808
- id: f.id,
6809
+ id: h.id,
6809
6810
  type: "sectionGroup",
6810
- data: { title: f.title || `Section ${g + 1}` },
6811
- position: { x: y, y: x },
6811
+ data: { title: h.title || `Section ${y + 1}` },
6812
+ position: { x: v, y: m },
6812
6813
  style: {
6813
- width: m,
6814
- height: v,
6814
+ width: w,
6815
+ height: S,
6815
6816
  backgroundColor: "rgba(248, 250, 252, 0.4)",
6816
6817
  border: "2px dashed #cbd5e1",
6817
6818
  borderRadius: "16px"
6818
6819
  }
6819
- }), (w = f == null ? void 0 : f.questionData) == null || w.forEach((S, _) => {
6820
- const E = S.id;
6820
+ }), p.forEach((E, I) => {
6821
+ const T = E.id;
6821
6822
  l.push({
6822
- id: E,
6823
+ id: T,
6823
6824
  type: "customField",
6824
- parentId: f.id,
6825
+ parentId: h.id,
6825
6826
  extent: "parent",
6826
6827
  targetPosition: G.Top,
6827
6828
  sourcePosition: G.Bottom,
6828
6829
  data: {
6829
- label: S.inputLabel || S.label,
6830
- type: S.type,
6831
- sectionTitle: f.title || "Untitled Section",
6832
- isHidden: S.isHidden,
6833
- colorScheme: h
6830
+ label: E.inputLabel || E.label,
6831
+ type: E.type,
6832
+ sectionTitle: h.title || "Untitled Section",
6833
+ isHidden: E.isHidden,
6834
+ colorScheme: x
6834
6835
  },
6835
- position: { x: 20, y: 40 + _ * 110 }
6836
- }), u && !S.isHidden && d.push({
6837
- id: `e-${u}-${E}`,
6836
+ position: { x: 20, y: 40 + I * 110 }
6837
+ }), u && !E.isHidden && d.push({
6838
+ id: `e-${u}-${T}`,
6838
6839
  source: u,
6839
- target: E,
6840
+ target: T,
6840
6841
  type: "smoothstep",
6841
6842
  animated: !0,
6842
6843
  style: { stroke: "#cbd5e1", strokeWidth: 2 },
@@ -6846,20 +6847,20 @@ function Jg({ formData: e }) {
6846
6847
  height: 20,
6847
6848
  color: "#cbd5e1"
6848
6849
  }
6849
- }), S.isHidden || (u = E);
6850
+ }), E.isHidden || (u = T);
6850
6851
  });
6851
- }), e == null || e.forEach((f) => {
6852
- var g;
6853
- (g = f == null ? void 0 : f.questionData) == null || g.forEach((h) => {
6854
- var y;
6855
- h.isHidden && ((y = h.visibilityDependentFields) == null ? void 0 : y.length) > 0 && h.visibilityDependentFields.forEach((x) => {
6852
+ }), (g = e == null ? void 0 : e.filter((h) => !(h != null && h.isDeleted))) == null || g.forEach((h) => {
6853
+ var y, x;
6854
+ (x = (y = h == null ? void 0 : h.questionData) == null ? void 0 : y.filter((p) => !(p != null && p.isDeleted))) == null || x.forEach((p) => {
6855
+ var v;
6856
+ p.isHidden && ((v = p.visibilityDependentFields) == null ? void 0 : v.length) > 0 && p.visibilityDependentFields.forEach((m) => {
6856
6857
  d.push({
6857
- id: `e-cond-${x.id}-${h.id}`,
6858
- source: x.id,
6859
- target: h.id,
6858
+ id: `e-cond-${m.id}-${p.id}`,
6859
+ source: m.id,
6860
+ target: p.id,
6860
6861
  type: "smoothstep",
6861
6862
  animated: !0,
6862
- label: `if ${x.operator} '${x.fieldValue}'`,
6863
+ label: `if ${m.operator} '${m.fieldValue}'`,
6863
6864
  labelStyle: { fill: "#f59e0b", fontWeight: 600, fontSize: 12 },
6864
6865
  labelBgStyle: {
6865
6866
  fill: "#fffef2",