1import{d as ue,k as ol,l as xe,r as de,m as W,n as He,o as O,c as te,p as Ce,f as B,q as bt,s as Lt,v as aa,x as ve,y as Ot,z as sa,A as il,e as R,w as Z,D as la,E as Kn,F as ut,G as rl,H as nn,I as al,J as wt,K as H,t as _e,g as $e,L as Ne,M as Le,N as ze,O as ua,P as sl,Q as pe,R as Ei,S as ll,T as ul,U as ye,V as ca,W as Se,X as cl,Y as Pe,Z as Si,_ as ao,$ as yt,j as Me,a0 as dl,a1 as fl,a2 as on,a3 as Et,a4 as St,a5 as Fe,a6 as Ni,a7 as qi,a as da,a8 as hl,a9 as Yt,aa as Nt,ab as kt,ac as rn,B as ki,ad as pl,ae as gl,af as Ct,ag as fa,u as vl,i as qe,ah as ml,ai as yl}from"./index-OmJ62E3Y.js";import{g as _l}from"./templates-CKRGZ70w.js";import{_ as ha}from"./index-BVdBAXPd.js";import{g as Ci}from"./merge-fields-CQiZ5ifC.js";import{g as wl,u as bl,c as $l,a as xl}from"./automations-BKi-pnnZ.js";import{getCampaigns as El}from"./campaigns-D3ljtE-P.js";function yn(e){return la()?(Kn(e),!0):!1}function rt(e){return typeof e=="function"?e():B(e)}const Sl=typeof window<"u"&&typeof document<"u",Nl=e=>typeof e<"u",kl=Object.prototype.toString,Cl=e=>kl.call(e)==="[object Object]",Ml=()=>{};function Tl(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 pa=e=>e();function Il(e=pa){const t=de(!0);function n(){t.value=!1}function o(){t.value=!0}const i=(...r)=>{t.value&&e(...r)};return{isActive:cl(t),pause:n,resume:o,eventFilter:i}}function Ki(e,t=!1,n="Timeout"){return new Promise((o,i)=>{setTimeout(t?()=>i(n):o,e)})}function Al(e,t,n={}){const{eventFilter:o=pa,...i}=n;return ve(e,Tl(o,t),i)}function Xt(e,t,n={}){const{eventFilter:o,...i}
1=n,{eventFilter:r,pause:a,resume:s,isActive:l}=Il(o);return{stop:Al(e,t,{...i,eventFilter:r}),pause:a,resume:s,isActive:l}}function Dl(e,t={}){if(!Ei(e))return ll(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const o in e.value)n[o]=ul(()=>({get(){return e.value[o]},set(i){var r;if((r=rt(t.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const s=[...e.value];s[o]=i,e.value=s}else{const s={...e.value,[o]:i};Object.setPrototypeOf(s,Object.getPrototypeOf(e.value)),e.value=s}else e.value[o]=i}}));return n}function jo(e,t=!1){function n(d,{flush:h="sync",deep:p=!1,timeout:$,throwOnTimeout:w}={}){let y=null;const C=[new Promise(v=>{y=ve(e,M=>{d(M)!==t&&(y==null||y(),v(M))},{flush:h,deep:p,immediate:!0})})];return $!=null&&C.push(Ki($,w).then(()=>rt(e)).finally(()=>y==null?void 0:y())),Promise.race(C)}function o(d,h){if(!Ei(d))return n(M=>M===d,h);const{flush:p="sync",deep:$=!1,timeout:w,throwOnTimeout:y}=h??{};let S=null;const v=[new Promise(M=>{S=ve([e,d],([z,L])=>{t!==(z===L)&&(S==null||S(),M(z))},{flush:p,deep:$,immediate:!0})})];return w!=null&&v.push(Ki(w,y).then(()=>rt(e)).finally(()=>(S==null||S(),rt(e)))),Promise.race(v)}function i(d){return n(h=>!!h,d)}function r(d){return o(null,d)}function a(d){return o(void 0,d)}function s(d){return n(Number.isNaN,d)}function l(d,h){return n(p=>{const $=Array.from(p);return $.includes(d)||$.includes(rt(d))},h)}function u(d){return c(1,d)}function c(d=1,h){let p=-1;return n(()=>(p+=1,p>=d),h)}return Array.isArray(rt(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return jo(e,!t)}}:{toMatch:n,toBe:o,toBeTruthy:i,toBeNull:r,toBeNaN:s,toBeUndefined:a,changed:u,changedTimes:c,get not(){return jo(e,!t)}}}function ei(e){return jo(e)}function Pl(e){var t;const n=rt(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ga=Sl?window:void 0;function va(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=ga):[t,n,o,i]=e,!t)return Ml;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],a=()=>{r.forEach(c=>c()),r.length=0},s=(c,d,h,p)=>(c.addEventListener(d,h,p),()=>c.removeEventListener(d,h,p)),l=ve(()=>[Pl(t),rt(i)],([c,d])=>{if(a(),!c)return;const h=Cl(d)?{...d}:d;r.push(...n.flatMap(p=>o.map($=>s(c,p,$,h))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return yn(u),u}function zl(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Qi(...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=ga,eventName:r="keydown",passive:a=!1,dedupe:s=!1}=o,l=zl(t);return va(i,r,c=>{c.repeat&&rt(s)||l(c)&&n(c)},a)}function Bl(e){return JSON.parse(JSON.stringify(e))}function Vo(e,t,n,o={}){var i,r,a;const{clone:s=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:h}=o,p=nn(),$=n||(p==null?void 0:p.emit)||((i=p==null?void 0:p.$emit)==null?void 0:i.bind(p))||((a=(r=p==null?void 0:p.proxy)==null?void 0:r.$emit)==null?void 0:a.bind(p==null?void 0:p.proxy));let w=u;t||(t="modelValue"),w=w||`update:${t.toString()}`;const y=v=>s?typeof s=="function"?s(v):Bl(v):v,S=()=>Nl(e[t])?y(e[t]):d,C=v=>{h?h(v)&&$(w,v):$(w,v)};if(l){const v=S(),M=de(v);let z=!1;return ve(()=>e[t],L=>{z||(z=!0,M.value=y(L),ut(()=>z=!1))}),ve(M,L=>{!z&&(L!==e[t]||c)&&C(L)},{deep:c}),M}else return W({get(){return S()},set(v){C(v)}})}var Ol={value:()=>{}};function Eo(){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 Qn(n)}function Qn(e){this._=e}function Rl(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}})}Qn.prototype=Eo.prototype={constructor:Qn,on:function(e,t){var n=this._,o=Rl(e+"",n),i,r=-1,a=o.length;if(arguments.length<2){for(;++r<a;)if((i=(e=o[r]).type)&&(i=Vl(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<a;)if(i=(e=o[r]).type)n[i]=Ji(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ji(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 Qn(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 Vl(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}
vendor: 10,887 bytes, line 1
1function Ji(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=Ol,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var ti="http://www.w3.org/1999/xhtml";const ji={svg:"http://www.w3.org/2000/svg",xhtml:ti,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function So(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ji.hasOwnProperty(t)?{space:ji[t],local:e}:e}function Hl(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ti&&t.documentElement.namespaceURI===ti?t.createElement(e):t.createElementNS(n,e)}}function Fl(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ma(e){var t=So(e);return(t.local?Fl:Hl)(t)}function Ll(){}function Mi(e){return e==null?Ll:function(){return this.querySelector(e)}}function Yl(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],a=r.length,s=o[i]=new Array(a),l,u,c=0;c<a;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Re(o,this._parents)}function Xl(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ul(){return[]}function ya(e){return e==null?Ul:function(){return this.querySelectorAll(e)}}function Gl(e){return function(){return Xl(e.apply(this,arguments))}}function Wl(e){typeof e=="function"?e=Gl(e):e=ya(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var a=t[r],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(o.push(e.call(l,l.__data__,u,a)),i.push(l));return new Re(o,i)}function _a(e){return function(){return this.matches(e)}}function wa(e){return function(t){return t.matches(e)}}var Zl=Array.prototype.find;function ql(e){return function(){return Zl.call(this.children,e)}}function Kl(){return this.firstElementChild}function Ql(e){return this.select(e==null?Kl:ql(typeof e=="function"?e:wa(e)))}var Jl=Array.prototype.filter;function jl(){return Array.from(this.children)}function eu(e){return function(){return Jl.call(this.children,e)}}function tu(e){return this.selectAll(e==null?jl:eu(typeof e=="function"?e:wa(e)))}function nu(e){typeof e!="function"&&(e=_a(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=[],l,u=0;u<a;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&s.push(l);return new Re(o,this._parents)}function ba(e){return new Array(e.length)}function ou(){return new Re(this._enter||this._groups.map(ba),this._parents)}function so(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}so.prototype={constructor:so,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 iu(e){return function(){return e}}function ru(e,t,n,o,i,r){for(var a=0,s,l=t.length,u=r.length;a<u;++a)(s=t[a])?(s.__data__=r[a],o[a]=s):n[a]=new so(e,r[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function au(e,t,n,o,i,r,a){var s,l,u=new Map,c=t.length,d=r.length,h=new Array(c),p;for(s=0;s<c;++s)(l=t[s])&&(h[s]=p=a.call(l,l.__data__,s,t)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<d;++s)p=a.call(e,r[s],s,r)+"",(l=u.get(p))?(o[s]=l,l.__data__=r[s],u.delete(p)):n[s]=new so(e,r[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(h[s])===l&&(i[s]=l)}function su(e){return e.__data__}function lu(e,t){if(!arguments.length)return Array.from(this,su);var n=t?au:ru,o=this._parents,i=this._groups;typeof e!="function"&&(e=iu(e));for(var r=i.length,a=new Array(r),s=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],h=d.length,p=uu(e.call(c,c&&c.__data__,u,o)),$=p.length,w=s[u]=new Array($),y=a[u]=new Array($),S=l[u]=new Array(h);n(c,d,w,y,S,p,t);for(var C=0,v=0,M,z;C<$;++C)if(M=w[C]){for(C>=v&&(v=C+1);!(z=y[v])&&++v<$;);M._next=z||null}}return a=new Re(a,o),a._enter=s,a._exit=l,a}function uu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function cu(){return new Re(this._exit||this._groups.map(ba),this._parents)}function du(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 fu(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,a=Math.min(i,r),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=o[l],d=u.length,h=s[l]=new Array(d),p,$=0;$<d;++$)(p=u[$]||c[$])&&(h[$]=p);for(;l<i;++l)s[l]=n[l];return new Re(s,this._parents)}function hu(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],a;--i>=0;)(a=o[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function pu(e){e||(e=gu);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var a=n[r],s=a.length,l=i[r]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new Re(i,this._parents).order()}function gu(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function vu(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function mu(){return Array.from(this)}function yu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var a=o[i];if(a)return a}return null}function _u(){let e=0;for(const t of this)++e;return e}function wu(){return!this.node()}function bu(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,a=i.length,s;r<a;++r)(s=i[r])&&e.call(s,s.__data__,r,i);return this}function $u(e){return function(){this.removeAttribute(e)}}function xu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Eu(e,t){return function(){this.setAttribute(e,t)}}function Su(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Nu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ku(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 Cu(e,t){var n=So(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?xu:$u:typeof t=="function"?n.local?ku:Nu:n.local?Su:Eu)(n,t))}function $a(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Mu(e){return function(){this.style.removeProperty(e)}}function Tu(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Iu(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function Au(e,t,n){return arguments.length>1?this.each((t==null?Mu:typeof t=="function"?Iu:Tu)(e,t,n??"")):Kt(this.node(),e)}function Kt(e,t){return e.style.getPropertyValue(t)||$a(e).getComputedStyle(e,null).getPropertyValue(t)}function Du(e){return function(){delete this[e]}}function Pu(e,t){return function(){this[e]=t}}function zu(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Bu(e,t){return arguments.length>1?this.each((t==null?Du:typeof t=="function"?zu:Pu)(e,t)):this.node()[e]}function xa(e){return e.trim().split(/^|\s+/)}function Ti(e){return e.classList||new Ea(e)}function Ea(e){this._node=e,this._names=xa(e.getAttribute("class")||"")}Ea.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 Sa(e,t){for(var n=Ti(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function Na(e,t){for(var n=Ti(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function Ou(e){return function(){Sa(this,e)}}function Ru(e){return function(){Na(this,e)}}function Vu(e,t){return function(){(t.apply(this,arguments)?Sa:Na)(this,e)}}function Hu(e,t){var n=xa(e+"");if(arguments.length<2){for(var o=Ti(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?Vu:t?Ou:Ru)(n,t))}function Fu(){this.textContent=""}function Lu(e){return function(){this.textContent=e}}function Yu(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Xu(e){return arguments.length?this.each(e==null?Fu:(typeof e=="function"?Yu:Lu)(e)):this.node().textContent}function Uu(){this.innerHTML=""}function Gu(e){return function(){this.innerHTML=e}}function Wu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Zu(e){return arguments.length?this.each(e==null?Uu:(typeof e=="function"?Wu:Gu)(e)):this.node().innerHTML}function qu(){this.nextSibling&&this.parentNode.appendChild(this)}function Ku(){return this.each(qu)}function Qu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ju(){return this.each(Qu)}function ju(e){var t=typeof e=="function"?e:ma(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ec(){return null}function tc(e,t){var n=typeof e=="function"?e:ma(e),o=t==null?ec:typeof t=="function"?t:Mi(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function nc(){var e=this.parentNode;e&&e.removeChild(this)}function oc(){return this.each(nc)}function ic(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ac(e){return this.select(e?rc:ic)}function sc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function lc(e){return function(t){e.call(this,t,this.__data__)}}function uc(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 cc(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 dc(e,t,n){return function(){var o=this.__on,i,r=lc(t);if(o){for(var a=0,s=o.length;a<s;++a)if((i=o[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}
vendor: 11,614 bytes, line 1
1function fc(e,t,n){var o=uc(e+""),i,r=o.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<r;++i)if((a=o[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?dc:cc,i=0;i<r;++i)this.each(s(o[i],t,n));return this}function ka(e,t,n){var o=$a(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 hc(e,t){return function(){return ka(this,e,t)}}function pc(e,t){return function(){return ka(this,e,t.apply(this,arguments))}}function gc(e,t){return this.each((typeof t=="function"?pc:hc)(e,t))}function*vc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,a;i<r;++i)(a=o[i])&&(yield a)}var Ca=[null];function Re(e,t){this._groups=e,this._parents=t}function In(){return new Re([[document.documentElement]],Ca)}function mc(){return this}Re.prototype=In.prototype={constructor:Re,select:Yl,selectAll:Wl,selectChild:Ql,selectChildren:tu,filter:nu,data:lu,enter:ou,exit:cu,join:du,merge:fu,selection:mc,order:hu,sort:pu,call:vu,nodes:mu,node:yu,size:_u,empty:wu,each:bu,attr:Cu,style:Au,property:Bu,classed:Hu,text:Xu,html:Zu,raise:Ku,lower:Ju,append:ju,insert:tc,remove:oc,clone:ac,datum:sc,on:fc,dispatch:gc,[Symbol.iterator]:vc};function Ye(e){return typeof e=="string"?new Re([[document.querySelector(e)]],[document.documentElement]):new Re([[e]],Ca)}function yc(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ke(e,t){if(e=yc(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 _c={passive:!1},_n={capture:!0,passive:!1};function Ho(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function Ma(e){var t=e.document.documentElement,n=Ye(e).on("dragstart.drag",Gt,_n);"onselectstart"in t?n.on("selectstart.drag",Gt,_n):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ta(e,t){var n=e.document.documentElement,o=Ye(e).on("dragstart.drag",null);t&&(o.on("click.drag",Gt,_n),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 Bn=e=>()=>e;function ni(e,{sourceEvent:t,subject:n,target:o,identifier:i,active:r,x:a,y:s,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}ni.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function wc(e){return!e.ctrlKey&&!e.button}function bc(){return this.parentNode}function $c(e,t){return t??{x:e.x,y:e.y}}function xc(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ec(){var e=wc,t=bc,n=$c,o=xc,i={},r=Eo("start","drag","end"),a=0,s,l,u,c,d=0;function h(M){M.on("mousedown.drag",p).filter(o).on("touchstart.drag",y).on("touchmove.drag",S,_c).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(M,z){if(!(c||!e.call(this,M,z))){var L=v(this,t.call(this,M,z),M,z,"mouse");L&&(Ye(M.view).on("mousemove.drag",$,_n).on("mouseup.drag",w,_n),Ma(M.view),Ho(M),u=!1,s=M.clientX,l=M.clientY,L("start",M))}}function $(M){if(Gt(M),!u){var z=M.clientX-s,L=M.clientY-l;u=z*z+L*L>d}i.mouse("drag",M)}function w(M){Ye(M.view).on("mousemove.drag mouseup.drag",null),Ta(M.view,u),Gt(M),i.mouse("end",M)}function y(M,z){if(e.call(this,M,z)){var L=M.changedTouches,F=t.call(this,M,z),X=L.length,ne,Y;for(ne=0;ne<X;++ne)(Y=v(this,F,M,z,L[ne].identifier,L[ne]))&&(Ho(M),Y("start",M,L[ne]))}}function S(M){var z=M.changedTouches,L=z.length,F,X;for(F=0;F<L;++F)(X=i[z[F].identifier])&&(Gt(M),X("drag",M,z[F]))}function C(M){var z=M.changedTouches,L=z.length,F,X;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),F=0;F<L;++F)(X=i[z[F].identifier])&&(Ho(M),X("end",M,z[F]))}function v(M,z,L,F,X,ne){var Y=r.copy(),U=Ke(ne||L,z),b,P,f;if((f=n.call(M,new ni("beforestart",{sourceEvent:L,target:h,identifier:X,active:a,x:U[0],y:U[1],dx:0,dy:0,dispatch:Y}),F))!=null)return b=f.x-U[0]||0,P=f.y-U[1]||0,function x(g,E,N){var D=U,I;switch(g){case"start":i[X]=x,I=a++;break;case"end":delete i[X],--a;case"drag":U=Ke(N||E,z),I=a;break}Y.call(g,M,new ni(g,{sourceEvent:E,subject:f,target:h,identifier:X,active:I,x:U[0]+b,y:U[1]+P,dx:U[0]-D[0],dy:U[1]-D[1],dispatch:Y}),F)}}return h.filter=function(M){return arguments.length?(e=typeof M=="function"?M:Bn(!!M),h):e},h.container=function(M){return arguments.length?(t=typeof M=="function"?M:Bn(M),h):t},h.subject=function(M){return arguments.length?(n=typeof M=="function"?M:Bn(M),h):n},h.touchable=function(M){return arguments.length?(o=typeof M=="function"?M:Bn(!!M),h):o},h.on=function(){var M=r.on.apply(r,arguments);return M===r?h:M},h.clickDistance=function(M){return arguments.length?(d=(M=+M)*M,h):Math.sqrt(d)},h}function Ii(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ia(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function An(){}var wn=.7,lo=1/wn,Wt="\\s*([+-]?\\d+)\\s*",bn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Sc=/^#([0-9a-f]{3,8})$/,Nc=new RegExp(`^rgb\\(${Wt},${Wt},${Wt}\\)$`),kc=new RegExp(`^rgb\\(${je},${je},${je}\\)$`),Cc=new RegExp(`^rgba\\(${Wt},${Wt},${Wt},${bn}\\)$`),Mc=new RegExp(`^rgba\\(${je},${je},${je},${bn}\\)$`),Tc=new RegExp(`^hsl\\(${bn},${je},${je}\\)$`),Ic=new RegExp(`^hsla\\(${bn},${je},${je},${bn}\\)$`),er={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};Ii(An,Rt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tr,formatHex:tr,formatHex8:Ac,formatHsl:Dc,formatRgb:nr,toString:nr});function tr(){return this.rgb().formatHex()}function Ac(){return this.rgb().formatHex8()}function Dc(){return Aa(this).formatHsl()}function nr(){return this.rgb().formatRgb()}function Rt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Sc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?or(t):n===3?new Be(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?On(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?On(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=Nc.exec(e))?new Be(t[1],t[2],t[3],1):(t=kc.exec(e))?new Be(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Cc.exec(e))?On(t[1],t[2],t[3],t[4]):(t=Mc.exec(e))?On(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Tc.exec(e))?ar(t[1],t[2]/100,t[3]/100,1):(t=Ic.exec(e))?ar(t[1],t[2]/100,t[3]/100,t[4]):er.hasOwnProperty(e)?or(er[e]):e==="transparent"?new Be(NaN,NaN,NaN,0):null}function or(e){return new Be(e>>16&255,e>>8&255,e&255,1)}function On(e,t,n,o){return o<=0&&(e=t=n=NaN),new Be(e,t,n,o)}function Pc(e){return e instanceof An||(e=Rt(e)),e?(e=e.rgb(),new Be(e.r,e.g,e.b,e.opacity)):new Be}function oi(e,t,n,o){return arguments.length===1?Pc(e):new Be(e,t,n,o??1)}function Be(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Ii(Be,oi,Ia(An,{brighter(e){return e=e==null?lo:Math.pow(lo,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wn:Math.pow(wn,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Be(Pt(this.r),Pt(this.g),Pt(this.b),uo(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:ir,formatHex:ir,formatHex8:zc,formatRgb:rr,toString:rr}));function ir(){return`#${At(this.r)}${At(this.g)}${At(this.b)}`}function zc(){return`#${At(this.r)}${At(this.g)}${At(this.b)}${At((isNaN(this.opacity)?1:this.opacity)*255)}`}function rr(){const e=uo(this.opacity);return`${e===1?"rgb(":"rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${e===1?")":`, ${e})`}`}function uo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function At(e){return e=Pt(e),(e<16?"0":"")+e.toString(16)}function ar(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Xe(e,t,n,o)}function Aa(e){if(e instanceof Xe)return new Xe(e.h,e.s,e.l,e.opacity);if(e instanceof An||(e=Rt(e)),!e)return new Xe;if(e instanceof Xe)return e;e=e.rgb();
vendor: 1,195 bytes, line 1
1var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),a=NaN,s=r-i,l=(r+i)/2;return s?(t===r?a=(n-o)/s+(n<o)*6:n===r?a=(o-t)/s+2:a=(t-n)/s+4,s/=l<.5?r+i:2-r-i,a*=60):s=l>0&&l<1?0:a,new Xe(a,s,l,e.opacity)}function Bc(e,t,n,o){return arguments.length===1?Aa(e):new Xe(e,t,n,o??1)}function Xe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Ii(Xe,Bc,Ia(An,{brighter(e){return e=e==null?lo:Math.pow(lo,e),new Xe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wn:Math.pow(wn,e),new Xe(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 Be(Fo(e>=240?e-240:e+120,i,o),Fo(e,i,o),Fo(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Xe(sr(this.h),Rn(this.s),Rn(this.l),uo(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=uo(this.opacity);return`${e===1?"hsl(":"hsla("}${sr(this.h)}, ${Rn(this.s)*100}%, ${Rn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sr(e){return e=(e||0)%360,e<0?e+360:e}function Rn(e){return Math.max(0,Math.min(1,e||0))}
vendor: 9,054 bytes, line 1
1function Fo(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 Ai=e=>()=>e;function Oc(e,t){return function(n){return e+n*t}}function Rc(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 Vc(e){return(e=+e)==1?Da:function(t,n){return n-t?Rc(t,n,e):Ai(isNaN(t)?n:t)}}function Da(e,t){var n=t-e;return n?Oc(e,n):Ai(isNaN(e)?t:e)}const co=function e(t){var n=Vc(t);function o(i,r){var a=n((i=oi(i)).r,(r=oi(r)).r),s=n(i.g,r.g),l=n(i.b,r.b),u=Da(i.opacity,r.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o}(1);function Hc(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),i;return function(r){for(i=0;i<n;++i)o[i]=e[i]*(1-r)+t[i]*r;return o}}function Fc(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Lc(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,i=new Array(o),r=new Array(n),a;for(a=0;a<o;++a)i[a]=gn(e[a],t[a]);for(;a<n;++a)r[a]=t[a];return function(s){for(a=0;a<o;++a)r[a]=i[a](s);return r}}function Yc(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function Qe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Xc(e,t){var n={},o={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=gn(e[i],t[i]):o[i]=t[i];return function(r){for(i in n)o[i]=n[i](r);return o}}var ii=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Lo=new RegExp(ii.source,"g");function Uc(e){return function(){return e}}function Gc(e){return function(t){return e(t)+""}}function Pa(e,t){var n=ii.lastIndex=Lo.lastIndex=0,o,i,r,a=-1,s=[],l=[];for(e=e+"",t=t+"";(o=ii.exec(e))&&(i=Lo.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),s[a]?s[a]+=r:s[++a]=r),(o=o[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Qe(o,i)})),n=Lo.lastIndex;return n<t.length&&(r=t.slice(n),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?Gc(l[0].x):Uc(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)s[(d=l[c]).i]=d.x(u);return s.join("")})}function gn(e,t){var n=typeof t,o;return t==null||n==="boolean"?Ai(t):(n==="number"?Qe:n==="string"?(o=Rt(t))?(t=o,co):Pa:t instanceof Rt?co:t instanceof Date?Yc:Fc(t)?Hc:Array.isArray(t)?Lc:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Xc:Qe)(e,t)}var lr=180/Math.PI,ri={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function za(e,t,n,o,i,r){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*lr,skewX:Math.atan(l)*lr,scaleX:a,scaleY:s}}var Vn;function Wc(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ri:za(t.a,t.b,t.c,t.d,t.e,t.f)}function Zc(e){return e==null||(Vn||(Vn=document.createElementNS("http://www.w3.org/2000/svg","g")),Vn.setAttribute("transform",e),!(e=Vn.transform.baseVal.consolidate()))?ri:(e=e.matrix,za(e.a,e.b,e.c,e.d,e.e,e.f))}function Ba(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,d,h,p,$){if(u!==d||c!==h){var w=p.push("translate(",null,t,null,n);$.push({i:w-4,x:Qe(u,d)},{i:w-2,x:Qe(c,h)})}else(d||h)&&p.push("translate("+d+t+h+n)}function a(u,c,d,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(i(d)+"rotate(",null,o)-2,x:Qe(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}function s(u,c,d,h){u!==c?h.push({i:d.push(i(d)+"skewX(",null,o)-2,x:Qe(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,h,p,$){if(u!==d||c!==h){var w=p.push(i(p)+"scale(",null,",",null,")");$.push({i:w-4,x:Qe(u,d)},{i:w-2,x:Qe(c,h)})}else(d!==1||h!==1)&&p.push(i(p)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,d,h),a(u.rotate,c.rotate,d,h),s(u.skewX,c.skewX,d,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(p){for(var $=-1,w=h.length,y;++$<w;)d[(y=h[$]).i]=y.x(p);return d.join("")}}}var qc=Ba(Wc,"px, ","px)","deg)"),Kc=Ba(Zc,", ",")",")"),Qc=1e-12;function ur(e){return((e=Math.exp(e))+1/e)/2}function Jc(e){return((e=Math.exp(e))-1/e)/2}function jc(e){return((e=Math.exp(2*e))-1)/(e+1)}const Jn=function e(t,n,o){function i(r,a){var s=r[0],l=r[1],u=r[2],c=a[0],d=a[1],h=a[2],p=c-s,$=d-l,w=p*p+$*$,y,S;if(w<Qc)S=Math.log(h/u)/t,y=function(F){return[s+F*p,l+F*$,u*Math.exp(t*F*S)]};else{var C=Math.sqrt(w),v=(h*h-u*u+o*w)/(2*u*n*C),M=(h*h-u*u-o*w)/(2*h*n*C),z=Math.log(Math.sqrt(v*v+1)-v),L=Math.log(Math.sqrt(M*M+1)-M);S=(L-z)/t,y=function(F){var X=F*S,ne=ur(z),Y=u/(n*C)*(ne*jc(t*X+z)-Jc(z));return[s+Y*p,l+Y*$,u*ne/ur(t*X+z)]}}return y.duration=S*1e3*t/Math.SQRT2,y}return i.rho=function(r){var a=Math.max(.001,+r),s=a*a,l=s*s;return e(a,s,l)},i}(Math.SQRT2,2,4);var Qt=0,cn=0,an=0,Oa=1e3,fo,dn,ho=0,Vt=0,No=0,$n=typeof performance=="object"&&performance.now?performance:Date,Ra=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Di(){return Vt||(Ra(ed),Vt=$n.now()+No)}function ed(){Vt=0}function po(){this._call=this._time=this._next=null}po.prototype=Va.prototype={constructor:po,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Di():+n)+(t==null?0:+t),!this._next&&dn!==this&&(dn?dn._next=this:fo=this,dn=this),this._call=e,this._time=n,ai()},stop:function(){this._call&&(this._call=null,this._time=1/0,ai())}};function Va(e,t,n){var o=new po;return o.restart(e,t,n),o}function td(){Di(),++Qt;for(var e=fo,t;e;)(t=Vt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qt}function cr(){Vt=(ho=$n.now())+No,Qt=cn=0;try{td()}finally{Qt=0,od(),Vt=0}}function nd(){var e=$n.now(),t=e-ho;t>Oa&&(No-=t,ho=e)}function od(){for(var e,t=fo,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:fo=n);dn=e,ai(o)}function ai(e){if(!Qt){cn&&(cn=clearTimeout(cn));var t=e-Vt;t>24?(e<1/0&&(cn=setTimeout(cr,e-$n.now()-No)),an&&(an=clearInterval(an))):(an||(ho=$n.now(),an=setInterval(nd,Oa)),Qt=1,Ra(cr))}}function dr(e,t,n){var o=new po;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var id=Eo("start","end","cancel","interrupt"),rd=[],Ha=0,fr=1,si=2,jn=3,hr=4,li=5,eo=6;function ko(e,t,n,o,i,r){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;ad(e,n,{name:t,index:o,group:i,on:id,tween:rd,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ha})}function Pi(e,t){var n=Ge(e,t);if(n.state>Ha)throw new Error("too late; already scheduled");return n}function tt(e,t){var n=Ge(e,t);if(n.state>jn)throw new Error("too late; already running");return n}function Ge(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ad(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Va(r,0,n.time);function r(u){n.state=fr,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,d,h,p;if(n.state!==fr)return l();for(c in o)if(p=o[c],p.name===n.name){if(p.state===jn)return dr(a);p.state===hr?(p.state=eo,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[c]):+c<t&&(p.state=eo,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[c])}if(dr(function(){n.state===jn&&(n.state=hr,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=si,n.on.call("start",e,e.__data__,n.index,n.group),n.state===si){for(n.state=jn,i=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=p);i.length=d+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=li,1),d=-1,h=i.length;++d<h;)i[d].call(e,c);n.state===li&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=eo,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function to(e,t){var n=e.__transition,o,i,r=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((o=n[a]).name!==t){r=!1;continue}i=o.state>si&&o.state<li,o.state=eo,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[a]}r&&delete e.__transition}}function sd(e){return this.each(function(){to(this,e)})}function ld(e,t){var n,o;return function(){var i=tt(this,e),r=i.tween;if(r!==n){o=n=r;for(var a=0,s=o.length;a<s;++a)if(o[a].name===t){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function ud(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=tt(this,e),a=r.tween;if(a!==o){i=(o=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}r.tween=i}}function cd(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Ge(this.node(),n).tween,i=0,r=o.length,a;i<r;++i)if((a=o[i]).name===e)return a.value;return null}return this.each((t==null?ld:ud)(n,e,t))}function zi(e,t,n){var o=e._id;return e.each(function(){var i=tt(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ge(i,o).value[t]}}function Fa(e,t){var n;
vendor: 5,185 bytes, line 1
1return(typeof t=="number"?Qe:t instanceof Rt?co:(n=Rt(t))?(t=n,co):Pa)(e,t)}function dd(e){return function(){this.removeAttribute(e)}}function fd(e){return function(){this.removeAttributeNS(e.space,e.local)}}function hd(e,t,n){var o,i=n+"",r;return function(){var a=this.getAttribute(e);return a===i?null:a===o?r:r=t(o=a,n)}}function pd(e,t,n){var o,i=n+"",r;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?r:r=t(o=a,n)}}function gd(e,t,n){var o,i,r;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s)))}}function vd(e,t,n){var o,i,r;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s)))}}function md(e,t){var n=So(e),o=n==="transform"?Kc:Fa;return this.attrTween(e,typeof t=="function"?(n.local?vd:gd)(n,o,zi(this,"attr."+e,t)):t==null?(n.local?fd:dd)(n):(n.local?pd:hd)(n,o,t))}function yd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function _d(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function wd(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&_d(e,r)),n}return i._value=t,i}function bd(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&yd(e,r)),n}return i._value=t,i}function $d(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=So(e);return this.tween(n,(o.local?wd:bd)(o,t))}function xd(e,t){return function(){Pi(this,e).delay=+t.apply(this,arguments)}}function Ed(e,t){return t=+t,function(){Pi(this,e).delay=t}}function Sd(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?xd:Ed)(t,e)):Ge(this.node(),t).delay}function Nd(e,t){return function(){tt(this,e).duration=+t.apply(this,arguments)}}function kd(e,t){return t=+t,function(){tt(this,e).duration=t}}function Cd(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Nd:kd)(t,e)):Ge(this.node(),t).duration}function Md(e,t){if(typeof t!="function")throw new Error;return function(){tt(this,e).ease=t}}function Td(e){var t=this._id;return arguments.length?this.each(Md(t,e)):Ge(this.node(),t).ease}function Id(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;tt(this,e).ease=n}}function Ad(e){if(typeof e!="function")throw new Error;return this.each(Id(this._id,e))}function Dd(e){typeof e!="function"&&(e=_a(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=[],l,u=0;u<a;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&s.push(l);return new ct(o,this._parents,this._name,this._id)}function Pd(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),a=new Array(o),s=0;s<r;++s)for(var l=t[s],u=n[s],c=l.length,d=a[s]=new Array(c),h,p=0;p<c;++p)(h=l[p]||u[p])&&(d[p]=h);for(;s<o;++s)a[s]=t[s];return new ct(a,this._parents,this._name,this._id)}function zd(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 Bd(e,t,n){var o,i,r=zd(t)?Pi:tt;return function(){var a=r(this,e),s=a.on;s!==o&&(i=(o=s).copy()).on(t,n),a.on=i}}function Od(e,t){var n=this._id;return arguments.length<2?Ge(this.node(),n).on.on(e):this.each(Bd(n,e,t))}function Rd(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Vd(){return this.on("end.remove",Rd(this._id))}function Hd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Mi(e));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a<i;++a)for(var s=o[a],l=s.length,u=r[a]=new Array(l),c,d,h=0;h<l;++h)(c=s[h])&&(d=e.call(c,c.__data__,h,s))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,ko(u[h],t,n,h,u,Ge(c,n)));return new ct(r,this._parents,t,n)}function Fd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ya(e));for(var o=this._groups,i=o.length,r=[],a=[],s=0;s<i;++s)for(var l=o[s],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var h=e.call(c,c.__data__,d,l),p,$=Ge(c,n),w=0,y=h.length;w<y;++w)(p=h[w])&&ko(p,t,n,w,h,$);r.push(h),a.push(c)}return new ct(r,a,t,n)}var Ld=In.prototype.constructor;function Yd(){return new Ld(this._groups,this._parents)}function Xd(e,t){var n,o,i;return function(){var r=Kt(this,e),a=(this.style.removeProperty(e),Kt(this,e));return r===a?null:r===n&&a===o?i:i=t(n=r,o=a)}}function La(e){return function(){this.style.removeProperty(e)}}function Ud(e,t,n){var o,i=n+"",r;return function(){var a=Kt(this,e);return a===i?null:a===o?r:r=t(o=a,n)}}function Gd(e,t,n){var o,i,r;return function(){var a=Kt(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),Kt(this,e))),a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s))}}function Wd(e,t){var n,o,i,r="style."+t,a="end."+r,s;return function(){var l=tt(this,e),u=l.on,c=l.value[r]==null?s||(s=La(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(a,i=c),l.on=o}}
vendor: 9,084 bytes, line 1
1function Zd(e,t,n){var o=(e+="")=="transform"?qc:Fa;return t==null?this.styleTween(e,Xd(e,o)).on("end.style."+e,La(e)):typeof t=="function"?this.styleTween(e,Gd(e,o,zi(this,"style."+e,t))).each(Wd(this._id,e)):this.styleTween(e,Ud(e,o,t),n).on("end.style."+e,null)}function qd(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Kd(e,t,n){var o,i;function r(){var a=t.apply(this,arguments);return a!==i&&(o=(i=a)&&qd(e,a,n)),o}return r._value=t,r}function Qd(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,Kd(e,t,n??""))}function Jd(e){return function(){this.textContent=e}}function jd(e){return function(){var t=e(this);this.textContent=t??""}}function ef(e){return this.tween("text",typeof e=="function"?jd(zi(this,"text",e)):Jd(e==null?"":e+""))}function tf(e){return function(t){this.textContent=e.call(this,t)}}function nf(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&tf(i)),t}return o._value=e,o}function of(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,nf(e))}function rf(){for(var e=this._name,t=this._id,n=Ya(),o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=Ge(l,t);ko(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ct(o,this._parents,e,n)}function af(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,a){var s={value:a},l={value:function(){--i===0&&r()}};n.each(function(){var u=tt(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&r()})}var sf=0;function ct(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Ya(){return++sf}var ot=In.prototype;ct.prototype={constructor:ct,select:Hd,selectAll:Fd,selectChild:ot.selectChild,selectChildren:ot.selectChildren,filter:Dd,merge:Pd,selection:Yd,transition:rf,call:ot.call,nodes:ot.nodes,node:ot.node,size:ot.size,empty:ot.empty,each:ot.each,on:Od,attr:md,attrTween:$d,style:Zd,styleTween:Qd,text:ef,textTween:of,remove:Vd,tween:cd,delay:Sd,duration:Cd,ease:Td,easeVarying:Ad,end:af,[Symbol.iterator]:ot[Symbol.iterator]};function lf(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var uf={time:null,delay:0,duration:250,ease:lf};function cf(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 df(e){var t,n;e instanceof ct?(t=e._id,e=e._name):(t=Ya(),(n=uf).time=Di(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],s=a.length,l,u=0;u<s;++u)(l=a[u])&&ko(l,e,t,u,a,n||cf(l,t));return new ct(o,this._parents,e,t)}In.prototype.interrupt=sd;In.prototype.transition=df;const Hn=e=>()=>e;function ff(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 at(e,t,n){this.k=e,this.x=t,this.y=n}at.prototype={constructor:at,scale:function(e){return e===1?this:new at(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new at(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 Jt=new at(1,0,0);at.prototype;function Yo(e){e.stopImmediatePropagation()}function sn(e){e.preventDefault(),e.stopImmediatePropagation()}function hf(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function pf(){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 pr(){return this.__zoom||Jt}function gf(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function vf(){return navigator.maxTouchPoints||"ontouchstart"in this}function mf(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function yf(){var e=hf,t=pf,n=mf,o=gf,i=vf,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Jn,u=Eo("start","zoom","end"),c,d,h,p=500,$=150,w=0,y=10;function S(f){f.property("__zoom",pr).on("wheel.zoom",X,{passive:!1}).on("mousedown.zoom",ne).on("dblclick.zoom",Y).filter(i).on("touchstart.zoom",U).on("touchmove.zoom",b).on("touchend.zoom touchcancel.zoom",P).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(f,x,g,E){var N=f.selection?f.selection():f;N.property("__zoom",pr),f!==N?z(f,x,g,E):N.interrupt().each(function(){L(this,arguments).event(E).start().zoom(null,typeof x=="function"?x.apply(this,arguments):x).end()})},S.scaleBy=function(f,x,g,E){S.scaleTo(f,function(){var N=this.__zoom.k,D=typeof x=="function"?x.apply(this,arguments):x;return N*D},g,E)},S.scaleTo=function(f,x,g,E){S.transform(f,function(){var N=t.apply(this,arguments),D=this.__zoom,I=g==null?M(N):typeof g=="function"?g.apply(this,arguments):g,V=D.invert(I),K=typeof x=="function"?x.apply(this,arguments):x;return n(v(C(D,K),I,V),N,a)},g,E)},S.translateBy=function(f,x,g,E){S.transform(f,function(){return n(this.__zoom.translate(typeof x=="function"?x.apply(this,arguments):x,typeof g=="function"?g.apply(this,arguments):g),t.apply(this,arguments),a)},null,E)},S.translateTo=function(f,x,g,E,N){S.transform(f,function(){var D=t.apply(this,arguments),I=this.__zoom,V=E==null?M(D):typeof E=="function"?E.apply(this,arguments):E;return n(Jt.translate(V[0],V[1]).scale(I.k).translate(typeof x=="function"?-x.apply(this,arguments):-x,typeof g=="function"?-g.apply(this,arguments):-g),D,a)},E,N)};function C(f,x){return x=Math.max(r[0],Math.min(r[1],x)),x===f.k?f:new at(x,f.x,f.y)}function v(f,x,g){var E=x[0]-g[0]*f.k,N=x[1]-g[1]*f.k;return E===f.x&&N===f.y?f:new at(f.k,E,N)}function M(f){return[(+f[0][0]+ +f[1][0])/2,(+f[0][1]+ +f[1][1])/2]}function z(f,x,g,E){f.on("start.zoom",function(){L(this,arguments).event(E).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(E).end()}).tween("zoom",function(){var N=this,D=arguments,I=L(N,D).event(E),V=t.apply(N,D),K=g==null?M(V):typeof g=="function"?g.apply(N,D):g,ie=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),ae=N.__zoom,G=typeof x=="function"?x.apply(N,D):x,q=l(ae.invert(K).concat(ie/ae.k),G.invert(K).concat(ie/G.k));return function(j){if(j===1)j=G;else{var fe=q(j),we=ie/fe[2];j=new at(we,K[0]-fe[0]*we,K[1]-fe[1]*we)}I.zoom(null,j)}})}function L(f,x,g){return!g&&f.__zooming||new F(f,x)}function F(f,x){this.that=f,this.args=x,this.active=0,this.sourceEvent=null,this.extent=t.apply(f,x),this.taps=0}F.prototype={event:function(f){return f&&(this.sourceEvent=f),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(f,x){return this.mouse&&f!=="mouse"&&(this.mouse[1]=x.invert(this.mouse[0])),this.touch0&&f!=="touch"&&(this.touch0[1]=x.invert(this.touch0[0])),this.touch1&&f!=="touch"&&(this.touch1[1]=x.invert(this.touch1[0])),this.that.__zoom=x,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(f){var x=Ye(this.that).datum();u.call(f,this.that,new ff(f,{sourceEvent:this.sourceEvent,target:S,type:f,transform:this.that.__zoom,dispatch:u}),x)}};function X(f,...x){if(!e.apply(this,arguments))return;var g=L(this,x).event(f),E=this.__zoom,N=Math.max(r[0],Math.min(r[1],E.k*Math.pow(2,o.apply(this,arguments)))),D=Ke(f);if(g.wheel)(g.mouse[0][0]!==D[0]||g.mouse[0][1]!==D[1])&&(g.mouse[1]=E.invert(g.mouse[0]=D)),clearTimeout(g.wheel);else{if(E.k===N)return;g.mouse=[D,E.invert(D)],to(this),g.start()}sn(f),g.wheel=setTimeout(I,$),g.zoom("mouse",n(v(C(E,N),g.mouse[0],g.mouse[1]),g.extent,a));function I(){g.wheel=null,g.end()}}function ne(f,...x){if(h||!e.apply(this,arguments))return;var g=f.currentTarget,E=L(this,x,!0).event(f),N=Ye(f.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",ie,!0),D=Ke(f,g),I=f.clientX,V=f.clientY;Ma(f.view),Yo(f),E.mouse=[D,this.__zoom.invert(D)],to(this),E.start();function K(ae){if(sn(ae),!E.moved){var G=ae.clientX-I,q=ae.clientY-V;E.moved=G*G+q*q>w}
1E.event(ae).zoom("mouse",n(v(E.that.__zoom,E.mouse[0]=Ke(ae,g),E.mouse[1]),E.extent,a))}function ie(ae){N.on("mousemove.zoom mouseup.zoom",null),Ta(ae.view,E.moved),sn(ae),E.event(ae).end()}}function Y(f,...x){if(e.apply(this,arguments)){var g=this.__zoom,E=Ke(f.changedTouches?f.changedTouches[0]:f,this),N=g.invert(E),D=g.k*(f.shiftKey?.5:2),I=n(v(C(g,D),E,N),t.apply(this,x),a);sn(f),s>0?Ye(this).transition().duration(s).call(z,I,E,f):Ye(this).call(S.transform,I,E,f)}}function U(f,...x){if(e.apply(this,arguments)){var g=f.touches,E=g.length,N=L(this,x,f.changedTouches.length===E).event(f),D,I,V,K;for(Yo(f),I=0;I<E;++I)V=g[I],K=Ke(V,this),K=[K,this.__zoom.invert(K),V.identifier],N.touch0?!N.touch1&&N.touch0[2]!==K[2]&&(N.touch1=K,N.taps=0):(N.touch0=K,D=!0,N.taps=1+!!c);c&&(c=clearTimeout(c)),D&&(N.taps<2&&(d=K[0],c=setTimeout(function(){c=null},p)),to(this),N.start())}}function b(f,...x){if(this.__zooming){var g=L(this,x).event(f),E=f.changedTouches,N=E.length,D,I,V,K;for(sn(f),D=0;D<N;++D)I=E[D],V=Ke(I,this),g.touch0&&g.touch0[2]===I.identifier?g.touch0[0]=V:g.touch1&&g.touch1[2]===I.identifier&&(g.touch1[0]=V);if(I=g.that.__zoom,g.touch1){var ie=g.touch0[0],ae=g.touch0[1],G=g.touch1[0],q=g.touch1[1],j=(j=G[0]-ie[0])*j+(j=G[1]-ie[1])*j,fe=(fe=q[0]-ae[0])*fe+(fe=q[1]-ae[1])*fe;I=C(I,Math.sqrt(j/fe)),V=[(ie[0]+G[0])/2,(ie[1]+G[1])/2],K=[(ae[0]+q[0])/2,(ae[1]+q[1])/2]}else if(g.touch0)V=g.touch0[0],K=g.touch0[1];else return;g.zoom("touch",n(v(I,V,K),g.extent,a))}}function P(f,...x){if(this.__zooming){var g=L(this,x).event(f),E=f.changedTouches,N=E.length,D,I;for(Yo(f),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),D=0;D<N;++D)I=E[D],g.touch0&&g.touch0[2]===I.identifier?delete g.touch0:g.touch1&&g.touch1[2]===I.identifier&&delete g.touch1;if(g.touch1&&!g.touch0&&(g.touch0=g.touch1,delete g.touch1),g.touch0)g.touch0[1]=this.__zoom.invert(g.touch0[0]);else if(g.end(),g.taps===2&&(I=Ke(I,this),Math.hypot(d[0]-I[0],d[1]-I[1])<y)){var V=Ye(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return S.wheelDelta=function(f){return arguments.length?(o=typeof f=="function"?f:Hn(+f),S):o},S.filter=function(f){return arguments.length?(e=typeof f=="function"?f:Hn(!!f),S):e},S.touchable=function(f){return arguments.length?(i=typeof f=="function"?f:Hn(!!f),S):i},S.extent=function(f){return arguments.length?(t=typeof f=="function"?f:Hn([[+f[0][0],+f[0][1]],[+f[1][0],+f[1][1]]]),S):t},S.scaleExtent=function(f){return arguments.length?(r[0]=+f[0],r[1]=+f[1],S):[r[0],r[1]]},S.translateExtent=function(f){return arguments.length?(a[0][0]=+f[0][0],a[1][0]=+f[1][0],a[0][1]=+f[0][1],a[1][1]=+f[1][1],S):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},S.constrain=function(f){return arguments.length?(n=f,S):n},S.duration=function(f){return arguments.length?(s=+f,S):s},S.interpolate=function(f){return arguments.length?(l=f,S):l},S.on=function(){var f=u.on.apply(u,arguments);return f===u?S:f},S.clickDistance=function(f){return arguments.length?(w=(f=+f)*f,S):Math.sqrt(w)},S.tapDistance=function(f){return arguments.length?(y=+f,S):y},S}var Q=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(Q||{}),Bi=(e=>(e.Partial="partial",e.Full="full",e))(Bi||{}),Mt=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(Mt||{}),$t=(e=>(e.Strict="strict",e.Loose="loose",e))($t||{}),ui=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(ui||{}),vn=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(vn||{}),Xa=(e=>(e.TopLeft="top-left",e.TopCenter="top-center",e.TopRight="top-right",e.BottomLeft="bottom-left",e.BottomCenter="bottom-center",e.BottomRight="bottom-right",e))(Xa||{});const _f=["INPUT","SELECT","TEXTAREA"],wf=typeof document<"u"?document:null;function ci(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 _f.includes(o==null?void 0:o.nodeName)||i||!!r}function bf(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function gr(e,t,n,o){const i=t.replace("+",` 2`).replace(` 3 4`,` 5+`).split(` 6`).map(a=>a.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();o||n.add(e.toLowerCase());const r=i.every((a,s)=>n.has(a)&&Array.from(n.values())[s]===i[s]);return o&&n.delete(e.toLowerCase()),r}function $f(e,t){return n=>{if(!n.code&&!n.key)return!1;const o=xf(n.code,e);return Array.isArray(e)?e.some(i=>
6gr(n[o],i,t,n.type==="keyup")):gr(n[o],e,t,n.type==="keyup")}}function xf(e,t){return t.includes(e)?"code":"key"}function mn(e,t){const n=W(()=>ye(t==null?void 0:t.target)??wf),o=wt(ye(e)===!0);let i=!1;const r=new Set;let a=l(ye(e));ve(()=>ye(e),(u,c)=>{typeof c=="boolean"&&typeof u!="boolean"&&s(),a=l(u)},{immediate:!0}),va(["blur","contextmenu"],s),Qi((...u)=>a(...u),u=>{var c,d;const h=ye(t==null?void 0:t.actInsideInputWithModifier)??!0,p=ye(t==null?void 0:t.preventDefault)??!1;if(i=bf(u),(!i||i&&!h)&&ci(u))return;const w=((d=(c=u.composedPath)==null?void 0:c.call(u))==null?void 0:d[0])||u.target,y=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";!p&&(i||!y)&&u.preventDefault(),o.value=!0},{eventName:"keydown",target:n}),Qi((...u)=>a(...u),u=>{const c=ye(t==null?void 0:t.actInsideInputWithModifier)??!0;if(o.value){if((!i||i&&!c)&&ci(u))return;i=!1,o.value=!1}},{eventName:"keyup",target:n});function s(){i=!1,r.clear(),o.value=ye(e)===!0}function l(u){return u===null?(s(),()=>!1):typeof u=="boolean"?(s(),o.value=u,()=>!1):Array.isArray(u)||typeof u=="string"?$f(u,r):u}return o}const Ua="vue-flow__node-desc",Ga="vue-flow__edge-desc",Ef="vue-flow__aria-live",Wa=["Enter"," ","Escape"],Zt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function go(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function vo(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 Co(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Ht(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Za(e,t){return{x:Ht(e.x,t[0][0],t[1][0]),y:Ht(e.y,t[0][1],t[1][1])}}function vr(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function xt(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function zt(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!xt(e)}function fn(e){return zt(e)&&"computedPosition"in e}function Fn(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Sf(e){return Fn(e.width)&&Fn(e.height)&&Fn(e.x)&&Fn(e.y)}function Nf(e,t,n){const o={id:e.id.toString(),type:e.type??"default",dimensions:Pe({width:0,height:0}),computedPosition:Pe({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Te(e.data)?e.data:{},events:Pe(Te(e.events)?e.events:{})};return Object.assign(t??o,e,{id:e.id.toString(),parentNode:n})}function qa(e,t,n){var o,i;const r={id:e.id.toString(),type:e.type??(t==null?void 0:t.type)??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(o=e.sourceHandle)==null?void 0:o.toString(),targetHandle:(i=e.targetHandle)==null?void 0:i.toString(),updatable:e.updatable??(n==null?void 0:n.updatable),selectable:e.selectable??(n==null?void 0:n.selectable),focusable:e.focu
6sable??(n==null?void 0:n.focusable),data:Te(e.data)?e.data:{},events:Pe(Te(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(n==null?void 0:n.interactionWidth),...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function Ka(e,t,n,o){const i=typeof e=="string"?e:e.id,r=new Set,a=o==="source"?"target":"source";for(const s of n)s[a]===i&&r.add(s[o]);return t.filter(s=>r.has(s.id))}function kf(...e){if(e.length===3){const[r,a,s]=e;return Ka(r,a,s,"target")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>xt(r)&&r.source===o).map(r=>n.find(a=>zt(a)&&a.id===r.target))}function Cf(...e){if(e.length===3){const[r,a,s]=e;return Ka(r,a,s,"source")}const[t,n]=e,o=typeof t=="string"?t:t.id;return n.filter(r=>xt(r)&&r.target===o).map(r=>n.find(a=>zt(a)&&a.id===r.source))}function Qa({source:e,sourceHandle:t,target:n,targetHandle:o}){return`vueflow__edge-${e}${t??""}-${n}${o??""}`}function Mf(e,t){return t.some(n=>xt(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 xn({x:e,y:t},{x:n,y:o,zoom:i}){return{x:e*i+n,y:t*i+o}}function En({x:e,y:t},{x:n,y:o,zoom:i},r=!1,a=[1,1]){const s={x:(e-n)/i,y:(t-o)/i};return r?Mo(s,a):s}function Ja(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 mo({x:e,y:t,width:n,height:o}){return{x:e,y:t,x2:e+n,y2:t+o}}function ja({x:e,y:t,x2:n,y2:o}){return{x:e,y:t,width:n-e,height:o-t}}function Tf(e,t){return ja(Ja(mo(e),mo(t)))}function Oi(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const o=e[n];t=Ja(t,mo({...o.computedPosition,...o.dimensions}))}return ja(t)}function es(e,t,n={x:0,y:0,zoom:1},o=!1,i=!1){const r={...En(t,n),width:t.width/n.zoom,height:t.height/n.zoom},a=[];for(const s of e){const{dimensions:l,selectable:u=!0,hidden:c=!1}=s,d=l.width??s.width??null,h=l.height??s.height??null;if(i&&!u||c)continue;const p=vo(r,go(s)),$=d===null||h===null,w=o&&p>0,y=(d??0)*(h??0);($||w||p>=y||s.dragging)&&a.push(s)}return a}function Tt(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 Ut(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return Dn(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function If(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Ut(e,n),i=Ut(e,t);return{top:o,right:i,bottom:o,left:i,x:i*2,y:o*2}}if(typeof e=="object"){const o=Ut(e.top??e.y??0,n),i=Ut(e.bottom??e.y??0,n),r=Ut(e.left??e.x??0,t),a=Ut(e.right??e.x??0,t);return{top:o,right:a,bottom:i,left:r,x:r+a,y:o+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Af(e,t,n,o,i,r){const{x:a,y:s}=xn(e,{x:t,y:n,zoom:o}),{x:l,y:u}=xn({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:o}),c=i-l,d=r-u;return{left:Math.floor(a),top:Math.floor(s),right:Math.floor(c),bottom:Math.floor(d)}}function mr(e,t,n,o,i,r=.1){const a=If(r,t,n),s=(t-a.x)/e.width,l=(n-a.y)/e.height,u=Math.min(s,l),c=Ht(u,o,i),d=e.x+e.width/2,h=e.y+e.height/2,p=t/2-d*c,$=n/2-h*c,w=Af(e,p,$,c,t,n),y={left:Math.min(w.left-a.left,0),top:Math.min(w.top-a.top,0),right:Math.min(w.right-a.right,0),bottom:Math.min(w.bottom-a.bottom,0)};return{x:p-y.left+y.right,y:$-y.top+y.bottom,zoom:c}}function Df(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function ts(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:ts(n,t):!1}function Sn(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`}function di(e){const t=e.ctrlKey&&Nn()?10:1;
6return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function yr(e,t,n){return e<t?Ht(Math.abs(e-t),1,t)/t:e>n?-Ht(Math.abs(e-n),1,t)/t:0}function ns(e,t,n=15,o=40){const i=yr(e.x,o,t.width-o)*n,r=yr(e.y,o,t.height-o)*n;return[i,r]}function Xo(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,o=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||o>0||e.position.x<0||e.position.y<0){let i={};if(typeof t.style=="function"?i={...t.style(t)}:t.style&&(i={...t.style}),i.width=i.width??`${t.dimensions.width}px`,i.height=i.height??`${t.dimensions.height}px`,n>0)if(typeof i.width=="string"){const r=Number(i.width.replace("px",""));i.width=`${r+n}px`}else i.width+=n;if(o>0)if(typeof i.height=="string"){const r=Number(i.height.replace("px",""));i.height=`${r+o}px`}else i.height+=o;if(e.position.x<0){const r=Math.abs(e.position.x);if(t.position.x=t.position.x-r,typeof i.width=="string"){const a=Number(i.width.replace("px",""));i.width=`${a+r}px`}else i.width+=r;e.position.x=0}if(e.position.y<0){const r=Math.abs(e.position.y);if(t.position.y=t.position.y-r,typeof i.height=="string"){const a=Number(i.height.replace("px",""));i.height=`${a+r}px`}else i.height+=r;e.position.y=0}t.dimensions.width=Number(i.width.toString().replace("px","")),t.dimensions.height=Number(i.height.toString().replace("px","")),typeof t.style=="function"?t.style=r=>{const a=t.style;return{...a(r),...i}}:t.style={...t.style,...i}}}}function _r(e,t){var n,o;const i=e.filter(a=>a.type==="add"||a.type==="remove");for(const a of i)if(a.type==="add")t.findIndex(l=>l.id===a.item.id)===-1&&t.push(a.item);else if(a.type==="remove"){const s=t.findIndex(l=>l.id===a.id);s!==-1&&t.splice(s,1)}const r=t.map(a=>a.id);for(const a of t)for(const s of e)if(s.id===a.id)switch(s.type){case"select":a.selected=s.selected;break;case"position":if(fn(a)&&(typeof s.position<"u"&&(a.position=s.position),typeof s.dragging<"u"&&(a.dragging=s.dragging),a.expandParent&&a.parentNode)){const l=t[r.indexOf(a.parentNode)];l&&fn(l)&&Xo(a,l)}break;case"dimensions":if(fn(a)&&(typeof s.dimensions<"u"&&(a.dimensions=s.dimensions),typeof s.updateStyle<"u"&&s.updateStyle&&(a.style={...a.style||{},width:`${(n=s.dimensions)==null?void 0:n.width}px`,height:`${(o=s.dimensions)==null?void 0:o.height}px`}),typeof s.resizing<"u"&&(a.resizing=s.resizing),a.expandParent&&a.parentNode)){const l=t[r.indexOf(a.parentNode)];l&&fn(l)&&(!!l.dimensions.width&&!!l.dimensions.height?Xo(a,l):ut(()=>{Xo(a,l)}))}break}return t}function pt(e,t){return{id:e,type:"select",selected:t}}function wr(e){return{item:e,type:"add"}}function br(e){return{id:e,type:"remove"}}function $r(e,t,n,o,i){return{id:e,source:t,target:n,sourceHandle:o||null,targetHandle:i||null,type:"remove"}}function vt(e,t=new Set,n=!1){const o=[];for(const[i,r]of e){const a=t.has(i);!(r.selected===void 0&&!a)&&r.selected!==a&&(n&&(r.selected=a),o.push(pt(r.id,a)))}return o}const xr=()=>{};function J(e){const t=new Set;let n=xr,o=()=>!1;const i=()=>t.size>0||o(),r=h=>{n=h},a=()=>{n=xr},s=h=>{o=h},l=()=>{o=()=>!1},u=h=>{t.delete(h)};return{on:h=>{t.add(h);const p=()=>u(h);return yn(p),{off:p}},off:u,trigger:h=>{const p=[n];return i()?p.push(...t):e&&p.push(e),Promise.allSettled(p.map($=>$(h)))},hasListeners:i,listeners:t,setEmitter:r,removeEmitter:a,setHasEmitListeners:s,removeHasEmitListeners:l}}function Er(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 Pf(e,t,n,o){var i,r;const a=new Map;for(const[s,l]of e)(l.selected||l.id===o)&&(!l.parentNode||!ts(l,e))&&(l.draggable||t&&typeof l.draggable>"u")&&e.get(s)&&a.set(s,{id:l.id,position:l.position||{x:0,y:0},distance:{x:n.x-((i=l.computedPosition)==null?void 0:i.x)||0,y:n.y-((r=l.computedPosition)==null?void 0:r.y)||0},from:{x:l.computedPosition.x,y:l.computedPosition.y},extent:l.extent,parentNode:l.parentNode,dimensions:{...l.dimensions},expandParent:l.expandParent});return Array.from(a.values())}function Uo({id:e,dragItems:t,findNode:n}){const o=[];for(const i of t){const r=n(i.id);r&&o.push(r)}return[e?o.find(i=>i.id===e):o[0],o]}function os(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 zf(e,t,n){const[o,i,r,a]=typeof e!="string"?os(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+a,n.computedPosition.y+o],[n.computedPosition.x+n.dimensions.width-i,n.computedPosition.y+n.dimensions.height-r]]:!1}function Bf(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=zf(i,e,o);r&&(i=r)}
6else t(new De(Ie.NODE_EXTENT_INVALID,e.id)),i=n;else if(Array.isArray(i)){const r=(o==null?void 0:o.computedPosition.x)||0,a=(o==null?void 0:o.computedPosition.y)||0;i=[[i[0][0]+r,i[0][1]+a],[i[1][0]+r,i[1][1]+a]]}else if(i!=="parent"&&(i!=null&&i.range)&&Array.isArray(i.range)){const[r,a,s,l]=os(i.padding),u=(o==null?void 0:o.computedPosition.x)||0,c=(o==null?void 0:o.computedPosition.y)||0;i=[[i.range[0][0]+u+l,i.range[0][1]+c+r],[i.range[1][0]+u-a,i.range[1][1]+c-s]]}return i==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:i}function Of({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function Ri(e,t,n,o,i){const r=Of(e.dimensions,Bf(e,n,o,i)),a=Za(t,r);return{position:{x:a.x-((i==null?void 0:i.computedPosition.x)||0),y:a.y-((i==null?void 0:i.computedPosition.y)||0)},computedPosition:a}}function jt(e,t,n=Q.Left,o=!1){const i=((t==null?void 0:t.x)??0)+e.computedPosition.x,r=((t==null?void 0:t.y)??0)+e.computedPosition.y,{width:a,height:s}=t??Ff(e);if(o)return{x:i+a/2,y:r+s/2};switch((t==null?void 0:t.position)??n){case Q.Top:return{x:i+a/2,y:r};case Q.Right:return{x:i+a,y:r+s/2};case Q.Bottom:return{x:i+a/2,y:r+s};case Q.Left:return{x:i,y:r+s/2}}}function Sr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Rf({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:i,targetHeight:r,width:a,height:s,viewport:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+o,t.y+r)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=mo({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:a/l.zoom,height:s/l.zoom}),d=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(d*h)>0}function Vf(e,t,n=!1){const o=typeof e.zIndex=="number";let i=o?e.zIndex:0;const r=t(e.source),a=t(e.target);return!r||!a?0:(n&&(i=o?e.zIndex:Math.max(r.computedPosition.z||0,a.computedPosition.z||0)),i)}var Ie=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(Ie||{});const Nr={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 7Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found 8Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent 9Node: ${e} 10Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing 11Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent 12Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target 13Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>
13`Edge source is missing 14Edge: ${e} 15Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing 16Edge: ${e} 17Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing 18Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same 19Edge: ${e} 20Source: ${t} 21Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing 22Edge: ${e} 23Source: ${t} 24Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed 25Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found 26Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class De extends Error{constructor(t,...n){var o;super((o=Nr[t])==null?void 0:o.call(Nr,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function Vi(e){return"clientX"in e}function Hf(e){return"sourceEvent"in e}function Je(e,t){const n=Vi(e);let o,i;return n?(o=e.clientX,i=e.clientY):"touches"in e&&e.touches.length>0?(o=e.touches[0].clientX,i=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(o=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(o=0,i=0),{x:o-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}}const Nn=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ff(e){var t,n;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((n=e.dimensions)==null?void 0:n.height)??e.height??0}}function Mo(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const Lf=()=>!0;function Go(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Yf(e,t,n){const o=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())vo(i,go(r))>0&&o.push(r);return o}const Xf=250;function Uf(e,t,n,o){var i,r;let a=[],s=Number.POSITIVE_INFINITY;const l=Yf(e,n,t+Xf);for(const u of l){const c=[...((i=u.handleBounds)==null?void 0:i.source)??[],...((r=u.handleBounds)==null?void 0:r.target)??[]];for(const d of c){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:h,y:p}=jt(u,d,d.position,!0),$=Math.sqrt((h-e.x)**2+(p-e.y)**2);$>t||($<s?(a=[{...d,x:h,y:p}],s=$):$===s&&a.push({...d,x:h,y:p}))}}if(!a.length)return null;if(a.length>1){const u=o.type==="source"?"target":"source";return a.find(c=>c.type===u)??a[0]}return a[0]}function kr(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:i,fromType:r,doc:a,lib:s,flowId:l,isValidConnection:u=Lf},c,d,h,p){const $=r==="target",w=t?a.querySelector(`.${s}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:y,y:S}=Je(e),C=a.elementFromPoint(y,S),v=C!=null&&C.classList.contains(`${s}-flow__handle`)?C:w,M={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const z=is(void 0,v),L=v.getAttribute("data-nodeid"),F=v.getAttribute("data-handleid"),X=v.classList.contains("connectable"),ne=v.classList.contains("connectableend");if(!L||!z)return M;const Y={source:$?L:o,sourceHandle:$?F:i,target:$?o:L,targetHandle:$?i:F};M.connection=Y;const b=X&&ne&&(n===$t.Strict?$&&z==="source"||!$&&z==="target":L!==o||F!==i);M.isValid=b&&u(Y,{nodes:d,edges:c,sourceNode:h(Y.source),targetNode:h(Y.target)}),M.toHandle=rs(L,z,F,p,n,!0)}return M}function is(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Gf(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Wf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function rs(e,t,n,o,i,r=!1){var a,s,l;const u=o.get(e);if(!u)return null;const c=i===$t.Strict?(a=u.handleBounds)==null?void 0:a[t]:[...((s=u.handleBounds)==null?void 0:s.source)??[],...((l=u.handleBounds)==null?void 0:l.target)??[]],d=(n?c==null?void 0:c.find(h=>h.id===n):c==null?void 0:c[0])??null;return d&&r?{...d,...jt(u,d,d.position,!0)}:d}const fi={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top},Zf=["production","prod"];function Dn(e,...t){as()&&console.warn(`[Vue Flow]: ${e}`,...t)}function as(){return!Zf.includes("production")}function Cr(e,t,n,o,i){const r=t.querySelectorAll(`.vue-flow__handle.${e}`);return r!=null&&r.length?Array.from(r).map(a=>{const s=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(s.left-n.left)/o,y:(s.top-n.top)/o,...Co(a)}}):null}function hi(e,t,n,o,i,r=!1,a){i.value=!1,e.selected?(r||e.selected&&t)&&(o([e]),ut(()=>{a.blur()})):n([e])}function Te(e){return typeof B(e)<"u"}function qf(e,t,n,o){if(!e||!e.source||!e.target)return n(new De(Ie.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let i;return xt(e)?i=e:i={...e,id:Qa(e)},i=qa(i,void 0,o),Mf(i,t)?!1:i}function Kf(e,t,n,o,i){if(!t.source||!t.target)return i(new De(Ie.EDGE_INVALID,e.
26id)),!1;if(!n)return i(new De(Ie.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...a}=e;return{...a,id:o?Qa(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Mr(e,t,n){const o={},i=[];for(let r=0;r<e.length;++r){const a=e[r];if(!zt(a)){n(new De(Ie.NODE_INVALID,a==null?void 0:a.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const s=Nf(a,t(a.id),a.parentNode);a.parentNode&&(o[a.parentNode]=!0),i[r]=s}for(const r of i){const a=t(r.parentNode)||i.find(s=>s.id===r.parentNode);r.parentNode&&!a&&n(new De(Ie.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||o[r.id])&&(o[r.id]&&(r.isParent=!0),a&&(a.isParent=!0))}return i}function Tr(e,t,n,o,i,r){let a=i;const s=o.get(a)||new Map;o.set(a,s.set(n,t)),a=`${i}-${e}`;const l=o.get(a)||new Map;if(o.set(a,l.set(n,t)),r){a=`${i}-${e}-${r}`;const u=o.get(a)||new Map;o.set(a,u.set(n,t))}}function Wo(e,t,n){e.clear();for(const o of n){const{source:i,target:r,sourceHandle:a=null,targetHandle:s=null}=o,l={edgeId:o.id,source:i,target:r,sourceHandle:a,targetHandle:s},u=`${i}-${a}--${r}-${s}`,c=`${r}-${s}--${i}-${a}`;Tr("source",l,c,e,i,a),Tr("target",l,u,e,r,s)}}function Ir(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Zo(e,t,n,o,i,r,a,s){const l=[];for(const u of e){const c=xt(u)?u:qf(u,s,i,r);if(!c)continue;const d=n(c.source),h=n(c.target);if(!d||!h){i(new De(Ie.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){i(new De(Ie.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!h){i(new De(Ie.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:s,nodes:a,sourceNode:d,targetNode:h})){i(new De(Ie.EDGE_INVALID,c.id));continue}const p=o(c.id);l.push({...qa(c,p,r),sourceNode:d,targetNode:h})}return l}const Ar=Symbol("vueFlow"),ss=Symbol("nodeId"),ls=Symbol("nodeRef"),Qf=Symbol("edgeId"),Jf=Symbol("edgeRef"),To=Symbol("slots");function us(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:o,noDragClassName:i,nodeLookup:r,nodeExtent:a,nodeDragThreshold:s,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:h,findNode:p,multiSelectionActive:$,nodesSelectionActive:w,selectNodesOnDrag:y,removeSelectedElements:S,addSelectedNodes:C,updateNodePositions:v,emits:M}=ke(),{onStart:z,onDrag:L,onStop:F,onClick:X,el:ne,disabled:Y,id:U,selectable:b,dragHandle:P}=e,f=wt(!1);let x=[],g,E=null,N={x:void 0,y:void 0},D={x:0,y:0},I=null,V=!1,K=!1,ie=0,ae=!1;const G=th(),q=({x:le,y:he})=>{N={x:le,y:he};let _=!1;if(x=x.map(m=>{const k={x:le-m.distance.x,y:he-m.distance.y},{computedPosition:A}=Ri(m,n.value?Mo(k,o.value):k,M.error,a.value,m.parentNode?p(m.parentNode):void 0);return _=_||m.position.x!==A.x||m.position.y!==A.y,m.position=A,m}),K=K||_,!!_&&(v(x,!0,!0),f.value=!0,I)){const[m,k]=Uo({id:U,dragItems:x,findNode:p});L({event:I,node:m,nodes:k})}},j=()=>
26{if(!E)return;const[le,he]=ns(D,E,c.value);if(le!==0||he!==0){const _={x:(N.x??0)-le/l.value.zoom,y:(N.y??0)-he/l.value.zoom};h({x:le,y:he})&&q(_)}ie=requestAnimationFrame(j)},fe=(le,he)=>{V=!0;const _=p(U);!y.value&&!$.value&&_&&(_.selected||S()),_&&ye(b)&&y.value&&hi(_,$.value,C,S,w,!1,he);const m=G(le.sourceEvent);if(N=m,x=Pf(r.value,d.value,m,U),x.length){const[k,A]=Uo({id:U,dragItems:x,findNode:p});z({event:le.sourceEvent,node:k,nodes:A})}},we=(le,he)=>{var _;le.sourceEvent.type==="touchmove"&&le.sourceEvent.touches.length>1||(K=!1,s.value===0&&fe(le,he),N=G(le.sourceEvent),E=((_=t.value)==null?void 0:_.getBoundingClientRect())||null,D=Je(le.sourceEvent,E))},ge=(le,he)=>{const _=G(le.sourceEvent);if(!ae&&V&&u.value&&(ae=!0,j()),!V){const m=_.xSnapped-(N.x??0),k=_.ySnapped-(N.y??0);Math.sqrt(m*m+k*k)>s.value&&fe(le,he)}(N.x!==_.xSnapped||N.y!==_.ySnapped)&&x.length&&V&&(I=le.sourceEvent,D=Je(le.sourceEvent,E),q(_))},be=le=>{let he=!1;if(!V&&!f.value&&!$.value){const _=le.sourceEvent,m=G(_),k=m.xSnapped-(N.x??0),A=m.ySnapped-(N.y??0),T=Math.sqrt(k*k+A*A);T!==0&&T<=s.value&&(X==null||X(_),he=!0)}if(x.length&&!he){K&&(v(x,!1,!1),K=!1);const[_,m]=Uo({id:U,dragItems:x,findNode:p});F({event:le.sourceEvent,node:_,nodes:m})}x=[],f.value=!1,ae=!1,V=!1,N={x:void 0,y:void 0},cancelAnimationFrame(ie)};return ve([()=>ye(Y),ne],([le,he],_,m)=>{if(he){const k=Ye(he);le||(g=Ec().on("start",A=>we(A,he)).on("drag",A=>ge(A,he)).on("end",A=>be(A)).filter(A=>{const T=A.target,ee=ye(P);return!A.button&&(!i.value||!Er(T,`.${i.value}`,he)&&(!ee||Er(T,ee,he)))}),k.call(g)),m(()=>{k.on(".drag",null),g&&(g.on("start",null),g.on("drag",null),g.on("end",null))})}}),f}function jf(){return{doubleClick:J(),click:J(),mouseEnter:J(),mouseMove:J(),mouseLeave:J(),contextMenu:J(),updateStart:J(),update:J(),updateEnd:J()}}function eh(e,t){const n=jf();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 th(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:o}=ke();return i=>{var r;const a=((r=o.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},s=Hf(i)?i.sourceEvent:i,{x:l,y:u}=Je(s,a),c=En({x:l,y:u},e.value),{x:d,y:h}=n.value?Mo(c,t.value):c;return{xSnapped:d,ySnapped:h,...c}}}function Ln(){return!0}function cs({handleId:e,nodeId:t,type:n,isValidConnection:o,edgeUpdaterType:i,onEdgeUpdate:r,onEdgeUpdateEnd:a}){const{id:s,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:h,nodesConnectable:p,autoPanOnConnect:$,autoPanSpeed:w,findNode:y,panBy:S,startConnection:C,updateConnection:v,endConnection:M,emits:z,viewport:L,edges:F,nodes:X,isValidConnection:ne,nodeLookup:Y}=ke();let U=null,b=!1,P=null;function f(g){var E;const N=ye(n)==="target",D=Vi(g),I=vr(g.target),V=g.currentTarget;if(V&&(D&&g.button===0||!D)){let K=function(re){_=Je(re,be),q=Uf(En(_,L.value,!1,[1,1]),c.value,Y.value,A),m||(k(),m=!0);const ce=kr(re,{handle:q,connectionMode:u.value,fromNodeId:ye(t),fromHandleId:ye(e),fromType:N?"target":"source",isValidConnection:G,doc:I,lib:"vue",flowId:s,nodeLookup:Y.value},F.value,X.value,y,Y.value);
26P=ce.handleDomNode,U=ce.connection,b=Wf(!!q,ce.isValid);const me={...se,isValid:b,to:ce.toHandle&&b?xn({x:ce.toHandle.x,y:ce.toHandle.y},L.value):_,toHandle:ce.toHandle,toPosition:b&&ce.toHandle?ce.toHandle.position:fi[A.position],toNode:ce.toHandle?Y.value.get(ce.toHandle.nodeId):null};if(b&&q&&(se!=null&&se.toHandle)&&me.toHandle&&se.toHandle.type===me.toHandle.type&&se.toHandle.nodeId===me.toHandle.nodeId&&se.toHandle.id===me.toHandle.id&&se.to.x===me.to.x&&se.to.y===me.to.y)return;const Ee=q??ce.toHandle;if(v(Ee&&b?xn({x:Ee.x,y:Ee.y},L.value):_,Ee,Gf(!!Ee,b)),se=me,!q&&!b&&!P)return Go(he);U&&U.source!==U.target&&P&&(Go(he),he=P,P.classList.add("connecting","vue-flow__handle-connecting"),P.classList.toggle("valid",!!b),P.classList.toggle("vue-flow__handle-valid",!!b))},ie=function(re){"touches"in re&&re.touches.length>0||((q||P)&&U&&b&&(r?r(re,U):z.connect(U)),z.connectEnd(re),i&&(a==null||a(re)),Go(he),cancelAnimationFrame(j),M(re),m=!1,b=!1,U=null,P=null,I.removeEventListener("mousemove",K),I.removeEventListener("mouseup",ie),I.removeEventListener("touchmove",K),I.removeEventListener("touchend",ie))};const ae=y(ye(t));let G=ye(o)||ne.value||Ln;!G&&ae&&(G=(N?ae.isValidSourcePos:ae.isValidTargetPos)||Ln);let q,j=0;const{x:fe,y:we}=Je(g),ge=is(ye(i),V),be=(E=l.value)==null?void 0:E.getBoundingClientRect();if(!be||!ge)return;const le=rs(ye(t),ge,ye(e),Y.value,u.value);if(!le)return;let he,_=Je(g,be),m=!1;const k=()=>{if(!$.value)return;const[re,ce]=ns(_,be,w.value);S({x:re,y:ce}),j=requestAnimationFrame(k)},A={...le,nodeId:ye(t),type:ge,position:le.position},T=Y.value.get(ye(t)),oe={inProgress:!0,isValid:null,from:jt(T,A,Q.Left,!0),fromHandle:A,fromPosition:A.position,fromNode:T,to:_,toHandle:null,toPosition:fi[A.position],toNode:null};C({nodeId:ye(t),id:ye(e),type:ge,position:(V==null?void 0:V.getAttribute("data-handlepos"))||Q.Top,..._},{x:fe-be.left,y:we-be.top}),z.connectStart({event:g,nodeId:ye(t),handleId:ye(e),handleType:ge});let se=oe;I.addEventListener("mousemove",K),I.addEventListener("mouseup",ie),I.addEventListener("touchmove",K),I.addEventListener("touchend",ie)}}function x(g){var E,N;if(!d.value)return;const D=ye(n)==="target";if(!h.value){z.clickConnectStart({event:g,nodeId:ye(t),handleId:ye(e)}),C({nodeId:ye(t),type:ye(n),id:ye(e),position:Q.Top,...Je(g)},void 0,!0);return}let I=ye(o)||ne.value||Ln;const V=y(ye(t));if(!I&&V&&(I=(D?V.isValidSourcePos:V.isValidTargetPos)||Ln),V&&(typeof V.connectable>"u"?p.value:V.connectable)===!1)return;const K=vr(g.target),ie=kr(g,{handle:{nodeId:ye(t),id:ye(e),type:ye(n),position:Q.Top,...Je(g)},connectionMode:u.value,fromNodeId:h.value.nodeId,fromHandleId:h.value.id??null,fromType:h.value.type,isValidConnection:I,doc:K,lib:"vue",flowId:s,nodeLookup:Y.value},F.value,X.value,y,Y.value),ae=((E=ie.connection)==null?void 0:E.source)===((N=ie.connection)==null?void 0:N.target);ie.isValid&&ie.connection&&!ae&&z.connect(ie.connection),z.clickConnectEnd(g),M(g,!0)}return{handlePointerDown:f,handleClick:x}}function nh(){return Lt(ss,"")}function ds(e){const t=e??nh()??"",n=Lt(ls,de(null)),{findNode:o,edges:i,emits:r}=ke(),a=o(t);return a||r.error(new De(Ie.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:a,parentNode:W(()=>o(a.parentNode)),connectedEdges:W(()=>Tt([a],i.value))}}function oh(){return{doubleClick:J(),click:J(),mouseEnter:J(),mouseMove:J(),mouseLeave:J(),contextMenu:J(),dragStart:J(),drag:J(),dragStop:J()}}function ih(e,t){const n=oh();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 fs(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:o,snapGrid:i,snapToGri
26d:r,nodesDraggable:a,emits:s}=ke();return(l,u=!1)=>{const c=r.value?i.value[0]:5,d=r.value?i.value[1]:5,h=u?4:1,p=l.x*c*h,$=l.y*d*h,w=[];for(const y of e.value)if(y.draggable||a&&typeof y.draggable>"u"){const S={x:y.computedPosition.x+p,y:y.computedPosition.y+$},{position:C}=Ri(y,S,s.error,t.value,y.parentNode?o(y.parentNode):void 0);w.push({id:y.id,position:C,from:y.position,distance:{x:l.x,y:l.y},dimensions:y.dimensions})}n(w,!0,!1)}}const Yn=.1,rh=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function ht(){return Dn("Viewport not initialized yet."),Promise.resolve(!1)}const ah={zoomIn:ht,zoomOut:ht,zoomTo:ht,fitView:ht,setCenter:ht,fitBounds:ht,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:ht,setTransform:ht,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function sh(e){function t(o,i){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((i==null?void 0:i.interpolate)==="linear"?gn:Jn).scaleBy(qo(e.d3Selection,i==null?void 0:i.duration,i==null?void 0:i.ease,()=>{r(!0)}),o):r(!1)})}function n(o,i,r,a){return new Promise(s=>{var l;const{x:u,y:c}=Za({x:-o,y:-i},e.translateExtent),d=Jt.translate(-u,-c).scale(r);e.d3Selection&&e.d3Zoom?(l=e.d3Zoom)==null||l.interpolate((a==null?void 0:a.interpolate)==="linear"?gn:Jn).transform(qo(e.d3Selection,a==null?void 0:a.duration,a==null?void 0:a.ease,()=>{s(!0)}),d):s(!1)})}return W(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:i=>t(1.2,i),zoomOut:i=>t(1/1.2,i),zoomTo:(i,r)=>new Promise(a=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((r==null?void 0:r.interpolate)==="linear"?gn:Jn).scaleTo(qo(e.d3Selection,r==null?void 0:r.duration,r==null?void 0:r.ease,()=>{a(!0)}),i):a(!1)}),setViewport:(i,r)=>n(i.x,i.y,i.zoom,r),setTransform:(i,r)=>n(i.x,i.y,i.zoom,r),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(i={padding:Yn,includeHiddenNodes:!1,duration:0})=>{var r,a;const s=[];for(const h of e.nodes)h.dimensions.width&&h.dimensions.height&&((i==null?void 0:i.includeHiddenNodes)||!h.hidden)&&(!((r=i.nodes)!=null&&r.length)||(a=i.nodes)!=null&&a.length&&i.nodes.includes(h.id))&&s.push(h);if(!s.length)return Promise.resolve(!1);const l=Oi(s),{x:u,y:c,zoom:d}=mr(l,e.dimensions.width,e.dimensions.height,i.minZoom??e.minZoom,i.maxZoom??e.maxZoom,i.padding??Yn);return n(u,c,d,i)},setCenter:(i,r,a)=>{const s=typeof(a==null?void 0:a.zoom)<"u"?a.zoom:e.maxZoom,l=e.dimensions.width/2-i*s,u=e.dimensions.height/2-r*s;return n(l,u,s,a)},fitBounds:(i,r={padding:Yn})=>{const{x:a,y:s,zoom:l}=mr(i,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding??Yn);return n(a,s,l,r)},project:i=>En(i,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:a}=e.vueFlowRef.getBoundingClientRect(),s={x:i.x-r,y:i.y-a};return En(s,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:i=>{if(e.vueFlowRef){const{x:r,y:a}=e.vueFlowRef.getBoundingClientRect(),s={x:i.x+r,y:i.y+a};return xn(s,e.viewport)}return{x:0,y:0}}}:ah)}function qo(e,t=0,n=rh,o=()=>{}){const i=typeof t=="number"&&t>0;return i||o(),i?e.transition().duration(t).ease(n).on("end",o):e}function lh(e,t,n){const o=aa(!0);return o.run(()=>{const i=()=>{o.run(()=>{let w,y,S=!!(n.nodes.value.length||n.edges.value.length);w=Xt([e.modelValue,()=>{var C,v;return(v=(C=e.modelValue)==null?void 0:C.value)==null?void 0:v.length}],([C])=>{C&&Array.isArray(C)&&(y==null||y.pause(),n.setElements(C),!y&&!S&&C.length?S=!0:y==null||y.resume())}),y=Xt([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([C,v])=>{var M;(M=e.modelValue)!=null&&M.value&&Array.isArray(e.modelValue.value)&&(w==null||w.pause(),e.modelValue.value=[...C,...v],ut(()=>{w==null||w.resume()}))},{immediate:S}),Kn(()=>{w==null||w.stop(),y==null||y.stop()})})},r=()=>{o.run(()=>{let w,y,S=!!n.nodes.value.length;w=Xt([e.nodes,()=>{var C,v;return(v=(C=e.nodes)==null?void 0:C.value)==null?void 0:v.length}],([C])=>{C&&Array.isArray(C)&&(y==null||y.pause(),n.setNodes(C),!y&&!S&&C.length?S=!0:y==null||y.resume())}),y=Xt([n.nodes,()=>n.nodes.value.length],([C])=>{var v;(v=e.nodes)!=null&&v.value&&Array.isArray(e.nodes.value)&&(w==null||w.pause(),e.nodes.value=[...C],ut(()=>{w==null||w.resume()}))},{immediate:S}),Kn(()=>{w==null||w.stop(),y==null||y.stop()})})},a=()=>{o.run(()=>{let w,y,S=!!n.edges.value.length;w=Xt([e.edges,()=>{var C,v;return(v=(C=e.edges)==null?void 0:C.value)==null?void 0:v.length}],([C])=>{C&&Array.isArray(C)&&(y==null||y.pause(),n.setEdges(C),!y&&!S&&C.length?S=!0:y==null||y.resume())}),y=Xt([n.edges,()=>n.edges.value.length],([C])=>{var v;(v=e.edges)!=null&&v.value&&Array.isArray(e.edges.value)&&(w==null||w.pause(),e.edges.value=[...C],ut(()=>{w==null||w.resume()}))},{immediate:S}),Kn(()=>{w==null||w.stop(),y==null||y.stop()})})},s=()=>{o.run(()=>{ve(()=>t.maxZoom,()=>{t.maxZoom&&Te(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{o.run(()=>{ve(()=>t.minZoom,()=>{t.minZoom&&Te(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{o.run(()=>{ve(()=>t.translateExtent,()=>{t.translateExtent&&Te(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{o.run(()=>{ve(()=>t.nodeExtent,()=>
26{t.nodeExtent&&Te(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{o.run(()=>{ve(()=>t.applyDefault,()=>{Te(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},h=()=>{o.run(()=>{const w=async y=>{let S=y;typeof t.autoConnect=="function"&&(S=await t.autoConnect(y)),S!==!1&&n.addEdges([S])};ve(()=>t.autoConnect,()=>{Te(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),ve(n.autoConnect,(y,S,C)=>{y?n.onConnect(w):n.hooks.value.connect.off(w),C(()=>{n.hooks.value.connect.off(w)})},{immediate:!0})})},p=()=>{const w=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const y of Object.keys(t)){const S=y;if(!w.includes(S)){const C=xe(()=>t[S]),v=n[S];Ei(v)&&o.run(()=>{ve(C,M=>{Te(M)&&(v.value=M)},{immediate:!0})})}}};(()=>{i(),r(),a(),l(),s(),u(),c(),d(),h(),p()})()}),()=>o.stop()}function uh(){return{edgesChange:J(),nodesChange:J(),nodeDoubleClick:J(),nodeClick:J(),nodeMouseEnter:J(),nodeMouseMove:J(),nodeMouseLeave:J(),nodeContextMenu:J(),nodeDragStart:J(),nodeDrag:J(),nodeDragStop:J(),nodesInitialized:J(),miniMapNodeClick:J(),miniMapNodeDoubleClick:J(),miniMapNodeMouseEnter:J(),miniMapNodeMouseMove:J(),miniMapNodeMouseLeave:J(),connect:J(),connectStart:J(),connectEnd:J(),clickConnectStart:J(),clickConnectEnd:J(),paneReady:J(),init:J(),move:J(),moveStart:J(),moveEnd:J(),selectionDragStart:J(),selectionDrag:J(),selectionDragStop:J(),selectionContextMenu:J(),selectionStart:J(),selectionEnd:J(),viewportChangeStart:J(),viewportChange:J(),viewportChangeEnd:J(),paneScroll:J(),paneClick:J(),paneContextMenu:J(),paneMouseEnter:J(),paneMouseMove:J(),paneMouseLeave:J(),edgeContextMenu:J(),edgeMouseEnter:J(),edgeMouseMove:J(),edgeMouseLeave:J(),edgeDoubleClick:J(),edgeClick:J(),edgeUpdateStart:J(),edgeUpdate:J(),edgeUpdateEnd:J(),updateNodeInternals:J(),error:J(e=>Dn(e.message))}}function ch(e,t){const n=nn();rl(()=>{for(const[i,r]of Object.entries(t.value)){const a=s=>{e(i,s)};r.setEmitter(a),yn(r.removeEmitter),r.setHasEmitListeners(()=>o(i)),yn(r.removeHasEmitListeners)}});function o(i){var r;const a=dh(i);return!!((r=n==null?void 0:n.vnode.props)==null?void 0:r[a])}}function dh(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(i,r)=>r.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function hs(){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:Bi.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:vn.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:Mt.Bezier,style:{}},connectionMode:$t.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:Nn()?"Meta":"Control",zoomActivationKeyCode:Nn()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:uh(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const fh=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function hh(e,t,n){const o=sh(e),i=_=>{const m=_??[];e.hooks.updateNodeInternals.trigger(m)},r=_=>Cf(_,e.nodes,e.edges),a=_=>kf(_,e.nodes,e.edges),s=_=>Tt(_,e.edges),l=({id:_,type:m,nodeId:k})=>{var A;const T=_?`-${m}-${_}`:`-${m}`;return Array.from(((A=e.connectionLookup.get(`${k}${T}`))==null?void 0:A.values())??[])},u=_=>{if(_)return t.value.get(_)},c=_=>{if(_)return n.value.get(_)},d=(_,m,k)=>{var A,T;const ee=[];for(const oe of _){const se={id:oe.id,type:"position",dragging:k,from:oe.from};if(m&&(se.position=oe.position,oe.parentNode)){const re=u(oe.parentNode);se.position={x:se.position.x-(((A=re==null?void 0:re.computedPosition)==null?void 0:A.x)??0),y:se.position.y-(((T=re==null?void 0:re.computedPosition)==null?void 0:T.y)??0)}}ee.push(se)}ee!=null&&ee.length&&e.hooks.nodesChange.trigger(ee)}
26,h=_=>{if(!e.vueFlowRef)return;const m=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!m)return;const k=window.getComputedStyle(m),{m22:A}=new window.DOMMatrixReadOnly(k.transform),T=[];for(const ee of _){const oe=ee,se=u(oe.id);if(se){const re=Co(oe.nodeElement);if(!!(re.width&&re.height&&(se.dimensions.width!==re.width||se.dimensions.height!==re.height||oe.forceUpdate))){const me=oe.nodeElement.getBoundingClientRect();se.dimensions=re,se.handleBounds.source=Cr("source",oe.nodeElement,me,A,se.id),se.handleBounds.target=Cr("target",oe.nodeElement,me,A,se.id),T.push({id:se.id,type:"dimensions",dimensions:re})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&o.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),T.length&&e.hooks.nodesChange.trigger(T)},p=(_,m)=>{const k=new Set,A=new Set;for(const oe of _)zt(oe)?k.add(oe.id):xt(oe)&&A.add(oe.id);const T=vt(t.value,k,!0),ee=vt(n.value,A);if(e.multiSelectionActive){for(const oe of k)T.push(pt(oe,m));for(const oe of A)ee.push(pt(oe,m))}T.length&&e.hooks.nodesChange.trigger(T),ee.length&&e.hooks.edgesChange.trigger(ee)},$=_=>{if(e.multiSelectionActive){const m=_.map(k=>pt(k.id,!0));e.hooks.nodesChange.trigger(m);return}e.hooks.nodesChange.trigger(vt(t.value,new Set(_.map(m=>m.id)),!0)),e.hooks.edgesChange.trigger(vt(n.value))},w=_=>{if(e.multiSelectionActive){const m=_.map(k=>pt(k.id,!0));e.hooks.edgesChange.trigger(m);return}e.hooks.edgesChange.trigger(vt(n.value,new Set(_.map(m=>m.id)))),e.hooks.nodesChange.trigger(vt(t.value,new Set,!0))},y=_=>{p(_,!0)},S=_=>{const k=(_||e.nodes).map(A=>(A.selected=!1,pt(A.id,!1)));e.hooks.nodesChange.trigger(k)},C=_=>{const k=(_||e.edges).map(A=>(A.selected=!1,pt(A.id,!1)));e.hooks.edgesChange.trigger(k)},v=_=>{if(!_||!_.length)return p([],!1);const m=_.reduce((k,A)=>{const T=pt(A.id,!1);return zt(A)?k.nodes.push(T):k.edges.push(T),k},{nodes:[],edges:[]});m.nodes.length&&e.hooks.nodesChange.trigger(m.nodes),m.edges.length&&e.hooks.edgesChange.trigger(m.edges)},M=_=>{var m;(m=e.d3Zoom)==null||m.scaleExtent([_,e.maxZoom]),e.minZoom=_},z=_=>{var m;(m=e.d3Zoom)==null||m.scaleExtent([e.minZoom,_]),e.maxZoom=_},L=_=>{var m;(m=e.d3Zoom)==null||m.translateExtent(_),e.translateExtent=_},F=_=>{e.nodeExtent=_,i()},X=_=>{var m;(m=e.d3Zoom)==null||m.clickDistance(_)},ne=_=>{e.nodesDraggable=_,e.nodesConnectable=_,e.elementsSelectable=_},Y=_=>{const m=_ instanceof Function?_(e.nodes):_;!e.initialized&&!m.length||(e.nodes=Mr(m,u,e.hooks.error.trigger))},U=_=>{const m=_ instanceof Function?_(e.edges):_;if(!e.initialized&&!m.length)return;const k=Zo(m,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Wo(e.connectionLookup,n.value,k),e.edges=k},b=_=>{const m=_ instanceof Function?_([...e.nodes,...e.edges]):_;!e.initialized&&!m.length||(Y(m.filter(zt)),U(m.filter(xt)))},P=_=>{let m=_ instanceof Function?_(e.nodes):_;m=Array.isArray(m)?m:[m];const k=Mr(m,u,e.hooks.error.trigger),A=[];for(const T of k)A.push(wr(T));A.length&&e.hooks.nodesChange.trigger(A)},f=_=>{let m=_ instanceof Function?_(e.edges):_;m=Array.isArray(m)?m:[m];const k=Zo(m,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),A=[];for(const T of k)A.push(wr(T));A.length&&e.hooks.edgesChange.trigger(A)},x=(_,m=!0,k=!1)=>{const A=_ instanceof Function?_(e.nodes):_,T=Array.isArray(A)?A:[A],ee=[],oe=[];function se(ce){const me=s(ce);for(const Ee of me)(!Te(Ee.deletable)||Ee.deletable)&&oe.push($r(Ee.id,Ee.source,Ee.target,Ee.sourceHandle,Ee.targetHandle))}function re(ce){const me=[];for(const Ee of e.nodes)Ee.parentNode===ce&&me.push(Ee);if(me.length){for(const Ee of me)ee.push(br(Ee.id));m&&se(me);for(const Ee of me)re(Ee.id)}}for(const ce of T){const me=typeof ce=="string"?u(ce):ce;me&&(Te(me.deletable)&&!me.deletable||(ee.push(br(me.id)),m&&se([me]),k&&re(me.id)))}oe.length&&e.hooks.edgesChange.trigger(oe),ee.length&&e.hooks.nodesChange.trigger(ee)},g=_=>{const m=_ instanceof Function?_(e.edges):_,k=Array.isArray(m)?m:[m],A=[];for(const T of k){const ee=typeof T=="string"?c(T):T;ee&&(Te(ee.deletable)&&!ee.deletable||A.push($r(typeof T=="string"?T:T.id,ee.source,ee.target,ee.sourceHandle,ee.targetHandle)))}e.hooks.edgesChange.trigger(A)},E=(_,m,k=!0)=>{const A=c(_.id);if(!A)return!1;const T=e.edges.indexOf(A),ee=Kf(_,m,A,k,e.hooks.error.trigger);if(ee){const[oe]=Zo([ee],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((se,re)=>re===T?oe:se),Wo(e.connectionLookup,n.value,[oe]),oe}return!1},N=(_,m,k={replace:!1})=>{const A=c(_);if(!A)return;const T=typeof m=="function"?m(A):m;A.data=k.replace?T:{...A.data,...T}},D=_=>_r(_,e.nodes),I=_=>{const m=_r(_,e.edges);return Wo(e.connectionLookup,n.value,m),m},V=(_,m,k={replace:!1})=>{const A=u(_);if(!A)return;const T=typeof m=="function"?m(A):m;k.replace?e.nodes.splice(e.nodes.indexOf(A),1,T):Object.assign(A,T)},K=(_,m,k={replace:!1})=>{const A=u(_);if(!A)return;const T=typeof m=="function"?m(A):m;A.data=k.replace?T:{...A.data,...T}},ie=(_,m,k=!1)=>{k?e.connectionClickStartHandle=_:e.connectionStartHandle=_,e.connectionEndHandle=null,e.connectionStatus=null,m&&(e.connectionPosition=m)},ae=(_,m=null,k=null)=>{e.connectionStartHandle&&(e.connectionPosition=_,e.connectionEndHandle=m,e.connectionStatus=k)},G=(_,m)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,m?e.connectionClickStartHandle=null:e.connectionStartHandle=null},q=_=>{const m=Sf(_),k=m?null:fn(_)?_:u(_.id);return!m&&!k?[null,null,m]:[m?_:go(k),k,m]},j=(_,m=!0,k=e.nodes)=>{const[A,T,ee]=q(_);if(!A)return[];const oe=[];for(const se of k||e.nodes){if(!ee&&(se.id===T.id||!se.computedPosition))continue;const re=go(se),ce=vo(re,A);(m&&ce>0||ce>=re.width*re.height||ce>=Number(A.width)*Number(A.height))&&oe.push(se)}return oe},fe=(_,m,k=!0)=>{const[A]=q(_);if(!A)return!1;const T=vo(A,m);return k&&T>0||T>=Number(A.width)*Number(A.height)},we=_=>{const{viewport:m,dimensions:k,d3Zoom:A,d3Selection:T,translateExtent:ee}=e;if(!A||!T||!_.x&&!_.y)return!1;const oe=Jt.translate(m.x+_.x,m.y+_.y).scale(m.zoom),se=[[0,0],[k.width,k.height]],re=A.constrain()(oe,se,ee),ce=e.viewport.x!==re.x||e.viewport.y!==re.y||e.viewport.zoom!==re.k;return A.transform(T,re),ce},ge=_=>{const m=_ instanceof Function?_(e):_,k=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Te(m.defaultEdgeOptions)&&(e.defaultEdgeOptions=m.defaultEdgeOptions);const A=m.modelValue||m.nodes||m.edges?[]:void 0;A&&(m.modelValue&&A.push(...m.modelValue),m.nodes&&A.push(...m.nodes),m.edges&&A.push(...m.edges),b(A));const T=()=>{Te(m.maxZoom)&&z(m.maxZoom),Te(m.minZoom)&&M(m.minZoom),Te(m.translateExtent)&&L(m.translateExtent)};for(const ee of Object.keys(m)){const oe=ee,se=m[oe];![...fh,...k].includes(oe)&&Te(se)&&(e[oe]=se)}ei(()=>e.d3Zoom).not.toBeNull().then(T),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:h,setElements:b,setNodes:Y,setE
26dges:U,addNodes:P,addEdges:f,removeNodes:x,removeEdges:g,findNode:u,findEdge:c,updateEdge:E,updateEdgeData:N,updateNode:V,updateNodeData:K,applyEdgeChanges:I,applyNodeChanges:D,addSelectedElements:y,addSelectedNodes:$,addSelectedEdges:w,setMinZoom:M,setMaxZoom:z,setTranslateExtent:L,setNodeExtent:F,setPaneClickDistance:X,removeSelectedElements:v,removeSelectedNodes:S,removeSelectedEdges:C,startConnection:ie,updateConnection:ae,endConnection:G,setInteractive:ne,setState:ge,getIntersectingNodes:j,getIncomers:r,getOutgoers:a,getConnectedEdges:s,getHandleConnections:l,isNodeIntersecting:fe,panBy:we,fitView:_=>o.value.fitView(_),zoomIn:_=>o.value.zoomIn(_),zoomOut:_=>o.value.zoomOut(_),zoomTo:(_,m)=>o.value.zoomTo(_,m),setViewport:(_,m)=>o.value.setViewport(_,m),setTransform:(_,m)=>o.value.setTransform(_,m),getViewport:()=>o.value.getViewport(),getTransform:()=>o.value.getTransform(),setCenter:(_,m,k)=>o.value.setCenter(_,m,k),fitBounds:(_,m)=>o.value.fitBounds(_,m),project:_=>o.value.project(_),screenToFlowCoordinate:_=>o.value.screenToFlowCoordinate(_),flowToScreenCoordinate:_=>o.value.flowToScreenCoordinate(_),toObject:()=>{const _=[],m=[];for(const k of e.nodes){const{computedPosition:A,handleBounds:T,selected:ee,dimensions:oe,isParent:se,resizing:re,dragging:ce,events:me,...Ee}=k;_.push(Ee)}for(const k of e.edges){const{selected:A,sourceNode:T,targetNode:ee,events:oe,...se}=k;m.push(se)}return JSON.parse(JSON.stringify({nodes:_,edges:m,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:_=>new Promise(m=>{const{nodes:k,edges:A,position:T,zoom:ee,viewport:oe}=_;k&&Y(k),A&&U(A);const[se,re]=oe!=null&&oe.x&&(oe!=null&&oe.y)?[oe.x,oe.y]:T??[null,null];if(se&&re){const ce=(oe==null?void 0:oe.zoom)||ee||e.viewport.zoom;return ei(()=>o.value.viewportInitialized).toBe(!0).then(()=>{o.value.setViewport({x:se,y:re,zoom:ce}).then(()=>{m(!0)})})}else m(!0)}),updateNodeInternals:i,viewportHelper:o,$reset:()=>{const _=hs();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const m=Jt.translate(_.defaultViewport.x??0,_.defaultViewport.y??0).scale(Ht(_.defaultViewport.zoom??1,_.minZoom,_.maxZoom)),k=e.viewportRef.getBoundingClientRect(),A=[[0,0],[k.width,k.height]],T=e.d3Zoom.constrain()(m,A,_.translateExtent);e.d3Zoom.transform(e.d3Selection,T)}ge(_)},$destroy:()=>{}}}const ph=["data-id","data-handleid","data-nodeid","data-handlepos"],gh={name:"Handle",compatConfig:{MODE:3}},Ae=ue({...gh,props:{id:{default:null},type:{},position:{default:()=>Q.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=ol(e,["position","connectable","connectableStart","connectableEnd","id"]),o=xe(()=>n.type??"source"),i=xe(()=>n.isValidConnection??null),{id:r,connectionStartHandle:a,connectionClickStartHandle:s,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:h}=ke(),{id:p,node:$,nodeEl:w,connectedEdges:y}=ds(),S=de(),C=xe(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),v=xe(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),M=xe(()=>{var U,b,P,f,x,g;return((U=a.value)==null?void 0:U.nodeId)===p&&((b=a.value)==null?void 0:b.id)===e.id&&((P=a.value)==null?void 0:P.type)===o.value||((f=l.value)==null?void 0:f.nodeId)===p&&((x=l.value)==null?void 0:x.id)===e.id&&((g=l.value)==null?void 0:g.type)===o.value}),z=xe(()=>{var U,b,P;return((U=s.value)==null?void 0:U.nodeId)===p&&((b=s.value)==null?void 0:b.id)===e.id&&((P=s.value)==null?void 0:P.type)===o.value}),{handlePointerDown:L,handleClick:F}=cs({nodeId:p,handleId:e.id,isValidConnection:i,type:o}),X=W(()=>typeof e.connectable=="string"&&e.connectable==="single"?!y.value.some(U=>{const b=U[`${o.value}Handle`];return U[o.value]!==p?!1:b?b===e.id:!0}):typeof e.connectable=="number"?y.value.filter(U=>{const b=U[`${o.value}Handle`];return U[o.value]!==p?!1:b?b===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable($,y.value):Te(e.connectable)?e.connectable:c.value);He(()=>{var U;if(!$.dimensions.width||!$.dimensions.height)return;const b=(U=$.handleBounds[o.value])==null?void 0:U.find(D=>D.id===e.id);if(!u.value||b)return;const P=u.value.querySelector(".vue-flow__transformationpane");if(!w.value||!S.value||!P||!e.id)return;const f=w.value.getBoundingClientRect(),x=S.value.getBoundingClientRect(),g=window.getComputedStyle(P),{m22:E}=new window.DOMMatrixReadOnly(g.transform),N={id:e.id,position:e.position,x:(x.left-f.left)/E,y:(x.top-f.to
26p)/E,type:o.value,nodeId:p,...Co(S.value)};$.handleBounds[o.value]=[...$.handleBounds[o.value]??[],N]});function ne(U){const b=Vi(U);X.value&&C.value&&(b&&U.button===0||!b)&&L(U)}function Y(U){!p||!s.value&&!C.value||X.value&&F(U)}return t({handleClick:F,handlePointerDown:L,onClick:Y,onPointerDown:ne}),(U,b)=>(O(),te("div",{ref_key:"handle",ref:S,"data-id":`${B(r)}-${B(p)}-${e.id}-${o.value}`,"data-handleid":e.id,"data-nodeid":B(p),"data-handlepos":U.position,class:bt(["vue-flow__handle",[`vue-flow__handle-${U.position}`,`vue-flow__handle-${e.id}`,B(d),B(h),o.value,{connectable:X.value,connecting:z.value,connectablestart:C.value,connectableend:v.value,connectionindicator:X.value&&(C.value&&!M.value||v.value&&M.value)}]]),onMousedown:ne,onTouchstartPassive:ne,onClick:Y},[Ce(U.$slots,"default",{id:U.id})],42,ph))}}),Io=function({sourcePosition:e=Q.Bottom,targetPosition:t=Q.Top,label:n,connectable:o=!0,isValidTargetPos:i,isValidSourcePos:r,data:a}){const s=a.label??n;return[Se(Ae,{type:"target",position:t,connectable:o,isValidConnection:i}),typeof s!="string"&&s?Se(s):Se(Ne,[s]),Se(Ae,{type:"source",position:e,connectable:o,isValidConnection:r})]};Io.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Io.inheritAttrs=!1;Io.compatConfig={MODE:3};const vh=Io,Ao=function({targetPosition:e=Q.Top,label:t,connectable:n=!0,isValidTargetPos:o,data:i}){const r=i.label??t;return[Se(Ae,{type:"target",position:e,connectable:n,isValidConnection:o}),typeof r!="string"&&r?Se(r):Se(Ne,[r])]};Ao.props=["targetPosition","label","isValidTargetPos","connectable","data"];Ao.inheritAttrs=!1;Ao.compatConfig={MODE:3};const mh=Ao,Do=function({sourcePosition:e=Q.Bottom,label:t,connectable:n=!0,isValidSourcePos:o,data:i}){const r=i.label??t;return[typeof r!="string"&&r?Se(r):Se(Ne,[r]),Se(Ae,{type:"source",position:e,connectable:n,isValidConnection:o})]};Do.props=["sourcePosition","label","isValidSourcePos","connectable","data"];Do.inheritAttrs=!1;Do.compatConfig={MODE:3};const yh=Do,_h=["transform"],wh=["width","height","x","y","rx","ry"],bh=["y"],$h={name:"EdgeText",compatConfig:{MODE:3}},xh=ue({...$h,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=de({x:0,y:0,width:0,height:0}),n=de(null),o=W(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);He(i),ve([()=>e.x,()=>e.y,n,()=>e.label],i);function i(){if(!n.value)return;const r=n.value.getBBox();(r.width!==t.value.width||r.height!==t.value.height)&&(t.value=r)}return(r,a)=>(O(),te("g",{transform:o.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(O(),te("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,wh)):$e("",!0),H("text",ao(r.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[Ce(r.$slots,"default",{},()=>[typeof r.label!="string"?(O(),pe(yt(r.label),{key:0})):(O(),te(Ne,{key:1},[Me(_e(r.label),1)],64))])],16,bh)],8,_h))}}),Eh=["id","d","marker-end","marker-start"],Sh=["d","stroke-width"],Nh={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Po=ue({...Nh,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=de(null),o=de(null),i=de(null),r=Si();return t({pathEl:n,interactionEl:o,labelEl:i}),(a,s)=>(O(),te(Ne,null,[H("path",ao(B(r),{id:a.id,ref_key:"pathEl",ref:n,d:a.path,class:"vue-flow__edge-path","marker-end":a.markerEnd,"marker-start":a.markerStart}),null,16,Eh),a.interactionWidth?(O(),te("path",{key:0,ref_key:"interactionEl",ref:o,fill:"none",d:a.path,"stroke-width":a.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,Sh)):$e("",!0),a.label&&a.labelX&&a.labelY?(O(),pe(xh,{key:1,ref_key:"labelEl",ref:i,x:a.labelX,y:a.labelY,label:a.label,"label-show-bg":a.labelShowBg,"label-bg-style":a.labelBgStyle,"label-bg-padding":a.labelBgPadding,"label-bg-border-radius":a.labelBgBorderRadius,"label-style":a.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):$e("",!0)],64))}});function ps({sourceX:e,sourceY:t,targetX:n,targetY:o}){const i=Math.abs(n-e)/2,r=n<e?n+i:n-i,a=Math.abs(o-t)/2,s=o<t?o+a:o-a;return[r,s,i,a]}function gs({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:i,sourceControlY:r,targetControlX:a,targetControlY:s}){const l=e*.125+i*.375+a*.375+n*.125,u=t*.125+r*.375+s*.375+o*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function Xn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}
26function Dr({pos:e,x1:t,y1:n,x2:o,y2:i,c:r}){let a,s;switch(e){case Q.Left:a=t-Xn(t-o,r),s=n;break;case Q.Right:a=t+Xn(o-t,r),s=n;break;case Q.Top:a=t,s=n-Xn(n-i,r);break;case Q.Bottom:a=t,s=n+Xn(i-n,r);break}return[a,s]}function zo(e){const{sourceX:t,sourceY:n,sourcePosition:o=Q.Bottom,targetX:i,targetY:r,targetPosition:a=Q.Top,curvature:s=.25}=e,[l,u]=Dr({pos:o,x1:t,y1:n,x2:i,y2:r,c:s}),[c,d]=Dr({pos:a,x1:i,y1:r,x2:t,y2:n,c:s}),[h,p,$,w]=gs({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${t},${n} C${l},${u} ${c},${d} ${i},${r}`,h,p,$,w]}function Pr({pos:e,x1:t,y1:n,x2:o,y2:i}){let r,a;switch(e){case Q.Left:case Q.Right:r=.5*(t+o),a=n;break;case Q.Top:case Q.Bottom:r=t,a=.5*(n+i);break}return[r,a]}function vs(e){const{sourceX:t,sourceY:n,sourcePosition:o=Q.Bottom,targetX:i,targetY:r,targetPosition:a=Q.Top}=e,[s,l]=Pr({pos:o,x1:t,y1:n,x2:i,y2:r}),[u,c]=Pr({pos:a,x1:i,y1:r,x2:t,y2:n}),[d,h,p,$]=gs({sourceX:t,sourceY:n,targetX:i,targetY:r,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${s},${l} ${u},${c} ${i},${r}`,d,h,p,$]}const zr={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}};function kh({source:e,sourcePosition:t=Q.Bottom,target:n}){return t===Q.Left||t===Q.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 Br(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Ch({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:o=Q.Top,center:i,offset:r}){const a=zr[t],s=zr[o],l={x:e.x+a.x*r,y:e.y+a.y*r},u={x:n.x+s.x*r,y:n.y+s.y*r},c=kh({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",h=c[d];let p,$,w;const y={x:0,y:0},S={x:0,y:0},[C,v,M,z]=ps({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*s[d]===-1){$=i.x??C,w=i.y??v;const F=[{x:$,y:l.y},{x:$,y:u.y}],X=[{x:l.x,y:w},{x:u.x,y:w}];a[d]===h?p=d==="x"?F:X:p=d==="x"?X:F}else{const F=[{x:l.x,y:u.y}],X=[{x:u.x,y:l.y}];if(d==="x"?p=a.x===h?X:F:p=a.y===h?F:X,t===o){const P=Math.abs(e[d]-n[d]);if(P<=r){const f=Math.min(r-1,r-P);a[d]===h?y[d]=(l[d]>e[d]?-1:1)*f:S[d]=(u[d]>n[d]?-1:1)*f}}if(t!==o){const P=d==="x"?"y":"x",f=a[d]===s[P],x=l[P]>u[P],g=l[P]<u[P];(a[d]===1&&(!f&&x||f&&g)||a[d]!==1&&(!f&&g||f&&x))&&(p=d==="x"?F:X)}const ne={x:l.x+y.x,y:l.y+y.y},Y={x:u.x+S.x,y:u.y+S.y},U=Math.max(Math.abs(ne.x-p[0].x),Math.abs(Y.x-p[0].x)),b=Math.max(Math.abs(ne.y-p[0].y),Math.abs(Y.y-p[0].y));U>=b?($=(ne.x+Y.x)/2,w=p[0].y):($=p[0].x,w=(ne.y+Y.y)/2)}return[[e,{x:l.x+y.x,y:l.y+y.y},...p,{x:u.x+S.x,y:u.y+S.y},n],$,w,M,z]}function Mh(e,t,n,o){const i=Math.min(Br(e,t)/2,Br(t,n)/2,o),{x:r,y:a}=t;if(e.x===r&&r===n.x||e.y===a&&a===n.y)return`L${r} ${a}`;if(e.y===a){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${r+i*u},${a}Q ${r},${a} ${r},${a+i*c}`}const s=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${r},${a+i*l}Q ${r},${a} ${r+i*s},${a}`}function pi(e){const{sourceX:t,sourceY:n,sourcePosition:o=Q.Bottom,targetX:i,targetY:r,targetPosition:a=Q.Top,borderRadius:s=5,centerX:l,centerY:u,offset:c=20}=e,[d,h,p,$,w]=Ch({source:{x:t,y:n},sourcePosition:o,target:{x:i,y:r},targetPosition:a,center:{x:l,y:u},offset:c});return[d.reduce((S,C,v)=>{let M;return v>
260&&v<d.length-1?M=Mh(d[v-1],C,d[v+1],s):M=`${v===0?"M":"L"}${C.x} ${C.y}`,S+=M,S},""),h,p,$,w]}function Th(e){const{sourceX:t,sourceY:n,targetX:o,targetY:i}=e,[r,a,s,l]=ps({sourceX:t,sourceY:n,targetX:o,targetY:i});return[`M ${t},${n}L ${o},${i}`,r,a,s,l]}const Ih=ue({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]=Th(e);return Se(Po,{path:n,labelX:o,labelY:i,...t,...e})}}}),Ah=Ih,Dh=ue({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=pi({...e,sourcePosition:e.sourcePosition??Q.Bottom,targetPosition:e.targetPosition??Q.Top});return Se(Po,{path:n,labelX:o,labelY:i,...t,...e})}}}),ms=Dh,Ph=ue({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>Se(ms,{...e,...t,borderRadius:0})}}),zh=Ph,Bh=ue({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=zo({...e,sourcePosition:e.sourcePosition??Q.Bottom,targetPosition:e.targetPosition??Q.Top});return Se(Po,{path:n,labelX:o,labelY:i,...t,...e})}}}),Oh=Bh,Rh=ue({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,o,i]=vs({...e,sourcePosition:e.sourcePosition??Q.Bottom,targetPosition:e.targetPosition??Q.Top});return Se(Po,{path:n,labelX:o,labelY:i,...t,...e})}}}),Vh=Rh,Hh={input:yh,default:vh,output:mh},Fh={default:Oh,straight:Ah,step:zh,smoothstep:ms,simplebezier:Vh};function Lh(e,t,n){const o=W(()=>w=>t.value.get(w)),i=W(()=>w=>n.value.get(w)),r=W(()=>{const w={...Fh,...e.edgeTypes},y=Object.keys(w);for(const S of e.edges)S.type&&!y.includes(S.type)&&(w[S.type]=S.type);return w}),a=W(()=>{const w={...Hh,...e.nodeTypes},y=Object.keys(w);for(const S of e.nodes)S.type&&!y.includes(S.type)&&(w[S.type]=S.type);return w}),s=W(()=>e.onlyRenderVisibleElements?es(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=W(()=>{if(e.onlyRenderVisibleElements){const w=[];for(const y of e.edges){const S=t.value.get(y.source),C=t.value.get(y.target);Rf({sourcePos:S.computedPosition||{x:0,y:0},targetPos:C.computedPosition||{x:0,y:0},sourceWidth:S.dimensions.width,sourceHeight:S.dimensions.height,targetWidth:C.dimensions.width,targetHeight:C.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&w.push(y)}return w}return e.edges}),u=W(()=>[...s.value,...l.value]),c=W(()=>{const w=[];for(const y of e.nodes)y.selected&&w.push(y);return w}),d=W(()=>{const w=[];for(const y of e.edges)y.selected&&w.push(y);return w}),h=W(()=>[...c.value,...d.value]),p=W(()=>{const w=[];for(const y of e.nodes)y.dimensions.width&&y.dimensions.height&&y.handleBounds!==void 0&&w.push(y);return w}),$=W(()=>s.value.length>0&&p.value.length===s.value.length);return{getNode:o,getEdge:i,getElements:u,getEdgeTypes:r,getNodeTypes:a,getEdges:l,getNodes:s,getSelectedElements:h,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:p,areNodesInitialized:$}}class It{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=nn())==null?void 0:t.appContext.app,o=(n==null?void 0:n.config.globalProperties.$vueFlowStorage)??It.instance;return It.instance=o??new It,n&&(n.config.globalProperties.$vueFlowStorage=It.instance),It.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=hs(),i=al(o),r={};for(const[h,p]of Object.entries(i.hooks)){const $=`on${h.charAt(0).toUpperCase()+h.slice(1)}`;r[$]=p.on}const a={};for(const[h,p]of Object.entries(i.hooks))a[h]=p.trigger;const s=W(()=>{const h=new Map;for(const p of i.nodes)h.set(p.id,p);return h}),l=W(()=>{const h=new Map;for(const p of i.edges)h.set(p.id,p);return h}),u=Lh(i,s,l),c=hh(i,s,l);c.setState({...i,...n});const d={...r,...u,...c,...Dl(i),nodeLookup:s,edgeLookup:l,emits:a,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}};return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}
26`}}function ke(e){const t=It.getInstance(),n=la(),o=typeof e=="object",i=o?e:{id:e},r=i.id,a=r??(n==null?void 0:n.vueFlowId);let s;if(n){const l=Lt(Ar,null);typeof l<"u"&&l!==null&&(!a||l.id===a)&&(s=l)}if(s||a&&(s=t.get(a)),!s||a&&s.id!==a){const l=r??t.getId(),u=t.create(l,i);s=u,(n??aa(!0)).run(()=>{ve(u.applyDefault,(d,h,p)=>{const $=y=>{u.applyNodeChanges(y)},w=y=>{u.applyEdgeChanges(y)};d?(u.onNodesChange($),u.onEdgesChange(w)):(u.hooks.value.nodesChange.off($),u.hooks.value.edgesChange.off(w)),p(()=>{u.hooks.value.nodesChange.off($),u.hooks.value.edgesChange.off(w)})},{immediate:!0}),yn(()=>{if(s){const d=t.get(s.id);d?d.$destroy():Dn(`No store instance found for id ${s.id} in storage.`)}})})}else o&&s.setState(i);if(n&&(Ot(Ar,s),n.vueFlowId=s.id),o){const l=nn();(l==null?void 0:l.type.name)!=="VueFlow"&&s.emits.error(new De(Ie.USEVUEFLOW_OPTIONS))}return s}function Yh(e){const{emits:t,dimensions:n}=ke();let o;He(()=>{const i=()=>{var r,a;if(!e.value||!(((a=(r=e.value).checkVisibility)==null?void 0:a.call(r))??!0))return;const s=Co(e.value);(s.width===0||s.height===0)&&t.error(new De(Ie.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:s.width||500,height:s.height||500}};i(),window.addEventListener("resize",i),e.value&&(o=new ResizeObserver(()=>i()),o.observe(e.value)),ua(()=>{window.removeEventListener("resize",i),o&&e.value&&o.unobserve(e.value)})})}const Xh={name:"UserSelection",compatConfig:{MODE:3}},Uh=ue({...Xh,props:{userSelectionRect:{}},setup(e){return(t,n)=>(O(),te("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))}}),Gh=["tabIndex"],Wh={name:"NodesSelection",compatConfig:{MODE:3}},Zh=ue({...Wh,setup(e){const{emits:t,viewport:n,getSelectedNodes:o,noPanClassName:i,disableKeyboardA11y:r,userSelectionActive:a}=ke(),s=fs(),l=de(null),u=us({el:l,onStart($){t.selectionDragStart($),t.nodeDragStart($)},onDrag($){t.selectionDrag($),t.nodeDrag($)},onStop($){t.selectionDragStop($),t.nodeDragStop($)}});He(()=>{var $;r.value||($=l.value)==null||$.focus({preventScroll:!0})});const c=W(()=>Oi(o.value)),d=W(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function h($){t.selectionContextMenu({event:$,nodes:o.value})}function p($){r.value||Zt[$.key]&&($.preventDefault(),s({x:Zt[$.key].x,y:Zt[$.key].y},$.shiftKey))}return($,w)=>!B(a)&&c.value.width&&c.value.height?(O(),te("div",{key:0,class:bt(["vue-flow__nodesselection vue-flow__container",B(i)]),style:ze({transform:`translate(${B(n).x}px,${B(n).y}px) scale(${B(n).zoom})`})},[H("div",{ref_key:"el",ref:l,class:bt([{dragging:B(u)},"vue-flow__nodesselection-rect"]),style:ze(d.value),tabIndex:B(r)?void 0:-1,onContextmenu:h,onKeydown:p},null,46,Gh)],6)):$e("",!0)}});function qh(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const Kh={name:"Pane",compatConfig:{MODE:3}},Qh=ue({...Kh,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:o,emits:i,userSelectionActive:r,removeSelectedElements:a,userSelectionRect:s,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:h,removeEdges:p,selectionMode:$,deleteKeyCode:w,multiSelectionKeyCode:y,multiSelectionActive:S,edgeLookup:C,nodeLookup:v,connectionLookup:M,defaultEdgeOptions:z,connectionStartHandle:L,panOnDrag:F}=ke(),X=wt(null),ne=wt(new Set),Y=wt(new Set),U=wt(null),b=xe(()=>l.value&&(e.isSelecting||r.value)),P=xe(()=>L.value!==null);let f=!1,x=!1;const g=mn(w,{actInsideInputWithModifier:!1}),E=mn(y);ve(g,G=>{G&&(h(d.value),p(c.value),u.value=!1)}),ve(E,G=>{S.value=G});function N(G,q){return j=>{j.target===q&&(G==null||G(j))}}function D(G){if(f||P.value){f=!1;return}i.paneClick(G),a(),u.value=!1}function I(G){var q;if(Array.isArray(F.value)&&((q=F.value)!=null&&q.includes(2))){G.preventDefault();return}i.paneContextMenu(G)}function V(G){i.paneScroll(G)}function K(G){var q,j,fe;if(U.value=((q=t.value)==null?void 0:q.getBoundingClientRect())??null,!l.value||!e.isSelecting||G.button!==0||G.target!==X.value||!U.value)return;(fe=(j=G.target)==null?void 0:j.setPointerCapture)==null||fe.call(j,G.pointerId);const{x:we,y:ge}=qh(G,U.value);x=!0,f=!1,a(),s.value={width:0,height:0,startX:we,startY:ge,x:we,y:ge},i.selectionStart(G)}function ie(G){var q;if(!U.value||!s.value)return;f=!0;const{x:j,y:fe}=Je(G,U.value),{startX:we=0,startY:ge=0}=s.value,be={startX:we,startY:ge,x:j<we?j:we,y:fe<ge?fe:ge,width:Math.abs(j-we),height:Math.abs(fe-ge)},le=ne.value,he=Y.value;ne.value=new Set(es(n.value,be,o.value,$.value===Bi.Partial,!0).map(m=>m.id)),Y.value=new Set;const _=((q=z.value)==null?void 0:q.selectable)??!0;for(const m of ne.value){const k=M.value.get(m);
26if(k)for(const{edgeId:A}of k.values()){const T=C.value.get(A);T&&(T.selectable??_)&&Y.value.add(A)}}if(!Ir(le,ne.value)){const m=vt(v.value,ne.value,!0);i.nodesChange(m)}if(!Ir(he,Y.value)){const m=vt(C.value,Y.value);i.edgesChange(m)}s.value=be,r.value=!0,u.value=!1}function ae(G){var q;G.button!==0||!x||((q=G.target)==null||q.releasePointerCapture(G.pointerId),!r.value&&s.value&&G.target===X.value&&D(G),r.value=!1,s.value=null,u.value=ne.value.size>0,i.selectionEnd(G),e.selectionKeyPressed&&(f=!1),x=!1)}return(G,q)=>(O(),te("div",{ref_key:"container",ref:X,class:bt(["vue-flow__pane vue-flow__container",{selection:G.isSelecting}]),onClick:q[0]||(q[0]=j=>b.value?void 0:N(D,X.value)(j)),onContextmenu:q[1]||(q[1]=j=>N(I,X.value)(j)),onWheelPassive:q[2]||(q[2]=j=>N(V,X.value)(j)),onPointerenter:q[3]||(q[3]=j=>b.value?void 0:B(i).paneMouseEnter(j)),onPointerdown:q[4]||(q[4]=j=>b.value?K(j):B(i).paneMouseMove(j)),onPointermove:q[5]||(q[5]=j=>b.value?ie(j):B(i).paneMouseMove(j)),onPointerup:q[6]||(q[6]=j=>b.value?ae(j):void 0),onPointerleave:q[7]||(q[7]=j=>B(i).paneMouseLeave(j))},[Ce(G.$slots,"default"),B(r)&&B(s)?(O(),pe(Uh,{key:0,"user-selection-rect":B(s)},null,8,["user-selection-rect"])):$e("",!0),B(u)&&B(d).length?(O(),pe(Zh,{key:1})):$e("",!0)],34))}}),Jh={name:"Transform",compatConfig:{MODE:3}},jh=ue({...Jh,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:o}=ke(),i=W(()=>n.value?!o.value:!1),r=W(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(a,s)=>(O(),te("div",{class:"vue-flow__transformationpane vue-flow__container",style:ze({transform:r.value,opacity:i.value?0:void 0})},[Ce(a.$slots,"default")],4))}}),ep={name:"Viewport",compatConfig:{MODE:3}},tp=ue({...ep,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:o,translateExtent:i,zoomActivationKeyCode:r,selectionKeyCode:a,panActivationKeyCode:s,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:h,zoomOnPinch:p,zoomOnScroll:$,preventScrolling:w,noWheelClassName:y,noPanClassName:S,emits:C,connectionStartHandle:v,userSelectionActive:M,paneDragging:z,d3Zoom:L,d3Selection:F,d3ZoomHandler:X,viewport:ne,viewportRef:Y,paneClickDistance:U}=ke();Yh(Y);const b=wt(!1),P=wt(!1);let f=null,x=!1,g=0,E={x:0,y:0,zoom:0};const N=mn(s),D=mn(a),I=mn(r),V=xe(()=>(!D.value||D.value&&a.value===!0)&&(N.value||d.value)),K=xe(()=>N.value||l.value),ie=xe(()=>a.value===!0&&V.value!==!0),ae=xe(()=>D.value&&a.value!==!0||M.value||ie.value),G=xe(()=>v.value!==null);He(()=>{if(!Y.value){Dn("Viewport element is missing");return}const ge=Y.value,be=ge.getBoundingClientRect(),le=yf().clickDistance(U.value).scaleExtent([t.value,n.value]).translateExtent(i.value),he=Ye(ge).call(le),_=he.on("wheel.zoom"),m=Jt.translate(o.value.x??0,o.value.y??0).scale(Ht(o.value.zoom??1,t.value,n.value)),k=[[0,0],[be.width,be.height]],A=le.constrain()(m,k,i.value);le.transform(he,A),le.wheelDelta(di),L.value=le,F.value=he,X.value=_,ne.value={x:A.x,y:A.y,zoom:A.k},le.on("start",T=>{var ee;if(!T.sourceEvent)return null;g=T.sourceEvent.button,b.value=!0;const oe=fe(T.transform);((ee=T.sourceEvent)==null?void 0:ee.type)==="mousedown"&&(z.value=!0),E=oe,C.viewportChangeStart(oe),C.moveStart({event:T,flowTransform:oe})}),le.on("end",T=>{if(!T.sourceEvent)return null;if(b.value=!1,z.value=!1,q(V.value,g??0)&&!x&&C.paneContextMenu(T.sourceEvent),x=!1,j(E,T.transform)){const ee=fe(T.transform);E=ee,C.viewportChangeEnd(ee),C.moveEnd({event:T,flowTransform:ee})}}),le.filter(T=>{var ee;const oe=I.value||$.value,se=p.value&&T.ctrlKey,re=T.button,ce=T.type==="wheel";if(re===1&&T.type==="mousedown"&&(we(T,"vue-flow__node")||we(T,"vue-flow__edge")))return!0;if(!V.value&&!oe&&!K.value&&!h.value&&!p.value||M.value||G.value&&!ce||!h.value&&T.type==="dblclick"||we(T,y.value)&&ce||we(T,S.value)&&(!ce||K.value&&ce&&!I.value)||!p.value&&T.ctrlKey&&ce||!oe&&!K.value&&!se&&ce)return!1;if(!p&&T.type==="touchstart"&&((ee=T.touches)==null?void 0:ee.length)>1)return T.preventDefault(),!1;if(!V.value&&(T.type==="mousedown"||T.type==="touchstart")||ie.value&&Array.isArray(d.value)&&d.value.includes(0)&&re===0||Array.isArray(d.value)&&!d.value.includes(re)&&(T.type==="mousedown"||T.type==="touchstart"))return!1;const me=Array.isArray(d.value)&&d.value.includes(re)||a.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!re||re<=1;return(!T.ctrlKey||N.value||ce)&&me}),ve([M,V],()=>{M.value&&!b.value?le.on("zoom",null):M.value||le.on("zoom",T=>{ne.value={x:T.transform.x,y:T.transform.y,zoom:T.transform.k};const ee=fe(T.transform);x=q(V.value,g??0),C.viewportChange(ee),C.move({event:T,flowTransform:ee})})},{immediate:!0}),ve([M,K,u,I,p,w,y],()=>{K.value&&!I.value&&!M.value?he.on("wheel.zoom",T=>{if(we(T,y.value))return!1;const ee=I.value||$.value,oe=p.value&&T.ctrlKey;if(!(!w.value||K.value||ee||oe))return!1;T.preventDefault(),T.stopImmediatePropagation();const re=he.property("__zoom").k||1,ce=Nn();if(!N.value&&T.ctrlKey&&p.value&&ce){const el=Ke(T),tl=di(T),nl=re*2**tl;le.scaleTo(he,nl,el,T);return}const me=T.deltaMode===1?20:1;let Ee=u.value===vn.Vertical?0:T.deltaX*me,ft=u.value===vn.Horizontal?0:T.deltaY*me;!ce&&T.shiftKey&&u.value!==vn.Vertical&&!Ee&&ft&&(Ee=ft,ft=0),le.translateBy(he,-(Ee/re)*c.value,-(ft/re)*c.value);const Ze=fe(he.property("__zoom"));f&&clearTimeout(f),P.value?(C.move({event:T,flowTransform:Ze}),C.viewportChange(Ze),f=setTimeout(()=>{C.moveEnd({event:T,flowTransform:Ze}),C.viewportChangeEnd(Ze),P.value=!1},150)):(P.value=!0,C.moveStart({event:T,flowTransform:Ze}),C.viewportChangeStart(Ze))},{passive:!1}):typeof _<"u"&&he.on("wheel.zoom",function(T,ee){const oe=!w.value&&T.type==="wheel"&&!T.ctrlKey,se=I.value||$.value,re=p.value&&T.ctrlKey;if(!se&&!l.value&&!re&&T.type==="wheel"||oe||we(T,y.value))return null;T.preventDefault(),_.call(this,T,ee)},{passive:!1})},{immediate:!0})});function q(ge,be){return be===2&&Array.isArray(ge)&&ge.includes(2)}function j(ge,be){return ge.x!==be.x&&!Number.isNaN(be.x)||ge.y!==be.y&&!Number.isNaN(be.y)||ge.zoom!==be.k&&!Number.isNaN(be.k)}function fe(ge){return{x:ge.x,y:ge.y,zoom:ge.k}}function we(ge,be){return ge.target.closest(`.${be}`)}return(ge,be)=>(O(),te("div",{ref_key:"viewportRef",ref:Y,class:"vue-flow__viewport vue-flow__container"},[R(Qh,{"is-selecting":ae.value,"selection-key-pressed":B(D),class:bt({connecting:G.value,dragging:B(z),draggable:B(d)===!0||Array.isArray(B(d))&&B(d).includes(0)})},{default:Z(()=>[R(jh,null,{default:Z(()=>[Ce(ge.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),np=["id"],op=["id"],ip=["id"],rp={name:"A11yDescriptions",compatConfig:{MODE:3}},ap=ue({...rp,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:o}=ke();return(i,r)=>(O(),te(Ne,null,[H("div",{id:`${B(Ua)}-${B(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+_e(B(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,np),H("div",{id:`${B(Ga)}-${B(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,op),B(n)?$e("",!0):(O(),te("div",{key:0,id:`${B(Ef)}-${B(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%)"}},_e(B(o)),9,ip))],64))}});function sp(){const e=ke();ve(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function lp(e,t,n){return n===Q.Left?e-t:n===Q.Right?e+t:e}function up(e,t,n){return n===Q.Top?e-t:n===Q.Bottom?e+t:e}
26const Hi=function({radius:e=10,centerX:t=0,centerY:n=0,position:o=Q.Top,type:i}){return Se("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${i}`,cx:lp(t,e,o),cy:up(n,e,o),r:e,stroke:"transparent",fill:"transparent"})};Hi.props=["radius","centerX","centerY","position","type"];Hi.compatConfig={MODE:3};const Or=Hi,cp=ue({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:o,edgeUpdaterRadius:i,emits:r,nodesSelectionActive:a,noPanClassName:s,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:h,multiSelectionActive:p,disableKeyboardA11y:$,elementsSelectable:w,edgesUpdatable:y,edgesFocusable:S,hooks:C}=ke(),v=W(()=>c(e.id)),{emit:M,on:z}=eh(v.value,r),L=Lt(To),F=nn(),X=de(!1),ne=de(!1),Y=de(""),U=de(null),b=de("source"),P=de(null),f=xe(()=>typeof v.value.selectable>"u"?w.value:v.value.selectable),x=xe(()=>typeof v.value.updatable>"u"?y.value:v.value.updatable),g=xe(()=>typeof v.value.focusable>"u"?S.value:v.value.focusable);Ot(Qf,e.id),Ot(Jf,P);const E=W(()=>v.value.class instanceof Function?v.value.class(v.value):v.value.class),N=W(()=>v.value.style instanceof Function?v.value.style(v.value):v.value.style),D=W(()=>{const m=v.value.type||"default",k=L==null?void 0:L[`edge-${m}`];if(k)return k;let A=v.value.template??l.value[m];if(typeof A=="string"&&F){const T=Object.keys(F.appContext.components);T&&T.includes(m)&&(A=ca(m,!1))}return A&&typeof A!="string"?A:(r.error(new De(Ie.EDGE_TYPE_MISSING,A)),!1)}),{handlePointerDown:I}=cs({nodeId:Y,handleId:U,type:b,isValidConnection:h,edgeUpdaterType:b,onEdgeUpdate:ie,onEdgeUpdateEnd:ae});return()=>{const m=d(v.value.source),k=d(v.value.target),A="pathOptions"in v.value?v.value.pathOptions:{};if(!m&&!k)return r.error(new De(Ie.EDGE_SOURCE_TARGET_MISSING,v.value.id,v.value.source,v.value.target)),null;if(!m)return r.error(new De(Ie.EDGE_SOURCE_MISSING,v.value.id,v.value.source)),null;if(!k)return r.error(new De(Ie.EDGE_TARGET_MISSING,v.value.id,v.value.target)),null;if(!v.value||v.value.hidden||m.hidden||k.hidden)return null;let T;o.value===$t.Strict?T=m.handleBounds.source:T=[...m.handleBounds.source||[],...m.handleBounds.target||[]];const ee=Sr(T,v.value.sourceHandle);let oe;o.value===$t.Strict?oe=k.handleBounds.target:oe=[...k.handleBounds.target||[],...k.handleBounds.source||[]];const se=Sr(oe,v.value.targetHandle),re=(ee==null?void 0:ee.position)||Q.Bottom,ce=(se==null?void 0:se.position)||Q.Top,{x:me,y:Ee}=jt(m,ee,re),{x:ft,y:Ze}=jt(k,se,ce);return v.value.sourceX=me,v.value.sourceY=Ee,v.value.targetX=ft,v.value.targetY=Ze,Se("g",{ref:P,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${D.value===!1?"default":v.value.type||"default"}`,s.value,E.value,{updating:X.value,selected:v.value.selected,animated:v.value.animated,inactive:!f.value&&!C.value.edgeClick.hasListeners()}],tabIndex:g.value?0:void 0,"aria-label":v.value.ariaLabel===null?void 0:v.value.ariaLabel??`Edge from ${v.value.source} to ${v.value.target}`,"aria-describedby":g.value?`${Ga}-${t}`:void 0,"aria-roledescription":"edge",role:g.value?"group":"img",...v.value.domAttributes,onClick:q,onContextmenu:j,onDblclick:fe,onMouseenter:we,onMousemove:ge,onMouseleave:be,onKeyDown:g.value?_:void 0},[ne.value?null:Se(D.value===!1?l.value.default:D.value,{id:e.id,sourceNode:m,targetNode:k,source:v.value.source,target:v.value.target,type:v.value.type,updatable:x.value,selected:v.value.selected,animated:v.value.animated,label:v.value.label,labelStyle:v.value.labelStyle,labelShowBg:v.value.labelShowBg,labelBgStyle:v.value.labelBgStyle,labelBgPadding:v.value.labelBgPadding,labelBgBorderRadius:v.value.labelBgBorderRadius,data:v.value.data,events:{...v.value.events,...z},style:N.value,markerStart:`url('#${Sn(v.value.markerStart,t)}')`,markerEnd:`url('#${Sn(v.value.markerEnd,t)}')`,sourcePosition:re,targetPosition:ce,sourceX:me,sourceY:Ee,targetX:ft,targetY:Ze,sourceHandleId:v.value.sourceHandle,targetHandleId:v.value.targetHandle,interactionWidth:v.value.interactionWidth,...A}),[x.value==="source"||x.value===!0?[Se("g",{onMousedown:le,onMouseenter:V,onMouseout:K}
26,Se(Or,{position:re,centerX:me,centerY:Ee,radius:i.value,type:"source","data-type":"source"}))]:null,x.value==="target"||x.value===!0?[Se("g",{onMousedown:he,onMouseenter:V,onMouseout:K},Se(Or,{position:ce,centerX:ft,centerY:Ze,radius:i.value,type:"target","data-type":"target"}))]:null]])};function V(){X.value=!0}function K(){X.value=!1}function ie(m,k){M.update({event:m,edge:v.value,connection:k})}function ae(m){M.updateEnd({event:m,edge:v.value}),ne.value=!1}function G(m,k){m.button===0&&(ne.value=!0,Y.value=k?v.value.target:v.value.source,U.value=(k?v.value.targetHandle:v.value.sourceHandle)??null,b.value=k?"target":"source",M.updateStart({event:m,edge:v.value}),I(m))}function q(m){var k;const A={event:m,edge:v.value};f.value&&(a.value=!1,v.value.selected&&p.value?(u([v.value]),(k=P.value)==null||k.blur()):n([v.value])),M.click(A)}function j(m){M.contextMenu({event:m,edge:v.value})}function fe(m){M.doubleClick({event:m,edge:v.value})}function we(m){M.mouseEnter({event:m,edge:v.value})}function ge(m){M.mouseMove({event:m,edge:v.value})}function be(m){M.mouseLeave({event:m,edge:v.value})}function le(m){G(m,!0)}function he(m){G(m,!1)}function _(m){var k;!$.value&&Wa.includes(m.key)&&f.value&&(m.key==="Escape"?((k=P.value)==null||k.blur(),u([c(e.id)])):n([c(e.id)]))}}}),dp=cp,fp=ue({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:o,connectionEndHandle:i,connectionPosition:r,connectionLineType:a,connectionLineStyle:s,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:d}=ke(),h=(e=Lt(To))==null?void 0:e["connection-line"],p=W(()=>{var C;return d((C=o.value)==null?void 0:C.nodeId)}),$=W(()=>{var C;return d((C=i.value)==null?void 0:C.nodeId)??null}),w=W(()=>({x:(r.value.x-c.value.x)/c.value.zoom,y:(r.value.y-c.value.y)/c.value.zoom})),y=W(()=>l.value.markerStart?`url(#${Sn(l.value.markerStart,t)})`:""),S=W(()=>l.value.markerEnd?`url(#${Sn(l.value.markerEnd,t)})`:"");return()=>{var C,v,M;if(!p.value||!o.value)return null;const z=o.value.id,L=o.value.type,F=p.value.handleBounds;let X=(F==null?void 0:F[L])??[];if(n.value===$t.Loose){const N=(F==null?void 0:F[L==="source"?"target":"source"])??[];X=[...X,...N]}if(!X)return null;const ne=(z?X.find(N=>N.id===z):X[0])??null,Y=(ne==null?void 0:ne.position)??Q.Top,{x:U,y:b}=jt(p.value,ne,Y);let P=null;$.value&&(n.value===$t.Strict?P=((C=$.value.handleBounds[L==="source"?"target":"source"])==null?void 0:C.find(N=>{var D;return N.id===((D=i.value)==null?void 0:D.id)}))||null:P=((v=[...$.value.handleBounds.source??[],...$.value.handleBounds.target??[]])==null?void 0:v.find(N=>{var D;return N.id===((D=i.value)==null?void 0:D.id)}))||null);const f=((M=i.value)==null?void 0:M.position)??(Y?fi[Y]:null);if(!Y||!f)return null;const x=a.value??l.value.type??Mt.Bezier;let g="";const E={sourceX:U,sourceY:b,sourcePosition:Y,targetX:w.value.x,targetY:w.value.y,targetPosition:f};return x===Mt.Bezier?[g]=zo(E):x===Mt.Step?[g]=pi({...E,borderRadius:0}):x===Mt.SmoothStep?[g]=pi(E):x===Mt.SimpleBezier?[g]=vs(E):g=`M${U},${b} ${w.value.x},${w.value.y}`,Se("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},Se("g",{class:"vue-flow__connection"},h?Se(h,{sourceX:U,sourceY:b,sourcePosition:Y,targetX:w.value.x,targetY:w.value.y,targetPosition:f,sourceNode:p.value,sourceHandle:ne,targetNode:$.value,targetHandle:P,markerEnd:S.value,markerStart:y.value,connectionStatus:u.value}):Se("path",{d:g,class:[l.value.class,u.value,"vue-flow__connection-path"],style:{...s.value,...l.value.style},"marker-end":S.value,"marker-start":y.value})))}}}),hp=fp,pp=["id","markerWidth","markerHeight","markerUnits","orient"],gp={name:"MarkerType",compatConfig:{MODE:3}},vp=ue({...gp,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)=>(O(),te("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===B(ui).ArrowClosed?(O(),te("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)):$e("",!0),t.type===B(ui).Arrow?(O(),te("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)):$e("",!0)],8,pp))}}),mp={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},yp={name:"MarkerDefinitions",compatConfig:{MODE:3}},_p=ue({...yp,setup(e){const{id:t,edges:n,connectionLineOptions:o,defaultMarkerColor:i}=ke(),r=W(()=>{const a=new Set,s=[],l=u=>{if(u){const c=Sn(u,t);a.has(c)||(typeof u=="object"?s.push({...u,id:c,color:u.color||i.value}):s.push({id:c,color:i.value,type:u}),a.add(c))}};for(const u of[o.value.markerEnd,o.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return s.sort((u,c)=>u.id.localeCompare(c.id))});return(a,s)=>(O(),te("svg",mp,[H("defs",null,[(O(!0),te(Ne,null,Le(r.value,l=>(O(),pe(vp,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),wp={name:"Edges",compatConfig:{MODE:3}},bp=ue({...wp,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:o}=ke();return(i,r)=>(O(),te(Ne,null,[R(_p),(O(!0),te(Ne,null,Le(B(n),a=>(O(),te("svg",{key:a.id,class:"vue-flow__edges vue-flow__container",style:ze({zIndex:B(Vf)(a,B(t),B(o))})},[R(B(dp),{id:a.id},null,8,["id"])],4))),128)),R(B(hp))],64))}}),$p=ue({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:o,nodesSelectionActive:i,multiSelectionActive:r,emits:a,removeSelectedNodes:s,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:h,elevateNodesOnSelect:p,disableKeyboardA11y:$,ariaLiveMessage:w,snapToGri
26d:y,snapGrid:S,nodeDragThreshold:C,nodesDraggable:v,elementsSelectable:M,nodesConnectable:z,nodesFocusable:L,hooks:F}=ke(),X=de(null);Ot(ls,X),Ot(ss,e.id);const ne=Lt(To),Y=nn(),U=fs(),{node:b,parentNode:P}=ds(e.id),{emit:f,on:x}=ih(b,a),g=xe(()=>typeof b.draggable>"u"?v.value:b.draggable),E=xe(()=>typeof b.selectable>"u"?M.value:b.selectable),N=xe(()=>typeof b.connectable>"u"?z.value:b.connectable),D=xe(()=>typeof b.focusable>"u"?L.value:b.focusable),I=W(()=>E.value||g.value||F.value.nodeClick.hasListeners()||F.value.nodeDoubleClick.hasListeners()||F.value.nodeMouseEnter.hasListeners()||F.value.nodeMouseMove.hasListeners()||F.value.nodeMouseLeave.hasListeners()),V=xe(()=>!!b.dimensions.width&&!!b.dimensions.height),K=W(()=>{const k=b.type||"default",A=ne==null?void 0:ne[`node-${k}`];if(A)return A;let T=b.template||d.value[k];if(typeof T=="string"&&Y){const ee=Object.keys(Y.appContext.components);ee&&ee.includes(k)&&(T=ca(k,!1))}return T&&typeof T!="string"?T:(a.error(new De(Ie.NODE_TYPE_MISSING,T)),!1)}),ie=us({id:e.id,el:X,disabled:()=>!g.value,selectable:E,dragHandle:()=>b.dragHandle,onStart(k){f.dragStart(k)},onDrag(k){f.drag(k)},onStop(k){f.dragStop(k)},onClick(k){_(k)}}),ae=W(()=>b.class instanceof Function?b.class(b):b.class),G=W(()=>{const k=(b.style instanceof Function?b.style(b):b.style)||{},A=b.width instanceof Function?b.width(b):b.width,T=b.height instanceof Function?b.height(b):b.height;return!k.width&&A&&(k.width=typeof A=="string"?A:`${A}px`),!k.height&&T&&(k.height=typeof T=="string"?T:`${T}px`),k}),q=xe(()=>Number(b.zIndex??G.value.zIndex??0));return c(k=>{(k.includes(e.id)||!k.length)&&fe()}),He(()=>{ve(()=>b.hidden,(k=!1,A,T)=>{!k&&X.value&&(e.resizeObserver.observe(X.value),T(()=>{X.value&&e.resizeObserver.unobserve(X.value)}))},{immediate:!0,flush:"post"})}),ve([()=>b.type,()=>b.sourcePosition,()=>b.targetPosition],()=>{ut(()=>{u([{id:e.id,nodeElement:X.value,forceUpdate:!0}])})}),ve([()=>b.position.x,()=>b.position.y,()=>{var k;return(k=P.value)==null?void 0:k.computedPosition.x},()=>{var k;return(k=P.value)==null?void 0:k.computedPosition.y},()=>{var k;return(k=P.value)==null?void 0:k.computedPosition.z},q,()=>b.selected,()=>b.dimensions.height,()=>b.dimensions.width,()=>{var k;return(k=P.value)==null?void 0:k.dimensions.height},()=>{var k;return(k=P.value)==null?void 0:k.dimensions.width}],([k,A,T,ee,oe,se])=>{const re={x:k,y:A,z:se+(p.value&&b.selected?1e3:0)};typeof T<"u"&&typeof ee<"u"?b.computedPosition=Df({x:T,y:ee,z:oe},re):b.computedPosition=re},{flush:"post",immediate:!0}),ve([()=>b.extent,h],([k,A],[T,ee])=>{(k!==T||A!==ee)&&j()}),b.extent==="parent"||typeof b.extent=="object"&&"range"in b.extent&&b.extent.range==="parent"?ei(()=>V).toBe(!0).then(j):j(),()=>b.hidden?null:Se("div",{ref:X,"data-id":b.id,class:["vue-flow__node",`vue-flow__node-${K.value===!1?"default":b.type||"default"}`,{[n.value]:g.value,dragging:ie==null?void 0:ie.value,draggable:g.value,selected:b.selected,selectable:E.value,parent:b.isParent},ae.value],style:{visibility:V.value?"visible":"hidden",zIndex:b.computedPosition.z??q.value,transform:`translate(${b.computedPosition.x}px,${b.computedPosition.y}px)`,pointerEvents:I.value?"all":"none",...G.value},tabIndex:D.value?0:void 0,role:D.value?"group":void 0,"aria-describedby":$.value?void 0:`${Ua}-${t}`,"aria-label":b.ariaLabel,"aria-roledescription":"node",...b.domAttributes,onMouseenter:we,onMousemove:ge,onMouseleave:be,onContextmenu:le,onClick:_,onDblclick:he,onKeydown:m},[Se(K.value===!1?d.value.default:K.value,{id:b.id,type:b.type,data:b.data,events:{...b.events,...x},selected:b.selected,resizing:b.resizing,dragging:ie.value,connectable:N.value,position:b.computedPosition,dimensions:b.dimensions,isValidTargetPos:b.isValidTargetPos,isValidSourcePos:b.isValidSourcePos,parent:b.parentNode,parentNodeId:b.parentNode,zIndex:b.computedPosition.z??q.value,targetPosition:b.targetPosition,sourcePosition:b.sourcePosition,label:b.label,dragHandle:b.dragHandle,onUpdateNodeInternals:fe})]);function j(){const k=b.computedPosition,{computedPosition:A,position:T}=Ri(b,y.value?Mo(k,S.value):k,a.error,h.value,P.value);(b.computedPosition.x!==A.x||b.computedPosition.y!==A.y)&&(b.computedPosition={...b.computedPosition,...A}),(b.position.x!==T.x||b.position.y!==T.y)&&(b.position=T)}function fe(){X.value&&u([{id:e.id,nodeElement:X.value,forceUpdate:!0}])}function we(k){ie!=null&&ie.value||f.mouseEnter({event:k,node:b})}function ge(k){ie!=null&&ie.value||f.mouseMove({event:k,node:b})}function be(k){ie!=null&&ie.value||f.mouseLeave({event:k,node:b})}function le(k){return f.contextMenu({event:k,node:b})}function he(k){return f.doubleClick({event:k,node:b})}function _(k){E.value&&(!o.value||!g.value||C.value>0)&&hi(b,r.value,l,s,i,!1,X.value),f.click({event:k,node:b})}function m(k){if(!(ci(k)||$.value))if(Wa.includes(k.key)&&E.value){const A=k.key==="Escape";hi(b,r.value,l,s,i,A,X.value)}else g.value&&b.selected&&Zt[k.key]&&(k.preventDefault(),w.value=`Moved selected node ${k.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~b.position.x}, y: ${~~b.position.y}`,U({x:Zt[k.key].x,y:Zt[k.key].y}
26,k.shiftKey))}}}),xp=$p;function Ep(e={includeHiddenNodes:!1}){const{nodes:t}=ke();return W(()=>{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 Sp={class:"vue-flow__nodes vue-flow__container"},Np={name:"Nodes",compatConfig:{MODE:3}},kp=ue({...Np,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:o}=ke(),i=Ep(),r=de();return ve(i,a=>{a&&ut(()=>{o.nodesInitialized(t.value)})},{immediate:!0}),He(()=>{r.value=new ResizeObserver(a=>{const s=a.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));ut(()=>n(s))})}),ua(()=>{var a;return(a=r.value)==null?void 0:a.disconnect()}),(a,s)=>(O(),te("div",Sp,[r.value?(O(!0),te(Ne,{key:0},Le(B(t),(l,u,c,d)=>{const h=[l.id];if(d&&d.key===l.id&&sl(d,h))return d;const p=(O(),pe(B(xp),{id:l.id,key:l.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return p.memo=h,p},s,0),128)):$e("",!0)]))}});function Cp(){const{emits:e}=ke();He(()=>{if(as()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new De(Ie.MISSING_STYLES))}})}const Mp=H("div",{class:"vue-flow__edge-labels"},null,-1),Tp={name:"VueFlow",compatConfig:{MODE:3}},Ip=ue({...Tp,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const o=e,i=sa(),r=Vo(o,"modelValue",n),a=Vo(o,"nodes",n),s=Vo(o,"edges",n),l=ke(o),u=lh({modelValue:r,nodes:a,edges:s},o,l);return ch(n,l.hooks),sp(),Cp(),Ot(To,i),il(u),t(l),(c,d)=>(O(),te("div",{ref:B(l).vueFlowRef,class:"vue-flow"},[R(tp,null,{default:Z(()=>[R(bp),Mp,R(kp),Ce(c.$slots,"zoom-pane")]),_:3}),Ce(c.$slots,"default"),R(ap)],512))}}),Ap={name:"Panel",compatConfig:{MODE:3}},ys=ue({...Ap,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=ke(),o=W(()=>`${t.position}`.split("-"));return(i,r)=>(O(),te("div",{class:bt(["vue-flow__panel",o.value]),style:ze({pointerEvents:B(n)?"none":"all"})},[Ce(i.$slots,"default")],6))}});var st=(e=>(e.Lines="lines",e.Dots="dots",e))(st||{});const _s=function({dimensions:e,size:t,color:n}){return Se("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}
26,ws=function({radius:e,color:t}){return Se("circle",{cx:e,cy:e,r:e,fill:t})};st.Lines+"",st.Dots+"";const Dp={[st.Dots]:"#81818a",[st.Lines]:"#eee"},Pp=["id","x","y","width","height","patternTransform"],zp={key:2,height:"100",width:"100"},Bp=["fill"],Op=["x","y","fill"],Rp={name:"Background",compatConfig:{MODE:3}},Vp=ue({...Rp,props:{id:{},variant:{default:()=>st.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=ke(),o=W(()=>{const a=n.value.zoom,[s,l]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],u=[s*a||1,l*a||1],c=e.size*a,[d,h]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],p=[d*a||1+u[0]/2,h*a||1+u[1]/2];return{scaledGap:u,offset:p,size:c}}),i=xe(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),r=xe(()=>e.color||e.patternColor||Dp[e.variant||st.Dots]);return(a,s)=>(O(),te("svg",{class:"vue-flow__background vue-flow__container",style:ze({height:`${a.height>100?100:a.height}%`,width:`${a.width>100?100:a.width}%`})},[Ce(a.$slots,"pattern-container",{id:i.value},()=>[H("pattern",{id:i.value,x:B(n).x%o.value.scaledGap[0],y:B(n).y%o.value.scaledGap[1],width:o.value.scaledGap[0],height:o.value.scaledGap[1],patternTransform:`translate(-${o.value.offset[0]},-${o.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[Ce(a.$slots,"pattern",{},()=>[a.variant===B(st).Lines?(O(),pe(B(_s),{key:0,size:a.lineWidth,color:r.value,dimensions:o.value.scaledGap},null,8,["size","color","dimensions"])):a.variant===B(st).Dots?(O(),pe(B(ws),{key:1,color:r.value,radius:o.value.size/2},null,8,["color","radius"])):$e("",!0),a.bgColor?(O(),te("svg",zp,[H("rect",{width:"100%",height:"100%",fill:a.bgColor},null,8,Bp)])):$e("",!0)])],8,Pp)]),H("rect",{x:a.x,y:a.y,width:"100%",height:"100%",fill:`url(#${i.value})`},null,8,Op),Ce(a.$slots,"default",{id:i.value})],4))}}),Hp={name:"ControlButton",compatConfig:{MODE:3}},Fp=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},Lp={type:"button",class:"vue-flow__controls-button"};function Yp(e,t,n,o,i,r){return O(),te("button",Lp,[Ce(e.$slots,"default")])}const Un=Fp(Hp,[["render",Yp]]),Xp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Up=H("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1),Gp=[Up];function Wp(e,t){return O(),te("svg",Xp,Gp)}const Zp={render:Wp},qp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Kp=H("path",{d:"M0 0h32v4.2H0z"},null,-1),Qp=[Kp];function Jp(e,t){return O(),te("svg",qp,Qp)}const jp={render:Jp},eg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},tg=H("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1),ng=[tg];function og(e,t){return O(),te("svg",eg,ng)}const ig={render:og},rg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ag=H("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1),sg=[ag];function lg(e,t){return O(),te("svg",rg,sg)}const ug={render:lg},cg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},dg=H("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1),fg=[dg];function hg(e,t){return O(),te("svg",cg,fg)}const pg={render:hg},gg={name:"Controls",compatConfig:{MODE:3}},vg=ue({...gg,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>Xa.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:n,nodesConnectable:o,elementsSelectable:i,setInteractive:r,zoomIn:a,zoomOut:s,fitView:l,viewport:u,minZoom:c,maxZoom:d}=ke(),h=xe(()=>n.value||o.value||i.value),p=xe(()=>u.value.zoom<=c.value),$=xe(()=>u.value.zoom>=d.value);function w(){a(),t("zoomIn")}function y(){s(),t("zoomOut")}function S(){l(e.fitViewParams),t("fitView")}function C(){r(!h.value),t("interactionChange",!h.value)}return(v,M)=>(O(),pe(B(ys),{class:"vue-flow__controls",position:v.position},{default:Z(()=>[Ce(v.$slots,"top"),v.showZoom?(O(),te(Ne,{key:0},[Ce(v.$slots,"control-zoom-in",{},()=>[R(Un,{class:"vue-flow__controls-zoomin",disabled:$.value,onClick:w},{default:Z(()=>[Ce(v.$slots,"icon-zoom-in",{},()=>[(O(),pe(yt(B(Zp))))])]),_:3},8,["disabled"])]),Ce(v.$slots,"control-zoom-out",{},()=>[R(Un,{class:"vue-flow__controls-zoomout",disabled:p.value,onClick:y},{default:Z(()=>[Ce(v.$slots,"icon-zoom-out",{},()=>[(O(),pe(yt(B(jp))))])]),_:3},8,["disabled"])])],64)):$e("",!0),v.showFitView?Ce(v.$slots,"control-fit-view",{key:1},()=>[R(Un,{class:"vue-flow__controls-fitview",onClick:S},{default:Z(()=>[Ce(v.$slots,"icon-fit-view",{},()=>[(O(),pe(yt(B(ig))))])]),_:3})]):$e("",!0),v.showInteractive?Ce(v.$slots,"control-interactive",{key:2},()=>[v.showInteractive?(O(),pe(Un,{key:0,class:"vue-flow__controls-interactive",onClick:C},{default:Z(()=>[h.value?Ce(v.$slots,"icon-unlock",{key:0}
vendor: 12,588 bytes, line 26
26,()=>[(O(),pe(yt(B(pg))))]):$e("",!0),h.value?$e("",!0):Ce(v.$slots,"icon-lock",{key:1},()=>[(O(),pe(yt(B(ug))))])]),_:3})):$e("",!0)]):$e("",!0),Ce(v.$slots,"default")]),_:3},8,["position"]))}});var mg={value:()=>{}};function Fi(){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 no(n)}function no(e){this._=e}function yg(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}})}no.prototype=Fi.prototype={constructor:no,on:function(e,t){var n=this._,o=yg(e+"",n),i,r=-1,a=o.length;if(arguments.length<2){for(;++r<a;)if((i=(e=o[r]).type)&&(i=_g(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<a;)if(i=(e=o[r]).type)n[i]=Rr(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Rr(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 no(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 _g(e,t){for(var n=0,o=e.length,i;n<o;++n)if((i=e[n]).name===t)return i.value}function Rr(e,t,n){for(var o=0,i=e.length;o<i;++o)if(e[o].name===t){e[o]=mg,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var gi="http://www.w3.org/1999/xhtml";const Vr={svg:"http://www.w3.org/2000/svg",xhtml:gi,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Bo(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Vr.hasOwnProperty(t)?{space:Vr[t],local:e}:e}function wg(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===gi&&t.documentElement.namespaceURI===gi?t.createElement(e):t.createElementNS(n,e)}}function bg(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function bs(e){var t=Bo(e);return(t.local?bg:wg)(t)}function $g(){}function Li(e){return e==null?$g:function(){return this.querySelector(e)}}function xg(e){typeof e!="function"&&(e=Li(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=new Array(a),l,u,c=0;c<a;++c)(l=r[c])&&(u=e.call(l,l.__data__,c,r))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Ve(o,this._parents)}function Eg(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Sg(){return[]}function $s(e){return e==null?Sg:function(){return this.querySelectorAll(e)}}function Ng(e){return function(){return Eg(e.apply(this,arguments))}}function kg(e){typeof e=="function"?e=Ng(e):e=$s(e);for(var t=this._groups,n=t.length,o=[],i=[],r=0;r<n;++r)for(var a=t[r],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(o.push(e.call(l,l.__data__,u,a)),i.push(l));return new Ve(o,i)}function xs(e){return function(){return this.matches(e)}}function Es(e){return function(t){return t.matches(e)}}var Cg=Array.prototype.find;function Mg(e){return function(){return Cg.call(this.children,e)}}function Tg(){return this.firstElementChild}function Ig(e){return this.select(e==null?Tg:Mg(typeof e=="function"?e:Es(e)))}var Ag=Array.prototype.filter;function Dg(){return Array.from(this.children)}function Pg(e){return function(){return Ag.call(this.children,e)}}function zg(e){return this.selectAll(e==null?Dg:Pg(typeof e=="function"?e:Es(e)))}function Bg(e){typeof e!="function"&&(e=xs(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=[],l,u=0;u<a;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&s.push(l);return new Ve(o,this._parents)}function Ss(e){return new Array(e.length)}function Og(){return new Ve(this._enter||this._groups.map(Ss),this._parents)}function yo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}yo.prototype={constructor:yo,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 Rg(e){return function(){return e}}function Vg(e,t,n,o,i,r){for(var a=0,s,l=t.length,u=r.length;a<u;++a)(s=t[a])?(s.__data__=r[a],o[a]=s):n[a]=new yo(e,r[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function Hg(e,t,n,o,i,r,a){var s,l,u=new Map,c=t.length,d=r.length,h=new Array(c),p;for(s=0;s<c;++s)(l=t[s])&&(h[s]=p=a.call(l,l.__data__,s,t)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<d;++s)p=a.call(e,r[s],s,r)+"",(l=u.get(p))?(o[s]=l,l.__data__=r[s],u.delete(p)):n[s]=new yo(e,r[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(h[s])===l&&(i[s]=l)}function Fg(e){return e.__data__}function Lg(e,t){if(!arguments.length)return Array.from(this,Fg);var n=t?Hg:Vg,o=this._parents,i=this._groups;typeof e!="function"&&(e=Rg(e));for(var r=i.length,a=new Array(r),s=new Array(r),l=new Array(r),u=0;u<r;++u){var c=o[u],d=i[u],h=d.length,p=Yg(e.call(c,c&&c.__data__,u,o)),$=p.length,w=s[u]=new Array($),y=a[u]=new Array($),S=l[u]=new Array(h);n(c,d,w,y,S,p,t);for(var C=0,v=0,M,z;C<$;++C)if(M=w[C]){for(C>=v&&(v=C+1);!(z=y[v])&&++v<$;);M._next=z||null}}return a=new Ve(a,o),a._enter=s,a._exit=l,a}function Yg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Xg(){return new Ve(this._exit||this._groups.map(Ss),this._parents)}function Ug(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 Gg(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,i=n.length,r=o.length,a=Math.min(i,r),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=o[l],d=u.length,h=s[l]=new Array(d),p,$=0;$<d;++$)(p=u[$]||c[$])&&(h[$]=p);for(;l<i;++l)s[l]=n[l];return new Ve(s,this._parents)}function Wg(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],i=o.length-1,r=o[i],a;--i>=0;)(a=o[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function Zg(e){e||(e=qg);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,o=n.length,i=new Array(o),r=0;r<o;++r){for(var a=n[r],s=a.length,l=i[r]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new Ve(i,this._parents).order()}function qg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Kg(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Qg(){return Array.from(this)}function Jg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length;i<r;++i){var a=o[i];if(a)return a}return null}function jg(){let e=0;for(const t of this)++e;return e}function ev(){return!this.node()}function tv(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var i=t[n],r=0,a=i.length,s;r<a;++r)(s=i[r])&&e.call(s,s.__data__,r,i);return this}function nv(e){return function(){this.removeAttribute(e)}}function ov(e){return function(){this.removeAttributeNS(e.space,e.local)}}function iv(e,t){return function(){this.setAttribute(e,t)}}function rv(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function av(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function sv(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 lv(e,t){var n=Bo(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?ov:nv:typeof t=="function"?n.local?sv:av:n.local?rv:iv)(n,t))}function Ns(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function uv(e){return function(){this.style.removeProperty(e)}}function cv(e,t,n){return function(){this.style.setProperty(e,t,n)}}function dv(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function fv(e,t,n){return arguments.length>1?this.each((t==null?uv:typeof t=="function"?dv:cv)(e,t,n??"")):en(this.node(),e)}function en(e,t){return e.style.getPropertyValue(t)||Ns(e).getComputedStyle(e,null).getPropertyValue(t)}function hv(e){return function(){delete this[e]}}function pv(e,t){return function(){this[e]=t}}function gv(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function vv(e,t){return arguments.length>1?this.each((t==null?hv:typeof t=="function"?gv:pv)(e,t)):this.node()[e]}function ks(e){return e.trim().split(/^|\s+/)}function Yi(e){return e.classList||new Cs(e)}function Cs(e){this._node=e,this._names=ks(e.getAttribute("class")||"")}Cs.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 Ms(e,t){for(var n=Yi(e),o=-1,i=t.length;++o<i;)n.add(t[o])}function Ts(e,t){for(var n=Yi(e),o=-1,i=t.length;++o<i;)n.remove(t[o])}function mv(e){return function(){Ms(this,e)}}function yv(e){return function(){Ts(this,e)}}function _v(e,t){return function(){(t.apply(this,arguments)?Ms:Ts)(this,e)}}function wv(e,t){var n=ks(e+"");if(arguments.length<2){for(var o=Yi(this.node()),i=-1,r=n.length;++i<r;)if(!o.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?_v:t?mv:yv)(n,t))}function bv(){this.textContent=""}function $v(e){return function(){this.textContent=e}}function xv(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ev(e){return arguments.length?this.each(e==null?bv:(typeof e=="function"?xv:$v)(e)):this.node().textContent}function Sv(){this.innerHTML=""}function Nv(e){return function(){this.innerHTML=e}}function kv(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Cv(e){return arguments.length?this.each(e==null?Sv:(typeof e=="function"?kv:Nv)(e)):this.node().innerHTML}function Mv(){this.nextSibling&&this.parentNode.appendChild(this)}function Tv(){return this.each(Mv)}function Iv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Av(){return this.each(Iv)}function Dv(e){var t=typeof e=="function"?e:bs(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Pv(){return null}function zv(e,t){var n=typeof e=="function"?e:bs(e),o=t==null?Pv:typeof t=="function"?t:Li(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Bv(){var e=this.parentNode;e&&e.removeChild(this)}function Ov(){return this.each(Bv)}function Rv(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vv(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Hv(e){return this.select(e?Vv:Rv)}function Fv(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Lv(e){return function(t){e.call(this,t,this.__data__)}}function Yv(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 Xv(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 Uv(e,t,n){return function(){var o=this.__on,i,r=Lv(t);if(o){for(var a=0,s=o.length;a<s;++a)if((i=o[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),i.value=t;return}}this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function Gv(e,t,n){var o=Yv(e+""),i,r=o.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;
vendor: 7,229 bytes, line 26
26l<u;++l)for(i=0,c=s[l];i<r;++i)if((a=o[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?Uv:Xv,i=0;i<r;++i)this.each(s(o[i],t,n));return this}function Is(e,t,n){var o=Ns(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 Wv(e,t){return function(){return Is(this,e,t)}}function Zv(e,t){return function(){return Is(this,e,t.apply(this,arguments))}}function qv(e,t){return this.each((typeof t=="function"?Zv:Wv)(e,t))}function*Kv(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],i=0,r=o.length,a;i<r;++i)(a=o[i])&&(yield a)}var As=[null];function Ve(e,t){this._groups=e,this._parents=t}function Pn(){return new Ve([[document.documentElement]],As)}function Qv(){return this}Ve.prototype=Pn.prototype={constructor:Ve,select:xg,selectAll:kg,selectChild:Ig,selectChildren:zg,filter:Bg,data:Lg,enter:Og,exit:Xg,join:Ug,merge:Gg,selection:Qv,order:Wg,sort:Zg,call:Kg,nodes:Qg,node:Jg,size:jg,empty:ev,each:tv,attr:lv,style:fv,property:vv,classed:wv,text:Ev,html:Cv,raise:Tv,lower:Av,append:Dv,insert:zv,remove:Ov,clone:Hv,datum:Fv,on:Gv,dispatch:qv,[Symbol.iterator]:Kv};function _t(e){return typeof e=="string"?new Ve([[document.querySelector(e)]],[document.documentElement]):new Ve([[e]],As)}function Jv(e){let t;for(;t=e.sourceEvent;)e=t;return e}function gt(e,t){if(e=Jv(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 vi={capture:!0,passive:!1};function mi(e){e.preventDefault(),e.stopImmediatePropagation()}function jv(e){var t=e.document.documentElement,n=_t(e).on("dragstart.drag",mi,vi);"onselectstart"in t?n.on("selectstart.drag",mi,vi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function em(e,t){var n=e.document.documentElement,o=_t(e).on("dragstart.drag",null);t&&(o.on("click.drag",mi,vi),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Xi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ds(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function zn(){}var kn=.7,_o=1/kn,qt="\\s*([+-]?\\d+)\\s*",Cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",et="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tm=/^#([0-9a-f]{3,8})$/,nm=new RegExp(`^rgb\\(${qt},${qt},${qt}\\)$`),om=new RegExp(`^rgb\\(${et},${et},${et}\\)$`),im=new RegExp(`^rgba\\(${qt},${qt},${qt},${Cn}\\)$`),rm=new RegExp(`^rgba\\(${et},${et},${et},${Cn}\\)$`),am=new RegExp(`^hsl\\(${Cn},${et},${et}\\)$`),sm=new RegExp(`^hsla\\(${Cn},${et},${et},${Cn}\\)$`),Hr={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};Xi(zn,Mn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fr,formatHex:Fr,formatHex8:lm,formatHsl:um,formatRgb:Lr,toString:Lr});function Fr(){return this.rgb().formatHex()}function lm(){return this.rgb().formatHex8()}function um(){return Ps(this).formatHsl()}function Lr(){return this.rgb().formatRgb()}function Mn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=tm.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Yr(t):n===3?new Oe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Gn(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Gn(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=nm.exec(e))?new Oe(t[1],t[2],t[3],1):(t=om.exec(e))?new Oe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=im.exec(e))?Gn(t[1],t[2],t[3],t[4]):(t=rm.exec(e))?Gn(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=am.exec(e))?Gr(t[1],t[2]/100,t[3]/100,1):(t=sm.exec(e))?Gr(t[1],t[2]/100,t[3]/100,t[4]):Hr.hasOwnProperty(e)?Yr(Hr[e]):e==="transparent"?new Oe(NaN,NaN,NaN,0):null}function Yr(e){return new Oe(e>>16&255,e>>8&255,e&255,1)}function Gn(e,t,n,o){return o<=0&&(e=t=n=NaN),new Oe(e,t,n,o)}function cm(e){return e instanceof zn||(e=Mn(e)),e?(e=e.rgb(),new Oe(e.r,e.g,e.b,e.opacity)):new Oe}function yi(e,t,n,o){return arguments.length===1?cm(e):new Oe(e,t,n,o??1)}function Oe(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Xi(Oe,yi,Ds(zn,{brighter(e){return e=e==null?_o:Math.pow(_o,e),new Oe(this.r*e,this.g*e,this.b*e,this.opacity)}
vendor: 4,743 bytes, line 26
26,darker(e){return e=e==null?kn:Math.pow(kn,e),new Oe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Oe(Bt(this.r),Bt(this.g),Bt(this.b),wo(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:Xr,formatHex:Xr,formatHex8:dm,formatRgb:Ur,toString:Ur}));function Xr(){return`#${Dt(this.r)}${Dt(this.g)}${Dt(this.b)}`}function dm(){return`#${Dt(this.r)}${Dt(this.g)}${Dt(this.b)}${Dt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ur(){const e=wo(this.opacity);return`${e===1?"rgb(":"rgba("}${Bt(this.r)}, ${Bt(this.g)}, ${Bt(this.b)}${e===1?")":`, ${e})`}`}function wo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Bt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Dt(e){return e=Bt(e),(e<16?"0":"")+e.toString(16)}function Gr(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,n,o)}function Ps(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof zn||(e=Mn(e)),!e)return new Ue;if(e instanceof Ue)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,i=Math.min(t,n,o),r=Math.max(t,n,o),a=NaN,s=r-i,l=(r+i)/2;return s?(t===r?a=(n-o)/s+(n<o)*6:n===r?a=(o-t)/s+2:a=(t-n)/s+4,s/=l<.5?r+i:2-r-i,a*=60):s=l>0&&l<1?0:a,new Ue(a,s,l,e.opacity)}function fm(e,t,n,o){return arguments.length===1?Ps(e):new Ue(e,t,n,o??1)}function Ue(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Xi(Ue,fm,Ds(zn,{brighter(e){return e=e==null?_o:Math.pow(_o,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kn:Math.pow(kn,e),new Ue(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 Oe(Ko(e>=240?e-240:e+120,i,o),Ko(e,i,o),Ko(e<120?e+240:e-120,i,o),this.opacity)},clamp(){return new Ue(Wr(this.h),Wn(this.s),Wn(this.l),wo(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=wo(this.opacity);return`${e===1?"hsl(":"hsla("}${Wr(this.h)}, ${Wn(this.s)*100}%, ${Wn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Wr(e){return e=(e||0)%360,e<0?e+360:e}function Wn(e){return Math.max(0,Math.min(1,e||0))}function Ko(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 zs=e=>()=>e;function hm(e,t){return function(n){return e+n*t}}function pm(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 gm(e){return(e=+e)==1?Bs:function(t,n){return n-t?pm(t,n,e):zs(isNaN(t)?n:t)}}function Bs(e,t){var n=t-e;return n?hm(e,n):zs(isNaN(e)?t:e)}const Zr=function e(t){var n=gm(t);function o(i,r){var a=n((i=yi(i)).r,(r=yi(r)).r),s=n(i.g,r.g),l=n(i.b,r.b),u=Bs(i.opacity,r.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return o.gamma=e,o}(1);function mt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var _i=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qo=new RegExp(_i.source,"g");function vm(e){return function(){return e}}function mm(e){return function(t){return e(t)+""}}function ym(e,t){var n=_i.lastIndex=Qo.lastIndex=0,o,i,r,a=-1,s=[],l=[];for(e=e+"",t=t+"";(o=_i.exec(e))&&(i=Qo.exec(t));)(r=i.index)>n&&(r=t.slice(n,r),s[a]?s[a]+=r:s[++a]=r),(o=o[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:mt(o,i)})),n=Qo.lastIndex;return n<t.length&&(r=t.slice(n),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?mm(l[0].x):vm(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)s[(d=l[c]).i]=d.x(u);return s.join("")})}var qr=180/Math.PI,wi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Os(e,t,n,o,i,r){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*o)&&(n-=e*l,o-=t*l),(s=Math.sqrt(n*n+o*o))&&(n/=s,o/=s,l/=s),e*o<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:r,rotate:Math.atan2(t,e)*qr,skewX:Math.atan(l)*qr,scaleX:a,scaleY:s}}var Zn;function _m(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?wi:Os(t.a,t.b,t.c,t.d,t.e,t.f)}function wm(e){return e==null||(Zn||(Zn=document.createElementNS("http://www.w3.org/2000/svg","g")),Zn.setAttribute("transform",e),!(e=Zn.transform.baseVal.consolidate()))?wi:(e=e.matrix,Os(e.a,e.b,e.c,e.d,e.e,e.f))}function Rs(e,t,n,o){function i(u){return u.length?u.pop()+" ":""}function r(u,c,d,h,p,$){if(u!==d||c!==h){var w=p.push("translate(",null,t,null,n);$.push({i:w-4,x:mt(u,d)},{i:w-2,x:mt(c,h)})}else(d||h)&&p.push("translate("+d+t+h+n)}function a(u,c,d,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(i(d)+"rotate(",null,o)-2,x:mt(u,c)})):c&&d.push(i(d)+"rotate("+c+o)}
vendor: 4,149 bytes, line 26
26function s(u,c,d,h){u!==c?h.push({i:d.push(i(d)+"skewX(",null,o)-2,x:mt(u,c)}):c&&d.push(i(d)+"skewX("+c+o)}function l(u,c,d,h,p,$){if(u!==d||c!==h){var w=p.push(i(p)+"scale(",null,",",null,")");$.push({i:w-4,x:mt(u,d)},{i:w-2,x:mt(c,h)})}else(d!==1||h!==1)&&p.push(i(p)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),r(u.translateX,u.translateY,c.translateX,c.translateY,d,h),a(u.rotate,c.rotate,d,h),s(u.skewX,c.skewX,d,h),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(p){for(var $=-1,w=h.length,y;++$<w;)d[(y=h[$]).i]=y.x(p);return d.join("")}}}var bm=Rs(_m,"px, ","px)","deg)"),$m=Rs(wm,", ",")",")"),xm=1e-12;function Kr(e){return((e=Math.exp(e))+1/e)/2}function Em(e){return((e=Math.exp(e))-1/e)/2}function Sm(e){return((e=Math.exp(2*e))-1)/(e+1)}const Nm=function e(t,n,o){function i(r,a){var s=r[0],l=r[1],u=r[2],c=a[0],d=a[1],h=a[2],p=c-s,$=d-l,w=p*p+$*$,y,S;if(w<xm)S=Math.log(h/u)/t,y=function(F){return[s+F*p,l+F*$,u*Math.exp(t*F*S)]};else{var C=Math.sqrt(w),v=(h*h-u*u+o*w)/(2*u*n*C),M=(h*h-u*u-o*w)/(2*h*n*C),z=Math.log(Math.sqrt(v*v+1)-v),L=Math.log(Math.sqrt(M*M+1)-M);S=(L-z)/t,y=function(F){var X=F*S,ne=Kr(z),Y=u/(n*C)*(ne*Sm(t*X+z)-Em(z));return[s+Y*p,l+Y*$,u*ne/Kr(t*X+z)]}}return y.duration=S*1e3*t/Math.SQRT2,y}return i.rho=function(r){var a=Math.max(.001,+r),s=a*a,l=s*s;return e(a,s,l)},i}(Math.SQRT2,2,4);var tn=0,hn=0,ln=0,Vs=1e3,bo,pn,$o=0,Ft=0,Oo=0,Tn=typeof performance=="object"&&performance.now?performance:Date,Hs=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ui(){return Ft||(Hs(km),Ft=Tn.now()+Oo)}function km(){Ft=0}function xo(){this._call=this._time=this._next=null}xo.prototype=Fs.prototype={constructor:xo,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ui():+n)+(t==null?0:+t),!this._next&&pn!==this&&(pn?pn._next=this:bo=this,pn=this),this._call=e,this._time=n,bi()},stop:function(){this._call&&(this._call=null,this._time=1/0,bi())}};function Fs(e,t,n){var o=new xo;return o.restart(e,t,n),o}function Cm(){Ui(),++tn;for(var e=bo,t;e;)(t=Ft-e._time)>=0&&e._call.call(void 0,t),e=e._next;--tn}function Qr(){Ft=($o=Tn.now())+Oo,tn=hn=0;try{Cm()}finally{tn=0,Tm(),Ft=0}}function Mm(){var e=Tn.now(),t=e-$o;t>Vs&&(Oo-=t,$o=e)}function Tm(){for(var e,t=bo,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:bo=n);pn=e,bi(o)}function bi(e){if(!tn){hn&&(hn=clearTimeout(hn));var t=e-Ft;t>24?(e<1/0&&(hn=setTimeout(Qr,e-Tn.now()-Oo)),ln&&(ln=clearInterval(ln))):(ln||($o=Tn.now(),ln=setInterval(Mm,Vs)),tn=1,Hs(Qr))}}function Jr(e,t,n){var o=new xo;return t=t==null?0:+t,o.restart(i=>{o.stop(),e(i+t)},t,n),o}var Im=Fi("start","end","cancel","interrupt"),Am=[],Ls=0,jr=1,$i=2,oo=3,ea=4,xi=5,io=6;function Ro(e,t,n,o,i,r){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Dm(e,n,{name:t,index:o,group:i,on:Im,tween:Am,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ls})}function Gi(e,t){var n=We(e,t);if(n.state>Ls)throw new Error("too late; already scheduled");return n}function nt(e,t){var n=We(e,t);if(n.state>oo)throw new Error("too late; already running");return n}function We(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Dm(e,t,n){var o=e.__transition,i;o[t]=n,n.timer=Fs(r,0,n.time);function r(u){n.state=jr,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,d,h,p;if(n.state!==jr)return l();for(c in o)if(p=o[c],p.name===n.name){if(p.state===oo)return Jr(a);p.state===ea?(p.state=io,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[c]):+c<t&&(p.state=io,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[c])}if(Jr(function(){n.state===oo&&(n.state=ea,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=$i,n.on.call("start",e,e.__data__,n.index,n.group),n.state===$i){for(n.state=oo,i=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[
vendor: 4,557 bytes, line 26
26++d]=p);i.length=d+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=xi,1),d=-1,h=i.length;++d<h;)i[d].call(e,c);n.state===xi&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=io,n.timer.stop(),delete o[t];for(var u in o)return;delete e.__transition}}function ro(e,t){var n=e.__transition,o,i,r=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((o=n[a]).name!==t){r=!1;continue}i=o.state>$i&&o.state<xi,o.state=io,o.timer.stop(),o.on.call(i?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[a]}r&&delete e.__transition}}function Pm(e){return this.each(function(){ro(this,e)})}function zm(e,t){var n,o;return function(){var i=nt(this,e),r=i.tween;if(r!==n){o=n=r;for(var a=0,s=o.length;a<s;++a)if(o[a].name===t){o=o.slice(),o.splice(a,1);break}}i.tween=o}}function Bm(e,t,n){var o,i;if(typeof n!="function")throw new Error;return function(){var r=nt(this,e),a=r.tween;if(a!==o){i=(o=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}r.tween=i}}function Om(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=We(this.node(),n).tween,i=0,r=o.length,a;i<r;++i)if((a=o[i]).name===e)return a.value;return null}return this.each((t==null?zm:Bm)(n,e,t))}function Wi(e,t,n){var o=e._id;return e.each(function(){var i=nt(this,o);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return We(i,o).value[t]}}function Ys(e,t){var n;return(typeof t=="number"?mt:t instanceof Mn?Zr:(n=Mn(t))?(t=n,Zr):ym)(e,t)}function Rm(e){return function(){this.removeAttribute(e)}}function Vm(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Hm(e,t,n){var o,i=n+"",r;return function(){var a=this.getAttribute(e);return a===i?null:a===o?r:r=t(o=a,n)}}function Fm(e,t,n){var o,i=n+"",r;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?r:r=t(o=a,n)}}function Lm(e,t,n){var o,i,r;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s)))}}function Ym(e,t,n){var o,i,r;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s)))}}function Xm(e,t){var n=Bo(e),o=n==="transform"?$m:Ys;return this.attrTween(e,typeof t=="function"?(n.local?Ym:Lm)(n,o,Wi(this,"attr."+e,t)):t==null?(n.local?Vm:Rm)(n):(n.local?Fm:Hm)(n,o,t))}function Um(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Gm(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Wm(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Gm(e,r)),n}return i._value=t,i}function Zm(e,t){var n,o;function i(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&Um(e,r)),n}return i._value=t,i}function qm(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=Bo(e);return this.tween(n,(o.local?Wm:Zm)(o,t))}function Km(e,t){return function(){Gi(this,e).delay=+t.apply(this,arguments)}}function Qm(e,t){return t=+t,function(){Gi(this,e).delay=t}}function Jm(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Km:Qm)(t,e)):We(this.node(),t).delay}function jm(e,t){return function(){nt(this,e).duration=+t.apply(this,arguments)}}function e0(e,t){return t=+t,function(){nt(this,e).duration=t}}function t0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?jm:e0)(t,e)):We(this.node(),t).duration}function n0(e,t){if(typeof t!="function")throw new Error;return function(){nt(this,e).ease=t}}function o0(e){var t=this._id;return arguments.length?this.each(n0(t,e)):We(this.node(),t).ease}function i0(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nt(this,e).ease=n}}function r0(e){if(typeof e!="function")throw new Error;return this.each(i0(this._id,e))}function a0(e){typeof e!="function"&&(e=xs(e));for(var t=this._groups,n=t.length,o=new Array(n),i=0;i<n;++i)for(var r=t[i],a=r.length,s=o[i]=[],l,u=0;u<a;++u)(l=r[u])&&e.call(l,l.__data__,u,r)&&s.push(l);return new dt(o,this._parents,this._name,this._id)}function s0(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,i=n.length,r=Math.min(o,i),a=new Array(o),s=0;s<r;++s)for(var l=t[s],u=n[s],c=l.length,d=a[s]=new Array(c),h,p=0;p<c;
vendor: 4,549 bytes, line 26
26++p)(h=l[p]||u[p])&&(d[p]=h);for(;s<o;++s)a[s]=t[s];return new dt(a,this._parents,this._name,this._id)}function l0(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 u0(e,t,n){var o,i,r=l0(t)?Gi:nt;return function(){var a=r(this,e),s=a.on;s!==o&&(i=(o=s).copy()).on(t,n),a.on=i}}function c0(e,t){var n=this._id;return arguments.length<2?We(this.node(),n).on.on(e):this.each(u0(n,e,t))}function d0(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function f0(){return this.on("end.remove",d0(this._id))}function h0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Li(e));for(var o=this._groups,i=o.length,r=new Array(i),a=0;a<i;++a)for(var s=o[a],l=s.length,u=r[a]=new Array(l),c,d,h=0;h<l;++h)(c=s[h])&&(d=e.call(c,c.__data__,h,s))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,Ro(u[h],t,n,h,u,We(c,n)));return new dt(r,this._parents,t,n)}function p0(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$s(e));for(var o=this._groups,i=o.length,r=[],a=[],s=0;s<i;++s)for(var l=o[s],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var h=e.call(c,c.__data__,d,l),p,$=We(c,n),w=0,y=h.length;w<y;++w)(p=h[w])&&Ro(p,t,n,w,h,$);r.push(h),a.push(c)}return new dt(r,a,t,n)}var g0=Pn.prototype.constructor;function v0(){return new g0(this._groups,this._parents)}function m0(e,t){var n,o,i;return function(){var r=en(this,e),a=(this.style.removeProperty(e),en(this,e));return r===a?null:r===n&&a===o?i:i=t(n=r,o=a)}}function Xs(e){return function(){this.style.removeProperty(e)}}function y0(e,t,n){var o,i=n+"",r;return function(){var a=en(this,e);return a===i?null:a===o?r:r=t(o=a,n)}}function _0(e,t,n){var o,i,r;return function(){var a=en(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),en(this,e))),a===l?null:a===o&&l===i?r:(i=l,r=t(o=a,s))}}function w0(e,t){var n,o,i,r="style."+t,a="end."+r,s;return function(){var l=nt(this,e),u=l.on,c=l.value[r]==null?s||(s=Xs(t)):void 0;(u!==n||i!==c)&&(o=(n=u).copy()).on(a,i=c),l.on=o}}function b0(e,t,n){var o=(e+="")=="transform"?bm:Ys;return t==null?this.styleTween(e,m0(e,o)).on("end.style."+e,Xs(e)):typeof t=="function"?this.styleTween(e,_0(e,o,Wi(this,"style."+e,t))).each(w0(this._id,e)):this.styleTween(e,y0(e,o,t),n).on("end.style."+e,null)}function $0(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function x0(e,t,n){var o,i;function r(){var a=t.apply(this,arguments);return a!==i&&(o=(i=a)&&$0(e,a,n)),o}return r._value=t,r}function E0(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,x0(e,t,n??""))}function S0(e){return function(){this.textContent=e}}function N0(e){return function(){var t=e(this);this.textContent=t??""}}function k0(e){return this.tween("text",typeof e=="function"?N0(Wi(this,"text",e)):S0(e==null?"":e+""))}function C0(e){return function(t){this.textContent=e.call(this,t)}}function M0(e){var t,n;function o(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&C0(i)),t}return o._value=e,o}function T0(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,M0(e))}function I0(){for(var e=this._name,t=this._id,n=Us(),o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=We(l,t);Ro(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new dt(o,this._parents,e,n)}function A0(){var e,t,n=this,o=n._id,i=n.size();return new Promise(function(r,a){var s={value:a},l={value:function(){--i===0&&r()}};n.each(function(){var u=nt(this,o),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&r()})}var D0=0;function dt(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Us(){return++D0}var it=Pn.prototype;dt.prototype={constructor:dt,select:h0,selectAll:p0,selectChild:it.selectChild,selectChildren:it.selectChildren,filter:a0,merge:s0,selection:v0,transition:I0,call:it.call,nodes:it.nodes,node:it.node,size:it.size,empty:it.empty,each:it.each,on:c0,attr:Xm,attrTween:qm,style:b0,styleTween:E0,text:k0,textTween:T0,remove:f0,tween:Om,delay:Jm,duration:t0,ease:o0,easeVarying:r0,end:A0,[Symbol.iterator]:it[Symbol.iterator]};function P0(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}
vendor: 10,521 bytes, line 26
26var z0={time:null,delay:0,duration:250,ease:P0};function B0(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 O0(e){var t,n;e instanceof dt?(t=e._id,e=e._name):(t=Us(),(n=z0).time=Ui(),e=e==null?null:e+"");for(var o=this._groups,i=o.length,r=0;r<i;++r)for(var a=o[r],s=a.length,l,u=0;u<s;++u)(l=a[u])&&Ro(l,e,t,u,a,n||B0(l,t));return new dt(o,this._parents,e,t)}Pn.prototype.interrupt=Pm;Pn.prototype.transition=O0;const qn=e=>()=>e;function R0(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 lt(e,t,n){this.k=e,this.x=t,this.y=n}lt.prototype={constructor:lt,scale:function(e){return e===1?this:new lt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new lt(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 Zi=new lt(1,0,0);lt.prototype;function Jo(e){e.stopImmediatePropagation()}function un(e){e.preventDefault(),e.stopImmediatePropagation()}function V0(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function H0(){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 ta(){return this.__zoom||Zi}function F0(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function L0(){return navigator.maxTouchPoints||"ontouchstart"in this}function Y0(e,t,n){var o=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function X0(){var e=V0,t=H0,n=Y0,o=F0,i=L0,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Nm,u=Fi("start","zoom","end"),c,d,h,p=500,$=150,w=0,y=10;function S(f){f.property("__zoom",ta).on("wheel.zoom",X,{passive:!1}).on("mousedown.zoom",ne).on("dblclick.zoom",Y).filter(i).on("touchstart.zoom",U).on("touchmove.zoom",b).on("touchend.zoom touchcancel.zoom",P).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(f,x,g,E){var N=f.selection?f.selection():f;N.property("__zoom",ta),f!==N?z(f,x,g,E):N.interrupt().each(function(){L(this,arguments).event(E).start().zoom(null,typeof x=="function"?x.apply(this,arguments):x).end()})},S.scaleBy=function(f,x,g,E){S.scaleTo(f,function(){var N=this.__zoom.k,D=typeof x=="function"?x.apply(this,arguments):x;return N*D},g,E)},S.scaleTo=function(f,x,g,E){S.transform(f,function(){var N=t.apply(this,arguments),D=this.__zoom,I=g==null?M(N):typeof g=="function"?g.apply(this,arguments):g,V=D.invert(I),K=typeof x=="function"?x.apply(this,arguments):x;return n(v(C(D,K),I,V),N,a)},g,E)},S.translateBy=function(f,x,g,E){S.transform(f,function(){return n(this.__zoom.translate(typeof x=="function"?x.apply(this,arguments):x,typeof g=="function"?g.apply(this,arguments):g),t.apply(this,arguments),a)},null,E)},S.translateTo=function(f,x,g,E,N){S.transform(f,function(){var D=t.apply(this,arguments),I=this.__zoom,V=E==null?M(D):typeof E=="function"?E.apply(this,arguments):E;return n(Zi.translate(V[0],V[1]).scale(I.k).translate(typeof x=="function"?-x.apply(this,arguments):-x,typeof g=="function"?-g.apply(this,arguments):-g),D,a)},E,N)};function C(f,x){return x=Math.max(r[0],Math.min(r[1],x)),x===f.k?f:new lt(x,f.x,f.y)}function v(f,x,g){var E=x[0]-g[0]*f.k,N=x[1]-g[1]*f.k;return E===f.x&&N===f.y?f:new lt(f.k,E,N)}function M(f){return[(+f[0][0]+ +f[1][0])/2,(+f[0][1]+ +f[1][1])/2]}function z(f,x,g,E){f.on("start.zoom",function(){L(this,arguments).event(E).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(E).end()}).tween("zoom",function(){var N=this,D=arguments,I=L(N,D).event(E),V=t.apply(N,D),K=g==null?M(V):typeof g=="function"?g.apply(N,D):g,ie=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),ae=N.__zoom,G=typeof x=="function"?x.apply(N,D):x,q=l(ae.invert(K).concat(ie/ae.k),G.invert(K).concat(ie/G.k));return function(j){if(j===1)j=G;else{var fe=q(j),we=ie/fe[2];j=new lt(we,K[0]-fe[0]*we,K[1]-fe[1]*we)}I.zoom(null,j)}})}function L(f,x,g){return!g&&f.__zooming||new F(f,x)}function F(f,x){this.that=f,this.args=x,this.active=0,this.sourceEvent=null,this.extent=t.apply(f,x),this.taps=0}F.prototype={event:function(f){return f&&(this.sourceEvent=f),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(f,x){return this.mouse&&f!=="mouse"&&(this.mouse[1]=x.invert(this.mouse[0])),this.touch0&&f!=="touch"&&(this.touch0[1]=x.invert(this.touch0[0])),this.touch1&&f!=="touch"&&(this.touch1[1]=x.invert(this.touch1[0])),this.that.__zoom=x,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(f){var x=_t(this.that).datum();u.call(f,this.that,new R0(f,{sourceEvent:this.sourceEvent,target:S,type:f,transform:this.that.__zoom,dispatch:u}),x)}};function X(f,...x){if(!e.apply(this,arguments))return;var g=L(this,x).event(f),E=this.__zoom,N=Math.max(r[0],Math.min(r[1],E.k*Math.pow(2,o.apply(this,arguments)))),D=gt(f);if(g.wheel)(g.mouse[0][0]!==D[0]||g.mouse[0][1]!==D[1])&&(g.mouse[1]=E.invert(g.mouse[0]=D)),clearTimeout(g.wheel);else{if(E.k===N)return;g.mouse=[D,E.invert(D)],ro(this),g.start()}un(f),g.wheel=setTimeout(I,$),g.zoom("mouse",n(v(C(E,N),g.mouse[0],g.mouse[1]),g.extent,a));function I(){g.wheel=null,g.end()}}function ne(f,...x){if(h||!e.apply(this,arguments))return;var g=f.currentTarget,E=L(this,x,!0).event(f),N=_t(f.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",ie,!0),D=gt(f,g),I=f.clientX,V=f.clientY;jv(f.view),Jo(f),E.mouse=[D,this.__zoom.invert(D)],ro(this),E.start();function K(ae){if(un(ae),!E.moved){var G=ae.clientX-I,q=ae.clientY-V;E.moved=G*G+q*q>w}E.event(ae).zoom("mouse",n(v(E.that.__zoom,E.mouse[0]=gt(ae,g),E.mouse[1]),E.extent,a))}function ie(ae){N.on("mousemove.zoom mouseup.zoom",null),em(ae.view,E.moved),un(ae),E.event(ae).end()}}function Y(f,...x){if(e.apply(this,arguments)){var g=this.__zoom,E=gt(f.changedTouches?f.changedTouches[0]:f,this),N=g.invert(E),D=g.k*(f.shiftKey?.5:2),I=n(v(C(g,D),E,N),t.apply(this,x),a);un(f),s>0?_t(this).transition().duration(s).call(z,I,E,f):_t(this).call(S.transform,I,E,f)}}function U(f,...x){if(e.apply(this,arguments)){var g=f.touches,E=g.length,N=L(this,x,f.changedTouches.length===E).event(f),D,I,V,K;for(Jo(f),I=0;I<E;++I)V=g[I],K=gt(V,this),K=[K,this.__zoom.invert(K),V.identifier],N.touch0?!N.touch1&&N.touch0[2]!==K[2]&&(N.touch1=K,N.taps=0):(N.touch0=K,D=!0,N.taps=1+!!c);c&&(c=clearTimeout(c)),D&&(N.taps<2&&(d=K[0],c=setTimeout(function(){c=null},p)),ro(this),N.start())}}function b(f,...x){if(this.__zooming){var g=L(this,x).event(f),E=f.changedTouches,N=E.length,D,I,V,K;for(un(f),D=0;D<N;++D)I=E[D],V=gt(I,this),g.touch0&&g.touch0[2]===I.identifier?g.touch0[0]=V:g.touch1&&g.touch1[2]===I.identifier&&(g.touch1[0]=V);if(I=g.that.__zoom,g.touch1){var ie=g.touch0[0],ae=g.touch0[1],G=g.touch1[0],q=g.touch1[1],j=(j=G[0]-ie[0])*j+(j=G[1]-ie[1])*j,fe=(fe=q[0]-ae[0])*fe+(fe=q[1]-ae[1])*fe;I=C(I,Math.sqrt(j/fe)),V=[(ie[0]+G[0])/2,(ie[1]+G[1])/2],K=[(ae[0]+q[0])/2,(ae[1]+q[1])/2]}else if(g.touch0)V=g.touch0[0],K=g.touch0[1];else return;g.zoom("touch",n(v(I,V,K),g.extent,a))}}function P(f,...x){if(this.__zooming){var g=L(this,x).event(f),E=f.changedTouches,N=E.length,D,I;for(Jo(f),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),D=0;D<N;++D)I=E[D],g.touch0&&g.touch0[2]===I.identifier?delete g.touch0:g.touch1&&g.touch1[2]===I.identifier&&delete g.touch1;if(g.touch1&&!g.touch0&&(g.touch0=g.touch1,delete g.touch1),g.touch0)g.touch0[1]=this.__zoom.invert(g.touch0[0]);else if(g.end(),g.taps===2&&(I=gt(I,this),Math.hypot(d[0]-I[0],d[1]-I[1])<y)){var V=_t(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return S.wheelDelta=function(f){return arguments.length?(o=typeof f=="function"?f:qn(+f),S):o},S.filter=function(f){return arguments.length?(e=typeof f=="function"?f:qn(!!f),S):e},S.touchable=function(f){return arguments.length?(i=typeof f=="function"?f:qn(!!f),S):i},S.extent=function(f){return arguments.length?(t=typeof f=="function"?f:qn([[+f[0][0],+f[0][1]],[+f[1][0],+f[1][1]]]),S):t},S.scaleExtent=function(f){return arguments.length?(r[0]=+f[0],r[1]=+f[1],S):[r[0],r[1]]},S.translateExtent=function(f){return arguments.length?(a[0][0]=+f[0][0],a[1][0]=+f[1][0],a[0][1]=+f[0][1],a[1][1]=+f[1][1],S):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},S.constrain=function(f){return arguments.length?(n=f,S):n},S.duration=function(f){return arguments.length?(s=+f,S):s},S.interpolate=function(f){return arguments.length?(l=f,S):l},S.on=function(){var f=u.on.apply(u,arguments);return f===u?S:f},S.clickDistance=function(f){return arguments.length?(w=(f=+f)*f,S):Math.sqrt(w)},S.tapDistance=function(f){return arguments.length?(y=+f,S):y},S}const Gs=Symbol("MiniMapSlots"),U0=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],G0={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},W0=ue({...G0,props:{id:{},type:{},selected:{type:Boolean},dragging:{type:Boolean},position:{},dimensions:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},hidden:{type:Boolean}},emits:["click","dblclick","mouseenter","mousemove","mouseleave"],setup(e,{emit:t}){const n=e,o=Lt(Gs),i=Si(),r=xe(()=>i.style??{});function a(d){t("click",d)}function s(d){t("dblclick",d)}function l(d){t("mouseenter",d)}function u(d){t("mousemove",d)}function c(d){t("mouseleave",d)}return(d,h)=>!d.hidden&&d.dimensions.width!==0&&d.dimensions.height!==0?(O(),te(Ne,{key:0},[B(o)[`node-${n.type}`]?(O(),pe(yt(B(o)[`node-${n.type}
26`]),fl(ao({key:0},{...n,...d.$attrs})),null,16)):(O(),te("rect",ao({key:1,id:d.id},d.$attrs,{class:["vue-flow__minimap-node",{selected:d.selected,dragging:d.dragging}],x:d.position.x,y:d.position.y,rx:d.borderRadius,ry:d.borderRadius,width:d.dimensions.width,height:d.dimensions.height,fill:d.color||r.value.background||r.value.backgroundColor,stroke:d.strokeColor,"stroke-width":d.strokeWidth,"shape-rendering":d.shapeRendering,onClick:a,onDblclick:s,onMouseenter:l,onMousemove:u,onMouseleave:c}),null,16,U0))],64)):$e("",!0)}}),Z0=["width","height","viewBox","aria-labelledby"],q0=["id"],K0=["d","fill","stroke","stroke-width"],Q0={name:"MiniMap",compatConfig:{MODE:3}},J0=ue({...Q0,props:{nodeColor:{type:[String,Function],default:"#e2e2e2"},nodeStrokeColor:{type:[String,Function],default:"transparent"},nodeClassName:{type:[String,Function]},nodeBorderRadius:{default:5},nodeStrokeWidth:{default:2},maskColor:{default:"rgb(240, 240, 240, 0.6)"},maskStrokeColor:{default:"none"},maskStrokeWidth:{default:1},position:{default:"bottom-right"},pannable:{type:Boolean,default:!1},zoomable:{type:Boolean,default:!1},width:{},height:{},ariaLabel:{default:"Vue Flow mini map"},inversePan:{type:Boolean,default:!1},zoomStep:{default:1},offsetScale:{default:5},maskBorderRadius:{default:0}},emits:["click","nodeClick","nodeDblclick","nodeMouseenter","nodeMousemove","nodeMouseleave"],setup(e,{emit:t}){const n=sa(),o=Si(),i=200,r=150,{id:a,edges:s,viewport:l,translateExtent:u,dimensions:c,emits:d,d3Selection:h,d3Zoom:p,getNodesInitialized:$}=ke(),w=de();Ot(Gs,n);const y=xe(()=>{var N;return e.width??((N=o.style)==null?void 0:N.width)??i}),S=xe(()=>{var N;return e.height??((N=o.style)==null?void 0:N.height)??r}),C=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",v=W(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),M=W(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),z=W(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),L=W(()=>Oi($.value.filter(N=>!N.hidden))),F=W(()=>({x:-l.value.x/l.value.zoom,y:-l.value.y/l.value.zoom,width:c.value.width/l.value.zoom,height:c.value.height/l.value.zoom})),X=W(()=>$.value&&$.value.length?Tf(L.value,F.value):F.value),ne=W(()=>{const N=X.value.width/y.value,D=X.value.height/S.value;return Math.max(N,D)}),Y=W(()=>{const N=ne.value*y.value,D=ne.value*S.value,I=e.offsetScale*ne.value;return{offset:I,x:X.value.x-(N-X.value.width)/2-I,y:X.value.y-(D-X.value.height)/2-I,width:N+I*2,height:D+I*2}}),U=W(()=>!Y.value.x||!Y.value.y?"":` 27 M${Y.value.x-Y.value.offset},${Y.value.y-Y.value.offset} 28 h${Y.value.width+Y.value.offset*2} 29 v${Y.value.height+Y.value.offset*2} 30 h${-Y.value.width-Y.value.offset*2}z 31 M${F.value.x+e.maskBorderRadius},${F.value.y} 32 h${F.value.width-2*e.maskBorderRadius} 33 a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},${e.maskBorderRadius} 34 v${F.value.height-2*e.maskBorderRadius} 35 a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},${e.maskBorderRadius} 36 h${-(F.value.width-2*e.maskBorderRadius)} 37 a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius} 38 v${-(F.value.height-2*e.maskBorderRadius)} 39 a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);dl(N=>{if(w.value){const D=_t(w.value),I=ie=>{if(ie.sourceEvent.type!=="wheel"||!h.value||!p.value)return;const ae=ie.sourceEvent.ctrlKey&&Nn()?10:1,G=-ie.sourceEvent.deltaY*(ie.sourceEvent.deltaMode===1?.05:ie.sourceEvent.deltaMode?1:.002)*e.zoomStep,q=l.value.zoom*2**(G*ae);p.value.scaleTo(h.value,q)},V=ie=>{if(ie.sourceEvent.type!=="mousemove"||!h.value||!p.value)return;const ae=ne.value*Math.max(1,l.value.zoom)*(e.inversePan?-1:1),G={x:l.value.x-ie.sourceEvent.movementX*ae,y:l.value.y-ie.sourceEvent.movementY*ae},q=[[0,0],[c.value.width,c.value.height]],j=Zi.translate(G.x,G.y).scale(l.value.zoom),fe=p.value.constrain()(j,q,u.value);p.value.transform(h.value,fe)},K=X0().wheelDelta(ie=>di(ie)*(e.zoomStep/10)).on("zoom",e.pannable?V:()=>{}).on("zoom.wheel",e.zoomable?I:()=>{});D.call(K),N(()=>{D.on("zoom",null)})}},{flush:"post"});function b(N){const[D,I]=gt(N);t("click",{event:N,position:{x:D,y:I}})}
39function P(N,D){const I={event:N,node:D,connectedEdges:Tt([D],s.value)};d.miniMapNodeClick(I),t("nodeClick",I)}function f(N,D){const I={event:N,node:D,connectedEdges:Tt([D],s.value)};d.miniMapNodeDoubleClick(I),t("nodeDblclick",I)}function x(N,D){const I={event:N,node:D,connectedEdges:Tt([D],s.value)};d.miniMapNodeMouseEnter(I),t("nodeMouseenter",I)}function g(N,D){const I={event:N,node:D,connectedEdges:Tt([D],s.value)};d.miniMapNodeMouseMove(I),t("nodeMousemove",I)}function E(N,D){const I={event:N,node:D,connectedEdges:Tt([D],s.value)};d.miniMapNodeMouseLeave(I),t("nodeMouseleave",I)}return(N,D)=>(O(),pe(B(ys),{position:N.position,class:bt(["vue-flow__minimap",{pannable:N.pannable,zoomable:N.zoomable}])},{default:Z(()=>[(O(),te("svg",{ref_key:"el",ref:w,width:y.value,height:S.value,viewBox:[Y.value.x,Y.value.y,Y.value.width,Y.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${B(a)}`,onClick:b},[N.ariaLabel?(O(),te("title",{key:0,id:`vue-flow__minimap-${B(a)}`},_e(N.ariaLabel),9,q0)):$e("",!0),(O(!0),te(Ne,null,Le(B($),I=>(O(),pe(W0,{id:I.id,key:I.id,f:"",position:I.computedPosition,dimensions:I.dimensions,selected:I.selected,dragging:I.dragging,style:ze(I.style),class:bt(z.value(I)),color:v.value(I),"border-radius":N.nodeBorderRadius,"stroke-color":M.value(I),"stroke-width":N.nodeStrokeWidth,"shape-rendering":B(C),type:I.type,hidden:I.hidden,onClick:V=>P(V,I),onDblclick:V=>f(V,I),onMouseenter:V=>x(V,I),onMousemove:V=>g(V,I),onMouseleave:V=>E(V,I)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"]))),128)),H("path",{class:"vue-flow__minimap-mask",d:U.value,fill:N.maskColor,stroke:N.maskStrokeColor,"stroke-width":N.maskStrokeWidth,"fill-rule":"evenodd"},null,8,K0)],8,Z0))]),_:1},8,["position","class"]))}}),Ws=e=>(Et("data-v-4dd8a774"),e=e(),St(),e),j0={class:"trigger-node"},ey=Ws(()=>H("div",{class:"trigger-node-icon"},[H("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[H("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z"})])],-1)),ty={class:"trigger-node-content"},ny=Ws(()=>H("div",{class:"trigger-node-title"},"Trigger",-1)),oy={class:"trigger-node-label"},iy=ue({__name:"TriggerNode",props:{data:{}},setup(e){const t=e,{t:n}=on(),o=W(()=>t.data.trigger_type?n(`edm.automation.trigger.${t.data.trigger_type}`):n("edm.automation.builder.select_trigger"));return(i,r)=>(O(),te("div",j0,[ey,H("div",ty,[ny,H("div",oy,_e(o.value),1)]),R(B(Ae),{type:"source",position:B(Q).Bottom},null,8,["position"])]))}}),ry=Fe(iy,[["__scopeId","data-v-4dd8a774"]]),Zs=e=>(Et("data-v-5ddaa8db"),e=e(),St(),e),ay={class:"action-node send-email-node"},sy=Zs(()=>H("div",{class:"action-node-icon",style:{background:"#e6f4ff",color:"#1890ff"}},[H("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[H("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"}),H("polyline",{points:"22,6 12,13 2,6"})])],-1)),ly={class:"action-node-content"},uy=Zs(()=>H("div",{class:"action-node-title"},"Send Email",-1)),cy={class:"action-node-summary"},dy=ue({__name:"SendEmailNode",props:{data:{}},setup(e){const t=e,n=W(()=>{var o,i;return(o=t.data.config)!=null&&o.subject?t.data.config.subject:(i=t.data.config)!=null&&i.template_name?t.data.config.template_name:"Configure email..."});return(o,i)=>(O(),te("div",ay,[R(B(Ae),{type:"target",position:B(Q).Top},null,8,["position"]),sy,H("div",ly,[uy,H("div",cy,_e(n.value),1)]),R(B(Ae),{type:"source",position:B(Q).Bottom},null,8,["position"])]))}}),fy=Fe(dy,[["__scopeId","data-v-5ddaa8db"]]),qs=e=>(Et("data-v-6ca44020"),e=e(),St(),e),hy={class:"action-node wait-node"},py=qs(()=>H("div",{class:"action-node-icon",style:{background:"#fff7e6",color:"#fa8c16"}},[H("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[H("circle",{cx:"12",cy:"12",r:"10"}),H("polyline",{points:"12 6 12 12 16 14"})])],-1)),gy={class:"action-node-content"},vy=qs(()=>H("div",{class:"action-node-title"},"Wait / Delay",-1)),my={class:"action-node-summary"},yy=ue({__name:"WaitNode",props:{data:{}},setup(e){const t=e,n=W(()=>{var o,i;return(o=t.data.config)!=null&&o.duration&&((i=t.data.config)!=null&&i.unit)?`Wait ${t.data.config.duration} ${t.data.config.unit}`:"Configure delay..."});return(o,i)=>(O(),te("div",hy,[R(B(Ae),{type:"target",position:B(Q).Top},null,8,["position"]),py,H("div",gy,[vy,H("div",my,_e(n.value),1)]),R(B(Ae),{type:"source",position:B(Q).Bottom},null,8,["position"])]))}}),_y=Fe(yy,[["__scopeId","data-v-6ca44020"]]),Ks=e=>(Et("data-v-622ef77e"),e=e(),St(),e),wy={class:"action-node condition-node"},by=Ni('<div class="action-node-icon" style="background:#f9f0ff;color:#722ed1;" data-v-622ef77e><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewB
39ox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-622ef77e><polyline points="16 3 21 3 21 8" data-v-622ef77e></polyline><line x1="4" y1="20" x2="21" y2="3" data-v-622ef77e></line><polyline points="21 16 21 21 16 21" data-v-622ef77e></polyline><line x1="15" y1="15" x2="21" y2="21" data-v-622ef77e></line><line x1="4" y1="4" x2="9" y2="9" data-v-622ef77e></line></svg></div>',1),$y={class:"action-node-content"},xy=Ks(()=>H("div",{class:"action-node-title"},"Condition",-1)),Ey={class:"action-node-summary"},Sy=Ks(()=>H("div",{class:"condition-handles"},[H("div",{class:"handle-label yes-label"},"Yes"),H("div",{class:"handle-label no-label"},"No")],-1)),Ny=ue({__name:"ConditionNode",props:{data:{}},setup(e){const t=e,n=W(()=>{var o,i;return(o=t.data.config)!=null&&o.field&&((i=t.data.config)!=null&&i.operator)?`${t.data.config.field} ${t.data.config.operator} ${t.data.config.value||""}`:"Configure condition..."});return(o,i)=>(O(),te("div",wy,[R(B(Ae),{type:"target",position:B(Q).Top},null,8,["position"]),by,H("div",$y,[xy,H("div",Ey,_e(n.value),1)]),Sy,R(B(Ae),{id:"yes",type:"source",position:B(Q).Bottom,style:{left:"30%"}},null,8,["position"]),R(B(Ae),{id:"no",type:"source",position:B(Q).Bottom,style:{left:"70%"}},null,8,["position"])]))}}),ky=Fe(Ny,[["__scopeId","data-v-622ef77e"]]),Cy={class:"action-node audience-node"},My=Ni('<div class="action-node-icon" style="background:#e6fffb;color:#13c2c2;" data-v-6b3331ec><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-6b3331ec><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" data-v-6b3331ec></path><circle cx="9" cy="7" r="4" data-v-6b3331ec></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87" data-v-6b3331ec></path><path d="M16 3.13a4 4 0 0 1 0 7.75" data-v-6b3331ec></path></svg></div>',1),Ty={class:"action-node-content"},Iy={class:"action-node-title"},Ay={class:"action-node-summary"},Dy=ue({__name:"AudienceActionNode",props:{data:{}},setup(e){const t=e,n=W(()=>t.data.step_type==="remove_from_audience"?"Remove from Audience":"Add to Audience"),o=W(()=>{var i;return(i=t.data.config)!=null&&i.audience_name?t.data.config.audience_name:"Select audience..."});return(i,r)=>(O(),te("div",Cy,[R(B(Ae),{type:"target",position:B(Q).Top},null,8,["position"]),My,H("div",Ty,[H("div",Iy,_e(n.value),1),H("div",Ay,_e(o.value),1)]),R(B(Ae),{type:"source",position:B(Q).Bottom},null,8,["position"])]))}}),na=Fe(Dy,[["__scopeId","data-v-6b3331ec"]]),Py=e=>(Et("data-v-e74909c4"),e=e(),St(),e),zy={class:"action-node tag-node"},By=Py(()=>H("div",{class:"action-node-icon",style:{background:"#fff0f6",color:"#eb2f96"}},[H("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[H("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),H("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})])],-1)),Oy={class:"action-node-content"},Ry={class:"action-node-title"},Vy={class:"action-node-summary"},Hy=ue({__name:"TagActionNode",props:{data:{}},setup(e){const t=e,n=W(()=>t.data.step_type==="remove_tag"?"Remove Tag":"Add Tag"),o=W(()=>{var i,r;return(r=(i=t.data.config)==null?void 0:i.tags)!=null&&r.length?t.data.config.tags.join(", "):"Configure tags..."});return(i,r)=>(O(),te("div",zy,[R(B(Ae),{type:"target",position:B(Q).Top},null,8,["position"]),By,H("div",Oy,[H("div",Ry,_e(n.value),1),H("div",Vy,_e(o.value),1)]),R(B(Ae),{type:"source",position:B(Q).Bottom},null,8,["position"])]))}}),oa=Fe(Hy,[["__scopeId","data-v-e74909c4"]]),Qs=e=>(Et("data-v-3650a30e"),e=e(),St(),e),Fy={class:"action-node update-field-node"},Ly=Qs(()=>H("div",{class:"action-node-icon",style:{background:"#fcffe6",color:"#a0d911"}},[H("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[H("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),H("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})])],-1)),Yy={class:"action-node-content"},Xy=Qs(()=>H("div",{class:"action-node-title"},"Update Field",-1)),Uy={class:"action-node-summary"},Gy=ue({__name:"UpdateFieldNode",props:{data:{}},setup(e){const t=e,n=W(()=>{var o;return(o=t.data.config)!=null&&o.field?`${t.data.config.field} = ${t.data.config.value||"..."}`:"Configure field..."});return(o,i)=>(O(),te("div",Fy,[R(B(Ae),{type:"target",position:B(Q).Top},null,8,["position"]),Ly,H("div",Yy,[Xy,H("div",Uy,_e(n.value),1)]),R(B(Ae),{type:"source",position:B(Q).Bottom},null,8,["position"])]))}}),Wy=Fe(Gy,[["__scopeId","data-v-3650a30e"]]),Js=e=>(Et("data-v-35c3ad57"),e=e(),St(),e),Zy={class:"action-node webhook-node"},qy=Js(()=>H("div",{class:"action-node-icon",style:{background:"#f0f5ff",color:"#2f54eb"}},[H("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[H("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),H("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})])],-1)),Ky={class:"action-node-content"},Qy=Js(()=>H("div",{class:"action-node-title"},"Webhook",-1)),Jy={class:"action-node-summary"},jy=ue({__name:"WebhookNode",props:{data:{}},setup(e){const t=e,n=W(()=>{var o;if((o=t.data.config)!=null&&o.url){const i=t.data.config.method||"POST",r=t.data.config.url.length>
3930?t.data.config.url.substring(0,30)+"...":t.data.config.url;return`${i} ${r}`}return"Configure webhook..."});return(o,i)=>(O(),te("div",Zy,[R(B(Ae),{type:"target",position:B(Q).Top},null,8,["position"]),qy,H("div",Ky,[Qy,H("div",Jy,_e(n.value),1)]),R(B(Ae),{type:"source",position:B(Q).Bottom},null,8,["position"])]))}}),e_=Fe(jy,[["__scopeId","data-v-35c3ad57"]]),t_=["id","d","marker-end"],n_=["d"],o_=ue({__name:"DefaultEdge",props:{id:{},sourceX:{},sourceY:{},targetX:{},targetY:{},sourcePosition:{},targetPosition:{},style:{},markerEnd:{}},setup(e){const t=e,n=W(()=>zo({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition}));return(o,i)=>(O(),te(Ne,null,[H("path",{id:o.id,class:"vue-flow__edge-path",d:n.value[0],"marker-end":o.markerEnd,style:ze({stroke:"#b1b1b7",strokeWidth:2,...o.style})},null,12,t_),H("path",{d:n.value[0],fill:"none",stroke:"transparent","stroke-width":"20",style:{cursor:"pointer"}},null,8,n_)],64))}}),i_=["id","d","marker-end"],r_=["d"],a_=["x","y"],s_=ue({__name:"ConditionalEdge",props:{id:{},sourceX:{},sourceY:{},targetX:{},targetY:{},sourcePosition:{},targetPosition:{},sourceHandleId:{},label:{},style:{},markerEnd:{}},setup(e){const t=e,n=W(()=>zo({sourceX:t.sourceX,sourceY:t.sourceY,targetX:t.targetX,targetY:t.targetY,sourcePosition:t.sourcePosition,targetPosition:t.targetPosition})),o=W(()=>t.sourceHandleId==="yes"),i=W(()=>o.value?"#52c41a":"#ff4d4f"),r=W(()=>t.label||(o.value?"Yes":"No")),a=W(()=>n.value[1]),s=W(()=>n.value[2]);return(l,u)=>(O(),te(Ne,null,[H("path",{id:l.id,class:"vue-flow__edge-path",d:n.value[0],"marker-end":l.markerEnd,style:ze({stroke:i.value,strokeWidth:2,...l.style})},null,12,i_),H("path",{d:n.value[0],fill:"none",stroke:"transparent","stroke-width":"20",style:{cursor:"pointer"}},null,8,r_),H("text",{x:a.value,y:s.value,class:"vue-flow__edge-text","text-anchor":"middle","dominant-baseline":"middle",style:ze({fill:i.value,fontSize:"11px",fontWeight:600})},_e(r.value),13,a_)],64))}}),l_=ue({__name:"WorkflowCanvas",props:{initialNodes:{},initialEdges:{}},emits:["nodeSelected","nodesChange","edgesChange"],setup(e,{expose:t,emit:n}){const o=e,i=n,r={trigger:Pe(ry),send_email:Pe(fy),wait:Pe(_y),condition:Pe(ky),add_to_audience:Pe(na),remove_from_audience:Pe(na),add_tag:Pe(oa),remove_tag:Pe(oa),update_field:Pe(Wy),webhook:Pe(e_)},a={default:Pe(o_),conditional:Pe(s_)},{nodes:s,edges:l,addNodes:u,addEdges:c,removeEdges:d,onConnect:h,onNodeClick:p,onPaneClick:$,onEdgeDoubleClick:w,onEdgesChange:y,project:S}=ke({nodes:o.initialNodes||[],edges:o.initialEdges||[]}),C=b=>({send_email:"send_email",wait:"wait",condition:"condition",add_to_audience:"add_to_audience",remove_from_audience:"remove_from_audience",add_tag:"add_tag",remove_tag:"remove_tag",update_field:"update_field",webhook:"webhook"})[b]||b;h(b=>{const P=s.value.find(g=>g.id===b.source),f=(P==null?void 0:P.type)==="condition",x={id:qi(),source:b.source,target:b.target,sourceHandle:b.sourceHandle||void 0,targetHandle:b.targetHandle||void 0,type:f?"conditional":"default",label:f?b.sourceHandle==="yes"?"Yes":"No":void 0};c([x]),i("edgesChange",l.value)}),p(({node:b})=>{i("nodeSelected",b)}),$(()=>{i("nodeSelected",null)}),w(({edge:b})=>{d([b.id]),i("edgesChange",l.value)}),y(()=>{i("edgesChange",l.value)});const v=b=>{b.preventDefault(),b.dataTransfer&&(b.dataTransfer.dropEffect="move")},M=de(null),z=b=>{var D,I;const P=(D=b.dataTransfer)==null?void 0:D.getData("application/vueflow");if(!P)return;const f=(I=b.target.closest(".vue-flow"))==null?void 0:I.getBoundingClientRect();if(!f)return;const x=S({x:b.clientX-f.left,y:b.clientY-f.top}),g=qi(),E=C(P);u([{id:g,type:E,position:x,data:{step_type:P,config:{},label:P}}]),i("nodesChange",s.value)};return t({getNodes:()=>s.value,getEdges:()=>l.value,updateNodeData:(b,P)=>{const f=s.value.find(x=>x.id===b);f&&(f.data={...f.data,...P})},removeNode:b=>{s.value=s.value.filter(P=>P.id!==b),l.value=l.value.filter(P=>P.source!==b&&P.target!==b),i("nodesChange",s.value),i("edgesChange",l.value),i("nodeSelected",null)},setNodes:b=>{s.value=b},setEdges:b=>{l.value=b}}),(b,P)=>(O(),te("div",{ref_key:"vueFlowRef",ref:M,class:"workflow-canvas",onDrop:z,onDragover:v},[R(B(Ip),{"node-types":r,"edge-types":a,"default-viewport":{zoom:.8,x:200,y:50},"min-zoom":.3,"max-zoom":1.5,"fit-view-on-init":"","snap-to-grid":!0,"snap-grid":[16,16],"delete-key-code":["Delete","Backspace"],"edges-updatable":!0},{default:Z(()=>[R(B(Vp),{gap:16}
39),R(B(vg)),R(B(J0))]),_:1})],544))}}),u_=Fe(l_,[["__scopeId","data-v-b561733b"]]),c_={class:"node-palette"},d_={class:"palette-title"},f_={class:"palette-hint"},h_={class:"palette-items"},p_=["onDragstart"],g_={class:"palette-item-label"},v_=ue({__name:"NodePalette",setup(e){const{t}=on(),n=[{type:"send_email",label:"Send Email",icon:"M",color:"#1890ff",bgColor:"#e6f4ff"},{type:"wait",label:"Wait / Delay",icon:"W",color:"#fa8c16",bgColor:"#fff7e6"},{type:"condition",label:"Condition",icon:"C",color:"#722ed1",bgColor:"#f9f0ff"},{type:"add_to_audience",label:"Add to Audience",icon:"A+",color:"#13c2c2",bgColor:"#e6fffb"},{type:"remove_from_audience",label:"Remove from Audience",icon:"A-",color:"#13c2c2",bgColor:"#e6fffb"},{type:"update_field",label:"Update Field",icon:"UF",color:"#a0d911",bgColor:"#fcffe6"},{type:"webhook",label:"Webhook",icon:"WH",color:"#2f54eb",bgColor:"#f0f5ff"}],o=(i,r)=>{i.dataTransfer&&(i.dataTransfer.setData("application/vueflow",r.type),i.dataTransfer.effectAllowed="move")};return(i,r)=>(O(),te("div",c_,[H("div",d_,_e(B(t)("edm.automation.builder.node_palette")),1),H("div",f_,_e(B(t)("edm.automation.builder.drag_to_add")),1),H("div",h_,[(O(),te(Ne,null,Le(n,a=>H("div",{key:a.type,class:"palette-item",draggable:"true",onDragstart:s=>o(s,a)},[H("div",{class:"palette-item-icon",style:ze({background:a.bgColor,color:a.color})},_e(a.icon),5),H("span",g_,_e(a.label),1)],40,p_)),64))])]))}}),m_=Fe(v_,[["__scopeId","data-v-6c16f24f"]]),y_={class:"border-t border-gray-200 pt-4"},__={class:"mt-1 text-xs text-gray-500"},w_={key:0,class:"mt-4"},b_={class:"mt-1 text-xs text-gray-500"},$_=ue({__name:"SendEmailConfig",props:{config:{}},emits:["update"],setup(e,{emit:t}){const n=e,o=t,{t:i}
39=on(),r=da(),a=hl(),s=de([]),l=C=>{if(!C)return{prefix:"",domain:""};const v=C.indexOf("@");return v<=0?{prefix:C,domain:""}:{prefix:C.substring(0,v),domain:C.substring(v+1)}},u=C=>{const{domain:v}=l(C);if(!v)return;const M=a.verifiedDomains.find(z=>z.domain===v);return M==null?void 0:M.id},c=l(n.config.from_email||""),d=de({template_id:n.config.template_id||void 0,subject:n.config.subject||"",from_name:n.config.from_name||"",from_email:n.config.from_email||"",custom_domain_id:n.config.custom_domain_id||void 0,email_prefix:c.prefix||"",enable_reply_to:!!n.config.enable_reply_to,reply_to_name:n.config.reply_to_name||"",reply_to:n.config.reply_to||""}),h=W(()=>{var C;return((C=a.quotaStatus)==null?void 0:C.is_internal)===!0}),p=W(()=>h.value?"[email protected]":"[email protected]"),$=W(()=>a.verifiedDomains.map(C=>({label:C.domain,value:C.id}))),w=()=>{if(!d.value.custom_domain_id)return"";const C=a.verifiedDomains.find(v=>v.id===d.value.custom_domain_id);return(C==null?void 0:C.domain)||""},y=()=>{const C=s.value.find(v=>v.id===d.value.template_id);o("update",{template_id:d.value.template_id,template_name:(C==null?void 0:C.name)||"",subject:d.value.subject,from_name:d.value.from_name,from_email:d.value.from_email,custom_domain_id:d.value.custom_domain_id||null,enable_reply_to:d.value.enable_reply_to,reply_to_name:d.value.reply_to_name,reply_to:d.value.reply_to})};ve(()=>[d.value.email_prefix,d.value.custom_domain_id,h.value],()=>{if(h.value)d.value.from_email=p.value;else{const C=w();d.value.from_email=d.value.email_prefix&&C?`${d.value.email_prefix}@${C}`:""}y()}),ve(()=>[d.value.template_id,d.value.subject,d.value.from_name,d.value.enable_reply_to,d.value.reply_to_name,d.value.reply_to],()=>y());const S=()=>{r.push({name:"edm_custom_domains"})};return He(async()=>{var C;if(await Promise.all([a.loadCustomDomains(),a.loadQuotaStatus()]),!d.value.custom_domain_id&&d.value.from_email){const v=u(d.value.from_email);v&&(d.value.custom_domain_id=v)}h.value&&(d.value.from_email=p.value);try{const v=await _l({per_page:100});v.code===200&&(s.value=(((C=v.data)==null?void 0:C.data)||[]).map(M=>({id:M.id,name:M.name})))}catch{}}),(C,v)=>{const M=Yt,z=Nt,L=kt,F=rn,X=ki,ne=ha,Y=pl,U=gl,b=Ct;return O(),pe(b,{layout:"vertical",model:d.value},{default:Z(()=>[R(L,{label:"Email Template"},{default:Z(()=>[R(z,{value:d.value.template_id,"onUpdate:value":v[0]||(v[0]=P=>d.value.template_id=P),placeholder:"Select a template","show-search":"","option-filter-prop":"label","allow-clear":""},{default:Z(()=>[(O(!0),te(Ne,null,Le(s.value,P=>(O(),pe(M,{key:P.id,value:P.id,label:P.name},{default:Z(()=>[Me(_e(P.name),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["value"])]),_:1}),R(L,{label:"Subject"},{default:Z(()=>[R(F,{value:d.value.subject,"onUpdate:value":v[1]||(v[1]=P=>d.value.subject=P),placeholder:"Email subject line"},null,8,["value"])]),_:1}),R(L,{label:"From Name"},{default:Z(()=>[R(F,{value:d.value.from_name,"onUpdate:value":v[2]||(v[2]=P=>d.value.from_name=P),placeholder:"Sender name"},null,8,["value"])]),_:1}),h.value?(O(),pe(L,{key:0,label:"From Email"},{default:Z(()=>[R(F,{value:p.value,disabled:""},null,8,["value"])]),_:1})):(O(),te(Ne,{key:1},[$.value.length===0?(O(),pe(ne,{key:0,type:"warning","show-icon":"",class:"mb-2"},{message:Z(()=>[Me(_e(B(i)("edm.campaign.no_domains_hint")),1)]),description:Z(()=>[R(X,{type:"link",class:"p-0",onClick:S},{default:Z(()=>[Me(_e(B(i)("edm.campaign.go_to_custom_domains"))+" â ",1)]),_:1})]),_:1})):$e("",!0),R(L,{label:"Sending Domain"},{default:Z(()=>[R(z,{value:d.value.custom_domain_id,"onUpdate:value":v[3]||(v[3]=P=>d.value.custom_domain_id=P),placeholder:"Select a verified domain",options:$.value,disabled:$.value.length===0,"allow-clear":""},null,8,["value","options","disabled"])]),_:1}),R(L,{label:"From Email"},{default:Z(()=>[R(Y,{compact:""},{default:Z(()=>[R(F,{value:d.value.email_prefix,"onUpdate:value":v[4]||(v[4]=P=>d.value.email_prefix=P),placeholder:"e.g. noreply",disabled:!d.value.custom_domain_id,style:{width:"calc(100% - 140px)"}},null,8,["value","disabled"]),R(F,{value:d.value.custom_domain_id?`@${w()}`:"",disabled:"",style:{width:"140px","text-align":"center","background-color":"#f5f5f5"}},null,8,["value"])]),_:1})]),_:1})],64)),H("div",y_,[R(U,{checked:d.value.enable_reply_to,"onUpdate:checked":v[5]||(v[5]=P=>d.value.enable_reply_to=P)},{default:Z(()=>[Me(_e(B(i)("edm.campaign.add_reply_to_field")),1)]),_:1},8,["checked"]),H("div",__,_e(B(i)("edm.campaign.reply_to_hint")),1),d.value.enable_reply_to?(O(),te("div",w_,[R(L,{label:B(i)("edm.campaign.reply_name"),name:"reply_to_name"},{default:Z(()=>[R(F,{value:d.value.reply_to_name,"onUpdate:value":v[6]||(v[6]=P=>d.value.reply_to_name=P),placeholder:B(i)("edm.campaign.reply_name_placeholder"),maxlength:255},null,8,["value","placeholder"]),H("div",b_,_e(B(i)("edm.campaign.reply_name_hint")),1)]),_:1},8,["label"]),R(L,{label:B(i)("edm.campaign.reply_email_address"),name:"reply_to",rules:[{required:!0,message:B(i)("edm.campaign.reply_email_placeholder"),trigger:"blur"},{type:"email",message:B(i)("edm.campaign.from_email_invalid"),trigger:"blur"}]},{default:Z(()=>
39[R(F,{value:d.value.reply_to,"onUpdate:value":v[7]||(v[7]=P=>d.value.reply_to=P),placeholder:B(i)("edm.campaign.reply_email_placeholder"),maxlength:255},null,8,["value","placeholder"])]),_:1},8,["label","rules"])])):$e("",!0)])]),_:1},8,["model"])}}}),x_=ue({__name:"WaitConfig",props:{config:{}},emits:["update"],setup(e,{emit:t}){const n=e,o=t,i=de({duration:n.config.duration||1,unit:n.config.unit||"days"});return ve(i,r=>{o("update",{...r})},{deep:!0}),(r,a)=>{const s=fa,l=kt,u=Yt,c=Nt,d=Ct;return O(),pe(d,{layout:"vertical",model:i.value},{default:Z(()=>[R(l,{label:"Duration"},{default:Z(()=>[R(s,{value:i.value.duration,"onUpdate:value":a[0]||(a[0]=h=>i.value.duration=h),min:1,max:365,style:{width:"100%"}},null,8,["value"])]),_:1}),R(l,{label:"Unit"},{default:Z(()=>[R(c,{value:i.value.unit,"onUpdate:value":a[1]||(a[1]=h=>i.value.unit=h)},{default:Z(()=>[R(u,{value:"minutes"},{default:Z(()=>[Me("Minutes")]),_:1}),R(u,{value:"hours"},{default:Z(()=>[Me("Hours")]),_:1}),R(u,{value:"days"},{default:Z(()=>[Me("Days")]),_:1}),R(u,{value:"weeks"},{default:Z(()=>[Me("Weeks")]),_:1})]),_:1},8,["value"])]),_:1})]),_:1},8,["model"])}}}),E_=ue({__name:"ConditionConfig",props:{config:{}},emits:["update"],setup(e,{emit:t}){const n=e,o=t,i=de({field:n.config.field||"",operator:n.config.operator||"equals",value:n.config.value||""}),r=de([]),a=[{value:"email",label:"Email"},{value:"name",label:"Name"},{value:"status",label:"Status"}],s=W(()=>{const u=[...a];return r.value.forEach(c=>{c.is_system&&(c.tag==="EMAIL"||c.tag==="NAME")||u.push({value:`custom_fields.${c.tag}`,label:`${c.title} (Custom)`})}),u}),l=[{value:"equals",label:"Equals"},{value:"not_equals",label:"Not Equals"},{value:"contains",label:"Contains"},{value:"not_contains",label:"Not Contains"},{value:"greater_than",label:"Greater Than"},{value:"less_than",label:"Less Than"},{value:"is_empty",label:"Is Empty"},{value:"is_not_empty",label:"Is Not Empty"}];return ve(i,u=>{o("update",{...u})},{deep:!0}),He(async()=>{try{const u=await Ci();u.code===200&&(r.value=u.data||[])}catch{}}),(u,c)=>{const d=Nt,h=kt,p=Yt,$=rn,w=Ct;return O(),pe(w,{layout:"vertical",model:i.value},{default:Z(()=>[R(h,{label:"Field"},{default:Z(()=>[R(d,{value:i.value.field,"onUpdate:value":c[0]||(c[0]=y=>i.value.field=y),placeholder:"Select field","show-search":"","option-filter-prop":"label",options:s.value},null,8,["value","options"])]),_:1}),R(h,{label:"Operator"},{default:Z(()=>[R(d,{value:i.value.operator,"onUpdate:value":c[1]||(c[1]=y=>i.value.operator=y)},{default:Z(()=>[(O(),te(Ne,null,Le(l,y=>R(p,{key:y.value,value:y.value},{default:Z(()=>[Me(_e(y.label),1)]),_:2},1032,["value"])),64))]),_:1},8,["value"])]),_:1}),["is_empty","is_not_empty"].includes(i.value.operator)?$e("",!0):(O(),pe(h,{key:0,label:"Value"},{default:Z(()=>[R($,{value:i.value.value,"onUpdate:value":c[2]||(c[2]=y=>i.value.value=y),placeholder:"Enter value"},null,8,["value"])]),_:1}))]),_:1},8,["model"])}}}),ia=ue({__name:"AudienceConfig",props:{config:{},audiences:{}},emits:["update"],setup(e,{emit:t}){const n=e,o=t,i=de({audience_id:n.config.audience_id||void 0});return ve(i,r=>{const a=n.audiences.find(s=>s.id===r.audience_id);o("update",{...r,audience_name:(a==null?void 0:a.name)||""})},{deep:!0}),(r,a)=>{const s=Yt,l=Nt,u=kt,c=Ct;return O(),pe(c,{layout:"vertical",model:i.value},{default:Z(()=>[R(u,{label:"Audience"},{default:Z(()=>[R(l,{value:i.value.audience_id,"onUpdate:value":a[0]||(a[0]=d=>i.value.audience_id=d),placeholder:"Select audience","show-search":"","option-filter-prop":"label","allow-clear":""},{default:Z(()=>[(O(!0),te(Ne,null,Le(r.audiences,d=>(O(),pe(s,{key:d.id,value:d.id,label:d.name},{default:Z(()=>[Me(_e(d.name),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["value"])]),_:1})]),_:1},8,["model"])}}}),ra=ue({__name:"TagConfig",props:{config:{}},emits:["update"],setup(e,{emit:t}){const n=e,o=t,i=de({tags:n.config.tags||[]});return ve(i,r=>{o("update",{...r})},{deep:!0}),(r,a)=>{const s=Nt,l=kt,u=Ct;return O(),pe(u,{layout:"vertical",model:i.value},{default:Z(()=>[R(l,{label:"Tags"},{default:Z(()=>[R(s,{value:i.value.tags,"onUpdate:value":a[0]||(a[0]=c=>i.value.tags=c),mode:"tags",placeholder:"Enter tags and press Enter","token-separators":[","]},null,8,["value"])]),_:1})]),_:1},8,["model"])}}}),S_=ue({__name:"UpdateFieldConfig",props:{config:{}},emits:["update"],setup(e,{emit:t}){const n=e,o=t,i=de({field:n.config.field||"",value:n.config.value||""}),r=de([]),a=[{value:"email",label:"Email"},{value:"name",label:"Name"},{value:"status",label:"Status"}],s=W(()=>{const u=[];return a.forEach(c=>
39u.push({...c,group:"System"})),r.value.forEach(c=>{c.is_system&&(c.tag==="EMAIL"||c.tag==="NAME")||u.push({value:`custom_fields.${c.tag}`,label:`${c.title} (Custom)`,group:"Custom"})}),u}),l=W(()=>{if(!i.value.field)return"text";if(i.value.field.startsWith("custom_fields.")){const u=i.value.field.substring(14),c=r.value.find(d=>d.tag===u);return(c==null?void 0:c.type)||"text"}return i.value.field==="status"?"status":"text"});return ve(i,u=>o("update",{...u}),{deep:!0}),He(async()=>{try{const u=await Ci();u.code===200&&(r.value=u.data||[])}catch{}}),(u,c)=>{const d=Yt,h=Nt,p=kt,$=rn,w=Ct;return O(),pe(w,{layout:"vertical",model:i.value},{default:Z(()=>[R(p,{label:"Field"},{default:Z(()=>[R(h,{value:i.value.field,"onUpdate:value":c[0]||(c[0]=y=>i.value.field=y),placeholder:"Select a field","show-search":"","option-filter-prop":"label"},{default:Z(()=>[(O(!0),te(Ne,null,Le(s.value,y=>(O(),pe(d,{key:y.value,value:y.value,label:y.label},{default:Z(()=>[Me(_e(y.label),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["value"])]),_:1}),R(p,{label:"Value"},{default:Z(()=>[l.value==="status"?(O(),pe(h,{key:0,value:i.value.value,"onUpdate:value":c[1]||(c[1]=y=>i.value.value=y),placeholder:"Select status"},{default:Z(()=>[R(d,{value:"subscribed"},{default:Z(()=>[Me("Subscribed")]),_:1}),R(d,{value:"unsubscribed"},{default:Z(()=>[Me("Unsubscribed")]),_:1})]),_:1},8,["value"])):(O(),pe($,{key:1,value:i.value.value,"onUpdate:value":c[2]||(c[2]=y=>i.value.value=y),placeholder:"Enter value"},null,8,["value"]))]),_:1})]),_:1},8,["model"])}}}),N_=ue({__name:"WebhookConfig",props:{config:{}},emits:["update"],setup(e,{emit:t}){const n=e,o=t,i=de({url:n.config.url||"",method:n.config.method||"POST"});return ve(i,r=>{o("update",{...r})},{deep:!0}),(r,a)=>{const s=Yt,l=Nt,u=kt,c=rn,d=Ct;return O(),pe(d,{layout:"vertical",model:i.value},{default:Z(()=>[R(u,{label:"Method"},{default:Z(()=>[R(l,{value:i.value.method,"onUpdate:value":a[0]||(a[0]=h=>i.value.method=h)},{default:Z(()=>[R(s,{value:"POST"},{default:Z(()=>[Me("POST")]),_:1}),R(s,{value:"GET"},{default:Z(()=>[Me("GET")]),_:1}),R(s,{value:"PUT"},{default:Z(()=>[Me("PUT")]),_:1})]),_:1},8,["value"])]),_:1}),R(u,{label:"URL"},{default:Z(()=>[R(c,{value:i.value.url,"onUpdate:value":a[1]||(a[1]=h=>i.value.url=h),placeholder:"https://example.com/webhook"},null,8,["value"])]),_:1})]),_:1},8,["model"])}}}),k_={class:"config-panel"},C_={class:"config-panel-header"},M_={class:"config-panel-title"},T_={class:"config-panel-body"},I_={key:1,class:"config-panel-empty"},A_=Ni('<div class="empty-icon" data-v-24033191><svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="#d9d9d9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-v-24033191><rect x="3" y="3" width="18" height="18" rx="2" ry="2" data-v-24033191></rect><line x1="9" y1="9" x2="15" y2="15" data-v-24033191></line><line x1="15" y1="9" x2="9" y2="15" data-v-24033191></line></svg></div>',1),D_={class:"empty-text"},P_=ue({__name:"NodeConfigPanel",props:{selectedNode:{},audiences:{}},emits:["updateNodeConfig","deleteNode"],setup(e,{emit:t}){const n=e,o=t,{t:i}
39=on(),r=W(()=>{var d;return n.selectedNode?((d=n.selectedNode.data)==null?void 0:d.step_type)||n.selectedNode.type:null}),a=W(()=>{var d,h;return((h=(d=n.selectedNode)==null?void 0:d.data)==null?void 0:h.config)||{}}),s=W(()=>({send_email:$_,wait:x_,condition:E_,add_to_audience:ia,remove_from_audience:ia,add_tag:ra,remove_tag:ra,update_field:S_,webhook:N_})[r.value||""]||null),l=W(()=>r.value?i(`edm.automation.step.${r.value}`):""),u=d=>{n.selectedNode&&o("updateNodeConfig",n.selectedNode.id,d)},c=()=>{n.selectedNode&&o("deleteNode",n.selectedNode.id)};return(d,h)=>{const p=ki;return O(),te("div",k_,[d.selectedNode&&s.value?(O(),te(Ne,{key:0},[H("div",C_,[H("div",M_,_e(l.value),1),R(p,{size:"small",danger:"",onClick:c},{default:Z(()=>[Me("Delete")]),_:1})]),H("div",T_,[(O(),pe(yt(s.value),{key:d.selectedNode.id,config:a.value,audiences:d.audiences,onUpdate:u},null,40,["config","audiences"]))])],64)):(O(),te("div",I_,[A_,H("div",D_,_e(B(i)("edm.automation.builder.select_node")),1)]))])}}}),z_=Fe(P_,[["__scopeId","data-v-24033191"]]),B_={class:"trigger-config"},O_={key:0,class:"hint"},R_=ue({__name:"TriggerConfigPanel",props:{triggerType:{},triggerConfig:{},audiences:{},campaigns:{}},emits:["update"],setup(e,{emit:t}){const n=e,o=t,{t:i}
39=on(),r=de(n.triggerType),a=de({...n.triggerConfig}),s=de([]),l=W(()=>s.value.filter(h=>h.type==="date").map(h=>({value:h.tag,label:h.title})));He(async()=>{try{const h=await Ci();h.code===200&&(s.value=h.data||[])}catch{}});const u=[{value:"contact_added",label:"Contact Added to Audience"},{value:"contact_subscribed",label:"Contact Subscribed"},{value:"contact_unsubscribed",label:"Contact Unsubscribed"},{value:"email_opened",label:"Email Opened"},{value:"email_clicked",label:"Email Link Clicked"},{value:"date_based",label:"Date Based"},{value:"integration_sync",label:"Integration Sync"}],c=["contact_added","contact_subscribed","contact_unsubscribed","integration_sync"],d=["email_opened","email_clicked"];return ve([r,a],()=>{r.value&&o("update",r.value,{...a.value})},{deep:!0}),(h,p)=>{const $=Yt,w=Nt,y=kt,S=rn,C=fa,v=ha,M=Ct;return O(),te("div",B_,[R(M,{layout:"vertical"},{default:Z(()=>[R(y,{label:B(i)("edm.automation.builder.select_trigger")},{default:Z(()=>[R(w,{value:r.value,"onUpdate:value":p[0]||(p[0]=z=>r.value=z),placeholder:B(i)("edm.automation.builder.select_trigger"),"show-search":"","option-filter-prop":"label"},{default:Z(()=>[(O(),te(Ne,null,Le(u,z=>R($,{key:z.value,value:z.value,label:z.label},{default:Z(()=>[Me(_e(z.label),1)]),_:2},1032,["value","label"])),64))]),_:1},8,["value","placeholder"])]),_:1},8,["label"]),r.value&&c.includes(r.value)?(O(),pe(y,{key:0,label:"Audience"},{default:Z(()=>[R(w,{value:a.value.audience_id,"onUpdate:value":p[1]||(p[1]=z=>a.value.audience_id=z),placeholder:"Select audience","show-search":"","option-filter-prop":"label","allow-clear":""},{default:Z(()=>[(O(!0),te(Ne,null,Le(h.audiences,z=>(O(),pe($,{key:z.id,value:z.id,label:z.name},{default:Z(()=>[Me(_e(z.name),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["value"])]),_:1})):$e("",!0),r.value&&d.includes(r.value)?(O(),te(Ne,{key:1},[R(y,{label:"Campaign"},{default:Z(()=>[R(w,{value:a.value.campaign_id,"onUpdate:value":p[2]||(p[2]=z=>a.value.campaign_id=z),placeholder:"Select campaign","show-search":"","option-filter-prop":"label","allow-clear":""},{default:Z(()=>[(O(!0),te(Ne,null,Le(h.campaigns,z=>(O(),pe($,{key:z.id,value:z.id,label:z.name},{default:Z(()=>[Me(_e(z.name),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["value"])]),_:1}),r.value==="email_clicked"?(O(),pe(y,{key:0,label:"URL (optional)"},{default:Z(()=>[R(S,{value:a.value.url,"onUpdate:value":p[3]||(p[3]=z=>a.value.url=z),placeholder:"Specific link URL"},null,8,["value"])]),_:1}
39)):$e("",!0)],64)):$e("",!0),r.value==="tag_added"?(O(),pe(y,{key:2,label:"Tags"},{default:Z(()=>[R(w,{value:a.value.tags,"onUpdate:value":p[4]||(p[4]=z=>a.value.tags=z),mode:"tags",placeholder:"Enter tags","token-separators":[","]},null,8,["value"])]),_:1})):$e("",!0),r.value==="date_based"?(O(),te(Ne,{key:3},[R(y,{label:"Date Field"},{default:Z(()=>[R(w,{value:a.value.field,"onUpdate:value":p[5]||(p[5]=z=>a.value.field=z),placeholder:"Select a date field",options:l.value,disabled:l.value.length===0},null,8,["value","options","disabled"]),l.value.length===0?(O(),te("div",O_," No date-type custom fields defined. Create one in Audiences â Custom Fields. ")):$e("",!0)]),_:1}),R(y,{label:"Offset Days"},{default:Z(()=>[R(C,{value:a.value.offset_days,"onUpdate:value":p[6]||(p[6]=z=>a.value.offset_days=z),min:-365,max:365,style:{width:"100%"}},null,8,["value"])]),_:1})],64)):$e("",!0),r.value==="manual"?(O(),pe(v,{key:4,message:"This automation can only be triggered manually.",type:"info","show-icon":""})):$e("",!0)]),_:1})])}}}),V_=Fe(R_,[["__scopeId","data-v-3f2df20c"]]),js=e=>(Et("data-v-19f8e094"),e=e(),St(),e),H_={class:"automation-builder"},F_={class:"builder-topbar"},L_={class:"topbar-left"},Y_=js(()=>H("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[H("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),H("polyline",{points:"12 19 5 12 12 5"})],-1)),X_={class:"topbar-right"},U_={class:"builder-content"},G_={class:"builder-left"},W_={class:"builder-center"},Z_={class:"builder-right"},q_=js(()=>H("div",{class:"config-panel-header",style:{padding:"16px","border-bottom":"1px solid #f0f0f0"}},[H("div",{style:{"font-size":"15px","font-weight":"600",color:"#333"}}
39,"Trigger Configuration")],-1)),K_=ue({__name:"AutomationBuilder",setup(e){const t=vl(),n=da(),{t:o}=on(),i=W(()=>!!t.params.id),r=W(()=>t.params.id?Number(t.params.id):null),a=de(!1),s=de(!1),l=de(!1),u=de(null),c=de(null),d=de(!1),h=de(o("edm.automation.builder.untitled_automation")),p=de(""),$=de(""),w=de({}),y=de([]),S=de([]),C=de([{id:"trigger-node",type:"trigger",position:{x:250,y:50},data:{trigger_type:"",trigger_config:{}},deletable:!1}]),v=de([]),M=async()=>{var P,f;try{const x=await ml({per_page:100});x.code===200&&(y.value=(((P=x.data)==null?void 0:P.data)||[]).map(g=>({id:g.id,name:g.name})))}catch(x){console.warn("[AutomationBuilder] Failed to load audiences:",x)}try{const x=await El({per_page:100});x.code===200&&(S.value=(((f=x.data)==null?void 0:f.data)||[]).map(g=>({id:g.id,name:g.name})))}catch(x){console.warn("[AutomationBuilder] Failed to load campaigns:",x)}};He(async()=>{if(M(),i.value&&r.value){a.value=!0;try{const P=await wl(r.value);if(P.code===200&&P.data){const f=P.data;h.value=f.name,p.value=f.description||"",$.value=f.trigger_type||"",w.value=Array.isArray(f.trigger_config)?{}:f.trigger_config||{};const x=[{id:"trigger-node",type:"trigger",position:{x:250,y:50},data:{trigger_type:f.trigger_type,trigger_config:f.trigger_config},deletable:!1}];f.steps&&f.steps.forEach(E=>{const N=z(E.type);x.push({id:E.step_uuid,type:N,position:{x:E.position_x,y:E.position_y},data:{step_type:E.type,config:E.config||{},label:E.name||E.type}})});const g=[];
39f.edges&&f.edges.forEach(E=>{const N=x.find(I=>I.id===E.source_step_uuid),D=(N==null?void 0:N.type)==="condition";g.push({id:E.edge_uuid,source:E.source_step_uuid,target:E.target_step_uuid,sourceHandle:E.source_handle||void 0,type:D?"conditional":"default",label:E.label||void 0})}),C.value=x,v.value=g}}catch{qe.error("Failed to load automation")}finally{a.value=!1,l.value=!0}}else l.value=!0});const z=P=>P,L=P=>{(P==null?void 0:P.type)==="trigger"?(c.value=null,d.value=!0):(c.value=P,d.value=!1)},F=(P,f)=>{$.value=P,w.value=f,u.value&&u.value.updateNodeData("trigger-node",{trigger_type:P,trigger_config:f})},X=(P,f)=>{u.value&&u.value.updateNodeData(P,{config:f})},ne=P=>{u.value&&(u.value.removeNode(P),c.value=null)},Y=()=>{if(!u.value)return{steps:[],edges:[]};const P=u.value.getNodes(),f=u.value.getEdges(),x=P.filter(E=>E.type!=="trigger").map(E=>({step_uuid:E.id,type:E.data.step_type||E.type,name:E.data.label||E.data.step_type||E.type,config:E.data.config||{},position_x:Math.round(E.position.x),position_y:Math.round(E.position.y),sort_order:0})),g=f.map(E=>({edge_uuid:E.id,source_step_uuid:E.source,target_step_uuid:E.target,source_handle:E.sourceHandle||null,label:E.label||null}));return{steps:x,edges:g}},U=async(P=!1)=>{if(!h.value.trim()){qe.warning("Please enter an automation name");return}if(!$.value){qe.warning("Please select a trigger type");return}s.value=!0;try{const{steps:f,edges:x}=Y(),g={name:h.value,description:p.value,trigger_type:$.value,trigger_config:w.value,steps:f,edges:x};let E=r.value;if(i.value&&r.value){const N=await bl(r.value,g);if(N.code===200)qe.success(o("edm.automation.saved_successfully"));else{qe.error(N.message||"Save failed");return}}else{const N=await $l(g);if(N.code===200&&N.data)E=N.data.id,qe.success(o("edm.automation.saved_successfully")),n.replace({name:"edm_automation_edit",params:{id:E}});else{qe.error(N.message||"Save failed");return}}if(P&&E){const N=await xl(E);N.code===200?(qe.success(o("edm.automation.activated_successfully")),n.push({name:"edm_automation_list"})):qe.error(N.message||"Activation failed")}}catch{qe.error("An error occurred while saving")}finally{s.value=!1}},b=()=>{n.push({name:"edm_automation_list"})};return(P,f)=>{const x=ki,g=rn,E=yl;return O(),te("div",H_,[H("div",F_,[H("div",L_,[R(x,{onClick:b},{icon:Z(()=>[Y_]),_:1}),R(g,{value:h.value,"onUpdate:value":f[0]||(f[0]=N=>h.value=N),placeholder:B(o)("edm.automation.builder.workflow_name"),class:"name-input",bordered:!1,size:"large"},null,8,["value","placeholder"])]),H("div",X_,[R(x,{loading:s.value,onClick:f[1]||(f[1]=N=>U(!1))},{default:Z(()=>[Me(_e(B(o)("edm.automation.builder.save_draft")),1)]),_:1},8,["loading"]),R(x,{type:"primary",loading:s.value,onClick:f[2]||(f[2]=N=>U(!0))},{default:Z(()=>[Me(_e(B(o)("edm.automation.builder.save_and_activate")),1)]),_:1},8,["loading"])])]),H("div",U_,[l.value?(O(),pe(E,{key:0,spinning:a.value,class:"builder-spin"},{default:Z(()=>[H("div",G_,[R(m_)]),H("div",W_,[R(u_,{ref_key:"canvasRef",ref:u,"initial-nodes":C.value,"initial-edges":v.value,onNodeSelected:L,onNodesChange:()=>{},onEdgesChange:()=>{}},null,8,["initial-nodes","initial-edges"])]),H("div",Z_,[d.value?(O(),te(Ne,{key:0},[q_,R(V_,{"trigger-type":$.value,"trigger-config":w.value,audiences:y.value,campaigns:S.value,onUpdate:F},null,8,["trigger-type","trigger-config","audiences","campaigns"])],64)):(O(),pe(z_,{key:1,"selected-node":c.value,audiences:y.value,onUpdateNodeConfig:X,onDeleteNode:ne},null,8,["selected-node","audiences"]))])]),_:1},8,["spinning"])):$e("",!0)])])}}}),o1=Fe(K_,[["__scopeId","data-v-19f8e094"]]);export{o1 as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.