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