likec4 1.58.0 → 1.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/__app__/codegen/webcomponent.mjs +14 -14
  2. package/__app__/src/chunks/AIChat.mjs +153 -156
  3. package/__app__/src/chunks/LikeC4Styles.mjs +1553 -1255
  4. package/__app__/src/chunks/ProjectsOverview.mjs +127 -130
  5. package/__app__/src/chunks/hooks.mjs +419 -106
  6. package/__app__/src/chunks/libs/@floating-ui.mjs +8 -8
  7. package/__app__/src/chunks/libs/@mantine.mjs +3039 -2135
  8. package/__app__/src/chunks/libs/@tanstack-ai.mjs +4 -4
  9. package/__app__/src/chunks/libs/@tanstack.mjs +93 -118
  10. package/__app__/src/chunks/libs/@xstate/react.mjs +30 -16
  11. package/__app__/src/chunks/libs/@xyflow/react.mjs +50 -26
  12. package/__app__/src/chunks/libs/bezier-js.mjs +11 -8
  13. package/__app__/src/chunks/libs/framer.mjs +1188 -1155
  14. package/__app__/src/chunks/libs/zod.mjs +191 -188
  15. package/__app__/src/chunks/rolldown-runtime.mjs +8 -1
  16. package/__app__/src/chunks/styled-system.mjs +23 -16
  17. package/__app__/src/main.mjs +22275 -9432
  18. package/__app__/src/style.css +1 -1
  19. package/dist/chunks/dist.mjs +10 -0
  20. package/dist/chunks/enableServer.mjs +1 -1
  21. package/dist/chunks/index.d.mts +9 -9
  22. package/dist/chunks/index2.d.mts +386 -229
  23. package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
  24. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +1 -1
  25. package/dist/chunks/libs/@logtape/logtape.mjs +3 -3
  26. package/dist/chunks/libs/@ts-graphviz/common.d.mts +1 -2
  27. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
  28. package/dist/chunks/libs/chevrotain-allstar.mjs +1 -1
  29. package/dist/chunks/libs/chevrotain.mjs +4 -4
  30. package/dist/chunks/libs/json5.mjs +1 -1
  31. package/dist/chunks/libs/langium.d.mts +2940 -2914
  32. package/dist/chunks/libs/langium.mjs +9 -9
  33. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  34. package/dist/chunks/libs/p-queue.mjs +1 -1
  35. package/dist/chunks/libs/package-manager-detector.mjs +1 -1
  36. package/dist/chunks/libs/pako.mjs +1 -1
  37. package/dist/chunks/libs/picomatch.mjs +1 -1
  38. package/dist/chunks/libs/remeda.mjs +1 -1
  39. package/dist/chunks/libs/unstorage.d.mts +1 -0
  40. package/dist/chunks/libs/which.mjs +1 -1
  41. package/dist/chunks/libs/zod.d.mts +48 -36
  42. package/dist/chunks/libs/zod.mjs +4 -4
  43. package/dist/chunks/logger.mjs +1 -0
  44. package/dist/chunks/node.mjs +57 -66
  45. package/dist/chunks/rolldown-runtime.mjs +1 -1
  46. package/dist/chunks/sequence-view.mjs +1 -1
  47. package/dist/chunks/vite-plugin.mjs +43 -43
  48. package/dist/cli/index.mjs +159 -157
  49. package/dist/index.d.mts +2 -3
  50. package/dist/index.mjs +1 -1
  51. package/dist/model/index.d.mts +5 -4
  52. package/dist/vite-plugin/index.d.mts +6 -9
  53. package/dist/vite-plugin/internal/index.d.mts +15 -10
  54. package/package.json +37 -37
  55. package/react/index.d.mts +761 -111
  56. package/react/index.mjs +13974 -10232
  57. package/__app__/src/chunks/DiagramActorProvider.mjs +0 -7638
  58. package/__app__/src/chunks/Markdown.mjs +0 -146
  59. package/__app__/src/chunks/NavigationPanel.mjs +0 -61
  60. package/__app__/src/chunks/adhoc-editor.mjs +0 -3386
  61. package/__app__/src/chunks/libs/@dagrejs/dagre.mjs +0 -1894
  62. package/__app__/src/chunks/libs/@tabler/icons-react.mjs +0 -252
  63. package/__app__/src/chunks/libs/remeda.mjs +0 -642
@@ -1,10 +1,10 @@
1
1
  import { i as e } from "../../rolldown-runtime.mjs";
2
2
  import { useCallback as t, useEffect as n, useLayoutEffect as r, useState as i } from "react";
3
3
  import { useSyncExternalStoreWithSelector as a } from "use-sync-external-store/shim/with-selector";
4
- //#region ../../node_modules/.pnpm/use-isomorphic-layout-effect@1.2.1_@types+react@19.2.16_react@19.2.7/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js
4
+ //#region ../../node_modules/.pnpm/use-isomorphic-layout-effect@1.2.1_@types+react@19.2.17_react@19.2.7/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js
5
5
  var o = r;
6
6
  //#endregion
7
- //#region ../../node_modules/.pnpm/xstate@5.32.0/node_modules/xstate/dist/xstate-dev.esm.js
7
+ //#region ../../node_modules/.pnpm/xstate@5.32.4/node_modules/xstate/dist/xstate-dev.esm.js
8
8
  function getGlobal() {
9
9
  if (typeof globalThis < "u") return globalThis;
10
10
  if (typeof self < "u") return self;
@@ -192,9 +192,11 @@ function createSystem(e, t) {
192
192
  id: i,
193
193
  startedAt: Date.now()
194
194
  }, c = createScheduledEventId(e, i);
195
- u._snapshot._scheduledEvents[c] = a, o[c] = s.setTimeout(() => {
195
+ u._snapshot._scheduledEvents[c] = a;
196
+ let l = s.setTimeout(() => {
196
197
  delete o[c], delete u._snapshot._scheduledEvents[c], u._relay(e, t, n);
197
198
  }, r);
199
+ o[c] = l;
198
200
  },
199
201
  cancel: (e, t) => {
200
202
  let n = createScheduledEventId(e, t), r = o[n];
@@ -259,7 +261,7 @@ function createSystem(e, t) {
259
261
  };
260
262
  return u;
261
263
  }
262
- var m = !1, h = /* @__PURE__ */ function(e) {
264
+ var m = !1, h = /*#__PURE__*/ function(e) {
263
265
  return e[e.NotStarted = 0] = "NotStarted", e[e.Running = 1] = "Running", e[e.Stopped = 2] = "Stopped", e;
264
266
  }({}), g = {
265
267
  clock: {
@@ -619,6 +621,15 @@ function stopChild(e) {
619
621
  function stop(e, t) {}
620
622
  return stop.type = "xstate.stopChild", stop.actorRef = e, stop.resolve = resolveStop, stop.execute = executeStop, stop;
621
623
  }
624
+ function checkNot(e, { context: t, event: n }, { guards: r }) {
625
+ return !evaluateGuard(r[0], t, n, e);
626
+ }
627
+ function not(e) {
628
+ function not(e, t) {
629
+ return !1;
630
+ }
631
+ return not.check = checkNot, not.guards = [e], not;
632
+ }
622
633
  function checkAnd(e, { context: t, event: n }, { guards: r }) {
623
634
  return r.every((r) => evaluateGuard(r, t, n, e));
624
635
  }
@@ -704,7 +715,8 @@ function isInFinalState(e, t) {
704
715
  }
705
716
  var isStateId = (e) => e[0] === c;
706
717
  function getCandidates(e, t) {
707
- return e.transitions.get(t) || [...e.transitions.keys()].filter((e) => matchesEventDescriptor(t, e)).sort((e, t) => t.length - e.length).flatMap((t) => e.transitions.get(t));
718
+ let n = e.transitions.get(t), r = [...e.transitions.keys()].filter((e) => e !== t && matchesEventDescriptor(t, e)).sort((e, t) => t.length - e.length).flatMap((t) => e.transitions.get(t));
719
+ return n ? [...n, ...r] : r;
708
720
  }
709
721
  function getDelayedTransitions(e) {
710
722
  let t = e.config.after;
@@ -829,7 +841,7 @@ function resolveTarget(e, t) {
829
841
  }
830
842
  function resolveHistoryDefaultTransition(e) {
831
843
  let t = normalizeTarget(e.config.target);
832
- return t ? { target: t.map((t) => typeof t == "string" ? getStateNodeByPath(e.parent, t) : t) } : e.parent.initial;
844
+ return t ? { target: t.map((t) => typeof t == "string" ? getStateNodeByPath(e.parent, t) : t) } : e.parent.type === "parallel" ? { target: [e.parent] } : e.parent.initial;
833
845
  }
834
846
  function isHistoryNode(e) {
835
847
  return e.type === "history";
@@ -1301,7 +1313,7 @@ function raise(e, t) {
1301
1313
  function raise(e, t) {}
1302
1314
  return raise.type = "xstate.raise", raise.event = e, raise.id = t?.id, raise.delay = t?.delay, raise.resolve = resolveRaise, raise.execute = executeRaise, raise;
1303
1315
  }
1304
- var S = /* @__PURE__ */ new WeakMap();
1316
+ var S = /* #__PURE__ */ new WeakMap();
1305
1317
  function fromCallback(e) {
1306
1318
  return {
1307
1319
  config: e,
@@ -1403,7 +1415,7 @@ function fromPromise(e) {
1403
1415
  };
1404
1416
  }
1405
1417
  //#endregion
1406
- //#region ../../node_modules/.pnpm/xstate@5.32.0/node_modules/xstate/dist/assign-2aa58daa.esm.js
1418
+ //#region ../../node_modules/.pnpm/xstate@5.32.4/node_modules/xstate/dist/assign-29f23f4d.esm.js
1407
1419
  function createSpawner(e, { machine: t, context: n }, r, i) {
1408
1420
  let spawn = (a, o) => {
1409
1421
  if (typeof a == "string") {
@@ -1469,7 +1481,7 @@ function assign(e) {
1469
1481
  return assign.type = "xstate.assign", assign.assignment = e, assign.resolve = resolveAssign, assign;
1470
1482
  }
1471
1483
  //#endregion
1472
- //#region ../../node_modules/.pnpm/xstate@5.32.0/node_modules/xstate/dist/StateMachine-45e79c35.esm.js
1484
+ //#region ../../node_modules/.pnpm/xstate@5.32.4/node_modules/xstate/dist/StateMachine-5f345bba.esm.js
1473
1485
  var E = /* @__PURE__ */ new WeakMap();
1474
1486
  function memo$1(e, t, n) {
1475
1487
  let r = E.get(e);
@@ -1690,14 +1702,16 @@ var D = {}, toSerializableAction = (e) => typeof e == "string" ? { type: e } : t
1690
1702
  let n = {}, r = e.children;
1691
1703
  Object.keys(r).forEach((e) => {
1692
1704
  let i = r[e], a = i.snapshot, o = i.src, s = typeof o == "string" ? resolveReferencedActor(this, o) : o;
1693
- s && (n[e] = createActor(s, {
1705
+ if (!s) return;
1706
+ let c = createActor(s, {
1694
1707
  id: e,
1695
1708
  parent: t.self,
1696
1709
  syncSnapshot: i.syncSnapshot,
1697
1710
  snapshot: a,
1698
1711
  src: o,
1699
1712
  systemId: i.systemId
1700
- }));
1713
+ });
1714
+ n[e] = c;
1701
1715
  });
1702
1716
  function resolveHistoryReferencedState(e, t) {
1703
1717
  if (t instanceof O) return t;
@@ -1742,7 +1756,7 @@ var D = {}, toSerializableAction = (e) => typeof e == "string" ? { type: e } : t
1742
1756
  }
1743
1757
  };
1744
1758
  //#endregion
1745
- //#region ../../node_modules/.pnpm/xstate@5.32.0/node_modules/xstate/dist/log-605ef461.esm.js
1759
+ //#region ../../node_modules/.pnpm/xstate@5.32.4/node_modules/xstate/dist/log-79409d72.esm.js
1746
1760
  function resolveEmit(e, t, n, r, { event: i }) {
1747
1761
  return [
1748
1762
  t,
@@ -1757,7 +1771,7 @@ function emit(e) {
1757
1771
  function emit(e, t) {}
1758
1772
  return emit.type = "xstate.emit", emit.event = e, emit.resolve = resolveEmit, emit.execute = executeEmit, emit;
1759
1773
  }
1760
- var A = /* @__PURE__ */ function(e) {
1774
+ var A = /*#__PURE__*/ function(e) {
1761
1775
  return e.Parent = "#_parent", e.Internal = "#_internal", e;
1762
1776
  }({});
1763
1777
  function resolveSendTo(e, t, n, r, { to: i, event: a, id: o, delay: s }, c) {
@@ -1862,7 +1876,7 @@ function log(e = ({ context: e, event: t }) => ({
1862
1876
  return log.type = "xstate.log", log.value = e, log.label = t, log.resolve = resolveLog, log.execute = executeLog, log;
1863
1877
  }
1864
1878
  //#endregion
1865
- //#region ../../node_modules/.pnpm/xstate@5.32.0/node_modules/xstate/dist/xstate.esm.js
1879
+ //#region ../../node_modules/.pnpm/xstate@5.32.4/node_modules/xstate/dist/xstate.esm.js
1866
1880
  function assertEvent(e, t) {
1867
1881
  let n = toArray(t);
1868
1882
  if (!n.some((t) => matchesEventDescriptor(e.type, t))) {
@@ -1914,7 +1928,7 @@ function setup({ schemas: e, actors: t, actions: n, guards: r, delays: i }) {
1914
1928
  };
1915
1929
  }
1916
1930
  //#endregion
1917
- //#region ../../node_modules/.pnpm/@xstate+react@6.1.0_@types+react@19.2.16_react@19.2.7_xstate@5.32.0/node_modules/@xstate/react/dist/xstate-react.esm.js
1931
+ //#region ../../node_modules/.pnpm/@xstate+react@6.1.0_@types+react@19.2.17_react@19.2.7_xstate@5.32.4/node_modules/@xstate/react/dist/xstate-react.esm.js
1918
1932
  var forEachActor = (e, t) => {
1919
1933
  t(e);
1920
1934
  let n = e.getSnapshot().children;
@@ -1979,4 +1993,4 @@ function useSelector(e, n, r = defaultCompare) {
1979
1993
  return a(i, o, o, n, r);
1980
1994
  }
1981
1995
  //#endregion
1982
- export { stopChild as _, emit as a, sendTo as c, fromPromise as d, and as f, spawnChild as g, raise as h, setup as i, assign as l, or as m, useSelector as n, enqueueActions as o, cancel as p, assertEvent as r, log as s, useActorRef as t, fromCallback as u };
1996
+ export { spawnChild as _, emit as a, sendTo as c, fromPromise as d, and as f, raise as g, or as h, setup as i, assign as l, not as m, useSelector as n, enqueueActions as o, cancel as p, assertEvent as r, log as s, useActorRef as t, fromCallback as u, stopChild as v };
@@ -866,7 +866,7 @@ function adoptUserNodes(e, t, n, r = {}) {
866
866
  function updateParentLookup(e, t) {
867
867
  if (!e.parentId) return;
868
868
  let n = t.get(e.parentId);
869
- n ? n.set(e.id, e) : t.set(e.parentId, new Map([[e.id, e]]));
869
+ n ? n.set(e.id, e) : t.set(e.parentId, /* @__PURE__ */ new Map([[e.id, e]]));
870
870
  }
871
871
  function updateChildNode(e, t, n, r, i) {
872
872
  let { elevateNodesOnSelect: a, nodeOrigin: o, nodeExtent: s, zIndexMode: c } = mergeObjects(H, r), l = e.parentId, u = t.get(l);
@@ -1036,6 +1036,13 @@ function updateConnectionLookup(e, t, n) {
1036
1036
  addConnectionToLookup("source", s, `${i}-${o}--${n}-${a}`, e, n, a), addConnectionToLookup("target", s, c, e, i, o), t.set(r.id, r);
1037
1037
  }
1038
1038
  }
1039
+ function shallowNodeData(e, t) {
1040
+ if (e === null || t === null) return !1;
1041
+ let n = Array.isArray(e) ? e : [e], r = Array.isArray(t) ? t : [t];
1042
+ if (n.length !== r.length) return !1;
1043
+ for (let e = 0; e < n.length; e++) if (n[e].id !== r[e].id || n[e].type !== r[e].type || !Object.is(n[e].data, r[e].data)) return !1;
1044
+ return !0;
1045
+ }
1039
1046
  function isParentSelected(e, t) {
1040
1047
  if (!e.parentId) return !1;
1041
1048
  let n = t.get(e.parentId);
@@ -1859,7 +1866,7 @@ function XYResizer({ domNode: e, nodeId: t, getStoreItems: r, onChange: i, onEnd
1859
1866
  };
1860
1867
  }
1861
1868
  //#endregion
1862
- //#region ../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.16_immer@11.1.8_react@19.2.7/node_modules/zustand/esm/vanilla.mjs
1869
+ //#region ../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.17_immer@11.1.9_react@19.2.7/node_modules/zustand/esm/vanilla.mjs
1863
1870
  var createStoreImpl = (e) => {
1864
1871
  let t, n = /* @__PURE__ */ new Set(), setState = (e, r) => {
1865
1872
  let i = typeof e == "function" ? e(t) : e;
@@ -1887,7 +1894,7 @@ var createWithEqualityFnImpl = (e, t) => {
1887
1894
  return Object.assign(useBoundStoreWithEqualityFn, n), useBoundStoreWithEqualityFn;
1888
1895
  }, createWithEqualityFn = (e, t) => e ? createWithEqualityFnImpl(e, t) : createWithEqualityFnImpl;
1889
1896
  //#endregion
1890
- //#region ../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.16_immer@11.1.8_react@19.2.7/node_modules/zustand/esm/shallow.mjs
1897
+ //#region ../../node_modules/.pnpm/zustand@4.5.7_@types+react@19.2.17_immer@11.1.9_react@19.2.7/node_modules/zustand/esm/shallow.mjs
1891
1898
  function shallow$1(e, t) {
1892
1899
  if (Object.is(e, t)) return !0;
1893
1900
  if (typeof e != "object" || !e || typeof t != "object" || !t) return !1;
@@ -1907,7 +1914,7 @@ function shallow$1(e, t) {
1907
1914
  return !0;
1908
1915
  }
1909
1916
  //#endregion
1910
- //#region ../../node_modules/.pnpm/@xyflow+react@12.11.0_@types+react-dom@19.2.3_@types+react@19.2.16__@types+react@19.2.1_dd8a26ae72693173562f7f85bb6ade55/node_modules/@xyflow/react/dist/esm/index.js
1917
+ //#region ../../node_modules/.pnpm/@xyflow+react@12.11.0_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react@19.2.1_3f98c81d1be2f678246222686ea3d156/node_modules/@xyflow/react/dist/esm/index.js
1911
1918
  var X = u(null), ne = X.Provider, re = T.error001("react");
1912
1919
  function useStore(e, t) {
1913
1920
  let n = m(X);
@@ -3193,7 +3200,7 @@ function useNodeObserver({ node: e, nodeType: t, hasDimensions: n, resizeObserve
3193
3200
  }, []), h(() => {
3194
3201
  if (a.current) {
3195
3202
  let n = l.current !== t, r = s.current !== e.sourcePosition, o = c.current !== e.targetPosition;
3196
- (n || r || o) && (l.current = t, s.current = e.sourcePosition, c.current = e.targetPosition, i.getState().updateNodeInternals(new Map([[e.id, {
3203
+ (n || r || o) && (l.current = t, s.current = e.sourcePosition, c.current = e.targetPosition, i.getState().updateNodeInternals(/* @__PURE__ */ new Map([[e.id, {
3197
3204
  id: e.id,
3198
3205
  nodeElement: a.current,
3199
3206
  force: !0
@@ -3240,13 +3247,15 @@ function NodeWrapper({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMou
3240
3247
  }), t && t(n, { ...b.userNode });
3241
3248
  }, onKeyDown = (t) => {
3242
3249
  if (!(isInputDOMNode(t.nativeEvent) || m)) {
3243
- if (D.includes(t.key) && O) handleNodeClick({
3244
- id: e,
3245
- store: j,
3246
- unselect: t.key === "Escape",
3247
- nodeRef: N
3248
- });
3249
- else if (E && y.selected && Object.prototype.hasOwnProperty.call(xe, t.key)) {
3250
+ if (D.includes(t.key) && O) {
3251
+ let n = t.key === "Escape";
3252
+ handleNodeClick({
3253
+ id: e,
3254
+ store: j,
3255
+ unselect: n,
3256
+ nodeRef: N
3257
+ });
3258
+ } else if (E && y.selected && Object.prototype.hasOwnProperty.call(xe, t.key)) {
3250
3259
  t.preventDefault();
3251
3260
  let { ariaLabelConfig: e } = j.getState();
3252
3261
  j.setState({ ariaLiveMessage: e["node.a11yDescription.ariaLiveMessage"]({
@@ -3262,7 +3271,7 @@ function NodeWrapper({ id: e, onClick: t, onMouseEnter: n, onMouseMove: r, onMou
3262
3271
  }, onFocus = () => {
3263
3272
  if (m || !N.current?.matches(":focus-visible")) return;
3264
3273
  let { transform: t, width: n, height: r, autoPanOnNodeFocus: i, setCenter: a } = j.getState();
3265
- i && (getNodesInside(new Map([[e, y]]), {
3274
+ i && (getNodesInside(/* @__PURE__ */ new Map([[e, y]]), {
3266
3275
  x: 0,
3267
3276
  y: 0,
3268
3277
  width: n,
@@ -4400,7 +4409,7 @@ var Ke = f(GraphViewComponent), qe = createDevWarn("React Flow", "https://reactf
4400
4409
  i(e.map((e) => createSelectionChange(e, !0)));
4401
4410
  return;
4402
4411
  }
4403
- i(getSelectionChanges(r, new Set([...e]), !0)), a(getSelectionChanges(n));
4412
+ i(getSelectionChanges(r, /* @__PURE__ */ new Set([...e]), !0)), a(getSelectionChanges(n));
4404
4413
  },
4405
4414
  addSelectedEdges: (e) => {
4406
4415
  let { multiSelectionActive: t, edgeLookup: n, nodeLookup: r, triggerNodeChanges: i, triggerEdgeChanges: a } = m();
@@ -4408,7 +4417,7 @@ var Ke = f(GraphViewComponent), qe = createDevWarn("React Flow", "https://reactf
4408
4417
  a(e.map((e) => createSelectionChange(e, !0)));
4409
4418
  return;
4410
4419
  }
4411
- a(getSelectionChanges(n, new Set([...e]))), i(getSelectionChanges(r, /* @__PURE__ */ new Set(), !0));
4420
+ a(getSelectionChanges(n, /* @__PURE__ */ new Set([...e]))), i(getSelectionChanges(r, /* @__PURE__ */ new Set(), !0));
4412
4421
  },
4413
4422
  unselectNodesAndEdges: ({ nodes: e, edges: t } = {}) => {
4414
4423
  let { edges: n, nodes: r, nodeLookup: i, triggerNodeChanges: a, triggerEdgeChanges: o } = m(), s = e || r, c = t || n, l = [];
@@ -4717,6 +4726,20 @@ function ViewportPortal({ children: e }) {
4717
4726
  return t ? w(e, t) : null;
4718
4727
  }
4719
4728
  T.error014();
4729
+ function useNodesData(e) {
4730
+ return useStore(p((t) => {
4731
+ let n = [], r = Array.isArray(e), i = r ? e : [e];
4732
+ for (let e of i) {
4733
+ let r = t.nodeLookup.get(e);
4734
+ r && n.push({
4735
+ id: r.id,
4736
+ type: r.type,
4737
+ data: r.data
4738
+ });
4739
+ }
4740
+ return r ? n : n[0] ?? null;
4741
+ }, [e]), shallowNodeData);
4742
+ }
4720
4743
  function LinePattern({ dimensions: e, lineWidth: t, variant: n, className: r }) {
4721
4744
  return x("path", {
4722
4745
  strokeWidth: t,
@@ -4899,7 +4922,8 @@ function ControlsComponent({ style: e, showZoom: t = !0, showFitView: n = !0, sh
4899
4922
  ]
4900
4923
  });
4901
4924
  }
4902
- ControlsComponent.displayName = "Controls", f(ControlsComponent);
4925
+ ControlsComponent.displayName = "Controls";
4926
+ var Qe = f(ControlsComponent);
4903
4927
  function MiniMapNodeComponent({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, strokeColor: s, strokeWidth: c, className: l, borderRadius: u, shapeRendering: d, selected: f, onClick: p }) {
4904
4928
  let { background: m, backgroundColor: h } = a || {}, g = o || m || h;
4905
4929
  return x("rect", {
@@ -4923,10 +4947,10 @@ function MiniMapNodeComponent({ id: e, x: t, y: n, width: r, height: i, style: a
4923
4947
  onClick: p ? (t) => p(t, e) : void 0
4924
4948
  });
4925
4949
  }
4926
- var Qe = f(MiniMapNodeComponent), selectorNodeIds = (e) => e.nodes.map((e) => e.id), getAttrFunction = (e) => e instanceof Function ? e : () => e;
4927
- function MiniMapNodes({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorderRadius: r = 5, nodeStrokeWidth: i, nodeComponent: a = Qe, onClick: o }) {
4950
+ var $e = f(MiniMapNodeComponent), selectorNodeIds = (e) => e.nodes.map((e) => e.id), getAttrFunction = (e) => e instanceof Function ? e : () => e;
4951
+ function MiniMapNodes({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorderRadius: r = 5, nodeStrokeWidth: i, nodeComponent: a = $e, onClick: o }) {
4928
4952
  let s = useStore(selectorNodeIds, shallow$1), c = getAttrFunction(t), l = getAttrFunction(e), u = getAttrFunction(n), d = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
4929
- return x(b, { children: s.map((e) => x($e, {
4953
+ return x(b, { children: s.map((e) => x(et, {
4930
4954
  id: e,
4931
4955
  nodeColorFunc: c,
4932
4956
  nodeStrokeColorFunc: l,
@@ -4974,7 +4998,7 @@ function NodeComponentWrapperInner({ id: e, nodeColorFunc: t, nodeStrokeColorFun
4974
4998
  id: l.id
4975
4999
  });
4976
5000
  }
4977
- var $e = f(NodeComponentWrapperInner), et = f(MiniMapNodes), tt = 200, nt = 150, filterHidden = (e) => !e.hidden, selector$1 = (e) => {
5001
+ var et = f(NodeComponentWrapperInner), tt = f(MiniMapNodes), nt = 200, rt = 150, filterHidden = (e) => !e.hidden, selector$1 = (e) => {
4978
5002
  let t = {
4979
5003
  x: -e.transform[0] / e.transform[2],
4980
5004
  y: -e.transform[1] / e.transform[2],
@@ -4991,9 +5015,9 @@ var $e = f(NodeComponentWrapperInner), et = f(MiniMapNodes), tt = 200, nt = 150,
4991
5015
  flowHeight: e.height,
4992
5016
  ariaLabelConfig: e.ariaLabelConfig
4993
5017
  };
4994
- }, rt = "react-flow__minimap-desc";
5018
+ }, it = "react-flow__minimap-desc";
4995
5019
  function MiniMapComponent({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClassName: i = "", nodeBorderRadius: a = 5, nodeStrokeWidth: o, nodeComponent: s, bgColor: c, maskColor: l, maskStrokeColor: u, maskStrokeWidth: d, position: f = "bottom-right", onClick: m, onNodeClick: g, pannable: _ = !1, zoomable: y = !1, ariaLabel: b, inversePan: C, zoomStep: w = 1, offsetScale: T = 5 }) {
4996
- let E = useStoreApi(), D = v(null), { boundingRect: O, viewBB: k, rfId: A, panZoom: j, translateExtent: M, flowWidth: N, flowHeight: P, ariaLabelConfig: F } = useStore(selector$1, shallow$1), I = e?.width ?? tt, L = e?.height ?? nt, R = O.width / I, z = O.height / L, B = Math.max(R, z), V = B * I, H = B * L, U = T * B, W = O.x - (V - O.width) / 2 - U, G = O.y - (H - O.height) / 2 - U, K = V + U * 2, q = H + U * 2, J = `${rt}-${A}`, ee = v(0), Y = v();
5020
+ let E = useStoreApi(), D = v(null), { boundingRect: O, viewBB: k, rfId: A, panZoom: j, translateExtent: M, flowWidth: N, flowHeight: P, ariaLabelConfig: F } = useStore(selector$1, shallow$1), I = e?.width ?? nt, L = e?.height ?? rt, R = O.width / I, z = O.height / L, B = Math.max(R, z), V = B * I, H = B * L, U = T * B, W = O.x - (V - O.width) / 2 - U, G = O.y - (H - O.height) / 2 - U, K = V + U * 2, q = H + U * 2, J = `${it}-${A}`, ee = v(0), Y = v();
4997
5021
  ee.current = B, h(() => {
4998
5022
  if (D.current && j) return Y.current = XYMinimap({
4999
5023
  domNode: D.current,
@@ -5060,7 +5084,7 @@ function MiniMapComponent({ style: e, className: t, nodeStrokeColor: n, nodeColo
5060
5084
  id: J,
5061
5085
  children: ne
5062
5086
  }),
5063
- x(et, {
5087
+ x(tt, {
5064
5088
  onClick: X,
5065
5089
  nodeColor: r,
5066
5090
  nodeStrokeColor: n,
@@ -5081,12 +5105,12 @@ function MiniMapComponent({ style: e, className: t, nodeStrokeColor: n, nodeColo
5081
5105
  });
5082
5106
  }
5083
5107
  MiniMapComponent.displayName = "MiniMap", f(MiniMapComponent);
5084
- var scaleSelector = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, it = {
5108
+ var scaleSelector = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, at = {
5085
5109
  [K.Line]: "right",
5086
5110
  [K.Handle]: "bottom-right"
5087
5111
  };
5088
5112
  function ResizeControl({ nodeId: e, position: t, variant: n = K.Handle, className: r, style: i = void 0, children: a, color: o, minWidth: s = 10, minHeight: c = 10, maxWidth: l = Number.MAX_VALUE, maxHeight: u = Number.MAX_VALUE, keepAspectRatio: d = !1, resizeDirection: f, autoScale: m = !0, shouldResize: g, onResizeStart: _, onResize: y, onResizeEnd: b }) {
5089
- let S = useNodeId(), C = typeof e == "string" ? e : S, w = useStoreApi(), T = v(null), E = n === K.Handle, D = useStore(p(scaleSelector(E && m), [E, m]), shallow$1), O = v(null), k = t ?? it[n];
5113
+ let S = useNodeId(), C = typeof e == "string" ? e : S, w = useStoreApi(), T = v(null), E = n === K.Handle, D = useStore(p(scaleSelector(E && m), [E, m]), shallow$1), O = v(null), k = t ?? at[n];
5090
5114
  return h(() => {
5091
5115
  if (!(!T.current || !C)) return O.current ||= XYResizer({
5092
5116
  domNode: T.current,
@@ -5253,4 +5277,4 @@ function NodeToolbar({ nodeId: e, children: t, className: n, style: r, isVisible
5253
5277
  }) });
5254
5278
  }
5255
5279
  //#endregion
5256
- export { nodeToRect as C, isMacOs as S, getEdgePosition as _, NodeToolbar as a, getSmoothStepPath as b, ViewportPortal as c, Ye as d, useReactFlow as f, getBezierPath as g, F as h, Q as i, applyEdgeChanges as l, useStoreApi as m, $ as n, Z as o, useStore as p, EdgeLabelRenderer as r, ReactFlowProvider as s, Ze as t, applyNodeChanges as u, getNodeDimensions as v, getViewportForBounds as x, getNodesBounds as y };
5280
+ export { getViewportForBounds as C, getSmoothStepPath as S, nodeToRect as T, F as _, Q as a, getNodeDimensions as b, ReactFlowProvider as c, applyNodeChanges as d, Ye as f, useStoreApi as g, useStore as h, EdgeLabelRenderer as i, ViewportPortal as l, useReactFlow as m, $ as n, NodeToolbar as o, useNodesData as p, Qe as r, Z as s, Ze as t, applyEdgeChanges as u, getBezierPath as v, isMacOs as w, getNodesBounds as x, getEdgePosition as y };
@@ -522,7 +522,10 @@ var c = Math.PI, l = 2 * c, u = c / 2, f = 1e-6, p = 2 ** 53 - 1 || 900719925474
522
522
  this._linear = f.reduce((e, n) => e + v(n.y), 0) < p / 50, this._lut = [], this._t1 = 0, this._t2 = 1, this.update();
523
523
  }
524
524
  static quadraticFromPoints(e, n, r, i) {
525
- return i === void 0 && (i = .5), i === 0 ? new Bezier(n, n, r) : i === 1 ? new Bezier(e, n, n) : new Bezier(e, Bezier.getABC(2, e, n, r, i).A, r);
525
+ if (i === void 0 && (i = .5), i === 0) return new Bezier(n, n, r);
526
+ if (i === 1) return new Bezier(e, n, n);
527
+ let a = Bezier.getABC(2, e, n, r, i);
528
+ return new Bezier(e, a.A, r);
526
529
  }
527
530
  static cubicFromPoints(e, n, r, i, a) {
528
531
  i === void 0 && (i = .5);
@@ -540,14 +543,14 @@ var c = Math.PI, l = 2 * c, u = c / 2, f = 1e-6, p = 2 ** 53 - 1 || 900719925474
540
543
  }, x = {
541
544
  x: y.x + (v.x - y.x) / i,
542
545
  y: y.y + (v.y - y.y) / i
543
- };
544
- return new Bezier(e, {
546
+ }, S = {
545
547
  x: e.x + (b.x - e.x) / i,
546
548
  y: e.y + (b.y - e.y) / i
547
- }, {
549
+ }, C = {
548
550
  x: r.x + (x.x - r.x) / (1 - i),
549
551
  y: r.y + (x.y - r.y) / (1 - i)
550
- }, r);
552
+ };
553
+ return new Bezier(e, S, C, r);
551
554
  }
552
555
  static getUtils() {
553
556
  return g;
@@ -782,14 +785,14 @@ var c = Math.PI, l = 2 * c, u = c / 2, f = 1e-6, p = 2 ** 53 - 1 || 900719925474
782
785
  return this._3d && (a.z = r.z + i.z * n), a;
783
786
  }
784
787
  if (this._linear) {
785
- let n = this.normal(0);
786
- return [new Bezier(this.points.map(function(r) {
788
+ let n = this.normal(0), r = this.points.map(function(r) {
787
789
  let i = {
788
790
  x: r.x + e * n.x,
789
791
  y: r.y + e * n.y
790
792
  };
791
793
  return r.z && n.z && (i.z = r.z + e * n.z), i;
792
- }))];
794
+ });
795
+ return [new Bezier(r)];
793
796
  }
794
797
  return this.reduce().map(function(n) {
795
798
  return n._linear ? n.offset(e)[0] : n.scale(e);