jinn-cli 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/src/engines/mock.d.ts +16 -0
  2. package/dist/src/engines/mock.d.ts.map +1 -0
  3. package/dist/src/engines/mock.js +47 -0
  4. package/dist/src/engines/mock.js.map +1 -0
  5. package/dist/src/gateway/__tests__/costs.test.d.ts +2 -0
  6. package/dist/src/gateway/__tests__/costs.test.d.ts.map +1 -0
  7. package/dist/src/gateway/__tests__/costs.test.js +32 -0
  8. package/dist/src/gateway/__tests__/costs.test.js.map +1 -0
  9. package/dist/src/gateway/api.d.ts.map +1 -1
  10. package/dist/src/gateway/api.js +112 -1
  11. package/dist/src/gateway/api.js.map +1 -1
  12. package/dist/src/gateway/budgets.d.ts +16 -0
  13. package/dist/src/gateway/budgets.d.ts.map +1 -0
  14. package/dist/src/gateway/budgets.js +39 -0
  15. package/dist/src/gateway/budgets.js.map +1 -0
  16. package/dist/src/gateway/costs.d.ts +19 -0
  17. package/dist/src/gateway/costs.d.ts.map +1 -0
  18. package/dist/src/gateway/costs.js +39 -0
  19. package/dist/src/gateway/costs.js.map +1 -0
  20. package/dist/src/gateway/goals.d.ts +11 -0
  21. package/dist/src/gateway/goals.d.ts.map +1 -0
  22. package/dist/src/gateway/goals.js +72 -0
  23. package/dist/src/gateway/goals.js.map +1 -0
  24. package/dist/src/sessions/manager.d.ts.map +1 -1
  25. package/dist/src/sessions/manager.js +25 -0
  26. package/dist/src/sessions/manager.js.map +1 -1
  27. package/dist/src/sessions/registry.d.ts.map +1 -1
  28. package/dist/src/sessions/registry.js +26 -0
  29. package/dist/src/sessions/registry.js.map +1 -1
  30. package/dist/src/shared/types.d.ts +13 -0
  31. package/dist/src/shared/types.d.ts.map +1 -1
  32. package/dist/web/404.html +1 -1
  33. package/dist/web/_next/static/1HnqYp-z0yEkKBQwXlWh1/_buildManifest.js +1 -0
  34. package/dist/web/_next/static/1HnqYp-z0yEkKBQwXlWh1/_ssgManifest.js +1 -0
  35. package/dist/web/_next/static/chunks/144-548cab85cf18301a.js +1 -0
  36. package/dist/web/_next/static/chunks/155-592ad81a5c00a38a.js +1 -0
  37. package/dist/web/_next/static/chunks/192-bd69b67fd03b9f3d.js +1 -0
  38. package/dist/web/_next/static/chunks/458-85ba1833ffcc2e6c.js +1 -0
  39. package/dist/web/_next/static/chunks/51-ea7256657692ba90.js +1 -0
  40. package/dist/web/_next/static/chunks/625-93dc90080662b8f4.js +1 -0
  41. package/dist/web/_next/static/chunks/6d25620b-d9f90746a7f2178c.js +1 -0
  42. package/dist/web/_next/static/chunks/7273c211.7ff69b7844551452.js +1 -0
  43. package/dist/web/_next/static/chunks/743.588b42b673795913.js +1 -0
  44. package/dist/web/_next/static/chunks/865-b4eb9a132b937321.js +1 -0
  45. package/dist/web/_next/static/chunks/943.1c6d37432bcad8e8.js +1 -0
  46. package/dist/web/_next/static/chunks/app/_not-found/page-22b69e9fb96ef3fc.js +1 -0
  47. package/dist/web/_next/static/chunks/app/chat/page-28df51d87ba7e82b.js +1 -0
  48. package/dist/web/_next/static/chunks/app/cron/page-4ede68bcdb3e76ca.js +1 -0
  49. package/dist/web/_next/static/chunks/app/kanban/page-0e1b2a66378b8a6b.js +1 -0
  50. package/dist/web/_next/static/chunks/app/layout-ab9ba2b24a88513d.js +1 -0
  51. package/dist/web/_next/static/chunks/app/logs/page-b2ea0e6b92c54706.js +1 -0
  52. package/dist/web/_next/static/chunks/app/org/page-05c8d33b3bf07d3d.js +1 -0
  53. package/dist/web/_next/static/chunks/app/page-57dcf41f8ef011a7.js +1 -0
  54. package/dist/web/_next/static/chunks/app/sessions/page-17f8dfdb90a924a7.js +1 -0
  55. package/dist/web/_next/static/chunks/app/settings/page-2903a5e9b8b0fc4a.js +1 -0
  56. package/dist/web/_next/static/chunks/app/skills/page-971feac69b3a1383.js +1 -0
  57. package/dist/web/_next/static/chunks/framework-33aa4529cc42a877.js +1 -0
  58. package/dist/web/_next/static/chunks/main-app-72a2d12a170701ef.js +1 -0
  59. package/dist/web/_next/static/chunks/main-c1296ca5f4362ccd.js +1 -0
  60. package/dist/web/_next/static/chunks/pages/_app-033e463982aa0ffc.js +1 -0
  61. package/dist/web/_next/static/chunks/pages/_error-de3b15b767c34e44.js +1 -0
  62. package/dist/web/_next/static/chunks/webpack-440561fa60ef8a8f.js +1 -0
  63. package/dist/web/_next/static/css/e79d77e53f783583.css +1 -0
  64. package/dist/web/chat.html +1 -1
  65. package/dist/web/chat.txt +12 -12
  66. package/dist/web/cron.html +1 -1
  67. package/dist/web/cron.txt +12 -12
  68. package/dist/web/index.html +1 -1
  69. package/dist/web/index.txt +12 -12
  70. package/dist/web/kanban.html +1 -1
  71. package/dist/web/kanban.txt +12 -12
  72. package/dist/web/logs.html +2 -2
  73. package/dist/web/logs.txt +12 -12
  74. package/dist/web/org.html +1 -1
  75. package/dist/web/org.txt +12 -12
  76. package/dist/web/sessions.html +1 -1
  77. package/dist/web/sessions.txt +10 -10
  78. package/dist/web/settings.html +1 -1
  79. package/dist/web/settings.txt +12 -12
  80. package/dist/web/skills.html +1 -1
  81. package/dist/web/skills.txt +12 -12
  82. package/dist/web.bak/404.html +1 -0
  83. package/dist/web.bak/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
  84. package/dist/web.bak/chat.html +1 -0
  85. package/dist/web.bak/chat.txt +20 -0
  86. package/dist/web.bak/cron.html +1 -0
  87. package/dist/web.bak/cron.txt +20 -0
  88. package/dist/web.bak/index.html +1 -0
  89. package/dist/web.bak/index.txt +20 -0
  90. package/dist/web.bak/kanban.html +1 -0
  91. package/dist/web.bak/kanban.txt +20 -0
  92. package/dist/web.bak/logs.html +7 -0
  93. package/dist/web.bak/logs.txt +20 -0
  94. package/dist/web.bak/org.html +1 -0
  95. package/dist/web.bak/org.txt +20 -0
  96. package/dist/web.bak/sessions.html +1 -0
  97. package/dist/web.bak/sessions.txt +17 -0
  98. package/dist/web.bak/settings.html +1 -0
  99. package/dist/web.bak/settings.txt +20 -0
  100. package/dist/web.bak/skills.html +1 -0
  101. package/dist/web.bak/skills.txt +20 -0
  102. package/package.json +5 -3
  103. /package/dist/{web → web.bak}/_next/static/QrKxazgwMrykF2yLwDvUM/_buildManifest.js +0 -0
  104. /package/dist/{web → web.bak}/_next/static/QrKxazgwMrykF2yLwDvUM/_ssgManifest.js +0 -0
  105. /package/dist/{web → web.bak}/_next/static/chunks/184-5a617386af9a1dd3.js +0 -0
  106. /package/dist/{web → web.bak}/_next/static/chunks/198-fd91406a158c5c25.js +0 -0
  107. /package/dist/{web → web.bak}/_next/static/chunks/517.62389e8d3c929c43.js +0 -0
  108. /package/dist/{web → web.bak}/_next/static/chunks/534-17c49c944e0d0fe1.js +0 -0
  109. /package/dist/{web → web.bak}/_next/static/chunks/573-070537ec2452d03e.js +0 -0
  110. /package/dist/{web → web.bak}/_next/static/chunks/590-2c34156c7417317e.js +0 -0
  111. /package/dist/{web → web.bak}/_next/static/chunks/700-ad04a2a5b3c8880f.js +0 -0
  112. /package/dist/{web → web.bak}/_next/static/chunks/7273c211.06e3b6021d90b73f.js +0 -0
  113. /package/dist/{web → web.bak}/_next/static/chunks/743-5bb03adbb0e4ddec.js +0 -0
  114. /package/dist/{web → web.bak}/_next/static/chunks/874.97d5a27895061057.js +0 -0
  115. /package/dist/{web → web.bak}/_next/static/chunks/8e6518bb-c26e82767f1faf66.js +0 -0
  116. /package/dist/{web → web.bak}/_next/static/chunks/app/_not-found/page-7d43a486b7014af3.js +0 -0
  117. /package/dist/{web → web.bak}/_next/static/chunks/app/chat/page-36edb6fc1d1e880b.js +0 -0
  118. /package/dist/{web → web.bak}/_next/static/chunks/app/costs/page-6c5cd46a6b3cde21.js +0 -0
  119. /package/dist/{web → web.bak}/_next/static/chunks/app/cron/page-210d9d333a7eed94.js +0 -0
  120. /package/dist/{web → web.bak}/_next/static/chunks/app/kanban/page-c32370bcd6a7c841.js +0 -0
  121. /package/dist/{web → web.bak}/_next/static/chunks/app/layout-3ad6b73a0904c24b.js +0 -0
  122. /package/dist/{web → web.bak}/_next/static/chunks/app/logs/page-7322a6789e16dca4.js +0 -0
  123. /package/dist/{web → web.bak}/_next/static/chunks/app/org/page-02263c5702e0fd3e.js +0 -0
  124. /package/dist/{web → web.bak}/_next/static/chunks/app/page-b68dcf7b8802c704.js +0 -0
  125. /package/dist/{web → web.bak}/_next/static/chunks/app/sessions/page-bf7ad2fac281c7d6.js +0 -0
  126. /package/dist/{web → web.bak}/_next/static/chunks/app/settings/page-d3b89563c42be2e5.js +0 -0
  127. /package/dist/{web → web.bak}/_next/static/chunks/app/skills/page-194f4e97f29ab581.js +0 -0
  128. /package/dist/{web → web.bak}/_next/static/chunks/framework-077b27ad7787463c.js +0 -0
  129. /package/dist/{web → web.bak}/_next/static/chunks/main-app-0c65af8a0fd99888.js +0 -0
  130. /package/dist/{web → web.bak}/_next/static/chunks/main-f1c74cefd4965abf.js +0 -0
  131. /package/dist/{web → web.bak}/_next/static/chunks/pages/_app-77a85fe7d6bca671.js +0 -0
  132. /package/dist/{web → web.bak}/_next/static/chunks/pages/_error-68febf4b34900064.js +0 -0
  133. /package/dist/{web → web.bak}/_next/static/chunks/webpack-0f39b7e91dce9791.js +0 -0
  134. /package/dist/{web → web.bak}/_next/static/css/b809b6af2d241fc8.css +0 -0
  135. /package/dist/{web → web.bak}/costs.html +0 -0
  136. /package/dist/{web → web.bak}/costs.txt +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[763],{4941:(e,t,n)=>{n.d(t,{Gc:()=>th,H2:()=>tk,ck:()=>tm,fM:()=>tv,h7:()=>ev});var o,l=n(4130),r=n(7946),a=n(3724),i=n(2916),s=n(8706),d=n(7494);n(1383);let c=(0,r.createContext)(null),u=c.Provider,g=i.xc.error001();function f(e,t){let n=(0,r.useContext)(c);if(null===n)throw Error(g);return(0,s.n)(n,e,t)}function p(){let e=(0,r.useContext)(c);if(null===e)throw Error(g);return(0,r.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}let h={display:"none"},m={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},v="react-flow__node-desc",b="react-flow__edge-desc",y=e=>e.ariaLiveMessage,x=e=>e.ariaLabelConfig;function S(e){let{rfId:t}=e,n=f(y);return(0,l.jsx)("div",{id:"".concat("react-flow__aria-live","-").concat(t),"aria-live":"assertive","aria-atomic":"true",style:m,children:n})}function w(e){let{rfId:t,disableKeyboardA11y:n}=e,o=f(x);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{id:"".concat(v,"-").concat(t),style:h,children:n?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),(0,l.jsx)("div",{id:"".concat(b,"-").concat(t),style:h,children:o["edge.a11yDescription.default"]}),!n&&(0,l.jsx)(S,{rfId:t})]})}let C=(0,r.forwardRef)((e,t)=>{let{position:n="top-left",children:o,className:r,style:i,...s}=e,d="".concat(n).split("-");return(0,l.jsx)("div",{className:(0,a.A)(["react-flow__panel",r,...d]),style:i,ref:t,...s,children:o})});function E(e){let{proOptions:t,position:n="bottom-right"}=e;return(null==t?void 0:t.hideAttribution)?null:(0,l.jsx)(C,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:(0,l.jsx)("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}C.displayName="Panel";let N=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},k=e=>e.id;function M(e,t){return(0,d.x)(e.selectedNodes.map(k),t.selectedNodes.map(k))&&(0,d.x)(e.selectedEdges.map(k),t.selectedEdges.map(k))}function P(e){let{onSelectionChange:t}=e,n=p(),{selectedNodes:o,selectedEdges:l}=f(N,M);return(0,r.useEffect)(()=>{let e={nodes:o,edges:l};null==t||t(e),n.getState().onSelectionChangeHandlers.forEach(t=>t(e))},[o,l,t]),null}let D=e=>!!e.onSelectionChangeHandlers;function j(e){let{onSelectionChange:t}=e,n=f(D);return t||n?(0,l.jsx)(P,{onSelectionChange:t}):null}let A=[0,0],I={x:0,y:0,zoom:1},O=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode","rfId"],R=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),_={translateExtent:i.ZO,nodeOrigin:A,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function L(e){let{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:l,setTranslateExtent:a,setNodeExtent:s,reset:c,setDefaultNodesAndEdges:u}=f(R,d.x),g=p();(0,r.useEffect)(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=_,c()}),[]);let h=(0,r.useRef)(_);return(0,r.useEffect)(()=>{for(let r of O){let d=e[r];d!==h.current[r]&&void 0!==e[r]&&("nodes"===r?t(d):"edges"===r?n(d):"minZoom"===r?o(d):"maxZoom"===r?l(d):"translateExtent"===r?a(d):"nodeExtent"===r?s(d):"ariaLabelConfig"===r?g.setState({ariaLabelConfig:(0,i.Q6)(d)}):"fitView"===r?g.setState({fitViewQueued:d}):"fitViewOptions"===r?g.setState({fitViewOptions:d}):g.setState({[r]:d}))}h.current=e},O.map(t=>e[t])),null}function z(){return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}let B="undefined"!=typeof document?document:null;function V(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{target:B,actInsideInputWithModifier:!0},[n,o]=(0,r.useState)(!1),l=(0,r.useRef)(!1),a=(0,r.useRef)(new Set([])),[s,d]=(0,r.useMemo)(()=>{if(null!==e){let t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace("+","\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,r.useEffect)(()=>{var n,r;let c=null!=(n=null==t?void 0:t.target)?n:B,u=null==(r=null==t?void 0:t.actInsideInputWithModifier)||r;if(null!==e){let e=e=>{if(l.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!l.current||l.current&&!u)&&(0,i.v5)(e))return!1;let n=T(e.code,d);if(a.current.add(e[n]),H(s,a.current,!1)){var r,c;let n=(null==(c=e.composedPath)||null==(r=c.call(e))?void 0:r[0])||e.target,a=(null==n?void 0:n.nodeName)==="BUTTON"||(null==n?void 0:n.nodeName)==="A";!1!==t.preventDefault&&(l.current||!a)&&e.preventDefault(),o(!0)}},n=e=>{let t=T(e.code,d);H(s,a.current,!0)?(o(!1),a.current.clear()):a.current.delete(e[t]),"Meta"===e.key&&a.current.clear(),l.current=!1},r=()=>{a.current.clear(),o(!1)};return null==c||c.addEventListener("keydown",e),null==c||c.addEventListener("keyup",n),window.addEventListener("blur",r),window.addEventListener("contextmenu",r),()=>{null==c||c.removeEventListener("keydown",e),null==c||c.removeEventListener("keyup",n),window.removeEventListener("blur",r),window.removeEventListener("contextmenu",r)}}},[e,o]),n}function H(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function T(e,t){return t.includes(e)?"code":"key"}function F(e,t){let n=[],o=new Map,l=[];for(let t of e)if("add"===t.type){l.push(t);continue}else if("remove"===t.type||"replace"===t.type)o.set(t.id,[t]);else{let e=o.get(t.id);e?e.push(t):o.set(t.id,[t])}for(let e of t){let t=o.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}let l={...e};for(let e of t){var r=e,a=l;switch(r.type){case"select":a.selected=r.selected;break;case"position":void 0!==r.position&&(a.position=r.position),void 0!==r.dragging&&(a.dragging=r.dragging);break;case"dimensions":void 0!==r.dimensions&&(a.measured={...r.dimensions},r.setAttributes&&((!0===r.setAttributes||"width"===r.setAttributes)&&(a.width=r.dimensions.width),(!0===r.setAttributes||"height"===r.setAttributes)&&(a.height=r.dimensions.height))),"boolean"==typeof r.resizing&&(a.resizing=r.resizing)}}n.push(l)}return l.length&&l.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function Z(e,t){return{id:e,type:"select",selected:t}}function X(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=[];for(let[l,r]of e){let e=t.has(l);(void 0!==r.selected||e)&&r.selected!==e&&(n&&(r.selected=e),o.push(Z(r.id,e)))}return o}function K(e){let{items:t=[],lookup:n}=e,o=[],l=new Map(t.map(e=>[e.id,e]));for(let[e,l]of t.entries()){var r,a;let t=n.get(l.id),i=null!=(a=null==t||null==(r=t.internals)?void 0:r.userNode)?a:t;void 0!==i&&i!==l&&o.push({id:l.id,item:l,type:"replace"}),void 0===i&&o.push({item:l,type:"add",index:e})}for(let[e]of n)void 0===l.get(e)&&o.push({id:e,type:"remove"});return o}function W(e){return{id:e.id,type:"remove"}}let Y=e=>(0,i.oB)(e);function Q(e){return(0,r.forwardRef)(e)}let U="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function G(e){let[t,n]=(0,r.useState)(BigInt(0)),[o]=(0,r.useState)(()=>{var e;let t;return e=()=>n(e=>e+BigInt(1)),t=[],{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}});return U(()=>{let t=o.get();t.length&&(e(t),o.reset())},[t]),o}let q=(0,r.createContext)(null);function $(e){let{children:t}=e,n=p(),o=G((0,r.useCallback)(e=>{let{nodes:t=[],setNodes:o,hasDefaultNodes:l,onNodesChange:r,nodeLookup:a,fitViewQueued:i,onNodesChangeMiddlewareMap:s}=n.getState(),d=t;for(let t of e)d="function"==typeof t?t(d):t;let c=K({items:d,lookup:a});for(let e of s.values())c=e(c);l&&o(d),c.length>0?null==r||r(c):i&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:t,setNodes:o}=n.getState();e&&o(t)})},[])),a=G((0,r.useCallback)(e=>{let{edges:t=[],setEdges:o,hasDefaultEdges:l,onEdgesChange:r,edgeLookup:a}=n.getState(),i=t;for(let t of e)i="function"==typeof t?t(i):t;l?o(i):r&&r(K({items:i,lookup:a}))},[])),i=(0,r.useMemo)(()=>({nodeQueue:o,edgeQueue:a}),[]);return(0,l.jsx)(q.Provider,{value:i,children:t})}let J=e=>!!e.panZoom;function ee(){let e=(()=>{let e=p();return(0,r.useMemo)(()=>({zoomIn:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:null==t?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:null==t?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{let{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:null==n?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{var o,l,r;let{transform:[a,i,s],panZoom:d}=e.getState();return d?(await d.setViewport({x:null!=(o=t.x)?o:a,y:null!=(l=t.y)?l:i,zoom:null!=(r=t.zoom)?r:s},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{let[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{var o;let{width:l,height:r,minZoom:a,maxZoom:s,panZoom:d}=e.getState(),c=(0,i.R4)(t,l,r,a,s,null!=(o=null==n?void 0:n.padding)?o:.1);return d?(await d.setViewport(c,{duration:null==n?void 0:n.duration,ease:null==n?void 0:n.ease,interpolate:null==n?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:function(t){var n,o;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{transform:r,snapGrid:a,snapToGrid:s,domNode:d}=e.getState();if(!d)return t;let{x:c,y:u}=d.getBoundingClientRect(),g={x:t.x-c,y:t.y-u},f=null!=(n=l.snapGrid)?n:a,p=null!=(o=l.snapToGrid)?o:s;return(0,i.Ff)(g,r,p,f)},flowToScreenPosition:t=>{let{transform:n,domNode:o}=e.getState();if(!o)return t;let{x:l,y:r}=o.getBoundingClientRect(),a=(0,i.zj)(t,n);return{x:a.x+l,y:a.y+r}}}),[])})(),t=p(),n=function(){let e=(0,r.useContext)(q);if(!e)throw Error("useBatchContext must be used within a BatchProvider");return e}(),o=f(J),l=(0,r.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),o=e=>{n.nodeQueue.push(e)},l=e=>{n.edgeQueue.push(e)},r=e=>{var n,o,l,r;let{nodeLookup:a,nodeOrigin:s}=t.getState(),d=Y(e)?e:a.get(e.id),c=d.parentId?(0,i.us)(d.position,d.measured,d.parentId,a,s):d.position,u={...d,position:c,width:null!=(l=null==(n=d.measured)?void 0:n.width)?l:d.width,height:null!=(r=null==(o=d.measured)?void 0:o.height)?r:d.height};return(0,i.kM)(u)},a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{replace:!1};o(o=>o.map(o=>{if(o.id===e){let e="function"==typeof t?t(o):t;return n.replace&&Y(e)?e:{...o,...e}}return o}))},s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{replace:!1};l(o=>o.map(o=>{if(o.id===e){let e="function"==typeof t?t(o):t;return n.replace&&(0,i.b$)(e)?e:{...o,...e}}return o}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>{var n;return null==(n=e(t))?void 0:n.internals.userNode},getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:o,setEdges:l,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:o}=t.getState(),[l,r,a]=o;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:l,y:r,zoom:a}}},deleteElements:async e=>{let{nodes:n=[],edges:o=[]}=e,{nodes:l,edges:r,onNodesDelete:a,onEdgesDelete:s,triggerNodeChanges:d,triggerEdgeChanges:c,onDelete:u,onBeforeDelete:g}=t.getState(),{nodes:f,edges:p}=await (0,i.Tq)({nodesToRemove:n,edgesToRemove:o,nodes:l,edges:r,onBeforeDelete:g}),h=p.length>0,m=f.length>0;if(h){let e=p.map(W);null==s||s(p),c(e)}if(m){let e=f.map(W);null==a||a(f),d(e)}return(m||h)&&(null==u||u({nodes:f,edges:p})),{deletedNodes:f,deletedEdges:p}},getIntersectingNodes:function(e){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],o=arguments.length>2?arguments[2]:void 0,l=(0,i.mW)(e),a=l?e:r(e),s=void 0!==o;return a?(o||t.getState().nodes).filter(o=>{let r=t.getState().nodeLookup.get(o.id);if(r&&!l&&(o.id===e.id||!r.internals.positionAbsolute))return!1;let d=(0,i.kM)(s?o:r),c=(0,i.X6)(d,a);return n&&c>0||c>=d.width*d.height||c>=a.width*a.height}):[]},isNodeIntersecting:function(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],o=(0,i.mW)(e)?e:r(e);if(!o)return!1;let l=(0,i.X6)(o,t);return n&&l>0||l>=t.width*t.height||l>=o.width*o.height},updateNode:a,updateNodeData:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{replace:!1};a(e,e=>{let o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}},n)},updateEdge:s,updateEdgeData:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{replace:!1};s(e,e=>{let o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:o}=t.getState();return(0,i.Jo)(e,{nodeLookup:n,nodeOrigin:o})},getHandleConnections:e=>{var n,o;let{type:l,id:r,nodeId:a}=e;return Array.from(null!=(o=null==(n=t.getState().connectionLookup.get("".concat(a,"-").concat(l).concat(r?"-".concat(r):"")))?void 0:n.values())?o:[])},getNodeConnections:e=>{var n,o;let{type:l,handleId:r,nodeId:a}=e;return Array.from(null!=(o=null==(n=t.getState().connectionLookup.get("".concat(a).concat(l?r?"-".concat(l,"-").concat(r):"-".concat(l):"")))?void 0:n.values())?o:[])},fitView:async e=>{var o;let l=null!=(o=t.getState().fitViewResolver)?o:(0,i.YN)();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:l}),n.nodeQueue.push(e=>[...e]),l.promise}}},[]);return(0,r.useMemo)(()=>({...l,...e,viewportInitialized:o}),[o])}let et=e=>e.selected,en="undefined"!=typeof window?window:void 0,eo={position:"absolute",width:"100%",height:"100%",top:0,left:0},el=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function er(e){let{onPaneContextMenu:t,zoomOnScroll:n=!0,zoomOnPinch:o=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:c=i.ny.Free,zoomOnDoubleClick:u=!0,panOnDrag:g=!0,defaultViewport:h,translateExtent:m,minZoom:v,maxZoom:b,zoomActivationKeyCode:y,preventScrolling:x=!0,children:S,noWheelClassName:w,noPanClassName:C,onViewportChange:E,isControlledViewport:N,paneClickDistance:k,selectionOnDrag:M}=e,P=p(),D=(0,r.useRef)(null),{userSelectionActive:j,lib:A,connectionInProgress:I}=f(el,d.x),O=V(y),R=(0,r.useRef)(),_=p();(0,r.useEffect)(()=>{let e=()=>{var e,t,n,o,l;if(!D.current||!(null==(n=null==(e=(t=D.current).checkVisibility)?void 0:e.call(t))||n))return!1;let r=(0,i.Eo)(D.current);(0===r.height||0===r.width)&&(null==(o=(l=_.getState()).onError)||o.call(l,"004",i.xc.error004())),_.setState({width:r.width||500,height:r.height||500})};if(D.current){e(),window.addEventListener("resize",e);let t=new ResizeObserver(()=>e());return t.observe(D.current),()=>{window.removeEventListener("resize",e),t&&D.current&&t.unobserve(D.current)}}},[]);let L=(0,r.useCallback)(e=>{null==E||E({x:e[0],y:e[1],zoom:e[2]}),N||P.setState({transform:e})},[E,N]);return(0,r.useEffect)(()=>{if(D.current){R.current=(0,i.kO)({domNode:D.current,minZoom:v,maxZoom:b,translateExtent:m,viewport:h,onDraggingChange:e=>P.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:o}=P.getState();null==o||o(e,t),null==n||n(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:o}=P.getState();null==o||o(e,t),null==n||n(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:o}=P.getState();null==o||o(e,t),null==n||n(t)}});let{x:e,y:t,zoom:n}=R.current.getViewport();return P.setState({panZoom:R.current,transform:[e,t,n],domNode:D.current.closest(".react-flow")}),()=>{var e;null==(e=R.current)||e.destroy()}}},[]),(0,r.useEffect)(()=>{var e;null==(e=R.current)||e.update({onPaneContextMenu:t,zoomOnScroll:n,zoomOnPinch:o,panOnScroll:a,panOnScrollSpeed:s,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:g,zoomActivationKeyPressed:O,preventScrolling:x,noPanClassName:C,userSelectionActive:j,noWheelClassName:w,lib:A,onTransformChange:L,connectionInProgress:I,selectionOnDrag:M,paneClickDistance:k})},[t,n,o,a,s,c,u,g,O,x,C,j,w,A,L,I,M,k]),(0,l.jsx)("div",{className:"react-flow__renderer",ref:D,style:eo,children:S})}let ea=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ei(){let{userSelectionActive:e,userSelectionRect:t}=f(ea,d.x);return e&&t?(0,l.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:"translate(".concat(t.x,"px, ").concat(t.y,"px)")}}):null}let es=(e,t)=>n=>{n.target===t.current&&(null==e||e(n))},ed=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function ec(e){let{isSelecting:t,selectionKeyPressed:n,selectionMode:o=i.Qc.Full,panOnDrag:s,paneClickDistance:c,selectionOnDrag:u,onSelectionStart:g,onSelectionEnd:h,onPaneClick:m,onPaneContextMenu:v,onPaneScroll:b,onPaneMouseEnter:y,onPaneMouseMove:x,onPaneMouseLeave:S,children:w}=e,C=p(),{userSelectionActive:E,elementsSelectable:N,dragging:k,connectionInProgress:M}=f(ed,d.x),P=N&&(t||E),D=(0,r.useRef)(null),j=(0,r.useRef)(),A=(0,r.useRef)(new Set),I=(0,r.useRef)(new Set),O=(0,r.useRef)(!1),R=e=>{if(O.current||M){O.current=!1;return}null==m||m(e),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},_=!0===s||Array.isArray(s)&&s.includes(0);return(0,l.jsxs)("div",{className:(0,a.A)(["react-flow__pane",{draggable:_,dragging:k,selection:t}]),onClick:P?void 0:es(R,D),onContextMenu:es(e=>{if(Array.isArray(s)&&(null==s?void 0:s.includes(2)))return void e.preventDefault();null==v||v(e)},D),onWheel:es(b?e=>b(e):void 0,D),onPointerEnter:P?void 0:y,onPointerMove:P?e=>{var t,l;let{userSelectionRect:r,transform:a,nodeLookup:s,edgeLookup:d,connectionLookup:u,triggerNodeChanges:f,triggerEdgeChanges:p,defaultEdgeOptions:h,resetSelectedElements:m}=C.getState();if(!j.current||!r)return;let{x:v,y:b}=(0,i.q1)(e.nativeEvent,j.current),{startX:y,startY:x}=r;if(!O.current){if(Math.hypot(v-y,b-x)<=(n?0:c))return;m(),null==g||g(e)}O.current=!0;let S={startX:y,startY:x,x:v<y?v:y,y:b<x?b:x,width:Math.abs(v-y),height:Math.abs(b-x)},w=A.current,E=I.current;A.current=new Set((0,i.U$)(s,S,a,o===i.Qc.Partial,!0).map(e=>e.id)),I.current=new Set;let N=null==(t=null==h?void 0:h.selectable)||t;for(let e of A.current){let t=u.get(e);if(t)for(let{edgeId:e}of t.values()){let t=d.get(e);t&&(null!=(l=t.selectable)?l:N)&&I.current.add(e)}}(0,i._s)(w,A.current)||f(X(s,A.current,!0)),(0,i._s)(E,I.current)||p(X(d,I.current)),C.setState({userSelectionRect:S,userSelectionActive:!0,nodesSelectionActive:!1})}:x,onPointerUp:P?e=>{var t,n;0===e.button&&(null==(n=e.target)||null==(t=n.releasePointerCapture)||t.call(n,e.pointerId),!E&&e.target===D.current&&C.getState().userSelectionRect&&(null==R||R(e)),C.setState({userSelectionActive:!1,userSelectionRect:null}),O.current&&(null==h||h(e),C.setState({nodesSelectionActive:A.current.size>0})))}:void 0,onPointerDownCapture:P?e=>{var o,l;let{domNode:r}=C.getState();if(j.current=null==r?void 0:r.getBoundingClientRect(),!j.current)return;let a=e.target===D.current;if(!a&&e.target.closest(".nokey")||!t||!(u&&a||n)||0!==e.button||!e.isPrimary)return;null==(l=e.target)||null==(o=l.setPointerCapture)||o.call(l,e.pointerId),O.current=!1;let{x:s,y:d}=(0,i.q1)(e.nativeEvent,j.current);C.setState({userSelectionRect:{width:0,height:0,startX:s,startY:d,x:s,y:d}}),a||(e.stopPropagation(),e.preventDefault())}:void 0,onClickCapture:P?e=>{O.current&&(e.stopPropagation(),O.current=!1)}:void 0,onPointerLeave:S,ref:D,style:eo,children:[w,(0,l.jsx)(ei,{})]})}function eu(e){let{id:t,store:n,unselect:o=!1,nodeRef:l}=e,{addSelectedNodes:r,unselectNodesAndEdges:a,multiSelectionActive:s,nodeLookup:d,onError:c}=n.getState(),u=d.get(t);if(!u){null==c||c("012",i.xc.error012(t));return}n.setState({nodesSelectionActive:!1}),u.selected?(o||u.selected&&s)&&(a({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var e;return null==l||null==(e=l.current)?void 0:e.blur()})):r([t])}function eg(e){let{nodeRef:t,disabled:n=!1,noDragClassName:o,handleSelector:l,nodeId:a,isSelectable:s,nodeClickDistance:d}=e,c=p(),[u,g]=(0,r.useState)(!1),f=(0,r.useRef)();return(0,r.useEffect)(()=>{f.current=(0,i.I$)({getStoreItems:()=>c.getState(),onNodeMouseDown:e=>{eu({id:e,store:c,nodeRef:t})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}})},[]),(0,r.useEffect)(()=>{if(!n&&t.current&&f.current)return f.current.update({noDragClassName:o,handleSelector:l,domNode:t.current,isSelectable:s,nodeId:a,nodeClickDistance:d}),()=>{var e;null==(e=f.current)||e.destroy()}},[o,l,n,s,t,a,d]),u}function ef(){let e=p();return(0,r.useCallback)(t=>{let{nodeExtent:n,snapToGrid:o,snapGrid:l,nodesDraggable:r,onError:a,updateNodePositions:s,nodeLookup:d,nodeOrigin:c}=e.getState(),u=new Map,g=e=>e.selected&&(e.draggable||r&&void 0===e.draggable),f=o?l[0]:5,p=o?l[1]:5,h=t.direction.x*f*t.factor,m=t.direction.y*p*t.factor;for(let[,e]of d){if(!g(e))continue;let t={x:e.internals.positionAbsolute.x+h,y:e.internals.positionAbsolute.y+m};o&&(t=(0,i.s_)(t,l));let{position:r,positionAbsolute:s}=(0,i.aE)({nodeId:e.id,nextPosition:t,nodeLookup:d,nodeExtent:n,nodeOrigin:c,onError:a});e.position=r,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}let ep=(0,r.createContext)(null),eh=ep.Provider;ep.Consumer;let em=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ev=(0,r.memo)(Q(function(e,t){let{type:n="source",position:o=i.yX.Top,isValidConnection:s,isConnectable:c=!0,isConnectableStart:u=!0,isConnectableEnd:g=!0,id:h,onConnect:m,children:v,className:b,onMouseDown:y,onTouchStart:x,...S}=e,w=h||null,C="target"===n,E=p(),N=(0,r.useContext)(ep),{connectOnClick:k,noPanClassName:M,rfId:P}=f(em,d.x),{connectingFrom:D,connectingTo:j,clickConnecting:A,isPossibleEndHandle:I,connectionInProcess:O,clickConnectionInProcess:R,valid:_}=f(e=>{let{connectionClickStartHandle:t,connectionMode:o,connection:l}=e,{fromHandle:r,toHandle:a,isValid:s}=l,d=(null==a?void 0:a.nodeId)===N&&(null==a?void 0:a.id)===w&&(null==a?void 0:a.type)===n;return{connectingFrom:(null==r?void 0:r.nodeId)===N&&(null==r?void 0:r.id)===w&&(null==r?void 0:r.type)===n,connectingTo:d,clickConnecting:(null==t?void 0:t.nodeId)===N&&(null==t?void 0:t.id)===w&&(null==t?void 0:t.type)===n,isPossibleEndHandle:o===i.WZ.Strict?(null==r?void 0:r.type)!==n:N!==(null==r?void 0:r.nodeId)||w!==(null==r?void 0:r.id),connectionInProcess:!!r,clickConnectionInProcess:!!t,valid:d&&s}},d.x);if(!N){var L,z;null==(L=(z=E.getState()).onError)||L.call(z,"010",i.xc.error010())}let B=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:o}=E.getState(),l={...t,...e};if(o){let{edges:e,setEdges:t}=E.getState();t((0,i.rN)(l,e))}null==n||n(l),null==m||m(l)},V=e=>{if(!N)return;let t=(0,i.Er)(e.nativeEvent);if(u&&(t&&0===e.button||!t)){let t=E.getState();i.aQ.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:C,handleId:w,nodeId:N,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:function(){for(var e,t,n=arguments.length,o=Array(n),l=0;l<n;l++)o[l]=arguments[l];return null==(e=(t=E.getState()).onConnectEnd)?void 0:e.call(t,...o)},updateConnection:t.updateConnection,onConnect:B,isValidConnection:s||function(){for(var e,t,n,o=arguments.length,l=Array(o),r=0;r<o;r++)l[r]=arguments[r];return null==(n=null==(e=(t=E.getState()).isValidConnection)?void 0:e.call(t,...l))||n},getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?null==y||y(e):null==x||x(e)};return(0,l.jsx)("div",{"data-handleid":w,"data-nodeid":N,"data-handlepos":o,"data-id":"".concat(P,"-").concat(N,"-").concat(w,"-").concat(n),className:(0,a.A)(["react-flow__handle","react-flow__handle-".concat(o),"nodrag",M,b,{source:!C,target:C,connectable:c,connectablestart:u,connectableend:g,clickconnecting:A,connectingfrom:D,connectingto:j,valid:_,connectionindicator:c&&(!O||I)&&(O||R?g:u)}]),onMouseDown:V,onTouchStart:V,onClick:k?e=>{let{onClickConnectStart:t,onClickConnectEnd:o,connectionClickStartHandle:l,connectionMode:r,isValidConnection:a,lib:d,rfId:c,nodeLookup:g,connection:f}=E.getState();if(!N||!l&&!u)return;if(!l){null==t||t(e.nativeEvent,{nodeId:N,handleId:w,handleType:n}),E.setState({connectionClickStartHandle:{nodeId:N,type:n,id:w}});return}let p=(0,i.oj)(e.target),h=s||a,{connection:m,isValid:v}=i.aQ.isValid(e.nativeEvent,{handle:{nodeId:N,id:w,type:n},connectionMode:r,fromNodeId:l.nodeId,fromHandleId:l.id||null,fromType:l.type,isValidConnection:h,flowId:c,doc:p,lib:d,nodeLookup:g});v&&m&&B(m);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,null==o||o(e,b),E.setState({connectionClickStartHandle:null})}:void 0,ref:t,...S,children:v})})),eb={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ey={input:function(e){let{data:t,isConnectable:n,sourcePosition:o=i.yX.Bottom}=e;return(0,l.jsxs)(l.Fragment,{children:[null==t?void 0:t.label,(0,l.jsx)(ev,{type:"source",position:o,isConnectable:n})]})},default:function(e){let{data:t,isConnectable:n,targetPosition:o=i.yX.Top,sourcePosition:r=i.yX.Bottom}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ev,{type:"target",position:o,isConnectable:n}),null==t?void 0:t.label,(0,l.jsx)(ev,{type:"source",position:r,isConnectable:n})]})},output:function(e){let{data:t,isConnectable:n,targetPosition:o=i.yX.Top}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ev,{type:"target",position:o,isConnectable:n}),null==t?void 0:t.label]})},group:function(){return null}},ex=e=>{let{width:t,height:n,x:o,y:l}=(0,i.aZ)(e.nodeLookup,{filter:e=>!!e.selected});return{width:(0,i.kf)(t)?t:null,height:(0,i.kf)(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:"translate(".concat(e.transform[0],"px,").concat(e.transform[1],"px) scale(").concat(e.transform[2],") translate(").concat(o,"px,").concat(l,"px)")}};function eS(e){let{onSelectionContextMenu:t,noPanClassName:n,disableKeyboardA11y:o}=e,i=p(),{width:s,height:c,transformString:u,userSelectionActive:g}=f(ex,d.x),h=ef(),m=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!o){var e;null==(e=m.current)||e.focus({preventScroll:!0})}},[o]);let v=!g&&null!==s&&null!==c;if(eg({nodeRef:m,disabled:!v}),!v)return null;let b=t?e=>{t(e,i.getState().nodes.filter(e=>e.selected))}:void 0;return(0,l.jsx)("div",{className:(0,a.A)(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:(0,l.jsx)("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:b,tabIndex:o?void 0:-1,onKeyDown:o?void 0:e=>{Object.prototype.hasOwnProperty.call(eb,e.key)&&(e.preventDefault(),h({direction:eb[e.key],factor:e.shiftKey?4:1}))},style:{width:s,height:c}})})}let ew="undefined"!=typeof window?window:void 0,eC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function eE(e){let{children:t,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:a,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:c,paneClickDistance:u,deleteKeyCode:g,selectionKeyCode:h,selectionOnDrag:m,selectionMode:v,onSelectionStart:b,onSelectionEnd:y,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:w,elementsSelectable:C,zoomOnScroll:E,zoomOnPinch:N,panOnScroll:k,panOnScrollSpeed:M,panOnScrollMode:P,zoomOnDoubleClick:D,panOnDrag:j,defaultViewport:A,translateExtent:I,minZoom:O,maxZoom:R,preventScrolling:_,onSelectionContextMenu:L,noWheelClassName:z,noPanClassName:B,disableKeyboardA11y:H,onViewportChange:T,isControlledViewport:F}=e,{nodesSelectionActive:Z,userSelectionActive:X}=f(eC,d.x),K=V(h,{target:ew}),W=V(S,{target:ew}),Y=W||j,Q=W||k,U=m&&!0!==Y,G=K||X||U;return!function(e){let{deleteKeyCode:t,multiSelectionKeyCode:n}=e,o=p(),{deleteElements:l}=ee(),a=V(t,{actInsideInputWithModifier:!1}),i=V(n,{target:en});(0,r.useEffect)(()=>{if(a){let{edges:e,nodes:t}=o.getState();l({nodes:t.filter(et),edges:e.filter(et)}),o.setState({nodesSelectionActive:!1})}},[a]),(0,r.useEffect)(()=>{o.setState({multiSelectionActive:i})},[i])}({deleteKeyCode:g,multiSelectionKeyCode:x}),(0,l.jsx)(er,{onPaneContextMenu:s,elementsSelectable:C,zoomOnScroll:E,zoomOnPinch:N,panOnScroll:Q,panOnScrollSpeed:M,panOnScrollMode:P,zoomOnDoubleClick:D,panOnDrag:!K&&Y,defaultViewport:A,translateExtent:I,minZoom:O,maxZoom:R,zoomActivationKeyCode:w,preventScrolling:_,noWheelClassName:z,noPanClassName:B,onViewportChange:T,isControlledViewport:F,paneClickDistance:u,selectionOnDrag:U,children:(0,l.jsxs)(ec,{onSelectionStart:b,onSelectionEnd:y,onPaneClick:n,onPaneMouseEnter:o,onPaneMouseMove:a,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:c,panOnDrag:Y,isSelecting:!!G,selectionMode:v,selectionKeyPressed:K,paneClickDistance:u,selectionOnDrag:U,children:[t,Z&&(0,l.jsx)(eS,{onSelectionContextMenu:L,noPanClassName:B,disableKeyboardA11y:H})]})})}eE.displayName="FlowRenderer";let eN=(0,r.memo)(eE),ek=e=>e.updateNodeInternals;var eM=(0,r.memo)(function(e){var t,n,o,s,c,u,g,h,m,b,y,x,S;let{id:w,onClick:C,onMouseEnter:E,onMouseMove:N,onMouseLeave:k,onContextMenu:M,onDoubleClick:P,nodesDraggable:D,elementsSelectable:j,nodesConnectable:A,nodesFocusable:I,resizeObserver:O,noDragClassName:R,noPanClassName:_,disableKeyboardA11y:L,rfId:z,nodeTypes:B,nodeClickDistance:V,onError:H}=e,{node:T,internals:F,isParent:Z}=f(e=>{let t=e.nodeLookup.get(w),n=e.parentLookup.has(w);return{node:t,internals:t.internals,isParent:n}},d.x),X=T.type||"default",K=(null==B?void 0:B[X])||ey[X];void 0===K&&(null==H||H("003",i.xc.error003(X)),X="default",K=(null==B?void 0:B.default)||ey.default);let W=!!(T.draggable||D&&void 0===T.draggable),Y=!!(T.selectable||j&&void 0===T.selectable),Q=!!(T.connectable||A&&void 0===T.connectable),U=!!(T.focusable||I&&void 0===T.focusable),G=p(),q=(0,i.QE)(T),$=function(e){let{node:t,nodeType:n,hasDimensions:o,resizeObserver:l}=e,a=p(),i=(0,r.useRef)(null),s=(0,r.useRef)(null),d=(0,r.useRef)(t.sourcePosition),c=(0,r.useRef)(t.targetPosition),u=(0,r.useRef)(n),g=o&&!!t.internals.handleBounds;return(0,r.useEffect)(()=>{!i.current||t.hidden||g&&s.current===i.current||(s.current&&(null==l||l.unobserve(s.current)),null==l||l.observe(i.current),s.current=i.current)},[g,t.hidden]),(0,r.useEffect)(()=>()=>{s.current&&(null==l||l.unobserve(s.current),s.current=null)},[]),(0,r.useEffect)(()=>{if(i.current){let e=u.current!==n,o=d.current!==t.sourcePosition,l=c.current!==t.targetPosition;(e||o||l)&&(u.current=n,d.current=t.sourcePosition,c.current=t.targetPosition,a.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:i.current,force:!0}]])))}},[t.id,n,t.sourcePosition,t.targetPosition]),i}({node:T,nodeType:X,hasDimensions:q,resizeObserver:O}),J=eg({nodeRef:$,disabled:T.hidden||!W,noDragClassName:R,handleSelector:T.dragHandle,nodeId:w,isSelectable:Y,nodeClickDistance:V}),ee=ef();if(T.hidden)return null;let et=(0,i.uD)(T),en=void 0===T.internals.handleBounds?{width:null!=(m=null!=(h=T.width)?h:T.initialWidth)?m:null==(u=T.style)?void 0:u.width,height:null!=(y=null!=(b=T.height)?b:T.initialHeight)?y:null==(g=T.style)?void 0:g.height}:{width:null!=(x=T.width)?x:null==(s=T.style)?void 0:s.width,height:null!=(S=T.height)?S:null==(c=T.style)?void 0:c.height},eo=Y||W||C||E||N||k,el=E?e=>E(e,{...F.userNode}):void 0,er=N?e=>N(e,{...F.userNode}):void 0,ea=k?e=>k(e,{...F.userNode}):void 0,ei=M?e=>M(e,{...F.userNode}):void 0,es=P?e=>P(e,{...F.userNode}):void 0;return(0,l.jsx)("div",{className:(0,a.A)(["react-flow__node","react-flow__node-".concat(X),{[_]:W},T.className,{selected:T.selected,selectable:Y,parent:Z,draggable:W,dragging:J}]),ref:$,style:{zIndex:F.z,transform:"translate(".concat(F.positionAbsolute.x,"px,").concat(F.positionAbsolute.y,"px)"),pointerEvents:eo?"all":"none",visibility:q?"visible":"hidden",...T.style,...en},"data-id":w,"data-testid":"rf__node-".concat(w),onMouseEnter:el,onMouseMove:er,onMouseLeave:ea,onContextMenu:ei,onClick:e=>{let{selectNodesOnDrag:t,nodeDragThreshold:n}=G.getState();Y&&(!t||!W||n>0)&&eu({id:w,store:G,nodeRef:$}),C&&C(e,{...F.userNode})},onDoubleClick:es,onKeyDown:U?e=>{if(!(0,i.v5)(e.nativeEvent)&&!L){if(i.tn.includes(e.key)&&Y)eu({id:w,store:G,unselect:"Escape"===e.key,nodeRef:$});else if(W&&T.selected&&Object.prototype.hasOwnProperty.call(eb,e.key)){e.preventDefault();let{ariaLabelConfig:t}=G.getState();G.setState({ariaLiveMessage:t["node.a11yDescription.ariaLiveMessage"]({direction:e.key.replace("Arrow","").toLowerCase(),x:~~F.positionAbsolute.x,y:~~F.positionAbsolute.y})}),ee({direction:eb[e.key],factor:e.shiftKey?4:1})}}}:void 0,tabIndex:U?0:void 0,onFocus:U?()=>{var e;if(L||!(null==(e=$.current)?void 0:e.matches(":focus-visible")))return;let{transform:t,width:n,height:o,autoPanOnNodeFocus:l,setCenter:r}=G.getState();l&&((0,i.U$)(new Map([[w,T]]),{x:0,y:0,width:n,height:o},t,!0).length>0||r(T.position.x+et.width/2,T.position.y+et.height/2,{zoom:t[2]}))}:void 0,role:null!=(t=T.ariaRole)?t:U?"group":void 0,"aria-roledescription":"node","aria-describedby":L?void 0:"".concat(v,"-").concat(z),"aria-label":T.ariaLabel,...T.domAttributes,children:(0,l.jsx)(eh,{value:w,children:(0,l.jsx)(K,{id:w,data:T.data,type:X,positionAbsoluteX:F.positionAbsolute.x,positionAbsoluteY:F.positionAbsolute.y,selected:null!=(n=T.selected)&&n,selectable:Y,draggable:W,deletable:null==(o=T.deletable)||o,isConnectable:Q,sourcePosition:T.sourcePosition,targetPosition:T.targetPosition,dragging:J,dragHandle:T.dragHandle,zIndex:F.z,parentId:T.parentId,...et})})})});let eP=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function eD(e){var t;let{nodesDraggable:n,nodesConnectable:o,nodesFocusable:a,elementsSelectable:s,onError:c}=f(eP,d.x),u=(t=e.onlyRenderVisibleElements,f((0,r.useCallback)(e=>t?(0,i.U$)(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(e=>e.id):Array.from(e.nodeLookup.keys()),[t]),d.x)),g=function(){let e=f(ek),[t]=(0,r.useState)(()=>"undefined"==typeof ResizeObserver?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,r.useEffect)(()=>()=>{null==t||t.disconnect()},[t]),t}();return(0,l.jsx)("div",{className:"react-flow__nodes",style:eo,children:u.map(t=>(0,l.jsx)(eM,{id:t,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:g,nodesDraggable:n,nodesConnectable:o,nodesFocusable:a,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:c},t))})}eD.displayName="NodeRenderer";let ej=(0,r.memo)(eD),eA={[i.TG.Arrow]:e=>{let{color:t="none",strokeWidth:n=1}=e,o={strokeWidth:n,...t&&{stroke:t}};return(0,l.jsx)("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},[i.TG.ArrowClosed]:e=>{let{color:t="none",strokeWidth:n=1}=e,o={strokeWidth:n,...t&&{stroke:t,fill:t}};return(0,l.jsx)("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})}},eI=e=>{let{id:t,type:n,color:o,width:a=12.5,height:s=12.5,markerUnits:d="strokeWidth",strokeWidth:c,orient:u="auto-start-reverse"}=e,g=function(e){let t=p();return(0,r.useMemo)(()=>{if(!Object.prototype.hasOwnProperty.call(eA,e)){var n,o;return null==(n=(o=t.getState()).onError)||n.call(o,"009",i.xc.error009(e)),null}return eA[e]},[e])}(n);return g?(0,l.jsx)("marker",{className:"react-flow__arrowhead",id:t,markerWidth:"".concat(a),markerHeight:"".concat(s),viewBox:"-10 -10 20 20",markerUnits:d,orient:u,refX:"0",refY:"0",children:(0,l.jsx)(g,{color:o,strokeWidth:c})}):null},eO=e=>{let{defaultColor:t,rfId:n}=e,o=f(e=>e.edges),a=f(e=>e.defaultEdgeOptions),s=(0,r.useMemo)(()=>(0,i.Hm)(o,{id:n,defaultColor:t,defaultMarkerStart:null==a?void 0:a.markerStart,defaultMarkerEnd:null==a?void 0:a.markerEnd}),[o,a,n,t]);return s.length?(0,l.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,l.jsx)("defs",{children:s.map(e=>(0,l.jsx)(eI,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};eO.displayName="MarkerDefinitions";var eR=(0,r.memo)(eO);function e_(e){let{x:t,y:n,label:o,labelStyle:i,labelShowBg:s=!0,labelBgStyle:d,labelBgPadding:c=[2,4],labelBgBorderRadius:u=2,children:g,className:f,...p}=e,[h,m]=(0,r.useState)({x:1,y:0,width:0,height:0}),v=(0,a.A)(["react-flow__edge-textwrapper",f]),b=(0,r.useRef)(null);return((0,r.useEffect)(()=>{if(b.current){let e=b.current.getBBox();m({x:e.x,y:e.y,width:e.width,height:e.height})}},[o]),o)?(0,l.jsxs)("g",{transform:"translate(".concat(t-h.width/2," ").concat(n-h.height/2,")"),className:v,visibility:h.width?"visible":"hidden",...p,children:[s&&(0,l.jsx)("rect",{width:h.width+2*c[0],x:-c[0],y:-c[1],height:h.height+2*c[1],className:"react-flow__edge-textbg",style:d,rx:u,ry:u}),(0,l.jsx)("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:b,style:i,children:o}),g]}):null}e_.displayName="EdgeText";let eL=(0,r.memo)(e_);function ez(e){let{path:t,labelX:n,labelY:o,label:r,labelStyle:s,labelShowBg:d,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:g,interactionWidth:f=20,...p}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("path",{...p,d:t,fill:"none",className:(0,a.A)(["react-flow__edge-path",p.className])}),f?(0,l.jsx)("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&(0,i.kf)(n)&&(0,i.kf)(o)?(0,l.jsx)(eL,{x:n,y:o,label:r,labelStyle:s,labelShowBg:d,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:g}):null]})}function eB(e){let{pos:t,x1:n,y1:o,x2:l,y2:r}=e;return t===i.yX.Left||t===i.yX.Right?[.5*(n+l),o]:[n,.5*(o+r)]}function eV(e){let{sourceX:t,sourceY:n,sourcePosition:o=i.yX.Bottom,targetX:l,targetY:r,targetPosition:a=i.yX.Top}=e,[s,d]=eB({pos:o,x1:t,y1:n,x2:l,y2:r}),[c,u]=eB({pos:a,x1:l,y1:r,x2:t,y2:n}),[g,f,p,h]=(0,i.e_)({sourceX:t,sourceY:n,targetX:l,targetY:r,sourceControlX:s,sourceControlY:d,targetControlX:c,targetControlY:u});return["M".concat(t,",").concat(n," C").concat(s,",").concat(d," ").concat(c,",").concat(u," ").concat(l,",").concat(r),g,f,p,h]}function eH(e){return(0,r.memo)(t=>{let{id:n,sourceX:o,sourceY:r,targetX:a,targetY:i,sourcePosition:s,targetPosition:d,label:c,labelStyle:u,labelShowBg:g,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:m,markerEnd:v,markerStart:b,interactionWidth:y}=t,[x,S,w]=eV({sourceX:o,sourceY:r,sourcePosition:s,targetX:a,targetY:i,targetPosition:d}),C=e.isInternal?void 0:n;return(0,l.jsx)(ez,{id:C,path:x,labelX:S,labelY:w,label:c,labelStyle:u,labelShowBg:g,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:h,style:m,markerEnd:v,markerStart:b,interactionWidth:y})})}let eT=eH({isInternal:!1}),eF=eH({isInternal:!0});function eZ(e){return(0,r.memo)(t=>{let{id:n,sourceX:o,sourceY:r,targetX:a,targetY:s,label:d,labelStyle:c,labelShowBg:u,labelBgStyle:g,labelBgPadding:f,labelBgBorderRadius:p,style:h,sourcePosition:m=i.yX.Bottom,targetPosition:v=i.yX.Top,markerEnd:b,markerStart:y,pathOptions:x,interactionWidth:S}=t,[w,C,E]=(0,i.oN)({sourceX:o,sourceY:r,sourcePosition:m,targetX:a,targetY:s,targetPosition:v,borderRadius:null==x?void 0:x.borderRadius,offset:null==x?void 0:x.offset,stepPosition:null==x?void 0:x.stepPosition}),N=e.isInternal?void 0:n;return(0,l.jsx)(ez,{id:N,path:w,labelX:C,labelY:E,label:d,labelStyle:c,labelShowBg:u,labelBgStyle:g,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:b,markerStart:y,interactionWidth:S})})}eT.displayName="SimpleBezierEdge",eF.displayName="SimpleBezierEdgeInternal";let eX=eZ({isInternal:!1}),eK=eZ({isInternal:!0});function eW(e){return(0,r.memo)(t=>{var n;let{id:o,...a}=t,i=e.isInternal?void 0:o;return(0,l.jsx)(eX,{...a,id:i,pathOptions:(0,r.useMemo)(()=>{var e;return{borderRadius:0,offset:null==(e=a.pathOptions)?void 0:e.offset}},[null==(n=a.pathOptions)?void 0:n.offset])})})}eX.displayName="SmoothStepEdge",eK.displayName="SmoothStepEdgeInternal";let eY=eW({isInternal:!1}),eQ=eW({isInternal:!0});function eU(e){return(0,r.memo)(t=>{let{id:n,sourceX:o,sourceY:r,targetX:a,targetY:s,label:d,labelStyle:c,labelShowBg:u,labelBgStyle:g,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,interactionWidth:b}=t,[y,x,S]=(0,i.ah)({sourceX:o,sourceY:r,targetX:a,targetY:s}),w=e.isInternal?void 0:n;return(0,l.jsx)(ez,{id:w,path:y,labelX:x,labelY:S,label:d,labelStyle:c,labelShowBg:u,labelBgStyle:g,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,interactionWidth:b})})}eY.displayName="StepEdge",eQ.displayName="StepEdgeInternal";let eG=eU({isInternal:!1}),eq=eU({isInternal:!0});function e$(e){return(0,r.memo)(t=>{let{id:n,sourceX:o,sourceY:r,targetX:a,targetY:s,sourcePosition:d=i.yX.Bottom,targetPosition:c=i.yX.Top,label:u,labelStyle:g,labelShowBg:f,labelBgStyle:p,labelBgPadding:h,labelBgBorderRadius:m,style:v,markerEnd:b,markerStart:y,pathOptions:x,interactionWidth:S}=t,[w,C,E]=(0,i.Fp)({sourceX:o,sourceY:r,sourcePosition:d,targetX:a,targetY:s,targetPosition:c,curvature:null==x?void 0:x.curvature}),N=e.isInternal?void 0:n;return(0,l.jsx)(ez,{id:N,path:w,labelX:C,labelY:E,label:u,labelStyle:g,labelShowBg:f,labelBgStyle:p,labelBgPadding:h,labelBgBorderRadius:m,style:v,markerEnd:b,markerStart:y,interactionWidth:S})})}eG.displayName="StraightEdge",eq.displayName="StraightEdgeInternal";let eJ=e$({isInternal:!1}),e0=e$({isInternal:!0});eJ.displayName="BezierEdge",e0.displayName="BezierEdgeInternal";let e1={default:e0,straight:eq,step:eQ,smoothstep:eK,simplebezier:eF},e3={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},e2="react-flow__edgeupdater";function e4(e){let{position:t,centerX:n,centerY:o,radius:r=10,onMouseDown:s,onMouseEnter:d,onMouseOut:c,type:u}=e;return(0,l.jsx)("circle",{onMouseDown:s,onMouseEnter:d,onMouseOut:c,className:(0,a.A)([e2,"".concat(e2,"-").concat(u)]),cx:t===i.yX.Left?n-r:t===i.yX.Right?n+r:n,cy:t===i.yX.Top?o-r:t===i.yX.Bottom?o+r:o,r:r,stroke:"transparent",fill:"transparent"})}function e5(e){let{isReconnectable:t,reconnectRadius:n,edge:o,sourceX:r,sourceY:a,targetX:s,targetY:d,sourcePosition:c,targetPosition:u,onReconnect:g,onReconnectStart:f,onReconnectEnd:h,setReconnecting:m,setUpdateHover:v}=e,b=p(),y=(e,t)=>{if(0!==e.button)return;let{autoPanOnConnect:n,domNode:l,connectionMode:r,connectionRadius:a,lib:s,onConnectStart:d,cancelConnection:c,nodeLookup:u,rfId:p,panBy:v,updateConnection:y}=b.getState(),x="target"===t.type;i.aQ.onPointerDown(e.nativeEvent,{autoPanOnConnect:n,connectionMode:r,connectionRadius:a,domNode:l,handleId:t.id,nodeId:t.nodeId,nodeLookup:u,isTarget:x,edgeUpdaterType:t.type,lib:s,flowId:p,cancelConnection:c,panBy:v,isValidConnection:function(){for(var e,t,n,o=arguments.length,l=Array(o),r=0;r<o;r++)l[r]=arguments[r];return null==(n=null==(e=(t=b.getState()).isValidConnection)?void 0:e.call(t,...l))||n},onConnect:e=>null==g?void 0:g(o,e),onConnectStart:(n,l)=>{m(!0),null==f||f(e,o,t.type),null==d||d(n,l)},onConnectEnd:function(){for(var e,t,n=arguments.length,o=Array(n),l=0;l<n;l++)o[l]=arguments[l];return null==(e=(t=b.getState()).onConnectEnd)?void 0:e.call(t,...o)},onReconnectEnd:(e,n)=>{m(!1),null==h||h(e,o,t.type,n)},updateConnection:y,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},x=()=>v(!0),S=()=>v(!1);return(0,l.jsxs)(l.Fragment,{children:[(!0===t||"source"===t)&&(0,l.jsx)(e4,{position:c,centerX:r,centerY:a,radius:n,onMouseDown:e=>{var t;return y(e,{nodeId:o.target,id:null!=(t=o.targetHandle)?t:null,type:"target"})},onMouseEnter:x,onMouseOut:S,type:"source"}),(!0===t||"target"===t)&&(0,l.jsx)(e4,{position:u,centerX:s,centerY:d,radius:n,onMouseDown:e=>{var t;return y(e,{nodeId:o.source,id:null!=(t=o.sourceHandle)?t:null,type:"source"})},onMouseEnter:x,onMouseOut:S,type:"target"})]})}var e6=(0,r.memo)(function(e){var t,n;let{id:o,edgesFocusable:s,edgesReconnectable:c,elementsSelectable:u,onClick:g,onDoubleClick:h,onContextMenu:m,onMouseEnter:v,onMouseMove:y,onMouseLeave:x,reconnectRadius:S,onReconnect:w,onReconnectStart:C,onReconnectEnd:E,rfId:N,edgeTypes:k,noPanClassName:M,onError:P,disableKeyboardA11y:D}=e,j=f(e=>e.edgeLookup.get(o)),A=f(e=>e.defaultEdgeOptions),I=(j=A?{...A,...j}:j).type||"default",O=(null==k?void 0:k[I])||e1[I];void 0===O&&(null==P||P("011",i.xc.error011(I)),I="default",O=(null==k?void 0:k.default)||e1.default);let R=!!(j.focusable||s&&void 0===j.focusable),_=void 0!==w&&(j.reconnectable||c&&void 0===j.reconnectable),L=!!(j.selectable||u&&void 0===j.selectable),z=(0,r.useRef)(null),[B,V]=(0,r.useState)(!1),[H,T]=(0,r.useState)(!1),F=p(),{zIndex:Z,sourceX:X,sourceY:K,targetX:W,targetY:Y,sourcePosition:Q,targetPosition:U}=f((0,r.useCallback)(e=>{let t=e.nodeLookup.get(j.source),n=e.nodeLookup.get(j.target);if(!t||!n)return{zIndex:j.zIndex,...e3};let l=(0,i.b5)({id:o,sourceNode:t,targetNode:n,sourceHandle:j.sourceHandle||null,targetHandle:j.targetHandle||null,connectionMode:e.connectionMode,onError:P});return{zIndex:(0,i.qX)({selected:j.selected,zIndex:j.zIndex,sourceNode:t,targetNode:n,elevateOnSelect:e.elevateEdgesOnSelect,zIndexMode:e.zIndexMode}),...l||e3}},[j.source,j.target,j.sourceHandle,j.targetHandle,j.selected,j.zIndex]),d.x),G=(0,r.useMemo)(()=>j.markerStart?"url('#".concat((0,i.aW)(j.markerStart,N),"')"):void 0,[j.markerStart,N]),q=(0,r.useMemo)(()=>j.markerEnd?"url('#".concat((0,i.aW)(j.markerEnd,N),"')"):void 0,[j.markerEnd,N]);if(j.hidden||null===X||null===K||null===W||null===Y)return null;let $=h?e=>{h(e,{...j})}:void 0,J=m?e=>{m(e,{...j})}:void 0,ee=v?e=>{v(e,{...j})}:void 0,et=y?e=>{y(e,{...j})}:void 0,en=x?e=>{x(e,{...j})}:void 0;return(0,l.jsx)("svg",{style:{zIndex:Z},children:(0,l.jsxs)("g",{className:(0,a.A)(["react-flow__edge","react-flow__edge-".concat(I),j.className,M,{selected:j.selected,animated:j.animated,inactive:!L&&!g,updating:B,selectable:L}]),onClick:e=>{let{addSelectedEdges:t,unselectNodesAndEdges:n,multiSelectionActive:l}=F.getState();if(L)if(F.setState({nodesSelectionActive:!1}),j.selected&&l){var r;n({nodes:[],edges:[j]}),null==(r=z.current)||r.blur()}else t([o]);g&&g(e,j)},onDoubleClick:$,onContextMenu:J,onMouseEnter:ee,onMouseMove:et,onMouseLeave:en,onKeyDown:R?e=>{if(!D&&i.tn.includes(e.key)&&L){let{unselectNodesAndEdges:n,addSelectedEdges:l}=F.getState();if("Escape"===e.key){var t;null==(t=z.current)||t.blur(),n({edges:[j]})}else l([o])}}:void 0,tabIndex:R?0:void 0,role:null!=(t=j.ariaRole)?t:R?"group":"img","aria-roledescription":"edge","data-id":o,"data-testid":"rf__edge-".concat(o),"aria-label":null===j.ariaLabel?void 0:j.ariaLabel||"Edge from ".concat(j.source," to ").concat(j.target),"aria-describedby":R?"".concat(b,"-").concat(N):void 0,ref:z,...j.domAttributes,children:[!H&&(0,l.jsx)(O,{id:o,source:j.source,target:j.target,type:j.type,selected:j.selected,animated:j.animated,selectable:L,deletable:null==(n=j.deletable)||n,label:j.label,labelStyle:j.labelStyle,labelShowBg:j.labelShowBg,labelBgStyle:j.labelBgStyle,labelBgPadding:j.labelBgPadding,labelBgBorderRadius:j.labelBgBorderRadius,sourceX:X,sourceY:K,targetX:W,targetY:Y,sourcePosition:Q,targetPosition:U,data:j.data,style:j.style,sourceHandleId:j.sourceHandle,targetHandleId:j.targetHandle,markerStart:G,markerEnd:q,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth}),_&&(0,l.jsx)(e5,{edge:j,isReconnectable:_,reconnectRadius:S,onReconnect:w,onReconnectStart:C,onReconnectEnd:E,sourceX:X,sourceY:K,targetX:W,targetY:Y,sourcePosition:Q,targetPosition:U,setUpdateHover:V,setReconnecting:T})]})})});let e7=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function e8(e){let{defaultMarkerColor:t,onlyRenderVisibleElements:n,rfId:o,edgeTypes:a,noPanClassName:s,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:g,onEdgeMouseMove:p,onEdgeMouseLeave:h,onEdgeClick:m,reconnectRadius:v,onEdgeDoubleClick:b,onReconnectStart:y,onReconnectEnd:x,disableKeyboardA11y:S}=e,{edgesFocusable:w,edgesReconnectable:C,elementsSelectable:E,onError:N}=f(e7,d.x),k=f((0,r.useCallback)(e=>{if(!n)return e.edges.map(e=>e.id);let t=[];if(e.width&&e.height)for(let n of e.edges){let o=e.nodeLookup.get(n.source),l=e.nodeLookup.get(n.target);o&&l&&(0,i.uj)({sourceNode:o,targetNode:l,width:e.width,height:e.height,transform:e.transform})&&t.push(n.id)}return t},[n]),d.x);return(0,l.jsxs)("div",{className:"react-flow__edges",children:[(0,l.jsx)(eR,{defaultColor:t,rfId:o}),k.map(e=>(0,l.jsx)(e6,{id:e,edgesFocusable:w,edgesReconnectable:C,elementsSelectable:E,noPanClassName:s,onReconnect:c,onContextMenu:u,onMouseEnter:g,onMouseMove:p,onMouseLeave:h,onClick:m,reconnectRadius:v,onDoubleClick:b,onReconnectStart:y,onReconnectEnd:x,rfId:o,onError:N,edgeTypes:a,disableKeyboardA11y:S},e))]})}e8.displayName="EdgeRenderer";let e9=(0,r.memo)(e8),te=e=>"translate(".concat(e.transform[0],"px,").concat(e.transform[1],"px) scale(").concat(e.transform[2],")");function tt(e){let{children:t}=e,n=f(te);return(0,l.jsx)("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:t})}let tn=e=>{var t;return null==(t=e.panZoom)?void 0:t.syncViewport};function to(e){return e.connection.inProgress?{...e.connection,to:(0,i.Ff)(e.connection.to,e.transform)}:{...e.connection}}let tl=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function tr(e){let{containerStyle:t,style:n,type:o,component:r}=e,{nodesConnectable:s,width:c,height:u,isValid:g,inProgress:p}=f(tl,d.x);return c&&s&&p?(0,l.jsx)("svg",{style:t,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:(0,l.jsx)("g",{className:(0,a.A)(["react-flow__connection",(0,i.HF)(g)]),children:(0,l.jsx)(ta,{style:n,type:o,CustomComponent:r,isValid:g})})}):null}let ta=e=>{let{style:t,type:n=i.Do.Bezier,CustomComponent:o,isValid:r}=e,{inProgress:a,from:s,fromNode:c,fromHandle:u,fromPosition:g,to:p,toNode:h,toHandle:m,toPosition:v,pointer:b}=function(e){return f(to,d.x)}();if(!a)return;if(o)return(0,l.jsx)(o,{connectionLineType:n,connectionLineStyle:t,fromNode:c,fromHandle:u,fromX:s.x,fromY:s.y,toX:p.x,toY:p.y,fromPosition:g,toPosition:v,connectionStatus:(0,i.HF)(r),toNode:h,toHandle:m,pointer:b});let y="",x={sourceX:s.x,sourceY:s.y,sourcePosition:g,targetX:p.x,targetY:p.y,targetPosition:v};switch(n){case i.Do.Bezier:[y]=(0,i.Fp)(x);break;case i.Do.SimpleBezier:[y]=eV(x);break;case i.Do.Step:[y]=(0,i.oN)({...x,borderRadius:0});break;case i.Do.SmoothStep:[y]=(0,i.oN)(x);break;default:[y]=(0,i.ah)(x)}return(0,l.jsx)("path",{d:y,fill:"none",className:"react-flow__connection-path",style:t})};ta.displayName="ConnectionLine";let ti={};function ts(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ti;(0,r.useRef)(e),p(),(0,r.useEffect)(()=>{},[e])}function td(e){let{nodeTypes:t,edgeTypes:n,onInit:o,onNodeClick:a,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:d,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:g,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:v,onSelectionEnd:b,connectionLineType:y,connectionLineStyle:x,connectionLineComponent:S,connectionLineContainerStyle:w,selectionKeyCode:C,selectionOnDrag:E,selectionMode:N,multiSelectionKeyCode:k,panActivationKeyCode:M,zoomActivationKeyCode:P,deleteKeyCode:D,onlyRenderVisibleElements:j,elementsSelectable:A,defaultViewport:I,translateExtent:O,minZoom:R,maxZoom:_,preventScrolling:L,defaultMarkerColor:z,zoomOnScroll:B,zoomOnPinch:V,panOnScroll:H,panOnScrollSpeed:T,panOnScrollMode:F,zoomOnDoubleClick:Z,panOnDrag:X,onPaneClick:K,onPaneMouseEnter:W,onPaneMouseMove:Y,onPaneMouseLeave:Q,onPaneScroll:U,onPaneContextMenu:G,paneClickDistance:q,nodeClickDistance:$,onEdgeContextMenu:J,onEdgeMouseEnter:et,onEdgeMouseMove:en,onEdgeMouseLeave:eo,reconnectRadius:el,onReconnect:er,onReconnectStart:ea,onReconnectEnd:ei,noDragClassName:es,noWheelClassName:ed,noPanClassName:ec,disableKeyboardA11y:eu,nodeExtent:eg,rfId:ef,viewport:ep,onViewportChange:eh}=e;ts(t),ts(n),p(),(0,r.useRef)(!1),(0,r.useEffect)(()=>{},[]);let em=ee(),ev=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{!ev.current&&em.viewportInitialized&&o&&(setTimeout(()=>o(em),1),ev.current=!0)},[o,em.viewportInitialized]),!function(e){let t=f(tn),n=p();(0,r.useEffect)(()=>{e&&(null==t||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t])}(ep),(0,l.jsx)(eN,{onPaneClick:K,onPaneMouseEnter:W,onPaneMouseMove:Y,onPaneMouseLeave:Q,onPaneContextMenu:G,onPaneScroll:U,paneClickDistance:q,deleteKeyCode:D,selectionKeyCode:C,selectionOnDrag:E,selectionMode:N,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:k,panActivationKeyCode:M,zoomActivationKeyCode:P,elementsSelectable:A,zoomOnScroll:B,zoomOnPinch:V,zoomOnDoubleClick:Z,panOnScroll:H,panOnScrollSpeed:T,panOnScrollMode:F,panOnDrag:X,defaultViewport:I,translateExtent:O,minZoom:R,maxZoom:_,onSelectionContextMenu:m,preventScrolling:L,noDragClassName:es,noWheelClassName:ed,noPanClassName:ec,disableKeyboardA11y:eu,onViewportChange:eh,isControlledViewport:!!ep,children:(0,l.jsxs)(tt,{children:[(0,l.jsx)(e9,{edgeTypes:n,onEdgeClick:i,onEdgeDoubleClick:d,onReconnect:er,onReconnectStart:ea,onReconnectEnd:ei,onlyRenderVisibleElements:j,onEdgeContextMenu:J,onEdgeMouseEnter:et,onEdgeMouseMove:en,onEdgeMouseLeave:eo,reconnectRadius:el,defaultMarkerColor:z,noPanClassName:ec,disableKeyboardA11y:eu,rfId:ef}),(0,l.jsx)(tr,{style:x,type:y,component:S,containerStyle:w}),(0,l.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,l.jsx)(ej,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:g,onNodeContextMenu:h,nodeClickDistance:$,onlyRenderVisibleElements:j,noPanClassName:ec,noDragClassName:es,disableKeyboardA11y:eu,nodeExtent:eg,rfId:ef}),(0,l.jsx)("div",{className:"react-flow__viewport-portal"})]})})}td.displayName="GraphView";let tc=(0,r.memo)(td),tu=function(){var e,t,n;let{nodes:o,edges:l,defaultNodes:r,defaultEdges:a,width:s,height:d,fitView:c,fitViewOptions:u,minZoom:g=.5,maxZoom:f=2,nodeOrigin:p,nodeExtent:h,zIndexMode:m="basic"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},v=new Map,b=new Map,y=new Map,x=new Map,S=null!=(e=null!=a?a:l)?e:[],w=null!=(t=null!=r?r:o)?t:[],C=null!=p?p:[0,0],E=null!=h?h:i.ZO;(0,i.qn)(y,x,S);let N=(0,i.bi)(w,v,b,{nodeOrigin:C,nodeExtent:E,zIndexMode:m}),k=[0,0,1];if(c&&s&&d){let e=(0,i.aZ)(v,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),{x:t,y:o,zoom:l}=(0,i.R4)(e,s,d,g,f,null!=(n=null==u?void 0:u.padding)?n:.1);k=[t,o,l]}return{rfId:"1",width:null!=s?s:0,height:null!=d?d:0,transform:k,nodes:w,nodesInitialized:N,nodeLookup:v,parentLookup:b,edges:S,edgeLookup:x,connectionLookup:y,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==r,hasDefaultEdges:void 0!==a,panZoom:null,minZoom:g,maxZoom:f,translateExtent:i.ZO,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:i.WZ.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:null!=c&&c,fitViewOptions:u,fitViewResolver:null,connection:{...i.bK},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:i.KE,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:i.tM,zIndexMode:m,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}};function tg(e){let{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:a,initialWidth:d,initialHeight:c,initialMinZoom:g,initialMaxZoom:f,initialFitViewOptions:p,fitView:h,nodeOrigin:m,nodeExtent:v,zIndexMode:b,children:y}=e,[x]=(0,r.useState)(()=>(e=>{let{nodes:t,edges:n,defaultNodes:o,defaultEdges:l,width:r,height:a,fitView:d,fitViewOptions:c,minZoom:u,maxZoom:g,nodeOrigin:f,nodeExtent:p,zIndexMode:h}=e;return(0,s.h)((e,s)=>{async function m(){let{nodeLookup:t,panZoom:n,fitViewOptions:o,fitViewResolver:l,width:r,height:a,minZoom:d,maxZoom:c}=s();n&&(await (0,i.IO)({nodes:t,width:r,height:a,panZoom:n,minZoom:d,maxZoom:c},o),null==l||l.resolve(!0),e({fitViewResolver:null}))}return{...tu({nodes:t,edges:n,width:r,height:a,fitView:d,fitViewOptions:c,minZoom:u,maxZoom:g,nodeOrigin:f,nodeExtent:p,defaultNodes:o,defaultEdges:l,zIndexMode:h}),setNodes:t=>{let{nodeLookup:n,parentLookup:o,nodeOrigin:l,elevateNodesOnSelect:r,fitViewQueued:a,zIndexMode:d}=s(),c=(0,i.bi)(t,n,o,{nodeOrigin:l,nodeExtent:p,elevateNodesOnSelect:r,checkEquality:!0,zIndexMode:d});a&&c?(m(),e({nodes:t,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0})):e({nodes:t,nodesInitialized:c})},setEdges:t=>{let{connectionLookup:n,edgeLookup:o}=s();(0,i.qn)(n,o,t),e({edges:t})},setDefaultNodesAndEdges:(t,n)=>{if(t){let{setNodes:n}=s();n(t),e({hasDefaultNodes:!0})}if(n){let{setEdges:t}=s();t(n),e({hasDefaultEdges:!0})}},updateNodeInternals:t=>{let{triggerNodeChanges:n,nodeLookup:o,parentLookup:l,domNode:r,nodeOrigin:a,nodeExtent:d,debug:c,fitViewQueued:u,zIndexMode:g}=s(),{changes:f,updatedInternals:p}=(0,i.uL)(t,o,l,r,a,d,g);p&&((0,i.vS)(o,l,{nodeOrigin:a,nodeExtent:d,zIndexMode:g}),u?(m(),e({fitViewQueued:!1,fitViewOptions:void 0})):e({}),(null==f?void 0:f.length)>0&&(c&&console.log("React Flow: trigger node changes",f),null==n||n(f)))},updateNodePositions:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],o=[],{nodeLookup:l,triggerNodeChanges:r,connection:a,updateConnection:d,onNodesChangeMiddlewareMap:c}=s();for(let[r,s]of e){let e=l.get(r),c=!!((null==e?void 0:e.expandParent)&&(null==e?void 0:e.parentId)&&(null==s?void 0:s.position)),f={id:r,type:"position",position:c?{x:Math.max(0,s.position.x),y:Math.max(0,s.position.y)}:s.position,dragging:t};if(e&&a.inProgress&&a.fromNode.id===e.id){let t=(0,i.M_)(e,a.fromHandle,i.yX.Left,!0);d({...a,from:t})}if(c&&e.parentId){var u,g;n.push({id:r,parentId:e.parentId,rect:{...s.internals.positionAbsolute,width:null!=(u=s.measured.width)?u:0,height:null!=(g=s.measured.height)?g:0}})}o.push(f)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=s(),r=(0,i.r8)(n,l,e,t);o.push(...r)}for(let e of c.values())o=e(o);r(o)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:o,hasDefaultNodes:l,debug:r}=s();(null==e?void 0:e.length)&&(l&&n(F(e,o)),r&&console.log("React Flow: trigger node changes",e),null==t||t(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:o,hasDefaultEdges:l,debug:r}=s();(null==e?void 0:e.length)&&(l&&n(F(e,o)),r&&console.log("React Flow: trigger edge changes",e),null==t||t(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:l,triggerEdgeChanges:r}=s();if(t)return void l(e.map(e=>Z(e,!0)));l(X(o,new Set([...e]),!0)),r(X(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:l,triggerEdgeChanges:r}=s();if(t)return void r(e.map(e=>Z(e,!0)));r(X(n,new Set([...e]))),l(X(o,new Set,!0))},unselectNodesAndEdges:function(){let{nodes:e,edges:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{edges:n,nodes:o,nodeLookup:l,triggerNodeChanges:r,triggerEdgeChanges:a}=s(),i=[];for(let t of e||o){if(!t.selected)continue;let e=l.get(t.id);e&&(e.selected=!1),i.push(Z(t.id,!1))}let d=[];for(let e of t||n)e.selected&&d.push(Z(e.id,!1));r(i),a(d)},setMinZoom:t=>{let{panZoom:n,maxZoom:o}=s();null==n||n.setScaleExtent([t,o]),e({minZoom:t})},setMaxZoom:t=>{let{panZoom:n,minZoom:o}=s();null==n||n.setScaleExtent([o,t]),e({maxZoom:t})},setTranslateExtent:t=>{var n;null==(n=s().panZoom)||n.setTranslateExtent(t),e({translateExtent:t})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:o,elementsSelectable:l}=s();if(!l)return;let r=t.reduce((e,t)=>t.selected?[...e,Z(t.id,!1)]:e,[]),a=e.reduce((e,t)=>t.selected?[...e,Z(t.id,!1)]:e,[]);n(r),o(a)},setNodeExtent:t=>{let{nodes:n,nodeLookup:o,parentLookup:l,nodeOrigin:r,elevateNodesOnSelect:a,nodeExtent:d,zIndexMode:c}=s();(t[0][0]!==d[0][0]||t[0][1]!==d[0][1]||t[1][0]!==d[1][0]||t[1][1]!==d[1][1])&&((0,i.bi)(n,o,l,{nodeOrigin:r,nodeExtent:t,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:c}),e({nodeExtent:t}))},panBy:e=>{let{transform:t,width:n,height:o,panZoom:l,translateExtent:r}=s();return(0,i.No)({delta:e,panZoom:l,transform:t,translateExtent:r,width:n,height:o})},setCenter:async(e,t,n)=>{let{width:o,height:l,maxZoom:r,panZoom:a}=s();if(!a)return Promise.resolve(!1);let i=void 0!==(null==n?void 0:n.zoom)?n.zoom:r;return await a.setViewport({x:o/2-e*i,y:l/2-t*i,zoom:i},{duration:null==n?void 0:n.duration,ease:null==n?void 0:n.ease,interpolate:null==n?void 0:n.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{e({connection:{...i.bK}})},updateConnection:t=>{e({connection:t})},reset:()=>e({...tu()})}},Object.is)})({nodes:t,edges:n,defaultNodes:o,defaultEdges:a,width:d,height:c,fitView:h,minZoom:g,maxZoom:f,fitViewOptions:p,nodeOrigin:m,nodeExtent:v,zIndexMode:b}));return(0,l.jsx)(u,{value:x,children:(0,l.jsx)($,{children:y})})}function tf(e){let{children:t,nodes:n,edges:o,defaultNodes:a,defaultEdges:i,width:s,height:d,fitView:u,fitViewOptions:g,minZoom:f,maxZoom:p,nodeOrigin:h,nodeExtent:m,zIndexMode:v}=e;return(0,r.useContext)(c)?(0,l.jsx)(l.Fragment,{children:t}):(0,l.jsx)(tg,{initialNodes:n,initialEdges:o,defaultNodes:a,defaultEdges:i,initialWidth:s,initialHeight:d,fitView:u,initialFitViewOptions:g,initialMinZoom:f,initialMaxZoom:p,nodeOrigin:h,nodeExtent:m,zIndexMode:v,children:t})}let tp={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var th=Q(function(e,t){let{nodes:n,edges:o,defaultNodes:s,defaultEdges:d,className:c,nodeTypes:u,edgeTypes:g,onNodeClick:f,onEdgeClick:p,onInit:h,onMove:m,onMoveStart:v,onMoveEnd:b,onConnect:y,onConnectStart:x,onConnectEnd:S,onClickConnectStart:C,onClickConnectEnd:N,onNodeMouseEnter:k,onNodeMouseMove:M,onNodeMouseLeave:P,onNodeContextMenu:D,onNodeDoubleClick:O,onNodeDragStart:R,onNodeDrag:_,onNodeDragStop:B,onNodesDelete:V,onEdgesDelete:H,onDelete:T,onSelectionChange:F,onSelectionDragStart:Z,onSelectionDrag:X,onSelectionDragStop:K,onSelectionContextMenu:W,onSelectionStart:Y,onSelectionEnd:Q,onBeforeDelete:U,connectionMode:G,connectionLineType:q=i.Do.Bezier,connectionLineStyle:$,connectionLineComponent:J,connectionLineContainerStyle:ee,deleteKeyCode:et="Backspace",selectionKeyCode:en="Shift",selectionOnDrag:eo=!1,selectionMode:el=i.Qc.Full,panActivationKeyCode:er="Space",multiSelectionKeyCode:ea=(0,i.Ue)()?"Meta":"Control",zoomActivationKeyCode:ei=(0,i.Ue)()?"Meta":"Control",snapToGrid:es,snapGrid:ed,onlyRenderVisibleElements:ec=!1,selectNodesOnDrag:eu,nodesDraggable:eg,autoPanOnNodeFocus:ef,nodesConnectable:ep,nodesFocusable:eh,nodeOrigin:em=A,edgesFocusable:ev,edgesReconnectable:eb,elementsSelectable:ey=!0,defaultViewport:ex=I,minZoom:eS=.5,maxZoom:ew=2,translateExtent:eC=i.ZO,preventScrolling:eE=!0,nodeExtent:eN,defaultMarkerColor:ek="#b1b1b7",zoomOnScroll:eM=!0,zoomOnPinch:eP=!0,panOnScroll:eD=!1,panOnScrollSpeed:ej=.5,panOnScrollMode:eA=i.ny.Free,zoomOnDoubleClick:eI=!0,panOnDrag:eO=!0,onPaneClick:eR,onPaneMouseEnter:e_,onPaneMouseMove:eL,onPaneMouseLeave:ez,onPaneScroll:eB,onPaneContextMenu:eV,paneClickDistance:eH=1,nodeClickDistance:eT=0,children:eF,onReconnect:eZ,onReconnectStart:eX,onReconnectEnd:eK,onEdgeContextMenu:eW,onEdgeDoubleClick:eY,onEdgeMouseEnter:eQ,onEdgeMouseMove:eU,onEdgeMouseLeave:eG,reconnectRadius:eq=10,onNodesChange:e$,onEdgesChange:eJ,noDragClassName:e0="nodrag",noWheelClassName:e1="nowheel",noPanClassName:e3="nopan",fitView:e2,fitViewOptions:e4,connectOnClick:e5,attributionPosition:e6,proOptions:e7,defaultEdgeOptions:e8,elevateNodesOnSelect:e9=!0,elevateEdgesOnSelect:te=!1,disableKeyboardA11y:tt=!1,autoPanOnConnect:tn,autoPanOnNodeDrag:to,autoPanSpeed:tl,connectionRadius:tr,isValidConnection:ta,onError:ti,style:ts,id:td,nodeDragThreshold:tu,connectionDragThreshold:tg,viewport:th,onViewportChange:tm,width:tv,height:tb,colorMode:ty="light",debug:tx,onScroll:tS,ariaLabelConfig:tw,zIndexMode:tC="basic",...tE}=e,tN=td||"1",tk=function(e){var t;let[n,o]=(0,r.useState)("system"===e?null:e);return(0,r.useEffect)(()=>{if("system"!==e)return void o(e);let t=z(),n=()=>o((null==t?void 0:t.matches)?"dark":"light");return n(),null==t||t.addEventListener("change",n),()=>{null==t||t.removeEventListener("change",n)}},[e]),null!==n?n:(null==(t=z())?void 0:t.matches)?"dark":"light"}(ty),tM=(0,r.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),null==tS||tS(e)},[tS]);return(0,l.jsx)("div",{"data-testid":"rf__wrapper",...tE,onScroll:tM,style:{...ts,...tp},ref:t,className:(0,a.A)(["react-flow",c,tk]),id:td,role:"application",children:(0,l.jsxs)(tf,{nodes:n,edges:o,width:tv,height:tb,fitView:e2,fitViewOptions:e4,minZoom:eS,maxZoom:ew,nodeOrigin:em,nodeExtent:eN,zIndexMode:tC,children:[(0,l.jsx)(tc,{onInit:h,onNodeClick:f,onEdgeClick:p,onNodeMouseEnter:k,onNodeMouseMove:M,onNodeMouseLeave:P,onNodeContextMenu:D,onNodeDoubleClick:O,nodeTypes:u,edgeTypes:g,connectionLineType:q,connectionLineStyle:$,connectionLineComponent:J,connectionLineContainerStyle:ee,selectionKeyCode:en,selectionOnDrag:eo,selectionMode:el,deleteKeyCode:et,multiSelectionKeyCode:ea,panActivationKeyCode:er,zoomActivationKeyCode:ei,onlyRenderVisibleElements:ec,defaultViewport:ex,translateExtent:eC,minZoom:eS,maxZoom:ew,preventScrolling:eE,zoomOnScroll:eM,zoomOnPinch:eP,zoomOnDoubleClick:eI,panOnScroll:eD,panOnScrollSpeed:ej,panOnScrollMode:eA,panOnDrag:eO,onPaneClick:eR,onPaneMouseEnter:e_,onPaneMouseMove:eL,onPaneMouseLeave:ez,onPaneScroll:eB,onPaneContextMenu:eV,paneClickDistance:eH,nodeClickDistance:eT,onSelectionContextMenu:W,onSelectionStart:Y,onSelectionEnd:Q,onReconnect:eZ,onReconnectStart:eX,onReconnectEnd:eK,onEdgeContextMenu:eW,onEdgeDoubleClick:eY,onEdgeMouseEnter:eQ,onEdgeMouseMove:eU,onEdgeMouseLeave:eG,reconnectRadius:eq,defaultMarkerColor:ek,noDragClassName:e0,noWheelClassName:e1,noPanClassName:e3,rfId:tN,disableKeyboardA11y:tt,nodeExtent:eN,viewport:th,onViewportChange:tm}),(0,l.jsx)(L,{nodes:n,edges:o,defaultNodes:s,defaultEdges:d,onConnect:y,onConnectStart:x,onConnectEnd:S,onClickConnectStart:C,onClickConnectEnd:N,nodesDraggable:eg,autoPanOnNodeFocus:ef,nodesConnectable:ep,nodesFocusable:eh,edgesFocusable:ev,edgesReconnectable:eb,elementsSelectable:ey,elevateNodesOnSelect:e9,elevateEdgesOnSelect:te,minZoom:eS,maxZoom:ew,nodeExtent:eN,onNodesChange:e$,onEdgesChange:eJ,snapToGrid:es,snapGrid:ed,connectionMode:G,translateExtent:eC,connectOnClick:e5,defaultEdgeOptions:e8,fitView:e2,fitViewOptions:e4,onNodesDelete:V,onEdgesDelete:H,onDelete:T,onNodeDragStart:R,onNodeDrag:_,onNodeDragStop:B,onSelectionDrag:X,onSelectionDragStart:Z,onSelectionDragStop:K,onMove:m,onMoveStart:v,onMoveEnd:b,noPanClassName:e3,nodeOrigin:em,rfId:tN,autoPanOnConnect:tn,autoPanOnNodeDrag:to,autoPanSpeed:tl,onError:ti,connectionRadius:tr,isValidConnection:ta,selectNodesOnDrag:eu,nodeDragThreshold:tu,connectionDragThreshold:tg,onBeforeDelete:U,debug:tx,ariaLabelConfig:tw,zIndexMode:tC}),(0,l.jsx)(j,{onSelectionChange:F}),eF,(0,l.jsx)(E,{proOptions:e7,position:e6}),(0,l.jsx)(w,{rfId:tN,disableKeyboardA11y:tt})]})})});function tm(e){let[t,n]=(0,r.useState)(e),o=(0,r.useCallback)(e=>n(t=>F(e,t)),[]);return[t,n,o]}function tv(e){let[t,n]=(0,r.useState)(e),o=(0,r.useCallback)(e=>n(t=>F(e,t)),[]);return[t,n,o]}function tb(){return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,l.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function ty(){return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,l.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function tx(){return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,l.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"})})}function tS(){return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,l.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"})})}function tw(){return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,l.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"})})}function tC(e){let{children:t,className:n,...o}=e;return(0,l.jsx)("button",{type:"button",className:(0,a.A)(["react-flow__controls-button",n]),...o,children:t})}i.xc.error014(),function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(o||(o={})),o.Dots,o.Lines,o.Cross;let tE=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function tN(e){let{style:t,showZoom:n=!0,showFitView:o=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:c,onFitView:u,onInteractiveChange:g,className:h,children:m,position:v="bottom-left",orientation:b="vertical","aria-label":y}=e,x=p(),{isInteractive:S,minZoomReached:w,maxZoomReached:E,ariaLabelConfig:N}=f(tE,d.x),{zoomIn:k,zoomOut:M,fitView:P}=ee();return(0,l.jsxs)(C,{className:(0,a.A)(["react-flow__controls","horizontal"===b?"horizontal":"vertical",h]),position:v,style:t,"data-testid":"rf__controls","aria-label":null!=y?y:N["controls.ariaLabel"],children:[n&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(tC,{onClick:()=>{k(),null==s||s()},className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:E,children:(0,l.jsx)(tb,{})}),(0,l.jsx)(tC,{onClick:()=>{M(),null==c||c()},className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:w,children:(0,l.jsx)(ty,{})})]}),o&&(0,l.jsx)(tC,{className:"react-flow__controls-fitview",onClick:()=>{P(i),null==u||u()},title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:(0,l.jsx)(tx,{})}),r&&(0,l.jsx)(tC,{className:"react-flow__controls-interactive",onClick:()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),null==g||g(!S)},title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:S?(0,l.jsx)(tw,{}):(0,l.jsx)(tS,{})}),m]})}tN.displayName="Controls";let tk=(0,r.memo)(tN),tM=(0,r.memo)(function(e){let{id:t,x:n,y:o,width:r,height:i,style:s,color:d,strokeColor:c,strokeWidth:u,className:g,borderRadius:f,shapeRendering:p,selected:h,onClick:m}=e,{background:v,backgroundColor:b}=s||{};return(0,l.jsx)("rect",{className:(0,a.A)(["react-flow__minimap-node",{selected:h},g]),x:n,y:o,rx:f,ry:f,width:r,height:i,style:{fill:d||v||b,stroke:c,strokeWidth:u},shapeRendering:p,onClick:m?e=>m(e,t):void 0})}),tP=e=>e.nodes.map(e=>e.id),tD=e=>e instanceof Function?e:()=>e,tj=(0,r.memo)(function(e){let{id:t,nodeColorFunc:n,nodeStrokeColorFunc:o,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:s,shapeRendering:c,NodeComponent:u,onClick:g}=e,{node:p,x:h,y:m,width:v,height:b}=f(e=>{let n=e.nodeLookup.get(t);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let o=n.internals.userNode,{x:l,y:r}=n.internals.positionAbsolute,{width:a,height:s}=(0,i.uD)(o);return{node:o,x:l,y:r,width:a,height:s}},d.x);return p&&!p.hidden&&(0,i.QE)(p)?(0,l.jsx)(u,{x:h,y:m,width:v,height:b,style:p.style,selected:!!p.selected,className:r(p),color:n(p),borderRadius:a,strokeColor:o(p),strokeWidth:s,shapeRendering:c,onClick:g,id:p.id}):null});i.xN.Line,i.xN.Handle}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[743],{224:(e,t,n)=>{var r=n(7946),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,u=r.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,c=r[1];return s(function(){o.value=n,o.getSnapshot=t,l(o)&&c({inst:o})},[e,n,t]),a(function(){return l(o)&&c({inst:o}),e(function(){l(o)&&c({inst:o})})},[e]),u(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},2223:(e,t,n)=>{e.exports=n(8807)},2916:(e,t,n)=>{n.d(t,{Do:()=>s,WZ:()=>o,TG:()=>u,ny:()=>i,yX:()=>l,xN:()=>c,Qc:()=>a,I$:()=>rc,aQ:()=>rg,di:()=>rv,kO:()=>rk,rN:()=>nF,bi:()=>re,_s:()=>nN,aE:()=>ne,Hm:()=>n3,tM:()=>tQ,KE:()=>nv,tn:()=>tZ,xc:()=>tK,us:()=>nO,IO:()=>t7,e_:()=>nR,Fp:()=>nH,Mi:()=>nd,HF:()=>t1,Eo:()=>n$,b5:()=>nJ,Tq:()=>nt,qX:()=>nV,q1:()=>nT,M_:()=>n1,oj:()=>nC,aZ:()=>t6,aW:()=>n5,uD:()=>nk,Jo:()=>t8,U$:()=>t9,X6:()=>nf,oN:()=>nZ,ah:()=>nG,R4:()=>nb,r8:()=>rr,ZO:()=>tU,bK:()=>tJ,b$:()=>t2,uj:()=>nX,v5:()=>nL,Ue:()=>n_,Er:()=>nP,oB:()=>t5,kf:()=>ng,mW:()=>np,Q6:()=>nA,QE:()=>nM,kM:()=>nc,No:()=>ri,Ff:()=>nm,zj:()=>nx,s_:()=>ny,vS:()=>n9,qn:()=>rs,uL:()=>ro,YN:()=>nj});var r,o,i,a,s,u,l,c,h={value:()=>{}};function d(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw Error("illegal type: "+e);r[e]=[]}return new f(r)}function f(e){this._=e}function p(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=h,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}function g(){}function v(e){return null==e?g:function(){return this.querySelector(e)}}function y(){return[]}function m(e){return null==e?y:function(){return this.querySelectorAll(e)}}function x(e){return function(){return this.matches(e)}}function w(e){return function(t){return t.matches(e)}}f.prototype=d.prototype={constructor:f,on:function(e,t){var n,r=this._,o=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),i=-1,a=o.length;if(arguments.length<2){for(;++i<a;)if((n=(e=o[i]).type)&&(n=function(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}(r[n],e.name)))return n;return}if(null!=t&&"function"!=typeof t)throw Error("invalid callback: "+t);for(;++i<a;)if(n=(e=o[i]).type)r[n]=p(r[n],e.name,t);else if(null==t)for(n in r)r[n]=p(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new f(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(r=this._[e],i=0,n=r.length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var b=Array.prototype.find;function _(){return this.firstElementChild}var E=Array.prototype.filter;function k(){return Array.from(this.children)}function M(e){return Array(e.length)}function O(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function N(e,t,n,r,o,i){for(var a,s=0,u=t.length,l=i.length;s<l;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new O(e,i[s]);for(;s<u;++s)(a=t[s])&&(o[s]=a)}function j(e,t,n,r,o,i,a){var s,u,l,c=new Map,h=t.length,d=i.length,f=Array(h);for(s=0;s<h;++s)(u=t[s])&&(f[s]=l=a.call(u,u.__data__,s,t)+"",c.has(l)?o[s]=u:c.set(l,u));for(s=0;s<d;++s)l=a.call(e,i[s],s,i)+"",(u=c.get(l))?(r[s]=u,u.__data__=i[s],c.delete(l)):n[s]=new O(e,i[s]);for(s=0;s<h;++s)(u=t[s])&&c.get(f[s])===u&&(o[s]=u)}function A(e){return e.__data__}function z(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}O.prototype={constructor:O,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var $="http://www.w3.org/1999/xhtml";let C={svg:"http://www.w3.org/2000/svg",xhtml:$,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function S(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),C.hasOwnProperty(t)?{space:C[t],local:e}:e}function L(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function P(e,t){return e.style.getPropertyValue(t)||L(e).getComputedStyle(e,null).getPropertyValue(t)}function T(e){return e.trim().split(/^|\s+/)}function I(e){return e.classList||new R(e)}function R(e){this._node=e,this._names=T(e.getAttribute("class")||"")}function D(e,t){for(var n=I(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function B(e,t){for(var n=I(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function H(){this.textContent=""}function q(){this.innerHTML=""}function V(){this.nextSibling&&this.parentNode.appendChild(this)}function X(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Y(e){var t=S(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===$&&t.documentElement.namespaceURI===$?t.createElement(e):t.createElementNS(n,e)}})(t)}function F(){return null}function G(){var e=this.parentNode;e&&e.removeChild(this)}function W(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function K(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function U(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)(n=t[r],e.type&&n.type!==e.type||n.name!==e.name)?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function Z(e,t,n){return function(){var r,o=this.__on,i=function(e){t.call(this,e,this.__data__)};if(o){for(var a=0,s=o.length;a<s;++a)if((r=o[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Q(e,t,n){var r=L(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}R.prototype={add:function(e){0>this._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var J=[null];function ee(e,t){this._groups=e,this._parents=t}function et(){return new ee([[document.documentElement]],J)}function en(e){return"string"==typeof e?new ee([[document.querySelector(e)]],[document.documentElement]):new ee([[e]],J)}function er(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}ee.prototype=et.prototype={constructor:ee,select:function(e){"function"!=typeof e&&(e=v(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a,s=t[o],u=s.length,l=r[o]=Array(u),c=0;c<u;++c)(i=s[c])&&(a=e.call(i,i.__data__,c,s))&&("__data__"in i&&(a.__data__=i.__data__),l[c]=a);return new ee(r,this._parents)},selectAll:function(e){if("function"==typeof e){var t;t=e,e=function(){var e;return e=t.apply(this,arguments),null==e?[]:Array.isArray(e)?e:Array.from(e)}}else e=m(e);for(var n=this._groups,r=n.length,o=[],i=[],a=0;a<r;++a)for(var s,u=n[a],l=u.length,c=0;c<l;++c)(s=u[c])&&(o.push(e.call(s,s.__data__,c,u)),i.push(s));return new ee(o,i)},selectChild:function(e){var t;return this.select(null==e?_:(t="function"==typeof e?e:w(e),function(){return b.call(this.children,t)}))},selectChildren:function(e){var t;return this.selectAll(null==e?k:(t="function"==typeof e?e:w(e),function(){return E.call(this.children,t)}))},filter:function(e){"function"!=typeof e&&(e=x(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,u=r[o]=[],l=0;l<s;++l)(i=a[l])&&e.call(i,i.__data__,l,a)&&u.push(i);return new ee(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,A);var n=t?j:N,r=this._parents,o=this._groups;"function"!=typeof e&&(m=e,e=function(){return m});for(var i=o.length,a=Array(i),s=Array(i),u=Array(i),l=0;l<i;++l){var c=r[l],h=o[l],d=h.length,f="object"==typeof(y=e.call(c,c&&c.__data__,l,r))&&"length"in y?y:Array.from(y),p=f.length,g=s[l]=Array(p),v=a[l]=Array(p);n(c,h,g,v,u[l]=Array(d),f,t);for(var y,m,x,w,b=0,_=0;b<p;++b)if(x=g[b]){for(b>=_&&(_=b+1);!(w=v[_])&&++_<p;);x._next=w||null}}return(a=new ee(a,r))._enter=s,a._exit=u,a},enter:function(){return new ee(this._enter||this._groups.map(M),this._parents)},exit:function(){return new ee(this._exit||this._groups.map(M),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),s=Array(o),u=0;u<a;++u)for(var l,c=n[u],h=r[u],d=c.length,f=s[u]=Array(d),p=0;p<d;++p)(l=c[p]||h[p])&&(f[p]=l);for(;u<o;++u)s[u]=n[u];return new ee(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=z);for(var n=this._groups,r=n.length,o=Array(r),i=0;i<r;++i){for(var a,s=n[i],u=s.length,l=o[i]=Array(u),c=0;c<u;++c)(a=s[c])&&(l[c]=a);l.sort(t)}return new ee(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(let t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,s=i.length;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=S(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}}:"function"==typeof t?n.local?function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}:function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}:n.local?function(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}:function(e,t){return function(){this.setAttribute(e,t)}})(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}:function(e,t,n){return function(){this.style.setProperty(e,t,n)}})(e,t,null==n?"":n)):P(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var n=T(e+"");if(arguments.length<2){for(var r=I(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?function(e,t){return function(){(t.apply(this,arguments)?D:B)(this,e)}}:t?function(e){return function(){D(this,e)}}:function(e){return function(){B(this,e)}})(n,t))},text:function(e){return arguments.length?this.each(null==e?H:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}:function(e){return function(){this.textContent=e}})(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?q:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}:function(e){return function(){this.innerHTML=e}})(e)):this.node().innerHTML},raise:function(){return this.each(V)},lower:function(){return this.each(X)},append:function(e){var t="function"==typeof e?e:Y(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Y(e),r=null==t?F:"function"==typeof t?t:v(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(G)},clone:function(e){return this.select(e?K:W)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}),a=i.length;if(arguments.length<2){var s=this.node().__on;if(s){for(var u,l=0,c=s.length;l<c;++l)for(r=0,u=s[l];r<a;++r)if((o=i[r]).type===u.type&&o.name===u.name)return u.value}return}for(r=0,s=t?Z:U;r<a;++r)this.each(s(i[r],t,n));return this},dispatch:function(e,t){return this.each(("function"==typeof t?function(e,t){return function(){return Q(this,e,t.apply(this,arguments))}}:function(e,t){return function(){return Q(this,e,t)}})(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};let eo={passive:!1},ei={capture:!0,passive:!1};function ea(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function eu(e){var t=e.document.documentElement,n=en(e).on("dragstart.drag",es,ei);"onselectstart"in t?n.on("selectstart.drag",es,ei):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function el(e,t){var n=e.document.documentElement,r=en(e).on("dragstart.drag",null);t&&(r.on("click.drag",es,ei),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}let ec=e=>()=>e;function eh(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,y:s,dx:u,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}function ed(e){return!e.ctrlKey&&!e.button}function ef(){return this.parentNode}function ep(e,t){return null==t?{x:e.x,y:e.y}:t}function eg(){return navigator.maxTouchPoints||"ontouchstart"in this}function ev(e){return((e=Math.exp(e))+1/e)/2}eh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};let ey=function e(t,n,r){function o(e,o){var i,a,s=e[0],u=e[1],l=e[2],c=o[0],h=o[1],d=o[2],f=c-s,p=h-u,g=f*f+p*p;if(g<1e-12)a=Math.log(d/l)/t,i=function(e){return[s+e*f,u+e*p,l*Math.exp(t*e*a)]};else{var v=Math.sqrt(g),y=(d*d-l*l+r*g)/(2*l*n*v),m=(d*d-l*l-r*g)/(2*d*n*v),x=Math.log(Math.sqrt(y*y+1)-y);a=(Math.log(Math.sqrt(m*m+1)-m)-x)/t,i=function(e){var r,o,i=e*a,c=ev(x),h=l/(n*v)*(c*(((r=Math.exp(2*(r=t*i+x)))-1)/(r+1))-((o=Math.exp(o=x))-1/o)/2);return[s+h*f,u+h*p,l*c/ev(t*i+x)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4);var em,ex,ew=0,eb=0,e_=0,eE=0,ek=0,eM=0,eO="object"==typeof performance&&performance.now?performance:Date,eN="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ej(){return ek||(eN(eA),ek=eO.now()+eM)}function eA(){ek=0}function ez(){this._call=this._time=this._next=null}function e$(e,t,n){var r=new ez;return r.restart(e,t,n),r}function eC(){ek=(eE=eO.now())+eM,ew=eb=0;try{ej(),++ew;for(var e,t=em;t;)(e=ek-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ew}finally{ew=0,function(){for(var e,t,n=em,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:em=t);ex=e,eL(r)}(),ek=0}}function eS(){var e=eO.now(),t=e-eE;t>1e3&&(eM-=t,eE=e)}function eL(e){!ew&&(eb&&(eb=clearTimeout(eb)),e-ek>24?(e<1/0&&(eb=setTimeout(eC,e-eO.now()-eM)),e_&&(e_=clearInterval(e_))):(e_||(eE=eO.now(),e_=setInterval(eS,1e3)),ew=1,eN(eC)))}function eP(e,t,n){var r=new ez;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}ez.prototype=e$.prototype={constructor:ez,restart:function(e,t,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?ej():+n)+(null==t?0:+t),this._next||ex===this||(ex?ex._next=this:em=this,ex=this),this._call=e,this._time=n,eL()},stop:function(){this._call&&(this._call=null,this._time=1/0,eL())}};var eT=d("start","end","cancel","interrupt"),eI=[];function eR(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(u){var l,c,h,d;if(1!==n.state)return s();for(l in o)if((d=o[l]).name===n.name){if(3===d.state)return eP(i);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete o[l]):+l<t&&(d.state=6,d.timer.stop(),d.on.call("cancel",e,e.__data__,d.index,d.group),delete o[l])}if(eP(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(l=0,n.state=3,r=Array(h=n.tween.length),c=-1;l<h;++l)(d=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(r[++c]=d);r.length=c+1}}function a(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(s),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=e$(function(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:o,on:eT,tween:eI,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function eD(e,t){var n=eH(e,t);if(n.state>0)throw Error("too late; already scheduled");return n}function eB(e,t){var n=eH(e,t);if(n.state>3)throw Error("too late; already running");return n}function eH(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function eq(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i){if((n=i[o]).name!==t){a=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]}a&&delete e.__transition}}function eV(e,t){return e*=1,t*=1,function(n){return e*(1-n)+t*n}}var eX=180/Math.PI,eY={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function eF(e,t,n,r,o,i){var a,s,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),e*r<t*n&&(e=-e,t=-t,u=-u,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*eX,skewX:Math.atan(u)*eX,scaleX:a,scaleY:s}}function eG(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var s,u,l,c,h=[],d=[];return i=e(i),a=e(a),!function(e,r,o,i,a,s){if(e!==o||r!==i){var u=a.push("translate(",null,t,null,n);s.push({i:u-4,x:eV(e,o)},{i:u-2,x:eV(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,h,d),s=i.rotate,u=a.rotate,s!==u?(s-u>180?u+=360:u-s>180&&(s+=360),d.push({i:h.push(o(h)+"rotate(",null,r)-2,x:eV(s,u)})):u&&h.push(o(h)+"rotate("+u+r),l=i.skewX,c=a.skewX,l!==c?d.push({i:h.push(o(h)+"skewX(",null,r)-2,x:eV(l,c)}):c&&h.push(o(h)+"skewX("+c+r),!function(e,t,n,r,i,a){if(e!==n||t!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:eV(e,n)},{i:s-2,x:eV(t,r)})}else(1!==n||1!==r)&&i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,h,d),i=a=null,function(e){for(var t,n=-1,r=d.length;++n<r;)h[(t=d[n]).i]=t.x(e);return h.join("")}}}var eW=eG(function(e){let t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?eY:eF(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),eK=eG(function(e){return null==e?eY:(r||(r=document.createElementNS("http://www.w3.org/2000/svg","g")),r.setAttribute("transform",e),e=r.transform.baseVal.consolidate())?eF((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):eY},", ",")",")");function eU(e,t,n){var r=e._id;return e.each(function(){var e=eB(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return eH(e,r).value[t]}}function eZ(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function eQ(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function eJ(){}var e0="\\s*([+-]?\\d+)\\s*",e1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",e2="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",e5=/^#([0-9a-f]{3,8})$/,e3=RegExp(`^rgb\\(${e0},${e0},${e0}\\)$`),e4=RegExp(`^rgb\\(${e2},${e2},${e2}\\)$`),e8=RegExp(`^rgba\\(${e0},${e0},${e0},${e1}\\)$`),e6=RegExp(`^rgba\\(${e2},${e2},${e2},${e1}\\)$`),e9=RegExp(`^hsl\\(${e1},${e2},${e2}\\)$`),e7=RegExp(`^hsla\\(${e1},${e2},${e2},${e1}\\)$`),te={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function tt(){return this.rgb().formatHex()}function tn(){return this.rgb().formatRgb()}function tr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=e5.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?to(t):3===n?new ts(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ti(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ti(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=e3.exec(e))?new ts(t[1],t[2],t[3],1):(t=e4.exec(e))?new ts(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=e8.exec(e))?ti(t[1],t[2],t[3],t[4]):(t=e6.exec(e))?ti(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=e9.exec(e))?tf(t[1],t[2]/100,t[3]/100,1):(t=e7.exec(e))?tf(t[1],t[2]/100,t[3]/100,t[4]):te.hasOwnProperty(e)?to(te[e]):"transparent"===e?new ts(NaN,NaN,NaN,0):null}function to(e){return new ts(e>>16&255,e>>8&255,255&e,1)}function ti(e,t,n,r){return r<=0&&(e=t=n=NaN),new ts(e,t,n,r)}function ta(e,t,n,r){var o;return 1==arguments.length?((o=e)instanceof eJ||(o=tr(o)),o)?new ts((o=o.rgb()).r,o.g,o.b,o.opacity):new ts:new ts(e,t,n,null==r?1:r)}function ts(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function tu(){return`#${td(this.r)}${td(this.g)}${td(this.b)}`}function tl(){let e=tc(this.opacity);return`${1===e?"rgb(":"rgba("}${th(this.r)}, ${th(this.g)}, ${th(this.b)}${1===e?")":`, ${e})`}`}function tc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function th(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function td(e){return((e=th(e))<16?"0":"")+e.toString(16)}function tf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tg(e,t,n,r)}function tp(e){if(e instanceof tg)return new tg(e.h,e.s,e.l,e.opacity);if(e instanceof eJ||(e=tr(e)),!e)return new tg;if(e instanceof tg)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,u=(i+o)/2;return s?(a=t===i?(n-r)/s+(n<r)*6:n===i?(r-t)/s+2:(t-n)/s+4,s/=u<.5?i+o:2-i-o,a*=60):s=u>0&&u<1?0:a,new tg(a,s,u,e.opacity)}function tg(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function tv(e){return(e=(e||0)%360)<0?e+360:e}function ty(e){return Math.max(0,Math.min(1,e||0))}function tm(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function tx(e,t,n,r,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*n+(1+3*e+3*i-3*a)*r+a*o)/6}eZ(eJ,tr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tt,formatHex:tt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return tp(this).formatHsl()},formatRgb:tn,toString:tn}),eZ(ts,ta,eQ(eJ,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new ts(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ts(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ts(th(this.r),th(this.g),th(this.b),tc(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tu,formatHex:tu,formatHex8:function(){return`#${td(this.r)}${td(this.g)}${td(this.b)}${td((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:tl,toString:tl})),eZ(tg,function(e,t,n,r){return 1==arguments.length?tp(e):new tg(e,t,n,null==r?1:r)},eQ(eJ,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new tg(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new tg(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new ts(tm(e>=240?e-240:e+120,o,r),tm(e,o,r),tm(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new tg(tv(this.h),ty(this.s),ty(this.l),tc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=tc(this.opacity);return`${1===e?"hsl(":"hsla("}${tv(this.h)}, ${100*ty(this.s)}%, ${100*ty(this.l)}%${1===e?")":`, ${e})`}`}}));let tw=e=>()=>e;function tb(e,t){var n=t-e;return n?function(t){return e+t*n}:tw(isNaN(e)?t:e)}let t_=function e(t){var n,r=1==(n=+t)?tb:function(e,t){var r,o,i;return t-e?(r=e,o=t,r=Math.pow(r,i=n),o=Math.pow(o,i)-r,i=1/i,function(e){return Math.pow(r+e*o,i)}):tw(isNaN(e)?t:e)};function o(e,t){var n=r((e=ta(e)).r,(t=ta(t)).r),o=r(e.g,t.g),i=r(e.b,t.b),a=tb(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return o.gamma=e,o}(1);function tE(e){return function(t){var n,r,o=t.length,i=Array(o),a=Array(o),s=Array(o);for(n=0;n<o;++n)r=ta(t[n]),i[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return i=e(i),a=e(a),s=e(s),r.opacity=1,function(e){return r.r=i(e),r.g=a(e),r.b=s(e),r+""}}}tE(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],a=r>0?e[r-1]:2*o-i,s=r<t-1?e[r+2]:2*i-o;return tx((n-r/t)*t,a,o,i,s)}}),tE(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],i=e[r%t],a=e[(r+1)%t],s=e[(r+2)%t];return tx((n-r/t)*t,o,i,a,s)}});var tk=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tM=RegExp(tk.source,"g");function tO(e,t){var n,r,o,i,a,s=tk.lastIndex=tM.lastIndex=0,u=-1,l=[],c=[];for(e+="",t+="";(o=tk.exec(e))&&(i=tM.exec(t));)(a=i.index)>s&&(a=t.slice(s,a),l[u]?l[u]+=a:l[++u]=a),(o=o[0])===(i=i[0])?l[u]?l[u]+=i:l[++u]=i:(l[++u]=null,c.push({i:u,x:eV(o,i)})),s=tM.lastIndex;return s<t.length&&(a=t.slice(s),l[u]?l[u]+=a:l[++u]=a),l.length<2?c[0]?(n=c[0].x,function(e){return n(e)+""}):(r=t,function(){return r}):(t=c.length,function(e){for(var n,r=0;r<t;++r)l[(n=c[r]).i]=n.x(e);return l.join("")})}function tN(e,t){var n;return("number"==typeof t?eV:t instanceof tr?t_:(n=tr(t))?(t=n,t_):tO)(e,t)}var tj=et.prototype.constructor;function tA(e){return function(){this.style.removeProperty(e)}}var tz=0;function t$(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}var tC=et.prototype;t$.prototype=(function(e){return et().transition(e)}).prototype={constructor:t$,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=v(e));for(var r=this._groups,o=r.length,i=Array(o),a=0;a<o;++a)for(var s,u,l=r[a],c=l.length,h=i[a]=Array(c),d=0;d<c;++d)(s=l[d])&&(u=e.call(s,s.__data__,d,l))&&("__data__"in s&&(u.__data__=s.__data__),h[d]=u,eR(h[d],t,n,d,h,eH(s,n)));return new t$(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=m(e));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var u,l=r[s],c=l.length,h=0;h<c;++h)if(u=l[h]){for(var d,f=e.call(u,u.__data__,h,l),p=eH(u,n),g=0,v=f.length;g<v;++g)(d=f[g])&&eR(d,t,n,g,f,p);i.push(f),a.push(u)}return new t$(i,a,t,n)},selectChild:tC.selectChild,selectChildren:tC.selectChildren,filter:function(e){"function"!=typeof e&&(e=x(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,u=r[o]=[],l=0;l<s;++l)(i=a[l])&&e.call(i,i.__data__,l,a)&&u.push(i);return new t$(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=Array(r),s=0;s<i;++s)for(var u,l=t[s],c=n[s],h=l.length,d=a[s]=Array(h),f=0;f<h;++f)(u=l[f]||c[f])&&(d[f]=u);for(;s<r;++s)a[s]=t[s];return new t$(a,this._parents,this._name,this._id)},selection:function(){return new tj(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=++tz,r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],u=s.length,l=0;l<u;++l)if(a=s[l]){var c=eH(a,t);eR(a,e,n,l,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new t$(r,this._parents,e,n)},call:tC.call,nodes:tC.nodes,node:tC.node,size:tC.size,empty:tC.empty,each:tC.each,on:function(e,t){var n,r,o,i,a,s,u=this._id;return arguments.length<2?eH(this.node(),u).on.on(e):this.each((n=u,r=e,o=t,s=(r+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})?eD:eB,function(){var e=s(this,n),t=e.on;t!==i&&(a=(i=t).copy()).on(r,o),e.on=a}))},attr:function(e,t){var n=S(e),r="transform"===n?eK:tN;return this.attrTween(e,"function"==typeof t?(n.local?function(e,t,n){var r,o,i;return function(){var a,s,u=n(this);return null==u?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local))===(s=u+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,u))}}:function(e,t,n){var r,o,i;return function(){var a,s,u=n(this);return null==u?void this.removeAttribute(e):(a=this.getAttribute(e))===(s=u+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,u))}})(n,r,eU(this,"attr."+e,t)):null==t?(n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(n):(n.local?function(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}:function(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}})(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw Error();var r=S(e);return this.tween(n,(r.local?function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttributeNS(e.space,e.local,o.call(this,t))}),n}return o._value=t,o}:function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttribute(e,o.call(this,t))}),n}return o._value=t,o})(r,t))},style:function(e,t,n){var r,o,i,a,s,u,l,c,h,d,f,p,g,v,y,m,x,w,b,_,E,k="transform"==(e+="")?eW:tN;return null==t?this.styleTween(e,(r=e,function(){var e=P(this,r),t=(this.style.removeProperty(r),P(this,r));return e===t?null:e===o&&t===i?a:a=k(o=e,i=t)})).on("end.style."+e,tA(e)):"function"==typeof t?this.styleTween(e,(s=e,u=eU(this,"style."+e,t),function(){var e=P(this,s),t=u(this),n=t+"";return null==t&&(this.style.removeProperty(s),n=t=P(this,s)),e===n?null:e===l&&n===c?h:(c=n,h=k(l=e,t))})).each((d=this._id,x="end."+(m="style."+(f=e)),function(){var e=eB(this,d),t=e.on,n=null==e.value[m]?y||(y=tA(f)):void 0;(t!==p||v!==n)&&(g=(p=t).copy()).on(x,v=n),e.on=g})):this.styleTween(e,(w=e,E=t+"",function(){var e=P(this,w);return e===E?null:e===b?_:_=k(b=e,t)}),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw Error();return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(t){this.style.setProperty(e,i.call(this,t),n)}),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){var t,n;return this.tween("text","function"==typeof e?(t=eU(this,"text",e),function(){var e=t(this);this.textContent=null==e?"":e}):(n=null==e?"":e+"",function(){this.textContent=n}))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw Error();return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){this.textContent=r.call(this,e)}),t}return r._value=e,r}(e))},remove:function(){var e;return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=eH(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?function(e,t){var n,r;return function(){var o=eB(this,e),i=o.tween;if(i!==n){r=n=i;for(var a=0,s=r.length;a<s;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}}o.tween=r}}:function(e,t,n){var r,o;if("function"!=typeof n)throw Error();return function(){var i=eB(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:t,value:n},u=0,l=o.length;u<l;++u)if(o[u].name===t){o[u]=s;break}u===l&&o.push(s)}i.tween=o}})(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eD(this,e).delay=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eD(this,e).delay=t}})(t,e)):eH(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eB(this,e).duration=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eB(this,e).duration=t}})(t,e)):eH(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw Error();return function(){eB(this,e).ease=t}}(t,e)):eH(this.node(),t).ease},easeVarying:function(e){var t;if("function"!=typeof e)throw Error();return this.each((t=this._id,function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw Error();eB(this,t).ease=n}))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,a){var s={value:a},u={value:function(){0==--o&&i()}};n.each(function(){var n=eB(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(u)),n.on=t}),0===o&&i()})},[Symbol.iterator]:tC[Symbol.iterator]};var tS={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};et.prototype.interrupt=function(e){return this.each(function(){eq(this,e)})},et.prototype.transition=function(e){var t,n;e instanceof t$?(t=e._id,e=e._name):(t=++tz,(n=tS).time=ej(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],u=s.length,l=0;l<u;++l)(a=s[l])&&eR(a,e,t,l,s,n||function(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}(a,t));return new t$(r,this._parents,e,t)};let tL=e=>()=>e;function tP(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function tT(e,t,n){this.k=e,this.x=t,this.y=n}tT.prototype={constructor:tT,scale:function(e){return 1===e?this:new tT(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new tT(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var tI=new tT(1,0,0);function tR(e){for(;!e.__zoom;)if(!(e=e.parentNode))return tI;return e.__zoom}function tD(e){e.stopImmediatePropagation()}function tB(e){e.preventDefault(),e.stopImmediatePropagation()}function tH(e){return(!e.ctrlKey||"wheel"===e.type)&&!e.button}function tq(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function tV(){return this.__zoom||tI}function tX(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function tY(){return navigator.maxTouchPoints||"ontouchstart"in this}function tF(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function tG(){var e,t,n,r=tH,o=tq,i=tF,a=tX,s=tY,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,h=ey,f=d("start","zoom","end"),p=0,g=10;function v(e){e.property("__zoom",tV).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",M).filter(s).on("touchstart.zoom",O).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(e,t){return(t=Math.max(u[0],Math.min(u[1],t)))===e.k?e:new tT(t,e.x,e.y)}function m(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new tT(e.k,r,o)}function x(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function w(e,t,n,r){e.on("start.zoom",function(){b(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){b(this,arguments).event(r).end()}).tween("zoom",function(){var e=arguments,i=b(this,e).event(r),a=o.apply(this,e),s=null==n?x(a):"function"==typeof n?n.apply(this,e):n,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),l=this.__zoom,c="function"==typeof t?t.apply(this,e):t,d=h(l.invert(s).concat(u/l.k),c.invert(s).concat(u/c.k));return function(e){if(1===e)e=c;else{var t=d(e),n=u/t[2];e=new tT(n,s[0]-t[0]*n,s[1]-t[1]*n)}i.zoom(null,e)}})}function b(e,t,n){return!n&&e.__zooming||new _(e,t)}function _(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function E(e,...t){if(r.apply(this,arguments)){var n=b(this,t).event(e),o=this.__zoom,s=Math.max(u[0],Math.min(u[1],o.k*Math.pow(2,a.apply(this,arguments)))),c=er(e);if(n.wheel)(n.mouse[0][0]!==c[0]||n.mouse[0][1]!==c[1])&&(n.mouse[1]=o.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[c,o.invert(c)],eq(this),n.start()}tB(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(m(y(o,s),n.mouse[0],n.mouse[1]),n.extent,l))}}function k(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=b(this,t,!0).event(e),s=en(e.view).on("mousemove.zoom",function(e){if(tB(e),!a.moved){var t=e.clientX-c,n=e.clientY-h;a.moved=t*t+n*n>p}a.event(e).zoom("mouse",i(m(a.that.__zoom,a.mouse[0]=er(e,o),a.mouse[1]),a.extent,l))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),el(e.view,a.moved),tB(e),a.event(e).end()},!0),u=er(e,o),c=e.clientX,h=e.clientY;eu(e.view),tD(e),a.mouse=[u,this.__zoom.invert(u)],eq(this),a.start()}}function M(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=er(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(a),u=n.k*(e.shiftKey?.5:2),h=i(m(y(n,u),a,s),o.apply(this,t),l);tB(e),c>0?en(this).transition().duration(c).call(w,h,a,e):en(this).call(v.transform,h,a,e)}}function O(n,...o){if(r.apply(this,arguments)){var i,a,s,u,l=n.touches,c=l.length,h=b(this,o,n.changedTouches.length===c).event(n);for(tD(n),a=0;a<c;++a)u=[u=er(s=l[a],this),this.__zoom.invert(u),s.identifier],h.touch0?h.touch1||h.touch0[2]===u[2]||(h.touch1=u,h.taps=0):(h.touch0=u,i=!0,h.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(h.taps<2&&(t=u[0],e=setTimeout(function(){e=null},500)),eq(this),h.start())}}function N(e,...t){if(this.__zooming){var n,r,o,a,s=b(this,t).event(e),u=e.changedTouches,c=u.length;for(tB(e),n=0;n<c;++n)o=er(r=u[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=s.that.__zoom,s.touch1){var h=s.touch0[0],d=s.touch0[1],f=s.touch1[0],p=s.touch1[1],g=(g=f[0]-h[0])*g+(g=f[1]-h[1])*g,v=(v=p[0]-d[0])*v+(v=p[1]-d[1])*v;r=y(r,Math.sqrt(g/v)),o=[(h[0]+f[0])/2,(h[1]+f[1])/2],a=[(d[0]+p[0])/2,(d[1]+p[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(m(r,o,a),s.extent,l))}}function j(e,...r){if(this.__zooming){var o,i,a=b(this,r).event(e),s=e.changedTouches,u=s.length;for(tD(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<u;++o)i=s[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=er(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<g)){var l=en(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return v.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",tV),e!==o?w(e,t,n,r):o.interrupt().each(function(){b(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},v.scaleBy=function(e,t,n,r){v.scaleTo(e,function(){var e=this.__zoom.k,n="function"==typeof t?t.apply(this,arguments):t;return e*n},n,r)},v.scaleTo=function(e,t,n,r){v.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?x(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(a),u="function"==typeof t?t.apply(this,arguments):t;return i(m(y(r,u),a,s),e,l)},n,r)},v.translateBy=function(e,t,n,r){v.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),l)},null,r)},v.translateTo=function(e,t,n,r,a){v.transform(e,function(){var e=o.apply(this,arguments),a=this.__zoom,s=null==r?x(e):"function"==typeof r?r.apply(this,arguments):r;return i(tI.translate(s[0],s[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,l)},r,a)},_.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=en(this.that).datum();f.call(e,this.that,new tP(e,{sourceEvent:this.sourceEvent,target:v,type:e,transform:this.that.__zoom,dispatch:f}),t)}},v.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:tL(+e),v):a},v.filter=function(e){return arguments.length?(r="function"==typeof e?e:tL(!!e),v):r},v.touchable=function(e){return arguments.length?(s="function"==typeof e?e:tL(!!e),v):s},v.extent=function(e){return arguments.length?(o="function"==typeof e?e:tL([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),v):o},v.scaleExtent=function(e){return arguments.length?(u[0]=+e[0],u[1]=+e[1],v):[u[0],u[1]]},v.translateExtent=function(e){return arguments.length?(l[0][0]=+e[0][0],l[1][0]=+e[1][0],l[0][1]=+e[0][1],l[1][1]=+e[1][1],v):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},v.constrain=function(e){return arguments.length?(i=e,v):i},v.duration=function(e){return arguments.length?(c=+e,v):c},v.interpolate=function(e){return arguments.length?(h=e,v):h},v.on=function(){var e=f.on.apply(f,arguments);return e===f?v:e},v.clickDistance=function(e){return arguments.length?(p=(e*=1)*e,v):Math.sqrt(p)},v.tapDistance=function(e){return arguments.length?(g=+e,v):g},v}function tW(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?tw(t):("number"===o?eV:"string"===o?(r=tr(t))?(t=r,t_):tO:t instanceof tr?t_:t instanceof Date?function(e,t){var n=new Date;return e*=1,t*=1,function(r){return n.setTime(e*(1-r)+t*r),n}}:!ArrayBuffer.isView(n=t)||n instanceof DataView?Array.isArray(t)?function(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,i=Array(o),a=Array(r);for(n=0;n<o;++n)i[n]=tW(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<o;++n)a[n]=i[n](e);return a}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var n,r={},o={};for(n in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)n in e?r[n]=tW(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}:eV:function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(i){for(n=0;n<r;++n)o[n]=e[n]*(1-i)+t[n]*i;return o}})(e,t)}tR.prototype=tT.prototype;let tK={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",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.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},tU=[[-1/0,-1/0],[1/0,1/0]],tZ=["Enter"," ","Escape"],tQ={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","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.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, 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.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};!function(e){e.Strict="strict",e.Loose="loose"}(o||(o={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(i||(i={})),function(e){e.Partial="partial",e.Full="full"}(a||(a={}));let tJ={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};!function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(s||(s={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(u||(u={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(l||(l={}));let t0={[l.Left]:l.Right,[l.Right]:l.Left,[l.Top]:l.Bottom,[l.Bottom]:l.Top};function t1(e){return null===e?null:e?"valid":"invalid"}let t2=e=>"id"in e&&"source"in e&&"target"in e,t5=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),t3=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),t4=(e,t=[0,0])=>{let{width:n,height:r}=nk(e),o=e.origin??t,i=n*o[0],a=r*o[1];return{x:e.position.x-i,y:e.position.y-a}},t8=(e,t={nodeOrigin:[0,0]})=>0===e.length?{x:0,y:0,width:0,height:0}:nl(e.reduce((e,n)=>{let r="string"==typeof n,o=t.nodeLookup||r?void 0:n;return t.nodeLookup&&(o=r?t.nodeLookup.get(n):t3(n)?n:t.nodeLookup.get(n.id)),ns(e,o?nh(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),t6=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(void 0===t.filter||t.filter(e))&&(n=ns(n,nh(e)),r=!0)}),r?nl(n):{x:0,y:0,width:0,height:0}},t9=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1)=>{let s={...nm(t,[n,r,o]),width:t.width/o,height:t.height/o},u=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(a&&!n||r)continue;let o=e.width??t.width??t.initialWidth??null,l=e.height??t.height??t.initialHeight??null,c=nf(s,nc(t)),h=(o??0)*(l??0),d=i&&c>0;(!t.internals.handleBounds||d||c>=h||t.dragging)&&u.push(t)}return u};async function t7({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},a){if(0===e.size)return Promise.resolve(!0);let s=nb(t6(function(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}(e,a)),t,n,a?.minZoom??o,a?.maxZoom??i,a?.padding??.1);return await r.setViewport(s,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),Promise.resolve(!0)}function ne({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){let a=n.get(e),s=a.parentId?n.get(a.parentId):void 0,{x:u,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},c=a.origin??r,h=a.extent||o;if("parent"!==a.extent||a.expandParent)s&&nE(a.extent)&&(h=[[a.extent[0][0]+u,a.extent[0][1]+l],[a.extent[1][0]+u,a.extent[1][1]+l]]);else if(s){let e=s.measured.width,t=s.measured.height;e&&t&&(h=[[u,l],[u+e,l+t]])}else i?.("005",tK.error005());let d=nE(h)?nr(t,h,a.measured):t;return(void 0===a.measured.width||void 0===a.measured.height)&&i?.("015",tK.error015()),{position:{x:d.x-u+(a.measured.width??0)*c[0],y:d.y-l+(a.measured.height??0)*c[1]},positionAbsolute:d}}async function nt({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){let i=new Set(e.map(e=>e.id)),a=[];for(let e of n){if(!1===e.deletable)continue;let t=i.has(e.id),n=!t&&e.parentId&&a.find(t=>t.id===e.parentId);(t||n)&&a.push(e)}let s=new Set(t.map(e=>e.id)),u=r.filter(e=>!1!==e.deletable),l=((e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))})(a,u);for(let e of u)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!o)return{edges:l,nodes:a};let c=await o({nodes:a,edges:l});return"boolean"==typeof c?c?{edges:l,nodes:a}:{edges:[],nodes:[]}:c}let nn=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),nr=(e={x:0,y:0},t,n)=>({x:nn(e.x,t[0][0],t[1][0]-(n?.width??0)),y:nn(e.y,t[0][1],t[1][1]-(n?.height??0))});function no(e,t,n){let{width:r,height:o}=nk(n),{x:i,y:a}=n.internals.positionAbsolute;return nr(e,[[i,a],[i+r,a+o]],t)}let ni=(e,t,n)=>e<t?nn(Math.abs(e-t),1,t)/t:e>n?-nn(Math.abs(e-n),1,t)/t:0,na=(e,t,n=15,r=40)=>[ni(e.x,r,t.width-r)*n,ni(e.y,r,t.height-r)*n],ns=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),nu=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),nl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),nc=(e,t=[0,0])=>{let{x:n,y:r}=t3(e)?e.internals.positionAbsolute:t4(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},nh=(e,t=[0,0])=>{let{x:n,y:r}=t3(e)?e.internals.positionAbsolute:t4(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},nd=(e,t)=>nl(ns(nu(e),nu(t))),nf=(e,t)=>Math.ceil(Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))),np=e=>ng(e.width)&&ng(e.height)&&ng(e.x)&&ng(e.y),ng=e=>!isNaN(e)&&isFinite(e),nv=(e,t)=>{},ny=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),nm=({x:e,y:t},[n,r,o],i=!1,a=[1,1])=>{let s={x:(e-n)/o,y:(t-r)/o};return i?ny(s,a):s},nx=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function nw(e,t){if("number"==typeof e)return Math.floor((t-t/(1+e))*.5);if("string"==typeof e&&e.endsWith("px")){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}let nb=(e,t,n,r,o,i)=>{let a=function(e,t,n){if("string"==typeof e||"number"==typeof e){let r=nw(e,n),o=nw(e,t);return{top:r,right:o,bottom:r,left:o,x:2*o,y:2*r}}if("object"==typeof e){let r=nw(e.top??e.y??0,n),o=nw(e.bottom??e.y??0,n),i=nw(e.left??e.x??0,t),a=nw(e.right??e.x??0,t);return{top:r,right:a,bottom:o,left:i,x:i+a,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(i,t,n),s=nn(Math.min((t-a.x)/e.width,(n-a.y)/e.height),r,o),u=e.x+e.width/2,l=e.y+e.height/2,c=t/2-u*s,h=n/2-l*s,d=function(e,t,n,r,o,i){let{x:a,y:s}=nx(e,[t,n,r]),{x:u,y:l}=nx({x:e.x+e.width,y:e.y+e.height},[t,n,r]);return{left:Math.floor(a),top:Math.floor(s),right:Math.floor(o-u),bottom:Math.floor(i-l)}}(e,c,h,s,t,n),f={left:Math.min(d.left-a.left,0),top:Math.min(d.top-a.top,0),right:Math.min(d.right-a.right,0),bottom:Math.min(d.bottom-a.bottom,0)};return{x:c-f.left+f.right,y:h-f.top+f.bottom,zoom:s}},n_=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function nE(e){return null!=e&&"parent"!==e}function nk(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function nM(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function nO(e,t={width:0,height:0},n,r,o){let i={...e},a=r.get(n);if(a){let e=a.origin||o;i.x+=a.internals.positionAbsolute.x-(t.width??0)*e[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*e[1]}return i}function nN(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function nj(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function nA(e){return{...tQ,...e||{}}}function nz(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){let{x:i,y:a}=nT(e),s=nm({x:i-(o?.left??0),y:a-(o?.top??0)},r),{x:u,y:l}=n?ny(s,t):s;return{xSnapped:u,ySnapped:l,...s}}let n$=e=>({width:e.offsetWidth,height:e.offsetHeight}),nC=e=>e?.getRootNode?.()||window?.document,nS=["INPUT","SELECT","TEXTAREA"];function nL(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1&&(nS.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}let nP=e=>"clientX"in e,nT=(e,t)=>{let n=nP(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},nI=(e,t,n,r,o)=>{let i=t.querySelectorAll(`.${e}`);return i&&i.length?Array.from(i).map(t=>{let i=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:o,position:t.getAttribute("data-handlepos"),x:(i.left-n.left)/r,y:(i.top-n.top)/r,...n$(t)}}):null};function nR({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:s}){let u=.125*e+.375*o+.375*a+.125*n,l=.125*t+.375*i+.375*s+.125*r,c=Math.abs(u-e),h=Math.abs(l-t);return[u,l,c,h]}function nD(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function nB({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case l.Left:return[t-nD(t-r,i),n];case l.Right:return[t+nD(r-t,i),n];case l.Top:return[t,n-nD(n-o,i)];case l.Bottom:return[t,n+nD(o-n,i)]}}function nH({sourceX:e,sourceY:t,sourcePosition:n=l.Bottom,targetX:r,targetY:o,targetPosition:i=l.Top,curvature:a=.25}){let[s,u]=nB({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[c,h]=nB({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,f,p,g]=nR({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:u,targetControlX:c,targetControlY:h});return[`M${e},${t} C${s},${u} ${c},${h} ${r},${o}`,d,f,p,g]}function nq({sourceX:e,sourceY:t,targetX:n,targetY:r}){let o=Math.abs(n-e)/2,i=Math.abs(r-t)/2;return[n<e?n+o:n-o,r<t?r+i:r-i,o,i]}function nV({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if("manual"===i)return r;let a=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return(o&&n?r+1e3:r)+a}function nX({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){let i=ns(nh(e),nh(t));return i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1),nf({x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]},nl(i))>0}let nY=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,nF=(e,t,n={})=>{let r;if(!e.source||!e.target)return nv("006",tK.error006()),t;let o=n.getEdgeId||nY;return((e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)))(r=t2(e)?{...e}:{...e,id:o(e)},t)?t:(null===r.sourceHandle&&delete r.sourceHandle,null===r.targetHandle&&delete r.targetHandle,t.concat(r))};function nG({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[o,i,a,s]=nq({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,s]}let nW={[l.Left]:{x:-1,y:0},[l.Right]:{x:1,y:0},[l.Top]:{x:0,y:-1},[l.Bottom]:{x:0,y:1}},nK=({source:e,sourcePosition:t=l.Bottom,target:n})=>t===l.Left||t===l.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},nU=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function nZ({sourceX:e,sourceY:t,sourcePosition:n=l.Bottom,targetX:r,targetY:o,targetPosition:i=l.Top,borderRadius:a=5,centerX:s,centerY:u,offset:c=20,stepPosition:h=.5}){let[d,f,p,g,v]=function({source:e,sourcePosition:t=l.Bottom,target:n,targetPosition:r=l.Top,center:o,offset:i,stepPosition:a}){let s,u,c=nW[t],h=nW[r],d={x:e.x+c.x*i,y:e.y+c.y*i},f={x:n.x+h.x*i,y:n.y+h.y*i},p=nK({source:d,sourcePosition:t,target:f}),g=0!==p.x?"x":"y",v=p[g],y=[],m={x:0,y:0},x={x:0,y:0},[,,w,b]=nq({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[g]*h[g]==-1){"x"===g?(s=o.x??d.x+(f.x-d.x)*a,u=o.y??(d.y+f.y)/2):(s=o.x??(d.x+f.x)/2,u=o.y??d.y+(f.y-d.y)*a);let e=[{x:s,y:d.y},{x:s,y:f.y}],t=[{x:d.x,y:u},{x:f.x,y:u}];y=c[g]===v?"x"===g?e:t:"x"===g?t:e}else{let o=[{x:d.x,y:f.y}],a=[{x:f.x,y:d.y}];if(y="x"===g?c.x===v?a:o:c.y===v?o:a,t===r){let t=Math.abs(e[g]-n[g]);if(t<=i){let r=Math.min(i-1,i-t);c[g]===v?m[g]=(d[g]>e[g]?-1:1)*r:x[g]=(f[g]>n[g]?-1:1)*r}}if(t!==r){let e="x"===g?"y":"x",t=c[g]===h[e],n=d[e]>f[e],r=d[e]<f[e];(1===c[g]&&(!t&&n||t&&r)||1!==c[g]&&(!t&&r||t&&n))&&(y="x"===g?o:a)}let l={x:d.x+m.x,y:d.y+m.y},p={x:f.x+x.x,y:f.y+x.y};Math.max(Math.abs(l.x-y[0].x),Math.abs(p.x-y[0].x))>=Math.max(Math.abs(l.y-y[0].y),Math.abs(p.y-y[0].y))?(s=(l.x+p.x)/2,u=y[0].y):(s=y[0].x,u=(l.y+p.y)/2)}return[[e,{x:d.x+m.x,y:d.y+m.y},...y,{x:f.x+x.x,y:f.y+x.y},n],s,u,w,b]}({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:s,y:u},offset:c,stepPosition:h});return[d.reduce((e,t,n)=>e+(n>0&&n<d.length-1?function(e,t,n,r){let o=Math.min(nU(e,t)/2,nU(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${i+o*t},${a}Q ${i},${a} ${i},${a+o*r}`}let s=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${i},${a+o*u}Q ${i},${a} ${i+o*s},${a}`}(d[n-1],t,d[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`),""),f,p,g,v]}function nQ(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function nJ(e){let{sourceNode:t,targetNode:n}=e;if(!nQ(t)||!nQ(n))return null;let r=t.internals.handleBounds||n0(t.handles),i=n.internals.handleBounds||n0(n.handles),a=n2(r?.source??[],e.sourceHandle),s=n2(e.connectionMode===o.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!s)return e.onError?.("008",tK.error008(!a?"source":"target",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let u=a?.position||l.Bottom,c=s?.position||l.Top,h=n1(t,a,u),d=n1(n,s,c);return{sourceX:h.x,sourceY:h.y,targetX:d.x,targetY:d.y,sourcePosition:u,targetPosition:c}}function n0(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,"source"===r.type?t.push(r):"target"===r.type&&n.push(r);return{source:t,target:n}}function n1(e,t,n=l.Left,r=!1){let o=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:s}=t??nk(e);if(r)return{x:o+a/2,y:i+s/2};switch(t?.position??n){case l.Top:return{x:o+a/2,y:i};case l.Right:return{x:o+a,y:i+s/2};case l.Bottom:return{x:o+a/2,y:i+s};case l.Left:return{x:o,y:i+s/2}}}function n2(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function n5(e,t){if(!e)return"";if("string"==typeof e)return e;let n=t?`${t}__`:"";return`${n}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`}function n3(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){let i=new Set;return e.reduce((e,a)=>([a.markerStart||r,a.markerEnd||o].forEach(r=>{if(r&&"object"==typeof r){let o=n5(r,t);i.has(o)||(e.push({id:o,color:r.color||n,...r}),i.add(o))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}let n4={nodeOrigin:[0,0],nodeExtent:tU,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},n8={...n4,checkEquality:!0};function n6(e,t){let n={...e};for(let e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function n9(e,t,n){let r=n6(n4,n);for(let n of e.values())if(n.parentId)rt(n,e,t,r);else{let e=nr(t4(n,r.nodeOrigin),nE(n.extent)?n.extent:r.nodeExtent,nk(n));n.internals.positionAbsolute=e}}function n7(e){return"manual"===e}function re(e,t,n,r={}){let o=n6(n8,r),i={i:0},a=new Map(t),s=o?.elevateNodesOnSelect&&!n7(o.zIndexMode)?1e3:0,u=e.length>0;for(let l of(t.clear(),n.clear(),e)){let e=a.get(l.id);if(o.checkEquality&&l===e?.internals.userNode)t.set(l.id,e);else{let n=nr(t4(l,o.nodeOrigin),nE(l.extent)?l.extent:o.nodeExtent,nk(l));e={...o.defaults,...l,measured:{width:l.measured?.width,height:l.measured?.height},internals:{positionAbsolute:n,handleBounds:function(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let o={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};"source"===t.type?n.push(o):"target"===t.type&&r.push(o)}return{source:n,target:r}}(l,e),z:rn(l,s,o.zIndexMode),userNode:l}},t.set(l.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(u=!1),l.parentId&&rt(e,t,n,r,i)}return u}function rt(e,t,n,r,o){let{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:s,zIndexMode:u}=n6(n4,r),l=e.parentId,c=t.get(l);if(!c)return void console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n),o&&!c.parentId&&void 0===c.internals.rootParentIndex&&"auto"===u&&(c.internals.rootParentIndex=++o.i,c.internals.z=c.internals.z+10*o.i),o&&void 0!==c.internals.rootParentIndex&&(o.i=c.internals.rootParentIndex);let{x:h,y:d,z:f}=function(e,t,n,r,o,i){let{x:a,y:s}=t.internals.positionAbsolute,u=nk(e),l=t4(e,n),c=nE(e.extent)?nr(l,e.extent,u):l,h=nr({x:a+c.x,y:s+c.y},r,u);"parent"===e.extent&&(h=no(h,u,t));let d=rn(e,o,i),f=t.internals.z??0;return{x:h.x,y:h.y,z:f>=d?f+1:d}}(e,c,a,s,i&&!n7(u)?1e3:0,u),{positionAbsolute:p}=e.internals,g=h!==p.x||d!==p.y;(g||f!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x:h,y:d}:p,z:f}})}function rn(e,t,n){let r=ng(e.zIndex)?e.zIndex:0;return n7(n)?r:r+(e.selected?t:0)}function rr(e,t,n,r=[0,0]){let o=[],i=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=nd(i.get(n.parentId)?.expandedRect??nc(e),n.rect);i.set(n.parentId,{expandedRect:r,parent:e})}return i.size>0&&i.forEach(({expandedRect:t,parent:i},a)=>{let s=i.internals.positionAbsolute,u=nk(i),l=i.origin??r,c=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,h=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,d=Math.max(u.width,Math.round(t.width)),f=Math.max(u.height,Math.round(t.height)),p=(d-u.width)*l[0],g=(f-u.height)*l[1];(c>0||h>0||p||g)&&(o.push({id:a,type:"position",position:{x:i.position.x-c+p,y:i.position.y-h+g}}),n.get(a)?.forEach(t=>{e.some(e=>e.id===t.id)||o.push({id:t.id,type:"position",position:{x:t.position.x+c,y:t.position.y+h}})})),(u.width<t.width||u.height<t.height||c||h)&&o.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:d+(c?l[0]*c-p:0),height:f+(h?l[1]*h-g:0)}})}),o}function ro(e,t,n,r,o,i,a){let s=r?.querySelector(".xyflow__viewport"),u=!1;if(!s)return{changes:[],updatedInternals:u};let l=[],c=window.getComputedStyle(s),{m22:h}=new window.DOMMatrixReadOnly(c.transform),d=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),u=!0;continue}let s=n$(r.nodeElement),c=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(c||!e.internals.handleBounds||r.force)){let f=r.nodeElement.getBoundingClientRect(),p=nE(e.extent)?e.extent:i,{positionAbsolute:g}=e.internals;e.parentId&&"parent"===e.extent?g=no(g,s,t.get(e.parentId)):p&&(g=nr(g,p,s));let v={...e,measured:s,internals:{...e.internals,positionAbsolute:g,handleBounds:{source:nI("source",r.nodeElement,f,h,e.id),target:nI("target",r.nodeElement,f,h,e.id)}}};t.set(e.id,v),e.parentId&&rt(v,t,n,{nodeOrigin:o,zIndexMode:a}),u=!0,c&&(l.push({id:e.id,type:"dimensions",dimensions:s}),e.expandParent&&e.parentId&&d.push({id:e.id,parentId:e.parentId,rect:nc(v,o)}))}}if(d.length>0){let e=rr(d,t,n,o);l.push(...e)}return{changes:l,updatedInternals:u}}async function ri({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r);return Promise.resolve(!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]))}function ra(e,t,n,r,o,i){let a=o,s=r.get(a)||new Map;r.set(a,s.set(n,t)),a=`${o}-${e}`;let u=r.get(a)||new Map;if(r.set(a,u.set(n,t)),i){a=`${o}-${e}-${i}`;let s=r.get(a)||new Map;r.set(a,s.set(n,t))}}function rs(e,t,n){for(let r of(e.clear(),t.clear(),n)){let{source:n,target:o,sourceHandle:i=null,targetHandle:a=null}=r,s={edgeId:r.id,source:n,target:o,sourceHandle:i,targetHandle:a},u=`${n}-${i}--${o}-${a}`;ra("source",s,`${o}-${a}--${n}-${i}`,e,n,i),ra("target",s,u,e,o,a),t.set(r.id,r)}}function ru(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)break;r=r?.parentElement}while(r);return!1}function rl({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let o=[];for(let[e,i]of t){let t=n.get(e)?.internals.userNode;t&&o.push({...t,position:i.position,dragging:r})}if(!e)return[o[0],o];let i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:r}:o[0],o]}function rc({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},a=0,s=new Map,u=!1,l={x:0,y:0},c=null,h=!1,f=null,p=!1,g=!1,v=null;return{update:function({noDragClassName:y,handleSelector:m,domNode:x,isSelectable:w,nodeId:b,nodeClickDistance:_=0}){function E({x:e,y:n}){let{nodeLookup:o,nodeExtent:a,snapGrid:u,snapToGrid:l,nodeOrigin:c,onNodeDrag:h,onSelectionDrag:d,onError:f,updateNodePositions:p}=t();i={x:e,y:n};let y=!1,m=s.size>1,x=m&&a?nu(t6(s)):null,w=m&&l?function({dragItems:e,snapGrid:t,x:n,y:r}){let o=e.values().next().value;if(!o)return null;let i={x:n-o.distance.x,y:r-o.distance.y},a=ny(i,t);return{x:a.x-i.x,y:a.y-i.y}}({dragItems:s,snapGrid:u,x:e,y:n}):null;for(let[t,r]of s){if(!o.has(t))continue;let i={x:e-r.distance.x,y:n-r.distance.y};l&&(i=w?{x:Math.round(i.x+w.x),y:Math.round(i.y+w.y)}:ny(i,u));let s=null;if(m&&a&&!r.extent&&x){let{positionAbsolute:e}=r.internals,t=e.x-x.x+a[0][0],n=e.x+r.measured.width-x.x2+a[1][0];s=[[t,e.y-x.y+a[0][1]],[n,e.y+r.measured.height-x.y2+a[1][1]]]}let{position:h,positionAbsolute:d}=ne({nodeId:t,nextPosition:i,nodeLookup:o,nodeExtent:s||a,nodeOrigin:c,onError:f});y=y||r.position.x!==h.x||r.position.y!==h.y,r.position=h,r.internals.positionAbsolute=d}if(g=g||y,y&&(p(s,!0),v&&(r||h||!b&&d))){let[e,t]=rl({nodeId:b,dragItems:s,nodeLookup:o});r?.(v,s,e,t),h?.(v,e,t),b||d?.(v,t)}}async function k(){if(!c)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:o}=t();if(!o){u=!1,cancelAnimationFrame(a);return}let[s,h]=na(l,c,r);(0!==s||0!==h)&&(i.x=(i.x??0)-s/e[2],i.y=(i.y??0)-h/e[2],await n({x:s,y:h})&&E(i)),a=requestAnimationFrame(k)}function M(r){let{nodeLookup:o,multiSelectionActive:a,nodesDraggable:u,transform:l,snapGrid:d,snapToGrid:f,selectNodesOnDrag:p,onNodeDragStart:g,onSelectionDragStart:v,unselectNodesAndEdges:y}=t();h=!0,p&&w||a||!b||o.get(b)?.selected||y(),w&&p&&b&&e?.(b);let m=nz(r.sourceEvent,{transform:l,snapGrid:d,snapToGrid:f,containerBounds:c});if(i=m,(s=function(e,t,n,r){let o=new Map;for(let[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!function e(t,n){if(!t.parentId)return!1;let r=n.get(t.parentId);return!!r&&(!!r.selected||e(r,n))}(a,e))&&(a.draggable||t&&void 0===a.draggable)){let t=e.get(i);t&&o.set(i,{id:i,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return o}(o,u,m,b)).size>0&&(n||g||!b&&v)){let[e,t]=rl({nodeId:b,dragItems:s,nodeLookup:o});n?.(r.sourceEvent,s,e,t),g?.(r.sourceEvent,e,t),b||v?.(r.sourceEvent,t)}}f=en(x);let O=(function(){var e,t,n,r,o=ed,i=ef,a=ep,s=eg,u={},l=d("start","drag","end"),c=0,h=0;function f(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",y).on("touchmove.drag",m,eo).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,s){if(!r&&o.call(this,a,s)){var u=w(this,i.call(this,a,s),a,s,"mouse");u&&(en(a.view).on("mousemove.drag",g,ei).on("mouseup.drag",v,ei),eu(a.view),ea(a),n=!1,e=a.clientX,t=a.clientY,u("start",a))}}function g(r){if(es(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>h}u.mouse("drag",r)}function v(e){en(e.view).on("mousemove.drag mouseup.drag",null),el(e.view,n),es(e),u.mouse("end",e)}function y(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,s=i.call(this,e,t),u=a.length;for(n=0;n<u;++n)(r=w(this,s,e,t,a[n].identifier,a[n]))&&(ea(e),r("start",e,a[n]))}}function m(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=u[r[t].identifier])&&(es(e),n("drag",e,r[t]))}function x(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=u[o[t].identifier])&&(ea(e),n("end",e,o[t]))}function w(e,t,n,r,o,i){var s,h,d,p=l.copy(),g=er(i||n,t);if(null!=(d=a.call(e,new eh("beforestart",{sourceEvent:n,target:f,identifier:o,active:c,x:g[0],y:g[1],dx:0,dy:0,dispatch:p}),r)))return s=d.x-g[0]||0,h=d.y-g[1]||0,function n(i,a,l){var v,y=g;switch(i){case"start":u[o]=n,v=c++;break;case"end":delete u[o],--c;case"drag":g=er(l||a,t),v=c}p.call(i,e,new eh(i,{sourceEvent:a,subject:d,target:f,identifier:o,active:v,x:g[0]+s,y:g[1]+h,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:p}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:ec(!!e),f):o},f.container=function(e){return arguments.length?(i="function"==typeof e?e:ec(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:ec(e),f):a},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:ec(!!e),f):s},f.on=function(){var e=l.on.apply(l,arguments);return e===l?f:e},f.clickDistance=function(e){return arguments.length?(h=(e*=1)*e,f):Math.sqrt(h)},f})().clickDistance(_).on("start",e=>{let{domNode:n,nodeDragThreshold:r,transform:o,snapGrid:a,snapToGrid:s}=t();c=n?.getBoundingClientRect()||null,p=!1,g=!1,v=e.sourceEvent,0===r&&M(e),i=nz(e.sourceEvent,{transform:o,snapGrid:a,snapToGrid:s,containerBounds:c}),l=nT(e.sourceEvent,c)}).on("drag",e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:o,snapToGrid:a,nodeDragThreshold:d,nodeLookup:f}=t(),g=nz(e.sourceEvent,{transform:r,snapGrid:o,snapToGrid:a,containerBounds:c});if(v=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||b&&!f.has(b))&&(p=!0),!p){if(!u&&n&&h&&(u=!0,k()),!h){let t=nT(e.sourceEvent,c),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>d&&M(e)}(i.x!==g.xSnapped||i.y!==g.ySnapped)&&s&&h&&(l=nT(e.sourceEvent,c),E(g))}}).on("end",e=>{if(h&&!p&&(u=!1,h=!1,cancelAnimationFrame(a),s.size>0)){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:i,onSelectionDragStop:a}=t();if(g&&(r(s,!1),g=!1),o||i||!b&&a){let[t,r]=rl({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});o?.(e.sourceEvent,s,t,r),i?.(e.sourceEvent,t,r),b||a?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!y||!ru(t,`.${y}`,x))&&(!m||ru(t,m,x))});f.call(O)},destroy:function(){f?.on(".drag",null)}}}function rh(e,t,n,r,o,i=!1){let a=r.get(e);if(!a)return null;let s="strict"===o?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],u=(n?s?.find(e=>e.id===n):s?.[0])??null;return u&&i?{...u,...n1(a,u,u.position,!0)}:u}function rd(e,t){return e?e:t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null}let rf=()=>!0;function rp(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:s,lib:u,flowId:l,isValidConnection:c=rf,nodeLookup:h}){let d="target"===a,f=t?s.querySelector(`.${u}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:g}=nT(e),v=s.elementFromPoint(p,g),y=v?.classList.contains(`${u}-flow__handle`)?v:f,m={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=rd(void 0,y),t=y.getAttribute("data-nodeid"),a=y.getAttribute("data-handleid"),s=y.classList.contains("connectable"),u=y.classList.contains("connectableend");if(!t||!e)return m;let l={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};m.connection=l,m.isValid=s&&u&&(n===o.Strict?d&&"source"===e||!d&&"target"===e:t!==r||a!==i)&&c(l),m.toHandle=rh(t,e,a,h,n,!0)}return m}let rg={onPointerDown:function(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:a,domNode:s,nodeLookup:u,lib:c,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:p,onConnectStart:g,onConnect:v,onConnectEnd:y,isValidConnection:m=rf,onReconnectEnd:x,updateConnection:w,getTransform:b,getFromHandle:_,autoPanSpeed:E,dragThreshold:k=1,handleDomNode:M}){let O,N=nC(e.target),j=0,{x:A,y:z}=nT(e),$=rd(i,M),C=s?.getBoundingClientRect(),S=!1;if(!C||!$)return;let L=rh(o,$,r,u,t);if(!L)return;let P=nT(e,C),T=!1,I=null,R=!1,D=null,B={...L,nodeId:o,type:$,position:L.position},H=u.get(o),q={inProgress:!0,isValid:null,from:n1(H,B,l.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:H,to:P,toHandle:null,toPosition:t0[B.position],toNode:null,pointer:P};function V(){S=!0,w(q),g?.(e,{nodeId:o,handleId:r,handleType:$})}function X(e){var i,s;let p;if(!S){let{x:t,y:n}=nT(e),r=t-A,o=n-z;if(!(r*r+o*o>k*k))return;V()}if(!_()||!B)return void Y(e);let g=b();O=function(e,t,n,r){let o=[],i=1/0;for(let a of function(e,t,n){let r=[],o={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(let e of t.values())nf(o,nc(e))>0&&r.push(e);return r}(e,n,t+250))for(let n of[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]]){if(r.nodeId===n.nodeId&&r.type===n.type&&r.id===n.id)continue;let{x:s,y:u}=n1(a,n,n.position,!0),l=Math.sqrt(Math.pow(s-e.x,2)+Math.pow(u-e.y,2));l>t||(l<i?(o=[{...n,x:s,y:u}],i=l):l===i&&o.push({...n,x:s,y:u}))}if(!o.length)return null;if(o.length>1){let e="source"===r.type?"target":"source";return o.find(t=>t.type===e)??o[0]}return o[0]}(nm(P=nT(e,C),g,!1,[1,1]),n,u,B),T||(!function e(){if(!h||!C)return;let[t,n]=na(P,C,E);f({x:t,y:n}),j=requestAnimationFrame(e)}(),T=!0);let v=rp(e,{handle:O,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:a?"target":"source",isValidConnection:m,doc:N,lib:c,flowId:d,nodeLookup:u});D=v.handleDomNode,I=v.connection,i=!!O,s=v.isValid,p=null,s?p=!0:i&&!s&&(p=!1),R=p;let y=u.get(o),x=y?n1(y,B,l.Left,!0):q.from,M={...q,from:x,isValid:R,to:v.toHandle&&R?nx({x:v.toHandle.x,y:v.toHandle.y},g):P,toHandle:v.toHandle,toPosition:R&&v.toHandle?v.toHandle.position:t0[B.position],toNode:v.toHandle?u.get(v.toHandle.nodeId):null,pointer:P};w(M),q=M}function Y(e){if(!("touches"in e)||!(e.touches.length>0)){if(S){(O||D)&&I&&R&&v?.(I);let{inProgress:t,...n}=q,r={...n,toPosition:q.toHandle?q.toPosition:null};y?.(e,r),i&&x?.(e,r)}p(),cancelAnimationFrame(j),T=!1,R=!1,I=null,D=null,N.removeEventListener("mousemove",X),N.removeEventListener("mouseup",Y),N.removeEventListener("touchmove",X),N.removeEventListener("touchend",Y)}}0===k&&V(),N.addEventListener("mousemove",X),N.addEventListener("mouseup",Y),N.addEventListener("touchmove",X),N.addEventListener("touchend",Y)},isValid:rp};function rv({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let o=en(e);return{update:function({translateExtent:e,width:i,height:a,zoomStep:s=1,pannable:u=!0,zoomable:l=!0,inversePan:c=!1}){let h=[0,0],d=tG().on("start",e=>{("mousedown"===e.sourceEvent.type||"touchstart"===e.sourceEvent.type)&&(h=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",u?o=>{let s=n();if("mousemove"!==o.sourceEvent.type&&"touchmove"!==o.sourceEvent.type||!t)return;let u=[o.sourceEvent.clientX??o.sourceEvent.touches[0].clientX,o.sourceEvent.clientY??o.sourceEvent.touches[0].clientY],l=[u[0]-h[0],u[1]-h[1]];h=u;let d=r()*Math.max(s[2],Math.log(s[2]))*(c?-1:1),f={x:s[0]-l[0]*d,y:s[1]-l[1]*d};t.setViewportConstrained({x:f.x,y:f.y,zoom:s[2]},[[0,0],[i,a]],e)}:null).on("zoom.wheel",l?e=>{if("wheel"!==e.sourceEvent.type||!t)return;let r=n(),o=e.sourceEvent.ctrlKey&&n_()?10:1,i=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*s,a=r[2]*Math.pow(2,i*o);t.scaleTo(a)}:null);o.call(d,{})},destroy:function(){o.on("zoom",null)},pointer:er}}let ry=e=>({x:e.x,y:e.y,zoom:e.k}),rm=({x:e,y:t,zoom:n})=>tI.translate(e,t).scale(n),rx=(e,t)=>e.target.closest(`.${t}`),rw=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),rb=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,r_=(e,t=0,n=rb,r=()=>{})=>{let o="number"==typeof t&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},rE=e=>{let t=e.ctrlKey&&n_()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function rk({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:a,onPanZoomStart:s,onPanZoomEnd:u,onDraggingChange:l}){let c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=tG().scaleExtent([t,n]).translateExtent(r),f=en(e).call(d);m({x:o.x,y:o.y,zoom:nn(o.zoom,t,n)},[[0,0],[h.width,h.height]],r);let p=f.on("wheel.zoom"),g=f.on("dblclick.zoom");function v(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate==="linear"?tW:ey).transform(r_(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function y(){d.on("zoom",null)}async function m(e,t,n){let r=rm(e),o=d?.constrain()(r,t,n);return o&&await v(o),new Promise(e=>e(o))}return d.wheelDelta(rE),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:o,panOnDrag:h,panOnScrollMode:v,panOnScrollSpeed:m,preventScrolling:x,zoomOnPinch:w,zoomOnScroll:b,zoomOnDoubleClick:_,zoomActivationKeyPressed:E,lib:k,onTransformChange:M,connectionInProgress:O,paneClickDistance:N,selectionOnDrag:j}){r&&!c.isZoomingOrPanning&&y();let A=o&&!E&&!r;d.clickDistance(j?1/0:!ng(N)||N<0?0:N);let z=A?function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:s,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:c}){return h=>{if(rx(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();let d=n.property("__zoom").k||1;if(h.ctrlKey&&s){let e=er(h),t=d*Math.pow(2,rE(h));r.scaleTo(n,t,e,h);return}let f=1===h.deltaMode?20:1,p=o===i.Vertical?0:h.deltaX*f,g=o===i.Horizontal?0:h.deltaY*f;!n_()&&h.shiftKey&&o!==i.Vertical&&(p=h.deltaY*f,g=0),r.translateBy(n,-(p/d)*a,-(g/d)*a,{internal:!0});let v=ry(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(h,v),e.panScrollTimeout=setTimeout(()=>{c?.(h,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,u?.(h,v))}}({zoomPanValues:c,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:v,panOnScrollSpeed:m,zoomOnPinch:w,onPanZoomStart:s,onPanZoom:a,onPanZoomEnd:u}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){let i="wheel"===r.type,a=!t&&i&&!r.ctrlKey,s=rx(r,e);if(r.ctrlKey&&i&&s&&r.preventDefault(),a||s)return null;r.preventDefault(),n.call(this,r,o)}}({noWheelClassName:e,preventScrolling:x,d3ZoomHandler:p});if(f.on("wheel.zoom",z,{passive:!1}),!r){let e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let o=ry(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,o)}}({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});d.on("start",e);let t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{e.usedRightMouseButton=!!(n&&rw(t,e.mouseButton??0)),i.sourceEvent?.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!i.sourceEvent?.internal&&o?.(i.sourceEvent,ry(i.transform))}}({zoomPanValues:c,panOnDrag:h,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:M});d.on("zoom",t);let r=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&rw(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){let t=ry(a.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(a.sourceEvent,t)},150*!!n)}}}({zoomPanValues:c,panOnDrag:h,panOnScroll:o,onPaneContextMenu:n,onPanZoomEnd:u,onDraggingChange:l});d.on("end",r)}let $=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:s,noPanClassName:u,lib:l,connectionInProgress:c}){return h=>{let d=e||t,f=n&&h.ctrlKey,p="wheel"===h.type;if(1===h.button&&"mousedown"===h.type&&(rx(h,`${l}-flow__node`)||rx(h,`${l}-flow__edge`)))return!0;if(!r&&!d&&!o&&!i&&!n||a||c&&!p||rx(h,s)&&p||rx(h,u)&&(!p||o&&p&&!e)||!n&&h.ctrlKey&&p)return!1;if(!n&&"touchstart"===h.type&&h.touches?.length>1)return h.preventDefault(),!1;if(!d&&!o&&!f&&p||!r&&("mousedown"===h.type||"touchstart"===h.type)||Array.isArray(r)&&!r.includes(h.button)&&"mousedown"===h.type)return!1;let g=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||p)&&g}}({zoomActivationKeyPressed:E,panOnDrag:h,zoomOnScroll:b,panOnScroll:o,zoomOnDoubleClick:_,zoomOnPinch:w,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:k,connectionInProgress:O});d.filter($),_?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)},destroy:y,setViewport:async function e(e,t){let n=rm(e);return await v(n,t),new Promise(e=>e(n))},setViewportConstrained:m,getViewport:function(){let e=f?tR(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate==="linear"?tW:ey).scaleTo(r_(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},scaleBy:function(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate==="linear"?tW:ey).scaleBy(r_(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},setScaleExtent:function(e){d?.scaleExtent(e)},setTranslateExtent:function(e){d?.translateExtent(e)},syncViewport:function(e){if(f){let t=rm(e),n=f.property("__zoom");(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&d?.transform(f,t,null,{sync:!0})}},setClickDistance:function(e){let t=!ng(e)||e<0?0:e;d?.clickDistance(t)}}}!function(e){e.Line="line",e.Handle="handle"}(c||(c={}))},3724:(e,t,n)=>{n.d(t,{A:()=>function e(t){if("string"==typeof t||"number"==typeof t)return""+t;let n="";if(Array.isArray(t))for(let r=0,o;r<t.length;r++)""!==(o=e(t[r]))&&(n+=(n&&" ")+o);else for(let e in t)t[e]&&(n+=(n&&" ")+e);return n}})},7494:(e,t,n)=>{n.d(t,{x:()=>r});function r(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}},8039:(e,t,n)=>{n.d(t,{A:()=>C});var r=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=r((e,t)=>{var n=Object.defineProperty,r=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=(e,t,r)=>((e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),i=r((e,t)=>{function n(e,t){e[t]?e[t]++:e[t]=1}function r(e,t){--e[t]||delete e[t]}function i(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}return o+"\x01"+i+"\x01"+(void 0===r?"\0":r)}function a(e,t){return i(e,t.v,t.w,t.name)}t.exports=class{constructor(e){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var n=arguments,r=this;return e.forEach(function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(var n=t;void 0!==n;n=this.parent(n))if(n===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let r=new Set(t);for(var n of this.successors(e))r.add(n);return Array.from(r.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach(function([n,r]){e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,function e(o){var i=n.parent(o);return void 0===i||t.hasNode(i)?(r[o]=i,i):i in r?r[i]:e(i)}(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return e.reduce(function(e,o){return r.length>1?n.setEdge(e,o,t):n.setEdge(e,o),o}),this}setEdge(){var e,t,r,o,a=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(e=s.v,t=s.w,r=s.name,2==arguments.length&&(o=arguments[1],a=!0)):(e=s,t=arguments[1],r=arguments[3],arguments.length>2&&(o=arguments[2],a=!0)),e=""+e,t=""+t,void 0!==r&&(r=""+r);var u=i(this._isDirected,e,t,r);if(Object.hasOwn(this._edgeLabels,u))return a&&(this._edgeLabels[u]=o),this;if(void 0!==r&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[u]=a?o:this._defaultEdgeLabelFn(e,t,r);var l=function(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}var s={v:o,w:i};return r&&(s.name=r),s}(this._isDirected,e,t,r);return e=l.v,t=l.w,Object.freeze(l),this._edgeObjs[u]=l,n(this._preds[t],e),n(this._sucs[e],t),this._in[t][u]=l,this._out[e][u]=l,this._edgeCount++,this}edge(e,t,n){var r=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,n){var r=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){var o=1==arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n),s=this._edgeObjs[o];return s&&(e=s.v,t=s.w,delete this._edgeLabels[o],delete this._edgeObjs[o],r(this._preds[t],e),r(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,n){if(e){var r=Object.values(e);return n?r.filter(function(e){return e.v===t&&e.w===n||e.v===n&&e.w===t}):r}}}}),a=r((e,t)=>{t.exports="3.0.2"}),s=r((e,t)=>{t.exports={Graph:i(),version:a()}}),u=r((e,t)=>{var n=i();t.exports={write:function(e){var t,n,r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(function(e){var n=t.node(e),r=t.parent(e),o={v:e};return void 0!==n&&(o.value=n),void 0!==r&&(o.parent=r),o}),edges:(n=e).edges().map(function(e){var t=n.edge(e),r={v:e.v,w:e.w};return void 0!==e.name&&(r.name=e.name),void 0!==t&&(r.value=t),r})};return void 0!==e.graph()&&(r.value=structuredClone(e.graph())),r},read:function(e){var t=new n(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}}),l=r((e,t)=>{t.exports=function(e,t,r,o){return function(e,t,n,r){var o={},i=!0,a=0,s=e.nodes(),u=function(e){var t=n(e);o[e.v].distance+t<o[e.w].distance&&(o[e.w]={distance:o[e.v].distance+t,predecessor:e.v},i=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){var n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;u({v:n,w:r})})})};s.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=s.length,h=1;h<c&&(i=!1,a++,l(),i);h++);if(a===c-1&&(i=!1,l(),i))throw Error("The graph contains a negative weight cycle");return o}(e,String(t),r||n,o||function(t){return e.outEdges(t)})};var n=()=>1}),c=r((e,t)=>{t.exports=function(e){var t,n={},r=[];return e.nodes().forEach(function(o){t=[],function r(o){Object.hasOwn(n,o)||(n[o]=!0,t.push(o),e.successors(o).forEach(r),e.predecessors(o).forEach(r))}(o),t.length&&r.push(t)}),r}}),h=r((e,t)=>{t.exports=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){var n=this._keyIndices;if(!Object.hasOwn(n,e=String(e))){var r=this._arr,o=r.length;return n[e]=o,r.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)}_heapify(e){var t=this._arr,n=2*e,r=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t}_swap(e,t){var n=this._arr,r=this._keyIndices,o=n[e],i=n[t];n[e]=i,n[t]=o,r[i.key]=e,r[o.key]=t}}}),d=r((e,t)=>{var n=h();t.exports=function(e,t,o,i){return function(e,t,r,o){var i,a,s={},u=new n,l=function(e){var t=e.v!==i?e.v:e.w,n=s[t],o=r(e),l=a.distance+o;if(o<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);l<n.distance&&(n.distance=l,n.predecessor=i,u.decrease(t,l))};for(e.nodes().forEach(function(e){var n=e===t?0:1/0;s[e]={distance:n},u.add(e,n)});u.size()>0&&(a=s[i=u.removeMin()]).distance!==1/0;)o(i).forEach(l);return s}(e,String(t),o||r,i||function(t){return e.outEdges(t)})};var r=()=>1}),f=r((e,t)=>{var n=d();t.exports=function(e,t,r){return e.nodes().reduce(function(o,i){return o[i]=n(e,i,t,r),o},{})}}),p=r((e,t)=>{t.exports=function(e,t,n){if(void 0!==e[t].predecessor)throw Error("Invalid source vertex");if(void 0===e[n].predecessor&&n!==t)throw Error("Invalid destination vertex");return{weight:e[n].distance,path:function(e,t,n){for(var r=[],o=n;o!==t;)r.push(o),o=e[o].predecessor;return r.push(t),r.reverse()}(e,t,n)}}}),g=r((e,t)=>{t.exports=function(e){var t=0,n=[],r={},o=[];return e.nodes().forEach(function(i){Object.hasOwn(r,i)||function i(a){var s=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(e){Object.hasOwn(r,e)?r[e].onStack&&(s.lowlink=Math.min(s.lowlink,r[e].index)):(i(e),s.lowlink=Math.min(s.lowlink,r[e].lowlink))}),s.lowlink===s.index){var u,l=[];do r[u=n.pop()].onStack=!1,l.push(u);while(a!==u);o.push(l)}}(i)}),o}}),v=r((e,t)=>{var n=g();t.exports=function(e){return n(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}}),y=r((e,t)=>{t.exports=function(e,t,r){var o,i,a,s,u;return o=e,i=t||n,a=r||function(t){return e.outEdges(t)},s={},(u=o.nodes()).forEach(function(e){s[e]={},s[e][e]={distance:0},u.forEach(function(t){e!==t&&(s[e][t]={distance:1/0})}),a(e).forEach(function(t){var n=t.v===e?t.w:t.v,r=i(t);s[e][n]={distance:r,predecessor:e}})}),u.forEach(function(e){var t=s[e];u.forEach(function(n){var r=s[n];u.forEach(function(n){var o=r[e],i=t[n],a=r[n],s=o.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)})})}),s};var n=()=>1}),m=r((e,t)=>{function n(e){var t={},n={},o=[];if(e.sinks().forEach(function i(a){if(Object.hasOwn(n,a))throw new r;Object.hasOwn(t,a)||(n[a]=!0,t[a]=!0,e.predecessors(a).forEach(i),delete n[a],o.push(a))}),Object.keys(t).length!==e.nodeCount())throw new r;return o}var r=class extends Error{constructor(){super(...arguments)}};t.exports=n,n.CycleException=r}),x=r((e,t)=>{var n=m();t.exports=function(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}),w=r((e,t)=>{t.exports=function(e,t,n,r,o){Array.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),a={};return t.forEach(function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);o=function e(t,n,r,o,i,a,s){return Object.hasOwn(o,n)||(o[n]=!0,r||(s=a(s,n)),i(n).forEach(function(n){s=e(t,n,r,o,i,a,s)}),r&&(s=a(s,n))),s}(e,t,"post"===n,a,i,r,o)}),o}}),b=r((e,t)=>{var n=w();t.exports=function(e,t,r){return n(e,t,r,function(e,t){return e.push(t),e},[])}}),_=r((e,t)=>{var n=b();t.exports=function(e,t){return n(e,t,"post")}}),E=r((e,t)=>{var n=b();t.exports=function(e,t){return n(e,t,"pre")}}),k=r((e,t)=>{var n=i(),r=h();t.exports=function(e,t){var o,i=new n,a={},s=new r;function u(e){var n=e.v===o?e.w:e.v,r=s.priority(n);if(void 0!==r){var i=t(e);i<r&&(a[n]=o,s.decrease(n,i))}}if(0===e.nodeCount())return i;e.nodes().forEach(function(e){s.add(e,1/0),i.setNode(e)}),s.decrease(e.nodes()[0],0);for(var l=!1;s.size()>0;){if(Object.hasOwn(a,o=s.removeMin()))i.setEdge(o,a[o]);else{if(l)throw Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(o).forEach(u)}return i}}),M=r((e,t)=>{var n=d(),r=l();t.exports=function(e,t,o,i){return function(e,t,o,i){if(void 0===o)return n(e,t,o,i);for(var a=!1,s=e.nodes(),u=0;u<s.length;u++){for(var l=i(s[u]),c=0;c<l.length;c++){var h=l[c],d=h.v===s[u]?h.v:h.w,f=d===h.v?h.w:h.v;0>o({v:d,w:f})&&(a=!0)}if(a)return r(e,t,o,i)}return n(e,t,o,i)}(e,t,o,i||function(t){return e.outEdges(t)})}}),O=r((e,t)=>{t.exports={bellmanFord:l(),components:c(),dijkstra:d(),dijkstraAll:f(),extractPath:p(),findCycles:v(),floydWarshall:y(),isAcyclic:x(),postorder:_(),preorder:E(),prim:k(),shortestPaths:M(),reduce:w(),tarjan:g(),topsort:m()}}),N=s();t.exports={Graph:N.Graph,json:u(),alg:O(),version:N.version}}),i=r((e,t)=>{function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return n(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}}}),a=r((e,t)=>{var n=o().Graph,r=i();t.exports=function(e,t){var o,i;let l,c,h,d,f;if(1>=e.nodeCount())return[];let p=(o=e,i=t||a,l=new n,c=0,h=0,o.nodes().forEach(e=>{l.setNode(e,{v:e,in:0,out:0})}),o.edges().forEach(e=>{let t=l.edge(e.v,e.w)||0,n=i(e);l.setEdge(e.v,e.w,t+n),h=Math.max(h,l.node(e.v).out+=n),c=Math.max(c,l.node(e.w).in+=n)}),d=(function(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t})(h+c+3).map(()=>new r),f=c+1,l.nodes().forEach(e=>{u(d,f,l.node(e))}),{graph:l,buckets:d,zeroIdx:f});return(function(e,t,n){let r=[],o=t[t.length-1],i=t[0],a;for(;e.nodeCount();){for(;a=i.dequeue();)s(e,t,n,a);for(;a=o.dequeue();)s(e,t,n,a);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(a=t[o].dequeue()){r=r.concat(s(e,t,n,a,!0));break}}}return r})(p.graph,p.buckets,p.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var a=()=>1;function s(e,t,n,r,o){let i=o?[]:void 0;return e.inEdges(r.v).forEach(r=>{let a=e.edge(r),s=e.node(r.v);o&&i.push({v:r.v,w:r.w}),s.out-=a,u(t,n,s)}),e.outEdges(r.v).forEach(r=>{let o=e.edge(r),i=r.w,a=e.node(i);a.in-=o,u(t,n,a)}),e.removeNode(r.v),i}function u(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}}),s=r((e,t)=>{var n=o().Graph;function r(e,t,n,r){for(var o=r;e.hasNode(o);)o=u(r);return n.dummy=t,e.setNode(o,n),o}t.exports={addBorderNode:function(e,t,n,o){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=o),r(e,"border",i,t)},addDummyNode:r,applyWithChunking:i,asNonCompoundGraph:function(e){let t=new n({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t},buildLayerMatrix:function(e){let t=l(a(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),o=r.rank;void 0!==o&&(t[o][r.order]=n)}),t},intersectRect:function(e,t){let n,r,o=e.x,i=e.y,a=t.x-o,s=t.y-i,u=e.width/2,l=e.height/2;if(!a&&!s)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*l?(s<0&&(l=-l),n=l*a/s,r=l):(a<0&&(u=-u),n=u,r=u*s/a),{x:o+n,y:i+r}},mapValues:function(e,t){let n=t;return"string"==typeof t&&(n=e=>e[t]),Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})},maxRank:a,normalizeRanks:function(e){let t=i(Math.min,e.nodes().map(t=>{let n=e.node(t).rank;return void 0===n?Number.MAX_VALUE:n}));e.nodes().forEach(n=>{let r=e.node(n);Object.hasOwn(r,"rank")&&(r.rank-=t)})},notime:function(e,t){return t()},partition:function(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n},pick:function(e,t){let n={};for(let r of t)void 0!==e[r]&&(n[r]=e[r]);return n},predecessorWeights:function(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return c(e.nodes(),t)},range:l,removeEmptyRanks:function(e){let t=i(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),n=[];e.nodes().forEach(r=>{let o=e.node(r).rank-t;n[o]||(n[o]=[]),n[o].push(r)});let r=0,o=e.graph().nodeRankFactor;Array.from(n).forEach((t,n)=>{void 0===t&&n%o!=0?--r:void 0!==t&&r&&t.forEach(t=>e.node(t).rank+=r)})},simplify:function(e){let t=new n().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return c(e.nodes(),t)},time:function(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}},uniqueId:u,zipObject:c};function i(e,t){if(!(t.length>65535))return e.apply(null,t);{let n=function(e,t=65535){let n=[];for(let r=0;r<e.length;r+=t){let o=e.slice(r,r+t);n.push(o)}return n}(t);return e.apply(null,n.map(t=>e.apply(null,t)))}}function a(e){return i(Math.max,e.nodes().map(t=>{let n=e.node(t).rank;return void 0===n?5e-324:n}))}var s=0;function u(e){return e+""+ ++s}function l(e,t,n=1){null==t&&(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let o=[];for(let t=e;r(t);t+=n)o.push(t);return o}function c(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}}),u=r((e,t)=>{var n=a(),r=s().uniqueId;t.exports={run:function(e){var t,o;let i,a,s;("greedy"===e.graph().acyclicer?n(e,(t=e,e=>t.edge(e).weight)):(i=[],a={},s={},(o=e).nodes().forEach(function e(t){Object.hasOwn(s,t)||(s[t]=!0,a[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(a,t.w)?i.push(t):e(t.w)}),delete a[t])}),i)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r("rev"))})},undo:function(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}}}),l=r((e,t)=>{var n=s();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let r,o,i,a=t.v,s=e.node(a).rank,u=t.w,l=e.node(u).rank,c=t.name,h=e.edge(t),d=h.labelRank;if(l!==s+1){for(e.removeEdge(t),i=0,++s;s<l;++i,++s)h.points=[],o={width:0,height:0,edgeLabel:h,edgeObj:t,rank:s},r=n.addDummyNode(e,"edge",o,"_d"),s===d&&(o.width=h.width,o.height=h.height,o.dummy="edge-label",o.labelpos=h.labelpos),e.setEdge(a,r,{weight:h.weight},c),0===i&&e.graph().dummyChains.push(r),a=r;e.setEdge(a,u,{weight:h.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,o;for(e.setEdge(n.edgeObj,r);n.dummy;)o=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),"edge-label"===n.dummy&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=o,n=e.node(t)})}}}),c=r((e,t)=>{var{applyWithChunking:n}=s();t.exports={longestPath:function(e){var t={};e.sources().forEach(function r(o){var i=e.node(o);if(Object.hasOwn(t,o))return i.rank;t[o]=!0;var a=n(Math.min,e.outEdges(o).map(t=>null==t?1/0:r(t.w)-e.edge(t).minlen));return a===1/0&&(a=0),i.rank=a})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),h=r((e,t)=>{var n=o().Graph,r=c().slack;t.exports=function(e){var t,o,i,a,s=new n({directed:!1}),u=e.nodes()[0],l=e.nodeCount();for(s.setNode(u,{});t=s,o=e,t.nodes().forEach(function e(n){o.nodeEdges(n).forEach(i=>{var a=i.v,s=n===a?i.w:a;t.hasNode(s)||r(o,i)||(t.setNode(s,{}),t.setEdge(n,s,{}),e(s))})}),t.nodeCount()<l;)i=function(e,t){return t.edges().reduce((n,o)=>{let i=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(i=r(t,o)),i<n[0]?[i,o]:n},[1/0,null])[1]}(s,e),a=s.hasNode(i.v)?r(e,i):-r(e,i),function(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}(s,e,a);return s}}),d=r((e,t)=>{var n=h(),r=c().slack,i=c().longestPath,a=o().alg.preorder,u=o().alg.postorder,l=s().simplify;function d(e){i(e=l(e));var t,r,o=n(e);for(g(o),f(o,e);t=v(o);)r=y(o,e,t),m(o,e,t,r)}function f(e,t){var n=u(e,e.nodes());(n=n.slice(0,n.length-1)).forEach(n=>{var r,o,i,a;return r=e,o=t,i=n,a=r.node(i).parent,void(r.edge(i,a).cutvalue=p(r,o,i))})}function p(e,t,n){var r=e.node(n).parent,o=!0,i=t.edge(n,r),a=0;return i||(o=!1,i=t.edge(r,n)),a=i.weight,t.nodeEdges(n).forEach(i=>{var s=i.v===n,u=s?i.w:i.v;if(u!==r){var l,c,h,d=s===o,f=t.edge(i).weight;if(a+=d?f:-f,l=e,c=n,h=u,l.hasEdge(c,h)){var p=e.edge(n,u).cutvalue;a+=d?-p:p}}}),a}function g(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,n,r,o,i){var a=r,s=t.node(o);return n[o]=!0,t.neighbors(o).forEach(i=>{Object.hasOwn(n,i)||(r=e(t,n,r,i,o))}),s.low=a,s.lim=r++,i?s.parent=i:delete s.parent,r}(e,{},1,t)}function v(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function y(e,t,n){var o=n.v,i=n.w;t.hasEdge(o,i)||(o=n.w,i=n.v);var a=e.node(o),s=e.node(i),u=a,l=!1;return a.lim>s.lim&&(u=s,l=!0),t.edges().filter(t=>l===x(e,e.node(t.v),u)&&l!==x(e,e.node(t.w),u)).reduce((e,n)=>r(t,n)<r(t,e)?n:e)}function m(e,t,n,r){var o,i,s,u,l=n.v,c=n.w;e.removeEdge(l,c),e.setEdge(r.v,r.w,{}),g(e),f(e,t),o=e,i=t,s=o.nodes().find(e=>!i.node(e).parent),(u=(u=a(o,s)).slice(1)).forEach(e=>{var t=o.node(e).parent,n=i.edge(e,t),r=!1;n||(n=i.edge(t,e),r=!0),i.node(e).rank=i.node(t).rank+(r?n.minlen:-n.minlen)})}function x(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}t.exports=d,d.initLowLimValues=g,d.initCutValues=f,d.calcCutValue=p,d.leaveEdge=v,d.enterEdge=y,d.exchangeEdges=m}),f=r((e,t)=>{var n=c().longestPath,r=h(),o=d();t.exports=function(e){var t,a=e.graph().ranker;if(a instanceof Function)return a(e);switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":n(t=e),r(t);break;case"longest-path":i(e);case"none":}};var i=n}),p=r((e,t)=>{t.exports=function(e){var t;let n,r,o=(n={},r=0,(t=e).children().forEach(function e(o){let i=r;t.children(o).forEach(e),n[o]={low:i,lim:r++}}),n);e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeObj,i=function(e,t,n,r){let o=[],i=[],a=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),u,l;u=n;do o.push(u=e.parent(u));while(u&&(t[u].low>a||s>t[u].lim));for(l=u,u=r;(u=e.parent(u))!==l;)i.push(u);return{path:o.concat(i.reverse()),lca:l}}(e,o,r.v,r.w),a=i.path,s=i.lca,u=0,l=a[0],c=!0;for(;t!==r.w;){if(n=e.node(t),c){for(;(l=a[u])!==s&&e.node(l).maxRank<n.rank;)u++;l===s&&(c=!1)}if(!c){for(;u<a.length-1&&e.node(l=a[u+1]).minRank<=n.rank;)u++;l=a[u]}e.setParent(t,l),t=e.successors(t)[0]}})}}),g=r((e,t)=>{var n=s();t.exports={run:function(e){var t,r,o;let i=n.addDummyNode(e,"root",{},"_root"),a=(r={},(t=e).children().forEach(e=>(function e(n,o){var i=t.children(n);i&&i.length&&i.forEach(t=>e(t,o+1)),r[n]=o})(e,1)),r),s=Object.values(a),u=n.applyWithChunking(Math.max,s)-1,l=2*u+1;e.graph().nestingRoot=i,e.edges().forEach(t=>e.edge(t).minlen*=l);let c=(o=e).edges().reduce((e,t)=>e+o.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,r,o,i,a,s,u){let l=t.children(u);if(!l.length){u!==r&&t.setEdge(r,u,{weight:0,minlen:o});return}let c=n.addBorderNode(t,"_bt"),h=n.addBorderNode(t,"_bb"),d=t.node(u);t.setParent(c,u),d.borderTop=c,t.setParent(h,u),d.borderBottom=h,l.forEach(n=>{e(t,r,o,i,a,s,n);let l=t.node(n),d=l.borderTop?l.borderTop:n,f=l.borderBottom?l.borderBottom:n,p=l.borderTop?i:2*i,g=d!==f?1:a-s[u]+1;t.setEdge(c,d,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,h,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(u)||t.setEdge(r,c,{weight:0,minlen:a+s[u]})})(e,i,l,c,u,a,t)),e.graph().nodeRankFactor=l},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}),v=r((e,t)=>{var n=s();function r(e,t,r,o,i,a){let s=i[t][a-1],u=n.addDummyNode(e,"border",{width:0,height:0,rank:a,borderType:t},r);i[t][a]=u,e.setParent(u,o),s&&e.setEdge(s,u,{weight:1})}t.exports=function(e){e.children().forEach(function t(n){let o=e.children(n),i=e.node(n);if(o.length&&o.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,o=i.maxRank+1;t<o;++t)r(e,"borderLeft","_bl",n,i,t),r(e,"borderRight","_br",n,i,t)}})}}),y=r((e,t)=>{function n(e){e.nodes().forEach(t=>r(e.node(t))),e.edges().forEach(t=>r(e.edge(t)))}function r(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.y=-e.y}function i(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&n(e)},undo:function(e){var t,r;let a=e.graph().rankdir.toLowerCase();("bt"===a||"rl"===a)&&((t=e).nodes().forEach(e=>o(t.node(e))),t.edges().forEach(e=>{let n=t.edge(e);n.points.forEach(o),Object.hasOwn(n,"y")&&o(n)})),("lr"===a||"rl"===a)&&((r=e).nodes().forEach(e=>i(r.node(e))),r.edges().forEach(e=>{let t=r.edge(e);t.points.forEach(i),Object.hasOwn(t,"x")&&i(t)}),n(e))}}}),m=r((e,t)=>{var n=s();t.exports=function(e){let t={},r=e.nodes().filter(t=>!e.children(t).length),o=r.map(t=>e.node(t).rank),i=n.applyWithChunking(Math.max,o),a=n.range(i+1).map(()=>[]);return r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(function n(r){t[r]||(t[r]=!0,a[e.node(r).rank].push(r),e.successors(r).forEach(n))}),a}}),x=r((e,t)=>{var n=s().zipObject;t.exports=function(e,t){let r=0;for(let o=1;o<t.length;++o)r+=function(e,t,r){let o=n(r,r.map((e,t)=>t)),i=t.flatMap(t=>e.outEdges(t).map(t=>({pos:o[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),a=1;for(;a<r.length;)a<<=1;let s=2*a-1;a-=1;let u=Array(s).fill(0),l=0;return i.forEach(e=>{let t=e.pos+a;u[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=u[t+1]),t=t-1>>1,u[t]+=e.weight;l+=e.weight*n}),l}(e,t[o-1],t[o]);return r}}),w=r((e,t)=>{t.exports=function(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),o=e.node(n.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}}),b=r((e,t)=>{var n=s();t.exports=function(e,t){let r={};return e.forEach((e,t)=>{let n=r[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(n.barycenter=e.barycenter,n.weight=e.weight)}),t.edges().forEach(e=>{let t=r[e.v],n=r[e.w];void 0!==t&&void 0!==n&&(n.indegree++,t.out.push(r[e.w]))}),function(e){let t=[];for(;e.length;){let n=e.pop();t.push(n),n.in.reverse().forEach(function(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(n)),n.out.forEach(function(t){return n=>{n.in.push(t),0==--n.indegree&&e.push(n)}}(n))}return t.filter(e=>!e.merged).map(e=>n.pick(e,["vs","i","barycenter","weight"]))}(Object.values(r).filter(e=>!e.indegree))}}),_=r((e,t)=>{var n=s();function r(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}t.exports=function(e,t){var o;let i=n.partition(e,e=>Object.hasOwn(e,"barycenter")),a=i.lhs,s=i.rhs.sort((e,t)=>t.i-e.i),u=[],l=0,c=0,h=0;a.sort((o=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:o?t.i-e.i:e.i-t.i)),h=r(u,s,h),a.forEach(e=>{h+=e.vs.length,u.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,h=r(u,s,h)});let d={vs:u.flat(!0)};return c&&(d.barycenter=l/c,d.weight=c),d}}),E=r((e,t)=>{var n=w(),r=b(),o=_();t.exports=function e(t,i,a,s){var u,l;let c=t.children(i),h=t.node(i),d=h?h.borderLeft:void 0,f=h?h.borderRight:void 0,p={};d&&(c=c.filter(e=>e!==d&&e!==f));let g=n(t,c);g.forEach(n=>{if(t.children(n.v).length){var r,o;let i=e(t,n.v,a,s);p[n.v]=i,Object.hasOwn(i,"barycenter")&&(r=n,o=i,void 0!==r.barycenter?(r.barycenter=(r.barycenter*r.weight+o.barycenter*o.weight)/(r.weight+o.weight),r.weight+=o.weight):(r.barycenter=o.barycenter,r.weight=o.weight))}});let v=r(g,a);u=v,l=p,u.forEach(e=>{e.vs=e.vs.flatMap(e=>l[e]?l[e].vs:e)});let y=o(v,s);if(d&&(y.vs=[d,y.vs,f].flat(!0),t.predecessors(d).length)){let e=t.node(t.predecessors(d)[0]),n=t.node(t.predecessors(f)[0]);Object.hasOwn(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+e.order+n.order)/(y.weight+2),y.weight+=2}return y}}),k=r((e,t)=>{var n=o().Graph,r=s();t.exports=function(e,t,o,i){i||(i=e.nodes());let a=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),s=new n({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(t=>e.node(t));return i.forEach(n=>{let r=e.node(n),i=e.parent(n);(r.rank===t||r.minRank<=t&&t<=r.maxRank)&&(s.setNode(n),s.setParent(n,i||a),e[o](n).forEach(t=>{let r=t.v===n?t.w:t.v,o=s.edge(r,n),i=void 0!==o?o.weight:0;s.setEdge(r,n,{weight:e.edge(t).weight+i})}),Object.hasOwn(r,"minRank")&&s.setNode(n,{borderLeft:r.borderLeft[t],borderRight:r.borderRight[t]}))}),s}}),M=r((e,t)=>{t.exports=function(e,t,n){let r={},o;n.forEach(n=>{let i=e.parent(n),a,s;for(;i;){if((a=e.parent(i))?(s=r[a],r[a]=i):(s=o,o=i),s&&s!==i)return void t.setEdge(s,i);i=a}})}}),O=r((e,t)=>{var n=m(),r=x(),i=E(),a=k(),u=M(),l=o().Graph,c=s();function h(e,t,n){let r=new Map,o=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if("number"==typeof n.rank&&o(n.rank,t),"number"==typeof n.minRank&&"number"==typeof n.maxRank)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&o(e,t)}return t.map(function(t){return a(e,t,n,r.get(t)||[])})}function d(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}t.exports=function e(t,o={}){if("function"==typeof o.customOrder)return void o.customOrder(t,e);let a=c.maxRank(t),s=h(t,c.range(1,a+1),"inEdges"),f=h(t,c.range(a-1,-1,-1),"outEdges"),p=n(t);if(d(t,p),o.disableOptimalOrderHeuristic)return;let g=1/0,v,y=o.constraints||[];for(let e=0,n=0;n<4;++e,++n){(function(e,t,n){let r=new l;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let o=e.graph().root,a=i(e,o,r,t);a.vs.forEach((t,n)=>e.node(t).order=n),u(e,r,a.vs)})})(e%2?s:f,e%4>=2,y),p=c.buildLayerMatrix(t);let o=r(t,p);o<g?(n=0,v=Object.assign({},p),g=o):o===g&&(v=structuredClone(p))}d(t,v)}}),N=r((e,t)=>{var n=o().Graph,r=s();function i(e,t){let n={};return t.length&&t.reduce(function(t,r){let o=0,i=0,a=t.length,s=r[r.length-1];return r.forEach((t,l)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),h=c?e.node(c).order:a;(c||t===s)&&(r.slice(i,l+1).forEach(t=>{e.predecessors(t).forEach(r=>{let i=e.node(r),a=i.order;(a<o||h<a)&&!(i.dummy&&e.node(t).dummy)&&u(n,r,t)})}),i=l+1,o=h)}),r}),n}function a(e,t){let n={};function o(t,o,i,a,s){let l;r.range(o,i).forEach(r=>{l=t[r],e.node(l).dummy&&e.predecessors(l).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&u(n,t,l)})})}return t.length&&t.reduce(function(t,n){let r=-1,i,a=0;return n.forEach((s,u)=>{if("border"===e.node(s).dummy){let t=e.predecessors(s);t.length&&(i=e.node(t[0]).order,o(n,a,u,r,i),a=u,r=i)}o(n,a,n.length,i,t.length)}),n}),n}function u(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function l(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function c(e,t,n,r){let o={},i={},a={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,i[e]=e,a[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s.length){let r=((s=s.sort((e,t)=>a[e]-a[t])).length-1)/2;for(let u=Math.floor(r),c=Math.ceil(r);u<=c;++u){let r=s[u];i[e]===e&&t<a[r]&&!l(n,e,r)&&(i[r]=e,i[e]=o[e]=o[r],t=a[r])}}})}),{root:o,align:i}}function h(e,t,r,o,i){var a,s,u,l,c,h,d;let f,p,g,v={},y=(a=e,s=t,u=r,l=i,f=new n,g=(c=(p=a.graph()).nodesep,h=p.edgesep,d=l,(e,t,n)=>{let r=e.node(t),o=e.node(n),i,a;if(i=0+r.width/2,Object.hasOwn(r,"labelpos"))switch(r.labelpos.toLowerCase()){case"l":a=-r.width/2;break;case"r":a=r.width/2}if(a&&(i+=d?a:-a),a=0,i+=(r.dummy?h:c)/2,i+=(o.dummy?h:c)/2,i+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":a=o.width/2;break;case"r":a=-o.width/2}return a&&(i+=d?a:-a),a=0,i}),s.forEach(e=>{let t;e.forEach(e=>{let n=u[e];if(f.setNode(n),t){var r=u[t],o=f.edge(r,n);f.setEdge(r,n,Math.max(g(a,e,t),o||0))}t=e})}),f),m=i?"borderLeft":"borderRight";function x(e,t){let n=y.nodes().slice(),r={},o=n.pop();for(;o;){if(r[o])e(o);else for(let e of(r[o]=!0,n.push(o),t(o)))n.push(e);o=n.pop()}}return x(function(e){v[e]=y.inEdges(e).reduce((e,t)=>Math.max(e,v[t.v]+y.edge(t)),0)},y.predecessors.bind(y)),x(function(t){let n=y.outEdges(t).reduce((e,t)=>Math.min(e,v[t.w]-y.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==m&&(v[t]=Math.max(v[t],n))},y.successors.bind(y)),Object.keys(o).forEach(e=>v[e]=v[r[e]]),v}function d(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,o=1/0;Object.entries(n).forEach(([t,n])=>{var i,a;let s=(i=e,a=t,i.node(a).width/2);r=Math.max(n+s,r),o=Math.min(n-s,o)});let i=r-o;return i<t[0]&&(t=[i,n]),t},[1/0,null])[1]}function f(e,t){let n=Object.values(t),o=r.applyWithChunking(Math.min,n),i=r.applyWithChunking(Math.max,n);["u","d"].forEach(n=>{["l","r"].forEach(a=>{let s=n+a,u=e[s];if(u===t)return;let l=Object.values(u),c=o-r.applyWithChunking(Math.min,l);"l"!==a&&(c=i-r.applyWithChunking(Math.max,l)),c&&(e[s]=r.mapValues(u,e=>e+c))})})}function p(e,t){return r.mapValues(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];{let t=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}t.exports={positionX:function(e){let t=r.buildLayerMatrix(e),n=Object.assign(i(e,t),a(e,t)),o={},s;["u","d"].forEach(i=>{s="u"===i?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(s=s.map(e=>Object.values(e).reverse()));let a=("u"===i?e.predecessors:e.successors).bind(e),u=c(e,s,n,a),l=h(e,s,u.root,u.align,"r"===t);"r"===t&&(l=r.mapValues(l,e=>-e)),o[i+t]=l})});let u=d(e,o);return f(o,u),p(o,e.graph().align)},findType1Conflicts:i,findType2Conflicts:a,addConflict:u,hasConflict:l,verticalAlignment:c,horizontalCompaction:h,alignCoordinates:f,findSmallestWidthAlignment:d,balance:p}}),j=r((e,t)=>{var n=s(),r=N().positionX;t.exports=function(e){var t;let o,i,a,s;t=e=n.asNonCompoundGraph(e),o=n.buildLayerMatrix(t),i=t.graph().ranksep,a=t.graph().rankalign,s=0,o.forEach(e=>{let n=e.reduce((e,n)=>{let r=t.node(n).height;return e>r?e:r},0);e.forEach(e=>{let r=t.node(e);"top"===a?r.y=s+r.height/2:"bottom"===a?r.y=s+n-r.height/2:r.y=s+n/2}),s+=n+i}),Object.entries(r(e)).forEach(([t,n])=>e.node(t).x=n)}}),A=r((e,t)=>{var n=u(),r=l(),i=f(),a=s().normalizeRanks,c=p(),h=s().removeEmptyRanks,d=g(),m=v(),x=y(),w=O(),b=j(),_=s(),E=o().Graph;t.exports=function(e,t={}){let o=t.debugTiming?_.time:_.notime;return o("layout",()=>{let s=o(" buildLayoutGraph",()=>{var t;let n,r;return t=e,n=new E({multigraph:!0,compound:!0}),r=P(t.graph()),n.setGraph(Object.assign({},M,L(r,k),_.pick(r,N))),t.nodes().forEach(e=>{let r=L(P(t.node(e)),A);Object.keys(z).forEach(e=>{void 0===r[e]&&(r[e]=z[e])}),n.setNode(e,r),n.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let r=P(t.edge(e));n.setEdge(e,Object.assign({},C,L(r,$),_.pick(r,S)))}),n});return o(" runLayout",()=>{var e,u,l;return e=s,u=o,l=t,void(u(" makeSpaceForEdgeLabels",()=>{var t;let n;return n=(t=e).graph(),void(n.ranksep/=2,t.edges().forEach(e=>{let r=t.edge(e);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}),u(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),u(" acyclic",()=>n.run(e)),u(" nestingGraph.run",()=>d.run(e)),u(" rank",()=>i(_.asNonCompoundGraph(e))),u(" injectEdgeLabelProxies",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);if(n.width&&n.height){let n=t.node(e.v),r={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};_.addDummyNode(t,"edge-proxy",r,"_ep")}})}),u(" removeEmptyRanks",()=>h(e)),u(" nestingGraph.cleanup",()=>d.cleanup(e)),u(" normalizeRanks",()=>a(e)),u(" assignRankMinMax",()=>{var t;let n;return n=0,void((t=e).nodes().forEach(e=>{let r=t.node(e);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,n=Math.max(n,r.maxRank))}),t.graph().maxRank=n)}),u(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))})}),u(" normalize.run",()=>r.run(e)),u(" parentDummyChains",()=>c(e)),u(" addBorderSegments",()=>m(e)),u(" order",()=>w(e,l)),u(" insertSelfEdges",()=>{var t;return t=e,void _.buildLayerMatrix(t).forEach(e=>{var n=0;e.forEach((e,r)=>{var o=t.node(e);o.order=r+n,(o.selfEdges||[]).forEach(e=>{_.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:r+ ++n,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),u(" adjustCoordinateSystem",()=>x.adjust(e)),u(" position",()=>b(e)),u(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:o+2*a/3,y:i-s},{x:o+5*a/6,y:i-s},{x:o+a,y:i},{x:o+5*a/6,y:i+s},{x:o+2*a/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}})}),u(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),o=t.node(n.borderBottom),i=t.node(n.borderLeft[n.borderLeft.length-1]),a=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-i.x),n.height=Math.abs(o.y-r.y),n.x=i.x+n.width/2,n.y=r.y+n.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),u(" normalize.undo",()=>r.undo(e)),u(" fixupEdgeLabelCoords",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch(("l"===n.labelpos||"r"===n.labelpos)&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}),u(" undoCoordinateSystem",()=>x.undo(e)),u(" translateGraph",()=>(function(e){let t=1/0,n=0,r=1/0,o=0,i=e.graph(),a=i.marginx||0,s=i.marginy||0;function u(e){let i=e.x,a=e.y,s=e.width,u=e.height;t=Math.min(t,i-s/2),n=Math.max(n,i+s/2),r=Math.min(r,a-u/2),o=Math.max(o,a+u/2)}e.nodes().forEach(t=>u(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,"x")&&u(n)}),t-=a,r-=s,e.nodes().forEach(n=>{let o=e.node(n);o.x-=t,o.y-=r}),e.edges().forEach(n=>{let o=e.edge(n);o.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=r)}),i.width=n-t+a,i.height=o-r+s})(e)),u(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e),r=t.node(e.v),o=t.node(e.w),i,a;n.points?(i=n.points[0],a=n.points[n.points.length-1]):(n.points=[],i=o,a=r),n.points.unshift(_.intersectRect(r,i)),n.points.push(_.intersectRect(o,a))})}),u(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let n=t.edge(e);n.reversed&&n.points.reverse()})}),u(" acyclic.undo",()=>n.undo(e)))}),o(" updateInputGraph",()=>{var t,n;return t=e,n=s,void(t.nodes().forEach(e=>{let r=t.node(e),o=n.node(e);r&&(r.x=o.x,r.y=o.y,r.order=o.order,r.rank=o.rank,n.children(e).length&&(r.width=o.width,r.height=o.height))}),t.edges().forEach(e=>{let r=t.edge(e),o=n.edge(e);r.points=o.points,Object.hasOwn(o,"x")&&(r.x=o.x,r.y=o.y)}),t.graph().width=n.graph().width,t.graph().height=n.graph().height)}),s})};var k=["nodesep","edgesep","ranksep","marginx","marginy"],M={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},N=["acyclicer","ranker","rankdir","align","rankalign"],A=["width","height","rank"],z={width:0,height:0},$=["minlen","weight","width","height","labeloffset"],C={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},S=["labelpos"];function L(e,t){return _.mapValues(_.pick(e,t),Number)}function P(e){var t={};return e&&Object.entries(e).forEach(([e,n])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=n}),t}}),z=r((e,t)=>{var n=s(),r=o().Graph;t.exports={debugOrdering:function(e){let t=n.buildLayerMatrix(e),o=new r({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{o.setNode(t,{label:t}),o.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{o.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}),$=r((e,t)=>{t.exports="2.0.4"});let C=r((e,t)=>{t.exports={graphlib:o(),layout:A(),debug:z(),util:{time:s().time,notime:s().notime},version:$()}})()},8085:(e,t,n)=>{e.exports=n(224)},8706:(e,t,n)=>{n.d(t,{h:()=>h,n:()=>l});var r=n(7946),o=n(2223);let i=e=>{let t,n=new Set,r=(e,r)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[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.clear()}},a=t=e(r,o,i);return i},{useDebugValue:a}=r,{useSyncExternalStoreWithSelector:s}=o,u=e=>e;function l(e,t=u,n){let r=s(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return a(r),r}let c=(e,t)=>{let n=(e=>e?i(e):i)(e),r=(e,r=t)=>l(n,e,r);return Object.assign(r,n),r},h=(e,t)=>e?c(e,t):c},8807:(e,t,n)=>{var r=n(7946),o=n(8085),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useSyncExternalStore,s=r.useRef,u=r.useEffect,l=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var h=s(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;var f=a(e,(h=l(function(){function e(e){if(!u){if(u=!0,a=e,e=r(e),void 0!==o&&d.hasValue){var t=d.value;if(o(t,e))return s=t}return s=e}if(t=s,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(a=e,t):(a=e,s=n)}var a,s,u=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,n,r,o]))[0],h[1]);return u(function(){d.hasValue=!0,d.value=f},[f]),c(f),f}}}]);