geonodes-web-render 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/embed.js CHANGED
@@ -14,7 +14,9 @@ async function b(e) {
14
14
  return new Uint8Array(n);
15
15
  }
16
16
  async function x(e) {
17
- let t = e.trim(), n = y(t.startsWith(v) ? t.slice(13) : t), r = n.length >= 2 && n[0] === 31 && n[1] === 139 ? await b(n) : n;
17
+ let t = e.trim();
18
+ if (t.startsWith("{") || t.startsWith("[")) return t;
19
+ let n = y(t.startsWith(v) ? t.slice(13) : t), r = n.length >= 2 && n[0] === 31 && n[1] === 139 ? await b(n) : n;
18
20
  return new TextDecoder().decode(r);
19
21
  }
20
22
  //#endregion
@@ -513,7 +515,8 @@ function nt(e) {
513
515
  }
514
516
  function rt(e) {
515
517
  return function() {
516
- this.textContent = e.apply(this, arguments) ?? "";
518
+ var t = e.apply(this, arguments);
519
+ this.textContent = t ?? "";
517
520
  };
518
521
  }
519
522
  function it(e) {
@@ -531,7 +534,8 @@ function ot(e) {
531
534
  }
532
535
  function st(e) {
533
536
  return function() {
534
- this.innerHTML = e.apply(this, arguments) ?? "";
537
+ var t = e.apply(this, arguments);
538
+ this.innerHTML = t ?? "";
535
539
  };
536
540
  }
537
541
  function ct(e) {
@@ -1961,7 +1965,8 @@ function Ii(e) {
1961
1965
  }
1962
1966
  function Li(e) {
1963
1967
  return function() {
1964
- this.textContent = e(this) ?? "";
1968
+ var t = e(this);
1969
+ this.textContent = t ?? "";
1965
1970
  };
1966
1971
  }
1967
1972
  function Ri(e) {
@@ -2379,10 +2384,10 @@ function fa() {
2379
2384
  //#endregion
2380
2385
  //#region node_modules/@xyflow/system/dist/esm/index.js
2381
2386
  var J = {
2382
- error001: () => "[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",
2387
+ error001: (e = "react") => `Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,
2383
2388
  error002: () => "It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",
2384
2389
  error003: (e) => `Node type "${e}" not found. Using fallback type "default".`,
2385
- error004: () => "The React Flow parent container needs a width and a height to render the graph.",
2390
+ error004: () => "The parent container needs a width and a height to render the graph.",
2386
2391
  error005: () => "Only child nodes can use a parent extent.",
2387
2392
  error006: () => "Can't create edge. An edge needs a source and a target.",
2388
2393
  error007: (e) => `The old edge with id=${e} does not exist.`,
@@ -2393,7 +2398,8 @@ var J = {
2393
2398
  error012: (e) => `Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,
2394
2399
  error013: (e = "react") => `It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,
2395
2400
  error014: () => "useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",
2396
- error015: () => "It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."
2401
+ error015: () => "It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",
2402
+ error016: (e) => `Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`
2397
2403
  }, pa = [[-Infinity, -Infinity], [Infinity, Infinity]], ma = [
2398
2404
  "Enter",
2399
2405
  " ",
@@ -2528,13 +2534,13 @@ function Ma(e, t) {
2528
2534
  }), n;
2529
2535
  }
2530
2536
  async function Na({ nodes: e, width: t, height: n, panZoom: r, minZoom: i, maxZoom: a }, o) {
2531
- if (e.size === 0) return Promise.resolve(!0);
2537
+ if (e.size === 0) return !0;
2532
2538
  let s = ro(ka(Ma(e, o)), t, n, o?.minZoom ?? i, o?.maxZoom ?? a, o?.padding ?? .1);
2533
2539
  return await r.setViewport(s, {
2534
2540
  duration: o?.duration,
2535
2541
  ease: o?.ease,
2536
2542
  interpolate: o?.interpolate
2537
- }), Promise.resolve(!0);
2543
+ }), !0;
2538
2544
  }
2539
2545
  function Pa({ nodeId: e, nextPosition: t, nodeLookup: n, nodeOrigin: r = [0, 0], nodeExtent: i, onError: a }) {
2540
2546
  let o = n.get(e), s = o.parentId ? n.get(o.parentId) : void 0, { x: c, y: l } = s ? s.internals.positionAbsolute : {
@@ -2626,8 +2632,8 @@ var za = (e, t, n) => e < t ? Ia(Math.abs(e - t), 1, t) / t : e > n ? -Ia(Math.a
2626
2632
  }, Ka = (e, t) => Ua(Va(Ha(e), Ha(t))), qa = (e, t) => {
2627
2633
  let n = Math.max(0, Math.min(e.x + e.width, t.x + t.width) - Math.max(e.x, t.x)), r = Math.max(0, Math.min(e.y + e.height, t.y + t.height) - Math.max(e.y, t.y));
2628
2634
  return Math.ceil(n * r);
2629
- }, Ja = (e) => Ya(e.width) && Ya(e.height) && Ya(e.x) && Ya(e.y), Ya = (e) => !isNaN(e) && isFinite(e), Xa = (e, t) => {
2630
- process.env.NODE_ENV === "development" && console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`);
2635
+ }, Ja = (e) => Ya(e.width) && Ya(e.height) && Ya(e.x) && Ya(e.y), Ya = (e) => !isNaN(e) && isFinite(e), Xa = (e, t) => (n, r) => {
2636
+ process.env.NODE_ENV === "development" && console.warn(`[${e}]: ${r} Help: ${t}error#${n}`);
2631
2637
  }, Za = (e, t = [1, 1]) => ({
2632
2638
  x: t[0] * Math.round(e.x / t[0]),
2633
2639
  y: t[1] * Math.round(e.y / t[1])
@@ -2651,7 +2657,7 @@ function eo(e, t) {
2651
2657
  let n = parseFloat(e);
2652
2658
  if (!Number.isNaN(n)) return Math.floor(t * n * .01);
2653
2659
  }
2654
- return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`), 0;
2660
+ return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`), 0;
2655
2661
  }
2656
2662
  function to(e, t, n) {
2657
2663
  if (typeof e == "string" || typeof e == "number") {
@@ -2881,7 +2887,7 @@ function Do({ sourceNode: e, targetNode: t, width: n, height: r, transform: i })
2881
2887
  }, Ua(a)) > 0;
2882
2888
  }
2883
2889
  var Oo = ({ source: e, sourceHandle: t, target: n, targetHandle: r }) => `xy-edge__${e}${t || ""}-${n}${r || ""}`, ko = (e, t) => t.some((t) => t.source === e.source && t.target === e.target && (t.sourceHandle === e.sourceHandle || !t.sourceHandle && !e.sourceHandle) && (t.targetHandle === e.targetHandle || !t.targetHandle && !e.targetHandle)), Ao = (e, t, n = {}) => {
2884
- if (!e.source || !e.target) return Xa("006", J.error006()), t;
2890
+ if (!e.source || !e.target) return n.onError?.("006", J.error006()), t;
2885
2891
  let r = n.getEdgeId || Oo, i;
2886
2892
  return i = wa(e) ? { ...e } : {
2887
2893
  ...e,
@@ -3000,18 +3006,19 @@ function Fo({ source: e, sourcePosition: t = Y.Bottom, target: n, targetPosition
3000
3006
  };
3001
3007
  Math.max(Math.abs(d.x - m[0].x), Math.abs(y.x - m[0].x)) >= Math.max(Math.abs(d.y - m[0].y), Math.abs(y.y - m[0].y)) ? (h = (d.x + y.x) / 2, g = m[0].y) : (h = m[0].x, g = (d.y + y.y) / 2);
3002
3008
  }
3009
+ let x = {
3010
+ x: l.x + _.x,
3011
+ y: l.y + _.y
3012
+ }, S = {
3013
+ x: u.x + v.x,
3014
+ y: u.y + v.y
3015
+ };
3003
3016
  return [
3004
3017
  [
3005
3018
  e,
3006
- {
3007
- x: l.x + _.x,
3008
- y: l.y + _.y
3009
- },
3019
+ ...x.x !== m[0].x || x.y !== m[0].y ? [x] : [],
3010
3020
  ...m,
3011
- {
3012
- x: u.x + v.x,
3013
- y: u.y + v.y
3014
- },
3021
+ ...S.x !== m[m.length - 1].x || S.y !== m[m.length - 1].y ? [S] : [],
3015
3022
  n
3016
3023
  ],
3017
3024
  h,
@@ -3048,12 +3055,10 @@ function Lo({ sourceX: e, sourceY: t, sourcePosition: n = Y.Bottom, targetX: r,
3048
3055
  },
3049
3056
  offset: l,
3050
3057
  stepPosition: u
3051
- });
3052
- return [
3053
- d.reduce((e, t, n) => {
3054
- let r = "";
3055
- return r = n > 0 && n < d.length - 1 ? Io(d[n - 1], t, d[n + 1], o) : `${n === 0 ? "M" : "L"}${t.x} ${t.y}`, e += r, e;
3056
- }, ""),
3058
+ }), g = `M${d[0].x} ${d[0].y}`;
3059
+ for (let e = 1; e < d.length - 1; e++) g += Io(d[e - 1], d[e], d[e + 1], o);
3060
+ return g += `L${d[d.length - 1].x} ${d[d.length - 1].y}`, [
3061
+ g,
3057
3062
  f,
3058
3063
  p,
3059
3064
  m,
@@ -3183,31 +3188,34 @@ function Qo(e) {
3183
3188
  return e === "manual";
3184
3189
  }
3185
3190
  function $o(e, t, n, r = {}) {
3186
- let i = Yo(Jo, r), a = { i: 0 }, o = new Map(t), s = i?.elevateNodesOnSelect && !Qo(i.zIndexMode) ? Go : 0, c = e.length > 0;
3191
+ let i = Yo(Jo, r), a = { i: 0 }, o = new Map(t), s = i?.elevateNodesOnSelect && !Qo(i.zIndexMode) ? Go : 0, c = e.length > 0, l = !1;
3187
3192
  t.clear(), n.clear();
3188
- for (let l of e) {
3189
- let e = o.get(l.id);
3190
- if (i.checkEquality && l === e?.internals.userNode) t.set(l.id, e);
3193
+ for (let u of e) {
3194
+ let e = o.get(u.id);
3195
+ if (i.checkEquality && u === e?.internals.userNode) t.set(u.id, e);
3191
3196
  else {
3192
- let n = La(Da(l, i.nodeOrigin), ao(l.extent) ? l.extent : i.nodeExtent, oo(l));
3197
+ let n = La(Da(u, i.nodeOrigin), ao(u.extent) ? u.extent : i.nodeExtent, oo(u));
3193
3198
  e = {
3194
3199
  ...i.defaults,
3195
- ...l,
3200
+ ...u,
3196
3201
  measured: {
3197
- width: l.measured?.width,
3198
- height: l.measured?.height
3202
+ width: u.measured?.width,
3203
+ height: u.measured?.height
3199
3204
  },
3200
3205
  internals: {
3201
3206
  positionAbsolute: n,
3202
- handleBounds: Zo(l, e),
3203
- z: ns(l, s, i.zIndexMode),
3204
- userNode: l
3207
+ handleBounds: Zo(u, e),
3208
+ z: ns(u, s, i.zIndexMode),
3209
+ userNode: u
3205
3210
  }
3206
- }, t.set(l.id, e);
3211
+ }, t.set(u.id, e);
3207
3212
  }
3208
- (e.measured === void 0 || e.measured.width === void 0 || e.measured.height === void 0) && !e.hidden && (c = !1), l.parentId && ts(e, t, n, r, a);
3213
+ (e.measured === void 0 || e.measured.width === void 0 || e.measured.height === void 0) && !e.hidden && (c = !1), u.parentId && ts(e, t, n, r, a), l ||= u.selected ?? !1;
3209
3214
  }
3210
- return c;
3215
+ return {
3216
+ nodesInitialized: c,
3217
+ hasSelectedNodes: l
3218
+ };
3211
3219
  }
3212
3220
  function es(e, t) {
3213
3221
  if (!e.parentId) return;
@@ -3351,13 +3359,13 @@ function as(e, t, n, r, i, a, o) {
3351
3359
  };
3352
3360
  }
3353
3361
  async function os({ delta: e, panZoom: t, transform: n, translateExtent: r, width: i, height: a }) {
3354
- if (!t || !e.x && !e.y) return Promise.resolve(!1);
3362
+ if (!t || !e.x && !e.y) return !1;
3355
3363
  let o = await t.setViewportConstrained({
3356
3364
  x: n[0] + e.x,
3357
3365
  y: n[1] + e.y,
3358
3366
  zoom: n[2]
3359
- }, [[0, 0], [i, a]], r), s = !!o && (o.x !== n[0] || o.y !== n[1] || o.k !== n[2]);
3360
- return Promise.resolve(s);
3367
+ }, [[0, 0], [i, a]], r);
3368
+ return !!o && (o.x !== n[0] || o.y !== n[1] || o.k !== n[2]);
3361
3369
  }
3362
3370
  function ss(e, t, n, r, i, a) {
3363
3371
  let o = i, s = r.get(o) || /* @__PURE__ */ new Map();
@@ -3566,7 +3574,11 @@ function ms({ onNodeMouseDown: e, getStoreItems: t, onDragStart: n, onDrag: r, o
3566
3574
  (a.x !== g.xSnapped || a.y !== g.ySnapped) && s && d && (l = yo(e.sourceEvent, u), S(g));
3567
3575
  }
3568
3576
  }).on("end", (e) => {
3569
- if (!(!d || p) && (c = !1, d = !1, cancelAnimationFrame(o), s.size > 0)) {
3577
+ if (!d || p) {
3578
+ p && s.size > 0 && t().updateNodePositions(s, !1);
3579
+ return;
3580
+ }
3581
+ if (c = !1, d = !1, cancelAnimationFrame(o), s.size > 0) {
3570
3582
  let { nodeLookup: n, updateNodePositions: r, onNodeDragStop: a, onSelectionDragStop: o } = t();
3571
3583
  if (m &&= (r(s, !1), !1), i || a || !b && o) {
3572
3584
  let [t, r] = fs({
@@ -3876,11 +3888,7 @@ function zs({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
3876
3888
  let l = {
3877
3889
  isZoomingOrPanning: !1,
3878
3890
  usedRightMouseButton: !1,
3879
- prevViewport: {
3880
- x: 0,
3881
- y: 0,
3882
- zoom: 0
3883
- },
3891
+ prevViewport: {},
3884
3892
  mouseButton: 0,
3885
3893
  timerId: void 0,
3886
3894
  panScrollTimeout: void 0,
@@ -3893,10 +3901,10 @@ function zs({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
3893
3901
  }, [[0, 0], [u.width, u.height]], r);
3894
3902
  let p = f.on("wheel.zoom"), m = f.on("dblclick.zoom");
3895
3903
  d.wheelDelta(Ms);
3896
- function h(e, t) {
3904
+ async function h(e, t) {
3897
3905
  return f ? new Promise((n) => {
3898
3906
  d?.interpolate(t?.interpolate === "linear" ? Qn : fr).transform(js(f, t?.duration, t?.ease, () => n(!0)), e);
3899
- }) : Promise.resolve(!1);
3907
+ }) : !1;
3900
3908
  }
3901
3909
  function g({ noWheelClassName: e, noPanClassName: t, onPaneContextMenu: n, userSelectionActive: r, panOnScroll: i, panOnDrag: u, panOnScrollMode: h, panOnScrollSpeed: g, preventScrolling: v, zoomOnPinch: y, zoomOnScroll: b, zoomOnDoubleClick: x, zoomActivationKeyPressed: S, lib: C, onTransformChange: w, connectionInProgress: T, paneClickDistance: E, selectionOnDrag: D }) {
3902
3910
  r && !l.isZoomingOrPanning && _();
@@ -3918,32 +3926,31 @@ function zs({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
3918
3926
  preventScrolling: v,
3919
3927
  d3ZoomHandler: p
3920
3928
  });
3921
- if (f.on("wheel.zoom", k, { passive: !1 }), !r) {
3922
- let e = Fs({
3923
- zoomPanValues: l,
3924
- onDraggingChange: c,
3925
- onPanZoomStart: o
3926
- });
3927
- d.on("start", e);
3928
- let t = Is({
3929
- zoomPanValues: l,
3930
- panOnDrag: u,
3931
- onPaneContextMenu: !!n,
3932
- onPanZoom: a,
3933
- onTransformChange: w
3934
- });
3935
- d.on("zoom", t);
3936
- let r = Ls({
3937
- zoomPanValues: l,
3938
- panOnDrag: u,
3939
- panOnScroll: i,
3940
- onPaneContextMenu: n,
3941
- onPanZoomEnd: s,
3942
- onDraggingChange: c
3943
- });
3944
- d.on("end", r);
3945
- }
3946
- let A = Rs({
3929
+ f.on("wheel.zoom", k, { passive: !1 });
3930
+ let A = Fs({
3931
+ zoomPanValues: l,
3932
+ onDraggingChange: c,
3933
+ onPanZoomStart: o
3934
+ });
3935
+ d.on("start", A);
3936
+ let j = Is({
3937
+ zoomPanValues: l,
3938
+ panOnDrag: u,
3939
+ onPaneContextMenu: !!n,
3940
+ onPanZoom: a,
3941
+ onTransformChange: w
3942
+ });
3943
+ d.on("zoom", j);
3944
+ let M = Ls({
3945
+ zoomPanValues: l,
3946
+ panOnDrag: u,
3947
+ panOnScroll: i,
3948
+ onPaneContextMenu: n,
3949
+ onPanZoomEnd: s,
3950
+ onDraggingChange: c
3951
+ });
3952
+ d.on("end", M);
3953
+ let N = Rs({
3947
3954
  zoomActivationKeyPressed: S,
3948
3955
  panOnDrag: u,
3949
3956
  zoomOnScroll: b,
@@ -3956,18 +3963,18 @@ function zs({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
3956
3963
  lib: C,
3957
3964
  connectionInProgress: T
3958
3965
  });
3959
- d.filter(A), x ? f.on("dblclick.zoom", m) : f.on("dblclick.zoom", null);
3966
+ d.filter(N), x ? f.on("dblclick.zoom", m) : f.on("dblclick.zoom", null);
3960
3967
  }
3961
3968
  function _() {
3962
3969
  d.on("zoom", null);
3963
3970
  }
3964
3971
  async function v(e, t, n) {
3965
3972
  let r = Ds(e), i = d?.constrain()(r, t, n);
3966
- return i && await h(i), new Promise((e) => e(i));
3973
+ return i && await h(i), i;
3967
3974
  }
3968
3975
  async function y(e, t) {
3969
3976
  let n = Ds(e);
3970
- return await h(n, t), new Promise((e) => e(n));
3977
+ return await h(n, t), n;
3971
3978
  }
3972
3979
  function b(e) {
3973
3980
  if (f) {
@@ -3987,15 +3994,15 @@ function zs({ domNode: e, minZoom: t, maxZoom: n, translateExtent: r, viewport:
3987
3994
  zoom: e.k
3988
3995
  };
3989
3996
  }
3990
- function S(e, t) {
3997
+ async function S(e, t) {
3991
3998
  return f ? new Promise((n) => {
3992
3999
  d?.interpolate(t?.interpolate === "linear" ? Qn : fr).scaleTo(js(f, t?.duration, t?.ease, () => n(!0)), e);
3993
- }) : Promise.resolve(!1);
4000
+ }) : !1;
3994
4001
  }
3995
- function C(e, t) {
4002
+ async function C(e, t) {
3996
4003
  return f ? new Promise((n) => {
3997
4004
  d?.interpolate(t?.interpolate === "linear" ? Qn : fr).scaleBy(js(f, t?.duration, t?.ease, () => n(!0)), e);
3998
- }) : Promise.resolve(!1);
4005
+ }) : !1;
3999
4006
  }
4000
4007
  function w(e) {
4001
4008
  d?.scaleExtent(e);
@@ -4103,14 +4110,11 @@ var Js = {
4103
4110
  pointerY: 0,
4104
4111
  aspectRatio: 1
4105
4112
  };
4106
- function Xs(e) {
4107
- return [[0, 0], [e.measured.width, e.measured.height]];
4108
- }
4109
- function Zs(e, t, n) {
4113
+ function Xs(e, t, n) {
4110
4114
  let r = t.position.x + e.position.x, i = t.position.y + e.position.y, a = e.measured.width ?? 0, o = e.measured.height ?? 0, s = n[0] * a, c = n[1] * o;
4111
4115
  return [[r - s, i - c], [r + a - s, i + o - c]];
4112
4116
  }
4113
- function Qs({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: i }) {
4117
+ function Zs({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: i }) {
4114
4118
  let a = K(e), o = {
4115
4119
  controlDirection: Hs("bottom-right"),
4116
4120
  boundaries: {
@@ -4150,13 +4154,13 @@ function Qs({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: i })
4150
4154
  pointerX: l,
4151
4155
  pointerY: d,
4152
4156
  aspectRatio: m.width / m.height
4153
- }, y = void 0, g.parentId && (g.extent === "parent" || g.expandParent) && (y = r.get(g.parentId), b = y && g.extent === "parent" ? Xs(y) : void 0), v = [], x = void 0;
4157
+ }, y = void 0, b = ao(g.extent) ? g.extent : void 0, g.parentId && (g.extent === "parent" || g.expandParent) && (y = r.get(g.parentId)), y && g.extent === "parent" && (b = [[0, 0], [y.measured.width, y.measured.height]]), v = [], x = void 0;
4154
4158
  for (let [e, n] of r) if (n.parentId === t && (v.push({
4155
4159
  id: e,
4156
4160
  position: { ...n.position },
4157
4161
  extent: n.extent
4158
4162
  }), n.extent === "parent" || n.expandParent)) {
4159
- let e = Zs(n, g, n.origin ?? s);
4163
+ let e = Xs(n, g, n.origin ?? s);
4160
4164
  x = x ? [[Math.min(e[0][0], x[0][0]), Math.min(e[0][1], x[0][1])], [Math.max(e[1][0], x[1][0]), Math.max(e[1][1], x[1][1])]] : e;
4161
4165
  }
4162
4166
  u?.(e, { ...m });
@@ -4210,11 +4214,11 @@ function Qs({ domNode: e, nodeId: t, getStoreItems: n, onChange: r, onEnd: i })
4210
4214
  }
4211
4215
  //#endregion
4212
4216
  //#region src/shims/use-sync-external-store-shim-with-selector.ts
4213
- function $s(e, t) {
4217
+ function Qs(e, t) {
4214
4218
  return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
4215
4219
  }
4216
- var ec = typeof Object.is == "function" ? Object.is : $s;
4217
- function tc(e, t, n, r, i) {
4220
+ var $s = typeof Object.is == "function" ? Object.is : Qs;
4221
+ function ec(e, t, n, r, i) {
4218
4222
  let a = d(null);
4219
4223
  a.current === null && (a.current = {
4220
4224
  hasValue: !1,
@@ -4232,7 +4236,7 @@ function tc(e, t, n, r, i) {
4232
4236
  return s = n, n;
4233
4237
  }
4234
4238
  let n = s;
4235
- if (ec(a, t)) return n;
4239
+ if ($s(a, t)) return n;
4236
4240
  let c = r(t);
4237
4241
  return i !== void 0 && i(n, c) ? (a = t, n) : (a = t, s = c, c);
4238
4242
  };
@@ -4247,7 +4251,7 @@ function tc(e, t, n, r, i) {
4247
4251
  o.hasValue = !0, o.value = m;
4248
4252
  }, [m]), s(m), m;
4249
4253
  }
4250
- var nc = { useSyncExternalStoreWithSelector: tc }, rc = (e) => {
4254
+ var tc = { useSyncExternalStoreWithSelector: ec }, nc = (e) => {
4251
4255
  let t, n = /* @__PURE__ */ new Set(), r = (e, r) => {
4252
4256
  let i = typeof e == "function" ? e(t) : e;
4253
4257
  if (!Object.is(i, t)) {
@@ -4264,15 +4268,15 @@ var nc = { useSyncExternalStoreWithSelector: tc }, rc = (e) => {
4264
4268
  }
4265
4269
  }, o = t = e(r, i, a);
4266
4270
  return a;
4267
- }, ic = (e) => e ? rc(e) : rc, { useDebugValue: ac } = e, { useSyncExternalStoreWithSelector: oc } = nc, sc = (e) => e;
4268
- function cc(e, t = sc, n) {
4269
- let r = oc(e.subscribe, e.getState, e.getServerState || e.getInitialState, t, n);
4270
- return ac(r), r;
4271
+ }, rc = (e) => e ? nc(e) : nc, { useDebugValue: ic } = e, { useSyncExternalStoreWithSelector: ac } = tc, oc = (e) => e;
4272
+ function sc(e, t = oc, n) {
4273
+ let r = ac(e.subscribe, e.getState, e.getServerState || e.getInitialState, t, n);
4274
+ return ic(r), r;
4271
4275
  }
4272
- var lc = (e, t) => {
4273
- let n = ic(e), r = (e, r = t) => cc(n, e, r);
4276
+ var cc = (e, t) => {
4277
+ let n = rc(e), r = (e, r = t) => sc(n, e, r);
4274
4278
  return Object.assign(r, n), r;
4275
- }, uc = (e, t) => e ? lc(e, t) : lc;
4279
+ }, lc = (e, t) => e ? cc(e, t) : cc;
4276
4280
  //#endregion
4277
4281
  //#region node_modules/zustand/esm/shallow.mjs
4278
4282
  function X(e, t) {
@@ -4295,22 +4299,22 @@ function X(e, t) {
4295
4299
  }
4296
4300
  //#endregion
4297
4301
  //#region node_modules/@xyflow/react/dist/esm/index.js
4298
- var dc = t(null), fc = dc.Provider, pc = J.error001();
4302
+ var uc = t(null), dc = uc.Provider, fc = J.error001("react");
4299
4303
  function Z(e, t) {
4300
- let n = o(dc);
4301
- if (n === null) throw Error(pc);
4302
- return cc(n, e, t);
4304
+ let n = o(uc);
4305
+ if (n === null) throw Error(fc);
4306
+ return sc(n, e, t);
4303
4307
  }
4304
4308
  function Q() {
4305
- let e = o(dc);
4306
- if (e === null) throw Error(pc);
4309
+ let e = o(uc);
4310
+ if (e === null) throw Error(fc);
4307
4311
  return u(() => ({
4308
4312
  getState: e.getState,
4309
4313
  setState: e.setState,
4310
4314
  subscribe: e.subscribe
4311
4315
  }), [e]);
4312
4316
  }
4313
- var mc = { display: "none" }, hc = {
4317
+ var pc = { display: "none" }, mc = {
4314
4318
  position: "absolute",
4315
4319
  width: 1,
4316
4320
  height: 1,
@@ -4320,34 +4324,34 @@ var mc = { display: "none" }, hc = {
4320
4324
  overflow: "hidden",
4321
4325
  clip: "rect(0px, 0px, 0px, 0px)",
4322
4326
  clipPath: "inset(100%)"
4323
- }, gc = "react-flow__node-desc", _c = "react-flow__edge-desc", vc = "react-flow__aria-live", yc = (e) => e.ariaLiveMessage, bc = (e) => e.ariaLabelConfig;
4324
- function xc({ rfId: e }) {
4325
- let t = Z(yc);
4327
+ }, hc = "react-flow__node-desc", gc = "react-flow__edge-desc", _c = "react-flow__aria-live", vc = (e) => e.ariaLiveMessage, yc = (e) => e.ariaLabelConfig;
4328
+ function bc({ rfId: e }) {
4329
+ let t = Z(vc);
4326
4330
  return g("div", {
4327
- id: `${vc}-${e}`,
4331
+ id: `${_c}-${e}`,
4328
4332
  "aria-live": "assertive",
4329
4333
  "aria-atomic": "true",
4330
- style: hc,
4334
+ style: mc,
4331
4335
  children: t
4332
4336
  });
4333
4337
  }
4334
- function Sc({ rfId: e, disableKeyboardA11y: t }) {
4335
- let n = Z(bc);
4338
+ function xc({ rfId: e, disableKeyboardA11y: t }) {
4339
+ let n = Z(yc);
4336
4340
  return _(h, { children: [
4337
4341
  g("div", {
4338
- id: `${gc}-${e}`,
4339
- style: mc,
4342
+ id: `${hc}-${e}`,
4343
+ style: pc,
4340
4344
  children: t ? n["node.a11yDescription.default"] : n["node.a11yDescription.keyboardDisabled"]
4341
4345
  }),
4342
4346
  g("div", {
4343
- id: `${_c}-${e}`,
4344
- style: mc,
4347
+ id: `${gc}-${e}`,
4348
+ style: pc,
4345
4349
  children: n["edge.a11yDescription.default"]
4346
4350
  }),
4347
- !t && g(xc, { rfId: e })
4351
+ !t && g(bc, { rfId: e })
4348
4352
  ] });
4349
4353
  }
4350
- var Cc = r(({ position: e = "top-left", children: t, className: n, style: r, ...i }, a) => g("div", {
4354
+ var Sc = r(({ position: e = "top-left", children: t, className: n, style: r, ...i }, a) => g("div", {
4351
4355
  className: S([
4352
4356
  "react-flow__panel",
4353
4357
  n,
@@ -4358,9 +4362,9 @@ var Cc = r(({ position: e = "top-left", children: t, className: n, style: r, ...
4358
4362
  ...i,
4359
4363
  children: t
4360
4364
  }));
4361
- Cc.displayName = "Panel";
4362
- function wc({ proOptions: e, position: t = "bottom-right" }) {
4363
- return e?.hideAttribution ? null : g(Cc, {
4365
+ Sc.displayName = "Panel";
4366
+ function Cc({ proOptions: e, position: t = "bottom-right" }) {
4367
+ return e?.hideAttribution ? null : g(Sc, {
4364
4368
  position: t,
4365
4369
  className: "react-flow__attribution",
4366
4370
  "data-message": "Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",
@@ -4373,7 +4377,7 @@ function wc({ proOptions: e, position: t = "bottom-right" }) {
4373
4377
  })
4374
4378
  });
4375
4379
  }
4376
- var Tc = (e) => {
4380
+ var wc = (e) => {
4377
4381
  let t = [], n = [];
4378
4382
  for (let [, n] of e.nodeLookup) n.selected && t.push(n.internals.userNode);
4379
4383
  for (let [, t] of e.edgeLookup) t.selected && n.push(t);
@@ -4381,12 +4385,12 @@ var Tc = (e) => {
4381
4385
  selectedNodes: t,
4382
4386
  selectedEdges: n
4383
4387
  };
4384
- }, Ec = (e) => e.id;
4385
- function Dc(e, t) {
4386
- return X(e.selectedNodes.map(Ec), t.selectedNodes.map(Ec)) && X(e.selectedEdges.map(Ec), t.selectedEdges.map(Ec));
4388
+ }, Tc = (e) => e.id;
4389
+ function Ec(e, t) {
4390
+ return X(e.selectedNodes.map(Tc), t.selectedNodes.map(Tc)) && X(e.selectedEdges.map(Tc), t.selectedEdges.map(Tc));
4387
4391
  }
4388
- function Oc({ onSelectionChange: e }) {
4389
- let t = Q(), { selectedNodes: n, selectedEdges: r } = Z(Tc, Dc);
4392
+ function Dc({ onSelectionChange: e }) {
4393
+ let t = Q(), { selectedNodes: n, selectedEdges: r } = Z(wc, Ec);
4390
4394
  return c(() => {
4391
4395
  let i = {
4392
4396
  nodes: n,
@@ -4399,16 +4403,16 @@ function Oc({ onSelectionChange: e }) {
4399
4403
  e
4400
4404
  ]), null;
4401
4405
  }
4402
- var kc = (e) => !!e.onSelectionChangeHandlers;
4403
- function Ac({ onSelectionChange: e }) {
4404
- let t = Z(kc);
4405
- return e || t ? g(Oc, { onSelectionChange: e }) : null;
4406
+ var Oc = (e) => !!e.onSelectionChangeHandlers;
4407
+ function kc({ onSelectionChange: e }) {
4408
+ let t = Z(Oc);
4409
+ return e || t ? g(Dc, { onSelectionChange: e }) : null;
4406
4410
  }
4407
- var jc = [0, 0], Mc = {
4411
+ var Ac = [0, 0], jc = {
4408
4412
  x: 0,
4409
4413
  y: 0,
4410
4414
  zoom: 1
4411
- }, Nc = [.../* @__PURE__ */ "nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode".split("."), "rfId"], Pc = (e) => ({
4415
+ }, Mc = [.../* @__PURE__ */ "nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode".split("."), "rfId"], Nc = (e) => ({
4412
4416
  setNodes: e.setNodes,
4413
4417
  setEdges: e.setEdges,
4414
4418
  setMinZoom: e.setMinZoom,
@@ -4417,48 +4421,48 @@ var jc = [0, 0], Mc = {
4417
4421
  setNodeExtent: e.setNodeExtent,
4418
4422
  reset: e.reset,
4419
4423
  setDefaultNodesAndEdges: e.setDefaultNodesAndEdges
4420
- }), Fc = {
4424
+ }), Pc = {
4421
4425
  translateExtent: pa,
4422
- nodeOrigin: jc,
4426
+ nodeOrigin: Ac,
4423
4427
  minZoom: .5,
4424
4428
  maxZoom: 2,
4425
4429
  elementsSelectable: !0,
4426
4430
  noPanClassName: "nopan",
4427
4431
  rfId: "1"
4428
4432
  };
4429
- function Ic(e) {
4430
- let { setNodes: t, setEdges: n, setMinZoom: r, setMaxZoom: i, setTranslateExtent: a, setNodeExtent: o, reset: s, setDefaultNodesAndEdges: l } = Z(Pc, X), u = Q();
4433
+ function Fc(e) {
4434
+ let { setNodes: t, setEdges: n, setMinZoom: r, setMaxZoom: i, setTranslateExtent: a, setNodeExtent: o, reset: s, setDefaultNodesAndEdges: l } = Z(Nc, X), u = Q();
4431
4435
  c(() => (l(e.defaultNodes, e.defaultEdges), () => {
4432
- f.current = Fc, s();
4436
+ f.current = Pc, s();
4433
4437
  }), []);
4434
- let f = d(Fc);
4438
+ let f = d(Pc);
4435
4439
  return c(() => {
4436
- for (let s of Nc) {
4440
+ for (let s of Mc) {
4437
4441
  let c = e[s];
4438
4442
  c !== f.current[s] && e[s] !== void 0 && (s === "nodes" ? t(c) : s === "edges" ? n(c) : s === "minZoom" ? r(c) : s === "maxZoom" ? i(c) : s === "translateExtent" ? a(c) : s === "nodeExtent" ? o(c) : s === "ariaLabelConfig" ? u.setState({ ariaLabelConfig: fo(c) }) : s === "fitView" ? u.setState({ fitViewQueued: c }) : s === "fitViewOptions" ? u.setState({ fitViewOptions: c }) : u.setState({ [s]: c }));
4439
4443
  }
4440
4444
  f.current = e;
4441
- }, Nc.map((t) => e[t])), null;
4445
+ }, Mc.map((t) => e[t])), null;
4442
4446
  }
4443
- function Lc() {
4447
+ function Ic() {
4444
4448
  return typeof window > "u" || !window.matchMedia ? null : window.matchMedia("(prefers-color-scheme: dark)");
4445
4449
  }
4446
- function Rc(e) {
4450
+ function Lc(e) {
4447
4451
  let [t, n] = f(e === "system" ? null : e);
4448
4452
  return c(() => {
4449
4453
  if (e !== "system") {
4450
4454
  n(e);
4451
4455
  return;
4452
4456
  }
4453
- let t = Lc(), r = () => n(t?.matches ? "dark" : "light");
4457
+ let t = Ic(), r = () => n(t?.matches ? "dark" : "light");
4454
4458
  return r(), t?.addEventListener("change", r), () => {
4455
4459
  t?.removeEventListener("change", r);
4456
4460
  };
4457
- }, [e]), t === null ? Lc()?.matches ? "dark" : "light" : t;
4461
+ }, [e]), t === null ? Ic()?.matches ? "dark" : "light" : t;
4458
4462
  }
4459
- var zc = typeof document < "u" ? document : null;
4460
- function Bc(e = null, t = {
4461
- target: zc,
4463
+ var Rc = typeof document < "u" ? document : null;
4464
+ function zc(e = null, t = {
4465
+ target: Rc,
4462
4466
  actInsideInputWithModifier: !0
4463
4467
  }) {
4464
4468
  let [n, r] = f(!1), i = d(!1), a = d(/* @__PURE__ */ new Set([])), [o, s] = u(() => {
@@ -4469,18 +4473,18 @@ function Bc(e = null, t = {
4469
4473
  return [[], []];
4470
4474
  }, [e]);
4471
4475
  return c(() => {
4472
- let n = t?.target ?? zc, c = t?.actInsideInputWithModifier ?? !0;
4476
+ let n = t?.target ?? Rc, c = t?.actInsideInputWithModifier ?? !0;
4473
4477
  if (e !== null) {
4474
4478
  let e = (e) => {
4475
4479
  if (i.current = e.ctrlKey || e.metaKey || e.shiftKey || e.altKey, (!i.current || i.current && !c) && _o(e)) return !1;
4476
- let n = Hc(e.code, s);
4477
- if (a.current.add(e[n]), Vc(o, a.current, !1)) {
4480
+ let n = Vc(e.code, s);
4481
+ if (a.current.add(e[n]), Bc(o, a.current, !1)) {
4478
4482
  let n = e.composedPath?.()?.[0] || e.target, a = n?.nodeName === "BUTTON" || n?.nodeName === "A";
4479
4483
  t.preventDefault !== !1 && (i.current || !a) && e.preventDefault(), r(!0);
4480
4484
  }
4481
4485
  }, l = (e) => {
4482
- let t = Hc(e.code, s);
4483
- Vc(o, a.current, !0) ? (r(!1), a.current.clear()) : a.current.delete(e[t]), e.key === "Meta" && a.current.clear(), i.current = !1;
4486
+ let t = Vc(e.code, s);
4487
+ Bc(o, a.current, !0) ? (r(!1), a.current.clear()) : a.current.delete(e[t]), e.key === "Meta" && a.current.clear(), i.current = !1;
4484
4488
  }, u = () => {
4485
4489
  a.current.clear(), r(!1);
4486
4490
  };
@@ -4490,26 +4494,26 @@ function Bc(e = null, t = {
4490
4494
  }
4491
4495
  }, [e, r]), n;
4492
4496
  }
4493
- function Vc(e, t, n) {
4497
+ function Bc(e, t, n) {
4494
4498
  return e.filter((e) => n || e.length === t.size).some((e) => e.every((e) => t.has(e)));
4495
4499
  }
4496
- function Hc(e, t) {
4500
+ function Vc(e, t) {
4497
4501
  return t.includes(e) ? "code" : "key";
4498
4502
  }
4499
- var Uc = () => {
4503
+ var Hc = () => {
4500
4504
  let e = Q();
4501
4505
  return u(() => ({
4502
- zoomIn: (t) => {
4506
+ zoomIn: async (t) => {
4503
4507
  let { panZoom: n } = e.getState();
4504
- return n ? n.scaleBy(1.2, { duration: t?.duration }) : Promise.resolve(!1);
4508
+ return n ? n.scaleBy(1.2, t) : !1;
4505
4509
  },
4506
- zoomOut: (t) => {
4510
+ zoomOut: async (t) => {
4507
4511
  let { panZoom: n } = e.getState();
4508
- return n ? n.scaleBy(1 / 1.2, { duration: t?.duration }) : Promise.resolve(!1);
4512
+ return n ? n.scaleBy(1 / 1.2, t) : !1;
4509
4513
  },
4510
- zoomTo: (t, n) => {
4514
+ zoomTo: async (t, n) => {
4511
4515
  let { panZoom: r } = e.getState();
4512
- return r ? r.scaleTo(t, { duration: n?.duration }) : Promise.resolve(!1);
4516
+ return r ? r.scaleTo(t, n) : !1;
4513
4517
  },
4514
4518
  getZoom: () => e.getState().transform[2],
4515
4519
  setViewport: async (t, n) => {
@@ -4518,7 +4522,7 @@ var Uc = () => {
4518
4522
  x: t.x ?? r,
4519
4523
  y: t.y ?? i,
4520
4524
  zoom: t.zoom ?? a
4521
- }, n), Promise.resolve(!0)) : Promise.resolve(!1);
4525
+ }, n), !0) : !1;
4522
4526
  },
4523
4527
  getViewport: () => {
4524
4528
  let [t, n, r] = e.getState().transform;
@@ -4535,7 +4539,7 @@ var Uc = () => {
4535
4539
  duration: n?.duration,
4536
4540
  ease: n?.ease,
4537
4541
  interpolate: n?.interpolate
4538
- }), Promise.resolve(!0)) : Promise.resolve(!1);
4542
+ }), !0) : !1;
4539
4543
  },
4540
4544
  screenToFlowPosition: (t, n = {}) => {
4541
4545
  let { transform: r, snapGrid: i, snapToGrid: a, domNode: o } = e.getState();
@@ -4557,7 +4561,7 @@ var Uc = () => {
4557
4561
  }
4558
4562
  }), []);
4559
4563
  };
4560
- function Wc(e, t) {
4564
+ function Uc(e, t) {
4561
4565
  let n = [], r = /* @__PURE__ */ new Map(), i = [];
4562
4566
  for (let t of e) if (t.type === "add") {
4563
4567
  i.push(t);
@@ -4579,14 +4583,14 @@ function Wc(e, t) {
4579
4583
  continue;
4580
4584
  }
4581
4585
  let i = { ...e };
4582
- for (let e of t) Gc(e, i);
4586
+ for (let e of t) Wc(e, i);
4583
4587
  n.push(i);
4584
4588
  }
4585
4589
  return i.length && i.forEach((e) => {
4586
4590
  e.index === void 0 ? n.push({ ...e.item }) : n.splice(e.index, 0, { ...e.item });
4587
4591
  }), n;
4588
4592
  }
4589
- function Gc(e, t) {
4593
+ function Wc(e, t) {
4590
4594
  switch (e.type) {
4591
4595
  case "select":
4592
4596
  t.selected = e.selected;
@@ -4599,28 +4603,28 @@ function Gc(e, t) {
4599
4603
  break;
4600
4604
  }
4601
4605
  }
4606
+ function Gc(e, t) {
4607
+ return Uc(e, t);
4608
+ }
4602
4609
  function Kc(e, t) {
4603
- return Wc(e, t);
4610
+ return Uc(e, t);
4604
4611
  }
4605
4612
  function qc(e, t) {
4606
- return Wc(e, t);
4607
- }
4608
- function Jc(e, t) {
4609
4613
  return {
4610
4614
  id: e,
4611
4615
  type: "select",
4612
4616
  selected: t
4613
4617
  };
4614
4618
  }
4615
- function Yc(e, t = /* @__PURE__ */ new Set(), n = !1) {
4619
+ function Jc(e, t = /* @__PURE__ */ new Set(), n = !1) {
4616
4620
  let r = [];
4617
4621
  for (let [i, a] of e) {
4618
4622
  let e = t.has(i);
4619
- !(a.selected === void 0 && !e) && a.selected !== e && (n && (a.selected = e), r.push(Jc(a.id, e)));
4623
+ !(a.selected === void 0 && !e) && a.selected !== e && (n && (a.selected = e), r.push(qc(a.id, e)));
4620
4624
  }
4621
4625
  return r;
4622
4626
  }
4623
- function Xc({ items: e = [], lookup: t }) {
4627
+ function Yc({ items: e = [], lookup: t }) {
4624
4628
  let n = [], r = new Map(e.map((e) => [e.id, e]));
4625
4629
  for (let [r, i] of e.entries()) {
4626
4630
  let e = t.get(i.id), a = e?.internals?.userNode ?? e;
@@ -4640,25 +4644,32 @@ function Xc({ items: e = [], lookup: t }) {
4640
4644
  });
4641
4645
  return n;
4642
4646
  }
4643
- function Zc(e) {
4647
+ function Xc(e) {
4644
4648
  return {
4645
4649
  id: e.id,
4646
4650
  type: "remove"
4647
4651
  };
4648
4652
  }
4649
- var Qc = (e) => Ta(e), $c = (e) => wa(e);
4650
- function el(e) {
4653
+ var Zc = Xa("React Flow", "https://reactflow.dev/");
4654
+ function Qc(e, t, n = {}) {
4655
+ return Ao(e, t, {
4656
+ ...n,
4657
+ onError: n.onError ?? Zc
4658
+ });
4659
+ }
4660
+ var $c = (e) => Ta(e), el = (e) => wa(e);
4661
+ function tl(e) {
4651
4662
  return r(e);
4652
4663
  }
4653
- var tl = typeof window < "u" ? l : c;
4654
- function nl(e) {
4655
- let [t, n] = f(BigInt(0)), [r] = f(() => rl(() => n((e) => e + BigInt(1))));
4656
- return tl(() => {
4664
+ var nl = typeof window < "u" ? l : c;
4665
+ function rl(e) {
4666
+ let [t, n] = f(BigInt(0)), [r] = f(() => il(() => n((e) => e + BigInt(1))));
4667
+ return nl(() => {
4657
4668
  let t = r.get();
4658
4669
  t.length && (e(t), r.reset());
4659
4670
  }, [t]), r;
4660
4671
  }
4661
- function rl(e) {
4672
+ function il(e) {
4662
4673
  let t = [];
4663
4674
  return {
4664
4675
  get: () => t,
@@ -4670,12 +4681,12 @@ function rl(e) {
4670
4681
  }
4671
4682
  };
4672
4683
  }
4673
- var il = t(null);
4674
- function al({ children: e }) {
4675
- let t = Q(), n = nl(a((e) => {
4684
+ var al = t(null);
4685
+ function ol({ children: e }) {
4686
+ let t = Q(), n = rl(a((e) => {
4676
4687
  let { nodes: n = [], setNodes: r, hasDefaultNodes: i, onNodesChange: a, nodeLookup: o, fitViewQueued: s, onNodesChangeMiddlewareMap: c } = t.getState(), l = n;
4677
4688
  for (let t of e) l = typeof t == "function" ? t(l) : t;
4678
- let u = Xc({
4689
+ let u = Yc({
4679
4690
  items: l,
4680
4691
  lookup: o
4681
4692
  });
@@ -4684,10 +4695,10 @@ function al({ children: e }) {
4684
4695
  let { fitViewQueued: e, nodes: n, setNodes: r } = t.getState();
4685
4696
  e && r(n);
4686
4697
  });
4687
- }, [])), r = nl(a((e) => {
4698
+ }, [])), r = rl(a((e) => {
4688
4699
  let { edges: n = [], setEdges: r, hasDefaultEdges: i, onEdgesChange: a, edgeLookup: o } = t.getState(), s = n;
4689
4700
  for (let t of e) s = typeof t == "function" ? t(s) : t;
4690
- i ? r(s) : a && a(Xc({
4701
+ i ? r(s) : a && a(Yc({
4691
4702
  items: s,
4692
4703
  lookup: o
4693
4704
  }));
@@ -4695,25 +4706,25 @@ function al({ children: e }) {
4695
4706
  nodeQueue: n,
4696
4707
  edgeQueue: r
4697
4708
  }), []);
4698
- return g(il.Provider, {
4709
+ return g(al.Provider, {
4699
4710
  value: i,
4700
4711
  children: e
4701
4712
  });
4702
4713
  }
4703
- function ol() {
4704
- let e = o(il);
4714
+ function sl() {
4715
+ let e = o(al);
4705
4716
  if (!e) throw Error("useBatchContext must be used within a BatchProvider");
4706
4717
  return e;
4707
4718
  }
4708
- var sl = (e) => !!e.panZoom;
4709
- function cl() {
4710
- let e = Uc(), t = Q(), n = ol(), r = Z(sl), i = u(() => {
4719
+ var cl = (e) => !!e.panZoom;
4720
+ function ll() {
4721
+ let e = Hc(), t = Q(), n = sl(), r = Z(cl), i = u(() => {
4711
4722
  let e = (e) => t.getState().nodeLookup.get(e), r = (e) => {
4712
4723
  n.nodeQueue.push(e);
4713
4724
  }, i = (e) => {
4714
4725
  n.edgeQueue.push(e);
4715
4726
  }, a = (e) => {
4716
- let { nodeLookup: n, nodeOrigin: r } = t.getState(), i = Qc(e) ? e : n.get(e.id), a = i.parentId ? co(i.position, i.measured, i.parentId, n, r) : i.position;
4727
+ let { nodeLookup: n, nodeOrigin: r } = t.getState(), i = $c(e) ? e : n.get(e.id), a = i.parentId ? co(i.position, i.measured, i.parentId, n, r) : i.position;
4717
4728
  return Wa({
4718
4729
  ...i,
4719
4730
  position: a,
@@ -4724,7 +4735,7 @@ function cl() {
4724
4735
  r((r) => r.map((r) => {
4725
4736
  if (r.id === e) {
4726
4737
  let e = typeof t == "function" ? t(r) : t;
4727
- return n.replace && Qc(e) ? e : {
4738
+ return n.replace && $c(e) ? e : {
4728
4739
  ...r,
4729
4740
  ...e
4730
4741
  };
@@ -4735,7 +4746,7 @@ function cl() {
4735
4746
  i((r) => r.map((r) => {
4736
4747
  if (r.id === e) {
4737
4748
  let e = typeof t == "function" ? t(r) : t;
4738
- return n.replace && $c(e) ? e : {
4749
+ return n.replace && el(e) ? e : {
4739
4750
  ...r,
4740
4751
  ...e
4741
4752
  };
@@ -4783,11 +4794,11 @@ function cl() {
4783
4794
  onBeforeDelete: u
4784
4795
  }), p = f.length > 0, m = d.length > 0;
4785
4796
  if (p) {
4786
- let e = f.map(Zc);
4797
+ let e = f.map(Xc);
4787
4798
  o?.(f), c(e);
4788
4799
  }
4789
4800
  if (m) {
4790
- let e = d.map(Zc);
4801
+ let e = d.map(Xc);
4791
4802
  a?.(d), s(e);
4792
4803
  }
4793
4804
  return (m || p) && l?.({
@@ -4870,22 +4881,22 @@ function cl() {
4870
4881
  viewportInitialized: r
4871
4882
  }), [r]);
4872
4883
  }
4873
- var ll = (e) => e.selected, ul = typeof window < "u" ? window : void 0;
4874
- function dl({ deleteKeyCode: e, multiSelectionKeyCode: t }) {
4875
- let n = Q(), { deleteElements: r } = cl(), i = Bc(e, { actInsideInputWithModifier: !1 }), a = Bc(t, { target: ul });
4884
+ var ul = (e) => e.selected, dl = typeof window < "u" ? window : void 0;
4885
+ function fl({ deleteKeyCode: e, multiSelectionKeyCode: t }) {
4886
+ let n = Q(), { deleteElements: r } = ll(), i = zc(e, { actInsideInputWithModifier: !1 }), a = zc(t, { target: dl });
4876
4887
  c(() => {
4877
4888
  if (i) {
4878
4889
  let { edges: e, nodes: t } = n.getState();
4879
4890
  r({
4880
- nodes: t.filter(ll),
4881
- edges: e.filter(ll)
4891
+ nodes: t.filter(ul),
4892
+ edges: e.filter(ul)
4882
4893
  }), n.setState({ nodesSelectionActive: !1 });
4883
4894
  }
4884
4895
  }, [i]), c(() => {
4885
4896
  n.setState({ multiSelectionActive: a });
4886
4897
  }, [a]);
4887
4898
  }
4888
- function fl(e) {
4899
+ function pl(e) {
4889
4900
  let t = Q();
4890
4901
  c(() => {
4891
4902
  let n = () => {
@@ -4905,20 +4916,20 @@ function fl(e) {
4905
4916
  }
4906
4917
  }, []);
4907
4918
  }
4908
- var pl = {
4919
+ var ml = {
4909
4920
  position: "absolute",
4910
4921
  width: "100%",
4911
4922
  height: "100%",
4912
4923
  top: 0,
4913
4924
  left: 0
4914
- }, ml = (e) => ({
4925
+ }, hl = (e) => ({
4915
4926
  userSelectionActive: e.userSelectionActive,
4916
4927
  lib: e.lib,
4917
4928
  connectionInProgress: e.connection.inProgress
4918
4929
  });
4919
- function hl({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, panOnScroll: r = !1, panOnScrollSpeed: i = .5, panOnScrollMode: o = _a.Free, zoomOnDoubleClick: s = !0, panOnDrag: l = !0, defaultViewport: u, translateExtent: f, minZoom: p, maxZoom: m, zoomActivationKeyCode: h, preventScrolling: _ = !0, children: v, noWheelClassName: y, noPanClassName: b, onViewportChange: x, isControlledViewport: S, paneClickDistance: C, selectionOnDrag: w }) {
4920
- let T = Q(), E = d(null), { userSelectionActive: D, lib: O, connectionInProgress: k } = Z(ml, X), A = Bc(h), j = d();
4921
- fl(E);
4930
+ function gl({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, panOnScroll: r = !1, panOnScrollSpeed: i = .5, panOnScrollMode: o = _a.Free, zoomOnDoubleClick: s = !0, panOnDrag: l = !0, defaultViewport: u, translateExtent: f, minZoom: p, maxZoom: m, zoomActivationKeyCode: h, preventScrolling: _ = !0, children: v, noWheelClassName: y, noPanClassName: b, onViewportChange: x, isControlledViewport: S, paneClickDistance: C, selectionOnDrag: w }) {
4931
+ let T = Q(), E = d(null), { userSelectionActive: D, lib: O, connectionInProgress: k } = Z(hl, X), A = zc(h), j = d();
4932
+ pl(E);
4922
4933
  let M = a((e) => {
4923
4934
  x?.({
4924
4935
  x: e[0],
@@ -5004,16 +5015,16 @@ function hl({ onPaneContextMenu: e, zoomOnScroll: t = !0, zoomOnPinch: n = !0, p
5004
5015
  ]), g("div", {
5005
5016
  className: "react-flow__renderer",
5006
5017
  ref: E,
5007
- style: pl,
5018
+ style: ml,
5008
5019
  children: v
5009
5020
  });
5010
5021
  }
5011
- var gl = (e) => ({
5022
+ var _l = (e) => ({
5012
5023
  userSelectionActive: e.userSelectionActive,
5013
5024
  userSelectionRect: e.userSelectionRect
5014
5025
  });
5015
- function _l() {
5016
- let { userSelectionActive: e, userSelectionRect: t } = Z(gl, X);
5026
+ function vl() {
5027
+ let { userSelectionActive: e, userSelectionRect: t } = Z(_l, X);
5017
5028
  return e && t ? g("div", {
5018
5029
  className: "react-flow__selection react-flow__container",
5019
5030
  style: {
@@ -5023,103 +5034,147 @@ function _l() {
5023
5034
  }
5024
5035
  }) : null;
5025
5036
  }
5026
- var vl = (e, t) => (n) => {
5037
+ var yl = (e, t) => (n) => {
5027
5038
  n.target === t.current && e?.(n);
5028
- }, yl = (e) => ({
5039
+ }, bl = (e) => ({
5029
5040
  userSelectionActive: e.userSelectionActive,
5030
5041
  elementsSelectable: e.elementsSelectable,
5031
5042
  connectionInProgress: e.connection.inProgress,
5032
- dragging: e.paneDragging
5043
+ dragging: e.paneDragging,
5044
+ panBy: e.panBy,
5045
+ autoPanSpeed: e.autoPanSpeed
5033
5046
  });
5034
- function bl({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = va.Full, panOnDrag: r, paneClickDistance: i, selectionOnDrag: a, onSelectionStart: o, onSelectionEnd: s, onPaneClick: c, onPaneContextMenu: l, onPaneScroll: u, onPaneMouseEnter: f, onPaneMouseMove: p, onPaneMouseLeave: m, children: h }) {
5035
- let v = Q(), { userSelectionActive: y, elementsSelectable: b, dragging: x, connectionInProgress: C } = Z(yl, X), w = b && (e || y), T = d(null), E = d(), D = d(/* @__PURE__ */ new Set()), O = d(/* @__PURE__ */ new Set()), k = d(!1), A = (e) => {
5036
- if (k.current || C) {
5037
- k.current = !1;
5047
+ function xl({ isSelecting: e, selectionKeyPressed: t, selectionMode: n = va.Full, panOnDrag: r, autoPanOnSelection: i, paneClickDistance: a, selectionOnDrag: o, onSelectionStart: s, onSelectionEnd: l, onPaneClick: u, onPaneContextMenu: f, onPaneScroll: p, onPaneMouseEnter: m, onPaneMouseMove: h, onPaneMouseLeave: v, children: y }) {
5048
+ let b = d(0), x = Q(), { userSelectionActive: C, elementsSelectable: w, dragging: T, connectionInProgress: E, panBy: D, autoPanSpeed: O } = Z(bl, X), k = w && (e || C), A = d(null), j = d(), M = d(/* @__PURE__ */ new Set()), N = d(/* @__PURE__ */ new Set()), P = d(!1), F = d({
5049
+ x: 0,
5050
+ y: 0
5051
+ }), I = d(!1), L = (e) => {
5052
+ if (P.current || E) {
5053
+ P.current = !1;
5038
5054
  return;
5039
5055
  }
5040
- c?.(e), v.getState().resetSelectedElements(), v.setState({ nodesSelectionActive: !1 });
5041
- }, j = (e) => {
5056
+ u?.(e), x.getState().resetSelectedElements(), x.setState({ nodesSelectionActive: !1 });
5057
+ }, R = (e) => {
5042
5058
  if (Array.isArray(r) && r?.includes(2)) {
5043
5059
  e.preventDefault();
5044
5060
  return;
5045
5061
  }
5046
- l?.(e);
5047
- }, M = u ? (e) => u(e) : void 0;
5048
- return _("div", {
5062
+ f?.(e);
5063
+ }, ee = p ? (e) => p(e) : void 0, z = (e) => {
5064
+ P.current &&= (e.stopPropagation(), !1);
5065
+ }, B = (n) => {
5066
+ let { domNode: r, transform: i } = x.getState();
5067
+ if (j.current = r?.getBoundingClientRect(), !j.current) return;
5068
+ let a = n.target === A.current;
5069
+ if (!a && n.target.closest(".nokey") || !e || !(o && a || t) || n.button !== 0 || !n.isPrimary) return;
5070
+ n.target?.setPointerCapture?.(n.pointerId), P.current = !1;
5071
+ let { x: s, y: c } = yo(n.nativeEvent, j.current), l = Qa({
5072
+ x: s,
5073
+ y: c
5074
+ }, i);
5075
+ x.setState({ userSelectionRect: {
5076
+ width: 0,
5077
+ height: 0,
5078
+ startX: l.x,
5079
+ startY: l.y,
5080
+ x: s,
5081
+ y: c
5082
+ } }), a || (n.stopPropagation(), n.preventDefault());
5083
+ };
5084
+ function V(e, t) {
5085
+ let { userSelectionRect: r } = x.getState();
5086
+ if (!r) return;
5087
+ let { transform: i, nodeLookup: a, edgeLookup: o, connectionLookup: s, triggerNodeChanges: c, triggerEdgeChanges: l, defaultEdgeOptions: u } = x.getState(), d = {
5088
+ x: r.startX,
5089
+ y: r.startY
5090
+ }, { x: f, y: p } = $a(d, i), m = {
5091
+ startX: d.x,
5092
+ startY: d.y,
5093
+ x: e < f ? e : f,
5094
+ y: t < p ? t : p,
5095
+ width: Math.abs(e - f),
5096
+ height: Math.abs(t - p)
5097
+ }, h = M.current, g = N.current;
5098
+ M.current = new Set(Aa(a, m, i, n === va.Partial, !0).map((e) => e.id)), N.current = /* @__PURE__ */ new Set();
5099
+ let _ = u?.selectable ?? !0;
5100
+ for (let e of M.current) {
5101
+ let t = s.get(e);
5102
+ if (t) for (let { edgeId: e } of t.values()) {
5103
+ let t = o.get(e);
5104
+ t && (t.selectable ?? _) && N.current.add(e);
5105
+ }
5106
+ }
5107
+ lo(h, M.current) || c(Jc(a, M.current, !0)), lo(g, N.current) || l(Jc(o, N.current)), x.setState({
5108
+ userSelectionRect: m,
5109
+ userSelectionActive: !0,
5110
+ nodesSelectionActive: !1
5111
+ });
5112
+ }
5113
+ function H() {
5114
+ if (!i || !j.current) return;
5115
+ let [e, t] = Ba(F.current, j.current, O);
5116
+ D({
5117
+ x: e,
5118
+ y: t
5119
+ }).then((e) => {
5120
+ if (!P.current || !e) {
5121
+ b.current = requestAnimationFrame(H);
5122
+ return;
5123
+ }
5124
+ let { x: t, y: n } = F.current;
5125
+ V(t, n), b.current = requestAnimationFrame(H);
5126
+ });
5127
+ }
5128
+ let U = () => {
5129
+ cancelAnimationFrame(b.current), b.current = 0, I.current = !1;
5130
+ };
5131
+ return c(() => () => U(), []), _("div", {
5049
5132
  className: S(["react-flow__pane", {
5050
5133
  draggable: r === !0 || Array.isArray(r) && r.includes(0),
5051
- dragging: x,
5134
+ dragging: T,
5052
5135
  selection: e
5053
5136
  }]),
5054
- onClick: w ? void 0 : vl(A, T),
5055
- onContextMenu: vl(j, T),
5056
- onWheel: vl(M, T),
5057
- onPointerEnter: w ? void 0 : f,
5058
- onPointerMove: w ? (e) => {
5059
- let { userSelectionRect: r, transform: a, nodeLookup: s, edgeLookup: c, connectionLookup: l, triggerNodeChanges: u, triggerEdgeChanges: d, defaultEdgeOptions: f, resetSelectedElements: p } = v.getState();
5060
- if (!E.current || !r) return;
5061
- let { x: m, y: h } = yo(e.nativeEvent, E.current), { startX: g, startY: _ } = r;
5062
- if (!k.current) {
5063
- let n = t ? 0 : i;
5064
- if (Math.hypot(m - g, h - _) <= n) return;
5065
- p(), o?.(e);
5066
- }
5067
- k.current = !0;
5068
- let y = {
5069
- startX: g,
5070
- startY: _,
5071
- x: m < g ? m : g,
5072
- y: h < _ ? h : _,
5073
- width: Math.abs(m - g),
5074
- height: Math.abs(h - _)
5075
- }, b = D.current, x = O.current;
5076
- D.current = new Set(Aa(s, y, a, n === va.Partial, !0).map((e) => e.id)), O.current = /* @__PURE__ */ new Set();
5077
- let S = f?.selectable ?? !0;
5078
- for (let e of D.current) {
5079
- let t = l.get(e);
5080
- if (t) for (let { edgeId: e } of t.values()) {
5081
- let t = c.get(e);
5082
- t && (t.selectable ?? S) && O.current.add(e);
5083
- }
5137
+ onClick: k ? void 0 : yl(L, A),
5138
+ onContextMenu: yl(R, A),
5139
+ onWheel: yl(ee, A),
5140
+ onPointerEnter: k ? void 0 : m,
5141
+ onPointerMove: k ? (e) => {
5142
+ let { userSelectionRect: n, transform: r, resetSelectedElements: i } = x.getState();
5143
+ if (!j.current || !n) return;
5144
+ let { x: o, y: c } = yo(e.nativeEvent, j.current);
5145
+ F.current = {
5146
+ x: o,
5147
+ y: c
5148
+ };
5149
+ let l = $a({
5150
+ x: n.startX,
5151
+ y: n.startY
5152
+ }, r);
5153
+ if (!P.current) {
5154
+ let n = t ? 0 : a;
5155
+ if (Math.hypot(o - l.x, c - l.y) <= n) return;
5156
+ i(), s?.(e);
5084
5157
  }
5085
- lo(b, D.current) || u(Yc(s, D.current, !0)), lo(x, O.current) || d(Yc(c, O.current)), v.setState({
5086
- userSelectionRect: y,
5087
- userSelectionActive: !0,
5088
- nodesSelectionActive: !1
5089
- });
5090
- } : p,
5091
- onPointerUp: w ? (e) => {
5092
- e.button === 0 && (e.target?.releasePointerCapture?.(e.pointerId), !y && e.target === T.current && v.getState().userSelectionRect && A?.(e), v.setState({
5158
+ P.current = !0, I.current ||= (H(), !0), V(o, c);
5159
+ } : h,
5160
+ onPointerUp: k ? (e) => {
5161
+ e.button === 0 && (e.target?.releasePointerCapture?.(e.pointerId), !C && e.target === A.current && x.getState().userSelectionRect && L?.(e), x.setState({
5093
5162
  userSelectionActive: !1,
5094
5163
  userSelectionRect: null
5095
- }), k.current && (s?.(e), v.setState({ nodesSelectionActive: D.current.size > 0 })));
5096
- } : void 0,
5097
- onPointerDownCapture: w ? (n) => {
5098
- let { domNode: r } = v.getState();
5099
- if (E.current = r?.getBoundingClientRect(), !E.current) return;
5100
- let i = n.target === T.current;
5101
- if (!i && n.target.closest(".nokey") || !e || !(a && i || t) || n.button !== 0 || !n.isPrimary) return;
5102
- n.target?.setPointerCapture?.(n.pointerId), k.current = !1;
5103
- let { x: o, y: s } = yo(n.nativeEvent, E.current);
5104
- v.setState({ userSelectionRect: {
5105
- width: 0,
5106
- height: 0,
5107
- startX: o,
5108
- startY: s,
5109
- x: o,
5110
- y: s
5111
- } }), i || (n.stopPropagation(), n.preventDefault());
5164
+ }), P.current && (l?.(e), x.setState({ nodesSelectionActive: M.current.size > 0 })), U());
5112
5165
  } : void 0,
5113
- onClickCapture: w ? (e) => {
5114
- k.current &&= (e.stopPropagation(), !1);
5166
+ onPointerCancel: k ? (e) => {
5167
+ e.target?.releasePointerCapture?.(e.pointerId), U();
5115
5168
  } : void 0,
5116
- onPointerLeave: m,
5117
- ref: T,
5118
- style: pl,
5119
- children: [h, g(_l, {})]
5169
+ onPointerDownCapture: k ? B : void 0,
5170
+ onClickCapture: k ? z : void 0,
5171
+ onPointerLeave: v,
5172
+ ref: A,
5173
+ style: ml,
5174
+ children: [y, g(vl, {})]
5120
5175
  });
5121
5176
  }
5122
- function xl({ id: e, store: t, unselect: n = !1, nodeRef: r }) {
5177
+ function Sl({ id: e, store: t, unselect: n = !1, nodeRef: r }) {
5123
5178
  let { addSelectedNodes: i, unselectNodesAndEdges: a, multiSelectionActive: o, nodeLookup: s, onError: c } = t.getState(), l = s.get(e);
5124
5179
  if (!l) {
5125
5180
  c?.("012", J.error012(e));
@@ -5130,13 +5185,13 @@ function xl({ id: e, store: t, unselect: n = !1, nodeRef: r }) {
5130
5185
  edges: []
5131
5186
  }), requestAnimationFrame(() => r?.current?.blur())) : i([e]);
5132
5187
  }
5133
- function Sl({ nodeRef: e, disabled: t = !1, noDragClassName: n, handleSelector: r, nodeId: i, isSelectable: a, nodeClickDistance: o }) {
5188
+ function Cl({ nodeRef: e, disabled: t = !1, noDragClassName: n, handleSelector: r, nodeId: i, isSelectable: a, nodeClickDistance: o }) {
5134
5189
  let s = Q(), [l, u] = f(!1), p = d();
5135
5190
  return c(() => {
5136
5191
  p.current = ms({
5137
5192
  getStoreItems: () => s.getState(),
5138
5193
  onNodeMouseDown: (t) => {
5139
- xl({
5194
+ Sl({
5140
5195
  id: t,
5141
5196
  store: s,
5142
5197
  nodeRef: e
@@ -5170,11 +5225,11 @@ function Sl({ nodeRef: e, disabled: t = !1, noDragClassName: n, handleSelector:
5170
5225
  o
5171
5226
  ]), l;
5172
5227
  }
5173
- var Cl = (e) => (t) => t.selected && (t.draggable || e && t.draggable === void 0);
5174
- function wl() {
5228
+ var wl = (e) => (t) => t.selected && (t.draggable || e && t.draggable === void 0);
5229
+ function Tl() {
5175
5230
  let e = Q();
5176
5231
  return a((t) => {
5177
- let { nodeExtent: n, snapToGrid: r, snapGrid: i, nodesDraggable: a, onError: o, updateNodePositions: s, nodeLookup: c, nodeOrigin: l } = e.getState(), u = /* @__PURE__ */ new Map(), d = Cl(a), f = r ? i[0] : 5, p = r ? i[1] : 5, m = t.direction.x * f * t.factor, h = t.direction.y * p * t.factor;
5232
+ let { nodeExtent: n, snapToGrid: r, snapGrid: i, nodesDraggable: a, onError: o, updateNodePositions: s, nodeLookup: c, nodeOrigin: l } = e.getState(), u = /* @__PURE__ */ new Map(), d = wl(a), f = r ? i[0] : 5, p = r ? i[1] : 5, m = t.direction.x * f * t.factor, h = t.direction.y * p * t.factor;
5178
5233
  for (let [, e] of c) {
5179
5234
  if (!d(e)) continue;
5180
5235
  let t = {
@@ -5195,13 +5250,13 @@ function wl() {
5195
5250
  s(u);
5196
5251
  }, []);
5197
5252
  }
5198
- var Tl = t(null), El = Tl.Provider;
5199
- Tl.Consumer;
5200
- var Dl = () => o(Tl), Ol = (e) => ({
5253
+ var El = t(null), Dl = El.Provider;
5254
+ El.Consumer;
5255
+ var Ol = () => o(El), kl = (e) => ({
5201
5256
  connectOnClick: e.connectOnClick,
5202
5257
  noPanClassName: e.noPanClassName,
5203
5258
  rfId: e.rfId
5204
- }), kl = (e, t, n) => (r) => {
5259
+ }), Al = (e, t, n) => (r) => {
5205
5260
  let { connectionClickStartHandle: i, connectionMode: a, connection: o } = r, { fromHandle: s, toHandle: c, isValid: l } = o, u = c?.nodeId === e && c?.id === t && c?.type === n;
5206
5261
  return {
5207
5262
  connectingFrom: s?.nodeId === e && s?.id === t && s?.type === n,
@@ -5213,8 +5268,8 @@ var Dl = () => o(Tl), Ol = (e) => ({
5213
5268
  valid: u && l
5214
5269
  };
5215
5270
  };
5216
- function Al({ type: e = "source", position: t = Y.Top, isValidConnection: n, isConnectable: r = !0, isConnectableStart: i = !0, isConnectableEnd: a = !0, id: o, onConnect: s, children: c, className: l, onMouseDown: u, onTouchStart: d, ...f }, p) {
5217
- let m = o || null, h = e === "target", _ = Q(), v = Dl(), { connectOnClick: y, noPanClassName: b, rfId: x } = Z(Ol, X), { connectingFrom: C, connectingTo: w, clickConnecting: T, isPossibleEndHandle: E, connectionInProcess: D, clickConnectionInProcess: O, valid: k } = Z(kl(v, m, e), X);
5271
+ function jl({ type: e = "source", position: t = Y.Top, isValidConnection: n, isConnectable: r = !0, isConnectableStart: i = !0, isConnectableEnd: a = !0, id: o, onConnect: s, children: c, className: l, onMouseDown: u, onTouchStart: d, ...f }, p) {
5272
+ let m = o || null, h = e === "target", _ = Q(), v = Ol(), { connectOnClick: y, noPanClassName: b, rfId: x } = Z(kl, X), { connectingFrom: C, connectingTo: w, clickConnecting: T, isPossibleEndHandle: E, connectionInProcess: D, clickConnectionInProcess: O, valid: k } = Z(Al(v, m, e), X);
5218
5273
  v || _.getState().onError?.("010", J.error010());
5219
5274
  let A = (e) => {
5220
5275
  let { defaultEdgeOptions: t, onConnect: n, hasDefaultEdges: r } = _.getState(), i = {
@@ -5222,8 +5277,8 @@ function Al({ type: e = "source", position: t = Y.Top, isValidConnection: n, isC
5222
5277
  ...e
5223
5278
  };
5224
5279
  if (r) {
5225
- let { edges: e, setEdges: t } = _.getState();
5226
- t(Ao(i, e));
5280
+ let { edges: e, setEdges: t, onError: n } = _.getState();
5281
+ t(Qc(i, e, { onError: n }));
5227
5282
  }
5228
5283
  n?.(i), s?.(i);
5229
5284
  }, j = (e) => {
@@ -5257,40 +5312,6 @@ function Al({ type: e = "source", position: t = Y.Top, isValidConnection: n, isC
5257
5312
  });
5258
5313
  }
5259
5314
  t ? u?.(e) : d?.(e);
5260
- }, M = (t) => {
5261
- let { onClickConnectStart: r, onClickConnectEnd: a, connectionClickStartHandle: o, connectionMode: s, isValidConnection: c, lib: l, rfId: u, nodeLookup: d, connection: f } = _.getState();
5262
- if (!v || !o && !i) return;
5263
- if (!o) {
5264
- r?.(t.nativeEvent, {
5265
- nodeId: v,
5266
- handleId: m,
5267
- handleType: e
5268
- }), _.setState({ connectionClickStartHandle: {
5269
- nodeId: v,
5270
- type: e,
5271
- id: m
5272
- } });
5273
- return;
5274
- }
5275
- let p = ho(t.target), h = n || c, { connection: g, isValid: y } = ws.isValid(t.nativeEvent, {
5276
- handle: {
5277
- nodeId: v,
5278
- id: m,
5279
- type: e
5280
- },
5281
- connectionMode: s,
5282
- fromNodeId: o.nodeId,
5283
- fromHandleId: o.id || null,
5284
- fromType: o.type,
5285
- isValidConnection: h,
5286
- flowId: u,
5287
- doc: p,
5288
- lib: l,
5289
- nodeLookup: d
5290
- });
5291
- y && g && A(g);
5292
- let b = structuredClone(f);
5293
- delete b.inProgress, b.toPosition = b.toHandle ? b.toHandle.position : null, a?.(t, b), _.setState({ connectionClickStartHandle: null });
5294
5315
  };
5295
5316
  return g("div", {
5296
5317
  "data-handleid": m,
@@ -5318,46 +5339,80 @@ function Al({ type: e = "source", position: t = Y.Top, isValidConnection: n, isC
5318
5339
  ]),
5319
5340
  onMouseDown: j,
5320
5341
  onTouchStart: j,
5321
- onClick: y ? M : void 0,
5342
+ onClick: y ? (t) => {
5343
+ let { onClickConnectStart: r, onClickConnectEnd: a, connectionClickStartHandle: o, connectionMode: s, isValidConnection: c, lib: l, rfId: u, nodeLookup: d, connection: f } = _.getState();
5344
+ if (!v || !o && !i) return;
5345
+ if (!o) {
5346
+ r?.(t.nativeEvent, {
5347
+ nodeId: v,
5348
+ handleId: m,
5349
+ handleType: e
5350
+ }), _.setState({ connectionClickStartHandle: {
5351
+ nodeId: v,
5352
+ type: e,
5353
+ id: m
5354
+ } });
5355
+ return;
5356
+ }
5357
+ let p = ho(t.target), h = n || c, { connection: g, isValid: y } = ws.isValid(t.nativeEvent, {
5358
+ handle: {
5359
+ nodeId: v,
5360
+ id: m,
5361
+ type: e
5362
+ },
5363
+ connectionMode: s,
5364
+ fromNodeId: o.nodeId,
5365
+ fromHandleId: o.id || null,
5366
+ fromType: o.type,
5367
+ isValidConnection: h,
5368
+ flowId: u,
5369
+ doc: p,
5370
+ lib: l,
5371
+ nodeLookup: d
5372
+ });
5373
+ y && g && A(g);
5374
+ let b = structuredClone(f);
5375
+ delete b.inProgress, b.toPosition = b.toHandle ? b.toHandle.position : null, a?.(t, b), _.setState({ connectionClickStartHandle: null });
5376
+ } : void 0,
5322
5377
  ref: p,
5323
5378
  ...f,
5324
5379
  children: c
5325
5380
  });
5326
5381
  }
5327
- var jl = i(el(Al));
5328
- function Ml({ data: e, isConnectable: t, sourcePosition: n = Y.Bottom }) {
5329
- return _(h, { children: [e?.label, g(jl, {
5382
+ var Ml = i(tl(jl));
5383
+ function Nl({ data: e, isConnectable: t, sourcePosition: n = Y.Bottom }) {
5384
+ return _(h, { children: [e?.label, g(Ml, {
5330
5385
  type: "source",
5331
5386
  position: n,
5332
5387
  isConnectable: t
5333
5388
  })] });
5334
5389
  }
5335
- function Nl({ data: e, isConnectable: t, targetPosition: n = Y.Top, sourcePosition: r = Y.Bottom }) {
5390
+ function Pl({ data: e, isConnectable: t, targetPosition: n = Y.Top, sourcePosition: r = Y.Bottom }) {
5336
5391
  return _(h, { children: [
5337
- g(jl, {
5392
+ g(Ml, {
5338
5393
  type: "target",
5339
5394
  position: n,
5340
5395
  isConnectable: t
5341
5396
  }),
5342
5397
  e?.label,
5343
- g(jl, {
5398
+ g(Ml, {
5344
5399
  type: "source",
5345
5400
  position: r,
5346
5401
  isConnectable: t
5347
5402
  })
5348
5403
  ] });
5349
5404
  }
5350
- function Pl() {
5405
+ function Fl() {
5351
5406
  return null;
5352
5407
  }
5353
- function Fl({ data: e, isConnectable: t, targetPosition: n = Y.Top }) {
5354
- return _(h, { children: [g(jl, {
5408
+ function Il({ data: e, isConnectable: t, targetPosition: n = Y.Top }) {
5409
+ return _(h, { children: [g(Ml, {
5355
5410
  type: "target",
5356
5411
  position: n,
5357
5412
  isConnectable: t
5358
5413
  }), e?.label] });
5359
5414
  }
5360
- var Il = {
5415
+ var Ll = {
5361
5416
  ArrowUp: {
5362
5417
  x: 0,
5363
5418
  y: -1
@@ -5374,13 +5429,13 @@ var Il = {
5374
5429
  x: 1,
5375
5430
  y: 0
5376
5431
  }
5377
- }, Ll = {
5378
- input: Ml,
5379
- default: Nl,
5380
- output: Fl,
5381
- group: Pl
5432
+ }, Rl = {
5433
+ input: Nl,
5434
+ default: Pl,
5435
+ output: Il,
5436
+ group: Fl
5382
5437
  };
5383
- function Rl(e) {
5438
+ function zl(e) {
5384
5439
  return e.internals.handleBounds === void 0 ? {
5385
5440
  width: e.width ?? e.initialWidth ?? e.style?.width,
5386
5441
  height: e.height ?? e.initialHeight ?? e.style?.height
@@ -5389,7 +5444,7 @@ function Rl(e) {
5389
5444
  height: e.height ?? e.style?.height
5390
5445
  };
5391
5446
  }
5392
- var zl = (e) => {
5447
+ var Bl = (e) => {
5393
5448
  let { width: t, height: n, x: r, y: i } = ka(e.nodeLookup, { filter: (e) => !!e.selected });
5394
5449
  return {
5395
5450
  width: Ya(t) ? t : null,
@@ -5398,13 +5453,13 @@ var zl = (e) => {
5398
5453
  transformString: `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`
5399
5454
  };
5400
5455
  };
5401
- function Bl({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y: n }) {
5402
- let r = Q(), { width: i, height: a, transformString: o, userSelectionActive: s } = Z(zl, X), l = wl(), u = d(null);
5456
+ function Vl({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y: n }) {
5457
+ let r = Q(), { width: i, height: a, transformString: o, userSelectionActive: s } = Z(Bl, X), l = Tl(), u = d(null);
5403
5458
  c(() => {
5404
5459
  n || u.current?.focus({ preventScroll: !0 });
5405
5460
  }, [n]);
5406
5461
  let f = !s && i !== null && a !== null;
5407
- if (Sl({
5462
+ if (Cl({
5408
5463
  nodeRef: u,
5409
5464
  disabled: !f
5410
5465
  }), !f) return null;
@@ -5424,8 +5479,8 @@ function Bl({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y:
5424
5479
  onContextMenu: p,
5425
5480
  tabIndex: n ? void 0 : -1,
5426
5481
  onKeyDown: n ? void 0 : (e) => {
5427
- Object.prototype.hasOwnProperty.call(Il, e.key) && (e.preventDefault(), l({
5428
- direction: Il[e.key],
5482
+ Object.prototype.hasOwnProperty.call(Ll, e.key) && (e.preventDefault(), l({
5483
+ direction: Ll[e.key],
5429
5484
  factor: e.shiftKey ? 4 : 1
5430
5485
  }));
5431
5486
  },
@@ -5436,38 +5491,38 @@ function Bl({ onSelectionContextMenu: e, noPanClassName: t, disableKeyboardA11y:
5436
5491
  })
5437
5492
  });
5438
5493
  }
5439
- var Vl = typeof window < "u" ? window : void 0, Hl = (e) => ({
5494
+ var Hl = typeof window < "u" ? window : void 0, Ul = (e) => ({
5440
5495
  nodesSelectionActive: e.nodesSelectionActive,
5441
5496
  userSelectionActive: e.userSelectionActive
5442
5497
  });
5443
- function Ul({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: r, onPaneMouseLeave: i, onPaneContextMenu: a, onPaneScroll: o, paneClickDistance: s, deleteKeyCode: c, selectionKeyCode: l, selectionOnDrag: u, selectionMode: d, onSelectionStart: f, onSelectionEnd: p, multiSelectionKeyCode: m, panActivationKeyCode: h, zoomActivationKeyCode: v, elementsSelectable: y, zoomOnScroll: b, zoomOnPinch: x, panOnScroll: S, panOnScrollSpeed: C, panOnScrollMode: w, zoomOnDoubleClick: T, panOnDrag: E, defaultViewport: D, translateExtent: O, minZoom: k, maxZoom: A, preventScrolling: j, onSelectionContextMenu: M, noWheelClassName: N, noPanClassName: P, disableKeyboardA11y: F, onViewportChange: I, isControlledViewport: L }) {
5444
- let { nodesSelectionActive: R, userSelectionActive: ee } = Z(Hl, X), z = Bc(l, { target: Vl }), B = Bc(h, { target: Vl }), V = B || E, H = B || S, U = u && V !== !0, W = z || ee || U;
5445
- return dl({
5498
+ function Wl({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove: r, onPaneMouseLeave: i, onPaneContextMenu: a, onPaneScroll: o, paneClickDistance: s, deleteKeyCode: c, selectionKeyCode: l, selectionOnDrag: u, selectionMode: d, onSelectionStart: f, onSelectionEnd: p, multiSelectionKeyCode: m, panActivationKeyCode: h, zoomActivationKeyCode: v, elementsSelectable: y, zoomOnScroll: b, zoomOnPinch: x, panOnScroll: S, panOnScrollSpeed: C, panOnScrollMode: w, zoomOnDoubleClick: T, panOnDrag: E, autoPanOnSelection: D, defaultViewport: O, translateExtent: k, minZoom: A, maxZoom: j, preventScrolling: M, onSelectionContextMenu: N, noWheelClassName: P, noPanClassName: F, disableKeyboardA11y: I, onViewportChange: L, isControlledViewport: R }) {
5499
+ let { nodesSelectionActive: ee, userSelectionActive: z } = Z(Ul, X), B = zc(l, { target: Hl }), V = zc(h, { target: Hl }), H = V || E, U = V || S, W = u && H !== !0, te = B || z || W;
5500
+ return fl({
5446
5501
  deleteKeyCode: c,
5447
5502
  multiSelectionKeyCode: m
5448
- }), g(hl, {
5503
+ }), g(gl, {
5449
5504
  onPaneContextMenu: a,
5450
5505
  elementsSelectable: y,
5451
5506
  zoomOnScroll: b,
5452
5507
  zoomOnPinch: x,
5453
- panOnScroll: H,
5508
+ panOnScroll: U,
5454
5509
  panOnScrollSpeed: C,
5455
5510
  panOnScrollMode: w,
5456
5511
  zoomOnDoubleClick: T,
5457
- panOnDrag: !z && V,
5458
- defaultViewport: D,
5459
- translateExtent: O,
5460
- minZoom: k,
5461
- maxZoom: A,
5512
+ panOnDrag: !B && H,
5513
+ defaultViewport: O,
5514
+ translateExtent: k,
5515
+ minZoom: A,
5516
+ maxZoom: j,
5462
5517
  zoomActivationKeyCode: v,
5463
- preventScrolling: j,
5464
- noWheelClassName: N,
5465
- noPanClassName: P,
5466
- onViewportChange: I,
5467
- isControlledViewport: L,
5518
+ preventScrolling: M,
5519
+ noWheelClassName: P,
5520
+ noPanClassName: F,
5521
+ onViewportChange: L,
5522
+ isControlledViewport: R,
5468
5523
  paneClickDistance: s,
5469
- selectionOnDrag: U,
5470
- children: _(bl, {
5524
+ selectionOnDrag: W,
5525
+ children: _(xl, {
5471
5526
  onSelectionStart: f,
5472
5527
  onSelectionEnd: p,
5473
5528
  onPaneClick: t,
@@ -5476,33 +5531,34 @@ function Ul({ children: e, onPaneClick: t, onPaneMouseEnter: n, onPaneMouseMove:
5476
5531
  onPaneMouseLeave: i,
5477
5532
  onPaneContextMenu: a,
5478
5533
  onPaneScroll: o,
5479
- panOnDrag: V,
5480
- isSelecting: !!W,
5534
+ panOnDrag: H,
5535
+ autoPanOnSelection: D,
5536
+ isSelecting: !!te,
5481
5537
  selectionMode: d,
5482
- selectionKeyPressed: z,
5538
+ selectionKeyPressed: B,
5483
5539
  paneClickDistance: s,
5484
- selectionOnDrag: U,
5485
- children: [e, R && g(Bl, {
5486
- onSelectionContextMenu: M,
5487
- noPanClassName: P,
5488
- disableKeyboardA11y: F
5540
+ selectionOnDrag: W,
5541
+ children: [e, ee && g(Vl, {
5542
+ onSelectionContextMenu: N,
5543
+ noPanClassName: F,
5544
+ disableKeyboardA11y: I
5489
5545
  })]
5490
5546
  })
5491
5547
  });
5492
5548
  }
5493
- Ul.displayName = "FlowRenderer";
5494
- var Wl = i(Ul), Gl = (e) => (t) => e ? Aa(t.nodeLookup, {
5549
+ Wl.displayName = "FlowRenderer";
5550
+ var Gl = i(Wl), Kl = (e) => (t) => e ? Aa(t.nodeLookup, {
5495
5551
  x: 0,
5496
5552
  y: 0,
5497
5553
  width: t.width,
5498
5554
  height: t.height
5499
5555
  }, t.transform, !0).map((e) => e.id) : Array.from(t.nodeLookup.keys());
5500
- function Kl(e) {
5501
- return Z(a(Gl(e), [e]), X);
5556
+ function ql(e) {
5557
+ return Z(a(Kl(e), [e]), X);
5502
5558
  }
5503
- var ql = (e) => e.updateNodeInternals;
5504
- function Jl() {
5505
- let e = Z(ql), [t] = f(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((t) => {
5559
+ var Jl = (e) => e.updateNodeInternals;
5560
+ function Yl() {
5561
+ let e = Z(Jl), [t] = f(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((t) => {
5506
5562
  let n = /* @__PURE__ */ new Map();
5507
5563
  t.forEach((e) => {
5508
5564
  let t = e.target.getAttribute("data-id");
@@ -5517,7 +5573,7 @@ function Jl() {
5517
5573
  t?.disconnect();
5518
5574
  }, [t]), t;
5519
5575
  }
5520
- function Yl({ node: e, nodeType: t, hasDimensions: n, resizeObserver: r }) {
5576
+ function Xl({ node: e, nodeType: t, hasDimensions: n, resizeObserver: r }) {
5521
5577
  let i = Q(), a = d(null), o = d(null), s = d(e.sourcePosition), l = d(e.targetPosition), u = d(t), f = n && !!e.internals.handleBounds;
5522
5578
  return c(() => {
5523
5579
  a.current && !e.hidden && (!f || o.current !== a.current) && (o.current && r?.unobserve(o.current), r?.observe(a.current), o.current = a.current);
@@ -5539,7 +5595,7 @@ function Yl({ node: e, nodeType: t, hasDimensions: n, resizeObserver: r }) {
5539
5595
  e.targetPosition
5540
5596
  ]), a;
5541
5597
  }
5542
- function Xl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave: i, onContextMenu: a, onDoubleClick: o, nodesDraggable: s, elementsSelectable: c, nodesConnectable: l, nodesFocusable: u, resizeObserver: d, noDragClassName: f, noPanClassName: p, disableKeyboardA11y: m, rfId: h, nodeTypes: _, nodeClickDistance: v, onError: y }) {
5598
+ function Zl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave: i, onContextMenu: a, onDoubleClick: o, nodesDraggable: s, elementsSelectable: c, nodesConnectable: l, nodesFocusable: u, resizeObserver: d, noDragClassName: f, noPanClassName: p, disableKeyboardA11y: m, rfId: h, nodeTypes: _, nodeClickDistance: v, onError: y }) {
5543
5599
  let { node: b, internals: x, isParent: C } = Z((t) => {
5544
5600
  let n = t.nodeLookup.get(e), r = t.parentLookup.has(e);
5545
5601
  return {
@@ -5547,14 +5603,14 @@ function Xl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
5547
5603
  internals: n.internals,
5548
5604
  isParent: r
5549
5605
  };
5550
- }, X), w = b.type || "default", T = _?.[w] || Ll[w];
5551
- T === void 0 && (y?.("003", J.error003(w)), w = "default", T = _?.default || Ll.default);
5552
- let E = !!(b.draggable || s && b.draggable === void 0), D = !!(b.selectable || c && b.selectable === void 0), O = !!(b.connectable || l && b.connectable === void 0), k = !!(b.focusable || u && b.focusable === void 0), A = Q(), j = so(b), M = Yl({
5606
+ }, X), w = b.type || "default", T = _?.[w] || Rl[w];
5607
+ T === void 0 && (y?.("003", J.error003(w)), w = "default", T = _?.default || Rl.default);
5608
+ let E = !!(b.draggable || s && b.draggable === void 0), D = !!(b.selectable || c && b.selectable === void 0), O = !!(b.connectable || l && b.connectable === void 0), k = !!(b.focusable || u && b.focusable === void 0), A = Q(), j = so(b), M = Xl({
5553
5609
  node: b,
5554
5610
  nodeType: w,
5555
5611
  hasDimensions: j,
5556
5612
  resizeObserver: d
5557
- }), N = Sl({
5613
+ }), N = Cl({
5558
5614
  nodeRef: M,
5559
5615
  disabled: b.hidden || !E,
5560
5616
  noDragClassName: f,
@@ -5562,24 +5618,24 @@ function Xl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
5562
5618
  nodeId: e,
5563
5619
  isSelectable: D,
5564
5620
  nodeClickDistance: v
5565
- }), P = wl();
5621
+ }), P = Tl();
5566
5622
  if (b.hidden) return null;
5567
- let F = oo(b), I = Rl(b), L = D || E || t || n || r || i, R = n ? (e) => n(e, { ...x.userNode }) : void 0, ee = r ? (e) => r(e, { ...x.userNode }) : void 0, z = i ? (e) => i(e, { ...x.userNode }) : void 0, B = a ? (e) => a(e, { ...x.userNode }) : void 0, V = o ? (e) => o(e, { ...x.userNode }) : void 0, H = (n) => {
5623
+ let F = oo(b), I = zl(b), L = D || E || t || n || r || i, R = n ? (e) => n(e, { ...x.userNode }) : void 0, ee = r ? (e) => r(e, { ...x.userNode }) : void 0, z = i ? (e) => i(e, { ...x.userNode }) : void 0, B = a ? (e) => a(e, { ...x.userNode }) : void 0, V = o ? (e) => o(e, { ...x.userNode }) : void 0, H = (n) => {
5568
5624
  let { selectNodesOnDrag: r, nodeDragThreshold: i } = A.getState();
5569
- D && (!r || !E || i > 0) && xl({
5625
+ D && (!r || !E || i > 0) && Sl({
5570
5626
  id: e,
5571
5627
  store: A,
5572
5628
  nodeRef: M
5573
5629
  }), t && t(n, { ...x.userNode });
5574
5630
  }, U = (t) => {
5575
5631
  if (!(_o(t.nativeEvent) || m)) {
5576
- if (ma.includes(t.key) && D) xl({
5632
+ if (ma.includes(t.key) && D) Sl({
5577
5633
  id: e,
5578
5634
  store: A,
5579
5635
  unselect: t.key === "Escape",
5580
5636
  nodeRef: M
5581
5637
  });
5582
- else if (E && b.selected && Object.prototype.hasOwnProperty.call(Il, t.key)) {
5638
+ else if (E && b.selected && Object.prototype.hasOwnProperty.call(Ll, t.key)) {
5583
5639
  t.preventDefault();
5584
5640
  let { ariaLabelConfig: e } = A.getState();
5585
5641
  A.setState({ ariaLiveMessage: e["node.a11yDescription.ariaLiveMessage"]({
@@ -5587,7 +5643,7 @@ function Xl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
5587
5643
  x: ~~x.positionAbsolute.x,
5588
5644
  y: ~~x.positionAbsolute.y
5589
5645
  }) }), P({
5590
- direction: Il[t.key],
5646
+ direction: Ll[t.key],
5591
5647
  factor: t.shiftKey ? 4 : 1
5592
5648
  });
5593
5649
  }
@@ -5638,10 +5694,10 @@ function Xl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
5638
5694
  onFocus: k ? W : void 0,
5639
5695
  role: b.ariaRole ?? (k ? "group" : void 0),
5640
5696
  "aria-roledescription": "node",
5641
- "aria-describedby": m ? void 0 : `${gc}-${h}`,
5697
+ "aria-describedby": m ? void 0 : `${hc}-${h}`,
5642
5698
  "aria-label": b.ariaLabel,
5643
5699
  ...b.domAttributes,
5644
- children: g(El, {
5700
+ children: g(Dl, {
5645
5701
  value: e,
5646
5702
  children: g(T, {
5647
5703
  id: e,
@@ -5665,19 +5721,19 @@ function Xl({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMouseLeave:
5665
5721
  })
5666
5722
  });
5667
5723
  }
5668
- var Zl = i(Xl), Ql = (e) => ({
5724
+ var Ql = i(Zl), $l = (e) => ({
5669
5725
  nodesDraggable: e.nodesDraggable,
5670
5726
  nodesConnectable: e.nodesConnectable,
5671
5727
  nodesFocusable: e.nodesFocusable,
5672
5728
  elementsSelectable: e.elementsSelectable,
5673
5729
  onError: e.onError
5674
5730
  });
5675
- function $l(e) {
5676
- let { nodesDraggable: t, nodesConnectable: n, nodesFocusable: r, elementsSelectable: i, onError: a } = Z(Ql, X), o = Kl(e.onlyRenderVisibleElements), s = Jl();
5731
+ function eu(e) {
5732
+ let { nodesDraggable: t, nodesConnectable: n, nodesFocusable: r, elementsSelectable: i, onError: a } = Z($l, X), o = ql(e.onlyRenderVisibleElements), s = Yl();
5677
5733
  return g("div", {
5678
5734
  className: "react-flow__nodes",
5679
- style: pl,
5680
- children: o.map((o) => g(Zl, {
5735
+ style: ml,
5736
+ children: o.map((o) => g(Ql, {
5681
5737
  id: o,
5682
5738
  nodeTypes: e.nodeTypes,
5683
5739
  nodeExtent: e.nodeExtent,
@@ -5701,9 +5757,9 @@ function $l(e) {
5701
5757
  }, o))
5702
5758
  });
5703
5759
  }
5704
- $l.displayName = "NodeRenderer";
5705
- var eu = i($l);
5706
- function tu(e) {
5760
+ eu.displayName = "NodeRenderer";
5761
+ var tu = i(eu);
5762
+ function nu(e) {
5707
5763
  return Z(a((t) => {
5708
5764
  if (!e) return t.edges.map((e) => e.id);
5709
5765
  let n = [];
@@ -5720,7 +5776,7 @@ function tu(e) {
5720
5776
  return n;
5721
5777
  }, [e]), X);
5722
5778
  }
5723
- var nu = ({ color: e = "none", strokeWidth: t = 1 }) => g("polyline", {
5779
+ var ru = ({ color: e = "none", strokeWidth: t = 1 }) => g("polyline", {
5724
5780
  className: "arrow",
5725
5781
  style: {
5726
5782
  strokeWidth: t,
@@ -5730,7 +5786,7 @@ var nu = ({ color: e = "none", strokeWidth: t = 1 }) => g("polyline", {
5730
5786
  fill: "none",
5731
5787
  strokeLinejoin: "round",
5732
5788
  points: "-5,-4 0,0 -5,4"
5733
- }), ru = ({ color: e = "none", strokeWidth: t = 1 }) => g("polyline", {
5789
+ }), iu = ({ color: e = "none", strokeWidth: t = 1 }) => g("polyline", {
5734
5790
  className: "arrowclosed",
5735
5791
  style: {
5736
5792
  strokeWidth: t,
@@ -5742,16 +5798,16 @@ var nu = ({ color: e = "none", strokeWidth: t = 1 }) => g("polyline", {
5742
5798
  strokeLinecap: "round",
5743
5799
  strokeLinejoin: "round",
5744
5800
  points: "-5,-4 0,0 -5,4 -5,-4"
5745
- }), iu = {
5746
- [xa.Arrow]: nu,
5747
- [xa.ArrowClosed]: ru
5801
+ }), au = {
5802
+ [xa.Arrow]: ru,
5803
+ [xa.ArrowClosed]: iu
5748
5804
  };
5749
- function au(e) {
5805
+ function ou(e) {
5750
5806
  let t = Q();
5751
- return u(() => Object.prototype.hasOwnProperty.call(iu, e) ? iu[e] : (t.getState().onError?.("009", J.error009(e)), null), [e]);
5807
+ return u(() => Object.prototype.hasOwnProperty.call(au, e) ? au[e] : (t.getState().onError?.("009", J.error009(e)), null), [e]);
5752
5808
  }
5753
- var ou = ({ id: e, type: t, color: n, width: r = 12.5, height: i = 12.5, markerUnits: a = "strokeWidth", strokeWidth: o, orient: s = "auto-start-reverse" }) => {
5754
- let c = au(t);
5809
+ var su = ({ id: e, type: t, color: n, width: r = 12.5, height: i = 12.5, markerUnits: a = "strokeWidth", strokeWidth: o, orient: s = "auto-start-reverse" }) => {
5810
+ let c = ou(t);
5755
5811
  return c ? g("marker", {
5756
5812
  className: "react-flow__arrowhead",
5757
5813
  id: e,
@@ -5767,7 +5823,7 @@ var ou = ({ id: e, type: t, color: n, width: r = 12.5, height: i = 12.5, markerU
5767
5823
  strokeWidth: o
5768
5824
  })
5769
5825
  }) : null;
5770
- }, su = ({ defaultColor: e, rfId: t }) => {
5826
+ }, cu = ({ defaultColor: e, rfId: t }) => {
5771
5827
  let n = Z((e) => e.edges), r = Z((e) => e.defaultEdgeOptions), i = u(() => Wo(n, {
5772
5828
  id: t,
5773
5829
  defaultColor: e,
@@ -5782,7 +5838,7 @@ var ou = ({ id: e, type: t, color: n, width: r = 12.5, height: i = 12.5, markerU
5782
5838
  return i.length ? g("svg", {
5783
5839
  className: "react-flow__marker",
5784
5840
  "aria-hidden": "true",
5785
- children: g("defs", { children: i.map((e) => g(ou, {
5841
+ children: g("defs", { children: i.map((e) => g(su, {
5786
5842
  id: e.id,
5787
5843
  type: e.type,
5788
5844
  color: e.color,
@@ -5794,9 +5850,9 @@ var ou = ({ id: e, type: t, color: n, width: r = 12.5, height: i = 12.5, markerU
5794
5850
  }, e.id)) })
5795
5851
  }) : null;
5796
5852
  };
5797
- su.displayName = "MarkerDefinitions";
5798
- var cu = i(su);
5799
- function lu({ x: e, y: t, label: n, labelStyle: r, labelShowBg: i = !0, labelBgStyle: a, labelBgPadding: o = [2, 4], labelBgBorderRadius: s = 2, children: l, className: u, ...p }) {
5853
+ cu.displayName = "MarkerDefinitions";
5854
+ var lu = i(cu);
5855
+ function uu({ x: e, y: t, label: n, labelStyle: r, labelShowBg: i = !0, labelBgStyle: a, labelBgPadding: o = [2, 4], labelBgBorderRadius: s = 2, children: l, className: u, ...p }) {
5800
5856
  let [m, h] = f({
5801
5857
  x: 1,
5802
5858
  y: 0,
@@ -5841,9 +5897,9 @@ function lu({ x: e, y: t, label: n, labelStyle: r, labelShowBg: i = !0, labelBgS
5841
5897
  ]
5842
5898
  }) : null;
5843
5899
  }
5844
- lu.displayName = "EdgeText";
5845
- var uu = i(lu);
5846
- function du({ path: e, labelX: t, labelY: n, label: r, labelStyle: i, labelShowBg: a, labelBgStyle: o, labelBgPadding: s, labelBgBorderRadius: c, interactionWidth: l = 20, ...u }) {
5900
+ uu.displayName = "EdgeText";
5901
+ var du = i(uu);
5902
+ function fu({ path: e, labelX: t, labelY: n, label: r, labelStyle: i, labelShowBg: a, labelBgStyle: o, labelBgPadding: s, labelBgBorderRadius: c, interactionWidth: l = 20, ...u }) {
5847
5903
  return _(h, { children: [
5848
5904
  g("path", {
5849
5905
  ...u,
@@ -5858,7 +5914,7 @@ function du({ path: e, labelX: t, labelY: n, label: r, labelStyle: i, labelShowB
5858
5914
  strokeWidth: l,
5859
5915
  className: "react-flow__edge-interaction"
5860
5916
  }) : null,
5861
- r && Ya(t) && Ya(n) ? g(uu, {
5917
+ r && Ya(t) && Ya(n) ? g(du, {
5862
5918
  x: t,
5863
5919
  y: n,
5864
5920
  label: r,
@@ -5870,17 +5926,17 @@ function du({ path: e, labelX: t, labelY: n, label: r, labelStyle: i, labelShowB
5870
5926
  }) : null
5871
5927
  ] });
5872
5928
  }
5873
- function fu({ pos: e, x1: t, y1: n, x2: r, y2: i }) {
5929
+ function pu({ pos: e, x1: t, y1: n, x2: r, y2: i }) {
5874
5930
  return e === Y.Left || e === Y.Right ? [.5 * (t + r), n] : [t, .5 * (n + i)];
5875
5931
  }
5876
- function pu({ sourceX: e, sourceY: t, sourcePosition: n = Y.Bottom, targetX: r, targetY: i, targetPosition: a = Y.Top }) {
5877
- let [o, s] = fu({
5932
+ function mu({ sourceX: e, sourceY: t, sourcePosition: n = Y.Bottom, targetX: r, targetY: i, targetPosition: a = Y.Top }) {
5933
+ let [o, s] = pu({
5878
5934
  pos: n,
5879
5935
  x1: e,
5880
5936
  y1: t,
5881
5937
  x2: r,
5882
5938
  y2: i
5883
- }), [c, l] = fu({
5939
+ }), [c, l] = pu({
5884
5940
  pos: a,
5885
5941
  x1: r,
5886
5942
  y1: i,
@@ -5904,9 +5960,9 @@ function pu({ sourceX: e, sourceY: t, sourcePosition: n = Y.Bottom, targetX: r,
5904
5960
  p
5905
5961
  ];
5906
5962
  }
5907
- function mu(e) {
5963
+ function hu(e) {
5908
5964
  return i(({ id: t, sourceX: n, sourceY: r, targetX: i, targetY: a, sourcePosition: o, targetPosition: s, label: c, labelStyle: l, labelShowBg: u, labelBgStyle: d, labelBgPadding: f, labelBgBorderRadius: p, style: m, markerEnd: h, markerStart: _, interactionWidth: v }) => {
5909
- let [y, b, x] = pu({
5965
+ let [y, b, x] = mu({
5910
5966
  sourceX: n,
5911
5967
  sourceY: r,
5912
5968
  sourcePosition: o,
@@ -5914,7 +5970,7 @@ function mu(e) {
5914
5970
  targetY: a,
5915
5971
  targetPosition: s
5916
5972
  });
5917
- return g(du, {
5973
+ return g(fu, {
5918
5974
  id: e.isInternal ? void 0 : t,
5919
5975
  path: y,
5920
5976
  labelX: b,
@@ -5932,9 +5988,9 @@ function mu(e) {
5932
5988
  });
5933
5989
  });
5934
5990
  }
5935
- var hu = mu({ isInternal: !1 }), gu = mu({ isInternal: !0 });
5936
- hu.displayName = "SimpleBezierEdge", gu.displayName = "SimpleBezierEdgeInternal";
5937
- function _u(e) {
5991
+ var gu = hu({ isInternal: !1 }), _u = hu({ isInternal: !0 });
5992
+ gu.displayName = "SimpleBezierEdge", _u.displayName = "SimpleBezierEdgeInternal";
5993
+ function vu(e) {
5938
5994
  return i(({ id: t, sourceX: n, sourceY: r, targetX: i, targetY: a, label: o, labelStyle: s, labelShowBg: c, labelBgStyle: l, labelBgPadding: u, labelBgBorderRadius: d, style: f, sourcePosition: p = Y.Bottom, targetPosition: m = Y.Top, markerEnd: h, markerStart: _, pathOptions: v, interactionWidth: y }) => {
5939
5995
  let [b, x, S] = Lo({
5940
5996
  sourceX: n,
@@ -5947,7 +6003,7 @@ function _u(e) {
5947
6003
  offset: v?.offset,
5948
6004
  stepPosition: v?.stepPosition
5949
6005
  });
5950
- return g(du, {
6006
+ return g(fu, {
5951
6007
  id: e.isInternal ? void 0 : t,
5952
6008
  path: b,
5953
6009
  labelX: x,
@@ -5965,12 +6021,12 @@ function _u(e) {
5965
6021
  });
5966
6022
  });
5967
6023
  }
5968
- var vu = _u({ isInternal: !1 }), yu = _u({ isInternal: !0 });
5969
- vu.displayName = "SmoothStepEdge", yu.displayName = "SmoothStepEdgeInternal";
5970
- function bu(e) {
6024
+ var yu = vu({ isInternal: !1 }), bu = vu({ isInternal: !0 });
6025
+ yu.displayName = "SmoothStepEdge", bu.displayName = "SmoothStepEdgeInternal";
6026
+ function xu(e) {
5971
6027
  return i(({ id: t, ...n }) => {
5972
6028
  let r = e.isInternal ? void 0 : t;
5973
- return g(vu, {
6029
+ return g(yu, {
5974
6030
  ...n,
5975
6031
  id: r,
5976
6032
  pathOptions: u(() => ({
@@ -5980,9 +6036,9 @@ function bu(e) {
5980
6036
  });
5981
6037
  });
5982
6038
  }
5983
- var xu = bu({ isInternal: !1 }), Su = bu({ isInternal: !0 });
5984
- xu.displayName = "StepEdge", Su.displayName = "StepEdgeInternal";
5985
- function Cu(e) {
6039
+ var Su = xu({ isInternal: !1 }), Cu = xu({ isInternal: !0 });
6040
+ Su.displayName = "StepEdge", Cu.displayName = "StepEdgeInternal";
6041
+ function wu(e) {
5986
6042
  return i(({ id: t, sourceX: n, sourceY: r, targetX: i, targetY: a, label: o, labelStyle: s, labelShowBg: c, labelBgStyle: l, labelBgPadding: u, labelBgBorderRadius: d, style: f, markerEnd: p, markerStart: m, interactionWidth: h }) => {
5987
6043
  let [_, v, y] = jo({
5988
6044
  sourceX: n,
@@ -5990,7 +6046,7 @@ function Cu(e) {
5990
6046
  targetX: i,
5991
6047
  targetY: a
5992
6048
  });
5993
- return g(du, {
6049
+ return g(fu, {
5994
6050
  id: e.isInternal ? void 0 : t,
5995
6051
  path: _,
5996
6052
  labelX: v,
@@ -6008,9 +6064,9 @@ function Cu(e) {
6008
6064
  });
6009
6065
  });
6010
6066
  }
6011
- var wu = Cu({ isInternal: !1 }), Tu = Cu({ isInternal: !0 });
6012
- wu.displayName = "StraightEdge", Tu.displayName = "StraightEdgeInternal";
6013
- function Eu(e) {
6067
+ var Tu = wu({ isInternal: !1 }), Eu = wu({ isInternal: !0 });
6068
+ Tu.displayName = "StraightEdge", Eu.displayName = "StraightEdgeInternal";
6069
+ function Du(e) {
6014
6070
  return i(({ id: t, sourceX: n, sourceY: r, targetX: i, targetY: a, sourcePosition: o = Y.Bottom, targetPosition: s = Y.Top, label: c, labelStyle: l, labelShowBg: u, labelBgStyle: d, labelBgPadding: f, labelBgBorderRadius: p, style: m, markerEnd: h, markerStart: _, pathOptions: v, interactionWidth: y }) => {
6015
6071
  let [b, x, S] = wo({
6016
6072
  sourceX: n,
@@ -6021,7 +6077,7 @@ function Eu(e) {
6021
6077
  targetPosition: s,
6022
6078
  curvature: v?.curvature
6023
6079
  });
6024
- return g(du, {
6080
+ return g(fu, {
6025
6081
  id: e.isInternal ? void 0 : t,
6026
6082
  path: b,
6027
6083
  labelX: x,
@@ -6039,36 +6095,36 @@ function Eu(e) {
6039
6095
  });
6040
6096
  });
6041
6097
  }
6042
- var Du = Eu({ isInternal: !1 }), Ou = Eu({ isInternal: !0 });
6043
- Du.displayName = "BezierEdge", Ou.displayName = "BezierEdgeInternal";
6044
- var ku = {
6045
- default: Ou,
6046
- straight: Tu,
6047
- step: Su,
6048
- smoothstep: yu,
6049
- simplebezier: gu
6050
- }, Au = {
6098
+ var Ou = Du({ isInternal: !1 }), ku = Du({ isInternal: !0 });
6099
+ Ou.displayName = "BezierEdge", ku.displayName = "BezierEdgeInternal";
6100
+ var Au = {
6101
+ default: ku,
6102
+ straight: Eu,
6103
+ step: Cu,
6104
+ smoothstep: bu,
6105
+ simplebezier: _u
6106
+ }, ju = {
6051
6107
  sourceX: null,
6052
6108
  sourceY: null,
6053
6109
  targetX: null,
6054
6110
  targetY: null,
6055
6111
  sourcePosition: null,
6056
6112
  targetPosition: null
6057
- }, ju = (e, t, n) => n === Y.Left ? e - t : n === Y.Right ? e + t : e, Mu = (e, t, n) => n === Y.Top ? e - t : n === Y.Bottom ? e + t : e, Nu = "react-flow__edgeupdater";
6058
- function Pu({ position: e, centerX: t, centerY: n, radius: r = 10, onMouseDown: i, onMouseEnter: a, onMouseOut: o, type: s }) {
6113
+ }, Mu = (e, t, n) => n === Y.Left ? e - t : n === Y.Right ? e + t : e, Nu = (e, t, n) => n === Y.Top ? e - t : n === Y.Bottom ? e + t : e, Pu = "react-flow__edgeupdater";
6114
+ function Fu({ position: e, centerX: t, centerY: n, radius: r = 10, onMouseDown: i, onMouseEnter: a, onMouseOut: o, type: s }) {
6059
6115
  return g("circle", {
6060
6116
  onMouseDown: i,
6061
6117
  onMouseEnter: a,
6062
6118
  onMouseOut: o,
6063
- className: S([Nu, `${Nu}-${s}`]),
6064
- cx: ju(t, r, e),
6065
- cy: Mu(n, r, e),
6119
+ className: S([Pu, `${Pu}-${s}`]),
6120
+ cx: Mu(t, r, e),
6121
+ cy: Nu(n, r, e),
6066
6122
  r,
6067
6123
  stroke: "transparent",
6068
6124
  fill: "transparent"
6069
6125
  });
6070
6126
  }
6071
- function Fu({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourceY: i, targetX: a, targetY: o, sourcePosition: s, targetPosition: c, onReconnect: l, onReconnectStart: u, onReconnectEnd: d, setReconnecting: f, setUpdateHover: p }) {
6127
+ function Iu({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourceY: i, targetX: a, targetY: o, sourcePosition: s, targetPosition: c, onReconnect: l, onReconnectStart: u, onReconnectEnd: d, setReconnecting: f, setUpdateHover: p }) {
6072
6128
  let m = Q(), v = (e, t) => {
6073
6129
  if (e.button !== 0) return;
6074
6130
  let { autoPanOnConnect: r, domNode: i, connectionMode: a, connectionRadius: o, lib: s, onConnectStart: c, cancelConnection: p, nodeLookup: h, rfId: g, panBy: _, updateConnection: v } = m.getState(), y = t.type === "target";
@@ -6110,7 +6166,7 @@ function Fu({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourc
6110
6166
  id: n.sourceHandle ?? null,
6111
6167
  type: "source"
6112
6168
  }), x = () => p(!0), S = () => p(!1);
6113
- return _(h, { children: [(e === !0 || e === "source") && g(Pu, {
6169
+ return _(h, { children: [(e === !0 || e === "source") && g(Fu, {
6114
6170
  position: s,
6115
6171
  centerX: r,
6116
6172
  centerY: i,
@@ -6119,7 +6175,7 @@ function Fu({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourc
6119
6175
  onMouseEnter: x,
6120
6176
  onMouseOut: S,
6121
6177
  type: "source"
6122
- }), (e === !0 || e === "target") && g(Pu, {
6178
+ }), (e === !0 || e === "target") && g(Fu, {
6123
6179
  position: c,
6124
6180
  centerX: a,
6125
6181
  centerY: o,
@@ -6130,19 +6186,19 @@ function Fu({ isReconnectable: e, reconnectRadius: t, edge: n, sourceX: r, sourc
6130
6186
  type: "target"
6131
6187
  })] });
6132
6188
  }
6133
- function Iu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectable: r, onClick: i, onDoubleClick: o, onContextMenu: s, onMouseEnter: c, onMouseMove: l, onMouseLeave: p, reconnectRadius: m, onReconnect: h, onReconnectStart: v, onReconnectEnd: y, rfId: b, edgeTypes: x, noPanClassName: C, onError: w, disableKeyboardA11y: T }) {
6189
+ function Lu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectable: r, onClick: i, onDoubleClick: o, onContextMenu: s, onMouseEnter: c, onMouseMove: l, onMouseLeave: p, reconnectRadius: m, onReconnect: h, onReconnectStart: v, onReconnectEnd: y, rfId: b, edgeTypes: x, noPanClassName: C, onError: w, disableKeyboardA11y: T }) {
6134
6190
  let E = Z((t) => t.edgeLookup.get(e)), D = Z((e) => e.defaultEdgeOptions);
6135
6191
  E = D ? {
6136
6192
  ...D,
6137
6193
  ...E
6138
6194
  } : E;
6139
- let O = E.type || "default", k = x?.[O] || ku[O];
6140
- k === void 0 && (w?.("011", J.error011(O)), O = "default", k = x?.default || ku.default);
6195
+ let O = E.type || "default", k = x?.[O] || Au[O];
6196
+ k === void 0 && (w?.("011", J.error011(O)), O = "default", k = x?.default || Au.default);
6141
6197
  let A = !!(E.focusable || t && E.focusable === void 0), j = h !== void 0 && (E.reconnectable || n && E.reconnectable === void 0), M = !!(E.selectable || r && E.selectable === void 0), N = d(null), [P, F] = f(!1), [I, L] = f(!1), R = Q(), { zIndex: ee, sourceX: z, sourceY: B, targetX: V, targetY: H, sourcePosition: U, targetPosition: W } = Z(a((t) => {
6142
6198
  let n = t.nodeLookup.get(E.source), r = t.nodeLookup.get(E.target);
6143
6199
  if (!n || !r) return {
6144
6200
  zIndex: E.zIndex,
6145
- ...Au
6201
+ ...ju
6146
6202
  };
6147
6203
  let i = zo({
6148
6204
  id: e,
@@ -6162,7 +6218,7 @@ function Iu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
6162
6218
  elevateOnSelect: t.elevateEdgesOnSelect,
6163
6219
  zIndexMode: t.zIndexMode
6164
6220
  }),
6165
- ...i || Au
6221
+ ...i || ju
6166
6222
  };
6167
6223
  }, [
6168
6224
  E.source,
@@ -6224,7 +6280,7 @@ function Iu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
6224
6280
  "data-id": e,
6225
6281
  "data-testid": `rf__edge-${e}`,
6226
6282
  "aria-label": E.ariaLabel === null ? void 0 : E.ariaLabel || `Edge from ${E.source} to ${E.target}`,
6227
- "aria-describedby": A ? `${_c}-${b}` : void 0,
6283
+ "aria-describedby": A ? `${gc}-${b}` : void 0,
6228
6284
  ref: N,
6229
6285
  ...E.domAttributes,
6230
6286
  children: [!I && g(k, {
@@ -6256,7 +6312,7 @@ function Iu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
6256
6312
  markerEnd: ne,
6257
6313
  pathOptions: "pathOptions" in E ? E.pathOptions : void 0,
6258
6314
  interactionWidth: E.interactionWidth
6259
- }), j && g(Fu, {
6315
+ }), j && g(Iu, {
6260
6316
  edge: E,
6261
6317
  isReconnectable: j,
6262
6318
  reconnectRadius: m,
@@ -6275,21 +6331,21 @@ function Iu({ id: e, edgesFocusable: t, edgesReconnectable: n, elementsSelectabl
6275
6331
  })
6276
6332
  });
6277
6333
  }
6278
- var Lu = i(Iu), Ru = (e) => ({
6334
+ var Ru = i(Lu), zu = (e) => ({
6279
6335
  edgesFocusable: e.edgesFocusable,
6280
6336
  edgesReconnectable: e.edgesReconnectable,
6281
6337
  elementsSelectable: e.elementsSelectable,
6282
6338
  connectionMode: e.connectionMode,
6283
6339
  onError: e.onError
6284
6340
  });
6285
- function zu({ defaultMarkerColor: e, onlyRenderVisibleElements: t, rfId: n, edgeTypes: r, noPanClassName: i, onReconnect: a, onEdgeContextMenu: o, onEdgeMouseEnter: s, onEdgeMouseMove: c, onEdgeMouseLeave: l, onEdgeClick: u, reconnectRadius: d, onEdgeDoubleClick: f, onReconnectStart: p, onReconnectEnd: m, disableKeyboardA11y: h }) {
6286
- let { edgesFocusable: v, edgesReconnectable: y, elementsSelectable: b, onError: x } = Z(Ru, X), S = tu(t);
6341
+ function Bu({ defaultMarkerColor: e, onlyRenderVisibleElements: t, rfId: n, edgeTypes: r, noPanClassName: i, onReconnect: a, onEdgeContextMenu: o, onEdgeMouseEnter: s, onEdgeMouseMove: c, onEdgeMouseLeave: l, onEdgeClick: u, reconnectRadius: d, onEdgeDoubleClick: f, onReconnectStart: p, onReconnectEnd: m, disableKeyboardA11y: h }) {
6342
+ let { edgesFocusable: v, edgesReconnectable: y, elementsSelectable: b, onError: x } = Z(zu, X), S = nu(t);
6287
6343
  return _("div", {
6288
6344
  className: "react-flow__edges",
6289
- children: [g(cu, {
6345
+ children: [g(lu, {
6290
6346
  defaultColor: e,
6291
6347
  rfId: n
6292
- }), S.map((e) => g(Lu, {
6348
+ }), S.map((e) => g(Ru, {
6293
6349
  id: e,
6294
6350
  edgesFocusable: v,
6295
6351
  edgesReconnectable: y,
@@ -6312,24 +6368,24 @@ function zu({ defaultMarkerColor: e, onlyRenderVisibleElements: t, rfId: n, edge
6312
6368
  }, e))]
6313
6369
  });
6314
6370
  }
6315
- zu.displayName = "EdgeRenderer";
6316
- var Bu = i(zu), Vu = (e) => `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;
6317
- function Hu({ children: e }) {
6371
+ Bu.displayName = "EdgeRenderer";
6372
+ var Vu = i(Bu), Hu = (e) => `translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;
6373
+ function Uu({ children: e }) {
6318
6374
  return g("div", {
6319
6375
  className: "react-flow__viewport xyflow__viewport react-flow__container",
6320
- style: { transform: Z(Vu) },
6376
+ style: { transform: Z(Hu) },
6321
6377
  children: e
6322
6378
  });
6323
6379
  }
6324
- function Uu(e) {
6325
- let t = cl(), n = d(!1);
6380
+ function Wu(e) {
6381
+ let t = ll(), n = d(!1);
6326
6382
  c(() => {
6327
6383
  !n.current && t.viewportInitialized && e && (setTimeout(() => e(t), 1), n.current = !0);
6328
6384
  }, [e, t.viewportInitialized]);
6329
6385
  }
6330
- var Wu = (e) => e.panZoom?.syncViewport;
6331
- function Gu(e) {
6332
- let t = Z(Wu), n = Q();
6386
+ var Gu = (e) => e.panZoom?.syncViewport;
6387
+ function Ku(e) {
6388
+ let t = Z(Gu), n = Q();
6333
6389
  return c(() => {
6334
6390
  e && (t?.(e), n.setState({ transform: [
6335
6391
  e.x,
@@ -6338,27 +6394,27 @@ function Gu(e) {
6338
6394
  ] }));
6339
6395
  }, [e, t]), null;
6340
6396
  }
6341
- function Ku(e) {
6397
+ function qu(e) {
6342
6398
  return e.connection.inProgress ? {
6343
6399
  ...e.connection,
6344
6400
  to: Qa(e.connection.to, e.transform)
6345
6401
  } : { ...e.connection };
6346
6402
  }
6347
- function qu(e) {
6348
- return e ? (t) => e(Ku(t)) : Ku;
6349
- }
6350
6403
  function Ju(e) {
6351
- return Z(qu(e), X);
6404
+ return e ? (t) => e(qu(t)) : qu;
6352
6405
  }
6353
- var Yu = (e) => ({
6406
+ function Yu(e) {
6407
+ return Z(Ju(e), X);
6408
+ }
6409
+ var Xu = (e) => ({
6354
6410
  nodesConnectable: e.nodesConnectable,
6355
6411
  isValid: e.connection.isValid,
6356
6412
  inProgress: e.connection.inProgress,
6357
6413
  width: e.width,
6358
6414
  height: e.height
6359
6415
  });
6360
- function Xu({ containerStyle: e, style: t, type: n, component: r }) {
6361
- let { nodesConnectable: i, width: a, height: o, isValid: s, inProgress: c } = Z(Yu, X);
6416
+ function Zu({ containerStyle: e, style: t, type: n, component: r }) {
6417
+ let { nodesConnectable: i, width: a, height: o, isValid: s, inProgress: c } = Z(Xu, X);
6362
6418
  return a && i && c ? g("svg", {
6363
6419
  style: e,
6364
6420
  width: a,
@@ -6366,7 +6422,7 @@ function Xu({ containerStyle: e, style: t, type: n, component: r }) {
6366
6422
  className: "react-flow__connectionline react-flow__container",
6367
6423
  children: g("g", {
6368
6424
  className: S(["react-flow__connection", Ca(s)]),
6369
- children: g(Zu, {
6425
+ children: g(Qu, {
6370
6426
  style: t,
6371
6427
  type: n,
6372
6428
  CustomComponent: r,
@@ -6375,8 +6431,8 @@ function Xu({ containerStyle: e, style: t, type: n, component: r }) {
6375
6431
  })
6376
6432
  }) : null;
6377
6433
  }
6378
- var Zu = ({ style: e, type: t = ba.Bezier, CustomComponent: n, isValid: r }) => {
6379
- let { inProgress: i, from: a, fromNode: o, fromHandle: s, fromPosition: c, to: l, toNode: u, toHandle: d, toPosition: f, pointer: p } = Ju();
6434
+ var Qu = ({ style: e, type: t = ba.Bezier, CustomComponent: n, isValid: r }) => {
6435
+ let { inProgress: i, from: a, fromNode: o, fromHandle: s, fromPosition: c, to: l, toNode: u, toHandle: d, toPosition: f, pointer: p } = Yu();
6380
6436
  if (!i) return;
6381
6437
  if (n) return g(n, {
6382
6438
  connectionLineType: t,
@@ -6407,7 +6463,7 @@ var Zu = ({ style: e, type: t = ba.Bezier, CustomComponent: n, isValid: r }) =>
6407
6463
  [m] = wo(h);
6408
6464
  break;
6409
6465
  case ba.SimpleBezier:
6410
- [m] = pu(h);
6466
+ [m] = mu(h);
6411
6467
  break;
6412
6468
  case ba.Step:
6413
6469
  [m] = Lo({
@@ -6427,9 +6483,9 @@ var Zu = ({ style: e, type: t = ba.Bezier, CustomComponent: n, isValid: r }) =>
6427
6483
  style: e
6428
6484
  });
6429
6485
  };
6430
- Zu.displayName = "ConnectionLine";
6431
- var Qu = {};
6432
- function $u(e = Qu) {
6486
+ Qu.displayName = "ConnectionLine";
6487
+ var $u = {};
6488
+ function ed(e = $u) {
6433
6489
  let t = d(e), n = Q();
6434
6490
  c(() => {
6435
6491
  if (process.env.NODE_ENV === "development") {
@@ -6442,7 +6498,7 @@ function $u(e = Qu) {
6442
6498
  }
6443
6499
  }, [e]);
6444
6500
  }
6445
- function ed() {
6501
+ function td() {
6446
6502
  let e = Q(), t = d(!1);
6447
6503
  c(() => {
6448
6504
  if (process.env.NODE_ENV === "development" && !t.current) {
@@ -6451,15 +6507,15 @@ function ed() {
6451
6507
  }
6452
6508
  }, []);
6453
6509
  }
6454
- function td({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick: i, onNodeDoubleClick: a, onEdgeDoubleClick: o, onNodeMouseEnter: s, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: u, onSelectionContextMenu: d, onSelectionStart: f, onSelectionEnd: p, connectionLineType: m, connectionLineStyle: h, connectionLineComponent: v, connectionLineContainerStyle: y, selectionKeyCode: b, selectionOnDrag: x, selectionMode: S, multiSelectionKeyCode: C, panActivationKeyCode: w, zoomActivationKeyCode: T, deleteKeyCode: E, onlyRenderVisibleElements: D, elementsSelectable: O, defaultViewport: k, translateExtent: A, minZoom: j, maxZoom: M, preventScrolling: N, defaultMarkerColor: P, zoomOnScroll: F, zoomOnPinch: I, panOnScroll: L, panOnScrollSpeed: R, panOnScrollMode: ee, zoomOnDoubleClick: z, panOnDrag: B, onPaneClick: V, onPaneMouseEnter: H, onPaneMouseMove: U, onPaneMouseLeave: W, onPaneScroll: te, onPaneContextMenu: ne, paneClickDistance: re, nodeClickDistance: ie, onEdgeContextMenu: ae, onEdgeMouseEnter: oe, onEdgeMouseMove: se, onEdgeMouseLeave: ce, reconnectRadius: le, onReconnect: ue, onReconnectStart: de, onReconnectEnd: fe, noDragClassName: pe, noWheelClassName: me, noPanClassName: he, disableKeyboardA11y: ge, nodeExtent: _e, rfId: ve, viewport: ye, onViewportChange: be }) {
6455
- return $u(e), $u(t), ed(), Uu(n), Gu(ye), g(Wl, {
6456
- onPaneClick: V,
6457
- onPaneMouseEnter: H,
6458
- onPaneMouseMove: U,
6459
- onPaneMouseLeave: W,
6460
- onPaneContextMenu: ne,
6461
- onPaneScroll: te,
6462
- paneClickDistance: re,
6510
+ function nd({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick: i, onNodeDoubleClick: a, onEdgeDoubleClick: o, onNodeMouseEnter: s, onNodeMouseMove: c, onNodeMouseLeave: l, onNodeContextMenu: u, onSelectionContextMenu: d, onSelectionStart: f, onSelectionEnd: p, connectionLineType: m, connectionLineStyle: h, connectionLineComponent: v, connectionLineContainerStyle: y, selectionKeyCode: b, selectionOnDrag: x, selectionMode: S, multiSelectionKeyCode: C, panActivationKeyCode: w, zoomActivationKeyCode: T, deleteKeyCode: E, onlyRenderVisibleElements: D, elementsSelectable: O, defaultViewport: k, translateExtent: A, minZoom: j, maxZoom: M, preventScrolling: N, defaultMarkerColor: P, zoomOnScroll: F, zoomOnPinch: I, panOnScroll: L, panOnScrollSpeed: R, panOnScrollMode: ee, zoomOnDoubleClick: z, panOnDrag: B, autoPanOnSelection: V, onPaneClick: H, onPaneMouseEnter: U, onPaneMouseMove: W, onPaneMouseLeave: te, onPaneScroll: ne, onPaneContextMenu: re, paneClickDistance: ie, nodeClickDistance: ae, onEdgeContextMenu: oe, onEdgeMouseEnter: se, onEdgeMouseMove: ce, onEdgeMouseLeave: le, reconnectRadius: ue, onReconnect: de, onReconnectStart: fe, onReconnectEnd: pe, noDragClassName: me, noWheelClassName: he, noPanClassName: ge, disableKeyboardA11y: _e, nodeExtent: ve, rfId: ye, viewport: be, onViewportChange: xe }) {
6511
+ return ed(e), ed(t), td(), Wu(n), Ku(be), g(Gl, {
6512
+ onPaneClick: H,
6513
+ onPaneMouseEnter: U,
6514
+ onPaneMouseMove: W,
6515
+ onPaneMouseLeave: te,
6516
+ onPaneContextMenu: re,
6517
+ onPaneScroll: ne,
6518
+ paneClickDistance: ie,
6463
6519
  deleteKeyCode: E,
6464
6520
  selectionKeyCode: b,
6465
6521
  selectionOnDrag: x,
@@ -6477,45 +6533,46 @@ function td({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick
6477
6533
  panOnScrollSpeed: R,
6478
6534
  panOnScrollMode: ee,
6479
6535
  panOnDrag: B,
6536
+ autoPanOnSelection: V,
6480
6537
  defaultViewport: k,
6481
6538
  translateExtent: A,
6482
6539
  minZoom: j,
6483
6540
  maxZoom: M,
6484
6541
  onSelectionContextMenu: d,
6485
6542
  preventScrolling: N,
6486
- noDragClassName: pe,
6487
- noWheelClassName: me,
6488
- noPanClassName: he,
6489
- disableKeyboardA11y: ge,
6490
- onViewportChange: be,
6491
- isControlledViewport: !!ye,
6492
- children: _(Hu, { children: [
6493
- g(Bu, {
6543
+ noDragClassName: me,
6544
+ noWheelClassName: he,
6545
+ noPanClassName: ge,
6546
+ disableKeyboardA11y: _e,
6547
+ onViewportChange: xe,
6548
+ isControlledViewport: !!be,
6549
+ children: _(Uu, { children: [
6550
+ g(Vu, {
6494
6551
  edgeTypes: t,
6495
6552
  onEdgeClick: i,
6496
6553
  onEdgeDoubleClick: o,
6497
- onReconnect: ue,
6498
- onReconnectStart: de,
6499
- onReconnectEnd: fe,
6554
+ onReconnect: de,
6555
+ onReconnectStart: fe,
6556
+ onReconnectEnd: pe,
6500
6557
  onlyRenderVisibleElements: D,
6501
- onEdgeContextMenu: ae,
6502
- onEdgeMouseEnter: oe,
6503
- onEdgeMouseMove: se,
6504
- onEdgeMouseLeave: ce,
6505
- reconnectRadius: le,
6558
+ onEdgeContextMenu: oe,
6559
+ onEdgeMouseEnter: se,
6560
+ onEdgeMouseMove: ce,
6561
+ onEdgeMouseLeave: le,
6562
+ reconnectRadius: ue,
6506
6563
  defaultMarkerColor: P,
6507
- noPanClassName: he,
6508
- disableKeyboardA11y: ge,
6509
- rfId: ve
6564
+ noPanClassName: ge,
6565
+ disableKeyboardA11y: _e,
6566
+ rfId: ye
6510
6567
  }),
6511
- g(Xu, {
6568
+ g(Zu, {
6512
6569
  style: h,
6513
6570
  type: m,
6514
6571
  component: v,
6515
6572
  containerStyle: y
6516
6573
  }),
6517
6574
  g("div", { className: "react-flow__edgelabel-renderer" }),
6518
- g(eu, {
6575
+ g(tu, {
6519
6576
  nodeTypes: e,
6520
6577
  onNodeClick: r,
6521
6578
  onNodeDoubleClick: a,
@@ -6523,23 +6580,23 @@ function td({ nodeTypes: e, edgeTypes: t, onInit: n, onNodeClick: r, onEdgeClick
6523
6580
  onNodeMouseMove: c,
6524
6581
  onNodeMouseLeave: l,
6525
6582
  onNodeContextMenu: u,
6526
- nodeClickDistance: ie,
6583
+ nodeClickDistance: ae,
6527
6584
  onlyRenderVisibleElements: D,
6528
- noPanClassName: he,
6529
- noDragClassName: pe,
6530
- disableKeyboardA11y: ge,
6531
- nodeExtent: _e,
6532
- rfId: ve
6585
+ noPanClassName: ge,
6586
+ noDragClassName: me,
6587
+ disableKeyboardA11y: _e,
6588
+ nodeExtent: ve,
6589
+ rfId: ye
6533
6590
  }),
6534
6591
  g("div", { className: "react-flow__viewport-portal" })
6535
6592
  ] })
6536
6593
  });
6537
6594
  }
6538
- td.displayName = "GraphView";
6539
- var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, width: i, height: a, fitView: o, fitViewOptions: s, minZoom: c = .5, maxZoom: l = 2, nodeOrigin: u, nodeExtent: d, zIndexMode: f = "basic" } = {}) => {
6595
+ nd.displayName = "GraphView";
6596
+ var rd = i(nd), id = Xa("React Flow", "https://reactflow.dev/"), ad = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, width: i, height: a, fitView: o, fitViewOptions: s, minZoom: c = .5, maxZoom: l = 2, nodeOrigin: u, nodeExtent: d, zIndexMode: f = "basic" } = {}) => {
6540
6597
  let p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), _ = r ?? t ?? [], v = n ?? e ?? [], y = u ?? [0, 0], b = d ?? pa;
6541
6598
  cs(h, g, _);
6542
- let x = $o(v, p, m, {
6599
+ let { nodesInitialized: x } = $o(v, p, m, {
6543
6600
  nodeOrigin: y,
6544
6601
  nodeExtent: b,
6545
6602
  zIndexMode: f
@@ -6611,7 +6668,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
6611
6668
  autoPanOnNodeFocus: !0,
6612
6669
  autoPanSpeed: 15,
6613
6670
  connectionRadius: 20,
6614
- onError: Xa,
6671
+ onError: id,
6615
6672
  isValidConnection: void 0,
6616
6673
  onSelectionChangeHandlers: [],
6617
6674
  lib: "react",
@@ -6621,7 +6678,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
6621
6678
  onNodesChangeMiddlewareMap: /* @__PURE__ */ new Map(),
6622
6679
  onEdgesChangeMiddlewareMap: /* @__PURE__ */ new Map()
6623
6680
  };
6624
- }, id = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, width: i, height: a, fitView: o, fitViewOptions: s, minZoom: c, maxZoom: l, nodeOrigin: u, nodeExtent: d, zIndexMode: f }) => uc((p, m) => {
6681
+ }, od = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, width: i, height: a, fitView: o, fitViewOptions: s, minZoom: c, maxZoom: l, nodeOrigin: u, nodeExtent: d, zIndexMode: f }) => lc((p, m) => {
6625
6682
  async function h() {
6626
6683
  let { nodeLookup: e, panZoom: t, fitViewOptions: n, fitViewResolver: r, width: i, height: a, minZoom: o, maxZoom: s } = m();
6627
6684
  t && (await Na({
@@ -6634,7 +6691,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
6634
6691
  }, n), r?.resolve(!0), p({ fitViewResolver: null }));
6635
6692
  }
6636
6693
  return {
6637
- ...rd({
6694
+ ...ad({
6638
6695
  nodes: e,
6639
6696
  edges: t,
6640
6697
  width: i,
@@ -6650,21 +6707,23 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
6650
6707
  zIndexMode: f
6651
6708
  }),
6652
6709
  setNodes: (e) => {
6653
- let { nodeLookup: t, parentLookup: n, nodeOrigin: r, elevateNodesOnSelect: i, fitViewQueued: a, zIndexMode: o } = m(), s = $o(e, t, n, {
6710
+ let { nodeLookup: t, parentLookup: n, nodeOrigin: r, elevateNodesOnSelect: i, fitViewQueued: a, zIndexMode: o, nodesSelectionActive: s } = m(), { nodesInitialized: c, hasSelectedNodes: l } = $o(e, t, n, {
6654
6711
  nodeOrigin: r,
6655
6712
  nodeExtent: d,
6656
6713
  elevateNodesOnSelect: i,
6657
6714
  checkEquality: !0,
6658
6715
  zIndexMode: o
6659
- });
6660
- a && s ? (h(), p({
6716
+ }), u = s && l;
6717
+ a && c ? (h(), p({
6661
6718
  nodes: e,
6662
- nodesInitialized: s,
6719
+ nodesInitialized: c,
6663
6720
  fitViewQueued: !1,
6664
- fitViewOptions: void 0
6721
+ fitViewOptions: void 0,
6722
+ nodesSelectionActive: u
6665
6723
  })) : p({
6666
6724
  nodes: e,
6667
- nodesInitialized: s
6725
+ nodesInitialized: c,
6726
+ nodesSelectionActive: u
6668
6727
  });
6669
6728
  },
6670
6729
  setEdges: (e) => {
@@ -6730,37 +6789,37 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
6730
6789
  },
6731
6790
  triggerNodeChanges: (e) => {
6732
6791
  let { onNodesChange: t, setNodes: n, nodes: r, hasDefaultNodes: i, debug: a } = m();
6733
- e?.length && (i && n(Kc(e, r)), a && console.log("React Flow: trigger node changes", e), t?.(e));
6792
+ e?.length && (i && n(Gc(e, r)), a && console.log("React Flow: trigger node changes", e), t?.(e));
6734
6793
  },
6735
6794
  triggerEdgeChanges: (e) => {
6736
6795
  let { onEdgesChange: t, setEdges: n, edges: r, hasDefaultEdges: i, debug: a } = m();
6737
- e?.length && (i && n(qc(e, r)), a && console.log("React Flow: trigger edge changes", e), t?.(e));
6796
+ e?.length && (i && n(Kc(e, r)), a && console.log("React Flow: trigger edge changes", e), t?.(e));
6738
6797
  },
6739
6798
  addSelectedNodes: (e) => {
6740
6799
  let { multiSelectionActive: t, edgeLookup: n, nodeLookup: r, triggerNodeChanges: i, triggerEdgeChanges: a } = m();
6741
6800
  if (t) {
6742
- i(e.map((e) => Jc(e, !0)));
6801
+ i(e.map((e) => qc(e, !0)));
6743
6802
  return;
6744
6803
  }
6745
- i(Yc(r, new Set([...e]), !0)), a(Yc(n));
6804
+ i(Jc(r, new Set([...e]), !0)), a(Jc(n));
6746
6805
  },
6747
6806
  addSelectedEdges: (e) => {
6748
6807
  let { multiSelectionActive: t, edgeLookup: n, nodeLookup: r, triggerNodeChanges: i, triggerEdgeChanges: a } = m();
6749
6808
  if (t) {
6750
- a(e.map((e) => Jc(e, !0)));
6809
+ a(e.map((e) => qc(e, !0)));
6751
6810
  return;
6752
6811
  }
6753
- a(Yc(n, new Set([...e]))), i(Yc(r, /* @__PURE__ */ new Set(), !0));
6812
+ a(Jc(n, new Set([...e]))), i(Jc(r, /* @__PURE__ */ new Set(), !0));
6754
6813
  },
6755
6814
  unselectNodesAndEdges: ({ nodes: e, edges: t } = {}) => {
6756
6815
  let { edges: n, nodes: r, nodeLookup: i, triggerNodeChanges: a, triggerEdgeChanges: o } = m(), s = e || r, c = t || n, l = [];
6757
6816
  for (let e of s) {
6758
6817
  if (!e.selected) continue;
6759
6818
  let t = i.get(e.id);
6760
- t && (t.selected = !1), l.push(Jc(e.id, !1));
6819
+ t && (t.selected = !1), l.push(qc(e.id, !1));
6761
6820
  }
6762
6821
  let u = [];
6763
- for (let e of c) e.selected && u.push(Jc(e.id, !1));
6822
+ for (let e of c) e.selected && u.push(qc(e.id, !1));
6764
6823
  a(l), o(u);
6765
6824
  },
6766
6825
  setMinZoom: (e) => {
@@ -6777,7 +6836,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
6777
6836
  resetSelectedElements: () => {
6778
6837
  let { edges: e, nodes: t, triggerNodeChanges: n, triggerEdgeChanges: r, elementsSelectable: i } = m();
6779
6838
  if (!i) return;
6780
- let a = t.reduce((e, t) => t.selected ? [...e, Jc(t.id, !1)] : e, []), o = e.reduce((e, t) => t.selected ? [...e, Jc(t.id, !1)] : e, []);
6839
+ let a = t.reduce((e, t) => t.selected ? [...e, qc(t.id, !1)] : e, []), o = e.reduce((e, t) => t.selected ? [...e, qc(t.id, !1)] : e, []);
6781
6840
  n(a), r(o);
6782
6841
  },
6783
6842
  setNodeExtent: (e) => {
@@ -6803,7 +6862,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
6803
6862
  },
6804
6863
  setCenter: async (e, t, n) => {
6805
6864
  let { width: r, height: i, maxZoom: a, panZoom: o } = m();
6806
- if (!o) return Promise.resolve(!1);
6865
+ if (!o) return !1;
6807
6866
  let s = n?.zoom === void 0 ? a : n.zoom;
6808
6867
  return await o.setViewport({
6809
6868
  x: r / 2 - e * s,
@@ -6813,7 +6872,7 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
6813
6872
  duration: n?.duration,
6814
6873
  ease: n?.ease,
6815
6874
  interpolate: n?.interpolate
6816
- }), Promise.resolve(!0);
6875
+ }), !0;
6817
6876
  },
6818
6877
  cancelConnection: () => {
6819
6878
  p({ connection: { ...ya } });
@@ -6821,11 +6880,11 @@ var nd = i(td), rd = ({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, wi
6821
6880
  updateConnection: (e) => {
6822
6881
  p({ connection: e });
6823
6882
  },
6824
- reset: () => p({ ...rd() })
6883
+ reset: () => p({ ...ad() })
6825
6884
  };
6826
6885
  }, Object.is);
6827
- function ad({ initialNodes: e, initialEdges: t, defaultNodes: n, defaultEdges: r, initialWidth: i, initialHeight: a, initialMinZoom: o, initialMaxZoom: s, initialFitViewOptions: c, fitView: l, nodeOrigin: u, nodeExtent: d, zIndexMode: p, children: m }) {
6828
- let [h] = f(() => id({
6886
+ function sd({ initialNodes: e, initialEdges: t, defaultNodes: n, defaultEdges: r, initialWidth: i, initialHeight: a, initialMinZoom: o, initialMaxZoom: s, initialFitViewOptions: c, fitView: l, nodeOrigin: u, nodeExtent: d, zIndexMode: p, children: m }) {
6887
+ let [h] = f(() => od({
6829
6888
  nodes: e,
6830
6889
  edges: t,
6831
6890
  defaultNodes: n,
@@ -6840,13 +6899,13 @@ function ad({ initialNodes: e, initialEdges: t, defaultNodes: n, defaultEdges: r
6840
6899
  nodeExtent: d,
6841
6900
  zIndexMode: p
6842
6901
  }));
6843
- return g(fc, {
6902
+ return g(dc, {
6844
6903
  value: h,
6845
- children: g(al, { children: m })
6904
+ children: g(ol, { children: m })
6846
6905
  });
6847
6906
  }
6848
- function od({ children: e, nodes: t, edges: n, defaultNodes: r, defaultEdges: i, width: a, height: s, fitView: c, fitViewOptions: l, minZoom: u, maxZoom: d, nodeOrigin: f, nodeExtent: p, zIndexMode: m }) {
6849
- return o(dc) ? g(h, { children: e }) : g(ad, {
6907
+ function cd({ children: e, nodes: t, edges: n, defaultNodes: r, defaultEdges: i, width: a, height: s, fitView: c, fitViewOptions: l, minZoom: u, maxZoom: d, nodeOrigin: f, nodeExtent: p, zIndexMode: m }) {
6908
+ return o(uc) ? g(h, { children: e }) : g(sd, {
6850
6909
  initialNodes: t,
6851
6910
  initialEdges: n,
6852
6911
  defaultNodes: r,
@@ -6863,51 +6922,112 @@ function od({ children: e, nodes: t, edges: n, defaultNodes: r, defaultEdges: i,
6863
6922
  children: e
6864
6923
  });
6865
6924
  }
6866
- var sd = {
6925
+ var ld = {
6867
6926
  width: "100%",
6868
6927
  height: "100%",
6869
6928
  overflow: "hidden",
6870
6929
  position: "relative",
6871
6930
  zIndex: 0
6872
6931
  };
6873
- function cd({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i, nodeTypes: o, edgeTypes: s, onNodeClick: c, onEdgeClick: l, onInit: u, onMove: d, onMoveStart: f, onMoveEnd: p, onConnect: m, onConnectStart: h, onConnectEnd: v, onClickConnectStart: y, onClickConnectEnd: b, onNodeMouseEnter: x, onNodeMouseMove: C, onNodeMouseLeave: w, onNodeContextMenu: T, onNodeDoubleClick: E, onNodeDragStart: D, onNodeDrag: O, onNodeDragStop: k, onNodesDelete: A, onEdgesDelete: j, onDelete: M, onSelectionChange: N, onSelectionDragStart: P, onSelectionDrag: F, onSelectionDragStop: I, onSelectionContextMenu: L, onSelectionStart: R, onSelectionEnd: ee, onBeforeDelete: z, connectionMode: B, connectionLineType: V = ba.Bezier, connectionLineStyle: H, connectionLineComponent: U, connectionLineContainerStyle: W, deleteKeyCode: te = "Backspace", selectionKeyCode: ne = "Shift", selectionOnDrag: re = !1, selectionMode: ie = va.Full, panActivationKeyCode: ae = "Space", multiSelectionKeyCode: oe = io() ? "Meta" : "Control", zoomActivationKeyCode: se = io() ? "Meta" : "Control", snapToGrid: ce, snapGrid: le, onlyRenderVisibleElements: ue = !1, selectNodesOnDrag: de, nodesDraggable: fe, autoPanOnNodeFocus: pe, nodesConnectable: me, nodesFocusable: he, nodeOrigin: ge = jc, edgesFocusable: _e, edgesReconnectable: ve, elementsSelectable: ye = !0, defaultViewport: be = Mc, minZoom: xe = .5, maxZoom: Se = 2, translateExtent: Ce = pa, preventScrolling: we = !0, nodeExtent: Te, defaultMarkerColor: Ee = "#b1b1b7", zoomOnScroll: De = !0, zoomOnPinch: Oe = !0, panOnScroll: ke = !1, panOnScrollSpeed: Ae = .5, panOnScrollMode: je = _a.Free, zoomOnDoubleClick: Me = !0, panOnDrag: Ne = !0, onPaneClick: Pe, onPaneMouseEnter: Fe, onPaneMouseMove: Ie, onPaneMouseLeave: Le, onPaneScroll: Re, onPaneContextMenu: ze, paneClickDistance: Be = 1, nodeClickDistance: Ve = 0, children: He, onReconnect: Ue, onReconnectStart: We, onReconnectEnd: Ge, onEdgeContextMenu: Ke, onEdgeDoubleClick: qe, onEdgeMouseEnter: Je, onEdgeMouseMove: Ye, onEdgeMouseLeave: Xe, reconnectRadius: Ze = 10, onNodesChange: Qe, onEdgesChange: $e, noDragClassName: et = "nodrag", noWheelClassName: tt = "nowheel", noPanClassName: nt = "nopan", fitView: rt, fitViewOptions: it, connectOnClick: at, attributionPosition: ot, proOptions: st, defaultEdgeOptions: ct, elevateNodesOnSelect: lt = !0, elevateEdgesOnSelect: ut = !1, disableKeyboardA11y: dt = !1, autoPanOnConnect: ft, autoPanOnNodeDrag: pt, autoPanSpeed: mt, connectionRadius: ht, isValidConnection: gt, onError: _t, style: vt, id: yt, nodeDragThreshold: bt, connectionDragThreshold: xt, viewport: St, onViewportChange: Ct, width: wt, height: Tt, colorMode: Et = "light", debug: Dt, onScroll: Ot, ariaLabelConfig: kt, zIndexMode: At = "basic", ...jt }, Mt) {
6874
- let G = yt || "1", Nt = Rc(Et), Pt = a((e) => {
6932
+ function ud({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i, nodeTypes: o, edgeTypes: s, onNodeClick: c, onEdgeClick: l, onInit: u, onMove: d, onMoveStart: f, onMoveEnd: p, onConnect: m, onConnectStart: h, onConnectEnd: v, onClickConnectStart: y, onClickConnectEnd: b, onNodeMouseEnter: x, onNodeMouseMove: C, onNodeMouseLeave: w, onNodeContextMenu: T, onNodeDoubleClick: E, onNodeDragStart: D, onNodeDrag: O, onNodeDragStop: k, onNodesDelete: A, onEdgesDelete: j, onDelete: M, onSelectionChange: N, onSelectionDragStart: P, onSelectionDrag: F, onSelectionDragStop: I, onSelectionContextMenu: L, onSelectionStart: R, onSelectionEnd: ee, onBeforeDelete: z, connectionMode: B, connectionLineType: V = ba.Bezier, connectionLineStyle: H, connectionLineComponent: U, connectionLineContainerStyle: W, deleteKeyCode: te = "Backspace", selectionKeyCode: ne = "Shift", selectionOnDrag: re = !1, selectionMode: ie = va.Full, panActivationKeyCode: ae = "Space", multiSelectionKeyCode: oe = io() ? "Meta" : "Control", zoomActivationKeyCode: se = io() ? "Meta" : "Control", snapToGrid: ce, snapGrid: le, onlyRenderVisibleElements: ue = !1, selectNodesOnDrag: de, nodesDraggable: fe, autoPanOnNodeFocus: pe, nodesConnectable: me, nodesFocusable: he, nodeOrigin: ge = Ac, edgesFocusable: _e, edgesReconnectable: ve, elementsSelectable: ye = !0, defaultViewport: be = jc, minZoom: xe = .5, maxZoom: Se = 2, translateExtent: Ce = pa, preventScrolling: we = !0, nodeExtent: Te, defaultMarkerColor: Ee = "#b1b1b7", zoomOnScroll: De = !0, zoomOnPinch: Oe = !0, panOnScroll: ke = !1, panOnScrollSpeed: Ae = .5, panOnScrollMode: je = _a.Free, zoomOnDoubleClick: Me = !0, panOnDrag: Ne = !0, onPaneClick: Pe, onPaneMouseEnter: Fe, onPaneMouseMove: Ie, onPaneMouseLeave: Le, onPaneScroll: Re, onPaneContextMenu: ze, paneClickDistance: Be = 1, nodeClickDistance: Ve = 0, children: He, onReconnect: Ue, onReconnectStart: We, onReconnectEnd: Ge, onEdgeContextMenu: Ke, onEdgeDoubleClick: qe, onEdgeMouseEnter: Je, onEdgeMouseMove: Ye, onEdgeMouseLeave: Xe, reconnectRadius: Ze = 10, onNodesChange: Qe, onEdgesChange: $e, noDragClassName: et = "nodrag", noWheelClassName: tt = "nowheel", noPanClassName: nt = "nopan", fitView: rt, fitViewOptions: it, connectOnClick: at, attributionPosition: ot, proOptions: st, defaultEdgeOptions: ct, elevateNodesOnSelect: lt = !0, elevateEdgesOnSelect: ut = !1, disableKeyboardA11y: dt = !1, autoPanOnConnect: ft, autoPanOnNodeDrag: pt, autoPanOnSelection: mt = !0, autoPanSpeed: ht, connectionRadius: gt, isValidConnection: _t, onError: vt, style: yt, id: bt, nodeDragThreshold: xt, connectionDragThreshold: St, viewport: Ct, onViewportChange: wt, width: Tt, height: Et, colorMode: Dt = "light", debug: Ot, onScroll: kt, ariaLabelConfig: At, zIndexMode: jt = "basic", ...Mt }, G) {
6933
+ let Nt = bt || "1", Pt = Lc(Dt), K = a((e) => {
6875
6934
  e.currentTarget.scrollTo({
6876
6935
  top: 0,
6877
6936
  left: 0,
6878
6937
  behavior: "instant"
6879
- }), Ot?.(e);
6880
- }, [Ot]);
6938
+ }), kt?.(e);
6939
+ }, [kt]);
6881
6940
  return g("div", {
6882
6941
  "data-testid": "rf__wrapper",
6883
- ...jt,
6884
- onScroll: Pt,
6942
+ ...Mt,
6943
+ onScroll: K,
6885
6944
  style: {
6886
- ...vt,
6887
- ...sd
6945
+ ...yt,
6946
+ ...ld
6888
6947
  },
6889
- ref: Mt,
6948
+ ref: G,
6890
6949
  className: S([
6891
6950
  "react-flow",
6892
6951
  i,
6893
- Nt
6952
+ Pt
6894
6953
  ]),
6895
- id: yt,
6954
+ id: bt,
6896
6955
  role: "application",
6897
- children: _(od, {
6956
+ children: _(cd, {
6898
6957
  nodes: e,
6899
6958
  edges: t,
6900
- width: wt,
6901
- height: Tt,
6959
+ width: Tt,
6960
+ height: Et,
6902
6961
  fitView: rt,
6903
6962
  fitViewOptions: it,
6904
6963
  minZoom: xe,
6905
6964
  maxZoom: Se,
6906
6965
  nodeOrigin: ge,
6907
6966
  nodeExtent: Te,
6908
- zIndexMode: At,
6967
+ zIndexMode: jt,
6909
6968
  children: [
6910
- g(nd, {
6969
+ g(Fc, {
6970
+ nodes: e,
6971
+ edges: t,
6972
+ defaultNodes: n,
6973
+ defaultEdges: r,
6974
+ onConnect: m,
6975
+ onConnectStart: h,
6976
+ onConnectEnd: v,
6977
+ onClickConnectStart: y,
6978
+ onClickConnectEnd: b,
6979
+ nodesDraggable: fe,
6980
+ autoPanOnNodeFocus: pe,
6981
+ nodesConnectable: me,
6982
+ nodesFocusable: he,
6983
+ edgesFocusable: _e,
6984
+ edgesReconnectable: ve,
6985
+ elementsSelectable: ye,
6986
+ elevateNodesOnSelect: lt,
6987
+ elevateEdgesOnSelect: ut,
6988
+ minZoom: xe,
6989
+ maxZoom: Se,
6990
+ nodeExtent: Te,
6991
+ onNodesChange: Qe,
6992
+ onEdgesChange: $e,
6993
+ snapToGrid: ce,
6994
+ snapGrid: le,
6995
+ connectionMode: B,
6996
+ translateExtent: Ce,
6997
+ connectOnClick: at,
6998
+ defaultEdgeOptions: ct,
6999
+ fitView: rt,
7000
+ fitViewOptions: it,
7001
+ onNodesDelete: A,
7002
+ onEdgesDelete: j,
7003
+ onDelete: M,
7004
+ onNodeDragStart: D,
7005
+ onNodeDrag: O,
7006
+ onNodeDragStop: k,
7007
+ onSelectionDrag: F,
7008
+ onSelectionDragStart: P,
7009
+ onSelectionDragStop: I,
7010
+ onMove: d,
7011
+ onMoveStart: f,
7012
+ onMoveEnd: p,
7013
+ noPanClassName: nt,
7014
+ nodeOrigin: ge,
7015
+ rfId: Nt,
7016
+ autoPanOnConnect: ft,
7017
+ autoPanOnNodeDrag: pt,
7018
+ autoPanSpeed: ht,
7019
+ onError: vt,
7020
+ connectionRadius: gt,
7021
+ isValidConnection: _t,
7022
+ selectNodesOnDrag: de,
7023
+ nodeDragThreshold: xt,
7024
+ connectionDragThreshold: St,
7025
+ onBeforeDelete: z,
7026
+ debug: Ot,
7027
+ ariaLabelConfig: At,
7028
+ zIndexMode: jt
7029
+ }),
7030
+ g(rd, {
6911
7031
  onInit: u,
6912
7032
  onNodeClick: c,
6913
7033
  onEdgeClick: l,
@@ -6942,6 +7062,7 @@ function cd({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i
6942
7062
  panOnScrollSpeed: Ae,
6943
7063
  panOnScrollMode: je,
6944
7064
  panOnDrag: Ne,
7065
+ autoPanOnSelection: mt,
6945
7066
  onPaneClick: Pe,
6946
7067
  onPaneMouseEnter: Fe,
6947
7068
  onPaneMouseMove: Ie,
@@ -6966,90 +7087,29 @@ function cd({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i
6966
7087
  noDragClassName: et,
6967
7088
  noWheelClassName: tt,
6968
7089
  noPanClassName: nt,
6969
- rfId: G,
7090
+ rfId: Nt,
6970
7091
  disableKeyboardA11y: dt,
6971
7092
  nodeExtent: Te,
6972
- viewport: St,
6973
- onViewportChange: Ct
6974
- }),
6975
- g(Ic, {
6976
- nodes: e,
6977
- edges: t,
6978
- defaultNodes: n,
6979
- defaultEdges: r,
6980
- onConnect: m,
6981
- onConnectStart: h,
6982
- onConnectEnd: v,
6983
- onClickConnectStart: y,
6984
- onClickConnectEnd: b,
6985
- nodesDraggable: fe,
6986
- autoPanOnNodeFocus: pe,
6987
- nodesConnectable: me,
6988
- nodesFocusable: he,
6989
- edgesFocusable: _e,
6990
- edgesReconnectable: ve,
6991
- elementsSelectable: ye,
6992
- elevateNodesOnSelect: lt,
6993
- elevateEdgesOnSelect: ut,
6994
- minZoom: xe,
6995
- maxZoom: Se,
6996
- nodeExtent: Te,
6997
- onNodesChange: Qe,
6998
- onEdgesChange: $e,
6999
- snapToGrid: ce,
7000
- snapGrid: le,
7001
- connectionMode: B,
7002
- translateExtent: Ce,
7003
- connectOnClick: at,
7004
- defaultEdgeOptions: ct,
7005
- fitView: rt,
7006
- fitViewOptions: it,
7007
- onNodesDelete: A,
7008
- onEdgesDelete: j,
7009
- onDelete: M,
7010
- onNodeDragStart: D,
7011
- onNodeDrag: O,
7012
- onNodeDragStop: k,
7013
- onSelectionDrag: F,
7014
- onSelectionDragStart: P,
7015
- onSelectionDragStop: I,
7016
- onMove: d,
7017
- onMoveStart: f,
7018
- onMoveEnd: p,
7019
- noPanClassName: nt,
7020
- nodeOrigin: ge,
7021
- rfId: G,
7022
- autoPanOnConnect: ft,
7023
- autoPanOnNodeDrag: pt,
7024
- autoPanSpeed: mt,
7025
- onError: _t,
7026
- connectionRadius: ht,
7027
- isValidConnection: gt,
7028
- selectNodesOnDrag: de,
7029
- nodeDragThreshold: bt,
7030
- connectionDragThreshold: xt,
7031
- onBeforeDelete: z,
7032
- debug: Dt,
7033
- ariaLabelConfig: kt,
7034
- zIndexMode: At
7093
+ viewport: Ct,
7094
+ onViewportChange: wt
7035
7095
  }),
7036
- g(Ac, { onSelectionChange: N }),
7096
+ g(kc, { onSelectionChange: N }),
7037
7097
  He,
7038
- g(wc, {
7098
+ g(Cc, {
7039
7099
  proOptions: st,
7040
7100
  position: ot
7041
7101
  }),
7042
- g(Sc, {
7043
- rfId: G,
7102
+ g(xc, {
7103
+ rfId: Nt,
7044
7104
  disableKeyboardA11y: dt
7045
7105
  })
7046
7106
  ]
7047
7107
  })
7048
7108
  });
7049
7109
  }
7050
- var ld = el(cd);
7110
+ var dd = tl(ud);
7051
7111
  J.error014();
7052
- function ud({ dimensions: e, lineWidth: t, variant: n, className: r }) {
7112
+ function fd({ dimensions: e, lineWidth: t, variant: n, className: r }) {
7053
7113
  return g("path", {
7054
7114
  strokeWidth: t,
7055
7115
  d: `M${e[0] / 2} 0 V${e[1]} M0 ${e[1] / 2} H${e[0]}`,
@@ -7060,7 +7120,7 @@ function ud({ dimensions: e, lineWidth: t, variant: n, className: r }) {
7060
7120
  ])
7061
7121
  });
7062
7122
  }
7063
- function dd({ radius: e, className: t }) {
7123
+ function pd({ radius: e, className: t }) {
7064
7124
  return g("circle", {
7065
7125
  cx: e,
7066
7126
  cy: e,
@@ -7072,25 +7132,25 @@ function dd({ radius: e, className: t }) {
7072
7132
  ])
7073
7133
  });
7074
7134
  }
7075
- var fd;
7135
+ var md;
7076
7136
  (function(e) {
7077
7137
  e.Lines = "lines", e.Dots = "dots", e.Cross = "cross";
7078
- })(fd ||= {});
7079
- var pd = {
7080
- [fd.Dots]: 1,
7081
- [fd.Lines]: 1,
7082
- [fd.Cross]: 6
7083
- }, md = (e) => ({
7138
+ })(md ||= {});
7139
+ var hd = {
7140
+ [md.Dots]: 1,
7141
+ [md.Lines]: 1,
7142
+ [md.Cross]: 6
7143
+ }, gd = (e) => ({
7084
7144
  transform: e.transform,
7085
7145
  patternId: `pattern-${e.rfId}`
7086
7146
  });
7087
- function hd({ id: e, variant: t = fd.Dots, gap: n = 20, size: r, lineWidth: i = 1, offset: a = 0, color: o, bgColor: s, style: c, className: l, patternClassName: u }) {
7088
- let f = d(null), { transform: p, patternId: m } = Z(md, X), h = r || pd[t], v = t === fd.Dots, y = t === fd.Cross, b = Array.isArray(n) ? n : [n, n], x = [b[0] * p[2] || 1, b[1] * p[2] || 1], C = h * p[2], w = Array.isArray(a) ? a : [a, a], T = y ? [C, C] : x, E = [w[0] * p[2] || 1 + T[0] / 2, w[1] * p[2] || 1 + T[1] / 2], D = `${m}${e || ""}`;
7147
+ function _d({ id: e, variant: t = md.Dots, gap: n = 20, size: r, lineWidth: i = 1, offset: a = 0, color: o, bgColor: s, style: c, className: l, patternClassName: u }) {
7148
+ let f = d(null), { transform: p, patternId: m } = Z(gd, X), h = r || hd[t], v = t === md.Dots, y = t === md.Cross, b = Array.isArray(n) ? n : [n, n], x = [b[0] * p[2] || 1, b[1] * p[2] || 1], C = h * p[2], w = Array.isArray(a) ? a : [a, a], T = y ? [C, C] : x, E = [w[0] * p[2] || 1 + T[0] / 2, w[1] * p[2] || 1 + T[1] / 2], D = `${m}${e || ""}`;
7089
7149
  return _("svg", {
7090
7150
  className: S(["react-flow__background", l]),
7091
7151
  style: {
7092
7152
  ...c,
7093
- ...pl,
7153
+ ...ml,
7094
7154
  "--xy-background-color-props": s,
7095
7155
  "--xy-background-pattern-color-props": o
7096
7156
  },
@@ -7104,10 +7164,10 @@ function hd({ id: e, variant: t = fd.Dots, gap: n = 20, size: r, lineWidth: i =
7104
7164
  height: x[1],
7105
7165
  patternUnits: "userSpaceOnUse",
7106
7166
  patternTransform: `translate(-${E[0]},-${E[1]})`,
7107
- children: v ? g(dd, {
7167
+ children: v ? g(pd, {
7108
7168
  radius: C / 2,
7109
7169
  className: u
7110
- }) : g(ud, {
7170
+ }) : g(fd, {
7111
7171
  dimensions: T,
7112
7172
  lineWidth: i,
7113
7173
  variant: t,
@@ -7122,44 +7182,44 @@ function hd({ id: e, variant: t = fd.Dots, gap: n = 20, size: r, lineWidth: i =
7122
7182
  })]
7123
7183
  });
7124
7184
  }
7125
- hd.displayName = "Background";
7126
- var gd = i(hd);
7127
- function _d() {
7185
+ _d.displayName = "Background";
7186
+ var vd = i(_d);
7187
+ function yd() {
7128
7188
  return g("svg", {
7129
7189
  xmlns: "http://www.w3.org/2000/svg",
7130
7190
  viewBox: "0 0 32 32",
7131
7191
  children: g("path", { d: "M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z" })
7132
7192
  });
7133
7193
  }
7134
- function vd() {
7194
+ function bd() {
7135
7195
  return g("svg", {
7136
7196
  xmlns: "http://www.w3.org/2000/svg",
7137
7197
  viewBox: "0 0 32 5",
7138
7198
  children: g("path", { d: "M0 0h32v4.2H0z" })
7139
7199
  });
7140
7200
  }
7141
- function yd() {
7201
+ function xd() {
7142
7202
  return g("svg", {
7143
7203
  xmlns: "http://www.w3.org/2000/svg",
7144
7204
  viewBox: "0 0 32 30",
7145
7205
  children: g("path", { d: "M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z" })
7146
7206
  });
7147
7207
  }
7148
- function bd() {
7208
+ function Sd() {
7149
7209
  return g("svg", {
7150
7210
  xmlns: "http://www.w3.org/2000/svg",
7151
7211
  viewBox: "0 0 25 32",
7152
7212
  children: g("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z" })
7153
7213
  });
7154
7214
  }
7155
- function xd() {
7215
+ function Cd() {
7156
7216
  return g("svg", {
7157
7217
  xmlns: "http://www.w3.org/2000/svg",
7158
7218
  viewBox: "0 0 25 32",
7159
7219
  children: g("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z" })
7160
7220
  });
7161
7221
  }
7162
- function Sd({ children: e, className: t, ...n }) {
7222
+ function wd({ children: e, className: t, ...n }) {
7163
7223
  return g("button", {
7164
7224
  type: "button",
7165
7225
  className: S(["react-flow__controls-button", t]),
@@ -7167,27 +7227,15 @@ function Sd({ children: e, className: t, ...n }) {
7167
7227
  children: e
7168
7228
  });
7169
7229
  }
7170
- var Cd = (e) => ({
7230
+ var Td = (e) => ({
7171
7231
  isInteractive: e.nodesDraggable || e.nodesConnectable || e.elementsSelectable,
7172
7232
  minZoomReached: e.transform[2] <= e.minZoom,
7173
7233
  maxZoomReached: e.transform[2] >= e.maxZoom,
7174
7234
  ariaLabelConfig: e.ariaLabelConfig
7175
7235
  });
7176
- function wd({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive: r = !0, fitViewOptions: i, onZoomIn: a, onZoomOut: o, onFitView: s, onInteractiveChange: c, className: l, children: u, position: d = "bottom-left", orientation: f = "vertical", "aria-label": p }) {
7177
- let m = Q(), { isInteractive: v, minZoomReached: y, maxZoomReached: b, ariaLabelConfig: x } = Z(Cd, X), { zoomIn: C, zoomOut: w, fitView: T } = cl(), E = () => {
7178
- C(), a?.();
7179
- }, D = () => {
7180
- w(), o?.();
7181
- }, O = () => {
7182
- T(i), s?.();
7183
- }, k = () => {
7184
- m.setState({
7185
- nodesDraggable: !v,
7186
- nodesConnectable: !v,
7187
- elementsSelectable: !v
7188
- }), c?.(!v);
7189
- };
7190
- return _(Cc, {
7236
+ function Ed({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive: r = !0, fitViewOptions: i, onZoomIn: a, onZoomOut: o, onFitView: s, onInteractiveChange: c, className: l, children: u, position: d = "bottom-left", orientation: f = "vertical", "aria-label": p }) {
7237
+ let m = Q(), { isInteractive: v, minZoomReached: y, maxZoomReached: b, ariaLabelConfig: x } = Z(Td, X), { zoomIn: C, zoomOut: w, fitView: T } = ll();
7238
+ return _(Sc, {
7191
7239
  className: S([
7192
7240
  "react-flow__controls",
7193
7241
  f === "horizontal" ? "horizontal" : "vertical",
@@ -7198,42 +7246,54 @@ function wd({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
7198
7246
  "data-testid": "rf__controls",
7199
7247
  "aria-label": p ?? x["controls.ariaLabel"],
7200
7248
  children: [
7201
- t && _(h, { children: [g(Sd, {
7202
- onClick: E,
7249
+ t && _(h, { children: [g(wd, {
7250
+ onClick: () => {
7251
+ C(), a?.();
7252
+ },
7203
7253
  className: "react-flow__controls-zoomin",
7204
7254
  title: x["controls.zoomIn.ariaLabel"],
7205
7255
  "aria-label": x["controls.zoomIn.ariaLabel"],
7206
7256
  disabled: b,
7207
- children: g(_d, {})
7208
- }), g(Sd, {
7209
- onClick: D,
7257
+ children: g(yd, {})
7258
+ }), g(wd, {
7259
+ onClick: () => {
7260
+ w(), o?.();
7261
+ },
7210
7262
  className: "react-flow__controls-zoomout",
7211
7263
  title: x["controls.zoomOut.ariaLabel"],
7212
7264
  "aria-label": x["controls.zoomOut.ariaLabel"],
7213
7265
  disabled: y,
7214
- children: g(vd, {})
7266
+ children: g(bd, {})
7215
7267
  })] }),
7216
- n && g(Sd, {
7268
+ n && g(wd, {
7217
7269
  className: "react-flow__controls-fitview",
7218
- onClick: O,
7270
+ onClick: () => {
7271
+ T(i), s?.();
7272
+ },
7219
7273
  title: x["controls.fitView.ariaLabel"],
7220
7274
  "aria-label": x["controls.fitView.ariaLabel"],
7221
- children: g(yd, {})
7275
+ children: g(xd, {})
7222
7276
  }),
7223
- r && g(Sd, {
7277
+ r && g(wd, {
7224
7278
  className: "react-flow__controls-interactive",
7225
- onClick: k,
7279
+ onClick: () => {
7280
+ m.setState({
7281
+ nodesDraggable: !v,
7282
+ nodesConnectable: !v,
7283
+ elementsSelectable: !v
7284
+ }), c?.(!v);
7285
+ },
7226
7286
  title: x["controls.interactive.ariaLabel"],
7227
7287
  "aria-label": x["controls.interactive.ariaLabel"],
7228
- children: g(v ? xd : bd, {})
7288
+ children: g(v ? Cd : Sd, {})
7229
7289
  }),
7230
7290
  u
7231
7291
  ]
7232
7292
  });
7233
7293
  }
7234
- wd.displayName = "Controls";
7235
- var Td = i(wd);
7236
- function Ed({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, strokeColor: s, strokeWidth: c, className: l, borderRadius: u, shapeRendering: d, selected: f, onClick: p }) {
7294
+ Ed.displayName = "Controls";
7295
+ var Dd = i(Ed);
7296
+ function Od({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, strokeColor: s, strokeWidth: c, className: l, borderRadius: u, shapeRendering: d, selected: f, onClick: p }) {
7237
7297
  let { background: m, backgroundColor: h } = a || {}, _ = o || m || h;
7238
7298
  return g("rect", {
7239
7299
  className: S([
@@ -7256,10 +7316,10 @@ function Ed({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, stroke
7256
7316
  onClick: p ? (t) => p(t, e) : void 0
7257
7317
  });
7258
7318
  }
7259
- var Dd = i(Ed), Od = (e) => e.nodes.map((e) => e.id), kd = (e) => e instanceof Function ? e : () => e;
7260
- function Ad({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorderRadius: r = 5, nodeStrokeWidth: i, nodeComponent: a = Dd, onClick: o }) {
7261
- let s = Z(Od, X), c = kd(t), l = kd(e), u = kd(n), d = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
7262
- return g(h, { children: s.map((e) => g(Md, {
7319
+ var kd = i(Od), Ad = (e) => e.nodes.map((e) => e.id), jd = (e) => e instanceof Function ? e : () => e;
7320
+ function Md({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorderRadius: r = 5, nodeStrokeWidth: i, nodeComponent: a = kd, onClick: o }) {
7321
+ let s = Z(Ad, X), c = jd(t), l = jd(e), u = jd(n), d = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
7322
+ return g(h, { children: s.map((e) => g(Pd, {
7263
7323
  id: e,
7264
7324
  nodeColorFunc: c,
7265
7325
  nodeStrokeColorFunc: l,
@@ -7271,7 +7331,7 @@ function Ad({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorde
7271
7331
  shapeRendering: d
7272
7332
  }, e)) });
7273
7333
  }
7274
- function jd({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc: r, nodeBorderRadius: i, nodeStrokeWidth: a, shapeRendering: o, NodeComponent: s, onClick: c }) {
7334
+ function Nd({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc: r, nodeBorderRadius: i, nodeStrokeWidth: a, shapeRendering: o, NodeComponent: s, onClick: c }) {
7275
7335
  let { node: l, x: u, y: d, width: f, height: p } = Z((t) => {
7276
7336
  let n = t.nodeLookup.get(e);
7277
7337
  if (!n) return {
@@ -7307,7 +7367,7 @@ function jd({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc
7307
7367
  id: l.id
7308
7368
  });
7309
7369
  }
7310
- var Md = i(jd), Nd = i(Ad), Pd = 200, Fd = 150, Id = (e) => !e.hidden, Ld = (e) => {
7370
+ var Pd = i(Nd), Fd = i(Md), Id = 200, Ld = 150, Rd = (e) => !e.hidden, zd = (e) => {
7311
7371
  let t = {
7312
7372
  x: -e.transform[0] / e.transform[2],
7313
7373
  y: -e.transform[1] / e.transform[2],
@@ -7316,7 +7376,7 @@ var Md = i(jd), Nd = i(Ad), Pd = 200, Fd = 150, Id = (e) => !e.hidden, Ld = (e)
7316
7376
  };
7317
7377
  return {
7318
7378
  viewBB: t,
7319
- boundingRect: e.nodeLookup.size > 0 ? Ka(ka(e.nodeLookup, { filter: Id }), t) : t,
7379
+ boundingRect: e.nodeLookup.size > 0 ? Ka(ka(e.nodeLookup, { filter: Rd }), t) : t,
7320
7380
  rfId: e.rfId,
7321
7381
  panZoom: e.panZoom,
7322
7382
  translateExtent: e.translateExtent,
@@ -7324,9 +7384,9 @@ var Md = i(jd), Nd = i(Ad), Pd = 200, Fd = 150, Id = (e) => !e.hidden, Ld = (e)
7324
7384
  flowHeight: e.height,
7325
7385
  ariaLabelConfig: e.ariaLabelConfig
7326
7386
  };
7327
- }, Rd = "react-flow__minimap-desc";
7328
- function zd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClassName: i = "", nodeBorderRadius: o = 5, nodeStrokeWidth: s, nodeComponent: l, bgColor: u, maskColor: f, maskStrokeColor: p, maskStrokeWidth: m, position: h = "bottom-right", onClick: v, onNodeClick: y, pannable: b = !1, zoomable: x = !1, ariaLabel: C, inversePan: w, zoomStep: T = 1, offsetScale: E = 5 }) {
7329
- let D = Q(), O = d(null), { boundingRect: k, viewBB: A, rfId: j, panZoom: M, translateExtent: N, flowWidth: P, flowHeight: F, ariaLabelConfig: I } = Z(Ld, X), L = e?.width ?? Pd, R = e?.height ?? Fd, ee = k.width / L, z = k.height / R, B = Math.max(ee, z), V = B * L, H = B * R, U = E * B, W = k.x - (V - k.width) / 2 - U, te = k.y - (H - k.height) / 2 - U, ne = V + U * 2, re = H + U * 2, ie = `${Rd}-${j}`, ae = d(0), oe = d();
7387
+ }, Bd = "react-flow__minimap-desc";
7388
+ function Vd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClassName: i = "", nodeBorderRadius: o = 5, nodeStrokeWidth: s, nodeComponent: l, bgColor: u, maskColor: f, maskStrokeColor: p, maskStrokeWidth: m, position: h = "bottom-right", onClick: v, onNodeClick: y, pannable: b = !1, zoomable: x = !1, ariaLabel: C, inversePan: w, zoomStep: T = 1, offsetScale: E = 5 }) {
7389
+ let D = Q(), O = d(null), { boundingRect: k, viewBB: A, rfId: j, panZoom: M, translateExtent: N, flowWidth: P, flowHeight: F, ariaLabelConfig: I } = Z(zd, X), L = e?.width ?? Id, R = e?.height ?? Ld, ee = k.width / L, z = k.height / R, B = Math.max(ee, z), V = B * L, H = B * R, U = E * B, W = k.x - (V - k.width) / 2 - U, te = k.y - (H - k.height) / 2 - U, ne = V + U * 2, re = H + U * 2, ie = `${Bd}-${j}`, ae = d(0), oe = d();
7330
7390
  ae.current = B, c(() => {
7331
7391
  if (O.current && M) return oe.current = Ts({
7332
7392
  domNode: O.current,
@@ -7365,7 +7425,7 @@ function zd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
7365
7425
  let n = D.getState().nodeLookup.get(t).internals.userNode;
7366
7426
  y(e, n);
7367
7427
  }, []) : void 0, le = C ?? I["minimap.ariaLabel"];
7368
- return g(Cc, {
7428
+ return g(Sc, {
7369
7429
  position: h,
7370
7430
  style: {
7371
7431
  ...e,
@@ -7393,7 +7453,7 @@ function zd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
7393
7453
  id: ie,
7394
7454
  children: le
7395
7455
  }),
7396
- g(Nd, {
7456
+ g(Fd, {
7397
7457
  onClick: ce,
7398
7458
  nodeColor: r,
7399
7459
  nodeStrokeColor: n,
@@ -7413,15 +7473,15 @@ function zd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
7413
7473
  })
7414
7474
  });
7415
7475
  }
7416
- zd.displayName = "MiniMap", i(zd);
7417
- var Bd = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, Vd = {
7476
+ Vd.displayName = "MiniMap", i(Vd);
7477
+ var Hd = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, Ud = {
7418
7478
  [Bs.Line]: "right",
7419
7479
  [Bs.Handle]: "bottom-right"
7420
7480
  };
7421
- function Hd({ nodeId: e, position: t, variant: n = Bs.Handle, className: r, style: i = void 0, children: o, color: s, minWidth: l = 10, minHeight: u = 10, maxWidth: f = Number.MAX_VALUE, maxHeight: p = Number.MAX_VALUE, keepAspectRatio: m = !1, resizeDirection: h, autoScale: _ = !0, shouldResize: v, onResizeStart: y, onResize: b, onResizeEnd: x }) {
7422
- let C = Dl(), w = typeof e == "string" ? e : C, T = Q(), E = d(null), D = n === Bs.Handle, O = Z(a(Bd(D && _), [D, _]), X), k = d(null), A = t ?? Vd[n];
7481
+ function Wd({ nodeId: e, position: t, variant: n = Bs.Handle, className: r, style: i = void 0, children: o, color: s, minWidth: l = 10, minHeight: u = 10, maxWidth: f = Number.MAX_VALUE, maxHeight: p = Number.MAX_VALUE, keepAspectRatio: m = !1, resizeDirection: h, autoScale: _ = !0, shouldResize: v, onResizeStart: y, onResize: b, onResizeEnd: x }) {
7482
+ let C = Ol(), w = typeof e == "string" ? e : C, T = Q(), E = d(null), D = n === Bs.Handle, O = Z(a(Hd(D && _), [D, _]), X), k = d(null), A = t ?? Ud[n];
7423
7483
  return c(() => {
7424
- if (!(!E.current || !w)) return k.current ||= Qs({
7484
+ if (!(!E.current || !w)) return k.current ||= Zs({
7425
7485
  domNode: E.current,
7426
7486
  nodeId: w,
7427
7487
  getStoreItems: () => {
@@ -7545,17 +7605,17 @@ function Hd({ nodeId: e, position: t, variant: n = Bs.Handle, className: r, styl
7545
7605
  children: o
7546
7606
  });
7547
7607
  }
7548
- i(Hd);
7608
+ i(Wd);
7549
7609
  //#endregion
7550
7610
  //#region src/gn/ir/socketColors.ts
7551
- function Ud(e) {
7611
+ function Gd(e) {
7552
7612
  return e <= .0031308 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - .055;
7553
7613
  }
7554
7614
  function $(e, t, n) {
7555
- let r = (e) => Math.round(Math.min(1, Math.max(0, Ud(e))) * 255).toString(16).padStart(2, "0");
7615
+ let r = (e) => Math.round(Math.min(1, Math.max(0, Gd(e))) * 255).toString(16).padStart(2, "0");
7556
7616
  return `#${r(e)}${r(t)}${r(n)}`;
7557
7617
  }
7558
- var Wd = {
7618
+ var Kd = {
7559
7619
  FLOAT: $(.63, .63, .63),
7560
7620
  VECTOR: $(.39, .39, .78),
7561
7621
  RGBA: $(.78, .78, .16),
@@ -7577,12 +7637,12 @@ var Wd = {
7577
7637
  INT_VECTOR: $(.36, .47, .61),
7578
7638
  CUSTOM: $(.2, .2, .2)
7579
7639
  };
7580
- function Gd(e) {
7581
- return Wd[e] ?? Wd.CUSTOM;
7640
+ function qd(e) {
7641
+ return Kd[e] ?? Kd.CUSTOM;
7582
7642
  }
7583
7643
  //#endregion
7584
7644
  //#region src/gn/ir/nodeColors.ts
7585
- var Kd = {
7645
+ var Jd = {
7586
7646
  GEOMETRY: "#1d725e",
7587
7647
  INPUT: "#82354c",
7588
7648
  OUTPUT: "#3e232a",
@@ -7599,10 +7659,10 @@ var Kd = {
7599
7659
  SCRIPT: "#203c3c",
7600
7660
  DEFAULT: "#303030"
7601
7661
  };
7602
- function qd(e) {
7662
+ function Yd(e) {
7603
7663
  return e === "NodeGroupInput" || e === "NodeGroupOutput" ? "INTERFACE" : e.startsWith("NodeGroup") ? "GROUP" : e.startsWith("GeometryNodeSet") || e.startsWith("GeometryNodeTransform") || e.startsWith("GeometryNodeMerge") || e.startsWith("GeometryNodeJoin") || e.startsWith("GeometryNodeDelete") || e.startsWith("GeometryNodeSeparate") || e.startsWith("GeometryNodeDuplicate") || e.startsWith("GeometryNodeExtrude") || e.startsWith("GeometryNodeFlip") || e.startsWith("GeometryNodeSubdivide") || e.startsWith("GeometryNodeTriangulate") || e.startsWith("GeometryNodeMesh") || e.startsWith("GeometryNodeCurve") || e.startsWith("GeometryNodePoints") || e.startsWith("GeometryNodeVolume") || e.startsWith("GeometryNodeInstance") || e.startsWith("GeometryNodeRealize") || e.startsWith("GeometryNodeConvex") || e.startsWith("GeometryNodeFill") || e.startsWith("GeometryNodeSDF") || e.startsWith("GeometryNode") ? "GEOMETRY" : e.startsWith("ShaderNode") ? "SHADER" : e.startsWith("FunctionNode") ? "CONVERTER" : "DEFAULT";
7604
7664
  }
7605
- var Jd = {
7665
+ var Xd = {
7606
7666
  GeometryNodeInputMaterial: "INPUT",
7607
7667
  GeometryNodeInputMaterialIndex: "INPUT",
7608
7668
  GeometryNodeInputRadius: "INPUT",
@@ -7653,12 +7713,12 @@ var Jd = {
7653
7713
  GeometryNodeFieldVariance: "CONVERTER",
7654
7714
  GeometryNodeViewer: "OUTPUT"
7655
7715
  };
7656
- function Yd(e) {
7657
- return Kd[Jd[e] ?? qd(e)] ?? Kd.DEFAULT;
7716
+ function Zd(e) {
7717
+ return Jd[Xd[e] ?? Yd(e)] ?? Jd.DEFAULT;
7658
7718
  }
7659
7719
  //#endregion
7660
7720
  //#region src/gn/importer/blenderTree.ts
7661
- var Xd = {
7721
+ var Qd = {
7662
7722
  NodeSocketGeometry: "GEOMETRY",
7663
7723
  NodeSocketFloat: "FLOAT",
7664
7724
  NodeSocketVector: "VECTOR",
@@ -7675,10 +7735,10 @@ var Xd = {
7675
7735
  NodeSocketMatrix: "MATRIX",
7676
7736
  NodeSocketMenu: "MENU"
7677
7737
  };
7678
- function Zd(e) {
7679
- return Xd[e] ?? "CUSTOM";
7738
+ function $d(e) {
7739
+ return Qd[e] ?? "CUSTOM";
7680
7740
  }
7681
- var Qd = {
7741
+ var ef = {
7682
7742
  HSV: [
7683
7743
  "Hue",
7684
7744
  "Saturation",
@@ -7695,7 +7755,7 @@ var Qd = {
7695
7755
  "Blue"
7696
7756
  ]
7697
7757
  };
7698
- function $d(e) {
7758
+ function tf(e) {
7699
7759
  let t = e.data.mapping?.data;
7700
7760
  if (!t) return;
7701
7761
  let n = t.curves?.data?.items;
@@ -7713,8 +7773,8 @@ function $d(e) {
7713
7773
  points: r
7714
7774
  };
7715
7775
  }
7716
- function ef(e, t) {
7717
- let n = Qd[t ?? "RGB"] ?? Qd.RGB, r = Qd.RGB;
7776
+ function nf(e, t) {
7777
+ let n = ef[t ?? "RGB"] ?? ef.RGB, r = ef.RGB;
7718
7778
  return e.map((e) => {
7719
7779
  let t = r.indexOf(e.name);
7720
7780
  return t === -1 ? e : {
@@ -7723,8 +7783,11 @@ function ef(e, t) {
7723
7783
  };
7724
7784
  });
7725
7785
  }
7726
- function tf(e, t) {
7727
- let n = Zd(e.data.socket_idname ?? ""), r = Gd(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
7786
+ function rf(e) {
7787
+ return e.replace(/\.\d{3}$/, "");
7788
+ }
7789
+ function af(e, t) {
7790
+ let n = $d(e.data.socket_idname ?? ""), r = qd(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
7728
7791
  id: e,
7729
7792
  name: "",
7730
7793
  dataType: n,
@@ -7749,7 +7812,7 @@ function tf(e, t) {
7749
7812
  outputs: [o(a)]
7750
7813
  };
7751
7814
  }
7752
- function nf(e) {
7815
+ function of(e) {
7753
7816
  return e == null ? null : Array.isArray(e) && e.length >= 2 ? {
7754
7817
  kind: "vec",
7755
7818
  values: e
@@ -7758,20 +7821,20 @@ function nf(e) {
7758
7821
  value: e
7759
7822
  } : null;
7760
7823
  }
7761
- function rf(e, t) {
7824
+ function sf(e, t) {
7762
7825
  return {
7763
7826
  id: String(e.id),
7764
7827
  name: e.data.name,
7765
7828
  dataType: e.data.type,
7766
7829
  displayShape: e.data.display_shape,
7767
- color: Gd(e.data.type),
7768
- defaultValue: nf(e.data.default_value),
7830
+ color: qd(e.data.type),
7831
+ defaultValue: of(e.data.default_value),
7769
7832
  hideValue: e.data.hide_value ?? !1,
7770
7833
  enabled: e.data.enabled ?? !0,
7771
7834
  index: t
7772
7835
  };
7773
7836
  }
7774
- function af(e) {
7837
+ function cf(e) {
7775
7838
  if (e.data.bl_idname === "FunctionNodeCompare") {
7776
7839
  let t = {};
7777
7840
  return e.data.data_type && (t.data_type = e.data.data_type), e.data.operation && (t.operation = e.data.operation), Object.keys(t).length > 0 ? t : void 0;
@@ -7781,23 +7844,20 @@ function af(e) {
7781
7844
  return e.data.operation && (t.operation = e.data.operation), e.data.use_clamp && (t.use_clamp = "true"), Object.keys(t).length > 0 ? t : void 0;
7782
7845
  }
7783
7846
  }
7784
- function of(e) {
7785
- if (!e || typeof e != "object") throw Error("JSON root must be an object.");
7786
- if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
7787
- let t = e.node_trees[0];
7788
- if (!t?.data) throw Error("\"node_trees[0].data\" is missing.");
7789
- if (!t.data.nodes?.data?.items) throw Error("\"node_trees[0].data.nodes.data.items\" is missing.");
7790
- if (!t.data.links?.data?.items) throw Error("\"node_trees[0].data.links.data.items\" is missing.");
7847
+ function lf(e, t) {
7848
+ if (!e?.data) throw Error(`"node_trees[${t}].data" is missing.`);
7849
+ if (!e.data.nodes?.data?.items) throw Error(`"node_trees[${t}].data.nodes.data.items" is missing.`);
7850
+ if (!e.data.links?.data?.items) throw Error(`"node_trees[${t}].data.links.data.items" is missing.`);
7791
7851
  return {
7792
- id: String(t.id),
7793
- label: t.data.name,
7794
- nodes: t.data.nodes.data.items.map((e, t) => {
7852
+ id: String(e.id),
7853
+ label: e.data.name,
7854
+ nodes: e.data.nodes.data.items.map((e, t) => {
7795
7855
  if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
7796
7856
  let n = e.data.location_absolute ?? e.data.location ?? [0, 0];
7797
- if (e.data.bl_idname === "NodeReroute") return tf(e, n);
7857
+ if (e.data.bl_idname === "NodeReroute") return af(e, n);
7798
7858
  let r = (e.data.outputs?.data?.items ?? []).map((t, n) => {
7799
7859
  if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
7800
- return rf(t, n);
7860
+ return sf(t, n);
7801
7861
  });
7802
7862
  e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (r[0] &&= {
7803
7863
  ...r[0],
@@ -7808,27 +7868,28 @@ function of(e) {
7808
7868
  });
7809
7869
  let i = (e.data.inputs?.data?.items ?? []).map((t, n) => {
7810
7870
  if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
7811
- return rf(t, n);
7871
+ return sf(t, n);
7812
7872
  });
7813
- (e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = ef(i, e.data.mode));
7814
- let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? $d(e) : void 0, o = af(e);
7873
+ (e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = nf(i, e.data.mode));
7874
+ let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? tf(e) : void 0, o = cf(e);
7815
7875
  return {
7816
7876
  id: String(e.id),
7817
7877
  type: e.data.bl_idname,
7818
- label: e.data.label || e.data.name,
7878
+ label: e.data.label || rf(e.data.name),
7819
7879
  position: {
7820
7880
  x: n[0],
7821
7881
  y: -n[1]
7822
7882
  },
7823
7883
  width: e.data.width ?? 140,
7824
- headerColor: Yd(e.data.bl_idname),
7884
+ headerColor: Zd(e.data.bl_idname),
7825
7885
  inputs: i,
7826
7886
  outputs: r,
7827
7887
  floatCurve: a,
7828
- ...o ? { properties: o } : {}
7888
+ ...o ? { properties: o } : {},
7889
+ ...e.data.node_tree == null ? {} : { groupTreeId: String(e.data.node_tree) }
7829
7890
  };
7830
7891
  }),
7831
- links: t.data.links.data.items.map((e, t) => {
7892
+ links: e.data.links.data.items.map((e, t) => {
7832
7893
  if (!e?.data) throw Error(`Link at index ${t} is missing ".data".`);
7833
7894
  return {
7834
7895
  id: String(e.id),
@@ -7838,21 +7899,45 @@ function of(e) {
7838
7899
  })
7839
7900
  };
7840
7901
  }
7841
- function sf(e, t) {
7902
+ function uf(e) {
7903
+ if (!e || typeof e != "object") throw Error("JSON root must be an object.");
7904
+ if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
7905
+ let t = {};
7906
+ for (let n = 0; n < e.node_trees.length; n++) {
7907
+ let r = lf(e.node_trees[n], n);
7908
+ t[r.id] = r;
7909
+ }
7910
+ let n = /* @__PURE__ */ new Set();
7911
+ for (let e of Object.values(t)) for (let r of e.nodes) {
7912
+ if (r.groupTreeId === void 0) continue;
7913
+ let e = t[r.groupTreeId];
7914
+ if (!e) {
7915
+ delete r.groupTreeId;
7916
+ continue;
7917
+ }
7918
+ r.groupTreeName = e.label, n.add(e.id);
7919
+ }
7920
+ let r = e.node_trees.filter((e) => !n.has(String(e.id))), i = r.find((e) => e.data?.is_modifier) ?? r[0] ?? e.node_trees[0];
7921
+ return {
7922
+ rootId: String(i.id),
7923
+ trees: t
7924
+ };
7925
+ }
7926
+ function df(e, t) {
7842
7927
  return {
7843
7928
  ...t,
7844
7929
  nodeId: e,
7845
7930
  direction: "input"
7846
7931
  };
7847
7932
  }
7848
- function cf(e, t) {
7933
+ function ff(e, t) {
7849
7934
  return {
7850
7935
  ...t,
7851
7936
  nodeId: e,
7852
7937
  direction: "output"
7853
7938
  };
7854
7939
  }
7855
- function lf(e) {
7940
+ function pf(e) {
7856
7941
  let t = e.nodes.map((e) => ({
7857
7942
  id: e.id,
7858
7943
  type: e.type,
@@ -7860,10 +7945,12 @@ function lf(e) {
7860
7945
  position: e.position,
7861
7946
  width: e.width,
7862
7947
  headerColor: e.headerColor,
7863
- inputs: e.inputs.map((t) => sf(e.id, t)),
7864
- outputs: e.outputs.map((t) => cf(e.id, t)),
7948
+ inputs: e.inputs.map((t) => df(e.id, t)),
7949
+ outputs: e.outputs.map((t) => ff(e.id, t)),
7865
7950
  floatCurve: e.floatCurve,
7866
- properties: e.properties
7951
+ properties: e.properties,
7952
+ groupTreeId: e.groupTreeId,
7953
+ groupTreeName: e.groupTreeName
7867
7954
  })), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
7868
7955
  for (let e of t) for (let t of [...e.inputs, ...e.outputs]) n.set(t.id, e.id), r.set(t.id, t);
7869
7956
  let i = e.links.map((e) => ({
@@ -7883,11 +7970,11 @@ function lf(e) {
7883
7970
  }
7884
7971
  //#endregion
7885
7972
  //#region src/gn/xyflow/mapGraphIRToFlow.ts
7886
- function uf(e) {
7973
+ function mf(e) {
7887
7974
  let t = Math.max(e.inputs.length, e.outputs.length);
7888
7975
  return Math.max(60, 32 + t * 18 + 16);
7889
7976
  }
7890
- function df(e, t) {
7977
+ function hf(e, t) {
7891
7978
  if (e.type === "NodeReroute") {
7892
7979
  let t = e.outputs[0]?.color ?? e.inputs[0]?.color ?? "#888888";
7893
7980
  return {
@@ -7921,11 +8008,13 @@ function df(e, t) {
7921
8008
  outputs: e.outputs,
7922
8009
  connectedInputIds: e.inputs.filter((e) => t.has(e.id)).map((e) => e.id),
7923
8010
  floatCurve: e.floatCurve,
7924
- properties: e.properties
8011
+ properties: e.properties,
8012
+ groupTreeId: e.groupTreeId,
8013
+ groupTreeName: e.groupTreeName
7925
8014
  }
7926
8015
  };
7927
8016
  }
7928
- function ff(e, t, n) {
8017
+ function gf(e, t, n) {
7929
8018
  let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
7930
8019
  for (let e of n.nodes) r.set(e.id, []), i.set(e.id, []);
7931
8020
  for (let e of n.edges) r.has(e.sourceNodeId) || r.set(e.sourceNodeId, []), i.has(e.targetNodeId) || i.set(e.targetNodeId, []), r.get(e.sourceNodeId).push(e.targetNodeId), i.get(e.targetNodeId).push(e.sourceNodeId);
@@ -7949,16 +8038,16 @@ function ff(e, t, n) {
7949
8038
  for (let e of a) s.has(e) && l.add(e);
7950
8039
  return l;
7951
8040
  }
7952
- function pf(e) {
7953
- let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) => df(e, t)), r = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), a = n;
8041
+ function _f(e) {
8042
+ let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) => hf(e, t)), r = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), a = n;
7954
8043
  if (r && i) {
7955
- let t = ff(r.id, i.id, e);
8044
+ let t = gf(r.id, i.id, e);
7956
8045
  if (t.size > 0) {
7957
8046
  let i = new Map(e.nodes.map((e) => [e.id, e])), o = Infinity, s = Infinity, c = -Infinity, l = -Infinity;
7958
8047
  for (let e of t) {
7959
8048
  let t = i.get(e);
7960
8049
  if (!t) continue;
7961
- let n = t.width, r = uf(t);
8050
+ let n = t.width, r = mf(t);
7962
8051
  o = Math.min(o, t.position.x), s = Math.min(s, t.position.y), c = Math.max(c, t.position.x + n), l = Math.max(l, t.position.y + r);
7963
8052
  }
7964
8053
  if (Number.isFinite(o) && Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(l)) {
@@ -8006,10 +8095,10 @@ function pf(e) {
8006
8095
  }
8007
8096
  //#endregion
8008
8097
  //#region src/gn/ir/curvePath.ts
8009
- function mf(e, t) {
8098
+ function vf(e, t) {
8010
8099
  return Math.sqrt(e * e + t * t);
8011
8100
  }
8012
- function hf(e) {
8101
+ function yf(e) {
8013
8102
  let t = e.length, n = e.map(({ location: [n, r], handleType: i }, a) => {
8014
8103
  let o = a > 0 ? e[a - 1].location : null, s = a < t - 1 ? e[a + 1].location : null;
8015
8104
  if (i === "VECTOR") return {
@@ -8019,11 +8108,11 @@ function hf(e) {
8019
8108
  let c = 0, l = 0, u = 0, d = 0;
8020
8109
  if (o && s) {
8021
8110
  let e = n - o[0], t = r - o[1], i = s[0] - n, a = s[1] - r;
8022
- if (u = mf(e, t), d = mf(i, a), u > 1e-8 && d > 1e-8) {
8023
- let n = e / u + i / d, r = t / u + a / d, o = mf(n, r);
8111
+ if (u = vf(e, t), d = vf(i, a), u > 1e-8 && d > 1e-8) {
8112
+ let n = e / u + i / d, r = t / u + a / d, o = vf(n, r);
8024
8113
  o > 1e-8 && (c = n / o, l = r / o);
8025
8114
  } else d > 1e-8 ? (c = (s[0] - n) / d, l = (s[1] - r) / d) : u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u);
8026
- } else s ? (d = mf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = mf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
8115
+ } else s ? (d = vf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = vf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
8027
8116
  let f = [n - c * u / 3, r - l * u / 3], p = [n + c * d / 3, r + l * d / 3];
8028
8117
  if (i === "AUTO_CLAMPED") {
8029
8118
  if (o) {
@@ -8068,7 +8157,7 @@ function hf(e) {
8068
8157
  }
8069
8158
  return n;
8070
8159
  }
8071
- function gf(e, t, n, r, i, a, o) {
8160
+ function bf(e, t, n, r, i, a, o) {
8072
8161
  let s = r - t || 1, c = i - n || 1, l = (e) => (e - t) / s * a, u = (e) => (1 - (e - n) / c) * o;
8073
8162
  if (e.length < 2) return {
8074
8163
  strokePath: "",
@@ -8076,7 +8165,7 @@ function gf(e, t, n, r, i, a, o) {
8076
8165
  zeroLinePath: "",
8077
8166
  dotPositions: []
8078
8167
  };
8079
- let d = hf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
8168
+ let d = yf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
8080
8169
  for (let t = 0; t < e.length - 1; t++) {
8081
8170
  let n = d[t].right, r = d[t + 1].left, [i, a] = e[t + 1].location;
8082
8171
  m += ` C ${l(n[0]).toFixed(2)} ${u(n[1]).toFixed(2)},`, m += ` ${l(r[0]).toFixed(2)} ${u(r[1]).toFixed(2)},`, m += ` ${l(i).toFixed(2)} ${u(a).toFixed(2)}`;
@@ -8090,13 +8179,19 @@ function gf(e, t, n, r, i, a, o) {
8090
8179
  };
8091
8180
  }
8092
8181
  //#endregion
8182
+ //#region src/gn/components/groupNavContext.ts
8183
+ var xf = t(null);
8184
+ function Sf() {
8185
+ return o(xf);
8186
+ }
8187
+ //#endregion
8093
8188
  //#region src/gn/components/GenericGNNode.tsx
8094
- var _f = [
8189
+ var Cf = [
8095
8190
  "X",
8096
8191
  "Y",
8097
8192
  "Z",
8098
8193
  "W"
8099
- ], vf = {
8194
+ ], wf = {
8100
8195
  FLOAT: "Float",
8101
8196
  INT: "Integer",
8102
8197
  VECTOR: "Vector",
@@ -8104,7 +8199,7 @@ var _f = [
8104
8199
  STRING: "String",
8105
8200
  BOOLEAN: "Boolean",
8106
8201
  ROTATION: "Rotation"
8107
- }, yf = {
8202
+ }, Tf = {
8108
8203
  EQUAL: "Equal",
8109
8204
  NOT_EQUAL: "Not Equal",
8110
8205
  LESS_THAN: "Less Than",
@@ -8150,10 +8245,10 @@ var _f = [
8150
8245
  RADIANS: "To Radians",
8151
8246
  DEGREES: "To Degrees"
8152
8247
  };
8153
- function bf(e, t) {
8154
- return e === "data_type" ? vf[t] ?? t : e === "operation" ? yf[t] ?? t : e === "use_clamp" ? "Clamp" : t;
8248
+ function Ef(e, t) {
8249
+ return e === "data_type" ? wf[t] ?? t : e === "operation" ? Tf[t] ?? t : e === "use_clamp" ? "Clamp" : t;
8155
8250
  }
8156
- function xf(e) {
8251
+ function Df(e) {
8157
8252
  switch (e) {
8158
8253
  case "LINE": return "gn-socket--line";
8159
8254
  case "DIAMOND": return "gn-socket--diamond";
@@ -8162,55 +8257,55 @@ function xf(e) {
8162
8257
  default: return "gn-socket--circle";
8163
8258
  }
8164
8259
  }
8165
- function Sf(e) {
8260
+ function Of(e) {
8166
8261
  return e === "ROTATION" ? "°" : e === "FLOAT" ? " m" : "";
8167
8262
  }
8168
- function Cf(e) {
8263
+ function kf(e) {
8169
8264
  return parseFloat(e.toFixed(3)).toString();
8170
8265
  }
8171
- function wf(e, t) {
8172
- return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${Cf(e)}${Sf(t)}`;
8266
+ function Af(e, t) {
8267
+ return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${kf(e)}${Of(t)}`;
8173
8268
  }
8174
- function Tf(e) {
8269
+ function jf(e) {
8175
8270
  return Math.round(Math.min(1, Math.max(0, e)) * 255);
8176
8271
  }
8177
- function Ef(e) {
8272
+ function Mf(e) {
8178
8273
  let [t, n, r, i = 1] = e.values;
8179
8274
  return /* @__PURE__ */ g("div", {
8180
8275
  className: "gn-node__color-swatch",
8181
- style: { background: `rgba(${Tf(t)},${Tf(n)},${Tf(r)},${i.toFixed(2)})` }
8276
+ style: { background: `rgba(${jf(t)},${jf(n)},${jf(r)},${i.toFixed(2)})` }
8182
8277
  });
8183
8278
  }
8184
- function Df(e) {
8185
- if (e.dataType === "RGBA") return /* @__PURE__ */ g(Ef, { values: e.values });
8186
- let t = Sf(e.dataType);
8279
+ function Nf(e) {
8280
+ if (e.dataType === "RGBA") return /* @__PURE__ */ g(Mf, { values: e.values });
8281
+ let t = Of(e.dataType);
8187
8282
  return /* @__PURE__ */ g("div", {
8188
8283
  className: "gn-node__vec-block",
8189
8284
  children: e.values.slice(0, 4).map((e, n) => /* @__PURE__ */ _("div", {
8190
8285
  className: "gn-node__vec-row",
8191
8286
  children: [/* @__PURE__ */ g("span", {
8192
8287
  className: "gn-node__vec-label",
8193
- children: _f[n]
8288
+ children: Cf[n]
8194
8289
  }), /* @__PURE__ */ _("span", {
8195
8290
  className: "gn-node__vec-value",
8196
- children: [Cf(e), t]
8291
+ children: [kf(e), t]
8197
8292
  })]
8198
8293
  }, n))
8199
8294
  });
8200
8295
  }
8201
- function Of({ properties: e }) {
8296
+ function Pf({ properties: e }) {
8202
8297
  let t = Object.entries(e);
8203
8298
  return t.length === 0 ? null : /* @__PURE__ */ g("div", {
8204
8299
  className: "gn-node__props",
8205
8300
  children: t.map(([e, t]) => /* @__PURE__ */ g("div", {
8206
8301
  className: "gn-node__prop-row",
8207
- children: bf(e, t)
8302
+ children: Ef(e, t)
8208
8303
  }, e))
8209
8304
  });
8210
8305
  }
8211
- var kf = 120, Af = 6;
8212
- function jf({ curve: e, width: t }) {
8213
- let n = Math.max(10, t - Af * 2), r = kf, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = gf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
8306
+ var Ff = 120, If = 6;
8307
+ function Lf({ curve: e, width: t }) {
8308
+ let n = Math.max(10, t - If * 2), r = Ff, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = bf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
8214
8309
  return /* @__PURE__ */ g("div", {
8215
8310
  className: "gn-node__curve-wrap",
8216
8311
  children: /* @__PURE__ */ _("svg", {
@@ -8241,16 +8336,16 @@ function jf({ curve: e, width: t }) {
8241
8336
  })
8242
8337
  });
8243
8338
  }
8244
- function Mf(e) {
8339
+ function Rf(e) {
8245
8340
  let { socket: t, position: n, type: r, align: i, suppressDefault: a } = e, o = t.name.trim().length === 0, s = !a && !t.hideValue && t.defaultValue?.kind === "scalar";
8246
8341
  return /* @__PURE__ */ _("div", {
8247
8342
  className: `gn-node__socket-row gn-node__socket-row--${i}`,
8248
8343
  children: [
8249
- /* @__PURE__ */ g(jl, {
8344
+ /* @__PURE__ */ g(Ml, {
8250
8345
  id: t.id,
8251
8346
  type: r,
8252
8347
  position: n,
8253
- className: `gn-socket ${xf(t.displayShape)}`,
8348
+ className: `gn-socket ${Df(t.displayShape)}`,
8254
8349
  style: {
8255
8350
  top: "50%",
8256
8351
  background: t.color,
@@ -8263,18 +8358,32 @@ function Mf(e) {
8263
8358
  }),
8264
8359
  s && t.defaultValue?.kind === "scalar" ? /* @__PURE__ */ g("span", {
8265
8360
  className: "gn-node__value",
8266
- children: wf(t.defaultValue.value, t.dataType)
8361
+ children: Af(t.defaultValue.value, t.dataType)
8267
8362
  }) : null
8268
8363
  ]
8269
8364
  });
8270
8365
  }
8271
- function Nf(e, t) {
8366
+ function zf(e, t) {
8272
8367
  return !t && !e.hideValue && e.defaultValue?.kind === "vec";
8273
8368
  }
8274
- function Pf(e) {
8275
- let t = e.data, n = new Set(t.connectedInputIds ?? []), r = t.outputs.filter((e) => e.enabled), i = t.inputs.filter((e) => e.enabled);
8369
+ function Bf() {
8370
+ return /* @__PURE__ */ _("div", {
8371
+ className: "gn-node__stack",
8372
+ "aria-hidden": "true",
8373
+ children: [
8374
+ /* @__PURE__ */ g("div", { className: "gn-node__stack-bar" }),
8375
+ /* @__PURE__ */ g("div", { className: "gn-node__stack-bar" }),
8376
+ /* @__PURE__ */ g("div", { className: "gn-node__stack-bar" })
8377
+ ]
8378
+ });
8379
+ }
8380
+ function Vf(e) {
8381
+ let t = e.data, n = Sf(), r = new Set(t.connectedInputIds ?? []), i = t.outputs.filter((e) => e.enabled), a = t.inputs.filter((e) => e.enabled), o = t.groupTreeId, s = o !== void 0 && t.groupTreeName !== void 0 && !!n;
8276
8382
  return /* @__PURE__ */ _("div", {
8277
- className: "gn-node",
8383
+ className: `gn-node${s ? " gn-node--group nodrag" : ""}`,
8384
+ onClick: s ? () => n.openGroup(o) : void 0,
8385
+ role: s ? "button" : void 0,
8386
+ title: s ? `Open group "${t.groupTreeName}"` : void 0,
8278
8387
  children: [
8279
8388
  /* @__PURE__ */ g("div", {
8280
8389
  className: "gn-node__header",
@@ -8284,28 +8393,29 @@ function Pf(e) {
8284
8393
  children: t.label
8285
8394
  })
8286
8395
  }),
8287
- t.properties && /* @__PURE__ */ g(Of, { properties: t.properties }),
8288
- t.floatCurve && /* @__PURE__ */ g(jf, {
8396
+ s && /* @__PURE__ */ g(Bf, {}),
8397
+ t.properties && /* @__PURE__ */ g(Pf, { properties: t.properties }),
8398
+ t.floatCurve && /* @__PURE__ */ g(Lf, {
8289
8399
  curve: t.floatCurve,
8290
8400
  width: t.width
8291
8401
  }),
8292
8402
  /* @__PURE__ */ _("div", {
8293
8403
  className: "gn-node__body",
8294
- children: [r.map((e) => /* @__PURE__ */ g(Mf, {
8404
+ children: [i.map((e) => /* @__PURE__ */ g(Rf, {
8295
8405
  socket: e,
8296
8406
  position: Y.Right,
8297
8407
  type: "source",
8298
8408
  align: "right",
8299
8409
  suppressDefault: !0
8300
- }, e.id)), i.map((e) => {
8301
- let t = n.has(e.id);
8302
- return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(Mf, {
8410
+ }, e.id)), a.map((e) => {
8411
+ let t = r.has(e.id);
8412
+ return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(Rf, {
8303
8413
  socket: e,
8304
8414
  position: Y.Left,
8305
8415
  type: "target",
8306
8416
  align: "left",
8307
8417
  suppressDefault: t
8308
- }), Nf(e, t) ? /* @__PURE__ */ g(Df, {
8418
+ }), zf(e, t) ? /* @__PURE__ */ g(Nf, {
8309
8419
  values: e.defaultValue.values,
8310
8420
  dataType: e.dataType
8311
8421
  }) : null] }, e.id);
@@ -8316,17 +8426,17 @@ function Pf(e) {
8316
8426
  }
8317
8427
  //#endregion
8318
8428
  //#region src/gn/components/RerouteNode.tsx
8319
- function Ff(e) {
8429
+ function Hf(e) {
8320
8430
  let t = e.data;
8321
8431
  return /* @__PURE__ */ _("div", {
8322
8432
  className: "gn-reroute",
8323
8433
  style: { "--gn-reroute-color": t.color },
8324
- children: [/* @__PURE__ */ g(jl, {
8434
+ children: [/* @__PURE__ */ g(Ml, {
8325
8435
  id: t.inputSocketId,
8326
8436
  type: "target",
8327
8437
  position: Y.Left,
8328
8438
  className: "gn-reroute__handle"
8329
- }), /* @__PURE__ */ g(jl, {
8439
+ }), /* @__PURE__ */ g(Ml, {
8330
8440
  id: t.outputSocketId,
8331
8441
  type: "source",
8332
8442
  position: Y.Right,
@@ -8336,7 +8446,7 @@ function Ff(e) {
8336
8446
  }
8337
8447
  //#endregion
8338
8448
  //#region src/gn/components/SimulationZoneFrame.tsx
8339
- function If(e) {
8449
+ function Uf(e) {
8340
8450
  let t = e.data;
8341
8451
  return /* @__PURE__ */ g("div", {
8342
8452
  className: "gn-sim-zone",
@@ -8363,21 +8473,21 @@ function If(e) {
8363
8473
  }
8364
8474
  //#endregion
8365
8475
  //#region src/gn/components/GeometryNodesFlow.tsx
8366
- var Lf = {
8367
- gnNode: Pf,
8368
- rerouteNode: Ff,
8369
- simulationZone: If
8370
- }, Rf = { padding: .08 };
8371
- function zf(e) {
8372
- let { nodes: t, edges: n } = e, { fitView: r } = cl();
8476
+ var Wf = {
8477
+ gnNode: Vf,
8478
+ rerouteNode: Hf,
8479
+ simulationZone: Uf
8480
+ }, Gf = { padding: .08 };
8481
+ function Kf(e) {
8482
+ let { nodes: t, edges: n, breadcrumbs: r, onNavigate: i } = e, { fitView: a } = ll();
8373
8483
  return c(() => {
8374
- r(Rf);
8375
- }, [t, r]), /* @__PURE__ */ _(ld, {
8484
+ a(Gf);
8485
+ }, [t, a]), /* @__PURE__ */ _(dd, {
8376
8486
  nodes: t,
8377
8487
  edges: n,
8378
- nodeTypes: Lf,
8488
+ nodeTypes: Wf,
8379
8489
  fitView: !0,
8380
- fitViewOptions: Rf,
8490
+ fitViewOptions: Gf,
8381
8491
  minZoom: .2,
8382
8492
  nodesDraggable: !1,
8383
8493
  nodesConnectable: !1,
@@ -8392,12 +8502,39 @@ function zf(e) {
8392
8502
  zoomOnScroll: !0,
8393
8503
  zoomOnDoubleClick: !1,
8394
8504
  children: [
8395
- /* @__PURE__ */ g(gd, {
8505
+ /* @__PURE__ */ g(vd, {
8396
8506
  gap: 20,
8397
8507
  size: 1
8398
8508
  }),
8399
- /* @__PURE__ */ g(Td, { showInteractive: !1 }),
8400
- /* @__PURE__ */ g(Cc, {
8509
+ /* @__PURE__ */ g(Dd, { showInteractive: !1 }),
8510
+ r.length > 1 ? /* @__PURE__ */ g(Sc, {
8511
+ position: "top-left",
8512
+ children: /* @__PURE__ */ g("nav", {
8513
+ className: "gn-breadcrumbs",
8514
+ "aria-label": "Node group path",
8515
+ children: r.map((e, t) => {
8516
+ let n = t === r.length - 1;
8517
+ return /* @__PURE__ */ _("span", {
8518
+ className: "gn-breadcrumbs__item",
8519
+ children: [t > 0 ? /* @__PURE__ */ g("span", {
8520
+ className: "gn-breadcrumbs__sep",
8521
+ "aria-hidden": "true",
8522
+ children: "›"
8523
+ }) : null, n ? /* @__PURE__ */ g("span", {
8524
+ className: "gn-breadcrumbs__current",
8525
+ "aria-current": "page",
8526
+ children: e.label
8527
+ }) : /* @__PURE__ */ g("button", {
8528
+ type: "button",
8529
+ className: "gn-breadcrumbs__link",
8530
+ onClick: () => i(t),
8531
+ children: e.label
8532
+ })]
8533
+ }, `${e.id}-${t}`);
8534
+ })
8535
+ })
8536
+ }) : null,
8537
+ /* @__PURE__ */ g(Sc, {
8401
8538
  position: "bottom-right",
8402
8539
  children: /* @__PURE__ */ g("a", {
8403
8540
  href: "https://extensions.blender.org/add-ons/tree-clipper/",
@@ -8410,24 +8547,64 @@ function zf(e) {
8410
8547
  ]
8411
8548
  });
8412
8549
  }
8413
- function Bf(e) {
8414
- let { jsonText: t, showHeader: n = !0 } = e, r = u(() => {
8550
+ function qf(e) {
8551
+ let { jsonText: t, showHeader: n = !0 } = e, [r, i] = f({
8552
+ json: t,
8553
+ ids: []
8554
+ }), o = u(() => {
8415
8555
  if (!t.trim()) return null;
8416
8556
  try {
8417
- let e = lf(of(JSON.parse(t)));
8557
+ let { rootId: e, trees: n } = uf(JSON.parse(t)), r = {};
8558
+ for (let e of Object.values(n)) {
8559
+ let t = pf(e);
8560
+ r[t.id] = {
8561
+ graph: t,
8562
+ flow: _f(t)
8563
+ };
8564
+ }
8418
8565
  return {
8419
- graph: e,
8420
- flow: pf(e),
8566
+ rootId: e,
8567
+ views: r,
8421
8568
  error: null
8422
8569
  };
8423
8570
  } catch (e) {
8424
8571
  return {
8425
- graph: null,
8426
- flow: null,
8572
+ rootId: "",
8573
+ views: null,
8427
8574
  error: e instanceof Error ? e.message : String(e)
8428
8575
  };
8429
8576
  }
8430
- }, [t]);
8577
+ }, [t]), s = u(() => {
8578
+ if (!o?.views) return [];
8579
+ let e = r.json === t ? r.ids : [], n = [o.rootId];
8580
+ for (let t of e) o.views[t] && n.push(t);
8581
+ return n;
8582
+ }, [
8583
+ o,
8584
+ r,
8585
+ t
8586
+ ]), l = o?.views ? o.views[s[s.length - 1]] : null, d = a((e) => {
8587
+ i((n) => ({
8588
+ json: t,
8589
+ ids: n.json === t ? [...n.ids, e] : [e]
8590
+ }));
8591
+ }, [t]), p = u(() => ({ openGroup: d }), [d]);
8592
+ c(() => {
8593
+ if (s.length <= 1) return;
8594
+ function e(e) {
8595
+ if (e.key !== "Tab" && e.key !== "Escape" || e.ctrlKey || e.metaKey || e.altKey) return;
8596
+ let n = e.target;
8597
+ n && (n.isContentEditable || n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.closest(".cm-editor")) || (e.preventDefault(), i({
8598
+ json: t,
8599
+ ids: s.slice(1, -1)
8600
+ }));
8601
+ }
8602
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
8603
+ }, [s, t]);
8604
+ let m = o?.views ? s.map((e) => ({
8605
+ id: e,
8606
+ label: o.views[e].graph.label
8607
+ })) : [];
8431
8608
  return /* @__PURE__ */ _("div", {
8432
8609
  className: "panel flow-panel",
8433
8610
  children: [n ? /* @__PURE__ */ _("div", {
@@ -8438,18 +8615,26 @@ function Bf(e) {
8438
8615
  }), /* @__PURE__ */ g("div", {
8439
8616
  className: "panel-status",
8440
8617
  "aria-live": "polite",
8441
- children: r?.graph ? `${r.graph.nodes.length} nodes, ${r.graph.edges.length} links` : null
8618
+ children: l ? `${l.graph.nodes.length} nodes, ${l.graph.edges.length} links` : null
8442
8619
  })]
8443
8620
  }) : null, /* @__PURE__ */ g("div", {
8444
8621
  className: "panel-body flow-panel__body",
8445
- children: r?.error ? /* @__PURE__ */ _("div", {
8622
+ children: o?.error ? /* @__PURE__ */ _("div", {
8446
8623
  className: "flow-error",
8447
8624
  role: "alert",
8448
- children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: r.error })]
8449
- }) : r?.flow ? /* @__PURE__ */ g(ad, { children: /* @__PURE__ */ g(zf, {
8450
- nodes: r.flow.nodes,
8451
- edges: r.flow.edges
8452
- }) }) : /* @__PURE__ */ g("div", {
8625
+ children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: o.error })]
8626
+ }) : l ? /* @__PURE__ */ g(xf.Provider, {
8627
+ value: p,
8628
+ children: /* @__PURE__ */ g(sd, { children: /* @__PURE__ */ g(Kf, {
8629
+ nodes: l.flow.nodes,
8630
+ edges: l.flow.edges,
8631
+ breadcrumbs: m,
8632
+ onNavigate: (e) => i({
8633
+ json: t,
8634
+ ids: s.slice(1, e + 1)
8635
+ })
8636
+ }) })
8637
+ }) : /* @__PURE__ */ g("div", {
8453
8638
  className: "flow-empty",
8454
8639
  children: "Waiting for sample graph..."
8455
8640
  })
@@ -8458,7 +8643,7 @@ function Bf(e) {
8458
8643
  }
8459
8644
  //#endregion
8460
8645
  //#region src/embed.tsx
8461
- function Vf(e) {
8646
+ function Jf(e) {
8462
8647
  let { payload: t } = e, [n, r] = f(""), [i, a] = f(null), [o, s] = f(!0);
8463
8648
  return c(() => {
8464
8649
  let e = !1;
@@ -8480,26 +8665,26 @@ function Vf(e) {
8480
8665
  className: "flow-error",
8481
8666
  role: "alert",
8482
8667
  children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: i })]
8483
- }) : /* @__PURE__ */ g(Bf, {
8668
+ }) : /* @__PURE__ */ g(qf, {
8484
8669
  jsonText: n,
8485
8670
  showHeader: !1
8486
8671
  })
8487
8672
  })
8488
8673
  });
8489
8674
  }
8490
- var Hf = null;
8491
- function Uf(e, t) {
8492
- Hf &&= (Hf.unmount(), null), Hf = m(e);
8675
+ var Yf = null;
8676
+ function Xf(e, t) {
8677
+ Yf &&= (Yf.unmount(), null), Yf = m(e);
8493
8678
  let r = t.onClose;
8494
- return Hf.render(n(Vf, {
8679
+ return Yf.render(n(Jf, {
8495
8680
  ...t,
8496
8681
  onClose: r ? () => {
8497
- Wf(), r();
8682
+ Zf(), r();
8498
8683
  } : void 0
8499
- })), Wf;
8684
+ })), Zf;
8500
8685
  }
8501
- function Wf() {
8502
- Hf &&= (Hf.unmount(), null);
8686
+ function Zf() {
8687
+ Yf &&= (Yf.unmount(), null);
8503
8688
  }
8504
8689
  //#endregion
8505
- export { Vf as GraphView, Uf as mountGraphView, Wf as unmountGraphView };
8690
+ export { Jf as GraphView, Xf as mountGraphView, Zf as unmountGraphView };