import{a0 as n,a1 as t,a2 as a,a3 as r,a4 as c,a5 as e,a6 as u,a7 as i,a8 as o,a9 as y,aa as l,ab as f,ac as s,ad as x,ae as p}from"./index-BGVkNnHt.js";function h(n){return n.innerRadius}function v(n){return n.outerRadius}function d(n){return n.startAngle}function g(n){return n.endAngle}function m(n){return n&&n.padAngle}function T(n,t,a,r,c,e,u){var i=n-a,o=t-r,l=(u?e:-e)/y(i*i+o*o),f=l*o,s=-l*i,x=n+f,h=t+s,v=a+f,d=r+s,g=(x+v)/2,m=(h+d)/2,T=v-x,A=d-h,R=T*T+A*A,b=c-e,j=x*d-v*h,P=(A<0?-1:1)*y(p(0,b*b*R-j*j)),k=(j*A-T*P)/R,q=(-j*T-A*P)/R,w=(j*A+T*P)/R,z=(-j*T+A*P)/R,B=k-g,C=q-m,D=w-g,E=z-m;return B*B+C*C>D*D+E*E&&(k=w,q=z),{cx:k,cy:q,x01:-f,y01:-s,x11:k*(c/b-1),y11:q*(c/b-1)}}function A(){var p=h,A=v,R=f(0),b=null,j=d,P=g,k=m,q=null,w=n(z);function z(){var n,f,h=+p.apply(this,arguments),v=+A.apply(this,arguments),d=j.apply(this,arguments)-t,g=P.apply(this,arguments)-t,m=i(g-d),z=g>d;if(q||(q=n=w()),v<h&&(f=v,v=h,h=f),v>a)if(m>r-a)q.moveTo(v*c(d),v*e(d)),q.arc(0,0,v,d,g,!z),h>a&&(q.moveTo(h*c(g),h*e(g)),q.arc(0,0,h,g,d,z));else{var B,C,D=d,E=g,F=d,G=g,H=m,I=m,J=k.apply(this,arguments)/2,K=J>a&&(b?+b.apply(this,arguments):y(h*h+v*v)),L=u(i(v-h)/2,+R.apply(this,arguments)),M=L,N=L;if(K>a){var O=s(K/h*e(J)),Q=s(K/v*e(J));(H-=2*O)>a?(F+=O*=z?1:-1,G-=O):(H=0,F=G=(d+g)/2),(I-=2*Q)>a?(D+=Q*=z?1:-1,E-=Q):(I=0,D=E=(d+g)/2)}var S=v*c(D),U=v*e(D),V=h*c(G),W=h*e(G);if(L>a){var X,Y=v*c(E),Z=v*e(E),$=h*c(F),_=h*e(F);if(m<o)if(X=function(n,t,r,c,e,u,i,o){var y=r-n,l=c-t,f=i-e,s=o-u,x=s*y-f*l;if(!(x*x<a))return[n+(x=(f*(t-u)-s*(n-e))/x)*y,t+x*l]}(S,U,$,_,Y,Z,V,W)){var nn=S-X[0],tn=U-X[1],an=Y-X[0],rn=Z-X[1],cn=1/e(x((nn*an+tn*rn)/(y(nn*nn+tn*tn)*y(an*an+rn*rn)))/2),en=y(X[0]*X[0]+X[1]*X[1]);M=u(L,(h-en)/(cn-1)),N=u(L,(v-en)/(cn+1))}else M=N=0}I>a?N>a?(B=T($,_,S,U,v,N,z),C=T(Y,Z,V,W,v,N,z),q.moveTo(B.cx+B.x01,B.cy+B.y01),N<L?q.arc(B.cx,B.cy,N,l(B.y01,B.x01),l(C.y01,C.x01),!z):(q.arc(B.cx,B.cy,N,l(B.y01,B.x01),l(B.y11,B.x11),!z),q.arc(0,0,v,l(B.cy+B.y11,B.cx+B.x11),l(C.cy+C.y11,C.cx+C.x11),!z),q.arc(C.cx,C.cy,N,l(C.y11,C.x11),l(C.y01,C.x01),!z))):(q.moveTo(S,U),q.arc(0,0,v,D,E,!z)):q.moveTo(S,U),h>a&&H>a?M>a?(B=T(V,W,Y,Z,h,-M,z),C=T(S,U,$,_,h,-M,z),q.lineTo(B.cx+B.x01,B.cy+B.y01),M<L?q.arc(B.cx,B.cy,M,l(B.y01,B.x01),l(C.y01,C.x01),!z):(q.arc(B.cx,B.cy,M,l(B.y01,B.x01),l(B.y11,B.x11),!z),q.arc(0,0,h,l(B.cy+B.y11,B.cx+B.x11),l(C.cy+C.y11,C.cx+C.x11),z),q.arc(C.cx,C.cy,M,l(C.y11,C.x11),l(C.y01,C.x01),!z))):q.arc(0,0,h,G,F,z):q.lineTo(V,W)}else q.moveTo(0,0);if(q.closePath(),n)return q=null,n+""||null}return z.centroid=function(){var n=(+p.apply(this,arguments)+ +A.apply(this,arguments))/2,t=(+j.apply(this,arguments)+ +P.apply(this,arguments))/2-o/2;return[c(t)*n,e(t)*n]},z.innerRadius=function(n){return arguments.length?(p="function"==typeof n?n:f(+n),z):p},z.outerRadius=function(n){return arguments.length?(A="function"==typeof n?n:f(+n),z):A},z.cornerRadius=function(n){return arguments.length?(R="function"==typeof n?n:f(+n),z):R},z.padRadius=function(n){return arguments.length?(b=null==n?null:"function"==typeof n?n:f(+n),z):b},z.startAngle=function(n){return arguments.length?(j="function"==typeof n?n:f(+n),z):j},z.endAngle=function(n){return arguments.length?(P="function"==typeof n?n:f(+n),z):P},z.padAngle=function(n){return arguments.length?(k="function"==typeof n?n:f(+n),z):k},z.context=function(n){return arguments.length?(q=null==n?null:n,z):q},z}export{A as d};
