=d&&f<=p}else{for(;f>d;)f-=360;for(;f=p&&f<=d}return c?Xc({},t,{radius:i,angle:iu(f,t)}):null};function su(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=0?1:-1;"insideStart"===i?(r=g+E*l,o=y):"insideEnd"===i?(r=v-E*l,o=!y):"end"===i&&(r=v+E*l,o=y),o=_<=0?o:!o;var S=tu(d,f,b,r),w=tu(d,f,b,r+359*(o?1:-1)),x="M".concat(S.x,",").concat(S.y,"\n A").concat(b,",").concat(b,",0,1,").concat(o?0:1,",\n ").concat(w.x,",").concat(w.y),T=p()(e.id)?I("recharts-radial-line-"):e.id;return a.a.createElement("text",lu({},n,{dominantBaseline:"central",className:u()("recharts-radial-bar-label",c)}),a.a.createElement("defs",null,a.a.createElement("path",{id:T,d:x})),a.a.createElement("textPath",{xlinkHref:"#".concat(T)},t))};function mu(e){var t,n=e.viewBox,r=e.position,o=e.value,s=e.children,l=e.content,c=e.className,d=void 0===c?"":c;if(!n||p()(o)&&p()(s)&&!Object(i.isValidElement)(l)&&!y()(l))return null;if(Object(i.isValidElement)(l))return Object(i.cloneElement)(l,e);if(y()(l)){if(t=l(e),Object(i.isValidElement)(t))return t}else t=function(e){var t=e.value,n=e.formatter,r=p()(e.children)?t:e.children;return y()(n)?n(r):r}(e);var f=function(e){return A(e.cx)}(n),h=K(e),m=Q(e);if(f&&("insideStart"===r||"insideEnd"===r||"end"===r))return hu(e,t,h);var v=f?function(e){var t=e.viewBox,n=e.offset,r=e.position,o=t.cx,i=t.cy,a=t.innerRadius,s=t.outerRadius,l=(t.startAngle+t.endAngle)/2;if("outside"===r){var c=tu(o,i,s+n,l),u=c.x;return{x:u,y:c.y,textAnchor:u>=o?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"end"};var d=tu(o,i,(a+s)/2,l);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}}(e):function(e){var t=e.viewBox,n=e.offset,r=e.position,o=t.x,i=t.y,a=t.width,s=t.height,l=s>=0?1:-1;return"top"===r?{x:o+a/2,y:i-l*n,textAnchor:"middle",verticalAnchor:l>0?"end":"start"}:"bottom"===r?{x:o+a/2,y:i+s+l*n,textAnchor:"middle",verticalAnchor:"start"}:"left"===r?{x:o-n,y:i+s/2,textAnchor:"end",verticalAnchor:"middle"}:"right"===r?{x:o+a+n,y:i+s/2,textAnchor:"start",verticalAnchor:"middle"}:"insideLeft"===r?{x:o+n,y:i+s/2,textAnchor:"start",verticalAnchor:"middle"}:"insideRight"===r?{x:o+a-n,y:i+s/2,textAnchor:"end",verticalAnchor:"middle"}:"insideTop"===r?{x:o+a/2,y:i+l*n,textAnchor:"middle",verticalAnchor:"start"}:"insideBottom"===r?{x:o+a/2,y:i+s-l*n,textAnchor:"middle",verticalAnchor:"end"}:"insideTopLeft"===r?{x:o+n,y:i+l*n,textAnchor:"start",verticalAnchor:"start"}:"insideTopRight"===r?{x:o+a-n,y:i+l*n,textAnchor:"end",verticalAnchor:"start"}:"insideBottomLeft"===r?{x:o+n,y:i+s-l*n,textAnchor:"start",verticalAnchor:"end"}:"insideBottomRight"===r?{x:o+a-n,y:i+s-l*n,textAnchor:"end",verticalAnchor:"end"}:g()(r)&&(A(r.x)||k(r.x))&&(A(r.y)||k(r.y))?{x:o+M(r.x,a),y:i+M(r.y,s),textAnchor:"end",verticalAnchor:"end"}:{x:o+a/2,y:i+s/2,textAnchor:"middle",verticalAnchor:"middle"}}(e);return a.a.createElement(Zr,lu({className:u()("recharts-label",d)},h,v,m),t)}mu.displayName="Label",mu.defaultProps={offset:5},mu.propTypes=fu;var gu=function(e){var t=e.cx,n=e.cy,r=e.angle,o=e.startAngle,i=e.endAngle,a=e.r,s=e.radius,l=e.innerRadius,c=e.outerRadius,u=e.x,d=e.y,p=e.top,f=e.left,h=e.width,m=e.height,g=e.clockWise;if(A(h)&&A(m)){if(A(u)&&A(d))return{x:u,y:d,width:h,height:m};if(A(p)&&A(f))return{x:p,y:f,width:h,height:m}}return A(u)&&A(d)?{x:u,y:d,width:0,height:0}:A(t)&&A(n)?{cx:t,cy:n,startAngle:o||r||0,endAngle:i||r||0,innerRadius:l||0,outerRadius:c||s||a||0,clockWise:g}:e.viewBox?e.viewBox:{}},vu=function(e,t){return e?!0===e?a.a.createElement(mu,{key:"label-implicit",viewBox:t}):N(e)?a.a.createElement(mu,{key:"label-implicit",viewBox:t,value:e}):Object(i.isValidElement)(e)?e.type===mu?Object(i.cloneElement)(e,{key:"label-implicit",viewBox:t}):a.a.createElement(mu,{key:"label-implicit",content:e,viewBox:t}):y()(e)?a.a.createElement(mu,{key:"label-implicit",content:e,viewBox:t}):g()(e)?a.a.createElement(mu,lu({viewBox:t},e,{key:"label-implicit"})):null:null};mu.parseViewBox=gu,mu.renderCallByParent=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&n&&!e.label)return null;var r=e.children,o=gu(e),a=$(r,mu).map((function(e,n){return Object(i.cloneElement)(e,{viewBox:t||o,key:"label-".concat(n)})}));if(!n)return a;var s=vu(e.label,t||o);return[s].concat(su(a))};var yu=mu,bu=n(300),_u=n.n(bu);function Eu(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Cu={id:l.a.string,data:l.a.arrayOf(l.a.object),valueAccessor:l.a.func,clockWise:l.a.bool,dataKey:l.a.oneOfType([l.a.string,l.a.number,l.a.func])},ku={valueAccessor:function(e){return _()(e.value)?_u()(e.value):e.value}};function Au(e){var t=e.data,n=e.valueAccessor,r=e.dataKey,o=e.clockWise,i=e.id,s=Ou(e,["data","valueAccessor","dataKey","clockWise","id"]);return t&&t.length?a.a.createElement(ve,{className:"recharts-label-list"},t.map((function(e,t){var l=p()(r)?n(e,t):wc(e&&e.payload,r),c=p()(i)?{}:{id:"".concat(i,"-").concat(t)};return a.a.createElement(yu,Su({},K(e),s,c,{index:t,value:l,viewBox:yu.parseViewBox(p()(o)?e:xu({},e,{clockWise:o})),key:"label-".concat(t)}))}))):null}Au.propTypes=Cu,Au.displayName="LabelList";var Nu=function(e,t){return e?!0===e?a.a.createElement(Au,{key:"labelList-implicit",data:t}):a.a.isValidElement(e)||y()(e)?a.a.createElement(Au,{key:"labelList-implicit",data:t,content:e}):g()(e)?a.a.createElement(Au,Su({data:t},e,{key:"labelList-implicit"})):null:null};Au.renderCallByParent=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&n&&!e.label)return null;var r=e.children,o=$(r,Au).map((function(e,n){return Object(i.cloneElement)(e,{data:t,key:"labelList-".concat(n)})}));if(!n)return o;var a=Nu(e.label,t);return[a].concat(Eu(o))},Au.defaultProps=ku;var Ru=Au;function Iu(e){return(Iu="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Mu(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Du(e){var t,n=e.component,r=Mu(e,["component"]);return Object(i.isValidElement)(n)?t=Object(i.cloneElement)(n,r):y()(n)?t=n(r):Iu(n),a.a.createElement(ve,{className:"recharts-customized-wrapper"},t)}function Lu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ju(e){return(ju="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Fu(){return(Fu=Object.assign||function(e){for(var t=1;t180),",").concat(+(i>s),",\n ").concat(c.x,",").concat(c.y,"\n ");if(r>0){var d=tu(t,n,r,i),p=tu(t,n,r,s);u+="L ".concat(p.x,",").concat(p.y,"\n A ").concat(r,",").concat(r,",0,\n ").concat(+(Math.abs(a)>180),",").concat(+(i<=s),",\n ").concat(d.x,",").concat(d.y," Z")}else u+="L ".concat(t,",").concat(n," Z");return u},qu=function(e){function t(){return Bu(this,t),zu(this,Hu(t).apply(this,arguments))}var n,r,o;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gu(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.innerRadius,o=e.outerRadius,i=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,d=e.endAngle,p=e.className;if(o0&&Math.abs(c-d)<360?function(e){var t=e.cx,n=e.cy,r=e.innerRadius,o=e.outerRadius,i=e.cornerRadius,a=e.forceCornerRadius,s=e.cornerIsExternal,l=e.startAngle,c=e.endAngle,u=C(c-l),d=Vu({cx:t,cy:n,radius:o,angle:l,sign:u,cornerRadius:i,cornerIsExternal:s}),p=d.circleTangency,f=d.lineTangency,h=d.theta,m=Vu({cx:t,cy:n,radius:o,angle:c,sign:-u,cornerRadius:i,cornerIsExternal:s}),g=m.circleTangency,v=m.lineTangency,y=m.theta,b=Math.abs(l-c)-h-y;if(b<0)return a?"M ".concat(f.x,",").concat(f.y,"\n a").concat(i,",").concat(i,",0,0,1,").concat(2*i,",0\n a").concat(i,",").concat(i,",0,0,1,").concat(2*-i,",0\n "):Wu({cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:l,endAngle:c});var _="M ".concat(f.x,",").concat(f.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(u<0),",").concat(p.x,",").concat(p.y,"\n A").concat(o,",").concat(o,",0,").concat(+(b>180),",").concat(+(u<0),",").concat(g.x,",").concat(g.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(u<0),",").concat(v.x,",").concat(v.y,"\n ");if(r>0){var E=Vu({cx:t,cy:n,radius:r,angle:l,sign:u,isExternal:!0,cornerRadius:i,cornerIsExternal:s}),S=E.circleTangency,w=E.lineTangency,x=E.theta,T=Vu({cx:t,cy:n,radius:r,angle:c,sign:-u,isExternal:!0,cornerRadius:i,cornerIsExternal:s}),O=T.circleTangency,k=T.lineTangency,A=T.theta,N=Math.abs(l-c)-x-A;if(N<0)return"".concat(_,"L").concat(t,",").concat(n,"Z");_+="L".concat(k.x,",").concat(k.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(u<0),",").concat(O.x,",").concat(O.y,"\n A").concat(r,",").concat(r,",0,").concat(+(N>180),",").concat(+(u>0),",").concat(S.x,",").concat(S.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(u<0),",").concat(w.x,",").concat(w.y,"Z")}else _+="L".concat(t,",").concat(n,"Z");return _}({cx:t,cy:n,innerRadius:r,outerRadius:o,cornerRadius:Math.min(g,m/2),forceCornerRadius:s,cornerIsExternal:l,startAngle:c,endAngle:d}):Wu({cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:c,endAngle:d}),a.a.createElement("path",Fu({},K(this.props),Q(this.props),{className:h,d:f}))}}])&&Uu(n.prototype,r),o&&Uu(n,o),t}(i.PureComponent);qu.displayName="Sector",qu.propTypes=function(e){for(var t=1;t=0;--t)o[t]=(a[t]-o[t+1])/i[t];for(i[r-1]=(e[r]+o[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};function pd(e){return e[0]}function fd(e){return e[1]}var hd=function(){var e=pd,t=fd,n=Ve(!0),r=null,o=td,i=null;function a(a){var s,l,c,u=a.length,d=!1;for(null==r&&(i=o(c=Ge())),s=0;s<=u;++s)!(s=u;--d)s.point(g[d],v[d]);s.lineEnd(),s.areaEnd()}m&&(g[c]=+e(p,c,l),v[c]=+n(p,c,l),s.point(t?+t(p,c,l):g[c],r?+r(p,c,l):v[c]))}if(f)return s=null,f+""||null}function c(){return hd().defined(o).curve(a).context(i)}return l.x=function(n){return arguments.length?(e="function"===typeof n?n:Ve(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"===typeof t?t:Ve(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"===typeof e?e:Ve(+e),l):t},l.y=function(e){return arguments.length?(n="function"===typeof e?e:Ve(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"===typeof e?e:Ve(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"===typeof e?e:Ve(+e),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(o="function"===typeof e?e:Ve(!!e),l):o},l.curve=function(e){return arguments.length?(a=e,null!=i&&(s=a(i)),l):a},l.context=function(e){return arguments.length?(null==e?i=s=null:s=a(i=e),l):i},l};function gd(e){return(gd="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vd(){return(vd=Object.assign||function(e){for(var t=1;t=0?1:-1,l=n>=0?1:-1,c=r>=0&&n>=0||r<0&&n<0?1:0;if(a>0&&o instanceof Array){for(var u=[],d=0;d<4;d++)u[d]=o[d]>a?a:o[d];i="M".concat(e,",").concat(t+s*u[0]),u[0]>0&&(i+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(c,",").concat(e+l*u[0],",").concat(t)),i+="L ".concat(e+n-l*u[1],",").concat(t),u[1]>0&&(i+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(c,",\n ").concat(e+n,",").concat(t+s*u[1])),i+="L ".concat(e+n,",").concat(t+r-s*u[2]),u[2]>0&&(i+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(c,",\n ").concat(e+n-l*u[2],",").concat(t+r)),i+="L ".concat(e+l*u[3],",").concat(t+r),u[3]>0&&(i+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(c,",\n ").concat(e,",").concat(t+r-s*u[3])),i+="Z"}else if(a>0&&o===+o&&o>0){var p=Math.min(a,o);i="M ".concat(e,",").concat(t+s*p,"\n A ").concat(p,",").concat(p,",0,0,").concat(c,",").concat(e+l*p,",").concat(t,"\n L ").concat(e+n-l*p,",").concat(t,"\n A ").concat(p,",").concat(p,",0,0,").concat(c,",").concat(e+n,",").concat(t+s*p,"\n L ").concat(e+n,",").concat(t+r-s*p,"\n A ").concat(p,",").concat(p,",0,0,").concat(c,",").concat(e+n-l*p,",").concat(t+r,"\n L ").concat(e+l*p,",").concat(t+r,"\n A ").concat(p,",").concat(p,",0,0,").concat(c,",").concat(e,",").concat(t+r-s*p," Z")}else i="M ".concat(e,",").concat(t," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return i},Hd=function(e){function t(){var e,n;Pd(this,t);for(var r=arguments.length,o=new Array(r),i=0;i0,from:{width:o,height:i,x:n,y:r},to:{width:o,height:i,x:n,y:r},duration:f,animationEasing:p,isActive:g},(function(t){var n=t.width,r=t.height,o=t.x,i=t.y;return a.a.createElement(Fn,{canBegin:c>0,from:"0px ".concat(-1===c?1:c,"px"),to:"".concat(c,"px 0px"),attributeName:"strokeDasharray",begin:h,duration:f,isActive:m,easing:p},a.a.createElement("path",Ld({},K(e.props),Q(e.props),{className:v,d:zd(o,i,n,r,s),ref:function(t){e.node=t}})))})):a.a.createElement("path",Ld({},K(this.props),Q(this.props),{className:v,d:zd(n,r,o,i,s)}))}}])&&jd(n.prototype,r),o&&jd(n,o),t}(i.PureComponent);Hd.displayName="Rectangle",Hd.propTypes=function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Vp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wp(e,t){for(var n=0;n1e-5?"outer"===t?"start":"end":n<-1e-5?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,i=e.axisLineType,s=ef({},K(this.props),{fill:"none"},K(o));if("circle"===i)return a.a.createElement(up,Zp({className:"recharts-polar-angle-axis-line"},s,{cx:t,cy:n,r:r}));var l=this.props.ticks.map((function(e){return tu(t,n,r,e.coordinate)}));return a.a.createElement(tp,Zp({className:"recharts-polar-angle-axis-line"},s,{points:l}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,r=t.tick,o=t.tickLine,i=t.tickFormatter,s=t.stroke,l=K(this.props),c=K(r),u=ef({},l,{fill:"none"},K(o)),d=n.map((function(t,n){var d=e.getTickLineCoord(t),p=ef({textAnchor:e.getTickTextAnchor(t)},l,{stroke:"none",fill:s},c,{index:n,payload:t,x:d.x2,y:d.y2});return a.a.createElement(ve,Zp({className:"recharts-polar-angle-axis-tick",key:"tick-".concat(n)},J(e.props,t,n)),o&&a.a.createElement("line",Zp({className:"recharts-polar-angle-axis-tick-line"},u,d)),r&&e.constructor.renderTickItem(r,p,i?i(t.value):t.value))}));return a.a.createElement(ve,{className:"recharts-polar-angle-axis-ticks"},d)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return n<=0||!t||!t.length?null:a.a.createElement(ve,{className:"recharts-polar-angle-axis"},r&&this.renderAxisLine(),this.renderTicks())}}])&&rf(n.prototype,r),o&&rf(n,o),t}(i.PureComponent);cf.displayName="PolarAngleAxis",cf.axisType="angleAxis",cf.propTypes=ef({},U,{},z,{type:l.a.oneOf(["number","category"]),angleAxisId:l.a.oneOfType([l.a.string,l.a.number]),dataKey:l.a.oneOfType([l.a.number,l.a.string,l.a.func]),cx:l.a.number,cy:l.a.number,radius:l.a.oneOfType([l.a.number,l.a.string]),hide:l.a.bool,scale:l.a.oneOfType([l.a.oneOf(G),l.a.func]),axisLine:l.a.oneOfType([l.a.bool,l.a.object]),axisLineType:l.a.oneOf(["polygon","circle"]),tickLine:l.a.oneOfType([l.a.bool,l.a.object]),tick:l.a.oneOfType([l.a.bool,l.a.func,l.a.object,l.a.element]),ticks:l.a.arrayOf(l.a.shape({value:l.a.any,coordinate:l.a.number})),stroke:l.a.string,orientation:l.a.oneOf(["inner","outer"]),tickFormatter:l.a.func,allowDuplicatedCategory:l.a.bool}),cf.defaultProps={type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,domain:[0,"auto"],orientation:"outer",axisLine:!0,tickLine:!0,tick:!0,hide:!1,allowDuplicatedCategory:!0};var uf=cf,df=n(301),pf=n.n(df);function ff(e){return(ff="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hf(){return(hf=Object.assign||function(e){for(var t=1;tt?"start":e0?S()(e,"paddingAngle",0):0;if(n){var s=L(n.endAngle-n.startAngle,e.endAngle-e.startAngle),l=gf({},e,{startAngle:i+a,endAngle:i+s(r)+a});o.push(l),i=l.endAngle}else{var u=e.endAngle,d=e.startAngle,p=L(0,u-d)(r),f=gf({},e,{startAngle:i+a,endAngle:i+p+a});o.push(f),i=f.endAngle}})),a.a.createElement(ve,null,e.renderSectorsStatically(o))}))}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return!(n&&t&&t.length)||r&&Nt()(r,t)?this.renderSectorsStatically(t):this.renderSectorsWithAnimation()}},{key:"render",value:function(){var e=this.props,t=e.hide,n=e.sectors,r=e.className,o=e.label,i=e.cx,s=e.cy,l=e.innerRadius,c=e.outerRadius,d=e.isAnimationActive,p=e.prevSectors;if(t||!n||!n.length||!A(i)||!A(s)||!A(l)||!A(c))return null;var f=u()("recharts-pie",r);return a.a.createElement(ve,{className:f},this.renderSectors(),o&&this.renderLabels(n),yu.renderCallByParent(this.props,null,!1),(!d||p&&Nt()(p,n))&&Ru.renderCallByParent(this.props,n,!1))}}])&&bf(n.prototype,r),o&&bf(n,o),t}(i.PureComponent);wf.displayName="Pie",wf.propTypes=gf({},U,{},z,{className:l.a.string,animationId:l.a.number,cx:l.a.oneOfType([l.a.number,l.a.string]),cy:l.a.oneOfType([l.a.number,l.a.string]),startAngle:l.a.number,endAngle:l.a.number,paddingAngle:l.a.number,innerRadius:l.a.oneOfType([l.a.number,l.a.string]),outerRadius:l.a.oneOfType([l.a.number,l.a.string]),cornerRadius:l.a.oneOfType([l.a.number,l.a.string]),dataKey:l.a.oneOfType([l.a.string,l.a.number,l.a.func]).isRequired,nameKey:l.a.oneOfType([l.a.string,l.a.number,l.a.func]),valueKey:l.a.oneOfType([l.a.string,l.a.number,l.a.func]),data:l.a.arrayOf(l.a.object),blendStroke:l.a.bool,minAngle:l.a.number,legendType:l.a.oneOf(V),tooltipType:l.a.oneOf(W),maxRadius:l.a.number,sectors:l.a.arrayOf(l.a.object),hide:l.a.bool,labelLine:l.a.oneOfType([l.a.object,l.a.func,l.a.element,l.a.bool]),label:l.a.oneOfType([l.a.shape({offsetRadius:l.a.number}),l.a.func,l.a.element,l.a.bool]),activeShape:l.a.oneOfType([l.a.object,l.a.func,l.a.element]),activeIndex:l.a.oneOfType([l.a.number,l.a.arrayOf(l.a.number)]),onAnimationStart:l.a.func,onAnimationEnd:l.a.func,isAnimationActive:l.a.bool,animationBegin:l.a.number,animationDuration:l.a.number,animationEasing:l.a.oneOf(["ease","ease-in","ease-out","ease-in-out","spring","linear"]),id:l.a.string}),wf.defaultProps={stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!te(),animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1},wf.parseDeltaAngle=function(e){var t=e.startAngle,n=e.endAngle;return C(n-t)*Math.min(Math.abs(n-t),360)},wf.getRealPieData=function(e){var t=e.props,n=t.data,r=t.children,o=K(e.props),i=$(r,Ar);return n&&n.length?n.map((function(e,t){return gf({payload:e},o,{},e,{},i&&i[t]&&i[t].props)})):i&&i.length?i.map((function(e){return gf({},o,{},e.props)})):[]},wf.parseCoordinateOfPie=function(e,t){var n=t.top,r=t.left,o=t.width,i=t.height,a=nu(o,i);return{cx:r+M(e.props.cx,o,o/2),cy:n+M(e.props.cy,i,i/2),innerRadius:M(e.props.innerRadius,a,0),outerRadius:M(e.props.outerRadius,a,.8*a),maxRadius:e.props.maxRadius||Math.sqrt(o*o+i*i)/2}},wf.getComposedData=function(e){var t=e.item,n=e.offset,r=e.onItemMouseLeave,o=e.onItemMouseEnter,i=wf.getRealPieData(t);if(!i||!i.length)return[];var a=t.props,s=a.cornerRadius,l=a.startAngle,c=a.endAngle,u=a.paddingAngle,d=a.dataKey,f=a.nameKey,h=a.valueKey,m=a.tooltipType,g=Math.abs(t.props.minAngle),v=wf.parseCoordinateOfPie(t,n),y=i.length,b=wf.parseDeltaAngle({startAngle:l,endAngle:c}),_=Math.abs(b),E=_-y*g-(_>=360?y:y-1)*u,S=d;p()(d)&&p()(h)?S="value":p()(d)&&(S=h);var w,x,T=i.reduce((function(e,t){var n=wc(t,S,0);return e+(A(n)?n:0)}),0);T>0&&(w=i.map((function(e,t){var n,r=wc(e,S,0),o=wc(e,f,t),i=(A(r)?r:0)/T,a=(n=t?x.endAngle+C(b)*u:l)+C(b)*(g+i*E),c=(n+a)/2,d=(v.innerRadius+v.outerRadius)/2,p=[{name:o,value:r,payload:e,dataKey:S,type:m}],h=tu(v.cx,v.cy,d,c);return x=gf({percent:i,cornerRadius:s,name:o,tooltipPayload:p,midAngle:c,middleRadius:d,tooltipPosition:h},e,{},v,{value:wc(e,S),startAngle:n,endAngle:a,payload:e,paddingAngle:C(b)*u})})));return gf({},v,{sectors:w,data:i,onMouseLeave:r,onMouseEnter:o})};var xf=wf;function Tf(e){return(Tf="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Of(){return(Of=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Hf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gf(e,t){for(var n=0;n0&&Math.abs(O)0&&Math.abs(k)0&&n.handleDrag(e.changedTouches[0])},n.handleDragEnd=function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1})},n.handleLeaveWrapper=function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=setTimeout(n.handleDragEnd,n.props.leaveTimeOut))},n.handleEnterSlideOrTraveller=function(){n.setState({isTextActive:!0})},n.handleLeaveSlideOrTraveller=function(){n.setState({isTextActive:!1})},n.handleSlideDragStart=function(e){var t=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:t.pageX})},n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(ah(n),"startX"),endX:n.handleTravellerDragStart.bind(ah(n),"endX")},n.state=e.data&&e.data.length?n.updateScale(e):{},n}var n,r,o;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&sh(e,t)}(t,e),n=t,o=[{key:"getIndexInRange",value:function(e,t){for(var n=0,r=e.length-1;r-n>1;){var o=Math.floor((n+r)/2);e[o]>t?r=o:n=o}return t>=e[r]?r:n}}],(r=[{key:"componentWillReceiveProps",value:function(e){var t=this,n=this.props,r=n.data,o=n.width,i=n.x,a=n.travellerWidth,s=n.updateId;(e.data!==r||e.updateId!==s)&&e.data&&e.data.length?this.setState(this.updateScale(e)):e.width===o&&e.x===i&&e.travellerWidth===a||(this.scale.range([e.x,e.x+e.width-e.travellerWidth]),this.scaleValues=this.scale.domain().map((function(e){return t.scale(e)})),this.setState({startX:this.scale(e.startIndex),endX:this.scale(e.endIndex)}))}},{key:"componentWillUnmount",value:function(){this.scale=null,this.scaleValues=null,this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null)}},{key:"getIndex",value:function(e){var t=e.startX,n=e.endX,r=this.props,o=r.gap,i=r.data.length-1,a=Math.min(t,n),s=Math.max(t,n),l=this.constructor.getIndexInRange(this.scaleValues,a),c=this.constructor.getIndexInRange(this.scaleValues,s);return{startIndex:l-l%o,endIndex:c===i?i:c-c%o}}},{key:"getTextOfTick",value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,o=t.dataKey,i=wc(n[e],o,e);return y()(r)?r(i):i}},{key:"handleSlideDrag",value:function(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,o=t.endX,i=this.props,a=i.x,s=i.width,l=i.travellerWidth,c=i.startIndex,u=i.endIndex,d=i.onChange,p=e.pageX-n;p>0?p=Math.min(p,a+s-l-o,a+s-l-r):p<0&&(p=Math.max(p,a-r,a-o));var f=this.getIndex({startX:r+p,endX:o+p});f.startIndex===c&&f.endIndex===u||!d||d(f),this.setState({startX:r+p,endX:o+p,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var n=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX})}},{key:"handleTravellerMove",value:function(e){var t,n=this.state,r=n.brushMoveStartX,o=n.movingTravellerId,i=n.endX,a=n.startX,s=this.state[o],l=this.props,c=l.x,u=l.width,d=l.travellerWidth,p=l.onChange,f=l.gap,h=l.data,m={startX:this.state.startX,endX:this.state.endX},g=e.pageX-r;g>0?g=Math.min(g,c+u-d-s):g<0&&(g=Math.max(g,c-s)),m[o]=s+g;var v=this.getIndex(m),y=v.startIndex,b=v.endIndex;this.setState((rh(t={},o,s+g),rh(t,"brushMoveStartX",e.pageX),t),(function(){p&&function(){var e=h.length-1;return"startX"===o&&(i>a?y%f===0:b%f===0)||ia?b%f===0:y%f===0)||i>a&&b===e}()&&p(v)}))}},{key:"updateScale",value:function(e){var t=this,n=e.data,r=e.startIndex,o=e.endIndex,i=e.x,a=e.width,s=e.travellerWidth,l=n.length;return this.scale=jo().domain(Xf()(0,l)).range([i,i+a-s]),this.scaleValues=this.scale.domain().map((function(e){return t.scale(e)})),{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,startX:this.scale(r),endX:this.scale(o)}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,o=e.height,i=e.fill,s=e.stroke;return a.a.createElement("rect",{stroke:s,fill:i,x:t,y:n,width:r,height:o})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,o=e.height,s=e.data,l=e.children,c=e.padding,u=i.Children.only(l);return u?a.a.cloneElement(u,{x:t,y:n,width:r,height:o,margin:c,compact:!0,data:s}):null}},{key:"renderTraveller",value:function(e,t){var n=this.props,r=n.y,o=n.travellerWidth,i=n.height,s=n.stroke,l=Math.floor(r+i/2)-1,c=Math.max(e,this.props.x);return a.a.createElement(ve,{className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[t],onTouchStart:this.travellerDragStartHandlers[t],style:{cursor:"col-resize"}},a.a.createElement("rect",{x:c,y:r,width:o,height:i,fill:s,stroke:"none"}),a.a.createElement("line",{x1:c+1,y1:l,x2:c+o-1,y2:l,fill:"none",stroke:"#fff"}),a.a.createElement("line",{x1:c+1,y1:l+2,x2:c+o-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderSlide",value:function(e,t){var n=this.props,r=n.y,o=n.height,i=n.stroke;return a.a.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:i,fillOpacity:.2,x:Math.min(e,t),y:r,width:Math.abs(t-e),height:o})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,r=e.y,o=e.height,i=e.travellerWidth,s=e.stroke,l=this.state,c=l.startX,u=l.endX,d={pointerEvents:"none",fill:s};return a.a.createElement(ve,{className:"recharts-brush-texts"},a.a.createElement(Zr,nh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,u)-5,y:r+o/2},d),this.getTextOfTick(t)),a.a.createElement(Zr,nh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,u)+i+5,y:r+o/2},d),this.getTextOfTick(n)))}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.className,r=e.children,o=e.x,i=e.y,s=e.width,l=e.height,c=e.alwaysShowText,d=this.state,p=d.startX,f=d.endX,h=d.isTextActive,m=d.isSlideMoving,g=d.isTravellerMoving;if(!t||!t.length||!A(o)||!A(i)||!A(s)||!A(l)||s<=0||l<=0)return null;var v=u()("recharts-brush",n),y=1===a.a.Children.count(r),b=eh("userSelect","none");return a.a.createElement(ve,{className:v,onMouseMove:this.handleDrag,onMouseLeave:this.handleLeaveWrapper,onMouseUp:this.handleDragEnd,onTouchEnd:this.handleDragEnd,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),y&&this.renderPanorama(),this.renderSlide(p,f),this.renderTraveller(p,"startX"),this.renderTraveller(f,"endX"),(h||m||g||c)&&this.renderText())}}])&&oh(n.prototype,r),o&&oh(n,o),t}(i.PureComponent);lh.displayName="Brush",lh.propTypes={className:l.a.string,fill:l.a.string,stroke:l.a.string,x:l.a.number,y:l.a.number,width:l.a.number,height:l.a.number.isRequired,travellerWidth:l.a.number,gap:l.a.number,padding:l.a.shape({top:l.a.number,right:l.a.number,bottom:l.a.number,left:l.a.number}),dataKey:l.a.oneOfType([l.a.string,l.a.number,l.a.func]),data:l.a.array,startIndex:l.a.number,endIndex:l.a.number,tickFormatter:l.a.func,children:l.a.node,onChange:l.a.func,updateId:l.a.oneOfType([l.a.string,l.a.number]),leaveTimeOut:l.a.number,alwaysShowText:l.a.bool},lh.defaultProps={height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1};var ch=lh,uh=n(171),dh=n.n(uh),ph=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r="extendDomain"),r===t},fh=n(211),hh=n.n(fh),mh=n(629),gh=n.n(mh);function vh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yh(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.bandAware,r=t.position;if(void 0!==e){if(r)switch(r){case"start":return this.scale(e);case"middle":var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o;case"end":var i=this.bandwidth?this.bandwidth():0;return this.scale(e)+i;default:return this.scale(e)}if(n){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+a}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}},{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}}]),e}();Th.EPS=1e-4;var Oh=function(){function e(t){vh(this,e),this.scales=gh()(t,Th.create),Object.assign(this,this.scales)}return bh(e,null,[{key:"create",value:function(e){return new this(e)}}]),bh(e,[{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.bandAware,r=this.scales;return gh()(e,(function(e,t){return r[t].apply(e,{bandAware:n})}))}},{key:"isInRange",value:function(e){var t=this.scales;return hh()(e,(function(e,n){return t[n].isInRange(e)}))}}]),e}();function Ch(e){return(Ch="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ah(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function gm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vm(e,t){for(var n=0;n=2?C(m[1].coordinate-m[0].coordinate):1;if(1===b?(n="width"===h?u:d,r="width"===h?u+p:d+f):(n="width"===h?u+p:d+f,r="width"===h?u:d),t){var _=o[v-1],E=y()(i)?i(_.value):_.value,S=Ur(E)[h]+g,w=b*(_.coordinate+b*S/2-r);m[v-1]=_=fm({},_,{tickCoord:w>0?_.coordinate-w*b:_.coordinate}),b*(_.tickCoord-b*S/2-n)>=0&&b*(_.tickCoord+b*S/2-r)<=0&&(r=_.tickCoord-b*(S/2+l),m[v-1]=fm({},_,{isShow:!0}))}for(var x=t?v-1:v,T=0;T=0&&b*(O.tickCoord+b*A/2-r)<=0&&(n=O.tickCoord+b*(A/2+l),m[T]=fm({},O,{isShow:!0}))}return m.filter((function(e){return e.isShow}))}},{key:"getTicksEnd",value:function(e){var t,n,r=e.ticks,o=e.tickFormatter,i=e.viewBox,a=e.orientation,s=e.minTickGap,l=e.unit,c=i.x,u=i.y,d=i.width,p=i.height,f="top"===a||"bottom"===a?"width":"height",h=l&&"width"===f?Ur(l)[f]:0,m=(r||[]).slice(),g=m.length,v=g>=2?C(m[1].coordinate-m[0].coordinate):1;1===v?(t="width"===f?c:u,n="width"===f?c+d:u+p):(t="width"===f?c+d:u+p,n="width"===f?c:u);for(var b=g-1;b>=0;b--){var _=m[b],E=y()(o)?o(_.value):_.value,S=Ur(E)[f]+h;if(b===g-1){var w=v*(_.coordinate+v*S/2-n);m[b]=_=fm({},_,{tickCoord:w>0?_.coordinate-w*v:_.coordinate})}else m[b]=_=fm({},_,{tickCoord:_.coordinate});v*(_.tickCoord-v*S/2-t)>=0&&v*(_.tickCoord+v*S/2-n)<=0&&(n=_.tickCoord-v*(S/2+s),m[b]=fm({},_,{isShow:!0}))}return m.filter((function(e){return e.isShow}))}},{key:"renderTickItem",value:function(e,t,n){return a.a.isValidElement(e)?a.a.cloneElement(e,t):y()(e)?e(t):a.a.createElement(Zr,dm({},t,{className:"recharts-cartesian-axis-tick-value"}),n)}}],(r=[{key:"shouldComponentUpdate",value:function(e,t){var n=e.viewBox,r=mm(e,["viewBox"]),o=this.props,i=o.viewBox,a=mm(o,["viewBox"]);return!j(n,i)||!j(r,a)||!j(t,this.state)}},{key:"getTickLineCoord",value:function(e){var t,n,r,o,i,a,s=this.props,l=s.x,c=s.y,u=s.width,d=s.height,p=s.orientation,f=s.tickSize,h=s.mirror,m=s.tickMargin,g=h?-1:1,v=e.tickSize||f,y=A(e.tickCoord)?e.tickCoord:e.coordinate;switch(p){case"top":t=n=e.coordinate,a=(r=(o=c+!h*d)-g*v)-g*m,i=y;break;case"left":r=o=e.coordinate,i=(t=(n=l+!h*u)-g*v)-g*m,a=y;break;case"right":r=o=e.coordinate,i=(t=(n=l+h*u)+g*v)+g*m,a=y;break;default:t=n=e.coordinate,a=(r=(o=c+h*d)+g*v)+g*m,i=y}return{line:{x1:t,y1:r,x2:n,y2:o},tick:{x:i,y:a}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,n=t.orientation,r=t.mirror;switch(n){case"left":e=r?"start":"end";break;case"right":e=r?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,n=e.mirror,r="end";switch(t){case"left":case"right":r="middle";break;case"top":r=n?"start":"end";break;default:r=n?"end":"start"}return r}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,o=e.height,i=e.orientation,s=e.axisLine,l=e.mirror,c=fm({},K(this.props),{fill:"none"},K(s));if("top"===i||"bottom"===i){var u="top"===i&&!l||"bottom"===i&&l;c=fm({},c,{x1:t,y1:n+u*o,x2:t+r,y2:n+u*o})}else{var d="left"===i&&!l||"right"===i&&l;c=fm({},c,{x1:t+d*r,y1:n,x2:t+d*r,y2:n+o})}return a.a.createElement("line",dm({className:"recharts-cartesian-axis-line"},c))}},{key:"renderTicks",value:function(e){var n=this,r=this.props,o=r.tickLine,i=r.stroke,s=r.tick,l=r.tickFormatter,c=r.unit,u=t.getTicks(fm({},this.props,{ticks:e})),d=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),f=K(this.props),h=K(s),m=fm({},f,{fill:"none"},K(o)),g=u.map((function(e,t){var r=n.getTickLineCoord(e),g=r.line,v=r.tick,b=fm({textAnchor:d,verticalAnchor:p},f,{stroke:"none",fill:i},h,{},v,{index:t,payload:e,visibleTicksCount:u.length});return a.a.createElement(ve,dm({className:"recharts-cartesian-axis-tick",key:"tick-".concat(t)},J(n.props,e,t)),o&&a.a.createElement("line",dm({className:"recharts-cartesian-axis-tick-line"},m,g)),s&&n.constructor.renderTickItem(s,b,"".concat(y()(l)?l(e.value):e.value).concat(c||"")))}));return a.a.createElement("g",{className:"recharts-cartesian-axis-ticks"},g)}},{key:"render",value:function(){var e=this.props,t=e.axisLine,n=e.width,r=e.height,o=e.ticksGenerator,i=e.className;if(e.hide)return null;var s=this.props,l=s.ticks,c=mm(s,["ticks"]),d=l;return y()(o)&&(d=l&&l.length>0?o(this.props):o(c)),n<=0||r<=0||!d||!d.length?null:a.a.createElement(ve,{className:u()("recharts-cartesian-axis",i)},t&&this.renderAxisLine(),this.renderTicks(d),yu.renderCallByParent(this.props))}}])&&vm(n.prototype,r),o&&vm(n,o),t}(i.Component);Em.displayName="CartesianAxis",Em.propTypes=fm({},U,{},z,{className:l.a.string,x:l.a.number,y:l.a.number,width:l.a.number,height:l.a.number,orientation:l.a.oneOf(["top","bottom","left","right"]),viewBox:l.a.shape({x:l.a.number,y:l.a.number,width:l.a.number,height:l.a.number}),tick:l.a.oneOfType([l.a.bool,l.a.func,l.a.object,l.a.element]),axisLine:l.a.oneOfType([l.a.bool,l.a.object]),tickLine:l.a.oneOfType([l.a.bool,l.a.object]),mirror:l.a.bool,tickMargin:l.a.number.isRequired,minTickGap:l.a.number,ticks:l.a.array,tickSize:l.a.number,stroke:l.a.string,tickFormatter:l.a.func,ticksGenerator:l.a.func,interval:l.a.oneOfType([l.a.number,l.a.oneOf(["preserveStart","preserveEnd","preserveStartEnd"])])}),Em.defaultProps={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"};var Sm=Em;function wm(e){return(wm="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xm(){return(xm=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Om(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cm(e){for(var t=1;ti){s=[].concat(zm(n.slice(0,l)),[i-c]);break}var u=s.length%2===0?[0,a]:[a];return[].concat(zm(this.constructor.repeat(n,o)),zm(s),u).map((function(e){return"".concat(e,"px")})).join(", ")}},{key:"renderErrorBar",value:function(){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var e=this.props,t=e.points,n=e.xAxis,r=e.yAxis,o=e.layout,i=e.children,s=$(i,yc);if(!s)return null;function l(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:wc(e.payload,t)}}return s.map((function(e,i){return a.a.cloneElement(e,{key:i,data:t,xAxis:n,yAxis:r,layout:o,dataPointFormatter:l})}))}},{key:"renderDots",value:function(e,t){var n=this;if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,o=r.dot,i=r.points,s=r.dataKey,l=K(this.props),c=K(o),u=Q(o),d=i.map((function(e,t){var r=Bm({key:"dot-".concat(t),r:3},l,{},c,{},u,{value:e.value,dataKey:s,cx:e.x,cy:e.y,index:t,payload:e.payload});return n.constructor.renderDotItem(o,r)})),p={clipPath:e?"url(#clipPath-".concat(t,")"):null};return a.a.createElement(ve,jm({className:"recharts-line-dots",key:"dots"},p),d)}},{key:"renderCurveStatically",value:function(e,t,n,r){var o=this.props,i=o.type,s=o.layout,l=o.connectNulls,c=Bm({},K(this.props),{},Q(this.props),{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(n,")"):null,points:e},r,{type:i,layout:s,connectNulls:l});return a.a.createElement(Rd,jm({},c,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var n=this,r=this.props,o=r.points,i=r.strokeDasharray,s=r.isAnimationActive,l=r.animationBegin,c=r.animationDuration,u=r.animationEasing,d=r.animationId,p=r.width,f=r.height,h=this.state,m=h.prevPoints,g=h.totalLength;return a.a.createElement(Fn,{begin:l,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"line-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(r){var a=r.t;if(m){var s=m.length/o.length,l=o.map((function(e,t){var r=Math.floor(t*s);if(m[r]){var o=m[r],i=L(o.x,e.x),l=L(o.y,e.y);return Bm({},e,{x:i(a),y:l(a)})}if(n.animateNewValues){var c=L(2*p,e.x),u=L(f/2,e.y);return Bm({},e,{x:c(a),y:u(a)})}return Bm({},e,{x:e.x,y:e.y})}));return n.renderCurveStatically(l,e,t)}var c,u=L(0,g)(a);if(i){var d=i.split(/[,\s]+/gim).map((function(e){return parseFloat(e)}));c=n.getStrokeDasharray(u,g,d)}else c="".concat(u,"px ").concat(g-u,"px");return n.renderCurveStatically(o,e,t,{strokeDasharray:c})}))}},{key:"renderCurve",value:function(e,t){var n=this.props,r=n.points,o=n.isAnimationActive,i=this.state,a=i.prevPoints,s=i.totalLength;return o&&r&&r.length&&(!a&&s>0||!Nt()(a,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:"render",value:function(){var e=this.props,t=e.hide,n=e.dot,r=e.points,o=e.className,i=e.xAxis,s=e.yAxis,l=e.top,c=e.left,d=e.width,f=e.height,h=e.isAnimationActive,m=e.id;if(t||!r||!r.length)return null;var g=this.state.isAnimationFinished,v=1===r.length,y=u()("recharts-line",o),b=i&&i.allowDataOverflow||s&&s.allowDataOverflow,_=p()(m)?this.id:m;return a.a.createElement(ve,{className:y},b?a.a.createElement("defs",null,a.a.createElement("clipPath",{id:"clipPath-".concat(_)},a.a.createElement("rect",{x:c,y:l,width:d,height:f}))):null,!v&&this.renderCurve(b,_),this.renderErrorBar(),(v||n)&&this.renderDots(b,_),(!h||g)&&Ru.renderCallByParent(this.props,r))}}])&&Gm(n.prototype,r),o&&Gm(n,o),t}(i.PureComponent);$m.displayName="Line",$m.propTypes=Bm({},U,{},z,{className:l.a.string,type:l.a.oneOfType([l.a.oneOf(["basis","basisClosed","basisOpen","linear","linearClosed","natural","monotoneX","monotoneY","monotone","step","stepBefore","stepAfter"]),l.a.func]),unit:l.a.oneOfType([l.a.string,l.a.number]),name:l.a.oneOfType([l.a.string,l.a.number]),yAxisId:l.a.oneOfType([l.a.string,l.a.number]),xAxisId:l.a.oneOfType([l.a.string,l.a.number]),yAxis:l.a.object,xAxis:l.a.object,legendType:l.a.oneOf(V),tooltipType:l.a.oneOf(W),layout:l.a.oneOf(["horizontal","vertical"]),connectNulls:l.a.bool,hide:l.a.bool,activeDot:l.a.oneOfType([l.a.object,l.a.element,l.a.func,l.a.bool]),dot:l.a.oneOfType([l.a.object,l.a.element,l.a.func,l.a.bool]),top:l.a.number,left:l.a.number,width:l.a.number,height:l.a.number,points:l.a.arrayOf(l.a.shape({x:l.a.number,y:l.a.number,value:l.a.value})),onAnimationStart:l.a.func,onAnimationEnd:l.a.func,isAnimationActive:l.a.bool,animateNewValues:l.a.bool,animationBegin:l.a.number,animationDuration:l.a.number,animationEasing:l.a.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),animationId:l.a.number,id:l.a.string}),$m.defaultProps={xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!te(),animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,onAnimationStart:function(){},onAnimationEnd:function(){}},$m.getComposedData=function(e){var t=e.props,n=e.xAxis,r=e.yAxis,o=e.xAxisTicks,i=e.yAxisTicks,a=e.dataKey,s=e.bandSize,l=e.displayedData,c=e.offset,u=t.layout;return Bm({points:l.map((function(e,t){var l=wc(e,a);return"horizontal"===u?{x:Uc({axis:n,ticks:o,bandSize:s,entry:e,index:t}),y:p()(l)?null:r.scale(l),value:l,payload:e}:{x:p()(l)?null:n.scale(l),y:Uc({axis:r,ticks:i,bandSize:s,entry:e,index:t}),value:l,payload:e}})),layout:u},c)};var Ym=$m;function Km(e){return(Km="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xm(){return(Xm=Object.assign||function(e){for(var t=1;t0||!Nt()(s,r)||!Nt()(l,o))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(r,o,e,t)}},{key:"render",value:function(){var e=this.props,t=e.hide,n=e.dot,r=e.points,o=e.className,i=e.top,s=e.left,l=e.xAxis,c=e.yAxis,d=e.width,f=e.height,h=e.isAnimationActive,m=e.id;if(t||!r||!r.length)return null;var g=this.state.isAnimationFinished,v=1===r.length,y=u()("recharts-area",o),b=l&&l.allowDataOverflow||c&&c.allowDataOverflow,_=p()(m)?this.id:m;return a.a.createElement(ve,{className:y},b?a.a.createElement("defs",null,a.a.createElement("clipPath",{id:"clipPath-".concat(_)},a.a.createElement("rect",{x:s,y:i,width:d,height:parseInt(f,10)}))):null,v?null:this.renderArea(b,_),(n||v)&&this.renderDots(b,_),(!h||g)&&Ru.renderCallByParent(this.props,r))}}])&&tg(n.prototype,r),o&&tg(n,o),t}(i.PureComponent);ig.displayName="Area",ig.propTypes=Zm({},U,{},z,{className:l.a.string,dataKey:l.a.oneOfType([l.a.string,l.a.number,l.a.func]).isRequired,type:l.a.oneOfType([l.a.oneOf(["basis","basisClosed","basisOpen","linear","linearClosed","natural","monotoneX","monotoneY","monotone","step","stepBefore","stepAfter"]),l.a.func]),unit:l.a.oneOfType([l.a.string,l.a.number]),name:l.a.oneOfType([l.a.string,l.a.number]),yAxisId:l.a.oneOfType([l.a.string,l.a.number]),xAxisId:l.a.oneOfType([l.a.string,l.a.number]),yAxis:l.a.object,xAxis:l.a.object,stackId:l.a.oneOfType([l.a.number,l.a.string]),legendType:l.a.oneOf(V),tooltipType:l.a.oneOf(W),connectNulls:l.a.bool,activeDot:l.a.oneOfType([l.a.object,l.a.element,l.a.func,l.a.bool]),dot:l.a.oneOfType([l.a.func,l.a.element,l.a.object,l.a.bool]),label:l.a.oneOfType([l.a.func,l.a.element,l.a.object,l.a.bool]),hide:l.a.bool,layout:l.a.oneOf(["horizontal","vertical"]),baseLine:l.a.oneOfType([l.a.number,l.a.array]),isRange:l.a.bool,points:l.a.arrayOf(l.a.shape({x:l.a.number,y:l.a.number,value:l.a.oneOfType([l.a.number,l.a.array])})),onAnimationStart:l.a.func,onAnimationEnd:l.a.func,animationId:l.a.number,isAnimationActive:l.a.bool,animationBegin:l.a.number,animationDuration:l.a.number,animationEasing:l.a.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),id:l.a.string}),ig.defaultProps={stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!te(),animationBegin:0,animationDuration:1500,animationEasing:"ease"},ig.getBaseValue=function(e,t,n){var r=e.layout,o=e.baseValue;if(A(o))return o;var i="horizontal"===r?n:t,a=i.scale.domain();if("number"===i.type){var s=Math.max(a[0],a[1]),l=Math.min(a[0],a[1]);return"dataMin"===o?l:"dataMax"===o||s<0?s:Math.max(Math.min(a[0],a[1]),0)}return"dataMin"===o?a[0]:"dataMax"===o?a[1]:a[0]},ig.getComposedData=function(e){var t,n=e.props,r=e.xAxis,o=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,s=e.bandSize,l=e.dataKey,c=e.stackedData,u=e.dataStartIndex,d=e.displayedData,f=e.offset,h=n.layout,m=c&&c.length,g=ig.getBaseValue(n,r,o),v=!1,y=d.map((function(e,t){var n;return m?n=c[u+t]:(n=wc(e,l),_()(n)?v=!0:n=[g,n]),"horizontal"===h?{x:Uc({axis:r,ticks:i,bandSize:s,entry:e,index:t}),y:p()(n[1])?null:o.scale(n[1]),value:n,payload:e}:{x:p()(n[1])?null:r.scale(n[1]),y:Uc({axis:o,ticks:a,bandSize:s,entry:e,index:t}),value:n,payload:e}}));return t=m||v?y.map((function(e){return"horizontal"===h?{x:e.x,y:p()(S()(e,"value[0]"))?null:o.scale(S()(e,"value[0]"))}:{x:p()(S()(e,"value[0]"))?null:r.scale(S()(e,"value[0]")),y:e.y}})):"horizontal"===h?o.scale(g):r.scale(g),Zm({points:y,baseLine:t,layout:h,isRange:v},f)},ig.renderDotItem=function(e,t){return a.a.isValidElement(e)?a.a.cloneElement(e,t):y()(e)?e(t):a.a.createElement(up,Xm({},t,{className:"recharts-area-dot"}))};var ag=ig;function sg(e){return(sg="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lg(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function cg(){return(cg=Object.assign||function(e){for(var t=1;t0&&Math.abs(m)0&&Math.abs(p)=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function pv(){return(pv=Object.assign||function(e){for(var t=1;t0&&n.handleMouseMove(e.changedTouches[0])},n.handleTouchStart=function(e){null!=e.changedTouches&&e.changedTouches.length>0&&n.handleMouseDown(e.changedTouches[0])},n.handleTouchEnd=function(e){null!=e.changedTouches&&e.changedTouches.length>0&&n.handleMouseUp(e.changedTouches[0])},n.verticalCoordinatesGenerator=function(e){var t=e.xAxis,n=e.width,r=e.height,o=e.offset;return Nc(Sm.getTicks(mv({},Sm.defaultProps,{},t,{ticks:Rc(t,!0),viewBox:{x:0,y:0,width:n,height:r}})),o.left,o.left+o.width)},n.horizontalCoordinatesGenerator=function(e){var t=e.yAxis,n=e.width,r=e.height,o=e.offset;return Nc(Sm.getTicks(mv({},Sm.defaultProps,{},t,{ticks:Rc(t,!0),viewBox:{x:0,y:0,width:n,height:r}})),o.top,o.top+o.height)},n.axesTicksGenerator=function(e){return Rc(e,!0)},n.tooltipTicksGenerator=function(e){var t=D(e),n=Rc(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Un()(n,(function(e){return e.coordinate})),tooltipAxis:t,tooltipAxisBandSize:$c(t)}},n.renderCursor=function(e){var r=n.state,o=r.isTooltipActive,a=r.activeCoordinate,s=r.activePayload,l=r.offset;if(!e||!e.props.cursor||!o||!a)return null;var c,u=n.props.layout,d=Rd;if("ScatterChart"===t)c=a,d=Ep;else if("BarChart"===t)c=n.getCursorRectangle(),d=Gd;else if("radial"===u){var p=n.getCursorPoints(),f=p.cx,h=p.cy,m=p.radius;c={cx:f,cy:h,startAngle:p.startAngle,endAngle:p.endAngle,innerRadius:m,outerRadius:m},d=$u}else c={points:n.getCursorPoints()},d=Rd;var g=e.key||"_recharts-cursor",v=mv({stroke:"#ccc",pointerEvents:"none"},l,{},c,{},K(e.props.cursor),{payload:s,key:g,className:"recharts-tooltip-cursor"});return Object(i.isValidElement)(e.props.cursor)?Object(i.cloneElement)(e.props.cursor,v):Object(i.createElement)(d,v)},n.renderPolarAxis=function(e,t,r){var o=e.type.axisType,a=n.state["".concat(o,"Map")][e.props["".concat(o,"Id")]];return Object(i.cloneElement)(e,mv({},a,{className:o,key:e.key||"".concat(t,"-").concat(r),ticks:Rc(a,!0)}))},n.renderXAxis=function(e,t,r){var o=n.state.xAxisMap[e.props.xAxisId];return n.renderAxis(o,e,t,r)},n.renderYAxis=function(e,t,r){var o=n.state.yAxisMap[e.props.yAxisId];return n.renderAxis(o,e,t,r)},n.renderGrid=function(e){var t=n.state,r=t.xAxisMap,o=t.yAxisMap,a=t.offset,s=n.props,l=s.width,c=s.height,u=D(r),d=rv()(o,(function(e){return hh()(e.domain,Number.isFinite)}))||D(o),p=e.props||{};return Object(i.cloneElement)(e,{key:e.key||"grid",x:A(p.x)?p.x:a.left,y:A(p.y)?p.y:a.top,width:A(p.width)?p.width:a.width,height:A(p.height)?p.height:a.height,xAxis:u,yAxis:d,offset:a,chartWidth:l,chartHeight:c,verticalCoordinatesGenerator:p.verticalCoordinatesGenerator||n.verticalCoordinatesGenerator,horizontalCoordinatesGenerator:p.horizontalCoordinatesGenerator||n.horizontalCoordinatesGenerator})},n.renderPolarGrid=function(e){var t=n.state,r=t.radiusAxisMap,o=t.angleAxisMap,a=D(r),s=D(o),l=s.cx,c=s.cy,u=s.innerRadius,d=s.outerRadius;return Object(i.cloneElement)(e,{polarAngles:Rc(s,!0).map((function(e){return e.coordinate})),polarRadius:Rc(a,!0).map((function(e){return e.coordinate})),cx:l,cy:c,innerRadius:u,outerRadius:d,key:e.key||"polar-grid"})},n.renderBrush=function(e){var t=n.props,r=t.margin,o=t.data,a=n.state,s=a.offset,l=a.dataStartIndex,c=a.dataEndIndex,u=a.updateId;return Object(i.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:Ic(n.handleBrushChange,null,e.props.onChange),data:o,x:A(e.props.x)?e.props.x:s.left,y:A(e.props.y)?e.props.y:s.top+s.height+s.brushBottom-(r.bottom||0),width:A(e.props.width)?e.props.width:s.width,startIndex:l,endIndex:c,updateId:"brush-".concat(u)})},n.renderReferenceElement=function(e,t,r){if(!e)return null;var o=bv(n).clipPathId,a=n.state,s=a.xAxisMap,l=a.yAxisMap,c=a.offset,u=e.props,d=u.xAxisId,p=u.yAxisId;return Object(i.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(r),xAxis:s[d],yAxis:l[p],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:o})},n.renderGraphicChild=function(e,t,r){var o=n.filterFormatItem(e,t,r);if(!o)return null;var a=Object(i.cloneElement)(e,o.props),s=n.state,l=s.isTooltipActive,c=s.tooltipAxis,u=s.activeTooltipIndex,d=s.activeLabel,f=n.props.children,h=Y(f,hr),m=o.props,g=m.points,v=m.isRange,y=m.baseLine,b=o.item.props,_=b.activeDot;if(!b.hide&&l&&h&&_&&u>=0){var E,S;if(c.dataKey&&!c.allowDuplicatedCategory){var w="function"===typeof c.dataKey?function(e){return c.dataKey(e.payload)}:"payload.".concat(c.dataKey);E=P(g,w,d),S=v&&y&&P(y,w,d)}else E=g[u],S=v&&y&&y[u];if(!p()(E))return[a].concat(fv(n.renderActivePoints({item:o,activePoint:E,basePoint:S,childIndex:u,isRange:v})))}return v?[a,null,null]:[a,null]},n.renderCustomized=function(e){return Object(i.cloneElement)(e,mv({},n.props,{},n.state))};var o=n.constructor.createDefaultState(e);return n.state=mv({},o,{updateId:0},n.updateStateOfAxisMapsOffsetAndStackGroups(mv({props:e},o,{updateId:0}))),n.uniqueChartId=p()(e.id)?I("recharts"):e.id,n.clipPathId="".concat(n.uniqueChartId,"-clip"),e.throttleDelay&&(n.triggeredAfterMouseMove=iv()(n.triggeredAfterMouseMove,e.throttleDelay)),n}var l,f,h;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_v(e,t)}(r,e),l=r,h=[{key:"getAxisNameByLayout",value:function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}}},{key:"renderActiveDot",value:function(e,t){var n;return n=Object(i.isValidElement)(e)?Object(i.cloneElement)(e,t):y()(e)?e(t):a.a.createElement(up,t),a.a.createElement(ve,{className:"recharts-active-dot",key:t.key},n)}}],(f=[{key:"componentDidMount",value:function(){p()(this.props.syncId)||this.addListener()}},{key:"componentWillReceiveProps",value:function(e){var t=this,n=this.props,r=n.data,o=n.children,i=n.width,a=n.height,s=n.layout,l=n.stackOffset,c=n.margin,u=this.state.updateId;if(e.data===r&&e.width===i&&e.height===a&&e.layout===s&&e.stackOffset===l&&j(e.margin,c)){if(!ie(e.children,o)){var d=p()(e.data)?u+1:u;this.setState((function(n){return mv({updateId:d},t.updateStateOfAxisMapsOffsetAndStackGroups(mv({props:e},n,{updateId:d})))}))}}else{var f=this.constructor.createDefaultState(e);this.setState(mv({},f,{updateId:u+1},this.updateStateOfAxisMapsOffsetAndStackGroups(mv({props:e},f,{updateId:u+1}))))}p()(this.props.syncId)&&!p()(e.syncId)&&this.addListener(),!p()(this.props.syncId)&&p()(e.syncId)&&this.removeListener()}},{key:"componentWillUnmount",value:function(){p()(this.props.syncId)||this.removeListener(),"function"===typeof this.triggeredAfterMouseMove.cancel&&this.triggeredAfterMouseMove.cancel()}},{key:"getAxisMap",value:function(e,t){var n=t.axisType,r=void 0===n?"xAxis":n,o=t.AxisComp,i=t.graphicalItems,a=t.stackGroups,s=t.dataStartIndex,l=t.dataEndIndex,c=e.children,u="".concat(r,"Id"),d=$(c,o),p={};return d&&d.length?p=this.getAxisMapByAxes(e,{axes:d,graphicalItems:i,axisType:r,axisIdKey:u,stackGroups:a,dataStartIndex:s,dataEndIndex:l}):i&&i.length&&(p=this.getAxisMapByItems(e,{Axis:o,graphicalItems:i,axisType:r,axisIdKey:u,stackGroups:a,dataStartIndex:s,dataEndIndex:l})),p}},{key:"getAxisMapByAxes",value:function(e,t){var n=this,r=t.axes,o=t.graphicalItems,i=t.axisType,a=t.axisIdKey,s=t.stackGroups,l=t.dataStartIndex,c=t.dataEndIndex,u=e.layout,d=e.children,f=e.stackOffset,h=Ac(u,i);return r.reduce((function(t,r){var m=r.props,g=m.type,v=m.dataKey,y=m.allowDataOverflow,b=m.allowDuplicatedCategory,E=m.scale,S=m.ticks,w=r.props[a],x=n.constructor.getDisplayedData(e,{graphicalItems:o.filter((function(e){return e.props[a]===w})),dataStartIndex:l,dataEndIndex:c}),T=x.length;if(!t[w]){var O,C,k;if(v){if(O=xc(x,v,g),"category"===g&&h){var A=function(e){if(!_()(e))return!1;for(var t=e.length,n={},r=0;r=0?e:[].concat(fv(e),[t])}),[]))}else if("category"===g)O=b?O.filter((function(e){return""!==e&&!p()(e)})):Yc(r.props.domain,O,r).reduce((function(e,t){return e.indexOf(t)>=0||""===t||p()(t)?e:[].concat(fv(e),[t])}),[]);else if("number"===g){var N=function(e,t,n,r){var o=t.map((function(t){return Cc(e,t,n,r)})).filter((function(e){return!p()(e)}));return o&&o.length?o.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]):null}(x,o.filter((function(e){return e.props[a]===w&&!e.props.hide})),v,i);N&&(O=N)}!h||"number"!==g&&"auto"===E||(k=xc(x,v,"category"))}else O=h?Xf()(0,T):s&&s[w]&&s[w].hasStack&&"number"===g?"expand"===f?[0,1]:Gc(s[w].stackGroups,l,c):kc(x,o.filter((function(e){return e.props[a]===w&&!e.props.hide})),g,!0);return"number"===g&&(O=av(d,O,w,i,S),r.props.domain&&(O=qc(r.props.domain,O,y))),mv({},t,gv({},w,mv({},r.props,{axisType:i,domain:O,categoricalDomain:k,duplicateDomain:C,originalDomain:r.props.domain,isCategorial:h,layout:u})))}return t}),{})}},{key:"getAxisMapByItems",value:function(e,t){var n=t.graphicalItems,r=t.Axis,o=t.axisType,i=t.axisIdKey,a=t.stackGroups,s=t.dataStartIndex,l=t.dataEndIndex,c=e.layout,u=e.children,d=this.constructor.getDisplayedData(e,{graphicalItems:n,dataStartIndex:s,dataEndIndex:l}),p=d.length,f=Ac(c,o),h=-1;return n.reduce((function(e,t){var m,g=t.props[i];return e[g]?e:(h++,f?m=Xf()(0,p):a&&a[g]&&a[g].hasStack?(m=Gc(a[g].stackGroups,s,l),m=av(u,m,g,o)):(m=qc(r.defaultProps.domain,kc(d,n.filter((function(e){return e.props[i]===g&&!e.props.hide})),"number"),r.defaultProps.allowDataOverflow),m=av(u,m,g,o)),mv({},e,gv({},g,mv({axisType:o},r.defaultProps,{hide:!0,orientation:Ev[o]&&Ev[o][h%2],domain:m,originalDomain:r.defaultProps.domain,isCategorial:f,layout:c}))))}),{})}},{key:"getActiveCoordinate",value:function(e,t,n){var r=this.props.layout,o=e.find((function(e){return e&&e.index===t}));if(o){if("horizontal"===r)return{x:o.coordinate,y:n.y};if("vertical"===r)return{x:n.x,y:o.coordinate};if("centric"===r){var i=o.coordinate,a=n.radius;return mv({},n,{},tu(n.cx,n.cy,a,i),{angle:i,radius:a})}var s=o.coordinate,l=n.angle;return mv({},n,{},tu(n.cx,n.cy,s,l),{angle:l,radius:s})}return Sv}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t=function(e,t){return{chartX:Math.round(e.pageX-t.left),chartY:Math.round(e.pageY-t.top)}}(e,function(e){var t=e.ownerDocument.documentElement,n={top:0,left:0};return"undefined"!==typeof e.getBoundingClientRect&&(n=e.getBoundingClientRect()),{top:n.top+window.pageYOffset-t.clientTop,left:n.left+window.pageXOffset-t.clientLeft}}(this.container)),n=this.inRange(t.chartX,t.chartY);if(!n)return null;var r=this.state,i=r.xAxisMap,a=r.yAxisMap;if("axis"!==o&&i&&a){var s=D(i).scale,l=D(a).scale;return mv({},t,{xValue:s&&s.invert?s.invert(t.chartX):null,yValue:l&&l.invert?l.invert(t.chartY):null})}var c=this.state,u=c.orderedTooltipTicks,d=c.tooltipAxis,p=c.tooltipTicks,f=function(e,t,n,r){var o=-1,i=t.length;if(i>1){if(r&&"angleAxis"===r.axisType&&Math.abs(Math.abs(r.range[1]-r.range[0])-360)<=1e-6)for(var a=r.range,s=0;s0?n[s-1].coordinate:n[i-1].coordinate,c=n[s].coordinate,u=s>=i-1?n[0].coordinate:n[s+1].coordinate,d=void 0;if(C(c-l)!==C(u-c)){var p=[];if(C(u-c)===C(a[1]-a[0])){d=u;var f=c+a[1]-a[0];p[0]=Math.min(f,(f+l)/2),p[1]=Math.max(f,(f+l)/2)}else{d=l;var h=u+a[1]-a[0];p[0]=Math.min(c,(h+c)/2),p[1]=Math.max(c,(h+c)/2)}var m=[Math.min(c,(d+c)/2),Math.max(c,(d+c)/2)];if(e>m[0]&&e<=m[1]||e>=p[0]&&e<=p[1]){o=n[s].index;break}}else{var g=Math.min(l,u),v=Math.max(l,u);if(e>(g+c)/2&&e<=(v+c)/2){o=n[s].index;break}}}else for(var y=0;y0&&y(t[y].coordinate+t[y-1].coordinate)/2&&e<=(t[y].coordinate+t[y+1].coordinate)/2||y===i-1&&e>(t[y].coordinate+t[y-1].coordinate)/2){o=t[y].index;break}}else o=0;return o}(this.calculateTooltipPos(n),u,p,d);if(f>=0&&p){var h=p[f]&&p[f].value;return mv({},t,{activeTooltipIndex:f,activeLabel:h,activePayload:this.getTooltipContent(f,h),activeCoordinate:this.getActiveCoordinate(u,f,n)})}return null}},{key:"getTooltipContent",value:function(e,t){var n=this.state,r=n.graphicalItems,o=n.tooltipAxis,i=this.constructor.getDisplayedData(this.props,this.state);return e<0||!r||!r.length||e>=i.length?null:r.reduce((function(n,r){if(r.props.hide)return n;var a,s=r.props,l=s.dataKey,c=s.name,u=s.unit,d=s.formatter,p=s.data,f=s.tooltipType;return(a=o.dataKey&&!o.allowDuplicatedCategory?P(p||i,o.dataKey,t):p&&p[e]||i[e])?[].concat(fv(n),[mv({},K(r),{dataKey:l,unit:u,formatter:d,name:c||l,color:Tc(r),value:wc(a,l),type:f,payload:a})]):n}),[])}},{key:"getFormatItems",value:function(e,t){var n=this,r=t.graphicalItems,o=t.stackGroups,i=t.offset,a=t.updateId,l=t.dataStartIndex,c=t.dataEndIndex,u=e.barSize,d=e.layout,f=e.barGap,h=e.barCategoryGap,m=e.maxBarSize,g=this.constructor.getAxisNameByLayout(d),v=g.numericAxisName,y=g.cateAxisName,b=this.constructor.hasBar(r),_=b&&function(e){var t=e.barSize,n=e.stackGroups,r=void 0===n?{}:n;if(!r)return{};for(var o={},i=Object.keys(r),a=0,s=i.length;a=0}));if(g&&g.length){var v=g[0].props.barSize,y=g[0].props[m];o[y]||(o[y]=[]),o[y].push({item:g[0],stackList:g.slice(1),barSize:p()(v)?t:v})}}return o}({barSize:u,stackGroups:o}),E=[];return r.forEach((function(r,u){var g,S=n.constructor.getDisplayedData(e,{dataStartIndex:l,dataEndIndex:c},r),w=r.props,x=w.dataKey,T=w.maxBarSize,O=r.props["".concat(v,"Id")],C=r.props["".concat(y,"Id")],k=s.reduce((function(e,n){var o,i=t["".concat(n.axisType,"Map")],a=r.props["".concat(n.axisType,"Id")],s=i&&i[a];return mv({},e,(gv(o={},n.axisType,s),gv(o,"".concat(n.axisType,"Ticks"),Rc(s)),o))}),{}),A=k[y],R=k["".concat(y,"Ticks")],I=o&&o[O]&&o[O].hasStack&&function(e,t){var n=e.props.stackId;if(N(n)){var r=t[n];if(r&&r.items.length){for(var o=-1,i=0,a=r.items.length;i=0?r.stackedData[o]:null}}return null}(r,o[O].stackGroups),D=$c(A,R),L=p()(T)?m:T,P=b&&function(e){var t=e.barGap,n=e.barCategoryGap,r=e.bandSize,o=e.sizeList,i=void 0===o?[]:o,a=e.maxBarSize,s=i.length;if(s<1)return null;var l,c=M(t,r,0,!0);if(i[0].barSize===+i[0].barSize){var u=!1,d=r/s,p=i.reduce((function(e,t){return e+t.barSize||0}),0);(p+=(s-1)*c)>=r&&(p-=(s-1)*c,c=0),p>=r&&d>0&&(u=!0,p=s*(d*=.9));var f={offset:((r-p)/2>>0)-c,size:0};l=i.reduce((function(e,t){var n=[].concat(bc(e),[{item:t.item,position:{offset:f.offset+f.size+c,size:u?d:t.barSize}}]);return f=n[n.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:f})})),n}),[])}else{var h=M(n,r,0,!0);r-2*h-(s-1)*c<=0&&(c=0);var m=(r-2*h-(s-1)*c)/s;m>1&&(m>>=0);var g=a===+a?Math.min(m,a):m;l=i.reduce((function(e,t,n){var r=[].concat(bc(e),[{item:t.item,position:{offset:h+(m+c)*n+(m-g)/2,size:g}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){r.push({item:e,position:r[r.length-1].position})})),r}),[])}return l}({barGap:f,barCategoryGap:h,bandSize:D,sizeList:_[C],maxBarSize:L}),j=r&&r.type&&r.type.getComposedData;j&&E.push({props:mv({},j(mv({},k,{displayedData:S,props:e,dataKey:x,item:r,bandSize:D,barPosition:P,offset:i,stackedData:I,layout:d,dataStartIndex:l,dataEndIndex:c,onItemMouseLeave:Ic(n.handleItemMouseLeave,null,r.props.onMouseLeave),onItemMouseEnter:Ic(n.handleItemMouseEnter,null,r.props.onMouseEnter)})),(g={key:r.key||"item-".concat(u)},gv(g,v,k[v]),gv(g,y,k[y]),gv(g,"animationId",a),g)),childIndex:se(r,e.children),item:r})})),E}},{key:"getCursorRectangle",value:function(){var e=this.props.layout,t=this.state,n=t.activeCoordinate,r=t.offset,o=t.tooltipAxisBandSize,i=o/2;return{stroke:"none",fill:"#ccc",x:"horizontal"===e?n.x-i:r.left+.5,y:"horizontal"===e?r.top+.5:n.y-i,width:"horizontal"===e?o:r.width-1,height:"horizontal"===e?r.height-1:o}}},{key:"getCursorPoints",value:function(){var e,t,n,r,o=this.props.layout,i=this.state,a=i.activeCoordinate,s=i.offset;if("horizontal"===o)n=e=a.x,t=s.top,r=s.top+s.height;else if("vertical"===o)r=t=a.y,e=s.left,n=s.left+s.width;else if(!p()(a.cx)||!p()(a.cy)){if("centric"!==o){var l=a.cx,c=a.cy,u=a.radius,d=a.startAngle,f=a.endAngle;return{points:[tu(l,c,u,d),tu(l,c,u,f)],cx:l,cy:c,radius:u,startAngle:d,endAngle:f}}var h=a.cx,m=a.cy,g=a.innerRadius,v=a.outerRadius,y=a.angle,b=tu(h,m,g,y),_=tu(h,m,v,y);e=b.x,t=b.y,n=_.x,r=_.y}return[{x:e,y:t},{x:n,y:r}]}},{key:"calculateTooltipPos",value:function(e){var t=this.props.layout;return"horizontal"===t?e.x:"vertical"===t?e.y:"centric"===t?e.angle:e.radius}},{key:"inRange",value:function(e,t){var n=this.props.layout;if("horizontal"===n||"vertical"===n){var r=this.state.offset;return e>=r.left&&e<=r.left+r.width&&t>=r.top&&t<=r.top+r.height?{x:e,y:t}:null}var o=this.state,i=o.angleAxisMap,a=o.radiusAxisMap;if(i&&a){var s=D(i);return au({x:e,y:t},s)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=Y(e,hr)&&"axis"===o?{onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd}:{};return mv({},Q(this.props,this.handleOuterEvent),{},t)}},{key:"updateStateOfAxisMapsOffsetAndStackGroups",value:function(e){var r=this,o=e.props,i=e.dataStartIndex,a=e.dataEndIndex,l=e.updateId;if(!ee({props:o}))return null;var c=o.children,u=o.layout,p=o.stackOffset,f=o.data,h=o.reverseStackOrder,m=this.constructor.getAxisNameByLayout(u),g=m.numericAxisName,v=m.cateAxisName,y=$(c,n),b=function(e,t,n,r,o,i){if(!e)return null;var a=(i?t.reverse():t).reduce((function(e,t){var o=t.props,i=o.stackId;if(o.hide)return e;var a=t.props[n],s=e[a]||{hasStack:!1,stackGroups:{}};if(N(i)){var l=s.stackGroups[i]||{numericAxisId:n,cateAxisId:r,items:[]};l.items.push(t),s.hasStack=!0,s.stackGroups[i]=l}else s.stackGroups[I("_stackId_")]={numericAxisId:n,cateAxisId:r,items:[t]};return Ec({},e,Sc({},a,s))}),{});return Object.keys(a).reduce((function(t,i){var s=a[i];return s.hasStack&&(s.stackGroups=Object.keys(s.stackGroups).reduce((function(t,i){var a=s.stackGroups[i];return Ec({},t,Sc({},i,{numericAxisId:n,cateAxisId:r,items:a.items,stackedData:Fc(e,a.items,o)}))}),{})),Ec({},t,Sc({},i,s))}),{})}(f,y,"".concat(g,"Id"),"".concat(v,"Id"),p,h),_=s.reduce((function(e,t){return mv({},e,gv({},"".concat(t.axisType,"Map"),r.getAxisMap(o,mv({},t,{graphicalItems:y,stackGroups:t.axisType===g&&b,dataStartIndex:i,dataEndIndex:a}))))}),{}),E=this.calculateOffset(mv({},_,{props:o,graphicalItems:y}));Object.keys(_).forEach((function(e){_[e]=d(o,_[e],E,e.replace("Map",""),t)}));var S=_["".concat(v,"Map")],w=this.tooltipTicksGenerator(S),x=this.getFormatItems(o,mv({},_,{dataStartIndex:i,dataEndIndex:a,updateId:l,graphicalItems:y,stackGroups:b,offset:E}));return mv({formatedGraphicalItems:x,graphicalItems:y,offset:E,stackGroups:b},w,{},_)}},{key:"addListener",value:function(){lv.on(cv,this.handleReceiveSyncEvent),lv.setMaxListeners&&lv._maxListeners&&lv.setMaxListeners(lv._maxListeners+1)}},{key:"removeListener",value:function(){lv.removeListener(cv,this.handleReceiveSyncEvent),lv.setMaxListeners&&lv._maxListeners&&lv.setMaxListeners(lv._maxListeners-1)}},{key:"calculateOffset",value:function(e){var t=e.props,n=e.graphicalItems,r=e.xAxisMap,o=void 0===r?{}:r,i=e.yAxisMap,a=void 0===i?{}:i,s=t.width,l=t.height,c=t.children,u=t.margin||{},d=Y(c,ch),p=Y(c,kt),f=Object.keys(a).reduce((function(e,t){var n=a[t],r=n.orientation;return n.mirror||n.hide?e:mv({},e,gv({},r,e[r]+n.width))}),{left:u.left||0,right:u.right||0}),h=Object.keys(o).reduce((function(e,t){var n=o[t],r=n.orientation;return n.mirror||n.hide?e:mv({},e,gv({},r,e[r]+n.height))}),{top:u.top||0,bottom:u.bottom||0}),m=mv({},h,{},f),g=m.bottom;return d&&(m.bottom+=d.props.height||ch.defaultProps.height),p&&this.legendInstance&&(m=function(e,t,n,r){var o=n.children,i=n.width,a=n.height,s=n.margin,l=i-(s.left||0)-(s.right||0),c=a-(s.top||0)-(s.bottom||0),u=Oc({children:o,items:t,legendWidth:l,legendHeight:c}),d=e;if(u){var p=r||{},f=u.align,h=u.verticalAlign,m=u.layout;("vertical"===m||"horizontal"===m&&"center"===h)&&A(e[f])&&(d=Ec({},e,Sc({},f,d[f]+(p.width||0)))),("horizontal"===m||"vertical"===m&&"center"===f)&&A(e[h])&&(d=Ec({},e,Sc({},h,d[h]+(p.height||0))))}return d}(m,n,t,this.legendInstance.getBBox())),mv({brushBottom:g},m,{width:s-m.left-m.right,height:l-m.top-m.bottom})}},{key:"triggerSyncEvent",value:function(e){var t=this.props.syncId;p()(t)||lv.emit(cv,t,this.uniqueChartId,e)}},{key:"filterFormatItem",value:function(e,t,n){for(var r=this.state.formatedGraphicalItems,o=0,i=r.length;o=0}))},m.getDisplayedData=function(e,t,n){var r=t.graphicalItems,o=t.dataStartIndex,i=t.dataEndIndex,a=(r||[]).reduce((function(e,t){var n=t.props.data;return n&&n.length?[].concat(fv(e),fv(n)):e}),[]);if(a&&a.length>0)return a;if(n&&n.props&&n.props.data&&n.props.data.length>0)return n.props.data;var s=e.data;return s&&s.length&&A(o)&&A(i)?s.slice(o,i+1):[]},m},xv=wv({chartName:"LineChart",GraphicalChild:Ym,axisComponents:[{axisType:"xAxis",AxisComp:$g},{axisType:"yAxis",AxisComp:tv}],formatAxisMap:wh}),Tv=wv({chartName:"BarChart",GraphicalChild:bg,axisComponents:[{axisType:"xAxis",AxisComp:$g},{axisType:"yAxis",AxisComp:tv}],formatAxisMap:wh}),Ov=wv({chartName:"PieChart",GraphicalChild:xf,eventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:uf},{axisType:"radiusAxis",AxisComp:Xp}],formatAxisMap:ru,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},propTypes:{layout:l.a.oneOf(["centric"]),startAngle:l.a.number,endAngle:l.a.number,cx:l.a.oneOfType([l.a.number,l.a.string]),cy:l.a.oneOfType([l.a.number,l.a.string]),innerRadius:l.a.oneOfType([l.a.number,l.a.string]),outerRadius:l.a.oneOfType([l.a.number,l.a.string])}}),Cv=n(66),kv=n.n(Cv),Av=["#1890FF","#66B5FF","#41D9C7","#2FC25B","#6EDB8F","#9AE65C","#FACC14","#E6965C","#57AD71","#223273","#738AE6","#7564CC","#8543E0","#A877ED","#5C8EE6","#13C2C2","#70E0E0","#5CA3E6","#3436C7","#8082FF","#DD81E6","#F04864","#FA7D92","#D598D9"];function Nv(e){return(Nv="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rv(){return(Rv=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Mv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dv(e,t){for(var n=0;nn.height)&&(o=n.height);for(var i,a=n.x,s=0,l=e.length;sn.width)&&(o=n.width);for(var i,a=n.y,s=0,l=e.length;s0;)s.push(o=d[0]),s.area+=o.area,(i=Hv(s,c,n))<=l?(d.shift(),l=i):(s.area-=s.pop().area,a=Gv(s,c,a,!1),c=Math.min(a.width,a.height),s.length=s.area=0,l=1/0);return s.length&&(a=Gv(s,c,a,!0),s.length=s.area=0),Bv({},t,{children:u.map((function(t){return e(t,n)}))})}return t},Wv=function(e){function t(){var e,n;Mv(this,t);for(var r=arguments.length,o=new Array(r),i=0;i10&&l>10&&t.children&&"nest"===n&&(u=a.a.createElement(tp,{points:[{x:o+2,y:i+l/2},{x:o+6,y:i+l/2+3},{x:o+2,y:i+l/2+6}]}));var d=null,p=Ur(t.name);s>20&&l>20&&p.width2&&!h?null:r.constructor.renderContentItem(e,Bv({},t,{isAnimationActive:i,isUpdateAnimationActive:!u,width:m,height:g,x:o,y:p}),d,f)))})):a.a.createElement(ve,E,this.constructor.renderContentItem(e,Bv({},t,{isAnimationActive:!1,isUpdateAnimationActive:!1,width:m,height:g,x:v,y:y}),d,f))}},{key:"renderNode",value:function(e,t,n){var r=this,o=this.props,i=o.content,s=o.type,l=Bv({},K(this.props),{},t,{root:e}),c=!t.children||!t.children.length;return!(this.state.currentRoot.children||[]).filter((function(e){return e.depth===t.depth&&e.name===t.name})).length&&e.depth&&"nest"===s?null:a.a.createElement(ve,{key:"recharts-treemap-node-".concat(n),className:"recharts-treemap-depth-".concat(t.depth)},this.renderItem(i,l,c),t.children&&t.children.length?t.children.map((function(e,n){return r.renderNode(t,e,n)})):null)}},{key:"renderAllNodes",value:function(){var e=this.state.formatRoot;return e?this.renderNode(e,e,0):null}},{key:"renderTooltip",value:function(){var e=this.props,t=e.children,n=e.nameKey,r=Y(t,hr);if(!r)return null;var o=this.props,i=o.width,s=o.height,l=o.dataKey,c=this.state,u=c.isTooltipActive,d=c.activeNode,p={x:0,y:0,width:i,height:s},f=d?{x:d.x+d.width/2,y:d.y+d.height/2}:null,h=u&&d?[{payload:d,name:wc(d,n,""),value:wc(d,l)}]:[];return a.a.cloneElement(r,{viewBox:p,active:u,coordinate:f,label:"",payload:h})}},{key:"renderNestIndex",value:function(){var e=this,t=this.props,n=t.nameKey,r=t.nestIndexContent,o=this.state.nestIndex;return a.a.createElement("div",{className:"recharts-treemap-nest-index-wrapper",style:{marginTop:"8px",textAlign:"center"}},o.map((function(t,o){var i=S()(t,n,"root"),s=null;return a.a.isValidElement(r)&&(s=a.a.cloneElement(r,t,o)),s=y()(r)?r(t,o):i,a.a.createElement("div",{onClick:e.handleNestIndex.bind(e,t,o),key:"nest-index-".concat(I()),className:"recharts-treemap-nest-index-box",style:{cursor:"pointer",display:"inline-block",padding:"0 7px",background:"#000",color:"#fff",marginRight:"3px"}},s)})))}},{key:"render",value:function(){if(!ee(this))return null;var e=this.props,t=e.width,n=e.height,r=e.className,o=e.style,i=e.children,s=e.type,l=Iv(e,["width","height","className","style","children","type"]),c=K(l);return a.a.createElement("div",{className:u()("recharts-wrapper",r),style:Bv({},o,{position:"relative",cursor:"default",width:t,height:n})},a.a.createElement(pe,Rv({},c,{width:t,height:"nest"===s?n-30:n}),this.renderAllNodes(),re(i)),this.renderTooltip(),"nest"===s&&this.renderNestIndex())}}])&&Dv(n.prototype,r),o&&Dv(n,o),t}(i.PureComponent);Wv.displayName="Treemap",Wv.propTypes={width:l.a.number,height:l.a.number,data:l.a.array,animationId:l.a.number,style:l.a.object,aspectRatio:l.a.number,content:l.a.oneOfType([l.a.element,l.a.func]),fill:l.a.string,stroke:l.a.string,className:l.a.string,nameKey:l.a.oneOfType([l.a.string,l.a.number,l.a.func]),dataKey:l.a.oneOfType([l.a.string,l.a.number,l.a.func]),children:l.a.oneOfType([l.a.arrayOf(l.a.node),l.a.node]),type:l.a.oneOf(["flat","nest"]),colorPanel:l.a.array,nestIndexContent:l.a.oneOfType([l.a.element,l.a.func]),onAnimationStart:l.a.func,onAnimationEnd:l.a.func,onMouseEnter:l.a.func,onMouseLeave:l.a.func,onClick:l.a.func,isAnimationActive:l.a.bool,isUpdateAnimationActive:l.a.bool,animationBegin:l.a.number,animationDuration:l.a.number,animationEasing:l.a.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"])},Wv.defaultProps={dataKey:"value",aspectRatio:.5*(1+Math.sqrt(5)),isAnimationActive:!te(),isUpdateAnimationActive:!te(),animationBegin:0,animationDuration:1500,animationEasing:"linear",type:"flat"};var qv=Wv,$v=n(1351),Yv=n.n($v);function Kv(e){return(Kv="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xv(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Qv(){return(Qv=Object.assign||function(e){for(var t=1;t