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