_=c.read(arguments);else{varw=d.read(arguments),x=u.isZero;if(x(w.width)||x(w.height))returnthis.lineTo(_);varb=r.read(arguments),v=!!r.read(arguments),S=!!r.read(arguments),y=f.add(_).divide(2),C=f.subtract(y).rotate(-b),P=C.x,I=C.y,M=o(w.width),z=o(w.height),k=M*M,O=z*z,A=P*P,L=I*I,N=h(A/k+L/O);if(N>1&&(M*=N,z*=N,k=M*M,O=z*z),N=(k*O-k*L-O*A)/(k*L+O*A),o(N)<1e-12&&(N=0),N<0)thrownewError("Cannot create an arc with the given arguments");i=newc(M*I/z,-z*P/M).multiply((S===v?-1:1)*h(N)).rotate(b).add(y),a=(newp).translate(i).rotate(b).scale(M,z),s=a._inverseTransform(f),n=s.getDirectedAngle(a._inverseTransform(_)),!v&&n>0?n-=360:v&&n<0&&(n+=360)}if(e){varB=newm(f.add(e).divide(2),e.subtract(f).rotate(90),(!0)),E=newm(e.add(_).divide(2),_.subtract(e).rotate(90),(!0)),D=newm(f,_),F=D.getSide(e);if(i=B.intersect(E,!0),!i){if(!F)returnthis.lineTo(_);thrownewError("Cannot create an arc with the given arguments")}s=f.subtract(i),n=s.getDirectedAngle(_.subtract(i));varj=D.getSide(i,!0);0===j?n=F*o(n):F===j&&(n+=n<0?360:-360)}for(varR=1e-7,q=o(n),V=q>=360?4:Math.ceil((q-R)/90),H=n/V,Z=H*Math.PI/360,U=4/3*Math.sin(Z)/(1+Math.cos(Z)),W=[],G=0;G<=V;G++){varC=_,J=null;if(G<V&&(J=s.rotate(90).multiply(U),a?(C=a._transformPoint(s),J=a._transformPoint(s.add(J)).subtract(C)):C=i.add(s)),G){var$=s.rotate(-90).multiply(U);a&&($=a._transformPoint(s.add($)).subtract(C)),W.push(newT(C,$,J))}elsel.setHandleOut(J);s=s.rotate(H)}this._add(W)},lineBy:function(){vare=c.read(arguments),i=t(this)._point;this.lineTo(i.add(e))},curveBy:function(){vare=c.read(arguments),i=c.read(arguments),n=r.read(arguments),s=t(this)._point;this.curveTo(s.add(e),s.add(i),n)},cubicCurveBy:function(){vare=c.read(arguments),i=c.read(arguments),n=c.read(arguments),r=t(this)._point;this.cubicCurveTo(r.add(e),r.add(i),r.add(n))},quadraticCurveBy:function(){vare=c.read(arguments),i=c.read(arguments),n=t(this)._point;this.quadraticCurveTo(n.add(e),n.add(i))},arcBy:function(){vare=t(this)._point,i=e.add(c.read(arguments)),n=r.pick(r.peek(arguments),!0);"boolean"==typeofn?this.arcTo(i,n):this.arcTo(i,e.add(c.read(arguments)))},closePath:function(t){this.setClosed(!0),this.join(this,t)}}},{_getBounds:function(t,e){vari=e.handle?"getHandleBounds":e.stroke?"getStrokeBounds":"getBounds";returnL[i](this._segments,this._closed,this,t,e)},statics:{getBounds:function(t,e,i,n,r,s){functiona(t){t._transformCoordinates(n,h);for(vare=0;e<2;e++)k._addBounds(u[e],u[e+4],h[e+2],h[e],e,s?s[e]:0,l,c,f);vari=u;u=h,h=i}varo=t[0];if(!o)returnnewg;for(varh=newArray(6),u=o._transformCoordinates(n,newArray(6)),l=u.slice(0,2),c=l.slice(),f=newArray(2),d=1,_=t.length;d<_;d++)a(t[d]);returne&&a(o),newg(l[0],l[1],c[0]-l[0],c[1]-l[1])},getStrokeBounds:function(t,e,i,n,r){functions(t){v=v.include(t)}functiona(t){v=v.unite(x.setCenter(t._point.transform(n)))}functiono(t,e){"round"===e||t.isSmooth()?a(t):L._addBevelJoin(t,e,p,w,n,f,s)}functionh(t,e){"round"===e?a(t):L._addSquareCap(t,e,p,n,f,s)}varu=i.getStyle(),l=u.hasStroke(),c=u.getStrokeWidth(),f=l&&i._getStrokeMatrix(n,r),_=l&&L._getStrokePadding(c,f),v=L.getBounds(t,e,i,n,r,_);if(!l)returnv;for(varp=c/2,m=u.getStrokeJoin(),y=u.getStrokeCap(),w=u.getMiterLimit(),x=newg(newd(_)),b=t.length-(e?0:1),S=1;S<b;S++)o(t[S],m);returne?o(t[0],m):b>0&&(h(t[0],y),h(t[t.length-1],y)),v},_getStrokePadding:function(t,e){if(!e)return[t,t];vari=newc(t,0).transform(e),n=newc(0,t).transform(e),r=i.getAngleInRadians(),s=i.getLength(),a=n.getLength(),o=Math.sin(r),h=Math.cos(r),u=Math.tan(r),l=Math.atan2(a*u,s),f=Math.atan2(a,u*s);return[Math.abs(s*Math.cos(l)*h+a*Math.sin(l)*o),Math.abs(a*Math.sin(f)*h+s*Math.cos(f)*o)]},_addBevelJoin:function(t,e,i,n,r,s,a,o){varh=t.getCurve(),u=h.getPrevious(),l=h.getPoint1().transform(r),f=u.getNormalAtTime(1).multiply(i).transform(s),d=h.getNormalAtTime(0).multiply(i).transform(s);if(f.getDirectedAngle(d)<0&&(f=f.negate(),d=d.negate()),o&&a(l),a(l.add(f)),"miter"===e){var_=newm(l.add(f),newc((-f.y),f.x),(!0)).intersect(newm(l.add(d),newc((-d.y),d.x),(!0)),!0);_&&l.getDistance(
if("gradient"===this._type){for(vare=this._components,i=1,n=e.length;i<n;i++){varr=e[i];t._transformPoint(r,r,!0)}this._changed()}},statics:{_types:n,random:function(){vart=Math.random;returnnewj(t(),t(),t())}}})},newfunction(){vart={add:function(t,e){returnt+e},subtract:function(t,e){returnt-e},multiply:function(t,e){returnt*e},divide:function(t,e){returnt/e}};returnr.each(t,function(t,e){this[e]=function(e){e=j.read(arguments);for(vari=this._type,n=this._components,r=e._convert(i),s=0,a=n.length;s<a;s++)r[s]=t(n[s],r[s]);returnnewj(i,r,null!=this._alpha?t(this._alpha,e.getAlpha()):null)}},{})}),R=r.extend({_class:"Gradient",initialize:function(t,e){this._id=l.get(),t&&r.isPlainObject(t)&&(this.set(t),t=e=null),null==this._stops&&this.setStops(t||["white","black"]),null==this._radial&&this.setRadial("string"==typeofe&&"radial"===e||e||!1)},_serialize:function(t,e){returne.add(this,function(){returnr.serialize([this._stops,this._radial],t,!0,e)})},_changed:function(){for(vart=0,e=this._owners&&this._owners.length;t<e;t++)this._owners[t]._changed()},_addOwner:function(t){this._owners||(this._owners=[]),this._owners.push(t)},_removeOwner:function(t){vari=this._owners?this._owners.indexOf(t):-1;i!=-1&&(this._owners.splice(i,1),this._owners.length||(this._owners=e))},clone:function(){for(vart=[],e=0,i=this._stops.length;e<i;e++)t[e]=this._stops[e].clone();returnnewR(t,this._radial)},getStops:function(){returnthis._stops},setStops:function(t){if(t.length<2)thrownewError("Gradient stop list needs to contain at least two stops.");vari=this._stops;if(i)for(varn=0,r=i.length;n<r;n++)i[n]._owner=e;i=this._stops=q.readList(t,0,{clone:!0});for(varn=0,r=i.length;n<r;n++)i[n]._owner=this;this._changed()},getRadial:function(){returnthis._radial},setRadial:function(t){this._radial=t,this._changed()},equals:function(t){if(t===this)return!0;if(t&&this._class===t._class){vare=this._stops,i=t._stops,n=e.length;if(n===i.length){for(varr=0;r<n;r++)if(!e[r].equals(i[r]))return!1;return!0}}return!1}}),q=r.extend({_class:"GradientStop",initialize:function(t,i){varn=t,r=i;"object"==typeoft&&i===e&&(Array.isArray(t)&&"number"!=typeoft[0]?(n=t[0],r=t[1]):("color"int||"offset"int||"rampPoint"int)&&(n=t.color,r=t.offset||t.rampPoint||0)),this.setColor(n),this.setOffset(r)},clone:function(){returnnewq(this._color.clone(),this._offset)},_serialize:function(t,e){vari=this._color,n=this._offset;returnr.serialize(null==n?[i]:[i,n],t,!0,e)},_changed:function(){this._owner&&this._owner._changed(65)},getOffset:function(){returnthis._offset},setOffset:function(t){this._offset=t,this._changed()},getRampPoint:"#getOffset",setRampPoint:"#setOffset",getColor:function(){returnthis._color},setColor:function(){vart=j.read(arguments,0,{clone:!0});t&&(t._owner=this),this._color=t,this._changed()},equals:function(t){returnt===this||t&&this._class===t._class&&this._color.equals(t._color)&&this._offset==t._offset||!1}}),V=r.extend(newfunction(){vart={fillColor:null,fillRule:"nonzero",strokeColor:null,strokeWidth:1,strokeCap:"butt",strokeJoin:"miter",strokeScaling:!0,miterLimit:10,dashOffset:0,dashArray:[],shadowColor:null,shadowBlur:0,shadowOffset:newc,selectedColor:null},i=r.set({},t,{fontFamily:"sans-serif",fontWeight:"normal",fontSize:12,leading:null,justification:"left"}),n=r.set({},i,{fillColor:newj}),s={strokeWidth:97,strokeCap:97,strokeJoin:97,strokeScaling:105,miterLimit:97,fontFamily:9,fontWeight:9,fontSize:9,font:9,leading:9,justification:9},a={beans:!0},o={_class:"Style",beans:!0,initialize:function(e,r,s){this._values={},this._owner=r,this._project=r&&r._project||s||nt.project,this._defaults=!r||rinstanceofx?i:rinstanceofD?n:t,e&&this.set(e)}};returnr.each(i,function(t,i){varn=/Color$/.test(i),h="shadowOffset"===i,u=r.capitalize(i),l=s[i],f="set"+u,d="get"+u;o[f]=function(t){varr=this._owner,s=r&&r._children;if(s&&s.length>0&&!(rinstanceofN))for(vara=0,o=s.length;a<o;a++)s[a]._style[f](t);elseif(iinthis._defaults){varh=this._values[i];h!==t&&(n&&(h&&h._owner!==e&&(h._owner=e,h._canvasStyle=null)