PageSourceSearch

https://playbooks.com/build/assets/member-node-DMumq46_.js

js playbooks.com collected 2026-10-03 23:47:25 UTC 168,839 bytes, 7 lines download raw bytes

vendor: 1,414 bytes, line 1
1import{v as Ms,r as z,j as I,c as Is}from"./app-Bda8uKs2.js";import{i as De,c as Fn,a as jn,b as As,d as Ut}from"./value-BGBiTkF3.js";import{u as ks}from"./with-selector-BLm6zFn_.js";import{c as Ps}from"./vanilla-CAvSZlFl.js";import{M as Ts}from"./member-avatar-DWyl3EEj.js";import{B as zs}from"./badge-CXkLP0kq.js";var Xn=180/Math.PI,rn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Oo(e,t,n,o,r,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Xn,skewX:Math.atan(l)*Xn,scaleX:s,scaleY:a}}var pt;function Ds(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?rn:Oo(t.a,t.b,t.c,t.d,t.e,t.f)}function $s(e){return e==null||(pt||(pt=document.createElementNS("http://www.w3.org/2000/svg","g")),pt.setAttribute("transform",e),!(e=pt.transform.baseVal.consolidate()))?rn:(e=e.matrix,Oo(e.a,e.b,e.c,e.d,e.e,e.f))}function Fo(e,t,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,f,d,h,p){if(c!==f||u!==d){var v=h.push("translate(",null,t,null,n);p.push({i:v-4,x:De(c,f)},{i:v-2,x:De(u,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(c,u,f,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(r(f)+"rotate(",null,o)-2,x:De(c,u)})):u&&f.push(r(f)+"rotate("+u+o)}
vendor: 6,473 bytes, line 1
1function a(c,u,f,d){c!==u?d.push({i:f.push(r(f)+"skewX(",null,o)-2,x:De(c,u)}):u&&f.push(r(f)+"skewX("+u+o)}function l(c,u,f,d,h,p){if(c!==f||u!==d){var v=h.push(r(h)+"scale(",null,",",null,")");p.push({i:v-4,x:De(c,f)},{i:v-2,x:De(u,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=e(c),u=e(u),i(c.translateX,c.translateY,u.translateX,u.translateY,f,d),s(c.rotate,u.rotate,f,d),a(c.skewX,u.skewX,f,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(h){for(var p=-1,v=d.length,x;++p<v;)f[(x=d[p]).i]=x.x(h);return f.join("")}}}var Hs=Fo(Ds,"px, ","px)","deg)"),Rs=Fo($s,", ",")",")"),Ls=1e-12;function Yn(e){return((e=Math.exp(e))+1/e)/2}function Bs(e){return((e=Math.exp(e))-1/e)/2}function Vs(e){return((e=Math.exp(2*e))-1)/(e+1)}const Et=(function e(t,n,o){function r(i,s){var a=i[0],l=i[1],c=i[2],u=s[0],f=s[1],d=s[2],h=u-a,p=f-l,v=h*h+p*p,x,m;if(v<Ls)m=Math.log(d/c)/t,x=function(C){return[a+C*h,l+C*p,c*Math.exp(t*C*m)]};else{var _=Math.sqrt(v),g=(d*d-c*c+o*v)/(2*c*n*_),w=(d*d-c*c-o*v)/(2*d*n*_),N=Math.log(Math.sqrt(g*g+1)-g),S=Math.log(Math.sqrt(w*w+1)-w);m=(S-N)/t,x=function(C){var k=C*m,A=Yn(N),O=c/(n*_)*(A*Vs(t*k+N)-Bs(N));return[a+O*h,l+O*p,c*A/Yn(t*k+N)]}}return x.duration=m*1e3*t/Math.SQRT2,x}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},r})(Math.SQRT2,2,4);function ie(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=ie(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Os={value:()=>{}};function $t(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new St(n)}function St(e){this._=e}function Fs(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}St.prototype=$t.prototype={constructor:St,on:function(e,t){var n=this._,o=Fs(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=js(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=Zn(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Zn(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new St(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function js(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function Zn(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=Os,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var sn="http://www.w3.org/1999/xhtml";const Wn={svg:"http://www.w3.org/2000/svg",xhtml:sn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ht(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Wn.hasOwnProperty(t)?{space:Wn[t],local:e}:e}function Xs(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===sn&&t.documentElement.namespaceURI===sn?t.createElement(e):t.createElementNS(n,e)}}function Ys(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jo(e){var t=Ht(e);return(t.local?Ys:Xs)(t)}function Zs(){}function yn(e){return e==null?Zs:function(){return this.querySelector(e)}}function Ws(e){typeof e!="function"&&(e=yn(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),l,c,u=0;u<s;++u)(l=i[u])&&(c=e.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new ce(o,this._parents)}function Gs(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qs(){return[]}function Xo(e){return e==null?qs:function(){return this.querySelectorAll(e)}}function Us(e){return function(){return Gs(e.apply(this,arguments))}}function Ks(e){typeof e=="function"?e=Us(e):e=Xo(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(o.push(e.call(l,l.__data__,c,s)),r.push(l));return new ce(o,r)}function Yo(e){return function(){return this.matches(e)}}function Zo(e){return function(t){return t.matches(e)}}var Qs=Array.prototype.find;function Js(e){return function(){return Qs.call(this.children,e)}}function ea(){return this.firstElementChild}function ta(e){return this.select(e==null?ea:Js(typeof e=="function"?e:Zo(e)))}var na=Array.prototype.filter;function oa(){return Array.from(this.children)}function ra(e){return function(){return na.call(this.children,e)}}function ia(e){return this.selectAll(e==null?oa:ra(typeof e=="function"?e:Zo(e)))}function sa(e){typeof e!="function"&&(e=Yo(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new ce(o,this._parents)}function Wo(e){return new Array(e.length)}function aa(){return new ce(this._enter||this._groups.map(Wo),this._parents)}function Mt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Mt.prototype={constructor:Mt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function ca(e){return function(){return e}}function la(e,t,n,o,r,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Mt(e,i[s]);for(;s<l;++s)(a=t[s])&&(r[s]=a)}function ua(e,t,n,o,r,i,s){var a,l,c=new Map,u=t.length,f=i.length,d=new Array(u),h;for(a=0;a<u;++a)(l=t[a])&&(d[a]=h=s.call(l,l.__data__,a,t)+"",c.has(h)?r[a]=l:c.set(h,l));for(a=0;a<f;++a)h=s.call(e,i[a],a,i)+"",(l=c.get(h))?(o[a]=l,l.__data__=i[a],c.delete(h)):n[a]=new Mt(e,i[a]);for(a=0;a<u;
vendor: 8,474 bytes, line 1
1++a)(l=t[a])&&c.get(d[a])===l&&(r[a]=l)}function da(e){return e.__data__}function fa(e,t){if(!arguments.length)return Array.from(this,da);var n=t?ua:la,o=this._parents,r=this._groups;typeof e!="function"&&(e=ca(e));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=o[c],f=r[c],d=f.length,h=ha(e.call(u,u&&u.__data__,c,o)),p=h.length,v=a[c]=new Array(p),x=s[c]=new Array(p),m=l[c]=new Array(d);n(u,f,v,x,m,h,t);for(var _=0,g=0,w,N;_<p;++_)if(w=v[_]){for(_>=g&&(g=_+1);!(N=x[g])&&++g<p;);w._next=N||null}}return s=new ce(s,o),s._enter=a,s._exit=l,s}function ha(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ga(){return new ce(this._exit||this._groups.map(Wo),this._parents)}function pa(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function ma(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=n[l],u=o[l],f=c.length,d=a[l]=new Array(f),h,p=0;p<f;++p)(h=c[p]||u[p])&&(d[p]=h);for(;l<r;++l)a[l]=n[l];return new ce(a,this._parents)}function ya(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function xa(e){e||(e=wa);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new ce(r,this._parents).order()}function wa(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function va(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function _a(){return Array.from(this)}function Ea(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function Sa(){let e=0;for(const t of this)++e;return e}function ba(){return!this.node()}function Na(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function Ca(e){return function(){this.removeAttribute(e)}}function Ma(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ia(e,t){return function(){this.setAttribute(e,t)}}function Aa(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ka(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Pa(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ta(e,t){var n=Ht(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Ma:Ca:typeof t=="function"?n.local?Pa:ka:n.local?Aa:Ia)(n,t))}function Go(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function za(e){return function(){this.style.removeProperty(e)}}function Da(e,t,n){return function(){this.style.setProperty(e,t,n)}}function $a(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Ha(e,t,n){return arguments.length>1?this.each((t==null?za:typeof t=="function"?$a:Da)(e,t,n??"")):Xe(this.node(),e)}function Xe(e,t){return e.style.getPropertyValue(t)||Go(e).getComputedStyle(e,null).getPropertyValue(t)}function Ra(e){return function(){delete this[e]}}function La(e,t){return function(){this[e]=t}}function Ba(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Va(e,t){return arguments.length>1?this.each((t==null?Ra:typeof t=="function"?Ba:La)(e,t)):this.node()[e]}function qo(e){return e.trim().split(/^|\s+/)}function xn(e){return e.classList||new Uo(e)}function Uo(e){this._node=e,this._names=qo(e.getAttribute("class")||"")}Uo.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ko(e,t){for(var n=xn(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Qo(e,t){for(var n=xn(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function Oa(e){return function(){Ko(this,e)}}function Fa(e){return function(){Qo(this,e)}}function ja(e,t){return function(){(t.apply(this,arguments)?Ko:Qo)(this,e)}}function Xa(e,t){var n=qo(e+"");if(arguments.length<2){for(var o=xn(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?ja:t?Oa:Fa)(n,t))}function Ya(){this.textContent=""}function Za(e){return function(){this.textContent=e}}function Wa(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ga(e){return arguments.length?this.each(e==null?Ya:(typeof e=="function"?Wa:Za)(e)):this.node().textContent}function qa(){this.innerHTML=""}function Ua(e){return function(){this.innerHTML=e}}function Ka(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Qa(e){return arguments.length?this.each(e==null?qa:(typeof e=="function"?Ka:Ua)(e)):this.node().innerHTML}function Ja(){this.nextSibling&&this.parentNode.appendChild(this)}function ec(){return this.each(Ja)}function tc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nc(){return this.each(tc)}function oc(e){var t=typeof e=="function"?e:jo(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function rc(){return null}function ic(e,t){var n=typeof e=="function"?e:jo(e),o=t==null?rc:typeof t=="function"?t:yn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function sc(){var e=this.parentNode;e&&e.removeChild(this)}function ac(){return this.each(sc)}function cc(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function lc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function uc(e){return this.select(e?lc:cc)}function dc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function fc(e){return function(t){e.call(this,t,this.__data__)}}function hc(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function gc(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function pc(e,t,n){return function(){var o=this.__on,r,i=fc(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function mc(e,t,n){var o=hc(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?pc:gc,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Jo(e,t,n){var o=Go(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function yc(e,t){return function(){return Jo(this,e,t)}}function xc(e,t){return function(){return Jo(this,e,t.apply(this,arguments))}}function wc(e,t){return this.each((typeof t=="function"?xc:yc)(e,t))}function*vc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var er=[null];function ce(e,t){this._groups=e,this._parents=t}function ut(){return new ce([[document.documentElement]],er)}function _c(){return this}ce.prototype=ut.prototype={constructor:ce,select:Ws,selectAll:Ks,selectChild:ta,selectChildren:ia,filter:sa,data:fa,enter
vendor: 5,276 bytes, line 1
1:aa,exit:ga,join:pa,merge:ma,selection:_c,order:ya,sort:xa,call:va,nodes:_a,node:Ea,size:Sa,empty:ba,each:Na,attr:Ta,style:Ha,property:Va,classed:Xa,text:Ga,html:Qa,raise:ec,lower:nc,append:oc,insert:ic,remove:ac,clone:uc,datum:dc,on:mc,dispatch:wc,[Symbol.iterator]:vc};function ae(e){return typeof e=="string"?new ce([[document.querySelector(e)]],[document.documentElement]):new ce([[e]],er)}function Ec(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ue(e,t){if(e=Ec(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Sc={passive:!1},ot={capture:!0,passive:!1};function Kt(e){e.stopImmediatePropagation()}function je(e){e.preventDefault(),e.stopImmediatePropagation()}function tr(e){var t=e.document.documentElement,n=ae(e).on("dragstart.drag",je,ot);"onselectstart"in t?n.on("selectstart.drag",je,ot):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function nr(e,t){var n=e.document.documentElement,o=ae(e).on("dragstart.drag",null);t&&(o.on("click.drag",je,ot),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const mt=e=>()=>e;function an(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}an.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function bc(e){return!e.ctrlKey&&!e.button}function Nc(){return this.parentNode}function Cc(e,t){return t??{x:e.x,y:e.y}}function Mc(){return navigator.maxTouchPoints||"ontouchstart"in this}function or(){var e=bc,t=Nc,n=Cc,o=Mc,r={},i=$t("start","drag","end"),s=0,a,l,c,u,f=0;function d(w){w.on("mousedown.drag",h).filter(o).on("touchstart.drag",x).on("touchmove.drag",m,Sc).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,N){if(!(u||!e.call(this,w,N))){var S=g(this,t.call(this,w,N),w,N,"mouse");S&&(ae(w.view).on("mousemove.drag",p,ot).on("mouseup.drag",v,ot),tr(w.view),Kt(w),c=!1,a=w.clientX,l=w.clientY,S("start",w))}}function p(w){if(je(w),!c){var N=w.clientX-a,S=w.clientY-l;c=N*N+S*S>f}r.mouse("drag",w)}function v(w){ae(w.view).on("mousemove.drag mouseup.drag",null),nr(w.view,c),je(w),r.mouse("end",w)}function x(w,N){if(e.call(this,w,N)){var S=w.changedTouches,C=t.call(this,w,N),k=S.length,A,O;for(A=0;A<k;++A)(O=g(this,C,w,N,S[A].identifier,S[A]))&&(Kt(w),O("start",w,S[A]))}}function m(w){var N=w.changedTouches,S=N.length,C,k;for(C=0;C<S;++C)(k=r[N[C].identifier])&&(je(w),k("drag",w,N[C]))}function _(w){var N=w.changedTouches,S=N.length,C,k;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),C=0;C<S;++C)(k=r[N[C].identifier])&&(Kt(w),k("end",w,N[C]))}function g(w,N,S,C,k,A){var O=i.copy(),D=ue(A||S,N),L,H,y;if((y=n.call(w,new an("beforestart",{sourceEvent:S,target:d,identifier:k,active:s,x:D[0],y:D[1],dx:0,dy:0,dispatch:O}),C))!=null)return L=y.x-D[0]||0,H=y.y-D[1]||0,function E(b,M,P){var T=D,R;switch(b){case"start":r[k]=E,R=s++;break;case"end":delete r[k],--s;case"drag":D=ue(P||M,N),R=s;break}O.call(b,w,new an(b,{sourceEvent:M,subject:y,target:d,identifier:k,active:R,x:D[0]+L,y:D[1]+H,dx:D[0]-T[0],dy:D[1]-T[1],dispatch:O}),C)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:mt(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:mt(w),d):t},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:mt(w),d):n},d.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:mt(!!w),d):o},d.on=function(){var w=i.on.apply(i,arguments);return w===i?d:w},d.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,d):Math.sqrt(f)},d}var Ye=0,et=0,Qe=0,rr=1e3,It,tt,At=0,Re=0,Rt=0,rt=typeof performance=="object"&&performance.now?performance:Date,ir=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function wn(){return Re||(ir(Ic),Re=rt.now()+Rt)}function Ic(){Re=0}function kt(){this._call=this._time=this._next=null}kt.prototype=sr.prototype={constructor:kt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?wn():+n)+(t==null?0:+t),!this._next&&tt!==this&&(tt?tt._next=this:It=this,tt=this),this._call=e,this._time=n,cn()},stop:function(){this._call&&(this._call=null,this._time=1/0,cn())}};function sr(e,t,n){var o=new kt;return o.restart(e,t,n),o}
vendor: 5,311 bytes, line 1
1function Ac(){wn(),++Ye;for(var e=It,t;e;)(t=Re-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ye}function Gn(){Re=(At=rt.now())+Rt,Ye=et=0;try{Ac()}finally{Ye=0,Pc(),Re=0}}function kc(){var e=rt.now(),t=e-At;t>rr&&(Rt-=t,At=e)}function Pc(){for(var e,t=It,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:It=n);tt=e,cn(o)}function cn(e){if(!Ye){et&&(et=clearTimeout(et));var t=e-Re;t>24?(e<1/0&&(et=setTimeout(Gn,e-rt.now()-Rt)),Qe&&(Qe=clearInterval(Qe))):(Qe||(At=rt.now(),Qe=setInterval(kc,rr)),Ye=1,ir(Gn))}}function qn(e,t,n){var o=new kt;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Tc=$t("start","end","cancel","interrupt"),zc=[],ar=0,Un=1,ln=2,bt=3,Kn=4,un=5,Nt=6;function Lt(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Dc(e,n,{name:t,index:o,group:r,on:Tc,tween:zc,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ar})}function vn(e,t){var n=ge(e,t);if(n.state>ar)throw new Error("too late; already scheduled");return n}function xe(e,t){var n=ge(e,t);if(n.state>bt)throw new Error("too late; already running");return n}function ge(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Dc(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=sr(i,0,n.time);function i(c){n.state=Un,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,f,d,h;if(n.state!==Un)return l();for(u in o)if(h=o[u],h.name===n.name){if(h.state===bt)return qn(s);h.state===Kn?(h.state=Nt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[u]):+u<t&&(h.state=Nt,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[u])}if(qn(function(){n.state===bt&&(n.state=Kn,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=ln,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ln){for(n.state=bt,r=new Array(d=n.tween.length),u=0,f=-1;u<d;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++f]=h);r.length=f+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=un,1),f=-1,d=r.length;++f<d;)r[f].call(e,u);n.state===un&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Nt,n.timer.stop(),delete o[t];for(var c in o)return;delete e.__transition}}function Ct(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>ln&&o.state<un,o.state=Nt,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function $c(e){return this.each(function(){Ct(this,e)})}function Hc(e,t){var n,o;return function(){var r=xe(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function Rc(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=xe(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===t){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function Lc(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=ge(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?Hc:Rc)(n,e,t))}function _n(e,t,n){var o=e._id;return e.each(function(){var r=xe(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return ge(r,o).value[t]}}function cr(e,t){var n;return(typeof t=="number"?De:t instanceof Fn?jn:(n=Fn(t))?(t=n,jn):As)(e,t)}function Bc(e){return function(){this.removeAttribute(e)}}function Vc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Oc(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function Fc(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function jc(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function Xc(e,t,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a)))}}function Yc(e,t){var n=Ht(e),o=n==="transform"?Rs:cr;return this.attrTween(e,typeof t=="function"?(n.local?Xc:jc)(n,o,_n(this,"attr."+e,t)):t==null?(n.local?Vc:Bc)(n):(n.local?Fc:Oc)(n,o,t))}function Zc(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Wc(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Gc(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Wc(e,i)),n}return r._value=t,r}function qc(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Zc(e,i)),n}return r._value=t,r}function Uc(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=Ht(e);return this.tween(n,(o.local?Gc:qc)(o,t))}function Kc(e,t){return function(){vn(this,e).delay=+t.apply(this,arguments)}}function Qc(e,t){return t=+t,function(){vn(this,e).delay=t}}
vendor: 4,932 bytes, line 1
1function Jc(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Kc:Qc)(t,e)):ge(this.node(),t).delay}function el(e,t){return function(){xe(this,e).duration=+t.apply(this,arguments)}}function tl(e,t){return t=+t,function(){xe(this,e).duration=t}}function nl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?el:tl)(t,e)):ge(this.node(),t).duration}function ol(e,t){if(typeof t!="function")throw new Error;return function(){xe(this,e).ease=t}}function rl(e){var t=this._id;return arguments.length?this.each(ol(t,e)):ge(this.node(),t).ease}function il(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;xe(this,e).ease=n}}function sl(e){if(typeof e!="function")throw new Error;return this.each(il(this._id,e))}function al(e){typeof e!="function"&&(e=Yo(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Ne(o,this._parents,this._name,this._id)}function cl(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var l=t[a],c=n[a],u=l.length,f=s[a]=new Array(u),d,h=0;h<u;++h)(d=l[h]||c[h])&&(f[h]=d);for(;a<o;++a)s[a]=t[a];return new Ne(s,this._parents,this._name,this._id)}function ll(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function ul(e,t,n){var o,r,i=ll(t)?vn:xe;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function dl(e,t){var n=this._id;return arguments.length<2?ge(this.node(),n).on.on(e):this.each(ul(n,e,t))}function fl(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function hl(){return this.on("end.remove",fl(this._id))}function gl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=yn(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,c=i[s]=new Array(l),u,f,d=0;d<l;++d)(u=a[d])&&(f=e.call(u,u.__data__,d,a))&&("__data__"in u&&(f.__data__=u.__data__),c[d]=f,Lt(c[d],t,n,d,c,ge(u,n)));return new Ne(i,this._parents,t,n)}function pl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Xo(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],c=l.length,u,f=0;f<c;++f)if(u=l[f]){for(var d=e.call(u,u.__data__,f,l),h,p=ge(u,n),v=0,x=d.length;v<x;++v)(h=d[v])&&Lt(h,t,n,v,d,p);i.push(d),s.push(u)}return new Ne(i,s,t,n)}var ml=ut.prototype.constructor;function yl(){return new ml(this._groups,this._parents)}function xl(e,t){var n,o,r;return function(){var i=Xe(this,e),s=(this.style.removeProperty(e),Xe(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function lr(e){return function(){this.style.removeProperty(e)}}function wl(e,t,n){var o,r=n+"",i;return function(){var s=Xe(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function vl(e,t,n){var o,r,i;return function(){var s=Xe(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Xe(this,e))),s===l?null:s===o&&l===r?i:(r=l,i=t(o=s,a))}}function _l(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var l=xe(this,e),c=l.on,u=l.value[i]==null?a||(a=lr(t)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function El(e,t,n){var o=(e+="")=="transform"?Hs:cr;return t==null?this.styleTween(e,xl(e,o)).on("end.style."+e,lr(e)):typeof t=="function"?this.styleTween(e,vl(e,o,_n(this,"style."+e,t))).each(_l(this._id,e)):this.styleTween(e,wl(e,o,t),n).on("end.style."+e,null)}function Sl(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function bl(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&Sl(e,s,n)),o}return i._value=t,i}function Nl(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,bl(e,t,n??""))}function Cl(e){return function(){this.textContent=e}}function Ml(e){return function(){var t=e(this);this.textContent=t??""}}function Il(e){return this.tween("text",typeof e=="function"?Ml(_n(this,"text",e)):Cl(e==null?"":e+""))}function Al(e){return function(t){this.textContent=e.call(this,t)}}function kl(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Al(r)),t}return o._value=e,o}function Pl(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,kl(e))}function Tl(){for(var e=this._name,t=this._id,n=ur(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=ge(l,t);Lt(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ne(o,this._parents,e,n)}
vendor: 8,179 bytes, line 1
1function zl(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var c=xe(this,o),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),r===0&&i()})}var Dl=0;function Ne(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function ur(){return++Dl}var Se=ut.prototype;Ne.prototype={constructor:Ne,select:gl,selectAll:pl,selectChild:Se.selectChild,selectChildren:Se.selectChildren,filter:al,merge:cl,selection:yl,transition:Tl,call:Se.call,nodes:Se.nodes,node:Se.node,size:Se.size,empty:Se.empty,each:Se.each,on:dl,attr:Yc,attrTween:Uc,style:El,styleTween:Nl,text:Il,textTween:Pl,remove:hl,tween:Lc,delay:Jc,duration:nl,ease:rl,easeVarying:sl,end:zl,[Symbol.iterator]:Se[Symbol.iterator]};function $l(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Hl={time:null,delay:0,duration:250,ease:$l};function Rl(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Ll(e){var t,n;e instanceof Ne?(t=e._id,e=e._name):(t=ur(),(n=Hl).time=wn(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&Lt(l,e,t,c,s,n||Rl(l,t));return new Ne(o,this._parents,e,t)}ut.prototype.interrupt=$c;ut.prototype.transition=Ll;const yt=e=>()=>e;function Bl(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){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:o,enumerable:!0,configurable:!0},_:{value:r}})}function be(e,t,n){this.k=e,this.x=t,this.y=n}be.prototype={constructor:be,scale:function(e){return e===1?this:new be(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new be(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 Bt=new be(1,0,0);dr.prototype=be.prototype;function dr(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Bt;return e.__zoom}function Qt(e){e.stopImmediatePropagation()}function Je(e){e.preventDefault(),e.stopImmediatePropagation()}function Vl(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Ol(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.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 Qn(){return this.__zoom||Bt}function Fl(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function jl(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xl(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function fr(){var e=Vl,t=Ol,n=Xl,o=Fl,r=jl,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Et,c=$t("start","zoom","end"),u,f,d,h=500,p=150,v=0,x=10;function m(y){y.property("__zoom",Qn).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",O).filter(r).on("touchstart.zoom",D).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(y,E,b,M){var P=y.selection?y.selection():y;P.property("__zoom",Qn),y!==P?N(y,E,b,M):P.interrupt().each(function(){S(this,arguments).event(M).start().zoom(null,typeof E=="function"?E.apply(this,arguments):E).end()})},m.scaleBy=function(y,E,b,M){m.scaleTo(y,function(){var P=this.__zoom.k,T=typeof E=="function"?E.apply(this,arguments):E;return P*T},b,M)},m.scaleTo=function(y,E,b,M){m.transform(y,function(){var P=t.apply(this,arguments),T=this.__zoom,R=b==null?w(P):typeof b=="function"?b.apply(this,arguments):b,V=T.invert(R),B=typeof E=="function"?E.apply(this,arguments):E;return n(g(_(T,B),R,V),P,s)},b,M)},m.translateBy=function(y,E,b,M){m.transform(y,function(){return n(this.__zoom.translate(typeof E=="function"?E.apply(this,arguments):E,typeof b=="function"?b.apply(this,arguments):b),t.apply(this,arguments),s)},null,M)},m.translateTo=function(y,E,b,M,P){m.transform(y,function(){var T=t.apply(this,arguments),R=this.__zoom,V=M==null?w(T):typeof M=="function"?M.apply(this,arguments):M;return n(Bt.translate(V[0],V[1]).scale(R.k).translate(typeof E=="function"?-E.apply(this,arguments):-E,typeof b=="function"?-b.apply(this,arguments):-b),T,s)},M,P)};function _(y,E){return E=Math.max(i[0],Math.min(i[1],E)),E===y.k?y:new be(E,y.x,y.y)}function g(y,E,b){var M=E[0]-b[0]*y.k,P=E[1]-b[1]*y.k;return M===y.x&&P===y.y?y:new be(y.k,M,P)}function w(y){return[(+y[0][0]+ +y[1][0])/2,(+y[0][1]+ +y[1][1])/2]}function N(y,E,b,M){y.on("start.zoom",function(){S(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(M).end()}).tween("zoom",function(){var P=this,T=arguments,R=S(P,T).event(M),V=t.apply(P,T),B=b==null?w(V):typeof b=="function"?b.apply(P,T):b,Y=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),F=P.__zoom,G=typeof E=="function"?E.apply(P,T):E,Q=l(F.invert(B).concat(Y/F.k),G.invert(B).concat(Y/G.k));return function(W){if(W===1)W=G;else{var $=Q(W),j=Y/$[2];W=new be(j,B[0]-$[0]*j,B[1]-$[1]*j)}R.zoom(null,W)}})}function S(y,E,b){return!b&&y.__zooming||new C(y,E)}function C(y,E){this.that=y,this.args=E,this.active=0,this.sourceEvent=null,this.extent=t.apply(y,E),this.taps=0}C.prototype={event:function(y){return y&&(this.sourceEvent=y),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(y,E){return this.mouse&&y!=="mouse"&&(this.mouse[1]=E.invert(this.mouse[0])),this.touch0&&y!=="touch"&&(this.touch0[1]=E.invert(this.touch0[0])),this.touch1&&y!=="touch"&&(this.touch1[1]=E.invert(this.touch1[0])),this.that.__zoom=E,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(y){var E=ae(this.that).datum();c.call(y,this.that,new Bl(y,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),E)}};function k(y,...E){if(!e.apply(this,arguments))return;var b=S(this,E).event(y),M=this.__zoom,P=Math.max(i[0],Math.min(i[1],M.k*Math.pow(2,o.apply(this,arguments)))),T=ue(y);if(b.wheel)(b.mouse[0][0]!==T[0]||b.mouse[0][1]!==T[1])&&(b.mouse[1]=M.invert(b.mouse[0]=T)),clearTimeout(b.wheel);else{if(M.k===P)return;b.mouse=[T,M.invert(T)],Ct(this),b.start()}Je(y),b.wheel=setTimeout(R,p),b.zoom("mouse",n(g(_(M,P),b.mouse[0],b.mouse[1]),b.extent,s));function R(){b.wheel=null,b.end()}}function A(y,...E){if(d||!e.apply(this,arguments))return;var b=y.currentTarget,M=S(this,E,!0).event(y),P=ae(y.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",Y,!0),T=ue(y,b),R=y.clientX,V=y.clientY;tr(y.view),Qt(y),M.mouse=[T,this.__zoom.invert(T)],Ct(this),M.start();function B(F){if(Je(F),!M.moved){var G=F.clientX-R,Q=F.clientY-V;M.moved=G*G+Q*Q>v}M.event(F).zoom("mouse",n(g(M.that.__zoom,M.mouse[0]=ue(F,b),M.mouse[1]),M.extent,s))}function Y(F){P.on("mousemove.zoom mouseup.zoom",null),nr(F.view,M.moved),Je(F),M.event(F).end()}}function O(y,...E){if(e.apply(this,arguments)){var b=this.__zoom,M=ue(y.changedTouches?y.changedTouches[0]:y,this),P=b.invert(M),T=b.k*(y.shiftKey?.5:2),R=n(g(_(b,T),M,P),t.apply(this,E),s);Je(y),a>0?ae(this).transition().duration(a).call(N,R,M,y):ae(this).call(m.transform,R,M,y)}}function D(y,...E){if(e.apply(this,arguments)){var b=y.touches,M=b.length,P=S(this,E,y.changedTouches.length===M).event(y),T,R,V,B;
1for(Qt(y),R=0;R<M;++R)V=b[R],B=ue(V,this),B=[B,this.__zoom.invert(B),V.identifier],P.touch0?!P.touch1&&P.touch0[2]!==B[2]&&(P.touch1=B,P.taps=0):(P.touch0=B,T=!0,P.taps=1+!!u);u&&(u=clearTimeout(u)),T&&(P.taps<2&&(f=B[0],u=setTimeout(function(){u=null},h)),Ct(this),P.start())}}function L(y,...E){if(this.__zooming){var b=S(this,E).event(y),M=y.changedTouches,P=M.length,T,R,V,B;for(Je(y),T=0;T<P;++T)R=M[T],V=ue(R,this),b.touch0&&b.touch0[2]===R.identifier?b.touch0[0]=V:b.touch1&&b.touch1[2]===R.identifier&&(b.touch1[0]=V);if(R=b.that.__zoom,b.touch1){var Y=b.touch0[0],F=b.touch0[1],G=b.touch1[0],Q=b.touch1[1],W=(W=G[0]-Y[0])*W+(W=G[1]-Y[1])*W,$=($=Q[0]-F[0])*$+($=Q[1]-F[1])*$;R=_(R,Math.sqrt(W/$)),V=[(Y[0]+G[0])/2,(Y[1]+G[1])/2],B=[(F[0]+Q[0])/2,(F[1]+Q[1])/2]}else if(b.touch0)V=b.touch0[0],B=b.touch0[1];else return;b.zoom("touch",n(g(R,V,B),b.extent,s))}}function H(y,...E){if(this.__zooming){var b=S(this,E).event(y),M=y.changedTouches,P=M.length,T,R;for(Qt(y),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),T=0;T<P;++T)R=M[T],b.touch0&&b.touch0[2]===R.identifier?delete b.touch0:b.touch1&&b.touch1[2]===R.identifier&&delete b.touch1;if(b.touch1&&!b.touch0&&(b.touch0=b.touch1,delete b.touch1),b.touch0)b.touch0[1]=this.__zoom.invert(b.touch0[0]);else if(b.end(),b.taps===2&&(R=ue(R,this),Math.hypot(f[0]-R[0],f[1]-R[1])<x)){var V=ae(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return m.wheelDelta=function(y){return arguments.length?(o=typeof y=="function"?y:yt(+y),m):o},m.filter=function(y){return arguments.length?(e=typeof y=="function"?y:yt(!!y),m):e},m.touchable=function(y){return arguments.length?(r=typeof y=="function"?y:yt(!!y),m):r},m.extent=function(y){return arguments.length?(t=typeof y=="function"?y:yt([[+y[0][0],+y[0][1]],[+y[1][0],+y[1][1]]]),m):t},m.scaleExtent=function(y){return arguments.length?(i[0]=+y[0],i[1]=+y[1],m):[i[0],i[1]]},m.translateExtent=function(y){return arguments.length?(s[0][0]=+y[0][0],s[1][0]=+y[1][0],s[0][1]=+y[0][1],s[1][1]=+y[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(y){return arguments.length?(n=y,m):n},m.duration=function(y){return arguments.length?(a=+y,m):a},m.interpolate=function(y){return arguments.length?(l=y,m):l},m.on=function(){var y=c.on.apply(c,arguments);return y===c?m:y},m.clickDistance=function(y){return arguments.length?(v=(y=+y)*y,m):Math.sqrt(v)},m.tapDistance=function(y){return arguments.length?(x=+y,m):x},m}const he={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},it=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],hr=["Enter"," ","Escape"],gr={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Ze;(function(e){e.Strict="strict",e.Loose="loose"})(Ze||(Ze={}));var He;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(He||(He={}));var st;(function(e){e.Partial="partial",e.Full="full"})(st||(st={}));const pr={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ae;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ae||(Ae={}));var Pt;
1(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Pt||(Pt={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const Jn={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function mr(e){return e===null?null:e?"valid":"invalid"}const yr=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,Yl=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),En=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),dt=(e,t=[0,0])=>{const{width:n,height:o}=pe(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},Zl=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const o=e.reduce((r,i)=>{const s=typeof i=="string";let a=!t.nodeLookup&&!s?i:void 0;return t.nodeLookup&&(a=s?t.nodeLookup.get(i):En(i)?i:t.nodeLookup.get(i.id)),a?(n=!0,Vt(r,Tt(a,t.nodeOrigin))):r},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Ot(o):{x:0,y:0,width:0,height:0}},ft=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=Vt(n,Tt(r)),o=!0)}),o?Ot(n):{x:0,y:0,width:0,height:0}},Sn=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a=(t.x-n)/r,l=(t.y-o)/r,c=t.width/r,u=t.height/r,f=[];for(const d of e.values()){const{measured:h,selectable:p=!0,hidden:v=!1}=d;if(s&&!p||v)continue;const x=h.width??d.width??d.initialWidth??0,m=h.height??d.height??d.initialHeight??0,{x:_,y:g}=d.internals.positionAbsolute,w=_r(a,l,c,u,_,g,x,m),N=x*m,S=i&&w>0;(!d.internals.handleBounds||S||w>=N||d.dragging)&&f.push(d)}return f},Wl=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function Gl(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{let i;if(t?.includeHiddenNodes){const{width:s,height:a}=pe(r);i=s>0&&a>0}else i=!!(r.measured.width&&r.measured.height&&!r.hidden);i&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}
1async function ql({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return!0;const a=Gl(e,s),l=ft(a),c=Nn(l,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(c,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0}function xr({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??o;let f=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",he.error005());else{const{width:h,height:p}=pe(a);h&&p&&(f=[[l,c],[l+h,c+p]])}else a&&Be(s.extent)&&(f=[[s.extent[0][0]+l,s.extent[0][1]+c],[s.extent[1][0]+l,s.extent[1][1]+c]]);const d=Be(f)?Le(t,f,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",he.error015()),{position:{x:d.x-l+(s.measured.width??0)*u[0],y:d.y-c+(s.measured.height??0)*u[1]},positionAbsolute:d}}async function Ul({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(d=>d.id)),s=[];for(const d of n){if(d.deletable===!1)continue;const h=i.has(d.id),p=!h&&d.parentId&&s.find(v=>v.id===d.parentId);(h||p)&&s.push(d)}const a=new Set(t.map(d=>d.id)),l=o.filter(d=>d.deletable!==!1),u=Wl(s,l);for(const d of l)a.has(d.id)&&!u.find(p=>p.id===d.id)&&u.push(d);if(!r)return{edges:u,nodes:s};const f=await r({nodes:s,edges:u});return typeof f=="boolean"?f?{edges:u,nodes:s}:{edges:[],nodes:[]}:f}const We=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Le=(e={x:0,y:0},t,n)=>({x:We(e.x,t[0][0],t[1][0]-(n?.width??0)),y:We(e.y,t[0][1],t[1][1]-(n?.height??0))});function wr(e,t,n){const{width:o,height:r}=pe(n),{x:i,y:s}=n.internals.positionAbsolute;return Le(e,[[i,s],[i+o,s+r]],t)}const eo=(e,t,n)=>e<t?We(Math.abs(e-t),1,t)/t:e>n?-We(Math.abs(e-n),1,t)/t:0,bn=(e,t,n=15,o=40)=>{const r=eo(e.x,o,t.width-o)*n,i=eo(e.y,o,t.height-o)*n;return[r,i]},Vt=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),dn=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),Ot=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),at=(e,t=[0,0])=>{const{x:n,y:o}=En(e)?e.internals.positionAbsolute:dt(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Tt=(e,t=[0,0])=>{const{x:n,y:o}=En(e)?e.internals.positionAbsolute:dt(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},vr=(e,t)=>Ot(Vt(dn(e),dn(t))),_r=(e,t,n,o,r,i,s,a)=>{const l=Math.max(0,Math.min(e+n,r+s)-Math.max(e,r)),c=Math.max(0,Math.min(t+o,i+a)-Math.max(t,i));return Math.ceil(l*c)},zt=(e,t)=>_r(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),to=e=>de(e.width)&&de(e.height)&&de(e.x)&&de(e.y),de=e=>!isNaN(e)&&isFinite(e),Er=(e,t)=>(n,o)=>{},ht=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),gt=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?ht(a,s):a},Ge=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Oe(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Kl(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Oe(e,n),r=Oe(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Oe(e.top??e.y??0,n),r=Oe(e.bottom??e.y??0,n),i=Oe(e.left??e.x??0,t),s=Oe(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Ql(e,t,n,o,r,i){const{x:s,y:a}=Ge(e,[t,n,o]),{x:l,y:c}=Ge({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-l,f=i-c;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(f)}}const Nn=(e,t,n,o,r,i)=>{const s=Kl(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,c=Math.min(a,l),u=We(c,o,r),f=e.x+e.width/2,d=e.y+e.height/2,h=t/2-f*u,p=n/2-d*u,v=Ql(e,h,p,u,t,n),x={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:h-x.left+x.right,y:p-x.top+x.bottom,zoom:u}},ct=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Be(e){return e!=null&&e!=="parent"}function pe(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Sr(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function br(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function no(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Jl(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function eu(e){return{...gr,...e||{}}}
1function nt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=fe(e),a=gt({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:l,y:c}=n?ht(a,t):a;return{xSnapped:l,ySnapped:c,...a}}const Cn=e=>({width:e.offsetWidth,height:e.offsetHeight}),Nr=e=>e?.getRootNode?.()||window?.document,tu=["INPUT","SELECT","TEXTAREA"];function Cr(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:tu.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Mr=e=>"clientX"in e,fe=(e,t)=>{const n=Mr(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},oo=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...Cn(s)}})};function Ir({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+r*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+o*.125,u=Math.abs(l-e),f=Math.abs(c-t);return[l,c,u,f]}function xt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ro({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case X.Left:return[t-xt(t-o,i),n];case X.Right:return[t+xt(o-t,i),n];case X.Top:return[t,n-xt(n-r,i)];case X.Bottom:return[t,n+xt(r-n,i)]}}function Ar({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top,curvature:s=.25}){const[a,l]=ro({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[c,u]=ro({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[f,d,h,p]=Ir({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${o},${r}`,f,d,h,p]}function kr({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function nu({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const s=r&&n?o+1e3:o,a=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return s+a}function ou({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=Vt(Tt(e),Tt(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return zt(s,Ot(i))>0}const ru=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,iu=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),su=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",he.error006()),t;const o=n.getEdgeId||ru;let r;return yr(e)?r={...e}:r={...e,id:o(e)},iu(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function Pr({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=kr({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const io={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},au=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},so=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function cu({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:o=X.Top,center:r,offset:i,stepPosition:s}){const a=io[t],l=io[o],c={x:e.x+a.x*i,y:e.y+a.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},f=au({source:c,sourcePosition:t,target:u}),d=f.x!==0?"x":"y",h=f[d];let p=[],v,x;const m={x:0,y:0},_={x:0,y:0},[,,g,w]=kr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*l[d]===-1){d==="x"?(v=r.x??c.x+(u.x-c.x)*s,x=r.y??(c.y+u.y)/2):(v=r.x??(c.x+u.x)/2,x=r.y??c.y+(u.y-c.y)*s);const k=[{x:v,y:c.y},{x:v,y:u.y}],A=[{x:c.x,y:x},{x:u.x,y:x}];a[d]===h?p=d==="x"?k:A:p=d==="x"?A:k}else{const k=[{x:c.x,y:u.y}],A=[{x:u.x,y:c.y}];if(d==="x"?p=a.x===h?A:k:p=a.y===h?k:A,t===o){const y=Math.abs(e[d]-n[d]
1);if(y<=i){const E=Math.min(i-1,i-y);a[d]===h?m[d]=(c[d]>e[d]?-1:1)*E:_[d]=(u[d]>n[d]?-1:1)*E}}if(t!==o){const y=d==="x"?"y":"x",E=a[d]===l[y],b=c[y]>u[y],M=c[y]<u[y];(a[d]===1&&(!E&&b||E&&M)||a[d]!==1&&(!E&&M||E&&b))&&(p=d==="x"?k:A)}const O={x:c.x+m.x,y:c.y+m.y},D={x:u.x+_.x,y:u.y+_.y},L=Math.max(Math.abs(O.x-p[0].x),Math.abs(D.x-p[0].x)),H=Math.max(Math.abs(O.y-p[0].y),Math.abs(D.y-p[0].y));L>=H?(v=(O.x+D.x)/2,x=p[0].y):(v=p[0].x,x=(O.y+D.y)/2)}const N={x:c.x+m.x,y:c.y+m.y},S={x:u.x+_.x,y:u.y+_.y};return[[e,...N.x!==p[0].x||N.y!==p[0].y?[N]:[],...p,...S.x!==p[p.length-1].x||S.y!==p[p.length-1].y?[S]:[],n],v,x,g,w]}function lu(e,t,n,o){const r=Math.min(so(e,t)/2,so(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*c},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+r*l}Q ${i},${s} ${i+r*a},${s}`}function fn({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20,stepPosition:u=.5}){const[f,d,h,p,v]=cu({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:l},offset:c,stepPosition:u});let x=`M${f[0].x} ${f[0].y}`;for(let m=1;m<f.length-1;m++)x+=lu(f[m-1],f[m],f[m+1],s);return x+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[x,d,h,p,v]}function ao(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function uu(e){const{sourceNode:t,targetNode:n}=e;if(!ao(t)||!ao(n))return null;const o=t.internals.handleBounds||co(t.handles),r=n.internals.handleBounds||co(n.handles),i=lo(o?.source??[],e.sourceHandle),s=lo(e.connectionMode===Ze.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",he.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||X.Bottom,l=s?.position||X.Top,c=Ve(t,i,a),u=Ve(n,s,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function co(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function Ve(e,t,n=X.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??pe(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case X.Top:return{x:r+s/2,y:i};case X.Right:return{x:r+s,y:i+a/2};case X.Bottom:return{x:r+s/2,y:i+a};case X.Left:return{x:r,y:i+a/2}}}function lo(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function hn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function du(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(l=>{if(l&&typeof l=="object"){const c=hn(l,t);i.has(c)||(s.push({id:c,color:l.color||n,...l}),i.add(c))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Tr=1e3,fu=10,Mn={nodeOrigin:[0,0],nodeExtent:it,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},hu={...Mn,checkEquality:!0};function In(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function gu(e,t,n){const o=In(Mn,n);for(const r of e.values())if(r.parentId)kn(r,e,t,o);else{const i=dt(r,o.nodeOrigin),s=Be(r.extent)?r.extent:o.nodeExtent,a=Le(i,s,pe(r));r.internals.positionAbsolute=a}}function pu(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function An(e){return e==="manual"}function gn(e,t,n,o={}){const r=In(hu,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!An(r.zIndexMode)?Tr:0;let l=e.length>0,c=!1;t.clear(),n.clear();for(const u of e){let f=s.get(u.id);if(r.checkEquality&&u===f?.internals.userNode)t.set(u.id,f);else{const d=dt(u,r.nodeOrigin),h=Be(u.extent)?u.extent:r.nodeExtent,p=Le(d,h,pe(u));f={...r.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:p,handleBounds:pu(u,f),z:zr(u,a,r.zIndexMode),userNode:u}},t.set(u.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(l=!1),u.parentId&&kn(f,t,n,o,i),c||=u.selected??!1}return{nodesInitialized:l,hasSelectedNodes:c}}function mu(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function kn(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:l}=In(Mn,o),c=e.parentId,u=t.get(c);if(!u){console.warn(`Parent node ${c}
1 not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}mu(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&l==="auto"&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*fu),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const f=i&&!An(l)?Tr:0,{x:d,y:h,z:p}=yu(e,u,s,a,f,l),{positionAbsolute:v}=e.internals,x=d!==v.x||h!==v.y;(x||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:d,y:h}:v,z:p}})}function zr(e,t,n){const o=de(e.zIndex)?e.zIndex:0;return An(n)?o:o+(e.selected?t:0)}function yu(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,l=pe(e),c=dt(e,n),u=Be(e.extent)?Le(c,e.extent,l):c;let f=Le({x:s+u.x,y:a+u.y},o,l);e.extent==="parent"&&(f=wr(f,l,t));const d=zr(e,r,i),h=t.internals.z??0;return{x:f.x,y:f.y,z:h>=d?h+1:d}}function Pn(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const l=i.get(s.parentId)?.expandedRect??at(a),c=vr(l,s.rect);i.set(s.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},l)=>{const c=a.internals.positionAbsolute,u=pe(a),f=a.origin??o,d=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,h=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,p=Math.max(u.width,Math.round(s.width)),v=Math.max(u.height,Math.round(s.height)),x=(p-u.width)*f[0],m=(v-u.height)*f[1];(d>0||h>0||x||m)&&(r.push({id:l,type:"position",position:{x:a.position.x-d+x,y:a.position.y-h+m}}),n.get(l)?.forEach(_=>{e.some(g=>g.id===_.id)||r.push({id:_.id,type:"position",position:{x:_.position.x+d,y:_.position.y+h}})})),(u.width<s.width||u.height<s.height||d||h)&&r.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:p+(d?f[0]*d-x:0),height:v+(h?f[1]*h-m:0)}})}),r}function xu(e,t,n,o,r,i,s){const a=o?.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(a),{m22:f}=new window.DOMMatrixReadOnly(u.transform),d=[];for(const h of e.values()){const p=t.get(h.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),l=!0;continue}const v=Cn(h.nodeElement),x=p.measured.width!==v.width||p.measured.height!==v.height;if(!!(v.width&&v.height&&(x||!p.internals.handleBounds||h.force))){const _=h.nodeElement.getBoundingClientRect(),g=Be(p.extent)?p.extent:i;let{positionAbsolute:w}=p.internals;if(p.parentId&&p.extent==="parent"){const S=t.get(p.parentId);S&&(w=wr(w,v,S))}else g&&(w=Le(w,g,v));const N={...p,measured:v,internals:{...p.internals,positionAbsolute:w,handleBounds:{source:oo("source",h.nodeElement,_,f,p.id),target:oo("target",h.nodeElement,_,f,p.id)}}};t.set(p.id,N),p.parentId&&kn(N,t,n,{nodeOrigin:r,zIndexMode:s}),l=!0,x&&(c.push({id:p.id,type:"dimensions",dimensions:v}),p.expandParent&&p.parentId&&d.push({id:p.id,parentId:p.parentId,rect:at(N,r)}))}}if(d.length>0){const h=Pn(d,t,n,r);c.push(...h)}return{changes:c,updatedInternals:l}}async function wu({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function uo(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),i){s=`${r}-${e}-${i}`;const c=o.get(s)||new Map;o.set(s,c.set(n,t))}}function Dr(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},c=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;uo("source",l,u,e,r,s),uo("target",l,c,e,i,a),t.set(o.id,o)}}function $r(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:$r(n,t):!1}function fo(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function vu(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!$r(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function Jt({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const l=n.get(s)?.internals.userNode;l&&r.push({...l,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function _u({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=ht(i,t);return{x:s.x-i.x,y:s.y-i.y}}function Eu({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null}
1,s=0,a=new Map,l=!1,c={x:0,y:0},u=null,f=!1,d=null,h=!1,p=!1,v=null;function x({noDragClassName:_,handleSelector:g,domNode:w,isSelectable:N,nodeId:S,nodeClickDistance:C=0}){d=ae(w);function k({x:L,y:H}){const{nodeLookup:y,nodeExtent:E,snapGrid:b,snapToGrid:M,nodeOrigin:P,onNodeDrag:T,onSelectionDrag:R,onError:V,updateNodePositions:B}=t();i={x:L,y:H};let Y=!1;const F=a.size>1,G=F&&E?dn(ft(a)):null,Q=F&&M?_u({dragItems:a,snapGrid:b,x:L,y:H}):null;for(const[W,$]of a){if(!y.has(W))continue;let j={x:L-$.distance.x,y:H-$.distance.y};M&&(j=Q?{x:Math.round(j.x+Q.x),y:Math.round(j.y+Q.y)}:ht(j,b));let K=null;if(F&&E&&!$.extent&&G){const{positionAbsolute:q}=$.internals,J=q.x-G.x+E[0][0],te=q.x+$.measured.width-G.x2+E[1][0],oe=q.y-G.y+E[0][1],se=q.y+$.measured.height-G.y2+E[1][1];K=[[J,oe],[te,se]]}const{position:U,positionAbsolute:Z}=xr({nodeId:W,nextPosition:j,nodeLookup:y,nodeExtent:K||E,nodeOrigin:P,onError:V});Y=Y||$.position.x!==U.x||$.position.y!==U.y,$.position=U,$.internals.positionAbsolute=Z}if(p=p||Y,!!Y&&(B(a,!0),v&&(o||T||!S&&R))){const[W,$]=Jt({nodeId:S,dragItems:a,nodeLookup:y});o?.(v,a,W,$),T?.(v,W,$),S||R?.(v,$)}}async function A(){if(!u)return;const{transform:L,panBy:H,autoPanSpeed:y,autoPanOnNodeDrag:E}=t();if(!E){l=!1,cancelAnimationFrame(s);return}const[b,M]=bn(c,u,y);(b!==0||M!==0)&&(i.x=(i.x??0)-b/L[2],i.y=(i.y??0)-M/L[2],await H({x:b,y:M})&&k(i)),s=requestAnimationFrame(A)}function O(L){const{nodeLookup:H,multiSelectionActive:y,nodesDraggable:E,transform:b,snapGrid:M,snapToGrid:P,selectNodesOnDrag:T,onNodeDragStart:R,onSelectionDragStart:V,unselectNodesAndEdges:B}=t();f=!0,(!T||!N)&&!y&&S&&(H.get(S)?.selected||B()),N&&T&&S&&e?.(S);const Y=nt(L.sourceEvent,{transform:b,snapGrid:M,snapToGrid:P,containerBounds:u});if(i=Y,a=vu(H,E,Y,S),a.size>0&&(n||R||!S&&V)){const[F,G]=Jt({nodeId:S,dragItems:a,nodeLookup:H});n?.(L.sourceEvent,a,F,G),R?.(L.sourceEvent,F,G),S||V?.(L.sourceEvent,G)}}const D=or().clickDistance(C).on("start",L=>{const{domNode:H,nodeDragThreshold:y,transform:E,snapGrid:b,snapToGrid:M}=t();u=H?.getBoundingClientRect()||null,h=!1,p=!1,v=L.sourceEvent,y===0&&O(L),i=nt(L.sourceEvent,{transform:E,snapGrid:b,snapToGrid:M,containerBounds:u}),c=fe(L.sourceEvent,u)}).on("drag",L=>
1{const{autoPanOnNodeDrag:H,transform:y,snapGrid:E,snapToGrid:b,nodeDragThreshold:M,nodeLookup:P}=t(),T=nt(L.sourceEvent,{transform:y,snapGrid:E,snapToGrid:b,containerBounds:u});if(v=L.sourceEvent,(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||S&&!P.has(S))&&(h=!0),!h){if(!l&&H&&f&&(l=!0,A()),!f){const R=fe(L.sourceEvent,u),V=R.x-c.x,B=R.y-c.y;Math.sqrt(V*V+B*B)>M&&O(L)}(i.x!==T.xSnapped||i.y!==T.ySnapped)&&a&&f&&(c=fe(L.sourceEvent,u),k(T))}}).on("end",L=>{if(!f||h){h&&a.size>0&&t().updateNodePositions(a,!1);return}if(l=!1,f=!1,cancelAnimationFrame(s),a.size>0){const{nodeLookup:H,updateNodePositions:y,onNodeDragStop:E,onSelectionDragStop:b}=t();if(p&&(y(a,!1),p=!1),r||E||!S&&b){const[M,P]=Jt({nodeId:S,dragItems:a,nodeLookup:H,dragging:!1});r?.(L.sourceEvent,a,M,P),E?.(L.sourceEvent,M,P),S||b?.(L.sourceEvent,P)}}}).filter(L=>{const H=L.target;return!L.button&&(!_||!fo(H,`.${_}`,w))&&(!g||fo(H,g,w))});d.call(D)}function m(){d?.on(".drag",null)}return{update:x,destroy:m}}function Su(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())zt(r,at(i))>0&&o.push(i);return o}const bu=250;function Nu(e,t,n,o){let r=[],i=1/0;const s=Su(e,n,t+bu);for(const a of s){const l=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const c of l){if(o.nodeId===c.nodeId&&o.type===c.type&&o.id===c.id)continue;const{x:u,y:f}=Ve(a,c,c.position,!0),d=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(f-e.y,2));d>t||(d<i?(r=[{...c,x:u,y:f}],i=d):d===i&&r.push({...c,x:u,y:f}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(l=>l.type===a)??r[0]}return r[0]}function Hr(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],l=(n?a?.find(c=>c.id===n):a?.[0])??null;return l&&i?{...l,...Ve(s,l,l.position,!0)}:l}function Rr(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Cu(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Lr=()=>!0;function Mu(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:f,panBy:d,cancelConnection:h,onConnectStart:p,onConnect:v,onConnectEnd:x,isValidConnection:m=Lr,onReconnectEnd:_,updateConnection:g,getTransform:w,getFromHandle:N,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:k}){const A=Nr(e.target);let O=0,D;const{x:L,y:H}=fe(e),y=Rr(i,k),E=a?.getBoundingClientRect();let b=!1;if(!E||!y)return;const M=Hr(r,y,o,l,t);if(!M)return;let P=fe(e,E),T=!1,R=null,V=!1,B=null;function Y(){if(!u||!E)return;const[U,Z]=bn(P,E,S);d({x:U,y:Z}),O=requestAnimationFrame(Y)}const F={...M,nodeId:r,type:y,position:M.position},G=l.get(r);let W={inProgress:!0,isValid:null,from:Ve(G,F,X.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:G,to:P,toHandle:null,toPosition:Jn[F.position],toNode:null,pointer:P};function $(){b=!0,g(W),p?.(e,{nodeId:r,handleId:o,handleType:y})}C===0&&$();function j(U){if(!b){const{x:se,y:we}=fe(U),me=se-L,ye=we-H;if(!(me*me+ye*ye>C*C))return;$()}if(!N()||!F){K(U);return}const Z=w();P=fe(U,E),D=Nu(gt(P,Z,!1,[1,1]),n,l,F),T||(Y(),T=!0);const q=Br(U,{handle:D,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:m,doc:A,lib:c,flowId:f,nodeLookup:l});B=q.handleDomNode,R=q.connection,V=Cu(!!D,q.isValid);const J=l.get(r),te=J?Ve(J,F,X.Left,!0):W.from,oe={...W,from:te,isValid:V,to:q.toHandle&&V?Ge({x:q.toHandle.x,y:q.toHandle.y},Z):P,toHandle:q.toHandle,toPosition:V&&q.toHandle?q.toHandle.position:Jn[F.position],toNode:q.toHandle?l.get(q.toHandle.nodeId):null,pointer:P};g(oe),W=oe}function K(U){if(!("touches"in U&&U.touches.length>0)){if(b){(D||B)&&R&&V&&v?.(R);const{inProgress:Z,...q}=W,J={...q,toPosition:W.toHandle?W.toPosition:null};x?.(U,J),i&&_?.(U,J)}h(),cancelAnimationFrame(O),T=!1,V=!1,R=null,B=null,A.removeEventListener("mousemove",j),A.removeEventListener("mouseup",K),A.removeEventListener("touchmove",j),A.removeEventListener("touchend",K)}}A.addEventListener("mousemove",j),A.addEventListener("mouseup",K),A.addEventListener("touchmove",j),A.addEventListener("touchend",K)}function Br(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:c=Lr,nodeLookup:u}){const f=i==="target",d=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:p}=fe(e),v=s.elementFromPoint(h,p),x=v?.classList.contains(`${a}
1-flow__handle`)?v:d,m={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const _=Rr(void 0,x),g=x.getAttribute("data-nodeid"),w=x.getAttribute("data-handleid"),N=x.classList.contains("connectable"),S=x.classList.contains("connectableend");if(!g||!_)return m;const C={source:f?g:o,sourceHandle:f?w:r,target:f?o:g,targetHandle:f?r:w};m.connection=C;const A=N&&S&&(n===Ze.Strict?f&&_==="source"||!f&&_==="target":g!==o||w!==r);m.isValid=A&&c(C),m.toHandle=Hr(g,_,w,u,n,!0)}return m}const pn={onPointerDown:Mu,isValid:Br};function Iu({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=ae(e);function i({translateExtent:a,width:l,height:c,zoomStep:u=1,pannable:f=!0,zoomable:d=!0,inversePan:h=!1}){const p=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const w=n(),N=g.sourceEvent.ctrlKey&&ct()?10:1,S=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*u,C=w[2]*Math.pow(2,S*N);t.scaleTo(C)};let v=[0,0];const x=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const N=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],S=[N[0]-v[0],N[1]-v[1]];v=N;const C=o()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),k={x:w[0]-S[0]*C,y:w[1]-S[1]*C},A=[[0,0],[l,c]];t.setViewportConstrained({x:k.x,y:k.y,zoom:w[2]},A,a)},_=fr().on("start",x).on("zoom",f?m:null).on("zoom.wheel",d?p:null);r.call(_,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:ue}}const Ft=e=>({x:e.x,y:e.y,zoom:e.k}),en=({x:e,y:t,zoom:n})=>Bt.translate(e,t).scale(n),Ie=(e,t)=>e.target.closest(`.${t}`),Vr=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Au=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,tn=(e,t=0,n=Au,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Or=e=>{const t=e.ctrlKey&&ct()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function ku({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(Ie(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(u.ctrlKey&&s){const x=ue(u),m=Or(u),_=f*Math.pow(2,m);o.scaleTo(n,_,x,u);return}const d=u.deltaMode===1?20:1;let h=r===He.Vertical?0:u.deltaX*d,p=r===He.Horizontal?0:u.deltaY*d;!ct()&&u.shiftKey&&r!==He.Vertical&&(h=u.deltaY*d,p=0),o.translateBy(n,-(h/f)*i,-(p/f)*i,{internal:!0});const v=Ft(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?l?.(u,v):(e.isPanScrolling=!0,a?.(u,v)),e.panScrollTimeout=setTimeout(()=>{c?.(u,v),e.isPanScrolling=!1},150)}}function Pu({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=Ie(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Tu({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=Ft(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function zu({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Vr(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,Ft(i.transform))}}function Du({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Vr(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=Ft(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function $u({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:o,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:f}){return d=>{const h=t||n,p=o&&d.ctrlKey,v=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Ie(d,`${u}-flow__node`)||Ie(d,`${u}-flow__edge`)||Ie(d,`${u}-flow__selection`)||Ie(d,`${u}-flow__nodesselection`)))return!0;
1if(!r&&!h&&!i&&!s&&!o||a||f&&!v||Ie(d,l)&&v||Ie(d,c)&&(!v||i&&v&&!t)||!o&&d.ctrlKey&&v)return!1;if(!o&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!h&&!i&&!p&&v||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const x=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||v||e)&&x}}function Hu({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect();let f=[[0,0],[u.width,u.height]];(typeof ResizeObserver<"u"?new ResizeObserver(H=>{const y=H[0];y&&(f=[[0,0],[y.contentRect.width,y.contentRect.height]])}):null)?.observe(e);const h=fr().extent(()=>f).scaleExtent([t,n]).translateExtent(o),p=ae(e).call(h);w({x:r.x,y:r.y,zoom:We(r.zoom,t,n)},[[0,0],[u.width,u.height]],o);const v=p.on("wheel.zoom"),x=p.on("dblclick.zoom");h.wheelDelta(Or);async function m(H,y){return p?new Promise(E=>{h?.interpolate(y?.interpolate==="linear"?Ut:Et).transform(tn(p,y?.duration,y?.ease,()=>E(!0)),H)}):!1}function _({noWheelClassName:H,noPanClassName:y,onPaneContextMenu:E,userSelectionActive:b,panOnScroll:M,panOnDrag:P,panOnScrollMode:T,panOnScrollSpeed:R,preventScrolling:V,zoomOnPinch:B,zoomOnScroll:Y,zoomOnDoubleClick:F,panActivationKeyPressed:G=!1,zoomActivationKeyPressed:Q,lib:W,onTransformChange:$,connectionInProgress:j,paneClickDistance:K,selectionOnDrag:U}){b&&!c.isZoomingOrPanning&&g();const Z=M&&!Q&&!b;h.clickDistance(U?1/0:!de(K)||K<0?0:K);const q=Z?ku({zoomPanValues:c,noWheelClassName:H,d3Selection:p,d3Zoom:h,panOnScrollMode:T,panOnScrollSpeed:R,zoomOnPinch:B,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):Pu({noWheelClassName:H,preventScrolling:V,d3ZoomHandler:v});p.on("wheel.zoom",q,{passive:!1});const J=Tu({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:s});h.on("start",J);const te=zu({zoomPanValues:c,panOnDrag:P,onPaneContextMenu:!!E,onPanZoom:i,onTransformChange:$});h.on("zoom",te);const oe=Du({zoomPanValues:c,panOnDrag:P,panOnScroll:M,onPaneContextMenu:E,onPanZoomEnd:a,onDraggingChange:l});h.on("end",oe);const se=$u({panActivationKeyPressed:G,zoomActivationKeyPressed:Q,panOnDrag:P,zoomOnScroll:Y,panOnScroll:M,zoomOnDoubleClick:F,zoomOnPinch:B,userSelectionActive:b,noPanClassName:y,noWheelClassName:H,lib:W,connectionInProgress:j});h.filter(se),F?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function g(){h.on("zoom",null)}async function w(H,y,E){const b=en(H),M=h?.constrain()(b,y,E);return M&&await m(M),M}async function N(H,y){const E=en(H);return await m(E,y),E}function S(H){if(p){const y=en(H),E=p.property("__zoom");(E.k!==H.zoom||E.x!==H.x||E.y!==H.y)&&h?.transform(p,y,null,{sync:!0})}}function C(){const H=p?dr(p.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}async function k(H,y){return p?new Promise(E=>{h?.interpolate(y?.interpolate==="linear"?Ut:Et).scaleTo(tn(p,y?.duration,y?.ease,()=>E(!0)),H)}):!1}async function A(H,y){return p?new Promise(E=>{h?.interpolate(y?.interpolate==="linear"?Ut:Et).scaleBy(tn(p,y?.duration,y?.ease,()=>E(!0)),H)}):!1}function O(H){h?.scaleExtent(H)}function D(H){h?.translateExtent(H)}function L(H){const y=!de(H)||H<0?0:H;h?.clickDistance(y)}return{update:_,destroy:g,setViewport:N,setViewportConstrained:w,getViewport:C,scaleTo:k,scaleBy:A,setScaleExtent:O,setTranslateExtent:D,syncViewport:S,setClickDistance:L}}var qe;(function(e){e.Line="line",e.Handle="handle"})(qe||(qe={}));function Ru({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,l=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(l[0]=l[0]*-1),a&&i&&(l[1]=l[1]*-1),l}function ho(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function Ce(e,t){return Math.max(0,t-e)}function Me(e,t){return Math.max(0,e-t)}function wt(e,t,n){return Math.max(0,t-e,e-n)}function go(e,t){return e?!t:t}function Lu(e,t,n,o,r,i,s,a){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:f}=t,d=u&&f,{xSnapped:h,ySnapped:p}=n,{minWidth:v,maxWidth:x,minHeight:m,maxHeight:_}=o,{x:g,y:w,width:N,height:S,aspectRatio:C}=e;let k=Math.floor(u?h-e.pointerX:0),A=Math.floor(f?p-e.pointerY:0);const O=N+(l?-k:k),D=S+(c?-A:A),L=-i[0]*N,H=-i[1]*S;let y=wt(O,v,x),E=wt(D,m,_);if(s){let P=0,T=0;l&&k<0?P=Ce(g+k+L,s[0][0]):!l&&k>0&&(P=Me(g+O+L,s[1][0])),c&&A<0?T=Ce(w+A+H,s[0][1]):!c&&A>0&&(T=Me(w+D+H,s[1][1])),y=Math.max(y,P),E=Math.max(E,T)}if(a){let P=0,T=0;l&&k>0?P=Me(g+k,a[0][0]):!l&&k<0&&(P=Ce(g+O,a[1][0])),c&&A>0?T=Me(w+A,a[0][1]):!c&&A<0&&(T=Ce(w+D,a[1][1])),y=Math.max(y,P),E=Math.max(E,T)}if(r){if(u){const P=wt(O/C,m,_)*C;if(y=Math.max(y,P),s){let T=0;!l&&!c||l&&!c&&d?T=Me(w+H+O/C,s[1][1])*C:T=Ce(w+H+(l?k:-k)/C,s[0][1])*C,y=Math.max(y,T)}if(a){let T=0;!l&&!c||l&&!c&&d?T=Ce(w+O/C,a[1][1])*C:T=Me(w+(l?k:-k)/C,a[0][1])*C,y=Math.max(y,T)}}if(f){const P=wt(D*C,v,x)/C;if(E=Math.max(E,P),s){let T=0;!l&&!c||c&&!l&&d?T=Me(g+D*C+L,s[1][0])/C:T=Ce(g+(c?A:-A)*C+L,s[0][0])/C,E=Math.max(E,T)}if(a){let T=0;!l&&!c||c&&!l&&d?T=Ce(g+D*C,a[1][0])/C:T=Me(g+(c?A:-A)*C,a[0][0])/C,E=Math.max(E,T)}}}A=A+(A<0?E:-E),k=k+(k<0?y:-y),r&&(d?O>D*C?A=(go(l,c)?-k:k)/C:k=(go(l,c)?-A:A)*C:u?(A=k/C,c=l):(k=A*C,l=c));const b=l?g+k:g,M=c?w+A:w;return{width:N+(l?-k:k),height:S+(c?-A:A),x:i[0]*k*(l?-1:1)+b,y:i[1]*A*(c?-1:1)+M}}const Fr={width:0,height:0,x:0,y:0},Bu={...Fr,pointerX:0,pointerY:0,aspectRatio:1};function Vu(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,l=n[1]*s;return[[o-a,r-l],[o+i-a,r+s-l]]}function Ou({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=ae(e);let s={controlDirection:ho("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:u,keepAspectRatio:f,resizeDirection:d,onResizeStart:h,onResize:p,onResizeEnd:v,shouldResize:x}){let m={...Fr},_={...Bu};s={boundaries:u,resizeDirection:d,keepAspectRatio:f,controlDirection:ho(c)};let g,w=null,N=[],S,C,k,A=!1;const O=or().on("start",D=>
1{const{nodeLookup:L,transform:H,snapGrid:y,snapToGrid:E,nodeOrigin:b,paneDomNode:M}=n();if(g=L.get(t),!g)return;w=M?.getBoundingClientRect()??null;const{xSnapped:P,ySnapped:T}=nt(D.sourceEvent,{transform:H,snapGrid:y,snapToGrid:E,containerBounds:w});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},_={...m,pointerX:P,pointerY:T,aspectRatio:m.width/m.height},S=void 0,C=Be(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(S=L.get(g.parentId)),S&&g.extent==="parent"&&(C=[[0,0],[S.measured.width,S.measured.height]]),N=[],k=void 0;for(const[R,V]of L)if(V.parentId===t&&(N.push({id:R,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const B=Vu(V,g,V.origin??b);k?k=[[Math.min(B[0][0],k[0][0]),Math.min(B[0][1],k[0][1])],[Math.max(B[1][0],k[1][0]),Math.max(B[1][1],k[1][1])]]:k=B}h?.(D,{...m})}).on("drag",D=>{const{transform:L,snapGrid:H,snapToGrid:y,nodeOrigin:E}=n(),b=nt(D.sourceEvent,{transform:L,snapGrid:H,snapToGrid:y,containerBounds:w}),M=[];if(!g)return;const{x:P,y:T,width:R,height:V}=m,B={},Y=g.origin??E,{width:F,height:G,x:Q,y:W}=Lu(_,s.controlDirection,b,s.boundaries,s.keepAspectRatio,Y,C,k),$=F!==R,j=G!==V,K=Q!==P&&$,U=W!==T&&j;if(!K&&!U&&!$&&!j)return;if((K||U||Y[0]===1||Y[1]===1)&&(B.x=K?Q:m.x,B.y=U?W:m.y,m.x=B.x,m.y=B.y,N.length>0)){const te=Q-P,oe=W-T;for(const se of N)se.position={x:se.position.x-te+Y[0]*(F-R),y:se.position.y-oe+Y[1]*(G-V)},M.push(se)}if(($||j)&&(B.width=$&&(!s.resizeDirection||s.resizeDirection==="horizontal")?F:m.width,B.height=j&&(!s.resizeDirection||s.resizeDirection==="vertical")?G:m.height,m.width=B.width,m.height=B.height),S&&g.expandParent){const te=Y[0]*(B.width??0);B.x&&B.x<te&&(m.x=te,_.x=_.x-(B.x-te));const oe=Y[1]*(B.height??0);B.y&&B.y<oe&&(m.y=oe,_.y=_.y-(B.y-oe))}const Z=Ru({width:m.width,prevWidth:R,height:m.height,prevHeight:V,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),q={...m,direction:Z};x?.(D,q)!==!1&&(A=!0,p?.(D,q),o(B,M))}).on("end",D=>{A&&(v?.(D,{...m}),r?.({...m}),A=!1)});i.call(O)}function l(){i.on(".drag",null)}return{update:a,destroy:l}}const{useDebugValue:Fu}=Ms,{useSyncExternalStoreWithSelector:ju}=ks,Xu=e=>e;function jr(e,t=Xu,n){const o=ju(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Fu(o),o}const po=(e,t)=>{const n=Ps(e),o=(r,i=t)=>jr(n,r,i);return Object.assign(o,n),o},Yu=(e,t)=>e?po(e,t):po;function re(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const jt=z.createContext(null),Zu=jt.Provider,Xr=he.error001("react");function ee(e,t){const n=z.useContext(jt);if(n===null)throw new Error(Xr);return jr(n,e,t)}function ne(){const e=z.useContext(jt);if(e===null)throw new Error(Xr);return z.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const mo={display:"none"},Wu={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Yr="react-flow__node-desc",Zr="react-flow__edge-desc",Gu="react-flow__aria-live",qu=e=>e.ariaLiveMessage,Uu=e=>e.ariaLabelConfig;function Ku({rfId:e}){const t=ee(qu);return I.jsx("div",{id:`${Gu}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Wu,children:t})}function Qu({rfId:e,disableKeyboardA11y:t}){const n=ee(Uu);return I.jsxs(I.Fragment,{children:[I.jsx("div",{id:`${Yr}-${e}`,style:mo,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),I.jsx("div",{id:`${Zr}-${e}`,style:mo,children:n["edge.a11yDescription.default"]}),!t&&I.jsx(Ku,{rfId:e})]})}const Xt=z.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return I.jsx("div",{className:ie(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});Xt.displayName="Panel";const yo="https://reactflow.dev?utm_source=attribution";function Ju({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:I.jsx(Xt,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${yo}`,children:I.jsx("a",{href:yo,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ed=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},vt=e=>e.id;function td(e,t){return re(e.selectedNodes.map(vt),t.selectedNodes.map(vt))&&re(e.selectedEdges.map(vt),t.selectedEdges.map(vt))}
1function nd({onSelectionChange:e}){const t=ne(),{selectedNodes:n,selectedEdges:o}=ee(ed,td);return z.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const od=e=>!!e.onSelectionChangeHandlers;function rd({onSelectionChange:e}){const t=ee(od);return e||t?I.jsx(nd,{onSelectionChange:e}):null}const Wr=[0,0],id={x:0,y:0,zoom:1},sd=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],xo=[...sd,"rfId"],ad=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),wo={translateExtent:it,nodeOrigin:Wr,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function cd(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:l}=ee(ad,re),c=ne();z.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{u.current=wo,a()}),[]);const u=z.useRef(wo);return z.useEffect(()=>{for(const f of xo){const d=e[f],h=u.current[f];d!==h&&(typeof e[f]>"u"||(f==="nodes"?t(d):f==="edges"?n(d):f==="minZoom"?o(d):f==="maxZoom"?r(d):f==="translateExtent"?i(d):f==="nodeExtent"?s(d):f==="ariaLabelConfig"?c.setState({ariaLabelConfig:eu(d)}):f==="fitView"?c.setState({fitViewQueued:d}):f==="fitViewOptions"?c.setState({fitViewOptions:d}):c.setState({[f]:d})))}u.current=e},xo.map(f=>e[f])),null}function vo(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function ld(e){const[t,n]=z.useState(e==="system"?null:e);return z.useEffect(()=>{if(e!=="system"){n(e);return}const o=vo(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:vo()?.matches?"dark":"light"}const _o=typeof document<"u"?document:null;function lt(e=null,t={target:_o,actInsideInputWithModifier:!0}){const[n,o]=z.useState(!1),r=z.useRef(!1),i=z.useRef(new Set([])),[s,a]=z.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace(/\+/g,`
2`).replace(`
3
4`,`
5+`).split(`
6`)),u=c.reduce((f,d)=>f.concat(...d),[]);return[c,u]}return[[],[]]},[e]);return z.useEffect(()=>{const l=t?.target??_o,c=t?.actInsideInputWithModifier??!0;if(e!==null){const u=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!c)&&Cr(h))return!1;const v=So(h.code,a);if(i.current.add(h[v]),Eo(s,i.current,!1)){const x=h.composedPath?.()?.[0]||h.target,m=x?.nodeName==="BUTTON"||x?.nodeName==="A";t.preventDefault!==!1&&(r.current||!m)&&h.preventDefault(),o(!0)}},f=h=>{const p=So(h.code,a);Eo(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(h[p]),h.key==="Meta"&&i.current.clear(),r.current=!1},d=()=>{i.current.clear(),o(!1)};return l?.addEventListener("keydown",u),l?.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{l?.removeEventListener("keydown",u),l?.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,o]),n}function Eo(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function So(e,t){return t.includes(e)?"code":"key"}const ud=()=>{const e=ne();return z.useMemo(()=>({zoomIn:async t=>
6{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),l=Nn(t,o,r,i,s,n?.padding??.1);return a?(await a.setViewport(l,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:l}=s.getBoundingClientRect(),c={x:t.x-a,y:t.y-l},u=n.snapGrid??r,f=n.snapToGrid??i;return gt(c,o,f,u)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),s=Ge(t,n);return{x:s.x+r,y:s.y+i}}}),[])};function Gr(e,t){const n=[],o=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of t){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const l of s)dd(l,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function dd(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function fd(e,t){return Gr(e,t)}function hd(e,t){return Gr(e,t)}function $e(e,t){return{id:e,type:"select",selected:t}}function Fe(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push($e(i.id,s)))}return o}function bo({items:e=[],lookup:t}){const n=[],o=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const s=t.get(i.id),a=s?.internals?.userNode??s;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)o.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function No(e){return{id:e.id,type:"remove"}}const gd=Er();function pd(e,t,n={}){return su(e,t,{...n,onError:n.onError??gd})}const Co=e=>Yl(e),md=e=>yr(e);function qr(e){return z.forwardRef(e)}const Ur=typeof window<"u"?z.useLayoutEffect:z.useEffect;function Mo(e){const[t,n]=z.useState(BigInt(0)),[o]=z.useState(()=>yd(()=>n(r=>r+BigInt(1))));return Ur(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function yd(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Kr=z.createContext(null);function xd({children:e}){const t=ne(),n=z.useCallback(a=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:u,onNodesChange:f,nodeLookup:d,fitViewQueued:h,onNodesChangeMiddlewareMap:p}=t.getState();let v=l;for(const m of a)v=typeof m=="function"?m(v):m;let x=bo({items:v,lookup:d});for(const m of p.values())x=m(x);u&&c(v),x.length>0?f?.(x):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:_,setNodes:g}=t.getState();m&&g(_)})},[]),o=Mo(n),r=z.useCallback(a=>{const{edges:l=[],setEdges:c,hasDefaultEdges:u,onEdgesChange:f,edgeLookup:d}=t.getState();let h=l;for(const p of a)h=typeof p=="function"?p(h):p;u?c(h):f&&f(bo({items:h,lookup:d}))},[]),i=Mo(r),s=z.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return I.jsx(Kr.Provider,{value:s,children:e})}function wd(){const e=z.useContext(Kr);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const vd=e=>!!e.panZoom;function Tn(){const e=ud(),t=ne(),n=wd(),o=ee(vd),r=z.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),s=f=>{n.nodeQueue.push(f)},a=f=>{n.edgeQueue.push(f)},l=f=>{const{nodeLookup:d,nodeOrigin:h}=t.getState(),p=Co(f)?f:d.get(f.id),v=p.parentId?br(p.position,p.measured,p.parentId,d,h):p.position,x={...p,position:v,width:p.measured?.width??p.width,height:p.measured?.height??p.height};return at(x)},c=(f,d,h={replace:!1})=>{s(p=>p.map(v=>{if(v.id===f){const x=typeof d=="function"?d(v):d;return h.replace&&Co(x)?x:{...v,...x}}return v}))},u=(f,d,h={replace:!1})=>{a(p=>p.map(v=>{if(v.id===f){const x=typeof d=="function"?d(v):d;return h.replace&&md(x)?x:{...v,...x}}return v}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>i(f)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(d=>({...d}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:s,setEdges:a,addNodes:f=>{const d=Array.isArray(f)?f:[f];n.nodeQueue.push(h=>[...h,...d])},addEdges:f=>{const d=Array.isArray(f)?f:[f];n.edgeQueue.push(h=>[...h,...d])},toObject:()=>{const{nodes:f=[],edges:d=[],transform:h}=t.getState(),[p,v,x]=h;return{nodes:f.map(m=>({...m})),edges:d.map(m=>({...m})),viewport:{x:p,y:v,zoom:x}}},deleteElements:async({nodes:f=[],edges:d=[]})=>{const{nodes:h,edges:p,onNodesDelete:v,onEdgesDelete:x,triggerNodeChanges:m,triggerEdgeChanges:_,onDelete:g,onBeforeDelete:w}=t.getState(),{nodes:N,edges:S}=await Ul({nodesToRemove:f,edgesToRemove:d,nodes:h,edges:p,onBeforeDelete:w}),C=S.length>0,k=N.length>0;if(C){const A=S.map(No);x?.(S),_(A)}if(k){const A=N.map(No);v?.(N),m(A)}return(k||C)&&g?.({nodes:N,edges:S}),{deletedNodes:N,deletedEdges:S}},getIntersectingNodes:(f,d=!0,h)=>{const p=to(f),v=p?f:l(f),x=h!==void 0;return v?(h||t.getState().nodes).filter(m=>{const _=t.getState().nodeLookup.get(m.id);if(_&&!p&&(m.id===f.id||!_.internals.positionAbsolute))return!1;const g=at(x?m:_),w=zt(g,v);return d&&w>0||w>=g.width*g.height||w>=v.width*v.height}):[]},isNodeIntersecting:(f,d,h=!0)=>{const v=to(f)?f:l(f);if(!v)return!1;const x=zt(v,d);return h&&x>0||x>=d.width*d.height||x>=v.width*v.height},updateNode:c,updateNodeData:(f,d,h={replace:!1})=>{c(f,p=>{const v=typeof d=="function"?d(p):d;return h.replace?{...p,data:v}:{...p,data:{...p.data,...v}}},h)},updateEdge:u,updateEdgeData:(f,d,h={replace:!1})=>{u(f,p=>{const v=typeof d=="function"?d(p):d;return h.replace?{...p,data:v}:{...p,data:{...p.data,...v}}},h)}
6,getNodesBounds:f=>{const{nodeLookup:d,nodeOrigin:h}=t.getState();return Zl(f,{nodeLookup:d,nodeOrigin:h})},getHandleConnections:({type:f,id:d,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}-${f}${d?`-${d}`:""}`)?.values()??[]),getNodeConnections:({type:f,handleId:d,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}${f?d?`-${f}-${d}`:`-${f}`:""}`)?.values()??[]),fitView:async f=>{const d=t.getState().fitViewResolver??Jl();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:d}),n.nodeQueue.push(h=>[...h]),d.promise}}},[]);return z.useMemo(()=>({...r,...e,viewportInitialized:o}),[o])}const Io=e=>e.selected,_d=typeof window<"u"?window:void 0;function Ed({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ne(),{deleteElements:o}=Tn(),r=lt(e,{actInsideInputWithModifier:!1}),i=lt(t,{target:_d});z.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();o({nodes:a.filter(Io),edges:s.filter(Io)}),n.setState({nodesSelectionActive:!1})}},[r]),z.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Sd(e){const t=ne();z.useEffect(()=>{const n=()=>
6{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const o=Cn(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",he.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const Yt={position:"absolute",width:"100%",height:"100%",top:0,left:0},bd=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Nd({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panActivationKeyPressed:r,panOnScrollSpeed:i=.5,panOnScrollMode:s=He.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:f,maxZoom:d,zoomActivationKeyCode:h,preventScrolling:p=!0,children:v,noWheelClassName:x,noPanClassName:m,onViewportChange:_,isControlledViewport:g,paneClickDistance:w,selectionOnDrag:N}){const S=ne(),C=z.useRef(null),{userSelectionActive:k,lib:A,connectionInProgress:O}=ee(bd,re),D=lt(h),L=z.useRef();Sd(C);const H=z.useCallback(y=>{_?.({x:y[0],y:y[1],zoom:y[2]}),g||S.setState({transform:y})},[_,g]);return z.useEffect(()=>{if(C.current){L.current=Hu({domNode:C.current,minZoom:f,maxZoom:d,translateExtent:u,viewport:c,onDraggingChange:M=>S.setState(P=>P.paneDragging===M?P:{paneDragging:M}),onPanZoomStart:(M,P)=>{const{onViewportChangeStart:T,onMoveStart:R}=S.getState();R?.(M,P),T?.(P)},onPanZoom:(M,P)=>{const{onViewportChange:T,onMove:R}=S.getState();R?.(M,P),T?.(P)},onPanZoomEnd:(M,P)=>{const{onViewportChangeEnd:T,onMoveEnd:R}=S.getState();R?.(M,P),T?.(P)}});const{x:y,y:E,zoom:b}=L.current.getViewport();return S.setState({panZoom:L.current,transform:[y,E,b],domNode:C.current.closest(".react-flow")}),()=>{L.current?.destroy()}}},[]),z.useEffect(()=>{L.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panActivationKeyPressed:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:D,preventScrolling:p,noPanClassName:m,userSelectionActive:k,noWheelClassName:x,lib:A,onTransformChange:H,connectionInProgress:O,selectionOnDrag:N,paneClickDistance:w})},[e,t,n,o,r,i,s,a,l,D,p,m,k,x,A,H,O,N,w]),I.jsx("div",{className:"react-flow__renderer",ref:C,style:Yt,children:v})}const Cd=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Md(){const{userSelectionActive:e,userSelectionRect:t}=ee(Cd,re);return e&&t?I.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const nn=(e,t)=>n=>{n.target===t.current&&e?.(n)},Id=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Ad({isSelecting:e,selectionKeyPressed:t,selectionMode:n=st.Full,panOnDrag:o,autoPanOnSelection:r,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:a,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:f,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:p,children:v}){const x=z.useRef(0),m=ne(),{userSelectionActive:_,elementsSelectable:g,dragging:w,panBy:N,autoPanSpeed:S}=ee(Id,re),C=g&&(e||_),k=z.useRef(null),A=z.useRef(),O=z.useRef(new Set),D=z.useRef(new Set),L=z.useRef(!1),H=z.useRef(!1),y=z.useRef({x:0,y:0}),E=z.useRef(!1),b=$=>{if(H.current||L.current||m.getState().connection.inProgress){H.current=!1,L.current=!1;return}c?.($),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},M=$=>{if(Array.isArray(o)&&o?.includes(2)){$.preventDefault();return}u?.($)},P=f?$=>f($):void 0,T=$=>{H.current&&($.stopPropagation(),H.current=!1)},R=$=>{if($.pointerType==="touch"&&o!==!1&&!t)return;const{domNode:j,transform:K}=m.getState();if(A.current=j?.getBoundingClientRect(),!A.current)return;const U=$.target===k.current;if(!U&&!!$.target.closest(".nokey")||!e||!(s&&U||t)||$.button!==0||!$.isPrimary)return;$.target?.setPointerCapture?.($.pointerId),H.current=!1;const{x:J,y:te}=fe($.nativeEvent,A.current),oe=gt({x:J,y:te},K);m.setState({userSelectionRect:{width:0,height:0,startX:oe.x,startY:oe.y,x:J,y:te}}),U||($.stopPropagation(),$.preventDefault())};
6function V($,j){const{userSelectionRect:K}=m.getState();if(!K)return;const{transform:U,nodeLookup:Z,edgeLookup:q,connectionLookup:J,triggerNodeChanges:te,triggerEdgeChanges:oe,defaultEdgeOptions:se}=m.getState(),we={x:K.startX,y:K.startY},{x:me,y:ye}=Ge(we,U),ve={startX:we.x,startY:we.y,x:$<me?$:me,y:j<ye?j:ye,width:Math.abs($-me),height:Math.abs(j-ye)},Ke=O.current,Pe=D.current;O.current=new Set(Sn(Z,ve,U,n===st.Partial,!0).map(le=>le.id)),D.current=new Set;const Te=se?.selectable??!0;for(const le of O.current){const _e=J.get(le);if(_e)for(const{edgeId:Ee}of _e.values()){const ze=q.get(Ee);ze&&(ze.selectable??Te)&&D.current.add(Ee)}}if(!no(Ke,O.current)){const le=Fe(Z,O.current,!0);te(le)}if(!no(Pe,D.current)){const le=Fe(q,D.current);oe(le)}m.setState({userSelectionRect:ve,userSelectionActive:!0,nodesSelectionActive:!1})}function B(){if(!r||!A.current)return;const[$,j]=bn(y.current,A.current,S);N({x:$,y:j}).then(K=>{if(!H.current||!K){x.current=requestAnimationFrame(B);return}const{x:U,y:Z}=y.current;V(U,Z),x.current=requestAnimationFrame(B)})}const Y=()=>{cancelAnimationFrame(x.current),x.current=0,E.current=!1};z.useEffect(()=>()=>Y(),[]);const F=$=>{const{userSelectionRect:j,transform:K,resetSelectedElements:U}=m.getState();if(!A.current||!j)return;const{x:Z,y:q}=fe($.nativeEvent,A.current);y.current={x:Z,y:q};const J=Ge({x:j.startX,y:j.startY},K);if(!H.current){const te=t?0:i;if(Math.hypot(Z-J.x,q-J.y)<=te)return;U(),a?.($)}H.current=!0,E.current||(B(),E.current=!0),V(Z,q)},G=$=>{if(!C){$.target===k.current&&m.getState().connection.inProgress&&(L.current=!0);return}$.button===0&&($.target?.releasePointerCapture?.($.pointerId),!_&&$.target===k.current&&m.getState().userSelectionRect&&b?.($),m.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(l?.($),m.setState({nodesSelectionActive:O.current.size>0})),Y())},Q=$=>{$.target?.releasePointerCapture?.($.pointerId),Y()},W=o===!0||Array.isArray(o)&&o.includes(0);return I.jsxs("div",{className:ie(["react-flow__pane",{draggable:W,dragging:w,selection:e}]),onClick:C?void 0:nn(b,k),onContextMenu:nn(M,k),onWheel:nn(P,k),onPointerEnter:C?void 0:d,onPointerMove:C?F:h,onPointerUp:G,onPointerCancel:C?Q:void 0,onPointerDownCapture:C?R:void 0,onClickCapture:C?T:void 0,onPointerLeave:p,ref:k,style:Yt,children:[v,I.jsx(Md,{})]})}function mn({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:l}=t.getState(),c=a.get(e);if(!c){l?.("012",he.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function Qr({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:s}){const a=ne(),[l,c]=z.useState(!1),u=z.useRef();return z.useEffect(()=>{if(!t)return u.current=Eu({getStoreItems:()=>a.getState(),onNodeMouseDown:f=>{mn({id:f,store:a,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,a,e]),z.useEffect(()=>{t||!e.current||!u.current||u.current.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:s})},[n,o,t,i,e,r,s]),l}const kd=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Jr(){const e=ne();return z.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:l,nodeLookup:c,nodeOrigin:u}=e.getState(),f=new Map,d=kd(s),h=r?i[0]:5,p=r?i[1]:5,v=n.direction.x*h*n.factor,x=n.direction.y*p*n.factor;for(const[,m]of c){if(!d(m))continue;let _={x:m.internals.positionAbsolute.x+v,y:m.internals.positionAbsolute.y+x};r&&(_=ht(_,i));const{position:g,positionAbsolute:w}=xr({nodeId:m.id,nextPosition:_,nodeLookup:c,nodeExtent:o,nodeOrigin:u,onError:a});m.position=g,m.internals.positionAbsolute=w,f.set(m.id,m)}l(f)},[])}const zn=z.createContext(null),Pd=zn.Provider;zn.Consumer;const ei=()=>z.useContext(zn),Td=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ti=z.createContext(null);function zd({children:e}){const t=ee(Td,re);return I.jsx(ti.Provider,{value:t,children:e})}function Dd(){const e=z.useContext(ti);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const $d={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Hd=(e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:s}=o,{fromHandle:a,toHandle:l,isValid:c}=s;if(!a&&!r)return $d;const u=l?.nodeId===e&&l?.id===t&&l?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:u,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===Ze.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:u&&c}};function Rd({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:u,onTouchStart:f,...d},h){const p=s||null,v=e==="target",x=ne(),m=ei(),{connectOnClick:_,noPanClassName:g,rfId:w}=Dd(),{connectingFrom:N,connectingTo:S,clickConnecting:C,isPossibleEndHandle:k,connectionInProcess:A,clickConnectionInProcess:O,valid:D}=ee(Hd(m,p,e),re);m||x.getState().onError?.("010",he.error010());const L=E=>{const{defaultEdgeOptions:b,onConnect:M,hasDefaultEdges:P}=x.getState(),T={...b,...E};if(P){const{edges:R,setEdges:V,onError:B}=x.getState();V(pd(T,R,{onError:B}))}M?.(T),a?.(T)},H=E=>{if(!m)return;const b=Mr(E.nativeEvent);if(r&&(b&&E.button===0||!b)){const M=x.getState();
6pn.onPointerDown(E.nativeEvent,{handleDomNode:E.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:v,handleId:p,nodeId:m,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...P)=>x.getState().onConnectEnd?.(...P),updateConnection:M.updateConnection,onConnect:L,isValidConnection:n||((...P)=>x.getState().isValidConnection?.(...P)??!0),getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}b?u?.(E):f?.(E)},y=E=>{const{onClickConnectStart:b,onClickConnectEnd:M,connectionClickStartHandle:P,connectionMode:T,isValidConnection:R,lib:V,rfId:B,nodeLookup:Y,connection:F}=x.getState();if(!m||!P&&!r)return;if(!P){b?.(E.nativeEvent,{nodeId:m,handleId:p,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:m,type:e,id:p}});return}const G=Nr(E.target),Q=n||R,{connection:W,isValid:$}=pn.isValid(E.nativeEvent,{handle:{nodeId:m,id:p,type:e},connectionMode:T,fromNodeId:P.nodeId,fromHandleId:P.id||null,fromType:P.type,isValidConnection:Q,flowId:B,doc:G,lib:V,nodeLookup:Y});$&&W&&L(W);const j=structuredClone(F);delete j.inProgress,j.toPosition=j.toHandle?j.toHandle.position:null,M?.(E,j),x.setState({connectionClickStartHandle:null})};return I.jsx("div",{"data-handleid":p,"data-nodeid":m,"data-handlepos":t,"data-id":`${w}-${m}-${p}-${e}`,className:ie(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,c,{source:!v,target:v,connectable:o,connectablestart:r,connectableend:i,clickconnecting:C,connectingfrom:N,connectingto:S,valid:D,connectionindicator:o&&(!A||k)&&(A||O?i:r)}]),onMouseDown:H,onTouchStart:H,onClick:_?y:void 0,ref:h,...d,children:l})}const Ue=z.memo(qr(Rd));function Ld({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return I.jsxs(I.Fragment,{children:[e?.label,I.jsx(Ue,{type:"source",position:n,isConnectable:t})]})}function Bd({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:o=X.Bottom}){return I.jsxs(I.Fragment,{children:[I.jsx(Ue,{type:"target",position:n,isConnectable:t}),e?.label,I.jsx(Ue,{type:"source",position:o,isConnectable:t})]})}function Vd(){return null}function Od({data:e,isConnectable:t,targetPosition:n=X.Top}){return I.jsxs(I.Fragment,{children:[I.jsx(Ue,{type:"target",position:n,isConnectable:t}),e?.label]})}const Dt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ao={input:Ld,default:Bd,output:Od,group:Vd};function Fd(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const jd=e=>{const{width:t,height:n,x:o,y:r}=ft(e.nodeLookup,{filter:i=>!!i.selected});return{width:de(t)?t:null,height:de(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function Xd({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=ne(),{width:r,height:i,transformString:s,userSelectionActive:a}=ee(jd,re),l=Jr(),c=z.useRef(null);z.useEffect(()=>{n||c.current?.focus({preventScroll:!0})},[n]);const u=!a&&r!==null&&i!==null;if(Qr({nodeRef:c,disabled:!u}),!u)return null;const f=e?h=>{const p=o.getState().nodes.filter(v=>v.selected);e(h,p)}:void 0,d=h=>{Object.prototype.hasOwnProperty.call(Dt,h.key)&&(h.preventDefault(),l({direction:Dt[h.key],factor:h.shiftKey?4:1}))};return I.jsx("div",{className:ie(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:I.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:r,height:i}})})}const ko=typeof window<"u"?window:void 0,Yd=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ni({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:u,selectionMode:f,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:p,panActivationKeyCode:v,zoomActivationKeyCode:x,elementsSelectable:m,zoomOnScroll:_,zoomOnPinch:g,panOnScroll:w,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:k,autoPanOnSelection:A,defaultViewport:O,translateExtent:D,minZoom:L,maxZoom:H,preventScrolling:y,onSelectionContextMenu:E,noWheelClassName:b,noPanClassName:M,disableKeyboardA11y:P,onViewportChange:T,isControlledViewport:R}){const{nodesSelectionActive:V,userSelectionActive:B}=ee(Yd,re),Y=lt(c,{target:ko}),F=lt(v,{target:ko}),G=F||k,Q=F||w,W=u&&G!==!0,$=Y||B||W;return Ed({deleteKeyCode:l,multiSelectionKeyCode:p}),I.jsx(Nd,{onPaneContextMenu:i,elementsSelectable:m,zoomOnScroll:_,zoomOnPinch:g,panOnScroll:Q,panActivationKeyPressed:F,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!Y&&G,defaultViewport:O,translateExtent:D,minZoom:L,maxZoom:H,zoomActivationKeyCode:x,preventScrolling:y,noWheelClassName:b,noPanClassName:M,onViewportChange:T,isControlledViewport:R,paneClickDistance:a,selectionOnDrag:W,children:I.jsxs(Ad,{onSelectionStart:d,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:G,autoPanOnSelection:A,isSelecting:!!$,selectionMode:f,selectionKeyPressed:Y,paneClickDistance:a,selectionOnDrag:W,children:[e,V&&I.jsx(Xd,{onSelectionContextMenu:E,noPanClassName:M,disableKeyboardA11y:P})]})})}ni.displayName="FlowRenderer";const Zd=z.memo(ni),Wd=e=>t=>e?Sn(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function Gd(e){return ee(z.useCallback(Wd(e),[e]),re)}const qd=e=>e.updateNodeInternals;function Ud(){const e=ee(qd),[t]=z.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;
6n.forEach(r=>{const i=r.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:r.target,force:!0})}),e(o)}));return z.useEffect(()=>()=>{t?.disconnect()},[t]),t}function Kd({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const r=ne(),i=z.useRef(null),s=z.useRef(null),a=z.useRef(e.sourcePosition),l=z.useRef(e.targetPosition),c=z.useRef(t),u=n&&!!e.internals.handleBounds;return z.useEffect(()=>{i.current&&!e.hidden&&(!u||s.current!==i.current)&&(s.current&&o?.unobserve(s.current),o?.observe(i.current),s.current=i.current)},[u,e.hidden]),z.useEffect(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),z.useEffect(()=>{if(i.current){const f=c.current!==t,d=a.current!==e.sourcePosition,h=l.current!==e.targetPosition;(f||d||h)&&(c.current=t,a.current=e.sourcePosition,l.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function Qd({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:l,nodesConnectable:c,nodesFocusable:u,resizeObserver:f,noDragClassName:d,noPanClassName:h,disableKeyboardA11y:p,rfId:v,nodeTypes:x,nodeClickDistance:m,onError:_}){const{node:g,internals:w,isParent:N}=ee($=>{const j=$.nodeLookup.get(e),K=$.parentLookup.has(e);return{node:j,internals:j.internals,isParent:K}},re);let S=g.type||"default",C=x?.[S]||Ao[S];C===void 0&&(_?.("003",he.error003(S)),S="default",C=x?.default||Ao.default);const k=!!(g.draggable||a&&typeof g.draggable>"u"),A=!!(g.selectable||l&&typeof g.selectable>"u"),O=!!(g.connectable||c&&typeof g.connectable>"u"),D=!!(g.focusable||u&&typeof g.focusable>"u"),L=ne(),H=Sr(g),y=Kd({node:g,nodeType:S,hasDimensions:H,resizeObserver:f}),E=Qr({nodeRef:y,disabled:g.hidden||!k,noDragClassName:d,handleSelector:g.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:m}),b=Jr();if(g.hidden)return null;const M=pe(g),P=Fd(g),T=A||k||t||n||o||r,R=n?$=>n($,{...w.userNode}):void 0,V=o?$=>o($,{...w.userNode}):void 0,B=r?$=>r($,{...w.userNode}):void 0,Y=i?$=>i($,{...w.userNode}):void 0,F=s?$=>s($,{...w.userNode}):void 0,G=$=>{const{selectNodesOnDrag:j,nodeDragThreshold:K}=L.getState();A&&(!j||!k||K>0)&&mn({id:e,store:L,nodeRef:y}),t&&t($,{...w.userNode})},Q=$=>{if(!(Cr($.nativeEvent)||p)){if(hr.includes($.key)&&A){const j=$.key==="Escape";mn({id:e,store:L,unselect:j,nodeRef:y})}else if(k&&g.selected&&Object.prototype.hasOwnProperty.call(Dt,$.key)){$.preventDefault();const{ariaLabelConfig:j}=L.getState();L.setState({ariaLiveMessage:j["node.a11yDescription.ariaLiveMessage"]({direction:$.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}
6),b({direction:Dt[$.key],factor:$.shiftKey?4:1})}}},W=()=>{if(p||!y.current?.matches(":focus-visible"))return;const{transform:$,width:j,height:K,autoPanOnNodeFocus:U,setCenter:Z}=L.getState();if(!U)return;Sn(new Map([[e,g]]),{x:0,y:0,width:j,height:K},$,!0).length>0||Z(g.position.x+M.width/2,g.position.y+M.height/2,{zoom:$[2]})};return I.jsx("div",{className:ie(["react-flow__node",`react-flow__node-${S}`,{[h]:k},g.className,{selected:g.selected,selectable:A,parent:N,draggable:k,dragging:E}]),ref:y,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:T?"all":"none",visibility:H?"visible":"hidden",...g.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:V,onMouseLeave:B,onContextMenu:Y,onClick:G,onDoubleClick:F,onKeyDown:D?Q:void 0,tabIndex:D?0:void 0,onFocus:D?W:void 0,role:g.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${Yr}-${v}`,"aria-label":g.ariaLabel,...g.domAttributes,children:I.jsx(Pd,{value:e,children:I.jsx(C,{id:e,data:g.data,type:S,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:g.selected??!1,selectable:A,draggable:k,deletable:g.deletable??!0,isConnectable:O,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:E,dragHandle:g.dragHandle,zIndex:w.z,parentId:g.parentId,...M})})})}var Jd=z.memo(Qd);const ef=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function oi(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,onError:r}=ee(ef,re),i=Gd(e.onlyRenderVisibleElements),s=Ud();return I.jsx("div",{className:"react-flow__nodes",style:Yt,children:i.map(a=>I.jsx(Jd,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:r},a))})}oi.displayName="NodeRenderer";const tf=z.memo(oi);function nf(e){return ee(z.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);i&&s&&ou({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[e]),re)}const of=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return I.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},rf=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return I.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Po={[Pt.Arrow]:of,[Pt.ArrowClosed]:rf};function sf(e){const t=ne();return z.useMemo(()=>Object.prototype.hasOwnProperty.call(Po,e)?Po[e]:(t.getState().onError?.("009",he.error009(e)),null),[e])}const af=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=sf(t);return l?I.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:I.jsx(l,{color:n,strokeWidth:s})}):null},ri=({defaultColor:e,rfId:t})=>{const n=ee(i=>i.edges),o=ee(i=>i.defaultEdgeOptions),r=z.useMemo(()=>du(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?I.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:I.jsx("defs",{children:r.map(i=>I.jsx(af,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};ri.displayName="MarkerDefinitions";var cf=z.memo(ri);function ii({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...u}){const[f,d]=z.useState({x:1,y:0,width:0,height:0}),h=ie(["react-flow__edge-textwrapper",c]),p=z.useRef(null);return z.useEffect(()=>{if(p.current){const v=p.current.getBBox();d({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?I.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:h,visibility:f.width?"visible":"hidden",...u,children:[r&&I.jsx("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),I.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:p,style:o,children:n}),l]}):null}ii.displayName="EdgeText";const lf=z.memo(ii);function Zt({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:c=20,...u}){return I.jsxs(I.Fragment,{children:[I.jsx("path",{...u,d:e,fill:"none",className:ie(["react-flow__edge-path",u.className])}),c?I.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,o&&de(t)&&de(n)?I.jsx(lf,{x:t,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function To({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===X.Left||e===X.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function si({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top}){const[s,a]=To({pos:n,x1:e,y1:t,x2:o,y2:r}),[l,c]=To({pos:i,x1:o,y1:r,x2:e,y2:t}),[u,f,d,h]=Ir({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${e},${t} C${s},${a} ${l},${c} ${o},${r}`,u,f,d,h]}function ai(e){return z.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:v,markerStart:x,interactionWidth:m})=>{const[_,g,w]=si({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),N=e.isInternal?void 0:t;return I.jsx(Zt,{id:N,path:_,labelX:g,labelY:w,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:v,markerStart:x,interactionWidth:m})})}const uf=ai({isInternal:!1}),ci=ai({isInternal:!0});uf.displayName="SimpleBezierEdge";ci.displayName="SimpleBezierEdgeInternal";function li(e){return z.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,sourcePosition:h=X.Bottom,targetPosition:p=X.Top,markerEnd:v,markerStart:x,pathOptions:m,interactionWidth:_})=>{const[g,w,N]=fn({sourceX:n,sourceY:o,sourcePosition:h,targetX:r,targetY:i,targetPosition:p,borderRadius:m?.borderRadius,offset:m?.offset,stepPosition:m?.stepPosition}),S=e.isInternal?void 0:t;return I.jsx(Zt,{id:S,path:g,labelX:w,labelY:N,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:v,markerStart:x,interactionWidth:_})})}const ui=li({isInternal:!1}),di=li({isInternal:!0});ui.displayName="SmoothStepEdge";di.displayName="SmoothStepEdgeInternal";function fi(e){return z.memo(({id:t,...n})=>{const o=e.isInternal?void 0:t;return I.jsx(ui,{...n,id:o,pathOptions:z.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const df=fi({isInternal:!1}),hi=fi({isInternal:!0});df.displayName="StepEdge";hi.displayName="StepEdgeInternal";function gi(e){return z.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:p,interactionWidth:v})=>{const[x,m,_]=Pr({sourceX:n,sourceY:o,targetX:r,targetY:i}),g=e.isInternal?void 0:t;return I.jsx(Zt,{id:g,path:x,labelX:m,labelY:_,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:p,interactionWidth:v})})}const ff=gi({isInternal:!1}),pi=gi({isInternal:!0});ff.displayName="StraightEdge";pi.displayName="StraightEdgeInternal";function mi(e){return z.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s=X.Bottom,targetPosition:a=X.Top,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:v,markerStart:x,pathOptions:m,interactionWidth:_})=>{const[g,w,N]=Ar({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a,curvature:m?.curvature}),S=e.isInternal?void 0:t;return I.jsx(Zt,{id:S,path:g,labelX:w,labelY:N,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:v,markerStart:x,interactionWidth:_})})}const hf=mi({isInternal:!1}),yi=mi({isInternal:!0});hf.displayName="BezierEdge";yi.displayName="BezierEdgeInternal";const zo={default:yi,straight:pi,step:hi,smoothstep:di,simplebezier:ci},Do={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},gf=(e,t,n)=>
6n===X.Left?e-t:n===X.Right?e+t:e,pf=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,$o="react-flow__edgeupdater";function Ho({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a}){return I.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:ie([$o,`${$o}-${a}`]),cx:gf(t,o,e),cy:pf(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function mf({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:l,onReconnect:c,onReconnectStart:u,onReconnectEnd:f,setReconnecting:d,setUpdateHover:h}){const p=ne(),v=(w,N)=>{if(w.button!==0)return;const{autoPanOnConnect:S,domNode:C,connectionMode:k,connectionRadius:A,lib:O,onConnectStart:D,cancelConnection:L,nodeLookup:H,rfId:y,panBy:E,updateConnection:b}=p.getState(),M=N.type==="target",P=(V,B)=>{d(!1),f?.(V,n,N.type,B)},T=V=>c?.(n,V),R=(V,B)=>{d(!0),u?.(w,n,N.type),D?.(V,B)};pn.onPointerDown(w.nativeEvent,{autoPanOnConnect:S,connectionMode:k,connectionRadius:A,domNode:C,handleId:N.id,nodeId:N.nodeId,nodeLookup:H,isTarget:M,edgeUpdaterType:N.type,lib:O,flowId:y,cancelConnection:L,panBy:E,isValidConnection:(...V)=>p.getState().isValidConnection?.(...V)??!0,onConnect:T,onConnectStart:R,onConnectEnd:(...V)=>p.getState().onConnectEnd?.(...V),onReconnectEnd:P,updateConnection:b,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},x=w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>h(!0),g=()=>h(!1);return I.jsxs(I.Fragment,{children:[(e===!0||e==="source")&&I.jsx(Ho,{position:a,centerX:o,centerY:r,radius:t,onMouseDown:x,onMouseEnter:_,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&I.jsx(Ho,{position:l,centerX:i,centerY:s,radius:t,onMouseDown:m,onMouseEnter:_,onMouseOut:g,type:"target"})]})}function yf({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,rfId:p,edgeTypes:v,noPanClassName:x,onError:m,disableKeyboardA11y:_}){let g=ee(Z=>Z.edgeLookup.get(e));const w=ee(Z=>Z.defaultEdgeOptions);g=w?{...w,...g}:g;let N=g.type||"default",S=v?.[N]||zo[N];S===void 0&&(m?.("011",he.error011(N)),N="default",S=v?.default||zo.default);const C=!!(g.focusable||t&&typeof g.focusable>"u"),k=typeof f<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),A=!!(g.selectable||o&&typeof g.selectable>"u"),O=z.useRef(null),[D,L]=z.useState(!1),[H,y]=z.useState(!1),E=ne(),{zIndex:b=g.zIndex,sourceX:M,sourceY:P,targetX:T,targetY:R,sourcePosition:V,targetPosition:B}=ee(z.useCallback(Z=>{const q=Z.nodeLookup.get(g.source),J=Z.nodeLookup.get(g.target);if(!q||!J)return Do;const te=uu({id:e,sourceNode:q,targetNode:J,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:Z.connectionMode,onError:m}),oe=nu({selected:g.selected,zIndex:g.zIndex,sourceNode:q,targetNode:J,elevateOnSelect:Z.elevateEdgesOnSelect,zIndexMode:Z.zIndexMode});return{...te||Do,zIndex:oe}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex,m]),re),Y=z.useMemo(()=>g.markerStart?`url('#${hn(g.markerStart,p)}')`:void 0,[g.markerStart,p]),F=z.useMemo(()=>g.markerEnd?`url('#${hn(g.markerEnd,p)}')`:void 0,[g.markerEnd,p]);if(g.hidden||M===null||P===null||T===null||R===null)return null;const G=Z=>{const{addSelectedEdges:q,unselectNodesAndEdges:J,multiSelectionActive:te}=E.getState();A&&(E.setState({nodesSelectionActive:!1}),g.selected&&te?(J({nodes:[],edges:[g]}),O.current?.blur()):q([e])),r&&r(Z,g)},Q=i?Z=>{i(Z,{...g})}:void 0,W=s?Z=>{s(Z,{...g})}:void 0,$=a?Z=>{a(Z,{...g})}:void 0,j=l?Z=>{l(Z,{...g})}:void 0,K=c?Z=>{c(Z,{...g})}:void 0,U=Z=>{if(!_&&hr.includes(Z.key)&&A){const{unselectNodesAndEdges:q,addSelectedEdges:J}=E.getState();Z.key==="Escape"?(O.current?.blur(),q({edges:[g]})):J([e])}};return I.jsx("svg",{style:{zIndex:b},children:I.jsxs("g",{className:ie(["react-flow__edge",`react-flow__edge-${N}`,g.className,x,{selected:g.selected,animated:g.animated,inactive:!A&&!r,updating:D,selectable:A}]),onClick:G,onDoubleClick:Q,onContextMenu:W,onMouseEnter:$,onMouseMove:j,onMouseLeave:K,onKeyDown:C?U:void 0,tabIndex:C?0:void 0,role:g.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":C?`${Zr}-${p}`:void 0,ref:O,...g.domAttributes,children:[!H&&I.jsx(S,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:A,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:M,sourceY:P,targetX:T,targetY:R,sourcePosition:V,targetPosition:B,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:Y,markerEnd:F,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),k&&I.jsx(mf,{edge:g,isReconnectable:k,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,sourceX:M,sourceY:P,targetX:T,targetY:R,sourcePosition:V,targetPosition:B,setUpdateHover:L,setReconnecting:y})]})})}var xf=z.memo(yf);const wf=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function xi({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:f,onEdgeDoubleClick:d,onReconnectStart:h,onReconnectEnd:p,disableKeyboardA11y:v}){const{edgesFocusable:x,edgesReconnectable:m,elementsSelectable:_,onError:g}=ee(wf,re),w=nf(t);return I.jsxs("div",{className:"react-flow__edges",children:[I.jsx(cf,{defaultColor:e,rfId:n}),w.map(N=>I.jsx(xf,{id:N,edgesFocusable:x,edgesReconnectable:m,elementsSelectable:_,noPanClassName:r,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:u,reconnectRadius:f,onDoubleClick:d,onReconnectStart:h,onReconnectEnd:p,rfId:n,onError:g,edgeTypes:o,disableKeyboardA11y:v},N))]})}xi.displayName="EdgeRenderer";const vf=z.memo(xi),Ro=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function _f({children:e}){const t=ne(),n=z.useRef(null),[o]=z.useState(()=>t.getState().transform);return Ur(()=>{let r=null;const i=()=>{const s=t.getState().transform;r&&s[0]===r[0]&&s[1]===r[1]&&s[2]===r[2]||(r=s,n.current&&(n.current.style.transform=Ro(s)))};return i(),t.subscribe(i)},[t]),I.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Ro(o)},children:e})}function Ef(e){const t=Tn(),n=z.useRef(!1);z.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)}
6,[e,t.viewportInitialized])}const Sf=e=>e.panZoom?.syncViewport;function bf(e){const t=ee(Sf),n=ne();return z.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Nf(e){return e.connection.inProgress?{...e.connection,to:gt(e.connection.to,e.transform)}:{...e.connection}}function Cf(e){return Nf}function Mf(e){const t=Cf();return ee(t,re)}const If=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Af({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:r,width:i,height:s,isValid:a,inProgress:l}=ee(If,re);return!(i&&r&&l)?null:I.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:I.jsx("g",{className:ie(["react-flow__connection",mr(a)]),children:I.jsx(wi,{style:t,type:n,CustomComponent:o,isValid:a})})})}const wi=({style:e,type:t=Ae.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:i,fromNode:s,fromHandle:a,fromPosition:l,to:c,toNode:u,toHandle:f,toPosition:d,pointer:h}=Mf();if(!r)return;if(n)return I.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:d,connectionStatus:mr(o),toNode:u,toHandle:f,pointer:h});let p="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:d};switch(t){case Ae.Bezier:[p]=Ar(v);break;case Ae.SimpleBezier:[p]=si(v);break;case Ae.Step:[p]=fn({...v,borderRadius:0});break;case Ae.SmoothStep:[p]=fn(v);break;default:[p]=Pr(v)}return I.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};wi.displayName="ConnectionLine";const kf={};function Lo(e=kf){z.useRef(e),ne(),z.useEffect(()=>{},[e])}function Pf(){ne(),z.useRef(!1),z.useEffect(()=>{},[])}function vi({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:f,onSelectionStart:d,onSelectionEnd:h,connectionLineType:p,connectionLineStyle:v,connectionLineComponent:x,connectionLineContainerStyle:m,selectionKeyCode:_,selectionOnDrag:g,selectionMode:w,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:k,onlyRenderVisibleElements:A,elementsSelectable:O,defaultViewport:D,translateExtent:L,minZoom:H,maxZoom:y,preventScrolling:E,defaultMarkerColor:b,zoomOnScroll:M,zoomOnPinch:P,panOnScroll:T,panOnScrollSpeed:R,panOnScrollMode:V,zoomOnDoubleClick:B,panOnDrag:Y,autoPanOnSelection:F,onPaneClick:G,onPaneMouseEnter:Q,onPaneMouseMove:W,onPaneMouseLeave:$,onPaneScroll:j,onPaneContextMenu:K,paneClickDistance:U,nodeClickDistance:Z,onEdgeContextMenu:q,onEdgeMouseEnter:J,onEdgeMouseMove:te,onEdgeMouseLeave:oe,reconnectRadius:se,onReconnect:we,onReconnectStart:me,onReconnectEnd:ye,noDragClassName:ve,noWheelClassName:Ke,noPanClassName:Pe,disableKeyboardA11y:Te,nodeExtent:le,rfId:_e,viewport:Ee,onViewportChange:ze,nodesDraggable:Wt}){return Lo(e),Lo(t),Pf(),Ef(n),bf(Ee),I.jsx(Zd,{onPaneClick:G,onPaneMouseEnter:Q,onPaneMouseMove:W,onPaneMouseLeave:$,onPaneContextMenu:K,onPaneScroll:j,paneClickDistance:U,deleteKeyCode:k,selectionKeyCode:_,selectionOnDrag:g,selectionMode:w,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:O,zoomOnScroll:M,zoomOnPinch:P,zoomOnDoubleClick:B,panOnScroll:T,panOnScrollSpeed:R,panOnScrollMode:V,panOnDrag:Y,autoPanOnSelection:F,defaultViewport:D,translateExtent:L,minZoom:H,maxZoom:y,onSelectionContextMenu:f,preventScrolling:E,noDragClassName:ve,noWheelClassName:Ke,noPanClassName:Pe,disableKeyboardA11y:Te,onViewportChange:ze,isControlledViewport:!!Ee,children:I.jsxs(_f,{children:[I.jsx(vf,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:we,onReconnectStart:me,onReconnectEnd:ye,onlyRenderVisibleElements:A,onEdgeContextMenu:q,onEdgeMouseEnter:J,onEdgeMouseMove:te,onEdgeMouseLeave:oe,reconnectRadius:se,defaultMarkerColor:b,noPanClassName:Pe,disableKeyboardA11y:Te,rfId:_e}),I.jsx(Af,{style:v,type:p,component:x,containerStyle:m}),I.jsx("div",{className:"react-flow__edgelabel-renderer"}),I.jsx(tf,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:Z,onlyRenderVisibleElements:A,noPanClassName:Pe,noDragClassName:ve,disableKeyboardA11y:Te,nodeExtent:le,rfId:_e,nodesDraggable:Wt}),I.jsx("div",{className:"react-flow__viewport-portal"})]})})}vi.displayName="GraphView";const Tf=z.memo(vi),zf=Er(),Bo=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:f,zIndexMode:d="basic"}={})=>{const h=new Map,p=new Map,v=new Map,x=new Map,m=o??t??[],_=n??e??[],g=u??[0,0],w=f??it;Dr(v,x,m);const{nodesInitialized:N}=gn(_,h,p,{nodeOrigin:g,nodeExtent:w,zIndexMode:d});let S=[0,0,1];if(s&&r&&i){const C=ft(h,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:k,y:A,zoom:O}=Nn(C,r,i,l,c,a?.padding??.1);S=[k,A,O]}return{rfId:"1",width:r??0,height:i??0,transform:S,nodes:_,nodesInitialized:N,nodeLookup:h,parentLookup:p,edges:m,edgeLookup:x,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:it,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ze.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGri
6d:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...pr},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:zf,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:gr,zIndexMode:d,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Df=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:f,zIndexMode:d})=>Yu((h,p)=>{async function v(){const{nodeLookup:x,panZoom:m,fitViewOptions:_,fitViewResolver:g,width:w,height:N,minZoom:S,maxZoom:C}=p();m&&(await ql({nodes:x,width:w,height:N,panZoom:m,minZoom:S,maxZoom:C},_),g?.resolve(!0),h({fitViewResolver:null}))}return{...Bo({nodes:e,edges:t,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:f,defaultNodes:n,defaultEdges:o,zIndexMode:d}),setNodes:x=>{const{nodeLookup:m,parentLookup:_,nodeOrigin:g,nodeExtent:w,elevateNodesOnSelect:N,fitViewQueued:S,zIndexMode:C,nodesSelectionActive:k}=p(),{nodesInitialized:A,hasSelectedNodes:O}=gn(x,m,_,{nodeOrigin:g,nodeExtent:w,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:C}),D=k&&O;S&&A?(v(),h({nodes:x,nodesInitialized:A,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D})):h({nodes:x,nodesInitialized:A,nodesSelectionActive:D})},setEdges:x=>{const{connectionLookup:m,edgeLookup:_}=p();Dr(m,_,x),h({edges:x})},setDefaultNodesAndEdges:(x,m)=>{if(x){const{setNodes:_}=p();_(x),h({hasDefaultNodes:!0})}if(m){const{setEdges:_}=p();_(m),h({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:m,nodeLookup:_,parentLookup:g,domNode:w,nodeOrigin:N,nodeExtent:S,debug:C,fitViewQueued:k,zIndexMode:A}=p(),{changes:O,updatedInternals:D}=xu(x,_,g,w,N,S,A);D&&(gu(_,g,{nodeOrigin:N,nodeExtent:S,zIndexMode:A}),k?(v(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),O?.length>0&&(C&&console.log("React Flow: trigger node changes",O),m?.(O)))},updateNodePositions:(x,m=!1)=>{const _=[];let g=[];const{nodeLookup:w,triggerNodeChanges:N,connection:S,updateConnection:C,onNodesChangeMiddlewareMap:k}=p();for(const[A,O]of x){const D=w.get(A),L=!!(D?.expandParent&&D?.parentId&&O?.position),H={id:A,type:"position",position:L?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:m};if(D&&S.inProgress&&S.fromNode.id===D.id){const y=Ve(D,S.fromHandle,X.Left,!0);C({...S,from:y})}L&&D.parentId&&_.push({id:A,parentId:D.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),g.push(H)}if(_.length>0){const{parentLookup:A,nodeOrigin:O}=p(),D=Pn(_,w,A,O);g.push(...D)}for(const A of k.values())g=A(g);N(g)},triggerNodeChanges:x=>{const{onNodesChange:m,setNodes:_,nodes:g,hasDefaultNodes:w,debug:N}=p();if(x?.length){if(w){const S=fd(x,g);_(S)}N&&console.log("React Flow: trigger node changes",x),m?.(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:m,setEdges:_,edges:g,hasDefaultEdges:w,debug:N}=p();if(x?.length){if(w){const S=hd(x,g);_(S)}N&&console.log("React Flow: trigger edge changes",x),m?.(x)}},addSelectedNodes:x=>{const{multiSelectionActive:m,edgeLookup:_,nodeLookup:g,triggerNodeChanges:w,triggerEdgeChanges:N}=p();if(m){const S=x.map(C=>$e(C,!0));w(S);return}w(Fe(g,new Set([...x]),!0)),N(Fe(_))},addSelectedEdges:x=>{const{multiSelectionActive:m,edgeLookup:_,nodeLookup:g,triggerNodeChanges:w,triggerEdgeChanges:N}=p();if(m){const S=x.map(C=>$e(C,!0));N(S);return}N(Fe(_,new Set([...x]))),w(Fe(g,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:m}={})=>{const{edges:_,nodes:g,nodeLookup:w,triggerNodeChanges:N,triggerEdgeChanges:S}=p(),C=x||g,k=m||_,A=[];for(const D of C){if(!D.selected)continue;const L=w.get(D.id);L&&(L.selected=!1),A.push($e(D.id,!1))}const O=[];for(const D of k)D.selected&&O.push($e(D.id,!1));N(A),S(O)},setMinZoom:x=>
6{const{panZoom:m,maxZoom:_}=p();m?.setScaleExtent([x,_]),h({minZoom:x})},setMaxZoom:x=>{const{panZoom:m,minZoom:_}=p();m?.setScaleExtent([_,x]),h({maxZoom:x})},setTranslateExtent:x=>{p().panZoom?.setTranslateExtent(x),h({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:m,triggerNodeChanges:_,triggerEdgeChanges:g,elementsSelectable:w}=p();if(!w)return;const N=m.reduce((C,k)=>k.selected?[...C,$e(k.id,!1)]:C,[]),S=x.reduce((C,k)=>k.selected?[...C,$e(k.id,!1)]:C,[]);_(N),g(S)},setNodeExtent:x=>{const{nodes:m,nodeLookup:_,parentLookup:g,nodeOrigin:w,elevateNodesOnSelect:N,nodeExtent:S,zIndexMode:C}=p();x[0][0]===S[0][0]&&x[0][1]===S[0][1]&&x[1][0]===S[1][0]&&x[1][1]===S[1][1]||(gn(m,_,g,{nodeOrigin:w,nodeExtent:x,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:C}),h({nodeExtent:x}))},panBy:x=>{const{transform:m,width:_,height:g,panZoom:w,translateExtent:N}=p();return wu({delta:x,panZoom:w,transform:m,translateExtent:N,width:_,height:g})},setCenter:async(x,m,_)=>{const{width:g,height:w,maxZoom:N,panZoom:S}=p();if(!S)return!1;const C=typeof _?.zoom<"u"?_.zoom:N;return await S.setViewport({x:g/2-x*C,y:w/2-m*C,zoom:C},{duration:_?.duration,ease:_?.ease,interpolate:_?.interpolate}),!0},cancelConnection:()=>{h({connection:{...pr}})},updateConnection:x=>{h({connection:x})},reset:()=>h({...Bo()})}},Object.is);function $f({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:l,fitView:c,nodeOrigin:u,nodeExtent:f,zIndexMode:d,children:h}){const[p]=z.useState(()=>Df({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:c,minZoom:s,maxZoom:a,fitViewOptions:l,nodeOrigin:u,nodeExtent:f,zIndexMode:d}));return I.jsx(Zu,{value:p,children:I.jsx(xd,{children:I.jsx(zd,{children:h})})})}function Hf({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:f,nodeExtent:d,zIndexMode:h}){return z.useContext(jt)?I.jsx(I.Fragment,{children:e}):I.jsx($f,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:u,nodeOrigin:f,nodeExtent:d,zIndexMode:h,children:e})}const Rf={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Lf({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:u,onMoveStart:f,onMoveEnd:d,onConnect:h,onConnectStart:p,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:m,onNodeMouseEnter:_,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:A,onNodesDelete:O,onEdgesDelete:D,onDelete:L,onSelectionChange:H,onSelectionDragStart:y,onSelectionDrag:E,onSelectionDragStop:b,onSelectionContextMenu:M,onSelectionStart:P,onSelectionEnd:T,onBeforeDelete:R,connectionMode:V,connectionLineType:B=Ae.Bezier,connectionLineStyle:Y,connectionLineComponent:F,connectionLineContainerStyle:G,deleteKeyCode:Q="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:$=!1,selectionMode:j=st.Full,panActivationKeyCode:K="Space",multiSelectionKeyCode:U=ct()?"Meta":"Control",zoomActivationKeyCode:Z=ct()?"Meta":"Control",snapToGrid:q,snapGrid:J,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:oe,nodesDraggable:se,autoPanOnNodeFocus:we,nodesConnectable:me,nodesFocusable:ye,nodeOrigin:ve=Wr,edgesFocusable:Ke,edgesReconnectable:Pe,elementsSelectable:Te=!0,defaultViewport:le=id,minZoom:_e=.5,maxZoom:Ee=2,translateExtent:ze=it,preventScrolling:Wt=!0,nodeExtent:Gt,defaultMarkerColor:bi="#b1b1b7",zoomOnScroll:Ni=!0,zoomOnPinch:Ci=!0,panOnScroll:Mi=!1,panOnScrollSpeed:Ii=.5,panOnScrollMode:Ai=He.Free,zoomOnDoubleClick:ki=!0,panOnDrag:Pi=!0,onPaneClick:Ti,onPaneMouseEnter:zi,onPaneMouseMove:Di,onPaneMouseLeave:$i,onPaneScroll:Hi,onPaneContextMenu:Ri,paneClickDistance:Li=1,nodeClickDistance:Bi=0,children:Vi,onReconnect:Oi,onReconnectStart:Fi,onReconnectEnd:ji,onEdgeContextMenu:Xi,onEdgeDoubleClick:Yi,onEdgeMouseEnter:Zi,onEdgeMouseMove:Wi,onEdgeMouseLeave:Gi,reconnectRadius:qi=10,onNodesChange:Ui,onEdgesChange:Ki,noDragClassName:Qi="nodrag",noWheelClassName:Ji="nowheel",noPanClassName:Dn="nopan",fitView:$n,fitViewOptions:Hn,connectOnClick:es,attributionPosition:ts,proOptions:ns,defaultEdgeOptions:os,elevateNodesOnSelect:rs=!0,elevateEdgesOnSelect:is=!1,disableKeyboardA11y:Rn=!1,autoPanOnConnect:ss,autoPanOnNodeDrag:as,autoPanOnSelection:cs=!0,autoPanSpeed:ls,connectionRadius:us,isValidConnection:ds,onError:fs,style:hs,id:Ln,nodeDragThreshold:gs,connectionDragThreshold:ps,viewport:ms,onViewportChange:ys,width:xs,height:ws,colorMode:vs="light",debug:_s,onScroll:Bn,ariaLabelConfig:Es,zIndexMode:Vn="basic",...Ss},bs){const qt=Ln||"1",Ns=ld(vs),Cs=z.useCallback(On=>{On.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Bn?.(On)},[Bn]);return I.jsx("div",{"data-testid":"rf__wrapper",...Ss,onScroll:Cs,style:{...hs,...Rf},ref:bs,className:ie(["react-flow",r,Ns]),id:Ln,role:"application",children:I.jsxs(Hf,{nodes:e,edges:t,width:xs,height:ws,fitView:$n,fitViewOptions:Hn,minZoom:_e,maxZoom:Ee,nodeOrigin:ve,nodeExtent:Gt,zIndexMode:Vn,children:[I.jsx(cd,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:h,onConnectStart:p,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:m,nodesDraggable:se,autoPanOnNodeFocus:we,nodesConnectable:me,nodesFocusable:ye,edgesFocusable:Ke,edgesReconnectable:Pe,elementsSelectable:Te,elevateNodesOnSelect:rs,elevateEdgesOnSelect:is,minZoom:_e,maxZoom:Ee,nodeExtent:Gt,onNodesChange:Ui,onEdgesChange:Ki,snapToGri
6d:q,snapGrid:J,connectionMode:V,translateExtent:ze,connectOnClick:es,defaultEdgeOptions:os,fitView:$n,fitViewOptions:Hn,onNodesDelete:O,onEdgesDelete:D,onDelete:L,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:A,onSelectionDrag:E,onSelectionDragStart:y,onSelectionDragStop:b,onMove:u,onMoveStart:f,onMoveEnd:d,noPanClassName:Dn,nodeOrigin:ve,rfId:qt,autoPanOnConnect:ss,autoPanOnNodeDrag:as,autoPanSpeed:ls,onError:fs,connectionRadius:us,isValidConnection:ds,selectNodesOnDrag:oe,nodeDragThreshold:gs,connectionDragThreshold:ps,onBeforeDelete:R,debug:_s,ariaLabelConfig:Es,zIndexMode:Vn}),I.jsx(Tf,{onInit:c,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:_,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:s,connectionLineType:B,connectionLineStyle:Y,connectionLineComponent:F,connectionLineContainerStyle:G,selectionKeyCode:W,selectionOnDrag:$,selectionMode:j,deleteKeyCode:Q,multiSelectionKeyCode:U,panActivationKeyCode:K,zoomActivationKeyCode:Z,onlyRenderVisibleElements:te,defaultViewport:le,translateExtent:ze,minZoom:_e,maxZoom:Ee,preventScrolling:Wt,zoomOnScroll:Ni,zoomOnPinch:Ci,zoomOnDoubleClick:ki,panOnScroll:Mi,panOnScrollSpeed:Ii,panOnScrollMode:Ai,panOnDrag:Pi,autoPanOnSelection:cs,onPaneClick:Ti,onPaneMouseEnter:zi,onPaneMouseMove:Di,onPaneMouseLeave:$i,onPaneScroll:Hi,onPaneContextMenu:Ri,paneClickDistance:Li,nodeClickDistance:Bi,onSelectionContextMenu:M,onSelectionStart:P,onSelectionEnd:T,onReconnect:Oi,onReconnectStart:Fi,onReconnectEnd:ji,onEdgeContextMenu:Xi,onEdgeDoubleClick:Yi,onEdgeMouseEnter:Zi,onEdgeMouseMove:Wi,onEdgeMouseLeave:Gi,reconnectRadius:qi,defaultMarkerColor:bi,noDragClassName:Qi,noWheelClassName:Ji,noPanClassName:Dn,rfId:qt,disableKeyboardA11y:Rn,nodeExtent:Gt,viewport:ms,onViewportChange:ys,nodesDraggable:se}),I.jsx(rd,{onSelectionChange:H}),Vi,I.jsx(Ju,{proOptions:ns,position:ts}),I.jsx(Qu,{rfId:qt,disableKeyboardA11y:Rn})]})})}var wh=qr(Lf);function Bf({dimensions:e,lineWidth:t,variant:n,className:o}){return I.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ie(["react-flow__background-pattern",n,o])})}function Vf({radius:e,className:t}){return I.jsx("circle",{cx:e,cy:e,r:e,className:ie(["react-flow__background-pattern","dots",t])})}var ke;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ke||(ke={}));const Of={[ke.Dots]:1,[ke.Lines]:1,[ke.Cross]:6},Ff=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function _i({id:e,variant:t=ke.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:s,bgColor:a,style:l,className:c,patternClassName:u}){const f=z.useRef(null),{transform:d,patternId:h}=ee(Ff,re),p=o||Of[t],v=t===ke.Dots,x=t===ke.Cross,m=Array.isArray(n)?n:[n,n],_=[m[0]*d[2]||1,m[1]*d[2]||1],g=p*d[2],w=Array.isArray(i)?i:[i,i],N=x?[g,g]:_,S=[w[0]*d[2]+N[0]/2,w[1]*d[2]+N[1]/2],C=`${h}${e||""}`;return I.jsxs("svg",{className:ie(["react-flow__background",c]),style:{...l,...Yt,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:f,"data-testid":"rf__background",children:[I.jsx("pattern",{id:C,x:d[0]%_[0],y:d[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:v?I.jsx(Vf,{radius:g/2,className:u}):I.jsx(Bf,{dimensions:N,lineWidth:r,variant:t,className:u})}),I.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}_i.displayName="Background";const vh=z.memo(_i);function jf(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:I.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Xf(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:I.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Yf(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:I.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Zf(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:I.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Wf(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:I.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function _t({children:e,className:t,...n}){return I.jsx("button",{type:"button",className:ie(["react-flow__controls-button",t]),...n,children:e})}const Gf=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Ei({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:u,position:f="bottom-left",orientation:d="vertical","aria-label":h}){const p=ne(),{isInteractive:v,minZoomReached:x,maxZoomReached:m,ariaLabelConfig:_}=ee(Gf,re),{zoomIn:g,zoomOut:w,fitView:N}=Tn(),S=()=>{g(),i?.()},C=()=>{w(),s?.()}
6,k=()=>{N(r),a?.()},A=()=>{p.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l?.(!v)},O=d==="horizontal"?"horizontal":"vertical";return I.jsxs(Xt,{className:ie(["react-flow__controls",O,c]),position:f,style:e,"data-testid":"rf__controls","aria-label":h??_["controls.ariaLabel"],children:[t&&I.jsxs(I.Fragment,{children:[I.jsx(_t,{onClick:S,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:m,children:I.jsx(jf,{})}),I.jsx(_t,{onClick:C,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:x,children:I.jsx(Xf,{})})]}),n&&I.jsx(_t,{className:"react-flow__controls-fitview",onClick:k,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:I.jsx(Yf,{})}),o&&I.jsx(_t,{className:"react-flow__controls-interactive",onClick:A,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:v?I.jsx(Wf,{}):I.jsx(Zf,{})}),u]})}Ei.displayName="Controls";z.memo(Ei);function qf({id:e,x:t,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:l,className:c,borderRadius:u,shapeRendering:f,selected:d,onClick:h}){const{background:p,backgroundColor:v}=i||{},x=s||p||v;return I.jsx("rect",{className:ie(["react-flow__minimap-node",{selected:d},c]),x:t,y:n,rx:u,ry:u,width:o,height:r,style:{fill:x,stroke:a,strokeWidth:l},shapeRendering:f,onClick:h?m=>h(m,e):void 0})}const Uf=z.memo(qf),Kf=e=>e.nodes.map(t=>t.id),on=e=>e instanceof Function?e:()=>e;function Qf({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=Uf,onClick:s}){const a=ee(Kf,re),l=on(t),c=on(e),u=on(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return I.jsx(I.Fragment,{children:a.map(d=>I.jsx(eh,{id:d,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:s,shapeRendering:f},d))})}function Jf({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:l}){const{node:c,x:u,y:f,width:d,height:h}=ee(p=>{const v=p.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const x=v.internals.userNode,{x:m,y:_}=v.internals.positionAbsolute,{width:g,height:w}=pe(x);return{node:x,x:m,y:_,width:g,height:w}},re);return!c||c.hidden||!Sr(c)?null:I.jsx(a,{x:u,y:f,width:d,height:h,style:c.style,selected:!!c.selected,className:o(c),color:t(c),borderRadius:r,strokeColor:n(c),strokeWidth:i,shapeRendering:s,onClick:l,id:c.id})}const eh=z.memo(Jf);var th=z.memo(Qf);const nh=200,oh=150,rh=e=>!e.hidden,ih=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?vr(ft(e.nodeLookup,{filter:rh}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Vo=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,sh=(e,t)=>Vo(e.viewBB,t.viewBB)&&Vo(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,ah="react-flow__minimap-desc";function Si({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:l,maskColor:c,maskStrokeColor:u,maskStrokeWidth:f,position:d="bottom-right",onClick:h,onNodeClick:p,pannable:v=!1,zoomable:x=!1,ariaLabel:m,inversePan:_,zoomStep:g=1,offsetScale:w=5}){const N=ne(),S=z.useRef(null),{boundingRect:C,viewBB:k,rfId:A,panZoom:O,translateExtent:D,flowWidth:L,flowHeight:H,ariaLabelConfig:y}=ee(ih,sh),E=e?.width??nh,b=e?.height??oh,M=C.width/E,P=C.height/b,T=Math.max(M,P),R=T*E,V=T*b,B=w*T,Y=C.x-(R-C.width)/2-B,F=C.y-(V-C.height)/2-B,G=R+B*2,Q=V+B*2,W=`${ah}-${A}`,$=z.useRef(0),j=z.useRef();$.current=T,z.useEffect(()=>{if(S.current&&O)return j.current=Iu({domNode:S.current,panZoom:O,getTransform:()=>N.getState().transform,getViewScale:()=>$.current}),()=>{j.current?.destroy()}},[O]),z.useEffect(()=>{j.current?.update({translateExtent:D,width:L,height:H,inversePan:_,pannable:v,zoomStep:g,zoomable:
6x})},[v,x,_,g,D,L,H]);const K=h?q=>{const[J,te]=j.current?.pointer(q)||[0,0];h(q,{x:J,y:te})}:void 0,U=p?z.useCallback((q,J)=>{const te=N.getState().nodeLookup.get(J).internals.userNode;p(q,te)},[]):void 0,Z=m??y["minimap.ariaLabel"];return I.jsx(Xt,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*T:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:ie(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:I.jsxs("svg",{width:E,height:b,viewBox:`${Y} ${F} ${G} ${Q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:S,onClick:K,children:[Z&&I.jsx("title",{id:W,children:Z}),I.jsx(th,{onClick:U,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),I.jsx("path",{className:"react-flow__minimap-mask",d:`M${Y-B},${F-B}h${G+B*2}v${Q+B*2}h${-G-B*2}z
7        M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Si.displayName="MiniMap";z.memo(Si);const ch=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,lh={[qe.Line]:"right",[qe.Handle]:"bottom-right"};function uh({nodeId:e,position:t,variant:n=qe.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:d,autoScale:h=!0,shouldResize:p,onResizeStart:v,onResize:x,onResizeEnd:m}){const _=ei(),g=typeof e=="string"?e:_,w=ne(),N=z.useRef(null),S=n===qe.Handle,C=ee(z.useCallback(ch(S&&h),[S,h]),re),k=z.useRef(null),A=t??lh[n];z.useEffect(()=>{if(!(!N.current||!g))return k.current||(k.current=Ou({domNode:N.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:D,transform:L,snapGrid:H,snapToGrid:y,nodeOrigin:E,domNode:b}
7=w.getState();return{nodeLookup:D,transform:L,snapGrid:H,snapToGrid:y,nodeOrigin:E,paneDomNode:b}},onChange:(D,L)=>{const{triggerNodeChanges:H,nodeLookup:y,parentLookup:E,nodeOrigin:b}=w.getState(),M=[],P={x:D.x,y:D.y},T=y.get(g);if(T&&T.expandParent&&T.parentId){const R=T.origin??b,V=D.width??T.measured.width??0,B=D.height??T.measured.height??0,Y={id:T.id,parentId:T.parentId,rect:{width:V,height:B,...br({x:D.x??T.position.x,y:D.y??T.position.y},{width:V,height:B},T.parentId,y,R)}},F=Pn([Y],y,E,b);M.push(...F),P.x=D.x?Math.max(R[0]*V,D.x):void 0,P.y=D.y?Math.max(R[1]*B,D.y):void 0}if(P.x!==void 0&&P.y!==void 0){const R={id:g,type:"position",position:{...P}};M.push(R)}if(D.width!==void 0&&D.height!==void 0){const V={id:g,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};M.push(V)}for(const R of L){const V={...R,type:"position"};M.push(V)}H(M)},onEnd:({width:D,height:L})=>{const H={id:g,type:"dimensions",resizing:!1,dimensions:{width:D,height:L}};w.getState().triggerNodeChanges([H])}})),k.current.update({controlPosition:A,boundaries:{minWidth:a,minHeight:l,maxWidth:c,maxHeight:u},keepAspectRatio:f,resizeDirection:d,onResizeStart:v,onResize:x,onResizeEnd:m,shouldResize:p}),()=>{k.current?.destroy()}},[A,a,l,c,u,f,v,x,m,p]);const O=A.split("-");return I.jsx("div",{className:ie(["react-flow__resize-control","nodrag",...O,n,o]),ref:N,style:{...r,scale:C,...s&&{[S?"backgroundColor":"borderColor"]:s}},children:i})}z.memo(uh);function dh(e){const t=Is.c(17),{data:n}=e;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=I.jsx(Ue,{type:"target",position:X.Top,className:"!border-0 !bg-transparent"}),t[0]=o):o=t[0];let r;t[1]!==n?(r=I.jsx(Ts,{member:n,className:"mx-auto mb-2 size-8 text-xs"}),t[1]=n,t[2]=r):r=t[2];let i;t[3]!==n.name?(i=I.jsx("div",{className:"truncate text-sm font-semibold",children:n.name}),t[3]=n.name,t[4]=i):i=t[4];let s;t[5]!==n.job_title?(s=n.job_title&&I.jsx("div",{className:"truncate text-xs text-muted-foreground",children:n.job_title}),t[5]=n.job_title,t[6]=s):s=t[6];let a;t[7]!==n.roles?(a=n.roles.map(fh),t[7]=n.roles,t[8]=a):a=t[8];let l;t[9]!==a?(l=I.jsx("div",{className:"mt-1 flex flex-wrap justify-center gap-1",children:a}),t[9]=a,t[10]=l):l=t[10];let c;t[11]===Symbol.for("react.memo_cache_sentinel")?(c=I.jsx(Ue,{type:"source",position:X.Bottom,className:"!border-0 !bg-transparent"}),t[11]=c):c=t[11];let u;return t[12]!==r||t[13]!==i||t[14]!==s||t[15]!==l?(u=I.jsxs("div",{className:"w-56 rounded-lg border bg-card p-3 text-center shadow-sm",children:[o,r,i,s,l,c]}),t[12]=r,t[13]=i,t[14]=s,t[15]=l,t[16]=u):u=t[16],u}function fh(e){return I.jsx(zs,{variant:"secondary",className:"text-[10px] capitalize",children:e},e)}const _h=Object.freeze(Object.defineProperty({__proto__:null,MemberNode:dh},Symbol.toStringTag,{value:"Module"}));export{vh as B,dh as M,wh as i,_h as m};

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.