import{M as fn,N as an,O as g,P as tn,Q as X,R as I,S as _,T as rn,V as N,W as un,X as $,Y as l,Z as sn,$ as ln,a0 as on}from"./NewEditor-J5bBywjE.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[o]="ffaafe68-f915-48a6-a596-8a7bec7a5a31",s._sentryDebugIdIdentifier="sentry-dbid-ffaafe68-f915-48a6-a596-8a7bec7a5a31")}catch{}})();function cn(s){return s.innerRadius}function yn(s){return s.outerRadius}function gn(s){return s.startAngle}function dn(s){return s.endAngle}function pn(s){return s&&s.padAngle}function mn(s,o,D,P,v,R,Q,a){var O=D-s,i=P-o,n=Q-v,p=a-R,r=p*O-n*i;if(!(r*r<g))return r=(n*(o-R)-p*(s-v))/r,[s+r*O,o+r*i]}function F(s,o,D,P,v,R,Q){var a=s-D,O=o-P,i=(Q?R:-R)/$(a*a+O*O),n=i*O,p=-i*a,r=s+n,f=o+p,c=D+n,y=P+p,V=(r+c)/2,t=(f+y)/2,m=c-r,d=y-f,A=m*m+d*d,T=v-R,b=r*y-c*f,S=(d<0?-1:1)*$(on(0,T*T*A-b*b)),q=(b*d-m*S)/A,M=(-b*m-d*S)/A,w=(b*d+m*S)/A,x=(-b*m+d*S)/A,h=q-V,e=M-t,u=w-V,W=x-t;return h*h+e*e>u*u+W*W&&(q=w,M=x),{cx:q,cy:M,x01:-n,y01:-p,x11:q*(v/T-1),y11:M*(v/T-1)}}function hn(){var s=cn,o=yn,D=N(0),P=null,v=gn,R=dn,Q=pn,a=null,O=fn(i);function i(){var n,p,r=+s.apply(this,arguments),f=+o.apply(this,arguments),c=v.apply(this,arguments)-an,y=R.apply(this,arguments)-an,V=rn(y-c),t=y>c;if(a||(a=n=O()),f<r&&(p=f,f=r,r=p),!(f>g))a.moveTo(0,0);else if(V>tn-g)a.moveTo(f*X(c),f*I(c)),a.arc(0,0,f,c,y,!t),r>g&&(a.moveTo(r*X(y),r*I(y)),a.arc(0,0,r,y,c,t));else{var m=c,d=y,A=c,T=y,b=V,S=V,q=Q.apply(this,arguments)/2,M=q>g&&(P?+P.apply(this,arguments):$(r*r+f*f)),w=_(rn(f-r)/2,+D.apply(this,arguments)),x=w,h=w,e,u;if(M>g){var W=sn(M/r*I(q)),j=sn(M/f*I(q));(b-=W*2)>g?(W*=t?1:-1,A+=W,T-=W):(b=0,A=T=(c+y)/2),(S-=j*2)>g?(j*=t?1:-1,m+=j,d-=j):(S=0,m=d=(c+y)/2)}var Y=f*X(m),Z=f*I(m),k=r*X(T),z=r*I(T);if(w>g){var B=f*X(d),C=f*I(d),G=r*X(A),H=r*I(A),E;if(V<un)if(E=mn(Y,Z,G,H,B,C,k,z)){var J=Y-E[0],K=Z-E[1],L=B-E[0],U=C-E[1],nn=1/I(ln((J*L+K*U)/($(J*J+K*K)*$(L*L+U*U)))/2),en=$(E[0]*E[0]+E[1]*E[1]);x=_(w,(r-en)/(nn-1)),h=_(w,(f-en)/(nn+1))}else x=h=0}S>g?h>g?(e=F(G,H,Y,Z,f,h,t),u=F(B,C,k,z,f,h,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),h<w?a.arc(e.cx,e.cy,h,l(e.y01,e.x01),l(u.y01,u.x01),!t):(a.arc(e.cx,e.cy,h,l(e.y01,e.x01),l(e.y11,e.x11),!t),a.arc(0,0,f,l(e.cy+e.y11,e.cx+e.x11),l(u.cy+u.y11,u.cx+u.x11),!t),a.arc(u.cx,u.cy,h,l(u.y11,u.x11),l(u.y01,u.x01),!t))):(a.moveTo(Y,Z),a.arc(0,0,f,m,d,!t)):a.moveTo(Y,Z),!(r>g)||!(b>g)?a.lineTo(k,z):x>g?(e=F(k,z,B,C,r,-x,t),u=F(Y,Z,G,H,r,-x,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,l(e.y01,e.x01),l(u.y01,u.x01),!t):(a.arc(e.cx,e.cy,x,l(e.y01,e.x01),l(e.y11,e.x11),!t),a.arc(0,0,r,l(e.cy+e.y11,e.cx+e.x11),l(u.cy+u.y11,u.cx+u.x11),t),a.arc(u.cx,u.cy,x,l(u.y11,u.x11),l(u.y01,u.x01),!t))):a.arc(0,0,r,T,A,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+s.apply(this,arguments)+ +o.apply(this,arguments))/2,p=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[X(p)*n,I(p)*n]},i.innerRadius=function(n){return arguments.length?(s=typeof n=="function"?n:N(+n),i):s},i.outerRadius=function(n){return arguments.length?(o=typeof n=="function"?n:N(+n),i):o},i.cornerRadius=function(n){return arguments.length?(D=typeof n=="function"?n:N(+n),i):D},i.padRadius=function(n){return arguments.length?(P=n==null?null:typeof n=="function"?n:N(+n),i):P},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:N(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:N(+n),i):R},i.padAngle=function(n){return arguments.length?(Q=typeof n=="function"?n:N(+n),i):Q},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
//# sourceMappingURL=arc-CVu8304O.js.map
