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