@workflow/web 4.0.1-beta.20 → 4.0.1-beta.21
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/server-reference-manifest.json +17 -17
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page/server-reference-manifest.json +32 -17
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/run/[runId]/page/server-reference-manifest.json +32 -17
- package/.next/server/app/run/[runId]/page.js.nft.json +1 -1
- package/.next/server/app/run/[runId]/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1365a866._.js +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__1365a866._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__2168651f._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__2168651f._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__25c4ca9a._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__25c4ca9a._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__d416fa5e._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__d416fa5e._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__e576a2e1._.js +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__e576a2e1._.js.map +1 -1
- package/.next/server/chunks/ssr/_af28dabd._.js +1 -1
- package/.next/server/chunks/ssr/_af28dabd._.js.map +1 -1
- package/.next/server/chunks/ssr/_bff7cae2._.js +9 -0
- package/.next/server/chunks/ssr/_bff7cae2._.js.map +1 -0
- package/.next/server/chunks/ssr/_c8bf1458._.js +9 -0
- package/.next/server/chunks/ssr/_c8bf1458._.js.map +1 -0
- package/.next/server/chunks/ssr/{node_modules__pnpm_604882ab._.js → node_modules__pnpm_1053b681._.js} +2 -2
- package/.next/server/chunks/ssr/node_modules__pnpm_9ac28e5c._.js +3 -0
- package/.next/server/chunks/ssr/node_modules__pnpm_9ac28e5c._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules__pnpm_c6ddcd47._.js +1 -1
- package/.next/server/chunks/ssr/node_modules__pnpm_c6ddcd47._.js.map +1 -1
- package/.next/server/chunks/ssr/node_modules__pnpm_ecc06f40._.js +3 -0
- package/.next/server/chunks/ssr/node_modules__pnpm_ecc06f40._.js.map +1 -0
- package/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js +5 -1
- package/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web_src_app_run_[runId]_page_tsx_c7d0b139._.js +6 -6
- package/.next/server/chunks/ssr/packages_web_src_app_run_[runId]_page_tsx_c7d0b139._.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web_src_components_ui_select_tsx_7c5238ef._.js +1 -1
- package/.next/server/chunks/ssr/packages_web_src_components_ui_select_tsx_7c5238ef._.js.map +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +40 -18
- package/.next/static/chunks/080d73f6a8a7055f.js +1 -0
- package/.next/static/chunks/0bf0e3b66b375058.js +2 -0
- package/.next/static/chunks/1633a4677cb7eacd.js +7 -0
- package/.next/static/chunks/19288057adbbaf16.css +2 -0
- package/.next/static/chunks/7993564ea9cd3862.js +60 -0
- package/.next/static/chunks/826c531268249b18.js +1 -0
- package/.next/static/chunks/915c48af605695f8.js +5 -0
- package/.next/static/chunks/a2fdd31ef7d1ed50.js +154 -0
- package/.next/static/chunks/b39dd1bd2af229c0.css +3 -0
- package/.next/static/chunks/{f860cef1a19defc2.js → c41b2f1bfdc5f91e.js} +1 -1
- package/.next/static/chunks/d3781b000675e89a.js +7 -0
- package/.next/static/chunks/ebaf4c277606b4fc.js +14 -0
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/package.json +4 -4
- package/.next/server/chunks/ssr/_5587a26a._.js +0 -3
- package/.next/server/chunks/ssr/_5587a26a._.js.map +0 -1
- package/.next/server/chunks/ssr/_905b4948._.js +0 -3
- package/.next/server/chunks/ssr/_905b4948._.js.map +0 -1
- package/.next/static/chunks/0ba5474f4ed4a8c8.js +0 -154
- package/.next/static/chunks/3cf543bacb44cfb5.js +0 -1
- package/.next/static/chunks/65a1beec565c5452.js +0 -1
- package/.next/static/chunks/74dc45834647aebe.css +0 -3
- package/.next/static/chunks/a6a14ee8e38e3e97.js +0 -14
- package/.next/static/chunks/e1532e8c78b14240.js +0 -1
- package/.next/static/chunks/e834043d5d00c377.js +0 -60
- package/.next/static/chunks/ed676821fd9c42fe.js +0 -1
- package/.next/static/chunks/f00878722fec5692.js +0 -2
- /package/.next/server/chunks/ssr/{node_modules__pnpm_604882ab._.js.map → node_modules__pnpm_1053b681._.js.map} +0 -0
- /package/.next/static/{kDel5ryx8YzI2wcHKGqt0 → 1Gd0u_mHFXgTr2DR4OTNR}/_buildManifest.js +0 -0
- /package/.next/static/{kDel5ryx8YzI2wcHKGqt0 → 1Gd0u_mHFXgTr2DR4OTNR}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{kDel5ryx8YzI2wcHKGqt0 → 1Gd0u_mHFXgTr2DR4OTNR}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../node_modules/.pnpm/lucide-react%400.469.0_react%4019.1.0/node_modules/lucide-react/src/icons/git-branch.ts","../../../../../../node_modules/.pnpm/lucide-react%400.469.0_react%4019.1.0/node_modules/lucide-react/src/icons/loader-circle.ts","../../../../../../node_modules/.pnpm/lucide-react%400.469.0_react%4019.1.0/node_modules/lucide-react/src/icons/ellipsis.ts","../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-roving-focus%401.1.11_%40types%2Breact-dom%4019.1.9_%40types%2Breact%4019.1.13__%40type_b7a7790b842ae8a9e7e8c79619f909a7/node_modules/%40radix-ui/react-roving-focus/dist/index.mjs","../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-tabs%401.1.13_%40types%2Breact-dom%4019.1.9_%40types%2Breact%4019.1.13__%40types%2Breact%40_049622907eccd02dfa6261aa64d1ddaa/node_modules/%40radix-ui/react-tabs/dist/index.mjs","../../../../../../packages/web/src/components/ui/tabs.tsx","../../../../../../packages/web/src/lib/flow-graph/use-workflow-graph.ts","../../../../../../packages/web-shared/dist/api/data%3A023e5c%20%3Ctext/javascript%3E","../../../../../../packages/web/src/lib/flow-graph/manifest-adapter.ts","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/_lib/defaultOptions.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/_lib/format/longFormatters.js","../../../../../../packages/web/src/components/display-utils/copyable-text.tsx","../../../../../../packages/web/src/components/display-utils/relative-time.tsx","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/_lib/protectedTokens.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/_lib/getRoundingMethod.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/_lib/addLeadingZeros.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/locale/en-US/_lib/localize.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/_lib/normalizeDates.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/locale/en-US/_lib/match.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/_lib/format/formatters.js","../../../../../../node_modules/.pnpm/lucide-react%400.469.0_react%4019.1.0/node_modules/lucide-react/src/icons/copy.ts","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/locale/en-US.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/_lib/format/lightFormatters.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/format.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/constants.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/getDayOfYear.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/startOfYear.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/getISOWeekYear.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/startOfDay.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/getISOWeek.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/startOfISOWeek.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/constructNow.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/isDate.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/startOfISOWeekYear.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/isValid.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/startOfWeek.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/compareAsc.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/constructFrom.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/differenceInCalendarDays.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/toDate.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/getWeekYear.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/getWeek.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/formatRelative.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/startOfWeekYear.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/formatDistanceToNowStrict.js","../../../../../../node_modules/.pnpm/date-fns%404.1.0/node_modules/date-fns/formatDistanceStrict.js","../../../../../../packages/web/src/components/display-utils/status-badge.tsx","../../../../../../node_modules/.pnpm/use-sync-external-store%401.5.0_react%4019.1.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../../../../../../node_modules/.pnpm/use-sync-external-store%401.5.0_react%4019.1.0/node_modules/use-sync-external-store/shim/with-selector.js","../../../../../../node_modules/.pnpm/%40xyflow%2Breact%4012.9.3_%40types%2Breact%4019.1.13_react-dom%4019.1.0_react%4019.1.0__react%4019.1.0/node_modules/%40xyflow/react/dist/esm/index.js","../../../../../../node_modules/.pnpm/classcat%405.0.5/node_modules/classcat/index.js","../../../../../../node_modules/.pnpm/d3-drag%403.0.0/node_modules/d3-drag/src/drag.js","../../../../../../node_modules/.pnpm/d3-drag%403.0.0/node_modules/d3-drag/src/constant.js","../../../../../../node_modules/.pnpm/d3-drag%403.0.0/node_modules/d3-drag/src/event.js","../../../../../../node_modules/.pnpm/%40xyflow%2Bsystem%400.0.73/node_modules/%40xyflow/system/dist/esm/index.js","../../../../../../node_modules/.pnpm/zustand%404.5.7_%40types%2Breact%4019.1.13_react%4019.1.0/node_modules/zustand/esm/traditional.mjs","../../../../../../node_modules/.pnpm/zustand%404.5.7_%40types%2Breact%4019.1.13_react%4019.1.0/node_modules/zustand/esm/vanilla.mjs","../../../../../../node_modules/.pnpm/zustand%404.5.7_%40types%2Breact%4019.1.13_react%4019.1.0/node_modules/zustand/esm/shallow.mjs","../../../../../../packages/web/src/components/ui/badge.tsx","../../../../../../packages/web/src/components/flow-graph/workflow-graph-viewer.tsx","../../../../../../node_modules/.pnpm/lucide-react%400.469.0_react%4019.1.0/node_modules/lucide-react/src/icons/circle-stop.ts","../../../../../../node_modules/.pnpm/lucide-react%400.469.0_react%4019.1.0/node_modules/lucide-react/src/icons/clock.ts","../../../../../../node_modules/.pnpm/lucide-react%400.469.0_react%4019.1.0/node_modules/lucide-react/src/icons/link-2.ts","../../../../../../node_modules/.pnpm/lucide-react%400.469.0_react%4019.1.0/node_modules/lucide-react/src/icons/circle-play.ts","../../../../../../node_modules/.pnpm/lucide-react%400.469.0_react%4019.1.0/node_modules/lucide-react/src/icons/circle-x.ts","../../../../../../node_modules/.pnpm/lucide-react%400.469.0_react%4019.1.0/node_modules/lucide-react/src/icons/rotate-cw.ts","../../../../../../packages/web/src/components/run-actions.tsx","../../../../../../packages/web/src/components/ui/skeleton.tsx","../../../../../../packages/web/src/lib/url-state.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name GitBranch\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/git-branch\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst GitBranch = createLucideIcon('GitBranch', [\n ['line', { x1: '6', x2: '6', y1: '3', y2: '15', key: '17qcm7' }],\n ['circle', { cx: '18', cy: '6', r: '3', key: '1h7g24' }],\n ['circle', { cx: '6', cy: '18', r: '3', key: 'fqmcym' }],\n ['path', { d: 'M18 9a9 9 0 0 1-9 9', key: 'n2h4wq' }],\n]);\n\nexport default GitBranch;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name LoaderCircle\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/loader-circle\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst LoaderCircle = createLucideIcon('LoaderCircle', [\n ['path', { d: 'M21 12a9 9 0 1 1-6.219-8.56', key: '13zald' }],\n]);\n\nexport default LoaderCircle;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Ellipsis\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/ellipsis\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Ellipsis = createLucideIcon('Ellipsis', [\n ['circle', { cx: '12', cy: '12', r: '1', key: '41hilf' }],\n ['circle', { cx: '19', cy: '12', r: '1', key: '1wjl8i' }],\n ['circle', { cx: '5', cy: '12', r: '1', key: '1pcz8c' }],\n]);\n\nexport default Ellipsis;\n","\"use client\";\n\n// src/roving-focus-group.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n }),\n children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/tabs.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { createRovingFocusGroupScope } from \"@radix-ui/react-roving-focus\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport * as RovingFocusGroup from \"@radix-ui/react-roving-focus\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { jsx } from \"react/jsx-runtime\";\nvar TABS_NAME = \"Tabs\";\nvar [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [\n createRovingFocusGroupScope\n]);\nvar useRovingFocusGroupScope = createRovingFocusGroupScope();\nvar [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);\nvar Tabs = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeTabs,\n value: valueProp,\n onValueChange,\n defaultValue,\n orientation = \"horizontal\",\n dir,\n activationMode = \"automatic\",\n ...tabsProps\n } = props;\n const direction = useDirection(dir);\n const [value, setValue] = useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n defaultProp: defaultValue ?? \"\",\n caller: TABS_NAME\n });\n return /* @__PURE__ */ jsx(\n TabsProvider,\n {\n scope: __scopeTabs,\n baseId: useId(),\n value,\n onValueChange: setValue,\n orientation,\n dir: direction,\n activationMode,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n dir: direction,\n \"data-orientation\": orientation,\n ...tabsProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\nTabs.displayName = TABS_NAME;\nvar TAB_LIST_NAME = \"TabsList\";\nvar TabsList = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTabs, loop = true, ...listProps } = props;\n const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);\n return /* @__PURE__ */ jsx(\n RovingFocusGroup.Root,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n orientation: context.orientation,\n dir: context.dir,\n loop,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"tablist\",\n \"aria-orientation\": context.orientation,\n ...listProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\nTabsList.displayName = TAB_LIST_NAME;\nvar TRIGGER_NAME = \"TabsTrigger\";\nvar TabsTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTabs, value, disabled = false, ...triggerProps } = props;\n const context = useTabsContext(TRIGGER_NAME, __scopeTabs);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);\n const triggerId = makeTriggerId(context.baseId, value);\n const contentId = makeContentId(context.baseId, value);\n const isSelected = value === context.value;\n return /* @__PURE__ */ jsx(\n RovingFocusGroup.Item,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n focusable: !disabled,\n active: isSelected,\n children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n role: \"tab\",\n \"aria-selected\": isSelected,\n \"aria-controls\": contentId,\n \"data-state\": isSelected ? \"active\" : \"inactive\",\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n id: triggerId,\n ...triggerProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onValueChange(value);\n } else {\n event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if ([\" \", \"Enter\"].includes(event.key)) context.onValueChange(value);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => {\n const isAutomaticActivation = context.activationMode !== \"manual\";\n if (!isSelected && !disabled && isAutomaticActivation) {\n context.onValueChange(value);\n }\n })\n }\n )\n }\n );\n }\n);\nTabsTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"TabsContent\";\nvar TabsContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTabs, value, forceMount, children, ...contentProps } = props;\n const context = useTabsContext(CONTENT_NAME, __scopeTabs);\n const triggerId = makeTriggerId(context.baseId, value);\n const contentId = makeContentId(context.baseId, value);\n const isSelected = value === context.value;\n const isMountAnimationPreventedRef = React.useRef(isSelected);\n React.useEffect(() => {\n const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);\n return () => cancelAnimationFrame(rAF);\n }, []);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": isSelected ? \"active\" : \"inactive\",\n \"data-orientation\": context.orientation,\n role: \"tabpanel\",\n \"aria-labelledby\": triggerId,\n hidden: !present,\n id: contentId,\n tabIndex: 0,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...props.style,\n animationDuration: isMountAnimationPreventedRef.current ? \"0s\" : void 0\n },\n children: present && children\n }\n ) });\n }\n);\nTabsContent.displayName = CONTENT_NAME;\nfunction makeTriggerId(baseId, value) {\n return `${baseId}-trigger-${value}`;\n}\nfunction makeContentId(baseId, value) {\n return `${baseId}-content-${value}`;\n}\nvar Root2 = Tabs;\nvar List = TabsList;\nvar Trigger = TabsTrigger;\nvar Content = TabsContent;\nexport {\n Content,\n List,\n Root2 as Root,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n Trigger,\n createTabsScope\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport type * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nfunction Tabs({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn('flex flex-col gap-2', className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n 'bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg border border-input p-[3px]',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n 'inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn('flex-1 outline-none', className)}\n {...props}\n />\n );\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","'use client';\n\nimport {\n unwrapServerActionResult,\n WorkflowWebAPIError,\n} from '@workflow/web-shared';\nimport { fetchWorkflowsManifest } from '@workflow/web-shared/server';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { worldConfigToEnvMap } from '@/lib/config';\nimport type { WorldConfig } from '@/lib/config-world';\nimport { adaptManifest } from '@/lib/flow-graph/manifest-adapter';\nimport type { WorkflowGraphManifest } from '@/lib/flow-graph/workflow-graph-types';\n\n/**\n * Hook to fetch the workflow graph manifest from the workflow data directory\n * The manifest contains static structure information about all workflows\n */\nexport function useWorkflowGraphManifest(config: WorldConfig) {\n const [manifest, setManifest] = useState<WorkflowGraphManifest | null>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n const isFetchingRef = useRef(false);\n\n const fetchManifest = useCallback(async () => {\n if (isFetchingRef.current) {\n return;\n }\n isFetchingRef.current = true;\n setLoading(true);\n setError(null);\n\n try {\n const env = worldConfigToEnvMap(config);\n console.log('[useWorkflowGraphManifest] Fetching with env:', env);\n const { result: rawManifest, error } = await unwrapServerActionResult(\n fetchWorkflowsManifest(env)\n );\n if (error) {\n setError(error);\n return;\n }\n console.log(\n '[useWorkflowGraphManifest] Raw manifest after unwrap:',\n rawManifest\n );\n console.log(\n '[useWorkflowGraphManifest] Workflows in raw:',\n Object.keys(rawManifest?.workflows || {})\n );\n\n // Transform the new manifest format to the format expected by UI components\n const adaptedManifest = adaptManifest(rawManifest);\n console.log(\n '[useWorkflowGraphManifest] Adapted manifest workflows:',\n Object.keys(adaptedManifest.workflows)\n );\n setManifest(adaptedManifest);\n } catch (err) {\n const error =\n err instanceof WorkflowWebAPIError\n ? err\n : err instanceof Error\n ? new WorkflowWebAPIError(err.message, {\n cause: err,\n layer: 'client',\n })\n : new WorkflowWebAPIError(String(err), { layer: 'client' });\n setError(error);\n setManifest(null);\n } finally {\n setLoading(false);\n isFetchingRef.current = false;\n }\n }, [config]);\n\n useEffect(() => {\n fetchManifest();\n }, [fetchManifest]);\n\n return {\n manifest,\n loading,\n error,\n refetch: fetchManifest,\n };\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"40e6caa6d7f53d3d5dd7573c4b318b482a32f6a2ed\":\"fetchWorkflowsManifest\"},\"packages/web-shared/dist/api/workflow-server-actions.js\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";export var fetchWorkflowsManifest=/*#__PURE__*/createServerReference(\"40e6caa6d7f53d3d5dd7573c4b318b482a32f6a2ed\",callServer,void 0,findSourceMapURL,\"fetchWorkflowsManifest\");","/**\n * Adapter to convert the new manifest format to the format expected by UI components\n * The new manifest has a nested structure and doesn't include node positions,\n * so this adapter transforms the data and calculates layout positions.\n */\n\nimport type {\n GraphEdge,\n GraphNode,\n RawGraphNode,\n RawWorkflowsManifest,\n WorkflowGraph,\n WorkflowGraphManifest,\n} from './workflow-graph-types';\n\n/**\n * Layout constants for auto-positioning nodes\n */\nconst LAYOUT = {\n NODE_WIDTH: 220,\n NODE_HEIGHT: 100,\n HORIZONTAL_SPACING: 280,\n VERTICAL_SPACING: 320,\n START_X: 250,\n START_Y: 50,\n};\n\n/**\n * Calculates initial positions for nodes using a topological layout\n * Nodes are arranged vertically by depth, with parallel nodes spread horizontally\n */\nfunction calculateNodePositions(\n rawNodes: RawGraphNode[],\n edges: GraphEdge[]\n): GraphNode[] {\n if (rawNodes.length === 0) return [];\n\n // Build adjacency maps\n const outgoing = new Map<string, string[]>();\n const incoming = new Map<string, string[]>();\n\n for (const edge of edges) {\n const out = outgoing.get(edge.source) || [];\n out.push(edge.target);\n outgoing.set(edge.source, out);\n\n const inc = incoming.get(edge.target) || [];\n inc.push(edge.source);\n incoming.set(edge.target, inc);\n }\n\n // Find start node\n const startNode = rawNodes.find((n) => n.data.nodeKind === 'workflow_start');\n if (!startNode) {\n // Fallback: just stack nodes vertically\n return rawNodes.map((node, idx) => ({\n id: node.id,\n type: node.type,\n data: {\n label: node.data.label,\n nodeKind: node.data.nodeKind as\n | 'workflow_start'\n | 'workflow_end'\n | 'step'\n | 'primitive'\n | 'agent'\n | 'tool',\n stepId: node.data.stepId,\n },\n metadata: node.metadata,\n position: {\n x: LAYOUT.START_X,\n y: LAYOUT.START_Y + idx * LAYOUT.VERTICAL_SPACING,\n },\n }));\n }\n\n // BFS to assign layers (y-positions based on depth from start)\n // Skip back-edges (loops) to avoid infinite loops in the algorithm\n const layers = new Map<string, number>();\n const visited = new Set<string>();\n const queue: string[] = [startNode.id];\n layers.set(startNode.id, 0);\n\n while (queue.length > 0) {\n const nodeId = queue.shift()!;\n\n // Skip if already fully processed\n if (visited.has(nodeId)) continue;\n visited.add(nodeId);\n\n const currentLayer = layers.get(nodeId)!;\n const targets = outgoing.get(nodeId) || [];\n\n for (const target of targets) {\n // Skip self-loops and back-edges to already visited nodes\n if (target === nodeId || visited.has(target)) continue;\n\n if (!layers.has(target)) {\n layers.set(target, currentLayer + 1);\n queue.push(target);\n } else {\n // Ensure we use the maximum layer for nodes with multiple incoming edges\n // This handles join points after parallel execution\n const existingLayer = layers.get(target)!;\n if (currentLayer + 1 > existingLayer) {\n layers.set(target, currentLayer + 1);\n // Only re-add if not already in queue\n if (!queue.includes(target)) {\n queue.push(target);\n }\n }\n }\n }\n }\n\n // Handle any nodes not reached by BFS (disconnected nodes)\n let maxLayer = Math.max(...Array.from(layers.values()), 0);\n for (const node of rawNodes) {\n if (!layers.has(node.id)) {\n maxLayer++;\n layers.set(node.id, maxLayer);\n }\n }\n\n // Group nodes by layer\n const nodesByLayer = new Map<number, RawGraphNode[]>();\n for (const node of rawNodes) {\n const layer = layers.get(node.id) ?? 0;\n const layerNodes = nodesByLayer.get(layer) || [];\n layerNodes.push(node);\n nodesByLayer.set(layer, layerNodes);\n }\n\n // Assign positions\n const positioned: GraphNode[] = [];\n for (const node of rawNodes) {\n const layer = layers.get(node.id) ?? 0;\n const layerNodes = nodesByLayer.get(layer) || [node];\n const indexInLayer = layerNodes.findIndex((n) => n.id === node.id);\n const layerWidth = layerNodes.length;\n\n // Center nodes horizontally within their layer\n const totalWidth = (layerWidth - 1) * LAYOUT.HORIZONTAL_SPACING;\n const startX = LAYOUT.START_X - totalWidth / 2;\n\n positioned.push({\n id: node.id,\n type: node.type,\n data: {\n label: node.data.label,\n nodeKind: node.data.nodeKind as\n | 'workflow_start'\n | 'workflow_end'\n | 'step'\n | 'primitive'\n | 'agent'\n | 'tool',\n stepId: node.data.stepId,\n },\n metadata: node.metadata,\n position: {\n x: startX + indexInLayer * LAYOUT.HORIZONTAL_SPACING,\n y: LAYOUT.START_Y + layer * LAYOUT.VERTICAL_SPACING,\n },\n });\n }\n\n return positioned;\n}\n\n/**\n * Converts the new manifest format to the format expected by UI components\n *\n * New format:\n * {\n * version: \"1.0.0\",\n * steps: { [filePath]: { [stepName]: { stepId } } },\n * workflows: { [filePath]: { [workflowName]: { workflowId, graph: { nodes, edges } } } }\n * }\n *\n * Expected format:\n * {\n * version: \"1.0.0\",\n * workflows: { [workflowId]: { workflowId, workflowName, filePath, nodes, edges } }\n * }\n */\nexport function adaptManifest(\n raw: RawWorkflowsManifest\n): WorkflowGraphManifest {\n const workflows: Record<string, WorkflowGraph> = {};\n\n console.log('[adaptManifest] Raw manifest version:', raw?.version);\n console.log(\n '[adaptManifest] Raw workflows keys:',\n Object.keys(raw?.workflows || {})\n );\n\n if (!raw?.workflows) {\n console.log('[adaptManifest] No workflows in manifest, returning empty');\n return { version: raw?.version || '1.0.0', workflows: {} };\n }\n\n for (const [filePath, workflowsInFile] of Object.entries(raw.workflows)) {\n for (const [workflowName, entry] of Object.entries(workflowsInFile)) {\n // Calculate positions for nodes since they're not provided\n const positionedNodes = calculateNodePositions(\n entry.graph.nodes,\n entry.graph.edges\n );\n\n const workflowGraph: WorkflowGraph = {\n workflowId: entry.workflowId,\n workflowName: workflowName,\n filePath: filePath,\n nodes: positionedNodes,\n edges: entry.graph.edges,\n };\n\n // Use workflowId as the key for lookup\n workflows[entry.workflowId] = workflowGraph;\n }\n }\n\n console.log(\n '[adaptManifest] Adapted workflows count:',\n Object.keys(workflows).length\n );\n\n return {\n version: raw.version,\n workflows,\n };\n}\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n","const formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, _date, _baseDate, _options) =>\n formatRelativeLocale[token];\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","const dateLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"P\":\n return formatLong.date({ width: \"short\" });\n case \"PP\":\n return formatLong.date({ width: \"medium\" });\n case \"PPP\":\n return formatLong.date({ width: \"long\" });\n case \"PPPP\":\n default:\n return formatLong.date({ width: \"full\" });\n }\n};\n\nconst timeLongFormatter = (pattern, formatLong) => {\n switch (pattern) {\n case \"p\":\n return formatLong.time({ width: \"short\" });\n case \"pp\":\n return formatLong.time({ width: \"medium\" });\n case \"ppp\":\n return formatLong.time({ width: \"long\" });\n case \"pppp\":\n default:\n return formatLong.time({ width: \"full\" });\n }\n};\n\nconst dateTimeLongFormatter = (pattern, formatLong) => {\n const matchResult = pattern.match(/(P+)(p+)?/) || [];\n const datePattern = matchResult[1];\n const timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n let dateTimeFormat;\n\n switch (datePattern) {\n case \"P\":\n dateTimeFormat = formatLong.dateTime({ width: \"short\" });\n break;\n case \"PP\":\n dateTimeFormat = formatLong.dateTime({ width: \"medium\" });\n break;\n case \"PPP\":\n dateTimeFormat = formatLong.dateTime({ width: \"long\" });\n break;\n case \"PPPP\":\n default:\n dateTimeFormat = formatLong.dateTime({ width: \"full\" });\n break;\n }\n\n return dateTimeFormat\n .replace(\"{{date}}\", dateLongFormatter(datePattern, formatLong))\n .replace(\"{{time}}\", timeLongFormatter(timePattern, formatLong));\n};\n\nexport const longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter,\n};\n","'use client';\n\nimport { Check, Copy } from 'lucide-react';\nimport { useState } from 'react';\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport { cn } from '@/lib/utils';\n\ninterface CopyableTextProps {\n text: string;\n children: React.ReactNode;\n className?: string;\n /** If true, the copy button overlaps the text on the right */\n overlay?: boolean;\n}\n\nexport function CopyableText({\n text,\n children,\n className,\n overlay,\n}: CopyableTextProps) {\n const [copied, setCopied] = useState(false);\n\n const handleCopy = async (e: React.MouseEvent) => {\n e.stopPropagation();\n try {\n await navigator.clipboard.writeText(text);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch (err) {\n console.error('Failed to copy text:', err);\n }\n };\n\n if (overlay) {\n return (\n <span className={cn('relative group/copy inline-block', className)}>\n {children}\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"absolute right-0 top-1/2 -translate-y-1/2 opacity-0 group-hover/copy:opacity-100 transition-opacity bg-background/80 backdrop-blur-sm p-1 rounded\"\n aria-label=\"Copy to clipboard\"\n >\n {copied ? (\n <Check className=\"h-3 w-3 text-muted-foreground\" />\n ) : (\n <Copy className=\"h-3 w-3 text-muted-foreground hover:text-foreground\" />\n )}\n </button>\n </TooltipTrigger>\n <TooltipContent>\n <p>{copied ? 'Copied!' : 'Copy to clipboard'}</p>\n </TooltipContent>\n </Tooltip>\n </span>\n );\n }\n\n return (\n <div className={cn('flex items-center gap-2 group', className)}>\n {children}\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"opacity-0 group-hover:opacity-100 transition-opacity\"\n aria-label=\"Copy to clipboard\"\n >\n {copied ? (\n <Check className=\"h-3 w-3 text-green-600\" />\n ) : (\n <Copy className=\"h-3 w-3 text-muted-foreground hover:text-foreground\" />\n )}\n </button>\n </TooltipTrigger>\n <TooltipContent>\n <p>{copied ? 'Copied!' : 'Copy to clipboard'}</p>\n </TooltipContent>\n </Tooltip>\n </div>\n );\n}\n","'use client';\n\nimport { formatDistanceToNowStrict, formatRelative } from 'date-fns';\nimport { useEffect, useState } from 'react';\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\n\ninterface RelativeTimeProps {\n date: Date | string;\n className?: string;\n type?: 'relative' | 'distance';\n}\n\nexport function RelativeTime({\n date,\n className = '',\n type = 'relative',\n}: RelativeTimeProps) {\n const [, setNow] = useState(Date.now());\n if (typeof date === 'string') {\n date = new Date(date);\n }\n const relativeTime =\n type === 'relative'\n ? formatRelative(new Date(date), new Date())\n : formatDistanceToNowStrict(new Date(date), { addSuffix: true });\n const absoluteTime = new Date(date).toLocaleString(undefined, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n timeZoneName: 'short',\n });\n\n useEffect(() => {\n const interval = setInterval(() => {\n setNow(Date.now());\n }, 1000);\n return () => clearInterval(interval);\n }, []);\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <span className={`${className} cursor-help border-b border-dotted`}>\n {relativeTime}\n </span>\n </TooltipTrigger>\n <TooltipContent>\n <p>{absoluteTime}</p>\n </TooltipContent>\n </Tooltip>\n );\n}\n","const dayOfYearTokenRE = /^D+$/;\nconst weekYearTokenRE = /^Y+$/;\n\nconst throwTokens = [\"D\", \"DD\", \"YY\", \"YYYY\"];\n\nexport function isProtectedDayOfYearToken(token) {\n return dayOfYearTokenRE.test(token);\n}\n\nexport function isProtectedWeekYearToken(token) {\n return weekYearTokenRE.test(token);\n}\n\nexport function warnOrThrowProtectedError(token, format, input) {\n const _message = message(token, format, input);\n console.warn(_message);\n if (throwTokens.includes(token)) throw new RangeError(_message);\n}\n\nfunction message(token, format, input) {\n const subject = token[0] === \"Y\" ? \"years\" : \"days of the month\";\n return `Use \\`${token.toLowerCase()}\\` instead of \\`${token}\\` (in \\`${format}\\`) for formatting ${subject} to the input \\`${input}\\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;\n}\n","export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // [TODO] -- I challenge you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // [TODO] -- I challenge you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // [TODO] I challenge you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","export function getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n };\n}\n","export function addLeadingZeros(number, targetLength) {\n const sign = number < 0 ? \"-\" : \"\";\n const output = Math.abs(number).toString().padStart(targetLength, \"0\");\n return sign + output;\n}\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.js\";\n\nconst eraValues = {\n narrow: [\"B\", \"A\"],\n abbreviated: [\"BC\", \"AD\"],\n wide: [\"Before Christ\", \"Anno Domini\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"],\n};\n\n// Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\nconst monthValues = {\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n abbreviated: [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ],\n\n wide: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n wide: [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mi\",\n noon: \"n\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"in the morning\",\n afternoon: \"in the afternoon\",\n evening: \"in the evening\",\n night: \"at night\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, _options) => {\n const number = Number(dirtyNumber);\n\n // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n const rem100 = number % 100;\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + \"st\";\n case 2:\n return number + \"nd\";\n case 3:\n return number + \"rd\";\n }\n }\n return number + \"th\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n full: \"EEEE, MMMM do, y\",\n long: \"MMMM do, y\",\n medium: \"MMM d, y\",\n short: \"MM/dd/yyyy\",\n};\n\nconst timeFormats = {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","import { constructFrom } from \"../constructFrom.js\";\n\nexport function normalizeDates(context, ...dates) {\n const normalize = constructFrom.bind(\n null,\n context || dates.find((date) => typeof date === \"object\"),\n );\n return dates.map(normalize);\n}\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.js\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.js\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i,\n};\nconst parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^f/i,\n /^mar/i,\n /^ap/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^au/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,\n};\nconst parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { getDayOfYear } from \"../../getDayOfYear.js\";\nimport { getISOWeek } from \"../../getISOWeek.js\";\nimport { getISOWeekYear } from \"../../getISOWeekYear.js\";\nimport { getWeek } from \"../../getWeek.js\";\nimport { getWeekYear } from \"../../getWeekYear.js\";\n\nimport { addLeadingZeros } from \"../addLeadingZeros.js\";\nimport { lightFormatters } from \"./lightFormatters.js\";\n\nconst dayPeriodEnum = {\n am: \"am\",\n pm: \"pm\",\n midnight: \"midnight\",\n noon: \"noon\",\n morning: \"morning\",\n afternoon: \"afternoon\",\n evening: \"evening\",\n night: \"night\",\n};\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nexport const formatters = {\n // Era\n G: function (date, token, localize) {\n const era = date.getFullYear() > 0 ? 1 : 0;\n switch (token) {\n // AD, BC\n case \"G\":\n case \"GG\":\n case \"GGG\":\n return localize.era(era, { width: \"abbreviated\" });\n // A, B\n case \"GGGGG\":\n return localize.era(era, { width: \"narrow\" });\n // Anno Domini, Before Christ\n case \"GGGG\":\n default:\n return localize.era(era, { width: \"wide\" });\n }\n },\n\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === \"yo\") {\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, { unit: \"year\" });\n }\n\n return lightFormatters.y(date, token);\n },\n\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n const signedWeekYear = getWeekYear(date, options);\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;\n\n // Two digit year\n if (token === \"YY\") {\n const twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n }\n\n // Ordinal number\n if (token === \"Yo\") {\n return localize.ordinalNumber(weekYear, { unit: \"year\" });\n }\n\n // Padding\n return addLeadingZeros(weekYear, token.length);\n },\n\n // ISO week-numbering year\n R: function (date, token) {\n const isoWeekYear = getISOWeekYear(date);\n\n // Padding\n return addLeadingZeros(isoWeekYear, token.length);\n },\n\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n const year = date.getFullYear();\n return addLeadingZeros(year, token.length);\n },\n\n // Quarter\n Q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"Q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"QQ\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"Qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"QQQ\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"QQQQQ\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"QQQQ\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone quarter\n q: function (date, token, localize) {\n const quarter = Math.ceil((date.getMonth() + 1) / 3);\n switch (token) {\n // 1, 2, 3, 4\n case \"q\":\n return String(quarter);\n // 01, 02, 03, 04\n case \"qq\":\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n case \"qo\":\n return localize.ordinalNumber(quarter, { unit: \"quarter\" });\n // Q1, Q2, Q3, Q4\n case \"qqq\":\n return localize.quarter(quarter, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n case \"qqqqq\":\n return localize.quarter(quarter, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // 1st quarter, 2nd quarter, ...\n case \"qqqq\":\n default:\n return localize.quarter(quarter, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // Month\n M: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n case \"M\":\n case \"MM\":\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n case \"Mo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"MMM\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // J, F, ..., D\n case \"MMMMM\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // January, February, ..., December\n case \"MMMM\":\n default:\n return localize.month(month, { width: \"wide\", context: \"formatting\" });\n }\n },\n\n // Stand-alone month\n L: function (date, token, localize) {\n const month = date.getMonth();\n switch (token) {\n // 1, 2, ..., 12\n case \"L\":\n return String(month + 1);\n // 01, 02, ..., 12\n case \"LL\":\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n case \"Lo\":\n return localize.ordinalNumber(month + 1, { unit: \"month\" });\n // Jan, Feb, ..., Dec\n case \"LLL\":\n return localize.month(month, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // J, F, ..., D\n case \"LLLLL\":\n return localize.month(month, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // January, February, ..., December\n case \"LLLL\":\n default:\n return localize.month(month, { width: \"wide\", context: \"standalone\" });\n }\n },\n\n // Local week of year\n w: function (date, token, localize, options) {\n const week = getWeek(date, options);\n\n if (token === \"wo\") {\n return localize.ordinalNumber(week, { unit: \"week\" });\n }\n\n return addLeadingZeros(week, token.length);\n },\n\n // ISO week of year\n I: function (date, token, localize) {\n const isoWeek = getISOWeek(date);\n\n if (token === \"Io\") {\n return localize.ordinalNumber(isoWeek, { unit: \"week\" });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n\n // Day of the month\n d: function (date, token, localize) {\n if (token === \"do\") {\n return localize.ordinalNumber(date.getDate(), { unit: \"date\" });\n }\n\n return lightFormatters.d(date, token);\n },\n\n // Day of year\n D: function (date, token, localize) {\n const dayOfYear = getDayOfYear(date);\n\n if (token === \"Do\") {\n return localize.ordinalNumber(dayOfYear, { unit: \"dayOfYear\" });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n\n // Day of week\n E: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n switch (token) {\n // Tue\n case \"E\":\n case \"EE\":\n case \"EEE\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"EEEEE\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"EEEEEE\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"EEEE\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Local day of week\n e: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case \"e\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"ee\":\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n case \"eo\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"eee\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"eeeee\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"eeeeee\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"eeee\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n const dayOfWeek = date.getDay();\n const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n switch (token) {\n // Numerical value (same as in `e`)\n case \"c\":\n return String(localDayOfWeek);\n // Padded numerical value\n case \"cc\":\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n case \"co\":\n return localize.ordinalNumber(localDayOfWeek, { unit: \"day\" });\n case \"ccc\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"standalone\",\n });\n // T\n case \"ccccc\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"standalone\",\n });\n // Tu\n case \"cccccc\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"standalone\",\n });\n // Tuesday\n case \"cccc\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"standalone\",\n });\n }\n },\n\n // ISO day of week\n i: function (date, token, localize) {\n const dayOfWeek = date.getDay();\n const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n switch (token) {\n // 2\n case \"i\":\n return String(isoDayOfWeek);\n // 02\n case \"ii\":\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n case \"io\":\n return localize.ordinalNumber(isoDayOfWeek, { unit: \"day\" });\n // Tue\n case \"iii\":\n return localize.day(dayOfWeek, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n // T\n case \"iiiii\":\n return localize.day(dayOfWeek, {\n width: \"narrow\",\n context: \"formatting\",\n });\n // Tu\n case \"iiiiii\":\n return localize.day(dayOfWeek, {\n width: \"short\",\n context: \"formatting\",\n });\n // Tuesday\n case \"iiii\":\n default:\n return localize.day(dayOfWeek, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM or PM\n a: function (date, token, localize) {\n const hours = date.getHours();\n const dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"aaa\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"aaaaa\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"aaaa\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? \"pm\" : \"am\";\n }\n\n switch (token) {\n case \"b\":\n case \"bb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"bbb\":\n return localize\n .dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n })\n .toLowerCase();\n case \"bbbbb\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"bbbb\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n const hours = date.getHours();\n let dayPeriodEnumValue;\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case \"B\":\n case \"BB\":\n case \"BBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"abbreviated\",\n context: \"formatting\",\n });\n case \"BBBBB\":\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"narrow\",\n context: \"formatting\",\n });\n case \"BBBB\":\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: \"wide\",\n context: \"formatting\",\n });\n }\n },\n\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === \"ho\") {\n let hours = date.getHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return lightFormatters.h(date, token);\n },\n\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === \"Ho\") {\n return localize.ordinalNumber(date.getHours(), { unit: \"hour\" });\n }\n\n return lightFormatters.H(date, token);\n },\n\n // Hour [0-11]\n K: function (date, token, localize) {\n const hours = date.getHours() % 12;\n\n if (token === \"Ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Hour [1-24]\n k: function (date, token, localize) {\n let hours = date.getHours();\n if (hours === 0) hours = 24;\n\n if (token === \"ko\") {\n return localize.ordinalNumber(hours, { unit: \"hour\" });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n\n // Minute\n m: function (date, token, localize) {\n if (token === \"mo\") {\n return localize.ordinalNumber(date.getMinutes(), { unit: \"minute\" });\n }\n\n return lightFormatters.m(date, token);\n },\n\n // Second\n s: function (date, token, localize) {\n if (token === \"so\") {\n return localize.ordinalNumber(date.getSeconds(), { unit: \"second\" });\n }\n\n return lightFormatters.s(date, token);\n },\n\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return \"Z\";\n }\n\n switch (token) {\n // Hours and optional minutes\n case \"X\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n case \"XXXX\":\n case \"XX\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n case \"XXXXX\":\n case \"XXX\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case \"x\":\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n case \"xxxx\":\n case \"xx\": // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n case \"xxxxx\":\n case \"xxx\": // Hours and minutes with `:` delimiter\n default:\n return formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (GMT)\n O: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"O\":\n case \"OO\":\n case \"OOO\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"OOOO\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Timezone (specific non-location)\n z: function (date, token, _localize) {\n const timezoneOffset = date.getTimezoneOffset();\n\n switch (token) {\n // Short\n case \"z\":\n case \"zz\":\n case \"zzz\":\n return \"GMT\" + formatTimezoneShort(timezoneOffset, \":\");\n // Long\n case \"zzzz\":\n default:\n return \"GMT\" + formatTimezone(timezoneOffset, \":\");\n }\n },\n\n // Seconds timestamp\n t: function (date, token, _localize) {\n const timestamp = Math.trunc(+date / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n\n // Milliseconds timestamp\n T: function (date, token, _localize) {\n return addLeadingZeros(+date, token.length);\n },\n};\n\nfunction formatTimezoneShort(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = Math.trunc(absOffset / 60);\n const minutes = absOffset % 60;\n if (minutes === 0) {\n return sign + String(hours);\n }\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, delimiter) {\n if (offset % 60 === 0) {\n const sign = offset > 0 ? \"-\" : \"+\";\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n return formatTimezone(offset, delimiter);\n}\n\nfunction formatTimezone(offset, delimiter = \"\") {\n const sign = offset > 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(offset);\n const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);\n const minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Copy\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/copy\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Copy = createLucideIcon('Copy', [\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2', key: '17jyea' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2', key: 'zix9uf' }],\n]);\n\nexport default Copy;\n","import { toDate } from \"../toDate.js\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { formatDistance } from \"./en-US/_lib/formatDistance.js\";\nimport { formatLong } from \"./en-US/_lib/formatLong.js\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.js\";\nimport { localize } from \"./en-US/_lib/localize.js\";\nimport { match } from \"./en-US/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n","import { addLeadingZeros } from \"../addLeadingZeros.js\";\n\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nexport const lightFormatters = {\n // Year\n y(date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n\n const signedYear = date.getFullYear();\n // Returns 1 for 1 BC (which is year 0 in JavaScript)\n const year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === \"yy\" ? year % 100 : year, token.length);\n },\n\n // Month\n M(date, token) {\n const month = date.getMonth();\n return token === \"M\" ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n\n // Day of the month\n d(date, token) {\n return addLeadingZeros(date.getDate(), token.length);\n },\n\n // AM or PM\n a(date, token) {\n const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? \"pm\" : \"am\";\n\n switch (token) {\n case \"a\":\n case \"aa\":\n return dayPeriodEnumValue.toUpperCase();\n case \"aaa\":\n return dayPeriodEnumValue;\n case \"aaaaa\":\n return dayPeriodEnumValue[0];\n case \"aaaa\":\n default:\n return dayPeriodEnumValue === \"am\" ? \"a.m.\" : \"p.m.\";\n }\n },\n\n // Hour [1-12]\n h(date, token) {\n return addLeadingZeros(date.getHours() % 12 || 12, token.length);\n },\n\n // Hour [0-23]\n H(date, token) {\n return addLeadingZeros(date.getHours(), token.length);\n },\n\n // Minute\n m(date, token) {\n return addLeadingZeros(date.getMinutes(), token.length);\n },\n\n // Second\n s(date, token) {\n return addLeadingZeros(date.getSeconds(), token.length);\n },\n\n // Fraction of second\n S(date, token) {\n const numberOfDigits = token.length;\n const milliseconds = date.getMilliseconds();\n const fractionalSeconds = Math.trunc(\n milliseconds * Math.pow(10, numberOfDigits - 3),\n );\n return addLeadingZeros(fractionalSeconds, token.length);\n },\n};\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { formatters } from \"./_lib/format/formatters.js\";\nimport { longFormatters } from \"./_lib/format/longFormatters.js\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.js\";\nimport { isValid } from \"./isValid.js\";\nimport { toDate } from \"./toDate.js\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date, options?.in);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n","/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n","import { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\nimport { startOfYear } from \"./startOfYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getDayOfYear} function options.\n */\n\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nexport function getDayOfYear(date, options) {\n const _date = toDate(date, options?.in);\n const diff = differenceInCalendarDays(_date, startOfYear(_date));\n const dayOfYear = diff + 1;\n return dayOfYear;\n}\n\n// Fallback for modularized imports:\nexport default getDayOfYear;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfYear} function options.\n */\n\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nexport function startOfYear(date, options) {\n const date_ = toDate(date, options?.in);\n date_.setFullYear(date_.getFullYear(), 0, 1);\n date_.setHours(0, 0, 0, 0);\n return date_;\n}\n\n// Fallback for modularized imports:\nexport default startOfYear;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeekYear} function options.\n */\n\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n *\n * @returns The ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nexport function getISOWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n\n const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (_date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (_date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getISOWeekYear;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfDay} function options.\n */\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\nimport { startOfISOWeekYear } from \"./startOfISOWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getISOWeek} function options.\n */\n\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param date - The given date\n * @param options - The options\n *\n * @returns The ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nexport function getISOWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getISOWeek;\n","import { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfISOWeek} function options.\n */\n\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfISOWeek(date, options) {\n return startOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeek;\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name constructNow\n * @category Generic Helpers\n * @summary Constructs a new current date using the passed value constructor.\n * @pure false\n *\n * @description\n * The function constructs a new current date using the constructor from\n * the reference date. It helps to build generic functions that accept date\n * extensions and use the current date.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * @param date - The reference date to take constructor from\n *\n * @returns Current date initialized using the given date constructor\n *\n * @example\n * import { constructNow, isSameDay } from 'date-fns'\n *\n * function isToday<DateType extends Date>(\n * date: DateArg<DateType>,\n * ): boolean {\n * // If we were to use `new Date()` directly, the function would behave\n * // differently in different timezones and return false for the same date.\n * return isSameDay(date, constructNow(date));\n * }\n */\nexport function constructNow(date) {\n return constructFrom(date, Date.now());\n}\n\n// Fallback for modularized imports:\nexport default constructNow;\n","/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n","import { constructFrom } from \"./constructFrom.js\";\nimport { getISOWeekYear } from \"./getISOWeekYear.js\";\nimport { startOfISOWeek } from \"./startOfISOWeek.js\";\n\n/**\n * The {@link startOfISOWeekYear} function options.\n */\n\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of an ISO week-numbering year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfISOWeekYear(date, options) {\n const year = getISOWeekYear(date, options);\n const fourthOfJanuary = constructFrom(options?.in || date, 0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n return startOfISOWeek(fourthOfJanuary);\n}\n\n// Fallback for modularized imports:\nexport default startOfISOWeekYear;\n","import { isDate } from \"./isDate.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @param date - The date to check\n *\n * @returns The date is valid\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertible into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\nexport function isValid(date) {\n return !((!isDate(date) && typeof date !== \"number\") || isNaN(+toDate(date)));\n}\n\n// Fallback for modularized imports:\nexport default isValid;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport function compareAsc(dateLeft, dateRight) {\n const diff = +toDate(dateLeft) - +toDate(dateRight);\n\n if (diff < 0) return -1;\n else if (diff > 0) return 1;\n\n // Return 0 if diff is 0; return NaN if diff is NaN\n return diff;\n}\n\n// Fallback for modularized imports:\nexport default compareAsc;\n","import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date>(date: DateType): DateType {\n * return constructFrom(\n * date, // Use constructor from the given date\n * date.getTime() // Use the date value to create a new date\n * );\n * }\n */\nexport function constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n\n if (date instanceof Date) return new date.constructor(value);\n\n return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n","/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * Starting from v3.7.0, it clones a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument, context) {\n // [TODO] Get rid of `toDate` or `constructFrom`?\n return constructFrom(context || argument, argument);\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeekYear} function options.\n */\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The local week-numbering year\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport function getWeekYear(date, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const firstWeekOfNextYear = constructFrom(options?.in || date, 0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n\n const firstWeekOfThisYear = constructFrom(options?.in || date, 0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (+_date >= +startOfNextYear) {\n return year + 1;\n } else if (+_date >= +startOfThisYear) {\n return year;\n } else {\n return year - 1;\n }\n}\n\n// Fallback for modularized imports:\nexport default getWeekYear;\n","import { millisecondsInWeek } from \"./constants.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\nimport { startOfWeekYear } from \"./startOfWeekYear.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getWeek} function options.\n */\n\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The week\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\nexport function getWeek(date, options) {\n const _date = toDate(date, options?.in);\n const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);\n\n // Round the number of weeks to the nearest integer because the number of\n // milliseconds in a week is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round(diff / millisecondsInWeek) + 1;\n}\n\n// Fallback for modularized imports:\nexport default getWeek;\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\nimport { format } from \"./format.js\";\n\n/**\n * The {@link formatRelative} function options.\n */\n\n/**\n * @name formatRelative\n * @category Common Helpers\n * @summary Represent the date in words relative to the given base date.\n *\n * @description\n * Represent the date in words relative to the given base date.\n *\n * | Distance to the base date | Result |\n * |---------------------------|---------------------------|\n * | Previous 6 days | last Sunday at 04:30 AM |\n * | Last day | yesterday at 04:30 AM |\n * | Same day | today at 04:30 AM |\n * | Next day | tomorrow at 04:30 AM |\n * | Next 6 days | Sunday at 04:30 AM |\n * | Other | 12/31/2017 |\n *\n * @param date - The date to format\n * @param baseDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The date in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws `options.locale` must contain `formatRelative` property\n *\n * @example\n * // Represent the date of 6 days ago in words relative to the given base date. In this example, today is Wednesday\n * const result = formatRelative(subDays(new Date(), 6), new Date())\n * //=> \"last Thursday at 12:45 AM\"\n */\nexport function formatRelative(date, baseDate, options) {\n const [date_, baseDate_] = normalizeDates(options?.in, date, baseDate);\n\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const diff = differenceInCalendarDays(date_, baseDate_);\n\n if (isNaN(diff)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let token;\n if (diff < -6) {\n token = \"other\";\n } else if (diff < -1) {\n token = \"lastWeek\";\n } else if (diff < 0) {\n token = \"yesterday\";\n } else if (diff < 1) {\n token = \"today\";\n } else if (diff < 2) {\n token = \"tomorrow\";\n } else if (diff < 7) {\n token = \"nextWeek\";\n } else {\n token = \"other\";\n }\n\n const formatStr = locale.formatRelative(token, date_, baseDate_, {\n locale,\n weekStartsOn,\n });\n return format(date_, formatStr, { locale, weekStartsOn });\n}\n\n// Fallback for modularized imports:\nexport default formatRelative;\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { constructFrom } from \"./constructFrom.js\";\nimport { getWeekYear } from \"./getWeekYear.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link startOfWeekYear} function options.\n */\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week-numbering year\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport function startOfWeekYear(date, options) {\n const defaultOptions = getDefaultOptions();\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const year = getWeekYear(date, options);\n const firstWeek = constructFrom(options?.in || date, 0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n const _date = startOfWeek(firstWeek, options);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeekYear;\n","import { constructNow } from \"./constructNow.js\";\n\nimport { formatDistanceStrict } from \"./formatDistanceStrict.js\";\n\n/**\n * The {@link formatDistanceToNowStrict} function options.\n */\n\n/**\n * @name formatDistanceToNowStrict\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param date - The given date\n * @param options - An object with options.\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * const result = formatDistanceToNowStrict(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * const result = formatDistanceToNowStrict(\n * new Date(2015, 0, 1, 0, 0, 15)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * const result = formatDistanceToNowStrict(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in 1 year'\n *\n * @example\n * // If today is 28 January 2015,\n * // what is the distance to 1 January 2015, in months, rounded up??\n * const result = formatDistanceToNowStrict(new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016 in Esperanto?\n * const eoLocale = require('date-fns/locale/eo')\n * const result = formatDistanceToNowStrict(\n * new Date(2016, 0, 1),\n * {locale: eoLocale}\n * )\n * //=> '1 jaro'\n */\nexport function formatDistanceToNowStrict(date, options) {\n return formatDistanceStrict(date, constructNow(date), options);\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceToNowStrict;\n","import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { compareAsc } from \"./compareAsc.js\";\nimport {\n millisecondsInMinute,\n minutesInDay,\n minutesInMonth,\n minutesInYear,\n} from \"./constants.js\";\n\n/**\n * The {@link formatDistanceStrict} function options.\n */\n\n/**\n * The unit used to format the distance in {@link formatDistanceStrict}.\n */\n\n/**\n * @name formatDistanceStrict\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with\n * @param options - An object with options\n *\n * @returns The distance in words\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * const result = formatDistanceStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\n * unit: 'minute'\n * })\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2015\n * // to 28 January 2015, in months, rounded up?\n * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> '1 jaro'\n */\n\nexport function formatDistanceStrict(laterDate, earlierDate, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const comparison = compareAsc(laterDate, earlierDate);\n\n if (isNaN(comparison)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n const localizeOptions = Object.assign({}, options, {\n addSuffix: options?.addSuffix,\n comparison: comparison,\n });\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n ...(comparison > 0 ? [earlierDate, laterDate] : [laterDate, earlierDate]),\n );\n\n const roundingMethod = getRoundingMethod(options?.roundingMethod ?? \"round\");\n\n const milliseconds = earlierDate_.getTime() - laterDate_.getTime();\n const minutes = milliseconds / millisecondsInMinute;\n\n const timezoneOffset =\n getTimezoneOffsetInMilliseconds(earlierDate_) -\n getTimezoneOffsetInMilliseconds(laterDate_);\n\n // Use DST-normalized difference in minutes for years, months and days;\n // use regular difference in minutes for hours, minutes and seconds.\n const dstNormalizedMinutes =\n (milliseconds - timezoneOffset) / millisecondsInMinute;\n\n const defaultUnit = options?.unit;\n let unit;\n if (!defaultUnit) {\n if (minutes < 1) {\n unit = \"second\";\n } else if (minutes < 60) {\n unit = \"minute\";\n } else if (minutes < minutesInDay) {\n unit = \"hour\";\n } else if (dstNormalizedMinutes < minutesInMonth) {\n unit = \"day\";\n } else if (dstNormalizedMinutes < minutesInYear) {\n unit = \"month\";\n } else {\n unit = \"year\";\n }\n } else {\n unit = defaultUnit;\n }\n\n // 0 up to 60 seconds\n if (unit === \"second\") {\n const seconds = roundingMethod(milliseconds / 1000);\n return locale.formatDistance(\"xSeconds\", seconds, localizeOptions);\n\n // 1 up to 60 mins\n } else if (unit === \"minute\") {\n const roundedMinutes = roundingMethod(minutes);\n return locale.formatDistance(\"xMinutes\", roundedMinutes, localizeOptions);\n\n // 1 up to 24 hours\n } else if (unit === \"hour\") {\n const hours = roundingMethod(minutes / 60);\n return locale.formatDistance(\"xHours\", hours, localizeOptions);\n\n // 1 up to 30 days\n } else if (unit === \"day\") {\n const days = roundingMethod(dstNormalizedMinutes / minutesInDay);\n return locale.formatDistance(\"xDays\", days, localizeOptions);\n\n // 1 up to 12 months\n } else if (unit === \"month\") {\n const months = roundingMethod(dstNormalizedMinutes / minutesInMonth);\n return months === 12 && defaultUnit !== \"month\"\n ? locale.formatDistance(\"xYears\", 1, localizeOptions)\n : locale.formatDistance(\"xMonths\", months, localizeOptions);\n\n // 1 year up to max Date\n } else {\n const years = roundingMethod(dstNormalizedMinutes / minutesInYear);\n return locale.formatDistance(\"xYears\", years, localizeOptions);\n }\n}\n\n// Fallback for modularized imports:\nexport default formatDistanceStrict;\n","'use client';\n\nimport type { Step, WorkflowRun } from '@workflow/world';\nimport { Check, Copy } from 'lucide-react';\nimport { useState } from 'react';\nimport { Button } from '@/components/ui/button';\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport { cn, formatDuration } from '@/lib/utils';\n\ninterface StatusBadgeProps {\n status: WorkflowRun['status'] | Step['status'];\n context?: { error?: unknown };\n className?: string;\n /** Duration in milliseconds to display below status */\n durationMs?: number;\n}\n\nexport function StatusBadge({\n status,\n context,\n className,\n durationMs,\n}: StatusBadgeProps) {\n const getCircleColor = () => {\n switch (status) {\n case 'running':\n return 'bg-blue-500';\n case 'completed':\n return 'bg-emerald-500';\n case 'failed':\n return 'bg-red-500';\n case 'cancelled':\n return 'bg-yellow-500';\n case 'pending':\n return 'bg-gray-400';\n case 'paused':\n return 'bg-orange-500';\n default:\n return 'bg-gray-400';\n }\n };\n\n const content = (\n <span className={cn('flex flex-row gap-2', className)}>\n <span className=\"flex items-center gap-1.5\">\n <span\n className={cn('size-2 rounded-full shrink-0', getCircleColor())}\n />\n <span className=\"text-muted-foreground text-xs font-medium capitalize\">\n {status}\n </span>\n </span>\n {durationMs !== undefined && (\n <span className=\"text-muted-foreground/70 text-xs\">\n ({formatDuration(durationMs)})\n </span>\n )}\n </span>\n );\n\n // Show error tooltip if status is failed and error exists\n if (status === 'failed' && context?.error) {\n return <ErrorStatusBadge content={content} error={context.error} />;\n }\n\n return content;\n}\n\nfunction ErrorStatusBadge({\n content,\n error,\n}: {\n content: React.ReactNode;\n error: unknown;\n}) {\n const [copied, setCopied] = useState(false);\n\n const errorMessage =\n typeof error === 'string'\n ? error\n : error instanceof Error\n ? error.message\n : JSON.stringify(error);\n\n const handleCopy = async (e: React.MouseEvent) => {\n e.stopPropagation();\n await navigator.clipboard.writeText(errorMessage);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"cursor-help\">{content}</span>\n </TooltipTrigger>\n <TooltipContent className=\"max-w-md p-0\">\n <div className=\"flex items-start justify-between gap-2 p-1 border-b\">\n <span className=\"text-xs font-medium pl-1 pt-1\">Error Details</span>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-6 w-6 shrink-0\"\n onClick={handleCopy}\n >\n {copied ? (\n <Check className=\"h-2.5 w-2.5 text-muted-foreground\" />\n ) : (\n <Copy className=\"h-2.5 w-2.5 text-muted-foreground\" />\n )}\n </Button>\n </div>\n <div className=\"max-h-48 overflow-auto p-2\">\n <p className=\"text-xs whitespace-pre-wrap break-words font-mono\">\n {errorMessage}\n </p>\n </div>\n </TooltipContent>\n </Tooltip>\n );\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","\"use client\"\nimport { jsxs, Fragment, jsx } from 'react/jsx-runtime';\nimport { createContext, useContext, useMemo, forwardRef, useEffect, useRef, useState, useLayoutEffect, useCallback, memo } from 'react';\nimport cc from 'classcat';\nimport { errorMessages, mergeAriaLabelConfig, infiniteExtent, isInputDOMNode, getViewportForBounds, pointToRendererPoint, rendererPointToPoint, isNodeBase, isEdgeBase, getElementsToRemove, isRectObject, nodeToRect, getOverlappingArea, getNodesBounds, withResolvers, evaluateAbsolutePosition, getDimensions, XYPanZoom, PanOnScrollMode, SelectionMode, getEventPosition, getNodesInside, areSetsEqual, XYDrag, snapPosition, calculateNodePosition, Position, ConnectionMode, isMouseEvent, XYHandle, getHostForElement, addEdge, getInternalNodesBounds, isNumeric, nodeHasDimensions, getNodeDimensions, elementSelectionKeys, isEdgeVisible, MarkerType, createMarkerIds, getBezierEdgeCenter, getSmoothStepPath, getStraightPath, getBezierPath, getEdgePosition, getElevatedEdgeZIndex, getMarkerId, getConnectionStatus, ConnectionLineType, updateConnectionLookup, adoptUserNodes, initialConnection, devWarn, defaultAriaLabelConfig, updateNodeInternals, updateAbsolutePositions, handleExpandParent, panBy, fitViewport, isMacOs, areConnectionMapsEqual, handleConnectionChange, shallowNodeData, XYMinimap, getBoundsOfRects, ResizeControlVariant, XYResizer, XY_RESIZER_LINE_POSITIONS, XY_RESIZER_HANDLE_POSITIONS, getNodeToolbarTransform, getEdgeToolbarTransform } from '@xyflow/system';\nexport { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds, reconnectEdge } from '@xyflow/system';\nimport { useStoreWithEqualityFn, createWithEqualityFn } from 'zustand/traditional';\nimport { shallow } from 'zustand/shallow';\nimport { createPortal } from 'react-dom';\n\nconst StoreContext = createContext(null);\nconst Provider$1 = StoreContext.Provider;\n\nconst zustandErrorMessage = errorMessages['error001']();\n/**\n * This hook can be used to subscribe to internal state changes of the React Flow\n * component. The `useStore` hook is re-exported from the [Zustand](https://github.com/pmndrs/zustand)\n * state management library, so you should check out their docs for more details.\n *\n * @public\n * @param selector - A selector function that returns a slice of the flow's internal state.\n * Extracting or transforming just the state you need is a good practice to avoid unnecessary\n * re-renders.\n * @param equalityFn - A function to compare the previous and next value. This is incredibly useful\n * for preventing unnecessary re-renders. Good sensible defaults are using `Object.is` or importing\n * `zustand/shallow`, but you can be as granular as you like.\n * @returns The selected state slice.\n *\n * @example\n * ```ts\n * const nodes = useStore((state) => state.nodes);\n * ```\n *\n * @remarks This hook should only be used if there is no other way to access the internal\n * state. For many of the common use cases, there are dedicated hooks available\n * such as {@link useReactFlow}, {@link useViewport}, etc.\n */\nfunction useStore(selector, equalityFn) {\n const store = useContext(StoreContext);\n if (store === null) {\n throw new Error(zustandErrorMessage);\n }\n return useStoreWithEqualityFn(store, selector, equalityFn);\n}\n/**\n * In some cases, you might need to access the store directly. This hook returns the store object which can be used on demand to access the state or dispatch actions.\n *\n * @returns The store object.\n * @example\n * ```ts\n * const store = useStoreApi();\n * ```\n *\n * @remarks This hook should only be used if there is no other way to access the internal\n * state. For many of the common use cases, there are dedicated hooks available\n * such as {@link useReactFlow}, {@link useViewport}, etc.\n */\nfunction useStoreApi() {\n const store = useContext(StoreContext);\n if (store === null) {\n throw new Error(zustandErrorMessage);\n }\n return useMemo(() => ({\n getState: store.getState,\n setState: store.setState,\n subscribe: store.subscribe,\n }), [store]);\n}\n\nconst style = { display: 'none' };\nconst ariaLiveStyle = {\n position: 'absolute',\n width: 1,\n height: 1,\n margin: -1,\n border: 0,\n padding: 0,\n overflow: 'hidden',\n clip: 'rect(0px, 0px, 0px, 0px)',\n clipPath: 'inset(100%)',\n};\nconst ARIA_NODE_DESC_KEY = 'react-flow__node-desc';\nconst ARIA_EDGE_DESC_KEY = 'react-flow__edge-desc';\nconst ARIA_LIVE_MESSAGE = 'react-flow__aria-live';\nconst ariaLiveSelector = (s) => s.ariaLiveMessage;\nconst ariaLabelConfigSelector = (s) => s.ariaLabelConfig;\nfunction AriaLiveMessage({ rfId }) {\n const ariaLiveMessage = useStore(ariaLiveSelector);\n return (jsx(\"div\", { id: `${ARIA_LIVE_MESSAGE}-${rfId}`, \"aria-live\": \"assertive\", \"aria-atomic\": \"true\", style: ariaLiveStyle, children: ariaLiveMessage }));\n}\nfunction A11yDescriptions({ rfId, disableKeyboardA11y }) {\n const ariaLabelConfig = useStore(ariaLabelConfigSelector);\n return (jsxs(Fragment, { children: [jsx(\"div\", { id: `${ARIA_NODE_DESC_KEY}-${rfId}`, style: style, children: disableKeyboardA11y\n ? ariaLabelConfig['node.a11yDescription.default']\n : ariaLabelConfig['node.a11yDescription.keyboardDisabled'] }), jsx(\"div\", { id: `${ARIA_EDGE_DESC_KEY}-${rfId}`, style: style, children: ariaLabelConfig['edge.a11yDescription.default'] }), !disableKeyboardA11y && jsx(AriaLiveMessage, { rfId: rfId })] }));\n}\n\n/**\n * The `<Panel />` component helps you position content above the viewport.\n * It is used internally by the [`<MiniMap />`](/api-reference/components/minimap)\n * and [`<Controls />`](/api-reference/components/controls) components.\n *\n * @public\n *\n * @example\n * ```jsx\n *import { ReactFlow, Background, Panel } from '@xyflow/react';\n *\n *export default function Flow() {\n * return (\n * <ReactFlow nodes={[]} fitView>\n * <Panel position=\"top-left\">top-left</Panel>\n * <Panel position=\"top-center\">top-center</Panel>\n * <Panel position=\"top-right\">top-right</Panel>\n * <Panel position=\"bottom-left\">bottom-left</Panel>\n * <Panel position=\"bottom-center\">bottom-center</Panel>\n * <Panel position=\"bottom-right\">bottom-right</Panel>\n * </ReactFlow>\n * );\n *}\n *```\n */\nconst Panel = forwardRef(({ position = 'top-left', children, className, style, ...rest }, ref) => {\n const positionClasses = `${position}`.split('-');\n return (jsx(\"div\", { className: cc(['react-flow__panel', className, ...positionClasses]), style: style, ref: ref, ...rest, children: children }));\n});\nPanel.displayName = 'Panel';\n\nfunction Attribution({ proOptions, position = 'bottom-right' }) {\n if (proOptions?.hideAttribution) {\n return null;\n }\n return (jsx(Panel, { position: position, className: \"react-flow__attribution\", \"data-message\": \"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev\", children: jsx(\"a\", { href: \"https://reactflow.dev\", target: \"_blank\", rel: \"noopener noreferrer\", \"aria-label\": \"React Flow attribution\", children: \"React Flow\" }) }));\n}\n\nconst selector$m = (s) => {\n const selectedNodes = [];\n const selectedEdges = [];\n for (const [, node] of s.nodeLookup) {\n if (node.selected) {\n selectedNodes.push(node.internals.userNode);\n }\n }\n for (const [, edge] of s.edgeLookup) {\n if (edge.selected) {\n selectedEdges.push(edge);\n }\n }\n return { selectedNodes, selectedEdges };\n};\nconst selectId = (obj) => obj.id;\nfunction areEqual(a, b) {\n return (shallow(a.selectedNodes.map(selectId), b.selectedNodes.map(selectId)) &&\n shallow(a.selectedEdges.map(selectId), b.selectedEdges.map(selectId)));\n}\nfunction SelectionListenerInner({ onSelectionChange, }) {\n const store = useStoreApi();\n const { selectedNodes, selectedEdges } = useStore(selector$m, areEqual);\n useEffect(() => {\n const params = { nodes: selectedNodes, edges: selectedEdges };\n onSelectionChange?.(params);\n store.getState().onSelectionChangeHandlers.forEach((fn) => fn(params));\n }, [selectedNodes, selectedEdges, onSelectionChange]);\n return null;\n}\nconst changeSelector = (s) => !!s.onSelectionChangeHandlers;\nfunction SelectionListener({ onSelectionChange, }) {\n const storeHasSelectionChangeHandlers = useStore(changeSelector);\n if (onSelectionChange || storeHasSelectionChangeHandlers) {\n return jsx(SelectionListenerInner, { onSelectionChange: onSelectionChange });\n }\n return null;\n}\n\nconst defaultNodeOrigin = [0, 0];\nconst defaultViewport = { x: 0, y: 0, zoom: 1 };\n\n/*\n * This component helps us to update the store with the values coming from the user.\n * We distinguish between values we can update directly with `useDirectStoreUpdater` (like `snapGrid`)\n * and values that have a dedicated setter function in the store (like `setNodes`).\n */\n// These fields exist in the global store, and we need to keep them up to date\nconst reactFlowFieldsToTrack = [\n 'nodes',\n 'edges',\n 'defaultNodes',\n 'defaultEdges',\n 'onConnect',\n 'onConnectStart',\n 'onConnectEnd',\n 'onClickConnectStart',\n 'onClickConnectEnd',\n 'nodesDraggable',\n 'autoPanOnNodeFocus',\n 'nodesConnectable',\n 'nodesFocusable',\n 'edgesFocusable',\n 'edgesReconnectable',\n 'elevateNodesOnSelect',\n 'elevateEdgesOnSelect',\n 'minZoom',\n 'maxZoom',\n 'nodeExtent',\n 'onNodesChange',\n 'onEdgesChange',\n 'elementsSelectable',\n 'connectionMode',\n 'snapGrid',\n 'snapToGrid',\n 'translateExtent',\n 'connectOnClick',\n 'defaultEdgeOptions',\n 'fitView',\n 'fitViewOptions',\n 'onNodesDelete',\n 'onEdgesDelete',\n 'onDelete',\n 'onNodeDrag',\n 'onNodeDragStart',\n 'onNodeDragStop',\n 'onSelectionDrag',\n 'onSelectionDragStart',\n 'onSelectionDragStop',\n 'onMoveStart',\n 'onMove',\n 'onMoveEnd',\n 'noPanClassName',\n 'nodeOrigin',\n 'autoPanOnConnect',\n 'autoPanOnNodeDrag',\n 'onError',\n 'connectionRadius',\n 'isValidConnection',\n 'selectNodesOnDrag',\n 'nodeDragThreshold',\n 'connectionDragThreshold',\n 'onBeforeDelete',\n 'debug',\n 'autoPanSpeed',\n 'ariaLabelConfig',\n];\n// rfId doesn't exist in ReactFlowProps, but it's one of the fields we want to update\nconst fieldsToTrack = [...reactFlowFieldsToTrack, 'rfId'];\nconst selector$l = (s) => ({\n setNodes: s.setNodes,\n setEdges: s.setEdges,\n setMinZoom: s.setMinZoom,\n setMaxZoom: s.setMaxZoom,\n setTranslateExtent: s.setTranslateExtent,\n setNodeExtent: s.setNodeExtent,\n reset: s.reset,\n setDefaultNodesAndEdges: s.setDefaultNodesAndEdges,\n});\nconst initPrevValues = {\n /*\n * these are values that are also passed directly to other components\n * than the StoreUpdater. We can reduce the number of setStore calls\n * by setting the same values here as prev fields.\n */\n translateExtent: infiniteExtent,\n nodeOrigin: defaultNodeOrigin,\n minZoom: 0.5,\n maxZoom: 2,\n elementsSelectable: true,\n noPanClassName: 'nopan',\n rfId: '1',\n};\nfunction StoreUpdater(props) {\n const { setNodes, setEdges, setMinZoom, setMaxZoom, setTranslateExtent, setNodeExtent, reset, setDefaultNodesAndEdges, } = useStore(selector$l, shallow);\n const store = useStoreApi();\n useEffect(() => {\n setDefaultNodesAndEdges(props.defaultNodes, props.defaultEdges);\n return () => {\n // when we reset the store we also need to reset the previous fields\n previousFields.current = initPrevValues;\n reset();\n };\n }, []);\n const previousFields = useRef(initPrevValues);\n useEffect(() => {\n for (const fieldName of fieldsToTrack) {\n const fieldValue = props[fieldName];\n const previousFieldValue = previousFields.current[fieldName];\n if (fieldValue === previousFieldValue)\n continue;\n if (typeof props[fieldName] === 'undefined')\n continue;\n // Custom handling with dedicated setters for some fields\n if (fieldName === 'nodes')\n setNodes(fieldValue);\n else if (fieldName === 'edges')\n setEdges(fieldValue);\n else if (fieldName === 'minZoom')\n setMinZoom(fieldValue);\n else if (fieldName === 'maxZoom')\n setMaxZoom(fieldValue);\n else if (fieldName === 'translateExtent')\n setTranslateExtent(fieldValue);\n else if (fieldName === 'nodeExtent')\n setNodeExtent(fieldValue);\n else if (fieldName === 'ariaLabelConfig')\n store.setState({ ariaLabelConfig: mergeAriaLabelConfig(fieldValue) });\n // Renamed fields\n else if (fieldName === 'fitView')\n store.setState({ fitViewQueued: fieldValue });\n else if (fieldName === 'fitViewOptions')\n store.setState({ fitViewOptions: fieldValue });\n // General case\n else\n store.setState({ [fieldName]: fieldValue });\n }\n previousFields.current = props;\n }, \n // Only re-run the effect if one of the fields we track changes\n fieldsToTrack.map((fieldName) => props[fieldName]));\n return null;\n}\n\nfunction getMediaQuery() {\n if (typeof window === 'undefined' || !window.matchMedia) {\n return null;\n }\n return window.matchMedia('(prefers-color-scheme: dark)');\n}\n/**\n * Hook for receiving the current color mode class 'dark' or 'light'.\n *\n * @internal\n * @param colorMode - The color mode to use ('dark', 'light' or 'system')\n */\nfunction useColorModeClass(colorMode) {\n const [colorModeClass, setColorModeClass] = useState(colorMode === 'system' ? null : colorMode);\n useEffect(() => {\n if (colorMode !== 'system') {\n setColorModeClass(colorMode);\n return;\n }\n const mediaQuery = getMediaQuery();\n const updateColorModeClass = () => setColorModeClass(mediaQuery?.matches ? 'dark' : 'light');\n updateColorModeClass();\n mediaQuery?.addEventListener('change', updateColorModeClass);\n return () => {\n mediaQuery?.removeEventListener('change', updateColorModeClass);\n };\n }, [colorMode]);\n return colorModeClass !== null ? colorModeClass : getMediaQuery()?.matches ? 'dark' : 'light';\n}\n\nconst defaultDoc = typeof document !== 'undefined' ? document : null;\n/**\n * This hook lets you listen for specific key codes and tells you whether they are\n * currently pressed or not.\n *\n * @public\n * @param options - Options\n *\n * @example\n * ```tsx\n *import { useKeyPress } from '@xyflow/react';\n *\n *export default function () {\n * const spacePressed = useKeyPress('Space');\n * const cmdAndSPressed = useKeyPress(['Meta+s', 'Strg+s']);\n *\n * return (\n * <div>\n * {spacePressed && <p>Space pressed!</p>}\n * {cmdAndSPressed && <p>Cmd + S pressed!</p>}\n * </div>\n * );\n *}\n *```\n */\nfunction useKeyPress(\n/**\n * The key code (string or array of strings) specifies which key(s) should trigger\n * an action.\n *\n * A **string** can represent:\n * - A **single key**, e.g. `'a'`\n * - A **key combination**, using `'+'` to separate keys, e.g. `'a+d'`\n *\n * An **array of strings** represents **multiple possible key inputs**. For example, `['a', 'd+s']`\n * means the user can press either the single key `'a'` or the combination of `'d'` and `'s'`.\n * @default null\n */\nkeyCode = null, options = { target: defaultDoc, actInsideInputWithModifier: true }) {\n const [keyPressed, setKeyPressed] = useState(false);\n // we need to remember if a modifier key is pressed in order to track it\n const modifierPressed = useRef(false);\n // we need to remember the pressed keys in order to support combinations\n const pressedKeys = useRef(new Set([]));\n /*\n * keyCodes = array with single keys [['a']] or key combinations [['a', 's']]\n * keysToWatch = array with all keys flattened ['a', 'd', 'ShiftLeft']\n * used to check if we store event.code or event.key. When the code is in the list of keysToWatch\n * we use the code otherwise the key. Explainer: When you press the left \"command\" key, the code is \"MetaLeft\"\n * and the key is \"Meta\". We want users to be able to pass keys and codes so we assume that the key is meant when\n * we can't find it in the list of keysToWatch.\n */\n const [keyCodes, keysToWatch] = useMemo(() => {\n if (keyCode !== null) {\n const keyCodeArr = Array.isArray(keyCode) ? keyCode : [keyCode];\n const keys = keyCodeArr\n .filter((kc) => typeof kc === 'string')\n /*\n * we first replace all '+' with '\\n' which we will use to split the keys on\n * then we replace '\\n\\n' with '\\n+', this way we can also support the combination 'key++'\n * in the end we simply split on '\\n' to get the key array\n */\n .map((kc) => kc.replace('+', '\\n').replace('\\n\\n', '\\n+').split('\\n'));\n const keysFlat = keys.reduce((res, item) => res.concat(...item), []);\n return [keys, keysFlat];\n }\n return [[], []];\n }, [keyCode]);\n useEffect(() => {\n const target = options?.target ?? defaultDoc;\n const actInsideInputWithModifier = options?.actInsideInputWithModifier ?? true;\n if (keyCode !== null) {\n const downHandler = (event) => {\n modifierPressed.current = event.ctrlKey || event.metaKey || event.shiftKey || event.altKey;\n const preventAction = (!modifierPressed.current || (modifierPressed.current && !actInsideInputWithModifier)) &&\n isInputDOMNode(event);\n if (preventAction) {\n return false;\n }\n const keyOrCode = useKeyOrCode(event.code, keysToWatch);\n pressedKeys.current.add(event[keyOrCode]);\n if (isMatchingKey(keyCodes, pressedKeys.current, false)) {\n const target = (event.composedPath?.()?.[0] || event.target);\n const isInteractiveElement = target?.nodeName === 'BUTTON' || target?.nodeName === 'A';\n if (options.preventDefault !== false && (modifierPressed.current || !isInteractiveElement)) {\n event.preventDefault();\n }\n setKeyPressed(true);\n }\n };\n const upHandler = (event) => {\n const keyOrCode = useKeyOrCode(event.code, keysToWatch);\n if (isMatchingKey(keyCodes, pressedKeys.current, true)) {\n setKeyPressed(false);\n pressedKeys.current.clear();\n }\n else {\n pressedKeys.current.delete(event[keyOrCode]);\n }\n // fix for Mac: when cmd key is pressed, keyup is not triggered for any other key, see: https://stackoverflow.com/questions/27380018/when-cmd-key-is-kept-pressed-keyup-is-not-triggered-for-any-other-key\n if (event.key === 'Meta') {\n pressedKeys.current.clear();\n }\n modifierPressed.current = false;\n };\n const resetHandler = () => {\n pressedKeys.current.clear();\n setKeyPressed(false);\n };\n target?.addEventListener('keydown', downHandler);\n target?.addEventListener('keyup', upHandler);\n window.addEventListener('blur', resetHandler);\n window.addEventListener('contextmenu', resetHandler);\n return () => {\n target?.removeEventListener('keydown', downHandler);\n target?.removeEventListener('keyup', upHandler);\n window.removeEventListener('blur', resetHandler);\n window.removeEventListener('contextmenu', resetHandler);\n };\n }\n }, [keyCode, setKeyPressed]);\n return keyPressed;\n}\n// utils\nfunction isMatchingKey(keyCodes, pressedKeys, isUp) {\n return (keyCodes\n /*\n * we only want to compare same sizes of keyCode definitions\n * and pressed keys. When the user specified 'Meta' as a key somewhere\n * this would also be truthy without this filter when user presses 'Meta' + 'r'\n */\n .filter((keys) => isUp || keys.length === pressedKeys.size)\n /*\n * since we want to support multiple possibilities only one of the\n * combinations need to be part of the pressed keys\n */\n .some((keys) => keys.every((k) => pressedKeys.has(k))));\n}\nfunction useKeyOrCode(eventCode, keysToWatch) {\n return keysToWatch.includes(eventCode) ? 'code' : 'key';\n}\n\n/**\n * Hook for getting viewport helper functions.\n *\n * @internal\n * @returns viewport helper functions\n */\nconst useViewportHelper = () => {\n const store = useStoreApi();\n return useMemo(() => {\n return {\n zoomIn: (options) => {\n const { panZoom } = store.getState();\n return panZoom ? panZoom.scaleBy(1.2, { duration: options?.duration }) : Promise.resolve(false);\n },\n zoomOut: (options) => {\n const { panZoom } = store.getState();\n return panZoom ? panZoom.scaleBy(1 / 1.2, { duration: options?.duration }) : Promise.resolve(false);\n },\n zoomTo: (zoomLevel, options) => {\n const { panZoom } = store.getState();\n return panZoom ? panZoom.scaleTo(zoomLevel, { duration: options?.duration }) : Promise.resolve(false);\n },\n getZoom: () => store.getState().transform[2],\n setViewport: async (viewport, options) => {\n const { transform: [tX, tY, tZoom], panZoom, } = store.getState();\n if (!panZoom) {\n return Promise.resolve(false);\n }\n await panZoom.setViewport({\n x: viewport.x ?? tX,\n y: viewport.y ?? tY,\n zoom: viewport.zoom ?? tZoom,\n }, options);\n return Promise.resolve(true);\n },\n getViewport: () => {\n const [x, y, zoom] = store.getState().transform;\n return { x, y, zoom };\n },\n setCenter: async (x, y, options) => {\n return store.getState().setCenter(x, y, options);\n },\n fitBounds: async (bounds, options) => {\n const { width, height, minZoom, maxZoom, panZoom } = store.getState();\n const viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom, options?.padding ?? 0.1);\n if (!panZoom) {\n return Promise.resolve(false);\n }\n await panZoom.setViewport(viewport, {\n duration: options?.duration,\n ease: options?.ease,\n interpolate: options?.interpolate,\n });\n return Promise.resolve(true);\n },\n screenToFlowPosition: (clientPosition, options = {}) => {\n const { transform, snapGrid, snapToGrid, domNode } = store.getState();\n if (!domNode) {\n return clientPosition;\n }\n const { x: domX, y: domY } = domNode.getBoundingClientRect();\n const correctedPosition = {\n x: clientPosition.x - domX,\n y: clientPosition.y - domY,\n };\n const _snapGrid = options.snapGrid ?? snapGrid;\n const _snapToGrid = options.snapToGrid ?? snapToGrid;\n return pointToRendererPoint(correctedPosition, transform, _snapToGrid, _snapGrid);\n },\n flowToScreenPosition: (flowPosition) => {\n const { transform, domNode } = store.getState();\n if (!domNode) {\n return flowPosition;\n }\n const { x: domX, y: domY } = domNode.getBoundingClientRect();\n const rendererPosition = rendererPointToPoint(flowPosition, transform);\n return {\n x: rendererPosition.x + domX,\n y: rendererPosition.y + domY,\n };\n },\n };\n }, []);\n};\n\n/*\n * This function applies changes to nodes or edges that are triggered by React Flow internally.\n * When you drag a node for example, React Flow will send a position change update.\n * This function then applies the changes and returns the updated elements.\n */\nfunction applyChanges(changes, elements) {\n const updatedElements = [];\n /*\n * By storing a map of changes for each element, we can a quick lookup as we\n * iterate over the elements array!\n */\n const changesMap = new Map();\n const addItemChanges = [];\n for (const change of changes) {\n if (change.type === 'add') {\n addItemChanges.push(change);\n continue;\n }\n else if (change.type === 'remove' || change.type === 'replace') {\n /*\n * For a 'remove' change we can safely ignore any other changes queued for\n * the same element, it's going to be removed anyway!\n */\n changesMap.set(change.id, [change]);\n }\n else {\n const elementChanges = changesMap.get(change.id);\n if (elementChanges) {\n /*\n * If we have some changes queued already, we can do a mutable update of\n * that array and save ourselves some copying.\n */\n elementChanges.push(change);\n }\n else {\n changesMap.set(change.id, [change]);\n }\n }\n }\n for (const element of elements) {\n const changes = changesMap.get(element.id);\n /*\n * When there are no changes for an element we can just push it unmodified,\n * no need to copy it.\n */\n if (!changes) {\n updatedElements.push(element);\n continue;\n }\n // If we have a 'remove' change queued, it'll be the only change in the array\n if (changes[0].type === 'remove') {\n continue;\n }\n if (changes[0].type === 'replace') {\n updatedElements.push({ ...changes[0].item });\n continue;\n }\n /**\n * For other types of changes, we want to start with a shallow copy of the\n * object so React knows this element has changed. Sequential changes will\n * each _mutate_ this object, so there's only ever one copy.\n */\n const updatedElement = { ...element };\n for (const change of changes) {\n applyChange(change, updatedElement);\n }\n updatedElements.push(updatedElement);\n }\n /*\n * we need to wait for all changes to be applied before adding new items\n * to be able to add them at the correct index\n */\n if (addItemChanges.length) {\n addItemChanges.forEach((change) => {\n if (change.index !== undefined) {\n updatedElements.splice(change.index, 0, { ...change.item });\n }\n else {\n updatedElements.push({ ...change.item });\n }\n });\n }\n return updatedElements;\n}\n// Applies a single change to an element. This is a *mutable* update.\nfunction applyChange(change, element) {\n switch (change.type) {\n case 'select': {\n element.selected = change.selected;\n break;\n }\n case 'position': {\n if (typeof change.position !== 'undefined') {\n element.position = change.position;\n }\n if (typeof change.dragging !== 'undefined') {\n element.dragging = change.dragging;\n }\n break;\n }\n case 'dimensions': {\n if (typeof change.dimensions !== 'undefined') {\n element.measured ??= {};\n element.measured.width = change.dimensions.width;\n element.measured.height = change.dimensions.height;\n if (change.setAttributes) {\n if (change.setAttributes === true || change.setAttributes === 'width') {\n element.width = change.dimensions.width;\n }\n if (change.setAttributes === true || change.setAttributes === 'height') {\n element.height = change.dimensions.height;\n }\n }\n }\n if (typeof change.resizing === 'boolean') {\n element.resizing = change.resizing;\n }\n break;\n }\n }\n}\n/**\n * Drop in function that applies node changes to an array of nodes.\n * @public\n * @param changes - Array of changes to apply.\n * @param nodes - Array of nodes to apply the changes to.\n * @returns Array of updated nodes.\n * @example\n *```tsx\n *import { useState, useCallback } from 'react';\n *import { ReactFlow, applyNodeChanges, type Node, type Edge, type OnNodesChange } from '@xyflow/react';\n *\n *export default function Flow() {\n * const [nodes, setNodes] = useState<Node[]>([]);\n * const [edges, setEdges] = useState<Edge[]>([]);\n * const onNodesChange: OnNodesChange = useCallback(\n * (changes) => {\n * setNodes((oldNodes) => applyNodeChanges(changes, oldNodes));\n * },\n * [setNodes],\n * );\n *\n * return (\n * <ReactFlow nodes={nodes} edges={edges} onNodesChange={onNodesChange} />\n * );\n *}\n *```\n * @remarks Various events on the <ReactFlow /> component can produce an {@link NodeChange}\n * that describes how to update the edges of your flow in some way.\n * If you don't need any custom behaviour, this util can be used to take an array\n * of these changes and apply them to your edges.\n */\nfunction applyNodeChanges(changes, nodes) {\n return applyChanges(changes, nodes);\n}\n/**\n * Drop in function that applies edge changes to an array of edges.\n * @public\n * @param changes - Array of changes to apply.\n * @param edges - Array of edge to apply the changes to.\n * @returns Array of updated edges.\n * @example\n * ```tsx\n *import { useState, useCallback } from 'react';\n *import { ReactFlow, applyEdgeChanges } from '@xyflow/react';\n *\n *export default function Flow() {\n * const [nodes, setNodes] = useState([]);\n * const [edges, setEdges] = useState([]);\n * const onEdgesChange = useCallback(\n * (changes) => {\n * setEdges((oldEdges) => applyEdgeChanges(changes, oldEdges));\n * },\n * [setEdges],\n * );\n *\n * return (\n * <ReactFlow nodes={nodes} edges={edges} onEdgesChange={onEdgesChange} />\n * );\n *}\n *```\n * @remarks Various events on the <ReactFlow /> component can produce an {@link EdgeChange}\n * that describes how to update the edges of your flow in some way.\n * If you don't need any custom behaviour, this util can be used to take an array\n * of these changes and apply them to your edges.\n */\nfunction applyEdgeChanges(changes, edges) {\n return applyChanges(changes, edges);\n}\nfunction createSelectionChange(id, selected) {\n return {\n id,\n type: 'select',\n selected,\n };\n}\nfunction getSelectionChanges(items, selectedIds = new Set(), mutateItem = false) {\n const changes = [];\n for (const [id, item] of items) {\n const willBeSelected = selectedIds.has(id);\n // we don't want to set all items to selected=false on the first selection\n if (!(item.selected === undefined && !willBeSelected) && item.selected !== willBeSelected) {\n if (mutateItem) {\n /*\n * this hack is needed for nodes. When the user dragged a node, it's selected.\n * When another node gets dragged, we need to deselect the previous one,\n * in order to have only one selected node at a time - the onNodesChange callback comes too late here :/\n */\n item.selected = willBeSelected;\n }\n changes.push(createSelectionChange(item.id, willBeSelected));\n }\n }\n return changes;\n}\nfunction getElementsDiffChanges({ items = [], lookup, }) {\n const changes = [];\n const itemsLookup = new Map(items.map((item) => [item.id, item]));\n for (const [index, item] of items.entries()) {\n const lookupItem = lookup.get(item.id);\n const storeItem = lookupItem?.internals?.userNode ?? lookupItem;\n if (storeItem !== undefined && storeItem !== item) {\n changes.push({ id: item.id, item: item, type: 'replace' });\n }\n if (storeItem === undefined) {\n changes.push({ item: item, type: 'add', index });\n }\n }\n for (const [id] of lookup) {\n const nextNode = itemsLookup.get(id);\n if (nextNode === undefined) {\n changes.push({ id, type: 'remove' });\n }\n }\n return changes;\n}\nfunction elementToRemoveChange(item) {\n return {\n id: item.id,\n type: 'remove',\n };\n}\n\n/**\n * Test whether an object is usable as an [`Node`](/api-reference/types/node).\n * In TypeScript this is a type guard that will narrow the type of whatever you pass in to\n * [`Node`](/api-reference/types/node) if it returns `true`.\n *\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true\n * @param element - The element to test.\n * @returns Tests whether the provided value can be used as a `Node`. If you're using TypeScript,\n * this function acts as a type guard and will narrow the type of the value to `Node` if it returns\n * `true`.\n *\n * @example\n * ```js\n *import { isNode } from '@xyflow/react';\n *\n *if (isNode(node)) {\n * // ...\n *}\n *```\n */\nconst isNode = (element) => isNodeBase(element);\n/**\n * Test whether an object is usable as an [`Edge`](/api-reference/types/edge).\n * In TypeScript this is a type guard that will narrow the type of whatever you pass in to\n * [`Edge`](/api-reference/types/edge) if it returns `true`.\n *\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true\n * @param element - The element to test\n * @returns Tests whether the provided value can be used as an `Edge`. If you're using TypeScript,\n * this function acts as a type guard and will narrow the type of the value to `Edge` if it returns\n * `true`.\n *\n * @example\n * ```js\n *import { isEdge } from '@xyflow/react';\n *\n *if (isEdge(edge)) {\n * // ...\n *}\n *```\n */\nconst isEdge = (element) => isEdgeBase(element);\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nfunction fixedForwardRef(render) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return forwardRef(render);\n}\n\n// we need this hook to prevent a warning when using react-flow in SSR\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\n/**\n * This hook returns a queue that can be used to batch updates.\n *\n * @param runQueue - a function that gets called when the queue is flushed\n * @internal\n *\n * @returns a Queue object\n */\nfunction useQueue(runQueue) {\n /*\n * Because we're using a ref above, we need some way to let React know when to\n * actually process the queue. We increment this number any time we mutate the\n * queue, creating a new state to trigger the layout effect below.\n * Using a boolean dirty flag here instead would lead to issues related to\n * automatic batching. (https://github.com/xyflow/xyflow/issues/4779)\n */\n const [serial, setSerial] = useState(BigInt(0));\n /*\n * A reference of all the batched updates to process before the next render. We\n * want a reference here so multiple synchronous calls to `setNodes` etc can be\n * batched together.\n */\n const [queue] = useState(() => createQueue(() => setSerial(n => n + BigInt(1))));\n /*\n * Layout effects are guaranteed to run before the next render which means we\n * shouldn't run into any issues with stale state or weird issues that come from\n * rendering things one frame later than expected (we used to use `setTimeout`).\n */\n useIsomorphicLayoutEffect(() => {\n const queueItems = queue.get();\n if (queueItems.length) {\n runQueue(queueItems);\n queue.reset();\n }\n }, [serial]);\n return queue;\n}\nfunction createQueue(cb) {\n let queue = [];\n return {\n get: () => queue,\n reset: () => {\n queue = [];\n },\n push: (item) => {\n queue.push(item);\n cb();\n },\n };\n}\n\nconst BatchContext = createContext(null);\n/**\n * This is a context provider that holds and processes the node and edge update queues\n * that are needed to handle setNodes, addNodes, setEdges and addEdges.\n *\n * @internal\n */\nfunction BatchProvider({ children, }) {\n const store = useStoreApi();\n const nodeQueueHandler = useCallback((queueItems) => {\n const { nodes = [], setNodes, hasDefaultNodes, onNodesChange, nodeLookup, fitViewQueued } = store.getState();\n /*\n * This is essentially an `Array.reduce` in imperative clothing. Processing\n * this queue is a relatively hot path so we'd like to avoid the overhead of\n * array methods where we can.\n */\n let next = nodes;\n for (const payload of queueItems) {\n next = typeof payload === 'function' ? payload(next) : payload;\n }\n const changes = getElementsDiffChanges({\n items: next,\n lookup: nodeLookup,\n });\n if (hasDefaultNodes) {\n setNodes(next);\n }\n // We only want to fire onNodesChange if there are changes to the nodes\n if (changes.length > 0) {\n onNodesChange?.(changes);\n }\n else if (fitViewQueued) {\n // If there are no changes to the nodes, we still need to call setNodes\n // to trigger a re-render and fitView.\n window.requestAnimationFrame(() => {\n const { fitViewQueued, nodes, setNodes } = store.getState();\n if (fitViewQueued) {\n setNodes(nodes);\n }\n });\n }\n }, []);\n const nodeQueue = useQueue(nodeQueueHandler);\n const edgeQueueHandler = useCallback((queueItems) => {\n const { edges = [], setEdges, hasDefaultEdges, onEdgesChange, edgeLookup } = store.getState();\n let next = edges;\n for (const payload of queueItems) {\n next = typeof payload === 'function' ? payload(next) : payload;\n }\n if (hasDefaultEdges) {\n setEdges(next);\n }\n else if (onEdgesChange) {\n onEdgesChange(getElementsDiffChanges({\n items: next,\n lookup: edgeLookup,\n }));\n }\n }, []);\n const edgeQueue = useQueue(edgeQueueHandler);\n const value = useMemo(() => ({ nodeQueue, edgeQueue }), []);\n return jsx(BatchContext.Provider, { value: value, children: children });\n}\nfunction useBatchContext() {\n const batchContext = useContext(BatchContext);\n if (!batchContext) {\n throw new Error('useBatchContext must be used within a BatchProvider');\n }\n return batchContext;\n}\n\nconst selector$k = (s) => !!s.panZoom;\n/**\n * This hook returns a ReactFlowInstance that can be used to update nodes and edges, manipulate the viewport, or query the current state of the flow.\n *\n * @public\n * @example\n * ```jsx\n *import { useCallback, useState } from 'react';\n *import { useReactFlow } from '@xyflow/react';\n *\n *export function NodeCounter() {\n * const reactFlow = useReactFlow();\n * const [count, setCount] = useState(0);\n * const countNodes = useCallback(() => {\n * setCount(reactFlow.getNodes().length);\n * // you need to pass it as a dependency if you are using it with useEffect or useCallback\n * // because at the first render, it's not initialized yet and some functions might not work.\n * }, [reactFlow]);\n *\n * return (\n * <div>\n * <button onClick={countNodes}>Update count</button>\n * <p>There are {count} nodes in the flow.</p>\n * </div>\n * );\n *}\n *```\n */\nfunction useReactFlow() {\n const viewportHelper = useViewportHelper();\n const store = useStoreApi();\n const batchContext = useBatchContext();\n const viewportInitialized = useStore(selector$k);\n const generalHelper = useMemo(() => {\n const getInternalNode = (id) => store.getState().nodeLookup.get(id);\n const setNodes = (payload) => {\n batchContext.nodeQueue.push(payload);\n };\n const setEdges = (payload) => {\n batchContext.edgeQueue.push(payload);\n };\n const getNodeRect = (node) => {\n const { nodeLookup, nodeOrigin } = store.getState();\n const nodeToUse = isNode(node) ? node : nodeLookup.get(node.id);\n const position = nodeToUse.parentId\n ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, nodeLookup, nodeOrigin)\n : nodeToUse.position;\n const nodeWithPosition = {\n ...nodeToUse,\n position,\n width: nodeToUse.measured?.width ?? nodeToUse.width,\n height: nodeToUse.measured?.height ?? nodeToUse.height,\n };\n return nodeToRect(nodeWithPosition);\n };\n const updateNode = (id, nodeUpdate, options = { replace: false }) => {\n setNodes((prevNodes) => prevNodes.map((node) => {\n if (node.id === id) {\n const nextNode = typeof nodeUpdate === 'function' ? nodeUpdate(node) : nodeUpdate;\n return options.replace && isNode(nextNode) ? nextNode : { ...node, ...nextNode };\n }\n return node;\n }));\n };\n const updateEdge = (id, edgeUpdate, options = { replace: false }) => {\n setEdges((prevEdges) => prevEdges.map((edge) => {\n if (edge.id === id) {\n const nextEdge = typeof edgeUpdate === 'function' ? edgeUpdate(edge) : edgeUpdate;\n return options.replace && isEdge(nextEdge) ? nextEdge : { ...edge, ...nextEdge };\n }\n return edge;\n }));\n };\n return {\n getNodes: () => store.getState().nodes.map((n) => ({ ...n })),\n getNode: (id) => getInternalNode(id)?.internals.userNode,\n getInternalNode,\n getEdges: () => {\n const { edges = [] } = store.getState();\n return edges.map((e) => ({ ...e }));\n },\n getEdge: (id) => store.getState().edgeLookup.get(id),\n setNodes,\n setEdges,\n addNodes: (payload) => {\n const newNodes = Array.isArray(payload) ? payload : [payload];\n batchContext.nodeQueue.push((nodes) => [...nodes, ...newNodes]);\n },\n addEdges: (payload) => {\n const newEdges = Array.isArray(payload) ? payload : [payload];\n batchContext.edgeQueue.push((edges) => [...edges, ...newEdges]);\n },\n toObject: () => {\n const { nodes = [], edges = [], transform } = store.getState();\n const [x, y, zoom] = transform;\n return {\n nodes: nodes.map((n) => ({ ...n })),\n edges: edges.map((e) => ({ ...e })),\n viewport: {\n x,\n y,\n zoom,\n },\n };\n },\n deleteElements: async ({ nodes: nodesToRemove = [], edges: edgesToRemove = [] }) => {\n const { nodes, edges, onNodesDelete, onEdgesDelete, triggerNodeChanges, triggerEdgeChanges, onDelete, onBeforeDelete, } = store.getState();\n const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove({\n nodesToRemove,\n edgesToRemove,\n nodes,\n edges,\n onBeforeDelete,\n });\n const hasMatchingEdges = matchingEdges.length > 0;\n const hasMatchingNodes = matchingNodes.length > 0;\n if (hasMatchingEdges) {\n const edgeChanges = matchingEdges.map(elementToRemoveChange);\n onEdgesDelete?.(matchingEdges);\n triggerEdgeChanges(edgeChanges);\n }\n if (hasMatchingNodes) {\n const nodeChanges = matchingNodes.map(elementToRemoveChange);\n onNodesDelete?.(matchingNodes);\n triggerNodeChanges(nodeChanges);\n }\n if (hasMatchingNodes || hasMatchingEdges) {\n onDelete?.({ nodes: matchingNodes, edges: matchingEdges });\n }\n return { deletedNodes: matchingNodes, deletedEdges: matchingEdges };\n },\n /**\n * Partial is defined as \"the 2 nodes/areas are intersecting partially\".\n * If a is contained in b or b is contained in a, they are both\n * considered fully intersecting.\n */\n getIntersectingNodes: (nodeOrRect, partially = true, nodes) => {\n const isRect = isRectObject(nodeOrRect);\n const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n const hasNodesOption = nodes !== undefined;\n if (!nodeRect) {\n return [];\n }\n return (nodes || store.getState().nodes).filter((n) => {\n const internalNode = store.getState().nodeLookup.get(n.id);\n if (internalNode && !isRect && (n.id === nodeOrRect.id || !internalNode.internals.positionAbsolute)) {\n return false;\n }\n const currNodeRect = nodeToRect(hasNodesOption ? n : internalNode);\n const overlappingArea = getOverlappingArea(currNodeRect, nodeRect);\n const partiallyVisible = partially && overlappingArea > 0;\n return (partiallyVisible ||\n overlappingArea >= currNodeRect.width * currNodeRect.height ||\n overlappingArea >= nodeRect.width * nodeRect.height);\n });\n },\n isNodeIntersecting: (nodeOrRect, area, partially = true) => {\n const isRect = isRectObject(nodeOrRect);\n const nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n if (!nodeRect) {\n return false;\n }\n const overlappingArea = getOverlappingArea(nodeRect, area);\n const partiallyVisible = partially && overlappingArea > 0;\n return (partiallyVisible ||\n overlappingArea >= area.width * area.height ||\n overlappingArea >= nodeRect.width * nodeRect.height);\n },\n updateNode,\n updateNodeData: (id, dataUpdate, options = { replace: false }) => {\n updateNode(id, (node) => {\n const nextData = typeof dataUpdate === 'function' ? dataUpdate(node) : dataUpdate;\n return options.replace ? { ...node, data: nextData } : { ...node, data: { ...node.data, ...nextData } };\n }, options);\n },\n updateEdge,\n updateEdgeData: (id, dataUpdate, options = { replace: false }) => {\n updateEdge(id, (edge) => {\n const nextData = typeof dataUpdate === 'function' ? dataUpdate(edge) : dataUpdate;\n return options.replace ? { ...edge, data: nextData } : { ...edge, data: { ...edge.data, ...nextData } };\n }, options);\n },\n getNodesBounds: (nodes) => {\n const { nodeLookup, nodeOrigin } = store.getState();\n return getNodesBounds(nodes, { nodeLookup, nodeOrigin });\n },\n getHandleConnections: ({ type, id, nodeId }) => Array.from(store\n .getState()\n .connectionLookup.get(`${nodeId}-${type}${id ? `-${id}` : ''}`)\n ?.values() ?? []),\n getNodeConnections: ({ type, handleId, nodeId }) => Array.from(store\n .getState()\n .connectionLookup.get(`${nodeId}${type ? (handleId ? `-${type}-${handleId}` : `-${type}`) : ''}`)\n ?.values() ?? []),\n fitView: async (options) => {\n // We either create a new Promise or reuse the existing one\n // Even if fitView is called multiple times in a row, we only end up with a single Promise\n const fitViewResolver = store.getState().fitViewResolver ?? withResolvers();\n // We schedule a fitView by setting fitViewQueued and triggering a setNodes\n store.setState({ fitViewQueued: true, fitViewOptions: options, fitViewResolver });\n batchContext.nodeQueue.push((nodes) => [...nodes]);\n return fitViewResolver.promise;\n },\n };\n }, []);\n return useMemo(() => {\n return {\n ...generalHelper,\n ...viewportHelper,\n viewportInitialized,\n };\n }, [viewportInitialized]);\n}\n\nconst selected = (item) => item.selected;\nconst win$1 = typeof window !== 'undefined' ? window : undefined;\n/**\n * Hook for handling global key events.\n *\n * @internal\n */\nfunction useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode, }) {\n const store = useStoreApi();\n const { deleteElements } = useReactFlow();\n const deleteKeyPressed = useKeyPress(deleteKeyCode, { actInsideInputWithModifier: false });\n const multiSelectionKeyPressed = useKeyPress(multiSelectionKeyCode, { target: win$1 });\n useEffect(() => {\n if (deleteKeyPressed) {\n const { edges, nodes } = store.getState();\n deleteElements({ nodes: nodes.filter(selected), edges: edges.filter(selected) });\n store.setState({ nodesSelectionActive: false });\n }\n }, [deleteKeyPressed]);\n useEffect(() => {\n store.setState({ multiSelectionActive: multiSelectionKeyPressed });\n }, [multiSelectionKeyPressed]);\n}\n\n/**\n * Hook for handling resize events.\n *\n * @internal\n */\nfunction useResizeHandler(domNode) {\n const store = useStoreApi();\n useEffect(() => {\n const updateDimensions = () => {\n if (!domNode.current || !(domNode.current.checkVisibility?.() ?? true)) {\n return false;\n }\n const size = getDimensions(domNode.current);\n if (size.height === 0 || size.width === 0) {\n store.getState().onError?.('004', errorMessages['error004']());\n }\n store.setState({ width: size.width || 500, height: size.height || 500 });\n };\n if (domNode.current) {\n updateDimensions();\n window.addEventListener('resize', updateDimensions);\n const resizeObserver = new ResizeObserver(() => updateDimensions());\n resizeObserver.observe(domNode.current);\n return () => {\n window.removeEventListener('resize', updateDimensions);\n if (resizeObserver && domNode.current) {\n resizeObserver.unobserve(domNode.current);\n }\n };\n }\n }, []);\n}\n\nconst containerStyle = {\n position: 'absolute',\n width: '100%',\n height: '100%',\n top: 0,\n left: 0,\n};\n\nconst selector$j = (s) => ({\n userSelectionActive: s.userSelectionActive,\n lib: s.lib,\n connectionInProgress: s.connection.inProgress,\n});\nfunction ZoomPane({ onPaneContextMenu, zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, defaultViewport, translateExtent, minZoom, maxZoom, zoomActivationKeyCode, preventScrolling = true, children, noWheelClassName, noPanClassName, onViewportChange, isControlledViewport, paneClickDistance, selectionOnDrag, }) {\n const store = useStoreApi();\n const zoomPane = useRef(null);\n const { userSelectionActive, lib, connectionInProgress } = useStore(selector$j, shallow);\n const zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode);\n const panZoom = useRef();\n useResizeHandler(zoomPane);\n const onTransformChange = useCallback((transform) => {\n onViewportChange?.({ x: transform[0], y: transform[1], zoom: transform[2] });\n if (!isControlledViewport) {\n store.setState({ transform });\n }\n }, [onViewportChange, isControlledViewport]);\n useEffect(() => {\n if (zoomPane.current) {\n panZoom.current = XYPanZoom({\n domNode: zoomPane.current,\n minZoom,\n maxZoom,\n translateExtent,\n viewport: defaultViewport,\n onDraggingChange: (paneDragging) => store.setState({ paneDragging }),\n onPanZoomStart: (event, vp) => {\n const { onViewportChangeStart, onMoveStart } = store.getState();\n onMoveStart?.(event, vp);\n onViewportChangeStart?.(vp);\n },\n onPanZoom: (event, vp) => {\n const { onViewportChange, onMove } = store.getState();\n onMove?.(event, vp);\n onViewportChange?.(vp);\n },\n onPanZoomEnd: (event, vp) => {\n const { onViewportChangeEnd, onMoveEnd } = store.getState();\n onMoveEnd?.(event, vp);\n onViewportChangeEnd?.(vp);\n },\n });\n const { x, y, zoom } = panZoom.current.getViewport();\n store.setState({\n panZoom: panZoom.current,\n transform: [x, y, zoom],\n domNode: zoomPane.current.closest('.react-flow'),\n });\n return () => {\n panZoom.current?.destroy();\n };\n }\n }, []);\n useEffect(() => {\n panZoom.current?.update({\n onPaneContextMenu,\n zoomOnScroll,\n zoomOnPinch,\n panOnScroll,\n panOnScrollSpeed,\n panOnScrollMode,\n zoomOnDoubleClick,\n panOnDrag,\n zoomActivationKeyPressed,\n preventScrolling,\n noPanClassName,\n userSelectionActive,\n noWheelClassName,\n lib,\n onTransformChange,\n connectionInProgress,\n selectionOnDrag,\n paneClickDistance,\n });\n }, [\n onPaneContextMenu,\n zoomOnScroll,\n zoomOnPinch,\n panOnScroll,\n panOnScrollSpeed,\n panOnScrollMode,\n zoomOnDoubleClick,\n panOnDrag,\n zoomActivationKeyPressed,\n preventScrolling,\n noPanClassName,\n userSelectionActive,\n noWheelClassName,\n lib,\n onTransformChange,\n connectionInProgress,\n selectionOnDrag,\n paneClickDistance,\n ]);\n return (jsx(\"div\", { className: \"react-flow__renderer\", ref: zoomPane, style: containerStyle, children: children }));\n}\n\nconst selector$i = (s) => ({\n userSelectionActive: s.userSelectionActive,\n userSelectionRect: s.userSelectionRect,\n});\nfunction UserSelection() {\n const { userSelectionActive, userSelectionRect } = useStore(selector$i, shallow);\n const isActive = userSelectionActive && userSelectionRect;\n if (!isActive) {\n return null;\n }\n return (jsx(\"div\", { className: \"react-flow__selection react-flow__container\", style: {\n width: userSelectionRect.width,\n height: userSelectionRect.height,\n transform: `translate(${userSelectionRect.x}px, ${userSelectionRect.y}px)`,\n } }));\n}\n\nconst wrapHandler = (handler, containerRef) => {\n return (event) => {\n if (event.target !== containerRef.current) {\n return;\n }\n handler?.(event);\n };\n};\nconst selector$h = (s) => ({\n userSelectionActive: s.userSelectionActive,\n elementsSelectable: s.elementsSelectable,\n connectionInProgress: s.connection.inProgress,\n dragging: s.paneDragging,\n});\nfunction Pane({ isSelecting, selectionKeyPressed, selectionMode = SelectionMode.Full, panOnDrag, paneClickDistance, selectionOnDrag, onSelectionStart, onSelectionEnd, onPaneClick, onPaneContextMenu, onPaneScroll, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, children, }) {\n const store = useStoreApi();\n const { userSelectionActive, elementsSelectable, dragging, connectionInProgress } = useStore(selector$h, shallow);\n const isSelectionEnabled = elementsSelectable && (isSelecting || userSelectionActive);\n const container = useRef(null);\n const containerBounds = useRef();\n const selectedNodeIds = useRef(new Set());\n const selectedEdgeIds = useRef(new Set());\n // Used to prevent click events when the user lets go of the selectionKey during a selection\n const selectionInProgress = useRef(false);\n const onClick = (event) => {\n // We prevent click events when the user let go of the selectionKey during a selection\n // We also prevent click events when a connection is in progress\n if (selectionInProgress.current || connectionInProgress) {\n selectionInProgress.current = false;\n return;\n }\n onPaneClick?.(event);\n store.getState().resetSelectedElements();\n store.setState({ nodesSelectionActive: false });\n };\n const onContextMenu = (event) => {\n if (Array.isArray(panOnDrag) && panOnDrag?.includes(2)) {\n event.preventDefault();\n return;\n }\n onPaneContextMenu?.(event);\n };\n const onWheel = onPaneScroll ? (event) => onPaneScroll(event) : undefined;\n const onClickCapture = (event) => {\n if (selectionInProgress.current) {\n event.stopPropagation();\n selectionInProgress.current = false;\n }\n };\n // We are using capture here in order to prevent other pointer events\n // to be able to create a selection above a node or an edge\n const onPointerDownCapture = (event) => {\n const { domNode } = store.getState();\n containerBounds.current = domNode?.getBoundingClientRect();\n if (!containerBounds.current)\n return;\n const eventTargetIsContainer = event.target === container.current;\n // if a child element has the 'nokey' class, we don't want to swallow the event and don't start a selection\n const isNoKeyEvent = !eventTargetIsContainer && !!event.target.closest('.nokey');\n const isSelectionActive = (selectionOnDrag && eventTargetIsContainer) || selectionKeyPressed;\n if (isNoKeyEvent || !isSelecting || !isSelectionActive || event.button !== 0 || !event.isPrimary) {\n return;\n }\n event.target?.setPointerCapture?.(event.pointerId);\n selectionInProgress.current = false;\n const { x, y } = getEventPosition(event.nativeEvent, containerBounds.current);\n store.setState({\n userSelectionRect: {\n width: 0,\n height: 0,\n startX: x,\n startY: y,\n x,\n y,\n },\n });\n if (!eventTargetIsContainer) {\n event.stopPropagation();\n event.preventDefault();\n }\n };\n const onPointerMove = (event) => {\n const { userSelectionRect, transform, nodeLookup, edgeLookup, connectionLookup, triggerNodeChanges, triggerEdgeChanges, defaultEdgeOptions, resetSelectedElements, } = store.getState();\n if (!containerBounds.current || !userSelectionRect) {\n return;\n }\n const { x: mouseX, y: mouseY } = getEventPosition(event.nativeEvent, containerBounds.current);\n const { startX, startY } = userSelectionRect;\n if (!selectionInProgress.current) {\n const requiredDistance = selectionKeyPressed ? 0 : paneClickDistance;\n const distance = Math.hypot(mouseX - startX, mouseY - startY);\n if (distance <= requiredDistance) {\n return;\n }\n resetSelectedElements();\n onSelectionStart?.(event);\n }\n selectionInProgress.current = true;\n const nextUserSelectRect = {\n startX,\n startY,\n x: mouseX < startX ? mouseX : startX,\n y: mouseY < startY ? mouseY : startY,\n width: Math.abs(mouseX - startX),\n height: Math.abs(mouseY - startY),\n };\n const prevSelectedNodeIds = selectedNodeIds.current;\n const prevSelectedEdgeIds = selectedEdgeIds.current;\n selectedNodeIds.current = new Set(getNodesInside(nodeLookup, nextUserSelectRect, transform, selectionMode === SelectionMode.Partial, true).map((node) => node.id));\n selectedEdgeIds.current = new Set();\n const edgesSelectable = defaultEdgeOptions?.selectable ?? true;\n // We look for all edges connected to the selected nodes\n for (const nodeId of selectedNodeIds.current) {\n const connections = connectionLookup.get(nodeId);\n if (!connections)\n continue;\n for (const { edgeId } of connections.values()) {\n const edge = edgeLookup.get(edgeId);\n if (edge && (edge.selectable ?? edgesSelectable)) {\n selectedEdgeIds.current.add(edgeId);\n }\n }\n }\n if (!areSetsEqual(prevSelectedNodeIds, selectedNodeIds.current)) {\n const changes = getSelectionChanges(nodeLookup, selectedNodeIds.current, true);\n triggerNodeChanges(changes);\n }\n if (!areSetsEqual(prevSelectedEdgeIds, selectedEdgeIds.current)) {\n const changes = getSelectionChanges(edgeLookup, selectedEdgeIds.current);\n triggerEdgeChanges(changes);\n }\n store.setState({\n userSelectionRect: nextUserSelectRect,\n userSelectionActive: true,\n nodesSelectionActive: false,\n });\n };\n const onPointerUp = (event) => {\n if (event.button !== 0) {\n return;\n }\n event.target?.releasePointerCapture?.(event.pointerId);\n /*\n * We only want to trigger click functions when in selection mode if\n * the user did not move the mouse.\n */\n if (!userSelectionActive && event.target === container.current && store.getState().userSelectionRect) {\n onClick?.(event);\n }\n store.setState({\n userSelectionActive: false,\n userSelectionRect: null,\n });\n if (selectionInProgress.current) {\n onSelectionEnd?.(event);\n store.setState({\n nodesSelectionActive: selectedNodeIds.current.size > 0,\n });\n }\n };\n const draggable = panOnDrag === true || (Array.isArray(panOnDrag) && panOnDrag.includes(0));\n return (jsxs(\"div\", { className: cc(['react-flow__pane', { draggable, dragging, selection: isSelecting }]), onClick: isSelectionEnabled ? undefined : wrapHandler(onClick, container), onContextMenu: wrapHandler(onContextMenu, container), onWheel: wrapHandler(onWheel, container), onPointerEnter: isSelectionEnabled ? undefined : onPaneMouseEnter, onPointerMove: isSelectionEnabled ? onPointerMove : onPaneMouseMove, onPointerUp: isSelectionEnabled ? onPointerUp : undefined, onPointerDownCapture: isSelectionEnabled ? onPointerDownCapture : undefined, onClickCapture: isSelectionEnabled ? onClickCapture : undefined, onPointerLeave: onPaneMouseLeave, ref: container, style: containerStyle, children: [children, jsx(UserSelection, {})] }));\n}\n\n/*\n * this handler is called by\n * 1. the click handler when node is not draggable or selectNodesOnDrag = false\n * or\n * 2. the on drag start handler when node is draggable and selectNodesOnDrag = true\n */\nfunction handleNodeClick({ id, store, unselect = false, nodeRef, }) {\n const { addSelectedNodes, unselectNodesAndEdges, multiSelectionActive, nodeLookup, onError } = store.getState();\n const node = nodeLookup.get(id);\n if (!node) {\n onError?.('012', errorMessages['error012'](id));\n return;\n }\n store.setState({ nodesSelectionActive: false });\n if (!node.selected) {\n addSelectedNodes([id]);\n }\n else if (unselect || (node.selected && multiSelectionActive)) {\n unselectNodesAndEdges({ nodes: [node], edges: [] });\n requestAnimationFrame(() => nodeRef?.current?.blur());\n }\n}\n\n/**\n * Hook for calling XYDrag helper from @xyflow/system.\n *\n * @internal\n */\nfunction useDrag({ nodeRef, disabled = false, noDragClassName, handleSelector, nodeId, isSelectable, nodeClickDistance, }) {\n const store = useStoreApi();\n const [dragging, setDragging] = useState(false);\n const xyDrag = useRef();\n useEffect(() => {\n xyDrag.current = XYDrag({\n getStoreItems: () => store.getState(),\n onNodeMouseDown: (id) => {\n handleNodeClick({\n id,\n store,\n nodeRef,\n });\n },\n onDragStart: () => {\n setDragging(true);\n },\n onDragStop: () => {\n setDragging(false);\n },\n });\n }, []);\n useEffect(() => {\n if (disabled) {\n xyDrag.current?.destroy();\n }\n else if (nodeRef.current) {\n xyDrag.current?.update({\n noDragClassName,\n handleSelector,\n domNode: nodeRef.current,\n isSelectable,\n nodeId,\n nodeClickDistance,\n });\n return () => {\n xyDrag.current?.destroy();\n };\n }\n }, [noDragClassName, handleSelector, disabled, isSelectable, nodeRef, nodeId]);\n return dragging;\n}\n\nconst selectedAndDraggable = (nodesDraggable) => (n) => n.selected && (n.draggable || (nodesDraggable && typeof n.draggable === 'undefined'));\n/**\n * Hook for updating node positions by passing a direction and factor\n *\n * @internal\n * @returns function for updating node positions\n */\nfunction useMoveSelectedNodes() {\n const store = useStoreApi();\n const moveSelectedNodes = useCallback((params) => {\n const { nodeExtent, snapToGrid, snapGrid, nodesDraggable, onError, updateNodePositions, nodeLookup, nodeOrigin } = store.getState();\n const nodeUpdates = new Map();\n const isSelected = selectedAndDraggable(nodesDraggable);\n /*\n * by default a node moves 5px on each key press\n * if snap grid is enabled, we use that for the velocity\n */\n const xVelo = snapToGrid ? snapGrid[0] : 5;\n const yVelo = snapToGrid ? snapGrid[1] : 5;\n const xDiff = params.direction.x * xVelo * params.factor;\n const yDiff = params.direction.y * yVelo * params.factor;\n for (const [, node] of nodeLookup) {\n if (!isSelected(node)) {\n continue;\n }\n let nextPosition = {\n x: node.internals.positionAbsolute.x + xDiff,\n y: node.internals.positionAbsolute.y + yDiff,\n };\n if (snapToGrid) {\n nextPosition = snapPosition(nextPosition, snapGrid);\n }\n const { position, positionAbsolute } = calculateNodePosition({\n nodeId: node.id,\n nextPosition,\n nodeLookup,\n nodeExtent,\n nodeOrigin,\n onError,\n });\n node.position = position;\n node.internals.positionAbsolute = positionAbsolute;\n nodeUpdates.set(node.id, node);\n }\n updateNodePositions(nodeUpdates);\n }, []);\n return moveSelectedNodes;\n}\n\nconst NodeIdContext = createContext(null);\nconst Provider = NodeIdContext.Provider;\nNodeIdContext.Consumer;\n/**\n * You can use this hook to get the id of the node it is used inside. It is useful\n * if you need the node's id deeper in the render tree but don't want to manually\n * drill down the id as a prop.\n *\n * @public\n * @returns The id for a node in the flow.\n *\n * @example\n *```jsx\n *import { useNodeId } from '@xyflow/react';\n *\n *export default function CustomNode() {\n * return (\n * <div>\n * <span>This node has an id of </span>\n * <NodeIdDisplay />\n * </div>\n * );\n *}\n *\n *function NodeIdDisplay() {\n * const nodeId = useNodeId();\n *\n * return <span>{nodeId}</span>;\n *}\n *```\n */\nconst useNodeId = () => {\n const nodeId = useContext(NodeIdContext);\n return nodeId;\n};\n\nconst selector$g = (s) => ({\n connectOnClick: s.connectOnClick,\n noPanClassName: s.noPanClassName,\n rfId: s.rfId,\n});\nconst connectingSelector = (nodeId, handleId, type) => (state) => {\n const { connectionClickStartHandle: clickHandle, connectionMode, connection } = state;\n const { fromHandle, toHandle, isValid } = connection;\n const connectingTo = toHandle?.nodeId === nodeId && toHandle?.id === handleId && toHandle?.type === type;\n return {\n connectingFrom: fromHandle?.nodeId === nodeId && fromHandle?.id === handleId && fromHandle?.type === type,\n connectingTo,\n clickConnecting: clickHandle?.nodeId === nodeId && clickHandle?.id === handleId && clickHandle?.type === type,\n isPossibleEndHandle: connectionMode === ConnectionMode.Strict\n ? fromHandle?.type !== type\n : nodeId !== fromHandle?.nodeId || handleId !== fromHandle?.id,\n connectionInProcess: !!fromHandle,\n clickConnectionInProcess: !!clickHandle,\n valid: connectingTo && isValid,\n };\n};\nfunction HandleComponent({ type = 'source', position = Position.Top, isValidConnection, isConnectable = true, isConnectableStart = true, isConnectableEnd = true, id, onConnect, children, className, onMouseDown, onTouchStart, ...rest }, ref) {\n const handleId = id || null;\n const isTarget = type === 'target';\n const store = useStoreApi();\n const nodeId = useNodeId();\n const { connectOnClick, noPanClassName, rfId } = useStore(selector$g, shallow);\n const { connectingFrom, connectingTo, clickConnecting, isPossibleEndHandle, connectionInProcess, clickConnectionInProcess, valid, } = useStore(connectingSelector(nodeId, handleId, type), shallow);\n if (!nodeId) {\n store.getState().onError?.('010', errorMessages['error010']());\n }\n const onConnectExtended = (params) => {\n const { defaultEdgeOptions, onConnect: onConnectAction, hasDefaultEdges } = store.getState();\n const edgeParams = {\n ...defaultEdgeOptions,\n ...params,\n };\n if (hasDefaultEdges) {\n const { edges, setEdges } = store.getState();\n setEdges(addEdge(edgeParams, edges));\n }\n onConnectAction?.(edgeParams);\n onConnect?.(edgeParams);\n };\n const onPointerDown = (event) => {\n if (!nodeId) {\n return;\n }\n const isMouseTriggered = isMouseEvent(event.nativeEvent);\n if (isConnectableStart &&\n ((isMouseTriggered && event.button === 0) || !isMouseTriggered)) {\n const currentStore = store.getState();\n XYHandle.onPointerDown(event.nativeEvent, {\n handleDomNode: event.currentTarget,\n autoPanOnConnect: currentStore.autoPanOnConnect,\n connectionMode: currentStore.connectionMode,\n connectionRadius: currentStore.connectionRadius,\n domNode: currentStore.domNode,\n nodeLookup: currentStore.nodeLookup,\n lib: currentStore.lib,\n isTarget,\n handleId,\n nodeId,\n flowId: currentStore.rfId,\n panBy: currentStore.panBy,\n cancelConnection: currentStore.cancelConnection,\n onConnectStart: currentStore.onConnectStart,\n onConnectEnd: currentStore.onConnectEnd,\n updateConnection: currentStore.updateConnection,\n onConnect: onConnectExtended,\n isValidConnection: isValidConnection || currentStore.isValidConnection,\n getTransform: () => store.getState().transform,\n getFromHandle: () => store.getState().connection.fromHandle,\n autoPanSpeed: currentStore.autoPanSpeed,\n dragThreshold: currentStore.connectionDragThreshold,\n });\n }\n if (isMouseTriggered) {\n onMouseDown?.(event);\n }\n else {\n onTouchStart?.(event);\n }\n };\n const onClick = (event) => {\n const { onClickConnectStart, onClickConnectEnd, connectionClickStartHandle, connectionMode, isValidConnection: isValidConnectionStore, lib, rfId: flowId, nodeLookup, connection: connectionState, } = store.getState();\n if (!nodeId || (!connectionClickStartHandle && !isConnectableStart)) {\n return;\n }\n if (!connectionClickStartHandle) {\n onClickConnectStart?.(event.nativeEvent, { nodeId, handleId, handleType: type });\n store.setState({ connectionClickStartHandle: { nodeId, type, id: handleId } });\n return;\n }\n const doc = getHostForElement(event.target);\n const isValidConnectionHandler = isValidConnection || isValidConnectionStore;\n const { connection, isValid } = XYHandle.isValid(event.nativeEvent, {\n handle: {\n nodeId,\n id: handleId,\n type,\n },\n connectionMode,\n fromNodeId: connectionClickStartHandle.nodeId,\n fromHandleId: connectionClickStartHandle.id || null,\n fromType: connectionClickStartHandle.type,\n isValidConnection: isValidConnectionHandler,\n flowId,\n doc,\n lib,\n nodeLookup,\n });\n if (isValid && connection) {\n onConnectExtended(connection);\n }\n const connectionClone = structuredClone(connectionState);\n delete connectionClone.inProgress;\n connectionClone.toPosition = connectionClone.toHandle ? connectionClone.toHandle.position : null;\n onClickConnectEnd?.(event, connectionClone);\n store.setState({ connectionClickStartHandle: null });\n };\n return (jsx(\"div\", { \"data-handleid\": handleId, \"data-nodeid\": nodeId, \"data-handlepos\": position, \"data-id\": `${rfId}-${nodeId}-${handleId}-${type}`, className: cc([\n 'react-flow__handle',\n `react-flow__handle-${position}`,\n 'nodrag',\n noPanClassName,\n className,\n {\n source: !isTarget,\n target: isTarget,\n connectable: isConnectable,\n connectablestart: isConnectableStart,\n connectableend: isConnectableEnd,\n clickconnecting: clickConnecting,\n connectingfrom: connectingFrom,\n connectingto: connectingTo,\n valid,\n /*\n * shows where you can start a connection from\n * and where you can end it while connecting\n */\n connectionindicator: isConnectable &&\n (!connectionInProcess || isPossibleEndHandle) &&\n (connectionInProcess || clickConnectionInProcess ? isConnectableEnd : isConnectableStart),\n },\n ]), onMouseDown: onPointerDown, onTouchStart: onPointerDown, onClick: connectOnClick ? onClick : undefined, ref: ref, ...rest, children: children }));\n}\n/**\n * The `<Handle />` component is used in your [custom nodes](/learn/customization/custom-nodes)\n * to define connection points.\n *\n *@public\n *\n *@example\n *\n *```jsx\n *import { Handle, Position } from '@xyflow/react';\n *\n *export function CustomNode({ data }) {\n * return (\n * <>\n * <div style={{ padding: '10px 20px' }}>\n * {data.label}\n * </div>\n *\n * <Handle type=\"target\" position={Position.Left} />\n * <Handle type=\"source\" position={Position.Right} />\n * </>\n * );\n *};\n *```\n */\nconst Handle = memo(fixedForwardRef(HandleComponent));\n\nfunction InputNode({ data, isConnectable, sourcePosition = Position.Bottom }) {\n return (jsxs(Fragment, { children: [data?.label, jsx(Handle, { type: \"source\", position: sourcePosition, isConnectable: isConnectable })] }));\n}\n\nfunction DefaultNode({ data, isConnectable, targetPosition = Position.Top, sourcePosition = Position.Bottom, }) {\n return (jsxs(Fragment, { children: [jsx(Handle, { type: \"target\", position: targetPosition, isConnectable: isConnectable }), data?.label, jsx(Handle, { type: \"source\", position: sourcePosition, isConnectable: isConnectable })] }));\n}\n\nfunction GroupNode() {\n return null;\n}\n\nfunction OutputNode({ data, isConnectable, targetPosition = Position.Top }) {\n return (jsxs(Fragment, { children: [jsx(Handle, { type: \"target\", position: targetPosition, isConnectable: isConnectable }), data?.label] }));\n}\n\nconst arrowKeyDiffs = {\n ArrowUp: { x: 0, y: -1 },\n ArrowDown: { x: 0, y: 1 },\n ArrowLeft: { x: -1, y: 0 },\n ArrowRight: { x: 1, y: 0 },\n};\nconst builtinNodeTypes = {\n input: InputNode,\n default: DefaultNode,\n output: OutputNode,\n group: GroupNode,\n};\nfunction getNodeInlineStyleDimensions(node) {\n if (node.internals.handleBounds === undefined) {\n return {\n width: node.width ?? node.initialWidth ?? node.style?.width,\n height: node.height ?? node.initialHeight ?? node.style?.height,\n };\n }\n return {\n width: node.width ?? node.style?.width,\n height: node.height ?? node.style?.height,\n };\n}\n\nconst selector$f = (s) => {\n const { width, height, x, y } = getInternalNodesBounds(s.nodeLookup, {\n filter: (node) => !!node.selected,\n });\n return {\n width: isNumeric(width) ? width : null,\n height: isNumeric(height) ? height : null,\n userSelectionActive: s.userSelectionActive,\n transformString: `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]}) translate(${x}px,${y}px)`,\n };\n};\nfunction NodesSelection({ onSelectionContextMenu, noPanClassName, disableKeyboardA11y, }) {\n const store = useStoreApi();\n const { width, height, transformString, userSelectionActive } = useStore(selector$f, shallow);\n const moveSelectedNodes = useMoveSelectedNodes();\n const nodeRef = useRef(null);\n useEffect(() => {\n if (!disableKeyboardA11y) {\n nodeRef.current?.focus({\n preventScroll: true,\n });\n }\n }, [disableKeyboardA11y]);\n useDrag({\n nodeRef,\n });\n if (userSelectionActive || !width || !height) {\n return null;\n }\n const onContextMenu = onSelectionContextMenu\n ? (event) => {\n const selectedNodes = store.getState().nodes.filter((n) => n.selected);\n onSelectionContextMenu(event, selectedNodes);\n }\n : undefined;\n const onKeyDown = (event) => {\n if (Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {\n event.preventDefault();\n moveSelectedNodes({\n direction: arrowKeyDiffs[event.key],\n factor: event.shiftKey ? 4 : 1,\n });\n }\n };\n return (jsx(\"div\", { className: cc(['react-flow__nodesselection', 'react-flow__container', noPanClassName]), style: {\n transform: transformString,\n }, children: jsx(\"div\", { ref: nodeRef, className: \"react-flow__nodesselection-rect\", onContextMenu: onContextMenu, tabIndex: disableKeyboardA11y ? undefined : -1, onKeyDown: disableKeyboardA11y ? undefined : onKeyDown, style: {\n width,\n height,\n } }) }));\n}\n\nconst win = typeof window !== 'undefined' ? window : undefined;\nconst selector$e = (s) => {\n return { nodesSelectionActive: s.nodesSelectionActive, userSelectionActive: s.userSelectionActive };\n};\nfunction FlowRendererComponent({ children, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneContextMenu, onPaneScroll, paneClickDistance, deleteKeyCode, selectionKeyCode, selectionOnDrag, selectionMode, onSelectionStart, onSelectionEnd, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, elementsSelectable, zoomOnScroll, zoomOnPinch, panOnScroll: _panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag: _panOnDrag, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, onSelectionContextMenu, noWheelClassName, noPanClassName, disableKeyboardA11y, onViewportChange, isControlledViewport, }) {\n const { nodesSelectionActive, userSelectionActive } = useStore(selector$e);\n const selectionKeyPressed = useKeyPress(selectionKeyCode, { target: win });\n const panActivationKeyPressed = useKeyPress(panActivationKeyCode, { target: win });\n const panOnDrag = panActivationKeyPressed || _panOnDrag;\n const panOnScroll = panActivationKeyPressed || _panOnScroll;\n const _selectionOnDrag = selectionOnDrag && panOnDrag !== true;\n const isSelecting = selectionKeyPressed || userSelectionActive || _selectionOnDrag;\n useGlobalKeyHandler({ deleteKeyCode, multiSelectionKeyCode });\n return (jsx(ZoomPane, { onPaneContextMenu: onPaneContextMenu, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, zoomOnDoubleClick: zoomOnDoubleClick, panOnDrag: !selectionKeyPressed && panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, zoomActivationKeyCode: zoomActivationKeyCode, preventScrolling: preventScrolling, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, onViewportChange: onViewportChange, isControlledViewport: isControlledViewport, paneClickDistance: paneClickDistance, selectionOnDrag: _selectionOnDrag, children: jsxs(Pane, { onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, panOnDrag: panOnDrag, isSelecting: !!isSelecting, selectionMode: selectionMode, selectionKeyPressed: selectionKeyPressed, paneClickDistance: paneClickDistance, selectionOnDrag: _selectionOnDrag, children: [children, nodesSelectionActive && (jsx(NodesSelection, { onSelectionContextMenu: onSelectionContextMenu, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y }))] }) }));\n}\nFlowRendererComponent.displayName = 'FlowRenderer';\nconst FlowRenderer = memo(FlowRendererComponent);\n\nconst selector$d = (onlyRenderVisible) => (s) => {\n return onlyRenderVisible\n ? getNodesInside(s.nodeLookup, { x: 0, y: 0, width: s.width, height: s.height }, s.transform, true).map((node) => node.id)\n : Array.from(s.nodeLookup.keys());\n};\n/**\n * Hook for getting the visible node ids from the store.\n *\n * @internal\n * @param onlyRenderVisible\n * @returns array with visible node ids\n */\nfunction useVisibleNodeIds(onlyRenderVisible) {\n const nodeIds = useStore(useCallback(selector$d(onlyRenderVisible), [onlyRenderVisible]), shallow);\n return nodeIds;\n}\n\nconst selector$c = (s) => s.updateNodeInternals;\nfunction useResizeObserver() {\n const updateNodeInternals = useStore(selector$c);\n const [resizeObserver] = useState(() => {\n if (typeof ResizeObserver === 'undefined') {\n return null;\n }\n return new ResizeObserver((entries) => {\n const updates = new Map();\n entries.forEach((entry) => {\n const id = entry.target.getAttribute('data-id');\n updates.set(id, {\n id,\n nodeElement: entry.target,\n force: true,\n });\n });\n updateNodeInternals(updates);\n });\n });\n useEffect(() => {\n return () => {\n resizeObserver?.disconnect();\n };\n }, [resizeObserver]);\n return resizeObserver;\n}\n\n/**\n * Hook to handle the resize observation + internal updates for the passed node.\n *\n * @internal\n * @returns nodeRef - reference to the node element\n */\nfunction useNodeObserver({ node, nodeType, hasDimensions, resizeObserver, }) {\n const store = useStoreApi();\n const nodeRef = useRef(null);\n const observedNode = useRef(null);\n const prevSourcePosition = useRef(node.sourcePosition);\n const prevTargetPosition = useRef(node.targetPosition);\n const prevType = useRef(nodeType);\n const isInitialized = hasDimensions && !!node.internals.handleBounds;\n useEffect(() => {\n if (nodeRef.current && !node.hidden && (!isInitialized || observedNode.current !== nodeRef.current)) {\n if (observedNode.current) {\n resizeObserver?.unobserve(observedNode.current);\n }\n resizeObserver?.observe(nodeRef.current);\n observedNode.current = nodeRef.current;\n }\n }, [isInitialized, node.hidden]);\n useEffect(() => {\n return () => {\n if (observedNode.current) {\n resizeObserver?.unobserve(observedNode.current);\n observedNode.current = null;\n }\n };\n }, []);\n useEffect(() => {\n if (nodeRef.current) {\n /*\n * when the user programmatically changes the source or handle position, we need to update the internals\n * to make sure the edges are updated correctly\n */\n const typeChanged = prevType.current !== nodeType;\n const sourcePosChanged = prevSourcePosition.current !== node.sourcePosition;\n const targetPosChanged = prevTargetPosition.current !== node.targetPosition;\n if (typeChanged || sourcePosChanged || targetPosChanged) {\n prevType.current = nodeType;\n prevSourcePosition.current = node.sourcePosition;\n prevTargetPosition.current = node.targetPosition;\n store\n .getState()\n .updateNodeInternals(new Map([[node.id, { id: node.id, nodeElement: nodeRef.current, force: true }]]));\n }\n }\n }, [node.id, nodeType, node.sourcePosition, node.targetPosition]);\n return nodeRef;\n}\n\nfunction NodeWrapper({ id, onClick, onMouseEnter, onMouseMove, onMouseLeave, onContextMenu, onDoubleClick, nodesDraggable, elementsSelectable, nodesConnectable, nodesFocusable, resizeObserver, noDragClassName, noPanClassName, disableKeyboardA11y, rfId, nodeTypes, nodeClickDistance, onError, }) {\n const { node, internals, isParent } = useStore((s) => {\n const node = s.nodeLookup.get(id);\n const isParent = s.parentLookup.has(id);\n return {\n node,\n internals: node.internals,\n isParent,\n };\n }, shallow);\n let nodeType = node.type || 'default';\n let NodeComponent = nodeTypes?.[nodeType] || builtinNodeTypes[nodeType];\n if (NodeComponent === undefined) {\n onError?.('003', errorMessages['error003'](nodeType));\n nodeType = 'default';\n NodeComponent = nodeTypes?.['default'] || builtinNodeTypes.default;\n }\n const isDraggable = !!(node.draggable || (nodesDraggable && typeof node.draggable === 'undefined'));\n const isSelectable = !!(node.selectable || (elementsSelectable && typeof node.selectable === 'undefined'));\n const isConnectable = !!(node.connectable || (nodesConnectable && typeof node.connectable === 'undefined'));\n const isFocusable = !!(node.focusable || (nodesFocusable && typeof node.focusable === 'undefined'));\n const store = useStoreApi();\n const hasDimensions = nodeHasDimensions(node);\n const nodeRef = useNodeObserver({ node, nodeType, hasDimensions, resizeObserver });\n const dragging = useDrag({\n nodeRef,\n disabled: node.hidden || !isDraggable,\n noDragClassName,\n handleSelector: node.dragHandle,\n nodeId: id,\n isSelectable,\n nodeClickDistance,\n });\n const moveSelectedNodes = useMoveSelectedNodes();\n if (node.hidden) {\n return null;\n }\n const nodeDimensions = getNodeDimensions(node);\n const inlineDimensions = getNodeInlineStyleDimensions(node);\n const hasPointerEvents = isSelectable || isDraggable || onClick || onMouseEnter || onMouseMove || onMouseLeave;\n const onMouseEnterHandler = onMouseEnter\n ? (event) => onMouseEnter(event, { ...internals.userNode })\n : undefined;\n const onMouseMoveHandler = onMouseMove\n ? (event) => onMouseMove(event, { ...internals.userNode })\n : undefined;\n const onMouseLeaveHandler = onMouseLeave\n ? (event) => onMouseLeave(event, { ...internals.userNode })\n : undefined;\n const onContextMenuHandler = onContextMenu\n ? (event) => onContextMenu(event, { ...internals.userNode })\n : undefined;\n const onDoubleClickHandler = onDoubleClick\n ? (event) => onDoubleClick(event, { ...internals.userNode })\n : undefined;\n const onSelectNodeHandler = (event) => {\n const { selectNodesOnDrag, nodeDragThreshold } = store.getState();\n if (isSelectable && (!selectNodesOnDrag || !isDraggable || nodeDragThreshold > 0)) {\n /*\n * this handler gets called by XYDrag on drag start when selectNodesOnDrag=true\n * here we only need to call it when selectNodesOnDrag=false\n */\n handleNodeClick({\n id,\n store,\n nodeRef,\n });\n }\n if (onClick) {\n onClick(event, { ...internals.userNode });\n }\n };\n const onKeyDown = (event) => {\n if (isInputDOMNode(event.nativeEvent) || disableKeyboardA11y) {\n return;\n }\n if (elementSelectionKeys.includes(event.key) && isSelectable) {\n const unselect = event.key === 'Escape';\n handleNodeClick({\n id,\n store,\n unselect,\n nodeRef,\n });\n }\n else if (isDraggable && node.selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {\n // prevent default scrolling behavior on arrow key press when node is moved\n event.preventDefault();\n const { ariaLabelConfig } = store.getState();\n store.setState({\n ariaLiveMessage: ariaLabelConfig['node.a11yDescription.ariaLiveMessage']({\n direction: event.key.replace('Arrow', '').toLowerCase(),\n x: ~~internals.positionAbsolute.x,\n y: ~~internals.positionAbsolute.y,\n }),\n });\n moveSelectedNodes({\n direction: arrowKeyDiffs[event.key],\n factor: event.shiftKey ? 4 : 1,\n });\n }\n };\n const onFocus = () => {\n if (disableKeyboardA11y || !nodeRef.current?.matches(':focus-visible')) {\n return;\n }\n const { transform, width, height, autoPanOnNodeFocus, setCenter } = store.getState();\n if (!autoPanOnNodeFocus) {\n return;\n }\n const withinViewport = getNodesInside(new Map([[id, node]]), { x: 0, y: 0, width, height }, transform, true).length > 0;\n if (!withinViewport) {\n setCenter(node.position.x + nodeDimensions.width / 2, node.position.y + nodeDimensions.height / 2, {\n zoom: transform[2],\n });\n }\n };\n return (jsx(\"div\", { className: cc([\n 'react-flow__node',\n `react-flow__node-${nodeType}`,\n {\n // this is overwritable by passing `nopan` as a class name\n [noPanClassName]: isDraggable,\n },\n node.className,\n {\n selected: node.selected,\n selectable: isSelectable,\n parent: isParent,\n draggable: isDraggable,\n dragging,\n },\n ]), ref: nodeRef, style: {\n zIndex: internals.z,\n transform: `translate(${internals.positionAbsolute.x}px,${internals.positionAbsolute.y}px)`,\n pointerEvents: hasPointerEvents ? 'all' : 'none',\n visibility: hasDimensions ? 'visible' : 'hidden',\n ...node.style,\n ...inlineDimensions,\n }, \"data-id\": id, \"data-testid\": `rf__node-${id}`, onMouseEnter: onMouseEnterHandler, onMouseMove: onMouseMoveHandler, onMouseLeave: onMouseLeaveHandler, onContextMenu: onContextMenuHandler, onClick: onSelectNodeHandler, onDoubleClick: onDoubleClickHandler, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, onFocus: isFocusable ? onFocus : undefined, role: node.ariaRole ?? (isFocusable ? 'group' : undefined), \"aria-roledescription\": \"node\", \"aria-describedby\": disableKeyboardA11y ? undefined : `${ARIA_NODE_DESC_KEY}-${rfId}`, \"aria-label\": node.ariaLabel, ...node.domAttributes, children: jsx(Provider, { value: id, children: jsx(NodeComponent, { id: id, data: node.data, type: nodeType, positionAbsoluteX: internals.positionAbsolute.x, positionAbsoluteY: internals.positionAbsolute.y, selected: node.selected ?? false, selectable: isSelectable, draggable: isDraggable, deletable: node.deletable ?? true, isConnectable: isConnectable, sourcePosition: node.sourcePosition, targetPosition: node.targetPosition, dragging: dragging, dragHandle: node.dragHandle, zIndex: internals.z, parentId: node.parentId, ...nodeDimensions }) }) }));\n}\nvar NodeWrapper$1 = memo(NodeWrapper);\n\nconst selector$b = (s) => ({\n nodesDraggable: s.nodesDraggable,\n nodesConnectable: s.nodesConnectable,\n nodesFocusable: s.nodesFocusable,\n elementsSelectable: s.elementsSelectable,\n onError: s.onError,\n});\nfunction NodeRendererComponent(props) {\n const { nodesDraggable, nodesConnectable, nodesFocusable, elementsSelectable, onError } = useStore(selector$b, shallow);\n const nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements);\n const resizeObserver = useResizeObserver();\n return (jsx(\"div\", { className: \"react-flow__nodes\", style: containerStyle, children: nodeIds.map((nodeId) => {\n return (\n /*\n * The split of responsibilities between NodeRenderer and\n * NodeComponentWrapper may appear weird. However, it’s designed to\n * minimize the cost of updates when individual nodes change.\n *\n * For example, when you’re dragging a single node, that node gets\n * updated multiple times per second. If `NodeRenderer` were to update\n * every time, it would have to re-run the `nodes.map()` loop every\n * time. This gets pricey with hundreds of nodes, especially if every\n * loop cycle does more than just rendering a JSX element!\n *\n * As a result of this choice, we took the following implementation\n * decisions:\n * - NodeRenderer subscribes *only* to node IDs – and therefore\n * rerender *only* when visible nodes are added or removed.\n * - NodeRenderer performs all operations the result of which can be\n * shared between nodes (such as creating the `ResizeObserver`\n * instance, or subscribing to `selector`). This means extra prop\n * drilling into `NodeComponentWrapper`, but it means we need to run\n * these operations only once – instead of once per node.\n * - Any operations that you’d normally write inside `nodes.map` are\n * moved into `NodeComponentWrapper`. This ensures they are\n * memorized – so if `NodeRenderer` *has* to rerender, it only\n * needs to regenerate the list of nodes, nothing else.\n */\n jsx(NodeWrapper$1, { id: nodeId, nodeTypes: props.nodeTypes, nodeExtent: props.nodeExtent, onClick: props.onNodeClick, onMouseEnter: props.onNodeMouseEnter, onMouseMove: props.onNodeMouseMove, onMouseLeave: props.onNodeMouseLeave, onContextMenu: props.onNodeContextMenu, onDoubleClick: props.onNodeDoubleClick, noDragClassName: props.noDragClassName, noPanClassName: props.noPanClassName, rfId: props.rfId, disableKeyboardA11y: props.disableKeyboardA11y, resizeObserver: resizeObserver, nodesDraggable: nodesDraggable, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, elementsSelectable: elementsSelectable, nodeClickDistance: props.nodeClickDistance, onError: onError }, nodeId));\n }) }));\n}\nNodeRendererComponent.displayName = 'NodeRenderer';\nconst NodeRenderer = memo(NodeRendererComponent);\n\n/**\n * Hook for getting the visible edge ids from the store.\n *\n * @internal\n * @param onlyRenderVisible\n * @returns array with visible edge ids\n */\nfunction useVisibleEdgeIds(onlyRenderVisible) {\n const edgeIds = useStore(useCallback((s) => {\n if (!onlyRenderVisible) {\n return s.edges.map((edge) => edge.id);\n }\n const visibleEdgeIds = [];\n if (s.width && s.height) {\n for (const edge of s.edges) {\n const sourceNode = s.nodeLookup.get(edge.source);\n const targetNode = s.nodeLookup.get(edge.target);\n if (sourceNode &&\n targetNode &&\n isEdgeVisible({\n sourceNode,\n targetNode,\n width: s.width,\n height: s.height,\n transform: s.transform,\n })) {\n visibleEdgeIds.push(edge.id);\n }\n }\n }\n return visibleEdgeIds;\n }, [onlyRenderVisible]), shallow);\n return edgeIds;\n}\n\nconst ArrowSymbol = ({ color = 'none', strokeWidth = 1 }) => {\n const style = {\n strokeWidth,\n ...(color && { stroke: color }),\n };\n return (jsx(\"polyline\", { className: \"arrow\", style: style, strokeLinecap: \"round\", fill: \"none\", strokeLinejoin: \"round\", points: \"-5,-4 0,0 -5,4\" }));\n};\nconst ArrowClosedSymbol = ({ color = 'none', strokeWidth = 1 }) => {\n const style = {\n strokeWidth,\n ...(color && { stroke: color, fill: color }),\n };\n return (jsx(\"polyline\", { className: \"arrowclosed\", style: style, strokeLinecap: \"round\", strokeLinejoin: \"round\", points: \"-5,-4 0,0 -5,4 -5,-4\" }));\n};\nconst MarkerSymbols = {\n [MarkerType.Arrow]: ArrowSymbol,\n [MarkerType.ArrowClosed]: ArrowClosedSymbol,\n};\nfunction useMarkerSymbol(type) {\n const store = useStoreApi();\n const symbol = useMemo(() => {\n const symbolExists = Object.prototype.hasOwnProperty.call(MarkerSymbols, type);\n if (!symbolExists) {\n store.getState().onError?.('009', errorMessages['error009'](type));\n return null;\n }\n return MarkerSymbols[type];\n }, [type]);\n return symbol;\n}\n\nconst Marker = ({ id, type, color, width = 12.5, height = 12.5, markerUnits = 'strokeWidth', strokeWidth, orient = 'auto-start-reverse', }) => {\n const Symbol = useMarkerSymbol(type);\n if (!Symbol) {\n return null;\n }\n return (jsx(\"marker\", { className: \"react-flow__arrowhead\", id: id, markerWidth: `${width}`, markerHeight: `${height}`, viewBox: \"-10 -10 20 20\", markerUnits: markerUnits, orient: orient, refX: \"0\", refY: \"0\", children: jsx(Symbol, { color: color, strokeWidth: strokeWidth }) }));\n};\n/*\n * when you have multiple flows on a page and you hide the first one, the other ones have no markers anymore\n * when they do have markers with the same ids. To prevent this the user can pass a unique id to the react flow wrapper\n * that we can then use for creating our unique marker ids\n */\nconst MarkerDefinitions = ({ defaultColor, rfId }) => {\n const edges = useStore((s) => s.edges);\n const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions);\n const markers = useMemo(() => {\n const markers = createMarkerIds(edges, {\n id: rfId,\n defaultColor,\n defaultMarkerStart: defaultEdgeOptions?.markerStart,\n defaultMarkerEnd: defaultEdgeOptions?.markerEnd,\n });\n return markers;\n }, [edges, defaultEdgeOptions, rfId, defaultColor]);\n if (!markers.length) {\n return null;\n }\n return (jsx(\"svg\", { className: \"react-flow__marker\", \"aria-hidden\": \"true\", children: jsx(\"defs\", { children: markers.map((marker) => (jsx(Marker, { id: marker.id, type: marker.type, color: marker.color, width: marker.width, height: marker.height, markerUnits: marker.markerUnits, strokeWidth: marker.strokeWidth, orient: marker.orient }, marker.id))) }) }));\n};\nMarkerDefinitions.displayName = 'MarkerDefinitions';\nvar MarkerDefinitions$1 = memo(MarkerDefinitions);\n\nfunction EdgeTextComponent({ x, y, label, labelStyle, labelShowBg = true, labelBgStyle, labelBgPadding = [2, 4], labelBgBorderRadius = 2, children, className, ...rest }) {\n const [edgeTextBbox, setEdgeTextBbox] = useState({ x: 1, y: 0, width: 0, height: 0 });\n const edgeTextClasses = cc(['react-flow__edge-textwrapper', className]);\n const edgeTextRef = useRef(null);\n useEffect(() => {\n if (edgeTextRef.current) {\n const textBbox = edgeTextRef.current.getBBox();\n setEdgeTextBbox({\n x: textBbox.x,\n y: textBbox.y,\n width: textBbox.width,\n height: textBbox.height,\n });\n }\n }, [label]);\n if (!label) {\n return null;\n }\n return (jsxs(\"g\", { transform: `translate(${x - edgeTextBbox.width / 2} ${y - edgeTextBbox.height / 2})`, className: edgeTextClasses, visibility: edgeTextBbox.width ? 'visible' : 'hidden', ...rest, children: [labelShowBg && (jsx(\"rect\", { width: edgeTextBbox.width + 2 * labelBgPadding[0], x: -labelBgPadding[0], y: -labelBgPadding[1], height: edgeTextBbox.height + 2 * labelBgPadding[1], className: \"react-flow__edge-textbg\", style: labelBgStyle, rx: labelBgBorderRadius, ry: labelBgBorderRadius })), jsx(\"text\", { className: \"react-flow__edge-text\", y: edgeTextBbox.height / 2, dy: \"0.3em\", ref: edgeTextRef, style: labelStyle, children: label }), children] }));\n}\nEdgeTextComponent.displayName = 'EdgeText';\n/**\n * You can use the `<EdgeText />` component as a helper component to display text\n * within your custom edges.\n *\n * @public\n *\n * @example\n * ```jsx\n * import { EdgeText } from '@xyflow/react';\n *\n * export function CustomEdgeLabel({ label }) {\n * return (\n * <EdgeText\n * x={100}\n * y={100}\n * label={label}\n * labelStyle={{ fill: 'white' }}\n * labelShowBg\n * labelBgStyle={{ fill: 'red' }}\n * labelBgPadding={[2, 4]}\n * labelBgBorderRadius={2}\n * />\n * );\n * }\n *```\n */\nconst EdgeText = memo(EdgeTextComponent);\n\n/**\n * The `<BaseEdge />` component gets used internally for all the edges. It can be\n * used inside a custom edge and handles the invisible helper edge and the edge label\n * for you.\n *\n * @public\n * @example\n * ```jsx\n *import { BaseEdge } from '@xyflow/react';\n *\n *export function CustomEdge({ sourceX, sourceY, targetX, targetY, ...props }) {\n * const [edgePath] = getStraightPath({\n * sourceX,\n * sourceY,\n * targetX,\n * targetY,\n * });\n *\n * return <BaseEdge path={edgePath} {...props} />;\n *}\n *```\n *\n * @remarks If you want to use an edge marker with the [`<BaseEdge />`](/api-reference/components/base-edge) component,\n * you can pass the `markerStart` or `markerEnd` props passed to your custom edge\n * through to the [`<BaseEdge />`](/api-reference/components/base-edge) component.\n * You can see all the props passed to a custom edge by looking at the [`EdgeProps`](/api-reference/types/edge-props) type.\n */\nfunction BaseEdge({ path, labelX, labelY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, interactionWidth = 20, ...props }) {\n return (jsxs(Fragment, { children: [jsx(\"path\", { ...props, d: path, fill: \"none\", className: cc(['react-flow__edge-path', props.className]) }), interactionWidth ? (jsx(\"path\", { d: path, fill: \"none\", strokeOpacity: 0, strokeWidth: interactionWidth, className: \"react-flow__edge-interaction\" })) : null, label && isNumeric(labelX) && isNumeric(labelY) ? (jsx(EdgeText, { x: labelX, y: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius })) : null] }));\n}\n\nfunction getControl({ pos, x1, y1, x2, y2 }) {\n if (pos === Position.Left || pos === Position.Right) {\n return [0.5 * (x1 + x2), y1];\n }\n return [x1, 0.5 * (y1 + y2)];\n}\n/**\n * The `getSimpleBezierPath` util returns everything you need to render a simple\n * bezier edge between two nodes.\n * @public\n * @returns\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n */\nfunction getSimpleBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, }) {\n const [sourceControlX, sourceControlY] = getControl({\n pos: sourcePosition,\n x1: sourceX,\n y1: sourceY,\n x2: targetX,\n y2: targetY,\n });\n const [targetControlX, targetControlY] = getControl({\n pos: targetPosition,\n x1: targetX,\n y1: targetY,\n x2: sourceX,\n y2: sourceY,\n });\n const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourceControlX,\n sourceControlY,\n targetControlX,\n targetControlY,\n });\n return [\n `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`,\n labelX,\n labelY,\n offsetX,\n offsetY,\n ];\n}\nfunction createSimpleBezierEdge(params) {\n // eslint-disable-next-line react/display-name\n return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }) => {\n const [path, labelX, labelY] = getSimpleBezierPath({\n sourceX,\n sourceY,\n sourcePosition,\n targetX,\n targetY,\n targetPosition,\n });\n const _id = params.isInternal ? undefined : id;\n return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n });\n}\nconst SimpleBezierEdge = createSimpleBezierEdge({ isInternal: false });\nconst SimpleBezierEdgeInternal = createSimpleBezierEdge({ isInternal: true });\nSimpleBezierEdge.displayName = 'SimpleBezierEdge';\nSimpleBezierEdgeInternal.displayName = 'SimpleBezierEdgeInternal';\n\nfunction createSmoothStepEdge(params) {\n // eslint-disable-next-line react/display-name\n return memo(({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, sourcePosition = Position.Bottom, targetPosition = Position.Top, markerEnd, markerStart, pathOptions, interactionWidth, }) => {\n const [path, labelX, labelY] = getSmoothStepPath({\n sourceX,\n sourceY,\n sourcePosition,\n targetX,\n targetY,\n targetPosition,\n borderRadius: pathOptions?.borderRadius,\n offset: pathOptions?.offset,\n stepPosition: pathOptions?.stepPosition,\n });\n const _id = params.isInternal ? undefined : id;\n return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n });\n}\n/**\n * Component that can be used inside a custom edge to render a smooth step edge.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { SmoothStepEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n * return (\n * <SmoothStepEdge\n * sourceX={sourceX}\n * sourceY={sourceY}\n * targetX={targetX}\n * targetY={targetY}\n * sourcePosition={sourcePosition}\n * targetPosition={targetPosition}\n * />\n * );\n * }\n * ```\n */\nconst SmoothStepEdge = createSmoothStepEdge({ isInternal: false });\n/**\n * @internal\n */\nconst SmoothStepEdgeInternal = createSmoothStepEdge({ isInternal: true });\nSmoothStepEdge.displayName = 'SmoothStepEdge';\nSmoothStepEdgeInternal.displayName = 'SmoothStepEdgeInternal';\n\nfunction createStepEdge(params) {\n // eslint-disable-next-line react/display-name\n return memo(({ id, ...props }) => {\n const _id = params.isInternal ? undefined : id;\n return (jsx(SmoothStepEdge, { ...props, id: _id, pathOptions: useMemo(() => ({ borderRadius: 0, offset: props.pathOptions?.offset }), [props.pathOptions?.offset]) }));\n });\n}\n/**\n * Component that can be used inside a custom edge to render a step edge.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { StepEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n * return (\n * <StepEdge\n * sourceX={sourceX}\n * sourceY={sourceY}\n * targetX={targetX}\n * targetY={targetY}\n * sourcePosition={sourcePosition}\n * targetPosition={targetPosition}\n * />\n * );\n * }\n * ```\n */\nconst StepEdge = createStepEdge({ isInternal: false });\n/**\n * @internal\n */\nconst StepEdgeInternal = createStepEdge({ isInternal: true });\nStepEdge.displayName = 'StepEdge';\nStepEdgeInternal.displayName = 'StepEdgeInternal';\n\nfunction createStraightEdge(params) {\n // eslint-disable-next-line react/display-name\n return memo(({ id, sourceX, sourceY, targetX, targetY, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, interactionWidth, }) => {\n const [path, labelX, labelY] = getStraightPath({ sourceX, sourceY, targetX, targetY });\n const _id = params.isInternal ? undefined : id;\n return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n });\n}\n/**\n * Component that can be used inside a custom edge to render a straight line.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { StraightEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY }) {\n * return (\n * <StraightEdge\n * sourceX={sourceX}\n * sourceY={sourceY}\n * targetX={targetX}\n * targetY={targetY}\n * />\n * );\n * }\n * ```\n */\nconst StraightEdge = createStraightEdge({ isInternal: false });\n/**\n * @internal\n */\nconst StraightEdgeInternal = createStraightEdge({ isInternal: true });\nStraightEdge.displayName = 'StraightEdge';\nStraightEdgeInternal.displayName = 'StraightEdgeInternal';\n\nfunction createBezierEdge(params) {\n // eslint-disable-next-line react/display-name\n return memo(({ id, sourceX, sourceY, targetX, targetY, sourcePosition = Position.Bottom, targetPosition = Position.Top, label, labelStyle, labelShowBg, labelBgStyle, labelBgPadding, labelBgBorderRadius, style, markerEnd, markerStart, pathOptions, interactionWidth, }) => {\n const [path, labelX, labelY] = getBezierPath({\n sourceX,\n sourceY,\n sourcePosition,\n targetX,\n targetY,\n targetPosition,\n curvature: pathOptions?.curvature,\n });\n const _id = params.isInternal ? undefined : id;\n return (jsx(BaseEdge, { id: _id, path: path, labelX: labelX, labelY: labelY, label: label, labelStyle: labelStyle, labelShowBg: labelShowBg, labelBgStyle: labelBgStyle, labelBgPadding: labelBgPadding, labelBgBorderRadius: labelBgBorderRadius, style: style, markerEnd: markerEnd, markerStart: markerStart, interactionWidth: interactionWidth }));\n });\n}\n/**\n * Component that can be used inside a custom edge to render a bezier curve.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { BezierEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n * return (\n * <BezierEdge\n * sourceX={sourceX}\n * sourceY={sourceY}\n * targetX={targetX}\n * targetY={targetY}\n * sourcePosition={sourcePosition}\n * targetPosition={targetPosition}\n * />\n * );\n * }\n * ```\n */\nconst BezierEdge = createBezierEdge({ isInternal: false });\n/**\n * @internal\n */\nconst BezierEdgeInternal = createBezierEdge({ isInternal: true });\nBezierEdge.displayName = 'BezierEdge';\nBezierEdgeInternal.displayName = 'BezierEdgeInternal';\n\nconst builtinEdgeTypes = {\n default: BezierEdgeInternal,\n straight: StraightEdgeInternal,\n step: StepEdgeInternal,\n smoothstep: SmoothStepEdgeInternal,\n simplebezier: SimpleBezierEdgeInternal,\n};\nconst nullPosition = {\n sourceX: null,\n sourceY: null,\n targetX: null,\n targetY: null,\n sourcePosition: null,\n targetPosition: null,\n};\n\nconst shiftX = (x, shift, position) => {\n if (position === Position.Left)\n return x - shift;\n if (position === Position.Right)\n return x + shift;\n return x;\n};\nconst shiftY = (y, shift, position) => {\n if (position === Position.Top)\n return y - shift;\n if (position === Position.Bottom)\n return y + shift;\n return y;\n};\nconst EdgeUpdaterClassName = 'react-flow__edgeupdater';\n/**\n * @internal\n */\nfunction EdgeAnchor({ position, centerX, centerY, radius = 10, onMouseDown, onMouseEnter, onMouseOut, type, }) {\n return (jsx(\"circle\", { onMouseDown: onMouseDown, onMouseEnter: onMouseEnter, onMouseOut: onMouseOut, className: cc([EdgeUpdaterClassName, `${EdgeUpdaterClassName}-${type}`]), cx: shiftX(centerX, radius, position), cy: shiftY(centerY, radius, position), r: radius, stroke: \"transparent\", fill: \"transparent\" }));\n}\n\nfunction EdgeUpdateAnchors({ isReconnectable, reconnectRadius, edge, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, onReconnect, onReconnectStart, onReconnectEnd, setReconnecting, setUpdateHover, }) {\n const store = useStoreApi();\n const handleEdgeUpdater = (event, oppositeHandle) => {\n // avoid triggering edge updater if mouse btn is not left\n if (event.button !== 0) {\n return;\n }\n const { autoPanOnConnect, domNode, isValidConnection, connectionMode, connectionRadius, lib, onConnectStart, onConnectEnd, cancelConnection, nodeLookup, rfId: flowId, panBy, updateConnection, } = store.getState();\n const isTarget = oppositeHandle.type === 'target';\n const _onReconnectEnd = (evt, connectionState) => {\n setReconnecting(false);\n onReconnectEnd?.(evt, edge, oppositeHandle.type, connectionState);\n };\n const onConnectEdge = (connection) => onReconnect?.(edge, connection);\n const _onConnectStart = (_event, params) => {\n setReconnecting(true);\n onReconnectStart?.(event, edge, oppositeHandle.type);\n onConnectStart?.(_event, params);\n };\n XYHandle.onPointerDown(event.nativeEvent, {\n autoPanOnConnect,\n connectionMode,\n connectionRadius,\n domNode,\n handleId: oppositeHandle.id,\n nodeId: oppositeHandle.nodeId,\n nodeLookup,\n isTarget,\n edgeUpdaterType: oppositeHandle.type,\n lib,\n flowId,\n cancelConnection,\n panBy,\n isValidConnection,\n onConnect: onConnectEdge,\n onConnectStart: _onConnectStart,\n onConnectEnd,\n onReconnectEnd: _onReconnectEnd,\n updateConnection,\n getTransform: () => store.getState().transform,\n getFromHandle: () => store.getState().connection.fromHandle,\n dragThreshold: store.getState().connectionDragThreshold,\n handleDomNode: event.currentTarget,\n });\n };\n const onReconnectSourceMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.target, id: edge.targetHandle ?? null, type: 'target' });\n const onReconnectTargetMouseDown = (event) => handleEdgeUpdater(event, { nodeId: edge.source, id: edge.sourceHandle ?? null, type: 'source' });\n const onReconnectMouseEnter = () => setUpdateHover(true);\n const onReconnectMouseOut = () => setUpdateHover(false);\n return (jsxs(Fragment, { children: [(isReconnectable === true || isReconnectable === 'source') && (jsx(EdgeAnchor, { position: sourcePosition, centerX: sourceX, centerY: sourceY, radius: reconnectRadius, onMouseDown: onReconnectSourceMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: \"source\" })), (isReconnectable === true || isReconnectable === 'target') && (jsx(EdgeAnchor, { position: targetPosition, centerX: targetX, centerY: targetY, radius: reconnectRadius, onMouseDown: onReconnectTargetMouseDown, onMouseEnter: onReconnectMouseEnter, onMouseOut: onReconnectMouseOut, type: \"target\" }))] }));\n}\n\nfunction EdgeWrapper({ id, edgesFocusable, edgesReconnectable, elementsSelectable, onClick, onDoubleClick, onContextMenu, onMouseEnter, onMouseMove, onMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, rfId, edgeTypes, noPanClassName, onError, disableKeyboardA11y, }) {\n let edge = useStore((s) => s.edgeLookup.get(id));\n const defaultEdgeOptions = useStore((s) => s.defaultEdgeOptions);\n edge = defaultEdgeOptions ? { ...defaultEdgeOptions, ...edge } : edge;\n let edgeType = edge.type || 'default';\n let EdgeComponent = edgeTypes?.[edgeType] || builtinEdgeTypes[edgeType];\n if (EdgeComponent === undefined) {\n onError?.('011', errorMessages['error011'](edgeType));\n edgeType = 'default';\n EdgeComponent = edgeTypes?.['default'] || builtinEdgeTypes.default;\n }\n const isFocusable = !!(edge.focusable || (edgesFocusable && typeof edge.focusable === 'undefined'));\n const isReconnectable = typeof onReconnect !== 'undefined' &&\n (edge.reconnectable || (edgesReconnectable && typeof edge.reconnectable === 'undefined'));\n const isSelectable = !!(edge.selectable || (elementsSelectable && typeof edge.selectable === 'undefined'));\n const edgeRef = useRef(null);\n const [updateHover, setUpdateHover] = useState(false);\n const [reconnecting, setReconnecting] = useState(false);\n const store = useStoreApi();\n const { zIndex, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition } = useStore(useCallback((store) => {\n const sourceNode = store.nodeLookup.get(edge.source);\n const targetNode = store.nodeLookup.get(edge.target);\n if (!sourceNode || !targetNode) {\n return {\n zIndex: edge.zIndex,\n ...nullPosition,\n };\n }\n const edgePosition = getEdgePosition({\n id,\n sourceNode,\n targetNode,\n sourceHandle: edge.sourceHandle || null,\n targetHandle: edge.targetHandle || null,\n connectionMode: store.connectionMode,\n onError,\n });\n const zIndex = getElevatedEdgeZIndex({\n selected: edge.selected,\n zIndex: edge.zIndex,\n sourceNode,\n targetNode,\n elevateOnSelect: store.elevateEdgesOnSelect,\n });\n return {\n zIndex,\n ...(edgePosition || nullPosition),\n };\n }, [edge.source, edge.target, edge.sourceHandle, edge.targetHandle, edge.selected, edge.zIndex]), shallow);\n const markerStartUrl = useMemo(() => (edge.markerStart ? `url('#${getMarkerId(edge.markerStart, rfId)}')` : undefined), [edge.markerStart, rfId]);\n const markerEndUrl = useMemo(() => (edge.markerEnd ? `url('#${getMarkerId(edge.markerEnd, rfId)}')` : undefined), [edge.markerEnd, rfId]);\n if (edge.hidden || sourceX === null || sourceY === null || targetX === null || targetY === null) {\n return null;\n }\n const onEdgeClick = (event) => {\n const { addSelectedEdges, unselectNodesAndEdges, multiSelectionActive } = store.getState();\n if (isSelectable) {\n store.setState({ nodesSelectionActive: false });\n if (edge.selected && multiSelectionActive) {\n unselectNodesAndEdges({ nodes: [], edges: [edge] });\n edgeRef.current?.blur();\n }\n else {\n addSelectedEdges([id]);\n }\n }\n if (onClick) {\n onClick(event, edge);\n }\n };\n const onEdgeDoubleClick = onDoubleClick\n ? (event) => {\n onDoubleClick(event, { ...edge });\n }\n : undefined;\n const onEdgeContextMenu = onContextMenu\n ? (event) => {\n onContextMenu(event, { ...edge });\n }\n : undefined;\n const onEdgeMouseEnter = onMouseEnter\n ? (event) => {\n onMouseEnter(event, { ...edge });\n }\n : undefined;\n const onEdgeMouseMove = onMouseMove\n ? (event) => {\n onMouseMove(event, { ...edge });\n }\n : undefined;\n const onEdgeMouseLeave = onMouseLeave\n ? (event) => {\n onMouseLeave(event, { ...edge });\n }\n : undefined;\n const onKeyDown = (event) => {\n if (!disableKeyboardA11y && elementSelectionKeys.includes(event.key) && isSelectable) {\n const { unselectNodesAndEdges, addSelectedEdges } = store.getState();\n const unselect = event.key === 'Escape';\n if (unselect) {\n edgeRef.current?.blur();\n unselectNodesAndEdges({ edges: [edge] });\n }\n else {\n addSelectedEdges([id]);\n }\n }\n };\n return (jsx(\"svg\", { style: { zIndex }, children: jsxs(\"g\", { className: cc([\n 'react-flow__edge',\n `react-flow__edge-${edgeType}`,\n edge.className,\n noPanClassName,\n {\n selected: edge.selected,\n animated: edge.animated,\n inactive: !isSelectable && !onClick,\n updating: updateHover,\n selectable: isSelectable,\n },\n ]), onClick: onEdgeClick, onDoubleClick: onEdgeDoubleClick, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onKeyDown: isFocusable ? onKeyDown : undefined, tabIndex: isFocusable ? 0 : undefined, role: edge.ariaRole ?? (isFocusable ? 'group' : 'img'), \"aria-roledescription\": \"edge\", \"data-id\": id, \"data-testid\": `rf__edge-${id}`, \"aria-label\": edge.ariaLabel === null ? undefined : edge.ariaLabel || `Edge from ${edge.source} to ${edge.target}`, \"aria-describedby\": isFocusable ? `${ARIA_EDGE_DESC_KEY}-${rfId}` : undefined, ref: edgeRef, ...edge.domAttributes, children: [!reconnecting && (jsx(EdgeComponent, { id: id, source: edge.source, target: edge.target, type: edge.type, selected: edge.selected, animated: edge.animated, selectable: isSelectable, deletable: edge.deletable ?? true, label: edge.label, labelStyle: edge.labelStyle, labelShowBg: edge.labelShowBg, labelBgStyle: edge.labelBgStyle, labelBgPadding: edge.labelBgPadding, labelBgBorderRadius: edge.labelBgBorderRadius, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, data: edge.data, style: edge.style, sourceHandleId: edge.sourceHandle, targetHandleId: edge.targetHandle, markerStart: markerStartUrl, markerEnd: markerEndUrl, pathOptions: 'pathOptions' in edge ? edge.pathOptions : undefined, interactionWidth: edge.interactionWidth })), isReconnectable && (jsx(EdgeUpdateAnchors, { edge: edge, isReconnectable: isReconnectable, reconnectRadius: reconnectRadius, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, sourceX: sourceX, sourceY: sourceY, targetX: targetX, targetY: targetY, sourcePosition: sourcePosition, targetPosition: targetPosition, setUpdateHover: setUpdateHover, setReconnecting: setReconnecting }))] }) }));\n}\nvar EdgeWrapper$1 = memo(EdgeWrapper);\n\nconst selector$a = (s) => ({\n edgesFocusable: s.edgesFocusable,\n edgesReconnectable: s.edgesReconnectable,\n elementsSelectable: s.elementsSelectable,\n connectionMode: s.connectionMode,\n onError: s.onError,\n});\nfunction EdgeRendererComponent({ defaultMarkerColor, onlyRenderVisibleElements, rfId, edgeTypes, noPanClassName, onReconnect, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, onEdgeClick, reconnectRadius, onEdgeDoubleClick, onReconnectStart, onReconnectEnd, disableKeyboardA11y, }) {\n const { edgesFocusable, edgesReconnectable, elementsSelectable, onError } = useStore(selector$a, shallow);\n const edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements);\n return (jsxs(\"div\", { className: \"react-flow__edges\", children: [jsx(MarkerDefinitions$1, { defaultColor: defaultMarkerColor, rfId: rfId }), edgeIds.map((id) => {\n return (jsx(EdgeWrapper$1, { id: id, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, noPanClassName: noPanClassName, onReconnect: onReconnect, onContextMenu: onEdgeContextMenu, onMouseEnter: onEdgeMouseEnter, onMouseMove: onEdgeMouseMove, onMouseLeave: onEdgeMouseLeave, onClick: onEdgeClick, reconnectRadius: reconnectRadius, onDoubleClick: onEdgeDoubleClick, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, rfId: rfId, onError: onError, edgeTypes: edgeTypes, disableKeyboardA11y: disableKeyboardA11y }, id));\n })] }));\n}\nEdgeRendererComponent.displayName = 'EdgeRenderer';\nconst EdgeRenderer = memo(EdgeRendererComponent);\n\nconst selector$9 = (s) => `translate(${s.transform[0]}px,${s.transform[1]}px) scale(${s.transform[2]})`;\nfunction Viewport({ children }) {\n const transform = useStore(selector$9);\n return (jsx(\"div\", { className: \"react-flow__viewport xyflow__viewport react-flow__container\", style: { transform }, children: children }));\n}\n\n/**\n * Hook for calling onInit handler.\n *\n * @internal\n */\nfunction useOnInitHandler(onInit) {\n const rfInstance = useReactFlow();\n const isInitialized = useRef(false);\n useEffect(() => {\n if (!isInitialized.current && rfInstance.viewportInitialized && onInit) {\n setTimeout(() => onInit(rfInstance), 1);\n isInitialized.current = true;\n }\n }, [onInit, rfInstance.viewportInitialized]);\n}\n\nconst selector$8 = (state) => state.panZoom?.syncViewport;\n/**\n * Hook for syncing the viewport with the panzoom instance.\n *\n * @internal\n * @param viewport\n */\nfunction useViewportSync(viewport) {\n const syncViewport = useStore(selector$8);\n const store = useStoreApi();\n useEffect(() => {\n if (viewport) {\n syncViewport?.(viewport);\n store.setState({ transform: [viewport.x, viewport.y, viewport.zoom] });\n }\n }, [viewport, syncViewport]);\n return null;\n}\n\nfunction storeSelector$1(s) {\n return s.connection.inProgress\n ? { ...s.connection, to: pointToRendererPoint(s.connection.to, s.transform) }\n : { ...s.connection };\n}\nfunction getSelector(connectionSelector) {\n if (connectionSelector) {\n const combinedSelector = (s) => {\n const connection = storeSelector$1(s);\n return connectionSelector(connection);\n };\n return combinedSelector;\n }\n return storeSelector$1;\n}\n/**\n * The `useConnection` hook returns the current connection when there is an active\n * connection interaction. If no connection interaction is active, it returns null\n * for every property. A typical use case for this hook is to colorize handles\n * based on a certain condition (e.g. if the connection is valid or not).\n *\n * @public\n * @param connectionSelector - An optional selector function used to extract a slice of the\n * `ConnectionState` data. Using a selector can prevent component re-renders where data you don't\n * otherwise care about might change. If a selector is not provided, the entire `ConnectionState`\n * object is returned unchanged.\n * @example\n *\n * ```tsx\n *import { useConnection } from '@xyflow/react';\n *\n *function App() {\n * const connection = useConnection();\n *\n * return (\n * <div> {connection ? `Someone is trying to make a connection from ${connection.fromNode} to this one.` : 'There are currently no incoming connections!'}\n *\n * </div>\n * );\n * }\n * ```\n *\n * @returns ConnectionState\n */\nfunction useConnection(connectionSelector) {\n const combinedSelector = getSelector(connectionSelector);\n return useStore(combinedSelector, shallow);\n}\n\nconst selector$7 = (s) => ({\n nodesConnectable: s.nodesConnectable,\n isValid: s.connection.isValid,\n inProgress: s.connection.inProgress,\n width: s.width,\n height: s.height,\n});\nfunction ConnectionLineWrapper({ containerStyle, style, type, component, }) {\n const { nodesConnectable, width, height, isValid, inProgress } = useStore(selector$7, shallow);\n const renderConnection = !!(width && nodesConnectable && inProgress);\n if (!renderConnection) {\n return null;\n }\n return (jsx(\"svg\", { style: containerStyle, width: width, height: height, className: \"react-flow__connectionline react-flow__container\", children: jsx(\"g\", { className: cc(['react-flow__connection', getConnectionStatus(isValid)]), children: jsx(ConnectionLine, { style: style, type: type, CustomComponent: component, isValid: isValid }) }) }));\n}\nconst ConnectionLine = ({ style, type = ConnectionLineType.Bezier, CustomComponent, isValid, }) => {\n const { inProgress, from, fromNode, fromHandle, fromPosition, to, toNode, toHandle, toPosition, pointer } = useConnection();\n if (!inProgress) {\n return;\n }\n if (CustomComponent) {\n return (jsx(CustomComponent, { connectionLineType: type, connectionLineStyle: style, fromNode: fromNode, fromHandle: fromHandle, fromX: from.x, fromY: from.y, toX: to.x, toY: to.y, fromPosition: fromPosition, toPosition: toPosition, connectionStatus: getConnectionStatus(isValid), toNode: toNode, toHandle: toHandle, pointer: pointer }));\n }\n let path = '';\n const pathParams = {\n sourceX: from.x,\n sourceY: from.y,\n sourcePosition: fromPosition,\n targetX: to.x,\n targetY: to.y,\n targetPosition: toPosition,\n };\n switch (type) {\n case ConnectionLineType.Bezier:\n [path] = getBezierPath(pathParams);\n break;\n case ConnectionLineType.SimpleBezier:\n [path] = getSimpleBezierPath(pathParams);\n break;\n case ConnectionLineType.Step:\n [path] = getSmoothStepPath({\n ...pathParams,\n borderRadius: 0,\n });\n break;\n case ConnectionLineType.SmoothStep:\n [path] = getSmoothStepPath(pathParams);\n break;\n default:\n [path] = getStraightPath(pathParams);\n }\n return jsx(\"path\", { d: path, fill: \"none\", className: \"react-flow__connection-path\", style: style });\n};\nConnectionLine.displayName = 'ConnectionLine';\n\nconst emptyTypes = {};\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction useNodeOrEdgeTypesWarning(nodeOrEdgeTypes = emptyTypes) {\n const typesRef = useRef(nodeOrEdgeTypes);\n const store = useStoreApi();\n useEffect(() => {\n if (process.env.NODE_ENV === 'development') {\n const usedKeys = new Set([...Object.keys(typesRef.current), ...Object.keys(nodeOrEdgeTypes)]);\n for (const key of usedKeys) {\n if (typesRef.current[key] !== nodeOrEdgeTypes[key]) {\n store.getState().onError?.('002', errorMessages['error002']());\n break;\n }\n }\n typesRef.current = nodeOrEdgeTypes;\n }\n }, [nodeOrEdgeTypes]);\n}\n\nfunction useStylesLoadedWarning() {\n const store = useStoreApi();\n const checked = useRef(false);\n useEffect(() => {\n if (process.env.NODE_ENV === 'development') {\n if (!checked.current) {\n const pane = document.querySelector('.react-flow__pane');\n if (pane && !(window.getComputedStyle(pane).zIndex === '1')) {\n store.getState().onError?.('013', errorMessages['error013']('react'));\n }\n checked.current = true;\n }\n }\n }, []);\n}\n\nfunction GraphViewComponent({ nodeTypes, edgeTypes, onInit, onNodeClick, onEdgeClick, onNodeDoubleClick, onEdgeDoubleClick, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onSelectionContextMenu, onSelectionStart, onSelectionEnd, connectionLineType, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, selectionKeyCode, selectionOnDrag, selectionMode, multiSelectionKeyCode, panActivationKeyCode, zoomActivationKeyCode, deleteKeyCode, onlyRenderVisibleElements, elementsSelectable, defaultViewport, translateExtent, minZoom, maxZoom, preventScrolling, defaultMarkerColor, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance, nodeClickDistance, onEdgeContextMenu, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius, onReconnect, onReconnectStart, onReconnectEnd, noDragClassName, noWheelClassName, noPanClassName, disableKeyboardA11y, nodeExtent, rfId, viewport, onViewportChange, }) {\n useNodeOrEdgeTypesWarning(nodeTypes);\n useNodeOrEdgeTypesWarning(edgeTypes);\n useStylesLoadedWarning();\n useOnInitHandler(onInit);\n useViewportSync(viewport);\n return (jsx(FlowRenderer, { onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneContextMenu: onPaneContextMenu, onPaneScroll: onPaneScroll, paneClickDistance: paneClickDistance, deleteKeyCode: deleteKeyCode, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, elementsSelectable: elementsSelectable, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, defaultViewport: defaultViewport, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, onSelectionContextMenu: onSelectionContextMenu, preventScrolling: preventScrolling, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, onViewportChange: onViewportChange, isControlledViewport: !!viewport, children: jsxs(Viewport, { children: [jsx(EdgeRenderer, { edgeTypes: edgeTypes, onEdgeClick: onEdgeClick, onEdgeDoubleClick: onEdgeDoubleClick, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onlyRenderVisibleElements: onlyRenderVisibleElements, onEdgeContextMenu: onEdgeContextMenu, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noPanClassName: noPanClassName, disableKeyboardA11y: disableKeyboardA11y, rfId: rfId }), jsx(ConnectionLineWrapper, { style: connectionLineStyle, type: connectionLineType, component: connectionLineComponent, containerStyle: connectionLineContainerStyle }), jsx(\"div\", { className: \"react-flow__edgelabel-renderer\" }), jsx(NodeRenderer, { nodeTypes: nodeTypes, onNodeClick: onNodeClick, onNodeDoubleClick: onNodeDoubleClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, nodeClickDistance: nodeClickDistance, onlyRenderVisibleElements: onlyRenderVisibleElements, noPanClassName: noPanClassName, noDragClassName: noDragClassName, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, rfId: rfId }), jsx(\"div\", { className: \"react-flow__viewport-portal\" })] }) }));\n}\nGraphViewComponent.displayName = 'GraphView';\nconst GraphView = memo(GraphViewComponent);\n\nconst getInitialState = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom = 0.5, maxZoom = 2, nodeOrigin, nodeExtent, } = {}) => {\n const nodeLookup = new Map();\n const parentLookup = new Map();\n const connectionLookup = new Map();\n const edgeLookup = new Map();\n const storeEdges = defaultEdges ?? edges ?? [];\n const storeNodes = defaultNodes ?? nodes ?? [];\n const storeNodeOrigin = nodeOrigin ?? [0, 0];\n const storeNodeExtent = nodeExtent ?? infiniteExtent;\n updateConnectionLookup(connectionLookup, edgeLookup, storeEdges);\n const nodesInitialized = adoptUserNodes(storeNodes, nodeLookup, parentLookup, {\n nodeOrigin: storeNodeOrigin,\n nodeExtent: storeNodeExtent,\n elevateNodesOnSelect: false,\n });\n let transform = [0, 0, 1];\n if (fitView && width && height) {\n const bounds = getInternalNodesBounds(nodeLookup, {\n filter: (node) => !!((node.width || node.initialWidth) && (node.height || node.initialHeight)),\n });\n const { x, y, zoom } = getViewportForBounds(bounds, width, height, minZoom, maxZoom, fitViewOptions?.padding ?? 0.1);\n transform = [x, y, zoom];\n }\n return {\n rfId: '1',\n width: width ?? 0,\n height: height ?? 0,\n transform,\n nodes: storeNodes,\n nodesInitialized,\n nodeLookup,\n parentLookup,\n edges: storeEdges,\n edgeLookup,\n connectionLookup,\n onNodesChange: null,\n onEdgesChange: null,\n hasDefaultNodes: defaultNodes !== undefined,\n hasDefaultEdges: defaultEdges !== undefined,\n panZoom: null,\n minZoom,\n maxZoom,\n translateExtent: infiniteExtent,\n nodeExtent: storeNodeExtent,\n nodesSelectionActive: false,\n userSelectionActive: false,\n userSelectionRect: null,\n connectionMode: ConnectionMode.Strict,\n domNode: null,\n paneDragging: false,\n noPanClassName: 'nopan',\n nodeOrigin: storeNodeOrigin,\n nodeDragThreshold: 1,\n connectionDragThreshold: 1,\n snapGrid: [15, 15],\n snapToGrid: false,\n nodesDraggable: true,\n nodesConnectable: true,\n nodesFocusable: true,\n edgesFocusable: true,\n edgesReconnectable: true,\n elementsSelectable: true,\n elevateNodesOnSelect: true,\n elevateEdgesOnSelect: false,\n selectNodesOnDrag: true,\n multiSelectionActive: false,\n fitViewQueued: fitView ?? false,\n fitViewOptions,\n fitViewResolver: null,\n connection: { ...initialConnection },\n connectionClickStartHandle: null,\n connectOnClick: true,\n ariaLiveMessage: '',\n autoPanOnConnect: true,\n autoPanOnNodeDrag: true,\n autoPanOnNodeFocus: true,\n autoPanSpeed: 15,\n connectionRadius: 20,\n onError: devWarn,\n isValidConnection: undefined,\n onSelectionChangeHandlers: [],\n lib: 'react',\n debug: false,\n ariaLabelConfig: defaultAriaLabelConfig,\n };\n};\n\nconst createStore = ({ nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }) => createWithEqualityFn((set, get) => {\n async function resolveFitView() {\n const { nodeLookup, panZoom, fitViewOptions, fitViewResolver, width, height, minZoom, maxZoom } = get();\n if (!panZoom) {\n return;\n }\n await fitViewport({\n nodes: nodeLookup,\n width,\n height,\n panZoom,\n minZoom,\n maxZoom,\n }, fitViewOptions);\n fitViewResolver?.resolve(true);\n /**\n * wait for the fitViewport to resolve before deleting the resolver,\n * we want to reuse the old resolver if the user calls fitView again in the mean time\n */\n set({ fitViewResolver: null });\n }\n return {\n ...getInitialState({\n nodes,\n edges,\n width,\n height,\n fitView,\n fitViewOptions,\n minZoom,\n maxZoom,\n nodeOrigin,\n nodeExtent,\n defaultNodes,\n defaultEdges,\n }),\n setNodes: (nodes) => {\n const { nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, fitViewQueued } = get();\n /*\n * setNodes() is called exclusively in response to user actions:\n * - either when the `<ReactFlow nodes>` prop is updated in the controlled ReactFlow setup,\n * - or when the user calls something like `reactFlowInstance.setNodes()` in an uncontrolled ReactFlow setup.\n *\n * When this happens, we take the note objects passed by the user and extend them with fields\n * relevant for internal React Flow operations.\n */\n const nodesInitialized = adoptUserNodes(nodes, nodeLookup, parentLookup, {\n nodeOrigin,\n nodeExtent,\n elevateNodesOnSelect,\n checkEquality: true,\n });\n if (fitViewQueued && nodesInitialized) {\n resolveFitView();\n set({ nodes, nodesInitialized, fitViewQueued: false, fitViewOptions: undefined });\n }\n else {\n set({ nodes, nodesInitialized });\n }\n },\n setEdges: (edges) => {\n const { connectionLookup, edgeLookup } = get();\n updateConnectionLookup(connectionLookup, edgeLookup, edges);\n set({ edges });\n },\n setDefaultNodesAndEdges: (nodes, edges) => {\n if (nodes) {\n const { setNodes } = get();\n setNodes(nodes);\n set({ hasDefaultNodes: true });\n }\n if (edges) {\n const { setEdges } = get();\n setEdges(edges);\n set({ hasDefaultEdges: true });\n }\n },\n /*\n * Every node gets registerd at a ResizeObserver. Whenever a node\n * changes its dimensions, this function is called to measure the\n * new dimensions and update the nodes.\n */\n updateNodeInternals: (updates) => {\n const { triggerNodeChanges, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent, debug, fitViewQueued } = get();\n const { changes, updatedInternals } = updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent);\n if (!updatedInternals) {\n return;\n }\n updateAbsolutePositions(nodeLookup, parentLookup, { nodeOrigin, nodeExtent });\n if (fitViewQueued) {\n resolveFitView();\n set({ fitViewQueued: false, fitViewOptions: undefined });\n }\n else {\n // we always want to trigger useStore calls whenever updateNodeInternals is called\n set({});\n }\n if (changes?.length > 0) {\n if (debug) {\n console.log('React Flow: trigger node changes', changes);\n }\n triggerNodeChanges?.(changes);\n }\n },\n updateNodePositions: (nodeDragItems, dragging = false) => {\n const parentExpandChildren = [];\n const changes = [];\n const { nodeLookup, triggerNodeChanges } = get();\n for (const [id, dragItem] of nodeDragItems) {\n // we are using the nodelookup to be sure to use the current expandParent and parentId value\n const node = nodeLookup.get(id);\n const expandParent = !!(node?.expandParent && node?.parentId && dragItem?.position);\n const change = {\n id,\n type: 'position',\n position: expandParent\n ? {\n x: Math.max(0, dragItem.position.x),\n y: Math.max(0, dragItem.position.y),\n }\n : dragItem.position,\n dragging,\n };\n if (expandParent && node.parentId) {\n parentExpandChildren.push({\n id,\n parentId: node.parentId,\n rect: {\n ...dragItem.internals.positionAbsolute,\n width: dragItem.measured.width ?? 0,\n height: dragItem.measured.height ?? 0,\n },\n });\n }\n changes.push(change);\n }\n if (parentExpandChildren.length > 0) {\n const { parentLookup, nodeOrigin } = get();\n const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin);\n changes.push(...parentExpandChanges);\n }\n triggerNodeChanges(changes);\n },\n triggerNodeChanges: (changes) => {\n const { onNodesChange, setNodes, nodes, hasDefaultNodes, debug } = get();\n if (changes?.length) {\n if (hasDefaultNodes) {\n const updatedNodes = applyNodeChanges(changes, nodes);\n setNodes(updatedNodes);\n }\n if (debug) {\n console.log('React Flow: trigger node changes', changes);\n }\n onNodesChange?.(changes);\n }\n },\n triggerEdgeChanges: (changes) => {\n const { onEdgesChange, setEdges, edges, hasDefaultEdges, debug } = get();\n if (changes?.length) {\n if (hasDefaultEdges) {\n const updatedEdges = applyEdgeChanges(changes, edges);\n setEdges(updatedEdges);\n }\n if (debug) {\n console.log('React Flow: trigger edge changes', changes);\n }\n onEdgesChange?.(changes);\n }\n },\n addSelectedNodes: (selectedNodeIds) => {\n const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();\n if (multiSelectionActive) {\n const nodeChanges = selectedNodeIds.map((nodeId) => createSelectionChange(nodeId, true));\n triggerNodeChanges(nodeChanges);\n return;\n }\n triggerNodeChanges(getSelectionChanges(nodeLookup, new Set([...selectedNodeIds]), true));\n triggerEdgeChanges(getSelectionChanges(edgeLookup));\n },\n addSelectedEdges: (selectedEdgeIds) => {\n const { multiSelectionActive, edgeLookup, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();\n if (multiSelectionActive) {\n const changedEdges = selectedEdgeIds.map((edgeId) => createSelectionChange(edgeId, true));\n triggerEdgeChanges(changedEdges);\n return;\n }\n triggerEdgeChanges(getSelectionChanges(edgeLookup, new Set([...selectedEdgeIds])));\n triggerNodeChanges(getSelectionChanges(nodeLookup, new Set(), true));\n },\n unselectNodesAndEdges: ({ nodes, edges } = {}) => {\n const { edges: storeEdges, nodes: storeNodes, nodeLookup, triggerNodeChanges, triggerEdgeChanges } = get();\n const nodesToUnselect = nodes ? nodes : storeNodes;\n const edgesToUnselect = edges ? edges : storeEdges;\n const nodeChanges = nodesToUnselect.map((n) => {\n const internalNode = nodeLookup.get(n.id);\n if (internalNode) {\n /*\n * we need to unselect the internal node that was selected previously before we\n * send the change to the user to prevent it to be selected while dragging the new node\n */\n internalNode.selected = false;\n }\n return createSelectionChange(n.id, false);\n });\n const edgeChanges = edgesToUnselect.map((edge) => createSelectionChange(edge.id, false));\n triggerNodeChanges(nodeChanges);\n triggerEdgeChanges(edgeChanges);\n },\n setMinZoom: (minZoom) => {\n const { panZoom, maxZoom } = get();\n panZoom?.setScaleExtent([minZoom, maxZoom]);\n set({ minZoom });\n },\n setMaxZoom: (maxZoom) => {\n const { panZoom, minZoom } = get();\n panZoom?.setScaleExtent([minZoom, maxZoom]);\n set({ maxZoom });\n },\n setTranslateExtent: (translateExtent) => {\n get().panZoom?.setTranslateExtent(translateExtent);\n set({ translateExtent });\n },\n resetSelectedElements: () => {\n const { edges, nodes, triggerNodeChanges, triggerEdgeChanges, elementsSelectable } = get();\n if (!elementsSelectable) {\n return;\n }\n const nodeChanges = nodes.reduce((res, node) => (node.selected ? [...res, createSelectionChange(node.id, false)] : res), []);\n const edgeChanges = edges.reduce((res, edge) => (edge.selected ? [...res, createSelectionChange(edge.id, false)] : res), []);\n triggerNodeChanges(nodeChanges);\n triggerEdgeChanges(edgeChanges);\n },\n setNodeExtent: (nextNodeExtent) => {\n const { nodes, nodeLookup, parentLookup, nodeOrigin, elevateNodesOnSelect, nodeExtent } = get();\n if (nextNodeExtent[0][0] === nodeExtent[0][0] &&\n nextNodeExtent[0][1] === nodeExtent[0][1] &&\n nextNodeExtent[1][0] === nodeExtent[1][0] &&\n nextNodeExtent[1][1] === nodeExtent[1][1]) {\n return;\n }\n adoptUserNodes(nodes, nodeLookup, parentLookup, {\n nodeOrigin,\n nodeExtent: nextNodeExtent,\n elevateNodesOnSelect,\n checkEquality: false,\n });\n set({ nodeExtent: nextNodeExtent });\n },\n panBy: (delta) => {\n const { transform, width, height, panZoom, translateExtent } = get();\n return panBy({ delta, panZoom, transform, translateExtent, width, height });\n },\n setCenter: async (x, y, options) => {\n const { width, height, maxZoom, panZoom } = get();\n if (!panZoom) {\n return Promise.resolve(false);\n }\n const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : maxZoom;\n await panZoom.setViewport({\n x: width / 2 - x * nextZoom,\n y: height / 2 - y * nextZoom,\n zoom: nextZoom,\n }, { duration: options?.duration, ease: options?.ease, interpolate: options?.interpolate });\n return Promise.resolve(true);\n },\n cancelConnection: () => {\n set({\n connection: { ...initialConnection },\n });\n },\n updateConnection: (connection) => {\n set({ connection });\n },\n reset: () => set({ ...getInitialState() }),\n };\n}, Object.is);\n\n/**\n * The `<ReactFlowProvider />` component is a [context provider](https://react.dev/learn/passing-data-deeply-with-context#)\n * that makes it possible to access a flow's internal state outside of the\n * [`<ReactFlow />`](/api-reference/react-flow) component. Many of the hooks we\n * provide rely on this component to work.\n * @public\n *\n * @example\n * ```tsx\n *import { ReactFlow, ReactFlowProvider, useNodes } from '@xyflow/react'\n *\n *export default function Flow() {\n * return (\n * <ReactFlowProvider>\n * <ReactFlow nodes={...} edges={...} />\n * <Sidebar />\n * </ReactFlowProvider>\n * );\n *}\n *\n *function Sidebar() {\n * // This hook will only work if the component it's used in is a child of a\n * // <ReactFlowProvider />.\n * const nodes = useNodes()\n *\n * return <aside>do something with nodes</aside>;\n *}\n *```\n *\n * @remarks If you're using a router and want your flow's state to persist across routes,\n * it's vital that you place the `<ReactFlowProvider />` component _outside_ of\n * your router. If you have multiple flows on the same page you will need to use a separate\n * `<ReactFlowProvider />` for each flow.\n */\nfunction ReactFlowProvider({ initialNodes: nodes, initialEdges: edges, defaultNodes, defaultEdges, initialWidth: width, initialHeight: height, initialMinZoom: minZoom, initialMaxZoom: maxZoom, initialFitViewOptions: fitViewOptions, fitView, nodeOrigin, nodeExtent, children, }) {\n const [store] = useState(() => createStore({\n nodes,\n edges,\n defaultNodes,\n defaultEdges,\n width,\n height,\n fitView,\n minZoom,\n maxZoom,\n fitViewOptions,\n nodeOrigin,\n nodeExtent,\n }));\n return (jsx(Provider$1, { value: store, children: jsx(BatchProvider, { children: children }) }));\n}\n\nfunction Wrapper({ children, nodes, edges, defaultNodes, defaultEdges, width, height, fitView, fitViewOptions, minZoom, maxZoom, nodeOrigin, nodeExtent, }) {\n const isWrapped = useContext(StoreContext);\n if (isWrapped) {\n /*\n * we need to wrap it with a fragment because it's not allowed for children to be a ReactNode\n * https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18051\n */\n return jsx(Fragment, { children: children });\n }\n return (jsx(ReactFlowProvider, { initialNodes: nodes, initialEdges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, initialWidth: width, initialHeight: height, fitView: fitView, initialFitViewOptions: fitViewOptions, initialMinZoom: minZoom, initialMaxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: children }));\n}\n\nconst wrapperStyle = {\n width: '100%',\n height: '100%',\n overflow: 'hidden',\n position: 'relative',\n zIndex: 0,\n};\nfunction ReactFlow({ nodes, edges, defaultNodes, defaultEdges, className, nodeTypes, edgeTypes, onNodeClick, onEdgeClick, onInit, onMove, onMoveStart, onMoveEnd, onConnect, onConnectStart, onConnectEnd, onClickConnectStart, onClickConnectEnd, onNodeMouseEnter, onNodeMouseMove, onNodeMouseLeave, onNodeContextMenu, onNodeDoubleClick, onNodeDragStart, onNodeDrag, onNodeDragStop, onNodesDelete, onEdgesDelete, onDelete, onSelectionChange, onSelectionDragStart, onSelectionDrag, onSelectionDragStop, onSelectionContextMenu, onSelectionStart, onSelectionEnd, onBeforeDelete, connectionMode, connectionLineType = ConnectionLineType.Bezier, connectionLineStyle, connectionLineComponent, connectionLineContainerStyle, deleteKeyCode = 'Backspace', selectionKeyCode = 'Shift', selectionOnDrag = false, selectionMode = SelectionMode.Full, panActivationKeyCode = 'Space', multiSelectionKeyCode = isMacOs() ? 'Meta' : 'Control', zoomActivationKeyCode = isMacOs() ? 'Meta' : 'Control', snapToGrid, snapGrid, onlyRenderVisibleElements = false, selectNodesOnDrag, nodesDraggable, autoPanOnNodeFocus, nodesConnectable, nodesFocusable, nodeOrigin = defaultNodeOrigin, edgesFocusable, edgesReconnectable, elementsSelectable = true, defaultViewport: defaultViewport$1 = defaultViewport, minZoom = 0.5, maxZoom = 2, translateExtent = infiniteExtent, preventScrolling = true, nodeExtent, defaultMarkerColor = '#b1b1b7', zoomOnScroll = true, zoomOnPinch = true, panOnScroll = false, panOnScrollSpeed = 0.5, panOnScrollMode = PanOnScrollMode.Free, zoomOnDoubleClick = true, panOnDrag = true, onPaneClick, onPaneMouseEnter, onPaneMouseMove, onPaneMouseLeave, onPaneScroll, onPaneContextMenu, paneClickDistance = 1, nodeClickDistance = 0, children, onReconnect, onReconnectStart, onReconnectEnd, onEdgeContextMenu, onEdgeDoubleClick, onEdgeMouseEnter, onEdgeMouseMove, onEdgeMouseLeave, reconnectRadius = 10, onNodesChange, onEdgesChange, noDragClassName = 'nodrag', noWheelClassName = 'nowheel', noPanClassName = 'nopan', fitView, fitViewOptions, connectOnClick, attributionPosition, proOptions, defaultEdgeOptions, elevateNodesOnSelect, elevateEdgesOnSelect, disableKeyboardA11y = false, autoPanOnConnect, autoPanOnNodeDrag, autoPanSpeed, connectionRadius, isValidConnection, onError, style, id, nodeDragThreshold, connectionDragThreshold, viewport, onViewportChange, width, height, colorMode = 'light', debug, onScroll, ariaLabelConfig, ...rest }, ref) {\n const rfId = id || '1';\n const colorModeClassName = useColorModeClass(colorMode);\n // Undo scroll events, preventing viewport from shifting when nodes outside of it are focused\n const wrapperOnScroll = useCallback((e) => {\n e.currentTarget.scrollTo({ top: 0, left: 0, behavior: 'instant' });\n onScroll?.(e);\n }, [onScroll]);\n return (jsx(\"div\", { \"data-testid\": \"rf__wrapper\", ...rest, onScroll: wrapperOnScroll, style: { ...style, ...wrapperStyle }, ref: ref, className: cc(['react-flow', className, colorModeClassName]), id: id, role: \"application\", children: jsxs(Wrapper, { nodes: nodes, edges: edges, width: width, height: height, fitView: fitView, fitViewOptions: fitViewOptions, minZoom: minZoom, maxZoom: maxZoom, nodeOrigin: nodeOrigin, nodeExtent: nodeExtent, children: [jsx(GraphView, { onInit: onInit, onNodeClick: onNodeClick, onEdgeClick: onEdgeClick, onNodeMouseEnter: onNodeMouseEnter, onNodeMouseMove: onNodeMouseMove, onNodeMouseLeave: onNodeMouseLeave, onNodeContextMenu: onNodeContextMenu, onNodeDoubleClick: onNodeDoubleClick, nodeTypes: nodeTypes, edgeTypes: edgeTypes, connectionLineType: connectionLineType, connectionLineStyle: connectionLineStyle, connectionLineComponent: connectionLineComponent, connectionLineContainerStyle: connectionLineContainerStyle, selectionKeyCode: selectionKeyCode, selectionOnDrag: selectionOnDrag, selectionMode: selectionMode, deleteKeyCode: deleteKeyCode, multiSelectionKeyCode: multiSelectionKeyCode, panActivationKeyCode: panActivationKeyCode, zoomActivationKeyCode: zoomActivationKeyCode, onlyRenderVisibleElements: onlyRenderVisibleElements, defaultViewport: defaultViewport$1, translateExtent: translateExtent, minZoom: minZoom, maxZoom: maxZoom, preventScrolling: preventScrolling, zoomOnScroll: zoomOnScroll, zoomOnPinch: zoomOnPinch, zoomOnDoubleClick: zoomOnDoubleClick, panOnScroll: panOnScroll, panOnScrollSpeed: panOnScrollSpeed, panOnScrollMode: panOnScrollMode, panOnDrag: panOnDrag, onPaneClick: onPaneClick, onPaneMouseEnter: onPaneMouseEnter, onPaneMouseMove: onPaneMouseMove, onPaneMouseLeave: onPaneMouseLeave, onPaneScroll: onPaneScroll, onPaneContextMenu: onPaneContextMenu, paneClickDistance: paneClickDistance, nodeClickDistance: nodeClickDistance, onSelectionContextMenu: onSelectionContextMenu, onSelectionStart: onSelectionStart, onSelectionEnd: onSelectionEnd, onReconnect: onReconnect, onReconnectStart: onReconnectStart, onReconnectEnd: onReconnectEnd, onEdgeContextMenu: onEdgeContextMenu, onEdgeDoubleClick: onEdgeDoubleClick, onEdgeMouseEnter: onEdgeMouseEnter, onEdgeMouseMove: onEdgeMouseMove, onEdgeMouseLeave: onEdgeMouseLeave, reconnectRadius: reconnectRadius, defaultMarkerColor: defaultMarkerColor, noDragClassName: noDragClassName, noWheelClassName: noWheelClassName, noPanClassName: noPanClassName, rfId: rfId, disableKeyboardA11y: disableKeyboardA11y, nodeExtent: nodeExtent, viewport: viewport, onViewportChange: onViewportChange }), jsx(StoreUpdater, { nodes: nodes, edges: edges, defaultNodes: defaultNodes, defaultEdges: defaultEdges, onConnect: onConnect, onConnectStart: onConnectStart, onConnectEnd: onConnectEnd, onClickConnectStart: onClickConnectStart, onClickConnectEnd: onClickConnectEnd, nodesDraggable: nodesDraggable, autoPanOnNodeFocus: autoPanOnNodeFocus, nodesConnectable: nodesConnectable, nodesFocusable: nodesFocusable, edgesFocusable: edgesFocusable, edgesReconnectable: edgesReconnectable, elementsSelectable: elementsSelectable, elevateNodesOnSelect: elevateNodesOnSelect, elevateEdgesOnSelect: elevateEdgesOnSelect, minZoom: minZoom, maxZoom: maxZoom, nodeExtent: nodeExtent, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, snapToGrid: snapToGrid, snapGrid: snapGrid, connectionMode: connectionMode, translateExtent: translateExtent, connectOnClick: connectOnClick, defaultEdgeOptions: defaultEdgeOptions, fitView: fitView, fitViewOptions: fitViewOptions, onNodesDelete: onNodesDelete, onEdgesDelete: onEdgesDelete, onDelete: onDelete, onNodeDragStart: onNodeDragStart, onNodeDrag: onNodeDrag, onNodeDragStop: onNodeDragStop, onSelectionDrag: onSelectionDrag, onSelectionDragStart: onSelectionDragStart, onSelectionDragStop: onSelectionDragStop, onMove: onMove, onMoveStart: onMoveStart, onMoveEnd: onMoveEnd, noPanClassName: noPanClassName, nodeOrigin: nodeOrigin, rfId: rfId, autoPanOnConnect: autoPanOnConnect, autoPanOnNodeDrag: autoPanOnNodeDrag, autoPanSpeed: autoPanSpeed, onError: onError, connectionRadius: connectionRadius, isValidConnection: isValidConnection, selectNodesOnDrag: selectNodesOnDrag, nodeDragThreshold: nodeDragThreshold, connectionDragThreshold: connectionDragThreshold, onBeforeDelete: onBeforeDelete, debug: debug, ariaLabelConfig: ariaLabelConfig }), jsx(SelectionListener, { onSelectionChange: onSelectionChange }), children, jsx(Attribution, { proOptions: proOptions, position: attributionPosition }), jsx(A11yDescriptions, { rfId: rfId, disableKeyboardA11y: disableKeyboardA11y })] }) }));\n}\n/**\n * The `<ReactFlow />` component is the heart of your React Flow application.\n * It renders your nodes and edges and handles user interaction\n *\n * @public\n *\n * @example\n * ```tsx\n *import { ReactFlow } from '@xyflow/react'\n *\n *export default function Flow() {\n * return (<ReactFlow\n * nodes={...}\n * edges={...}\n * onNodesChange={...}\n * ...\n * />);\n *}\n *```\n */\nvar index = fixedForwardRef(ReactFlow);\n\nconst selector$6 = (s) => s.domNode?.querySelector('.react-flow__edgelabel-renderer');\n/**\n * Edges are SVG-based. If you want to render more complex labels you can use the\n * `<EdgeLabelRenderer />` component to access a div based renderer. This component\n * is a portal that renders the label in a `<div />` that is positioned on top of\n * the edges. You can see an example usage of the component in the\n * [edge label renderer example](/examples/edges/edge-label-renderer).\n * @public\n *\n * @example\n * ```jsx\n * import React from 'react';\n * import { getBezierPath, EdgeLabelRenderer, BaseEdge } from '@xyflow/react';\n *\n * export function CustomEdge({ id, data, ...props }) {\n * const [edgePath, labelX, labelY] = getBezierPath(props);\n *\n * return (\n * <>\n * <BaseEdge id={id} path={edgePath} />\n * <EdgeLabelRenderer>\n * <div\n * style={{\n * position: 'absolute',\n * transform: `translate(-50%, -50%) translate(${labelX}px,${labelY}px)`,\n * background: '#ffcc00',\n * padding: 10,\n * }}\n * className=\"nodrag nopan\"\n * >\n * {data.label}\n * </div>\n * </EdgeLabelRenderer>\n * </>\n * );\n * };\n * ```\n *\n * @remarks The `<EdgeLabelRenderer />` has no pointer events by default. If you want to\n * add mouse interactions you need to set the style `pointerEvents: all` and add\n * the `nopan` class on the label or the element you want to interact with.\n */\nfunction EdgeLabelRenderer({ children }) {\n const edgeLabelRenderer = useStore(selector$6);\n if (!edgeLabelRenderer) {\n return null;\n }\n return createPortal(children, edgeLabelRenderer);\n}\n\nconst selector$5 = (s) => s.domNode?.querySelector('.react-flow__viewport-portal');\n/**\n * The `<ViewportPortal />` component can be used to add components to the same viewport\n * of the flow where nodes and edges are rendered. This is useful when you want to render\n * your own components that are adhere to the same coordinate system as the nodes & edges\n * and are also affected by zooming and panning\n * @public\n * @example\n *\n * ```jsx\n *import React from 'react';\n *import { ViewportPortal } from '@xyflow/react';\n *\n *export default function () {\n * return (\n * <ViewportPortal>\n * <div\n * style={{ transform: 'translate(100px, 100px)', position: 'absolute' }}\n * >\n * This div is positioned at [100, 100] on the flow.\n * </div>\n * </ViewportPortal>\n * );\n *}\n *```\n */\nfunction ViewportPortal({ children }) {\n const viewPortalDiv = useStore(selector$5);\n if (!viewPortalDiv) {\n return null;\n }\n return createPortal(children, viewPortalDiv);\n}\n\n/**\n * When you programmatically add or remove handles to a node or update a node's\n * handle position, you need to let React Flow know about it using this hook. This\n * will update the internal dimensions of the node and properly reposition handles\n * on the canvas if necessary.\n *\n * @public\n * @returns Use this function to tell React Flow to update the internal state of one or more nodes\n * that you have changed programmatically.\n *\n * @example\n * ```jsx\n *import { useCallback, useState } from 'react';\n *import { Handle, useUpdateNodeInternals } from '@xyflow/react';\n *\n *export default function RandomHandleNode({ id }) {\n * const updateNodeInternals = useUpdateNodeInternals();\n * const [handleCount, setHandleCount] = useState(0);\n * const randomizeHandleCount = useCallback(() => {\n * setHandleCount(Math.floor(Math.random() * 10));\n * updateNodeInternals(id);\n * }, [id, updateNodeInternals]);\n *\n * return (\n * <>\n * {Array.from({ length: handleCount }).map((_, index) => (\n * <Handle\n * key={index}\n * type=\"target\"\n * position=\"left\"\n * id={`handle-${index}`}\n * />\n * ))}\n *\n * <div>\n * <button onClick={randomizeHandleCount}>Randomize handle count</button>\n * <p>There are {handleCount} handles on this node.</p>\n * </div>\n * </>\n * );\n *}\n *```\n * @remarks This hook can only be used in a component that is a child of a\n *{@link ReactFlowProvider} or a {@link ReactFlow} component.\n */\nfunction useUpdateNodeInternals() {\n const store = useStoreApi();\n return useCallback((id) => {\n const { domNode, updateNodeInternals } = store.getState();\n const updateIds = Array.isArray(id) ? id : [id];\n const updates = new Map();\n updateIds.forEach((updateId) => {\n const nodeElement = domNode?.querySelector(`.react-flow__node[data-id=\"${updateId}\"]`);\n if (nodeElement) {\n updates.set(updateId, { id: updateId, nodeElement, force: true });\n }\n });\n requestAnimationFrame(() => updateNodeInternals(updates, { triggerFitView: false }));\n }, []);\n}\n\nconst nodesSelector = (state) => state.nodes;\n/**\n * This hook returns an array of the current nodes. Components that use this hook\n * will re-render **whenever any node changes**, including when a node is selected\n * or moved.\n *\n * @public\n * @returns An array of all nodes currently in the flow.\n *\n * @example\n * ```jsx\n *import { useNodes } from '@xyflow/react';\n *\n *export default function() {\n * const nodes = useNodes();\n *\n * return <div>There are currently {nodes.length} nodes!</div>;\n *}\n *```\n */\nfunction useNodes() {\n const nodes = useStore(nodesSelector, shallow);\n return nodes;\n}\n\nconst edgesSelector = (state) => state.edges;\n/**\n * This hook returns an array of the current edges. Components that use this hook\n * will re-render **whenever any edge changes**.\n *\n * @public\n * @returns An array of all edges currently in the flow.\n *\n * @example\n * ```tsx\n *import { useEdges } from '@xyflow/react';\n *\n *export default function () {\n * const edges = useEdges();\n *\n * return <div>There are currently {edges.length} edges!</div>;\n *}\n *```\n */\nfunction useEdges() {\n const edges = useStore(edgesSelector, shallow);\n return edges;\n}\n\nconst viewportSelector = (state) => ({\n x: state.transform[0],\n y: state.transform[1],\n zoom: state.transform[2],\n});\n/**\n * The `useViewport` hook is a convenient way to read the current state of the\n * {@link Viewport} in a component. Components that use this hook\n * will re-render **whenever the viewport changes**.\n *\n * @public\n * @returns The current viewport.\n *\n * @example\n *\n *```jsx\n *import { useViewport } from '@xyflow/react';\n *\n *export default function ViewportDisplay() {\n * const { x, y, zoom } = useViewport();\n *\n * return (\n * <div>\n * <p>\n * The viewport is currently at ({x}, {y}) and zoomed to {zoom}.\n * </p>\n * </div>\n * );\n *}\n *```\n *\n * @remarks This hook can only be used in a component that is a child of a\n *{@link ReactFlowProvider} or a {@link ReactFlow} component.\n */\nfunction useViewport() {\n const viewport = useStore(viewportSelector, shallow);\n return viewport;\n}\n\n/**\n * This hook makes it easy to prototype a controlled flow where you manage the\n * state of nodes and edges outside the `ReactFlowInstance`. You can think of it\n * like React's `useState` hook with an additional helper callback.\n *\n * @public\n * @returns\n * - `nodes`: The current array of nodes. You might pass this directly to the `nodes` prop of your\n * `<ReactFlow />` component, or you may want to manipulate it first to perform some layouting,\n * for example.\n * - `setNodes`: A function that you can use to update the nodes. You can pass it a new array of\n * nodes or a callback that receives the current array of nodes and returns a new array of nodes.\n * This is the same as the second element of the tuple returned by React's `useState` hook.\n * - `onNodesChange`: A handy callback that can take an array of `NodeChanges` and update the nodes\n * state accordingly. You'll typically pass this directly to the `onNodesChange` prop of your\n * `<ReactFlow />` component.\n * @example\n *\n *```tsx\n *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react';\n *\n *const initialNodes = [];\n *const initialEdges = [];\n *\n *export default function () {\n * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);\n * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);\n *\n * return (\n * <ReactFlow\n * nodes={nodes}\n * edges={edges}\n * onNodesChange={onNodesChange}\n * onEdgesChange={onEdgesChange}\n * />\n * );\n *}\n *```\n *\n * @remarks This hook was created to make prototyping easier and our documentation\n * examples clearer. Although it is OK to use this hook in production, in\n * practice you may want to use a more sophisticated state management solution\n * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.\n *\n */\nfunction useNodesState(initialNodes) {\n const [nodes, setNodes] = useState(initialNodes);\n const onNodesChange = useCallback((changes) => setNodes((nds) => applyNodeChanges(changes, nds)), []);\n return [nodes, setNodes, onNodesChange];\n}\n/**\n * This hook makes it easy to prototype a controlled flow where you manage the\n * state of nodes and edges outside the `ReactFlowInstance`. You can think of it\n * like React's `useState` hook with an additional helper callback.\n *\n * @public\n * @returns\n * - `edges`: The current array of edges. You might pass this directly to the `edges` prop of your\n * `<ReactFlow />` component, or you may want to manipulate it first to perform some layouting,\n * for example.\n *\n * - `setEdges`: A function that you can use to update the edges. You can pass it a new array of\n * edges or a callback that receives the current array of edges and returns a new array of edges.\n * This is the same as the second element of the tuple returned by React's `useState` hook.\n *\n * - `onEdgesChange`: A handy callback that can take an array of `EdgeChanges` and update the edges\n * state accordingly. You'll typically pass this directly to the `onEdgesChange` prop of your\n * `<ReactFlow />` component.\n * @example\n *\n *```tsx\n *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react';\n *\n *const initialNodes = [];\n *const initialEdges = [];\n *\n *export default function () {\n * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);\n * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);\n *\n * return (\n * <ReactFlow\n * nodes={nodes}\n * edges={edges}\n * onNodesChange={onNodesChange}\n * onEdgesChange={onEdgesChange}\n * />\n * );\n *}\n *```\n *\n * @remarks This hook was created to make prototyping easier and our documentation\n * examples clearer. Although it is OK to use this hook in production, in\n * practice you may want to use a more sophisticated state management solution\n * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.\n *\n */\nfunction useEdgesState(initialEdges) {\n const [edges, setEdges] = useState(initialEdges);\n const onEdgesChange = useCallback((changes) => setEdges((eds) => applyEdgeChanges(changes, eds)), []);\n return [edges, setEdges, onEdgesChange];\n}\n\n/**\n * The `useOnViewportChange` hook lets you listen for changes to the viewport such\n * as panning and zooming. You can provide a callback for each phase of a viewport\n * change: `onStart`, `onChange`, and `onEnd`.\n *\n * @public\n * @example\n * ```jsx\n *import { useCallback } from 'react';\n *import { useOnViewportChange } from '@xyflow/react';\n *\n *function ViewportChangeLogger() {\n * useOnViewportChange({\n * onStart: (viewport: Viewport) => console.log('start', viewport),\n * onChange: (viewport: Viewport) => console.log('change', viewport),\n * onEnd: (viewport: Viewport) => console.log('end', viewport),\n * });\n *\n * return null;\n *}\n *```\n */\nfunction useOnViewportChange({ onStart, onChange, onEnd }) {\n const store = useStoreApi();\n useEffect(() => {\n store.setState({ onViewportChangeStart: onStart });\n }, [onStart]);\n useEffect(() => {\n store.setState({ onViewportChange: onChange });\n }, [onChange]);\n useEffect(() => {\n store.setState({ onViewportChangeEnd: onEnd });\n }, [onEnd]);\n}\n\n/**\n * This hook lets you listen for changes to both node and edge selection. As the\n *name implies, the callback you provide will be called whenever the selection of\n *_either_ nodes or edges changes.\n *\n * @public\n * @example\n * ```jsx\n *import { useState } from 'react';\n *import { ReactFlow, useOnSelectionChange } from '@xyflow/react';\n *\n *function SelectionDisplay() {\n * const [selectedNodes, setSelectedNodes] = useState([]);\n * const [selectedEdges, setSelectedEdges] = useState([]);\n *\n * // the passed handler has to be memoized, otherwise the hook will not work correctly\n * const onChange = useCallback(({ nodes, edges }) => {\n * setSelectedNodes(nodes.map((node) => node.id));\n * setSelectedEdges(edges.map((edge) => edge.id));\n * }, []);\n *\n * useOnSelectionChange({\n * onChange,\n * });\n *\n * return (\n * <div>\n * <p>Selected nodes: {selectedNodes.join(', ')}</p>\n * <p>Selected edges: {selectedEdges.join(', ')}</p>\n * </div>\n * );\n *}\n *```\n *\n * @remarks You need to memoize the passed `onChange` handler, otherwise the hook will not work correctly.\n */\nfunction useOnSelectionChange({ onChange, }) {\n const store = useStoreApi();\n useEffect(() => {\n const nextOnSelectionChangeHandlers = [...store.getState().onSelectionChangeHandlers, onChange];\n store.setState({ onSelectionChangeHandlers: nextOnSelectionChangeHandlers });\n return () => {\n const nextHandlers = store.getState().onSelectionChangeHandlers.filter((fn) => fn !== onChange);\n store.setState({ onSelectionChangeHandlers: nextHandlers });\n };\n }, [onChange]);\n}\n\nconst selector$4 = (options) => (s) => {\n if (!options.includeHiddenNodes) {\n return s.nodesInitialized;\n }\n if (s.nodeLookup.size === 0) {\n return false;\n }\n for (const [, { internals }] of s.nodeLookup) {\n if (internals.handleBounds === undefined || !nodeHasDimensions(internals.userNode)) {\n return false;\n }\n }\n return true;\n};\n/**\n * This hook tells you whether all the nodes in a flow have been measured and given\n *a width and height. When you add a node to the flow, this hook will return\n *`false` and then `true` again once the node has been measured.\n *\n * @public\n * @returns Whether or not the nodes have been initialized by the `<ReactFlow />` component and\n * given a width and height.\n *\n * @example\n * ```jsx\n *import { useReactFlow, useNodesInitialized } from '@xyflow/react';\n *import { useEffect, useState } from 'react';\n *\n *const options = {\n * includeHiddenNodes: false,\n *};\n *\n *export default function useLayout() {\n * const { getNodes } = useReactFlow();\n * const nodesInitialized = useNodesInitialized(options);\n * const [layoutedNodes, setLayoutedNodes] = useState(getNodes());\n *\n * useEffect(() => {\n * if (nodesInitialized) {\n * setLayoutedNodes(yourLayoutingFunction(getNodes()));\n * }\n * }, [nodesInitialized]);\n *\n * return layoutedNodes;\n *}\n *```\n */\nfunction useNodesInitialized(options = {\n includeHiddenNodes: false,\n}) {\n const initialized = useStore(selector$4(options));\n return initialized;\n}\n\n/**\n * Hook to check if a <Handle /> is connected to another <Handle /> and get the connections.\n *\n * @public\n * @deprecated Use `useNodeConnections` instead.\n * @returns An array with handle connections.\n */\nfunction useHandleConnections({ type, id, nodeId, onConnect, onDisconnect, }) {\n console.warn('[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://reactflow.dev/api-reference/hooks/useNodeConnections');\n const _nodeId = useNodeId();\n const currentNodeId = nodeId ?? _nodeId;\n const prevConnections = useRef(null);\n const connections = useStore((state) => state.connectionLookup.get(`${currentNodeId}-${type}${id ? `-${id}` : ''}`), areConnectionMapsEqual);\n useEffect(() => {\n // @todo dicuss if onConnect/onDisconnect should be called when the component mounts/unmounts\n if (prevConnections.current && prevConnections.current !== connections) {\n const _connections = connections ?? new Map();\n handleConnectionChange(prevConnections.current, _connections, onDisconnect);\n handleConnectionChange(_connections, prevConnections.current, onConnect);\n }\n prevConnections.current = connections ?? new Map();\n }, [connections, onConnect, onDisconnect]);\n return useMemo(() => Array.from(connections?.values() ?? []), [connections]);\n}\n\nconst error014 = errorMessages['error014']();\n/**\n * This hook returns an array of connections on a specific node, handle type ('source', 'target') or handle ID.\n *\n * @public\n * @returns An array with connections.\n *\n * @example\n * ```jsx\n *import { useNodeConnections } from '@xyflow/react';\n *\n *export default function () {\n * const connections = useNodeConnections({\n * handleType: 'target',\n * handleId: 'my-handle',\n * });\n *\n * return (\n * <div>There are currently {connections.length} incoming connections!</div>\n * );\n *}\n *```\n */\nfunction useNodeConnections({ id, handleType, handleId, onConnect, onDisconnect, } = {}) {\n const nodeId = useNodeId();\n const currentNodeId = id ?? nodeId;\n if (!currentNodeId) {\n throw new Error(error014);\n }\n const prevConnections = useRef(null);\n const connections = useStore((state) => state.connectionLookup.get(`${currentNodeId}${handleType ? (handleId ? `-${handleType}-${handleId}` : `-${handleType}`) : ''}`), areConnectionMapsEqual);\n useEffect(() => {\n // @todo discuss if onConnect/onDisconnect should be called when the component mounts/unmounts\n if (prevConnections.current && prevConnections.current !== connections) {\n const _connections = connections ?? new Map();\n handleConnectionChange(prevConnections.current, _connections, onDisconnect);\n handleConnectionChange(_connections, prevConnections.current, onConnect);\n }\n prevConnections.current = connections ?? new Map();\n }, [connections, onConnect, onDisconnect]);\n return useMemo(() => Array.from(connections?.values() ?? []), [connections]);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction useNodesData(nodeIds) {\n const nodesData = useStore(useCallback((s) => {\n const data = [];\n const isArrayOfIds = Array.isArray(nodeIds);\n const _nodeIds = isArrayOfIds ? nodeIds : [nodeIds];\n for (const nodeId of _nodeIds) {\n const node = s.nodeLookup.get(nodeId);\n if (node) {\n data.push({\n id: node.id,\n type: node.type,\n data: node.data,\n });\n }\n }\n return isArrayOfIds ? data : data[0] ?? null;\n }, [nodeIds]), shallowNodeData);\n return nodesData;\n}\n\n/**\n * This hook returns the internal representation of a specific node.\n * Components that use this hook will re-render **whenever the node changes**,\n * including when a node is selected or moved.\n *\n * @public\n * @param id - The ID of a node you want to observe.\n * @returns The `InternalNode` object for the node with the given ID.\n *\n * @example\n * ```tsx\n *import { useInternalNode } from '@xyflow/react';\n *\n *export default function () {\n * const internalNode = useInternalNode('node-1');\n * const absolutePosition = internalNode.internals.positionAbsolute;\n *\n * return (\n * <div>\n * The absolute position of the node is at:\n * <p>x: {absolutePosition.x}</p>\n * <p>y: {absolutePosition.y}</p>\n * </div>\n * );\n *}\n *```\n */\nfunction useInternalNode(id) {\n const node = useStore(useCallback((s) => s.nodeLookup.get(id), [id]), shallow);\n return node;\n}\n\nfunction LinePattern({ dimensions, lineWidth, variant, className }) {\n return (jsx(\"path\", { strokeWidth: lineWidth, d: `M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}`, className: cc(['react-flow__background-pattern', variant, className]) }));\n}\nfunction DotPattern({ radius, className }) {\n return (jsx(\"circle\", { cx: radius, cy: radius, r: radius, className: cc(['react-flow__background-pattern', 'dots', className]) }));\n}\n\n/**\n * The three variants are exported as an enum for convenience. You can either import\n * the enum and use it like `BackgroundVariant.Lines` or you can use the raw string\n * value directly.\n * @public\n */\nvar BackgroundVariant;\n(function (BackgroundVariant) {\n BackgroundVariant[\"Lines\"] = \"lines\";\n BackgroundVariant[\"Dots\"] = \"dots\";\n BackgroundVariant[\"Cross\"] = \"cross\";\n})(BackgroundVariant || (BackgroundVariant = {}));\n\nconst defaultSize = {\n [BackgroundVariant.Dots]: 1,\n [BackgroundVariant.Lines]: 1,\n [BackgroundVariant.Cross]: 6,\n};\nconst selector$3 = (s) => ({ transform: s.transform, patternId: `pattern-${s.rfId}` });\nfunction BackgroundComponent({ id, variant = BackgroundVariant.Dots, \n// only used for dots and cross\ngap = 20, \n// only used for lines and cross\nsize, lineWidth = 1, offset = 0, color, bgColor, style, className, patternClassName, }) {\n const ref = useRef(null);\n const { transform, patternId } = useStore(selector$3, shallow);\n const patternSize = size || defaultSize[variant];\n const isDots = variant === BackgroundVariant.Dots;\n const isCross = variant === BackgroundVariant.Cross;\n const gapXY = Array.isArray(gap) ? gap : [gap, gap];\n const scaledGap = [gapXY[0] * transform[2] || 1, gapXY[1] * transform[2] || 1];\n const scaledSize = patternSize * transform[2];\n const offsetXY = Array.isArray(offset) ? offset : [offset, offset];\n const patternDimensions = isCross ? [scaledSize, scaledSize] : scaledGap;\n const scaledOffset = [\n offsetXY[0] * transform[2] || 1 + patternDimensions[0] / 2,\n offsetXY[1] * transform[2] || 1 + patternDimensions[1] / 2,\n ];\n const _patternId = `${patternId}${id ? id : ''}`;\n return (jsxs(\"svg\", { className: cc(['react-flow__background', className]), style: {\n ...style,\n ...containerStyle,\n '--xy-background-color-props': bgColor,\n '--xy-background-pattern-color-props': color,\n }, ref: ref, \"data-testid\": \"rf__background\", children: [jsx(\"pattern\", { id: _patternId, x: transform[0] % scaledGap[0], y: transform[1] % scaledGap[1], width: scaledGap[0], height: scaledGap[1], patternUnits: \"userSpaceOnUse\", patternTransform: `translate(-${scaledOffset[0]},-${scaledOffset[1]})`, children: isDots ? (jsx(DotPattern, { radius: scaledSize / 2, className: patternClassName })) : (jsx(LinePattern, { dimensions: patternDimensions, lineWidth: lineWidth, variant: variant, className: patternClassName })) }), jsx(\"rect\", { x: \"0\", y: \"0\", width: \"100%\", height: \"100%\", fill: `url(#${_patternId})` })] }));\n}\nBackgroundComponent.displayName = 'Background';\n/**\n * The `<Background />` component makes it convenient to render different types of backgrounds common in node-based UIs. It comes with three variants: lines, dots and cross.\n *\n * @example\n *\n * A simple example of how to use the Background component.\n *\n * ```tsx\n * import { useState } from 'react';\n * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react';\n *\n * export default function Flow() {\n * return (\n * <ReactFlow defaultNodes={[...]} defaultEdges={[...]}>\n * <Background color=\"#ccc\" variant={BackgroundVariant.Dots} />\n * </ReactFlow>\n * );\n * }\n * ```\n *\n * @example\n *\n * In this example you can see how to combine multiple backgrounds\n *\n * ```tsx\n * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react';\n * import '@xyflow/react/dist/style.css';\n *\n * export default function Flow() {\n * return (\n * <ReactFlow defaultNodes={[...]} defaultEdges={[...]}>\n * <Background\n * id=\"1\"\n * gap={10}\n * color=\"#f1f1f1\"\n * variant={BackgroundVariant.Lines}\n * />\n * <Background\n * id=\"2\"\n * gap={100}\n * color=\"#ccc\"\n * variant={BackgroundVariant.Lines}\n * />\n * </ReactFlow>\n * );\n * }\n * ```\n *\n * @remarks\n *\n * When combining multiple <Background /> components it’s important to give each of them a unique id prop!\n *\n */\nconst Background = memo(BackgroundComponent);\n\nfunction PlusIcon() {\n return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 32 32\", children: jsx(\"path\", { d: \"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z\" }) }));\n}\n\nfunction MinusIcon() {\n return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 32 5\", children: jsx(\"path\", { d: \"M0 0h32v4.2H0z\" }) }));\n}\n\nfunction FitViewIcon() {\n return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 32 30\", children: jsx(\"path\", { d: \"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z\" }) }));\n}\n\nfunction LockIcon() {\n return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 25 32\", children: jsx(\"path\", { d: \"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z\" }) }));\n}\n\nfunction UnlockIcon() {\n return (jsx(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 25 32\", children: jsx(\"path\", { d: \"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z\" }) }));\n}\n\n/**\n * You can add buttons to the control panel by using the `<ControlButton />` component\n * and pass it as a child to the [`<Controls />`](/api-reference/components/controls) component.\n *\n * @public\n * @example\n *```jsx\n *import { MagicWand } from '@radix-ui/react-icons'\n *import { ReactFlow, Controls, ControlButton } from '@xyflow/react'\n *\n *export default function Flow() {\n * return (\n * <ReactFlow nodes={[...]} edges={[...]}>\n * <Controls>\n * <ControlButton onClick={() => alert('Something magical just happened. ✨')}>\n * <MagicWand />\n * </ControlButton>\n * </Controls>\n * </ReactFlow>\n * )\n *}\n *```\n */\nfunction ControlButton({ children, className, ...rest }) {\n return (jsx(\"button\", { type: \"button\", className: cc(['react-flow__controls-button', className]), ...rest, children: children }));\n}\n\nconst selector$2 = (s) => ({\n isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,\n minZoomReached: s.transform[2] <= s.minZoom,\n maxZoomReached: s.transform[2] >= s.maxZoom,\n ariaLabelConfig: s.ariaLabelConfig,\n});\nfunction ControlsComponent({ style, showZoom = true, showFitView = true, showInteractive = true, fitViewOptions, onZoomIn, onZoomOut, onFitView, onInteractiveChange, className, children, position = 'bottom-left', orientation = 'vertical', 'aria-label': ariaLabel, }) {\n const store = useStoreApi();\n const { isInteractive, minZoomReached, maxZoomReached, ariaLabelConfig } = useStore(selector$2, shallow);\n const { zoomIn, zoomOut, fitView } = useReactFlow();\n const onZoomInHandler = () => {\n zoomIn();\n onZoomIn?.();\n };\n const onZoomOutHandler = () => {\n zoomOut();\n onZoomOut?.();\n };\n const onFitViewHandler = () => {\n fitView(fitViewOptions);\n onFitView?.();\n };\n const onToggleInteractivity = () => {\n store.setState({\n nodesDraggable: !isInteractive,\n nodesConnectable: !isInteractive,\n elementsSelectable: !isInteractive,\n });\n onInteractiveChange?.(!isInteractive);\n };\n const orientationClass = orientation === 'horizontal' ? 'horizontal' : 'vertical';\n return (jsxs(Panel, { className: cc(['react-flow__controls', orientationClass, className]), position: position, style: style, \"data-testid\": \"rf__controls\", \"aria-label\": ariaLabel ?? ariaLabelConfig['controls.ariaLabel'], children: [showZoom && (jsxs(Fragment, { children: [jsx(ControlButton, { onClick: onZoomInHandler, className: \"react-flow__controls-zoomin\", title: ariaLabelConfig['controls.zoomIn.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.zoomIn.ariaLabel'], disabled: maxZoomReached, children: jsx(PlusIcon, {}) }), jsx(ControlButton, { onClick: onZoomOutHandler, className: \"react-flow__controls-zoomout\", title: ariaLabelConfig['controls.zoomOut.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.zoomOut.ariaLabel'], disabled: minZoomReached, children: jsx(MinusIcon, {}) })] })), showFitView && (jsx(ControlButton, { className: \"react-flow__controls-fitview\", onClick: onFitViewHandler, title: ariaLabelConfig['controls.fitView.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.fitView.ariaLabel'], children: jsx(FitViewIcon, {}) })), showInteractive && (jsx(ControlButton, { className: \"react-flow__controls-interactive\", onClick: onToggleInteractivity, title: ariaLabelConfig['controls.interactive.ariaLabel'], \"aria-label\": ariaLabelConfig['controls.interactive.ariaLabel'], children: isInteractive ? jsx(UnlockIcon, {}) : jsx(LockIcon, {}) })), children] }));\n}\nControlsComponent.displayName = 'Controls';\n/**\n * The `<Controls />` component renders a small panel that contains convenient\n * buttons to zoom in, zoom out, fit the view, and lock the viewport.\n *\n * @public\n * @example\n *```tsx\n *import { ReactFlow, Controls } from '@xyflow/react'\n *\n *export default function Flow() {\n * return (\n * <ReactFlow nodes={[...]} edges={[...]}>\n * <Controls />\n * </ReactFlow>\n * )\n *}\n *```\n *\n * @remarks To extend or customise the controls, you can use the [`<ControlButton />`](/api-reference/components/control-button) component\n *\n */\nconst Controls = memo(ControlsComponent);\n\nfunction MiniMapNodeComponent({ id, x, y, width, height, style, color, strokeColor, strokeWidth, className, borderRadius, shapeRendering, selected, onClick, }) {\n const { background, backgroundColor } = style || {};\n const fill = (color || background || backgroundColor);\n return (jsx(\"rect\", { className: cc(['react-flow__minimap-node', { selected }, className]), x: x, y: y, rx: borderRadius, ry: borderRadius, width: width, height: height, style: {\n fill,\n stroke: strokeColor,\n strokeWidth,\n }, shapeRendering: shapeRendering, onClick: onClick ? (event) => onClick(event, id) : undefined }));\n}\nconst MiniMapNode = memo(MiniMapNodeComponent);\n\nconst selectorNodeIds = (s) => s.nodes.map((node) => node.id);\nconst getAttrFunction = (func) => func instanceof Function ? func : () => func;\nfunction MiniMapNodes({ nodeStrokeColor, nodeColor, nodeClassName = '', nodeBorderRadius = 5, nodeStrokeWidth, \n/*\n * We need to rename the prop to be `CapitalCase` so that JSX will render it as\n * a component properly.\n */\nnodeComponent: NodeComponent = MiniMapNode, onClick, }) {\n const nodeIds = useStore(selectorNodeIds, shallow);\n const nodeColorFunc = getAttrFunction(nodeColor);\n const nodeStrokeColorFunc = getAttrFunction(nodeStrokeColor);\n const nodeClassNameFunc = getAttrFunction(nodeClassName);\n const shapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision';\n return (jsx(Fragment, { children: nodeIds.map((nodeId) => (\n /*\n * The split of responsibilities between MiniMapNodes and\n * NodeComponentWrapper may appear weird. However, it’s designed to\n * minimize the cost of updates when individual nodes change.\n *\n * For more details, see a similar commit in `NodeRenderer/index.tsx`.\n */\n jsx(NodeComponentWrapper, { id: nodeId, nodeColorFunc: nodeColorFunc, nodeStrokeColorFunc: nodeStrokeColorFunc, nodeClassNameFunc: nodeClassNameFunc, nodeBorderRadius: nodeBorderRadius, nodeStrokeWidth: nodeStrokeWidth, NodeComponent: NodeComponent, onClick: onClick, shapeRendering: shapeRendering }, nodeId))) }));\n}\nfunction NodeComponentWrapperInner({ id, nodeColorFunc, nodeStrokeColorFunc, nodeClassNameFunc, nodeBorderRadius, nodeStrokeWidth, shapeRendering, NodeComponent, onClick, }) {\n const { node, x, y, width, height } = useStore((s) => {\n const { internals } = s.nodeLookup.get(id);\n const node = internals.userNode;\n const { x, y } = internals.positionAbsolute;\n const { width, height } = getNodeDimensions(node);\n return {\n node,\n x,\n y,\n width,\n height,\n };\n }, shallow);\n if (!node || node.hidden || !nodeHasDimensions(node)) {\n return null;\n }\n return (jsx(NodeComponent, { x: x, y: y, width: width, height: height, style: node.style, selected: !!node.selected, className: nodeClassNameFunc(node), color: nodeColorFunc(node), borderRadius: nodeBorderRadius, strokeColor: nodeStrokeColorFunc(node), strokeWidth: nodeStrokeWidth, shapeRendering: shapeRendering, onClick: onClick, id: node.id }));\n}\nconst NodeComponentWrapper = memo(NodeComponentWrapperInner);\nvar MiniMapNodes$1 = memo(MiniMapNodes);\n\nconst defaultWidth = 200;\nconst defaultHeight = 150;\nconst filterHidden = (node) => !node.hidden;\nconst selector$1 = (s) => {\n const viewBB = {\n x: -s.transform[0] / s.transform[2],\n y: -s.transform[1] / s.transform[2],\n width: s.width / s.transform[2],\n height: s.height / s.transform[2],\n };\n return {\n viewBB,\n boundingRect: s.nodeLookup.size > 0\n ? getBoundsOfRects(getInternalNodesBounds(s.nodeLookup, { filter: filterHidden }), viewBB)\n : viewBB,\n rfId: s.rfId,\n panZoom: s.panZoom,\n translateExtent: s.translateExtent,\n flowWidth: s.width,\n flowHeight: s.height,\n ariaLabelConfig: s.ariaLabelConfig,\n };\n};\nconst ARIA_LABEL_KEY = 'react-flow__minimap-desc';\nfunction MiniMapComponent({ style, className, nodeStrokeColor, nodeColor, nodeClassName = '', nodeBorderRadius = 5, nodeStrokeWidth, \n/*\n * We need to rename the prop to be `CapitalCase` so that JSX will render it as\n * a component properly.\n */\nnodeComponent, bgColor, maskColor, maskStrokeColor, maskStrokeWidth, position = 'bottom-right', onClick, onNodeClick, pannable = false, zoomable = false, ariaLabel, inversePan, zoomStep = 1, offsetScale = 5, }) {\n const store = useStoreApi();\n const svg = useRef(null);\n const { boundingRect, viewBB, rfId, panZoom, translateExtent, flowWidth, flowHeight, ariaLabelConfig } = useStore(selector$1, shallow);\n const elementWidth = style?.width ?? defaultWidth;\n const elementHeight = style?.height ?? defaultHeight;\n const scaledWidth = boundingRect.width / elementWidth;\n const scaledHeight = boundingRect.height / elementHeight;\n const viewScale = Math.max(scaledWidth, scaledHeight);\n const viewWidth = viewScale * elementWidth;\n const viewHeight = viewScale * elementHeight;\n const offset = offsetScale * viewScale;\n const x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset;\n const y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset;\n const width = viewWidth + offset * 2;\n const height = viewHeight + offset * 2;\n const labelledBy = `${ARIA_LABEL_KEY}-${rfId}`;\n const viewScaleRef = useRef(0);\n const minimapInstance = useRef();\n viewScaleRef.current = viewScale;\n useEffect(() => {\n if (svg.current && panZoom) {\n minimapInstance.current = XYMinimap({\n domNode: svg.current,\n panZoom,\n getTransform: () => store.getState().transform,\n getViewScale: () => viewScaleRef.current,\n });\n return () => {\n minimapInstance.current?.destroy();\n };\n }\n }, [panZoom]);\n useEffect(() => {\n minimapInstance.current?.update({\n translateExtent,\n width: flowWidth,\n height: flowHeight,\n inversePan,\n pannable,\n zoomStep,\n zoomable,\n });\n }, [pannable, zoomable, inversePan, zoomStep, translateExtent, flowWidth, flowHeight]);\n const onSvgClick = onClick\n ? (event) => {\n const [x, y] = minimapInstance.current?.pointer(event) || [0, 0];\n onClick(event, { x, y });\n }\n : undefined;\n const onSvgNodeClick = onNodeClick\n ? useCallback((event, nodeId) => {\n const node = store.getState().nodeLookup.get(nodeId).internals.userNode;\n onNodeClick(event, node);\n }, [])\n : undefined;\n const _ariaLabel = ariaLabel ?? ariaLabelConfig['minimap.ariaLabel'];\n return (jsx(Panel, { position: position, style: {\n ...style,\n '--xy-minimap-background-color-props': typeof bgColor === 'string' ? bgColor : undefined,\n '--xy-minimap-mask-background-color-props': typeof maskColor === 'string' ? maskColor : undefined,\n '--xy-minimap-mask-stroke-color-props': typeof maskStrokeColor === 'string' ? maskStrokeColor : undefined,\n '--xy-minimap-mask-stroke-width-props': typeof maskStrokeWidth === 'number' ? maskStrokeWidth * viewScale : undefined,\n '--xy-minimap-node-background-color-props': typeof nodeColor === 'string' ? nodeColor : undefined,\n '--xy-minimap-node-stroke-color-props': typeof nodeStrokeColor === 'string' ? nodeStrokeColor : undefined,\n '--xy-minimap-node-stroke-width-props': typeof nodeStrokeWidth === 'number' ? nodeStrokeWidth : undefined,\n }, className: cc(['react-flow__minimap', className]), \"data-testid\": \"rf__minimap\", children: jsxs(\"svg\", { width: elementWidth, height: elementHeight, viewBox: `${x} ${y} ${width} ${height}`, className: \"react-flow__minimap-svg\", role: \"img\", \"aria-labelledby\": labelledBy, ref: svg, onClick: onSvgClick, children: [_ariaLabel && jsx(\"title\", { id: labelledBy, children: _ariaLabel }), jsx(MiniMapNodes$1, { onClick: onSvgNodeClick, nodeColor: nodeColor, nodeStrokeColor: nodeStrokeColor, nodeBorderRadius: nodeBorderRadius, nodeClassName: nodeClassName, nodeStrokeWidth: nodeStrokeWidth, nodeComponent: nodeComponent }), jsx(\"path\", { className: \"react-flow__minimap-mask\", d: `M${x - offset},${y - offset}h${width + offset * 2}v${height + offset * 2}h${-width - offset * 2}z\n M${viewBB.x},${viewBB.y}h${viewBB.width}v${viewBB.height}h${-viewBB.width}z`, fillRule: \"evenodd\", pointerEvents: \"none\" })] }) }));\n}\nMiniMapComponent.displayName = 'MiniMap';\n/**\n * The `<MiniMap />` component can be used to render an overview of your flow. It\n * renders each node as an SVG element and visualizes where the current viewport is\n * in relation to the rest of the flow.\n *\n * @public\n * @example\n *\n * ```jsx\n *import { ReactFlow, MiniMap } from '@xyflow/react';\n *\n *export default function Flow() {\n * return (\n * <ReactFlow nodes={[...]]} edges={[...]]}>\n * <MiniMap nodeStrokeWidth={3} />\n * </ReactFlow>\n * );\n *}\n *```\n */\nconst MiniMap = memo(MiniMapComponent);\n\nconst scaleSelector = (calculateScale) => (store) => calculateScale ? `${Math.max(1 / store.transform[2], 1)}` : undefined;\nconst defaultPositions = {\n [ResizeControlVariant.Line]: 'right',\n [ResizeControlVariant.Handle]: 'bottom-right',\n};\nfunction ResizeControl({ nodeId, position, variant = ResizeControlVariant.Handle, className, style = undefined, children, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, resizeDirection, autoScale = true, shouldResize, onResizeStart, onResize, onResizeEnd, }) {\n const contextNodeId = useNodeId();\n const id = typeof nodeId === 'string' ? nodeId : contextNodeId;\n const store = useStoreApi();\n const resizeControlRef = useRef(null);\n const isHandleControl = variant === ResizeControlVariant.Handle;\n const scale = useStore(useCallback(scaleSelector(isHandleControl && autoScale), [isHandleControl, autoScale]), shallow);\n const resizer = useRef(null);\n const controlPosition = position ?? defaultPositions[variant];\n useEffect(() => {\n if (!resizeControlRef.current || !id) {\n return;\n }\n if (!resizer.current) {\n resizer.current = XYResizer({\n domNode: resizeControlRef.current,\n nodeId: id,\n getStoreItems: () => {\n const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, domNode } = store.getState();\n return {\n nodeLookup,\n transform,\n snapGrid,\n snapToGrid,\n nodeOrigin,\n paneDomNode: domNode,\n };\n },\n onChange: (change, childChanges) => {\n const { triggerNodeChanges, nodeLookup, parentLookup, nodeOrigin } = store.getState();\n const changes = [];\n const nextPosition = { x: change.x, y: change.y };\n const node = nodeLookup.get(id);\n if (node && node.expandParent && node.parentId) {\n const origin = node.origin ?? nodeOrigin;\n const width = change.width ?? node.measured.width ?? 0;\n const height = change.height ?? node.measured.height ?? 0;\n const child = {\n id: node.id,\n parentId: node.parentId,\n rect: {\n width,\n height,\n ...evaluateAbsolutePosition({\n x: change.x ?? node.position.x,\n y: change.y ?? node.position.y,\n }, { width, height }, node.parentId, nodeLookup, origin),\n },\n };\n const parentExpandChanges = handleExpandParent([child], nodeLookup, parentLookup, nodeOrigin);\n changes.push(...parentExpandChanges);\n /*\n * when the parent was expanded by the child node, its position will be clamped at\n * 0,0 when node origin is 0,0 and to width, height if it's 1,1\n */\n nextPosition.x = change.x ? Math.max(origin[0] * width, change.x) : undefined;\n nextPosition.y = change.y ? Math.max(origin[1] * height, change.y) : undefined;\n }\n if (nextPosition.x !== undefined && nextPosition.y !== undefined) {\n const positionChange = {\n id,\n type: 'position',\n position: { ...nextPosition },\n };\n changes.push(positionChange);\n }\n if (change.width !== undefined && change.height !== undefined) {\n const setAttributes = !resizeDirection ? true : resizeDirection === 'horizontal' ? 'width' : 'height';\n const dimensionChange = {\n id,\n type: 'dimensions',\n resizing: true,\n setAttributes,\n dimensions: {\n width: change.width,\n height: change.height,\n },\n };\n changes.push(dimensionChange);\n }\n for (const childChange of childChanges) {\n const positionChange = {\n ...childChange,\n type: 'position',\n };\n changes.push(positionChange);\n }\n triggerNodeChanges(changes);\n },\n onEnd: ({ width, height }) => {\n const dimensionChange = {\n id: id,\n type: 'dimensions',\n resizing: false,\n dimensions: {\n width,\n height,\n },\n };\n store.getState().triggerNodeChanges([dimensionChange]);\n },\n });\n }\n resizer.current.update({\n controlPosition,\n boundaries: {\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n },\n keepAspectRatio,\n resizeDirection,\n onResizeStart,\n onResize,\n onResizeEnd,\n shouldResize,\n });\n return () => {\n resizer.current?.destroy();\n };\n }, [\n controlPosition,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n keepAspectRatio,\n onResizeStart,\n onResize,\n onResizeEnd,\n shouldResize,\n ]);\n const positionClassNames = controlPosition.split('-');\n return (jsx(\"div\", { className: cc(['react-flow__resize-control', 'nodrag', ...positionClassNames, variant, className]), ref: resizeControlRef, style: {\n ...style,\n scale,\n ...(color && { [isHandleControl ? 'backgroundColor' : 'borderColor']: color }),\n }, children: children }));\n}\n/**\n * To create your own resizing UI, you can use the `NodeResizeControl` component where you can pass children (such as icons).\n * @public\n *\n */\nconst NodeResizeControl = memo(ResizeControl);\n\n/**\n * The `<NodeResizer />` component can be used to add a resize functionality to your\n * nodes. It renders draggable controls around the node to resize in all directions.\n * @public\n *\n * @example\n *```jsx\n *import { memo } from 'react';\n *import { Handle, Position, NodeResizer } from '@xyflow/react';\n *\n *function ResizableNode({ data }) {\n * return (\n * <>\n * <NodeResizer minWidth={100} minHeight={30} />\n * <Handle type=\"target\" position={Position.Left} />\n * <div style={{ padding: 10 }}>{data.label}</div>\n * <Handle type=\"source\" position={Position.Right} />\n * </>\n * );\n *};\n *\n *export default memo(ResizableNode);\n *```\n */\nfunction NodeResizer({ nodeId, isVisible = true, handleClassName, handleStyle, lineClassName, lineStyle, color, minWidth = 10, minHeight = 10, maxWidth = Number.MAX_VALUE, maxHeight = Number.MAX_VALUE, keepAspectRatio = false, autoScale = true, shouldResize, onResizeStart, onResize, onResizeEnd, }) {\n if (!isVisible) {\n return null;\n }\n return (jsxs(Fragment, { children: [XY_RESIZER_LINE_POSITIONS.map((position) => (jsx(NodeResizeControl, { className: lineClassName, style: lineStyle, nodeId: nodeId, position: position, variant: ResizeControlVariant.Line, color: color, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, onResizeStart: onResizeStart, keepAspectRatio: keepAspectRatio, autoScale: autoScale, shouldResize: shouldResize, onResize: onResize, onResizeEnd: onResizeEnd }, position))), XY_RESIZER_HANDLE_POSITIONS.map((position) => (jsx(NodeResizeControl, { className: handleClassName, style: handleStyle, nodeId: nodeId, position: position, color: color, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, onResizeStart: onResizeStart, keepAspectRatio: keepAspectRatio, autoScale: autoScale, shouldResize: shouldResize, onResize: onResize, onResizeEnd: onResizeEnd }, position)))] }));\n}\n\nconst selector = (state) => state.domNode?.querySelector('.react-flow__renderer');\nfunction NodeToolbarPortal({ children }) {\n const wrapperRef = useStore(selector);\n if (!wrapperRef) {\n return null;\n }\n return createPortal(children, wrapperRef);\n}\n\nconst nodeEqualityFn = (a, b) => a?.internals.positionAbsolute.x !== b?.internals.positionAbsolute.x ||\n a?.internals.positionAbsolute.y !== b?.internals.positionAbsolute.y ||\n a?.measured.width !== b?.measured.width ||\n a?.measured.height !== b?.measured.height ||\n a?.selected !== b?.selected ||\n a?.internals.z !== b?.internals.z;\nconst nodesEqualityFn = (a, b) => {\n if (a.size !== b.size) {\n return false;\n }\n for (const [key, node] of a) {\n if (nodeEqualityFn(node, b.get(key))) {\n return false;\n }\n }\n return true;\n};\nconst storeSelector = (state) => ({\n x: state.transform[0],\n y: state.transform[1],\n zoom: state.transform[2],\n selectedNodesCount: state.nodes.filter((node) => node.selected).length,\n});\n/**\n * This component can render a toolbar or tooltip to one side of a custom node. This\n * toolbar doesn't scale with the viewport so that the content is always visible.\n *\n * @public\n * @example\n * ```jsx\n *import { memo } from 'react';\n *import { Handle, Position, NodeToolbar } from '@xyflow/react';\n *\n *function CustomNode({ data }) {\n * return (\n * <>\n * <NodeToolbar isVisible={data.toolbarVisible} position={data.toolbarPosition}>\n * <button>delete</button>\n * <button>copy</button>\n * <button>expand</button>\n * </NodeToolbar>\n *\n * <div style={{ padding: '10px 20px' }}>\n * {data.label}\n * </div>\n *\n * <Handle type=\"target\" position={Position.Left} />\n * <Handle type=\"source\" position={Position.Right} />\n * </>\n * );\n *};\n *\n *export default memo(CustomNode);\n *```\n * @remarks By default, the toolbar is only visible when a node is selected. If multiple\n * nodes are selected it will not be visible to prevent overlapping toolbars or\n * clutter. You can override this behavior by setting the `isVisible` prop to `true`.\n */\nfunction NodeToolbar({ nodeId, children, className, style, isVisible, position = Position.Top, offset = 10, align = 'center', ...rest }) {\n const contextNodeId = useNodeId();\n const nodesSelector = useCallback((state) => {\n const nodeIds = Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId || ''];\n const internalNodes = nodeIds.reduce((res, id) => {\n const node = state.nodeLookup.get(id);\n if (node) {\n res.set(node.id, node);\n }\n return res;\n }, new Map());\n return internalNodes;\n }, [nodeId, contextNodeId]);\n const nodes = useStore(nodesSelector, nodesEqualityFn);\n const { x, y, zoom, selectedNodesCount } = useStore(storeSelector, shallow);\n // if isVisible is not set, we show the toolbar only if its node is selected and no other node is selected\n const isActive = typeof isVisible === 'boolean'\n ? isVisible\n : nodes.size === 1 && nodes.values().next().value?.selected && selectedNodesCount === 1;\n if (!isActive || !nodes.size) {\n return null;\n }\n const nodeRect = getInternalNodesBounds(nodes);\n const nodesArray = Array.from(nodes.values());\n const zIndex = Math.max(...nodesArray.map((node) => node.internals.z + 1));\n const wrapperStyle = {\n position: 'absolute',\n transform: getNodeToolbarTransform(nodeRect, { x, y, zoom }, position, offset, align),\n zIndex,\n ...style,\n };\n return (jsx(NodeToolbarPortal, { children: jsx(\"div\", { style: wrapperStyle, className: cc(['react-flow__node-toolbar', className]), ...rest, \"data-id\": nodesArray.reduce((acc, node) => `${acc}${node.id} `, '').trim(), children: children }) }));\n}\n\nconst zoomSelector = (state) => state.transform[2];\n/**\n * This component can render a toolbar or tooltip to one side of a custom edge. This\n * toolbar doesn't scale with the viewport so that the content stays the same size.\n *\n * @public\n * @example\n * ```jsx\n * import { EdgeToolbar, BaseEdge, getBezierPath, type EdgeProps } from \"@xyflow/react\";\n *\n * export function CustomEdge({ id, data, ...props }: EdgeProps) {\n * const [edgePath, centerX, centerY] = getBezierPath(props);\n *\n * return (\n * <>\n * <BaseEdge id={id} path={edgePath} />\n * <EdgeToolbar edgeId={id} x={centerX} y={centerY} isVisible>\n * <button onClick={() => console.log('edge', id, 'click')}}>Click me</button>\n * </EdgeToolbar>\n * </>\n * );\n * }\n * ```\n */\nfunction EdgeToolbar({ edgeId, x, y, children, className, style, isVisible, alignX = 'center', alignY = 'center', ...rest }) {\n const edgeSelector = useCallback((state) => state.edgeLookup.get(edgeId), [edgeId]);\n const edge = useStore(edgeSelector, shallow);\n const isActive = typeof isVisible === 'boolean' ? isVisible : edge?.selected;\n const zoom = useStore(zoomSelector);\n if (!isActive) {\n return null;\n }\n const zIndex = (edge?.zIndex ?? 0) + 1;\n const transform = getEdgeToolbarTransform(x, y, zoom, alignX, alignY);\n return (jsx(EdgeLabelRenderer, { children: jsx(\"div\", { style: {\n position: 'absolute',\n transform,\n zIndex,\n pointerEvents: 'all',\n transformOrigin: '0 0',\n ...style,\n }, className: cc(['react-flow__edge-toolbar', className]), \"data-id\": edge?.id ?? '', ...rest, children: children }) }));\n}\n\nexport { Background, BackgroundVariant, BaseEdge, BezierEdge, ControlButton, Controls, EdgeLabelRenderer, EdgeText, EdgeToolbar, Handle, MiniMap, MiniMapNode, NodeResizeControl, NodeResizer, NodeToolbar, Panel, index as ReactFlow, ReactFlowProvider, SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge, ViewportPortal, applyEdgeChanges, applyNodeChanges, getSimpleBezierPath, isEdge, isNode, useConnection, useEdges, useEdgesState, useHandleConnections, useInternalNode, useKeyPress, useNodeConnections, useNodeId, useNodes, useNodesData, useNodesInitialized, useNodesState, useOnSelectionChange, useOnViewportChange, useReactFlow, useStore, useStoreApi, useUpdateNodeInternals, useViewport };\n","export default function cc(names) {\n if (typeof names === \"string\" || typeof names === \"number\") return \"\" + names\n\n let out = \"\"\n\n if (Array.isArray(names)) {\n for (let i = 0, tmp; i < names.length; i++) {\n if ((tmp = cc(names[i])) !== \"\") {\n out += (out && \" \") + tmp\n }\n }\n } else {\n for (let k in names) {\n if (names[k]) out += (out && \" \") + k\n }\n }\n\n return out\n}\n","import {dispatch} from \"d3-dispatch\";\nimport {select, pointer} from \"d3-selection\";\nimport nodrag, {yesdrag} from \"./nodrag.js\";\nimport noevent, {nonpassive, nonpassivecapture, nopropagation} from \"./noevent.js\";\nimport constant from \"./constant.js\";\nimport DragEvent from \"./event.js\";\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter(event) {\n return !event.ctrlKey && !event.button;\n}\n\nfunction defaultContainer() {\n return this.parentNode;\n}\n\nfunction defaultSubject(event, d) {\n return d == null ? {x: event.x, y: event.y} : d;\n}\n\nfunction defaultTouchable() {\n return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\nexport default function() {\n var filter = defaultFilter,\n container = defaultContainer,\n subject = defaultSubject,\n touchable = defaultTouchable,\n gestures = {},\n listeners = dispatch(\"start\", \"drag\", \"end\"),\n active = 0,\n mousedownx,\n mousedowny,\n mousemoving,\n touchending,\n clickDistance2 = 0;\n\n function drag(selection) {\n selection\n .on(\"mousedown.drag\", mousedowned)\n .filter(touchable)\n .on(\"touchstart.drag\", touchstarted)\n .on(\"touchmove.drag\", touchmoved, nonpassive)\n .on(\"touchend.drag touchcancel.drag\", touchended)\n .style(\"touch-action\", \"none\")\n .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n }\n\n function mousedowned(event, d) {\n if (touchending || !filter.call(this, event, d)) return;\n var gesture = beforestart(this, container.call(this, event, d), event, d, \"mouse\");\n if (!gesture) return;\n select(event.view)\n .on(\"mousemove.drag\", mousemoved, nonpassivecapture)\n .on(\"mouseup.drag\", mouseupped, nonpassivecapture);\n nodrag(event.view);\n nopropagation(event);\n mousemoving = false;\n mousedownx = event.clientX;\n mousedowny = event.clientY;\n gesture(\"start\", event);\n }\n\n function mousemoved(event) {\n noevent(event);\n if (!mousemoving) {\n var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;\n mousemoving = dx * dx + dy * dy > clickDistance2;\n }\n gestures.mouse(\"drag\", event);\n }\n\n function mouseupped(event) {\n select(event.view).on(\"mousemove.drag mouseup.drag\", null);\n yesdrag(event.view, mousemoving);\n noevent(event);\n gestures.mouse(\"end\", event);\n }\n\n function touchstarted(event, d) {\n if (!filter.call(this, event, d)) return;\n var touches = event.changedTouches,\n c = container.call(this, event, d),\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = beforestart(this, c, event, d, touches[i].identifier, touches[i])) {\n nopropagation(event);\n gesture(\"start\", event, touches[i]);\n }\n }\n }\n\n function touchmoved(event) {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n noevent(event);\n gesture(\"drag\", event, touches[i]);\n }\n }\n }\n\n function touchended(event) {\n var touches = event.changedTouches,\n n = touches.length, i, gesture;\n\n if (touchending) clearTimeout(touchending);\n touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n for (i = 0; i < n; ++i) {\n if (gesture = gestures[touches[i].identifier]) {\n nopropagation(event);\n gesture(\"end\", event, touches[i]);\n }\n }\n }\n\n function beforestart(that, container, event, d, identifier, touch) {\n var dispatch = listeners.copy(),\n p = pointer(touch || event, container), dx, dy,\n s;\n\n if ((s = subject.call(that, new DragEvent(\"beforestart\", {\n sourceEvent: event,\n target: drag,\n identifier,\n active,\n x: p[0],\n y: p[1],\n dx: 0,\n dy: 0,\n dispatch\n }), d)) == null) return;\n\n dx = s.x - p[0] || 0;\n dy = s.y - p[1] || 0;\n\n return function gesture(type, event, touch) {\n var p0 = p, n;\n switch (type) {\n case \"start\": gestures[identifier] = gesture, n = active++; break;\n case \"end\": delete gestures[identifier], --active; // falls through\n case \"drag\": p = pointer(touch || event, container), n = active; break;\n }\n dispatch.call(\n type,\n that,\n new DragEvent(type, {\n sourceEvent: event,\n subject: s,\n target: drag,\n identifier,\n active: n,\n x: p[0] + dx,\n y: p[1] + dy,\n dx: p[0] - p0[0],\n dy: p[1] - p0[1],\n dispatch\n }),\n d\n );\n };\n }\n\n drag.filter = function(_) {\n return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), drag) : filter;\n };\n\n drag.container = function(_) {\n return arguments.length ? (container = typeof _ === \"function\" ? _ : constant(_), drag) : container;\n };\n\n drag.subject = function(_) {\n return arguments.length ? (subject = typeof _ === \"function\" ? _ : constant(_), drag) : subject;\n };\n\n drag.touchable = function(_) {\n return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), drag) : touchable;\n };\n\n drag.on = function() {\n var value = listeners.on.apply(listeners, arguments);\n return value === listeners ? drag : value;\n };\n\n drag.clickDistance = function(_) {\n return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);\n };\n\n return drag;\n}\n","export default x => () => x;\n","export default function DragEvent(type, {\n sourceEvent,\n subject,\n target,\n identifier,\n active,\n x, y, dx, dy,\n dispatch\n}) {\n Object.defineProperties(this, {\n type: {value: type, enumerable: true, configurable: true},\n sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},\n subject: {value: subject, enumerable: true, configurable: true},\n target: {value: target, enumerable: true, configurable: true},\n identifier: {value: identifier, enumerable: true, configurable: true},\n active: {value: active, enumerable: true, configurable: true},\n x: {value: x, enumerable: true, configurable: true},\n y: {value: y, enumerable: true, configurable: true},\n dx: {value: dx, enumerable: true, configurable: true},\n dy: {value: dy, enumerable: true, configurable: true},\n _: {value: dispatch}\n });\n}\n\nDragEvent.prototype.on = function() {\n var value = this._.on.apply(this._, arguments);\n return value === this._ ? this : value;\n};\n","import { drag } from 'd3-drag';\nimport { select, pointer } from 'd3-selection';\nimport { zoom, zoomIdentity, zoomTransform } from 'd3-zoom';\nimport { interpolateZoom, interpolate } from 'd3-interpolate';\n\nconst errorMessages = {\n error001: () => '[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001',\n error002: () => \"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.\",\n error003: (nodeType) => `Node type \"${nodeType}\" not found. Using fallback type \"default\".`,\n error004: () => 'The React Flow parent container needs a width and a height to render the graph.',\n error005: () => 'Only child nodes can use a parent extent.',\n error006: () => \"Can't create edge. An edge needs a source and a target.\",\n error007: (id) => `The old edge with id=${id} does not exist.`,\n error009: (type) => `Marker type \"${type}\" doesn't exist.`,\n error008: (handleType, { id, sourceHandle, targetHandle }) => `Couldn't create edge for ${handleType} handle id: \"${handleType === 'source' ? sourceHandle : targetHandle}\", edge id: ${id}.`,\n error010: () => 'Handle: No node id found. Make sure to only use a Handle inside a custom Node.',\n error011: (edgeType) => `Edge type \"${edgeType}\" not found. Using fallback type \"default\".`,\n error012: (id) => `Node with id \"${id}\" does not exist, it may have been removed. This can happen when a node is deleted before the \"onNodeClick\" handler is called.`,\n error013: (lib = 'react') => `It seems that you haven't loaded the styles. Please import '@xyflow/${lib}/dist/style.css' or base.css to make sure everything is working properly.`,\n error014: () => 'useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.',\n error015: () => 'It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.',\n};\nconst infiniteExtent = [\n [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],\n [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],\n];\nconst elementSelectionKeys = ['Enter', ' ', 'Escape'];\nconst defaultAriaLabelConfig = {\n 'node.a11yDescription.default': 'Press enter or space to select a node. Press delete to remove it and escape to cancel.',\n 'node.a11yDescription.keyboardDisabled': 'Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.',\n 'node.a11yDescription.ariaLiveMessage': ({ direction, x, y }) => `Moved selected node ${direction}. New position, x: ${x}, y: ${y}`,\n 'edge.a11yDescription.default': 'Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.',\n // Control elements\n 'controls.ariaLabel': 'Control Panel',\n 'controls.zoomIn.ariaLabel': 'Zoom In',\n 'controls.zoomOut.ariaLabel': 'Zoom Out',\n 'controls.fitView.ariaLabel': 'Fit View',\n 'controls.interactive.ariaLabel': 'Toggle Interactivity',\n // Mini map\n 'minimap.ariaLabel': 'Mini Map',\n // Handle\n 'handle.ariaLabel': 'Handle',\n};\n\n/**\n * The `ConnectionMode` is used to set the mode of connection between nodes.\n * The `Strict` mode is the default one and only allows source to target edges.\n * `Loose` mode allows source to source and target to target edges as well.\n *\n * @public\n */\nvar ConnectionMode;\n(function (ConnectionMode) {\n ConnectionMode[\"Strict\"] = \"strict\";\n ConnectionMode[\"Loose\"] = \"loose\";\n})(ConnectionMode || (ConnectionMode = {}));\n/**\n * This enum is used to set the different modes of panning the viewport when the\n * user scrolls. The `Free` mode allows the user to pan in any direction by scrolling\n * with a device like a trackpad. The `Vertical` and `Horizontal` modes restrict\n * scroll panning to only the vertical or horizontal axis, respectively.\n *\n * @public\n */\nvar PanOnScrollMode;\n(function (PanOnScrollMode) {\n PanOnScrollMode[\"Free\"] = \"free\";\n PanOnScrollMode[\"Vertical\"] = \"vertical\";\n PanOnScrollMode[\"Horizontal\"] = \"horizontal\";\n})(PanOnScrollMode || (PanOnScrollMode = {}));\nvar SelectionMode;\n(function (SelectionMode) {\n SelectionMode[\"Partial\"] = \"partial\";\n SelectionMode[\"Full\"] = \"full\";\n})(SelectionMode || (SelectionMode = {}));\nconst initialConnection = {\n inProgress: false,\n isValid: null,\n from: null,\n fromHandle: null,\n fromPosition: null,\n fromNode: null,\n to: null,\n toHandle: null,\n toPosition: null,\n toNode: null,\n pointer: null,\n};\n\n/**\n * If you set the `connectionLineType` prop on your [`<ReactFlow />`](/api-reference/react-flow#connection-connectionLineType)\n *component, it will dictate the style of connection line rendered when creating\n *new edges.\n *\n * @public\n *\n * @remarks If you choose to render a custom connection line component, this value will be\n *passed to your component as part of its [`ConnectionLineComponentProps`](/api-reference/types/connection-line-component-props).\n */\nvar ConnectionLineType;\n(function (ConnectionLineType) {\n ConnectionLineType[\"Bezier\"] = \"default\";\n ConnectionLineType[\"Straight\"] = \"straight\";\n ConnectionLineType[\"Step\"] = \"step\";\n ConnectionLineType[\"SmoothStep\"] = \"smoothstep\";\n ConnectionLineType[\"SimpleBezier\"] = \"simplebezier\";\n})(ConnectionLineType || (ConnectionLineType = {}));\n/**\n * Edges may optionally have a marker on either end. The MarkerType type enumerates\n * the options available to you when configuring a given marker.\n *\n * @public\n */\nvar MarkerType;\n(function (MarkerType) {\n MarkerType[\"Arrow\"] = \"arrow\";\n MarkerType[\"ArrowClosed\"] = \"arrowclosed\";\n})(MarkerType || (MarkerType = {}));\n\n/**\n * While [`PanelPosition`](/api-reference/types/panel-position) can be used to place a\n * component in the corners of a container, the `Position` enum is less precise and used\n * primarily in relation to edges and handles.\n *\n * @public\n */\nvar Position;\n(function (Position) {\n Position[\"Left\"] = \"left\";\n Position[\"Top\"] = \"top\";\n Position[\"Right\"] = \"right\";\n Position[\"Bottom\"] = \"bottom\";\n})(Position || (Position = {}));\nconst oppositePosition = {\n [Position.Left]: Position.Right,\n [Position.Right]: Position.Left,\n [Position.Top]: Position.Bottom,\n [Position.Bottom]: Position.Top,\n};\n\n/**\n * @internal\n */\nfunction areConnectionMapsEqual(a, b) {\n if (!a && !b) {\n return true;\n }\n if (!a || !b || a.size !== b.size) {\n return false;\n }\n if (!a.size && !b.size) {\n return true;\n }\n for (const key of a.keys()) {\n if (!b.has(key)) {\n return false;\n }\n }\n return true;\n}\n/**\n * We call the callback for all connections in a that are not in b\n *\n * @internal\n */\nfunction handleConnectionChange(a, b, cb) {\n if (!cb) {\n return;\n }\n const diff = [];\n a.forEach((connection, key) => {\n if (!b?.has(key)) {\n diff.push(connection);\n }\n });\n if (diff.length) {\n cb(diff);\n }\n}\nfunction getConnectionStatus(isValid) {\n return isValid === null ? null : isValid ? 'valid' : 'invalid';\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Test whether an object is usable as an Edge\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Edge\n */\nconst isEdgeBase = (element) => 'id' in element && 'source' in element && 'target' in element;\n/**\n * Test whether an object is usable as a Node\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Node\n */\nconst isNodeBase = (element) => 'id' in element && 'position' in element && !('source' in element) && !('target' in element);\nconst isInternalNodeBase = (element) => 'id' in element && 'internals' in element && !('source' in element) && !('target' in element);\n/**\n * This util is used to tell you what nodes, if any, are connected to the given node\n * as the _target_ of an edge.\n * @public\n * @param node - The node to get the connected nodes from.\n * @param nodes - The array of all nodes.\n * @param edges - The array of all edges.\n * @returns An array of nodes that are connected over edges where the source is the given node.\n *\n * @example\n * ```ts\n *import { getOutgoers } from '@xyflow/react';\n *\n *const nodes = [];\n *const edges = [];\n *\n *const outgoers = getOutgoers(\n * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } },\n * nodes,\n * edges,\n *);\n *```\n */\nconst getOutgoers = (node, nodes, edges) => {\n if (!node.id) {\n return [];\n }\n const outgoerIds = new Set();\n edges.forEach((edge) => {\n if (edge.source === node.id) {\n outgoerIds.add(edge.target);\n }\n });\n return nodes.filter((n) => outgoerIds.has(n.id));\n};\n/**\n * This util is used to tell you what nodes, if any, are connected to the given node\n * as the _source_ of an edge.\n * @public\n * @param node - The node to get the connected nodes from.\n * @param nodes - The array of all nodes.\n * @param edges - The array of all edges.\n * @returns An array of nodes that are connected over edges where the target is the given node.\n *\n * @example\n * ```ts\n *import { getIncomers } from '@xyflow/react';\n *\n *const nodes = [];\n *const edges = [];\n *\n *const incomers = getIncomers(\n * { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } },\n * nodes,\n * edges,\n *);\n *```\n */\nconst getIncomers = (node, nodes, edges) => {\n if (!node.id) {\n return [];\n }\n const incomersIds = new Set();\n edges.forEach((edge) => {\n if (edge.target === node.id) {\n incomersIds.add(edge.source);\n }\n });\n return nodes.filter((n) => incomersIds.has(n.id));\n};\nconst getNodePositionWithOrigin = (node, nodeOrigin = [0, 0]) => {\n const { width, height } = getNodeDimensions(node);\n const origin = node.origin ?? nodeOrigin;\n const offsetX = width * origin[0];\n const offsetY = height * origin[1];\n return {\n x: node.position.x - offsetX,\n y: node.position.y - offsetY,\n };\n};\n/**\n * Returns the bounding box that contains all the given nodes in an array. This can\n * be useful when combined with [`getViewportForBounds`](/api-reference/utils/get-viewport-for-bounds)\n * to calculate the correct transform to fit the given nodes in a viewport.\n * @public\n * @remarks Useful when combined with {@link getViewportForBounds} to calculate the correct transform to fit the given nodes in a viewport.\n * @param nodes - Nodes to calculate the bounds for.\n * @returns Bounding box enclosing all nodes.\n *\n * @remarks This function was previously called `getRectOfNodes`\n *\n * @example\n * ```js\n *import { getNodesBounds } from '@xyflow/react';\n *\n *const nodes = [\n * {\n * id: 'a',\n * position: { x: 0, y: 0 },\n * data: { label: 'a' },\n * width: 50,\n * height: 25,\n * },\n * {\n * id: 'b',\n * position: { x: 100, y: 100 },\n * data: { label: 'b' },\n * width: 50,\n * height: 25,\n * },\n *];\n *\n *const bounds = getNodesBounds(nodes);\n *```\n */\nconst getNodesBounds = (nodes, params = { nodeOrigin: [0, 0] }) => {\n if (process.env.NODE_ENV === 'development' && !params.nodeLookup) {\n console.warn('Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows.');\n }\n if (nodes.length === 0) {\n return { x: 0, y: 0, width: 0, height: 0 };\n }\n const box = nodes.reduce((currBox, nodeOrId) => {\n const isId = typeof nodeOrId === 'string';\n let currentNode = !params.nodeLookup && !isId ? nodeOrId : undefined;\n if (params.nodeLookup) {\n currentNode = isId\n ? params.nodeLookup.get(nodeOrId)\n : !isInternalNodeBase(nodeOrId)\n ? params.nodeLookup.get(nodeOrId.id)\n : nodeOrId;\n }\n const nodeBox = currentNode ? nodeToBox(currentNode, params.nodeOrigin) : { x: 0, y: 0, x2: 0, y2: 0 };\n return getBoundsOfBoxes(currBox, nodeBox);\n }, { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity });\n return boxToRect(box);\n};\n/**\n * Determines a bounding box that contains all given nodes in an array\n * @internal\n */\nconst getInternalNodesBounds = (nodeLookup, params = {}) => {\n let box = { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity };\n let hasVisibleNodes = false;\n nodeLookup.forEach((node) => {\n if (params.filter === undefined || params.filter(node)) {\n box = getBoundsOfBoxes(box, nodeToBox(node));\n hasVisibleNodes = true;\n }\n });\n return hasVisibleNodes ? boxToRect(box) : { x: 0, y: 0, width: 0, height: 0 };\n};\nconst getNodesInside = (nodes, rect, [tx, ty, tScale] = [0, 0, 1], partially = false, \n// set excludeNonSelectableNodes if you want to pay attention to the nodes \"selectable\" attribute\nexcludeNonSelectableNodes = false) => {\n const paneRect = {\n ...pointToRendererPoint(rect, [tx, ty, tScale]),\n width: rect.width / tScale,\n height: rect.height / tScale,\n };\n const visibleNodes = [];\n for (const node of nodes.values()) {\n const { measured, selectable = true, hidden = false } = node;\n if ((excludeNonSelectableNodes && !selectable) || hidden) {\n continue;\n }\n const width = measured.width ?? node.width ?? node.initialWidth ?? null;\n const height = measured.height ?? node.height ?? node.initialHeight ?? null;\n const overlappingArea = getOverlappingArea(paneRect, nodeToRect(node));\n const area = (width ?? 0) * (height ?? 0);\n const partiallyVisible = partially && overlappingArea > 0;\n const forceInitialRender = !node.internals.handleBounds;\n const isVisible = forceInitialRender || partiallyVisible || overlappingArea >= area;\n if (isVisible || node.dragging) {\n visibleNodes.push(node);\n }\n }\n return visibleNodes;\n};\n/**\n * This utility filters an array of edges, keeping only those where either the source or target\n * node is present in the given array of nodes.\n * @public\n * @param nodes - Nodes you want to get the connected edges for.\n * @param edges - All edges.\n * @returns Array of edges that connect any of the given nodes with each other.\n *\n * @example\n * ```js\n *import { getConnectedEdges } from '@xyflow/react';\n *\n *const nodes = [\n * { id: 'a', position: { x: 0, y: 0 } },\n * { id: 'b', position: { x: 100, y: 0 } },\n *];\n *\n *const edges = [\n * { id: 'a->c', source: 'a', target: 'c' },\n * { id: 'c->d', source: 'c', target: 'd' },\n *];\n *\n *const connectedEdges = getConnectedEdges(nodes, edges);\n * // => [{ id: 'a->c', source: 'a', target: 'c' }]\n *```\n */\nconst getConnectedEdges = (nodes, edges) => {\n const nodeIds = new Set();\n nodes.forEach((node) => {\n nodeIds.add(node.id);\n });\n return edges.filter((edge) => nodeIds.has(edge.source) || nodeIds.has(edge.target));\n};\nfunction getFitViewNodes(nodeLookup, options) {\n const fitViewNodes = new Map();\n const optionNodeIds = options?.nodes ? new Set(options.nodes.map((node) => node.id)) : null;\n nodeLookup.forEach((n) => {\n const isVisible = n.measured.width && n.measured.height && (options?.includeHiddenNodes || !n.hidden);\n if (isVisible && (!optionNodeIds || optionNodeIds.has(n.id))) {\n fitViewNodes.set(n.id, n);\n }\n });\n return fitViewNodes;\n}\nasync function fitViewport({ nodes, width, height, panZoom, minZoom, maxZoom }, options) {\n if (nodes.size === 0) {\n return Promise.resolve(true);\n }\n const nodesToFit = getFitViewNodes(nodes, options);\n const bounds = getInternalNodesBounds(nodesToFit);\n const viewport = getViewportForBounds(bounds, width, height, options?.minZoom ?? minZoom, options?.maxZoom ?? maxZoom, options?.padding ?? 0.1);\n await panZoom.setViewport(viewport, {\n duration: options?.duration,\n ease: options?.ease,\n interpolate: options?.interpolate,\n });\n return Promise.resolve(true);\n}\n/**\n * This function calculates the next position of a node, taking into account the node's extent, parent node, and origin.\n *\n * @internal\n * @returns position, positionAbsolute\n */\nfunction calculateNodePosition({ nodeId, nextPosition, nodeLookup, nodeOrigin = [0, 0], nodeExtent, onError, }) {\n const node = nodeLookup.get(nodeId);\n const parentNode = node.parentId ? nodeLookup.get(node.parentId) : undefined;\n const { x: parentX, y: parentY } = parentNode ? parentNode.internals.positionAbsolute : { x: 0, y: 0 };\n const origin = node.origin ?? nodeOrigin;\n let extent = node.extent || nodeExtent;\n if (node.extent === 'parent' && !node.expandParent) {\n if (!parentNode) {\n onError?.('005', errorMessages['error005']());\n }\n else {\n const parentWidth = parentNode.measured.width;\n const parentHeight = parentNode.measured.height;\n if (parentWidth && parentHeight) {\n extent = [\n [parentX, parentY],\n [parentX + parentWidth, parentY + parentHeight],\n ];\n }\n }\n }\n else if (parentNode && isCoordinateExtent(node.extent)) {\n extent = [\n [node.extent[0][0] + parentX, node.extent[0][1] + parentY],\n [node.extent[1][0] + parentX, node.extent[1][1] + parentY],\n ];\n }\n const positionAbsolute = isCoordinateExtent(extent)\n ? clampPosition(nextPosition, extent, node.measured)\n : nextPosition;\n if (node.measured.width === undefined || node.measured.height === undefined) {\n onError?.('015', errorMessages['error015']());\n }\n return {\n position: {\n x: positionAbsolute.x - parentX + (node.measured.width ?? 0) * origin[0],\n y: positionAbsolute.y - parentY + (node.measured.height ?? 0) * origin[1],\n },\n positionAbsolute,\n };\n}\n/**\n * Pass in nodes & edges to delete, get arrays of nodes and edges that actually can be deleted\n * @internal\n * @param param.nodesToRemove - The nodes to remove\n * @param param.edgesToRemove - The edges to remove\n * @param param.nodes - All nodes\n * @param param.edges - All edges\n * @param param.onBeforeDelete - Callback to check which nodes and edges can be deleted\n * @returns nodes: nodes that can be deleted, edges: edges that can be deleted\n */\nasync function getElementsToRemove({ nodesToRemove = [], edgesToRemove = [], nodes, edges, onBeforeDelete, }) {\n const nodeIds = new Set(nodesToRemove.map((node) => node.id));\n const matchingNodes = [];\n for (const node of nodes) {\n if (node.deletable === false) {\n continue;\n }\n const isIncluded = nodeIds.has(node.id);\n const parentHit = !isIncluded && node.parentId && matchingNodes.find((n) => n.id === node.parentId);\n if (isIncluded || parentHit) {\n matchingNodes.push(node);\n }\n }\n const edgeIds = new Set(edgesToRemove.map((edge) => edge.id));\n const deletableEdges = edges.filter((edge) => edge.deletable !== false);\n const connectedEdges = getConnectedEdges(matchingNodes, deletableEdges);\n const matchingEdges = connectedEdges;\n for (const edge of deletableEdges) {\n const isIncluded = edgeIds.has(edge.id);\n if (isIncluded && !matchingEdges.find((e) => e.id === edge.id)) {\n matchingEdges.push(edge);\n }\n }\n if (!onBeforeDelete) {\n return {\n edges: matchingEdges,\n nodes: matchingNodes,\n };\n }\n const onBeforeDeleteResult = await onBeforeDelete({\n nodes: matchingNodes,\n edges: matchingEdges,\n });\n if (typeof onBeforeDeleteResult === 'boolean') {\n return onBeforeDeleteResult ? { edges: matchingEdges, nodes: matchingNodes } : { edges: [], nodes: [] };\n }\n return onBeforeDeleteResult;\n}\n\nconst clamp = (val, min = 0, max = 1) => Math.min(Math.max(val, min), max);\nconst clampPosition = (position = { x: 0, y: 0 }, extent, dimensions) => ({\n x: clamp(position.x, extent[0][0], extent[1][0] - (dimensions?.width ?? 0)),\n y: clamp(position.y, extent[0][1], extent[1][1] - (dimensions?.height ?? 0)),\n});\nfunction clampPositionToParent(childPosition, childDimensions, parent) {\n const { width: parentWidth, height: parentHeight } = getNodeDimensions(parent);\n const { x: parentX, y: parentY } = parent.internals.positionAbsolute;\n return clampPosition(childPosition, [\n [parentX, parentY],\n [parentX + parentWidth, parentY + parentHeight],\n ], childDimensions);\n}\n/**\n * Calculates the velocity of panning when the mouse is close to the edge of the canvas\n * @internal\n * @param value - One dimensional poition of the mouse (x or y)\n * @param min - Minimal position on canvas before panning starts\n * @param max - Maximal position on canvas before panning starts\n * @returns - A number between 0 and 1 that represents the velocity of panning\n */\nconst calcAutoPanVelocity = (value, min, max) => {\n if (value < min) {\n return clamp(Math.abs(value - min), 1, min) / min;\n }\n else if (value > max) {\n return -clamp(Math.abs(value - max), 1, min) / min;\n }\n return 0;\n};\nconst calcAutoPan = (pos, bounds, speed = 15, distance = 40) => {\n const xMovement = calcAutoPanVelocity(pos.x, distance, bounds.width - distance) * speed;\n const yMovement = calcAutoPanVelocity(pos.y, distance, bounds.height - distance) * speed;\n return [xMovement, yMovement];\n};\nconst getBoundsOfBoxes = (box1, box2) => ({\n x: Math.min(box1.x, box2.x),\n y: Math.min(box1.y, box2.y),\n x2: Math.max(box1.x2, box2.x2),\n y2: Math.max(box1.y2, box2.y2),\n});\nconst rectToBox = ({ x, y, width, height }) => ({\n x,\n y,\n x2: x + width,\n y2: y + height,\n});\nconst boxToRect = ({ x, y, x2, y2 }) => ({\n x,\n y,\n width: x2 - x,\n height: y2 - y,\n});\nconst nodeToRect = (node, nodeOrigin = [0, 0]) => {\n const { x, y } = isInternalNodeBase(node)\n ? node.internals.positionAbsolute\n : getNodePositionWithOrigin(node, nodeOrigin);\n return {\n x,\n y,\n width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,\n height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0,\n };\n};\nconst nodeToBox = (node, nodeOrigin = [0, 0]) => {\n const { x, y } = isInternalNodeBase(node)\n ? node.internals.positionAbsolute\n : getNodePositionWithOrigin(node, nodeOrigin);\n return {\n x,\n y,\n x2: x + (node.measured?.width ?? node.width ?? node.initialWidth ?? 0),\n y2: y + (node.measured?.height ?? node.height ?? node.initialHeight ?? 0),\n };\n};\nconst getBoundsOfRects = (rect1, rect2) => boxToRect(getBoundsOfBoxes(rectToBox(rect1), rectToBox(rect2)));\nconst getOverlappingArea = (rectA, rectB) => {\n const xOverlap = Math.max(0, Math.min(rectA.x + rectA.width, rectB.x + rectB.width) - Math.max(rectA.x, rectB.x));\n const yOverlap = Math.max(0, Math.min(rectA.y + rectA.height, rectB.y + rectB.height) - Math.max(rectA.y, rectB.y));\n return Math.ceil(xOverlap * yOverlap);\n};\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isRectObject = (obj) => isNumeric(obj.width) && isNumeric(obj.height) && isNumeric(obj.x) && isNumeric(obj.y);\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\nconst isNumeric = (n) => !isNaN(n) && isFinite(n);\n// used for a11y key board controls for nodes and edges\nconst devWarn = (id, message) => {\n if (process.env.NODE_ENV === 'development') {\n console.warn(`[React Flow]: ${message} Help: https://reactflow.dev/error#${id}`);\n }\n};\nconst snapPosition = (position, snapGrid = [1, 1]) => {\n return {\n x: snapGrid[0] * Math.round(position.x / snapGrid[0]),\n y: snapGrid[1] * Math.round(position.y / snapGrid[1]),\n };\n};\nconst pointToRendererPoint = ({ x, y }, [tx, ty, tScale], snapToGrid = false, snapGrid = [1, 1]) => {\n const position = {\n x: (x - tx) / tScale,\n y: (y - ty) / tScale,\n };\n return snapToGrid ? snapPosition(position, snapGrid) : position;\n};\nconst rendererPointToPoint = ({ x, y }, [tx, ty, tScale]) => {\n return {\n x: x * tScale + tx,\n y: y * tScale + ty,\n };\n};\n/**\n * Parses a single padding value to a number\n * @internal\n * @param padding - Padding to parse\n * @param viewport - Width or height of the viewport\n * @returns The padding in pixels\n */\nfunction parsePadding(padding, viewport) {\n if (typeof padding === 'number') {\n return Math.floor((viewport - viewport / (1 + padding)) * 0.5);\n }\n if (typeof padding === 'string' && padding.endsWith('px')) {\n const paddingValue = parseFloat(padding);\n if (!Number.isNaN(paddingValue)) {\n return Math.floor(paddingValue);\n }\n }\n if (typeof padding === 'string' && padding.endsWith('%')) {\n const paddingValue = parseFloat(padding);\n if (!Number.isNaN(paddingValue)) {\n return Math.floor(viewport * paddingValue * 0.01);\n }\n }\n console.error(`[React Flow] The padding value \"${padding}\" is invalid. Please provide a number or a string with a valid unit (px or %).`);\n return 0;\n}\n/**\n * Parses the paddings to an object with top, right, bottom, left, x and y paddings\n * @internal\n * @param padding - Padding to parse\n * @param width - Width of the viewport\n * @param height - Height of the viewport\n * @returns An object with the paddings in pixels\n */\nfunction parsePaddings(padding, width, height) {\n if (typeof padding === 'string' || typeof padding === 'number') {\n const paddingY = parsePadding(padding, height);\n const paddingX = parsePadding(padding, width);\n return {\n top: paddingY,\n right: paddingX,\n bottom: paddingY,\n left: paddingX,\n x: paddingX * 2,\n y: paddingY * 2,\n };\n }\n if (typeof padding === 'object') {\n const top = parsePadding(padding.top ?? padding.y ?? 0, height);\n const bottom = parsePadding(padding.bottom ?? padding.y ?? 0, height);\n const left = parsePadding(padding.left ?? padding.x ?? 0, width);\n const right = parsePadding(padding.right ?? padding.x ?? 0, width);\n return { top, right, bottom, left, x: left + right, y: top + bottom };\n }\n return { top: 0, right: 0, bottom: 0, left: 0, x: 0, y: 0 };\n}\n/**\n * Calculates the resulting paddings if the new viewport is applied\n * @internal\n * @param bounds - Bounds to fit inside viewport\n * @param x - X position of the viewport\n * @param y - Y position of the viewport\n * @param zoom - Zoom level of the viewport\n * @param width - Width of the viewport\n * @param height - Height of the viewport\n * @returns An object with the minimum padding required to fit the bounds inside the viewport\n */\nfunction calculateAppliedPaddings(bounds, x, y, zoom, width, height) {\n const { x: left, y: top } = rendererPointToPoint(bounds, [x, y, zoom]);\n const { x: boundRight, y: boundBottom } = rendererPointToPoint({ x: bounds.x + bounds.width, y: bounds.y + bounds.height }, [x, y, zoom]);\n const right = width - boundRight;\n const bottom = height - boundBottom;\n return {\n left: Math.floor(left),\n top: Math.floor(top),\n right: Math.floor(right),\n bottom: Math.floor(bottom),\n };\n}\n/**\n * Returns a viewport that encloses the given bounds with padding.\n * @public\n * @remarks You can determine bounds of nodes with {@link getNodesBounds} and {@link getBoundsOfRects}\n * @param bounds - Bounds to fit inside viewport.\n * @param width - Width of the viewport.\n * @param height - Height of the viewport.\n * @param minZoom - Minimum zoom level of the resulting viewport.\n * @param maxZoom - Maximum zoom level of the resulting viewport.\n * @param padding - Padding around the bounds.\n * @returns A transformed {@link Viewport} that encloses the given bounds which you can pass to e.g. {@link setViewport}.\n * @example\n * const { x, y, zoom } = getViewportForBounds(\n * { x: 0, y: 0, width: 100, height: 100},\n * 1200, 800, 0.5, 2);\n */\nconst getViewportForBounds = (bounds, width, height, minZoom, maxZoom, padding) => {\n // First we resolve all the paddings to actual pixel values\n const p = parsePaddings(padding, width, height);\n const xZoom = (width - p.x) / bounds.width;\n const yZoom = (height - p.y) / bounds.height;\n // We calculate the new x, y, zoom for a centered view\n const zoom = Math.min(xZoom, yZoom);\n const clampedZoom = clamp(zoom, minZoom, maxZoom);\n const boundsCenterX = bounds.x + bounds.width / 2;\n const boundsCenterY = bounds.y + bounds.height / 2;\n const x = width / 2 - boundsCenterX * clampedZoom;\n const y = height / 2 - boundsCenterY * clampedZoom;\n // Then we calculate the minimum padding, to respect asymmetric paddings\n const newPadding = calculateAppliedPaddings(bounds, x, y, clampedZoom, width, height);\n // We only want to have an offset if the newPadding is smaller than the required padding\n const offset = {\n left: Math.min(newPadding.left - p.left, 0),\n top: Math.min(newPadding.top - p.top, 0),\n right: Math.min(newPadding.right - p.right, 0),\n bottom: Math.min(newPadding.bottom - p.bottom, 0),\n };\n return {\n x: x - offset.left + offset.right,\n y: y - offset.top + offset.bottom,\n zoom: clampedZoom,\n };\n};\nconst isMacOs = () => typeof navigator !== 'undefined' && navigator?.userAgent?.indexOf('Mac') >= 0;\nfunction isCoordinateExtent(extent) {\n return extent !== undefined && extent !== null && extent !== 'parent';\n}\nfunction getNodeDimensions(node) {\n return {\n width: node.measured?.width ?? node.width ?? node.initialWidth ?? 0,\n height: node.measured?.height ?? node.height ?? node.initialHeight ?? 0,\n };\n}\nfunction nodeHasDimensions(node) {\n return ((node.measured?.width ?? node.width ?? node.initialWidth) !== undefined &&\n (node.measured?.height ?? node.height ?? node.initialHeight) !== undefined);\n}\n/**\n * Convert child position to aboslute position\n *\n * @internal\n * @param position\n * @param parentId\n * @param nodeLookup\n * @param nodeOrigin\n * @returns an internal node with an absolute position\n */\nfunction evaluateAbsolutePosition(position, dimensions = { width: 0, height: 0 }, parentId, nodeLookup, nodeOrigin) {\n const positionAbsolute = { ...position };\n const parent = nodeLookup.get(parentId);\n if (parent) {\n const origin = parent.origin || nodeOrigin;\n positionAbsolute.x += parent.internals.positionAbsolute.x - (dimensions.width ?? 0) * origin[0];\n positionAbsolute.y += parent.internals.positionAbsolute.y - (dimensions.height ?? 0) * origin[1];\n }\n return positionAbsolute;\n}\nfunction areSetsEqual(a, b) {\n if (a.size !== b.size) {\n return false;\n }\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Polyfill for Promise.withResolvers until we can use it in all browsers\n * @internal\n */\nfunction withResolvers() {\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve, reject };\n}\nfunction mergeAriaLabelConfig(partial) {\n return { ...defaultAriaLabelConfig, ...(partial || {}) };\n}\n\nfunction getPointerPosition(event, { snapGrid = [0, 0], snapToGrid = false, transform, containerBounds }) {\n const { x, y } = getEventPosition(event);\n const pointerPos = pointToRendererPoint({ x: x - (containerBounds?.left ?? 0), y: y - (containerBounds?.top ?? 0) }, transform);\n const { x: xSnapped, y: ySnapped } = snapToGrid ? snapPosition(pointerPos, snapGrid) : pointerPos;\n // we need the snapped position in order to be able to skip unnecessary drag events\n return {\n xSnapped,\n ySnapped,\n ...pointerPos,\n };\n}\nconst getDimensions = (node) => ({\n width: node.offsetWidth,\n height: node.offsetHeight,\n});\nconst getHostForElement = (element) => element?.getRootNode?.() || window?.document;\nconst inputTags = ['INPUT', 'SELECT', 'TEXTAREA'];\nfunction isInputDOMNode(event) {\n // using composed path for handling shadow dom\n const target = (event.composedPath?.()?.[0] || event.target);\n if (target?.nodeType !== 1 /* Node.ELEMENT_NODE */)\n return false;\n const isInput = inputTags.includes(target.nodeName) || target.hasAttribute('contenteditable');\n // when an input field is focused we don't want to trigger deletion or movement of nodes\n return isInput || !!target.closest('.nokey');\n}\nconst isMouseEvent = (event) => 'clientX' in event;\nconst getEventPosition = (event, bounds) => {\n const isMouse = isMouseEvent(event);\n const evtX = isMouse ? event.clientX : event.touches?.[0].clientX;\n const evtY = isMouse ? event.clientY : event.touches?.[0].clientY;\n return {\n x: evtX - (bounds?.left ?? 0),\n y: evtY - (bounds?.top ?? 0),\n };\n};\n/*\n * The handle bounds are calculated relative to the node element.\n * We store them in the internals object of the node in order to avoid\n * unnecessary recalculations.\n */\nconst getHandleBounds = (type, nodeElement, nodeBounds, zoom, nodeId) => {\n const handles = nodeElement.querySelectorAll(`.${type}`);\n if (!handles || !handles.length) {\n return null;\n }\n return Array.from(handles).map((handle) => {\n const handleBounds = handle.getBoundingClientRect();\n return {\n id: handle.getAttribute('data-handleid'),\n type,\n nodeId,\n position: handle.getAttribute('data-handlepos'),\n x: (handleBounds.left - nodeBounds.left) / zoom,\n y: (handleBounds.top - nodeBounds.top) / zoom,\n ...getDimensions(handle),\n };\n });\n};\n\nfunction getBezierEdgeCenter({ sourceX, sourceY, targetX, targetY, sourceControlX, sourceControlY, targetControlX, targetControlY, }) {\n /*\n * cubic bezier t=0.5 mid point, not the actual mid point, but easy to calculate\n * https://stackoverflow.com/questions/67516101/how-to-find-distance-mid-point-of-bezier-curve\n */\n const centerX = sourceX * 0.125 + sourceControlX * 0.375 + targetControlX * 0.375 + targetX * 0.125;\n const centerY = sourceY * 0.125 + sourceControlY * 0.375 + targetControlY * 0.375 + targetY * 0.125;\n const offsetX = Math.abs(centerX - sourceX);\n const offsetY = Math.abs(centerY - sourceY);\n return [centerX, centerY, offsetX, offsetY];\n}\nfunction calculateControlOffset(distance, curvature) {\n if (distance >= 0) {\n return 0.5 * distance;\n }\n return curvature * 25 * Math.sqrt(-distance);\n}\nfunction getControlWithCurvature({ pos, x1, y1, x2, y2, c }) {\n switch (pos) {\n case Position.Left:\n return [x1 - calculateControlOffset(x1 - x2, c), y1];\n case Position.Right:\n return [x1 + calculateControlOffset(x2 - x1, c), y1];\n case Position.Top:\n return [x1, y1 - calculateControlOffset(y1 - y2, c)];\n case Position.Bottom:\n return [x1, y1 + calculateControlOffset(y2 - y1, c)];\n }\n}\n/**\n * The `getBezierPath` util returns everything you need to render a bezier edge\n *between two nodes.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n * const source = { x: 0, y: 20 };\n * const target = { x: 150, y: 100 };\n *\n * const [path, labelX, labelY, offsetX, offsetY] = getBezierPath({\n * sourceX: source.x,\n * sourceY: source.y,\n * sourcePosition: Position.Right,\n * targetX: target.x,\n * targetY: target.y,\n * targetPosition: Position.Left,\n *});\n *```\n *\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to\n *work with multiple edge paths at once.\n */\nfunction getBezierPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, curvature = 0.25, }) {\n const [sourceControlX, sourceControlY] = getControlWithCurvature({\n pos: sourcePosition,\n x1: sourceX,\n y1: sourceY,\n x2: targetX,\n y2: targetY,\n c: curvature,\n });\n const [targetControlX, targetControlY] = getControlWithCurvature({\n pos: targetPosition,\n x1: targetX,\n y1: targetY,\n x2: sourceX,\n y2: sourceY,\n c: curvature,\n });\n const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourceControlX,\n sourceControlY,\n targetControlX,\n targetControlY,\n });\n return [\n `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`,\n labelX,\n labelY,\n offsetX,\n offsetY,\n ];\n}\n\n// this is used for straight edges and simple smoothstep edges (LTR, RTL, BTT, TTB)\nfunction getEdgeCenter({ sourceX, sourceY, targetX, targetY, }) {\n const xOffset = Math.abs(targetX - sourceX) / 2;\n const centerX = targetX < sourceX ? targetX + xOffset : targetX - xOffset;\n const yOffset = Math.abs(targetY - sourceY) / 2;\n const centerY = targetY < sourceY ? targetY + yOffset : targetY - yOffset;\n return [centerX, centerY, xOffset, yOffset];\n}\n/**\n * Returns the z-index for an edge based on the node it connects and whether it is selected.\n * By default, edges are rendered below nodes. This behaviour is different for edges that are\n * connected to nodes with a parent, as they are rendered above the parent node.\n */\nfunction getElevatedEdgeZIndex({ sourceNode, targetNode, selected = false, zIndex, elevateOnSelect = false, }) {\n if (zIndex !== undefined) {\n return zIndex;\n }\n const edgeZ = elevateOnSelect && selected ? 1000 : 0;\n const nodeZ = Math.max(sourceNode.parentId || (elevateOnSelect && sourceNode.selected) ? sourceNode.internals.z : 0, targetNode.parentId || (elevateOnSelect && targetNode.selected) ? targetNode.internals.z : 0);\n return edgeZ + nodeZ;\n}\nfunction isEdgeVisible({ sourceNode, targetNode, width, height, transform }) {\n const edgeBox = getBoundsOfBoxes(nodeToBox(sourceNode), nodeToBox(targetNode));\n if (edgeBox.x === edgeBox.x2) {\n edgeBox.x2 += 1;\n }\n if (edgeBox.y === edgeBox.y2) {\n edgeBox.y2 += 1;\n }\n const viewRect = {\n x: -transform[0] / transform[2],\n y: -transform[1] / transform[2],\n width: width / transform[2],\n height: height / transform[2],\n };\n return getOverlappingArea(viewRect, boxToRect(edgeBox)) > 0;\n}\nconst getEdgeId = ({ source, sourceHandle, target, targetHandle }) => `xy-edge__${source}${sourceHandle || ''}-${target}${targetHandle || ''}`;\nconst connectionExists = (edge, edges) => {\n return edges.some((el) => el.source === edge.source &&\n el.target === edge.target &&\n (el.sourceHandle === edge.sourceHandle || (!el.sourceHandle && !edge.sourceHandle)) &&\n (el.targetHandle === edge.targetHandle || (!el.targetHandle && !edge.targetHandle)));\n};\n/**\n * This util is a convenience function to add a new Edge to an array of edges. It also performs some validation to make sure you don't add an invalid edge or duplicate an existing one.\n * @public\n * @param edgeParams - Either an `Edge` or a `Connection` you want to add.\n * @param edges - The array of all current edges.\n * @returns A new array of edges with the new edge added.\n *\n * @remarks If an edge with the same `target` and `source` already exists (and the same\n *`targetHandle` and `sourceHandle` if those are set), then this util won't add\n *a new edge even if the `id` property is different.\n *\n */\nconst addEdge = (edgeParams, edges) => {\n if (!edgeParams.source || !edgeParams.target) {\n devWarn('006', errorMessages['error006']());\n return edges;\n }\n let edge;\n if (isEdgeBase(edgeParams)) {\n edge = { ...edgeParams };\n }\n else {\n edge = {\n ...edgeParams,\n id: getEdgeId(edgeParams),\n };\n }\n if (connectionExists(edge, edges)) {\n return edges;\n }\n if (edge.sourceHandle === null) {\n delete edge.sourceHandle;\n }\n if (edge.targetHandle === null) {\n delete edge.targetHandle;\n }\n return edges.concat(edge);\n};\n/**\n * A handy utility to update an existing [`Edge`](/api-reference/types/edge) with new properties.\n *This searches your edge array for an edge with a matching `id` and updates its\n *properties with the connection you provide.\n * @public\n * @param oldEdge - The edge you want to update.\n * @param newConnection - The new connection you want to update the edge with.\n * @param edges - The array of all current edges.\n * @returns The updated edges array.\n *\n * @example\n * ```js\n *const onReconnect = useCallback(\n * (oldEdge: Edge, newConnection: Connection) => setEdges((els) => reconnectEdge(oldEdge, newConnection, els)),[]);\n *```\n */\nconst reconnectEdge = (oldEdge, newConnection, edges, options = { shouldReplaceId: true }) => {\n const { id: oldEdgeId, ...rest } = oldEdge;\n if (!newConnection.source || !newConnection.target) {\n devWarn('006', errorMessages['error006']());\n return edges;\n }\n const foundEdge = edges.find((e) => e.id === oldEdge.id);\n if (!foundEdge) {\n devWarn('007', errorMessages['error007'](oldEdgeId));\n return edges;\n }\n // Remove old edge and create the new edge with parameters of old edge.\n const edge = {\n ...rest,\n id: options.shouldReplaceId ? getEdgeId(newConnection) : oldEdgeId,\n source: newConnection.source,\n target: newConnection.target,\n sourceHandle: newConnection.sourceHandle,\n targetHandle: newConnection.targetHandle,\n };\n return edges.filter((e) => e.id !== oldEdgeId).concat(edge);\n};\n\n/**\n * Calculates the straight line path between two points.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n *\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n * const source = { x: 0, y: 20 };\n * const target = { x: 150, y: 100 };\n *\n * const [path, labelX, labelY, offsetX, offsetY] = getStraightPath({\n * sourceX: source.x,\n * sourceY: source.y,\n * sourcePosition: Position.Right,\n * targetX: target.x,\n * targetY: target.y,\n * targetPosition: Position.Left,\n * });\n * ```\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once.\n */\nfunction getStraightPath({ sourceX, sourceY, targetX, targetY, }) {\n const [labelX, labelY, offsetX, offsetY] = getEdgeCenter({\n sourceX,\n sourceY,\n targetX,\n targetY,\n });\n return [`M ${sourceX},${sourceY}L ${targetX},${targetY}`, labelX, labelY, offsetX, offsetY];\n}\n\nconst handleDirections = {\n [Position.Left]: { x: -1, y: 0 },\n [Position.Right]: { x: 1, y: 0 },\n [Position.Top]: { x: 0, y: -1 },\n [Position.Bottom]: { x: 0, y: 1 },\n};\nconst getDirection = ({ source, sourcePosition = Position.Bottom, target, }) => {\n if (sourcePosition === Position.Left || sourcePosition === Position.Right) {\n return source.x < target.x ? { x: 1, y: 0 } : { x: -1, y: 0 };\n }\n return source.y < target.y ? { x: 0, y: 1 } : { x: 0, y: -1 };\n};\nconst distance = (a, b) => Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2));\n/*\n * With this function we try to mimic an orthogonal edge routing behaviour\n * It's not as good as a real orthogonal edge routing, but it's faster and good enough as a default for step and smooth step edges\n */\nfunction getPoints({ source, sourcePosition = Position.Bottom, target, targetPosition = Position.Top, center, offset, stepPosition, }) {\n const sourceDir = handleDirections[sourcePosition];\n const targetDir = handleDirections[targetPosition];\n const sourceGapped = { x: source.x + sourceDir.x * offset, y: source.y + sourceDir.y * offset };\n const targetGapped = { x: target.x + targetDir.x * offset, y: target.y + targetDir.y * offset };\n const dir = getDirection({\n source: sourceGapped,\n sourcePosition,\n target: targetGapped,\n });\n const dirAccessor = dir.x !== 0 ? 'x' : 'y';\n const currDir = dir[dirAccessor];\n let points = [];\n let centerX, centerY;\n const sourceGapOffset = { x: 0, y: 0 };\n const targetGapOffset = { x: 0, y: 0 };\n const [, , defaultOffsetX, defaultOffsetY] = getEdgeCenter({\n sourceX: source.x,\n sourceY: source.y,\n targetX: target.x,\n targetY: target.y,\n });\n // opposite handle positions, default case\n if (sourceDir[dirAccessor] * targetDir[dirAccessor] === -1) {\n if (dirAccessor === 'x') {\n // Primary direction is horizontal, so stepPosition affects X coordinate\n centerX = center.x ?? (sourceGapped.x + (targetGapped.x - sourceGapped.x) * stepPosition);\n centerY = center.y ?? (sourceGapped.y + targetGapped.y) / 2;\n }\n else {\n // Primary direction is vertical, so stepPosition affects Y coordinate \n centerX = center.x ?? (sourceGapped.x + targetGapped.x) / 2;\n centerY = center.y ?? (sourceGapped.y + (targetGapped.y - sourceGapped.y) * stepPosition);\n }\n /*\n * --->\n * |\n * >---\n */\n const verticalSplit = [\n { x: centerX, y: sourceGapped.y },\n { x: centerX, y: targetGapped.y },\n ];\n /*\n * |\n * ---\n * |\n */\n const horizontalSplit = [\n { x: sourceGapped.x, y: centerY },\n { x: targetGapped.x, y: centerY },\n ];\n if (sourceDir[dirAccessor] === currDir) {\n points = dirAccessor === 'x' ? verticalSplit : horizontalSplit;\n }\n else {\n points = dirAccessor === 'x' ? horizontalSplit : verticalSplit;\n }\n }\n else {\n // sourceTarget means we take x from source and y from target, targetSource is the opposite\n const sourceTarget = [{ x: sourceGapped.x, y: targetGapped.y }];\n const targetSource = [{ x: targetGapped.x, y: sourceGapped.y }];\n // this handles edges with same handle positions\n if (dirAccessor === 'x') {\n points = sourceDir.x === currDir ? targetSource : sourceTarget;\n }\n else {\n points = sourceDir.y === currDir ? sourceTarget : targetSource;\n }\n if (sourcePosition === targetPosition) {\n const diff = Math.abs(source[dirAccessor] - target[dirAccessor]);\n // if an edge goes from right to right for example (sourcePosition === targetPosition) and the distance between source.x and target.x is less than the offset, the added point and the gapped source/target will overlap. This leads to a weird edge path. To avoid this we add a gapOffset to the source/target\n if (diff <= offset) {\n const gapOffset = Math.min(offset - 1, offset - diff);\n if (sourceDir[dirAccessor] === currDir) {\n sourceGapOffset[dirAccessor] = (sourceGapped[dirAccessor] > source[dirAccessor] ? -1 : 1) * gapOffset;\n }\n else {\n targetGapOffset[dirAccessor] = (targetGapped[dirAccessor] > target[dirAccessor] ? -1 : 1) * gapOffset;\n }\n }\n }\n // these are conditions for handling mixed handle positions like Right -> Bottom for example\n if (sourcePosition !== targetPosition) {\n const dirAccessorOpposite = dirAccessor === 'x' ? 'y' : 'x';\n const isSameDir = sourceDir[dirAccessor] === targetDir[dirAccessorOpposite];\n const sourceGtTargetOppo = sourceGapped[dirAccessorOpposite] > targetGapped[dirAccessorOpposite];\n const sourceLtTargetOppo = sourceGapped[dirAccessorOpposite] < targetGapped[dirAccessorOpposite];\n const flipSourceTarget = (sourceDir[dirAccessor] === 1 && ((!isSameDir && sourceGtTargetOppo) || (isSameDir && sourceLtTargetOppo))) ||\n (sourceDir[dirAccessor] !== 1 && ((!isSameDir && sourceLtTargetOppo) || (isSameDir && sourceGtTargetOppo)));\n if (flipSourceTarget) {\n points = dirAccessor === 'x' ? sourceTarget : targetSource;\n }\n }\n const sourceGapPoint = { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y };\n const targetGapPoint = { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y };\n const maxXDistance = Math.max(Math.abs(sourceGapPoint.x - points[0].x), Math.abs(targetGapPoint.x - points[0].x));\n const maxYDistance = Math.max(Math.abs(sourceGapPoint.y - points[0].y), Math.abs(targetGapPoint.y - points[0].y));\n // we want to place the label on the longest segment of the edge\n if (maxXDistance >= maxYDistance) {\n centerX = (sourceGapPoint.x + targetGapPoint.x) / 2;\n centerY = points[0].y;\n }\n else {\n centerX = points[0].x;\n centerY = (sourceGapPoint.y + targetGapPoint.y) / 2;\n }\n }\n const pathPoints = [\n source,\n { x: sourceGapped.x + sourceGapOffset.x, y: sourceGapped.y + sourceGapOffset.y },\n ...points,\n { x: targetGapped.x + targetGapOffset.x, y: targetGapped.y + targetGapOffset.y },\n target,\n ];\n return [pathPoints, centerX, centerY, defaultOffsetX, defaultOffsetY];\n}\nfunction getBend(a, b, c, size) {\n const bendSize = Math.min(distance(a, b) / 2, distance(b, c) / 2, size);\n const { x, y } = b;\n // no bend\n if ((a.x === x && x === c.x) || (a.y === y && y === c.y)) {\n return `L${x} ${y}`;\n }\n // first segment is horizontal\n if (a.y === y) {\n const xDir = a.x < c.x ? -1 : 1;\n const yDir = a.y < c.y ? 1 : -1;\n return `L ${x + bendSize * xDir},${y}Q ${x},${y} ${x},${y + bendSize * yDir}`;\n }\n const xDir = a.x < c.x ? 1 : -1;\n const yDir = a.y < c.y ? -1 : 1;\n return `L ${x},${y + bendSize * yDir}Q ${x},${y} ${x + bendSize * xDir},${y}`;\n}\n/**\n * The `getSmoothStepPath` util returns everything you need to render a stepped path\n * between two nodes. The `borderRadius` property can be used to choose how rounded\n * the corners of those steps are.\n * @public\n * @returns A path string you can use in an SVG, the `labelX` and `labelY` position (center of path)\n * and `offsetX`, `offsetY` between source handle and label.\n *\n * - `path`: the path to use in an SVG `<path>` element.\n * - `labelX`: the `x` position you can use to render a label for this edge.\n * - `labelY`: the `y` position you can use to render a label for this edge.\n * - `offsetX`: the absolute difference between the source `x` position and the `x` position of the\n * middle of this path.\n * - `offsetY`: the absolute difference between the source `y` position and the `y` position of the\n * middle of this path.\n * @example\n * ```js\n * const source = { x: 0, y: 20 };\n * const target = { x: 150, y: 100 };\n *\n * const [path, labelX, labelY, offsetX, offsetY] = getSmoothStepPath({\n * sourceX: source.x,\n * sourceY: source.y,\n * sourcePosition: Position.Right,\n * targetX: target.x,\n * targetY: target.y,\n * targetPosition: Position.Left,\n * });\n * ```\n * @remarks This function returns a tuple (aka a fixed-size array) to make it easier to work with multiple edge paths at once.\n */\nfunction getSmoothStepPath({ sourceX, sourceY, sourcePosition = Position.Bottom, targetX, targetY, targetPosition = Position.Top, borderRadius = 5, centerX, centerY, offset = 20, stepPosition = 0.5, }) {\n const [points, labelX, labelY, offsetX, offsetY] = getPoints({\n source: { x: sourceX, y: sourceY },\n sourcePosition,\n target: { x: targetX, y: targetY },\n targetPosition,\n center: { x: centerX, y: centerY },\n offset,\n stepPosition,\n });\n const path = points.reduce((res, p, i) => {\n let segment = '';\n if (i > 0 && i < points.length - 1) {\n segment = getBend(points[i - 1], p, points[i + 1], borderRadius);\n }\n else {\n segment = `${i === 0 ? 'M' : 'L'}${p.x} ${p.y}`;\n }\n res += segment;\n return res;\n }, '');\n return [path, labelX, labelY, offsetX, offsetY];\n}\n\nfunction isNodeInitialized(node) {\n return (node &&\n !!(node.internals.handleBounds || node.handles?.length) &&\n !!(node.measured.width || node.width || node.initialWidth));\n}\nfunction getEdgePosition(params) {\n const { sourceNode, targetNode } = params;\n if (!isNodeInitialized(sourceNode) || !isNodeInitialized(targetNode)) {\n return null;\n }\n const sourceHandleBounds = sourceNode.internals.handleBounds || toHandleBounds(sourceNode.handles);\n const targetHandleBounds = targetNode.internals.handleBounds || toHandleBounds(targetNode.handles);\n const sourceHandle = getHandle$1(sourceHandleBounds?.source ?? [], params.sourceHandle);\n const targetHandle = getHandle$1(\n // when connection type is loose we can define all handles as sources and connect source -> source\n params.connectionMode === ConnectionMode.Strict\n ? targetHandleBounds?.target ?? []\n : (targetHandleBounds?.target ?? []).concat(targetHandleBounds?.source ?? []), params.targetHandle);\n if (!sourceHandle || !targetHandle) {\n params.onError?.('008', errorMessages['error008'](!sourceHandle ? 'source' : 'target', {\n id: params.id,\n sourceHandle: params.sourceHandle,\n targetHandle: params.targetHandle,\n }));\n return null;\n }\n const sourcePosition = sourceHandle?.position || Position.Bottom;\n const targetPosition = targetHandle?.position || Position.Top;\n const source = getHandlePosition(sourceNode, sourceHandle, sourcePosition);\n const target = getHandlePosition(targetNode, targetHandle, targetPosition);\n return {\n sourceX: source.x,\n sourceY: source.y,\n targetX: target.x,\n targetY: target.y,\n sourcePosition,\n targetPosition,\n };\n}\nfunction toHandleBounds(handles) {\n if (!handles) {\n return null;\n }\n const source = [];\n const target = [];\n for (const handle of handles) {\n handle.width = handle.width ?? 1;\n handle.height = handle.height ?? 1;\n if (handle.type === 'source') {\n source.push(handle);\n }\n else if (handle.type === 'target') {\n target.push(handle);\n }\n }\n return {\n source,\n target,\n };\n}\nfunction getHandlePosition(node, handle, fallbackPosition = Position.Left, center = false) {\n const x = (handle?.x ?? 0) + node.internals.positionAbsolute.x;\n const y = (handle?.y ?? 0) + node.internals.positionAbsolute.y;\n const { width, height } = handle ?? getNodeDimensions(node);\n if (center) {\n return { x: x + width / 2, y: y + height / 2 };\n }\n const position = handle?.position ?? fallbackPosition;\n switch (position) {\n case Position.Top:\n return { x: x + width / 2, y };\n case Position.Right:\n return { x: x + width, y: y + height / 2 };\n case Position.Bottom:\n return { x: x + width / 2, y: y + height };\n case Position.Left:\n return { x, y: y + height / 2 };\n }\n}\nfunction getHandle$1(bounds, handleId) {\n if (!bounds) {\n return null;\n }\n // if no handleId is given, we use the first handle, otherwise we check for the id\n return (!handleId ? bounds[0] : bounds.find((d) => d.id === handleId)) || null;\n}\n\nfunction getMarkerId(marker, id) {\n if (!marker) {\n return '';\n }\n if (typeof marker === 'string') {\n return marker;\n }\n const idPrefix = id ? `${id}__` : '';\n return `${idPrefix}${Object.keys(marker)\n .sort()\n .map((key) => `${key}=${marker[key]}`)\n .join('&')}`;\n}\nfunction createMarkerIds(edges, { id, defaultColor, defaultMarkerStart, defaultMarkerEnd, }) {\n const ids = new Set();\n return edges\n .reduce((markers, edge) => {\n [edge.markerStart || defaultMarkerStart, edge.markerEnd || defaultMarkerEnd].forEach((marker) => {\n if (marker && typeof marker === 'object') {\n const markerId = getMarkerId(marker, id);\n if (!ids.has(markerId)) {\n markers.push({ id: markerId, color: marker.color || defaultColor, ...marker });\n ids.add(markerId);\n }\n }\n });\n return markers;\n }, [])\n .sort((a, b) => a.id.localeCompare(b.id));\n}\n\nfunction getNodeToolbarTransform(nodeRect, viewport, position, offset, align) {\n let alignmentOffset = 0.5;\n if (align === 'start') {\n alignmentOffset = 0;\n }\n else if (align === 'end') {\n alignmentOffset = 1;\n }\n /*\n * position === Position.Top\n * we set the x any y position of the toolbar based on the nodes position\n */\n let pos = [\n (nodeRect.x + nodeRect.width * alignmentOffset) * viewport.zoom + viewport.x,\n nodeRect.y * viewport.zoom + viewport.y - offset,\n ];\n // and than shift it based on the alignment. The shift values are in %.\n let shift = [-100 * alignmentOffset, -100];\n switch (position) {\n case Position.Right:\n pos = [\n (nodeRect.x + nodeRect.width) * viewport.zoom + viewport.x + offset,\n (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y,\n ];\n shift = [0, -100 * alignmentOffset];\n break;\n case Position.Bottom:\n pos[1] = (nodeRect.y + nodeRect.height) * viewport.zoom + viewport.y + offset;\n shift[1] = 0;\n break;\n case Position.Left:\n pos = [\n nodeRect.x * viewport.zoom + viewport.x - offset,\n (nodeRect.y + nodeRect.height * alignmentOffset) * viewport.zoom + viewport.y,\n ];\n shift = [-100, -100 * alignmentOffset];\n break;\n }\n return `translate(${pos[0]}px, ${pos[1]}px) translate(${shift[0]}%, ${shift[1]}%)`;\n}\n\nconst alignXToPercent = {\n left: 0,\n center: 50,\n right: 100,\n};\nconst alignYToPercent = {\n top: 0,\n center: 50,\n bottom: 100,\n};\nfunction getEdgeToolbarTransform(x, y, zoom, alignX = 'center', alignY = 'center') {\n return `translate(${x}px, ${y}px) scale(${1 / zoom}) translate(${-(alignXToPercent[alignX] ?? 50)}%, ${-(alignYToPercent[alignY] ?? 50)}%)`;\n}\n\nconst SELECTED_NODE_Z = 1000;\nconst ROOT_PARENT_Z_INCREMENT = 10;\nconst defaultOptions = {\n nodeOrigin: [0, 0],\n nodeExtent: infiniteExtent,\n elevateNodesOnSelect: true,\n defaults: {},\n};\nconst adoptUserNodesDefaultOptions = {\n ...defaultOptions,\n checkEquality: true,\n};\nfunction mergeObjects(base, incoming) {\n const result = { ...base };\n for (const key in incoming) {\n if (incoming[key] !== undefined) {\n // typecast is safe here, because we check for undefined\n result[key] = incoming[key];\n }\n }\n return result;\n}\nfunction updateAbsolutePositions(nodeLookup, parentLookup, options) {\n const _options = mergeObjects(defaultOptions, options);\n for (const node of nodeLookup.values()) {\n if (node.parentId) {\n updateChildNode(node, nodeLookup, parentLookup, _options);\n }\n else {\n const positionWithOrigin = getNodePositionWithOrigin(node, _options.nodeOrigin);\n const extent = isCoordinateExtent(node.extent) ? node.extent : _options.nodeExtent;\n const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(node));\n node.internals.positionAbsolute = clampedPosition;\n }\n }\n}\nfunction parseHandles(userNode, internalNode) {\n if (!userNode.handles) {\n return !userNode.measured ? undefined : internalNode?.internals.handleBounds;\n }\n const source = [];\n const target = [];\n for (const handle of userNode.handles) {\n const handleBounds = {\n id: handle.id,\n width: handle.width ?? 1,\n height: handle.height ?? 1,\n nodeId: userNode.id,\n x: handle.x,\n y: handle.y,\n position: handle.position,\n type: handle.type,\n };\n if (handle.type === 'source') {\n source.push(handleBounds);\n }\n else if (handle.type === 'target') {\n target.push(handleBounds);\n }\n }\n return {\n source,\n target,\n };\n}\nfunction adoptUserNodes(nodes, nodeLookup, parentLookup, options) {\n const _options = mergeObjects(adoptUserNodesDefaultOptions, options);\n let rootParentIndex = { i: -1 };\n let nodesInitialized = nodes.length > 0;\n const tmpLookup = new Map(nodeLookup);\n const selectedNodeZ = _options?.elevateNodesOnSelect ? SELECTED_NODE_Z : 0;\n nodeLookup.clear();\n parentLookup.clear();\n for (const userNode of nodes) {\n let internalNode = tmpLookup.get(userNode.id);\n if (_options.checkEquality && userNode === internalNode?.internals.userNode) {\n nodeLookup.set(userNode.id, internalNode);\n }\n else {\n const positionWithOrigin = getNodePositionWithOrigin(userNode, _options.nodeOrigin);\n const extent = isCoordinateExtent(userNode.extent) ? userNode.extent : _options.nodeExtent;\n const clampedPosition = clampPosition(positionWithOrigin, extent, getNodeDimensions(userNode));\n internalNode = {\n ..._options.defaults,\n ...userNode,\n measured: {\n width: userNode.measured?.width,\n height: userNode.measured?.height,\n },\n internals: {\n positionAbsolute: clampedPosition,\n // if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured\n handleBounds: parseHandles(userNode, internalNode),\n z: calculateZ(userNode, selectedNodeZ),\n userNode,\n },\n };\n nodeLookup.set(userNode.id, internalNode);\n }\n if ((internalNode.measured === undefined ||\n internalNode.measured.width === undefined ||\n internalNode.measured.height === undefined) &&\n !internalNode.hidden) {\n nodesInitialized = false;\n }\n if (userNode.parentId) {\n updateChildNode(internalNode, nodeLookup, parentLookup, options, rootParentIndex);\n }\n }\n return nodesInitialized;\n}\nfunction updateParentLookup(node, parentLookup) {\n if (!node.parentId) {\n return;\n }\n const childNodes = parentLookup.get(node.parentId);\n if (childNodes) {\n childNodes.set(node.id, node);\n }\n else {\n parentLookup.set(node.parentId, new Map([[node.id, node]]));\n }\n}\n/**\n * Updates positionAbsolute and zIndex of a child node and the parentLookup.\n */\nfunction updateChildNode(node, nodeLookup, parentLookup, options, rootParentIndex) {\n const { elevateNodesOnSelect, nodeOrigin, nodeExtent } = mergeObjects(defaultOptions, options);\n const parentId = node.parentId;\n const parentNode = nodeLookup.get(parentId);\n if (!parentNode) {\n console.warn(`Parent node ${parentId} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);\n return;\n }\n updateParentLookup(node, parentLookup);\n // We just want to set the rootParentIndex for the first child\n if (rootParentIndex && !parentNode.parentId && parentNode.internals.rootParentIndex === undefined) {\n parentNode.internals.rootParentIndex = ++rootParentIndex.i;\n parentNode.internals.z = parentNode.internals.z + rootParentIndex.i * ROOT_PARENT_Z_INCREMENT;\n }\n // But we need to update rootParentIndex.i also when parent has not been updated\n if (rootParentIndex && parentNode.internals.rootParentIndex !== undefined) {\n rootParentIndex.i = parentNode.internals.rootParentIndex;\n }\n const selectedNodeZ = elevateNodesOnSelect ? SELECTED_NODE_Z : 0;\n const { x, y, z } = calculateChildXYZ(node, parentNode, nodeOrigin, nodeExtent, selectedNodeZ);\n const { positionAbsolute } = node.internals;\n const positionChanged = x !== positionAbsolute.x || y !== positionAbsolute.y;\n if (positionChanged || z !== node.internals.z) {\n // we create a new object to mark the node as updated\n nodeLookup.set(node.id, {\n ...node,\n internals: {\n ...node.internals,\n positionAbsolute: positionChanged ? { x, y } : positionAbsolute,\n z,\n },\n });\n }\n}\nfunction calculateZ(node, selectedNodeZ) {\n return (isNumeric(node.zIndex) ? node.zIndex : 0) + (node.selected ? selectedNodeZ : 0);\n}\nfunction calculateChildXYZ(childNode, parentNode, nodeOrigin, nodeExtent, selectedNodeZ) {\n const { x: parentX, y: parentY } = parentNode.internals.positionAbsolute;\n const childDimensions = getNodeDimensions(childNode);\n const positionWithOrigin = getNodePositionWithOrigin(childNode, nodeOrigin);\n const clampedPosition = isCoordinateExtent(childNode.extent)\n ? clampPosition(positionWithOrigin, childNode.extent, childDimensions)\n : positionWithOrigin;\n let absolutePosition = clampPosition({ x: parentX + clampedPosition.x, y: parentY + clampedPosition.y }, nodeExtent, childDimensions);\n if (childNode.extent === 'parent') {\n absolutePosition = clampPositionToParent(absolutePosition, childDimensions, parentNode);\n }\n const childZ = calculateZ(childNode, selectedNodeZ);\n const parentZ = parentNode.internals.z ?? 0;\n return {\n x: absolutePosition.x,\n y: absolutePosition.y,\n z: parentZ >= childZ ? parentZ + 1 : childZ,\n };\n}\nfunction handleExpandParent(children, nodeLookup, parentLookup, nodeOrigin = [0, 0]) {\n const changes = [];\n const parentExpansions = new Map();\n // determine the expanded rectangle the child nodes would take for each parent\n for (const child of children) {\n const parent = nodeLookup.get(child.parentId);\n if (!parent) {\n continue;\n }\n const parentRect = parentExpansions.get(child.parentId)?.expandedRect ?? nodeToRect(parent);\n const expandedRect = getBoundsOfRects(parentRect, child.rect);\n parentExpansions.set(child.parentId, { expandedRect, parent });\n }\n if (parentExpansions.size > 0) {\n parentExpansions.forEach(({ expandedRect, parent }, parentId) => {\n // determine the position & dimensions of the parent\n const positionAbsolute = parent.internals.positionAbsolute;\n const dimensions = getNodeDimensions(parent);\n const origin = parent.origin ?? nodeOrigin;\n // determine how much the parent expands in width and position\n const xChange = expandedRect.x < positionAbsolute.x ? Math.round(Math.abs(positionAbsolute.x - expandedRect.x)) : 0;\n const yChange = expandedRect.y < positionAbsolute.y ? Math.round(Math.abs(positionAbsolute.y - expandedRect.y)) : 0;\n const newWidth = Math.max(dimensions.width, Math.round(expandedRect.width));\n const newHeight = Math.max(dimensions.height, Math.round(expandedRect.height));\n const widthChange = (newWidth - dimensions.width) * origin[0];\n const heightChange = (newHeight - dimensions.height) * origin[1];\n // We need to correct the position of the parent node if the origin is not [0,0]\n if (xChange > 0 || yChange > 0 || widthChange || heightChange) {\n changes.push({\n id: parentId,\n type: 'position',\n position: {\n x: parent.position.x - xChange + widthChange,\n y: parent.position.y - yChange + heightChange,\n },\n });\n /*\n * We move all child nodes in the oppsite direction\n * so the x,y changes of the parent do not move the children\n */\n parentLookup.get(parentId)?.forEach((childNode) => {\n if (!children.some((child) => child.id === childNode.id)) {\n changes.push({\n id: childNode.id,\n type: 'position',\n position: {\n x: childNode.position.x + xChange,\n y: childNode.position.y + yChange,\n },\n });\n }\n });\n }\n // We need to correct the dimensions of the parent node if the origin is not [0,0]\n if (dimensions.width < expandedRect.width || dimensions.height < expandedRect.height || xChange || yChange) {\n changes.push({\n id: parentId,\n type: 'dimensions',\n setAttributes: true,\n dimensions: {\n width: newWidth + (xChange ? origin[0] * xChange - widthChange : 0),\n height: newHeight + (yChange ? origin[1] * yChange - heightChange : 0),\n },\n });\n }\n });\n }\n return changes;\n}\nfunction updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent) {\n const viewportNode = domNode?.querySelector('.xyflow__viewport');\n let updatedInternals = false;\n if (!viewportNode) {\n return { changes: [], updatedInternals };\n }\n const changes = [];\n const style = window.getComputedStyle(viewportNode);\n const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform);\n // in this array we collect nodes, that might trigger changes (like expanding parent)\n const parentExpandChildren = [];\n for (const update of updates.values()) {\n const node = nodeLookup.get(update.id);\n if (!node) {\n continue;\n }\n if (node.hidden) {\n nodeLookup.set(node.id, {\n ...node,\n internals: {\n ...node.internals,\n handleBounds: undefined,\n },\n });\n updatedInternals = true;\n continue;\n }\n const dimensions = getDimensions(update.nodeElement);\n const dimensionChanged = node.measured.width !== dimensions.width || node.measured.height !== dimensions.height;\n const doUpdate = !!(dimensions.width &&\n dimensions.height &&\n (dimensionChanged || !node.internals.handleBounds || update.force));\n if (doUpdate) {\n const nodeBounds = update.nodeElement.getBoundingClientRect();\n const extent = isCoordinateExtent(node.extent) ? node.extent : nodeExtent;\n let { positionAbsolute } = node.internals;\n if (node.parentId && node.extent === 'parent') {\n positionAbsolute = clampPositionToParent(positionAbsolute, dimensions, nodeLookup.get(node.parentId));\n }\n else if (extent) {\n positionAbsolute = clampPosition(positionAbsolute, extent, dimensions);\n }\n const newNode = {\n ...node,\n measured: dimensions,\n internals: {\n ...node.internals,\n positionAbsolute,\n handleBounds: {\n source: getHandleBounds('source', update.nodeElement, nodeBounds, zoom, node.id),\n target: getHandleBounds('target', update.nodeElement, nodeBounds, zoom, node.id),\n },\n },\n };\n nodeLookup.set(node.id, newNode);\n if (node.parentId) {\n updateChildNode(newNode, nodeLookup, parentLookup, { nodeOrigin });\n }\n updatedInternals = true;\n if (dimensionChanged) {\n changes.push({\n id: node.id,\n type: 'dimensions',\n dimensions,\n });\n if (node.expandParent && node.parentId) {\n parentExpandChildren.push({\n id: node.id,\n parentId: node.parentId,\n rect: nodeToRect(newNode, nodeOrigin),\n });\n }\n }\n }\n }\n if (parentExpandChildren.length > 0) {\n const parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, nodeOrigin);\n changes.push(...parentExpandChanges);\n }\n return { changes, updatedInternals };\n}\nasync function panBy({ delta, panZoom, transform, translateExtent, width, height, }) {\n if (!panZoom || (!delta.x && !delta.y)) {\n return Promise.resolve(false);\n }\n const nextViewport = await panZoom.setViewportConstrained({\n x: transform[0] + delta.x,\n y: transform[1] + delta.y,\n zoom: transform[2],\n }, [\n [0, 0],\n [width, height],\n ], translateExtent);\n const transformChanged = !!nextViewport &&\n (nextViewport.x !== transform[0] || nextViewport.y !== transform[1] || nextViewport.k !== transform[2]);\n return Promise.resolve(transformChanged);\n}\n/**\n * this function adds the connection to the connectionLookup\n * at the following keys: nodeId-type-handleId, nodeId-type and nodeId\n * @param type type of the connection\n * @param connection connection that should be added to the lookup\n * @param connectionKey at which key the connection should be added\n * @param connectionLookup reference to the connection lookup\n * @param nodeId nodeId of the connection\n * @param handleId handleId of the conneciton\n */\nfunction addConnectionToLookup(type, connection, connectionKey, connectionLookup, nodeId, handleId) {\n /*\n * We add the connection to the connectionLookup at the following keys\n * 1. nodeId, 2. nodeId-type, 3. nodeId-type-handleId\n * If the key already exists, we add the connection to the existing map\n */\n let key = nodeId;\n const nodeMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, nodeMap.set(connectionKey, connection));\n key = `${nodeId}-${type}`;\n const typeMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, typeMap.set(connectionKey, connection));\n if (handleId) {\n key = `${nodeId}-${type}-${handleId}`;\n const handleMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, handleMap.set(connectionKey, connection));\n }\n}\nfunction updateConnectionLookup(connectionLookup, edgeLookup, edges) {\n connectionLookup.clear();\n edgeLookup.clear();\n for (const edge of edges) {\n const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge;\n const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle };\n const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}`;\n const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}`;\n addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle);\n addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle);\n edgeLookup.set(edge.id, edge);\n }\n}\n\nfunction shallowNodeData(a, b) {\n if (a === null || b === null) {\n return false;\n }\n const _a = Array.isArray(a) ? a : [a];\n const _b = Array.isArray(b) ? b : [b];\n if (_a.length !== _b.length) {\n return false;\n }\n for (let i = 0; i < _a.length; i++) {\n if (_a[i].id !== _b[i].id || _a[i].type !== _b[i].type || !Object.is(_a[i].data, _b[i].data)) {\n return false;\n }\n }\n return true;\n}\n\nfunction isParentSelected(node, nodeLookup) {\n if (!node.parentId) {\n return false;\n }\n const parentNode = nodeLookup.get(node.parentId);\n if (!parentNode) {\n return false;\n }\n if (parentNode.selected) {\n return true;\n }\n return isParentSelected(parentNode, nodeLookup);\n}\nfunction hasSelector(target, selector, domNode) {\n let current = target;\n do {\n if (current?.matches?.(selector))\n return true;\n if (current === domNode)\n return false;\n current = current?.parentElement;\n } while (current);\n return false;\n}\n// looks for all selected nodes and created a NodeDragItem for each of them\nfunction getDragItems(nodeLookup, nodesDraggable, mousePos, nodeId) {\n const dragItems = new Map();\n for (const [id, node] of nodeLookup) {\n if ((node.selected || node.id === nodeId) &&\n (!node.parentId || !isParentSelected(node, nodeLookup)) &&\n (node.draggable || (nodesDraggable && typeof node.draggable === 'undefined'))) {\n const internalNode = nodeLookup.get(id);\n if (internalNode) {\n dragItems.set(id, {\n id,\n position: internalNode.position || { x: 0, y: 0 },\n distance: {\n x: mousePos.x - internalNode.internals.positionAbsolute.x,\n y: mousePos.y - internalNode.internals.positionAbsolute.y,\n },\n extent: internalNode.extent,\n parentId: internalNode.parentId,\n origin: internalNode.origin,\n expandParent: internalNode.expandParent,\n internals: {\n positionAbsolute: internalNode.internals.positionAbsolute || { x: 0, y: 0 },\n },\n measured: {\n width: internalNode.measured.width ?? 0,\n height: internalNode.measured.height ?? 0,\n },\n });\n }\n }\n }\n return dragItems;\n}\n/*\n * returns two params:\n * 1. the dragged node (or the first of the list, if we are dragging a node selection)\n * 2. array of selected nodes (for multi selections)\n */\nfunction getEventHandlerParams({ nodeId, dragItems, nodeLookup, dragging = true, }) {\n const nodesFromDragItems = [];\n for (const [id, dragItem] of dragItems) {\n const node = nodeLookup.get(id)?.internals.userNode;\n if (node) {\n nodesFromDragItems.push({\n ...node,\n position: dragItem.position,\n dragging,\n });\n }\n }\n if (!nodeId) {\n return [nodesFromDragItems[0], nodesFromDragItems];\n }\n const node = nodeLookup.get(nodeId)?.internals.userNode;\n return [\n !node\n ? nodesFromDragItems[0]\n : {\n ...node,\n position: dragItems.get(nodeId)?.position || node.position,\n dragging,\n },\n nodesFromDragItems,\n ];\n}\n/**\n * If a selection is being dragged we want to apply the same snap offset to all nodes in the selection.\n * This function calculates the snap offset based on the first node in the selection.\n */\nfunction calculateSnapOffset({ dragItems, snapGrid, x, y, }) {\n const refDragItem = dragItems.values().next().value;\n if (!refDragItem) {\n return null;\n }\n const refPos = {\n x: x - refDragItem.distance.x,\n y: y - refDragItem.distance.y,\n };\n const refPosSnapped = snapPosition(refPos, snapGrid);\n return {\n x: refPosSnapped.x - refPos.x,\n y: refPosSnapped.y - refPos.y,\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragStop, }) {\n let lastPos = { x: null, y: null };\n let autoPanId = 0;\n let dragItems = new Map();\n let autoPanStarted = false;\n let mousePosition = { x: 0, y: 0 };\n let containerBounds = null;\n let dragStarted = false;\n let d3Selection = null;\n let abortDrag = false; // prevents unintentional dragging on multitouch\n let nodePositionsChanged = false;\n // we store the last drag event to be able to use it in the update function\n let dragEvent = null;\n // public functions\n function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) {\n d3Selection = select(domNode);\n function updateNodes({ x, y }) {\n const { nodeLookup, nodeExtent, snapGrid, snapToGrid, nodeOrigin, onNodeDrag, onSelectionDrag, onError, updateNodePositions, } = getStoreItems();\n lastPos = { x, y };\n let hasChange = false;\n const isMultiDrag = dragItems.size > 1;\n const nodesBox = isMultiDrag && nodeExtent ? rectToBox(getInternalNodesBounds(dragItems)) : null;\n const multiDragSnapOffset = isMultiDrag && snapToGrid\n ? calculateSnapOffset({\n dragItems,\n snapGrid,\n x,\n y,\n })\n : null;\n for (const [id, dragItem] of dragItems) {\n /*\n * if the node is not in the nodeLookup anymore, it was probably deleted while dragging\n */\n if (!nodeLookup.has(id)) {\n continue;\n }\n let nextPosition = { x: x - dragItem.distance.x, y: y - dragItem.distance.y };\n if (snapToGrid) {\n nextPosition = multiDragSnapOffset\n ? {\n x: Math.round(nextPosition.x + multiDragSnapOffset.x),\n y: Math.round(nextPosition.y + multiDragSnapOffset.y),\n }\n : snapPosition(nextPosition, snapGrid);\n }\n let adjustedNodeExtent = null;\n if (isMultiDrag && nodeExtent && !dragItem.extent && nodesBox) {\n const { positionAbsolute } = dragItem.internals;\n const x1 = positionAbsolute.x - nodesBox.x + nodeExtent[0][0];\n const x2 = positionAbsolute.x + dragItem.measured.width - nodesBox.x2 + nodeExtent[1][0];\n const y1 = positionAbsolute.y - nodesBox.y + nodeExtent[0][1];\n const y2 = positionAbsolute.y + dragItem.measured.height - nodesBox.y2 + nodeExtent[1][1];\n adjustedNodeExtent = [\n [x1, y1],\n [x2, y2],\n ];\n }\n const { position, positionAbsolute } = calculateNodePosition({\n nodeId: id,\n nextPosition,\n nodeLookup,\n nodeExtent: adjustedNodeExtent ? adjustedNodeExtent : nodeExtent,\n nodeOrigin,\n onError,\n });\n // we want to make sure that we only fire a change event when there is a change\n hasChange = hasChange || dragItem.position.x !== position.x || dragItem.position.y !== position.y;\n dragItem.position = position;\n dragItem.internals.positionAbsolute = positionAbsolute;\n }\n nodePositionsChanged = nodePositionsChanged || hasChange;\n if (!hasChange) {\n return;\n }\n updateNodePositions(dragItems, true);\n if (dragEvent && (onDrag || onNodeDrag || (!nodeId && onSelectionDrag))) {\n const [currentNode, currentNodes] = getEventHandlerParams({\n nodeId,\n dragItems,\n nodeLookup,\n });\n onDrag?.(dragEvent, dragItems, currentNode, currentNodes);\n onNodeDrag?.(dragEvent, currentNode, currentNodes);\n if (!nodeId) {\n onSelectionDrag?.(dragEvent, currentNodes);\n }\n }\n }\n async function autoPan() {\n if (!containerBounds) {\n return;\n }\n const { transform, panBy, autoPanSpeed, autoPanOnNodeDrag } = getStoreItems();\n if (!autoPanOnNodeDrag) {\n autoPanStarted = false;\n cancelAnimationFrame(autoPanId);\n return;\n }\n const [xMovement, yMovement] = calcAutoPan(mousePosition, containerBounds, autoPanSpeed);\n if (xMovement !== 0 || yMovement !== 0) {\n lastPos.x = (lastPos.x ?? 0) - xMovement / transform[2];\n lastPos.y = (lastPos.y ?? 0) - yMovement / transform[2];\n if (await panBy({ x: xMovement, y: yMovement })) {\n updateNodes(lastPos);\n }\n }\n autoPanId = requestAnimationFrame(autoPan);\n }\n function startDrag(event) {\n const { nodeLookup, multiSelectionActive, nodesDraggable, transform, snapGrid, snapToGrid, selectNodesOnDrag, onNodeDragStart, onSelectionDragStart, unselectNodesAndEdges, } = getStoreItems();\n dragStarted = true;\n if ((!selectNodesOnDrag || !isSelectable) && !multiSelectionActive && nodeId) {\n if (!nodeLookup.get(nodeId)?.selected) {\n // we need to reset selected nodes when selectNodesOnDrag=false\n unselectNodesAndEdges();\n }\n }\n if (isSelectable && selectNodesOnDrag && nodeId) {\n onNodeMouseDown?.(nodeId);\n }\n const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n lastPos = pointerPos;\n dragItems = getDragItems(nodeLookup, nodesDraggable, pointerPos, nodeId);\n if (dragItems.size > 0 && (onDragStart || onNodeDragStart || (!nodeId && onSelectionDragStart))) {\n const [currentNode, currentNodes] = getEventHandlerParams({\n nodeId,\n dragItems,\n nodeLookup,\n });\n onDragStart?.(event.sourceEvent, dragItems, currentNode, currentNodes);\n onNodeDragStart?.(event.sourceEvent, currentNode, currentNodes);\n if (!nodeId) {\n onSelectionDragStart?.(event.sourceEvent, currentNodes);\n }\n }\n }\n const d3DragInstance = drag()\n .clickDistance(nodeClickDistance)\n .on('start', (event) => {\n const { domNode, nodeDragThreshold, transform, snapGrid, snapToGrid } = getStoreItems();\n containerBounds = domNode?.getBoundingClientRect() || null;\n abortDrag = false;\n nodePositionsChanged = false;\n dragEvent = event.sourceEvent;\n if (nodeDragThreshold === 0) {\n startDrag(event);\n }\n const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n lastPos = pointerPos;\n mousePosition = getEventPosition(event.sourceEvent, containerBounds);\n })\n .on('drag', (event) => {\n const { autoPanOnNodeDrag, transform, snapGrid, snapToGrid, nodeDragThreshold, nodeLookup } = getStoreItems();\n const pointerPos = getPointerPosition(event.sourceEvent, { transform, snapGrid, snapToGrid, containerBounds });\n dragEvent = event.sourceEvent;\n if ((event.sourceEvent.type === 'touchmove' && event.sourceEvent.touches.length > 1) ||\n // if user deletes a node while dragging, we need to abort the drag to prevent errors\n (nodeId && !nodeLookup.has(nodeId))) {\n abortDrag = true;\n }\n if (abortDrag) {\n return;\n }\n if (!autoPanStarted && autoPanOnNodeDrag && dragStarted) {\n autoPanStarted = true;\n autoPan();\n }\n if (!dragStarted) {\n // Calculate distance in client coordinates for consistent drag threshold behavior across zoom levels\n const currentMousePosition = getEventPosition(event.sourceEvent, containerBounds);\n const x = currentMousePosition.x - mousePosition.x;\n const y = currentMousePosition.y - mousePosition.y;\n const distance = Math.sqrt(x * x + y * y);\n if (distance > nodeDragThreshold) {\n startDrag(event);\n }\n }\n // skip events without movement\n if ((lastPos.x !== pointerPos.xSnapped || lastPos.y !== pointerPos.ySnapped) && dragItems && dragStarted) {\n mousePosition = getEventPosition(event.sourceEvent, containerBounds);\n updateNodes(pointerPos);\n }\n })\n .on('end', (event) => {\n if (!dragStarted || abortDrag) {\n return;\n }\n autoPanStarted = false;\n dragStarted = false;\n cancelAnimationFrame(autoPanId);\n if (dragItems.size > 0) {\n const { nodeLookup, updateNodePositions, onNodeDragStop, onSelectionDragStop } = getStoreItems();\n if (nodePositionsChanged) {\n updateNodePositions(dragItems, false);\n nodePositionsChanged = false;\n }\n if (onDragStop || onNodeDragStop || (!nodeId && onSelectionDragStop)) {\n const [currentNode, currentNodes] = getEventHandlerParams({\n nodeId,\n dragItems,\n nodeLookup,\n dragging: false,\n });\n onDragStop?.(event.sourceEvent, dragItems, currentNode, currentNodes);\n onNodeDragStop?.(event.sourceEvent, currentNode, currentNodes);\n if (!nodeId) {\n onSelectionDragStop?.(event.sourceEvent, currentNodes);\n }\n }\n }\n })\n .filter((event) => {\n const target = event.target;\n const isDraggable = !event.button &&\n (!noDragClassName || !hasSelector(target, `.${noDragClassName}`, domNode)) &&\n (!handleSelector || hasSelector(target, handleSelector, domNode));\n return isDraggable;\n });\n d3Selection.call(d3DragInstance);\n }\n function destroy() {\n d3Selection?.on('.drag', null);\n }\n return {\n update,\n destroy,\n };\n}\n\nfunction getNodesWithinDistance(position, nodeLookup, distance) {\n const nodes = [];\n const rect = {\n x: position.x - distance,\n y: position.y - distance,\n width: distance * 2,\n height: distance * 2,\n };\n for (const node of nodeLookup.values()) {\n if (getOverlappingArea(rect, nodeToRect(node)) > 0) {\n nodes.push(node);\n }\n }\n return nodes;\n}\n/*\n * this distance is used for the area around the user pointer\n * while doing a connection for finding the closest nodes\n */\nconst ADDITIONAL_DISTANCE = 250;\nfunction getClosestHandle(position, connectionRadius, nodeLookup, fromHandle) {\n let closestHandles = [];\n let minDistance = Infinity;\n const closeNodes = getNodesWithinDistance(position, nodeLookup, connectionRadius + ADDITIONAL_DISTANCE);\n for (const node of closeNodes) {\n const allHandles = [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];\n for (const handle of allHandles) {\n // if the handle is the same as the fromHandle we skip it\n if (fromHandle.nodeId === handle.nodeId && fromHandle.type === handle.type && fromHandle.id === handle.id) {\n continue;\n }\n // determine absolute position of the handle\n const { x, y } = getHandlePosition(node, handle, handle.position, true);\n const distance = Math.sqrt(Math.pow(x - position.x, 2) + Math.pow(y - position.y, 2));\n if (distance > connectionRadius) {\n continue;\n }\n if (distance < minDistance) {\n closestHandles = [{ ...handle, x, y }];\n minDistance = distance;\n }\n else if (distance === minDistance) {\n // when multiple handles are on the same distance we collect all of them\n closestHandles.push({ ...handle, x, y });\n }\n }\n }\n if (!closestHandles.length) {\n return null;\n }\n // when multiple handles overlay each other we prefer the opposite handle\n if (closestHandles.length > 1) {\n const oppositeHandleType = fromHandle.type === 'source' ? 'target' : 'source';\n return closestHandles.find((handle) => handle.type === oppositeHandleType) ?? closestHandles[0];\n }\n return closestHandles[0];\n}\nfunction getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode, withAbsolutePosition = false) {\n const node = nodeLookup.get(nodeId);\n if (!node) {\n return null;\n }\n const handles = connectionMode === 'strict'\n ? node.internals.handleBounds?.[handleType]\n : [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];\n const handle = (handleId ? handles?.find((h) => h.id === handleId) : handles?.[0]) ?? null;\n return handle && withAbsolutePosition\n ? { ...handle, ...getHandlePosition(node, handle, handle.position, true) }\n : handle;\n}\nfunction getHandleType(edgeUpdaterType, handleDomNode) {\n if (edgeUpdaterType) {\n return edgeUpdaterType;\n }\n else if (handleDomNode?.classList.contains('target')) {\n return 'target';\n }\n else if (handleDomNode?.classList.contains('source')) {\n return 'source';\n }\n return null;\n}\nfunction isConnectionValid(isInsideConnectionRadius, isHandleValid) {\n let isValid = null;\n if (isHandleValid) {\n isValid = true;\n }\n else if (isInsideConnectionRadius && !isHandleValid) {\n isValid = false;\n }\n return isValid;\n}\n\nconst alwaysValid = () => true;\nfunction onPointerDown(event, { connectionMode, connectionRadius, handleId, nodeId, edgeUpdaterType, isTarget, domNode, nodeLookup, lib, autoPanOnConnect, flowId, panBy, cancelConnection, onConnectStart, onConnect, onConnectEnd, isValidConnection = alwaysValid, onReconnectEnd, updateConnection, getTransform, getFromHandle, autoPanSpeed, dragThreshold = 1, handleDomNode, }) {\n // when xyflow is used inside a shadow root we can't use document\n const doc = getHostForElement(event.target);\n let autoPanId = 0;\n let closestHandle;\n const { x, y } = getEventPosition(event);\n const handleType = getHandleType(edgeUpdaterType, handleDomNode);\n const containerBounds = domNode?.getBoundingClientRect();\n let connectionStarted = false;\n if (!containerBounds || !handleType) {\n return;\n }\n const fromHandleInternal = getHandle(nodeId, handleType, handleId, nodeLookup, connectionMode);\n if (!fromHandleInternal) {\n return;\n }\n let position = getEventPosition(event, containerBounds);\n let autoPanStarted = false;\n let connection = null;\n let isValid = false;\n let resultHandleDomNode = null;\n // when the user is moving the mouse close to the edge of the canvas while connecting we move the canvas\n function autoPan() {\n if (!autoPanOnConnect || !containerBounds) {\n return;\n }\n const [x, y] = calcAutoPan(position, containerBounds, autoPanSpeed);\n panBy({ x, y });\n autoPanId = requestAnimationFrame(autoPan);\n }\n // Stays the same for all consecutive pointermove events\n const fromHandle = {\n ...fromHandleInternal,\n nodeId,\n type: handleType,\n position: fromHandleInternal.position,\n };\n const fromNodeInternal = nodeLookup.get(nodeId);\n const from = getHandlePosition(fromNodeInternal, fromHandle, Position.Left, true);\n let previousConnection = {\n inProgress: true,\n isValid: null,\n from,\n fromHandle,\n fromPosition: fromHandle.position,\n fromNode: fromNodeInternal,\n to: position,\n toHandle: null,\n toPosition: oppositePosition[fromHandle.position],\n toNode: null,\n pointer: position,\n };\n function startConnection() {\n connectionStarted = true;\n updateConnection(previousConnection);\n onConnectStart?.(event, { nodeId, handleId, handleType });\n }\n if (dragThreshold === 0) {\n startConnection();\n }\n function onPointerMove(event) {\n if (!connectionStarted) {\n const { x: evtX, y: evtY } = getEventPosition(event);\n const dx = evtX - x;\n const dy = evtY - y;\n const nextConnectionStarted = dx * dx + dy * dy > dragThreshold * dragThreshold;\n if (!nextConnectionStarted) {\n return;\n }\n startConnection();\n }\n if (!getFromHandle() || !fromHandle) {\n onPointerUp(event);\n return;\n }\n const transform = getTransform();\n position = getEventPosition(event, containerBounds);\n closestHandle = getClosestHandle(pointToRendererPoint(position, transform, false, [1, 1]), connectionRadius, nodeLookup, fromHandle);\n if (!autoPanStarted) {\n autoPan();\n autoPanStarted = true;\n }\n const result = isValidHandle(event, {\n handle: closestHandle,\n connectionMode,\n fromNodeId: nodeId,\n fromHandleId: handleId,\n fromType: isTarget ? 'target' : 'source',\n isValidConnection,\n doc,\n lib,\n flowId,\n nodeLookup,\n });\n resultHandleDomNode = result.handleDomNode;\n connection = result.connection;\n isValid = isConnectionValid(!!closestHandle, result.isValid);\n const newConnection = {\n // from stays the same\n ...previousConnection,\n isValid,\n to: result.toHandle && isValid\n ? rendererPointToPoint({ x: result.toHandle.x, y: result.toHandle.y }, transform)\n : position,\n toHandle: result.toHandle,\n toPosition: isValid && result.toHandle ? result.toHandle.position : oppositePosition[fromHandle.position],\n toNode: result.toHandle ? nodeLookup.get(result.toHandle.nodeId) : null,\n pointer: position,\n };\n updateConnection(newConnection);\n previousConnection = newConnection;\n }\n function onPointerUp(event) {\n // Prevent multi-touch aborting connection\n if ('touches' in event && event.touches.length > 0) {\n return;\n }\n if (connectionStarted) {\n if ((closestHandle || resultHandleDomNode) && connection && isValid) {\n onConnect?.(connection);\n }\n /*\n * it's important to get a fresh reference from the store here\n * in order to get the latest state of onConnectEnd\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { inProgress, ...connectionState } = previousConnection;\n const finalConnectionState = {\n ...connectionState,\n toPosition: previousConnection.toHandle ? previousConnection.toPosition : null,\n };\n onConnectEnd?.(event, finalConnectionState);\n if (edgeUpdaterType) {\n onReconnectEnd?.(event, finalConnectionState);\n }\n }\n cancelConnection();\n cancelAnimationFrame(autoPanId);\n autoPanStarted = false;\n isValid = false;\n connection = null;\n resultHandleDomNode = null;\n doc.removeEventListener('mousemove', onPointerMove);\n doc.removeEventListener('mouseup', onPointerUp);\n doc.removeEventListener('touchmove', onPointerMove);\n doc.removeEventListener('touchend', onPointerUp);\n }\n doc.addEventListener('mousemove', onPointerMove);\n doc.addEventListener('mouseup', onPointerUp);\n doc.addEventListener('touchmove', onPointerMove);\n doc.addEventListener('touchend', onPointerUp);\n}\n// checks if and returns connection in fom of an object { source: 123, target: 312 }\nfunction isValidHandle(event, { handle, connectionMode, fromNodeId, fromHandleId, fromType, doc, lib, flowId, isValidConnection = alwaysValid, nodeLookup, }) {\n const isTarget = fromType === 'target';\n const handleDomNode = handle\n ? doc.querySelector(`.${lib}-flow__handle[data-id=\"${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}\"]`)\n : null;\n const { x, y } = getEventPosition(event);\n const handleBelow = doc.elementFromPoint(x, y);\n /*\n * we always want to prioritize the handle below the mouse cursor over the closest distance handle,\n * because it could be that the center of another handle is closer to the mouse pointer than the handle below the cursor\n */\n const handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode;\n const result = {\n handleDomNode: handleToCheck,\n isValid: false,\n connection: null,\n toHandle: null,\n };\n if (handleToCheck) {\n const handleType = getHandleType(undefined, handleToCheck);\n const handleNodeId = handleToCheck.getAttribute('data-nodeid');\n const handleId = handleToCheck.getAttribute('data-handleid');\n const connectable = handleToCheck.classList.contains('connectable');\n const connectableEnd = handleToCheck.classList.contains('connectableend');\n if (!handleNodeId || !handleType) {\n return result;\n }\n const connection = {\n source: isTarget ? handleNodeId : fromNodeId,\n sourceHandle: isTarget ? handleId : fromHandleId,\n target: isTarget ? fromNodeId : handleNodeId,\n targetHandle: isTarget ? fromHandleId : handleId,\n };\n result.connection = connection;\n const isConnectable = connectable && connectableEnd;\n // in strict mode we don't allow target to target or source to source connections\n const isValid = isConnectable &&\n (connectionMode === ConnectionMode.Strict\n ? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target')\n : handleNodeId !== fromNodeId || handleId !== fromHandleId);\n result.isValid = isValid && isValidConnection(connection);\n result.toHandle = getHandle(handleNodeId, handleType, handleId, nodeLookup, connectionMode, true);\n }\n return result;\n}\nconst XYHandle = {\n onPointerDown,\n isValid: isValidHandle,\n};\n\nfunction XYMinimap({ domNode, panZoom, getTransform, getViewScale }) {\n const selection = select(domNode);\n function update({ translateExtent, width, height, zoomStep = 1, pannable = true, zoomable = true, inversePan = false, }) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const zoomHandler = (event) => {\n if (event.sourceEvent.type !== 'wheel' || !panZoom) {\n return;\n }\n const transform = getTransform();\n const factor = event.sourceEvent.ctrlKey && isMacOs() ? 10 : 1;\n const pinchDelta = -event.sourceEvent.deltaY *\n (event.sourceEvent.deltaMode === 1 ? 0.05 : event.sourceEvent.deltaMode ? 1 : 0.002) *\n zoomStep;\n const nextZoom = transform[2] * Math.pow(2, pinchDelta * factor);\n panZoom.scaleTo(nextZoom);\n };\n let panStart = [0, 0];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const panStartHandler = (event) => {\n if (event.sourceEvent.type === 'mousedown' || event.sourceEvent.type === 'touchstart') {\n panStart = [\n event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX,\n event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY,\n ];\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const panHandler = (event) => {\n const transform = getTransform();\n if ((event.sourceEvent.type !== 'mousemove' && event.sourceEvent.type !== 'touchmove') || !panZoom) {\n return;\n }\n const panCurrent = [\n event.sourceEvent.clientX ?? event.sourceEvent.touches[0].clientX,\n event.sourceEvent.clientY ?? event.sourceEvent.touches[0].clientY,\n ];\n const panDelta = [panCurrent[0] - panStart[0], panCurrent[1] - panStart[1]];\n panStart = panCurrent;\n const moveScale = getViewScale() * Math.max(transform[2], Math.log(transform[2])) * (inversePan ? -1 : 1);\n const position = {\n x: transform[0] - panDelta[0] * moveScale,\n y: transform[1] - panDelta[1] * moveScale,\n };\n const extent = [\n [0, 0],\n [width, height],\n ];\n panZoom.setViewportConstrained({\n x: position.x,\n y: position.y,\n zoom: transform[2],\n }, extent, translateExtent);\n };\n const zoomAndPanHandler = zoom()\n .on('start', panStartHandler)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .on('zoom', pannable ? panHandler : null)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n .on('zoom.wheel', zoomable ? zoomHandler : null);\n selection.call(zoomAndPanHandler, {});\n }\n function destroy() {\n selection.on('zoom', null);\n }\n return {\n update,\n destroy,\n pointer,\n };\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst transformToViewport = (transform) => ({\n x: transform.x,\n y: transform.y,\n zoom: transform.k,\n});\nconst viewportToTransform = ({ x, y, zoom }) => zoomIdentity.translate(x, y).scale(zoom);\nconst isWrappedWithClass = (event, className) => event.target.closest(`.${className}`);\nconst isRightClickPan = (panOnDrag, usedButton) => usedButton === 2 && Array.isArray(panOnDrag) && panOnDrag.includes(2);\n// taken from d3-ease: https://github.com/d3/d3-ease/blob/main/src/cubic.js\nconst defaultEase = (t) => ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\nconst getD3Transition = (selection, duration = 0, ease = defaultEase, onEnd = () => { }) => {\n const hasDuration = typeof duration === 'number' && duration > 0;\n if (!hasDuration) {\n onEnd();\n }\n return hasDuration ? selection.transition().duration(duration).ease(ease).on('end', onEnd) : selection;\n};\nconst wheelDelta = (event) => {\n const factor = event.ctrlKey && isMacOs() ? 10 : 1;\n return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002) * factor;\n};\n\nfunction createPanOnScrollHandler({ zoomPanValues, noWheelClassName, d3Selection, d3Zoom, panOnScrollMode, panOnScrollSpeed, zoomOnPinch, onPanZoomStart, onPanZoom, onPanZoomEnd, }) {\n return (event) => {\n if (isWrappedWithClass(event, noWheelClassName)) {\n if (event.ctrlKey) {\n event.preventDefault(); // stop native page zoom for pinch zooming\n }\n return false;\n }\n event.preventDefault();\n event.stopImmediatePropagation();\n const currentZoom = d3Selection.property('__zoom').k || 1;\n // macos sets ctrlKey=true for pinch gesture on a trackpad\n if (event.ctrlKey && zoomOnPinch) {\n const point = pointer(event);\n const pinchDelta = wheelDelta(event);\n const zoom = currentZoom * Math.pow(2, pinchDelta);\n // @ts-ignore\n d3Zoom.scaleTo(d3Selection, zoom, point, event);\n return;\n }\n /*\n * increase scroll speed in firefox\n * firefox: deltaMode === 1; chrome: deltaMode === 0\n */\n const deltaNormalize = event.deltaMode === 1 ? 20 : 1;\n let deltaX = panOnScrollMode === PanOnScrollMode.Vertical ? 0 : event.deltaX * deltaNormalize;\n let deltaY = panOnScrollMode === PanOnScrollMode.Horizontal ? 0 : event.deltaY * deltaNormalize;\n // this enables vertical scrolling with shift + scroll on windows\n if (!isMacOs() && event.shiftKey && panOnScrollMode !== PanOnScrollMode.Vertical) {\n deltaX = event.deltaY * deltaNormalize;\n deltaY = 0;\n }\n d3Zoom.translateBy(d3Selection, -(deltaX / currentZoom) * panOnScrollSpeed, -(deltaY / currentZoom) * panOnScrollSpeed, \n // @ts-ignore\n { internal: true });\n const nextViewport = transformToViewport(d3Selection.property('__zoom'));\n clearTimeout(zoomPanValues.panScrollTimeout);\n /*\n * for pan on scroll we need to handle the event calls on our own\n * we can't use the start, zoom and end events from d3-zoom\n * because start and move gets called on every scroll event and not once at the beginning\n */\n if (!zoomPanValues.isPanScrolling) {\n zoomPanValues.isPanScrolling = true;\n onPanZoomStart?.(event, nextViewport);\n }\n else {\n onPanZoom?.(event, nextViewport);\n zoomPanValues.panScrollTimeout = setTimeout(() => {\n onPanZoomEnd?.(event, nextViewport);\n zoomPanValues.isPanScrolling = false;\n }, 150);\n }\n };\n}\nfunction createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }) {\n return function (event, d) {\n const isWheel = event.type === 'wheel';\n // we still want to enable pinch zooming even if preventScrolling is set to false\n const preventZoom = !preventScrolling && isWheel && !event.ctrlKey;\n const hasNoWheelClass = isWrappedWithClass(event, noWheelClassName);\n // if user is pinch zooming above a nowheel element, we don't want the browser to zoom\n if (event.ctrlKey && isWheel && hasNoWheelClass) {\n event.preventDefault();\n }\n if (preventZoom || hasNoWheelClass) {\n return null;\n }\n event.preventDefault();\n d3ZoomHandler.call(this, event, d);\n };\n}\nfunction createPanZoomStartHandler({ zoomPanValues, onDraggingChange, onPanZoomStart }) {\n return (event) => {\n if (event.sourceEvent?.internal) {\n return;\n }\n const viewport = transformToViewport(event.transform);\n // we need to remember it here, because it's always 0 in the \"zoom\" event\n zoomPanValues.mouseButton = event.sourceEvent?.button || 0;\n zoomPanValues.isZoomingOrPanning = true;\n zoomPanValues.prevViewport = viewport;\n if (event.sourceEvent?.type === 'mousedown') {\n onDraggingChange(true);\n }\n if (onPanZoomStart) {\n onPanZoomStart?.(event.sourceEvent, viewport);\n }\n };\n}\nfunction createPanZoomHandler({ zoomPanValues, panOnDrag, onPaneContextMenu, onTransformChange, onPanZoom, }) {\n return (event) => {\n zoomPanValues.usedRightMouseButton = !!(onPaneContextMenu && isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0));\n if (!event.sourceEvent?.sync) {\n onTransformChange([event.transform.x, event.transform.y, event.transform.k]);\n }\n if (onPanZoom && !event.sourceEvent?.internal) {\n onPanZoom?.(event.sourceEvent, transformToViewport(event.transform));\n }\n };\n}\nfunction createPanZoomEndHandler({ zoomPanValues, panOnDrag, panOnScroll, onDraggingChange, onPanZoomEnd, onPaneContextMenu, }) {\n return (event) => {\n if (event.sourceEvent?.internal) {\n return;\n }\n zoomPanValues.isZoomingOrPanning = false;\n if (onPaneContextMenu &&\n isRightClickPan(panOnDrag, zoomPanValues.mouseButton ?? 0) &&\n !zoomPanValues.usedRightMouseButton &&\n event.sourceEvent) {\n onPaneContextMenu(event.sourceEvent);\n }\n zoomPanValues.usedRightMouseButton = false;\n onDraggingChange(false);\n if (onPanZoomEnd) {\n const viewport = transformToViewport(event.transform);\n zoomPanValues.prevViewport = viewport;\n clearTimeout(zoomPanValues.timerId);\n zoomPanValues.timerId = setTimeout(() => {\n onPanZoomEnd?.(event.sourceEvent, viewport);\n }, \n // we need a setTimeout for panOnScroll to supress multiple end events fired during scroll\n panOnScroll ? 150 : 0);\n }\n };\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nfunction createFilter({ zoomActivationKeyPressed, zoomOnScroll, zoomOnPinch, panOnDrag, panOnScroll, zoomOnDoubleClick, userSelectionActive, noWheelClassName, noPanClassName, lib, connectionInProgress, }) {\n return (event) => {\n const zoomScroll = zoomActivationKeyPressed || zoomOnScroll;\n const pinchZoom = zoomOnPinch && event.ctrlKey;\n const isWheelEvent = event.type === 'wheel';\n if (event.button === 1 &&\n event.type === 'mousedown' &&\n (isWrappedWithClass(event, `${lib}-flow__node`) || isWrappedWithClass(event, `${lib}-flow__edge`))) {\n return true;\n }\n // if all interactions are disabled, we prevent all zoom events\n if (!panOnDrag && !zoomScroll && !panOnScroll && !zoomOnDoubleClick && !zoomOnPinch) {\n return false;\n }\n // during a selection we prevent all other interactions\n if (userSelectionActive) {\n return false;\n }\n // we want to disable pinch-zooming while making a connection\n if (connectionInProgress && !isWheelEvent) {\n return false;\n }\n // if the target element is inside an element with the nowheel class, we prevent zooming\n if (isWrappedWithClass(event, noWheelClassName) && isWheelEvent) {\n return false;\n }\n // if the target element is inside an element with the nopan class, we prevent panning\n if (isWrappedWithClass(event, noPanClassName) &&\n (!isWheelEvent || (panOnScroll && isWheelEvent && !zoomActivationKeyPressed))) {\n return false;\n }\n if (!zoomOnPinch && event.ctrlKey && isWheelEvent) {\n return false;\n }\n if (!zoomOnPinch && event.type === 'touchstart' && event.touches?.length > 1) {\n event.preventDefault(); // if you manage to start with 2 touches, we prevent native zoom\n return false;\n }\n // when there is no scroll handling enabled, we prevent all wheel events\n if (!zoomScroll && !panOnScroll && !pinchZoom && isWheelEvent) {\n return false;\n }\n // if the pane is not movable, we prevent dragging it with mousestart or touchstart\n if (!panOnDrag && (event.type === 'mousedown' || event.type === 'touchstart')) {\n return false;\n }\n // if the pane is only movable using allowed clicks\n if (Array.isArray(panOnDrag) && !panOnDrag.includes(event.button) && event.type === 'mousedown') {\n return false;\n }\n // We only allow right clicks if pan on drag is set to right click\n const buttonAllowed = (Array.isArray(panOnDrag) && panOnDrag.includes(event.button)) || !event.button || event.button <= 1;\n // default filter for d3-zoom\n return (!event.ctrlKey || isWheelEvent) && buttonAllowed;\n };\n}\n\nfunction XYPanZoom({ domNode, minZoom, maxZoom, translateExtent, viewport, onPanZoom, onPanZoomStart, onPanZoomEnd, onDraggingChange, }) {\n const zoomPanValues = {\n isZoomingOrPanning: false,\n usedRightMouseButton: false,\n prevViewport: { x: 0, y: 0, zoom: 0 },\n mouseButton: 0,\n timerId: undefined,\n panScrollTimeout: undefined,\n isPanScrolling: false,\n };\n const bbox = domNode.getBoundingClientRect();\n const d3ZoomInstance = zoom().scaleExtent([minZoom, maxZoom]).translateExtent(translateExtent);\n const d3Selection = select(domNode).call(d3ZoomInstance);\n setViewportConstrained({\n x: viewport.x,\n y: viewport.y,\n zoom: clamp(viewport.zoom, minZoom, maxZoom),\n }, [\n [0, 0],\n [bbox.width, bbox.height],\n ], translateExtent);\n const d3ZoomHandler = d3Selection.on('wheel.zoom');\n const d3DblClickZoomHandler = d3Selection.on('dblclick.zoom');\n d3ZoomInstance.wheelDelta(wheelDelta);\n function setTransform(transform, options) {\n if (d3Selection) {\n return new Promise((resolve) => {\n d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).transform(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), transform);\n });\n }\n return Promise.resolve(false);\n }\n // public functions\n function update({ noWheelClassName, noPanClassName, onPaneContextMenu, userSelectionActive, panOnScroll, panOnDrag, panOnScrollMode, panOnScrollSpeed, preventScrolling, zoomOnPinch, zoomOnScroll, zoomOnDoubleClick, zoomActivationKeyPressed, lib, onTransformChange, connectionInProgress, paneClickDistance, selectionOnDrag, }) {\n if (userSelectionActive && !zoomPanValues.isZoomingOrPanning) {\n destroy();\n }\n const isPanOnScroll = panOnScroll && !zoomActivationKeyPressed && !userSelectionActive;\n d3ZoomInstance.clickDistance(selectionOnDrag ? Infinity : !isNumeric(paneClickDistance) || paneClickDistance < 0 ? 0 : paneClickDistance);\n const wheelHandler = isPanOnScroll\n ? createPanOnScrollHandler({\n zoomPanValues,\n noWheelClassName,\n d3Selection,\n d3Zoom: d3ZoomInstance,\n panOnScrollMode,\n panOnScrollSpeed,\n zoomOnPinch,\n onPanZoomStart,\n onPanZoom,\n onPanZoomEnd,\n })\n : createZoomOnScrollHandler({\n noWheelClassName,\n preventScrolling,\n d3ZoomHandler,\n });\n d3Selection.on('wheel.zoom', wheelHandler, { passive: false });\n if (!userSelectionActive) {\n // pan zoom start\n const startHandler = createPanZoomStartHandler({\n zoomPanValues,\n onDraggingChange,\n onPanZoomStart,\n });\n d3ZoomInstance.on('start', startHandler);\n // pan zoom\n const panZoomHandler = createPanZoomHandler({\n zoomPanValues,\n panOnDrag,\n onPaneContextMenu: !!onPaneContextMenu,\n onPanZoom,\n onTransformChange,\n });\n d3ZoomInstance.on('zoom', panZoomHandler);\n // pan zoom end\n const panZoomEndHandler = createPanZoomEndHandler({\n zoomPanValues,\n panOnDrag,\n panOnScroll,\n onPaneContextMenu,\n onPanZoomEnd,\n onDraggingChange,\n });\n d3ZoomInstance.on('end', panZoomEndHandler);\n }\n const filter = createFilter({\n zoomActivationKeyPressed,\n panOnDrag,\n zoomOnScroll,\n panOnScroll,\n zoomOnDoubleClick,\n zoomOnPinch,\n userSelectionActive,\n noPanClassName,\n noWheelClassName,\n lib,\n connectionInProgress,\n });\n d3ZoomInstance.filter(filter);\n /*\n * We cannot add zoomOnDoubleClick to the filter above because\n * double tapping on touch screens circumvents the filter and\n * dblclick.zoom is fired on the selection directly\n */\n if (zoomOnDoubleClick) {\n d3Selection.on('dblclick.zoom', d3DblClickZoomHandler);\n }\n else {\n d3Selection.on('dblclick.zoom', null);\n }\n }\n function destroy() {\n d3ZoomInstance.on('zoom', null);\n }\n async function setViewportConstrained(viewport, extent, translateExtent) {\n const nextTransform = viewportToTransform(viewport);\n const contrainedTransform = d3ZoomInstance?.constrain()(nextTransform, extent, translateExtent);\n if (contrainedTransform) {\n await setTransform(contrainedTransform);\n }\n return new Promise((resolve) => resolve(contrainedTransform));\n }\n async function setViewport(viewport, options) {\n const nextTransform = viewportToTransform(viewport);\n await setTransform(nextTransform, options);\n return new Promise((resolve) => resolve(nextTransform));\n }\n function syncViewport(viewport) {\n if (d3Selection) {\n const nextTransform = viewportToTransform(viewport);\n const currentTransform = d3Selection.property('__zoom');\n if (currentTransform.k !== viewport.zoom ||\n currentTransform.x !== viewport.x ||\n currentTransform.y !== viewport.y) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n d3ZoomInstance?.transform(d3Selection, nextTransform, null, { sync: true });\n }\n }\n }\n function getViewport() {\n const transform = d3Selection ? zoomTransform(d3Selection.node()) : { x: 0, y: 0, k: 1 };\n return { x: transform.x, y: transform.y, zoom: transform.k };\n }\n function scaleTo(zoom, options) {\n if (d3Selection) {\n return new Promise((resolve) => {\n d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleTo(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), zoom);\n });\n }\n return Promise.resolve(false);\n }\n function scaleBy(factor, options) {\n if (d3Selection) {\n return new Promise((resolve) => {\n d3ZoomInstance?.interpolate(options?.interpolate === 'linear' ? interpolate : interpolateZoom).scaleBy(getD3Transition(d3Selection, options?.duration, options?.ease, () => resolve(true)), factor);\n });\n }\n return Promise.resolve(false);\n }\n function setScaleExtent(scaleExtent) {\n d3ZoomInstance?.scaleExtent(scaleExtent);\n }\n function setTranslateExtent(translateExtent) {\n d3ZoomInstance?.translateExtent(translateExtent);\n }\n function setClickDistance(distance) {\n const validDistance = !isNumeric(distance) || distance < 0 ? 0 : distance;\n d3ZoomInstance?.clickDistance(validDistance);\n }\n return {\n update,\n destroy,\n setViewport,\n setViewportConstrained,\n getViewport,\n scaleTo,\n scaleBy,\n setScaleExtent,\n setTranslateExtent,\n syncViewport,\n setClickDistance,\n };\n}\n\n/**\n * Used to determine the variant of the resize control\n *\n * @public\n */\nvar ResizeControlVariant;\n(function (ResizeControlVariant) {\n ResizeControlVariant[\"Line\"] = \"line\";\n ResizeControlVariant[\"Handle\"] = \"handle\";\n})(ResizeControlVariant || (ResizeControlVariant = {}));\nconst XY_RESIZER_HANDLE_POSITIONS = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];\nconst XY_RESIZER_LINE_POSITIONS = ['top', 'right', 'bottom', 'left'];\n\n/**\n * Get all connecting edges for a given set of nodes\n * @param width - new width of the node\n * @param prevWidth - previous width of the node\n * @param height - new height of the node\n * @param prevHeight - previous height of the node\n * @param affectsX - whether to invert the resize direction for the x axis\n * @param affectsY - whether to invert the resize direction for the y axis\n * @returns array of two numbers representing the direction of the resize for each axis, 0 = no change, 1 = increase, -1 = decrease\n */\nfunction getResizeDirection({ width, prevWidth, height, prevHeight, affectsX, affectsY, }) {\n const deltaWidth = width - prevWidth;\n const deltaHeight = height - prevHeight;\n const direction = [deltaWidth > 0 ? 1 : deltaWidth < 0 ? -1 : 0, deltaHeight > 0 ? 1 : deltaHeight < 0 ? -1 : 0];\n if (deltaWidth && affectsX) {\n direction[0] = direction[0] * -1;\n }\n if (deltaHeight && affectsY) {\n direction[1] = direction[1] * -1;\n }\n return direction;\n}\n/**\n * Parses the control position that is being dragged to dimensions that are being resized\n * @param controlPosition - position of the control that is being dragged\n * @returns isHorizontal, isVertical, affectsX, affectsY,\n */\nfunction getControlDirection(controlPosition) {\n const isHorizontal = controlPosition.includes('right') || controlPosition.includes('left');\n const isVertical = controlPosition.includes('bottom') || controlPosition.includes('top');\n const affectsX = controlPosition.includes('left');\n const affectsY = controlPosition.includes('top');\n return {\n isHorizontal,\n isVertical,\n affectsX,\n affectsY,\n };\n}\nfunction getLowerExtentClamp(lowerExtent, lowerBound) {\n return Math.max(0, lowerBound - lowerExtent);\n}\nfunction getUpperExtentClamp(upperExtent, upperBound) {\n return Math.max(0, upperExtent - upperBound);\n}\nfunction getSizeClamp(size, minSize, maxSize) {\n return Math.max(0, minSize - size, size - maxSize);\n}\nfunction xor(a, b) {\n return a ? !b : b;\n}\n/**\n * Calculates new width & height and x & y of node after resize based on pointer position\n * @description - Buckle up, this is a chunky one... If you want to determine the new dimensions of a node after a resize,\n * you have to account for all possible restrictions: min/max width/height of the node, the maximum extent the node is allowed\n * to move in (in this case: resize into) determined by the parent node, the minimal extent determined by child nodes\n * with expandParent or extent: 'parent' set and oh yeah, these things also have to work with keepAspectRatio!\n * The way this is done is by determining how much each of these restricting actually restricts the resize and then applying the\n * strongest restriction. Because the resize affects x, y and width, height and width, height of a opposing side with keepAspectRatio,\n * the resize amount is always kept in distX & distY amount (the distance in mouse movement)\n * Instead of clamping each value, we first calculate the biggest 'clamp' (for the lack of a better name) and then apply it to all values.\n * To complicate things nodeOrigin has to be taken into account as well. This is done by offsetting the nodes as if their origin is [0, 0],\n * then calculating the restrictions as usual\n * @param startValues - starting values of resize\n * @param controlDirection - dimensions affected by the resize\n * @param pointerPosition - the current pointer position corrected for snapping\n * @param boundaries - minimum and maximum dimensions of the node\n * @param keepAspectRatio - prevent changes of asprect ratio\n * @returns x, y, width and height of the node after resize\n */\nfunction getDimensionsAfterResize(startValues, controlDirection, pointerPosition, boundaries, keepAspectRatio, nodeOrigin, extent, childExtent) {\n let { affectsX, affectsY } = controlDirection;\n const { isHorizontal, isVertical } = controlDirection;\n const isDiagonal = isHorizontal && isVertical;\n const { xSnapped, ySnapped } = pointerPosition;\n const { minWidth, maxWidth, minHeight, maxHeight } = boundaries;\n const { x: startX, y: startY, width: startWidth, height: startHeight, aspectRatio } = startValues;\n let distX = Math.floor(isHorizontal ? xSnapped - startValues.pointerX : 0);\n let distY = Math.floor(isVertical ? ySnapped - startValues.pointerY : 0);\n const newWidth = startWidth + (affectsX ? -distX : distX);\n const newHeight = startHeight + (affectsY ? -distY : distY);\n const originOffsetX = -nodeOrigin[0] * startWidth;\n const originOffsetY = -nodeOrigin[1] * startHeight;\n // Check if maxWidth, minWWidth, maxHeight, minHeight are restricting the resize\n let clampX = getSizeClamp(newWidth, minWidth, maxWidth);\n let clampY = getSizeClamp(newHeight, minHeight, maxHeight);\n // Check if extent is restricting the resize\n if (extent) {\n let xExtentClamp = 0;\n let yExtentClamp = 0;\n if (affectsX && distX < 0) {\n xExtentClamp = getLowerExtentClamp(startX + distX + originOffsetX, extent[0][0]);\n }\n else if (!affectsX && distX > 0) {\n xExtentClamp = getUpperExtentClamp(startX + newWidth + originOffsetX, extent[1][0]);\n }\n if (affectsY && distY < 0) {\n yExtentClamp = getLowerExtentClamp(startY + distY + originOffsetY, extent[0][1]);\n }\n else if (!affectsY && distY > 0) {\n yExtentClamp = getUpperExtentClamp(startY + newHeight + originOffsetY, extent[1][1]);\n }\n clampX = Math.max(clampX, xExtentClamp);\n clampY = Math.max(clampY, yExtentClamp);\n }\n // Check if the child extent is restricting the resize\n if (childExtent) {\n let xExtentClamp = 0;\n let yExtentClamp = 0;\n if (affectsX && distX > 0) {\n xExtentClamp = getUpperExtentClamp(startX + distX, childExtent[0][0]);\n }\n else if (!affectsX && distX < 0) {\n xExtentClamp = getLowerExtentClamp(startX + newWidth, childExtent[1][0]);\n }\n if (affectsY && distY > 0) {\n yExtentClamp = getUpperExtentClamp(startY + distY, childExtent[0][1]);\n }\n else if (!affectsY && distY < 0) {\n yExtentClamp = getLowerExtentClamp(startY + newHeight, childExtent[1][1]);\n }\n clampX = Math.max(clampX, xExtentClamp);\n clampY = Math.max(clampY, yExtentClamp);\n }\n // Check if the aspect ratio resizing of the other side is restricting the resize\n if (keepAspectRatio) {\n if (isHorizontal) {\n // Check if the max dimensions might be restricting the resize\n const aspectHeightClamp = getSizeClamp(newWidth / aspectRatio, minHeight, maxHeight) * aspectRatio;\n clampX = Math.max(clampX, aspectHeightClamp);\n // Check if the extent is restricting the resize\n if (extent) {\n let aspectExtentClamp = 0;\n if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) {\n aspectExtentClamp =\n getUpperExtentClamp(startY + originOffsetY + newWidth / aspectRatio, extent[1][1]) * aspectRatio;\n }\n else {\n aspectExtentClamp =\n getLowerExtentClamp(startY + originOffsetY + (affectsX ? distX : -distX) / aspectRatio, extent[0][1]) *\n aspectRatio;\n }\n clampX = Math.max(clampX, aspectExtentClamp);\n }\n // Check if the child extent is restricting the resize\n if (childExtent) {\n let aspectExtentClamp = 0;\n if ((!affectsX && !affectsY) || (affectsX && !affectsY && isDiagonal)) {\n aspectExtentClamp = getLowerExtentClamp(startY + newWidth / aspectRatio, childExtent[1][1]) * aspectRatio;\n }\n else {\n aspectExtentClamp =\n getUpperExtentClamp(startY + (affectsX ? distX : -distX) / aspectRatio, childExtent[0][1]) * aspectRatio;\n }\n clampX = Math.max(clampX, aspectExtentClamp);\n }\n }\n // Do the same thing for vertical resizing\n if (isVertical) {\n const aspectWidthClamp = getSizeClamp(newHeight * aspectRatio, minWidth, maxWidth) / aspectRatio;\n clampY = Math.max(clampY, aspectWidthClamp);\n if (extent) {\n let aspectExtentClamp = 0;\n if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) {\n aspectExtentClamp =\n getUpperExtentClamp(startX + newHeight * aspectRatio + originOffsetX, extent[1][0]) / aspectRatio;\n }\n else {\n aspectExtentClamp =\n getLowerExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio + originOffsetX, extent[0][0]) /\n aspectRatio;\n }\n clampY = Math.max(clampY, aspectExtentClamp);\n }\n if (childExtent) {\n let aspectExtentClamp = 0;\n if ((!affectsX && !affectsY) || (affectsY && !affectsX && isDiagonal)) {\n aspectExtentClamp = getLowerExtentClamp(startX + newHeight * aspectRatio, childExtent[1][0]) / aspectRatio;\n }\n else {\n aspectExtentClamp =\n getUpperExtentClamp(startX + (affectsY ? distY : -distY) * aspectRatio, childExtent[0][0]) / aspectRatio;\n }\n clampY = Math.max(clampY, aspectExtentClamp);\n }\n }\n }\n distY = distY + (distY < 0 ? clampY : -clampY);\n distX = distX + (distX < 0 ? clampX : -clampX);\n if (keepAspectRatio) {\n if (isDiagonal) {\n if (newWidth > newHeight * aspectRatio) {\n distY = (xor(affectsX, affectsY) ? -distX : distX) / aspectRatio;\n }\n else {\n distX = (xor(affectsX, affectsY) ? -distY : distY) * aspectRatio;\n }\n }\n else {\n if (isHorizontal) {\n distY = distX / aspectRatio;\n affectsY = affectsX;\n }\n else {\n distX = distY * aspectRatio;\n affectsX = affectsY;\n }\n }\n }\n const x = affectsX ? startX + distX : startX;\n const y = affectsY ? startY + distY : startY;\n return {\n width: startWidth + (affectsX ? -distX : distX),\n height: startHeight + (affectsY ? -distY : distY),\n x: nodeOrigin[0] * distX * (!affectsX ? 1 : -1) + x,\n y: nodeOrigin[1] * distY * (!affectsY ? 1 : -1) + y,\n };\n}\n\nconst initPrevValues = { width: 0, height: 0, x: 0, y: 0 };\nconst initStartValues = {\n ...initPrevValues,\n pointerX: 0,\n pointerY: 0,\n aspectRatio: 1,\n};\nfunction nodeToParentExtent(node) {\n return [\n [0, 0],\n [node.measured.width, node.measured.height],\n ];\n}\nfunction nodeToChildExtent(child, parent, nodeOrigin) {\n const x = parent.position.x + child.position.x;\n const y = parent.position.y + child.position.y;\n const width = child.measured.width ?? 0;\n const height = child.measured.height ?? 0;\n const originOffsetX = nodeOrigin[0] * width;\n const originOffsetY = nodeOrigin[1] * height;\n return [\n [x - originOffsetX, y - originOffsetY],\n [x + width - originOffsetX, y + height - originOffsetY],\n ];\n}\nfunction XYResizer({ domNode, nodeId, getStoreItems, onChange, onEnd }) {\n const selection = select(domNode);\n let params = {\n controlDirection: getControlDirection('bottom-right'),\n boundaries: {\n minWidth: 0,\n minHeight: 0,\n maxWidth: Number.MAX_VALUE,\n maxHeight: Number.MAX_VALUE,\n },\n resizeDirection: undefined,\n keepAspectRatio: false,\n };\n function update({ controlPosition, boundaries, keepAspectRatio, resizeDirection, onResizeStart, onResize, onResizeEnd, shouldResize, }) {\n let prevValues = { ...initPrevValues };\n let startValues = { ...initStartValues };\n params = {\n boundaries,\n resizeDirection,\n keepAspectRatio,\n controlDirection: getControlDirection(controlPosition),\n };\n let node = undefined;\n let containerBounds = null;\n let childNodes = [];\n let parentNode = undefined; // Needed to fix expandParent\n let parentExtent = undefined;\n let childExtent = undefined;\n // we only want to trigger onResizeEnd if onResize was actually called\n let resizeDetected = false;\n const dragHandler = drag()\n .on('start', (event) => {\n const { nodeLookup, transform, snapGrid, snapToGrid, nodeOrigin, paneDomNode } = getStoreItems();\n node = nodeLookup.get(nodeId);\n if (!node) {\n return;\n }\n containerBounds = paneDomNode?.getBoundingClientRect() ?? null;\n const { xSnapped, ySnapped } = getPointerPosition(event.sourceEvent, {\n transform,\n snapGrid,\n snapToGrid,\n containerBounds,\n });\n prevValues = {\n width: node.measured.width ?? 0,\n height: node.measured.height ?? 0,\n x: node.position.x ?? 0,\n y: node.position.y ?? 0,\n };\n startValues = {\n ...prevValues,\n pointerX: xSnapped,\n pointerY: ySnapped,\n aspectRatio: prevValues.width / prevValues.height,\n };\n parentNode = undefined;\n if (node.parentId && (node.extent === 'parent' || node.expandParent)) {\n parentNode = nodeLookup.get(node.parentId);\n parentExtent = parentNode && node.extent === 'parent' ? nodeToParentExtent(parentNode) : undefined;\n }\n /*\n * Collect all child nodes to correct their relative positions when top/left changes\n * Determine largest minimal extent the parent node is allowed to resize to\n */\n childNodes = [];\n childExtent = undefined;\n for (const [childId, child] of nodeLookup) {\n if (child.parentId === nodeId) {\n childNodes.push({\n id: childId,\n position: { ...child.position },\n extent: child.extent,\n });\n if (child.extent === 'parent' || child.expandParent) {\n const extent = nodeToChildExtent(child, node, child.origin ?? nodeOrigin);\n if (childExtent) {\n childExtent = [\n [Math.min(extent[0][0], childExtent[0][0]), Math.min(extent[0][1], childExtent[0][1])],\n [Math.max(extent[1][0], childExtent[1][0]), Math.max(extent[1][1], childExtent[1][1])],\n ];\n }\n else {\n childExtent = extent;\n }\n }\n }\n }\n onResizeStart?.(event, { ...prevValues });\n })\n .on('drag', (event) => {\n const { transform, snapGrid, snapToGrid, nodeOrigin: storeNodeOrigin } = getStoreItems();\n const pointerPosition = getPointerPosition(event.sourceEvent, {\n transform,\n snapGrid,\n snapToGrid,\n containerBounds,\n });\n const childChanges = [];\n if (!node) {\n return;\n }\n const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues;\n const change = {};\n const nodeOrigin = node.origin ?? storeNodeOrigin;\n const { width, height, x, y } = getDimensionsAfterResize(startValues, params.controlDirection, pointerPosition, params.boundaries, params.keepAspectRatio, nodeOrigin, parentExtent, childExtent);\n const isWidthChange = width !== prevWidth;\n const isHeightChange = height !== prevHeight;\n const isXPosChange = x !== prevX && isWidthChange;\n const isYPosChange = y !== prevY && isHeightChange;\n if (!isXPosChange && !isYPosChange && !isWidthChange && !isHeightChange) {\n return;\n }\n if (isXPosChange || isYPosChange || nodeOrigin[0] === 1 || nodeOrigin[1] === 1) {\n change.x = isXPosChange ? x : prevValues.x;\n change.y = isYPosChange ? y : prevValues.y;\n prevValues.x = change.x;\n prevValues.y = change.y;\n /*\n * when top/left changes, correct the relative positions of child nodes\n * so that they stay in the same position\n */\n if (childNodes.length > 0) {\n const xChange = x - prevX;\n const yChange = y - prevY;\n for (const childNode of childNodes) {\n childNode.position = {\n x: childNode.position.x - xChange + nodeOrigin[0] * (width - prevWidth),\n y: childNode.position.y - yChange + nodeOrigin[1] * (height - prevHeight),\n };\n childChanges.push(childNode);\n }\n }\n }\n if (isWidthChange || isHeightChange) {\n change.width =\n isWidthChange && (!params.resizeDirection || params.resizeDirection === 'horizontal')\n ? width\n : prevValues.width;\n change.height =\n isHeightChange && (!params.resizeDirection || params.resizeDirection === 'vertical')\n ? height\n : prevValues.height;\n prevValues.width = change.width;\n prevValues.height = change.height;\n }\n // Fix expandParent when resizing from top/left\n if (parentNode && node.expandParent) {\n const xLimit = nodeOrigin[0] * (change.width ?? 0);\n if (change.x && change.x < xLimit) {\n prevValues.x = xLimit;\n startValues.x = startValues.x - (change.x - xLimit);\n }\n const yLimit = nodeOrigin[1] * (change.height ?? 0);\n if (change.y && change.y < yLimit) {\n prevValues.y = yLimit;\n startValues.y = startValues.y - (change.y - yLimit);\n }\n }\n const direction = getResizeDirection({\n width: prevValues.width,\n prevWidth,\n height: prevValues.height,\n prevHeight,\n affectsX: params.controlDirection.affectsX,\n affectsY: params.controlDirection.affectsY,\n });\n const nextValues = { ...prevValues, direction };\n const callResize = shouldResize?.(event, nextValues);\n if (callResize === false) {\n return;\n }\n resizeDetected = true;\n onResize?.(event, nextValues);\n onChange(change, childChanges);\n })\n .on('end', (event) => {\n if (!resizeDetected) {\n return;\n }\n onResizeEnd?.(event, { ...prevValues });\n onEnd?.({ ...prevValues });\n resizeDetected = false;\n });\n selection.call(dragHandler);\n }\n function destroy() {\n selection.on('.drag', null);\n }\n return {\n update,\n destroy,\n };\n}\n\nexport { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, XY_RESIZER_HANDLE_POSITIONS, XY_RESIZER_LINE_POSITIONS, addEdge, adoptUserNodes, areConnectionMapsEqual, areSetsEqual, boxToRect, calcAutoPan, calculateNodePosition, clamp, clampPosition, clampPositionToParent, createMarkerIds, defaultAriaLabelConfig, devWarn, elementSelectionKeys, errorMessages, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter, getBezierPath, getBoundsOfBoxes, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter, getEdgePosition, getEdgeToolbarTransform, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandleBounds, getHandlePosition, getHostForElement, getIncomers, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodePositionWithOrigin, getNodeToolbarTransform, getNodesBounds, getNodesInside, getOutgoers, getOverlappingArea, getPointerPosition, getSmoothStepPath, getStraightPath, getViewportForBounds, handleConnectionChange, handleExpandParent, infiniteExtent, initialConnection, isCoordinateExtent, isEdgeBase, isEdgeVisible, isInputDOMNode, isInternalNodeBase, isMacOs, isMouseEvent, isNodeBase, isNumeric, isRectObject, mergeAriaLabelConfig, nodeHasDimensions, nodeToBox, nodeToRect, oppositePosition, panBy, pointToRendererPoint, reconnectEdge, rectToBox, rendererPointToPoint, shallowNodeData, snapPosition, updateAbsolutePositions, updateConnectionLookup, updateNodeInternals, withResolvers };\n","import ReactExports from 'react';\nimport useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector.js';\nimport { createStore } from 'zustand/vanilla';\n\nconst { useDebugValue } = ReactExports;\nconst { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;\nconst identity = (arg) => arg;\nfunction useStoreWithEqualityFn(api, selector = identity, equalityFn) {\n const slice = useSyncExternalStoreWithSelector(\n api.subscribe,\n api.getState,\n api.getServerState || api.getInitialState,\n selector,\n equalityFn\n );\n useDebugValue(slice);\n return slice;\n}\nconst createWithEqualityFnImpl = (createState, defaultEqualityFn) => {\n const api = createStore(createState);\n const useBoundStoreWithEqualityFn = (selector, equalityFn = defaultEqualityFn) => useStoreWithEqualityFn(api, selector, equalityFn);\n Object.assign(useBoundStoreWithEqualityFn, api);\n return useBoundStoreWithEqualityFn;\n};\nconst createWithEqualityFn = (createState, defaultEqualityFn) => createState ? createWithEqualityFnImpl(createState, defaultEqualityFn) : createWithEqualityFnImpl;\n\nexport { createWithEqualityFn, useStoreWithEqualityFn };\n","const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const destroy = () => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.\"\n );\n }\n listeners.clear();\n };\n const api = { setState, getState, getInitialState, subscribe, destroy };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;\nvar vanilla = (createState) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] Default export is deprecated. Instead use import { createStore } from 'zustand/vanilla'.\"\n );\n }\n return createStore(createState);\n};\n\nexport { createStore, vanilla as default };\n","function shallow$1(objA, objB) {\n if (Object.is(objA, objB)) {\n return true;\n }\n if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n return false;\n }\n if (objA instanceof Map && objB instanceof Map) {\n if (objA.size !== objB.size) return false;\n for (const [key, value] of objA) {\n if (!Object.is(value, objB.get(key))) {\n return false;\n }\n }\n return true;\n }\n if (objA instanceof Set && objB instanceof Set) {\n if (objA.size !== objB.size) return false;\n for (const value of objA) {\n if (!objB.has(value)) {\n return false;\n }\n }\n return true;\n }\n const keysA = Object.keys(objA);\n if (keysA.length !== Object.keys(objB).length) {\n return false;\n }\n for (const keyA of keysA) {\n if (!Object.prototype.hasOwnProperty.call(objB, keyA) || !Object.is(objA[keyA], objB[keyA])) {\n return false;\n }\n }\n return true;\n}\n\nvar shallow = (objA, objB) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") {\n console.warn(\n \"[DEPRECATED] Default export is deprecated. Instead use `import { shallow } from 'zustand/shallow'`.\"\n );\n }\n return shallow$1(objA, objB);\n};\n\nexport { shallow as default, shallow$1 as shallow };\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport type * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst badgeVariants = cva(\n 'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',\n {\n variants: {\n variant: {\n default:\n 'border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80',\n secondary:\n 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',\n destructive:\n 'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',\n outline: 'text-foreground',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return (\n <div className={cn(badgeVariants({ variant }), className)} {...props} />\n );\n}\n\nexport { Badge, badgeVariants };\n","'use client';\n\nimport {\n Background,\n BaseEdge,\n Controls,\n type Edge,\n EdgeLabelRenderer,\n type EdgeProps,\n Handle,\n MarkerType,\n type Node,\n type NodeProps,\n Panel,\n Position,\n ReactFlow,\n useEdgesState,\n useNodesState,\n} from '@xyflow/react';\nimport { useEffect, useMemo } from 'react';\nimport '@xyflow/react/dist/style.css';\nimport { Clock, Link2, PlayCircle, StopCircle, Zap } from 'lucide-react';\nimport './workflow-graph-viewer.css';\nimport type {\n GraphNode,\n WorkflowGraph,\n} from '@/lib/flow-graph/workflow-graph-types';\n\n// ============================================================================\n// SHARED TYPES\n// ============================================================================\n\nexport interface NodeStyleResult {\n color: string;\n backgroundColor: string;\n borderColor: string;\n borderWidth?: number;\n opacity?: number;\n}\n\nexport interface LoopNodeData {\n label: React.ReactNode;\n nodeKind: string;\n isLoopNode?: boolean;\n isAwaitLoop?: boolean;\n nodeStyle?: React.CSSProperties;\n className?: string;\n [key: string]: unknown;\n}\n\nexport interface DiamondNodeData {\n label: React.ReactNode;\n nodeKind: string;\n nodeStyle?: React.CSSProperties;\n className?: string;\n [key: string]: unknown;\n}\n\nexport interface ParallelGroupData {\n label: string;\n groupWidth?: number;\n groupHeight?: number;\n [key: string]: unknown;\n}\n\n// Edge type with optional consolidation flag\nexport type ConsolidatedEdge = {\n id: string;\n source: string;\n target: string;\n type?: string;\n label?: string;\n sourceHandle?: string;\n targetHandle?: string;\n isConsolidated?: boolean;\n isOriginal?: boolean;\n originalEdgeIds?: string[]; // Track original edge IDs when consolidated\n};\n\n// ============================================================================\n// SHARED CONSTANTS\n// ============================================================================\n\n// Layout constants\nexport const LAYOUT = {\n NODE_WIDTH: 220,\n NODE_HEIGHT: 120,\n HORIZONTAL_SPACING: 280,\n VERTICAL_SPACING: 220,\n START_X: 250,\n PARALLEL_GROUP_PADDING: 25,\n};\n\ninterface WorkflowGraphViewerProps {\n workflow: WorkflowGraph;\n}\n\n// ============================================================================\n// SHARED COMPONENTS\n// ============================================================================\n\n// Custom Loop Node component with left-side handles for self-loop edge\nexport function LoopNodeComponent({ data, selected }: NodeProps) {\n const nodeData = data as LoopNodeData;\n\n return (\n <div\n className={`relative ${nodeData.className || ''}`}\n style={{\n borderWidth: nodeData.nodeStyle?.borderWidth ?? 1,\n borderRadius: 8,\n padding: 12,\n width: 220,\n borderStyle: 'solid',\n backgroundColor: nodeData.nodeStyle?.backgroundColor,\n borderColor: nodeData.nodeStyle?.borderColor ?? '#9ca3af',\n opacity: nodeData.nodeStyle?.opacity,\n boxShadow: selected ? '0 0 0 2px rgba(168, 85, 247, 0.5)' : undefined,\n }}\n >\n {/* Node content */}\n {nodeData.label}\n\n {/* Main flow handles (top/bottom) */}\n <Handle\n type=\"target\"\n position={Position.Top}\n className=\"!bg-purple-500\"\n />\n <Handle\n type=\"source\"\n position={Position.Bottom}\n className=\"!bg-purple-500\"\n />\n\n {/* Left-side handles for self-loop edge */}\n <Handle\n type=\"source\"\n position={Position.Left}\n id=\"loop-out\"\n className=\"!bg-purple-500 !-left-1 !w-[6px] !h-[6px] !min-w-0 !min-h-0\"\n style={{ top: '30%' }}\n />\n <Handle\n type=\"target\"\n position={Position.Left}\n id=\"loop-in\"\n className=\"!bg-purple-500 !-left-1 !w-[6px] !h-[6px] !min-w-0 !min-h-0\"\n style={{ top: '70%' }}\n />\n </div>\n );\n}\n\n// Custom parallel group component with label\nexport function ParallelGroupComponent({ data }: { data: ParallelGroupData }) {\n return (\n <div\n style={{\n width: data.groupWidth || 200,\n height: data.groupHeight || 100,\n position: 'relative',\n }}\n >\n <span\n style={{\n position: 'absolute',\n top: 8,\n left: 12,\n fontSize: 11,\n fontWeight: 600,\n color: 'rgba(59, 130, 246, 0.8)',\n textTransform: 'uppercase',\n letterSpacing: '0.5px',\n pointerEvents: 'none',\n }}\n >\n {data.label}\n </span>\n </div>\n );\n}\n\n// Custom Diamond Node component for conditional nodes\nexport function DiamondNodeComponent({ data, selected }: NodeProps) {\n const nodeData = data as DiamondNodeData;\n\n // Diamond size\n const size = 160;\n\n return (\n <div\n className={`relative flex items-center justify-center ${nodeData.className || ''}`}\n style={{\n width: size,\n height: size,\n }}\n >\n {/* Diamond shape */}\n <div\n style={{\n width: size * 0.7,\n height: size * 0.7,\n transform: 'rotate(45deg)',\n borderWidth: 2,\n borderStyle: 'solid',\n borderRadius: 4,\n backgroundColor: nodeData.nodeStyle?.backgroundColor,\n borderColor: nodeData.nodeStyle?.borderColor ?? '#ef4444',\n opacity: nodeData.nodeStyle?.opacity,\n boxShadow: selected ? '0 0 0 2px rgba(239, 68, 68, 0.5)' : undefined,\n }}\n />\n {/* Label overlay (not rotated) */}\n <div\n className=\"absolute inset-0 flex items-center justify-center pointer-events-auto\"\n style={{\n fontSize: 11,\n fontWeight: 600,\n padding: size * 0.25, // Keep text within the diamond's inscribed area\n }}\n title={typeof nodeData.label === 'string' ? nodeData.label : undefined}\n >\n <span className=\"text-center line-clamp-3 overflow-hidden\">\n {nodeData.label}\n </span>\n </div>\n\n {/* Main flow handles (top/bottom) */}\n <Handle type=\"target\" position={Position.Top} className=\"!bg-red-500\" />\n <Handle\n type=\"source\"\n position={Position.Bottom}\n id=\"bottom\"\n className=\"!bg-red-500\"\n />\n {/* Additional handles for true/false branches */}\n <Handle\n type=\"source\"\n position={Position.Left}\n id=\"left\"\n className=\"!bg-red-500\"\n />\n <Handle\n type=\"source\"\n position={Position.Right}\n id=\"right\"\n className=\"!bg-red-500\"\n />\n </div>\n );\n}\n\n// Custom node components - base types for static graph viewing\nexport const baseNodeTypes = {\n loopNode: LoopNodeComponent,\n parallelGroup: ParallelGroupComponent,\n diamondNode: DiamondNodeComponent,\n};\n\n// Node types for this viewer (same as base)\nconst nodeTypes = baseNodeTypes;\n\n// Self-loop edge styling options\nexport interface SelfLoopEdgeStyle {\n strokeColor?: string;\n labelBgClass?: string;\n}\n\n// Default self-loop edge style (gray for static view)\nexport const defaultSelfLoopStyle: SelfLoopEdgeStyle = {\n strokeColor: '#6b7280', // gray-500\n labelBgClass:\n 'bg-gray-200 dark:bg-gray-700 text-black dark:text-gray-200 border-gray-400 dark:border-gray-500',\n};\n\n// Execution self-loop edge style (purple for execution view)\nexport const executionSelfLoopStyle: SelfLoopEdgeStyle = {\n strokeColor: '#a855f7', // purple-500\n labelBgClass:\n 'bg-purple-200 dark:bg-purple-900/50 text-black dark:text-purple-200 border-purple-400 dark:border-purple-600',\n};\n\n// Factory to create a self-loop edge component with custom styling\nexport function createSelfLoopEdge(\n style: SelfLoopEdgeStyle = defaultSelfLoopStyle\n) {\n return function SelfLoopEdge({\n id,\n sourceX,\n sourceY,\n targetX,\n targetY,\n label,\n markerEnd,\n }: EdgeProps) {\n // Calculate the loop path that goes to the left of the node\n const loopOffset = 50; // How far left the loop extends\n const verticalGap = targetY - sourceY;\n\n // Create a path that exits left, curves around, and enters left\n const path = `\n M ${sourceX} ${sourceY}\n C ${sourceX - loopOffset} ${sourceY},\n ${sourceX - loopOffset} ${targetY},\n ${targetX} ${targetY}\n `;\n\n // Label position - to the left of the loop edge, slightly up and right\n const labelX = sourceX - loopOffset + 5;\n const labelY = sourceY + verticalGap / 2 - 12;\n\n return (\n <>\n <BaseEdge\n id={id}\n path={path}\n markerEnd={markerEnd}\n style={{\n stroke: style.strokeColor,\n strokeWidth: 2,\n }}\n />\n {label && (\n <EdgeLabelRenderer>\n <div\n style={{\n position: 'absolute',\n transform: `translate(-100%, -50%) translate(${labelX}px, ${labelY}px)`,\n pointerEvents: 'all',\n }}\n className=\"nodrag nopan\"\n >\n <span\n className={`px-1.5 py-0.5 text-[9px] font-bold rounded border whitespace-nowrap ${style.labelBgClass}`}\n >\n {label}\n </span>\n </div>\n </EdgeLabelRenderer>\n )}\n </>\n );\n };\n}\n\n// Default self-loop edge for static graph viewing\nconst SelfLoopEdge = createSelfLoopEdge(defaultSelfLoopStyle);\n\n// Custom edge types\nconst edgeTypes = {\n selfLoop: SelfLoopEdge,\n};\n\n// Factory to create edge types with custom self-loop styling\nexport function createEdgeTypes(\n selfLoopStyle: SelfLoopEdgeStyle = defaultSelfLoopStyle\n) {\n return {\n selfLoop: createSelfLoopEdge(selfLoopStyle),\n };\n}\n\n// ============================================================================\n// SHARED UTILITIES\n// ============================================================================\n\n// Get base node background color based on node kind\nexport function getNodeBackgroundColor(nodeKind: string): string {\n if (nodeKind === 'workflow_start' || nodeKind === 'workflow_end') {\n return 'var(--node-bg-start)'; // blue\n }\n if (nodeKind === 'primitive') {\n return 'var(--node-bg-primitive)'; // orange\n }\n if (nodeKind === 'agent') {\n return 'var(--node-bg-agent)'; // pink\n }\n if (nodeKind === 'tool') {\n return 'var(--node-bg-tool)'; // purple\n }\n if (nodeKind === 'conditional') {\n return 'var(--node-bg-conditional)'; // red\n }\n // Default for steps - green\n return 'var(--node-bg-step)';\n}\n\n// Get default border color for a node kind\nexport function getNodeBorderColor(nodeKind: string): string {\n if (nodeKind === 'workflow_start' || nodeKind === 'workflow_end') {\n return '#60a5fa'; // blue-400\n }\n if (nodeKind === 'primitive') {\n return '#f97316'; // orange-500\n }\n if (nodeKind === 'agent') {\n return '#ec4899'; // pink-500\n }\n if (nodeKind === 'tool') {\n return '#a855f7'; // purple-500\n }\n if (nodeKind === 'conditional') {\n return '#ef4444'; // red-500\n }\n // Default for steps - green\n return '#22c55e'; // green-500\n}\n\n// Get node styling based on node kind - theme-aware colors using CSS variables\nexport function getNodeStyle(nodeKind: string): NodeStyleResult {\n return {\n color: 'hsl(var(--card-foreground))',\n backgroundColor: getNodeBackgroundColor(nodeKind),\n borderColor: getNodeBorderColor(nodeKind),\n };\n}\n\n// Get node icon based on node kind\nexport function getNodeIcon(nodeKind: string, label?: string) {\n if (nodeKind === 'workflow_start') {\n return (\n <PlayCircle className=\"h-3.5 w-3.5 text-blue-600 dark:text-blue-400\" />\n );\n }\n if (nodeKind === 'workflow_end') {\n return (\n <StopCircle className=\"h-3.5 w-3.5 text-blue-600 dark:text-blue-400\" />\n );\n }\n if (nodeKind === 'primitive') {\n if (label === 'sleep') {\n return (\n <Clock className=\"h-3.5 w-3.5 text-orange-600 dark:text-orange-400\" />\n );\n }\n if (label === 'createHook' || label === 'createWebhook') {\n return (\n <Link2 className=\"h-3.5 w-3.5 text-orange-600 dark:text-orange-400\" />\n );\n }\n return (\n <Clock className=\"h-3.5 w-3.5 text-orange-600 dark:text-orange-400\" />\n );\n }\n if (nodeKind === 'agent') {\n return (\n <span className=\"h-3.5 w-3.5 text-pink-600 dark:text-pink-400 text-xs\">\n 🤖\n </span>\n );\n }\n if (nodeKind === 'tool') {\n return (\n <span className=\"h-3.5 w-3.5 text-purple-600 dark:text-purple-400 text-xs\">\n 🔧\n </span>\n );\n }\n if (nodeKind === 'conditional') {\n return (\n <span className=\"h-3.5 w-3.5 text-red-600 dark:text-red-400 text-xs\">\n ◇\n </span>\n );\n }\n // Default for steps - use Zap icon\n return <Zap className=\"h-3.5 w-3.5 text-green-600 dark:text-green-400\" />;\n}\n\n// Layout result type\nexport interface EnhancedLayoutResult {\n nodes: GraphNode[];\n groupNodes: Array<{\n id: string;\n type: 'group';\n position: { x: number; y: number };\n style: React.CSSProperties;\n data: ParallelGroupData;\n }>;\n additionalEdges: Array<{\n id: string;\n source: string;\n target: string;\n type: string;\n label?: string;\n sourceHandle?: string;\n targetHandle?: string;\n }>;\n}\n\n// Helper to calculate enhanced layout with control flow\nexport function calculateEnhancedLayout(\n workflow: WorkflowGraph,\n layoutConfig: typeof LAYOUT = LAYOUT\n): EnhancedLayoutResult {\n // Clone nodes (positions are always provided by the manifest adapter)\n const nodes: GraphNode[] = workflow.nodes.map((node) => ({ ...node }));\n const groupNodes: EnhancedLayoutResult['groupNodes'] = [];\n const additionalEdges: EnhancedLayoutResult['additionalEdges'] = [];\n\n // Group nodes by their control flow context\n const parallelGroups = new Map<\n string,\n { nodes: GraphNode[]; method?: string }\n >();\n const loopNodes = new Map<string, GraphNode[]>();\n const conditionalGroups = new Map<\n string,\n { thenBranch: GraphNode[]; elseBranch: GraphNode[] }\n >();\n\n for (const node of nodes) {\n if (node.metadata?.parallelGroupId) {\n const group = parallelGroups.get(node.metadata.parallelGroupId) || {\n nodes: [],\n method: node.metadata.parallelMethod,\n };\n group.nodes.push(node);\n parallelGroups.set(node.metadata.parallelGroupId, group);\n }\n if (node.metadata?.loopId) {\n const group = loopNodes.get(node.metadata.loopId) || [];\n group.push(node);\n loopNodes.set(node.metadata.loopId, group);\n }\n if (node.metadata?.conditionalId) {\n const groups = conditionalGroups.get(node.metadata.conditionalId) || {\n thenBranch: [],\n elseBranch: [],\n };\n if (node.metadata.conditionalBranch === 'Then') {\n groups.thenBranch.push(node);\n } else {\n groups.elseBranch.push(node);\n }\n conditionalGroups.set(node.metadata.conditionalId, groups);\n }\n }\n\n // Layout parallel nodes side-by-side and create visual group containers\n for (const [groupId, group] of parallelGroups) {\n const groupNodes_ = group.nodes;\n if (groupNodes_.length === 0) continue;\n\n const baseY = groupNodes_[0].position.y;\n\n // For multiple nodes, spread them horizontally\n if (groupNodes_.length > 1) {\n const spacing = layoutConfig.HORIZONTAL_SPACING;\n const totalWidth = (groupNodes_.length - 1) * spacing;\n const startX = layoutConfig.START_X - totalWidth / 2;\n\n groupNodes_.forEach((node, idx) => {\n node.position = {\n x: startX + idx * spacing,\n y: baseY,\n };\n });\n }\n\n // Create a visual group container (even for single nodes to show parallel pattern)\n const minX = Math.min(...groupNodes_.map((n) => n.position.x));\n const maxX = Math.max(...groupNodes_.map((n) => n.position.x));\n const methodLabel =\n group.method === 'all'\n ? 'Promise.all'\n : group.method === 'race'\n ? 'Promise.race'\n : group.method === 'allSettled'\n ? 'Promise.allSettled'\n : group.method === 'any'\n ? 'Promise.any'\n : 'Parallel';\n\n const groupWidth =\n maxX -\n minX +\n layoutConfig.NODE_WIDTH +\n layoutConfig.PARALLEL_GROUP_PADDING * 2;\n const groupHeight =\n layoutConfig.NODE_HEIGHT + layoutConfig.PARALLEL_GROUP_PADDING * 2;\n\n groupNodes.push({\n id: `group_${groupId}`,\n type: 'group',\n position: {\n x: minX - layoutConfig.PARALLEL_GROUP_PADDING,\n y: baseY - layoutConfig.PARALLEL_GROUP_PADDING,\n },\n style: {\n width: groupWidth,\n height: groupHeight,\n backgroundColor: 'rgba(59, 130, 246, 0.05)',\n border: '2px dashed rgba(59, 130, 246, 0.3)',\n borderRadius: 12,\n },\n data: { label: methodLabel, groupWidth, groupHeight },\n });\n }\n\n // Layout conditional branches side-by-side\n for (const [, branches] of conditionalGroups) {\n const allNodes = [...branches.thenBranch, ...branches.elseBranch];\n if (allNodes.length <= 1) continue;\n\n const thenNodes = branches.thenBranch;\n const elseNodes = branches.elseBranch;\n\n if (thenNodes.length > 0 && elseNodes.length > 0) {\n // Position then branch on the left, else on the right\n const baseY = Math.min(\n thenNodes[0]?.position.y || 0,\n elseNodes[0]?.position.y || 0\n );\n\n thenNodes.forEach((node, idx) => {\n node.position = {\n x: 100,\n y: baseY + idx * 120,\n };\n });\n\n elseNodes.forEach((node, idx) => {\n node.position = {\n x: 400,\n y: baseY + idx * 120,\n };\n });\n }\n }\n\n // Create self-loop edges for loop nodes (no container, just the edge with label)\n for (const [, loopNodeList] of loopNodes) {\n if (loopNodeList.length > 0) {\n const isAwaitLoop = loopNodeList.some((n) => n.metadata?.loopIsAwait);\n\n // Add self-loop edges for each node in the loop (with label on the edge)\n for (const loopNode of loopNodeList) {\n additionalEdges.push({\n id: `self_loop_${loopNode.id}`,\n source: loopNode.id,\n target: loopNode.id,\n sourceHandle: 'loop-out',\n targetHandle: 'loop-in',\n type: 'selfLoop',\n label: isAwaitLoop ? 'await' : 'loop',\n });\n }\n }\n }\n\n return { nodes, groupNodes, additionalEdges };\n}\n\n// Consolidate edges between parallel groups to reduce visual clutter\nexport function consolidateEdges(\n edges: ConsolidatedEdge[],\n nodes: GraphNode[]\n): ConsolidatedEdge[] {\n // Build a map of node -> parallel group\n const nodeToGroup = new Map<string, string>();\n for (const node of nodes) {\n if (node.metadata?.parallelGroupId) {\n nodeToGroup.set(node.id, node.metadata.parallelGroupId);\n }\n }\n\n // Find edges that connect different parallel groups (N×M pattern)\n // Group edges by source-group → target-group\n const groupToGroupEdges = new Map<string, ConsolidatedEdge[]>();\n const otherEdges: ConsolidatedEdge[] = [];\n\n for (const edge of edges) {\n const sourceGroup = nodeToGroup.get(edge.source);\n const targetGroup = nodeToGroup.get(edge.target);\n\n // Only consolidate if both nodes are in different parallel groups\n if (sourceGroup && targetGroup && sourceGroup !== targetGroup) {\n const key = `${sourceGroup}->${targetGroup}`;\n const existing = groupToGroupEdges.get(key) || [];\n existing.push(edge);\n groupToGroupEdges.set(key, existing);\n } else {\n otherEdges.push(edge);\n }\n }\n\n // For each group-to-group connection, consolidate N×M edges to 1×M\n const consolidatedEdges: ConsolidatedEdge[] = [...otherEdges];\n\n for (const [, groupEdges] of groupToGroupEdges) {\n if (groupEdges.length > 1) {\n // Find unique targets\n const uniqueTargets = [...new Set(groupEdges.map((e) => e.target))];\n // Pick the first source as the representative\n const representativeSource = groupEdges[0].source;\n\n // Create one edge from representative source to each unique target\n for (const target of uniqueTargets) {\n const originalEdge = groupEdges.find((e) => e.target === target);\n // Collect all original edge IDs that are being consolidated to this target\n const originalEdgeIds = groupEdges\n .filter((e) => e.target === target)\n .map((e) => e.id);\n consolidatedEdges.push({\n ...originalEdge!,\n id: `consolidated_${representativeSource}_${target}`,\n source: representativeSource,\n target,\n isConsolidated: true,\n originalEdgeIds,\n });\n }\n } else {\n // Only one edge, keep as-is\n consolidatedEdges.push(...groupEdges);\n }\n }\n\n return consolidatedEdges;\n}\n\n// Convert our graph nodes to React Flow format\nfunction convertToReactFlowNodes(workflow: WorkflowGraph): Node[] {\n const { nodes, groupNodes } = calculateEnhancedLayout(workflow);\n\n // Build a map of node id -> parent group id for parallel groups only\n const nodeToParent = new Map<string, string>();\n const groupPositions = new Map<string, { x: number; y: number }>();\n\n // Store group positions for relative position calculation (parallel groups only)\n for (const group of groupNodes) {\n if (group.id.startsWith('group_')) {\n groupPositions.set(group.id, group.position);\n }\n }\n\n // Determine parent for each node (parallel groups only, no loop groups)\n for (const node of nodes) {\n const parallelGroupId = node.metadata?.parallelGroupId\n ? `group_${node.metadata.parallelGroupId}`\n : null;\n\n if (parallelGroupId && groupPositions.has(parallelGroupId)) {\n nodeToParent.set(node.id, parallelGroupId);\n }\n }\n\n const reactFlowNodes: Node[] = [];\n\n // Add parallel groups only (no loop groups)\n const parallelGroups = groupNodes.filter((g) => g.id.startsWith('group_'));\n\n for (const group of parallelGroups) {\n reactFlowNodes.push({\n id: group.id,\n type: 'parallelGroup',\n position: group.position,\n style: {\n ...group.style,\n cursor: 'grab',\n zIndex: -1,\n },\n data: group.data,\n draggable: true,\n selectable: true,\n });\n }\n\n // Add regular nodes\n nodes.forEach((node) => {\n const styles = getNodeStyle(node.data.nodeKind);\n const metadata = node.metadata;\n const isLoopNode = !!metadata?.loopId;\n const isAwaitLoop = !!metadata?.loopIsAwait;\n const isConditionalNode = node.data.nodeKind === 'conditional';\n\n // Determine node type - use custom node types for loops and conditionals\n let nodeType: 'input' | 'output' | 'default' | 'loopNode' | 'diamondNode' =\n isConditionalNode ? 'diamondNode' : isLoopNode ? 'loopNode' : 'default';\n if (node.type === 'workflowStart') {\n nodeType = 'input'; // Only source handle (outputs edges)\n } else if (node.type === 'workflowEnd') {\n nodeType = 'output'; // Only target handle (receives edges)\n }\n\n // Add CFG metadata badges (conditionalBranch badges removed - now using conditional nodes with edge labels)\n const badges: React.ReactNode[] = [];\n\n // Determine parent group and calculate relative position\n const parentId = nodeToParent.get(node.id);\n let position = node.position;\n\n if (parentId) {\n const parentPos = groupPositions.get(parentId);\n if (parentPos) {\n // Convert to relative position within parent\n position = {\n x: node.position.x - parentPos.x,\n y: node.position.y - parentPos.y,\n };\n }\n }\n\n const nodeLabel = (\n <div\n key={`label-${node.id}`}\n className=\"flex flex-col gap-1.5 w-full overflow-hidden\"\n >\n <div className=\"flex items-start gap-2 w-full overflow-hidden\">\n <div className=\"flex-shrink-0\">\n {getNodeIcon(node.data.nodeKind, node.data.label)}\n </div>\n <span className=\"text-sm font-medium break-words whitespace-normal leading-tight flex-1 min-w-0\">\n {node.data.label}\n </span>\n </div>\n {badges.length > 0 && (\n <div className=\"flex flex-wrap gap-1\">{badges}</div>\n )}\n </div>\n );\n\n // For loop nodes, pass style through data for custom component\n if (isLoopNode) {\n reactFlowNodes.push({\n id: node.id,\n type: nodeType,\n position,\n parentId: parentId,\n extent: parentId ? 'parent' : undefined,\n expandParent: true,\n data: {\n ...node.data,\n label: nodeLabel,\n isLoopNode: true,\n isAwaitLoop,\n nodeStyle: styles,\n },\n });\n } else if (isConditionalNode) {\n // For conditional nodes (diamond shape), pass style through data\n reactFlowNodes.push({\n id: node.id,\n type: nodeType,\n position,\n parentId: parentId,\n extent: parentId ? 'parent' : undefined,\n expandParent: true,\n data: {\n ...node.data,\n label: node.data.label, // Show the conditional expression\n nodeStyle: styles,\n },\n });\n } else {\n reactFlowNodes.push({\n id: node.id,\n type: nodeType,\n position,\n parentId: parentId,\n extent: parentId ? 'parent' : undefined,\n expandParent: true,\n data: {\n ...node.data,\n label: nodeLabel,\n },\n style: {\n borderWidth: 1,\n borderRadius: 8,\n padding: 12,\n width: 220,\n ...styles,\n },\n });\n }\n });\n\n return reactFlowNodes;\n}\n\n// Convert our graph edges to React Flow format\nfunction convertToReactFlowEdges(workflow: WorkflowGraph): Edge[] {\n const { additionalEdges } = calculateEnhancedLayout(workflow);\n\n // Transform original loop edges into loop_back_ edges (they go from exit nodes back to entry nodes)\n // and keep all other edges as-is\n const transformedOriginalEdges = workflow.edges.map((e) => {\n if (e.type === 'loop') {\n return {\n ...e,\n id: `loop_back_${e.source}_${e.target}`,\n isOriginal: true,\n };\n }\n return { ...e, isOriginal: true };\n });\n\n // Combine original edges with additional self-loop edges\n const rawEdges = [\n ...transformedOriginalEdges,\n ...additionalEdges.map((e) => ({ ...e, isOriginal: false })),\n ];\n\n // Consolidate N×M edges between parallel groups into single edges\n const allEdges = consolidateEdges(rawEdges, workflow.nodes);\n\n return allEdges.map((edge) => {\n // Handle self-loop edges specially (they use custom edge type and handles)\n if (edge.type === 'selfLoop') {\n return {\n id: edge.id,\n source: edge.source,\n target: edge.target,\n sourceHandle: edge.sourceHandle,\n targetHandle: edge.targetHandle,\n type: 'selfLoop',\n label: edge.label,\n markerEnd: {\n type: MarkerType.ArrowClosed,\n width: 12,\n height: 12,\n color: '#6b7280', // gray-500\n },\n };\n }\n\n // Simple edge styling - neutral color that works in both light/dark modes\n const strokeColor = '#6b7280'; // gray-500 - visible in both modes\n let strokeWidth = 1;\n let strokeDasharray: string | undefined;\n const animated = false;\n let label: string | undefined = edge.label;\n let edgeType: 'smoothstep' | 'straight' | 'step' | 'bezier' = 'bezier';\n\n // Track if this is a conditional edge for special label styling\n let isConditional = false;\n\n switch (edge.type) {\n case 'parallel':\n strokeWidth = 1.5;\n strokeDasharray = '4,4';\n edgeType = 'smoothstep';\n label = undefined;\n break;\n case 'loop':\n strokeWidth = 2;\n strokeDasharray = '8,4';\n edgeType = 'step';\n // Keep label for loop-back edges\n break;\n case 'conditional':\n strokeDasharray = '8,4';\n edgeType = 'smoothstep';\n isConditional = true;\n // Keep the edge label (e.g., \"true\" or \"false\") for conditional edges\n break;\n default:\n edgeType = 'bezier';\n break;\n }\n\n // Label styling - conditional edges get dark bg with white text\n const labelTextColor = isConditional ? '#ffffff' : '#6b7280';\n const labelBgColor = isConditional ? '#374151' : '#f3f4f6'; // gray-700 : gray-100\n const labelBorderColor = isConditional ? '#4b5563' : '#d1d5db'; // gray-600 : gray-300\n\n return {\n id: edge.id,\n source: edge.source,\n target: edge.target,\n type: edgeType,\n animated,\n label,\n labelStyle: {\n fill: labelTextColor,\n fontWeight: 500,\n fontSize: '11px',\n },\n labelBgPadding: [4, 6] as [number, number],\n labelBgBorderRadius: 4,\n labelBgStyle: {\n fill: labelBgColor,\n fillOpacity: 0.95,\n stroke: labelBorderColor,\n strokeWidth: 1,\n },\n markerEnd: {\n type: MarkerType.ArrowClosed,\n width: 12,\n height: 12,\n color: strokeColor,\n },\n style: {\n strokeWidth,\n stroke: strokeColor,\n strokeDasharray,\n },\n };\n });\n}\n\nexport function WorkflowGraphViewer({ workflow }: WorkflowGraphViewerProps) {\n const initialNodes = useMemo(\n () => convertToReactFlowNodes(workflow),\n [workflow]\n );\n const initialEdges = useMemo(\n () => convertToReactFlowEdges(workflow),\n [workflow]\n );\n\n const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);\n const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);\n\n // Update nodes and edges when workflow changes\n useEffect(() => {\n setNodes(convertToReactFlowNodes(workflow));\n setEdges(convertToReactFlowEdges(workflow));\n }, [workflow, setNodes, setEdges]);\n\n return (\n <div className=\"h-full w-full border rounded-lg bg-background relative overflow-hidden\">\n <ReactFlow\n nodes={nodes}\n edges={edges}\n onNodesChange={onNodesChange}\n onEdgesChange={onEdgesChange}\n nodeTypes={nodeTypes}\n edgeTypes={edgeTypes}\n fitView\n minZoom={0.1}\n maxZoom={2}\n defaultViewport={{ x: 0, y: 0, zoom: 1 }}\n proOptions={{ hideAttribution: true }}\n >\n <Background />\n <Controls />\n <Panel\n position=\"top-left\"\n className=\"bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 border rounded-lg p-3 text-xs\"\n >\n <div className=\"space-y-3\">\n {/* Node types */}\n <div className=\"space-y-1\">\n <div className=\"font-semibold text-[10px] text-muted-foreground mb-1.5\">\n Node Types\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"w-3 h-3 rounded-full bg-blue-500\" />\n <span>Start / End</span>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"w-3 h-3 rounded-full bg-green-500\" />\n <span>Step</span>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"w-3 h-3 rounded-full bg-orange-500\" />\n <span>Primitive (sleep, hook)</span>\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"w-3 h-3 rounded-full bg-red-500\" />\n <span>Conditional</span>\n </div>\n </div>\n\n {/* Edge types */}\n <div className=\"space-y-1 pt-2 border-t\">\n <div className=\"font-semibold text-[10px] text-muted-foreground mb-1.5\">\n Edge Types\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"w-8 h-0.5 bg-gray-500\" />\n <span>Sequential</span>\n </div>\n <div className=\"flex items-center gap-2\">\n <div\n className=\"w-8 h-0.5\"\n style={{\n backgroundImage:\n 'repeating-linear-gradient(90deg, #6b7280, #6b7280 4px, transparent 4px, transparent 8px)',\n }}\n />\n <span>Parallel / Loop / Conditional</span>\n </div>\n </div>\n </div>\n </Panel>\n </ReactFlow>\n </div>\n );\n}\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleStop\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/circle-stop\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleStop = createLucideIcon('CircleStop', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['rect', { x: '9', y: '9', width: '6', height: '6', rx: '1', key: '1ssd4o' }],\n]);\n\nexport default CircleStop;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Clock\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/clock\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Clock = createLucideIcon('Clock', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['polyline', { points: '12 6 12 12 16 14', key: '68esgv' }],\n]);\n\nexport default Clock;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Link2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/link-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Link2 = createLucideIcon('Link2', [\n ['path', { d: 'M9 17H7A5 5 0 0 1 7 7h2', key: '8i5ue5' }],\n ['path', { d: 'M15 7h2a5 5 0 1 1 0 10h-2', key: '1b9ql8' }],\n ['line', { x1: '8', x2: '16', y1: '12', y2: '12', key: '1jonct' }],\n]);\n\nexport default Link2;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CirclePlay\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/circle-play\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CirclePlay = createLucideIcon('CirclePlay', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['polygon', { points: '10 8 16 12 10 16 10 8', key: '1cimsy' }],\n]);\n\nexport default CirclePlay;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleX\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/circle-x\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleX = createLucideIcon('CircleX', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'm15 9-6 6', key: '1uzhvr' }],\n ['path', { d: 'm9 9 6 6', key: 'z0biqf' }],\n]);\n\nexport default CircleX;\n","import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name RotateCw\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/rotate-cw\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst RotateCw = createLucideIcon('RotateCw', [\n ['path', { d: 'M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8', key: '1p45f6' }],\n ['path', { d: 'M21 3v5h-5', key: '1q7to0' }],\n]);\n\nexport default RotateCw;\n","'use client';\n\nimport {\n analyzeEvents,\n cancelRun,\n type EnvMap,\n type Event,\n recreateRun,\n reenqueueRun,\n shouldShowReenqueueButton,\n wakeUpRun,\n} from '@workflow/web-shared';\nimport type { WorkflowRunStatus } from '@workflow/world';\nimport { Loader2, RotateCw, XCircle, Zap } from 'lucide-react';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { toast } from 'sonner';\nimport { DropdownMenuItem } from '@/components/ui/dropdown-menu';\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport { Button } from './ui/button';\n\n// ============================================================================\n// Shared Props and Types\n// ============================================================================\n\nexport interface RunActionCallbacks {\n onSuccess?: () => void;\n onNavigateToRun?: (runId: string) => void;\n}\n\nexport interface RunActionsBaseProps {\n env: EnvMap;\n runId: string;\n runStatus: WorkflowRunStatus | undefined;\n events?: Event[];\n eventsLoading?: boolean;\n callbacks?: RunActionCallbacks;\n}\n\n// ============================================================================\n// Shared Hook for Run Actions\n// ============================================================================\n\ninterface UseRunActionsOptions {\n env: EnvMap;\n runId: string;\n runStatus: WorkflowRunStatus | undefined;\n events?: Event[];\n callbacks?: RunActionCallbacks;\n}\n\nfunction useRunActions({\n env,\n runId,\n runStatus,\n events,\n callbacks,\n}: UseRunActionsOptions) {\n const [rerunning, setRerunning] = useState(false);\n const [reenqueuing, setReenqueuing] = useState(false);\n const [wakingUp, setWakingUp] = useState(false);\n const [cancelling, setCancelling] = useState(false);\n\n const eventAnalysis = useMemo(() => analyzeEvents(events), [events]);\n const hasPendingSleeps = eventAnalysis.hasPendingSleeps;\n\n const showReenqueueForStuckWorkflow = useMemo(\n () => shouldShowReenqueueButton(events, runStatus),\n [events, runStatus]\n );\n\n const handleReplay = useCallback(async () => {\n if (rerunning) return null;\n\n try {\n setRerunning(true);\n const newRunId = await recreateRun(env, runId);\n toast.success('New run started', {\n description: `Run ID: ${newRunId}`,\n });\n callbacks?.onSuccess?.();\n callbacks?.onNavigateToRun?.(newRunId);\n return newRunId;\n } catch (err) {\n toast.error('Failed to re-run', {\n description: err instanceof Error ? err.message : 'Unknown error',\n });\n return null;\n } finally {\n setRerunning(false);\n }\n }, [env, runId, rerunning, callbacks]);\n\n const handleReenqueue = useCallback(async () => {\n if (reenqueuing) return;\n\n try {\n setReenqueuing(true);\n await reenqueueRun(env, runId);\n toast.success('Run re-enqueued', {\n description: 'The workflow orchestration layer has been re-enqueued.',\n });\n callbacks?.onSuccess?.();\n } catch (err) {\n toast.error('Failed to re-enqueue', {\n description: err instanceof Error ? err.message : 'Unknown error',\n });\n } finally {\n setReenqueuing(false);\n }\n }, [env, runId, reenqueuing, callbacks]);\n\n const handleWakeUp = useCallback(async () => {\n if (wakingUp) return;\n\n try {\n setWakingUp(true);\n const result = await wakeUpRun(env, runId);\n if (result.stoppedCount > 0) {\n toast.success('Run woken up', {\n description: `Interrupted ${result.stoppedCount} pending sleep${result.stoppedCount > 1 ? 's' : ''} and woke up the run.`,\n });\n } else {\n toast.info('No pending sleeps', {\n description: 'There were no pending sleep calls to interrupt.',\n });\n }\n callbacks?.onSuccess?.();\n } catch (err) {\n toast.error('Failed to wake up', {\n description: err instanceof Error ? err.message : 'Unknown error',\n });\n } finally {\n setWakingUp(false);\n }\n }, [env, runId, wakingUp, callbacks]);\n\n const handleCancel = useCallback(async () => {\n if (cancelling) return;\n\n const isRunActive = runStatus === 'pending' || runStatus === 'running';\n if (!isRunActive) {\n toast.error('Cannot cancel', {\n description: 'Only active runs can be cancelled',\n });\n return;\n }\n\n try {\n setCancelling(true);\n await cancelRun(env, runId);\n toast.success('Run cancelled');\n callbacks?.onSuccess?.();\n } catch (err) {\n toast.error('Failed to cancel', {\n description: err instanceof Error ? err.message : 'Unknown error',\n });\n } finally {\n setCancelling(false);\n }\n }, [env, runId, runStatus, cancelling, callbacks]);\n\n return {\n // State\n rerunning,\n reenqueuing,\n wakingUp,\n cancelling,\n hasPendingSleeps,\n showReenqueueForStuckWorkflow,\n // Handlers\n handleReplay,\n handleReenqueue,\n handleWakeUp,\n handleCancel,\n };\n}\n\n// ============================================================================\n// Shared Tooltip Content\n// ============================================================================\n\nfunction WakeUpTooltipContent() {\n return (\n <>\n Interrupt any current calls to <code>sleep</code> and wake up the run.\n </>\n );\n}\n\nfunction ReenqueueTooltipContent({ isStuck }: { isStuck: boolean }) {\n if (isStuck) {\n return (\n <>\n This workflow has no active steps or sleep calls, it maybe be stuck.\n Re-enqueue the workflow orchestration layer to resume execution.\n </>\n );\n }\n return (\n <>\n Re-enqueue the workflow orchestration layer. This is a no-op, unless the\n workflow got stuck due to an implementation issue in the World. This is\n useful for debugging custom Worlds.\n </>\n );\n}\n\n// ============================================================================\n// Dropdown Menu Items (for runs-table)\n// ============================================================================\n\nexport interface RunActionsDropdownItemsProps extends RunActionsBaseProps {\n /** Stop click event propagation (useful in table rows) */\n stopPropagation?: boolean;\n /** Show debug actions like Re-enqueue (requires debug=1 URL param) */\n showDebugActions?: boolean;\n}\n\nexport function RunActionsDropdownItems({\n env,\n runId,\n runStatus,\n events,\n eventsLoading,\n callbacks,\n stopPropagation = false,\n showDebugActions = false,\n}: RunActionsDropdownItemsProps) {\n const {\n rerunning,\n reenqueuing,\n wakingUp,\n cancelling,\n hasPendingSleeps,\n showReenqueueForStuckWorkflow,\n handleReplay,\n handleReenqueue,\n handleWakeUp,\n handleCancel,\n } = useRunActions({ env, runId, runStatus, events, callbacks });\n\n const onReplay = (e: React.MouseEvent) => {\n if (stopPropagation) e.stopPropagation();\n handleReplay();\n };\n\n const onReenqueue = (e: React.MouseEvent) => {\n if (stopPropagation) e.stopPropagation();\n handleReenqueue();\n };\n\n const onWakeUp = (e: React.MouseEvent) => {\n if (stopPropagation) e.stopPropagation();\n handleWakeUp();\n };\n\n const onCancel = (e: React.MouseEvent) => {\n if (stopPropagation) e.stopPropagation();\n handleCancel();\n };\n\n const isRunActive = runStatus === 'pending' || runStatus === 'running';\n\n // Determine which button to show: Wake up, Re-enqueue, or disabled Wake up\n const showReenqueue =\n !eventsLoading && (showDebugActions || showReenqueueForStuckWorkflow);\n\n return (\n <>\n <DropdownMenuItem onClick={onReplay} disabled={rerunning}>\n <RotateCw className=\"h-4 w-4 mr-2\" />\n {rerunning ? 'Replaying...' : 'Replay Run'}\n </DropdownMenuItem>\n\n {/* Wake up / Re-enqueue button - mutually exclusive */}\n {eventsLoading ? (\n // Loading state: show Wake up button with spinner\n <DropdownMenuItem disabled>\n <Loader2 className=\"h-4 w-4 mr-2 animate-spin\" />\n Wake up\n </DropdownMenuItem>\n ) : showReenqueue ? (\n // Re-enqueue: shown when debug flag or stuck workflow detected\n <Tooltip>\n <TooltipTrigger asChild>\n <DropdownMenuItem onClick={onReenqueue} disabled={reenqueuing}>\n <Zap className=\"h-4 w-4 mr-2\" />\n {reenqueuing ? 'Re-enqueuing...' : 'Re-enqueue'}\n </DropdownMenuItem>\n </TooltipTrigger>\n <TooltipContent side=\"left\" className=\"max-w-xs\">\n <ReenqueueTooltipContent\n isStuck={showReenqueueForStuckWorkflow && !showDebugActions}\n />\n </TooltipContent>\n </Tooltip>\n ) : (\n // Wake up: enabled if pending sleeps, disabled otherwise\n <Tooltip>\n <TooltipTrigger asChild>\n <DropdownMenuItem\n onClick={onWakeUp}\n disabled={!hasPendingSleeps || wakingUp}\n >\n <Zap className=\"h-4 w-4 mr-2\" />\n {wakingUp ? 'Waking up...' : 'Wake up'}\n </DropdownMenuItem>\n </TooltipTrigger>\n <TooltipContent side=\"left\" className=\"max-w-xs\">\n {hasPendingSleeps ? (\n <WakeUpTooltipContent />\n ) : (\n <>No pending sleep calls to interrupt.</>\n )}\n </TooltipContent>\n </Tooltip>\n )}\n\n <DropdownMenuItem\n onClick={onCancel}\n disabled={!isRunActive || cancelling}\n >\n <XCircle className=\"h-4 w-4 mr-2\" />\n {cancelling ? 'Cancelling...' : 'Cancel'}\n </DropdownMenuItem>\n </>\n );\n}\n\n// ============================================================================\n// Buttons (for run-detail-view)\n// ============================================================================\n\nexport interface RunActionsButtonsProps extends RunActionsBaseProps {\n loading?: boolean;\n /** Called when cancel button is clicked - typically shows a confirmation dialog */\n onCancelClick?: () => void;\n /** Called when rerun button is clicked - typically shows a confirmation dialog */\n onRerunClick?: () => void;\n /** Show debug actions like Re-enqueue (requires debug=1 URL param) */\n showDebugActions?: boolean;\n}\n\nexport function RunActionsButtons({\n env,\n runId,\n runStatus,\n events,\n eventsLoading,\n loading,\n callbacks,\n onCancelClick,\n onRerunClick,\n showDebugActions = false,\n}: RunActionsButtonsProps) {\n const {\n reenqueuing,\n wakingUp,\n hasPendingSleeps,\n showReenqueueForStuckWorkflow,\n handleReenqueue,\n handleWakeUp,\n } = useRunActions({ env, runId, runStatus, events, callbacks });\n\n const isRunActive = runStatus === 'pending' || runStatus === 'running';\n const canCancel = isRunActive;\n\n // Rerun button logic\n const canRerun = !loading && !isRunActive;\n const rerunDisabledReason = loading\n ? 'Loading run data...'\n : isRunActive\n ? 'Cannot re-run while workflow is still running'\n : '';\n\n // Re-enqueue button logic\n const canReenqueue = !loading && !reenqueuing;\n const reenqueueDisabledReason = reenqueuing\n ? 'Re-enqueuing workflow...'\n : loading\n ? 'Loading run data...'\n : '';\n\n // Wake up button logic\n const canWakeUp = !loading && !wakingUp && hasPendingSleeps;\n const wakeUpDisabledReason = wakingUp\n ? 'Waking up workflow...'\n : loading\n ? 'Loading run data...'\n : !hasPendingSleeps\n ? 'No pending sleep calls to interrupt'\n : '';\n\n // Cancel button logic\n const cancelDisabledReason =\n runStatus === 'completed'\n ? 'Run has already completed'\n : runStatus === 'failed'\n ? 'Run has already failed'\n : runStatus === 'cancelled'\n ? 'Run has already been cancelled'\n : '';\n\n // Determine which button to show: Wake up, Re-enqueue, or disabled Wake up\n const showReenqueue =\n !eventsLoading && (showDebugActions || showReenqueueForStuckWorkflow);\n\n return (\n <>\n {/* Rerun Button */}\n <Tooltip>\n <TooltipTrigger asChild>\n <span>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={onRerunClick}\n disabled={!canRerun}\n >\n <RotateCw className=\"h-4 w-4\" />\n Replay\n </Button>\n </span>\n </TooltipTrigger>\n <TooltipContent>\n {rerunDisabledReason ? (\n <p>{rerunDisabledReason}</p>\n ) : (\n <p>\n This will start a new copy of the current run using the same\n deployment, environment, and inputs. It will not affect the\n current run.\n </p>\n )}\n </TooltipContent>\n </Tooltip>\n\n {/* Wake up / Re-enqueue Button - mutually exclusive */}\n {eventsLoading ? (\n // Loading state: show Wake up button with spinner\n <Button variant=\"outline\" size=\"sm\" disabled>\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n Wake up\n </Button>\n ) : showReenqueue ? (\n // Re-enqueue: shown when debug flag or stuck workflow detected\n <Tooltip>\n <TooltipTrigger asChild>\n <span>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleReenqueue}\n disabled={!canReenqueue || reenqueuing}\n >\n <Zap className=\"h-4 w-4\" />\n {reenqueuing ? 'Re-enqueuing...' : 'Re-enqueue'}\n </Button>\n </span>\n </TooltipTrigger>\n <TooltipContent className=\"max-w-xs\">\n {reenqueueDisabledReason ? (\n <p>{reenqueueDisabledReason}</p>\n ) : (\n <p>\n <ReenqueueTooltipContent\n isStuck={showReenqueueForStuckWorkflow && !showDebugActions}\n />\n </p>\n )}\n </TooltipContent>\n </Tooltip>\n ) : (\n // Wake up: enabled if pending sleeps, disabled otherwise\n <Tooltip>\n <TooltipTrigger asChild>\n <span>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleWakeUp}\n disabled={!canWakeUp || wakingUp}\n >\n <Zap className=\"h-4 w-4\" />\n {wakingUp ? 'Waking up...' : 'Wake up'}\n </Button>\n </span>\n </TooltipTrigger>\n <TooltipContent className=\"max-w-xs\">\n {wakeUpDisabledReason ? (\n <p>{wakeUpDisabledReason}</p>\n ) : (\n <p>\n <WakeUpTooltipContent />\n </p>\n )}\n </TooltipContent>\n </Tooltip>\n )}\n\n {/* Cancel Button */}\n <Tooltip>\n <TooltipTrigger asChild>\n <span>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={onCancelClick}\n disabled={!canCancel}\n >\n <XCircle className=\"h-4 w-4\" />\n Cancel\n </Button>\n </span>\n </TooltipTrigger>\n <TooltipContent>\n {cancelDisabledReason ? (\n <p>{cancelDisabledReason}</p>\n ) : (\n <p>Cancel the workflow run</p>\n )}\n </TooltipContent>\n </Tooltip>\n </>\n );\n}\n\n// ============================================================================\n// Hook for lazy loading events (alternative approach)\n// ============================================================================\n\nexport function useLazyEvents(\n fetchEvents: () => Promise<Event[]>,\n enabled: boolean\n) {\n const [events, setEvents] = useState<Event[] | undefined>(undefined);\n const [loading, setLoading] = useState(false);\n const [hasFetched, setHasFetched] = useState(false);\n\n useEffect(() => {\n if (!enabled || hasFetched) return;\n\n let cancelled = false;\n setLoading(true);\n\n fetchEvents()\n .then((result) => {\n if (!cancelled) {\n setEvents(result);\n setHasFetched(true);\n }\n })\n .catch((err) => {\n console.error('Failed to fetch events:', err);\n })\n .finally(() => {\n if (!cancelled) {\n setLoading(false);\n }\n });\n\n return () => {\n cancelled = true;\n };\n }, [enabled, hasFetched, fetchEvents]);\n\n return { events, loading };\n}\n","import { cn } from '@/lib/utils';\n\nfunction Skeleton({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn('animate-pulse rounded-md bg-muted', className)}\n {...props}\n />\n );\n}\n\nexport { Skeleton };\n","'use client';\n\nimport { parseAsString, useQueryState, useQueryStates } from 'nuqs';\n\n/**\n * Hook to manage sidebar state in URL\n */\nexport function useSidebarState() {\n return useQueryState('sidebar', parseAsString);\n}\n\n/**\n * Hook to manage theme state in URL\n */\nexport function useThemeState() {\n return useQueryState('theme', parseAsString.withDefault('system'));\n}\n\n/**\n * Hook to manage tab selection state in URL\n */\nexport function useTabState() {\n return useQueryState('tab', parseAsString.withDefault('runs'));\n}\n\n/**\n * Hook to manage multiple navigation params at once\n */\nexport function useNavigationParams() {\n return useQueryStates({\n sidebar: parseAsString,\n hookId: parseAsString,\n stepId: parseAsString,\n eventId: parseAsString,\n streamId: parseAsString,\n runId: parseAsString,\n id: parseAsString,\n resource: parseAsString,\n });\n}\n\n/**\n * Hook to manage individual navigation params\n */\nexport function useHookIdState() {\n return useQueryState('hookId', parseAsString);\n}\n\nexport function useStepIdState() {\n return useQueryState('stepId', parseAsString);\n}\n\nexport function useEventIdState() {\n return useQueryState('eventId', parseAsString);\n}\n\nexport function useStreamIdState() {\n return useQueryState('streamId', parseAsString);\n}\n\n/**\n * Hook to manage selected workflow ID for graph visualization\n */\nexport function useWorkflowIdState() {\n return useQueryState('workflowId', parseAsString);\n}\n"],"names":[],"mappings":"uCAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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