jmgraph 3.1.94 → 3.1.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/jmgraph.js CHANGED
@@ -5769,7 +5769,7 @@ var jmImage = /*#__PURE__*/function (_jmControl) {
5769
5769
  try {
5770
5770
  var img = this.getImage();
5771
5771
 
5772
- if (this.graph.isWXMiniApp && this.graph.canvas) {
5772
+ if (this.graph.isWXMiniApp && this.graph.canvas && typeof img === 'string') {
5773
5773
  // 图片对象
5774
5774
  var image = this.graph.canvas.createImage(); // 图片加载完成回调
5775
5775
 
@@ -5791,6 +5791,11 @@ var jmImage = /*#__PURE__*/function (_jmControl) {
5791
5791
  }, {
5792
5792
  key: "drawImg",
5793
5793
  value: function drawImg(img) {
5794
+ if (!img) {
5795
+ console.warn('image is empty');
5796
+ return;
5797
+ }
5798
+
5794
5799
  var bounds = this.parent && this.parent.absoluteBounds ? this.parent.absoluteBounds : this.absoluteBounds;
5795
5800
  if (!bounds) bounds = this.parent && this.parent.getAbsoluteBounds ? this.parent.getAbsoluteBounds() : this.getAbsoluteBounds();
5796
5801
  var p = this.getLocation();
@@ -1 +1 @@
1
- !function(r){var t;t=function(t,e,n){var i=function i(r,o,s){function u(e,t){if(!o[e]){if(!r[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(c)return c(e,!0);throw(n=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",n}n=o[e]={exports:{}},r[e][0].call(n.exports,function(t){return u(r[e][1][t]||t)},n,n.exports,i,r,o,s)}return o[e].exports}for(var c="function"==typeof require&&require,t=0;t<s.length;t++)u(s[t]);return u}({1:[function(t,e,n){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"jmArc",{enumerable:!0,get:function(){return r.jmArc}}),Object.defineProperty(n,"jmArrow",{enumerable:!0,get:function(){return o.jmArrow}}),Object.defineProperty(n,"jmBezier",{enumerable:!0,get:function(){return s.jmBezier}}),Object.defineProperty(n,"jmCircle",{enumerable:!0,get:function(){return u.jmCircle}}),Object.defineProperty(n,"jmHArc",{enumerable:!0,get:function(){return c.jmHArc}}),Object.defineProperty(n,"jmLine",{enumerable:!0,get:function(){return a.jmLine}}),Object.defineProperty(n,"jmPrismatic",{enumerable:!0,get:function(){return f.jmPrismatic}}),Object.defineProperty(n,"jmRect",{enumerable:!0,get:function(){return h.jmRect}}),Object.defineProperty(n,"jmArrowLine",{enumerable:!0,get:function(){return l.jmArrowLine}}),Object.defineProperty(n,"jmImage",{enumerable:!0,get:function(){return p.jmImage}}),Object.defineProperty(n,"jmLabel",{enumerable:!0,get:function(){return y.jmLabel}}),Object.defineProperty(n,"jmResize",{enumerable:!0,get:function(){return d.jmResize}}),Object.defineProperty(n,"jmUtils",{enumerable:!0,get:function(){return m.jmUtils}}),Object.defineProperty(n,"jmList",{enumerable:!0,get:function(){return m.jmList}}),Object.defineProperty(n,"jmShadow",{enumerable:!0,get:function(){return m.jmShadow}}),Object.defineProperty(n,"jmGradient",{enumerable:!0,get:function(){return m.jmGradient}}),Object.defineProperty(n,"jmControl",{enumerable:!0,get:function(){return m.jmControl}}),Object.defineProperty(n,"jmPath",{enumerable:!0,get:function(){return m.jmPath}}),n.create=n.jmGraph=n.default=void 0;var r=t("./src/shapes/jmArc.js"),o=t("./src/shapes/jmArrow.js"),s=t("./src/shapes/jmBezier.js"),u=t("./src/shapes/jmCircle.js"),c=t("./src/shapes/jmHArc.js"),a=t("./src/shapes/jmLine.js"),f=t("./src/shapes/jmPrismatic.js"),h=t("./src/shapes/jmRect.js"),l=t("./src/shapes/jmArrowLine.js"),p=t("./src/shapes/jmImage.js"),y=t("./src/shapes/jmLabel.js"),d=t("./src/shapes/jmResize.js"),m=t("./src/core/jmGraph.js");function v(t,e,n){return(v=j()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);i=new(Function.bind.apply(t,i));return n&&b(i,n.prototype),i}).apply(null,arguments)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function g(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}function j(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function w(t){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var _={arc:r.jmArc,arrow:o.jmArrow,bezier:s.jmBezier,circle:u.jmCircle,harc:c.jmHArc,line:a.jmLine,prismatic:f.jmPrismatic,rect:h.jmRect,arrowline:l.jmArrowLine,image:p.jmImage,img:p.jmImage,label:y.jmLabel,resize:d.jmResize},x=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}(s,m.jmGraph);var n,i,e=(n=s,i=j(),function(){var t,e=w(n);return g(this,i?(t=w(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))});function s(i,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var t=this instanceof s?this.constructor:void 0;return(r=Object.assign({},r)).shapes=Object.assign(_,r.shapes||{}),t&&t.prototype instanceof m.jmGraph?("function"==typeof r&&(o=r,r={}),e.call(this,i,r,o)):g(void 0,new Promise(function(t,e){var n=new s(i,r,o);t&&t(n)}))}return s}();n.jmGraph=n.default=x;n.create=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v(x,e)}},{"./src/core/jmGraph.js":5,"./src/shapes/jmArc.js":12,"./src/shapes/jmArrow.js":13,"./src/shapes/jmArrowLine.js":14,"./src/shapes/jmBezier.js":15,"./src/shapes/jmCircle.js":16,"./src/shapes/jmHArc.js":17,"./src/shapes/jmImage.js":18,"./src/shapes/jmLabel.js":19,"./src/shapes/jmLine.js":20,"./src/shapes/jmPrismatic.js":21,"./src/shapes/jmRect.js":22,"./src/shapes/jmResize.js":23}],2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmControl=n.default=void 0;var p=t("./jmUtils.js"),o=t("./jmList.js"),y=t("./jmGradient.js"),d=t("./jmShadow.js"),s=t("./jmProperty.js");function u(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,e=function(){};return{s:e,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw r}}}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=r(n);return function(t,e){{if(e&&("object"===m(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=r(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(r,s.jmProperty);var t,e,n,i=h(r);function r(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),t=t||{},(n=i.call(this)).__pro("type",e||(this instanceof r?this.constructor:void 0).name),n.style=t&&t.style?t.style:{},n.width=t.width||0,n.height=t.height||0,t.position&&(n.position=t.position),n.graph=t.graph||null,n.zIndex=t.zIndex||0,n.interactive=void 0===t.interactive||t.interactive,n.jmStyleMap={fill:"fillStyle",stroke:"strokeStyle","shadow.blur":"shadowBlur","shadow.x":"shadowOffsetX","shadow.y":"shadowOffsetY","shadow.color":"shadowColor",lineWidth:"lineWidth",miterLimit:"miterLimit",fillStyle:"fillStyle",strokeStyle:"strokeStyle",font:"font",opacity:"globalAlpha",textAlign:"textAlign",textBaseline:"textBaseline",shadowBlur:"shadowBlur",shadowOffsetX:"shadowOffsetX",shadowOffsetY:"shadowOffsetY",shadowColor:"shadowColor",lineJoin:"lineJoin",lineCap:"lineCap"},n.initializing(),n.on=n.bind,n.option=t,n}return t=r,(e=[{key:"type",get:function(){return this.__pro("type")}},{key:"context",get:function(){var t=this.__pro("context");if(t)return t;if(this.is("jmGraph")&&this.canvas&&this.canvas.getContext)return this.context=this.canvas.getContext("2d");t=this.graph;return t?t.context:t.canvas.getContext("2d")},set:function(t){return this.__pro("context",t)}},{key:"style",get:function(){return this.__pro("style")||this.__pro("style",{})},set:function(t){return this.needUpdate=!0,this.__pro("style",t)}},{key:"visible",get:function(){var t=this.__pro("visible");return t=void 0===t?this.__pro("visible",!0):t},set:function(t){return this.needUpdate=!0,this.__pro("visible",t)}},{key:"interactive",get:function(){return this.__pro("interactive")},set:function(t){return this.__pro("interactive",t)}},{key:"children",get:function(){return this.__pro("children")||this.__pro("children",new o.jmList)},set:function(t){return this.needUpdate=!0,this.__pro("children",t)}},{key:"width",get:function(){var t=this.__pro("width");return t=void 0===t?this.__pro("width",0):t},set:function(t){return this.needUpdate=!0,this.__pro("width",t)}},{key:"height",get:function(){var t=this.__pro("height");return t=void 0===t?this.__pro("height",0):t},set:function(t){return this.needUpdate=!0,this.__pro("height",t)}},{key:"zIndex",get:function(){return this.__pro("zIndex")||this.__pro("zIndex",0)},set:function(t){return this.needUpdate=!0,this.__pro("zIndex",t),this.children.sort(),this.needUpdate=!0,t}},{key:"cursor",get:function(){var t=this.graph;if(t)return t.css("cursor")},set:function(t){var e=this.graph;e&&e.css("cursor",t)}},{key:"initializing",value:function(){var e=this;this.children=this.children||new o.jmList;var n=this.children.add;this.children.add=function(t){if("object"===m(t))return t.parent&&t.parent!=e&&t.parent.children&&t.parent.children.remove(t),t.parent=e,this.contain(t)&&this.oremove(t),n.call(this,t),t.emit("add",t),e.needUpdate=!0,e.graph&&(t.graph=e.graph),this.sort(),t},this.children.oremove=this.children.remove,this.children.remove=function(t){"object"===m(t)&&(t.parent=null,t.graph=null,t.remove(!0),this.oremove(t),e.needUpdate=!0)},this.children.sort=function(){var t,i={};for(t in this.each(function(t,e){var n;e&&(!(n=e.zIndex)&&e.style&&e.style.zIndex&&(n=Number(e.style.zIndex),isNaN(n)&&(n=e.style.zIndex||0)),(i[n]||(i[n]=[])).push(e))}),this.splice(0,this.length),i)n.call(this,i[t])},this.children.clear=function(){this.each(function(t,e){this.remove(e)},!0)},this.needUpdate=!0}},{key:"setStyle",value:function(t){var h=this;if(t=t||p.jmUtils.clone(this.style,!0)){var e,n,l=this.graph.devicePixelRatio,i=function t(e,n,i){if(e){if("function"==typeof e)try{e=e.call(h)}catch(t){return void console.warn(t)}var r=m(e),i=h.jmStyleMap[i||n];if(e instanceof y.jmGradient||"string"==r&&-1<e.indexOf("-gradient"))t((e="string"==r&&-1<e.indexOf("-gradient")?new y.jmGradient(e):e).toGradient(h),i||n);else if("function"==r)i&&(e=e.call(h,i))&&t(e,i);else if(i){if("string"==r&&-1<["fillStyle","strokeStyle","shadowColor"].indexOf(i)&&(e=p.jmUtils.toColor(e)),l&&e)switch(i){case"lineWidth":e*=l;break;case"fontSize":case"font":var o,s=e.toString().match(/[\d\.]+/);s&&s.length&&(o=Number(s[0])*l,e=e.toString().replace(s[0],o))}h.context[i]=e}else switch(n){case"shadow":if("string"==r){t(new d.jmShadow(e),n);break}for(var u in e)t(e[u],u,n+"."+u);break;case"translate":h.context.translate(e.x,e.y);break;case"rotation":if(!e.angle)break;var c,a=0,f=0;e.point&&(c=h.absoluteBounds||h.getAbsoluteBounds(),a=(e=h.getRotation(e)).rotateX+c.left,f=e.rotateY+c.top),0==a&&0==f||h.context.translate(a,f),h.context.rotate(e.angle),0==a&&0==f||h.context.translate(-a,-f);break;case"transform":Array.isArray(e)?h.context.transform.apply(h.context,e):"object"==m(e)&&h.context.transform(e.scaleX,e.skewX,e.skewY,e.scaleY,e.offsetX,e.offsetY);break;case"cursor":h.cursor=e}}};for(e in this.translate&&i(this.translate,"translate"),this.transform&&i(this.transform,"transform"),t)"constructor"!==e&&("string"==(n=m(t[e]))&&-1<t[e].indexOf("-gradient")?t[e]=new y.jmGradient(t[e]):"string"==n&&"shadow"==e&&(t[e]=new d.jmShadow(t[e])),i(t[e],e))}}},{key:"getBounds",value:function(t){if(this.bounds&&!t)return this.bounds;var e={};if("jmGraph"==this.type&&this.canvas)"function"==typeof this.canvas.width?e.right=this.canvas.width():this.canvas.width?e.right=this.canvas.width:this.width&&(e.right=this.width),"function"==typeof this.canvas.height?e.bottom=this.canvas.height():this.canvas.height?e.bottom=this.canvas.height:this.height&&(e.bottom=this.height);else if(this.points&&0<this.points.length)for(var n in this.points){n=this.points[n];(void 0===e.left||e.left>n.x)&&(e.left=n.x),(void 0===e.top||e.top>n.y)&&(e.top=n.y),(void 0===e.right||e.right<n.x)&&(e.right=n.x),(void 0===e.bottom||e.bottom<n.y)&&(e.bottom=n.y)}else!this.getLocation||(t=this.getLocation())&&(e.left=t.left,e.top=t.top,e.right=t.left+t.width,e.bottom=t.top+t.height);return e.left||(e.left=0),e.top||(e.top=0),e.right||(e.right=0),e.bottom||(e.bottom=0),e.width=e.right-e.left,e.height=e.bottom-e.top,this.bounds=e}},{key:"getLocation",value:function(){var t=this.location={left:0,top:0,width:0,height:0};t.position="function"==typeof this.position?this.position():p.jmUtils.clone(this.position),t.center=this.center&&"function"==typeof this.center?this.center():p.jmUtils.clone(this.center),t.start=this.start&&"function"==typeof this.start?this.start():p.jmUtils.clone(this.start),t.end=this.end&&"function"==typeof this.end?this.end():p.jmUtils.clone(this.end),t.radius=this.radius,t.width=this.width,t.height=this.height;var e=p.jmUtils.clone(this.style.margin,{});if(e.left=(e.left||0)*this.graph.devicePixelRatio,e.top=(e.top||0)*this.graph.devicePixelRatio,e.right=(e.right||0)*this.graph.devicePixelRatio,e.bottom=(e.bottom||0)*this.graph.devicePixelRatio,t.position?(t.left=t.position.x,t.top=t.position.y):(t.left=e.left,t.top=e.top),!this.parent)return t;e=this.parent.getBounds();return p.jmUtils.checkPercent(t.left)&&(t.left=p.jmUtils.percentToNumber(t.left)*e.width),p.jmUtils.checkPercent(t.top)&&(t.top=p.jmUtils.percentToNumber(t.top)*e.height),p.jmUtils.checkPercent(t.width)&&(t.width=p.jmUtils.percentToNumber(t.width)*e.width),p.jmUtils.checkPercent(t.height)&&(t.height=p.jmUtils.percentToNumber(t.height)*e.height),t.center&&(p.jmUtils.checkPercent(t.center.x)&&(t.center.x=p.jmUtils.percentToNumber(t.center.x)*e.width),p.jmUtils.checkPercent(t.center.y)&&(t.center.y=p.jmUtils.percentToNumber(t.center.y)*e.height)),t.radius&&p.jmUtils.checkPercent(t.radius)&&(t.radius=p.jmUtils.percentToNumber(t.radius)*Math.min(e.width,e.height)),t}},{key:"getRotation",value:function(t){var e;return(t=t||this.style.rotation)?(e=this.getBounds(),t.rotateX=t.point.x,p.jmUtils.checkPercent(t.rotateX)&&(t.rotateX=p.jmUtils.percentToNumber(t.rotateX)*e.width),t.rotateY=t.point.y,p.jmUtils.checkPercent(t.rotateY)&&(t.rotateY=p.jmUtils.percentToNumber(t.rotateY)*e.height)):(t=this.parent&&this.parent.getRotation?this.parent.getRotation():null)&&(e=this.getBounds(),t.rotateX-=e.left,t.rotateY-=e.top),t}},{key:"remove",value:function(){this.parent&&this.parent.children.remove(this)}},{key:"offset",value:function(t,e,n,i){n=!1!==n;var r=this.getLocation(!0),o=!1;if(r.position&&(r.left+=t,r.top+=e,this.position.x=r.left,this.position.y=r.top,o=!0),r.center&&(this.center.x=r.center.x+t,this.center.y=r.center.y+e,o=!0),r.start&&"object"==m(r.start)&&(this.start.x=r.start.x+t,this.start.y=r.start.y+e,o=!0),r.end&&"object"==m(r.end)&&(this.end.x=r.end.x+t,this.end.y=r.end.y+e,o=!0),0==o&&this.cpoints){var s=(this.cpoints,this.cpoints);if(s){for(var u=s.length,c=0;c<u;c++)s[c].x+=t,s[c].y+=e;o=!0}}if(0==o&&this.points){for(var a=this.points.length,f=0;f<a;f++)this.points[f].x+=t,this.points[f].y+=e;o=!0}this.emit("move",{offsetX:t,offsetY:e,trans:n,evt:i}),this.needUpdate=!0}},{key:"rotate",value:function(t,e){this.style.rotation={angle:t,point:e},this.needUpdate=!0}},{key:"getAbsoluteBounds",value:function(){var t=this.getBounds();if(this.parent&&this.parent.absoluteBounds){var e=this.parent.absoluteBounds||this.parent.getAbsoluteBounds();return{left:e.left+t.left,top:e.top+t.top,right:e.left+t.right,bottom:e.top+t.bottom,width:t.width,height:t.height}}return t}},{key:"beginDraw",value:function(){this.getLocation(!0),this.context.beginPath()}},{key:"endDraw",value:function(){this.style.close&&this.context.closePath(),this.style.fill&&this.context.fill(),!this.style.stroke&&this.style.fill||this.context.stroke(),this.needUpdate=!1}},{key:"draw",value:function(){if(this.points&&0<this.points.length){var t=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds;this.context.moveTo(this.points[0].x+t.left,this.points[0].y+t.top);for(var e=this.points.length,n=1;n<e;n++){var i=this.points[n];i.m?this.context.moveTo(i.x+t.left,i.y+t.top):this.context.lineTo(i.x+t.left,i.y+t.top)}}}},{key:"paint",value:function(t){!1!==t&&!1!==this.visible&&(this.initPoints&&this.initPoints(),this.bounds=null,this.absoluteBounds=this.getAbsoluteBounds(),t=!0,!this.is("jmGraph")&&this.graph&&(this.absoluteBounds.left>=this.graph.width||this.absoluteBounds.top>=this.graph.height||this.absoluteBounds.right<=0||this.absoluteBounds.bottom<=0)&&(t=!1),this.context.save(),this.emit("beginDraw",this),this.setStyle(),t&&this.beginDraw&&this.beginDraw(),t&&this.draw&&this.draw(),t&&this.endDraw&&this.endDraw(),this.children&&this.children.each(function(t,e){e&&e.paint&&e.paint()}),this.emit("endDraw",this),this.context.restore(),this.is("jmGraph")&&this.context.draw&&this.context.draw(),this.needUpdate=!1)}},{key:"getEvent",value:function(t){return this.__events?this.__events[t]:null}},{key:"bind",value:function(t,e){if(t&&-1<t.indexOf(" ")){var n,i=u(t=t.split(" "));try{for(i.s();!(n=i.n()).done;){var r=n.value;r&&this.bind(r,e)}}catch(t){i.e(t)}finally{i.f()}}else{t=this.getEvent(t)||function(t,e){return this.__events||(this.__events={}),this.__events[t]=e}.call(this,t,new o.jmList);t.contain(e)||t.add(e)}}},{key:"unbind",value:function(t,e){if(t&&-1<t.indexOf(" ")){var n,i=u(t=t.split(" "));try{for(i.s();!(n=i.n()).done;){var r=n.value;r&&this.unbind(r,e)}}catch(t){i.e(t)}finally{i.f()}}else{t=this.getEvent(t);t&&(e?t.remove(e):t.clear())}}},{key:"emit",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.runEventHandle(e[0],e.slice(1)),this}},{key:"runEventHandle",value:function(t,n){var i,t=this.getEvent(t);return t&&(i=this,Array.isArray(n)||(n=[n]),t.each(function(t,e){!1===e.apply(i,n)&&(n.cancel=!0)})),n.cancel}},{key:"checkPoint",value:function(t,e){if("jmGraph"==this.type){var n=this.getPosition(),i=n.left+(this.canvas.clientWidth||this.canvas.offsetWidth||this.canvas.width),r=n.top+(this.canvas.clientHeight||this.canvas.offsetHeight||this.canvas.height);return t.pageX>i||t.pageX<n.left?!1:!(t.pageY>r||t.pageY<n.top)}var r=this.getBounds(),n=this.getRotation(),o=this.points;if(o&&o.length||((o=[]).push({x:r.left,y:r.top}),o.push({x:r.right,y:r.top}),o.push({x:r.right,y:r.bottom}),o.push({x:r.left,y:r.bottom}),o.push({x:r.left,y:r.top})),e=Number(e||this.style.touchPadding||this.style.lineWidth||1),o&&o.length){if(n&&0!=n.angle&&(o=p.jmUtils.clone(o,!0),o=p.jmUtils.rotatePoints(o,{x:n.rotateX+r.left,y:n.rotateY+r.top},n.angle)),2<o.length&&(!this.style.fill||this.style.stroke)){for(var s=0,u=o.length,c=s+1;c<=u;c=++s+1)if(c==u){if(this.style.close)if(p.jmUtils.pointInPolygon(t,[o[s],o[0]],e))return!0}else if(p.jmUtils.pointInPolygon(t,[o[s],o[c]],e))return!0;if(!this.style.fill)return!1}return p.jmUtils.pointInPolygon(t,o,e)}return!(t.x>r.right||t.x<r.left)&&!(t.y>r.bottom||t.y<r.top)}},{key:"raiseEvent",value:function(n,i){if(!1!==this.visible){var t,e;i.position||(t=this.graph,o=i.srcElement||i.target,e=p.jmUtils.getEventPosition(i,t.scaleSize),0<t.devicePixelRatio&&(e.x=e.offsetX=e.x*t.devicePixelRatio,e.y=e.offsetY=e.y*t.devicePixelRatio),i={position:e,button:0==i.button||e.isTouch?1:i.button,keyCode:i.keyCode||i.charCode||i.which,ctrlKey:i.ctrlKey,cancel:!1,event:i,srcElement:o}),i.path=i.path||[];var r=!1;if(this.children&&this.children.each(function(t,e){if(!0!==i.cancel&&(r=!1===e.raiseEvent(n,i)||r))return!1},!0),r)return!1;var o=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds;if(!o)return!1;i.position.x=i.position.offsetX-o.left,i.position.y=i.position.offsetY-o.top;o=!1!==this.interactive&&this.checkPoint(i.position);return o?(i.target||(i.target=this),this.runEventAndPopEvent(n,i),this.focused||"mousemove"!==n&&"touchmove"!==n||(this.focused=!0,this.raiseEvent("mousemove"===n?"mouseover":"touchover",i))):!1===this.interactive||o||!this.focused||"mousemove"!==n&&"touchmove"!==n||(this.focused=!1,this.runEventHandle("mousemove"===n?"mouseleave":"touchleave",i)),!1===i.cancel}}},{key:"runEventAndPopEvent",value:function(t,e){!0!==e.cancel&&(e.path.push(this),this.runEventHandle(t,e))}},{key:"clearEvents",value:function(t){t=this.getEvent(t);t&&t.clear}},{key:"findParent",value:function(t){if("string"==typeof t){if(this.type==t)return this}else if(this.is(t))return this;return this.parent?this.parent.findParent(t):null}},{key:"canMove",value:function(t,e){var s;return this.__mvMonitor||(this.__mvMonitor={},this.__mvMonitor.mouseDown=!1,this.__mvMonitor.curposition={x:0,y:0},(s=this).__mvMonitor.mv=function(t){var e=s;if(e.__mvMonitor.mouseDown){e.parent.bounds=null;var n,i=e.parent.getAbsoluteBounds(),r=t.position.offsetX-e.__mvMonitor.curposition.x,o=t.position.offsetY-e.__mvMonitor.curposition.y;return e.lockSide&&(n=e.bounds||e.getAbsoluteBounds(),(n=p.jmUtils.checkOutSide(i,n,{x:r,y:o})).left<0?e.lockSide.left&&(r-=n.left):0<n.right&&e.lockSide.right&&(r-=n.right),n.top<0?e.lockSide.top&&(o-=n.top):0<n.bottom&&e.lockSide.bottom&&(o-=n.bottom)),(r||o)&&(e.offset(r,o,!0,t),e.__mvMonitor.curposition.x=t.position.offsetX,e.__mvMonitor.curposition.y=t.position.offsetY),!1}},this.__mvMonitor.mu=function(t){var e=s;e.__mvMonitor.mouseDown&&(e.__mvMonitor.mouseDown=!1,e.emit("moveend",{position:e.__mvMonitor.curposition}))},this.__mvMonitor.ml=function(){var t=s;if(t.__mvMonitor.mouseDown)return t.__mvMonitor.mouseDown=!1,t.emit("moveend",{position:t.__mvMonitor.curposition}),!1},this.__mvMonitor.md=function(t){if(!this.__mvMonitor.mouseDown)return 0==t.button||1==t.button?(this.__mvMonitor.mouseDown=!0,this.__mvMonitor.curposition.x=t.position.offsetX,this.__mvMonitor.curposition.y=t.position.offsetY,this.emit("movestart",{position:this.__mvMonitor.curposition}),!(t.cancel=!0)):void 0}),e=e||this.graph,!1!==t?(e.bind("mousemove",this.__mvMonitor.mv),e.bind("mouseup",this.__mvMonitor.mu),e.bind("mouseleave",this.__mvMonitor.ml),this.bind("mousedown",this.__mvMonitor.md),e.bind("touchmove",this.__mvMonitor.mv),e.bind("touchend",this.__mvMonitor.mu),this.bind("touchstart",this.__mvMonitor.md)):(e.unbind("mousemove",this.__mvMonitor.mv),e.unbind("mouseup",this.__mvMonitor.mu),e.unbind("mouseleave",this.__mvMonitor.ml),this.unbind("mousedown",this.__mvMonitor.md),e.unbind("touchmove",this.__mvMonitor.mv),e.unbind("touchend",this.__mvMonitor.mu),this.unbind("touchstart",this.__mvMonitor.md)),this}}])&&a(t.prototype,e),n&&a(t,n),r}();n.jmControl=n.default=t},{"./jmGradient.js":4,"./jmList.js":6,"./jmProperty.js":9,"./jmShadow.js":10,"./jmUtils.js":11}],3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmEvents=n.default=void 0;var o=t("./jmUtils.js");function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}t=function(){function n(t,e){r(this,n),this.container=t,this.target=e||t,this.mouseHandler=new c(this,t,e),this.keyHandler=new a(this,t,e)}return u(n,[{key:"touchStart",value:function(t){if((t=t||window.event).eventName="touchstart",this.container.raiseEvent("touchstart",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchMove",value:function(t){if((t=t||window.event).eventName="touchmove",this.container.raiseEvent("touchmove",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchEnd",value:function(t){if((t=t||window.event).eventName="touchend",this.container.raiseEvent("touchend",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchCancel",value:function(t){if((t=t||window.event).eventName="touchcancel",this.container.raiseEvent("touchcancel",t),(t.target||t.srcElement)==this.target)return!1}},{key:"destroy",value:function(){this.mouseHandler.destroy(),this.keyHandler.destroy()}}]),n}();n.jmEvents=n.default=t;var c=function(){function i(t,e,n){r(this,i),this.instance=t,this.container=e,this.target=n||e,this.eventEvents={},this.init(t,e,n)}return u(i,[{key:"init",value:function(e,n,t){var i=this.target,r=void 0!==("undefined"==typeof document?"undefined":s(document))?document:null;this.eventEvents.mousedown=o.jmUtils.bindEvent(this.target,"mousedown",function(t){(t=t||window.event).eventName="mousedown";n.raiseEvent("mousedown",t)}),this.eventEvents.mousedown=o.jmUtils.bindEvent(this.target,"mousemove",function(t){if((t=t||window.event).eventName="mousemove",(t.target||t.srcElement)==i){n.raiseEvent("mousemove",t);return t.preventDefault&&t.preventDefault(),!1}}),this.eventEvents.mousedown=o.jmUtils.bindEvent(this.target,"mouseover",function(t){(t=t||window.event).eventName="mouseover",n.raiseEvent("mouseover",t)}),this.eventEvents.mouseleave=o.jmUtils.bindEvent(this.target,"mouseleave",function(t){(t=t||window.event).eventName="mouseleave",n.raiseEvent("mouseleave",t)}),this.eventEvents.mouseout=o.jmUtils.bindEvent(this.target,"mouseout",function(t){(t=t||window.event).eventName="mouseout",n.raiseEvent("mouseout",t)}),r&&(this.eventEvents.mouseup=o.jmUtils.bindEvent(r,"mouseup",function(t){if(!((t=t||window.event).eventName="mouseup")===n.raiseEvent("mouseup",t))return t.preventDefault&&t.preventDefault(),!1})),this.eventEvents.dblclick=o.jmUtils.bindEvent(this.target,"dblclick",function(t){(t=t||window.event).eventName="dblclick",n.raiseEvent("dblclick",t)}),this.eventEvents.click=o.jmUtils.bindEvent(this.target,"click",function(t){(t=t||window.event).eventName="click",n.raiseEvent("click",t)}),r&&(this.eventEvents.resize=o.jmUtils.bindEvent(r,"resize",function(t){return(t=t||window.event).eventName="resize",n.raiseEvent("resize",t)})),this.eventEvents.touchstart=o.jmUtils.bindEvent(this.target,"touchstart",function(t){return t.eventName="touchstart",e.touchStart(t)},{passive:!1}),this.eventEvents.touchmove=o.jmUtils.bindEvent(this.target,"touchmove",function(t){return t.eventName="touchmove",e.touchMove(t)},{passive:!1}),r&&(this.eventEvents.touchend=o.jmUtils.bindEvent(r,"touchend",function(t){return t.eventName="touchend",e.touchEnd(t)},{passive:!1})),r&&(this.eventEvents.touchcancel=o.jmUtils.bindEvent(r,"touchcancel",function(t){return t.eventName="touchcancel",e.touchCancel(t)},{passive:!1}))}},{key:"destroy",value:function(){for(var t in this.eventEvents){var e=this.eventEvents[t];e&&e.fun&&o.jmUtils.removeEvent(e.target,t,e.fun)}}}]),i}(),a=function(){function i(t,e,n){r(this,i),this.instance=t,this.container=e,this.target=n||e,this.eventEvents={},this.init(e,n)}return u(i,[{key:"init",value:function(n,t){function i(t){return!(t=t.srcElement||t.target)||"INPUT"!=t.tagName&&"TEXTAREA"!=t.tagName&&"ANCHOR"!=t.tagName&&"FORM"!=t.tagName&&"FILE"!=t.tagName&&"IMG"!=t.tagName&&"HIDDEN"!=t.tagName&&"RADIO"!=t.tagName&&"TEXT"!=t.tagName}var e=void 0!==("undefined"==typeof document?"undefined":s(document))?document:null;e&&(this.eventEvents.keypress=o.jmUtils.bindEvent(e,"keypress",function(t){if(t=t||window.event,i(t)){var e=n.raiseEvent("keypress",t);return!1===e&&t.preventDefault&&t.preventDefault(),e}})),e&&(this.eventEvents.keydown=o.jmUtils.bindEvent(e,"keydown",function(t){if(t=t||window.event,i(t)){var e=n.raiseEvent("keydown",t);return!1===e&&t.preventDefault&&t.preventDefault(),e}})),e&&(this.eventEvents.keyup=o.jmUtils.bindEvent(e,"keyup",function(t){if(t=t||window.event,i(t)){var e=n.raiseEvent("keyup",t);return!1===e&&t.preventDefault&&t.preventDefault(),e}}))}},{key:"destroy",value:function(){for(var t in this.eventEvents){var e=this.eventEvents[t];e&&e.fun&&o.jmUtils.removeEvent(e.target,t,e.fun)}}}]),i}()},{"./jmUtils.js":11}],4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmGradient=n.default=void 0;var a=t("./jmUtils.js"),r=t("./jmList.js");function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}t=function(){function n(t){if(!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.stops=new r.jmList,t&&"object"==o(t))for(var e in t)this[e]=t[e];else"string"==typeof t&&this.fromString(t)}var t,e,i;return t=n,(e=[{key:"addStop",value:function(t,e){this.stops.add({offset:Number(t),color:e})}},{key:"toGradient",value:function(t){var i,e=t.context||t,n=t.absoluteBounds||t.getAbsoluteBounds(),r=this.x1||0,o=this.y1||0,s=this.x2,u=this.y2,c=t.getLocation(),t=0,t=(t=c.radius?2*c.radius:t)||Math.min(c.width,c.height);a.jmUtils.checkPercent(r)&&(r=a.jmUtils.percentToNumber(r)*(n.width||t)),a.jmUtils.checkPercent(s)&&(s=a.jmUtils.percentToNumber(s)*(n.width||t)),a.jmUtils.checkPercent(o)&&(o=a.jmUtils.percentToNumber(o)*(n.height||t)),a.jmUtils.checkPercent(u)&&(u=a.jmUtils.percentToNumber(u)*(n.height||t));c=Number(r)+n.left,r=Number(o)+n.top,o=Number(s)+n.left,s=Number(u)+n.top;return"linear"===this.type?i=e.createLinearGradient(c,r,o,s):"radial"===this.type&&(u=this.r1||0,n=this.r2,a.jmUtils.checkPercent(u)&&(u=a.jmUtils.percentToNumber(u),u*=t),a.jmUtils.checkPercent(n)&&(n=a.jmUtils.percentToNumber(n),n*=t),i=e.createCircularGradient?e.createCircularGradient(c,r,n):e.createRadialGradient(c,r,u,o,s,n)),this.stops.each(function(t,e){var n=a.jmUtils.toColor(e.color);i.addColorStop(e.offset,n)}),i}},{key:"fromString",value:function(t){if(t){var e=t.match(/(linear|radial)-gradient\s*\(\s*([^,]+)\s*,\s*((.|\s)+)\)/i);if(e&&!(e.length<3)){this.type=e[1].toLowerCase();t=a.jmUtils.trim(e[2]).split(/\s+/);"linear"==this.type?t.length<=2?(this.x2=t[0],this.y2=t[1]||0):(this.x1=t[0],this.y1=t[1],this.x2=t[2],this.y2=t[3]):t.length<=3?(this.x2=t[0],this.y2=t[1]||0,this.r2=t[2]||0):(this.x1=t[0],this.y1=t[1],this.r1=t[2],this.x2=t[3],this.y2=t[3],this.r2=t[3]);var n=e[3].match(/((rgb(a)?\s*\([\d,\.\s]+\))|(#[a-zA-Z\d]+))\s+([\d\.]+)/gi);if(n&&n.length)for(var i=0;i<n.length;i++){var r,o=a.jmUtils.trim(n[i]),s=o.lastIndexOf(" ");-1<s&&(r=Number(o.substr(s+1)),s=a.jmUtils.trim(o.substr(0,s)),!isNaN(r)&&s&&this.addStop(r,s))}}}}},{key:"toString",value:function(){var n=this.type+"-gradient(";return"linear"==this.type?n+=this.x1+" "+this.y1+" "+this.x2+" "+this.y2:n+=this.x1+" "+this.y1+" "+this.r1+" "+this.x2+" "+this.y2+" "+this.r2,this.stops.each(function(t,e){n+=","+e.color+" "+e.offset}),n+")"}}])&&s(t.prototype,e),i&&s(t,i),n}();n.jmGradient=n.default=t},{"./jmList.js":6,"./jmUtils.js":11}],5:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"jmUtils",{enumerable:!0,get:function(){return s.jmUtils}}),Object.defineProperty(n,"jmList",{enumerable:!0,get:function(){return i.jmList}}),Object.defineProperty(n,"jmProperty",{enumerable:!0,get:function(){return o.jmProperty}}),Object.defineProperty(n,"jmShadow",{enumerable:!0,get:function(){return u.jmShadow}}),Object.defineProperty(n,"jmGradient",{enumerable:!0,get:function(){return c.jmGradient}}),Object.defineProperty(n,"jmEvents",{enumerable:!0,get:function(){return a.jmEvents}}),Object.defineProperty(n,"jmControl",{enumerable:!0,get:function(){return f.jmControl}}),Object.defineProperty(n,"jmPath",{enumerable:!0,get:function(){return h.jmPath}}),n.jmGraph=n.default=void 0;var s=t("./jmUtils.js"),i=t("./jmList.js"),o=t("./jmProperty.js"),u=t("./jmShadow.js"),c=t("./jmGradient.js"),a=t("./jmEvents.js"),f=t("./jmControl.js"),h=t("./jmPath.js");function l(t,e,n){return(l=m()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);i=new(Function.bind.apply(t,i));return n&&y(i,n.prototype),i}).apply(null,arguments)}function p(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(n){var i=m();return function(){var t,e=v(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=v(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(o,f.jmControl);var t,e,n,r=d(o);function o(t,e,n){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),"function"==typeof e&&(n=e,e={}),(e=e||{}).mode=e.mode||"2d",e.interactive=!0,(i=r.call(this,e,"jmGraph")).option=e||{},i.devicePixelRatio=1,i.util=i.utils=s.jmUtils,"undefined"!=typeof wx&&wx.canIUse&&wx.canIUse("canvas")?("string"==typeof t&&(t=wx.createSelectorQuery().select("#"+t)),i.isWXMiniApp=!0):("string"==typeof t&&"undefined"!=typeof document?t=document.getElementById(t):t.length&&(t=t[0]),"CANVAS"!=t.tagName?(i.container=t,e=document.createElement("canvas"),t.appendChild(e),e.width=t.offsetWidth||t.clientWidth,e.height=t.offsetHeight||t.clientHeight,t=e):i.container=t.parentElement),i.canvas=t,i.context=t.getContext("2d"),i.__init(n),i}return t=o,n=[{key:"create",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return l(o,e)}}],(e=[{key:"__init",value:function(t){this.shapes=Object.assign({path:h.jmPath},this.option.shapes),this.on("beginDraw",function(){this.context.translate(.5,.5)}),this.on("endDraw",function(){this.context.translate(-.5,-.5)}),0<this.option.width&&(this.width=this.option.width),0<this.option.height&&(this.height=this.option.height),this.resize(),this.eventHandler=new a.jmEvents(this,this.canvas.canvas||this.canvas),this.option.autoRefresh&&this.autoRefresh(),t&&t(this)}},{key:"resize",value:function(t,e){var n="undefined"!=typeof window&&1<window.devicePixelRatio?window.devicePixelRatio:1;this.isWXMiniApp?wx.getSystemInfoSync().pixelRatio:1<n&&(this.__normalSize=this.__normalSize||{width:0,height:0},t=t||this.__normalSize.width||this.width,e=e||this.__normalSize.height||this.height,t&&(this.__normalSize.width=t),e&&(this.__normalSize.height=e),this.canvas.style&&(this.canvas.style.width=t+"px"),this.canvas.style&&(this.canvas.style.height=e+"px"),this.canvas.height=e*n,this.canvas.width=t*n,this.context.scale(n,n),this.devicePixelRatio=n)}},{key:"pointToPixes",value:function(t){return t=this.devicePixelRatio&&1!==this.devicePixelRatio?Object.assign({},t,{x:t.x/this.devicePixelRatio,y:t.y/this.devicePixelRatio}):t}},{key:"width",get:function(){return this.canvas?this.canvas.width:0},set:function(t){return this.needUpdate=!0,this.canvas&&(this.canvas.width=t,this.resize(t)),t}},{key:"height",get:function(){return this.canvas?this.canvas.height:0},set:function(t){return this.needUpdate=!0,this.canvas&&(this.canvas.height=t,this.resize(0,t)),t}},{key:"getPosition",value:function(){var t=s.jmUtils.getElementPosition(this.canvas.canvas||this.canvas);return t.width=this.canvas.width,t.height=this.canvas.height,t.right=t.left+t.width,t.bottom=t.top+t.height,t}},{key:"registerShape",value:function(t,e){this.shapes[t]=e}},{key:"createShape",value:function(t,e){if(t="string"==typeof t?this.shapes[t]:t)return(e=e||{}).graph=this,new t(e)}},{key:"createShadow",value:function(t,e,n,i){return new u.jmShadow(t,e,n,i)}},{key:"createLinearGradient",value:function(t,e,n,i){return new c.jmGradient({type:"linear",x1:t,y1:e,x2:n,y2:i})}},{key:"createRadialGradient",value:function(t,e,n,i,r,o){return new c.jmGradient({type:"radial",x1:t,y1:e,r1:n,x2:i,y2:r,r2:o})}},{key:"refresh",value:function(){this.redraw()}},{key:"redraw",value:function(t,e){this.clear(t||this.width,e||this.height),this.paint()}},{key:"clear",value:function(t,e){t&&e?(this.canvas.width=t,this.canvas.height=e,this.scaleSize&&this.context.scale&&this.context.scale(this.scaleSize.x,this.scaleSize.y)):(t=this.canvas.width,e=this.canvas.height,this.scaleSize&&(t/=this.scaleSize.x,e/=this.scaleSize.y)),this.style&&this.style.fill?this.points=[{x:0,y:0},{x:t,y:0},{x:t,y:e},{x:0,y:e}]:this.context.clearRect&&this.context.clearRect(0,0,t,e)}},{key:"css",value:function(t,e){if(this.canvas&&this.canvas.style)return void 0!==e&&(this.canvas.style[t]=e),this.canvas.style[t]}},{key:"createPath",value:function(t,e){return this.createShape("path",{points:t,style:e})}},{key:"createLine",value:function(t,e,n){return this.createShape("line",{start:t,end:e,style:n})}},{key:"zoomOut",value:function(){this.scale(.9,.9)}},{key:"zoomIn",value:function(){this.scale(1.1,1.1)}},{key:"zoomActual",value:function(){this.scaleSize?this.scale(1/this.scaleSize.x,1/this.scaleSize.y):this.scale(1,1)}},{key:"scale",value:function(t,e){this.normalSize||(this.normalSize={width:this.canvas.width,height:this.canvas.height}),this.context.scale(t,e),this.scaleSize?this.scaleSize={x:t*this.scaleSize.x,y:e*this.scaleSize.y}:this.scaleSize={x:t,y:e},this.refresh()}},{key:"toDataURL",value:function(){return this.canvas.toDataURL?this.canvas.toDataURL():""}},{key:"autoRefresh",value:function(e){if(!this.___isAutoRefreshing){var n=this;return this.___isAutoRefreshing=!0,n.__requestAnimationFrameFunHandler&&s.jmUtils.cancelAnimationFrame(n.__requestAnimationFrameFunHandler),n.__requestAnimationFrameFunHandler=s.jmUtils.requestAnimationFrame(function t(){n.destroyed?n.___isAutoRefreshing=!1:(n.needUpdate&&n.redraw(),n.__requestAnimationFrameFunHandler&&s.jmUtils.cancelAnimationFrame(n.__requestAnimationFrameFunHandler),n.__requestAnimationFrameFunHandler=s.jmUtils.requestAnimationFrame(t),e&&e())}),this}}},{key:"destroy",value:function(){this.eventHandler.destroy(),this.destroyed=!0}}])&&p(t.prototype,e),n&&p(t,n),o}();n.jmGraph=n.default=t},{"./jmControl.js":2,"./jmEvents.js":3,"./jmGradient.js":4,"./jmList.js":6,"./jmPath.js":8,"./jmProperty.js":9,"./jmShadow.js":10,"./jmUtils.js":11}],6:[function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function a(t,e){if(e&&("object"===o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}function f(t){var n="function"==typeof Map?new Map:void 0;return function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return i(t,arguments,p(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),l(e,t)}(t)}function i(t,e,n){return(i=h()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);i=new(Function.bind.apply(t,i));return n&&l(i,n.prototype),i}).apply(null,arguments)}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmList=n.default=void 0;var r=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(u,f(Array));var n,i,t,e,r,s=(n=u,i=h(),function(){var t,e=p(n);return a(this,i?(t=p(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))});function u(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);for(var e=[],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];if(i&&i.length&&Array.isArray(i[0])){for(var o=0;o<i[0].length;o++)e.push(i[0][o]);t=s.call.apply(s,[this].concat(e))}else t=s.call(this);return t.option={},t.type="jmList",a(t)}return t=u,(e=[{key:"add",value:function(t){if(t&&Array.isArray(t)){for(var e=0;e<t.length;e++)this.includes(t[e])||this.push(t[e]);return t}return"object"==o(t)&&this.includes(t)||this.push(t),t}},{key:"remove",value:function(t){for(var e=this.length-1;0<=e;e--)this[e]==t&&this.removeAt(e)}},{key:"removeAt",value:function(t){var e;this.length>t&&(e=this[t],this.splice(t,1),this.option.removeHandler&&this.option.removeHandler.call(this,e,t))}},{key:"contain",value:function(t){return this.includes(t)}},{key:"get",value:function(t){return"function"==typeof t?this.find(t):this[t]}},{key:"each",value:function(t,e){if(t&&"function"==typeof t)if(e){for(var n=this.length-1;0<=n;n--)if(!1===t.call(this,n,this[n]))break}else for(var i=this.length,r=0;r<i;r++)if(!1===t.call(this,r,this[r]))break}},{key:"count",value:function(t){if(t&&"function"==typeof t){for(var e=0,n=this.length,i=0;i<n;i++)t(this[i])&&e++;return e}return this.length}},{key:"clear",value:function(){this.splice(0,this.length)}}])&&c(t.prototype,e),r&&c(t,r),u}();n.jmList=n.default=r},{}],7:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmObject=n.default=void 0;var r=t("./jmList.js");function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Symbol("jmchart#animate#counter");t=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t&&"jmGraph"==t.type&&(this.graph=t)}var t,n,i;return t=e,(n=[{key:"is",value:function(t){return"string"==typeof t?this.type==t:this instanceof t}},{key:"animate",value:function(){if(this.is("jmGraph")){if(1<arguments.length){this.animateHandles||(this.animateHandles=new r.jmList);var t=[];if(2<arguments.length)for(var e=2;e<arguments.length;e++)t.push(e<0||arguments.length<=e?void 0:arguments[e]);this.animateHandles.add({millisec:(arguments.length<=1?void 0:arguments[1])||20,handle:arguments.length<=0?void 0:arguments[0],params:t})}var o;this.animateHandles&&0<this.animateHandles.count()&&((o=this).dispatcher=setTimeout(function(n){n=n||o;var t,i=[],r=(new Date).getTime();for(t in n.animateHandles.each(function(t,e){try{e&&e.handle&&(!e.times||r-e.times>=e.millisec)&&(!1===e.handle.apply(n,e.params)&&i.push(e),e.times=r)}catch(t){window.console&&window.console.info&&window.console.info(t.toString()),e&&i.push(e)}}),i)n.animateHandles.remove(i[t]);n.animate()},10,this))}else{var n=this.graph;n&&n.animate.apply(n,arguments)}}}])&&o(t.prototype,n),i&&o(t,i),e}();n.jmObject=n.default=t},{"./jmList.js":6}],8:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmPath=n.default=void 0;var o=t("./jmControl.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmControl);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmPath";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t,e)).points=t&&t.points?t.points:[],e}return t=r,(e=[{key:"points",get:function(){return this.__pro("points")},set:function(t){return this.needUpdate=!0,this.__pro("points",t)}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmPath=n.default=t},{"./jmControl.js":2}],9:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmProperty=n.default=void 0;var o=t("./jmObject.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=Symbol("properties"),t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmObject);var t,e,n,i=c(r);function r(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this))[f]={},t}return t=r,(e=[{key:"__pro",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(e){var i=this[f],r=e[0];if(1<e.length){var o=e[1],o={oldValue:i[r],newValue:o};return i[r]=e[1],this.emit&&this.emit("propertyChange",r,o),e[1]}if(1==e.length)return i[r]}}},{key:"needUpdate",get:function(){return this.__pro("needUpdate")},set:function(t){this.__pro("needUpdate",t),t&&!this.is("jmGraph")&&this.graph&&(this.graph.needUpdate=!0)}},{key:"graph",get:function(){return this.__pro("graph")||this.__pro("graph",this.findParent("jmGraph"))},set:function(t){return this.__pro("graph",t)}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmProperty=n.default=t},{"./jmObject.js":7}],10:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmShadow=n.default=void 0;var i=t("./jmUtils.js");function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}n.jmShadow=n.default=function(){function r(t,e,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),"string"!=typeof t||e||n||i?(this.x=t,this.y=e,this.blur=n,this.color=i):this.fromString(t)}var t,e,n;return t=r,(e=[{key:"fromString",value:function(t){if(t){t=t.match(/\s*([^,]+)\s*,\s*([^,]+)\s*(,[^,]+)?\s*(,[\s\S]+)?\s*/i);return t&&(this.x=t[1]||0,this.y=t[2]||0,t[3]&&(t[3]=i.jmUtils.trim(t[3],", "),0===t[3].indexOf("#")||/^rgb/i.test(t[3])?this.color=t[3]:this.blur=i.jmUtils.trim(t[3],", ")),t[4]&&(this.color=i.jmUtils.trim(t[4],", "))),this}}},{key:"toString",value:function(){var t=this.x+","+this.y;return this.blur&&(t+=","+this.blur),this.color&&(t+=","+this.color),t}}])&&o(t.prototype,e),n&&o(t,n),r}()},{"./jmUtils.js":11}],11:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmUtils=n.default=void 0;var a=t("./jmList.js");function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}t=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,i,r,o;function s(t){return r.apply(this,arguments)}function u(t){return o.apply(this,arguments)}return e=t,n=null,i=[{key:"clone",value:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0;if("function"==typeof i){var o=i(t,n,r);if(o)return o}if("boolean"==typeof e&&(n=e,e=void 0),100<++r)return e;if(t&&"object"===f(t)){if(e=e||{},this.isType(t,a.jmList))return new a.jmList(t);if(Array.isArray(t)){if(n){for(var s=[],u=0;u<t.length;u++)s.push(this.clone(t[u],e[u],n,i,r));return s}return t.slice(0)}for(var c in t.__proto__&&(e.__proto__=t.__proto__),t)"constructor"!==c&&("object"!==f(e[c])&&void 0!==e[c]||(e[c]=this.clone(t[c],e[c],n,i,r)));return e}return void 0!==e?e:t}},{key:"bindEvent",value:function(t,e,n,i){if(e&&e.indexOf&&-1!=e.indexOf(" "))for(var r=e.split(" "),o=0;o<r.length;o++)this.bindEvent(t,r[o],n,i);return t.attachEvent?t.attachEvent("on"+e,n,i):t.addEventListener&&t.addEventListener(e,n,i),{name:e,target:t,fun:n}}},{key:"removeEvent",value:function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent?(t.detachEvent("on"+e,n),!0):void(t["on"+e]=null)}},{key:"getElementPosition",value:function(t){var e={top:0,left:0};if(!t)return e;if(t.offsetParent)for(;t.offsetParent;)e.top+=t.offsetTop,e.left+=t.offsetLeft,t=t.offsetParent;else t.x?e.left+=t.x:t.x&&(e.top+=t.y);return e}},{key:"getEventPosition",value:function(t,e){var n=!1,i=(t=t||event).changedTouches||t.targetTouches||t.touches,r=t.target||t.srcElement;i&&i.length&&((t=i[0]).target||(t.target=r),n=!0);var o=t.pageX||t.x;void 0===o&&(o=t.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));var s=t.pageY||t.y;void 0===s&&(s=t.clientY+(document.documentElement.scrollTop||document.body.scrollTop));var u=t.offsetX,c=t.offsetY;return void 0===u&&void 0===c&&(u=o-(r=this.getElementPosition(r)).left,c=s-r.top),e&&(e.x&&(u/=e.x),e.y&&(c/=e.y)),{pageX:o,pageY:s,clientX:t.clientX,clientY:t.clientY,offsetX:u,offsetY:c,layerX:t.layerX,layerY:t.layerY,screenX:t.screenX,screenY:t.screenY,x:u,y:c,isTouch:n,touches:i}}},{key:"isType",value:function(t,e){return!(!t||"object"!==f(t))&&t.constructor===e}},{key:"pointInPolygon",value:function(t,e,n){n=n||1,n/=2;var i,r,o=e.length,s=!1,u=!0;if(!e||0==o)return 0;if(1==o)return Math.abs(e[0].x-t.x)<=n&&Math.abs(e[0].y-t.y)<=n;if(2==o){if(Math.min(e[0].x,e[1].x)-t.x>n||t.x-Math.max(e[0].x,e[1].x)>n)return 0;if(Math.min(e[0].y,e[1].y)-t.y>n||t.y-Math.max(e[0].y,e[1].y)>n)return 0;if(e[0].x==e[1].x)return Math.abs(e[0].x-t.x)<=n&&(t.y-e[0].y)*(t.y-e[1].y)<=0?1:0;if(e[0].y==e[1].y)return Math.abs(e[0].y-t.y)<=n&&(t.x-e[0].x)*(t.x-e[1].x)<=0?1:0;if(Math.abs(e[0].x-t.x)<n&&Math.abs(e[0].y-t.y)<n)return 1;if(Math.abs(e[1].x-t.x)<n&&Math.abs(e[1].y-t.y)<n)return 1;if(t.y==e[0].y||t.y==e[1].y)return 0;var c=(e[1].x-e[0].x)/(e[1].y-e[0].y)*(t.y-e[0].y),c=(t.y-e[0].y)/Math.sqrt(c*c+(t.y-e[0].y)*(t.y-e[0].y))*(t.x-e[0].x-c);return Math.abs(c)<=n?1:0}for(i=0;i<o;++i)if(e[i].x==t.x&&e[i].y==t.y)return 1;for(;u;)for(s=u=!1,i=0,r=o-1;i<o;r=i++)if(e[i].y<t.y&&t.y<e[r].y||e[r].y<t.y&&t.y<e[i].y){if(t.x<=e[i].x||t.x<=e[r].x){var a=(t.y-e[i].y)*(e[r].x-e[i].x)/(e[r].y-e[i].y)+e[i].x;if(t.x<a)s=!s;else if(t.x==a)return 1}}else if(t.y==e[i].y){if(t.x<e[i].x){e[i].y>e[r].y?--t.y:++t.y,u=!0;break}}else if(e[i].y==e[r].y&&t.y==e[i].y&&(e[i].x<t.x&&t.x<e[r].x||e[r].x<t.x&&t.x<e[i].x)){s=!0;break}return s?2:0}},{key:"checkOutSide",value:function(t,e,n){var i={left:0,right:0,top:0,bottom:0};return n.x<0?i.left=e.left+n.x-t.left:0<n.x&&(i.right=e.right+n.x-t.right),n.y<0?i.top=e.top+n.y-t.top:0<n.y&&(i.bottom=e.bottom+n.y-t.bottom),i}},{key:"rotatePoints",value:function(t,e,n){if(!n||!t)return t;var i=Math.cos(n),r=Math.sin(n);if(t.length)for(var o,s,u=0;u<t.length;u++)t[u]&&(o=t[u].x-e.x,s=t[u].y-e.y,t[u].x=o*i-s*r+e.x,t[u].y=o*r+s*i+e.y);else{var c=t.x-e.x,n=t.y-e.y;t.x=c*i-n*r+e.x,t.y=c*r+n*i+e.y}return t}},{key:"trimStart",value:function(t,e){if(e=e||" ",t&&0<t.length){var n=t[0];if(n===e||0<=e.indexOf(n))return t=t.substring(1),this.trimStart(t,e)}return t}},{key:"trimEnd",value:function(t,e){if(e=e||" ",t&&0<t.length){var n=t[t.length-1];if(n===e||0<=e.indexOf(n))return t=t.substring(0,t.length-1),this.trimStart(t,e)}return t}},{key:"trim",value:function(t,e){return this.trimEnd(this.trimStart(t,e),e)}},{key:"checkPercent",value:function(t){if("string"==typeof t&&"%"==(t=this.trim(t))[t.length-1])return t}},{key:"percentToNumber",value:function(t){var e;return"string"!=typeof t||(e=this.checkPercent(t))&&(t=this.trim(e,"% "),t/=100),t}},{key:"hexToNumber",value:function(t){if("string"!=typeof t)return t;for(var e=0,n=(t=t.toLowerCase()).length,i=0;i<n;i++){var r="0123456789abcdef".indexOf(t[i]);if(0!=r){for(var o=1;o<n-i;o++)r*=16;e+=r}}return e}},{key:"numberToHex",value:function(t){for(var e="";0<t;){e="0123456789abcdef"[t%16]+e;t=Math.floor(t/16)}return e}},{key:"hexToRGBA",value:function(t){if("#"==(t=this.trim(t))[0]){var e={a:1};if(8<=t.length)return e.a=t.substr(1,2),e.g=t.substr(5,2),e.b=t.substr(7,2),e.r=t.substr(3,2),e.a=(this.hexToNumber(e.a)/255).toFixed(4),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),e;if(7===t.length||4===t.length)return 4===t.length?(e.g=t.substr(2,1),e.g=e.g+e.g,e.b=t.substr(3,1),e.b=e.b+e.b,e.r=t.substr(1,1),e.r=e.r+e.r):(e.g=t.substr(3,2),e.b=t.substr(5,2),e.r=t.substr(1,2)),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),e;if(5===t.length)return e.a=t.substr(1,1),e.g=t.substr(3,1),e.b=t.substr(4,1),e.r=t.substr(2,1),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),e.a=(this.hexToNumber(e.a)/255).toFixed(4),e}return t}},{key:"toColor",value:function(t,e,n,i){if("string"==typeof t&&t){if("#"===(t=this.trim(t))[0]&&(4===t.length||7===t.length))return t;var r=this.hexToRGBA(t);if("string"==typeof r)return r;t=r.r||t,e=r.g||e,n=r.b||n,i=r.a||i}return void 0!==t&&void 0!==e&&void 0!==n?void 0!==i?"rgba("+t+","+e+","+n+","+i+")":"rgb("+t+","+e+","+n+")":t}},{key:"requestAnimationFrame",value:(o=function(t){return"undefined"==typeof requestAnimationFrame?setTimeout(t,20):requestAnimationFrame(t)},u.toString=function(){return o.toString()},u)},{key:"cancelAnimationFrame",value:(r=function(t){return("undefined"==typeof requestAnimationFrame?clearTimeout:cancelAnimationFrame)(t)},s.toString=function(){return r.toString()},s)}],n&&c(e.prototype,n),i&&c(e,i),t}();n.jmUtils=n.default=t},{"./jmList.js":6}],12:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmArc=n.default=void 0;var o=t("../core/jmPath.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmArc";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t=t||{},e)).center=t.center||{x:0,y:0},e.radius=t.radius||0,e.startAngle=t.start||t.startAngle||0,e.endAngle=t.end||t.endAngle||2*Math.PI,e.anticlockwise=t.anticlockwise||0,e.isFan=!!t.isFan,e}return t=r,(e=[{key:"center",get:function(){return this.__pro("center")},set:function(t){return this.needUpdate=!0,this.__pro("center",t)}},{key:"radius",get:function(){return this.__pro("radius")},set:function(t){return this.needUpdate=!0,this.__pro("radius",t)}},{key:"startAngle",get:function(){return this.__pro("startAngle")},set:function(t){return this.needUpdate=!0,this.__pro("startAngle",t)}},{key:"endAngle",get:function(){return this.__pro("endAngle")},set:function(t){return this.needUpdate=!0,this.__pro("endAngle",t)}},{key:"anticlockwise",get:function(){return this.__pro("anticlockwise")},set:function(t){return this.needUpdate=!0,this.__pro("anticlockwise",t)}},{key:"initPoints",value:function(){var t=this.getLocation(),e=0,n=0,i=t.center.x,r=t.center.y;t.radius?e=n=t.radius:(e=t.width/2,n=t.height/2);var o=this.startAngle,s=this.endAngle;if((0!=e||0!=n)&&o!=s){var u=this.anticlockwise;this.points=[];var c=1/Math.max(e,n);u&&(o=(u=2*Math.PI)-o,s=u-s),s<o&&(c=-c),this.isFan&&this.points.push(t.center);for(var a=o;;a+=c){(0<c&&s<a||c<0&&a<s)&&(a=s);var f={x:Math.cos(a)*e+i,y:Math.sin(a)*n+r};if(this.points.push(f),a==s)break}return this.points}}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmArc=n.default=t},{"../core/jmPath.js":8}],13:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmArrow=n.default=void 0;var o=t("../core/jmPath.js"),c=t("../core/jmUtils.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=f(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=f(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=a(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmArrow";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t,e)).style.lineJoin="miter",e.style.lineCap="square",e.angle=t.angle||0,e.start=t.start||{x:0,y:0},e.end=t.end||{x:0,y:0},e.offsetX=t.offsetX||5,e.offsetY=t.offsetY||8,e}return t=r,(e=[{key:"start",get:function(){return this.__pro("start")},set:function(t){return this.needUpdate=!0,this.__pro("start",t)}},{key:"end",get:function(){return this.__pro("end")},set:function(t){return this.needUpdate=!0,this.__pro("end",t)}},{key:"angle",get:function(){return this.__pro("angle")},set:function(t){return this.needUpdate=!0,this.__pro("angle",t)}},{key:"offsetX",get:function(){return this.__pro("offsetX")},set:function(t){return this.needUpdate=!0,this.__pro("offsetX",t)}},{key:"offsetY",get:function(){return this.__pro("offsetY")},set:function(t){return this.needUpdate=!0,this.__pro("offsetY",t)}},{key:"initPoints",value:function(t){var e=this.angle,n=this.start,i=this.end;if(i){e=e||Math.atan2(i.y-n.y,i.x-n.x),this.points=[];var r=this.offsetX,o=this.offsetY,s=Math.atan2(r,o),u=e+s,n=Math.sin(u),u=Math.cos(u),r=Math.sqrt(r*r+o*o),o={x:i.x-u*r,y:i.y-n*r},s=e-s,n=Math.sin(s),u=Math.cos(s),n={x:i.x-u*r,y:i.y-n*r},r=c.jmUtils.clone(i);return r.m=!0,this.points.push(r),this.points.push(o),t||this.style.fill?(this.points.push(n),this.points.push(i)):(this.points.push(r),this.points.push(n)),this.points}}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmArrow=n.default=t},{"../core/jmPath.js":8,"../core/jmUtils.js":11}],14:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmArrowLine=n.default=void 0;var o=t("./jmLine.js"),s=t("./jmArrow.js");function u(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function c(t,e,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){t=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(t){e=Object.getOwnPropertyDescriptor(t,e);return e.get?e.get.call(n):e.value}})(t,e,n||t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=h(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=h(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(r,o.jmLine);var t,e,n,i=f(r);function r(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),t.start=t.start||{x:0,y:0},t.end=t.end||{x:0,y:0},(e=i.call(this,t,e||"jmArrowLine")).style.lineJoin=e.style.lineJoin||"miter",e.arrow=new s.jmArrow(t),e}return t=r,(e=[{key:"initPoints",value:function(){return this.points=c(h(r.prototype),"initPoints",this).call(this),!1!==this.arrowVisible&&(this.points=this.points.concat(this.arrow.initPoints())),this.points}}])&&u(t.prototype,e),n&&u(t,n),r}();n.jmArrowLine=n.default=t},{"./jmArrow.js":13,"./jmLine.js":20}],15:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmBezier=n.default=void 0;var o=t("../core/jmPath.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmBezier";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),t.style&&!0!==typeof t.style.close&&(t.style.close=!1),(e=i.call(this,t,e)).cpoints=t.points||[],e}return t=r,(e=[{key:"cpoints",get:function(){return this.__pro("cpoints")},set:function(t){return this.needUpdate=!0,this.__pro("cpoints",t)}},{key:"initPoints",value:function(){this.points=[];for(var t=this.cpoints,e=0;e<=1;e+=.01){var n=this.getPoint(t,e);this.points.push(n)}return this.points.push(t[t.length-1]),this.points}},{key:"getPoint",value:function(t,e){if(1==t.length)return t[0];if(2==t.length){var n={};return n.x=(t[1].x-t[0].x)*e+t[0].x,n.y=(t[1].y-t[0].y)*e+t[0].y,n}if(2<t.length){for(var i=[],r=0;r<t.length-1;r++){var o=this.getPoint([t[r],t[r+1]],e);o&&i.push(o)}return this.getPoint(i,e)}}},{key:"offset",value:function(t,e,n){var i=this.cpoints;if(i){for(var r=i.length,o=0;o<r;o++)i[o].x+=t,i[o].y+=e;this.emit("move",{offsetX:t,offsetY:e,trans:n}),this.getLocation(!0)}}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmBezier=n.default=t},{"../core/jmPath.js":8}],16:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmCircle=n.default=void 0;var o=t("./jmArc.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmArc);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmCircle";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),i.call(this,t,e)}return t=r,(e=[{key:"initPoints",value:function(){var t=this.getLocation();t.radius||(t.radius=Math.min(t.width,t.height)/2),this.points=[],this.points.push({x:t.center.x-t.radius,y:t.center.y-t.radius}),this.points.push({x:t.center.x+t.radius,y:t.center.y-t.radius}),this.points.push({x:t.center.x+t.radius,y:t.center.y+t.radius}),this.points.push({x:t.center.x-t.radius,y:t.center.y+t.radius})}},{key:"draw",value:function(){var t=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds,e=this.getLocation();e.radius||(e.radius=Math.min(e.width,e.height)/2);var n=this.startAngle,i=this.endAngle,r=this.anticlockwise;this.context.arc(e.center.x+t.left,e.center.y+t.top,e.radius,n,i,r)}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmCircle=n.default=t},{"./jmArc.js":12}],17:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmHArc=n.default=void 0;var o=t("./jmArc.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmArc);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmHArc";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t,e)).minRadius=t.minRadius||e.style.minRadius||0,e.maxRadius=t.maxRadius||e.style.maxRadius||0,e}return t=r,(e=[{key:"minRadius",get:function(){return this.__pro("minRadius")},set:function(t){return this.needUpdate=!0,this.__pro("minRadius",t)}},{key:"maxRadius",get:function(){return this.__pro("maxRadius")},set:function(t){return this.needUpdate=!0,this.__pro("maxRadius",t)}},{key:"initPoints",value:function(){var t,e=this.getLocation(),n=this.minRadius,i=this.maxRadius,r=this.startAngle,o=this.endAngle;this.anticlockwise&&(r=(t=2*Math.PI)-r,o=t-o);var s=.1;o<r&&(s=-s);for(var u=[],c=[],a=r;;a+=s){(0<s&&o<a||s<0&&a<o)&&(a=o);var f=Math.cos(a),h=Math.sin(a),l={x:f*n+e.center.x,y:h*n+e.center.y},h={x:f*i+e.center.x,y:h*i+e.center.y};if(u.push(l),c.push(h),a===o)break}c.reverse(),this.style&&this.style.close||(c[0].m=!0),this.points=u.concat(c)}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmHArc=n.default=t},{"./jmArc.js":12}],18:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmImage=n.default=void 0;var o=t("../core/jmControl.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmControl);var t,e,n,i=c(r);function r(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t=t||{},e||"jmImage")).style.fill=e.fill||"transparent",e.sourceWidth=t.sourceWidth,e.sourceHeight=t.sourceHeight,e.sourcePosition=t.sourcePosition,e.image=t.image||e.style.image,e}return t=r,(e=[{key:"sourcePosition",get:function(){return this.__pro("sourcePosition")},set:function(t){return this.__pro("sourcePosition",t)}},{key:"sourceWidth",get:function(){return this.__pro("sourceWidth")},set:function(t){return this.needUpdate=!0,this.__pro("sourceWidth",t)}},{key:"sourceHeight",get:function(){return this.__pro("sourceHeight")},set:function(t){return this.needUpdate=!0,this.__pro("sourceHeight",t)}},{key:"image",get:function(){return this.__pro("image")},set:function(t){return this.needUpdate=!0,this.__pro("image",t)}},{key:"draw",value:function(){var t=this;try{var e,n=this.getImage();this.graph.isWXMiniApp&&this.graph.canvas?((e=this.graph.canvas.createImage()).onload=function(){t.drawImg(e)},e.src=n):this.drawImg(n)}catch(t){console.error&&console.error(t)}}},{key:"drawImg",value:function(t){var e=(e=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds)||(this.parent&&this.parent.getAbsoluteBounds?this.parent:this).getAbsoluteBounds(),n=this.getLocation();n.left+=e.left,n.top+=e.top;var i=this.sourcePosition,r=this.sourceWidth,e=this.sourceHeight;i||void 0!==r||void 0!==e?(void 0===r&&(r=n.width||t.width||0),void 0===e&&(e=n.height||t.height||0),i=i||{x:0,y:0},n.width&&n.height?this.context.drawImage(t,i.x,i.y,r,e,n.left,n.top,n.width,n.height):n.width?this.context.drawImage(t,i.x,i.y,r,e,n.left,n.top,n.width,e):n.height?this.context.drawImage(t,i.x,i.y,r,e,n.left,n.top,r,n.height):this.context.drawImage(t,i.x,i.y,r,e,n.left,n.top,r,e)):n?n.width&&n.height?this.context.drawImage(t,n.left,n.top,n.width,n.height):n.width?this.context.drawImage(t,n.left,n.top,n.width,t.height):n.height?this.context.drawImage(t,n.left,n.top,t.width,n.height):this.context.drawImage(t,n.left,n.top):this.context.drawImage(t)}},{key:"getBounds",value:function(){var t={},e=this.getImage(),n=this.getLocation(),i=n.width||e.width,e=n.height||e.height;return t.left=n.left,t.top=n.top,t.right=n.left+i,t.bottom=n.top+e,t.width=i,t.height=e,t}},{key:"getImage",value:function(){var t=this.image||this.style.src||this.style.image;return this.__img&&this.__img.src&&-1!=this.__img.src.indexOf(t)||((!t||!t.src)&&"undefined"!=typeof document&&document.createElement?(this.__img=document.createElement("img"),t&&"string"==typeof t&&(this.__img.src=t)):this.__img=t),this.__img}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmImage=n.default=t},{"../core/jmControl.js":2}],19:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmLabel=n.default=void 0;var o=t("../core/jmControl.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){t=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}(t,e);if(t){e=Object.getOwnPropertyDescriptor(t,e);return e.get?e.get.call(n):e.value}})(t,e,n||t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=f(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=f(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(r,o.jmControl);var t,e,n,i=a(r);function r(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t=t||{},e||"jmLabel")).style.font=e.style.font||"15px Arial",e.style.fontFamily=e.style.fontFamily||"Arial",e.style.fontSize=e.style.fontSize||15,e.style.textAlign=e.style.textAlign||"left",e.style.textBaseline=e.style.textBaseline||"middle",e.text=t.text||"",e.center=t.center||null,e}return t=r,(e=[{key:"text",get:function(){return this.__pro("text")},set:function(t){return this.needUpdate=!0,this.__pro("text",t)}},{key:"center",get:function(){return this.__pro("center")},set:function(t){return this.needUpdate=!0,this.__pro("center",t)}},{key:"position",get:function(){return this.__pro("position")},set:function(t){return this.needUpdate=!0,this.__pro("position",t)}},{key:"getLocation",value:function(){var t=u(f(r.prototype),"getLocation",this).call(this),e=this.testSize();return t.width=t.width||e.width,t.height=t.height||e.height,t.left||t.top||!t.center||(t.left=t.center.x-t.width/2,t.top=t.center.y-t.height/2),t}},{key:"initPoints",value:function(){this.__size=null;var t=this.getLocation();return this.points=[{x:t.left,y:t.top}],this.points.push({x:t.left+t.width,y:t.top}),this.points.push({x:t.left+t.width,y:t.top+t.height}),this.points.push({x:t.left,y:t.top+t.height}),this.points}},{key:"testSize",value:function(){return this.__size||(this.context.save(),this.setStyle({font:this.style.font||this.style.fontSize+"px "+this.style.fontFamily}),this.__size=this.context.measureText?this.context.measureText(this.text):{width:15},this.context.restore(),this.__size.height=this.style.fontSize||15,this.width||(this.width=this.__size.width),this.height||(this.height=this.__size.height),this.__size)}},{key:"draw",value:function(){var t=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds,e=(this.testSize(),this.location),n=e.left+t.left,i=e.top+t.top;switch(this.style.textAlign){case"right":n+=e.width;break;case"center":n+=e.width/2}switch(this.style.textBaseline){case"bottom":i+=e.height;break;case"hanging":case"alphabetic":case"middle":i+=e.height/2}var r=this.text;void 0!==r&&(this.style.fill&&this.context.fillText?this.style.maxWidth?this.context.fillText(r,n,i,this.style.maxWidth):this.context.fillText(r,n,i):this.context.strokeText&&(this.style.maxWidth?this.context.strokeText(r,n,i,this.style.maxWidth):this.context.strokeText(r,n,i))),this.style.border&&(this.style.border.style&&(this.context.save(),this.setStyle(this.style.border.style)),this.context.moveTo(this.points[0].x+t.left,this.points[0].y+t.top),this.style.border.top&&this.context.lineTo(this.points[1].x+t.left,this.points[1].y+t.top),this.style.border.right&&(this.context.moveTo(this.points[1].x+t.left,this.points[1].y+t.top),this.context.lineTo(this.points[2].x+t.left,this.points[2].y+t.top)),this.style.border.bottom&&(this.context.moveTo(this.points[2].x+t.left,this.points[2].y+t.top),this.context.lineTo(this.points[3].x+t.left,this.points[3].y+t.top)),this.style.border.left&&(this.context.moveTo(this.points[3].x+t.left,this.points[3].y+t.top),this.context.lineTo(this.points[0].x+t.left,this.points[0].y+t.top)),this.style.border.style&&this.context.restore())}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmLabel=n.default=t},{"../core/jmControl.js":2}],20:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmLine=n.default=void 0;var o=t("../core/jmPath.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmLine";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t,e)).start=t.start||{x:0,y:0},e.end=t.end||{x:0,y:0},e.style.lineType=e.style.lineType||"solid",e.style.dashLength=e.style.dashLength||4,e}return t=r,(e=[{key:"start",get:function(){return this.__pro("start")},set:function(t){return this.needUpdate=!0,this.__pro("start",t)}},{key:"end",get:function(){return this.__pro("end")},set:function(t){return this.needUpdate=!0,this.__pro("end",t)}},{key:"initPoints",value:function(){var t=this.start,e=this.end;if(this.points=[],this.points.push(t),"dotted"===this.style.lineType){var n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i);n/=r,i/=r;for(var o=!1,s=this.style.dashLength||5,u=s/2,c=s;c<=r;)0==o?(this.points.push({x:t.x+n*c,y:t.y+i*c}),c+=u):(this.points.push({x:t.x+n*c,y:t.y+i*c,m:!0}),c+=s),o=!o}return this.points.push(e),this.points}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmLine=n.default=t},{"../core/jmPath.js":8}],21:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmPrismatic=n.default=void 0;var o=t("../core/jmPath.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmPrismatic";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t,e)).style.close=void 0===e.style.close||e.style.close,e.center=t.center||{x:0,y:0},e.width=t.width||0,e.height=t.height||0,e}return t=r,(e=[{key:"center",get:function(){return this.__pro("center")},set:function(t){return this.needUpdate=!0,this.__pro("center",t)}},{key:"initPoints",value:function(){var t=this.getLocation(),e=t.width/2,n=t.height/2;this.points=[],this.points.push({x:t.center.x-e,y:t.center.y}),this.points.push({x:t.center.x,y:t.center.y+n}),this.points.push({x:t.center.x+e,y:t.center.y}),this.points.push({x:t.center.x,y:t.center.y-n})}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmPrismatic=n.default=t},{"../core/jmPath.js":8}],22:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmRect=n.default=void 0;var o=t("../core/jmPath.js"),f=t("./jmArc.js"),h=t("./jmLine.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmRect";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t=t||{},e)).style.close=!0,e.radius=t.radius||e.style.radius||0,e}return t=r,(e=[{key:"radius",get:function(){return this.__pro("radius")},set:function(t){return this.needUpdate=!0,this.__pro("radius",t)}},{key:"position",get:function(){return this.__pro("position")},set:function(t){return this.needUpdate=!0,this.__pro("position",t)}},{key:"getBounds",value:function(){var t={};this.initPoints();var e=this.getLocation();return t.left=e.left,t.top=e.top,t.right=e.left+e.width,t.bottom=e.top+e.height,t.width=t.right-t.left,t.height=t.bottom-t.top,t}},{key:"initPoints",value:function(){var t,e,n,i,r,o=this.getLocation(),s={x:o.left,y:o.top},u={x:o.left+o.width,y:o.top},c={x:o.left+o.width,y:o.top+o.height},a={x:o.left,y:o.top+o.height};return"dotted"!==this.style.lineType||this.dottedLine||(this.dottedLine=this.graph.createShape(h.jmLine,{style:this.style})),o.radius&&o.radius<o.width/2&&o.radius<o.height/2?(t=Math.PI/2,(r=this.graph.createShape(f.jmArc,{radius:o.radius,anticlockwise:!1})).center={x:o.left+o.radius,y:o.top+o.radius},r.startAngle=Math.PI,r.endAngle=Math.PI+t,e=r.initPoints(),(r=this.graph.createShape(f.jmArc,{radius:o.radius,anticlockwise:!1})).center={x:u.x-o.radius,y:u.y+o.radius},r.startAngle=Math.PI+t,r.endAngle=2*Math.PI,n=r.initPoints(),(r=this.graph.createShape(f.jmArc,{radius:o.radius,anticlockwise:!1})).center={x:c.x-o.radius,y:c.y-o.radius},r.startAngle=0,r.endAngle=t,i=r.initPoints(),(r=this.graph.createShape(f.jmArc,{radius:o.radius,anticlockwise:!1})).center={x:a.x+o.radius,y:a.y-o.radius},r.startAngle=t,r.endAngle=Math.PI,r=r.initPoints(),this.points=e.concat(n,i,r)):(this.points=[],this.points.push(s),this.dottedLine&&(this.dottedLine.start=s,this.dottedLine.end=u,this.points=this.points.concat(this.dottedLine.initPoints())),this.points.push(u),this.dottedLine&&(this.dottedLine.start=u,this.dottedLine.end=c,this.points=this.points.concat(this.dottedLine.initPoints())),this.points.push(c),this.dottedLine&&(this.dottedLine.start=c,this.dottedLine.end=a,this.points=this.points.concat(this.dottedLine.initPoints())),this.points.push(a),this.dottedLine&&(this.dottedLine.start=a,this.dottedLine.end=s,this.points=this.points.concat(this.dottedLine.initPoints()))),this.points}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmRect=n.default=t},{"../core/jmPath.js":8,"./jmArc.js":12,"./jmLine.js":20}],23:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmResize=n.default=void 0;var o=t("./jmRect.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmRect);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmResize";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t=t||{},e)).resizable=!1!==t.resizable,e.movable=t.movable,e.rectSize=t.rectSize||8,e.style.close=e.style.close||!0,e.init(t),e}return t=r,(e=[{key:"rectSize",get:function(){return this.__pro("rectSize")},set:function(t){return this.__pro("rectSize",t)}},{key:"resizable",get:function(){return this.__pro("resizable")},set:function(t){return this.__pro("resizable",t)}},{key:"init",value:function(t){if(!1!==this.resizable){this.resizeRects=[];var e=this.rectSize,n=this.style.rectStyle||{stroke:"red",fill:"transparent",lineWidth:2,close:!0,zIndex:100};n.close=!0,n.fill=n.fill||"transparent";for(var i=0;i<8;i++){var r=(this.graph||t.graph).createShape(o.jmRect,{position:{x:0,y:0},width:e,height:e,style:n,interactive:!0});r.index=i,r.visible=!0,this.resizeRects.push(r),this.children.add(r),r.canMove(!0,this.graph)}this.reset(0,0,0,0),this.bindRectEvents()}}},{key:"bindRectEvents",value:function(){for(var t=0;t<this.resizeRects.length;t++){var e=this.resizeRects[t];e.on("move",function(t){var e=0,n=0,i=0,r=0;0==this.index?(i=-t.offsetX,e=t.offsetX):1==this.index?(i=-t.offsetX,e=t.offsetX,r=-t.offsetY,n=t.offsetY):2==this.index?(r=-t.offsetY,n=t.offsetY):3==this.index?(i=t.offsetX,r=-t.offsetY,n=t.offsetY):4==this.index?i=t.offsetX:5==this.index?(i=t.offsetX,r=t.offsetY):6==this.index?r=t.offsetY:7==this.index&&(i=-t.offsetX,i=-t.offsetX,e=t.offsetX,r=t.offsetY),this.parent.reset(e,n,i,r),this.needUpdate=!0}),e.bind("mousemove",function(){this.cursor=["w-resize","nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize"][this.index]}),e.bind("mouseleave",function(){this.cursor="default"})}}},{key:"reset",value:function(t,e,n,i){var r,o,s,u=void 0===this.style.minWidth?5:this.style.minWidth,c=void 0===this.style.minHeight?5:this.style.minHeight,a=this.getLocation();for(s in 0==n&&0==i||(r=a.width+n,o=a.height+i,(u<=r||c<=o)&&(u<=r?this.width=r:n=t=0,c<=o?this.height=o:i=e=0,!1!==this.movable&&(t||e)&&((o=this.position).x=a.left+t,o.y=a.top+e,this.position=o),this.emit("resize",t,e,n,i))),this.resizeRects){var f=this.resizeRects[s];switch(f.index){case 0:f.position.x=-f.width/2,f.position.y=(a.height-f.height)/2;break;case 1:f.position.x=-f.width/2,f.position.y=-f.height/2;break;case 2:f.position.x=(a.width-f.width)/2,f.position.y=-f.height/2;break;case 3:f.position.x=a.width-f.width/2,f.position.y=-f.height/2;break;case 4:f.position.x=a.width-f.width/2,f.position.y=(a.height-f.height)/2;break;case 5:f.position.x=a.width-f.width/2,f.position.y=a.height-f.height/2;break;case 6:f.position.x=(a.width-f.height)/2,f.position.y=a.height-f.height/2;break;case 7:f.position.x=-f.width/2,f.position.y=a.height-f.height/2}}}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmResize=n.default=t},{"./jmRect.js":22}]},{},[1])(1);return r.jmGraph=i},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t.bind(r)):t()}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
1
+ !function(r){var t;t=function(t,e,n){var i=function i(r,o,s){function u(e,t){if(!o[e]){if(!r[e]){var n="function"==typeof require&&require;if(!t&&n)return n(e,!0);if(c)return c(e,!0);throw(n=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",n}n=o[e]={exports:{}},r[e][0].call(n.exports,function(t){return u(r[e][1][t]||t)},n,n.exports,i,r,o,s)}return o[e].exports}for(var c="function"==typeof require&&require,t=0;t<s.length;t++)u(s[t]);return u}({1:[function(t,e,n){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"jmArc",{enumerable:!0,get:function(){return r.jmArc}}),Object.defineProperty(n,"jmArrow",{enumerable:!0,get:function(){return o.jmArrow}}),Object.defineProperty(n,"jmBezier",{enumerable:!0,get:function(){return s.jmBezier}}),Object.defineProperty(n,"jmCircle",{enumerable:!0,get:function(){return u.jmCircle}}),Object.defineProperty(n,"jmHArc",{enumerable:!0,get:function(){return c.jmHArc}}),Object.defineProperty(n,"jmLine",{enumerable:!0,get:function(){return a.jmLine}}),Object.defineProperty(n,"jmPrismatic",{enumerable:!0,get:function(){return f.jmPrismatic}}),Object.defineProperty(n,"jmRect",{enumerable:!0,get:function(){return h.jmRect}}),Object.defineProperty(n,"jmArrowLine",{enumerable:!0,get:function(){return l.jmArrowLine}}),Object.defineProperty(n,"jmImage",{enumerable:!0,get:function(){return p.jmImage}}),Object.defineProperty(n,"jmLabel",{enumerable:!0,get:function(){return y.jmLabel}}),Object.defineProperty(n,"jmResize",{enumerable:!0,get:function(){return d.jmResize}}),Object.defineProperty(n,"jmUtils",{enumerable:!0,get:function(){return m.jmUtils}}),Object.defineProperty(n,"jmList",{enumerable:!0,get:function(){return m.jmList}}),Object.defineProperty(n,"jmShadow",{enumerable:!0,get:function(){return m.jmShadow}}),Object.defineProperty(n,"jmGradient",{enumerable:!0,get:function(){return m.jmGradient}}),Object.defineProperty(n,"jmControl",{enumerable:!0,get:function(){return m.jmControl}}),Object.defineProperty(n,"jmPath",{enumerable:!0,get:function(){return m.jmPath}}),n.create=n.jmGraph=n.default=void 0;var r=t("./src/shapes/jmArc.js"),o=t("./src/shapes/jmArrow.js"),s=t("./src/shapes/jmBezier.js"),u=t("./src/shapes/jmCircle.js"),c=t("./src/shapes/jmHArc.js"),a=t("./src/shapes/jmLine.js"),f=t("./src/shapes/jmPrismatic.js"),h=t("./src/shapes/jmRect.js"),l=t("./src/shapes/jmArrowLine.js"),p=t("./src/shapes/jmImage.js"),y=t("./src/shapes/jmLabel.js"),d=t("./src/shapes/jmResize.js"),m=t("./src/core/jmGraph.js");function v(t,e,n){return(v=j()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);i=new(Function.bind.apply(t,i));return n&&b(i,n.prototype),i}).apply(null,arguments)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function g(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}function j(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function w(t){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var _={arc:r.jmArc,arrow:o.jmArrow,bezier:s.jmBezier,circle:u.jmCircle,harc:c.jmHArc,line:a.jmLine,prismatic:f.jmPrismatic,rect:h.jmRect,arrowline:l.jmArrowLine,image:p.jmImage,img:p.jmImage,label:y.jmLabel,resize:d.jmResize},x=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}(s,m.jmGraph);var n,i,e=(n=s,i=j(),function(){var t,e=w(n);return g(this,i?(t=w(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))});function s(i,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var t=this instanceof s?this.constructor:void 0;return(r=Object.assign({},r)).shapes=Object.assign(_,r.shapes||{}),t&&t.prototype instanceof m.jmGraph?("function"==typeof r&&(o=r,r={}),e.call(this,i,r,o)):g(void 0,new Promise(function(t,e){var n=new s(i,r,o);t&&t(n)}))}return s}();n.jmGraph=n.default=x;n.create=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v(x,e)}},{"./src/core/jmGraph.js":5,"./src/shapes/jmArc.js":12,"./src/shapes/jmArrow.js":13,"./src/shapes/jmArrowLine.js":14,"./src/shapes/jmBezier.js":15,"./src/shapes/jmCircle.js":16,"./src/shapes/jmHArc.js":17,"./src/shapes/jmImage.js":18,"./src/shapes/jmLabel.js":19,"./src/shapes/jmLine.js":20,"./src/shapes/jmPrismatic.js":21,"./src/shapes/jmRect.js":22,"./src/shapes/jmResize.js":23}],2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmControl=n.default=void 0;var p=t("./jmUtils.js"),o=t("./jmList.js"),y=t("./jmGradient.js"),d=t("./jmShadow.js"),s=t("./jmProperty.js");function u(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,e=function(){};return{s:e,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,r=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw r}}}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=r(n);return function(t,e){{if(e&&("object"===m(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=r(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(r,s.jmProperty);var t,e,n,i=h(r);function r(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),t=t||{},(n=i.call(this)).__pro("type",e||(this instanceof r?this.constructor:void 0).name),n.style=t&&t.style?t.style:{},n.width=t.width||0,n.height=t.height||0,t.position&&(n.position=t.position),n.graph=t.graph||null,n.zIndex=t.zIndex||0,n.interactive=void 0===t.interactive||t.interactive,n.jmStyleMap={fill:"fillStyle",stroke:"strokeStyle","shadow.blur":"shadowBlur","shadow.x":"shadowOffsetX","shadow.y":"shadowOffsetY","shadow.color":"shadowColor",lineWidth:"lineWidth",miterLimit:"miterLimit",fillStyle:"fillStyle",strokeStyle:"strokeStyle",font:"font",opacity:"globalAlpha",textAlign:"textAlign",textBaseline:"textBaseline",shadowBlur:"shadowBlur",shadowOffsetX:"shadowOffsetX",shadowOffsetY:"shadowOffsetY",shadowColor:"shadowColor",lineJoin:"lineJoin",lineCap:"lineCap"},n.initializing(),n.on=n.bind,n.option=t,n}return t=r,(e=[{key:"type",get:function(){return this.__pro("type")}},{key:"context",get:function(){var t=this.__pro("context");if(t)return t;if(this.is("jmGraph")&&this.canvas&&this.canvas.getContext)return this.context=this.canvas.getContext("2d");t=this.graph;return t?t.context:t.canvas.getContext("2d")},set:function(t){return this.__pro("context",t)}},{key:"style",get:function(){return this.__pro("style")||this.__pro("style",{})},set:function(t){return this.needUpdate=!0,this.__pro("style",t)}},{key:"visible",get:function(){var t=this.__pro("visible");return t=void 0===t?this.__pro("visible",!0):t},set:function(t){return this.needUpdate=!0,this.__pro("visible",t)}},{key:"interactive",get:function(){return this.__pro("interactive")},set:function(t){return this.__pro("interactive",t)}},{key:"children",get:function(){return this.__pro("children")||this.__pro("children",new o.jmList)},set:function(t){return this.needUpdate=!0,this.__pro("children",t)}},{key:"width",get:function(){var t=this.__pro("width");return t=void 0===t?this.__pro("width",0):t},set:function(t){return this.needUpdate=!0,this.__pro("width",t)}},{key:"height",get:function(){var t=this.__pro("height");return t=void 0===t?this.__pro("height",0):t},set:function(t){return this.needUpdate=!0,this.__pro("height",t)}},{key:"zIndex",get:function(){return this.__pro("zIndex")||this.__pro("zIndex",0)},set:function(t){return this.needUpdate=!0,this.__pro("zIndex",t),this.children.sort(),this.needUpdate=!0,t}},{key:"cursor",get:function(){var t=this.graph;if(t)return t.css("cursor")},set:function(t){var e=this.graph;e&&e.css("cursor",t)}},{key:"initializing",value:function(){var e=this;this.children=this.children||new o.jmList;var n=this.children.add;this.children.add=function(t){if("object"===m(t))return t.parent&&t.parent!=e&&t.parent.children&&t.parent.children.remove(t),t.parent=e,this.contain(t)&&this.oremove(t),n.call(this,t),t.emit("add",t),e.needUpdate=!0,e.graph&&(t.graph=e.graph),this.sort(),t},this.children.oremove=this.children.remove,this.children.remove=function(t){"object"===m(t)&&(t.parent=null,t.graph=null,t.remove(!0),this.oremove(t),e.needUpdate=!0)},this.children.sort=function(){var t,i={};for(t in this.each(function(t,e){var n;e&&(!(n=e.zIndex)&&e.style&&e.style.zIndex&&(n=Number(e.style.zIndex),isNaN(n)&&(n=e.style.zIndex||0)),(i[n]||(i[n]=[])).push(e))}),this.splice(0,this.length),i)n.call(this,i[t])},this.children.clear=function(){this.each(function(t,e){this.remove(e)},!0)},this.needUpdate=!0}},{key:"setStyle",value:function(t){var h=this;if(t=t||p.jmUtils.clone(this.style,!0)){var e,n,l=this.graph.devicePixelRatio,i=function t(e,n,i){if(e){if("function"==typeof e)try{e=e.call(h)}catch(t){return void console.warn(t)}var r=m(e),i=h.jmStyleMap[i||n];if(e instanceof y.jmGradient||"string"==r&&-1<e.indexOf("-gradient"))t((e="string"==r&&-1<e.indexOf("-gradient")?new y.jmGradient(e):e).toGradient(h),i||n);else if("function"==r)i&&(e=e.call(h,i))&&t(e,i);else if(i){if("string"==r&&-1<["fillStyle","strokeStyle","shadowColor"].indexOf(i)&&(e=p.jmUtils.toColor(e)),l&&e)switch(i){case"lineWidth":e*=l;break;case"fontSize":case"font":var o,s=e.toString().match(/[\d\.]+/);s&&s.length&&(o=Number(s[0])*l,e=e.toString().replace(s[0],o))}h.context[i]=e}else switch(n){case"shadow":if("string"==r){t(new d.jmShadow(e),n);break}for(var u in e)t(e[u],u,n+"."+u);break;case"translate":h.context.translate(e.x,e.y);break;case"rotation":if(!e.angle)break;var c,a=0,f=0;e.point&&(c=h.absoluteBounds||h.getAbsoluteBounds(),a=(e=h.getRotation(e)).rotateX+c.left,f=e.rotateY+c.top),0==a&&0==f||h.context.translate(a,f),h.context.rotate(e.angle),0==a&&0==f||h.context.translate(-a,-f);break;case"transform":Array.isArray(e)?h.context.transform.apply(h.context,e):"object"==m(e)&&h.context.transform(e.scaleX,e.skewX,e.skewY,e.scaleY,e.offsetX,e.offsetY);break;case"cursor":h.cursor=e}}};for(e in this.translate&&i(this.translate,"translate"),this.transform&&i(this.transform,"transform"),t)"constructor"!==e&&("string"==(n=m(t[e]))&&-1<t[e].indexOf("-gradient")?t[e]=new y.jmGradient(t[e]):"string"==n&&"shadow"==e&&(t[e]=new d.jmShadow(t[e])),i(t[e],e))}}},{key:"getBounds",value:function(t){if(this.bounds&&!t)return this.bounds;var e={};if("jmGraph"==this.type&&this.canvas)"function"==typeof this.canvas.width?e.right=this.canvas.width():this.canvas.width?e.right=this.canvas.width:this.width&&(e.right=this.width),"function"==typeof this.canvas.height?e.bottom=this.canvas.height():this.canvas.height?e.bottom=this.canvas.height:this.height&&(e.bottom=this.height);else if(this.points&&0<this.points.length)for(var n in this.points){n=this.points[n];(void 0===e.left||e.left>n.x)&&(e.left=n.x),(void 0===e.top||e.top>n.y)&&(e.top=n.y),(void 0===e.right||e.right<n.x)&&(e.right=n.x),(void 0===e.bottom||e.bottom<n.y)&&(e.bottom=n.y)}else!this.getLocation||(t=this.getLocation())&&(e.left=t.left,e.top=t.top,e.right=t.left+t.width,e.bottom=t.top+t.height);return e.left||(e.left=0),e.top||(e.top=0),e.right||(e.right=0),e.bottom||(e.bottom=0),e.width=e.right-e.left,e.height=e.bottom-e.top,this.bounds=e}},{key:"getLocation",value:function(){var t=this.location={left:0,top:0,width:0,height:0};t.position="function"==typeof this.position?this.position():p.jmUtils.clone(this.position),t.center=this.center&&"function"==typeof this.center?this.center():p.jmUtils.clone(this.center),t.start=this.start&&"function"==typeof this.start?this.start():p.jmUtils.clone(this.start),t.end=this.end&&"function"==typeof this.end?this.end():p.jmUtils.clone(this.end),t.radius=this.radius,t.width=this.width,t.height=this.height;var e=p.jmUtils.clone(this.style.margin,{});if(e.left=(e.left||0)*this.graph.devicePixelRatio,e.top=(e.top||0)*this.graph.devicePixelRatio,e.right=(e.right||0)*this.graph.devicePixelRatio,e.bottom=(e.bottom||0)*this.graph.devicePixelRatio,t.position?(t.left=t.position.x,t.top=t.position.y):(t.left=e.left,t.top=e.top),!this.parent)return t;e=this.parent.getBounds();return p.jmUtils.checkPercent(t.left)&&(t.left=p.jmUtils.percentToNumber(t.left)*e.width),p.jmUtils.checkPercent(t.top)&&(t.top=p.jmUtils.percentToNumber(t.top)*e.height),p.jmUtils.checkPercent(t.width)&&(t.width=p.jmUtils.percentToNumber(t.width)*e.width),p.jmUtils.checkPercent(t.height)&&(t.height=p.jmUtils.percentToNumber(t.height)*e.height),t.center&&(p.jmUtils.checkPercent(t.center.x)&&(t.center.x=p.jmUtils.percentToNumber(t.center.x)*e.width),p.jmUtils.checkPercent(t.center.y)&&(t.center.y=p.jmUtils.percentToNumber(t.center.y)*e.height)),t.radius&&p.jmUtils.checkPercent(t.radius)&&(t.radius=p.jmUtils.percentToNumber(t.radius)*Math.min(e.width,e.height)),t}},{key:"getRotation",value:function(t){var e;return(t=t||this.style.rotation)?(e=this.getBounds(),t.rotateX=t.point.x,p.jmUtils.checkPercent(t.rotateX)&&(t.rotateX=p.jmUtils.percentToNumber(t.rotateX)*e.width),t.rotateY=t.point.y,p.jmUtils.checkPercent(t.rotateY)&&(t.rotateY=p.jmUtils.percentToNumber(t.rotateY)*e.height)):(t=this.parent&&this.parent.getRotation?this.parent.getRotation():null)&&(e=this.getBounds(),t.rotateX-=e.left,t.rotateY-=e.top),t}},{key:"remove",value:function(){this.parent&&this.parent.children.remove(this)}},{key:"offset",value:function(t,e,n,i){n=!1!==n;var r=this.getLocation(!0),o=!1;if(r.position&&(r.left+=t,r.top+=e,this.position.x=r.left,this.position.y=r.top,o=!0),r.center&&(this.center.x=r.center.x+t,this.center.y=r.center.y+e,o=!0),r.start&&"object"==m(r.start)&&(this.start.x=r.start.x+t,this.start.y=r.start.y+e,o=!0),r.end&&"object"==m(r.end)&&(this.end.x=r.end.x+t,this.end.y=r.end.y+e,o=!0),0==o&&this.cpoints){var s=(this.cpoints,this.cpoints);if(s){for(var u=s.length,c=0;c<u;c++)s[c].x+=t,s[c].y+=e;o=!0}}if(0==o&&this.points){for(var a=this.points.length,f=0;f<a;f++)this.points[f].x+=t,this.points[f].y+=e;o=!0}this.emit("move",{offsetX:t,offsetY:e,trans:n,evt:i}),this.needUpdate=!0}},{key:"rotate",value:function(t,e){this.style.rotation={angle:t,point:e},this.needUpdate=!0}},{key:"getAbsoluteBounds",value:function(){var t=this.getBounds();if(this.parent&&this.parent.absoluteBounds){var e=this.parent.absoluteBounds||this.parent.getAbsoluteBounds();return{left:e.left+t.left,top:e.top+t.top,right:e.left+t.right,bottom:e.top+t.bottom,width:t.width,height:t.height}}return t}},{key:"beginDraw",value:function(){this.getLocation(!0),this.context.beginPath()}},{key:"endDraw",value:function(){this.style.close&&this.context.closePath(),this.style.fill&&this.context.fill(),!this.style.stroke&&this.style.fill||this.context.stroke(),this.needUpdate=!1}},{key:"draw",value:function(){if(this.points&&0<this.points.length){var t=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds;this.context.moveTo(this.points[0].x+t.left,this.points[0].y+t.top);for(var e=this.points.length,n=1;n<e;n++){var i=this.points[n];i.m?this.context.moveTo(i.x+t.left,i.y+t.top):this.context.lineTo(i.x+t.left,i.y+t.top)}}}},{key:"paint",value:function(t){!1!==t&&!1!==this.visible&&(this.initPoints&&this.initPoints(),this.bounds=null,this.absoluteBounds=this.getAbsoluteBounds(),t=!0,!this.is("jmGraph")&&this.graph&&(this.absoluteBounds.left>=this.graph.width||this.absoluteBounds.top>=this.graph.height||this.absoluteBounds.right<=0||this.absoluteBounds.bottom<=0)&&(t=!1),this.context.save(),this.emit("beginDraw",this),this.setStyle(),t&&this.beginDraw&&this.beginDraw(),t&&this.draw&&this.draw(),t&&this.endDraw&&this.endDraw(),this.children&&this.children.each(function(t,e){e&&e.paint&&e.paint()}),this.emit("endDraw",this),this.context.restore(),this.is("jmGraph")&&this.context.draw&&this.context.draw(),this.needUpdate=!1)}},{key:"getEvent",value:function(t){return this.__events?this.__events[t]:null}},{key:"bind",value:function(t,e){if(t&&-1<t.indexOf(" ")){var n,i=u(t=t.split(" "));try{for(i.s();!(n=i.n()).done;){var r=n.value;r&&this.bind(r,e)}}catch(t){i.e(t)}finally{i.f()}}else{t=this.getEvent(t)||function(t,e){return this.__events||(this.__events={}),this.__events[t]=e}.call(this,t,new o.jmList);t.contain(e)||t.add(e)}}},{key:"unbind",value:function(t,e){if(t&&-1<t.indexOf(" ")){var n,i=u(t=t.split(" "));try{for(i.s();!(n=i.n()).done;){var r=n.value;r&&this.unbind(r,e)}}catch(t){i.e(t)}finally{i.f()}}else{t=this.getEvent(t);t&&(e?t.remove(e):t.clear())}}},{key:"emit",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.runEventHandle(e[0],e.slice(1)),this}},{key:"runEventHandle",value:function(t,n){var i,t=this.getEvent(t);return t&&(i=this,Array.isArray(n)||(n=[n]),t.each(function(t,e){!1===e.apply(i,n)&&(n.cancel=!0)})),n.cancel}},{key:"checkPoint",value:function(t,e){if("jmGraph"==this.type){var n=this.getPosition(),i=n.left+(this.canvas.clientWidth||this.canvas.offsetWidth||this.canvas.width),r=n.top+(this.canvas.clientHeight||this.canvas.offsetHeight||this.canvas.height);return t.pageX>i||t.pageX<n.left?!1:!(t.pageY>r||t.pageY<n.top)}var r=this.getBounds(),n=this.getRotation(),o=this.points;if(o&&o.length||((o=[]).push({x:r.left,y:r.top}),o.push({x:r.right,y:r.top}),o.push({x:r.right,y:r.bottom}),o.push({x:r.left,y:r.bottom}),o.push({x:r.left,y:r.top})),e=Number(e||this.style.touchPadding||this.style.lineWidth||1),o&&o.length){if(n&&0!=n.angle&&(o=p.jmUtils.clone(o,!0),o=p.jmUtils.rotatePoints(o,{x:n.rotateX+r.left,y:n.rotateY+r.top},n.angle)),2<o.length&&(!this.style.fill||this.style.stroke)){for(var s=0,u=o.length,c=s+1;c<=u;c=++s+1)if(c==u){if(this.style.close)if(p.jmUtils.pointInPolygon(t,[o[s],o[0]],e))return!0}else if(p.jmUtils.pointInPolygon(t,[o[s],o[c]],e))return!0;if(!this.style.fill)return!1}return p.jmUtils.pointInPolygon(t,o,e)}return!(t.x>r.right||t.x<r.left)&&!(t.y>r.bottom||t.y<r.top)}},{key:"raiseEvent",value:function(n,i){if(!1!==this.visible){var t,e;i.position||(t=this.graph,o=i.srcElement||i.target,e=p.jmUtils.getEventPosition(i,t.scaleSize),0<t.devicePixelRatio&&(e.x=e.offsetX=e.x*t.devicePixelRatio,e.y=e.offsetY=e.y*t.devicePixelRatio),i={position:e,button:0==i.button||e.isTouch?1:i.button,keyCode:i.keyCode||i.charCode||i.which,ctrlKey:i.ctrlKey,cancel:!1,event:i,srcElement:o}),i.path=i.path||[];var r=!1;if(this.children&&this.children.each(function(t,e){if(!0!==i.cancel&&(r=!1===e.raiseEvent(n,i)||r))return!1},!0),r)return!1;var o=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds;if(!o)return!1;i.position.x=i.position.offsetX-o.left,i.position.y=i.position.offsetY-o.top;o=!1!==this.interactive&&this.checkPoint(i.position);return o?(i.target||(i.target=this),this.runEventAndPopEvent(n,i),this.focused||"mousemove"!==n&&"touchmove"!==n||(this.focused=!0,this.raiseEvent("mousemove"===n?"mouseover":"touchover",i))):!1===this.interactive||o||!this.focused||"mousemove"!==n&&"touchmove"!==n||(this.focused=!1,this.runEventHandle("mousemove"===n?"mouseleave":"touchleave",i)),!1===i.cancel}}},{key:"runEventAndPopEvent",value:function(t,e){!0!==e.cancel&&(e.path.push(this),this.runEventHandle(t,e))}},{key:"clearEvents",value:function(t){t=this.getEvent(t);t&&t.clear}},{key:"findParent",value:function(t){if("string"==typeof t){if(this.type==t)return this}else if(this.is(t))return this;return this.parent?this.parent.findParent(t):null}},{key:"canMove",value:function(t,e){var s;return this.__mvMonitor||(this.__mvMonitor={},this.__mvMonitor.mouseDown=!1,this.__mvMonitor.curposition={x:0,y:0},(s=this).__mvMonitor.mv=function(t){var e=s;if(e.__mvMonitor.mouseDown){e.parent.bounds=null;var n,i=e.parent.getAbsoluteBounds(),r=t.position.offsetX-e.__mvMonitor.curposition.x,o=t.position.offsetY-e.__mvMonitor.curposition.y;return e.lockSide&&(n=e.bounds||e.getAbsoluteBounds(),(n=p.jmUtils.checkOutSide(i,n,{x:r,y:o})).left<0?e.lockSide.left&&(r-=n.left):0<n.right&&e.lockSide.right&&(r-=n.right),n.top<0?e.lockSide.top&&(o-=n.top):0<n.bottom&&e.lockSide.bottom&&(o-=n.bottom)),(r||o)&&(e.offset(r,o,!0,t),e.__mvMonitor.curposition.x=t.position.offsetX,e.__mvMonitor.curposition.y=t.position.offsetY),!1}},this.__mvMonitor.mu=function(t){var e=s;e.__mvMonitor.mouseDown&&(e.__mvMonitor.mouseDown=!1,e.emit("moveend",{position:e.__mvMonitor.curposition}))},this.__mvMonitor.ml=function(){var t=s;if(t.__mvMonitor.mouseDown)return t.__mvMonitor.mouseDown=!1,t.emit("moveend",{position:t.__mvMonitor.curposition}),!1},this.__mvMonitor.md=function(t){if(!this.__mvMonitor.mouseDown)return 0==t.button||1==t.button?(this.__mvMonitor.mouseDown=!0,this.__mvMonitor.curposition.x=t.position.offsetX,this.__mvMonitor.curposition.y=t.position.offsetY,this.emit("movestart",{position:this.__mvMonitor.curposition}),!(t.cancel=!0)):void 0}),e=e||this.graph,!1!==t?(e.bind("mousemove",this.__mvMonitor.mv),e.bind("mouseup",this.__mvMonitor.mu),e.bind("mouseleave",this.__mvMonitor.ml),this.bind("mousedown",this.__mvMonitor.md),e.bind("touchmove",this.__mvMonitor.mv),e.bind("touchend",this.__mvMonitor.mu),this.bind("touchstart",this.__mvMonitor.md)):(e.unbind("mousemove",this.__mvMonitor.mv),e.unbind("mouseup",this.__mvMonitor.mu),e.unbind("mouseleave",this.__mvMonitor.ml),this.unbind("mousedown",this.__mvMonitor.md),e.unbind("touchmove",this.__mvMonitor.mv),e.unbind("touchend",this.__mvMonitor.mu),this.unbind("touchstart",this.__mvMonitor.md)),this}}])&&a(t.prototype,e),n&&a(t,n),r}();n.jmControl=n.default=t},{"./jmGradient.js":4,"./jmList.js":6,"./jmProperty.js":9,"./jmShadow.js":10,"./jmUtils.js":11}],3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmEvents=n.default=void 0;var o=t("./jmUtils.js");function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}t=function(){function n(t,e){r(this,n),this.container=t,this.target=e||t,this.mouseHandler=new c(this,t,e),this.keyHandler=new a(this,t,e)}return u(n,[{key:"touchStart",value:function(t){if((t=t||window.event).eventName="touchstart",this.container.raiseEvent("touchstart",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchMove",value:function(t){if((t=t||window.event).eventName="touchmove",this.container.raiseEvent("touchmove",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchEnd",value:function(t){if((t=t||window.event).eventName="touchend",this.container.raiseEvent("touchend",t),(t.target||t.srcElement)==this.target)return!1}},{key:"touchCancel",value:function(t){if((t=t||window.event).eventName="touchcancel",this.container.raiseEvent("touchcancel",t),(t.target||t.srcElement)==this.target)return!1}},{key:"destroy",value:function(){this.mouseHandler.destroy(),this.keyHandler.destroy()}}]),n}();n.jmEvents=n.default=t;var c=function(){function i(t,e,n){r(this,i),this.instance=t,this.container=e,this.target=n||e,this.eventEvents={},this.init(t,e,n)}return u(i,[{key:"init",value:function(e,n,t){var i=this.target,r=void 0!==("undefined"==typeof document?"undefined":s(document))?document:null;this.eventEvents.mousedown=o.jmUtils.bindEvent(this.target,"mousedown",function(t){(t=t||window.event).eventName="mousedown";n.raiseEvent("mousedown",t)}),this.eventEvents.mousedown=o.jmUtils.bindEvent(this.target,"mousemove",function(t){if((t=t||window.event).eventName="mousemove",(t.target||t.srcElement)==i){n.raiseEvent("mousemove",t);return t.preventDefault&&t.preventDefault(),!1}}),this.eventEvents.mousedown=o.jmUtils.bindEvent(this.target,"mouseover",function(t){(t=t||window.event).eventName="mouseover",n.raiseEvent("mouseover",t)}),this.eventEvents.mouseleave=o.jmUtils.bindEvent(this.target,"mouseleave",function(t){(t=t||window.event).eventName="mouseleave",n.raiseEvent("mouseleave",t)}),this.eventEvents.mouseout=o.jmUtils.bindEvent(this.target,"mouseout",function(t){(t=t||window.event).eventName="mouseout",n.raiseEvent("mouseout",t)}),r&&(this.eventEvents.mouseup=o.jmUtils.bindEvent(r,"mouseup",function(t){if(!((t=t||window.event).eventName="mouseup")===n.raiseEvent("mouseup",t))return t.preventDefault&&t.preventDefault(),!1})),this.eventEvents.dblclick=o.jmUtils.bindEvent(this.target,"dblclick",function(t){(t=t||window.event).eventName="dblclick",n.raiseEvent("dblclick",t)}),this.eventEvents.click=o.jmUtils.bindEvent(this.target,"click",function(t){(t=t||window.event).eventName="click",n.raiseEvent("click",t)}),r&&(this.eventEvents.resize=o.jmUtils.bindEvent(r,"resize",function(t){return(t=t||window.event).eventName="resize",n.raiseEvent("resize",t)})),this.eventEvents.touchstart=o.jmUtils.bindEvent(this.target,"touchstart",function(t){return t.eventName="touchstart",e.touchStart(t)},{passive:!1}),this.eventEvents.touchmove=o.jmUtils.bindEvent(this.target,"touchmove",function(t){return t.eventName="touchmove",e.touchMove(t)},{passive:!1}),r&&(this.eventEvents.touchend=o.jmUtils.bindEvent(r,"touchend",function(t){return t.eventName="touchend",e.touchEnd(t)},{passive:!1})),r&&(this.eventEvents.touchcancel=o.jmUtils.bindEvent(r,"touchcancel",function(t){return t.eventName="touchcancel",e.touchCancel(t)},{passive:!1}))}},{key:"destroy",value:function(){for(var t in this.eventEvents){var e=this.eventEvents[t];e&&e.fun&&o.jmUtils.removeEvent(e.target,t,e.fun)}}}]),i}(),a=function(){function i(t,e,n){r(this,i),this.instance=t,this.container=e,this.target=n||e,this.eventEvents={},this.init(e,n)}return u(i,[{key:"init",value:function(n,t){function i(t){return!(t=t.srcElement||t.target)||"INPUT"!=t.tagName&&"TEXTAREA"!=t.tagName&&"ANCHOR"!=t.tagName&&"FORM"!=t.tagName&&"FILE"!=t.tagName&&"IMG"!=t.tagName&&"HIDDEN"!=t.tagName&&"RADIO"!=t.tagName&&"TEXT"!=t.tagName}var e=void 0!==("undefined"==typeof document?"undefined":s(document))?document:null;e&&(this.eventEvents.keypress=o.jmUtils.bindEvent(e,"keypress",function(t){if(t=t||window.event,i(t)){var e=n.raiseEvent("keypress",t);return!1===e&&t.preventDefault&&t.preventDefault(),e}})),e&&(this.eventEvents.keydown=o.jmUtils.bindEvent(e,"keydown",function(t){if(t=t||window.event,i(t)){var e=n.raiseEvent("keydown",t);return!1===e&&t.preventDefault&&t.preventDefault(),e}})),e&&(this.eventEvents.keyup=o.jmUtils.bindEvent(e,"keyup",function(t){if(t=t||window.event,i(t)){var e=n.raiseEvent("keyup",t);return!1===e&&t.preventDefault&&t.preventDefault(),e}}))}},{key:"destroy",value:function(){for(var t in this.eventEvents){var e=this.eventEvents[t];e&&e.fun&&o.jmUtils.removeEvent(e.target,t,e.fun)}}}]),i}()},{"./jmUtils.js":11}],4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmGradient=n.default=void 0;var a=t("./jmUtils.js"),r=t("./jmList.js");function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}t=function(){function n(t){if(!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.stops=new r.jmList,t&&"object"==o(t))for(var e in t)this[e]=t[e];else"string"==typeof t&&this.fromString(t)}var t,e,i;return t=n,(e=[{key:"addStop",value:function(t,e){this.stops.add({offset:Number(t),color:e})}},{key:"toGradient",value:function(t){var i,e=t.context||t,n=t.absoluteBounds||t.getAbsoluteBounds(),r=this.x1||0,o=this.y1||0,s=this.x2,u=this.y2,c=t.getLocation(),t=0,t=(t=c.radius?2*c.radius:t)||Math.min(c.width,c.height);a.jmUtils.checkPercent(r)&&(r=a.jmUtils.percentToNumber(r)*(n.width||t)),a.jmUtils.checkPercent(s)&&(s=a.jmUtils.percentToNumber(s)*(n.width||t)),a.jmUtils.checkPercent(o)&&(o=a.jmUtils.percentToNumber(o)*(n.height||t)),a.jmUtils.checkPercent(u)&&(u=a.jmUtils.percentToNumber(u)*(n.height||t));c=Number(r)+n.left,r=Number(o)+n.top,o=Number(s)+n.left,s=Number(u)+n.top;return"linear"===this.type?i=e.createLinearGradient(c,r,o,s):"radial"===this.type&&(u=this.r1||0,n=this.r2,a.jmUtils.checkPercent(u)&&(u=a.jmUtils.percentToNumber(u),u*=t),a.jmUtils.checkPercent(n)&&(n=a.jmUtils.percentToNumber(n),n*=t),i=e.createCircularGradient?e.createCircularGradient(c,r,n):e.createRadialGradient(c,r,u,o,s,n)),this.stops.each(function(t,e){var n=a.jmUtils.toColor(e.color);i.addColorStop(e.offset,n)}),i}},{key:"fromString",value:function(t){if(t){var e=t.match(/(linear|radial)-gradient\s*\(\s*([^,]+)\s*,\s*((.|\s)+)\)/i);if(e&&!(e.length<3)){this.type=e[1].toLowerCase();t=a.jmUtils.trim(e[2]).split(/\s+/);"linear"==this.type?t.length<=2?(this.x2=t[0],this.y2=t[1]||0):(this.x1=t[0],this.y1=t[1],this.x2=t[2],this.y2=t[3]):t.length<=3?(this.x2=t[0],this.y2=t[1]||0,this.r2=t[2]||0):(this.x1=t[0],this.y1=t[1],this.r1=t[2],this.x2=t[3],this.y2=t[3],this.r2=t[3]);var n=e[3].match(/((rgb(a)?\s*\([\d,\.\s]+\))|(#[a-zA-Z\d]+))\s+([\d\.]+)/gi);if(n&&n.length)for(var i=0;i<n.length;i++){var r,o=a.jmUtils.trim(n[i]),s=o.lastIndexOf(" ");-1<s&&(r=Number(o.substr(s+1)),s=a.jmUtils.trim(o.substr(0,s)),!isNaN(r)&&s&&this.addStop(r,s))}}}}},{key:"toString",value:function(){var n=this.type+"-gradient(";return"linear"==this.type?n+=this.x1+" "+this.y1+" "+this.x2+" "+this.y2:n+=this.x1+" "+this.y1+" "+this.r1+" "+this.x2+" "+this.y2+" "+this.r2,this.stops.each(function(t,e){n+=","+e.color+" "+e.offset}),n+")"}}])&&s(t.prototype,e),i&&s(t,i),n}();n.jmGradient=n.default=t},{"./jmList.js":6,"./jmUtils.js":11}],5:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"jmUtils",{enumerable:!0,get:function(){return s.jmUtils}}),Object.defineProperty(n,"jmList",{enumerable:!0,get:function(){return i.jmList}}),Object.defineProperty(n,"jmProperty",{enumerable:!0,get:function(){return o.jmProperty}}),Object.defineProperty(n,"jmShadow",{enumerable:!0,get:function(){return u.jmShadow}}),Object.defineProperty(n,"jmGradient",{enumerable:!0,get:function(){return c.jmGradient}}),Object.defineProperty(n,"jmEvents",{enumerable:!0,get:function(){return a.jmEvents}}),Object.defineProperty(n,"jmControl",{enumerable:!0,get:function(){return f.jmControl}}),Object.defineProperty(n,"jmPath",{enumerable:!0,get:function(){return h.jmPath}}),n.jmGraph=n.default=void 0;var s=t("./jmUtils.js"),i=t("./jmList.js"),o=t("./jmProperty.js"),u=t("./jmShadow.js"),c=t("./jmGradient.js"),a=t("./jmEvents.js"),f=t("./jmControl.js"),h=t("./jmPath.js");function l(t,e,n){return(l=m()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);i=new(Function.bind.apply(t,i));return n&&y(i,n.prototype),i}).apply(null,arguments)}function p(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(n){var i=m();return function(){var t,e=v(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=v(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(o,f.jmControl);var t,e,n,r=d(o);function o(t,e,n){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),"function"==typeof e&&(n=e,e={}),(e=e||{}).mode=e.mode||"2d",e.interactive=!0,(i=r.call(this,e,"jmGraph")).option=e||{},i.devicePixelRatio=1,i.util=i.utils=s.jmUtils,"undefined"!=typeof wx&&wx.canIUse&&wx.canIUse("canvas")?("string"==typeof t&&(t=wx.createSelectorQuery().select("#"+t)),i.isWXMiniApp=!0):("string"==typeof t&&"undefined"!=typeof document?t=document.getElementById(t):t.length&&(t=t[0]),"CANVAS"!=t.tagName?(i.container=t,e=document.createElement("canvas"),t.appendChild(e),e.width=t.offsetWidth||t.clientWidth,e.height=t.offsetHeight||t.clientHeight,t=e):i.container=t.parentElement),i.canvas=t,i.context=t.getContext("2d"),i.__init(n),i}return t=o,n=[{key:"create",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return l(o,e)}}],(e=[{key:"__init",value:function(t){this.shapes=Object.assign({path:h.jmPath},this.option.shapes),this.on("beginDraw",function(){this.context.translate(.5,.5)}),this.on("endDraw",function(){this.context.translate(-.5,-.5)}),0<this.option.width&&(this.width=this.option.width),0<this.option.height&&(this.height=this.option.height),this.resize(),this.eventHandler=new a.jmEvents(this,this.canvas.canvas||this.canvas),this.option.autoRefresh&&this.autoRefresh(),t&&t(this)}},{key:"resize",value:function(t,e){var n="undefined"!=typeof window&&1<window.devicePixelRatio?window.devicePixelRatio:1;this.isWXMiniApp?wx.getSystemInfoSync().pixelRatio:1<n&&(this.__normalSize=this.__normalSize||{width:0,height:0},t=t||this.__normalSize.width||this.width,e=e||this.__normalSize.height||this.height,t&&(this.__normalSize.width=t),e&&(this.__normalSize.height=e),this.canvas.style&&(this.canvas.style.width=t+"px"),this.canvas.style&&(this.canvas.style.height=e+"px"),this.canvas.height=e*n,this.canvas.width=t*n,this.context.scale(n,n),this.devicePixelRatio=n)}},{key:"pointToPixes",value:function(t){return t=this.devicePixelRatio&&1!==this.devicePixelRatio?Object.assign({},t,{x:t.x/this.devicePixelRatio,y:t.y/this.devicePixelRatio}):t}},{key:"width",get:function(){return this.canvas?this.canvas.width:0},set:function(t){return this.needUpdate=!0,this.canvas&&(this.canvas.width=t,this.resize(t)),t}},{key:"height",get:function(){return this.canvas?this.canvas.height:0},set:function(t){return this.needUpdate=!0,this.canvas&&(this.canvas.height=t,this.resize(0,t)),t}},{key:"getPosition",value:function(){var t=s.jmUtils.getElementPosition(this.canvas.canvas||this.canvas);return t.width=this.canvas.width,t.height=this.canvas.height,t.right=t.left+t.width,t.bottom=t.top+t.height,t}},{key:"registerShape",value:function(t,e){this.shapes[t]=e}},{key:"createShape",value:function(t,e){if(t="string"==typeof t?this.shapes[t]:t)return(e=e||{}).graph=this,new t(e)}},{key:"createShadow",value:function(t,e,n,i){return new u.jmShadow(t,e,n,i)}},{key:"createLinearGradient",value:function(t,e,n,i){return new c.jmGradient({type:"linear",x1:t,y1:e,x2:n,y2:i})}},{key:"createRadialGradient",value:function(t,e,n,i,r,o){return new c.jmGradient({type:"radial",x1:t,y1:e,r1:n,x2:i,y2:r,r2:o})}},{key:"refresh",value:function(){this.redraw()}},{key:"redraw",value:function(t,e){this.clear(t||this.width,e||this.height),this.paint()}},{key:"clear",value:function(t,e){t&&e?(this.canvas.width=t,this.canvas.height=e,this.scaleSize&&this.context.scale&&this.context.scale(this.scaleSize.x,this.scaleSize.y)):(t=this.canvas.width,e=this.canvas.height,this.scaleSize&&(t/=this.scaleSize.x,e/=this.scaleSize.y)),this.style&&this.style.fill?this.points=[{x:0,y:0},{x:t,y:0},{x:t,y:e},{x:0,y:e}]:this.context.clearRect&&this.context.clearRect(0,0,t,e)}},{key:"css",value:function(t,e){if(this.canvas&&this.canvas.style)return void 0!==e&&(this.canvas.style[t]=e),this.canvas.style[t]}},{key:"createPath",value:function(t,e){return this.createShape("path",{points:t,style:e})}},{key:"createLine",value:function(t,e,n){return this.createShape("line",{start:t,end:e,style:n})}},{key:"zoomOut",value:function(){this.scale(.9,.9)}},{key:"zoomIn",value:function(){this.scale(1.1,1.1)}},{key:"zoomActual",value:function(){this.scaleSize?this.scale(1/this.scaleSize.x,1/this.scaleSize.y):this.scale(1,1)}},{key:"scale",value:function(t,e){this.normalSize||(this.normalSize={width:this.canvas.width,height:this.canvas.height}),this.context.scale(t,e),this.scaleSize?this.scaleSize={x:t*this.scaleSize.x,y:e*this.scaleSize.y}:this.scaleSize={x:t,y:e},this.refresh()}},{key:"toDataURL",value:function(){return this.canvas.toDataURL?this.canvas.toDataURL():""}},{key:"autoRefresh",value:function(e){if(!this.___isAutoRefreshing){var n=this;return this.___isAutoRefreshing=!0,n.__requestAnimationFrameFunHandler&&s.jmUtils.cancelAnimationFrame(n.__requestAnimationFrameFunHandler),n.__requestAnimationFrameFunHandler=s.jmUtils.requestAnimationFrame(function t(){n.destroyed?n.___isAutoRefreshing=!1:(n.needUpdate&&n.redraw(),n.__requestAnimationFrameFunHandler&&s.jmUtils.cancelAnimationFrame(n.__requestAnimationFrameFunHandler),n.__requestAnimationFrameFunHandler=s.jmUtils.requestAnimationFrame(t),e&&e())}),this}}},{key:"destroy",value:function(){this.eventHandler.destroy(),this.destroyed=!0}}])&&p(t.prototype,e),n&&p(t,n),o}();n.jmGraph=n.default=t},{"./jmControl.js":2,"./jmEvents.js":3,"./jmGradient.js":4,"./jmList.js":6,"./jmPath.js":8,"./jmProperty.js":9,"./jmShadow.js":10,"./jmUtils.js":11}],6:[function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function a(t,e){if(e&&("object"===o(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}function f(t){var n="function"==typeof Map?new Map:void 0;return function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return i(t,arguments,p(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),l(e,t)}(t)}function i(t,e,n){return(i=h()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);i=new(Function.bind.apply(t,i));return n&&l(i,n.prototype),i}).apply(null,arguments)}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmList=n.default=void 0;var r=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(u,f(Array));var n,i,t,e,r,s=(n=u,i=h(),function(){var t,e=p(n);return a(this,i?(t=p(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))});function u(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);for(var e=[],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];if(i&&i.length&&Array.isArray(i[0])){for(var o=0;o<i[0].length;o++)e.push(i[0][o]);t=s.call.apply(s,[this].concat(e))}else t=s.call(this);return t.option={},t.type="jmList",a(t)}return t=u,(e=[{key:"add",value:function(t){if(t&&Array.isArray(t)){for(var e=0;e<t.length;e++)this.includes(t[e])||this.push(t[e]);return t}return"object"==o(t)&&this.includes(t)||this.push(t),t}},{key:"remove",value:function(t){for(var e=this.length-1;0<=e;e--)this[e]==t&&this.removeAt(e)}},{key:"removeAt",value:function(t){var e;this.length>t&&(e=this[t],this.splice(t,1),this.option.removeHandler&&this.option.removeHandler.call(this,e,t))}},{key:"contain",value:function(t){return this.includes(t)}},{key:"get",value:function(t){return"function"==typeof t?this.find(t):this[t]}},{key:"each",value:function(t,e){if(t&&"function"==typeof t)if(e){for(var n=this.length-1;0<=n;n--)if(!1===t.call(this,n,this[n]))break}else for(var i=this.length,r=0;r<i;r++)if(!1===t.call(this,r,this[r]))break}},{key:"count",value:function(t){if(t&&"function"==typeof t){for(var e=0,n=this.length,i=0;i<n;i++)t(this[i])&&e++;return e}return this.length}},{key:"clear",value:function(){this.splice(0,this.length)}}])&&c(t.prototype,e),r&&c(t,r),u}();n.jmList=n.default=r},{}],7:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmObject=n.default=void 0;var r=t("./jmList.js");function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Symbol("jmchart#animate#counter");t=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t&&"jmGraph"==t.type&&(this.graph=t)}var t,n,i;return t=e,(n=[{key:"is",value:function(t){return"string"==typeof t?this.type==t:this instanceof t}},{key:"animate",value:function(){if(this.is("jmGraph")){if(1<arguments.length){this.animateHandles||(this.animateHandles=new r.jmList);var t=[];if(2<arguments.length)for(var e=2;e<arguments.length;e++)t.push(e<0||arguments.length<=e?void 0:arguments[e]);this.animateHandles.add({millisec:(arguments.length<=1?void 0:arguments[1])||20,handle:arguments.length<=0?void 0:arguments[0],params:t})}var o;this.animateHandles&&0<this.animateHandles.count()&&((o=this).dispatcher=setTimeout(function(n){n=n||o;var t,i=[],r=(new Date).getTime();for(t in n.animateHandles.each(function(t,e){try{e&&e.handle&&(!e.times||r-e.times>=e.millisec)&&(!1===e.handle.apply(n,e.params)&&i.push(e),e.times=r)}catch(t){window.console&&window.console.info&&window.console.info(t.toString()),e&&i.push(e)}}),i)n.animateHandles.remove(i[t]);n.animate()},10,this))}else{var n=this.graph;n&&n.animate.apply(n,arguments)}}}])&&o(t.prototype,n),i&&o(t,i),e}();n.jmObject=n.default=t},{"./jmList.js":6}],8:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmPath=n.default=void 0;var o=t("./jmControl.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmControl);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmPath";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t,e)).points=t&&t.points?t.points:[],e}return t=r,(e=[{key:"points",get:function(){return this.__pro("points")},set:function(t){return this.needUpdate=!0,this.__pro("points",t)}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmPath=n.default=t},{"./jmControl.js":2}],9:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmProperty=n.default=void 0;var o=t("./jmObject.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=Symbol("properties"),t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmObject);var t,e,n,i=c(r);function r(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(t=i.call(this))[f]={},t}return t=r,(e=[{key:"__pro",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(e){var i=this[f],r=e[0];if(1<e.length){var o=e[1],o={oldValue:i[r],newValue:o};return i[r]=e[1],this.emit&&this.emit("propertyChange",r,o),e[1]}if(1==e.length)return i[r]}}},{key:"needUpdate",get:function(){return this.__pro("needUpdate")},set:function(t){this.__pro("needUpdate",t),t&&!this.is("jmGraph")&&this.graph&&(this.graph.needUpdate=!0)}},{key:"graph",get:function(){return this.__pro("graph")||this.__pro("graph",this.findParent("jmGraph"))},set:function(t){return this.__pro("graph",t)}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmProperty=n.default=t},{"./jmObject.js":7}],10:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmShadow=n.default=void 0;var i=t("./jmUtils.js");function o(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}n.jmShadow=n.default=function(){function r(t,e,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),"string"!=typeof t||e||n||i?(this.x=t,this.y=e,this.blur=n,this.color=i):this.fromString(t)}var t,e,n;return t=r,(e=[{key:"fromString",value:function(t){if(t){t=t.match(/\s*([^,]+)\s*,\s*([^,]+)\s*(,[^,]+)?\s*(,[\s\S]+)?\s*/i);return t&&(this.x=t[1]||0,this.y=t[2]||0,t[3]&&(t[3]=i.jmUtils.trim(t[3],", "),0===t[3].indexOf("#")||/^rgb/i.test(t[3])?this.color=t[3]:this.blur=i.jmUtils.trim(t[3],", ")),t[4]&&(this.color=i.jmUtils.trim(t[4],", "))),this}}},{key:"toString",value:function(){var t=this.x+","+this.y;return this.blur&&(t+=","+this.blur),this.color&&(t+=","+this.color),t}}])&&o(t.prototype,e),n&&o(t,n),r}()},{"./jmUtils.js":11}],11:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.jmUtils=n.default=void 0;var a=t("./jmList.js");function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}t=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,i,r,o;function s(t){return r.apply(this,arguments)}function u(t){return o.apply(this,arguments)}return e=t,n=null,i=[{key:"clone",value:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0;if("function"==typeof i){var o=i(t,n,r);if(o)return o}if("boolean"==typeof e&&(n=e,e=void 0),100<++r)return e;if(t&&"object"===f(t)){if(e=e||{},this.isType(t,a.jmList))return new a.jmList(t);if(Array.isArray(t)){if(n){for(var s=[],u=0;u<t.length;u++)s.push(this.clone(t[u],e[u],n,i,r));return s}return t.slice(0)}for(var c in t.__proto__&&(e.__proto__=t.__proto__),t)"constructor"!==c&&("object"!==f(e[c])&&void 0!==e[c]||(e[c]=this.clone(t[c],e[c],n,i,r)));return e}return void 0!==e?e:t}},{key:"bindEvent",value:function(t,e,n,i){if(e&&e.indexOf&&-1!=e.indexOf(" "))for(var r=e.split(" "),o=0;o<r.length;o++)this.bindEvent(t,r[o],n,i);return t.attachEvent?t.attachEvent("on"+e,n,i):t.addEventListener&&t.addEventListener(e,n,i),{name:e,target:t,fun:n}}},{key:"removeEvent",value:function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent?(t.detachEvent("on"+e,n),!0):void(t["on"+e]=null)}},{key:"getElementPosition",value:function(t){var e={top:0,left:0};if(!t)return e;if(t.offsetParent)for(;t.offsetParent;)e.top+=t.offsetTop,e.left+=t.offsetLeft,t=t.offsetParent;else t.x?e.left+=t.x:t.x&&(e.top+=t.y);return e}},{key:"getEventPosition",value:function(t,e){var n=!1,i=(t=t||event).changedTouches||t.targetTouches||t.touches,r=t.target||t.srcElement;i&&i.length&&((t=i[0]).target||(t.target=r),n=!0);var o=t.pageX||t.x;void 0===o&&(o=t.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));var s=t.pageY||t.y;void 0===s&&(s=t.clientY+(document.documentElement.scrollTop||document.body.scrollTop));var u=t.offsetX,c=t.offsetY;return void 0===u&&void 0===c&&(u=o-(r=this.getElementPosition(r)).left,c=s-r.top),e&&(e.x&&(u/=e.x),e.y&&(c/=e.y)),{pageX:o,pageY:s,clientX:t.clientX,clientY:t.clientY,offsetX:u,offsetY:c,layerX:t.layerX,layerY:t.layerY,screenX:t.screenX,screenY:t.screenY,x:u,y:c,isTouch:n,touches:i}}},{key:"isType",value:function(t,e){return!(!t||"object"!==f(t))&&t.constructor===e}},{key:"pointInPolygon",value:function(t,e,n){n=n||1,n/=2;var i,r,o=e.length,s=!1,u=!0;if(!e||0==o)return 0;if(1==o)return Math.abs(e[0].x-t.x)<=n&&Math.abs(e[0].y-t.y)<=n;if(2==o){if(Math.min(e[0].x,e[1].x)-t.x>n||t.x-Math.max(e[0].x,e[1].x)>n)return 0;if(Math.min(e[0].y,e[1].y)-t.y>n||t.y-Math.max(e[0].y,e[1].y)>n)return 0;if(e[0].x==e[1].x)return Math.abs(e[0].x-t.x)<=n&&(t.y-e[0].y)*(t.y-e[1].y)<=0?1:0;if(e[0].y==e[1].y)return Math.abs(e[0].y-t.y)<=n&&(t.x-e[0].x)*(t.x-e[1].x)<=0?1:0;if(Math.abs(e[0].x-t.x)<n&&Math.abs(e[0].y-t.y)<n)return 1;if(Math.abs(e[1].x-t.x)<n&&Math.abs(e[1].y-t.y)<n)return 1;if(t.y==e[0].y||t.y==e[1].y)return 0;var c=(e[1].x-e[0].x)/(e[1].y-e[0].y)*(t.y-e[0].y),c=(t.y-e[0].y)/Math.sqrt(c*c+(t.y-e[0].y)*(t.y-e[0].y))*(t.x-e[0].x-c);return Math.abs(c)<=n?1:0}for(i=0;i<o;++i)if(e[i].x==t.x&&e[i].y==t.y)return 1;for(;u;)for(s=u=!1,i=0,r=o-1;i<o;r=i++)if(e[i].y<t.y&&t.y<e[r].y||e[r].y<t.y&&t.y<e[i].y){if(t.x<=e[i].x||t.x<=e[r].x){var a=(t.y-e[i].y)*(e[r].x-e[i].x)/(e[r].y-e[i].y)+e[i].x;if(t.x<a)s=!s;else if(t.x==a)return 1}}else if(t.y==e[i].y){if(t.x<e[i].x){e[i].y>e[r].y?--t.y:++t.y,u=!0;break}}else if(e[i].y==e[r].y&&t.y==e[i].y&&(e[i].x<t.x&&t.x<e[r].x||e[r].x<t.x&&t.x<e[i].x)){s=!0;break}return s?2:0}},{key:"checkOutSide",value:function(t,e,n){var i={left:0,right:0,top:0,bottom:0};return n.x<0?i.left=e.left+n.x-t.left:0<n.x&&(i.right=e.right+n.x-t.right),n.y<0?i.top=e.top+n.y-t.top:0<n.y&&(i.bottom=e.bottom+n.y-t.bottom),i}},{key:"rotatePoints",value:function(t,e,n){if(!n||!t)return t;var i=Math.cos(n),r=Math.sin(n);if(t.length)for(var o,s,u=0;u<t.length;u++)t[u]&&(o=t[u].x-e.x,s=t[u].y-e.y,t[u].x=o*i-s*r+e.x,t[u].y=o*r+s*i+e.y);else{var c=t.x-e.x,n=t.y-e.y;t.x=c*i-n*r+e.x,t.y=c*r+n*i+e.y}return t}},{key:"trimStart",value:function(t,e){if(e=e||" ",t&&0<t.length){var n=t[0];if(n===e||0<=e.indexOf(n))return t=t.substring(1),this.trimStart(t,e)}return t}},{key:"trimEnd",value:function(t,e){if(e=e||" ",t&&0<t.length){var n=t[t.length-1];if(n===e||0<=e.indexOf(n))return t=t.substring(0,t.length-1),this.trimStart(t,e)}return t}},{key:"trim",value:function(t,e){return this.trimEnd(this.trimStart(t,e),e)}},{key:"checkPercent",value:function(t){if("string"==typeof t&&"%"==(t=this.trim(t))[t.length-1])return t}},{key:"percentToNumber",value:function(t){var e;return"string"!=typeof t||(e=this.checkPercent(t))&&(t=this.trim(e,"% "),t/=100),t}},{key:"hexToNumber",value:function(t){if("string"!=typeof t)return t;for(var e=0,n=(t=t.toLowerCase()).length,i=0;i<n;i++){var r="0123456789abcdef".indexOf(t[i]);if(0!=r){for(var o=1;o<n-i;o++)r*=16;e+=r}}return e}},{key:"numberToHex",value:function(t){for(var e="";0<t;){e="0123456789abcdef"[t%16]+e;t=Math.floor(t/16)}return e}},{key:"hexToRGBA",value:function(t){if("#"==(t=this.trim(t))[0]){var e={a:1};if(8<=t.length)return e.a=t.substr(1,2),e.g=t.substr(5,2),e.b=t.substr(7,2),e.r=t.substr(3,2),e.a=(this.hexToNumber(e.a)/255).toFixed(4),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),e;if(7===t.length||4===t.length)return 4===t.length?(e.g=t.substr(2,1),e.g=e.g+e.g,e.b=t.substr(3,1),e.b=e.b+e.b,e.r=t.substr(1,1),e.r=e.r+e.r):(e.g=t.substr(3,2),e.b=t.substr(5,2),e.r=t.substr(1,2)),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),e;if(5===t.length)return e.a=t.substr(1,1),e.g=t.substr(3,1),e.b=t.substr(4,1),e.r=t.substr(2,1),e.r=this.hexToNumber(e.r||0),e.g=this.hexToNumber(e.g||0),e.b=this.hexToNumber(e.b||0),e.a=(this.hexToNumber(e.a)/255).toFixed(4),e}return t}},{key:"toColor",value:function(t,e,n,i){if("string"==typeof t&&t){if("#"===(t=this.trim(t))[0]&&(4===t.length||7===t.length))return t;var r=this.hexToRGBA(t);if("string"==typeof r)return r;t=r.r||t,e=r.g||e,n=r.b||n,i=r.a||i}return void 0!==t&&void 0!==e&&void 0!==n?void 0!==i?"rgba("+t+","+e+","+n+","+i+")":"rgb("+t+","+e+","+n+")":t}},{key:"requestAnimationFrame",value:(o=function(t){return"undefined"==typeof requestAnimationFrame?setTimeout(t,20):requestAnimationFrame(t)},u.toString=function(){return o.toString()},u)},{key:"cancelAnimationFrame",value:(r=function(t){return("undefined"==typeof requestAnimationFrame?clearTimeout:cancelAnimationFrame)(t)},s.toString=function(){return r.toString()},s)}],n&&c(e.prototype,n),i&&c(e,i),t}();n.jmUtils=n.default=t},{"./jmList.js":6}],12:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmArc=n.default=void 0;var o=t("../core/jmPath.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmArc";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t=t||{},e)).center=t.center||{x:0,y:0},e.radius=t.radius||0,e.startAngle=t.start||t.startAngle||0,e.endAngle=t.end||t.endAngle||2*Math.PI,e.anticlockwise=t.anticlockwise||0,e.isFan=!!t.isFan,e}return t=r,(e=[{key:"center",get:function(){return this.__pro("center")},set:function(t){return this.needUpdate=!0,this.__pro("center",t)}},{key:"radius",get:function(){return this.__pro("radius")},set:function(t){return this.needUpdate=!0,this.__pro("radius",t)}},{key:"startAngle",get:function(){return this.__pro("startAngle")},set:function(t){return this.needUpdate=!0,this.__pro("startAngle",t)}},{key:"endAngle",get:function(){return this.__pro("endAngle")},set:function(t){return this.needUpdate=!0,this.__pro("endAngle",t)}},{key:"anticlockwise",get:function(){return this.__pro("anticlockwise")},set:function(t){return this.needUpdate=!0,this.__pro("anticlockwise",t)}},{key:"initPoints",value:function(){var t=this.getLocation(),e=0,n=0,i=t.center.x,r=t.center.y;t.radius?e=n=t.radius:(e=t.width/2,n=t.height/2);var o=this.startAngle,s=this.endAngle;if((0!=e||0!=n)&&o!=s){var u=this.anticlockwise;this.points=[];var c=1/Math.max(e,n);u&&(o=(u=2*Math.PI)-o,s=u-s),s<o&&(c=-c),this.isFan&&this.points.push(t.center);for(var a=o;;a+=c){(0<c&&s<a||c<0&&a<s)&&(a=s);var f={x:Math.cos(a)*e+i,y:Math.sin(a)*n+r};if(this.points.push(f),a==s)break}return this.points}}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmArc=n.default=t},{"../core/jmPath.js":8}],13:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmArrow=n.default=void 0;var o=t("../core/jmPath.js"),c=t("../core/jmUtils.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=f(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=f(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=a(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmArrow";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t,e)).style.lineJoin="miter",e.style.lineCap="square",e.angle=t.angle||0,e.start=t.start||{x:0,y:0},e.end=t.end||{x:0,y:0},e.offsetX=t.offsetX||5,e.offsetY=t.offsetY||8,e}return t=r,(e=[{key:"start",get:function(){return this.__pro("start")},set:function(t){return this.needUpdate=!0,this.__pro("start",t)}},{key:"end",get:function(){return this.__pro("end")},set:function(t){return this.needUpdate=!0,this.__pro("end",t)}},{key:"angle",get:function(){return this.__pro("angle")},set:function(t){return this.needUpdate=!0,this.__pro("angle",t)}},{key:"offsetX",get:function(){return this.__pro("offsetX")},set:function(t){return this.needUpdate=!0,this.__pro("offsetX",t)}},{key:"offsetY",get:function(){return this.__pro("offsetY")},set:function(t){return this.needUpdate=!0,this.__pro("offsetY",t)}},{key:"initPoints",value:function(t){var e=this.angle,n=this.start,i=this.end;if(i){e=e||Math.atan2(i.y-n.y,i.x-n.x),this.points=[];var r=this.offsetX,o=this.offsetY,s=Math.atan2(r,o),u=e+s,n=Math.sin(u),u=Math.cos(u),r=Math.sqrt(r*r+o*o),o={x:i.x-u*r,y:i.y-n*r},s=e-s,n=Math.sin(s),u=Math.cos(s),n={x:i.x-u*r,y:i.y-n*r},r=c.jmUtils.clone(i);return r.m=!0,this.points.push(r),this.points.push(o),t||this.style.fill?(this.points.push(n),this.points.push(i)):(this.points.push(r),this.points.push(n)),this.points}}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmArrow=n.default=t},{"../core/jmPath.js":8,"../core/jmUtils.js":11}],14:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmArrowLine=n.default=void 0;var o=t("./jmLine.js"),s=t("./jmArrow.js");function u(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function c(t,e,n){return(c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){t=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(t){e=Object.getOwnPropertyDescriptor(t,e);return e.get?e.get.call(n):e.value}})(t,e,n||t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=h(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=h(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(r,o.jmLine);var t,e,n,i=f(r);function r(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),t.start=t.start||{x:0,y:0},t.end=t.end||{x:0,y:0},(e=i.call(this,t,e||"jmArrowLine")).style.lineJoin=e.style.lineJoin||"miter",e.arrow=new s.jmArrow(t),e}return t=r,(e=[{key:"initPoints",value:function(){return this.points=c(h(r.prototype),"initPoints",this).call(this),!1!==this.arrowVisible&&(this.points=this.points.concat(this.arrow.initPoints())),this.points}}])&&u(t.prototype,e),n&&u(t,n),r}();n.jmArrowLine=n.default=t},{"./jmArrow.js":13,"./jmLine.js":20}],15:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmBezier=n.default=void 0;var o=t("../core/jmPath.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmBezier";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),t.style&&!0!==typeof t.style.close&&(t.style.close=!1),(e=i.call(this,t,e)).cpoints=t.points||[],e}return t=r,(e=[{key:"cpoints",get:function(){return this.__pro("cpoints")},set:function(t){return this.needUpdate=!0,this.__pro("cpoints",t)}},{key:"initPoints",value:function(){this.points=[];for(var t=this.cpoints,e=0;e<=1;e+=.01){var n=this.getPoint(t,e);this.points.push(n)}return this.points.push(t[t.length-1]),this.points}},{key:"getPoint",value:function(t,e){if(1==t.length)return t[0];if(2==t.length){var n={};return n.x=(t[1].x-t[0].x)*e+t[0].x,n.y=(t[1].y-t[0].y)*e+t[0].y,n}if(2<t.length){for(var i=[],r=0;r<t.length-1;r++){var o=this.getPoint([t[r],t[r+1]],e);o&&i.push(o)}return this.getPoint(i,e)}}},{key:"offset",value:function(t,e,n){var i=this.cpoints;if(i){for(var r=i.length,o=0;o<r;o++)i[o].x+=t,i[o].y+=e;this.emit("move",{offsetX:t,offsetY:e,trans:n}),this.getLocation(!0)}}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmBezier=n.default=t},{"../core/jmPath.js":8}],16:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmCircle=n.default=void 0;var o=t("./jmArc.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmArc);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmCircle";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),i.call(this,t,e)}return t=r,(e=[{key:"initPoints",value:function(){var t=this.getLocation();t.radius||(t.radius=Math.min(t.width,t.height)/2),this.points=[],this.points.push({x:t.center.x-t.radius,y:t.center.y-t.radius}),this.points.push({x:t.center.x+t.radius,y:t.center.y-t.radius}),this.points.push({x:t.center.x+t.radius,y:t.center.y+t.radius}),this.points.push({x:t.center.x-t.radius,y:t.center.y+t.radius})}},{key:"draw",value:function(){var t=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds,e=this.getLocation();e.radius||(e.radius=Math.min(e.width,e.height)/2);var n=this.startAngle,i=this.endAngle,r=this.anticlockwise;this.context.arc(e.center.x+t.left,e.center.y+t.top,e.radius,n,i,r)}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmCircle=n.default=t},{"./jmArc.js":12}],17:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmHArc=n.default=void 0;var o=t("./jmArc.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmArc);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmHArc";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t,e)).minRadius=t.minRadius||e.style.minRadius||0,e.maxRadius=t.maxRadius||e.style.maxRadius||0,e}return t=r,(e=[{key:"minRadius",get:function(){return this.__pro("minRadius")},set:function(t){return this.needUpdate=!0,this.__pro("minRadius",t)}},{key:"maxRadius",get:function(){return this.__pro("maxRadius")},set:function(t){return this.needUpdate=!0,this.__pro("maxRadius",t)}},{key:"initPoints",value:function(){var t,e=this.getLocation(),n=this.minRadius,i=this.maxRadius,r=this.startAngle,o=this.endAngle;this.anticlockwise&&(r=(t=2*Math.PI)-r,o=t-o);var s=.1;o<r&&(s=-s);for(var u=[],c=[],a=r;;a+=s){(0<s&&o<a||s<0&&a<o)&&(a=o);var f=Math.cos(a),h=Math.sin(a),l={x:f*n+e.center.x,y:h*n+e.center.y},h={x:f*i+e.center.x,y:h*i+e.center.y};if(u.push(l),c.push(h),a===o)break}c.reverse(),this.style&&this.style.close||(c[0].m=!0),this.points=u.concat(c)}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmHArc=n.default=t},{"./jmArc.js":12}],18:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmImage=n.default=void 0;var o=t("../core/jmControl.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmControl);var t,e,n,i=c(r);function r(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t=t||{},e||"jmImage")).style.fill=e.fill||"transparent",e.sourceWidth=t.sourceWidth,e.sourceHeight=t.sourceHeight,e.sourcePosition=t.sourcePosition,e.image=t.image||e.style.image,e}return t=r,(e=[{key:"sourcePosition",get:function(){return this.__pro("sourcePosition")},set:function(t){return this.__pro("sourcePosition",t)}},{key:"sourceWidth",get:function(){return this.__pro("sourceWidth")},set:function(t){return this.needUpdate=!0,this.__pro("sourceWidth",t)}},{key:"sourceHeight",get:function(){return this.__pro("sourceHeight")},set:function(t){return this.needUpdate=!0,this.__pro("sourceHeight",t)}},{key:"image",get:function(){return this.__pro("image")},set:function(t){return this.needUpdate=!0,this.__pro("image",t)}},{key:"draw",value:function(){var t=this;try{var e,n=this.getImage();this.graph.isWXMiniApp&&this.graph.canvas&&"string"==typeof n?((e=this.graph.canvas.createImage()).onload=function(){t.drawImg(e)},e.src=n):this.drawImg(n)}catch(t){console.error&&console.error(t)}}},{key:"drawImg",value:function(t){var e,n,i,r;t?(r=(r=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds)||(this.parent&&this.parent.getAbsoluteBounds?this.parent:this).getAbsoluteBounds(),(e=this.getLocation()).left+=r.left,e.top+=r.top,n=this.sourcePosition,i=this.sourceWidth,r=this.sourceHeight,n||void 0!==i||void 0!==r?(void 0===i&&(i=e.width||t.width||0),void 0===r&&(r=e.height||t.height||0),n=n||{x:0,y:0},e.width&&e.height?this.context.drawImage(t,n.x,n.y,i,r,e.left,e.top,e.width,e.height):e.width?this.context.drawImage(t,n.x,n.y,i,r,e.left,e.top,e.width,r):e.height?this.context.drawImage(t,n.x,n.y,i,r,e.left,e.top,i,e.height):this.context.drawImage(t,n.x,n.y,i,r,e.left,e.top,i,r)):e?e.width&&e.height?this.context.drawImage(t,e.left,e.top,e.width,e.height):e.width?this.context.drawImage(t,e.left,e.top,e.width,t.height):e.height?this.context.drawImage(t,e.left,e.top,t.width,e.height):this.context.drawImage(t,e.left,e.top):this.context.drawImage(t)):console.warn("image is empty")}},{key:"getBounds",value:function(){var t={},e=this.getImage(),n=this.getLocation(),i=n.width||e.width,e=n.height||e.height;return t.left=n.left,t.top=n.top,t.right=n.left+i,t.bottom=n.top+e,t.width=i,t.height=e,t}},{key:"getImage",value:function(){var t=this.image||this.style.src||this.style.image;return this.__img&&this.__img.src&&-1!=this.__img.src.indexOf(t)||((!t||!t.src)&&"undefined"!=typeof document&&document.createElement?(this.__img=document.createElement("img"),t&&"string"==typeof t&&(this.__img.src=t)):this.__img=t),this.__img}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmImage=n.default=t},{"../core/jmControl.js":2}],19:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmLabel=n.default=void 0;var o=t("../core/jmControl.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){t=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=f(t)););return t}(t,e);if(t){e=Object.getOwnPropertyDescriptor(t,e);return e.get?e.get.call(n):e.value}})(t,e,n||t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=f(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=f(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function f(t){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(r,o.jmControl);var t,e,n,i=a(r);function r(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t=t||{},e||"jmLabel")).style.font=e.style.font||"15px Arial",e.style.fontFamily=e.style.fontFamily||"Arial",e.style.fontSize=e.style.fontSize||15,e.style.textAlign=e.style.textAlign||"left",e.style.textBaseline=e.style.textBaseline||"middle",e.text=t.text||"",e.center=t.center||null,e}return t=r,(e=[{key:"text",get:function(){return this.__pro("text")},set:function(t){return this.needUpdate=!0,this.__pro("text",t)}},{key:"center",get:function(){return this.__pro("center")},set:function(t){return this.needUpdate=!0,this.__pro("center",t)}},{key:"position",get:function(){return this.__pro("position")},set:function(t){return this.needUpdate=!0,this.__pro("position",t)}},{key:"getLocation",value:function(){var t=u(f(r.prototype),"getLocation",this).call(this),e=this.testSize();return t.width=t.width||e.width,t.height=t.height||e.height,t.left||t.top||!t.center||(t.left=t.center.x-t.width/2,t.top=t.center.y-t.height/2),t}},{key:"initPoints",value:function(){this.__size=null;var t=this.getLocation();return this.points=[{x:t.left,y:t.top}],this.points.push({x:t.left+t.width,y:t.top}),this.points.push({x:t.left+t.width,y:t.top+t.height}),this.points.push({x:t.left,y:t.top+t.height}),this.points}},{key:"testSize",value:function(){return this.__size||(this.context.save(),this.setStyle({font:this.style.font||this.style.fontSize+"px "+this.style.fontFamily}),this.__size=this.context.measureText?this.context.measureText(this.text):{width:15},this.context.restore(),this.__size.height=this.style.fontSize||15,this.width||(this.width=this.__size.width),this.height||(this.height=this.__size.height),this.__size)}},{key:"draw",value:function(){var t=(this.parent&&this.parent.absoluteBounds?this.parent:this).absoluteBounds,e=(this.testSize(),this.location),n=e.left+t.left,i=e.top+t.top;switch(this.style.textAlign){case"right":n+=e.width;break;case"center":n+=e.width/2}switch(this.style.textBaseline){case"bottom":i+=e.height;break;case"hanging":case"alphabetic":case"middle":i+=e.height/2}var r=this.text;void 0!==r&&(this.style.fill&&this.context.fillText?this.style.maxWidth?this.context.fillText(r,n,i,this.style.maxWidth):this.context.fillText(r,n,i):this.context.strokeText&&(this.style.maxWidth?this.context.strokeText(r,n,i,this.style.maxWidth):this.context.strokeText(r,n,i))),this.style.border&&(this.style.border.style&&(this.context.save(),this.setStyle(this.style.border.style)),this.context.moveTo(this.points[0].x+t.left,this.points[0].y+t.top),this.style.border.top&&this.context.lineTo(this.points[1].x+t.left,this.points[1].y+t.top),this.style.border.right&&(this.context.moveTo(this.points[1].x+t.left,this.points[1].y+t.top),this.context.lineTo(this.points[2].x+t.left,this.points[2].y+t.top)),this.style.border.bottom&&(this.context.moveTo(this.points[2].x+t.left,this.points[2].y+t.top),this.context.lineTo(this.points[3].x+t.left,this.points[3].y+t.top)),this.style.border.left&&(this.context.moveTo(this.points[3].x+t.left,this.points[3].y+t.top),this.context.lineTo(this.points[0].x+t.left,this.points[0].y+t.top)),this.style.border.style&&this.context.restore())}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmLabel=n.default=t},{"../core/jmControl.js":2}],20:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmLine=n.default=void 0;var o=t("../core/jmPath.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmLine";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t,e)).start=t.start||{x:0,y:0},e.end=t.end||{x:0,y:0},e.style.lineType=e.style.lineType||"solid",e.style.dashLength=e.style.dashLength||4,e}return t=r,(e=[{key:"start",get:function(){return this.__pro("start")},set:function(t){return this.needUpdate=!0,this.__pro("start",t)}},{key:"end",get:function(){return this.__pro("end")},set:function(t){return this.needUpdate=!0,this.__pro("end",t)}},{key:"initPoints",value:function(){var t=this.start,e=this.end;if(this.points=[],this.points.push(t),"dotted"===this.style.lineType){var n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i);n/=r,i/=r;for(var o=!1,s=this.style.dashLength||5,u=s/2,c=s;c<=r;)0==o?(this.points.push({x:t.x+n*c,y:t.y+i*c}),c+=u):(this.points.push({x:t.x+n*c,y:t.y+i*c,m:!0}),c+=s),o=!o}return this.points.push(e),this.points}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmLine=n.default=t},{"../core/jmPath.js":8}],21:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmPrismatic=n.default=void 0;var o=t("../core/jmPath.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmPrismatic";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t,e)).style.close=void 0===e.style.close||e.style.close,e.center=t.center||{x:0,y:0},e.width=t.width||0,e.height=t.height||0,e}return t=r,(e=[{key:"center",get:function(){return this.__pro("center")},set:function(t){return this.needUpdate=!0,this.__pro("center",t)}},{key:"initPoints",value:function(){var t=this.getLocation(),e=t.width/2,n=t.height/2;this.points=[],this.points.push({x:t.center.x-e,y:t.center.y}),this.points.push({x:t.center.x,y:t.center.y+n}),this.points.push({x:t.center.x+e,y:t.center.y}),this.points.push({x:t.center.x,y:t.center.y-n})}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmPrismatic=n.default=t},{"../core/jmPath.js":8}],22:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmRect=n.default=void 0;var o=t("../core/jmPath.js"),f=t("./jmArc.js"),h=t("./jmLine.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmPath);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmRect";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t=t||{},e)).style.close=!0,e.radius=t.radius||e.style.radius||0,e}return t=r,(e=[{key:"radius",get:function(){return this.__pro("radius")},set:function(t){return this.needUpdate=!0,this.__pro("radius",t)}},{key:"position",get:function(){return this.__pro("position")},set:function(t){return this.needUpdate=!0,this.__pro("position",t)}},{key:"getBounds",value:function(){var t={};this.initPoints();var e=this.getLocation();return t.left=e.left,t.top=e.top,t.right=e.left+e.width,t.bottom=e.top+e.height,t.width=t.right-t.left,t.height=t.bottom-t.top,t}},{key:"initPoints",value:function(){var t,e,n,i,r,o=this.getLocation(),s={x:o.left,y:o.top},u={x:o.left+o.width,y:o.top},c={x:o.left+o.width,y:o.top+o.height},a={x:o.left,y:o.top+o.height};return"dotted"!==this.style.lineType||this.dottedLine||(this.dottedLine=this.graph.createShape(h.jmLine,{style:this.style})),o.radius&&o.radius<o.width/2&&o.radius<o.height/2?(t=Math.PI/2,(r=this.graph.createShape(f.jmArc,{radius:o.radius,anticlockwise:!1})).center={x:o.left+o.radius,y:o.top+o.radius},r.startAngle=Math.PI,r.endAngle=Math.PI+t,e=r.initPoints(),(r=this.graph.createShape(f.jmArc,{radius:o.radius,anticlockwise:!1})).center={x:u.x-o.radius,y:u.y+o.radius},r.startAngle=Math.PI+t,r.endAngle=2*Math.PI,n=r.initPoints(),(r=this.graph.createShape(f.jmArc,{radius:o.radius,anticlockwise:!1})).center={x:c.x-o.radius,y:c.y-o.radius},r.startAngle=0,r.endAngle=t,i=r.initPoints(),(r=this.graph.createShape(f.jmArc,{radius:o.radius,anticlockwise:!1})).center={x:a.x+o.radius,y:a.y-o.radius},r.startAngle=t,r.endAngle=Math.PI,r=r.initPoints(),this.points=e.concat(n,i,r)):(this.points=[],this.points.push(s),this.dottedLine&&(this.dottedLine.start=s,this.dottedLine.end=u,this.points=this.points.concat(this.dottedLine.initPoints())),this.points.push(u),this.dottedLine&&(this.dottedLine.start=u,this.dottedLine.end=c,this.points=this.points.concat(this.dottedLine.initPoints())),this.points.push(c),this.dottedLine&&(this.dottedLine.start=c,this.dottedLine.end=a,this.points=this.points.concat(this.dottedLine.initPoints())),this.points.push(a),this.dottedLine&&(this.dottedLine.start=a,this.dottedLine.end=s,this.points=this.points.concat(this.dottedLine.initPoints()))),this.points}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmRect=n.default=t},{"../core/jmPath.js":8,"./jmArc.js":12,"./jmLine.js":20}],23:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.jmResize=n.default=void 0;var o=t("./jmRect.js");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(n){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=a(n);return function(t,e){{if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined")}return function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(t)}(this,i?(t=a(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}t=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(r,o.jmRect);var t,e,n,i=c(r);function r(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"jmResize";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),(e=i.call(this,t=t||{},e)).resizable=!1!==t.resizable,e.movable=t.movable,e.rectSize=t.rectSize||8,e.style.close=e.style.close||!0,e.init(t),e}return t=r,(e=[{key:"rectSize",get:function(){return this.__pro("rectSize")},set:function(t){return this.__pro("rectSize",t)}},{key:"resizable",get:function(){return this.__pro("resizable")},set:function(t){return this.__pro("resizable",t)}},{key:"init",value:function(t){if(!1!==this.resizable){this.resizeRects=[];var e=this.rectSize,n=this.style.rectStyle||{stroke:"red",fill:"transparent",lineWidth:2,close:!0,zIndex:100};n.close=!0,n.fill=n.fill||"transparent";for(var i=0;i<8;i++){var r=(this.graph||t.graph).createShape(o.jmRect,{position:{x:0,y:0},width:e,height:e,style:n,interactive:!0});r.index=i,r.visible=!0,this.resizeRects.push(r),this.children.add(r),r.canMove(!0,this.graph)}this.reset(0,0,0,0),this.bindRectEvents()}}},{key:"bindRectEvents",value:function(){for(var t=0;t<this.resizeRects.length;t++){var e=this.resizeRects[t];e.on("move",function(t){var e=0,n=0,i=0,r=0;0==this.index?(i=-t.offsetX,e=t.offsetX):1==this.index?(i=-t.offsetX,e=t.offsetX,r=-t.offsetY,n=t.offsetY):2==this.index?(r=-t.offsetY,n=t.offsetY):3==this.index?(i=t.offsetX,r=-t.offsetY,n=t.offsetY):4==this.index?i=t.offsetX:5==this.index?(i=t.offsetX,r=t.offsetY):6==this.index?r=t.offsetY:7==this.index&&(i=-t.offsetX,i=-t.offsetX,e=t.offsetX,r=t.offsetY),this.parent.reset(e,n,i,r),this.needUpdate=!0}),e.bind("mousemove",function(){this.cursor=["w-resize","nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize"][this.index]}),e.bind("mouseleave",function(){this.cursor="default"})}}},{key:"reset",value:function(t,e,n,i){var r,o,s,u=void 0===this.style.minWidth?5:this.style.minWidth,c=void 0===this.style.minHeight?5:this.style.minHeight,a=this.getLocation();for(s in 0==n&&0==i||(r=a.width+n,o=a.height+i,(u<=r||c<=o)&&(u<=r?this.width=r:n=t=0,c<=o?this.height=o:i=e=0,!1!==this.movable&&(t||e)&&((o=this.position).x=a.left+t,o.y=a.top+e,this.position=o),this.emit("resize",t,e,n,i))),this.resizeRects){var f=this.resizeRects[s];switch(f.index){case 0:f.position.x=-f.width/2,f.position.y=(a.height-f.height)/2;break;case 1:f.position.x=-f.width/2,f.position.y=-f.height/2;break;case 2:f.position.x=(a.width-f.width)/2,f.position.y=-f.height/2;break;case 3:f.position.x=a.width-f.width/2,f.position.y=-f.height/2;break;case 4:f.position.x=a.width-f.width/2,f.position.y=(a.height-f.height)/2;break;case 5:f.position.x=a.width-f.width/2,f.position.y=a.height-f.height/2;break;case 6:f.position.x=(a.width-f.height)/2,f.position.y=a.height-f.height/2;break;case 7:f.position.x=-f.width/2,f.position.y=a.height-f.height/2}}}}])&&s(t.prototype,e),n&&s(t,n),r}();n.jmResize=n.default=t},{"./jmRect.js":22}]},{},[1])(1);return r.jmGraph=i},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t.bind(r)):t()}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "family": "jmgraph",
3
3
  "name": "jmgraph",
4
- "version": "3.1.94",
4
+ "version": "3.1.95",
5
5
  "description": "一个简单的canvas画图库",
6
6
  "homepage": "http://graph.jm47.com/",
7
7
  "keywords": [
@@ -87,7 +87,7 @@ export default class jmImage extends jmControl {
87
87
  try {
88
88
 
89
89
  let img = this.getImage();
90
- if(this.graph.isWXMiniApp && this.graph.canvas) {
90
+ if(this.graph.isWXMiniApp && this.graph.canvas && typeof img === 'string') {
91
91
  // 图片对象
92
92
  const image = this.graph.canvas.createImage();
93
93
  // 图片加载完成回调
@@ -109,6 +109,10 @@ export default class jmImage extends jmControl {
109
109
 
110
110
  // 绘制
111
111
  drawImg(img) {
112
+ if(!img) {
113
+ console.warn('image is empty');
114
+ return;
115
+ }
112
116
  let bounds = this.parent && this.parent.absoluteBounds?this.parent.absoluteBounds:this.absoluteBounds;
113
117
  if(!bounds) bounds = this.parent && this.parent.getAbsoluteBounds?this.parent.getAbsoluteBounds():this.getAbsoluteBounds();
114
118
  let p = this.getLocation();