| 123456789101112131415161718192021 | 
							- import{N as Ko,O as vt,P as qo,B as ge,Q as ut,R as It,S as dr,H as ne,D as ye,T as Vt,j as Yn,U as fr,V as hr,W as Jo,I as xe,r as de,X as Qo,o as ae,c as me,J as qe,u as ee,n as ct,Y as gr,d as ze,w as En,Z as Re,$ as vr,e as nt,b as Je,t as Sn,v as Pe,F as Qe,h as Fn,a0 as jo,K as Ve,a1 as ei,l as dt,a2 as se,a3 as rt,G as fe,a as ti,a4 as pr,a5 as mr,M as yr,q as _r,a6 as wr}from"./index-ab924b12.js";function jt(e){return Ko()?(Vt(e),!0):!1}function Oe(e){return typeof e=="function"?e():ee(e)}const xr=typeof window<"u"&&typeof document<"u",br=e=>typeof e<"u",Er=Object.prototype.toString,Sr=e=>Er.call(e)==="[object Object]",Nr=()=>{};function Mr(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 ni=e=>e();function Cr(e=ni){const t=de(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:pr(t),pause:n,resume:o,eventFilter:i}}function oo(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function Ir(e,t,n={}){const{eventFilter:o=ni,...i}=n;return ge(e,Mr(o,t),i)}function ot(e,t,n={}){const{eventFilter:o,...i}=n,{eventFilter:r,pause:s,resume:a,isActive:l}=Cr(o);return{stop:Ir(e,t,{...i,eventFilter:r}),pause:s,resume:a,isActive:l}}function Tr(e,t={}){if(!Yn(e))return fr(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=hr(()=>({get(){return e.value[o]},set(i){var r;if((r=Oe(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const a=[...e.value];a[o]=i,e.value=a}else{const a={...e.value,[o]:i};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[o]=i}}));return n}function Nn(e,t=!1){function n(f,{flush:h="sync",deep:m=!1,timeout:b,throwOnTimeout:_}={}){let x=null;const g=[new Promise(I=>{x=ge(e,N=>{f(N)!==t&&(x==null||x(),I(N))},{flush:h,deep:m,immediate:!0})})];return b!=null&&g.push(oo(b,_).then(()=>Oe(e)).finally(()=>x==null?void 0:x())),Promise.race(g)}function o(f,h){if(!Yn(f))return n(N=>N===f,h);const{flush:m="sync",deep:b=!1,timeout:_,throwOnTimeout:x}=h??{};let S=null;const I=[new Promise(N=>{S=ge([e,f],([O,H])=>{t!==(O===H)&&(S==null||S(),N(O))},{flush:m,deep:b,immediate:!0})})];return _!=null&&I.push(oo(_,x).then(()=>Oe(e)).finally(()=>(S==null||S(),Oe(e)))),Promise.race(I)}function i(f){return n(h=>!!h,f)}function r(f){return o(null,f)}function s(f){return o(void 0,f)}function a(f){return n(Number.isNaN,f)}function l(f,h){return n(m=>{const b=Array.from(m);return b.includes(f)||b.includes(Oe(f))},h)}function u(f){return c(1,f)}function c(f=1,h){let m=-1;return n(()=>(m+=1,m>=f),h)}return Array.isArray(Oe(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return Nn(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:a,toBeUndefined:s,changed:u,changedTimes:c,get not(){return Nn(e,!t)}}}function Gt(e){return Nn(e)}function kr(e){var t;const n=Oe(e);return(t=n==null?void 0:n.$el)!=null?t:n}const oi=xr?window:void 0;function ii(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=oi):[t,n,o,i]=e,!t)return Nr;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],s=()=>{r.forEach(c=>c()),r.length=0},a=(c,f,h,m)=>(c.addEventListener(f,h,m),()=>c.removeEventListener(f,h,m)),l=ge(()=>[kr(t),Oe(i)],([c,f])=>{if(s(),!c)return;const h=Sr(f)?{...f}:f;r.push(...n.flatMap(m=>o.map(b=>a(c,m,b,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return jt(u),u}function Pr(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function io(...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=oi,eventName:r="keydown",passive:s=!1,dedupe:a=!1}=o,l=Pr(t);return ii(i,r,c=>{c.repeat&&Oe(a)||l(c)&&n(c)},s)}function $r(e){return JSON.parse(JSON.stringify(e))}function fn(e,t,n,o={}){var i,r,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:f,shouldEmit:h}=o,m=It(),b=n||(m==null?void 0:m.emit)||((i=m==null?void 0:m.$emit)==null?void 0:i.bind(m))||((s=(r=m==null?void 0:m.proxy)==null?void 0:r.$emit)==null?void 0:s.bind(m==null?void 0:m.proxy));let _=u;t||(t="modelValue"),_=_||`update:${t.toString()}`;const x=I=>a?typeof a=="function"?a(I):$r(I):I,S=()=>br(e[t])?x(e[t]):f,g=I=>{h?h(I)&&b(_,I):b(_,I)};if(l){const I=S(),N=de(I);let O=!1;return ge(()=>e[t],H=>{O||(O=!0,N.value=x(H),Re(()=>O=!1))}),ge(N,H=>{!O&&(H!==e[t]||c)&&g(H)},{deep:c}),N}else return ne({get(){return S()},set(I){g(I)}})}var Dr={value:()=>{}};function en(){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 Ht(n)}function Ht(e){this._=e}function Ar(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}})}Ht.prototype=en.prototype={constructor:Ht,on:function(e,t){var n=this._,o=Ar(e+"",n),i,r=-1,s=o.length;if(arguments.length<2){for(;++r<s;)if((i=(e=o[r]).type)&&(i=Or(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]=ro(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ro(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 Ht(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 Or(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function ro(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=Dr,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Mn="http://www.w3.org/1999/xhtml";const so={svg:"http://www.w3.org/2000/svg",xhtml:Mn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),so.hasOwnProperty(t)?{space:so[t],local:e}:e}function zr(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Mn&&t.documentElement.namespaceURI===Mn?t.createElement(e):t.createElementNS(n,e)}}function Br(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ri(e){var t=tn(e);return(t.local?Br:zr)(t)}function Rr(){}function Gn(e){return e==null?Rr:function(){return this.querySelector(e)}}function Vr(e){typeof e!="function"&&(e=Gn(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 Ne(o,this._parents)}function Hr(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Lr(){return[]}function si(e){return e==null?Lr:function(){return this.querySelectorAll(e)}}function Yr(e){return function(){return Hr(e.apply(this,arguments))}}function Fr(e){typeof e=="function"?e=Yr(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 Ne(o,i)}function ai(e){return function(){return this.matches(e)}}function li(e){return function(t){return t.matches(e)}}var Gr=Array.prototype.find;function Xr(e){return function(){return Gr.call(this.children,e)}}function Ur(){return this.firstElementChild}function Zr(e){return this.select(e==null?Ur:Xr(typeof e=="function"?e:li(e)))}var Wr=Array.prototype.filter;function Kr(){return Array.from(this.children)}function qr(e){return function(){return Wr.call(this.children,e)}}function Jr(e){return this.selectAll(e==null?Kr:qr(typeof e=="function"?e:li(e)))}function Qr(e){typeof e!="function"&&(e=ai(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 Ne(o,this._parents)}function ui(e){return new Array(e.length)}function jr(){return new Ne(this._enter||this._groups.map(ui),this._parents)}function Xt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Xt.prototype={constructor:Xt,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 es(e){return function(){return e}}function ts(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 Xt(e,r[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function ns(e,t,n,o,i,r,s){var a,l,u=new Map,c=t.length,f=r.length,h=new Array(c),m;for(a=0;a<c;++a)(l=t[a])&&(h[a]=m=s.call(l,l.__data__,a,t)+"",u.has(m)?i[a]=l:u.set(m,l));for(a=0;a<f;++a)m=s.call(e,r[a],a,r)+"",(l=u.get(m))?(o[a]=l,l.__data__=r[a],u.delete(m)):n[a]=new Xt(e,r[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(h[a])===l&&(i[a]=l)}function os(e){return e.__data__}function is(e,t){if(!arguments.length)return Array.from(this,os);var n=t?ns:ts,o=this._parents,i=this._groups;typeof e!="function"&&(e=es(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],f=i[u],h=f.length,m=rs(e.call(c,c&&c.__data__,u,o)),b=m.length,_=a[u]=new Array(b),x=s[u]=new Array(b),S=l[u]=new Array(h);n(c,f,_,x,S,m,t);for(var g=0,I=0,N,O;g<b;++g)if(N=_[g]){for(g>=I&&(I=g+1);!(O=x[I])&&++I<b;);N._next=O||null}}return s=new Ne(s,o),s._enter=a,s._exit=l,s}function rs(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ss(){return new Ne(this._exit||this._groups.map(ui),this._parents)}function as(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 ls(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],f=u.length,h=a[l]=new Array(f),m,b=0;b<f;++b)(m=u[b]||c[b])&&(h[b]=m);for(;l<i;++l)a[l]=n[l];return new Ne(a,this._parents)}function us(){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 cs(e){e||(e=ds);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!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 Ne(i,this._parents).order()}function ds(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function fs(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function hs(){return Array.from(this)}function gs(){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 vs(){let e=0;for(const t of this)++e;return e}function ps(){return!this.node()}function ms(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 ys(e){return function(){this.removeAttribute(e)}}function _s(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ws(e,t){return function(){this.setAttribute(e,t)}}function xs(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function bs(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Es(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 Ss(e,t){var n=tn(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?_s:ys:typeof t=="function"?n.local?Es:bs:n.local?xs:ws)(n,t))}function ci(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ns(e){return function(){this.style.removeProperty(e)}}function Ms(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Cs(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Is(e,t,n){return arguments.length>1?this.each((t==null?Ns:typeof t=="function"?Cs:Ms)(e,t,n??"")):ft(this.node(),e)}function ft(e,t){return e.style.getPropertyValue(t)||ci(e).getComputedStyle(e,null).getPropertyValue(t)}function Ts(e){return function(){delete this[e]}}function ks(e,t){return function(){this[e]=t}}function Ps(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function $s(e,t){return arguments.length>1?this.each((t==null?Ts:typeof t=="function"?Ps:ks)(e,t)):this.node()[e]}function di(e){return e.trim().split(/^|\s+/)}function Xn(e){return e.classList||new fi(e)}function fi(e){this._node=e,this._names=di(e.getAttribute("class")||"")}fi.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 hi(e,t){for(var n=Xn(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function gi(e,t){for(var n=Xn(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function Ds(e){return function(){hi(this,e)}}function As(e){return function(){gi(this,e)}}function Os(e,t){return function(){(t.apply(this,arguments)?hi:gi)(this,e)}}function zs(e,t){var n=di(e+"");if(arguments.length<2){for(var o=Xn(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Os:t?Ds:As)(n,t))}function Bs(){this.textContent=""}function Rs(e){return function(){this.textContent=e}}function Vs(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Hs(e){return arguments.length?this.each(e==null?Bs:(typeof e=="function"?Vs:Rs)(e)):this.node().textContent}function Ls(){this.innerHTML=""}function Ys(e){return function(){this.innerHTML=e}}function Fs(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Gs(e){return arguments.length?this.each(e==null?Ls:(typeof e=="function"?Fs:Ys)(e)):this.node().innerHTML}function Xs(){this.nextSibling&&this.parentNode.appendChild(this)}function Us(){return this.each(Xs)}function Zs(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ws(){return this.each(Zs)}function Ks(e){var t=typeof e=="function"?e:ri(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qs(){return null}function Js(e,t){var n=typeof e=="function"?e:ri(e),o=t==null?qs:typeof t=="function"?t:Gn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Qs(){var e=this.parentNode;e&&e.removeChild(this)}function js(){return this.each(Qs)}function ea(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ta(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function na(e){return this.select(e?ta:ea)}function oa(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ia(e){return function(t){e.call(this,t,this.__data__)}}function ra(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 sa(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 aa(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 la(e,t,n){var o=ra(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?aa:sa,i=0;i<r;++i)this.each(a(o[i],t,n));return this}function vi(e,t,n){var o=ci(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 ua(e,t){return function(){return vi(this,e,t)}}function ca(e,t){return function(){return vi(this,e,t.apply(this,arguments))}}function da(e,t){return this.each((typeof t=="function"?ca:ua)(e,t))}function*fa(){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 pi=[null];function Ne(e,t){this._groups=e,this._parents=t}function Tt(){return new Ne([[document.documentElement]],pi)}function ha(){return this}Ne.prototype=Tt.prototype={constructor:Ne,select:Vr,selectAll:Fr,selectChild:Zr,selectChildren:Jr,filter:Qr,data:is,enter:jr,exit:ss,join:as,merge:ls,selection:ha,order:us,sort:cs,call:fs,nodes:hs,node:gs,size:vs,empty:ps,each:ms,attr:Ss,style:Is,property:$s,classed:zs,text:Hs,html:Gs,raise:Us,lower:Ws,append:Ks,insert:Js,remove:js,clone:na,datum:oa,on:la,dispatch:da,[Symbol.iterator]:fa};function Me(e){return typeof e=="string"?new Ne([[document.querySelector(e)]],[document.documentElement]):new Ne([[e]],pi)}function ga(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Te(e,t){if(e=ga(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 va={passive:!1},bt={capture:!0,passive:!1};function hn(e){e.stopImmediatePropagation()}function st(e){e.preventDefault(),e.stopImmediatePropagation()}function mi(e){var t=e.document.documentElement,n=Me(e).on("dragstart.drag",st,bt);"onselectstart"in t?n.on("selectstart.drag",st,bt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function yi(e,t){var n=e.document.documentElement,o=Me(e).on("dragstart.drag",null);t&&(o.on("click.drag",st,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 Pt=e=>()=>e;function Cn(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}})}Cn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function pa(e){return!e.ctrlKey&&!e.button}function ma(){return this.parentNode}function ya(e,t){return t??{x:e.x,y:e.y}}function _a(){return navigator.maxTouchPoints||"ontouchstart"in this}function wa(){var e=pa,t=ma,n=ya,o=_a,i={},r=en("start","drag","end"),s=0,a,l,u,c,f=0;function h(N){N.on("mousedown.drag",m).filter(o).on("touchstart.drag",x).on("touchmove.drag",S,va).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(N,O){if(!(c||!e.call(this,N,O))){var H=I(this,t.call(this,N,O),N,O,"mouse");H&&(Me(N.view).on("mousemove.drag",b,bt).on("mouseup.drag",_,bt),mi(N.view),hn(N),u=!1,a=N.clientX,l=N.clientY,H("start",N))}}function b(N){if(st(N),!u){var O=N.clientX-a,H=N.clientY-l;u=O*O+H*H>f}i.mouse("drag",N)}function _(N){Me(N.view).on("mousemove.drag mouseup.drag",null),yi(N.view,u),st(N),i.mouse("end",N)}function x(N,O){if(e.call(this,N,O)){var H=N.changedTouches,A=t.call(this,N,O),G=H.length,X,$;for(X=0;X<G;++X)($=I(this,A,N,O,H[X].identifier,H[X]))&&(hn(N),$("start",N,H[X]))}}function S(N){var O=N.changedTouches,H=O.length,A,G;for(A=0;A<H;++A)(G=i[O[A].identifier])&&(st(N),G("drag",N,O[A]))}function g(N){var O=N.changedTouches,H=O.length,A,G;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),A=0;A<H;++A)(G=i[O[A].identifier])&&(hn(N),G("end",N,O[A]))}function I(N,O,H,A,G,X){var $=r.copy(),w=Te(X||H,O),J,R,p;if((p=n.call(N,new Cn("beforestart",{sourceEvent:H,target:h,identifier:G,active:s,x:w[0],y:w[1],dx:0,dy:0,dispatch:$}),A))!=null)return J=p.x-w[0]||0,R=p.y-w[1]||0,function k(E,T,z){var M=w,P;switch(E){case"start":i[G]=k,P=s++;break;case"end":delete i[G],--s;case"drag":w=Te(z||T,O),P=s;break}$.call(E,N,new Cn(E,{sourceEvent:T,subject:p,target:h,identifier:G,active:P,x:w[0]+J,y:w[1]+R,dx:w[0]-M[0],dy:w[1]-M[1],dispatch:$}),A)}}return h.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Pt(!!N),h):e},h.container=function(N){return arguments.length?(t=typeof N=="function"?N:Pt(N),h):t},h.subject=function(N){return arguments.length?(n=typeof N=="function"?N:Pt(N),h):n},h.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:Pt(!!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?(f=(N=+N)*N,h):Math.sqrt(f)},h}function Un(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _i(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function kt(){}var Et=.7,Ut=1/Et,at="\\s*([+-]?\\d+)\\s*",St="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xa=/^#([0-9a-f]{3,8})$/,ba=new RegExp(`^rgb\\(${at},${at},${at}\\)$`),Ea=new RegExp(`^rgb\\(${ke},${ke},${ke}\\)$`),Sa=new RegExp(`^rgba\\(${at},${at},${at},${St}\\)$`),Na=new RegExp(`^rgba\\(${ke},${ke},${ke},${St}\\)$`),Ma=new RegExp(`^hsl\\(${St},${ke},${ke}\\)$`),Ca=new RegExp(`^hsla\\(${St},${ke},${ke},${St}\\)$`),ao={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};Un(kt,Nt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:lo,formatHex:lo,formatHex8:Ia,formatHsl:Ta,formatRgb:uo,toString:uo});function lo(){return this.rgb().formatHex()}function Ia(){return this.rgb().formatHex8()}function Ta(){return wi(this).formatHsl()}function uo(){return this.rgb().formatRgb()}function Nt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xa.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?co(t):n===3?new Se(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$t(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$t(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=ba.exec(e))?new Se(t[1],t[2],t[3],1):(t=Ea.exec(e))?new Se(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Sa.exec(e))?$t(t[1],t[2],t[3],t[4]):(t=Na.exec(e))?$t(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ma.exec(e))?go(t[1],t[2]/100,t[3]/100,1):(t=Ca.exec(e))?go(t[1],t[2]/100,t[3]/100,t[4]):ao.hasOwnProperty(e)?co(ao[e]):e==="transparent"?new Se(NaN,NaN,NaN,0):null}function co(e){return new Se(e>>16&255,e>>8&255,e&255,1)}function $t(e,t,n,o){return o<=0&&(e=t=n=NaN),new Se(e,t,n,o)}function ka(e){return e instanceof kt||(e=Nt(e)),e?(e=e.rgb(),new Se(e.r,e.g,e.b,e.opacity)):new Se}function In(e,t,n,o){return arguments.length===1?ka(e):new Se(e,t,n,o??1)}function Se(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Un(Se,In,_i(kt,{brighter(e){return e=e==null?Ut:Math.pow(Ut,e),new Se(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Et:Math.pow(Et,e),new Se(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Se(Ze(this.r),Ze(this.g),Ze(this.b),Zt(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:fo,formatHex:fo,formatHex8:Pa,formatRgb:ho,toString:ho}));function fo(){return`#${Ue(this.r)}${Ue(this.g)}${Ue(this.b)}`}function Pa(){return`#${Ue(this.r)}${Ue(this.g)}${Ue(this.b)}${Ue((isNaN(this.opacity)?1:this.opacity)*255)}`}function ho(){const e=Zt(this.opacity);return`${e===1?"rgb(":"rgba("}${Ze(this.r)}, ${Ze(this.g)}, ${Ze(this.b)}${e===1?")":`, ${e})`}`}function Zt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ze(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ue(e){return e=Ze(e),(e<16?"0":"")+e.toString(16)}function go(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ce(e,t,n,o)}function wi(e){if(e instanceof Ce)return new Ce(e.h,e.s,e.l,e.opacity);if(e instanceof kt||(e=Nt(e)),!e)return new Ce;if(e instanceof Ce)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 Ce(s,a,l,e.opacity)}function $a(e,t,n,o){return arguments.length===1?wi(e):new Ce(e,t,n,o??1)}function Ce(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Un(Ce,$a,_i(kt,{brighter(e){return e=e==null?Ut:Math.pow(Ut,e),new Ce(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Et:Math.pow(Et,e),new Ce(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 Se(gn(e>=240?e-240:e+120,i,o),gn(e,i,o),gn(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Ce(vo(this.h),Dt(this.s),Dt(this.l),Zt(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=Zt(this.opacity);return`${e===1?"hsl(":"hsla("}${vo(this.h)}, ${Dt(this.s)*100}%, ${Dt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function vo(e){return e=(e||0)%360,e<0?e+360:e}function Dt(e){return Math.max(0,Math.min(1,e||0))}function gn(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 xi=e=>()=>e;function Da(e,t){return function(n){return e+n*t}}function Aa(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 Oa(e){return(e=+e)==1?bi:function(t,n){return n-t?Aa(t,n,e):xi(isNaN(t)?n:t)}}function bi(e,t){var n=t-e;return n?Da(e,n):xi(isNaN(e)?t:e)}const po=function e(t){var n=Oa(t);function o(i,r){var s=n((i=In(i)).r,(r=In(r)).r),a=n(i.g,r.g),l=n(i.b,r.b),u=bi(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 Ye(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Tn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vn=new RegExp(Tn.source,"g");function za(e){return function(){return e}}function Ba(e){return function(t){return e(t)+""}}function Ra(e,t){var n=Tn.lastIndex=vn.lastIndex=0,o,i,r,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Tn.exec(e))&&(i=vn.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:Ye(o,i)})),n=vn.lastIndex;return n<t.length&&(r=t.slice(n),a[s]?a[s]+=r:a[++s]=r),a.length<2?l[0]?Ba(l[0].x):za(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)a[(f=l[c]).i]=f.x(u);return a.join("")})}var mo=180/Math.PI,kn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ei(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)*mo,skewX:Math.atan(l)*mo,scaleX:s,scaleY:a}}var At;function Va(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?kn:Ei(t.a,t.b,t.c,t.d,t.e,t.f)}function Ha(e){return e==null||(At||(At=document.createElementNS("http://www.w3.org/2000/svg","g")),At.setAttribute("transform",e),!(e=At.transform.baseVal.consolidate()))?kn:(e=e.matrix,Ei(e.a,e.b,e.c,e.d,e.e,e.f))}function Si(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,f,h,m,b){if(u!==f||c!==h){var _=m.push("translate(",null,t,null,n);b.push({i:_-4,x:Ye(u,f)},{i:_-2,x:Ye(c,h)})}else(f||h)&&m.push("translate("+f+t+h+n)}function s(u,c,f,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,o)-2,x:Ye(u,c)})):c&&f.push(i(f)+"rotate("+c+o)}function a(u,c,f,h){u!==c?h.push({i:f.push(i(f)+"skewX(",null,o)-2,x:Ye(u,c)}):c&&f.push(i(f)+"skewX("+c+o)}function l(u,c,f,h,m,b){if(u!==f||c!==h){var _=m.push(i(m)+"scale(",null,",",null,")");b.push({i:_-4,x:Ye(u,f)},{i:_-2,x:Ye(c,h)})}else(f!==1||h!==1)&&m.push(i(m)+"scale("+f+","+h+")")}return function(u,c){var f=[],h=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,f,h),s(u.rotate,c.rotate,f,h),a(u.skewX,c.skewX,f,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,h),u=c=null,function(m){for(var b=-1,_=h.length,x;++b<_;)f[(x=h[b]).i]=x.x(m);return f.join("")}}}var La=Si(Va,"px, ","px)","deg)"),Ya=Si(Ha,", ",")",")"),Fa=1e-12;function yo(e){return((e=Math.exp(e))+1/e)/2}function Ga(e){return((e=Math.exp(e))-1/e)/2}function Xa(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ua=function e(t,n,o){function i(r,s){var a=r[0],l=r[1],u=r[2],c=s[0],f=s[1],h=s[2],m=c-a,b=f-l,_=m*m+b*b,x,S;if(_<Fa)S=Math.log(h/u)/t,x=function(A){return[a+A*m,l+A*b,u*Math.exp(t*A*S)]};else{var g=Math.sqrt(_),I=(h*h-u*u+o*_)/(2*u*n*g),N=(h*h-u*u-o*_)/(2*h*n*g),O=Math.log(Math.sqrt(I*I+1)-I),H=Math.log(Math.sqrt(N*N+1)-N);S=(H-O)/t,x=function(A){var G=A*S,X=yo(O),$=u/(n*g)*(X*Xa(t*G+O)-Ga(O));return[a+$*m,l+$*b,u*X/yo(t*G+O)]}}return x.duration=S*1e3*t/Math.SQRT2,x}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 ht=0,yt=0,pt=0,Ni=1e3,Wt,_t,Kt=0,je=0,nn=0,Mt=typeof performance=="object"&&performance.now?performance:Date,Mi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Zn(){return je||(Mi(Za),je=Mt.now()+nn)}function Za(){je=0}function qt(){this._call=this._time=this._next=null}qt.prototype=Ci.prototype={constructor:qt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Zn():+n)+(t==null?0:+t),!this._next&&_t!==this&&(_t?_t._next=this:Wt=this,_t=this),this._call=e,this._time=n,Pn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Pn())}};function Ci(e,t,n){var o=new qt;return o.restart(e,t,n),o}function Wa(){Zn(),++ht;for(var e=Wt,t;e;)(t=je-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ht}function _o(){je=(Kt=Mt.now())+nn,ht=yt=0;try{Wa()}finally{ht=0,qa(),je=0}}function Ka(){var e=Mt.now(),t=e-Kt;t>Ni&&(nn-=t,Kt=e)}function qa(){for(var e,t=Wt,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:Wt=n);_t=e,Pn(o)}function Pn(e){if(!ht){yt&&(yt=clearTimeout(yt));var t=e-je;t>24?(e<1/0&&(yt=setTimeout(_o,e-Mt.now()-nn)),pt&&(pt=clearInterval(pt))):(pt||(Kt=Mt.now(),pt=setInterval(Ka,Ni)),ht=1,Mi(_o))}}function wo(e,t,n){var o=new qt;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Ja=en("start","end","cancel","interrupt"),Qa=[],Ii=0,xo=1,$n=2,Lt=3,bo=4,Dn=5,Yt=6;function on(e,t,n,o,i,r){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;ja(e,n,{name:t,index:o,group:i,on:Ja,tween:Qa,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ii})}function Wn(e,t){var n=Ie(e,t);if(n.state>Ii)throw new Error("too late; already scheduled");return n}function $e(e,t){var n=Ie(e,t);if(n.state>Lt)throw new Error("too late; already running");return n}function Ie(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ja(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Ci(r,0,n.time);function r(u){n.state=xo,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,f,h,m;if(n.state!==xo)return l();for(c in o)if(m=o[c],m.name===n.name){if(m.state===Lt)return wo(s);m.state===bo?(m.state=Yt,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete o[c]):+c<t&&(m.state=Yt,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete o[c])}if(wo(function(){n.state===Lt&&(n.state=bo,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=$n,n.on.call("start",e,e.__data__,n.index,n.group),n.state===$n){for(n.state=Lt,i=new Array(h=n.tween.length),c=0,f=-1;c<h;++c)(m=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=m);i.length=f+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Dn,1),f=-1,h=i.length;++f<h;)i[f].call(e,c);n.state===Dn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Yt,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function Ft(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>$n&&o.state<Dn,o.state=Yt,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}r&&delete e.__transition}}function el(e){return this.each(function(){Ft(this,e)})}function tl(e,t){var n,o;return function(){var i=$e(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 nl(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=$e(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 ol(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ie(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?tl:nl)(n,e,t))}function Kn(e,t,n){var o=e._id;return e.each(function(){var i=$e(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ie(i,o).value[t]}}function Ti(e,t){var n;return(typeof t=="number"?Ye:t instanceof Nt?po:(n=Nt(t))?(t=n,po):Ra)(e,t)}function il(e){return function(){this.removeAttribute(e)}}function rl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function sl(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 ll(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 ul(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 cl(e,t){var n=tn(e),o=n==="transform"?Ya:Ti;return this.attrTween(e,typeof t=="function"?(n.local?ul:ll)(n,o,Kn(this,"attr."+e,t)):t==null?(n.local?rl:il)(n):(n.local?al:sl)(n,o,t))}function dl(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function fl(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)&&fl(e,r)),n}return i._value=t,i}function gl(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&dl(e,r)),n}return i._value=t,i}function vl(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=tn(e);return this.tween(n,(o.local?hl:gl)(o,t))}function pl(e,t){return function(){Wn(this,e).delay=+t.apply(this,arguments)}}function ml(e,t){return t=+t,function(){Wn(this,e).delay=t}}function yl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pl:ml)(t,e)):Ie(this.node(),t).delay}function _l(e,t){return function(){$e(this,e).duration=+t.apply(this,arguments)}}function wl(e,t){return t=+t,function(){$e(this,e).duration=t}}function xl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_l:wl)(t,e)):Ie(this.node(),t).duration}function bl(e,t){if(typeof t!="function")throw new Error;return function(){$e(this,e).ease=t}}function El(e){var t=this._id;return arguments.length?this.each(bl(t,e)):Ie(this.node(),t).ease}function Sl(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;$e(this,e).ease=n}}function Nl(e){if(typeof e!="function")throw new Error;return this.each(Sl(this._id,e))}function Ml(e){typeof e!="function"&&(e=ai(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 He(o,this._parents,this._name,this._id)}function Cl(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,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,f=s[a]=new Array(c),h,m=0;m<c;++m)(h=l[m]||u[m])&&(f[m]=h);for(;a<o;++a)s[a]=t[a];return new He(s,this._parents,this._name,this._id)}function Il(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 Tl(e,t,n){var o,i,r=Il(t)?Wn:$e;return function(){var s=r(this,e),a=s.on;a!==o&&(i=(o=a).copy()).on(t,n),s.on=i}}function kl(e,t){var n=this._id;return arguments.length<2?Ie(this.node(),n).on.on(e):this.each(Tl(n,e,t))}function Pl(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $l(){return this.on("end.remove",Pl(this._id))}function Dl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Gn(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,f,h=0;h<l;++h)(c=a[h])&&(f=e.call(c,c.__data__,h,a))&&("__data__"in c&&(f.__data__=c.__data__),u[h]=f,on(u[h],t,n,h,u,Ie(c,n)));return new He(r,this._parents,t,n)}function Al(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,f=0;f<u;++f)if(c=l[f]){for(var h=e.call(c,c.__data__,f,l),m,b=Ie(c,n),_=0,x=h.length;_<x;++_)(m=h[_])&&on(m,t,n,_,h,b);r.push(h),s.push(c)}return new He(r,s,t,n)}var Ol=Tt.prototype.constructor;function zl(){return new Ol(this._groups,this._parents)}function Bl(e,t){var n,o,i;return function(){var r=ft(this,e),s=(this.style.removeProperty(e),ft(this,e));return r===s?null:r===n&&s===o?i:i=t(n=r,o=s)}}function ki(e){return function(){this.style.removeProperty(e)}}function Rl(e,t,n){var o,i=n+"",r;return function(){var s=ft(this,e);return s===i?null:s===o?r:r=t(o=s,n)}}function Vl(e,t,n){var o,i,r;return function(){var s=ft(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),ft(this,e))),s===l?null:s===o&&l===i?r:(i=l,r=t(o=s,a))}}function Hl(e,t){var n,o,i,r="style."+t,s="end."+r,a;return function(){var l=$e(this,e),u=l.on,c=l.value[r]==null?a||(a=ki(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(s,i=c),l.on=o}}function Ll(e,t,n){var o=(e+="")=="transform"?La:Ti;return t==null?this.styleTween(e,Bl(e,o)).on("end.style."+e,ki(e)):typeof t=="function"?this.styleTween(e,Vl(e,o,Kn(this,"style."+e,t))).each(Hl(this._id,e)):this.styleTween(e,Rl(e,o,t),n).on("end.style."+e,null)}function Yl(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Fl(e,t,n){var o,i;function r(){var s=t.apply(this,arguments);return s!==i&&(o=(i=s)&&Yl(e,s,n)),o}return r._value=t,r}function Gl(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,Fl(e,t,n??""))}function Xl(e){return function(){this.textContent=e}}function Ul(e){return function(){var t=e(this);this.textContent=t??""}}function Zl(e){return this.tween("text",typeof e=="function"?Ul(Kn(this,"text",e)):Xl(e==null?"":e+""))}function Wl(e){return function(t){this.textContent=e.call(this,t)}}function Kl(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Wl(i)),t}return o._value=e,o}function ql(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Kl(e))}function Jl(){for(var e=this._name,t=this._id,n=Pi(),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=Ie(l,t);on(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new He(o,this._parents,e,n)}function Ql(){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=$e(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 jl=0;function He(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Pi(){return++jl}var De=Tt.prototype;He.prototype={constructor:He,select:Dl,selectAll:Al,selectChild:De.selectChild,selectChildren:De.selectChildren,filter:Ml,merge:Cl,selection:zl,transition:Jl,call:De.call,nodes:De.nodes,node:De.node,size:De.size,empty:De.empty,each:De.each,on:kl,attr:cl,attrTween:vl,style:Ll,styleTween:Gl,text:Zl,textTween:ql,remove:$l,tween:ol,delay:yl,duration:xl,ease:El,easeVarying:Nl,end:Ql,[Symbol.iterator]:De[Symbol.iterator]};function eu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var tu={time:null,delay:0,duration:250,ease:eu};function nu(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 ou(e){var t,n;e instanceof He?(t=e._id,e=e._name):(t=Pi(),(n=tu).time=Zn(),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])&&on(l,e,t,u,s,n||nu(l,t));return new He(o,this._parents,e,t)}Tt.prototype.interrupt=el;Tt.prototype.transition=ou;const Ot=e=>()=>e;function iu(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 Be(e,t,n){this.k=e,this.x=t,this.y=n}Be.prototype={constructor:Be,scale:function(e){return e===1?this:new Be(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Be(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var gt=new Be(1,0,0);Be.prototype;function pn(e){e.stopImmediatePropagation()}function mt(e){e.preventDefault(),e.stopImmediatePropagation()}function ru(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function su(){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 Eo(){return this.__zoom||gt}function au(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lu(){return navigator.maxTouchPoints||"ontouchstart"in this}function uu(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 cu(){var e=ru,t=su,n=uu,o=au,i=lu,r=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Ua,u=en("start","zoom","end"),c,f,h,m=500,b=150,_=0,x=10;function S(p){p.property("__zoom",Eo).on("wheel.zoom",G,{passive:!1}).on("mousedown.zoom",X).on("dblclick.zoom",$).filter(i).on("touchstart.zoom",w).on("touchmove.zoom",J).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(p,k,E,T){var z=p.selection?p.selection():p;z.property("__zoom",Eo),p!==z?O(p,k,E,T):z.interrupt().each(function(){H(this,arguments).event(T).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},S.scaleBy=function(p,k,E,T){S.scaleTo(p,function(){var z=this.__zoom.k,M=typeof k=="function"?k.apply(this,arguments):k;return z*M},E,T)},S.scaleTo=function(p,k,E,T){S.transform(p,function(){var z=t.apply(this,arguments),M=this.__zoom,P=E==null?N(z):typeof E=="function"?E.apply(this,arguments):E,V=M.invert(P),W=typeof k=="function"?k.apply(this,arguments):k;return n(I(g(M,W),P,V),z,s)},E,T)},S.translateBy=function(p,k,E,T){S.transform(p,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,T)},S.translateTo=function(p,k,E,T,z){S.transform(p,function(){var M=t.apply(this,arguments),P=this.__zoom,V=T==null?N(M):typeof T=="function"?T.apply(this,arguments):T;return n(gt.translate(V[0],V[1]).scale(P.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof E=="function"?-E.apply(this,arguments):-E),M,s)},T,z)};function g(p,k){return k=Math.max(r[0],Math.min(r[1],k)),k===p.k?p:new Be(k,p.x,p.y)}function I(p,k,E){var T=k[0]-E[0]*p.k,z=k[1]-E[1]*p.k;return T===p.x&&z===p.y?p:new Be(p.k,T,z)}function N(p){return[(+p[0][0]+ +p[1][0])/2,(+p[0][1]+ +p[1][1])/2]}function O(p,k,E,T){p.on("start.zoom",function(){H(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){H(this,arguments).event(T).end()}).tween("zoom",function(){var z=this,M=arguments,P=H(z,M).event(T),V=t.apply(z,M),W=E==null?N(V):typeof E=="function"?E.apply(z,M):E,le=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),te=z.__zoom,ie=typeof k=="function"?k.apply(z,M):k,ve=l(te.invert(W).concat(le/te.k),ie.invert(W).concat(le/ie.k));return function(ue){if(ue===1)ue=ie;else{var K=ve(ue),U=le/K[2];ue=new Be(U,W[0]-K[0]*U,W[1]-K[1]*U)}P.zoom(null,ue)}})}function H(p,k,E){return!E&&p.__zooming||new A(p,k)}function A(p,k){this.that=p,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(p,k),this.taps=0}A.prototype={event:function(p){return p&&(this.sourceEvent=p),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(p,k){return this.mouse&&p!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&p!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&p!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(p){var k=Me(this.that).datum();u.call(p,this.that,new iu(p,{sourceEvent:this.sourceEvent,target:S,type:p,transform:this.that.__zoom,dispatch:u}),k)}};function G(p,...k){if(!e.apply(this,arguments))return;var E=H(this,k).event(p),T=this.__zoom,z=Math.max(r[0],Math.min(r[1],T.k*Math.pow(2,o.apply(this,arguments)))),M=Te(p);if(E.wheel)(E.mouse[0][0]!==M[0]||E.mouse[0][1]!==M[1])&&(E.mouse[1]=T.invert(E.mouse[0]=M)),clearTimeout(E.wheel);else{if(T.k===z)return;E.mouse=[M,T.invert(M)],Ft(this),E.start()}mt(p),E.wheel=setTimeout(P,b),E.zoom("mouse",n(I(g(T,z),E.mouse[0],E.mouse[1]),E.extent,s));function P(){E.wheel=null,E.end()}}function X(p,...k){if(h||!e.apply(this,arguments))return;var E=p.currentTarget,T=H(this,k,!0).event(p),z=Me(p.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",le,!0),M=Te(p,E),P=p.clientX,V=p.clientY;mi(p.view),pn(p),T.mouse=[M,this.__zoom.invert(M)],Ft(this),T.start();function W(te){if(mt(te),!T.moved){var ie=te.clientX-P,ve=te.clientY-V;T.moved=ie*ie+ve*ve>_}T.event(te).zoom("mouse",n(I(T.that.__zoom,T.mouse[0]=Te(te,E),T.mouse[1]),T.extent,s))}function le(te){z.on("mousemove.zoom mouseup.zoom",null),yi(te.view,T.moved),mt(te),T.event(te).end()}}function $(p,...k){if(e.apply(this,arguments)){var E=this.__zoom,T=Te(p.changedTouches?p.changedTouches[0]:p,this),z=E.invert(T),M=E.k*(p.shiftKey?.5:2),P=n(I(g(E,M),T,z),t.apply(this,k),s);mt(p),a>0?Me(this).transition().duration(a).call(O,P,T,p):Me(this).call(S.transform,P,T,p)}}function w(p,...k){if(e.apply(this,arguments)){var E=p.touches,T=E.length,z=H(this,k,p.changedTouches.length===T).event(p),M,P,V,W;for(pn(p),P=0;P<T;++P)V=E[P],W=Te(V,this),W=[W,this.__zoom.invert(W),V.identifier],z.touch0?!z.touch1&&z.touch0[2]!==W[2]&&(z.touch1=W,z.taps=0):(z.touch0=W,M=!0,z.taps=1+!!c);c&&(c=clearTimeout(c)),M&&(z.taps<2&&(f=W[0],c=setTimeout(function(){c=null},m)),Ft(this),z.start())}}function J(p,...k){if(this.__zooming){var E=H(this,k).event(p),T=p.changedTouches,z=T.length,M,P,V,W;for(mt(p),M=0;M<z;++M)P=T[M],V=Te(P,this),E.touch0&&E.touch0[2]===P.identifier?E.touch0[0]=V:E.touch1&&E.touch1[2]===P.identifier&&(E.touch1[0]=V);if(P=E.that.__zoom,E.touch1){var le=E.touch0[0],te=E.touch0[1],ie=E.touch1[0],ve=E.touch1[1],ue=(ue=ie[0]-le[0])*ue+(ue=ie[1]-le[1])*ue,K=(K=ve[0]-te[0])*K+(K=ve[1]-te[1])*K;P=g(P,Math.sqrt(ue/K)),V=[(le[0]+ie[0])/2,(le[1]+ie[1])/2],W=[(te[0]+ve[0])/2,(te[1]+ve[1])/2]}else if(E.touch0)V=E.touch0[0],W=E.touch0[1];else return;E.zoom("touch",n(I(P,V,W),E.extent,s))}}function R(p,...k){if(this.__zooming){var E=H(this,k).event(p),T=p.changedTouches,z=T.length,M,P;for(pn(p),h&&clearTimeout(h),h=setTimeout(function(){h=null},m),M=0;M<z;++M)P=T[M],E.touch0&&E.touch0[2]===P.identifier?delete E.touch0:E.touch1&&E.touch1[2]===P.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(P=Te(P,this),Math.hypot(f[0]-P[0],f[1]-P[1])<x)){var V=Me(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return S.wheelDelta=function(p){return arguments.length?(o=typeof p=="function"?p:Ot(+p),S):o},S.filter=function(p){return arguments.length?(e=typeof p=="function"?p:Ot(!!p),S):e},S.touchable=function(p){return arguments.length?(i=typeof p=="function"?p:Ot(!!p),S):i},S.extent=function(p){return arguments.length?(t=typeof p=="function"?p:Ot([[+p[0][0],+p[0][1]],[+p[1][0],+p[1][1]]]),S):t},S.scaleExtent=function(p){return arguments.length?(r[0]=+p[0],r[1]=+p[1],S):[r[0],r[1]]},S.translateExtent=function(p){return arguments.length?(s[0][0]=+p[0][0],s[1][0]=+p[1][0],s[0][1]=+p[0][1],s[1][1]=+p[1][1],S):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},S.constrain=function(p){return arguments.length?(n=p,S):n},S.duration=function(p){return arguments.length?(a=+p,S):a},S.interpolate=function(p){return arguments.length?(l=p,S):l},S.on=function(){var p=u.on.apply(u,arguments);return p===u?S:p},S.clickDistance=function(p){return arguments.length?(_=(p=+p)*p,S):Math.sqrt(_)},S.tapDistance=function(p){return arguments.length?(x=+p,S):x},S}var Z=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(Z||{}),qn=(e=>(e.Partial="partial",e.Full="full",e))(qn||{}),Ge=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(Ge||{}),et=(e=>(e.Strict="strict",e.Loose="loose",e))(et||{}),An=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(An||{}),wt=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(wt||{});function Jn(){return typeof window<"u"?window:{chrome:!1,addEventListener(...e){}}}function On(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["INPUT","SELECT","TEXTAREA"].includes(o==null?void 0:o.nodeName)||i||!!r}function du(e){return e.ctrlKey||e.metaKey||e.shiftKey}function So(e,t,n,o){const i=t.split("+").map(r=>r.trim().toLowerCase());return i.length===1?e.toLowerCase()===t.toLowerCase():(o?n.delete(e.toLowerCase()):n.add(e.toLowerCase()),i.every((r,s)=>n.has(r)&&Array.from(n.values())[s]===i[s]))}function fu(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=hu(n.code,e);return Array.isArray(e)?e.some(i=>So(n[o],i,t,n.type==="keyup")):So(n[o],e,t,n.type==="keyup")}}function hu(e,t){return typeof t=="string"?e===t?"code":"key":t.includes(e)?"code":"key"}function xt(e,t,n={actInsideInputWithModifier:!0}){const o=Jn(),i=de(se(e)===!0);let r=!1;const s=new Set;let a=u(se(e));return ge(i,(c,f)=>{c!==f&&(t==null||t(c))}),ge(()=>se(e),(c,f)=>{typeof f=="boolean"&&typeof c!="boolean"&&l(),a=u(c)},{immediate:!0}),ii(o,"blur",()=>{se(e)!==!0&&(i.value=!1)}),io((...c)=>a(...c),c=>{r=du(c),!((!r||r&&!n.actInsideInputWithModifier)&&On(c))&&(c.preventDefault(),i.value=!0)},{eventName:"keydown"}),io((...c)=>a(...c),c=>{if(i.value){if((!r||r&&!n.actInsideInputWithModifier)&&On(c))return;l()}},{eventName:"keyup"}),i;function l(){r=!1,s.clear(),i.value=!1}function u(c){return c===null?(l(),()=>!1):typeof c=="boolean"?(l(),i.value=c,()=>!1):Array.isArray(c)||typeof c=="string"?fu(c,s):c}}const $i="vue-flow__node-desc",Di="vue-flow__edge-desc",gu="vue-flow__aria-live",Ai=["Enter"," ","Escape"],lt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function Oi(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodes:r,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,nodesDraggable:c,panBy:f,findNode:h,multiSelectionActive:m,nodesSelectionActive:b,selectNodesOnDrag:_,removeSelectedElements:x,addSelectedNodes:S,updateNodePositions:g,emits:I}=_e(),{onStart:N,onDrag:O,onStop:H,el:A,disabled:G,id:X,selectable:$,dragHandle:w}=e,J=de(!1);let R=[],p,k=null,E={x:void 0,y:void 0},T={x:0,y:0},z=null,M=!1,P=0,V=!1;const W=_u(),le=({x:U,y:q})=>{E={x:U,y:q};let Q=!1;if(R=R.map(re=>{const L={x:U-re.distance.x,y:q-re.distance.y};n.value&&(L.x=o.value[0]*Math.round(L.x/o.value[0]),L.y=o.value[1]*Math.round(L.y/o.value[1]));const{computedPosition:d}=jn(re,L,I.error,s.value,re.parentNode?h(re.parentNode):void 0);return Q=Q||re.position.x!==d.x||re.position.y!==d.y,re.position=d,re}),!!Q&&(g(R,!0,!0),J.value=!0,z)){const[re,L]=xn({id:X,dragItems:R,findNode:h});O({event:z,node:re,nodes:L})}},te=()=>{if(!k)return;const[U,q]=qi(T,k);if(U!==0||q!==0){const Q={x:(E.x??0)-U/l.value.zoom,y:(E.y??0)-q/l.value.zoom};f({x:U,y:q})&&le(Q)}P=requestAnimationFrame(te)},ie=(U,q)=>{M=!0;const Q=h(X);!_.value&&!m.value&&Q&&(Q.selected||x()),Q&&se($)&&_.value&&Vn(Q,m.value,S,x,b,!1,q);const re=W(U);if(E=re,R=Au(r.value,c.value,re,h,X),R.length){const[L,d]=xn({id:X,dragItems:R,findNode:h});N({event:U.sourceEvent,node:L,nodes:d})}},ve=(U,q)=>{var Q;U.sourceEvent.type==="touchmove"&&U.sourceEvent.touches.length>1||(a.value===0&&ie(U,q),E=W(U),k=((Q=t.value)==null?void 0:Q.getBoundingClientRect())||null,T=Ke(U.sourceEvent,k))},ue=(U,q)=>{const Q=W(U);if(!V&&M&&u.value&&(V=!0,te()),!M){const re=Q.xSnapped-(E.x??0),L=Q.ySnapped-(E.y??0);Math.sqrt(re*re+L*L)>a.value&&ie(U,q)}(E.x!==Q.xSnapped||E.y!==Q.ySnapped)&&R.length&&M&&(z=U.sourceEvent,T=Ke(U.sourceEvent,k),le(Q))},K=U=>{if(M&&(J.value=!1,V=!1,M=!1,cancelAnimationFrame(P),R.length)){g(R,!1,!1);const[q,Q]=xn({id:X,dragItems:R,findNode:h});H({event:U.sourceEvent,node:q,nodes:Q})}};return ge([()=>se(G),A],([U,q],Q,re)=>{if(q){const L=Me(q);U||(p=wa().on("start",d=>ve(d,q)).on("drag",d=>ue(d,q)).on("end",d=>K(d)).filter(d=>{const v=d.target,y=se(w);return!d.button&&(!i.value||!Ao(v,`.${i.value}`,q)&&(!y||Ao(v,y,q)))}),L.call(p)),re(()=>{L.on(".drag",null),p&&(p.on("start",null),p.on("drag",null),p.on("end",null))})}}),J}const No=Symbol("vueFlow"),zi=Symbol("nodeId"),Bi=Symbol("nodeRef"),vu=Symbol("edgeId"),pu=Symbol("edgeRef"),rn=Symbol("slots");function mu(){return{doubleClick:B(),click:B(),mouseEnter:B(),mouseMove:B(),mouseLeave:B(),contextMenu:B(),updateStart:B(),update:B(),updateEnd:B()}}function yu(e,t){const n=mu();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 _u(){const{viewport:e,snapGrid:t,snapToGrid:n}=_e();return({sourceEvent:o})=>{const i=o.touches?o.touches[0].clientX:o.clientX,r=o.touches?o.touches[0].clientY:o.clientY,s={x:(i-e.value.x)/e.value.zoom,y:(r-e.value.y)/e.value.zoom};return{xSnapped:n.value?t.value[0]*Math.round(s.x/t.value[0]):s.x,ySnapped:n.value?t.value[1]*Math.round(s.y/t.value[1]):s.y,...s}}}function zt(){return!0}function Ri({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:s}){const{vueFlowRef:a,connectionMode:l,connectionRadius:u,connectOnClick:c,connectionClickStartHandle:f,nodesConnectable:h,autoPanOnConnect:m,findNode:b,panBy:_,startConnection:x,updateConnection:S,endConnection:g,emits:I,viewport:N,edges:O,nodes:H,isValidConnection:A}=_e();let G=null,X=!1,$=null;function w(R){var p;const k=se(n)==="target",E=eo(R),T=Co(R.target);if(E&&R.button===0||!E){let z=function(d){q=Ke(d,K);const{handle:v,validHandleResult:y}=Lu(d,T,Bn(q,N.value,!1,[1,1]),u.value,re,C=>Ro(d,C,l.value,se(t),se(e),k?"target":"source",V,T,O.value,H.value,b));if(W=v,Q||(L(),Q=!0),G=y.connection,X=y.isValid,$=y.handleDomNode,S(W&&X?Xi({x:W.x,y:W.y},N.value):q,y.endHandle,Fu(!!W,X)),!W&&!X&&!$)return bn(U);G&&G.source!==G.target&&$&&(bn(U),U=$,$.classList.add("connecting","vue-flow__handle-connecting"),$.classList.toggle("valid",X),$.classList.toggle("vue-flow__handle-valid",X))},M=function(d){(W||$)&&G&&X&&(r?r(d,G):I.connect(G)),I.connectEnd(d),i&&(s==null||s(d)),bn(U),cancelAnimationFrame(le),g(d),Q=!1,X=!1,G=null,$=null,T.removeEventListener("mousemove",z),T.removeEventListener("mouseup",M),T.removeEventListener("touchmove",z),T.removeEventListener("touchend",M)};const P=b(se(t));let V=se(o)||A.value||zt;!V&&P&&(V=(k?P.isValidSourcePos:P.isValidTargetPos)||zt);let W,le=0;const{x:te,y:ie}=Ke(R),ve=T==null?void 0:T.elementFromPoint(te,ie),ue=to(se(i),ve),K=(p=a.value)==null?void 0:p.getBoundingClientRect();if(!K||!ue)return;let U,q=Ke(R,K),Q=!1;const re=Yu({nodes:H.value,nodeId:se(t),handleId:se(e),handleType:ue}),L=()=>{if(!m.value)return;const[d,v]=qi(q,K);_({x:d,y:v}),le=requestAnimationFrame(L)};x({nodeId:se(t),handleId:se(e),type:ue},{x:te-K.left,y:ie-K.top}),I.connectStart({event:R,nodeId:se(t),handleId:se(e),handleType:ue}),T.addEventListener("mousemove",z),T.addEventListener("mouseup",M),T.addEventListener("touchmove",z),T.addEventListener("touchend",M)}}function J(R){if(!c.value)return;const p=se(n)==="target";if(!f.value)I.clickConnectStart({event:R,nodeId:se(t),handleId:se(e)}),x({nodeId:se(t),type:se(n),handleId:se(e)},void 0,!0);else{let k=se(o)||A.value||zt;const E=b(se(t));if(!k&&E&&(k=(p?E.isValidSourcePos:E.isValidTargetPos)||zt),E&&(typeof E.connectable>"u"?h.value:E.connectable)===!1)return;const T=Co(R.target),{connection:z,isValid:M}=Ro(R,{nodeId:se(t),id:se(e),type:se(n)},l.value,f.value.nodeId,f.value.handleId||null,f.value.type,k,T,O.value,H.value,b),P=z.source===z.target;M&&!P&&I.connect(z),I.clickConnectEnd(R),g(R,!0)}}return{handlePointerDown:w,handleClick:J}}function wu(){return vt(zi,"")}function Vi(e){const t=e??wu()??"",n=vt(Bi,de(null)),{findNode:o,edges:i,emits:r}=_e(),s=o(t);return s||r.error(new Ee(be.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:ne(()=>o(s.parentNode)),connectedEdges:ne(()=>Qn([s],i.value))}}function xu(){return{doubleClick:B(),click:B(),mouseEnter:B(),mouseMove:B(),mouseLeave:B(),contextMenu:B(),dragStart:B(),drag:B(),dragStop:B()}}function bu(e,t){const n=xu();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 Hi(){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,f=r.value?i.value[1]:5,h=u?4:1,m=l.x*c*h,b=l.y*f*h,_=[];for(const x of e.value)if(x.draggable||s&&typeof x.draggable>"u"){const S={x:x.computedPosition.x+m,y:x.computedPosition.y+b},{computedPosition:g}=jn(x,S,a.error,t.value,x.parentNode?o(x.parentNode):void 0);_.push({id:x.id,position:g,from:x.position,distance:{x:l.x,y:l.y},dimensions:x.dimensions})}n(_,!0,!1)}}const mn=.1;function Le(){return an("Viewport not initialized yet."),Promise.resolve(!1)}const Eu={zoomIn:Le,zoomOut:Le,zoomTo:Le,fitView:Le,setCenter:Le,fitBounds:Le,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:Le,setTransform:Le,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function Su(e){function t(o,i){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleBy(yn(e.d3Selection,i,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,s){return new Promise(a=>{const{x:l,y:u}=Li({x:-o,y:-i},e.translateExtent),c=gt.translate(-l,-u).scale(r);e.d3Selection&&e.d3Zoom?e.d3Zoom.transform(yn(e.d3Selection,s,()=>{a(!0)}),c):a(!1)})}return ne(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:i=>t(1.2,i==null?void 0:i.duration),zoomOut:i=>t(1/1.2,i==null?void 0:i.duration),zoomTo:(i,r)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.scaleTo(yn(e.d3Selection,r==null?void 0:r.duration,()=>{s(!0)}),i):s(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r==null?void 0:r.duration),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r==null?void 0:r.duration),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:mn,includeHiddenNodes:!1,duration:0})=>{var r,s;const a=[];for(const h of e.nodes)h.dimensions.width&&h.dimensions.height&&((i==null?void 0:i.includeHiddenNodes)||!h.hidden)&&(!((r=i.nodes)!=null&&r.length)||(s=i.nodes)!=null&&s.length&&i.nodes.includes(h.id))&&a.push(h);if(!a.length)return Promise.resolve(!1);const l=Zi(a),{x:u,y:c,zoom:f}=Io(l,e.dimensions.width,e.dimensions.height,i.minZoom??e.minZoom,i.maxZoom??e.maxZoom,i.padding??mn,i.offset);return n(u,c,f,i==null?void 0:i.duration)},setCenter:(i,r,s)=>{const a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:e.maxZoom,l=e.dimensions.width/2-i*a,u=e.dimensions.height/2-r*a;return n(l,u,a,s==null?void 0:s.duration)},fitBounds:(i,r={padding:mn})=>{const{x:s,y:a,zoom:l}=Io(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding);return n(s,a,l,r==null?void 0:r.duration)},project:i=>Bn(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 Bn(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 Xi(a,e.viewport)}return{x:0,y:0}}}:Eu)}function yn(e,t=0,n){return e.transition().duration(t).on("end",n)}function Nu(e,t,n){const o=qo(!0);return o.run(()=>{const i=()=>{o.run(()=>{let _,x,S=!!(n.nodes.value.length||n.edges.value.length);_=ot([e.modelValue,()=>{var g,I;return(I=(g=e.modelValue)==null?void 0:g.value)==null?void 0:I.length}],([g])=>{g&&Array.isArray(g)&&(x==null||x.pause(),n.setElements(g),!x&&!S&&g.length?S=!0:x==null||x.resume())}),x=ot([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([g,I])=>{var N;(N=e.modelValue)!=null&&N.value&&Array.isArray(e.modelValue.value)&&(_==null||_.pause(),e.modelValue.value=[...g,...I],Re(()=>{_==null||_.resume()}))},{immediate:S}),Vt(()=>{_==null||_.stop(),x==null||x.stop()})})},r=()=>{o.run(()=>{let _,x,S=!!n.nodes.value.length;_=ot([e.nodes,()=>{var g,I;return(I=(g=e.nodes)==null?void 0:g.value)==null?void 0:I.length}],([g])=>{g&&Array.isArray(g)&&(x==null||x.pause(),n.setNodes(g),!x&&!S&&g.length?S=!0:x==null||x.resume())}),x=ot([n.nodes,()=>n.nodes.value.length],([g])=>{var I;(I=e.nodes)!=null&&I.value&&Array.isArray(e.nodes.value)&&(_==null||_.pause(),e.nodes.value=[...g],Re(()=>{_==null||_.resume()}))},{immediate:S}),Vt(()=>{_==null||_.stop(),x==null||x.stop()})})},s=()=>{o.run(()=>{let _,x,S=!!n.edges.value.length;_=ot([e.edges,()=>{var g,I;return(I=(g=e.edges)==null?void 0:g.value)==null?void 0:I.length}],([g])=>{g&&Array.isArray(g)&&(x==null||x.pause(),n.setEdges(g),!x&&!S&&g.length?S=!0:x==null||x.resume())}),x=ot([n.edges,()=>n.edges.value.length],([g])=>{var I;(I=e.edges)!=null&&I.value&&Array.isArray(e.edges.value)&&(_==null||_.pause(),e.edges.value=[...g],Re(()=>{_==null||_.resume()}))},{immediate:S}),Vt(()=>{_==null||_.stop(),x==null||x.stop()})})},a=()=>{o.run(()=>{ge(()=>t.maxZoom,()=>{t.maxZoom&&we(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{ge(()=>t.minZoom,()=>{t.minZoom&&we(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{ge(()=>t.translateExtent,()=>{t.translateExtent&&we(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{ge(()=>t.nodeExtent,()=>{t.nodeExtent&&we(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},f=()=>{o.run(()=>{ge(()=>t.applyDefault,()=>{we(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const _=async x=>{let S=x;typeof t.autoConnect=="function"&&(S=await t.autoConnect(x)),S!==!1&&n.addEdges([S])};ge(()=>t.autoConnect,()=>{we(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),ge(n.autoConnect,(x,S,g)=>{x?n.onConnect(_):n.hooks.value.connect.off(_),g(()=>{n.hooks.value.connect.off(_)})},{immediate:!0})})},m=()=>{const _=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const x of Object.keys(t)){const S=x;if(!_.includes(S)){const g=xe(()=>t[S]),I=n[S];Yn(I)&&o.run(()=>{ge(g,N=>{we(N)&&(I.value=N)},{immediate:!0})})}}};(()=>{i(),r(),s(),l(),a(),u(),c(),f(),h(),m()})()}),()=>o.stop()}function Mo(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function zn(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 sn(e){return{width:e.offsetWidth,height:e.offsetHeight}}function tt(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Li(e,t){return{x:tt(e.x,t[0][0],t[1][0]),y:tt(e.y,t[0][1],t[1][1])}}function Co(e){const t=e.getRootNode();return"elementFromPoint"in t?t:Jn().document}function Fe(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function We(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Fe(e)}function it(e){return We(e)&&"computedPosition"in e}function Bt(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Mu(e){return Bt(e.width)&&Bt(e.height)&&Bt(e.x)&&Bt(e.y)}function Cu(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:rt({width:0,height:0}),computedPosition:rt({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:we(e.data)?e.data:{},events:rt(we(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function Yi(e,t,n){var o,i;const r={id:e.id.toString(),type:e.type??(t==null?void 0:t.type)??"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:e.updatable??(n==null?void 0:n.updatable),selectable:e.selectable??(n==null?void 0:n.selectable),focusable:e.focusable??(n==null?void 0:n.focusable),data:we(e.data)?e.data:{},events:rt(we(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(n==null?void 0:n.interactionWidth),...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function Fi(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 Iu(...e){if(e.length===3){const[r,s,a]=e;return Fi(r,s,a,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>Fe(r)&&r.source===o).map(r=>n.find(s=>We(s)&&s.id===r.target))}function Tu(...e){if(e.length===3){const[r,s,a]=e;return Fi(r,s,a,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>Fe(r)&&r.target===o).map(r=>n.find(s=>We(s)&&s.id===r.source))}function Gi({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function ku(e,t){return t.some(n=>Fe(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 Xi({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function Bn({x:e,y:t},{x:n,y:o,zoom:i},r,[s,a]){const l={x:(e-n)/i,y:(t-o)/i};return r?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l}function Pu(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 Ui({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function $u({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function Zi(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=Pu(t,Ui({...o.computedPosition,...o.dimensions}))}return $u(t)}function Wi(e,t,{x:n,y:o,zoom:i}={x:0,y:0,zoom:1},r=!1,s=!1){const a={x:(t.x-n)/i,y:(t.y-o)/i,width:t.width/i,height:t.height/i};return e.filter(l=>{const{computedPosition:u={x:0,y:0},dimensions:c={width:0,height:0},selectable:f}=l;if(s&&!f)return!1;const h={...u,width:c.width||0,height:c.height||0},m=zn(a,h),b=typeof c.width>"u"||typeof c.height>"u"||c.width===0||c.height===0,_=r&&m>0,x=c.width*c.height;return b||_||m>=x})}function Qn(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 Io(e,t,n,o,i,r=.1,s={x:0,y:0}){const a=t/(e.width*(1+r)),l=n/(e.height*(1+r)),u=Math.min(a,l),c=tt(u,o,i),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*c+(s.x??0),b=n/2-h*c+(s.y??0);return{x:m,y:b,zoom:c}}function Du(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function Ki(e,t){if(!e.parentNode)return!1;const n=t(e.parentNode);return n?n.selected?!0:Ki(n,t):!1}function Ct(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function To(e,t,n){return e<t?tt(Math.abs(e-t),1,50)/50:e>n?-tt(Math.abs(e-n),1,50)/50:0}function qi(e,t){const n=To(e.x,35,t.width-35)*20,o=To(e.y,35,t.height-35)*20;return[n,o]}function _n(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,o=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||o>0||e.position.x<0||e.position.y<0){let i={};if(typeof t.style=="function"?i={...t.style(t)}:t.style&&(i={...t.style}),i.width=i.width??`${t.dimensions.width}px`,i.height=i.height??`${t.dimensions.height}px`,n>0)if(typeof i.width=="string"){const r=Number(i.width.replace("px",""));i.width=`${r+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const r=Number(i.height.replace("px",""));i.height=`${r+o}px`}else i.height+=o;if(e.position.x<0){const r=Math.abs(e.position.x);if(t.position.x=t.position.x-r,typeof i.width=="string"){const s=Number(i.width.replace("px",""));i.width=`${s+r}px`}else i.width+=r;e.position.x=0}if(e.position.y<0){const r=Math.abs(e.position.y);if(t.position.y=t.position.y-r,typeof i.height=="string"){const s=Number(i.height.replace("px",""));i.height=`${s+r}px`}else i.height+=r;e.position.y=0}t.dimensions.width=Number(i.width.toString().replace("px","")),t.dimensions.height=Number(i.height.toString().replace("px","")),typeof t.style=="function"?t.style=r=>{const s=t.style;return{...s(r),...i}}:t.style={...t.style,...i}}}}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(it(s)&&(typeof a.position<"u"&&(s.position=a.position),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&it(l)&&_n(s,l)}break;case"dimensions":if(it(s)&&(typeof a.dimensions<"u"&&(s.dimensions=a.dimensions),typeof a.updateStyle<"u"&&(s.style={...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<"u"&&(s.resizing=a.resizing),s.expandParent&&s.parentNode)){const l=t[r.indexOf(s.parentNode)];l&&it(l)&&(!!l.dimensions.width&&!!l.dimensions.height?_n(s,l):Re(()=>{_n(s,l)}))}break}return t}function Ae(e,t){return{id:e,type:"select",selected:t}}function Po(e){return{item:e,type:"add"}}function $o(e){return{id:e,type:"remove"}}function Do(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function wn(e,t){return e.reduce((n,o)=>{let i=t.includes(o.id);we(o.selectable)&&!o.selectable&&(i=!1);const r=it(o)?"changedNodes":"changedEdges";return!o.selected&&i?n[r].push(Ae(o.id,!0)):o.selected&&!i&&n[r].push(Ae(o.id,!1)),n},{changedNodes:[],changedEdges:[]})}function B(e){const t=new Set;let n=!1;const o=()=>t.size>0;e&&(n=!0,t.add(e));const i=a=>{t.delete(a)};return{on:a=>{e&&n&&t.delete(e),t.add(a);const l=()=>{i(a),e&&n&&t.add(e)};return jt(l),{off:l}},off:i,trigger:a=>Promise.all(Array.from(t).map(l=>l(a))),hasListeners:o,fns:t}}function Ao(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 Au(e,t,n,o,i){var r,s;const a=[];for(const l of e)(l.selected||l.id===i)&&(!l.parentNode||!Ki(l,o))&&(l.draggable||t&&typeof l.draggable>"u")&&a.push(rt({id:l.id,position:l.position||{x:0,y:0},distance:{x:n.x-((r=l.computedPosition)==null?void 0:r.x)||0,y:n.y-((s=l.computedPosition)==null?void 0:s.y)||0},from:l.computedPosition,extent:l.extent,parentNode:l.parentNode,dimensions:l.dimensions,expandParent:l.expandParent}));return a}function xn({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 Ji(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 Ou(e,t,n){const[o,i,r,s]=typeof e!="string"?Ji(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+s,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function zu(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=Ou(i,e,o);r&&(i=r)}else t(new Ee(be.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]=Ji(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 Bu({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function jn(e,t,n,o,i){const r=Bu(e.dimensions,zu(e,n,o,i)),s=Li(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 Rn(e,t,n){const o=((n==null?void 0:n.x)??0)+t.x,i=((n==null?void 0:n.y)??0)+t.y,r=(n==null?void 0:n.width)??t.width,s=(n==null?void 0:n.height)??t.height;switch(e){case Z.Top:return{x:o+r/2,y:i};case Z.Right:return{x:o+r,y:i+s/2};case Z.Bottom:return{x:o+r/2,y:i+s};case Z.Left:return{x:o,y:i+s/2}}}function Oo(e=[],t){return e.length&&(t?e.find(n=>n.id===t):e[0])||null}function Ru(e,t,n,o,i,r){const s=Rn(n,{...e.dimensions,...e.computedPosition},t),a=Rn(r,{...o.dimensions,...o.computedPosition},i);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}}function Vu({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=Ui({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:s/l.zoom,height:a/l.zoom}),f=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(f*h)>0}function Hu(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 be=(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))(be||{});const zo={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 Ee extends Error{constructor(t,...n){var o;super((o=zo[t])==null?void 0:o.call(zo,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function eo(e){return"clientX"in e}function Ke(e,t){var n,o;const i=eo(e),r=i?e.clientX:(n=e.touches)==null?void 0:n[0].clientX,s=i?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}}const Jt=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Qi(){return{handleDomNode:null,isValid:!1,connection:{source:"",target:"",sourceHandle:null,targetHandle:null},endHandle:null}}function bn(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Bo(e,t,n,o){return(t[n]||[]).reduce((i,r)=>{var s,a;return`${e.id}-${r.id}-${n}`!==o&&i.push({id:r.id||null,type:n,nodeId:e.id,x:(((s=e.computedPosition)==null?void 0:s.x)??0)+r.x+r.width/2,y:(((a=e.computedPosition)==null?void 0:a.y)??0)+r.y+r.height/2,width:r.width,height:r.height}),i},[])}function Lu(e,t,n,o,i,r){const{x:s,y:a}=Ke(e),u=t.elementsFromPoint(s,a).find(b=>b.classList.contains("vue-flow__handle"));if(u){const b=u.getAttribute("data-nodeid");if(b){const _=to(void 0,u),x=u.getAttribute("data-handleid"),S=r({nodeId:b,id:x,type:_});if(S){const g=i.find(I=>I.nodeId===b&&I.type===_&&I.id===x);return{handle:{id:x,type:_,nodeId:b,x:(g==null?void 0:g.x)||n.x,y:(g==null?void 0:g.y)||n.y},validHandleResult:S}}}}let c=[],f=Number.POSITIVE_INFINITY;for(const b of i){const _=Math.sqrt((b.x-n.x)**2+(b.y-n.y)**2);if(_<=o){const x=r(b);_<=f&&(_<f?c=[{handle:b,validHandleResult:x}]:_===f&&c.push({handle:b,validHandleResult:x}),f=_)}}if(!c.length)return{handle:null,validHandleResult:Qi()};if(c.length===1)return c[0];const h=c.some(({validHandleResult:b})=>b.isValid),m=c.some(({handle:b})=>b.type==="target");return c.find(({handle:b,validHandleResult:_})=>m?b.type==="target":h?_.isValid:!0)||c[0]}function Ro(e,t,n,o,i,r,s,a,l,u,c){const f=r==="target",h=a.querySelector(`.vue-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),{x:m,y:b}=Ke(e),_=a.elementFromPoint(m,b),x=_!=null&&_.classList.contains("vue-flow__handle")?_:h,S=Qi();if(x){S.handleDomNode=x;const g=to(void 0,x),I=x.getAttribute("data-nodeid"),N=x.getAttribute("data-handleid"),O=x.classList.contains("connectable"),H=x.classList.contains("connectableend"),A={source:f?I:o,sourceHandle:f?N:i,target:f?o:I,targetHandle:f?i:N};S.connection=A;const X=O&&H&&(n===et.Strict?f&&g==="source"||!f&&g==="target":I!==o||N!==i);S.endHandle={nodeId:I,handleId:N,type:g},X&&(S.isValid=s(A,{edges:l,nodes:u,sourceNode:c(A.source),targetNode:c(A.target)}))}return S}function Yu({nodes:e,nodeId:t,handleId:n,handleType:o}){const i=[];for(let r=0;r<e.length;r++){const s=e[r],{handleBounds:a}=s;let l=[],u=[];a&&(l=Bo(s,a,"source",`${t}-${n}-${o}`),u=Bo(s,a,"target",`${t}-${n}-${o}`)),i.push(...l,...u)}return i}function to(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Fu(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}const Gu=["production","prod"];function an(e,...t){ji()&&console.warn(`[Vue Flow]: ${e}`,...t)}function ji(){return!Gu.includes("production")}function Vo(e,t,n,o){const i=t.querySelectorAll(`.vue-flow__handle${e}`);return Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...sn(s)}})}function Vn(e,t,n,o,i,r=!1,s){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),Re(()=>{s.blur()})):n([e])}function we(e){return typeof ee(e)<"u"}function Xu(e,t,n,o){if(!e||!e.source||!e.target)return n(new Ee(be.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let i;return Fe(e)?i=e:i={...e,id:Gi(e)},i=Yi(i,void 0,o),ku(i,t)?!1:i}function Uu(e,t,n,o,i,r){if(!t.source||!t.target)return r(new Ee(be.EDGE_INVALID,e.id)),!1;const s=o(e.id);if(!s)return r(new Ee(be.EDGE_NOT_FOUND,e.id)),!1;const{id:a,...l}=e,u={...l,id:i?Gi(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.splice(n.indexOf(s),1,u),u}function Ho(e,t,n){const o={},i=[];for(let r=0;r<e.length;++r){const s=e[r];if(!We(s)){n(new Ee(be.NODE_INVALID,s==null?void 0:s.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const a=Cu(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 Ee(be.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 Lo(e,t){e.clear();for(const n of t){const{id:o,source:i,target:r,sourceHandle:s=null,targetHandle:a=null}=n,l=`${i}-source-${s}`,u=`${r}-target-${a}`,c=e.get(l)||new Map,f=e.get(u)||new Map,h=rt({edgeId:o,source:i,target:r,sourceHandle:s,targetHandle:a});e.set(l,c.set(`${r}-${a}`,h)),e.set(u,f.set(`${i}-${s}`,h))}}function Yo(e,t,n,o,i,r,s,a){const l=[];for(const u of e){const c=Fe(u)?u:Xu(u,a,i,r);if(!c)continue;const f=n(c.source),h=n(c.target);if(!f||!h){i(new Ee(be.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!f){i(new Ee(be.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!h){i(new Ee(be.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:s,sourceNode:f,targetNode:h})){i(new Ee(be.EDGE_INVALID,c.id));continue}const m=o(c.id);l.push({...Yi(c,m,r),sourceNode:f,targetNode:h})}return l}function Zu(){return{edgesChange:B(),nodesChange:B(),nodeDoubleClick:B(),nodeClick:B(),nodeMouseEnter:B(),nodeMouseMove:B(),nodeMouseLeave:B(),nodeContextMenu:B(),nodeDragStart:B(),nodeDrag:B(),nodeDragStop:B(),nodesInitialized:B(),miniMapNodeClick:B(),miniMapNodeDoubleClick:B(),miniMapNodeMouseEnter:B(),miniMapNodeMouseMove:B(),miniMapNodeMouseLeave:B(),connect:B(),connectStart:B(),connectEnd:B(),clickConnectStart:B(),clickConnectEnd:B(),paneReady:B(),init:B(),move:B(),moveStart:B(),moveEnd:B(),selectionDragStart:B(),selectionDrag:B(),selectionDragStop:B(),selectionContextMenu:B(),selectionStart:B(),selectionEnd:B(),viewportChangeStart:B(),viewportChange:B(),viewportChangeEnd:B(),paneScroll:B(),paneClick:B(),paneContextMenu:B(),paneMouseEnter:B(),paneMouseMove:B(),paneMouseLeave:B(),edgeContextMenu:B(),edgeMouseEnter:B(),edgeMouseMove:B(),edgeMouseLeave:B(),edgeDoubleClick:B(),edgeClick:B(),edgeUpdateStart:B(),edgeUpdate:B(),edgeUpdateEnd:B(),updateNodeInternals:B(),error:B(e=>an(e.message))}}function Wu(e,t){vr(()=>{for(const[n,o]of Object.entries(t.value)){const i=r=>{e(n,r)};o.fns.add(i),jt(()=>{o.off(i)})}})}function er(){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:qn.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:wt.Free,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:Ge.Bezier,style:{}},connectionMode:et.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:Jt()?"Meta":"Control",zoomActivationKeyCode:Jt()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:Zu(),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,disableKeyboardA11y:!1,ariaLiveMessage:""}}const Ku=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function qu(e,t,n){const o=Su(e),i=d=>{const v=d??[];e.hooks.updateNodeInternals.trigger(v)},r=d=>Tu(d,e.nodes,e.edges),s=d=>Iu(d,e.nodes,e.edges),a=d=>Qn(d,e.edges),l=d=>{if(d)return t.value.get(d)},u=d=>{if(d)return n.value.get(d)},c=(d,v,y)=>{var C,D;const Y=[];for(const F of d){const j={id:F.id,type:"position",dragging:y,from:F.from};if(v&&(j.position=F.position,F.parentNode)){const oe=l(F.parentNode);j.position={x:j.position.x-(((C=oe==null?void 0:oe.computedPosition)==null?void 0:C.x)??0),y:j.position.y-(((D=oe==null?void 0:oe.computedPosition)==null?void 0:D.y)??0)}}Y.push(j)}Y!=null&&Y.length&&e.hooks.nodesChange.trigger(Y)},f=d=>{if(!e.vueFlowRef)return;const v=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!v)return;const y=window.getComputedStyle(v),{m22:C}=new window.DOMMatrixReadOnly(y.transform),D=[];for(let Y=0;Y<d.length;++Y){const F=d[Y],j=l(F.id);if(j){const oe=sn(F.nodeElement);if(!!(oe.width&&oe.height&&(j.dimensions.width!==oe.width||j.dimensions.height!==oe.height||F.forceUpdate))){const ce=F.nodeElement.getBoundingClientRect();j.dimensions=oe,j.handleBounds.source=Vo(".source",F.nodeElement,ce,C),j.handleBounds.target=Vo(".target",F.nodeElement,ce,C),D[Y]={id:j.id,type:"dimensions",dimensions:oe}}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),D.length&&e.hooks.nodesChange.trigger(D)},h=(d,v)=>{const y=[];for(const Y of d)y.push(Y.id);let C=[],D=[];if(e.multiSelectionActive)for(const Y of y)C.push(Ae(Y,v));else{const Y=wn([...e.nodes,...e.edges],y);C=Y.changedNodes,D=Y.changedEdges}C.length&&e.hooks.nodesChange.trigger(C),D.length&&e.hooks.edgesChange.trigger(D)},m=(d,v)=>{const y=[];for(const Y of d)y.push(Y.id);let C=[],D=[];if(e.multiSelectionActive)for(const Y of y)D.push(Ae(Y,v));else{const Y=wn([...e.nodes,...e.edges],y);C=Y.changedNodes,D=Y.changedEdges}C.length&&e.hooks.nodesChange.trigger(C),D.length&&e.hooks.edgesChange.trigger(D)},b=(d,v)=>{const y=[],C=[];for(const F of d)We(F)?y.push(F.id):Fe(F)&&C.push(F.id);const{changedNodes:D,changedEdges:Y}=wn([...e.nodes,...e.edges],[...y,...C]);if(e.multiSelectionActive){for(const F of y)D.push(Ae(F,v));for(const F of C)Y.push(Ae(F,v))}D.length&&e.hooks.nodesChange.trigger(D),Y.length&&e.hooks.edgesChange.trigger(Y)},_=d=>{h(d,!0)},x=d=>{m(d,!0)},S=d=>{b(d,!0)},g=d=>{if(!d.length)return h(d,!1);const v=[];for(const y of d)v.push(Ae(y.id,!1));v.length&&e.hooks.nodesChange.trigger(v)},I=d=>{if(!d.length)return m(d,!1);const v=[];for(const y of d)v.push(Ae(y.id,!1));v.length&&e.hooks.edgesChange.trigger(v)},N=d=>{if(!d||!d.length)return b([],!1);const v=d.reduce((y,C)=>{const D=Ae(C.id,!1);return We(C)?y.nodes.push(D):y.edges.push(D),y},{nodes:[],edges:[]});v.nodes.length&&e.hooks.nodesChange.trigger(v.nodes),v.edges.length&&e.hooks.edgesChange.trigger(v.edges)},O=d=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([d,e.maxZoom]),e.minZoom=d},H=d=>{var v;(v=e.d3Zoom)==null||v.scaleExtent([e.minZoom,d]),e.maxZoom=d},A=d=>{var v;(v=e.d3Zoom)==null||v.translateExtent(d),e.translateExtent=d},G=d=>{e.nodeExtent=d,i()},X=d=>{e.nodesDraggable=d,e.nodesConnectable=d,e.elementsSelectable=d},$=d=>{const v=d instanceof Function?d(e.nodes):d;!e.initialized&&!v.length||(e.nodes=Ho(v,l,e.hooks.error.trigger))},w=d=>{const v=d instanceof Function?d(e.edges):d;if(!e.initialized&&!v.length)return;const y=Yo(v,e.isValidConnection,l,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Lo(e.connectionLookup,y),e.edges=y},J=d=>{const v=d instanceof Function?d([...e.nodes,...e.edges]):d;!e.initialized&&!v.length||($(v.filter(We)),w(v.filter(Fe)))},R=d=>{let v=d instanceof Function?d(e.nodes):d;v=Array.isArray(v)?v:[v];const y=Ho(v,l,e.hooks.error.trigger),C=[];for(const D of y)C.push(Po(D));C.length&&e.hooks.nodesChange.trigger(C)},p=d=>{let v=d instanceof Function?d(e.edges):d;v=Array.isArray(v)?v:[v];const y=Yo(v,e.isValidConnection,l,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),C=[];for(const D of y)C.push(Po(D));C.length&&e.hooks.edgesChange.trigger(C)},k=(d,v=!0,y=!1)=>{const C=d instanceof Function?d(e.nodes):d,D=Array.isArray(C)?C:[C],Y=[],F=[];function j(pe){const ce=a(pe);for(const he of ce)(!we(he.deletable)||he.deletable)&&F.push(Do(he.id,he.source,he.target,he.sourceHandle,he.targetHandle))}function oe(pe){const ce=[];for(const he of e.nodes)he.parentNode===pe&&ce.push(he);if(ce.length){for(const he of ce)Y.push($o(he.id));v&&j(ce);for(const he of ce)oe(he.id)}}for(const pe of D){const ce=typeof pe=="string"?l(pe):pe;ce&&(we(ce.deletable)&&!ce.deletable||(Y.push($o(ce.id)),v&&j([ce]),y&&oe(ce.id)))}F.length&&e.hooks.edgesChange.trigger(F),Y.length&&e.hooks.nodesChange.trigger(Y)},E=d=>{const v=d instanceof Function?d(e.edges):d,y=Array.isArray(v)?v:[v],C=[];for(const D of y){const Y=typeof D=="string"?u(D):D;Y&&(we(Y.deletable)&&!Y.deletable||C.push(Do(typeof D=="string"?D:D.id,Y.source,Y.target,Y.sourceHandle,Y.targetHandle)))}e.hooks.edgesChange.trigger(C)},T=(d,v,y=!0)=>Uu(d,v,e.edges,u,y,e.hooks.error.trigger),z=(d,v,y={replace:!1})=>{const C=u(d);if(!C)return;const D=typeof v=="function"?v(C):v;C.data=y.replace?D:{...C.data,...D}},M=d=>ko(d,e.nodes),P=d=>{const v=ko(d,e.edges);return Lo(e.connectionLookup,v),v},V=(d,v,y={replace:!1})=>{const C=l(d);if(!C)return;const D=typeof v=="function"?v(C):v;y.replace?e.nodes.splice(e.nodes.indexOf(C),1,D):Object.assign(C,D)},W=(d,v,y={replace:!1})=>{const C=l(d);if(!C)return;const D=typeof v=="function"?v(C):v;C.data=y.replace?D:{...C.data,...D}},le=(d,v,y=!1)=>{y?e.connectionClickStartHandle=d:e.connectionStartHandle=d,e.connectionEndHandle=null,e.connectionStatus=null,v&&(e.connectionPosition=v)},te=(d,v=null,y=null)=>{e.connectionStartHandle&&(e.connectionPosition=d,e.connectionEndHandle=v,e.connectionStatus=y)},ie=(d,v)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,v?e.connectionClickStartHandle=null:e.connectionStartHandle=null},ve=d=>{const v=Mu(d),y=v?null:it(d)?d:l(d.id);return!v&&!y?[null,null,v]:[v?d:Mo(y),y,v]},ue=(d,v=!0,y=e.nodes)=>{const[C,D,Y]=ve(d);if(!C)return[];const F=[];for(const j of y||e.nodes){if(!Y&&(j.id===D.id||!j.computedPosition))continue;const oe=Mo(j),pe=zn(oe,C);(v&&pe>0||pe>=Number(C.width)*Number(C.height))&&F.push(j)}return F},K=(d,v,y=!0)=>{const[C]=ve(d);if(!C)return!1;const D=zn(C,v);return y&&D>0||D>=Number(C.width)*Number(C.height)},U=d=>{const{viewport:v,dimensions:y,d3Zoom:C,d3Selection:D,translateExtent:Y}=e;if(!C||!D||!d.x&&!d.y)return!1;const F=gt.translate(v.x+d.x,v.y+d.y).scale(v.zoom),j=[[0,0],[y.width,y.height]],oe=C.constrain()(F,j,Y),pe=e.viewport.x!==oe.x||e.viewport.y!==oe.y||e.viewport.zoom!==oe.k;return C.transform(D,oe),pe},q=d=>{const v=d instanceof Function?d(e):d,y=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];we(v.defaultEdgeOptions)&&(e.defaultEdgeOptions=v.defaultEdgeOptions);const C=v.modelValue||v.nodes||v.edges?[]:void 0;C&&(v.modelValue&&C.push(...v.modelValue),v.nodes&&C.push(...v.nodes),v.edges&&C.push(...v.edges),J(C));const D=()=>{we(v.maxZoom)&&H(v.maxZoom),we(v.minZoom)&&O(v.minZoom),we(v.translateExtent)&&A(v.translateExtent)};for(const Y of Object.keys(v)){const F=Y,j=v[F];![...Ku,...y].includes(F)&&we(j)&&(e[F]=j)}Gt(()=>e.d3Zoom).not.toBeNull().then(D),e.initialized||(e.initialized=!0)};return{updateNodePositions:c,updateNodeDimensions:f,setElements:J,setNodes:$,setEdges:w,addNodes:R,addEdges:p,removeNodes:k,removeEdges:E,findNode:l,findEdge:u,updateEdge:T,updateEdgeData:z,updateNode:V,updateNodeData:W,applyEdgeChanges:P,applyNodeChanges:M,addSelectedElements:S,addSelectedNodes:_,addSelectedEdges:x,setMinZoom:O,setMaxZoom:H,setTranslateExtent:A,setNodeExtent:G,removeSelectedElements:N,removeSelectedNodes:g,removeSelectedEdges:I,startConnection:le,updateConnection:te,endConnection:ie,setInteractive:X,setState:q,getIntersectingNodes:ue,getIncomers:r,getOutgoers:s,getConnectedEdges:a,isNodeIntersecting:K,panBy:U,fitView:d=>o.value.fitView(d),zoomIn:d=>o.value.zoomIn(d),zoomOut:d=>o.value.zoomOut(d),zoomTo:(d,v)=>o.value.zoomTo(d,v),setViewport:(d,v)=>o.value.setViewport(d,v),setTransform:(d,v)=>o.value.setTransform(d,v),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(d,v,y)=>o.value.setCenter(d,v,y),fitBounds:(d,v)=>o.value.fitBounds(d,v),project:d=>o.value.project(d),screenToFlowCoordinate:d=>o.value.screenToFlowCoordinate(d),flowToScreenCoordinate:d=>o.value.flowToScreenCoordinate(d),toObject:()=>{const d=[],v=[];for(const y of e.nodes){const{computedPosition:C,handleBounds:D,selected:Y,dimensions:F,isParent:j,resizing:oe,dragging:pe,events:ce,...he}=y;d.push(he)}for(const y of e.edges){const{selected:C,sourceNode:D,targetNode:Y,events:F,...j}=y;v.push(j)}return JSON.parse(JSON.stringify({nodes:d,edges:v,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:d=>new Promise(v=>{const{nodes:y,edges:C,position:D,zoom:Y,viewport:F}=d;if(y&&$(y),C&&w(C),F!=null&&F.x&&(F!=null&&F.y)||D){const j=(F==null?void 0:F.x)||D[0],oe=(F==null?void 0:F.y)||D[1],pe=(F==null?void 0:F.zoom)||Y||e.viewport.zoom;return Gt(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:j,y:oe,zoom:pe}).then(()=>{v(!0)})})}else v(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const d=er();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const v=gt.translate(d.defaultViewport.x??0,d.defaultViewport.y??0).scale(tt(d.defaultViewport.zoom??1,d.minZoom,d.maxZoom)),y=e.viewportRef.getBoundingClientRect(),C=[[0,0],[y.width,y.height]],D=e.d3Zoom.constrain()(v,C,d.translateExtent);e.d3Zoom.transform(e.d3Selection,D)}q(d)},$destroy:()=>{}}}const Ju=["data-id","data-handleid","data-nodeid","data-handlepos"],Qu={name:"Handle",compatConfig:{MODE:3}},Qt=ye({...Qu,props:{id:{default:null},type:{},position:{default:()=>Z.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=Jo(e,["position","connectable","connectableStart","connectableEnd","id"]),o=xe(()=>n.type??"source"),i=xe(()=>n.isValidConnection??null),{connectionStartHandle:r,connectionClickStartHandle:s,connectionEndHandle:a,vueFlowRef:l,nodesConnectable:u,noDragClassName:c,noPanClassName:f}=_e(),{id:h,node:m,nodeEl:b,connectedEdges:_}=Vi(),x=de(),S=xe(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),g=xe(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),I=xe(()=>{var $,w,J,R,p,k;return(($=r.value)==null?void 0:$.nodeId)===h&&((w=r.value)==null?void 0:w.handleId)===e.id&&((J=r.value)==null?void 0:J.type)===o.value||((R=a.value)==null?void 0:R.nodeId)===h&&((p=a.value)==null?void 0:p.handleId)===e.id&&((k=a.value)==null?void 0:k.type)===o.value}),N=xe(()=>{var $,w,J;return(($=s.value)==null?void 0:$.nodeId)===h&&((w=s.value)==null?void 0:w.handleId)===e.id&&((J=s.value)==null?void 0:J.type)===o.value}),{handlePointerDown:O,handleClick:H}=Ri({nodeId:h,handleId:e.id,isValidConnection:i,type:o}),A=ne(()=>typeof e.connectable=="string"&&e.connectable==="single"?!_.value.some($=>{const w=$[`${o.value}Handle`];return $[o.value]!==h?!1:w?w===e.id:!0}):typeof e.connectable=="number"?_.value.filter($=>{const w=$[`${o.value}Handle`];return $[o.value]!==h?!1:w?w===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(m,_.value):we(e.connectable)?e.connectable:u.value);Gt(()=>!!m.dimensions.width&&!!m.dimensions.height).toBe(!0,{flush:"post"}).then(()=>{var $;const w=($=m.handleBounds[o.value])==null?void 0:$.find(z=>z.id===e.id);if(!l.value||w)return;const J=l.value.querySelector(".vue-flow__transformationpane");if(!b.value||!x.value||!J||!e.id)return;const R=b.value.getBoundingClientRect(),p=x.value.getBoundingClientRect(),k=window.getComputedStyle(J),{m22:E}=new window.DOMMatrixReadOnly(k.transform),T={id:e.id,position:e.position,x:(p.left-R.left)/E,y:(p.top-R.top)/E,...sn(x.value)};m.handleBounds[o.value]=[...m.handleBounds[o.value]??[],T]}),Qo(()=>{const $=m.handleBounds[o.value];$&&(m.handleBounds[o.value]=$.filter(w=>w.id!==e.id))});function G($){const w=eo($);A.value&&S.value&&(w&&$.button===0||!w)&&O($)}function X($){!h||!s.value&&!S.value||A.value&&H($)}return t({handleClick:H,handlePointerDown:O,onClick:X,onPointerDown:G}),($,w)=>(ae(),me("div",{ref_key:"handle",ref:x,"data-id":`${ee(h)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":ee(h),"data-handlepos":$.position,class:ct(["vue-flow__handle",[`vue-flow__handle-${$.position}`,`vue-flow__handle-${e.id}`,ee(c),ee(f),o.value,{connectable:A.value,connecting:N.value,connectablestart:S.value,connectableend:g.value,connectionindicator:A.value&&(S.value&&!I.value||g.value&&I.value)}]]),onMousedown:G,onTouchstartPassive:G,onClick:X},[qe($.$slots,"default",{id:$.id})],42,Ju))}}),ln=function({sourcePosition:e=Z.Bottom,targetPosition:t=Z.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:s}){const a=s.label||n;return[fe(Qt,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof a!="string"&&a?fe(a):fe("div",{innerHTML:a}),fe(Qt,{type:"source",position:e,connectable:o,isValidConnection:r})]};ln.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];ln.inheritAttrs=!1;ln.compatConfig={MODE:3};const ju=ln,un=function({targetPosition:e=Z.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label||t;return[fe(Qt,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?fe(r):fe("div",{innerHTML:r})]};un.props=["targetPosition","label","isValidTargetPos","connectable","data"];un.inheritAttrs=!1;un.compatConfig={MODE:3};const ec=un,cn=function({sourcePosition:e=Z.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label||t;return[typeof r!="string"&&r?fe(r):fe("div",{innerHTML:r}),fe(Qt,{type:"source",position:e,connectable:n,isValidConnection:o})]};cn.props=["sourcePosition","label","isValidSourcePos","connectable","data"];cn.inheritAttrs=!1;cn.compatConfig={MODE:3};const tc=cn,nc=["transform"],oc=["width","height","x","y","rx","ry"],ic=["y"],rc={name:"EdgeText",compatConfig:{MODE:3}},sc=ye({...rc,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=de({x:0,y:0,width:0,height:0}),n=de(null),o=ne(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);nt(i),ge([()=>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)=>(ae(),me("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(ae(),me("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:Ve(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,oc)):Pe("",!0),Je("text",wr(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[qe(r.$slots,"default",{},()=>[typeof r.label!="string"?(ae(),dt(yr(r.label),{key:0})):(ae(),me(Qe,{key:1},[_r(Sn(r.label),1)],64))])],16,ic)],8,nc))}}),ac=["id","d","marker-end","marker-start"],lc=["d","stroke-width"],uc={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},dn=ye({...uc,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},style:{},labelStyle:{},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=Jo(e,["interactionWidth","labelShowBg"]),o=de(null),i=de(null),r=de(null),s=mr();return t({pathEl:o,interactionEl:i,labelEl:r}),(a,l)=>(ae(),me(Qe,null,[Je("path",{id:a.id,ref_key:"pathEl",ref:o,d:a.path,style:Ve(n.style),class:ct(["vue-flow__edge-path",ee(s).class]),"marker-end":a.markerEnd,"marker-start":a.markerStart},null,14,ac),a.interactionWidth?(ae(),me("path",{key:0,ref_key:"interactionEl",ref:i,fill:"none",d:a.path,"stroke-width":a.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,lc)):Pe("",!0),a.label&&a.labelX&&a.labelY?(ae(),dt(sc,{key:1,ref_key:"labelEl",ref:r,x:a.labelX,y:a.labelY,label:a.label,"label-show-bg":a.labelShowBg,"label-bg-style":a.labelBgStyle,"label-bg-padding":a.labelBgPadding,"label-bg-border-radius":a.labelBgBorderRadius,"label-style":a.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):Pe("",!0)],64))}});function tr({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 nr({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),f=Math.abs(u-t);return[l,u,c,f]}function Rt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Fo({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let s,a;switch(e){case Z.Left:s=t-Rt(t-o,r),a=n;break;case Z.Right:s=t+Rt(o-t,r),a=n;break;case Z.Top:s=t,a=n-Rt(n-i,r);break;case Z.Bottom:s=t,a=n+Rt(i-n,r);break}return[s,a]}function or(e){const{sourceX:t,sourceY:n,sourcePosition:o=Z.Bottom,targetX:i,targetY:r,targetPosition:s=Z.Top,curvature:a=.25}=e,[l,u]=Fo({pos:o,x1:t,y1:n,x2:i,y2:r,c:a}),[c,f]=Fo({pos:s,x1:i,y1:r,x2:t,y2:n,c:a}),[h,m,b,_]=nr({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:f});return[`M${t},${n} C${l},${u} ${c},${f} ${i},${r}`,h,m,b,_]}function Go({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,s;switch(e){case Z.Left:case Z.Right:r=.5*(t+o),s=n;break;case Z.Top:case Z.Bottom:r=t,s=.5*(n+i);break}return[r,s]}function ir(e){const{sourceX:t,sourceY:n,sourcePosition:o=Z.Bottom,targetX:i,targetY:r,targetPosition:s=Z.Top}=e,[a,l]=Go({pos:o,x1:t,y1:n,x2:i,y2:r}),[u,c]=Go({pos:s,x1:i,y1:r,x2:t,y2:n}),[f,h,m,b]=nr({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}`,f,h,m,b]}const Xo={[Z.Left]:{x:-1,y:0},[Z.Right]:{x:1,y:0},[Z.Top]:{x:0,y:-1},[Z.Bottom]:{x:0,y:1}};function cc({source:e,sourcePosition:t=Z.Bottom,target:n}){return t===Z.Left||t===Z.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 Uo(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function dc({source:e,sourcePosition:t=Z.Bottom,target:n,targetPosition:o=Z.Top,center:i,offset:r}){const s=Xo[t],a=Xo[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=cc({source:l,sourcePosition:t,target:u}),f=c.x!==0?"x":"y",h=c[f];let m,b,_;const x={x:0,y:0},S={x:0,y:0},[g,I,N,O]=tr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*a[f]===-1){b=i.x??g,_=i.y??I;const A=[{x:b,y:l.y},{x:b,y:u.y}],G=[{x:l.x,y:_},{x:u.x,y:_}];s[f]===h?m=f==="x"?A:G:m=f==="x"?G:A}else{const A=[{x:l.x,y:u.y}],G=[{x:u.x,y:l.y}];if(f==="x"?m=s.x===h?G:A:m=s.y===h?A:G,t===o){const R=Math.abs(e[f]-n[f]);if(R<=r){const p=Math.min(r-1,r-R);s[f]===h?x[f]=(l[f]>e[f]?-1:1)*p:S[f]=(u[f]>n[f]?-1:1)*p}}if(t!==o){const R=f==="x"?"y":"x",p=s[f]===a[R],k=l[R]>u[R],E=l[R]<u[R];(s[f]===1&&(!p&&k||p&&E)||s[f]!==1&&(!p&&E||p&&k))&&(m=f==="x"?A:G)}const X={x:l.x+x.x,y:l.y+x.y},$={x:u.x+S.x,y:u.y+S.y},w=Math.max(Math.abs(X.x-m[0].x),Math.abs($.x-m[0].x)),J=Math.max(Math.abs(X.y-m[0].y),Math.abs($.y-m[0].y));w>=J?(b=(X.x+$.x)/2,_=m[0].y):(b=m[0].x,_=(X.y+$.y)/2)}return[[e,{x:l.x+x.x,y:l.y+x.y},...m,{x:u.x+S.x,y:u.y+S.y},n],b,_,N,O]}function fc(e,t,n,o){const i=Math.min(Uo(e,t)/2,Uo(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 Hn(e){const{sourceX:t,sourceY:n,sourcePosition:o=Z.Bottom,targetX:i,targetY:r,targetPosition:s=Z.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=e,[f,h,m,b,_]=dc({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:s,center:{x:l,y:u},offset:c});return[f.reduce((S,g,I)=>{let N;return I>0&&I<f.length-1?N=fc(f[I-1],g,f[I+1],a):N=`${I===0?"M":"L"}${g.x} ${g.y}`,S+=N,S},""),h,m,b,_]}function hc(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,s,a,l]=tr({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,s,a,l]}const gc=ye({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]=hc(e);return fe(dn,{path:n,labelX:o,labelY:i,...t,...e})}}}),vc=gc,pc=ye({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()=>{const[n,o,i]=Hn({...e,sourcePosition:e.sourcePosition??Z.Bottom,targetPosition:e.targetPosition??Z.Top});return fe(dn,{path:n,labelX:o,labelY:i,...t,...e})}}}),rr=pc,mc=ye({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>fe(rr,{...e,...t,borderRadius:0})}}),yc=mc,_c=ye({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()=>{const[n,o,i]=or({...e,sourcePosition:e.sourcePosition??Z.Bottom,targetPosition:e.targetPosition??Z.Top});return fe(dn,{path:n,labelX:o,labelY:i,...t,...e})}}}),wc=_c,xc=ye({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()=>{const[n,o,i]=ir({...e,sourcePosition:e.sourcePosition??Z.Bottom,targetPosition:e.targetPosition??Z.Top});return fe(dn,{path:n,labelX:o,labelY:i,...t,...e})}}}),bc=xc,Ec={input:tc,default:ju,output:ec},Sc={default:wc,straight:vc,step:yc,smoothstep:rr,simplebezier:bc};function Nc(e,t,n){const o=ne(()=>_=>t.value.get(_)),i=ne(()=>_=>n.value.get(_)),r=ne(()=>{const _={...Sc,...e.edgeTypes},x=Object.keys(_);for(const S of e.edges)S.type&&!x.includes(S.type)&&(_[S.type]=S.type);return _}),s=ne(()=>{const _={...Ec,...e.nodeTypes},x=Object.keys(_);for(const S of e.nodes)S.type&&!x.includes(S.type)&&(_[S.type]=S.type);return _}),a=ne(()=>e.onlyRenderVisibleElements?Wi(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=ne(()=>{if(e.onlyRenderVisibleElements){const _=[];for(const x of e.edges){const S=t.value.get(x.source),g=t.value.get(x.target);Vu({sourcePos:S.computedPosition||{x:0,y:0},targetPos:g.computedPosition||{x:0,y:0},sourceWidth:S.dimensions.width,sourceHeight:S.dimensions.height,targetWidth:g.dimensions.width,targetHeight:g.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&_.push(x)}return _}return e.edges}),u=ne(()=>[...a.value,...l.value]),c=ne(()=>{const _=[];for(const x of e.nodes)x.selected&&_.push(x);return _}),f=ne(()=>{const _=[];for(const x of e.edges)x.selected&&_.push(x);return _}),h=ne(()=>[...c.value,...f.value]),m=ne(()=>{const _=[];for(const x of e.nodes)x.dimensions.width&&x.dimensions.height&&x.handleBounds!==void 0&&_.push(x);return _}),b=ne(()=>a.value.length>0&&m.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:f,getNodesInitialized:m,areNodesInitialized:b}}class Xe{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=It())==null?void 0:t.appContext.app,o=(n==null?void 0:n.config.globalProperties.$vueFlowStorage)??Xe.instance;return Xe.instance=o??new Xe,n&&(n.config.globalProperties.$vueFlowStorage=Xe.instance),Xe.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=er(),i=dr(o),r={};for(const[h,m]of Object.entries(i.hooks)){const b=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;r[b]=m.on}const s={};for(const[h,m]of Object.entries(i.hooks))s[h]=m.trigger;const a=ne(()=>{const h=new Map;for(const m of i.nodes)h.set(m.id,m);return h}),l=ne(()=>{const h=new Map;for(const m of i.edges)h.set(m.id,m);return h}),u=Nc(i,a,l),c=qu(i,a,l);c.setState({...i,...n});const f={...r,...u,...c,...Tr(i),emits:s,id:t,vueFlowVersion:"1.37.1",$destroy:()=>{this.remove(t)}};return this.set(t,f),f}getId(){return`vue-flow-${this.currentId++}`}}function _e(e){const t=Xe.getInstance(),n=Ko(),o=typeof e=="object",i=o?e:{id:e},r=i.id,s=(n==null?void 0:n.vueFlowId)||r;let a;if(n){const l=vt(No,null);typeof l<"u"&&l!==null&&(a=l)}if(a||s&&(a=t.get(s)),!a||a&&r&&r!==a.id){const l=r??t.getId(),u=t.create(l,i);a=u,(n??qo(!0)).run(()=>{ge(u.applyDefault,(f,h,m)=>{const b=x=>{u.applyNodeChanges(x)},_=x=>{u.applyEdgeChanges(x)};f?(u.onNodesChange(b),u.onEdgesChange(_)):(u.hooks.value.nodesChange.off(b),u.hooks.value.edgesChange.off(_)),m(()=>{u.hooks.value.nodesChange.off(b),u.hooks.value.edgesChange.off(_)})},{immediate:!0}),jt(()=>{if(a){const f=t.get(a.id);f?f.$destroy():an(`No store instance found for id ${a.id} in storage.`)}})})}else o&&a.setState(i);if(n&&(ut(No,a),n.vueFlowId=a.id),o){const l=It();(l==null?void 0:l.type.name)!=="VueFlow"&&a.emits.error(new Ee(be.USEVUEFLOW_OPTIONS))}return a}function Mc(e){const t=Jn(),{emits:n,dimensions:o}=_e();let i;nt(()=>{const r=e.value,s=()=>{if(!r)return;const a=sn(r);(a.width===0||a.height===0)&&n.error(new Ee(be.MISSING_VIEWPORT_DIMENSIONS)),o.value={width:a.width||500,height:a.height||500}};s(),t.addEventListener("resize",s),r&&(i=new ResizeObserver(()=>s()),i.observe(r)),ei(()=>{t.removeEventListener("resize",s),i&&r&&i.unobserve(r)})})}const Cc={name:"UserSelection",compatConfig:{MODE:3}},Ic=ye({...Cc,props:{userSelectionRect:{}},setup(e){return(t,n)=>(ae(),me("div",{class:"vue-flow__selection vue-flow__container",style:Ve({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),Tc=["tabIndex"],kc={name:"NodesSelection",compatConfig:{MODE:3}},Pc=ye({...kc,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:s}=_e(),a=Hi(),l=de(null),u=Oi({el:l,onStart(b){t.selectionDragStart(b)},onDrag(b){t.selectionDrag(b)},onStop(b){t.selectionDragStop(b)}});nt(()=>{var b;r.value||(b=l.value)==null||b.focus({preventScroll:!0})});const c=ne(()=>Zi(o.value)),f=ne(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function h(b){t.selectionContextMenu({event:b,nodes:o.value})}function m(b){r||lt[b.key]&&a({x:lt[b.key].x,y:lt[b.key].y},b.shiftKey)}return(b,_)=>!ee(s)&&c.value.width&&c.value.height?(ae(),me("div",{key:0,class:ct(["vue-flow__nodesselection vue-flow__container",ee(i)]),style:Ve({transform:`translate(${ee(n).x}px,${ee(n).y}px) scale(${ee(n).zoom})`})},[Je("div",{ref_key:"el",ref:l,class:ct([{dragging:ee(u)},"vue-flow__nodesselection-rect"]),style:Ve(f.value),tabIndex:ee(r)?void 0:-1,onContextmenu:h,onKeydown:m},null,46,Tc)],6)):Pe("",!0)}});function Zo(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const $c={name:"Pane",compatConfig:{MODE:3}},Dc=ye({...$c,props:{isSelecting:{type:Boolean}},setup(e){const{vueFlowRef:t,getNodes:n,getEdges:o,viewport:i,emits:r,userSelectionActive:s,removeSelectedElements:a,panOnDrag:l,userSelectionRect:u,elementsSelectable:c,nodesSelectionActive:f,addSelectedElements:h,getSelectedEdges:m,getSelectedNodes:b,removeNodes:_,removeEdges:x,selectionMode:S,deleteKeyCode:g,multiSelectionKeyCode:I,multiSelectionActive:N}=_e(),O=de(null),H=de(0),A=de(0),G=de(),X=xe(()=>c.value&&(e.isSelecting||s.value));xt(g,M=>{if(!M)return;const P=[];for(const V of n.value)(!V.selected&&V.parentNode&&P.some(W=>W.id===V.parentNode)||V.selected)&&P.push(V);(P||m.value)&&(m.value.length>0&&x(m.value),P.length>0&&_(P),f.value=!1,a())},{actInsideInputWithModifier:!1}),xt(I,M=>{N.value=M});function $(){s.value=!1,u.value=null,H.value=0,A.value=0}function w(M){M.target!==O.value||X.value||(r.paneClick(M),a(),f.value=!1)}function J(M){var P;if(M.target===O.value){if(Array.isArray(l.value)&&((P=l.value)!=null&&P.includes(2))){M.preventDefault();return}r.paneContextMenu(M)}}function R(M){M.target===O.value&&r.paneScroll(M)}function p(M){if(G.value=t.value.getBoundingClientRect(),!X.value||!c||!e.isSelecting||M.button!==0||M.target!==O.value||!G.value)return;const{x:P,y:V}=Zo(M,G.value);a(),u.value={width:0,height:0,startX:P,startY:V,x:P,y:V},s.value=!0,r.selectionStart(M)}function k(M){if(!X.value)return r.paneMouseMove(M);if(!e.isSelecting||!G.value||!u.value)return;s.value||(s.value=!0),f.value&&(f.value=!1);const P=Zo(M,G.value),V=u.value.startX??0,W=u.value.startY??0,le={...u.value,x:P.x<V?P.x:V,y:P.y<W?P.y:W,width:Math.abs(P.x-V),height:Math.abs(P.y-W)},te=Wi(n.value,u.value,i.value,S.value===qn.Partial),ie=Qn(te,o.value);H.value=te.length,A.value=ie.length,u.value=le,h([...te,...ie])}function E(M){X.value&&M.button===0&&(!s.value&&u.value&&M.target===O.value&&w(M),f.value=H.value>0,$(),r.selectionEnd(M))}function T(M){var P;if(!X.value)return r.paneMouseLeave(M);s.value&&(f.value=H.value>0,(P=r.selectionEnd)==null||P.call(r,M)),$()}function z(M){X.value||r.paneMouseEnter(M)}return(M,P)=>(ae(),me("div",{ref_key:"container",ref:O,class:ct(["vue-flow__pane vue-flow__container",{selection:M.isSelecting}]),onClick:w,onContextmenu:J,onWheelPassive:R,onMouseenter:z,onMousedown:p,onMousemove:k,onMouseup:E,onMouseleave:T},[qe(M.$slots,"default"),ee(s)&&ee(u)?(ae(),dt(Ic,{key:0,"user-selection-rect":ee(u)},null,8,["user-selection-rect"])):Pe("",!0),ee(f)&&ee(b).length?(ae(),dt(Pc,{key:1})):Pe("",!0)],34))}}),Ac={name:"Transform",compatConfig:{MODE:3}},Oc=ye({...Ac,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=_e(),i=ne(()=>n.value?!o.value:!1),r=ne(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(ae(),me("div",{class:"vue-flow__transformationpane vue-flow__container",style:Ve({transform:r.value,opacity:i.value?0:void 0})},[qe(s.$slots,"default")],4))}}),zc={name:"Viewport",compatConfig:{MODE:3}},Bc=ye({...zc,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:f,zoomOnDoubleClick:h,zoomOnPinch:m,zoomOnScroll:b,preventScrolling:_,noWheelClassName:x,noPanClassName:S,emits:g,connectionStartHandle:I,userSelectionActive:N,paneDragging:O,d3Zoom:H,d3Selection:A,d3ZoomHandler:G,viewport:X,viewportRef:$}=_e();Mc($);const w=de(!1),J=de(!1);let R=null,p=!1,k=0,E={x:0,y:0,zoom:0};const T=xt(a),z=xt(s),M=xt(r),P=xe(()=>T.value||f.value),V=xe(()=>T.value||l.value),W=xe(()=>z.value||s.value===!0&&P.value!==!0);nt(()=>{if(!$.value){an("Viewport element is missing");return}const K=$.value,U=K.getBoundingClientRect(),q=cu().scaleExtent([t.value,n.value]).translateExtent(i.value),Q=Me(K).call(q),re=Q.on("wheel.zoom"),L=gt.translate(o.value.x??0,o.value.y??0).scale(tt(o.value.zoom??1,t.value,n.value)),d=[[0,0],[U.width,U.height]],v=q.constrain()(L,d,i.value);q.transform(Q,v),q.wheelDelta(te),H.value=q,A.value=Q,G.value=re,X.value={x:v.x,y:v.y,zoom:v.k},q.on("start",y=>{var C;if(!y.sourceEvent)return null;k=y.sourceEvent.button,w.value=!0;const D=ve(y.transform);((C=y.sourceEvent)==null?void 0:C.type)==="mousedown"&&(O.value=!0),E=D,g.viewportChangeStart(D),g.moveStart({event:y,flowTransform:D})}),q.on("end",y=>{if(!y.sourceEvent)return null;if(w.value=!1,O.value=!1,le(P.value,k??0)&&!p&&g.paneContextMenu(y.sourceEvent),p=!1,ie(E,y.transform)){const C=ve(y.transform);E=C,g.viewportChangeEnd(C),g.moveEnd({event:y,flowTransform:C})}}),q.filter(y=>{var C,D,Y;const F=M.value||b.value,j=m.value&&y.ctrlKey,oe=y.button;if((P.value===!0||Array.isArray(P.value)&&P.value.includes(1))&&oe===1&&y.type==="mousedown"&&((C=y.target)!=null&&C.closest(".vue-flow__node")||(D=y.target)!=null&&D.closest(".vue-flow__edge")))return!0;if(!P.value&&!F&&!V.value&&!h.value&&!m.value||N.value||!h.value&&y.type==="dblclick"||ue(y,x.value)&&y.type==="wheel"||ue(y,S.value)&&(y.type!=="wheel"||V.value&&y.type==="wheel"&&!M.value)||!m.value&&y.ctrlKey&&y.type==="wheel"||!F&&!V.value&&!j&&y.type==="wheel")return!1;if(!m&&y.type==="touchstart"&&((Y=y.touches)==null?void 0:Y.length)>1)return y.preventDefault(),!1;if(!P.value&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(P.value)&&!P.value.includes(oe)&&(y.type==="mousedown"||y.type==="touchstart"))return!1;const pe=Array.isArray(P.value)&&P.value.includes(oe)||!oe||oe<=1;return(!y.ctrlKey||y.type==="wheel")&&pe}),ge([N,P],()=>{N.value&&!w.value?q.on("zoom",null):N.value||q.on("zoom",y=>{X.value={x:y.transform.x,y:y.transform.y,zoom:y.transform.k};const C=ve(y.transform);p=le(P.value,k??0),g.viewportChange(C),g.move({event:y,flowTransform:C})})},{immediate:!0}),ge([N,V,u,M,m,_,x],()=>{V.value&&!M.value&&!N.value?Q.on("wheel.zoom",y=>{if(ue(y,x.value))return!1;const C=M.value||b.value,D=m.value&&y.ctrlKey;if(!(!_.value||V.value||C||D))return!1;y.preventDefault(),y.stopImmediatePropagation();const F=Q.property("__zoom").k||1,j=Jt();if(y.ctrlKey&&m.value&&j){const lr=Te(y),ur=te(y),cr=F*2**ur;q.scaleTo(Q,cr,lr,y);return}const oe=y.deltaMode===1?20:1;let pe=u.value===wt.Vertical?0:y.deltaX*oe,ce=u.value===wt.Horizontal?0:y.deltaY*oe;!j&&y.shiftKey&&u.value!==wt.Vertical&&!pe&&ce&&(pe=ce,ce=0),q.translateBy(Q,-(pe/F)*c.value,-(ce/F)*c.value);const he=ve(Q.property("__zoom"));R&&clearTimeout(R),J.value?(g.move({event:y,flowTransform:he}),g.viewportChange(he),R=setTimeout(()=>{g.moveEnd({event:y,flowTransform:he}),g.viewportChangeEnd(he),J.value=!1},150)):(J.value=!0,g.moveStart({event:y,flowTransform:he}),g.viewportChangeStart(he))},{passive:!1}):typeof re<"u"&&Q.on("wheel.zoom",function(y,C){const D=!_.value&&y.type==="wheel"&&!y.ctrlKey,Y=M.value||b.value,F=m.value&&y.ctrlKey;if(!Y&&!l.value&&!F&&y.type==="wheel"||D||ue(y,x.value))return null;y.preventDefault(),re.call(this,y,C)},{passive:!1})},{immediate:!0})});function le(K,U){return U===2&&Array.isArray(K)&&K.includes(2)}function te(K){const U=K.ctrlKey&&Jt()?10:1;return-K.deltaY*(K.deltaMode===1?.05:K.deltaMode?1:.002)*U}function ie(K,U){return K.x!==U.x&&!Number.isNaN(U.x)||K.y!==U.y&&!Number.isNaN(U.y)||K.zoom!==U.k&&!Number.isNaN(U.k)}function ve(K){return{x:K.x,y:K.y,zoom:K.k}}function ue(K,U){return K.target.closest(`.${U}`)}return(K,U)=>(ae(),me("div",{ref_key:"viewportRef",ref:$,class:"vue-flow__viewport vue-flow__container"},[ze(Dc,{"is-selecting":W.value,class:ct({connecting:!!ee(I),dragging:ee(O),draggable:P.value})},{default:En(()=>[ze(Oc,null,{default:En(()=>[qe(K.$slots,"default")]),_:3})]),_:3},8,["is-selecting","class"])],512))}}),Rc=["id"],Vc=["id"],Hc=["id"],Lc={name:"A11yDescriptions",compatConfig:{MODE:3}},Yc=ye({...Lc,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=_e();return(i,r)=>(ae(),me(Qe,null,[Je("div",{id:`${ee($i)}-${ee(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+Sn(ee(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,Rc),Je("div",{id:`${ee(Di)}-${ee(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,Vc),ee(n)?Pe("",!0):(ae(),me("div",{key:0,id:`${ee(gu)}-${ee(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},Sn(ee(o)),9,Hc))],64))}});function Fc(){const e=_e();ge(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Gc(e,t,n){return n===Z.Left?e-t:n===Z.Right?e+t:e}function Xc(e,t,n){return n===Z.Top?e-t:n===Z.Bottom?e+t:e}const no=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=Z.Top,type:i}){return fe("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:Gc(t,e,o),cy:Xc(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};no.props=["radius","centerX","centerY","position","type"];no.compatConfig={MODE:3};const Wo=no,Uc=ye({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:f,isValidConnection:h,multiSelectionActive:m,disableKeyboardA11y:b,elementsSelectable:_,edgesUpdatable:x,edgesFocusable:S}=_e(),g=ne(()=>c(e.id)),I=yu(g.value,r),N=vt(rn),O=It(),H=de(!1),A=de(!1),G=de(""),X=de(null),$=de("source"),w=de(null),J=xe(()=>typeof g.value.selectable>"u"?_.value:g.value.selectable),R=xe(()=>typeof g.value.updatable>"u"?x.value:g.value.updatable),p=xe(()=>typeof g.value.focusable>"u"?S.value:g.value.focusable);ut(vu,e.id),ut(pu,w);const k=ne(()=>g.value.class instanceof Function?g.value.class(g.value):g.value.class),E=ne(()=>g.value.style instanceof Function?g.value.style(g.value):g.value.style),T=ne(()=>{const L=g.value.type||"default",d=N==null?void 0:N[`edge-${L}`];if(d)return d;let v=g.value.template??l.value[L];if(typeof v=="string"&&O){const y=Object.keys(O.appContext.components);y&&y.includes(L)&&(v=ti(L,!1))}return v&&typeof v!="string"?v:(r.error(new Ee(be.EDGE_TYPE_MISSING,v)),!1)}),{handlePointerDown:z}=Ri({nodeId:G,handleId:X,type:$,isValidConnection:h,edgeUpdaterType:$,onEdgeUpdate:V,onEdgeUpdateEnd:W});return()=>{const L=f(g.value.source),d=f(g.value.target),v="pathOptions"in g.value?g.value.pathOptions:{};if(!L&&!d)return r.error(new Ee(be.EDGE_SOURCE_TARGET_MISSING,g.value.id,g.value.source,g.value.target)),null;if(!L)return r.error(new Ee(be.EDGE_SOURCE_MISSING,g.value.id,g.value.source)),null;if(!d)return r.error(new Ee(be.EDGE_TARGET_MISSING,g.value.id,g.value.target)),null;if(!g.value||g.value.hidden||L.hidden||d.hidden)return null;let y;o.value===et.Strict?y=L.handleBounds.source:y=[...L.handleBounds.source||[],...L.handleBounds.target||[]];const C=Oo(y,g.value.sourceHandle);let D;o.value===et.Strict?D=d.handleBounds.target:D=[...d.handleBounds.target||[],...d.handleBounds.source||[]];const Y=Oo(D,g.value.targetHandle),F=C?C.position:Z.Bottom,j=Y?Y.position:Z.Top,{sourceX:oe,sourceY:pe,targetY:ce,targetX:he}=Ru(L,C,F,d,Y,j);return g.value.sourceX=oe,g.value.sourceY=pe,g.value.targetX=he,g.value.targetY=ce,fe("g",{ref:w,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${T.value===!1?"default":g.value.type||"default"}`,a.value,k.value,{updating:H.value,selected:g.value.selected,animated:g.value.animated,inactive:!J.value}],onClick:te,onContextmenu:ie,onDblclick:ve,onMouseenter:ue,onMousemove:K,onMouseleave:U,onKeyDown:p.value?re:void 0,tabIndex:p.value?0:void 0,"aria-label":g.value.ariaLabel===null?void 0:g.value.ariaLabel||`Edge from ${g.value.source} to ${g.value.target}`,"aria-describedby":p.value?`${Di}-${t}`:void 0,role:p.value?"button":"img"},[A.value?null:fe(T.value===!1?l.value.default:T.value,{id:e.id,sourceNode:L,targetNode:d,source:g.value.source,target:g.value.target,type:g.value.type,updatable:R.value,selected:g.value.selected,animated:g.value.animated,label:g.value.label,labelStyle:g.value.labelStyle,labelShowBg:g.value.labelShowBg,labelBgStyle:g.value.labelBgStyle,labelBgPadding:g.value.labelBgPadding,labelBgBorderRadius:g.value.labelBgBorderRadius,data:g.value.data,events:{...g.value.events,...I.on},style:E.value,markerStart:`url('#${Ct(g.value.markerStart,t)}')`,markerEnd:`url('#${Ct(g.value.markerEnd,t)}')`,sourcePosition:F,targetPosition:j,sourceX:oe,sourceY:pe,targetX:he,targetY:ce,sourceHandleId:g.value.sourceHandle,targetHandleId:g.value.targetHandle,interactionWidth:g.value.interactionWidth,...v}),[R.value==="source"||R.value===!0?[fe("g",{onMousedown:q,onMouseenter:M,onMouseout:P},fe(Wo,{position:F,centerX:oe,centerY:pe,radius:i.value,type:"source","data-type":"source"}))]:null,R.value==="target"||R.value===!0?[fe("g",{onMousedown:Q,onMouseenter:M,onMouseout:P},fe(Wo,{position:j,centerX:he,centerY:ce,radius:i.value,type:"target","data-type":"target"}))]:null]])};function M(){H.value=!0}function P(){H.value=!1}function V(L,d){I.emit.update({event:L,edge:g.value,connection:d})}function W(L){I.emit.updateEnd({event:L,edge:g.value}),A.value=!1}function le(L,d){L.button===0&&(A.value=!0,G.value=d?g.value.target:g.value.source,X.value=(d?g.value.targetHandle:g.value.sourceHandle)??"",$.value=d?"target":"source",I.emit.updateStart({event:L,edge:g.value}),z(L))}function te(L){var d;const v={event:L,edge:g.value};J.value&&(s.value=!1,g.value.selected&&m.value?(u([g.value]),(d=w.value)==null||d.blur()):n([g.value])),I.emit.click(v)}function ie(L){I.emit.contextMenu({event:L,edge:g.value})}function ve(L){I.emit.doubleClick({event:L,edge:g.value})}function ue(L){I.emit.mouseEnter({event:L,edge:g.value})}function K(L){I.emit.mouseMove({event:L,edge:g.value})}function U(L){I.emit.mouseLeave({event:L,edge:g.value})}function q(L){le(L,!0)}function Q(L){le(L,!1)}function re(L){var d;!b.value&&Ai.includes(L.key)&&J.value&&(L.key==="Escape"?((d=w.value)==null||d.blur(),u([c(e.id)])):n([c(e.id)]))}}}),Zc=Uc,Wc={[Z.Left]:Z.Right,[Z.Right]:Z.Left,[Z.Top]:Z.Bottom,[Z.Bottom]:Z.Top},Kc=ye({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:f}=_e(),h=(e=vt(rn))==null?void 0:e["connection-line"],m=ne(()=>{var g;return f((g=o.value)==null?void 0:g.nodeId)}),b=ne(()=>{var g;return f((g=i.value)==null?void 0:g.nodeId)??null}),_=ne(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),x=ne(()=>l.value.markerStart?`url(#${Ct(l.value.markerStart,t)})`:""),S=ne(()=>l.value.markerEnd?`url(#${Ct(l.value.markerEnd,t)})`:"");return()=>{var g,I,N;if(!m.value||!o.value)return null;const O=o.value.handleId,H=o.value.type,A=m.value.handleBounds;let G=A==null?void 0:A[H];if(n.value===et.Loose&&(G=G||(A==null?void 0:A[H==="source"?"target":"source"])),!G)return null;const X=(O?G.find(z=>z.id===O):G[0])??null,$=(X==null?void 0:X.position)||Z.Top,{x:w,y:J}=Rn($,{...m.value.dimensions,...m.value.computedPosition},X);let R=null;b.value&&((g=i.value)!=null&&g.handleId)&&(n.value===et.Strict?R=((I=b.value.handleBounds[H==="source"?"target":"source"])==null?void 0:I.find(z=>{var M;return z.id===((M=i.value)==null?void 0:M.handleId)}))||null:R=((N=[...b.value.handleBounds.source||[],...b.value.handleBounds.target||[]])==null?void 0:N.find(z=>{var M;return z.id===((M=i.value)==null?void 0:M.handleId)}))||null);const p=$?Wc[$]:null;if(!$||!p)return null;const k=s.value??l.value.type??Ge.Bezier;let E="";const T={sourceX:w,sourceY:J,sourcePosition:$,targetX:_.value.x,targetY:_.value.y,targetPosition:p};return k===Ge.Bezier?[E]=or(T):k===Ge.Step?[E]=Hn({...T,borderRadius:0}):k===Ge.SmoothStep?[E]=Hn(T):k===Ge.SimpleBezier?[E]=ir(T):E=`M${w},${J} ${_.value.x},${_.value.y}`,fe("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},fe("g",{class:"vue-flow__connection"},h?fe(h,{sourceX:w,sourceY:J,sourcePosition:$,targetX:_.value.x,targetY:_.value.y,targetPosition:p,sourceNode:m.value,sourceHandle:X,targetNode:b.value,targetHandle:R,markerEnd:S.value,markerStart:x.value,connectionStatus:u.value}):fe("path",{d:E,class:[l.value.class,u,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":S.value,"marker-start":x.value})))}}}),qc=Kc,Jc=["id","markerWidth","markerHeight","markerUnits","orient"],Qc={name:"MarkerType",compatConfig:{MODE:3}},jc=ye({...Qc,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)=>(ae(),me("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===ee(An).ArrowClosed?(ae(),me("polyline",{key:0,style:Ve({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)):Pe("",!0),t.type===ee(An).Arrow?(ae(),me("polyline",{key:1,style:Ve({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):Pe("",!0)],8,Jc))}}),ed={class:"vue-flow__marker vue-flow__container"},td={name:"MarkerDefinitions",compatConfig:{MODE:3}},nd=ye({...td,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=_e(),r=ne(()=>{const s=new Set,a=[],l=u=>{if(u){const c=Ct(u,t);s.has(c)||(typeof u=="object"?a.push({...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)=>(ae(),me("svg",ed,[Je("defs",null,[(ae(!0),me(Qe,null,Fn(r.value,l=>(ae(),dt(jc,{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))])]))}}),od={name:"Edges",compatConfig:{MODE:3}},id=ye({...od,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=_e();return(i,r)=>(ae(),me(Qe,null,[ze(nd),(ae(!0),me(Qe,null,Fn(ee(n),(s,a,l,u)=>{const c=[s.id];if(u&&u.key===s.id&&jo(u,c))return u;const f=(ae(),me("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:Ve({zIndex:ee(Hu)(s,ee(t),ee(o))})},[ze(ee(Zc),{id:s.id},null,8,["id"])],4));return f.memo=c,f},r,0),128)),ze(ee(qc))],64))}}),rd=ye({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:f,nodeExtent:h,elevateNodesOnSelect:m,disableKeyboardA11y:b,ariaLiveMessage:_,snapToGrid:x,snapGrid:S,nodeDragThreshold:g,nodesDraggable:I,elementsSelectable:N,nodesConnectable:O,nodesFocusable:H}=_e(),A=de(null);ut(Bi,A),ut(zi,e.id);const G=vt(rn),X=It(),$=Hi(),{node:w,parentNode:J}=Vi(e.id),R=xe(()=>typeof w.draggable>"u"?I.value:w.draggable),p=xe(()=>typeof w.selectable>"u"?N.value:w.selectable),k=xe(()=>typeof w.connectable>"u"?O.value:w.connectable),E=xe(()=>typeof w.focusable>"u"?H.value:w.focusable),T=xe(()=>!!w.dimensions.width&&!!w.dimensions.height),z=ne(()=>{const d=w.type||"default",v=G==null?void 0:G[`node-${d}`];if(v)return v;let y=w.template||f.value[d];if(typeof y=="string"&&X){const C=Object.keys(X.appContext.components);C&&C.includes(d)&&(y=ti(d,!1))}return y&&typeof y!="string"?y:(s.error(new Ee(be.NODE_TYPE_MISSING,y)),!1)}),{emit:M,on:P}=bu(w,s),V=Oi({id:e.id,el:A,disabled:()=>!R.value,selectable:p,dragHandle:()=>w.dragHandle,onStart(d){M.dragStart(d)},onDrag(d){M.drag(d)},onStop(d){M.dragStop(d)}}),W=ne(()=>w.class instanceof Function?w.class(w):w.class),le=ne(()=>{const d=(w.style instanceof Function?w.style(w):w.style)||{},v=w.width instanceof Function?w.width(w):w.width,y=w.height instanceof Function?w.height(w):w.height;return v&&(d.width=typeof v=="string"?v:`${v}px`),y&&(d.height=typeof y=="string"?y:`${y}px`),d}),te=xe(()=>Number(w.zIndex??le.value.zIndex??0));return c(d=>{(d.includes(e.id)||!d.length)&&ve()}),nt(()=>{ge(()=>w.hidden,(d=!1,v,y)=>{!d&&A.value&&(e.resizeObserver.observe(A.value),y(()=>{A.value&&e.resizeObserver.unobserve(A.value)}))},{immediate:!0,flush:"pre"})}),ge([()=>w.type,()=>w.sourcePosition,()=>w.targetPosition],()=>{Re(()=>{u([{id:e.id,nodeElement:A.value,forceUpdate:!0}])})}),ge([()=>w.position.x,()=>w.position.y,()=>{var d;return(d=J.value)==null?void 0:d.computedPosition.x},()=>{var d;return(d=J.value)==null?void 0:d.computedPosition.y},()=>{var d;return(d=J.value)==null?void 0:d.computedPosition.z},te,()=>w.selected,()=>w.dimensions.height,()=>w.dimensions.width,()=>{var d;return(d=J.value)==null?void 0:d.dimensions.height},()=>{var d;return(d=J.value)==null?void 0:d.dimensions.width}],([d,v,y,C,D,Y])=>{const F={x:d,y:v,z:Y+(m.value&&w.selected?1e3:0)};typeof y<"u"&&typeof C<"u"?w.computedPosition=Du({x:y,y:C,z:D},F):w.computedPosition=F},{flush:"post",immediate:!0}),ge([()=>w.extent,h],([d,v],[y,C])=>{(d!==y||v!==C)&&ie()}),w.extent==="parent"||typeof w.extent=="object"&&"range"in w.extent&&w.extent.range==="parent"?Gt(()=>T).toBe(!0).then(ie):ie(),()=>w.hidden?null:fe("div",{ref:A,"data-id":w.id,class:["vue-flow__node",`vue-flow__node-${z.value===!1?"default":w.type||"default"}`,{[n.value]:R.value,dragging:V==null?void 0:V.value,draggable:R.value,selected:w.selected,selectable:p.value,parent:w.isParent},W.value],style:{visibility:T.value?"visible":"hidden",zIndex:w.computedPosition.z??te.value,transform:`translate(${w.computedPosition.x}px,${w.computedPosition.y}px)`,pointerEvents:p.value||R.value?"all":"none",...le.value},tabIndex:E.value?0:void 0,role:E.value?"button":void 0,"aria-describedby":b.value?void 0:`${$i}-${t}`,"aria-label":w.ariaLabel,onMouseenter:ue,onMousemove:K,onMouseleave:U,onContextmenu:q,onClick:re,onDblclick:Q,onKeydown:L},[fe(z.value===!1?f.value.default:z.value,{id:w.id,type:w.type,data:w.data,events:{...w.events,...P},selected:w.selected,resizing:w.resizing,dragging:V.value,connectable:k.value,position:w.computedPosition,dimensions:w.dimensions,isValidTargetPos:w.isValidTargetPos,isValidSourcePos:w.isValidSourcePos,parent:w.parentNode,parentNodeId:w.parentNode,zIndex:w.computedPosition.z??te.value,targetPosition:w.targetPosition,sourcePosition:w.sourcePosition,label:w.label,dragHandle:w.dragHandle,onUpdateNodeInternals:ve})]);function ie(){const d=w.computedPosition;x.value&&(d.x=S.value[0]*Math.round(d.x/S.value[0]),d.y=S.value[1]*Math.round(d.y/S.value[1]));const{computedPosition:v,position:y}=jn(w,d,s.error,h.value,J.value);(w.computedPosition.x!==v.x||w.computedPosition.y!==v.y)&&(w.computedPosition={...w.computedPosition,...v}),(w.position.x!==y.x||w.position.y!==y.y)&&(w.position=y)}function ve(){A.value&&u([{id:e.id,nodeElement:A.value,forceUpdate:!0}])}function ue(d){V!=null&&V.value||M.mouseEnter({event:d,node:w})}function K(d){V!=null&&V.value||M.mouseMove({event:d,node:w})}function U(d){V!=null&&V.value||M.mouseLeave({event:d,node:w})}function q(d){return M.contextMenu({event:d,node:w})}function Q(d){return M.doubleClick({event:d,node:w})}function re(d){p.value&&(!o.value||!R.value||g.value>0)&&Vn(w,r.value,l,a,i,!1,A.value),M.click({event:d,node:w})}function L(d){if(!(On(d)||b.value))if(Ai.includes(d.key)&&p.value){const v=d.key==="Escape";Vn(w,r.value,l,a,i,v,A.value)}else R.value&&w.selected&<[d.key]&&(_.value=`Moved selected node ${d.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~w.position.x}, y: ${~~w.position.y}`,$({x:lt[d.key].x,y:lt[d.key].y},d.shiftKey))}}}),sd=rd;function ad(e={includeHiddenNodes:!1}){const{nodes:t}=_e();return ne(()=>{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 ld={class:"vue-flow__nodes vue-flow__container"},ud={name:"Nodes",compatConfig:{MODE:3}},cd=ye({...ud,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=_e(),i=ad(),r=de();return ge(i,s=>{s&&Re(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),nt(()=>{r.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));Re(()=>n(a))})}),ei(()=>{var s;return(s=r.value)==null?void 0:s.disconnect()}),(s,a)=>(ae(),me("div",ld,[r.value?(ae(!0),me(Qe,{key:0},Fn(ee(t),(l,u,c,f)=>{const h=[l.id];if(f&&f.key===l.id&&jo(f,h))return f;const m=(ae(),dt(ee(sd),{id:l.id,key:l.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return m.memo=h,m},a,0),128)):Pe("",!0)]))}});function dd(){const{emits:e}=_e();nt(()=>{if(ji()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ee(be.MISSING_STYLES))}})}const fd=Je("div",{class:"vue-flow__edge-labels"},null,-1),hd={name:"VueFlow",compatConfig:{MODE:3}},vd=ye({...hd,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:{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:{},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}},emits:["nodesChange","edgesChange","nodesInitialized","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneReady","init","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","updateNodeInternals","error","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdate","edgeUpdateEnd","nodeDoubleClick","nodeClick","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeContextMenu","nodeDragStart","nodeDrag","nodeDragStop","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,i=gr(),r=fn(o,"modelValue",n),s=fn(o,"nodes",n),a=fn(o,"edges",n),l=_e(o),u=Nu({modelValue:r,nodes:s,edges:a},o,l);return Wu(n,l.hooks),Fc(),dd(),ut(rn,i),Qo(()=>{u()}),t(l),(c,f)=>(ae(),me("div",{ref:ee(l).vueFlowRef,class:"vue-flow"},[ze(Bc,null,{default:En(()=>[ze(id),fd,ze(cd),qe(c.$slots,"zoom-pane")]),_:3}),qe(c.$slots,"default"),ze(Yc)],512))}});const sr=de(!1),ar=de("");let Ln;function pd(){return{isVisible:sr,message:ar,resolve:e=>{Ln&&Ln(e)}}}function md(){return{confirm(e){return sr.value=!0,ar.value=e,new Promise(t=>{Ln=t})}}}export{An as M,Z as P,Qt as _,vd as a,pd as b,md as c,_e as u};
 
 
  |