import{w as ln,c as k}from"./path.53f90ab3.js";import{b0 as an,b1 as F,b2 as w,b3 as rn,b4 as y,ak as on,b5 as J,b6 as _,b7 as un,b8 as t,b9 as sn,ba as tn,bb as fn}from"./entry.17d1cd3e.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function mn(l){return l.endAngle}function pn(l){return l&&l.padAngle}function dn(l,h,E,q,v,A,z,a){var I=E-l,i=q-h,n=z-v,m=a-A,r=m*I-n*i;if(!(r*r<y))return r=(n*(h-A)-m*(l-v))/r,[l+r*I,h+r*i]}function U(l,h,E,q,v,A,z){var a=l-E,I=h-q,i=(z?A:-A)/J(a*a+I*I),n=i*I,m=-i*a,r=l+n,s=h+m,f=E+n,c=q+m,B=(r+f)/2,o=(s+c)/2,p=f-r,g=c-s,R=p*p+g*g,b=v-A,T=r*c-f*s,O=(g<0?-1:1)*J(fn(0,b*b*R-T*T)),S=(T*g-p*O)/R,j=(-T*p-g*O)/R,P=(T*g+p*O)/R,d=(-T*p+g*O)/R,x=S-B,e=j-o,u=P-B,C=d-o;return x*x+e*e>u*u+C*C&&(S=P,j=d),{cx:S,cy:j,x01:-n,y01:-m,x11:S*(v/b-1),y11:j*(v/b-1)}}function vn(){var l=cn,h=yn,E=k(0),q=null,v=gn,A=mn,z=pn,a=null,I=ln(i);function i(){var n,m,r=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-rn,c=A.apply(this,arguments)-rn,B=un(c-f),o=c>f;if(a||(a=n=I()),s<r&&(m=s,s=r,r=m),!(s>y))a.moveTo(0,0);else if(B>on-y)a.moveTo(s*F(f),s*w(f)),a.arc(0,0,s,f,c,!o),r>y&&(a.moveTo(r*F(c),r*w(c)),a.arc(0,0,r,c,f,o));else{var p=f,g=c,R=f,b=c,T=B,O=B,S=z.apply(this,arguments)/2,j=S>y&&(q?+q.apply(this,arguments):J(r*r+s*s)),P=_(un(s-r)/2,+E.apply(this,arguments)),d=P,x=P,e,u;if(j>y){var C=sn(j/r*w(S)),K=sn(j/s*w(S));(T-=C*2)>y?(C*=o?1:-1,R+=C,b-=C):(T=0,R=b=(f+c)/2),(O-=K*2)>y?(K*=o?1:-1,p+=K,g-=K):(O=0,p=g=(f+c)/2)}var G=s*F(p),H=s*w(p),L=r*F(b),M=r*w(b);if(P>y){var N=s*F(g),Q=s*w(g),V=r*F(R),W=r*w(R),D;if(B<an)if(D=dn(G,H,V,W,N,Q,L,M)){var X=G-D[0],Y=H-D[1],Z=N-D[0],$=Q-D[1],nn=1/w(tn((X*Z+Y*$)/(J(X*X+Y*Y)*J(Z*Z+$*$)))/2),en=J(D[0]*D[0]+D[1]*D[1]);d=_(P,(r-en)/(nn-1)),x=_(P,(s-en)/(nn+1))}else d=x=0}O>y?x>y?(e=U(V,W,G,H,s,x,o),u=U(N,Q,L,M,s,x,o),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<P?a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),!o),a.arc(u.cx,u.cy,x,t(u.y11,u.x11),t(u.y01,u.x01),!o))):(a.moveTo(G,H),a.arc(0,0,s,p,g,!o)):a.moveTo(G,H),!(r>y)||!(T>y)?a.lineTo(L,M):d>y?(e=U(L,M,N,Q,r,-d,o),u=U(G,H,V,W,r,-d,o),a.lineTo(e.cx+e.x01,e.cy+e.y01),d<P?a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,r,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),o),a.arc(u.cx,u.cy,d,t(u.y11,u.x11),t(u.y01,u.x01),!o))):a.arc(0,0,r,b,R,o)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[F(m)*n,w(m)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:k(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:k(+n),i):h},i.cornerRadius=function(n){return arguments.length?(E=typeof n=="function"?n:k(+n),i):E},i.padRadius=function(n){return arguments.length?(q=n==null?null:typeof n=="function"?n:k(+n),i):q},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:k(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:k(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:k(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{vn as a};
