vue-pure-admin/dist/static/js/vue-flow-core-CxroMy2d.js
2024-03-21 16:24:24 +08:00

22 lines
152 KiB
JavaScript

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