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