import{a as f}from"./chunk-VELTKBKT.mjs";var d=f((t,r)=>{if(r)return"translate("+-t.width/2+", "+-t.height/2+")";let c=t.x??0,e=t.y??0;return"translate("+-(c+t.width/2)+", "+-(e+t.height/2)+")"},"computeLabelTransform");var s={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},T={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function x(t,r){if(t===void 0||r===void 0)return{angle:0,deltaX:0,deltaY:0};t=n(t),r=n(r);let[c,e]=[t.x,t.y],[o,i]=[r.x,r.y],l=o-c,p=i-e;return{angle:Math.atan(p/l),deltaX:l,deltaY:p}}f(x,"calculateDeltaAndAngle");var n=f(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),E=f(t=>({x:f(function(r,c,e){let o=0,i=n(e[0]).x<n(e[e.length-1]).x?"left":"right";if(c===0&&Object.hasOwn(s,t.arrowTypeStart)){let{angle:a,deltaX:m}=x(e[0],e[1]);o=s[t.arrowTypeStart]*Math.cos(a)*(m>=0?1:-1)}else if(c===e.length-1&&Object.hasOwn(s,t.arrowTypeEnd)){let{angle:a,deltaX:m}=x(e[e.length-1],e[e.length-2]);o=s[t.arrowTypeEnd]*Math.cos(a)*(m>=0?1:-1)}let l=Math.abs(n(r).x-n(e[e.length-1]).x),p=Math.abs(n(r).y-n(e[e.length-1]).y),u=Math.abs(n(r).x-n(e[0]).x),b=Math.abs(n(r).y-n(e[0]).y),y=s[t.arrowTypeStart],h=s[t.arrowTypeEnd],g=1;if(l<h&&l>0&&p<h){let a=h+g-l;a*=i==="right"?-1:1,o-=a}if(u<y&&u>0&&b<y){let a=y+g-u;a*=i==="right"?-1:1,o+=a}return n(r).x+o},"x"),y:f(function(r,c,e){let o=0,i=n(e[0]).y<n(e[e.length-1]).y?"down":"up";if(c===0&&Object.hasOwn(s,t.arrowTypeStart)){let{angle:a,deltaY:m}=x(e[0],e[1]);o=s[t.arrowTypeStart]*Math.abs(Math.sin(a))*(m>=0?1:-1)}else if(c===e.length-1&&Object.hasOwn(s,t.arrowTypeEnd)){let{angle:a,deltaY:m}=x(e[e.length-1],e[e.length-2]);o=s[t.arrowTypeEnd]*Math.abs(Math.sin(a))*(m>=0?1:-1)}let l=Math.abs(n(r).y-n(e[e.length-1]).y),p=Math.abs(n(r).x-n(e[e.length-1]).x),u=Math.abs(n(r).y-n(e[0]).y),b=Math.abs(n(r).x-n(e[0]).x),y=s[t.arrowTypeStart],h=s[t.arrowTypeEnd],g=1;if(l<h&&l>0&&p<h){let a=h+g-l;a*=i==="up"?-1:1,o-=a}if(u<y&&u>0&&b<y){let a=y+g-u;a*=i==="up"?-1:1,o+=a}return n(r).y+o},"y")}),"getLineFunctionsWithOffset");export{d as a,s as b,T as c,E as d};
