const c=Math.PI,y=2*c,u=1e-6,q=y-u;function E($){this._+=$[0];for(let t=1,h=$.length;t=0))throw new Error(`invalid digits: ${$}`);if(t>15)return E;const h=10**t;return function(i){this._+=i[0];for(let s=1,e=i.length;su)if(!(Math.abs(o*l-p*_)>u)||!e)this._append`L${this._x1=t},${this._y1=h}`;else{let r=i-a,M=s-d,v=l*l+p*p,m=r*r+M*M,b=Math.sqrt(v),T=Math.sqrt(n),w=e*Math.tan((c-Math.acos((v+n-m)/(2*b*T)))/2),x=w/T,A=w/b;Math.abs(x-1)>u&&this._append`L${t+x*_},${h+x*o}`,this._append`A${e},${e},0,0,${+(o*r>_*M)},${this._x1=t+A*l},${this._y1=h+A*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 d=i*Math.cos(s),l=i*Math.sin(s),p=t+d,_=h+l,o=1^a,n=a?s-e:e-s;if(this._x1===null?this._append`M${p},${_}`:(Math.abs(this._x1-p)>u||Math.abs(this._y1-_)>u)&&this._append`L${p},${_}`,!i)return;n<0&&(n=n%y+y),n>q?this._append`A${i},${i},0,1,${o},${t-d},${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 L(){return new f}L.prototype=f.prototype;function P($=3){return new f(+$)}export{f as Path,L as path,P as pathRound};export default null;