/**
 * Copyright (c) 2022 Visa, Inc.
 *
 * This source code is licensed under the MIT license
 * https://github.com/visa/visa-chart-components/blob/master/LICENSE
 *
 **/
var t=Math.PI,i=2*t,h=1e-6,s=i-h;function n(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function r(){return new n}function a(t){return function(){return t}}n.prototype=r.prototype={constructor:n,moveTo:function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},quadraticCurveTo:function(t,i,h,s){this._+="Q"+ +t+","+ +i+","+(this._x1=+h)+","+(this._y1=+s)},bezierCurveTo:function(t,i,h,s,n,r){this._+="C"+ +t+","+ +i+","+ +h+","+ +s+","+(this._x1=+n)+","+(this._y1=+r)},arcTo:function(i,s,n,r,a){var o=this._x1,u=this._y1,e=(n=+n)-(i=+i),c=(r=+r)-(s=+s),f=o-i,M=u-s,l=f*f+M*M;if((a=+a)<0)throw new Error("negative radius: "+a);if(null===this._x1)this._+="M"+(this._x1=i)+","+(this._y1=s);else if(l>h)if(Math.abs(M*e-c*f)>h&&a){var v=n-o,w=r-u,T=e*e+c*c,A=v*v+w*w,L=Math.sqrt(T),d=Math.sqrt(l),g=a*Math.tan((t-Math.acos((T+l-A)/(2*L*d)))/2),C=g/d,p=g/L;Math.abs(C-1)>h&&(this._+="L"+(i+C*f)+","+(s+C*M)),this._+="A"+a+","+a+",0,0,"+ +(M*v>f*w)+","+(this._x1=i+p*e)+","+(this._y1=s+p*c)}else this._+="L"+(this._x1=i)+","+(this._y1=s)},arc:function(n,r,a,o,u,e){n=+n,r=+r,e=!!e;var c=(a=+a)*Math.cos(o),f=a*Math.sin(o),M=n+c,l=r+f,v=1^e,w=e?o-u:u-o;if(a<0)throw new Error("negative radius: "+a);null===this._x1?this._+="M"+M+","+l:(Math.abs(this._x1-M)>h||Math.abs(this._y1-l)>h)&&(this._+="L"+M+","+l),a&&(w<0&&(w=w%i+i),w>s?this._+="A"+a+","+a+",0,1,"+v+","+(n-c)+","+(r-f)+"A"+a+","+a+",0,1,"+v+","+(this._x1=M)+","+(this._y1=l):w>h&&(this._+="A"+a+","+a+",0,"+ +(w>=t)+","+v+","+(this._x1=n+a*Math.cos(u))+","+(this._y1=r+a*Math.sin(u))))},rect:function(t,i,h,s){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +h+"v"+ +s+"h"+-h+"Z"},toString:function(){return this._}};export{a as c,r as p}