@evergis/charts 2.0.17 → 2.0.21
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/charts/BarChart/drawTooltip/index.d.ts +1 -1
- package/dist/charts/BarChart/drawTooltip/types.d.ts +1 -1
- package/dist/charts/BarChart/styled.d.ts +1 -0
- package/dist/charts/BarChart/types.d.ts +2 -0
- package/dist/charts.cjs.development.js +58 -31
- package/dist/charts.cjs.development.js.map +1 -1
- package/dist/charts.cjs.production.min.js +1 -1
- package/dist/charts.cjs.production.min.js.map +1 -1
- package/dist/charts.esm.js +58 -31
- package/dist/charts.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),a=t(e),n=require("react"),r=t(n),l=require("d3"),o=t(require("react-dom/server")),i=require("react-dom");function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t}).apply(this,arguments)}function c(t,e){if(null==t)return{};var a,n,r={},l=Object.keys(t);for(n=0;n<l.length;n++)e.indexOf(a=l[n])>=0||(r[a]=t[a]);return r}function d(t,e){return e||(e=t.slice(0)),t.raw=e,t}function u(){const t=d(["\n position: relative;\n width: 100%;\n box-sizing: border-box;\n"]);return u=function(){return t},t}const p=a.div(u());function h(){const[t,e]=n.useState(null);return[n.useCallback(e,[e]),t]}const m=(t,e,a)=>{const r=n.useMemo(()=>e?function(t,e){let a=!1;return function(){a||(t(...arguments),a=!0,setTimeout((function(){a=!1}),e))}}(e,a||44):void 0,[e,a]);n.useEffect(()=>(r&&"number"!=typeof t&&window.addEventListener("resize",r),()=>r&&window.removeEventListener("resize",r)),[t,r])},b=(t,e,a)=>(l.select(t).select("svg").remove(),l.select(t).append("svg").attr("width",e).attr("height",a));function f(){const t=d(["\n width: 100%;\n overflow: hidden;\n user-select: none;\n"]);return f=function(){return t},t}const g=a.div(f()),C=t=>t*(2-t),x=(t,e,a)=>Math.min(Math.max(t,e),a),y={animation:0,speed:0,timestamp:0,startX:0,currentX:0},v=t=>{let{children:e,width:a,onSwipe:o}=t,i=c(t,["children","width","onSwipe"]);const[d,u]=h();return((t,e)=>{let{width:a,duration:r,animationFunc:o,onSwipe:i}=e;const s=l.select(t),c=l.select("body"),d=l.select(document),u=n.useRef(y);n.useEffect(()=>{a&&u.current.animation&&(cancelAnimationFrame(u.current.animation),u.current=y)},[a]);const p=n.useCallback(e=>{const{width:n}=t?t.getBoundingClientRect():{width:0},[r]=l.pointer(e.type.includes("touch")?e.touches[0]:e),o=x(r-u.current.startX,-(a-n),0);if(s.style("transform","translateX("+o+"px)"),u.current.currentX){const t=100,e=Date.now(),a=Math.round((o-u.current.currentX)/(e-u.current.timestamp)*t);u.current.speed=a,u.current.timestamp=e}u.current.currentX=o,i&&i(o,s)},[i,a,t,s]),h=n.useCallback(()=>{const{width:e}=t?t.getBoundingClientRect():{width:0};d.on("mousemove.swipe touchmove.swipe mouseup.swipe touchend.swipe",null),c.style("cursor",null),s.style("cursor",a>e?"grab":null),Date.now()-u.current.timestamp<44&&function(t){let{duration:e,timing:a,draw:n}=t;const r=performance.now();let l;requestAnimationFrame((function t(o){let i=(o-r)/e;i<1&&(l=requestAnimationFrame(t)),i>1&&cancelAnimationFrame(l);const s=a(i);n(s,l)}))}({duration:r,timing:o||C,draw:(t,n)=>{u.current.animation=n;const r=Math.round(2*u.current.speed*t),l=u.current.currentX+r,o=a-e,c=x(l,-o,0),d=Math.max(Math.min(l,o),0);u.current.currentX!==d&&(s.style("transform","translateX("+c+"px)"),i&&i(c,s))}})},[c,o,i,s,r,t,a,d]),m=n.useCallback(e=>{const a=e.type.includes("touch"),[n]=l.pointer(a?e.touches[0]:e,t),{left:r}=t&&t.parentElement?t.parentElement.getBoundingClientRect():{left:0};c.style("cursor","grabbing"),s.style("cursor","grabbing"),u.current.animation&&(cancelAnimationFrame(u.current.animation),u.current=y),u.current.startX=Math.max(n+r,0),d.on("mousemove.swipe touchmove.swipe",p),d.on("mouseup.swipe touchend.swipe",h)},[s,c,t,h,p,d]);n.useEffect(()=>{if(t){const{width:e}=t.getBoundingClientRect();a>e&&(s.style("cursor","grab"),s.on("mousedown.swipe touchstart.swipe",m))}},[s,m,t,a])})(u,s({width:a,onSwipe:o},i)),r.createElement(g,Object.assign({},i),r.createElement("div",{ref:d},e))};function T(){const t=d(["\n position: absolute;\n"]);return T=function(){return t},t}v.defaultProps={duration:1400};const L=t=>{let{anchor:e,index:a,translateX:n,translateY:r}=t;return 0===a&&"middle"===e?"translate(calc(-50% + "+n+"px), calc(-100% + "+r+"px))":"middle"===e?"translate(calc(-50% + "+n+"px), calc("+r+"px))":"start"===e?"translate(calc("+n+"px), calc(-50% + "+r+"px))":"end"===e?"translate(calc(-100% + "+n+"px), calc(-50% + "+r+"px))":"translate("+n+"px, "+r+"px)"},S=a.div.attrs(t=>({style:{transform:L(t)}}))(T());function k(){const t=d(["\n margin-left: 4px;\n font-size: 10px;\n color: rgba(255, 255, 255, 0.54);\n"]);return k=function(){return t},t}function M(){const t=d(["\n ","\n"]);return M=function(){return t},t}function A(){const t=d(["\n display: flex;\n align-items: center;\n padding: 2px 4px;\n border-radius: 4px;\n color: rgb(255, 255, 255);\n background-color: rgb(144, 197, 61);\n margin-left: 8px;\n"]);return A=function(){return t},t}function w(){const t=d(["\n position: absolute;\n top: 50%;\n right: 0;\n transform: translate(calc(100% + 6px), -50%);\n"]);return w=function(){return t},t}function B(){const t=d(["\n text-align: center;\n max-width: 120px;\n"]);return B=function(){return t},t}function N(){const t=d(["\n display: flex;\n align-items: center;\n font-size: 12px;\n"]);return N=function(){return t},t}const E=a.div(N()),G=a.div(B()),z=e.css(w()),Y=a.div(A()),X=a(Y)(M(),z),R=a.div(k());function I(){const t=d(["\n ."," {\n path,\n line,\n circle {\n fill: none;\n stroke-width: 1px;\n stroke: rgba(149, 149, 149, 0.18);\n }\n }\n ."," {\n font-size: 12px;\n fill-opacity: 0.56;\n }\n ."," {\n fill-opacity: 0.06;\n stroke-width: 2px;\n fill: rgb(144, 197, 61);\n stroke: rgb(144, 197, 61);\n }\n ."," {\n fill: rgb(144, 197, 61);\n }\n"]);return I=function(){return t},t}const P={radar:"radar",radarAxis:"radarAxis",radarAxisTextGlobal:"radarAxisTextGlobal",radarAxisText:"radarAxisText",radarPolygon:"radarPolygon",radarLabel:"radarLabel",radarLabelName:"radarLabelName",radarLabelBadge:"radarLabelBadge",radarLabelBadgePrefix:"radarLabelBadgePrefix",radarCircle:"radarCircle"},D=a(p)(I(),P.radarAxis,P.radarAxisText,P.radarPolygon,P.radarCircle),F=(t,e)=>{const{data:a,curve:n,polar:i,formatValue:c,badgePrefix:d,labelOffset:u,circleRadius:p,svgElements:h,renderLabel:m,customize:f,formatAxisValue:g,radarStyles:C,labelIndex:x,selectLabel:y}=e;if(null!==t&&a.length){const v=10,T="number"==typeof e.bleedLength?e.bleedLength:v,{width:L}=t.getBoundingClientRect(),k=e.width||L,M=400,A=e.height||M,w=e.minValue||Math.min(0,l.min(a,t=>l.min(t.map(t=>{let{value:e}=t;return e})))),B=(e.maxValue||Math.max(0,l.max(a,t=>l.max(t.map(t=>{let{value:e}=t;return e})))))-w,N=e.paddingY||0,z=Math.min((k-2*(e.paddingX||0)-2*T)/2,(A-2*N-2*T)/2),I=4,D=l.scaleLinear().domain([0,B||1]).range([]).ticks(e.levels||I),F=D[D.length-1],O=F+(D[1]-D[0]);F<B&&D.push(O);const V=e.levels||D.length-1,j=D[D.length-1],W=2*Math.PI/a[0].length,q=l.scaleLinear().range([0,z]).domain([0,j]),Z=l.lineRadial().curve(l.curveLinearClosed).radius(t=>{let{value:e}=t;return q(e)}).angle((t,e)=>e*W),U=l.lineRadial().curve(n||l.curveLinearClosed).radius(t=>{let{value:e}=t;return q(e)}).angle((t,e)=>e*W),_=b(t,k,A),H=_.append("g"),J=l.range(1,V+1).reverse(),K=t=>-t*z/V,Q=t=>j*t/V,$=H.append("g").attr("class",P.radarAxis).selectAll().data([a[0]]).enter(),tt=H.append("g").attr("class",P.radar),et=$.selectAll().data(a[0].map(t=>{let{name:e}=t;return e})).enter();let at=0;i?J.forEach(t=>{const e=$.append("circle").attr("cx",0).attr("cy",0).attr("r",()=>z/V*t).node().getBoundingClientRect().height;at=Math.max(at,e)}):J.map(Q).forEach(t=>{const e=$.append("path").attr("d",()=>Z(Array.from({length:a[0].length},()=>({value:t})))).node().getBoundingClientRect().height;at=Math.max(at,e)});const nt=q(j)+T;et.append("line").attr("x1",0).attr("y1",0).attr("x2",(t,e)=>Math.round(nt*Math.cos(W*e-Math.PI/2))).attr("y2",(t,e)=>Math.round(nt*Math.sin(W*e-Math.PI/2))),tt.selectAll("path").data(a).join("path").attr("class",P.radarPolygon).attr("style",(t,e)=>(null==C?void 0:C[e])||"").attr("d",t=>U(t.map(t=>s({},t,{value:t.value-w}))));const rt=l.format(",");H.append("g").attr("class",P.radarAxisTextGlobal).selectAll("text").data(J).enter().append("text").attr("class",P.radarAxisText).attr("x","4").attr("y",K).attr("dy",0).attr("dominant-baseline","central").text((t,e)=>{const a=Q(t)+w;return g?g(a,e):rt(a)}),p&&a.forEach(t=>{const e=H.append("g").attr("class",P.radarCircle);t.forEach((t,a)=>{let{value:n}=t;e.append("circle").attr("cx",Math.round(q(n)*Math.cos(W*a-Math.PI/2))).attr("cy",Math.round(q(n*Math.sin(W*a-Math.PI/2)))).attr("r",p)})});const lt=8,ot=A-T-N,it=k/2,st=ot/2+(ot-at)/2,ct=T+(u||lt);if(H.attr("transform","translate("+it+","+st+")"),(t=>{let{node:e,dataLength:a,radiusScale:n,maxValue:i,angleSlice:s,radius:c,xOffset:d,yOffset:u,translateX:p,translateY:h,renderLabel:m,selectLabel:b}=t;const f=l.select(e);f.selectAll(".d3-chart-label").remove();const g=t=>i/c*t,C=t=>n((i+g(u||0))*Math.sin(s*t-Math.PI/2));Array.from({length:a},(t,e)=>{return{x:Math.ceil((a=e,n(i+g(d||0))*Math.cos(s*a-Math.PI/2))),y:Math.ceil(C(e))};var a}).forEach((t,e)=>{let{x:n,y:l}=t;const i=((t,e)=>{const a=((t,e)=>360/e*t)(t,e),n=180;return[0,n].includes(a)?"middle":a<n?"start":"end"})(e,a),s=o.renderToString(r.createElement(S,{anchor:i,translateX:p||0,translateY:h||0,index:e,style:{left:n,top:l}},"function"==typeof m?m(i,e):m)),c=f.append("div").attr("class","d3-chart-label").html(s);b(c,i,e)})})({node:t,maxValue:j,translateX:it,translateY:st,dataLength:a[x||0].length,angleSlice:W,radius:z,radiusScale:q,xOffset:ct,yOffset:ct,renderLabel:(t,e)=>{const n=a.map(t=>t[e]),l="middle"===t?X:Y,o=a[x||0][e],{name:i,value:s}=o;return m?m({item:o,items:n,anchor:t,index:e}):r.createElement(E,{className:P.radarLabel},r.createElement(G,{className:P.radarLabelName},i),r.createElement(l,{className:P.radarLabelBadge},c?c(s,e):rt(s),d&&r.createElement(R,{className:P.radarLabelBadgePrefix},d)))},selectLabel:(t,e,n)=>{if(y){const r=a.map(t=>t[n]);y(t,{index:n,item:a[x||0][n],items:r,anchor:e})}}}),h){const t=o.renderToString(h);_.append("g").html(t)}f&&f(_)}},O=t=>{const{className:e,style:a}=t,[l,o]=h();return n.useEffect(()=>{o&&F(o,t)},[o,t]),m(t.width,()=>F(o,t)),r.createElement("div",{className:e,style:a},r.createElement(D,{ref:l}))};function V(t){return t*(Math.PI/180)}function j(){const t=d(["\n ."," {\n fill: #4a4a4a;\n }\n ."," {\n position: absolute;\n max-width: 128px;\n }\n ."," {\n stroke: #000;\n }\n ."," {\n fill: transparent;\n cursor: pointer;\n }\n"]);return j=function(){return t},t}O.defaultProps={height:400,data:[],curve:l.curveLinearClosed};const W={pieGlobal:"pieGlobal",pieSlice:"pieSlice",pieSliceLabel:"pieSliceLabel",pieSliceLabelValue:"pieSliceLabelValue",pieSliceLabelName:"pieSliceLabelName",pieRadialLabel:"pieRadialLabel",pieRadialLink:"pieRadialLink",pieTooltipContainer:"pieTooltipContainer",pieTooltipFlex:"pieTooltipFlex",pieTooltip:"pieTooltip",pieTooltipItem:"pieTooltipItem",pieTooltipName:"pieTooltipName",pieTooltipValue:"pieTooltipValue",pieTooltipColorBox:"pieTooltipColorBox",pieFullChartTooltipCircle:"pieFullChartTooltipCircle"},q=a(p)(j(),W.pieSliceLabel,W.pieRadialLabel,W.pieRadialLink,W.pieFullChartTooltipCircle),Z=t=>t.startAngle+(t.endAngle-t.startAngle)/2<Math.PI?1:-1,U=t=>t.startAngle+(t.endAngle-t.startAngle)/2<Math.PI?"start":"end";function _(){const t=d(["\n bottom: 6px;\n"]);return _=function(){return t},t}function H(){const t=d(["\n top: 6px;\n"]);return H=function(){return t},t}function J(){const t=d(["\n position: relative;\n font-size: 11px;\n color: #fff;\n font-weight: bold;\n letter-spacing: 0.52px;\n"]);return J=function(){return t},t}function K(){const t=d(["\n text-align: right;\n flex-shrink: 0;\n flex-grow: 1;\n"]);return K=function(){return t},t}function Q(){const t=d(["\n margin-right: 4px;\n"]);return Q=function(){return t},t}function $(){const t=d(["\n height: 2px;\n border-radius: 0;\n"]);return $=function(){return t},t}function tt(){const t=d(["\n margin-right: 4px;\n width: 10px;\n height: 10px;\n border-radius: 2px;\n"]);return tt=function(){return t},t}function et(){const t=d(["\n display: flex;\n align-items: center;\n margin-right: 4px;\n"]);return et=function(){return t},t}function at(){const t=d(["\n display: flex;\n align-items: center;\n margin-bottom: 0.25rem;\n &:last-of-type {\n margin-bottom: 0;\n }\n"]);return at=function(){return t},t}function nt(){const t=d(["\n font-size: 14px;\n margin-bottom: 6px;\n"]);return nt=function(){return t},t}function rt(){const t=d(["\n position: relative;\n font-size: 11px;\n color: #fff;\n margin-bottom: 8px;\n padding: 4px 6px;\n background-color: rgba(48, 69, 79, 1);\n border-radius: 4px;\n box-shadow: 0 0.1875rem 0.5rem rgba(48, 69, 79, 0.06);\n :before {\n content: '';\n position: absolute;\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 100%);\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 4px 3px 0 3px;\n border-color: rgba(48, 69, 79, 1) transparent transparent transparent;\n }\n"]);return rt=function(){return t},t}function lt(){const t=d(["\n align-items: center;\n"]);return lt=function(){return t},t}function ot(){const t=d([""]);return ot=function(){return t},t}function it(){const t=d(["\n width: 0;\n height: 0;\n display: flex;\n align-items: flex-end;\n justify-content: center;\n pointer-events: none;\n white-space: nowrap;\n"]);return it=function(){return t},t}const st=a.div(it()),ct=a(st)(ot()),dt=a(ct)(lt()),ut=a.div(rt()),pt=a.div(nt()),ht=a.div(at()),mt=a.div(et()),bt=a.div(tt()),ft=a(bt)($()),gt=a.div(Q()),Ct=a.div(K()),xt=a.div(J()),yt=a(xt)(H()),vt=a(xt)(_()),Tt=(t,e)=>{const{data:a,padAngle:n,onClick:i,outerRadius:s,startAngle:c,endAngle:d,cornerRadius:u,margin:p,enableSlicesLabels:h,formatSliceLabel:m,slicesLabelsSkipAngle:f,enableSlicesLabelsName:g,formatSliceLabelName:C,borderWidth:x,borderColor:y,enableRadialLabels:v,backgroundColor:T,radialLabelsLinkHorizontalLength:L,radialLabelsTextXOffset:S,formatRadialLabel:k,radialLabelYOffset:M,svgElements:A,formatSliceTitle:w,radialAngleXOffset:B,withTooltip:N,fullChartTooltip:E,tooltipClassName:G,tooltipBind:z,renderTooltip:Y,tooltipStyle:X}=e;if(null!==t&&a.length){const R=p?p.top:0,I=p?p.right:0,P=p?p.bottom:0,D=p?p.left:0,{width:F}=t.getBoundingClientRect(),O=e.width||F,j=240,q=e.height||j,_=(Math.min(O,q)-2*(x||0)-(O>q?R+P:I+D))/2,H=b(t,O,q),J=H.append("g").attr("class",W.pieGlobal).attr("transform","translate("+((O-(D+I))/2+D)+","+((q-(P+R))/2+R)+")"),K=45,Q=100,$=360,tt=l.pie().startAngle(-V(c||0)).endAngle(V(d||$)).padAngle(n?Math.max(Math.min(n/Q,K),0):0).sort(null).value(t=>{let{value:e}=t;return e})(a),et=.95,at=l.arc().cornerRadius(u||0).innerRadius(_).outerRadius(_*Math.min(Math.max(s||0,0),et));"string"==typeof T&&J.append("path").attr("fill",T).attr("d",()=>at({startAngle:V(0),endAngle:V($)}));const nt=l.format(","),rt=J.selectAll("allSlices").data(tt).enter().append("path").attr("d",at);if(rt.attr("class",W.pieSlice).attr("fill",t=>{let{index:e}=t;return a[e].color||""}).attr("stroke",y||"").attr("stroke-width",x||0).attr("style",i?"cursor: pointer":"").on("click",(t,e)=>i&&i(a[e.index])).append("svg:title").text(t=>w?w(t):E||N?"":(a[t.index].name||"")+" ("+nt(a[t.index].value)+")"),h){const t=J.selectAll("allSlices").data(tt).enter().append("text").attr("class",W.pieSliceLabel).attr("text-anchor","middle").attr("dominant-baseline","central").attr("transform",t=>"translate("+at.centroid(t)+")");t.append("tspan").attr("class",W.pieSliceLabelValue).text(t=>{const e=180*(t.endAngle-t.startAngle)/Math.PI;if(!f||e>f)return m?m(t):t.value}),g&&t.append("tspan").attr("class",W.pieSliceLabelName).text(t=>C?C(t):t.data.name).attr("x","0").attr("dy","1.2em")}if((t=>{let{arc:e,enableRadialLabels:a,global:n,node:r,radius:i,dataReady:s,radialLabelsLinkHorizontalLength:c,formatRadialLabel:d,radialLabelsTextXOffset:u,translateX:p,translateY:h,radialLabelYOffset:m,radialAngleXOffset:b}=t;const f=l.select(r);if(f.selectAll("."+W.pieRadialLabel).remove(),a){const t=4,a=l.arc().innerRadius(i).outerRadius(i);n.selectAll("allPolylines").data(s).enter().append("polyline").attr("class",W.pieRadialLink).style("fill","none").attr("points",n=>{const r=Z(n),l=e.centroid(n),o=a.centroid(n),s=a.centroid(n),d=[(i+(c||t))*r,s[1]];return[[l[0],l[1]],[o[0]+(b||0)*r,o[1]-(m||0)*n.index],[d[0],d[1]-(m||0)*n.index]]});const r=e=>{const n=a.centroid(e);return[(i+(c||t))*Z(e),n[1]]},g=4;f.selectAll("allLabels").data(s).enter().append("div").html(t=>o.renderToString(d?d(t):t.data.name)).attr("class",W.pieRadialLabel).style("transform",t=>(t=>{let{anchor:e,index:a,translateX:n,translateY:r}=t;return 0===a&&"middle"===e?"translate(calc(-50% + "+n+"px), calc(-100% + "+r+"px))":"middle"===e?"translate(calc(-50% + "+n+"px), calc("+r+"px))":"start"===e?"translate(calc("+n+"px), calc(-50% + "+r+"px))":"end"===e?"translate(calc(-100% + "+n+"px), calc(-50% + "+r+"px))":"translate("+n+"px, "+r+"px)"})({anchor:U(t),index:t.index,translateX:p,translateY:h-(m||0)*t.index})).style("left",t=>r(t)[0]-("start"===U(t)?-(u||g):u||g)+"px").style("top",t=>r(t)[1]+"px").style("text-align",U)}})({arc:at,enableRadialLabels:v,global:J,radius:_,node:t,dataReady:tt,translateX:(O-(D-I))/2,translateY:(q+(R-P))/2,radialLabelsLinkHorizontalLength:L,radialLabelsTextXOffset:S,formatRadialLabel:k,radialLabelYOffset:M,radialAngleXOffset:B}),(N||E)&&(t=>{let{fullChartTooltip:e,global:a,tooltipRoot:n,data:i,tooltipClassName:s,tooltipBind:c,renderTooltip:d,arc:u,allSlices:p,tooltipStyle:h,width:m,height:b,radius:f}=t;const g=n||document.querySelector("body"),C=l.format(","),x=l.select(g).select("."+W.pieTooltipContainer),y=x.empty()?l.select(g).append("div").attr("class",W.pieTooltipContainer+" "+(s||"")).style("position","absolute").style("opacity","0"):x;h&&Object.entries(h).forEach(t=>{let[e,a]=t;return y.style(e,a)}),y.html("");let v=!1;const T=t=>{v=Boolean(t),y.style("opacity",v?"1":"0")},L=(t,n)=>{let[r,o]=l.pointer(t,document);if(!c&&e){const[e,a]=l.pointer(t,t.target);r-=e,o-=a}else if(!c){const t=a.node(),{x:e,y:l,width:i,height:s}=t?t.getBoundingClientRect():{x:0,y:0,width:0,height:0},[c,d]=u.centroid(n);r=e+i/2+c,o=l+s/2+d}y.style("left",r+"px").style("top",o+"px")},S=(t,e)=>{T(!0),L(t,e);const a=e?[e.data]:i;y.html(()=>o.renderToString(r.createElement(st,{className:W.pieTooltipFlex},r.createElement(ut,{className:W.pieTooltip},d?d(a):r.createElement(r.Fragment,null,a.map((t,e)=>{let{color:a,name:n,value:l}=t;return r.createElement(ht,{key:n+"-"+e,className:W.pieTooltipItem},a&&r.createElement(bt,{className:W.pieTooltipColorBox,style:{backgroundColor:a}}),n&&r.createElement(gt,{className:W.pieTooltipName},n),r.createElement(Ct,{className:W.pieTooltipValue},C(l)))}))))))};e?(a.on("mouseover.fulltooltip",t=>S(t)),a.on("mouseout.fulltooltip",()=>{y.html(""),T()}),m&&b&&a.append("circle").attr("class",W.pieFullChartTooltipCircle).attr("r",f).attr("cx",0).attr("cy",0),c||a.on("touchmove.tooltipBind mousemove.tooltipBind",t=>L(t))):(p.on("mouseover.slice",S),c||p.on("touchmove.slice mousemove.slice",L),p.on("mouseout.slice",()=>{y.html(""),T()}))})({fullChartTooltip:E,global:J,data:a,tooltipClassName:G,tooltipBind:z,renderTooltip:Y,allSlices:rt,arc:at,tooltipStyle:X,width:O,height:q,radius:_}),A){const t=o.renderToString(A);H.append("g").html(t)}}},Lt=t=>{const{className:e,style:a,children:l}=t,[o,i]=h();return n.useEffect(()=>{i&&Tt(i,t)},[i,t]),m(t.width,()=>Tt(i,t)),r.createElement("div",{className:e,style:a},r.createElement(q,{ref:o},l))};Lt.defaultProps={data:[],startAngle:0,endAngle:360,slicesLabelsSkipAngle:0,radialLabelYOffset:16,radialAngleXOffset:8};const St={legendContainer:"d3-legend-container",legendTitle:"d3-legend-title",legendTick:"d3-legend-tick",legendTickLine:"d3-legend-tick-line",legendTickText:"d3-legend-tick-text"};function kt(t,e){void 0===e&&(e=256);const a=document.createElement("canvas");a.width=e,a.height=1;const n=a.getContext("2d");for(let a=0;a<e;++a)n.fillStyle=t(a/(e-1)),n.fillRect(a,0,1,1);return a}const Mt={tickSize:6,height:44,width:320,marginTop:18,marginBottom:16,ticksDivier:64,titleMarginBottom:6};function At(){const t=d(["\n ."," {\n display: flex;\n margin-bottom: 16px;\n }\n ."," {\n display: inline-flex;\n align-items: flex-end;\n height: ",";\n margin-bottom: 4px;\n font-weight: bold;\n }\n ."," {\n height: ",";\n margin-bottom: 4px;\n position: relative;\n display: flex;\n }\n ."," {\n font-size: 14px;\n bottom: 0;\n position: absolute;\n }\n ."," {\n display: flex;\n flex-direction: column;\n margin-right: 10px;\n }\n ."," {\n font-size: 12px;\n display: inline-flex;\n align-items: center;\n justify-content: flex-end;\n }\n ."," {\n position: relative;\n }\n ."," {\n position: absolute;\n }\n"]);return At=function(){return t},t}const wt=s({calendarChart:"calendarChart",calendarYear:"calendarYear",calendarAxis:"calendarAxis",calendarBody:"calendarBody",calendarHeader:"calendarHeader",calendarYearTitle:"calendarYearTitle",calendarWeekDay:"calendarWeekDay",calendarMonth:"calendarMonth",calendarDays:"calendarDays",calendarDay:"calendarDay"},St),Bt=a(p)(At(),wt.calendarYear,wt.calendarYearTitle,"20px",wt.calendarHeader,"20px",wt.calendarMonth,wt.calendarAxis,wt.calendarWeekDay,wt.calendarDays,wt.calendarDay),Nt=t=>{const{className:e,style:a,children:o,data:i,startSunday:c,weekdays:d,cellOffset:u,cellSize:p,interpolator:m,monthSpacing:b,colorRange:f,legendProps:g}=t,[C,x]=h();return n.useEffect(()=>{x&&((t,e)=>{const{data:a,startSunday:n,weekdays:r,interpolator:o,monthSpacing:i,onEachDay:c,colorRange:d,legendProps:u}=e;if(null!==t&&a.length){const p=l.group(a,t=>t.date.getUTCFullYear()),h="number"==typeof e.cellOffset?e.cellOffset:0,m=7,b=18,f=e.cellSize||b,g=t=>n?t:(t+(m-1))%m,C=r||["вс","пн","вт","ср","чт","пт","сб"],x=6,y=t=>n?C[t]:t===x?C[0]:C[t+1],v=l.utcFormat("%x"),T=n?l.utcSunday:l.utcMonday,L=(t,e)=>T.count(l.utcYear(t),e),S=t=>t.getUTCMonth()*(i||0),k=l.utcFormat("%b"),M=l.max(a.map(t=>{let{value:e}=t;return e})),A=l.min(a.map(t=>{let{value:e}=t;return e})),w=d?l.scaleLinear().domain([A,M]).range(d):l.scaleSequential(o||l.interpolateGreens).domain([A,+M]);let B=0;p.forEach((t,e)=>{const a=new Date(e,1),n=l.max(t.map(t=>t.date)),r=n.getUTCMonth()-a.getUTCMonth(),o=L(a,n)+1;B=Math.max(B,o*(f+h)+(i||0)*r)}),l.select(t).select("."+wt.calendarChart).remove();const N=l.select(t).append("div").attr("class",wt.calendarChart),E=N.selectAll("div").data(p).join("div").attr("class",wt.calendarYear),G=E.append("div").attr("class",wt.calendarAxis);G.append("div").attr("class",wt.calendarYearTitle).text(t=>{let[e]=t;return e}),G.selectAll("span").data(l.range(m)).join("div").attr("class",wt.calendarWeekDay).style("height",f+"px").style("margin-bottom",h+"px").text(y);const z=E.append("div").attr("class",wt.calendarBody);if(z.append("div").attr("class",wt.calendarHeader).selectAll("div").data(t=>{let[e,a]=t;return l.utcMonths(l.utcMonth(new Date(a[0].date.getUTCFullYear(),1,1)),l.utcMonth(new Date(a[0].date.getUTCFullYear(),12,31)))}).join("div").attr("class",wt.calendarMonth).style("left",t=>L(t,T.ceil(t))*(f+h)+S(t)+"px").text(k),z.append("div").attr("class",wt.calendarDays).style("height",(f+h)*m+"px").style("width",B+"px").selectAll("div").data(t=>{let[,e]=t;return e}).join("div").each((t,e,a)=>{if(c){const n=a[e],r=w(t.value);c(t,n,r)}}).attr("class",wt.calendarDay).style("width",f+"px").style("height",f+"px").style("left",t=>L(t.date,t.date)*(f+h)+S(t.date)+"px").style("top",t=>g(t.date.getUTCDay())*(f+h)+"px").style("background-color",t=>w(t.value)).attr("title",t=>v(t.date)+" - "+t.value),"object"==typeof u){const t=(t=>{let{color:e,title:a,tickSize:n=Mt.tickSize,width:r=Mt.width,height:o=Mt.height+n,marginTop:i=Mt.marginTop,marginRight:s=0,marginBottom:c=Mt.marginBottom+n,marginLeft:d=0,ticks:u=Mt.width/Mt.ticksDivier,tickFormat:p,tickValues:h,titleMarginBottom:m}=t;const b=l.create("svg").attr("width",r).attr("height",o).attr("viewBox",[0,0,r,o]).style("overflow","visible").style("display","block");let f;if(e.interpolate){const t=Math.min(e.domain().length,e.range().length);f=e.copy().rangeRound(l.quantize(l.interpolate(d,r-s),t)),b.append("image").attr("x",d).attr("y",i).attr("class",St.legendContainer).attr("width",r-d-s).attr("height",o-i-c).attr("preserveAspectRatio","none").attr("xlink:href",kt(e.copy().domain(l.quantize(l.interpolate(0,1),t))).toDataURL())}else if(e.interpolator&&(f=Object.assign(e.copy().interpolator(l.interpolateRound(d,r-s)),{range:()=>[d,r-s]}),b.append("image").attr("x",d).attr("y",i).attr("width",r-d-s).attr("height",o-i-c).attr("preserveAspectRatio","none").attr("xlink:href",kt(e.interpolator()).toDataURL()),!f.ticks)){if(void 0===h){const t=Math.round(u+1);h=l.range(t).map(a=>l.quantile(e.domain(),a/(t-1)))}"function"!=typeof p&&(p=l.format(void 0===p?",f":p))}return b.append("g").attr("transform","translate(0,"+(o-c)+")").call(l.axisBottom(f).ticks(u,"string"==typeof p?p:void 0).tickFormat("function"==typeof p?p:void 0).tickSize(n).tickValues(h)).call(t=>{const e=t.selectAll(".tick");return e.selectAll(".tick line").attr("y1",i+c-o).attr("class",St.legendTickLine),e.selectAll(".tick text").attr("class",St.legendTickText),e.attr("class",St.legendTick),e}).call(t=>t.select(".domain").remove()).call(t=>t.append("text").attr("x",d).attr("class",St.legendTitle).attr("y",i+c-o-(m||Mt.titleMarginBottom)).attr("fill","currentColor").attr("text-anchor","start").attr("font-weight","bold").text(a)),b})(s({color:w},u)),e=N.node(),a=t.node();e.appendChild(a)}}})(x,t)},[x,i,c,d,u,p,m,b,f,g]),r.createElement(Bt,{ref:C,className:e,style:a},o)};function Et(t){let e;const a=t.node();return e=a instanceof SVGGraphicsElement?a.getBBox():a.getBoundingClientRect(),e}function Gt(){}function zt(t){return null==t||Number.isNaN(t)}function Yt(){const t=d(["\n ."," {\n transition: opacity linear 200ms;\n z-index: 1;\n ."," {\n justify-content: flex-start;\n align-items: center;\n pointer-events: none;\n }\n ."," {\n margin: 0 0 0 10px;\n }\n }\n"]);return Yt=function(){return t},t}function Xt(){const t=d(["\n .",",\n .",",\n ."," {\n shape-rendering: crispEdges;\n }\n ."," {\n fill: none;\n stroke: steelblue;\n stroke-width: 1.5px;\n stroke-linejoin: round;\n stroke-linecap: round;\n }\n ."," {\n fill-opacity: 0.24;\n }\n .",",\n .",",\n ."," {\n stroke: rgba(149, 149, 149, 0.24);\n }\n .",",\n ."," {\n transition: opacity linear 200ms;\n pointer-events: none;\n stroke-width: 1px;\n }\n ."," {\n stroke: #fff;\n stroke-width: 2px;\n }\n ."," {\n shape-rendering: crispEdges;\n }\n ."," {\n fill: none;\n pointer-events: all;\n }\n"]);return Xt=function(){return t},t}Nt.defaultProps={data:[]};const Rt={lineChartYScaleGlobal:"lineChartYScaleGlobal",lineChartXScaleGlobal:"lineChartXScaleGlobal",lineChartLinesGlobal:"lineChartLinesGlobal",lineChartLine:"lineChartLine",lineChartAreasGlobal:"lineChartAreasGlobal",lineChartArea:"lineChartArea",lineChartDotsGlobalContainer:"lineChartDotsGlobalContainer",lineChartDotsGlobal:"lineChartDotsGlobal",lineChartDot:"lineChartDot",lineChartGridGlobal:"lineChartGridGlobal",lineChartGridLineX:"lineChartGridLineX",lineChartGridLineY:"lineChartGridLineY",lineChartLabelContainer:"lineChartLabelContainer",lineChartLabelFlex:"lineChartLabelFlex",lineChartLabel:"lineChartLabel",lineChartMouseGlobal:"lineChartMouseGlobal",lineChartMouseLine:"lineChartMouseLine",lineChartMouseRect:"lineChartMouseRect",lineChartMouseCircle:"lineChartMouseCircle",lineChartMouseLabelContainer:"lineChartMouseLabelContainer",lineChartMouseLabel:"lineChartMouseLabel"},It=a(p)(Xt(),Rt.lineChartYScaleGlobal,Rt.lineChartXScaleGlobal,Rt.lineChartGridGlobal,Rt.lineChartLinesGlobal,Rt.lineChartArea,Rt.lineChartGridLineX,Rt.lineChartGridLineY,Rt.lineChartMouseLine,Rt.lineChartMouseLine,Rt.lineChartMouseCircle,Rt.lineChartDot,Rt.lineChartMouseLine,Rt.lineChartMouseRect),Pt=e.createGlobalStyle(Yt(),Rt.lineChartMouseLabel,Rt.lineChartLabelFlex,Rt.lineChartLabel);function Dt(){const t=d(["\n margin-bottom: 4px;\n"]);return Dt=function(){return t},t}function Ft(){const t=d(["\n width: 0;\n height: 0;\n display: flex;\n align-items: flex-end;\n justify-content: center;\n font-size: 12px;\n white-space: nowrap;\n"]);return Ft=function(){return t},t}const Ot=a.div(Ft()),Vt=a.div(Dt()),jt=(t,e)=>{const{data:a,labels:n,margin:i,customYAxisSelection:d,customXAxisSelection:u,customYAxis:p,customXAxis:h,curve:m,yAxisPadding:f,xAxisPadding:g,drawGridY:C,drawGridX:x,withLabels:y,formatLabel:v,eachLabel:T,stacked:L,dynamicTooltipEnable:S,dynamicCircleRadius:k,formatDynamicTooltip:M,renderTooltip:A,stackedTooltip:w,stackedTooltipIndex:B,tooltipLineTop:N,customize:E,customYScale:G,customLine:z,tooltipClassName:Y,xScaleItemWidth:X,areaCurve:R}=e;if(null!==t&&a.length){const I=L?(t=>{const e={};return t.map((t,a)=>(e[a]={},a>0?s({},t,{values:t.values.map((t,n)=>{const r=e[a-1][n];return e[a][n]=Number(("number"!=typeof r?0:Math.abs(r))+("number"!=typeof t?0:Math.abs(t))),e[a][n]})}):(t.values.forEach((t,n)=>{e[a][n]=Number(t)}),t)))})(a):a,P=i?i.top:0,D=i?i.right:0,F=i?i.bottom:0,O=i?i.left:0,{width:V}=t.getBoundingClientRect(),j=e.width||V,W=e.height||0,q="number"==typeof e.min?e.min:l.min(I,t=>{let{values:e}=t;return l.min(e)}),Z="number"==typeof e.max?e.max:l.max(I,t=>{let{values:e}=t;return l.max(e)}),U=b(t,j,W||0),_=l.scaleLinear().domain([q||0,Z||0]).range([W-P-F-(g||0),P]).nice();G&&G(_);const H=8,J=l.axisLeft(_).ticks(H);p&&p(J);const K=J.tickArguments()[0],Q=U.append("g").attr("class",Rt.lineChartYScaleGlobal).call(J).call(d||Gt),{width:$}=Et(Q);Q.attr("transform","translate("+(O+$)+", 0)");const tt=n&&n.length?n.length-1:I.reduce((t,e)=>{let{values:a}=e;return Math.max(t,a.length)},0)-1,et=l.scaleLinear().domain([0,tt]).range([O+$+(f||0),j-D]),at=l.axisBottom(et).tickFormat(t=>n&&n.length>0?n[t]:0).ticks(tt);if("number"==typeof X){const[t,e]=et.range();at.ticks(Math.round((e-t)/X)).tickSizeOuter(0)}if(h&&h(at),(t=>{let{svg:e,yScale:a,xScale:n,yTicksCount:r,lastIndex:l,drawGridX:o,drawGridY:i}=t;if(!i&&!o)return;const s=e.append("g").attr("class",Rt.lineChartGridGlobal),c=a.ticks(r);o&&s.append("g").selectAll("line").data(c).join("line").attr("class",Rt.lineChartGridLineX).attr("x1",()=>n(0)).attr("x2",()=>n(l)).attr("y1",t=>Math.round(a(t))).attr("y2",t=>Math.round(a(t))),i&&s.append("g").selectAll("line").data(Array.from({length:l+1},(t,e)=>e)).join("line").attr("class",Rt.lineChartGridLineY).attr("x1",(t,e)=>Math.round(n(e))).attr("x2",(t,e)=>Math.round(n(e))).attr("y1",()=>Math.round(a(c[0]))).attr("y2",()=>Math.round(a(c[c.length-1])))})({svg:U,yScale:_,xScale:et,yTicksCount:K,lastIndex:tt,drawGridY:C,drawGridX:x}),Array.isArray(n)&&n.length>0){const t=U.append("g").call(u||Gt).attr("class",Rt.lineChartXScaleGlobal).call(at),{height:e}=Et(t);t.attr("transform","translate(0, "+(W-Math.ceil(e)-F)+")")}const nt=l.line().defined(t=>null!==t).x((t,e)=>et(e)).y(t=>_(t)).curve(m||l.curveLinear);if(z&&z(nt),I.some(t=>{let{fill:e}=t;return e})){let t=-2;const e=e=>{const{minAreaValues:a}=e,n=_.ticks()[0];return l.area().defined(t=>null!==t).x((t,e)=>et(e)).y0((e,r)=>{0===r&&(t+=1);let l=n;a&&"number"==typeof a[r]?l=a[r]||l:a&&(l=_(l-e));const o=I[t];return _(L&&t>-1?"number"!=typeof o.values[r]?0:o.values[r]:l)}).y1(t=>_(t)).curve(R||m||l.curveLinear)};U.append("g").attr("class",Rt.lineChartAreasGlobal).selectAll("path").data(I.filter(t=>{let{fill:e}=t;return Boolean(e)})).join("path").attr("class",Rt.lineChartArea).attr("d",t=>e(t)(t.values)).attr("fill",t=>{let{fill:e}=t;return e||"none"}).attr("style",t=>{let{areaStyle:e}=t;return e||""})}U.append("g").attr("class",Rt.lineChartLinesGlobal).selectAll("path").data(I).join("path").attr("class",Rt.lineChartLine).attr("d",t=>nt(t.values)).attr("stroke",t=>{let{stroke:e}=t;return e||"steelblue"}).attr("style",t=>{let{style:e}=t;return e||""});const rt=I.filter(t=>{let{dot:e}=t;return e});if(rt.length>0){const t=U.append("g").attr("class",Rt.lineChartDotsGlobalContainer);rt.forEach(e=>{const{values:a,dot:n}=e,{radius:r,style:l,filter:o}=n,i=t.append("g").attr("class",Rt.lineChartDotsGlobal);i.selectAll("circle").data(a).join("circle").attr("cx",(t,e)=>et(e)).attr("class",Rt.lineChartDot).attr("cy",t=>_(t)).attr("r",r||0).attr("style",l||""),o&&i.selectAll("circle").select((t,a,n)=>o(e,a,n)?n[a]:null).remove()})}l.select(t).select(".d3-chart-label").remove(),y&&(t=>{let{node:e,data:a,yScale:n,xScale:i,formatLabel:s,eachLabel:c}=t;const d=l.select(e).append("div").attr("class","d3-chart-label"),u=l.format(",");a.forEach(t=>{let{values:e}=t;d.append("div").selectAll("div").data(e).join("div").attr("class",Rt.lineChartLabelContainer).style("position","absolute").style("left",(t,e)=>i(e)+"px").style("top",t=>n(t)+"px").html((t,e,a)=>o.renderToString(r.createElement(Ot,{className:Rt.lineChartLabelFlex},r.createElement(Vt,{className:Rt.lineChartLabel},s?s(t,e,a):u(t))))).each(c||Gt)})})({node:t,eachLabel:T,data:I,yScale:_,xScale:et,formatLabel:v}),S&&(t=>{let{svg:e,node:a,data:n,xScale:i,yScale:d,dynamicCircleRadius:u,formatDynamicTooltip:p,renderTooltip:h,stackedTooltipIndex:m,stackedTooltip:b,tooltipLineTop:f,tooltipRoot:g,tooltipClassName:C}=t;const x=g||document.querySelector("body"),y=l.format(","),v=n.filter(t=>{let{tooltipOff:e}=t;return!e}),T="number"==typeof m?[v[m]]:b?[v[0]]:v,[L,S]=i.range(),[k,M]=d.range(),A=e.append("g").attr("class",Rt.lineChartMouseGlobal),w=A.append("rect").attr("width",S-L).attr("height",Math.abs(k-M)).attr("class",Rt.lineChartMouseRect).attr("transform","translate("+L+", "+M+")"),B=A.append("path").attr("class",Rt.lineChartMouseLine).style("opacity","0"),N=e.selectAll("."+Rt.lineChartLine).nodes(),E=A.selectAll("circle").data(v.filter(t=>{let{dynamicDotOff:e}=t;return!e})).join("circle").attr("class",Rt.lineChartMouseCircle).attr("r",u).attr("fill",t=>{let{stroke:e}=t;return e||"none"}).attr("stroke",t=>{let{stroke:e}=t;return e||"none"}).style("opacity","0");let G=l.select("."+Rt.lineChartMouseLabelContainer);0===G.size()&&(G=l.select(x).append("div").attr("class",Rt.lineChartMouseLabelContainer));let z=null,Y=!1;const X=t=>{Y=Boolean(t);const e=Y?"1":"0";B.style("opacity",e),E.style("opacity",e),z&&z.style("opacity",e)},R=t=>{const[u,g]=l.pointer(t,document),[C]=l.pointer(t,w),[x,T]=l.pointer(t,a),L=C-(C-x),S=x+(u-x),A=Math.abs(i.invert(L)),G={},R=t=>zt(t[Math.floor(A+1)])?null:t[Math.floor(A)];N.forEach((t,e)=>{let a={x:0,y:0};if(!t.hasAttribute("d")||n[e].tooltipOff)return void(G[e]=a);let r=0,l=t.getTotalLength(),o=null;for(;o=Math.floor((r+l)/2),a=t.getPointAtLength(o),o!==l&&o!==r||a.x===L;)if(a.x>L)l=o;else{if(!(a.x<L))break;r=o}G[e]=a}),E.attr("transform",(t,e)=>{const a=R(t.values);return G[e]&&a?"translate("+L+","+G[e].y+")":"translate(-9999, -9999)"}).attr("style",t=>{let{dynamicDotStyle:e}=t;return e||""});const I=v.map((t,e)=>{let{values:a}=t;return s({},c(t,["values"]),{value:R(a),invertValue:G[e]?d.invert(G[e].y):0})}),P=I.every(t=>{let{value:e}=t;return zt(e)});P&&Y?X():Y||P||X(!0);const D=Object.keys(G).reduce((t,e,a)=>{var r,l;const o=null==(r=I[Number(t)])?void 0:r.value,i=null==(l=I[Number(e)])?void 0:l.value,s=null==n?void 0:n[a].dynamicDotOff;return 0===a||zt(i)||s?t:zt(o)||G[t].y>G[e].y?e:t},"0"),F=z&&z.style("left",S+"px").style("top",(t,e)=>{const a="number"==typeof m?m:b?D:e;return(G[a]&&G[a].y+(g-T))+"px"}).select("."+Rt.lineChartLabel);h&&z?z.html((a,n)=>o.renderToString(r.createElement(Ot,{className:Rt.lineChartLabelFlex},h(I,{indexX:Math.round(A),indexY:n,svg:e,event:t})))):F&&F.text((t,e)=>{const a=I[e].invertValue;return p?p(a,I[e].value):y(a)}),B.attr("d",()=>{var t;let e="M"+L+","+k;return e+=" "+L+","+(f?M:(null==(t=G[D])?void 0:t.y)||0),e})};w.on("mouseover.tooltip",t=>{z=G.selectAll("div").data(T).join("div").attr("class",Rt.lineChartMouseLabel+" "+(C||"")).style("opacity","0").style("position","absolute").html(()=>o.renderToString(r.createElement(Ot,{className:Rt.lineChartLabelFlex},r.createElement(Vt,{className:Rt.lineChartLabel})))),R(t)}),w.on("mouseout.tooltip",()=>{l.select("."+Rt.lineChartMouseLabelContainer).selectAll("*").remove(),X()}),w.on("touchmove.tooltip mousemove.tooltip",R)})({tooltipLineTop:N,stackedTooltip:w,renderTooltip:A,stackedTooltipIndex:B,formatDynamicTooltip:M,node:t,svg:U,data:I,xScale:et,yScale:_,dynamicCircleRadius:k,tooltipClassName:Y}),E&&E({svg:U,yScale:_,xScale:et})}},Wt=t=>{const{className:e,style:a,children:l}=t,[o,i]=h();return n.useEffect(()=>{i&&jt(i,t)},[i,t]),m(t.width,()=>jt(i,t)),r.createElement("div",{className:e,style:a},r.createElement(Pt,null),r.createElement(It,{ref:o},l))};Wt.defaultProps={data:[],labels:[],height:240,yAxisPadding:10,xAxisPadding:20,margin:{top:10,right:10,bottom:10,left:0},dynamicCircleRadius:4,stackedTooltip:!1};const qt={barChartLinesGlobal:"barChartLinesGlobal",barChartLine:"barChartLine",barChartAreasGlobal:"barChartAreasGlobal",barChartArea:"barChartArea"};function Zt(){const t=d(["\n line {\n stroke-width: 1px;\n shape-rendering: crispEdges;\n }\n .",",\n ."," {\n stroke: rgba(48, 69, 79, 0.06);\n }\n ."," {\n }\n ."," {\n fill: none;\n pointer-events: all;\n }\n ."," {\n z-index: 1;\n }\n ."," {\n stroke-width: 1.5px;\n stroke-linejoin: round;\n stroke-linecap: round;\n }\n ."," {\n shape-rendering: auto;\n }\n ."," {\n fill-opacity: 0.24;\n }\n ."," {\n margin-bottom: 4px;\n :last-of-type {\n margin-bottom: 0;\n }\n }\n"]);return Zt=function(){return t},t}const Ut=s({barChartBarGlobal:"barChartBarGlobal",barChartYScaleGlobal:"barChartYScaleGlobal",barChartYAxis:"barChartYAxis",barChartXAxis:"barChartXAxis",barChartYAxisZeroTick:"barChartYAxisZeroTick",barChartGridGlobal:"barChartGridGlobal",barChartGridLineX:"barChartGridLineX",barChartGridLineXZero:"barChartGridLineXZero",barChartGridLineYZero:"barChartGridLineYZero",barChartGridLineY:"barChartGridLineY"},{barChartMouseRect:"barChartMouseRect",barChartMouseContainer:"barChartMouseContainer",barChartTooltipFlex:"barChartTooltipFlex",barChartMouseTooltip:"barChartMouseTooltip",barChartTooltip:"barChartTooltip",barChartTooltipItem:"barChartTooltipItem",barChartTooltipColFlex:"barChartTooltipColFlex",barChartTooltipGroupName:"barChartTooltipGroupName",barChartColorBox:"barChartColorBox",barChartColorLine:"barChartColorLine",barChartTooltipName:"barChartTooltipName",barChartTooltipValue:"barChartTooltipValue"},{barChartLabelContainer:"barChartLabelContainer",barChartLabelFlex:"barChartLabelFlex",barChartLabel:"barChartLabel"},qt),_t=a(p)(Zt(),Ut.barChartGridLineX,Ut.barChartGridLineY,Ut.barChartMouseRect,Ut.barChartMouseRect,Ut.barChartMouseTooltip,Ut.barChartLinesGlobal,Ut.barChartLine,Ut.barChartArea,Ut.barChartTooltipItem),Ht=(t,e)=>{const{data:a,lineData:n=[],barWidth:i,barPadding:d,colors:u,margin:p,xAxisPadding:h,yAxisPadding:m,drawGridY:f,drawGridX:g,customYScale:C,customXScale:x,customYAxisLeft:y,customXAxisBottom:v,customYAxis:T,customXAxis:L,customBars:S,customize:k,dynamicTooltipEnable:M,renderTooltip:A,labelPosition:w,renderLabel:B,tooltipY:N,tooltipBind:E,stackedLine:G,curve:z,formatTooltipValue:Y,formatTooltipName:X,sectionPadding:R,minValuesLine:I,tooltipYDomain:P,marshalledMap:D,minValue:F,maxValue:O,minDomainValue:V,maxDomainValue:j,drawBars:W,setTooltipPosition:q,onLabelItem:Z,isBarTooltip:U,xScaleItemWidth:_}=e;if(null!==t&&a.length){const H=p?p.top:0,J=p?p.right:0,K=p?p.bottom:0,Q=p?p.left:0,$=12,{width:tt}=t.getBoundingClientRect(),et=e.width||tt,at=e.height||0,nt=(t=>{let{data:e,minDomainValue:a,maxDomainValue:n}=t,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;return e.forEach(t=>{let e=c(t,["groupName"]),a=0,n=0;Object.keys(e).forEach(t=>{const r=e[t];let l=0,o=0;Object.keys(r).forEach(t=>{const e=r[t];e>0?l+=e:o+=e}),a=Math.min(a,o),n=Math.max(n,l)}),r=Math.min(r,a),l=Math.max(l,n)}),0===r&&0===l?{min:"number"==typeof a?a:0,max:"number"==typeof n?n:1}:{min:"number"==typeof a?a:r,max:"number"==typeof n?n:l}})({data:a,minDomainValue:V,maxDomainValue:j}),rt="number"==typeof F?F:Math.min(l.min(n,t=>{let{values:e}=t;return l.min(e)})||Number.POSITIVE_INFINITY,nt.min||0),lt="number"==typeof O?O:Math.max(l.max(n,t=>{let{values:e}=t;return l.max(e)})||Number.NEGATIVE_INFINITY,nt.max),ot=b(t,et,at||0),it=6,Tt=a.map(t=>t.groupName);let Lt=i||$;const St=l.scaleLinear().domain([rt,lt]).range([at-H-K-(h||0),H]).nice();C&&C(St);const kt=St.ticks(),Mt=l.axisLeft(St).ticks(it);y&&y(Mt);const At=Mt.tickArguments()[0],wt=ot.append("g").attr("class",Ut.barChartYAxis).call(Mt);wt.selectAll(".tick").attr("class",t=>0===t?"tick "+Ut.barChartYAxisZeroTick:"tick"),T&&T(wt);const{width:Bt}=Et(wt),Nt=[Q+Bt+(m||0),et-J],Gt=l.scaleBand().domain(l.range(a.length)).range(Nt);Lt=(t=>{let{data:e,range:a,barWidth:n,barPadding:r,sectionPadding:l}=t;const o="number"==typeof l?l:0,i=a[1]-a[0],s=e.reduce((t,e)=>{let a=c(e,["groupName"]);return t+Object.keys(a).reduce((t,e,a)=>a>0?t+(n||0)+(r||0):t+n,0)+o},o);return i<s?Math.floor(n*(i/s)):n})({data:a,sectionPadding:R,range:Nt,barWidth:Lt,barPadding:d}),x&&x(Gt);const[zt,Yt]=Gt.range(),Xt=l.axisBottom(Gt).tickFormat(t=>Tt[Number(t)]);"number"==typeof _&&Xt.tickValues(Gt.domain().filter((t,e,a)=>{const n=Math.round((Yt-zt)/_);return!(e%Math.round(a.length/n))})).tickSizeOuter(0),v&&v(Xt,{node:t,labels:Tt});const Rt=ot.append("g").call(Xt).attr("class",Ut.barChartXAxis);L&&L(Rt);const It=(t=>{let{data:e,yScale:a,xScale:n,barWidth:r,barPadding:l,colors:o,marginTop:i}=t;return e.map((t,e)=>{let{groupName:s}=t,d=c(t,["groupName"]);const u=[],p=n.bandwidth(),h=Object.keys(d);return h.forEach((t,n)=>{const c=d[t],m=Object.keys(c),b=(r+l)*h.length-(m.length>1?l:0);let f=0,g=0;m.forEach(t=>{const d=c[t],h=o[t],m=(r+l)*n+p/2-b/2,C=d>0,x=C?Math.abs(100*(a(f-d)-a(f)+Number.EPSILON)/100):Math.abs(100*(a(g-d)-a(g)+Number.EPSILON)/100);C&&(f+=d);const y=C?100*(a(f)+Number.EPSILON)/100:a(g)-a(0)+a(0);u.push({x:m,y:y+(i||0),height:x,color:h,value:d,groupName:s,name:t,stackIndex:n,groupIndex:e}),C||(g+=d)})}),u})})({data:a,yScale:St,xScale:Gt,barWidth:Lt,barPadding:"number"==typeof d?d:0,colors:u,marginTop:H}),Pt=D?D(It):It;wt.attr("transform","translate( "+(Q+Bt)+", 0)"),(t=>{let{svg:e,yScale:a,xScale:n,yTicksCount:r,drawGridX:l,drawGridY:o}=t;if(!o&&!l)return;const i=e.append("g").attr("class",Ut.barChartGridGlobal),s=a.ticks(r),c=n.range(),d=n.domain();if(l&&i.append("g").selectAll("line").data(s).join("line").attr("class",t=>0===t?Ut.barChartGridLineX+" "+Ut.barChartGridLineXZero:Ut.barChartGridLineX).attr("x1",()=>c[0]).attr("x2",()=>c[1]).attr("y1",t=>Math.round(a(t))).attr("y2",t=>Math.round(a(t))),o){const t=t=>void 0!==d[t]?0===t?c[0]:Math.round(n.step()*t+c[0]-n.step()/2*n.padding()):c[1];i.append("g").selectAll("line").data(Array.from({length:d.length+1},(t,e)=>e)).join("line").attr("class",t=>0===t?Ut.barChartGridLineY+" "+Ut.barChartGridLineYZero:Ut.barChartGridLineY).attr("x1",t).attr("x2",t).attr("y1",()=>Math.round(a(s[0]))).attr("y2",()=>Math.round(a(s[s.length-1])))}})({svg:ot,yScale:St,xScale:Gt,yTicksCount:At,drawGridY:f,drawGridX:g}),Rt.attr("transform","translate(0, "+(St(kt[0])+(h||0))+")");const Dt=ot.append("g").attr("class",Ut.barChartBarGlobal).selectAll("g").data(Pt).enter().append("g").attr("transform",(t,e)=>"translate("+Math.round(Gt(e.toString()))+","+-(H||0)+")"),Ft=W?W({groups:Dt,yScale:St,marshalledData:Pt,barWidth:Lt}):(t=>{let{groups:e,barWidth:a}=t;return e.selectAll("rect").data(t=>t).join("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",a).attr("height",t=>t.height).style("fill",t=>t.color)})({groups:Dt,barWidth:Lt});let Ot=null;Array.isArray(n)&&n.length>0&&(Ot=(t=>{let{svg:e,lineData:a,min:n,yScale:r,xScale:o,curve:i,stackedLine:s}=t,c=null,d=null,u=null;const p=l.line().defined(t=>null!==t).x((t,e)=>o(e.toString())+h/2).y(t=>r(t)).curve(i||l.curveLinear),h=o.bandwidth(),m=a.filter(t=>{let{lineType:e}=t;return"line"===e}),b=a.filter(t=>{let{lineType:e}=t;return"area"===e});if(m.length>0&&(c=e.append("g").attr("class",qt.barChartLinesGlobal).selectAll("path").data(m).join("path").attr("class",qt.barChartLine).attr("d",t=>p(t.values)).attr("stroke",t=>{let{stroke:e}=t;return e||""}).attr("fill",t=>{let{fill:e}=t;return e||"none"})),b.length>0){let t=-2;u=l.area().x((t,e)=>o(e.toString())+h/2).y0((e,l)=>(0===l&&(t+=1),r(s&&t>-1?"number"!=typeof a[t].values[l]?0:a[t].values[l]:n))).y1(t=>r(t)).curve(i||l.curveLinear),d=e.append("g").attr("class",qt.barChartAreasGlobal).selectAll("path").data(b).join("path").attr("class",qt.barChartArea).attr("d",t=>u&&u(t.values)).attr("fill",t=>{let{fill:e}=t;return e||"none"})}return{areasSelection:d,linesSelection:c,area:u}})({svg:ot,lineData:n,xScale:Gt,yScale:St,min:"number"==typeof I?I:rt,stackedLine:G,curve:z})),S&&S({bars:Ft,yScale:St,lines:Ot,marshalledData:Pt,lineData:n}),(M||w)&&(t=>{let{svg:e,node:a,data:n,marshalledData:i,xScale:d,yScale:u,renderTooltip:p,labelPosition:h,marginTop:m,renderLabel:b,barWidth:f,barPadding:g,dynamicTooltipEnable:C,tooltipY:x,tooltipBind:y,lineData:v,formatTooltipValue:T,formatTooltipName:L,tooltipYDomain:S,setTooltipPosition:k,onLabelItem:M,isBarTooltip:A,bars:w}=t;l.select(a).select("."+Ut.barChartMouseContainer).remove();const B=d.domain(),[N,E]=d.range(),[G,z]=u.range(),Y=d.bandwidth(),X=l.format(","),R=B.map(t=>{return e=Number(t)+1,void 0!==B[e]?0===e?N:Math.round(d.step()*e+N-d.step()/2*d.padding()):E;var e}),I=S?S({data:i,lineData:v,yScale:u}):i.reduce((t,e,a)=>{const n=l.min(v,t=>{let{values:e}=t;return"number"==typeof e[a]?u((e[a]||0)-z):Number.POSITIVE_INFINITY})||Number.POSITIVE_INFINITY;return t.push(e.reduce((t,e)=>{let{y:a}=e;return Math.min(t,a,n)},Number.POSITIVE_INFINITY)),t},[]),P=e.append("g").attr("class","lineChartMouseGlobal").append("rect").attr("width",E-N).attr("height",Math.abs(G-z)).attr("class",Ut.barChartMouseRect).attr("transform","translate("+N+", "+z+")"),D=l.select(a).append("div").attr("class",Ut.barChartMouseContainer);if(C){const t=D.append("div").attr("class",Ut.barChartMouseTooltip).style("opacity","0").style("position","absolute").html(()=>o.renderToString(r.createElement(st,{className:Ut.barChartTooltipFlex},r.createElement(ut,{className:Ut.barChartTooltip})))),u=t.select("."+Ut.barChartTooltipFlex),h=t.select("."+Ut.barChartTooltip);let m=!1,b=null;const g=e=>{m=Boolean(e),t.style("opacity",m?"1":"0"),m?t.style("transition",null):(b=null,t.style("transition","none"),t.style("top",null),t.style("left",null))};P.on("mouseout.tooltip",()=>g()),P.on("touchmove.tooltip mousemove.tooltip",C=>{const[S]=l.pointer(C,P),[M]=l.pointer(C,a),B=S-(S-M),N=R.findIndex(t=>B<=t);if(A){const t=document.elementsFromPoint(C.clientX,C.clientY),e=l.select(w.nodes()[N]).selectAll("rect").nodes();if(!t.some(t=>e.includes(t)))return m&&g(!1),void P.style("cursor","default");P.style("cursor","pointer")}const E="number"==typeof x?x:I[N]-z,G=y?(d(N.toString())||0)+Y/2:B;if(y&&b===N)return;let D=i[N];if(Array.isArray(D)&&0===D.length)return;if(v){const t=v.map(t=>{let{values:e}=t;return s({},c(t,["values"]),{value:e[N],groupName:n[N]&&n[N].groupName})});Array.isArray(t)&&Array.isArray(D)&&(D=D.concat(t))}const F=e.node().getBoundingClientRect().width;"function"==typeof k?k({left:G,top:E,tooltip:t,svgWidth:F}):k||t.style("left",G+"px").style("top",E+"px"),p?u.html(()=>o.renderToString(r.createElement(r.Fragment,null,p(D,k?{left:G,top:E,tooltip:t,svgWidth:F}:void 0,f)))):(m||g(!0),h.html(()=>o.renderToString(r.createElement(r.Fragment,null,D&&D[0]&&r.createElement(pt,{className:Ut.barChartTooltipGroupName},D[0].groupName),D&&D.map(t=>{let{name:e,value:a,stroke:n,fill:l,color:o,lineType:i}=t;return r.createElement(ht,{key:e,className:Ut.barChartTooltipItem},r.createElement(mt,{className:Ut.barChartTooltipColFlex},i?r.createElement(ft,{className:Ut.barChartColorLine,style:{backgroundColor:n||l}}):r.createElement(bt,{className:Ut.barChartColorBox,style:{backgroundColor:o}}),r.createElement(gt,{className:Ut.barChartTooltipName},L?L(e):e)),r.createElement(Ct,{className:Ut.barChartTooltipValue},T?T(a):X(a)))}))))),b=N,m||g(!0)})}const F=D.append("div").attr("class",Ut.barChartLabelContainer).style("position","absolute").style("top",z+"px");if(h){const t=v?i.map((t,e)=>t.concat(v.map(a=>{let{values:n,name:r,stroke:l}=a;const{stacksCount:o}=t.reduce((t,e)=>{let{stackIndex:a}=e;const{indexFlag:n,stacksCount:r}=t;return a!==n?{indexFlag:a,stacksCount:r+1}:t},{indexFlag:-1,stacksCount:0});return{x:t[0].x-f/2+(f*o+(g||0)*(o-1))/2,y:u(n[e])+m,height:0,color:l,value:n[e],groupName:t[0].groupName,name:r,stackIndex:0,groupIndex:e}}))):i,e=F.selectAll("div").data(t).enter().append("div").style("position","absolute").style("transform",(t,e)=>"translate("+Math.round(d(e.toString()))+"px,"+-(m||0)+"px)"),a="center"===h?dt:ct,n=(t=>{switch(t){case"top":return yt;case"bottom":return vt;default:return xt}})(h);e.selectAll("span").data(t=>M?M(t):t).join("div").style("left",t=>Math.round(t.x+f/2)+"px").style("top",t=>((t,e,a)=>{switch(t){case"center":return a.y+a.height/2-e;case"bottom":return a.y+a.height-e;default:return a.y}})(h,z,t)+"px").style("position","absolute").html(t=>o.renderToString(r.createElement(a,{className:Ut.barChartLabelFlex},b?b(s({},t,{barWidth:f})):r.createElement(n,{className:Ut.barChartLabel},X(t.value)))))}})({svg:ot,node:t,xScale:Gt,yScale:St,marshalledData:Pt,data:a,lineData:n,renderTooltip:A,labelPosition:w,marginTop:H,renderLabel:B,barWidth:Lt,barPadding:d,dynamicTooltipEnable:M,tooltipY:N,tooltipBind:E,formatTooltipValue:Y,formatTooltipName:X,tooltipYDomain:P,setTooltipPosition:q,onLabelItem:Z,isBarTooltip:U,bars:Dt}),k&&k({svg:ot,marshalledData:Pt,yScale:St,xScale:Gt,lineData:n})}},Jt=t=>{const{className:e,style:a,children:l}=t,[o,i]=h();return n.useEffect(()=>{i&&Ht(i,t)},[i,t]),m(t.width,()=>Ht(i,t)),r.createElement("div",{className:e,style:a},r.createElement(_t,{ref:o},l))};function Kt(){const t=d(["\n position: absolute;\n top: 0;\n display: flex;\n justify-content: flex-start;\n height: 100%;\n"]);return Kt=function(){return t},t}function Qt(){const t=d(["\n white-space: nowrap;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(0, -50%);\n"]);return Qt=function(){return t},t}function $t(){const t=d(["\n position: relative;\n"]);return $t=function(){return t},t}function te(){const t=d(["\n position: absolute;\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n will-change: left, top;\n"]);return te=function(){return t},t}function ee(){const t=d(["\n width: 100%;\n position: relative;\n vertical-align: middle;\n"]);return ee=function(){return t},t}function ae(){const t=d(["\n width: 100%;\n display: flex;\n height: 1rem;\n"]);return ae=function(){return t},t}function ne(){const t=d(["\n text-align: right;\n"]);return ne=function(){return t},t}function re(){const t=d(["\n width: 100%;\n"]);return re=function(){return t},t}Jt.defaultProps={data:[],colors:{},margin:{top:10,right:10,bottom:10,left:0},barWidth:12,barPadding:0,height:320,yAxisPadding:0,xAxisPadding:0,tooltipBind:!0,sectionPadding:1};const le={horizontalBarChartButtonTd:"horizontalBarChartButtonTd",horizontalBarChartLabelTd:"horizontalBarChartLabelTd",horizontalBarChartLabelCell:"horizontalBarChartLabelCell",horizontalBarChartBarTd:"horizontalBarChartBarTd",horizontalBarChartBarFlex:"horizontalBarChartBarFlex",horizontalBarChartBar:"horizontalBarChartBar",horizontalBarChartBarFirst:"horizontalBarChartBarFirst",horizontalBarChartBarLast:"horizontalBarChartBarLast",horizontalBarChartBarOnly:"horizontalBarChartBarOnly",horizontalBarChartTooltipFlex:"horizontalBarChartTooltipFlex",horizontalBarChartStackWrapper:"horizontalBarChartStackWrapper",horizontalBarChartTooltipContainer:"horizontalBarChartTooltipContainer",horizontalBarChartStackSumContainer:"horizontalBarChartStackSumContainer",horizontalBarChartStackSum:"horizontalBarChartStackSum",horizontalBarChartXScaleTd:"horizontalBarChartXScaleTd",horizontalBarChartXScaleTicks:"horizontalBarChartXScaleTicks",horizontalBarChartXScaleTick:"horizontalBarChartXScaleTick",horizontalBarChartTooltipItem:"horizontalBarChartTooltipItem",horizontalBarChartTooltipName:"horizontalBarChartTooltipName",horizontalBarChartTooltipValue:"horizontalBarChartTooltipValue"},oe=a.table(re()),ie=a.div(ne()),se=a.div(ae()),ce=a.td(ee()),de=a(st)(te()),ue=a.div($t()),pe=a.div(Qt()),he=a.div(Kt()),me=t=>{let{renderTooltip:e,bars:a,style:n,className:o}=t;const i=l.format(",");return r.createElement(de,{className:le.horizontalBarChartTooltipFlex+" "+(o||""),style:n},r.createElement(ut,{className:le.horizontalBarChartTooltipContainer},e?e(a):a.map((t,e)=>{let{color:a,name:n,value:l,groupName:o}=t;return r.createElement(ht,{key:(n||"")+"-"+e+"-"+o,className:le.horizontalBarChartTooltipItem},a&&r.createElement(bt,{style:{backgroundColor:a}}),n&&r.createElement(gt,{className:le.horizontalBarChartTooltipName},n),r.createElement(Ct,{className:le.horizontalBarChartTooltipValue},i(l)))})))},be=document.createElement("div");function fe(){const t=d(["\n position: relative;\n display: inline-flex;\n height: 100%;\n"]);return fe=function(){return t},t}const ge=a.div(fe()),Ce=t=>{let{withTooltip:e,bar:a,formatNativeTitle:n,tooltipBind:l,mouseMove:o,mouseLeave:i,pointerEventsNone:s,isFirstChild:c,isLastChild:d,isOnlyChild:u}=t;const{color:p,width:h}=a,m=Math.abs(h),b=e?t=>o(t,[a]):void 0,f=e?()=>i():void 0;return r.createElement(ge,{className:le.horizontalBarChartBar+" "+(c?le.horizontalBarChartBarFirst:"")+" "+(d?le.horizontalBarChartBarLast:"")+" "+(u?le.horizontalBarChartBarOnly:""),style:{width:m+"%",backgroundColor:p,pointerEvents:s?"none":"auto"},title:n?n(a):"",onMouseOver:b,onMouseMove:l?b:void 0,onMouseOut:f})};function xe(){const t=d(["\n white-space: nowrap;\n width: 0;\n height: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n"]);return xe=function(){return t},t}function ye(){const t=d(["\n position: relative;\n height: 1rem;\n"]);return ye=function(){return t},t}function ve(){const t=d(["\n position: relative;\n"]);return ve=function(){return t},t}const Te=a.td(ve()),Le=a.div(ye()),Se=a.div(xe()),ke=t=>{let{maxValue:e,scaleTicks:a,renderTicks:o,scaleDomain:i}=t;const s=(t=>{let{maxValue:e,scaleTicks:a,scaleDomain:r}=t;return n.useMemo(()=>{const t=l.scaleLinear().domain([0,e]).range([0,100]),n=t.ticks(a);return(r||n).map(e=>({value:e,x:t(e)}))},[e,a,r])})({maxValue:e,scaleTicks:a,scaleDomain:i}),c=l.format(",");return r.createElement("tr",null,r.createElement("td",null),r.createElement(Te,{className:le.horizontalBarChartXScaleTd},r.createElement(Le,{className:le.horizontalBarChartXScaleTicks},s.map((t,e,a)=>{const{value:n,x:l}=t;return r.createElement(Se,{key:n,className:le.horizontalBarChartXScaleTick,style:{left:l+"%",justifyContent:0===e?"flex-start":e===a.length-1?"flex-end":""}},o?o(t):c(n))}))))},Me=t=>{let{data:e,className:a,style:o,children:d,labels:u,fullExtent:p,maxValue:h,formatNativeTitle:m,renderTooltip:b,withTooltip:f,withStackSum:g,tooltipBind:C,scaleTicks:x,renderTicks:y,renderButton:v,tooltipStyle:T,tooltipClassName:L,scaleDomain:S,renderDataTable:k,thead:M,withoutXScale:A,stackedTooltip:w,fullChartTooltip:B,hideTooltip:N}=t;const{fullMax:E,data:G}=(t=>{let{data:e,fullExtent:a,maxValue:r,labels:o}=t;return n.useMemo(()=>{const t=l.max(e,t=>l.sum(t,t=>{let{value:e}=t;return e})),n=l.scaleLinear().domain([0,"number"==typeof r?r:t]).range([0,100]);return{fullMax:t,data:e.map((t,e)=>(a||n.domain([0,"number"==typeof r?r:l.sum(t,t=>{let{value:e}=t;return e})]),t.map(t=>{let{value:a}=t;return s({},c(t,["value"]),{value:a,width:n(a),groupName:o?o[e]:""})})))}},[e,a,r,o])})({data:e,fullExtent:p,maxValue:h,labels:u}),[z,Y]=(t=>{let{renderTooltip:e,tooltipBind:a,tooltipStyle:o,tooltipRoot:c,tooltipClassName:d,hideTooltip:u}=t;return n.useEffect(()=>{const t=c||document.querySelector("body");return t&&t.appendChild(be),()=>{i.unmountComponentAtNode(be)}},[c]),[n.useCallback((t,n)=>{let[c,u]=l.pointer(t,document);if(!a&&"getBoundingClientRect"in t.target){const{width:e,height:a}=t.target.getBoundingClientRect(),[n,r]=l.pointer(t,t.target);c=c-n+e/2,u=u-r+a/2}be&&(be.style.visibility="visible"),i.render(r.createElement(me,{style:s({left:c,top:u},o),bars:n,renderTooltip:e,className:d}),be)},[d,o,e,a]),n.useCallback(()=>{be&&(be.style.visibility="hidden",u&&u())},[u])]})({renderTooltip:b,tooltipBind:C,tooltipStyle:T,tooltipClassName:L,hideTooltip:N}),X=(t=>n.useMemo(()=>t?t=>{let{item:e,mouseMove:a,mouseLeave:n,tooltipBind:l}=t,o=c(t,["item","mouseMove","mouseLeave","tooltipBind"]);return r.createElement(he,Object.assign({className:le.horizontalBarChartStackWrapper,onMouseOver:t=>a(t,e),onMouseMove:l?t=>a(t,e):void 0,onMouseOut:n},o))}:t=>{let{children:e}=t;return r.createElement(n.Fragment,null,e)},[t]))(w);return r.createElement(oe,{className:a,style:o,onMouseOver:B?t=>z(t,G.flat()):void 0,onMouseMove:B?t=>z(t,G.flat()):void 0,onMouseOut:B?Y:void 0},M,r.createElement("tbody",null,G.map((t,e)=>{const a=(g||k)&&l.sum(t,t=>{let{value:e}=t;return e}),n=l.sum(t,t=>{let{width:e}=t;return e});return r.createElement("tr",{key:"row-"+e},"function"==typeof v&&r.createElement("td",{className:le.horizontalBarChartButtonTd},v(t,e)),r.createElement("td",{className:le.horizontalBarChartLabelTd},u&&u[e]&&r.createElement(ie,{className:le.horizontalBarChartLabelCell},u[e])),r.createElement(ce,{className:le.horizontalBarChartBarTd,style:{pointerEvents:B?"none":"auto"}},r.createElement(se,{className:le.horizontalBarChartBarFlex,style:{pointerEvents:B?"none":"auto"}},r.createElement(X,{style:w?{width:n+"%"}:void 0,item:t,tooltipBind:C,mouseMove:z,mouseLeave:Y}),t.map((t,e,a)=>0!==t.value&&r.createElement(Ce,{key:"bar-"+(t.name||"")+"-"+e,formatNativeTitle:m,bar:t,tooltipBind:C,pointerEventsNone:w||B,withTooltip:f&&!w,mouseMove:z,mouseLeave:Y,isOnlyChild:1===a.length,isFirstChild:0===e&&a.length>1,isLastChild:a.length-1===e&&a.length>1})),g&&r.createElement(ue,{className:le.horizontalBarChartStackSumContainer},r.createElement(pe,{className:le.horizontalBarChartStackSum},a)))),k&&k(t,a,e))}),!A&&r.createElement(ke,{maxValue:"number"==typeof h?h:E,scaleTicks:x,renderTicks:y,scaleDomain:S}),d))};function Ae(){const t=d(["\n ."," {\n position: absolute;\n transition: opacity 150ms cubic-bezier(0.2, 1, 0.6, 1);\n pointer-events: none;\n z-index: 1;\n }\n"]);return Ae=function(){return t},t}function we(){const t=d(["\n .",",\n .",",\n ."," {\n shape-rendering: crispEdges;\n }\n\n .",",\n ."," {\n stroke: rgba(149, 149, 149, 0.24);\n }\n\n ."," {\n font-size: 10px;\n }\n"]);return we=function(){return t},t}Me.defaultProps={fullExtent:!0,withTooltip:!1,withStackSum:!1,tooltipBind:!1,scaleTicks:4,withoutXScale:!1};const Be={bubbleChartYAxis:"bubbleChartYAxis",bubbleChartYAxisZeroTick:"bubbleChartYAxisZeroTick",bubbleChartXAxis:"bubbleChartXAxis",bubbleChartGridGlobal:"bubbleChartGridGlobal",bubbleChartGridLineX:"bubbleChartGridLineX",bubbleChartGridLineY:"bubbleChartGridLineY",bubbleChartCircle:"bubbleChartCircle",bubbleChartYScaleLabel:"bubbleChartYScaleLabel",bubbleChartTooltip:"bubbleChartTooltip",bubbleChartTooltipContainer:"bubbleChartTooltipContainer",bubbleChartTooltipFlex:"bubbleChartTooltipFlex",bubbleChartTip:"bubbleChartTip"},Ne=a(p)(we(),Be.bubbleChartYAxis,Be.bubbleChartXAxis,Be.bubbleChartGridGlobal,Be.bubbleChartGridLineX,Be.bubbleChartGridLineY,Be.bubbleChartYScaleLabel),Ee=e.createGlobalStyle(Ae(),Be.bubbleChartTooltipContainer);function Ge(){const t=d(["\n width: 0;\n height: 0;\n display: flex;\n align-items: flex-end;\n justify-content: center;\n font-size: 12px;\n white-space: nowrap;\n"]);return Ge=function(){return t},t}const ze=a.div(Ge()),Ye=(t,e)=>{const{data:a,margin:n,xAxisPadding:i,yAxisPadding:s,customYScale:c,customYAxis:d,customXScale:u,customXAxis:p,minSize:h,maxSize:m,minYValue:f,maxYValue:g,drawGridY:C,drawGridX:x,xScaleItemWidth:y,bubbleStyle:v,customize:T,yScaleLabel:L,yScaleLabelPadding:S,enableTooltip:k,tooltipRoot:M,tooltipClassName:A,renderTooltip:w}=e;if(null!==t&&a.length){const B=n?n.top:0,N=n?n.right:0,E=n?n.bottom:0,G=n?n.left:0,{width:z}=t.getBoundingClientRect(),Y=e.width||z,X=e.height||0,R=6,I="number"==typeof f?f:l.min(a,t=>{let{yValue:e}=t;return e}),P="number"==typeof g?g:l.max(a,t=>{let{yValue:e}=t;return e}),D=b(t,Y,X||0),F=l.scaleLinear().domain([l.min(a,t=>{let{sizeValue:e}=t;return e}),l.max(a,t=>{let{sizeValue:e}=t;return e})]).range([h||Re.minSize,m||Re.maxSize]),O=X-B-E-(i||0),V=l.scaleLinear().domain([I,P]).range([O,B]).nice();c&&c(V);const j=V.ticks(),W=l.axisLeft(V).ticks(R),q=W.tickArguments()[0],Z=D.append("g").attr("class",Be.bubbleChartYAxis).call(W);let U=S||0;if(L){const t=D.append("text").text(L).attr("class",Be.bubbleChartYScaleLabel),{width:e,height:a}=Et(t);U+=a,t.attr("transform","rotate(-90) translate(-"+(O+E+e)/2+", "+a+")")}Z.selectAll(".tick").attr("class",t=>0===t?"tick "+Be.bubbleChartYAxisZeroTick:"tick"),d&&d(Z);const{width:_}=Et(Z),H=[G+_+(s||0)+U,Y-N],J=l.scaleLinear().domain([l.min(a,t=>{let{xValue:e}=t;return e}),l.max(a,t=>{let{xValue:e}=t;return e})]).range(H);u&&u(J);const K=l.axisBottom(J);if("number"==typeof y){const[t,e]=J.range();K.ticks(Math.round((e-t)/y)).tickSizeOuter(0)}const Q=D.append("g").call(K).attr("class",Be.bubbleChartXAxis);p&&p(Q),Z.attr("transform","translate("+(G+_+U)+", 0)"),(t=>{let{svg:e,yScale:a,xScale:n,yTicksCount:r,drawGridX:l,drawGridY:o}=t;if(!o&&!l)return;const[i,s]=n.domain(),c=e.append("g").attr("class",Be.bubbleChartGridGlobal),d=a.ticks(r);l&&c.append("g").selectAll("line").data(d).join("line").attr("class",Be.bubbleChartGridLineX).attr("x1",()=>n(i)).attr("x2",()=>n(s)).attr("y1",t=>Math.round(a(t))).attr("y2",t=>Math.round(a(t))),o&&c.append("g").selectAll("line").data(n.ticks(r)).join("line").attr("class",Be.bubbleChartGridLineY).attr("x1",t=>Math.round(n(t))).attr("x2",t=>Math.round(n(t))).attr("y1",()=>Math.round(a(d[0]))).attr("y2",()=>Math.round(a(d[d.length-1])))})({svg:D,yScale:V,xScale:J,yTicksCount:q,drawGridY:C,drawGridX:x}),Q.attr("transform","translate(0, "+(V(j[0])+(i||0))+")");const $=D.append("g").selectAll("dot").data(a).enter().append("circle").attr("class",Be.bubbleChartCircle).attr("cx",t=>{let{xValue:e}=t;return J(e)}).attr("cy",t=>{let{yValue:e}=t;return V(e)}).attr("r",t=>{let{sizeValue:e}=t;return F(e)/2}).attr("fill",t=>{let{color:e}=t;return e||"rgba(0, 176, 113, 0.6)"}).attr("stroke",t=>{let{stroke:e}=t;return e||"transparent"}).attr("style",t=>{let{style:e}=t;return e||v||""});k&&(t=>{let{bubbles:e,tooltipRoot:a,tooltipClassName:n,renderTooltip:i}=t;const s=a||document.querySelector("body"),c=l.format(",");let d=l.select(s).select("."+Be.bubbleChartTooltip);null===d.node()&&(d=l.select(s).append("div").attr("class",Be.bubbleChartTooltip));let u=d.append("div").attr("class",Be.bubbleChartTooltipContainer+" "+(n||"")).style("opacity","0");e.on("mouseover.tooltip",(t,e)=>{const{sizeValue:a}=e,n=t.currentTarget,{x:l,y:s,width:d}=n.getBoundingClientRect(),p=window.pageXOffset+l+d/2,h=window.pageYOffset+s;u.style("left",p+"px").style("top",h+"px").html(()=>o.renderToString(r.createElement(ze,{className:Be.bubbleChartTooltipFlex},r.createElement(ut,{className:Be.bubbleChartTip},c(a))))),i&&i({tooltip:u,data:e,circle:n}),u.style("opacity","1")}),e.on("mouseout.tooltip",()=>{u.style("opacity","0")})})({bubbles:$,tooltipRoot:M,tooltipClassName:A,renderTooltip:w}),T&&T({svg:D,bubbles:$,yScale:V,xScale:J,sizeScale:F})}},Xe=t=>{const{className:e,style:a,children:o,tooltipRoot:i}=t,[s,c]=h();return n.useEffect(()=>{c&&Ye(c,t)},[c,t]),n.useEffect(()=>()=>(t=>{const e=t||document.querySelector("body");l.select(e).select("."+Be.bubbleChartTooltip).remove()})(i),[i]),m(t.width,()=>Ye(c,t)),r.createElement("div",{className:e,style:a},r.createElement(Ee,null),r.createElement(Ne,{ref:s},o))},Re={height:280,minSize:6,maxSize:30,margin:{top:10,right:15,bottom:10,left:0},yAxisPadding:10,xAxisPadding:10,yScaleLabelPadding:10};Xe.defaultProps=Re,exports.BarChart=Jt,exports.BubbleChart=Xe,exports.CalendarChart=Nt,exports.ChartWrapper=p,exports.HorizontalBarChart=Me,exports.LineChart=Wt,exports.PieChart=Lt,exports.RadarChart=O,exports.SwipeScroll=v,exports.appendSvg=b,exports.barChartClassNames=Ut,exports.bubbleChartClassNames=Be,exports.calendarChartClassNames=wt,exports.horizontalBarChartClassNames=le,exports.lineChartClassNames=Rt,exports.pieChartclassNames=W,exports.radarChartclassNames=P,exports.useNode=h,exports.useResize=m;
|
|
1
|
+
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),a=t(e),n=require("react"),r=t(n),l=require("d3"),o=t(require("react-dom/server")),i=require("react-dom");function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t}).apply(this,arguments)}function c(t,e){if(null==t)return{};var a,n,r={},l=Object.keys(t);for(n=0;n<l.length;n++)e.indexOf(a=l[n])>=0||(r[a]=t[a]);return r}function d(t,e){return e||(e=t.slice(0)),t.raw=e,t}function u(){const t=d(["\n position: relative;\n width: 100%;\n box-sizing: border-box;\n"]);return u=function(){return t},t}const p=a.div(u());function h(){const[t,e]=n.useState(null);return[n.useCallback(e,[e]),t]}const m=(t,e,a)=>{const r=n.useMemo(()=>e?function(t,e){let a=!1;return function(){a||(t(...arguments),a=!0,setTimeout((function(){a=!1}),e))}}(e,a||44):void 0,[e,a]);n.useEffect(()=>(r&&"number"!=typeof t&&window.addEventListener("resize",r),()=>r&&window.removeEventListener("resize",r)),[t,r])},b=(t,e,a)=>(l.select(t).select("svg").remove(),l.select(t).append("svg").attr("width",e).attr("height",a));function f(){const t=d(["\n width: 100%;\n overflow: hidden;\n user-select: none;\n"]);return f=function(){return t},t}const g=a.div(f()),C=t=>t*(2-t),x=(t,e,a)=>Math.min(Math.max(t,e),a),y={animation:0,speed:0,timestamp:0,startX:0,currentX:0},v=t=>{let{children:e,width:a,onSwipe:o}=t,i=c(t,["children","width","onSwipe"]);const[d,u]=h();return((t,e)=>{let{width:a,duration:r,animationFunc:o,onSwipe:i}=e;const s=l.select(t),c=l.select("body"),d=l.select(document),u=n.useRef(y);n.useEffect(()=>{a&&u.current.animation&&(cancelAnimationFrame(u.current.animation),u.current=y)},[a]);const p=n.useCallback(e=>{const{width:n}=t?t.getBoundingClientRect():{width:0},[r]=l.pointer(e.type.includes("touch")?e.touches[0]:e),o=x(r-u.current.startX,-(a-n),0);if(s.style("transform","translateX("+o+"px)"),u.current.currentX){const t=100,e=Date.now(),a=Math.round((o-u.current.currentX)/(e-u.current.timestamp)*t);u.current.speed=a,u.current.timestamp=e}u.current.currentX=o,i&&i(o,s)},[i,a,t,s]),h=n.useCallback(()=>{const{width:e}=t?t.getBoundingClientRect():{width:0};d.on("mousemove.swipe touchmove.swipe mouseup.swipe touchend.swipe",null),c.style("cursor",null),s.style("cursor",a>e?"grab":null),Date.now()-u.current.timestamp<44&&function(t){let{duration:e,timing:a,draw:n}=t;const r=performance.now();let l;requestAnimationFrame((function t(o){let i=(o-r)/e;i<1&&(l=requestAnimationFrame(t)),i>1&&cancelAnimationFrame(l);const s=a(i);n(s,l)}))}({duration:r,timing:o||C,draw:(t,n)=>{u.current.animation=n;const r=Math.round(2*u.current.speed*t),l=u.current.currentX+r,o=a-e,c=x(l,-o,0),d=Math.max(Math.min(l,o),0);u.current.currentX!==d&&(s.style("transform","translateX("+c+"px)"),i&&i(c,s))}})},[c,o,i,s,r,t,a,d]),m=n.useCallback(e=>{const a=e.type.includes("touch"),[n]=l.pointer(a?e.touches[0]:e,t),{left:r}=t&&t.parentElement?t.parentElement.getBoundingClientRect():{left:0};c.style("cursor","grabbing"),s.style("cursor","grabbing"),u.current.animation&&(cancelAnimationFrame(u.current.animation),u.current=y),u.current.startX=Math.max(n+r,0),d.on("mousemove.swipe touchmove.swipe",p),d.on("mouseup.swipe touchend.swipe",h)},[s,c,t,h,p,d]);n.useEffect(()=>{if(t){const{width:e}=t.getBoundingClientRect();a>e&&(s.style("cursor","grab"),s.on("mousedown.swipe touchstart.swipe",m))}},[s,m,t,a])})(u,s({width:a,onSwipe:o},i)),r.createElement(g,Object.assign({},i),r.createElement("div",{ref:d},e))};function T(){const t=d(["\n position: absolute;\n"]);return T=function(){return t},t}v.defaultProps={duration:1400};const L=t=>{let{anchor:e,index:a,translateX:n,translateY:r}=t;return 0===a&&"middle"===e?"translate(calc(-50% + "+n+"px), calc(-100% + "+r+"px))":"middle"===e?"translate(calc(-50% + "+n+"px), calc("+r+"px))":"start"===e?"translate(calc("+n+"px), calc(-50% + "+r+"px))":"end"===e?"translate(calc(-100% + "+n+"px), calc(-50% + "+r+"px))":"translate("+n+"px, "+r+"px)"},S=a.div.attrs(t=>({style:{transform:L(t)}}))(T());function k(){const t=d(["\n margin-left: 4px;\n font-size: 10px;\n color: rgba(255, 255, 255, 0.54);\n"]);return k=function(){return t},t}function M(){const t=d(["\n ","\n"]);return M=function(){return t},t}function A(){const t=d(["\n display: flex;\n align-items: center;\n padding: 2px 4px;\n border-radius: 4px;\n color: rgb(255, 255, 255);\n background-color: rgb(144, 197, 61);\n margin-left: 8px;\n"]);return A=function(){return t},t}function w(){const t=d(["\n position: absolute;\n top: 50%;\n right: 0;\n transform: translate(calc(100% + 6px), -50%);\n"]);return w=function(){return t},t}function N(){const t=d(["\n text-align: center;\n max-width: 120px;\n"]);return N=function(){return t},t}function B(){const t=d(["\n display: flex;\n align-items: center;\n font-size: 12px;\n"]);return B=function(){return t},t}const E=a.div(B()),G=a.div(N()),z=e.css(w()),Y=a.div(A()),X=a(Y)(M(),z),R=a.div(k());function I(){const t=d(["\n ."," {\n path,\n line,\n circle {\n fill: none;\n stroke-width: 1px;\n stroke: rgba(149, 149, 149, 0.18);\n }\n }\n ."," {\n font-size: 12px;\n fill-opacity: 0.56;\n }\n ."," {\n fill-opacity: 0.06;\n stroke-width: 2px;\n fill: rgb(144, 197, 61);\n stroke: rgb(144, 197, 61);\n }\n ."," {\n fill: rgb(144, 197, 61);\n }\n"]);return I=function(){return t},t}const P={radar:"radar",radarAxis:"radarAxis",radarAxisTextGlobal:"radarAxisTextGlobal",radarAxisText:"radarAxisText",radarPolygon:"radarPolygon",radarLabel:"radarLabel",radarLabelName:"radarLabelName",radarLabelBadge:"radarLabelBadge",radarLabelBadgePrefix:"radarLabelBadgePrefix",radarCircle:"radarCircle"},D=a(p)(I(),P.radarAxis,P.radarAxisText,P.radarPolygon,P.radarCircle),F=(t,e)=>{const{data:a,curve:n,polar:i,formatValue:c,badgePrefix:d,labelOffset:u,circleRadius:p,svgElements:h,renderLabel:m,customize:f,formatAxisValue:g,radarStyles:C,labelIndex:x,selectLabel:y}=e;if(null!==t&&a.length){const v=10,T="number"==typeof e.bleedLength?e.bleedLength:v,{width:L}=t.getBoundingClientRect(),k=e.width||L,M=400,A=e.height||M,w=e.minValue||Math.min(0,l.min(a,t=>l.min(t.map(t=>{let{value:e}=t;return e})))),N=(e.maxValue||Math.max(0,l.max(a,t=>l.max(t.map(t=>{let{value:e}=t;return e})))))-w,B=e.paddingY||0,z=Math.min((k-2*(e.paddingX||0)-2*T)/2,(A-2*B-2*T)/2),I=4,D=l.scaleLinear().domain([0,N||1]).range([]).ticks(e.levels||I),F=D[D.length-1],O=F+(D[1]-D[0]);F<N&&D.push(O);const V=e.levels||D.length-1,j=D[D.length-1],W=2*Math.PI/a[0].length,q=l.scaleLinear().range([0,z]).domain([0,j]),Z=l.lineRadial().curve(l.curveLinearClosed).radius(t=>{let{value:e}=t;return q(e)}).angle((t,e)=>e*W),U=l.lineRadial().curve(n||l.curveLinearClosed).radius(t=>{let{value:e}=t;return q(e)}).angle((t,e)=>e*W),_=b(t,k,A),H=_.append("g"),J=l.range(1,V+1).reverse(),K=t=>-t*z/V,Q=t=>j*t/V,$=H.append("g").attr("class",P.radarAxis).selectAll().data([a[0]]).enter(),tt=H.append("g").attr("class",P.radar),et=$.selectAll().data(a[0].map(t=>{let{name:e}=t;return e})).enter();let at=0;i?J.forEach(t=>{const e=$.append("circle").attr("cx",0).attr("cy",0).attr("r",()=>z/V*t).node().getBoundingClientRect().height;at=Math.max(at,e)}):J.map(Q).forEach(t=>{const e=$.append("path").attr("d",()=>Z(Array.from({length:a[0].length},()=>({value:t})))).node().getBoundingClientRect().height;at=Math.max(at,e)});const nt=q(j)+T;et.append("line").attr("x1",0).attr("y1",0).attr("x2",(t,e)=>Math.round(nt*Math.cos(W*e-Math.PI/2))).attr("y2",(t,e)=>Math.round(nt*Math.sin(W*e-Math.PI/2))),tt.selectAll("path").data(a).join("path").attr("class",P.radarPolygon).attr("style",(t,e)=>(null==C?void 0:C[e])||"").attr("d",t=>U(t.map(t=>s({},t,{value:t.value-w}))));const rt=l.format(",");H.append("g").attr("class",P.radarAxisTextGlobal).selectAll("text").data(J).enter().append("text").attr("class",P.radarAxisText).attr("x","4").attr("y",K).attr("dy",0).attr("dominant-baseline","central").text((t,e)=>{const a=Q(t)+w;return g?g(a,e):rt(a)}),p&&a.forEach(t=>{const e=H.append("g").attr("class",P.radarCircle);t.forEach((t,a)=>{let{value:n}=t;e.append("circle").attr("cx",Math.round(q(n)*Math.cos(W*a-Math.PI/2))).attr("cy",Math.round(q(n*Math.sin(W*a-Math.PI/2)))).attr("r",p)})});const lt=8,ot=A-T-B,it=k/2,st=ot/2+(ot-at)/2,ct=T+(u||lt);if(H.attr("transform","translate("+it+","+st+")"),(t=>{let{node:e,dataLength:a,radiusScale:n,maxValue:i,angleSlice:s,radius:c,xOffset:d,yOffset:u,translateX:p,translateY:h,renderLabel:m,selectLabel:b}=t;const f=l.select(e);f.selectAll(".d3-chart-label").remove();const g=t=>i/c*t,C=t=>n((i+g(u||0))*Math.sin(s*t-Math.PI/2));Array.from({length:a},(t,e)=>{return{x:Math.ceil((a=e,n(i+g(d||0))*Math.cos(s*a-Math.PI/2))),y:Math.ceil(C(e))};var a}).forEach((t,e)=>{let{x:n,y:l}=t;const i=((t,e)=>{const a=((t,e)=>360/e*t)(t,e),n=180;return[0,n].includes(a)?"middle":a<n?"start":"end"})(e,a),s=o.renderToString(r.createElement(S,{anchor:i,translateX:p||0,translateY:h||0,index:e,style:{left:n,top:l}},"function"==typeof m?m(i,e):m)),c=f.append("div").attr("class","d3-chart-label").html(s);b(c,i,e)})})({node:t,maxValue:j,translateX:it,translateY:st,dataLength:a[x||0].length,angleSlice:W,radius:z,radiusScale:q,xOffset:ct,yOffset:ct,renderLabel:(t,e)=>{const n=a.map(t=>t[e]),l="middle"===t?X:Y,o=a[x||0][e],{name:i,value:s}=o;return m?m({item:o,items:n,anchor:t,index:e}):r.createElement(E,{className:P.radarLabel},r.createElement(G,{className:P.radarLabelName},i),r.createElement(l,{className:P.radarLabelBadge},c?c(s,e):rt(s),d&&r.createElement(R,{className:P.radarLabelBadgePrefix},d)))},selectLabel:(t,e,n)=>{if(y){const r=a.map(t=>t[n]);y(t,{index:n,item:a[x||0][n],items:r,anchor:e})}}}),h){const t=o.renderToString(h);_.append("g").html(t)}f&&f(_)}},O=t=>{const{className:e,style:a}=t,[l,o]=h();return n.useEffect(()=>{o&&F(o,t)},[o,t]),m(t.width,()=>F(o,t)),r.createElement("div",{className:e,style:a},r.createElement(D,{ref:l}))};function V(t){return t*(Math.PI/180)}function j(){const t=d(["\n ."," {\n fill: #4a4a4a;\n }\n ."," {\n position: absolute;\n max-width: 128px;\n }\n ."," {\n stroke: #000;\n }\n ."," {\n fill: transparent;\n cursor: pointer;\n }\n"]);return j=function(){return t},t}O.defaultProps={height:400,data:[],curve:l.curveLinearClosed};const W={pieGlobal:"pieGlobal",pieSlice:"pieSlice",pieSliceLabel:"pieSliceLabel",pieSliceLabelValue:"pieSliceLabelValue",pieSliceLabelName:"pieSliceLabelName",pieRadialLabel:"pieRadialLabel",pieRadialLink:"pieRadialLink",pieTooltipContainer:"pieTooltipContainer",pieTooltipFlex:"pieTooltipFlex",pieTooltip:"pieTooltip",pieTooltipItem:"pieTooltipItem",pieTooltipName:"pieTooltipName",pieTooltipValue:"pieTooltipValue",pieTooltipColorBox:"pieTooltipColorBox",pieFullChartTooltipCircle:"pieFullChartTooltipCircle"},q=a(p)(j(),W.pieSliceLabel,W.pieRadialLabel,W.pieRadialLink,W.pieFullChartTooltipCircle),Z=t=>t.startAngle+(t.endAngle-t.startAngle)/2<Math.PI?1:-1,U=t=>t.startAngle+(t.endAngle-t.startAngle)/2<Math.PI?"start":"end";function _(){const t=d(["\n bottom: 6px;\n"]);return _=function(){return t},t}function H(){const t=d(["\n top: 6px;\n"]);return H=function(){return t},t}function J(){const t=d(["\n position: relative;\n font-size: 11px;\n color: #fff;\n font-weight: bold;\n letter-spacing: 0.52px;\n"]);return J=function(){return t},t}function K(){const t=d(["\n text-align: right;\n flex-shrink: 0;\n flex-grow: 1;\n"]);return K=function(){return t},t}function Q(){const t=d(["\n margin-right: 4px;\n"]);return Q=function(){return t},t}function $(){const t=d(["\n height: 2px;\n border-radius: 0;\n"]);return $=function(){return t},t}function tt(){const t=d(["\n margin-right: 4px;\n width: 10px;\n height: 10px;\n border-radius: 2px;\n"]);return tt=function(){return t},t}function et(){const t=d(["\n display: flex;\n align-items: center;\n margin-right: 4px;\n"]);return et=function(){return t},t}function at(){const t=d(["\n display: flex;\n align-items: center;\n margin-bottom: 0.25rem;\n &:last-of-type {\n margin-bottom: 0;\n }\n"]);return at=function(){return t},t}function nt(){const t=d(["\n font-size: 14px;\n margin-bottom: 6px;\n"]);return nt=function(){return t},t}function rt(){const t=d(["\n position: relative;\n font-size: 11px;\n color: #fff;\n margin-bottom: 8px;\n padding: 4px 6px;\n background-color: rgba(48, 69, 79, 1);\n border-radius: 4px;\n box-shadow: 0 0.1875rem 0.5rem rgba(48, 69, 79, 0.06);\n :before {\n content: '';\n position: absolute;\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 100%);\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 4px 3px 0 3px;\n border-color: rgba(48, 69, 79, 1) transparent transparent transparent;\n }\n"]);return rt=function(){return t},t}function lt(){const t=d(["\n align-items: center;\n"]);return lt=function(){return t},t}function ot(){const t=d([""]);return ot=function(){return t},t}function it(){const t=d(["\n width: 0;\n height: 0;\n display: flex;\n align-items: flex-end;\n justify-content: center;\n pointer-events: none;\n white-space: nowrap;\n"]);return it=function(){return t},t}const st=a.div(it()),ct=a(st)(ot()),dt=a(ct)(lt()),ut=a.div(rt()),pt=a.div(nt()),ht=a.div(at()),mt=a.div(et()),bt=a.div(tt()),ft=a(bt)($()),gt=a.div(Q()),Ct=a.div(K()),xt=a.div(J()),yt=a(xt)(H()),vt=a(xt)(_()),Tt=(t,e)=>{const{data:a,padAngle:n,onClick:i,outerRadius:s,startAngle:c,endAngle:d,cornerRadius:u,margin:p,enableSlicesLabels:h,formatSliceLabel:m,slicesLabelsSkipAngle:f,enableSlicesLabelsName:g,formatSliceLabelName:C,borderWidth:x,borderColor:y,enableRadialLabels:v,backgroundColor:T,radialLabelsLinkHorizontalLength:L,radialLabelsTextXOffset:S,formatRadialLabel:k,radialLabelYOffset:M,svgElements:A,formatSliceTitle:w,radialAngleXOffset:N,withTooltip:B,fullChartTooltip:E,tooltipClassName:G,tooltipBind:z,renderTooltip:Y,tooltipStyle:X}=e;if(null!==t&&a.length){const R=p?p.top:0,I=p?p.right:0,P=p?p.bottom:0,D=p?p.left:0,{width:F}=t.getBoundingClientRect(),O=e.width||F,j=240,q=e.height||j,_=(Math.min(O,q)-2*(x||0)-(O>q?R+P:I+D))/2,H=b(t,O,q),J=H.append("g").attr("class",W.pieGlobal).attr("transform","translate("+((O-(D+I))/2+D)+","+((q-(P+R))/2+R)+")"),K=45,Q=100,$=360,tt=l.pie().startAngle(-V(c||0)).endAngle(V(d||$)).padAngle(n?Math.max(Math.min(n/Q,K),0):0).sort(null).value(t=>{let{value:e}=t;return e})(a),et=.95,at=l.arc().cornerRadius(u||0).innerRadius(_).outerRadius(_*Math.min(Math.max(s||0,0),et));"string"==typeof T&&J.append("path").attr("fill",T).attr("d",()=>at({startAngle:V(0),endAngle:V($)}));const nt=l.format(","),rt=J.selectAll("allSlices").data(tt).enter().append("path").attr("d",at);if(rt.attr("class",W.pieSlice).attr("fill",t=>{let{index:e}=t;return a[e].color||""}).attr("stroke",y||"").attr("stroke-width",x||0).attr("style",i?"cursor: pointer":"").on("click",(t,e)=>i&&i(a[e.index])).append("svg:title").text(t=>w?w(t):E||B?"":(a[t.index].name||"")+" ("+nt(a[t.index].value)+")"),h){const t=J.selectAll("allSlices").data(tt).enter().append("text").attr("class",W.pieSliceLabel).attr("text-anchor","middle").attr("dominant-baseline","central").attr("transform",t=>"translate("+at.centroid(t)+")");t.append("tspan").attr("class",W.pieSliceLabelValue).text(t=>{const e=180*(t.endAngle-t.startAngle)/Math.PI;if(!f||e>f)return m?m(t):t.value}),g&&t.append("tspan").attr("class",W.pieSliceLabelName).text(t=>C?C(t):t.data.name).attr("x","0").attr("dy","1.2em")}if((t=>{let{arc:e,enableRadialLabels:a,global:n,node:r,radius:i,dataReady:s,radialLabelsLinkHorizontalLength:c,formatRadialLabel:d,radialLabelsTextXOffset:u,translateX:p,translateY:h,radialLabelYOffset:m,radialAngleXOffset:b}=t;const f=l.select(r);if(f.selectAll("."+W.pieRadialLabel).remove(),a){const t=4,a=l.arc().innerRadius(i).outerRadius(i);n.selectAll("allPolylines").data(s).enter().append("polyline").attr("class",W.pieRadialLink).style("fill","none").attr("points",n=>{const r=Z(n),l=e.centroid(n),o=a.centroid(n),s=a.centroid(n),d=[(i+(c||t))*r,s[1]];return[[l[0],l[1]],[o[0]+(b||0)*r,o[1]-(m||0)*n.index],[d[0],d[1]-(m||0)*n.index]]});const r=e=>{const n=a.centroid(e);return[(i+(c||t))*Z(e),n[1]]},g=4;f.selectAll("allLabels").data(s).enter().append("div").html(t=>o.renderToString(d?d(t):t.data.name)).attr("class",W.pieRadialLabel).style("transform",t=>(t=>{let{anchor:e,index:a,translateX:n,translateY:r}=t;return 0===a&&"middle"===e?"translate(calc(-50% + "+n+"px), calc(-100% + "+r+"px))":"middle"===e?"translate(calc(-50% + "+n+"px), calc("+r+"px))":"start"===e?"translate(calc("+n+"px), calc(-50% + "+r+"px))":"end"===e?"translate(calc(-100% + "+n+"px), calc(-50% + "+r+"px))":"translate("+n+"px, "+r+"px)"})({anchor:U(t),index:t.index,translateX:p,translateY:h-(m||0)*t.index})).style("left",t=>r(t)[0]-("start"===U(t)?-(u||g):u||g)+"px").style("top",t=>r(t)[1]+"px").style("text-align",U)}})({arc:at,enableRadialLabels:v,global:J,radius:_,node:t,dataReady:tt,translateX:(O-(D-I))/2,translateY:(q+(R-P))/2,radialLabelsLinkHorizontalLength:L,radialLabelsTextXOffset:S,formatRadialLabel:k,radialLabelYOffset:M,radialAngleXOffset:N}),(B||E)&&(t=>{let{fullChartTooltip:e,global:a,tooltipRoot:n,data:i,tooltipClassName:s,tooltipBind:c,renderTooltip:d,arc:u,allSlices:p,tooltipStyle:h,width:m,height:b,radius:f}=t;const g=n||document.querySelector("body"),C=l.format(","),x=l.select(g).select("."+W.pieTooltipContainer),y=x.empty()?l.select(g).append("div").attr("class",W.pieTooltipContainer+" "+(s||"")).style("position","absolute").style("opacity","0"):x;h&&Object.entries(h).forEach(t=>{let[e,a]=t;return y.style(e,a)}),y.html("");let v=!1;const T=t=>{v=Boolean(t),y.style("opacity",v?"1":"0")},L=(t,n)=>{let[r,o]=l.pointer(t,document);if(!c&&e){const[e,a]=l.pointer(t,t.target);r-=e,o-=a}else if(!c){const t=a.node(),{x:e,y:l,width:i,height:s}=t?t.getBoundingClientRect():{x:0,y:0,width:0,height:0},[c,d]=u.centroid(n);r=e+i/2+c,o=l+s/2+d}y.style("left",r+"px").style("top",o+"px")},S=(t,e)=>{T(!0),L(t,e);const a=e?[e.data]:i;y.html(()=>o.renderToString(r.createElement(st,{className:W.pieTooltipFlex},r.createElement(ut,{className:W.pieTooltip},d?d(a):r.createElement(r.Fragment,null,a.map((t,e)=>{let{color:a,name:n,value:l}=t;return r.createElement(ht,{key:n+"-"+e,className:W.pieTooltipItem},a&&r.createElement(bt,{className:W.pieTooltipColorBox,style:{backgroundColor:a}}),n&&r.createElement(gt,{className:W.pieTooltipName},n),r.createElement(Ct,{className:W.pieTooltipValue},C(l)))}))))))};e?(a.on("mouseover.fulltooltip",t=>S(t)),a.on("mouseout.fulltooltip",()=>{y.html(""),T()}),m&&b&&a.append("circle").attr("class",W.pieFullChartTooltipCircle).attr("r",f).attr("cx",0).attr("cy",0),c||a.on("touchmove.tooltipBind mousemove.tooltipBind",t=>L(t))):(p.on("mouseover.slice",S),c||p.on("touchmove.slice mousemove.slice",L),p.on("mouseout.slice",()=>{y.html(""),T()}))})({fullChartTooltip:E,global:J,data:a,tooltipClassName:G,tooltipBind:z,renderTooltip:Y,allSlices:rt,arc:at,tooltipStyle:X,width:O,height:q,radius:_}),A){const t=o.renderToString(A);H.append("g").html(t)}}},Lt=t=>{const{className:e,style:a,children:l}=t,[o,i]=h();return n.useEffect(()=>{i&&Tt(i,t)},[i,t]),m(t.width,()=>Tt(i,t)),r.createElement("div",{className:e,style:a},r.createElement(q,{ref:o},l))};Lt.defaultProps={data:[],startAngle:0,endAngle:360,slicesLabelsSkipAngle:0,radialLabelYOffset:16,radialAngleXOffset:8};const St={legendContainer:"d3-legend-container",legendTitle:"d3-legend-title",legendTick:"d3-legend-tick",legendTickLine:"d3-legend-tick-line",legendTickText:"d3-legend-tick-text"};function kt(t,e){void 0===e&&(e=256);const a=document.createElement("canvas");a.width=e,a.height=1;const n=a.getContext("2d");for(let a=0;a<e;++a)n.fillStyle=t(a/(e-1)),n.fillRect(a,0,1,1);return a}const Mt={tickSize:6,height:44,width:320,marginTop:18,marginBottom:16,ticksDivier:64,titleMarginBottom:6};function At(){const t=d(["\n ."," {\n display: flex;\n margin-bottom: 16px;\n }\n ."," {\n display: inline-flex;\n align-items: flex-end;\n height: ",";\n margin-bottom: 4px;\n font-weight: bold;\n }\n ."," {\n height: ",";\n margin-bottom: 4px;\n position: relative;\n display: flex;\n }\n ."," {\n font-size: 14px;\n bottom: 0;\n position: absolute;\n }\n ."," {\n display: flex;\n flex-direction: column;\n margin-right: 10px;\n }\n ."," {\n font-size: 12px;\n display: inline-flex;\n align-items: center;\n justify-content: flex-end;\n }\n ."," {\n position: relative;\n }\n ."," {\n position: absolute;\n }\n"]);return At=function(){return t},t}const wt=s({calendarChart:"calendarChart",calendarYear:"calendarYear",calendarAxis:"calendarAxis",calendarBody:"calendarBody",calendarHeader:"calendarHeader",calendarYearTitle:"calendarYearTitle",calendarWeekDay:"calendarWeekDay",calendarMonth:"calendarMonth",calendarDays:"calendarDays",calendarDay:"calendarDay"},St),Nt=a(p)(At(),wt.calendarYear,wt.calendarYearTitle,"20px",wt.calendarHeader,"20px",wt.calendarMonth,wt.calendarAxis,wt.calendarWeekDay,wt.calendarDays,wt.calendarDay),Bt=t=>{const{className:e,style:a,children:o,data:i,startSunday:c,weekdays:d,cellOffset:u,cellSize:p,interpolator:m,monthSpacing:b,colorRange:f,legendProps:g}=t,[C,x]=h();return n.useEffect(()=>{x&&((t,e)=>{const{data:a,startSunday:n,weekdays:r,interpolator:o,monthSpacing:i,onEachDay:c,colorRange:d,legendProps:u}=e;if(null!==t&&a.length){const p=l.group(a,t=>t.date.getUTCFullYear()),h="number"==typeof e.cellOffset?e.cellOffset:0,m=7,b=18,f=e.cellSize||b,g=t=>n?t:(t+(m-1))%m,C=r||["вс","пн","вт","ср","чт","пт","сб"],x=6,y=t=>n?C[t]:t===x?C[0]:C[t+1],v=l.utcFormat("%x"),T=n?l.utcSunday:l.utcMonday,L=(t,e)=>T.count(l.utcYear(t),e),S=t=>t.getUTCMonth()*(i||0),k=l.utcFormat("%b"),M=l.max(a.map(t=>{let{value:e}=t;return e})),A=l.min(a.map(t=>{let{value:e}=t;return e})),w=d?l.scaleLinear().domain([A,M]).range(d):l.scaleSequential(o||l.interpolateGreens).domain([A,+M]);let N=0;p.forEach((t,e)=>{const a=new Date(e,1),n=l.max(t.map(t=>t.date)),r=n.getUTCMonth()-a.getUTCMonth(),o=L(a,n)+1;N=Math.max(N,o*(f+h)+(i||0)*r)}),l.select(t).select("."+wt.calendarChart).remove();const B=l.select(t).append("div").attr("class",wt.calendarChart),E=B.selectAll("div").data(p).join("div").attr("class",wt.calendarYear),G=E.append("div").attr("class",wt.calendarAxis);G.append("div").attr("class",wt.calendarYearTitle).text(t=>{let[e]=t;return e}),G.selectAll("span").data(l.range(m)).join("div").attr("class",wt.calendarWeekDay).style("height",f+"px").style("margin-bottom",h+"px").text(y);const z=E.append("div").attr("class",wt.calendarBody);if(z.append("div").attr("class",wt.calendarHeader).selectAll("div").data(t=>{let[e,a]=t;return l.utcMonths(l.utcMonth(new Date(a[0].date.getUTCFullYear(),1,1)),l.utcMonth(new Date(a[0].date.getUTCFullYear(),12,31)))}).join("div").attr("class",wt.calendarMonth).style("left",t=>L(t,T.ceil(t))*(f+h)+S(t)+"px").text(k),z.append("div").attr("class",wt.calendarDays).style("height",(f+h)*m+"px").style("width",N+"px").selectAll("div").data(t=>{let[,e]=t;return e}).join("div").each((t,e,a)=>{if(c){const n=a[e],r=w(t.value);c(t,n,r)}}).attr("class",wt.calendarDay).style("width",f+"px").style("height",f+"px").style("left",t=>L(t.date,t.date)*(f+h)+S(t.date)+"px").style("top",t=>g(t.date.getUTCDay())*(f+h)+"px").style("background-color",t=>w(t.value)).attr("title",t=>v(t.date)+" - "+t.value),"object"==typeof u){const t=(t=>{let{color:e,title:a,tickSize:n=Mt.tickSize,width:r=Mt.width,height:o=Mt.height+n,marginTop:i=Mt.marginTop,marginRight:s=0,marginBottom:c=Mt.marginBottom+n,marginLeft:d=0,ticks:u=Mt.width/Mt.ticksDivier,tickFormat:p,tickValues:h,titleMarginBottom:m}=t;const b=l.create("svg").attr("width",r).attr("height",o).attr("viewBox",[0,0,r,o]).style("overflow","visible").style("display","block");let f;if(e.interpolate){const t=Math.min(e.domain().length,e.range().length);f=e.copy().rangeRound(l.quantize(l.interpolate(d,r-s),t)),b.append("image").attr("x",d).attr("y",i).attr("class",St.legendContainer).attr("width",r-d-s).attr("height",o-i-c).attr("preserveAspectRatio","none").attr("xlink:href",kt(e.copy().domain(l.quantize(l.interpolate(0,1),t))).toDataURL())}else if(e.interpolator&&(f=Object.assign(e.copy().interpolator(l.interpolateRound(d,r-s)),{range:()=>[d,r-s]}),b.append("image").attr("x",d).attr("y",i).attr("width",r-d-s).attr("height",o-i-c).attr("preserveAspectRatio","none").attr("xlink:href",kt(e.interpolator()).toDataURL()),!f.ticks)){if(void 0===h){const t=Math.round(u+1);h=l.range(t).map(a=>l.quantile(e.domain(),a/(t-1)))}"function"!=typeof p&&(p=l.format(void 0===p?",f":p))}return b.append("g").attr("transform","translate(0,"+(o-c)+")").call(l.axisBottom(f).ticks(u,"string"==typeof p?p:void 0).tickFormat("function"==typeof p?p:void 0).tickSize(n).tickValues(h)).call(t=>{const e=t.selectAll(".tick");return e.selectAll(".tick line").attr("y1",i+c-o).attr("class",St.legendTickLine),e.selectAll(".tick text").attr("class",St.legendTickText),e.attr("class",St.legendTick),e}).call(t=>t.select(".domain").remove()).call(t=>t.append("text").attr("x",d).attr("class",St.legendTitle).attr("y",i+c-o-(m||Mt.titleMarginBottom)).attr("fill","currentColor").attr("text-anchor","start").attr("font-weight","bold").text(a)),b})(s({color:w},u)),e=B.node(),a=t.node();e.appendChild(a)}}})(x,t)},[x,i,c,d,u,p,m,b,f,g]),r.createElement(Nt,{ref:C,className:e,style:a},o)};function Et(t){let e;const a=t.node();return e=a instanceof SVGGraphicsElement?a.getBBox():a.getBoundingClientRect(),e}function Gt(){}function zt(t){return null==t||Number.isNaN(t)}function Yt(){const t=d(["\n ."," {\n transition: opacity linear 200ms;\n z-index: 1;\n ."," {\n justify-content: flex-start;\n align-items: center;\n pointer-events: none;\n }\n ."," {\n margin: 0 0 0 10px;\n }\n }\n"]);return Yt=function(){return t},t}function Xt(){const t=d(["\n .",",\n .",",\n ."," {\n shape-rendering: crispEdges;\n }\n ."," {\n fill: none;\n stroke: steelblue;\n stroke-width: 1.5px;\n stroke-linejoin: round;\n stroke-linecap: round;\n }\n ."," {\n fill-opacity: 0.24;\n }\n .",",\n .",",\n ."," {\n stroke: rgba(149, 149, 149, 0.24);\n }\n .",",\n ."," {\n transition: opacity linear 200ms;\n pointer-events: none;\n stroke-width: 1px;\n }\n ."," {\n stroke: #fff;\n stroke-width: 2px;\n }\n ."," {\n shape-rendering: crispEdges;\n }\n ."," {\n fill: none;\n pointer-events: all;\n }\n"]);return Xt=function(){return t},t}Bt.defaultProps={data:[]};const Rt={lineChartYScaleGlobal:"lineChartYScaleGlobal",lineChartXScaleGlobal:"lineChartXScaleGlobal",lineChartLinesGlobal:"lineChartLinesGlobal",lineChartLine:"lineChartLine",lineChartAreasGlobal:"lineChartAreasGlobal",lineChartArea:"lineChartArea",lineChartDotsGlobalContainer:"lineChartDotsGlobalContainer",lineChartDotsGlobal:"lineChartDotsGlobal",lineChartDot:"lineChartDot",lineChartGridGlobal:"lineChartGridGlobal",lineChartGridLineX:"lineChartGridLineX",lineChartGridLineY:"lineChartGridLineY",lineChartLabelContainer:"lineChartLabelContainer",lineChartLabelFlex:"lineChartLabelFlex",lineChartLabel:"lineChartLabel",lineChartMouseGlobal:"lineChartMouseGlobal",lineChartMouseLine:"lineChartMouseLine",lineChartMouseRect:"lineChartMouseRect",lineChartMouseCircle:"lineChartMouseCircle",lineChartMouseLabelContainer:"lineChartMouseLabelContainer",lineChartMouseLabel:"lineChartMouseLabel"},It=a(p)(Xt(),Rt.lineChartYScaleGlobal,Rt.lineChartXScaleGlobal,Rt.lineChartGridGlobal,Rt.lineChartLinesGlobal,Rt.lineChartArea,Rt.lineChartGridLineX,Rt.lineChartGridLineY,Rt.lineChartMouseLine,Rt.lineChartMouseLine,Rt.lineChartMouseCircle,Rt.lineChartDot,Rt.lineChartMouseLine,Rt.lineChartMouseRect),Pt=e.createGlobalStyle(Yt(),Rt.lineChartMouseLabel,Rt.lineChartLabelFlex,Rt.lineChartLabel);function Dt(){const t=d(["\n margin-bottom: 4px;\n"]);return Dt=function(){return t},t}function Ft(){const t=d(["\n width: 0;\n height: 0;\n display: flex;\n align-items: flex-end;\n justify-content: center;\n font-size: 12px;\n white-space: nowrap;\n"]);return Ft=function(){return t},t}const Ot=a.div(Ft()),Vt=a.div(Dt()),jt=(t,e)=>{const{data:a,labels:n,margin:i,customYAxisSelection:d,customXAxisSelection:u,customYAxis:p,customXAxis:h,curve:m,yAxisPadding:f,xAxisPadding:g,drawGridY:C,drawGridX:x,withLabels:y,formatLabel:v,eachLabel:T,stacked:L,dynamicTooltipEnable:S,dynamicCircleRadius:k,formatDynamicTooltip:M,renderTooltip:A,stackedTooltip:w,stackedTooltipIndex:N,tooltipLineTop:B,customize:E,customYScale:G,customLine:z,tooltipClassName:Y,xScaleItemWidth:X,areaCurve:R}=e;if(null!==t&&a.length){const I=L?(t=>{const e={};return t.map((t,a)=>(e[a]={},a>0?s({},t,{values:t.values.map((t,n)=>{const r=e[a-1][n];return e[a][n]=Number(("number"!=typeof r?0:Math.abs(r))+("number"!=typeof t?0:Math.abs(t))),e[a][n]})}):(t.values.forEach((t,n)=>{e[a][n]=Number(t)}),t)))})(a):a,P=i?i.top:0,D=i?i.right:0,F=i?i.bottom:0,O=i?i.left:0,{width:V}=t.getBoundingClientRect(),j=e.width||V,W=e.height||0,q="number"==typeof e.min?e.min:l.min(I,t=>{let{values:e}=t;return l.min(e)}),Z="number"==typeof e.max?e.max:l.max(I,t=>{let{values:e}=t;return l.max(e)}),U=b(t,j,W||0),_=l.scaleLinear().domain([q||0,Z||0]).range([W-P-F-(g||0),P]).nice();G&&G(_);const H=8,J=l.axisLeft(_).ticks(H);p&&p(J);const K=J.tickArguments()[0],Q=U.append("g").attr("class",Rt.lineChartYScaleGlobal).call(J).call(d||Gt),{width:$}=Et(Q);Q.attr("transform","translate("+(O+$)+", 0)");const tt=n&&n.length?n.length-1:I.reduce((t,e)=>{let{values:a}=e;return Math.max(t,a.length)},0)-1,et=l.scaleLinear().domain([0,tt]).range([O+$+(f||0),j-D]),at=l.axisBottom(et).tickFormat(t=>n&&n.length>0?n[t]:0).ticks(tt);if("number"==typeof X){const[t,e]=et.range();at.ticks(Math.round((e-t)/X)).tickSizeOuter(0)}if(h&&h(at),(t=>{let{svg:e,yScale:a,xScale:n,yTicksCount:r,lastIndex:l,drawGridX:o,drawGridY:i}=t;if(!i&&!o)return;const s=e.append("g").attr("class",Rt.lineChartGridGlobal),c=a.ticks(r);o&&s.append("g").selectAll("line").data(c).join("line").attr("class",Rt.lineChartGridLineX).attr("x1",()=>n(0)).attr("x2",()=>n(l)).attr("y1",t=>Math.round(a(t))).attr("y2",t=>Math.round(a(t))),i&&s.append("g").selectAll("line").data(Array.from({length:l+1},(t,e)=>e)).join("line").attr("class",Rt.lineChartGridLineY).attr("x1",(t,e)=>Math.round(n(e))).attr("x2",(t,e)=>Math.round(n(e))).attr("y1",()=>Math.round(a(c[0]))).attr("y2",()=>Math.round(a(c[c.length-1])))})({svg:U,yScale:_,xScale:et,yTicksCount:K,lastIndex:tt,drawGridY:C,drawGridX:x}),Array.isArray(n)&&n.length>0){const t=U.append("g").call(u||Gt).attr("class",Rt.lineChartXScaleGlobal).call(at),{height:e}=Et(t);t.attr("transform","translate(0, "+(W-Math.ceil(e)-F)+")")}const nt=l.line().defined(t=>null!==t).x((t,e)=>et(e)).y(t=>_(t)).curve(m||l.curveLinear);if(z&&z(nt),I.some(t=>{let{fill:e}=t;return e})){let t=-2;const e=e=>{const{minAreaValues:a}=e,n=_.ticks()[0];return l.area().defined(t=>null!==t).x((t,e)=>et(e)).y0((e,r)=>{0===r&&(t+=1);let l=n;a&&"number"==typeof a[r]?l=a[r]||l:a&&(l=_(l-e));const o=I[t];return _(L&&t>-1?"number"!=typeof o.values[r]?0:o.values[r]:l)}).y1(t=>_(t)).curve(R||m||l.curveLinear)};U.append("g").attr("class",Rt.lineChartAreasGlobal).selectAll("path").data(I.filter(t=>{let{fill:e}=t;return Boolean(e)})).join("path").attr("class",Rt.lineChartArea).attr("d",t=>e(t)(t.values)).attr("fill",t=>{let{fill:e}=t;return e||"none"}).attr("style",t=>{let{areaStyle:e}=t;return e||""})}U.append("g").attr("class",Rt.lineChartLinesGlobal).selectAll("path").data(I).join("path").attr("class",Rt.lineChartLine).attr("d",t=>nt(t.values)).attr("stroke",t=>{let{stroke:e}=t;return e||"steelblue"}).attr("style",t=>{let{style:e}=t;return e||""});const rt=I.filter(t=>{let{dot:e}=t;return e});if(rt.length>0){const t=U.append("g").attr("class",Rt.lineChartDotsGlobalContainer);rt.forEach(e=>{const{values:a,dot:n}=e,{radius:r,style:l,filter:o}=n,i=t.append("g").attr("class",Rt.lineChartDotsGlobal);i.selectAll("circle").data(a).join("circle").attr("cx",(t,e)=>et(e)).attr("class",Rt.lineChartDot).attr("cy",t=>_(t)).attr("r",r||0).attr("style",l||""),o&&i.selectAll("circle").select((t,a,n)=>o(e,a,n)?n[a]:null).remove()})}l.select(t).select(".d3-chart-label").remove(),y&&(t=>{let{node:e,data:a,yScale:n,xScale:i,formatLabel:s,eachLabel:c}=t;const d=l.select(e).append("div").attr("class","d3-chart-label"),u=l.format(",");a.forEach(t=>{let{values:e}=t;d.append("div").selectAll("div").data(e).join("div").attr("class",Rt.lineChartLabelContainer).style("position","absolute").style("left",(t,e)=>i(e)+"px").style("top",t=>n(t)+"px").html((t,e,a)=>o.renderToString(r.createElement(Ot,{className:Rt.lineChartLabelFlex},r.createElement(Vt,{className:Rt.lineChartLabel},s?s(t,e,a):u(t))))).each(c||Gt)})})({node:t,eachLabel:T,data:I,yScale:_,xScale:et,formatLabel:v}),S&&(t=>{let{svg:e,node:a,data:n,xScale:i,yScale:d,dynamicCircleRadius:u,formatDynamicTooltip:p,renderTooltip:h,stackedTooltipIndex:m,stackedTooltip:b,tooltipLineTop:f,tooltipRoot:g,tooltipClassName:C}=t;const x=g||document.querySelector("body"),y=l.format(","),v=n.filter(t=>{let{tooltipOff:e}=t;return!e}),T="number"==typeof m?[v[m]]:b?[v[0]]:v,[L,S]=i.range(),[k,M]=d.range(),A=e.append("g").attr("class",Rt.lineChartMouseGlobal),w=A.append("rect").attr("width",S-L).attr("height",Math.abs(k-M)).attr("class",Rt.lineChartMouseRect).attr("transform","translate("+L+", "+M+")"),N=A.append("path").attr("class",Rt.lineChartMouseLine).style("opacity","0"),B=e.selectAll("."+Rt.lineChartLine).nodes(),E=A.selectAll("circle").data(v.filter(t=>{let{dynamicDotOff:e}=t;return!e})).join("circle").attr("class",Rt.lineChartMouseCircle).attr("r",u).attr("fill",t=>{let{stroke:e}=t;return e||"none"}).attr("stroke",t=>{let{stroke:e}=t;return e||"none"}).style("opacity","0");let G=l.select("."+Rt.lineChartMouseLabelContainer);0===G.size()&&(G=l.select(x).append("div").attr("class",Rt.lineChartMouseLabelContainer));let z=null,Y=!1;const X=t=>{Y=Boolean(t);const e=Y?"1":"0";N.style("opacity",e),E.style("opacity",e),z&&z.style("opacity",e)},R=t=>{const[u,g]=l.pointer(t,document),[C]=l.pointer(t,w),[x,T]=l.pointer(t,a),L=C-(C-x),S=x+(u-x),A=Math.abs(i.invert(L)),G={},R=t=>zt(t[Math.floor(A+1)])?null:t[Math.floor(A)];B.forEach((t,e)=>{let a={x:0,y:0};if(!t.hasAttribute("d")||n[e].tooltipOff)return void(G[e]=a);let r=0,l=t.getTotalLength(),o=null;for(;o=Math.floor((r+l)/2),a=t.getPointAtLength(o),o!==l&&o!==r||a.x===L;)if(a.x>L)l=o;else{if(!(a.x<L))break;r=o}G[e]=a}),E.attr("transform",(t,e)=>{const a=R(t.values);return G[e]&&a?"translate("+L+","+G[e].y+")":"translate(-9999, -9999)"}).attr("style",t=>{let{dynamicDotStyle:e}=t;return e||""});const I=v.map((t,e)=>{let{values:a}=t;return s({},c(t,["values"]),{value:R(a),invertValue:G[e]?d.invert(G[e].y):0})}),P=I.every(t=>{let{value:e}=t;return zt(e)});P&&Y?X():Y||P||X(!0);const D=Object.keys(G).reduce((t,e,a)=>{var r,l;const o=null==(r=I[Number(t)])?void 0:r.value,i=null==(l=I[Number(e)])?void 0:l.value,s=null==n?void 0:n[a].dynamicDotOff;return 0===a||zt(i)||s?t:zt(o)||G[t].y>G[e].y?e:t},"0"),F=z&&z.style("left",S+"px").style("top",(t,e)=>{const a="number"==typeof m?m:b?D:e;return(G[a]&&G[a].y+(g-T))+"px"}).select("."+Rt.lineChartLabel);h&&z?z.html((a,n)=>o.renderToString(r.createElement(Ot,{className:Rt.lineChartLabelFlex},h(I,{indexX:Math.round(A),indexY:n,svg:e,event:t})))):F&&F.text((t,e)=>{const a=I[e].invertValue;return p?p(a,I[e].value):y(a)}),N.attr("d",()=>{var t;let e="M"+L+","+k;return e+=" "+L+","+(f?M:(null==(t=G[D])?void 0:t.y)||0),e})};w.on("mouseover.tooltip",t=>{z=G.selectAll("div").data(T).join("div").attr("class",Rt.lineChartMouseLabel+" "+(C||"")).style("opacity","0").style("position","absolute").html(()=>o.renderToString(r.createElement(Ot,{className:Rt.lineChartLabelFlex},r.createElement(Vt,{className:Rt.lineChartLabel})))),R(t)}),w.on("mouseout.tooltip",()=>{l.select("."+Rt.lineChartMouseLabelContainer).selectAll("*").remove(),X()}),w.on("touchmove.tooltip mousemove.tooltip",R)})({tooltipLineTop:B,stackedTooltip:w,renderTooltip:A,stackedTooltipIndex:N,formatDynamicTooltip:M,node:t,svg:U,data:I,xScale:et,yScale:_,dynamicCircleRadius:k,tooltipClassName:Y}),E&&E({svg:U,yScale:_,xScale:et})}},Wt=t=>{const{className:e,style:a,children:l}=t,[o,i]=h();return n.useEffect(()=>{i&&jt(i,t)},[i,t]),m(t.width,()=>jt(i,t)),r.createElement("div",{className:e,style:a},r.createElement(Pt,null),r.createElement(It,{ref:o},l))};Wt.defaultProps={data:[],labels:[],height:240,yAxisPadding:10,xAxisPadding:20,margin:{top:10,right:10,bottom:10,left:0},dynamicCircleRadius:4,stackedTooltip:!1};const qt={barChartLinesGlobal:"barChartLinesGlobal",barChartLine:"barChartLine",barChartAreasGlobal:"barChartAreasGlobal",barChartArea:"barChartArea"};function Zt(){const t=d(["\n ."," {\n z-index: 1;\n transition: all linear 144ms;\n\n ."," {\n margin-bottom: 4px;\n :last-of-type {\n margin-bottom: 0;\n }\n }\n }\n"]);return Zt=function(){return t},t}function Ut(){const t=d(["\n line {\n stroke-width: 1px;\n shape-rendering: crispEdges;\n }\n .",",\n ."," {\n stroke: rgba(48, 69, 79, 0.06);\n }\n ."," {\n }\n ."," {\n fill: none;\n pointer-events: all;\n }\n ."," {\n stroke-width: 1.5px;\n stroke-linejoin: round;\n stroke-linecap: round;\n }\n ."," {\n shape-rendering: auto;\n }\n ."," {\n fill-opacity: 0.24;\n }\n"]);return Ut=function(){return t},t}const _t=s({barChartBarGlobal:"barChartBarGlobal",barChartYScaleGlobal:"barChartYScaleGlobal",barChartYAxis:"barChartYAxis",barChartXAxis:"barChartXAxis",barChartYAxisZeroTick:"barChartYAxisZeroTick",barChartGridGlobal:"barChartGridGlobal",barChartGridLineX:"barChartGridLineX",barChartGridLineXZero:"barChartGridLineXZero",barChartGridLineYZero:"barChartGridLineYZero",barChartGridLineY:"barChartGridLineY"},{barChartMouseRect:"barChartMouseRect",barChartMouseContainer:"barChartMouseContainer",barChartTooltipFlex:"barChartTooltipFlex",barChartMouseTooltip:"barChartMouseTooltip",barChartTooltip:"barChartTooltip",barChartTooltipItem:"barChartTooltipItem",barChartTooltipColFlex:"barChartTooltipColFlex",barChartTooltipGroupName:"barChartTooltipGroupName",barChartColorBox:"barChartColorBox",barChartColorLine:"barChartColorLine",barChartTooltipName:"barChartTooltipName",barChartTooltipValue:"barChartTooltipValue"},{barChartLabelContainer:"barChartLabelContainer",barChartLabelFlex:"barChartLabelFlex",barChartLabel:"barChartLabel"},qt),Ht=a(p)(Ut(),_t.barChartGridLineX,_t.barChartGridLineY,_t.barChartMouseRect,_t.barChartMouseRect,_t.barChartLinesGlobal,_t.barChartLine,_t.barChartArea),Jt=e.createGlobalStyle(Zt(),_t.barChartMouseTooltip,_t.barChartTooltipItem),Kt=(t,e)=>{const{data:a,lineData:n=[],barWidth:i,barPadding:d,colors:u,margin:p,xAxisPadding:h,yAxisPadding:m,drawGridY:f,drawGridX:g,customYScale:C,customXScale:x,customYAxisLeft:y,customXAxisBottom:v,customYAxis:T,customXAxis:L,customBars:S,customize:k,dynamicTooltipEnable:M,renderTooltip:A,labelPosition:w,renderLabel:N,tooltipY:B,tooltipBind:E,stackedLine:G,curve:z,formatTooltipValue:Y,formatTooltipName:X,sectionPadding:R,minValuesLine:I,tooltipYDomain:P,marshalledMap:D,minValue:F,maxValue:O,minDomainValue:V,maxDomainValue:j,drawBars:W,setTooltipPosition:q,onLabelItem:Z,isBarTooltip:U,xScaleItemWidth:_,tooltipRoot:H,tooltipClassName:J}=e;if(null!==t&&a.length){const K=p?p.top:0,Q=p?p.right:0,$=p?p.bottom:0,tt=p?p.left:0,et=12,{width:at}=t.getBoundingClientRect(),nt=e.width||at,rt=e.height||0,lt=(t=>{let{data:e,minDomainValue:a,maxDomainValue:n}=t,r=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;return e.forEach(t=>{let e=c(t,["groupName"]),a=0,n=0;Object.keys(e).forEach(t=>{const r=e[t];let l=0,o=0;Object.keys(r).forEach(t=>{const e=r[t];e>0?l+=e:o+=e}),a=Math.min(a,o),n=Math.max(n,l)}),r=Math.min(r,a),l=Math.max(l,n)}),0===r&&0===l?{min:"number"==typeof a?a:0,max:"number"==typeof n?n:1}:{min:"number"==typeof a?a:r,max:"number"==typeof n?n:l}})({data:a,minDomainValue:V,maxDomainValue:j}),ot="number"==typeof F?F:Math.min(l.min(n,t=>{let{values:e}=t;return l.min(e)})||Number.POSITIVE_INFINITY,lt.min||0),it="number"==typeof O?O:Math.max(l.max(n,t=>{let{values:e}=t;return l.max(e)})||Number.NEGATIVE_INFINITY,lt.max),Tt=b(t,nt,rt||0),Lt=6,St=a.map(t=>t.groupName);let kt=i||et;const Mt=l.scaleLinear().domain([ot,it]).range([rt-K-$-(h||0),K]).nice();C&&C(Mt);const At=Mt.ticks(),wt=l.axisLeft(Mt).ticks(Lt);y&&y(wt);const Nt=wt.tickArguments()[0],Bt=Tt.append("g").attr("class",_t.barChartYAxis).call(wt);Bt.selectAll(".tick").attr("class",t=>0===t?"tick "+_t.barChartYAxisZeroTick:"tick"),T&&T(Bt);const{width:Gt}=Et(Bt),zt=[tt+Gt+(m||0),nt-Q],Yt=l.scaleBand().domain(l.range(a.length)).range(zt);kt=(t=>{let{data:e,range:a,barWidth:n,barPadding:r,sectionPadding:l}=t;const o="number"==typeof l?l:0,i=a[1]-a[0],s=e.reduce((t,e)=>{let a=c(e,["groupName"]);return t+Object.keys(a).reduce((t,e,a)=>a>0?t+(n||0)+(r||0):t+n,0)+o},o);return i<s?Math.floor(n*(i/s)):n})({data:a,sectionPadding:R,range:zt,barWidth:kt,barPadding:d}),x&&x(Yt);const[Xt,Rt]=Yt.range(),It=l.axisBottom(Yt).tickFormat(t=>St[Number(t)]);"number"==typeof _&&It.tickValues(Yt.domain().filter((t,e,a)=>{const n=Math.round((Rt-Xt)/_);return!(e%Math.round(a.length/n))})).tickSizeOuter(0),v&&v(It,{node:t,labels:St});const Pt=Tt.append("g").call(It).attr("class",_t.barChartXAxis);L&&L(Pt);const Dt=(t=>{let{data:e,yScale:a,xScale:n,barWidth:r,barPadding:l,colors:o,marginTop:i}=t;return e.map((t,e)=>{let{groupName:s}=t,d=c(t,["groupName"]);const u=[],p=n.bandwidth(),h=Object.keys(d);return h.forEach((t,n)=>{const c=d[t],m=Object.keys(c),b=(r+l)*h.length-(m.length>1?l:0);let f=0,g=0;m.forEach(t=>{const d=c[t],h=o[t],m=(r+l)*n+p/2-b/2,C=d>0,x=C?Math.abs(100*(a(f-d)-a(f)+Number.EPSILON)/100):Math.abs(100*(a(g-d)-a(g)+Number.EPSILON)/100);C&&(f+=d);const y=C?100*(a(f)+Number.EPSILON)/100:a(g)-a(0)+a(0);u.push({x:m,y:y+(i||0),height:x,color:h,value:d,groupName:s,name:t,stackIndex:n,groupIndex:e}),C||(g+=d)})}),u})})({data:a,yScale:Mt,xScale:Yt,barWidth:kt,barPadding:"number"==typeof d?d:0,colors:u,marginTop:K}),Ft=D?D(Dt):Dt;Bt.attr("transform","translate( "+(tt+Gt)+", 0)"),(t=>{let{svg:e,yScale:a,xScale:n,yTicksCount:r,drawGridX:l,drawGridY:o}=t;if(!o&&!l)return;const i=e.append("g").attr("class",_t.barChartGridGlobal),s=a.ticks(r),c=n.range(),d=n.domain();if(l&&i.append("g").selectAll("line").data(s).join("line").attr("class",t=>0===t?_t.barChartGridLineX+" "+_t.barChartGridLineXZero:_t.barChartGridLineX).attr("x1",()=>c[0]).attr("x2",()=>c[1]).attr("y1",t=>Math.round(a(t))).attr("y2",t=>Math.round(a(t))),o){const t=t=>void 0!==d[t]?0===t?c[0]:Math.round(n.step()*t+c[0]-n.step()/2*n.padding()):c[1];i.append("g").selectAll("line").data(Array.from({length:d.length+1},(t,e)=>e)).join("line").attr("class",t=>0===t?_t.barChartGridLineY+" "+_t.barChartGridLineYZero:_t.barChartGridLineY).attr("x1",t).attr("x2",t).attr("y1",()=>Math.round(a(s[0]))).attr("y2",()=>Math.round(a(s[s.length-1])))}})({svg:Tt,yScale:Mt,xScale:Yt,yTicksCount:Nt,drawGridY:f,drawGridX:g}),Pt.attr("transform","translate(0, "+(Mt(At[0])+(h||0))+")");const Ot=Tt.append("g").attr("class",_t.barChartBarGlobal).selectAll("g").data(Ft).enter().append("g").attr("transform",(t,e)=>"translate("+Math.round(Yt(e.toString()))+","+-(K||0)+")"),Vt=W?W({groups:Ot,yScale:Mt,marshalledData:Ft,barWidth:kt}):(t=>{let{groups:e,barWidth:a}=t;return e.selectAll("rect").data(t=>t).join("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",a).attr("height",t=>t.height).style("fill",t=>t.color)})({groups:Ot,barWidth:kt});let jt=null;Array.isArray(n)&&n.length>0&&(jt=(t=>{let{svg:e,lineData:a,min:n,yScale:r,xScale:o,curve:i,stackedLine:s}=t,c=null,d=null,u=null;const p=l.line().defined(t=>null!==t).x((t,e)=>o(e.toString())+h/2).y(t=>r(t)).curve(i||l.curveLinear),h=o.bandwidth(),m=a.filter(t=>{let{lineType:e}=t;return"line"===e}),b=a.filter(t=>{let{lineType:e}=t;return"area"===e});if(m.length>0&&(c=e.append("g").attr("class",qt.barChartLinesGlobal).selectAll("path").data(m).join("path").attr("class",qt.barChartLine).attr("d",t=>p(t.values)).attr("stroke",t=>{let{stroke:e}=t;return e||""}).attr("fill",t=>{let{fill:e}=t;return e||"none"})),b.length>0){let t=-2;u=l.area().x((t,e)=>o(e.toString())+h/2).y0((e,l)=>(0===l&&(t+=1),r(s&&t>-1?"number"!=typeof a[t].values[l]?0:a[t].values[l]:n))).y1(t=>r(t)).curve(i||l.curveLinear),d=e.append("g").attr("class",qt.barChartAreasGlobal).selectAll("path").data(b).join("path").attr("class",qt.barChartArea).attr("d",t=>u&&u(t.values)).attr("fill",t=>{let{fill:e}=t;return e||"none"})}return{areasSelection:d,linesSelection:c,area:u}})({svg:Tt,lineData:n,xScale:Yt,yScale:Mt,min:"number"==typeof I?I:ot,stackedLine:G,curve:z})),S&&S({bars:Vt,yScale:Mt,lines:jt,marshalledData:Ft,lineData:n}),(M||w)&&(t=>{let{svg:e,node:a,data:n,marshalledData:i,xScale:d,yScale:u,renderTooltip:p,labelPosition:h,marginTop:m,renderLabel:b,barWidth:f,barPadding:g,dynamicTooltipEnable:C,tooltipY:x,tooltipBind:y,lineData:v,formatTooltipValue:T,formatTooltipName:L,tooltipYDomain:S,setTooltipPosition:k,onLabelItem:M,isBarTooltip:A,bars:w,tooltipRoot:N,tooltipClassName:B}=t;l.select(a).select("."+_t.barChartMouseContainer).remove();const E=d.domain(),[G,z]=d.range(),[Y,X]=u.range(),R=d.bandwidth(),I=l.format(","),P=E.map(t=>{return e=Number(t)+1,void 0!==E[e]?0===e?G:Math.round(d.step()*e+G-d.step()/2*d.padding()):z;var e}),D=S?S({data:i,lineData:v,yScale:u}):i.reduce((t,e,a)=>{const n=l.min(v,t=>{let{values:e}=t;return"number"==typeof e[a]?u((e[a]||0)-X):Number.POSITIVE_INFINITY})||Number.POSITIVE_INFINITY;return t.push(e.reduce((t,e)=>{let{y:a}=e;return Math.min(t,a,n)},Number.POSITIVE_INFINITY)),t},[]),F=e.append("g").attr("class","lineChartMouseGlobal").append("rect").attr("width",z-G).attr("height",Math.abs(Y-X)).attr("class",_t.barChartMouseRect).attr("transform","translate("+G+", "+X+")");if(C){const t=N||document.querySelector("body");let u=l.select("."+_t.barChartMouseTooltip);0===u.size()&&(u=l.select(t).append("div").attr("class",_t.barChartMouseTooltip).style("opacity","0").style("position","absolute").html(()=>o.renderToString(r.createElement(st,{className:_t.barChartTooltipFlex}))));const h=u.select("."+_t.barChartTooltipFlex);let m=!1,b=null;const g=t=>{m=Boolean(t),u.style("opacity",m?"1":"0"),m?(u.attr("class",_t.barChartMouseTooltip+" "+(B||"")),u.style("transition",null)):(u.attr("class",_t.barChartMouseTooltip),b=null,u.style("transition","none"),u.style("top",null),u.style("left",null))};F.on("mouseout.tooltip",()=>g()),F.on("touchmove.tooltip mousemove.tooltip",t=>{const[C,S]=l.pointer(t,document),[M]=l.pointer(t,F),[N,B]=l.pointer(t,a),E=M-(M-N),G=C-N,z=S-B,Y=P.findIndex(t=>E<=t);if(A){const e=document.elementsFromPoint(t.clientX,t.clientY),a=l.select(w.nodes()[Y]).selectAll("rect").nodes();if(!e.some(t=>a.includes(t)))return m&&g(!1),void F.style("cursor","default");F.style("cursor","pointer")}const O=("number"==typeof x?x:D[Y]-X)+z,V=(y?(d(Y.toString())||0)+R/2:E)+G;if(y&&b===Y)return;let j=i[Y];if(Array.isArray(j)&&0===j.length)return;if(v){const t=v.map(t=>{let{values:e}=t;return s({},c(t,["values"]),{value:e[Y],groupName:n[Y]&&n[Y].groupName})});Array.isArray(t)&&Array.isArray(j)&&(j=j.concat(t))}const W=e.node().getBoundingClientRect().width;"function"==typeof k?k({left:V,top:O,tooltip:u,svgWidth:W}):k||u.style("left",V+"px").style("top",O+"px"),p?h.html(()=>o.renderToString(r.createElement(r.Fragment,null,p(j,k?{left:V,top:O,tooltip:u,svgWidth:W}:void 0,f)))):(m||g(!0),h.html(()=>o.renderToString(r.createElement(ut,{className:_t.barChartTooltip},j&&j[0]&&r.createElement(pt,{className:_t.barChartTooltipGroupName},j[0].groupName),j&&j.map(t=>{let{name:e,value:a,stroke:n,fill:l,color:o,lineType:i}=t;return r.createElement(ht,{key:e,className:_t.barChartTooltipItem},r.createElement(mt,{className:_t.barChartTooltipColFlex},i?r.createElement(ft,{className:_t.barChartColorLine,style:{backgroundColor:n||l}}):r.createElement(bt,{className:_t.barChartColorBox,style:{backgroundColor:o}}),r.createElement(gt,{className:_t.barChartTooltipName},L?L(e):e)),r.createElement(Ct,{className:_t.barChartTooltipValue},T?T(a):I(a)))}))))),b=Y,m||g(!0)})}const O=l.select(a).append("div").attr("class",_t.barChartMouseContainer).append("div").attr("class",_t.barChartLabelContainer).style("position","absolute").style("top",X+"px");if(h){const t=v?i.map((t,e)=>t.concat(v.map(a=>{let{values:n,name:r,stroke:l}=a;const{stacksCount:o}=t.reduce((t,e)=>{let{stackIndex:a}=e;const{indexFlag:n,stacksCount:r}=t;return a!==n?{indexFlag:a,stacksCount:r+1}:t},{indexFlag:-1,stacksCount:0});return{x:t[0].x-f/2+(f*o+(g||0)*(o-1))/2,y:u(n[e])+m,height:0,color:l,value:n[e],groupName:t[0].groupName,name:r,stackIndex:0,groupIndex:e}}))):i,e=O.selectAll("div").data(t).enter().append("div").style("position","absolute").style("transform",(t,e)=>"translate("+Math.round(d(e.toString()))+"px,"+-(m||0)+"px)"),a="center"===h?dt:ct,n=(t=>{switch(t){case"top":return yt;case"bottom":return vt;default:return xt}})(h);e.selectAll("span").data(t=>M?M(t):t).join("div").style("left",t=>Math.round(t.x+f/2)+"px").style("top",t=>((t,e,a)=>{switch(t){case"center":return a.y+a.height/2-e;case"bottom":return a.y+a.height-e;default:return a.y}})(h,X,t)+"px").style("position","absolute").html(t=>o.renderToString(r.createElement(a,{className:_t.barChartLabelFlex},b?b(s({},t,{barWidth:f})):r.createElement(n,{className:_t.barChartLabel},I(t.value)))))}})({svg:Tt,node:t,xScale:Yt,yScale:Mt,marshalledData:Ft,data:a,lineData:n,renderTooltip:A,labelPosition:w,marginTop:K,renderLabel:N,barWidth:kt,barPadding:d,dynamicTooltipEnable:M,tooltipY:B,tooltipBind:E,formatTooltipValue:Y,formatTooltipName:X,tooltipYDomain:P,setTooltipPosition:q,onLabelItem:Z,isBarTooltip:U,bars:Ot,tooltipRoot:H,tooltipClassName:J}),k&&k({svg:Tt,marshalledData:Ft,yScale:Mt,xScale:Yt,lineData:n})}},Qt=t=>{const{className:e,style:a,children:l}=t,[o,i]=h();return n.useEffect(()=>{i&&Kt(i,t)},[i,t]),m(t.width,()=>Kt(i,t)),r.createElement("div",{className:e,style:a},r.createElement(Jt,null),r.createElement(Ht,{ref:o},l))};function $t(){const t=d(["\n position: absolute;\n top: 0;\n display: flex;\n justify-content: flex-start;\n height: 100%;\n"]);return $t=function(){return t},t}function te(){const t=d(["\n white-space: nowrap;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(0, -50%);\n"]);return te=function(){return t},t}function ee(){const t=d(["\n position: relative;\n"]);return ee=function(){return t},t}function ae(){const t=d(["\n position: absolute;\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n will-change: left, top;\n"]);return ae=function(){return t},t}function ne(){const t=d(["\n width: 100%;\n position: relative;\n vertical-align: middle;\n"]);return ne=function(){return t},t}function re(){const t=d(["\n width: 100%;\n display: flex;\n height: 1rem;\n"]);return re=function(){return t},t}function le(){const t=d(["\n text-align: right;\n"]);return le=function(){return t},t}function oe(){const t=d(["\n width: 100%;\n"]);return oe=function(){return t},t}Qt.defaultProps={data:[],colors:{},margin:{top:10,right:10,bottom:10,left:0},barWidth:12,barPadding:0,height:320,yAxisPadding:0,xAxisPadding:0,tooltipBind:!0,sectionPadding:1};const ie={horizontalBarChartButtonTd:"horizontalBarChartButtonTd",horizontalBarChartLabelTd:"horizontalBarChartLabelTd",horizontalBarChartLabelCell:"horizontalBarChartLabelCell",horizontalBarChartBarTd:"horizontalBarChartBarTd",horizontalBarChartBarFlex:"horizontalBarChartBarFlex",horizontalBarChartBar:"horizontalBarChartBar",horizontalBarChartBarFirst:"horizontalBarChartBarFirst",horizontalBarChartBarLast:"horizontalBarChartBarLast",horizontalBarChartBarOnly:"horizontalBarChartBarOnly",horizontalBarChartTooltipFlex:"horizontalBarChartTooltipFlex",horizontalBarChartStackWrapper:"horizontalBarChartStackWrapper",horizontalBarChartTooltipContainer:"horizontalBarChartTooltipContainer",horizontalBarChartStackSumContainer:"horizontalBarChartStackSumContainer",horizontalBarChartStackSum:"horizontalBarChartStackSum",horizontalBarChartXScaleTd:"horizontalBarChartXScaleTd",horizontalBarChartXScaleTicks:"horizontalBarChartXScaleTicks",horizontalBarChartXScaleTick:"horizontalBarChartXScaleTick",horizontalBarChartTooltipItem:"horizontalBarChartTooltipItem",horizontalBarChartTooltipName:"horizontalBarChartTooltipName",horizontalBarChartTooltipValue:"horizontalBarChartTooltipValue"},se=a.table(oe()),ce=a.div(le()),de=a.div(re()),ue=a.td(ne()),pe=a(st)(ae()),he=a.div(ee()),me=a.div(te()),be=a.div($t()),fe=t=>{let{renderTooltip:e,bars:a,style:n,className:o}=t;const i=l.format(",");return r.createElement(pe,{className:ie.horizontalBarChartTooltipFlex+" "+(o||""),style:n},r.createElement(ut,{className:ie.horizontalBarChartTooltipContainer},e?e(a):a.map((t,e)=>{let{color:a,name:n,value:l,groupName:o}=t;return r.createElement(ht,{key:(n||"")+"-"+e+"-"+o,className:ie.horizontalBarChartTooltipItem},a&&r.createElement(bt,{style:{backgroundColor:a}}),n&&r.createElement(gt,{className:ie.horizontalBarChartTooltipName},n),r.createElement(Ct,{className:ie.horizontalBarChartTooltipValue},i(l)))})))},ge=document.createElement("div");function Ce(){const t=d(["\n position: relative;\n display: inline-flex;\n height: 100%;\n"]);return Ce=function(){return t},t}const xe=a.div(Ce()),ye=t=>{let{withTooltip:e,bar:a,formatNativeTitle:n,tooltipBind:l,mouseMove:o,mouseLeave:i,pointerEventsNone:s,isFirstChild:c,isLastChild:d,isOnlyChild:u}=t;const{color:p,width:h}=a,m=Math.abs(h),b=e?t=>o(t,[a]):void 0,f=e?()=>i():void 0;return r.createElement(xe,{className:ie.horizontalBarChartBar+" "+(c?ie.horizontalBarChartBarFirst:"")+" "+(d?ie.horizontalBarChartBarLast:"")+" "+(u?ie.horizontalBarChartBarOnly:""),style:{width:m+"%",backgroundColor:p,pointerEvents:s?"none":"auto"},title:n?n(a):"",onMouseOver:b,onMouseMove:l?b:void 0,onMouseOut:f})};function ve(){const t=d(["\n white-space: nowrap;\n width: 0;\n height: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n"]);return ve=function(){return t},t}function Te(){const t=d(["\n position: relative;\n height: 1rem;\n"]);return Te=function(){return t},t}function Le(){const t=d(["\n position: relative;\n"]);return Le=function(){return t},t}const Se=a.td(Le()),ke=a.div(Te()),Me=a.div(ve()),Ae=t=>{let{maxValue:e,scaleTicks:a,renderTicks:o,scaleDomain:i}=t;const s=(t=>{let{maxValue:e,scaleTicks:a,scaleDomain:r}=t;return n.useMemo(()=>{const t=l.scaleLinear().domain([0,e]).range([0,100]),n=t.ticks(a);return(r||n).map(e=>({value:e,x:t(e)}))},[e,a,r])})({maxValue:e,scaleTicks:a,scaleDomain:i}),c=l.format(",");return r.createElement("tr",null,r.createElement("td",null),r.createElement(Se,{className:ie.horizontalBarChartXScaleTd},r.createElement(ke,{className:ie.horizontalBarChartXScaleTicks},s.map((t,e,a)=>{const{value:n,x:l}=t;return r.createElement(Me,{key:n,className:ie.horizontalBarChartXScaleTick,style:{left:l+"%",justifyContent:0===e?"flex-start":e===a.length-1?"flex-end":""}},o?o(t):c(n))}))))},we=t=>{let{data:e,className:a,style:o,children:d,labels:u,fullExtent:p,maxValue:h,formatNativeTitle:m,renderTooltip:b,withTooltip:f,withStackSum:g,tooltipBind:C,scaleTicks:x,renderTicks:y,renderButton:v,tooltipStyle:T,tooltipClassName:L,scaleDomain:S,renderDataTable:k,thead:M,withoutXScale:A,stackedTooltip:w,fullChartTooltip:N,hideTooltip:B}=t;const{fullMax:E,data:G}=(t=>{let{data:e,fullExtent:a,maxValue:r,labels:o}=t;return n.useMemo(()=>{const t=l.max(e,t=>l.sum(t,t=>{let{value:e}=t;return e})),n=l.scaleLinear().domain([0,"number"==typeof r?r:t]).range([0,100]);return{fullMax:t,data:e.map((t,e)=>(a||n.domain([0,"number"==typeof r?r:l.sum(t,t=>{let{value:e}=t;return e})]),t.map(t=>{let{value:a}=t;return s({},c(t,["value"]),{value:a,width:n(a),groupName:o?o[e]:""})})))}},[e,a,r,o])})({data:e,fullExtent:p,maxValue:h,labels:u}),[z,Y]=(t=>{let{renderTooltip:e,tooltipBind:a,tooltipStyle:o,tooltipRoot:c,tooltipClassName:d,hideTooltip:u}=t;return n.useEffect(()=>{const t=c||document.querySelector("body");return t&&t.appendChild(ge),()=>{i.unmountComponentAtNode(ge)}},[c]),[n.useCallback((t,n)=>{let[c,u]=l.pointer(t,document);if(!a&&"getBoundingClientRect"in t.target){const{width:e,height:a}=t.target.getBoundingClientRect(),[n,r]=l.pointer(t,t.target);c=c-n+e/2,u=u-r+a/2}ge&&(ge.style.visibility="visible"),i.render(r.createElement(fe,{style:s({left:c,top:u},o),bars:n,renderTooltip:e,className:d}),ge)},[d,o,e,a]),n.useCallback(()=>{ge&&(ge.style.visibility="hidden",u&&u())},[u])]})({renderTooltip:b,tooltipBind:C,tooltipStyle:T,tooltipClassName:L,hideTooltip:B}),X=(t=>n.useMemo(()=>t?t=>{let{item:e,mouseMove:a,mouseLeave:n,tooltipBind:l}=t,o=c(t,["item","mouseMove","mouseLeave","tooltipBind"]);return r.createElement(be,Object.assign({className:ie.horizontalBarChartStackWrapper,onMouseOver:t=>a(t,e),onMouseMove:l?t=>a(t,e):void 0,onMouseOut:n},o))}:t=>{let{children:e}=t;return r.createElement(n.Fragment,null,e)},[t]))(w);return r.createElement(se,{className:a,style:o,onMouseOver:N?t=>z(t,G.flat()):void 0,onMouseMove:N?t=>z(t,G.flat()):void 0,onMouseOut:N?Y:void 0},M,r.createElement("tbody",null,G.map((t,e)=>{const a=(g||k)&&l.sum(t,t=>{let{value:e}=t;return e}),n=l.sum(t,t=>{let{width:e}=t;return e});return r.createElement("tr",{key:"row-"+e},"function"==typeof v&&r.createElement("td",{className:ie.horizontalBarChartButtonTd},v(t,e)),r.createElement("td",{className:ie.horizontalBarChartLabelTd},u&&u[e]&&r.createElement(ce,{className:ie.horizontalBarChartLabelCell},u[e])),r.createElement(ue,{className:ie.horizontalBarChartBarTd,style:{pointerEvents:N?"none":"auto"}},r.createElement(de,{className:ie.horizontalBarChartBarFlex,style:{pointerEvents:N?"none":"auto"}},r.createElement(X,{style:w?{width:n+"%"}:void 0,item:t,tooltipBind:C,mouseMove:z,mouseLeave:Y}),t.map((t,e,a)=>0!==t.value&&r.createElement(ye,{key:"bar-"+(t.name||"")+"-"+e,formatNativeTitle:m,bar:t,tooltipBind:C,pointerEventsNone:w||N,withTooltip:f&&!w,mouseMove:z,mouseLeave:Y,isOnlyChild:1===a.length,isFirstChild:0===e&&a.length>1,isLastChild:a.length-1===e&&a.length>1})),g&&r.createElement(he,{className:ie.horizontalBarChartStackSumContainer},r.createElement(me,{className:ie.horizontalBarChartStackSum},a)))),k&&k(t,a,e))}),!A&&r.createElement(Ae,{maxValue:"number"==typeof h?h:E,scaleTicks:x,renderTicks:y,scaleDomain:S}),d))};function Ne(){const t=d(["\n ."," {\n position: absolute;\n transition: opacity 150ms cubic-bezier(0.2, 1, 0.6, 1);\n pointer-events: none;\n z-index: 1;\n }\n"]);return Ne=function(){return t},t}function Be(){const t=d(["\n .",",\n .",",\n ."," {\n shape-rendering: crispEdges;\n }\n\n .",",\n ."," {\n stroke: rgba(149, 149, 149, 0.24);\n }\n\n ."," {\n font-size: 10px;\n }\n"]);return Be=function(){return t},t}we.defaultProps={fullExtent:!0,withTooltip:!1,withStackSum:!1,tooltipBind:!1,scaleTicks:4,withoutXScale:!1};const Ee={bubbleChartYAxis:"bubbleChartYAxis",bubbleChartYAxisZeroTick:"bubbleChartYAxisZeroTick",bubbleChartXAxis:"bubbleChartXAxis",bubbleChartGridGlobal:"bubbleChartGridGlobal",bubbleChartGridLineX:"bubbleChartGridLineX",bubbleChartGridLineY:"bubbleChartGridLineY",bubbleChartCircle:"bubbleChartCircle",bubbleChartYScaleLabel:"bubbleChartYScaleLabel",bubbleChartTooltip:"bubbleChartTooltip",bubbleChartTooltipContainer:"bubbleChartTooltipContainer",bubbleChartTooltipFlex:"bubbleChartTooltipFlex",bubbleChartTip:"bubbleChartTip"},Ge=a(p)(Be(),Ee.bubbleChartYAxis,Ee.bubbleChartXAxis,Ee.bubbleChartGridGlobal,Ee.bubbleChartGridLineX,Ee.bubbleChartGridLineY,Ee.bubbleChartYScaleLabel),ze=e.createGlobalStyle(Ne(),Ee.bubbleChartTooltipContainer);function Ye(){const t=d(["\n width: 0;\n height: 0;\n display: flex;\n align-items: flex-end;\n justify-content: center;\n font-size: 12px;\n white-space: nowrap;\n"]);return Ye=function(){return t},t}const Xe=a.div(Ye()),Re=(t,e)=>{const{data:a,margin:n,xAxisPadding:i,yAxisPadding:s,customYScale:c,customYAxis:d,customXScale:u,customXAxis:p,minSize:h,maxSize:m,minYValue:f,maxYValue:g,drawGridY:C,drawGridX:x,xScaleItemWidth:y,bubbleStyle:v,customize:T,yScaleLabel:L,yScaleLabelPadding:S,enableTooltip:k,tooltipRoot:M,tooltipClassName:A,renderTooltip:w}=e;if(null!==t&&a.length){const N=n?n.top:0,B=n?n.right:0,E=n?n.bottom:0,G=n?n.left:0,{width:z}=t.getBoundingClientRect(),Y=e.width||z,X=e.height||0,R=6,I="number"==typeof f?f:l.min(a,t=>{let{yValue:e}=t;return e}),P="number"==typeof g?g:l.max(a,t=>{let{yValue:e}=t;return e}),D=b(t,Y,X||0),F=l.scaleLinear().domain([l.min(a,t=>{let{sizeValue:e}=t;return e}),l.max(a,t=>{let{sizeValue:e}=t;return e})]).range([h||Pe.minSize,m||Pe.maxSize]),O=X-N-E-(i||0),V=l.scaleLinear().domain([I,P]).range([O,N]).nice();c&&c(V);const j=V.ticks(),W=l.axisLeft(V).ticks(R),q=W.tickArguments()[0],Z=D.append("g").attr("class",Ee.bubbleChartYAxis).call(W);let U=S||0;if(L){const t=D.append("text").text(L).attr("class",Ee.bubbleChartYScaleLabel),{width:e,height:a}=Et(t);U+=a,t.attr("transform","rotate(-90) translate(-"+(O+E+e)/2+", "+a+")")}Z.selectAll(".tick").attr("class",t=>0===t?"tick "+Ee.bubbleChartYAxisZeroTick:"tick"),d&&d(Z);const{width:_}=Et(Z),H=[G+_+(s||0)+U,Y-B],J=l.scaleLinear().domain([l.min(a,t=>{let{xValue:e}=t;return e}),l.max(a,t=>{let{xValue:e}=t;return e})]).range(H);u&&u(J);const K=l.axisBottom(J);if("number"==typeof y){const[t,e]=J.range();K.ticks(Math.round((e-t)/y)).tickSizeOuter(0)}const Q=D.append("g").call(K).attr("class",Ee.bubbleChartXAxis);p&&p(Q),Z.attr("transform","translate("+(G+_+U)+", 0)"),(t=>{let{svg:e,yScale:a,xScale:n,yTicksCount:r,drawGridX:l,drawGridY:o}=t;if(!o&&!l)return;const[i,s]=n.domain(),c=e.append("g").attr("class",Ee.bubbleChartGridGlobal),d=a.ticks(r);l&&c.append("g").selectAll("line").data(d).join("line").attr("class",Ee.bubbleChartGridLineX).attr("x1",()=>n(i)).attr("x2",()=>n(s)).attr("y1",t=>Math.round(a(t))).attr("y2",t=>Math.round(a(t))),o&&c.append("g").selectAll("line").data(n.ticks(r)).join("line").attr("class",Ee.bubbleChartGridLineY).attr("x1",t=>Math.round(n(t))).attr("x2",t=>Math.round(n(t))).attr("y1",()=>Math.round(a(d[0]))).attr("y2",()=>Math.round(a(d[d.length-1])))})({svg:D,yScale:V,xScale:J,yTicksCount:q,drawGridY:C,drawGridX:x}),Q.attr("transform","translate(0, "+(V(j[0])+(i||0))+")");const $=D.append("g").selectAll("dot").data(a).enter().append("circle").attr("class",Ee.bubbleChartCircle).attr("cx",t=>{let{xValue:e}=t;return J(e)}).attr("cy",t=>{let{yValue:e}=t;return V(e)}).attr("r",t=>{let{sizeValue:e}=t;return F(e)/2}).attr("fill",t=>{let{color:e}=t;return e||"rgba(0, 176, 113, 0.6)"}).attr("stroke",t=>{let{stroke:e}=t;return e||"transparent"}).attr("style",t=>{let{style:e}=t;return e||v||""});k&&(t=>{let{bubbles:e,tooltipRoot:a,tooltipClassName:n,renderTooltip:i}=t;const s=a||document.querySelector("body"),c=l.format(",");let d=l.select(s).select("."+Ee.bubbleChartTooltip);null===d.node()&&(d=l.select(s).append("div").attr("class",Ee.bubbleChartTooltip));let u=d.append("div").attr("class",Ee.bubbleChartTooltipContainer+" "+(n||"")).style("opacity","0");e.on("mouseover.tooltip",(t,e)=>{const{sizeValue:a}=e,n=t.currentTarget,{x:l,y:s,width:d}=n.getBoundingClientRect(),p=window.pageXOffset+l+d/2,h=window.pageYOffset+s;u.style("left",p+"px").style("top",h+"px").html(()=>o.renderToString(r.createElement(Xe,{className:Ee.bubbleChartTooltipFlex},r.createElement(ut,{className:Ee.bubbleChartTip},c(a))))),i&&i({tooltip:u,data:e,circle:n}),u.style("opacity","1")}),e.on("mouseout.tooltip",()=>{u.style("opacity","0")})})({bubbles:$,tooltipRoot:M,tooltipClassName:A,renderTooltip:w}),T&&T({svg:D,bubbles:$,yScale:V,xScale:J,sizeScale:F})}},Ie=t=>{const{className:e,style:a,children:o,tooltipRoot:i}=t,[s,c]=h();return n.useEffect(()=>{c&&Re(c,t)},[c,t]),n.useEffect(()=>()=>(t=>{const e=t||document.querySelector("body");l.select(e).select("."+Ee.bubbleChartTooltip).remove()})(i),[i]),m(t.width,()=>Re(c,t)),r.createElement("div",{className:e,style:a},r.createElement(ze,null),r.createElement(Ge,{ref:s},o))},Pe={height:280,minSize:6,maxSize:30,margin:{top:10,right:15,bottom:10,left:0},yAxisPadding:10,xAxisPadding:10,yScaleLabelPadding:10};Ie.defaultProps=Pe,exports.BarChart=Qt,exports.BubbleChart=Ie,exports.CalendarChart=Bt,exports.ChartWrapper=p,exports.HorizontalBarChart=we,exports.LineChart=Wt,exports.PieChart=Lt,exports.RadarChart=O,exports.SwipeScroll=v,exports.appendSvg=b,exports.barChartClassNames=_t,exports.bubbleChartClassNames=Ee,exports.calendarChartClassNames=wt,exports.horizontalBarChartClassNames=ie,exports.lineChartClassNames=Rt,exports.pieChartclassNames=W,exports.radarChartclassNames=P,exports.useNode=h,exports.useResize=m;
|
|
2
2
|
//# sourceMappingURL=charts.cjs.production.min.js.map
|