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