var Tr=Object.defineProperty,Pr=Object.defineProperties;var kr=Object.getOwnPropertyDescriptors;var Zt=Object.getOwnPropertySymbols;var xo=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable;var ht=Math.pow,bo=(e,t,n)=>t in e?Tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$=(e,t)=>{for(var n in t||(t={}))xo.call(t,n)&&bo(e,n,t[n]);if(Zt)for(var n of Zt(t))Eo.call(t,n)&&bo(e,n,t[n]);return e},de=(e,t)=>Pr(e,kr(t));var gt=(e,t)=>{var n={};for(var o in e)xo.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Zt)for(var o of Zt(e))t.indexOf(o)<0&&Eo.call(e,o)&&(n[o]=e[o]);return n};var So=(e,t,n)=>new Promise((o,i)=>{var r=l=>{try{a(n.next(l))}catch(u){i(u)}},s=l=>{try{a(n.throw(l))}catch(u){i(u)}},a=l=>l.done?o(l.value):Promise.resolve(l.value).then(r,s);a((n=n.apply(e,t)).next())});import{d as we,b9 as vi,bc as Ct,eN as pi,n as pe,p as re,k as ye,e as ge,N as Xe,s as Ue,u as ee,v as wt,Q as le,a as Ee,dx as $r,g as at,i as Oe,b as lt,a4 as mi,F as ze,M as be,T as Dr,eO as Ar,m as et,a$ as Or,o as zr,f as Fe,w as Gn,Z as Mt,r as Br,ba as on,V as Vr,j as Rr,t as Xn,Y as Hr,l as ao,x as Ge,y as yi,eP as Lr,L as Qe,aE as lo,b6 as Fr,eQ as Yr,bd as bt,h as _i,K as me,a1 as rn,eR as Gr}from"./index-Bxsg-rc-.js";function Bt(e){return vi()?(on(e),!0):!1}function Le(e){return typeof e=="function"?e():ee(e)}const Xr=typeof window!="undefined"&&typeof document!="undefined",Ur=e=>typeof e!="undefined",Zr=Object.prototype.toString,Wr=e=>Zr.call(e)==="[object Object]",Kr=()=>{};function qr(e,t){function n(...o){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(r)})}return n}const wi=e=>e();function Qr(e=wi){const t=Ee(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:Gr(t),pause:n,resume:o,eventFilter:i}}function No(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function Jr(e,t,n={}){const r=n,{eventFilter:o=wi}=r,i=gt(r,["eventFilter"]);return pe(e,qr(o,t),i)}function vt(e,t,n={}){const c=n,{eventFilter:o}=c,i=gt(c,["eventFilter"]),{eventFilter:r,pause:s,resume:a,isActive:l}=Qr(o);return{stop:Jr(e,t,de($({},i),{eventFilter:r})),pause:s,resume:a,isActive:l}}function jr(e,t={}){if(!lo(e))return Fr(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=Yr(()=>({get(){return e.value[o]},set(i){var r;if((r=Le(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=i,e.value=a}else{const a=de($({},e.value),{[o]:i});Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=i}}));return n}function Un(e,t=!1){function n(d,{flush:h="sync",deep:g=!1,timeout:E,throwOnTimeout:_}={}){let S=null;const I=[new Promise(y=>{S=pe(e,N=>{d(N)!==t&&(S==null||S(),y(N))},{flush:h,deep:g,immediate:!0})})];return E!=null&&I.push(No(E,_).then(()=>Le(e)).finally(()=>S==null?void 0:S())),Promise.race(I)}function o(d,h){if(!lo(d))return n(N=>N===d,h);const{flush:g="sync",deep:E=!1,timeout:_,throwOnTimeout:S}=h!=null?h:{};let C=null;const y=[new Promise(N=>{C=pe([e,d],([z,L])=>{t!==(z===L)&&(C==null||C(),N(z))},{flush:g,deep:E,immediate:!0})})];return _!=null&&y.push(No(_,S).then(()=>Le(e)).finally(()=>(C==null||C(),Le(e)))),Promise.race(y)}function i(d){return n(h=>!!h,d)}function r(d){return o(null,d)}function s(d){return o(void 0,d)}function a(d){return n(Number.isNaN,d)}function l(d,h){return n(g=>{const E=Array.from(g);return E.includes(d)||E.includes(Le(d))},h)}function u(d){return c(1,d)}function c(d=1,h){let g=-1;return n(()=>(g+=1,g>=d),h)}return Array.isArray(Le(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return Un(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:a,toBeUndefined:s,changed:u,changedTimes:c,get not(){return Un(e,!t)}}}function Zn(e){return Un(e)}function es(e){var t;const n=Le(e);return(t=n==null?void 0:n.$el)!=null?t:n}const bi=Xr?window:void 0;function xi(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=bi):[t,n,o,i]=e,!t)return Kr;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],s=()=>{r.forEach(c=>c()),r.length=0},a=(c,d,h,g)=>(c.addEventListener(d,h,g),()=>c.removeEventListener(d,h,g)),l=pe(()=>[es(t),Le(i)],([c,d])=>{if(s(),!c)return;const h=Wr(d)?$({},d):d;r.push(...n.flatMap(g=>o.map(E=>a(c,g,E,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return Bt(u),u}function ts(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Co(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=bi,eventName:r="keydown",passive:s=!1,dedupe:a=!1}=o,l=ts(t);return xi(i,r,c=>{c.repeat&&Le(a)||l(c)&&n(c)},s)}function ns(e){return JSON.parse(JSON.stringify(e))}function Dn(e,t,n,o={}){var i,r,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:h}=o,g=Mt(),E=n||(g==null?void 0:g.emit)||((i=g==null?void 0:g.$emit)==null?void 0:i.bind(g))||((s=(r=g==null?void 0:g.proxy)==null?void 0:r.$emit)==null?void 0:s.bind(g==null?void 0:g.proxy));let _=u;t||(t="modelValue"),_=_||`update:${t.toString()}`;const S=y=>a?typeof a=="function"?a(y):ns(y):y,C=()=>Ur(e[t])?S(e[t]):d,I=y=>{h?h(y)&&E(_,y):E(_,y)};if(l){const y=C(),N=Ee(y);let z=!1;return pe(()=>e[t],L=>{z||(z=!0,N.value=S(L),Ge(()=>z=!1))}),pe(N,L=>{!z&&(L!==e[t]||c)&&I(L)},{deep:c}),N}else return re({get(){return C()},set(y){I(y)}})}var os={value:()=>{}};function xn(){for(var e=0,t=arguments.length,n={},o;e=0&&(o=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}sn.prototype=xn.prototype={constructor:sn,on:function(e,t){var n=this._,o=is(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r0)for(var n=new Array(i),o=0,i,r;o=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Io.hasOwnProperty(t)?{space:Io[t],local:e}:e}function ss(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Wn&&t.documentElement.namespaceURI===Wn?t.createElement(e):t.createElementNS(n,e)}}function as(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ei(e){var t=En(e);return(t.local?as:ss)(t)}function ls(){}function uo(e){return e==null?ls:function(){return this.querySelector(e)}}function us(e){typeof e!="function"&&(e=uo(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i=y&&(y=I+1);!(z=S[y])&&++y=0;)(s=o[i])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function As(e){e||(e=Os);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;rt?1:e>=t?0:NaN}function zs(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Bs(){return Array.from(this)}function Vs(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Ks:typeof t=="function"?Qs:qs)(e,t,n==null?"":n)):xt(this.node(),e)}function xt(e,t){return e.style.getPropertyValue(t)||Ii(e).getComputedStyle(e,null).getPropertyValue(t)}function js(e){return function(){delete this[e]}}function ea(e,t){return function(){this[e]=t}}function ta(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function na(e,t){return arguments.length>1?this.each((t==null?js:typeof t=="function"?ta:ea)(e,t)):this.node()[e]}function Ti(e){return e.trim().split(/^|\s+/)}function co(e){return e.classList||new Pi(e)}function Pi(e){this._node=e,this._names=Ti(e.getAttribute("class")||"")}Pi.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 ki(e,t){for(var n=co(e),o=-1,i=t.length;++o=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Pa(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n()=>e;function Kn(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:r,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,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:u,enumerable:!0,configurable:!0},_:{value:c}})}Kn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ha(e){return!e.ctrlKey&&!e.button}function La(){return this.parentNode}function Fa(e,t){return t==null?{x:e.x,y:e.y}:t}function Ya(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ga(){var e=Ha,t=La,n=Fa,o=Ya,i={},r=xn("start","drag","end"),s=0,a,l,u,c,d=0;function h(N){N.on("mousedown.drag",g).filter(o).on("touchstart.drag",S).on("touchmove.drag",C,Ra).on("touchend.drag touchcancel.drag",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(N,z){if(!(c||!e.call(this,N,z))){var L=y(this,t.call(this,N,z),N,z,"mouse");L&&(Ie(N.view).on("mousemove.drag",E,Vt).on("mouseup.drag",_,Vt),Oi(N.view),An(N),u=!1,a=N.clientX,l=N.clientY,L("start",N))}}function E(N){if(mt(N),!u){var z=N.clientX-a,L=N.clientY-l;u=z*z+L*L>d}i.mouse("drag",N)}function _(N){Ie(N.view).on("mousemove.drag mouseup.drag",null),zi(N.view,u),mt(N),i.mouse("end",N)}function S(N,z){if(e.call(this,N,z)){var L=N.changedTouches,W=t.call(this,N,z),F=L.length,Q,U;for(Q=0;Q>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Kt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Kt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Ua.exec(e))?new Ce(t[1],t[2],t[3],1):(t=Za.exec(e))?new Ce(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Wa.exec(e))?Kt(t[1],t[2],t[3],t[4]):(t=Ka.exec(e))?Kt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qa.exec(e))?Oo(t[1],t[2]/100,t[3]/100,1):(t=Qa.exec(e))?Oo(t[1],t[2]/100,t[3]/100,t[4]):To.hasOwnProperty(e)?$o(To[e]):e==="transparent"?new Ce(NaN,NaN,NaN,0):null}function $o(e){return new Ce(e>>16&255,e>>8&255,e&255,1)}function Kt(e,t,n,o){return o<=0&&(e=t=n=NaN),new Ce(e,t,n,o)}function el(e){return e instanceof Ut||(e=ut(e)),e?(e=e.rgb(),new Ce(e.r,e.g,e.b,e.opacity)):new Ce}function qn(e,t,n,o){return arguments.length===1?el(e):new Ce(e,t,n,o==null?1:o)}function Ce(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}fo(Ce,qn,Bi(Ut,{brighter(e){return e=e==null?fn:Math.pow(fn,e),new Ce(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Rt:Math.pow(Rt,e),new Ce(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ce(rt(this.r),rt(this.g),rt(this.b),hn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Do,formatHex:Do,formatHex8:tl,formatRgb:Ao,toString:Ao}));function Do(){return`#${it(this.r)}${it(this.g)}${it(this.b)}`}function tl(){return`#${it(this.r)}${it(this.g)}${it(this.b)}${it((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ao(){const e=hn(this.opacity);return`${e===1?"rgb(":"rgba("}${rt(this.r)}, ${rt(this.g)}, ${rt(this.b)}${e===1?")":`, ${e})`}`}function hn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function rt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function it(e){return e=rt(e),(e<16?"0":"")+e.toString(16)}function Oo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Te(e,t,n,o)}function Vi(e){if(e instanceof Te)return new Te(e.h,e.s,e.l,e.opacity);if(e instanceof Ut||(e=ut(e)),!e)return new Te;if(e instanceof Te)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),s=NaN,a=r-i,l=(r+i)/2;return a?(t===r?s=(n-o)/a+(n0&&l<1?0:s,new Te(s,a,l,e.opacity)}function nl(e,t,n,o){return arguments.length===1?Vi(e):new Te(e,t,n,o==null?1:o)}function Te(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}fo(Te,nl,Bi(Ut,{brighter(e){return e=e==null?fn:Math.pow(fn,e),new Te(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Rt:Math.pow(Rt,e),new Te(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,i=2*n-o;return new Ce(On(e>=240?e-240:e+120,i,o),On(e,i,o),On(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Te(zo(this.h),qt(this.s),qt(this.l),hn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=hn(this.opacity);return`${e===1?"hsl(":"hsla("}${zo(this.h)}, ${qt(this.s)*100}%, ${qt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function zo(e){return e=(e||0)%360,e<0?e+360:e}function qt(e){return Math.max(0,Math.min(1,e||0))}function On(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ho=e=>()=>e;function ol(e,t){return function(n){return e+n*t}}function il(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function rl(e){return(e=+e)==1?Ri:function(t,n){return n-t?il(t,n,e):ho(isNaN(t)?n:t)}}function Ri(e,t){var n=t-e;return n?ol(e,n):ho(isNaN(e)?t:e)}const gn=(function e(t){var n=rl(t);function o(i,r){var s=n((i=qn(i)).r,(r=qn(r)).r),a=n(i.g,r.g),l=n(i.b,r.b),u=Ri(i.opacity,r.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o})(1);function sl(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),i;return function(r){for(i=0;in&&(r=t.slice(n,r),a[s]?a[s]+=r:a[++s]=r),(o=o[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:$e(o,i)})),n=zn.lastIndex;return n180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(i(d)+"rotate(",null,o)-2,x:$e(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function a(u,c,d,h){u!==c?h.push({i:d.push(i(d)+"skewX(",null,o)-2,x:$e(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,h,g,E){if(u!==d||c!==h){var _=g.push(i(g)+"scale(",null,",",null,")");E.push({i:_-4,x:$e(u,d)},{i:_-2,x:$e(c,h)})}else(d!==1||h!==1)&&g.push(i(g)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,d,h),s(u.rotate,c.rotate,d,h),a(u.skewX,c.skewX,d,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(g){for(var E=-1,_=h.length,S;++E<_;)d[(S=h[E]).i]=S.x(g);return d.join("")}}}var vl=Fi(hl,"px, ","px)","deg)"),pl=Fi(gl,", ",")",")"),ml=1e-12;function Vo(e){return((e=Math.exp(e))+1/e)/2}function yl(e){return((e=Math.exp(e))-1/e)/2}function _l(e){return((e=Math.exp(2*e))-1)/(e+1)}const an=(function e(t,n,o){function i(r,s){var a=r[0],l=r[1],u=r[2],c=s[0],d=s[1],h=s[2],g=c-a,E=d-l,_=g*g+E*E,S,C;if(_=0&&e._call.call(void 0,t),e=e._next;--Et}function Ro(){ct=(pn=Lt.now())+Sn,Et=kt=0;try{bl()}finally{Et=0,El(),ct=0}}function xl(){var e=Lt.now(),t=e-pn;t>Yi&&(Sn-=t,pn=e)}function El(){for(var e,t=vn,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:vn=n);$t=e,jn(o)}function jn(e){if(!Et){kt&&(kt=clearTimeout(kt));var t=e-ct;t>24?(e<1/0&&(kt=setTimeout(Ro,e-Lt.now()-Sn)),Tt&&(Tt=clearInterval(Tt))):(Tt||(pn=Lt.now(),Tt=setInterval(xl,Yi)),Et=1,Gi(Ro))}}function Ho(e,t,n){var o=new mn;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Sl=xn("start","end","cancel","interrupt"),Nl=[],Ui=0,Lo=1,eo=2,ln=3,Fo=4,to=5,un=6;function Nn(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Cl(e,n,{name:t,index:o,group:i,on:Sl,tween:Nl,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ui})}function vo(e,t){var n=Pe(e,t);if(n.state>Ui)throw new Error("too late; already scheduled");return n}function Be(e,t){var n=Pe(e,t);if(n.state>ln)throw new Error("too late; already running");return n}function Pe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Cl(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Xi(r,0,n.time);function r(u){n.state=Lo,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,h,g;if(n.state!==Lo)return l();for(c in o)if(g=o[c],g.name===n.name){if(g.state===ln)return Ho(s);g.state===Fo?(g.state=un,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[c]):+ceo&&o.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function nu(e,t,n){var o,i,r=tu(t)?vo:Be;return function(){var s=r(this,e),a=s.on;a!==o&&(i=(o=a).copy()).on(t,n),s.on=i}}function ou(e,t){var n=this._id;return arguments.length<2?Pe(this.node(),n).on.on(e):this.each(nu(n,e,t))}function iu(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ru(){return this.on("end.remove",iu(this._id))}function su(e){var t=this._name,n=this._id;typeof e!="function"&&(e=uo(e));for(var o=this._groups,i=o.length,r=new Array(i),s=0;s()=>e;function ku(e,{sourceEvent:t,target:n,transform:o,dispatch:i}){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:i}})}function Ye(e,t,n){this.k=e,this.x=t,this.y=n}Ye.prototype={constructor:Ye,scale:function(e){return e===1?this:new Ye(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ye(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 St=new Ye(1,0,0);Ye.prototype;function Bn(e){e.stopImmediatePropagation()}function Pt(e){e.preventDefault(),e.stopImmediatePropagation()}function $u(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Du(){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 Yo(){return this.__zoom||St}function Au(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ou(){return navigator.maxTouchPoints||"ontouchstart"in this}function zu(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s))}function Bu(){var e=$u,t=Du,n=zu,o=Au,i=Ou,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=an,u=xn("start","zoom","end"),c,d,h,g=500,E=150,_=0,S=10;function C(m){m.property("__zoom",Yo).on("wheel.zoom",F,{passive:!1}).on("mousedown.zoom",Q).on("dblclick.zoom",U).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",b).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(m,T,x,k){var A=m.selection?m.selection():m;A.property("__zoom",Yo),m!==A?z(m,T,x,k):A.interrupt().each(function(){L(this,arguments).event(k).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},C.scaleBy=function(m,T,x,k){C.scaleTo(m,function(){var A=this.__zoom.k,B=typeof T=="function"?T.apply(this,arguments):T;return A*B},x,k)},C.scaleTo=function(m,T,x,k){C.transform(m,function(){var A=t.apply(this,arguments),B=this.__zoom,O=x==null?N(A):typeof x=="function"?x.apply(this,arguments):x,Z=B.invert(O),J=typeof T=="function"?T.apply(this,arguments):T;return n(y(I(B,J),O,Z),A,s)},x,k)},C.translateBy=function(m,T,x,k){C.transform(m,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof x=="function"?x.apply(this,arguments):x),t.apply(this,arguments),s)},null,k)},C.translateTo=function(m,T,x,k,A){C.transform(m,function(){var B=t.apply(this,arguments),O=this.__zoom,Z=k==null?N(B):typeof k=="function"?k.apply(this,arguments):k;return n(St.translate(Z[0],Z[1]).scale(O.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof x=="function"?-x.apply(this,arguments):-x),B,s)},k,A)};function I(m,T){return T=Math.max(r[0],Math.min(r[1],T)),T===m.k?m:new Ye(T,m.x,m.y)}function y(m,T,x){var k=T[0]-x[0]*m.k,A=T[1]-x[1]*m.k;return k===m.x&&A===m.y?m:new Ye(m.k,k,A)}function N(m){return[(+m[0][0]+ +m[1][0])/2,(+m[0][1]+ +m[1][1])/2]}function z(m,T,x,k){m.on("start.zoom",function(){L(this,arguments).event(k).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(k).end()}).tween("zoom",function(){var A=this,B=arguments,O=L(A,B).event(k),Z=t.apply(A,B),J=x==null?N(Z):typeof x=="function"?x.apply(A,B):x,ie=Math.max(Z[1][0]-Z[0][0],Z[1][1]-Z[0][1]),se=A.__zoom,H=typeof T=="function"?T.apply(A,B):T,Y=l(se.invert(J).concat(ie/se.k),H.invert(J).concat(ie/H.k));return function(G){if(G===1)G=H;else{var ae=Y(G),ue=ie/ae[2];G=new Ye(ue,J[0]-ae[0]*ue,J[1]-ae[1]*ue)}O.zoom(null,G)}})}function L(m,T,x){return!x&&m.__zooming||new W(m,T)}function W(m,T){this.that=m,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(m,T),this.taps=0}W.prototype={event:function(m){return m&&(this.sourceEvent=m),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(m,T){return this.mouse&&m!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&m!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&m!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(m){var T=Ie(this.that).datum();u.call(m,this.that,new ku(m,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:u}),T)}};function F(m,...T){if(!e.apply(this,arguments))return;var x=L(this,T).event(m),k=this.__zoom,A=Math.max(r[0],Math.min(r[1],k.k*Math.pow(2,o.apply(this,arguments)))),B=ke(m);if(x.wheel)(x.mouse[0][0]!==B[0]||x.mouse[0][1]!==B[1])&&(x.mouse[1]=k.invert(x.mouse[0]=B)),clearTimeout(x.wheel);else{if(k.k===A)return;x.mouse=[B,k.invert(B)],cn(this),x.start()}Pt(m),x.wheel=setTimeout(O,E),x.zoom("mouse",n(y(I(k,A),x.mouse[0],x.mouse[1]),x.extent,s));function O(){x.wheel=null,x.end()}}function Q(m,...T){if(h||!e.apply(this,arguments))return;var x=m.currentTarget,k=L(this,T,!0).event(m),A=Ie(m.view).on("mousemove.zoom",J,!0).on("mouseup.zoom",ie,!0),B=ke(m,x),O=m.clientX,Z=m.clientY;Oi(m.view),Bn(m),k.mouse=[B,this.__zoom.invert(B)],cn(this),k.start();function J(se){if(Pt(se),!k.moved){var H=se.clientX-O,Y=se.clientY-Z;k.moved=H*H+Y*Y>_}k.event(se).zoom("mouse",n(y(k.that.__zoom,k.mouse[0]=ke(se,x),k.mouse[1]),k.extent,s))}function ie(se){A.on("mousemove.zoom mouseup.zoom",null),zi(se.view,k.moved),Pt(se),k.event(se).end()}}function U(m,...T){if(e.apply(this,arguments)){var x=this.__zoom,k=ke(m.changedTouches?m.changedTouches[0]:m,this),A=x.invert(k),B=x.k*(m.shiftKey?.5:2),O=n(y(I(x,B),k,A),t.apply(this,T),s);Pt(m),a>0?Ie(this).transition().duration(a).call(z,O,k,m):Ie(this).call(C.transform,O,k,m)}}function D(m,...T){if(e.apply(this,arguments)){var x=m.touches,k=x.length,A=L(this,T,m.changedTouches.length===k).event(m),B,O,Z,J;for(Bn(m),O=0;O(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(q||{}),mo=(e=>(e.Partial="partial",e.Full="full",e))(mo||{}),nt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(nt||{}),Je=(e=>(e.Strict="strict",e.Loose="loose",e))(Je||{}),no=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(no||{}),Ot=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Ot||{});const Vu=["INPUT","SELECT","TEXTAREA"],Ru=typeof document!="undefined"?document:null;function oo(e){var t,n;const o=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,i=typeof(o==null?void 0:o.hasAttribute)=="function"?o.hasAttribute("contenteditable"):!1,r=typeof(o==null?void 0:o.closest)=="function"?o.closest(".nokey"):null;return Vu.includes(o==null?void 0:o.nodeName)||i||!!r}function Hu(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Go(e,t,n,o){const i=t.replace("+",` `).replace(` `,` +`).split(` `).map(s=>s.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const r=i.every((s,a)=>n.has(s)&&Array.from(n.values())[a]===i[a]);return o&&n.delete(e.toLowerCase()),r}function Lu(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=Fu(n.code,e);return Array.isArray(e)?e.some(i=>Go(n[o],i,t,n.type==="keyup")):Go(n[o],e,t,n.type==="keyup")}}function Fu(e,t){return t.includes(e)?"code":"key"}function zt(e,t){const n=re(()=>{var u;return(u=le(t==null?void 0:t.target))!=null?u:Ru}),o=Qe(le(e)===!0);let i=!1;const r=new Set;let s=l(le(e));pe(()=>le(e),(u,c)=>{typeof c=="boolean"&&typeof u!="boolean"&&a(),s=l(u)},{immediate:!0}),xi(["blur","contextmenu"],a),Co((...u)=>s(...u),u=>{var C,I;var c,d;const h=(C=le(t==null?void 0:t.actInsideInputWithModifier))!=null?C:!0,g=(I=le(t==null?void 0:t.preventDefault))!=null?I:!1;if(i=Hu(u),(!i||i&&!h)&&oo(u))return;const _=((d=(c=u.composedPath)==null?void 0:c.call(u))==null?void 0:d[0])||u.target,S=(_==null?void 0:_.nodeName)==="BUTTON"||(_==null?void 0:_.nodeName)==="A";!g&&(i||!S)&&u.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),Co((...u)=>s(...u),u=>{var d;const c=(d=le(t==null?void 0:t.actInsideInputWithModifier))!=null?d:!0;if(o.value){if((!i||i&&!c)&&oo(u))return;i=!1,o.value=!1}},{eventName:"keyup",target:n});function a(){i=!1,r.clear(),o.value=le(e)===!0}function l(u){return u===null?(a(),()=>!1):typeof u=="boolean"?(a(),o.value=u,()=>!1):Array.isArray(u)||typeof u=="string"?Lu(u,r):u}return o}const qi="vue-flow__node-desc",Qi="vue-flow__edge-desc",Yu="vue-flow__aria-live",Ji=["Enter"," ","Escape"],_t={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function yn(e){return de($({},e.computedPosition||{x:0,y:0}),{width:e.dimensions.width||0,height:e.dimensions.height||0})}function _n(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)}function Cn(e){return{width:e.offsetWidth,height:e.offsetHeight}}function dt(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function ji(e,t){return{x:dt(e.x,t[0][0],t[1][0]),y:dt(e.y,t[0][1],t[1][1])}}function Xo(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function je(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function st(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!je(e)}function Dt(e){return st(e)&&"computedPosition"in e}function jt(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Gu(e){return jt(e.width)&&jt(e.height)&&jt(e.x)&&jt(e.y)}function Xu(e,t,n){var i;const o={id:e.id.toString(),type:(i=e.type)!=null?i:"default",dimensions:rn({width:0,height:0}),computedPosition:rn($({z:0},e.position)),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:xe(e.data)?e.data:{},events:rn(xe(e.events)?e.events:{})};return Object.assign(t!=null?t:o,e,{id:e.id.toString(),parentNode:n})}function er(e,t,n){var s,a,l,u,c,d,h;var o,i;const r=$({id:e.id.toString(),type:(a=(s=e.type)!=null?s:t==null?void 0:t.type)!=null?a:"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=e.targetHandle)==null?void 0:i.toString(),updatable:(l=e.updatable)!=null?l:n==null?void 0:n.updatable,selectable:(u=e.selectable)!=null?u:n==null?void 0:n.selectable,focusable:(c=e.focusable)!=null?c:n==null?void 0:n.focusable,data:xe(e.data)?e.data:{},events:rn(xe(e.events)?e.events:{}),label:(d=e.label)!=null?d:"",interactionWidth:(h=e.interactionWidth)!=null?h:n==null?void 0:n.interactionWidth},n!=null?n:{});return Object.assign(t!=null?t:r,e,{id:e.id.toString()})}function tr(e,t,n,o){const i=typeof e=="string"?e:e.id,r=new Set,s=o==="source"?"target":"source";for(const a of n)a[s]===i&&r.add(a[o]);return t.filter(a=>r.has(a.id))}function Uu(...e){if(e.length===3){const[r,s,a]=e;return tr(r,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>je(r)&&r.source===o).map(r=>n.find(s=>st(s)&&s.id===r.target))}function Zu(...e){if(e.length===3){const[r,s,a]=e;return tr(r,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>je(r)&&r.target===o).map(r=>n.find(s=>st(s)&&s.id===r.source))}function nr({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t!=null?t:""}-${n}${o!=null?o:""}`}function Wu(e,t){return t.some(n=>je(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))}function Ft({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function Yt({x:e,y:t},{x:n,y:o,zoom:i},r=!1,s=[1,1]){const a={x:(e-n)/i,y:(t-o)/i};return r?Mn(a,s):a}function Ku(e,t){return{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)}}function or({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function qu({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function ir(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n0,N=(_!=null?_:0)*(S!=null?S:0);(I||y||C>=N||d.dragging)&&s.push(d)}return s}function sr(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const o of e)n.add(o.id);return t.filter(o=>n.has(o.source)||n.has(o.target))}function pt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return It(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Qu(e,t,n){var o,i,r,s,a,l,u,c;if(typeof e=="string"||typeof e=="number"){const d=pt(e,n),h=pt(e,t);return{top:d,right:h,bottom:d,left:h,x:h*2,y:d*2}}if(typeof e=="object"){const d=pt((i=(o=e.top)!=null?o:e.y)!=null?i:0,n),h=pt((s=(r=e.bottom)!=null?r:e.y)!=null?s:0,n),g=pt((l=(a=e.left)!=null?a:e.x)!=null?l:0,t),E=pt((c=(u=e.right)!=null?u:e.x)!=null?c:0,t);return{top:d,right:E,bottom:h,left:g,x:g+E,y:d+h}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Ju(e,t,n,o,i,r){const{x:s,y:a}=Ft(e,{x:t,y:n,zoom:o}),{x:l,y:u}=Ft({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:o}),c=i-l,d=r-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(c),bottom:Math.floor(d)}}function Uo(e,t,n,o,i,r=.1){const s=Qu(r,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),c=dt(u,o,i),d=e.x+e.width/2,h=e.y+e.height/2,g=t/2-d*c,E=n/2-h*c,_=Ju(e,g,E,c,t,n),S={left:Math.min(_.left-s.left,0),top:Math.min(_.top-s.top,0),right:Math.min(_.right-s.right,0),bottom:Math.min(_.bottom-s.bottom,0)};return{x:g-S.left+S.right,y:E-S.top+S.bottom,zoom:c}}function ju(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function ar(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:ar(n,t):!1}function Gt(e,t){return typeof e=="undefined"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function Zo(e){const t=e.ctrlKey&&wn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function Wo(e,t,n){return en?-dt(Math.abs(e-n),1,t)/t:0}function lr(e,t,n=15,o=40){const i=Wo(e.x,o,t.width-o)*n,r=Wo(e.y,o,t.height-o)*n;return[i,r]}function Vn(e,t){var n,o;if(t){const i=e.position.x+e.dimensions.width-t.dimensions.width,r=e.position.y+e.dimensions.height-t.dimensions.height;if(i>0||r>0||e.position.x<0||e.position.y<0){let s={};if(typeof t.style=="function"?s=$({},t.style(t)):t.style&&(s=$({},t.style)),s.width=(n=s.width)!=null?n:`${t.dimensions.width}px`,s.height=(o=s.height)!=null?o:`${t.dimensions.height}px`,i>0)if(typeof s.width=="string"){const a=Number(s.width.replace("px",""));s.width=`${a+i}px`}else s.width+=i;if(r>0)if(typeof s.height=="string"){const a=Number(s.height.replace("px",""));s.height=`${a+r}px`}else s.height+=r;if(e.position.x<0){const a=Math.abs(e.position.x);if(t.position.x=t.position.x-a,typeof s.width=="string"){const l=Number(s.width.replace("px",""));s.width=`${l+a}px`}else s.width+=a;e.position.x=0}if(e.position.y<0){const a=Math.abs(e.position.y);if(t.position.y=t.position.y-a,typeof s.height=="string"){const l=Number(s.height.replace("px",""));s.height=`${l+a}px`}else s.height+=a;e.position.y=0}t.dimensions.width=Number(s.width.toString().replace("px","")),t.dimensions.height=Number(s.height.toString().replace("px","")),typeof t.style=="function"?t.style=a=>{const l=t.style;return $($({},l(a)),s)}:t.style=$($({},t.style),s)}}}function Ko(e,t){var n,o;const i=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of i)if(s.type==="add")t.findIndex(l=>l.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const a=t.findIndex(l=>l.id===s.id);a!==-1&&t.splice(a,1)}const r=t.map(s=>s.id);for(const s of t)for(const a of e)if(a.id===s.id)switch(a.type){case"select":s.selected=a.selected;break;case"position":if(Dt(s)&&(typeof a.position!="undefined"&&(s.position=a.position),typeof a.dragging!="undefined"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&Dt(l)&&Vn(s,l)}break;case"dimensions":if(Dt(s)&&(typeof a.dimensions!="undefined"&&(s.dimensions=a.dimensions),typeof a.updateStyle!="undefined"&&a.updateStyle&&(s.style=de($({},s.style||{}),{width:`${(n=a.dimensions)==null?void 0:n.width}px`,height:`${(o=a.dimensions)==null?void 0:o.height}px`})),typeof a.resizing!="undefined"&&(s.resizing=a.resizing),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&Dt(l)&&(!!l.dimensions.width&&!!l.dimensions.height?Vn(s,l):Ge(()=>{Vn(s,l)}))}break}return t}function Ke(e,t){return{id:e,type:"select",selected:t}}function qo(e){return{item:e,type:"add"}}function Qo(e){return{id:e,type:"remove"}}function Jo(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function qe(e,t=new Set,n=!1){const o=[];for(const[i,r]of e){const s=t.has(i);!(r.selected===void 0&&!s)&&r.selected!==s&&(n&&(r.selected=s),o.push(Ke(r.id,s)))}return o}const jo=()=>{};function R(e){const t=new Set;let n=jo,o=()=>!1;const i=()=>t.size>0||o(),r=h=>{n=h},s=()=>{n=jo},a=h=>{o=h},l=()=>{o=()=>!1},u=h=>{t.delete(h)};return{on:h=>{t.add(h);const g=()=>u(h);return Bt(g),{off:g}},off:u,trigger:h=>{const g=[n];return i()?g.push(...t):e&&g.push(e),Promise.allSettled(g.map(E=>E(h)))},hasListeners:i,listeners:t,setEmitter:r,removeEmitter:s,setHasEmitListeners:a,removeHasEmitListeners:l}}function ei(e,t,n){let o=e;do{if(o&&o.matches(t))return!0;if(o===n)return!1;o=o.parentElement}while(o);return!1}function ec(e,t,n,o){var i,r;const s=new Map;for(const[a,l]of e)(l.selected||l.id===o)&&(!l.parentNode||!ar(l,e))&&(l.draggable||t&&typeof l.draggable=="undefined")&&e.get(a)&&s.set(a,{id:l.id,position:l.position||{x:0,y:0},distance:{x:n.x-((i=l.computedPosition)==null?void 0:i.x)||0,y:n.y-((r=l.computedPosition)==null?void 0:r.y)||0},from:{x:l.computedPosition.x,y:l.computedPosition.y},extent:l.extent,parentNode:l.parentNode,dimensions:$({},l.dimensions),expandParent:l.expandParent});return Array.from(s.values())}function Rn({id:e,dragItems:t,findNode:n}){const o=[];for(const i of t){const r=n(i.id);r&&o.push(r)}return[e?o.find(i=>i.id===e):o[0],o]}function ur(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function tc(e,t,n){const[o,i,r,s]=typeof e!="string"?ur(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x!="undefined"&&typeof n.computedPosition.y!="undefined"&&typeof n.dimensions.width!="undefined"&&typeof n.dimensions.height!="undefined"?[[n.computedPosition.x+s,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function nc(e,t,n,o){let i=e.extent||n;if((i==="parent"||!Array.isArray(i)&&(i==null?void 0:i.range)==="parent")&&!e.expandParent)if(e.parentNode&&o&&e.dimensions.width&&e.dimensions.height){const r=tc(i,e,o);r&&(i=r)}else t(new Ne(Se.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const r=(o==null?void 0:o.computedPosition.x)||0,s=(o==null?void 0:o.computedPosition.y)||0;i=[[i[0][0]+r,i[0][1]+s],[i[1][0]+r,i[1][1]+s]]}else if(i!=="parent"&&(i!=null&&i.range)&&Array.isArray(i.range)){const[r,s,a,l]=ur(i.padding),u=(o==null?void 0:o.computedPosition.x)||0,c=(o==null?void 0:o.computedPosition.y)||0;i=[[i.range[0][0]+u+l,i.range[0][1]+c+r],[i.range[1][0]+u-s,i.range[1][1]+c-a]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function oc({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function yo(e,t,n,o,i){const r=oc(e.dimensions,nc(e,n,o,i)),s=ji(t,r);return{position:{x:s.x-((i==null?void 0:i.computedPosition.x)||0),y:s.y-((i==null?void 0:i.computedPosition.y)||0)},computedPosition:s}}function Nt(e,t,n=q.Left,o=!1){var u,c,d;const i=((u=t==null?void 0:t.x)!=null?u:0)+e.computedPosition.x,r=((c=t==null?void 0:t.y)!=null?c:0)+e.computedPosition.y,{width:s,height:a}=t!=null?t:ac(e);if(o)return{x:i+s/2,y:r+a/2};switch((d=t==null?void 0:t.position)!=null?d:n){case q.Top:return{x:i+s/2,y:r};case q.Right:return{x:i+s,y:r+a/2};case q.Bottom:return{x:i+s/2,y:r+a};case q.Left:return{x:i,y:r+a/2}}}function ti(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function ic({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:s,height:a,viewport:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+o,t.y+r)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=or({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:s/l.zoom,height:a/l.zoom}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),h=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*h)>0}function rc(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const r=t(e.source),s=t(e.target);return!r||!s?0:(n&&(i=o?e.zIndex:Math.max(r.computedPosition.z||0,s.computedPosition.z||0)),i)}var Se=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Se||{});const ni={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent Node: ${e} Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing Edge: ${e} Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing Edge: ${e} Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same Edge: ${e} Source: ${t} Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing Edge: ${e} Source: ${t} Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Ne extends Error{constructor(t,...n){var o;super((o=ni[t])==null?void 0:o.call(ni,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function _o(e){return"clientX"in e}function sc(e){return"sourceEvent"in e}function De(e,t){var r,s;const n=_o(e);let o,i;return n?(o=e.clientX,i=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,i=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(o=0,i=0),{x:o-((r=t==null?void 0:t.left)!=null?r:0),y:i-((s=t==null?void 0:t.top)!=null?s:0)}}const wn=()=>{var e;return typeof navigator!="undefined"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ac(e){var o,i,r,s;var t,n;return{width:(i=(o=(t=e.dimensions)==null?void 0:t.width)!=null?o:e.width)!=null?i:0,height:(s=(r=(n=e.dimensions)==null?void 0:n.height)!=null?r:e.height)!=null?s:0}}function Mn(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const lc=()=>!0;function Hn(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function uc(e,t,n){const o=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())_n(i,yn(r))>0&&o.push(r);return o}const cc=250;function dc(e,t,n,o){var u,c,d;var i,r;let s=[],a=Number.POSITIVE_INFINITY;const l=uc(e,n,t+cc);for(const h of l){const g=[...(u=(i=h.handleBounds)==null?void 0:i.source)!=null?u:[],...(c=(r=h.handleBounds)==null?void 0:r.target)!=null?c:[]];for(const E of g){if(o.nodeId===E.nodeId&&o.type===E.type&&o.id===E.id)continue;const{x:_,y:S}=Nt(h,E,E.position,!0),C=Math.sqrt(ht(_-e.x,2)+ht(S-e.y,2));C>t||(C1){const h=o.type==="source"?"target":"source";return(d=s.find(g=>g.type===h))!=null?d:s[0]}return s[0]}function oi(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:s,lib:a,flowId:l,isValidConnection:u=lc},c,d,h,g){const E=r==="target",_=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:S,y:C}=De(e),I=s.elementFromPoint(S,C),y=I!=null&&I.classList.contains(`${a}-flow__handle`)?I:_,N={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const z=cr(void 0,y),L=y.getAttribute("data-nodeid"),W=y.getAttribute("data-handleid"),F=y.classList.contains("connectable"),Q=y.classList.contains("connectableend");if(!L||!z)return N;const U={source:E?L:o,sourceHandle:E?W:i,target:E?o:L,targetHandle:E?i:W};N.connection=U;const b=F&&Q&&(n===Je.Strict?E&&z==="source"||!E&&z==="target":L!==o||W!==i);N.isValid=b&&u(U,{nodes:d,edges:c,sourceNode:h(U.source),targetNode:h(U.target)}),N.toHandle=dr(L,z,W,g,n,!0)}return N}function cr(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function fc(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function hc(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function dr(e,t,n,o,i,r=!1){var h,g,E;var s,a,l;const u=o.get(e);if(!u)return null;const c=i===Je.Strict?(s=u.handleBounds)==null?void 0:s[t]:[...(h=(a=u.handleBounds)==null?void 0:a.source)!=null?h:[],...(g=(l=u.handleBounds)==null?void 0:l.target)!=null?g:[]],d=(E=n?c==null?void 0:c.find(_=>_.id===n):c==null?void 0:c[0])!=null?E:null;return d&&r?$($({},d),Nt(u,d,d.position,!0)):d}const io={[q.Left]:q.Right,[q.Right]:q.Left,[q.Top]:q.Bottom,[q.Bottom]:q.Top},gc=["production","prod"];function It(e,...t){fr()&&console.warn(`[Vue Flow]: ${e}`,...t)}function fr(){return!gc.includes("production")}function ii(e,t,n,o,i){const r=t.querySelectorAll(`.vue-flow__handle.${e}`);return r!=null&&r.length?Array.from(r).map(s=>{const a=s.getBoundingClientRect();return $({id:s.getAttribute("data-handleid"),type:e,nodeId:i,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o},Cn(s))}):null}function ro(e,t,n,o,i,r=!1,s){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),Ge(()=>{s.blur()})):n([e])}function xe(e){return typeof ee(e)!="undefined"}function vc(e,t,n,o){var r;if(!e||!e.source||!e.target)return n(new Ne(Se.EDGE_INVALID,(r=e==null?void 0:e.id)!=null?r:"[ID UNKNOWN]")),!1;let i;return je(e)?i=e:i=de($({},e),{id:nr(e)}),i=er(i,void 0,o),Wu(i,t)?!1:i}function pc(e,t,n,o,i){if(!t.source||!t.target)return i(new Ne(Se.EDGE_INVALID,e.id)),!1;if(!n)return i(new Ne(Se.EDGE_NOT_FOUND,e.id)),!1;const a=e,{id:r}=a,s=gt(a,["id"]);return de($({},s),{id:o?nr(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})}function ri(e,t,n){const o={},i=[];for(let r=0;ra.id===r.parentNode);r.parentNode&&!s&&n(new Ne(Se.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),s&&(s.isParent=!0))}return i}function si(e,t,n,o,i,r){let s=i;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${i}-${e}`;const l=o.get(s)||new Map;if(o.set(s,l.set(n,t)),r){s=`${i}-${e}-${r}`;const u=o.get(s)||new Map;o.set(s,u.set(n,t))}}function Ln(e,t,n){e.clear();for(const o of n){const{source:i,target:r,sourceHandle:s=null,targetHandle:a=null}=o,l={edgeId:o.id,source:i,target:r,sourceHandle:s,targetHandle:a},u=`${i}-${s}--${r}-${a}`,c=`${r}-${a}--${i}-${s}`;si("source",l,c,e,i,s),si("target",l,u,e,r,a)}}function ai(e,t,n){if(!n)return;const o=[];for(const i of e.keys())t.has(i)||o.push(e.get(i));o.length&&n(o)}function mc(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(const n of e.keys())if(!t.has(n))return!1;return!0}function li(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Fn(e,t,n,o,i,r,s,a){const l=[];for(const u of e){const c=je(u)?u:vc(u,a,i,r);if(!c)continue;const d=n(c.source),h=n(c.target);if(!d||!h){i(new Ne(Se.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){i(new Ne(Se.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!h){i(new Ne(Se.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:s,sourceNode:d,targetNode:h})){i(new Ne(Se.EDGE_INVALID,c.id));continue}const g=o(c.id);l.push(de($({},er(c,g,r)),{sourceNode:d,targetNode:h}))}return l}const ui=Symbol("vueFlow"),hr=Symbol("nodeId"),gr=Symbol("nodeRef"),yc=Symbol("edgeId"),_c=Symbol("edgeRef"),In=Symbol("slots");function vr(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodeLookup:r,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:h,findNode:g,multiSelectionActive:E,nodesSelectionActive:_,selectNodesOnDrag:S,removeSelectedElements:C,addSelectedNodes:I,updateNodePositions:y,emits:N}=_e(),{onStart:z,onDrag:L,onStop:W,onClick:F,el:Q,disabled:U,id:D,selectable:b,dragHandle:j}=e,m=Qe(!1);let T=[],x,k=null,A={x:void 0,y:void 0},B={x:0,y:0},O=null,Z=!1,J=!1,ie=0,se=!1;const H=xc(),Y=({x:oe,y:ce})=>{A={x:oe,y:ce};let v=!1;if(T=T.map(f=>{const p={x:oe-f.distance.x,y:ce-f.distance.y},{computedPosition:w}=yo(f,n.value?Mn(p,o.value):p,N.error,s.value,f.parentNode?g(f.parentNode):void 0);return v=v||f.position.x!==w.x||f.position.y!==w.y,f.position=w,f}),J=J||v,!!v&&(y(T,!0,!0),m.value=!0,O)){const[f,p]=Rn({id:D,dragItems:T,findNode:g});L({event:O,node:f,nodes:p})}},G=()=>{var v,f;if(!k)return;const[oe,ce]=lr(B,k,c.value);if(oe!==0||ce!==0){const p={x:((v=A.x)!=null?v:0)-oe/l.value.zoom,y:((f=A.y)!=null?f:0)-ce/l.value.zoom};h({x:oe,y:ce})&&Y(p)}ie=requestAnimationFrame(G)},ae=(oe,ce)=>{Z=!0;const v=g(D);!S.value&&!E.value&&v&&(v.selected||C()),v&&le(b)&&S.value&&ro(v,E.value,I,C,_,!1,ce);const f=H(oe.sourceEvent);if(A=f,T=ec(r.value,d.value,f,D),T.length){const[p,w]=Rn({id:D,dragItems:T,findNode:g});z({event:oe.sourceEvent,node:p,nodes:w})}},ue=(oe,ce)=>{var v;oe.sourceEvent.type==="touchmove"&&oe.sourceEvent.touches.length>1||(J=!1,a.value===0&&ae(oe,ce),A=H(oe.sourceEvent),k=((v=t.value)==null?void 0:v.getBoundingClientRect())||null,B=De(oe.sourceEvent,k))},fe=(oe,ce)=>{var f,p;const v=H(oe.sourceEvent);if(!se&&Z&&u.value&&(se=!0,G()),!Z){const w=v.xSnapped-((f=A.x)!=null?f:0),P=v.ySnapped-((p=A.y)!=null?p:0);Math.sqrt(w*w+P*P)>a.value&&ae(oe,ce)}(A.x!==v.xSnapped||A.y!==v.ySnapped)&&T.length&&Z&&(O=oe.sourceEvent,B=De(oe.sourceEvent,k),Y(v))},ve=oe=>{var v,f;let ce=!1;if(!Z&&!m.value&&!E.value){const p=oe.sourceEvent,w=H(p),P=w.xSnapped-((v=A.x)!=null?v:0),V=w.ySnapped-((f=A.y)!=null?f:0),M=Math.sqrt(P*P+V*V);M!==0&&M<=a.value&&(F==null||F(p),ce=!0)}if(T.length&&!ce){J&&(y(T,!1,!1),J=!1);const[p,w]=Rn({id:D,dragItems:T,findNode:g});W({event:oe.sourceEvent,node:p,nodes:w})}T=[],m.value=!1,se=!1,Z=!1,A={x:void 0,y:void 0},cancelAnimationFrame(ie)};return pe([()=>le(U),Q],([oe,ce],v,f)=>{if(ce){const p=Ie(ce);oe||(x=Ga().on("start",w=>ue(w,ce)).on("drag",w=>fe(w,ce)).on("end",w=>ve(w)).filter(w=>{const P=w.target,V=le(j);return!w.button&&(!i.value||!ei(P,`.${i.value}`,ce)&&(!V||ei(P,V,ce)))}),p.call(x)),f(()=>{p.on(".drag",null),x&&(x.on("start",null),x.on("drag",null),x.on("end",null))})}}),m}function wc(){return{doubleClick:R(),click:R(),mouseEnter:R(),mouseMove:R(),mouseLeave:R(),contextMenu:R(),updateStart:R(),update:R(),updateEnd:R()}}function bc(e,t){const n=wc();return n.doubleClick.on(o=>{var i,r;t.edgeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.edgeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.edgeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.edgeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.edgeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.edgeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.updateStart.on(o=>{var i,r;t.edgeUpdateStart(o),(r=(i=e.events)==null?void 0:i.updateStart)==null||r.call(i,o)}),n.update.on(o=>{var i,r;t.edgeUpdate(o),(r=(i=e.events)==null?void 0:i.update)==null||r.call(i,o)}),n.updateEnd.on(o=>{var i,r;t.edgeUpdateEnd(o),(r=(i=e.events)==null?void 0:i.updateEnd)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function xc(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=_e();return i=>{var g;var r;const s=(g=(r=o.value)==null?void 0:r.getBoundingClientRect())!=null?g:{left:0,top:0},a=sc(i)?i.sourceEvent:i,{x:l,y:u}=De(a,s),c=Yt({x:l,y:u},e.value),{x:d,y:h}=n.value?Mn(c,t.value):c;return $({xSnapped:d,ySnapped:h},c)}}function en(){return!0}function pr({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:g,autoPanOnConnect:E,autoPanSpeed:_,findNode:S,panBy:C,startConnection:I,updateConnection:y,endConnection:N,emits:z,viewport:L,edges:W,nodes:F,isValidConnection:Q,nodeLookup:U}=_e();let D=null,b=!1,j=null;function m(x){var k;const A=le(n)==="target",B=_o(x),O=Xo(x.target),Z=x.currentTarget;if(Z&&(B&&x.button===0||!B)){let J=function(K){v=De(K,ve),Y=dc(Yt(v,L.value,!1,[1,1]),c.value,U.value,w),f||(p(),f=!0);const te=oi(K,{handle:Y,connectionMode:u.value,fromNodeId:le(t),fromHandleId:le(e),fromType:A?"target":"source",isValidConnection:H,doc:O,lib:"vue",flowId:a,nodeLookup:U.value},W.value,F.value,S,U.value);j=te.handleDomNode,D=te.connection,b=hc(!!Y,te.isValid);const ne=de($({},X),{isValid:b,to:te.toHandle&&b?Ft({x:te.toHandle.x,y:te.toHandle.y},L.value):v,toHandle:te.toHandle,toPosition:b&&te.toHandle?te.toHandle.position:io[w.position],toNode:te.toHandle?U.value.get(te.toHandle.nodeId):null});if(b&&Y&&(X!=null&&X.toHandle)&&ne.toHandle&&X.toHandle.type===ne.toHandle.type&&X.toHandle.nodeId===ne.toHandle.nodeId&&X.toHandle.id===ne.toHandle.id&&X.to.x===ne.to.x&&X.to.y===ne.to.y)return;const he=Y!=null?Y:te.toHandle;if(y(he&&b?Ft({x:he.x,y:he.y},L.value):v,he,fc(!!he,b)),X=ne,!Y&&!b&&!j)return Hn(ce);D&&D.source!==D.target&&j&&(Hn(ce),ce=j,j.classList.add("connecting","vue-flow__handle-connecting"),j.classList.toggle("valid",!!b),j.classList.toggle("vue-flow__handle-valid",!!b))},ie=function(K){"touches"in K&&K.touches.length>0||((Y||j)&&D&&b&&(r?r(K,D):z.connect(D)),z.connectEnd(K),i&&(s==null||s(K)),Hn(ce),cancelAnimationFrame(G),N(K),f=!1,b=!1,D=null,j=null,O.removeEventListener("mousemove",J),O.removeEventListener("mouseup",ie),O.removeEventListener("touchmove",J),O.removeEventListener("touchend",ie))};const se=S(le(t));let H=le(o)||Q.value||en;!H&&se&&(H=(A?se.isValidSourcePos:se.isValidTargetPos)||en);let Y,G=0;const{x:ae,y:ue}=De(x),fe=cr(le(i),Z),ve=(k=l.value)==null?void 0:k.getBoundingClientRect();if(!ve||!fe)return;const oe=dr(le(t),fe,le(e),U.value,u.value);if(!oe)return;let ce,v=De(x,ve),f=!1;const p=()=>{if(!E.value)return;const[K,te]=lr(v,ve,_.value);C({x:K,y:te}),G=requestAnimationFrame(p)},w=de($({},oe),{nodeId:le(t),type:fe,position:oe.position}),P=U.value.get(le(t)),M={inProgress:!0,isValid:null,from:Nt(P,w,q.Left,!0),fromHandle:w,fromPosition:w.position,fromNode:P,to:v,toHandle:null,toPosition:io[w.position],toNode:null};I($({nodeId:le(t),id:le(e),type:fe,position:(Z==null?void 0:Z.getAttribute("data-handlepos"))||q.Top},v),{x:ae-ve.left,y:ue-ve.top}),z.connectStart({event:x,nodeId:le(t),handleId:le(e),handleType:fe});let X=M;O.addEventListener("mousemove",J),O.addEventListener("mouseup",ie),O.addEventListener("touchmove",J),O.addEventListener("touchend",ie)}}function T(x){var H;var k,A;if(!d.value)return;const B=le(n)==="target";if(!h.value){z.clickConnectStart({event:x,nodeId:le(t),handleId:le(e)}),I($({nodeId:le(t),type:le(n),id:le(e),position:q.Top},De(x)),void 0,!0);return}let O=le(o)||Q.value||en;const Z=S(le(t));if(!O&&Z&&(O=(B?Z.isValidSourcePos:Z.isValidTargetPos)||en),Z&&(typeof Z.connectable=="undefined"?g.value:Z.connectable)===!1)return;const J=Xo(x.target),ie=oi(x,{handle:$({nodeId:le(t),id:le(e),type:le(n),position:q.Top},De(x)),connectionMode:u.value,fromNodeId:h.value.nodeId,fromHandleId:(H=h.value.id)!=null?H:null,fromType:h.value.type,isValidConnection:O,doc:J,lib:"vue",flowId:a,nodeLookup:U.value},W.value,F.value,S,U.value),se=((k=ie.connection)==null?void 0:k.source)===((A=ie.connection)==null?void 0:A.target);ie.isValid&&ie.connection&&!se&&z.connect(ie.connection),z.clickConnectEnd(x),N(x,!0)}return{handlePointerDown:m,handleClick:T}}function mr(){return Ct(hr,"")}function yr(e){var a;const t=(a=e!=null?e:mr())!=null?a:"",n=Ct(gr,Ee(null)),{findNode:o,edges:i,emits:r}=_e(),s=o(t);return s||r.error(new Ne(Se.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:re(()=>o(s.parentNode)),connectedEdges:re(()=>sr([s],i.value))}}function Ec(){return{doubleClick:R(),click:R(),mouseEnter:R(),mouseMove:R(),mouseLeave:R(),contextMenu:R(),dragStart:R(),drag:R(),dragStop:R()}}function Sc(e,t){const n=Ec();return n.doubleClick.on(o=>{var i,r;t.nodeDoubleClick(o),(r=(i=e.events)==null?void 0:i.doubleClick)==null||r.call(i,o)}),n.click.on(o=>{var i,r;t.nodeClick(o),(r=(i=e.events)==null?void 0:i.click)==null||r.call(i,o)}),n.mouseEnter.on(o=>{var i,r;t.nodeMouseEnter(o),(r=(i=e.events)==null?void 0:i.mouseEnter)==null||r.call(i,o)}),n.mouseMove.on(o=>{var i,r;t.nodeMouseMove(o),(r=(i=e.events)==null?void 0:i.mouseMove)==null||r.call(i,o)}),n.mouseLeave.on(o=>{var i,r;t.nodeMouseLeave(o),(r=(i=e.events)==null?void 0:i.mouseLeave)==null||r.call(i,o)}),n.contextMenu.on(o=>{var i,r;t.nodeContextMenu(o),(r=(i=e.events)==null?void 0:i.contextMenu)==null||r.call(i,o)}),n.dragStart.on(o=>{var i,r;t.nodeDragStart(o),(r=(i=e.events)==null?void 0:i.dragStart)==null||r.call(i,o)}),n.drag.on(o=>{var i,r;t.nodeDrag(o),(r=(i=e.events)==null?void 0:i.drag)==null||r.call(i,o)}),n.dragStop.on(o=>{var i,r;t.nodeDragStop(o),(r=(i=e.events)==null?void 0:i.dragStop)==null||r.call(i,o)}),Object.entries(n).reduce((o,[i,r])=>(o.emit[i]=r.trigger,o.on[i]=r.on,o),{emit:{},on:{}})}function _r(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGrid:r,nodesDraggable:s,emits:a}=_e();return(l,u=!1)=>{const c=r.value?i.value[0]:5,d=r.value?i.value[1]:5,h=u?4:1,g=l.x*c*h,E=l.y*d*h,_=[];for(const S of e.value)if(S.draggable||s&&typeof S.draggable=="undefined"){const C={x:S.computedPosition.x+g,y:S.computedPosition.y+E},{position:I}=yo(S,C,a.error,t.value,S.parentNode?o(S.parentNode):void 0);_.push({id:S.id,position:I,from:S.position,distance:{x:l.x,y:l.y},dimensions:S.dimensions})}n(_,!0,!1)}}const tn=.1,Nc=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function We(){return It("Viewport not initialized yet."),Promise.resolve(!1)}const Cc={zoomIn:We,zoomOut:We,zoomTo:We,fitView:We,setCenter:We,fitBounds:We,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:We,setTransform:We,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Mc(e){function t(o,i){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((i==null?void 0:i.interpolate)==="linear"?At:an).scaleBy(Yn(e.d3Selection,i==null?void 0:i.duration,i==null?void 0:i.ease,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,s){return new Promise(a=>{var l;const{x:u,y:c}=ji({x:-o,y:-i},e.translateExtent),d=St.translate(-u,-c).scale(r);e.d3Selection&&e.d3Zoom?(l=e.d3Zoom)==null||l.interpolate((s==null?void 0:s.interpolate)==="linear"?At:an).transform(Yn(e.d3Selection,s==null?void 0:s.duration,s==null?void 0:s.ease,()=>{a(!0)}),d):a(!1)})}return re(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:i=>t(1.2,i),zoomOut:i=>t(1/1.2,i),zoomTo:(i,r)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((r==null?void 0:r.interpolate)==="linear"?At:an).scaleTo(Yn(e.d3Selection,r==null?void 0:r.duration,r==null?void 0:r.ease,()=>{s(!0)}),i):s(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(i={padding:tn,includeHiddenNodes:!1,duration:0})=>{var h,g,E;var r,s;const a=[];for(const _ of e.nodes)_.dimensions.width&&_.dimensions.height&&(i!=null&&i.includeHiddenNodes||!_.hidden)&&(!((r=i.nodes)!=null&&r.length)||(s=i.nodes)!=null&&s.length&&i.nodes.includes(_.id))&&a.push(_);if(!a.length)return Promise.resolve(!1);const l=ir(a),{x:u,y:c,zoom:d}=Uo(l,e.dimensions.width,e.dimensions.height,(h=i.minZoom)!=null?h:e.minZoom,(g=i.maxZoom)!=null?g:e.maxZoom,(E=i.padding)!=null?E:tn);return n(u,c,d,i)},setCenter:(i,r,s)=>{const a=typeof(s==null?void 0:s.zoom)!="undefined"?s.zoom:e.maxZoom,l=e.dimensions.width/2-i*a,u=e.dimensions.height/2-r*a;return n(l,u,a,s)},fitBounds:(i,r={padding:tn})=>{var u;const{x:s,y:a,zoom:l}=Uo(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,(u=r.padding)!=null?u:tn);return n(s,a,l,r)},project:i=>Yt(i,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x-r,y:i.y-s};return Yt(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:i.x+r,y:i.y+s};return Ft(a,e.viewport)}return{x:0,y:0}}}:Cc)}function Yn(e,t=0,n=Nc,o=()=>{}){const i=typeof t=="number"&&t>0;return i||o(),i?e.transition().duration(t).ease(n).on("end",o):e}function Ic(e,t,n){const o=pi(!0);return o.run(()=>{const i=()=>{o.run(()=>{let _,S,C=!!(n.nodes.value.length||n.edges.value.length);_=vt([e.modelValue,()=>{var I,y;return(y=(I=e.modelValue)==null?void 0:I.value)==null?void 0:y.length}],([I])=>{I&&Array.isArray(I)&&(S==null||S.pause(),n.setElements(I),!S&&!C&&I.length?C=!0:S==null||S.resume())}),S=vt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([I,y])=>{var N;(N=e.modelValue)!=null&&N.value&&Array.isArray(e.modelValue.value)&&(_==null||_.pause(),e.modelValue.value=[...I,...y],Ge(()=>{_==null||_.resume()}))},{immediate:C}),on(()=>{_==null||_.stop(),S==null||S.stop()})})},r=()=>{o.run(()=>{let _,S,C=!!n.nodes.value.length;_=vt([e.nodes,()=>{var I,y;return(y=(I=e.nodes)==null?void 0:I.value)==null?void 0:y.length}],([I])=>{I&&Array.isArray(I)&&(S==null||S.pause(),n.setNodes(I),!S&&!C&&I.length?C=!0:S==null||S.resume())}),S=vt([n.nodes,()=>n.nodes.value.length],([I])=>{var y;(y=e.nodes)!=null&&y.value&&Array.isArray(e.nodes.value)&&(_==null||_.pause(),e.nodes.value=[...I],Ge(()=>{_==null||_.resume()}))},{immediate:C}),on(()=>{_==null||_.stop(),S==null||S.stop()})})},s=()=>{o.run(()=>{let _,S,C=!!n.edges.value.length;_=vt([e.edges,()=>{var I,y;return(y=(I=e.edges)==null?void 0:I.value)==null?void 0:y.length}],([I])=>{I&&Array.isArray(I)&&(S==null||S.pause(),n.setEdges(I),!S&&!C&&I.length?C=!0:S==null||S.resume())}),S=vt([n.edges,()=>n.edges.value.length],([I])=>{var y;(y=e.edges)!=null&&y.value&&Array.isArray(e.edges.value)&&(_==null||_.pause(),e.edges.value=[...I],Ge(()=>{_==null||_.resume()}))},{immediate:C}),on(()=>{_==null||_.stop(),S==null||S.stop()})})},a=()=>{o.run(()=>{pe(()=>t.maxZoom,()=>{t.maxZoom&&xe(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{pe(()=>t.minZoom,()=>{t.minZoom&&xe(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{pe(()=>t.translateExtent,()=>{t.translateExtent&&xe(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{pe(()=>t.nodeExtent,()=>{t.nodeExtent&&xe(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{pe(()=>t.applyDefault,()=>{xe(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const _=S=>So(null,null,function*(){let C=S;typeof t.autoConnect=="function"&&(C=yield t.autoConnect(S)),C!==!1&&n.addEdges([C])});pe(()=>t.autoConnect,()=>{xe(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),pe(n.autoConnect,(S,C,I)=>{S?n.onConnect(_):n.hooks.value.connect.off(_),I(()=>{n.hooks.value.connect.off(_)})},{immediate:!0})})},g=()=>{const _=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const S of Object.keys(t)){const C=S;if(!_.includes(C)){const I=be(()=>t[C]),y=n[C];lo(y)&&o.run(()=>{pe(I,N=>{xe(N)&&(y.value=N)},{immediate:!0})})}}};i(),r(),s(),l(),a(),u(),c(),d(),h(),g()}),()=>o.stop()}function Tc(){return{edgesChange:R(),nodesChange:R(),nodeDoubleClick:R(),nodeClick:R(),nodeMouseEnter:R(),nodeMouseMove:R(),nodeMouseLeave:R(),nodeContextMenu:R(),nodeDragStart:R(),nodeDrag:R(),nodeDragStop:R(),nodesInitialized:R(),miniMapNodeClick:R(),miniMapNodeDoubleClick:R(),miniMapNodeMouseEnter:R(),miniMapNodeMouseMove:R(),miniMapNodeMouseLeave:R(),connect:R(),connectStart:R(),connectEnd:R(),clickConnectStart:R(),clickConnectEnd:R(),paneReady:R(),init:R(),move:R(),moveStart:R(),moveEnd:R(),selectionDragStart:R(),selectionDrag:R(),selectionDragStop:R(),selectionContextMenu:R(),selectionStart:R(),selectionEnd:R(),viewportChangeStart:R(),viewportChange:R(),viewportChangeEnd:R(),paneScroll:R(),paneClick:R(),paneContextMenu:R(),paneMouseEnter:R(),paneMouseMove:R(),paneMouseLeave:R(),edgeContextMenu:R(),edgeMouseEnter:R(),edgeMouseMove:R(),edgeMouseLeave:R(),edgeDoubleClick:R(),edgeClick:R(),edgeUpdateStart:R(),edgeUpdate:R(),edgeUpdateEnd:R(),updateNodeInternals:R(),error:R(e=>It(e.message))}}function Pc(e,t){const n=Mt();Hr(()=>{for(const[i,r]of Object.entries(t.value)){const s=a=>{e(i,a)};r.setEmitter(s),Bt(r.removeEmitter),r.setHasEmitListeners(()=>o(i)),Bt(r.removeHasEmitListeners)}});function o(i){var r;const s=kc(i);return!!((r=n==null?void 0:n.vnode.props)==null?void 0:r[s])}}function kc(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(i,r)=>r.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function wr(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:mo.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Ot.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:nt.Bezier,style:{}},connectionMode:Je.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:wn()?"Meta":"Control",zoomActivationKeyCode:wn()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Tc(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const $c=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function Dc(e,t,n){const o=Mc(e),i=v=>{const f=v!=null?v:[];e.hooks.updateNodeInternals.trigger(f)},r=v=>Zu(v,e.nodes,e.edges),s=v=>Uu(v,e.nodes,e.edges),a=v=>sr(v,e.edges),l=({id:v,type:f,nodeId:p})=>{var V;var w;const P=v?`-${f}-${v}`:`-${f}`;return Array.from((V=(w=e.connectionLookup.get(`${p}${P}`))==null?void 0:w.values())!=null?V:[])},u=v=>{if(v)return t.value.get(v)},c=v=>{if(v)return n.value.get(v)},d=(v,f,p)=>{var M,X;var w,P;const V=[];for(const K of v){const te={id:K.id,type:"position",dragging:p,from:K.from};if(f&&(te.position=K.position,K.parentNode)){const ne=u(K.parentNode);te.position={x:te.position.x-((M=(w=ne==null?void 0:ne.computedPosition)==null?void 0:w.x)!=null?M:0),y:te.position.y-((X=(P=ne==null?void 0:ne.computedPosition)==null?void 0:P.y)!=null?X:0)}}V.push(te)}V!=null&&V.length&&e.hooks.nodesChange.trigger(V)},h=v=>{if(!e.vueFlowRef)return;const f=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!f)return;const p=window.getComputedStyle(f),{m22:w}=new window.DOMMatrixReadOnly(p.transform),P=[];for(const V of v){const M=V,X=u(M.id);if(X){const K=Cn(M.nodeElement);if(!!(K.width&&K.height&&(X.dimensions.width!==K.width||X.dimensions.height!==K.height||M.forceUpdate))){const ne=M.nodeElement.getBoundingClientRect();X.dimensions=K,X.handleBounds.source=ii("source",M.nodeElement,ne,w,X.id),X.handleBounds.target=ii("target",M.nodeElement,ne,w,X.id),P.push({id:X.id,type:"dimensions",dimensions:K})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),P.length&&e.hooks.nodesChange.trigger(P)},g=(v,f)=>{const p=new Set,w=new Set;for(const M of v)st(M)?p.add(M.id):je(M)&&w.add(M.id);const P=qe(t.value,p,!0),V=qe(n.value,w);if(e.multiSelectionActive){for(const M of p)P.push(Ke(M,f));for(const M of w)V.push(Ke(M,f))}P.length&&e.hooks.nodesChange.trigger(P),V.length&&e.hooks.edgesChange.trigger(V)},E=v=>{if(e.multiSelectionActive){const f=v.map(p=>Ke(p.id,!0));e.hooks.nodesChange.trigger(f);return}e.hooks.nodesChange.trigger(qe(t.value,new Set(v.map(f=>f.id)),!0)),e.hooks.edgesChange.trigger(qe(n.value))},_=v=>{if(e.multiSelectionActive){const f=v.map(p=>Ke(p.id,!0));e.hooks.edgesChange.trigger(f);return}e.hooks.edgesChange.trigger(qe(n.value,new Set(v.map(f=>f.id)))),e.hooks.nodesChange.trigger(qe(t.value,new Set,!0))},S=v=>{g(v,!0)},C=v=>{const p=(v||e.nodes).map(w=>(w.selected=!1,Ke(w.id,!1)));e.hooks.nodesChange.trigger(p)},I=v=>{const p=(v||e.edges).map(w=>(w.selected=!1,Ke(w.id,!1)));e.hooks.edgesChange.trigger(p)},y=v=>{if(!v||!v.length)return g([],!1);const f=v.reduce((p,w)=>{const P=Ke(w.id,!1);return st(w)?p.nodes.push(P):p.edges.push(P),p},{nodes:[],edges:[]});f.nodes.length&&e.hooks.nodesChange.trigger(f.nodes),f.edges.length&&e.hooks.edgesChange.trigger(f.edges)},N=v=>{var f;(f=e.d3Zoom)==null||f.scaleExtent([v,e.maxZoom]),e.minZoom=v},z=v=>{var f;(f=e.d3Zoom)==null||f.scaleExtent([e.minZoom,v]),e.maxZoom=v},L=v=>{var f;(f=e.d3Zoom)==null||f.translateExtent(v),e.translateExtent=v},W=v=>{e.nodeExtent=v,i()},F=v=>{var f;(f=e.d3Zoom)==null||f.clickDistance(v)},Q=v=>{e.nodesDraggable=v,e.nodesConnectable=v,e.elementsSelectable=v},U=v=>{const f=v instanceof Function?v(e.nodes):v;!e.initialized&&!f.length||(e.nodes=ri(f,u,e.hooks.error.trigger))},D=v=>{const f=v instanceof Function?v(e.edges):v;if(!e.initialized&&!f.length)return;const p=Fn(f,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Ln(e.connectionLookup,n.value,p),e.edges=p},b=v=>{const f=v instanceof Function?v([...e.nodes,...e.edges]):v;!e.initialized&&!f.length||(U(f.filter(st)),D(f.filter(je)))},j=v=>{let f=v instanceof Function?v(e.nodes):v;f=Array.isArray(f)?f:[f];const p=ri(f,u,e.hooks.error.trigger),w=[];for(const P of p)w.push(qo(P));w.length&&e.hooks.nodesChange.trigger(w)},m=v=>{let f=v instanceof Function?v(e.edges):v;f=Array.isArray(f)?f:[f];const p=Fn(f,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),w=[];for(const P of p)w.push(qo(P));w.length&&e.hooks.edgesChange.trigger(w)},T=(v,f=!0,p=!1)=>{const w=v instanceof Function?v(e.nodes):v,P=Array.isArray(w)?w:[w],V=[],M=[];function X(te){const ne=a(te);for(const he of ne)(!xe(he.deletable)||he.deletable)&&M.push(Jo(he.id,he.source,he.target,he.sourceHandle,he.targetHandle))}function K(te){const ne=[];for(const he of e.nodes)he.parentNode===te&&ne.push(he);if(ne.length){for(const he of ne)V.push(Qo(he.id));f&&X(ne);for(const he of ne)K(he.id)}}for(const te of P){const ne=typeof te=="string"?u(te):te;ne&&(xe(ne.deletable)&&!ne.deletable||(V.push(Qo(ne.id)),f&&X([ne]),p&&K(ne.id)))}M.length&&e.hooks.edgesChange.trigger(M),V.length&&e.hooks.nodesChange.trigger(V)},x=v=>{const f=v instanceof Function?v(e.edges):v,p=Array.isArray(f)?f:[f],w=[];for(const P of p){const V=typeof P=="string"?c(P):P;V&&(xe(V.deletable)&&!V.deletable||w.push(Jo(typeof P=="string"?P:P.id,V.source,V.target,V.sourceHandle,V.targetHandle)))}e.hooks.edgesChange.trigger(w)},k=(v,f,p=!0)=>{const w=c(v.id);if(!w)return!1;const P=e.edges.indexOf(w),V=pc(v,f,w,p,e.hooks.error.trigger);if(V){const[M]=Fn([V],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((X,K)=>K===P?M:X),Ln(e.connectionLookup,n.value,[M]),M}return!1},A=(v,f,p={replace:!1})=>{const w=c(v);if(!w)return;const P=typeof f=="function"?f(w):f;w.data=p.replace?P:$($({},w.data),P)},B=v=>Ko(v,e.nodes),O=v=>{const f=Ko(v,e.edges);return Ln(e.connectionLookup,n.value,f),f},Z=(v,f,p={replace:!1})=>{const w=u(v);if(!w)return;const P=typeof f=="function"?f(w):f;p.replace?e.nodes.splice(e.nodes.indexOf(w),1,P):Object.assign(w,P)},J=(v,f,p={replace:!1})=>{const w=u(v);if(!w)return;const P=typeof f=="function"?f(w):f;w.data=p.replace?P:$($({},w.data),P)},ie=(v,f,p=!1)=>{p?e.connectionClickStartHandle=v:e.connectionStartHandle=v,e.connectionEndHandle=null,e.connectionStatus=null,f&&(e.connectionPosition=f)},se=(v,f=null,p=null)=>{e.connectionStartHandle&&(e.connectionPosition=v,e.connectionEndHandle=f,e.connectionStatus=p)},H=(v,f)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,f?e.connectionClickStartHandle=null:e.connectionStartHandle=null},Y=v=>{const f=Gu(v),p=f?null:Dt(v)?v:u(v.id);return!f&&!p?[null,null,f]:[f?v:yn(p),p,f]},G=(v,f=!0,p=e.nodes)=>{const[w,P,V]=Y(v);if(!w)return[];const M=[];for(const X of p||e.nodes){if(!V&&(X.id===P.id||!X.computedPosition))continue;const K=yn(X),te=_n(K,w);(f&&te>0||te>=K.width*K.height||te>=Number(w.width)*Number(w.height))&&M.push(X)}return M},ae=(v,f,p=!0)=>{const[w]=Y(v);if(!w)return!1;const P=_n(w,f);return p&&P>0||P>=Number(w.width)*Number(w.height)},ue=v=>{const{viewport:f,dimensions:p,d3Zoom:w,d3Selection:P,translateExtent:V}=e;if(!w||!P||!v.x&&!v.y)return!1;const M=St.translate(f.x+v.x,f.y+v.y).scale(f.zoom),X=[[0,0],[p.width,p.height]],K=w.constrain()(M,X,V),te=e.viewport.x!==K.x||e.viewport.y!==K.y||e.viewport.zoom!==K.k;return w.transform(P,K),te},fe=v=>{const f=v instanceof Function?v(e):v,p=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];xe(f.defaultEdgeOptions)&&(e.defaultEdgeOptions=f.defaultEdgeOptions);const w=f.modelValue||f.nodes||f.edges?[]:void 0;w&&(f.modelValue&&w.push(...f.modelValue),f.nodes&&w.push(...f.nodes),f.edges&&w.push(...f.edges),b(w));const P=()=>{xe(f.maxZoom)&&z(f.maxZoom),xe(f.minZoom)&&N(f.minZoom),xe(f.translateExtent)&&L(f.translateExtent)};for(const V of Object.keys(f)){const M=V,X=f[M];![...$c,...p].includes(M)&&xe(X)&&(e[M]=X)}Zn(()=>e.d3Zoom).not.toBeNull().then(P),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:b,setNodes:U,setEdges:D,addNodes:j,addEdges:m,removeNodes:T,removeEdges:x,findNode:u,findEdge:c,updateEdge:k,updateEdgeData:A,updateNode:Z,updateNodeData:J,applyEdgeChanges:O,applyNodeChanges:B,addSelectedElements:S,addSelectedNodes:E,addSelectedEdges:_,setMinZoom:N,setMaxZoom:z,setTranslateExtent:L,setNodeExtent:W,setPaneClickDistance:F,removeSelectedElements:y,removeSelectedNodes:C,removeSelectedEdges:I,startConnection:ie,updateConnection:se,endConnection:H,setInteractive:Q,setState:fe,getIntersectingNodes:G,getIncomers:r,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:ae,panBy:ue,fitView:v=>o.value.fitView(v),zoomIn:v=>o.value.zoomIn(v),zoomOut:v=>o.value.zoomOut(v),zoomTo:(v,f)=>o.value.zoomTo(v,f),setViewport:(v,f)=>o.value.setViewport(v,f),setTransform:(v,f)=>o.value.setTransform(v,f),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(v,f,p)=>o.value.setCenter(v,f,p),fitBounds:(v,f)=>o.value.fitBounds(v,f),project:v=>o.value.project(v),screenToFlowCoordinate:v=>o.value.screenToFlowCoordinate(v),flowToScreenCoordinate:v=>o.value.flowToScreenCoordinate(v),toObject:()=>{const v=[],f=[];for(const P of e.nodes){const p=P,{computedPosition:V,handleBounds:M,selected:X,dimensions:K,isParent:te,resizing:ne,dragging:he,events:Ve}=p,Re=gt(p,["computedPosition","handleBounds","selected","dimensions","isParent","resizing","dragging","events"]);v.push(Re)}for(const P of e.edges){const w=P,{selected:V,sourceNode:M,targetNode:X,events:K}=w,te=gt(w,["selected","sourceNode","targetNode","events"]);f.push(te)}return JSON.parse(JSON.stringify({nodes:v,edges:f,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:v=>new Promise(f=>{const{nodes:p,edges:w,position:P,zoom:V,viewport:M}=v;p&&U(p),w&&D(w);const[X,K]=M!=null&&M.x&&(M!=null&&M.y)?[M.x,M.y]:P!=null?P:[null,null];if(X&&K){const te=(M==null?void 0:M.zoom)||V||e.viewport.zoom;return Zn(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:X,y:K,zoom:te}).then(()=>{f(!0)})})}else f(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{var f,p,w;const v=wr();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const P=St.translate((f=v.defaultViewport.x)!=null?f:0,(p=v.defaultViewport.y)!=null?p:0).scale(dt((w=v.defaultViewport.zoom)!=null?w:1,v.minZoom,v.maxZoom)),V=e.viewportRef.getBoundingClientRect(),M=[[0,0],[V.width,V.height]],X=e.d3Zoom.constrain()(P,M,v.translateExtent);e.d3Zoom.transform(e.d3Selection,X)}fe(v)},$destroy:()=>{}}}const Ac=["data-id","data-handleid","data-nodeid","data-handlepos"],Oc={name:"Handle",compatConfig:{MODE:3}},bn=we(de($({},Oc),{props:{id:{default:null},type:{},position:{default:()=>q.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=Ar(e,["position","connectable","connectableStart","connectableEnd","id"]),o=be(()=>{var D;return(D=n.type)!=null?D:"source"}),i=be(()=>{var D;return(D=n.isValidConnection)!=null?D:null}),{id:r,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:h}=_e(),{id:g,node:E,nodeEl:_,connectedEdges:S}=yr(),C=Ee(),I=be(()=>typeof e.connectableStart!="undefined"?e.connectableStart:!0),y=be(()=>typeof e.connectableEnd!="undefined"?e.connectableEnd:!0),N=be(()=>{var D,b,j,m,T,x;return((D=s.value)==null?void 0:D.nodeId)===g&&((b=s.value)==null?void 0:b.id)===e.id&&((j=s.value)==null?void 0:j.type)===o.value||((m=l.value)==null?void 0:m.nodeId)===g&&((T=l.value)==null?void 0:T.id)===e.id&&((x=l.value)==null?void 0:x.type)===o.value}),z=be(()=>{var D,b,j;return((D=a.value)==null?void 0:D.nodeId)===g&&((b=a.value)==null?void 0:b.id)===e.id&&((j=a.value)==null?void 0:j.type)===o.value}),{handlePointerDown:L,handleClick:W}=pr({nodeId:g,handleId:e.id,isValidConnection:i,type:o}),F=re(()=>typeof e.connectable=="string"&&e.connectable==="single"?!S.value.some(D=>{const b=D[`${o.value}Handle`];return D[o.value]!==g?!1:b?b===e.id:!0}):typeof e.connectable=="number"?S.value.filter(D=>{const b=D[`${o.value}Handle`];return D[o.value]!==g?!1:b?b===e.id:!0}).length{var B;var D;if(!E.dimensions.width||!E.dimensions.height)return;const b=(D=E.handleBounds[o.value])==null?void 0:D.find(O=>O.id===e.id);if(!u.value||b)return;const j=u.value.querySelector(".vue-flow__transformationpane");if(!_.value||!C.value||!j||!e.id)return;const m=_.value.getBoundingClientRect(),T=C.value.getBoundingClientRect(),x=window.getComputedStyle(j),{m22:k}=new window.DOMMatrixReadOnly(x.transform),A=$({id:e.id,position:e.position,x:(T.left-m.left)/k,y:(T.top-m.top)/k,type:o.value,nodeId:g},Cn(C.value));E.handleBounds[o.value]=[...(B=E.handleBounds[o.value])!=null?B:[],A]});function Q(D){const b=_o(D);F.value&&I.value&&(b&&D.button===0||!b)&&L(D)}function U(D){!g||!a.value&&!I.value||F.value&&W(D)}return t({handleClick:W,handlePointerDown:L,onClick:U,onPointerDown:Q}),(D,b)=>(ge(),ye("div",{ref_key:"handle",ref:C,"data-id":`${ee(r)}-${ee(g)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":ee(g),"data-handlepos":D.position,class:wt(["vue-flow__handle",[`vue-flow__handle-${D.position}`,`vue-flow__handle-${e.id}`,ee(d),ee(h),o.value,{connectable:F.value,connecting:z.value,connectablestart:I.value,connectableend:y.value,connectionindicator:F.value&&(I.value&&!N.value||y.value&&N.value)}]]),onMousedown:Q,onTouchstartPassive:Q,onClick:U},[Xe(D.$slots,"default",{id:D.id})],42,Ac))}})),Tn=function({sourcePosition:e=q.Bottom,targetPosition:t=q.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:s}){var l;const a=(l=s.label)!=null?l:n;return[me(bn,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof a!="string"&&a?me(a):me(ze,[a]),me(bn,{type:"source",position:e,connectable:o,isValidConnection:r})]};Tn.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Tn.inheritAttrs=!1;Tn.compatConfig={MODE:3};const zc=Tn,Pn=function({targetPosition:e=q.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){var s;const r=(s=i.label)!=null?s:t;return[me(bn,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?me(r):me(ze,[r])]};Pn.props=["targetPosition","label","isValidTargetPos","connectable","data"];Pn.inheritAttrs=!1;Pn.compatConfig={MODE:3};const Bc=Pn,kn=function({sourcePosition:e=q.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){var s;const r=(s=i.label)!=null?s:t;return[typeof r!="string"&&r?me(r):me(ze,[r]),me(bn,{type:"source",position:e,connectable:n,isValidConnection:o})]};kn.props=["sourcePosition","label","isValidSourcePos","connectable","data"];kn.inheritAttrs=!1;kn.compatConfig={MODE:3};const Vc=kn,Rc=["transform"],Hc=["width","height","x","y","rx","ry"],Lc=["y"],Fc={name:"EdgeText",compatConfig:{MODE:3}},Yc=we(de($({},Fc),{props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=Ee({x:0,y:0,width:0,height:0}),n=Ee(null),o=re(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);et(i),pe([()=>e.x,()=>e.y,n,()=>e.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==t.value.width||r.height!==t.value.height)&&(t.value=r)}return(r,s)=>(ge(),ye("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(ge(),ye("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*r.labelBgPadding[0]}px`,height:`${t.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:Ue(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,Hc)):Oe("",!0),at("text",mi(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[Xe(r.$slots,"default",{},()=>[typeof r.label!="string"?(ge(),lt(Vr(r.label),{key:0})):(ge(),ye(ze,{key:1},[Rr(Xn(r.label),1)],64))])],16,Lc)],8,Rc))}})),Gc=["id","d","marker-end","marker-start"],Xc=["d","stroke-width"],Uc={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},$n=we(de($({},Uc),{props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=Ee(null),o=Ee(null),i=Ee(null),r=$r();return t({pathEl:n,interactionEl:o,labelEl:i}),(s,a)=>(ge(),ye(ze,null,[at("path",mi(ee(r),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,Gc),s.interactionWidth?(ge(),ye("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,Xc)):Oe("",!0),s.label&&s.labelX&&s.labelY?(ge(),lt(Yc,{key:1,ref_key:"labelEl",ref:i,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Oe("",!0)],64))}}));function br({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,r=n=0?.5*e:t*25*Math.sqrt(-e)}function ci({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let s,a;switch(e){case q.Left:s=t-nn(t-o,r),a=n;break;case q.Right:s=t+nn(o-t,r),a=n;break;case q.Top:s=t,a=n-nn(n-i,r);break;case q.Bottom:s=t,a=n+nn(i-n,r);break}return[s,a]}function Er(e){const{sourceX:t,sourceY:n,sourcePosition:o=q.Bottom,targetX:i,targetY:r,targetPosition:s=q.Top,curvature:a=.25}=e,[l,u]=ci({pos:o,x1:t,y1:n,x2:i,y2:r,c:a}),[c,d]=ci({pos:s,x1:i,y1:r,x2:t,y2:n,c:a}),[h,g,E,_]=xr({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${t},${n} C${l},${u} ${c},${d} ${i},${r}`,h,g,E,_]}function di({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,s;switch(e){case q.Left:case q.Right:r=.5*(t+o),s=n;break;case q.Top:case q.Bottom:r=t,s=.5*(n+i);break}return[r,s]}function Sr(e){const{sourceX:t,sourceY:n,sourcePosition:o=q.Bottom,targetX:i,targetY:r,targetPosition:s=q.Top}=e,[a,l]=di({pos:o,x1:t,y1:n,x2:i,y2:r}),[u,c]=di({pos:s,x1:i,y1:r,x2:t,y2:n}),[d,h,g,E]=xr({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${a},${l} ${u},${c} ${i},${r}`,d,h,g,E]}const fi={[q.Left]:{x:-1,y:0},[q.Right]:{x:1,y:0},[q.Top]:{x:0,y:-1},[q.Bottom]:{x:0,y:1}};function Zc({source:e,sourcePosition:t=q.Bottom,target:n}){return t===q.Left||t===q.Right?e.xe[d]?-1:1)*x:C[d]=(u[d]>n[d]?-1:1)*x}}if(t!==o){const T=d==="x"?"y":"x",x=s[d]===a[T],k=l[T]>u[T],A=l[T]=m?(E=(D.x+b.x)/2,_=g[0].y):(E=g[0].x,_=(D.y+b.y)/2)}return[[e,{x:l.x+S.x,y:l.y+S.y},...g,{x:u.x+C.x,y:u.y+C.y},n],E,_,N,z]}function Kc(e,t,n,o){const i=Math.min(hi(e,t)/2,hi(t,n)/2,o),{x:r,y:s}=t;if(e.x===r&&r===n.x||e.y===s&&s===n.y)return`L${r} ${s}`;if(e.y===s){const u=e.x{let N;return y>0&&y{const[n,o,i]=qc(e);return me($n,$($({path:n,labelX:o,labelY:i},t),e))}}}),Jc=Qc,jc=we({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{var r,s;const[n,o,i]=so(de($({},e),{sourcePosition:(r=e.sourcePosition)!=null?r:q.Bottom,targetPosition:(s=e.targetPosition)!=null?s:q.Top}));return me($n,$($({path:n,labelX:o,labelY:i},t),e))}}}),Nr=jc,ed=we({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>me(Nr,de($($({},e),t),{borderRadius:0}))}}),td=ed,nd=we({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{var r,s;const[n,o,i]=Er(de($({},e),{sourcePosition:(r=e.sourcePosition)!=null?r:q.Bottom,targetPosition:(s=e.targetPosition)!=null?s:q.Top}));return me($n,$($({path:n,labelX:o,labelY:i},t),e))}}}),od=nd,id=we({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{var r,s;const[n,o,i]=Sr(de($({},e),{sourcePosition:(r=e.sourcePosition)!=null?r:q.Bottom,targetPosition:(s=e.targetPosition)!=null?s:q.Top}));return me($n,$($({path:n,labelX:o,labelY:i},t),e))}}}),rd=id,sd={input:Vc,default:zc,output:Bc},ad={default:od,straight:Jc,step:td,smoothstep:Nr,simplebezier:rd};function ld(e,t,n){const o=re(()=>_=>t.value.get(_)),i=re(()=>_=>n.value.get(_)),r=re(()=>{const _=$($({},ad),e.edgeTypes),S=Object.keys(_);for(const C of e.edges)C.type&&!S.includes(C.type)&&(_[C.type]=C.type);return _}),s=re(()=>{const _=$($({},sd),e.nodeTypes),S=Object.keys(_);for(const C of e.nodes)C.type&&!S.includes(C.type)&&(_[C.type]=C.type);return _}),a=re(()=>e.onlyRenderVisibleElements?rr(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=re(()=>{if(e.onlyRenderVisibleElements){const _=[];for(const S of e.edges){const C=t.value.get(S.source),I=t.value.get(S.target);ic({sourcePos:C.computedPosition||{x:0,y:0},targetPos:I.computedPosition||{x:0,y:0},sourceWidth:C.dimensions.width,sourceHeight:C.dimensions.height,targetWidth:I.dimensions.width,targetHeight:I.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&_.push(S)}return _}return e.edges}),u=re(()=>[...a.value,...l.value]),c=re(()=>{const _=[];for(const S of e.nodes)S.selected&&_.push(S);return _}),d=re(()=>{const _=[];for(const S of e.edges)S.selected&&_.push(S);return _}),h=re(()=>[...c.value,...d.value]),g=re(()=>{const _=[];for(const S of e.nodes)S.dimensions.width&&S.dimensions.height&&S.handleBounds!==void 0&&_.push(S);return _}),E=re(()=>a.value.length>0&&g.value.length===a.value.length);return{getNode:o,getEdge:i,getElements:u,getEdgeTypes:r,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:h,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:g,areNodesInitialized:E}}class ot{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var i;var t;const n=(t=Mt())==null?void 0:t.appContext.app,o=(i=n==null?void 0:n.config.globalProperties.$vueFlowStorage)!=null?i:ot.instance;return ot.instance=o!=null?o:new ot,n&&(n.config.globalProperties.$vueFlowStorage=ot.instance),ot.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const o=wr(),i=Br(o),r={};for(const[h,g]of Object.entries(i.hooks)){const E=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;r[E]=g.on}const s={};for(const[h,g]of Object.entries(i.hooks))s[h]=g.trigger;const a=re(()=>{const h=new Map;for(const g of i.nodes)h.set(g.id,g);return h}),l=re(()=>{const h=new Map;for(const g of i.edges)h.set(g.id,g);return h}),u=ld(i,a,l),c=Dc(i,a,l);c.setState($($({},i),n));const d=de($($($($({},r),u),c),jr(i)),{nodeLookup:a,edgeLookup:l,emits:s,id:t,vueFlowVersion:"1.48.1",$destroy:()=>{this.remove(t)}});return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function _e(e){const t=ot.getInstance(),n=vi(),o=typeof e=="object",i=o?e:{id:e},r=i.id,s=r!=null?r:n==null?void 0:n.vueFlowId;let a;if(n){const l=Ct(ui,null);typeof l!="undefined"&&l!==null&&(!s||l.id===s)&&(a=l)}if(a||s&&(a=t.get(s)),!a||s&&a.id!==s){const l=r!=null?r:t.getId(),u=t.create(l,i);a=u,(n!=null?n:pi(!0)).run(()=>{pe(u.applyDefault,(d,h,g)=>{const E=S=>{u.applyNodeChanges(S)},_=S=>{u.applyEdgeChanges(S)};d?(u.onNodesChange(E),u.onEdgesChange(_)):(u.hooks.value.nodesChange.off(E),u.hooks.value.edgesChange.off(_)),g(()=>{u.hooks.value.nodesChange.off(E),u.hooks.value.edgesChange.off(_)})},{immediate:!0}),Bt(()=>{if(a){const d=t.get(a.id);d?d.$destroy():It(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(i);if(n&&(bt(ui,a),n.vueFlowId=a.id),o){const l=Mt();(l==null?void 0:l.type.name)!=="VueFlow"&&a.emits.error(new Ne(Se.USEVUEFLOW_OPTIONS))}return a}function ud(e){const{emits:t,dimensions:n}=_e();let o;et(()=>{const i=()=>{var l;var r,s;if(!e.value||!((l=(s=(r=e.value).checkVisibility)==null?void 0:s.call(r))==null||l))return;const a=Cn(e.value);(a.width===0||a.height===0)&&t.error(new Ne(Se.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};i(),window.addEventListener("resize",i),e.value&&(o=new ResizeObserver(()=>i()),o.observe(e.value)),yi(()=>{window.removeEventListener("resize",i),o&&e.value&&o.unobserve(e.value)})})}const cd={name:"UserSelection",compatConfig:{MODE:3}},dd=we(de($({},cd),{props:{userSelectionRect:{}},setup(e){return(t,n)=>(ge(),ye("div",{class:"vue-flow__selection vue-flow__container",style:Ue({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}})),fd=["tabIndex"],hd={name:"NodesSelection",compatConfig:{MODE:3}},gd=we(de($({},hd),{setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:s}=_e(),a=_r(),l=Ee(null),u=vr({el:l,onStart(E){t.selectionDragStart(E),t.nodeDragStart(E)},onDrag(E){t.selectionDrag(E),t.nodeDrag(E)},onStop(E){t.selectionDragStop(E),t.nodeDragStop(E)}});et(()=>{var E;r.value||(E=l.value)==null||E.focus({preventScroll:!0})});const c=re(()=>ir(o.value)),d=re(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function h(E){t.selectionContextMenu({event:E,nodes:o.value})}function g(E){r.value||_t[E.key]&&(E.preventDefault(),a({x:_t[E.key].x,y:_t[E.key].y},E.shiftKey))}return(E,_)=>!ee(s)&&c.value.width&&c.value.height?(ge(),ye("div",{key:0,class:wt(["vue-flow__nodesselection vue-flow__container",ee(i)]),style:Ue({transform:`translate(${ee(n).x}px,${ee(n).y}px) scale(${ee(n).zoom})`})},[at("div",{ref_key:"el",ref:l,class:wt([{dragging:ee(u)},"vue-flow__nodesselection-rect"]),style:Ue(d.value),tabIndex:ee(r)?void 0:-1,onContextmenu:h,onKeydown:g},null,46,fd)],6)):Oe("",!0)}}));function vd(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const pd={name:"Pane",compatConfig:{MODE:3}},md=we(de($({},pd),{props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:h,removeEdges:g,selectionMode:E,deleteKeyCode:_,multiSelectionKeyCode:S,multiSelectionActive:C,edgeLookup:I,nodeLookup:y,connectionLookup:N,defaultEdgeOptions:z,connectionStartHandle:L,panOnDrag:W}=_e(),F=Qe(null),Q=Qe(new Set),U=Qe(new Set),D=Qe(null),b=be(()=>l.value&&(e.isSelecting||r.value)),j=be(()=>L.value!==null);let m=!1,T=!1;const x=zt(_,{actInsideInputWithModifier:!1}),k=zt(S);pe(x,H=>{H&&(h(d.value),g(c.value),u.value=!1)}),pe(k,H=>{C.value=H});function A(H,Y){return G=>{G.target===Y&&(H==null||H(G))}}function B(H){if(m||j.value){m=!1;return}i.paneClick(H),s(),u.value=!1}function O(H){var Y;if(Array.isArray(W.value)&&((Y=W.value)!=null&&Y.includes(2))){H.preventDefault();return}i.paneContextMenu(H)}function Z(H){i.paneScroll(H)}function J(H){var ve;var Y,G,ae;if(D.value=(ve=(Y=t.value)==null?void 0:Y.getBoundingClientRect())!=null?ve:null,!l.value||!e.isSelecting||H.button!==0||H.target!==F.value||!D.value)return;(ae=(G=H.target)==null?void 0:G.setPointerCapture)==null||ae.call(G,H.pointerId);const{x:ue,y:fe}=vd(H,D.value);T=!0,m=!1,s(),a.value={width:0,height:0,startX:ue,startY:fe,x:ue,y:fe},i.selectionStart(H)}function ie(H){var f,p;var Y;if(!D.value||!a.value)return;m=!0;const{x:G,y:ae}=De(H,D.value),{startX:ue=0,startY:fe=0}=a.value,ve={startX:ue,startY:fe,x:Gw.id)),U.value=new Set;const v=(f=(Y=z.value)==null?void 0:Y.selectable)!=null?f:!0;for(const w of Q.value){const P=N.value.get(w);if(P)for(const{edgeId:V}of P.values()){const M=I.value.get(V);M&&((p=M.selectable)!=null?p:v)&&U.value.add(V)}}if(!li(oe,Q.value)){const w=qe(y.value,Q.value,!0);i.nodesChange(w)}if(!li(ce,U.value)){const w=qe(I.value,U.value);i.edgesChange(w)}a.value=ve,r.value=!0,u.value=!1}function se(H){var Y;H.button!==0||!T||((Y=H.target)==null||Y.releasePointerCapture(H.pointerId),!r.value&&a.value&&H.target===F.value&&B(H),r.value=!1,a.value=null,u.value=Q.value.size>0,i.selectionEnd(H),e.selectionKeyPressed&&(m=!1),T=!1)}return(H,Y)=>(ge(),ye("div",{ref_key:"container",ref:F,class:wt(["vue-flow__pane vue-flow__container",{selection:H.isSelecting}]),onClick:Y[0]||(Y[0]=G=>b.value?void 0:A(B,F.value)(G)),onContextmenu:Y[1]||(Y[1]=G=>A(O,F.value)(G)),onWheelPassive:Y[2]||(Y[2]=G=>A(Z,F.value)(G)),onPointerenter:Y[3]||(Y[3]=G=>b.value?void 0:ee(i).paneMouseEnter(G)),onPointerdown:Y[4]||(Y[4]=G=>b.value?J(G):ee(i).paneMouseMove(G)),onPointermove:Y[5]||(Y[5]=G=>b.value?ie(G):ee(i).paneMouseMove(G)),onPointerup:Y[6]||(Y[6]=G=>b.value?se(G):void 0),onPointerleave:Y[7]||(Y[7]=G=>ee(i).paneMouseLeave(G))},[Xe(H.$slots,"default"),ee(r)&&ee(a)?(ge(),lt(dd,{key:0,"user-selection-rect":ee(a)},null,8,["user-selection-rect"])):Oe("",!0),ee(u)&&ee(d).length?(ge(),lt(gd,{key:1})):Oe("",!0)],34))}})),yd={name:"Transform",compatConfig:{MODE:3}},_d=we(de($({},yd),{setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=_e(),i=re(()=>n.value?!o.value:!1),r=re(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(ge(),ye("div",{class:"vue-flow__transformationpane vue-flow__container",style:Ue({transform:r.value,opacity:i.value?0:void 0})},[Xe(s.$slots,"default")],4))}})),wd={name:"Viewport",compatConfig:{MODE:3}},bd=we(de($({},wd),{setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:g,zoomOnScroll:E,preventScrolling:_,noWheelClassName:S,noPanClassName:C,emits:I,connectionStartHandle:y,userSelectionActive:N,paneDragging:z,d3Zoom:L,d3Selection:W,d3ZoomHandler:F,viewport:Q,viewportRef:U,paneClickDistance:D}=_e();ud(U);const b=Qe(!1),j=Qe(!1);let m=null,T=!1,x=0,k={x:0,y:0,zoom:0};const A=zt(a),B=zt(s),O=zt(r),Z=be(()=>(!B.value||B.value&&s.value===!0)&&(A.value||d.value)),J=be(()=>A.value||l.value),ie=be(()=>B.value||s.value===!0&&Z.value!==!0),se=be(()=>y.value!==null);et(()=>{var w,P,V;if(!U.value){It("Viewport element is missing");return}const ue=U.value,fe=ue.getBoundingClientRect(),ve=Bu().clickDistance(D.value).scaleExtent([t.value,n.value]).translateExtent(i.value),oe=Ie(ue).call(ve),ce=oe.on("wheel.zoom"),v=St.translate((w=o.value.x)!=null?w:0,(P=o.value.y)!=null?P:0).scale(dt((V=o.value.zoom)!=null?V:1,t.value,n.value)),f=[[0,0],[fe.width,fe.height]],p=ve.constrain()(v,f,i.value);ve.transform(oe,p),ve.wheelDelta(Zo),L.value=ve,W.value=oe,F.value=ce,Q.value={x:p.x,y:p.y,zoom:p.k},ve.on("start",M=>{var X;if(!M.sourceEvent)return null;x=M.sourceEvent.button,b.value=!0;const K=G(M.transform);((X=M.sourceEvent)==null?void 0:X.type)==="mousedown"&&(z.value=!0),k=K,I.viewportChangeStart(K),I.moveStart({event:M,flowTransform:K})}),ve.on("end",M=>{if(!M.sourceEvent)return null;if(b.value=!1,z.value=!1,H(Z.value,x!=null?x:0)&&!T&&I.paneContextMenu(M.sourceEvent),T=!1,Y(k,M.transform)){const X=G(M.transform);k=X,I.viewportChangeEnd(X),I.moveEnd({event:M,flowTransform:X})}}),ve.filter(M=>{var X;const K=O.value||E.value,te=g.value&&M.ctrlKey,ne=M.button,he=M.type==="wheel";if(ne===1&&M.type==="mousedown"&&(ae(M,"vue-flow__node")||ae(M,"vue-flow__edge")))return!0;if(!Z.value&&!K&&!J.value&&!h.value&&!g.value||N.value||se.value&&!he||!h.value&&M.type==="dblclick"||ae(M,S.value)&&he||ae(M,C.value)&&(!he||J.value&&he&&!O.value)||!g.value&&M.ctrlKey&&he||!K&&!J.value&&!te&&he)return!1;if(!g&&M.type==="touchstart"&&((X=M.touches)==null?void 0:X.length)>1)return M.preventDefault(),!1;if(!Z.value&&(M.type==="mousedown"||M.type==="touchstart")||s.value===!0&&Array.isArray(d.value)&&d.value.includes(0)&&ne===0||Array.isArray(d.value)&&!d.value.includes(ne)&&(M.type==="mousedown"||M.type==="touchstart"))return!1;const Ve=Array.isArray(d.value)&&d.value.includes(ne)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!ne||ne<=1;return(!M.ctrlKey||A.value||he)&&Ve}),pe([N,Z],()=>{N.value&&!b.value?ve.on("zoom",null):N.value||ve.on("zoom",M=>{Q.value={x:M.transform.x,y:M.transform.y,zoom:M.transform.k};const X=G(M.transform);T=H(Z.value,x!=null?x:0),I.viewportChange(X),I.move({event:M,flowTransform:X})})},{immediate:!0}),pe([N,J,u,O,g,_,S],()=>{J.value&&!O.value&&!N.value?oe.on("wheel.zoom",M=>{if(ae(M,S.value))return!1;const X=O.value||E.value,K=g.value&&M.ctrlKey;if(!(!_.value||J.value||X||K))return!1;M.preventDefault(),M.stopImmediatePropagation();const ne=oe.property("__zoom").k||1,he=wn();if(!A.value&&M.ctrlKey&&g.value&&he){const Cr=ke(M),Mr=Zo(M),Ir=ne*ht(2,Mr);ve.scaleTo(oe,Ir,Cr,M);return}const Ve=M.deltaMode===1?20:1;let Re=u.value===Ot.Vertical?0:M.deltaX*Ve,tt=u.value===Ot.Horizontal?0:M.deltaY*Ve;!he&&M.shiftKey&&u.value!==Ot.Vertical&&!Re&&tt&&(Re=tt,tt=0),ve.translateBy(oe,-(Re/ne)*c.value,-(tt/ne)*c.value);const ft=G(oe.property("__zoom"));m&&clearTimeout(m),j.value?(I.move({event:M,flowTransform:ft}),I.viewportChange(ft),m=setTimeout(()=>{I.moveEnd({event:M,flowTransform:ft}),I.viewportChangeEnd(ft),j.value=!1},150)):(j.value=!0,I.moveStart({event:M,flowTransform:ft}),I.viewportChangeStart(ft))},{passive:!1}):typeof ce!="undefined"&&oe.on("wheel.zoom",function(M,X){const K=!_.value&&M.type==="wheel"&&!M.ctrlKey,te=O.value||E.value,ne=g.value&&M.ctrlKey;if(!te&&!l.value&&!ne&&M.type==="wheel"||K||ae(M,S.value))return null;M.preventDefault(),ce.call(this,M,X)},{passive:!1})},{immediate:!0})});function H(ue,fe){return fe===2&&Array.isArray(ue)&&ue.includes(2)}function Y(ue,fe){return ue.x!==fe.x&&!Number.isNaN(fe.x)||ue.y!==fe.y&&!Number.isNaN(fe.y)||ue.zoom!==fe.k&&!Number.isNaN(fe.k)}function G(ue){return{x:ue.x,y:ue.y,zoom:ue.k}}function ae(ue,fe){return ue.target.closest(`.${fe}`)}return(ue,fe)=>(ge(),ye("div",{ref_key:"viewportRef",ref:U,class:"vue-flow__viewport vue-flow__container"},[Fe(md,{"is-selecting":ie.value,"selection-key-pressed":ee(B),class:wt({connecting:se.value,dragging:ee(z),draggable:ee(d)===!0||Array.isArray(ee(d))&&ee(d).includes(0)})},{default:Gn(()=>[Fe(_d,null,{default:Gn(()=>[Xe(ue.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}})),xd=["id"],Ed=["id"],Sd=["id"],Nd={name:"A11yDescriptions",compatConfig:{MODE:3}},Cd=we(de($({},Nd),{setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=_e();return(i,r)=>(ge(),ye(ze,null,[at("div",{id:`${ee(qi)}-${ee(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+Xn(ee(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,xd),at("div",{id:`${ee(Qi)}-${ee(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,Ed),ee(n)?Oe("",!0):(ge(),ye("div",{key:0,id:`${ee(Yu)}-${ee(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},Xn(ee(o)),9,Sd))],64))}}));function Md(){const e=_e();pe(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Id(e,t,n){return n===q.Left?e-t:n===q.Right?e+t:e}function Td(e,t,n){return n===q.Top?e-t:n===q.Bottom?e+t:e}const wo=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=q.Top,type:i}){return me("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Id(t,e,o),cy:Td(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};wo.props=["radius","centerX","centerY","position","type"];wo.compatConfig={MODE:3};const gi=wo,Pd=we({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:h,multiSelectionActive:g,disableKeyboardA11y:E,elementsSelectable:_,edgesUpdatable:S,edgesFocusable:C,hooks:I}=_e(),y=re(()=>c(e.id)),{emit:N,on:z}=bc(y.value,r),L=Ct(In),W=Mt(),F=Ee(!1),Q=Ee(!1),U=Ee(""),D=Ee(null),b=Ee("source"),j=Ee(null),m=be(()=>typeof y.value.selectable=="undefined"?_.value:y.value.selectable),T=be(()=>typeof y.value.updatable=="undefined"?S.value:y.value.updatable),x=be(()=>typeof y.value.focusable=="undefined"?C.value:y.value.focusable);bt(yc,e.id),bt(_c,j);const k=re(()=>y.value.class instanceof Function?y.value.class(y.value):y.value.class),A=re(()=>y.value.style instanceof Function?y.value.style(y.value):y.value.style),B=re(()=>{var P;const f=y.value.type||"default",p=L==null?void 0:L[`edge-${f}`];if(p)return p;let w=(P=y.value.template)!=null?P:l.value[f];if(typeof w=="string"&&W){const V=Object.keys(W.appContext.components);V&&V.includes(f)&&(w=_i(f,!1))}return w&&typeof w!="string"?w:(r.error(new Ne(Se.EDGE_TYPE_MISSING,w)),!1)}),{handlePointerDown:O}=pr({nodeId:U,handleId:D,type:b,isValidConnection:h,edgeUpdaterType:b,onEdgeUpdate:ie,onEdgeUpdateEnd:se});return()=>{var tt;const f=d(y.value.source),p=d(y.value.target),w="pathOptions"in y.value?y.value.pathOptions:{};if(!f&&!p)return r.error(new Ne(Se.EDGE_SOURCE_TARGET_MISSING,y.value.id,y.value.source,y.value.target)),null;if(!f)return r.error(new Ne(Se.EDGE_SOURCE_MISSING,y.value.id,y.value.source)),null;if(!p)return r.error(new Ne(Se.EDGE_TARGET_MISSING,y.value.id,y.value.target)),null;if(!y.value||y.value.hidden||f.hidden||p.hidden)return null;let P;o.value===Je.Strict?P=f.handleBounds.source:P=[...f.handleBounds.source||[],...f.handleBounds.target||[]];const V=ti(P,y.value.sourceHandle);let M;o.value===Je.Strict?M=p.handleBounds.target:M=[...p.handleBounds.target||[],...p.handleBounds.source||[]];const X=ti(M,y.value.targetHandle),K=(V==null?void 0:V.position)||q.Bottom,te=(X==null?void 0:X.position)||q.Top,{x:ne,y:he}=Nt(f,V,K),{x:Ve,y:Re}=Nt(p,X,te);return y.value.sourceX=ne,y.value.sourceY=he,y.value.targetX=Ve,y.value.targetY=Re,me("g",de($({ref:j,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${B.value===!1?"default":y.value.type||"default"}`,a.value,k.value,{updating:F.value,selected:y.value.selected,animated:y.value.animated,inactive:!m.value&&!I.value.edgeClick.hasListeners()}],tabIndex:x.value?0:void 0,"aria-label":y.value.ariaLabel===null?void 0:(tt=y.value.ariaLabel)!=null?tt:`Edge from ${y.value.source} to ${y.value.target}`,"aria-describedby":x.value?`${Qi}-${t}`:void 0,"aria-roledescription":"edge",role:x.value?"group":"img"},y.value.domAttributes),{onClick:Y,onContextmenu:G,onDblclick:ae,onMouseenter:ue,onMousemove:fe,onMouseleave:ve,onKeyDown:x.value?v:void 0}),[Q.value?null:me(B.value===!1?l.value.default:B.value,$({id:e.id,sourceNode:f,targetNode:p,source:y.value.source,target:y.value.target,type:y.value.type,updatable:T.value,selected:y.value.selected,animated:y.value.animated,label:y.value.label,labelStyle:y.value.labelStyle,labelShowBg:y.value.labelShowBg,labelBgStyle:y.value.labelBgStyle,labelBgPadding:y.value.labelBgPadding,labelBgBorderRadius:y.value.labelBgBorderRadius,data:y.value.data,events:$($({},y.value.events),z),style:A.value,markerStart:`url('#${Gt(y.value.markerStart,t)}')`,markerEnd:`url('#${Gt(y.value.markerEnd,t)}')`,sourcePosition:K,targetPosition:te,sourceX:ne,sourceY:he,targetX:Ve,targetY:Re,sourceHandleId:y.value.sourceHandle,targetHandleId:y.value.targetHandle,interactionWidth:y.value.interactionWidth},w)),[T.value==="source"||T.value===!0?[me("g",{onMousedown:oe,onMouseenter:Z,onMouseout:J},me(gi,{position:K,centerX:ne,centerY:he,radius:i.value,type:"source","data-type":"source"}))]:null,T.value==="target"||T.value===!0?[me("g",{onMousedown:ce,onMouseenter:Z,onMouseout:J},me(gi,{position:te,centerX:Ve,centerY:Re,radius:i.value,type:"target","data-type":"target"}))]:null]])};function Z(){F.value=!0}function J(){F.value=!1}function ie(f,p){N.update({event:f,edge:y.value,connection:p})}function se(f){N.updateEnd({event:f,edge:y.value}),Q.value=!1}function H(f,p){var w;f.button===0&&(Q.value=!0,U.value=p?y.value.target:y.value.source,D.value=(w=p?y.value.targetHandle:y.value.sourceHandle)!=null?w:null,b.value=p?"target":"source",N.updateStart({event:f,edge:y.value}),O(f))}function Y(f){var p;const w={event:f,edge:y.value};m.value&&(s.value=!1,y.value.selected&&g.value?(u([y.value]),(p=j.value)==null||p.blur()):n([y.value])),N.click(w)}function G(f){N.contextMenu({event:f,edge:y.value})}function ae(f){N.doubleClick({event:f,edge:y.value})}function ue(f){N.mouseEnter({event:f,edge:y.value})}function fe(f){N.mouseMove({event:f,edge:y.value})}function ve(f){N.mouseLeave({event:f,edge:y.value})}function oe(f){H(f,!0)}function ce(f){H(f,!1)}function v(f){var p;!E.value&&Ji.includes(f.key)&&m.value&&(f.key==="Escape"?((p=j.value)==null||p.blur(),u([c(e.id)])):n([c(e.id)]))}}}),kd=Pd,$d=we({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:d}=_e(),h=(e=Ct(In))==null?void 0:e["connection-line"],g=re(()=>{var I;return d((I=o.value)==null?void 0:I.nodeId)}),E=re(()=>{var y;var I;return(y=d((I=i.value)==null?void 0:I.nodeId))!=null?y:null}),_=re(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),S=re(()=>l.value.markerStart?`url(#${Gt(l.value.markerStart,t)})`:""),C=re(()=>l.value.markerEnd?`url(#${Gt(l.value.markerEnd,t)})`:"");return()=>{var A,B,O,Z,J,ie,se,H,Y;var I,y,N;if(!g.value||!o.value)return null;const z=o.value.id,L=o.value.type,W=g.value.handleBounds;let F=(A=W==null?void 0:W[L])!=null?A:[];if(n.value===Je.Loose){const G=(B=W==null?void 0:W[L==="source"?"target":"source"])!=null?B:[];F=[...F,...G]}if(!F)return null;const Q=(O=z?F.find(G=>G.id===z):F[0])!=null?O:null,U=(Z=Q==null?void 0:Q.position)!=null?Z:q.Top,{x:D,y:b}=Nt(g.value,Q,U);let j=null;E.value&&(n.value===Je.Strict?j=((I=E.value.handleBounds[L==="source"?"target":"source"])==null?void 0:I.find(G=>{var ae;return G.id===((ae=i.value)==null?void 0:ae.id)}))||null:j=((y=[...(J=E.value.handleBounds.source)!=null?J:[],...(ie=E.value.handleBounds.target)!=null?ie:[]])==null?void 0:y.find(G=>{var ae;return G.id===((ae=i.value)==null?void 0:ae.id)}))||null);const m=(se=(N=i.value)==null?void 0:N.position)!=null?se:U?io[U]:null;if(!U||!m)return null;const T=(Y=(H=s.value)!=null?H:l.value.type)!=null?Y:nt.Bezier;let x="";const k={sourceX:D,sourceY:b,sourcePosition:U,targetX:_.value.x,targetY:_.value.y,targetPosition:m};return T===nt.Bezier?[x]=Er(k):T===nt.Step?[x]=so(de($({},k),{borderRadius:0})):T===nt.SmoothStep?[x]=so(k):T===nt.SimpleBezier?[x]=Sr(k):x=`M${D},${b} ${_.value.x},${_.value.y}`,me("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},me("g",{class:"vue-flow__connection"},h?me(h,{sourceX:D,sourceY:b,sourcePosition:U,targetX:_.value.x,targetY:_.value.y,targetPosition:m,sourceNode:g.value,sourceHandle:Q,targetNode:E.value,targetHandle:j,markerEnd:C.value,markerStart:S.value,connectionStatus:u.value}):me("path",{d:x,class:[l.value.class,u.value,"vue-flow__connection-path"],style:$($({},a.value),l.value.style),"marker-end":C.value,"marker-start":S.value})))}}}),Dd=$d,Ad=["id","markerWidth","markerHeight","markerUnits","orient"],Od={name:"MarkerType",compatConfig:{MODE:3}},zd=we(de($({},Od),{props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>(ge(),ye("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===ee(no).ArrowClosed?(ge(),ye("polyline",{key:0,style:Ue({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):Oe("",!0),t.type===ee(no).Arrow?(ge(),ye("polyline",{key:1,style:Ue({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Oe("",!0)],8,Ad))}})),Bd={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Vd={name:"MarkerDefinitions",compatConfig:{MODE:3}},Rd=we(de($({},Vd),{setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=_e(),r=re(()=>{const s=new Set,a=[],l=u=>{if(u){const c=Gt(u,t);s.has(c)||(typeof u=="object"?a.push(de($({},u),{id:c,color:u.color||i.value})):a.push({id:c,color:i.value,type:u}),s.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return a.sort((u,c)=>u.id.localeCompare(c.id))});return(s,a)=>(ge(),ye("svg",Bd,[at("defs",null,[(ge(!0),ye(ze,null,ao(r.value,l=>(ge(),lt(zd,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}})),Hd={name:"Edges",compatConfig:{MODE:3}},Ld=we(de($({},Hd),{setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=_e();return(i,r)=>(ge(),ye(ze,null,[Fe(Rd),(ge(!0),ye(ze,null,ao(ee(n),s=>(ge(),ye("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Ue({zIndex:ee(rc)(s,ee(t),ee(o))})},[Fe(ee(kd),{id:s.id},null,8,["id"])],4))),128)),Fe(ee(Dd))],64))}})),Fd=we({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:g,disableKeyboardA11y:E,ariaLiveMessage:_,snapToGrid:S,snapGrid:C,nodeDragThreshold:I,nodesDraggable:y,elementsSelectable:N,nodesConnectable:z,nodesFocusable:L,hooks:W}=_e(),F=Ee(null);bt(gr,F),bt(hr,e.id);const Q=Ct(In),U=Mt(),D=_r(),{node:b,parentNode:j}=yr(e.id),{emit:m,on:T}=Sc(b,s),x=be(()=>typeof b.draggable=="undefined"?y.value:b.draggable),k=be(()=>typeof b.selectable=="undefined"?N.value:b.selectable),A=be(()=>typeof b.connectable=="undefined"?z.value:b.connectable),B=be(()=>typeof b.focusable=="undefined"?L.value:b.focusable),O=re(()=>k.value||x.value||W.value.nodeClick.hasListeners()||W.value.nodeDoubleClick.hasListeners()||W.value.nodeMouseEnter.hasListeners()||W.value.nodeMouseMove.hasListeners()||W.value.nodeMouseLeave.hasListeners()),Z=be(()=>!!b.dimensions.width&&!!b.dimensions.height),J=re(()=>{const p=b.type||"default",w=Q==null?void 0:Q[`node-${p}`];if(w)return w;let P=b.template||d.value[p];if(typeof P=="string"&&U){const V=Object.keys(U.appContext.components);V&&V.includes(p)&&(P=_i(p,!1))}return P&&typeof P!="string"?P:(s.error(new Ne(Se.NODE_TYPE_MISSING,P)),!1)}),ie=vr({id:e.id,el:F,disabled:()=>!x.value,selectable:k,dragHandle:()=>b.dragHandle,onStart(p){m.dragStart(p)},onDrag(p){m.drag(p)},onStop(p){m.dragStop(p)},onClick(p){v(p)}}),se=re(()=>b.class instanceof Function?b.class(b):b.class),H=re(()=>{const p=(b.style instanceof Function?b.style(b):b.style)||{},w=b.width instanceof Function?b.width(b):b.width,P=b.height instanceof Function?b.height(b):b.height;return!p.width&&w&&(p.width=typeof w=="string"?w:`${w}px`),!p.height&&P&&(p.height=typeof P=="string"?P:`${P}px`),p}),Y=be(()=>{var p,w;return Number((w=(p=b.zIndex)!=null?p:H.value.zIndex)!=null?w:0)});return c(p=>{(p.includes(e.id)||!p.length)&&ae()}),et(()=>{pe(()=>b.hidden,(p=!1,w,P)=>{!p&&F.value&&(e.resizeObserver.observe(F.value),P(()=>{F.value&&e.resizeObserver.unobserve(F.value)}))},{immediate:!0,flush:"post"})}),pe([()=>b.type,()=>b.sourcePosition,()=>b.targetPosition],()=>{Ge(()=>{u([{id:e.id,nodeElement:F.value,forceUpdate:!0}])})}),pe([()=>b.position.x,()=>b.position.y,()=>{var p;return(p=j.value)==null?void 0:p.computedPosition.x},()=>{var p;return(p=j.value)==null?void 0:p.computedPosition.y},()=>{var p;return(p=j.value)==null?void 0:p.computedPosition.z},Y,()=>b.selected,()=>b.dimensions.height,()=>b.dimensions.width,()=>{var p;return(p=j.value)==null?void 0:p.dimensions.height},()=>{var p;return(p=j.value)==null?void 0:p.dimensions.width}],([p,w,P,V,M,X])=>{const K={x:p,y:w,z:X+(g.value&&b.selected?1e3:0)};typeof P!="undefined"&&typeof V!="undefined"?b.computedPosition=ju({x:P,y:V,z:M},K):b.computedPosition=K},{flush:"post",immediate:!0}),pe([()=>b.extent,h],([p,w],[P,V])=>{(p!==P||w!==V)&&G()}),b.extent==="parent"||typeof b.extent=="object"&&"range"in b.extent&&b.extent.range==="parent"?Zn(()=>Z).toBe(!0).then(G):G(),()=>{var p,w;return b.hidden?null:me("div",de($({ref:F,"data-id":b.id,class:["vue-flow__node",`vue-flow__node-${J.value===!1?"default":b.type||"default"}`,{[n.value]:x.value,dragging:ie==null?void 0:ie.value,draggable:x.value,selected:b.selected,selectable:k.value,parent:b.isParent},se.value],style:$({visibility:Z.value?"visible":"hidden",zIndex:(p=b.computedPosition.z)!=null?p:Y.value,transform:`translate(${b.computedPosition.x}px,${b.computedPosition.y}px)`,pointerEvents:O.value?"all":"none"},H.value),tabIndex:B.value?0:void 0,role:B.value?"group":void 0,"aria-describedby":E.value?void 0:`${qi}-${t}`,"aria-label":b.ariaLabel,"aria-roledescription":"node"},b.domAttributes),{onMouseenter:ue,onMousemove:fe,onMouseleave:ve,onContextmenu:oe,onClick:v,onDblclick:ce,onKeydown:f}),[me(J.value===!1?d.value.default:J.value,{id:b.id,type:b.type,data:b.data,events:$($({},b.events),T),selected:b.selected,resizing:b.resizing,dragging:ie.value,connectable:A.value,position:b.computedPosition,dimensions:b.dimensions,isValidTargetPos:b.isValidTargetPos,isValidSourcePos:b.isValidSourcePos,parent:b.parentNode,parentNodeId:b.parentNode,zIndex:(w=b.computedPosition.z)!=null?w:Y.value,targetPosition:b.targetPosition,sourcePosition:b.sourcePosition,label:b.label,dragHandle:b.dragHandle,onUpdateNodeInternals:ae})])};function G(){const p=b.computedPosition,{computedPosition:w,position:P}=yo(b,S.value?Mn(p,C.value):p,s.error,h.value,j.value);(b.computedPosition.x!==w.x||b.computedPosition.y!==w.y)&&(b.computedPosition=$($({},b.computedPosition),w)),(b.position.x!==P.x||b.position.y!==P.y)&&(b.position=P)}function ae(){F.value&&u([{id:e.id,nodeElement:F.value,forceUpdate:!0}])}function ue(p){ie!=null&&ie.value||m.mouseEnter({event:p,node:b})}function fe(p){ie!=null&&ie.value||m.mouseMove({event:p,node:b})}function ve(p){ie!=null&&ie.value||m.mouseLeave({event:p,node:b})}function oe(p){return m.contextMenu({event:p,node:b})}function ce(p){return m.doubleClick({event:p,node:b})}function v(p){k.value&&(!o.value||!x.value||I.value>0)&&ro(b,r.value,l,a,i,!1,F.value),m.click({event:p,node:b})}function f(p){if(!(oo(p)||E.value))if(Ji.includes(p.key)&&k.value){const w=p.key==="Escape";ro(b,r.value,l,a,i,w,F.value)}else x.value&&b.selected&&_t[p.key]&&(p.preventDefault(),_.value=`Moved selected node ${p.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~b.position.x}, y: ${~~b.position.y}`,D({x:_t[p.key].x,y:_t[p.key].y},p.shiftKey))}}}),Yd=Fd,Gd={height:"0",width:"0"},Xd={name:"EdgeLabelRenderer",compatConfig:{MODE:3}},nf=we(de($({},Xd),{setup(e){const{viewportRef:t}=_e(),n=be(()=>{var o;return(o=t.value)==null?void 0:o.getElementsByClassName("vue-flow__edge-labels")[0]});return(o,i)=>(ge(),ye("svg",null,[(ge(),ye("foreignObject",Gd,[(ge(),lt(Dr,{to:n.value,disabled:!n.value},[Xe(o.$slots,"default")],8,["to","disabled"]))]))]))}}));function Ud(e={includeHiddenNodes:!1}){const{nodes:t}=_e();return re(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&((n==null?void 0:n.handleBounds)===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const Zd={class:"vue-flow__nodes vue-flow__container"},Wd={name:"Nodes",compatConfig:{MODE:3}},Kd=we(de($({},Wd),{setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=_e(),i=Ud(),r=Ee();return pe(i,s=>{s&&Ge(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),et(()=>{r.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));Ge(()=>n(a))})}),yi(()=>{var s;return(s=r.value)==null?void 0:s.disconnect()}),(s,a)=>(ge(),ye("div",Zd,[r.value?(ge(!0),ye(ze,{key:0},ao(ee(t),(l,u,c,d)=>{const h=[l.id];if(d&&d.key===l.id&&Lr(d,h))return d;const g=(ge(),lt(ee(Yd),{id:l.id,key:l.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return g.memo=h,g},a,0),128)):Oe("",!0)]))}}));function qd(){const{emits:e}=_e();et(()=>{if(fr()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ne(Se.MISSING_STYLES))}})}const Qd=at("div",{class:"vue-flow__edge-labels"},null,-1),Jd={name:"VueFlow",compatConfig:{MODE:3}},of=we(de($({},Jd),{props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,i=Or(),r=Dn(o,"modelValue",n),s=Dn(o,"nodes",n),a=Dn(o,"edges",n),l=_e(o),u=Ic({modelValue:r,nodes:s,edges:a},o,l);return Pc(n,l.hooks),Md(),qd(),bt(In,i),zr(u),t(l),(c,d)=>(ge(),ye("div",{ref:ee(l).vueFlowRef,class:"vue-flow"},[Fe(bd,null,{default:Gn(()=>[Fe(Ld),Qd,Fe(Kd),Xe(c.$slots,"zoom-pane")]),_:3}),Xe(c.$slots,"default"),Fe(Cd)],512))}})),jd={name:"Panel",compatConfig:{MODE:3}},rf=we(de($({},jd),{props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=_e(),o=re(()=>`${t.position}`.split("-"));return(i,r)=>(ge(),ye("div",{class:wt(["vue-flow__panel",o.value]),style:Ue({pointerEvents:ee(n)?"none":"all"})},[Xe(i.$slots,"default")],6))}}));function sf(e={}){const{handleType:t,handleId:n,nodeId:o,onConnect:i,onDisconnect:r}=e,{connectionLookup:s}=_e(),a=mr(),l=Ee(null),u=Ee(),c=re(()=>{var _;const d=(_=le(o))!=null?_:a,h=le(t),g=le(n);let E="";return h&&(E=g?`-${h}-${g}`:`-${h}`),`${d}${E}`});return pe(()=>s.value.get(c.value),d=>{mc(u.value,d)||(u.value=d)},{immediate:!0}),pe([u,()=>typeof i!="undefined",()=>typeof r!="undefined"],([d=new Map])=>{l.value&&l.value!==d&&(ai(l.value,d,r),ai(d,l.value,i)),l.value=d},{immediate:!0}),re(()=>u.value?Array.from(u.value.values()):[])}function af(e){const{findNode:t}=_e();return re({get(){const n=le(e);if(!Array.isArray(n)){const i=t(n);return i?{id:i.id,type:i.type,data:i.data}:null}const o=[];for(const i of n){const r=t(i);r&&o.push({id:r.id,type:r.type,data:r.data})}return o},set(){It("You are trying to set node data via useNodesData. This is not supported.")}})}export{q as P,rf as _,of as a,sf as b,bn as c,af as d,$n as e,nf as f,so as g,_e as u};