//>>built
require({cache:{"dojox/gfx/shape":function(){define("./_base dojo/_base/lang dojo/_base/declare dojo/_base/kernel dojo/_base/sniff dojo/on dojo/_base/array dojo/dom-construct dojo/_base/Color ./matrix".split(" "),function(f,q,p,t,m,c,l,g,h,b){function n(a,b){if(!u)return a.splice(b,1);var e=a.length;if(e){for(;b<e;)a[b]=a[b+1],b++;a.length--}}var u=!!m("chrome"),k=f.shape={};k.Shape=p("dojox.gfx.shape.Shape",null,{constructor:function(){this.parentMatrix=this.parent=this.bbox=this.strokeStyle=this.fillStyle=
this.matrix=this.shape=this.rawNode=null;if(m("gfxRegistry")){var a=k.register(this);this.getUID=function(){return a}}},destroy:function(){m("gfxRegistry")&&k.dispose(this);this.rawNode&&"__gfxObject__"in this.rawNode&&(this.rawNode.__gfxObject__=null);this.rawNode=null},getNode:function(){return this.rawNode},getShape:function(){return this.shape},getTransform:function(){return this.matrix},getFill:function(){return this.fillStyle},getStroke:function(){return this.strokeStyle},getParent:function(){return this.parent},
getBoundingBox:function(){return this.bbox},getTransformedBoundingBox:function(){var a=this.getBoundingBox();if(!a)return null;var c=this._getRealMatrix();return[b.multiplyPoint(c,a.x,a.y),b.multiplyPoint(c,a.x+a.width,a.y),b.multiplyPoint(c,a.x+a.width,a.y+a.height),b.multiplyPoint(c,a.x,a.y+a.height)]},getEventSource:function(){return this.rawNode},setClip:function(a){this.clip=a},getClip:function(){return this.clip},setShape:function(a){this.shape=f.makeParameters(this.shape,a);this.bbox=null;
return this},setFill:function(a){if(!a)return this.fillStyle=null,this;var b=null;if("object"==typeof a&&"type"in a)switch(a.type){case "linear":b=f.makeParameters(f.defaultLinearGradient,a);break;case "radial":b=f.makeParameters(f.defaultRadialGradient,a);break;case "pattern":b=f.makeParameters(f.defaultPattern,a)}else b=f.normalizeColor(a);this.fillStyle=b;return this},setStroke:function(a){if(!a)return this.strokeStyle=null,this;if("string"==typeof a||q.isArray(a)||a instanceof h)a={color:a};a=
this.strokeStyle=f.makeParameters(f.defaultStroke,a);a.color=f.normalizeColor(a.color);return this},setTransform:function(a){this.matrix=b.clone(a?b.normalize(a):b.identity);return this._applyTransform()},_applyTransform:function(){return this},moveToFront:function(){var a=this.getParent();a&&(a._moveChildToFront(this),this._moveToFront());return this},moveToBack:function(){var a=this.getParent();a&&(a._moveChildToBack(this),this._moveToBack());return this},_moveToFront:function(){},_moveToBack:function(){},
applyRightTransform:function(a){return a?this.setTransform([this.matrix,a]):this},applyLeftTransform:function(a){return a?this.setTransform([a,this.matrix]):this},applyTransform:function(a){return a?this.setTransform([this.matrix,a]):this},removeShape:function(a){this.parent&&this.parent.remove(this,a);return this},_setParent:function(a,b){this.parent=a;return this._updateParentMatrix(b)},_updateParentMatrix:function(a){this.parentMatrix=a?b.clone(a):null;return this._applyTransform()},_getRealMatrix:function(){for(var a=
this.matrix,c=this.parent;c;)c.matrix&&(a=b.multiply(c.matrix,a)),c=c.parent;return a}});k._eventsProcessing={on:function(a,b){return c(this.getEventSource(),a,k.fixCallback(this,f.fixTarget,b))},connect:function(a,b,e){"on"==a.substring(0,2)&&(a=a.substring(2));return this.on(a,e?q.hitch(b,e):b)},disconnect:function(a){return a.remove()}};k.fixCallback=function(a,b,e,c){c||(c=e,e=null);if(q.isString(c)){e=e||t.global;if(!e[c])throw['dojox.gfx.shape.fixCallback: scope["',c,'"] is null (scope\x3d"',
e,'")'].join("");return function(f){return b(f,a)?e[c].apply(e,arguments||[]):void 0}}return e?function(f){return b(f,a)?c.apply(e,arguments||[]):void 0}:function(f){return b(f,a)?c.apply(e,arguments):void 0}};q.extend(k.Shape,k._eventsProcessing);k.Container={_init:function(){this.children=[];this._batch=0},openBatch:function(){return this},closeBatch:function(){return this},add:function(a){var b=a.getParent();b&&b.remove(a,!0);this.children.push(a);return a._setParent(this,this._getRealMatrix())},
remove:function(a,b){for(var e=0;e<this.children.length;++e)if(this.children[e]==a){b||(a.parent=null,a.parentMatrix=null);n(this.children,e);break}return this},clear:function(a){for(var b,e=0;e<this.children.length;++e)b=this.children[e],b.parent=null,b.parentMatrix=null,a&&b.destroy();this.children=[];return this},getBoundingBox:function(){if(this.children){var a=null;l.forEach(this.children,function(c){var e=c.getBoundingBox();e&&((c=c.getTransform())&&(e=b.multiplyRectangle(c,e)),a?(a.x=Math.min(a.x,
e.x),a.y=Math.min(a.y,e.y),a.endX=Math.max(a.endX,e.x+e.width),a.endY=Math.max(a.endY,e.y+e.height)):a={x:e.x,y:e.y,endX:e.x+e.width,endY:e.y+e.height})});a&&(a.width=a.endX-a.x,a.height=a.endY-a.y);return a}return null},_moveChildToFront:function(a){for(var b=0;b<this.children.length;++b)if(this.children[b]==a){n(this.children,b);this.children.push(a);break}return this},_moveChildToBack:function(a){for(var b=0;b<this.children.length;++b)if(this.children[b]==a){n(this.children,b);this.children.unshift(a);
break}return this}};k.Surface=p("dojox.gfx.shape.Surface",null,{constructor:function(){this._parent=this.rawNode=null;this._nodes=[];this._events=[]},destroy:function(){l.forEach(this._nodes,g.destroy);this._nodes=[];l.forEach(this._events,function(a){a&&a.remove()});this._events=[];this.rawNode=null;if(m("ie"))for(;this._parent.lastChild;)g.destroy(this._parent.lastChild);else this._parent.innerHTML="";this._parent=null},getEventSource:function(){return this.rawNode},_getRealMatrix:function(){return null},
isLoaded:!0,onLoad:function(a){},whenLoaded:function(a,b){var e=q.hitch(a,b);if(this.isLoaded)e(this);else c.once(this,"load",function(a){e(a)})}});q.extend(k.Surface,k._eventsProcessing);k.Rect=p("dojox.gfx.shape.Rect",k.Shape,{constructor:function(a){this.shape=f.getDefault("Rect");this.rawNode=a},getBoundingBox:function(){return this.shape}});k.Ellipse=p("dojox.gfx.shape.Ellipse",k.Shape,{constructor:function(a){this.shape=f.getDefault("Ellipse");this.rawNode=a},getBoundingBox:function(){if(!this.bbox){var a=
this.shape;this.bbox={x:a.cx-a.rx,y:a.cy-a.ry,width:2*a.rx,height:2*a.ry}}return this.bbox}});k.Circle=p("dojox.gfx.shape.Circle",k.Shape,{constructor:function(a){this.shape=f.getDefault("Circle");this.rawNode=a},getBoundingBox:function(){if(!this.bbox){var a=this.shape;this.bbox={x:a.cx-a.r,y:a.cy-a.r,width:2*a.r,height:2*a.r}}return this.bbox}});k.Line=p("dojox.gfx.shape.Line",k.Shape,{constructor:function(a){this.shape=f.getDefault("Line");this.rawNode=a},getBoundingBox:function(){if(!this.bbox){var a=
this.shape;this.bbox={x:Math.min(a.x1,a.x2),y:Math.min(a.y1,a.y2),width:Math.abs(a.x2-a.x1),height:Math.abs(a.y2-a.y1)}}return this.bbox}});k.Polyline=p("dojox.gfx.shape.Polyline",k.Shape,{constructor:function(a){this.shape=f.getDefault("Polyline");this.rawNode=a},setShape:function(a,b){a&&a instanceof Array?(this.inherited(arguments,[{points:a}]),b&&this.shape.points.length&&this.shape.points.push(this.shape.points[0])):this.inherited(arguments,[a]);return this},_normalizePoints:function(){var a=
this.shape.points,b=a&&a.length;if(b&&"number"==typeof a[0]){for(var e=[],c=0;c<b;c+=2)e.push({x:a[c],y:a[c+1]});this.shape.points=e}},getBoundingBox:function(){if(!this.bbox&&this.shape.points.length){for(var a=this.shape.points,b=a.length,e=a[0],c=e.x,f=e.y,g=e.x,l=e.y,k=1;k<b;++k)e=a[k],c>e.x&&(c=e.x),g<e.x&&(g=e.x),f>e.y&&(f=e.y),l<e.y&&(l=e.y);this.bbox={x:c,y:f,width:g-c,height:l-f}}return this.bbox}});k.Image=p("dojox.gfx.shape.Image",k.Shape,{constructor:function(a){this.shape=f.getDefault("Image");
this.rawNode=a},getBoundingBox:function(){return this.shape},setStroke:function(){return this},setFill:function(){return this}});k.Text=p(k.Shape,{constructor:function(a){this.fontStyle=null;this.shape=f.getDefault("Text");this.rawNode=a},getFont:function(){return this.fontStyle},setFont:function(a){this.fontStyle="string"==typeof a?f.splitFontString(a):f.makeParameters(f.defaultFont,a);this._setFont();return this},getBoundingBox:function(){var a=null;this.getShape().text&&(a=f._base._computeTextBoundingBox(this));
return a}});k.Creator={createShape:function(a){switch(a.type){case f.defaultPath.type:return this.createPath(a);case f.defaultRect.type:return this.createRect(a);case f.defaultCircle.type:return this.createCircle(a);case f.defaultEllipse.type:return this.createEllipse(a);case f.defaultLine.type:return this.createLine(a);case f.defaultPolyline.type:return this.createPolyline(a);case f.defaultImage.type:return this.createImage(a);case f.defaultText.type:return this.createText(a);case f.defaultTextPath.type:return this.createTextPath(a)}return null},
createGroup:function(){return this.createObject(f.Group)},createRect:function(a){return this.createObject(f.Rect,a)},createEllipse:function(a){return this.createObject(f.Ellipse,a)},createCircle:function(a){return this.createObject(f.Circle,a)},createLine:function(a){return this.createObject(f.Line,a)},createPolyline:function(a){return this.createObject(f.Polyline,a)},createImage:function(a){return this.createObject(f.Image,a)},createText:function(a){return this.createObject(f.Text,a)},createPath:function(a){return this.createObject(f.Path,
a)},createTextPath:function(a){return this.createObject(f.TextPath,{}).setText(a)},createObject:function(a,b){return null}};return k})},"dojox/gfx/path":function(){define(["./_base","dojo/_base/lang","dojo/_base/declare","./matrix","./shape"],function(f,q,p,t,m){m=p("dojox.gfx.path.Path",m.Shape,{constructor:function(c){this.shape=q.clone(f.defaultPath);this.segments=[];this.tbbox=null;this.absolute=!0;this.last={};this.rawNode=c;this.segmented=!1},setAbsoluteMode:function(c){this._confirmSegmented();
this.absolute="string"==typeof c?"absolute"==c:c;return this},getAbsoluteMode:function(){this._confirmSegmented();return this.absolute},getBoundingBox:function(){this._confirmSegmented();return this.bbox&&"l"in this.bbox?{x:this.bbox.l,y:this.bbox.t,width:this.bbox.r-this.bbox.l,height:this.bbox.b-this.bbox.t}:null},_getRealBBox:function(){this._confirmSegmented();if(this.tbbox)return this.tbbox;var c=this.bbox,f=this._getRealMatrix();this.bbox=null;for(var g=0,h=this.segments.length;g<h;++g)this._updateWithSegment(this.segments[g],
f);f=this.bbox;this.bbox=c;return this.tbbox=f?[{x:f.l,y:f.t},{x:f.r,y:f.t},{x:f.r,y:f.b},{x:f.l,y:f.b}]:null},getLastPosition:function(){this._confirmSegmented();return"x"in this.last?this.last:null},_applyTransform:function(){this.tbbox=null;return this.inherited(arguments)},_updateBBox:function(c,f,g){g&&(f=t.multiplyPoint(g,c,f),c=f.x,f=f.y);this.bbox&&"l"in this.bbox?(this.bbox.l>c&&(this.bbox.l=c),this.bbox.r<c&&(this.bbox.r=c),this.bbox.t>f&&(this.bbox.t=f),this.bbox.b<f&&(this.bbox.b=f)):
this.bbox={l:c,b:f,r:c,t:f}},_updateWithSegment:function(c,l){var g=c.args,h=g.length,b;switch(c.action){case "M":case "L":case "C":case "S":case "Q":case "T":for(b=0;b<h;b+=2)this._updateBBox(g[b],g[b+1],l);this.last.x=g[h-2];this.last.y=g[h-1];this.absolute=!0;break;case "H":for(b=0;b<h;++b)this._updateBBox(g[b],this.last.y,l);this.last.x=g[h-1];this.absolute=!0;break;case "V":for(b=0;b<h;++b)this._updateBBox(this.last.x,g[b],l);this.last.y=g[h-1];this.absolute=!0;break;case "m":b=0;"x"in this.last||
(this._updateBBox(this.last.x=g[0],this.last.y=g[1],l),b=2);for(;b<h;b+=2)this._updateBBox(this.last.x+=g[b],this.last.y+=g[b+1],l);this.absolute=!1;break;case "l":case "t":for(b=0;b<h;b+=2)this._updateBBox(this.last.x+=g[b],this.last.y+=g[b+1],l);this.absolute=!1;break;case "h":for(b=0;b<h;++b)this._updateBBox(this.last.x+=g[b],this.last.y,l);this.absolute=!1;break;case "v":for(b=0;b<h;++b)this._updateBBox(this.last.x,this.last.y+=g[b],l);this.absolute=!1;break;case "c":for(b=0;b<h;b+=6)this._updateBBox(this.last.x+
g[b],this.last.y+g[b+1],l),this._updateBBox(this.last.x+g[b+2],this.last.y+g[b+3],l),this._updateBBox(this.last.x+=g[b+4],this.last.y+=g[b+5],l);this.absolute=!1;break;case "s":case "q":for(b=0;b<h;b+=4)this._updateBBox(this.last.x+g[b],this.last.y+g[b+1],l),this._updateBBox(this.last.x+=g[b+2],this.last.y+=g[b+3],l);this.absolute=!1;break;case "A":for(b=0;b<h;b+=7)this._updateBBox(g[b+5],g[b+6],l);this.last.x=g[h-2];this.last.y=g[h-1];this.absolute=!0;break;case "a":for(b=0;b<h;b+=7)this._updateBBox(this.last.x+=
g[b+5],this.last.y+=g[b+6],l);this.absolute=!1}var n=[c.action];for(b=0;b<h;++b)n.push(f.formatNumber(g[b],!0));if("string"==typeof this.shape.path)this.shape.path+=n.join("");else for(b=0,h=n.length;b<h;++b)this.shape.path.push(n[b])},_validSegments:{m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,z:0},_pushSegment:function(c,f){this.tbbox=null;var g=this._validSegments[c.toLowerCase()];"number"==typeof g&&(g?f.length>=g&&(g={action:c,args:f.slice(0,f.length-f.length%g)},this.segments.push(g),this._updateWithSegment(g)):
(g={action:c,args:[]},this.segments.push(g),this._updateWithSegment(g)))},_collectArgs:function(c,f){for(var g=0;g<f.length;++g){var h=f[g];"boolean"==typeof h?c.push(h?1:0):"number"==typeof h?c.push(h):h instanceof Array?this._collectArgs(c,h):"x"in h&&"y"in h&&c.push(h.x,h.y)}},moveTo:function(){this._confirmSegmented();var c=[];this._collectArgs(c,arguments);this._pushSegment(this.absolute?"M":"m",c);return this},lineTo:function(){this._confirmSegmented();var c=[];this._collectArgs(c,arguments);
this._pushSegment(this.absolute?"L":"l",c);return this},hLineTo:function(){this._confirmSegmented();var c=[];this._collectArgs(c,arguments);this._pushSegment(this.absolute?"H":"h",c);return this},vLineTo:function(){this._confirmSegmented();var c=[];this._collectArgs(c,arguments);this._pushSegment(this.absolute?"V":"v",c);return this},curveTo:function(){this._confirmSegmented();var c=[];this._collectArgs(c,arguments);this._pushSegment(this.absolute?"C":"c",c);return this},smoothCurveTo:function(){this._confirmSegmented();
var c=[];this._collectArgs(c,arguments);this._pushSegment(this.absolute?"S":"s",c);return this},qCurveTo:function(){this._confirmSegmented();var c=[];this._collectArgs(c,arguments);this._pushSegment(this.absolute?"Q":"q",c);return this},qSmoothCurveTo:function(){this._confirmSegmented();var c=[];this._collectArgs(c,arguments);this._pushSegment(this.absolute?"T":"t",c);return this},arcTo:function(){this._confirmSegmented();var c=[];this._collectArgs(c,arguments);this._pushSegment(this.absolute?"A":
"a",c);return this},closePath:function(){this._confirmSegmented();this._pushSegment("Z",[]);return this},_confirmSegmented:function(){if(!this.segmented){var c=this.shape.path;this.shape.path=[];this._setPath(c);this.shape.path=this.shape.path.join("");this.segmented=!0}},_setPath:function(c){c=q.isArray(c)?c:c.match(f.pathSvgRegExp);this.segments=[];this.absolute=!0;this.bbox={};this.last={};if(c){for(var l="",g=[],h=c.length,b=0;b<h;++b){var n=c[b],m=parseFloat(n);isNaN(m)?(l&&this._pushSegment(l,
g),g=[],l=n):g.push(m)}this._pushSegment(l,g)}},setShape:function(c){this.inherited(arguments,["string"==typeof c?{path:c}:c]);this.segmented=!1;this.segments=[];f.lazyPathSegmentation||this._confirmSegmented();return this},_2PI:2*Math.PI});p=p("dojox.gfx.path.TextPath",m,{constructor:function(c){"text"in this||(this.text=q.clone(f.defaultTextPath));"fontStyle"in this||(this.fontStyle=q.clone(f.defaultFont))},getText:function(){return this.text},setText:function(c){this.text=f.makeParameters(this.text,
"string"==typeof c?{text:c}:c);this._setText();return this},getFont:function(){return this.fontStyle},setFont:function(c){this.fontStyle="string"==typeof c?f.splitFontString(c):f.makeParameters(f.defaultFont,c);this._setFont();return this}});return f.path={Path:m,TextPath:p}})},"*noref":1}});
define("dojox/gfx/svg","dojo/_base/lang dojo/_base/sniff dojo/_base/window dojo/dom dojo/_base/declare dojo/_base/array dojo/dom-geometry dojo/dom-attr dojo/_base/Color ./_base ./shape ./path".split(" "),function(f,q,p,t,m,c,l,g,h,b,n,u){function k(d,a){return p.doc.createElementNS?p.doc.createElementNS(d,a):p.doc.createElement(a)}function a(d,a,b,e){return d.setAttributeNS?d.setAttributeNS(a,b,e):d.setAttribute(b,e)}function x(d){return e.useSvgWeb?p.doc.createTextNode(d,!0):p.doc.createTextNode(d)}
var e=b.svg={};e.useSvgWeb="undefined"!=typeof window.svgweb;var z=navigator.userAgent,A=q("ios"),y=q("android"),B=q("chrome")||y&&4<=y?"auto":"optimizeLegibility";e.xmlns={xlink:"http://www.w3.org/1999/xlink",svg:"http://www.w3.org/2000/svg"};e.getRef=function(d){return d&&"none"!=d?d.match(/^url\(#.+\)$/)?t.byId(d.slice(5,-1)):d.match(/^#dojoUnique\d+$/)?t.byId(d.slice(1)):null:null};e.dasharray={solid:"none",shortdash:[4,1],shortdot:[1,1],shortdashdot:[4,1,1,1],shortdashdotdot:[4,1,1,1,1,1],dot:[1,
3],dash:[4,3],longdash:[8,3],dashdot:[4,3,1,3],longdashdot:[8,3,1,3],longdashdotdot:[8,3,1,3,1,3]};var C=0;e.Shape=m("dojox.gfx.svg.Shape",n.Shape,{destroy:function(){if(this.fillStyle&&"type"in this.fillStyle){var d=this.rawNode.getAttribute("fill");(d=e.getRef(d))&&d.parentNode.removeChild(d)}this.clip&&(d=this.rawNode.getAttribute("clip-path"))&&(d=t.byId(d.match(/gfx_clip[\d]+/)[0]))&&d.parentNode.removeChild(d);n.Shape.prototype.destroy.apply(this,arguments)},setFill:function(d){if(!d)return this.fillStyle=
null,this.rawNode.setAttribute("fill","none"),this.rawNode.setAttribute("fill-opacity",0),this;var a,e=function(d){this.setAttribute(d,a[d].toFixed(8))};if("object"==typeof d&&"type"in d){switch(d.type){case "linear":a=b.makeParameters(b.defaultLinearGradient,d);d=this._setFillObject(a,"linearGradient");c.forEach(["x1","y1","x2","y2"],e,d);break;case "radial":a=b.makeParameters(b.defaultRadialGradient,d);d=this._setFillObject(a,"radialGradient");c.forEach(["cx","cy","r"],e,d);break;case "pattern":a=
b.makeParameters(b.defaultPattern,d),d=this._setFillObject(a,"pattern"),c.forEach(["x","y","width","height"],e,d)}this.fillStyle=a;return this}this.fillStyle=a=b.normalizeColor(d);this.rawNode.setAttribute("fill",a.toCss());this.rawNode.setAttribute("fill-opacity",a.a);this.rawNode.setAttribute("fill-rule","evenodd");return this},setStroke:function(d){var a=this.rawNode;if(!d)return this.strokeStyle=null,a.setAttribute("stroke","none"),a.setAttribute("stroke-opacity",0),this;if("string"==typeof d||
f.isArray(d)||d instanceof h)d={color:d};d=this.strokeStyle=b.makeParameters(b.defaultStroke,d);d.color=b.normalizeColor(d.color);if(d){var c=0>d.width?0:d.width;a.setAttribute("stroke",d.color.toCss());a.setAttribute("stroke-opacity",d.color.a);a.setAttribute("stroke-width",c);a.setAttribute("stroke-linecap",d.cap);"number"==typeof d.join?(a.setAttribute("stroke-linejoin","miter"),a.setAttribute("stroke-miterlimit",d.join)):a.setAttribute("stroke-linejoin",d.join);var g=d.style.toLowerCase();g in
e.dasharray&&(g=e.dasharray[g]);if(g instanceof Array){var g=f._toArray(g),r;for(r=0;r<g.length;++r)g[r]*=c;if("butt"!=d.cap){for(r=0;r<g.length;r+=2)g[r]-=c,1>g[r]&&(g[r]=1);for(r=1;r<g.length;r+=2)g[r]+=c}g=g.join(",")}a.setAttribute("stroke-dasharray",g);a.setAttribute("dojoGfxStrokeStyle",d.style)}return this},_getParentSurface:function(){for(var d=this.parent;d&&!(d instanceof b.Surface);d=d.parent);return d},_setFillObject:function(d,c){var f=e.xmlns.svg;this.fillStyle=d;var v=this._getParentSurface().defNode,
g=this.rawNode.getAttribute("fill");if(g=e.getRef(g))if(g.tagName.toLowerCase()!=c.toLowerCase()){var h=g.id;g.parentNode.removeChild(g);g=k(f,c);g.setAttribute("id",h);v.appendChild(g)}else for(;g.childNodes.length;)g.removeChild(g.lastChild);else g=k(f,c),g.setAttribute("id",b._base._getUniqueId()),v.appendChild(g);if("pattern"==c)g.setAttribute("patternUnits","userSpaceOnUse"),f=k(f,"image"),f.setAttribute("x",0),f.setAttribute("y",0),f.setAttribute("width",(0>d.width?0:d.width).toFixed(8)),f.setAttribute("height",
(0>d.height?0:d.height).toFixed(8)),a(f,e.xmlns.xlink,"xlink:href",d.src),g.appendChild(f);else for(g.setAttribute("gradientUnits","userSpaceOnUse"),v=0;v<d.colors.length;++v){var h=d.colors[v],l=k(f,"stop"),m=h.color=b.normalizeColor(h.color);l.setAttribute("offset",h.offset.toFixed(8));l.setAttribute("stop-color",m.toCss());l.setAttribute("stop-opacity",m.a);g.appendChild(l)}this.rawNode.setAttribute("fill","url(#"+g.getAttribute("id")+")");this.rawNode.removeAttribute("fill-opacity");this.rawNode.setAttribute("fill-rule",
"evenodd");return g},_applyTransform:function(){if(this.matrix){var d=this.matrix;this.rawNode.setAttribute("transform","matrix("+d.xx.toFixed(8)+","+d.yx.toFixed(8)+","+d.xy.toFixed(8)+","+d.yy.toFixed(8)+","+d.dx.toFixed(8)+","+d.dy.toFixed(8)+")")}else this.rawNode.removeAttribute("transform");return this},setRawNode:function(d){d=this.rawNode=d;"image"!=this.shape.type&&d.setAttribute("fill","none");d.setAttribute("fill-opacity",0);d.setAttribute("stroke","none");d.setAttribute("stroke-opacity",
0);d.setAttribute("stroke-width",1);d.setAttribute("stroke-linecap","butt");d.setAttribute("stroke-linejoin","miter");d.setAttribute("stroke-miterlimit",4);d.__gfxObject__=this},setShape:function(d){this.shape=b.makeParameters(this.shape,d);for(var a in this.shape)if("type"!=a){d=this.shape[a];if("width"===a||"height"===a)d=0>d?0:d;this.rawNode.setAttribute(a,d)}this.bbox=null;return this},_moveToFront:function(){this.rawNode.parentNode.appendChild(this.rawNode);return this},_moveToBack:function(){this.rawNode.parentNode.insertBefore(this.rawNode,
this.rawNode.parentNode.firstChild);return this},setClip:function(d){this.inherited(arguments);var a=d?"width"in d?"rect":"cx"in d?"ellipse":"points"in d?"polyline":"d"in d?"path":null:null;if(d&&!a)return this;"polyline"===a&&(d=f.clone(d),d.points=d.points.join(","));var b,c=g.get(this.rawNode,"clip-path");c&&(b=t.byId(c.match(/gfx_clip[\d]+/)[0]))&&b.removeChild(b.childNodes[0]);d?(b?(a=k(e.xmlns.svg,a),b.appendChild(a)):(c="gfx_clip"+ ++C,this.rawNode.setAttribute("clip-path","url(#"+c+")"),b=
k(e.xmlns.svg,"clipPath"),a=k(e.xmlns.svg,a),b.appendChild(a),this.rawNode.parentNode.insertBefore(b,this.rawNode),g.set(b,"id",c)),g.set(a,d)):(this.rawNode.removeAttribute("clip-path"),b&&b.parentNode.removeChild(b));return this},_removeClipNode:function(){var a,b=g.get(this.rawNode,"clip-path");b&&(a=t.byId(b.match(/gfx_clip[\d]+/)[0]))&&a.parentNode.removeChild(a);return a}});e.Group=m("dojox.gfx.svg.Group",e.Shape,{constructor:function(){n.Container._init.call(this)},setRawNode:function(a){this.rawNode=
a;this.rawNode.__gfxObject__=this},destroy:function(){this.clear(!0);e.Shape.prototype.destroy.apply(this,arguments)}});e.Group.nodeType="g";e.Rect=m("dojox.gfx.svg.Rect",[e.Shape,n.Rect],{setShape:function(a){this.shape=b.makeParameters(this.shape,a);this.bbox=null;for(var d in this.shape)if("type"!=d&&"r"!=d){a=this.shape[d];if("width"===d||"height"===d)a=0>a?0:a;this.rawNode.setAttribute(d,a)}null!=this.shape.r&&(this.rawNode.setAttribute("ry",this.shape.r),this.rawNode.setAttribute("rx",this.shape.r));
return this}});e.Rect.nodeType="rect";e.Ellipse=m("dojox.gfx.svg.Ellipse",[e.Shape,n.Ellipse],{});e.Ellipse.nodeType="ellipse";e.Circle=m("dojox.gfx.svg.Circle",[e.Shape,n.Circle],{});e.Circle.nodeType="circle";e.Line=m("dojox.gfx.svg.Line",[e.Shape,n.Line],{});e.Line.nodeType="line";e.Polyline=m("dojox.gfx.svg.Polyline",[e.Shape,n.Polyline],{setShape:function(a,e){a&&a instanceof Array?(this.shape=b.makeParameters(this.shape,{points:a}),e&&this.shape.points.length&&this.shape.points.push(this.shape.points[0])):
this.shape=b.makeParameters(this.shape,a);this.bbox=null;this._normalizePoints();for(var d=[],c=this.shape.points,f=0;f<c.length;++f)d.push(c[f].x.toFixed(8),c[f].y.toFixed(8));this.rawNode.setAttribute("points",d.join(" "));return this}});e.Polyline.nodeType="polyline";e.Image=m("dojox.gfx.svg.Image",[e.Shape,n.Image],{setShape:function(d){this.shape=b.makeParameters(this.shape,d);this.bbox=null;d=this.rawNode;for(var c in this.shape)if("type"!=c&&"src"!=c){var f=this.shape[c];if("width"===c||"height"===
c)f=0>f?0:f;d.setAttribute(c,f)}d.setAttribute("preserveAspectRatio","none");a(d,e.xmlns.xlink,"xlink:href",this.shape.src);d.__gfxObject__=this;return this}});e.Image.nodeType="image";e.Text=m("dojox.gfx.svg.Text",[e.Shape,n.Text],{setShape:function(a){this.shape=b.makeParameters(this.shape,a);this.bbox=null;a=this.rawNode;var d=this.shape;a.setAttribute("x",d.x);a.setAttribute("y",d.y);a.setAttribute("text-anchor",d.align);a.setAttribute("text-decoration",d.decoration);a.setAttribute("rotate",d.rotated?
90:0);a.setAttribute("kerning",d.kerning?"auto":0);a.setAttribute("text-rendering",B);a.firstChild?a.firstChild.nodeValue=d.text:a.appendChild(x(d.text));return this},getTextWidth:function(){var a=this.rawNode,b=a.parentNode,a=a.cloneNode(!0);a.style.visibility="hidden";var e=0,c=a.firstChild.nodeValue;b.appendChild(a);if(""!=c)for(;!e;)e=a.getBBox?parseInt(a.getBBox().width):68;b.removeChild(a);return e},getBoundingBox:function(){var a=null;if(this.getShape().text)try{a=this.rawNode.getBBox()}catch(v){a=
{x:0,y:0,width:0,height:0}}return a}});e.Text.nodeType="text";e.Path=m("dojox.gfx.svg.Path",[e.Shape,u.Path],{_updateWithSegment:function(a){this.inherited(arguments);"string"==typeof this.shape.path&&this.rawNode.setAttribute("d",this.shape.path)},setShape:function(a){this.inherited(arguments);this.shape.path?this.rawNode.setAttribute("d",this.shape.path):this.rawNode.removeAttribute("d");return this}});e.Path.nodeType="path";e.TextPath=m("dojox.gfx.svg.TextPath",[e.Shape,u.TextPath],{_updateWithSegment:function(a){this.inherited(arguments);
this._setTextPath()},setShape:function(a){this.inherited(arguments);this._setTextPath();return this},_setTextPath:function(){if("string"==typeof this.shape.path){var d=this.rawNode;if(!d.firstChild){var c=k(e.xmlns.svg,"textPath"),f=x("");c.appendChild(f);d.appendChild(c)}c=(c=d.firstChild.getAttributeNS(e.xmlns.xlink,"href"))&&e.getRef(c);if(!c&&(f=this._getParentSurface())){var f=f.defNode,c=k(e.xmlns.svg,"path"),g=b._base._getUniqueId();c.setAttribute("id",g);f.appendChild(c);a(d.firstChild,e.xmlns.xlink,
"xlink:href","#"+g)}c&&c.setAttribute("d",this.shape.path)}},_setText:function(){var a=this.rawNode;if(!a.firstChild){var b=k(e.xmlns.svg,"textPath"),c=x("");b.appendChild(c);a.appendChild(b)}a=a.firstChild;b=this.text;a.setAttribute("alignment-baseline","middle");switch(b.align){case "middle":a.setAttribute("text-anchor","middle");a.setAttribute("startOffset","50%");break;case "end":a.setAttribute("text-anchor","end");a.setAttribute("startOffset","100%");break;default:a.setAttribute("text-anchor",
"start"),a.setAttribute("startOffset","0%")}a.setAttribute("baseline-shift","0.5ex");a.setAttribute("text-decoration",b.decoration);a.setAttribute("rotate",b.rotated?90:0);a.setAttribute("kerning",b.kerning?"auto":0);a.firstChild.data=b.text}});e.TextPath.nodeType="text";var D=534<function(){var a=/WebKit\/(\d*)/.exec(z);return a?a[1]:0}();e.Surface=m("dojox.gfx.svg.Surface",n.Surface,{constructor:function(){n.Container._init.call(this)},destroy:function(){n.Container.clear.call(this,!0);this.defNode=
null;this.inherited(arguments)},setDimensions:function(a,b){if(!this.rawNode)return this;var d=0>a?0:a,c=0>b?0:b;this.rawNode.setAttribute("width",d);this.rawNode.setAttribute("height",c);D&&(this.rawNode.style.width=d,this.rawNode.style.height=c);return this},getDimensions:function(){return this.rawNode?{width:b.normalizedLength(this.rawNode.getAttribute("width")),height:b.normalizedLength(this.rawNode.getAttribute("height"))}:null}});e.createSurface=function(a,c,f){var d=new e.Surface;d.rawNode=
k(e.xmlns.svg,"svg");d.rawNode.setAttribute("overflow","hidden");c&&d.rawNode.setAttribute("width",0>c?0:c);f&&d.rawNode.setAttribute("height",0>f?0:f);c=k(e.xmlns.svg,"defs");d.rawNode.appendChild(c);d.defNode=c;d._parent=t.byId(a);d._parent.appendChild(d.rawNode);b._base._fixMsTouchAction(d);return d};q={_setFont:function(){var a=this.fontStyle;this.rawNode.setAttribute("font-style",a.style);this.rawNode.setAttribute("font-variant",a.variant);this.rawNode.setAttribute("font-weight",a.weight);this.rawNode.setAttribute("font-size",
a.size);this.rawNode.setAttribute("font-family",a.family)}};var w=n.Container;m=e.Container={openBatch:function(){if(!this._batch){var a;a=e.useSvgWeb?p.doc.createDocumentFragment(!0):p.doc.createDocumentFragment();this.fragment=a}++this._batch;return this},closeBatch:function(){this._batch=0<this._batch?--this._batch:0;this.fragment&&!this._batch&&(this.rawNode.appendChild(this.fragment),delete this.fragment);return this},add:function(a){this!=a.getParent()&&(this.fragment?this.fragment.appendChild(a.rawNode):
this.rawNode.appendChild(a.rawNode),w.add.apply(this,arguments),a.setClip(a.clip));return this},remove:function(a,b){this==a.getParent()&&(this.rawNode==a.rawNode.parentNode&&this.rawNode.removeChild(a.rawNode),this.fragment&&this.fragment==a.rawNode.parentNode&&this.fragment.removeChild(a.rawNode),a._removeClipNode(),w.remove.apply(this,arguments));return this},clear:function(){for(var a=this.rawNode;a.lastChild;)a.removeChild(a.lastChild);var b=this.defNode;if(b){for(;b.lastChild;)b.removeChild(b.lastChild);
a.appendChild(b)}return w.clear.apply(this,arguments)},getBoundingBox:w.getBoundingBox,_moveChildToFront:w._moveChildToFront,_moveChildToBack:w._moveChildToBack};u=e.Creator={createObject:function(a,b){if(!this.rawNode)return null;var d=new a,c=k(e.xmlns.svg,a.nodeType);d.setRawNode(c);d.setShape(b);this.add(d);return d}};f.extend(e.Text,q);f.extend(e.TextPath,q);f.extend(e.Group,m);f.extend(e.Group,n.Creator);f.extend(e.Group,u);f.extend(e.Surface,m);f.extend(e.Surface,n.Creator);f.extend(e.Surface,
u);e.fixTarget=function(a,b){a.gfxTarget||(a.gfxTarget=A&&a.target.wholeText?a.target.parentElement.__gfxObject__:a.target.__gfxObject__);return!0};e.useSvgWeb&&(e.createSurface=function(a,c,f){var d=new e.Surface;c=0>c?0:c;f=0>f?0:f;if(!c||!f){var g=l.position(a);c=c||g.w;f=f||g.h}a=t.byId(a);var g=a.id?a.id+"_svgweb":b._base._getUniqueId(),h=k(e.xmlns.svg,"svg");h.id=g;h.setAttribute("width",c);h.setAttribute("height",f);svgweb.appendChild(h,a);h.addEventListener("SVGLoad",function(){d.rawNode=
this;d.isLoaded=!0;var a=k(e.xmlns.svg,"defs");d.rawNode.appendChild(a);d.defNode=a;if(d.onLoad)d.onLoad(d)},!1);d.isLoaded=!1;return d},e.Surface.extend({destroy:function(){var a=this.rawNode;svgweb.removeChild(a,a.parentNode)}}),q={connect:function(a,b,c){"on"===a.substring(0,2)&&(a=a.substring(2));c=2==arguments.length?b:f.hitch(b,c);this.getEventSource().addEventListener(a,c,!1);return[this,a,c]},disconnect:function(a){this.getEventSource().removeEventListener(a[1],a[2],!1);delete a[0]}},f.extend(e.Shape,
q),f.extend(e.Surface,q));return e});