import{n as e}from"./rolldown-runtime-BG2f4sTM.js";import{n as t,r as n}from"./chunk-AGHRB4JF-D33xM56t.js";function r(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=o(e),t=o(t);let[n,r]=[e.x,e.y],[i,a]=[t.x,t.y],s=i-n,c=a-r;return{angle:Math.atan(c/s),deltaX:s,deltaY:c}}var i,a,o,s,c=e((()=>{n(),i={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},a={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5},t(r,`calculateDeltaAndAngle`),o=t(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,`pointTransformer`),s=t(e=>({x:t(function(t,n,a){let s=0,c=o(a[0]).x<o(a[a.length-1]).x?`left`:`right`;if(n===0&&Object.hasOwn(i,e.arrowTypeStart)){let{angle:t,deltaX:n}=r(a[0],a[1]);s=i[e.arrowTypeStart]*Math.cos(t)*(n>=0?1:-1)}else if(n===a.length-1&&Object.hasOwn(i,e.arrowTypeEnd)){let{angle:t,deltaX:n}=r(a[a.length-1],a[a.length-2]);s=i[e.arrowTypeEnd]*Math.cos(t)*(n>=0?1:-1)}let l=Math.abs(o(t).x-o(a[a.length-1]).x),u=Math.abs(o(t).y-o(a[a.length-1]).y),d=Math.abs(o(t).x-o(a[0]).x),f=Math.abs(o(t).y-o(a[0]).y),p=i[e.arrowTypeStart],m=i[e.arrowTypeEnd];if(l<m&&l>0&&u<m){let e=m+1-l;e*=c===`right`?-1:1,s-=e}if(d<p&&d>0&&f<p){let e=p+1-d;e*=c===`right`?-1:1,s+=e}return o(t).x+s},`x`),y:t(function(t,n,a){let s=0,c=o(a[0]).y<o(a[a.length-1]).y?`down`:`up`;if(n===0&&Object.hasOwn(i,e.arrowTypeStart)){let{angle:t,deltaY:n}=r(a[0],a[1]);s=i[e.arrowTypeStart]*Math.abs(Math.sin(t))*(n>=0?1:-1)}else if(n===a.length-1&&Object.hasOwn(i,e.arrowTypeEnd)){let{angle:t,deltaY:n}=r(a[a.length-1],a[a.length-2]);s=i[e.arrowTypeEnd]*Math.abs(Math.sin(t))*(n>=0?1:-1)}let l=Math.abs(o(t).y-o(a[a.length-1]).y),u=Math.abs(o(t).x-o(a[a.length-1]).x),d=Math.abs(o(t).y-o(a[0]).y),f=Math.abs(o(t).x-o(a[0]).x),p=i[e.arrowTypeStart],m=i[e.arrowTypeEnd];if(l<m&&l>0&&u<m){let e=m+1-l;e*=c===`up`?-1:1,s-=e}if(d<p&&d>0&&f<p){let e=p+1-d;e*=c===`up`?-1:1,s+=e}return o(t).y+s},`y`)}),`getLineFunctionsWithOffset`)}));export{a as i,c as n,i as r,s as t};
//# sourceMappingURL=chunk-HN2XXSSU-C3555Ac7.js.map