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