PageSourceSearch

https://app.transcend.io/vendor-reactflow-core.3240c90b5e89b2262caf.js

js transcend.io collected 2026-09-24 07:58:34 UTC 105,054 bytes, 2 lines download raw bytes

vendor: 4,583 bytes, line 1
1"use strict";(self.webpackChunk_main_main=self.webpackChunk_main_main||[]).push([[8437],{529966(e,n,t){t.d(n,{Cz:()=>Ve,Fp:()=>Re,Gc:()=>ho,Jo:()=>Ke,Ln:()=>lo,Mi:()=>ee,PI:()=>L,Pj:()=>_,TG:()=>pe,VH:()=>Kn,Zk:()=>Y,ah:()=>ke,ck:()=>bo,fM:()=>Eo,h7:()=>rn,oN:()=>Me,rN:()=>He,rV:()=>yo,tE:()=>ue,yX:()=>he});var o=t(37142),r=t(243477),i=t(752837),a=t(721610),l=t(546588),d=t(887852),c=t(948225),u=t(656604),s=t(228800),f=["position","children","className","style"],v=["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"],g=["type","position","isValidConnection","isConnectable","isConnectableStart","isConnectableEnd","id","onConnect","children","className","onMouseDown","onTouchStart"],p=["nodes","edges","defaultNodes","defaultEdges","className","nodeTypes","edgeTypes","onNodeClick","onEdgeClick","onInit","onMove","onMoveStart","onMoveEnd","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","onNodeMouseEnter","onNodeMouseMove","onNodeMouseLeave","onNodeContextMenu","onNodeDoubleClick","onNodeDragStart","onNodeDrag","onNodeDragStop","onNodesDelete","onEdgesDelete","onSelectionChange","onSelectionDragStart","onSelectionDrag","onSelectionDragStop","onSelectionContextMenu","onSelectionStart","onSelectionEnd","connectionMode","connectionLineType","connectionLineStyle","connectionLineComponent","connectionLineContainerStyle","deleteKeyCode","selectionKeyCode","selectionOnDrag","selectionMode","panActivationKeyCode","multiSelectionKeyCode","zoomActivationKeyCode","snapToGrid","snapGrid","onlyRenderVisibleElements","selectNodesOnDrag","nodesDraggable","nodesConnectable","nodesFocusable","nodeOrigin","edgesFocusable","edgesUpdatable","elementsSelectable","defaultViewport","minZoom","maxZoom","translateExtent","preventScrolling","nodeExtent","defaultMarkerColor","zoomOnScroll","zoomOnPinch","panOnScroll","panOnScrollSpeed","panOnScrollMode","zoomOnDoubleClick","panOnDrag","onPaneClick","onPaneMouseEnter","onPaneMouseMove","onPaneMouseLeave","onPaneScroll","onPaneContextMenu","children","onEdgeUpdate","onEdgeContextMenu","onEdgeDoubleClick","onEdgeMouseEnter","onEdgeMouseMove","onEdgeMouseLeave","onEdgeUpdateStart","onEdgeUpdateEnd","edgeUpdaterRadius","onNodesChange","onEdgesChange","noDragClassName","noWheelClassName","noPanClassName","fitView","fitViewOptions","connectOnClick","attributionPosition","proOptions","defaultEdgeOptions","elevateNodesOnSelect","elevateEdgesOnSelect","disableKeyboardA11y","autoPanOnConnect","autoPanOnNodeDrag","connectionRadius","isValidConnection","onError","style","id","nodeDragThreshold"];function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function m(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,r,i,a,l=[],d=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;d=!1}else for(;!(d=(o=i.call(t)).done)&&(l.push(o.value),l.length!==n);d=!0);}catch(e){c=!0,r=e}finally{try{if(!d&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw r}}return l}}(e,n)||S(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,n){if(e){if("string"==typeof e)return b(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?b(e,n):void 0}}function b(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,o=Array(n);t<n;t++)o[t]=e[t];return o}function E(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,o)}return t}function x(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};
1n%2?E(Object(t),!0).forEach(function(n){C(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):E(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function C(e,n,t){return(n=function(e){var n=function(e,n){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var o=t.call(e,n||"default");if("object"!=h(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==h(n)?n:n+""}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function w(e,n){if(null==e)return{};var t,o,r=function(e,n){if(null==e)return{};var t={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==n.indexOf(o))continue;t[o]=e[o]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)t=i[o],-1===n.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var N=(0,o.createContext)(null),M=N.Provider,P=function(e){return'Node type "'.concat(e,'" not found. Using fallback type "default".')},O=function(){return"The React Flow parent container needs a width and a height to render the graph."},k=function(){return"Only child nodes can use a parent extent."},D=function(){return"Can't create edge. An edge needs a source and a target."},I=function(e){return'Marker type "'.concat(e,"\" doesn't exist.")},A=function(e,n){return"Couldn't create edge for ".concat(e?"target":"source",' handle id: "').concat(e?n.targetHandle:n.sourceHandle,'", edge id: ').concat(n.id,".")},R=function(){return"Handle: No node id found. Make sure to only use a Handle inside a custom Node."},B=function(e){return'Edge type "'.concat(e,'" not found. Using fallback type "default".')}
1,z=function(e){return'Node with id "'.concat(e,'" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.')},T=function(){return"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001"}();function _(e,n){var t=(0,o.useContext)(N);if(null===t)throw new Error(T);return(0,i.n)(t,e,n)}var L=function(){var e=(0,o.useContext)(N);if(null===e)throw new Error(T);return(0,o.useMemo)(function(){return{getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}},[e])},H=function(e){return e.userSelectionActive?"none":"all"};function Y(e){var n=e.position,t=e.children,i=e.className,a=e.style,l=w(e,f),d=_(H),c="".concat(n).split("-");return o.createElement("div",x({className:(0,r.A)(["react-flow__panel",i].concat(y(c))),style:x(x({},a),{},{pointerEvents:d})},l),t)}function X(e){var n=e.proOptions,t=e.position,r=void 0===t?"bottom-right":t;return null!==n&&void 0!==n&&n.hideAttribution?null:o.createElement(Y,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},o.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var V=function(e){var n=e.x,t=e.y,i=e.label,a=e.labelStyle,l=void 0===a?{}:a,d=e.labelShowBg,c=void 0===d||d,u=e.labelBgStyle,s=void 0===u?{}:u,f=e.labelBgPadding,g=void 0===f?[2,4]:f,p=e.labelBgBorderRadius,h=void 0===p?2:p,y=e.children,S=e.className,b=w(e,v),E=(0,o.useRef)(null),C=m((0,o.useState)({x:0,y:0,width:0,height:0}),2),N=C[0],M=C[1],P=(0,r.A)(["react-flow__edge-textwrapper",S]);return(0,o.useEffect)(function(){if(E.current){var e=E.current.getBBox();M({x:e.x,y:e.y,width:e.width,height:e.height})}},[i]),"undefined"!==typeof i&&i?o.createElement("g",x({transform:"translate(".concat(n-N.width/2," ").concat(t-N.height/2,")"),className:P,visibility:N.width?"visible":"hidden"},b),c&&o.createElement("rect",{width:N.width+2*g[0],x:-g[0],y:-g[1],height:N.height+2*g[1],className:"react-flow__edge-textbg",style:s,rx:h,ry:h}),o.createElement("text",{className:"react-flow__edge-text",y:N.height/2,dy:"0.3em",ref:E,style:l},i),y):null},K=(0,o.memo)(V),Z=function(e){return{width:e.offsetWidth,height:e.offsetHeight}},F=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(e,n),t)},U=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0},n=arguments.length>1?arguments[1]:void 0;return{x:F(e.x,n[0][0],n[1][0]),y:F(e.y,n[0][1],n[1][1])}},W=function(e,n,t){return e<n?F(Math.abs(e-n),1,50)/50:e>t?-F(Math.abs(e-t),1,50)/50:0},j=function(e,n){return[20*W(e.x,35,n.width-35),20*W(e.y,35,n.height-35)]},G=function(e){var n,t;return(null===(n=e.getRootNode)||void 0===n?void 0:n.call(e))||(null===(t=window)||void 0===t?void 0:t.document)},q=function(e,n){return{x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}},Q=function(e){var n=e.x,t=e.y;return{x:n,y:t,x2:n+e.width,y2:t+e.height}},J=function(e){var n=e.x,t=e.y;return{x:n,y:t,width:e.x2-n,height:e.y2-t}},$=function(e){return x(x({},e.positionAbsolute||{x:0,y:0}),{},{width:e.width||0,height:e.height||0})},ee=function(e,n){return J(q(Q(e),Q(n)))},ne=function(e,n){var t=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),o=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(t*o)},te=function(e){return!isNaN(e)&&isFinite(e)},oe=Symbol.for("internals"),re=["Enter"," ","Escape"],ie=function(e,n){0};function ae(e){var n,t=function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,o=(null===(n=t.composedPath)||void 0===n||null===(n=n.call(t))||void 0===n?void 0:n[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(null===o||void 0===o?void 0:o.nodeName)||(null===o||void 0===o?void 0:o.hasAttribute("contenteditable"))||!(null===o||void 0===o||!o.closest(".
1nokey"))}var le=function(e){return"clientX"in e},de=function(e,n){var t,o,r,i,a=le(e),l=a?e.clientX:null===(t=e.touches)||void 0===t?void 0:t[0].clientX,d=a?e.clientY:null===(o=e.touches)||void 0===o?void 0:o[0].clientY;return{x:l-(null!==(r=null===n||void 0===n?void 0:n.left)&&void 0!==r?r:0),y:d-(null!==(i=null===n||void 0===n?void 0:n.top)&&void 0!==i?i:0)}},ce=function(){var e;return"undefined"!==typeof navigator&&(null===(e=navigator)||void 0===e||null===(e=e.userAgent)||void 0===e?void 0:e.indexOf("Mac"))>=0},ue=function(e){var n=e.id,t=e.path,r=e.labelX,i=e.labelY,a=e.label,l=e.labelStyle,d=e.labelShowBg,c=e.labelBgStyle,u=e.labelBgPadding,s=e.labelBgBorderRadius,f=e.style,v=e.markerEnd,g=e.markerStart,p=e.interactionWidth,h=void 0===p?20:p;return o.createElement(o.Fragment,null,o.createElement("path",{id:n,style:f,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:v,markerStart:g}),h&&o.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),a&&te(r)&&te(i)?o.createElement(K,{x:r,y:i,label:a,labelStyle:l,labelShowBg:d,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:s}):null)};ue.displayName="BaseEdge";var se,fe,ve,ge,pe,he;function me(e,n,t){return void 0===t?t:function(o){var r=n().edges.find(function(n){return n.id===e});r&&t(o,x({},r))}}function ye(e){var n=e.sourceX,t=e.sourceY,o=e.targetX,r=e.targetY,i=Math.abs(o-n)/2,a=o<n?o+i:o-i,l=Math.abs(r-t)/2;return[a,r<t?r+l:r-l,i,l]}function Se(e){var n=e.sourceX,t=e.sourceY,o=e.targetX,r=e.targetY,i=e.sourceControlX,a=e.sourceControlY,l=.125*n+.375*i+.375*e.targetControlX+.125*o,d=.125*t+.375*a+.375*e.targetControlY+.125*r;return[l,d,Math.abs(l-n),Math.abs(d-t)]}function be(e){var n=e.pos,t=e.x1,o=e.y1,r=e.x2,i=e.y2;return n===he.Left||n===he.Right?[.5*(t+r),o]:[t,.5*(o+i)]}function Ee(e){var n=e.sourceX,t=e.sourceY,o=e.sourcePosition,r=void 0===o?he.Bottom:o,i=e.targetX,a=e.targetY,l=e.targetPosition,d=void 0===l?he.Top:l,c=m(be({pos:r,x1:n,y1:t,x2:i,y2:a}),2),u=c[0],s=c[1],f=m(be({pos:d,x1:i,y1:a,x2:n,y2:t}),2),v=f[0],g=f[1],p=m(Se({sourceX:n,sourceY:t,targetX:i,targetY:a,sourceControlX:u,sourceControlY:s,targetControlX:v,targetControlY:g}),4),h=p[0],y=p[1],S=p[2],b=p[3];return["M".concat(n,",").concat(t," C").concat(u,",").concat(s," ").concat(v,",").concat(g," ").concat(i,",").concat(a),h,y,S,b]}!function(e){e.Strict="strict",e.Loose="loose"}(se||(se={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(fe||(fe={})),function(e){e.Partial="partial",e.Full="full"}(ve||(ve={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(ge||(ge={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(pe||(pe={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(he||(he={}));var xe=(0,o.memo)(function(e){var n=e.sourceX,t=e.sourceY,r=e.targetX,i=e.targetY,a=e.sourcePosition,l=void 0===a?he.Bottom:a,d=e.targetPosition,c=void 0===d?he.Top:d,u=e.label,s=e.labelStyle,f=e.labelShowBg,v=e.labelBgStyle,g=e.labelBgPadding,p=e.labelBgBorderRadius,h=e.style,y=e.markerEnd,S=e.markerStart,b=e.interactionWidth,E=m(Ee({sourceX:n,sourceY:t,sourcePosition:l,targetX:r,targetY:i,targetPosition:c}),3),x=E[0],C=E[1],w=E[2];return o.createElement(ue,{path:x,labelX:C,labelY:w,label:u,labelStyle:s,labelShowBg:f,labelBgStyle:v,labelBgPadding:g,labelBgBorderRadius:p,style:h,markerEnd:y,markerStart:S,interactionWidth:b})});xe.displayName="SimpleBezierEdge";var Ce=C(C(C(C({},he.Left,{x:-1,y:0}),he.Right,{x:1,y:0}),he.Top,{x:0,y:-1}),he.Bottom,{x:0,y:1}),we=function(e,n){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))};function Ne(e){var n,t,o=e.source,r=e.sourcePosition,i=void 0===r?he.Bottom:r,a=e.target,l=e.targetPosition,d=void 0===l?he.Top:l,c=e.center,u=e.offset,s=Ce[i],f=Ce[d],v={x:o.x+s.x*u,y:o.y+s.y*u},g={x:a.x+f.x*u,y:a.y+f.y*u},p=function(e){var n=e.source,t=e.sourcePosition,o=void 0===t?he.Bottom:t,r=e.target;return o===he.Left||o===he.Right?n.x<r.x?{x:1,y:0}:{x:-1,y:0}:n.y<r.y?{x:0,y:1}:{x:0,y:-1}}({source:v,sourcePosition:i,target:g}),h=0!==p.x?"x":"y",S=p[h],b=[],E={x:0,y:0},x={x:0,y:0},C=m(ye({sourceX:o.x,sourceY:o.y,targetX:a.x,targetY:a.y}),4),w=C[0],N=C[1],M=C[2],P=C[3];if(s[h]*f[h]===-1){n=c.x||w,t=c.y||N;var O=[{x:n,y:v.y},{x:n,y:g.y}],k=[{x:v.x,y:t},{x:g.x,y:t}];b=s[h]===S?"x"===h?O:k:"x"===h?k:O}else{var D=[{x:v.x,y:g.y}],I=[{x:g.x,y:v.y}];if(b="x"===h?s.x===S?I:D:s.y===S?D:I,i===d){var A=Math.abs(o[h]-a[h]);if(A<=u){var R=Math.min(u-1,u-A);s[h]===S?E[h]=(v[h]>o[h]?-1:1)*R:x[h]=(g[h]>a[h]?-1:1)*R}}if(i!==d){var B="x"===h?"y":"x",z=s[h]===f[B],T=v[B]>g[B],_=v[B]<g[B];(1===s[h]&&(!z&&T||z&&_)||1!==s[h]&&(!z&&_||z&&T))&&(b="x"===h?D:I)}var L={x:v.x+E.x,y:v.y+E.y},H={x:g.x+x.x,y:g.y+x.y};Math.max(Math.abs(L.x-b[0].x),Math.abs(H.x-b[0].x))>=Math.max(Math.abs(L.y-b[0].y),Math.abs(H.y-b[0].y))?(n=(L.x+H.x)/2,t=b[0].y):(n=b[0].x,t=(L.y+H.y)/2)}return[[o,{x:v.x+E.x,y:v.y+E.y}].concat(y(b),[{x:g.x+x.x,y:g.y+x.y},a]),n,t,M,P]}function Me(e){var n=e.sourceX,t=e.sourceY,o=e.sourcePosition,r=void 0===o?he.Bottom:o,i=e.targetX,a=e.targetY,l=e.targetPosition,d=void 0===l?he.Top:l,c=e.borderRadius,u=void 0===c?5:c,s=e.centerX,f=e.centerY,v=e.offset,g=m(Ne({source:{x:n,y:t},sourcePosition:r,target:{x:i,y:a},targetPosition:d,center:{x:s,y:f},offset:void 0===v?20:v}),5),p=g[0],h=g[1],y=g[2],S=g[3],b=g[4];return[p.reduce(function(e,n,t){return e+=t>0&&t<p.length-1?function(e,n,t,o){var r=Math.min(we(e,n)/2,we(n,t)/2,o),i=n.x,a=n.y;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return"L".concat(i," ").concat(a);if(e.y===a){var l=e.x<t.x?-1:1,d=e.y<t.y?1:-1;return"L ".concat(i+r*l,",").concat(a,"Q ").concat(i,",").concat(a," ").concat(i,",").concat(a+r*d)}var c=e.x<t.x?1:-1,u=e.y<t.y?-1:1;return"L ".concat(i,",").concat(a+r*u,"Q ").concat(i,",").concat(a," ").concat(i+r*c,",").concat(a)}(p[t-1],n,p[t+1],u):"".concat(0===t?"M":"L").concat(n.x," ").concat(n.y)},""),h,y,S,b]}var Pe=(0,o.memo)(function(e){var n=e.sourceX,t=e.sourceY,r=e.targetX,i=e.targetY,a=e.label,l=e.labelStyle,d=e.labelShowBg,c=e.labelBgStyle,u=e.labelBgPadding,s=e.labelBgBorderRadius,f=e.style,v=e.sourcePosition,g=void 0===v?he.Bottom:v,p=e.targetPosition,h=void 0===p?he.Top:p,y=e.markerEnd,S=e.markerStart,b=e.pathOptions,E=e.interactionWidth,x=m(Me({sourceX:n,sourceY:t,sourcePosition:g,targetX:r,targetY:i,targetPosition:h,borderRadius:null===b||void 0===b?void 0:b.borderRadius,offset:null===b||void 0===b?void 0:b.offset}),3),C=x[0],w=x[1],N=x[2];return o.createElement(ue,{path:C,labelX:w,labelY:N,label:a,labelStyle:l,labelShowBg:d,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:s,style:f,markerEnd:y,markerStart:S,interactionWidth:E})});Pe.displayName="SmoothStepEdge";var Oe=(0,o.memo)(function(e){var n;return o.createElement(Pe,x(x({},e),{},{pathOptions:(0,o.useMemo)(function(){var n;return{borderRadius:0,offset:null===(n=e.pathOptions)||void 0===n?void 0:n.offset}},[null===(n=e.pathOptions)||void 0===n?void 0:n.offset])}))});function ke(e){var n=e.sourceX,t=e.sourceY,o=e.targetX,r=e.targetY,i=m(ye({sourceX:n,sourceY:t,targetX:o,targetY:r}),4),a=i[0],l=i[1],d=i[2],c=i[3];return["M ".concat(n,",").concat(t,"L ").concat(o,",").concat(r),a,l,d,c]}Oe.displayName="StepEdge";var De=(0,o.memo)(function(e){var n=e.sourceX,t=e.sourceY,r=e.targetX,i=e.targetY,a=e.label,l=e.labelStyle,d=e.labelShowBg,c=e.labelBgStyle,u=e.labelBgPadding,s=e.labelBgBorderRadius,f=e.style,v=e.markerEnd,g=e.markerStart,p=e.interactionWidth,h=m(ke({sourceX:n,sourceY:t,targetX:r,targetY:i}),3),y=h[0],S=h[1],b=h[2];return o.createElement(ue,{path:y,labelX:S,labelY:b,label:a,labelStyle:l,labelShowBg:d,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:s,style:f,markerEnd:v,markerStart:g,interactionWidth:p})});function Ie(e,n){return e>=0?.5*e:25*n*Math.sqrt(-e)}function Ae(e){var n=e.pos,t=e.x1,o=e.y1,r=e.x2,i=e.y2,a=e.c;switch(n){case he.Left:return[t-Ie(t-r,a),o];case he.Right:return[t+Ie(r-t,a),o];case he.Top:return[t,o-Ie(o-i,a)];case he.Bottom:return[t,o+Ie(i-o,a)]}}function Re(e){var n=e.sourceX,t=e.sourceY,o=e.sourcePosition,r=void 0===o?he.Bottom:o,i=e.targetX,a=e.targetY,l=e.targetPosition,d=void 0===l?he.Top:l,c=e.curvature,u=void 0===c?.25:c,s=m(Ae({pos:r,x1:n,y1:t,x2:i,y2:a,c:u}),2),f=s[0],v=s[1],g=m(Ae({pos:d,x1:i,y1:a,x2:n,y2:t,c:u}),2),p=g[0],h=g[1],y=m(Se({sourceX:n,sourceY:t,targetX:i,targetY:a,sourceControlX:f,sourceControlY:v,targetControlX:p,targetControlY:h}),4),S=y[0],b=y[1],E=y[2],x=y[3];return["M".concat(n,",").concat(t," C").concat(f,",").concat(v," ").concat(p,",").concat(h," ").concat(i,",").concat(a),S,b,E,x]}De.displayName="StraightEdge";var Be=(0,o.memo)(function(e){var n=e.sourceX,t=e.sourceY,r=e.targetX,i=e.targetY,a=e.sourcePosition,l=void 0===a?he.Bottom:a,d=e.targetPosition,c=void 0===d?he.Top:d,u=e.label,s=e.labelStyle,f=e.labelShowBg,v=e.labelBgStyle,g=e.labelBgPadding,p=e.labelBgBorderRadius,h=e.style,y=e.markerEnd,S=e.markerStart,b=e.pathOptions,E=e.interactionWidth,x=m(Re({sourceX:n,sourceY:t,sourcePosition:l,targetX:r,targetY:i,targetPosition:c,curvature:null===b||void 0===b?void 0:b.curvature}),3),C=x[0],w=x[1],N=x[2];return o.createElement(ue,{path:C,labelX:w,labelY:N,label:u,labelStyle:s,labelShowBg:f,labelBgStyle:v,labelBgPadding:g,labelBgBorderRadius:p,style:h,markerEnd:y,markerStart:S,interactionWidth:E})});Be.displayName="BezierEdge";var ze=(0,o.createContext)(null),Te=ze.Provider;ze.Consumer;var _e=function(e){var n=e.source,t=e.sourceHandle,o=e.target,r=e.targetHandle;return"reactflow__edge-".concat(n).concat(t||"","-").concat(o).concat(r||"")},Le=function(e,n){if("undefined"===typeof e)return"";if("string"===typeof e)return e;var t=n?"".concat(n,"__"):"";return"".concat(t).concat(Object.keys(e).sort().map(function(n){return"".concat(n,"=").concat(e[n])}).join("&"))},He=function(e,n){return e.source&&e.target?function(e,n){return n.some(function(n){return n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)})}(t="id"in(o=e)&&"source"in o&&"target"in o?x({},e):x(x({},e),{},{id:_e(e)}),n)?n:n.concat(t):(ie(0,D()),n);var t,o},Ye=function(e,n,t,o){var r=e.x,i=e.y,a=m(n,3),l=a[0],d=a[1],c=a[2],u=m(o,2),s=u[0],f=u[1],v={x:(r-l)/c,y:(i-d)/c};return t?{x:s*Math.round(v.x/s),y:f*Math.round(v.y/f)}:v},Xe=function(e,n){var t=e.x,o=e.y,r=m(n,3),i=r[0],a=r[1],l=r[2];return{x:t*l+i,y:o*l+a}},Ve=function(e){var n,t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0];if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};var r=(null!==(n=e.width)&&void 0!==n?n:0)*o[0],i=(null!==(t=e.height)&&void 0!==t?t:0)*o[1],a={x:e.position.x-r,y:e.position.y-i};return x(x({},a),{},{positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-r,y:e.positionAbsolute.y-i}:a})},Ke=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0];if(0===e.length)return{x:0,y:0,width:0,height:0};var t=e.reduce(function(e,t){var o=Ve(t,n).positionAbsolute,r=o.x,i=o.y;return q(e,Q({x:r,y:i,width:t.width||0,height:t.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return J(t)},Ze=function(e,n){var t=m(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,1],3),o=t[0],r=t[1],i=t[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=arguments.length>4&&void 0!==arguments[4]&&arguments[4],d=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[0,0],c={x:(n.x-o)/i,y:(n.y-r)/i,width:n.width/i,height:n.height/i},u=[];return e.forEach(function(e){var n=e.width,t=e.height,o=e.selectable,r=void 0===o||o,i=e.hidden;if(l&&!r||void 0!==i&&i)return!1;var s=Ve(e,d).positionAbsolute,f={x:s.x,y:s.y,width:n||0,height:t||0},v=ne(c,f);("undefined"===typeof n||"undefined"===typeof t||null===n||null===t||a&&v>0||v>=(n||0)*(t||0)||e.dragging)&&u.push(e)}),u},Fe=function(e,n){var t=e.map(function(e){return e.id});return n.filter(function(e){return t.includes(e.source)||t.includes(e.target)})},Ue=function(e,n,t,o,r){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.1,a=n/(e.width*(1+i)),l=t/(e.height*(1+i)),d=Math.min(a,l),c=F(d,o,r);return{x:n/2-(e.x+e.width/2)*c,y:t/2-(e.y+e.height/2)*c,zoom:c}},We=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.transition().duration(n)};function je(e,n,t,o){return(n[t]||[]).reduce(function(n,r){var i,a,l,d;"".concat(e.id,"-").concat(r.id,"-").concat(t)!==o&&n.push({id:r.id||null,type:t,nodeId:e.id,x:(null!==(i=null===(a=e.positionAbsolute)||void 0===a?void 0:a.x)&&void 0!==i?i:0)+r.x+r.width/2,y:(null!==(l=null===(d=e.positionAbsolute)||void 0===d?void 0:d.y)&&void 0!==l?l:0)+r.y+r.height/2});return n},[])}var Ge={source:null,target:null,sourceHandle:null,targetHandle:null}
1,qe=function(){return{handleDomNode:null,isValid:!1,connection:Ge,endHandle:null}};function Qe(e,n,t,o,r,i,a){var l="target"===r,d=a.querySelector('.react-flow__handle[data-id="'.concat(null===e||void 0===e?void 0:e.nodeId,"-").concat(null===e||void 0===e?void 0:e.id,"-").concat(null===e||void 0===e?void 0:e.type,'"]')),c=x(x({},qe()),{},{handleDomNode:d});if(d){var u=Je(void 0,d),s=d.getAttribute("data-nodeid"),f=d.getAttribute("data-handleid"),v=d.classList.contains("connectable"),g=d.classList.contains("connectableend"),p={source:l?s:t,sourceHandle:l?f:o,target:l?t:s,targetHandle:l?o:f};c.connection=p,v&&g&&(n===se.Strict?l&&"source"===u||!l&&"target"===u:s!==t||f!==o)&&(c.endHandle={nodeId:s,handleId:f,type:u},c.isValid=i(p))}return c}function Je(e,n){return e||(null!==n&&void 0!==n&&n.classList.contains("target")?"target":null!==n&&void 0!==n&&n.classList.contains("source")?"source":null)}function $e(e){null===e||void 0===e||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function en(e){var n,t=e.event,o=e.handleId,r=e.nodeId,i=e.onConnect,a=e.isTarget,l=e.getState,d=e.setState,c=e.isValidConnection,u=e.edgeUpdaterType,s=e.onEdgeUpdateEnd,f=G(t.target),v=l(),g=v.connectionMode,p=v.domNode,h=v.autoPanOnConnect,S=v.connectionRadius,b=v.onConnectStart,E=v.panBy,x=v.getNodes,C=v.cancelConnection,w=0,N=de(t),M=N.x,P=N.y,O=null===f||void 0===f?void 0:f.elementFromPoint(M,P),k=Je(u,O),D=null===p||void 0===p?void 0:p.getBoundingClientRect();if(D&&k){var I,A=de(t,D),R=!1,B=null,z=!1,T=null,_=function(e){var n=e.nodes,t=e.nodeId,o=e.handleId,r=e.handleType;return n.reduce(function(e,n){if(n[oe]){var i=n[oe].handleBounds,a=[],l=[];i&&(a=je(n,i,"source","".concat(t,"-").concat(o,"-").concat(r)),l=je(n,i,"target","".concat(t,"-").concat(o,"-").concat(r))),e.push.apply(e,y(a).concat(y(l)))}return e},[])}({nodes:x(),nodeId:r,handleId:o,handleType:k}),L=function(){if(h){var e=m(j(A,D),2),n=e[0],t=e[1];E({x:n,y:t}),w=requestAnimationFrame(L)}};d({connectionPosition:A,connectionStatus:null,connectionNodeId:r,connectionHandleId:o,connectionHandleType:k,connectionStartHandle:{nodeId:r,handleId:o,type:k},connectionEndHandle:null}),null===b||void 0===b||b(t,{nodeId:r,handleId:o,handleType:k}),f.addEventListener("mousemove",H),f.addEventListener("mouseup",Y),f.addEventListener("touchmove",H),f.addEventListener("touchend",Y)}function H(e){var t=l().transform;A=de(e,D);var i,u,s,v=function(e,n,t,o,r,i){var a=de(e),l=a.x,d=a.y,c=n.elementsFromPoint(l,d).find(function(e){return e.classList.contains("react-flow__handle")});if(c){var u=c.getAttribute("data-nodeid");if(u){var s=Je(void 0,c),f=c.getAttribute("data-handleid"),v=i({nodeId:u,id:f,type:s});if(v){var g=r.find(function(e){return e.nodeId===u&&e.type===s&&e.id===f});return{handle:{id:f,type:s,nodeId:u,x:(null===g||void 0===g?void 0:g.x)||t.x,y:(null===g||void 0===g?void 0:g.y)||t.y},validHandleResult:v}}}}var p=[],h=1/0;if(r.forEach(function(e){var n=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));if(n<=o){var r=i(e);n<=h&&(n<h?p=[{handle:e,validHandleResult:r}]:n===h&&p.push({handle:e,validHandleResult:r}),h=n)}}),!p.length)return{handle:null,validHandleResult:qe()};if(1===p.length)return p[0];var m=p.some(function(e){return e.validHandleResult.isValid}),y=p.some(function(e){return"target"===e.handle.type});return p.find(function(e){var n=e.handle,t=e.validHandleResult;return y?"target"===n.type:!m||t.isValid})||p[0]}(e,f,Ye(A,t,!1,[1,1]),S,_,function(e){return Qe(e,g,r,o,a?"target":"source",c,f)}),p=v.handle,h=v.validHandleResult;if(n=p,R||(L(),R=!0),T=h.handleDomNode,B=h.connection,z=h.isValid,d({connectionPosition:n&&z?Xe({x:n.x,y:n.y},t):A,connectionStatus:(i=!!n,u=z,s=null,u?s="valid":i&&!u&&(s="invalid"),s),connectionEndHandle:h.endHandle}),!n&&!z&&!T)return $e(I);B.source!==B.target&&T&&($e(I),I=T,T.classList.add("connecting","react-flow__handle-connecting"),T.classList.toggle("valid",z),T.classList.toggle("react-flow__handle-valid",z))}function Y(e){var t,o;(n||T)&&B&&z&&(null===i||void 0===i||i(B)),null===(t=(o=l()).onConnectEnd)||void 0===t||t.call(o,e),u&&(null===s||void 0===s||s(e)),$e(I),C(),cancelAnimationFrame(w),R=!1,z=!1,B=null,T=null,f.removeEventListener("mousemove",H),f.removeEventListener("mouseup",Y),f.removeEventListener("touchmove",H),f.removeEventListener("touchend",Y)}}var nn=function(){return!0},tn=function(e){return{connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}},on=(0,o.forwardRef)(function(e,n){var t,i,l=e.type,d=void 0===l?"source":l,c=e.position,u=void 0===c?he.Top:c,s=e.isValidConnection,f=e.isConnectable,v=void 0===f||f,p=e.isConnectableStart,h=void 0===p||p,m=e.isConnectableEnd,y=void 0===m||m,S=e.id,b=e.onConnect,E=e.children,C=e.className,N=e.onMouseDown,M=e.onTouchStart,P=w(e,g),O=S||null,k="target"===d,D=L(),I=(0,o.useContext)(ze),A=_(tn,a.x),B=A.connectOnClick,z=A.noPanClassName,T=_(function(e,n,t){return function(o){var r=o.connectionStartHandle,i=o.connectionEndHandle,a=o.connectionClickStartHandle;
1return{connecting:(null===r||void 0===r?void 0:r.nodeId)===e&&(null===r||void 0===r?void 0:r.handleId)===n&&(null===r||void 0===r?void 0:r.type)===t||(null===i||void 0===i?void 0:i.nodeId)===e&&(null===i||void 0===i?void 0:i.handleId)===n&&(null===i||void 0===i?void 0:i.type)===t,clickConnecting:(null===a||void 0===a?void 0:a.nodeId)===e&&(null===a||void 0===a?void 0:a.handleId)===n&&(null===a||void 0===a?void 0:a.type)===t}}}(I,O,d),a.x),H=T.connecting,Y=T.clickConnecting;I||(null===(t=(i=D.getState()).onError)||void 0===t||t.call(i,"010",R()));var X=function(e){var n=D.getState(),t=n.defaultEdgeOptions,o=n.onConnect,r=n.hasDefaultEdges,i=x(x({},t),e);if(r){var a=D.getState(),l=a.edges;(0,a.setEdges)(He(i,l))}null===o||void 0===o||o(i),null===b||void 0===b||b(i)},V=function(e){if(I){var n=le(e);h&&(n&&0===e.button||!n)&&en({event:e,handleId:O,nodeId:I,onConnect:X,isTarget:k,getState:D.getState,setState:D.setState,isValidConnection:s||D.getState().isValidConnection||nn}),n?null===N||void 0===N||N(e):null===M||void 0===M||M(e)}};return o.createElement("div",x({"data-handleid":O,"data-nodeid":I,"data-handlepos":u,"data-id":"".concat(I,"-").concat(O,"-").concat(d),className:(0,r.A)(["react-flow__handle","react-flow__handle-".concat(u),"nodrag",z,C,{source:!k,target:k,connectable:v,connectablestart:h,connectableend:y,connecting:Y,connectionindicator:v&&(h&&!H||y&&H)}]),onMouseDown:V,onTouchStart:V,onClick:B?function(e){var n=D.getState(),t=n.onClickConnectStart,o=n.onClickConnectEnd,r=n.connectionClickStartHandle,i=n.connectionMode,a=n.isValidConnection;if(I&&(r||h)){if(!r)return null===t||void 0===t||t(e,{nodeId:I,handleId:O,handleType:d}),void D.setState({connectionClickStartHandle:{nodeId:I,type:d,handleId:O}});var l=G(e.target),c=s||a||nn,u=Qe({nodeId:I,id:O,type:d},i,r.nodeId,r.handleId||null,r.type,c,l),f=u.connection;u.isValid&&X(f),null===o||void 0===o||o(e),D.setState({connectionClickStartHandle:null})}}:void 0,ref:n},P),E)});on.displayName="Handle";var rn=(0,o.memo)(on),an=function(e){var n=e.data,t=e.isConnectable,r=e.targetPosition,i=void 0===r?he.Top:r,a=e.sourcePosition,l=void 0===a?he.Bottom:a;return o.createElement(o.Fragment,null,o.createElement(rn,{type:"target",position:i,isConnectable:t}),null===n||void 0===n?void 0:n.label,o.createElement(rn,{type:"source",position:l,isConnectable:t}))};an.displayName="DefaultNode";var ln=(0,o.memo)(an),dn=function(e){var n=e.data,t=e.isConnectable,r=e.sourcePosition,i=void 0===r?he.Bottom:r;return o.createElement(o.Fragment,null,null===n||void 0===n?void 0:n.label,o.createElement(rn,{type:"source",position:i,isConnectable:t}))};dn.displayName="InputNode";var cn=(0,o.memo)(dn),un=function(e){var n=e.data,t=e.isConnectable,r=e.targetPosition,i=void 0===r?he.Top:r;return o.createElement(o.Fragment,null,o.createElement(rn,{type:"target",position:i,isConnectable:t}),null===n||void 0===n?void 0:n.label)};un.displayName="OutputNode";var sn=(0,o.memo)(un),fn=function(){return null};fn.displayName="GroupNode";var vn=function(e){return{selectedNodes:e.getNodes().filter(function(e){return e.selected}),selectedEdges:e.edges.filter(function(e){return e.selected})}},gn=function(e){return e.id};function pn(e,n){return(0,a.x)(e.selectedNodes.map(gn),n.selectedNodes.map(gn))&&(0,a.x)(e.selectedEdges.map(gn),n.selectedEdges.map(gn))}var hn=(0,o.memo)(function(e){var n=e.onSelectionChange,t=L(),r=_(vn,pn),i=r.selectedNodes,a=r.selectedEdges;return(0,o.useEffect)(function(){var e={nodes:i,edges:a};null===n||void 0===n||n(e),t.getState().onSelectionChange.forEach(function(n){return n(e)})},[i,a,n]),null});hn.displayName="SelectionListener";var mn=function(e){return!!e.onSelectionChange};function yn(e){var n=e.onSelectionChange,t=_(mn);return n||t?o.createElement(hn,{onSelectionChange:n}):null}var Sn=function(e){return{setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset}};function bn(e,n){(0,o.useEffect)(function(){"undefined"!==typeof e&&n(e)},[e])}function En(e,n,t){(0,o.useEffect)(function(){"undefined"!==typeof n&&t(C({},e,n))},[n])}var xn=function(e){var n=e.nodes,t=e.edges,r=e.defaultNodes,i=e.defaultEdges,l=e.onConnect,d=e.onConnectStart,c=e.onConnectEnd,u=e.onClickConnectStart,s=e.onClickConnectEnd,f=e.nodesDraggable,v=e.nodesConnectable,g=e.nodesFocusable,p=e.edgesFocusable,h=e.edgesUpdatable,m=e.elevateNodesOnSelect,y=e.minZoom,S=e.maxZoom,b=e.nodeExtent,E=e.onNodesChange,C=e.onEdgesChange,w=e.elementsSelectable,N=e.connectionMode,M=e.snapGrid,P=e.snapToGri
1d,O=e.translateExtent,k=e.connectOnClick,D=e.defaultEdgeOptions,I=e.fitView,A=e.fitViewOptions,R=e.onNodesDelete,B=e.onEdgesDelete,z=e.onNodeDrag,T=e.onNodeDragStart,H=e.onNodeDragStop,Y=e.onSelectionDrag,X=e.onSelectionDragStart,V=e.onSelectionDragStop,K=e.noPanClassName,Z=e.nodeOrigin,F=e.rfId,U=e.autoPanOnConnect,W=e.autoPanOnNodeDrag,j=e.onError,G=e.connectionRadius,q=e.isValidConnection,Q=e.nodeDragThreshold,J=_(Sn,a.x),$=J.setNodes,ee=J.setEdges,ne=J.setDefaultNodesAndEdges,te=J.setMinZoom,oe=J.setMaxZoom,re=J.setTranslateExtent,ie=J.setNodeExtent,ae=J.reset,le=L();return(0,o.useEffect)(function(){var e=null===i||void 0===i?void 0:i.map(function(e){return x(x({},e),D)});return ne(r,e),function(){ae()}},[]),En("defaultEdgeOptions",D,le.setState),En("connectionMode",N,le.setState),En("onConnect",l,le.setState),En("onConnectStart",d,le.setState),En("onConnectEnd",c,le.setState),En("onClickConnectStart",u,le.setState),En("onClickConnectEnd",s,le.setState),En("nodesDraggable",f,le.setState),En("nodesConnectable",v,le.setState),En("nodesFocusable",g,le.setState),En("edgesFocusable",p,le.setState),En("edgesUpdatable",h,le.setState),En("elementsSelectable",w,le.setState),En("elevateNodesOnSelect",m,le.setState),En("snapToGrid",P,le.setState),En("snapGrid",M,le.setState),En("onNodesChange",E,le.setState),En("onEdgesChange",C,le.setState),En("connectOnClick",k,le.setState),En("fitViewOnInit",I,le.setState),En("fitViewOnInitOptions",A,le.setState),En("onNodesDelete",R,le.setState),En("onEdgesDelete",B,le.setState),En("onNodeDrag",z,le.setState),En("onNodeDragStart",T,le.setState),En("onNodeDragStop",H,le.setState),En("onSelectionDrag",Y,le.setState),En("onSelectionDragStart",X,le.setState),En("onSelectionDragStop",V,le.setState),En("noPanClassName",K,le.setState),En("nodeOrigin",Z,le.setState),En("rfId",F,le.setState),En("autoPanOnConnect",U,le.setState),En("autoPanOnNodeDrag",W,le.setState),En("onError",j,le.setState),En("connectionRadius",G,le.setState),En("isValidConnection",q,le.setState),En("nodeDragThreshold",Q,le.setState),bn(n,$),bn(t,ee),bn(y,te),bn(S,oe),bn(O,re),bn(b,ie),null},Cn={display:"none"},wn={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Nn="react-flow__node-desc",Mn="react-flow__edge-desc",Pn=function(e){return e.ariaLiveMessage};function On(e){var n=e.rfId,t=_(Pn);return o.createElement("div",{id:"".concat("react-flow__aria-live","-").concat(n),"aria-live":"assertive","aria-atomic":"true",style:wn},t)}function kn(e){var n=e.rfId,t=e.disableKeyboardA11y;return o.createElement(o.Fragment,null,o.createElement("div",{id:"".concat(Nn,"-").concat(n),style:Cn},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),o.createElement("div",{id:"".concat(Mn,"-").concat(n),style:Cn},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&o.createElement(On,{rfId:n}))}var Dn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{actInsideInputWithModifier:!0},t=m((0,o.useState)(!1),2),r=t[0],i=t[1],a=(0,o.useRef)(!1),l=(0,o.useRef)(new Set([])),d=m((0,o.useMemo)(function(){if(null!==e){var n=(Array.isArray(e)?e:[e]).filter(function(e){return"string"===typeof e}).map(function(e){return e.split("+")}),t=n.reduce(function(e,n){return e.concat.apply(e,y(n))},[]);return[n,t]}return[[],[]]},[e]),2),c=d[0],u=d[1];return(0,o.useEffect)(function(){var t="undefined"!==typeof document?document:null,o=(null===n||void 0===n?void 0:n.target)||t;if(null!==e){var r=function(e){if(a.current=e.ctrlKey||e.metaKey||e.shiftKey,(!a.current||a.current&&!n.actInsideInputWithModifier)&&ae(e))return!1;var t=An(e.code,u);l.current.add(e[t]),In(c,l.current,!1)&&(e.preventDefault(),i(!0))},d=function(e){if((!a.current||a.current&&!n.actInsideInputWithModifier)&&ae(e))return!1;var t=An(e.code,u);In(c,l.current,!0)?(i(!1),l.current.clear()):l.current.delete(e[t]),"Meta"===e.key&&l.current.clear(),a.current=!1},s=function(){l.current.clear(),i(!1)};return null===o||void 0===o||o.addEventListener("keydown",r),null===o||void 0===o||o.addEventListener("keyup",d),window.addEventListener("blur",s),function(){null===o||void 0===o||o.removeEventListener("keydown",r),null===o||void 0===o||o.removeEventListener("keyup",d),window.removeEventListener("blur",s)}}},[e,i]),r};function In(e,n,t){return e.filter(function(e){return t||e.length===n.size}).some(function(e){return e.every(function(e){return n.has(e)})})}function An(e,n){return n.includes(e)?"code":"key"}function Rn(e,n,t,o){var r,i,a,l,d,c,u,s;if(!e.parentNode)return t;var f=n.get(e.parentNode),v=Ve(f,o);return Rn(f,n,{x:(null!==(r=t.x)&&void 0!==r?r:0)+v.x,y:(null!==(i=t.y)&&void 0!==i?i:0)+v.y,z:(null!==(a=null===(l=f[oe])||void 0===l?void 0:l.z)&&void 0!==a?a:0)>(null!==(d=t.z)&&void 0!==d?d:0)?null!==(c=null===(u=f[oe])||void 0===u?void 0:u.z)&&void 0!==c?c:0:null!==(s=t.z)&&void 0!==s?s:0},o)}
1function Bn(e,n,t){e.forEach(function(o){if(o.parentNode&&!e.has(o.parentNode))throw new Error("Parent node ".concat(o.parentNode," not found"));if(o.parentNode||null!==t&&void 0!==t&&t[o.id]){var r,i,a=Rn(o,e,x(x({},o.position),{},{z:null!==(r=null===(i=o[oe])||void 0===i?void 0:i.z)&&void 0!==r?r:0}),n),l=a.x,d=a.y,c=a.z;o.positionAbsolute={x:l,y:d},o[oe].z=c,null!==t&&void 0!==t&&t[o.id]&&(o[oe].isParent=!0)}})}function zn(e,n,t,o){var r=new Map,i={},a=o?1e3:0;return e.forEach(function(e){var t,o=(te(e.zIndex)?e.zIndex:0)+(e.selected?a:0),l=n.get(e.id),d=x(x({},e),{},{positionAbsolute:{x:e.position.x,y:e.position.y}});e.parentNode&&(i[e.parentNode]=!0);var c=(null===l||void 0===l?void 0:l.type)&&(null===l||void 0===l?void 0:l.type)!==e.type;Object.defineProperty(d,oe,{enumerable:!1,value:{handleBounds:c||null===l||void 0===l||null===(t=l[oe])||void 0===t?void 0:t.handleBounds,z:o}}),r.set(e.id,d)}),Bn(r,t,i),r}function Tn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e(),o=t.getNodes,r=t.width,i=t.height,a=t.minZoom,d=t.maxZoom,c=t.d3Zoom,u=t.d3Selection,s=t.fitViewOnInitDone,f=t.fitViewOnInit,v=t.nodeOrigin,g=n.initial&&!s&&f;if(c&&u&&(g||!n.initial)){var p=o().filter(function(e){var t,o=n.includeHiddenNodes?e.width&&e.height:!e.hidden;return null!==(t=n.nodes)&&void 0!==t&&t.length?o&&n.nodes.some(function(n){return n.id===e.id}):o}),h=p.every(function(e){return e.width&&e.height});if(p.length>0&&h){var m,y,S,b=Ke(p,v),E=Ue(b,r,i,null!==(m=n.minZoom)&&void 0!==m?m:a,null!==(y=n.maxZoom)&&void 0!==y?y:d,null!==(S=n.padding)&&void 0!==S?S:.1),x=E.x,C=E.y,w=E.zoom,N=l.GS.translate(x,C).scale(w);return"number"===typeof n.duration&&n.duration>0?c.transform(We(u,n.duration),N):c.transform(u,N),!0}}return!1}function _n(e,n){return e.forEach(function(e){var t=n.get(e.id);t&&n.set(t.id,x(x({},t),{},C(C({},oe,t[oe]),"selected",e.selected)))}),new Map(n)}function Ln(e,n){return n.map(function(n){var t=e.find(function(e){return e.id===n.id});return t&&(n.selected=t.selected),n})}function Hn(e){var n=e.changedNodes,t=e.changedEdges,o=e.get,r=e.set,i=o(),a=i.nodeInternals,l=i.edges,d=i.onNodesChange,c=i.onEdgesChange,u=i.hasDefaultNodes,s=i.hasDefaultEdges;null!==n&&void 0!==n&&n.length&&(u&&r({nodeInternals:_n(n,a)}),null===d||void 0===d||d(n)),null!==t&&void 0!==t&&t.length&&(s&&r({edges:Ln(t,l)}),null===c||void 0===c||c(t))}var Yn=function(){},Xn={zoomIn:Yn,zoomOut:Yn,zoomTo:Yn,getZoom:function(){return 1},setViewport:Yn,getViewport:function(){return{x:0,y:0,zoom:1}},fitView:function(){return!1},setCenter:Yn,fitBounds:Yn,project:function(e){return e},screenToFlowPosition:function(e){return e},flowToScreenPosition:function(e){return e},viewportInitialized:!1},Vn=function(e){return{d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}};function Kn(){var e=function(){var e=L(),n=_(Vn,a.x),t=n.d3Zoom,r=n.d3Selection;return(0,o.useMemo)(function(){return r&&t?{zoomIn:function(e){return t.scaleBy(We(r,null===e||void 0===e?void 0:e.duration),1.2)},zoomOut:function(e){return t.scaleBy(We(r,null===e||void 0===e?void 0:e.duration),1/1.2)},zoomTo:function(e,n){return t.scaleTo(We(r,null===n||void 0===n?void 0:n.duration),e)},getZoom:function(){return e.getState().transform[2]},setViewport:function(n,o){var i,a,d,c=m(e.getState().transform,3),u=c[0],s=c[1],f=c[2],v=l.GS.translate(null!==(i=n.x)&&void 0!==i?i:u,null!==(a=n.y)&&void 0!==a?a:s).scale(null!==(d=n.zoom)&&void 0!==d?d:f);t.transform(We(r,null===o||void 0===o?void 0:o.duration),v)},getViewport:function(){var n=m(e.getState().transform,3);return{x:n[0],y:n[1],zoom:n[2]}},fitView:function(n){return Tn(e.getState,n)},setCenter:function(n,o,i){var a=e.getState(),d=a.width,c=a.height,u=a.maxZoom,s="undefined"!==typeof(null===i||void 0===i?void 0:i.zoom)?i.zoom:u,f=d/2-n*s,v=c/2-o*s,g=l.GS.translate(f,v).scale(s);t.transform(We(r,null===i||void 0===i?void 0:i.duration),g)},fitBounds:function(n,o){var i,a=e.getState(),d=a.width,c=a.height,u=a.minZoom,s=a.maxZoom,f=Ue(n,d,c,u,s,null!==(i=null===o||void 0===o?void 0:o.padding)&&void 0!==i?i:.1),v=f.x,g=f.y,p=f.zoom,h=l.GS.translate(v,g).scale(p);t.transform(We(r,null===o||void 0===o?void 0:o.duration),h)},project:function(n){var t=e.getState(),o=t.transform,r=t.snapToGri
1d,i=t.snapGrid;return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Ye(n,o,r,i)},screenToFlowPosition:function(n){var t=e.getState(),o=t.transform,r=t.snapToGrid,i=t.snapGrid,a=t.domNode;if(!a)return n;var l=a.getBoundingClientRect(),d=l.x,c=l.y,u={x:n.x-d,y:n.y-c};return Ye(u,o,r,i)},flowToScreenPosition:function(n){var t=e.getState(),o=t.transform,r=t.domNode;if(!r)return n;var i=r.getBoundingClientRect(),a=i.x,l=i.y,d=Xe(n,o);return{x:d.x+a,y:d.y+l}},viewportInitialized:!0}:Xn},[t,r])}(),n=L(),t=(0,o.useCallback)(function(){return n.getState().getNodes().map(function(e){return x({},e)})},[]),r=(0,o.useCallback)(function(e){return n.getState().nodeInternals.get(e)},[]),i=(0,o.useCallback)(function(){var e=n.getState().edges;return(void 0===e?[]:e).map(function(e){return x({},e)})},[]),d=(0,o.useCallback)(function(e){var t=n.getState().edges;return(void 0===t?[]:t).find(function(n){return n.id===e})},[]),c=(0,o.useCallback)(function(e){var t=n.getState(),o=t.getNodes,r=t.setNodes,i=t.hasDefaultNodes,a=t.onNodesChange,l=o(),d="function"===typeof e?e(l):e;if(i)r(d);else if(a){a(0===d.length?l.map(function(e){return{type:"remove",id:e.id}}):d.map(function(e){return{item:e,type:"reset"}}))}},[]),u=(0,o.useCallback)(function(e){var t=n.getState(),o=t.edges,r=void 0===o?[]:o,i=t.setEdges,a=t.hasDefaultEdges,l=t.onEdgesChange,d="function"===typeof e?e(r):e;if(a)i(d);else if(l){l(0===d.length?r.map(function(e){return{type:"remove",id:e.id}}):d.map(function(e){return{item:e,type:"reset"}}))}},[]),s=(0,o.useCallback)(function(e){var t=Array.isArray(e)?e:[e],o=n.getState(),r=o.getNodes,i=o.setNodes,a=o.hasDefaultNodes,l=o.onNodesChange;if(a){var d=r();i([].concat(y(d),y(t)))}else if(l){l(t.map(function(e){return{item:e,type:"add"}}))}},[]),f=(0,o.useCallback)(function(e){var t=Array.isArray(e)?e:[e],o=n.getState(),r=o.edges,i=void 0===r?[]:r,a=o.setEdges,l=o.hasDefaultEdges,d=o.onEdgesChange;if(l)a([].concat(y(i),y(t)));else if(d){d(t.map(function(e){return{item:e,type:"add"}}))}},[]),v=(0,o.useCallback)(function(){var e=n.getState(),t=e.getNodes,o=e.edges,r=void 0===o?[]:o,i=m(e.transform,3),a=i[0],l=i[1],d=i[2];return{nodes:t().map(function(e){return x({},e)}),edges:r.map(function(e){return x({},e)}),viewport:{x:a,y:l,zoom:d}}},[]),g=(0,o.useCallback)(function(e){var t=e.nodes,o=e.edges,r=n.getState(),i=r.nodeInternals,a=r.getNodes,l=r.edges,d=r.hasDefaultNodes,c=r.hasDefaultEdges,u=r.onNodesDelete,s=r.onEdgesDelete,f=r.onNodesChange,v=r.onEdgesChange,g=(t||[]).map(function(e){return e.id}),p=(o||[]).map(function(e){return e.id}),h=a().reduce(function(e,n){var t=!g.includes(n.id)&&n.parentNode&&e.find(function(e){return e.id===n.parentNode});return("boolean"!==typeof n.deletable||n.deletable)&&(g.includes(n.id)||t)&&e.push(n),e},[]),m=l.filter(function(e){return"boolean"!==typeof e.deletable||e.deletable}),S=m.filter(function(e){return p.includes(e.id)});if(h||S){var b=Fe(h,m),E=[].concat(y(S),y(b)),x=E.reduce(function(e,n){return e.includes(n.id)||e.push(n.id),e},[]);if((c||d)&&(c&&n.setState({edges:l.filter(function(e){return!x.includes(e.id)})}),d&&(h.forEach(function(e){i.delete(e.id)}),n.setState({nodeInternals:new Map(i)}))),x.length>0&&(null===s||void 0===s||s(E),v&&v(x.map(function(e){return{id:e,type:"remove"}}))),h.length>0)if(null===u||void 0===u||u(h),f)f(h.map(function(e){return{id:e.id,type:"remove"}}))}},[]),p=(0,o.useCallback)(function(e){var t,o=te((t=e).width)&&te(t.height)&&te(t.x)&&te(t.y),r=o?null:n.getState().nodeInternals.get(e.id);return o||r?[o?e:$(r),r,o]:[null,null,o]},[]),h=(0,o.useCallback)(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2?arguments[2]:void 0,r=m(p(e),3),i=r[0],a=r[1],l=r[2];return i?(o||n.getState().getNodes()).filter(function(e){if(!l&&(e.id===a.id||!e.positionAbsolute))return!1;var n=$(e),o=ne(n,i);return t&&o>0||o>=i.width*i.height}):[]},[]),S=(0,o.useCallback)(function(e,n){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=m(p(e),1)[0];if(!o)return!1;var r=ne(o,n);return t&&r>0||r>=o.width*o.height},[]);return(0,o.useMemo)(function(){return x(x({},e),{},{getNodes:t,getNode:r,getEdges:i,getEdge:d,setNodes:c,setEdges:u,addNodes:s,addEdges:f,toObject:v,deleteElements:g,getIntersectingNodes:h,isNodeIntersecting:S})},[e,t,r,i,d,c,u,s,f,v,g,h,S])}var Zn={actInsideInputWithModifier:!1};var Fn={position:"absolute",width:"100%",height:"100%",top:0,left:0},Un=function(e){return{x:e.x,y:e.y,zoom:e.k}},Wn=function(e,n){return e.target.closest(".".concat(n))},jn=function(e,n){return 2===n&&Array.isArray(e)&&e.includes(2)},Gn=function(e){var n=e.ctrlKey&&ce()?10:1;
1return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*n},qn=function(e){return{d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}},Qn=function(e){var n=e.onMove,t=e.onMoveStart,r=e.onMoveEnd,i=e.onPaneContextMenu,u=e.zoomOnScroll,s=void 0===u||u,f=e.zoomOnPinch,v=void 0===f||f,g=e.panOnScroll,p=void 0!==g&&g,h=e.panOnScrollSpeed,m=void 0===h?.5:h,y=e.panOnScrollMode,S=void 0===y?fe.Free:y,b=e.zoomOnDoubleClick,E=void 0===b||b,x=e.elementsSelectable,C=e.panOnDrag,w=void 0===C||C,N=e.defaultViewport,M=e.translateExtent,P=e.minZoom,k=e.maxZoom,D=e.zoomActivationKeyCode,I=e.preventScrolling,A=void 0===I||I,R=e.children,B=e.noWheelClassName,z=e.noPanClassName,T=(0,o.useRef)(),H=L(),Y=(0,o.useRef)(!1),X=(0,o.useRef)(!1),V=(0,o.useRef)(null),K=(0,o.useRef)({x:0,y:0,zoom:0}),U=_(qn,a.x),W=U.d3Zoom,j=U.d3Selection,G=U.d3ZoomHandler,q=U.userSelectionActive,Q=Dn(D),J=(0,o.useRef)(0),$=(0,o.useRef)(!1),ee=(0,o.useRef)();return function(e){var n=L();(0,o.useEffect)(function(){var t,o=function(){if(e.current){var t,o,r=Z(e.current);0!==r.height&&0!==r.width||null===(t=(o=n.getState()).onError)||void 0===t||t.call(o,"004",O()),n.setState({width:r.width||500,height:r.height||500})}};return o(),window.addEventListener("resize",o),e.current&&(t=new ResizeObserver(function(){return o()})).observe(e.current),function(){window.removeEventListener("resize",o),t&&e.current&&t.unobserve(e.current)}},[])}(V),(0,o.useEffect)(function(){if(V.current){var e=V.current.getBoundingClientRect(),n=(0,l.s_)().scaleExtent([P,k]).translateExtent(M),t=(0,c.A)(V.current).call(n),o=l.GS.translate(N.x,N.y).scale(F(N.zoom,P,k)),r=[[0,0],[e.width,e.height]],i=n.constrain()(o,r,M);n.transform(t,i),n.wheelDelta(Gn),H.setState({d3Zoom:n,d3Selection:t,d3ZoomHandler:t.on("wheel.zoom"),transform:[i.x,i.y,i.k],domNode:V.current.closest(".react-flow")})}},[]),(0,o.useEffect)(function(){j&&W&&(!p||Q||q?"undefined"!==typeof G&&j.on("wheel.zoom",function(e,n){if(!A||Wn(e,B))return null;e.preventDefault(),G.call(this,e,n)},{passive:!1}):j.on("wheel.zoom",function(e){if(Wn(e,B))return!1;e.preventDefault(),e.stopImmediatePropagation();var o=j.property("__zoom").k||1,i=ce();if(e.ctrlKey&&v&&i){var a=(0,d.A)(e),l=Gn(e),c=o*Math.pow(2,l);W.scaleTo(j,c,a,e)}else{var u=1===e.deltaMode?20:1,s=S===fe.Vertical?0:e.deltaX*u,f=S===fe.Horizontal?0:e.deltaY*u;!i&&e.shiftKey&&S!==fe.Vertical&&(s=e.deltaY*u,f=0),W.translateBy(j,-s/o*m,-f/o*m,{internal:!0});var g=Un(j.property("__zoom")),p=H.getState(),h=p.onViewportChangeStart,y=p.onViewportChange,b=p.onViewportChangeEnd;clearTimeout(ee.current),$.current||($.current=!0,null===t||void 0===t||t(e,g),null===h||void 0===h||h(g)),$.current&&(null===n||void 0===n||n(e,g),null===y||void 0===y||y(g),ee.current=setTimeout(function(){null===r||void 0===r||r(e,g),null===b||void 0===b||b(g),$.current=!1},150))}},{passive:!1}))},[q,p,S,j,W,G,Q,v,A,B,t,n,r]),(0,o.useEffect)(function(){W&&W.on("start",function(e){var n,o;if(!e.sourceEvent||e.sourceEvent.internal)return null;J.current=null===(n=e.sourceEvent)||void 0===n?void 0:n.button;var r=H.getState().onViewportChangeStart,i=Un(e.transform);Y.current=!0,K.current=i,"mousedown"===(null===(o=e.sourceEvent)||void 0===o?void 0:o.type)&&H.setState({paneDragging:!0}),null===r||void 0===r||r(i),null===t||void 0===t||t(e.sourceEvent,i)})},[W,t]),(0,o.useEffect)(function(){W&&(q&&!Y.current?W.on("zoom",null):q||W.on("zoom",function(e){var t,o,r=H.getState().onViewportChange;if(H.setState({transform:[e.transform.x,e.transform.y,e.transform.k]}),X.current=!(!i||!jn(w,null!==(t=J.current)&&void 0!==t?t:0)),(n||r)&&(null===(o=e.sourceEvent)||void 0===o||!o.internal)){var a=Un(e.transform);null===r||void 0===r||r(a),null===n||void 0===n||n(e.sourceEvent,a)}}))},[q,W,n,w,i]),(0,o.useEffect)(function(){W&&W.on("end",function(e){var n;if(!e.sourceEvent||e.sourceEvent.internal)return null;var t,o,a=H.getState().onViewportChangeEnd;if(Y.current=!1,H.setState({paneDragging:!1}),i&&jn(w,null!==(n=J.current)&&void 0!==n?n:0)&&!X.current&&i(e.sourceEvent),X.current=!1,(r||a)&&(t=K.current,o=e.transform,t.x!==o.x||t.y!==o.y||t.zoom!==o.k)){var l=Un(e.transform);K.current=l,clearTimeout(T.current),T.current=setTimeout(function(){null===a||void 0===a||a(l),null===r||void 0===r||r(e.sourceEvent,l)},p?150:0)}})},[W,p,w,r,i]),(0,o.useEffect)(function(){W&&W.filter(function(e){var n=Q||s,t=v&&e.ctrlKey;if((!0===w||Array.isArray(w)&&w.includes(1))&&1===e.button&&"mousedown"===e.type&&(Wn(e,"react-flow__node")||Wn(e,"react-flow__edge")))return!0;
1if(!w&&!n&&!p&&!E&&!v)return!1;if(q)return!1;if(!E&&"dblclick"===e.type)return!1;if(Wn(e,B)&&"wheel"===e.type)return!1;if(Wn(e,z)&&("wheel"!==e.type||p&&"wheel"===e.type&&!Q))return!1;if(!v&&e.ctrlKey&&"wheel"===e.type)return!1;if(!n&&!p&&!t&&"wheel"===e.type)return!1;if(!w&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(w)&&!w.includes(e.button)&&("mousedown"===e.type||"touchstart"===e.type))return!1;var o=Array.isArray(w)&&w.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&o})},[q,W,s,v,p,E,w,x,Q]),o.createElement("div",{className:"react-flow__renderer",ref:V,style:Fn},R)},Jn=function(e){return{userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect}};function $n(){var e=_(Jn,a.x),n=e.userSelectionActive,t=e.userSelectionRect;return n&&t?o.createElement("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}function et(e,n){var t=e.find(function(e){return e.id===n.parentNode});if(t){var o=n.position.x+n.width-t.width,r=n.position.y+n.height-t.height;if(o>0||r>0||n.position.x<0||n.position.y<0){var i,a;if(t.style=x({},t.style)||{},t.style.width=null!==(i=t.style.width)&&void 0!==i?i:t.width,t.style.height=null!==(a=t.style.height)&&void 0!==a?a:t.height,o>0&&(t.style.width+=o),r>0&&(t.style.height+=r),n.position.x<0){var l=Math.abs(n.position.x);t.position.x=t.position.x-l,t.style.width+=l,n.position.x=0}if(n.position.y<0){var d=Math.abs(n.position.y);t.position.y=t.position.y-d,t.style.height+=d,n.position.y=0}t.width=t.style.width,t.height=t.style.height}}}function nt(e,n){if(e.some(function(e){return"reset"===e.type}))return e.filter(function(e){return"reset"===e.type}).map(function(e){return e.item});var t=e.filter(function(e){return"add"===e.type}).map(function(e){return e.item});return n.reduce(function(n,t){var o=e.filter(function(e){return e.id===t.id});if(0===o.length)return n.push(t),n;var r,i=x({},t),a=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=S(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}(o);try{for(a.s();!(r=a.n()).done;){var l=r.value;if(l)switch(l.type){case"select":i.selected=l.selected;break;case"position":"undefined"!==typeof l.position&&(i.position=l.position),"undefined"!==typeof l.positionAbsolute&&(i.positionAbsolute=l.positionAbsolute),"undefined"!==typeof l.dragging&&(i.dragging=l.dragging),i.expandParent&&et(n,i);break;case"dimensions":"undefined"!==typeof l.dimensions&&(i.width=l.dimensions.width,i.height=l.dimensions.height),"undefined"!==typeof l.updateStyle&&(i.style=x(x({},i.style||{}),l.dimensions)),"boolean"===typeof l.resizing&&(i.resizing=l.resizing),i.expandParent&&et(n,i);break;case"remove":return n}}}catch(e){a.e(e)}finally{a.f()}return n.push(i),n},t)}function tt(e,n){return nt(e,n)}var ot=function(e,n){return{id:e,type:"select",selected:n}};function rt(e,n){return e.reduce(function(e,t){var o=n.includes(t.id);return!t.selected&&o?(t.selected=!0,e.push(ot(t.id,!0))):t.selected&&!o&&(t.selected=!1,e.push(ot(t.id,!1))),e},[])}var it=function(e,n){return function(t){t.target===n.current&&(null===e||void 0===e||e(t))}},at=function(e){return{userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}},lt=(0,o.memo)(function(e){var n=e.isSelecting,t=e.selectionMode,i=void 0===t?ve.Full:t,l=e.panOnDrag,d=e.onSelectionStart,c=e.onSelectionEnd,u=e.onPaneClick,s=e.onPaneContextMenu,f=e.onPaneScroll,v=e.onPaneMouseEnter,g=e.onPaneMouseMove,p=e.onPaneMouseLeave,h=e.children,m=(0,o.useRef)(null),y=L(),S=(0,o.useRef)(0),b=(0,o.useRef)(0),E=(0,o.useRef)(),C=_(at,a.x),w=C.userSelectionActive,N=C.elementsSelectable,M=C.dragging,P=function(){y.setState({userSelectionActive:!1,userSelectionRect:null}),S.current=0,b.current=0},O=function(e){null===u||void 0===u||u(e),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},k=f?function(e){return f(e)}:void 0,D=N&&(n||w);return o.createElement("div",{className:(0,r.A)(["react-flow__pane",{dragging:
1M,selection:n}]),onClick:D?void 0:it(O,m),onContextMenu:it(function(e){Array.isArray(l)&&null!==l&&void 0!==l&&l.includes(2)?e.preventDefault():null===s||void 0===s||s(e)},m),onWheel:it(k,m),onMouseEnter:D?void 0:v,onMouseDown:D?function(e){var t=y.getState(),o=t.resetSelectedElements,r=t.domNode;if(E.current=null===r||void 0===r?void 0:r.getBoundingClientRect(),N&&n&&0===e.button&&e.target===m.current&&E.current){var i=de(e,E.current),a=i.x,l=i.y;o(),y.setState({userSelectionRect:{width:0,height:0,startX:a,startY:l,x:a,y:l}}),null===d||void 0===d||d(e)}}:void 0,onMouseMove:D?function(e){var t,o,r=y.getState(),a=r.userSelectionRect,l=r.nodeInternals,d=r.edges,c=r.transform,u=r.onNodesChange,s=r.onEdgesChange,f=r.nodeOrigin,v=r.getNodes;if(n&&E.current&&a){y.setState({userSelectionActive:!0,nodesSelectionActive:!1});var g=de(e,E.current),p=null!==(t=a.startX)&&void 0!==t?t:0,h=null!==(o=a.startY)&&void 0!==o?o:0,m=x(x({},a),{},{x:g.x<p?g.x:p,y:g.y<h?g.y:h,width:Math.abs(g.x-p),height:Math.abs(g.y-h)}),C=v(),w=Ze(l,m,c,i===ve.Partial,!0,f),N=Fe(w,d).map(function(e){return e.id}),M=w.map(function(e){return e.id});if(S.current!==M.length){S.current=M.length;var P=rt(C,M);P.length&&(null===u||void 0===u||u(P))}if(b.current!==N.length){b.current=N.length;var O=rt(d,N);O.length&&(null===s||void 0===s||s(O))}y.setState({userSelectionRect:m})}}:g,onMouseUp:D?function(e){if(0===e.button){var n=y.getState().userSelectionRect;!w&&n&&e.target===m.current&&(null===O||void 0===O||O(e)),y.setState({nodesSelectionActive:S.current>0}),P(),null===c||void 0===c||c(e)}}:void 0,onMouseLeave:D?function(e){w&&(y.setState({nodesSelectionActive:S.current>0}),null===c||void 0===c||c(e)),P()}:p,ref:m,style:Fn},h,o.createElement($n,null))});function dt(e,n){if(!e.parentNode)return!1;var t=n.get(e.parentNode);return!!t&&(!!t.selected||dt(t,n))}function ct(e,n,t){var o=e;do{var r;if(null!==(r=o)&&void 0!==r&&r.matches(n))return!0;if(o===t.current)return!1;o=o.parentElement}while(o);return!1}function ut(e,n,t,o){return Array.from(e.values()).filter(function(t){return(t.selected||t.id===o)&&(!t.parentNode||!dt(t,e))&&(t.draggable||n&&"undefined"===typeof t.draggable)}).map(function(e){var n,o,r,i;return{id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:t.x-(null!==(n=null===(o=e.positionAbsolute)||void 0===o?void 0:o.x)&&void 0!==n?n:0),y:t.y-(null!==(r=null===(i=e.positionAbsolute)||void 0===i?void 0:i.y)&&void 0!==r?r:0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode,width:e.width,height:e.height,expandParent:e.expandParent}})}function st(e,n,t,o){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[0,0],i=arguments.length>5?arguments[5]:void 0,a=function(e,n){return n&&"parent"!==n?[n[0],[n[1][0]-(e.width||0),n[1][1]-(e.height||0)]]:n}(e,e.extent||o),l=a;if("parent"!==e.extent||e.expandParent){if(e.extent&&e.parentNode&&"parent"!==e.extent){var d=t.get(e.parentNode),c=Ve(d,r).positionAbsolute,u=c.x,s=c.y;l=[[e.extent[0][0]+u,e.extent[0][1]+s],[e.extent[1][0]+u,e.extent[1][1]+s]]}}else if(e.parentNode&&e.width&&e.height){var f=t.get(e.parentNode),v=Ve(f,r).positionAbsolute,g=v.x,p=v.y;l=f&&te(g)&&te(p)&&te(f.width)&&te(f.height)?[[g+e.width*r[0],p+e.height*r[1]],[g+f.width-e.width+e.width*r[0],p+f.height-e.height+e.height*r[1]]]:l}else null===i||void 0===i||i("005",k()),l=a;var h={x:0,y:0};if(e.parentNode){var m=t.get(e.parentNode);h=Ve(m,r).positionAbsolute}var y=l&&"parent"!==l?U(n,l):n;return{position:{x:y.x-h.x,y:y.y-h.y},positionAbsolute:y}}function ft(e){var n=e.nodeId,t=e.dragItems,o=e.nodeInternals,r=t.map(function(e){return x(x({},o.get(e.id)),{},{position:e.position,positionAbsolute:e.positionAbsolute})});return[n?r.find(function(e){return e.id===n}):r[0],r]}lt.displayName="Pane";var vt=function(e,n,t,o){var r=n.querySelectorAll(e);if(!r||!r.length)return null;var i=Array.from(r),a=n.getBoundingClientRect(),l=a.width*o[0],d=a.height*o[1];return i.map(function(e){var n=e.getBoundingClientRect();return x({id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(n.left-a.left-l)/t,y:(n.top-a.top-d)/t},Z(e))})};function gt(e,n,t){return void 0===t?t:function(o){var r=n().nodeInternals.get(e);r&&t(o,x({},r))}}function pt(e){var n=e.id,t=e.store,o=e.unselect,r=void 0!==o&&o,i=e.nodeRef,a=t.getState(),l=a.addSelectedNodes,d=a.unselectNodesAndEdges,c=a.multiSelectionActive,u=a.nodeInternals,s=a.onError,f=u.get(n);f?(t.setState({nodesSelectionActive:!1}
1),f.selected?(r||f.selected&&c)&&(d({nodes:[f],edges:[]}),requestAnimationFrame(function(){var e;return null===i||void 0===i||null===(e=i.current)||void 0===e?void 0:e.blur()})):l([n])):null===s||void 0===s||s("012",z(n))}function ht(e){return function(n,t,o){return null===e||void 0===e?void 0:e(n,o)}}function mt(e){var n=e.nodeRef,t=e.disabled,r=void 0!==t&&t,i=e.noDragClassName,a=e.handleSelector,l=e.nodeId,d=e.isSelectable,s=e.selectNodesOnDrag,f=L(),v=m((0,o.useState)(!1),2),g=v[0],p=v[1],h=(0,o.useRef)([]),y=(0,o.useRef)({x:null,y:null}),S=(0,o.useRef)(0),b=(0,o.useRef)(null),E=(0,o.useRef)({x:0,y:0}),C=(0,o.useRef)(null),w=(0,o.useRef)(!1),N=(0,o.useRef)(!1),M=function(){var e=L();return(0,o.useCallback)(function(n){var t=n.sourceEvent,o=e.getState(),r=o.transform,i=o.snapGrid,a=o.snapToGrid,l=t.touches?t.touches[0].clientX:t.clientX,d=t.touches?t.touches[0].clientY:t.clientY,c={x:(l-r[0])/r[2],y:(d-r[1])/r[2]};return x({xSnapped:a?i[0]*Math.round(c.x/i[0]):c.x,ySnapped:a?i[1]*Math.round(c.y/i[1]):c.y},c)},[])}();return(0,o.useEffect)(function(){if(null!==n&&void 0!==n&&n.current){var e=(0,c.A)(n.current),t=function(e){var n=e.x,t=e.y,o=f.getState(),r=o.nodeInternals,i=o.onNodeDrag,a=o.onSelectionDrag,d=o.updateNodePositions,c=o.nodeExtent,u=o.snapGrid,s=o.snapToGrid,v=o.nodeOrigin,g=o.onError;y.current={x:n,y:t};var S=!1,b={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&c){var E=Ke(h.current,v);b=Q(E)}if(h.current=h.current.map(function(e){var o={x:n-e.distance.x,y:t-e.distance.y};s&&(o.x=u[0]*Math.round(o.x/u[0]),o.y=u[1]*Math.round(o.y/u[1]));var i,a,l=[[c[0][0],c[0][1]],[c[1][0],c[1][1]]];h.current.length>1&&c&&!e.extent&&(l[0][0]=e.positionAbsolute.x-b.x+c[0][0],l[1][0]=e.positionAbsolute.x+(null!==(i=e.width)&&void 0!==i?i:0)-b.x2+c[1][0],l[0][1]=e.positionAbsolute.y-b.y+c[0][1],l[1][1]=e.positionAbsolute.y+(null!==(a=e.height)&&void 0!==a?a:0)-b.y2+c[1][1]);var d=st(e,o,r,l,v,g);return S=S||e.position.x!==d.position.x||e.position.y!==d.position.y,e.position=d.position,e.positionAbsolute=d.positionAbsolute,e}),S){d(h.current,!0,!0),p(!0);var x=l?i:ht(a);if(x&&C.current){var w=m(ft({nodeId:l,dragItems:h.current,nodeInternals:r}),2),N=w[0],M=w[1];x(C.current,N,M)}}},o=function(){if(b.current){var e=m(j(E.current,b.current),2),n=e[0],r=e[1];if(0!==n||0!==r){var i,a,l=f.getState(),d=l.transform,c=l.panBy;y.current.x=(null!==(i=y.current.x)&&void 0!==i?i:0)-n/d[2],y.current.y=(null!==(a=y.current.y)&&void 0!==a?a:0)-r/d[2],c({x:n,y:r})&&t(y.current)}S.current=requestAnimationFrame(o)}},v=function(e){var t=f.getState(),o=t.nodeInternals,r=t.multiSelectionActive,i=t.nodesDraggable,a=t.unselectNodesAndEdges,c=t.onNodeDragStart,u=t.onSelectionDragStart;N.current=!0;var v,g=l?c:ht(u);s&&d||r||!l||(null!==(v=o.get(l))&&void 0!==v&&v.selected||a());l&&d&&s&&pt({id:l,store:f,nodeRef:n});var p=M(e);if(y.current=p,h.current=ut(o,i,p,l),g&&h.current){var S=m(ft({nodeId:l,dragItems:h.current,nodeInternals:o}),2),b=S[0],E=S[1];g(e.sourceEvent,b,E)}};if(!r){var g=(0,u.A)().on("start",function(e){var n=f.getState(),t=n.domNode;0===n.nodeDragThreshold&&v(e);var o=M(e);y.current=o,b.current=(null===t||void 0===t?void 0:t.getBoundingClientRect())||null,E.current=de(e.sourceEvent,b.current)}).on("drag",function(e){var n=M(e),r=f.getState(),i=r.autoPanOnNodeDrag,a=r.nodeDragThreshold;if(!w.current&&N.current&&i&&(w.current=!0,o()),!N.current){var l,d,c,u,s=n.xSnapped-(null!==(l=null===y||void 0===y||null===(d=y.current)||void 0===d?void 0:d.x)&&void 0!==l?l:0),g=n.ySnapped-(null!==(c=null===y||void 0===y||null===(u=y.current)||void 0===u?void 0:u.y)&&void 0!==c?c:0);Math.sqrt(s*s+g*g)>a&&v(e)}(y.current.x!==n.xSnapped||y.current.y!==n.ySnapped)&&h.current&&N.current&&(C.current=e.sourceEvent,E.current=de(e.sourceEvent,b.current),t(n))}).on("end",function(e){if(N.current&&(p(!1),w.current=!1,N.current=!1,cancelAnimationFrame(S.current),h.current)){var n=f.getState(),t=n.updateNodePositions,o=n.nodeInternals,r=n.onNodeDragStop,i=n.onSelectionDragStop,a=l?r:ht(i);if(t(h.current,!1,!1),a){var d=m(ft({nodeId:l,dragItems:h.current,nodeInternals:o}),2),c=d[0],u=d[1];a(e.sourceEvent,c,u)}}}).filter(function(e){var t=e.target;return!e.button&&(!i||!ct(t,".".concat(i),n))&&(!a||ct(t,a,n))});return e.call(g),function(){e.on(".drag",null)}}e.on(".drag",null)}},[n,r,i,a,d,f,l,s,M]),g}function yt(){var e=L();return(0,o.useCallback)(function(n){var t=e.getState(),o=t.nodeInternals,r=t.no
1deExtent,i=t.updateNodePositions,a=t.getNodes,l=t.snapToGrid,d=t.snapGrid,c=t.onError,u=t.nodesDraggable,s=a().filter(function(e){return e.selected&&(e.draggable||u&&"undefined"===typeof e.draggable)}),f=l?d[0]:5,v=l?d[1]:5,g=n.isShiftPressed?4:1,p=n.x*f*g,h=n.y*v*g;i(s.map(function(e){if(e.positionAbsolute){var n={x:e.positionAbsolute.x+p,y:e.positionAbsolute.y+h};l&&(n.x=d[0]*Math.round(n.x/d[0]),n.y=d[1]*Math.round(n.y/d[1]));var t=st(e,n,o,r,void 0,c),i=t.positionAbsolute,a=t.position;e.position=a,e.positionAbsolute=i}return e}),!0,!1)},[])}var St={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},bt=function(e){var n=function(n){var t=n.id,i=n.type,a=n.data,l=n.xPos,d=n.yPos,c=n.xPosOrigin,u=n.yPosOrigin,s=n.selected,f=n.onClick,v=n.onMouseEnter,g=n.onMouseMove,p=n.onMouseLeave,h=n.onContextMenu,m=n.onDoubleClick,y=n.style,S=n.className,b=n.isDraggable,E=n.isSelectable,w=n.isConnectable,N=n.isFocusable,M=n.selectNodesOnDrag,P=n.sourcePosition,O=n.targetPosition,k=n.hidden,D=n.resizeObserver,I=n.dragHandle,A=n.zIndex,R=n.isParent,B=n.noDragClassName,z=n.noPanClassName,T=n.initialized,_=n.disableKeyboardA11y,H=n.ariaLabel,Y=n.rfId,X=n.hasHandleBounds,V=L(),K=(0,o.useRef)(null),Z=(0,o.useRef)(P),F=(0,o.useRef)(O),U=(0,o.useRef)(i),W=E||b||f||v||g||p,j=yt(),G=gt(t,V.getState,v),q=gt(t,V.getState,g),Q=gt(t,V.getState,p),J=gt(t,V.getState,h),$=gt(t,V.getState,m);(0,o.useEffect)(function(){return function(){K.current&&(null===D||void 0===D||D.unobserve(K.current))}},[]),(0,o.useEffect)(function(){if(K.current&&!k){var e=K.current;T&&X||(null===D||void 0===D||D.unobserve(e),null===D||void 0===D||D.observe(e))}},[k,T,X]),(0,o.useEffect)(function(){var e=U.current!==i,n=Z.current!==P,o=F.current!==O;K.current&&(e||n||o)&&(e&&(U.current=i),n&&(Z.current=P),o&&(F.current=O),V.getState().updateNodeDimensions([{id:t,nodeElement:K.current,forceUpdate:!0}]))},[t,i,P,O]);var ee=mt({nodeRef:K,disabled:k||!b,noDragClassName:B,handleSelector:I,nodeId:t,isSelectable:E,selectNodesOnDrag:M});return k?null:o.createElement("div",{className:(0,r.A)(["react-flow__node","react-flow__node-".concat(i),C({},z,b),S,{selected:s,selectable:E,parent:R,dragging:ee}]),ref:K,style:x({zIndex:A,transform:"translate(".concat(c,"px,").concat(u,"px)"),pointerEvents:W?"all":"none",visibility:T?"visible":"hidden"},y),"data-id":t,"data-testid":"rf__node-".concat(t),onMouseEnter:G,onMouseMove:q,onMouseLeave:Q,onContextMenu:J,onClick:function(e){var n=V.getState().nodeDragThreshold;if(E&&(!M||!b||n>0)&&pt({id:t,store:V,nodeRef:K}),f){var o=V.getState().nodeInternals.get(t);o&&f(e,x({},o))}},onDoubleClick:$,onKeyDown:N?function(e){if(!ae(e))if(re.includes(e.key)&&E){var n="Escape"===e.key;pt({id:t,store:V,unselect:n,nodeRef:K})}else!_&&b&&s&&Object.prototype.hasOwnProperty.call(St,e.key)&&(V.setState({ariaLiveMessage:"Moved selected node ".concat(e.key.replace("Arrow","").toLowerCase(),". New position, x: ").concat(~~l,", y: ").concat(~~d)}),j({x:St[e.key].x,y:St[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:N?0:void 0,role:N?"button":void 0,"aria-describedby":_?void 0:"".concat(Nn,"-").concat(Y),"aria-label":H},o.createElement(Te,{value:t},o.createElement(e,{id:t,data:a,type:i,xPos:l,yPos:d,selected:s,isConnectable:w,sourcePosition:P,targetPosition:O,dragging:ee,dragHandle:I,zIndex:A})))};return n.displayName="NodeWrapper",(0,o.memo)(n)},Et=function(e){var n=e.getNodes().filter(function(e){return e.selected});return x(x({},Ke(n,e.nodeOrigin)),{},{transformString:"translate(".concat(e.transform[0],"px,").concat(e.transform[1],"px) scale(").concat(e.transform[2],")"),userSelectionActive:e.userSelectionActive})};function xt(e){var n=e.onSelectionContextMenu,t=e.noPanClassName,i=e.disableKeyboardA11y,l=L(),d=_(Et,a.x),c=d.width,u=d.height,s=d.x,f=d.y,v=d.transformString,g=d.userSelectionActive,p=yt(),h=(0,o.useRef)(null);if((0,o.useEffect)(function(){var e;i||(null===(e=h.current)||void 0===e||e.focus({preventScroll:!0}))},[i]),mt({nodeRef:h}),g||!c||!u)return null;var m=n?function(e){var t=l.getState().getNodes().filter(function(e){return e.selected});n(e,t)}:void 0;return o.createElement("div",{className:(0,r.A)(["react-flow__nodesselection","react-flow__container",t]),style:{transform:v}},o.createElement("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:i?void 0:-1,onKeyDown:i?void 0:function(e){Object.prototype.hasOwnProperty.call(St,e.key)&&p({x:St[e.key].x,y:St[e.key].y,isShiftPressed:e.shiftKey})},style:{width:c,height:u,top:f,left:s}}))}
1var Ct=(0,o.memo)(xt),wt=function(e){return e.nodesSelectionActive},Nt=function(e){var n=e.children,t=e.onPaneClick,r=e.onPaneMouseEnter,i=e.onPaneMouseMove,a=e.onPaneMouseLeave,l=e.onPaneContextMenu,d=e.onPaneScroll,c=e.deleteKeyCode,u=e.onMove,s=e.onMoveStart,f=e.onMoveEnd,v=e.selectionKeyCode,g=e.selectionOnDrag,p=e.selectionMode,h=e.onSelectionStart,m=e.onSelectionEnd,y=e.multiSelectionKeyCode,S=e.panActivationKeyCode,b=e.zoomActivationKeyCode,E=e.elementsSelectable,x=e.zoomOnScroll,C=e.zoomOnPinch,w=e.panOnScroll,N=e.panOnScrollSpeed,M=e.panOnScrollMode,P=e.zoomOnDoubleClick,O=e.panOnDrag,k=e.defaultViewport,D=e.translateExtent,I=e.minZoom,A=e.maxZoom,R=e.preventScrolling,B=e.onSelectionContextMenu,z=e.noWheelClassName,T=e.noPanClassName,H=e.disableKeyboardA11y,Y=_(wt),X=Dn(v),V=Dn(S),K=V||O,Z=V||w,F=X||g&&!0!==K;return function(e){var n=e.deleteKeyCode,t=e.multiSelectionKeyCode,r=L(),i=Kn().deleteElements,a=Dn(n,Zn),l=Dn(t);(0,o.useEffect)(function(){if(a){var e=r.getState(),n=e.edges,t=(0,e.getNodes)().filter(function(e){return e.selected}),o=n.filter(function(e){return e.selected});i({nodes:t,edges:o}),r.setState({nodesSelectionActive:!1})}},[a]),(0,o.useEffect)(function(){r.setState({multiSelectionActive:l})},[l])}({deleteKeyCode:c,multiSelectionKeyCode:y}),o.createElement(Qn,{onMove:u,onMoveStart:s,onMoveEnd:f,onPaneContextMenu:l,elementsSelectable:E,zoomOnScroll:x,zoomOnPinch:C,panOnScroll:Z,panOnScrollSpeed:N,panOnScrollMode:M,zoomOnDoubleClick:P,panOnDrag:!X&&K,defaultViewport:k,translateExtent:D,minZoom:I,maxZoom:A,zoomActivationKeyCode:b,preventScrolling:R,noWheelClassName:z,noPanClassName:T},o.createElement(lt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:i,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:d,panOnDrag:K,isSelecting:!!F,selectionMode:p},n,Y&&o.createElement(Ct,{onSelectionContextMenu:B,noPanClassName:T,disableKeyboardA11y:H})))};Nt.displayName="FlowRenderer";var Mt=(0,o.memo)(Nt);function Pt(e){var n={input:bt(e.input||cn),default:bt(e.default||ln),output:bt(e.output||sn),group:bt(e.group||fn)},t=Object.keys(e).filter(function(e){return!["input","default","output","group"].includes(e)}).reduce(function(n,t){return n[t]=bt(e[t]||ln),n},{});return x(x({},n),t)}var Ot=function(e){return{nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}},kt=function(e){var n,t=_(Ot,a.x),r=t.nodesDraggable,i=t.nodesConnectable,l=t.nodesFocusable,d=t.elementsSelectable,c=t.updateNodeDimensions,u=t.onError,s=(n=e.onlyRenderVisibleElements,_((0,o.useCallback)(function(e){return n?Ze(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes()},[n]))),f=(0,o.useRef)(),v=(0,o.useMemo)(function(){if("undefined"===typeof ResizeObserver)return null;var e=new ResizeObserver(function(e){var n=e.map(function(e){return{id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0}});c(n)});return f.current=e,e},[]);return(0,o.useEffect)(function(){return function(){var e;null===f||void 0===f||null===(e=f.current)||void 0===e||e.disconnect()}},[]),o.createElement("div",{className:"react-flow__nodes",style:Fn},s.map(function(n){var t,a,c,s,f,g,p,h,m=n.type||"default";e.nodeTypes[m]||(null===u||void 0===u||u("003",P(m)),m="default");var y,S,b,E,x,C,w=e.nodeTypes[m]||e.nodeTypes.default,N=!!(n.draggable||r&&"undefined"===typeof n.draggable),M=!!(n.selectable||d&&"undefined"===typeof n.selectable),O=!!(n.connectable||i&&"undefined"===typeof n.connectable),k=!!(n.focusable||l&&"undefined"===typeof n.focusable),D=e.nodeExtent?U(n.positionAbsolute,e.nodeExtent):n.positionAbsolute,I=null!==(t=null===D||void 0===D?void 0:D.x)&&void 0!==t?t:0,A=null!==(a=null===D||void 0===D?void 0:D.y)&&void 0!==a?a:0,R=(y={x:I,y:A,width:null!==(c=n.width)&&void 0!==c?c:0,height:null!==(s=n.height)&&void 0!==s?s:0,origin:e.nodeOrigin},S=y.x,b=y.y,E=y.width,x=y.height,C=y.origin,E&&x?C[0]<0||C[1]<0||C[0]>1||C[1]>1?{x:S,y:b}:{x:S-E*C[0],y:b-x*C[1]}:{x:S,y:b});return o.createElement(w,{key:n.id,id:n.id,className:n.className,style:n.style,type:m,data:n.data,sourcePosition:n.sourcePosition||he.Bottom,targetPosition:n.targetPosition||he.Top,hidden:n.hidden,xPos:I,yPos:A,xPosOrigin:R.x,yPosOrigin:R.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!n.selected,isDraggable:N,isSelectable:M,isConnectable:O,isFocusable:k,resizeObserver:v,dragHandle:n.dragHandle,zIndex:null!==(f=null===(g=n[oe])||void 0===g?void 0:g.z)&&void 0!==f?f:0,isParent:!(null===(p=n[oe])||void 0===p||!p.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!n.width&&!!n.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:n.ariaLabel,hasHandleBounds:!(null===(h=n[oe])||void 0===h||!h.handleBounds)})}))};kt.displayName="NodeRenderer";var Dt=(0,o.memo)(kt),It=function(e,n,t){return t===he.Left?e-n:t===he.Right?e+n:e},At=function(e,n,t){return t===he.Top?e-n:t===he.Bottom?e+n:e},Rt="react-flow__edgeupdater",Bt=function(e){var n=e.position,t=e.centerX,i=e.centerY,a=e.radius,l=void 0===a?10:a,d=e.onMouseDown,c=e.onMouseEnter,u=e.onMouseOut,s=e.type;return o.createElement("circle",{onMouseDown:d,onMouseEnter:c,onMouseOut:u,className:(0,r.A)([Rt,"".concat(Rt,"-").concat(s)]),cx:It(t,l,n),cy:At(i,l,
1n),r:l,stroke:"transparent",fill:"transparent"})},zt=function(){return!0},Tt=function(e){var n=function(n){var t=n.id,i=n.className,a=n.type,l=n.data,d=n.onClick,c=n.onEdgeDoubleClick,u=n.selected,s=n.animated,f=n.label,v=n.labelStyle,g=n.labelShowBg,p=n.labelBgStyle,h=n.labelBgPadding,y=n.labelBgBorderRadius,S=n.style,b=n.source,E=n.target,x=n.sourceX,C=n.sourceY,w=n.targetX,N=n.targetY,M=n.sourcePosition,P=n.targetPosition,O=n.elementsSelectable,k=n.hidden,D=n.sourceHandleId,I=n.targetHandleId,A=n.onContextMenu,R=n.onMouseEnter,B=n.onMouseMove,z=n.onMouseLeave,T=n.edgeUpdaterRadius,_=n.onEdgeUpdate,H=n.onEdgeUpdateStart,Y=n.onEdgeUpdateEnd,X=n.markerEnd,V=n.markerStart,K=n.rfId,Z=n.ariaLabel,F=n.isFocusable,U=n.isUpdatable,W=n.pathOptions,j=n.interactionWidth,G=(0,o.useRef)(null),q=m((0,o.useState)(!1),2),Q=q[0],J=q[1],$=m((0,o.useState)(!1),2),ee=$[0],ne=$[1],te=L(),oe=(0,o.useMemo)(function(){return"url('#".concat(Le(V,K),"')")},[V,K]),ie=(0,o.useMemo)(function(){return"url('#".concat(Le(X,K),"')")},[X,K]);if(k)return null;var ae=me(t,te.getState,c),le=me(t,te.getState,A),de=me(t,te.getState,R),ce=me(t,te.getState,B),ue=me(t,te.getState,z),se=function(e,n){if(0===e.button){var o=te.getState(),r=o.edges,i=o.isValidConnection,a=n?E:b,l=(n?I:D)||null,d=n?"target":"source",c=i||zt,u=n,s=r.find(function(e){return e.id===t});ne(!0),null===H||void 0===H||H(e,s,d);en({event:e,handleId:l,nodeId:a,onConnect:function(e){return null===_||void 0===_?void 0:_(s,e)},isTarget:u,getState:te.getState,setState:te.setState,isValidConnection:c,edgeUpdaterType:d,onEdgeUpdateEnd:function(e){ne(!1),null===Y||void 0===Y||Y(e,s,d)}})}},fe=function(){return J(!0)},ve=function(){return J(!1)},ge=!O&&!d;return o.createElement("g",{className:(0,r.A)(["react-flow__edge","react-flow__edge-".concat(a),i,{selected:u,animated:s,inactive:ge,updating:Q}]),onClick:function(e){var n=te.getState(),o=n.edges,r=n.addSelectedEdges,i=n.unselectNodesAndEdges,a=n.multiSelectionActive,l=o.find(function(e){return e.id===t});if(l){var c;if(O)if(te.setState({nodesSelectionActive:!1}),l.selected&&a)i({nodes:[],edges:[l]}),null===(c=G.current)||void 0===c||c.blur();else r([t]);d&&d(e,l)}},onDoubleClick:ae,onContextMenu:le,onMouseEnter:de,onMouseMove:ce,onMouseLeave:ue,onKeyDown:F?function(e){if(re.includes(e.key)&&O){var n,o=te.getState(),r=o.unselectNodesAndEdges,i=o.addSelectedEdges,a=o.edges;if("Escape"===e.key)null===(n=G.current)||void 0===n||n.blur(),r({edges:[a.find(function(e){return e.id===t})]});else i([t])}}:void 0,tabIndex:F?0:void 0,role:F?"button":"img","data-testid":"rf__edge-".concat(t),"aria-label":null===Z?void 0:Z||"Edge from ".concat(b," to ").concat(E),"aria-describedby":F?"".concat(Mn,"-").concat(K):void 0,ref:G},!ee&&o.createElement(e,{id:t,source:b,target:E,selected:u,animated:s,label:f,labelStyle:v,labelShowBg:g,labelBgStyle:p,labelBgPadding:h,labelBgBorderRadius:y,data:l,style:S,sourceX:x,sourceY:C,targetX:w,targetY:N,sourcePosition:M,targetPosition:P,sourceHandleId:D,targetHandleId:I,markerStart:oe,markerEnd:ie,pathOptions:W,interactionWidth:j}),U&&o.createElement(o.Fragment,null,("source"===U||!0===U)&&o.createElement(Bt,{position:M,centerX:x,centerY:C,radius:T,onMouseDown:function(e){return se(e,!0)},onMouseEnter:fe,onMouseOut:ve,type:"source"}),("target"===U||!0===U)&&o.createElement(Bt,{position:P,centerX:w,centerY:N,radius:T,onMouseDown:function(e){return se(e,!1)},onMouseEnter:fe,onMouseOut:ve,type:"target"})))};return n.displayName="EdgeWrapper",(0,o.memo)(n)};function _t(e){var n={default:Tt(e.default||Be),straight:Tt(e.bezier||De),step:Tt(e.step||Oe),smoothstep:Tt(e.step||Pe),simplebezier:Tt(e.simplebezier||xe)},t=Object.keys(e).filter(function(e){return!["default","bezier"].includes(e)}).reduce(function(n,t){return n[t]=Tt(e[t]||Be),n},{});return x(x({},n),t)}function Lt(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=((null===t||void 0===t?void 0:t.x)||0)+n.x,r=((null===t||void 0===t?void 0:t.y)||0)+n.y,i=(null===t||void 0===t?void 0:t.width)||n.width,a=(null===t||void 0===t?void 0:t.height)||n.height;switch(e){case he.Top:return{x:o+i/2,y:r};case he.Right:return{x:o+i,y:r+a/2};case he.Bottom:return{x:o+i/2,y:r+a};case he.Left:return{x:o,y:r+a/2}}}function Ht(e,n){return e?1!==e.length&&n?n&&e.find(function(e){return e.id===n})||null:e[0]:null}function Yt(e){var n,t,o,r,i,a=(null===e||void 0===e||null===(n=e[oe])||void 0===n?void 0:n.handleBounds)||null,l=a&&(null===e||void 0===e?void 0:e.width)&&(null===e||void 0===e?void 0:e.he
1ight)&&"undefined"!==typeof(null===e||void 0===e||null===(t=e.positionAbsolute)||void 0===t?void 0:t.x)&&"undefined"!==typeof(null===e||void 0===e||null===(o=e.positionAbsolute)||void 0===o?void 0:o.y);return[{x:(null===e||void 0===e||null===(r=e.positionAbsolute)||void 0===r?void 0:r.x)||0,y:(null===e||void 0===e||null===(i=e.positionAbsolute)||void 0===i?void 0:i.y)||0,width:(null===e||void 0===e?void 0:e.width)||0,height:(null===e||void 0===e?void 0:e.height)||0},a,!!l]}var Xt=[{level:0,isMaxLevel:!0,edges:[]}];function Vt(e,n,t){return function(e,n){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=-1,r=e.reduce(function(e,r){var i=te(r.zIndex),a=i?r.zIndex:0;if(t){var l,d,c=n.get(r.target),u=n.get(r.source),s=r.selected||(null===c||void 0===c?void 0:c.selected)||(null===u||void 0===u?void 0:u.selected),f=Math.max((null===u||void 0===u||null===(l=u[oe])||void 0===l?void 0:l.z)||0,(null===c||void 0===c||null===(d=c[oe])||void 0===d?void 0:d.z)||0,1e3);a=(i?r.zIndex:0)+(s?f:0)}return e[a]?e[a].push(r):e[a]=[r],o=a>o?a:o,e},{}),i=Object.entries(r).map(function(e){var n=m(e,2),t=+n[0];return{edges:n[1],level:t,isMaxLevel:t===o}});return 0===i.length?Xt:i}(_((0,o.useCallback)(function(t){return e?t.edges.filter(function(e){var o=n.get(e.source),r=n.get(e.target);return(null===o||void 0===o?void 0:o.width)&&(null===o||void 0===o?void 0:o.height)&&(null===r||void 0===r?void 0:r.width)&&(null===r||void 0===r?void 0:r.height)&&function(e){var n=e.sourcePos,t=e.targetPos,o=e.sourceWidth,r=e.sourceHeight,i=e.targetWidth,a=e.targetHeight,l=e.width,d=e.height,c=e.transform,u={x:Math.min(n.x,t.x),y:Math.min(n.y,t.y),x2:Math.max(n.x+o,t.x+i),y2:Math.max(n.y+r,t.y+a)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);var s=Q({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:l/c[2],height:d/c[2]}),f=Math.max(0,Math.min(s.x2,u.x2)-Math.max(s.x,u.x)),v=Math.max(0,Math.min(s.y2,u.y2)-Math.max(s.y,u.y));return Math.ceil(f*v)>0}({sourcePos:o.positionAbsolute||{x:0,y:0},targetPos:r.positionAbsolute||{x:0,y:0},sourceWidth:o.width,sourceHeight:o.height,targetWidth:r.width,targetHeight:r.height,width:t.width,height:t.height,transform:t.transform})}):t.edges},[e,n])),n,t)}var Kt=C(C({},pe.Arrow,function(e){var n=e.color,t=void 0===n?"none":n,r=e.strokeWidth,i=void 0===r?1:r;return o.createElement("polyline",{style:{stroke:t,strokeWidth:i},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"})}),pe.ArrowClosed,function(e){var n=e.color,t=void 0===n?"none":n,r=e.strokeWidth,i=void 0===r?1:r;return o.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:i},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})});var Zt=function(e){var n=e.id,t=e.type,r=e.color,i=e.width,a=void 0===i?12.5:i,l=e.height,d=void 0===l?12.5:l,c=e.markerUnits,u=void 0===c?"strokeWidth":c,s=e.strokeWidth,f=e.orient,v=void 0===f?"auto-start-reverse":f,g=function(e){var n=L();return(0,o.useMemo)(function(){var t,o;return Object.prototype.hasOwnProperty.call(Kt,e)?Kt[e]:(null===(t=(o=n.getState()).onError)||void 0===t||t.call(o,"009",I(e)),null)},[e])}(t);return g?o.createElement("marker",{className:"react-flow__arrowhead",id:n,markerWidth:"".concat(a),markerHeight:"".concat(d),viewBox:"-10 -10 20 20",markerUnits:u,orient:v,refX:"0",refY:"0"},o.createElement(g,{color:r,strokeWidth:s})):null},Ft=function(e){var n=e.defaultColor,t=e.rfId,r=_((0,o.useCallback)(function(e){var n=e.defaultColor,t=e.rfId;return function(e){var o=[];return e.edges.reduce(function(e,r){return[r.markerStart,r.markerEnd].forEac
1h(function(r){if(r&&"object"===h(r)){var i=Le(r,t);o.includes(i)||(e.push(x({id:i,color:r.color||n},r)),o.push(i))}}),e},[]).sort(function(e,n){return e.id.localeCompare(n.id)})}}({defaultColor:n,rfId:t}),[n,t]),function(e,n){return!(e.length!==n.length||e.some(function(e,t){return e.id!==n[t].id}))});return o.createElement("defs",null,r.map(function(e){return o.createElement(Zt,{id:e.id,key:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient})}))};Ft.displayName="MarkerDefinitions";var Ut=(0,o.memo)(Ft),Wt=function(e){return{nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}},jt=function(e){var n=e.defaultMarkerColor,t=e.onlyRenderVisibleElements,i=e.elevateEdgesOnSelect,l=e.rfId,d=e.edgeTypes,c=e.noPanClassName,u=e.onEdgeUpdate,s=e.onEdgeContextMenu,f=e.onEdgeMouseEnter,v=e.onEdgeMouseMove,g=e.onEdgeMouseLeave,p=e.onEdgeClick,h=e.edgeUpdaterRadius,y=e.onEdgeDoubleClick,S=e.onEdgeUpdateStart,b=e.onEdgeUpdateEnd,E=e.children,x=_(Wt,a.x),C=x.edgesFocusable,w=x.edgesUpdatable,N=x.elementsSelectable,M=x.width,P=x.height,O=x.connectionMode,k=x.nodeInternals,D=x.onError,I=Vt(t,k,i);return M?o.createElement(o.Fragment,null,I.map(function(e){var t=e.level,i=e.edges,a=e.isMaxLevel;return o.createElement("svg",{key:t,style:{zIndex:t},width:M,height:P,className:"react-flow__edges react-flow__container"},a&&o.createElement(Ut,{defaultColor:n,rfId:l}),o.createElement("g",null,i.map(function(e){var n,t,i=m(Yt(k.get(e.source)),3),a=i[0],E=i[1],x=i[2],M=m(Yt(k.get(e.target)),3),P=M[0],I=M[1],R=M[2];if(!x||!R)return null;var z=e.type||"default";d[z]||(null===D||void 0===D||D("011",B(z)),z="default");var T=d[z]||d.default,_=O===se.Strict?I.target:(null!==(n=I.target)&&void 0!==n?n:[]).concat(null!==(t=I.source)&&void 0!==t?t:[]),L=Ht(E.source,e.sourceHandle),H=Ht(_,e.targetHandle),Y=(null===L||void 0===L?void 0:L.position)||he.Bottom,X=(null===H||void 0===H?void 0:H.position)||he.Top,V=!!(e.focusable||C&&"undefined"===typeof e.focusable),K="undefined"!==typeof u&&(e.updatable||w&&"undefined"===typeof e.updatable);if(!L||!H)return null===D||void 0===D||D("008",A(L,e)),null;var Z=function(e,n,t,o,r,i){var a=Lt(t,e,n),l=Lt(i,o,r);return{sourceX:a.x,sourceY:a.y,targetX:l.x,targetY:l.y}}(a,L,Y,P,H,X),F=Z.sourceX,U=Z.sourceY,W=Z.targetX,j=Z.targetY;return o.createElement(T,{key:e.id,id:e.id,className:(0,r.A)([e.className,c]),type:z,data:e.data,selected:!!e.selected,animated:!!e.animated,hidden:!!e.hidden,label:e.label,labelStyle:e.labelStyle,labelShowBg:e.labelShowBg,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,source:e.source,target:e.target,sourceHandleId:e.sourceHandle,targetHandleId:e.targetHandle,markerEnd:e.markerEnd,markerStart:e.markerStart,sourceX:F,sourceY:U,targetX:W,targetY:j,sourcePosition:Y,targetPosition:X,elementsSelectable:N,onEdgeUpdate:u,onContextMenu:s,onMouseEnter:f,onMouseMove:v,onMouseLeave:g,onClick:p,edgeUpdaterRadius:h,onEdgeDoubleClick:y,onEdgeUpdateStart:S,onEdgeUpdateEnd:b,rfId:l,ariaLabel:e.ariaLabel,isFocusable:V,isUpdatable:K,pathOptions:"pathOptions"in e?e.pathOptions:void 0,interactionWidth:e.interactionWidth})})))}),E):null};jt.displayName="EdgeRenderer";var Gt=(0,o.memo)(jt),qt=function(e){return"translate(".concat(e.transform[0],"px,").concat(e.transform[1],"px) scale(").concat(e.transform[2],")")};function Qt(e){var n=e.children,t=_(qt);return o.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},n)}var Jt=C(C(C(C({},he.Left,he.Right),he.Right,he.Left),he.Top,he.Bottom),he.Bottom,he.Top),$t=function(e){var n,t,r,i,l,d,c,u=e.nodeId,s=e.handleType,f=e.style,v=e.type,g=void 0===v?ge.Bezier:v,p=e.CustomComponent,h=e.connectionStatus,y=_((0,o.useCallback)(function(e){return{fromNode:e.nodeInternals.get(u),handleId:e.connectionHandleId,toX:(e.connectionPosition.x-e.transform[0])/e.transform[2],toY:(e.connectionPosition.y-e.transform[1])/e.transform[2],connectionMode:e.connectionMode}},[u]),a.x),S=y.fromNode,b=y.handleId,E=y.toX,C=y.toY,w=y.connectionMode,N=null===S||void 0===S||null===(n=S[oe])||void 0===n?void 0:n.handleBounds,M=null===N||void 0===N?void 0:N[s];if(w===se.Loose&&(M=M||(null===N||void 0===N?void 0:N["source"===s?"target":"source"])),!S||!M)return null;var P=b?M.find(function(e){return e.id===b}):M[0],O=P?P.x+P.width/2:(null!==(t=S.width)&&void 0!==t?t:0)/2,k=P?P.y+P.height/2:null!==(r=S.height)&&void 0!==r?r:0,D=(null!==(i=null===(l=S.positionAbsolute)||void 0===l?void 0:l.x)&&void 0!==i?i:0)+O,I=(null!==(d=null===(c=S.positionAbsolute)||void 0===c?void 0:c.y)&&void 0!==d?d:0)+k,A=null===P||void 0===P?void 0:P.position,R=A?Jt[A]:null;if(!A||!R)return null;if(p)return o.createElement(p,{connectionLineType:g,connectionLineStyle:f,fromNode:S,fromHandle:P,fromX:D,fromY:I,toX:E,toY:C,fromPosition:A,toPosition:R,connectionStatus:h});var B="",z={sourceX:D,sourceY:I,sourcePosition:A,targetX:E,targetY:C,targetPosition:R};if(g===ge.Bezier)B=m(Re(z),1)[0];else if(g===ge.Step){B=m(Me(x(x({},z),{},{borderRadius:0})),1)[0]}else if(g===ge.SmoothStep){B=m(Me(z),1)[0]}else if(g===ge.SimpleBezier){B=m(Ee(z),1)[0]}else B="M".concat(D,",").concat(I," ").concat(E,",").concat(C);return o.createElement("path",{d:B,fill:"none",className:"react-flow__connection-path",style:f})};$t.displayName="ConnectionLine";var eo=function(e){return{nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height}};function no(e){var n=e.containerStyle,t=e.style,i=e.type,l=e.component,d=_(eo,a.x),c=d.nodeId,u=d.handleType,s=d.nodesConnectable,f=d.width,v=d.height,g=d.connectionStatus;return!!(c&&u&&f&&s)?o.createElement("svg",{style:n,width:f,height:v,className:"react-flow__edges react-flow__connectionline react-flow__container"},o.createElement("g",{className:(0,r.A)(["react-flow__connection",g])},o.createElement($t,{nodeId:c,handleType:u,style:t,type:i,CustomComponent:l,connectionStatus:g}))):null}function to(e,n){(0,o.useRef)(null),L();return(0,o.useMemo)(function(){return n(e)},[e])}var oo=function(e){var n=e.nodeTypes,t=e.edgeTypes,r=e.onMove,i=e.onMoveStart,a=e.onMoveEnd,l=e.onInit,d=e.onNodeClick,c=e.onEdgeClick,u=e.onNodeDoubleClick,s=e.onEdgeDoubleClick,f=e.onNodeMouseEnter,v=e.onNodeMouseMove,g=e.onNodeMouseLeave,p=e.onNodeContextMenu,h=e.onSelectionContextMenu,m=e.onSelectionStart,y=e.onSelectionEnd,S=e.connectionLineType,b=e.connectionLineStyle,E=e.connectionLineComponent,x=e.connectionLineContainerStyle,C=e.selectionKeyCode,w=e.selectionOnDrag,N=e.selectionMode,M=e.multiSelectionKeyCode,P=e.panActivationKeyCode,O=e.zoomActivationKeyCode,k=e.deleteKeyCode,D=e.onlyRenderVisibleElements,I=e.elementsSelectable,A=e.selectNodesOnDrag,R=e.defaultViewport,B=e.translateExtent,z=e.minZoom,T=e.maxZoom,_=e.preventScrolling,L=e.defaultMarkerColor,H=e.zoomOnScroll,Y=e.zoomOnPinch,X=e.panOnScroll,V=e.panOnScrollSpeed,K=e.panOnScrollMode,Z=e.zoomOnDoubleClick,F=e.panOnDrag,U=e.onPaneClick,W=e.onPaneMouseEnter,j=e.onPaneMouseMove,G=e.onPaneMouseLeave,q=e.onPaneScroll,Q=e.onPaneContextMenu,J=e.onEdgeUpdate,$=e.onEdgeContextMenu,ee=e.onEdgeMouseEnter,ne=e.onEdgeMouseMove,te=e.onEdgeMouseLeave,oe=e.edgeUpdaterRadius,re=e.onEdgeUpdateStart,ie=e.onEdgeUpdateEnd,ae=e.noDragClassName,le=e.noWheelClassName,de=e.noPanClassName,ce=e.elevateEdgesOnSelect,ue=e.disableKeyboardA11y,se=e.nodeOrigin,fe=e.nodeExtent,ve=e.rfId,ge=to(n,Pt),pe=to(t,_t);return function(e){var n=Kn(),t=(0,o.useRef)(!1);(0,o.useEffect)(function(){!t.current&&n.viewportInitialized&&e&&(setTimeout(function(){return e(n)},1),t.current=!0)}
1,[e,n.viewportInitialized])}(l),o.createElement(Mt,{onPaneClick:U,onPaneMouseEnter:W,onPaneMouseMove:j,onPaneMouseLeave:G,onPaneContextMenu:Q,onPaneScroll:q,deleteKeyCode:k,selectionKeyCode:C,selectionOnDrag:w,selectionMode:N,onSelectionStart:m,onSelectionEnd:y,multiSelectionKeyCode:M,panActivationKeyCode:P,zoomActivationKeyCode:O,elementsSelectable:I,onMove:r,onMoveStart:i,onMoveEnd:a,zoomOnScroll:H,zoomOnPinch:Y,zoomOnDoubleClick:Z,panOnScroll:X,panOnScrollSpeed:V,panOnScrollMode:K,panOnDrag:F,defaultViewport:R,translateExtent:B,minZoom:z,maxZoom:T,onSelectionContextMenu:h,preventScrolling:_,noDragClassName:ae,noWheelClassName:le,noPanClassName:de,disableKeyboardA11y:ue},o.createElement(Qt,null,o.createElement(Gt,{edgeTypes:pe,onEdgeClick:c,onEdgeDoubleClick:s,onEdgeUpdate:J,onlyRenderVisibleElements:D,onEdgeContextMenu:$,onEdgeMouseEnter:ee,onEdgeMouseMove:ne,onEdgeMouseLeave:te,onEdgeUpdateStart:re,onEdgeUpdateEnd:ie,edgeUpdaterRadius:oe,defaultMarkerColor:L,noPanClassName:de,elevateEdgesOnSelect:!!ce,disableKeyboardA11y:ue,rfId:ve},o.createElement(no,{style:b,type:S,component:E,containerStyle:x})),o.createElement("div",{className:"react-flow__edgelabel-renderer"}),o.createElement(Dt,{nodeTypes:ge,onNodeClick:d,onNodeDoubleClick:u,onNodeMouseEnter:f,onNodeMouseMove:v,onNodeMouseLeave:g,onNodeContextMenu:p,selectNodesOnDrag:A,onlyRenderVisibleElements:D,noPanClassName:de,noDragClassName:ae,disableKeyboardA11y:ue,nodeOrigin:se,nodeExtent:fe,rfId:ve})))};oo.displayName="GraphView";var ro=(0,o.memo)(oo),io=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ao={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:io,nodeExtent:io,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:se.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:ie,isValidConnection:void 0},lo=function(e){var n=e.children,t=(0,o.useRef)(null);return t.current||(t.current=(0,i.h)(function(e,n){return x(x({},ao),{},{setNodes:function(t){var o=n(),r=o.nodeInternals,i=o.nodeOrigin,a=o.elevateNodesOnSelect;e({nodeInternals:zn(t,r,i,a)})},getNodes:function(){return Array.from(n().nodeInternals.values())},setEdges:function(t){var o=n().defaultEdgeOptions,r=void 0===o?{}:o;e({edges:t.map(function(e){return x(x({},r),e)})})},setDefaultNodesAndEdges:function(t,o){var r="undefined"!==typeof t,i="undefined"!==typeof o,a=r?zn(t,new Map,n().nodeOrigin,n().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:i?o:[],hasDefaultNodes:r,hasDefaultEdges:i})},updateNodeDimensions:function(t){var o=n(),r=o.onNodesChange,i=o.nodeInternals,a=o.fitViewOnInit,l=o.fitViewOnInitDone,d=o.fitViewOnInitOptions,c=o.domNode,u=o.nodeOrigin,s=null===c||void 0===c?void 0:c.querySelector(".react-flow__viewport");if(s){var f=window.getComputedStyle(s),v=new window.DOMMatrixReadOnly(f.transform).m22,g=t.reduce(function(e,n){var t=i.get(n.id);if(t){var o=Z(n.nodeElement);o.width&&o.height&&(t.width!==o.width||t.height!==o.height||n.forceUpdate)&&(i.set(t.id,x(x({},t),{},C({},oe,x(x({},t[oe]),{},{handleBounds:{source:vt(".source",n.nodeElement,v,u),target:vt(".target",n.nodeElement,v,u)}})),o)),e.push({id:t.id,type:"dimensions",dimensions:o}))}return e},[]);Bn(i,u);var p=l||a&&!l&&Tn(n,x({initial:!0},d));e({nodeInternals:new Map(i),fitViewOnInitDone:p}),(null===g||void 0===g?void 0:g.length)>0&&(null===r||void 0===r||r(g))}},updateNodePositions:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,n().triggerNodeChanges)(e.map(function(e){var n={id:e.id,type:"position",dragging:o};return t&&(n.positionAbsolute=e.positionAbsolute,n.position=e.position),n}))},triggerNodeChanges:function(t){var o=n(),r=o.onNodesChange,i=o.nodeInternals,a=o.hasDefaultNodes,l=o.nodeOrigin,d=o.getNodes,c=o.elevateNodesOnSelect;if(null!==t&&void 0!==t&&t.length){if(a){var u=zn(tt(t,d()),i,l,c);e({nodeInternals:u})}null===r||void 0===r||r(t)}},addSelectedNodes:function(t){var o,r=n(),i=r.multiSelectionActive,a=r.edges,l=r.getNodes,d=null;i?o=t.map(function(e){return ot(e,!0)}):(o=rt(l(),t),d=rt(a,[])),Hn({changedNodes:o,changedEdges:d,get:n,set:e})},addSelectedEdges:function(t){var o,r=n(),i=r.multiSelectionActive,a=r.edges,l=r.getNodes,d=null;i?o=t.map(function(e){return ot(e,!0)}):(o=rt(a,t),d=rt(l(),[])),Hn({changedNodes:d,changedEdges:o,get:n,set:e})},unselectNodesAndEdges:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.nodes,r=t.edges,i=n(),a=i.edges,l=i.getNodes,d=r||a;Hn({changedNodes:(o||l()).map(function(e){return e.selected=!1,ot(e.id,!1)}),changedEdges:d.map(function(e){return ot(e.id,!1)}),get:n,set:e})},setMinZoom:function(t){var o=n(),r=o.d3Zoom,i=o.maxZoom;null===r||void 0===r||r.scaleExtent([t,i]),e({minZoom:t})}
1,setMaxZoom:function(t){var o=n(),r=o.d3Zoom,i=o.minZoom;null===r||void 0===r||r.scaleExtent([i,t]),e({maxZoom:t})},setTranslateExtent:function(t){var o;null===(o=n().d3Zoom)||void 0===o||o.translateExtent(t),e({translateExtent:t})},resetSelectedElements:function(){var t=n(),o=t.edges;Hn({changedNodes:(0,t.getNodes)().filter(function(e){return e.selected}).map(function(e){return ot(e.id,!1)}),changedEdges:o.filter(function(e){return e.selected}).map(function(e){return ot(e.id,!1)}),get:n,set:e})},setNodeExtent:function(t){var o=n().nodeInternals;o.forEach(function(e){e.positionAbsolute=U(e.position,t)}),e({nodeExtent:t,nodeInternals:new Map(o)})},panBy:function(e){var t=n(),o=t.transform,r=t.width,i=t.height,a=t.d3Zoom,d=t.d3Selection,c=t.translateExtent;if(!a||!d||!e.x&&!e.y)return!1;var u=l.GS.translate(o[0]+e.x,o[1]+e.y).scale(o[2]),s=[[0,0],[r,i]],f=null===a||void 0===a?void 0:a.constrain()(u,s,c);return a.transform(d,f),o[0]!==f.x||o[1]!==f.y||o[2]!==f.k},cancelConnection:function(){return e({connectionNodeId:ao.connectionNodeId,connectionHandleId:ao.connectionHandleId,connectionHandleType:ao.connectionHandleType,connectionStatus:ao.connectionStatus,connectionStartHandle:ao.connectionStartHandle,connectionEndHandle:ao.connectionEndHandle})},reset:function(){return e(x({},ao))}})},Object.is)),o.createElement(M,{value:t.current},n)};lo.displayName="ReactFlowProvider";var co=function(e){var n=e.children;return(0,o.useContext)(N)?o.createElement(o.Fragment,null,n):o.createElement(lo,null,n)};co.displayName="ReactFlowWrapper";var uo={input:cn,default:ln,output:sn,group:fn},so={default:Be,straight:De,step:Oe,smoothstep:Pe,simplebezier:xe},fo=[0,0],vo=[15,15],go={x:0,y:0,zoom:1},po={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},ho=(0,o.forwardRef)(function(e,n){var t=e.nodes,i=e.edges,a=e.defaultNodes,l=e.defaultEdges,d=e.className,c=e.nodeTypes,u=void 0===c?uo:c,s=e.edgeTypes,f=void 0===s?so:s,v=e.onNodeClick,g=e.onEdgeClick,h=e.onInit,m=e.onMove,y=e.onMoveStart,S=e.onMoveEnd,b=e.onConnect,E=e.onConnectStart,C=e.onConnectEnd,N=e.onClickConnectStart,M=e.onClickConnectEnd,P=e.onNodeMouseEnter,O=e.onNodeMouseMove,k=e.onNodeMouseLeave,D=e.onNodeContextMenu,I=e.onNodeDoubleClick,A=e.onNodeDragStart,R=e.onNodeDrag,B=e.onNodeDragStop,z=e.onNodesDelete,T=e.onEdgesDelete,_=e.onSelectionChange,L=e.onSelectionDragStart,H=e.onSelectionDrag,Y=e.onSelectionDragStop,V=e.onSelectionContextMenu,K=e.onSelectionStart,Z=e.onSelectionEnd,F=e.connectionMode,U=void 0===F?se.Strict:F,W=e.connectionLineType,j=void 0===W?ge.Bezier:W,G=e.connectionLineStyle,q=e.connectionLineComponent,Q=e.connectionLineContainerStyle,J=e.deleteKeyCode,$=void 0===J?"Backspace":J,ee=e.selectionKeyCode,ne=void 0===ee?"Shift":ee,te=e.selectionOnDrag,oe=void 0!==te&&te,re=e.selectionMode,ie=void 0===re?ve.Full:re,ae=e.panActivationKeyCode,le=void 0===ae?"Space":ae,de=e.multiSelectionKeyCode,ue=void 0===de?ce()?"Meta":"Control":de,pe=e.zoomActivationKeyCode,he=void 0===pe?ce()?"Meta":"Control":pe,me=e.snapToGrid,ye=void 0!==me&&me,Se=e.snapGrid,be=void 0===Se?vo:Se,Ee=e.onlyRenderVisibleElements,xe=void 0!==Ee&&Ee,Ce=e.selectNodesOnDrag,we=void 0===Ce||Ce,Ne=e.nodesDraggable,Me=e.nodesConnectable,Pe=e.nodesFocusable,Oe=e.nodeOrigin,ke=void 0===Oe?fo:Oe,De=e.edgesFocusable,Ie=e.edgesUpdatable,Ae=e.elementsSelectable,Re=e.defaultViewport,Be=void 0===Re?go:Re,ze=e.minZoom,Te=void 0===ze?.5:ze,_e=e.maxZoom,Le=void 0===_e?2:_e,He=e.translateExtent,Ye=void 0===He?io:He,Xe=e.preventScrolling,Ve=void 0===Xe||Xe,Ke=e.nodeExtent,Ze=e.defaultMarkerColor,Fe=void 0===Ze?"#b1b1b7":Ze,Ue=e.zoomOnScroll,We=void 0===Ue||Ue,je=e.zoomOnPinch,Ge=void 0===je||je,qe=e.panOnScroll,Qe=void 0!==qe&&qe,Je=e.panOnScrollSpeed,$e=void 0===Je?.5:Je,en=e.panOnScrollMode,nn=void 0===en?fe.Free:en,tn=e.zoomOnDoubleClick,on=void 0===tn||tn,rn=e.panOnDrag,an=void 0===rn||rn,ln=e.onPaneClick,dn=e.onPaneMouseEnter,cn=e.onPaneMouseMove,un=e.onPaneMouseLeave,sn=e.onPaneScroll,fn=e.onPaneContextMenu,vn=e.children,gn=e.onEdgeUpdate,pn=e.onEdgeContextMenu,hn=e.onEdgeDoubleClick,mn=e.onEdgeMouseEnter,Sn=e.onEdgeMouseMove,bn=e.onEdgeMouseLeave,En=e.onEdgeUpdateStart,Cn=e.onEdgeUpdateEnd,wn=e.edgeUpdaterRadius,Nn=void 0===wn?10:wn,Mn=e.onNodesChange,Pn=e.onEdgesChange,On=e.noDragClassName,Dn=void 0===On?"nodrag":On,In=e.noWheelClassName,An=void 0===In?"nowheel":In,Rn=e.noPanClassName,Bn=void 0===Rn?"nopan":Rn,zn=e.f
1itView,Tn=void 0!==zn&&zn,_n=e.fitViewOptions,Ln=e.connectOnClick,Hn=void 0===Ln||Ln,Yn=e.attributionPosition,Xn=e.proOptions,Vn=e.defaultEdgeOptions,Kn=e.elevateNodesOnSelect,Zn=void 0===Kn||Kn,Fn=e.elevateEdgesOnSelect,Un=void 0!==Fn&&Fn,Wn=e.disableKeyboardA11y,jn=void 0!==Wn&&Wn,Gn=e.autoPanOnConnect,qn=void 0===Gn||Gn,Qn=e.autoPanOnNodeDrag,Jn=void 0===Qn||Qn,$n=e.connectionRadius,et=void 0===$n?20:$n,nt=e.isValidConnection,tt=e.onError,ot=e.style,rt=e.id,it=e.nodeDragThreshold,at=w(e,p),lt=rt||"1";return o.createElement("div",x(x({},at),{},{style:x(x({},ot),po),ref:n,className:(0,r.A)(["react-flow",d]),"data-testid":"rf__wrapper",id:rt}),o.createElement(co,null,o.createElement(ro,{onInit:h,onMove:m,onMoveStart:y,onMoveEnd:S,onNodeClick:v,onEdgeClick:g,onNodeMouseEnter:P,onNodeMouseMove:O,onNodeMouseLeave:k,onNodeContextMenu:D,onNodeDoubleClick:I,nodeTypes:u,edgeTypes:f,connectionLineType:j,connectionLineStyle:G,connectionLineComponent:q,connectionLineContainerStyle:Q,selectionKeyCode:ne,selectionOnDrag:oe,selectionMode:ie,deleteKeyCode:$,multiSelectionKeyCode:ue,panActivationKeyCode:le,zoomActivationKeyCode:he,onlyRenderVisibleElements:xe,selectNodesOnDrag:we,defaultViewport:Be,translateExtent:Ye,minZoom:Te,maxZoom:Le,preventScrolling:Ve,zoomOnScroll:We,zoomOnPinch:Ge,zoomOnDoubleClick:on,panOnScroll:Qe,panOnScrollSpeed:$e,panOnScrollMode:nn,panOnDrag:an,onPaneClick:ln,onPaneMouseEnter:dn,onPaneMouseMove:cn,onPaneMouseLeave:un,onPaneScroll:sn,onPaneContextMenu:fn,onSelectionContextMenu:V,onSelectionStart:K,onSelectionEnd:Z,onEdgeUpdate:gn,onEdgeContextMenu:pn,onEdgeDoubleClick:hn,onEdgeMouseEnter:mn,onEdgeMouseMove:Sn,onEdgeMouseLeave:bn,onEdgeUpdateStart:En,onEdgeUpdateEnd:Cn,edgeUpdaterRadius:Nn,defaultMarkerColor:Fe,noDragClassName:Dn,noWheelClassName:An,noPanClassName:Bn,elevateEdgesOnSelect:Un,rfId:lt,disableKeyboardA11y:jn,nodeOrigin:ke,nodeExtent:Ke}),o.createElement(xn,{nodes:t,edges:i,defaultNodes:a,defaultEdges:l,onConnect:b,onConnectStart:E,onConnectEnd:C,onClickConnectStart:N,onClickConnectEnd:M,nodesDraggable:Ne,nodesConnectable:Me,nodesFocusable:Pe,edgesFocusable:De,edgesUpdatable:Ie,elementsSelectable:Ae,elevateNodesOnSelect:Zn,minZoom:Te,maxZoom:Le,nodeExtent:Ke,onNodesChange:Mn,onEdgesChange:Pn,snapToGrid:ye,snapGrid:be,connectionMode:U,translateExtent:Ye,connectOnClick:Hn,defaultEdgeOptions:Vn,fitView:Tn,fitViewOptions:_n,onNodesDelete:z,onEdgesDelete:T,onNodeDragStart:A,onNodeDrag:R,onNodeDragStop:B,onSelectionDrag:H,onSelectionDragStart:L,onSelectionDragStop:Y,noPanClassName:Bn,nodeOrigin:ke,rfId:lt,autoPanOnConnect:qn,autoPanOnNodeDrag:Jn,onError:tt,connectionRadius:et,isValidConnection:nt,nodeDragThreshold:it}),o.createElement(yn,{onSelectionChange:_}),vn,o.createElement(X,{proOptions:Xn,position:Yn}),o.createElement(kn,{rfId:lt,disableKeyboardA11y:jn})))});ho.displayName="ReactFlow";var mo=function(e){var n;return null===(n=e.domNode)||void 0===n?void 0:n.querySelector(".react-flow__edgelabel-renderer")};function yo(e){var n=e.children,t=_(mo);return t?(0,s.createPortal)(n,t):null}function So(e){return function(n){var t=m((0,o.useState)(n),2),r=t[0],i=t[1],a=(0,o.useCallback)(function(n){return i(function(t){return e(n,t)})},[]);return[r,i,a]}}var bo=So(tt),Eo=So(function(e,n){return nt(e,n)})}}]);
2//# sourceMappingURL=vendor-reactflow-core.3240c90b5e89b2262caf.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.