},cubicCurveTo:function(){vare=c.read(arguments),i=c.read(arguments),n=c.read(arguments),r=t(this);r.setHandleOut(e.subtract(r._point)),this._add([newT(n,i.subtract(n))])},quadraticCurveTo:function(){vare=c.read(arguments),i=c.read(arguments),n=t(this)._point;this.cubicCurveTo(e.add(n.subtract(e).multiply(1/3)),e.add(i.subtract(e).multiply(1/3)),i)},curveTo:function(){vare=c.read(arguments),i=c.read(arguments),n=r.pick(r.read(arguments),.5),s=1-n,a=t(this)._point,o=e.subtract(a.multiply(s*s)).subtract(i.multiply(n*n)).divide(2*n*s);if(o.isNaN())thrownewError("Cannot put a curve through points with parameter = "+n);this.quadraticCurveTo(o,i)},arcTo:function(){vare,i,n,s,a,o=Math.abs,h=Math.sqrt,l=t(this),f=l._point,_=c.read(arguments),g=r.peek(arguments),v=r.pick(g,!0);if("boolean"==typeofv)vary=f.add(_).divide(2),e=y.add(y.subtract(f).rotate(v?-90:90));elseif(r.remain(arguments)<=2)e=_,_=c.read(arguments);elseif(!f.equals(_)){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),O=o(w.height),z=M*M,k=O*O,A=P*P,L=I*I,N=h(A/z+L/k);if(N>1&&(M*=N,O*=N,z=M*M,k=O*O),N=(z*k-z*L-k*A)/(z*L+k*A),o(N)<1e-12&&(N=0),N<0)thrownewError("Cannot create an arc with the given arguments");i=newc(M*I/O,-O*P/M).multiply((S===v?-1:1)*h(N)).rotate(b).add(y),a=(newp).translate(i).rotate(b).scale(M,O),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)),j=newm(f,_),F=j.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));varD=j.getSide(i,!0);0===D?n=F*o(n):F===D&&(n+=n<0?360:-360)}if(n){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++)z._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;
},toString:function(){for(vart=this._properties,e=[],i="gradient"===this._type,n=h.instance,r=0,s=t.length;r<s;r++){vara=this._components[r];null!=a&&e.push(t[r]+": "+(i?a:n.number(a)))}returnnull!=this._alpha&&e.push("alpha: "+n.number(this._alpha)),"{ "+e.join(", ")+" }"},toCSS:function(t){functione(t){returnMath.round(255*(t<0?0:t>1?1:t))}vari=this._convert("rgb"),n=t||null==this._alpha?1:this._alpha;returni=[e(i[0]),e(i[1]),e(i[2])],n<1&&i.push(n<0?0:n),t?"#"+((1<<24)+(i[0]<<16)+(i[1]<<8)+i[2]).toString(16).slice(1):(4==i.length?"rgba(":"rgb(")+i.join(",")+")"},toCanvasStyle:function(t,e){if(this._canvasStyle)returnthis._canvasStyle;if("gradient"!==this._type)returnthis._canvasStyle=this.toCSS();vari,n=this._components,r=n[0],s=r._stops,a=n[1],o=n[2],h=n[3],u=e&&e.inverted();if(u&&(a=u._transformPoint(a),o=u._transformPoint(o),h&&(h=u._transformPoint(h))),r._radial){varl=o.getDistance(a);if(h){varc=h.subtract(a);c.getLength()>l&&(h=a.add(c.normalize(l-.1)))}varf=h||a;i=t.createRadialGradient(f.x,f.y,0,a.x,a.y,l)}elsei=t.createLinearGradient(a.x,a.y,o.x,o.y);for(vard=0,_=s.length;d<_;d++){varg=s[d],v=g._offset;i.addColorStop(null==v?d/(_-1):v,g._color.toCanvasStyle())}returnthis._canvasStyle=i},transform:function(t){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;returnnewD(t(),t(),t())},_setOwner:function(t,e,i){returnt&&(t._owner&&e&&t._owner!==e&&(t=t.clone()),!t._owner^!e&&(t._owner=e||null,t._setter=i||null)),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=D.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]);returnnewD(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(129)},getOffset:function(){returnthis._offset},setOffset:function(t){this._offset=t,this._changed()},getRampPoint:"#getOffset",setRampPoint:"#setOffset",getColo