New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vue-flow/node-resizer

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue-flow/node-resizer - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

2

./dist/vue-flow-node-resizer.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("vue"),q=require("@vue-flow/core");var et="http://www.w3.org/1999/xhtml";const mt={svg:"http://www.w3.org/2000/svg",xhtml:et,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function yt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),mt.hasOwnProperty(e)?{space:mt[e],local:t}:t}function Pt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===et&&e.documentElement.namespaceURI===et?e.createElement(t):e.createElementNS(n,t)}}function Ht(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function vt(t){var e=yt(t);return(e.local?Ht:Pt)(e)}function Vt(){}function _t(t){return t==null?Vt:function(){return this.querySelector(t)}}function Lt(t){typeof t!="function"&&(t=_t(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o=e[r],l=o.length,s=i[r]=new Array(l),a,c,f=0;f<l;++f)(a=o[f])&&(c=t.call(a,a.__data__,f,o))&&("__data__"in a&&(c.__data__=a.__data__),s[f]=c);return new N(i,this._parents)}function Bt(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Mt(){return[]}function Tt(t){return t==null?Mt:function(){return this.querySelectorAll(t)}}function Ft(t){return function(){return Bt(t.apply(this,arguments))}}function Wt(t){typeof t=="function"?t=Ft(t):t=Tt(t);for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var l=e[o],s=l.length,a,c=0;c<s;++c)(a=l[c])&&(i.push(t.call(a,a.__data__,c,l)),r.push(a));return new N(i,r)}function Xt(t){return function(){return this.matches(t)}}function wt(t){return function(e){return e.matches(t)}}var Dt=Array.prototype.find;function It(t){return function(){return Dt.call(this.children,t)}}function Yt(){return this.firstElementChild}function Ot(t){return this.select(t==null?Yt:It(typeof t=="function"?t:wt(t)))}var qt=Array.prototype.filter;function Ut(){return Array.from(this.children)}function $t(t){return function(){return qt.call(this.children,t)}}function Kt(t){return this.selectAll(t==null?Ut:$t(typeof t=="function"?t:wt(t)))}function Gt(t){typeof t!="function"&&(t=Xt(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o=e[r],l=o.length,s=i[r]=[],a,c=0;c<l;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&s.push(a);return new N(i,this._parents)}function xt(t){return new Array(t.length)}function Jt(){return new N(this._enter||this._groups.map(xt),this._parents)}function j(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}j.prototype={constructor:j,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Qt(t){return function(){return t}}function Zt(t,e,n,i,r,o){for(var l=0,s,a=e.length,c=o.length;l<c;++l)(s=e[l])?(s.__data__=o[l],i[l]=s):n[l]=new j(t,o[l]);for(;l<a;++l)(s=e[l])&&(r[l]=s)}function jt(t,e,n,i,r,o,l){var s,a,c=new Map,f=e.length,m=o.length,d=new Array(f),x;for(s=0;s<f;++s)(a=e[s])&&(d[s]=x=l.call(a,a.__data__,s,e)+"",c.has(x)?r[s]=a:c.set(x,a));for(s=0;s<m;++s)x=l.call(t,o[s],s,o)+"",(a=c.get(x))?(i[s]=a,a.__data__=o[s],c.delete(x)):n[s]=new j(t,o[s]);for(s=0;s<f;++s)(a=e[s])&&c.get(d[s])===a&&(r[s]=a)}function te(t){return t.__data__}function ee(t,e){if(!arguments.length)return Array.from(this,te);var n=e?jt:Zt,i=this._parents,r=this._groups;typeof t!="function"&&(t=Qt(t));for(var o=r.length,l=new Array(o),s=new Array(o),a=new Array(o),c=0;c<o;++c){var f=i[c],m=r[c],d=m.length,x=ne(t.call(f,f&&f.__data__,c,i)),_=x.length,B=s[c]=new Array(_),M=l[c]=new Array(_),X=a[c]=new Array(d);n(f,m,B,M,X,x,e);for(var b=0,k=0,u,g;b<_;++b)if(u=B[b]){for(b>=k&&(k=b+1);!(g=M[k])&&++k<_;);u._next=g||null}}return l=new N(l,i),l._enter=s,l._exit=a,l}function ne(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ie(){return new N(this._exit||this._groups.map(xt),this._parents)}function re(t,e,n){var i=this.enter(),r=this,o=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?o.remove():n(o),i&&r?i.merge(r).order():r}function oe(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,o=i.length,l=Math.min(r,o),s=new Array(r),a=0;a<l;++a)for(var c=n[a],f=i[a],m=c.length,d=s[a]=new Array(m),x,_=0;_<m;++_)(x=c[_]||f[_])&&(d[_]=x);for(;a<r;++a)s[a]=n[a];return new N(s,this._parents)}function se(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,o=i[r],l;--r>=0;)(l=i[r])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function le(t){t||(t=ue);function e(m,d){return m&&d?t(m.__data__,d.__data__):!m-!d}for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var l=n[o],s=l.length,a=r[o]=new Array(s),c,f=0;f<s;++f)(c=l[f])&&(a[f]=c);a.sort(e)}return new N(r,this._parents).order()}function ue(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ae(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ce(){return Array.from(this)}function fe(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var l=i[r];if(l)return l}return null}function he(){let t=0;for(const e of this)++t;return t}function de(){return!this.node()}function me(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],o=0,l=r.length,s;o<l;++o)(s=r[o])&&t.call(s,s.__data__,o,r);return this}function ge(t){return function(){this.removeAttribute(t)}}function pe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ye(t,e){return function(){this.setAttribute(t,e)}}function ve(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function _e(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function we(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function xe(t,e){var n=yt(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?pe:ge:typeof e=="function"?n.local?we:_e:n.local?ve:ye)(n,e))}function bt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function be(t){return function(){this.style.removeProperty(t)}}function Ae(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Ce(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function Se(t,e,n){return arguments.length>1?this.each((e==null?be:typeof e=="function"?Ce:Ae)(t,e,n==null?"":n)):ze(this.node(),t)}function ze(t,e){return t.style.getPropertyValue(e)||bt(t).getComputedStyle(t,null).getPropertyValue(e)}function Ee(t){return function(){delete this[t]}}function Re(t,e){return function(){this[t]=e}}function Ne(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function ke(t,e){return arguments.length>1?this.each((e==null?Ee:typeof e=="function"?Ne:Re)(t,e)):this.node()[t]}function At(t){return t.trim().split(/^|\s+/)}function rt(t){return t.classList||new Ct(t)}function Ct(t){this._node=t,this._names=At(t.getAttribute("class")||"")}Ct.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function St(t,e){for(var n=rt(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function zt(t,e){for(var n=rt(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function Pe(t){return function(){St(this,t)}}function He(t){return function(){zt(this,t)}}function Ve(t,e){return function(){(e.apply(this,arguments)?St:zt)(this,t)}}function Le(t,e){var n=At(t+"");if(arguments.length<2){for(var i=rt(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?Ve:e?Pe:He)(n,e))}function Be(){this.textContent=""}function Me(t){return function(){this.textContent=t}}function Te(t){return function(){var e=t.apply(this,arguments);this.textContent=e==null?"":e}}function Fe(t){return arguments.length?this.each(t==null?Be:(typeof t=="function"?Te:Me)(t)):this.node().textContent}function We(){this.innerHTML=""}function Xe(t){return function(){this.innerHTML=t}}function De(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e==null?"":e}}function Ie(t){return arguments.length?this.each(t==null?We:(typeof t=="function"?De:Xe)(t)):this.node().innerHTML}function Ye(){this.nextSibling&&this.parentNode.appendChild(this)}function Oe(){return this.each(Ye)}function qe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ue(){return this.each(qe)}function $e(t){var e=typeof t=="function"?t:vt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Ke(){return null}function Ge(t,e){var n=typeof t=="function"?t:vt(t),i=e==null?Ke:typeof e=="function"?e:_t(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function Je(){var t=this.parentNode;t&&t.removeChild(this)}function Qe(){return this.each(Je)}function Ze(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function je(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function tn(t){return this.select(t?je:Ze)}function en(t){return arguments.length?this.property("__data__",t):this.node().__data__}function nn(t){return function(e){t.call(this,e,this.__data__)}}function rn(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function on(t){return function(){var e=this.__on;if(!!e){for(var n=0,i=-1,r=e.length,o;n<r;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++i]=o;++i?e.length=i:delete this.__on}}}function sn(t,e,n){return function(){var i=this.__on,r,o=nn(e);if(i){for(var l=0,s=i.length;l<s;++l)if((r=i[l]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=e;return}}this.addEventListener(t.type,o,n),r={type:t.type,name:t.name,value:e,listener:o,options:n},i?i.push(r):this.__on=[r]}}function ln(t,e,n){var i=rn(t+""),r,o=i.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var a=0,c=s.length,f;a<c;++a)for(r=0,f=s[a];r<o;++r)if((l=i[r]).type===f.type&&l.name===f.name)return f.value}return}for(s=e?sn:on,r=0;r<o;++r)this.each(s(i[r],e,n));return this}function Et(t,e,n){var i=bt(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function un(t,e){return function(){return Et(this,t,e)}}function an(t,e){return function(){return Et(this,t,e.apply(this,arguments))}}function cn(t,e){return this.each((typeof e=="function"?an:un)(t,e))}function*fn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length,l;r<o;++r)(l=i[r])&&(yield l)}var hn=[null];function N(t,e){this._groups=t,this._parents=e}function dn(){return this}N.prototype={constructor:N,select:Lt,selectAll:Wt,selectChild:Ot,selectChildren:Kt,filter:Gt,data:ee,enter:Jt,exit:ie,join:re,merge:oe,selection:dn,order:se,sort:le,call:ae,nodes:ce,node:fe,size:he,empty:de,each:me,attr:xe,style:Se,property:ke,classed:Le,text:Fe,html:Ie,raise:Oe,lower:Ue,append:$e,insert:Ge,remove:Qe,clone:tn,datum:en,on:ln,dispatch:cn,[Symbol.iterator]:fn};function U(t){return typeof t=="string"?new N([[document.querySelector(t)]],[document.documentElement]):new N([[t]],hn)}function mn(t){let e;for(;e=t.sourceEvent;)t=e;return t}function gt(t,e){if(t=mn(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}var gn={value:()=>{}};function Rt(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Z(n)}function Z(t){this._=t}function pn(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Z.prototype=Rt.prototype={constructor:Z,on:function(t,e){var n=this._,i=pn(t+"",n),r,o=-1,l=i.length;if(arguments.length<2){for(;++o<l;)if((r=(t=i[o]).type)&&(r=yn(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<l;)if(r=(t=i[o]).type)n[r]=pt(n[r],t.name,e);else if(e==null)for(r in n)n[r]=pt(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Z(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,o;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],i=0,r=o.length;i<r;++i)o[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};function yn(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function pt(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=gn,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}const vn={passive:!1},$={capture:!0,passive:!1};function tt(t){t.stopImmediatePropagation()}function W(t){t.preventDefault(),t.stopImmediatePropagation()}function _n(t){var e=t.document.documentElement,n=U(t).on("dragstart.drag",W,$);"onselectstart"in e?n.on("selectstart.drag",W,$):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function wn(t,e){var n=t.document.documentElement,i=U(t).on("dragstart.drag",null);e&&(i.on("click.drag",W,$),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Q=t=>()=>t;function nt(t,{sourceEvent:e,subject:n,target:i,identifier:r,active:o,x:l,y:s,dx:a,dy:c,dispatch:f}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:f}})}nt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function xn(t){return!t.ctrlKey&&!t.button}function bn(){return this.parentNode}function An(t,e){return e==null?{x:t.x,y:t.y}:e}function Cn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sn(){var t=xn,e=bn,n=An,i=Cn,r={},o=Rt("start","drag","end"),l=0,s,a,c,f,m=0;function d(u){u.on("mousedown.drag",x).filter(i).on("touchstart.drag",M).on("touchmove.drag",X,vn).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(u,g){if(!(f||!t.call(this,u,g))){var y=k(this,e.call(this,u,g),u,g,"mouse");!y||(U(u.view).on("mousemove.drag",_,$).on("mouseup.drag",B,$),_n(u.view),tt(u),c=!1,s=u.clientX,a=u.clientY,y("start",u))}}function _(u){if(W(u),!c){var g=u.clientX-s,y=u.clientY-a;c=g*g+y*y>m}r.mouse("drag",u)}function B(u){U(u.view).on("mousemove.drag mouseup.drag",null),wn(u.view,c),W(u),r.mouse("end",u)}function M(u,g){if(!!t.call(this,u,g)){var y=u.changedTouches,v=e.call(this,u,g),A=y.length,w,p;for(w=0;w<A;++w)(p=k(this,v,u,g,y[w].identifier,y[w]))&&(tt(u),p("start",u,y[w]))}}function X(u){var g=u.changedTouches,y=g.length,v,A;for(v=0;v<y;++v)(A=r[g[v].identifier])&&(W(u),A("drag",u,g[v]))}function b(u){var g=u.changedTouches,y=g.length,v,A;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),v=0;v<y;++v)(A=r[g[v].identifier])&&(tt(u),A("end",u,g[v]))}function k(u,g,y,v,A,w){var p=o.copy(),C=gt(w||y,g),P,H,E;if((E=n.call(u,new nt("beforestart",{sourceEvent:y,target:d,identifier:A,active:l,x:C[0],y:C[1],dx:0,dy:0,dispatch:p}),v))!=null)return P=E.x-C[0]||0,H=E.y-C[1]||0,function T(V,D,G){var I=C,F;switch(V){case"start":r[A]=T,F=l++;break;case"end":delete r[A],--l;case"drag":C=gt(G||D,g),F=l;break}p.call(V,u,new nt(V,{sourceEvent:D,subject:E,target:d,identifier:A,active:F,x:C[0]+P,y:C[1]+H,dx:C[0]-I[0],dy:C[1]-I[1],dispatch:p}),v)}}return d.filter=function(u){return arguments.length?(t=typeof u=="function"?u:Q(!!u),d):t},d.container=function(u){return arguments.length?(e=typeof u=="function"?u:Q(u),d):e},d.subject=function(u){return arguments.length?(n=typeof u=="function"?u:Q(u),d):n},d.touchable=function(u){return arguments.length?(i=typeof u=="function"?u:Q(!!u),d):i},d.on=function(){var u=o.on.apply(o,arguments);return u===o?d:u},d.clickDistance=function(u){return arguments.length?(m=(u=+u)*u,d):Math.sqrt(m)},d}var K=(t=>(t.Line="line",t.Handle="handle",t))(K||{});function zn({width:t,prevWidth:e,height:n,prevHeight:i,invertX:r,invertY:o}){const l=t-e,s=n-i,a=[l>0?1:l<0?-1:0,s>0?1:s<0?-1:0];return l&&r&&(a[0]=a[0]*-1),s&&o&&(a[1]=a[1]*-1),a}const En={name:"ResizeControl",compatConfig:{MODE:3}},it=h.defineComponent({...En,props:{nodeId:null,color:null,minWidth:{default:10},minHeight:{default:10},maxWidth:{default:Number.MAX_VALUE},maxHeight:{default:Number.MAX_VALUE},position:null,variant:{default:"handle"},shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number],default:!1}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,i={width:0,height:0,x:0,y:0},r={...i,pointerX:0,pointerY:0,aspectRatio:1},{findNode:o,emits:l}=q.useVueFlow(),s=q.useGetPointerPosition(),a=h.inject(q.NodeIdInjection,null),c=h.ref();let f=r,m=i;const d=h.computed(()=>typeof n.nodeId=="string"?n.nodeId:a),x=h.computed(()=>n.variant===K.Line?"right":"bottom-right"),_=h.computed(()=>{var b;return(b=n.position)!=null?b:x.value});h.watchEffect(b=>{if(!c.value||!d.value)return;const k=U(c.value),u=_.value.includes("right")||_.value.includes("left"),g=_.value.includes("bottom")||_.value.includes("top"),y=_.value.includes("left"),v=_.value.includes("top"),A=Sn().on("start",w=>{var H,E,T,V;const p=o(d.value),{xSnapped:C,ySnapped:P}=s(w);m={width:(H=p==null?void 0:p.dimensions.width)!=null?H:0,height:(E=p==null?void 0:p.dimensions.height)!=null?E:0,x:(T=p==null?void 0:p.position.x)!=null?T:0,y:(V=p==null?void 0:p.position.y)!=null?V:0},f={...m,pointerX:C,pointerY:P,aspectRatio:m.width/m.height},e("resizeStart",{event:w,params:m})}).on("drag",w=>{var H;const{xSnapped:p,ySnapped:C}=s(w),P=o(d.value);if(P){const E=[],{pointerX:T,pointerY:V,width:D,height:G,x:I,y:F,aspectRatio:Nt}=f,{x:ot,y:st,width:lt,height:ut}=m,at=Math.floor(u?p-T:0),ct=Math.floor(g?C-V:0);let S=q.clamp(D+(y?-at:at),n.minWidth,n.maxWidth),z=q.clamp(G+(v?-ct:ct),n.minHeight,n.maxHeight);if(n.keepAspectRatio){const L=S/z;let R=Nt;typeof n.keepAspectRatio=="number"&&L!==n.keepAspectRatio&&(R=n.keepAspectRatio);const Y=u&&g,J=u&&!g,O=g&&!u;S=L<=R&&Y||O?z*R:S,z=L>R&&Y||J?S/R:z,S>=n.maxWidth?(S=n.maxWidth,z=n.maxWidth/R):S<=n.minWidth&&(S=n.minWidth,z=n.minWidth/R),z>=n.maxHeight?(z=n.maxHeight,S=n.maxHeight*R):z<=n.minHeight&&(z=n.minHeight,S=n.minHeight*R)}const ft=S!==lt,ht=z!==ut;if(y||v){const L=y?I-(S-D):I,R=v?F-(z-G):F,Y=L!==ot&&ft,J=R!==st&&ht;if(Y||J){const O={id:P.id,type:"position",from:P.position,position:{x:Y?L:ot,y:J?R:st}};E.push(O),m.x=O.position.x,m.y=O.position.y}}if(ft||ht){const L={id:d.value,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:S,height:z}};E.push(L),m.width=S,m.height=z}if(E.length===0)return;const kt=zn({width:m.width,prevWidth:lt,height:m.height,prevHeight:ut,invertX:y,invertY:v}),dt={...m,direction:kt};if(((H=n.shouldResize)==null?void 0:H.call(n,w,dt))===!1)return;e("resize",{event:w,params:dt}),l.nodesChange(E)}}).on("end",w=>{const p={id:d.value,type:"dimensions",resizing:!1};e("resizeEnd",{event:w,params:m}),l.nodesChange([p])});k.call(A),b(()=>{k.on(".drag",null)})});const B=h.computed(()=>_.value.split("-")),M=h.computed(()=>n.variant===K.Line?"borderColor":"backgroundColor"),X=h.computed(()=>n.color?{[M.value]:n.color}:{});return(b,k)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"resizeControlRef",ref:c,class:h.normalizeClass(["vue-flow__resize-control nodrag",[...h.unref(B),t.variant]]),style:h.normalizeStyle(h.unref(X))},[h.renderSlot(b.$slots,"default")],6))}}),Rn={name:"NodeResizer",compatConfig:{MODE:3},inheritAttrs:!1},Nn=h.defineComponent({...Rn,props:{nodeId:null,color:null,handleClassName:null,handleStyle:null,lineClassName:null,lineStyle:null,isVisible:{type:Boolean,default:!0},minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number]}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=["top-left","top-right","bottom-left","bottom-right"],i=["top","right","bottom","left"];return(r,o)=>t.isVisible?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(h.openBlock(),h.createElementBlock(h.Fragment,null,h.renderList(i,l=>h.createVNode(it,{key:l,class:h.normalizeClass(t.lineClassName),style:h.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:l,variant:h.unref(K).Line,"keep-aspect-ratio":t.keepAspectRatio,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,onResizeStart:o[0]||(o[0]=s=>e("resizeStart",s)),onResize:o[1]||(o[1]=s=>e("resize",s)),onResizeEnd:o[2]||(o[2]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","variant","keep-aspect-ratio","color","min-width","min-height","max-width","max-height","should-resize"])),64)),(h.openBlock(),h.createElementBlock(h.Fragment,null,h.renderList(n,l=>h.createVNode(it,{key:l,class:h.normalizeClass(t.handleClassName),style:h.normalizeStyle(t.handleStyle),"node-id":t.nodeId,position:l,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,"keep-aspect-ratio":t.keepAspectRatio,onResizeStart:o[3]||(o[3]=s=>e("resizeStart",s)),onResize:o[4]||(o[4]=s=>e("resize",s)),onResizeEnd:o[5]||(o[5]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio"])),64))],64)):h.createCommentVNode("",!0)}});exports.NodeResizeControl=it;exports.NodeResizer=Nn;exports.ResizeControlVariant=K;
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("vue"),T=require("@vue-flow/core");var et="http://www.w3.org/1999/xhtml";const dt={svg:"http://www.w3.org/2000/svg",xhtml:et,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),dt.hasOwnProperty(e)?{space:dt[e],local:t}:t}function Nt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===et&&e.documentElement.namespaceURI===et?e.createElement(t):e.createElementNS(n,t)}}function kt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yt(t){var e=pt(t);return(e.local?kt:Nt)(e)}function Pt(){}function vt(t){return t==null?Pt:function(){return this.querySelector(t)}}function Vt(t){typeof t!="function"&&(t=vt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,l=r[i]=new Array(s),a,f,c=0;c<s;++c)(a=o[c])&&(f=t.call(a,a.__data__,c,o))&&("__data__"in a&&(f.__data__=a.__data__),l[c]=f);return new N(r,this._parents)}function Ht(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function It(){return[]}function Lt(t){return t==null?It:function(){return this.querySelectorAll(t)}}function Bt(t){return function(){return Ht(t.apply(this,arguments))}}function Ft(t){typeof t=="function"?t=Bt(t):t=Lt(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],l=s.length,a,f=0;f<l;++f)(a=s[f])&&(r.push(t.call(a,a.__data__,f,s)),i.push(a));return new N(r,i)}function Tt(t){return function(){return this.matches(t)}}function _t(t){return function(e){return e.matches(t)}}var Mt=Array.prototype.find;function Wt(t){return function(){return Mt.call(this.children,t)}}function Xt(){return this.firstElementChild}function Dt(t){return this.select(t==null?Xt:Wt(typeof t=="function"?t:_t(t)))}var Yt=Array.prototype.filter;function Ot(){return Array.from(this.children)}function qt(t){return function(){return Yt.call(this.children,t)}}function Ut(t){return this.selectAll(t==null?Ot:qt(typeof t=="function"?t:_t(t)))}function $t(t){typeof t!="function"&&(t=Tt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,l=r[i]=[],a,f=0;f<s;++f)(a=o[f])&&t.call(a,a.__data__,f,o)&&l.push(a);return new N(r,this._parents)}function wt(t){return new Array(t.length)}function Kt(){return new N(this._enter||this._groups.map(wt),this._parents)}function j(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}j.prototype={constructor:j,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Gt(t){return function(){return t}}function Jt(t,e,n,r,i,o){for(var s=0,l,a=e.length,f=o.length;s<f;++s)(l=e[s])?(l.__data__=o[s],r[s]=l):n[s]=new j(t,o[s]);for(;s<a;++s)(l=e[s])&&(i[s]=l)}function Qt(t,e,n,r,i,o,s){var l,a,f=new Map,c=e.length,p=o.length,h=new Array(c),y;for(l=0;l<c;++l)(a=e[l])&&(h[l]=y=s.call(a,a.__data__,l,e)+"",f.has(y)?i[l]=a:f.set(y,a));for(l=0;l<p;++l)y=s.call(t,o[l],l,o)+"",(a=f.get(y))?(r[l]=a,a.__data__=o[l],f.delete(y)):n[l]=new j(t,o[l]);for(l=0;l<c;++l)(a=e[l])&&f.get(h[l])===a&&(i[l]=a)}function Zt(t){return t.__data__}function jt(t,e){if(!arguments.length)return Array.from(this,Zt);var n=e?Qt:Jt,r=this._parents,i=this._groups;typeof t!="function"&&(t=Gt(t));for(var o=i.length,s=new Array(o),l=new Array(o),a=new Array(o),f=0;f<o;++f){var c=r[f],p=i[f],h=p.length,y=te(t.call(c,c&&c.__data__,f,r)),_=y.length,I=l[f]=new Array(_),k=s[f]=new Array(_),V=a[f]=new Array(h);n(c,p,I,k,V,y,e);for(var C=0,S=0,u,m;C<_;++C)if(u=I[C]){for(C>=S&&(S=C+1);!(m=k[S])&&++S<_;);u._next=m||null}}return s=new N(s,r),s._enter=l,s._exit=a,s}function te(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ee(){return new N(this._exit||this._groups.map(wt),this._parents)}function ne(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function ie(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),l=new Array(i),a=0;a<s;++a)for(var f=n[a],c=r[a],p=f.length,h=l[a]=new Array(p),y,_=0;_<p;++_)(y=f[_]||c[_])&&(h[_]=y);for(;a<i;++a)l[a]=n[a];return new N(l,this._parents)}function re(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function oe(t){t||(t=se);function e(p,h){return p&&h?t(p.__data__,h.__data__):!p-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],l=s.length,a=i[o]=new Array(l),f,c=0;c<l;++c)(f=s[c])&&(a[c]=f);a.sort(e)}return new N(i,this._parents).order()}function se(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function le(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ue(){return Array.from(this)}function ae(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function ce(){let t=0;for(const e of this)++t;return t}function fe(){return!this.node()}function he(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,l;o<s;++o)(l=i[o])&&t.call(l,l.__data__,o,i);return this}function de(t){return function(){this.removeAttribute(t)}}function me(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ge(t,e){return function(){this.setAttribute(t,e)}}function pe(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ye(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ve(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function _e(t,e){var n=pt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?me:de:typeof e=="function"?n.local?ve:ye:n.local?pe:ge)(n,e))}function xt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function we(t){return function(){this.style.removeProperty(t)}}function xe(t,e,n){return function(){this.style.setProperty(t,e,n)}}function be(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ae(t,e,n){return arguments.length>1?this.each((e==null?we:typeof e=="function"?be:xe)(t,e,n??"")):Ce(this.node(),t)}function Ce(t,e){return t.style.getPropertyValue(e)||xt(t).getComputedStyle(t,null).getPropertyValue(e)}function Se(t){return function(){delete this[t]}}function ze(t,e){return function(){this[t]=e}}function Ee(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Re(t,e){return arguments.length>1?this.each((e==null?Se:typeof e=="function"?Ee:ze)(t,e)):this.node()[t]}function bt(t){return t.trim().split(/^|\s+/)}function rt(t){return t.classList||new At(t)}function At(t){this._node=t,this._names=bt(t.getAttribute("class")||"")}At.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Ct(t,e){for(var n=rt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function St(t,e){for(var n=rt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Ne(t){return function(){Ct(this,t)}}function ke(t){return function(){St(this,t)}}function Pe(t,e){return function(){(e.apply(this,arguments)?Ct:St)(this,t)}}function Ve(t,e){var n=bt(t+"");if(arguments.length<2){for(var r=rt(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Pe:e?Ne:ke)(n,e))}function He(){this.textContent=""}function Ie(t){return function(){this.textContent=t}}function Le(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Be(t){return arguments.length?this.each(t==null?He:(typeof t=="function"?Le:Ie)(t)):this.node().textContent}function Fe(){this.innerHTML=""}function Te(t){return function(){this.innerHTML=t}}function Me(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function We(t){return arguments.length?this.each(t==null?Fe:(typeof t=="function"?Me:Te)(t)):this.node().innerHTML}function Xe(){this.nextSibling&&this.parentNode.appendChild(this)}function De(){return this.each(Xe)}function Ye(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Oe(){return this.each(Ye)}function qe(t){var e=typeof t=="function"?t:yt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Ue(){return null}function $e(t,e){var n=typeof t=="function"?t:yt(t),r=e==null?Ue:typeof e=="function"?e:vt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ke(){var t=this.parentNode;t&&t.removeChild(this)}function Ge(){return this.each(Ke)}function Je(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Qe(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ze(t){return this.select(t?Qe:Je)}function je(t){return arguments.length?this.property("__data__",t):this.node().__data__}function tn(t){return function(e){t.call(this,e,this.__data__)}}function en(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function nn(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function rn(t,e,n){return function(){var r=this.__on,i,o=tn(e);if(r){for(var s=0,l=r.length;s<l;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function on(t,e,n){var r=en(t+""),i,o=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,f=l.length,c;a<f;++a)for(i=0,c=l[a];i<o;++i)if((s=r[i]).type===c.type&&s.name===c.name)return c.value}return}for(l=e?rn:nn,i=0;i<o;++i)this.each(l(r[i],e,n));return this}function zt(t,e,n){var r=xt(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function sn(t,e){return function(){return zt(this,t,e)}}function ln(t,e){return function(){return zt(this,t,e.apply(this,arguments))}}function un(t,e){return this.each((typeof e=="function"?ln:sn)(t,e))}function*an(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var cn=[null];function N(t,e){this._groups=t,this._parents=e}function fn(){return this}N.prototype={constructor:N,select:Vt,selectAll:Ft,selectChild:Dt,selectChildren:Ut,filter:$t,data:jt,enter:Kt,exit:ee,join:ne,merge:ie,selection:fn,order:re,sort:oe,call:le,nodes:ue,node:ae,size:ce,empty:fe,each:he,attr:_e,style:Ae,property:Re,classed:Ve,text:Be,html:We,raise:De,lower:Oe,append:qe,insert:$e,remove:Ge,clone:Ze,datum:je,on,dispatch:un,[Symbol.iterator]:an};function Y(t){return typeof t=="string"?new N([[document.querySelector(t)]],[document.documentElement]):new N([[t]],cn)}function hn(t){let e;for(;e=t.sourceEvent;)t=e;return t}function mt(t,e){if(t=hn(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var dn={value:()=>{}};function Et(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Z(n)}function Z(t){this._=t}function mn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Z.prototype=Et.prototype={constructor:Z,on:function(t,e){var n=this._,r=mn(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=gn(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=gt(n[i],t.name,e);else if(e==null)for(i in n)n[i]=gt(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Z(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function gn(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function gt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=dn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const pn={passive:!1},O={capture:!0,passive:!1};function tt(t){t.stopImmediatePropagation()}function M(t){t.preventDefault(),t.stopImmediatePropagation()}function yn(t){var e=t.document.documentElement,n=Y(t).on("dragstart.drag",M,O);"onselectstart"in e?n.on("selectstart.drag",M,O):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function vn(t,e){var n=t.document.documentElement,r=Y(t).on("dragstart.drag",null);e&&(r.on("click.drag",M,O),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Q=t=>()=>t;function nt(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:s,y:l,dx:a,dy:f,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:c}})}nt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function _n(t){return!t.ctrlKey&&!t.button}function wn(){return this.parentNode}function xn(t,e){return e??{x:t.x,y:t.y}}function bn(){return navigator.maxTouchPoints||"ontouchstart"in this}function An(){var t=_n,e=wn,n=xn,r=bn,i={},o=Et("start","drag","end"),s=0,l,a,f,c,p=0;function h(u){u.on("mousedown.drag",y).filter(r).on("touchstart.drag",k).on("touchmove.drag",V,pn).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(u,m){if(!(c||!t.call(this,u,m))){var w=S(this,e.call(this,u,m),u,m,"mouse");w&&(Y(u.view).on("mousemove.drag",_,O).on("mouseup.drag",I,O),yn(u.view),tt(u),f=!1,l=u.clientX,a=u.clientY,w("start",u))}}function _(u){if(M(u),!f){var m=u.clientX-l,w=u.clientY-a;f=m*m+w*w>p}i.mouse("drag",u)}function I(u){Y(u.view).on("mousemove.drag mouseup.drag",null),vn(u.view,f),M(u),i.mouse("end",u)}function k(u,m){if(t.call(this,u,m)){var w=u.changedTouches,v=e.call(this,u,m),g=w.length,z,E;for(z=0;z<g;++z)(E=S(this,v,u,m,w[z].identifier,w[z]))&&(tt(u),E("start",u,w[z]))}}function V(u){var m=u.changedTouches,w=m.length,v,g;for(v=0;v<w;++v)(g=i[m[v].identifier])&&(M(u),g("drag",u,m[v]))}function C(u){var m=u.changedTouches,w=m.length,v,g;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),v=0;v<w;++v)(g=i[m[v].identifier])&&(tt(u),g("end",u,m[v]))}function S(u,m,w,v,g,z){var E=o.copy(),A=mt(z||w,m),H,U,L;if((L=n.call(u,new nt("beforestart",{sourceEvent:w,target:h,identifier:g,active:s,x:A[0],y:A[1],dx:0,dy:0,dispatch:E}),v))!=null)return H=L.x-A[0]||0,U=L.y-A[1]||0,function $(B,W,K){var G=A,F;switch(B){case"start":i[g]=$,F=s++;break;case"end":delete i[g],--s;case"drag":A=mt(K||W,m),F=s;break}E.call(B,u,new nt(B,{sourceEvent:W,subject:L,target:h,identifier:g,active:F,x:A[0]+H,y:A[1]+U,dx:A[0]-G[0],dy:A[1]-G[1],dispatch:E}),v)}}return h.filter=function(u){return arguments.length?(t=typeof u=="function"?u:Q(!!u),h):t},h.container=function(u){return arguments.length?(e=typeof u=="function"?u:Q(u),h):e},h.subject=function(u){return arguments.length?(n=typeof u=="function"?u:Q(u),h):n},h.touchable=function(u){return arguments.length?(r=typeof u=="function"?u:Q(!!u),h):r},h.on=function(){var u=o.on.apply(o,arguments);return u===o?h:u},h.clickDistance=function(u){return arguments.length?(p=(u=+u)*u,h):Math.sqrt(p)},h}var q=(t=>(t.Line="line",t.Handle="handle",t))(q||{});function Cn({width:t,prevWidth:e,height:n,prevHeight:r,invertX:i,invertY:o}){const s=t-e,l=n-r,a=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&i&&(a[0]=a[0]*-1),l&&o&&(a[1]=a[1]*-1),a}const Sn={name:"ResizeControl",compatConfig:{MODE:3}},it=d.defineComponent({...Sn,props:{nodeId:null,color:null,minWidth:{default:10},minHeight:{default:10},maxWidth:{default:Number.MAX_VALUE},maxHeight:{default:Number.MAX_VALUE},position:null,variant:{default:"handle"},shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number],default:!1}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,r={width:0,height:0,x:0,y:0},i={...r,pointerX:0,pointerY:0,aspectRatio:1},{findNode:o,emits:s}=T.useVueFlow(),l=T.useGetPointerPosition(),a=d.ref();let f=i,c=r;const p=d.computed(()=>n.variant===q.Line?"right":"bottom-right"),h=d.computed(()=>n.position??p.value);d.watchEffect(k=>{if(!a.value||!n.nodeId)return;const V=Y(a.value),C=h.value.includes("right")||h.value.includes("left"),S=h.value.includes("bottom")||h.value.includes("top"),u=h.value.includes("left"),m=h.value.includes("top"),w=An().on("start",v=>{const g=o(n.nodeId),{xSnapped:z,ySnapped:E}=l(v);c={width:(g==null?void 0:g.dimensions.width)??0,height:(g==null?void 0:g.dimensions.height)??0,x:(g==null?void 0:g.position.x)??0,y:(g==null?void 0:g.position.y)??0},f={...c,pointerX:z,pointerY:E,aspectRatio:c.width/c.height},e("resizeStart",{event:v,params:c})}).on("drag",v=>{var A;const{xSnapped:g,ySnapped:z}=l(v),E=o(n.nodeId);if(E){const H=[],{pointerX:U,pointerY:L,width:$,height:B,x:W,y:K,aspectRatio:G}=f,{x:F,y:ot,width:st,height:lt}=c,ut=Math.floor(C?g-U:0),at=Math.floor(S?z-L:0);let x=T.clamp($+(u?-ut:ut),n.minWidth,n.maxWidth),b=T.clamp(B+(m?-at:at),n.minHeight,n.maxHeight);if(n.keepAspectRatio){const P=x/b;let R=G;typeof n.keepAspectRatio=="number"&&P!==n.keepAspectRatio&&(R=n.keepAspectRatio);const X=C&&S,J=C&&!S,D=S&&!C;x=P<=R&&X||D?b*R:x,b=P>R&&X||J?x/R:b,x>=n.maxWidth?(x=n.maxWidth,b=n.maxWidth/R):x<=n.minWidth&&(x=n.minWidth,b=n.minWidth/R),b>=n.maxHeight?(b=n.maxHeight,x=n.maxHeight*R):b<=n.minHeight&&(b=n.minHeight,x=n.minHeight*R)}const ct=x!==st,ft=b!==lt;if(u||m){const P=u?W-(x-$):W,R=m?K-(b-B):K,X=P!==F&&ct,J=R!==ot&&ft;if(X||J){const D={id:E.id,type:"position",from:E.position,position:{x:X?P:F,y:J?R:ot}};H.push(D),c.x=D.position.x,c.y=D.position.y}}if(n.nodeId&&(ct||ft)){const P={id:n.nodeId,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:x,height:b}};H.push(P),c.width=x,c.height=b}if(H.length===0)return;const Rt=Cn({width:c.width,prevWidth:st,height:c.height,prevHeight:lt,invertX:u,invertY:m}),ht={...c,direction:Rt};if(((A=n.shouldResize)==null?void 0:A.call(n,v,ht))===!1)return;e("resize",{event:v,params:ht}),s.nodesChange(H)}}).on("end",v=>{if(n.nodeId){const g={id:n.nodeId,type:"dimensions",resizing:!1};e("resizeEnd",{event:v,params:c}),s.nodesChange([g])}});V.call(w),k(()=>{V.on(".drag",null)})});const y=d.computed(()=>h.value.split("-")),_=d.computed(()=>n.variant===q.Line?"borderColor":"backgroundColor"),I=d.computed(()=>n.color?{[_.value]:n.color}:{});return(k,V)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"resizeControlRef",ref:a,class:d.normalizeClass(["vue-flow__resize-control nodrag",[...d.unref(y),t.variant]]),style:d.normalizeStyle(d.unref(I))},[d.renderSlot(k.$slots,"default")],6))}}),zn={name:"NodeResizer",compatConfig:{MODE:3},inheritAttrs:!1},En=d.defineComponent({...zn,props:{nodeId:null,color:null,handleClassName:null,handleStyle:null,lineClassName:null,lineStyle:null,isVisible:{type:Boolean,default:!0},minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number]}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,{findNode:r,emits:i}=T.useVueFlow(),o=["top-left","top-right","bottom-left","bottom-right"],s=["top","right","bottom","left"],l=d.inject(T.NodeIdInjection,null),a=d.computed(()=>typeof n.nodeId=="string"?n.nodeId:l);return d.watch([()=>n.minWidth,()=>n.minHeight,()=>n.maxWidth,()=>n.maxHeight],([f,c,p,h])=>{const y=r(a.value);if(y){const _={id:y.id,type:"dimensions",updateStyle:!0,dimensions:{width:y.dimensions.width,height:y.dimensions.height}};f&&y.dimensions.width<f&&(_.dimensions.width=f),c&&y.dimensions.height<c&&(_.dimensions.height=c),p&&y.dimensions.width>p&&(_.dimensions.width=p),h&&y.dimensions.height>h&&(_.dimensions.height=h),(_.dimensions.width!==y.dimensions.width||_.dimensions.height!==y.dimensions.height)&&i.nodesChange([_])}},{flush:"post",immediate:!0}),(f,c)=>t.isVisible?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(s,p=>d.createVNode(it,{key:p,class:d.normalizeClass(t.lineClassName),style:d.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:p,variant:d.unref(q).Line,"keep-aspect-ratio":t.keepAspectRatio,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,onResizeStart:c[0]||(c[0]=h=>e("resizeStart",h)),onResize:c[1]||(c[1]=h=>e("resize",h)),onResizeEnd:c[2]||(c[2]=h=>e("resizeEnd",h))},null,8,["class","style","node-id","position","variant","keep-aspect-ratio","color","min-width","min-height","max-width","max-height","should-resize"])),64)),(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(o,p=>d.createVNode(it,{key:p,class:d.normalizeClass(t.handleClassName),style:d.normalizeStyle(t.handleStyle),"node-id":d.unref(a),position:p,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,"keep-aspect-ratio":t.keepAspectRatio,onResizeStart:c[3]||(c[3]=h=>e("resizeStart",h)),onResize:c[4]||(c[4]=h=>e("resize",h)),onResizeEnd:c[5]||(c[5]=h=>e("resizeEnd",h))},null,8,["class","style","node-id","position","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio"])),64))],64)):d.createCommentVNode("",!0)}});exports.NodeResizeControl=it;exports.NodeResizer=En;exports.ResizeControlVariant=q;

@@ -54,3 +54,3 @@ import type { D3DragEvent, SubjectPosition } from 'd3-drag'

export interface ResizeControlProps {
nodeId?: string
nodeId?: string | null
color?: string

@@ -57,0 +57,0 @@ minWidth?: number

@@ -1,1 +0,1 @@

var VueFlowNodeResizer=function(X,f,D){"use strict";const Vn="";var et="http://www.w3.org/1999/xhtml";const st={svg:"http://www.w3.org/2000/svg",xhtml:et,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function lt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),st.hasOwnProperty(e)?{space:st[e],local:t}:t}function kt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===et&&e.documentElement.namespaceURI===et?e.createElement(t):e.createElementNS(n,t)}}function Vt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function at(t){var e=lt(t);return(e.local?Vt:kt)(e)}function Pt(){}function ut(t){return t==null?Pt:function(){return this.querySelector(t)}}function Ht(t){typeof t!="function"&&(t=ut(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o=e[r],l=o.length,s=i[r]=new Array(l),u,c,h=0;h<l;++h)(u=o[h])&&(c=t.call(u,u.__data__,h,o))&&("__data__"in u&&(c.__data__=u.__data__),s[h]=c);return new E(i,this._parents)}function Lt(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Bt(){return[]}function Ft(t){return t==null?Bt:function(){return this.querySelectorAll(t)}}function Mt(t){return function(){return Lt(t.apply(this,arguments))}}function Tt(t){typeof t=="function"?t=Mt(t):t=Ft(t);for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var l=e[o],s=l.length,u,c=0;c<s;++c)(u=l[c])&&(i.push(t.call(u,u.__data__,c,l)),r.push(u));return new E(i,r)}function Wt(t){return function(){return this.matches(t)}}function ct(t){return function(e){return e.matches(t)}}var Xt=Array.prototype.find;function Dt(t){return function(){return Xt.call(this.children,t)}}function It(){return this.firstElementChild}function Yt(t){return this.select(t==null?It:Dt(typeof t=="function"?t:ct(t)))}var Ot=Array.prototype.filter;function Ut(){return Array.from(this.children)}function qt(t){return function(){return Ot.call(this.children,t)}}function $t(t){return this.selectAll(t==null?Ut:qt(typeof t=="function"?t:ct(t)))}function Kt(t){typeof t!="function"&&(t=Wt(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o=e[r],l=o.length,s=i[r]=[],u,c=0;c<l;++c)(u=o[c])&&t.call(u,u.__data__,c,o)&&s.push(u);return new E(i,this._parents)}function ft(t){return new Array(t.length)}function Gt(){return new E(this._enter||this._groups.map(ft),this._parents)}function J(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}J.prototype={constructor:J,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Jt(t){return function(){return t}}function Qt(t,e,n,i,r,o){for(var l=0,s,u=e.length,c=o.length;l<c;++l)(s=e[l])?(s.__data__=o[l],i[l]=s):n[l]=new J(t,o[l]);for(;l<u;++l)(s=e[l])&&(r[l]=s)}function Zt(t,e,n,i,r,o,l){var s,u,c=new Map,h=e.length,m=o.length,d=new Array(h),x;for(s=0;s<h;++s)(u=e[s])&&(d[s]=x=l.call(u,u.__data__,s,e)+"",c.has(x)?r[s]=u:c.set(x,u));for(s=0;s<m;++s)x=l.call(t,o[s],s,o)+"",(u=c.get(x))?(i[s]=u,u.__data__=o[s],c.delete(x)):n[s]=new J(t,o[s]);for(s=0;s<h;++s)(u=e[s])&&c.get(d[s])===u&&(r[s]=u)}function jt(t){return t.__data__}function te(t,e){if(!arguments.length)return Array.from(this,jt);var n=e?Zt:Qt,i=this._parents,r=this._groups;typeof t!="function"&&(t=Jt(t));for(var o=r.length,l=new Array(o),s=new Array(o),u=new Array(o),c=0;c<o;++c){var h=i[c],m=r[c],d=m.length,x=ee(t.call(h,h&&h.__data__,c,i)),w=x.length,F=s[c]=new Array(w),M=l[c]=new Array(w),U=u[c]=new Array(d);n(h,m,F,M,U,x,e);for(var b=0,k=0,a,g;b<w;++b)if(a=F[b]){for(b>=k&&(k=b+1);!(g=M[k])&&++k<w;);a._next=g||null}}return l=new E(l,i),l._enter=s,l._exit=u,l}function ee(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ne(){return new E(this._exit||this._groups.map(ft),this._parents)}function ie(t,e,n){var i=this.enter(),r=this,o=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?o.remove():n(o),i&&r?i.merge(r).order():r}function re(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,o=i.length,l=Math.min(r,o),s=new Array(r),u=0;u<l;++u)for(var c=n[u],h=i[u],m=c.length,d=s[u]=new Array(m),x,w=0;w<m;++w)(x=c[w]||h[w])&&(d[w]=x);for(;u<r;++u)s[u]=n[u];return new E(s,this._parents)}function oe(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,o=i[r],l;--r>=0;)(l=i[r])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function se(t){t||(t=le);function e(m,d){return m&&d?t(m.__data__,d.__data__):!m-!d}for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var l=n[o],s=l.length,u=r[o]=new Array(s),c,h=0;h<s;++h)(c=l[h])&&(u[h]=c);u.sort(e)}return new E(r,this._parents).order()}function le(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ae(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ue(){return Array.from(this)}function ce(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var l=i[r];if(l)return l}return null}function fe(){let t=0;for(const e of this)++t;return t}function he(){return!this.node()}function de(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],o=0,l=r.length,s;o<l;++o)(s=r[o])&&t.call(s,s.__data__,o,r);return this}function me(t){return function(){this.removeAttribute(t)}}function ge(t){return function(){this.removeAttributeNS(t.space,t.local)}}function pe(t,e){return function(){this.setAttribute(t,e)}}function ye(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function _e(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function we(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ve(t,e){var n=lt(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?ge:me:typeof e=="function"?n.local?we:_e:n.local?ye:pe)(n,e))}function ht(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function xe(t){return function(){this.style.removeProperty(t)}}function be(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Ae(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function Ce(t,e,n){return arguments.length>1?this.each((e==null?xe:typeof e=="function"?Ae:be)(t,e,n==null?"":n)):Se(this.node(),t)}function Se(t,e){return t.style.getPropertyValue(e)||ht(t).getComputedStyle(t,null).getPropertyValue(e)}function ze(t){return function(){delete this[t]}}function Ee(t,e){return function(){this[t]=e}}function Re(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ne(t,e){return arguments.length>1?this.each((e==null?ze:typeof e=="function"?Re:Ee)(t,e)):this.node()[t]}function dt(t){return t.trim().split(/^|\s+/)}function nt(t){return t.classList||new mt(t)}function mt(t){this._node=t,this._names=dt(t.getAttribute("class")||"")}mt.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function gt(t,e){for(var n=nt(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function pt(t,e){for(var n=nt(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function ke(t){return function(){gt(this,t)}}function Ve(t){return function(){pt(this,t)}}function Pe(t,e){return function(){(e.apply(this,arguments)?gt:pt)(this,t)}}function He(t,e){var n=dt(t+"");if(arguments.length<2){for(var i=nt(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?Pe:e?ke:Ve)(n,e))}function Le(){this.textContent=""}function Be(t){return function(){this.textContent=t}}function Fe(t){return function(){var e=t.apply(this,arguments);this.textContent=e==null?"":e}}function Me(t){return arguments.length?this.each(t==null?Le:(typeof t=="function"?Fe:Be)(t)):this.node().textContent}function Te(){this.innerHTML=""}function We(t){return function(){this.innerHTML=t}}function Xe(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e==null?"":e}}function De(t){return arguments.length?this.each(t==null?Te:(typeof t=="function"?Xe:We)(t)):this.node().innerHTML}function Ie(){this.nextSibling&&this.parentNode.appendChild(this)}function Ye(){return this.each(Ie)}function Oe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ue(){return this.each(Oe)}function qe(t){var e=typeof t=="function"?t:at(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function $e(){return null}function Ke(t,e){var n=typeof t=="function"?t:at(t),i=e==null?$e:typeof e=="function"?e:ut(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function Ge(){var t=this.parentNode;t&&t.removeChild(this)}function Je(){return this.each(Ge)}function Qe(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ze(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function je(t){return this.select(t?Ze:Qe)}function tn(t){return arguments.length?this.property("__data__",t):this.node().__data__}function en(t){return function(e){t.call(this,e,this.__data__)}}function nn(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function rn(t){return function(){var e=this.__on;if(!!e){for(var n=0,i=-1,r=e.length,o;n<r;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++i]=o;++i?e.length=i:delete this.__on}}}function on(t,e,n){return function(){var i=this.__on,r,o=en(e);if(i){for(var l=0,s=i.length;l<s;++l)if((r=i[l]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=e;return}}this.addEventListener(t.type,o,n),r={type:t.type,name:t.name,value:e,listener:o,options:n},i?i.push(r):this.__on=[r]}}function sn(t,e,n){var i=nn(t+""),r,o=i.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,c=s.length,h;u<c;++u)for(r=0,h=s[u];r<o;++r)if((l=i[r]).type===h.type&&l.name===h.name)return h.value}return}for(s=e?on:rn,r=0;r<o;++r)this.each(s(i[r],e,n));return this}function yt(t,e,n){var i=ht(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function ln(t,e){return function(){return yt(this,t,e)}}function an(t,e){return function(){return yt(this,t,e.apply(this,arguments))}}function un(t,e){return this.each((typeof e=="function"?an:ln)(t,e))}function*cn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length,l;r<o;++r)(l=i[r])&&(yield l)}var fn=[null];function E(t,e){this._groups=t,this._parents=e}function hn(){return this}E.prototype={constructor:E,select:Ht,selectAll:Tt,selectChild:Yt,selectChildren:$t,filter:Kt,data:te,enter:Gt,exit:ne,join:ie,merge:re,selection:hn,order:oe,sort:se,call:ae,nodes:ue,node:ce,size:fe,empty:he,each:de,attr:ve,style:Ce,property:Ne,classed:He,text:Me,html:De,raise:Ye,lower:Ue,append:qe,insert:Ke,remove:Je,clone:je,datum:tn,on:sn,dispatch:un,[Symbol.iterator]:cn};function I(t){return typeof t=="string"?new E([[document.querySelector(t)]],[document.documentElement]):new E([[t]],fn)}function dn(t){let e;for(;e=t.sourceEvent;)t=e;return t}function _t(t,e){if(t=dn(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}var mn={value:()=>{}};function wt(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Q(n)}function Q(t){this._=t}function gn(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Q.prototype=wt.prototype={constructor:Q,on:function(t,e){var n=this._,i=gn(t+"",n),r,o=-1,l=i.length;if(arguments.length<2){for(;++o<l;)if((r=(t=i[o]).type)&&(r=pn(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<l;)if(r=(t=i[o]).type)n[r]=vt(n[r],t.name,e);else if(e==null)for(r in n)n[r]=vt(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Q(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,o;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],i=0,r=o.length;i<r;++i)o[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};function pn(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function vt(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=mn,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}const yn={passive:!1},Y={capture:!0,passive:!1};function it(t){t.stopImmediatePropagation()}function B(t){t.preventDefault(),t.stopImmediatePropagation()}function _n(t){var e=t.document.documentElement,n=I(t).on("dragstart.drag",B,Y);"onselectstart"in e?n.on("selectstart.drag",B,Y):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function wn(t,e){var n=t.document.documentElement,i=I(t).on("dragstart.drag",null);e&&(i.on("click.drag",B,Y),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Z=t=>()=>t;function rt(t,{sourceEvent:e,subject:n,target:i,identifier:r,active:o,x:l,y:s,dx:u,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}rt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function vn(t){return!t.ctrlKey&&!t.button}function xn(){return this.parentNode}function bn(t,e){return e==null?{x:t.x,y:t.y}:e}function An(){return navigator.maxTouchPoints||"ontouchstart"in this}function Cn(){var t=vn,e=xn,n=bn,i=An,r={},o=wt("start","drag","end"),l=0,s,u,c,h,m=0;function d(a){a.on("mousedown.drag",x).filter(i).on("touchstart.drag",M).on("touchmove.drag",U,yn).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(a,g){if(!(h||!t.call(this,a,g))){var y=k(this,e.call(this,a,g),a,g,"mouse");!y||(I(a.view).on("mousemove.drag",w,Y).on("mouseup.drag",F,Y),_n(a.view),it(a),c=!1,s=a.clientX,u=a.clientY,y("start",a))}}function w(a){if(B(a),!c){var g=a.clientX-s,y=a.clientY-u;c=g*g+y*y>m}r.mouse("drag",a)}function F(a){I(a.view).on("mousemove.drag mouseup.drag",null),wn(a.view,c),B(a),r.mouse("end",a)}function M(a,g){if(!!t.call(this,a,g)){var y=a.changedTouches,_=e.call(this,a,g),A=y.length,v,p;for(v=0;v<A;++v)(p=k(this,_,a,g,y[v].identifier,y[v]))&&(it(a),p("start",a,y[v]))}}function U(a){var g=a.changedTouches,y=g.length,_,A;for(_=0;_<y;++_)(A=r[g[_].identifier])&&(B(a),A("drag",a,g[_]))}function b(a){var g=a.changedTouches,y=g.length,_,A;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),_=0;_<y;++_)(A=r[g[_].identifier])&&(it(a),A("end",a,g[_]))}function k(a,g,y,_,A,v){var p=o.copy(),C=_t(v||y,g),V,P,R;if((R=n.call(a,new rt("beforestart",{sourceEvent:y,target:d,identifier:A,active:l,x:C[0],y:C[1],dx:0,dy:0,dispatch:p}),_))!=null)return V=R.x-C[0]||0,P=R.y-C[1]||0,function T(H,q,j){var $=C,W;switch(H){case"start":r[A]=T,W=l++;break;case"end":delete r[A],--l;case"drag":C=_t(j||q,g),W=l;break}p.call(H,a,new rt(H,{sourceEvent:q,subject:R,target:d,identifier:A,active:W,x:C[0]+V,y:C[1]+P,dx:C[0]-$[0],dy:C[1]-$[1],dispatch:p}),_)}}return d.filter=function(a){return arguments.length?(t=typeof a=="function"?a:Z(!!a),d):t},d.container=function(a){return arguments.length?(e=typeof a=="function"?a:Z(a),d):e},d.subject=function(a){return arguments.length?(n=typeof a=="function"?a:Z(a),d):n},d.touchable=function(a){return arguments.length?(i=typeof a=="function"?a:Z(!!a),d):i},d.on=function(){var a=o.on.apply(o,arguments);return a===o?d:a},d.clickDistance=function(a){return arguments.length?(m=(a=+a)*a,d):Math.sqrt(m)},d}var O=(t=>(t.Line="line",t.Handle="handle",t))(O||{});function Sn({width:t,prevWidth:e,height:n,prevHeight:i,invertX:r,invertY:o}){const l=t-e,s=n-i,u=[l>0?1:l<0?-1:0,s>0?1:s<0?-1:0];return l&&r&&(u[0]=u[0]*-1),s&&o&&(u[1]=u[1]*-1),u}const zn={name:"ResizeControl",compatConfig:{MODE:3}},ot=f.defineComponent({...zn,props:{nodeId:null,color:null,minWidth:{default:10},minHeight:{default:10},maxWidth:{default:Number.MAX_VALUE},maxHeight:{default:Number.MAX_VALUE},position:null,variant:{default:"handle"},shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number],default:!1}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,i={width:0,height:0,x:0,y:0},r={...i,pointerX:0,pointerY:0,aspectRatio:1},{findNode:o,emits:l}=D.useVueFlow(),s=D.useGetPointerPosition(),u=f.inject(D.NodeIdInjection,null),c=f.ref();let h=r,m=i;const d=f.computed(()=>typeof n.nodeId=="string"?n.nodeId:u),x=f.computed(()=>n.variant===O.Line?"right":"bottom-right"),w=f.computed(()=>{var b;return(b=n.position)!=null?b:x.value});f.watchEffect(b=>{if(!c.value||!d.value)return;const k=I(c.value),a=w.value.includes("right")||w.value.includes("left"),g=w.value.includes("bottom")||w.value.includes("top"),y=w.value.includes("left"),_=w.value.includes("top"),A=Cn().on("start",v=>{var P,R,T,H;const p=o(d.value),{xSnapped:C,ySnapped:V}=s(v);m={width:(P=p==null?void 0:p.dimensions.width)!=null?P:0,height:(R=p==null?void 0:p.dimensions.height)!=null?R:0,x:(T=p==null?void 0:p.position.x)!=null?T:0,y:(H=p==null?void 0:p.position.y)!=null?H:0},h={...m,pointerX:C,pointerY:V,aspectRatio:m.width/m.height},e("resizeStart",{event:v,params:m})}).on("drag",v=>{var P;const{xSnapped:p,ySnapped:C}=s(v),V=o(d.value);if(V){const R=[],{pointerX:T,pointerY:H,width:q,height:j,x:$,y:W,aspectRatio:Nn}=h,{x:xt,y:bt,width:At,height:Ct}=m,St=Math.floor(a?p-T:0),zt=Math.floor(g?C-H:0);let S=D.clamp(q+(y?-St:St),n.minWidth,n.maxWidth),z=D.clamp(j+(_?-zt:zt),n.minHeight,n.maxHeight);if(n.keepAspectRatio){const L=S/z;let N=Nn;typeof n.keepAspectRatio=="number"&&L!==n.keepAspectRatio&&(N=n.keepAspectRatio);const K=a&&g,tt=a&&!g,G=g&&!a;S=L<=N&&K||G?z*N:S,z=L>N&&K||tt?S/N:z,S>=n.maxWidth?(S=n.maxWidth,z=n.maxWidth/N):S<=n.minWidth&&(S=n.minWidth,z=n.minWidth/N),z>=n.maxHeight?(z=n.maxHeight,S=n.maxHeight*N):z<=n.minHeight&&(z=n.minHeight,S=n.minHeight*N)}const Et=S!==At,Rt=z!==Ct;if(y||_){const L=y?$-(S-q):$,N=_?W-(z-j):W,K=L!==xt&&Et,tt=N!==bt&&Rt;if(K||tt){const G={id:V.id,type:"position",from:V.position,position:{x:K?L:xt,y:tt?N:bt}};R.push(G),m.x=G.position.x,m.y=G.position.y}}if(Et||Rt){const L={id:d.value,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:S,height:z}};R.push(L),m.width=S,m.height=z}if(R.length===0)return;const kn=Sn({width:m.width,prevWidth:At,height:m.height,prevHeight:Ct,invertX:y,invertY:_}),Nt={...m,direction:kn};if(((P=n.shouldResize)==null?void 0:P.call(n,v,Nt))===!1)return;e("resize",{event:v,params:Nt}),l.nodesChange(R)}}).on("end",v=>{const p={id:d.value,type:"dimensions",resizing:!1};e("resizeEnd",{event:v,params:m}),l.nodesChange([p])});k.call(A),b(()=>{k.on(".drag",null)})});const F=f.computed(()=>w.value.split("-")),M=f.computed(()=>n.variant===O.Line?"borderColor":"backgroundColor"),U=f.computed(()=>n.color?{[M.value]:n.color}:{});return(b,k)=>(f.openBlock(),f.createElementBlock("div",{ref_key:"resizeControlRef",ref:c,class:f.normalizeClass(["vue-flow__resize-control nodrag",[...f.unref(F),t.variant]]),style:f.normalizeStyle(f.unref(U))},[f.renderSlot(b.$slots,"default")],6))}}),En={name:"NodeResizer",compatConfig:{MODE:3},inheritAttrs:!1},Rn=f.defineComponent({...En,props:{nodeId:null,color:null,handleClassName:null,handleStyle:null,lineClassName:null,lineStyle:null,isVisible:{type:Boolean,default:!0},minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number]}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=["top-left","top-right","bottom-left","bottom-right"],i=["top","right","bottom","left"];return(r,o)=>t.isVisible?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(i,l=>f.createVNode(ot,{key:l,class:f.normalizeClass(t.lineClassName),style:f.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:l,variant:f.unref(O).Line,"keep-aspect-ratio":t.keepAspectRatio,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,onResizeStart:o[0]||(o[0]=s=>e("resizeStart",s)),onResize:o[1]||(o[1]=s=>e("resize",s)),onResizeEnd:o[2]||(o[2]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","variant","keep-aspect-ratio","color","min-width","min-height","max-width","max-height","should-resize"])),64)),(f.openBlock(),f.createElementBlock(f.Fragment,null,f.renderList(n,l=>f.createVNode(ot,{key:l,class:f.normalizeClass(t.handleClassName),style:f.normalizeStyle(t.handleStyle),"node-id":t.nodeId,position:l,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,"keep-aspect-ratio":t.keepAspectRatio,onResizeStart:o[3]||(o[3]=s=>e("resizeStart",s)),onResize:o[4]||(o[4]=s=>e("resize",s)),onResizeEnd:o[5]||(o[5]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio"])),64))],64)):f.createCommentVNode("",!0)}});return X.NodeResizeControl=ot,X.NodeResizer=Rn,X.ResizeControlVariant=O,Object.defineProperties(X,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),X}({},Vue,VueFlowCore);
var VueFlowNodeResizer=function(W,d,F){"use strict";const Nn="";var et="http://www.w3.org/1999/xhtml";const st={svg:"http://www.w3.org/2000/svg",xhtml:et,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function lt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),st.hasOwnProperty(e)?{space:st[e],local:t}:t}function Nt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===et&&e.documentElement.namespaceURI===et?e.createElement(t):e.createElementNS(n,t)}}function kt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function at(t){var e=lt(t);return(e.local?kt:Nt)(e)}function Vt(){}function ut(t){return t==null?Vt:function(){return this.querySelector(t)}}function Pt(t){typeof t!="function"&&(t=ut(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,l=r[i]=new Array(s),u,f,c=0;c<s;++c)(u=o[c])&&(f=t.call(u,u.__data__,c,o))&&("__data__"in u&&(f.__data__=u.__data__),l[c]=f);return new C(r,this._parents)}function Ht(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Ft(){return[]}function It(t){return t==null?Ft:function(){return this.querySelectorAll(t)}}function Lt(t){return function(){return Ht(t.apply(this,arguments))}}function Bt(t){typeof t=="function"?t=Lt(t):t=It(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],l=s.length,u,f=0;f<l;++f)(u=s[f])&&(r.push(t.call(u,u.__data__,f,s)),i.push(u));return new C(r,i)}function Tt(t){return function(){return this.matches(t)}}function ct(t){return function(e){return e.matches(t)}}var Mt=Array.prototype.find;function Wt(t){return function(){return Mt.call(this.children,t)}}function Xt(){return this.firstElementChild}function Dt(t){return this.select(t==null?Xt:Wt(typeof t=="function"?t:ct(t)))}var Yt=Array.prototype.filter;function Ot(){return Array.from(this.children)}function Ut(t){return function(){return Yt.call(this.children,t)}}function qt(t){return this.selectAll(t==null?Ot:Ut(typeof t=="function"?t:ct(t)))}function $t(t){typeof t!="function"&&(t=Tt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,l=r[i]=[],u,f=0;f<s;++f)(u=o[f])&&t.call(u,u.__data__,f,o)&&l.push(u);return new C(r,this._parents)}function ft(t){return new Array(t.length)}function Kt(){return new C(this._enter||this._groups.map(ft),this._parents)}function $(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}$.prototype={constructor:$,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Gt(t){return function(){return t}}function Jt(t,e,n,r,i,o){for(var s=0,l,u=e.length,f=o.length;s<f;++s)(l=e[s])?(l.__data__=o[s],r[s]=l):n[s]=new $(t,o[s]);for(;s<u;++s)(l=e[s])&&(i[s]=l)}function Qt(t,e,n,r,i,o,s){var l,u,f=new Map,c=e.length,p=o.length,h=new Array(c),y;for(l=0;l<c;++l)(u=e[l])&&(h[l]=y=s.call(u,u.__data__,l,e)+"",f.has(y)?i[l]=u:f.set(y,u));for(l=0;l<p;++l)y=s.call(t,o[l],l,o)+"",(u=f.get(y))?(r[l]=u,u.__data__=o[l],f.delete(y)):n[l]=new $(t,o[l]);for(l=0;l<c;++l)(u=e[l])&&f.get(h[l])===u&&(i[l]=u)}function Zt(t){return t.__data__}function jt(t,e){if(!arguments.length)return Array.from(this,Zt);var n=e?Qt:Jt,r=this._parents,i=this._groups;typeof t!="function"&&(t=Gt(t));for(var o=i.length,s=new Array(o),l=new Array(o),u=new Array(o),f=0;f<o;++f){var c=r[f],p=i[f],h=p.length,y=te(t.call(c,c&&c.__data__,f,r)),w=y.length,L=l[f]=new Array(w),k=s[f]=new Array(w),P=u[f]=new Array(h);n(c,p,L,k,P,y,e);for(var S=0,z=0,a,m;S<w;++S)if(a=L[S]){for(S>=z&&(z=S+1);!(m=k[z])&&++z<w;);a._next=m||null}}return s=new C(s,r),s._enter=l,s._exit=u,s}function te(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ee(){return new C(this._exit||this._groups.map(ft),this._parents)}function ne(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function ie(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),l=new Array(i),u=0;u<s;++u)for(var f=n[u],c=r[u],p=f.length,h=l[u]=new Array(p),y,w=0;w<p;++w)(y=f[w]||c[w])&&(h[w]=y);for(;u<i;++u)l[u]=n[u];return new C(l,this._parents)}function re(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function oe(t){t||(t=se);function e(p,h){return p&&h?t(p.__data__,h.__data__):!p-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],l=s.length,u=i[o]=new Array(l),f,c=0;c<l;++c)(f=s[c])&&(u[c]=f);u.sort(e)}return new C(i,this._parents).order()}function se(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function le(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ae(){return Array.from(this)}function ue(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function ce(){let t=0;for(const e of this)++t;return t}function fe(){return!this.node()}function he(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,l;o<s;++o)(l=i[o])&&t.call(l,l.__data__,o,i);return this}function de(t){return function(){this.removeAttribute(t)}}function me(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ge(t,e){return function(){this.setAttribute(t,e)}}function pe(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ye(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function _e(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function we(t,e){var n=lt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?me:de:typeof e=="function"?n.local?_e:ye:n.local?pe:ge)(n,e))}function ht(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ve(t){return function(){this.style.removeProperty(t)}}function xe(t,e,n){return function(){this.style.setProperty(t,e,n)}}function be(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ae(t,e,n){return arguments.length>1?this.each((e==null?ve:typeof e=="function"?be:xe)(t,e,n??"")):Ce(this.node(),t)}function Ce(t,e){return t.style.getPropertyValue(e)||ht(t).getComputedStyle(t,null).getPropertyValue(e)}function Se(t){return function(){delete this[t]}}function ze(t,e){return function(){this[t]=e}}function Ee(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Re(t,e){return arguments.length>1?this.each((e==null?Se:typeof e=="function"?Ee:ze)(t,e)):this.node()[t]}function dt(t){return t.trim().split(/^|\s+/)}function nt(t){return t.classList||new mt(t)}function mt(t){this._node=t,this._names=dt(t.getAttribute("class")||"")}mt.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function gt(t,e){for(var n=nt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function pt(t,e){for(var n=nt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Ne(t){return function(){gt(this,t)}}function ke(t){return function(){pt(this,t)}}function Ve(t,e){return function(){(e.apply(this,arguments)?gt:pt)(this,t)}}function Pe(t,e){var n=dt(t+"");if(arguments.length<2){for(var r=nt(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Ve:e?Ne:ke)(n,e))}function He(){this.textContent=""}function Fe(t){return function(){this.textContent=t}}function Ie(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Le(t){return arguments.length?this.each(t==null?He:(typeof t=="function"?Ie:Fe)(t)):this.node().textContent}function Be(){this.innerHTML=""}function Te(t){return function(){this.innerHTML=t}}function Me(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function We(t){return arguments.length?this.each(t==null?Be:(typeof t=="function"?Me:Te)(t)):this.node().innerHTML}function Xe(){this.nextSibling&&this.parentNode.appendChild(this)}function De(){return this.each(Xe)}function Ye(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Oe(){return this.each(Ye)}function Ue(t){var e=typeof t=="function"?t:at(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function qe(){return null}function $e(t,e){var n=typeof t=="function"?t:at(t),r=e==null?qe:typeof e=="function"?e:ut(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ke(){var t=this.parentNode;t&&t.removeChild(this)}function Ge(){return this.each(Ke)}function Je(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Qe(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ze(t){return this.select(t?Qe:Je)}function je(t){return arguments.length?this.property("__data__",t):this.node().__data__}function tn(t){return function(e){t.call(this,e,this.__data__)}}function en(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function nn(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function rn(t,e,n){return function(){var r=this.__on,i,o=tn(e);if(r){for(var s=0,l=r.length;s<l;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function on(t,e,n){var r=en(t+""),i,o=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,f=l.length,c;u<f;++u)for(i=0,c=l[u];i<o;++i)if((s=r[i]).type===c.type&&s.name===c.name)return c.value}return}for(l=e?rn:nn,i=0;i<o;++i)this.each(l(r[i],e,n));return this}function yt(t,e,n){var r=ht(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function sn(t,e){return function(){return yt(this,t,e)}}function ln(t,e){return function(){return yt(this,t,e.apply(this,arguments))}}function an(t,e){return this.each((typeof e=="function"?ln:sn)(t,e))}function*un(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var cn=[null];function C(t,e){this._groups=t,this._parents=e}function fn(){return this}C.prototype={constructor:C,select:Pt,selectAll:Bt,selectChild:Dt,selectChildren:qt,filter:$t,data:jt,enter:Kt,exit:ee,join:ne,merge:ie,selection:fn,order:re,sort:oe,call:le,nodes:ae,node:ue,size:ce,empty:fe,each:he,attr:we,style:Ae,property:Re,classed:Pe,text:Le,html:We,raise:De,lower:Oe,append:Ue,insert:$e,remove:Ge,clone:Ze,datum:je,on,dispatch:an,[Symbol.iterator]:un};function X(t){return typeof t=="string"?new C([[document.querySelector(t)]],[document.documentElement]):new C([[t]],cn)}function hn(t){let e;for(;e=t.sourceEvent;)t=e;return t}function _t(t,e){if(t=hn(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var dn={value:()=>{}};function wt(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new K(n)}function K(t){this._=t}function mn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}K.prototype=wt.prototype={constructor:K,on:function(t,e){var n=this._,r=mn(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=gn(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=vt(n[i],t.name,e);else if(e==null)for(i in n)n[i]=vt(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new K(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function gn(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function vt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=dn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const pn={passive:!1},D={capture:!0,passive:!1};function it(t){t.stopImmediatePropagation()}function I(t){t.preventDefault(),t.stopImmediatePropagation()}function yn(t){var e=t.document.documentElement,n=X(t).on("dragstart.drag",I,D);"onselectstart"in e?n.on("selectstart.drag",I,D):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function _n(t,e){var n=t.document.documentElement,r=X(t).on("dragstart.drag",null);e&&(r.on("click.drag",I,D),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const G=t=>()=>t;function rt(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:s,y:l,dx:u,dy:f,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:c}})}rt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function wn(t){return!t.ctrlKey&&!t.button}function vn(){return this.parentNode}function xn(t,e){return e??{x:t.x,y:t.y}}function bn(){return navigator.maxTouchPoints||"ontouchstart"in this}function An(){var t=wn,e=vn,n=xn,r=bn,i={},o=wt("start","drag","end"),s=0,l,u,f,c,p=0;function h(a){a.on("mousedown.drag",y).filter(r).on("touchstart.drag",k).on("touchmove.drag",P,pn).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(a,m){if(!(c||!t.call(this,a,m))){var v=z(this,e.call(this,a,m),a,m,"mouse");v&&(X(a.view).on("mousemove.drag",w,D).on("mouseup.drag",L,D),yn(a.view),it(a),f=!1,l=a.clientX,u=a.clientY,v("start",a))}}function w(a){if(I(a),!f){var m=a.clientX-l,v=a.clientY-u;f=m*m+v*v>p}i.mouse("drag",a)}function L(a){X(a.view).on("mousemove.drag mouseup.drag",null),_n(a.view,f),I(a),i.mouse("end",a)}function k(a,m){if(t.call(this,a,m)){var v=a.changedTouches,_=e.call(this,a,m),g=v.length,E,R;for(E=0;E<g;++E)(R=z(this,_,a,m,v[E].identifier,v[E]))&&(it(a),R("start",a,v[E]))}}function P(a){var m=a.changedTouches,v=m.length,_,g;for(_=0;_<v;++_)(g=i[m[_].identifier])&&(I(a),g("drag",a,m[_]))}function S(a){var m=a.changedTouches,v=m.length,_,g;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),_=0;_<v;++_)(g=i[m[_].identifier])&&(it(a),g("end",a,m[_]))}function z(a,m,v,_,g,E){var R=o.copy(),A=_t(E||v,m),H,J,B;if((B=n.call(a,new rt("beforestart",{sourceEvent:v,target:h,identifier:g,active:s,x:A[0],y:A[1],dx:0,dy:0,dispatch:R}),_))!=null)return H=B.x-A[0]||0,J=B.y-A[1]||0,function Q(T,O,Z){var j=A,M;switch(T){case"start":i[g]=Q,M=s++;break;case"end":delete i[g],--s;case"drag":A=_t(Z||O,m),M=s;break}R.call(T,a,new rt(T,{sourceEvent:O,subject:B,target:h,identifier:g,active:M,x:A[0]+H,y:A[1]+J,dx:A[0]-j[0],dy:A[1]-j[1],dispatch:R}),_)}}return h.filter=function(a){return arguments.length?(t=typeof a=="function"?a:G(!!a),h):t},h.container=function(a){return arguments.length?(e=typeof a=="function"?a:G(a),h):e},h.subject=function(a){return arguments.length?(n=typeof a=="function"?a:G(a),h):n},h.touchable=function(a){return arguments.length?(r=typeof a=="function"?a:G(!!a),h):r},h.on=function(){var a=o.on.apply(o,arguments);return a===o?h:a},h.clickDistance=function(a){return arguments.length?(p=(a=+a)*a,h):Math.sqrt(p)},h}var Y=(t=>(t.Line="line",t.Handle="handle",t))(Y||{});function Cn({width:t,prevWidth:e,height:n,prevHeight:r,invertX:i,invertY:o}){const s=t-e,l=n-r,u=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&i&&(u[0]=u[0]*-1),l&&o&&(u[1]=u[1]*-1),u}const Sn={name:"ResizeControl",compatConfig:{MODE:3}},ot=d.defineComponent({...Sn,props:{nodeId:null,color:null,minWidth:{default:10},minHeight:{default:10},maxWidth:{default:Number.MAX_VALUE},maxHeight:{default:Number.MAX_VALUE},position:null,variant:{default:"handle"},shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number],default:!1}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,r={width:0,height:0,x:0,y:0},i={...r,pointerX:0,pointerY:0,aspectRatio:1},{findNode:o,emits:s}=F.useVueFlow(),l=F.useGetPointerPosition(),u=d.ref();let f=i,c=r;const p=d.computed(()=>n.variant===Y.Line?"right":"bottom-right"),h=d.computed(()=>n.position??p.value);d.watchEffect(k=>{if(!u.value||!n.nodeId)return;const P=X(u.value),S=h.value.includes("right")||h.value.includes("left"),z=h.value.includes("bottom")||h.value.includes("top"),a=h.value.includes("left"),m=h.value.includes("top"),v=An().on("start",_=>{const g=o(n.nodeId),{xSnapped:E,ySnapped:R}=l(_);c={width:(g==null?void 0:g.dimensions.width)??0,height:(g==null?void 0:g.dimensions.height)??0,x:(g==null?void 0:g.position.x)??0,y:(g==null?void 0:g.position.y)??0},f={...c,pointerX:E,pointerY:R,aspectRatio:c.width/c.height},e("resizeStart",{event:_,params:c})}).on("drag",_=>{var A;const{xSnapped:g,ySnapped:E}=l(_),R=o(n.nodeId);if(R){const H=[],{pointerX:J,pointerY:B,width:Q,height:T,x:O,y:Z,aspectRatio:j}=f,{x:M,y:xt,width:bt,height:At}=c,Ct=Math.floor(S?g-J:0),St=Math.floor(z?E-B:0);let x=F.clamp(Q+(a?-Ct:Ct),n.minWidth,n.maxWidth),b=F.clamp(T+(m?-St:St),n.minHeight,n.maxHeight);if(n.keepAspectRatio){const V=x/b;let N=j;typeof n.keepAspectRatio=="number"&&V!==n.keepAspectRatio&&(N=n.keepAspectRatio);const U=S&&z,tt=S&&!z,q=z&&!S;x=V<=N&&U||q?b*N:x,b=V>N&&U||tt?x/N:b,x>=n.maxWidth?(x=n.maxWidth,b=n.maxWidth/N):x<=n.minWidth&&(x=n.minWidth,b=n.minWidth/N),b>=n.maxHeight?(b=n.maxHeight,x=n.maxHeight*N):b<=n.minHeight&&(b=n.minHeight,x=n.minHeight*N)}const zt=x!==bt,Et=b!==At;if(a||m){const V=a?O-(x-Q):O,N=m?Z-(b-T):Z,U=V!==M&&zt,tt=N!==xt&&Et;if(U||tt){const q={id:R.id,type:"position",from:R.position,position:{x:U?V:M,y:tt?N:xt}};H.push(q),c.x=q.position.x,c.y=q.position.y}}if(n.nodeId&&(zt||Et)){const V={id:n.nodeId,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:x,height:b}};H.push(V),c.width=x,c.height=b}if(H.length===0)return;const Rn=Cn({width:c.width,prevWidth:bt,height:c.height,prevHeight:At,invertX:a,invertY:m}),Rt={...c,direction:Rn};if(((A=n.shouldResize)==null?void 0:A.call(n,_,Rt))===!1)return;e("resize",{event:_,params:Rt}),s.nodesChange(H)}}).on("end",_=>{if(n.nodeId){const g={id:n.nodeId,type:"dimensions",resizing:!1};e("resizeEnd",{event:_,params:c}),s.nodesChange([g])}});P.call(v),k(()=>{P.on(".drag",null)})});const y=d.computed(()=>h.value.split("-")),w=d.computed(()=>n.variant===Y.Line?"borderColor":"backgroundColor"),L=d.computed(()=>n.color?{[w.value]:n.color}:{});return(k,P)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"resizeControlRef",ref:u,class:d.normalizeClass(["vue-flow__resize-control nodrag",[...d.unref(y),t.variant]]),style:d.normalizeStyle(d.unref(L))},[d.renderSlot(k.$slots,"default")],6))}}),zn={name:"NodeResizer",compatConfig:{MODE:3},inheritAttrs:!1},En=d.defineComponent({...zn,props:{nodeId:null,color:null,handleClassName:null,handleStyle:null,lineClassName:null,lineStyle:null,isVisible:{type:Boolean,default:!0},minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number]}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,{findNode:r,emits:i}=F.useVueFlow(),o=["top-left","top-right","bottom-left","bottom-right"],s=["top","right","bottom","left"],l=d.inject(F.NodeIdInjection,null),u=d.computed(()=>typeof n.nodeId=="string"?n.nodeId:l);return d.watch([()=>n.minWidth,()=>n.minHeight,()=>n.maxWidth,()=>n.maxHeight],([f,c,p,h])=>{const y=r(u.value);if(y){const w={id:y.id,type:"dimensions",updateStyle:!0,dimensions:{width:y.dimensions.width,height:y.dimensions.height}};f&&y.dimensions.width<f&&(w.dimensions.width=f),c&&y.dimensions.height<c&&(w.dimensions.height=c),p&&y.dimensions.width>p&&(w.dimensions.width=p),h&&y.dimensions.height>h&&(w.dimensions.height=h),(w.dimensions.width!==y.dimensions.width||w.dimensions.height!==y.dimensions.height)&&i.nodesChange([w])}},{flush:"post",immediate:!0}),(f,c)=>t.isVisible?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(s,p=>d.createVNode(ot,{key:p,class:d.normalizeClass(t.lineClassName),style:d.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:p,variant:d.unref(Y).Line,"keep-aspect-ratio":t.keepAspectRatio,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,onResizeStart:c[0]||(c[0]=h=>e("resizeStart",h)),onResize:c[1]||(c[1]=h=>e("resize",h)),onResizeEnd:c[2]||(c[2]=h=>e("resizeEnd",h))},null,8,["class","style","node-id","position","variant","keep-aspect-ratio","color","min-width","min-height","max-width","max-height","should-resize"])),64)),(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(o,p=>d.createVNode(ot,{key:p,class:d.normalizeClass(t.handleClassName),style:d.normalizeStyle(t.handleStyle),"node-id":d.unref(u),position:p,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,"keep-aspect-ratio":t.keepAspectRatio,onResizeStart:c[3]||(c[3]=h=>e("resizeStart",h)),onResize:c[4]||(c[4]=h=>e("resize",h)),onResizeEnd:c[5]||(c[5]=h=>e("resizeEnd",h))},null,8,["class","style","node-id","position","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio"])),64))],64)):d.createCommentVNode("",!0)}});return W.NodeResizeControl=ot,W.NodeResizer=En,W.ResizeControlVariant=Y,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"}),W}({},Vue,VueFlowCore);

@@ -1,1 +0,1 @@

"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("vue"),q=require("@vue-flow/core");var et="http://www.w3.org/1999/xhtml";const mt={svg:"http://www.w3.org/2000/svg",xhtml:et,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function yt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),mt.hasOwnProperty(e)?{space:mt[e],local:t}:t}function Pt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===et&&e.documentElement.namespaceURI===et?e.createElement(t):e.createElementNS(n,t)}}function Ht(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function vt(t){var e=yt(t);return(e.local?Ht:Pt)(e)}function Vt(){}function _t(t){return t==null?Vt:function(){return this.querySelector(t)}}function Lt(t){typeof t!="function"&&(t=_t(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o=e[r],l=o.length,s=i[r]=new Array(l),a,c,f=0;f<l;++f)(a=o[f])&&(c=t.call(a,a.__data__,f,o))&&("__data__"in a&&(c.__data__=a.__data__),s[f]=c);return new N(i,this._parents)}function Bt(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Mt(){return[]}function Tt(t){return t==null?Mt:function(){return this.querySelectorAll(t)}}function Ft(t){return function(){return Bt(t.apply(this,arguments))}}function Wt(t){typeof t=="function"?t=Ft(t):t=Tt(t);for(var e=this._groups,n=e.length,i=[],r=[],o=0;o<n;++o)for(var l=e[o],s=l.length,a,c=0;c<s;++c)(a=l[c])&&(i.push(t.call(a,a.__data__,c,l)),r.push(a));return new N(i,r)}function Xt(t){return function(){return this.matches(t)}}function wt(t){return function(e){return e.matches(t)}}var Dt=Array.prototype.find;function It(t){return function(){return Dt.call(this.children,t)}}function Yt(){return this.firstElementChild}function Ot(t){return this.select(t==null?Yt:It(typeof t=="function"?t:wt(t)))}var qt=Array.prototype.filter;function Ut(){return Array.from(this.children)}function $t(t){return function(){return qt.call(this.children,t)}}function Kt(t){return this.selectAll(t==null?Ut:$t(typeof t=="function"?t:wt(t)))}function Gt(t){typeof t!="function"&&(t=Xt(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var o=e[r],l=o.length,s=i[r]=[],a,c=0;c<l;++c)(a=o[c])&&t.call(a,a.__data__,c,o)&&s.push(a);return new N(i,this._parents)}function xt(t){return new Array(t.length)}function Jt(){return new N(this._enter||this._groups.map(xt),this._parents)}function j(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}j.prototype={constructor:j,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Qt(t){return function(){return t}}function Zt(t,e,n,i,r,o){for(var l=0,s,a=e.length,c=o.length;l<c;++l)(s=e[l])?(s.__data__=o[l],i[l]=s):n[l]=new j(t,o[l]);for(;l<a;++l)(s=e[l])&&(r[l]=s)}function jt(t,e,n,i,r,o,l){var s,a,c=new Map,f=e.length,m=o.length,d=new Array(f),x;for(s=0;s<f;++s)(a=e[s])&&(d[s]=x=l.call(a,a.__data__,s,e)+"",c.has(x)?r[s]=a:c.set(x,a));for(s=0;s<m;++s)x=l.call(t,o[s],s,o)+"",(a=c.get(x))?(i[s]=a,a.__data__=o[s],c.delete(x)):n[s]=new j(t,o[s]);for(s=0;s<f;++s)(a=e[s])&&c.get(d[s])===a&&(r[s]=a)}function te(t){return t.__data__}function ee(t,e){if(!arguments.length)return Array.from(this,te);var n=e?jt:Zt,i=this._parents,r=this._groups;typeof t!="function"&&(t=Qt(t));for(var o=r.length,l=new Array(o),s=new Array(o),a=new Array(o),c=0;c<o;++c){var f=i[c],m=r[c],d=m.length,x=ne(t.call(f,f&&f.__data__,c,i)),_=x.length,B=s[c]=new Array(_),M=l[c]=new Array(_),X=a[c]=new Array(d);n(f,m,B,M,X,x,e);for(var b=0,k=0,u,g;b<_;++b)if(u=B[b]){for(b>=k&&(k=b+1);!(g=M[k])&&++k<_;);u._next=g||null}}return l=new N(l,i),l._enter=s,l._exit=a,l}function ne(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ie(){return new N(this._exit||this._groups.map(xt),this._parents)}function re(t,e,n){var i=this.enter(),r=this,o=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?o.remove():n(o),i&&r?i.merge(r).order():r}function oe(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,o=i.length,l=Math.min(r,o),s=new Array(r),a=0;a<l;++a)for(var c=n[a],f=i[a],m=c.length,d=s[a]=new Array(m),x,_=0;_<m;++_)(x=c[_]||f[_])&&(d[_]=x);for(;a<r;++a)s[a]=n[a];return new N(s,this._parents)}function se(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,o=i[r],l;--r>=0;)(l=i[r])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function le(t){t||(t=ue);function e(m,d){return m&&d?t(m.__data__,d.__data__):!m-!d}for(var n=this._groups,i=n.length,r=new Array(i),o=0;o<i;++o){for(var l=n[o],s=l.length,a=r[o]=new Array(s),c,f=0;f<s;++f)(c=l[f])&&(a[f]=c);a.sort(e)}return new N(r,this._parents).order()}function ue(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ae(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ce(){return Array.from(this)}function fe(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length;r<o;++r){var l=i[r];if(l)return l}return null}function he(){let t=0;for(const e of this)++t;return t}function de(){return!this.node()}function me(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],o=0,l=r.length,s;o<l;++o)(s=r[o])&&t.call(s,s.__data__,o,r);return this}function ge(t){return function(){this.removeAttribute(t)}}function pe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ye(t,e){return function(){this.setAttribute(t,e)}}function ve(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function _e(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function we(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function xe(t,e){var n=yt(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?pe:ge:typeof e=="function"?n.local?we:_e:n.local?ve:ye)(n,e))}function bt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function be(t){return function(){this.style.removeProperty(t)}}function Ae(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Ce(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function Se(t,e,n){return arguments.length>1?this.each((e==null?be:typeof e=="function"?Ce:Ae)(t,e,n==null?"":n)):ze(this.node(),t)}function ze(t,e){return t.style.getPropertyValue(e)||bt(t).getComputedStyle(t,null).getPropertyValue(e)}function Ee(t){return function(){delete this[t]}}function Re(t,e){return function(){this[t]=e}}function Ne(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function ke(t,e){return arguments.length>1?this.each((e==null?Ee:typeof e=="function"?Ne:Re)(t,e)):this.node()[t]}function At(t){return t.trim().split(/^|\s+/)}function rt(t){return t.classList||new Ct(t)}function Ct(t){this._node=t,this._names=At(t.getAttribute("class")||"")}Ct.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function St(t,e){for(var n=rt(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function zt(t,e){for(var n=rt(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function Pe(t){return function(){St(this,t)}}function He(t){return function(){zt(this,t)}}function Ve(t,e){return function(){(e.apply(this,arguments)?St:zt)(this,t)}}function Le(t,e){var n=At(t+"");if(arguments.length<2){for(var i=rt(this.node()),r=-1,o=n.length;++r<o;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?Ve:e?Pe:He)(n,e))}function Be(){this.textContent=""}function Me(t){return function(){this.textContent=t}}function Te(t){return function(){var e=t.apply(this,arguments);this.textContent=e==null?"":e}}function Fe(t){return arguments.length?this.each(t==null?Be:(typeof t=="function"?Te:Me)(t)):this.node().textContent}function We(){this.innerHTML=""}function Xe(t){return function(){this.innerHTML=t}}function De(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e==null?"":e}}function Ie(t){return arguments.length?this.each(t==null?We:(typeof t=="function"?De:Xe)(t)):this.node().innerHTML}function Ye(){this.nextSibling&&this.parentNode.appendChild(this)}function Oe(){return this.each(Ye)}function qe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ue(){return this.each(qe)}function $e(t){var e=typeof t=="function"?t:vt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Ke(){return null}function Ge(t,e){var n=typeof t=="function"?t:vt(t),i=e==null?Ke:typeof e=="function"?e:_t(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function Je(){var t=this.parentNode;t&&t.removeChild(this)}function Qe(){return this.each(Je)}function Ze(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function je(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function tn(t){return this.select(t?je:Ze)}function en(t){return arguments.length?this.property("__data__",t):this.node().__data__}function nn(t){return function(e){t.call(this,e,this.__data__)}}function rn(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function on(t){return function(){var e=this.__on;if(!!e){for(var n=0,i=-1,r=e.length,o;n<r;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++i]=o;++i?e.length=i:delete this.__on}}}function sn(t,e,n){return function(){var i=this.__on,r,o=nn(e);if(i){for(var l=0,s=i.length;l<s;++l)if((r=i[l]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=e;return}}this.addEventListener(t.type,o,n),r={type:t.type,name:t.name,value:e,listener:o,options:n},i?i.push(r):this.__on=[r]}}function ln(t,e,n){var i=rn(t+""),r,o=i.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var a=0,c=s.length,f;a<c;++a)for(r=0,f=s[a];r<o;++r)if((l=i[r]).type===f.type&&l.name===f.name)return f.value}return}for(s=e?sn:on,r=0;r<o;++r)this.each(s(i[r],e,n));return this}function Et(t,e,n){var i=bt(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function un(t,e){return function(){return Et(this,t,e)}}function an(t,e){return function(){return Et(this,t,e.apply(this,arguments))}}function cn(t,e){return this.each((typeof e=="function"?an:un)(t,e))}function*fn(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,o=i.length,l;r<o;++r)(l=i[r])&&(yield l)}var hn=[null];function N(t,e){this._groups=t,this._parents=e}function dn(){return this}N.prototype={constructor:N,select:Lt,selectAll:Wt,selectChild:Ot,selectChildren:Kt,filter:Gt,data:ee,enter:Jt,exit:ie,join:re,merge:oe,selection:dn,order:se,sort:le,call:ae,nodes:ce,node:fe,size:he,empty:de,each:me,attr:xe,style:Se,property:ke,classed:Le,text:Fe,html:Ie,raise:Oe,lower:Ue,append:$e,insert:Ge,remove:Qe,clone:tn,datum:en,on:ln,dispatch:cn,[Symbol.iterator]:fn};function U(t){return typeof t=="string"?new N([[document.querySelector(t)]],[document.documentElement]):new N([[t]],hn)}function mn(t){let e;for(;e=t.sourceEvent;)t=e;return t}function gt(t,e){if(t=mn(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}var gn={value:()=>{}};function Rt(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Z(n)}function Z(t){this._=t}function pn(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Z.prototype=Rt.prototype={constructor:Z,on:function(t,e){var n=this._,i=pn(t+"",n),r,o=-1,l=i.length;if(arguments.length<2){for(;++o<l;)if((r=(t=i[o]).type)&&(r=yn(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<l;)if(r=(t=i[o]).type)n[r]=pt(n[r],t.name,e);else if(e==null)for(r in n)n[r]=pt(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Z(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,o;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],i=0,r=o.length;i<r;++i)o[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,o=i.length;r<o;++r)i[r].value.apply(e,n)}};function yn(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function pt(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=gn,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}const vn={passive:!1},$={capture:!0,passive:!1};function tt(t){t.stopImmediatePropagation()}function W(t){t.preventDefault(),t.stopImmediatePropagation()}function _n(t){var e=t.document.documentElement,n=U(t).on("dragstart.drag",W,$);"onselectstart"in e?n.on("selectstart.drag",W,$):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function wn(t,e){var n=t.document.documentElement,i=U(t).on("dragstart.drag",null);e&&(i.on("click.drag",W,$),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Q=t=>()=>t;function nt(t,{sourceEvent:e,subject:n,target:i,identifier:r,active:o,x:l,y:s,dx:a,dy:c,dispatch:f}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:f}})}nt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function xn(t){return!t.ctrlKey&&!t.button}function bn(){return this.parentNode}function An(t,e){return e==null?{x:t.x,y:t.y}:e}function Cn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sn(){var t=xn,e=bn,n=An,i=Cn,r={},o=Rt("start","drag","end"),l=0,s,a,c,f,m=0;function d(u){u.on("mousedown.drag",x).filter(i).on("touchstart.drag",M).on("touchmove.drag",X,vn).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(u,g){if(!(f||!t.call(this,u,g))){var y=k(this,e.call(this,u,g),u,g,"mouse");!y||(U(u.view).on("mousemove.drag",_,$).on("mouseup.drag",B,$),_n(u.view),tt(u),c=!1,s=u.clientX,a=u.clientY,y("start",u))}}function _(u){if(W(u),!c){var g=u.clientX-s,y=u.clientY-a;c=g*g+y*y>m}r.mouse("drag",u)}function B(u){U(u.view).on("mousemove.drag mouseup.drag",null),wn(u.view,c),W(u),r.mouse("end",u)}function M(u,g){if(!!t.call(this,u,g)){var y=u.changedTouches,v=e.call(this,u,g),A=y.length,w,p;for(w=0;w<A;++w)(p=k(this,v,u,g,y[w].identifier,y[w]))&&(tt(u),p("start",u,y[w]))}}function X(u){var g=u.changedTouches,y=g.length,v,A;for(v=0;v<y;++v)(A=r[g[v].identifier])&&(W(u),A("drag",u,g[v]))}function b(u){var g=u.changedTouches,y=g.length,v,A;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),v=0;v<y;++v)(A=r[g[v].identifier])&&(tt(u),A("end",u,g[v]))}function k(u,g,y,v,A,w){var p=o.copy(),C=gt(w||y,g),P,H,E;if((E=n.call(u,new nt("beforestart",{sourceEvent:y,target:d,identifier:A,active:l,x:C[0],y:C[1],dx:0,dy:0,dispatch:p}),v))!=null)return P=E.x-C[0]||0,H=E.y-C[1]||0,function T(V,D,G){var I=C,F;switch(V){case"start":r[A]=T,F=l++;break;case"end":delete r[A],--l;case"drag":C=gt(G||D,g),F=l;break}p.call(V,u,new nt(V,{sourceEvent:D,subject:E,target:d,identifier:A,active:F,x:C[0]+P,y:C[1]+H,dx:C[0]-I[0],dy:C[1]-I[1],dispatch:p}),v)}}return d.filter=function(u){return arguments.length?(t=typeof u=="function"?u:Q(!!u),d):t},d.container=function(u){return arguments.length?(e=typeof u=="function"?u:Q(u),d):e},d.subject=function(u){return arguments.length?(n=typeof u=="function"?u:Q(u),d):n},d.touchable=function(u){return arguments.length?(i=typeof u=="function"?u:Q(!!u),d):i},d.on=function(){var u=o.on.apply(o,arguments);return u===o?d:u},d.clickDistance=function(u){return arguments.length?(m=(u=+u)*u,d):Math.sqrt(m)},d}var K=(t=>(t.Line="line",t.Handle="handle",t))(K||{});function zn({width:t,prevWidth:e,height:n,prevHeight:i,invertX:r,invertY:o}){const l=t-e,s=n-i,a=[l>0?1:l<0?-1:0,s>0?1:s<0?-1:0];return l&&r&&(a[0]=a[0]*-1),s&&o&&(a[1]=a[1]*-1),a}const En={name:"ResizeControl",compatConfig:{MODE:3}},it=h.defineComponent({...En,props:{nodeId:null,color:null,minWidth:{default:10},minHeight:{default:10},maxWidth:{default:Number.MAX_VALUE},maxHeight:{default:Number.MAX_VALUE},position:null,variant:{default:"handle"},shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number],default:!1}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,i={width:0,height:0,x:0,y:0},r={...i,pointerX:0,pointerY:0,aspectRatio:1},{findNode:o,emits:l}=q.useVueFlow(),s=q.useGetPointerPosition(),a=h.inject(q.NodeIdInjection,null),c=h.ref();let f=r,m=i;const d=h.computed(()=>typeof n.nodeId=="string"?n.nodeId:a),x=h.computed(()=>n.variant===K.Line?"right":"bottom-right"),_=h.computed(()=>{var b;return(b=n.position)!=null?b:x.value});h.watchEffect(b=>{if(!c.value||!d.value)return;const k=U(c.value),u=_.value.includes("right")||_.value.includes("left"),g=_.value.includes("bottom")||_.value.includes("top"),y=_.value.includes("left"),v=_.value.includes("top"),A=Sn().on("start",w=>{var H,E,T,V;const p=o(d.value),{xSnapped:C,ySnapped:P}=s(w);m={width:(H=p==null?void 0:p.dimensions.width)!=null?H:0,height:(E=p==null?void 0:p.dimensions.height)!=null?E:0,x:(T=p==null?void 0:p.position.x)!=null?T:0,y:(V=p==null?void 0:p.position.y)!=null?V:0},f={...m,pointerX:C,pointerY:P,aspectRatio:m.width/m.height},e("resizeStart",{event:w,params:m})}).on("drag",w=>{var H;const{xSnapped:p,ySnapped:C}=s(w),P=o(d.value);if(P){const E=[],{pointerX:T,pointerY:V,width:D,height:G,x:I,y:F,aspectRatio:Nt}=f,{x:ot,y:st,width:lt,height:ut}=m,at=Math.floor(u?p-T:0),ct=Math.floor(g?C-V:0);let S=q.clamp(D+(y?-at:at),n.minWidth,n.maxWidth),z=q.clamp(G+(v?-ct:ct),n.minHeight,n.maxHeight);if(n.keepAspectRatio){const L=S/z;let R=Nt;typeof n.keepAspectRatio=="number"&&L!==n.keepAspectRatio&&(R=n.keepAspectRatio);const Y=u&&g,J=u&&!g,O=g&&!u;S=L<=R&&Y||O?z*R:S,z=L>R&&Y||J?S/R:z,S>=n.maxWidth?(S=n.maxWidth,z=n.maxWidth/R):S<=n.minWidth&&(S=n.minWidth,z=n.minWidth/R),z>=n.maxHeight?(z=n.maxHeight,S=n.maxHeight*R):z<=n.minHeight&&(z=n.minHeight,S=n.minHeight*R)}const ft=S!==lt,ht=z!==ut;if(y||v){const L=y?I-(S-D):I,R=v?F-(z-G):F,Y=L!==ot&&ft,J=R!==st&&ht;if(Y||J){const O={id:P.id,type:"position",from:P.position,position:{x:Y?L:ot,y:J?R:st}};E.push(O),m.x=O.position.x,m.y=O.position.y}}if(ft||ht){const L={id:d.value,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:S,height:z}};E.push(L),m.width=S,m.height=z}if(E.length===0)return;const kt=zn({width:m.width,prevWidth:lt,height:m.height,prevHeight:ut,invertX:y,invertY:v}),dt={...m,direction:kt};if(((H=n.shouldResize)==null?void 0:H.call(n,w,dt))===!1)return;e("resize",{event:w,params:dt}),l.nodesChange(E)}}).on("end",w=>{const p={id:d.value,type:"dimensions",resizing:!1};e("resizeEnd",{event:w,params:m}),l.nodesChange([p])});k.call(A),b(()=>{k.on(".drag",null)})});const B=h.computed(()=>_.value.split("-")),M=h.computed(()=>n.variant===K.Line?"borderColor":"backgroundColor"),X=h.computed(()=>n.color?{[M.value]:n.color}:{});return(b,k)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"resizeControlRef",ref:c,class:h.normalizeClass(["vue-flow__resize-control nodrag",[...h.unref(B),t.variant]]),style:h.normalizeStyle(h.unref(X))},[h.renderSlot(b.$slots,"default")],6))}}),Rn={name:"NodeResizer",compatConfig:{MODE:3},inheritAttrs:!1},Nn=h.defineComponent({...Rn,props:{nodeId:null,color:null,handleClassName:null,handleStyle:null,lineClassName:null,lineStyle:null,isVisible:{type:Boolean,default:!0},minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number]}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=["top-left","top-right","bottom-left","bottom-right"],i=["top","right","bottom","left"];return(r,o)=>t.isVisible?(h.openBlock(),h.createElementBlock(h.Fragment,{key:0},[(h.openBlock(),h.createElementBlock(h.Fragment,null,h.renderList(i,l=>h.createVNode(it,{key:l,class:h.normalizeClass(t.lineClassName),style:h.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:l,variant:h.unref(K).Line,"keep-aspect-ratio":t.keepAspectRatio,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,onResizeStart:o[0]||(o[0]=s=>e("resizeStart",s)),onResize:o[1]||(o[1]=s=>e("resize",s)),onResizeEnd:o[2]||(o[2]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","variant","keep-aspect-ratio","color","min-width","min-height","max-width","max-height","should-resize"])),64)),(h.openBlock(),h.createElementBlock(h.Fragment,null,h.renderList(n,l=>h.createVNode(it,{key:l,class:h.normalizeClass(t.handleClassName),style:h.normalizeStyle(t.handleStyle),"node-id":t.nodeId,position:l,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,"keep-aspect-ratio":t.keepAspectRatio,onResizeStart:o[3]||(o[3]=s=>e("resizeStart",s)),onResize:o[4]||(o[4]=s=>e("resize",s)),onResizeEnd:o[5]||(o[5]=s=>e("resizeEnd",s))},null,8,["class","style","node-id","position","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio"])),64))],64)):h.createCommentVNode("",!0)}});exports.NodeResizeControl=it;exports.NodeResizer=Nn;exports.ResizeControlVariant=K;
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("vue"),T=require("@vue-flow/core");var et="http://www.w3.org/1999/xhtml";const dt={svg:"http://www.w3.org/2000/svg",xhtml:et,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),dt.hasOwnProperty(e)?{space:dt[e],local:t}:t}function Nt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===et&&e.documentElement.namespaceURI===et?e.createElement(t):e.createElementNS(n,t)}}function kt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yt(t){var e=pt(t);return(e.local?kt:Nt)(e)}function Pt(){}function vt(t){return t==null?Pt:function(){return this.querySelector(t)}}function Vt(t){typeof t!="function"&&(t=vt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,l=r[i]=new Array(s),a,f,c=0;c<s;++c)(a=o[c])&&(f=t.call(a,a.__data__,c,o))&&("__data__"in a&&(f.__data__=a.__data__),l[c]=f);return new N(r,this._parents)}function Ht(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function It(){return[]}function Lt(t){return t==null?It:function(){return this.querySelectorAll(t)}}function Bt(t){return function(){return Ht(t.apply(this,arguments))}}function Ft(t){typeof t=="function"?t=Bt(t):t=Lt(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],l=s.length,a,f=0;f<l;++f)(a=s[f])&&(r.push(t.call(a,a.__data__,f,s)),i.push(a));return new N(r,i)}function Tt(t){return function(){return this.matches(t)}}function _t(t){return function(e){return e.matches(t)}}var Mt=Array.prototype.find;function Wt(t){return function(){return Mt.call(this.children,t)}}function Xt(){return this.firstElementChild}function Dt(t){return this.select(t==null?Xt:Wt(typeof t=="function"?t:_t(t)))}var Yt=Array.prototype.filter;function Ot(){return Array.from(this.children)}function qt(t){return function(){return Yt.call(this.children,t)}}function Ut(t){return this.selectAll(t==null?Ot:qt(typeof t=="function"?t:_t(t)))}function $t(t){typeof t!="function"&&(t=Tt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,l=r[i]=[],a,f=0;f<s;++f)(a=o[f])&&t.call(a,a.__data__,f,o)&&l.push(a);return new N(r,this._parents)}function wt(t){return new Array(t.length)}function Kt(){return new N(this._enter||this._groups.map(wt),this._parents)}function j(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}j.prototype={constructor:j,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Gt(t){return function(){return t}}function Jt(t,e,n,r,i,o){for(var s=0,l,a=e.length,f=o.length;s<f;++s)(l=e[s])?(l.__data__=o[s],r[s]=l):n[s]=new j(t,o[s]);for(;s<a;++s)(l=e[s])&&(i[s]=l)}function Qt(t,e,n,r,i,o,s){var l,a,f=new Map,c=e.length,p=o.length,h=new Array(c),y;for(l=0;l<c;++l)(a=e[l])&&(h[l]=y=s.call(a,a.__data__,l,e)+"",f.has(y)?i[l]=a:f.set(y,a));for(l=0;l<p;++l)y=s.call(t,o[l],l,o)+"",(a=f.get(y))?(r[l]=a,a.__data__=o[l],f.delete(y)):n[l]=new j(t,o[l]);for(l=0;l<c;++l)(a=e[l])&&f.get(h[l])===a&&(i[l]=a)}function Zt(t){return t.__data__}function jt(t,e){if(!arguments.length)return Array.from(this,Zt);var n=e?Qt:Jt,r=this._parents,i=this._groups;typeof t!="function"&&(t=Gt(t));for(var o=i.length,s=new Array(o),l=new Array(o),a=new Array(o),f=0;f<o;++f){var c=r[f],p=i[f],h=p.length,y=te(t.call(c,c&&c.__data__,f,r)),_=y.length,I=l[f]=new Array(_),k=s[f]=new Array(_),V=a[f]=new Array(h);n(c,p,I,k,V,y,e);for(var C=0,S=0,u,m;C<_;++C)if(u=I[C]){for(C>=S&&(S=C+1);!(m=k[S])&&++S<_;);u._next=m||null}}return s=new N(s,r),s._enter=l,s._exit=a,s}function te(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ee(){return new N(this._exit||this._groups.map(wt),this._parents)}function ne(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function ie(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),l=new Array(i),a=0;a<s;++a)for(var f=n[a],c=r[a],p=f.length,h=l[a]=new Array(p),y,_=0;_<p;++_)(y=f[_]||c[_])&&(h[_]=y);for(;a<i;++a)l[a]=n[a];return new N(l,this._parents)}function re(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function oe(t){t||(t=se);function e(p,h){return p&&h?t(p.__data__,h.__data__):!p-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],l=s.length,a=i[o]=new Array(l),f,c=0;c<l;++c)(f=s[c])&&(a[c]=f);a.sort(e)}return new N(i,this._parents).order()}function se(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function le(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ue(){return Array.from(this)}function ae(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function ce(){let t=0;for(const e of this)++t;return t}function fe(){return!this.node()}function he(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,l;o<s;++o)(l=i[o])&&t.call(l,l.__data__,o,i);return this}function de(t){return function(){this.removeAttribute(t)}}function me(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ge(t,e){return function(){this.setAttribute(t,e)}}function pe(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ye(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ve(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function _e(t,e){var n=pt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?me:de:typeof e=="function"?n.local?ve:ye:n.local?pe:ge)(n,e))}function xt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function we(t){return function(){this.style.removeProperty(t)}}function xe(t,e,n){return function(){this.style.setProperty(t,e,n)}}function be(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ae(t,e,n){return arguments.length>1?this.each((e==null?we:typeof e=="function"?be:xe)(t,e,n??"")):Ce(this.node(),t)}function Ce(t,e){return t.style.getPropertyValue(e)||xt(t).getComputedStyle(t,null).getPropertyValue(e)}function Se(t){return function(){delete this[t]}}function ze(t,e){return function(){this[t]=e}}function Ee(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Re(t,e){return arguments.length>1?this.each((e==null?Se:typeof e=="function"?Ee:ze)(t,e)):this.node()[t]}function bt(t){return t.trim().split(/^|\s+/)}function rt(t){return t.classList||new At(t)}function At(t){this._node=t,this._names=bt(t.getAttribute("class")||"")}At.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Ct(t,e){for(var n=rt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function St(t,e){for(var n=rt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Ne(t){return function(){Ct(this,t)}}function ke(t){return function(){St(this,t)}}function Pe(t,e){return function(){(e.apply(this,arguments)?Ct:St)(this,t)}}function Ve(t,e){var n=bt(t+"");if(arguments.length<2){for(var r=rt(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Pe:e?Ne:ke)(n,e))}function He(){this.textContent=""}function Ie(t){return function(){this.textContent=t}}function Le(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Be(t){return arguments.length?this.each(t==null?He:(typeof t=="function"?Le:Ie)(t)):this.node().textContent}function Fe(){this.innerHTML=""}function Te(t){return function(){this.innerHTML=t}}function Me(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function We(t){return arguments.length?this.each(t==null?Fe:(typeof t=="function"?Me:Te)(t)):this.node().innerHTML}function Xe(){this.nextSibling&&this.parentNode.appendChild(this)}function De(){return this.each(Xe)}function Ye(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Oe(){return this.each(Ye)}function qe(t){var e=typeof t=="function"?t:yt(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Ue(){return null}function $e(t,e){var n=typeof t=="function"?t:yt(t),r=e==null?Ue:typeof e=="function"?e:vt(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ke(){var t=this.parentNode;t&&t.removeChild(this)}function Ge(){return this.each(Ke)}function Je(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Qe(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ze(t){return this.select(t?Qe:Je)}function je(t){return arguments.length?this.property("__data__",t):this.node().__data__}function tn(t){return function(e){t.call(this,e,this.__data__)}}function en(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function nn(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function rn(t,e,n){return function(){var r=this.__on,i,o=tn(e);if(r){for(var s=0,l=r.length;s<l;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function on(t,e,n){var r=en(t+""),i,o=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,f=l.length,c;a<f;++a)for(i=0,c=l[a];i<o;++i)if((s=r[i]).type===c.type&&s.name===c.name)return c.value}return}for(l=e?rn:nn,i=0;i<o;++i)this.each(l(r[i],e,n));return this}function zt(t,e,n){var r=xt(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function sn(t,e){return function(){return zt(this,t,e)}}function ln(t,e){return function(){return zt(this,t,e.apply(this,arguments))}}function un(t,e){return this.each((typeof e=="function"?ln:sn)(t,e))}function*an(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var cn=[null];function N(t,e){this._groups=t,this._parents=e}function fn(){return this}N.prototype={constructor:N,select:Vt,selectAll:Ft,selectChild:Dt,selectChildren:Ut,filter:$t,data:jt,enter:Kt,exit:ee,join:ne,merge:ie,selection:fn,order:re,sort:oe,call:le,nodes:ue,node:ae,size:ce,empty:fe,each:he,attr:_e,style:Ae,property:Re,classed:Ve,text:Be,html:We,raise:De,lower:Oe,append:qe,insert:$e,remove:Ge,clone:Ze,datum:je,on,dispatch:un,[Symbol.iterator]:an};function Y(t){return typeof t=="string"?new N([[document.querySelector(t)]],[document.documentElement]):new N([[t]],cn)}function hn(t){let e;for(;e=t.sourceEvent;)t=e;return t}function mt(t,e){if(t=hn(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var dn={value:()=>{}};function Et(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Z(n)}function Z(t){this._=t}function mn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Z.prototype=Et.prototype={constructor:Z,on:function(t,e){var n=this._,r=mn(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=gn(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=gt(n[i],t.name,e);else if(e==null)for(i in n)n[i]=gt(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Z(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function gn(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function gt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=dn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const pn={passive:!1},O={capture:!0,passive:!1};function tt(t){t.stopImmediatePropagation()}function M(t){t.preventDefault(),t.stopImmediatePropagation()}function yn(t){var e=t.document.documentElement,n=Y(t).on("dragstart.drag",M,O);"onselectstart"in e?n.on("selectstart.drag",M,O):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function vn(t,e){var n=t.document.documentElement,r=Y(t).on("dragstart.drag",null);e&&(r.on("click.drag",M,O),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Q=t=>()=>t;function nt(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:s,y:l,dx:a,dy:f,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:c}})}nt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function _n(t){return!t.ctrlKey&&!t.button}function wn(){return this.parentNode}function xn(t,e){return e??{x:t.x,y:t.y}}function bn(){return navigator.maxTouchPoints||"ontouchstart"in this}function An(){var t=_n,e=wn,n=xn,r=bn,i={},o=Et("start","drag","end"),s=0,l,a,f,c,p=0;function h(u){u.on("mousedown.drag",y).filter(r).on("touchstart.drag",k).on("touchmove.drag",V,pn).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(u,m){if(!(c||!t.call(this,u,m))){var w=S(this,e.call(this,u,m),u,m,"mouse");w&&(Y(u.view).on("mousemove.drag",_,O).on("mouseup.drag",I,O),yn(u.view),tt(u),f=!1,l=u.clientX,a=u.clientY,w("start",u))}}function _(u){if(M(u),!f){var m=u.clientX-l,w=u.clientY-a;f=m*m+w*w>p}i.mouse("drag",u)}function I(u){Y(u.view).on("mousemove.drag mouseup.drag",null),vn(u.view,f),M(u),i.mouse("end",u)}function k(u,m){if(t.call(this,u,m)){var w=u.changedTouches,v=e.call(this,u,m),g=w.length,z,E;for(z=0;z<g;++z)(E=S(this,v,u,m,w[z].identifier,w[z]))&&(tt(u),E("start",u,w[z]))}}function V(u){var m=u.changedTouches,w=m.length,v,g;for(v=0;v<w;++v)(g=i[m[v].identifier])&&(M(u),g("drag",u,m[v]))}function C(u){var m=u.changedTouches,w=m.length,v,g;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),v=0;v<w;++v)(g=i[m[v].identifier])&&(tt(u),g("end",u,m[v]))}function S(u,m,w,v,g,z){var E=o.copy(),A=mt(z||w,m),H,U,L;if((L=n.call(u,new nt("beforestart",{sourceEvent:w,target:h,identifier:g,active:s,x:A[0],y:A[1],dx:0,dy:0,dispatch:E}),v))!=null)return H=L.x-A[0]||0,U=L.y-A[1]||0,function $(B,W,K){var G=A,F;switch(B){case"start":i[g]=$,F=s++;break;case"end":delete i[g],--s;case"drag":A=mt(K||W,m),F=s;break}E.call(B,u,new nt(B,{sourceEvent:W,subject:L,target:h,identifier:g,active:F,x:A[0]+H,y:A[1]+U,dx:A[0]-G[0],dy:A[1]-G[1],dispatch:E}),v)}}return h.filter=function(u){return arguments.length?(t=typeof u=="function"?u:Q(!!u),h):t},h.container=function(u){return arguments.length?(e=typeof u=="function"?u:Q(u),h):e},h.subject=function(u){return arguments.length?(n=typeof u=="function"?u:Q(u),h):n},h.touchable=function(u){return arguments.length?(r=typeof u=="function"?u:Q(!!u),h):r},h.on=function(){var u=o.on.apply(o,arguments);return u===o?h:u},h.clickDistance=function(u){return arguments.length?(p=(u=+u)*u,h):Math.sqrt(p)},h}var q=(t=>(t.Line="line",t.Handle="handle",t))(q||{});function Cn({width:t,prevWidth:e,height:n,prevHeight:r,invertX:i,invertY:o}){const s=t-e,l=n-r,a=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&i&&(a[0]=a[0]*-1),l&&o&&(a[1]=a[1]*-1),a}const Sn={name:"ResizeControl",compatConfig:{MODE:3}},it=d.defineComponent({...Sn,props:{nodeId:null,color:null,minWidth:{default:10},minHeight:{default:10},maxWidth:{default:Number.MAX_VALUE},maxHeight:{default:Number.MAX_VALUE},position:null,variant:{default:"handle"},shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number],default:!1}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,r={width:0,height:0,x:0,y:0},i={...r,pointerX:0,pointerY:0,aspectRatio:1},{findNode:o,emits:s}=T.useVueFlow(),l=T.useGetPointerPosition(),a=d.ref();let f=i,c=r;const p=d.computed(()=>n.variant===q.Line?"right":"bottom-right"),h=d.computed(()=>n.position??p.value);d.watchEffect(k=>{if(!a.value||!n.nodeId)return;const V=Y(a.value),C=h.value.includes("right")||h.value.includes("left"),S=h.value.includes("bottom")||h.value.includes("top"),u=h.value.includes("left"),m=h.value.includes("top"),w=An().on("start",v=>{const g=o(n.nodeId),{xSnapped:z,ySnapped:E}=l(v);c={width:(g==null?void 0:g.dimensions.width)??0,height:(g==null?void 0:g.dimensions.height)??0,x:(g==null?void 0:g.position.x)??0,y:(g==null?void 0:g.position.y)??0},f={...c,pointerX:z,pointerY:E,aspectRatio:c.width/c.height},e("resizeStart",{event:v,params:c})}).on("drag",v=>{var A;const{xSnapped:g,ySnapped:z}=l(v),E=o(n.nodeId);if(E){const H=[],{pointerX:U,pointerY:L,width:$,height:B,x:W,y:K,aspectRatio:G}=f,{x:F,y:ot,width:st,height:lt}=c,ut=Math.floor(C?g-U:0),at=Math.floor(S?z-L:0);let x=T.clamp($+(u?-ut:ut),n.minWidth,n.maxWidth),b=T.clamp(B+(m?-at:at),n.minHeight,n.maxHeight);if(n.keepAspectRatio){const P=x/b;let R=G;typeof n.keepAspectRatio=="number"&&P!==n.keepAspectRatio&&(R=n.keepAspectRatio);const X=C&&S,J=C&&!S,D=S&&!C;x=P<=R&&X||D?b*R:x,b=P>R&&X||J?x/R:b,x>=n.maxWidth?(x=n.maxWidth,b=n.maxWidth/R):x<=n.minWidth&&(x=n.minWidth,b=n.minWidth/R),b>=n.maxHeight?(b=n.maxHeight,x=n.maxHeight*R):b<=n.minHeight&&(b=n.minHeight,x=n.minHeight*R)}const ct=x!==st,ft=b!==lt;if(u||m){const P=u?W-(x-$):W,R=m?K-(b-B):K,X=P!==F&&ct,J=R!==ot&&ft;if(X||J){const D={id:E.id,type:"position",from:E.position,position:{x:X?P:F,y:J?R:ot}};H.push(D),c.x=D.position.x,c.y=D.position.y}}if(n.nodeId&&(ct||ft)){const P={id:n.nodeId,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:x,height:b}};H.push(P),c.width=x,c.height=b}if(H.length===0)return;const Rt=Cn({width:c.width,prevWidth:st,height:c.height,prevHeight:lt,invertX:u,invertY:m}),ht={...c,direction:Rt};if(((A=n.shouldResize)==null?void 0:A.call(n,v,ht))===!1)return;e("resize",{event:v,params:ht}),s.nodesChange(H)}}).on("end",v=>{if(n.nodeId){const g={id:n.nodeId,type:"dimensions",resizing:!1};e("resizeEnd",{event:v,params:c}),s.nodesChange([g])}});V.call(w),k(()=>{V.on(".drag",null)})});const y=d.computed(()=>h.value.split("-")),_=d.computed(()=>n.variant===q.Line?"borderColor":"backgroundColor"),I=d.computed(()=>n.color?{[_.value]:n.color}:{});return(k,V)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"resizeControlRef",ref:a,class:d.normalizeClass(["vue-flow__resize-control nodrag",[...d.unref(y),t.variant]]),style:d.normalizeStyle(d.unref(I))},[d.renderSlot(k.$slots,"default")],6))}}),zn={name:"NodeResizer",compatConfig:{MODE:3},inheritAttrs:!1},En=d.defineComponent({...zn,props:{nodeId:null,color:null,handleClassName:null,handleStyle:null,lineClassName:null,lineStyle:null,isVisible:{type:Boolean,default:!0},minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,shouldResize:{type:Function},keepAspectRatio:{type:[Boolean,Number]}},emits:["resizeStart","resize","resizeEnd"],setup(t,{emit:e}){const n=t,{findNode:r,emits:i}=T.useVueFlow(),o=["top-left","top-right","bottom-left","bottom-right"],s=["top","right","bottom","left"],l=d.inject(T.NodeIdInjection,null),a=d.computed(()=>typeof n.nodeId=="string"?n.nodeId:l);return d.watch([()=>n.minWidth,()=>n.minHeight,()=>n.maxWidth,()=>n.maxHeight],([f,c,p,h])=>{const y=r(a.value);if(y){const _={id:y.id,type:"dimensions",updateStyle:!0,dimensions:{width:y.dimensions.width,height:y.dimensions.height}};f&&y.dimensions.width<f&&(_.dimensions.width=f),c&&y.dimensions.height<c&&(_.dimensions.height=c),p&&y.dimensions.width>p&&(_.dimensions.width=p),h&&y.dimensions.height>h&&(_.dimensions.height=h),(_.dimensions.width!==y.dimensions.width||_.dimensions.height!==y.dimensions.height)&&i.nodesChange([_])}},{flush:"post",immediate:!0}),(f,c)=>t.isVisible?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(s,p=>d.createVNode(it,{key:p,class:d.normalizeClass(t.lineClassName),style:d.normalizeStyle(t.lineStyle),"node-id":t.nodeId,position:p,variant:d.unref(q).Line,"keep-aspect-ratio":t.keepAspectRatio,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,onResizeStart:c[0]||(c[0]=h=>e("resizeStart",h)),onResize:c[1]||(c[1]=h=>e("resize",h)),onResizeEnd:c[2]||(c[2]=h=>e("resizeEnd",h))},null,8,["class","style","node-id","position","variant","keep-aspect-ratio","color","min-width","min-height","max-width","max-height","should-resize"])),64)),(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(o,p=>d.createVNode(it,{key:p,class:d.normalizeClass(t.handleClassName),style:d.normalizeStyle(t.handleStyle),"node-id":d.unref(a),position:p,color:t.color,"min-width":t.minWidth,"min-height":t.minHeight,"max-width":t.maxWidth,"max-height":t.maxHeight,"should-resize":t.shouldResize,"keep-aspect-ratio":t.keepAspectRatio,onResizeStart:c[3]||(c[3]=h=>e("resizeStart",h)),onResize:c[4]||(c[4]=h=>e("resize",h)),onResizeEnd:c[5]||(c[5]=h=>e("resizeEnd",h))},null,8,["class","style","node-id","position","color","min-width","min-height","max-width","max-height","should-resize","keep-aspect-ratio"])),64))],64)):d.createCommentVNode("",!0)}});exports.NodeResizeControl=it;exports.NodeResizer=En;exports.ResizeControlVariant=q;
{
"name": "@vue-flow/node-resizer",
"version": "1.3.3",
"version": "1.3.4",
"private": false,

@@ -65,6 +65,6 @@ "license": "MIT",

"vue-tsc": "^1.6.5",
"@tooling/tsconfig": "0.0.0",
"@tooling/eslint-config": "0.0.0",
"@tooling/vite-config": "0.0.0",
"@tooling/eslint-config": "0.0.0",
"@vue-flow/core": "1.21.0"
"@vue-flow/core": "1.22.3",
"@tooling/tsconfig": "0.0.0"
},

@@ -71,0 +71,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc