@undp/data-viz 2.1.2 → 2.1.3

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.
Files changed (90) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +2 -2
  3. package/dist/BarGraph.cjs +1 -1
  4. package/dist/BarGraph.js +1 -1
  5. package/dist/BulletChart.cjs +1 -1
  6. package/dist/BulletChart.cjs.map +1 -1
  7. package/dist/BulletChart.js +223 -223
  8. package/dist/BulletChart.js.map +1 -1
  9. package/dist/ButterflyChart.cjs +1 -1
  10. package/dist/ButterflyChart.js +1 -1
  11. package/dist/DifferenceLineChart.cjs +1 -1
  12. package/dist/DifferenceLineChart.js +2 -2
  13. package/dist/DonutChart.cjs +1 -1
  14. package/dist/DonutChart.cjs.map +1 -1
  15. package/dist/DonutChart.d.ts +10 -0
  16. package/dist/DonutChart.js +230 -264
  17. package/dist/DonutChart.js.map +1 -1
  18. package/dist/DualAxisLineChart.cjs +1 -1
  19. package/dist/DualAxisLineChart.js +1 -1
  20. package/dist/DumbbellChart.cjs +1 -1
  21. package/dist/DumbbellChart.js +1 -1
  22. package/dist/{GraphEl-YKUlz-37.cjs → GraphEl-BLMih7RN.cjs} +2 -2
  23. package/dist/GraphEl-BLMih7RN.cjs.map +1 -0
  24. package/dist/{GraphEl-sVZvlyWe.js → GraphEl-CRrAlbcr.js} +4 -2
  25. package/dist/GraphEl-CRrAlbcr.js.map +1 -0
  26. package/dist/GriddedGraphs.cjs +1 -1
  27. package/dist/GriddedGraphs.d.ts +1 -0
  28. package/dist/GriddedGraphs.js +1 -1
  29. package/dist/GriddedGraphsFromConfig.d.ts +1 -0
  30. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  31. package/dist/LineChartWithConfidenceInterval.js +2 -2
  32. package/dist/MultiGraphDashboard.d.ts +1 -0
  33. package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
  34. package/dist/MultiLineAltChart.cjs +1 -1
  35. package/dist/MultiLineAltChart.js +1 -1
  36. package/dist/MultiLineChart.cjs +1 -1
  37. package/dist/MultiLineChart.js +1 -1
  38. package/dist/ParetoChart.cjs +1 -1
  39. package/dist/ParetoChart.js +1 -1
  40. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
  41. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
  42. package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
  43. package/dist/RadarChart.cjs +1 -1
  44. package/dist/RadarChart.js +1 -1
  45. package/dist/ScatterPlot.cjs +1 -1
  46. package/dist/ScatterPlot.js +1 -1
  47. package/dist/ScrollStory.d.ts +1 -0
  48. package/dist/SimpleLineChart.cjs +1 -1
  49. package/dist/SimpleLineChart.js +1 -1
  50. package/dist/SingleGraphDashboard.cjs +1 -1
  51. package/dist/SingleGraphDashboard.d.ts +1 -0
  52. package/dist/SingleGraphDashboard.js +1 -1
  53. package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
  54. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
  55. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
  56. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
  57. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
  58. package/dist/SparkLine.cjs +1 -1
  59. package/dist/SparkLine.js +2 -2
  60. package/dist/Types.d.ts +1 -0
  61. package/dist/{area-BE2wo7fv.js → area-B6r7cv2o.js} +5 -5
  62. package/dist/{area-BE2wo7fv.js.map → area-B6r7cv2o.js.map} +1 -1
  63. package/dist/area-C1gxfNGD.cjs +2 -0
  64. package/dist/{area-D3Qx7k7K.cjs.map → area-C1gxfNGD.cjs.map} +1 -1
  65. package/dist/array-DMyR1sql.cjs +2 -0
  66. package/dist/array-DMyR1sql.cjs.map +1 -0
  67. package/dist/array-USo-Szhp.js +13 -0
  68. package/dist/array-USo-Szhp.js.map +1 -0
  69. package/dist/{ensureCompleteData-DS7gCvVd.js → ensureCompleteData-DH5c52Ub.js} +6 -6
  70. package/dist/{ensureCompleteData-DS7gCvVd.js.map → ensureCompleteData-DH5c52Ub.js.map} +1 -1
  71. package/dist/{ensureCompleteData-Oib-vGb0.cjs → ensureCompleteData-pZ9QO6kB.cjs} +2 -2
  72. package/dist/{ensureCompleteData-Oib-vGb0.cjs.map → ensureCompleteData-pZ9QO6kB.cjs.map} +1 -1
  73. package/dist/index.d.ts +5 -0
  74. package/dist/line-DFlZsxI1.js +144 -0
  75. package/dist/line-DFlZsxI1.js.map +1 -0
  76. package/dist/line-DaEMhXmx.cjs +2 -0
  77. package/dist/line-DaEMhXmx.cjs.map +1 -0
  78. package/dist/style.css +1 -1
  79. package/package.json +1 -1
  80. package/dist/GraphEl-YKUlz-37.cjs.map +0 -1
  81. package/dist/GraphEl-sVZvlyWe.js.map +0 -1
  82. package/dist/area-D3Qx7k7K.cjs +0 -2
  83. package/dist/array-B7TkkRH0.js +0 -89
  84. package/dist/array-B7TkkRH0.js.map +0 -1
  85. package/dist/array-DKbXV8lR.cjs +0 -2
  86. package/dist/array-DKbXV8lR.cjs.map +0 -1
  87. package/dist/line-CPfhohvF.js +0 -68
  88. package/dist/line-CPfhohvF.js.map +0 -1
  89. package/dist/line-DHV4JwCR.cjs +0 -2
  90. package/dist/line-DHV4JwCR.cjs.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),k=require("react"),ue=require("./getSliderMarks-BmADcPQt.cjs"),xe=require("./parse-hMnG_lRV.cjs"),me=require("./index-DQA8q5sC.cjs"),de=require("./numberFormattingFunction-02t-wJta.cjs"),ve=require("./Tooltip-uUdw6wJL.cjs"),pe=require("./XTicksAndGridLines-B6CELS7q.cjs"),he=require("./Axis-DxRV2yMi.cjs"),we=require("./YAxesLabels-DesLesUP.cjs"),fe=require("./ReferenceLine-BH0qdf4R.cjs"),Re=require("./DetailsModal-BN0HDFlV.cjs"),Ee=require("./band-VYfcZeJ2.cjs"),ge=require("./linear-BwPAspcq.cjs"),Ae=require("./use-in-view-QcfiW0w3.cjs"),Ot=require("./proxy-BxvUI_9l.cjs"),le=require("./index-DG2bgAva.cjs"),Be=require("./GraphFooter.cjs"),Ce=require("./GraphHeader.cjs"),Le=require("./ColorLegend.cjs"),ye=require("./Colors.cjs"),ke=require("./EmptyState-sAEZ_5rU.cjs"),be=require("./index-DRXx7m-C.cjs"),ce=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Me=require("./ensureCompleteData-Oib-vGb0.cjs"),je=require("./GraphContainer-d8A46BK2.cjs");function Ve(s){const t=i.compilerRuntimeExports.c(140),{data:l,width:R,height:j,barColors:x,centerGap:v,refValues:f,maxValue:ct,minValue:wt,showValues:ut,axisTitles:xt,rightMargin:zt,leftMargin:Jt,topMargin:Y,bottomMargin:Kt,tooltip:Nt,onSeriesMouseOver:mt,barPadding:St,truncateBy:Rt,onSeriesMouseClick:M,showTicks:Et,suffix:dt,prefix:pt,resetSelectionOnDoubleClick:At,detailsOnClick:O,styles:a,classNames:n,noOfTicks:E,animate:u,precision:ht,customLayers:N,minValueLeftBar:S,minValueRightBar:D,naLabel:Dt}=s,se=k.useRef(null);let qt;t[0]!==u.amount||t[1]!==u.once?(qt={once:u.once,amount:u.amount},t[0]=u.amount,t[1]=u.once,t[2]=qt):qt=t[2];const A=Ae.useInView(se,qt),[Tt,ft]=k.useState(void 0),[V,Bt]=k.useState(void 0),[Ct,m]=k.useState(void 0),[p,gt]=k.useState(void 0);let Ft;t[3]!==Kt||t[4]!==Jt||t[5]!==zt||t[6]!==Y?(Ft={top:Y,bottom:Kt,left:Jt,right:zt},t[3]=Kt,t[4]=Jt,t[5]=zt,t[6]=Y,t[7]=Ft):Ft=t[7];const d=Ft,B=R-d.left-d.right,w=j-d.top-d.bottom;let yt,q,T,U,W,z,J,K,F,C,Q,Z,_,tt;if(t[8]!==u||t[9]!==x[0]||t[10]!==x[1]||t[11]!==St||t[12]!==v||t[13]!==n?.graphObjectValues||t[14]!==n?.xAxis?.gridLines||t[15]!==n?.xAxis?.labels||t[16]!==n?.yAxis?.axis||t[17]!==n?.yAxis?.labels||t[18]!==N||t[19]!==l||t[20]!==O||t[21]!==w||t[22]!==B||t[23]!==j||t[24]!==A||t[25]!==d.bottom||t[26]!==d.left||t[27]!==d.top||t[28]!==ct||t[29]!==wt||t[30]!==S||t[31]!==D||t[32]!==V||t[33]!==Dt||t[34]!==E||t[35]!==M||t[36]!==mt||t[37]!==ht||t[38]!==pt||t[39]!==f||t[40]!==At||t[41]!==Et||t[42]!==ut||t[43]!==a?.graphObjectValues||t[44]!==a?.xAxis?.gridLines||t[45]!==a?.xAxis?.labels||t[46]!==a?.yAxis?.axis||t[47]!==a?.yAxis?.labels||t[48]!==dt||t[49]!==Y||t[50]!==Rt||t[51]!==R){const bt=l.map(Ge),$=Ee.band().domain(bt.map(Ie)).range([w,0]).paddingInner(St),r=ge.linear().domain([wt,ct]).range([0,(B-v)/2]).nice(),ne=r.ticks(E),h=ge.linear().domain([wt,ct]).range([(B-v)/2,0]).nice(),c=h.ticks(E);T=Ot.motion.svg,_=`${R}px`,tt=`${j}px`,U=`0 0 ${R} ${j}`,W="ltr",z=se,F=`translate(${d.left},${d.top})`,t[66]!==N?(C=N.filter(Fe).map(Te),t[66]=N,t[67]=C):C=t[67];const L=n?.yAxis?.axis;let Mt;t[68]!==L?(Mt={axis:L},t[68]=L,t[69]=Mt):Mt=t[69];const Yt=a?.yAxis?.axis;let Ut;t[70]!==Yt?(Ut={axis:Yt},t[70]=Yt,t[71]=Ut):Ut=t[71],Q=i.jsxRuntimeExports.jsxs("g",{transform:"translate(0,0)",children:[Et?i.jsxRuntimeExports.jsx(pe.XTicksAndGridLines,{values:c.filter(qe),x:c.filter(De).map(e=>h(e)),y1:0-Y,y2:w+d.bottom,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:dt,prefix:pt,labelType:"secondary",showGridLines:!0,leftLabel:!0,precision:ht}):null,i.jsxRuntimeExports.jsxs(le.AnimatePresence,{children:[bt.map((e,g)=>i.jsxRuntimeExports.jsxs(Ot.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{ft(e),gt(b.clientY),m(b.clientX),mt?.(e)},onClick:()=>{(M||O)&&(me.isEqual(V,e)&&At?(Bt(void 0),M?.(void 0)):(Bt(e),M?.(e)))},onMouseMove:b=>{ft(e),gt(b.clientY),m(b.clientX)},onMouseLeave:()=>{ft(void 0),m(void 0),gt(void 0),mt?.(void 0)},children:[e.leftBar?i.jsxRuntimeExports.jsx(Ot.motion.rect,{y:$(`${g}`),style:{fill:x[0]},height:$.bandwidth(),variants:{initial:{x:h(0),width:0},whileInView:{x:e.leftBar<0?h(0):h(e.leftBar),width:e.leftBar<0?h(e.leftBar)-h(0):h(0)-h(e.leftBar),transition:{duration:u.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{x:h(0),width:0,transition:{duration:u.duration}}}):null,ut?i.jsxRuntimeExports.jsx(Ot.motion.text,{y:$(`${g}`)+$.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar>0?"end":"start",...a?.graphObjectValues||{}},dx:e.rightBar&&e.rightBar>0?-5:5,dy:"0.33em",className:i.mo("graph-value text-sm",n?.graphObjectValues),exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x:h(0),opacity:0,fill:x[0]},whileInView:{x:e.leftBar?h(e.leftBar):h(S<0?0:S),opacity:1,fill:x[0],transition:{duration:u.duration}}},initial:"initial",animate:A?"whileInView":"initial",children:de.numberFormattingFunction(e.rightBar,Dt,ht,pt,dt)}):null]},e.label)),i.jsxRuntimeExports.jsx(he.Axis,{y1:-2.5,y2:w+d.bottom,x1:h(S<0?0:S),x2:h(S<0?0:S),classNames:Mt,styles:Ut}),f?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:f.map((e,g)=>i.jsxRuntimeExports.jsx(fe.RefLineX,{text:e.text,color:e.color,x:h(e.value),y1:0-d.top,y2:w+d.bottom,textSide:"left",classNames:e.classNames,styles:e.styles,animate:u,isInView:A},g))}):null]})]});const Vt=n?.yAxis?.axis;let jt;t[72]!==Vt?(jt={axis:Vt},t[72]=Vt,t[73]=jt):jt=t[73];const $t=a?.yAxis?.axis;let vt;t[74]!==$t?(vt={axis:$t},t[74]=$t,t[75]=vt):vt=t[75],Z=i.jsxRuntimeExports.jsxs("g",{transform:`translate(${(B+v)/2},0)`,children:[Et?i.jsxRuntimeExports.jsx(pe.XTicksAndGridLines,{values:ne.filter(Se),x:ne.filter(Ne).map(e=>r(e)),y1:0-Y,y2:w+d.bottom,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:dt,prefix:pt,labelType:"secondary",showGridLines:!0,precision:ht}):null,i.jsxRuntimeExports.jsxs(le.AnimatePresence,{children:[bt.map((e,g)=>i.jsxRuntimeExports.jsxs(Ot.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{ft(e),gt(b.clientY),m(b.clientX),mt?.(e)},onClick:()=>{(M||O)&&(me.isEqual(V,e)&&At?(Bt(void 0),M?.(void 0)):(Bt(e),M?.(e)))},onMouseMove:b=>{ft(e),gt(b.clientY),m(b.clientX)},onMouseLeave:()=>{ft(void 0),m(void 0),gt(void 0),mt?.(void 0)},children:[e.rightBar?i.jsxRuntimeExports.jsx(Ot.motion.rect,{y:$(`${g}`),style:{fill:x[1]},height:$.bandwidth(),exit:{x:r(0),width:0,transition:{duration:u.duration}},variants:{initial:{x:r(0),width:0},whileInView:{x:e.rightBar>=0?r(0):r(e.rightBar),width:e.rightBar>=0?r(e.rightBar)-r(0):r(0)-r(e.rightBar),transition:{duration:u.duration}}},initial:"initial",animate:A?"whileInView":"initial"}):null,ut?i.jsxRuntimeExports.jsx(Ot.motion.text,{y:$(`${g}`)+$.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar<0?"end":"start",...a?.graphObjectValues||{}},className:i.mo("graph-value text-sm",n?.graphObjectValues),dx:e.rightBar&&e.rightBar<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x:r(0),opacity:0,fill:x[1]},whileInView:{x:e.rightBar?r(e.rightBar):r(D<0?0:D),opacity:1,fill:x[1],transition:{duration:u.duration}}},initial:"initial",animate:A?"whileInView":"initial",children:de.numberFormattingFunction(e.rightBar,Dt,ht,pt,dt)}):null]},g)),i.jsxRuntimeExports.jsx(he.Axis,{y1:-2.5,y2:w+d.bottom,x1:r(D<0?0:D),x2:r(D<0?0:D),classNames:jt,styles:vt}),f?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:f.map((e,g)=>i.jsxRuntimeExports.jsx(fe.RefLineX,{text:e.text,color:e.color,x:r(e.value),y1:0-d.top,y2:w+d.bottom,textSide:"right",classNames:e.classNames,styles:e.styles,animate:u,isInView:A},g))}):null]})]}),q=le.AnimatePresence,yt=Ot.motion.g,J=`translate(${B/2},0)`,K=bt.map((e,g)=>i.jsxRuntimeExports.jsx(we.YAxesLabels,{value:`${e.label}`.length<Rt?`${e.label}`:`${`${e.label}`.substring(0,Rt)}...`,y:$(`${e.id}`),x:0-v/2,width:v,height:$.bandwidth(),alignment:"center",style:a?.yAxis?.labels,className:n?.yAxis?.labels,animate:u,isInView:A},g)),t[8]=u,t[9]=x[0],t[10]=x[1],t[11]=St,t[12]=v,t[13]=n?.graphObjectValues,t[14]=n?.xAxis?.gridLines,t[15]=n?.xAxis?.labels,t[16]=n?.yAxis?.axis,t[17]=n?.yAxis?.labels,t[18]=N,t[19]=l,t[20]=O,t[21]=w,t[22]=B,t[23]=j,t[24]=A,t[25]=d.bottom,t[26]=d.left,t[27]=d.top,t[28]=ct,t[29]=wt,t[30]=S,t[31]=D,t[32]=V,t[33]=Dt,t[34]=E,t[35]=M,t[36]=mt,t[37]=ht,t[38]=pt,t[39]=f,t[40]=At,t[41]=Et,t[42]=ut,t[43]=a?.graphObjectValues,t[44]=a?.xAxis?.gridLines,t[45]=a?.xAxis?.labels,t[46]=a?.yAxis?.axis,t[47]=a?.yAxis?.labels,t[48]=dt,t[49]=Y,t[50]=Rt,t[51]=R,t[52]=yt,t[53]=q,t[54]=T,t[55]=U,t[56]=W,t[57]=z,t[58]=J,t[59]=K,t[60]=F,t[61]=C,t[62]=Q,t[63]=Z,t[64]=_,t[65]=tt}else yt=t[52],q=t[53],T=t[54],U=t[55],W=t[56],z=t[57],J=t[58],K=t[59],F=t[60],C=t[61],Q=t[62],Z=t[63],_=t[64],tt=t[65];let I;t[76]!==yt||t[77]!==J||t[78]!==K?(I=i.jsxRuntimeExports.jsx(yt,{transform:J,children:K}),t[76]=yt,t[77]=J,t[78]=K,t[79]=I):I=t[79];let et;t[80]!==q||t[81]!==I?(et=i.jsxRuntimeExports.jsx(q,{children:I}),t[80]=q,t[81]=I,t[82]=et):et=t[82];const It=`translate(0,${w})`,Gt=a?.yAxis?.title;let it;t[83]!==x[0]||t[84]!==Gt?(it={fill:x[0],textAnchor:"end",...Gt},t[83]=x[0],t[84]=Gt,t[85]=it):it=t[85];const Pt=n?.yAxis?.title;let G;t[86]!==Pt?(G=i.mo("text-base",Pt),t[86]=Pt,t[87]=G):G=t[87];const Lt=B/2-v/2;let st;t[88]!==xt[0]||t[89]!==it||t[90]!==G||t[91]!==Lt?(st=i.jsxRuntimeExports.jsx("text",{style:it,className:G,x:Lt,y:0,dx:-5,dy:20,children:xt[0]}),t[88]=xt[0],t[89]=it,t[90]=G,t[91]=Lt,t[92]=st):st=t[92];const Xt=a?.yAxis?.title;let nt;t[93]!==x[1]||t[94]!==Xt?(nt={fill:x[1],textAnchor:"start",...Xt},t[93]=x[1],t[94]=Xt,t[95]=nt):nt=t[95];const Ht=n?.yAxis?.title;let ot;t[96]!==Ht?(ot=i.mo("text-base",Ht),t[96]=Ht,t[97]=ot):ot=t[97];const kt=B/2+v/2;let at;t[98]!==xt[1]||t[99]!==nt||t[100]!==ot||t[101]!==kt?(at=i.jsxRuntimeExports.jsx("text",{style:nt,className:ot,x:kt,y:0,dx:5,dy:20,children:xt[1]}),t[98]=xt[1],t[99]=nt,t[100]=ot,t[101]=kt,t[102]=at):at=t[102];let P;t[103]!==It||t[104]!==st||t[105]!==at?(P=i.jsxRuntimeExports.jsxs("g",{transform:It,children:[st,at]}),t[103]=It,t[104]=st,t[105]=at,t[106]=P):P=t[106];let rt;t[107]!==N?(rt=N.filter(Oe).map($e),t[107]=N,t[108]=rt):rt=t[108];let X;t[109]!==et||t[110]!==P||t[111]!==rt||t[112]!==F||t[113]!==C||t[114]!==Q||t[115]!==Z?(X=i.jsxRuntimeExports.jsxs("g",{transform:F,children:[C,Q,Z,et,P,rt]}),t[109]=et,t[110]=P,t[111]=rt,t[112]=F,t[113]=C,t[114]=Q,t[115]=Z,t[116]=X):X=t[116];let o;t[117]!==T||t[118]!==U||t[119]!==W||t[120]!==z||t[121]!==X||t[122]!==_||t[123]!==tt?(o=i.jsxRuntimeExports.jsx(T,{width:_,height:tt,viewBox:U,direction:W,ref:z,children:X}),t[117]=T,t[118]=U,t[119]=W,t[120]=z,t[121]=X,t[122]=_,t[123]=tt,t[124]=o):o=t[124];let lt;t[125]!==n?.tooltip||t[126]!==Ct||t[127]!==p||t[128]!==Tt||t[129]!==a?.tooltip||t[130]!==Nt?(lt=Tt&&Nt&&Ct&&p?i.jsxRuntimeExports.jsx(ve.Tooltip,{data:Tt,body:Nt,xPos:Ct,yPos:p,backgroundStyle:a?.tooltip,className:n?.tooltip}):null,t[125]=n?.tooltip,t[126]=Ct,t[127]=p,t[128]=Tt,t[129]=a?.tooltip,t[130]=Nt,t[131]=lt):lt=t[131];let H;t[132]!==n?.modal||t[133]!==O||t[134]!==V?(H=O&&V!==void 0?i.jsxRuntimeExports.jsx(Re.DetailsModal,{body:O,data:V,setData:Bt,className:n?.modal}):null,t[132]=n?.modal,t[133]=O,t[134]=V,t[135]=H):H=t[135];let Qt;return t[136]!==o||t[137]!==lt||t[138]!==H?(Qt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[o,lt,H]}),t[136]=o,t[137]=lt,t[138]=H,t[139]=Qt):Qt=t[139],Qt}function $e(s){return s.layer}function Oe(s){return s.position==="after"}function Ne(s){return s!==0}function Se(s){return s!==0}function De(s){return s!==0}function qe(s){return s!==0}function Te(s){return s.layer}function Fe(s){return s.position==="before"}function Ie(s){return`${s.id}`}function Ge(s,t){return{...s,id:`${t}`}}function ie(s,t,l,R){const j=s.map(f=>f[t]).filter(f=>!ce.checkIfNullOrUndefined(f)),x=ce.checkIfNullOrUndefined(l)?Math.min(...j)>=0?0:Math.min(...j):l,v=ce.checkIfNullOrUndefined(R)?Math.max(...j)<0?0:Math.max(...j):R;return{min:x,max:v}}function Pe(s){const t=i.compilerRuntimeExports.c(106),{data:l,graphTitle:R,sources:j,graphDescription:x,height:v,width:f,footNote:ct,padding:wt,barColors:ut,backgroundColor:xt,leftMargin:zt,rightMargin:Jt,topMargin:Y,bottomMargin:Kt,rightBarTitle:Nt,leftBarTitle:mt,tooltip:St,relativeHeight:Rt,onSeriesMouseOver:M,graphID:Et,barPadding:dt,truncateBy:pt,onSeriesMouseClick:At,centerGap:O,showValues:a,maxValue:n,minValue:E,refValues:u,suffix:ht,prefix:N,showTicks:S,showColorScale:D,graphDownload:Dt,dataDownload:se,language:qt,colorLegendTitle:A,minHeight:Tt,theme:ft,ariaLabel:V,resetSelectionOnDoubleClick:Bt,detailsOnClick:Ct,styles:m,classNames:p,noOfTicks:gt,animate:Ft,precision:d,customLayers:B,timeline:w,naLabel:yt}=s;let q;t[0]!==ut?(q=ut===void 0?[ye.Colors.light.categoricalColors.colors[0],ye.Colors.light.categoricalColors.colors[1]]:ut,t[0]=ut,t[1]=q):q=t[1];const T=q,U=xt===void 0?!1:xt,W=zt===void 0?20:zt,z=Jt===void 0?20:Jt,J=Y===void 0?25:Y,K=Kt===void 0?30:Kt,F=Nt===void 0?"Right bar graph":Nt,C=mt===void 0?"Left bar graph":mt,Q=dt===void 0?.25:dt,Z=pt===void 0?999:pt,_=O===void 0?100:O,tt=a===void 0?!0:a;let I;t[2]!==u?(I=u===void 0?[]:u,t[2]=u,t[3]=I):I=t[3];const et=I,It=ht===void 0?"":ht,Gt=N===void 0?"":N,it=S===void 0?!0:S,Pt=D===void 0?!1:D,G=Dt===void 0?!1:Dt,Lt=se===void 0?!1:se,st=qt===void 0?"en":qt,Xt=Tt===void 0?0:Tt,nt=ft===void 0?"light":ft,Ht=Bt===void 0?!0:Bt,ot=gt===void 0?5:gt,kt=Ft===void 0?!1:Ft,at=d===void 0?2:d;let P;t[4]!==B?(P=B===void 0?[]:B,t[4]=B,t[5]=P):P=t[5];const rt=P;let X;t[6]!==w?(X=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,t[6]=w,t[7]=X):X=t[7];const o=X,lt=yt===void 0?"NA":yt,[H,Qt]=k.useState(0),[bt,$]=k.useState(0),[r,ne]=k.useState(o.autoplay);let h;if(t[8]!==l||t[9]!==o.dateFormat){let y;t[11]!==o.dateFormat?(y=Wt=>xe.parse(`${Wt.date}`,o.dateFormat||"yyyy",new Date).getTime(),t[11]=o.dateFormat,t[12]=y):y=t[12],h=[...new Set(l.filter(Je).map(y))],h.sort(ze),t[8]=l,t[9]=o.dateFormat,t[10]=h}else h=t[10];const c=h,[L,Mt]=k.useState(o.autoplay?0:c.length-1),Yt=k.useRef(null),Ut=k.useRef(null);let Vt,jt;t[13]===Symbol.for("react.memo_cache_sentinel")?(Vt=()=>{const y=new ResizeObserver(Wt=>{Qt(Wt[0].target.clientWidth||620),$(Wt[0].target.clientHeight||480)});return Yt.current&&y.observe(Yt.current),()=>y.disconnect()},jt=[],t[13]=Vt,t[14]=jt):(Vt=t[13],jt=t[14]),k.useEffect(Vt,jt);let $t,vt;t[15]!==r||t[16]!==o.speed||t[17]!==c?($t=()=>{const y=setInterval(()=>{Mt(Wt=>Wt<c.length-1?Wt+1:0)},(o.speed||2)*1e3);return r||clearInterval(y),()=>clearInterval(y)},vt=[c,r,o.speed],t[15]=r,t[16]=o.speed,t[17]=c,t[18]=$t,t[19]=vt):($t=t[18],vt=t[19]),k.useEffect($t,vt);const e=o.dateFormat||"yyyy";let g;t[20]!==L||t[21]!==e||t[22]!==o.showOnlyActiveDate||t[23]!==c?(g=ue.getSliderMarks(c,L,o.showOnlyActiveDate,e),t[20]=L,t[21]=e,t[22]=o.showOnlyActiveDate,t[23]=c,t[24]=g):g=t[24];const b=g,ae=p?.graphContainer,re=m?.graphContainer;let Zt;t[25]!==p?.description||t[26]!==p?.title||t[27]!==l||t[28]!==Lt||t[29]!==x||t[30]!==G||t[31]!==R||t[32]!==m?.description||t[33]!==m?.title||t[34]!==f?(Zt=R||x||G||Lt?i.jsxRuntimeExports.jsx(Ce.GraphHeader,{styles:{title:m?.title,description:m?.description},classNames:{title:p?.title,description:p?.description},graphTitle:R,graphDescription:x,width:f,graphDownload:G?Ut:void 0,dataDownload:Lt?l.map(We).filter(Ue).length>0?l.map(Ye).filter(He):l.filter(Xe):null}):null,t[25]=p?.description,t[26]=p?.title,t[27]=l,t[28]=Lt,t[29]=x,t[30]=G,t[31]=R,t[32]=m?.description,t[33]=m?.title,t[34]=f,t[35]=Zt):Zt=t[35];let _t;t[36]!==L||t[37]!==b||t[38]!==r||t[39]!==o.enabled||t[40]!==c?(_t=o.enabled&&c.length>0&&b?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{ne(!r)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":r?"Click to pause animation":"Click to play animation",children:r?i.jsxRuntimeExports.jsx(be.Pause,{}):i.jsxRuntimeExports.jsx(be.Play,{})}),i.jsxRuntimeExports.jsx(ue.Nr,{min:c[0],max:c[c.length-1],marks:b,step:null,defaultValue:c[c.length-1],value:c[L],onChangeComplete:y=>{Mt(c.indexOf(y))},onChange:y=>{Mt(c.indexOf(y))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[36]=L,t[37]=b,t[38]=r,t[39]=o.enabled,t[40]=c,t[41]=_t):_t=t[41];let te;t[42]!==kt||t[43]!==T||t[44]!==Q||t[45]!==K||t[46]!==_||t[47]!==p||t[48]!==A||t[49]!==rt||t[50]!==l||t[51]!==Ct||t[52]!==L||t[53]!==C||t[54]!==W||t[55]!==n||t[56]!==E||t[57]!==lt||t[58]!==ot||t[59]!==At||t[60]!==M||t[61]!==at||t[62]!==Gt||t[63]!==et||t[64]!==Ht||t[65]!==F||t[66]!==z||t[67]!==Pt||t[68]!==it||t[69]!==tt||t[70]!==m||t[71]!==It||t[72]!==bt||t[73]!==H||t[74]!==o.dateFormat||t[75]!==o.enabled||t[76]!==St||t[77]!==J||t[78]!==Z||t[79]!==c?(te=l.length===0?i.jsxRuntimeExports.jsx(ke.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[Pt?i.jsxRuntimeExports.jsx(Le.ColorLegend,{colorLegendTitle:A,colorDomain:[C,F],colors:T,showNAColor:!1,className:p?.colorLegend}):null,i.jsxRuntimeExports.jsx(je.GraphArea,{ref:Yt,children:H&&bt?i.jsxRuntimeExports.jsx(Ve,{data:Me.ensureCompleteDataForButterFlyChart(l,o.dateFormat||"yyyy").filter(y=>o.enabled?y.date===xe.format(new Date(c[L]),o.dateFormat||"yyyy"):y),barColors:T,width:H,centerGap:_,height:bt,truncateBy:Z,leftMargin:W,rightMargin:z,topMargin:J,bottomMargin:K,axisTitles:[C,F],tooltip:St,onSeriesMouseOver:M,barPadding:Q,refValues:et,maxValue:Math.max(ie(l,"leftBar",E,n).max,ie(l,"rightBar",E,n).max),minValue:Math.min(ie(l,"leftBar",E,n).min,ie(l,"rightBar",E,n).min),minValueLeftBar:ie(l,"leftBar",E,n).min,minValueRightBar:ie(l,"rightBar",E,n).min,showValues:tt,onSeriesMouseClick:At,showTicks:it,suffix:It,prefix:Gt,resetSelectionOnDoubleClick:Ht,detailsOnClick:Ct,styles:m,classNames:p,noOfTicks:ot,animate:kt===!0?{duration:.5,once:!0,amount:.5}:kt||{duration:0,once:!0,amount:0},precision:at,customLayers:rt,naLabel:lt}):null})]}),t[42]=kt,t[43]=T,t[44]=Q,t[45]=K,t[46]=_,t[47]=p,t[48]=A,t[49]=rt,t[50]=l,t[51]=Ct,t[52]=L,t[53]=C,t[54]=W,t[55]=n,t[56]=E,t[57]=lt,t[58]=ot,t[59]=At,t[60]=M,t[61]=at,t[62]=Gt,t[63]=et,t[64]=Ht,t[65]=F,t[66]=z,t[67]=Pt,t[68]=it,t[69]=tt,t[70]=m,t[71]=It,t[72]=bt,t[73]=H,t[74]=o.dateFormat,t[75]=o.enabled,t[76]=St,t[77]=J,t[78]=Z,t[79]=c,t[80]=te):te=t[80];let ee;t[81]!==p?.footnote||t[82]!==p?.source||t[83]!==ct||t[84]!==j||t[85]!==m?.footnote||t[86]!==m?.source||t[87]!==f?(ee=j||ct?i.jsxRuntimeExports.jsx(Be.GraphFooter,{styles:{footnote:m?.footnote,source:m?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:j,footNote:ct,width:f}):null,t[81]=p?.footnote,t[82]=p?.source,t[83]=ct,t[84]=j,t[85]=m?.footnote,t[86]=m?.source,t[87]=f,t[88]=ee):ee=t[88];let oe;return t[89]!==V||t[90]!==U||t[91]!==Et||t[92]!==v||t[93]!==st||t[94]!==Xt||t[95]!==wt||t[96]!==Rt||t[97]!==ae||t[98]!==re||t[99]!==Zt||t[100]!==_t||t[101]!==te||t[102]!==ee||t[103]!==nt||t[104]!==f?(oe=i.jsxRuntimeExports.jsxs(je.GraphContainer,{className:ae,style:re,id:Et,ref:Ut,"aria-label":V,backgroundColor:U,theme:nt,language:st,minHeight:Xt,width:f,height:v,relativeHeight:Rt,padding:wt,children:[Zt,_t,te,ee]}),t[89]=V,t[90]=U,t[91]=Et,t[92]=v,t[93]=st,t[94]=Xt,t[95]=wt,t[96]=Rt,t[97]=ae,t[98]=re,t[99]=Zt,t[100]=_t,t[101]=te,t[102]=ee,t[103]=nt,t[104]=f,t[105]=oe):oe=t[105],oe}function Xe(s){return s!==void 0}function He(s){return s!==void 0}function Ye(s){return s.data}function Ue(s){return s!==void 0}function We(s){return s.data}function ze(s,t){return s-t}function Je(s){return s.date}exports.ButterflyChart=Pe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),k=require("react"),ue=require("./getSliderMarks-BmADcPQt.cjs"),xe=require("./parse-hMnG_lRV.cjs"),me=require("./index-DQA8q5sC.cjs"),de=require("./numberFormattingFunction-02t-wJta.cjs"),ve=require("./Tooltip-uUdw6wJL.cjs"),pe=require("./XTicksAndGridLines-B6CELS7q.cjs"),he=require("./Axis-DxRV2yMi.cjs"),we=require("./YAxesLabels-DesLesUP.cjs"),fe=require("./ReferenceLine-BH0qdf4R.cjs"),Re=require("./DetailsModal-BN0HDFlV.cjs"),Ee=require("./band-VYfcZeJ2.cjs"),ge=require("./linear-BwPAspcq.cjs"),Ae=require("./use-in-view-QcfiW0w3.cjs"),Ot=require("./proxy-BxvUI_9l.cjs"),le=require("./index-DG2bgAva.cjs"),Be=require("./GraphFooter.cjs"),Ce=require("./GraphHeader.cjs"),Le=require("./ColorLegend.cjs"),ye=require("./Colors.cjs"),ke=require("./EmptyState-sAEZ_5rU.cjs"),be=require("./index-DRXx7m-C.cjs"),ce=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Me=require("./ensureCompleteData-pZ9QO6kB.cjs"),je=require("./GraphContainer-d8A46BK2.cjs");function Ve(s){const t=i.compilerRuntimeExports.c(140),{data:l,width:R,height:j,barColors:x,centerGap:v,refValues:f,maxValue:ct,minValue:wt,showValues:ut,axisTitles:xt,rightMargin:zt,leftMargin:Jt,topMargin:Y,bottomMargin:Kt,tooltip:Nt,onSeriesMouseOver:mt,barPadding:St,truncateBy:Rt,onSeriesMouseClick:M,showTicks:Et,suffix:dt,prefix:pt,resetSelectionOnDoubleClick:At,detailsOnClick:O,styles:a,classNames:n,noOfTicks:E,animate:u,precision:ht,customLayers:N,minValueLeftBar:S,minValueRightBar:D,naLabel:Dt}=s,se=k.useRef(null);let qt;t[0]!==u.amount||t[1]!==u.once?(qt={once:u.once,amount:u.amount},t[0]=u.amount,t[1]=u.once,t[2]=qt):qt=t[2];const A=Ae.useInView(se,qt),[Tt,ft]=k.useState(void 0),[V,Bt]=k.useState(void 0),[Ct,m]=k.useState(void 0),[p,gt]=k.useState(void 0);let Ft;t[3]!==Kt||t[4]!==Jt||t[5]!==zt||t[6]!==Y?(Ft={top:Y,bottom:Kt,left:Jt,right:zt},t[3]=Kt,t[4]=Jt,t[5]=zt,t[6]=Y,t[7]=Ft):Ft=t[7];const d=Ft,B=R-d.left-d.right,w=j-d.top-d.bottom;let yt,q,T,U,W,z,J,K,F,C,Q,Z,_,tt;if(t[8]!==u||t[9]!==x[0]||t[10]!==x[1]||t[11]!==St||t[12]!==v||t[13]!==n?.graphObjectValues||t[14]!==n?.xAxis?.gridLines||t[15]!==n?.xAxis?.labels||t[16]!==n?.yAxis?.axis||t[17]!==n?.yAxis?.labels||t[18]!==N||t[19]!==l||t[20]!==O||t[21]!==w||t[22]!==B||t[23]!==j||t[24]!==A||t[25]!==d.bottom||t[26]!==d.left||t[27]!==d.top||t[28]!==ct||t[29]!==wt||t[30]!==S||t[31]!==D||t[32]!==V||t[33]!==Dt||t[34]!==E||t[35]!==M||t[36]!==mt||t[37]!==ht||t[38]!==pt||t[39]!==f||t[40]!==At||t[41]!==Et||t[42]!==ut||t[43]!==a?.graphObjectValues||t[44]!==a?.xAxis?.gridLines||t[45]!==a?.xAxis?.labels||t[46]!==a?.yAxis?.axis||t[47]!==a?.yAxis?.labels||t[48]!==dt||t[49]!==Y||t[50]!==Rt||t[51]!==R){const bt=l.map(Ge),$=Ee.band().domain(bt.map(Ie)).range([w,0]).paddingInner(St),r=ge.linear().domain([wt,ct]).range([0,(B-v)/2]).nice(),ne=r.ticks(E),h=ge.linear().domain([wt,ct]).range([(B-v)/2,0]).nice(),c=h.ticks(E);T=Ot.motion.svg,_=`${R}px`,tt=`${j}px`,U=`0 0 ${R} ${j}`,W="ltr",z=se,F=`translate(${d.left},${d.top})`,t[66]!==N?(C=N.filter(Fe).map(Te),t[66]=N,t[67]=C):C=t[67];const L=n?.yAxis?.axis;let Mt;t[68]!==L?(Mt={axis:L},t[68]=L,t[69]=Mt):Mt=t[69];const Yt=a?.yAxis?.axis;let Ut;t[70]!==Yt?(Ut={axis:Yt},t[70]=Yt,t[71]=Ut):Ut=t[71],Q=i.jsxRuntimeExports.jsxs("g",{transform:"translate(0,0)",children:[Et?i.jsxRuntimeExports.jsx(pe.XTicksAndGridLines,{values:c.filter(qe),x:c.filter(De).map(e=>h(e)),y1:0-Y,y2:w+d.bottom,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:dt,prefix:pt,labelType:"secondary",showGridLines:!0,leftLabel:!0,precision:ht}):null,i.jsxRuntimeExports.jsxs(le.AnimatePresence,{children:[bt.map((e,g)=>i.jsxRuntimeExports.jsxs(Ot.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{ft(e),gt(b.clientY),m(b.clientX),mt?.(e)},onClick:()=>{(M||O)&&(me.isEqual(V,e)&&At?(Bt(void 0),M?.(void 0)):(Bt(e),M?.(e)))},onMouseMove:b=>{ft(e),gt(b.clientY),m(b.clientX)},onMouseLeave:()=>{ft(void 0),m(void 0),gt(void 0),mt?.(void 0)},children:[e.leftBar?i.jsxRuntimeExports.jsx(Ot.motion.rect,{y:$(`${g}`),style:{fill:x[0]},height:$.bandwidth(),variants:{initial:{x:h(0),width:0},whileInView:{x:e.leftBar<0?h(0):h(e.leftBar),width:e.leftBar<0?h(e.leftBar)-h(0):h(0)-h(e.leftBar),transition:{duration:u.duration}}},initial:"initial",animate:A?"whileInView":"initial",exit:{x:h(0),width:0,transition:{duration:u.duration}}}):null,ut?i.jsxRuntimeExports.jsx(Ot.motion.text,{y:$(`${g}`)+$.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar>0?"end":"start",...a?.graphObjectValues||{}},dx:e.rightBar&&e.rightBar>0?-5:5,dy:"0.33em",className:i.mo("graph-value text-sm",n?.graphObjectValues),exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x:h(0),opacity:0,fill:x[0]},whileInView:{x:e.leftBar?h(e.leftBar):h(S<0?0:S),opacity:1,fill:x[0],transition:{duration:u.duration}}},initial:"initial",animate:A?"whileInView":"initial",children:de.numberFormattingFunction(e.rightBar,Dt,ht,pt,dt)}):null]},e.label)),i.jsxRuntimeExports.jsx(he.Axis,{y1:-2.5,y2:w+d.bottom,x1:h(S<0?0:S),x2:h(S<0?0:S),classNames:Mt,styles:Ut}),f?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:f.map((e,g)=>i.jsxRuntimeExports.jsx(fe.RefLineX,{text:e.text,color:e.color,x:h(e.value),y1:0-d.top,y2:w+d.bottom,textSide:"left",classNames:e.classNames,styles:e.styles,animate:u,isInView:A},g))}):null]})]});const Vt=n?.yAxis?.axis;let jt;t[72]!==Vt?(jt={axis:Vt},t[72]=Vt,t[73]=jt):jt=t[73];const $t=a?.yAxis?.axis;let vt;t[74]!==$t?(vt={axis:$t},t[74]=$t,t[75]=vt):vt=t[75],Z=i.jsxRuntimeExports.jsxs("g",{transform:`translate(${(B+v)/2},0)`,children:[Et?i.jsxRuntimeExports.jsx(pe.XTicksAndGridLines,{values:ne.filter(Se),x:ne.filter(Ne).map(e=>r(e)),y1:0-Y,y2:w+d.bottom,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:dt,prefix:pt,labelType:"secondary",showGridLines:!0,precision:ht}):null,i.jsxRuntimeExports.jsxs(le.AnimatePresence,{children:[bt.map((e,g)=>i.jsxRuntimeExports.jsxs(Ot.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:b=>{ft(e),gt(b.clientY),m(b.clientX),mt?.(e)},onClick:()=>{(M||O)&&(me.isEqual(V,e)&&At?(Bt(void 0),M?.(void 0)):(Bt(e),M?.(e)))},onMouseMove:b=>{ft(e),gt(b.clientY),m(b.clientX)},onMouseLeave:()=>{ft(void 0),m(void 0),gt(void 0),mt?.(void 0)},children:[e.rightBar?i.jsxRuntimeExports.jsx(Ot.motion.rect,{y:$(`${g}`),style:{fill:x[1]},height:$.bandwidth(),exit:{x:r(0),width:0,transition:{duration:u.duration}},variants:{initial:{x:r(0),width:0},whileInView:{x:e.rightBar>=0?r(0):r(e.rightBar),width:e.rightBar>=0?r(e.rightBar)-r(0):r(0)-r(e.rightBar),transition:{duration:u.duration}}},initial:"initial",animate:A?"whileInView":"initial"}):null,ut?i.jsxRuntimeExports.jsx(Ot.motion.text,{y:$(`${g}`)+$.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar<0?"end":"start",...a?.graphObjectValues||{}},className:i.mo("graph-value text-sm",n?.graphObjectValues),dx:e.rightBar&&e.rightBar<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x:r(0),opacity:0,fill:x[1]},whileInView:{x:e.rightBar?r(e.rightBar):r(D<0?0:D),opacity:1,fill:x[1],transition:{duration:u.duration}}},initial:"initial",animate:A?"whileInView":"initial",children:de.numberFormattingFunction(e.rightBar,Dt,ht,pt,dt)}):null]},g)),i.jsxRuntimeExports.jsx(he.Axis,{y1:-2.5,y2:w+d.bottom,x1:r(D<0?0:D),x2:r(D<0?0:D),classNames:jt,styles:vt}),f?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:f.map((e,g)=>i.jsxRuntimeExports.jsx(fe.RefLineX,{text:e.text,color:e.color,x:r(e.value),y1:0-d.top,y2:w+d.bottom,textSide:"right",classNames:e.classNames,styles:e.styles,animate:u,isInView:A},g))}):null]})]}),q=le.AnimatePresence,yt=Ot.motion.g,J=`translate(${B/2},0)`,K=bt.map((e,g)=>i.jsxRuntimeExports.jsx(we.YAxesLabels,{value:`${e.label}`.length<Rt?`${e.label}`:`${`${e.label}`.substring(0,Rt)}...`,y:$(`${e.id}`),x:0-v/2,width:v,height:$.bandwidth(),alignment:"center",style:a?.yAxis?.labels,className:n?.yAxis?.labels,animate:u,isInView:A},g)),t[8]=u,t[9]=x[0],t[10]=x[1],t[11]=St,t[12]=v,t[13]=n?.graphObjectValues,t[14]=n?.xAxis?.gridLines,t[15]=n?.xAxis?.labels,t[16]=n?.yAxis?.axis,t[17]=n?.yAxis?.labels,t[18]=N,t[19]=l,t[20]=O,t[21]=w,t[22]=B,t[23]=j,t[24]=A,t[25]=d.bottom,t[26]=d.left,t[27]=d.top,t[28]=ct,t[29]=wt,t[30]=S,t[31]=D,t[32]=V,t[33]=Dt,t[34]=E,t[35]=M,t[36]=mt,t[37]=ht,t[38]=pt,t[39]=f,t[40]=At,t[41]=Et,t[42]=ut,t[43]=a?.graphObjectValues,t[44]=a?.xAxis?.gridLines,t[45]=a?.xAxis?.labels,t[46]=a?.yAxis?.axis,t[47]=a?.yAxis?.labels,t[48]=dt,t[49]=Y,t[50]=Rt,t[51]=R,t[52]=yt,t[53]=q,t[54]=T,t[55]=U,t[56]=W,t[57]=z,t[58]=J,t[59]=K,t[60]=F,t[61]=C,t[62]=Q,t[63]=Z,t[64]=_,t[65]=tt}else yt=t[52],q=t[53],T=t[54],U=t[55],W=t[56],z=t[57],J=t[58],K=t[59],F=t[60],C=t[61],Q=t[62],Z=t[63],_=t[64],tt=t[65];let I;t[76]!==yt||t[77]!==J||t[78]!==K?(I=i.jsxRuntimeExports.jsx(yt,{transform:J,children:K}),t[76]=yt,t[77]=J,t[78]=K,t[79]=I):I=t[79];let et;t[80]!==q||t[81]!==I?(et=i.jsxRuntimeExports.jsx(q,{children:I}),t[80]=q,t[81]=I,t[82]=et):et=t[82];const It=`translate(0,${w})`,Gt=a?.yAxis?.title;let it;t[83]!==x[0]||t[84]!==Gt?(it={fill:x[0],textAnchor:"end",...Gt},t[83]=x[0],t[84]=Gt,t[85]=it):it=t[85];const Pt=n?.yAxis?.title;let G;t[86]!==Pt?(G=i.mo("text-base",Pt),t[86]=Pt,t[87]=G):G=t[87];const Lt=B/2-v/2;let st;t[88]!==xt[0]||t[89]!==it||t[90]!==G||t[91]!==Lt?(st=i.jsxRuntimeExports.jsx("text",{style:it,className:G,x:Lt,y:0,dx:-5,dy:20,children:xt[0]}),t[88]=xt[0],t[89]=it,t[90]=G,t[91]=Lt,t[92]=st):st=t[92];const Xt=a?.yAxis?.title;let nt;t[93]!==x[1]||t[94]!==Xt?(nt={fill:x[1],textAnchor:"start",...Xt},t[93]=x[1],t[94]=Xt,t[95]=nt):nt=t[95];const Ht=n?.yAxis?.title;let ot;t[96]!==Ht?(ot=i.mo("text-base",Ht),t[96]=Ht,t[97]=ot):ot=t[97];const kt=B/2+v/2;let at;t[98]!==xt[1]||t[99]!==nt||t[100]!==ot||t[101]!==kt?(at=i.jsxRuntimeExports.jsx("text",{style:nt,className:ot,x:kt,y:0,dx:5,dy:20,children:xt[1]}),t[98]=xt[1],t[99]=nt,t[100]=ot,t[101]=kt,t[102]=at):at=t[102];let P;t[103]!==It||t[104]!==st||t[105]!==at?(P=i.jsxRuntimeExports.jsxs("g",{transform:It,children:[st,at]}),t[103]=It,t[104]=st,t[105]=at,t[106]=P):P=t[106];let rt;t[107]!==N?(rt=N.filter(Oe).map($e),t[107]=N,t[108]=rt):rt=t[108];let X;t[109]!==et||t[110]!==P||t[111]!==rt||t[112]!==F||t[113]!==C||t[114]!==Q||t[115]!==Z?(X=i.jsxRuntimeExports.jsxs("g",{transform:F,children:[C,Q,Z,et,P,rt]}),t[109]=et,t[110]=P,t[111]=rt,t[112]=F,t[113]=C,t[114]=Q,t[115]=Z,t[116]=X):X=t[116];let o;t[117]!==T||t[118]!==U||t[119]!==W||t[120]!==z||t[121]!==X||t[122]!==_||t[123]!==tt?(o=i.jsxRuntimeExports.jsx(T,{width:_,height:tt,viewBox:U,direction:W,ref:z,children:X}),t[117]=T,t[118]=U,t[119]=W,t[120]=z,t[121]=X,t[122]=_,t[123]=tt,t[124]=o):o=t[124];let lt;t[125]!==n?.tooltip||t[126]!==Ct||t[127]!==p||t[128]!==Tt||t[129]!==a?.tooltip||t[130]!==Nt?(lt=Tt&&Nt&&Ct&&p?i.jsxRuntimeExports.jsx(ve.Tooltip,{data:Tt,body:Nt,xPos:Ct,yPos:p,backgroundStyle:a?.tooltip,className:n?.tooltip}):null,t[125]=n?.tooltip,t[126]=Ct,t[127]=p,t[128]=Tt,t[129]=a?.tooltip,t[130]=Nt,t[131]=lt):lt=t[131];let H;t[132]!==n?.modal||t[133]!==O||t[134]!==V?(H=O&&V!==void 0?i.jsxRuntimeExports.jsx(Re.DetailsModal,{body:O,data:V,setData:Bt,className:n?.modal}):null,t[132]=n?.modal,t[133]=O,t[134]=V,t[135]=H):H=t[135];let Qt;return t[136]!==o||t[137]!==lt||t[138]!==H?(Qt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[o,lt,H]}),t[136]=o,t[137]=lt,t[138]=H,t[139]=Qt):Qt=t[139],Qt}function $e(s){return s.layer}function Oe(s){return s.position==="after"}function Ne(s){return s!==0}function Se(s){return s!==0}function De(s){return s!==0}function qe(s){return s!==0}function Te(s){return s.layer}function Fe(s){return s.position==="before"}function Ie(s){return`${s.id}`}function Ge(s,t){return{...s,id:`${t}`}}function ie(s,t,l,R){const j=s.map(f=>f[t]).filter(f=>!ce.checkIfNullOrUndefined(f)),x=ce.checkIfNullOrUndefined(l)?Math.min(...j)>=0?0:Math.min(...j):l,v=ce.checkIfNullOrUndefined(R)?Math.max(...j)<0?0:Math.max(...j):R;return{min:x,max:v}}function Pe(s){const t=i.compilerRuntimeExports.c(106),{data:l,graphTitle:R,sources:j,graphDescription:x,height:v,width:f,footNote:ct,padding:wt,barColors:ut,backgroundColor:xt,leftMargin:zt,rightMargin:Jt,topMargin:Y,bottomMargin:Kt,rightBarTitle:Nt,leftBarTitle:mt,tooltip:St,relativeHeight:Rt,onSeriesMouseOver:M,graphID:Et,barPadding:dt,truncateBy:pt,onSeriesMouseClick:At,centerGap:O,showValues:a,maxValue:n,minValue:E,refValues:u,suffix:ht,prefix:N,showTicks:S,showColorScale:D,graphDownload:Dt,dataDownload:se,language:qt,colorLegendTitle:A,minHeight:Tt,theme:ft,ariaLabel:V,resetSelectionOnDoubleClick:Bt,detailsOnClick:Ct,styles:m,classNames:p,noOfTicks:gt,animate:Ft,precision:d,customLayers:B,timeline:w,naLabel:yt}=s;let q;t[0]!==ut?(q=ut===void 0?[ye.Colors.light.categoricalColors.colors[0],ye.Colors.light.categoricalColors.colors[1]]:ut,t[0]=ut,t[1]=q):q=t[1];const T=q,U=xt===void 0?!1:xt,W=zt===void 0?20:zt,z=Jt===void 0?20:Jt,J=Y===void 0?25:Y,K=Kt===void 0?30:Kt,F=Nt===void 0?"Right bar graph":Nt,C=mt===void 0?"Left bar graph":mt,Q=dt===void 0?.25:dt,Z=pt===void 0?999:pt,_=O===void 0?100:O,tt=a===void 0?!0:a;let I;t[2]!==u?(I=u===void 0?[]:u,t[2]=u,t[3]=I):I=t[3];const et=I,It=ht===void 0?"":ht,Gt=N===void 0?"":N,it=S===void 0?!0:S,Pt=D===void 0?!1:D,G=Dt===void 0?!1:Dt,Lt=se===void 0?!1:se,st=qt===void 0?"en":qt,Xt=Tt===void 0?0:Tt,nt=ft===void 0?"light":ft,Ht=Bt===void 0?!0:Bt,ot=gt===void 0?5:gt,kt=Ft===void 0?!1:Ft,at=d===void 0?2:d;let P;t[4]!==B?(P=B===void 0?[]:B,t[4]=B,t[5]=P):P=t[5];const rt=P;let X;t[6]!==w?(X=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,t[6]=w,t[7]=X):X=t[7];const o=X,lt=yt===void 0?"NA":yt,[H,Qt]=k.useState(0),[bt,$]=k.useState(0),[r,ne]=k.useState(o.autoplay);let h;if(t[8]!==l||t[9]!==o.dateFormat){let y;t[11]!==o.dateFormat?(y=Wt=>xe.parse(`${Wt.date}`,o.dateFormat||"yyyy",new Date).getTime(),t[11]=o.dateFormat,t[12]=y):y=t[12],h=[...new Set(l.filter(Je).map(y))],h.sort(ze),t[8]=l,t[9]=o.dateFormat,t[10]=h}else h=t[10];const c=h,[L,Mt]=k.useState(o.autoplay?0:c.length-1),Yt=k.useRef(null),Ut=k.useRef(null);let Vt,jt;t[13]===Symbol.for("react.memo_cache_sentinel")?(Vt=()=>{const y=new ResizeObserver(Wt=>{Qt(Wt[0].target.clientWidth||620),$(Wt[0].target.clientHeight||480)});return Yt.current&&y.observe(Yt.current),()=>y.disconnect()},jt=[],t[13]=Vt,t[14]=jt):(Vt=t[13],jt=t[14]),k.useEffect(Vt,jt);let $t,vt;t[15]!==r||t[16]!==o.speed||t[17]!==c?($t=()=>{const y=setInterval(()=>{Mt(Wt=>Wt<c.length-1?Wt+1:0)},(o.speed||2)*1e3);return r||clearInterval(y),()=>clearInterval(y)},vt=[c,r,o.speed],t[15]=r,t[16]=o.speed,t[17]=c,t[18]=$t,t[19]=vt):($t=t[18],vt=t[19]),k.useEffect($t,vt);const e=o.dateFormat||"yyyy";let g;t[20]!==L||t[21]!==e||t[22]!==o.showOnlyActiveDate||t[23]!==c?(g=ue.getSliderMarks(c,L,o.showOnlyActiveDate,e),t[20]=L,t[21]=e,t[22]=o.showOnlyActiveDate,t[23]=c,t[24]=g):g=t[24];const b=g,ae=p?.graphContainer,re=m?.graphContainer;let Zt;t[25]!==p?.description||t[26]!==p?.title||t[27]!==l||t[28]!==Lt||t[29]!==x||t[30]!==G||t[31]!==R||t[32]!==m?.description||t[33]!==m?.title||t[34]!==f?(Zt=R||x||G||Lt?i.jsxRuntimeExports.jsx(Ce.GraphHeader,{styles:{title:m?.title,description:m?.description},classNames:{title:p?.title,description:p?.description},graphTitle:R,graphDescription:x,width:f,graphDownload:G?Ut:void 0,dataDownload:Lt?l.map(We).filter(Ue).length>0?l.map(Ye).filter(He):l.filter(Xe):null}):null,t[25]=p?.description,t[26]=p?.title,t[27]=l,t[28]=Lt,t[29]=x,t[30]=G,t[31]=R,t[32]=m?.description,t[33]=m?.title,t[34]=f,t[35]=Zt):Zt=t[35];let _t;t[36]!==L||t[37]!==b||t[38]!==r||t[39]!==o.enabled||t[40]!==c?(_t=o.enabled&&c.length>0&&b?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{ne(!r)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":r?"Click to pause animation":"Click to play animation",children:r?i.jsxRuntimeExports.jsx(be.Pause,{}):i.jsxRuntimeExports.jsx(be.Play,{})}),i.jsxRuntimeExports.jsx(ue.Nr,{min:c[0],max:c[c.length-1],marks:b,step:null,defaultValue:c[c.length-1],value:c[L],onChangeComplete:y=>{Mt(c.indexOf(y))},onChange:y=>{Mt(c.indexOf(y))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[36]=L,t[37]=b,t[38]=r,t[39]=o.enabled,t[40]=c,t[41]=_t):_t=t[41];let te;t[42]!==kt||t[43]!==T||t[44]!==Q||t[45]!==K||t[46]!==_||t[47]!==p||t[48]!==A||t[49]!==rt||t[50]!==l||t[51]!==Ct||t[52]!==L||t[53]!==C||t[54]!==W||t[55]!==n||t[56]!==E||t[57]!==lt||t[58]!==ot||t[59]!==At||t[60]!==M||t[61]!==at||t[62]!==Gt||t[63]!==et||t[64]!==Ht||t[65]!==F||t[66]!==z||t[67]!==Pt||t[68]!==it||t[69]!==tt||t[70]!==m||t[71]!==It||t[72]!==bt||t[73]!==H||t[74]!==o.dateFormat||t[75]!==o.enabled||t[76]!==St||t[77]!==J||t[78]!==Z||t[79]!==c?(te=l.length===0?i.jsxRuntimeExports.jsx(ke.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[Pt?i.jsxRuntimeExports.jsx(Le.ColorLegend,{colorLegendTitle:A,colorDomain:[C,F],colors:T,showNAColor:!1,className:p?.colorLegend}):null,i.jsxRuntimeExports.jsx(je.GraphArea,{ref:Yt,children:H&&bt?i.jsxRuntimeExports.jsx(Ve,{data:Me.ensureCompleteDataForButterFlyChart(l,o.dateFormat||"yyyy").filter(y=>o.enabled?y.date===xe.format(new Date(c[L]),o.dateFormat||"yyyy"):y),barColors:T,width:H,centerGap:_,height:bt,truncateBy:Z,leftMargin:W,rightMargin:z,topMargin:J,bottomMargin:K,axisTitles:[C,F],tooltip:St,onSeriesMouseOver:M,barPadding:Q,refValues:et,maxValue:Math.max(ie(l,"leftBar",E,n).max,ie(l,"rightBar",E,n).max),minValue:Math.min(ie(l,"leftBar",E,n).min,ie(l,"rightBar",E,n).min),minValueLeftBar:ie(l,"leftBar",E,n).min,minValueRightBar:ie(l,"rightBar",E,n).min,showValues:tt,onSeriesMouseClick:At,showTicks:it,suffix:It,prefix:Gt,resetSelectionOnDoubleClick:Ht,detailsOnClick:Ct,styles:m,classNames:p,noOfTicks:ot,animate:kt===!0?{duration:.5,once:!0,amount:.5}:kt||{duration:0,once:!0,amount:0},precision:at,customLayers:rt,naLabel:lt}):null})]}),t[42]=kt,t[43]=T,t[44]=Q,t[45]=K,t[46]=_,t[47]=p,t[48]=A,t[49]=rt,t[50]=l,t[51]=Ct,t[52]=L,t[53]=C,t[54]=W,t[55]=n,t[56]=E,t[57]=lt,t[58]=ot,t[59]=At,t[60]=M,t[61]=at,t[62]=Gt,t[63]=et,t[64]=Ht,t[65]=F,t[66]=z,t[67]=Pt,t[68]=it,t[69]=tt,t[70]=m,t[71]=It,t[72]=bt,t[73]=H,t[74]=o.dateFormat,t[75]=o.enabled,t[76]=St,t[77]=J,t[78]=Z,t[79]=c,t[80]=te):te=t[80];let ee;t[81]!==p?.footnote||t[82]!==p?.source||t[83]!==ct||t[84]!==j||t[85]!==m?.footnote||t[86]!==m?.source||t[87]!==f?(ee=j||ct?i.jsxRuntimeExports.jsx(Be.GraphFooter,{styles:{footnote:m?.footnote,source:m?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:j,footNote:ct,width:f}):null,t[81]=p?.footnote,t[82]=p?.source,t[83]=ct,t[84]=j,t[85]=m?.footnote,t[86]=m?.source,t[87]=f,t[88]=ee):ee=t[88];let oe;return t[89]!==V||t[90]!==U||t[91]!==Et||t[92]!==v||t[93]!==st||t[94]!==Xt||t[95]!==wt||t[96]!==Rt||t[97]!==ae||t[98]!==re||t[99]!==Zt||t[100]!==_t||t[101]!==te||t[102]!==ee||t[103]!==nt||t[104]!==f?(oe=i.jsxRuntimeExports.jsxs(je.GraphContainer,{className:ae,style:re,id:Et,ref:Ut,"aria-label":V,backgroundColor:U,theme:nt,language:st,minHeight:Xt,width:f,height:v,relativeHeight:Rt,padding:wt,children:[Zt,_t,te,ee]}),t[89]=V,t[90]=U,t[91]=Et,t[92]=v,t[93]=st,t[94]=Xt,t[95]=wt,t[96]=Rt,t[97]=ae,t[98]=re,t[99]=Zt,t[100]=_t,t[101]=te,t[102]=ee,t[103]=nt,t[104]=f,t[105]=oe):oe=t[105],oe}function Xe(s){return s!==void 0}function He(s){return s!==void 0}function Ye(s){return s.data}function Ue(s){return s!==void 0}function We(s){return s.data}function ze(s,t){return s-t}function Je(s){return s.date}exports.ButterflyChart=Pe;
2
2
  //# sourceMappingURL=ButterflyChart.cjs.map
@@ -22,7 +22,7 @@ import { Colors as be } from "./Colors.js";
22
22
  import { E as De } from "./EmptyState-BZo1BbAn.js";
23
23
  import { P as Te, e as Se } from "./index-D491FEn1.js";
24
24
  import { c as me } from "./checkIfNullOrUndefined-DmfiKkNw.js";
25
- import { c as Fe } from "./ensureCompleteData-DS7gCvVd.js";
25
+ import { c as Fe } from "./ensureCompleteData-DH5c52Ub.js";
26
26
  import { a as Ie, G as Ge } from "./GraphContainer-CRqzdKu2.js";
27
27
  function Re(a) {
28
28
  const t = ve.c(140), {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),A=require("react"),O=require("./parse-hMnG_lRV.cjs"),xi=require("./index-Cno4Q0YE.cjs"),ei=require("./numberFormattingFunction-02t-wJta.cjs"),mi=require("./Tooltip-uUdw6wJL.cjs"),It=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ii=require("./customArea-CMF5g-C3.cjs"),di=require("./AxisTitle-sS5bLLR7.cjs"),pi=require("./Axis-DxRV2yMi.cjs"),fi=require("./XTicksAndGridLines-B6CELS7q.cjs"),hi=require("./ReferenceLine-BH0qdf4R.cjs"),yi=require("./YTicksAndGridLines-4pxTRlRK.cjs"),gi=require("./index-B_sAFsEV.cjs"),ji=require("./time-CZd5YLSP.cjs"),vi=require("./linear-BwPAspcq.cjs"),ni=require("./line-DHV4JwCR.cjs"),Ge=require("./step-BZ3C8QFW.cjs"),oi=require("./area-D3Qx7k7K.cjs"),wi=require("./select-Bnfk0lJx.cjs"),Ri=require("./init-DU0ybBc_.cjs"),bi=require("./pointer-Dkq5NV1q.cjs"),Ei=require("./use-in-view-QcfiW0w3.cjs"),S=require("./proxy-BxvUI_9l.cjs"),Oi=require("./GraphFooter.cjs"),Ci=require("./GraphHeader.cjs"),Ai=require("./ColorLegend.cjs"),Pe=require("./Colors.cjs"),Vi=require("./generateRandomString-B5zBiJzS.cjs"),Li=require("./EmptyState-sAEZ_5rU.cjs"),si=require("./GraphContainer-d8A46BK2.cjs"),Si=require("./getNoOfTicks-C_1CFXv_.cjs");function ki(r){const t=s.compilerRuntimeExports.c(217),{data:k,width:ot,height:Nt,lineColors:c,suffix:E,prefix:v,dateFormat:x,showValues:w,noOfXTicks:Tt,rightMargin:qt,leftMargin:V,topMargin:$t,bottomMargin:gt,tooltip:H,highlightAreaSettings:Mt,onSeriesMouseOver:Ft,animate:i,rtl:W,showColorLegendAtTop:Gt,colorDomain:N,diffAreaColors:D,idSuffix:st,strokeWidth:T,showDots:q,refValues:jt,minValue:I,maxValue:vt,annotations:Pt,customHighlightAreaSettings:Ht,yAxisTitle:Y,noOfYTicks:xe,minDate:Wt,maxDate:wt,curveType:Rt,styles:f,classNames:d,precision:b,customLayers:$}=r,bt=A.useRef(null);let X;t[0]!==i.amount||t[1]!==i.once?(X={once:i.once,amount:i.amount},t[0]=i.amount,t[1]=i.once,t[2]=X):X=t[2];const u=Ei.useInView(bt,X),[p,ne]=A.useState(!1);let Et,at;t[3]!==i.duration||t[4]!==p||t[5]!==u?(Et=()=>{if(u&&!p){const o=setTimeout(()=>{ne(!0)},(i.duration+.5)*1e3);return()=>clearTimeout(o)}},at=[u,p,i.duration],t[3]=i.duration,t[4]=p,t[5]=u,t[6]=Et,t[7]=at):(Et=t[6],at=t[7]),A.useEffect(Et,at);const U=Rt==="linear"?ni.curveLinear:Rt==="step"?Ge.curveStep:Rt==="stepAfter"?Ge.stepAfter:Rt==="stepBefore"?Ge.stepBefore:Ge.monotoneX,[L,g]=A.useState(void 0),[h,oe]=A.useState(void 0),[B,Yt]=A.useState(void 0),Ot=Y?V+30:V;let rt;t[8]!==gt||t[9]!==qt||t[10]!==Ot||t[11]!==$t?(rt={top:$t,bottom:gt,left:Ot,right:qt},t[8]=gt,t[9]=qt,t[10]=Ot,t[11]=$t,t[12]=rt):rt=t[12];const y=rt,lt=A.useRef(null);let z;t[13]!==x?(z=o=>({...o,date:O.parse(`${o.date}`,x,new Date)}),t[13]=x,t[14]=z):z=t[14];const n=xi.orderBy(k.map(z),["date"],["asc"]);let ct;if(t[15]!==x||t[16]!==Mt){let o;t[18]!==x?(o=e=>({...e,coordinates:[e.coordinates[0]===null?null:O.parse(`${e.coordinates[0]}`,x,new Date),e.coordinates[1]===null?null:O.parse(`${e.coordinates[1]}`,x,new Date)]}),t[18]=x,t[19]=o):o=t[19],ct=Mt.map(o),t[15]=x,t[16]=Mt,t[17]=ct}else ct=t[17];const Ct=ct;let ut;if(t[20]!==Ht||t[21]!==x){let o;t[23]!==x?(o=e=>({...e,coordinates:e.coordinates.map((P,Dt)=>Dt%2===0?O.parse(`${P}`,x,new Date):P)}),t[23]=x,t[24]=o):o=t[24],ut=Ht.map(o),t[20]=Ht,t[21]=x,t[22]=ut}else ut=t[22];const se=ut,m=ot-y.left-y.right,j=Nt-y.top-y.bottom,ae=Wt?O.parse(`${Wt}`,x,new Date):n[0].date,Xt=wt?O.parse(`${wt}`,x,new Date):n[n.length-1].date,J=Math.min(...n.map(zi))!==1/0?Math.min(...n.map(Bi))>0?0:Math.min(...n.map(Ui)):0,K=Math.min(...n.map(Xi))!==1/0?Math.min(...n.map(Yi))>0?0:Math.min(...n.map(Wi)):0,M=Math.max(...n.map(Hi))!==1/0?Math.max(...n.map(Pi)):0,Ut=Math.max(...n.map(Gi))!==1/0?Math.max(...n.map(Fi)):0;let Q;t[25]!==J||t[26]!==K||t[27]!==I?(Q=It.checkIfNullOrUndefined(I)?J<K?J:K:I,t[25]=J,t[26]=K,t[27]=I,t[28]=Q):Q=t[28];const R=Q,Z=M>Ut?M:Ut,a=ji.time().domain([ae,Xt]).range([0,m]);let xt;t[29]!==R||t[30]!==I?(xt=It.checkIfNullOrUndefined(I)?R:I,t[29]=R,t[30]=I,t[31]=xt):xt=t[31];let _;t[32]!==Z||t[33]!==vt?(_=It.checkIfNullOrUndefined(vt)?Z>0?Z:0:vt,t[32]=Z,t[33]=vt,t[34]=_):_=t[34];const l=vi.linear().domain([xt,_]).range([j,0]).nice(),mt=ni.line().x(o=>a(o.date)).y(o=>l(o.y1)).curve(U),Bt=ni.line().x(o=>a(o.date)).y(o=>l(o.y2)).curve(U),At=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(o=>l(o.y2)).curve(U),re=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(0).curve(U),le=oi.area().x(o=>a(o.date)).y1(o=>l(o.y2)).y0(0).curve(U),zt=l.ticks(xe),Jt=a.ticks(Tt);A.useEffect(()=>{const o=P=>{const Dt=n[Ri.bisectCenter(n.map(Mi),a.invert(bi.pointer(P)[0]),0)];g(Dt||n[n.length-1]),Ft?.(Dt||n[n.length-1]),Yt(P.clientY),oe(P.clientX)},e=()=>{g(void 0),oe(void 0),Yt(void 0),Ft?.(void 0)};wi.select(lt.current).on("mousemove",o).on("mouseout",e)},[a,n,Ft]);let dt;t[35]===Symbol.for("react.memo_cache_sentinel")?(dt={fill:"none"},t[35]=dt):dt=t[35];let tt;t[36]===Symbol.for("react.memo_cache_sentinel")?(tt={fill:"none"},t[36]=tt):tt=t[36];let pt;t[37]!==i||t[38]!==j||t[39]!==m||t[40]!==Ct||t[41]!==u||t[42]!==a?(pt=s.jsxRuntimeExports.jsx(gi.HighlightArea,{areaSettings:Ct,width:m,height:j,scale:a,animate:i,isInView:u}),t[37]=i,t[38]=j,t[39]=m,t[40]=Ct,t[41]=u,t[42]=a,t[43]=pt):pt=t[43];const et=f?.yAxis?.gridLines,ce=f?.yAxis?.labels;let it;t[44]!==et||t[45]!==ce?(it={gridLines:et,labels:ce},t[44]=et,t[45]=ce,t[46]=it):it=t[46];const ue=d?.yAxis?.gridLines,Vt=d?.yAxis?.labels;let Lt;t[47]!==ue||t[48]!==Vt?(Lt={gridLines:ue,labels:Vt},t[47]=ue,t[48]=Vt,t[49]=Lt):Lt=t[49];const ft=l(R<0?0:R),ht=l(R<0?0:R),St=0-V,kt=m+y.right,F=R<0?0:R;let C;t[50]!==b||t[51]!==v||t[52]!==E||t[53]!==F?(C=ei.numberFormattingFunction(F,"NA",b,v,E),t[50]=b,t[51]=v,t[52]=E,t[53]=F,t[54]=C):C=t[54];const G=0-V,yt=l(R<0?0:R),Kt=Z<0?"1rem":-5;let nt;t[55]!==G||t[56]!==yt||t[57]!==Kt?(nt={x:G,y:yt,dx:0,dy:Kt},t[55]=G,t[56]=yt,t[57]=Kt,t[58]=nt):nt=t[58];const He=d?.xAxis?.axis,We=d?.yAxis?.labels;let Qt;t[59]!==He||t[60]!==We?(Qt={axis:He,label:We},t[59]=He,t[60]=We,t[61]=Qt):Qt=t[61];const Ye=f?.xAxis?.axis,Xe=f?.yAxis?.labels;let Zt;t[62]!==Ye||t[63]!==Xe?(Zt={axis:Ye,label:Xe},t[62]=Ye,t[63]=Xe,t[64]=Zt):Zt=t[64];let me;t[65]!==ft||t[66]!==ht||t[67]!==St||t[68]!==kt||t[69]!==C||t[70]!==nt||t[71]!==Qt||t[72]!==Zt?(me=s.jsxRuntimeExports.jsx(pi.Axis,{y1:ft,y2:ht,x1:St,x2:kt,label:C,labelPos:nt,classNames:Qt,styles:Zt}),t[65]=ft,t[66]=ht,t[67]=St,t[68]=kt,t[69]=C,t[70]=nt,t[71]=Qt,t[72]=Zt,t[73]=me):me=t[73];const Ue=0-V-15,Be=j/2,ze=f?.yAxis?.title,Je=d?.yAxis?.title;let de;t[74]!==Ue||t[75]!==Be||t[76]!==ze||t[77]!==Je||t[78]!==Y?(de=s.jsxRuntimeExports.jsx(di.AxisTitle,{x:Ue,y:Be,style:ze,className:Je,text:Y,rotate90:!0}),t[74]=Ue,t[75]=Be,t[76]=ze,t[77]=Je,t[78]=Y,t[79]=de):de=t[79];let pe;t[80]!==x?(pe=o=>O.format(o,x),t[80]=x,t[81]=pe):pe=t[81];const ai=Jt.map(pe),ri=Jt.map(o=>a(o)),Ke=f?.xAxis?.gridLines,Qe=f?.xAxis?.labels;let fe;t[82]!==Ke||t[83]!==Qe?(fe={gridLines:Ke,labels:Qe},t[82]=Ke,t[83]=Qe,t[84]=fe):fe=t[84];const Ze=d?.xAxis?.gridLines;let _t;t[85]!==Ze?(_t=s.mo("opacity-0",Ze),t[85]=Ze,t[86]=_t):_t=t[86];const _e=d?.xAxis?.labels;let te;t[87]!==_e?(te=s.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",_e),t[87]=_e,t[88]=te):te=t[88];let he;t[89]!==_t||t[90]!==te?(he={gridLines:_t,labels:te},t[89]=_t,t[90]=te,t[91]=he):he=t[91];let ye;t[92]!==$?(ye=$.filter(Ti).map(Ni),t[92]=$,t[93]=ye):ye=t[93];let ge;t[94]!==D[1]?(ge={fill:D[1]},t[94]=D[1],t[95]=ge):ge=t[95];let je;t[96]!==i.duration?(je={opacity:0,transition:{duration:i.duration}},t[96]=i.duration,t[97]=je):je=t[97];let ve;t[98]===Symbol.for("react.memo_cache_sentinel")?(ve={opacity:1},t[98]=ve):ve=t[98];let we;t[99]!==i.duration?(we={initial:ve,whileInView:{opacity:1,transition:{duration:i.duration}}},t[99]=i.duration,t[100]=we):we=t[100];let Re;t[101]!==D[0]?(Re={fill:D[0]},t[101]=D[0],t[102]=Re):Re=t[102];let be;t[103]!==i.duration?(be={opacity:0,transition:{duration:i.duration}},t[103]=i.duration,t[104]=be):be=t[104];let Ee;t[105]===Symbol.for("react.memo_cache_sentinel")?(Ee={opacity:0},t[105]=Ee):Ee=t[105];let Oe;t[106]!==i.duration?(Oe={initial:Ee,whileInView:{opacity:1,transition:{duration:i.duration}}},t[106]=i.duration,t[107]=Oe):Oe=t[107];let Ce;t[108]!==c[0]||t[109]!==T?(Ce={fill:"none",stroke:c[0],strokeWidth:T},t[108]=c[0],t[109]=T,t[110]=Ce):Ce=t[110];let Ae;t[111]!==i.duration?(Ae={opacity:0,transition:{duration:i.duration}},t[111]=i.duration,t[112]=Ae):Ae=t[112];let Ve;t[113]!==c[1]||t[114]!==T?(Ve={fill:"none",stroke:c[1],strokeWidth:T},t[113]=c[1],t[114]=T,t[115]=Ve):Ve=t[115];let Le;t[116]!==i.duration?(Le={opacity:0,transition:{duration:i.duration}},t[116]=i.duration,t[117]=Le):Le=t[117];const li=1,ti=Bt(n)||"";let ee;t[118]!==i.duration?(ee={duration:i.duration},t[118]=i.duration,t[119]=ee):ee=t[119];let Se;t[120]!==ti||t[121]!==ee?(Se={pathLength:li,d:ti,opacity:1,transition:ee},t[120]=ti,t[121]=ee,t[122]=Se):Se=t[122];let ke;t[123]!==i.duration||t[124]!==N||t[125]!==n||t[126]!==p||t[127]!==u||t[128]!==c[0]||t[129]!==c[1]||t[130]!==Gt||t[131]!==a||t[132]!==l?(ke=Gt?null:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:N[0]},N[0]),s.jsxRuntimeExports.jsx(S.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:N[1]},N[1])]}),t[123]=i.duration,t[124]=N,t[125]=n,t[126]=p,t[127]=u,t[128]=c[0],t[129]=c[1],t[130]=Gt,t[131]=a,t[132]=l,t[133]=ke):ke=t[133];let De;t[134]!==d?.mouseOverLine||t[135]!==j||t[136]!==L||t[137]!==f?.mouseOverLine||t[138]!==a?(De=L?s.jsxRuntimeExports.jsx("line",{y1:0,y2:j,x1:a(L.date),x2:a(L.date),className:s.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",d?.mouseOverLine),style:f?.mouseOverLine}):null,t[134]=d?.mouseOverLine,t[135]=j,t[136]=L,t[137]=f?.mouseOverLine,t[138]=a,t[139]=De):De=t[139];let Ie;if(t[140]!==i.duration||t[141]!==d?.graphObjectValues||t[142]!==n||t[143]!==m||t[144]!==p||t[145]!==u||t[146]!==c[0]||t[147]!==c[1]||t[148]!==b||t[149]!==v||t[150]!==q||t[151]!==w||t[152]!==f?.graphObjectValues||t[153]!==E||t[154]!==a||t[155]!==l){let o;t[157]!==i.duration||t[158]!==d?.graphObjectValues||t[159]!==n.length||t[160]!==m||t[161]!==p||t[162]!==u||t[163]!==c[0]||t[164]!==c[1]||t[165]!==b||t[166]!==v||t[167]!==q||t[168]!==w||t[169]!==f?.graphObjectValues||t[170]!==E||t[171]!==a||t[172]!==l?(o=(e,P)=>s.jsxRuntimeExports.jsxs(S.motion.g,{children:[It.checkIfNullOrUndefined(e.y1)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[q?s.jsxRuntimeExports.jsx(S.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],transition:{duration:.5,delay:i.duration},cx:a(e.date),cy:l(e.y1)}},initial:"initial",animate:u?"whileInView":"initial"}):null,w?s.jsxRuntimeExports.jsx(S.motion.text,{dy:e.y2<e.y1?-8:"1em",style:{textAnchor:"middle",...f?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-1 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],x:a(e.date),y:l(e.y1),transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y1,"NA",b,v,E)}):null]}),It.checkIfNullOrUndefined(e.y2)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[q?s.jsxRuntimeExports.jsx(S.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y2),fill:c[1]},whileInView:{opacity:1,fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration},cx:a(e.date),cy:l(e.y2)}},initial:"initial",animate:u?"whileInView":"initial"}):null,w?s.jsxRuntimeExports.jsx(S.motion.text,{dy:e.y2>e.y1?-8:"1em",style:{textAnchor:"middle",...f?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-2 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y2),fill:c[1]},whileInView:{opacity:1,x:a(e.date),y:l(e.y2),fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y2,"NA",b,v,E)}):null]})]},P),t[157]=i.duration,t[158]=d?.graphObjectValues,t[159]=n.length,t[160]=m,t[161]=p,t[162]=u,t[163]=c[0],t[164]=c[1],t[165]=b,t[166]=v,t[167]=q,t[168]=w,t[169]=f?.graphObjectValues,t[170]=E,t[171]=a,t[172]=l,t[173]=o):o=t[173],Ie=n.map(o),t[140]=i.duration,t[141]=d?.graphObjectValues,t[142]=n,t[143]=m,t[144]=p,t[145]=u,t[146]=c[0],t[147]=c[1],t[148]=b,t[149]=v,t[150]=q,t[151]=w,t[152]=f?.graphObjectValues,t[153]=E,t[154]=a,t[155]=l,t[156]=Ie}else Ie=t[156];let Ne;t[174]!==i||t[175]!==m||t[176]!==u||t[177]!==V||t[178]!==y.right||t[179]!==jt||t[180]!==l?(Ne=jt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:jt.map((o,e)=>s.jsxRuntimeExports.jsx(hi.RefLineY,{text:o.text,color:o.color,y:l(o.value),x1:0-V,x2:m+y.right,classNames:o.classNames,styles:o.styles,animate:i,isInView:u},e))}):null,t[174]=i,t[175]=m,t[176]=u,t[177]=V,t[178]=y.right,t[179]=jt,t[180]=l,t[181]=Ne):Ne=t[181];let ie;if(t[182]!==i||t[183]!==Pt||t[184]!==x||t[185]!==m||t[186]!==u||t[187]!==y.right||t[188]!==W||t[189]!==a||t[190]!==l){let o;t[192]!==i||t[193]!==x||t[194]!==m||t[195]!==u||t[196]!==y.right||t[197]!==W||t[198]!==a||t[199]!==l?(o=(e,P)=>{const Dt=ii.getLineEndPoint({x:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date)):0,y:e.yCoordinate?l(e.yCoordinate):0},It.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),ci=e.showConnector?{y1:Dt.y,x1:Dt.x,y2:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?l(e.yCoordinate):0,cx:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date)):0,circleRadius:It.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,ui={y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:W?0:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:W?e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0):m+y.right-(e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return s.jsxRuntimeExports.jsx(ii.Annotation,{color:e.color,connectorsSettings:ci,labelSettings:ui,text:e.text,classNames:e.classNames,styles:e.styles,animate:i,isInView:u},P)},t[192]=i,t[193]=x,t[194]=m,t[195]=u,t[196]=y.right,t[197]=W,t[198]=a,t[199]=l,t[200]=o):o=t[200],ie=Pt.map(o),t[182]=i,t[183]=Pt,t[184]=x,t[185]=m,t[186]=u,t[187]=y.right,t[188]=W,t[189]=a,t[190]=l,t[191]=ie}else ie=t[191];let Te;t[201]!==ie?(Te=s.jsxRuntimeExports.jsx("g",{children:ie}),t[201]=ie,t[202]=Te):Te=t[202];let qe;t[203]!==$?(qe=$.filter(Ii).map(Di),t[203]=$,t[204]=qe):qe=t[204];let $e;t[205]===Symbol.for("react.memo_cache_sentinel")?($e={fill:"none",pointerEvents:"all"},t[205]=$e):$e=t[205];let Me;t[206]!==lt||t[207]!==j||t[208]!==m?(Me=s.jsxRuntimeExports.jsx("rect",{ref:lt,style:$e,width:m,height:j}),t[206]=lt,t[207]=j,t[208]=m,t[209]=Me):Me=t[209];let Fe;return t[210]!==d?.tooltip||t[211]!==h||t[212]!==B||t[213]!==L||t[214]!==f?.tooltip||t[215]!==H?(Fe=L&&H&&h&&B?s.jsxRuntimeExports.jsx(mi.Tooltip,{data:L,body:H,xPos:h,yPos:B,backgroundStyle:f?.tooltip,className:d?.tooltip}):null,t[210]=d?.tooltip,t[211]=h,t[212]=B,t[213]=L,t[214]=f?.tooltip,t[215]=H,t[216]=Fe):Fe=t[216],s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(S.motion.svg,{width:`${ot}px`,height:`${Nt}px`,viewBox:`0 0 ${ot} ${Nt}`,direction:"ltr",ref:bt,children:s.jsxRuntimeExports.jsxs("g",{transform:`translate(${y.left},${y.top})`,children:[s.jsxRuntimeExports.jsx("clipPath",{id:`above${st}`,children:s.jsxRuntimeExports.jsx("path",{d:le(n),style:dt})}),s.jsxRuntimeExports.jsx("clipPath",{id:`below${st}`,children:s.jsxRuntimeExports.jsx("path",{d:re(n),style:tt})}),pt,s.jsxRuntimeExports.jsx(ii.CustomArea,{areaSettings:se,scaleX:a,scaleY:l,animate:i,isInView:u}),s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(yi.YTicksAndGridLines,{values:zt.filter($i),y:zt.filter(qi).map(o=>l(o)),x1:0-V,x2:m+y.right,styles:it,classNames:Lt,suffix:E,prefix:v,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:b}),me,de]})}),s.jsxRuntimeExports.jsx(fi.XTicksAndGridLines,{values:ai,x:ri,y1:0,y2:j,styles:fe,classNames:he,suffix:E,prefix:v,labelType:"primary",showGridLines:!0,precision:b}),ye,s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.path,{clipPath:`url(#below${st})`,d:At(n)||"",style:ge,exit:je,variants:we,initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(S.motion.path,{clipPath:`url(#above${st})`,d:At(n)||"",style:Re,exit:be,variants:Oe,initial:"initial",animate:u?"whileInView":"initial"})]}),s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.path,{d:mt(n)||"",style:Ce,exit:Ae,variants:{initial:{pathLength:0,d:mt(n)||"",opacity:1},whileInView:{pathLength:1,d:mt(n)||"",opacity:1,transition:{duration:i.duration}}},initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(S.motion.path,{style:Ve,exit:Le,variants:{initial:{pathLength:0,d:Bt(n)||"",opacity:1},whileInView:Se},initial:"initial",animate:u?"whileInView":"initial"}),ke,De,Ie]}),Ne,Te,qe,Me]})}),Fe]})}function Di(r){return r.layer}function Ii(r){return r.position==="after"}function Ni(r){return r.layer}function Ti(r){return r.position==="before"}function qi(r){return r!==0}function $i(r){return r!==0}function Mi(r){return r.date}function Fi(r){return r.y2}function Gi(r){return r.y2}function Pi(r){return r.y1}function Hi(r){return r.y1}function Wi(r){return r.y2}function Yi(r){return r.y2}function Xi(r){return r.y2}function Ui(r){return r.y1}function Bi(r){return r.y1}function zi(r){return r.y1}function Ji(r){const t=s.compilerRuntimeExports.c(90),{data:k,graphTitle:ot,suffix:Nt,sources:c,prefix:E,graphDescription:v,height:x,width:w,footNote:Tt,noOfXTicks:qt,dateFormat:V,showValues:$t,padding:gt,lineColors:H,backgroundColor:Mt,leftMargin:Ft,rightMargin:i,topMargin:W,bottomMargin:Gt,tooltip:N,highlightAreaSettings:D,relativeHeight:st,onSeriesMouseOver:T,graphID:q,graphDownload:jt,dataDownload:I,animate:vt,language:Pt,minHeight:Ht,labels:Y,showColorLegendAtTop:xe,colorLegendTitle:Wt,diffAreaColors:wt,strokeWidth:Rt,showDots:f,refValues:d,minValue:b,maxValue:$,annotations:bt,customHighlightAreaSettings:X,theme:u,ariaLabel:p,yAxisTitle:ne,noOfYTicks:Et,minDate:at,maxDate:U,curveType:L,styles:g,classNames:h,precision:oe,customLayers:B}=r,Yt=Nt===void 0?"":Nt,Ot=E===void 0?"":E,rt=qt===void 0?10:qt,y=V===void 0?"yyyy":V,lt=$t===void 0?!1:$t;let z;t[0]!==H?(z=H===void 0?[Pe.Colors.light.categoricalColors.colors[0],Pe.Colors.light.categoricalColors.colors[1]]:H,t[0]=H,t[1]=z):z=t[1];const n=z,ct=Mt===void 0?!1:Mt,Ct=Ft===void 0?30:Ft,ut=i===void 0?50:i,se=W===void 0?20:W,m=Gt===void 0?25:Gt;let j;t[2]!==D?(j=D===void 0?[]:D,t[2]=D,t[3]=j):j=t[3];const ae=j,Xt=jt===void 0?!1:jt,J=I===void 0?!1:I,K=vt===void 0?!1:vt,M=Pt===void 0?"en":Pt,Ut=Ht===void 0?0:Ht,Q=xe===void 0?!1:xe;let R;t[4]!==wt?(R=wt===void 0?[Pe.Colors.alerts.red,Pe.Colors.alerts.darkGreen]:wt,t[4]=wt,t[5]=R):R=t[5];const Z=R,a=Rt===void 0?2:Rt,xt=f===void 0?!0:f;let _;t[6]!==d?(_=d===void 0?[]:d,t[6]=d,t[7]=_):_=t[7];const l=_;let mt;t[8]!==bt?(mt=bt===void 0?[]:bt,t[8]=bt,t[9]=mt):mt=t[9];const Bt=mt;let At;t[10]!==X?(At=X===void 0?[]:X,t[10]=X,t[11]=At):At=t[11];const re=At,le=u===void 0?"light":u,zt=Et===void 0?5:Et,Jt=L===void 0?"curve":L,dt=oe===void 0?2:oe;let tt;t[12]!==B?(tt=B===void 0?[]:B,t[12]=B,t[13]=tt):tt=t[13];const pt=tt,[et,ce]=A.useState(0),[it,ue]=A.useState(0),Vt=A.useRef(null),Lt=A.useRef(null);let ft,ht;t[14]===Symbol.for("react.memo_cache_sentinel")?(ft=()=>{const Kt=new ResizeObserver(nt=>{ce(nt[0].target.clientWidth||620),ue(nt[0].target.clientHeight||480)});return Vt.current&&Kt.observe(Vt.current),()=>Kt.disconnect()},ht=[],t[14]=ft,t[15]=ht):(ft=t[14],ht=t[15]),A.useEffect(ft,ht);const St=h?.graphContainer,kt=g?.graphContainer;let F;t[16]!==h?.description||t[17]!==h?.title||t[18]!==k||t[19]!==J||t[20]!==v||t[21]!==Xt||t[22]!==ot||t[23]!==g?.description||t[24]!==g?.title||t[25]!==w?(F=ot||v||Xt||J?s.jsxRuntimeExports.jsx(Ci.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:h?.title,description:h?.description},graphTitle:ot,graphDescription:v,width:w,graphDownload:Xt?Lt:void 0,dataDownload:J?k.map(tn).filter(_i).length>0?k.map(Zi).filter(Qi):k.filter(Ki):null}):null,t[16]=h?.description,t[17]=h?.title,t[18]=k,t[19]=J,t[20]=v,t[21]=Xt,t[22]=ot,t[23]=g?.description,t[24]=g?.title,t[25]=w,t[26]=F):F=t[26];let C;t[27]!==K||t[28]!==Bt||t[29]!==m||t[30]!==h||t[31]!==Wt||t[32]!==Jt||t[33]!==re||t[34]!==pt||t[35]!==k||t[36]!==y||t[37]!==Z||t[38]!==ae||t[39]!==Y||t[40]!==M||t[41]!==Ct||t[42]!==n||t[43]!==U||t[44]!==$||t[45]!==at||t[46]!==b||t[47]!==rt||t[48]!==zt||t[49]!==T||t[50]!==dt||t[51]!==Ot||t[52]!==l||t[53]!==ut||t[54]!==Q||t[55]!==xt||t[56]!==lt||t[57]!==a||t[58]!==g||t[59]!==Yt||t[60]!==it||t[61]!==et||t[62]!==N||t[63]!==se||t[64]!==ne?(C=k.length===0?s.jsxRuntimeExports.jsx(Li.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Q?s.jsxRuntimeExports.jsx(Ai.ColorLegend,{colorDomain:Y,colorLegendTitle:Wt,colors:n,showNAColor:!1,className:h?.colorLegend}):null,s.jsxRuntimeExports.jsx(si.GraphArea,{ref:Vt,children:et&&it?s.jsxRuntimeExports.jsx(ki,{data:k,lineColors:n,colorDomain:Y,width:et,height:it,suffix:Yt,prefix:Ot,dateFormat:y,showValues:lt,noOfXTicks:rt??Si.getNoOfTicks(et),leftMargin:Ct,rightMargin:ut,topMargin:se,bottomMargin:m,highlightAreaSettings:ae,tooltip:N,onSeriesMouseOver:T,showColorLegendAtTop:Q,animate:K===!0?{duration:.5,once:!0,amount:.5}:K||{duration:0,once:!0,amount:0},rtl:M==="he"||M==="ar",diffAreaColors:Z,idSuffix:Vi.generateRandomString(8),strokeWidth:a,showDots:xt,refValues:l,minValue:b,maxValue:$,annotations:Bt,customHighlightAreaSettings:re,yAxisTitle:ne,noOfYTicks:zt,minDate:at,maxDate:U,curveType:Jt,styles:g,classNames:h,precision:dt,customLayers:pt}):null})]}),t[27]=K,t[28]=Bt,t[29]=m,t[30]=h,t[31]=Wt,t[32]=Jt,t[33]=re,t[34]=pt,t[35]=k,t[36]=y,t[37]=Z,t[38]=ae,t[39]=Y,t[40]=M,t[41]=Ct,t[42]=n,t[43]=U,t[44]=$,t[45]=at,t[46]=b,t[47]=rt,t[48]=zt,t[49]=T,t[50]=dt,t[51]=Ot,t[52]=l,t[53]=ut,t[54]=Q,t[55]=xt,t[56]=lt,t[57]=a,t[58]=g,t[59]=Yt,t[60]=it,t[61]=et,t[62]=N,t[63]=se,t[64]=ne,t[65]=C):C=t[65];let G;t[66]!==h?.footnote||t[67]!==h?.source||t[68]!==Tt||t[69]!==c||t[70]!==g?.footnote||t[71]!==g?.source||t[72]!==w?(G=c||Tt?s.jsxRuntimeExports.jsx(Oi.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:c,footNote:Tt,width:w}):null,t[66]=h?.footnote,t[67]=h?.source,t[68]=Tt,t[69]=c,t[70]=g?.footnote,t[71]=g?.source,t[72]=w,t[73]=G):G=t[73];let yt;return t[74]!==p||t[75]!==ct||t[76]!==q||t[77]!==x||t[78]!==M||t[79]!==Ut||t[80]!==gt||t[81]!==st||t[82]!==St||t[83]!==kt||t[84]!==F||t[85]!==C||t[86]!==G||t[87]!==le||t[88]!==w?(yt=s.jsxRuntimeExports.jsxs(si.GraphContainer,{className:St,style:kt,id:q,ref:Lt,"aria-label":p,backgroundColor:ct,theme:le,language:M,minHeight:Ut,width:w,height:x,relativeHeight:st,padding:gt,children:[F,C,G]}),t[74]=p,t[75]=ct,t[76]=q,t[77]=x,t[78]=M,t[79]=Ut,t[80]=gt,t[81]=st,t[82]=St,t[83]=kt,t[84]=F,t[85]=C,t[86]=G,t[87]=le,t[88]=w,t[89]=yt):yt=t[89],yt}function Ki(r){return r!==void 0}function Qi(r){return r!==void 0}function Zi(r){return r.data}function _i(r){return r!==void 0}function tn(r){return r.data}exports.DifferenceLineChart=Ji;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),A=require("react"),O=require("./parse-hMnG_lRV.cjs"),xi=require("./index-Cno4Q0YE.cjs"),ei=require("./numberFormattingFunction-02t-wJta.cjs"),mi=require("./Tooltip-uUdw6wJL.cjs"),It=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ii=require("./customArea-CMF5g-C3.cjs"),di=require("./AxisTitle-sS5bLLR7.cjs"),pi=require("./Axis-DxRV2yMi.cjs"),fi=require("./XTicksAndGridLines-B6CELS7q.cjs"),hi=require("./ReferenceLine-BH0qdf4R.cjs"),yi=require("./YTicksAndGridLines-4pxTRlRK.cjs"),gi=require("./index-B_sAFsEV.cjs"),ji=require("./time-CZd5YLSP.cjs"),vi=require("./linear-BwPAspcq.cjs"),ni=require("./line-DaEMhXmx.cjs"),Ge=require("./step-BZ3C8QFW.cjs"),oi=require("./area-C1gxfNGD.cjs"),wi=require("./select-Bnfk0lJx.cjs"),Ri=require("./init-DU0ybBc_.cjs"),bi=require("./pointer-Dkq5NV1q.cjs"),Ei=require("./use-in-view-QcfiW0w3.cjs"),S=require("./proxy-BxvUI_9l.cjs"),Oi=require("./GraphFooter.cjs"),Ci=require("./GraphHeader.cjs"),Ai=require("./ColorLegend.cjs"),Pe=require("./Colors.cjs"),Vi=require("./generateRandomString-B5zBiJzS.cjs"),Li=require("./EmptyState-sAEZ_5rU.cjs"),si=require("./GraphContainer-d8A46BK2.cjs"),Si=require("./getNoOfTicks-C_1CFXv_.cjs");function ki(r){const t=s.compilerRuntimeExports.c(217),{data:k,width:ot,height:Nt,lineColors:c,suffix:E,prefix:v,dateFormat:x,showValues:w,noOfXTicks:Tt,rightMargin:qt,leftMargin:V,topMargin:$t,bottomMargin:gt,tooltip:H,highlightAreaSettings:Mt,onSeriesMouseOver:Ft,animate:i,rtl:W,showColorLegendAtTop:Gt,colorDomain:N,diffAreaColors:D,idSuffix:st,strokeWidth:T,showDots:q,refValues:jt,minValue:I,maxValue:vt,annotations:Pt,customHighlightAreaSettings:Ht,yAxisTitle:Y,noOfYTicks:xe,minDate:Wt,maxDate:wt,curveType:Rt,styles:f,classNames:d,precision:b,customLayers:$}=r,bt=A.useRef(null);let X;t[0]!==i.amount||t[1]!==i.once?(X={once:i.once,amount:i.amount},t[0]=i.amount,t[1]=i.once,t[2]=X):X=t[2];const u=Ei.useInView(bt,X),[p,ne]=A.useState(!1);let Et,at;t[3]!==i.duration||t[4]!==p||t[5]!==u?(Et=()=>{if(u&&!p){const o=setTimeout(()=>{ne(!0)},(i.duration+.5)*1e3);return()=>clearTimeout(o)}},at=[u,p,i.duration],t[3]=i.duration,t[4]=p,t[5]=u,t[6]=Et,t[7]=at):(Et=t[6],at=t[7]),A.useEffect(Et,at);const U=Rt==="linear"?ni.curveLinear:Rt==="step"?Ge.curveStep:Rt==="stepAfter"?Ge.stepAfter:Rt==="stepBefore"?Ge.stepBefore:Ge.monotoneX,[L,g]=A.useState(void 0),[h,oe]=A.useState(void 0),[B,Yt]=A.useState(void 0),Ot=Y?V+30:V;let rt;t[8]!==gt||t[9]!==qt||t[10]!==Ot||t[11]!==$t?(rt={top:$t,bottom:gt,left:Ot,right:qt},t[8]=gt,t[9]=qt,t[10]=Ot,t[11]=$t,t[12]=rt):rt=t[12];const y=rt,lt=A.useRef(null);let z;t[13]!==x?(z=o=>({...o,date:O.parse(`${o.date}`,x,new Date)}),t[13]=x,t[14]=z):z=t[14];const n=xi.orderBy(k.map(z),["date"],["asc"]);let ct;if(t[15]!==x||t[16]!==Mt){let o;t[18]!==x?(o=e=>({...e,coordinates:[e.coordinates[0]===null?null:O.parse(`${e.coordinates[0]}`,x,new Date),e.coordinates[1]===null?null:O.parse(`${e.coordinates[1]}`,x,new Date)]}),t[18]=x,t[19]=o):o=t[19],ct=Mt.map(o),t[15]=x,t[16]=Mt,t[17]=ct}else ct=t[17];const Ct=ct;let ut;if(t[20]!==Ht||t[21]!==x){let o;t[23]!==x?(o=e=>({...e,coordinates:e.coordinates.map((P,Dt)=>Dt%2===0?O.parse(`${P}`,x,new Date):P)}),t[23]=x,t[24]=o):o=t[24],ut=Ht.map(o),t[20]=Ht,t[21]=x,t[22]=ut}else ut=t[22];const se=ut,m=ot-y.left-y.right,j=Nt-y.top-y.bottom,ae=Wt?O.parse(`${Wt}`,x,new Date):n[0].date,Xt=wt?O.parse(`${wt}`,x,new Date):n[n.length-1].date,J=Math.min(...n.map(zi))!==1/0?Math.min(...n.map(Bi))>0?0:Math.min(...n.map(Ui)):0,K=Math.min(...n.map(Xi))!==1/0?Math.min(...n.map(Yi))>0?0:Math.min(...n.map(Wi)):0,M=Math.max(...n.map(Hi))!==1/0?Math.max(...n.map(Pi)):0,Ut=Math.max(...n.map(Gi))!==1/0?Math.max(...n.map(Fi)):0;let Q;t[25]!==J||t[26]!==K||t[27]!==I?(Q=It.checkIfNullOrUndefined(I)?J<K?J:K:I,t[25]=J,t[26]=K,t[27]=I,t[28]=Q):Q=t[28];const R=Q,Z=M>Ut?M:Ut,a=ji.time().domain([ae,Xt]).range([0,m]);let xt;t[29]!==R||t[30]!==I?(xt=It.checkIfNullOrUndefined(I)?R:I,t[29]=R,t[30]=I,t[31]=xt):xt=t[31];let _;t[32]!==Z||t[33]!==vt?(_=It.checkIfNullOrUndefined(vt)?Z>0?Z:0:vt,t[32]=Z,t[33]=vt,t[34]=_):_=t[34];const l=vi.linear().domain([xt,_]).range([j,0]).nice(),mt=ni.line().x(o=>a(o.date)).y(o=>l(o.y1)).curve(U),Bt=ni.line().x(o=>a(o.date)).y(o=>l(o.y2)).curve(U),At=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(o=>l(o.y2)).curve(U),re=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(0).curve(U),le=oi.area().x(o=>a(o.date)).y1(o=>l(o.y2)).y0(0).curve(U),zt=l.ticks(xe),Jt=a.ticks(Tt);A.useEffect(()=>{const o=P=>{const Dt=n[Ri.bisectCenter(n.map(Mi),a.invert(bi.pointer(P)[0]),0)];g(Dt||n[n.length-1]),Ft?.(Dt||n[n.length-1]),Yt(P.clientY),oe(P.clientX)},e=()=>{g(void 0),oe(void 0),Yt(void 0),Ft?.(void 0)};wi.select(lt.current).on("mousemove",o).on("mouseout",e)},[a,n,Ft]);let dt;t[35]===Symbol.for("react.memo_cache_sentinel")?(dt={fill:"none"},t[35]=dt):dt=t[35];let tt;t[36]===Symbol.for("react.memo_cache_sentinel")?(tt={fill:"none"},t[36]=tt):tt=t[36];let pt;t[37]!==i||t[38]!==j||t[39]!==m||t[40]!==Ct||t[41]!==u||t[42]!==a?(pt=s.jsxRuntimeExports.jsx(gi.HighlightArea,{areaSettings:Ct,width:m,height:j,scale:a,animate:i,isInView:u}),t[37]=i,t[38]=j,t[39]=m,t[40]=Ct,t[41]=u,t[42]=a,t[43]=pt):pt=t[43];const et=f?.yAxis?.gridLines,ce=f?.yAxis?.labels;let it;t[44]!==et||t[45]!==ce?(it={gridLines:et,labels:ce},t[44]=et,t[45]=ce,t[46]=it):it=t[46];const ue=d?.yAxis?.gridLines,Vt=d?.yAxis?.labels;let Lt;t[47]!==ue||t[48]!==Vt?(Lt={gridLines:ue,labels:Vt},t[47]=ue,t[48]=Vt,t[49]=Lt):Lt=t[49];const ft=l(R<0?0:R),ht=l(R<0?0:R),St=0-V,kt=m+y.right,F=R<0?0:R;let C;t[50]!==b||t[51]!==v||t[52]!==E||t[53]!==F?(C=ei.numberFormattingFunction(F,"NA",b,v,E),t[50]=b,t[51]=v,t[52]=E,t[53]=F,t[54]=C):C=t[54];const G=0-V,yt=l(R<0?0:R),Kt=Z<0?"1rem":-5;let nt;t[55]!==G||t[56]!==yt||t[57]!==Kt?(nt={x:G,y:yt,dx:0,dy:Kt},t[55]=G,t[56]=yt,t[57]=Kt,t[58]=nt):nt=t[58];const He=d?.xAxis?.axis,We=d?.yAxis?.labels;let Qt;t[59]!==He||t[60]!==We?(Qt={axis:He,label:We},t[59]=He,t[60]=We,t[61]=Qt):Qt=t[61];const Ye=f?.xAxis?.axis,Xe=f?.yAxis?.labels;let Zt;t[62]!==Ye||t[63]!==Xe?(Zt={axis:Ye,label:Xe},t[62]=Ye,t[63]=Xe,t[64]=Zt):Zt=t[64];let me;t[65]!==ft||t[66]!==ht||t[67]!==St||t[68]!==kt||t[69]!==C||t[70]!==nt||t[71]!==Qt||t[72]!==Zt?(me=s.jsxRuntimeExports.jsx(pi.Axis,{y1:ft,y2:ht,x1:St,x2:kt,label:C,labelPos:nt,classNames:Qt,styles:Zt}),t[65]=ft,t[66]=ht,t[67]=St,t[68]=kt,t[69]=C,t[70]=nt,t[71]=Qt,t[72]=Zt,t[73]=me):me=t[73];const Ue=0-V-15,Be=j/2,ze=f?.yAxis?.title,Je=d?.yAxis?.title;let de;t[74]!==Ue||t[75]!==Be||t[76]!==ze||t[77]!==Je||t[78]!==Y?(de=s.jsxRuntimeExports.jsx(di.AxisTitle,{x:Ue,y:Be,style:ze,className:Je,text:Y,rotate90:!0}),t[74]=Ue,t[75]=Be,t[76]=ze,t[77]=Je,t[78]=Y,t[79]=de):de=t[79];let pe;t[80]!==x?(pe=o=>O.format(o,x),t[80]=x,t[81]=pe):pe=t[81];const ai=Jt.map(pe),ri=Jt.map(o=>a(o)),Ke=f?.xAxis?.gridLines,Qe=f?.xAxis?.labels;let fe;t[82]!==Ke||t[83]!==Qe?(fe={gridLines:Ke,labels:Qe},t[82]=Ke,t[83]=Qe,t[84]=fe):fe=t[84];const Ze=d?.xAxis?.gridLines;let _t;t[85]!==Ze?(_t=s.mo("opacity-0",Ze),t[85]=Ze,t[86]=_t):_t=t[86];const _e=d?.xAxis?.labels;let te;t[87]!==_e?(te=s.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",_e),t[87]=_e,t[88]=te):te=t[88];let he;t[89]!==_t||t[90]!==te?(he={gridLines:_t,labels:te},t[89]=_t,t[90]=te,t[91]=he):he=t[91];let ye;t[92]!==$?(ye=$.filter(Ti).map(Ni),t[92]=$,t[93]=ye):ye=t[93];let ge;t[94]!==D[1]?(ge={fill:D[1]},t[94]=D[1],t[95]=ge):ge=t[95];let je;t[96]!==i.duration?(je={opacity:0,transition:{duration:i.duration}},t[96]=i.duration,t[97]=je):je=t[97];let ve;t[98]===Symbol.for("react.memo_cache_sentinel")?(ve={opacity:1},t[98]=ve):ve=t[98];let we;t[99]!==i.duration?(we={initial:ve,whileInView:{opacity:1,transition:{duration:i.duration}}},t[99]=i.duration,t[100]=we):we=t[100];let Re;t[101]!==D[0]?(Re={fill:D[0]},t[101]=D[0],t[102]=Re):Re=t[102];let be;t[103]!==i.duration?(be={opacity:0,transition:{duration:i.duration}},t[103]=i.duration,t[104]=be):be=t[104];let Ee;t[105]===Symbol.for("react.memo_cache_sentinel")?(Ee={opacity:0},t[105]=Ee):Ee=t[105];let Oe;t[106]!==i.duration?(Oe={initial:Ee,whileInView:{opacity:1,transition:{duration:i.duration}}},t[106]=i.duration,t[107]=Oe):Oe=t[107];let Ce;t[108]!==c[0]||t[109]!==T?(Ce={fill:"none",stroke:c[0],strokeWidth:T},t[108]=c[0],t[109]=T,t[110]=Ce):Ce=t[110];let Ae;t[111]!==i.duration?(Ae={opacity:0,transition:{duration:i.duration}},t[111]=i.duration,t[112]=Ae):Ae=t[112];let Ve;t[113]!==c[1]||t[114]!==T?(Ve={fill:"none",stroke:c[1],strokeWidth:T},t[113]=c[1],t[114]=T,t[115]=Ve):Ve=t[115];let Le;t[116]!==i.duration?(Le={opacity:0,transition:{duration:i.duration}},t[116]=i.duration,t[117]=Le):Le=t[117];const li=1,ti=Bt(n)||"";let ee;t[118]!==i.duration?(ee={duration:i.duration},t[118]=i.duration,t[119]=ee):ee=t[119];let Se;t[120]!==ti||t[121]!==ee?(Se={pathLength:li,d:ti,opacity:1,transition:ee},t[120]=ti,t[121]=ee,t[122]=Se):Se=t[122];let ke;t[123]!==i.duration||t[124]!==N||t[125]!==n||t[126]!==p||t[127]!==u||t[128]!==c[0]||t[129]!==c[1]||t[130]!==Gt||t[131]!==a||t[132]!==l?(ke=Gt?null:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:N[0]},N[0]),s.jsxRuntimeExports.jsx(S.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:N[1]},N[1])]}),t[123]=i.duration,t[124]=N,t[125]=n,t[126]=p,t[127]=u,t[128]=c[0],t[129]=c[1],t[130]=Gt,t[131]=a,t[132]=l,t[133]=ke):ke=t[133];let De;t[134]!==d?.mouseOverLine||t[135]!==j||t[136]!==L||t[137]!==f?.mouseOverLine||t[138]!==a?(De=L?s.jsxRuntimeExports.jsx("line",{y1:0,y2:j,x1:a(L.date),x2:a(L.date),className:s.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",d?.mouseOverLine),style:f?.mouseOverLine}):null,t[134]=d?.mouseOverLine,t[135]=j,t[136]=L,t[137]=f?.mouseOverLine,t[138]=a,t[139]=De):De=t[139];let Ie;if(t[140]!==i.duration||t[141]!==d?.graphObjectValues||t[142]!==n||t[143]!==m||t[144]!==p||t[145]!==u||t[146]!==c[0]||t[147]!==c[1]||t[148]!==b||t[149]!==v||t[150]!==q||t[151]!==w||t[152]!==f?.graphObjectValues||t[153]!==E||t[154]!==a||t[155]!==l){let o;t[157]!==i.duration||t[158]!==d?.graphObjectValues||t[159]!==n.length||t[160]!==m||t[161]!==p||t[162]!==u||t[163]!==c[0]||t[164]!==c[1]||t[165]!==b||t[166]!==v||t[167]!==q||t[168]!==w||t[169]!==f?.graphObjectValues||t[170]!==E||t[171]!==a||t[172]!==l?(o=(e,P)=>s.jsxRuntimeExports.jsxs(S.motion.g,{children:[It.checkIfNullOrUndefined(e.y1)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[q?s.jsxRuntimeExports.jsx(S.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],transition:{duration:.5,delay:i.duration},cx:a(e.date),cy:l(e.y1)}},initial:"initial",animate:u?"whileInView":"initial"}):null,w?s.jsxRuntimeExports.jsx(S.motion.text,{dy:e.y2<e.y1?-8:"1em",style:{textAnchor:"middle",...f?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-1 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],x:a(e.date),y:l(e.y1),transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y1,"NA",b,v,E)}):null]}),It.checkIfNullOrUndefined(e.y2)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[q?s.jsxRuntimeExports.jsx(S.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y2),fill:c[1]},whileInView:{opacity:1,fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration},cx:a(e.date),cy:l(e.y2)}},initial:"initial",animate:u?"whileInView":"initial"}):null,w?s.jsxRuntimeExports.jsx(S.motion.text,{dy:e.y2>e.y1?-8:"1em",style:{textAnchor:"middle",...f?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-2 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y2),fill:c[1]},whileInView:{opacity:1,x:a(e.date),y:l(e.y2),fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y2,"NA",b,v,E)}):null]})]},P),t[157]=i.duration,t[158]=d?.graphObjectValues,t[159]=n.length,t[160]=m,t[161]=p,t[162]=u,t[163]=c[0],t[164]=c[1],t[165]=b,t[166]=v,t[167]=q,t[168]=w,t[169]=f?.graphObjectValues,t[170]=E,t[171]=a,t[172]=l,t[173]=o):o=t[173],Ie=n.map(o),t[140]=i.duration,t[141]=d?.graphObjectValues,t[142]=n,t[143]=m,t[144]=p,t[145]=u,t[146]=c[0],t[147]=c[1],t[148]=b,t[149]=v,t[150]=q,t[151]=w,t[152]=f?.graphObjectValues,t[153]=E,t[154]=a,t[155]=l,t[156]=Ie}else Ie=t[156];let Ne;t[174]!==i||t[175]!==m||t[176]!==u||t[177]!==V||t[178]!==y.right||t[179]!==jt||t[180]!==l?(Ne=jt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:jt.map((o,e)=>s.jsxRuntimeExports.jsx(hi.RefLineY,{text:o.text,color:o.color,y:l(o.value),x1:0-V,x2:m+y.right,classNames:o.classNames,styles:o.styles,animate:i,isInView:u},e))}):null,t[174]=i,t[175]=m,t[176]=u,t[177]=V,t[178]=y.right,t[179]=jt,t[180]=l,t[181]=Ne):Ne=t[181];let ie;if(t[182]!==i||t[183]!==Pt||t[184]!==x||t[185]!==m||t[186]!==u||t[187]!==y.right||t[188]!==W||t[189]!==a||t[190]!==l){let o;t[192]!==i||t[193]!==x||t[194]!==m||t[195]!==u||t[196]!==y.right||t[197]!==W||t[198]!==a||t[199]!==l?(o=(e,P)=>{const Dt=ii.getLineEndPoint({x:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date)):0,y:e.yCoordinate?l(e.yCoordinate):0},It.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),ci=e.showConnector?{y1:Dt.y,x1:Dt.x,y2:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?l(e.yCoordinate):0,cx:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date)):0,circleRadius:It.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,ui={y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:W?0:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:W?e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0):m+y.right-(e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return s.jsxRuntimeExports.jsx(ii.Annotation,{color:e.color,connectorsSettings:ci,labelSettings:ui,text:e.text,classNames:e.classNames,styles:e.styles,animate:i,isInView:u},P)},t[192]=i,t[193]=x,t[194]=m,t[195]=u,t[196]=y.right,t[197]=W,t[198]=a,t[199]=l,t[200]=o):o=t[200],ie=Pt.map(o),t[182]=i,t[183]=Pt,t[184]=x,t[185]=m,t[186]=u,t[187]=y.right,t[188]=W,t[189]=a,t[190]=l,t[191]=ie}else ie=t[191];let Te;t[201]!==ie?(Te=s.jsxRuntimeExports.jsx("g",{children:ie}),t[201]=ie,t[202]=Te):Te=t[202];let qe;t[203]!==$?(qe=$.filter(Ii).map(Di),t[203]=$,t[204]=qe):qe=t[204];let $e;t[205]===Symbol.for("react.memo_cache_sentinel")?($e={fill:"none",pointerEvents:"all"},t[205]=$e):$e=t[205];let Me;t[206]!==lt||t[207]!==j||t[208]!==m?(Me=s.jsxRuntimeExports.jsx("rect",{ref:lt,style:$e,width:m,height:j}),t[206]=lt,t[207]=j,t[208]=m,t[209]=Me):Me=t[209];let Fe;return t[210]!==d?.tooltip||t[211]!==h||t[212]!==B||t[213]!==L||t[214]!==f?.tooltip||t[215]!==H?(Fe=L&&H&&h&&B?s.jsxRuntimeExports.jsx(mi.Tooltip,{data:L,body:H,xPos:h,yPos:B,backgroundStyle:f?.tooltip,className:d?.tooltip}):null,t[210]=d?.tooltip,t[211]=h,t[212]=B,t[213]=L,t[214]=f?.tooltip,t[215]=H,t[216]=Fe):Fe=t[216],s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(S.motion.svg,{width:`${ot}px`,height:`${Nt}px`,viewBox:`0 0 ${ot} ${Nt}`,direction:"ltr",ref:bt,children:s.jsxRuntimeExports.jsxs("g",{transform:`translate(${y.left},${y.top})`,children:[s.jsxRuntimeExports.jsx("clipPath",{id:`above${st}`,children:s.jsxRuntimeExports.jsx("path",{d:le(n),style:dt})}),s.jsxRuntimeExports.jsx("clipPath",{id:`below${st}`,children:s.jsxRuntimeExports.jsx("path",{d:re(n),style:tt})}),pt,s.jsxRuntimeExports.jsx(ii.CustomArea,{areaSettings:se,scaleX:a,scaleY:l,animate:i,isInView:u}),s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(yi.YTicksAndGridLines,{values:zt.filter($i),y:zt.filter(qi).map(o=>l(o)),x1:0-V,x2:m+y.right,styles:it,classNames:Lt,suffix:E,prefix:v,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:b}),me,de]})}),s.jsxRuntimeExports.jsx(fi.XTicksAndGridLines,{values:ai,x:ri,y1:0,y2:j,styles:fe,classNames:he,suffix:E,prefix:v,labelType:"primary",showGridLines:!0,precision:b}),ye,s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.path,{clipPath:`url(#below${st})`,d:At(n)||"",style:ge,exit:je,variants:we,initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(S.motion.path,{clipPath:`url(#above${st})`,d:At(n)||"",style:Re,exit:be,variants:Oe,initial:"initial",animate:u?"whileInView":"initial"})]}),s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.path,{d:mt(n)||"",style:Ce,exit:Ae,variants:{initial:{pathLength:0,d:mt(n)||"",opacity:1},whileInView:{pathLength:1,d:mt(n)||"",opacity:1,transition:{duration:i.duration}}},initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(S.motion.path,{style:Ve,exit:Le,variants:{initial:{pathLength:0,d:Bt(n)||"",opacity:1},whileInView:Se},initial:"initial",animate:u?"whileInView":"initial"}),ke,De,Ie]}),Ne,Te,qe,Me]})}),Fe]})}function Di(r){return r.layer}function Ii(r){return r.position==="after"}function Ni(r){return r.layer}function Ti(r){return r.position==="before"}function qi(r){return r!==0}function $i(r){return r!==0}function Mi(r){return r.date}function Fi(r){return r.y2}function Gi(r){return r.y2}function Pi(r){return r.y1}function Hi(r){return r.y1}function Wi(r){return r.y2}function Yi(r){return r.y2}function Xi(r){return r.y2}function Ui(r){return r.y1}function Bi(r){return r.y1}function zi(r){return r.y1}function Ji(r){const t=s.compilerRuntimeExports.c(90),{data:k,graphTitle:ot,suffix:Nt,sources:c,prefix:E,graphDescription:v,height:x,width:w,footNote:Tt,noOfXTicks:qt,dateFormat:V,showValues:$t,padding:gt,lineColors:H,backgroundColor:Mt,leftMargin:Ft,rightMargin:i,topMargin:W,bottomMargin:Gt,tooltip:N,highlightAreaSettings:D,relativeHeight:st,onSeriesMouseOver:T,graphID:q,graphDownload:jt,dataDownload:I,animate:vt,language:Pt,minHeight:Ht,labels:Y,showColorLegendAtTop:xe,colorLegendTitle:Wt,diffAreaColors:wt,strokeWidth:Rt,showDots:f,refValues:d,minValue:b,maxValue:$,annotations:bt,customHighlightAreaSettings:X,theme:u,ariaLabel:p,yAxisTitle:ne,noOfYTicks:Et,minDate:at,maxDate:U,curveType:L,styles:g,classNames:h,precision:oe,customLayers:B}=r,Yt=Nt===void 0?"":Nt,Ot=E===void 0?"":E,rt=qt===void 0?10:qt,y=V===void 0?"yyyy":V,lt=$t===void 0?!1:$t;let z;t[0]!==H?(z=H===void 0?[Pe.Colors.light.categoricalColors.colors[0],Pe.Colors.light.categoricalColors.colors[1]]:H,t[0]=H,t[1]=z):z=t[1];const n=z,ct=Mt===void 0?!1:Mt,Ct=Ft===void 0?30:Ft,ut=i===void 0?50:i,se=W===void 0?20:W,m=Gt===void 0?25:Gt;let j;t[2]!==D?(j=D===void 0?[]:D,t[2]=D,t[3]=j):j=t[3];const ae=j,Xt=jt===void 0?!1:jt,J=I===void 0?!1:I,K=vt===void 0?!1:vt,M=Pt===void 0?"en":Pt,Ut=Ht===void 0?0:Ht,Q=xe===void 0?!1:xe;let R;t[4]!==wt?(R=wt===void 0?[Pe.Colors.alerts.red,Pe.Colors.alerts.darkGreen]:wt,t[4]=wt,t[5]=R):R=t[5];const Z=R,a=Rt===void 0?2:Rt,xt=f===void 0?!0:f;let _;t[6]!==d?(_=d===void 0?[]:d,t[6]=d,t[7]=_):_=t[7];const l=_;let mt;t[8]!==bt?(mt=bt===void 0?[]:bt,t[8]=bt,t[9]=mt):mt=t[9];const Bt=mt;let At;t[10]!==X?(At=X===void 0?[]:X,t[10]=X,t[11]=At):At=t[11];const re=At,le=u===void 0?"light":u,zt=Et===void 0?5:Et,Jt=L===void 0?"curve":L,dt=oe===void 0?2:oe;let tt;t[12]!==B?(tt=B===void 0?[]:B,t[12]=B,t[13]=tt):tt=t[13];const pt=tt,[et,ce]=A.useState(0),[it,ue]=A.useState(0),Vt=A.useRef(null),Lt=A.useRef(null);let ft,ht;t[14]===Symbol.for("react.memo_cache_sentinel")?(ft=()=>{const Kt=new ResizeObserver(nt=>{ce(nt[0].target.clientWidth||620),ue(nt[0].target.clientHeight||480)});return Vt.current&&Kt.observe(Vt.current),()=>Kt.disconnect()},ht=[],t[14]=ft,t[15]=ht):(ft=t[14],ht=t[15]),A.useEffect(ft,ht);const St=h?.graphContainer,kt=g?.graphContainer;let F;t[16]!==h?.description||t[17]!==h?.title||t[18]!==k||t[19]!==J||t[20]!==v||t[21]!==Xt||t[22]!==ot||t[23]!==g?.description||t[24]!==g?.title||t[25]!==w?(F=ot||v||Xt||J?s.jsxRuntimeExports.jsx(Ci.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:h?.title,description:h?.description},graphTitle:ot,graphDescription:v,width:w,graphDownload:Xt?Lt:void 0,dataDownload:J?k.map(tn).filter(_i).length>0?k.map(Zi).filter(Qi):k.filter(Ki):null}):null,t[16]=h?.description,t[17]=h?.title,t[18]=k,t[19]=J,t[20]=v,t[21]=Xt,t[22]=ot,t[23]=g?.description,t[24]=g?.title,t[25]=w,t[26]=F):F=t[26];let C;t[27]!==K||t[28]!==Bt||t[29]!==m||t[30]!==h||t[31]!==Wt||t[32]!==Jt||t[33]!==re||t[34]!==pt||t[35]!==k||t[36]!==y||t[37]!==Z||t[38]!==ae||t[39]!==Y||t[40]!==M||t[41]!==Ct||t[42]!==n||t[43]!==U||t[44]!==$||t[45]!==at||t[46]!==b||t[47]!==rt||t[48]!==zt||t[49]!==T||t[50]!==dt||t[51]!==Ot||t[52]!==l||t[53]!==ut||t[54]!==Q||t[55]!==xt||t[56]!==lt||t[57]!==a||t[58]!==g||t[59]!==Yt||t[60]!==it||t[61]!==et||t[62]!==N||t[63]!==se||t[64]!==ne?(C=k.length===0?s.jsxRuntimeExports.jsx(Li.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Q?s.jsxRuntimeExports.jsx(Ai.ColorLegend,{colorDomain:Y,colorLegendTitle:Wt,colors:n,showNAColor:!1,className:h?.colorLegend}):null,s.jsxRuntimeExports.jsx(si.GraphArea,{ref:Vt,children:et&&it?s.jsxRuntimeExports.jsx(ki,{data:k,lineColors:n,colorDomain:Y,width:et,height:it,suffix:Yt,prefix:Ot,dateFormat:y,showValues:lt,noOfXTicks:rt??Si.getNoOfTicks(et),leftMargin:Ct,rightMargin:ut,topMargin:se,bottomMargin:m,highlightAreaSettings:ae,tooltip:N,onSeriesMouseOver:T,showColorLegendAtTop:Q,animate:K===!0?{duration:.5,once:!0,amount:.5}:K||{duration:0,once:!0,amount:0},rtl:M==="he"||M==="ar",diffAreaColors:Z,idSuffix:Vi.generateRandomString(8),strokeWidth:a,showDots:xt,refValues:l,minValue:b,maxValue:$,annotations:Bt,customHighlightAreaSettings:re,yAxisTitle:ne,noOfYTicks:zt,minDate:at,maxDate:U,curveType:Jt,styles:g,classNames:h,precision:dt,customLayers:pt}):null})]}),t[27]=K,t[28]=Bt,t[29]=m,t[30]=h,t[31]=Wt,t[32]=Jt,t[33]=re,t[34]=pt,t[35]=k,t[36]=y,t[37]=Z,t[38]=ae,t[39]=Y,t[40]=M,t[41]=Ct,t[42]=n,t[43]=U,t[44]=$,t[45]=at,t[46]=b,t[47]=rt,t[48]=zt,t[49]=T,t[50]=dt,t[51]=Ot,t[52]=l,t[53]=ut,t[54]=Q,t[55]=xt,t[56]=lt,t[57]=a,t[58]=g,t[59]=Yt,t[60]=it,t[61]=et,t[62]=N,t[63]=se,t[64]=ne,t[65]=C):C=t[65];let G;t[66]!==h?.footnote||t[67]!==h?.source||t[68]!==Tt||t[69]!==c||t[70]!==g?.footnote||t[71]!==g?.source||t[72]!==w?(G=c||Tt?s.jsxRuntimeExports.jsx(Oi.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:c,footNote:Tt,width:w}):null,t[66]=h?.footnote,t[67]=h?.source,t[68]=Tt,t[69]=c,t[70]=g?.footnote,t[71]=g?.source,t[72]=w,t[73]=G):G=t[73];let yt;return t[74]!==p||t[75]!==ct||t[76]!==q||t[77]!==x||t[78]!==M||t[79]!==Ut||t[80]!==gt||t[81]!==st||t[82]!==St||t[83]!==kt||t[84]!==F||t[85]!==C||t[86]!==G||t[87]!==le||t[88]!==w?(yt=s.jsxRuntimeExports.jsxs(si.GraphContainer,{className:St,style:kt,id:q,ref:Lt,"aria-label":p,backgroundColor:ct,theme:le,language:M,minHeight:Ut,width:w,height:x,relativeHeight:st,padding:gt,children:[F,C,G]}),t[74]=p,t[75]=ct,t[76]=q,t[77]=x,t[78]=M,t[79]=Ut,t[80]=gt,t[81]=st,t[82]=St,t[83]=kt,t[84]=F,t[85]=C,t[86]=G,t[87]=le,t[88]=w,t[89]=yt):yt=t[89],yt}function Ki(r){return r!==void 0}function Qi(r){return r!==void 0}function Zi(r){return r.data}function _i(r){return r!==void 0}function tn(r){return r.data}exports.DifferenceLineChart=Ji;
2
2
  //# sourceMappingURL=DifferenceLineChart.cjs.map
@@ -14,9 +14,9 @@ import { Y as ji } from "./YTicksAndGridLines-Blepl7XF.js";
14
14
  import { H as Ai } from "./index-SKgJALZg.js";
15
15
  import { t as Oi } from "./time-BUL-dwnK.js";
16
16
  import { a as Ci } from "./linear-BqltdMeF.js";
17
- import { l as ai, c as Vi } from "./line-CPfhohvF.js";
17
+ import { l as ai, c as Vi } from "./line-DFlZsxI1.js";
18
18
  import { c as Di, s as Li, a as Si, m as ki } from "./step-BrDul-H4.js";
19
- import { a as oi } from "./area-BE2wo7fv.js";
19
+ import { a as oi } from "./area-B6r7cv2o.js";
20
20
  import { s as $i } from "./select-DKy99ogv.js";
21
21
  import { a as Ti } from "./init-BhZylTFx.js";
22
22
  import { p as Ii } from "./pointer-CWRWOsrb.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-CHPV5EwG-CTPQjnHt.cjs"),K=require("react"),ne=require("./Typography-DX7PlgQU.cjs"),me=require("./index-Cno4Q0YE.cjs"),xe=require("./Source-DYMJRrsq.cjs"),fe=require("./index-DQA8q5sC.cjs"),ge=require("./Tooltip-uUdw6wJL.cjs"),_=require("./Colors.cjs"),pe=require("./numberFormattingFunction-02t-wJta.cjs"),he=require("./DetailsModal-BN0HDFlV.cjs"),T=require("./array-DKbXV8lR.cjs"),ye=require("./GraphFooter.cjs"),ve=require("./GraphHeader.cjs"),je=require("./EmptyState-sAEZ_5rU.cjs"),ue=require("./GraphContainer-d8A46BK2.cjs"),ce=Math.abs,F=Math.atan2,U=Math.cos,Re=Math.max,ae=Math.min,V=Math.sin,Z=Math.sqrt,H=1e-12,ee=Math.PI,re=ee/2,se=2*ee;function be(r){return r>1?0:r<-1?ee:Math.acos(r)}function de(r){return r>=1?re:r<=-1?-re:Math.asin(r)}function Ee(r){return r.innerRadius}function Ae(r){return r.outerRadius}function Ce(r){return r.startAngle}function Me(r){return r.endAngle}function De(r){return r&&r.padAngle}function Ne(r,e,c,R,l,b,d,t){var p=c-r,a=R-e,n=d-l,E=t-b,s=E*p-n*a;if(!(s*s<H))return s=(n*(e-b)-E*(r-l))/s,[r+s*p,e+s*a]}function te(r,e,c,R,l,b,d){var t=r-c,p=e-R,a=(d?b:-b)/Z(t*t+p*p),n=a*p,E=-a*t,s=r+n,i=e+E,y=c+n,g=R+E,q=(s+y)/2,m=(i+g)/2,v=y-s,C=g-i,x=v*v+C*C,j=l-b,A=s*g-y*i,G=(C<0?-1:1)*Z(Re(0,j*j*x-A*A)),P=(A*C-v*G)/x,z=(-A*v-C*G)/x,D=(A*C+v*G)/x,N=(-A*v+C*G)/x,S=P-q,o=z-m,u=D-q,I=N-m;return S*S+o*o>u*u+I*I&&(P=D,z=N),{cx:P,cy:z,x01:-n,y01:-E,x11:P*(l/j-1),y11:z*(l/j-1)}}function Se(){var r=Ee,e=Ae,c=T.constant(0),R=null,l=Ce,b=Me,d=De,t=null,p=T.withPath(a);function a(){var n,E,s=+r.apply(this,arguments),i=+e.apply(this,arguments),y=l.apply(this,arguments)-re,g=b.apply(this,arguments)-re,q=ce(g-y),m=g>y;if(t||(t=n=p()),i<s&&(E=i,i=s,s=E),!(i>H))t.moveTo(0,0);else if(q>se-H)t.moveTo(i*U(y),i*V(y)),t.arc(0,0,i,y,g,!m),s>H&&(t.moveTo(s*U(g),s*V(g)),t.arc(0,0,s,g,y,m));else{var v=y,C=g,x=y,j=g,A=q,G=q,P=d.apply(this,arguments)/2,z=P>H&&(R?+R.apply(this,arguments):Z(s*s+i*i)),D=ae(ce(i-s)/2,+c.apply(this,arguments)),N=D,S=D,o,u;if(z>H){var I=de(z/s*V(P)),W=de(z/i*V(P));(A-=I*2)>H?(I*=m?1:-1,x+=I,j-=I):(A=0,x=j=(y+g)/2),(G-=W*2)>H?(W*=m?1:-1,v+=W,C-=W):(G=0,v=C=(y+g)/2)}var X=i*U(v),w=i*V(v),k=s*U(j),$=s*V(j);if(D>H){var B=i*U(C),Y=i*V(C),L=s*U(x),M=s*V(x),O;if(q<ee)if(O=Ne(X,w,L,M,B,Y,k,$)){var f=X-O[0],J=w-O[1],Q=B-O[0],oe=Y-O[1],ie=1/V(be((f*Q+J*oe)/(Z(f*f+J*J)*Z(Q*Q+oe*oe)))/2),le=Z(O[0]*O[0]+O[1]*O[1]);N=ae(D,(s-le)/(ie-1)),S=ae(D,(i-le)/(ie+1))}else N=S=0}G>H?S>H?(o=te(L,M,X,w,i,S,m),u=te(B,Y,k,$,i,S,m),t.moveTo(o.cx+o.x01,o.cy+o.y01),S<D?t.arc(o.cx,o.cy,S,F(o.y01,o.x01),F(u.y01,u.x01),!m):(t.arc(o.cx,o.cy,S,F(o.y01,o.x01),F(o.y11,o.x11),!m),t.arc(0,0,i,F(o.cy+o.y11,o.cx+o.x11),F(u.cy+u.y11,u.cx+u.x11),!m),t.arc(u.cx,u.cy,S,F(u.y11,u.x11),F(u.y01,u.x01),!m))):(t.moveTo(X,w),t.arc(0,0,i,v,C,!m)):t.moveTo(X,w),!(s>H)||!(A>H)?t.lineTo(k,$):N>H?(o=te(k,$,B,Y,s,-N,m),u=te(X,w,L,M,s,-N,m),t.lineTo(o.cx+o.x01,o.cy+o.y01),N<D?t.arc(o.cx,o.cy,N,F(o.y01,o.x01),F(u.y01,u.x01),!m):(t.arc(o.cx,o.cy,N,F(o.y01,o.x01),F(o.y11,o.x11),!m),t.arc(0,0,s,F(o.cy+o.y11,o.cx+o.x11),F(u.cy+u.y11,u.cx+u.x11),m),t.arc(u.cx,u.cy,N,F(u.y11,u.x11),F(u.y01,u.x01),!m))):t.arc(0,0,s,j,x,m)}if(t.closePath(),n)return t=null,n+""||null}return a.centroid=function(){var n=(+r.apply(this,arguments)+ +e.apply(this,arguments))/2,E=(+l.apply(this,arguments)+ +b.apply(this,arguments))/2-ee/2;return[U(E)*n,V(E)*n]},a.innerRadius=function(n){return arguments.length?(r=typeof n=="function"?n:T.constant(+n),a):r},a.outerRadius=function(n){return arguments.length?(e=typeof n=="function"?n:T.constant(+n),a):e},a.cornerRadius=function(n){return arguments.length?(c=typeof n=="function"?n:T.constant(+n),a):c},a.padRadius=function(n){return arguments.length?(R=n==null?null:typeof n=="function"?n:T.constant(+n),a):R},a.startAngle=function(n){return arguments.length?(l=typeof n=="function"?n:T.constant(+n),a):l},a.endAngle=function(n){return arguments.length?(b=typeof n=="function"?n:T.constant(+n),a):b},a.padAngle=function(n){return arguments.length?(d=typeof n=="function"?n:T.constant(+n),a):d},a.context=function(n){return arguments.length?(t=n??null,a):t},a}function ke(r,e){return e<r?-1:e>r?1:e>=r?0:NaN}function qe(r){return r}function we(){var r=qe,e=ke,c=null,R=T.constant(0),l=T.constant(se),b=T.constant(0);function d(t){var p,a=(t=T.array(t)).length,n,E,s=0,i=new Array(a),y=new Array(a),g=+R.apply(this,arguments),q=Math.min(se,Math.max(-se,l.apply(this,arguments)-g)),m,v=Math.min(Math.abs(q)/a,b.apply(this,arguments)),C=v*(q<0?-1:1),x;for(p=0;p<a;++p)(x=y[i[p]=p]=+r(t[p],p,t))>0&&(s+=x);for(e!=null?i.sort(function(j,A){return e(y[j],y[A])}):c!=null&&i.sort(function(j,A){return c(t[j],t[A])}),p=0,E=s?(q-a*C)/s:0;p<a;++p,g=m)n=i[p],x=y[n],m=g+(x>0?x*E:0)+C,y[n]={data:t[n],index:p,value:x,startAngle:g,endAngle:m,padAngle:v};return y}return d.value=function(t){return arguments.length?(r=typeof t=="function"?t:T.constant(+t),d):r},d.sortValues=function(t){return arguments.length?(e=t,c=null,d):e},d.sort=function(t){return arguments.length?(c=t,e=null,d):c},d.startAngle=function(t){return arguments.length?(R=typeof t=="function"?t:T.constant(+t),d):R},d.endAngle=function(t){return arguments.length?(l=typeof t=="function"?t:T.constant(+t),d):l},d.padAngle=function(t){return arguments.length?(b=typeof t=="function"?t:T.constant(+t),d):b},d}function Oe(r){const e=h.compilerRuntimeExports.c(44),{mainText:c,data:R,radius:l,colors:b,subNote:d,strokeWidth:t,tooltip:p,onSeriesMouseOver:a,onSeriesMouseClick:n,colorDomain:E,resetSelectionOnDoubleClick:s,detailsOnClick:i,styles:y,classNames:g,precision:q}=r,m=we().sort(null).startAngle(0).value(Te),[v,C]=K.useState(void 0),[x,j]=K.useState(void 0),[A,G]=K.useState(void 0),[P,z]=K.useState(void 0),D=`${l*2}px`,N=`${l*2}px`,S=`0 0 ${l*2} ${l*2}`,o="ltr",u="mx-auto",I=`translate(${l} ${l})`;let W;e[0]!==R||e[1]!==c||e[2]!==q||e[3]!==l||e[4]!==t||e[5]!==d?(W=c||d?h.jsxRuntimeExports.jsx("foreignObject",{y:0-(l-t),x:0-(l-t),width:2*(l-t),height:2*(l-t),children:h.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4",children:[c?h.jsxRuntimeExports.jsx(ne.v,{marginBottom:"none",className:"donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center",children:typeof c=="string"?c:R.findIndex(M=>M.label===c.label)!==-1?pe.numberFormattingFunction(R[R.findIndex(M=>M.label===c.label)].size,"NA",q,c.prefix,c.suffix):"NA"}):null,d?h.jsxRuntimeExports.jsx(ne.j,{marginBottom:"none",size:"base",leading:"none",className:"donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:d}):typeof c=="string"||!c?null:h.jsxRuntimeExports.jsx(ne.j,{size:"base",marginBottom:"none",leading:"none",className:"donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:c.label})]})}):null,e[0]=R,e[1]=c,e[2]=q,e[3]=l,e[4]=t,e[5]=d,e[6]=W):W=e[6];let X;e[7]!==E||e[8]!==b||e[9]!==i||e[10]!==x||e[11]!==v||e[12]!==n||e[13]!==a||e[14]!==l||e[15]!==s||e[16]!==j||e[17]!==t?(X=(M,O)=>h.jsxRuntimeExports.jsx("path",{d:Se()({innerRadius:l-t,outerRadius:l,startAngle:M.startAngle,endAngle:M.endAngle}),style:{fill:E.indexOf(M.data.label)!==-1?b[E.indexOf(M.data.label)%b.length]:_.Colors.gray,opacity:v?v.label===M.data.label?1:.3:1},onMouseEnter:f=>{C(M.data),z(f.clientY),G(f.clientX),a?.(M)},onClick:()=>{(n||i)&&(fe.isEqual(x,M.data)&&s?(j(void 0),n?.(void 0)):(j(M.data),n&&n(M.data)))},onMouseMove:f=>{C(M.data),z(f.clientY),G(f.clientX)},onMouseLeave:()=>{C(void 0),G(void 0),z(void 0),a?.(void 0)}},O),e[7]=E,e[8]=b,e[9]=i,e[10]=x,e[11]=v,e[12]=n,e[13]=a,e[14]=l,e[15]=s,e[16]=j,e[17]=t,e[18]=X):X=e[18];const w=m(R).map(X);let k;e[19]!==I||e[20]!==W||e[21]!==w?(k=h.jsxRuntimeExports.jsxs("g",{transform:I,children:[W,w]}),e[19]=I,e[20]=W,e[21]=w,e[22]=k):k=e[22];let $;e[23]!==D||e[24]!==N||e[25]!==S||e[26]!==k?($=h.jsxRuntimeExports.jsx("svg",{width:D,height:N,viewBox:S,direction:o,className:u,children:k}),e[23]=D,e[24]=N,e[25]=S,e[26]=k,e[27]=$):$=e[27];let B;e[28]!==g?.tooltip||e[29]!==A||e[30]!==P||e[31]!==v||e[32]!==y?.tooltip||e[33]!==p?(B=v&&p&&A&&P?h.jsxRuntimeExports.jsx(ge.Tooltip,{data:v,body:p,xPos:A,yPos:P,backgroundStyle:y?.tooltip,className:g?.tooltip}):null,e[28]=g?.tooltip,e[29]=A,e[30]=P,e[31]=v,e[32]=y?.tooltip,e[33]=p,e[34]=B):B=e[34];let Y;e[35]!==g?.modal||e[36]!==i||e[37]!==x||e[38]!==j?(Y=i&&x!==void 0?h.jsxRuntimeExports.jsx(he.DetailsModal,{body:i,data:x,setData:j,className:g?.modal}):null,e[35]=g?.modal,e[36]=i,e[37]=x,e[38]=j,e[39]=Y):Y=e[39];let L;return e[40]!==$||e[41]!==B||e[42]!==Y?(L=h.jsxRuntimeExports.jsxs(h.jsxRuntimeExports.Fragment,{children:[$,B,Y]}),e[40]=$,e[41]=B,e[42]=Y,e[43]=L):L=e[43],L}function Te(r){return r.size}function ze(r){const{mainText:e,graphTitle:c,colors:R=_.Colors.light.categoricalColors.colors,suffix:l="",sources:b,prefix:d="",strokeWidth:t=50,graphDescription:p,subNote:a,footNote:n,radius:E,data:s,showColorScale:i=!0,padding:y,backgroundColor:g=!1,tooltip:q,onSeriesMouseOver:m,graphID:v,onSeriesMouseClick:C,graphDownload:x=!1,dataDownload:j=!1,colorDomain:A,sortData:G,language:P="en",theme:z="light",width:D,height:N,minHeight:S=0,relativeHeight:o,ariaLabel:u,resetSelectionOnDoubleClick:I=!0,colorScaleMaxWidth:W,detailsOnClick:X,styles:w,classNames:k,precision:$=2}=r,[B,Y]=K.useState(0),L=K.useRef(null),M=K.useRef(null);K.useEffect(()=>{const f=new ResizeObserver(J=>{Y((Math.min(J[0].target.clientWidth||620,J[0].target.clientHeight||480,E||1/0)||420)/2)});return L.current&&f.observe(L.current),()=>f.disconnect()},[E]);const O=G?me.orderBy(s,["size"],[G]):s;return h.jsxRuntimeExports.jsxs(ue.GraphContainer,{className:k?.graphContainer,style:w?.graphContainer,id:v,ref:M,"aria-label":u,backgroundColor:g,theme:z,language:P,minHeight:S,width:D,height:N,relativeHeight:o,padding:y,children:[c||p||x||j?h.jsxRuntimeExports.jsx(ve.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:k?.title,description:k?.description},graphTitle:c,graphDescription:p,width:D,graphDownload:x?M:void 0,dataDownload:j?s.map(f=>f.data).filter(f=>f!==void 0).length>0?s.map(f=>f.data).filter(f=>f!==void 0):s.filter(f=>f!==void 0):null}):null,s.length===0?h.jsxRuntimeExports.jsx(je.EmptyState,{}):h.jsxRuntimeExports.jsxs(h.jsxRuntimeExports.Fragment,{children:[i?h.jsxRuntimeExports.jsx("div",{className:h.mo("leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap",k?.colorLegend),style:{maxWidth:W},"aria-label":"Color legend",children:O.map((f,J)=>h.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center pb-3",children:[h.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:(A||O.map(Q=>Q.label)).indexOf(f.label)!==-1?(R||_.Colors[z].categoricalColors.colors)[(A||O.map(Q=>Q.label)).indexOf(f.label)%(R||_.Colors[z].categoricalColors.colors).length]:_.Colors.gray}}),h.jsxRuntimeExports.jsxs(ne.j,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[f.label,":"," ",h.jsxRuntimeExports.jsx("span",{className:"font-bold",style:{fontSize:"inherit"},children:pe.numberFormattingFunction(f.size,"NA",$,d,l)})]})]},J))}):null,h.jsxRuntimeExports.jsx(xe.n,{size:"lg"}),h.jsxRuntimeExports.jsx(ue.GraphArea,{ref:L,children:B?h.jsxRuntimeExports.jsx(Oe,{mainText:e,data:O,colors:R,radius:B,subNote:a,strokeWidth:t,tooltip:q,colorDomain:A||O.map(f=>f.label),onSeriesMouseOver:m,onSeriesMouseClick:C,resetSelectionOnDoubleClick:I,styles:w,detailsOnClick:X,precision:$}):null})]}),b||n?h.jsxRuntimeExports.jsx(ye.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:k?.footnote,source:k?.source},sources:b,footNote:n,width:D}):null]})}exports.DonutChart=ze;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-CTPQjnHt.cjs"),O=require("react"),ot=require("./Typography-DX7PlgQU.cjs"),xt=require("./index-Cno4Q0YE.cjs"),mt=require("./Source-DYMJRrsq.cjs"),pt=require("./index-DQA8q5sC.cjs"),dt=require("./Tooltip-uUdw6wJL.cjs"),W=require("./Colors.cjs"),ct=require("./numberFormattingFunction-02t-wJta.cjs"),gt=require("./DetailsModal-BN0HDFlV.cjs"),z=require("./array-DMyR1sql.cjs"),ht=require("./use-in-view-QcfiW0w3.cjs"),ft=require("./index-DG2bgAva.cjs"),rt=require("./proxy-BxvUI_9l.cjs"),yt=require("./GraphFooter.cjs"),jt=require("./GraphHeader.cjs"),vt=require("./EmptyState-sAEZ_5rU.cjs"),it=require("./GraphContainer-d8A46BK2.cjs"),bt=Math.PI,st=2*bt;function Et(l,t){return t<l?-1:t>l?1:t>=l?0:NaN}function Ct(l){return l}function Rt(){var l=Ct,t=Et,n=null,c=z.constant(0),r=z.constant(st),m=z.constant(0);function s(e){var a,f=(e=z.array(e)).length,p,R,d=0,g=new Array(f),v=new Array(f),y=+c.apply(this,arguments),A=Math.min(st,Math.max(-st,r.apply(this,arguments)-y)),x,I=Math.min(Math.abs(A)/f,m.apply(this,arguments)),F=I*(A<0?-1:1),h;for(a=0;a<f;++a)(h=v[g[a]=a]=+l(e[a],a,e))>0&&(d+=h);for(t!=null?g.sort(function(M,S){return t(v[M],v[S])}):n!=null&&g.sort(function(M,S){return n(e[M],e[S])}),a=0,R=d?(A-f*F)/d:0;a<f;++a,y=x)p=g[a],h=v[p],x=y+(h>0?h*R:0)+F,v[p]={data:e[p],index:a,value:h,startAngle:y,endAngle:x,padAngle:I};return v}return s.value=function(e){return arguments.length?(l=typeof e=="function"?e:z.constant(+e),s):l},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(c=typeof e=="function"?e:z.constant(+e),s):c},s.endAngle=function(e){return arguments.length?(r=typeof e=="function"?e:z.constant(+e),s):r},s.padAngle=function(e){return arguments.length?(m=typeof e=="function"?e:z.constant(+e),s):m},s}const at=(l,t,n,c)=>({x:l+n*Math.cos(c),y:t+n*Math.sin(c)});function lt(l,t,n,c,r){const m=at(l,t,n,c),s=at(l,t,n,r),e=r-c<=Math.PI?"0":"1";return["M",m.x,m.y,"A",n,n,0,e,1,s.x,s.y].join(" ")}function Mt(l){const t=o.compilerRuntimeExports.c(59),{mainText:n,data:c,radius:r,colors:m,subNote:s,strokeWidth:e,tooltip:a,onSeriesMouseOver:f,onSeriesMouseClick:p,colorDomain:R,resetSelectionOnDoubleClick:d,detailsOnClick:g,styles:v,classNames:y,precision:A,animate:x,trackColor:I}=l,F=O.useRef(null);let h;t[0]!==x.amount||t[1]!==x.once?(h={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=h):h=t[2];const M=ht.useInView(F,h),S=Rt().sort(null).startAngle(0).value(Dt),[j,X]=O.useState(void 0),[b,E]=O.useState(void 0),[G,Y]=O.useState(void 0),[T,J]=O.useState(void 0),K=rt.motion,Q=`${r*2}px`,U=`${r*2}px`,D=`0 0 ${r*2} ${r*2}`,P="ltr",et="mx-auto",$=rt.motion,Z=`translate(${r} ${r})`;let q;t[3]!==c||t[4]!==n||t[5]!==A||t[6]!==r||t[7]!==e||t[8]!==s?(q=n||s?o.jsxRuntimeExports.jsx("foreignObject",{y:0-(r-e),x:0-(r-e),width:2*(r-e),height:2*(r-e),children:o.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4",children:[n?o.jsxRuntimeExports.jsx(ot.v,{marginBottom:"none",className:"donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center",children:typeof n=="string"?n:c.findIndex(u=>u.label===n.label)!==-1?ct.numberFormattingFunction(c[c.findIndex(u=>u.label===n.label)].size,"NA",A,n.prefix,n.suffix):"NA"}):null,s?o.jsxRuntimeExports.jsx(ot.j,{marginBottom:"none",size:"base",leading:"none",className:"donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:s}):typeof n=="string"||!n?null:o.jsxRuntimeExports.jsx(ot.j,{size:"base",marginBottom:"none",leading:"none",className:"donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:n.label})]})}):null,t[3]=c,t[4]=n,t[5]=A,t[6]=r,t[7]=e,t[8]=s,t[9]=q):q=t[9];const _=r-e/2;let N;t[10]!==e||t[11]!==_||t[12]!==I?(N=o.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,r:_,fill:"none",stroke:I,strokeWidth:e}),t[10]=e,t[11]=_,t[12]=I,t[13]=N):N=t[13];const V=ft.AnimatePresence;let k;t[14]!==x.duration||t[15]!==R||t[16]!==m||t[17]!==g||t[18]!==M||t[19]!==b||t[20]!==j||t[21]!==p||t[22]!==f||t[23]!==r||t[24]!==d||t[25]!==E||t[26]!==e?(k=(u,ut)=>o.jsxRuntimeExports.jsx(rt.motion.path,{variants:{initial:{pathLength:0,d:lt(0,0,r-e/2,u.startAngle-Math.PI/2,u.endAngle-Math.PI/2),opacity:j?j.label===u.data.label?1:.3:1},whileInView:{pathLength:1,d:lt(0,0,r-e/2,u.startAngle-Math.PI/2,u.endAngle-Math.PI/2),opacity:j?j.label===u.data.label?1:.3:1,transition:{duration:x.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{stroke:R.indexOf(u.data.label)!==-1?m[R.indexOf(u.data.label)%m.length]:W.Colors.gray,strokeWidth:e,fill:"none"},onMouseEnter:tt=>{X(u.data),J(tt.clientY),Y(tt.clientX),f?.(u)},onClick:()=>{(p||g)&&(pt.isEqual(b,u.data)&&d?(E(void 0),p?.(void 0)):(E(u.data),p&&p(u.data)))},onMouseMove:tt=>{X(u.data),J(tt.clientY),Y(tt.clientX)},onMouseLeave:()=>{X(void 0),Y(void 0),J(void 0),f?.(void 0)}},ut),t[14]=x.duration,t[15]=R,t[16]=m,t[17]=g,t[18]=M,t[19]=b,t[20]=j,t[21]=p,t[22]=f,t[23]=r,t[24]=d,t[25]=E,t[26]=e,t[27]=k):k=t[27];const i=S(c).map(k);let C;t[28]!==V||t[29]!==i?(C=o.jsxRuntimeExports.jsx(V,{children:i}),t[28]=V,t[29]=i,t[30]=C):C=t[30];let w;t[31]!==N||t[32]!==C||t[33]!==$.g||t[34]!==Z||t[35]!==q?(w=o.jsxRuntimeExports.jsxs($.g,{transform:Z,children:[q,N,C]}),t[31]=N,t[32]=C,t[33]=$.g,t[34]=Z,t[35]=q,t[36]=w):w=t[36];let B;t[37]!==K.svg||t[38]!==w||t[39]!==Q||t[40]!==U||t[41]!==D?(B=o.jsxRuntimeExports.jsx(K.svg,{ref:F,width:Q,height:U,viewBox:D,direction:P,className:et,children:w}),t[37]=K.svg,t[38]=w,t[39]=Q,t[40]=U,t[41]=D,t[42]=B):B=t[42];let H;t[43]!==y?.tooltip||t[44]!==G||t[45]!==T||t[46]!==j||t[47]!==v?.tooltip||t[48]!==a?(H=j&&a&&G&&T?o.jsxRuntimeExports.jsx(dt.Tooltip,{data:j,body:a,xPos:G,yPos:T,backgroundStyle:v?.tooltip,className:y?.tooltip}):null,t[43]=y?.tooltip,t[44]=G,t[45]=T,t[46]=j,t[47]=v?.tooltip,t[48]=a,t[49]=H):H=t[49];let L;t[50]!==y?.modal||t[51]!==g||t[52]!==b||t[53]!==E?(L=g&&b!==void 0?o.jsxRuntimeExports.jsx(gt.DetailsModal,{body:g,data:b,setData:E,className:y?.modal}):null,t[50]=y?.modal,t[51]=g,t[52]=b,t[53]=E,t[54]=L):L=t[54];let nt;return t[55]!==B||t[56]!==H||t[57]!==L?(nt=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[B,H,L]}),t[55]=B,t[56]=H,t[57]=L,t[58]=nt):nt=t[58],nt}function Dt(l){return l.size}function Nt(l){const{mainText:t,graphTitle:n,colors:c=W.Colors.light.categoricalColors.colors,suffix:r="",sources:m,prefix:s="",strokeWidth:e=50,graphDescription:a,subNote:f,footNote:p,radius:R,data:d,showColorScale:g=!0,padding:v,backgroundColor:y=!1,tooltip:A,onSeriesMouseOver:x,graphID:I,onSeriesMouseClick:F,graphDownload:h=!1,dataDownload:M=!1,colorDomain:S,sortData:j,language:X="en",theme:b="light",width:E,height:G,minHeight:Y=0,relativeHeight:T,ariaLabel:J,resetSelectionOnDoubleClick:K=!0,colorScaleMaxWidth:Q,detailsOnClick:U,styles:D,classNames:P,precision:et=2,animate:$=!1,trackColor:Z=W.Colors.light.grays["gray-200"]}=l,[q,_]=O.useState(0),N=O.useRef(null),V=O.useRef(null);O.useEffect(()=>{const i=new ResizeObserver(C=>{_((Math.min(C[0].target.clientWidth||620,C[0].target.clientHeight||480,R||1/0)||420)/2)});return N.current&&i.observe(N.current),()=>i.disconnect()},[R]);const k=j?xt.orderBy(d,["size"],[j]):d;return o.jsxRuntimeExports.jsxs(it.GraphContainer,{className:P?.graphContainer,style:D?.graphContainer,id:I,ref:V,"aria-label":J,backgroundColor:y,theme:b,language:X,minHeight:Y,width:E,height:G,relativeHeight:T,padding:v,children:[n||a||h||M?o.jsxRuntimeExports.jsx(jt.GraphHeader,{styles:{title:D?.title,description:D?.description},classNames:{title:P?.title,description:P?.description},graphTitle:n,graphDescription:a,width:E,graphDownload:h?V:void 0,dataDownload:M?d.map(i=>i.data).filter(i=>i!==void 0).length>0?d.map(i=>i.data).filter(i=>i!==void 0):d.filter(i=>i!==void 0):null}):null,d.length===0?o.jsxRuntimeExports.jsx(vt.EmptyState,{}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[g?o.jsxRuntimeExports.jsx("div",{className:o.mo("leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap",P?.colorLegend),style:{maxWidth:Q},"aria-label":"Color legend",children:k.map((i,C)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center pb-3",children:[o.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:(S||k.map(w=>w.label)).indexOf(i.label)!==-1?(c||W.Colors[b].categoricalColors.colors)[(S||k.map(w=>w.label)).indexOf(i.label)%(c||W.Colors[b].categoricalColors.colors).length]:W.Colors.gray}}),o.jsxRuntimeExports.jsxs(ot.j,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[i.label,":"," ",o.jsxRuntimeExports.jsx("span",{className:"font-bold",style:{fontSize:"inherit"},children:ct.numberFormattingFunction(i.size,"NA",et,s,r)})]})]},C))}):null,o.jsxRuntimeExports.jsx(mt.n,{size:"lg"}),o.jsxRuntimeExports.jsx(it.GraphArea,{ref:N,children:q?o.jsxRuntimeExports.jsx(Mt,{mainText:t,data:k,colors:c,radius:q,subNote:f,strokeWidth:e,tooltip:A,colorDomain:S||k.map(i=>i.label),onSeriesMouseOver:x,onSeriesMouseClick:F,resetSelectionOnDoubleClick:K,styles:D,detailsOnClick:U,precision:et,animate:$===!0?{duration:.5,once:!0,amount:.5}:$||{duration:0,once:!0,amount:0},trackColor:Z}):null})]}),m||p?o.jsxRuntimeExports.jsx(yt.GraphFooter,{styles:{footnote:D?.footnote,source:D?.source},classNames:{footnote:P?.footnote,source:P?.source},sources:m,footNote:p,width:E}):null]})}exports.DonutChart=Nt;
2
2
  //# sourceMappingURL=DonutChart.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"DonutChart.cjs","sources":["../node_modules/d3-shape/src/math.js","../node_modules/d3-shape/src/arc.js","../node_modules/d3-shape/src/descending.js","../node_modules/d3-shape/src/identity.js","../node_modules/d3-shape/src/pie.js","../src/Components/Graphs/DonutChart/Graph.tsx","../src/Components/Graphs/DonutChart/index.tsx"],"sourcesContent":["export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\nimport {withPath} from \"./path.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null,\n path = withPath(arc);\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle. If this\n // intersection fails, it’s probably because the arc is too small, so\n // disable the corner radius entirely.\n if (da < pi) {\n if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),\n lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);\n rc0 = min(rc, (r0 - lc) / (kc - 1));\n rc1 = min(rc, (r1 - lc) / (kc + 1));\n } else {\n rc0 = rc1 = 0;\n }\n }\n }\n\n // Is the sector collapsed to a line?\n if (!(da1 > epsilon)) context.moveTo(x01, y01);\n\n // Does the sector’s outer ring have rounded corners?\n else if (rc1 > epsilon) {\n t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);\n t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);\n\n context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);\n context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the outer ring just a circular arc?\n else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);\n\n // Is there no inner ring, and it’s a circular sector?\n // Or perhaps it’s an annular sector collapsed due to padding?\n if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);\n\n // Does the sector’s inner ring (or point) have rounded corners?\n else if (rc0 > epsilon) {\n t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);\n t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);\n\n context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);\n\n // Have the corners merged?\n if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);\n\n // Otherwise, draw the two corners and the ring.\n else {\n context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);\n context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);\n context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);\n }\n }\n\n // Or is the inner ring just a circular arc?\n else context.arc(0, 0, r0, a10, a00, cw);\n }\n\n context.closePath();\n\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n arc.centroid = function() {\n var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,\n a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;\n return [cos(a) * r, sin(a) * r];\n };\n\n arc.innerRadius = function(_) {\n return arguments.length ? (innerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : innerRadius;\n };\n\n arc.outerRadius = function(_) {\n return arguments.length ? (outerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : outerRadius;\n };\n\n arc.cornerRadius = function(_) {\n return arguments.length ? (cornerRadius = typeof _ === \"function\" ? _ : constant(+_), arc) : cornerRadius;\n };\n\n arc.padRadius = function(_) {\n return arguments.length ? (padRadius = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), arc) : padRadius;\n };\n\n arc.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : startAngle;\n };\n\n arc.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : endAngle;\n };\n\n arc.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), arc) : padAngle;\n };\n\n arc.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), arc) : context;\n };\n\n return arc;\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport isEqual from 'fast-deep-equal';\r\nimport { pie, arc } from 'd3-shape';\r\nimport { useState } from 'react';\r\nimport { H2, P } from '@undp/design-system-react/Typography';\r\n\r\nimport { ClassNameObject, DonutChartDataType, StyleObject } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n radius: number;\r\n colors: string[];\r\n subNote?: string;\r\n strokeWidth: number;\r\n data: DonutChartDataType[];\r\n\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n\r\n onSeriesMouseOver?: (_d: any) => void;\r\n\r\n onSeriesMouseClick?: (_d: any) => void;\r\n colorDomain: string[];\r\n resetSelectionOnDoubleClick: boolean;\r\n\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n mainText,\r\n data,\r\n radius,\r\n colors,\r\n subNote,\r\n strokeWidth,\r\n tooltip,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n colorDomain,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision,\r\n } = props;\r\n const pieData = pie()\r\n .sort(null)\r\n .startAngle(0)\r\n\r\n .value((d: any) => d.size);\r\n\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n return (\r\n <>\r\n <svg\r\n width={`${radius * 2}px`}\r\n height={`${radius * 2}px`}\r\n viewBox={`0 0 ${radius * 2} ${radius * 2}`}\r\n direction='ltr'\r\n className='mx-auto'\r\n >\r\n <g transform={`translate(${radius} ${radius})`}>\r\n {mainText || subNote ? (\r\n <foreignObject\r\n y={0 - (radius - strokeWidth)}\r\n x={0 - (radius - strokeWidth)}\r\n width={2 * (radius - strokeWidth)}\r\n height={2 * (radius - strokeWidth)}\r\n >\r\n <div className='flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4'>\r\n {mainText ? (\r\n <H2\r\n marginBottom='none'\r\n className='donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center'\r\n >\r\n {typeof mainText === 'string'\r\n ? mainText\r\n : data.findIndex(d => d.label === mainText.label) !== -1\r\n ? numberFormattingFunction(\r\n data[data.findIndex(d => d.label === mainText.label)].size,\r\n 'NA',\r\n precision,\r\n mainText.prefix,\r\n mainText.suffix,\r\n )\r\n : 'NA'}\r\n </H2>\r\n ) : null}\r\n {subNote ? (\r\n <P\r\n marginBottom='none'\r\n size='base'\r\n leading='none'\r\n className='donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {subNote}\r\n </P>\r\n ) : typeof mainText === 'string' || !mainText ? null : (\r\n <P\r\n size='base'\r\n marginBottom='none'\r\n leading='none'\r\n className='donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {mainText.label}\r\n </P>\r\n )}\r\n </div>\r\n </foreignObject>\r\n ) : null}\r\n {pieData(data as any).map((d, i) => (\r\n <path\r\n key={i}\r\n d={\r\n arc()({\r\n innerRadius: radius - strokeWidth,\r\n outerRadius: radius,\r\n startAngle: d.startAngle,\r\n endAngle: d.endAngle,\r\n }) as string\r\n }\r\n style={{\r\n fill:\r\n colorDomain.indexOf((d.data as any).label) !== -1\r\n ? colors[colorDomain.indexOf((d.data as any).label) % colors.length]\r\n : Colors.gray,\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\r\n : 1,\r\n }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d.data);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d.data) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.data);\r\n if (onSeriesMouseClick) onSeriesMouseClick(d.data);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d.data);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n </svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useRef, useState } from 'react';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport orderBy from 'lodash.orderby';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n DonutChartDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DonutChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Array of colors for each segment */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Radius of the donut chart */\r\n radius?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Max width of the color scale as a css property */\r\n colorScaleMaxWidth?: string;\r\n /** Stroke width of the arcs and circle of the donut */\r\n strokeWidth?: number;\r\n /** Sorting order for data. This is overwritten by labelOrder prop */\r\n sortData?: 'asc' | 'desc';\r\n /** Large text at the center of the donut chart. If the type is an object then the text is the value in the data for the label mentioned in the object */\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n /** Small text at the center of the donut chart */\r\n subNote?: string;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function DonutChart(props: Props) {\r\n const {\r\n mainText,\r\n graphTitle,\r\n colors = Colors.light.categoricalColors.colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n strokeWidth = 50,\r\n graphDescription,\r\n subNote,\r\n footNote,\r\n radius,\r\n data,\r\n showColorScale = true,\r\n padding,\r\n backgroundColor = false,\r\n tooltip,\r\n onSeriesMouseOver,\r\n graphID,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n colorDomain,\r\n sortData,\r\n language = 'en',\r\n theme = 'light',\r\n width,\r\n height,\r\n minHeight = 0,\r\n relativeHeight,\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n colorScaleMaxWidth,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision = 2,\r\n } = props;\r\n\r\n const [graphRadius, setGraphRadius] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setGraphRadius(\r\n (Math.min(\r\n ...[\r\n entries[0].target.clientWidth || 620,\r\n entries[0].target.clientHeight || 480,\r\n radius || Infinity,\r\n ],\r\n ) || 420) / 2,\r\n );\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [radius]);\r\n\r\n const sortedData = sortData ? orderBy(data, ['size'], [sortData]) : data;\r\n\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? (\r\n <div\r\n className={cn(\r\n 'leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap',\r\n classNames?.colorLegend,\r\n )}\r\n style={{ maxWidth: colorScaleMaxWidth }}\r\n aria-label='Color legend'\r\n >\r\n {sortedData.map((d, i) => (\r\n <div className='flex gap-2 items-center pb-3' key={i}>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{\r\n backgroundColor:\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) !== -1\r\n ? (colors || Colors[theme].categoricalColors.colors)[\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) %\r\n (colors || Colors[theme].categoricalColors.colors).length\r\n ]\r\n : Colors.gray,\r\n }}\r\n />\r\n <P\r\n marginBottom='none'\r\n size='sm'\r\n className='text-primary-gray-700 dark:text-primary-gray-100'\r\n >\r\n {d.label}:{' '}\r\n <span className='font-bold' style={{ fontSize: 'inherit' }}>\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </span>\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n ) : null}\r\n <Spacer size='lg' />\r\n <GraphArea ref={graphDiv}>\r\n {graphRadius ? (\r\n <Graph\r\n mainText={mainText}\r\n data={sortedData}\r\n colors={colors}\r\n radius={graphRadius}\r\n subNote={subNote}\r\n strokeWidth={strokeWidth}\r\n tooltip={tooltip}\r\n colorDomain={colorDomain || sortedData.map(d => d.label)}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n detailsOnClick={detailsOnClick}\r\n precision={precision}\r\n />\r\n ) : null}\r\n </GraphArea>\r\n </>\r\n )}\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["abs","atan2","cos","max","min","sin","sqrt","epsilon","pi","halfPi","tau","acos","x","asin","arcInnerRadius","d","arcOuterRadius","arcStartAngle","arcEndAngle","arcPadAngle","intersect","x0","y0","x1","y1","x2","y2","x3","y3","x10","y10","x32","y32","t","cornerTangents","r1","rc","cw","x01","y01","lo","ox","oy","x11","y11","x00","y00","dx","dy","d2","r","D","cx0","cy0","cx1","cy1","dx0","dy0","dx1","dy1","arc","innerRadius","outerRadius","cornerRadius","constant","padRadius","startAngle","endAngle","padAngle","context","path","withPath","buffer","r0","a0","a1","da","a01","a11","a00","a10","da0","da1","ap","rp","rc0","rc1","t0","t1","p0","p1","oc","ax","ay","bx","by","kc","lc","a","_","descending","b","identity","pie","value","sortValues","sort","data","i","n","array","j","k","sum","index","arcs","p","pa","v","Graph","props","$","_c","mainText","radius","colors","subNote","strokeWidth","tooltip","onSeriesMouseOver","onSeriesMouseClick","colorDomain","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","precision","pieData","_temp","mouseOverData","setMouseOverData","useState","undefined","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","t2","t3","t4","t5","t6","jsx","jsxs","H2","findIndex","d_1","label","numberFormattingFunction","d_0","size","prefix","suffix","P","t7","d_2","fill","indexOf","length","Colors","gray","opacity","event","clientY","clientX","isEqual","event_0","t8","map","t9","t10","t11","Tooltip","t12","modal","DetailsModal","t13","Fragment","DonutChart","graphTitle","light","categoricalColors","sources","graphDescription","footNote","showColorScale","padding","backgroundColor","graphID","graphDownload","dataDownload","sortData","language","theme","width","height","minHeight","relativeHeight","ariaLabel","colorScaleMaxWidth","graphRadius","setGraphRadius","graphDiv","useRef","graphParentDiv","useEffect","resizeObserver","ResizeObserver","entries","Math","target","clientWidth","clientHeight","Infinity","current","observe","disconnect","sortedData","orderBy","GraphContainer","graphContainer","GraphHeader","title","description","filter","EmptyState","cn","colorLegend","maxWidth","el","fontSize","Spacer","GraphArea","GraphFooter","footnote","source"],"mappings":"2nBAAaA,GAAM,KAAK,IACXC,EAAQ,KAAK,MACbC,EAAM,KAAK,IACXC,GAAM,KAAK,IACXC,GAAM,KAAK,IACXC,EAAM,KAAK,IACXC,EAAO,KAAK,KAEZC,EAAU,MACVC,GAAK,KAAK,GACVC,GAASD,GAAK,EACdE,GAAM,EAAIF,GAEhB,SAASG,GAAKC,EAAG,CACtB,OAAOA,EAAI,EAAI,EAAIA,EAAI,GAAKJ,GAAK,KAAK,KAAKI,CAAC,CAC9C,CAEO,SAASC,GAAKD,EAAG,CACtB,OAAOA,GAAK,EAAIH,GAASG,GAAK,GAAK,CAACH,GAAS,KAAK,KAAKG,CAAC,CAC1D,CCfA,SAASE,GAAeC,EAAG,CACzB,OAAOA,EAAE,WACX,CAEA,SAASC,GAAeD,EAAG,CACzB,OAAOA,EAAE,WACX,CAEA,SAASE,GAAcF,EAAG,CACxB,OAAOA,EAAE,UACX,CAEA,SAASG,GAAYH,EAAG,CACtB,OAAOA,EAAE,QACX,CAEA,SAASI,GAAYJ,EAAG,CACtB,OAAOA,GAAKA,EAAE,QAChB,CAEA,SAASK,GAAUC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAAI,CACjD,IAAIC,EAAMN,EAAKF,EAAIS,EAAMN,EAAKF,EAC1BS,EAAMJ,EAAKF,EAAIO,EAAMJ,EAAKF,EAC1BO,EAAID,EAAMH,EAAME,EAAMD,EAC1B,GAAI,EAAAG,EAAIA,EAAI1B,GACZ,OAAA0B,GAAKF,GAAOT,EAAKI,GAAMM,GAAOX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EAAQC,CAAM,CAAA,CACnE,CAAA,CAAA,CACF,CAAA,CAAA,EAtBiDxD,CAuBnD,CACD,CAAA,CACH,EACE,KACJ8C,EAAAA,kBAAAA,IAACyF,GAAAA,EAAA,CAAO,KAAK,IAAA,CAAI,EACjBzF,EAAAA,kBAAAA,IAAC0F,GAAAA,UAAA,CAAU,IAAK9B,EACbF,SAAAA,EACC1D,EAAAA,kBAAAA,IAACnC,GAAA,CACC,SAAAI,EACA,KAAM0G,EACN,OAAAxG,EACA,OAAQuF,EACR,QAAAtF,EACA,YAAAC,EACA,QAAAC,EACA,YAAaG,GAAekG,EAAWjD,IAAIrK,GAAKA,EAAEgJ,KAAK,EACvD,kBAAA9B,EACA,mBAAAC,EACA,4BAAAE,EACA,OAAAE,EACA,eAAAD,EACA,UAAAG,CAAA,CAAqB,EAErB,IAAA,CACN,CAAA,EACF,EAED0D,GAAWE,EACV1C,EAAAA,kBAAAA,IAAC2F,GAAAA,YAAA,CACC,OAAQ,CAAEC,SAAUhH,GAAQgH,SAAUC,OAAQjH,GAAQiH,MAAAA,EACtD,WAAY,CACVD,SAAU/G,GAAY+G,SACtBC,OAAQhH,GAAYgH,MAAAA,EAEtB,QAAArD,EACA,SAAAE,EACA,MAAAU,CAAA,CAAa,EAEb,IAAA,EACN,CAEJ","x_google_ignoreList":[0,1,2,3,4]}
1
+ {"version":3,"file":"DonutChart.cjs","sources":["../node_modules/d3-shape/src/math.js","../node_modules/d3-shape/src/descending.js","../node_modules/d3-shape/src/identity.js","../node_modules/d3-shape/src/pie.js","../src/Utils/getArc.ts","../src/Components/Graphs/DonutChart/Graph.tsx","../src/Components/Graphs/DonutChart/index.tsx"],"sourcesContent":["export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","export default function(a, b) {\n return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;\n}\n","export default function(d) {\n return d;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport descending from \"./descending.js\";\nimport identity from \"./identity.js\";\nimport {tau} from \"./math.js\";\n\nexport default function() {\n var value = identity,\n sortValues = descending,\n sort = null,\n startAngle = constant(0),\n endAngle = constant(tau),\n padAngle = constant(0);\n\n function pie(data) {\n var i,\n n = (data = array(data)).length,\n j,\n k,\n sum = 0,\n index = new Array(n),\n arcs = new Array(n),\n a0 = +startAngle.apply(this, arguments),\n da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),\n a1,\n p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),\n pa = p * (da < 0 ? -1 : 1),\n v;\n\n for (i = 0; i < n; ++i) {\n if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {\n sum += v;\n }\n }\n\n // Optionally sort the arcs by previously-computed values or by data.\n if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });\n else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });\n\n // Compute the arcs! They are stored in the original data's order.\n for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {\n j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {\n data: data[j],\n index: i,\n value: v,\n startAngle: a0,\n endAngle: a1,\n padAngle: p\n };\n }\n\n return arcs;\n }\n\n pie.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), pie) : value;\n };\n\n pie.sortValues = function(_) {\n return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;\n };\n\n pie.sort = function(_) {\n return arguments.length ? (sort = _, sortValues = null, pie) : sort;\n };\n\n pie.startAngle = function(_) {\n return arguments.length ? (startAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : startAngle;\n };\n\n pie.endAngle = function(_) {\n return arguments.length ? (endAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : endAngle;\n };\n\n pie.padAngle = function(_) {\n return arguments.length ? (padAngle = typeof _ === \"function\" ? _ : constant(+_), pie) : padAngle;\n };\n\n return pie;\n}\n","const polarToCartesian = (\r\n centerX: number,\r\n centerY: number,\r\n radius: number,\r\n angleInRadians: number,\r\n) => {\r\n return {\r\n x: centerX + radius * Math.cos(angleInRadians),\r\n y: centerY + radius * Math.sin(angleInRadians),\r\n };\r\n};\r\n\r\nexport function getArc(\r\n x: number,\r\n y: number,\r\n radius: number,\r\n startAngleInRadians: number,\r\n endAngleInRadians: number,\r\n) {\r\n const start = polarToCartesian(x, y, radius, startAngleInRadians);\r\n const end = polarToCartesian(x, y, radius, endAngleInRadians);\r\n const largeArcFlag = endAngleInRadians - startAngleInRadians <= Math.PI ? '0' : '1';\r\n const d = ['M', start.x, start.y, 'A', radius, radius, 0, largeArcFlag, 1, end.x, end.y].join(\r\n ' ',\r\n );\r\n return d;\r\n}\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport isEqual from 'fast-deep-equal';\r\nimport { pie } from 'd3-shape';\r\nimport { useRef, useState } from 'react';\r\nimport { H2, P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport { AnimateDataType, ClassNameObject, DonutChartDataType, StyleObject } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { getArc } from '@/Utils/getArc';\r\n\r\ninterface Props {\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n radius: number;\r\n colors: string[];\r\n subNote?: string;\r\n strokeWidth: number;\r\n data: DonutChartDataType[];\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n onSeriesMouseOver?: (_d: any) => void;\r\n onSeriesMouseClick?: (_d: any) => void;\r\n colorDomain: string[];\r\n resetSelectionOnDoubleClick: boolean;\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n animate: AnimateDataType;\r\n trackColor: string;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n mainText,\r\n data,\r\n radius,\r\n colors,\r\n subNote,\r\n strokeWidth,\r\n tooltip,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n colorDomain,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision,\r\n animate,\r\n trackColor,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const pieData = pie()\r\n .sort(null)\r\n .startAngle(0)\r\n .value((d: any) => d.size);\r\n\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n return (\r\n <>\r\n <motion.svg\r\n ref={svgRef}\r\n width={`${radius * 2}px`}\r\n height={`${radius * 2}px`}\r\n viewBox={`0 0 ${radius * 2} ${radius * 2}`}\r\n direction='ltr'\r\n className='mx-auto'\r\n >\r\n <motion.g transform={`translate(${radius} ${radius})`}>\r\n {mainText || subNote ? (\r\n <foreignObject\r\n y={0 - (radius - strokeWidth)}\r\n x={0 - (radius - strokeWidth)}\r\n width={2 * (radius - strokeWidth)}\r\n height={2 * (radius - strokeWidth)}\r\n >\r\n <div className='flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4'>\r\n {mainText ? (\r\n <H2\r\n marginBottom='none'\r\n className='donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center'\r\n >\r\n {typeof mainText === 'string'\r\n ? mainText\r\n : data.findIndex(d => d.label === mainText.label) !== -1\r\n ? numberFormattingFunction(\r\n data[data.findIndex(d => d.label === mainText.label)].size,\r\n 'NA',\r\n precision,\r\n mainText.prefix,\r\n mainText.suffix,\r\n )\r\n : 'NA'}\r\n </H2>\r\n ) : null}\r\n {subNote ? (\r\n <P\r\n marginBottom='none'\r\n size='base'\r\n leading='none'\r\n className='donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {subNote}\r\n </P>\r\n ) : typeof mainText === 'string' || !mainText ? null : (\r\n <P\r\n size='base'\r\n marginBottom='none'\r\n leading='none'\r\n className='donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold'\r\n >\r\n {mainText.label}\r\n </P>\r\n )}\r\n </div>\r\n </foreignObject>\r\n ) : null}\r\n <circle\r\n cx={0}\r\n cy={0}\r\n r={radius - strokeWidth / 2}\r\n fill='none'\r\n stroke={trackColor}\r\n strokeWidth={strokeWidth}\r\n />\r\n <AnimatePresence>\r\n {pieData(data as any).map((d, i) => (\r\n <motion.path\r\n key={i}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d: getArc(\r\n 0,\r\n 0,\r\n radius - strokeWidth / 2,\r\n d.startAngle - Math.PI / 2,\r\n d.endAngle - Math.PI / 2,\r\n ),\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\r\n : 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d: getArc(\r\n 0,\r\n 0,\r\n radius - strokeWidth / 2,\r\n d.startAngle - Math.PI / 2,\r\n d.endAngle - Math.PI / 2,\r\n ),\r\n opacity: mouseOverData\r\n ? mouseOverData.label === (d.data as any).label\r\n ? 1\r\n : 0.3\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke:\r\n colorDomain.indexOf((d.data as any).label) !== -1\r\n ? colors[colorDomain.indexOf((d.data as any).label) % colors.length]\r\n : Colors.gray,\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d.data);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d.data) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.data);\r\n if (onSeriesMouseClick) onSeriesMouseClick(d.data);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d.data);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n />\r\n ))}\r\n </AnimatePresence>\r\n </motion.g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useRef, useState } from 'react';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport orderBy from 'lodash.orderby';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n DonutChartDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DonutChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Array of colors for each segment */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Radius of the donut chart */\r\n radius?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Max width of the color scale as a css property */\r\n colorScaleMaxWidth?: string;\r\n /** Stroke width of the arcs and circle of the donut */\r\n strokeWidth?: number;\r\n /** Sorting order for data. This is overwritten by labelOrder prop */\r\n sortData?: 'asc' | 'desc';\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Large text at the center of the donut chart. If the type is an object then the text is the value in the data for the label mentioned in the object */\r\n mainText?: string | { label: string; suffix?: string; prefix?: string };\r\n /** Small text at the center of the donut chart */\r\n subNote?: string;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Track color (i.e. the color of the donut chart's background) of the donut chart */\r\n trackColor?: string;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function DonutChart(props: Props) {\r\n const {\r\n mainText,\r\n graphTitle,\r\n colors = Colors.light.categoricalColors.colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n strokeWidth = 50,\r\n graphDescription,\r\n subNote,\r\n footNote,\r\n radius,\r\n data,\r\n showColorScale = true,\r\n padding,\r\n backgroundColor = false,\r\n tooltip,\r\n onSeriesMouseOver,\r\n graphID,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n colorDomain,\r\n sortData,\r\n language = 'en',\r\n theme = 'light',\r\n width,\r\n height,\r\n minHeight = 0,\r\n relativeHeight,\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n colorScaleMaxWidth,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n precision = 2,\r\n animate = false,\r\n trackColor = Colors.light.grays['gray-200'],\r\n } = props;\r\n\r\n const [graphRadius, setGraphRadius] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setGraphRadius(\r\n (Math.min(\r\n ...[\r\n entries[0].target.clientWidth || 620,\r\n entries[0].target.clientHeight || 480,\r\n radius || Infinity,\r\n ],\r\n ) || 420) / 2,\r\n );\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [radius]);\r\n\r\n const sortedData = sortData ? orderBy(data, ['size'], [sortData]) : data;\r\n\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? (\r\n <div\r\n className={cn(\r\n 'leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap',\r\n classNames?.colorLegend,\r\n )}\r\n style={{ maxWidth: colorScaleMaxWidth }}\r\n aria-label='Color legend'\r\n >\r\n {sortedData.map((d, i) => (\r\n <div className='flex gap-2 items-center pb-3' key={i}>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{\r\n backgroundColor:\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) !== -1\r\n ? (colors || Colors[theme].categoricalColors.colors)[\r\n (colorDomain || sortedData.map(el => el.label)).indexOf(d.label) %\r\n (colors || Colors[theme].categoricalColors.colors).length\r\n ]\r\n : Colors.gray,\r\n }}\r\n />\r\n <P\r\n marginBottom='none'\r\n size='sm'\r\n className='text-primary-gray-700 dark:text-primary-gray-100'\r\n >\r\n {d.label}:{' '}\r\n <span className='font-bold' style={{ fontSize: 'inherit' }}>\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </span>\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n ) : null}\r\n <Spacer size='lg' />\r\n <GraphArea ref={graphDiv}>\r\n {graphRadius ? (\r\n <Graph\r\n mainText={mainText}\r\n data={sortedData}\r\n colors={colors}\r\n radius={graphRadius}\r\n subNote={subNote}\r\n strokeWidth={strokeWidth}\r\n tooltip={tooltip}\r\n colorDomain={colorDomain || sortedData.map(d => d.label)}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n detailsOnClick={detailsOnClick}\r\n precision={precision}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n trackColor={trackColor}\r\n />\r\n ) : null}\r\n </GraphArea>\r\n </>\r\n )}\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["pi","tau","descending","a","b","identity","d","pie","value","sortValues","sort","startAngle","constant","endAngle","padAngle","data","i","n","array","j","k","sum","index","arcs","a0","da","a1","p","pa","v","_","polarToCartesian","centerX","centerY","radius","angleInRadians","x","Math","cos","y","sin","getArc","startAngleInRadians","endAngleInRadians","start","end","largeArcFlag","PI","join","Graph","props","$","_c","mainText","colors","subNote","strokeWidth","tooltip","onSeriesMouseOver","onSeriesMouseClick","colorDomain","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","precision","animate","trackColor","svgRef","useRef","t0","amount","once","isInView","useInView","pieData","_temp","mouseOverData","setMouseOverData","useState","undefined","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","t1","motion","t2","t3","t4","t5","t6","t7","t8","t9","jsx","jsxs","H2","findIndex","d_1","label","numberFormattingFunction","d_0","size","prefix","suffix","P","t10","t11","T0","AnimatePresence","t12","duration","d_2","initial","pathLength","opacity","whileInView","transition","stroke","indexOf","length","Colors","gray","fill","event","clientY","clientX","isEqual","event_0","t13","map","t14","t15","g","t16","svg","t17","Tooltip","t18","modal","DetailsModal","t19","Fragment","DonutChart","graphTitle","light","categoricalColors","sources","graphDescription","footNote","showColorScale","padding","backgroundColor","graphID","graphDownload","dataDownload","sortData","language","theme","width","height","minHeight","relativeHeight","ariaLabel","colorScaleMaxWidth","grays","graphRadius","setGraphRadius","graphDiv","graphParentDiv","useEffect","resizeObserver","ResizeObserver","entries","min","target","clientWidth","clientHeight","Infinity","current","observe","disconnect","sortedData","orderBy","GraphContainer","graphContainer","GraphHeader","title","description","filter","EmptyState","cn","colorLegend","maxWidth","el","fontSize","Spacer","GraphArea","GraphFooter","footnote","source"],"mappings":"0uBASaA,GAAK,KAAK,GAEVC,GAAM,EAAID,GCXR,SAAAE,GAASC,EAAGC,EAAG,CAC5B,OAAOA,EAAID,EAAI,GAAKC,EAAID,EAAI,EAAIC,GAAKD,EAAI,EAAI,GAC/C,CCFe,SAAAE,GAASC,EAAG,CACzB,OAAOA,CACT,CCIe,SAAAC,IAAW,CACxB,IAAIC,EAAQH,GACRI,EAAaP,GACbQ,EAAO,KACPC,EAAaC,EAAAA,SAAS,CAAC,EACvBC,EAAWD,EAAAA,SAASX,EAAG,EACvBa,EAAWF,EAAAA,SAAS,CAAC,EAEzB,SAASL,EAAIQ,EAAM,CACjB,IAAIC,EACAC,GAAKF,EAAOG,QAAMH,CAAI,GAAG,OACzBI,EACAC,EACAC,EAAM,EACNC,EAAQ,IAAI,MAAML,CAAC,EACnBM,EAAO,IAAI,MAAMN,CAAC,EAClBO,EAAK,CAACb,EAAW,MAAM,KAAM,SAAS,EACtCc,EAAK,KAAK,IAAIxB,GAAK,KAAK,IAAI,CAACA,GAAKY,EAAS,MAAM,KAAM,SAAS,EAAIW,CAAE,CAAC,EACvEE,EACAC,EAAI,KAAK,IAAI,KAAK,IAAIF,CAAE,EAAIR,EAAGH,EAAS,MAAM,KAAM,SAAS,CAAC,EAC9Dc,EAAKD,GAAKF,EAAK,EAAI,GAAK,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AAA,CAAA,CACF,CAAA,CAAA,EAtBiD3F,CAuBnD,CACD,CAAA,CACH,EACE,KACJiF,EAAAA,kBAAAA,IAACsG,GAAAA,EAAA,CAAO,KAAK,IAAA,CAAI,EACjBtG,EAAAA,kBAAAA,IAACuG,GAAAA,UAAA,CAAU,IAAK7B,EACbF,WACCxE,wBAAChD,GAAA,CACC,SAAAI,EACA,KAAMoI,EACN,OAAAnI,EACA,OAAQmH,EACR,QAAAlH,EACA,YAAAC,EACA,QAAAC,EACA,YAAaG,GAAe6H,EAAWpD,IAAI/H,GAAKA,EAAEgG,KAAK,EACvD,kBAAA5C,EACA,mBAAAC,EACA,4BAAAE,EACA,OAAAE,EACA,eAAAD,EACA,UAAAG,GACA,QACEC,IAAY,GACR,CAAEgD,SAAU,GAAK1C,KAAM,GAAMD,OAAQ,EAAA,EACrCL,GAAW,CAAEgD,SAAU,EAAG1C,KAAM,GAAMD,OAAQ,CAAA,EAEpD,WAAAJ,CAAA,CAAuB,EAEvB,IAAA,CACN,CAAA,EACF,EAEDmF,GAAWE,EACVvD,EAAAA,kBAAAA,IAACwG,GAAAA,YAAA,CACC,OAAQ,CAAEC,SAAU3I,GAAQ2I,SAAUC,OAAQ5I,GAAQ4I,MAAAA,EACtD,WAAY,CACVD,SAAU1I,GAAY0I,SACtBC,OAAQ3I,GAAY2I,MAAAA,EAEtB,QAAArD,EACA,SAAAE,EACA,MAAAU,CAAA,CAAa,EAEb,IAAA,EACN,CAEJ","x_google_ignoreList":[0,1,2,3]}
@@ -1,5 +1,11 @@
1
1
  import { JSX } from 'react/jsx-runtime';
2
2
 
3
+ declare interface AnimateDataType {
4
+ duration: number;
5
+ once: boolean;
6
+ amount: 'some' | 'all' | number;
7
+ }
8
+
3
9
  declare interface AxesClassNameObject {
4
10
  gridLines?: string;
5
11
  labels?: string;
@@ -90,6 +96,8 @@ declare interface Props {
90
96
  strokeWidth?: number;
91
97
  /** Sorting order for data. This is overwritten by labelOrder prop */
92
98
  sortData?: 'asc' | 'desc';
99
+ /** Toggles if the graph animates in when loaded. */
100
+ animate?: boolean | AnimateDataType;
93
101
  /** Large text at the center of the donut chart. If the type is an object then the text is the value in the data for the label mentioned in the object */
94
102
  mainText?: string | {
95
103
  label: string;
@@ -100,6 +108,8 @@ declare interface Props {
100
108
  subNote?: string;
101
109
  /** Specifies the number of decimal places to display in the value. */
102
110
  precision?: number;
111
+ /** Track color (i.e. the color of the donut chart's background) of the donut chart */
112
+ trackColor?: string;
103
113
  /** Enable graph download option as png */
104
114
  graphDownload?: boolean;
105
115
  /** Enable data download option as a csv */