UNPKG

arbor-dashboard

Version:
2 lines 734 kB
/*! For license information please see dashboard.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.dashboard=t(require("react"),require("react-dom")):e.dashboard=t(e.react,e["react-dom"])}(self,((e,t)=>(()=>{var n,r,i={6774:(e,t)=>{"use strict";Symbol.for("react.transitional.element"),Symbol.for("react.portal");var n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler");Symbol.for("react.provider");var o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=(Symbol.for("react.view_transition"),Symbol.for("react.client.reference"));t.Hy=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===i||e===r||e===l||e===c||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===u||e.$$typeof===a||e.$$typeof===o||e.$$typeof===s||e.$$typeof===f||void 0!==e.getModuleId)}},9882:(e,t,n)=>{"use strict";n.d(t,{_:()=>a}),n(9155);var r=n(4848);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a=function(e){var t=e.data,n=e.themeConfig;return"object"===o(t)&&(t=Object.entries(t).map((function(e){var t,r,o=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,r)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],s=o[1];return{title:s.title||s.id,color:n[a]}}))),(0,r.jsx)("div",{className:"chart-legend",role:"graphics-legend",children:t.map((function(e,t){return(0,r.jsxs)("div",{className:"chart-legend-item",children:[(0,r.jsx)("div",{className:"chart-legend-symbol",style:{backgroundColor:n[t]}}),(0,r.jsx)("span",{children:e.title})]},t)}))})}},8941:(e,t,n)=>{"use strict";n.d(t,{BarChart:()=>ue});var r=n(4782),i=n(5650),o=n(2555),a=n(9155),s=n(6762),l=n(4848),c=n(6714),u=n(4028),d=n(806),f=n(7965),h=n(5917),p=n(8946),m=n(3414),g=n(4873);function y(e,t){return e[t]}function b(e){const t=[];return t.key=e,t}var v=n(8801),x=n(14);function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}function S(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var k,_=function(e){var t=e.bars,n=e.annotations,r=(0,s.wI)({data:t,annotations:n,getPosition:function(e){return{x:e.x+e.width/2,y:e.y+e.height/2}},getDimensions:function(e){var t=e.height,n=e.width;return{width:n,height:t,size:Math.max(n,t)}}});return(0,l.jsx)(l.Fragment,{children:r.map((function(e,t){return(0,l.jsx)(s.YH,w({},e),t)}))})},C=function(e){var t=e.width,n=e.height,r=e.legends,i=e.toggleSerie;return(0,l.jsx)(l.Fragment,{children:r.map((function(e,r){var o,a=e[0],s=e[1];return(0,l.jsx)(c.$i,w({},a,{containerWidth:t,containerHeight:n,data:null!=(o=a.data)?o:s,toggleSerie:a.toggleSerie&&"keys"===a.dataFrom?i:void 0}),r)}))})},M=["data"],A=["color","label"],j={indexBy:"id",keys:["value"],groupMode:"stacked",layout:"vertical",reverse:!1,minValue:"auto",maxValue:"auto",valueScale:{type:"linear"},indexScale:{type:"band",round:!0},padding:.1,innerPadding:0,axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,enableLabel:!0,label:"formattedValue",labelPosition:"middle",labelOffset:0,labelSkipWidth:0,labelSkipHeight:0,labelTextColor:{from:"theme",theme:"labels.text.fill"},colorBy:"id",colors:{scheme:"nivo"},borderRadius:0,borderWidth:0,borderColor:{from:"color"},isInteractive:!0,tooltip:function(e){var t=e.color,n=e.label,r=S(e,A);return(0,l.jsx)(d.GK,{id:n,value:r.formattedValue,enableChip:!0,color:t})},tooltipLabel:function(e){return e.id+" - "+e.indexValue},legends:[],initialHiddenIds:[],annotations:[],markers:[],enableTotals:!1,totalsOffset:10},O=w({},j,{layers:["grid","axes","bars","totals","markers","legends","annotations"],barComponent:function(e){var t,n=e.bar,r=n.data,s=S(n,M),c=e.style,u=c.borderColor,f=c.color,h=c.height,p=c.labelColor,m=c.labelOpacity,g=c.labelX,y=c.labelY,b=c.transform,v=c.width,x=c.textAnchor,k=e.borderRadius,_=e.borderWidth,C=e.label,A=e.shouldRenderLabel,j=e.isInteractive,O=e.onClick,T=e.onMouseEnter,P=e.onMouseLeave,E=e.tooltip,R=e.isFocusable,D=e.ariaLabel,I=e.ariaLabelledBy,L=e.ariaDescribedBy,z=e.ariaDisabled,F=e.ariaHidden,$=(0,i.DP)(),N=(0,d.fS)(),W=N.showTooltipFromEvent,B=N.showTooltipAt,H=N.hideTooltip,q=(0,a.useMemo)((function(){return function(){return(0,a.createElement)(E,w({},s,r))}}),[E,s,r]),U=(0,a.useCallback)((function(e){null==O||O(w({color:s.color},r),e)}),[s,r,O]),V=(0,a.useCallback)((function(e){return W(q(),e)}),[W,q]),Y=(0,a.useCallback)((function(e){null==T||T(r,e),W(q(),e)}),[r,T,W,q]),G=(0,a.useCallback)((function(e){null==P||P(r,e),H()}),[r,H,P]),K=(0,a.useCallback)((function(){B(q(),[s.absX+s.width/2,s.absY])}),[B,q,s]),X=(0,a.useCallback)((function(){H()}),[H]);return(0,l.jsxs)(o.CS.g,{transform:b,children:[(0,l.jsx)(o.CS.rect,{width:(0,o.to)(v,(function(e){return Math.max(e,0)})),height:(0,o.to)(h,(function(e){return Math.max(e,0)})),rx:k,ry:k,fill:null!=(t=r.fill)?t:f,strokeWidth:_,stroke:u,focusable:R,tabIndex:R?0:void 0,"aria-label":D?D(r):void 0,"aria-labelledby":I?I(r):void 0,"aria-describedby":L?L(r):void 0,"aria-disabled":z?z(r):void 0,"aria-hidden":F?F(r):void 0,onMouseEnter:j?Y:void 0,onMouseMove:j?V:void 0,onMouseLeave:j?G:void 0,onClick:j?U:void 0,onFocus:j&&R?K:void 0,onBlur:j&&R?X:void 0}),A&&(0,l.jsx)(o.CS.text,{x:g,y,textAnchor:x,dominantBaseline:"central",fillOpacity:m,style:w({},$.labels.text,{pointerEvents:"none",fill:p}),children:C})]})},defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),T=w({},j,{layers:["grid","axes","bars","totals","legends","annotations"],pixelRatio:"undefined"!=typeof window&&null!=(k=window.devicePixelRatio)?k:1}),P=function(e,t,n,r,i,o){return(0,f.gx)(r,{all:e.map(t),min:0,max:0},i,o).padding(n)},E=function(e,t){return e.map((function(e){return w({},t.reduce((function(e,t){return e[t]=null,e}),{}),e)}))},R=function(e){return Object.keys(e).reduce((function(t,n){return e[n]&&(t[n]=e[n]),t}),{})},D=function(e){return[e,Number(e)]};function I(e,t,n,r){return void 0===e&&(e=j.layout),void 0===t&&(t=j.reverse),void 0===n&&(n=j.labelPosition),void 0===r&&(r=j.labelOffset),function(i,o){var a=r*(t?-1:1);if("horizontal"===e){var s=i/2;return"start"===n?s=t?i:0:"end"===n&&(s=t?0:i),{labelX:s+a,labelY:o/2,textAnchor:"middle"===n?"middle":t?"end":"start"}}var l=o/2;return"start"===n?l=t?0:o:"end"===n&&(l=t?o:0),{labelX:i/2,labelY:l-a,textAnchor:"middle"}}}var L=["layout","minValue","maxValue","reverse","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],z=function(e,t){return e>t},F=function(e,t){return e<t},$=function(e,t){return Array.from(" ".repeat(t-e),(function(t,n){return e+n}))},N=function(e){return z(e,0)?0:e},W=function(e,t,n,r){var i=e.data,o=e.formatValue,a=e.getColor,s=e.getIndex,l=e.getTooltipLabel,c=e.innerPadding,u=void 0===c?0:c,d=e.keys,f=e.xScale,h=e.yScale,p=e.margin,m=n?F:z,g=i.map(R),y=[];return d.forEach((function(e,n){return $(0,f.domain().length).forEach((function(c){var d,b,v,x=D(i[c][e]),w=x[0],S=x[1],k=s(i[c]),_=(null!=(d=f(k))?d:0)+t*n+u*n,C=m(b=S,0)?null!=(v=h(b))?v:0:r,M=function(e,t){var n;return m(e,0)?r-t:(null!=(n=h(e))?n:0)-r}(S,C),A={id:e,value:null===w?w:S,formattedValue:o(S),hidden:!1,index:c,indexValue:k,data:g[c]};y.push({key:e+"."+A.indexValue,index:y.length,data:A,x:_,y:C,absX:p.left+_,absY:p.top+C,width:t,height:M,color:a(A),label:l(A)})}))})),y},B=function(e,t,n,r){var i=e.data,o=e.formatValue,a=e.getIndex,s=e.getColor,l=e.getTooltipLabel,c=e.keys,u=e.innerPadding,d=void 0===u?0:u,f=e.xScale,h=e.yScale,p=e.margin,m=n?F:z,g=i.map(R),y=[];return c.forEach((function(e,n){return $(0,h.domain().length).forEach((function(c){var u,b,v,x=D(i[c][e]),w=x[0],S=x[1],k=a(i[c]),_=m(b=S,0)?r:null!=(v=f(b))?v:0,C=(null!=(u=h(k))?u:0)+t*n+d*n,M=function(e,t){var n;return m(e,0)?(null!=(n=f(e))?n:0)-r:r-t}(S,_),A={id:e,value:null===w?w:S,formattedValue:o(S),hidden:!1,index:c,indexValue:k,data:g[c]};y.push({key:e+"."+A.indexValue,index:y.length,data:A,x:_,y:C,absX:p.left+_,absY:p.top+C,width:M,height:t,color:s(A),label:l(A)})}))})),y},H=function(e){var t,n,r=e.layout,i=e.minValue,o=e.maxValue,a=e.reverse,s=e.width,l=e.height,c=e.padding,u=void 0===c?0:c,d=e.innerPadding,h=void 0===d?0:d,p=e.valueScale,m=e.indexScale,g=e.hiddenIds,y=void 0===g?[]:g,b=S(e,L),v=b.keys.filter((function(e){return!y.includes(e)})),x=E(b.data,v),k="vertical"===r?["y","x",s]:["x","y",l],_=k[0],C=k[1],M=k[2],A=P(x,b.getIndex,u,m,M,C),j=w({max:o,min:i,reverse:a},p),O="auto"===j.min?N:function(e){return e},T=x.reduce((function(e,t){return[].concat(e,v.map((function(e){return t[e]})))}),[]).filter(Boolean),R=O(Math.min.apply(Math,T)),D=(n=Math.max.apply(Math,T),isFinite(n)?n:0),I=(0,f.gx)(j,{all:T,min:R,max:D},"x"===_?s:l,_),z="vertical"===r?[A,I]:[I,A],F=z[0],$=z[1],H=(A.bandwidth()-h*(v.length-1))/v.length,q=[w({},b,{data:x,keys:v,innerPadding:h,xScale:F,yScale:$}),H,j.reverse,null!=(t=I(0))?t:0];return{xScale:F,yScale:$,bars:H>0?"vertical"===r?W.apply(void 0,q):B.apply(void 0,q):[]}},q=["data","layout","minValue","maxValue","reverse","width","height","padding","valueScale","indexScale","hiddenIds"],U=function e(t){var n;return t.some(Array.isArray)?e((n=[]).concat.apply(n,t)):t},V=function(e,t,n){var r=e.formatValue,i=e.getColor,o=e.getIndex,a=e.getTooltipLabel,s=e.innerPadding,l=e.stackedData,c=e.xScale,u=e.yScale,d=e.margin,f=[];return l.forEach((function(e){return c.domain().forEach((function(l,h){var p,m,g=e[h],y=null!=(p=c(o(g.data)))?p:0,b=(null!=(m=function(e){return u(e[n?0:1])}(g))?m:0)+.5*s,v=function(e,t){var r;return(null!=(r=u(e[n?1:0]))?r:0)-t}(g,b)-s,x=D(g.data[e.key]),w=x[0],S=x[1],k={id:e.key,value:null===w?w:S,formattedValue:r(S),hidden:!1,index:h,indexValue:l,data:R(g.data)};f.push({key:e.key+"."+l,index:f.length,data:k,x:y,y:b,absX:d.left+y,absY:d.top+b,width:t,height:v,color:i(k),label:a(k)})}))})),f},Y=function(e,t,n){var r=e.formatValue,i=e.getColor,o=e.getIndex,a=e.getTooltipLabel,s=e.innerPadding,l=e.stackedData,c=e.xScale,u=e.yScale,d=e.margin,f=[];return l.forEach((function(e){return u.domain().forEach((function(l,h){var p,m,g=e[h],y=null!=(p=u(o(g.data)))?p:0,b=(null!=(m=function(e){return c(e[n?1:0])}(g))?m:0)+.5*s,v=function(e,t){var r;return(null!=(r=c(e[n?0:1]))?r:0)-t}(g,b)-s,x=D(g.data[e.key]),w=x[0],S=x[1],k={id:e.key,value:null===w?w:S,formattedValue:r(S),hidden:!1,index:h,indexValue:l,data:R(g.data)};f.push({key:e.key+"."+l,index:f.length,data:k,x:b,y,absX:d.left+b,absY:d.top+y,width:v,height:t,color:i(k),label:a(k)})}))})),f},G=function(e){var t,n=e.data,r=e.layout,i=e.minValue,o=e.maxValue,a=e.reverse,s=e.width,l=e.height,c=e.padding,u=void 0===c?0:c,d=e.valueScale,x=e.indexScale,k=e.hiddenIds,_=void 0===k?[]:k,C=S(e,q),M=C.keys.filter((function(e){return!_.includes(e)})),A=function(){var e=(0,p.A)([]),t=g.A,n=m.A,r=y;function i(i){var o,a,s=Array.from(e.apply(this,arguments),b),l=s.length,c=-1;for(const e of i)for(o=0,++c;o<l;++o)(s[o][c]=[0,+r(e,s[o].key,c,i)]).data=e;for(o=0,a=(0,h.A)(t(s));o<l;++o)s[a[o]].index=o;return n(s,a),s}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:(0,p.A)(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:(0,p.A)(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?g.A:"function"==typeof e?e:(0,p.A)(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?m.A:e,i):n},i}().keys(M).offset(v.A)(E(n,M)),j="vertical"===r?["y","x",s]:["x","y",l],O=j[0],T=j[1],R=j[2],D=P(n,C.getIndex,u,x,R,T),I=w({max:o,min:i,reverse:a},d),L=(t=U(A),"log"===d.type?t.filter((function(e){return 0!==e})):t),z=Math.min.apply(Math,L),F=Math.max.apply(Math,L),$=(0,f.gx)(I,{all:L,min:z,max:F},"x"===O?s:l,O),N="vertical"===r?[D,$]:[$,D],W=N[0],B=N[1],H=C.innerPadding>0?C.innerPadding:0,G=D.bandwidth(),K=[w({},C,{innerPadding:H,stackedData:A,xScale:W,yScale:B}),G,I.reverse];return{xScale:W,yScale:B,bars:G>0?"vertical"===r?V.apply(void 0,K):Y.apply(void 0,K):[]}},K=function(e){var t=e.bars,n=e.direction,r=e.from,o=e.groupMode,a=e.layout,s=e.legendLabel,l=e.reverse,c=(0,i.x)(null!=s?s:"indexes"===r?"indexValue":"id");return"indexes"===r?function(e,t,n){var r=x(e.map((function(e){var t,r;return{id:null!=(t=e.data.indexValue)?t:"",label:n(e.data),hidden:e.data.hidden,color:null!=(r=e.color)?r:"#000"}})),(function(e){return e.id}));return"horizontal"===t&&r.reverse(),r}(t,a,c):function(e,t,n,r,i,o){var a=x(e.map((function(e){var t;return{id:e.data.id,label:o(e.data),hidden:e.data.hidden,color:null!=(t=e.color)?t:"#000"}})),(function(e){return e.id}));return("vertical"===t&&"stacked"===r&&"column"===n&&!0!==i||"horizontal"===t&&"stacked"===r&&!0===i)&&a.reverse(),a}(t,a,n,o,l,c)},X=function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},Q=function(e){var t=e.indexBy,n=void 0===t?j.indexBy:t,r=e.keys,o=void 0===r?j.keys:r,s=e.label,l=void 0===s?j.label:s,c=e.tooltipLabel,d=void 0===c?j.tooltipLabel:c,f=e.valueFormat,h=e.colors,p=void 0===h?j.colors:h,m=e.colorBy,g=void 0===m?j.colorBy:m,y=e.borderColor,b=void 0===y?j.borderColor:y,v=e.labelTextColor,x=void 0===v?j.labelTextColor:v,S=e.groupMode,k=void 0===S?j.groupMode:S,_=e.layout,C=void 0===_?j.layout:_,M=e.reverse,A=void 0===M?j.reverse:M,O=e.data,T=e.minValue,P=void 0===T?j.minValue:T,E=e.maxValue,R=void 0===E?j.maxValue:E,D=e.margin,I=e.width,L=e.height,z=e.padding,F=void 0===z?j.padding:z,$=e.innerPadding,N=void 0===$?j.innerPadding:$,W=e.valueScale,B=void 0===W?j.valueScale:W,q=e.indexScale,U=void 0===q?j.indexScale:q,V=e.initialHiddenIds,Y=void 0===V?j.initialHiddenIds:V,Q=e.enableLabel,Z=void 0===Q?j.enableLabel:Q,J=e.labelSkipWidth,ee=void 0===J?j.labelSkipWidth:J,te=e.labelSkipHeight,ne=void 0===te?j.labelSkipHeight:te,re=e.legends,ie=void 0===re?j.legends:re,oe=e.legendLabel,ae=e.totalsOffset,se=void 0===ae?j.totalsOffset:ae,le=(0,a.useState)(null!=Y?Y:[]),ce=le[0],ue=le[1],de=(0,a.useCallback)((function(e){ue((function(t){return t.indexOf(e)>-1?t.filter((function(t){return t!==e})):[].concat(t,[e])}))}),[]),fe=(0,i.Ob)(n),he=(0,i.Ob)(l),pe=(0,i.Ob)(d),me=(0,i.d_)(f),ge=(0,i.DP)(),ye=(0,u.m1)(p,g),be=(0,u.nz)(b,ge),ve=(0,u.nz)(x,ge),xe=("grouped"===k?H:G)({layout:C,reverse:A,data:O,getIndex:fe,keys:o,minValue:P,maxValue:R,width:I,height:L,getColor:ye,padding:F,innerPadding:N,valueScale:B,indexScale:U,hiddenIds:ce,formatValue:me,getTooltipLabel:pe,margin:D}),we=xe.bars,Se=xe.xScale,ke=xe.yScale,_e=(0,a.useMemo)((function(){return we.filter((function(e){return null!==e.data.value})).map((function(e,t){return w({},e,{index:t})}))}),[we]),Ce=(0,a.useCallback)((function(e){var t=e.width,n=e.height;return!(!Z||ee>0&&t<ee||ne>0&&n<ne)}),[Z,ee,ne]),Me=(0,a.useMemo)((function(){return o.map((function(e){var t=we.find((function(t){return t.data.id===e}));return w({},t,{data:w({id:e},null==t?void 0:t.data,{hidden:ce.includes(e)})})}))}),[ce,o,we]),Ae=(0,a.useMemo)((function(){return ie.map((function(e){return[e,K({bars:"keys"===e.dataFrom?Me:we,direction:e.direction,from:e.dataFrom,groupMode:k,layout:C,legendLabel:oe,reverse:A})]}))}),[ie,Me,we,k,C,oe,A]),je=(0,a.useMemo)((function(){return function(e,t,n,r,i,o,a){void 0===r&&(r=j.layout),void 0===i&&(i=j.groupMode);var s=[];if(0===e.length)return s;var l=new Map,c=e[0].width,u=e[0].height;if("stacked"===i){var d=new Map;e.forEach((function(e){var t=e.data,n=t.indexValue,r=t.value;X(l,n,Number(r)),function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))}(d,n,Number(r))})),d.forEach((function(e,i){var d,f,h,p=l.get(i)||0;"vertical"===r?(d=t(i),f=n(e),h=n(e/2)):(d=t(e),f=n(i),h=t(e/2)),d+="vertical"===r?c/2:o,f+="vertical"===r?-o:u/2,s.push({key:"total_"+i,x:d,y:f,value:p,formattedValue:a(p),animationOffset:h})}))}else if("grouped"===i){var f=new Map,h=new Map;e.forEach((function(e){var t=e.data,n=t.indexValue,r=t.value;X(l,n,Number(r)),function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))}(f,n,Number(r)),function(e,t){var n=e.get(t)||0;e.set(t,n+1)}(h,n)})),f.forEach((function(e,i){var d,f,p,m=l.get(i)||0,g=h.get(i);"vertical"===r?(d=t(i),f=n(e),p=n(e/2)):(d=t(e),f=n(i),p=t(e/2)),d+="vertical"===r?g*c/2:o,f+="vertical"===r?-o:g*u/2,s.push({key:"total_"+i,x:d,y:f,value:m,formattedValue:a(m),animationOffset:p})}))}return s}(we,Se,ke,C,k,se,me)}),[we,Se,ke,C,k,se,me]);return{bars:we,barsWithValue:_e,xScale:Se,yScale:ke,getIndex:fe,getLabel:he,getTooltipLabel:pe,formatValue:me,getColor:ye,getBorderColor:be,getLabelColor:ve,shouldRenderBarLabel:Ce,hiddenIds:ce,toggleSerie:de,legendsWithData:Ae,barTotals:je}},Z=function(e){var t=e.data,n=e.springConfig,r=e.animate,a=e.layout,s=void 0===a?O.layout:a,c=(0,i.DP)();return(0,o.pn)(t,{keys:function(e){return e.key},from:function(e){return{x:"vertical"===s?e.x:e.animationOffset,y:"vertical"===s?e.animationOffset:e.y,labelOpacity:0}},enter:function(e){return{x:e.x,y:e.y,labelOpacity:1}},update:function(e){return{x:e.x,y:e.y,labelOpacity:1}},leave:function(e){return{x:"vertical"===s?e.x:e.animationOffset,y:"vertical"===s?e.animationOffset:e.y,labelOpacity:0}},config:n,immediate:!r,initial:r?void 0:null})((function(e,t){return(0,l.jsx)(o.CS.text,{x:e.x,y:e.y,fillOpacity:e.labelOpacity,style:w({},c.labels.text,{pointerEvents:"none"}),fontWeight:"bold",fontSize:c.labels.text.fontSize,fontFamily:c.labels.text.fontFamily,textAnchor:"vertical"===s?"middle":"start",alignmentBaseline:"vertical"===s?"alphabetic":"middle",children:t.formattedValue},t.key)}))},J=["isInteractive","animate","motionConfig","theme","renderWrapper"],ee=function(e){var t=e.data,n=e.indexBy,s=e.keys,c=e.margin,u=e.width,d=e.height,f=e.groupMode,h=e.layout,p=e.reverse,m=e.minValue,g=e.maxValue,y=e.valueScale,b=e.indexScale,v=e.padding,x=e.innerPadding,S=e.axisTop,k=e.axisRight,M=e.axisBottom,A=void 0===M?O.axisBottom:M,j=e.axisLeft,T=void 0===j?O.axisLeft:j,P=e.enableGridX,E=void 0===P?O.enableGridX:P,R=e.enableGridY,D=void 0===R?O.enableGridY:R,L=e.gridXValues,z=e.gridYValues,F=e.layers,$=void 0===F?O.layers:F,N=e.barComponent,W=void 0===N?O.barComponent:N,B=e.enableLabel,H=void 0===B?O.enableLabel:B,q=e.label,U=e.labelSkipWidth,V=void 0===U?O.labelSkipWidth:U,Y=e.labelSkipHeight,G=void 0===Y?O.labelSkipHeight:Y,K=e.labelTextColor,X=e.labelPosition,J=void 0===X?O.labelPosition:X,ee=e.labelOffset,te=void 0===ee?O.labelOffset:ee,ne=e.markers,re=void 0===ne?O.markers:ne,ie=e.colorBy,oe=e.colors,ae=e.defs,se=void 0===ae?O.defs:ae,le=e.fill,ce=void 0===le?O.fill:le,ue=e.borderRadius,de=void 0===ue?O.borderRadius:ue,fe=e.borderWidth,he=void 0===fe?O.borderWidth:fe,pe=e.borderColor,me=e.annotations,ge=void 0===me?O.annotations:me,ye=e.legendLabel,be=e.tooltipLabel,ve=e.valueFormat,xe=e.isInteractive,we=void 0===xe?O.isInteractive:xe,Se=e.tooltip,ke=void 0===Se?O.tooltip:Se,_e=e.onClick,Ce=e.onMouseEnter,Me=e.onMouseLeave,Ae=e.legends,je=e.role,Oe=void 0===je?O.role:je,Te=e.ariaLabel,Pe=e.ariaLabelledBy,Ee=e.ariaDescribedBy,Re=e.isFocusable,De=void 0===Re?O.isFocusable:Re,Ie=e.barAriaLabel,Le=e.barAriaLabelledBy,ze=e.barAriaDescribedBy,Fe=e.barAriaHidden,$e=e.barAriaDisabled,Ne=e.initialHiddenIds,We=e.enableTotals,Be=void 0===We?O.enableTotals:We,He=e.totalsOffset,qe=void 0===He?O.totalsOffset:He,Ue=(0,i.mk)(),Ve=Ue.animate,Ye=Ue.config,Ge=(0,i.Xl)(u,d,c),Ke=Ge.outerWidth,Xe=Ge.outerHeight,Qe=Ge.margin,Ze=Ge.innerWidth,Je=Ge.innerHeight,et=Q({indexBy:n,label:q,tooltipLabel:be,valueFormat:ve,colors:oe,colorBy:ie,borderColor:pe,labelTextColor:K,groupMode:f,layout:h,reverse:p,data:t,keys:s,minValue:m,maxValue:g,margin:Qe,width:Ze,height:Je,padding:v,innerPadding:x,valueScale:y,indexScale:b,enableLabel:H,labelSkipWidth:V,labelSkipHeight:G,legends:Ae,legendLabel:ye,initialHiddenIds:Ne,totalsOffset:qe}),tt=et.bars,nt=et.barsWithValue,rt=et.xScale,it=et.yScale,ot=et.getLabel,at=et.getTooltipLabel,st=et.getBorderColor,lt=et.getLabelColor,ct=et.shouldRenderBarLabel,ut=et.toggleSerie,dt=et.legendsWithData,ft=et.barTotals,ht=et.getColor,pt=I(h,p,J,te),mt=(0,o.pn)(nt,{keys:function(e){return e.key},from:function(e){return w({borderColor:st(e),color:e.color,height:0,labelColor:lt(e),labelOpacity:0},pt(e.width,e.height),{transform:"translate("+e.x+", "+(e.y+e.height)+")",width:e.width},"vertical"===h?{}:{height:e.height,transform:"translate("+e.x+", "+e.y+")",width:0})},enter:function(e){return w({borderColor:st(e),color:e.color,height:e.height,labelColor:lt(e),labelOpacity:1},pt(e.width,e.height),{transform:"translate("+e.x+", "+e.y+")",width:e.width})},update:function(e){return w({borderColor:st(e),color:e.color,height:e.height,labelColor:lt(e),labelOpacity:1},pt(e.width,e.height),{transform:"translate("+e.x+", "+e.y+")",width:e.width})},leave:function(e){return w({borderColor:st(e),color:e.color,height:0,labelColor:lt(e),labelOpacity:0},pt(e.width,e.height),{labelY:0,transform:"translate("+e.x+", "+(e.y+e.height)+")",width:e.width},"vertical"===h?{}:w({},pt(e.width,e.height),{labelX:0,height:e.height,transform:"translate("+e.x+", "+e.y+")",width:0}))},config:Ye,immediate:!Ve,initial:Ve?void 0:null}),gt=(0,a.useMemo)((function(){return{borderRadius:de,borderWidth:he,enableLabel:H,isInteractive:we,labelSkipWidth:V,labelSkipHeight:G,onClick:_e,onMouseEnter:Ce,onMouseLeave:Me,getTooltipLabel:at,tooltip:ke,isFocusable:De,ariaLabel:Ie,ariaLabelledBy:Le,ariaDescribedBy:ze,ariaHidden:Fe,ariaDisabled:$e}}),[de,he,H,at,we,G,V,_e,Ce,Me,ke,De,Ie,Le,ze,Fe,$e]),yt=(0,i.kc)(se,tt,ce,{dataKey:"data",targetKey:"data.fill"}),bt={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};$.includes("annotations")&&(bt.annotations=(0,l.jsx)(_,{bars:tt,annotations:ge},"annotations")),$.includes("axes")&&(bt.axes=(0,l.jsx)(r.Y5,{xScale:rt,yScale:it,width:Ze,height:Je,top:S,right:k,bottom:A,left:T},"axes")),$.includes("bars")&&(bt.bars=(0,l.jsx)(a.Fragment,{children:mt((function(e,t){return(0,a.createElement)(W,w({},gt,{bar:t,style:e,shouldRenderLabel:ct(t),label:ot(t.data)}))}))},"bars")),$.includes("grid")&&(bt.grid=(0,l.jsx)(r.xA,{width:Ze,height:Je,xScale:E?rt:null,yScale:D?it:null,xValues:L,yValues:z},"grid")),$.includes("legends")&&(bt.legends=(0,l.jsx)(C,{width:Ze,height:Je,legends:dt,toggleSerie:ut},"legends")),$.includes("markers")&&(bt.markers=(0,l.jsx)(i.U9,{markers:re,width:Ze,height:Je,xScale:rt,yScale:it},"markers")),$.includes("totals")&&Be&&(bt.totals=(0,l.jsx)(Z,{data:ft,springConfig:Ye,animate:Ve,layout:h},"totals"));var vt=(0,a.useMemo)((function(){return w({},gt,{margin:Qe,width:u,height:d,innerWidth:Ze,innerHeight:Je,bars:tt,legendData:dt,enableLabel:H,xScale:rt,yScale:it,tooltip:ke,getTooltipLabel:at,onClick:_e,onMouseEnter:Ce,onMouseLeave:Me,getColor:ht})}),[gt,Qe,u,d,Ze,Je,tt,dt,H,rt,it,ke,at,_e,Ce,Me,ht]);return(0,l.jsx)(i.Ge,{width:Ke,height:Xe,margin:Qe,defs:yt,role:Oe,ariaLabel:Te,ariaLabelledBy:Pe,ariaDescribedBy:Ee,isFocusable:De,children:$.map((function(e,t){var n;return"function"==typeof e?(0,l.jsx)(a.Fragment,{children:(0,a.createElement)(e,vt)},t):null!=(n=null==bt?void 0:bt[e])?n:null}))})},te=function(e){var t=e.isInteractive,n=void 0===t?O.isInteractive:t,r=e.animate,o=void 0===r?O.animate:r,a=e.motionConfig,s=void 0===a?O.motionConfig:a,c=e.theme,u=e.renderWrapper,d=S(e,J);return(0,l.jsx)(i.mc,{animate:o,isInteractive:n,motionConfig:s,renderWrapper:u,theme:c,children:(0,l.jsx)(ee,w({isInteractive:n},d))})},ne=["isInteractive","renderWrapper","theme"],re=function(e,t,n,r){return e.find((function(e){return(0,i.u7)(e.x+t.left,e.y+t.top,e.width,e.height,n,r)}))},ie=function(e){var t=e.data,n=e.indexBy,o=e.keys,u=e.margin,f=e.width,h=e.height,p=e.groupMode,m=e.layout,g=e.reverse,y=e.minValue,b=e.maxValue,v=e.valueScale,x=e.indexScale,S=e.padding,k=e.innerPadding,_=e.axisTop,C=e.axisRight,M=e.axisBottom,A=void 0===M?T.axisBottom:M,j=e.axisLeft,O=void 0===j?T.axisLeft:j,P=e.enableGridX,E=void 0===P?T.enableGridX:P,R=e.enableGridY,D=void 0===R?T.enableGridY:R,L=e.gridXValues,z=e.gridYValues,F=e.labelPosition,$=void 0===F?T.labelPosition:F,N=e.labelOffset,W=void 0===N?T.labelOffset:N,B=e.layers,H=void 0===B?T.layers:B,q=e.renderBar,U=void 0===q?function(e,t){var n=t.bar,r=n.color,i=n.height,o=n.width,a=n.x,s=n.y,l=t.borderColor,c=t.borderRadius,u=t.borderWidth,d=t.label,f=t.labelColor,h=t.shouldRenderLabel,p=t.labelX,m=t.labelY,g=t.textAnchor;if(e.fillStyle=r,u>0&&(e.strokeStyle=l,e.lineWidth=u),e.beginPath(),c>0){var y=Math.min(c,i);e.moveTo(a+y,s),e.lineTo(a+o-y,s),e.quadraticCurveTo(a+o,s,a+o,s+y),e.lineTo(a+o,s+i-y),e.quadraticCurveTo(a+o,s+i,a+o-y,s+i),e.lineTo(a+y,s+i),e.quadraticCurveTo(a,s+i,a,s+i-y),e.lineTo(a,s+y),e.quadraticCurveTo(a,s,a+y,s),e.closePath()}else e.rect(a,s,o,i);e.fill(),u>0&&e.stroke(),h&&(e.textBaseline="middle",e.textAlign="middle"===g?"center":g,e.fillStyle=f,e.fillText(d,a+p,s+m))}:q,V=e.enableLabel,Y=void 0===V?T.enableLabel:V,G=e.label,K=e.labelSkipWidth,X=void 0===K?T.labelSkipWidth:K,Z=e.labelSkipHeight,J=void 0===Z?T.labelSkipHeight:Z,ee=e.labelTextColor,te=e.colorBy,ne=e.colors,ie=e.borderRadius,oe=void 0===ie?T.borderRadius:ie,ae=e.borderWidth,se=void 0===ae?T.borderWidth:ae,le=e.borderColor,ce=e.annotations,ue=void 0===ce?T.annotations:ce,de=e.legendLabel,fe=e.tooltipLabel,he=e.valueFormat,pe=e.isInteractive,me=void 0===pe?T.isInteractive:pe,ge=e.tooltip,ye=void 0===ge?T.tooltip:ge,be=e.onClick,ve=e.onMouseEnter,xe=e.onMouseLeave,we=e.legends,Se=e.pixelRatio,ke=void 0===Se?T.pixelRatio:Se,_e=e.canvasRef,Ce=e.enableTotals,Me=void 0===Ce?T.enableTotals:Ce,Ae=e.totalsOffset,je=void 0===Ae?T.totalsOffset:Ae,Oe=(0,a.useRef)(null),Te=(0,i.DP)(),Pe=(0,i.Xl)(f,h,u),Ee=Pe.margin,Re=Pe.innerWidth,De=Pe.innerHeight,Ie=Pe.outerWidth,Le=Pe.outerHeight,ze=Q({indexBy:n,label:G,tooltipLabel:fe,valueFormat:he,colors:ne,colorBy:te,borderColor:le,labelTextColor:ee,groupMode:p,layout:m,reverse:g,data:t,keys:o,minValue:y,maxValue:b,margin:Ee,width:Re,height:De,padding:S,innerPadding:k,valueScale:v,indexScale:x,enableLabel:Y,labelSkipWidth:X,labelSkipHeight:J,legends:we,legendLabel:de,totalsOffset:je}),Fe=ze.bars,$e=ze.barsWithValue,Ne=ze.xScale,We=ze.yScale,Be=ze.getLabel,He=ze.getTooltipLabel,qe=ze.getBorderColor,Ue=ze.getLabelColor,Ve=ze.shouldRenderBarLabel,Ye=ze.legendsWithData,Ge=ze.barTotals,Ke=ze.getColor,Xe=(0,d.fS)(),Qe=Xe.showTooltipFromEvent,Ze=Xe.hideTooltip,Je=(0,s.x$)({annotations:(0,s.wI)({data:Fe,annotations:ue,getPosition:function(e){return{x:e.x,y:e.y}},getDimensions:function(e){var t=e.width,n=e.height;return{width:t,height:n,size:Math.max(t,n)}}})}),et=(0,a.useMemo)((function(){return{borderRadius:oe,borderWidth:se,isInteractive:me,isFocusable:!1,labelSkipWidth:X,labelSkipHeight:J,margin:Ee,width:f,height:h,innerWidth:Re,innerHeight:De,bars:Fe,legendData:Ye,enableLabel:Y,xScale:Ne,yScale:We,tooltip:ye,getTooltipLabel:He,onClick:be,onMouseEnter:ve,onMouseLeave:xe,getColor:Ke}}),[oe,se,me,X,J,Ee,f,h,Re,De,Fe,Ye,Y,Ne,We,ye,He,be,ve,xe,Ke]),tt=(0,i.d_)(he),nt=I(m,g,$,W);(0,a.useEffect)((function(){var e,t=null==(e=Oe.current)?void 0:e.getContext("2d");Oe.current&&t&&(Oe.current.width=Ie*ke,Oe.current.height=Le*ke,t.scale(ke,ke),t.fillStyle=Te.background,t.fillRect(0,0,Ie,Le),t.translate(Ee.left,Ee.top),H.forEach((function(e){"grid"===e?"number"==typeof Te.grid.line.strokeWidth&&Te.grid.line.strokeWidth>0&&(t.lineWidth=Te.grid.line.strokeWidth,t.strokeStyle=Te.grid.line.stroke,E&&(0,r.xu)(t,{width:Re,height:De,scale:Ne,axis:"x",values:L}),D&&(0,r.xu)(t,{width:Re,height:De,scale:We,axis:"y",values:z})):"axes"===e?(0,r.ZY)(t,{xScale:Ne,yScale:We,width:Re,height:De,top:_,right:C,bottom:A,left:O,theme:Te}):"bars"===e?$e.forEach((function(e){U(t,w({bar:e,borderColor:qe(e),borderRadius:oe,borderWidth:se,label:Be(e.data),labelColor:Ue(e),shouldRenderLabel:Ve(e)},nt(e.width,e.height)))})):"legends"===e?Ye.forEach((function(e){var n=e[0],r=e[1];(0,c.ZG)(t,w({},n,{data:r,containerWidth:Re,containerHeight:De,theme:Te}))})):"annotations"===e?(0,s.e0)(t,{annotations:Je,theme:Te}):"totals"===e&&Me?function(e,t,n,r){void 0===r&&(r=T.layout),e.fillStyle=n.text.fill,e.font="bold "+n.labels.text.fontSize+"px "+n.labels.text.fontFamily,e.textBaseline="vertical"===r?"alphabetic":"middle",e.textAlign="vertical"===r?"center":"start",t.forEach((function(t){e.fillText(t.formattedValue,t.x,t.y)}))}(t,Ge,Te,m):"function"==typeof e&&e(t,et)})),t.save())}),[A,O,C,_,$e,oe,se,Je,E,D,qe,Be,Ue,L,z,p,h,De,Re,et,H,m,Ye,Ee.left,Ee.top,Le,Ie,ke,U,Ne,We,g,Ve,Te,f,Ge,Me,tt,nt]);var rt=(0,a.useCallback)((function(e){if(Fe&&Oe.current){var t=(0,i.H9)(Oe.current,e),n=t[0],r=t[1],o=re(Fe,Ee,n,r);void 0!==o?(Qe((0,a.createElement)(ye,w({},o.data,{color:o.color,label:o.label,value:Number(o.data.value)})),e),"mouseenter"===e.type&&(null==ve||ve(o.data,e))):Ze()}}),[Ze,Ee,ve,Fe,Qe,ye]),it=(0,a.useCallback)((function(e){if(Fe&&Oe.current){Ze();var t=(0,i.H9)(Oe.current,e),n=t[0],r=t[1],o=re(Fe,Ee,n,r);o&&(null==xe||xe(o.data,e))}}),[Ze,Ee,xe,Fe]),ot=(0,a.useCallback)((function(e){if(Fe&&Oe.current){var t=(0,i.H9)(Oe.current,e),n=t[0],r=t[1],o=re(Fe,Ee,n,r);void 0!==o&&(null==be||be(w({},o.data,{color:o.color}),e))}}),[Ee,be,Fe]);return(0,l.jsx)("canvas",{ref:function(e){Oe.current=e,_e&&"current"in _e&&(_e.current=e)},width:Ie*ke,height:Le*ke,style:{width:Ie,height:Le,cursor:me?"auto":"normal"},onMouseEnter:me?rt:void 0,onMouseMove:me?rt:void 0,onMouseLeave:me?it:void 0,onClick:me?ot:void 0})},oe=(0,a.forwardRef)((function(e,t){var n=e.isInteractive,r=e.renderWrapper,o=e.theme,a=S(e,ne);return(0,l.jsx)(i.mc,{isInteractive:n,renderWrapper:r,theme:o,animate:!1,children:(0,l.jsx)(ie,w({},a,{canvasRef:t}))})})),ae=function(e){return(0,l.jsx)(i.KF,{children:function(t){var n=t.width,r=t.height;return(0,l.jsx)(te,w({width:n,height:r},e))}})},se=((0,a.forwardRef)((function(e,t){return(0,l.jsx)(i.KF,{children:function(n){var r=n.width,i=n.height;return(0,l.jsx)(oe,w({width:r,height:i},e,{ref:t}))}})})),n(7382)),le=n(8640),ce=n(9882),ue=function(e){var t=e.data,n=e.chartConfig,i=e.keys,o=e.indexes,s=e.annotation;if(!t||!1===t.success)return(0,l.jsx)("div",{children:"Error: no data provided"});var c=n.theme,u=n.xAxisLabel,h=n.yAxisLabel,p=n.grouped,m=n.lineMeasure,g=n.verticalLabels,y=t.transformedData,b=t.lineData,v=m&&b&&b.length>0,x=v?i.filter((function(e){return e!==m})):i,w=function(e){var t=e.x,n=e.y,r=e.value,i=e.textAnchor,o=r.split(" "),a=[],s="";return o.forEach((function(e){(s+e).length>12?(s&&a.push(s.trim()),s=e+" "):s+=e+" "})),s&&a.push(s.trim()),(0,l.jsx)("g",{transform:"translate(".concat(t,", ").concat(n+15,")"),children:a.map((function(e,t){return(0,l.jsx)("text",{textAnchor:i,y:14*t,style:{fontSize:"12px",fill:"#333"},children:e},t)}))})},S=(0,se.g)(c),k=S[i.findIndex((function(e){return e===m}))],_=o[0],C=v?function(e){var t=e.bars,n=e.xScale,i=e.innerWidth,o=e.innerHeight,c=(e.tooltip,t[0].width),u=(0,f._6)([{id:"only",data:b.map((function(e,t){return{x:t,y:e[m]}}))}],{type:"linear"},{type:"linear"},i,o),h=(0,le.A)().x((function(e){return n(e[_])+c})).y((function(e){return u.yScale(e[m])})),p=(0,d.fS)();function g(e,n){var r=t[n].data.indexValue,i=b.find((function(e){return e[_]===r})),o=s.measures[t[n].data.id].title,a=t[n].data.value,c=s.measures[m].title;return p.showTooltipFromEvent((0,l.jsx)(M,{barLabel:o,barValue:a,lineLabel:c,lineValue:i?i[m]:null}),e)}return(0,l.jsxs)(a.Fragment,{children:[(0,l.jsx)(r.Y5,{yScale:u.yScale,xScale:n,width:i,height:o,right:{ticksPosition:"after"}}),(0,l.jsx)("path",{d:h(b),fill:"none",stroke:k,style:{pointerEvents:"none"}}),b.map((function(e){return(0,l.jsx)("circle",{cx:n(e[_])+c,cy:u.yScale(e[m]),r:2,fill:"white",stroke:k,style:{pointerEvents:"none"}},e[_])})),t.map((function(e,t){return(0,l.jsx)("rect",{x:e.x,y:0,height:o,width:e.width,fill:"transparent",onMouseEnter:function(e){return g(e,t)},onMouseMove:function(e){return g(e,t)},onMouseLeave:p.hideTooltip},e.key)}))]})}:null,M=function(e){var t=e.barLabel,n=e.barValue,r=e.lineLabel,i=e.lineValue;return(0,l.jsx)(d.ST,{rows:[[t,n],[r,i]]})};return(0,l.jsxs)("div",{className:"dashboard-chart-container",children:[(0,l.jsx)("div",{className:"dashboard-chart",role:"graphics-datachart",children:(0,l.jsx)(ae,{"test-id":"bar-chart",data:y,keys:x,indexBy:function(e){return o.map((function(t){return String(e[t])})).join(" - ")},colors:S,theme:{tooltip:{wrapper:{zIndex:1e3}}},colorBy:"id",groupMode:p?"grouped":"stacked",margin:{top:20,right:40,bottom:70,left:60},padding:.35,valueScale:{type:"linear",max:"auto"},indexScale:{type:"band",round:!0},tooltip:function(e){var t,n=e.id,r=e.value,i=e.indexValue,o=(null===(t=s.measures[n])||void 0===t?void 0:t.title)||n;return(0,l.jsxs)("div",{style:{padding:"6px 9px",background:"white"},children:[(0,l.jsxs)("strong",{children:[o,":"]})," ",r," ",(0,l.jsx)("br",{}),(0,l.jsx)("em",{children:i})]})},borderColor:{from:"color",modifiers:[["darker",1.6]]},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:-70,legend:u,legendPosition:"middle",legendOffset:60,truncateTickAt:0,renderTick:g?void 0:function(e){return(0,l.jsx)(w,{x:e.x,y:e.y,value:e.value,textAnchor:"middle"})}},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:h,legendPosition:"middle",legendOffset:-50,truncateTickAt:0},labelSkipWidth:12,labelSkipHeight:12,labelTextColor:{from:"color",modifiers:[["darker",1.6]]},role:"application",ariaLabel:"Bar chart",onClick:function(e){return console.log(e)},layers:["grid","bars","markers","legends","axes",C]})}),(0,l.jsx)(ce._,{data:s.measures,themeConfig:S})]})}},7382:(e,t,n)=>{"use strict";n.d(t,{g:()=>r});var r=function(e,t,n){switch(e){case"sequential-green":return{type:"sequential",colors:["#FFFFFF","#009D00"],minValue:t,maxValue:n};case"sequential-red":return{type:"sequential",colors:["#FFFFFF","#f50707"],minValue:t,maxValue:n};case"sequential-blue":return{type:"sequential",colors:["#FFFFFF","#0264f7"],minValue:t,maxValue:n};case"categorical-default":return["#41F99A","#91F941","#F9E441","#F9AF41","#F97841","#F94144","#F941A3","#AC41F9","#4441F9","#41CBF9"];case"categorical-canvas":return["#AFD318","#68AA23","#CFE574","#FDEC73","#FABE78","#32AABF","#ADF3FF"]}}},8448:(e,t,n)=>{"use strict";n.d(t,{HeatMap:()=>E});var r=n(9155),i=n(5650),o=n(4782),a=n(6714),s=n(4028),l=n(6762),c=n(806),u=n(4848),d=n(9072),f=n(8849),h=n(7965),p=n(2555);function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m.apply(this,arguments)}var g={layers:["grid","axes","cells","legends","annotations"],forceSquare:!1,xInnerPadding:0,xOuterPadding:0,yInnerPadding:0,yOuterPadding:0,sizeVariation:!1,opacity:1,activeOpacity:1,inactiveOpacity:.15,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",.8]]},enableGridX:!1,enableGridY:!1,enableLabels:!0,label:"formattedValue",labelTextColor:{from:"color",modifiers:[["darker",2]]},colors:{type:"sequential",scheme:"brown_blueGreen"},emptyColor:"#000000",legends:[],annotations:[],isInteractive:!0,hoverTarget:"rowColumn",tooltip:(0,r.memo)((function(e){var t=e.cell;return null===t.formattedValue?null:(0,u.jsx)(c.GK,{id:t.serieId+" - "+t.data.x,value:t.formattedValue,enableChip:!0,color:t.color})})),animate:!0,motionConfig:"gentle"},y=(m({},g,{axisTop:{},axisRight:null,axisBottom:null,axisLeft:{},borderRadius:0,cellComponent:"rect"}),m({},g,{axisTop:{},axisRight:null,axisBottom:null,axisLeft:{},renderCell:"rect",pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1})),b=function(e){return{x:e.x,y:e.y}},v=function(e){return{size:Math.max(e.width,e.height),width:e.width,height:e.height}},x=function(e){var t=e.data,n=e.width,i=e.height,o=e.xInnerPadding,a=e.xOuterPadding,s=e.yInnerPadding,l=e.yOuterPadding,c=e.forceSquare;return(0,r.useMemo)((function(){return function(e){var t=e.data,n=e.width,r=e.height,i=e.xInnerPadding,o=e.xOuterPadding,a=e.yInnerPadding,s=e.yOuterPadding,l=e.forceSquare,c=new Set,u=[],f=[],p=[];t.forEach((function(e){u.push(e.id),e.data.forEach((function(t){c.add(t.x);var n=null;void 0!==t.y&&null!==t.y&&(f.push(t.y),n=t.y),p.push({id:e.id+"."+t.x,serieId:e.id,value:n,data:t})}))}));var g=Array.from(c),y=function(e){var t=e.width,n=e.height,r=e.rows,i=e.columns,o=t,a=n,s=0,l=0;if(e.forceSquare){var c=Math.max(t/i,0),u=Math.max(n/r,0),d=Math.min(c,u);s=(t-(o=d*i))/2,l=(n-(a=d*r))/2}return{offsetX:s,offsetY:l,width:o,height:a}}({width:n,height:r,columns:g.length,rows:u.length,forceSquare:l}),b=y.width,v=y.height,x=y.offsetX,w=y.offsetY,S=(0,h.nj)((0,d.A)().domain(g).range([0,b]).paddingOuter(o).paddingInner(i)),k=(0,h.nj)((0,d.A)().domain(u).range([0,v]).paddingOuter(s).paddingInner(a)),_=S.bandwidth(),C=k.bandwidth(),M=p.map((function(e){return m({},e,{x:S(e.data.x)+_/2,y:k(e.serieId)+C/2,width:_,height:C})}));return{width:b,height:v,offsetX:x,offsetY:w,xScale:S,yScale:k,minValue:Math.min.apply(Math,f),maxValue:Math.max.apply(Math,f),cells:M}}({data:t,width:n,height:i,xInnerPadding:o,xOuterPadding:a,yInnerPadding:s,yOuterPadding:l,forceSquare:c})}),[t,n,i,o,a,s,l,c])},w={cell:function(e,t){return e.id===t.id},row:function(e,t){return e.serieId===t.serieId},column:function(e,t){return e.data.x===t.data.x},rowColumn:function(e,t){return e.serieId===t.serieId||e.data.x===t.data.x}},S=function(e){var t,n,o,a=e.cells,l=e.minValue,c=e.maxValue,u=e.sizeVariation,d=e.colors,h=e.emptyColor,p=e.opacity,g=e.activeOpacity,y=e.inactiveOpacity,b=e.borderColor,v=e.label,x=e.labelTextColor,w=e.valueFormat,S=e.activeIds,k=(0,r.useMemo)((function(){return function(e,t,n){if(!e)return function(){return 1};var r=(0,f.A)().domain(e.values?e.values:[t,n]).range(e.sizes);return function(e){return null===e?1:r(e)}}(t,n,o)}),[t=u,n=l,o=c]),_=(0,r.useMemo)((function(){return"function"==typeof d?null:(0,s.pN)(d,{min:l,max:c})}),[d,l,c]),C=(0,r.useCallback)((function(e){if(null!==e.value){if("function"==typeof d)return d(e);if(null!==_)return _(e.value)}return h}),[d,_,h]),M=(0,i.DP)(),A=(0,s.nz)(b,M),j=(0,s.nz)(x,M),O=(0,i.d_)(w),T=(0,i.Ob)(v);return{cells:(0,r.useMemo)((function(){return a.map((function(e){var t=p;S.length>0&&(t=S.includes(e.id)?g:y);var n=k(e.value),r=m({},e,{width:e.width*n,height:e.height*n,formattedValue:null!==e.value?O(e.value):null,opacity:t});return r.label=T(r),r.color=C(r),r.borderColor=A(r),r.labelTextColor=j(r),r}))}),[a,k,C,A,j,O,T,S,p,g,y]),colorScale:_}},k=function(e){var t=e.data,n=e.valueFormat,i=e.width,o=e.height,a=e.xOuterPadding,s=void 0===a?g.xOuterPadding:a,l=e.xInnerPadding,c=void 0===l?g.xInnerPadding:l,u=e.yOuterPadding,d=void 0===u?g.yOuterPadding:u,f=e.yInnerPadding,h=void 0===f?g.yInnerPadding:f,p=e.forceSquare,m=void 0===p?g.forceSquare:p,y=e.sizeVariation,b=void 0===y?g.sizeVariation:y,v=e.colors,k=void 0===v?g.colors:v,_=e.emptyColor,C=void 0===_?g.emptyColor:_,M=e.opacity,A=void 0===M?g.opacity:M,j=e.activeOpacity,O=void 0===j?g.activeOpacity:j,T=e.inactiveOpacity,P=void 0===T?g.inactiveOpacity:T,E=e.borderColor,R=void 0===E?g.borderColor:E,D=e.label,I=void 0===D?g.label:D,L=e.labelTextColor,z=void 0===L?g.labelTextColor:L,F=e.hoverTarget,$=void 0===F?g.hoverTarget:F,N=(0,r.useState)(null),W=N[0],B=N[1],H=x({data:t,width:i,height:o,xOuterPadding:s,xInnerPadding:c,yOuterPadding:d,yInnerPadding:h,forceSquare:m}),q=H.width,U=H.height,V=H.offsetX,Y=H.offsetY,G=H.cells,K=H.xScale,X=H.yScale,Q=H.minValue,Z=H.maxValue,J=(0,r.useMemo)((function(){if(!W)return[];var e=w[$];return G.filter((function(t){return e(t,W)})).map((function(e){return e.id}))}),[G,W,$]),ee=S({cells:G,minValue:Q,maxValue:Z,sizeVariation:b,colors:k,emptyColor:C,opacity:A,activeOpacity:O,inactiveOpacity:P,borderColor:R,label:I,labelTextColor:z,valueFormat:n,activeIds:J});return{width:q,height:U,offsetX:V,offsetY:Y,cells:ee.cells,xScale:K,yScale:X,colorScale:ee.colorScale,activeCell:W,setActiveCell:B}},_=function(e,t){return(0,l.wI)({data:e,annotations:t,getPosition:b,getDimensions:v})},C=((0,r.memo)((function(e){var t=e.cell,n=e.borderWidth,o=e.borderRadius,a=e.animatedProps,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,d=e.onClick,f=e.enableLabels,h=(0,i.DP)(),g=(0,r.useMemo)((function(){return{onMouseEnter:s?s(t):void 0,onMouseMove:l?l(t):void 0,onMouseLeave:c?c(t):void 0,onClick:d?d(t):void 0}}),[t,s,l,c,d]);return(0,u.jsxs)(p.CS.g,m({"data-testid":"cell."+t.id,style:{cursor:"pointer"},opacity:a.opacity},g,{transform:(0,p.to)([a.x,a.y,a.scale],(function(e,t,n){return"translate("+e+", "+t+") scale("+n+")"})),children:[(0,u.jsx)(p.CS.rect,{transform:(0,p.to)([a.width,a.height],(function(e,t){return"translate("+-.5*e+", "+-.5*t+")"})),fill:a.color,width:a.width,height:a.height,stroke:a.borderColor,strokeWidth:n,rx:o,ry:o},t.id),f&&(0,u.jsx)(p.CS.text,{textAnchor:"middle",dominantBaseline:"central",fill:a.labelTextColor,style:m({},h.labels.text,{fill:void 0,userSelect:"none"}),children:t.label})]}))})),(0,r.memo)((function(e){var t=e.cell,n=e.borderWidth,o=e.animatedProps,a=e.onMouseEnter,s=e.onMouseMove,l=e.onMouseLeave,c=e.onClick,d=e.enableLabels,f=(0,i.DP)(),h=(0,r.useMemo)((function(){return{onMouseEnter:a?a(t):void 0,onMouseMove:s?s(t):void 0,onMouseLeave:l?l(t):void 0,onClick:c?c(t):void 0}}),[t,a,s,l,c]);return(0,u.jsxs)(p.CS.g,m({"data-testid":"cell."+t.id,style:{cursor:"pointer"},opacity:o.opacity},h,{transform:(0,p.to)([o.x,o.y],(function(e,t){return"translate("+e+", "+t+")"})),children:[(0,u.jsx)(p.CS.circle,{r:(0,p.to)([o.width,o.height],(function(e,t){return Math.min(e,t)/2})),fill:o.color,fillOpacity:o.opacity,strokeWidth:n,stroke:o.borderColor}),d&&(0,u.jsx)(p.CS.text,{dominantBaseline:"central",textAnchor:"middle",fill:o.labelTextColor,style:m({},f.labels.text,{fill:void 0}),children:t.label})]}))})),function(e,t){var n=t.cell,r=n.x,i=n.y,o=n.width,a=n.height,s=n.color,l=n.borderColor,c=n.opacity,u=n.labelTextColor,d=n.label,f=t.borderWidth,h=t.enableLabels,p=t.theme;e.save(),e.globalAlpha=c,e.fillStyle=s,f>0&&(e.strokeStyle=l,e.lineWidth=f),e.fillRect(r-o/2,i-a/2,o,a),f>0&&e.strokeRect(r-o/2,i-a/2,o,a),h&&(e.fillStyle=u,e.font=(p.labels.text.fontWeight?p.labels.text.fontWeight+" ":"")+p.labels.text.fontSize+"px "+p.labels.text.fontFamily,e.textAlign="center",e.textBaseline="middle",e.fillText(d,r,i)),e.restore()}),M=function(e,t){var n=t.cell,r=n.x,i=n.y,o=n.width,a=n.height,s=n.color,l=n.borderColor,c=n.opacity,u=n.labelTextColor,d=n.label,f=t.borderWidth,h=t.enableLabels,p=t.theme;e.save(),e.globalAlpha=c;var m=Math.min(o,a)/2;e.fillStyle=s,f>0&&(e.strokeStyle=l,e.lineWidth=f),e.beginPath(),e.arc(r,i,m,0,2*Math.PI),e.fill(),f>0&&e.stroke(),h&&(e.fillStyle=u,e.font=(p.labels.text.fontWeight?p.labels.text.fontWeight+" ":"")+p.labels.text.fontSize+"px "+p.labels.text.fontFamily,e.textAlign="center",e.textBaseline="middle",e.fillText(d,r,i)),e.restore()},A=["theme","isInteractive","animate","motionConfig","renderWrapper"],j=function(e){var t,n=e.data,s=e.layers,d=void 0===s?y.layers:s,f=e.valueFormat,h=e.width,p=e.height,g=e.margin,b=e.xInnerPadding,v=void 0===b?y.xInnerPadding:b,x=e.xOuterPadding,w=void 0===x?y.xOuterPadding:x,S=e.yInnerPadding,A=void 0===S?y.yInnerPadding:S,j=e.yOuterPadding,O=void 0===j?y.yOuterPadding:j,T=e.forceSquare,P=void 0===T?y.forceSquare:T,E=e.sizeVariation,R=void 0===E?y.sizeVariation:E,D=e.renderCell,I=void 0===D?y.renderCell:D,L=e.opacity,z=void 0===L?y.opacity:L,F=e.activeOpacity,$=void 0===F?y.activeOpacity:F,N=e.inactiveOpacity,W=void 0===N?y.inactiveOpacity:N,B=e.borderWidth,H=void 0===B?y.borderWidth:B,q=e.borderColor,U=void 0===q?y.borderColor:q,V=e.enableGridX,Y=void 0===V?y.enableGridX:V,G=e.enableGridY,K=void 0===G?y.enableGridY:G,X=e.axisTop,Q=void 0===X?y.axisTop:X,Z=e.axisRight,J=void 0===Z?y.axisRight:Z,ee=e.axisBottom,te=void 0===ee?y.axisBottom:ee,ne=e.axisLeft,re=void 0===ne?y.axisLeft:ne,ie=e.enableLabels,oe=void 0===ie?y.enableLabels:ie,ae=e.label,se=void 0===ae?y.label:ae,le=e.labelTextColor,ce=void 0===le?y.labelTextColor:le,ue=e.colors,de=void 0===ue?y.colors:ue,fe=e.emptyColor,he=void 0===fe?y.emptyColor:fe,pe=e.legends,me=void 0===pe?y.legends:pe,ge=e.annotations,ye=void 0===ge?y.annotations:ge,be=e.isInteractive,ve=void 0===be?y.isInteractive:be,xe=e.onClick,we=e.hoverTarget,Se=void 0===we?y.hoverTarget:we,ke=e.tooltip,_e=void 0===ke?y.tooltip:ke,Ce=e.role,Me=e.ariaLabel,Ae=e.ariaLabelledBy,je=e.ariaDescribedBy,Oe=e.pixelRatio,Te=void 0===Oe?y.pixelRatio:Oe,Pe=(0,r.useRef)(null),Ee=(0,i.Xl)(h,p,g),Re=Ee.margin,De=Ee.innerWidth,Ie=Ee.innerHeight,Le=Ee.outerWidth,ze=Ee.outerHeight,Fe=k({data:n,valueFormat:f,width:De,height:Ie,xInnerPadding:v,xOuterPadding:w,yInnerPadding:A,yOuterPadding:O,forceSquare:P,sizeVariation:R,colors:de,emptyColor:he,opacity:z,activeOpacity:$,inactiveOpacity:W,borderColor:U,label:se,labelTextColor:ce,hoverTarget:Se}),$e=Fe.width,Ne=Fe.height,We=Fe.offsetX,Be=Fe.offsetY,He=Fe.xScale,qe=Fe.yScale,Ue=Fe.cells,Ve=Fe.colorScale,Ye=Fe.activeCell,Ge=Fe.setActiveCell,Ke=(0,r.useMemo)((function(){return m({},Re,{top:Re.top+Be,left:Re.left+We})}),[Re,We,Be]),Xe=_(Ue,ye),Qe=(0,l.x$)({annotations:Xe});t="function"==typeof I?I:"circle"===I?M:C;var Ze=(0,i.DP)(),Je=(0,r.useMemo)((function(){return{cells:Ue,activeCell:Ye,setActiveCell:Ge}}),[Ue,Ye,Ge]);(0,r.useEffect)((function(){if(null!==Pe.current){var e=Pe.current.getContext("2d");e&&(Pe.current.width=Le*Te,Pe.current.height=ze*Te,e.scale(Te,Te),e.fillStyle=Ze.background,e.fillRect(0,0,Le,ze),e.translate(Ke.left,Ke.top),d.forEach((function(n){"grid"===n?(e.lineWidth=Ze.grid.line.strokeWidth,e.strokeStyle=Ze.grid.line.stroke,Y&&(0,o.xu)(e,{width:$e,height:Ne,scale:He,axis:"x"}),K&&(0,o.xu)(e,{width:$e,height:Ne,scale:qe,axis:"y"})):"axes"===n?(0,o.ZY)(e,{xScale:He,yScale:qe,width:$e,height:Ne,top:Q,right:J,bottom:te,left:re,theme:Ze}):"cells"===n?(e.textAlign="center",e.textBaseline="middle",Ue.forEach((function(n){t(e,{cell:n,borderWidth:H,enableLabels:oe,theme:Ze})}))):"legends"===n&&null!==Ve?me.forEach((function(t){(0,a.Rm)(e,m({},t,{containerWidth:$e,containerHeight:Ne,scale:Ve,theme:Ze}))})):"annotations"===n?(0,l.e0)(e,{annotations:Qe,theme:Ze}):"function"==typeof n&&n(e,Je)})))}}),[Pe,Te,Le,ze,$e,Ne,Ke,d,Je,Ue,t,Y,K,Q,J,te,re,He,qe,Ze,H,oe,Ve,me,Qe]);var et=(0,c.fS)(),tt=et.showTooltipFromEvent,nt=et.hideTooltip,rt=(0,r.useCallback)((function(e){if(null!==Pe.current){var t=(0,i.H9)(Pe.current,e),n=t[0],o=t[1],a=Ue.find((function(e){return(0,i.u7)(e.x+Ke.left-e.width/2,e.y+Ke.top-e.height/2,e.width,e.height,n,o)}));void 0!==a?(Ge(a),tt((0,r.createElement)(_e,{cell:a}),e)):(Ge(null),nt())}}),[Pe,Ue,Ke,Ge,tt,nt,_e]),it=(0,r.useCallback)((function(){Ge(null),nt()}),[Ge,nt]),ot=(0,r.useCallback)((function(e){null!==Ye&&(null==xe||xe(Ye,e))}),[Ye,xe]);return(0,u.jsx)("canvas",{ref:Pe,width:Le*Te,height:ze*Te,style:{width:Le,height:ze},onMouseEnter:ve?rt:void 0,onMouseMove:ve?rt:void 0,onMouseLeave:ve?it:void 0,onClick:ve?ot:void 0,role:Ce,"aria-label":Me,"aria-labelledby":Ae,"aria-describedby":je})},O=function(e){var t=e.theme,n=e.isInteractive,r=void 0===n?y.isInteractive:n,o=e.animate,a=void 0===o?y.animate:o,s=e.motionConfig,l=void 0===s?y.motionConfig:s,c=e.renderWrapper,d=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,A);return(0,u.jsx)(i.mc,{isInteractive:r,animate:a,motionConfig:l,theme:t,renderWrapper:c,children:(0,u.jsx)(j,m({isInteractive:r},d))})},T=function(e){return(0,u.jsx)(i.KF,{children:function(t){var n=t.width,r=t.height;return(0,u.jsx)(O,m({width:n,height:r},e))}})},P=n(7382),E=function(e){var t=e.data,n=e.chartConfig;if(!t||!1===t.success)return(0,u.jsx)("div",{children:"Error: no data provided"});var r=n.xAxisLabel,i=n.yAxisLabel,o=n.theme,a=n.minValue,s=n.maxValue;return(0,u.jsx)("div",{className:"dashboard-chart-container",children:(0,u.jsx)("div",{className:"dashboard-chart",role:"graphics-datachart",children:(0,u.jsx)(T,{"test-id":"heatmap",data:t,margin:{top:30,right:80,bottom:50,left:80},valueFormat:">-.2s",axisRight:{tickSize:5,tickPadding:5,tickRotation:0,legend:i,legendPosition:"middle",legendOffset:70,truncateTickAt:0},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:i,legendPosition:"middle",legendOffset:-72,truncateTickAt:0},colors:(0,P.g)(o,a,s),emptyColor:"#555555",opacity:10,legends:[{anchor:"bottom",translateX:0,translateY:30,length:400,thickness:8,direction:"row",tickPosition:"after",tickSize:3,tickSpacing:4,tickOverlap:!1,tickFormat:">-.2s",title:r+" Value →",titleAlign:"start",titleOffset:4}],onClick:function(e){return console.log(e)}},o)})})}},512:(e,t,n)=>{"use strict";n.d(t,{LineChart:()=>Ce});var r=n(9155),i=n(5650),o=n(4028),a=n(4782),s=n(6714),l=n(806),c=n(8640),u=n(5917),d=n(8946),f=n(6343),h=