forked from Icehawk78/FrozenCookies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jcanvas.min.js
68 lines (68 loc) · 31.2 KB
/
jcanvas.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
jCanvas v14.03.01
Copyright 2014 Caleb Evans
Released under the MIT license
*/
(function(e,ta,ua,Ta,da,fa,na,v,x,h,p){function I(d){var c;if(P.future.inheritance)for(c in d)d.hasOwnProperty(c)&&(this[c]=d[c]);else $(this,d)}function P(d){var c;if(d)$(aa,d);else for(c in aa)aa.hasOwnProperty(c)&&delete aa[c];na&&na.warn&&!va.jCanvas&&(va.jCanvas=v,na.warn("The jCanvas() method has been deprecated and will be removed in a future release."));return this}function wa(){}function ka(d){return"string"===ba(d)}function L(d){return d&&d.getContext?d.getContext("2d"):h}function la(d){d=
$({},d);d.masks=d.masks.slice(0);return d}function ga(d,c){var a;d.save();a=la(c.transforms);c.savedTransforms.push(a)}function xa(d,c,a,b){a[b]&&(ea(a[b])?c[b]=a[b].call(d,a):c[b]=a[b])}function U(d,c,a){xa(d,c,a,"fillStyle");xa(d,c,a,"strokeStyle");c.lineWidth=a.strokeWidth;a.rounded?c.lineCap=c.lineJoin="round":(c.lineCap=a.strokeCap,c.lineJoin=a.strokeJoin,c.miterLimit=a.miterLimit);c.shadowOffsetX=a.shadowX;c.shadowOffsetY=a.shadowY;c.shadowBlur=a.shadowBlur;c.shadowColor=a.shadowColor;c.globalAlpha=
a.opacity;c.globalCompositeOperation=a.compositing;a.imageSmoothing&&(c.webkitImageSmoothingEnabled=c.mozImageSmoothingEnabled=a.imageSmoothing)}function ya(d,c,a){a.mask&&(a.autosave&&ga(d,c),d.clip(),c.transforms.masks.push(a._args))}function Y(d,c,a){a.closed&&c.closePath();a.shadowStroke&&0!==a.strokeWidth?(c.stroke(),c.fill(),c.shadowColor="transparent",c.shadowBlur=0,c.stroke()):(c.fill(),"transparent"!==a.fillStyle&&(c.shadowColor="transparent"),0!==a.strokeWidth&&c.stroke());a.closed||c.closePath();
a._transformed&&c.restore();a.mask&&(d=E(d),ya(c,d,a))}function za(d,c,a){c._toRad=c.inDegrees?G/180:1;d.translate(c.x,c.y);d.rotate(c.rotate*c._toRad);d.translate(-c.x,-c.y);a&&(a.rotate+=c.rotate*c._toRad)}function Aa(d,c,a){1!==c.scale&&(c.scaleX=c.scaleY=c.scale);d.translate(c.x,c.y);d.scale(c.scaleX,c.scaleY);d.translate(-c.x,-c.y);a&&(a.scaleX*=c.scaleX,a.scaleY*=c.scaleY)}function Ba(d,c,a){c.translate&&(c.translateX=c.translateY=c.translate);d.translate(c.translateX,c.translateY);a&&(a.translateX+=
c.translateX,a.translateY+=c.translateY)}function T(d,c,a,b,g){a._toRad=a.inDegrees?G/180:1;a._transformed=v;c.save();a.fromCenter||a._centered||b===p||(g===p&&(g=b),a.x+=b/2,a.y+=g/2,a._centered=v);a.rotate&&za(c,a,h);1===a.scale&&1===a.scaleX&&1===a.scaleY||Aa(c,a,h);(a.translate||a.translateX||a.translateY)&&Ba(c,a,h)}function E(d){var c=ca.dataCache,a;c._canvas===d&&c._data?a=c._data:(a=e.data(d,"jCanvas"),a||(a={canvas:d,layers:[],layer:{names:{},groups:{}},eventHooks:{},intersecting:[],lastIntersected:h,
cursor:e(d).css("cursor"),drag:{layer:h,dragging:x},event:{type:h,x:h,y:h},events:{},transforms:la(oa),savedTransforms:[],animating:x,animated:h,pixelRatio:1,scaled:x},e.data(d,"jCanvas",a)),c._canvas=d,c._data=a);return a}function Ca(d,c,a){for(var b in P.events)P.events.hasOwnProperty(b)&&(a[b]||a.cursors&&a.cursors[b])&&Da(d,c,a,b)}function Da(d,c,a,b){window.ontouchstart!==p&&Z.touchEvents[b]&&(b=Z.touchEvents[b]);P.events[b](d,c);a._event=v}function Ea(d,c,a){var b,g,f;if(a.draggable||a.cursors){b=
["mousedown","mousemove","mouseup"];for(f=0;f<b.length;f+=1)g=b[f],Da(d,c,a,g);c.events.mouseoutdrag||(d.bind("mouseout.jCanvas",function(){var a=c.drag.layer;a&&(c.drag={},R(d,c,a,"dragcancel"),d.drawLayers())}),c.events.mouseoutdrag=v);a._event=v}}function pa(d,c,a,b){d=c.layer.names;b?b.name!==p&&ka(a.name)&&a.name!==b.name&&delete d[a.name]:b=a;ka(b.name)&&(d[b.name]=a)}function qa(d,c,a,b){d=c.layer.groups;var g,f,k,e;if(!b)b=a;else if(b.groups!==p&&a.groups!==h)for(f=0;f<a.groups.length;f+=
1)if(g=a.groups[f],c=d[g]){for(e=0;e<c.length;e+=1)if(c[e]===a){k=e;c.splice(e,1);break}0===c.length&&delete d[g]}if(b.groups!==p&&b.groups!==h)for(f=0;f<b.groups.length;f+=1)g=b.groups[f],c=d[g],c||(c=d[g]=[],c.name=g),k===p&&(k=c.length),c.splice(k,0,a)}function ra(d,c,a,b,g){b[a]&&c._running&&!c._running[a]&&(c._running[a]=v,b[a].call(d[0],c,g),c._running[a]=x)}function R(d,c,a,b,g){if(!a.disableEvents){if("mouseout"!==b){var f;a.cursors&&(f=a.cursors[b]);-1!==e.inArray(f,X.cursors)&&(f=X.prefix+
f);f&&d.css({cursor:f})}ra(d,a,b,a,g);ra(d,a,b,c.eventHooks,g);ra(d,a,b,P.eventHooks,g)}}function Q(d,c,a,b){var g,f=c._layer?a:c;c._args=a;if(c.draggable||c.dragGroups)c.layer=v,c.draggable=v;c._method=b?b:c.method?e.fn[c.method]:c.type?e.fn[Z.drawings[c.type]]:function(){};c.layer&&!c._layer&&(a=e(d),b=E(d),g=b.layers,f.name===h||ka(f.name)&&b.layer.names[f.name]===p)&&(f=new I(c),f.canvas=d,f.$canvas=e(d),f.layer=v,f._layer=v,f._running={},f.data=f.data!==h?$({},f.data):{},f.groups=f.groups!==
h?f.groups.slice(0):[],pa(a,b,f),qa(a,b,f),Ca(a,b,f),Ea(a,b,f),c._event=f._event,f._method===e.fn.drawText&&a.measureText(f),f.index===h&&(f.index=g.length),g.splice(f.index,0,f),c._args=f,R(a,b,f,"add"));return f}function Fa(d,c){var a,b;for(b=0;b<X.props.length;b+=1)a=X.props[b],d[a]!==p&&(d["_"+a]=d[a],X.propsObj[a]=v,c&&delete d[a])}function Ua(d,c,a){var b,g,f,k;for(b in a)if(a.hasOwnProperty(b)&&(g=a[b],ea(g)&&(a[b]=g.call(d,c,b)),"object"===ba(g))){for(f in g)g.hasOwnProperty(f)&&(k=g[f],c[b]!==
p&&(c[b+"."+f]=c[b][f],a[b+"."+f]=k));delete a[b]}return a}function Ga(d){var c,a,b=[],g=1;d.match(/^([a-z]+|#[0-9a-f]+)$/gi)&&("transparent"===d&&(d="rgba(0,0,0,0)"),a=ta.head,c=a.style.color,a.style.color=d,d=e.css(a,"color"),a.style.color=c);d.match(/^rgb/gi)&&(b=d.match(/(\d+(\.\d+)?)/gi),d.match(/%/gi)&&(g=2.55),b[0]*=g,b[1]*=g,b[2]*=g,b[3]=b[3]!==p?fa(b[3]):1);return b}function Va(d){var c=3,a;"array"!==ba(d.start)&&(d.start=Ga(d.start),d.end=Ga(d.end));d.now=[];if(1!==d.start[3]||1!==d.end[3])c=
4;for(a=0;a<c;a+=1)d.now[a]=d.start[a]+(d.end[a]-d.start[a])*d.pos,3>a&&(d.now[a]=Wa(d.now[a]));1!==d.start[3]||1!==d.end[3]?d.now="rgba("+d.now.join(",")+")":(d.now.slice(0,3),d.now="rgb("+d.now.join(",")+")");d.elem.nodeName?d.elem.style[d.prop]=d.now:d.elem[d.prop]=d.now}function Xa(d){P.events[d]=function(c,a){var b,g;g=a.event;b="mouseover"===d||"mouseout"===d?"mousemove":d;a.events[b]||(c.bind(b+".jCanvas",function(a){g.x=a.offsetX;g.y=a.offsetY;g.type=b;g.event=a;c.drawLayers({resetFire:v});
a.preventDefault()}),a.events[b]=v)}}function V(d,c,a){var b,g,f,k;if(a=a._args)d=E(d),b=d.event,b.x!==h&&b.y!==h&&(f=b.x*d.pixelRatio,k=b.y*d.pixelRatio,g=c.isPointInPath(f,k)||c.isPointInStroke&&c.isPointInStroke(f,k)),c=d.transforms,a.eventX=a.mouseX=b.x,a.eventY=a.mouseY=b.y,a.event=b.event,b=d.transforms.rotate,f=a.eventX,k=a.eventY,0!==b?(a._eventX=f*N(-b)-k*S(-b),a._eventY=k*N(-b)+f*S(-b)):(a._eventX=f,a._eventY=k),a._eventX/=c.scaleX,a._eventY/=c.scaleY,g&&d.intersecting.push(a),a.intersects=
g}function Ha(d){for(;0>d;)d+=2*G;return d}function Ia(d,c,a,b){var g,f,k,e,C,t,h;a===b?h=t=0:(t=a.x,h=a.y);b.inDegrees||360!==b.end||(b.end=2*G);b.start*=a._toRad;b.end*=a._toRad;b.start-=G/2;b.end-=G/2;C=G/180*1;b.ccw&&(C*=-1);g=b.x+b.radius*N(b.start+C);f=b.y+b.radius*S(b.start+C);k=b.x+b.radius*N(b.start);e=b.y+b.radius*S(b.start);ha(d,c,a,b,g,f,k,e);c.arc(b.x+t,b.y+h,b.radius,b.start,b.end,b.ccw);g=b.x+b.radius*N(b.end+C);C=b.y+b.radius*S(b.end+C);f=b.x+b.radius*N(b.end);k=b.y+b.radius*S(b.end);
ia(d,c,a,b,f,k,g,C)}function Ja(d,c,a,b,g,f,k,e){var C,t;b.arrowRadius&&!a.closed&&(t=Ya(e-f,k-g),t-=G,d=a.strokeWidth*N(t),C=a.strokeWidth*S(t),a=k+b.arrowRadius*N(t+b.arrowAngle/2),g=e+b.arrowRadius*S(t+b.arrowAngle/2),f=k+b.arrowRadius*N(t-b.arrowAngle/2),b=e+b.arrowRadius*S(t-b.arrowAngle/2),c.moveTo(a-d,g-C),c.lineTo(k-d,e-C),c.lineTo(f-d,b-C),c.moveTo(k-d,e-C),c.lineTo(k+d,e+C),c.moveTo(k,e))}function ha(d,c,a,b,g,f,k,e){b._arrowAngleConverted||(b.arrowAngle*=a._toRad,b._arrowAngleConverted=
v);b.startArrow&&Ja(d,c,a,b,g,f,k,e)}function ia(d,c,a,b,g,f,k,e){b._arrowAngleConverted||(b.arrowAngle*=a._toRad,b._arrowAngleConverted=v);b.endArrow&&Ja(d,c,a,b,g,f,k,e)}function Ka(d,c,a,b){var g,f,k;g=2;ha(d,c,a,b,b.x2+a.x,b.y2+a.y,b.x1+a.x,b.y1+a.y);for(b.x1!==p&&b.y1!==p&&c.moveTo(b.x1+a.x,b.y1+a.y);v;)if(f=b["x"+g],k=b["y"+g],f!==p&&k!==p)c.lineTo(f+a.x,k+a.y),g+=1;else break;g-=1;ia(d,c,a,b,b["x"+(g-1)]+a.x,b["y"+(g-1)]+a.y,b["x"+g]+a.x,b["y"+g]+a.y)}function La(d,c,a,b){var g,f,k,e,C;g=2;
ha(d,c,a,b,b.cx1+a.x,b.cy1+a.y,b.x1+a.x,b.y1+a.y);for(b.x1!==p&&b.y1!==p&&c.moveTo(b.x1+a.x,b.y1+a.y);v;)if(f=b["x"+g],k=b["y"+g],e=b["cx"+(g-1)],C=b["cy"+(g-1)],f!==p&&k!==p&&e!==p&&C!==p)c.quadraticCurveTo(e+a.x,C+a.y,f+a.x,k+a.y),g+=1;else break;g-=1;ia(d,c,a,b,b["cx"+(g-1)]+a.x,b["cy"+(g-1)]+a.y,b["x"+g]+a.x,b["y"+g]+a.y)}function Ma(d,c,a,b){var g,f,k,e,C,t,h,F;g=2;f=1;ha(d,c,a,b,b.cx1+a.x,b.cy1+a.y,b.x1+a.x,b.y1+a.y);for(b.x1!==p&&b.y1!==p&&c.moveTo(b.x1+a.x,b.y1+a.y);v;)if(k=b["x"+g],e=b["y"+
g],C=b["cx"+f],t=b["cy"+f],h=b["cx"+(f+1)],F=b["cy"+(f+1)],k!==p&&e!==p&&C!==p&&t!==p&&h!==p&&F!==p)c.bezierCurveTo(C+a.x,t+a.y,h+a.x,F+a.y,k+a.x,e+a.y),g+=1,f+=2;else break;g-=1;f-=2;ia(d,c,a,b,b["cx"+(f+1)]+a.x,b["cy"+(f+1)]+a.y,b["x"+g]+a.x,b["y"+g]+a.y)}function Na(d,c,a){c*=d._toRad;c-=G/2;return a*N(c)}function Oa(d,c,a){c*=d._toRad;c-=G/2;return a*S(c)}function Pa(d,c,a,b){var g,f,k,e,h,t,D;a===b?h=e=0:(e=a.x,h=a.y);g=1;f=e=t=b.x+e;k=h=D=b.y+h;ha(d,c,a,b,f+Na(a,b.a1,b.l1),k+Oa(a,b.a1,b.l1),
f,k);for(b.x!==p&&b.y!==p&&c.moveTo(f,k);v;)if(f=b["a"+g],k=b["l"+g],f!==p&&k!==p)e=t,h=D,t+=Na(a,f,k),D+=Oa(a,f,k),c.lineTo(t,D),g+=1;else break;ia(d,c,a,b,e,h,t,D)}function Qa(d,c){isNaN(Number(c.fontSize))||(c.fontSize+="px");d.font=c.fontStyle+" "+c.fontSize+" "+c.fontFamily}function Ra(d,c,a,b){var g,f;g=ca.propCache;if(g.text===a.text&&g.fontStyle===a.fontStyle&&g.fontSize===a.fontSize&&g.fontFamily===a.fontFamily&&g.maxWidth===a.maxWidth&&g.lineHeight===a.lineHeight)a.width=g.width,a.height=
g.height;else{a.width=c.measureText(b[0]).width;for(f=1;f<b.length;f+=1)g=c.measureText(b[f]).width,g>a.width&&(a.width=g);c=d.style.fontSize;d.style.fontSize=a.fontSize;a.height=fa(e.css(d,"fontSize"))*b.length*a.lineHeight;d.style.fontSize=c}}function Sa(d,c){var a=c.maxWidth,b=c.text.split("\n"),g=[],f,k,e,h,t;for(e=0;e<b.length;e+=1){h=b[e];t=h.split(" ");f=[];k="";if(1===t.length||d.measureText(h).width<a)f=[h];else{for(h=0;h<t.length;h+=1)d.measureText(k+t[h]).width>a&&(""!==k&&f.push(k),k=
""),k+=t[h],h!==t.length-1&&(k+=" ");f.push(k)}g=g.concat(f.join("\n").replace(/( (\n))|( $)/gi,"$2").split("\n"))}return g}var ma,aa,$=e.extend,ja=e.inArray,ba=e.type,ea=e.isFunction,G=da.PI,Wa=da.round,Za=da.abs,S=da.sin,N=da.cos,Ya=da.atan2,sa=Ta.prototype.slice,$a=e.event.fix,Z={},ca={dataCache:{},propCache:{},imageCache:{}},oa={rotate:0,scaleX:1,scaleY:1,translateX:0,translateY:0,masks:[]},va={jCanvas:x},X={};e.fn.jCanvas=P;P.events={};P.eventHooks={};P.future={inheritance:!1};ma=new function(){$(this,
{align:"center",arrowAngle:90,arrowRadius:0,autosave:v,baseline:"middle",bringToFront:x,ccw:x,closed:x,compositing:"source-over",concavity:0,cornerRadius:0,count:1,cropFromCenter:v,cursors:h,disableEvents:x,draggable:x,dragGroups:h,groups:h,data:h,dx:h,dy:h,end:360,eventX:h,eventY:h,fillStyle:"transparent",fontStyle:"normal",fontSize:"12pt",fontFamily:"sans-serif",fromCenter:v,height:h,imageSmoothing:v,inDegrees:v,index:h,lineHeight:1,layer:x,mask:x,maxWidth:h,miterLimit:10,name:h,opacity:1,r1:h,
r2:h,radius:0,repeat:"repeat",respectAlign:x,rotate:0,rounded:x,scale:1,scaleX:1,scaleY:1,shadowBlur:0,shadowColor:"transparent",shadowStroke:x,shadowX:0,shadowY:0,sHeight:h,sides:0,source:"",letterSpacing:h,spread:0,start:0,strokeCap:"butt",strokeJoin:"miter",strokeStyle:"transparent",strokeWidth:1,sWidth:h,sx:h,sy:h,text:"",translate:0,translateX:0,translateY:0,type:h,visible:v,width:h,x:0,y:0})};wa.prototype=ma;aa=new wa;I.prototype=aa;P.extend=function(d){d.name&&(d.props&&$(ma,d.props),e.fn[d.name]=
function a(b){var g,f,k,e;for(f=0;f<this.length;f+=1)if(g=this[f],k=L(g))e=new I(b),Q(g,e,b,a),U(g,k,e),d.fn.call(g,k,e);return this},d.type&&(Z.drawings[d.type]=d.name));return e.fn[d.name]};e.fn.getEventHooks=function(){var d;d={};0!==this.length&&(d=this[0],d=E(d),d=d.eventHooks);return d};e.fn.setEventHooks=function(d){var c,a;for(c=0;c<this.length;c+=1)e(this[c]),a=E(this[c]),$(a.eventHooks,d);return this};e.fn.getLayers=function(d){var c,a,b,g,f=[];if(0!==this.length)if(c=this[0],a=E(c),a=a.layers,
ea(d))for(g=0;g<a.length;g+=1)b=a[g],d.call(c,b)&&f.push(b);else f=a;return f};e.fn.getLayer=function(d){var c,a,b,g;if(0!==this.length)if(c=this[0],a=E(c),c=a.layers,g=ba(d),d&&d.layer)b=d;else if("number"===g)0>d&&(d=c.length+d),b=c[d];else if("regexp"===g)for(a=0;a<c.length;a+=1){if(ka(c[a].name)&&c[a].name.match(d)){b=c[a];break}}else b=a.layer.names[d];return b};e.fn.getLayerGroup=function(d){var c,a,b,g=ba(d);if(0!==this.length)if(c=this[0],"array"===g)b=d;else if("regexp"===g)for(a in c=E(c),
c=c.layer.groups,c){if(a.match(d)){b=c[a];break}}else c=E(c),b=c.layer.groups[d];return b};e.fn.getLayerIndex=function(d){var c=this.getLayers();d=this.getLayer(d);return ja(d,c)};e.fn.setLayer=function(d,c){var a,b,g,f,k,h,C;for(b=0;b<this.length;b+=1)if(a=e(this[b]),g=E(this[b]),f=e(this[b]).getLayer(d)){pa(a,g,f,c);qa(a,g,f,c);for(k in c)c.hasOwnProperty(k)&&(h=c[k],C=ba(h),"object"===C?f[k]=$({},h):"array"===C?f[k]=h.slice(0):"string"===C?0===h.indexOf("+=")?f[k]+=fa(h.substr(2)):0===h.indexOf("-=")?
f[k]-=fa(h.substr(2)):f[k]=h:f[k]=h);Ca(a,g,f);Ea(a,g,f);e.isEmptyObject(c)===x&&R(a,g,f,"change",c)}return this};e.fn.setLayers=function(d,c){var a,b,g,f;for(b=0;b<this.length;b+=1)for(a=e(this[b]),g=a.getLayers(c),f=0;f<g.length;f+=1)a.setLayer(g[f],d);return this};e.fn.setLayerGroup=function(d,c){var a,b,g,f;for(b=0;b<this.length;b+=1)if(a=e(this[b]),g=a.getLayerGroup(d))for(f=0;f<g.length;f+=1)a.setLayer(g[f],c);return this};e.fn.moveLayer=function(d,c){var a,b,g,f,k;for(b=0;b<this.length;b+=
1)if(a=e(this[b]),g=E(this[b]),f=g.layers,k=a.getLayer(d))k.index=ja(k,f),f.splice(k.index,1),f.splice(c,0,k),0>c&&(c=f.length+c),k.index=c,R(a,g,k,"move");return this};e.fn.removeLayer=function(d){var c,a,b,g,f;for(a=0;a<this.length;a+=1)if(c=e(this[a]),b=E(this[a]),g=c.getLayers(),f=c.getLayer(d))f.index=ja(f,g),g.splice(f.index,1),pa(c,b,f,{name:h}),qa(c,b,f,{groups:h}),R(c,b,f,"remove");return this};e.fn.removeLayers=function(d){var c,a,b,g,f,k;for(a=0;a<this.length;a+=1){c=e(this[a]);b=E(this[a]);
g=c.getLayers(d);for(k=0;k<g.length;k+=1)f=g[k],c.removeLayer(f),k-=1;b.layer.names={};b.layer.groups={}}return this};e.fn.removeLayerGroup=function(d){var c,a,b,g;if(d!==p)for(a=0;a<this.length;a+=1)if(c=e(this[a]),E(this[a]),c.getLayers(),b=c.getLayerGroup(d))for(b=b.slice(0),g=0;g<b.length;g+=1)c.removeLayer(b[g]);return this};e.fn.addLayerToGroup=function(d,c){var a,b,g,f=[c];for(b=0;b<this.length;b+=1)a=e(this[b]),g=a.getLayer(d),g.groups&&(f=g.groups.slice(0),-1===ja(c,g.groups)&&f.push(c)),
a.setLayer(g,{groups:f});return this};e.fn.removeLayerFromGroup=function(d,c){var a,b,g,f=[],k;for(b=0;b<this.length;b+=1)a=e(this[b]),g=a.getLayer(d),g.groups&&(k=ja(c,g.groups),-1!==k&&(f=g.groups.slice(0),f.splice(k,1),a.setLayer(g,{groups:f})));return this};X.cursors=["grab","grabbing","zoom-in","zoom-out"];X.prefix=function(){var d=getComputedStyle(ta.documentElement,"");return"-"+(sa.call(d).join("").match(/-(moz|webkit|ms)-/)||""===d.OLink&&["","o"])[1]+"-"}();e.fn.triggerLayerEvent=function(d,
c){var a,b,g;for(b=0;b<this.length;b+=1)a=e(this[b]),g=E(this[b]),(d=a.getLayer(d))&&R(a,g,d,c);return this};e.fn.drawLayer=function(d){var c,a,b;for(c=0;c<this.length;c+=1)a=e(this[c]),L(this[c]),(b=a.getLayer(d))&&b.visible&&b._method&&(b._next=h,b._method.call(a,b));return this};e.fn.drawLayers=function(d){var c,a,b=$({},d),g,f,k,M,C,t;b.index||(b.index=0);for(c=0;c<this.length;c+=1)if(d=e(this[c]),a=L(this[c])){M=E(this[c]);b.clear!==x&&d.clearCanvas();a=M.layers;for(k=b.index;k<a.length&&(g=
a[k],g.index=k,b.resetFire&&(g._fired=x),C=d,t=g,f=k+1,t&&t.visible&&t._method&&(t._next=f?f:h,t._method.call(C,t)),g._masks=M.transforms.masks.slice(0),g._method!==e.fn.drawImage||!g.visible);k+=1);g=M;var D=f=t=C=void 0;C=h;for(t=g.intersecting.length-1;0<=t;t-=1)if(C=g.intersecting[t],C._masks){for(D=C._masks.length-1;0<=D;D-=1)if(f=C._masks[D],!f.intersects){C.intersects=x;break}if(C.intersects)break}g=C;C=M.event;t=C.type;if(M.drag.layer){f=d;var D=M,F=t,y=void 0,u=void 0,q=void 0,A=q=void 0,
n=void 0,q=y=y=q=void 0,q=D.drag,A=(u=q.layer)&&u.dragGroups||[],y=D.layers;if("mousemove"===F||"touchmove"===F){if(q.dragging||(q.dragging=v,u.dragging=v,u.bringToFront&&(y.splice(u.index,1),u.index=y.push(u)),u._startX=u.x,u._startY=u.y,u._endX=u._eventX,u._endY=u._eventY,R(f,D,u,"dragstart")),q.dragging)for(y=u._eventX-(u._endX-u._startX),q=u._eventY-(u._endY-u._startY),u.dx=y-u.x,u.dy=q-u.y,u.x=y,u.y=q,R(f,D,u,"drag"),y=0;y<A.length;y+=1)if(q=A[y],n=D.layer.groups[q],u.groups&&n)for(q=0;q<n.length;q+=
1)n[q]!==u&&(n[q].x+=u.dx,n[q].y+=u.dy)}else if("mouseup"===F||"touchend"===F)q.dragging&&(u.dragging=x,q.dragging=x,R(f,D,u,"dragstop")),D.drag={}}f=M.lastIntersected;f===h||g===f||!f._hovered||f._fired||M.drag.dragging||(M.lastIntersected=h,f._fired=v,f._hovered=x,R(d,M,f,"mouseout"),d.css({cursor:M.cursor}));g&&(g[t]||Z.mouseEvents[t]&&(t=Z.mouseEvents[t]),g._event&&g.intersects&&(M.lastIntersected=g,!(g.mouseover||g.mouseout||g.cursors)||M.drag.dragging||g._hovered||g._fired||(g._fired=v,g._hovered=
v,R(d,M,g,"mouseover")),g._fired||(g._fired=v,C.type=h,R(d,M,g,t)),!g.draggable||g.disableEvents||"mousedown"!==t&&"touchstart"!==t||(M.drag.layer=g)));g!==h||M.drag.dragging||d.css({cursor:M.cursor});k===a.length&&(M.intersecting.length=0,M.transforms=la(oa),M.savedTransforms.length=0)}return this};e.fn.addLayer=function(d){var c,a;for(c=0;c<this.length;c+=1)if(a=L(this[c]))a=new I(d),a.layer=v,Q(this[c],a,d);return this};X.props=["width","height","opacity","lineHeight"];X.propsObj={};e.fn.animateLayer=
function(){function d(a,b,c){return function(){var d,g;for(g=0;g<X.props.length;g+=1)d=X.props[g],c[d]=c["_"+d];for(var k in c)c.hasOwnProperty(k)&&-1!==k.indexOf(".")&&delete c[k];b.animating&&b.animated!==c||a.drawLayers();c._animating=x;b.animating=x;b.animated=h;f[4]&&f[4].call(a[0],c);R(a,b,c,"animateend")}}function c(a,b,c){return function(d,g){var k,e,h=!1;"_"===g.prop[0]&&(h=!0,g.prop=g.prop.replace("_",""),c[g.prop]=c["_"+g.prop]);-1!==g.prop.indexOf(".")&&(k=g.prop.split("."),e=k[0],k=k[1],
c[e]&&(c[e][k]=g.now));c._pos!==g.pos&&(c._pos=g.pos,c._animating||b.animating||(c._animating=v,b.animating=v,b.animated=c),b.animating&&b.animated!==c||a.drawLayers());f[5]&&f[5].call(a[0],d,g,c);R(a,b,c,"animate",g);h&&(g.prop="_"+g.prop)}}var a,b,g,f=sa.call(arguments,0),k,M;"object"===ba(f[2])?(f.splice(2,0,f[2].duration||h),f.splice(3,0,f[3].easing||h),f.splice(4,0,f[4].complete||h),f.splice(5,0,f[5].step||h)):(f[2]===p?(f.splice(2,0,h),f.splice(3,0,h),f.splice(4,0,h)):ea(f[2])&&(f.splice(2,
0,h),f.splice(3,0,h)),f[3]===p?(f[3]=h,f.splice(4,0,h)):ea(f[3])&&f.splice(3,0,h));for(b=0;b<this.length;b+=1)if(a=e(this[b]),g=L(this[b]))g=E(this[b]),(k=a.getLayer(f[0]))&&k._method!==e.fn.draw&&(M=$({},f[1]),M=Ua(this[b],k,M),Fa(M,v),Fa(k),k.style=X.propsObj,e(k).animate(M,{duration:f[2],easing:e.easing[f[3]]?f[3]:h,complete:d(a,g,k),step:c(a,g,k)}),R(a,g,k,"animatestart"));return this};e.fn.animateLayerGroup=function(d){var c,a,b=sa.call(arguments,0),g,f;for(a=0;a<this.length;a+=1)if(c=e(this[a]),
g=c.getLayerGroup(d))for(f=0;f<g.length;f+=1)b[0]=g[f],c.animateLayer.apply(c,b);return this};e.fn.delayLayer=function(d,c){var a,b,g,f;c=c||0;for(b=0;b<this.length;b+=1)if(a=e(this[b]),g=E(this[b]),f=a.getLayer(d))e(f).delay(c),R(a,g,f,"delay");return this};e.fn.delayLayerGroup=function(d,c){var a,b,g,f,k;c=c||0;for(b=0;b<this.length;b+=1)if(a=e(this[b]),g=a.getLayerGroup(d))for(k=0;k<g.length;k+=1)f=g[k],a.delayLayer(f,c);return this};e.fn.stopLayer=function(d,c){var a,b,g,f;for(b=0;b<this.length;b+=
1)if(a=e(this[b]),g=E(this[b]),f=a.getLayer(d))e(f).stop(c),R(a,g,f,"stop");return this};e.fn.stopLayerGroup=function(d,c){var a,b,g,f,k;for(b=0;b<this.length;b+=1)if(a=e(this[b]),g=a.getLayerGroup(d))for(k=0;k<g.length;k+=1)f=g[k],a.stopLayer(f,c);return this};(function(d){var c;for(c=0;c<d.length;c+=1)e.fx.step[d[c]]=Va})("color backgroundColor borderColor borderTopColor borderRightColor borderBottomColor borderLeftColor fillStyle outlineColor strokeStyle shadowColor".split(" "));Z.touchEvents=
{mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove"};Z.mouseEvents={touchstart:"mousedown",touchend:"mouseup",touchmove:"mousemove"};(function(d){var c;for(c=0;c<d.length;c+=1)Xa(d[c])})("click dblclick mousedown mouseup mousemove mouseover mouseout touchstart touchmove touchend".split(" "));e.event.fix=function(d){var c,a;d=$a.call(e.event,d);if(c=d.originalEvent)if(a=c.changedTouches,d.pageX!==p&&d.offsetX===p){if(c=e(d.currentTarget).offset())d.offsetX=d.pageX-c.left,d.offsetY=d.pageY-
c.top}else a&&(c=e(d.currentTarget).offset())&&(d.offsetX=a[0].pageX-c.left,d.offsetY=a[0].pageY-c.top);return d};Z.drawings={arc:"drawArc",bezier:"drawBezier",ellipse:"drawEllipse","function":"draw",image:"drawImage",line:"drawLine",path:"drawPath",polygon:"drawPolygon",slice:"drawSlice",quadratic:"drawQuadratic",rectangle:"drawRect",text:"drawText",vector:"drawVector",save:"saveCanvas",restore:"restoreCanvas",rotate:"rotateCanvas",scale:"scaleCanvas",translate:"translateCanvas"};e.fn.draw=function c(a){var b,
g,f=new I(a);if(Z.drawings[f.type])this[Z.drawings[f.type]](a);else for(b=0;b<this.length;b+=1)if(e(this[b]),g=L(this[b]))f=new I(a),Q(this[b],f,a,c),f.visible&&f.fn&&f.fn.call(this[b],g,f);return this};e.fn.clearCanvas=function a(b){var g,f,k=new I(b);for(g=0;g<this.length;g+=1)if(f=L(this[g]))k.width===h||k.height===h?(f.save(),f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,this[g].width,this[g].height),f.restore()):(Q(this[g],k,b,a),T(this[g],f,k,k.width,k.height),f.clearRect(k.x-k.width/2,k.y-k.height/
2,k.width,k.height),k._transformed&&f.restore());return this};e.fn.saveCanvas=function b(g){var f,k,e,h,t;for(f=0;f<this.length;f+=1)if(k=L(this[f]))for(h=E(this[f]),e=new I(g),Q(this[f],e,g,b),t=0;t<e.count;t+=1)ga(k,h);return this};e.fn.restoreCanvas=function g(f){var k,e,h,t,D;for(k=0;k<this.length;k+=1)if(e=L(this[k]))for(t=E(this[k]),h=new I(f),Q(this[k],h,f,g),D=0;D<h.count;D+=1){var F=e,y=t;0===y.savedTransforms.length?y.transforms=la(oa):(F.restore(),y.transforms=y.savedTransforms.pop())}return this};
e.fn.rotateCanvas=function f(e){var h,C,t,D;for(h=0;h<this.length;h+=1)if(C=L(this[h]))D=E(this[h]),t=new I(e),Q(this[h],t,e,f),t.autosave&&ga(C,D),za(C,t,D.transforms);return this};e.fn.scaleCanvas=function k(e){var h,t,D,F;for(h=0;h<this.length;h+=1)if(t=L(this[h]))F=E(this[h]),D=new I(e),Q(this[h],D,e,k),D.autosave&&ga(t,F),Aa(t,D,F.transforms);return this};e.fn.translateCanvas=function M(e){var h,D,F,y;for(h=0;h<this.length;h+=1)if(D=L(this[h]))y=E(this[h]),F=new I(e),Q(this[h],F,e,M),F.autosave&&
ga(D,y),Ba(D,F,y.transforms);return this};e.fn.drawRect=function C(e){var h,F,y,u,q,A,n,z,K;for(h=0;h<this.length;h+=1)if(F=L(this[h]))y=new I(e),Q(this[h],y,e,C),y.visible&&(U(this[h],F,y),T(this[h],F,y,y.width,y.height),F.beginPath(),u=y.x-y.width/2,q=y.y-y.height/2,z=Za(y.cornerRadius),y.width&&y.height&&(z?(A=y.x+y.width/2,n=y.y+y.height/2,0>y.width&&(K=u,u=A,A=K),0>y.height&&(K=q,q=n,n=K),0>A-u-2*z&&(z=(A-u)/2),0>n-q-2*z&&(z=(n-q)/2),F.moveTo(u+z,q),F.lineTo(A-z,q),F.arc(A-z,q+z,z,3*G/2,2*G,
x),F.lineTo(A,n-z),F.arc(A-z,n-z,z,0,G/2,x),F.lineTo(u+z,n),F.arc(u+z,n-z,z,G/2,G,x),F.lineTo(u,q+z),F.arc(u+z,q+z,z,G,3*G/2,x),y.closed=v):F.rect(u,q,y.width,y.height)),V(this[h],F,y),Y(this[h],F,y));return this};e.fn.drawArc=function t(e){var h,y,u;for(h=0;h<this.length;h+=1)if(y=L(this[h]))u=new I(e),Q(this[h],u,e,t),u.visible&&(U(this[h],y,u),T(this[h],y,u,2*u.radius),y.beginPath(),Ia(this[h],y,u,u),V(this[h],y,u),Y(this[h],y,u));return this};e.fn.drawEllipse=function D(e){var h,u,q,A,n;for(h=
0;h<this.length;h+=1)if(u=L(this[h]))q=new I(e),Q(this[h],q,e,D),q.visible&&(U(this[h],u,q),T(this[h],u,q,q.width,q.height),A=4/3*q.width,n=q.height,u.beginPath(),u.moveTo(q.x,q.y-n/2),u.bezierCurveTo(q.x-A/2,q.y-n/2,q.x-A/2,q.y+n/2,q.x,q.y+n/2),u.bezierCurveTo(q.x+A/2,q.y+n/2,q.x+A/2,q.y-n/2,q.x,q.y-n/2),V(this[h],u,q),q.closed=v,Y(this[h],u,q));return this};e.fn.drawPolygon=function F(h){var e,q,A,n,z,K,H,w,m,l;for(e=0;e<this.length;e+=1)if(q=L(this[e]))if(A=new I(h),Q(this[e],A,h,F),A.visible){U(this[e],
q,A);T(this[e],q,A,2*A.radius);z=2*G/A.sides;K=z/2;n=K+G/2;H=A.radius*N(K);q.beginPath();for(l=0;l<A.sides;l+=1)w=A.x+A.radius*N(n),m=A.y+A.radius*S(n),q.lineTo(w,m),A.concavity&&(w=A.x+(H+-H*A.concavity)*N(n+K),m=A.y+(H+-H*A.concavity)*S(n+K),q.lineTo(w,m)),n+=z;V(this[e],q,A);A.closed=v;Y(this[e],q,A)}return this};e.fn.drawSlice=function y(h){var q,A,n,z,K;for(q=0;q<this.length;q+=1)if(e(this[q]),A=L(this[q]))n=new I(h),Q(this[q],n,h,y),n.visible&&(U(this[q],A,n),T(this[q],A,n,2*n.radius),n.start*=
n._toRad,n.end*=n._toRad,n.start-=G/2,n.end-=G/2,n.start=Ha(n.start),n.end=Ha(n.end),n.end<n.start&&(n.end+=2*G),z=(n.start+n.end)/2,K=n.radius*n.spread*N(z),z=n.radius*n.spread*S(z),n.x+=K,n.y+=z,A.beginPath(),A.arc(n.x,n.y,n.radius,n.start,n.end,n.ccw),A.lineTo(n.x,n.y),V(this[q],A,n),n.closed=v,Y(this[q],A,n));return this};e.fn.drawLine=function u(h){var e,n,z;for(e=0;e<this.length;e+=1)if(n=L(this[e]))z=new I(h),Q(this[e],z,h,u),z.visible&&(U(this[e],n,z),T(this[e],n,z),n.beginPath(),Ka(this[e],
n,z,z),V(this[e],n,z),Y(this[e],n,z));return this};e.fn.drawQuadratic=function q(e){var h,z,K;for(h=0;h<this.length;h+=1)if(z=L(this[h]))K=new I(e),Q(this[h],K,e,q),K.visible&&(U(this[h],z,K),T(this[h],z,K),z.beginPath(),La(this[h],z,K,K),V(this[h],z,K),Y(this[h],z,K));return this};e.fn.drawBezier=function A(h){var e,K,H;for(e=0;e<this.length;e+=1)if(K=L(this[e]))H=new I(h),Q(this[e],H,h,A),H.visible&&(U(this[e],K,H),T(this[e],K,H),K.beginPath(),Ma(this[e],K,H,H),V(this[e],K,H),Y(this[e],K,H));return this};
e.fn.drawVector=function n(e){var h,H,w;for(h=0;h<this.length;h+=1)if(H=L(this[h]))w=new I(e),Q(this[h],w,e,n),w.visible&&(U(this[h],H,w),T(this[h],H,w),H.beginPath(),Pa(this[h],H,w,w),V(this[h],H,w),Y(this[h],H,w));return this};e.fn.drawPath=function z(h){var e,w,m,l,B;for(e=0;e<this.length;e+=1)if(w=L(this[e]))if(m=new I(h),Q(this[e],m,h,z),m.visible){U(this[e],w,m);T(this[e],w,m);w.beginPath();for(l=1;v;)if(B=m["p"+l],B!==p)B=new I(B),"line"===B.type?Ka(this[e],w,m,B):"quadratic"===B.type?La(this[e],
w,m,B):"bezier"===B.type?Ma(this[e],w,m,B):"vector"===B.type?Pa(this[e],w,m,B):"arc"===B.type&&Ia(this[e],w,m,B),l+=1;else break;V(this[e],w,m);Y(this[e],w,m)}return this};e.fn.drawText=function K(H){var w,m,l,B,W,s,O,p,v,x;for(w=0;w<this.length;w+=1)if(e(this[w]),m=L(this[w]))if(l=new I(H),B=Q(this[w],l,H,K),l.visible){U(this[w],m,l);m.textBaseline=l.baseline;m.textAlign=l.align;Qa(m,l);W=l.maxWidth!==h?Sa(m,l):l.text.toString().split("\n");Ra(this[w],m,l,W);B&&(B.width=l.width,B.height=l.height);
T(this[w],m,l,l.width,l.height);O=l.x;"left"===l.align?l.respectAlign?l.x+=l.width/2:O-=l.width/2:"right"===l.align&&(l.respectAlign?l.x-=l.width/2:O+=l.width/2);if(l.radius)for(O=fa(l.fontSize),l.letterSpacing===h&&(l.letterSpacing=O/500),s=0;s<W.length;s+=1){m.save();m.translate(l.x,l.y);B=W[s];p=B.length;m.rotate(-(G*l.letterSpacing*(p-1))/2);for(x=0;x<p;x+=1)v=B[x],0!==x&&m.rotate(G*l.letterSpacing),m.save(),m.translate(0,-l.radius),m.fillText(v,0,0),m.restore();l.radius-=O;l.letterSpacing+=O/
(1E3*G);m.restore()}else for(s=0;s<W.length;s+=1)B=W[s],p=l.y+s*l.height/W.length-(W.length-1)*l.height/W.length/2,m.shadowColor=l.shadowColor,m.fillText(B,O,p),"transparent"!==l.fillStyle&&(m.shadowColor="transparent"),m.strokeText(B,O,p);p=0;"top"===l.baseline?p+=l.height/2:"bottom"===l.baseline&&(p-=l.height/2);l._event&&(m.beginPath(),m.rect(l.x-l.width/2,l.y-l.height/2+p,l.width,l.height),V(this[w],m,l),m.closePath());l._transformed&&m.restore()}ca.propCache=l;return this};e.fn.measureText=function(e){var h,
w;h=this.getLayer(e);if(!h||h&&!h._layer)h=new I(e);if(e=L(this[0]))Qa(e,h),w=Sa(e,h),Ra(this[0],e,h,w);return h};e.fn.drawImage=function H(w){function m(l,m,s,r,w){return function(){var B=e(l);U(l,m,r);r.width===h&&r.sWidth===h&&(r.width=r.sWidth=J.width);r.height===h&&r.sHeight===h&&(r.height=r.sHeight=J.height);w&&(w.width=r.width,w.height=r.height);r.sWidth!==h&&r.sHeight!==h&&r.sx!==h&&r.sy!==h?(r.width===h&&(r.width=r.sWidth),r.height===h&&(r.height=r.sHeight),r.cropFromCenter||(r.sx+=r.sWidth/
2,r.sy+=r.sHeight/2),0>r.sy-r.sHeight/2&&(r.sy=r.sHeight/2),r.sy+r.sHeight/2>J.height&&(r.sy=J.height-r.sHeight/2),0>r.sx-r.sWidth/2&&(r.sx=r.sWidth/2),r.sx+r.sWidth/2>J.width&&(r.sx=J.width-r.sWidth/2),T(l,m,r,r.width,r.height),m.drawImage(J,r.sx-r.sWidth/2,r.sy-r.sHeight/2,r.sWidth,r.sHeight,r.x-r.width/2,r.y-r.height/2,r.width,r.height)):(T(l,m,r,r.width,r.height),m.drawImage(J,r.x-r.width/2,r.y-r.height/2,r.width,r.height));m.beginPath();m.rect(r.x-r.width/2,r.y-r.height/2,r.width,r.height);V(l,
m,r);m.closePath();r._transformed&&m.restore();ya(m,s,r);r.layer?R(B,s,w,"load"):r.load&&r.load.call(B[0],w);r.layer&&(w._masks=s.transforms.masks.slice(0),r._next&&B.drawLayers({clear:x,resetFire:v,index:r._next}))}}var l,B,W,s,O,G,J,P,N,S=ca.imageCache;for(B=0;B<this.length;B+=1)if(l=this[B],W=L(this[B]))s=E(this[B]),O=new I(w),G=Q(this[B],O,w,H),O.visible&&(N=O.source,P=N.getContext,N.src||P?J=N:N&&(S[N]!==p?J=S[N]:(J=new ua,J.src=N,S[N]=J)),J&&(J.complete||P?m(l,W,s,O,G)():(J.onload=m(l,W,s,O,
G),J.src=J.src)));return this};e.fn.createPattern=function(H){function w(){s=l.createPattern(p,B.repeat);B.load&&B.load.call(m[0],s)}var m=this,l,B,p,s,v;(l=L(m[0]))?(B=new I(H),v=B.source,ea(v)?(p=e("<canvas />")[0],p.width=B.width,p.height=B.height,H=L(p),v.call(p,H),w()):(H=v.getContext,v.src||H?p=v:(p=new ua,p.src=v),p.complete||H?w():(e(p).bind("load",w),p.src=p.src))):s=h;return s};e.fn.createGradient=function(e){var w,m=[],l,B,v,s,O,x,J;e=new I(e);if(w=L(this[0])){e.x1=e.x1||0;e.y1=e.y1||0;
e.x2=e.x2||0;e.y2=e.y2||0;w=e.r1!==h&&e.r2!==h?w.createRadialGradient(e.x1,e.y1,e.r1,e.x2,e.y2,e.r2):w.createLinearGradient(e.x1,e.y1,e.x2,e.y2);for(s=1;e["c"+s]!==p;s+=1)e["s"+s]!==p?m.push(e["s"+s]):m.push(h);l=m.length;m[0]===h&&(m[0]=0);m[l-1]===h&&(m[l-1]=1);for(s=0;s<l;s+=1){if(m[s]!==h){x=1;J=0;B=m[s];for(O=s+1;O<l;O+=1)if(m[O]!==h){v=m[O];break}else x+=1;B>v&&(m[O]=m[s])}else m[s]===h&&(J+=1,m[s]=B+(v-B)/x*J);w.addColorStop(m[s],e["c"+(s+1)])}}else w=h;return w};e.fn.setPixels=function w(e){var l,
p,v,s,x,G,J,E,N;for(p=0;p<this.length;p+=1)if(l=this[p],v=L(l)){s=new I(e);Q(l,s,e,w);T(this[p],v,s,s.width,s.height);if(s.width===h||s.height===h)s.width=l.width,s.height=l.height,s.x=s.width/2,s.y=s.height/2;if(0!==s.width&&0!==s.height){G=v.getImageData(s.x-s.width/2,s.y-s.height/2,s.width,s.height);J=G.data;N=J.length;if(s.each)for(E=0;E<N;E+=4)x={r:J[E],g:J[E+1],b:J[E+2],a:J[E+3]},s.each.call(l,x,s),J[E]=x.r,J[E+1]=x.g,J[E+2]=x.b,J[E+3]=x.a;v.putImageData(G,s.x-s.width/2,s.y-s.height/2);v.restore()}}return this};
e.fn.getCanvasImage=function(e,m){var l,v=h;0!==this.length&&(l=this[0],l.toDataURL&&(m===p&&(m=1),v=l.toDataURL("image/"+e,m)));return v};e.fn.detectPixelRatio=function(h){var m,l,p,x,s,G,I;for(l=0;l<this.length;l+=1)m=this[l],e(this[l]),p=L(m),I=E(this[l]),I.scaled||(x=window.devicePixelRatio||1,s=p.webkitBackingStorePixelRatio||p.mozBackingStorePixelRatio||p.msBackingStorePixelRatio||p.oBackingStorePixelRatio||p.backingStorePixelRatio||1,x/=s,1!==x&&(s=m.width,G=m.height,m.width=s*x,m.height=G*
x,m.style.width=s+"px",m.style.height=G+"px",p.scale(x,x)),I.pixelRatio=x,I.scaled=v,h&&h.call(m,x));return this};P.clearCache=function(){for(var e in ca)ca.hasOwnProperty(e)&&(ca[e]={})};e.support.canvas=e("<canvas />")[0].getContext!==p;P.defaults=ma;P.prefs=aa;P.setGlobalProps=U;P.transformShape=T;P.detectEvents=V;P.closePath=Y;e.jCanvas=P})(jQuery,document,Image,Array,Math,parseFloat,console,!0,!1,null);