/* esm.sh - d3-path@3.1.0 */
var c=Math.PI,y=2*c,u=1e-6,q=y-u;function A($){this._+=$[0];for(let t=1,h=$.length;t<h;++t)this._+=arguments[t]+$[t]}function C($){let t=Math.floor($);if(!(t>=0))throw new Error(`invalid digits: ${$}`);if(t>15)return A;let h=10**t;return function(i){this._+=i[0];for(let s=1,e=i.length;s<e;++s)this._+=Math.round(arguments[s]*h)/h+i[s]}}var d=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?A:C(t)}moveTo(t,h){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+h}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,h){this._append`L${this._x1=+t},${this._y1=+h}`}quadraticCurveTo(t,h,i,s){this._append`Q${+t},${+h},${this._x1=+i},${this._y1=+s}`}bezierCurveTo(t,h,i,s,e,a){this._append`C${+t},${+h},${+i},${+s},${this._x1=+e},${this._y1=+a}`}arcTo(t,h,i,s,e){if(t=+t,h=+h,i=+i,s=+s,e=+e,e<0)throw new Error(`negative radius: ${e}`);let a=this._x1,r=this._y1,l=i-t,p=s-h,_=a-t,o=r-h,n=_*_+o*o;if(this._x1===null)this._append`M${this._x1=t},${this._y1=h}`;else if(n>u)if(!(Math.abs(o*l-p*_)>u)||!e)this._append`L${this._x1=t},${this._y1=h}`;else{let f=i-a,M=s-r,v=l*l+p*p,L=f*f+M*M,b=Math.sqrt(v),T=Math.sqrt(n),m=e*Math.tan((c-Math.acos((v+n-L)/(2*b*T)))/2),x=m/T,w=m/b;Math.abs(x-1)>u&&this._append`L${t+x*_},${h+x*o}`,this._append`A${e},${e},0,0,${+(o*f>_*M)},${this._x1=t+w*l},${this._y1=h+w*p}`}}arc(t,h,i,s,e,a){if(t=+t,h=+h,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let r=i*Math.cos(s),l=i*Math.sin(s),p=t+r,_=h+l,o=1^a,n=a?s-e:e-s;this._x1===null?this._append`M${p},${_}`:(Math.abs(this._x1-p)>u||Math.abs(this._y1-_)>u)&&this._append`L${p},${_}`,i&&(n<0&&(n=n%y+y),n>q?this._append`A${i},${i},0,1,${o},${t-r},${h-l}A${i},${i},0,1,${o},${this._x1=p},${this._y1=_}`:n>u&&this._append`A${i},${i},0,${+(n>=c)},${o},${this._x1=t+i*Math.cos(e)},${this._y1=h+i*Math.sin(e)}`)}rect(t,h,i,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+h}h${i=+i}v${+s}h${-i}Z`}toString(){return this._}};function E(){return new d}E.prototype=d.prototype;function R($=3){return new d(+$)}export{d as Path,E as path,R as pathRound};
//# sourceMappingURL=d3-path.mjs.map