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