@graph-render/react 1.0.1 → 1.0.2

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/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { LayoutType as Me, EdgeType as vr, LayoutDirection as tr } from "@graph-render/types";
2
- import { EdgeType as ei, LayoutDirection as ri, LayoutType as ni, NodeSide as ii } from "@graph-render/types";
3
- import re, { useState as Et, useMemo as k, useCallback as K, useRef as pt, useEffect as te, useLayoutEffect as an, useId as cn, useImperativeHandle as un } from "react";
4
- import { groupEdgesByTarget as ln, sortEdgesBySourcePosition as fn, fromTypedNxGraph as dn, layoutNodes as er, routeEdges as xr, buildEdgePath as hn, normalizeGraphConfig as pn, DEFAULT_THEME as wr } from "@graph-render/core";
5
- import { buildEdgePath as si, fromNxGraph as ai, layoutNodes as ci, renderGraphToSvg as ui, routeEdges as li } from "@graph-render/core";
6
- var rr = { exports: {} }, fe = {};
1
+ import { LayoutType as Me, EdgeType as fr, LayoutDirection as qe } from "@graph-render/types";
2
+ import { EdgeType as Vn, LayoutDirection as qn, LayoutType as Jn, NodeSide as Zn } from "@graph-render/types";
3
+ import oe, { useState as _t, useMemo as M, useCallback as J, useRef as pt, useEffect as ne, useLayoutEffect as Zr, useId as Qr, useImperativeHandle as tn } from "react";
4
+ import { groupEdgesByTarget as en, sortEdgesBySourcePosition as rn, fromTypedNxGraph as nn, layoutNodes as Je, routeEdges as dr, buildEdgePath as on, normalizeGraphConfig as sn, DEFAULT_THEME as hr } from "@graph-render/core";
5
+ import { buildEdgePath as ti, fromNxGraph as ei, layoutNodes as ri, renderGraphToSvg as ni, routeEdges as ii } from "@graph-render/core";
6
+ var Ze = { exports: {} }, ge = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.min.js
@@ -13,21 +13,21 @@ var rr = { exports: {} }, fe = {};
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
- var br;
17
- function mn() {
18
- if (br) return fe;
19
- br = 1;
20
- var e = re, r = Symbol.for("react.element"), s = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
21
- function h(u, w, T) {
22
- var v, m = {}, g = null, I = null;
23
- T !== void 0 && (g = "" + T), w.key !== void 0 && (g = "" + w.key), w.ref !== void 0 && (I = w.ref);
24
- for (v in w) i.call(w, v) && !c.hasOwnProperty(v) && (m[v] = w[v]);
25
- if (u && u.defaultProps) for (v in w = u.defaultProps, w) m[v] === void 0 && (m[v] = w[v]);
26
- return { $$typeof: r, type: u, key: g, ref: I, props: m, _owner: o.current };
16
+ var pr;
17
+ function an() {
18
+ if (pr) return ge;
19
+ pr = 1;
20
+ var e = oe, r = Symbol.for("react.element"), o = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 };
21
+ function d(u, b, I) {
22
+ var y, p = {}, m = null, E = null;
23
+ I !== void 0 && (m = "" + I), b.key !== void 0 && (m = "" + b.key), b.ref !== void 0 && (E = b.ref);
24
+ for (y in b) i.call(b, y) && !a.hasOwnProperty(y) && (p[y] = b[y]);
25
+ if (u && u.defaultProps) for (y in b = u.defaultProps, b) p[y] === void 0 && (p[y] = b[y]);
26
+ return { $$typeof: r, type: u, key: m, ref: E, props: p, _owner: s.current };
27
27
  }
28
- return fe.Fragment = s, fe.jsx = h, fe.jsxs = h, fe;
28
+ return ge.Fragment = o, ge.jsx = d, ge.jsxs = d, ge;
29
29
  }
30
- var de = {};
30
+ var ve = {};
31
31
  /**
32
32
  * @license React
33
33
  * react-jsx-runtime.development.js
@@ -37,91 +37,91 @@ var de = {};
37
37
  * This source code is licensed under the MIT license found in the
38
38
  * LICENSE file in the root directory of this source tree.
39
39
  */
40
- var Ir;
41
- function yn() {
42
- return Ir || (Ir = 1, process.env.NODE_ENV !== "production" && function() {
43
- var e = re, r = Symbol.for("react.element"), s = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), u = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), I = Symbol.for("react.offscreen"), l = Symbol.iterator, L = "@@iterator";
44
- function X(t) {
40
+ var mr;
41
+ function cn() {
42
+ return mr || (mr = 1, process.env.NODE_ENV !== "production" && function() {
43
+ var e = oe, r = Symbol.for("react.element"), o = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), u = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), l = Symbol.iterator, R = "@@iterator";
44
+ function W(t) {
45
45
  if (t === null || typeof t != "object")
46
46
  return null;
47
- var a = l && t[l] || t[L];
48
- return typeof a == "function" ? a : null;
47
+ var c = l && t[l] || t[R];
48
+ return typeof c == "function" ? c : null;
49
49
  }
50
- var y = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
- function E(t) {
50
+ var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
+ function _(t) {
52
52
  {
53
- for (var a = arguments.length, f = new Array(a > 1 ? a - 1 : 0), R = 1; R < a; R++)
54
- f[R - 1] = arguments[R];
55
- _("error", t, f);
53
+ for (var c = arguments.length, h = new Array(c > 1 ? c - 1 : 0), P = 1; P < c; P++)
54
+ h[P - 1] = arguments[P];
55
+ w("error", t, h);
56
56
  }
57
57
  }
58
- function _(t, a, f) {
58
+ function w(t, c, h) {
59
59
  {
60
- var R = y.ReactDebugCurrentFrame, M = R.getStackAddendum();
61
- M !== "" && (a += "%s", f = f.concat([M]));
62
- var W = f.map(function(z) {
63
- return String(z);
60
+ var P = g.ReactDebugCurrentFrame, N = P.getStackAddendum();
61
+ N !== "" && (c += "%s", h = h.concat([N]));
62
+ var X = h.map(function(j) {
63
+ return String(j);
64
64
  });
65
- W.unshift("Warning: " + a), Function.prototype.apply.call(console[t], console, W);
65
+ X.unshift("Warning: " + c), Function.prototype.apply.call(console[t], console, X);
66
66
  }
67
67
  }
68
- var x = !1, G = !1, ut = !1, rt = !1, S = !1, D;
69
- D = Symbol.for("react.module.reference");
70
- function H(t) {
71
- return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || S || t === o || t === T || t === v || rt || t === I || x || G || ut || typeof t == "object" && t !== null && (t.$$typeof === g || t.$$typeof === m || t.$$typeof === h || t.$$typeof === u || t.$$typeof === w || // This needs to include all possible module reference object
68
+ var v = !1, H = !1, ot = !1, ut = !1, S = !1, L;
69
+ L = Symbol.for("react.module.reference");
70
+ function et(t) {
71
+ return !!(typeof t == "string" || typeof t == "function" || t === i || t === a || S || t === s || t === I || t === y || ut || t === E || v || H || ot || typeof t == "object" && t !== null && (t.$$typeof === m || t.$$typeof === p || t.$$typeof === d || t.$$typeof === u || t.$$typeof === b || // This needs to include all possible module reference object
72
72
  // types supported by any Flight configuration anywhere since
73
73
  // we don't know which Flight build this will end up being used
74
74
  // with.
75
- t.$$typeof === D || t.getModuleId !== void 0));
75
+ t.$$typeof === L || t.getModuleId !== void 0));
76
76
  }
77
- function it(t, a, f) {
78
- var R = t.displayName;
79
- if (R)
80
- return R;
81
- var M = a.displayName || a.name || "";
82
- return M !== "" ? f + "(" + M + ")" : f;
77
+ function B(t, c, h) {
78
+ var P = t.displayName;
79
+ if (P)
80
+ return P;
81
+ var N = c.displayName || c.name || "";
82
+ return N !== "" ? h + "(" + N + ")" : h;
83
83
  }
84
- function q(t) {
84
+ function C(t) {
85
85
  return t.displayName || "Context";
86
86
  }
87
- function V(t) {
87
+ function Y(t) {
88
88
  if (t == null)
89
89
  return null;
90
- if (typeof t.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
90
+ if (typeof t.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
91
91
  return t.displayName || t.name || null;
92
92
  if (typeof t == "string")
93
93
  return t;
94
94
  switch (t) {
95
95
  case i:
96
96
  return "Fragment";
97
- case s:
97
+ case o:
98
98
  return "Portal";
99
- case c:
99
+ case a:
100
100
  return "Profiler";
101
- case o:
101
+ case s:
102
102
  return "StrictMode";
103
- case T:
103
+ case I:
104
104
  return "Suspense";
105
- case v:
105
+ case y:
106
106
  return "SuspenseList";
107
107
  }
108
108
  if (typeof t == "object")
109
109
  switch (t.$$typeof) {
110
110
  case u:
111
- var a = t;
112
- return q(a) + ".Consumer";
113
- case h:
114
- var f = t;
115
- return q(f._context) + ".Provider";
116
- case w:
117
- return it(t, t.render, "ForwardRef");
118
- case m:
119
- var R = t.displayName || null;
120
- return R !== null ? R : V(t.type) || "Memo";
121
- case g: {
122
- var M = t, W = M._payload, z = M._init;
111
+ var c = t;
112
+ return C(c) + ".Consumer";
113
+ case d:
114
+ var h = t;
115
+ return C(h._context) + ".Provider";
116
+ case b:
117
+ return B(t, t.render, "ForwardRef");
118
+ case p:
119
+ var P = t.displayName || null;
120
+ return P !== null ? P : Y(t.type) || "Memo";
121
+ case m: {
122
+ var N = t, X = N._payload, j = N._init;
123
123
  try {
124
- return V(z(W));
124
+ return Y(j(X));
125
125
  } catch {
126
126
  return null;
127
127
  }
@@ -129,18 +129,18 @@ function yn() {
129
129
  }
130
130
  return null;
131
131
  }
132
- var at = Object.assign, O = 0, A, Y, J, dt, jt, vt, _t;
133
- function Ft() {
132
+ var U = Object.assign, it = 0, A, O, F, G, zt, Yt, Kt;
133
+ function Wt() {
134
134
  }
135
- Ft.__reactDisabledLog = !0;
136
- function Kt() {
135
+ Wt.__reactDisabledLog = !0;
136
+ function Vt() {
137
137
  {
138
- if (O === 0) {
139
- A = console.log, Y = console.info, J = console.warn, dt = console.error, jt = console.group, vt = console.groupCollapsed, _t = console.groupEnd;
138
+ if (it === 0) {
139
+ A = console.log, O = console.info, F = console.warn, G = console.error, zt = console.group, Yt = console.groupCollapsed, Kt = console.groupEnd;
140
140
  var t = {
141
141
  configurable: !0,
142
142
  enumerable: !0,
143
- value: Ft,
143
+ value: Wt,
144
144
  writable: !0
145
145
  };
146
146
  Object.defineProperties(console, {
@@ -153,332 +153,332 @@ function yn() {
153
153
  groupEnd: t
154
154
  });
155
155
  }
156
- O++;
156
+ it++;
157
157
  }
158
158
  }
159
- function ot() {
159
+ function lt() {
160
160
  {
161
- if (O--, O === 0) {
161
+ if (it--, it === 0) {
162
162
  var t = {
163
163
  configurable: !0,
164
164
  enumerable: !0,
165
165
  writable: !0
166
166
  };
167
167
  Object.defineProperties(console, {
168
- log: at({}, t, {
168
+ log: U({}, t, {
169
169
  value: A
170
170
  }),
171
- info: at({}, t, {
172
- value: Y
171
+ info: U({}, t, {
172
+ value: O
173
173
  }),
174
- warn: at({}, t, {
175
- value: J
174
+ warn: U({}, t, {
175
+ value: F
176
176
  }),
177
- error: at({}, t, {
178
- value: dt
177
+ error: U({}, t, {
178
+ value: G
179
179
  }),
180
- group: at({}, t, {
181
- value: jt
180
+ group: U({}, t, {
181
+ value: zt
182
182
  }),
183
- groupCollapsed: at({}, t, {
184
- value: vt
183
+ groupCollapsed: U({}, t, {
184
+ value: Yt
185
185
  }),
186
- groupEnd: at({}, t, {
187
- value: _t
186
+ groupEnd: U({}, t, {
187
+ value: Kt
188
188
  })
189
189
  });
190
190
  }
191
- O < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
191
+ it < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
192
  }
193
193
  }
194
- var Q = y.ReactCurrentDispatcher, Lt;
195
- function Tt(t, a, f) {
194
+ var rt = g.ReactCurrentDispatcher, Ot;
195
+ function Tt(t, c, h) {
196
196
  {
197
- if (Lt === void 0)
197
+ if (Ot === void 0)
198
198
  try {
199
199
  throw Error();
200
- } catch (M) {
201
- var R = M.stack.trim().match(/\n( *(at )?)/);
202
- Lt = R && R[1] || "";
200
+ } catch (N) {
201
+ var P = N.stack.trim().match(/\n( *(at )?)/);
202
+ Ot = P && P[1] || "";
203
203
  }
204
204
  return `
205
- ` + Lt + t;
205
+ ` + Ot + t;
206
206
  }
207
207
  }
208
- var mt = !1, Gt;
208
+ var mt = !1, qt;
209
209
  {
210
- var De = typeof WeakMap == "function" ? WeakMap : Map;
211
- Gt = new De();
210
+ var je = typeof WeakMap == "function" ? WeakMap : Map;
211
+ qt = new je();
212
212
  }
213
- function me(t, a) {
213
+ function be(t, c) {
214
214
  if (!t || mt)
215
215
  return "";
216
216
  {
217
- var f = Gt.get(t);
218
- if (f !== void 0)
219
- return f;
217
+ var h = qt.get(t);
218
+ if (h !== void 0)
219
+ return h;
220
220
  }
221
- var R;
221
+ var P;
222
222
  mt = !0;
223
- var M = Error.prepareStackTrace;
223
+ var N = Error.prepareStackTrace;
224
224
  Error.prepareStackTrace = void 0;
225
- var W;
226
- W = Q.current, Q.current = null, Kt();
225
+ var X;
226
+ X = rt.current, rt.current = null, Vt();
227
227
  try {
228
- if (a) {
229
- var z = function() {
228
+ if (c) {
229
+ var j = function() {
230
230
  throw Error();
231
231
  };
232
- if (Object.defineProperty(z.prototype, "props", {
232
+ if (Object.defineProperty(j.prototype, "props", {
233
233
  set: function() {
234
234
  throw Error();
235
235
  }
236
236
  }), typeof Reflect == "object" && Reflect.construct) {
237
237
  try {
238
- Reflect.construct(z, []);
239
- } catch (C) {
240
- R = C;
238
+ Reflect.construct(j, []);
239
+ } catch (ct) {
240
+ P = ct;
241
241
  }
242
- Reflect.construct(t, [], z);
242
+ Reflect.construct(t, [], j);
243
243
  } else {
244
244
  try {
245
- z.call();
246
- } catch (C) {
247
- R = C;
245
+ j.call();
246
+ } catch (ct) {
247
+ P = ct;
248
248
  }
249
- t.call(z.prototype);
249
+ t.call(j.prototype);
250
250
  }
251
251
  } else {
252
252
  try {
253
253
  throw Error();
254
- } catch (C) {
255
- R = C;
254
+ } catch (ct) {
255
+ P = ct;
256
256
  }
257
257
  t();
258
258
  }
259
- } catch (C) {
260
- if (C && R && typeof C.stack == "string") {
261
- for (var j = C.stack.split(`
262
- `), nt = R.stack.split(`
263
- `), B = j.length - 1, Z = nt.length - 1; B >= 1 && Z >= 0 && j[B] !== nt[Z]; )
259
+ } catch (ct) {
260
+ if (ct && P && typeof ct.stack == "string") {
261
+ for (var D = ct.stack.split(`
262
+ `), at = P.stack.split(`
263
+ `), q = D.length - 1, Z = at.length - 1; q >= 1 && Z >= 0 && D[q] !== at[Z]; )
264
264
  Z--;
265
- for (; B >= 1 && Z >= 0; B--, Z--)
266
- if (j[B] !== nt[Z]) {
267
- if (B !== 1 || Z !== 1)
265
+ for (; q >= 1 && Z >= 0; q--, Z--)
266
+ if (D[q] !== at[Z]) {
267
+ if (q !== 1 || Z !== 1)
268
268
  do
269
- if (B--, Z--, Z < 0 || j[B] !== nt[Z]) {
270
- var ft = `
271
- ` + j[B].replace(" at new ", " at ");
272
- return t.displayName && ft.includes("<anonymous>") && (ft = ft.replace("<anonymous>", t.displayName)), typeof t == "function" && Gt.set(t, ft), ft;
269
+ if (q--, Z--, Z < 0 || D[q] !== at[Z]) {
270
+ var Q = `
271
+ ` + D[q].replace(" at new ", " at ");
272
+ return t.displayName && Q.includes("<anonymous>") && (Q = Q.replace("<anonymous>", t.displayName)), typeof t == "function" && qt.set(t, Q), Q;
273
273
  }
274
- while (B >= 1 && Z >= 0);
274
+ while (q >= 1 && Z >= 0);
275
275
  break;
276
276
  }
277
277
  }
278
278
  } finally {
279
- mt = !1, Q.current = W, ot(), Error.prepareStackTrace = M;
279
+ mt = !1, rt.current = X, lt(), Error.prepareStackTrace = N;
280
280
  }
281
- var $ = t ? t.displayName || t.name : "", tt = $ ? Tt($) : "";
282
- return typeof t == "function" && Gt.set(t, tt), tt;
281
+ var V = t ? t.displayName || t.name : "", Lt = V ? Tt(V) : "";
282
+ return typeof t == "function" && qt.set(t, Lt), Lt;
283
283
  }
284
- function ne(t, a, f) {
285
- return me(t, !1);
284
+ function se(t, c, h) {
285
+ return be(t, !1);
286
286
  }
287
- function ie(t) {
288
- var a = t.prototype;
289
- return !!(a && a.isReactComponent);
287
+ function ae(t) {
288
+ var c = t.prototype;
289
+ return !!(c && c.isReactComponent);
290
290
  }
291
- function ct(t, a, f) {
291
+ function ft(t, c, h) {
292
292
  if (t == null)
293
293
  return "";
294
294
  if (typeof t == "function")
295
- return me(t, ie(t));
295
+ return be(t, ae(t));
296
296
  if (typeof t == "string")
297
297
  return Tt(t);
298
298
  switch (t) {
299
- case T:
299
+ case I:
300
300
  return Tt("Suspense");
301
- case v:
301
+ case y:
302
302
  return Tt("SuspenseList");
303
303
  }
304
304
  if (typeof t == "object")
305
305
  switch (t.$$typeof) {
306
- case w:
307
- return ne(t.render);
308
- case m:
309
- return ct(t.type, a, f);
310
- case g: {
311
- var R = t, M = R._payload, W = R._init;
306
+ case b:
307
+ return se(t.render);
308
+ case p:
309
+ return ft(t.type, c, h);
310
+ case m: {
311
+ var P = t, N = P._payload, X = P._init;
312
312
  try {
313
- return ct(W(M), a, f);
313
+ return ft(X(N), c, h);
314
314
  } catch {
315
315
  }
316
316
  }
317
317
  }
318
318
  return "";
319
319
  }
320
- var Pt = Object.prototype.hasOwnProperty, Yt = {}, Rt = y.ReactDebugCurrentFrame;
320
+ var Pt = Object.prototype.hasOwnProperty, $t = {}, Rt = g.ReactDebugCurrentFrame;
321
321
  function yt(t) {
322
322
  if (t) {
323
- var a = t._owner, f = ct(t.type, t._source, a ? a.type : null);
324
- Rt.setExtraStackFrame(f);
323
+ var c = t._owner, h = ft(t.type, t._source, c ? c.type : null);
324
+ Rt.setExtraStackFrame(h);
325
325
  } else
326
326
  Rt.setExtraStackFrame(null);
327
327
  }
328
- function ze(t, a, f, R, M) {
328
+ function ze(t, c, h, P, N) {
329
329
  {
330
- var W = Function.call.bind(Pt);
331
- for (var z in t)
332
- if (W(t, z)) {
333
- var j = void 0;
330
+ var X = Function.call.bind(Pt);
331
+ for (var j in t)
332
+ if (X(t, j)) {
333
+ var D = void 0;
334
334
  try {
335
- if (typeof t[z] != "function") {
336
- var nt = Error((R || "React class") + ": " + f + " type `" + z + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[z] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
- throw nt.name = "Invariant Violation", nt;
335
+ if (typeof t[j] != "function") {
336
+ var at = Error((P || "React class") + ": " + h + " type `" + j + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[j] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
+ throw at.name = "Invariant Violation", at;
338
338
  }
339
- j = t[z](a, z, R, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
- } catch (B) {
341
- j = B;
339
+ D = t[j](c, j, P, h, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (q) {
341
+ D = q;
342
342
  }
343
- j && !(j instanceof Error) && (yt(M), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", R || "React class", f, z, typeof j), yt(null)), j instanceof Error && !(j.message in Yt) && (Yt[j.message] = !0, yt(M), E("Failed %s type: %s", f, j.message), yt(null));
343
+ D && !(D instanceof Error) && (yt(N), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", P || "React class", h, j, typeof D), yt(null)), D instanceof Error && !(D.message in $t) && ($t[D.message] = !0, yt(N), _("Failed %s type: %s", h, D.message), yt(null));
344
344
  }
345
345
  }
346
346
  }
347
- var ye = Array.isArray;
348
- function lt(t) {
349
- return ye(t);
347
+ var Ie = Array.isArray;
348
+ function xt(t) {
349
+ return Ie(t);
350
350
  }
351
- function ht(t) {
351
+ function Mt(t) {
352
352
  {
353
- var a = typeof Symbol == "function" && Symbol.toStringTag, f = a && t[Symbol.toStringTag] || t.constructor.name || "Object";
354
- return f;
353
+ var c = typeof Symbol == "function" && Symbol.toStringTag, h = c && t[Symbol.toStringTag] || t.constructor.name || "Object";
354
+ return h;
355
355
  }
356
356
  }
357
- function ge(t) {
357
+ function Ee(t) {
358
358
  try {
359
- return Wt(t), !1;
359
+ return Xt(t), !1;
360
360
  } catch {
361
361
  return !0;
362
362
  }
363
363
  }
364
- function Wt(t) {
364
+ function Xt(t) {
365
365
  return "" + t;
366
366
  }
367
- function oe(t) {
368
- if (ge(t))
369
- return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ht(t)), Wt(t);
367
+ function St(t) {
368
+ if (Ee(t))
369
+ return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Mt(t)), Xt(t);
370
370
  }
371
- var ve = y.ReactCurrentOwner, se = {
371
+ var Jt = g.ReactCurrentOwner, _e = {
372
372
  key: !0,
373
373
  ref: !0,
374
374
  __self: !0,
375
375
  __source: !0
376
- }, xe, we;
377
- function Ne(t) {
376
+ }, ce, gt;
377
+ function bt(t) {
378
378
  if (Pt.call(t, "ref")) {
379
- var a = Object.getOwnPropertyDescriptor(t, "ref").get;
380
- if (a && a.isReactWarning)
379
+ var c = Object.getOwnPropertyDescriptor(t, "ref").get;
380
+ if (c && c.isReactWarning)
381
381
  return !1;
382
382
  }
383
383
  return t.ref !== void 0;
384
384
  }
385
- function kt(t) {
385
+ function At(t) {
386
386
  if (Pt.call(t, "key")) {
387
- var a = Object.getOwnPropertyDescriptor(t, "key").get;
388
- if (a && a.isReactWarning)
387
+ var c = Object.getOwnPropertyDescriptor(t, "key").get;
388
+ if (c && c.isReactWarning)
389
389
  return !1;
390
390
  }
391
391
  return t.key !== void 0;
392
392
  }
393
- function ae(t, a) {
394
- typeof t.ref == "string" && ve.current;
393
+ function Nt(t, c) {
394
+ typeof t.ref == "string" && Jt.current;
395
395
  }
396
- function be(t, a) {
396
+ function Ne(t, c) {
397
397
  {
398
- var f = function() {
399
- xe || (xe = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
398
+ var h = function() {
399
+ ce || (ce = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
400
400
  };
401
- f.isReactWarning = !0, Object.defineProperty(t, "key", {
402
- get: f,
401
+ h.isReactWarning = !0, Object.defineProperty(t, "key", {
402
+ get: h,
403
403
  configurable: !0
404
404
  });
405
405
  }
406
406
  }
407
- function Ie(t, a) {
407
+ function ue(t, c) {
408
408
  {
409
- var f = function() {
410
- we || (we = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", a));
409
+ var h = function() {
410
+ gt || (gt = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", c));
411
411
  };
412
- f.isReactWarning = !0, Object.defineProperty(t, "ref", {
413
- get: f,
412
+ h.isReactWarning = !0, Object.defineProperty(t, "ref", {
413
+ get: h,
414
414
  configurable: !0
415
415
  });
416
416
  }
417
417
  }
418
- var xt = function(t, a, f, R, M, W, z) {
419
- var j = {
418
+ var T = function(t, c, h, P, N, X, j) {
419
+ var D = {
420
420
  // This tag allows us to uniquely identify this as a React Element
421
421
  $$typeof: r,
422
422
  // Built-in properties that belong on the element
423
423
  type: t,
424
- key: a,
425
- ref: f,
426
- props: z,
424
+ key: c,
425
+ ref: h,
426
+ props: j,
427
427
  // Record the component responsible for creating this element.
428
- _owner: W
428
+ _owner: X
429
429
  };
430
- return j._store = {}, Object.defineProperty(j._store, "validated", {
430
+ return D._store = {}, Object.defineProperty(D._store, "validated", {
431
431
  configurable: !1,
432
432
  enumerable: !1,
433
433
  writable: !0,
434
434
  value: !1
435
- }), Object.defineProperty(j, "_self", {
435
+ }), Object.defineProperty(D, "_self", {
436
436
  configurable: !1,
437
437
  enumerable: !1,
438
438
  writable: !1,
439
- value: R
440
- }), Object.defineProperty(j, "_source", {
439
+ value: P
440
+ }), Object.defineProperty(D, "_source", {
441
441
  configurable: !1,
442
442
  enumerable: !1,
443
443
  writable: !1,
444
- value: M
445
- }), Object.freeze && (Object.freeze(j.props), Object.freeze(j)), j;
444
+ value: N
445
+ }), Object.freeze && (Object.freeze(D.props), Object.freeze(D)), D;
446
446
  };
447
- function wt(t, a, f, R, M) {
447
+ function It(t, c, h, P, N) {
448
448
  {
449
- var W, z = {}, j = null, nt = null;
450
- f !== void 0 && (oe(f), j = "" + f), kt(a) && (oe(a.key), j = "" + a.key), Ne(a) && (nt = a.ref, ae(a, M));
451
- for (W in a)
452
- Pt.call(a, W) && !se.hasOwnProperty(W) && (z[W] = a[W]);
449
+ var X, j = {}, D = null, at = null;
450
+ h !== void 0 && (St(h), D = "" + h), At(c) && (St(c.key), D = "" + c.key), bt(c) && (at = c.ref, Nt(c, N));
451
+ for (X in c)
452
+ Pt.call(c, X) && !_e.hasOwnProperty(X) && (j[X] = c[X]);
453
453
  if (t && t.defaultProps) {
454
- var B = t.defaultProps;
455
- for (W in B)
456
- z[W] === void 0 && (z[W] = B[W]);
454
+ var q = t.defaultProps;
455
+ for (X in q)
456
+ j[X] === void 0 && (j[X] = q[X]);
457
457
  }
458
- if (j || nt) {
458
+ if (D || at) {
459
459
  var Z = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
460
- j && be(z, Z), nt && Ie(z, Z);
460
+ D && Ne(j, Z), at && ue(j, Z);
461
461
  }
462
- return xt(t, j, nt, M, R, ve.current, z);
462
+ return T(t, D, at, N, P, Jt.current, j);
463
463
  }
464
464
  }
465
- var bt = y.ReactCurrentOwner, Ot = y.ReactDebugCurrentFrame;
465
+ var Zt = g.ReactCurrentOwner, Bt = g.ReactDebugCurrentFrame;
466
466
  function Dt(t) {
467
467
  if (t) {
468
- var a = t._owner, f = ct(t.type, t._source, a ? a.type : null);
469
- Ot.setExtraStackFrame(f);
468
+ var c = t._owner, h = ft(t.type, t._source, c ? c.type : null);
469
+ Bt.setExtraStackFrame(h);
470
470
  } else
471
- Ot.setExtraStackFrame(null);
471
+ Bt.setExtraStackFrame(null);
472
472
  }
473
- var $t;
474
- $t = !1;
475
- function b(t) {
473
+ var le;
474
+ le = !1;
475
+ function fe(t) {
476
476
  return typeof t == "object" && t !== null && t.$$typeof === r;
477
477
  }
478
- function gt() {
478
+ function Te() {
479
479
  {
480
- if (bt.current) {
481
- var t = V(bt.current.type);
480
+ if (Zt.current) {
481
+ var t = Y(Zt.current.type);
482
482
  if (t)
483
483
  return `
484
484
 
@@ -487,476 +487,476 @@ Check the render method of \`` + t + "`.";
487
487
  return "";
488
488
  }
489
489
  }
490
- function Ee(t) {
490
+ function Fe(t) {
491
491
  return "";
492
492
  }
493
- var Xt = {};
494
- function _e(t) {
493
+ var Ct = {};
494
+ function Pe(t) {
495
495
  {
496
- var a = gt();
497
- if (!a) {
498
- var f = typeof t == "string" ? t : t.displayName || t.name;
499
- f && (a = `
496
+ var c = Te();
497
+ if (!c) {
498
+ var h = typeof t == "string" ? t : t.displayName || t.name;
499
+ h && (c = `
500
500
 
501
- Check the top-level render call using <` + f + ">.");
501
+ Check the top-level render call using <` + h + ">.");
502
502
  }
503
- return a;
503
+ return c;
504
504
  }
505
505
  }
506
- function Te(t, a) {
506
+ function de(t, c) {
507
507
  {
508
508
  if (!t._store || t._store.validated || t.key != null)
509
509
  return;
510
510
  t._store.validated = !0;
511
- var f = _e(a);
512
- if (Xt[f])
511
+ var h = Pe(c);
512
+ if (Ct[h])
513
513
  return;
514
- Xt[f] = !0;
515
- var R = "";
516
- t && t._owner && t._owner !== bt.current && (R = " It was passed a child from " + V(t._owner.type) + "."), Dt(t), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', f, R), Dt(null);
514
+ Ct[h] = !0;
515
+ var P = "";
516
+ t && t._owner && t._owner !== Zt.current && (P = " It was passed a child from " + Y(t._owner.type) + "."), Dt(t), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', h, P), Dt(null);
517
517
  }
518
518
  }
519
- function Pe(t, a) {
519
+ function he(t, c) {
520
520
  {
521
521
  if (typeof t != "object")
522
522
  return;
523
- if (lt(t))
524
- for (var f = 0; f < t.length; f++) {
525
- var R = t[f];
526
- b(R) && Te(R, a);
523
+ if (xt(t))
524
+ for (var h = 0; h < t.length; h++) {
525
+ var P = t[h];
526
+ fe(P) && de(P, c);
527
527
  }
528
- else if (b(t))
528
+ else if (fe(t))
529
529
  t._store && (t._store.validated = !0);
530
530
  else if (t) {
531
- var M = X(t);
532
- if (typeof M == "function" && M !== t.entries)
533
- for (var W = M.call(t), z; !(z = W.next()).done; )
534
- b(z.value) && Te(z.value, a);
531
+ var N = W(t);
532
+ if (typeof N == "function" && N !== t.entries)
533
+ for (var X = N.call(t), j; !(j = X.next()).done; )
534
+ fe(j.value) && de(j.value, c);
535
535
  }
536
536
  }
537
537
  }
538
- function Fe(t) {
538
+ function Re(t) {
539
539
  {
540
- var a = t.type;
541
- if (a == null || typeof a == "string")
540
+ var c = t.type;
541
+ if (c == null || typeof c == "string")
542
542
  return;
543
- var f;
544
- if (typeof a == "function")
545
- f = a.propTypes;
546
- else if (typeof a == "object" && (a.$$typeof === w || // Note: Memo only checks outer props here.
543
+ var h;
544
+ if (typeof c == "function")
545
+ h = c.propTypes;
546
+ else if (typeof c == "object" && (c.$$typeof === b || // Note: Memo only checks outer props here.
547
547
  // Inner props are checked in the reconciler.
548
- a.$$typeof === m))
549
- f = a.propTypes;
548
+ c.$$typeof === p))
549
+ h = c.propTypes;
550
550
  else
551
551
  return;
552
- if (f) {
553
- var R = V(a);
554
- ze(f, t.props, "prop", R, t);
555
- } else if (a.PropTypes !== void 0 && !$t) {
556
- $t = !0;
557
- var M = V(a);
558
- E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", M || "Unknown");
552
+ if (h) {
553
+ var P = Y(c);
554
+ ze(h, t.props, "prop", P, t);
555
+ } else if (c.PropTypes !== void 0 && !le) {
556
+ le = !0;
557
+ var N = Y(c);
558
+ _("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", N || "Unknown");
559
559
  }
560
- typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
560
+ typeof c.getDefaultProps == "function" && !c.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
561
561
  }
562
562
  }
563
- function Ye(t) {
563
+ function $(t) {
564
564
  {
565
- for (var a = Object.keys(t.props), f = 0; f < a.length; f++) {
566
- var R = a[f];
567
- if (R !== "children" && R !== "key") {
568
- Dt(t), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", R), Dt(null);
565
+ for (var c = Object.keys(t.props), h = 0; h < c.length; h++) {
566
+ var P = c[h];
567
+ if (P !== "children" && P !== "key") {
568
+ Dt(t), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", P), Dt(null);
569
569
  break;
570
570
  }
571
571
  }
572
- t.ref !== null && (Dt(t), E("Invalid attribute `ref` supplied to `React.Fragment`."), Dt(null));
572
+ t.ref !== null && (Dt(t), _("Invalid attribute `ref` supplied to `React.Fragment`."), Dt(null));
573
573
  }
574
574
  }
575
- var Bt = {};
576
- function ce(t, a, f, R, M, W) {
575
+ var Se = {};
576
+ function st(t, c, h, P, N, X) {
577
577
  {
578
- var z = H(t);
579
- if (!z) {
580
- var j = "";
581
- (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (j += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
582
- var nt = Ee();
583
- nt ? j += nt : j += gt();
584
- var B;
585
- t === null ? B = "null" : lt(t) ? B = "array" : t !== void 0 && t.$$typeof === r ? (B = "<" + (V(t.type) || "Unknown") + " />", j = " Did you accidentally export a JSX literal instead of a component?") : B = typeof t, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", B, j);
578
+ var j = et(t);
579
+ if (!j) {
580
+ var D = "";
581
+ (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (D += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
582
+ var at = Fe();
583
+ at ? D += at : D += Te();
584
+ var q;
585
+ t === null ? q = "null" : xt(t) ? q = "array" : t !== void 0 && t.$$typeof === r ? (q = "<" + (Y(t.type) || "Unknown") + " />", D = " Did you accidentally export a JSX literal instead of a component?") : q = typeof t, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", q, D);
586
586
  }
587
- var Z = wt(t, a, f, M, W);
587
+ var Z = It(t, c, h, N, X);
588
588
  if (Z == null)
589
589
  return Z;
590
- if (z) {
591
- var ft = a.children;
592
- if (ft !== void 0)
593
- if (R)
594
- if (lt(ft)) {
595
- for (var $ = 0; $ < ft.length; $++)
596
- Pe(ft[$], t);
597
- Object.freeze && Object.freeze(ft);
590
+ if (j) {
591
+ var Q = c.children;
592
+ if (Q !== void 0)
593
+ if (P)
594
+ if (xt(Q)) {
595
+ for (var V = 0; V < Q.length; V++)
596
+ he(Q[V], t);
597
+ Object.freeze && Object.freeze(Q);
598
598
  } else
599
- E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
599
+ _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
600
600
  else
601
- Pe(ft, t);
601
+ he(Q, t);
602
602
  }
603
- if (Pt.call(a, "key")) {
604
- var tt = V(t), C = Object.keys(a).filter(function($e) {
605
- return $e !== "key";
606
- }), Vt = C.length > 0 ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}";
607
- if (!Bt[tt + Vt]) {
608
- var We = C.length > 0 ? "{" + C.join(": ..., ") + ": ...}" : "{}";
609
- E(`A props object containing a "key" prop is being spread into JSX:
603
+ if (Pt.call(c, "key")) {
604
+ var Lt = Y(t), ct = Object.keys(c).filter(function(Le) {
605
+ return Le !== "key";
606
+ }), pe = ct.length > 0 ? "{key: someKey, " + ct.join(": ..., ") + ": ...}" : "{key: someKey}";
607
+ if (!Se[Lt + pe]) {
608
+ var ht = ct.length > 0 ? "{" + ct.join(": ..., ") + ": ...}" : "{}";
609
+ _(`A props object containing a "key" prop is being spread into JSX:
610
610
  let props = %s;
611
611
  <%s {...props} />
612
612
  React keys must be passed directly to JSX without using spread:
613
613
  let props = %s;
614
- <%s key={someKey} {...props} />`, Vt, tt, We, tt), Bt[tt + Vt] = !0;
614
+ <%s key={someKey} {...props} />`, pe, Lt, ht, Lt), Se[Lt + pe] = !0;
615
615
  }
616
616
  }
617
- return t === i ? Ye(Z) : Fe(Z), Z;
617
+ return t === i ? $(Z) : Re(Z), Z;
618
618
  }
619
619
  }
620
- function Re(t, a, f) {
621
- return ce(t, a, f, !0);
620
+ function Et(t, c, h) {
621
+ return st(t, c, h, !0);
622
622
  }
623
- function Se(t, a, f) {
624
- return ce(t, a, f, !1);
623
+ function K(t, c, h) {
624
+ return st(t, c, h, !1);
625
625
  }
626
- var Le = Se, F = Re;
627
- de.Fragment = i, de.jsx = Le, de.jsxs = F;
628
- }()), de;
626
+ var dt = K, vt = Et;
627
+ ve.Fragment = i, ve.jsx = dt, ve.jsxs = vt;
628
+ }()), ve;
629
629
  }
630
- process.env.NODE_ENV === "production" ? rr.exports = mn() : rr.exports = yn();
631
- var N = rr.exports;
632
- function Ue(e) {
630
+ process.env.NODE_ENV === "production" ? Ze.exports = an() : Ze.exports = cn();
631
+ var z = Ze.exports;
632
+ function Xe(e) {
633
633
  return e.trim().toLowerCase();
634
634
  }
635
- function gn(e) {
635
+ function un(e) {
636
636
  const r = /* @__PURE__ */ new Map();
637
- return e.forEach((s) => {
638
- const i = s.meta;
637
+ return e.forEach((o) => {
638
+ const i = o.meta;
639
639
  if (!i)
640
640
  return;
641
- const o = i.pathKeys, h = (Array.isArray(o) ? o : []).map((u) => typeof u == "string" ? u : typeof u == "object" && u !== null && "name" in u && typeof u.name == "string" ? u.name : null).filter((u) => typeof u == "string").map((u) => u.trim()).filter((u) => u.length > 0);
642
- h.length && r.set(s.id, h);
641
+ const s = i.pathKeys, d = (Array.isArray(s) ? s : []).map((u) => typeof u == "string" ? u : typeof u == "object" && u !== null && "name" in u && typeof u.name == "string" ? u.name : null).filter((u) => typeof u == "string").map((u) => u.trim()).filter((u) => u.length > 0);
642
+ d.length && r.set(o.id, d);
643
643
  }), r;
644
644
  }
645
- function vn(e) {
645
+ function ln(e) {
646
646
  const {
647
647
  startNodeId: r,
648
- sourceIndex: s,
648
+ sourceIndex: o,
649
649
  pathKey: i,
650
- incomingEdgesByTarget: o,
651
- pathKeysByNode: c,
652
- maxNodes: h = 500
653
- } = e, u = /* @__PURE__ */ new Set([r]), w = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set([`${r}|${s ?? ""}|${i ?? ""}`]), v = [
654
- { nodeId: r, sourceIndex: s ?? null, pathKey: i }
650
+ incomingEdgesByTarget: s,
651
+ pathKeysByNode: a,
652
+ maxNodes: d = 500
653
+ } = e, u = /* @__PURE__ */ new Set([r]), b = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Set([`${r}|${o ?? ""}|${i ?? ""}`]), y = [
654
+ { nodeId: r, sourceIndex: o ?? null, pathKey: i }
655
655
  ];
656
- for (; v.length && !(u.size >= h); ) {
657
- const m = v.pop();
658
- if (!m)
656
+ for (; y.length && !(u.size >= d); ) {
657
+ const p = y.pop();
658
+ if (!p)
659
659
  continue;
660
- const g = o.get(m.nodeId) ?? [], I = m.pathKey ? Ue(m.pathKey) : null;
660
+ const m = s.get(p.nodeId) ?? [], E = p.pathKey ? Xe(p.pathKey) : null;
661
661
  let l = [];
662
- I && c && (l = g.filter((L) => (c.get(L.source) ?? []).some((y) => Ue(y) === I))), l.length || (m.sourceIndex == null ? l = g : g[m.sourceIndex] && (l = [g[m.sourceIndex]])), l.forEach((L) => {
663
- if (w.has(L.id))
662
+ E && a && (l = m.filter((R) => (a.get(R.source) ?? []).some((g) => Xe(g) === E))), l.length || (p.sourceIndex == null ? l = m : m[p.sourceIndex] && (l = [m[p.sourceIndex]])), l.forEach((R) => {
663
+ if (b.has(R.id))
664
664
  return;
665
- w.add(L.id), u.add(L.source);
666
- const X = (c == null ? void 0 : c.get(L.source)) ?? [], y = I ? X.findIndex((x) => Ue(x) === I) : m.sourceIndex, E = typeof y == "number" && y >= 0 ? y : m.sourceIndex, _ = `${L.source}|${E ?? ""}|${m.pathKey ?? ""}`;
667
- T.has(_) || (T.add(_), v.push({
668
- nodeId: L.source,
669
- sourceIndex: E,
670
- pathKey: m.pathKey
665
+ b.add(R.id), u.add(R.source);
666
+ const W = (a == null ? void 0 : a.get(R.source)) ?? [], g = E ? W.findIndex((v) => Xe(v) === E) : p.sourceIndex, _ = typeof g == "number" && g >= 0 ? g : p.sourceIndex, w = `${R.source}|${_ ?? ""}|${p.pathKey ?? ""}`;
667
+ I.has(w) || (I.add(w), y.push({
668
+ nodeId: R.source,
669
+ sourceIndex: _,
670
+ pathKey: p.pathKey
671
671
  }));
672
672
  });
673
673
  }
674
- return { nodes: u, edges: w };
674
+ return { nodes: u, edges: b };
675
675
  }
676
- function xn(e, r, s) {
677
- const [i, o] = Et(null), [c, h] = Et(null), [u, w] = Et(null), T = k(
678
- () => new Map(r.map((y) => [y.id, y])),
676
+ function fn(e, r, o) {
677
+ const [i, s] = _t(null), [a, d] = _t(null), [u, b] = _t(null), I = M(
678
+ () => new Map(r.map((g) => [g.id, g])),
679
679
  [r]
680
- ), v = k(() => {
681
- const y = /* @__PURE__ */ new Map();
682
- return r.forEach((E) => {
683
- y.set(E.source, [...y.get(E.source) ?? [], E]), E.target !== E.source && y.set(E.target, [...y.get(E.target) ?? [], E]);
684
- }), y;
685
- }, [r]), m = k(() => {
686
- const y = /* @__PURE__ */ new Map();
687
- return e.forEach((E) => y.set(E.id, E.position)), y;
688
- }, [e]), g = k(
689
- () => gn(e),
680
+ ), y = M(() => {
681
+ const g = /* @__PURE__ */ new Map();
682
+ return r.forEach((_) => {
683
+ g.set(_.source, [...g.get(_.source) ?? [], _]), _.target !== _.source && g.set(_.target, [...g.get(_.target) ?? [], _]);
684
+ }), g;
685
+ }, [r]), p = M(() => {
686
+ const g = /* @__PURE__ */ new Map();
687
+ return e.forEach((_) => g.set(_.id, _.position)), g;
688
+ }, [e]), m = M(
689
+ () => un(e),
690
690
  [e]
691
- ), I = k(() => {
692
- const y = ln(r);
693
- return y.forEach((E, _) => {
694
- y.set(_, fn(E, m));
695
- }), y;
696
- }, [r, m]), l = k(() => u ? vn({
691
+ ), E = M(() => {
692
+ const g = en(r);
693
+ return g.forEach((_, w) => {
694
+ g.set(w, rn(_, p));
695
+ }), g;
696
+ }, [r, p]), l = M(() => u ? ln({
697
697
  startNodeId: u.nodeId,
698
698
  sourceIndex: u.sourceIndex,
699
699
  pathKey: u.pathKey,
700
- incomingEdgesByTarget: I,
701
- pathKeysByNode: g
702
- }) : null, [u, I, g]), L = k(() => {
703
- if (!s && !l) return null;
704
- const y = /* @__PURE__ */ new Map(), E = () => {
705
- l && l.nodes.forEach((_) => {
706
- const x = y.get(_) ?? { in: !1, out: !1 };
707
- y.set(_, { ...x, in: !0, out: !0 });
700
+ incomingEdgesByTarget: E,
701
+ pathKeysByNode: m
702
+ }) : null, [u, E, m]), R = M(() => {
703
+ if (!o && !l) return null;
704
+ const g = /* @__PURE__ */ new Map(), _ = () => {
705
+ l && l.nodes.forEach((w) => {
706
+ const v = g.get(w) ?? { in: !1, out: !1 };
707
+ g.set(w, { ...v, in: !0, out: !0 });
708
708
  });
709
709
  };
710
710
  if (u)
711
- E();
711
+ _();
712
712
  else {
713
- if (s) {
713
+ if (o) {
714
714
  if (i) {
715
- const _ = T.get(i);
716
- if (_) {
717
- const x = (G, ut) => {
718
- const rt = y.get(G) ?? { in: !1, out: !1 };
719
- y.set(G, { ...rt, [ut]: !0 });
715
+ const w = I.get(i);
716
+ if (w) {
717
+ const v = (H, ot) => {
718
+ const ut = g.get(H) ?? { in: !1, out: !1 };
719
+ g.set(H, { ...ut, [ot]: !0 });
720
720
  };
721
- _.type === "undirected" ? (x(_.source, "in"), x(_.source, "out"), x(_.target, "in"), x(_.target, "out")) : (x(_.source, "out"), x(_.target, "in"));
721
+ w.type === "undirected" ? (v(w.source, "in"), v(w.source, "out"), v(w.target, "in"), v(w.target, "out")) : (v(w.source, "out"), v(w.target, "in"));
722
722
  }
723
- } else if (c) {
724
- const _ = (x, G) => {
725
- const ut = y.get(x) ?? { in: !1, out: !1 };
726
- y.set(x, { ...ut, [G]: !0 });
723
+ } else if (a) {
724
+ const w = (v, H) => {
725
+ const ot = g.get(v) ?? { in: !1, out: !1 };
726
+ g.set(v, { ...ot, [H]: !0 });
727
727
  };
728
- (v.get(c) ?? []).forEach((x) => {
729
- const G = x.type === "undirected";
730
- (x.source === c || x.target === c) && (G ? (_(x.source, "in"), _(x.source, "out"), _(x.target, "in"), _(x.target, "out")) : (_(x.source, "out"), _(x.target, "in")));
731
- }), _(c, "in"), _(c, "out");
728
+ (y.get(a) ?? []).forEach((v) => {
729
+ const H = v.type === "undirected";
730
+ (v.source === a || v.target === a) && (H ? (w(v.source, "in"), w(v.source, "out"), w(v.target, "in"), w(v.target, "out")) : (w(v.source, "out"), w(v.target, "in")));
731
+ }), w(a, "in"), w(a, "out");
732
732
  }
733
733
  }
734
- E();
734
+ _();
735
735
  }
736
- return y.size ? y : null;
736
+ return g.size ? g : null;
737
737
  }, [
738
- T,
739
- v,
740
- s,
738
+ I,
739
+ y,
740
+ o,
741
741
  i,
742
- c,
742
+ a,
743
743
  l,
744
744
  u
745
- ]), X = k(() => {
746
- const y = /* @__PURE__ */ new Set();
747
- if (u && l ? l.edges.forEach((x) => y.add(x)) : (s && (i ? y.add(i) : c && (v.get(c) ?? []).forEach((x) => {
748
- (x.source === c || x.target === c) && y.add(x.id);
749
- })), l && l.edges.forEach((x) => y.add(x))), !y.size) return r;
750
- const E = [], _ = [];
751
- return r.forEach((x) => {
752
- y.has(x.id) ? E.push(x) : _.push(x);
753
- }), [..._, ...E];
745
+ ]), W = M(() => {
746
+ const g = /* @__PURE__ */ new Set();
747
+ if (u && l ? l.edges.forEach((v) => g.add(v)) : (o && (i ? g.add(i) : a && (y.get(a) ?? []).forEach((v) => {
748
+ (v.source === a || v.target === a) && g.add(v.id);
749
+ })), l && l.edges.forEach((v) => g.add(v))), !g.size) return r;
750
+ const _ = [], w = [];
751
+ return r.forEach((v) => {
752
+ g.has(v.id) ? _.push(v) : w.push(v);
753
+ }), [...w, ..._];
754
754
  }, [
755
- v,
756
- s,
755
+ y,
756
+ o,
757
757
  i,
758
- c,
758
+ a,
759
759
  r,
760
760
  l,
761
761
  u
762
762
  ]);
763
763
  return {
764
764
  hoveredEdgeId: i,
765
- setHoveredEdgeId: o,
766
- hoveredNodeId: c,
767
- setHoveredNodeId: h,
765
+ setHoveredEdgeId: s,
766
+ hoveredNodeId: a,
767
+ setHoveredNodeId: d,
768
768
  focusedPath: u,
769
- setFocusedPath: w,
769
+ setFocusedPath: b,
770
770
  pathHighlight: l,
771
- hoveredNodeStates: L,
772
- edgesForRender: X
771
+ hoveredNodeStates: R,
772
+ edgesForRender: W
773
773
  };
774
774
  }
775
- const wn = ({
775
+ const dn = ({
776
776
  collapsedNodeIds: e,
777
777
  defaultCollapsedNodeIds: r,
778
- onCollapsedNodeIdsChange: s
778
+ onCollapsedNodeIdsChange: o
779
779
  }) => {
780
- const [i, o] = Et(
780
+ const [i, s] = _t(
781
781
  r ?? []
782
- ), [c, h] = Et([]), u = e ?? i, w = k(() => new Set(u), [u]), T = k(
783
- () => new Set(c),
784
- [c]
785
- ), v = K(
786
- (m) => {
787
- const I = typeof m == "function" ? m(u) : m;
788
- e == null && o(I), s == null || s(I);
782
+ ), [a, d] = _t([]), u = e ?? i, b = M(() => new Set(u), [u]), I = M(
783
+ () => new Set(a),
784
+ [a]
785
+ ), y = J(
786
+ (p) => {
787
+ const E = typeof p == "function" ? p(u) : p;
788
+ e == null && s(E), o == null || o(E);
789
789
  },
790
- [u, e, s]
790
+ [u, e, o]
791
791
  );
792
792
  return {
793
793
  collapsedIds: u,
794
- collapsedNodeSet: w,
795
- pendingExpansionNodeSet: T,
796
- updateCollapsedNodeIds: v,
797
- setPendingExpansionNodeIds: h
794
+ collapsedNodeSet: b,
795
+ pendingExpansionNodeSet: I,
796
+ updateCollapsedNodeIds: y,
797
+ setPendingExpansionNodeIds: d
798
798
  };
799
- }, bn = ({
799
+ }, hn = ({
800
800
  nodes: e,
801
801
  edges: r,
802
- collapsedIds: s,
802
+ collapsedIds: o,
803
803
  hiddenNodeIds: i,
804
- searchQuery: o,
805
- hideUnmatchedSearch: c = !1,
806
- searchPredicate: h,
804
+ searchQuery: s,
805
+ hideUnmatchedSearch: a = !1,
806
+ searchPredicate: d,
807
807
  highlightedNodeIds: u,
808
- highlightedEdgeIds: w,
809
- highlightStrategy: T,
810
- onSearchResultsChange: v
808
+ highlightedEdgeIds: b,
809
+ highlightStrategy: I,
810
+ onSearchResultsChange: y
811
811
  }) => {
812
- const m = pt(v);
813
- m.current = v;
814
- const g = k(() => {
815
- const S = o == null ? void 0 : o.trim().toLowerCase();
816
- return S ? e.filter((D) => {
817
- if (h)
812
+ const p = pt(y);
813
+ p.current = y;
814
+ const m = M(() => {
815
+ const S = s == null ? void 0 : s.trim().toLowerCase();
816
+ return S ? e.filter((L) => {
817
+ if (d)
818
818
  try {
819
- return h(D, S);
819
+ return d(L, S);
820
820
  } catch {
821
821
  return !1;
822
822
  }
823
- const H = typeof D.label == "string" || typeof D.label == "number" ? String(D.label) : D.id;
824
- return D.id.toLowerCase().includes(S) || H.toLowerCase().includes(S);
825
- }).map((D) => D.id) : [];
826
- }, [e, h, o]), I = k(
827
- () => new Set(g),
828
- [g]
829
- ), l = k(() => {
830
- const S = o == null ? void 0 : o.trim().toLowerCase();
831
- return S ? r.filter((D) => {
832
- const H = D.label != null ? String(D.label).toLowerCase() : "";
833
- return I.has(D.source) || I.has(D.target) || H.includes(S);
834
- }).map((D) => D.id) : [];
835
- }, [r, I, o]), L = k(() => o != null && o.trim() ? (() => {
823
+ const et = typeof L.label == "string" || typeof L.label == "number" ? String(L.label) : L.id;
824
+ return L.id.toLowerCase().includes(S) || et.toLowerCase().includes(S);
825
+ }).map((L) => L.id) : [];
826
+ }, [e, d, s]), E = M(
827
+ () => new Set(m),
828
+ [m]
829
+ ), l = M(() => {
830
+ const S = s == null ? void 0 : s.trim().toLowerCase();
831
+ return S ? r.filter((L) => {
832
+ const et = L.label != null ? String(L.label).toLowerCase() : "";
833
+ return E.has(L.source) || E.has(L.target) || et.includes(S);
834
+ }).map((L) => L.id) : [];
835
+ }, [r, E, s]), R = M(() => s != null && s.trim() ? (() => {
836
836
  try {
837
- return (T == null ? void 0 : T({
837
+ return (I == null ? void 0 : I({
838
838
  nodes: e,
839
839
  edges: r,
840
- query: o,
841
- matchedNodeIds: g,
840
+ query: s,
841
+ matchedNodeIds: m,
842
842
  matchedEdgeIds: l
843
843
  })) ?? { nodeIds: [], edgeIds: [] };
844
844
  } catch {
845
845
  return { nodeIds: [], edgeIds: [] };
846
846
  }
847
- })() : { nodeIds: [], edgeIds: [] }, [r, T, e, l, g, o]), X = k(
847
+ })() : { nodeIds: [], edgeIds: [] }, [r, I, e, l, m, s]), W = M(
848
848
  () => /* @__PURE__ */ new Set([
849
- ...g,
850
- ...L.nodeIds ?? [],
849
+ ...m,
850
+ ...R.nodeIds ?? [],
851
851
  ...u ?? []
852
852
  ]),
853
- [L.nodeIds, u, g]
854
- ), y = k(
853
+ [R.nodeIds, u, m]
854
+ ), g = M(
855
855
  () => /* @__PURE__ */ new Set([
856
856
  ...l,
857
- ...L.edgeIds ?? [],
858
- ...w ?? []
857
+ ...R.edgeIds ?? [],
858
+ ...b ?? []
859
859
  ]),
860
- [L.edgeIds, w, l]
860
+ [R.edgeIds, b, l]
861
861
  );
862
- te(() => {
862
+ ne(() => {
863
863
  var S;
864
- (S = m.current) == null || S.call(m, {
865
- nodeIds: g,
864
+ (S = p.current) == null || S.call(p, {
865
+ nodeIds: m,
866
866
  edgeIds: l
867
867
  });
868
- }, [l, g]);
869
- const E = k(() => {
868
+ }, [l, m]);
869
+ const _ = M(() => {
870
870
  const S = new Set(i ?? []);
871
- return c && (o != null && o.trim()) && e.forEach((D) => {
872
- X.has(D.id) || S.add(D.id);
871
+ return a && (s != null && s.trim()) && e.forEach((L) => {
872
+ W.has(L.id) || S.add(L.id);
873
873
  }), S;
874
- }, [X, i, c, e, o]), _ = k(() => {
874
+ }, [W, i, a, e, s]), w = M(() => {
875
875
  const S = /* @__PURE__ */ new Map();
876
- return r.forEach((D) => {
877
- S.set(D.source, [...S.get(D.source) ?? [], D.target]);
876
+ return r.forEach((L) => {
877
+ S.set(L.source, [...S.get(L.source) ?? [], L.target]);
878
878
  }), S;
879
- }, [r]), x = k(() => {
880
- const S = new Set(E);
881
- return s.forEach((D) => {
882
- const H = [..._.get(D) ?? []];
883
- for (; H.length; ) {
884
- const it = H.pop();
885
- !it || S.has(it) || (S.add(it), H.push(..._.get(it) ?? []));
879
+ }, [r]), v = M(() => {
880
+ const S = new Set(_);
881
+ return o.forEach((L) => {
882
+ const et = [...w.get(L) ?? []];
883
+ for (; et.length; ) {
884
+ const B = et.pop();
885
+ !B || S.has(B) || (S.add(B), et.push(...w.get(B) ?? []));
886
886
  }
887
887
  }), S;
888
- }, [s, E, _]), G = k(
889
- () => e.filter((S) => !x.has(S.id)),
890
- [x, e]
891
- ), ut = k(
888
+ }, [o, _, w]), H = M(
889
+ () => e.filter((S) => !v.has(S.id)),
890
+ [v, e]
891
+ ), ot = M(
892
892
  () => r.filter(
893
- (S) => !x.has(S.source) && !x.has(S.target)
893
+ (S) => !v.has(S.source) && !v.has(S.target)
894
894
  ),
895
- [x, r]
895
+ [v, r]
896
896
  );
897
897
  return {
898
- effectiveHighlightedNodeSet: X,
899
- effectiveHighlightedEdgeSet: y,
900
- visibleNodes: G,
901
- visibleEdges: ut,
902
- childNodeIdsByParent: _
898
+ effectiveHighlightedNodeSet: W,
899
+ effectiveHighlightedEdgeSet: g,
900
+ visibleNodes: H,
901
+ visibleEdges: ot,
902
+ childNodeIdsByParent: w
903
903
  };
904
- }, Mr = (e) => !!(e && Number.isFinite(e.x) && Number.isFinite(e.y)), he = (e, r, s) => {
905
- const i = new Set(r.map((c) => c.id));
904
+ }, Pr = (e) => !!(e && Number.isFinite(e.x) && Number.isFinite(e.y)), we = (e, r, o) => {
905
+ const i = new Set(r.map((a) => a.id));
906
906
  if (e.length !== r.length)
907
907
  throw new Error(
908
- `${s} must return ${r.length} nodes, received ${e.length}.`
908
+ `${o} must return ${r.length} nodes, received ${e.length}.`
909
909
  );
910
- const o = /* @__PURE__ */ new Set();
911
- e.forEach((c) => {
912
- if (!i.has(c.id))
913
- throw new Error(`${s} returned unknown node id "${c.id}".`);
914
- if (o.has(c.id))
915
- throw new Error(`${s} returned duplicate node id "${c.id}".`);
916
- if (!Mr(c.position))
917
- throw new Error(`${s} returned a non-finite position for node "${c.id}".`);
918
- o.add(c.id);
910
+ const s = /* @__PURE__ */ new Set();
911
+ e.forEach((a) => {
912
+ if (!i.has(a.id))
913
+ throw new Error(`${o} returned unknown node id "${a.id}".`);
914
+ if (s.has(a.id))
915
+ throw new Error(`${o} returned duplicate node id "${a.id}".`);
916
+ if (!Pr(a.position))
917
+ throw new Error(`${o} returned a non-finite position for node "${a.id}".`);
918
+ s.add(a.id);
919
919
  });
920
- }, pe = (e, r, s) => {
920
+ }, xe = (e, r, o) => {
921
921
  const i = /* @__PURE__ */ new Set();
922
- e.forEach((o) => {
923
- if (i.has(o.id))
924
- throw new Error(`${s} returned duplicate edge id "${o.id}".`);
925
- if (!r.has(o.source) || !r.has(o.target))
922
+ e.forEach((s) => {
923
+ if (i.has(s.id))
924
+ throw new Error(`${o} returned duplicate edge id "${s.id}".`);
925
+ if (!r.has(s.source) || !r.has(s.target))
926
926
  throw new Error(
927
- `${s} returned edge "${o.id}" with unknown endpoint(s): ${o.source} -> ${o.target}.`
927
+ `${o} returned edge "${s.id}" with unknown endpoint(s): ${s.source} -> ${s.target}.`
928
928
  );
929
- if (!Array.isArray(o.points) || o.points.length < 2)
930
- throw new Error(`${s} returned edge "${o.id}" without a valid point path.`);
931
- o.points.forEach((c, h) => {
932
- if (!Mr(c))
929
+ if (!Array.isArray(s.points) || s.points.length < 2)
930
+ throw new Error(`${o} returned edge "${s.id}" without a valid point path.`);
931
+ s.points.forEach((a, d) => {
932
+ if (!Pr(a))
933
933
  throw new Error(
934
- `${s} returned a non-finite point at index ${h} for edge "${o.id}".`
934
+ `${o} returned a non-finite point at index ${d} for edge "${s.id}".`
935
935
  );
936
- }), i.add(o.id);
936
+ }), i.add(s.id);
937
937
  });
938
- }, Nt = (e) => e instanceof Error ? e : new Error(String(e)), Er = (e) => er({
938
+ }, wt = (e) => e instanceof Error ? e : new Error(String(e)), yr = (e) => Je({
939
939
  ...e,
940
940
  layout: Me.Centered
941
- }), _r = (e, r) => {
942
- const s = new Map(e.map((i) => [i.id, i]));
941
+ }), gr = (e, r) => {
942
+ const o = new Map(e.map((i) => [i.id, i]));
943
943
  return r.flatMap((i) => {
944
- var v, m, g, I;
945
- const o = s.get(i.source), c = s.get(i.target);
946
- if (!o || !c)
944
+ var y, p, m, E;
945
+ const s = o.get(i.source), a = o.get(i.target);
946
+ if (!s || !a)
947
947
  return [];
948
- const h = ((v = o.size) == null ? void 0 : v.width) ?? 0, u = ((m = o.size) == null ? void 0 : m.height) ?? 0, w = ((g = c.size) == null ? void 0 : g.width) ?? 0, T = ((I = c.size) == null ? void 0 : I.height) ?? 0;
949
- if (o.id === c.id) {
950
- const l = o.position.x + h, L = o.position.y;
948
+ const d = ((y = s.size) == null ? void 0 : y.width) ?? 0, u = ((p = s.size) == null ? void 0 : p.height) ?? 0, b = ((m = a.size) == null ? void 0 : m.width) ?? 0, I = ((E = a.size) == null ? void 0 : E.height) ?? 0;
949
+ if (s.id === a.id) {
950
+ const l = s.position.x + d, R = s.position.y;
951
951
  return [
952
952
  {
953
953
  ...i,
954
- type: i.type ?? vr.Directed,
954
+ type: i.type ?? fr.Directed,
955
955
  points: [
956
- { x: l - Math.min(h * 0.25, 18), y: L + Math.min(u * 0.35, 18) },
957
- { x: l + 28, y: L - 20 },
958
- { x: l + 36, y: L + u / 2 },
959
- { x: l - Math.min(h * 0.25, 18), y: L + u * 0.8 }
956
+ { x: l - Math.min(d * 0.25, 18), y: R + Math.min(u * 0.35, 18) },
957
+ { x: l + 28, y: R - 20 },
958
+ { x: l + 36, y: R + u / 2 },
959
+ { x: l - Math.min(d * 0.25, 18), y: R + u * 0.8 }
960
960
  ]
961
961
  }
962
962
  ];
@@ -964,83 +964,85 @@ const wn = ({
964
964
  return [
965
965
  {
966
966
  ...i,
967
- type: i.type ?? vr.Directed,
967
+ type: i.type ?? fr.Directed,
968
968
  points: [
969
969
  {
970
- x: o.position.x + h / 2,
971
- y: o.position.y + u / 2
970
+ x: s.position.x + d / 2,
971
+ y: s.position.y + u / 2
972
972
  },
973
973
  {
974
- x: c.position.x + w / 2,
975
- y: c.position.y + T / 2
974
+ x: a.position.x + b / 2,
975
+ y: a.position.y + I / 2
976
976
  }
977
977
  ]
978
978
  }
979
979
  ];
980
980
  });
981
- }, In = ({
981
+ }, pn = ({
982
982
  graph: e,
983
983
  config: r,
984
- mergedTheme: s,
984
+ mergedTheme: o,
985
985
  collapsedIds: i,
986
- hiddenNodeIds: o,
987
- searchQuery: c,
988
- hideUnmatchedSearch: h = !1,
986
+ hiddenNodeIds: s,
987
+ searchQuery: a,
988
+ hideUnmatchedSearch: d = !1,
989
989
  searchPredicate: u,
990
- highlightedNodeIds: w,
991
- highlightedEdgeIds: T,
992
- highlightStrategy: v,
993
- onSearchResultsChange: m,
994
- layoutNodesOverride: g,
995
- routeEdgesOverride: I,
990
+ highlightedNodeIds: b,
991
+ highlightedEdgeIds: I,
992
+ highlightStrategy: y,
993
+ onSearchResultsChange: p,
994
+ layoutNodesOverride: m,
995
+ routeEdgesOverride: E,
996
996
  onError: l
997
997
  }) => {
998
- const [L, X] = Et({}), { nodes: y, edges: E } = k(
999
- () => dn(e, r.defaultEdgeType),
1000
- [r.defaultEdgeType, e]
1001
- ), _ = k(
1002
- () => y.map((O) => ({
1003
- ...O,
1004
- measuredSize: L[O.id] ?? O.measuredSize
998
+ const [R, W] = _t({}), { nodes: g, edges: _ } = M(
999
+ () => nn(e, r.defaultEdgeType, {
1000
+ inputValidationMode: r.inputValidationMode
1001
+ }),
1002
+ [r.defaultEdgeType, r.inputValidationMode, e]
1003
+ ), w = r.failureBehavior === "degrade", v = M(
1004
+ () => g.map((A) => ({
1005
+ ...A,
1006
+ measuredSize: R[A.id] ?? A.measuredSize
1005
1007
  })),
1006
- [L, y]
1008
+ [R, g]
1007
1009
  );
1008
- te(() => {
1009
- const O = new Set(y.map((A) => A.id));
1010
- X((A) => {
1011
- const Y = Object.entries(A).filter(([J]) => O.has(J));
1012
- return Y.length === Object.keys(A).length ? A : Object.fromEntries(Y);
1010
+ ne(() => {
1011
+ const A = new Set(g.map((O) => O.id));
1012
+ W((O) => {
1013
+ const F = Object.entries(O).filter(([G]) => A.has(G));
1014
+ return F.length === Object.keys(O).length ? O : Object.fromEntries(F);
1013
1015
  });
1014
- }, [y]);
1015
- const x = k(
1016
- () => E.map((O) => ({
1017
- ...O,
1018
- type: O.type ?? r.defaultEdgeType
1016
+ }, [g]);
1017
+ const H = M(
1018
+ () => _.map((A) => ({
1019
+ ...A,
1020
+ type: A.type ?? r.defaultEdgeType
1019
1021
  })),
1020
- [r.defaultEdgeType, E]
1022
+ [r.defaultEdgeType, _]
1021
1023
  ), {
1022
- effectiveHighlightedNodeSet: G,
1024
+ effectiveHighlightedNodeSet: ot,
1023
1025
  effectiveHighlightedEdgeSet: ut,
1024
- visibleNodes: rt,
1025
- visibleEdges: S,
1026
- childNodeIdsByParent: D
1027
- } = bn({
1028
- nodes: _,
1029
- edges: x,
1026
+ visibleNodes: S,
1027
+ visibleEdges: L,
1028
+ childNodeIdsByParent: et
1029
+ } = hn({
1030
+ nodes: v,
1031
+ edges: H,
1030
1032
  collapsedIds: i,
1031
- hiddenNodeIds: o,
1032
- searchQuery: c,
1033
- hideUnmatchedSearch: h,
1033
+ hiddenNodeIds: s,
1034
+ searchQuery: a,
1035
+ hideUnmatchedSearch: d,
1034
1036
  searchPredicate: u,
1035
- highlightedNodeIds: w,
1036
- highlightedEdgeIds: T,
1037
- highlightStrategy: v,
1038
- onSearchResultsChange: m
1039
- }), H = k(
1037
+ highlightedNodeIds: b,
1038
+ highlightedEdgeIds: I,
1039
+ highlightStrategy: y,
1040
+ onSearchResultsChange: p
1041
+ }), B = M(
1040
1042
  () => ({
1041
- nodes: rt,
1042
- edges: S,
1043
- theme: s,
1043
+ nodes: S,
1044
+ edges: L,
1045
+ theme: o,
1044
1046
  padding: r.padding,
1045
1047
  layout: r.layout,
1046
1048
  width: r.width,
@@ -1053,65 +1055,67 @@ const wn = ({
1053
1055
  labelMeasurementCharWidth: r.labelMeasurementCharWidth,
1054
1056
  labelMeasurementLineHeight: r.labelMeasurementLineHeight
1055
1057
  }),
1056
- [r, s, S, rt]
1057
- ), it = K(
1058
- (O, A) => {
1059
- r.nodeSizing === "measured" && X((Y) => {
1060
- const J = Y[O];
1061
- return J && J.width === A.width && J.height === A.height ? Y : {
1062
- ...Y,
1063
- [O]: A
1058
+ [r, o, L, S]
1059
+ ), C = J(
1060
+ (A, O) => {
1061
+ r.nodeSizing === "measured" && W((F) => {
1062
+ const G = F[A];
1063
+ return G && G.width === O.width && G.height === O.height ? F : {
1064
+ ...F,
1065
+ [A]: O
1064
1066
  };
1065
1067
  });
1066
1068
  },
1067
1069
  [r.nodeSizing]
1068
- ), q = k(
1070
+ ), Y = M(
1069
1071
  () => {
1070
- if (!g)
1072
+ if (!m)
1071
1073
  try {
1072
- const O = er(H);
1073
- return he(O, rt, "layout"), O;
1074
- } catch (O) {
1075
- l == null || l(Nt(O), {
1074
+ const A = Je(B);
1075
+ return we(A, S, "layout"), A;
1076
+ } catch (A) {
1077
+ if (l == null || l(wt(A), {
1076
1078
  graph: e,
1077
1079
  phase: "layout"
1078
- });
1080
+ }), !w)
1081
+ throw wt(A);
1079
1082
  try {
1080
- const A = Er(H);
1081
- return he(A, rt, "layout"), A;
1082
- } catch (A) {
1083
- const Y = Nt(A);
1084
- throw l == null || l(Y, {
1083
+ const O = yr(B);
1084
+ return we(O, S, "layout"), O;
1085
+ } catch (O) {
1086
+ const F = wt(O);
1087
+ throw l == null || l(F, {
1085
1088
  graph: e,
1086
1089
  phase: "layout"
1087
- }), Y;
1090
+ }), F;
1088
1091
  }
1089
1092
  }
1090
1093
  try {
1091
- const O = g(H);
1092
- return he(O, rt, "layout override"), O;
1093
- } catch (O) {
1094
- l == null || l(Nt(O), {
1094
+ const A = m(B);
1095
+ return we(A, S, "layout override"), A;
1096
+ } catch (A) {
1097
+ if (l == null || l(wt(A), {
1095
1098
  graph: e,
1096
1099
  phase: "layout-override"
1097
- });
1100
+ }), !w)
1101
+ throw wt(A);
1098
1102
  try {
1099
- const A = er(H);
1100
- return he(A, rt, "layout"), A;
1101
- } catch (A) {
1102
- l == null || l(Nt(A), { graph: e, phase: "layout" });
1103
+ const O = Je(B);
1104
+ return we(O, S, "layout"), O;
1105
+ } catch (O) {
1106
+ l == null || l(wt(O), { graph: e, phase: "layout" });
1103
1107
  try {
1104
- const Y = Er(H);
1105
- return he(Y, rt, "layout"), Y;
1106
- } catch (Y) {
1107
- const J = Nt(Y);
1108
- throw l == null || l(J, { graph: e, phase: "layout" }), J;
1108
+ const F = yr(B);
1109
+ return we(F, S, "layout"), F;
1110
+ } catch (F) {
1111
+ const G = wt(F);
1112
+ throw l == null || l(G, { graph: e, phase: "layout" }), G;
1109
1113
  }
1110
1114
  }
1111
1115
  }
1112
1116
  },
1113
- [e, g, H, l, rt]
1114
- ), V = k(
1117
+ [e, m, B, l, S]
1118
+ ), U = M(
1115
1119
  () => ({
1116
1120
  arrowPadding: r.arrowPadding,
1117
1121
  straight: !r.curveEdges || r.routingStyle === "orthogonal",
@@ -1122,206 +1126,286 @@ const wn = ({
1122
1126
  selfLoopRadius: r.selfLoopRadius
1123
1127
  }),
1124
1128
  [r]
1125
- ), at = k(
1129
+ ), it = M(
1126
1130
  () => {
1127
- const O = new Set(q.map((A) => A.id));
1128
- if (!I)
1131
+ const A = new Set(Y.map((O) => O.id));
1132
+ if (!E)
1129
1133
  try {
1130
- const A = xr(q, S, V);
1131
- return pe(A, O, "routing"), A;
1132
- } catch (A) {
1133
- l == null || l(Nt(A), {
1134
+ const O = dr(Y, L, U);
1135
+ return xe(O, A, "routing"), O;
1136
+ } catch (O) {
1137
+ if (l == null || l(wt(O), {
1134
1138
  graph: e,
1135
1139
  phase: "routing"
1136
- });
1137
- const Y = _r(q, S);
1138
- return pe(Y, O, "routing"), Y;
1140
+ }), !w)
1141
+ throw wt(O);
1142
+ const F = gr(Y, L);
1143
+ return xe(F, A, "routing"), F;
1139
1144
  }
1140
1145
  try {
1141
- const A = I(q, S, V);
1142
- return pe(A, O, "routing override"), A;
1143
- } catch (A) {
1144
- l == null || l(Nt(A), {
1146
+ const O = E(Y, L, U);
1147
+ return xe(O, A, "routing override"), O;
1148
+ } catch (O) {
1149
+ if (l == null || l(wt(O), {
1145
1150
  graph: e,
1146
1151
  phase: "routing-override"
1147
- });
1152
+ }), !w)
1153
+ throw wt(O);
1148
1154
  try {
1149
- const Y = xr(q, S, V);
1150
- return pe(Y, O, "routing"), Y;
1151
- } catch (Y) {
1152
- l == null || l(Nt(Y), { graph: e, phase: "routing" });
1153
- const J = _r(q, S);
1154
- return pe(J, O, "routing"), J;
1155
+ const F = dr(Y, L, U);
1156
+ return xe(F, A, "routing"), F;
1157
+ } catch (F) {
1158
+ l == null || l(wt(F), { graph: e, phase: "routing" });
1159
+ const G = gr(Y, L);
1160
+ return xe(G, A, "routing"), G;
1155
1161
  }
1156
1162
  }
1157
1163
  },
1158
1164
  [
1159
- V,
1165
+ U,
1160
1166
  e,
1161
1167
  l,
1162
- q,
1163
- I,
1164
- S
1168
+ w,
1169
+ Y,
1170
+ E,
1171
+ L
1165
1172
  ]
1166
1173
  );
1167
1174
  return {
1168
- childNodeIdsByParent: D,
1175
+ childNodeIdsByParent: et,
1169
1176
  effectiveHighlightedEdgeSet: ut,
1170
- effectiveHighlightedNodeSet: G,
1171
- handleNodeMeasure: it,
1172
- positionedEdges: at,
1173
- positionedNodes: q,
1174
- visibleEdges: S,
1175
- visibleNodesWithMeasuredSize: rt
1177
+ effectiveHighlightedNodeSet: ot,
1178
+ handleNodeMeasure: C,
1179
+ positionedEdges: it,
1180
+ positionedNodes: Y,
1181
+ visibleEdges: L,
1182
+ visibleNodesWithMeasuredSize: S
1176
1183
  };
1177
- }, Tr = (e) => Object.prototype.toString.call(e) === "[object Object]", nr = (e, r, s) => {
1184
+ }, Rr = 180, Sr = 72, Ae = (e, r, o) => Math.min(Math.max(e, r), o), mn = (e) => e.length ? e.reduce(
1185
+ (o, i) => {
1186
+ var y, p;
1187
+ const s = ((y = i.size) == null ? void 0 : y.width) ?? Rr, a = ((p = i.size) == null ? void 0 : p.height) ?? Sr, d = Math.min(o.minX, i.position.x), u = Math.min(o.minY, i.position.y), b = Math.max(o.maxX, i.position.x + s), I = Math.max(o.maxY, i.position.y + a);
1188
+ return {
1189
+ minX: d,
1190
+ minY: u,
1191
+ maxX: b,
1192
+ maxY: I,
1193
+ width: b - d,
1194
+ height: I - u
1195
+ };
1196
+ },
1197
+ {
1198
+ minX: Number.POSITIVE_INFINITY,
1199
+ minY: Number.POSITIVE_INFINITY,
1200
+ maxX: Number.NEGATIVE_INFINITY,
1201
+ maxY: Number.NEGATIVE_INFINITY,
1202
+ width: 0,
1203
+ height: 0
1204
+ }
1205
+ ) : null, yn = (e, r, o, i, s, a) => {
1206
+ if (!e || r <= 0 || o <= 0)
1207
+ return { x: 0, y: 0, zoom: 1 };
1208
+ const d = Math.max(e.width, 1), u = Math.max(e.height, 1), b = Math.max(r - i * 2, 1), I = Math.max(o - i * 2, 1), y = Ae(
1209
+ Math.min(b / d, I / u),
1210
+ s,
1211
+ a
1212
+ );
1213
+ return {
1214
+ x: i + (b - d * y) / 2 - e.minX * y,
1215
+ y: i + (I - u * y) / 2 - e.minY * y,
1216
+ zoom: y
1217
+ };
1218
+ }, gn = (e, r, o, i) => {
1219
+ var b, I;
1220
+ const s = ((b = e.size) == null ? void 0 : b.width) ?? Rr, a = ((I = e.size) == null ? void 0 : I.height) ?? Sr, d = e.position.x + s / 2, u = e.position.y + a / 2;
1221
+ return {
1222
+ x: r / 2 - d * i,
1223
+ y: o / 2 - u * i,
1224
+ zoom: i
1225
+ };
1226
+ }, vn = { x: 0, y: 0, zoom: 1 }, Be = (e, r, o) => ({
1227
+ x: Number.isFinite(e.x) ? e.x : 0,
1228
+ y: Number.isFinite(e.y) ? e.y : 0,
1229
+ zoom: Ae(Number.isFinite(e.zoom) ? e.zoom : 1, r, o)
1230
+ }), wn = ({
1231
+ controlledViewport: e,
1232
+ defaultViewport: r,
1233
+ safeMinZoom: o,
1234
+ safeMaxZoom: i,
1235
+ onViewportChange: s,
1236
+ selectedNodeIds: a,
1237
+ selectedEdgeIds: d,
1238
+ defaultSelectedNodeIds: u,
1239
+ defaultSelectedEdgeIds: b,
1240
+ onSelectionChange: I,
1241
+ controlledFocusedNodeId: y,
1242
+ defaultFocusedNodeId: p,
1243
+ onFocusedNodeChange: m
1244
+ }) => {
1245
+ const [E, l] = _t(
1246
+ () => Be(
1247
+ { ...vn, ...r ?? {} },
1248
+ o,
1249
+ i
1250
+ )
1251
+ ), [R, W] = _t({
1252
+ nodeIds: u ?? [],
1253
+ edgeIds: b ?? []
1254
+ }), [g, _] = _t(
1255
+ p
1256
+ ), w = M(
1257
+ () => Be(e ?? E, o, i),
1258
+ [e, E, i, o]
1259
+ ), v = pt(w);
1260
+ v.current = w;
1261
+ const H = pt(s);
1262
+ H.current = s;
1263
+ const ot = M(
1264
+ () => ({
1265
+ nodeIds: a ?? R.nodeIds,
1266
+ edgeIds: d ?? R.edgeIds
1267
+ }),
1268
+ [a, d, R]
1269
+ ), ut = pt(ot);
1270
+ ut.current = ot;
1271
+ const S = y !== void 0 ? y : g, L = J(
1272
+ (C) => {
1273
+ var A;
1274
+ const Y = v.current, U = typeof C == "function" ? C(Y) : C, it = Be({ ...Y, ...U }, o, i);
1275
+ e || l(it), (A = H.current) == null || A.call(H, it);
1276
+ },
1277
+ [e, i, o]
1278
+ ), et = J(
1279
+ (C) => {
1280
+ const Y = ut.current, U = typeof C == "function" ? C(Y) : C;
1281
+ (a == null || d == null) && W((it) => ({
1282
+ nodeIds: a == null ? U.nodeIds : it.nodeIds,
1283
+ edgeIds: d == null ? U.edgeIds : it.edgeIds
1284
+ })), I == null || I(U);
1285
+ },
1286
+ [I, d, a]
1287
+ ), B = J(
1288
+ (C) => {
1289
+ y === void 0 && _(C), m == null || m(C);
1290
+ },
1291
+ [y, m]
1292
+ );
1293
+ return {
1294
+ viewport: w,
1295
+ viewportRef: v,
1296
+ selection: ot,
1297
+ selectionRef: ut,
1298
+ focusedNodeId: S,
1299
+ updateViewport: L,
1300
+ updateSelection: et,
1301
+ updateFocusedNode: B
1302
+ };
1303
+ }, vr = (e) => Object.prototype.toString.call(e) === "[object Object]", Qe = (e, r, o) => {
1178
1304
  if (Object.is(e, r))
1179
1305
  return !0;
1180
1306
  if (typeof e == "function" || typeof r == "function" || !e || !r || typeof e != "object" || typeof r != "object")
1181
1307
  return !1;
1182
- const i = s.get(e);
1308
+ const i = o.get(e);
1183
1309
  if (i != null && i.has(r))
1184
1310
  return !0;
1185
1311
  if (Array.isArray(e) || Array.isArray(r)) {
1186
1312
  if (!Array.isArray(e) || !Array.isArray(r) || e.length !== r.length)
1187
1313
  return !1;
1188
- i ? i.add(r) : s.set(e, new WeakSet([r]));
1189
- for (let h = 0; h < e.length; h += 1)
1190
- if (!nr(e[h], r[h], s))
1314
+ i ? i.add(r) : o.set(e, new WeakSet([r]));
1315
+ for (let d = 0; d < e.length; d += 1)
1316
+ if (!Qe(e[d], r[d], o))
1191
1317
  return !1;
1192
1318
  return !0;
1193
1319
  }
1194
- if (!Tr(e) || !Tr(r))
1320
+ if (!vr(e) || !vr(r))
1195
1321
  return !1;
1196
- i ? i.add(r) : s.set(e, new WeakSet([r]));
1197
- const o = Object.keys(e), c = Object.keys(r);
1198
- if (o.length !== c.length)
1322
+ i ? i.add(r) : o.set(e, new WeakSet([r]));
1323
+ const s = Object.keys(e), a = Object.keys(r);
1324
+ if (s.length !== a.length)
1199
1325
  return !1;
1200
- for (const h of o)
1201
- if (!(h in r) || !nr(e[h], r[h], s))
1326
+ for (const d of s)
1327
+ if (!(d in r) || !Qe(e[d], r[d], o))
1202
1328
  return !1;
1203
1329
  return !0;
1204
1330
  };
1205
- function En(e) {
1331
+ function xn(e) {
1206
1332
  const r = pt(null);
1207
- return (r.current === null || !nr(r.current, e, /* @__PURE__ */ new WeakMap())) && (r.current = e), r.current;
1333
+ return (r.current === null || !Qe(r.current, e, /* @__PURE__ */ new WeakMap())) && (r.current = e), r.current;
1208
1334
  }
1209
- const _n = 180, Tn = 24, Ar = (e) => {
1335
+ const bn = 180, In = 24, Lr = (e) => {
1210
1336
  var r;
1211
- return ((r = e.size) == null ? void 0 : r.width) ?? _n;
1212
- }, He = (e) => e.position.x + Ar(e) / 2, jr = (e, r = Tn) => {
1213
- const s = [...e].sort((o, c) => He(o) - He(c)), i = [];
1214
- return s.forEach((o) => {
1215
- const c = He(o), h = Ar(o), u = i[i.length - 1];
1337
+ return ((r = e.size) == null ? void 0 : r.width) ?? bn;
1338
+ }, Ce = (e) => e.position.x + Lr(e) / 2, kr = (e, r = In) => {
1339
+ const o = [...e].sort((s, a) => Ce(s) - Ce(a)), i = [];
1340
+ return o.forEach((s) => {
1341
+ const a = Ce(s), d = Lr(s), u = i[i.length - 1];
1216
1342
  if (!u) {
1217
- i.push({ centerX: c, avgWidth: h, nodes: [o] });
1343
+ i.push({ centerX: a, avgWidth: d, nodes: [s] });
1218
1344
  return;
1219
1345
  }
1220
- const w = Math.max(r, Math.min(u.avgWidth, h) * 0.35);
1221
- if (Math.abs(c - u.centerX) > w) {
1222
- i.push({ centerX: c, avgWidth: h, nodes: [o] });
1346
+ const b = Math.max(r, Math.min(u.avgWidth, d) * 0.35);
1347
+ if (Math.abs(a - u.centerX) > b) {
1348
+ i.push({ centerX: a, avgWidth: d, nodes: [s] });
1223
1349
  return;
1224
1350
  }
1225
- u.nodes.push(o);
1226
- const T = u.nodes.length;
1227
- u.centerX = (u.centerX * (T - 1) + c) / T, u.avgWidth = (u.avgWidth * (T - 1) + h) / T;
1228
- }), i.map((o) => ({
1229
- centerX: o.centerX,
1230
- nodes: [...o.nodes].sort((c, h) => c.position.y - h.position.y)
1351
+ u.nodes.push(s);
1352
+ const I = u.nodes.length;
1353
+ u.centerX = (u.centerX * (I - 1) + a) / I, u.avgWidth = (u.avgWidth * (I - 1) + d) / I;
1354
+ }), i.map((s) => ({
1355
+ centerX: s.centerX,
1356
+ nodes: [...s.nodes].sort((a, d) => a.position.y - d.position.y)
1231
1357
  }));
1232
- }, Dr = 180, zr = 72, Ae = (e, r, s) => Math.min(Math.max(e, r), s), Pn = (e) => e.length ? e.reduce(
1233
- (s, i) => {
1234
- var v, m;
1235
- const o = ((v = i.size) == null ? void 0 : v.width) ?? Dr, c = ((m = i.size) == null ? void 0 : m.height) ?? zr, h = Math.min(s.minX, i.position.x), u = Math.min(s.minY, i.position.y), w = Math.max(s.maxX, i.position.x + o), T = Math.max(s.maxY, i.position.y + c);
1236
- return {
1237
- minX: h,
1238
- minY: u,
1239
- maxX: w,
1240
- maxY: T,
1241
- width: w - h,
1242
- height: T - u
1243
- };
1244
- },
1245
- {
1246
- minX: Number.POSITIVE_INFINITY,
1247
- minY: Number.POSITIVE_INFINITY,
1248
- maxX: Number.NEGATIVE_INFINITY,
1249
- maxY: Number.NEGATIVE_INFINITY,
1250
- width: 0,
1251
- height: 0
1252
- }
1253
- ) : null, Rn = (e, r, s, i, o, c) => {
1254
- if (!e || r <= 0 || s <= 0)
1255
- return { x: 0, y: 0, zoom: 1 };
1256
- const h = Math.max(e.width, 1), u = Math.max(e.height, 1), w = Math.max(r - i * 2, 1), T = Math.max(s - i * 2, 1), v = Ae(
1257
- Math.min(w / h, T / u),
1258
- o,
1259
- c
1260
- );
1261
- return {
1262
- x: i + (w - h * v) / 2 - e.minX * v,
1263
- y: i + (T - u * v) / 2 - e.minY * v,
1264
- zoom: v
1265
- };
1266
- }, Sn = (e, r, s, i) => {
1267
- var w, T;
1268
- const o = ((w = e.size) == null ? void 0 : w.width) ?? Dr, c = ((T = e.size) == null ? void 0 : T.height) ?? zr, h = e.position.x + o / 2, u = e.position.y + c / 2;
1269
- return {
1270
- x: r / 2 - h * i,
1271
- y: s / 2 - u * i,
1272
- zoom: i
1273
- };
1274
- }, Ln = re.memo(function({
1358
+ }, En = oe.memo(function({
1275
1359
  edge: r,
1276
- color: s,
1360
+ color: o,
1277
1361
  width: i,
1278
- curveEdges: o,
1279
- curveStrength: c,
1280
- markerEnd: h,
1362
+ curveEdges: s,
1363
+ curveStrength: a,
1364
+ markerEnd: d,
1281
1365
  isHovered: u,
1282
- isSelected: w,
1283
- hoverColor: T,
1284
- selectionColor: v,
1285
- labelColor: m,
1286
- selectionMarker: g,
1287
- hoverMarker: I,
1366
+ isSelected: b,
1367
+ hoverColor: I,
1368
+ selectionColor: y,
1369
+ labelColor: p,
1370
+ selectionMarker: m,
1371
+ hoverMarker: E,
1288
1372
  hoverEnabled: l,
1289
- hoverStrokeWidth: L,
1290
- selectedStrokeWidth: X,
1291
- hitStrokeWidth: y,
1292
- onHoverChange: E,
1293
- onClick: _
1373
+ hoverStrokeWidth: R,
1374
+ selectedStrokeWidth: W,
1375
+ hitStrokeWidth: g,
1376
+ onHoverChange: _,
1377
+ onClick: w
1294
1378
  }) {
1295
- const x = hn(r, o, c);
1296
- if (!x) return null;
1297
- const G = u ? T : w ? v ?? T : s, ut = u ? L ?? i : w ? X ?? i + 1 : i, rt = u ? I ?? g ?? h : w ? g ?? h : h, S = r.label != null && r.labelPosition ? String(r.label) : null;
1298
- return /* @__PURE__ */ N.jsxs(N.Fragment, { children: [
1299
- /* @__PURE__ */ N.jsx(
1379
+ const v = on(r, s, a);
1380
+ if (!v) return null;
1381
+ const H = u ? I : b ? y ?? I : o, ot = u ? R ?? i : b ? W ?? i + 1 : i, ut = u ? E ?? m ?? d : b ? m ?? d : d, S = r.label != null && r.labelPosition ? String(r.label) : null;
1382
+ return /* @__PURE__ */ z.jsxs(z.Fragment, { children: [
1383
+ /* @__PURE__ */ z.jsx(
1300
1384
  "path",
1301
1385
  {
1302
- d: x,
1386
+ d: v,
1303
1387
  stroke: "transparent",
1304
- strokeWidth: y ?? i + 8,
1388
+ strokeWidth: g ?? i + 8,
1305
1389
  fill: "none",
1306
1390
  pointerEvents: "stroke",
1307
1391
  "data-graph-edge-interactive": "true",
1308
- onMouseEnter: () => l && (E == null ? void 0 : E(!0)),
1309
- onMouseLeave: () => l && (E == null ? void 0 : E(!1)),
1310
- onClick: _
1392
+ onMouseEnter: () => l && (_ == null ? void 0 : _(!0)),
1393
+ onMouseLeave: () => l && (_ == null ? void 0 : _(!1)),
1394
+ onClick: w
1311
1395
  }
1312
1396
  ),
1313
- /* @__PURE__ */ N.jsx(
1397
+ /* @__PURE__ */ z.jsx(
1314
1398
  "path",
1315
1399
  {
1316
- d: x,
1317
- stroke: G,
1318
- strokeWidth: ut,
1400
+ d: v,
1401
+ stroke: H,
1402
+ strokeWidth: ot,
1319
1403
  fill: "none",
1320
- markerEnd: r.type === "directed" ? rt : void 0,
1404
+ markerEnd: r.type === "directed" ? ut : void 0,
1321
1405
  pointerEvents: "none"
1322
1406
  }
1323
1407
  ),
1324
- S && r.labelPosition ? /* @__PURE__ */ N.jsx(
1408
+ S && r.labelPosition ? /* @__PURE__ */ z.jsx(
1325
1409
  "text",
1326
1410
  {
1327
1411
  x: r.labelPosition.x,
@@ -1329,220 +1413,220 @@ const _n = 180, Tn = 24, Ar = (e) => {
1329
1413
  textAnchor: "middle",
1330
1414
  fontSize: 12,
1331
1415
  fontWeight: 600,
1332
- fill: m ?? "#334155",
1416
+ fill: p ?? "#334155",
1333
1417
  pointerEvents: "none",
1334
1418
  children: S
1335
1419
  }
1336
1420
  ) : null
1337
1421
  ] });
1338
- }), kn = 64, ee = 20, Pr = 8, On = 12, Mn = 7, An = 48, jn = 12, Dn = 700;
1339
- function Nr(e) {
1340
- const r = Math.min(Array.from(e).length, An);
1422
+ }), _n = 64, ie = 20, wr = 8, Tn = 12, Pn = 7, Rn = 48, Sn = 12, Ln = 700;
1423
+ function Or(e) {
1424
+ const r = Math.min(Array.from(e).length, Rn);
1341
1425
  return Math.max(
1342
- kn,
1343
- r * Mn + On * 2
1426
+ _n,
1427
+ r * Pn + Tn * 2
1344
1428
  );
1345
1429
  }
1346
- function Fr(e, r, s, i, o = !1) {
1347
- const c = jr(e), h = c.map((g) => g.centerX);
1348
- if (!h.length)
1430
+ function Mr(e, r, o, i, s = !1) {
1431
+ const a = kr(e), d = a.map((m) => m.centerX);
1432
+ if (!d.length)
1349
1433
  return { orderedXs: [], orderedLabels: [] };
1350
- const w = c.map((g) => g.nodes.length).map((g) => {
1351
- const I = g * 2;
1352
- return I <= 2 ? "Final" : `1/${I}`;
1353
- }), T = i && i.length ? i : o ? w : [], v = r === Me.Tree && s === tr.RTL ? [...h].reverse() : h, m = r === Me.Tree && s === tr.RTL ? [...T].reverse() : T;
1354
- return { orderedXs: v, orderedLabels: m };
1434
+ const b = a.map((m) => m.nodes.length).map((m) => {
1435
+ const E = m * 2;
1436
+ return E <= 2 ? "Final" : `1/${E}`;
1437
+ }), I = i && i.length ? i : s ? b : [], y = r === Me.Tree && o === qe.RTL ? [...d].reverse() : d, p = r === Me.Tree && o === qe.RTL ? [...I].reverse() : I;
1438
+ return { orderedXs: y, orderedLabels: p };
1355
1439
  }
1356
- function zn({
1440
+ function kn({
1357
1441
  positionedNodes: e,
1358
1442
  layout: r,
1359
- layoutDirection: s,
1443
+ layoutDirection: o,
1360
1444
  labels: i,
1361
- autoLabels: o,
1362
- labelOffset: c,
1363
- pillBackground: h = "#eef1f6",
1445
+ autoLabels: s,
1446
+ labelOffset: a,
1447
+ pillBackground: d = "#eef1f6",
1364
1448
  pillBorderColor: u = "#d7dbe3",
1365
- pillTextColor: w = "#3f434b"
1449
+ pillTextColor: b = "#3f434b"
1366
1450
  }) {
1367
- const { orderedXs: T, orderedLabels: v } = Fr(
1451
+ const { orderedXs: I, orderedLabels: y } = Mr(
1368
1452
  e,
1369
1453
  r,
1370
- s,
1454
+ o,
1371
1455
  i,
1372
- o
1456
+ s
1373
1457
  );
1374
- if (!T.length || !v.length) return null;
1375
- const g = e.reduce(
1376
- (I, l) => Math.min(I, l.position.y),
1458
+ if (!I.length || !y.length) return null;
1459
+ const m = e.reduce(
1460
+ (E, l) => Math.min(E, l.position.y),
1377
1461
  Number.POSITIVE_INFINITY
1378
- ) - c;
1379
- return /* @__PURE__ */ N.jsx("g", { "aria-label": "labels", children: T.map((I, l) => {
1380
- const L = v[l] ?? "", X = Nr(L), y = I;
1381
- return /* @__PURE__ */ N.jsxs(
1462
+ ) - a;
1463
+ return /* @__PURE__ */ z.jsx("g", { "aria-label": "labels", children: I.map((E, l) => {
1464
+ const R = y[l] ?? "", W = Or(R), g = E;
1465
+ return /* @__PURE__ */ z.jsxs(
1382
1466
  "g",
1383
1467
  {
1384
- transform: `translate(${y - X / 2}, ${g - ee + 6})`,
1468
+ transform: `translate(${g - W / 2}, ${m - ie + 6})`,
1385
1469
  children: [
1386
- /* @__PURE__ */ N.jsx(
1470
+ /* @__PURE__ */ z.jsx(
1387
1471
  "rect",
1388
1472
  {
1389
- width: X,
1390
- height: ee,
1391
- rx: Pr,
1392
- ry: Pr,
1393
- fill: h,
1473
+ width: W,
1474
+ height: ie,
1475
+ rx: wr,
1476
+ ry: wr,
1477
+ fill: d,
1394
1478
  stroke: u,
1395
1479
  strokeWidth: 1
1396
1480
  }
1397
1481
  ),
1398
- /* @__PURE__ */ N.jsx(
1482
+ /* @__PURE__ */ z.jsx(
1399
1483
  "text",
1400
1484
  {
1401
- x: X / 2,
1402
- y: ee / 2 + 4,
1403
- fill: w,
1404
- fontSize: jn,
1405
- fontWeight: Dn,
1485
+ x: W / 2,
1486
+ y: ie / 2 + 4,
1487
+ fill: b,
1488
+ fontSize: Sn,
1489
+ fontWeight: Ln,
1406
1490
  textAnchor: "middle",
1407
- children: L
1491
+ children: R
1408
1492
  }
1409
1493
  )
1410
1494
  ]
1411
1495
  },
1412
- `col-${I}`
1496
+ `col-${E}`
1413
1497
  );
1414
1498
  }) });
1415
1499
  }
1416
- const Nn = typeof window > "u" ? te : an, Yr = re.memo(
1500
+ const On = typeof window > "u" ? ne : Zr, Ar = oe.memo(
1417
1501
  ({
1418
1502
  node: e,
1419
1503
  Vertex: r,
1420
- isSelected: s,
1504
+ isSelected: o,
1421
1505
  isFocused: i,
1422
- selectionColor: o,
1423
- isHighlighted: c,
1424
- activePathKey: h,
1506
+ selectionColor: s,
1507
+ isHighlighted: a,
1508
+ activePathKey: d,
1425
1509
  activePathNodeIds: u,
1426
- highlightColor: w,
1427
- nodeBorderColor: T,
1428
- nodeBorderWidth: v,
1429
- hoverNodeBorderColor: m,
1430
- hoverNodeBothColor: g,
1431
- hoverNodeInColor: I,
1510
+ highlightColor: b,
1511
+ nodeBorderColor: I,
1512
+ nodeBorderWidth: y,
1513
+ hoverNodeBorderColor: p,
1514
+ hoverNodeBothColor: m,
1515
+ hoverNodeInColor: E,
1432
1516
  hoverNodeOutColor: l,
1433
- hoverNodeHighlight: L,
1434
- hoveredNodeStates: X,
1435
- onNodeMeasure: y,
1436
- onNodeFocus: E,
1437
- onNodeClick: _,
1438
- onNodeDoubleClick: x,
1439
- onNodeMouseEnter: G,
1440
- onNodeMouseLeave: ut,
1441
- onPathHover: rt,
1517
+ hoverNodeHighlight: R,
1518
+ hoveredNodeStates: W,
1519
+ onNodeMeasure: g,
1520
+ onNodeFocus: _,
1521
+ onNodeClick: w,
1522
+ onNodeDoubleClick: v,
1523
+ onNodeMouseEnter: H,
1524
+ onNodeMouseLeave: ot,
1525
+ onPathHover: ut,
1442
1526
  onPathLeave: S
1443
1527
  }) => {
1444
- var Ft, Kt;
1445
- const D = pt(null), H = ((Ft = e.size) == null ? void 0 : Ft.width) ?? 180, it = ((Kt = e.size) == null ? void 0 : Kt.height) ?? 72, q = 8, V = X == null ? void 0 : X.get(e.id), at = (V == null ? void 0 : V.in) ?? !1, O = (V == null ? void 0 : V.out) ?? !1, A = at && O, Y = at || O, J = !!T && v > 0 || s;
1446
- let dt = T;
1447
- s ? dt = o : c ? dt = w : J ? L && (A ? dt = g : O ? dt = l : at ? dt = I : Y && (dt = m)) : dt = "none";
1448
- let jt = 0;
1449
- s || c ? jt = 1 : J && (jt = L && Y ? 1 : 0.4), Nn(() => {
1450
- if (!D.current || !y)
1528
+ var Wt, Vt;
1529
+ const L = pt(null), et = ((Wt = e.size) == null ? void 0 : Wt.width) ?? 180, B = ((Vt = e.size) == null ? void 0 : Vt.height) ?? 72, C = 8, Y = W == null ? void 0 : W.get(e.id), U = (Y == null ? void 0 : Y.in) ?? !1, it = (Y == null ? void 0 : Y.out) ?? !1, A = U && it, O = U || it, F = !!I && y > 0 || o;
1530
+ let G = I;
1531
+ o ? G = s : a ? G = b : F ? R && (A ? G = m : it ? G = l : U ? G = E : O && (G = p)) : G = "none";
1532
+ let zt = 0;
1533
+ o || a ? zt = 1 : F && (zt = R && O ? 1 : 0.4), On(() => {
1534
+ if (!L.current || !g)
1451
1535
  return;
1452
- const ot = () => {
1453
- H > 0 && it > 0 && y(e.id, { width: Math.ceil(H), height: Math.ceil(it) });
1454
- }, Q = requestAnimationFrame(() => {
1455
- var Lt, Tt;
1536
+ const lt = () => {
1537
+ et > 0 && B > 0 && g(e.id, { width: Math.ceil(et), height: Math.ceil(B) });
1538
+ }, rt = requestAnimationFrame(() => {
1539
+ var Ot, Tt;
1456
1540
  try {
1457
- if (typeof ((Lt = D.current) == null ? void 0 : Lt.getBBox) != "function") {
1458
- ot();
1541
+ if (typeof ((Ot = L.current) == null ? void 0 : Ot.getBBox) != "function") {
1542
+ lt();
1459
1543
  return;
1460
1544
  }
1461
- const mt = (Tt = D.current) == null ? void 0 : Tt.getBBox();
1545
+ const mt = (Tt = L.current) == null ? void 0 : Tt.getBBox();
1462
1546
  if (mt && mt.width > 0 && mt.height > 0) {
1463
- y(e.id, {
1547
+ g(e.id, {
1464
1548
  width: Math.ceil(mt.width),
1465
1549
  height: Math.ceil(mt.height)
1466
1550
  });
1467
1551
  return;
1468
1552
  }
1469
1553
  } catch {
1470
- ot();
1554
+ lt();
1471
1555
  }
1472
- ot();
1556
+ lt();
1473
1557
  });
1474
- return () => cancelAnimationFrame(Q);
1475
- }, [e.id, e.label, e.meta, y, H, it]);
1476
- const vt = s || c ? Math.max(2, v) : J ? v : 0, _t = i ? Math.max(2, vt || 2) : 0;
1477
- return /* @__PURE__ */ N.jsxs(
1558
+ return () => cancelAnimationFrame(rt);
1559
+ }, [e.id, e.label, e.meta, g, et, B]);
1560
+ const Yt = o || a ? Math.max(2, y) : F ? y : 0, Kt = i ? Math.max(2, Yt || 2) : 0;
1561
+ return /* @__PURE__ */ z.jsxs(
1478
1562
  "g",
1479
1563
  {
1480
- ref: D,
1564
+ ref: L,
1481
1565
  transform: `translate(${e.position.x}, ${e.position.y})`,
1482
1566
  "data-graph-node-interactive": "true",
1483
1567
  role: "button",
1484
1568
  tabIndex: 0,
1485
- "aria-selected": s,
1486
- onMouseDown: (ot) => {
1487
- ot.preventDefault();
1569
+ "aria-selected": o,
1570
+ onMouseDown: (lt) => {
1571
+ lt.preventDefault();
1488
1572
  },
1489
- onFocus: () => E == null ? void 0 : E(e.id),
1490
- onClick: () => _ == null ? void 0 : _(e),
1491
- onDoubleClick: () => x == null ? void 0 : x(e),
1492
- onMouseEnter: () => G(e.id),
1493
- onMouseLeave: ut,
1494
- onKeyDown: (ot) => {
1495
- (ot.key === "Enter" || ot.key === " ") && (ot.preventDefault(), _ == null || _(e));
1573
+ onFocus: () => _ == null ? void 0 : _(e.id),
1574
+ onClick: () => w == null ? void 0 : w(e),
1575
+ onDoubleClick: () => v == null ? void 0 : v(e),
1576
+ onMouseEnter: () => H(e.id),
1577
+ onMouseLeave: ot,
1578
+ onKeyDown: (lt) => {
1579
+ (lt.key === "Enter" || lt.key === " ") && (lt.preventDefault(), w == null || w(e));
1496
1580
  },
1497
1581
  children: [
1498
- /* @__PURE__ */ N.jsx(
1582
+ /* @__PURE__ */ z.jsx(
1499
1583
  "rect",
1500
1584
  {
1501
1585
  x: 0,
1502
1586
  y: 0,
1503
- width: H,
1504
- height: it,
1505
- rx: q,
1506
- ry: q,
1587
+ width: et,
1588
+ height: B,
1589
+ rx: C,
1590
+ ry: C,
1507
1591
  fill: "none",
1508
- stroke: dt,
1509
- strokeOpacity: jt,
1510
- strokeWidth: vt,
1592
+ stroke: G,
1593
+ strokeOpacity: zt,
1594
+ strokeWidth: Yt,
1511
1595
  pointerEvents: "none"
1512
1596
  }
1513
1597
  ),
1514
- i ? /* @__PURE__ */ N.jsx(
1598
+ i ? /* @__PURE__ */ z.jsx(
1515
1599
  "rect",
1516
1600
  {
1517
1601
  x: -3,
1518
1602
  y: -3,
1519
- width: H + 6,
1520
- height: it + 6,
1521
- rx: q + 2,
1522
- ry: q + 2,
1603
+ width: et + 6,
1604
+ height: B + 6,
1605
+ rx: C + 2,
1606
+ ry: C + 2,
1523
1607
  fill: "none",
1524
- stroke: o,
1608
+ stroke: s,
1525
1609
  strokeOpacity: 0.7,
1526
- strokeWidth: _t,
1610
+ strokeWidth: Kt,
1527
1611
  strokeDasharray: "4 3",
1528
1612
  pointerEvents: "none"
1529
1613
  }
1530
1614
  ) : null,
1531
- /* @__PURE__ */ N.jsx(
1615
+ /* @__PURE__ */ z.jsx(
1532
1616
  r,
1533
1617
  {
1534
1618
  node: e,
1535
- isSelected: s,
1536
- isHovered: Y,
1537
- isHoveredIn: at,
1538
- isHoveredOut: O,
1619
+ isSelected: o,
1620
+ isHovered: O,
1621
+ isHoveredIn: U,
1622
+ isHoveredOut: it,
1539
1623
  isHoveredBoth: A,
1540
- activePathKey: h,
1624
+ activePathKey: d,
1541
1625
  activePathNodeIds: u,
1542
- hoverInColor: I,
1626
+ hoverInColor: E,
1543
1627
  hoverOutColor: l,
1544
- hoverBothColor: g,
1545
- onPathHover: (ot, Q) => ot !== null && rt(e.id, ot, (Q == null ? void 0 : Q.pathKey) ?? (Q == null ? void 0 : Q.playerKey)),
1628
+ hoverBothColor: m,
1629
+ onPathHover: (lt, rt) => lt !== null && ut(e.id, lt, (rt == null ? void 0 : rt.pathKey) ?? (rt == null ? void 0 : rt.playerKey)),
1546
1630
  onPathLeave: S
1547
1631
  }
1548
1632
  )
@@ -1551,747 +1635,720 @@ const Nn = typeof window > "u" ? te : an, Yr = re.memo(
1551
1635
  );
1552
1636
  }
1553
1637
  );
1554
- Yr.displayName = "GraphNode";
1555
- const Ke = { x: 0, y: 0, zoom: 1 }, Ge = { nodeIds: [], edgeIds: [] }, Wr = 0.25, $r = 2.5, Fn = 0.12, Yn = "#f59e0b", Wn = "top-left", Ht = 26, ir = 34, Xr = 8, Ve = 48, Ze = 20, $n = 8, qe = (e, r, s) => ({
1556
- x: Number.isFinite(e.x) ? e.x : 0,
1557
- y: Number.isFinite(e.y) ? e.y : 0,
1558
- zoom: Ae(Number.isFinite(e.zoom) ? e.zoom : 1, r, s)
1559
- }), Xn = (e, r) => {
1560
- const s = Number.isFinite(e) && e > 0 ? e : Wr, i = Number.isFinite(r) && r > 0 ? r : $r;
1561
- return s <= i ? { minZoom: s, maxZoom: i } : { minZoom: i, maxZoom: s };
1562
- }, Je = (e) => e instanceof Error ? e : new Error(String(e)), Rr = (e, r, s) => s === "single" ? e.length === 1 && e[0] === r ? [] : [r] : e.includes(r) ? e.filter((i) => i !== r) : [...e, r], Bn = (e, r, s) => {
1563
- const i = 2 * Ht + 2 * ir + Xr * 3, o = 12;
1564
- switch (s) {
1638
+ Ar.displayName = "GraphNode";
1639
+ const xr = { x: 0, y: 0, zoom: 1 }, Ue = { nodeIds: [], edgeIds: [] }, Dr = 0.25, jr = 2.5, Mn = 0.12, An = "#f59e0b", Dn = "top-left", Ht = 26, tr = 34, zr = 8, Ge = 48, He = 20, jn = 8, zn = (e, r) => {
1640
+ const o = Number.isFinite(e) && e > 0 ? e : Dr, i = Number.isFinite(r) && r > 0 ? r : jr;
1641
+ return o <= i ? { minZoom: o, maxZoom: i } : { minZoom: i, maxZoom: o };
1642
+ }, Ke = (e) => e instanceof Error ? e : new Error(String(e)), br = (e, r, o) => o === "single" ? e.length === 1 && e[0] === r ? [] : [r] : e.includes(r) ? e.filter((i) => i !== r) : [...e, r], Nn = (e, r, o) => {
1643
+ const i = 2 * Ht + 2 * tr + zr * 3, s = 12;
1644
+ switch (o) {
1565
1645
  case "top-right":
1566
- return { x: e - i - o, y: o };
1646
+ return { x: e - i - s, y: s };
1567
1647
  case "bottom-left":
1568
- return { x: o, y: r - Ht - o };
1648
+ return { x: s, y: r - Ht - s };
1569
1649
  case "bottom-right":
1570
1650
  return {
1571
- x: e - i - o,
1572
- y: r - Ht - o
1651
+ x: e - i - s,
1652
+ y: r - Ht - s
1573
1653
  };
1574
1654
  case "top-left":
1575
1655
  default:
1576
- return { x: o, y: o };
1656
+ return { x: s, y: s };
1577
1657
  }
1578
- }, Sr = (e, r) => Math.hypot(e.x - r.x, e.y - r.y), Lr = (e, r) => ({
1658
+ }, Ir = (e, r) => Math.hypot(e.x - r.x, e.y - r.y), Er = (e, r) => ({
1579
1659
  x: (e.x + r.x) / 2,
1580
1660
  y: (e.y + r.y) / 2
1581
- }), kr = (e) => ({
1661
+ }), _r = (e) => ({
1582
1662
  x: Math.min(e.startX, e.endX),
1583
1663
  y: Math.min(e.startY, e.endY),
1584
1664
  width: Math.abs(e.endX - e.startX),
1585
1665
  height: Math.abs(e.endY - e.startY)
1586
- }), Or = (e, r, s) => e >= s.x && e <= s.x + s.width && r >= s.y && r <= s.y + s.height, Cn = (e, r) => ({
1666
+ }), Tr = (e, r, o) => e >= o.x && e <= o.x + o.width && r >= o.y && r <= o.y + o.height, Fn = (e, r) => ({
1587
1667
  minX: e.minX - r,
1588
1668
  minY: e.minY - r,
1589
1669
  maxX: e.maxX + r,
1590
1670
  maxY: e.maxY + r,
1591
1671
  width: e.width + r * 2,
1592
1672
  height: e.height + r * 2
1593
- }), je = (e, r) => {
1673
+ }), De = (e, r) => {
1594
1674
  if (!e)
1595
1675
  return r;
1596
1676
  if (!r)
1597
1677
  return e;
1598
- const s = Math.min(e.minX, r.minX), i = Math.min(e.minY, r.minY), o = Math.max(e.maxX, r.maxX), c = Math.max(e.maxY, r.maxY);
1678
+ const o = Math.min(e.minX, r.minX), i = Math.min(e.minY, r.minY), s = Math.max(e.maxX, r.maxX), a = Math.max(e.maxY, r.maxY);
1599
1679
  return {
1600
- minX: s,
1680
+ minX: o,
1601
1681
  minY: i,
1602
- maxX: o,
1603
- maxY: c,
1604
- width: o - s,
1605
- height: c - i
1682
+ maxX: s,
1683
+ maxY: a,
1684
+ width: s - o,
1685
+ height: a - i
1606
1686
  };
1607
- }, Un = (e, r, s, i, o, c) => {
1608
- if (!e.length || !o && !(i && i.length))
1687
+ }, Yn = (e, r, o, i, s, a) => {
1688
+ if (!e.length || !s && !(i && i.length))
1609
1689
  return null;
1610
- const h = jr(e);
1611
- if (!h.length)
1690
+ const d = kr(e);
1691
+ if (!d.length)
1612
1692
  return null;
1613
- const u = r === Me.Tree && s === tr.RTL ? [...h].reverse() : h, { orderedLabels: w } = Fr(
1693
+ const u = r === Me.Tree && o === qe.RTL ? [...d].reverse() : d, { orderedLabels: b } = Mr(
1614
1694
  e,
1615
1695
  r,
1616
- s,
1696
+ o,
1617
1697
  i,
1618
- o
1619
- ), v = e.reduce(
1620
- (m, g) => Math.min(m, g.position.y),
1698
+ s
1699
+ ), y = e.reduce(
1700
+ (p, m) => Math.min(p, m.position.y),
1621
1701
  Number.POSITIVE_INFINITY
1622
- ) - c - ee + 6;
1623
- return u.reduce((m, g, I) => {
1624
- const l = Nr(w[I] ?? ""), L = {
1625
- minX: g.centerX - l / 2,
1626
- minY: v,
1627
- maxX: g.centerX + l / 2,
1628
- maxY: v + ee,
1702
+ ) - a - ie + 6;
1703
+ return u.reduce((p, m, E) => {
1704
+ const l = Or(b[E] ?? ""), R = {
1705
+ minX: m.centerX - l / 2,
1706
+ minY: y,
1707
+ maxX: m.centerX + l / 2,
1708
+ maxY: y + ie,
1629
1709
  width: l,
1630
- height: ee
1710
+ height: ie
1631
1711
  };
1632
- return je(m, L);
1712
+ return De(p, R);
1633
1713
  }, null);
1634
- }, Hn = (e) => e.reduce((r, s) => {
1635
- if (!s.labelPosition)
1714
+ }, Wn = (e) => e.reduce((r, o) => {
1715
+ if (!o.labelPosition)
1636
1716
  return r;
1637
1717
  const i = {
1638
- minX: s.labelPosition.x - Ve / 2,
1639
- minY: s.labelPosition.y - Ze / 2,
1640
- maxX: s.labelPosition.x + Ve / 2,
1641
- maxY: s.labelPosition.y + Ze / 2,
1642
- width: Ve,
1643
- height: Ze
1718
+ minX: o.labelPosition.x - Ge / 2,
1719
+ minY: o.labelPosition.y - He / 2,
1720
+ maxX: o.labelPosition.x + Ge / 2,
1721
+ maxY: o.labelPosition.y + He / 2,
1722
+ width: Ge,
1723
+ height: He
1644
1724
  };
1645
- return je(r, i);
1646
- }, null), Qe = (e, r, s) => {
1725
+ return De(r, i);
1726
+ }, null), Ve = (e, r, o) => {
1647
1727
  if (!e)
1648
- return { x: r, y: s };
1728
+ return { x: r, y: o };
1649
1729
  const i = e.getBoundingClientRect();
1650
1730
  return {
1651
1731
  x: r - i.left,
1652
- y: s - i.top
1732
+ y: o - i.top
1653
1733
  };
1654
- }, Kn = (e, r, s) => {
1655
- var u, w, T, v, m, g;
1734
+ }, $n = (e, r, o) => {
1735
+ var u, b, I, y, p, m;
1656
1736
  const i = {
1657
1737
  x: e.position.x + (((u = e.size) == null ? void 0 : u.width) ?? 0) / 2,
1658
- y: e.position.y + (((w = e.size) == null ? void 0 : w.height) ?? 0) / 2
1659
- }, o = r.filter((I) => {
1660
- var L, X;
1661
- if (I.id === e.id)
1738
+ y: e.position.y + (((b = e.size) == null ? void 0 : b.height) ?? 0) / 2
1739
+ }, s = r.filter((E) => {
1740
+ var R, W;
1741
+ if (E.id === e.id)
1662
1742
  return !1;
1663
1743
  const l = {
1664
- x: I.position.x + (((L = I.size) == null ? void 0 : L.width) ?? 0) / 2,
1665
- y: I.position.y + (((X = I.size) == null ? void 0 : X.height) ?? 0) / 2
1744
+ x: E.position.x + (((R = E.size) == null ? void 0 : R.width) ?? 0) / 2,
1745
+ y: E.position.y + (((W = E.size) == null ? void 0 : W.height) ?? 0) / 2
1666
1746
  };
1667
- return s === "left" ? l.x < i.x : s === "right" ? l.x > i.x : s === "up" ? l.y < i.y : l.y > i.y;
1747
+ return o === "left" ? l.x < i.x : o === "right" ? l.x > i.x : o === "up" ? l.y < i.y : l.y > i.y;
1668
1748
  });
1669
- if (!o.length)
1749
+ if (!s.length)
1670
1750
  return null;
1671
- let c = o[0], h = Math.hypot(
1672
- c.position.x + (((T = c.size) == null ? void 0 : T.width) ?? 0) / 2 - i.x,
1673
- c.position.y + (((v = c.size) == null ? void 0 : v.height) ?? 0) / 2 - i.y
1751
+ let a = s[0], d = Math.hypot(
1752
+ a.position.x + (((I = a.size) == null ? void 0 : I.width) ?? 0) / 2 - i.x,
1753
+ a.position.y + (((y = a.size) == null ? void 0 : y.height) ?? 0) / 2 - i.y
1674
1754
  );
1675
- for (let I = 1; I < o.length; I++) {
1676
- const l = o[I], L = Math.hypot(
1677
- l.position.x + (((m = l.size) == null ? void 0 : m.width) ?? 0) / 2 - i.x,
1678
- l.position.y + (((g = l.size) == null ? void 0 : g.height) ?? 0) / 2 - i.y
1755
+ for (let E = 1; E < s.length; E++) {
1756
+ const l = s[E], R = Math.hypot(
1757
+ l.position.x + (((p = l.size) == null ? void 0 : p.width) ?? 0) / 2 - i.x,
1758
+ l.position.y + (((m = l.size) == null ? void 0 : m.height) ?? 0) / 2 - i.y
1679
1759
  );
1680
- L < h && (c = l, h = L);
1760
+ R < d && (a = l, d = R);
1681
1761
  }
1682
- return c;
1683
- }, Gn = ({
1762
+ return a;
1763
+ }, Xn = ({
1684
1764
  graph: e,
1685
1765
  vertexComponent: r,
1686
- edgeComponent: s = Ln,
1766
+ edgeComponent: o = En,
1687
1767
  config: i,
1688
- viewport: o,
1689
- defaultViewport: c,
1690
- onViewportChange: h,
1768
+ viewport: s,
1769
+ defaultViewport: a,
1770
+ onViewportChange: d,
1691
1771
  fitViewOnMount: u = !1,
1692
- fitViewPadding: w = 32,
1693
- minZoom: T = Wr,
1694
- maxZoom: v = $r,
1695
- zoomStep: m = Fn,
1696
- panEnabled: g = !0,
1697
- zoomEnabled: I = !0,
1772
+ fitViewPadding: b = 32,
1773
+ minZoom: I = Dr,
1774
+ maxZoom: y = jr,
1775
+ zoomStep: p = Mn,
1776
+ panEnabled: m = !0,
1777
+ zoomEnabled: E = !0,
1698
1778
  pinchZoomEnabled: l = !0,
1699
- keyboardNavigation: L = !0,
1700
- showControls: X = !1,
1701
- controlsPosition: y = Wn,
1702
- marqueeSelectionEnabled: E = !0,
1703
- focusedNodeId: _,
1704
- defaultFocusedNodeId: x = null,
1705
- onFocusedNodeChange: G,
1706
- collapsedNodeIds: ut,
1707
- defaultCollapsedNodeIds: rt,
1779
+ keyboardNavigation: R = !0,
1780
+ showControls: W = !1,
1781
+ controlsPosition: g = Dn,
1782
+ marqueeSelectionEnabled: _ = !0,
1783
+ focusedNodeId: w,
1784
+ defaultFocusedNodeId: v = null,
1785
+ onFocusedNodeChange: H,
1786
+ collapsedNodeIds: ot,
1787
+ defaultCollapsedNodeIds: ut,
1708
1788
  onCollapsedNodeIdsChange: S,
1709
- toggleCollapseOnNodeDoubleClick: D = !0,
1710
- hiddenNodeIds: H,
1711
- onNodeExpand: it,
1712
- onNodeCollapse: q,
1713
- searchQuery: V,
1714
- hideUnmatchedSearch: at = !1,
1715
- searchPredicate: O,
1789
+ toggleCollapseOnNodeDoubleClick: L = !0,
1790
+ hiddenNodeIds: et,
1791
+ onNodeExpand: B,
1792
+ onNodeCollapse: C,
1793
+ searchQuery: Y,
1794
+ hideUnmatchedSearch: U = !1,
1795
+ searchPredicate: it,
1716
1796
  highlightedNodeIds: A,
1717
- highlightedEdgeIds: Y,
1718
- highlightColor: J = "#f59e0b",
1719
- highlightStrategy: dt,
1720
- onSearchResultsChange: jt,
1721
- selectedNodeIds: vt,
1722
- selectedEdgeIds: _t,
1723
- defaultSelectedNodeIds: Ft,
1724
- defaultSelectedEdgeIds: Kt,
1725
- onSelectionChange: ot,
1726
- selectionMode: Q = "single",
1727
- nodeSelectionEnabled: Lt = !0,
1797
+ highlightedEdgeIds: O,
1798
+ highlightColor: F = "#f59e0b",
1799
+ highlightStrategy: G,
1800
+ onSearchResultsChange: zt,
1801
+ selectedNodeIds: Yt,
1802
+ selectedEdgeIds: Kt,
1803
+ defaultSelectedNodeIds: Wt,
1804
+ defaultSelectedEdgeIds: Vt,
1805
+ onSelectionChange: lt,
1806
+ selectionMode: rt = "single",
1807
+ nodeSelectionEnabled: Ot = !0,
1728
1808
  edgeSelectionEnabled: Tt = !0,
1729
- selectionColor: mt = Yn,
1730
- edgeSelectionColor: Gt,
1731
- layoutNodesOverride: De,
1732
- routeEdgesOverride: me,
1733
- renderBackground: ne,
1734
- renderOverlay: ie,
1735
- onError: ct,
1809
+ selectionColor: mt = An,
1810
+ edgeSelectionColor: qt,
1811
+ layoutNodesOverride: je,
1812
+ routeEdgesOverride: be,
1813
+ renderBackground: se,
1814
+ renderOverlay: ae,
1815
+ onError: ft,
1736
1816
  onNodeHoverChange: Pt,
1737
- onEdgeHoverChange: Yt,
1817
+ onEdgeHoverChange: $t,
1738
1818
  onNodeClick: Rt,
1739
1819
  onEdgeClick: yt
1740
1820
  }, ze) => {
1741
- const ye = k(() => Xn(T, v), [T, v]), lt = ye.minZoom, ht = ye.maxZoom, ge = En(i), Wt = cn().replace(/:/g, "-"), [oe, ve] = Et(
1742
- () => qe({ ...Ke, ...c ?? {} }, lt, ht)
1743
- ), [se, xe] = Et({
1744
- nodeIds: Ft ?? [],
1745
- edgeIds: Kt ?? []
1746
- }), [we, Ne] = Et(
1747
- x
1748
- ), [kt, ae] = Et(null), [be, Ie] = Et(!1), xt = pt({
1821
+ const Ie = M(() => zn(I, y), [I, y]), xt = Ie.minZoom, Mt = Ie.maxZoom, Ee = xn(i), Xt = Qr().replace(/:/g, "-"), [St, Jt] = _t(null), [_e, ce] = _t(!1), gt = pt({
1749
1822
  active: !1,
1750
1823
  startX: 0,
1751
1824
  startY: 0,
1752
1825
  originX: 0,
1753
1826
  originY: 0
1754
- }), wt = pt(/* @__PURE__ */ new Map()), bt = pt({
1827
+ }), bt = pt(/* @__PURE__ */ new Map()), At = pt({
1755
1828
  active: !1,
1756
1829
  startDistance: 0,
1757
1830
  startZoom: 1,
1758
1831
  worldX: 0,
1759
1832
  worldY: 0
1760
- }), Ot = pt(null), Dt = pt(null), $t = pt(!1), b = k(() => pn(ge), [ge]), gt = b.theme, Ee = gt.edgeColor ?? wr.edgeColor, Xt = gt.edgeWidth ?? wr.edgeWidth, _e = Gt ?? mt, Te = b.hoverNodeBorderColor ?? b.hoverEdgeColor, Pe = b.hoverNodeBothColor ?? b.hoverEdgeColor, Fe = gt.nodeBorderColor, Ye = gt.nodeBorderWidth ?? 0, Bt = b.showArrows, ce = `${Wt}-arrow`, Re = `${Wt}-arrow-hover`, Se = `${Wt}-arrow-hover-in`, Le = `${Wt}-arrow-selected`, F = k(
1761
- () => qe(o ?? oe, lt, ht),
1762
- [o, oe, ht, lt]
1763
- ), t = pt(F);
1764
- t.current = F;
1765
- const a = pt(h);
1766
- a.current = h;
1767
- const f = k(
1768
- () => ({
1769
- nodeIds: vt ?? se.nodeIds,
1770
- edgeIds: _t ?? se.edgeIds
1771
- }),
1772
- [vt, _t, se]
1773
- ), R = pt(f);
1774
- R.current = f;
1775
- const M = _ !== void 0 ? _ : we, {
1776
- collapsedIds: W,
1777
- collapsedNodeSet: z,
1778
- pendingExpansionNodeSet: j,
1779
- updateCollapsedNodeIds: nt,
1780
- setPendingExpansionNodeIds: B
1833
+ }), Nt = pt(null), Ne = pt(null), ue = pt(!1), T = M(() => sn(Ee), [Ee]), It = T.theme, Zt = It.edgeColor ?? hr.edgeColor, Bt = It.edgeWidth ?? hr.edgeWidth, Dt = qt ?? mt, le = T.hoverNodeBorderColor ?? T.hoverEdgeColor, fe = T.hoverNodeBothColor ?? T.hoverEdgeColor, Te = It.nodeBorderColor, Fe = It.nodeBorderWidth ?? 0, Ct = T.showArrows, Pe = `${Xt}-arrow`, de = `${Xt}-arrow-hover`, he = `${Xt}-arrow-hover-in`, Re = `${Xt}-arrow-selected`, {
1834
+ viewport: $,
1835
+ viewportRef: Se,
1836
+ selection: st,
1837
+ focusedNodeId: Et,
1838
+ updateViewport: K,
1839
+ updateSelection: dt,
1840
+ updateFocusedNode: vt
1781
1841
  } = wn({
1782
- collapsedNodeIds: ut,
1783
- defaultCollapsedNodeIds: rt,
1842
+ controlledViewport: s,
1843
+ defaultViewport: a,
1844
+ safeMinZoom: xt,
1845
+ safeMaxZoom: Mt,
1846
+ onViewportChange: d,
1847
+ selectedNodeIds: Yt,
1848
+ selectedEdgeIds: Kt,
1849
+ defaultSelectedNodeIds: Wt,
1850
+ defaultSelectedEdgeIds: Vt,
1851
+ onSelectionChange: lt,
1852
+ controlledFocusedNodeId: w,
1853
+ defaultFocusedNodeId: v,
1854
+ onFocusedNodeChange: H
1855
+ }), {
1856
+ collapsedIds: t,
1857
+ collapsedNodeSet: c,
1858
+ pendingExpansionNodeSet: h,
1859
+ updateCollapsedNodeIds: P,
1860
+ setPendingExpansionNodeIds: N
1861
+ } = dn({
1862
+ collapsedNodeIds: ot,
1863
+ defaultCollapsedNodeIds: ut,
1784
1864
  onCollapsedNodeIdsChange: S
1785
- }), Z = k(() => new Set(f.nodeIds), [f.nodeIds]), ft = k(() => new Set(f.edgeIds), [f.edgeIds]), $ = K(
1786
- (n) => {
1787
- var U;
1788
- const d = t.current, p = typeof n == "function" ? n(d) : n, P = qe({ ...d, ...p }, lt, ht);
1789
- return o || ve(P), (U = a.current) == null || U.call(a, P), P;
1790
- },
1791
- // viewport and onViewportChange are intentionally excluded: both are read
1792
- // via refs so the callback stays stable across renders.
1793
- [o, ht, lt]
1794
- ), tt = K(
1795
- (n) => {
1796
- const d = R.current, p = typeof n == "function" ? n(d) : n;
1797
- (vt == null || _t == null) && xe((P) => ({
1798
- nodeIds: vt == null ? p.nodeIds : P.nodeIds,
1799
- edgeIds: _t == null ? p.edgeIds : P.edgeIds
1800
- })), ot == null || ot(p);
1801
- },
1802
- [ot, _t, vt]
1803
- ), C = K(
1804
- (n) => {
1805
- _ === void 0 && Ne(n), G == null || G(n);
1806
- },
1807
- [_, G]
1808
- ), {
1809
- childNodeIdsByParent: Vt,
1810
- effectiveHighlightedEdgeSet: We,
1811
- effectiveHighlightedNodeSet: $e,
1812
- handleNodeMeasure: Cr,
1813
- positionedEdges: Mt,
1814
- positionedNodes: st,
1815
- visibleEdges: or,
1816
- visibleNodesWithMeasuredSize: sr
1817
- } = In({
1865
+ }), X = M(() => new Set(st.nodeIds), [st.nodeIds]), j = M(() => new Set(st.edgeIds), [st.edgeIds]), {
1866
+ childNodeIdsByParent: D,
1867
+ effectiveHighlightedEdgeSet: at,
1868
+ effectiveHighlightedNodeSet: q,
1869
+ handleNodeMeasure: Z,
1870
+ positionedEdges: Q,
1871
+ positionedNodes: V,
1872
+ visibleEdges: Lt,
1873
+ visibleNodesWithMeasuredSize: ct
1874
+ } = pn({
1818
1875
  graph: e,
1819
- config: b,
1820
- mergedTheme: gt,
1821
- collapsedIds: W,
1822
- hiddenNodeIds: H,
1823
- searchQuery: V,
1824
- hideUnmatchedSearch: at,
1825
- searchPredicate: O,
1876
+ config: T,
1877
+ mergedTheme: It,
1878
+ collapsedIds: t,
1879
+ hiddenNodeIds: et,
1880
+ searchQuery: Y,
1881
+ hideUnmatchedSearch: U,
1882
+ searchPredicate: it,
1826
1883
  highlightedNodeIds: A,
1827
- highlightedEdgeIds: Y,
1828
- highlightStrategy: dt,
1829
- onSearchResultsChange: jt,
1830
- layoutNodesOverride: De,
1831
- routeEdgesOverride: me,
1832
- onError: ct
1833
- }), Ur = K(
1884
+ highlightedEdgeIds: O,
1885
+ highlightStrategy: G,
1886
+ onSearchResultsChange: zt,
1887
+ layoutNodesOverride: je,
1888
+ routeEdgesOverride: be,
1889
+ onError: ft
1890
+ }), pe = J(
1834
1891
  (n) => {
1835
- if (!(!D || !((Vt.get(n.id) ?? []).length > 0) || j.has(n.id)))
1836
- if (z.has(n.id))
1892
+ if (!(!L || !((D.get(n.id) ?? []).length > 0) || h.has(n.id)))
1893
+ if (c.has(n.id))
1837
1894
  try {
1838
- const p = it == null ? void 0 : it(n.id);
1839
- if (p && typeof p == "object" && "then" in p) {
1840
- B(
1841
- (P) => P.includes(n.id) ? P : [...P, n.id]
1842
- ), Promise.resolve(p).then(() => {
1843
- nt((P) => P.filter((U) => U !== n.id));
1844
- }).catch((P) => {
1845
- ct == null || ct(Je(P), { graph: e, phase: "interaction" });
1895
+ const x = B == null ? void 0 : B(n.id);
1896
+ if (x && typeof x == "object" && "then" in x) {
1897
+ N(
1898
+ (k) => k.includes(n.id) ? k : [...k, n.id]
1899
+ ), Promise.resolve(x).then(() => {
1900
+ P((k) => k.filter((tt) => tt !== n.id));
1901
+ }).catch((k) => {
1902
+ ft == null || ft(Ke(k), { graph: e, phase: "interaction" });
1846
1903
  }).finally(() => {
1847
- B(
1848
- (P) => P.filter((U) => U !== n.id)
1904
+ N(
1905
+ (k) => k.filter((tt) => tt !== n.id)
1849
1906
  );
1850
1907
  });
1851
1908
  return;
1852
1909
  }
1853
- nt((P) => P.filter((U) => U !== n.id));
1854
- } catch (p) {
1855
- ct == null || ct(Je(p), { graph: e, phase: "interaction" });
1910
+ P((k) => k.filter((tt) => tt !== n.id));
1911
+ } catch (x) {
1912
+ ft == null || ft(Ke(x), { graph: e, phase: "interaction" });
1856
1913
  }
1857
1914
  else {
1858
- nt((p) => [...p, n.id]);
1915
+ P((x) => [...x, n.id]);
1859
1916
  try {
1860
- q == null || q(n.id);
1861
- } catch (p) {
1862
- ct == null || ct(Je(p), { graph: e, phase: "interaction" });
1917
+ C == null || C(n.id);
1918
+ } catch (x) {
1919
+ ft == null || ft(Ke(x), { graph: e, phase: "interaction" });
1863
1920
  }
1864
1921
  }
1865
1922
  },
1866
1923
  [
1867
- Vt,
1868
- z,
1924
+ D,
1925
+ c,
1869
1926
  e,
1870
- ct,
1871
- q,
1872
- it,
1873
- j,
1927
+ ft,
1928
+ C,
1874
1929
  B,
1875
- D,
1876
- nt
1930
+ h,
1931
+ N,
1932
+ L,
1933
+ P
1877
1934
  ]
1878
1935
  );
1879
- te(() => {
1880
- const n = new Set(sr.map((p) => p.id)), d = new Set(or.map((p) => p.id));
1881
- (f.nodeIds.some((p) => !n.has(p)) || f.edgeIds.some((p) => !d.has(p))) && tt({
1882
- nodeIds: f.nodeIds.filter((p) => n.has(p)),
1883
- edgeIds: f.edgeIds.filter((p) => d.has(p))
1884
- }), M && !n.has(M) && C(null);
1936
+ ne(() => {
1937
+ const n = new Set(ct.map((x) => x.id)), f = new Set(Lt.map((x) => x.id));
1938
+ (st.nodeIds.some((x) => !n.has(x)) || st.edgeIds.some((x) => !f.has(x))) && dt({
1939
+ nodeIds: st.nodeIds.filter((x) => n.has(x)),
1940
+ edgeIds: st.edgeIds.filter((x) => f.has(x))
1941
+ }), Et && !n.has(Et) && vt(null);
1885
1942
  }, [
1886
- M,
1887
- f,
1888
- C,
1889
- tt,
1890
- or,
1891
- sr
1943
+ Et,
1944
+ st,
1945
+ vt,
1946
+ dt,
1947
+ Lt,
1948
+ ct
1892
1949
  ]);
1893
- const It = k(
1894
- () => new Map(st.map((n) => [n.id, n])),
1895
- [st]
1896
- ), ar = k(
1897
- () => new Map(Mt.map((n) => [n.id, n])),
1898
- [Mt]
1899
- ), cr = k(() => Pn(st), [st]), ur = k(() => {
1900
- const n = je(
1901
- je(
1902
- cr,
1903
- Un(
1904
- st,
1905
- b.layout,
1906
- b.layoutDirection,
1907
- b.labels,
1908
- b.autoLabels,
1909
- b.labelOffset
1950
+ const ht = M(
1951
+ () => new Map(V.map((n) => [n.id, n])),
1952
+ [V]
1953
+ ), Le = M(
1954
+ () => new Map(Q.map((n) => [n.id, n])),
1955
+ [Q]
1956
+ ), er = M(() => mn(V), [V]), rr = M(() => {
1957
+ const n = De(
1958
+ De(
1959
+ er,
1960
+ Yn(
1961
+ V,
1962
+ T.layout,
1963
+ T.layoutDirection,
1964
+ T.labels,
1965
+ T.autoLabels,
1966
+ T.labelOffset
1910
1967
  )
1911
1968
  ),
1912
- Hn(Mt)
1969
+ Wn(Q)
1913
1970
  );
1914
- return n && Cn(n, $n);
1971
+ return n && Fn(n, jn);
1915
1972
  }, [
1916
- b.autoLabels,
1917
- b.labelOffset,
1918
- b.labels,
1919
- b.layout,
1920
- b.layoutDirection,
1921
- cr,
1922
- Mt,
1923
- st
1924
- ]), ke = K(() => {
1925
- var P;
1926
- const n = Ot.current;
1973
+ T.autoLabels,
1974
+ T.labelOffset,
1975
+ T.labels,
1976
+ T.layout,
1977
+ T.layoutDirection,
1978
+ er,
1979
+ Q,
1980
+ V
1981
+ ]), ke = J(() => {
1982
+ var k;
1983
+ const n = Nt.current;
1927
1984
  if (!n)
1928
- return { width: b.width, height: b.height };
1929
- const p = ((P = n.parentElement) == null ? void 0 : P.getBoundingClientRect()) ?? n.getBoundingClientRect();
1985
+ return { width: T.width, height: T.height };
1986
+ const x = ((k = n.parentElement) == null ? void 0 : k.getBoundingClientRect()) ?? n.getBoundingClientRect();
1930
1987
  return {
1931
- width: p.width || b.width,
1932
- height: p.height || b.height
1988
+ width: x.width || T.width,
1989
+ height: x.height || T.height
1933
1990
  };
1934
- }, [b.height, b.width]), Ct = K(
1935
- (n = w) => {
1936
- const { width: d, height: p } = ke();
1937
- $(
1938
- Rn(ur, d, p, n, lt, ht)
1991
+ }, [T.height, T.width]), Ut = J(
1992
+ (n = b) => {
1993
+ const { width: f, height: x } = ke();
1994
+ K(
1995
+ yn(rr, f, x, n, xt, Mt)
1939
1996
  );
1940
1997
  },
1941
- [ur, w, ke, ht, lt, $]
1942
- ), Oe = K(
1998
+ [rr, b, ke, Mt, xt, K]
1999
+ ), Oe = J(
1943
2000
  (n) => {
1944
- const d = It.get(n);
1945
- if (!d)
2001
+ const f = ht.get(n);
2002
+ if (!f)
1946
2003
  return;
1947
- const { width: p, height: P } = ke();
1948
- $(Sn(d, p, P, F.zoom));
2004
+ const { width: x, height: k } = ke();
2005
+ K(gn(f, x, k, $.zoom));
1949
2006
  },
1950
- [ke, It, $, F.zoom]
2007
+ [ke, ht, K, $.zoom]
1951
2008
  );
1952
- un(
2009
+ tn(
1953
2010
  ze,
1954
2011
  () => ({
1955
- fitView: Ct,
2012
+ fitView: Ut,
1956
2013
  centerOnNode: Oe,
1957
- zoomIn: () => $((n) => ({ zoom: n.zoom + m })),
1958
- zoomOut: () => $((n) => ({ zoom: n.zoom - m })),
1959
- zoomTo: (n) => $({ zoom: n }),
1960
- resetViewport: () => $(Ke),
1961
- getViewport: () => F,
1962
- setViewport: $,
1963
- clearSelection: () => tt(Ge)
2014
+ zoomIn: () => K((n) => ({ zoom: n.zoom + p })),
2015
+ zoomOut: () => K((n) => ({ zoom: n.zoom - p })),
2016
+ zoomTo: (n) => K({ zoom: n }),
2017
+ resetViewport: () => K(xr),
2018
+ getViewport: () => $,
2019
+ setViewport: K,
2020
+ clearSelection: () => dt(Ue)
1964
2021
  }),
1965
- [Oe, Ct, tt, $, F, m]
1966
- ), te(() => {
1967
- $t.current = !1;
1968
- }, [e]), te(() => {
1969
- !u || $t.current || st.length === 0 || ($t.current = !0, Ct());
1970
- }, [Ct, u, st.length]);
2022
+ [Oe, Ut, dt, K, $, p]
2023
+ ), ne(() => {
2024
+ ue.current = !1;
2025
+ }, [e]), ne(() => {
2026
+ !u || ue.current || V.length === 0 || (ue.current = !0, Ut());
2027
+ }, [Ut, u, V.length]);
1971
2028
  const {
1972
- hoveredEdgeId: lr,
1973
- setHoveredEdgeId: fr,
1974
- hoveredNodeId: Ut,
1975
- setHoveredNodeId: Zt,
1976
- focusedPath: Xe,
1977
- setFocusedPath: At,
1978
- pathHighlight: qt,
1979
- hoveredNodeStates: Hr,
1980
- edgesForRender: Kr
1981
- } = xn(st, Mt, b.hoverHighlight), dr = pt(Ut);
1982
- dr.current = Ut;
1983
- const hr = k(
2029
+ hoveredEdgeId: nr,
2030
+ setHoveredEdgeId: ir,
2031
+ hoveredNodeId: Gt,
2032
+ setHoveredNodeId: Qt,
2033
+ focusedPath: Ye,
2034
+ setFocusedPath: jt,
2035
+ pathHighlight: te,
2036
+ hoveredNodeStates: Fr,
2037
+ edgesForRender: Yr
2038
+ } = fn(V, Q, T.hoverHighlight), or = pt(Gt);
2039
+ or.current = Gt;
2040
+ const sr = M(
1984
2041
  () => ({
1985
2042
  graph: e,
1986
- nodes: st,
1987
- edges: Mt,
1988
- config: b,
1989
- viewport: F,
1990
- selection: f
2043
+ nodes: V,
2044
+ edges: Q,
2045
+ config: T,
2046
+ viewport: $,
2047
+ selection: st
1991
2048
  }),
1992
- [b, e, Mt, st, f, F]
1993
- ), Jt = K(
1994
- (n, d, p = "pointer") => {
1995
- Pt == null || Pt(n, d, {
1996
- viewport: F,
1997
- selection: f,
1998
- trigger: p
2049
+ [T, e, Q, V, st, $]
2050
+ ), ee = J(
2051
+ (n, f, x = "pointer") => {
2052
+ Pt == null || Pt(n, f, {
2053
+ viewport: $,
2054
+ selection: st,
2055
+ trigger: x
1999
2056
  });
2000
2057
  },
2001
- [Pt, f, F]
2002
- ), pr = K(
2003
- (n, d, p = "pointer") => {
2004
- Yt == null || Yt(n, d, {
2005
- viewport: F,
2006
- selection: f,
2007
- trigger: p
2058
+ [Pt, st, $]
2059
+ ), ar = J(
2060
+ (n, f, x = "pointer") => {
2061
+ $t == null || $t(n, f, {
2062
+ viewport: $,
2063
+ selection: st,
2064
+ trigger: x
2008
2065
  });
2009
2066
  },
2010
- [Yt, f, F]
2011
- ), Be = K(
2067
+ [$t, st, $]
2068
+ ), We = J(
2012
2069
  (n) => {
2013
- if (!Lt) {
2014
- C(n.id), Rt == null || Rt(n);
2070
+ if (!Ot) {
2071
+ vt(n.id), Rt == null || Rt(n);
2015
2072
  return;
2016
2073
  }
2017
- tt((d) => ({
2018
- nodeIds: Rr(d.nodeIds, n.id, Q),
2019
- edgeIds: Q === "single" ? [] : d.edgeIds
2020
- })), C(n.id), Rt == null || Rt(n);
2074
+ dt((f) => ({
2075
+ nodeIds: br(f.nodeIds, n.id, rt),
2076
+ edgeIds: rt === "single" ? [] : f.edgeIds
2077
+ })), vt(n.id), Rt == null || Rt(n);
2021
2078
  },
2022
- [Lt, Rt, Q, C, tt]
2023
- ), Gr = K(
2079
+ [Ot, Rt, rt, vt, dt]
2080
+ ), Wr = J(
2024
2081
  (n) => {
2025
2082
  if (!Tt) {
2026
2083
  yt == null || yt(n);
2027
2084
  return;
2028
2085
  }
2029
- tt((d) => ({
2030
- nodeIds: Q === "single" ? [] : d.nodeIds,
2031
- edgeIds: Rr(d.edgeIds, n.id, Q)
2086
+ dt((f) => ({
2087
+ nodeIds: rt === "single" ? [] : f.nodeIds,
2088
+ edgeIds: br(f.edgeIds, n.id, rt)
2032
2089
  })), yt == null || yt(n);
2033
2090
  },
2034
- [Tt, yt, Q, tt]
2035
- ), Vr = K(
2091
+ [Tt, yt, rt, dt]
2092
+ ), $r = J(
2036
2093
  (n) => {
2037
- var U, St;
2038
- const d = n.target, p = !!d.closest('[data-graph-node-interactive="true"], [data-graph-edge-interactive="true"]'), P = Qe(Ot.current, n.clientX, n.clientY);
2039
- if (!p && Q === "multiple" && E && n.shiftKey) {
2040
- ae({
2041
- startX: P.x,
2042
- startY: P.y,
2043
- endX: P.x,
2044
- endY: P.y
2045
- }), xt.current.active = !1;
2094
+ var tt, kt;
2095
+ const f = n.target, x = !!f.closest('[data-graph-node-interactive="true"], [data-graph-edge-interactive="true"]'), k = Ve(Nt.current, n.clientX, n.clientY);
2096
+ if (!x && rt === "multiple" && _ && n.shiftKey) {
2097
+ Jt({
2098
+ startX: k.x,
2099
+ startY: k.y,
2100
+ endX: k.x,
2101
+ endY: k.y
2102
+ }), gt.current.active = !1;
2046
2103
  return;
2047
2104
  }
2048
- if (n.pointerType === "touch" && (wt.current.set(n.pointerId, P), l && I && wt.current.size === 2)) {
2049
- const [zt, et] = Array.from(wt.current.values()), Qt = Lr(zt, et);
2050
- bt.current = {
2105
+ if (n.pointerType === "touch" && (bt.current.set(n.pointerId, k), l && E && bt.current.size === 2)) {
2106
+ const [Ft, nt] = Array.from(bt.current.values()), re = Er(Ft, nt);
2107
+ At.current = {
2051
2108
  active: !0,
2052
- startDistance: Sr(zt, et),
2053
- startZoom: F.zoom,
2054
- worldX: (Qt.x - F.x) / F.zoom,
2055
- worldY: (Qt.y - F.y) / F.zoom
2056
- }, xt.current.active = !1, (U = d.setPointerCapture) == null || U.call(d, n.pointerId);
2109
+ startDistance: Ir(Ft, nt),
2110
+ startZoom: $.zoom,
2111
+ worldX: (re.x - $.x) / $.zoom,
2112
+ worldY: (re.y - $.y) / $.zoom
2113
+ }, gt.current.active = !1, (tt = f.setPointerCapture) == null || tt.call(f, n.pointerId);
2057
2114
  return;
2058
2115
  }
2059
- !g || n.button !== 0 || p || (xt.current = {
2116
+ !m || n.button !== 0 || x || (gt.current = {
2060
2117
  active: !0,
2061
- startX: P.x,
2062
- startY: P.y,
2063
- originX: F.x,
2064
- originY: F.y
2065
- }, Ie(!0), (St = d.setPointerCapture) == null || St.call(d, n.pointerId));
2118
+ startX: k.x,
2119
+ startY: k.y,
2120
+ originX: $.x,
2121
+ originY: $.y
2122
+ }, ce(!0), (kt = f.setPointerCapture) == null || kt.call(f, n.pointerId));
2066
2123
  },
2067
- [E, g, l, Q, F, I]
2068
- ), Zr = K(
2124
+ [_, m, l, rt, $, E]
2125
+ ), Xr = J(
2069
2126
  (n) => {
2070
- const d = Qe(Ot.current, n.clientX, n.clientY);
2071
- if (n.pointerType === "touch" && wt.current.has(n.pointerId) && (wt.current.set(n.pointerId, d), bt.current.active && wt.current.size >= 2)) {
2072
- const [p, P] = Array.from(wt.current.values()), U = Lr(p, P), St = Sr(p, P), zt = Ae(
2073
- bt.current.startZoom * (St / Math.max(1, bt.current.startDistance)),
2074
- lt,
2075
- ht
2127
+ const f = Ve(Nt.current, n.clientX, n.clientY);
2128
+ if (n.pointerType === "touch" && bt.current.has(n.pointerId) && (bt.current.set(n.pointerId, f), At.current.active && bt.current.size >= 2)) {
2129
+ const [x, k] = Array.from(bt.current.values()), tt = Er(x, k), kt = Ir(x, k), Ft = Ae(
2130
+ At.current.startZoom * (kt / Math.max(1, At.current.startDistance)),
2131
+ xt,
2132
+ Mt
2076
2133
  );
2077
- $({
2078
- zoom: zt,
2079
- x: U.x - bt.current.worldX * zt,
2080
- y: U.y - bt.current.worldY * zt
2134
+ K({
2135
+ zoom: Ft,
2136
+ x: tt.x - At.current.worldX * Ft,
2137
+ y: tt.y - At.current.worldY * Ft
2081
2138
  });
2082
2139
  return;
2083
2140
  }
2084
- if (kt) {
2085
- ae(
2086
- (p) => p && {
2087
- ...p,
2088
- endX: d.x,
2089
- endY: d.y
2141
+ if (St) {
2142
+ Jt(
2143
+ (x) => x && {
2144
+ ...x,
2145
+ endX: f.x,
2146
+ endY: f.y
2090
2147
  }
2091
2148
  );
2092
2149
  return;
2093
2150
  }
2094
- !g || !xt.current.active || $({
2095
- x: xt.current.originX + (d.x - xt.current.startX),
2096
- y: xt.current.originY + (d.y - xt.current.startY)
2151
+ !m || !gt.current.active || K({
2152
+ x: gt.current.originX + (f.x - gt.current.startX),
2153
+ y: gt.current.originY + (f.y - gt.current.startY)
2097
2154
  });
2098
2155
  },
2099
- [g, ht, lt, kt, $]
2100
- ), mr = K(
2156
+ [m, Mt, xt, St, K]
2157
+ ), cr = J(
2101
2158
  (n) => {
2102
- var d, p;
2103
- if (wt.current.delete(n.pointerId), wt.current.size < 2 && (bt.current.active = !1), kt) {
2104
- const P = kr(kt), U = {
2105
- x: (P.x - F.x) / F.zoom,
2106
- y: (P.y - F.y) / F.zoom,
2107
- width: P.width / F.zoom,
2108
- height: P.height / F.zoom
2109
- }, St = st.filter((et) => {
2110
- var le, gr;
2111
- const Qt = ((le = et.size) == null ? void 0 : le.width) ?? 0, Ce = ((gr = et.size) == null ? void 0 : gr.height) ?? 0;
2112
- return !(et.position.x + Qt < U.x || et.position.x > U.x + U.width || et.position.y + Ce < U.y || et.position.y > U.y + U.height);
2113
- }).map((et) => et.id), zt = Mt.filter((et) => {
2114
- const Qt = et.points.some(
2115
- (le) => Or(le.x, le.y, U)
2116
- ), Ce = !!et.labelPosition && Or(et.labelPosition.x, et.labelPosition.y, U);
2117
- return Qt || Ce;
2118
- }).map((et) => et.id);
2119
- tt((et) => ({
2120
- nodeIds: Array.from(/* @__PURE__ */ new Set([...et.nodeIds, ...St])),
2121
- edgeIds: Array.from(/* @__PURE__ */ new Set([...et.edgeIds, ...zt]))
2122
- })), ae(null);
2159
+ var f, x;
2160
+ if (bt.current.delete(n.pointerId), bt.current.size < 2 && (At.current.active = !1), St) {
2161
+ const k = _r(St), tt = {
2162
+ x: (k.x - $.x) / $.zoom,
2163
+ y: (k.y - $.y) / $.zoom,
2164
+ width: k.width / $.zoom,
2165
+ height: k.height / $.zoom
2166
+ }, kt = V.filter((nt) => {
2167
+ var ye, lr;
2168
+ const re = ((ye = nt.size) == null ? void 0 : ye.width) ?? 0, $e = ((lr = nt.size) == null ? void 0 : lr.height) ?? 0;
2169
+ return !(nt.position.x + re < tt.x || nt.position.x > tt.x + tt.width || nt.position.y + $e < tt.y || nt.position.y > tt.y + tt.height);
2170
+ }).map((nt) => nt.id), Ft = Q.filter((nt) => {
2171
+ const re = nt.points.some(
2172
+ (ye) => Tr(ye.x, ye.y, tt)
2173
+ ), $e = !!nt.labelPosition && Tr(nt.labelPosition.x, nt.labelPosition.y, tt);
2174
+ return re || $e;
2175
+ }).map((nt) => nt.id);
2176
+ dt((nt) => ({
2177
+ nodeIds: Array.from(/* @__PURE__ */ new Set([...nt.nodeIds, ...kt])),
2178
+ edgeIds: Array.from(/* @__PURE__ */ new Set([...nt.edgeIds, ...Ft]))
2179
+ })), Jt(null);
2123
2180
  }
2124
- xt.current.active = !1, Ie(!1), (p = (d = n.target).releasePointerCapture) == null || p.call(d, n.pointerId);
2181
+ gt.current.active = !1, ce(!1), (x = (f = n.target).releasePointerCapture) == null || x.call(f, n.pointerId);
2125
2182
  },
2126
- [Mt, st, kt, tt, F]
2127
- ), qr = K(
2183
+ [Q, V, St, dt, $]
2184
+ ), Br = J(
2128
2185
  (n) => {
2129
- if (!I || !Ot.current)
2186
+ if (!E || !Nt.current)
2130
2187
  return;
2131
2188
  n.preventDefault();
2132
- const d = Qe(Ot.current, n.clientX, n.clientY), p = t.current, P = (d.x - p.x) / p.zoom, U = (d.y - p.y) / p.zoom, St = Ae(
2133
- p.zoom + (n.deltaY < 0 ? m : -m),
2134
- lt,
2135
- ht
2189
+ const f = Ve(Nt.current, n.clientX, n.clientY), x = Se.current, k = (f.x - x.x) / x.zoom, tt = (f.y - x.y) / x.zoom, kt = Ae(
2190
+ x.zoom + (n.deltaY < 0 ? p : -p),
2191
+ xt,
2192
+ Mt
2136
2193
  );
2137
- $({
2138
- zoom: St,
2139
- x: d.x - P * St,
2140
- y: d.y - U * St
2194
+ K({
2195
+ zoom: kt,
2196
+ x: f.x - k * kt,
2197
+ y: f.y - tt * kt
2141
2198
  });
2142
2199
  },
2143
- [ht, lt, $, I, m]
2144
- ), Jr = K(
2200
+ [Mt, xt, K, E, p]
2201
+ ), Cr = J(
2145
2202
  (n) => {
2146
- if (L)
2203
+ if (R)
2147
2204
  switch (n.key) {
2148
2205
  case "+":
2149
2206
  case "=":
2150
- n.preventDefault(), $((d) => ({ zoom: d.zoom + m }));
2207
+ n.preventDefault(), K((f) => ({ zoom: f.zoom + p }));
2151
2208
  break;
2152
2209
  case "-":
2153
2210
  case "_":
2154
- n.preventDefault(), $((d) => ({ zoom: d.zoom - m }));
2211
+ n.preventDefault(), K((f) => ({ zoom: f.zoom - p }));
2155
2212
  break;
2156
2213
  case "0":
2157
- n.preventDefault(), Ct();
2214
+ n.preventDefault(), Ut();
2158
2215
  break;
2159
2216
  case "ArrowLeft":
2160
2217
  case "ArrowRight":
2161
2218
  case "ArrowUp":
2162
2219
  case "ArrowDown": {
2163
- if (n.preventDefault(), M) {
2164
- const d = It.get(M);
2165
- if (d) {
2166
- const p = n.key === "ArrowLeft" ? "left" : n.key === "ArrowRight" ? "right" : n.key === "ArrowUp" ? "up" : "down", P = Kn(d, st, p);
2167
- P && (C(P.id), Oe(P.id));
2220
+ if (n.preventDefault(), Et) {
2221
+ const f = ht.get(Et);
2222
+ if (f) {
2223
+ const x = n.key === "ArrowLeft" ? "left" : n.key === "ArrowRight" ? "right" : n.key === "ArrowUp" ? "up" : "down", k = $n(f, V, x);
2224
+ k && (vt(k.id), Oe(k.id));
2168
2225
  break;
2169
2226
  }
2170
2227
  }
2171
- $((d) => n.key === "ArrowLeft" ? { x: d.x + 32 } : n.key === "ArrowRight" ? { x: d.x - 32 } : n.key === "ArrowUp" ? { y: d.y + 32 } : { y: d.y - 32 });
2228
+ K((f) => n.key === "ArrowLeft" ? { x: f.x + 32 } : n.key === "ArrowRight" ? { x: f.x - 32 } : n.key === "ArrowUp" ? { y: f.y + 32 } : { y: f.y - 32 });
2172
2229
  break;
2173
2230
  }
2174
2231
  case "Enter":
2175
2232
  case " ": {
2176
- if (!M)
2233
+ if (!Et)
2177
2234
  break;
2178
2235
  n.preventDefault();
2179
- const d = It.get(M);
2180
- d && Be(d);
2236
+ const f = ht.get(Et);
2237
+ f && We(f);
2181
2238
  break;
2182
2239
  }
2183
2240
  case "Escape":
2184
- n.preventDefault(), At(null), tt(Ge), C(null);
2241
+ n.preventDefault(), jt(null), dt(Ue), vt(null);
2185
2242
  break;
2186
2243
  }
2187
2244
  },
2188
2245
  [
2189
2246
  Oe,
2190
- Ct,
2191
- M,
2192
- Be,
2193
- L,
2194
- It,
2195
- st,
2196
- At,
2197
- C,
2198
- tt,
2199
- $,
2200
- m
2247
+ Ut,
2248
+ Et,
2249
+ We,
2250
+ R,
2251
+ ht,
2252
+ V,
2253
+ jt,
2254
+ vt,
2255
+ dt,
2256
+ K,
2257
+ p
2201
2258
  ]
2202
- ), Qr = K(
2259
+ ), Ur = J(
2203
2260
  (n) => {
2204
- Zt(n);
2205
- const d = It.get(n);
2206
- d && Jt(d, !0);
2261
+ Qt(n);
2262
+ const f = ht.get(n);
2263
+ f && ee(f, !0);
2207
2264
  },
2208
- [Jt, It, Zt]
2209
- ), tn = K(() => {
2210
- const n = dr.current;
2265
+ [ee, ht, Qt]
2266
+ ), Gr = J(() => {
2267
+ const n = or.current;
2211
2268
  if (n) {
2212
- const d = It.get(n);
2213
- d && Jt(d, !1);
2269
+ const f = ht.get(n);
2270
+ f && ee(f, !1);
2214
2271
  }
2215
- Zt(null), At(null);
2216
- }, [Jt, It, At, Zt]), en = K(
2217
- (n, d, p) => {
2218
- At({ nodeId: n, sourceIndex: d, pathKey: p });
2219
- const P = It.get(n);
2220
- P && Jt(P, !0, "path");
2272
+ Qt(null), jt(null);
2273
+ }, [ee, ht, jt, Qt]), Hr = J(
2274
+ (n, f, x) => {
2275
+ jt({ nodeId: n, sourceIndex: f, pathKey: x });
2276
+ const k = ht.get(n);
2277
+ k && ee(k, !0, "path");
2221
2278
  },
2222
- [Jt, It, At]
2223
- ), rn = K(() => {
2224
- At(null);
2225
- }, [At]), nn = K(
2226
- (n, d) => {
2227
- const p = ar.get(n);
2228
- p && pr(p, d), b.hoverHighlight && (fr(d ? n : null), d && Zt(null));
2279
+ [ee, ht, jt]
2280
+ ), Kr = J(() => {
2281
+ jt(null);
2282
+ }, [jt]), Vr = J(
2283
+ (n, f) => {
2284
+ const x = Le.get(n);
2285
+ x && ar(x, f), T.hoverHighlight && (ir(f ? n : null), f && Qt(null));
2229
2286
  },
2230
- [b.hoverHighlight, pr, ar, fr, Zt]
2231
- ), on = k(
2287
+ [T.hoverHighlight, ar, Le, ir, Qt]
2288
+ ), qr = M(
2232
2289
  () => ({
2233
- background: gt.background,
2234
- fontFamily: gt.fontFamily,
2235
- cursor: be ? "grabbing" : g ? "grab" : "default",
2290
+ background: It.background,
2291
+ fontFamily: It.fontFamily,
2292
+ cursor: _e ? "grabbing" : m ? "grab" : "default",
2236
2293
  outline: "none",
2237
- touchAction: g || I ? "none" : "auto",
2294
+ touchAction: m || E ? "none" : "auto",
2238
2295
  overflow: "hidden",
2239
2296
  userSelect: "none"
2240
2297
  }),
2241
- [be, gt.background, gt.fontFamily, g, I]
2242
- ), yr = k(
2243
- () => Bn(b.width, b.height, y),
2244
- [b.height, b.width, y]
2245
- ), ue = kt ? kr(kt) : null, sn = X ? /* @__PURE__ */ N.jsx(
2298
+ [_e, It.background, It.fontFamily, m, E]
2299
+ ), ur = M(
2300
+ () => Nn(T.width, T.height, g),
2301
+ [T.height, T.width, g]
2302
+ ), me = St ? _r(St) : null, Jr = W ? /* @__PURE__ */ z.jsx(
2246
2303
  "g",
2247
2304
  {
2248
2305
  "aria-label": "viewport-controls",
2249
- transform: `translate(${yr.x}, ${yr.y})`,
2306
+ transform: `translate(${ur.x}, ${ur.y})`,
2250
2307
  children: [
2251
2308
  {
2252
2309
  key: "zoom-in",
2253
2310
  label: "+",
2254
2311
  width: Ht,
2255
- onClick: () => $((n) => ({ zoom: n.zoom + m }))
2312
+ onClick: () => K((n) => ({ zoom: n.zoom + p }))
2256
2313
  },
2257
2314
  {
2258
2315
  key: "zoom-out",
2259
2316
  label: "−",
2260
2317
  width: Ht,
2261
- onClick: () => $((n) => ({ zoom: n.zoom - m }))
2318
+ onClick: () => K((n) => ({ zoom: n.zoom - p }))
2262
2319
  },
2263
2320
  {
2264
2321
  key: "fit-view",
2265
2322
  label: "Fit",
2266
- width: ir,
2267
- onClick: () => Ct()
2323
+ width: tr,
2324
+ onClick: () => Ut()
2268
2325
  },
2269
2326
  {
2270
2327
  key: "reset-view",
2271
2328
  label: "1:1",
2272
- width: ir,
2273
- onClick: () => $(Ke)
2329
+ width: tr,
2330
+ onClick: () => K(xr)
2274
2331
  }
2275
2332
  ].reduce(
2276
- (n, d) => ({
2277
- x: n.x + d.width + Xr,
2278
- controls: [...n.controls, { ...d, x: n.x }]
2333
+ (n, f) => ({
2334
+ x: n.x + f.width + zr,
2335
+ controls: [...n.controls, { ...f, x: n.x }]
2279
2336
  }),
2280
2337
  { x: 0, controls: [] }
2281
- ).controls.map((n) => /* @__PURE__ */ N.jsxs(
2338
+ ).controls.map((n) => /* @__PURE__ */ z.jsxs(
2282
2339
  "g",
2283
2340
  {
2284
2341
  transform: `translate(${n.x}, 0)`,
2285
2342
  role: "button",
2286
2343
  tabIndex: 0,
2287
- onClick: (d) => {
2288
- d.stopPropagation(), n.onClick();
2344
+ onClick: (f) => {
2345
+ f.stopPropagation(), n.onClick();
2289
2346
  },
2290
- onKeyDown: (d) => {
2291
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), d.stopPropagation(), n.onClick());
2347
+ onKeyDown: (f) => {
2348
+ (f.key === "Enter" || f.key === " ") && (f.preventDefault(), f.stopPropagation(), n.onClick());
2292
2349
  },
2293
2350
  children: [
2294
- /* @__PURE__ */ N.jsx(
2351
+ /* @__PURE__ */ z.jsx(
2295
2352
  "rect",
2296
2353
  {
2297
2354
  width: n.width,
@@ -2302,7 +2359,7 @@ const Ke = { x: 0, y: 0, zoom: 1 }, Ge = { nodeIds: [], edgeIds: [] }, Wr = 0.25
2302
2359
  stroke: "rgba(15,23,42,0.18)"
2303
2360
  }
2304
2361
  ),
2305
- /* @__PURE__ */ N.jsx(
2362
+ /* @__PURE__ */ z.jsx(
2306
2363
  "text",
2307
2364
  {
2308
2365
  x: n.width / 2,
@@ -2320,190 +2377,190 @@ const Ke = { x: 0, y: 0, zoom: 1 }, Ge = { nodeIds: [], edgeIds: [] }, Wr = 0.25
2320
2377
  ))
2321
2378
  }
2322
2379
  ) : null;
2323
- return /* @__PURE__ */ N.jsxs(
2380
+ return /* @__PURE__ */ z.jsxs(
2324
2381
  "svg",
2325
2382
  {
2326
- ref: Ot,
2327
- width: b.width,
2328
- height: b.height,
2383
+ ref: Nt,
2384
+ width: T.width,
2385
+ height: T.height,
2329
2386
  role: "figure",
2330
2387
  "aria-label": "Graph",
2331
2388
  tabIndex: 0,
2332
- style: on,
2389
+ style: qr,
2333
2390
  onClick: (n) => {
2334
- n.target === n.currentTarget && (tt(Ge), At(null), C(null));
2391
+ n.target === n.currentTarget && (dt(Ue), jt(null), vt(null));
2335
2392
  },
2336
- onPointerDown: Vr,
2337
- onPointerMove: Zr,
2338
- onPointerUp: mr,
2339
- onPointerLeave: mr,
2340
- onWheel: qr,
2341
- onKeyDown: Jr,
2393
+ onPointerDown: $r,
2394
+ onPointerMove: Xr,
2395
+ onPointerUp: cr,
2396
+ onPointerLeave: cr,
2397
+ onWheel: Br,
2398
+ onKeyDown: Cr,
2342
2399
  children: [
2343
- Bt ? /* @__PURE__ */ N.jsxs("defs", { children: [
2344
- /* @__PURE__ */ N.jsx(
2400
+ Ct ? /* @__PURE__ */ z.jsxs("defs", { children: [
2401
+ /* @__PURE__ */ z.jsx(
2345
2402
  "marker",
2346
2403
  {
2347
- id: ce,
2404
+ id: Pe,
2348
2405
  viewBox: "0 0 10 10",
2349
2406
  refX: "6",
2350
2407
  refY: "5",
2351
2408
  markerWidth: "6",
2352
2409
  markerHeight: "6",
2353
2410
  orient: "auto-start-reverse",
2354
- children: /* @__PURE__ */ N.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: Ee })
2411
+ children: /* @__PURE__ */ z.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: Zt })
2355
2412
  }
2356
2413
  ),
2357
- /* @__PURE__ */ N.jsx(
2414
+ /* @__PURE__ */ z.jsx(
2358
2415
  "marker",
2359
2416
  {
2360
- id: Re,
2417
+ id: de,
2361
2418
  viewBox: "0 0 10 10",
2362
2419
  refX: "6",
2363
2420
  refY: "5",
2364
2421
  markerWidth: "6",
2365
2422
  markerHeight: "6",
2366
2423
  orient: "auto-start-reverse",
2367
- children: /* @__PURE__ */ N.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: b.hoverEdgeColor })
2424
+ children: /* @__PURE__ */ z.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: T.hoverEdgeColor })
2368
2425
  }
2369
2426
  ),
2370
- /* @__PURE__ */ N.jsx(
2427
+ /* @__PURE__ */ z.jsx(
2371
2428
  "marker",
2372
2429
  {
2373
- id: Se,
2430
+ id: he,
2374
2431
  viewBox: "0 0 10 10",
2375
2432
  refX: "6",
2376
2433
  refY: "5",
2377
2434
  markerWidth: "6",
2378
2435
  markerHeight: "6",
2379
2436
  orient: "auto-start-reverse",
2380
- children: /* @__PURE__ */ N.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: b.hoverNodeOutColor })
2437
+ children: /* @__PURE__ */ z.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: T.hoverNodeOutColor })
2381
2438
  }
2382
2439
  ),
2383
- /* @__PURE__ */ N.jsx(
2440
+ /* @__PURE__ */ z.jsx(
2384
2441
  "marker",
2385
2442
  {
2386
- id: Le,
2443
+ id: Re,
2387
2444
  viewBox: "0 0 10 10",
2388
2445
  refX: "6",
2389
2446
  refY: "5",
2390
2447
  markerWidth: "6",
2391
2448
  markerHeight: "6",
2392
2449
  orient: "auto-start-reverse",
2393
- children: /* @__PURE__ */ N.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: _e })
2450
+ children: /* @__PURE__ */ z.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: Dt })
2394
2451
  }
2395
2452
  )
2396
2453
  ] }) : null,
2397
- /* @__PURE__ */ N.jsx("g", { transform: `translate(${F.x}, ${F.y}) scale(${F.zoom})`, children: /* @__PURE__ */ N.jsxs("g", { ref: Dt, children: [
2398
- ne == null ? void 0 : ne(hr),
2399
- /* @__PURE__ */ N.jsx(
2400
- zn,
2454
+ /* @__PURE__ */ z.jsx("g", { transform: `translate(${$.x}, ${$.y}) scale(${$.zoom})`, children: /* @__PURE__ */ z.jsxs("g", { ref: Ne, children: [
2455
+ se == null ? void 0 : se(sr),
2456
+ /* @__PURE__ */ z.jsx(
2457
+ kn,
2401
2458
  {
2402
- positionedNodes: st,
2403
- layout: b.layout,
2404
- layoutDirection: b.layoutDirection,
2405
- labels: b.labels,
2406
- autoLabels: b.autoLabels,
2407
- labelOffset: b.labelOffset,
2408
- pillBackground: b.labelPillBackground,
2409
- pillBorderColor: b.labelPillBorderColor,
2410
- pillTextColor: b.labelPillTextColor
2459
+ positionedNodes: V,
2460
+ layout: T.layout,
2461
+ layoutDirection: T.layoutDirection,
2462
+ labels: T.labels,
2463
+ autoLabels: T.autoLabels,
2464
+ labelOffset: T.labelOffset,
2465
+ pillBackground: T.labelPillBackground,
2466
+ pillBorderColor: T.labelPillBorderColor,
2467
+ pillTextColor: T.labelPillTextColor
2411
2468
  }
2412
2469
  ),
2413
- /* @__PURE__ */ N.jsx("g", { "aria-label": "edges", children: Kr.map((n) => {
2414
- const d = b.hoverHighlight && (lr === n.id || Ut && (n.source === Ut || n.target === Ut)) || (qt == null ? void 0 : qt.edges.has(n.id)), p = Ut && !lr && n.type !== "undirected" && n.target === Ut;
2415
- return /* @__PURE__ */ N.jsx(
2416
- s,
2470
+ /* @__PURE__ */ z.jsx("g", { "aria-label": "edges", children: Yr.map((n) => {
2471
+ const f = T.hoverHighlight && (nr === n.id || Gt && (n.source === Gt || n.target === Gt)) || (te == null ? void 0 : te.edges.has(n.id)), x = Gt && !nr && n.type !== "undirected" && n.target === Gt;
2472
+ return /* @__PURE__ */ z.jsx(
2473
+ o,
2417
2474
  {
2418
2475
  edge: n,
2419
- color: Ee,
2420
- width: Xt,
2421
- curveEdges: b.curveEdges && b.routingStyle !== "orthogonal",
2422
- curveStrength: b.curveStrength,
2423
- markerEnd: Bt ? `url(#${ce})` : void 0,
2424
- isHovered: d,
2425
- isSelected: ft.has(n.id) || We.has(n.id),
2426
- hoverColor: p ? b.hoverNodeOutColor : b.hoverEdgeColor,
2427
- selectionColor: ft.has(n.id) ? _e : J,
2428
- labelColor: b.edgeLabelColor,
2429
- selectionMarker: Bt ? `url(#${Le})` : void 0,
2430
- hoverMarker: Bt ? p ? `url(#${Se})` : `url(#${Re})` : void 0,
2431
- hoverEnabled: b.hoverHighlight,
2432
- hitStrokeWidth: Xt + 8,
2433
- hoverStrokeWidth: Xt + 1.5,
2434
- selectedStrokeWidth: Xt + 1.5,
2435
- onHoverChange: (P) => nn(n.id, P),
2436
- onClick: () => Gr(n)
2476
+ color: Zt,
2477
+ width: Bt,
2478
+ curveEdges: T.curveEdges && T.routingStyle !== "orthogonal",
2479
+ curveStrength: T.curveStrength,
2480
+ markerEnd: Ct ? `url(#${Pe})` : void 0,
2481
+ isHovered: f,
2482
+ isSelected: j.has(n.id) || at.has(n.id),
2483
+ hoverColor: x ? T.hoverNodeOutColor : T.hoverEdgeColor,
2484
+ selectionColor: j.has(n.id) ? Dt : F,
2485
+ labelColor: T.edgeLabelColor,
2486
+ selectionMarker: Ct ? `url(#${Re})` : void 0,
2487
+ hoverMarker: Ct ? x ? `url(#${he})` : `url(#${de})` : void 0,
2488
+ hoverEnabled: T.hoverHighlight,
2489
+ hitStrokeWidth: Bt + 8,
2490
+ hoverStrokeWidth: Bt + 1.5,
2491
+ selectedStrokeWidth: Bt + 1.5,
2492
+ onHoverChange: (k) => Vr(n.id, k),
2493
+ onClick: () => Wr(n)
2437
2494
  },
2438
2495
  n.id
2439
2496
  );
2440
2497
  }) }),
2441
- /* @__PURE__ */ N.jsx("g", { "aria-label": "nodes", children: st.map((n) => /* @__PURE__ */ N.jsx(
2442
- Yr,
2498
+ /* @__PURE__ */ z.jsx("g", { "aria-label": "nodes", children: V.map((n) => /* @__PURE__ */ z.jsx(
2499
+ Ar,
2443
2500
  {
2444
2501
  node: n,
2445
2502
  Vertex: r,
2446
- isSelected: Z.has(n.id),
2447
- isFocused: M === n.id,
2448
- isHighlighted: $e.has(n.id),
2449
- activePathKey: Xe == null ? void 0 : Xe.pathKey,
2450
- activePathNodeIds: qt == null ? void 0 : qt.nodes,
2451
- highlightColor: J,
2503
+ isSelected: X.has(n.id),
2504
+ isFocused: Et === n.id,
2505
+ isHighlighted: q.has(n.id),
2506
+ activePathKey: Ye == null ? void 0 : Ye.pathKey,
2507
+ activePathNodeIds: te == null ? void 0 : te.nodes,
2508
+ highlightColor: F,
2452
2509
  selectionColor: mt,
2453
- nodeBorderColor: Fe,
2454
- nodeBorderWidth: Ye,
2455
- hoverNodeBorderColor: Te,
2456
- hoverNodeBothColor: Pe,
2457
- hoverNodeInColor: b.hoverNodeInColor,
2458
- hoverNodeOutColor: b.hoverNodeOutColor,
2459
- hoverNodeHighlight: b.hoverNodeHighlight,
2460
- hoveredNodeStates: Hr ?? void 0,
2461
- onNodeMeasure: Cr,
2462
- onNodeFocus: C,
2463
- onNodeClick: Be,
2464
- onNodeDoubleClick: Ur,
2465
- onNodeMouseEnter: Qr,
2466
- onNodeMouseLeave: tn,
2467
- onPathHover: en,
2468
- onPathLeave: rn
2510
+ nodeBorderColor: Te,
2511
+ nodeBorderWidth: Fe,
2512
+ hoverNodeBorderColor: le,
2513
+ hoverNodeBothColor: fe,
2514
+ hoverNodeInColor: T.hoverNodeInColor,
2515
+ hoverNodeOutColor: T.hoverNodeOutColor,
2516
+ hoverNodeHighlight: T.hoverNodeHighlight,
2517
+ hoveredNodeStates: Fr ?? void 0,
2518
+ onNodeMeasure: Z,
2519
+ onNodeFocus: vt,
2520
+ onNodeClick: We,
2521
+ onNodeDoubleClick: pe,
2522
+ onNodeMouseEnter: Ur,
2523
+ onNodeMouseLeave: Gr,
2524
+ onPathHover: Hr,
2525
+ onPathLeave: Kr
2469
2526
  },
2470
2527
  n.id
2471
2528
  )) }),
2472
- ie == null ? void 0 : ie(hr)
2529
+ ae == null ? void 0 : ae(sr)
2473
2530
  ] }) }),
2474
- ue ? /* @__PURE__ */ N.jsx(
2531
+ me ? /* @__PURE__ */ z.jsx(
2475
2532
  "rect",
2476
2533
  {
2477
- x: ue.x,
2478
- y: ue.y,
2479
- width: ue.width,
2480
- height: ue.height,
2534
+ x: me.x,
2535
+ y: me.y,
2536
+ width: me.width,
2537
+ height: me.height,
2481
2538
  fill: "rgba(59, 130, 246, 0.12)",
2482
2539
  stroke: "rgba(59, 130, 246, 0.8)",
2483
2540
  strokeDasharray: "6 4",
2484
2541
  pointerEvents: "none"
2485
2542
  }
2486
2543
  ) : null,
2487
- sn
2544
+ Jr
2488
2545
  ]
2489
2546
  }
2490
2547
  );
2491
- }, Br = re.memo(
2492
- re.forwardRef(Gn)
2548
+ }, Nr = oe.memo(
2549
+ oe.forwardRef(Xn)
2493
2550
  );
2494
- Br.displayName = "Graph";
2495
- const Jn = Br;
2551
+ Nr.displayName = "Graph";
2552
+ const Gn = Nr;
2496
2553
  export {
2497
- Ln as EdgePath,
2498
- ei as EdgeType,
2499
- Jn as Graph,
2500
- ri as LayoutDirection,
2501
- ni as LayoutType,
2502
- ii as NodeSide,
2503
- si as buildEdgePath,
2504
- ai as fromNxGraph,
2505
- jr as groupPositionedNodesByColumn,
2506
- ci as layoutNodes,
2507
- ui as renderGraphToSvg,
2508
- li as routeEdges
2554
+ En as EdgePath,
2555
+ Vn as EdgeType,
2556
+ Gn as Graph,
2557
+ qn as LayoutDirection,
2558
+ Jn as LayoutType,
2559
+ Zn as NodeSide,
2560
+ ti as buildEdgePath,
2561
+ ei as fromNxGraph,
2562
+ kr as groupPositionedNodesByColumn,
2563
+ ri as layoutNodes,
2564
+ ni as renderGraphToSvg,
2565
+ ii as routeEdges
2509
2566
  };