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