vue-pure-admin/static/js/vue-flow-core-BJ4ZPFne.js

27 lines
159 KiB
JavaScript

var Pr=Object.defineProperty,Tr=Object.defineProperties;var kr=Object.getOwnPropertyDescriptors;var Ut=Object.getOwnPropertySymbols;var xo=Object.prototype.hasOwnProperty,Eo=Object.prototype.propertyIsEnumerable;var ft=Math.pow,bo=(e,t,n)=>t in e?Pr(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(Ut)for(var n of Ut(t))Eo.call(t,n)&&bo(e,n,t[n]);return e},de=(e,t)=>Tr(e,kr(t));var ht=(e,t)=>{var n={};for(var o in e)xo.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&Ut)for(var o of Ut(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 be,b9 as vi,bc as Nt,eN as pi,n as ve,p as se,k as ye,e as he,M as Xe,s as Ue,u as te,v as _t,P as le,a as we,dx as $r,g as st,i as Oe,b as at,a4 as mi,F as ze,L as xe,T as Dr,eO as Ar,m as je,a$ as Or,o as zr,f as Fe,w as Gn,Z as Ct,r as Br,ba as nn,U as Vr,j as Rr,t as Xn,Y as Hr,l as ao,x as Ge,y as yi,eP as Lr,K as cn,aE as lo,b6 as Fr,eQ as Yr,bd as wt,h as _i,J as me,a1 as on,eR as Gr}from"./index-FkXh20BC.js";function zt(e){return vi()?(nn(e),!0):!1}function Le(e){return typeof e=="function"?e():te(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 Jr(e=wi){const t=we(!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 Qr(e,t,n={}){const r=n,{eventFilter:o=wi}=r,i=ht(r,["eventFilter"]);return ve(e,qr(o,t),i)}function gt(e,t,n={}){const c=n,{eventFilter:o}=c,i=ht(c,["eventFilter"]),{eventFilter:r,pause:s,resume:a,isActive:l}=Jr(o);return{stop:Qr(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=ve(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=ve([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=ve(()=>[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 zt(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=Ct(),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=we(y);let z=!1;return ve(()=>e[t],L=>{z||(z=!0,N.value=S(L),Ge(()=>z=!1))}),ve(N,L=>{!z&&(L!==e[t]||c)&&I(L)},{deep:c}),N}else return se({get(){return C()},set(y){I(y)}})}var os={value:()=>{}};function xn(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new rn(n)}function rn(e){this._=e}function is(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");if(i>=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}})}rn.prototype=xn.prototype={constructor:rn,on:function(e,t){var n=this._,o=is(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=rs(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<s;)if(i=(e=o[r]).type)n[i]=Mo(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Mo(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new rn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),o=0,i,r;o<i;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],i=0,r=o.length;i<r;++i)o[i].value.apply(t,n)}};function rs(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Mo(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=os,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Wn="http://www.w3.org/1999/xhtml";const Io={svg:"http://www.w3.org/2000/svg",xhtml:Wn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function En(e){var t=e+="",n=t.indexOf(":");return n>=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<n;++i)for(var r=t[i],s=r.length,a=o[i]=new Array(s),l,u,c=0;c<s;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new Me(o,this._parents)}function cs(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ds(){return[]}function Si(e){return e==null?ds:function(){return this.querySelectorAll(e)}}function fs(e){return function(){return cs(e.apply(this,arguments))}}function hs(e){typeof e=="function"?e=fs(e):e=Si(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var s=t[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),i.push(l));return new Me(o,i)}function Ni(e){return function(){return this.matches(e)}}function Ci(e){return function(t){return t.matches(e)}}var gs=Array.prototype.find;function vs(e){return function(){return gs.call(this.children,e)}}function ps(){return this.firstElementChild}function ms(e){return this.select(e==null?ps:vs(typeof e=="function"?e:Ci(e)))}var ys=Array.prototype.filter;function _s(){return Array.from(this.children)}function ws(e){return function(){return ys.call(this.children,e)}}function bs(e){return this.selectAll(e==null?_s:ws(typeof e=="function"?e:Ci(e)))}function xs(e){typeof e!="function"&&(e=Ni(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Me(o,this._parents)}function Mi(e){return new Array(e.length)}function Es(){return new Me(this._enter||this._groups.map(Mi),this._parents)}function dn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}dn.prototype={constructor:dn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ss(e){return function(){return e}}function Ns(e,t,n,o,i,r){for(var s=0,a,l=t.length,u=r.length;s<u;++s)(a=t[s])?(a.__data__=r[s],o[s]=a):n[s]=new dn(e,r[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function Cs(e,t,n,o,i,r,s){var a,l,u=new Map,c=t.length,d=r.length,h=new Array(c),g;for(a=0;a<c;++a)(l=t[a])&&(h[a]=g=s.call(l,l.__data__,a,t)+"",u.has(g)?i[a]=l:u.set(g,l));for(a=0;a<d;++a)g=s.call(e,r[a],a,r)+"",(l=u.get(g))?(o[a]=l,l.__data__=r[a],u.delete(g)):n[a]=new dn(e,r[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(h[a])===l&&(i[a]=l)}function Ms(e){return e.__data__}function Is(e,t){if(!arguments.length)return Array.from(this,Ms);var n=t?Cs:Ns,o=this._parents,i=this._groups;typeof e!="function"&&(e=Ss(e));for(var r=i.length,s=new Array(r),a=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],h=d.length,g=Ps(e.call(c,c&&c.__data__,u,o)),E=g.length,_=a[u]=new Array(E),S=s[u]=new Array(E),C=l[u]=new Array(h);n(c,d,_,S,C,g,t);for(var I=0,y=0,N,z;I<E;++I)if(N=_[I]){for(I>=y&&(y=I+1);!(z=S[y])&&++y<E;);N._next=z||null}}return s=new Me(s,o),s._enter=a,s._exit=l,s}function Ps(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ts(){return new Me(this._exit||this._groups.map(Mi),this._parents)}function ks(e,t,n){var o=this.enter(),i=this,r=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?r.remove():n(r),o&&i?o.merge(i).order():i}function $s(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,s=Math.min(i,r),a=new Array(i),l=0;l<s;++l)for(var u=n[l],c=o[l],d=u.length,h=a[l]=new Array(d),g,E=0;E<d;++E)(g=u[E]||c[E])&&(h[E]=g);for(;l<i;++l)a[l]=n[l];return new Me(a,this._parents)}function Ds(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],s;--i>=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;r<o;++r){for(var s=n[r],a=s.length,l=i[r]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new Me(i,this._parents).order()}function Os(e,t){return e<t?-1:e>t?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;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var s=o[i];if(s)return s}return null}function Rs(){let e=0;for(const t of this)++e;return e}function Hs(){return!this.node()}function Ls(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,s=i.length,a;r<s;++r)(a=i[r])&&e.call(a,a.__data__,r,i);return this}function Fs(e){return function(){this.removeAttribute(e)}}function Ys(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Gs(e,t){return function(){this.setAttribute(e,t)}}function Xs(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Us(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Zs(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ws(e,t){var n=En(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Ys:Fs:typeof t=="function"?n.local?Zs:Us:n.local?Xs:Gs)(n,t))}function Ii(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ks(e){return function(){this.style.removeProperty(e)}}function qs(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Js(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Qs(e,t,n){return arguments.length>1?this.each((t==null?Ks:typeof t=="function"?Js:qs)(e,t,n==null?"":n)):bt(this.node(),e)}function bt(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 Pi(e){return e.trim().split(/^|\s+/)}function co(e){return e.classList||new Ti(e)}function Ti(e){this._node=e,this._names=Pi(e.getAttribute("class")||"")}Ti.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<i;)n.add(t[o])}function $i(e,t){for(var n=co(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function oa(e){return function(){ki(this,e)}}function ia(e){return function(){$i(this,e)}}function ra(e,t){return function(){(t.apply(this,arguments)?ki:$i)(this,e)}}function sa(e,t){var n=Pi(e+"");if(arguments.length<2){for(var o=co(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?ra:t?oa:ia)(n,t))}function aa(){this.textContent=""}function la(e){return function(){this.textContent=e}}function ua(e){return function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}}function ca(e){return arguments.length?this.each(e==null?aa:(typeof e=="function"?ua:la)(e)):this.node().textContent}function da(){this.innerHTML=""}function fa(e){return function(){this.innerHTML=e}}function ha(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}}function ga(e){return arguments.length?this.each(e==null?da:(typeof e=="function"?ha:fa)(e)):this.node().innerHTML}function va(){this.nextSibling&&this.parentNode.appendChild(this)}function pa(){return this.each(va)}function ma(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ya(){return this.each(ma)}function _a(e){var t=typeof e=="function"?e:Ei(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function wa(){return null}function ba(e,t){var n=typeof e=="function"?e:Ei(e),o=t==null?wa:typeof t=="function"?t:uo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function xa(){var e=this.parentNode;e&&e.removeChild(this)}function Ea(){return this.each(xa)}function Sa(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Na(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ca(e){return this.select(e?Na:Sa)}function Ma(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Ia(e){return function(t){e.call(this,t,this.__data__)}}function Pa(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Ta(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,i=t.length,r;n<i;++n)r=t[n],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++o]=r;++o?t.length=o:delete this.__on}}}function ka(e,t,n){return function(){var o=this.__on,i,r=Ia(t);if(o){for(var s=0,a=o.length;s<a;++s)if((i=o[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function $a(e,t,n){var o=Pa(e+""),i,r=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<r;++i)if((s=o[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?ka:Ta,i=0;i<r;++i)this.each(a(o[i],t,n));return this}function Di(e,t,n){var o=Ii(e),i=o.CustomEvent;typeof i=="function"?i=new i(t,n):(i=o.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Da(e,t){return function(){return Di(this,e,t)}}function Aa(e,t){return function(){return Di(this,e,t.apply(this,arguments))}}function Oa(e,t){return this.each((typeof t=="function"?Aa:Da)(e,t))}function*za(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,s;i<r;++i)(s=o[i])&&(yield s)}var Ai=[null];function Me(e,t){this._groups=e,this._parents=t}function Gt(){return new Me([[document.documentElement]],Ai)}function Ba(){return this}Me.prototype=Gt.prototype={constructor:Me,select:us,selectAll:hs,selectChild:ms,selectChildren:bs,filter:xs,data:Is,enter:Es,exit:Ts,join:ks,merge:$s,selection:Ba,order:Ds,sort:As,call:zs,nodes:Bs,node:Vs,size:Rs,empty:Hs,each:Ls,attr:Ws,style:Qs,property:na,classed:sa,text:ca,html:ga,raise:pa,lower:ya,append:_a,insert:ba,remove:Ea,clone:Ca,datum:Ma,on:$a,dispatch:Oa,[Symbol.iterator]:za};function Ie(e){return typeof e=="string"?new Me([[document.querySelector(e)]],[document.documentElement]):new Me([[e]],Ai)}function Va(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ke(e,t){if(e=Va(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Ra={passive:!1},Bt={capture:!0,passive:!1};function An(e){e.stopImmediatePropagation()}function pt(e){e.preventDefault(),e.stopImmediatePropagation()}function Oi(e){var t=e.document.documentElement,n=Ie(e).on("dragstart.drag",pt,Bt);"onselectstart"in t?n.on("selectstart.drag",pt,Bt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function zi(e,t){var n=e.document.documentElement,o=Ie(e).on("dragstart.drag",null);t&&(o.on("click.drag",pt,Bt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Zt=e=>()=>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,Bt).on("mouseup.drag",_,Bt),Oi(N.view),An(N),u=!1,a=N.clientX,l=N.clientY,L("start",N))}}function E(N){if(pt(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),pt(N),i.mouse("end",N)}function S(N,z){if(e.call(this,N,z)){var L=N.changedTouches,Y=t.call(this,N,z),F=L.length,j,X;for(j=0;j<F;++j)(X=y(this,Y,N,z,L[j].identifier,L[j]))&&(An(N),X("start",N,L[j]))}}function C(N){var z=N.changedTouches,L=z.length,Y,F;for(Y=0;Y<L;++Y)(F=i[z[Y].identifier])&&(pt(N),F("drag",N,z[Y]))}function I(N){var z=N.changedTouches,L=z.length,Y,F;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),Y=0;Y<L;++Y)(F=i[z[Y].identifier])&&(An(N),F("end",N,z[Y]))}function y(N,z,L,Y,F,j){var X=r.copy(),D=ke(j||L,z),x,J,m;if((m=n.call(N,new Kn("beforestart",{sourceEvent:L,target:h,identifier:F,active:s,x:D[0],y:D[1],dx:0,dy:0,dispatch:X}),Y))!=null)return x=m.x-D[0]||0,J=m.y-D[1]||0,function P(b,k,A){var R=D,O;switch(b){case"start":i[F]=P,O=s++;break;case"end":delete i[F],--s;case"drag":D=ke(A||k,z),O=s;break}X.call(b,N,new Kn(b,{sourceEvent:k,subject:m,target:h,identifier:F,active:O,x:D[0]+x,y:D[1]+J,dx:D[0]-R[0],dy:D[1]-R[1],dispatch:X}),Y)}}return h.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Zt(!!N),h):e},h.container=function(N){return arguments.length?(t=typeof N=="function"?N:Zt(N),h):t},h.subject=function(N){return arguments.length?(n=typeof N=="function"?N:Zt(N),h):n},h.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:Zt(!!N),h):o},h.on=function(){var N=r.on.apply(r,arguments);return N===r?h:N},h.clickDistance=function(N){return arguments.length?(d=(N=+N)*N,h):Math.sqrt(d)},h}function fo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Bi(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Xt(){}var Vt=.7,fn=1/Vt,mt="\\s*([+-]?\\d+)\\s*",Rt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ae="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xa=/^#([0-9a-f]{3,8})$/,Ua=new RegExp(`^rgb\\(${mt},${mt},${mt}\\)$`),Za=new RegExp(`^rgb\\(${Ae},${Ae},${Ae}\\)$`),Wa=new RegExp(`^rgba\\(${mt},${mt},${mt},${Rt}\\)$`),Ka=new RegExp(`^rgba\\(${Ae},${Ae},${Ae},${Rt}\\)$`),qa=new RegExp(`^hsl\\(${Rt},${Ae},${Ae}\\)$`),Ja=new RegExp(`^hsla\\(${Rt},${Ae},${Ae},${Rt}\\)$`),Po={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};fo(Xt,lt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:To,formatHex:To,formatHex8:Qa,formatHsl:ja,formatRgb:ko,toString:ko});function To(){return this.rgb().formatHex()}function Qa(){return this.rgb().formatHex8()}function ja(){return Vi(this).formatHsl()}function ko(){return this.rgb().formatRgb()}function lt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Xa.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?$o(t):n===3?new Ce(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Wt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Wt(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))?Wt(t[1],t[2],t[3],t[4]):(t=Ka.exec(e))?Wt(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=Ja.exec(e))?Oo(t[1],t[2]/100,t[3]/100,t[4]):Po.hasOwnProperty(e)?$o(Po[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 Wt(e,t,n,o){return o<=0&&(e=t=n=NaN),new Ce(e,t,n,o)}function el(e){return e instanceof Xt||(e=lt(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(Xt,{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?Vt:Math.pow(Vt,e),new Ce(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ce(it(this.r),it(this.g),it(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`#${ot(this.r)}${ot(this.g)}${ot(this.b)}`}function tl(){return`#${ot(this.r)}${ot(this.g)}${ot(this.b)}${ot((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ao(){const e=hn(this.opacity);return`${e===1?"rgb(":"rgba("}${it(this.r)}, ${it(this.g)}, ${it(this.b)}${e===1?")":`, ${e})`}`}function hn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function it(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ot(e){return e=it(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 Pe(e,t,n,o)}function Vi(e){if(e instanceof Pe)return new Pe(e.h,e.s,e.l,e.opacity);if(e instanceof Xt||(e=lt(e)),!e)return new Pe;if(e instanceof Pe)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+(n<o)*6:n===r?s=(o-t)/a+2:s=(t-n)/a+4,a/=l<.5?r+i:2-r-i,s*=60):a=l>0&&l<1?0:s,new Pe(s,a,l,e.opacity)}function nl(e,t,n,o){return arguments.length===1?Vi(e):new Pe(e,t,n,o==null?1:o)}function Pe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}fo(Pe,nl,Bi(Xt,{brighter(e){return e=e==null?fn:Math.pow(fn,e),new Pe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vt:Math.pow(Vt,e),new Pe(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 Pe(zo(this.h),Kt(this.s),Kt(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)}, ${Kt(this.s)*100}%, ${Kt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function zo(e){return e=(e||0)%360,e<0?e+360:e}function Kt(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;i<n;++i)o[i]=e[i]*(1-r)+t[i]*r;return o}}function al(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ll(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,i=new Array(o),r=new Array(n),s;for(s=0;s<o;++s)i[s]=Dt(e[s],t[s]);for(;s<n;++s)r[s]=t[s];return function(a){for(s=0;s<o;++s)r[s]=i[s](a);return r}}function ul(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function $e(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function cl(e,t){var n={},o={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Dt(e[i],t[i]):o[i]=t[i];return function(r){for(i in n)o[i]=n[i](r);return o}}var Jn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zn=new RegExp(Jn.source,"g");function dl(e){return function(){return e}}function fl(e){return function(t){return e(t)+""}}function Hi(e,t){var n=Jn.lastIndex=zn.lastIndex=0,o,i,r,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Jn.exec(e))&&(i=zn.exec(t));)(r=i.index)>n&&(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 n<t.length&&(r=t.slice(n),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?fl(l[0].x):dl(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}function Dt(e,t){var n=typeof t,o;return t==null||n==="boolean"?ho(t):(n==="number"?$e:n==="string"?(o=lt(t))?(t=o,gn):Hi:t instanceof lt?gn:t instanceof Date?ul:al(t)?sl:Array.isArray(t)?ll:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?cl:$e)(e,t)}var Bo=180/Math.PI,Qn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Li(e,t,n,o,i,r){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),e*o<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*Bo,skewX:Math.atan(l)*Bo,scaleX:s,scaleY:a}}var qt;function hl(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Qn:Li(t.a,t.b,t.c,t.d,t.e,t.f)}function gl(e){return e==null||(qt||(qt=document.createElementNS("http://www.w3.org/2000/svg","g")),qt.setAttribute("transform",e),!(e=qt.transform.baseVal.consolidate()))?Qn:(e=e.matrix,Li(e.a,e.b,e.c,e.d,e.e,e.f))}function Fi(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,d,h,g,E){if(u!==d||c!==h){var _=g.push("translate(",null,t,null,n);E.push({i:_-4,x:$e(u,d)},{i:_-2,x:$e(c,h)})}else(d||h)&&g.push("translate("+d+t+h+n)}function s(u,c,d,h){u!==c?(u-c>180?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 sn=(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(_<ml)C=Math.log(h/u)/t,S=function(Y){return[a+Y*g,l+Y*E,u*Math.exp(t*Y*C)]};else{var I=Math.sqrt(_),y=(h*h-u*u+o*_)/(2*u*n*I),N=(h*h-u*u-o*_)/(2*h*n*I),z=Math.log(Math.sqrt(y*y+1)-y),L=Math.log(Math.sqrt(N*N+1)-N);C=(L-z)/t,S=function(Y){var F=Y*C,j=Vo(z),X=u/(n*I)*(j*_l(t*F+z)-yl(z));return[a+X*g,l+X*E,u*j/Vo(t*F+z)]}}return S.duration=C*1e3*t/Math.SQRT2,S}return i.rho=function(r){var s=Math.max(.001,+r),a=s*s,l=a*a;return e(s,a,l)},i})(Math.SQRT2,2,4);var xt=0,Tt=0,It=0,Yi=1e3,vn,kt,pn=0,ut=0,Sn=0,Ht=typeof performance=="object"&&performance.now?performance:Date,Gi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function go(){return ut||(Gi(wl),ut=Ht.now()+Sn)}function wl(){ut=0}function mn(){this._call=this._time=this._next=null}mn.prototype=Xi.prototype={constructor:mn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?go():+n)+(t==null?0:+t),!this._next&&kt!==this&&(kt?kt._next=this:vn=this,kt=this),this._call=e,this._time=n,jn()},stop:function(){this._call&&(this._call=null,this._time=1/0,jn())}};function Xi(e,t,n){var o=new mn;return o.restart(e,t,n),o}function bl(){go(),++xt;for(var e=vn,t;e;)(t=ut-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xt}function Ro(){ut=(pn=Ht.now())+Sn,xt=Tt=0;try{bl()}finally{xt=0,El(),ut=0}}function xl(){var e=Ht.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);kt=e,jn(o)}function jn(e){if(!xt){Tt&&(Tt=clearTimeout(Tt));var t=e-ut;t>24?(e<1/0&&(Tt=setTimeout(Ro,e-Ht.now()-Sn)),It&&(It=clearInterval(It))):(It||(pn=Ht.now(),It=setInterval(xl,Yi)),xt=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,an=3,Fo=4,to=5,ln=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=Te(e,t);if(n.state>Ui)throw new Error("too late; already scheduled");return n}function Be(e,t){var n=Te(e,t);if(n.state>an)throw new Error("too late; already running");return n}function Te(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===an)return Ho(s);g.state===Fo?(g.state=ln,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete o[c]):+c<t&&(g.state=ln,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete o[c])}if(Ho(function(){n.state===an&&(n.state=Fo,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=eo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===eo){for(n.state=an,i=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=g);i.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=to,1),d=-1,h=i.length;++d<h;)i[d].call(e,c);n.state===to&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ln,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function un(e,t){var n=e.__transition,o,i,r=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){r=!1;continue}i=o.state>eo&&o.state<to,o.state=ln,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function Ml(e){return this.each(function(){un(this,e)})}function Il(e,t){var n,o;return function(){var i=Be(this,e),r=i.tween;if(r!==n){o=n=r;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}i.tween=o}}function Pl(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=Be(this,e),s=r.tween;if(s!==o){i=(o=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}r.tween=i}}function Tl(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Te(this.node(),n).tween,i=0,r=o.length,s;i<r;++i)if((s=o[i]).name===e)return s.value;return null}return this.each((t==null?Il:Pl)(n,e,t))}function po(e,t,n){var o=e._id;return e.each(function(){var i=Be(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Te(i,o).value[t]}}function Zi(e,t){var n;return(typeof t=="number"?$e:t instanceof lt?gn:(n=lt(t))?(t=n,gn):Hi)(e,t)}function kl(e){return function(){this.removeAttribute(e)}}function $l(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Dl(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttribute(e);return s===i?null:s===o?r:r=t(o=s,n)}}function Al(e,t,n){var o,i=n+"",r;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===o?r:r=t(o=s,n)}}function Ol(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function zl(e,t,n){var o,i,r;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a)))}}function Bl(e,t){var n=En(e),o=n==="transform"?pl:Zi;return this.attrTween(e,typeof t=="function"?(n.local?zl:Ol)(n,o,po(this,"attr."+e,t)):t==null?(n.local?$l:kl)(n):(n.local?Al:Dl)(n,o,t))}function Vl(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Rl(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Hl(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Rl(e,r)),n}return i._value=t,i}function Ll(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Vl(e,r)),n}return i._value=t,i}function Fl(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=En(e);return this.tween(n,(o.local?Hl:Ll)(o,t))}function Yl(e,t){return function(){vo(this,e).delay=+t.apply(this,arguments)}}function Gl(e,t){return t=+t,function(){vo(this,e).delay=t}}function Xl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Yl:Gl)(t,e)):Te(this.node(),t).delay}function Ul(e,t){return function(){Be(this,e).duration=+t.apply(this,arguments)}}function Zl(e,t){return t=+t,function(){Be(this,e).duration=t}}function Wl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ul:Zl)(t,e)):Te(this.node(),t).duration}function Kl(e,t){if(typeof t!="function")throw new Error;return function(){Be(this,e).ease=t}}function ql(e){var t=this._id;return arguments.length?this.each(Kl(t,e)):Te(this.node(),t).ease}function Jl(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Be(this,e).ease=n}}function Ql(e){if(typeof e!="function")throw new Error;return this.each(Jl(this._id,e))}function jl(e){typeof e!="function"&&(e=Ni(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],s=r.length,a=o[i]=[],l,u=0;u<s;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&a.push(l);return new Ze(o,this._parents,this._name,this._id)}function eu(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),s=new Array(o),a=0;a<r;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),h,g=0;g<c;++g)(h=l[g]||u[g])&&(d[g]=h);for(;a<o;++a)s[a]=t[a];return new Ze(s,this._parents,this._name,this._id)}function tu(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function 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?Te(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<i;++s)for(var a=o[s],l=a.length,u=r[s]=new Array(l),c,d,h=0;h<l;++h)(c=a[h])&&(d=e.call(c,c.__data__,h,a))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,Nn(u[h],t,n,h,u,Te(c,n)));return new Ze(r,this._parents,t,n)}function au(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Si(e));for(var o=this._groups,i=o.length,r=[],s=[],a=0;a<i;++a)for(var l=o[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var h=e.call(c,c.__data__,d,l),g,E=Te(c,n),_=0,S=h.length;_<S;++_)(g=h[_])&&Nn(g,t,n,_,h,E);r.push(h),s.push(c)}return new Ze(r,s,t,n)}var lu=Gt.prototype.constructor;function uu(){return new lu(this._groups,this._parents)}function cu(e,t){var n,o,i;return function(){var r=bt(this,e),s=(this.style.removeProperty(e),bt(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function Wi(e){return function(){this.style.removeProperty(e)}}function du(e,t,n){var o,i=n+"",r;return function(){var s=bt(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function fu(e,t,n){var o,i,r;return function(){var s=bt(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),bt(this,e))),s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a))}}function hu(e,t){var n,o,i,r="style."+t,s="end."+r,a;return function(){var l=Be(this,e),u=l.on,c=l.value[r]==null?a||(a=Wi(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),l.on=o}}function gu(e,t,n){var o=(e+="")=="transform"?vl:Zi;return t==null?this.styleTween(e,cu(e,o)).on("end.style."+e,Wi(e)):typeof t=="function"?this.styleTween(e,fu(e,o,po(this,"style."+e,t))).each(hu(this._id,e)):this.styleTween(e,du(e,o,t),n).on("end.style."+e,null)}function vu(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function pu(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&vu(e,s,n)),o}return r._value=t,r}function mu(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,pu(e,t,n==null?"":n))}function yu(e){return function(){this.textContent=e}}function _u(e){return function(){var t=e(this);this.textContent=t==null?"":t}}function wu(e){return this.tween("text",typeof e=="function"?_u(po(this,"text",e)):yu(e==null?"":e+""))}function bu(e){return function(t){this.textContent=e.call(this,t)}}function xu(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&bu(i)),t}return o._value=e,o}function Eu(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,xu(e))}function Su(){for(var e=this._name,t=this._id,n=Ki(),o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Te(l,t);Nn(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Ze(o,this._parents,e,n)}function Nu(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,s){var a={value:s},l={value:function(){--i===0&&r()}};n.each(function(){var u=Be(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&r()})}var Cu=0;function Ze(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Ki(){return++Cu}var He=Gt.prototype;Ze.prototype={constructor:Ze,select:su,selectAll:au,selectChild:He.selectChild,selectChildren:He.selectChildren,filter:jl,merge:eu,selection:uu,transition:Su,call:He.call,nodes:He.nodes,node:He.node,size:He.size,empty:He.empty,each:He.each,on:ou,attr:Bl,attrTween:Fl,style:gu,styleTween:mu,text:wu,textTween:Eu,remove:ru,tween:Tl,delay:Xl,duration:Wl,ease:ql,easeVarying:Ql,end:Nu,[Symbol.iterator]:He[Symbol.iterator]};function Mu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Iu={time:null,delay:0,duration:250,ease:Mu};function Pu(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Tu(e){var t,n;e instanceof Ze?(t=e._id,e=e._name):(t=Ki(),(n=Iu).time=go(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var s=o[r],a=s.length,l,u=0;u<a;++u)(l=s[u])&&Nn(l,e,t,u,s,n||Pu(l,t));return new Ze(o,this._parents,e,t)}Gt.prototype.interrupt=Ml;Gt.prototype.transition=Tu;const Jt=e=>()=>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 Et=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||Et}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=sn,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",j).on("dblclick.zoom",X).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",x).on("touchend.zoom touchcancel.zoom",J).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(m,P,b,k){var A=m.selection?m.selection():m;A.property("__zoom",Yo),m!==A?z(m,P,b,k):A.interrupt().each(function(){L(this,arguments).event(k).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},C.scaleBy=function(m,P,b,k){C.scaleTo(m,function(){var A=this.__zoom.k,R=typeof P=="function"?P.apply(this,arguments):P;return A*R},b,k)},C.scaleTo=function(m,P,b,k){C.transform(m,function(){var A=t.apply(this,arguments),R=this.__zoom,O=b==null?N(A):typeof b=="function"?b.apply(this,arguments):b,U=R.invert(O),Q=typeof P=="function"?P.apply(this,arguments):P;return n(y(I(R,Q),O,U),A,s)},b,k)},C.translateBy=function(m,P,b,k){C.transform(m,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof b=="function"?b.apply(this,arguments):b),t.apply(this,arguments),s)},null,k)},C.translateTo=function(m,P,b,k,A){C.transform(m,function(){var R=t.apply(this,arguments),O=this.__zoom,U=k==null?N(R):typeof k=="function"?k.apply(this,arguments):k;return n(Et.translate(U[0],U[1]).scale(O.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof b=="function"?-b.apply(this,arguments):-b),R,s)},k,A)};function I(m,P){return P=Math.max(r[0],Math.min(r[1],P)),P===m.k?m:new Ye(P,m.x,m.y)}function y(m,P,b){var k=P[0]-b[0]*m.k,A=P[1]-b[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,P,b,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,R=arguments,O=L(A,R).event(k),U=t.apply(A,R),Q=b==null?N(U):typeof b=="function"?b.apply(A,R):b,ie=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),B=A.__zoom,Z=typeof P=="function"?P.apply(A,R):P,W=l(B.invert(Q).concat(ie/B.k),Z.invert(Q).concat(ie/Z.k));return function(re){if(re===1)re=Z;else{var ae=W(re),ue=ie/ae[2];re=new Ye(ue,Q[0]-ae[0]*ue,Q[1]-ae[1]*ue)}O.zoom(null,re)}})}function L(m,P,b){return!b&&m.__zooming||new Y(m,P)}function Y(m,P){this.that=m,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(m,P),this.taps=0}Y.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,P){return this.mouse&&m!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&m!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&m!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(m){var P=Ie(this.that).datum();u.call(m,this.that,new ku(m,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:u}),P)}};function F(m,...P){if(!e.apply(this,arguments))return;var b=L(this,P).event(m),k=this.__zoom,A=Math.max(r[0],Math.min(r[1],k.k*Math.pow(2,o.apply(this,arguments)))),R=ke(m);if(b.wheel)(b.mouse[0][0]!==R[0]||b.mouse[0][1]!==R[1])&&(b.mouse[1]=k.invert(b.mouse[0]=R)),clearTimeout(b.wheel);else{if(k.k===A)return;b.mouse=[R,k.invert(R)],un(this),b.start()}Pt(m),b.wheel=setTimeout(O,E),b.zoom("mouse",n(y(I(k,A),b.mouse[0],b.mouse[1]),b.extent,s));function O(){b.wheel=null,b.end()}}function j(m,...P){if(h||!e.apply(this,arguments))return;var b=m.currentTarget,k=L(this,P,!0).event(m),A=Ie(m.view).on("mousemove.zoom",Q,!0).on("mouseup.zoom",ie,!0),R=ke(m,b),O=m.clientX,U=m.clientY;Oi(m.view),Bn(m),k.mouse=[R,this.__zoom.invert(R)],un(this),k.start();function Q(B){if(Pt(B),!k.moved){var Z=B.clientX-O,W=B.clientY-U;k.moved=Z*Z+W*W>_}k.event(B).zoom("mouse",n(y(k.that.__zoom,k.mouse[0]=ke(B,b),k.mouse[1]),k.extent,s))}function ie(B){A.on("mousemove.zoom mouseup.zoom",null),zi(B.view,k.moved),Pt(B),k.event(B).end()}}function X(m,...P){if(e.apply(this,arguments)){var b=this.__zoom,k=ke(m.changedTouches?m.changedTouches[0]:m,this),A=b.invert(k),R=b.k*(m.shiftKey?.5:2),O=n(y(I(b,R),k,A),t.apply(this,P),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,...P){if(e.apply(this,arguments)){var b=m.touches,k=b.length,A=L(this,P,m.changedTouches.length===k).event(m),R,O,U,Q;for(Bn(m),O=0;O<k;++O)U=b[O],Q=ke(U,this),Q=[Q,this.__zoom.invert(Q),U.identifier],A.touch0?!A.touch1&&A.touch0[2]!==Q[2]&&(A.touch1=Q,A.taps=0):(A.touch0=Q,R=!0,A.taps=1+!!c);c&&(c=clearTimeout(c)),R&&(A.taps<2&&(d=Q[0],c=setTimeout(function(){c=null},g)),un(this),A.start())}}function x(m,...P){if(this.__zooming){var b=L(this,P).event(m),k=m.changedTouches,A=k.length,R,O,U,Q;for(Pt(m),R=0;R<A;++R)O=k[R],U=ke(O,this),b.touch0&&b.touch0[2]===O.identifier?b.touch0[0]=U:b.touch1&&b.touch1[2]===O.identifier&&(b.touch1[0]=U);if(O=b.that.__zoom,b.touch1){var ie=b.touch0[0],B=b.touch0[1],Z=b.touch1[0],W=b.touch1[1],re=(re=Z[0]-ie[0])*re+(re=Z[1]-ie[1])*re,ae=(ae=W[0]-B[0])*ae+(ae=W[1]-B[1])*ae;O=I(O,Math.sqrt(re/ae)),U=[(ie[0]+Z[0])/2,(ie[1]+Z[1])/2],Q=[(B[0]+W[0])/2,(B[1]+W[1])/2]}else if(b.touch0)U=b.touch0[0],Q=b.touch0[1];else return;b.zoom("touch",n(y(O,U,Q),b.extent,s))}}function J(m,...P){if(this.__zooming){var b=L(this,P).event(m),k=m.changedTouches,A=k.length,R,O;for(Bn(m),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),R=0;R<A;++R)O=k[R],b.touch0&&b.touch0[2]===O.identifier?delete b.touch0:b.touch1&&b.touch1[2]===O.identifier&&delete b.touch1;if(b.touch1&&!b.touch0&&(b.touch0=b.touch1,delete b.touch1),b.touch0)b.touch0[1]=this.__zoom.invert(b.touch0[0]);else if(b.end(),b.taps===2&&(O=ke(O,this),Math.hypot(d[0]-O[0],d[1]-O[1])<S)){var U=Ie(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return C.wheelDelta=function(m){return arguments.length?(o=typeof m=="function"?m:Jt(+m),C):o},C.filter=function(m){return arguments.length?(e=typeof m=="function"?m:Jt(!!m),C):e},C.touchable=function(m){return arguments.length?(i=typeof m=="function"?m:Jt(!!m),C):i},C.extent=function(m){return arguments.length?(t=typeof m=="function"?m:Jt([[+m[0][0],+m[0][1]],[+m[1][0],+m[1][1]]]),C):t},C.scaleExtent=function(m){return arguments.length?(r[0]=+m[0],r[1]=+m[1],C):[r[0],r[1]]},C.translateExtent=function(m){return arguments.length?(s[0][0]=+m[0][0],s[1][0]=+m[1][0],s[0][1]=+m[0][1],s[1][1]=+m[1][1],C):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},C.constrain=function(m){return arguments.length?(n=m,C):n},C.duration=function(m){return arguments.length?(a=+m,C):a},C.interpolate=function(m){return arguments.length?(l=m,C):l},C.on=function(){var m=u.on.apply(u,arguments);return m===u?C:m},C.clickDistance=function(m){return arguments.length?(_=(m=+m)*m,C):Math.sqrt(_)},C.tapDistance=function(m){return arguments.length?(S=+m,C):S},C}var q=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(q||{}),mo=(e=>(e.Partial="partial",e.Full="full",e))(mo||{}),tt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(tt||{}),Je=(e=>(e.Strict="strict",e.Loose="loose",e))(Je||{}),no=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(no||{}),At=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(At||{});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 Ot(e,t){const n=se(()=>{var u;return(u=le(t==null?void 0:t.target))!=null?u:Ru}),o=cn(le(e)===!0);let i=!1;const r=new Set;let s=l(le(e));ve(()=>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",Ji="vue-flow__edge-desc",Yu="vue-flow__aria-live",Qi=["Enter"," ","Escape"],yt={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 ct(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function ji(e,t){return{x:ct(e.x,t[0][0],t[1][0]),y:ct(e.y,t[0][1],t[1][1])}}function Xo(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function Qe(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function rt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Qe(e)}function $t(e){return rt(e)&&"computedPosition"in e}function Qt(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Gu(e){return Qt(e.width)&&Qt(e.height)&&Qt(e.x)&&Qt(e.y)}function Xu(e,t,n){var i;const o={id:e.id.toString(),type:(i=e.type)!=null?i:"default",dimensions:on({width:0,height:0}),computedPosition:on($({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:Ee(e.data)?e.data:{},events:on(Ee(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:Ee(e.data)?e.data:{},events:on(Ee(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=>Qe(r)&&r.source===o).map(r=>n.find(s=>rt(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=>Qe(r)&&r.target===o).map(r=>n.find(s=>rt(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=>Qe(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 Lt({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function Ft({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;n<e.length;n++){const o=e[n];t=Ku(t,or($($({},o.computedPosition),o.dimensions)))}return qu(t)}function rr(e,t,n={x:0,y:0,zoom:1},o=!1,i=!1){var a,l,u,c;const r=de($({},Ft(t,n)),{width:t.width/n.zoom,height:t.height/n.zoom}),s=[];for(const d of e){const{dimensions:h,selectable:g=!0,hidden:E=!1}=d,_=(l=(a=h.width)!=null?a:d.width)!=null?l:null,S=(c=(u=h.height)!=null?u:d.height)!=null?c:null;if(i&&!g||E)continue;const C=_n(r,yn(d)),I=_===null||S===null,y=o&&C>0,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 vt(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 Mt(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Ju(e,t,n){var o,i,r,s,a,l,u,c;if(typeof e=="string"||typeof e=="number"){const d=vt(e,n),h=vt(e,t);return{top:d,right:h,bottom:d,left:h,x:h*2,y:d*2}}if(typeof e=="object"){const d=vt((i=(o=e.top)!=null?o:e.y)!=null?i:0,n),h=vt((s=(r=e.bottom)!=null?r:e.y)!=null?s:0,n),g=vt((l=(a=e.left)!=null?a:e.x)!=null?l:0,t),E=vt((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 Qu(e,t,n,o,i,r){const{x:s,y:a}=Lt(e,{x:t,y:n,zoom:o}),{x:l,y:u}=Lt({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=Ju(r,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),c=ct(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,_=Qu(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 Yt(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 e<t?ct(Math.abs(e-t),1,t)/t:e>n?-ct(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($t(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&&$t(l)&&Vn(s,l)}break;case"dimensions":if($t(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&&$t(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 Jo(e){return{id:e,type:"remove"}}function Qo(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 H(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 zt(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 St(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}=St(h,E,E.position,!0),C=Math.sqrt(ft(_-e.x,2)+ft(S-e.y,2));C>t||(C<a?(s=[de($({},E),{x:_,y:S})],a=C):C===a&&s.push(de($({},E),{x:_,y:S})))}}if(!s.length)return null;if(s.length>1){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"),Y=y.getAttribute("data-handleid"),F=y.classList.contains("connectable"),j=y.classList.contains("connectableend");if(!L||!z)return N;const X={source:E?L:o,sourceHandle:E?Y:i,target:E?o:L,targetHandle:E?i:Y};N.connection=X;const x=F&&j&&(n===Je.Strict?E&&z==="source"||!E&&z==="target":L!==o||Y!==i);N.isValid=x&&u(X,{nodes:d,edges:c,sourceNode:h(X.source),targetNode:h(X.target)}),N.toHandle=dr(L,z,Y,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),St(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 Mt(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 Ee(e){return typeof te(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 Qe(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=ht(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;r<e.length;++r){const s=e[r];if(!rt(s)){n(new Ne(Se.NODE_INVALID,s==null?void 0:s.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const a=Xu(s,t(s.id),s.parentNode);s.parentNode&&(o[s.parentNode]=!0),i[r]=a}for(const r of i){const s=t(r.parentNode)||i.find(a=>a.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=Qe(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:Y,onClick:F,el:j,disabled:X,id:D,selectable:x,dragHandle:J}=e,m=cn(!1);let P=[],b,k=null,A={x:void 0,y:void 0},R={x:0,y:0},O=null,U=!1,Q=!1,ie=0,B=!1;const Z=xc(),W=({x:oe,y:ce})=>{A={x:oe,y:ce};let v=!1;if(P=P.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}),Q=Q||v,!!v&&(y(P,!0,!0),m.value=!0,O)){const[f,p]=Rn({id:D,dragItems:P,findNode:g});L({event:O,node:f,nodes:p})}},re=()=>{var v,f;if(!k)return;const[oe,ce]=lr(R,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})&&W(p)}ie=requestAnimationFrame(re)},ae=(oe,ce)=>{U=!0;const v=g(D);!S.value&&!E.value&&v&&(v.selected||C()),v&&le(x)&&S.value&&ro(v,E.value,I,C,_,!1,ce);const f=Z(oe.sourceEvent);if(A=f,P=ec(r.value,d.value,f,D),P.length){const[p,w]=Rn({id:D,dragItems:P,findNode:g});z({event:oe.sourceEvent,node:p,nodes:w})}},ue=(oe,ce)=>{var v;oe.sourceEvent.type==="touchmove"&&oe.sourceEvent.touches.length>1||(Q=!1,a.value===0&&ae(oe,ce),A=Z(oe.sourceEvent),k=((v=t.value)==null?void 0:v.getBoundingClientRect())||null,R=De(oe.sourceEvent,k))},ge=(oe,ce)=>{var f,p;const v=Z(oe.sourceEvent);if(!B&&U&&u.value&&(B=!0,re()),!U){const w=v.xSnapped-((f=A.x)!=null?f:0),T=v.ySnapped-((p=A.y)!=null?p:0);Math.sqrt(w*w+T*T)>a.value&&ae(oe,ce)}(A.x!==v.xSnapped||A.y!==v.ySnapped)&&P.length&&U&&(O=oe.sourceEvent,R=De(oe.sourceEvent,k),W(v))},pe=oe=>{var v,f;let ce=!1;if(!U&&!m.value&&!E.value){const p=oe.sourceEvent,w=Z(p),T=w.xSnapped-((v=A.x)!=null?v:0),V=w.ySnapped-((f=A.y)!=null?f:0),M=Math.sqrt(T*T+V*V);M!==0&&M<=a.value&&(F==null||F(p),ce=!0)}if(P.length&&!ce){Q&&(y(P,!1,!1),Q=!1);const[p,w]=Rn({id:D,dragItems:P,findNode:g});Y({event:oe.sourceEvent,node:p,nodes:w})}P=[],m.value=!1,B=!1,U=!1,A={x:void 0,y:void 0},cancelAnimationFrame(ie)};return ve([()=>le(X),j],([oe,ce],v,f)=>{if(ce){const p=Ie(ce);oe||(b=Ga().on("start",w=>ue(w,ce)).on("drag",w=>ge(w,ce)).on("end",w=>pe(w)).filter(w=>{const T=w.target,V=le(J);return!w.button&&(!i.value||!ei(T,`.${i.value}`,ce)&&(!V||ei(T,V,ce)))}),p.call(b)),f(()=>{p.on(".drag",null),b&&(b.on("start",null),b.on("drag",null),b.on("end",null))})}}),m}function wc(){return{doubleClick:H(),click:H(),mouseEnter:H(),mouseMove:H(),mouseLeave:H(),contextMenu:H(),updateStart:H(),update:H(),updateEnd:H()}}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=Ft({x:l,y:u},e.value),{x:d,y:h}=n.value?Mn(c,t.value):c;return $({xSnapped:d,ySnapped:h},c)}}function jt(){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:Y,nodes:F,isValidConnection:j,nodeLookup:X}=_e();let D=null,x=!1,J=null;function m(b){var k;const A=le(n)==="target",R=_o(b),O=Xo(b.target),U=b.currentTarget;if(U&&(R&&b.button===0||!R)){let Q=function(K){v=De(K,pe),W=dc(Ft(v,L.value,!1,[1,1]),c.value,X.value,w),f||(p(),f=!0);const ee=oi(K,{handle:W,connectionMode:u.value,fromNodeId:le(t),fromHandleId:le(e),fromType:A?"target":"source",isValidConnection:Z,doc:O,lib:"vue",flowId:a,nodeLookup:X.value},Y.value,F.value,S,X.value);J=ee.handleDomNode,D=ee.connection,x=hc(!!W,ee.isValid);const ne=de($({},G),{isValid:x,to:ee.toHandle&&x?Lt({x:ee.toHandle.x,y:ee.toHandle.y},L.value):v,toHandle:ee.toHandle,toPosition:x&&ee.toHandle?ee.toHandle.position:io[w.position],toNode:ee.toHandle?X.value.get(ee.toHandle.nodeId):null});if(x&&W&&(G!=null&&G.toHandle)&&ne.toHandle&&G.toHandle.type===ne.toHandle.type&&G.toHandle.nodeId===ne.toHandle.nodeId&&G.toHandle.id===ne.toHandle.id&&G.to.x===ne.to.x&&G.to.y===ne.to.y)return;const fe=W!=null?W:ee.toHandle;if(y(fe&&x?Lt({x:fe.x,y:fe.y},L.value):v,ee.toHandle,fc(!!fe,x)),G=ne,!W&&!x&&!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",!!x),J.classList.toggle("vue-flow__handle-valid",!!x))},ie=function(K){"touches"in K&&K.touches.length>0||((W||J)&&D&&x&&(r?r(K,D):z.connect(D)),z.connectEnd(K),i&&(s==null||s(K)),Hn(ce),cancelAnimationFrame(re),N(K),f=!1,x=!1,D=null,J=null,O.removeEventListener("mousemove",Q),O.removeEventListener("mouseup",ie),O.removeEventListener("touchmove",Q),O.removeEventListener("touchend",ie))};const B=S(le(t));let Z=le(o)||j.value||jt;!Z&&B&&(Z=(A?B.isValidSourcePos:B.isValidTargetPos)||jt);let W,re=0;const{x:ae,y:ue}=De(b),ge=cr(le(i),U),pe=(k=l.value)==null?void 0:k.getBoundingClientRect();if(!pe||!ge)return;const oe=dr(le(t),ge,le(e),X.value,u.value);if(!oe)return;let ce,v=De(b,pe),f=!1;const p=()=>{if(!E.value)return;const[K,ee]=lr(v,pe,_.value);C({x:K,y:ee}),re=requestAnimationFrame(p)},w=de($({},oe),{nodeId:le(t),type:ge,position:oe.position}),T=X.value.get(le(t)),M={inProgress:!0,isValid:null,from:St(T,w,q.Left,!0),fromHandle:w,fromPosition:w.position,fromNode:T,to:v,toHandle:null,toPosition:io[w.position],toNode:null};I($({nodeId:le(t),id:le(e),type:ge,position:(U==null?void 0:U.getAttribute("data-handlepos"))||q.Top},v),{x:ae-pe.left,y:ue-pe.top}),z.connectStart({event:b,nodeId:le(t),handleId:le(e),handleType:ge});let G=M;O.addEventListener("mousemove",Q),O.addEventListener("mouseup",ie),O.addEventListener("touchmove",Q),O.addEventListener("touchend",ie)}}function P(b){var Z;var k,A;if(!d.value)return;const R=le(n)==="target";if(!h.value){z.clickConnectStart({event:b,nodeId:le(t),handleId:le(e)}),I($({nodeId:le(t),type:le(n),id:le(e),position:q.Top},De(b)),void 0,!0);return}let O=le(o)||j.value||jt;const U=S(le(t));if(!O&&U&&(O=(R?U.isValidSourcePos:U.isValidTargetPos)||jt),U&&(typeof U.connectable=="undefined"?g.value:U.connectable)===!1)return;const Q=Xo(b.target),ie=oi(b,{handle:$({nodeId:le(t),id:le(e),type:le(n),position:q.Top},De(b)),connectionMode:u.value,fromNodeId:h.value.nodeId,fromHandleId:(Z=h.value.id)!=null?Z:null,fromType:h.value.type,isValidConnection:O,doc:Q,lib:"vue",flowId:a,nodeLookup:X.value},Y.value,F.value,S,X.value),B=((k=ie.connection)==null?void 0:k.source)===((A=ie.connection)==null?void 0:A.target);ie.isValid&&ie.connection&&!B&&z.connect(ie.connection),z.clickConnectEnd(b),N(b,!0)}return{handlePointerDown:m,handleClick:P}}function mr(){return Nt(hr,"")}function yr(e){var a;const t=(a=e!=null?e:mr())!=null?a:"",n=Nt(gr,we(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:se(()=>o(s.parentNode)),connectedEdges:se(()=>sr([s],i.value))}}function Ec(){return{doubleClick:H(),click:H(),mouseEnter:H(),mouseMove:H(),mouseLeave:H(),contextMenu:H(),dragStart:H(),drag:H(),dragStop:H()}}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},{computedPosition: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 en=.1,Nc=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function We(){return Mt("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"?Dt:sn).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=Et.translate(-u,-c).scale(r);e.d3Selection&&e.d3Zoom?(l=e.d3Zoom)==null||l.interpolate((s==null?void 0:s.interpolate)==="linear"?Dt:sn).transform(Yn(e.d3Selection,s==null?void 0:s.duration,s==null?void 0:s.ease,()=>{a(!0)}),d):a(!1)})}return se(()=>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"?Dt:sn).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:en,includeHiddenNodes:!1,duration:0})=>{var h,g,E;var r,s;const a=[];for(const _ of e.nodes)_.dimensions.width&&_.dimensions.height&&((i==null?void 0: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:en);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:en})=>{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:en);return n(s,a,l,r)},project:i=>Ft(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 Ft(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 Lt(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);_=gt([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=gt([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}),nn(()=>{_==null||_.stop(),S==null||S.stop()})})},r=()=>{o.run(()=>{let _,S,C=!!n.nodes.value.length;_=gt([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=gt([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}),nn(()=>{_==null||_.stop(),S==null||S.stop()})})},s=()=>{o.run(()=>{let _,S,C=!!n.edges.value.length;_=gt([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=gt([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}),nn(()=>{_==null||_.stop(),S==null||S.stop()})})},a=()=>{o.run(()=>{ve(()=>t.maxZoom,()=>{t.maxZoom&&Ee(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{ve(()=>t.minZoom,()=>{t.minZoom&&Ee(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{ve(()=>t.translateExtent,()=>{t.translateExtent&&Ee(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{ve(()=>t.nodeExtent,()=>{t.nodeExtent&&Ee(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{ve(()=>t.applyDefault,()=>{Ee(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])});ve(()=>t.autoConnect,()=>{Ee(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),ve(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=xe(()=>t[C]),y=n[C];lo(y)&&o.run(()=>{ve(I,N=>{Ee(N)&&(y.value=N)},{immediate:!0})})}}};(()=>{i(),r(),s(),l(),a(),u(),c(),d(),h(),g()})()}),()=>o.stop()}function Pc(){return{edgesChange:H(),nodesChange:H(),nodeDoubleClick:H(),nodeClick:H(),nodeMouseEnter:H(),nodeMouseMove:H(),nodeMouseLeave:H(),nodeContextMenu:H(),nodeDragStart:H(),nodeDrag:H(),nodeDragStop:H(),nodesInitialized:H(),miniMapNodeClick:H(),miniMapNodeDoubleClick:H(),miniMapNodeMouseEnter:H(),miniMapNodeMouseMove:H(),miniMapNodeMouseLeave:H(),connect:H(),connectStart:H(),connectEnd:H(),clickConnectStart:H(),clickConnectEnd:H(),paneReady:H(),init:H(),move:H(),moveStart:H(),moveEnd:H(),selectionDragStart:H(),selectionDrag:H(),selectionDragStop:H(),selectionContextMenu:H(),selectionStart:H(),selectionEnd:H(),viewportChangeStart:H(),viewportChange:H(),viewportChangeEnd:H(),paneScroll:H(),paneClick:H(),paneContextMenu:H(),paneMouseEnter:H(),paneMouseMove:H(),paneMouseLeave:H(),edgeContextMenu:H(),edgeMouseEnter:H(),edgeMouseMove:H(),edgeMouseLeave:H(),edgeDoubleClick:H(),edgeClick:H(),edgeUpdateStart:H(),edgeUpdate:H(),edgeUpdateEnd:H(),updateNodeInternals:H(),error:H(e=>Mt(e.message))}}function Tc(e,t){const n=Ct();Hr(()=>{for(const[i,r]of Object.entries(t.value)){const s=a=>{e(i,a)};r.setEmitter(s),zt(r.removeEmitter),r.setHasEmitListeners(()=>o(i)),zt(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:At.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:tt.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:Pc(),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 T=v?`-${f}-${v}`:`-${f}`;return Array.from((V=(w=e.connectionLookup.get(`${p}${T}`))==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,G;var w,T;const V=[];for(const K of v){const ee={id:K.id,type:"position",dragging:p,from:K.from};if(f&&(ee.position=K.position,K.parentNode)){const ne=u(K.parentNode);ee.position={x:ee.position.x-((M=(w=ne==null?void 0:ne.computedPosition)==null?void 0:w.x)!=null?M:0),y:ee.position.y-((G=(T=ne==null?void 0:ne.computedPosition)==null?void 0:T.y)!=null?G:0)}}V.push(ee)}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),T=[];for(const V of v){const M=V,G=u(M.id);if(G){const K=Cn(M.nodeElement);if(!!(K.width&&K.height&&(G.dimensions.width!==K.width||G.dimensions.height!==K.height||M.forceUpdate))){const ne=M.nodeElement.getBoundingClientRect();G.dimensions=K,G.handleBounds.source=ii("source",M.nodeElement,ne,w,G.id),G.handleBounds.target=ii("target",M.nodeElement,ne,w,G.id),T.push({id:G.id,type:"dimensions",dimensions:K})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),T.length&&e.hooks.nodesChange.trigger(T)},g=(v,f)=>{const p=new Set,w=new Set;for(const M of v)rt(M)?p.add(M.id):Qe(M)&&w.add(M.id);const T=qe(t.value,p,!0),V=qe(n.value,w);if(e.multiSelectionActive){for(const M of p)T.push(Ke(M,f));for(const M of w)V.push(Ke(M,f))}T.length&&e.hooks.nodesChange.trigger(T),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 T=Ke(w.id,!1);return rt(w)?p.nodes.push(T):p.edges.push(T),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},Y=v=>{e.nodeExtent=v,i()},F=v=>{var f;(f=e.d3Zoom)==null||f.clickDistance(v)},j=v=>{e.nodesDraggable=v,e.nodesConnectable=v,e.elementsSelectable=v},X=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},x=v=>{const f=v instanceof Function?v([...e.nodes,...e.edges]):v;!e.initialized&&!f.length||(X(f.filter(rt)),D(f.filter(Qe)))},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 T of p)w.push(qo(T));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 T of p)w.push(qo(T));w.length&&e.hooks.edgesChange.trigger(w)},P=(v,f=!0,p=!1)=>{const w=v instanceof Function?v(e.nodes):v,T=Array.isArray(w)?w:[w],V=[],M=[];function G(ee){const ne=a(ee);for(const fe of ne)(!Ee(fe.deletable)||fe.deletable)&&M.push(Qo(fe.id,fe.source,fe.target,fe.sourceHandle,fe.targetHandle))}function K(ee){const ne=[];for(const fe of e.nodes)fe.parentNode===ee&&ne.push(fe);if(ne.length){for(const fe of ne)V.push(Jo(fe.id));f&&G(ne);for(const fe of ne)K(fe.id)}}for(const ee of T){const ne=typeof ee=="string"?u(ee):ee;ne&&(Ee(ne.deletable)&&!ne.deletable||(V.push(Jo(ne.id)),f&&G([ne]),p&&K(ne.id)))}M.length&&e.hooks.edgesChange.trigger(M),V.length&&e.hooks.nodesChange.trigger(V)},b=v=>{const f=v instanceof Function?v(e.edges):v,p=Array.isArray(f)?f:[f],w=[];for(const T of p){const V=typeof T=="string"?c(T):T;V&&(Ee(V.deletable)&&!V.deletable||w.push(Qo(typeof T=="string"?T:T.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 T=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((G,K)=>K===T?M:G),Ln(e.connectionLookup,n.value,[M]),M}return!1},A=(v,f,p={replace:!1})=>{const w=c(v);if(!w)return;const T=typeof f=="function"?f(w):f;w.data=p.replace?T:$($({},w.data),T)},R=v=>Ko(v,e.nodes),O=v=>{const f=Ko(v,e.edges);return Ln(e.connectionLookup,n.value,f),f},U=(v,f,p={replace:!1})=>{const w=u(v);if(!w)return;const T=typeof f=="function"?f(w):f;p.replace?e.nodes.splice(e.nodes.indexOf(w),1,T):Object.assign(w,T)},Q=(v,f,p={replace:!1})=>{const w=u(v);if(!w)return;const T=typeof f=="function"?f(w):f;w.data=p.replace?T:$($({},w.data),T)},ie=(v,f,p=!1)=>{p?e.connectionClickStartHandle=v:e.connectionStartHandle=v,e.connectionEndHandle=null,e.connectionStatus=null,f&&(e.connectionPosition=f)},B=(v,f=null,p=null)=>{e.connectionStartHandle&&(e.connectionPosition=v,e.connectionEndHandle=f,e.connectionStatus=p)},Z=(v,f)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,f?e.connectionClickStartHandle=null:e.connectionStartHandle=null},W=v=>{const f=Gu(v),p=f?null:$t(v)?v:u(v.id);return!f&&!p?[null,null,f]:[f?v:yn(p),p,f]},re=(v,f=!0,p=e.nodes)=>{const[w,T,V]=W(v);if(!w)return[];const M=[];for(const G of p||e.nodes){if(!V&&(G.id===T.id||!G.computedPosition))continue;const K=yn(G),ee=_n(K,w);(f&&ee>0||ee>=K.width*K.height||ee>=Number(w.width)*Number(w.height))&&M.push(G)}return M},ae=(v,f,p=!0)=>{const[w]=W(v);if(!w)return!1;const T=_n(w,f);return p&&T>0||T>=Number(w.width)*Number(w.height)},ue=v=>{const{viewport:f,dimensions:p,d3Zoom:w,d3Selection:T,translateExtent:V}=e;if(!w||!T||!v.x&&!v.y)return!1;const M=Et.translate(f.x+v.x,f.y+v.y).scale(f.zoom),G=[[0,0],[p.width,p.height]],K=w.constrain()(M,G,V),ee=e.viewport.x!==K.x||e.viewport.y!==K.y||e.viewport.zoom!==K.k;return w.transform(T,K),ee},ge=v=>{const f=v instanceof Function?v(e):v,p=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Ee(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),x(w));const T=()=>{Ee(f.maxZoom)&&z(f.maxZoom),Ee(f.minZoom)&&N(f.minZoom),Ee(f.translateExtent)&&L(f.translateExtent)};for(const V of Object.keys(f)){const M=V,G=f[M];![...$c,...p].includes(M)&&Ee(G)&&(e[M]=G)}Zn(()=>e.d3Zoom).not.toBeNull().then(T),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:x,setNodes:X,setEdges:D,addNodes:J,addEdges:m,removeNodes:P,removeEdges:b,findNode:u,findEdge:c,updateEdge:k,updateEdgeData:A,updateNode:U,updateNodeData:Q,applyEdgeChanges:O,applyNodeChanges:R,addSelectedElements:S,addSelectedNodes:E,addSelectedEdges:_,setMinZoom:N,setMaxZoom:z,setTranslateExtent:L,setNodeExtent:Y,setPaneClickDistance:F,removeSelectedElements:y,removeSelectedNodes:C,removeSelectedEdges:I,startConnection:ie,updateConnection:B,endConnection:Z,setInteractive:j,setState:ge,getIntersectingNodes:re,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 T of e.nodes){const p=T,{computedPosition:V,handleBounds:M,selected:G,dimensions:K,isParent:ee,resizing:ne,dragging:fe,events:Ve}=p,Re=ht(p,["computedPosition","handleBounds","selected","dimensions","isParent","resizing","dragging","events"]);v.push(Re)}for(const T of e.edges){const w=T,{selected:V,sourceNode:M,targetNode:G,events:K}=w,ee=ht(w,["selected","sourceNode","targetNode","events"]);f.push(ee)}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:T,zoom:V,viewport:M}=v;if(p&&X(p),w&&D(w),M!=null&&M.x&&(M!=null&&M.y)||T){const G=(M==null?void 0:M.x)||T[0],K=(M==null?void 0:M.y)||T[1],ee=(M==null?void 0:M.zoom)||V||e.viewport.zoom;return Zn(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:G,y:K,zoom:ee}).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 T=Et.translate((f=v.defaultViewport.x)!=null?f:0,(p=v.defaultViewport.y)!=null?p:0).scale(ct((w=v.defaultViewport.zoom)!=null?w:1,v.minZoom,v.maxZoom)),V=e.viewportRef.getBoundingClientRect(),M=[[0,0],[V.width,V.height]],G=e.d3Zoom.constrain()(T,M,v.translateExtent);e.d3Zoom.transform(e.d3Selection,G)}ge(v)},$destroy:()=>{}}}const Ac=["data-id","data-handleid","data-nodeid","data-handlepos"],Oc={name:"Handle",compatConfig:{MODE:3}},bn=be(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=xe(()=>{var D;return(D=n.type)!=null?D:"source"}),i=xe(()=>{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=we(),I=xe(()=>typeof e.connectableStart!="undefined"?e.connectableStart:!0),y=xe(()=>typeof e.connectableEnd!="undefined"?e.connectableEnd:!0),N=xe(()=>{var D,x,J,m,P,b;return((D=s.value)==null?void 0:D.nodeId)===g&&((x=s.value)==null?void 0:x.id)===e.id&&((J=s.value)==null?void 0:J.type)===o.value||((m=l.value)==null?void 0:m.nodeId)===g&&((P=l.value)==null?void 0:P.id)===e.id&&((b=l.value)==null?void 0:b.type)===o.value}),z=xe(()=>{var D,x,J;return((D=a.value)==null?void 0:D.nodeId)===g&&((x=a.value)==null?void 0:x.id)===e.id&&((J=a.value)==null?void 0:J.type)===o.value}),{handlePointerDown:L,handleClick:Y}=pr({nodeId:g,handleId:e.id,isValidConnection:i,type:o}),F=se(()=>typeof e.connectable=="string"&&e.connectable==="single"?!S.value.some(D=>{const x=D[`${o.value}Handle`];return D[o.value]!==g?!1:x?x===e.id:!0}):typeof e.connectable=="number"?S.value.filter(D=>{const x=D[`${o.value}Handle`];return D[o.value]!==g?!1:x?x===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(E,S.value):Ee(e.connectable)?e.connectable:c.value);je(()=>{var R;var D;if(!E.dimensions.width||!E.dimensions.height)return;const x=(D=E.handleBounds[o.value])==null?void 0:D.find(O=>O.id===e.id);if(!u.value||x)return;const J=u.value.querySelector(".vue-flow__transformationpane");if(!_.value||!C.value||!J||!e.id)return;const m=_.value.getBoundingClientRect(),P=C.value.getBoundingClientRect(),b=window.getComputedStyle(J),{m22:k}=new window.DOMMatrixReadOnly(b.transform),A=$({id:e.id,position:e.position,x:(P.left-m.left)/k,y:(P.top-m.top)/k,type:o.value,nodeId:g},Cn(C.value));E.handleBounds[o.value]=[...(R=E.handleBounds[o.value])!=null?R:[],A]});function j(D){const x=_o(D);F.value&&I.value&&(x&&D.button===0||!x)&&L(D)}function X(D){!g||!a.value&&!I.value||F.value&&Y(D)}return t({handleClick:Y,handlePointerDown:L,onClick:X,onPointerDown:j}),(D,x)=>(he(),ye("div",{ref_key:"handle",ref:C,"data-id":`${te(r)}-${te(g)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":te(g),"data-handlepos":D.position,class:_t(["vue-flow__handle",[`vue-flow__handle-${D.position}`,`vue-flow__handle-${e.id}`,te(d),te(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:j,onTouchstartPassive:j,onClick:X},[Xe(D.$slots,"default",{id:D.id})],42,Ac))}})),Pn=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})]};Pn.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Pn.inheritAttrs=!1;Pn.compatConfig={MODE:3};const zc=Pn,Tn=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])]};Tn.props=["targetPosition","label","isValidTargetPos","connectable","data"];Tn.inheritAttrs=!1;Tn.compatConfig={MODE:3};const Bc=Tn,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=be(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=we({x:0,y:0,width:0,height:0}),n=we(null),o=se(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);je(i),ve([()=>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)=>(he(),ye("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(he(),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),st("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"?(he(),at(Vr(r.label),{key:0})):(he(),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=be(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=we(null),o=we(null),i=we(null),r=$r();return t({pathEl:n,interactionEl:o,labelEl:i}),(s,a)=>(he(),ye(ze,null,[st("path",mi(te(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?(he(),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?(he(),at(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<e?n+i:n-i,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[r,a,i,s]}function xr({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:s,targetControlY:a}){const l=e*.125+i*.375+s*.375+n*.125,u=t*.125+r*.375+a*.375+o*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function tn(e,t){return e>=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-tn(t-o,r),a=n;break;case q.Right:s=t+tn(o-t,r),a=n;break;case q.Top:s=t,a=n-tn(n-i,r);break;case q.Bottom:s=t,a=n+tn(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.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function hi(e,t){return Math.sqrt(ft(t.x-e.x,2)+ft(t.y-e.y,2))}function Wc({source:e,sourcePosition:t=q.Bottom,target:n,targetPosition:o=q.Top,center:i,offset:r}){var Y,F;const s=fi[t],a=fi[o],l={x:e.x+s.x*r,y:e.y+s.y*r},u={x:n.x+a.x*r,y:n.y+a.y*r},c=Zc({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",h=c[d];let g,E,_;const S={x:0,y:0},C={x:0,y:0},[I,y,N,z]=br({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){E=(Y=i.x)!=null?Y:I,_=(F=i.y)!=null?F:y;const j=[{x:E,y:l.y},{x:E,y:u.y}],X=[{x:l.x,y:_},{x:u.x,y:_}];s[d]===h?g=d==="x"?j:X:g=d==="x"?X:j}else{const j=[{x:l.x,y:u.y}],X=[{x:u.x,y:l.y}];if(d==="x"?g=s.x===h?X:j:g=s.y===h?j:X,t===o){const P=Math.abs(e[d]-n[d]);if(P<=r){const b=Math.min(r-1,r-P);s[d]===h?S[d]=(l[d]>e[d]?-1:1)*b:C[d]=(u[d]>n[d]?-1:1)*b}}if(t!==o){const P=d==="x"?"y":"x",b=s[d]===a[P],k=l[P]>u[P],A=l[P]<u[P];(s[d]===1&&(!b&&k||b&&A)||s[d]!==1&&(!b&&A||b&&k))&&(g=d==="x"?j:X)}const D={x:l.x+S.x,y:l.y+S.y},x={x:u.x+C.x,y:u.y+C.y},J=Math.max(Math.abs(D.x-g[0].x),Math.abs(x.x-g[0].x)),m=Math.max(Math.abs(D.y-g[0].y),Math.abs(x.y-g[0].y));J>=m?(E=(D.x+x.x)/2,_=g[0].y):(E=g[0].x,_=(D.y+x.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<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${r+i*u},${s}Q ${r},${s} ${r},${s+i*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${r},${s+i*l}Q ${r},${s} ${r+i*a},${s}`}function so(e){const{sourceX:t,sourceY:n,sourcePosition:o=q.Bottom,targetX:i,targetY:r,targetPosition:s=q.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=e,[d,h,g,E,_]=Wc({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:s,center:{x:l,y:u},offset:c});return[d.reduce((C,I,y)=>{let N;return y>0&&y<d.length-1?N=Kc(d[y-1],I,d[y+1],a):N=`${y===0?"M":"L"}${I.x} ${I.y}`,C+=N,C},""),h,g,E,_]}function qc(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,s,a,l]=br({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,s,a,l]}const Jc=be({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=qc(e);return me($n,$($({path:n,labelX:o,labelY:i},t),e))}}}),Qc=Jc,jc=be({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=be({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=be({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=be({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:Qc,step:td,smoothstep:Nr,simplebezier:rd};function ld(e,t,n){const o=se(()=>_=>t.value.get(_)),i=se(()=>_=>n.value.get(_)),r=se(()=>{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=se(()=>{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=se(()=>e.onlyRenderVisibleElements?rr(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=se(()=>{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=se(()=>[...a.value,...l.value]),c=se(()=>{const _=[];for(const S of e.nodes)S.selected&&_.push(S);return _}),d=se(()=>{const _=[];for(const S of e.edges)S.selected&&_.push(S);return _}),h=se(()=>[...c.value,...d.value]),g=se(()=>{const _=[];for(const S of e.nodes)S.dimensions.width&&S.dimensions.height&&S.handleBounds!==void 0&&_.push(S);return _}),E=se(()=>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 nt{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var i;var t;const n=(t=Ct())==null?void 0:t.appContext.app,o=(i=n==null?void 0:n.config.globalProperties.$vueFlowStorage)!=null?i:nt.instance;return nt.instance=o!=null?o:new nt,n&&(n.config.globalProperties.$vueFlowStorage=nt.instance),nt.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=se(()=>{const h=new Map;for(const g of i.nodes)h.set(g.id,g);return h}),l=se(()=>{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.47.0",$destroy:()=>{this.remove(t)}});return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function _e(e){const t=nt.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=Nt(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(()=>{ve(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}),zt(()=>{if(a){const d=t.get(a.id);d?d.$destroy():Mt(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(i);if(n&&(wt(ui,a),n.vueFlowId=a.id),o){const l=Ct();(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;je(()=>{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=be(de($({},cd),{props:{userSelectionRect:{}},setup(e){return(t,n)=>(he(),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=be(de($({},hd),{setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:s}=_e(),a=_r(),l=we(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)}});je(()=>{var E;r.value||(E=l.value)==null||E.focus({preventScroll:!0})});const c=se(()=>ir(o.value)),d=se(()=>({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||yt[E.key]&&(E.preventDefault(),a({x:yt[E.key].x,y:yt[E.key].y},E.shiftKey))}return(E,_)=>!te(s)&&c.value.width&&c.value.height?(he(),ye("div",{key:0,class:_t(["vue-flow__nodesselection vue-flow__container",te(i)]),style:Ue({transform:`translate(${te(n).x}px,${te(n).y}px) scale(${te(n).zoom})`})},[st("div",{ref_key:"el",ref:l,class:_t([{dragging:te(u)},"vue-flow__nodesselection-rect"]),style:Ue(d.value),tabIndex:te(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=be(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}=_e(),Y=we(null),F=we(new Set),j=we(new Set),X=we(),D=xe(()=>l.value&&(e.isSelecting||r.value)),x=xe(()=>L.value!==null);let J=!1,m=!1;const P=Ot(_,{actInsideInputWithModifier:!1}),b=Ot(S);ve(P,B=>{B&&(h(d.value),g(c.value),u.value=!1)}),ve(b,B=>{C.value=B});function k(B,Z){return W=>{W.target===Z&&(B==null||B(W))}}function A(B){if(J||x.value){J=!1;return}i.paneClick(B),s(),u.value=!1}function R(B){B.preventDefault(),B.stopPropagation(),i.paneContextMenu(B)}function O(B){i.paneScroll(B)}function U(B){var Z,W,re;if(X.value=(Z=t.value)==null?void 0:Z.getBoundingClientRect(),!l.value||!e.isSelecting||B.button!==0||B.target!==Y.value||!X.value)return;(re=(W=B.target)==null?void 0:W.setPointerCapture)==null||re.call(W,B.pointerId);const{x:ae,y:ue}=vd(B,X.value);m=!0,J=!1,s(),a.value={width:0,height:0,startX:ae,startY:ue,x:ae,y:ue},i.selectionStart(B)}function Q(B){var v,f;var Z;if(!X.value||!a.value)return;J=!0;const{x:W,y:re}=De(B,X.value),{startX:ae=0,startY:ue=0}=a.value,ge={startX:ae,startY:ue,x:W<ae?W:ae,y:re<ue?re:ue,width:Math.abs(W-ae),height:Math.abs(re-ue)},pe=F.value,oe=j.value;F.value=new Set(rr(n.value,ge,o.value,E.value===mo.Partial,!0).map(p=>p.id)),j.value=new Set;const ce=(v=(Z=z.value)==null?void 0:Z.selectable)!=null?v:!0;for(const p of F.value){const w=N.value.get(p);if(w)for(const{edgeId:T}of w.values()){const V=I.value.get(T);V&&((f=V.selectable)!=null?f:ce)&&j.value.add(T)}}if(!li(pe,F.value)){const p=qe(y.value,F.value,!0);i.nodesChange(p)}if(!li(oe,j.value)){const p=qe(I.value,j.value);i.edgesChange(p)}a.value=ge,r.value=!0,u.value=!1}function ie(B){var Z;B.button!==0||!m||((Z=B.target)==null||Z.releasePointerCapture(B.pointerId),!r.value&&a.value&&B.target===Y.value&&A(B),r.value=!1,a.value=null,u.value=F.value.size>0,i.selectionEnd(B),e.selectionKeyPressed&&(J=!1),m=!1)}return(B,Z)=>(he(),ye("div",{ref_key:"container",ref:Y,class:_t(["vue-flow__pane vue-flow__container",{selection:B.isSelecting}]),onClick:Z[0]||(Z[0]=W=>D.value?void 0:k(A,Y.value)(W)),onContextmenu:Z[1]||(Z[1]=W=>k(R,Y.value)(W)),onWheelPassive:Z[2]||(Z[2]=W=>k(O,Y.value)(W)),onPointerenter:Z[3]||(Z[3]=W=>D.value?void 0:te(i).paneMouseEnter(W)),onPointerdown:Z[4]||(Z[4]=W=>D.value?U(W):te(i).paneMouseMove(W)),onPointermove:Z[5]||(Z[5]=W=>D.value?Q(W):te(i).paneMouseMove(W)),onPointerup:Z[6]||(Z[6]=W=>D.value?ie(W):void 0),onPointerleave:Z[7]||(Z[7]=W=>te(i).paneMouseLeave(W))},[Xe(B.$slots,"default"),te(r)&&te(a)?(he(),at(dd,{key:0,"user-selection-rect":te(a)},null,8,["user-selection-rect"])):Oe("",!0),te(u)&&te(d).length?(he(),at(gd,{key:1})):Oe("",!0)],34))}})),yd={name:"Transform",compatConfig:{MODE:3}},_d=be(de($({},yd),{setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=_e(),i=se(()=>n.value?!o.value:!1),r=se(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(he(),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=be(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:Y,d3ZoomHandler:F,viewport:j,viewportRef:X,paneClickDistance:D}=_e();ud(X);const x=cn(!1),J=cn(!1);let m=null,P=!1,b=0,k={x:0,y:0,zoom:0};const A=Ot(a),R=Ot(s),O=Ot(r),U=xe(()=>(!R.value||R.value&&s.value===!0)&&(A.value||d.value)),Q=xe(()=>A.value||l.value),ie=xe(()=>R.value||s.value===!0&&U.value!==!0),B=xe(()=>y.value!==null);je(()=>{var w,T,V;if(!X.value){Mt("Viewport element is missing");return}const ue=X.value,ge=ue.getBoundingClientRect(),pe=Bu().clickDistance(D.value).scaleExtent([t.value,n.value]).translateExtent(i.value),oe=Ie(ue).call(pe),ce=oe.on("wheel.zoom"),v=Et.translate((w=o.value.x)!=null?w:0,(T=o.value.y)!=null?T:0).scale(ct((V=o.value.zoom)!=null?V:1,t.value,n.value)),f=[[0,0],[ge.width,ge.height]],p=pe.constrain()(v,f,i.value);pe.transform(oe,p),pe.wheelDelta(Zo),L.value=pe,Y.value=oe,F.value=ce,j.value={x:p.x,y:p.y,zoom:p.k},pe.on("start",M=>{var G;if(!M.sourceEvent)return null;b=M.sourceEvent.button,x.value=!0;const K=re(M.transform);((G=M.sourceEvent)==null?void 0:G.type)==="mousedown"&&(z.value=!0),k=K,I.viewportChangeStart(K),I.moveStart({event:M,flowTransform:K})}),pe.on("end",M=>{if(!M.sourceEvent)return null;if(x.value=!1,z.value=!1,Z(U.value,b!=null?b:0)&&!P&&I.paneContextMenu(M.sourceEvent),P=!1,W(k,M.transform)){const G=re(M.transform);k=G,I.viewportChangeEnd(G),I.moveEnd({event:M,flowTransform:G})}}),pe.filter(M=>{var G;const K=O.value||E.value,ee=g.value&&M.ctrlKey,ne=M.button,fe=M.type==="wheel";if(ne===1&&M.type==="mousedown"&&(ae(M,"vue-flow__node")||ae(M,"vue-flow__edge")))return!0;if(!U.value&&!K&&!Q.value&&!h.value&&!g.value||N.value||B.value&&!fe||!h.value&&M.type==="dblclick"||ae(M,S.value)&&fe||ae(M,C.value)&&(!fe||Q.value&&fe&&!O.value)||!g.value&&M.ctrlKey&&fe||!K&&!Q.value&&!ee&&fe)return!1;if(!g&&M.type==="touchstart"&&((G=M.touches)==null?void 0:G.length)>1)return M.preventDefault(),!1;if(!U.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||fe)&&Ve}),ve([N,U],()=>{N.value&&!x.value?pe.on("zoom",null):N.value||pe.on("zoom",M=>{j.value={x:M.transform.x,y:M.transform.y,zoom:M.transform.k};const G=re(M.transform);P=Z(U.value,b!=null?b:0),I.viewportChange(G),I.move({event:M,flowTransform:G})})},{immediate:!0}),ve([N,Q,u,O,g,_,S],()=>{Q.value&&!O.value&&!N.value?oe.on("wheel.zoom",M=>{if(ae(M,S.value))return!1;const G=O.value||E.value,K=g.value&&M.ctrlKey;if(!(!_.value||Q.value||G||K))return!1;M.preventDefault(),M.stopImmediatePropagation();const ne=oe.property("__zoom").k||1,fe=wn();if(!A.value&&M.ctrlKey&&g.value&&fe){const Cr=ke(M),Mr=Zo(M),Ir=ne*ft(2,Mr);pe.scaleTo(oe,Ir,Cr,M);return}const Ve=M.deltaMode===1?20:1;let Re=u.value===At.Vertical?0:M.deltaX*Ve,et=u.value===At.Horizontal?0:M.deltaY*Ve;!fe&&M.shiftKey&&u.value!==At.Vertical&&!Re&&et&&(Re=et,et=0),pe.translateBy(oe,-(Re/ne)*c.value,-(et/ne)*c.value);const dt=re(oe.property("__zoom"));m&&clearTimeout(m),J.value?(I.move({event:M,flowTransform:dt}),I.viewportChange(dt),m=setTimeout(()=>{I.moveEnd({event:M,flowTransform:dt}),I.viewportChangeEnd(dt),J.value=!1},150)):(J.value=!0,I.moveStart({event:M,flowTransform:dt}),I.viewportChangeStart(dt))},{passive:!1}):typeof ce!="undefined"&&oe.on("wheel.zoom",function(M,G){const K=!_.value&&M.type==="wheel"&&!M.ctrlKey,ee=O.value||E.value,ne=g.value&&M.ctrlKey;if(!ee&&!l.value&&!ne&&M.type==="wheel"||K||ae(M,S.value))return null;M.preventDefault(),ce.call(this,M,G)},{passive:!1})},{immediate:!0})});function Z(ue,ge){return ge===2&&Array.isArray(ue)&&ue.includes(2)}function W(ue,ge){return ue.x!==ge.x&&!Number.isNaN(ge.x)||ue.y!==ge.y&&!Number.isNaN(ge.y)||ue.zoom!==ge.k&&!Number.isNaN(ge.k)}function re(ue){return{x:ue.x,y:ue.y,zoom:ue.k}}function ae(ue,ge){return ue.target.closest(`.${ge}`)}return(ue,ge)=>(he(),ye("div",{ref_key:"viewportRef",ref:X,class:"vue-flow__viewport vue-flow__container"},[Fe(md,{"is-selecting":ie.value,"selection-key-pressed":te(R),class:_t({connecting:B.value,dragging:te(z),draggable:te(d)===!0||Array.isArray(te(d))&&te(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=be(de($({},Nd),{setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=_e();return(i,r)=>(he(),ye(ze,null,[st("div",{id:`${te(qi)}-${te(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+Xn(te(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),st("div",{id:`${te(Ji)}-${te(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),te(n)?Oe("",!0):(he(),ye("div",{key:0,id:`${te(Yu)}-${te(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(te(o)),9,Sd))],64))}}));function Md(){const e=_e();ve(()=>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 Pd(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:Pd(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};wo.props=["radius","centerX","centerY","position","type"];wo.compatConfig={MODE:3};const gi=wo,Td=be({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=se(()=>c(e.id)),{emit:N,on:z}=bc(y.value,r),L=Nt(In),Y=Ct(),F=we(!1),j=we(!1),X=we(""),D=we(null),x=we("source"),J=we(null),m=xe(()=>typeof y.value.selectable=="undefined"?_.value:y.value.selectable),P=xe(()=>typeof y.value.updatable=="undefined"?S.value:y.value.updatable),b=xe(()=>typeof y.value.focusable=="undefined"?C.value:y.value.focusable);wt(yc,e.id),wt(_c,J);const k=se(()=>y.value.class instanceof Function?y.value.class(y.value):y.value.class),A=se(()=>y.value.style instanceof Function?y.value.style(y.value):y.value.style),R=se(()=>{var T;const f=y.value.type||"default",p=L==null?void 0:L[`edge-${f}`];if(p)return p;let w=(T=y.value.template)!=null?T:l.value[f];if(typeof w=="string"&&Y){const V=Object.keys(Y.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:X,handleId:D,type:x,isValidConnection:h,edgeUpdaterType:x,onEdgeUpdate:ie,onEdgeUpdateEnd:B});return()=>{var et;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 T;o.value===Je.Strict?T=f.handleBounds.source:T=[...f.handleBounds.source||[],...f.handleBounds.target||[]];const V=ti(T,y.value.sourceHandle);let M;o.value===Je.Strict?M=p.handleBounds.target:M=[...p.handleBounds.target||[],...p.handleBounds.source||[]];const G=ti(M,y.value.targetHandle),K=(V==null?void 0:V.position)||q.Bottom,ee=(G==null?void 0:G.position)||q.Top,{x:ne,y:fe}=St(f,V,K),{x:Ve,y:Re}=St(p,G,ee);return y.value.sourceX=ne,y.value.sourceY=fe,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-${R.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:b.value?0:void 0,"aria-label":y.value.ariaLabel===null?void 0:(et=y.value.ariaLabel)!=null?et:`Edge from ${y.value.source} to ${y.value.target}`,"aria-describedby":b.value?`${Ji}-${t}`:void 0,"aria-roledescription":"edge",role:b.value?"group":"img"},y.value.domAttributes),{onClick:W,onContextmenu:re,onDblclick:ae,onMouseenter:ue,onMousemove:ge,onMouseleave:pe,onKeyDown:b.value?v:void 0}),[j.value?null:me(R.value===!1?l.value.default:R.value,$({id:e.id,sourceNode:f,targetNode:p,source:y.value.source,target:y.value.target,type:y.value.type,updatable:P.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('#${Yt(y.value.markerStart,t)}')`,markerEnd:`url('#${Yt(y.value.markerEnd,t)}')`,sourcePosition:K,targetPosition:ee,sourceX:ne,sourceY:fe,targetX:Ve,targetY:Re,sourceHandleId:y.value.sourceHandle,targetHandleId:y.value.targetHandle,interactionWidth:y.value.interactionWidth},w)),[P.value==="source"||P.value===!0?[me("g",{onMousedown:oe,onMouseenter:U,onMouseout:Q},me(gi,{position:K,centerX:ne,centerY:fe,radius:i.value,type:"source","data-type":"source"}))]:null,P.value==="target"||P.value===!0?[me("g",{onMousedown:ce,onMouseenter:U,onMouseout:Q},me(gi,{position:ee,centerX:Ve,centerY:Re,radius:i.value,type:"target","data-type":"target"}))]:null]])};function U(){F.value=!0}function Q(){F.value=!1}function ie(f,p){N.update({event:f,edge:y.value,connection:p})}function B(f){N.updateEnd({event:f,edge:y.value}),j.value=!1}function Z(f,p){var w;f.button===0&&(j.value=!0,X.value=p?y.value.target:y.value.source,D.value=(w=p?y.value.targetHandle:y.value.sourceHandle)!=null?w:null,x.value=p?"target":"source",N.updateStart({event:f,edge:y.value}),O(f))}function W(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 re(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 ge(f){N.mouseMove({event:f,edge:y.value})}function pe(f){N.mouseLeave({event:f,edge:y.value})}function oe(f){Z(f,!0)}function ce(f){Z(f,!1)}function v(f){var p;!E.value&&Qi.includes(f.key)&&m.value&&(f.key==="Escape"?((p=J.value)==null||p.blur(),u([c(e.id)])):n([c(e.id)]))}}}),kd=Td,$d=be({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=Nt(In))==null?void 0:e["connection-line"],g=se(()=>{var I;return d((I=o.value)==null?void 0:I.nodeId)}),E=se(()=>{var y;var I;return(y=d((I=i.value)==null?void 0:I.nodeId))!=null?y:null}),_=se(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),S=se(()=>l.value.markerStart?`url(#${Yt(l.value.markerStart,t)})`:""),C=se(()=>l.value.markerEnd?`url(#${Yt(l.value.markerEnd,t)})`:"");return()=>{var A,R,O,U,Q,ie,B,Z,W;var I,y,N;if(!g.value||!o.value)return null;const z=o.value.id,L=o.value.type,Y=g.value.handleBounds;let F=(A=Y==null?void 0:Y[L])!=null?A:[];if(n.value===Je.Loose){const re=(R=Y==null?void 0:Y[L==="source"?"target":"source"])!=null?R:[];F=[...F,...re]}if(!F)return null;const j=(O=z?F.find(re=>re.id===z):F[0])!=null?O:null,X=(U=j==null?void 0:j.position)!=null?U:q.Top,{x:D,y:x}=St(g.value,j,X);let J=null;E.value&&(n.value===Je.Strict?J=((I=E.value.handleBounds[L==="source"?"target":"source"])==null?void 0:I.find(re=>{var ae;return re.id===((ae=i.value)==null?void 0:ae.id)}))||null:J=((y=[...(Q=E.value.handleBounds.source)!=null?Q:[],...(ie=E.value.handleBounds.target)!=null?ie:[]])==null?void 0:y.find(re=>{var ae;return re.id===((ae=i.value)==null?void 0:ae.id)}))||null);const m=(B=(N=i.value)==null?void 0:N.position)!=null?B:X?io[X]:null;if(!X||!m)return null;const P=(W=(Z=s.value)!=null?Z:l.value.type)!=null?W:tt.Bezier;let b="";const k={sourceX:D,sourceY:x,sourcePosition:X,targetX:_.value.x,targetY:_.value.y,targetPosition:m};return P===tt.Bezier?[b]=Er(k):P===tt.Step?[b]=so(de($({},k),{borderRadius:0})):P===tt.SmoothStep?[b]=so(k):P===tt.SimpleBezier?[b]=Sr(k):b=`M${D},${x} ${_.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:x,sourcePosition:X,targetX:_.value.x,targetY:_.value.y,targetPosition:m,sourceNode:g.value,sourceHandle:j,targetNode:E.value,targetHandle:J,markerEnd:C.value,markerStart:S.value,connectionStatus:u.value}):me("path",{d:b,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=be(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)=>(he(),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===te(no).ArrowClosed?(he(),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===te(no).Arrow?(he(),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=be(de($({},Vd),{setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=_e(),r=se(()=>{const s=new Set,a=[],l=u=>{if(u){const c=Yt(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)=>(he(),ye("svg",Bd,[st("defs",null,[(he(!0),ye(ze,null,ao(r.value,l=>(he(),at(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=be(de($({},Hd),{setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=_e();return(i,r)=>(he(),ye(ze,null,[Fe(Rd),(he(!0),ye(ze,null,ao(te(n),s=>(he(),ye("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Ue({zIndex:te(rc)(s,te(t),te(o))})},[Fe(te(kd),{id:s.id},null,8,["id"])],4))),128)),Fe(te(Dd))],64))}})),Fd=be({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:Y}=_e(),F=we(null);wt(gr,F),wt(hr,e.id);const j=Nt(In),X=Ct(),D=_r(),{node:x,parentNode:J}=yr(e.id),{emit:m,on:P}=Sc(x,s),b=xe(()=>typeof x.draggable=="undefined"?y.value:x.draggable),k=xe(()=>typeof x.selectable=="undefined"?N.value:x.selectable),A=xe(()=>typeof x.connectable=="undefined"?z.value:x.connectable),R=xe(()=>typeof x.focusable=="undefined"?L.value:x.focusable),O=se(()=>k.value||b.value||Y.value.nodeClick.hasListeners()||Y.value.nodeDoubleClick.hasListeners()||Y.value.nodeMouseEnter.hasListeners()||Y.value.nodeMouseMove.hasListeners()||Y.value.nodeMouseLeave.hasListeners()),U=xe(()=>!!x.dimensions.width&&!!x.dimensions.height),Q=se(()=>{const p=x.type||"default",w=j==null?void 0:j[`node-${p}`];if(w)return w;let T=x.template||d.value[p];if(typeof T=="string"&&X){const V=Object.keys(X.appContext.components);V&&V.includes(p)&&(T=_i(p,!1))}return T&&typeof T!="string"?T:(s.error(new Ne(Se.NODE_TYPE_MISSING,T)),!1)}),ie=vr({id:e.id,el:F,disabled:()=>!b.value,selectable:k,dragHandle:()=>x.dragHandle,onStart(p){m.dragStart(p)},onDrag(p){m.drag(p)},onStop(p){m.dragStop(p)},onClick(p){v(p)}}),B=se(()=>x.class instanceof Function?x.class(x):x.class),Z=se(()=>{const p=(x.style instanceof Function?x.style(x):x.style)||{},w=x.width instanceof Function?x.width(x):x.width,T=x.height instanceof Function?x.height(x):x.height;return!p.width&&w&&(p.width=typeof w=="string"?w:`${w}px`),!p.height&&T&&(p.height=typeof T=="string"?T:`${T}px`),p}),W=xe(()=>{var p,w;return Number((w=(p=x.zIndex)!=null?p:Z.value.zIndex)!=null?w:0)});return c(p=>{(p.includes(e.id)||!p.length)&&ae()}),je(()=>{ve(()=>x.hidden,(p=!1,w,T)=>{!p&&F.value&&(e.resizeObserver.observe(F.value),T(()=>{F.value&&e.resizeObserver.unobserve(F.value)}))},{immediate:!0,flush:"post"})}),ve([()=>x.type,()=>x.sourcePosition,()=>x.targetPosition],()=>{Ge(()=>{u([{id:e.id,nodeElement:F.value,forceUpdate:!0}])})}),ve([()=>x.position.x,()=>x.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},W,()=>x.selected,()=>x.dimensions.height,()=>x.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,T,V,M,G])=>{const K={x:p,y:w,z:G+(g.value&&x.selected?1e3:0)};typeof T!="undefined"&&typeof V!="undefined"?x.computedPosition=ju({x:T,y:V,z:M},K):x.computedPosition=K},{flush:"post",immediate:!0}),ve([()=>x.extent,h],([p,w],[T,V])=>{(p!==T||w!==V)&&re()}),x.extent==="parent"||typeof x.extent=="object"&&"range"in x.extent&&x.extent.range==="parent"?Zn(()=>U).toBe(!0).then(re):re(),()=>{var p,w;return x.hidden?null:me("div",de($({ref:F,"data-id":x.id,class:["vue-flow__node",`vue-flow__node-${Q.value===!1?"default":x.type||"default"}`,{[n.value]:b.value,dragging:ie==null?void 0:ie.value,draggable:b.value,selected:x.selected,selectable:k.value,parent:x.isParent},B.value],style:$({visibility:U.value?"visible":"hidden",zIndex:(p=x.computedPosition.z)!=null?p:W.value,transform:`translate(${x.computedPosition.x}px,${x.computedPosition.y}px)`,pointerEvents:O.value?"all":"none"},Z.value),tabIndex:R.value?0:void 0,role:R.value?"group":void 0,"aria-describedby":E.value?void 0:`${qi}-${t}`,"aria-label":x.ariaLabel,"aria-roledescription":"node"},x.domAttributes),{onMouseenter:ue,onMousemove:ge,onMouseleave:pe,onContextmenu:oe,onClick:v,onDblclick:ce,onKeydown:f}),[me(Q.value===!1?d.value.default:Q.value,{id:x.id,type:x.type,data:x.data,events:$($({},x.events),P),selected:x.selected,resizing:x.resizing,dragging:ie.value,connectable:A.value,position:x.computedPosition,dimensions:x.dimensions,isValidTargetPos:x.isValidTargetPos,isValidSourcePos:x.isValidSourcePos,parent:x.parentNode,parentNodeId:x.parentNode,zIndex:(w=x.computedPosition.z)!=null?w:W.value,targetPosition:x.targetPosition,sourcePosition:x.sourcePosition,label:x.label,dragHandle:x.dragHandle,onUpdateNodeInternals:ae})])};function re(){const p=x.computedPosition,{computedPosition:w,position:T}=yo(x,S.value?Mn(p,C.value):p,s.error,h.value,J.value);(x.computedPosition.x!==w.x||x.computedPosition.y!==w.y)&&(x.computedPosition=$($({},x.computedPosition),w)),(x.position.x!==T.x||x.position.y!==T.y)&&(x.position=T)}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:x})}function ge(p){ie!=null&&ie.value||m.mouseMove({event:p,node:x})}function pe(p){ie!=null&&ie.value||m.mouseLeave({event:p,node:x})}function oe(p){return m.contextMenu({event:p,node:x})}function ce(p){return m.doubleClick({event:p,node:x})}function v(p){k.value&&(!o.value||!b.value||I.value>0)&&ro(x,r.value,l,a,i,!1,F.value),m.click({event:p,node:x})}function f(p){if(!(oo(p)||E.value))if(Qi.includes(p.key)&&k.value){const w=p.key==="Escape";ro(x,r.value,l,a,i,w,F.value)}else b.value&&x.selected&&yt[p.key]&&(p.preventDefault(),_.value=`Moved selected node ${p.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~x.position.x}, y: ${~~x.position.y}`,D({x:yt[p.key].x,y:yt[p.key].y},p.shiftKey))}}}),Yd=Fd,Gd={height:"0",width:"0"},Xd={name:"EdgeLabelRenderer",compatConfig:{MODE:3}},nf=be(de($({},Xd),{setup(e){const{viewportRef:t}=_e(),n=xe(()=>{var o;return(o=t.value)==null?void 0:o.getElementsByClassName("vue-flow__edge-labels")[0]});return(o,i)=>(he(),ye("svg",null,[(he(),ye("foreignObject",Gd,[(he(),at(Dr,{to:n.value,disabled:!n.value},[Xe(o.$slots,"default")],8,["to","disabled"]))]))]))}}));function Ud(e={includeHiddenNodes:!1}){const{nodes:t}=_e();return se(()=>{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=be(de($({},Wd),{setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=_e(),i=Ud(),r=we();return ve(i,s=>{s&&Ge(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),je(()=>{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)=>(he(),ye("div",Zd,[r.value?(he(!0),ye(ze,{key:0},ao(te(t),(l,u,c,d)=>{const h=[l.id];if(d&&d.key===l.id&&Lr(d,h))return d;const g=(he(),at(te(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();je(()=>{if(fr()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ne(Se.MISSING_STYLES))}})}const Jd=st("div",{class:"vue-flow__edge-labels"},null,-1),Qd={name:"VueFlow",compatConfig:{MODE:3}},of=be(de($({},Qd),{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 Tc(n,l.hooks),Md(),qd(),wt(In,i),zr(u),t(l),(c,d)=>(he(),ye("div",{ref:te(l).vueFlowRef,class:"vue-flow"},[Fe(bd,null,{default:Gn(()=>[Fe(Ld),Jd,Fe(Kd),Xe(c.$slots,"zoom-pane")]),_:3}),Xe(c.$slots,"default"),Fe(Cd)],512))}})),jd={name:"Panel",compatConfig:{MODE:3}},rf=be(de($({},jd),{props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=_e(),o=se(()=>`${t.position}`.split("-"));return(i,r)=>(he(),ye("div",{class:_t(["vue-flow__panel",o.value]),style:Ue({pointerEvents:te(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=we(null),u=we(),c=se(()=>{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 ve(()=>s.value.get(c.value),d=>{mc(u.value,d)||(u.value=d)},{immediate:!0}),ve([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}),se(()=>u.value?Array.from(u.value.values()):[])}function af(e){const{findNode:t}=_e();return se({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(){Mt("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};