(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[740],{39362:function(e,t,n){"use strict";n.d(t,{Aq:function(){return _u},HH:function(){return wc},Ly:function(){return ni},tV:function(){return Eu},Hs:function(){return fc}});var r=n(67294),o=n(73935);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function c(e){if("string"===typeof e||"number"===typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(e,t),n)},tt=function(e,t){return{x:et(e.x,t[0][0],t[1][0]),y:et(e.y,t[0][1],t[1][1])}},nt=function(e){var t=qe((0,r.useState)(!1),2),n=t[0],o=t[1];return(0,r.useEffect)((function(){if("undefined"!==typeof e){var t=function(t){Qe(t)||t.key!==e&&t.keyCode!==e||(t.preventDefault(),o(!0))},n=function(t){Qe(t)||t.key!==e&&t.keyCode!==e||o(!1)},r=function(){return o(!1)};return window.addEventListener("keydown",t),window.addEventListener("keyup",n),window.addEventListener("blur",r),function(){window.removeEventListener("keydown",t),window.removeEventListener("keyup",n),window.removeEventListener("blur",r)}}}),[e,o]),n};function rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ot(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:[0,0,1],r=qe(n,3),o=r[0],i=r[1],a=r[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=dt({x:(t.x-o)/a,y:(t.y-i)/a,width:t.width/a,height:t.height/a});return e.filter((function(e){var t=e.__rf,n=t.position,r=t.width,o=t.height,i=t.isDragging,a=dt(ot(ot({},n),{},{width:r,height:o})),l=Math.max(0,Math.min(u.x2,a.x2)-Math.max(u.x,a.x)),s=Math.max(0,Math.min(u.y2,a.y2)-Math.max(u.y,a.y)),f=Math.ceil(l*s);return!(null!==r&&null!==o&&!i)||(c?f>0:f>=r*o)}))},mt=function(e,t){var n=e.map((function(e){return e.id}));return t.filter((function(e){return n.includes(e.source)||n.includes(e.target)}))},yt=function(e,t){return[].concat($e(e.map((function(e){var t=ot({},e);return t.position=t.__rf.position,delete t.__rf,t}))),$e(t.map((function(e){return ot({},e)}))))},vt=function(e){return function(){var t=e.getState(),n=t.nodes,r=void 0===n?[]:n,o=t.edges;return yt(r,void 0===o?[]:o)}},bt=function(e){return function(){var t=e.getState(),n=t.nodes,r=void 0===n?[]:n,o=t.edges,i=void 0===o?[]:o,a=t.transform;return{elements:yt(r,i),position:[a[0],a[1]],zoom:a[2]}}},wt=function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.1,a=t/(e.width*(1+i)),c=n/(e.height*(1+i)),u=Math.min(a,c),l=et(u,r,o),s=e.x+e.width/2,f=e.y+e.height/2,d=t/2-s*l,p=n/2-f*l;return[d,p,l]},_t={value:()=>{}};function Et(){for(var e,t=0,n=arguments.length,r={};t=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}function xt(e,t){for(var n,r=0,o=e.length;r0)for(var n,r,o=new Array(n),i=0;i=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Nt.hasOwnProperty(t)?{space:Nt[t],local:e}:e}function Dt(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ct&&t.documentElement.namespaceURI===Ct?t.createElement(e):t.createElementNS(n,e)}}function kt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jt(e){var t=Pt(e);return(t.local?kt:Dt)(t)}function Tt(){}function At(e){return null==e?Tt:function(){return this.querySelector(e)}}function zt(e){return"object"===typeof e&&"length"in e?e:Array.from(e)}function It(){return[]}function Rt(e){return null==e?It:function(){return this.querySelectorAll(e)}}function Lt(e){return function(){return this.matches(e)}}function Bt(e){return function(t){return t.matches(e)}}var Yt=Array.prototype.find;function Xt(){return this.firstElementChild}var Ht=Array.prototype.filter;function Ut(){return this.children}function Vt(e){return new Array(e.length)}function Zt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Gt(e){return function(){return e}}function Ft(e,t,n,r,o,i){for(var a,c=0,u=t.length,l=i.length;ct?1:e>=t?0:NaN}function qt(e){return function(){this.removeAttribute(e)}}function Qt(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Jt(e,t){return function(){this.setAttribute(e,t)}}function en(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function tn(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function nn(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function rn(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function on(e){return function(){this.style.removeProperty(e)}}function an(e,t,n){return function(){this.style.setProperty(e,t,n)}}function cn(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function un(e,t){return e.style.getPropertyValue(t)||rn(e).getComputedStyle(e,null).getPropertyValue(t)}function ln(e){return function(){delete this[e]}}function sn(e,t){return function(){this[e]=t}}function fn(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function dn(e){return e.trim().split(/^|\s+/)}function pn(e){return e.classList||new hn(e)}function hn(e){this._node=e,this._names=dn(e.getAttribute("class")||"")}function gn(e,t){for(var n=pn(e),r=-1,o=t.length;++r=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}function Tn(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var Ln=[null];function Bn(e,t){this._groups=e,this._parents=t}function Yn(){return new Bn([[document.documentElement]],Ln)}function Xn(e){return"string"===typeof e?new Bn([[document.querySelector(e)]],[document.documentElement]):new Bn([[e]],Ln)}function Hn(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}function Un(e){e.preventDefault(),e.stopImmediatePropagation()}function Vn(e){var t=e.document.documentElement,n=Xn(e).on("dragstart.drag",Un,!0);"onselectstart"in t?n.on("selectstart.drag",Un,!0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Zn(e,t){var n=e.document.documentElement,r=Xn(e).on("dragstart.drag",null);t&&(r.on("click.drag",Un,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Gn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Fn(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Kn(){}Bn.prototype=Yn.prototype={constructor:Bn,select:function(e){"function"!==typeof e&&(e=At(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o=_&&(_=w+1);!(b=m[_])&&++_=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=$t);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i1?this.each((null==t?on:"function"===typeof t?cn:an)(e,t,null==n?"":n)):un(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?ln:"function"===typeof t?fn:sn)(e,t)):this.node()[e]},classed:function(e,t){var n=dn(e+"");if(arguments.length<2){for(var r=pn(this.node()),o=-1,i=n.length;++o>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?dr(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?dr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=tr.exec(e))?new gr(t[1],t[2],t[3],1):(t=nr.exec(e))?new gr(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=rr.exec(e))?dr(t[1],t[2],t[3],t[4]):(t=or.exec(e))?dr(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ir.exec(e))?br(t[1],t[2]/100,t[3]/100,1):(t=ar.exec(e))?br(t[1],t[2]/100,t[3]/100,t[4]):cr.hasOwnProperty(e)?fr(cr[e]):"transparent"===e?new gr(NaN,NaN,NaN,0):null}function fr(e){return new gr(e>>16&255,e>>8&255,255&e,1)}function dr(e,t,n,r){return r<=0&&(e=t=n=NaN),new gr(e,t,n,r)}function pr(e){return e instanceof Kn||(e=sr(e)),e?new gr((e=e.rgb()).r,e.g,e.b,e.opacity):new gr}function hr(e,t,n,r){return 1===arguments.length?pr(e):new gr(e,t,n,null==r?1:r)}function gr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function mr(){return"#"+vr(this.r)+vr(this.g)+vr(this.b)}function yr(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function vr(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function br(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _r(e,t,n,r)}function wr(e){if(e instanceof _r)return new _r(e.h,e.s,e.l,e.opacity);if(e instanceof Kn||(e=sr(e)),!e)return new _r;if(e instanceof _r)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,c=i-o,u=(i+o)/2;return c?(a=t===i?(n-r)/c+6*(n0&&u<1?0:a,new _r(a,c,u,e.opacity)}function _r(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Er(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Gn(Kn,sr,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:ur,formatHex:ur,formatHsl:function(){return wr(this).formatHsl()},formatRgb:lr,toString:lr}),Gn(gr,hr,Fn(Kn,{brighter:function(e){return e=null==e?$n:Math.pow($n,e),new gr(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?Wn:Math.pow(Wn,e),new gr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:mr,formatHex:mr,formatRgb:yr,toString:yr})),Gn(_r,(function(e,t,n,r){return 1===arguments.length?wr(e):new _r(e,t,n,null==r?1:r)}),Fn(Kn,{brighter:function(e){return e=null==e?$n:Math.pow($n,e),new _r(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Wn:Math.pow(Wn,e),new _r(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new gr(Er(e>=240?e-240:e+120,o,r),Er(e,o,r),Er(e<120?e+240:e-120,o,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Sr=e=>()=>e;function Or(e){return 1===(e=+e)?xr:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Sr(isNaN(t)?n:t)}}function xr(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Sr(isNaN(e)?t:e)}var Mr=function e(t){var n=Or(t);function r(e,t){var r=n((e=hr(e)).r,(t=hr(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),a=xr(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Cr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Nr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pr=new RegExp(Nr.source,"g");function Dr(e,t){var n,r,o,i=Nr.lastIndex=Pr.lastIndex=0,a=-1,c=[],u=[];for(e+="",t+="";(n=Nr.exec(e))&&(r=Pr.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),c[a]?c[a]+=o:c[++a]=o),(n=n[0])===(r=r[0])?c[a]?c[a]+=r:c[++a]=r:(c[++a]=null,u.push({i:a,x:Cr(n,r)})),i=Pr.lastIndex;return i180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:Cr(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(i.rotate,a.rotate,c,u),function(e,t,n,i){e!==t?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:Cr(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(i.skewX,a.skewX,c,u),function(e,t,n,r,i,a){if(e!==n||t!==r){var c=i.push(o(i)+"scale(",null,",",null,")");a.push({i:c-4,x:Cr(e,n)},{i:c-2,x:Cr(t,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,c,u),i=a=null,function(e){for(var t,n=-1,r=u.length;++n=0&&t._call.call(null,e),t=t._next;--Hr}()}finally{Hr=0,function(){var e,t,n=Br,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Br=t);Yr=e,no(r)}(),Gr=0}}function to(){var e=Kr.now(),t=e-Zr;t>1e3&&(Fr-=t,Zr=e)}function no(e){Hr||(Ur&&(Ur=clearTimeout(Ur)),e-Gr>24?(e<1/0&&(Ur=setTimeout(eo,e-Kr.now()-Fr)),Vr&&(Vr=clearInterval(Vr))):(Vr||(Zr=Kr.now(),Vr=setInterval(to,1e3)),Hr=1,Wr(eo)))}function ro(e,t,n){var r=new Qr;return t=null==t?0:+t,r.restart((n=>{r.stop(),e(n+t)}),t,n),r}Qr.prototype=Jr.prototype={constructor:Qr,restart:function(e,t,n){if("function"!==typeof e)throw new TypeError("callback is not a function");n=(null==n?$r():+n)+(null==t?0:+t),this._next||Yr===this||(Yr?Yr._next=this:Br=this,Yr=this),this._call=e,this._time=n,no()},stop:function(){this._call&&(this._call=null,this._time=1/0,no())}};var oo=Et("start","end","cancel","interrupt"),io=[];function ao(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(i){var l,s,f,d;if(1!==n.state)return u();for(l in o)if((d=o[l]).name===n.name){if(3===d.state)return ro(a);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete o[l]):+l0)throw new Error("too late; already scheduled");return n}function uo(e,t){var n=lo(e,t);if(n.state>3)throw new Error("too late; already running");return n}function lo(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function so(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i)(n=i[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete e.__transition}}function fo(e,t){var n,r;return function(){var o=uo(this,e),i=o.tween;if(i!==n)for(var a=0,c=(r=n=i).length;a=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?co:uo;return function(){var a=i(this,e),c=a.on;c!==r&&(o=(r=c).copy()).on(t,n),a.on=o}}var jo=Yn.prototype.constructor;function To(e){return function(){this.style.removeProperty(e)}}function Ao(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function zo(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&Ao(e,i,n)),r}return i._value=t,i}function Io(e){return function(t){this.textContent=e.call(this,t)}}function Ro(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Io(r)),t}return r._value=e,r}var Lo=0;function Bo(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Yo(){return++Lo}var Xo=Yn.prototype;Bo.prototype={constructor:Bo,select:function(e){var t=this._name,n=this._id;"function"!==typeof e&&(e=At(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a()=>e;function Zo(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Go(e,t,n){this.k=e,this.x=t,this.y=n}Go.prototype={constructor:Go,scale:function(e){return 1===e?this:new Go(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Go(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fo=new Go(1,0,0);function Ko(e){e.stopImmediatePropagation()}function Wo(e){e.preventDefault(),e.stopImmediatePropagation()}function $o(e){return(!e.ctrlKey||"wheel"===e.type)&&!e.button}function qo(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function Qo(){return this.__zoom||Fo}function Jo(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ei(){return navigator.maxTouchPoints||"ontouchstart"in this}function ti(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}var ni,ri,oi,ii,ai,ci;!function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(ni||(ni={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(ri||(ri={})),function(e){e.Lines="lines",e.Dots="dots"}(oi||(oi={})),function(e){e.Strict="strict",e.Loose="loose"}(ii||(ii={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep"}(ai||(ai={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(ci||(ci={}));var ui=function(e,t){return e.x!==t.x||e.y!==t.y||e.zoom!==t.k},li=function(e){return{x:e.x,y:e.y,zoom:e.k}},si=function(e){var t=e.onMove,n=e.onMoveStart,o=e.onMoveEnd,i=e.zoomOnScroll,a=void 0===i||i,c=e.zoomOnPinch,u=void 0===c||c,l=e.panOnScroll,s=void 0!==l&&l,f=e.panOnScrollSpeed,d=void 0===f?.5:f,p=e.panOnScrollMode,h=void 0===p?ci.Free:p,g=e.zoomOnDoubleClick,m=void 0===g||g,y=e.selectionKeyPressed,v=e.elementsSelectable,b=e.paneMoveable,w=void 0===b||b,_=e.defaultPosition,E=void 0===_?[0,0]:_,S=e.defaultZoom,O=void 0===S?1:S,x=e.translateExtent,M=e.zoomActivationKeyCode,C=e.children,N=(0,r.useRef)(null),P=(0,r.useRef)({x:0,y:0,zoom:0}),D=Fe(),k=Ge((function(e){return e.d3Zoom})),j=Ge((function(e){return e.d3Selection})),T=Ge((function(e){return e.d3ZoomHandler})),A=Ze((function(e){return e.initD3Zoom})),z=Ze((function(e){return e.updateTransform})),I=nt(M);return function(e){var t=Ze((function(e){return e.updateSize}));(0,r.useEffect)((function(){var n,r=function(){if(e.current){var n=Je(e.current);0!==n.height&&0!==n.width||console.warn("The React Flow parent container needs a width and a height to render the graph."),t(n)}};return r(),window.onresize=r,e.current&&(n=new ResizeObserver((function(){return r()}))).observe(e.current),function(){window.onresize=null,n&&e.current&&n.unobserve(e.current)}}),[])}(N),(0,r.useEffect)((function(){if(N.current){var e=D.getState(),t="undefined"!==typeof x?x:e.translateExtent,n=function(){var e,t,n,r=$o,o=qo,i=ti,a=Jo,c=ei,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,f=Xr,d=Et("start","zoom","end"),p=500,h=0,g=10;function m(e){e.property("__zoom",Qo).on("wheel.zoom",S).on("mousedown.zoom",O).on("dblclick.zoom",x).filter(c).on("touchstart.zoom",M).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(e,t){return(t=Math.max(u[0],Math.min(u[1],t)))===e.k?e:new Go(t,e.x,e.y)}function v(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new Go(e.k,r,o)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function w(e,t,n,r){e.on("start.zoom",(function(){_(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){_(this,arguments).event(r).end()})).tween("zoom",(function(){var e=this,i=arguments,a=_(e,i).event(r),c=o.apply(e,i),u=null==n?b(c):"function"===typeof n?n.apply(e,i):n,l=Math.max(c[1][0]-c[0][0],c[1][1]-c[0][1]),s=e.__zoom,d="function"===typeof t?t.apply(e,i):t,p=f(s.invert(u).concat(l/s.k),d.invert(u).concat(l/d.k));return function(e){if(1===e)e=d;else{var t=p(e),n=l/t[2];e=new Go(n,u[0]-t[0]*n,u[1]-t[1]*n)}a.zoom(null,e)}}))}function _(e,t,n){return!n&&e.__zooming||new E(e,t)}function E(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function S(e,...t){if(r.apply(this,arguments)){var n=_(this,t).event(e),o=this.__zoom,c=Math.max(u[0],Math.min(u[1],o.k*Math.pow(2,a.apply(this,arguments)))),s=Hn(e);if(n.wheel)n.mouse[0][0]===s[0]&&n.mouse[0][1]===s[1]||(n.mouse[1]=o.invert(n.mouse[0]=s)),clearTimeout(n.wheel);else{if(o.k===c)return;n.mouse=[s,o.invert(s)],so(this),n.start()}Wo(e),n.wheel=setTimeout(f,150),n.zoom("mouse",i(v(y(o,c),n.mouse[0],n.mouse[1]),n.extent,l))}function f(){n.wheel=null,n.end()}}function O(e,...t){if(!n&&r.apply(this,arguments)){var o=_(this,t,!0).event(e),a=Xn(e.view).on("mousemove.zoom",d,!0).on("mouseup.zoom",p,!0),c=Hn(e,u),u=e.currentTarget,s=e.clientX,f=e.clientY;Vn(e.view),Ko(e),o.mouse=[c,this.__zoom.invert(c)],so(this),o.start()}function d(e){if(Wo(e),!o.moved){var t=e.clientX-s,n=e.clientY-f;o.moved=t*t+n*n>h}o.event(e).zoom("mouse",i(v(o.that.__zoom,o.mouse[0]=Hn(e,u),o.mouse[1]),o.extent,l))}function p(e){a.on("mousemove.zoom mouseup.zoom",null),Zn(e.view,o.moved),Wo(e),o.event(e).end()}}function x(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=Hn(e.changedTouches?e.changedTouches[0]:e,this),c=n.invert(a),u=n.k*(e.shiftKey?.5:2),f=i(v(y(n,u),a,c),o.apply(this,t),l);Wo(e),s>0?Xn(this).transition().duration(s).call(w,f,a,e):Xn(this).call(m.transform,f,a,e)}}function M(n,...o){if(r.apply(this,arguments)){var i,a,c,u,l=n.touches,s=l.length,f=_(this,o,n.changedTouches.length===s).event(n);for(Ko(n),a=0;a0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"===typeof window||"undefined"===typeof window.document)return"";var t=window.document.documentElement.style;if(e in t)return"";for(var n=0;n<_i.length;n++)if(Si(e,_i[n])in t)return _i[n];return""}function Si(e,t){return t?"".concat(t).concat(function(e){for(var t="",n=!0,r=0;r: Unmounted during event!");return t}var Xi={},Hi={};Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=function(){},Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.default=void 0;var Ui=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==Qi(e)&&"function"!==typeof e)return{default:e};var t=qi();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(r),Vi=$i(m.exports),Zi=$i(o),Gi=vi,Fi=Ri,Ki=bi,Wi=$i(Hi);function $i(e){return e&&e.__esModule?e:{default:e}}function qi(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return qi=function(){return e},e}function Qi(e){return(Qi="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})(e)}function Ji(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return ea(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ea(e,t)}(e,t)||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 ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n not mounted on DragStart!");var r=n.ownerDocument;if(!(e.props.disabled||!(t.target instanceof r.defaultView.Node)||e.props.handle&&!(0,Gi.matchesSelectorAndParentsTo)(t.target,e.props.handle,n)||e.props.cancel&&(0,Gi.matchesSelectorAndParentsTo)(t.target,e.props.cancel,n))){"touchstart"===t.type&&t.preventDefault();var o=(0,Gi.getTouchIdentifier)(t);e.setState({touchIdentifier:o});var i=(0,Fi.getControlPosition)(t,o,aa(e));if(null!=i){var a=i.x,c=i.y,u=(0,Fi.createCoreData)(aa(e),a,c);(0,Wi.default)("DraggableCore: handleDragStart: %j",u),(0,Wi.default)("calling",e.props.onStart),!1!==e.props.onStart(t,u)&&!1!==e.mounted&&(e.props.enableUserSelectHack&&(0,Gi.addUserSelectStyles)(r),e.setState({dragging:!0,lastX:a,lastY:c}),(0,Gi.addEvent)(r,fa.move,e.handleDrag),(0,Gi.addEvent)(r,fa.stop,e.handleDragStop))}}})),ua(aa(e),"handleDrag",(function(t){var n=(0,Fi.getControlPosition)(t,e.state.touchIdentifier,aa(e));if(null!=n){var r=n.x,o=n.y;if(Array.isArray(e.props.grid)){var i=r-e.state.lastX,a=o-e.state.lastY,c=Ji((0,Fi.snapToGrid)(e.props.grid,i,a),2);if(i=c[0],a=c[1],!i&&!a)return;r=e.state.lastX+i,o=e.state.lastY+a}var u=(0,Fi.createCoreData)(aa(e),r,o);if((0,Wi.default)("DraggableCore: handleDrag: %j",u),!1!==e.props.onDrag(t,u)&&!1!==e.mounted)e.setState({lastX:r,lastY:o});else try{e.handleDragStop(new MouseEvent("mouseup"))}catch(s){var l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e.handleDragStop(l)}}})),ua(aa(e),"handleDragStop",(function(t){if(e.state.dragging){var n=(0,Fi.getControlPosition)(t,e.state.touchIdentifier,aa(e));if(null!=n){var r=n.x,o=n.y,i=(0,Fi.createCoreData)(aa(e),r,o);if(!1===e.props.onStop(t,i)||!1===e.mounted)return!1;var a=e.findDOMNode();a&&e.props.enableUserSelectHack&&(0,Gi.removeUserSelectStyles)(a.ownerDocument),(0,Wi.default)("DraggableCore: handleDragStop: %j",i),e.setState({dragging:!1,lastX:NaN,lastY:NaN}),a&&((0,Wi.default)("DraggableCore: Removing handlers"),(0,Gi.removeEvent)(a.ownerDocument,fa.move,e.handleDrag),(0,Gi.removeEvent)(a.ownerDocument,fa.stop,e.handleDragStop))}}})),ua(aa(e),"onMouseDown",(function(t){return fa=sa,e.handleDragStart(t)})),ua(aa(e),"onMouseUp",(function(t){return fa=sa,e.handleDragStop(t)})),ua(aa(e),"onTouchStart",(function(t){return fa=la,e.handleDragStart(t)})),ua(aa(e),"onTouchEnd",(function(t){return fa=la,e.handleDragStop(t)})),e}return t=i,(n=[{key:"componentDidMount",value:function(){this.mounted=!0;var e=this.findDOMNode();e&&(0,Gi.addEvent)(e,la.start,this.onTouchStart,{passive:!1})}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.findDOMNode();if(e){var t=e.ownerDocument;(0,Gi.removeEvent)(t,sa.move,this.handleDrag),(0,Gi.removeEvent)(t,la.move,this.handleDrag),(0,Gi.removeEvent)(t,sa.stop,this.handleDragStop),(0,Gi.removeEvent)(t,la.stop,this.handleDragStop),(0,Gi.removeEvent)(e,la.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Gi.removeUserSelectStyles)(t)}}},{key:"findDOMNode",value:function(){return this.props.nodeRef?this.props.nodeRef.current:Zi.default.findDOMNode(this)}},{key:"render",value:function(){return Ui.cloneElement(Ui.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}])&&na(t.prototype,n),r&&na(t,r),i}(Ui.Component);Xi.default=da,ua(da,"displayName","DraggableCore"),ua(da,"propTypes",{allowAnyClick:Vi.default.bool,disabled:Vi.default.bool,enableUserSelectHack:Vi.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Vi.default.arrayOf(Vi.default.number),handle:Vi.default.string,cancel:Vi.default.string,nodeRef:Vi.default.object,onStart:Vi.default.func,onDrag:Vi.default.func,onStop:Vi.default.func,onMouseDown:Vi.default.func,scale:Vi.default.number,className:Ki.dontSetMe,style:Ki.dontSetMe,transform:Ki.dontSetMe}),ua(da,"defaultProps",{allowAnyClick:!1,cancel:null,disabled:!1,enableUserSelectHack:!0,offsetParent:null,handle:null,grid:null,transform:null,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return s.default}}),e.default=void 0;var t=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==h(e)&&"function"!==typeof e)return{default:e};var t=p();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(r),n=d(m.exports),i=d(o),a=d(yi.exports),c=vi,u=Ri,l=bi,s=d(Xi),f=d(Hi);function d(e){return e&&e.__esModule?e:{default:e}}function p(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return p=function(){return e},e}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})(e)}function g(){return(g=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){o=!0,i=u}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e,t)||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 b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),t}return O(r,null,[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.position,r=t.prevPropsPosition;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,f.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:_({},n)})}}]),O(r,[{key:"componentDidMount",value:function(){"undefined"!==typeof window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"findDOMNode",value:function(){return this.props.nodeRef?this.props.nodeRef.current:i.default.findDOMNode(this)}},{key:"render",value:function(){var e,n=this.props;n.axis,n.bounds;var r=n.children,o=n.defaultPosition,i=n.defaultClassName,l=n.defaultClassNameDragging,f=n.defaultClassNameDragged,d=n.position,p=n.positionOffset;n.scale;var h=y(n,["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"]),m={},v=null,b=!Boolean(d)||this.state.dragging,w=d||o,E={x:(0,u.canDragX)(this)&&b?this.state.x:w.x,y:(0,u.canDragY)(this)&&b?this.state.y:w.y};this.state.isElementSVG?v=(0,c.createSVGTransform)(E,p):m=(0,c.createCSSTransform)(E,p);var S=(0,a.default)(r.props.className||"",i,(D(e={},l,this.state.dragging),D(e,f,this.state.dragged),e));return t.createElement(s.default,g({},h,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(r),{className:S,style:_(_({},r.props.style),m),transform:v}))}}]),r}(t.Component);e.default=k,D(k,"displayName","Draggable"),D(k,"propTypes",_(_({},s.default.propTypes),{},{axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe})),D(k,"defaultProps",_(_({},s.default.defaultProps),{},{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},position:null,scale:1}))}(mi);var pa=mi.default,ha=mi.DraggableCore;gi.exports=pa,gi.exports.default=pa;var ga=gi.exports.DraggableCore=ha,ma=gi.exports;function ya(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function va(e){for(var t=1;tr?t-f:t+f,p=l?0:Math.abs(o-n);return[d,n2&&void 0!==arguments[2]?arguments[2]:null,r=((null===n||void 0===n?void 0:n.x)||0)+t.__rf.position.x,o=((null===n||void 0===n?void 0:n.y)||0)+t.__rf.position.y,i=(null===n||void 0===n?void 0:n.width)||t.__rf.width,a=(null===n||void 0===n?void 0:n.height)||t.__rf.height;switch(e){case ni.Top:return{x:r+i/2,y:o};case ni.Right:return{x:r+i,y:o+a/2};case ni.Bottom:return{x:r+i/2,y:o+a};case ni.Left:return{x:r,y:o+a/2}}}function ic(e,t){if(!e)return null;var n=null;return 1!==e.length&&t?t&&(n=e.find((function(e){return e.id===t}))):n=e[0],"undefined"===typeof n?null:n}var ac=function(e){var t=e.edge,n=e.props,o=e.nodes,i=e.selectedElements,a=e.elementsSelectable,c=e.transform,u=e.width,l=e.height,s=e.onlyRenderVisibleElements,f=e.connectionMode,d=t.sourceHandle||null,p=t.targetHandle||null,h=function(e,t){return t.reduce((function(t,n){return n.id===e.source&&(t.sourceNode=n),n.id===e.target&&(t.targetNode=n),t}),{sourceNode:null,targetNode:null})}(t,o),g=h.sourceNode,m=h.targetNode,y=(0,r.useCallback)((function(e){var r;null===(r=n.onEdgeUpdate)||void 0===r||r.call(n,t,e)}),[t]);if(!g)return console.warn("couldn't create edge for source id: ".concat(t.source,"; edge id: ").concat(t.id)),null;if(!m)return console.warn("couldn't create edge for target id: ".concat(t.target,"; edge id: ").concat(t.id)),null;if(!g.__rf.width||!m.__rf.width)return null;var v=t.type||"default",b=n.edgeTypes[v]||n.edgeTypes.default,w=m.__rf.handleBounds,_=f===ii.Strict?w.target:w.target||w.source,E=ic(g.__rf.handleBounds.source,d),S=ic(_,p),O=E?E.position:ni.Bottom,x=S?S.position:ni.Top;if(!E)return console.warn("couldn't create edge for source handle id: ".concat(d,"; edge id: ").concat(t.id)),null;if(!S)return console.warn("couldn't create edge for target handle id: ".concat(p,"; edge id: ").concat(t.id)),null;var M=function(e,t,n,r,o,i){var a=oc(n,e,t),c=oc(i,r,o);return{sourceX:a.x,sourceY:a.y,targetX:c.x,targetY:c.y}}(g,E,O,m,S,x),C=M.sourceX,N=M.sourceY,P=M.targetX,D=M.targetY;if(!(!s||function(e){var t=e.sourcePos,n=e.targetPos,r=e.width,o=e.height,i=e.transform,a={x:Math.min(t.x,n.x),y:Math.min(t.y,n.y),x2:Math.max(t.x,n.x),y2:Math.max(t.y,n.y)};a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);var c=dt({x:(0-i[0])/i[2],y:(0-i[1])/i[2],width:r/i[2],height:o/i[2]}),u=Math.max(0,Math.min(c.x2,a.x2)-Math.max(c.x,a.x)),l=Math.max(0,Math.min(c.y2,a.y2)-Math.max(c.y,a.y));return Math.ceil(u*l)>0}({sourcePos:{x:C,y:N},targetPos:{x:P,y:D},width:u,height:l,transform:c})))return null;var k=(null===i||void 0===i?void 0:i.some((function(e){return it(e)&&e.id===t.id})))||!1;return r.createElement(b,{key:t.id,id:t.id,className:t.className,type:t.type,data:t.data,onClick:n.onElementClick,selected:k,animated:t.animated,label:t.label,labelStyle:t.labelStyle,labelShowBg:t.labelShowBg,labelBgStyle:t.labelBgStyle,labelBgPadding:t.labelBgPadding,labelBgBorderRadius:t.labelBgBorderRadius,style:t.style,arrowHeadType:t.arrowHeadType,source:t.source,target:t.target,sourceHandleId:d,targetHandleId:p,sourceX:C,sourceY:N,targetX:P,targetY:D,sourcePosition:O,targetPosition:x,elementsSelectable:a,markerEndId:n.markerEndId,isHidden:t.isHidden,onConnectEdge:y,handleEdgeUpdate:"undefined"!==typeof n.onEdgeUpdate,onContextMenu:n.onEdgeContextMenu,onMouseEnter:n.onEdgeMouseEnter,onMouseMove:n.onEdgeMouseMove,onMouseLeave:n.onEdgeMouseLeave,edgeUpdaterRadius:n.edgeUpdaterRadius,onEdgeDoubleClick:n.onEdgeDoubleClick,onEdgeUpdateStart:n.onEdgeUpdateStart,onEdgeUpdateEnd:n.onEdgeUpdateEnd})},cc=function(e){var t=Ge((function(e){return e.transform})),n=Ge((function(e){return e.nodes})),o=Ge((function(e){return e.edges})),i=Ge((function(e){return e.connectionNodeId})),a=Ge((function(e){return e.connectionHandleId})),c=Ge((function(e){return e.connectionHandleType})),u=Ge((function(e){return e.connectionPosition})),l=Ge((function(e){return e.selectedElements})),s=Ge((function(e){return e.nodesConnectable})),f=Ge((function(e){return e.elementsSelectable})),d=Ge((function(e){return e.width})),p=Ge((function(e){return e.height}));if(!d)return null;var h=e.connectionLineType,g=e.arrowHeadColor,m=e.connectionLineStyle,y=e.connectionLineComponent,v=e.onlyRenderVisibleElements,b="translate(".concat(t[0],",").concat(t[1],") scale(").concat(t[2],")"),w=i&&c;return r.createElement("svg",{width:d,height:p,className:"react-flow__edges"},r.createElement(Va,{color:g}),r.createElement("g",{transform:b},o.map((function(o){return r.createElement(ac,{key:o.id,edge:o,props:e,nodes:n,selectedElements:l,elementsSelectable:f,transform:t,width:d,height:p,onlyRenderVisibleElements:v})})),w&&r.createElement(Ha,{nodes:n,connectionNodeId:i,connectionHandleId:a,connectionHandleType:c,connectionPositionX:u.x,connectionPositionY:u.y,transform:t,connectionLineStyle:m,connectionLineType:h,isConnectable:s,CustomConnectionLineComponent:y})))};cc.displayName="EdgeRenderer";var uc=(0,r.memo)(cc),lc=.1,sc={zoomIn:function(){},zoomOut:function(){},zoomTo:function(e){},transform:function(e){},fitView:function(){},setCenter:function(e,t){},fitBounds:function(e){},project:function(e){return e},initialized:!1},fc=function(){var e=Fe(),t=Ge((function(e){return e.d3Zoom})),n=Ge((function(e){return e.d3Selection}));return(0,r.useMemo)((function(){return n&&t?{zoomIn:function(){return t.scaleBy(n,1.2)},zoomOut:function(){return t.scaleBy(n,1/1.2)},zoomTo:function(e){return t.scaleTo(n,e)},transform:function(e){var r=Fo.translate(e.x,e.y).scale(e.zoom);t.transform(n,r)},fitView:function(){var r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{padding:lc,includeHiddenNodes:!1},i=e.getState(),a=i.nodes,c=i.width,u=i.height,l=i.minZoom,s=i.maxZoom;if(a.length){var f=ht(o.includeHiddenNodes?a:a.filter((function(e){return!e.isHidden}))),d=wt(f,c,u,l,s,null!==(r=o.padding)&&void 0!==r?r:lc),p=qe(d,3),h=p[0],g=p[1],m=p[2],y=Fo.translate(h,g).scale(m);t.transform(n,y)}},setCenter:function(r,o,i){var a=e.getState(),c=a.width,u=a.height,l=a.maxZoom,s="undefined"!==typeof i?i:l,f=c/2-r*s,d=u/2-o*s,p=Fo.translate(f,d).scale(s);t.transform(n,p)},fitBounds:function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lc,i=e.getState(),a=i.width,c=i.height,u=i.minZoom,l=i.maxZoom,s=wt(r,a,c,u,l,o),f=qe(s,3),d=f[0],p=f[1],h=f[2],g=Fo.translate(d,p).scale(h);t.transform(n,g)},project:function(t){var n=e.getState(),r=n.transform,o=n.snapToGrid,i=n.snapGrid;return ct(t,r,o,i)},initialized:!0}:sc}),[t,n])},dc=function(e){var t=e.nodeTypes,n=e.edgeTypes,o=e.onMove,i=e.onMoveStart,a=e.onMoveEnd,c=e.onLoad,u=e.onElementClick,l=e.onNodeDoubleClick,s=e.onEdgeDoubleClick,f=e.onNodeMouseEnter,d=e.onNodeMouseMove,p=e.onNodeMouseLeave,h=e.onNodeContextMenu,g=e.onNodeDragStart,m=e.onNodeDrag,y=e.onNodeDragStop,v=e.onSelectionDragStart,b=e.onSelectionDrag,w=e.onSelectionDragStop,_=e.onSelectionContextMenu,E=e.connectionMode,S=e.connectionLineType,O=e.connectionLineStyle,x=e.connectionLineComponent,M=e.selectionKeyCode,C=e.multiSelectionKeyCode,N=e.zoomActivationKeyCode,P=e.onElementsRemove,D=e.deleteKeyCode,k=e.onConnect,j=e.onConnectStart,T=e.onConnectStop,A=e.onConnectEnd,z=e.snapToGrid,I=e.snapGrid,R=e.onlyRenderVisibleElements,L=e.nodesDraggable,B=e.nodesConnectable,Y=e.elementsSelectable,X=e.selectNodesOnDrag,H=e.minZoom,U=e.maxZoom,V=e.defaultZoom,Z=e.defaultPosition,G=e.translateExtent,F=e.nodeExtent,K=e.arrowHeadColor,W=e.markerEndId,$=e.zoomOnScroll,q=e.zoomOnPinch,Q=e.panOnScroll,J=e.panOnScrollSpeed,ee=e.panOnScrollMode,te=e.zoomOnDoubleClick,ne=e.paneMoveable,re=e.onPaneClick,oe=e.onPaneScroll,ie=e.onPaneContextMenu,ae=e.onEdgeUpdate,ce=e.onEdgeContextMenu,ue=e.onEdgeMouseEnter,le=e.onEdgeMouseMove,se=e.onEdgeMouseLeave,fe=e.edgeUpdaterRadius,de=e.onEdgeUpdateStart,pe=e.onEdgeUpdateEnd,he=(0,r.useRef)(!1),ge=Ze((function(e){return e.setOnConnect})),me=Ze((function(e){return e.setOnConnectStart})),ye=Ze((function(e){return e.setOnConnectStop})),ve=Ze((function(e){return e.setOnConnectEnd})),be=Ze((function(e){return e.setSnapGrid})),we=Ze((function(e){return e.setSnapToGrid})),_e=Ze((function(e){return e.setNodesDraggable})),Ee=Ze((function(e){return e.setNodesConnectable})),Se=Ze((function(e){return e.setElementsSelectable})),Oe=Ze((function(e){return e.setMinZoom})),xe=Ze((function(e){return e.setMaxZoom})),Me=Ze((function(e){return e.setTranslateExtent})),Ce=Ze((function(e){return e.setNodeExtent})),Ne=Ze((function(e){return e.setConnectionMode})),Pe=Fe(),De=fc(),ke=De.zoomIn,je=De.zoomOut,Te=De.zoomTo,Ae=De.transform,ze=De.fitView,Ie=De.initialized;return(0,r.useEffect)((function(){!he.current&&Ie&&(c&&c({fitView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{padding:.1};return ze(e)},zoomIn:ke,zoomOut:je,zoomTo:Te,setTransform:Ae,project:ut(Pe),getElements:vt(Pe),toObject:bt(Pe)}),he.current=!0)}),[c,ke,je,Te,Ae,ze,Ie]),(0,r.useEffect)((function(){k&&ge(k)}),[k]),(0,r.useEffect)((function(){j&&me(j)}),[j]),(0,r.useEffect)((function(){T&&ye(T)}),[T]),(0,r.useEffect)((function(){A&&ve(A)}),[A]),(0,r.useEffect)((function(){"undefined"!==typeof z&&we(z)}),[z]),(0,r.useEffect)((function(){"undefined"!==typeof I&&be(I)}),[I]),(0,r.useEffect)((function(){"undefined"!==typeof L&&_e(L)}),[L]),(0,r.useEffect)((function(){"undefined"!==typeof B&&Ee(B)}),[B]),(0,r.useEffect)((function(){"undefined"!==typeof Y&&Se(Y)}),[Y]),(0,r.useEffect)((function(){"undefined"!==typeof H&&Oe(H)}),[H]),(0,r.useEffect)((function(){"undefined"!==typeof U&&xe(U)}),[U]),(0,r.useEffect)((function(){"undefined"!==typeof G&&Me(G)}),[G]),(0,r.useEffect)((function(){"undefined"!==typeof F&&Ce(F)}),[F]),(0,r.useEffect)((function(){"undefined"!==typeof E&&Ne(E)}),[E]),r.createElement(_a,{onPaneClick:re,onPaneContextMenu:ie,onPaneScroll:oe,onElementsRemove:P,deleteKeyCode:D,selectionKeyCode:M,multiSelectionKeyCode:C,zoomActivationKeyCode:N,elementsSelectable:Y,onMove:o,onMoveStart:i,onMoveEnd:a,zoomOnScroll:$,zoomOnPinch:q,zoomOnDoubleClick:te,panOnScroll:Q,panOnScrollSpeed:J,panOnScrollMode:ee,paneMoveable:ne,defaultPosition:Z,defaultZoom:V,translateExtent:G,onSelectionDragStart:v,onSelectionDrag:b,onSelectionDragStop:w,onSelectionContextMenu:_},r.createElement(Sa,{nodeTypes:t,onElementClick:u,onNodeDoubleClick:l,onNodeMouseEnter:f,onNodeMouseMove:d,onNodeMouseLeave:p,onNodeContextMenu:h,onNodeDragStop:y,onNodeDrag:m,onNodeDragStart:g,selectNodesOnDrag:X,snapToGrid:z,snapGrid:I,onlyRenderVisibleElements:R}),r.createElement(uc,{edgeTypes:n,onElementClick:u,onEdgeDoubleClick:s,connectionLineType:S,connectionLineStyle:O,connectionLineComponent:x,connectionMode:E,arrowHeadColor:K,markerEndId:W,onEdgeUpdate:ae,onlyRenderVisibleElements:R,onEdgeContextMenu:ce,onEdgeMouseEnter:ue,onEdgeMouseMove:le,onEdgeMouseLeave:se,onEdgeUpdateStart:de,onEdgeUpdateEnd:pe,edgeUpdaterRadius:fe}))};dc.displayName="GraphView";var pc=(0,r.memo)(dc),hc=function(e){var t=e.elements,n=Ze((function(e){return e.setElements}));return(0,r.useEffect)((function(){n(t)}),[t]),null},gc=(0,r.createContext)(null),mc=gc.Provider;function yc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}gc.Consumer;var vc=function(){return!0},bc=function(e){var t=e.type,n=void 0===t?"source":t,o=e.position,u=void 0===o?ni.Top:o,l=e.isValidConnection,s=void 0===l?vc:l,f=e.isConnectable,d=void 0===f||f,p=e.id,h=e.onConnect,g=e.children,m=e.className,y=a(e,["type","position","isValidConnection","isConnectable","id","onConnect","children","className"]),v=(0,r.useContext)(gc),b=Ze((function(e){return e.setConnectionPosition})),w=Ze((function(e){return e.setConnectionNodeId})),_=Ge((function(e){return e.onConnect})),E=Ge((function(e){return e.onConnectStart})),S=Ge((function(e){return e.onConnectStop})),O=Ge((function(e){return e.onConnectEnd})),x=Ge((function(e){return e.connectionMode})),M=p||null,C="target"===n,N=(0,r.useCallback)((function(e){null===_||void 0===_||_(e),null===h||void 0===h||h(e)}),[_,h]),P=(0,r.useCallback)((function(e){qa(e,M,v,w,b,N,C,s,x,void 0,void 0,E,S,O)}),[M,v,w,b,N,C,s,x,E,S,O]),D=c(["react-flow__handle","react-flow__handle-".concat(u),"nodrag",m,{source:!C,target:C,connectable:d}]);return r.createElement("div",function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:Yc,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case me:var n=t.payload,r={nextNodes:[],nextEdges:[]},o=n.reduce((function(t,n){if(at(n)){var r=e.nodes.find((function(e){return e.id===n.id}));if(r){var o=Rc(Rc({},r),n);r.position.x===n.position.x&&r.position.y===n.position.y||(o.__rf.position=n.position),"undefined"!==typeof n.type&&n.type!==r.type&&(o.__rf.width=null),t.nextNodes.push(o)}else t.nextNodes.push(lt(n,e.nodeExtent))}else if(it(n)){var i=e.edges.find((function(e){return e.id===n.id}));i?t.nextEdges.push(Rc(Rc({},i),n)):t.nextEdges.push(st(n))}return t}),r),i=o.nextNodes,a=o.nextEdges;return Rc(Rc({},e),{},{nodes:i,edges:a});case ye:var c=e.nodes.map((function(n){var r=t.payload.find((function(e){return e.id===n.id}));if(r){var o=Je(r.nodeElement);if(o.width&&o.height&&(n.__rf.width!==o.width||n.__rf.height!==o.height||r.forceUpdate)){var i=Ac(r.nodeElement,e.transform[2]);return Rc(Rc({},n),{},{__rf:Rc(Rc(Rc({},n.__rf),o),{},{handleBounds:i})})}}return n}));return Rc(Rc({},e),{},{nodes:c});case ve:var u=t.payload,l=u.id,s=u.pos,f=s;if(e.snapToGrid){var d=qe(e.snapGrid,2),p=d[0],h=d[1];f={x:p*Math.round(s.x/p),y:h*Math.round(s.y/h)}}var g=e.nodes.map((function(e){return e.id===l?Rc(Rc({},e),{},{__rf:Rc(Rc({},e.__rf),{},{position:f})}):e}));return Rc(Rc({},e),{},{nodes:g});case be:var m=t.payload,y=m.id,v=m.diff,b=m.isDragging,w=e.nodes.map((function(t){var n;if(y===t.id||null!==(n=e.selectedElements)&&void 0!==n&&n.find((function(e){return e.id===t.id}))){var r=Rc(Rc({},t),{},{__rf:Rc(Rc({},t.__rf),{},{isDragging:b})});return v&&(r.__rf.position={x:t.__rf.position.x+v.x,y:t.__rf.position.y+v.y}),r}return t}));return Rc(Rc({},e),{},{nodes:w});case we:var _=t.payload;return Rc(Rc({},e),{},{selectionActive:!0,userSelectionRect:{width:0,height:0,startX:_.x,startY:_.y,x:_.x,y:_.y,draw:!0}});case _e:var E,S,O=t.payload,x=null!==(E=e.userSelectionRect.startX)&&void 0!==E?E:0,M=null!==(S=e.userSelectionRect.startY)&&void 0!==S?S:0,C=Rc(Rc({},e.userSelectionRect),{},{x:O.x0?D:null}:{};return Rc(Rc(Rc({},e),j),{},{userSelectionRect:C});case Ee:var T,A=null===(T=e.selectedElements)||void 0===T?void 0:T.filter((function(e){return at(e)&&e.__rf})),z=Rc(Rc({},e),{},{selectionActive:!1,userSelectionRect:Rc(Rc({},e.userSelectionRect),{},{draw:!1})});if(A&&0!==A.length){var I=ht(A);z.selectedNodesBbox=I,z.nodesSelectionActive=!0}else z.selectedElements=null,z.nodesSelectionActive=!1;return z;case Oe:var R=t.payload,L=Array.isArray(R)?R:[R],B=!jc(L,e.selectedElements),Y=B?L:e.selectedElements;return Rc(Rc({},e),{},{selectedElements:Y});case Me:var X=e.multiSelectionActive,H=e.selectedElements,U=t.payload,V=Array.isArray(U)?U:[U],Z=V;X&&(Z=H?[].concat($e(H),$e(V)):V);var G=!jc(Z,e.selectedElements),F=G?Z:e.selectedElements;return Rc(Rc({},e),{},{selectedElements:F});case Pe:var K=t.payload,W=K.d3Zoom,$=K.d3Selection,q=K.d3ZoomHandler,Q=K.transform;return Rc(Rc({},e),{},{d3Zoom:W,d3Selection:$,d3ZoomHandler:q,transform:Q});case De:var J,ee=t.payload;return null===(J=e.d3Zoom)||void 0===J||J.scaleExtent([ee,e.maxZoom]),Rc(Rc({},e),{},{minZoom:ee});case ke:var te,ne=t.payload;return null===(te=e.d3Zoom)||void 0===te||te.scaleExtent([e.minZoom,ne]),Rc(Rc({},e),{},{maxZoom:ne});case je:var re,oe=t.payload;return null===(re=e.d3Zoom)||void 0===re||re.translateExtent(oe),Rc(Rc({},e),{},{translateExtent:oe});case Ue:var ie=t.payload;return Rc(Rc({},e),{},{nodeExtent:ie,nodes:e.nodes.map((function(e){return Rc(Rc({},e),{},{__rf:Rc(Rc({},e.__rf),{},{position:tt(e.__rf.position,ie)})})}))});case de:case pe:case he:case ge:case xe:case Se:case Ce:case Ne:case Te:case Ae:case ze:case Ie:case Re:case Le:case Be:case Ye:case Xe:case He:return Rc(Rc({},e),t.payload);default:return e}}function Bc(e){return p(Lc,e)}var Yc={width:0,height:0,transform:[0,0,1],nodes:[],edges:[],selectedElements:null,selectedNodesBbox:{x:0,y:0,width:0,height:0},d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodesSelectionActive:!1,selectionActive:!1,userSelectionRect:{startX:0,startY:0,x:0,y:0,width:0,height:0,draw:!1},connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionMode:ii.Strict,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,multiSelectionActive:!1,reactFlowVersion:"9.6.0"},Xc=Bc(Yc),Hc=function(e){var t=e.children,n=(0,r.useContext)(F);return(0,r.useMemo)((function(){var e,t;return null===n||void 0===n||null===(e=n.store)||void 0===e||null===(t=e.getState())||void 0===t?void 0:t.reactFlowVersion}),[n])?r.createElement(r.Fragment,null,t):r.createElement(J,{store:Xc},t)};function Uc(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!==typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}Hc.displayName="ReactFlowWrapper";Uc(".react-flow{width:100%;height:100%;position:relative;overflow:hidden}.react-flow__pane,.react-flow__renderer,.react-flow__selectionpane{width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__renderer{z-index:4}.react-flow__selectionpane{z-index:5}.react-flow__edges,.react-flow__selection{position:absolute;top:0;left:0}.react-flow__edges{pointer-events:none;z-index:2}.react-flow__edge{pointer-events:visibleStroke;}.react-flow__edge.inactive{pointer-events:none}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edge-path{fill:none}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.react-flow__connection{pointer-events:none;}.react-flow__connection .animated{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__connection-path{fill:none}.react-flow__nodes{width:100%;height:100%;pointer-events:none;z-index:3}.react-flow__node,.react-flow__nodes{position:absolute;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:all}.react-flow__nodesselection{z-index:3;position:absolute;width:100%;height:100%;top:0;left:0;transform-origin:left top;pointer-events:none;}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:-webkit-grab;cursor:grab}.react-flow__handle{pointer-events:none;}.react-flow__handle.connectable{pointer-events:all}.react-flow__handle-bottom{top:auto;left:50%;bottom:-4px;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{top:50%;left:-4px;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__background{position:absolute;top:0;left:0;width:100%;height:100%}.react-flow__controls{position:absolute;z-index:5;bottom:10px;left:10px;}.react-flow__controls-button{width:24px;height:24px;}.react-flow__controls-button svg{width:100%}.react-flow__minimap{position:absolute;z-index:5;bottom:10px;right:10px}");function Vc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zc(e){for(var t=1;t