import{r as t}from"./src-C2qr8KzS.js";var a=t((t,a)=>{if(a)return"translate("+-t.width/2+", "+-t.height/2+")";const e=t.x??0,r=t.y??0;return"translate("+-(e+t.width/2)+", "+-(r+t.height/2)+")"},"computeLabelTransform"),e={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},r={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function n(t,a){if(void 0===t||void 0===a)return{angle:0,deltaX:0,deltaY:0};t=o(t),a=o(a);const[e,r]=[t.x,t.y],[n,s]=[a.x,a.y],l=n-e,h=s-r;return{angle:Math.atan(h/l),deltaX:l,deltaY:h}}t(n,"calculateDeltaAndAngle");var o=t(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),s=t(a=>({x:t(function(t,r,s){let l=0;const h=o(s[0]).x<o(s[s.length-1]).x?"left":"right";if(0===r&&Object.hasOwn(e,a.arrowTypeStart)){const{angle:t,deltaX:r}=n(s[0],s[1]);l=e[a.arrowTypeStart]*Math.cos(t)*(r>=0?1:-1)}else if(r===s.length-1&&Object.hasOwn(e,a.arrowTypeEnd)){const{angle:t,deltaX:r}=n(s[s.length-1],s[s.length-2]);l=e[a.arrowTypeEnd]*Math.cos(t)*(r>=0?1:-1)}const i=Math.abs(o(t).x-o(s[s.length-1]).x),y=Math.abs(o(t).y-o(s[s.length-1]).y),c=Math.abs(o(t).x-o(s[0]).x),g=Math.abs(o(t).y-o(s[0]).y),p=e[a.arrowTypeStart],w=e[a.arrowTypeEnd];if(i<w&&i>0&&y<w){let t=w+1-i;t*="right"===h?-1:1,l-=t}if(c<p&&c>0&&g<p){let t=p+1-c;t*="right"===h?-1:1,l+=t}return o(t).x+l},"x"),y:t(function(t,r,s){let l=0;const h=o(s[0]).y<o(s[s.length-1]).y?"down":"up";if(0===r&&Object.hasOwn(e,a.arrowTypeStart)){const{angle:t,deltaY:r}=n(s[0],s[1]);l=e[a.arrowTypeStart]*Math.abs(Math.sin(t))*(r>=0?1:-1)}else if(r===s.length-1&&Object.hasOwn(e,a.arrowTypeEnd)){const{angle:t,deltaY:r}=n(s[s.length-1],s[s.length-2]);l=e[a.arrowTypeEnd]*Math.abs(Math.sin(t))*(r>=0?1:-1)}const i=Math.abs(o(t).y-o(s[s.length-1]).y),y=Math.abs(o(t).x-o(s[s.length-1]).x),c=Math.abs(o(t).y-o(s[0]).y),g=Math.abs(o(t).x-o(s[0]).x),p=e[a.arrowTypeStart],w=e[a.arrowTypeEnd];if(i<w&&i>0&&y<w){let t=w+1-i;t*="up"===h?-1:1,l-=t}if(c<p&&c>0&&g<p){let t=p+1-c;t*="up"===h?-1:1,l+=t}return o(t).y+l},"y")}),"getLineFunctionsWithOffset");export{r as i,s as n,e as r,a as t};