/*
    *
    * Wijmo Library 5.20173.409
    * http://wijmo.com/
    *
    * Copyright(c) GrapeCity, Inc.  All rights reserved.
    *
    * Licensed under the GrapeCity Commercial License.
    * sales@wijmo.com
    * wijmo.com/products/wijmo-5/license/
    *
    */
System.register(["wijmo/wijmo.chart","wijmo/wijmo","wijmo/wijmo.chart.render"],function(t,e){"use strict";var n,i,o,a,l;e&&e.id;return{setters:[function(t){n=t},function(t){i=t},function(t){o=t}],execute:function(){if(window.wijmo=window.wijmo||{},window.wijmo.chart=window.wijmo.chart||{},window.wijmo.chart.render=o,a=function(){function t(t,e){void 0===e&&(e=!1),this._strokeWidth=1,this._fontSize=null,this._fontFamily=null,this._applyCanvasClip=function(t,e){var n=this._canvasRect[e];n&&(t.beginPath(),t.rect(n.left,n.top,n.width,n.height),t.clip(),t.closePath())},this._applyCanvasStyles=function(t,e,n,i,o){var a,l,r,s=this,p=s._canvas.getContext("2d"),h=s.stroke,f=s.fill,c=s.strokeWidth;e&&void 0!==e.stroke&&(h=e.stroke),e&&void 0!==e.fill&&(f=s._getOpacityColor(e.fill,e["fill-opacity"])),t&&(l=window.getComputedStyle(t),r=t.getBBox()),o?l?(p.fillStyle=l.fill,a=l.fontStyle+" "+l.fontSize+" "+l.fontFamily,p.font=a,p.font.replace(/\"/g,"'")!==a.replace(/\"/g,"'")&&(a=l.fontStyle+" "+l.fontSize+" "+(p.font.split(" ")[1]||"sans-serif"),p.font=a)):s.fontSize?(p.fillStyle=s.textFill,p.font=s.fontSize+" "+(s.fontFamily||"sans-serif")):s._canvasDefaultFont&&(p.fillStyle=s._canvasDefaultFont.textFill,a=s._canvasDefaultFont.fontSize+" "+s._canvasDefaultFont.fontFamily,p.font=a,p.font.replace(/\"/g,"'")!==a.replace(/\"/g,"'")&&(a=s._canvasDefaultFont.fontSize+" "+(p.font.split(" ")[1]||"sans-serif"),p.font=a)):(l&&(h=l.stroke&&"none"!==l.stroke?l.stroke:h,f=l.fill&&"none"!==l.fill?s._getOpacityColor(l.fill,l["fill-opacity"]):f,c=l.strokeWidth?l.strokeWidth:c),"none"!==h&&null!=h&&(this._applyColor("strokeStyle",h,r),p.lineWidth=+c.replace(/px/g,""),p.stroke()),i&&null!=f&&"transparent"!==f&&"none"!==f&&(this._applyColor("fillStyle",f,r),p.fill()))};var i=this;i._element=t,i._canvas=document.createElement("canvas"),i._svgEngine=new n._SvgRenderEngine(t),i._element.appendChild(i._canvas),i._applyCSSStyles=e}return t.prototype.beginRender=function(){var t,e=this,n=e._svgEngine.element,i=e._element;e._applyCSSStyles&&(e._svgEngine.beginRender(),i=n),e._element.appendChild(n),e._canvasRect={},t=window.getComputedStyle(i),e._canvasDefaultFont={fontSize:t.fontSize,fontFamily:t.fontFamily,textFill:t.color}},t.prototype.endRender=function(){this._applyCSSStyles&&this._svgEngine.endRender(),this._svgEngine.element.parentNode.removeChild(this._svgEngine.element)},t.prototype.setViewportSize=function(t,e){var n,i,o=this,a=o._canvas,l=(a.getContext("2d"),o.fill);o._applyCSSStyles&&o._svgEngine.setViewportSize(t,e),a.width=t,a.height=e,n=window.getComputedStyle(o._element).backgroundColor,i=o.stroke,n&&(o.stroke=null,o.fill=n,o.drawRect(0,0,t,e),o.fill=l,o.stroke=i)},Object.defineProperty(t.prototype,"element",{get:function(){return this._canvas},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){this._svgEngine.fill=t,this._fill=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._svgEngine.fontSize=t;var e=null==t||isNaN(t)?t:t+"px";this._fontSize=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this._svgEngine.fontFamily=t,this._fontFamily=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stroke",{get:function(){return this._stroke},set:function(t){this._svgEngine.stroke=t,this._stroke=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"strokeWidth",{get:function(){return this._strokeWidth},set:function(t){this._svgEngine.strokeWidth=t,this._strokeWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textFill",{get:function(){return this._textFill},set:function(t){this._svgEngine.textFill=t,this._textFill=t},enumerable:!0,configurable:!0}),t.prototype.addClipRect=function(t,e){t&&e&&(this._applyCSSStyles&&this._svgEngine.addClipRect(t,e),this._canvasRect[e]=t.clone())},t.prototype.drawEllipse=function(t,e,n,i,o,a){var l,r=this._canvas.getContext("2d");return this._applyCSSStyles&&(l=this._svgEngine.drawEllipse(t,e,n,i,o,a)),r.save(),r.beginPath(),r.ellipse?r.ellipse(t,e,n,i,0,0,2*Math.PI):(r.translate(t,e),r.scale(1,i/n),r.translate(-t,-e),r.arc(t,e,n,0,2*Math.PI),r.scale(1,1)),this._applyCanvasStyles(l,a,o,!0),r.restore(),l},t.prototype.drawRect=function(t,e,n,i,o,a,l){var r,s=this._canvas.getContext("2d");return this._applyCSSStyles&&(r=this._svgEngine.drawRect(t,e,n,i,o,a,l)),s.save(),this._applyCanvasClip(s,l),s.beginPath(),s.rect(t,e,n,i),this._applyCanvasStyles(r,a,o,!0),s.restore(),r},t.prototype.drawLine=function(t,e,n,i,o,a){var l,r=this._canvas.getContext("2d");return this._applyCSSStyles&&(l=this._svgEngine.drawLine(t,e,n,i,o,a)),r.save(),r.beginPath(),r.moveTo(t,e),r.lineTo(n,i),this._applyCanvasStyles(l,a,o),r.restore(),l},t.prototype.drawLines=function(t,e,n,i,o){if(t&&e&&0!==t.length&&0!==e.length){var a,l,r=this._canvas.getContext("2d"),s=Math.min(t.length,e.length);for(this._applyCSSStyles&&(a=this._svgEngine.drawLines([0,1],[1,0],n,i,o)),r.save(),this._applyCanvasClip(r,o),r.beginPath(),r.moveTo(t[0],e[0]),l=1;l<s;l++)r.lineTo(t[l],e[l]);return this._applyCanvasStyles(a,i,n),r.restore(),a}},t.prototype.drawSplines=function(t,e,i,o,a){if(t&&e&&0!==t.length&&0!==e.length){var l,r,s=this._canvas.getContext("2d"),p=new n._Spline(t,e).calculate(),h=p.xs,f=p.ys,c=Math.min(h.length,f.length);for(this._applyCSSStyles&&(l=this._svgEngine.drawSplines([0,1],[1,0],i,o,a)),s.save(),this._applyCanvasClip(s,a),s.beginPath(),s.moveTo(h[0],f[0]),r=1;r<c;r++)s.lineTo(h[r],f[r]);return this._applyCanvasStyles(l,o,i),s.restore(),l}},t.prototype.drawPolygon=function(t,e,n,i,o){if(t&&e&&0!==t.length&&0!==e.length){var a,l,r=this._canvas.getContext("2d"),s=Math.min(t.length,e.length);for(this._applyCSSStyles&&(a=this._svgEngine.drawPolygon(t,e,n,i,o)),r.save(),this._applyCanvasClip(r,o),r.beginPath(),r.moveTo(t[0],e[0]),l=1;l<s;l++)r.lineTo(t[l],e[l]);return r.closePath(),this._applyCanvasStyles(a,i,n,!0),r.restore(),a}},t.prototype.drawPieSegment=function(t,e,n,i,o,a,l,r){var s,p=this._canvas.getContext("2d"),h=i,f=i+o;return this._applyCSSStyles&&(s=this._svgEngine.drawPieSegment(t,e,n,i,o,a,l,r)),p.save(),this._applyCanvasClip(p,r),p.beginPath(),p.moveTo(t,e),p.arc(t,e,n,h,f,!1),p.lineTo(t,e),this._applyCanvasStyles(s,l,a,!0),p.restore(),s},t.prototype.drawDonutSegment=function(t,e,n,o,a,l,r,s,p){var h,f,c,y=this._canvas.getContext("2d"),g=a,u=a+l;return this._applyCSSStyles&&(h=this._svgEngine.drawDonutSegment(t,e,n,o,a,l,r,s,p)),f=new i.Point(t,e),f.x+=o*Math.cos(g),f.y+=o*Math.sin(g),c=new i.Point(t,e),c.x+=o*Math.cos(u),c.y+=o*Math.sin(u),y.save(),this._applyCanvasClip(y,p),y.beginPath(),y.moveTo(f.x,f.y),y.arc(t,e,n,g,u,!1),y.lineTo(c.x,c.y),y.arc(t,e,o,u,g,!0),this._applyCanvasStyles(h,s,r,!0),y.restore(),h},t.prototype.drawString=function(t,e,n,i){var o,a=this._canvas.getContext("2d");return this._applyCSSStyles&&(o=this._svgEngine.drawString(t,e,n,i)),a.save(),a.textBaseline="bottom",this._applyCanvasStyles(o,i,n,!0,!0),a.fillText(t,e.x,e.y),a.restore(),o},t.prototype.drawStringRotated=function(t,e,n,i,o,a){var l,r=this._canvas.getContext("2d");r.measureText(t);return this._applyCSSStyles&&(l=this._svgEngine.drawStringRotated(t,e,n,i,o,a)),r.save(),r.textBaseline="bottom",r.translate(n.x,n.y),r.rotate(Math.PI/180*i),r.translate(-n.x,-n.y),this._applyCanvasStyles(l,a,o,!0,!0),r.fillText(t,e.x,e.y),r.restore(),l},t.prototype.measureString=function(t,e,n,o){var a,l=l=this._canvas.getContext("2d");return this._applyCSSStyles?this._svgEngine.measureString(t,e,n,o):(this._applyCanvasStyles(null,null,e,!0,!0),a=l.measureText(t).width,new i.Size(a,1.5*parseInt(l.font)))},t.prototype.startGroup=function(t,e,n){void 0===n&&(n=!1);var i,o=this._canvas.getContext("2d");return this._applyCSSStyles&&(i=this._svgEngine.startGroup(t,e,n)),o.save(),this._applyCanvasClip(o,e),i},t.prototype.endGroup=function(){this._applyCSSStyles&&this._svgEngine.endGroup(),this._canvas.getContext("2d").restore()},t.prototype.drawImage=function(t,e,n,i,o){var a,l=this._canvas.getContext("2d"),r=new Image;return this._applyCSSStyles&&(a=this._svgEngine.drawImage(t,e,n,i,o)),r.onload=function(){l.drawImage(r,e,n,i,o)},r.src=t,a},t.prototype._getOpacityColor=function(t,e){var n=new i.Color(t);return t.indexOf("url")>-1?this.fill:t.indexOf("-")>-1?(this.fill=t,t):(null!=e&&1===n.a&&(n.a=isNaN(e)?1:Number(e)),n.toString())},t.prototype._applyColor=function(t,e,n){var o=l.tryParse(e),a=this._canvas.getContext("2d");if(null!=o)if(i.isString(o)||null==n)a[t]=o;else{var r;if(null!=o.x1)r=o.relative?a.createLinearGradient(n.x+o.x1*n.width,n.y+o.y1*n.height,n.x+o.x2*n.width,n.y+o.y2*n.height):a.createLinearGradient(o.x1,o.y1,o.x2,o.y2);else if(null!=o.r)if(o.relative){var s=n.x+o.cx*n.width,p=n.y+o.cy*n.height,h=o.r*n.width,f=o.r*n.height/h,c=n.x+(null==o.fx?o.cx:o.fx)*n.width,y=n.y+(null==o.fy?o.cy:o.fy)*n.height,g=(null==o.fr?0:o.fr)*n.width,u=(null==o.fr?0:o.fr)*n.height,v=Math.min(g,u);r=a.createRadialGradient(c,y/f,v,s,p/f,h),a.setTransform(1,0,0,f,0,0)}else r=a.createRadialGradient(null==o.fx?o.cx:o.fx,null==o.fy?o.cy:o.fy,o.fr||0,o.cx,o.cy,o.r);o.colors&&o.colors.length>0&&null!=r&&o.colors.forEach(function(t){var e=new i.Color("#000000");null!=t.color&&(e=t.color),null!=t.opacity&&(e.a=t.opacity),r.addColorStop(t.offset,e.toString())}),a[t]=r}},t}(),t("_CanvasRenderEngine",a),l=function(){function t(){}return t.tryParse=function(e){if(t.parsedColor[e])return t.parsedColor[e];if(null==e||-1===e.indexOf("-"))return e;var n,o=e.replace(/\s+/g,"").split(/\-/g),a=o[0][0],l=!1,r=o[0].match(/\(\S+\)/)[0].replace(/[\(\\)]/g,"").split(/\,/g);"l"===a||"L"===a?(n={x1:"0",y1:"0",x2:"0",y2:"0",colors:[]},"l"===a&&(l=!0),["x1","y1","x2","y2"].forEach(function(t,e){null!=r[e]&&(n[t]=+r[e])})):"r"!==a&&"R"!==a||(n={cx:"0",cy:"0",r:"0",colors:[]},"r"===a&&(l=!0),["cx","cy","r","fx","fy","fr"].forEach(function(t,e){null!=r[e]&&""!==r[e]&&(n[t]=+r[e])})),n.relative=l,t.parsedColor[e]=n;var s=o.length-1;return o.forEach(function(t,e){t.indexOf(")")>-1&&(t=t.match(/\)\S+/)[0].replace(")",""));var o=t.split(":"),a={color:new i.Color("#000000")};null!=o[0]&&(a.color=i.Color.fromString(o[0])),null!=o[1]?a.offset=+o[1]:a.offset=e/s,null!=o[2]&&(a.opacity=+o[2]),n.colors.push(a)}),n},t.parsedColor={},t}(),n.FlexChartBase&&n.FlexChartBase.prototype&&n.FlexChartBase.prototype._exportToImage){var e=n.FlexChartBase.prototype._exportToImage;n.FlexChartBase.prototype._exportToImage=function(t,n){if("svg"!==t){var o,l,r=new a(this.hostElement,!0),s=this.rendered;this.rendered=new i.Event,this._render(r,!1),(l=r.element).parentNode.removeChild(l),o=l.toDataURL("image/"+t),n.call(null,o),l=null,r=null,this.rendered=s}else e.call(this,t,n)}}}}});