@undp/data-viz 2.3.1 → 2.3.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 (154) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +1 -1
  3. package/dist/BarGraph.cjs +1 -1
  4. package/dist/BarGraph.js +2 -2
  5. package/dist/BasicStatCard.cjs +1 -1
  6. package/dist/BasicStatCard.js +15 -15
  7. package/dist/BeeSwarmChart.cjs +1 -1
  8. package/dist/BeeSwarmChart.js +2 -2
  9. package/dist/BiVariateChoroplethMap.cjs +1 -1
  10. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  11. package/dist/BiVariateChoroplethMap.js +202 -202
  12. package/dist/BiVariateChoroplethMap.js.map +1 -1
  13. package/dist/BulletChart.cjs +1 -1
  14. package/dist/BulletChart.js +2 -2
  15. package/dist/ButterflyChart.cjs +1 -1
  16. package/dist/ButterflyChart.js +2 -2
  17. package/dist/ChoroplethMap.cjs +1 -1
  18. package/dist/ChoroplethMap.cjs.map +1 -1
  19. package/dist/ChoroplethMap.js +33 -33
  20. package/dist/ChoroplethMap.js.map +1 -1
  21. package/dist/CirclePackingGraph.cjs +1 -1
  22. package/dist/CirclePackingGraph.js +2 -2
  23. package/dist/ColorLegend.cjs +1 -1
  24. package/dist/ColorLegend.js +7 -7
  25. package/dist/ColorLegendWithMouseOver.cjs +1 -1
  26. package/dist/ColorLegendWithMouseOver.js +1 -1
  27. package/dist/CopyTextButton.cjs +1 -1
  28. package/dist/CopyTextButton.js +1 -1
  29. package/dist/CsvDownloadButton.cjs +2 -2
  30. package/dist/CsvDownloadButton.js +1 -1
  31. package/dist/DataCards.cjs +1 -1
  32. package/dist/DataCards.js +3 -3
  33. package/dist/DataCards.js.map +1 -1
  34. package/dist/DataTable.cjs +1 -1
  35. package/dist/DataTable.js +2 -2
  36. package/dist/DifferenceLineChart.cjs +1 -1
  37. package/dist/DifferenceLineChart.js +1 -1
  38. package/dist/DonutChart.cjs +1 -1
  39. package/dist/DonutChart.js +20 -20
  40. package/dist/DotDensityMap.cjs +1 -1
  41. package/dist/DotDensityMap.cjs.map +1 -1
  42. package/dist/DotDensityMap.js +46 -46
  43. package/dist/DotDensityMap.js.map +1 -1
  44. package/dist/DualAxisLineChart.cjs +1 -1
  45. package/dist/DualAxisLineChart.js +1 -1
  46. package/dist/DumbbellChart.cjs +1 -1
  47. package/dist/DumbbellChart.js +2 -2
  48. package/dist/{EmptyState-CGeBqbmR.cjs → EmptyState-DX0t62iF.cjs} +2 -2
  49. package/dist/{EmptyState-CGeBqbmR.cjs.map → EmptyState-DX0t62iF.cjs.map} +1 -1
  50. package/dist/{EmptyState-tZBErBKF.js → EmptyState-Pj-emXt5.js} +3 -3
  51. package/dist/{EmptyState-tZBErBKF.js.map → EmptyState-Pj-emXt5.js.map} +1 -1
  52. package/dist/ExcelDownloadButton.cjs +1 -1
  53. package/dist/ExcelDownloadButton.js +7 -7
  54. package/dist/FootNote.cjs +1 -1
  55. package/dist/FootNote.js +1 -1
  56. package/dist/GeoHubCompareMaps.cjs +1 -1
  57. package/dist/GeoHubCompareMaps.js +1 -1
  58. package/dist/GeoHubMap.cjs +1 -1
  59. package/dist/GeoHubMap.js +1 -1
  60. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  61. package/dist/GeoHubMapWithLayerSelection.js +2 -2
  62. package/dist/GraphDescription.cjs +1 -1
  63. package/dist/GraphDescription.js +1 -1
  64. package/dist/{GraphEl-ic8C5Ksc.cjs → GraphEl-CWjTuiYd.cjs} +2 -2
  65. package/dist/{GraphEl-ic8C5Ksc.cjs.map → GraphEl-CWjTuiYd.cjs.map} +1 -1
  66. package/dist/{GraphEl-L5hNe7wJ.js → GraphEl-DDXkYObU.js} +7 -7
  67. package/dist/{GraphEl-L5hNe7wJ.js.map → GraphEl-DDXkYObU.js.map} +1 -1
  68. package/dist/GraphFooter.cjs +1 -1
  69. package/dist/GraphFooter.js +1 -1
  70. package/dist/GraphTitle.cjs +1 -1
  71. package/dist/GraphTitle.js +1 -1
  72. package/dist/GriddedGraphs.cjs +1 -1
  73. package/dist/GriddedGraphs.js +1 -1
  74. package/dist/HeatMap.cjs +1 -1
  75. package/dist/HeatMap.js +1 -1
  76. package/dist/Histogram.cjs +1 -1
  77. package/dist/Histogram.js +1 -1
  78. package/dist/HybridMap.cjs +1 -1
  79. package/dist/HybridMap.cjs.map +1 -1
  80. package/dist/HybridMap.js +42 -42
  81. package/dist/HybridMap.js.map +1 -1
  82. package/dist/ImageDownloadButton.cjs +1 -1
  83. package/dist/ImageDownloadButton.js +1 -1
  84. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  85. package/dist/LineChartWithConfidenceInterval.js +1 -1
  86. package/dist/LinearColorLegend.cjs +1 -1
  87. package/dist/LinearColorLegend.js +1 -1
  88. package/dist/MultiLineAltChart.cjs +1 -1
  89. package/dist/MultiLineAltChart.js +1 -1
  90. package/dist/MultiLineChart.cjs +1 -1
  91. package/dist/MultiLineChart.js +1 -1
  92. package/dist/ParetoChart.cjs +1 -1
  93. package/dist/ParetoChart.js +1 -1
  94. package/dist/RadarChart.cjs +1 -1
  95. package/dist/RadarChart.js +1 -1
  96. package/dist/SVGDownloadButton.cjs +1 -1
  97. package/dist/SVGDownloadButton.js +8 -8
  98. package/dist/SankeyChart.cjs +1 -1
  99. package/dist/SankeyChart.js +80 -80
  100. package/dist/ScatterPlot.cjs +1 -1
  101. package/dist/ScatterPlot.js +2 -2
  102. package/dist/SimpleLineChart.cjs +1 -1
  103. package/dist/SimpleLineChart.js +1 -1
  104. package/dist/SingleGraphDashboard.cjs +1 -1
  105. package/dist/SingleGraphDashboard.js +1 -1
  106. package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
  107. package/dist/SingleGraphDashboardGeoHubMaps.js +10 -10
  108. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  109. package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
  110. package/dist/SlopeChart.cjs +1 -1
  111. package/dist/SlopeChart.js +1 -1
  112. package/dist/{Source-B5AoSlsi.cjs → Source-B3i0Bx2R.cjs} +2 -2
  113. package/dist/{Source-B5AoSlsi.cjs.map → Source-B3i0Bx2R.cjs.map} +1 -1
  114. package/dist/{Source-F8EYCYkV.js → Source-_STIejqs.js} +14 -14
  115. package/dist/{Source-F8EYCYkV.js.map → Source-_STIejqs.js.map} +1 -1
  116. package/dist/Source.cjs +1 -1
  117. package/dist/Source.js +2 -2
  118. package/dist/StatCardFromData.cjs +1 -1
  119. package/dist/StatCardFromData.js +12 -12
  120. package/dist/StripChart.cjs +1 -1
  121. package/dist/StripChart.js +1 -1
  122. package/dist/ThreeDGlobe.cjs +1 -1
  123. package/dist/ThreeDGlobe.js +2 -2
  124. package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
  125. package/dist/ThresholdColorLegendWithMouseOver.js +10 -10
  126. package/dist/TreeMapGraph.cjs +1 -1
  127. package/dist/TreeMapGraph.js +29 -29
  128. package/dist/Typography-DrJ7IOdw.cjs +2 -0
  129. package/dist/Typography-DrJ7IOdw.cjs.map +1 -0
  130. package/dist/Typography-iR8PEgdt.js +263 -0
  131. package/dist/Typography-iR8PEgdt.js.map +1 -0
  132. package/dist/UnitChart.cjs +1 -1
  133. package/dist/UnitChart.js +25 -25
  134. package/dist/WaterfallChart.cjs +1 -1
  135. package/dist/WaterfallChart.js +1 -1
  136. package/dist/{index-BQYOuXdl.js → index-B-4y_iGB.js} +19 -17
  137. package/dist/index-B-4y_iGB.js.map +1 -0
  138. package/dist/{index-D5ihtaJJ.js → index-BE-lvE4c.js} +3 -3
  139. package/dist/{index-D5ihtaJJ.js.map → index-BE-lvE4c.js.map} +1 -1
  140. package/dist/{index-Dgjq6aZ2.cjs → index-DlrGwLQA.cjs} +2 -2
  141. package/dist/{index-Dgjq6aZ2.cjs.map → index-DlrGwLQA.cjs.map} +1 -1
  142. package/dist/index-sbKVyHS2.cjs +2 -0
  143. package/dist/index-sbKVyHS2.cjs.map +1 -0
  144. package/dist/index.cjs +1 -1
  145. package/dist/index.js +2 -2
  146. package/dist/style.css +1 -1
  147. package/package.json +3 -3
  148. package/dist/Typography-hWfh3H0J.js +0 -142
  149. package/dist/Typography-hWfh3H0J.js.map +0 -1
  150. package/dist/Typography-sa1UE0oF.cjs +0 -2
  151. package/dist/Typography-sa1UE0oF.cjs.map +0 -1
  152. package/dist/index-BQYOuXdl.js.map +0 -1
  153. package/dist/index-C6er0ety.cjs +0 -2
  154. package/dist/index-C6er0ety.cjs.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-CHPV5EwG-6v2a2njQ.cjs"),A=require("react"),de=require("./index-CSNtgibC.cjs"),pe=require("./index-Cno4Q0YE.cjs"),Oe=require("./index-DQA8q5sC.cjs"),Zt=require("./Typography-sa1UE0oF.cjs"),me=require("./numberFormattingFunction-02t-wJta.cjs"),Ce=require("./Tooltip-BLa2EfMs.cjs"),Ve=require("./DetailsModal-DHttOA80.cjs"),ie=require("./proxy-C4-uo6nS.cjs"),Ne=require("./use-in-view-C3o_ntMv.cjs"),De=require("./index-CoobIWNj.cjs"),Te=require("./GraphHeader.cjs"),qe=require("./GraphFooter.cjs"),xe=require("./Colors.cjs"),Be=require("./generateRandomString-B5zBiJzS.cjs"),Pe=require("./EmptyState-CGeBqbmR.cjs"),zt=require("./uniqBy-O05lp2S5.cjs"),ye=require("./GraphContainer-B1EDxJ0S.cjs");function ve(e,t){let o;if(t===void 0)for(const r of e)r!=null&&(o<r||o===void 0&&r>=r)&&(o=r);else{let r=-1;for(let a of e)(a=t(a,++r,e))!=null&&(o<a||o===void 0&&a>=a)&&(o=a)}return o}function Ee(e,t){let o;if(t===void 0)for(const r of e)r!=null&&(o>r||o===void 0&&r>=r)&&(o=r);else{let r=-1;for(let a of e)(a=t(a,++r,e))!=null&&(o>a||o===void 0&&a>=a)&&(o=a)}return o}function re(e,t){let o=0;if(t===void 0)for(let r of e)(r=+r)&&(o+=r);else{let r=-1;for(let a of e)(a=+t(a,++r,e))&&(o+=a)}return o}function ze(e){return e.target.depth}function Ie(e,t){return e.sourceLinks.length?e.depth:t-1}function se(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?Ee(e.sourceLinks,ze)-1:0}function _t(e){return function(){return e}}function je(e,t){return Qt(e.source,t.source)||e.index-t.index}function ke(e,t){return Qt(e.target,t.target)||e.index-t.index}function Qt(e,t){return e.y0-t.y0}function le(e){return e.value}function Ae(e){return e.index}function He(e){return e.nodes}function Ge(e){return e.links}function be(e,t){const o=e.get(t);if(!o)throw new Error("missing: "+t);return o}function we({nodes:e}){for(const t of e){let o=t.y0,r=o;for(const a of t.sourceLinks)a.y0=o+a.width/2,o+=a.width;for(const a of t.targetLinks)a.y1=r+a.width/2,r+=a.width}}function ae(){let e=0,t=0,o=1,r=1,a=24,x=8,h,g=Ae,y=Ie,k,b,$=He,D=Ge,j=6;function p(){const n={nodes:$.apply(null,arguments),links:D.apply(null,arguments)};return M(n),H(n),w(n),S(n),F(n),we(n),n}p.update=function(n){return we(n),n},p.nodeId=function(n){return arguments.length?(g=typeof n=="function"?n:_t(n),p):g},p.nodeAlign=function(n){return arguments.length?(y=typeof n=="function"?n:_t(n),p):y},p.nodeSort=function(n){return arguments.length?(k=n,p):k},p.nodeWidth=function(n){return arguments.length?(a=+n,p):a},p.nodePadding=function(n){return arguments.length?(x=h=+n,p):x},p.nodes=function(n){return arguments.length?($=typeof n=="function"?n:_t(n),p):$},p.links=function(n){return arguments.length?(D=typeof n=="function"?n:_t(n),p):D},p.linkSort=function(n){return arguments.length?(b=n,p):b},p.size=function(n){return arguments.length?(e=t=0,o=+n[0],r=+n[1],p):[o-e,r-t]},p.extent=function(n){return arguments.length?(e=+n[0][0],o=+n[1][0],t=+n[0][1],r=+n[1][1],p):[[e,t],[o,r]]},p.iterations=function(n){return arguments.length?(j=+n,p):j};function M({nodes:n,links:l}){for(const[u,i]of n.entries())i.index=u,i.sourceLinks=[],i.targetLinks=[];const s=new Map(n.map((u,i)=>[g(u,i,n),u]));for(const[u,i]of l.entries()){i.index=u;let{source:f,target:v}=i;typeof f!="object"&&(f=i.source=be(s,f)),typeof v!="object"&&(v=i.target=be(s,v)),f.sourceLinks.push(i),v.targetLinks.push(i)}if(b!=null)for(const{sourceLinks:u,targetLinks:i}of n)u.sort(b),i.sort(b)}function H({nodes:n}){for(const l of n)l.value=l.fixedValue===void 0?Math.max(re(l.sourceLinks,le),re(l.targetLinks,le)):l.fixedValue}function w({nodes:n}){const l=n.length;let s=new Set(n),u=new Set,i=0;for(;s.size;){for(const f of s){f.depth=i;for(const{target:v}of f.sourceLinks)u.add(v)}if(++i>l)throw new Error("circular link");s=u,u=new Set}}function S({nodes:n}){const l=n.length;let s=new Set(n),u=new Set,i=0;for(;s.size;){for(const f of s){f.height=i;for(const{source:v}of f.targetLinks)u.add(v)}if(++i>l)throw new Error("circular link");s=u,u=new Set}}function B({nodes:n}){const l=ve(n,i=>i.depth)+1,s=(o-e-a)/(l-1),u=new Array(l);for(const i of n){const f=Math.max(0,Math.min(l-1,Math.floor(y.call(null,i,l))));i.layer=f,i.x0=e+f*s,i.x1=i.x0+a,u[f]?u[f].push(i):u[f]=[i]}if(k)for(const i of u)i.sort(k);return u}function z(n){const l=Ee(n,s=>(r-t-(s.length-1)*h)/re(s,le));for(const s of n){let u=t;for(const i of s){i.y0=u,i.y1=u+i.value*l,u=i.y1+h;for(const f of i.sourceLinks)f.width=f.value*l}u=(r-u+h)/(s.length+1);for(let i=0;i<s.length;++i){const f=s[i];f.y0+=u*(i+1),f.y1+=u*(i+1)}Y(s)}}function F(n){const l=B(n);h=Math.min(x,(r-t)/(ve(l,s=>s.length)-1)),z(l);for(let s=0;s<j;++s){const u=Math.pow(.99,s),i=Math.max(1-u,(s+1)/j);X(l,u,i),G(l,u,i)}}function G(n,l,s){for(let u=1,i=n.length;u<i;++u){const f=n[u];for(const v of f){let C=0,T=0;for(const{source:I,value:U}of v.targetLinks){let Z=U*(v.layer-I.layer);C+=O(I,v)*Z,T+=Z}if(!(T>0))continue;let V=(C/T-v.y0)*l;v.y0+=V,v.y1+=V,kt(v)}k===void 0&&f.sort(Qt),W(f,s)}}function X(n,l,s){for(let u=n.length,i=u-2;i>=0;--i){const f=n[i];for(const v of f){let C=0,T=0;for(const{target:I,value:U}of v.sourceLinks){let Z=U*(I.layer-v.layer);C+=E(v,I)*Z,T+=Z}if(!(T>0))continue;let V=(C/T-v.y0)*l;v.y0+=V,v.y1+=V,kt(v)}k===void 0&&f.sort(Qt),W(f,s)}}function W(n,l){const s=n.length>>1,u=n[s];tt(n,u.y0-h,s-1,l),R(n,u.y1+h,s+1,l),tt(n,r,n.length-1,l),R(n,t,0,l)}function R(n,l,s,u){for(;s<n.length;++s){const i=n[s],f=(l-i.y0)*u;f>1e-6&&(i.y0+=f,i.y1+=f),l=i.y1+h}}function tt(n,l,s,u){for(;s>=0;--s){const i=n[s],f=(i.y1-l)*u;f>1e-6&&(i.y0-=f,i.y1-=f),l=i.y0-h}}function kt({sourceLinks:n,targetLinks:l}){if(b===void 0){for(const{source:{sourceLinks:s}}of l)s.sort(ke);for(const{target:{targetLinks:s}}of n)s.sort(je)}}function Y(n){if(b===void 0)for(const{sourceLinks:l,targetLinks:s}of n)l.sort(ke),s.sort(je)}function O(n,l){let s=n.y0-(n.sourceLinks.length-1)*h/2;for(const{target:u,width:i}of n.sourceLinks){if(u===l)break;s+=i+h}for(const{source:u,width:i}of l.targetLinks){if(u===n)break;s-=i}return s}function E(n,l){let s=l.y0-(l.targetLinks.length-1)*h/2;for(const{source:u,width:i}of l.targetLinks){if(u===n)break;s+=i+h}for(const{target:u,width:i}of n.sourceLinks){if(u===l)break;s-=i}return s}return p}var ue=Math.PI,ce=2*ue,Ct=1e-6,We=ce-Ct;function fe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Le(){return new fe}fe.prototype=Le.prototype={constructor:fe,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,o,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+o)+","+(this._y1=+r)},bezierCurveTo:function(e,t,o,r,a,x){this._+="C"+ +e+","+ +t+","+ +o+","+ +r+","+(this._x1=+a)+","+(this._y1=+x)},arcTo:function(e,t,o,r,a){e=+e,t=+t,o=+o,r=+r,a=+a;var x=this._x1,h=this._y1,g=o-e,y=r-t,k=x-e,b=h-t,$=k*k+b*b;if(a<0)throw new Error("negative radius: "+a);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if($>Ct)if(!(Math.abs(b*g-y*k)>Ct)||!a)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var D=o-x,j=r-h,p=g*g+y*y,M=D*D+j*j,H=Math.sqrt(p),w=Math.sqrt($),S=a*Math.tan((ue-Math.acos((p+$-M)/(2*H*w)))/2),B=S/w,z=S/H;Math.abs(B-1)>Ct&&(this._+="L"+(e+B*k)+","+(t+B*b)),this._+="A"+a+","+a+",0,0,"+ +(b*D>k*j)+","+(this._x1=e+z*g)+","+(this._y1=t+z*y)}},arc:function(e,t,o,r,a,x){e=+e,t=+t,o=+o,x=!!x;var h=o*Math.cos(r),g=o*Math.sin(r),y=e+h,k=t+g,b=1^x,$=x?r-a:a-r;if(o<0)throw new Error("negative radius: "+o);this._x1===null?this._+="M"+y+","+k:(Math.abs(this._x1-y)>Ct||Math.abs(this._y1-k)>Ct)&&(this._+="L"+y+","+k),o&&($<0&&($=$%ce+ce),$>We?this._+="A"+o+","+o+",0,1,"+b+","+(e-h)+","+(t-g)+"A"+o+","+o+",0,1,"+b+","+(this._x1=y)+","+(this._y1=k):$>Ct&&(this._+="A"+o+","+o+",0,"+ +($>=ue)+","+b+","+(this._x1=e+o*Math.cos(a))+","+(this._y1=t+o*Math.sin(a))))},rect:function(e,t,o,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +o+"v"+ +r+"h"+-o+"Z"},toString:function(){return this._}};function $e(e){return function(){return e}}function Fe(e){return e[0]}function Xe(e){return e[1]}var Ye=Array.prototype.slice;function Ue(e){return e.source}function Ze(e){return e.target}function _e(e){var t=Ue,o=Ze,r=Fe,a=Xe,x=null;function h(){var g,y=Ye.call(arguments),k=t.apply(this,y),b=o.apply(this,y);if(x||(x=g=Le()),e(x,+r.apply(this,(y[0]=k,y)),+a.apply(this,y),+r.apply(this,(y[0]=b,y)),+a.apply(this,y)),g)return x=null,g+""||null}return h.source=function(g){return arguments.length?(t=g,h):t},h.target=function(g){return arguments.length?(o=g,h):o},h.x=function(g){return arguments.length?(r=typeof g=="function"?g:$e(+g),h):r},h.y=function(g){return arguments.length?(a=typeof g=="function"?g:$e(+g),h):a},h.context=function(g){return arguments.length?(x=g??null,h):x},h}function Qe(e,t,o,r,a){e.moveTo(t,o),e.bezierCurveTo(t=(t+r)/2,o,t,a,r,a)}function Je(){return _e(Qe)}function Ke(e){return[e.source.x1,e.y0]}function tn(e){return[e.target.x0,e.y1]}function en(){return Je().source(Ke).target(tn)}function nn(e){const t=d.compilerRuntimeExports.c(136),{data:o,showLabels:r,leftMargin:a,rightMargin:x,truncateBy:h,width:g,height:y,topMargin:k,bottomMargin:b,tooltip:$,onSeriesMouseOver:D,suffix:j,prefix:p,showValues:M,onSeriesMouseClick:H,nodePadding:w,nodeWidth:S,id:B,highlightedSourceDataPoints:z,highlightedTargetDataPoints:F,defaultLinkOpacity:G,sourceTitle:X,targetTitle:W,animate:R,sortNodes:tt,resetSelectionOnDoubleClick:kt,detailsOnClick:Y,styles:O,classNames:E,precision:n,customLayers:l}=e,s=A.useRef(null);let u;t[0]!==R.amount||t[1]!==R.once?(u={once:R.once,amount:R.amount},t[0]=R.amount,t[1]=R.once,t[2]=u):u=t[2];const i=Ne.useInView(s,u),[f,v]=A.useState(void 0),[C,T]=A.useState(void 0),[V,I]=A.useState(void 0),[U,Z]=A.useState(void 0),[St,Rt]=A.useState(void 0);let L;t[3]!==b||t[4]!==a||t[5]!==x||t[6]!==k?(L={top:k,bottom:b,left:a,right:x},t[3]=b,t[4]=a,t[5]=x,t[6]=k,t[7]=L):L=t[7];const m=L,wt=g-m.left-m.right,$t=y-m.top-m.bottom;let et,lt,at,_,ut,ct,Q,J,ft,ht,K,nt,ot,it,gt,dt;if(t[8]!==R.duration||t[9]!==E?.graphObjectValues||t[10]!==l||t[11]!==o||t[12]!==G||t[13]!==Y||t[14]!==$t||t[15]!==wt||t[16]!==y||t[17]!==z||t[18]!==F||t[19]!==B||t[20]!==i||t[21]!==a||t[22]!==m.left||t[23]!==m.right||t[24]!==m.top||t[25]!==C||t[26]!==w||t[27]!==S||t[28]!==H||t[29]!==D||t[30]!==n||t[31]!==p||t[32]!==kt||t[33]!==x||t[34]!==V||t[35]!==r||t[36]!==M||t[37]!==tt||t[38]!==X||t[39]!==O?.graphObjectValues||t[40]!==j||t[41]!==W||t[42]!==h||t[43]!==g){const It=tt==="mostReadable"?ae().nodeWidth(S).nodePadding(w).size([wt,$t]).nodeAlign(se):tt==="none"?ae().nodeWidth(S).nodePadding(w).size([wt,$t]).nodeAlign(se).nodeSort(null).linkSort(null):ae().nodeWidth(S).nodePadding(w).size([wt,$t]).nodeAlign(se).nodeSort(tt==="desc"?fn:cn),{nodes:N,links:Vt}=It(o),Nt=en();lt=ie.motion.svg,gt=`${g}px`,dt=`${y}px`,at=`0 0 ${g} ${y}`,t[60]===Symbol.for("react.memo_cache_sentinel")?(_={marginLeft:"auto",marginRight:"auto"},t[60]=_):_=t[60],ut="ltr",ct=s,t[61]!==m.left||t[62]!==m.top||t[63]!==X?(Q=X?d.jsxRuntimeExports.jsx("text",{x:m.left,y:m.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"start"},children:X}):null,t[61]=m.left,t[62]=m.top,t[63]=X,t[64]=Q):Q=t[64],t[65]!==m.right||t[66]!==m.top||t[67]!==W||t[68]!==g?(J=W?d.jsxRuntimeExports.jsx("text",{x:g-m.right,y:m.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"end"},children:W}):null,t[65]=m.right,t[66]=m.top,t[67]=W,t[68]=g,t[69]=J):J=t[69],ht=`translate(${m.left},${m.top})`,t[70]!==l?(K=l.filter(un).map(an),t[70]=l,t[71]=K):K=t[71];let Lt;t[72]!==E?.graphObjectValues||t[73]!==a||t[74]!==w||t[75]!==n||t[76]!==p||t[77]!==r||t[78]!==M||t[79]!==O?.graphObjectValues||t[80]!==j||t[81]!==h?(Lt=(c,vt)=>d.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{I(c)},onMouseLeave:()=>{I(void 0)},children:d.jsxRuntimeExports.jsxs("g",{transform:`translate(${c.x0},${c.y0})`,children:[d.jsxRuntimeExports.jsx("rect",{x:0,y:0,width:(c.x1||0)-(c.x0||0),height:(c.y1||0)-(c.y0||0),style:{fill:c.color}}),r||M?d.jsxRuntimeExports.jsx("foreignObject",{y:0-w/2,x:0-a,width:a,height:(c.y1||0)-(c.y0||0)+w,children:d.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(c.y1||0)-(c.y0||0)+w}px`,overflow:"visible"},children:[r?d.jsxRuntimeExports.jsx(Zt.j,{marginBottom:M?"3xs":"none",size:"sm",leading:"none",className:d.mo("sankey-right-label text-right",E?.graphObjectValues),style:{hyphens:"auto",color:c.color,...O?.graphObjectValues},children:`${c.label}`.length<h?`${c.label}`:`${`${c.label}`.substring(0,h)}...`}):null,M?d.jsxRuntimeExports.jsx(Zt.j,{marginBottom:"none",size:"sm",leading:"none",className:d.mo("sankey-right-value text-right font-bold",E?.graphObjectValues),style:{hyphens:"auto",color:c.color,...O?.graphObjectValues},children:me.numberFormattingFunction(c.value,"NA",n,p,j)}):null]})}):null]})},vt),t[72]=E?.graphObjectValues,t[73]=a,t[74]=w,t[75]=n,t[76]=p,t[77]=r,t[78]=M,t[79]=O?.graphObjectValues,t[80]=j,t[81]=h,t[82]=Lt):Lt=t[82],nt=N.filter(ln).map(Lt);let bt;t[83]!==E?.graphObjectValues||t[84]!==w||t[85]!==S||t[86]!==n||t[87]!==p||t[88]!==x||t[89]!==r||t[90]!==M||t[91]!==O?.graphObjectValues||t[92]!==j||t[93]!==h?(bt=(c,vt)=>d.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{I(c)},onMouseLeave:()=>{I(void 0)},children:d.jsxRuntimeExports.jsxs("g",{transform:`translate(${c.x0},${c.y0})`,children:[d.jsxRuntimeExports.jsx("rect",{x:0,y:0,width:(c.x1||0)-(c.x0||0),height:(c.y1||0)-(c.y0||0),style:{fill:c.color}}),r||M?d.jsxRuntimeExports.jsx("foreignObject",{y:0-w/2,x:S,width:x-S,height:(c.y1||0)-(c.y0||0)+w,children:d.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(c.y1||0)-(c.y0||0)+w}px`},children:[r?d.jsxRuntimeExports.jsx(Zt.j,{marginBottom:M?"3xs":"none",size:"sm",leading:"none",className:d.mo("sankey-left-label text-left",E?.graphObjectValues),style:{hyphens:"auto",color:c.color,...O?.graphObjectValues},children:`${c.label}`.length<h?`${c.label}`:`${`${c.label}`.substring(0,h)}...`}):null,M?d.jsxRuntimeExports.jsx(Zt.j,{size:"sm",leading:"none",marginBottom:"none",className:d.mo("sankey-left-value text-left font-bold",E?.graphObjectValues),style:{hyphens:"auto",color:c.color,...O?.graphObjectValues},children:me.numberFormattingFunction(c.value,"NA",n,p,j)}):null]})}):null]})},vt),t[83]=E?.graphObjectValues,t[84]=w,t[85]=S,t[86]=n,t[87]=p,t[88]=x,t[89]=r,t[90]=M,t[91]=O?.graphObjectValues,t[92]=j,t[93]=h,t[94]=bt):bt=t[94],ot=N.filter(sn).map(bt);let Mt;t[95]!==B?(Mt=(c,vt)=>d.jsxRuntimeExports.jsxs("linearGradient",{id:`${B}-gradient-${vt}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientUnits:"userSpaceOnUse",children:[d.jsxRuntimeExports.jsx("stop",{offset:"0%",style:{stopColor:c.source.color,stopOpacity:1}}),d.jsxRuntimeExports.jsx("stop",{offset:"100%",style:{stopColor:c.target.color,stopOpacity:1}})]},vt),t[95]=B,t[96]=Mt):Mt=t[96],it=d.jsxRuntimeExports.jsx("defs",{children:Vt.map(Mt)}),et=De.AnimatePresence,ft=Vt.map((c,vt)=>d.jsxRuntimeExports.jsx(ie.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:jt=>{v(c.data),Rt(jt.clientY),Z(jt.clientX),D?.(c)},onMouseMove:jt=>{v(c.data),Rt(jt.clientY),Z(jt.clientX)},onClick:()=>{(H||Y)&&(Oe.isEqual(C,c.data)&&kt?(T(void 0),H?.(void 0)):(T(c.data),H?.(c.data)))},onMouseLeave:()=>{v(void 0),Z(void 0),Rt(void 0),D?.(void 0)},variants:{initial:{opacity:V?c.source.name===V.name||c.target.name===V.name?.85:G:(z.length!==0||F.length!==0)&&(z.indexOf(c.source.label)!==-1||F.indexOf(c.target.label)!==-1)?.85:G},whileInView:{opacity:V?c.source.name===V.name||c.target.name===V.name?.85:G:(z.length!==0||F.length!==0)&&(z.indexOf(c.source.label)!==-1||F.indexOf(c.target.label)!==-1)?.85:G,transition:{duration:R.duration}}},initial:"initial",animate:i?"whileInView":"initial",exit:{opacity:0,transition:{duration:R.duration}},children:d.jsxRuntimeExports.jsx(ie.motion.path,{d:Nt(c)||"",style:{stroke:`url(#${B}-gradient-${vt})`,strokeWidth:c.width,fill:"none"},exit:{opacity:0,transition:{duration:R.duration}},variants:{initial:{pathLength:0,opacity:1},whileInView:{pathLength:1,opacity:1,transition:{duration:R.duration}}},initial:"initial",animate:i?"whileInView":"initial"},`${c.source}-${c.target}`)},`${c.source}-${c.target}`)),t[8]=R.duration,t[9]=E?.graphObjectValues,t[10]=l,t[11]=o,t[12]=G,t[13]=Y,t[14]=$t,t[15]=wt,t[16]=y,t[17]=z,t[18]=F,t[19]=B,t[20]=i,t[21]=a,t[22]=m.left,t[23]=m.right,t[24]=m.top,t[25]=C,t[26]=w,t[27]=S,t[28]=H,t[29]=D,t[30]=n,t[31]=p,t[32]=kt,t[33]=x,t[34]=V,t[35]=r,t[36]=M,t[37]=tt,t[38]=X,t[39]=O?.graphObjectValues,t[40]=j,t[41]=W,t[42]=h,t[43]=g,t[44]=et,t[45]=lt,t[46]=at,t[47]=_,t[48]=ut,t[49]=ct,t[50]=Q,t[51]=J,t[52]=ft,t[53]=ht,t[54]=K,t[55]=nt,t[56]=ot,t[57]=it,t[58]=gt,t[59]=dt}else et=t[44],lt=t[45],at=t[46],_=t[47],ut=t[48],ct=t[49],Q=t[50],J=t[51],ft=t[52],ht=t[53],K=t[54],nt=t[55],ot=t[56],it=t[57],gt=t[58],dt=t[59];let pt;t[97]!==et||t[98]!==ft?(pt=d.jsxRuntimeExports.jsx("g",{children:d.jsxRuntimeExports.jsx(et,{children:ft})}),t[97]=et,t[98]=ft,t[99]=pt):pt=t[99];let mt;t[100]!==l?(mt=l.filter(rn).map(on),t[100]=l,t[101]=mt):mt=t[101];let xt;t[102]!==pt||t[103]!==mt||t[104]!==ht||t[105]!==K||t[106]!==nt||t[107]!==ot||t[108]!==it?(xt=d.jsxRuntimeExports.jsxs("g",{transform:ht,children:[K,nt,ot,it,pt,mt]}),t[102]=pt,t[103]=mt,t[104]=ht,t[105]=K,t[106]=nt,t[107]=ot,t[108]=it,t[109]=xt):xt=t[109];let rt;t[110]!==lt||t[111]!==at||t[112]!==_||t[113]!==ut||t[114]!==ct||t[115]!==Q||t[116]!==J||t[117]!==xt||t[118]!==gt||t[119]!==dt?(rt=d.jsxRuntimeExports.jsxs(lt,{width:gt,height:dt,viewBox:at,style:_,direction:ut,ref:ct,children:[Q,J,xt]}),t[110]=lt,t[111]=at,t[112]=_,t[113]=ut,t[114]=ct,t[115]=Q,t[116]=J,t[117]=xt,t[118]=gt,t[119]=dt,t[120]=rt):rt=t[120];let yt;t[121]!==E?.tooltip||t[122]!==U||t[123]!==St||t[124]!==f||t[125]!==O?.tooltip||t[126]!==$?(yt=f&&$&&U&&St?d.jsxRuntimeExports.jsx(Ce.Tooltip,{data:f,body:$,xPos:U,yPos:St,backgroundStyle:O?.tooltip,className:E?.tooltip}):null,t[121]=E?.tooltip,t[122]=U,t[123]=St,t[124]=f,t[125]=O?.tooltip,t[126]=$,t[127]=yt):yt=t[127];let st;t[128]!==E?.modal||t[129]!==Y||t[130]!==C?(st=Y&&C!==void 0?d.jsxRuntimeExports.jsx(Ve.DetailsModal,{body:Y,data:C,setData:T,className:E?.modal}):null,t[128]=E?.modal,t[129]=Y,t[130]=C,t[131]=st):st=t[131];let Et;return t[132]!==rt||t[133]!==yt||t[134]!==st?(Et=d.jsxRuntimeExports.jsxs(d.jsxRuntimeExports.Fragment,{children:[rt,yt,st]}),t[132]=rt,t[133]=yt,t[134]=st,t[135]=Et):Et=t[135],Et}function on(e){return e.layer}function rn(e){return e.position==="after"}function sn(e){return e.type==="target"}function ln(e){return e.type==="source"}function an(e){return e.layer}function un(e){return e.position==="before"}function cn(e,t){return(e.value||0)-(t.value||0)}function fn(e,t){return(t.value||0)-(e.value||0)}function hn(e){const t=d.compilerRuntimeExports.c(98),{data:o,graphTitle:r,sources:a,graphDescription:x,showLabels:h,leftMargin:g,rightMargin:y,topMargin:k,bottomMargin:b,truncateBy:$,height:D,width:j,footNote:p,padding:M,backgroundColor:H,tooltip:w,onSeriesMouseOver:S,suffix:B,prefix:z,relativeHeight:F,showValues:G,graphID:X,onSeriesMouseClick:W,graphDownload:R,dataDownload:tt,fillContainer:kt,language:Y,minHeight:O,theme:E,ariaLabel:n,sourceColors:l,targetColors:s,sourceColorDomain:u,targetColorDomain:i,nodePadding:f,nodeWidth:v,highlightedSourceDataPoints:C,highlightedTargetDataPoints:T,defaultLinkOpacity:V,sourceTitle:I,targetTitle:U,sortNodes:Z,resetSelectionOnDoubleClick:St,detailsOnClick:Rt,styles:L,classNames:m,animate:wt,precision:$t,customLayers:et}=e,lt=h===void 0?!0:h,at=g===void 0?75:g,_=y===void 0?75:y,ut=k===void 0?30:k,ct=b===void 0?10:b,Q=$===void 0?999:$,J=H===void 0?!1:H,ft=B===void 0?"":B,ht=z===void 0?"":z,K=G===void 0?!0:G,nt=R===void 0?!1:R,ot=tt===void 0?!1:tt,it=kt===void 0?!0:kt,gt=Y===void 0?"en":Y,dt=O===void 0?0:O,pt=E===void 0?"light":E,mt=f===void 0?5:f,xt=v===void 0?5:v;let rt;t[0]!==C?(rt=C===void 0?[]:C,t[0]=C,t[1]=rt):rt=t[1];const yt=rt;let st;t[2]!==T?(st=T===void 0?[]:T,t[2]=T,t[3]=st):st=t[3];const Et=st,It=V===void 0?.3:V,N=Z===void 0?"mostReadable":Z,Vt=St===void 0?!0:St,Nt=wt===void 0?!1:wt,Lt=$t===void 0?2:$t;let bt;t[4]!==et?(bt=et===void 0?[]:et,t[4]=et,t[5]=bt):bt=t[5];const Mt=bt,[c,vt]=A.useState(0),[jt,Me]=A.useState(0),[At,Se]=A.useState(void 0),Jt=A.useRef(null),he=A.useRef(null);let Ht;t[6]===Symbol.for("react.memo_cache_sentinel")?(Ht=Ot=>{Se(Ot)},t[6]=Ht):Ht=t[6];const Kt=A.useEffectEvent(Ht);let Gt;t[7]!==o||t[8]!==N||t[9]!==u||t[10]!==l||t[11]!==i||t[12]!==s||t[13]!==Kt?(Gt=()=>{const Ot=zt.uniqBy(o,"source",!0).map(q=>({name:`source_${q}`,type:"source",label:`${q}`,color:typeof l=="string"||!l?l||xe.Colors.graphMainColor:l[(u||zt.uniqBy(o,"source",!0)).findIndex(P=>`${P}`==`${q}`)>l.length?l.length-1:(u||zt.uniqBy(o,"source",!0)).findIndex(P=>`${P}`==`${q}`)],totalValue:de.sum(o.filter(P=>`${P.source}`==`${q}`).map(kn))})),Ut=N==="asc"||N==="desc"?pe.orderBy(Ot,["totalValue"],[N]):Ot,ge=zt.uniqBy(o,"target",!0).map(q=>({name:`target_${q}`,type:"target",label:`${q}`,color:typeof s=="string"||!s?s||xe.Colors.graphMainColor:s[(i||zt.uniqBy(o,"target",!0)).findIndex(P=>`${P}`==`${q}`)>s.length?s.length-1:(i||zt.uniqBy(o,"target",!0)).findIndex(P=>`${P}`==`${q}`)],totalValue:de.sum(o.filter(P=>`${P.target}`==`${q}`).map(jn))})),Re=N==="asc"||N==="desc"?pe.orderBy(ge,["totalValue"],[N]):ge,oe=[...Ut,...Re];Kt({nodes:oe,links:o.map(q=>({source:oe.findIndex(P=>P.name===`source_${q.source}`),target:oe.findIndex(P=>P.name===`target_${q.target}`),value:q.value,data:{...q}}))})},t[7]=o,t[8]=N,t[9]=u,t[10]=l,t[11]=i,t[12]=s,t[13]=Kt,t[14]=Gt):Gt=t[14];let Wt;t[15]!==o||t[16]!==N||t[17]!==u||t[18]!==l||t[19]!==i||t[20]!==s?(Wt=[o,N,u,l,i,s],t[15]=o,t[16]=N,t[17]=u,t[18]=l,t[19]=i,t[20]=s,t[21]=Wt):Wt=t[21],A.useEffect(Gt,Wt);let Ft,Xt;t[22]===Symbol.for("react.memo_cache_sentinel")?(Ft=()=>{const Ot=new ResizeObserver(Ut=>{vt(Ut[0].target.clientWidth||620),Me(Ut[0].target.clientHeight||480)});return Jt.current&&Ot.observe(Jt.current),()=>Ot.disconnect()},Xt=[],t[22]=Ft,t[23]=Xt):(Ft=t[22],Xt=t[23]),A.useEffect(Ft,Xt);const te=m?.graphContainer,ee=L?.graphContainer,ne=it?void 0:j;let Dt;t[24]!==m?.description||t[25]!==m?.title||t[26]!==o||t[27]!==ot||t[28]!==x||t[29]!==nt||t[30]!==r||t[31]!==L?.description||t[32]!==L?.title||t[33]!==j?(Dt=r||x||nt||ot?d.jsxRuntimeExports.jsx(Te.GraphHeader,{styles:{title:L?.title,description:L?.description},classNames:{title:m?.title,description:m?.description},graphTitle:r,graphDescription:x,width:j,graphDownload:nt?he:void 0,dataDownload:ot?o.map(vn).filter(yn).length>0?o.map(xn).filter(mn):o.filter(pn):null}):null,t[24]=m?.description,t[25]=m?.title,t[26]=o,t[27]=ot,t[28]=x,t[29]=nt,t[30]=r,t[31]=L?.description,t[32]=L?.title,t[33]=j,t[34]=Dt):Dt=t[34];let Tt;t[35]!==o.length?(Tt=o.length===0&&d.jsxRuntimeExports.jsx(Pe.EmptyState,{}),t[35]=o.length,t[36]=Tt):Tt=t[36];let qt;t[37]!==Nt||t[38]!==ct||t[39]!==m||t[40]!==Mt||t[41]!==o.length||t[42]!==It||t[43]!==Rt||t[44]!==it||t[45]!==yt||t[46]!==Et||t[47]!==at||t[48]!==mt||t[49]!==xt||t[50]!==W||t[51]!==S||t[52]!==Lt||t[53]!==ht||t[54]!==Vt||t[55]!==_||t[56]!==At||t[57]!==lt||t[58]!==K||t[59]!==N||t[60]!==I||t[61]!==L||t[62]!==ft||t[63]!==jt||t[64]!==c||t[65]!==U||t[66]!==w||t[67]!==ut||t[68]!==Q||t[69]!==j?(qt=c&&jt&&At&&o.length>0?d.jsxRuntimeExports.jsx(nn,{data:At,nodePadding:mt,nodeWidth:xt,width:it||!j||c<j?c:j,height:jt,showLabels:lt,leftMargin:at,rightMargin:_,topMargin:ut,bottomMargin:ct,truncateBy:Q,tooltip:w,onSeriesMouseOver:S,showValues:K,suffix:ft,prefix:ht,onSeriesMouseClick:W,id:Be.generateRandomString(8),highlightedSourceDataPoints:yt.map(dn),highlightedTargetDataPoints:Et.map(gn),defaultLinkOpacity:It,sourceTitle:I,targetTitle:U,sortNodes:N,resetSelectionOnDoubleClick:Vt,styles:L,classNames:m,detailsOnClick:Rt,animate:Nt===!0?{duration:.5,once:!0,amount:.5}:Nt||{duration:0,once:!0,amount:0},precision:Lt,customLayers:Mt}):null,t[37]=Nt,t[38]=ct,t[39]=m,t[40]=Mt,t[41]=o.length,t[42]=It,t[43]=Rt,t[44]=it,t[45]=yt,t[46]=Et,t[47]=at,t[48]=mt,t[49]=xt,t[50]=W,t[51]=S,t[52]=Lt,t[53]=ht,t[54]=Vt,t[55]=_,t[56]=At,t[57]=lt,t[58]=K,t[59]=N,t[60]=I,t[61]=L,t[62]=ft,t[63]=jt,t[64]=c,t[65]=U,t[66]=w,t[67]=ut,t[68]=Q,t[69]=j,t[70]=qt):qt=t[70];let Bt;t[71]!==Tt||t[72]!==qt?(Bt=d.jsxRuntimeExports.jsxs(ye.GraphArea,{ref:Jt,children:[Tt,qt]}),t[71]=Tt,t[72]=qt,t[73]=Bt):Bt=t[73];let Pt;t[74]!==m?.footnote||t[75]!==m?.source||t[76]!==p||t[77]!==a||t[78]!==L?.footnote||t[79]!==L?.source||t[80]!==j?(Pt=a||p?d.jsxRuntimeExports.jsx(qe.GraphFooter,{styles:{footnote:L?.footnote,source:L?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:a,footNote:p,width:j}):null,t[74]=m?.footnote,t[75]=m?.source,t[76]=p,t[77]=a,t[78]=L?.footnote,t[79]=L?.source,t[80]=j,t[81]=Pt):Pt=t[81];let Yt;return t[82]!==n||t[83]!==J||t[84]!==X||t[85]!==D||t[86]!==gt||t[87]!==dt||t[88]!==M||t[89]!==F||t[90]!==te||t[91]!==ee||t[92]!==ne||t[93]!==Dt||t[94]!==Bt||t[95]!==Pt||t[96]!==pt?(Yt=d.jsxRuntimeExports.jsxs(ye.GraphContainer,{className:te,style:ee,id:X,ref:he,"aria-label":n,backgroundColor:J,theme:pt,language:gt,minHeight:dt,width:ne,height:D,relativeHeight:F,padding:M,children:[Dt,Bt,Pt]}),t[82]=n,t[83]=J,t[84]=X,t[85]=D,t[86]=gt,t[87]=dt,t[88]=M,t[89]=F,t[90]=te,t[91]=ee,t[92]=ne,t[93]=Dt,t[94]=Bt,t[95]=Pt,t[96]=pt,t[97]=Yt):Yt=t[97],Yt}function gn(e){return`${e}`}function dn(e){return`${e}`}function pn(e){return e!==void 0}function mn(e){return e!==void 0}function xn(e){return e.data}function yn(e){return e!==void 0}function vn(e){return e.data}function jn(e){return e.value}function kn(e){return e.value}exports.SankeyChart=hn;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-CHPV5EwG-6v2a2njQ.cjs"),A=require("react"),de=require("./index-CSNtgibC.cjs"),pe=require("./index-Cno4Q0YE.cjs"),Oe=require("./index-DQA8q5sC.cjs"),Ut=require("./Typography-DrJ7IOdw.cjs"),me=require("./numberFormattingFunction-02t-wJta.cjs"),Ce=require("./Tooltip-BLa2EfMs.cjs"),Ve=require("./DetailsModal-DHttOA80.cjs"),ie=require("./proxy-C4-uo6nS.cjs"),Ne=require("./use-in-view-C3o_ntMv.cjs"),De=require("./index-CoobIWNj.cjs"),Te=require("./GraphHeader.cjs"),qe=require("./GraphFooter.cjs"),xe=require("./Colors.cjs"),Be=require("./generateRandomString-B5zBiJzS.cjs"),Pe=require("./EmptyState-DX0t62iF.cjs"),zt=require("./uniqBy-O05lp2S5.cjs"),ye=require("./GraphContainer-B1EDxJ0S.cjs");function ve(e,t){let o;if(t===void 0)for(const r of e)r!=null&&(o<r||o===void 0&&r>=r)&&(o=r);else{let r=-1;for(let a of e)(a=t(a,++r,e))!=null&&(o<a||o===void 0&&a>=a)&&(o=a)}return o}function Ee(e,t){let o;if(t===void 0)for(const r of e)r!=null&&(o>r||o===void 0&&r>=r)&&(o=r);else{let r=-1;for(let a of e)(a=t(a,++r,e))!=null&&(o>a||o===void 0&&a>=a)&&(o=a)}return o}function re(e,t){let o=0;if(t===void 0)for(let r of e)(r=+r)&&(o+=r);else{let r=-1;for(let a of e)(a=+t(a,++r,e))&&(o+=a)}return o}function ze(e){return e.target.depth}function Ie(e,t){return e.sourceLinks.length?e.depth:t-1}function se(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?Ee(e.sourceLinks,ze)-1:0}function Zt(e){return function(){return e}}function je(e,t){return Qt(e.source,t.source)||e.index-t.index}function ke(e,t){return Qt(e.target,t.target)||e.index-t.index}function Qt(e,t){return e.y0-t.y0}function le(e){return e.value}function Ae(e){return e.index}function He(e){return e.nodes}function Ge(e){return e.links}function be(e,t){const o=e.get(t);if(!o)throw new Error("missing: "+t);return o}function we({nodes:e}){for(const t of e){let o=t.y0,r=o;for(const a of t.sourceLinks)a.y0=o+a.width/2,o+=a.width;for(const a of t.targetLinks)a.y1=r+a.width/2,r+=a.width}}function ae(){let e=0,t=0,o=1,r=1,a=24,x=8,h,g=Ae,y=Ie,k,b,$=He,D=Ge,j=6;function p(){const n={nodes:$.apply(null,arguments),links:D.apply(null,arguments)};return M(n),H(n),w(n),S(n),F(n),we(n),n}p.update=function(n){return we(n),n},p.nodeId=function(n){return arguments.length?(g=typeof n=="function"?n:Zt(n),p):g},p.nodeAlign=function(n){return arguments.length?(y=typeof n=="function"?n:Zt(n),p):y},p.nodeSort=function(n){return arguments.length?(k=n,p):k},p.nodeWidth=function(n){return arguments.length?(a=+n,p):a},p.nodePadding=function(n){return arguments.length?(x=h=+n,p):x},p.nodes=function(n){return arguments.length?($=typeof n=="function"?n:Zt(n),p):$},p.links=function(n){return arguments.length?(D=typeof n=="function"?n:Zt(n),p):D},p.linkSort=function(n){return arguments.length?(b=n,p):b},p.size=function(n){return arguments.length?(e=t=0,o=+n[0],r=+n[1],p):[o-e,r-t]},p.extent=function(n){return arguments.length?(e=+n[0][0],o=+n[1][0],t=+n[0][1],r=+n[1][1],p):[[e,t],[o,r]]},p.iterations=function(n){return arguments.length?(j=+n,p):j};function M({nodes:n,links:l}){for(const[u,i]of n.entries())i.index=u,i.sourceLinks=[],i.targetLinks=[];const s=new Map(n.map((u,i)=>[g(u,i,n),u]));for(const[u,i]of l.entries()){i.index=u;let{source:f,target:v}=i;typeof f!="object"&&(f=i.source=be(s,f)),typeof v!="object"&&(v=i.target=be(s,v)),f.sourceLinks.push(i),v.targetLinks.push(i)}if(b!=null)for(const{sourceLinks:u,targetLinks:i}of n)u.sort(b),i.sort(b)}function H({nodes:n}){for(const l of n)l.value=l.fixedValue===void 0?Math.max(re(l.sourceLinks,le),re(l.targetLinks,le)):l.fixedValue}function w({nodes:n}){const l=n.length;let s=new Set(n),u=new Set,i=0;for(;s.size;){for(const f of s){f.depth=i;for(const{target:v}of f.sourceLinks)u.add(v)}if(++i>l)throw new Error("circular link");s=u,u=new Set}}function S({nodes:n}){const l=n.length;let s=new Set(n),u=new Set,i=0;for(;s.size;){for(const f of s){f.height=i;for(const{source:v}of f.targetLinks)u.add(v)}if(++i>l)throw new Error("circular link");s=u,u=new Set}}function B({nodes:n}){const l=ve(n,i=>i.depth)+1,s=(o-e-a)/(l-1),u=new Array(l);for(const i of n){const f=Math.max(0,Math.min(l-1,Math.floor(y.call(null,i,l))));i.layer=f,i.x0=e+f*s,i.x1=i.x0+a,u[f]?u[f].push(i):u[f]=[i]}if(k)for(const i of u)i.sort(k);return u}function z(n){const l=Ee(n,s=>(r-t-(s.length-1)*h)/re(s,le));for(const s of n){let u=t;for(const i of s){i.y0=u,i.y1=u+i.value*l,u=i.y1+h;for(const f of i.sourceLinks)f.width=f.value*l}u=(r-u+h)/(s.length+1);for(let i=0;i<s.length;++i){const f=s[i];f.y0+=u*(i+1),f.y1+=u*(i+1)}X(s)}}function F(n){const l=B(n);h=Math.min(x,(r-t)/(ve(l,s=>s.length)-1)),z(l);for(let s=0;s<j;++s){const u=Math.pow(.99,s),i=Math.max(1-u,(s+1)/j);_(l,u,i),G(l,u,i)}}function G(n,l,s){for(let u=1,i=n.length;u<i;++u){const f=n[u];for(const v of f){let C=0,T=0;for(const{source:I,value:Y}of v.targetLinks){let U=Y*(v.layer-I.layer);C+=O(I,v)*U,T+=U}if(!(T>0))continue;let V=(C/T-v.y0)*l;v.y0+=V,v.y1+=V,kt(v)}k===void 0&&f.sort(Qt),W(f,s)}}function _(n,l,s){for(let u=n.length,i=u-2;i>=0;--i){const f=n[i];for(const v of f){let C=0,T=0;for(const{target:I,value:Y}of v.sourceLinks){let U=Y*(I.layer-v.layer);C+=E(v,I)*U,T+=U}if(!(T>0))continue;let V=(C/T-v.y0)*l;v.y0+=V,v.y1+=V,kt(v)}k===void 0&&f.sort(Qt),W(f,s)}}function W(n,l){const s=n.length>>1,u=n[s];tt(n,u.y0-h,s-1,l),R(n,u.y1+h,s+1,l),tt(n,r,n.length-1,l),R(n,t,0,l)}function R(n,l,s,u){for(;s<n.length;++s){const i=n[s],f=(l-i.y0)*u;f>1e-6&&(i.y0+=f,i.y1+=f),l=i.y1+h}}function tt(n,l,s,u){for(;s>=0;--s){const i=n[s],f=(i.y1-l)*u;f>1e-6&&(i.y0-=f,i.y1-=f),l=i.y0-h}}function kt({sourceLinks:n,targetLinks:l}){if(b===void 0){for(const{source:{sourceLinks:s}}of l)s.sort(ke);for(const{target:{targetLinks:s}}of n)s.sort(je)}}function X(n){if(b===void 0)for(const{sourceLinks:l,targetLinks:s}of n)l.sort(ke),s.sort(je)}function O(n,l){let s=n.y0-(n.sourceLinks.length-1)*h/2;for(const{target:u,width:i}of n.sourceLinks){if(u===l)break;s+=i+h}for(const{source:u,width:i}of l.targetLinks){if(u===n)break;s-=i}return s}function E(n,l){let s=l.y0-(l.targetLinks.length-1)*h/2;for(const{source:u,width:i}of l.targetLinks){if(u===n)break;s+=i+h}for(const{target:u,width:i}of n.sourceLinks){if(u===l)break;s-=i}return s}return p}var ue=Math.PI,ce=2*ue,Ct=1e-6,We=ce-Ct;function fe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Le(){return new fe}fe.prototype=Le.prototype={constructor:fe,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,o,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+o)+","+(this._y1=+r)},bezierCurveTo:function(e,t,o,r,a,x){this._+="C"+ +e+","+ +t+","+ +o+","+ +r+","+(this._x1=+a)+","+(this._y1=+x)},arcTo:function(e,t,o,r,a){e=+e,t=+t,o=+o,r=+r,a=+a;var x=this._x1,h=this._y1,g=o-e,y=r-t,k=x-e,b=h-t,$=k*k+b*b;if(a<0)throw new Error("negative radius: "+a);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if($>Ct)if(!(Math.abs(b*g-y*k)>Ct)||!a)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var D=o-x,j=r-h,p=g*g+y*y,M=D*D+j*j,H=Math.sqrt(p),w=Math.sqrt($),S=a*Math.tan((ue-Math.acos((p+$-M)/(2*H*w)))/2),B=S/w,z=S/H;Math.abs(B-1)>Ct&&(this._+="L"+(e+B*k)+","+(t+B*b)),this._+="A"+a+","+a+",0,0,"+ +(b*D>k*j)+","+(this._x1=e+z*g)+","+(this._y1=t+z*y)}},arc:function(e,t,o,r,a,x){e=+e,t=+t,o=+o,x=!!x;var h=o*Math.cos(r),g=o*Math.sin(r),y=e+h,k=t+g,b=1^x,$=x?r-a:a-r;if(o<0)throw new Error("negative radius: "+o);this._x1===null?this._+="M"+y+","+k:(Math.abs(this._x1-y)>Ct||Math.abs(this._y1-k)>Ct)&&(this._+="L"+y+","+k),o&&($<0&&($=$%ce+ce),$>We?this._+="A"+o+","+o+",0,1,"+b+","+(e-h)+","+(t-g)+"A"+o+","+o+",0,1,"+b+","+(this._x1=y)+","+(this._y1=k):$>Ct&&(this._+="A"+o+","+o+",0,"+ +($>=ue)+","+b+","+(this._x1=e+o*Math.cos(a))+","+(this._y1=t+o*Math.sin(a))))},rect:function(e,t,o,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +o+"v"+ +r+"h"+-o+"Z"},toString:function(){return this._}};function $e(e){return function(){return e}}function Fe(e){return e[0]}function _e(e){return e[1]}var Xe=Array.prototype.slice;function Ye(e){return e.source}function Ue(e){return e.target}function Ze(e){var t=Ye,o=Ue,r=Fe,a=_e,x=null;function h(){var g,y=Xe.call(arguments),k=t.apply(this,y),b=o.apply(this,y);if(x||(x=g=Le()),e(x,+r.apply(this,(y[0]=k,y)),+a.apply(this,y),+r.apply(this,(y[0]=b,y)),+a.apply(this,y)),g)return x=null,g+""||null}return h.source=function(g){return arguments.length?(t=g,h):t},h.target=function(g){return arguments.length?(o=g,h):o},h.x=function(g){return arguments.length?(r=typeof g=="function"?g:$e(+g),h):r},h.y=function(g){return arguments.length?(a=typeof g=="function"?g:$e(+g),h):a},h.context=function(g){return arguments.length?(x=g??null,h):x},h}function Qe(e,t,o,r,a){e.moveTo(t,o),e.bezierCurveTo(t=(t+r)/2,o,t,a,r,a)}function Je(){return Ze(Qe)}function Ke(e){return[e.source.x1,e.y0]}function tn(e){return[e.target.x0,e.y1]}function en(){return Je().source(Ke).target(tn)}function nn(e){const t=d.compilerRuntimeExports.c(136),{data:o,showLabels:r,leftMargin:a,rightMargin:x,truncateBy:h,width:g,height:y,topMargin:k,bottomMargin:b,tooltip:$,onSeriesMouseOver:D,suffix:j,prefix:p,showValues:M,onSeriesMouseClick:H,nodePadding:w,nodeWidth:S,id:B,highlightedSourceDataPoints:z,highlightedTargetDataPoints:F,defaultLinkOpacity:G,sourceTitle:_,targetTitle:W,animate:R,sortNodes:tt,resetSelectionOnDoubleClick:kt,detailsOnClick:X,styles:O,classNames:E,precision:n,customLayers:l}=e,s=A.useRef(null);let u;t[0]!==R.amount||t[1]!==R.once?(u={once:R.once,amount:R.amount},t[0]=R.amount,t[1]=R.once,t[2]=u):u=t[2];const i=Ne.useInView(s,u),[f,v]=A.useState(void 0),[C,T]=A.useState(void 0),[V,I]=A.useState(void 0),[Y,U]=A.useState(void 0),[St,Rt]=A.useState(void 0);let L;t[3]!==b||t[4]!==a||t[5]!==x||t[6]!==k?(L={top:k,bottom:b,left:a,right:x},t[3]=b,t[4]=a,t[5]=x,t[6]=k,t[7]=L):L=t[7];const m=L,wt=g-m.left-m.right,$t=y-m.top-m.bottom;let et,lt,at,Z,ut,ct,Q,J,ft,ht,K,nt,ot,it,gt,dt;if(t[8]!==R.duration||t[9]!==E?.graphObjectValues||t[10]!==l||t[11]!==o||t[12]!==G||t[13]!==X||t[14]!==$t||t[15]!==wt||t[16]!==y||t[17]!==z||t[18]!==F||t[19]!==B||t[20]!==i||t[21]!==a||t[22]!==m.left||t[23]!==m.right||t[24]!==m.top||t[25]!==C||t[26]!==w||t[27]!==S||t[28]!==H||t[29]!==D||t[30]!==n||t[31]!==p||t[32]!==kt||t[33]!==x||t[34]!==V||t[35]!==r||t[36]!==M||t[37]!==tt||t[38]!==_||t[39]!==O?.graphObjectValues||t[40]!==j||t[41]!==W||t[42]!==h||t[43]!==g){const It=tt==="mostReadable"?ae().nodeWidth(S).nodePadding(w).size([wt,$t]).nodeAlign(se):tt==="none"?ae().nodeWidth(S).nodePadding(w).size([wt,$t]).nodeAlign(se).nodeSort(null).linkSort(null):ae().nodeWidth(S).nodePadding(w).size([wt,$t]).nodeAlign(se).nodeSort(tt==="desc"?fn:cn),{nodes:N,links:Vt}=It(o),Nt=en();lt=ie.motion.svg,gt=`${g}px`,dt=`${y}px`,at=`0 0 ${g} ${y}`,t[60]===Symbol.for("react.memo_cache_sentinel")?(Z={marginLeft:"auto",marginRight:"auto"},t[60]=Z):Z=t[60],ut="ltr",ct=s,t[61]!==m.left||t[62]!==m.top||t[63]!==_?(Q=_?d.jsxRuntimeExports.jsx("text",{x:m.left,y:m.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"start"},children:_}):null,t[61]=m.left,t[62]=m.top,t[63]=_,t[64]=Q):Q=t[64],t[65]!==m.right||t[66]!==m.top||t[67]!==W||t[68]!==g?(J=W?d.jsxRuntimeExports.jsx("text",{x:g-m.right,y:m.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"end"},children:W}):null,t[65]=m.right,t[66]=m.top,t[67]=W,t[68]=g,t[69]=J):J=t[69],ht=`translate(${m.left},${m.top})`,t[70]!==l?(K=l.filter(un).map(an),t[70]=l,t[71]=K):K=t[71];let Lt;t[72]!==E?.graphObjectValues||t[73]!==a||t[74]!==w||t[75]!==n||t[76]!==p||t[77]!==r||t[78]!==M||t[79]!==O?.graphObjectValues||t[80]!==j||t[81]!==h?(Lt=(c,vt)=>d.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{I(c)},onMouseLeave:()=>{I(void 0)},children:d.jsxRuntimeExports.jsxs("g",{transform:`translate(${c.x0},${c.y0})`,children:[d.jsxRuntimeExports.jsx("rect",{x:0,y:0,width:(c.x1||0)-(c.x0||0),height:(c.y1||0)-(c.y0||0),style:{fill:c.color}}),r||M?d.jsxRuntimeExports.jsx("foreignObject",{y:0-w/2,x:0-a,width:a,height:(c.y1||0)-(c.y0||0)+w,children:d.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(c.y1||0)-(c.y0||0)+w}px`,overflow:"visible"},children:[r?d.jsxRuntimeExports.jsx(Ut._,{marginBottom:M?"3xs":"none",size:"sm",leading:"none",className:d.mo("sankey-right-label text-right",E?.graphObjectValues),style:{hyphens:"auto",color:c.color,...O?.graphObjectValues},children:`${c.label}`.length<h?`${c.label}`:`${`${c.label}`.substring(0,h)}...`}):null,M?d.jsxRuntimeExports.jsx(Ut._,{marginBottom:"none",size:"sm",leading:"none",className:d.mo("sankey-right-value text-right font-bold",E?.graphObjectValues),style:{hyphens:"auto",color:c.color,...O?.graphObjectValues},children:me.numberFormattingFunction(c.value,"NA",n,p,j)}):null]})}):null]})},vt),t[72]=E?.graphObjectValues,t[73]=a,t[74]=w,t[75]=n,t[76]=p,t[77]=r,t[78]=M,t[79]=O?.graphObjectValues,t[80]=j,t[81]=h,t[82]=Lt):Lt=t[82],nt=N.filter(ln).map(Lt);let bt;t[83]!==E?.graphObjectValues||t[84]!==w||t[85]!==S||t[86]!==n||t[87]!==p||t[88]!==x||t[89]!==r||t[90]!==M||t[91]!==O?.graphObjectValues||t[92]!==j||t[93]!==h?(bt=(c,vt)=>d.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{I(c)},onMouseLeave:()=>{I(void 0)},children:d.jsxRuntimeExports.jsxs("g",{transform:`translate(${c.x0},${c.y0})`,children:[d.jsxRuntimeExports.jsx("rect",{x:0,y:0,width:(c.x1||0)-(c.x0||0),height:(c.y1||0)-(c.y0||0),style:{fill:c.color}}),r||M?d.jsxRuntimeExports.jsx("foreignObject",{y:0-w/2,x:S,width:x-S,height:(c.y1||0)-(c.y0||0)+w,children:d.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(c.y1||0)-(c.y0||0)+w}px`},children:[r?d.jsxRuntimeExports.jsx(Ut._,{marginBottom:M?"3xs":"none",size:"sm",leading:"none",className:d.mo("sankey-left-label text-left",E?.graphObjectValues),style:{hyphens:"auto",color:c.color,...O?.graphObjectValues},children:`${c.label}`.length<h?`${c.label}`:`${`${c.label}`.substring(0,h)}...`}):null,M?d.jsxRuntimeExports.jsx(Ut._,{size:"sm",leading:"none",marginBottom:"none",className:d.mo("sankey-left-value text-left font-bold",E?.graphObjectValues),style:{hyphens:"auto",color:c.color,...O?.graphObjectValues},children:me.numberFormattingFunction(c.value,"NA",n,p,j)}):null]})}):null]})},vt),t[83]=E?.graphObjectValues,t[84]=w,t[85]=S,t[86]=n,t[87]=p,t[88]=x,t[89]=r,t[90]=M,t[91]=O?.graphObjectValues,t[92]=j,t[93]=h,t[94]=bt):bt=t[94],ot=N.filter(sn).map(bt);let Mt;t[95]!==B?(Mt=(c,vt)=>d.jsxRuntimeExports.jsxs("linearGradient",{id:`${B}-gradient-${vt}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientUnits:"userSpaceOnUse",children:[d.jsxRuntimeExports.jsx("stop",{offset:"0%",style:{stopColor:c.source.color,stopOpacity:1}}),d.jsxRuntimeExports.jsx("stop",{offset:"100%",style:{stopColor:c.target.color,stopOpacity:1}})]},vt),t[95]=B,t[96]=Mt):Mt=t[96],it=d.jsxRuntimeExports.jsx("defs",{children:Vt.map(Mt)}),et=De.AnimatePresence,ft=Vt.map((c,vt)=>d.jsxRuntimeExports.jsx(ie.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:jt=>{v(c.data),Rt(jt.clientY),U(jt.clientX),D?.(c)},onMouseMove:jt=>{v(c.data),Rt(jt.clientY),U(jt.clientX)},onClick:()=>{(H||X)&&(Oe.isEqual(C,c.data)&&kt?(T(void 0),H?.(void 0)):(T(c.data),H?.(c.data)))},onMouseLeave:()=>{v(void 0),U(void 0),Rt(void 0),D?.(void 0)},variants:{initial:{opacity:V?c.source.name===V.name||c.target.name===V.name?.85:G:(z.length!==0||F.length!==0)&&(z.indexOf(c.source.label)!==-1||F.indexOf(c.target.label)!==-1)?.85:G},whileInView:{opacity:V?c.source.name===V.name||c.target.name===V.name?.85:G:(z.length!==0||F.length!==0)&&(z.indexOf(c.source.label)!==-1||F.indexOf(c.target.label)!==-1)?.85:G,transition:{duration:R.duration}}},initial:"initial",animate:i?"whileInView":"initial",exit:{opacity:0,transition:{duration:R.duration}},children:d.jsxRuntimeExports.jsx(ie.motion.path,{d:Nt(c)||"",style:{stroke:`url(#${B}-gradient-${vt})`,strokeWidth:c.width,fill:"none"},exit:{opacity:0,transition:{duration:R.duration}},variants:{initial:{pathLength:0,opacity:1},whileInView:{pathLength:1,opacity:1,transition:{duration:R.duration}}},initial:"initial",animate:i?"whileInView":"initial"},`${c.source}-${c.target}`)},`${c.source}-${c.target}`)),t[8]=R.duration,t[9]=E?.graphObjectValues,t[10]=l,t[11]=o,t[12]=G,t[13]=X,t[14]=$t,t[15]=wt,t[16]=y,t[17]=z,t[18]=F,t[19]=B,t[20]=i,t[21]=a,t[22]=m.left,t[23]=m.right,t[24]=m.top,t[25]=C,t[26]=w,t[27]=S,t[28]=H,t[29]=D,t[30]=n,t[31]=p,t[32]=kt,t[33]=x,t[34]=V,t[35]=r,t[36]=M,t[37]=tt,t[38]=_,t[39]=O?.graphObjectValues,t[40]=j,t[41]=W,t[42]=h,t[43]=g,t[44]=et,t[45]=lt,t[46]=at,t[47]=Z,t[48]=ut,t[49]=ct,t[50]=Q,t[51]=J,t[52]=ft,t[53]=ht,t[54]=K,t[55]=nt,t[56]=ot,t[57]=it,t[58]=gt,t[59]=dt}else et=t[44],lt=t[45],at=t[46],Z=t[47],ut=t[48],ct=t[49],Q=t[50],J=t[51],ft=t[52],ht=t[53],K=t[54],nt=t[55],ot=t[56],it=t[57],gt=t[58],dt=t[59];let pt;t[97]!==et||t[98]!==ft?(pt=d.jsxRuntimeExports.jsx("g",{children:d.jsxRuntimeExports.jsx(et,{children:ft})}),t[97]=et,t[98]=ft,t[99]=pt):pt=t[99];let mt;t[100]!==l?(mt=l.filter(rn).map(on),t[100]=l,t[101]=mt):mt=t[101];let xt;t[102]!==pt||t[103]!==mt||t[104]!==ht||t[105]!==K||t[106]!==nt||t[107]!==ot||t[108]!==it?(xt=d.jsxRuntimeExports.jsxs("g",{transform:ht,children:[K,nt,ot,it,pt,mt]}),t[102]=pt,t[103]=mt,t[104]=ht,t[105]=K,t[106]=nt,t[107]=ot,t[108]=it,t[109]=xt):xt=t[109];let rt;t[110]!==lt||t[111]!==at||t[112]!==Z||t[113]!==ut||t[114]!==ct||t[115]!==Q||t[116]!==J||t[117]!==xt||t[118]!==gt||t[119]!==dt?(rt=d.jsxRuntimeExports.jsxs(lt,{width:gt,height:dt,viewBox:at,style:Z,direction:ut,ref:ct,children:[Q,J,xt]}),t[110]=lt,t[111]=at,t[112]=Z,t[113]=ut,t[114]=ct,t[115]=Q,t[116]=J,t[117]=xt,t[118]=gt,t[119]=dt,t[120]=rt):rt=t[120];let yt;t[121]!==E?.tooltip||t[122]!==Y||t[123]!==St||t[124]!==f||t[125]!==O?.tooltip||t[126]!==$?(yt=f&&$&&Y&&St?d.jsxRuntimeExports.jsx(Ce.Tooltip,{data:f,body:$,xPos:Y,yPos:St,backgroundStyle:O?.tooltip,className:E?.tooltip}):null,t[121]=E?.tooltip,t[122]=Y,t[123]=St,t[124]=f,t[125]=O?.tooltip,t[126]=$,t[127]=yt):yt=t[127];let st;t[128]!==E?.modal||t[129]!==X||t[130]!==C?(st=X&&C!==void 0?d.jsxRuntimeExports.jsx(Ve.DetailsModal,{body:X,data:C,setData:T,className:E?.modal}):null,t[128]=E?.modal,t[129]=X,t[130]=C,t[131]=st):st=t[131];let Et;return t[132]!==rt||t[133]!==yt||t[134]!==st?(Et=d.jsxRuntimeExports.jsxs(d.jsxRuntimeExports.Fragment,{children:[rt,yt,st]}),t[132]=rt,t[133]=yt,t[134]=st,t[135]=Et):Et=t[135],Et}function on(e){return e.layer}function rn(e){return e.position==="after"}function sn(e){return e.type==="target"}function ln(e){return e.type==="source"}function an(e){return e.layer}function un(e){return e.position==="before"}function cn(e,t){return(e.value||0)-(t.value||0)}function fn(e,t){return(t.value||0)-(e.value||0)}function hn(e){const t=d.compilerRuntimeExports.c(98),{data:o,graphTitle:r,sources:a,graphDescription:x,showLabels:h,leftMargin:g,rightMargin:y,topMargin:k,bottomMargin:b,truncateBy:$,height:D,width:j,footNote:p,padding:M,backgroundColor:H,tooltip:w,onSeriesMouseOver:S,suffix:B,prefix:z,relativeHeight:F,showValues:G,graphID:_,onSeriesMouseClick:W,graphDownload:R,dataDownload:tt,fillContainer:kt,language:X,minHeight:O,theme:E,ariaLabel:n,sourceColors:l,targetColors:s,sourceColorDomain:u,targetColorDomain:i,nodePadding:f,nodeWidth:v,highlightedSourceDataPoints:C,highlightedTargetDataPoints:T,defaultLinkOpacity:V,sourceTitle:I,targetTitle:Y,sortNodes:U,resetSelectionOnDoubleClick:St,detailsOnClick:Rt,styles:L,classNames:m,animate:wt,precision:$t,customLayers:et}=e,lt=h===void 0?!0:h,at=g===void 0?75:g,Z=y===void 0?75:y,ut=k===void 0?30:k,ct=b===void 0?10:b,Q=$===void 0?999:$,J=H===void 0?!1:H,ft=B===void 0?"":B,ht=z===void 0?"":z,K=G===void 0?!0:G,nt=R===void 0?!1:R,ot=tt===void 0?!1:tt,it=kt===void 0?!0:kt,gt=X===void 0?"en":X,dt=O===void 0?0:O,pt=E===void 0?"light":E,mt=f===void 0?5:f,xt=v===void 0?5:v;let rt;t[0]!==C?(rt=C===void 0?[]:C,t[0]=C,t[1]=rt):rt=t[1];const yt=rt;let st;t[2]!==T?(st=T===void 0?[]:T,t[2]=T,t[3]=st):st=t[3];const Et=st,It=V===void 0?.3:V,N=U===void 0?"mostReadable":U,Vt=St===void 0?!0:St,Nt=wt===void 0?!1:wt,Lt=$t===void 0?2:$t;let bt;t[4]!==et?(bt=et===void 0?[]:et,t[4]=et,t[5]=bt):bt=t[5];const Mt=bt,[c,vt]=A.useState(0),[jt,Me]=A.useState(0),[At,Se]=A.useState(void 0),Jt=A.useRef(null),he=A.useRef(null);let Ht;t[6]===Symbol.for("react.memo_cache_sentinel")?(Ht=Ot=>{Se(Ot)},t[6]=Ht):Ht=t[6];const Kt=A.useEffectEvent(Ht);let Gt;t[7]!==o||t[8]!==N||t[9]!==u||t[10]!==l||t[11]!==i||t[12]!==s||t[13]!==Kt?(Gt=()=>{const Ot=zt.uniqBy(o,"source",!0).map(q=>({name:`source_${q}`,type:"source",label:`${q}`,color:typeof l=="string"||!l?l||xe.Colors.graphMainColor:l[(u||zt.uniqBy(o,"source",!0)).findIndex(P=>`${P}`==`${q}`)>l.length?l.length-1:(u||zt.uniqBy(o,"source",!0)).findIndex(P=>`${P}`==`${q}`)],totalValue:de.sum(o.filter(P=>`${P.source}`==`${q}`).map(kn))})),Yt=N==="asc"||N==="desc"?pe.orderBy(Ot,["totalValue"],[N]):Ot,ge=zt.uniqBy(o,"target",!0).map(q=>({name:`target_${q}`,type:"target",label:`${q}`,color:typeof s=="string"||!s?s||xe.Colors.graphMainColor:s[(i||zt.uniqBy(o,"target",!0)).findIndex(P=>`${P}`==`${q}`)>s.length?s.length-1:(i||zt.uniqBy(o,"target",!0)).findIndex(P=>`${P}`==`${q}`)],totalValue:de.sum(o.filter(P=>`${P.target}`==`${q}`).map(jn))})),Re=N==="asc"||N==="desc"?pe.orderBy(ge,["totalValue"],[N]):ge,oe=[...Yt,...Re];Kt({nodes:oe,links:o.map(q=>({source:oe.findIndex(P=>P.name===`source_${q.source}`),target:oe.findIndex(P=>P.name===`target_${q.target}`),value:q.value,data:{...q}}))})},t[7]=o,t[8]=N,t[9]=u,t[10]=l,t[11]=i,t[12]=s,t[13]=Kt,t[14]=Gt):Gt=t[14];let Wt;t[15]!==o||t[16]!==N||t[17]!==u||t[18]!==l||t[19]!==i||t[20]!==s?(Wt=[o,N,u,l,i,s],t[15]=o,t[16]=N,t[17]=u,t[18]=l,t[19]=i,t[20]=s,t[21]=Wt):Wt=t[21],A.useEffect(Gt,Wt);let Ft,_t;t[22]===Symbol.for("react.memo_cache_sentinel")?(Ft=()=>{const Ot=new ResizeObserver(Yt=>{vt(Yt[0].target.clientWidth||620),Me(Yt[0].target.clientHeight||480)});return Jt.current&&Ot.observe(Jt.current),()=>Ot.disconnect()},_t=[],t[22]=Ft,t[23]=_t):(Ft=t[22],_t=t[23]),A.useEffect(Ft,_t);const te=m?.graphContainer,ee=L?.graphContainer,ne=it?void 0:j;let Dt;t[24]!==m?.description||t[25]!==m?.title||t[26]!==o||t[27]!==ot||t[28]!==x||t[29]!==nt||t[30]!==r||t[31]!==L?.description||t[32]!==L?.title||t[33]!==j?(Dt=r||x||nt||ot?d.jsxRuntimeExports.jsx(Te.GraphHeader,{styles:{title:L?.title,description:L?.description},classNames:{title:m?.title,description:m?.description},graphTitle:r,graphDescription:x,width:j,graphDownload:nt?he:void 0,dataDownload:ot?o.map(vn).filter(yn).length>0?o.map(xn).filter(mn):o.filter(pn):null}):null,t[24]=m?.description,t[25]=m?.title,t[26]=o,t[27]=ot,t[28]=x,t[29]=nt,t[30]=r,t[31]=L?.description,t[32]=L?.title,t[33]=j,t[34]=Dt):Dt=t[34];let Tt;t[35]!==o.length?(Tt=o.length===0&&d.jsxRuntimeExports.jsx(Pe.EmptyState,{}),t[35]=o.length,t[36]=Tt):Tt=t[36];let qt;t[37]!==Nt||t[38]!==ct||t[39]!==m||t[40]!==Mt||t[41]!==o.length||t[42]!==It||t[43]!==Rt||t[44]!==it||t[45]!==yt||t[46]!==Et||t[47]!==at||t[48]!==mt||t[49]!==xt||t[50]!==W||t[51]!==S||t[52]!==Lt||t[53]!==ht||t[54]!==Vt||t[55]!==Z||t[56]!==At||t[57]!==lt||t[58]!==K||t[59]!==N||t[60]!==I||t[61]!==L||t[62]!==ft||t[63]!==jt||t[64]!==c||t[65]!==Y||t[66]!==w||t[67]!==ut||t[68]!==Q||t[69]!==j?(qt=c&&jt&&At&&o.length>0?d.jsxRuntimeExports.jsx(nn,{data:At,nodePadding:mt,nodeWidth:xt,width:it||!j||c<j?c:j,height:jt,showLabels:lt,leftMargin:at,rightMargin:Z,topMargin:ut,bottomMargin:ct,truncateBy:Q,tooltip:w,onSeriesMouseOver:S,showValues:K,suffix:ft,prefix:ht,onSeriesMouseClick:W,id:Be.generateRandomString(8),highlightedSourceDataPoints:yt.map(dn),highlightedTargetDataPoints:Et.map(gn),defaultLinkOpacity:It,sourceTitle:I,targetTitle:Y,sortNodes:N,resetSelectionOnDoubleClick:Vt,styles:L,classNames:m,detailsOnClick:Rt,animate:Nt===!0?{duration:.5,once:!0,amount:.5}:Nt||{duration:0,once:!0,amount:0},precision:Lt,customLayers:Mt}):null,t[37]=Nt,t[38]=ct,t[39]=m,t[40]=Mt,t[41]=o.length,t[42]=It,t[43]=Rt,t[44]=it,t[45]=yt,t[46]=Et,t[47]=at,t[48]=mt,t[49]=xt,t[50]=W,t[51]=S,t[52]=Lt,t[53]=ht,t[54]=Vt,t[55]=Z,t[56]=At,t[57]=lt,t[58]=K,t[59]=N,t[60]=I,t[61]=L,t[62]=ft,t[63]=jt,t[64]=c,t[65]=Y,t[66]=w,t[67]=ut,t[68]=Q,t[69]=j,t[70]=qt):qt=t[70];let Bt;t[71]!==Tt||t[72]!==qt?(Bt=d.jsxRuntimeExports.jsxs(ye.GraphArea,{ref:Jt,children:[Tt,qt]}),t[71]=Tt,t[72]=qt,t[73]=Bt):Bt=t[73];let Pt;t[74]!==m?.footnote||t[75]!==m?.source||t[76]!==p||t[77]!==a||t[78]!==L?.footnote||t[79]!==L?.source||t[80]!==j?(Pt=a||p?d.jsxRuntimeExports.jsx(qe.GraphFooter,{styles:{footnote:L?.footnote,source:L?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:a,footNote:p,width:j}):null,t[74]=m?.footnote,t[75]=m?.source,t[76]=p,t[77]=a,t[78]=L?.footnote,t[79]=L?.source,t[80]=j,t[81]=Pt):Pt=t[81];let Xt;return t[82]!==n||t[83]!==J||t[84]!==_||t[85]!==D||t[86]!==gt||t[87]!==dt||t[88]!==M||t[89]!==F||t[90]!==te||t[91]!==ee||t[92]!==ne||t[93]!==Dt||t[94]!==Bt||t[95]!==Pt||t[96]!==pt?(Xt=d.jsxRuntimeExports.jsxs(ye.GraphContainer,{className:te,style:ee,id:_,ref:he,"aria-label":n,backgroundColor:J,theme:pt,language:gt,minHeight:dt,width:ne,height:D,relativeHeight:F,padding:M,children:[Dt,Bt,Pt]}),t[82]=n,t[83]=J,t[84]=_,t[85]=D,t[86]=gt,t[87]=dt,t[88]=M,t[89]=F,t[90]=te,t[91]=ee,t[92]=ne,t[93]=Dt,t[94]=Bt,t[95]=Pt,t[96]=pt,t[97]=Xt):Xt=t[97],Xt}function gn(e){return`${e}`}function dn(e){return`${e}`}function pn(e){return e!==void 0}function mn(e){return e!==void 0}function xn(e){return e.data}function yn(e){return e!==void 0}function vn(e){return e.data}function jn(e){return e.value}function kn(e){return e.value}exports.SankeyChart=hn;
2
2
  //# sourceMappingURL=SankeyChart.cjs.map
@@ -1,9 +1,9 @@
1
- import { c as Se, j as m, m as Zt } from "./index-CHPV5EwG-DecW7_qr.js";
1
+ import { c as Se, j as m, m as Ut } from "./index-CHPV5EwG-DecW7_qr.js";
2
2
  import { useRef as ce, useState as St, useEffectEvent as Te, useEffect as me } from "react";
3
3
  import { s as ye } from "./index-CeVNqhMO.js";
4
4
  import { o as xe } from "./index-BZQYSqar.js";
5
5
  import { i as Pe } from "./index-Bwrro8-q.js";
6
- import { j as _t } from "./Typography-hWfh3H0J.js";
6
+ import { _ as Zt } from "./Typography-iR8PEgdt.js";
7
7
  import { n as ve } from "./numberFormattingFunction-14YCbkN2.js";
8
8
  import { T as ze } from "./Tooltip-BRnAz2Gv.js";
9
9
  import { D as Ee } from "./DetailsModal-BMCTgVsk.js";
@@ -14,7 +14,7 @@ import { GraphHeader as Ie } from "./GraphHeader.js";
14
14
  import { GraphFooter as He } from "./GraphFooter.js";
15
15
  import { Colors as ke } from "./Colors.js";
16
16
  import { g as We } from "./generateRandomString-za3IQGfQ.js";
17
- import { E as Re } from "./EmptyState-tZBErBKF.js";
17
+ import { E as Re } from "./EmptyState-Pj-emXt5.js";
18
18
  import { u as It } from "./uniqBy-BHy4I8PK.js";
19
19
  import { a as Ge, G as qe } from "./GraphContainer-CF6ws3pd.js";
20
20
  function be(e, t) {
@@ -67,10 +67,10 @@ function Qt(e) {
67
67
  return e;
68
68
  };
69
69
  }
70
- function je(e, t) {
70
+ function we(e, t) {
71
71
  return Jt(e.source, t.source) || e.index - t.index;
72
72
  }
73
- function we(e, t) {
73
+ function je(e, t) {
74
74
  return Jt(e.target, t.target) || e.index - t.index;
75
75
  }
76
76
  function Jt(e, t) {
@@ -82,10 +82,10 @@ function ae(e) {
82
82
  function Ye(e) {
83
83
  return e.index;
84
84
  }
85
- function Ue(e) {
85
+ function _e(e) {
86
86
  return e.nodes;
87
87
  }
88
- function Ze(e) {
88
+ function Ue(e) {
89
89
  return e.links;
90
90
  }
91
91
  function $e(e, t) {
@@ -103,10 +103,10 @@ function Le({ nodes: e }) {
103
103
  }
104
104
  }
105
105
  function ue() {
106
- let e = 0, t = 0, o = 1, r = 1, a = 24, y = 8, h, g = Ye, x = Xe, b, j, $ = Ue, P = Ze, k = 6;
106
+ let e = 0, t = 0, o = 1, r = 1, a = 24, y = 8, h, g = Ye, x = Xe, b, w, $ = _e, P = Ue, k = 6;
107
107
  function d() {
108
108
  const n = { nodes: $.apply(null, arguments), links: P.apply(null, arguments) };
109
- return S(n), W(n), w(n), O(n), q(n), Le(n), n;
109
+ return S(n), W(n), j(n), O(n), q(n), Le(n), n;
110
110
  }
111
111
  d.update = function(n) {
112
112
  return Le(n), n;
@@ -125,7 +125,7 @@ function ue() {
125
125
  }, d.links = function(n) {
126
126
  return arguments.length ? (P = typeof n == "function" ? n : Qt(n), d) : P;
127
127
  }, d.linkSort = function(n) {
128
- return arguments.length ? (j = n, d) : j;
128
+ return arguments.length ? (w = n, d) : w;
129
129
  }, d.size = function(n) {
130
130
  return arguments.length ? (e = t = 0, o = +n[0], r = +n[1], d) : [o - e, r - t];
131
131
  }, d.extent = function(n) {
@@ -142,15 +142,15 @@ function ue() {
142
142
  let { source: f, target: v } = i;
143
143
  typeof f != "object" && (f = i.source = $e(s, f)), typeof v != "object" && (v = i.target = $e(s, v)), f.sourceLinks.push(i), v.targetLinks.push(i);
144
144
  }
145
- if (j != null)
145
+ if (w != null)
146
146
  for (const { sourceLinks: u, targetLinks: i } of n)
147
- u.sort(j), i.sort(j);
147
+ u.sort(w), i.sort(w);
148
148
  }
149
149
  function W({ nodes: n }) {
150
150
  for (const l of n)
151
151
  l.value = l.fixedValue === void 0 ? Math.max(se(l.sourceLinks, ae), se(l.targetLinks, ae)) : l.fixedValue;
152
152
  }
153
- function w({ nodes: n }) {
153
+ function j({ nodes: n }) {
154
154
  const l = n.length;
155
155
  let s = new Set(n), u = /* @__PURE__ */ new Set(), i = 0;
156
156
  for (; s.size; ) {
@@ -217,8 +217,8 @@ function ue() {
217
217
  for (const v of f) {
218
218
  let D = 0, z = 0;
219
219
  for (const { source: H, value: Y } of v.targetLinks) {
220
- let U = Y * (v.layer - H.layer);
221
- D += V(H, v) * U, z += U;
220
+ let _ = Y * (v.layer - H.layer);
221
+ D += V(H, v) * _, z += _;
222
222
  }
223
223
  if (!(z > 0)) continue;
224
224
  let C = (D / z - v.y0) * l;
@@ -233,8 +233,8 @@ function ue() {
233
233
  for (const v of f) {
234
234
  let D = 0, z = 0;
235
235
  for (const { target: H, value: Y } of v.sourceLinks) {
236
- let U = Y * (H.layer - v.layer);
237
- D += L(v, H) * U, z += U;
236
+ let _ = Y * (H.layer - v.layer);
237
+ D += L(v, H) * _, z += _;
238
238
  }
239
239
  if (!(z > 0)) continue;
240
240
  let C = (D / z - v.y0) * l;
@@ -260,17 +260,17 @@ function ue() {
260
260
  }
261
261
  }
262
262
  function kt({ sourceLinks: n, targetLinks: l }) {
263
- if (j === void 0) {
263
+ if (w === void 0) {
264
264
  for (const { source: { sourceLinks: s } } of l)
265
- s.sort(we);
266
- for (const { target: { targetLinks: s } } of n)
267
265
  s.sort(je);
266
+ for (const { target: { targetLinks: s } } of n)
267
+ s.sort(we);
268
268
  }
269
269
  }
270
270
  function X(n) {
271
- if (j === void 0)
271
+ if (w === void 0)
272
272
  for (const { sourceLinks: l, targetLinks: s } of n)
273
- l.sort(we), s.sort(je);
273
+ l.sort(je), s.sort(we);
274
274
  }
275
275
  function V(n, l) {
276
276
  let s = n.y0 - (n.sourceLinks.length - 1) * h / 2;
@@ -298,7 +298,7 @@ function ue() {
298
298
  }
299
299
  return d;
300
300
  }
301
- var fe = Math.PI, he = 2 * fe, Dt = 1e-6, _e = he - Dt;
301
+ var fe = Math.PI, he = 2 * fe, Dt = 1e-6, Ze = he - Dt;
302
302
  function ge() {
303
303
  this._x0 = this._y0 = // start of current subpath
304
304
  this._x1 = this._y1 = null, this._ = "";
@@ -325,22 +325,22 @@ ge.prototype = Ne.prototype = {
325
325
  },
326
326
  arcTo: function(e, t, o, r, a) {
327
327
  e = +e, t = +t, o = +o, r = +r, a = +a;
328
- var y = this._x1, h = this._y1, g = o - e, x = r - t, b = y - e, j = h - t, $ = b * b + j * j;
328
+ var y = this._x1, h = this._y1, g = o - e, x = r - t, b = y - e, w = h - t, $ = b * b + w * w;
329
329
  if (a < 0) throw new Error("negative radius: " + a);
330
330
  if (this._x1 === null)
331
331
  this._ += "M" + (this._x1 = e) + "," + (this._y1 = t);
332
- else if ($ > Dt) if (!(Math.abs(j * g - x * b) > Dt) || !a)
332
+ else if ($ > Dt) if (!(Math.abs(w * g - x * b) > Dt) || !a)
333
333
  this._ += "L" + (this._x1 = e) + "," + (this._y1 = t);
334
334
  else {
335
- var P = o - y, k = r - h, d = g * g + x * x, S = P * P + k * k, W = Math.sqrt(d), w = Math.sqrt($), O = a * Math.tan((fe - Math.acos((d + $ - S) / (2 * W * w))) / 2), B = O / w, I = O / W;
336
- Math.abs(B - 1) > Dt && (this._ += "L" + (e + B * b) + "," + (t + B * j)), this._ += "A" + a + "," + a + ",0,0," + +(j * P > b * k) + "," + (this._x1 = e + I * g) + "," + (this._y1 = t + I * x);
335
+ var P = o - y, k = r - h, d = g * g + x * x, S = P * P + k * k, W = Math.sqrt(d), j = Math.sqrt($), O = a * Math.tan((fe - Math.acos((d + $ - S) / (2 * W * j))) / 2), B = O / j, I = O / W;
336
+ Math.abs(B - 1) > Dt && (this._ += "L" + (e + B * b) + "," + (t + B * w)), this._ += "A" + a + "," + a + ",0,0," + +(w * P > b * k) + "," + (this._x1 = e + I * g) + "," + (this._y1 = t + I * x);
337
337
  }
338
338
  },
339
339
  arc: function(e, t, o, r, a, y) {
340
340
  e = +e, t = +t, o = +o, y = !!y;
341
- var h = o * Math.cos(r), g = o * Math.sin(r), x = e + h, b = t + g, j = 1 ^ y, $ = y ? r - a : a - r;
341
+ var h = o * Math.cos(r), g = o * Math.sin(r), x = e + h, b = t + g, w = 1 ^ y, $ = y ? r - a : a - r;
342
342
  if (o < 0) throw new Error("negative radius: " + o);
343
- this._x1 === null ? this._ += "M" + x + "," + b : (Math.abs(this._x1 - x) > Dt || Math.abs(this._y1 - b) > Dt) && (this._ += "L" + x + "," + b), o && ($ < 0 && ($ = $ % he + he), $ > _e ? this._ += "A" + o + "," + o + ",0,1," + j + "," + (e - h) + "," + (t - g) + "A" + o + "," + o + ",0,1," + j + "," + (this._x1 = x) + "," + (this._y1 = b) : $ > Dt && (this._ += "A" + o + "," + o + ",0," + +($ >= fe) + "," + j + "," + (this._x1 = e + o * Math.cos(a)) + "," + (this._y1 = t + o * Math.sin(a))));
343
+ this._x1 === null ? this._ += "M" + x + "," + b : (Math.abs(this._x1 - x) > Dt || Math.abs(this._y1 - b) > Dt) && (this._ += "L" + x + "," + b), o && ($ < 0 && ($ = $ % he + he), $ > Ze ? this._ += "A" + o + "," + o + ",0,1," + w + "," + (e - h) + "," + (t - g) + "A" + o + "," + o + ",0,1," + w + "," + (this._x1 = x) + "," + (this._y1 = b) : $ > Dt && (this._ += "A" + o + "," + o + ",0," + +($ >= fe) + "," + w + "," + (this._x1 = e + o * Math.cos(a)) + "," + (this._y1 = t + o * Math.sin(a))));
344
344
  },
345
345
  rect: function(e, t, o, r) {
346
346
  this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +t) + "h" + +o + "v" + +r + "h" + -o + "Z";
@@ -370,8 +370,8 @@ function en(e) {
370
370
  function nn(e) {
371
371
  var t = tn, o = en, r = Qe, a = Je, y = null;
372
372
  function h() {
373
- var g, x = Ke.call(arguments), b = t.apply(this, x), j = o.apply(this, x);
374
- if (y || (y = g = Ne()), e(y, +r.apply(this, (x[0] = b, x)), +a.apply(this, x), +r.apply(this, (x[0] = j, x)), +a.apply(this, x)), g) return y = null, g + "" || null;
373
+ var g, x = Ke.call(arguments), b = t.apply(this, x), w = o.apply(this, x);
374
+ if (y || (y = g = Ne()), e(y, +r.apply(this, (x[0] = b, x)), +a.apply(this, x), +r.apply(this, (x[0] = w, x)), +a.apply(this, x)), g) return y = null, g + "" || null;
375
375
  }
376
376
  return h.source = function(g) {
377
377
  return arguments.length ? (t = g, h) : t;
@@ -410,14 +410,14 @@ function un(e) {
410
410
  width: g,
411
411
  height: x,
412
412
  topMargin: b,
413
- bottomMargin: j,
413
+ bottomMargin: w,
414
414
  tooltip: $,
415
415
  onSeriesMouseOver: P,
416
416
  suffix: k,
417
417
  prefix: d,
418
418
  showValues: S,
419
419
  onSeriesMouseClick: W,
420
- nodePadding: w,
420
+ nodePadding: j,
421
421
  nodeWidth: O,
422
422
  id: B,
423
423
  highlightedSourceDataPoints: I,
@@ -439,31 +439,31 @@ function un(e) {
439
439
  once: N.once,
440
440
  amount: N.amount
441
441
  }, t[0] = N.amount, t[1] = N.once, t[2] = u) : u = t[2];
442
- const i = Be(s, u), [f, v] = St(void 0), [D, z] = St(void 0), [C, H] = St(void 0), [Y, U] = St(void 0), [Ot, Nt] = St(void 0);
442
+ const i = Be(s, u), [f, v] = St(void 0), [D, z] = St(void 0), [C, H] = St(void 0), [Y, _] = St(void 0), [Ot, Nt] = St(void 0);
443
443
  let M;
444
- t[3] !== j || t[4] !== a || t[5] !== y || t[6] !== b ? (M = {
444
+ t[3] !== w || t[4] !== a || t[5] !== y || t[6] !== b ? (M = {
445
445
  top: b,
446
- bottom: j,
446
+ bottom: w,
447
447
  left: a,
448
448
  right: y
449
- }, t[3] = j, t[4] = a, t[5] = y, t[6] = b, t[7] = M) : M = t[7];
450
- const p = M, jt = g - p.left - p.right, wt = x - p.top - p.bottom;
451
- let tt, st, lt, Z, at, ut, _, Q, ct, ft, J, et, nt, ot, ht, gt;
452
- if (t[8] !== N.duration || t[9] !== L?.graphObjectValues || t[10] !== l || t[11] !== o || t[12] !== R || t[13] !== X || t[14] !== wt || t[15] !== jt || t[16] !== x || t[17] !== I || t[18] !== q || t[19] !== B || t[20] !== i || t[21] !== a || t[22] !== p.left || t[23] !== p.right || t[24] !== p.top || t[25] !== D || t[26] !== w || t[27] !== O || t[28] !== W || t[29] !== P || t[30] !== n || t[31] !== d || t[32] !== kt || t[33] !== y || t[34] !== C || t[35] !== r || t[36] !== S || t[37] !== K || t[38] !== F || t[39] !== V?.graphObjectValues || t[40] !== k || t[41] !== G || t[42] !== h || t[43] !== g) {
453
- const Ht = K === "mostReadable" ? ue().nodeWidth(O).nodePadding(w).size([jt, wt]).nodeAlign(le) : K === "none" ? ue().nodeWidth(O).nodePadding(w).size([jt, wt]).nodeAlign(le).nodeSort(null).linkSort(null) : ue().nodeWidth(O).nodePadding(w).size([jt, wt]).nodeAlign(le).nodeSort(K === "desc" ? yn : mn), {
449
+ }, t[3] = w, t[4] = a, t[5] = y, t[6] = b, t[7] = M) : M = t[7];
450
+ const p = M, wt = g - p.left - p.right, jt = x - p.top - p.bottom;
451
+ let tt, st, lt, U, at, ut, Z, Q, ct, ft, J, et, nt, ot, ht, gt;
452
+ if (t[8] !== N.duration || t[9] !== L?.graphObjectValues || t[10] !== l || t[11] !== o || t[12] !== R || t[13] !== X || t[14] !== jt || t[15] !== wt || t[16] !== x || t[17] !== I || t[18] !== q || t[19] !== B || t[20] !== i || t[21] !== a || t[22] !== p.left || t[23] !== p.right || t[24] !== p.top || t[25] !== D || t[26] !== j || t[27] !== O || t[28] !== W || t[29] !== P || t[30] !== n || t[31] !== d || t[32] !== kt || t[33] !== y || t[34] !== C || t[35] !== r || t[36] !== S || t[37] !== K || t[38] !== F || t[39] !== V?.graphObjectValues || t[40] !== k || t[41] !== G || t[42] !== h || t[43] !== g) {
453
+ const Ht = K === "mostReadable" ? ue().nodeWidth(O).nodePadding(j).size([wt, jt]).nodeAlign(le) : K === "none" ? ue().nodeWidth(O).nodePadding(j).size([wt, jt]).nodeAlign(le).nodeSort(null).linkSort(null) : ue().nodeWidth(O).nodePadding(j).size([wt, jt]).nodeAlign(le).nodeSort(K === "desc" ? yn : mn), {
454
454
  nodes: T,
455
455
  links: Ct
456
456
  } = Ht(o), Tt = an();
457
- st = re.svg, ht = `${g}px`, gt = `${x}px`, lt = `0 0 ${g} ${x}`, t[60] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Z = {
457
+ st = re.svg, ht = `${g}px`, gt = `${x}px`, lt = `0 0 ${g} ${x}`, t[60] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (U = {
458
458
  marginLeft: "auto",
459
459
  marginRight: "auto"
460
- }, t[60] = Z) : Z = t[60], at = "ltr", ut = s, t[61] !== p.left || t[62] !== p.top || t[63] !== F ? (_ = F ? /* @__PURE__ */ m.jsx("text", { x: p.left, y: p.top - 10, className: "text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100", style: {
460
+ }, t[60] = U) : U = t[60], at = "ltr", ut = s, t[61] !== p.left || t[62] !== p.top || t[63] !== F ? (Z = F ? /* @__PURE__ */ m.jsx("text", { x: p.left, y: p.top - 10, className: "text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100", style: {
461
461
  textAnchor: "start"
462
- }, children: F }) : null, t[61] = p.left, t[62] = p.top, t[63] = F, t[64] = _) : _ = t[64], t[65] !== p.right || t[66] !== p.top || t[67] !== G || t[68] !== g ? (Q = G ? /* @__PURE__ */ m.jsx("text", { x: g - p.right, y: p.top - 10, className: "text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100", style: {
462
+ }, children: F }) : null, t[61] = p.left, t[62] = p.top, t[63] = F, t[64] = Z) : Z = t[64], t[65] !== p.right || t[66] !== p.top || t[67] !== G || t[68] !== g ? (Q = G ? /* @__PURE__ */ m.jsx("text", { x: g - p.right, y: p.top - 10, className: "text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100", style: {
463
463
  textAnchor: "end"
464
464
  }, children: G }) : null, t[65] = p.right, t[66] = p.top, t[67] = G, t[68] = g, t[69] = Q) : Q = t[69], ft = `translate(${p.left},${p.top})`, t[70] !== l ? (J = l.filter(pn).map(dn), t[70] = l, t[71] = J) : J = t[71];
465
465
  let Lt;
466
- t[72] !== L?.graphObjectValues || t[73] !== a || t[74] !== w || t[75] !== n || t[76] !== d || t[77] !== r || t[78] !== S || t[79] !== V?.graphObjectValues || t[80] !== k || t[81] !== h ? (Lt = (c, xt) => /* @__PURE__ */ m.jsx("g", { onMouseEnter: () => {
466
+ t[72] !== L?.graphObjectValues || t[73] !== a || t[74] !== j || t[75] !== n || t[76] !== d || t[77] !== r || t[78] !== S || t[79] !== V?.graphObjectValues || t[80] !== k || t[81] !== h ? (Lt = (c, xt) => /* @__PURE__ */ m.jsx("g", { onMouseEnter: () => {
467
467
  H(c);
468
468
  }, onMouseLeave: () => {
469
469
  H(void 0);
@@ -471,24 +471,24 @@ function un(e) {
471
471
  /* @__PURE__ */ m.jsx("rect", { x: 0, y: 0, width: (c.x1 || 0) - (c.x0 || 0), height: (c.y1 || 0) - (c.y0 || 0), style: {
472
472
  fill: c.color
473
473
  } }),
474
- r || S ? /* @__PURE__ */ m.jsx("foreignObject", { y: 0 - w / 2, x: 0 - a, width: a, height: (c.y1 || 0) - (c.y0 || 0) + w, children: /* @__PURE__ */ m.jsxs("div", { className: "flex flex-col gap-0.5 justify-center py-0 px-1.5", style: {
475
- height: `${(c.y1 || 0) - (c.y0 || 0) + w}px`,
474
+ r || S ? /* @__PURE__ */ m.jsx("foreignObject", { y: 0 - j / 2, x: 0 - a, width: a, height: (c.y1 || 0) - (c.y0 || 0) + j, children: /* @__PURE__ */ m.jsxs("div", { className: "flex flex-col gap-0.5 justify-center py-0 px-1.5", style: {
475
+ height: `${(c.y1 || 0) - (c.y0 || 0) + j}px`,
476
476
  overflow: "visible"
477
477
  }, children: [
478
- r ? /* @__PURE__ */ m.jsx(_t, { marginBottom: S ? "3xs" : "none", size: "sm", leading: "none", className: Zt("sankey-right-label text-right", L?.graphObjectValues), style: {
478
+ r ? /* @__PURE__ */ m.jsx(Zt, { marginBottom: S ? "3xs" : "none", size: "sm", leading: "none", className: Ut("sankey-right-label text-right", L?.graphObjectValues), style: {
479
479
  hyphens: "auto",
480
480
  color: c.color,
481
481
  ...V?.graphObjectValues
482
482
  }, children: `${c.label}`.length < h ? `${c.label}` : `${`${c.label}`.substring(0, h)}...` }) : null,
483
- S ? /* @__PURE__ */ m.jsx(_t, { marginBottom: "none", size: "sm", leading: "none", className: Zt("sankey-right-value text-right font-bold", L?.graphObjectValues), style: {
483
+ S ? /* @__PURE__ */ m.jsx(Zt, { marginBottom: "none", size: "sm", leading: "none", className: Ut("sankey-right-value text-right font-bold", L?.graphObjectValues), style: {
484
484
  hyphens: "auto",
485
485
  color: c.color,
486
486
  ...V?.graphObjectValues
487
487
  }, children: ve(c.value, "NA", n, d, k) }) : null
488
488
  ] }) }) : null
489
- ] }) }, xt), t[72] = L?.graphObjectValues, t[73] = a, t[74] = w, t[75] = n, t[76] = d, t[77] = r, t[78] = S, t[79] = V?.graphObjectValues, t[80] = k, t[81] = h, t[82] = Lt) : Lt = t[82], et = T.filter(gn).map(Lt);
489
+ ] }) }, xt), t[72] = L?.graphObjectValues, t[73] = a, t[74] = j, t[75] = n, t[76] = d, t[77] = r, t[78] = S, t[79] = V?.graphObjectValues, t[80] = k, t[81] = h, t[82] = Lt) : Lt = t[82], et = T.filter(gn).map(Lt);
490
490
  let bt;
491
- t[83] !== L?.graphObjectValues || t[84] !== w || t[85] !== O || t[86] !== n || t[87] !== d || t[88] !== y || t[89] !== r || t[90] !== S || t[91] !== V?.graphObjectValues || t[92] !== k || t[93] !== h ? (bt = (c, xt) => /* @__PURE__ */ m.jsx("g", { onMouseEnter: () => {
491
+ t[83] !== L?.graphObjectValues || t[84] !== j || t[85] !== O || t[86] !== n || t[87] !== d || t[88] !== y || t[89] !== r || t[90] !== S || t[91] !== V?.graphObjectValues || t[92] !== k || t[93] !== h ? (bt = (c, xt) => /* @__PURE__ */ m.jsx("g", { onMouseEnter: () => {
492
492
  H(c);
493
493
  }, onMouseLeave: () => {
494
494
  H(void 0);
@@ -496,21 +496,21 @@ function un(e) {
496
496
  /* @__PURE__ */ m.jsx("rect", { x: 0, y: 0, width: (c.x1 || 0) - (c.x0 || 0), height: (c.y1 || 0) - (c.y0 || 0), style: {
497
497
  fill: c.color
498
498
  } }),
499
- r || S ? /* @__PURE__ */ m.jsx("foreignObject", { y: 0 - w / 2, x: O, width: y - O, height: (c.y1 || 0) - (c.y0 || 0) + w, children: /* @__PURE__ */ m.jsxs("div", { className: "flex flex-col gap-0.5 justify-center py-0 px-1.5", style: {
500
- height: `${(c.y1 || 0) - (c.y0 || 0) + w}px`
499
+ r || S ? /* @__PURE__ */ m.jsx("foreignObject", { y: 0 - j / 2, x: O, width: y - O, height: (c.y1 || 0) - (c.y0 || 0) + j, children: /* @__PURE__ */ m.jsxs("div", { className: "flex flex-col gap-0.5 justify-center py-0 px-1.5", style: {
500
+ height: `${(c.y1 || 0) - (c.y0 || 0) + j}px`
501
501
  }, children: [
502
- r ? /* @__PURE__ */ m.jsx(_t, { marginBottom: S ? "3xs" : "none", size: "sm", leading: "none", className: Zt("sankey-left-label text-left", L?.graphObjectValues), style: {
502
+ r ? /* @__PURE__ */ m.jsx(Zt, { marginBottom: S ? "3xs" : "none", size: "sm", leading: "none", className: Ut("sankey-left-label text-left", L?.graphObjectValues), style: {
503
503
  hyphens: "auto",
504
504
  color: c.color,
505
505
  ...V?.graphObjectValues
506
506
  }, children: `${c.label}`.length < h ? `${c.label}` : `${`${c.label}`.substring(0, h)}...` }) : null,
507
- S ? /* @__PURE__ */ m.jsx(_t, { size: "sm", leading: "none", marginBottom: "none", className: Zt("sankey-left-value text-left font-bold", L?.graphObjectValues), style: {
507
+ S ? /* @__PURE__ */ m.jsx(Zt, { size: "sm", leading: "none", marginBottom: "none", className: Ut("sankey-left-value text-left font-bold", L?.graphObjectValues), style: {
508
508
  hyphens: "auto",
509
509
  color: c.color,
510
510
  ...V?.graphObjectValues
511
511
  }, children: ve(c.value, "NA", n, d, k) }) : null
512
512
  ] }) }) : null
513
- ] }) }, xt), t[83] = L?.graphObjectValues, t[84] = w, t[85] = O, t[86] = n, t[87] = d, t[88] = y, t[89] = r, t[90] = S, t[91] = V?.graphObjectValues, t[92] = k, t[93] = h, t[94] = bt) : bt = t[94], nt = T.filter(hn).map(bt);
513
+ ] }) }, xt), t[83] = L?.graphObjectValues, t[84] = j, t[85] = O, t[86] = n, t[87] = d, t[88] = y, t[89] = r, t[90] = S, t[91] = V?.graphObjectValues, t[92] = k, t[93] = h, t[94] = bt) : bt = t[94], nt = T.filter(hn).map(bt);
514
514
  let Mt;
515
515
  t[95] !== B ? (Mt = (c, xt) => /* @__PURE__ */ m.jsxs("linearGradient", { id: `${B}-gradient-${xt}`, x1: "0%", y1: "0%", x2: "100%", y2: "0%", gradientUnits: "userSpaceOnUse", children: [
516
516
  /* @__PURE__ */ m.jsx("stop", { offset: "0%", style: {
@@ -522,13 +522,13 @@ function un(e) {
522
522
  stopOpacity: 1
523
523
  } })
524
524
  ] }, xt), t[95] = B, t[96] = Mt) : Mt = t[96], ot = /* @__PURE__ */ m.jsx("defs", { children: Ct.map(Mt) }), tt = Ae, ct = Ct.map((c, xt) => /* @__PURE__ */ m.jsx(re.g, { className: "undp-viz-g-with-hover", onMouseEnter: (vt) => {
525
- v(c.data), Nt(vt.clientY), U(vt.clientX), P?.(c);
525
+ v(c.data), Nt(vt.clientY), _(vt.clientX), P?.(c);
526
526
  }, onMouseMove: (vt) => {
527
- v(c.data), Nt(vt.clientY), U(vt.clientX);
527
+ v(c.data), Nt(vt.clientY), _(vt.clientX);
528
528
  }, onClick: () => {
529
529
  (W || X) && (Pe(D, c.data) && kt ? (z(void 0), W?.(void 0)) : (z(c.data), W?.(c.data)));
530
530
  }, onMouseLeave: () => {
531
- v(void 0), U(void 0), Nt(void 0), P?.(void 0);
531
+ v(void 0), _(void 0), Nt(void 0), P?.(void 0);
532
532
  }, variants: {
533
533
  initial: {
534
534
  opacity: C ? c.source.name === C.name || c.target.name === C.name ? 0.85 : R : (I.length !== 0 || q.length !== 0) && (I.indexOf(c.source.label) !== -1 || q.indexOf(c.target.label) !== -1) ? 0.85 : R
@@ -565,9 +565,9 @@ function un(e) {
565
565
  duration: N.duration
566
566
  }
567
567
  }
568
- }, initial: "initial", animate: i ? "whileInView" : "initial" }, `${c.source}-${c.target}`) }, `${c.source}-${c.target}`)), t[8] = N.duration, t[9] = L?.graphObjectValues, t[10] = l, t[11] = o, t[12] = R, t[13] = X, t[14] = wt, t[15] = jt, t[16] = x, t[17] = I, t[18] = q, t[19] = B, t[20] = i, t[21] = a, t[22] = p.left, t[23] = p.right, t[24] = p.top, t[25] = D, t[26] = w, t[27] = O, t[28] = W, t[29] = P, t[30] = n, t[31] = d, t[32] = kt, t[33] = y, t[34] = C, t[35] = r, t[36] = S, t[37] = K, t[38] = F, t[39] = V?.graphObjectValues, t[40] = k, t[41] = G, t[42] = h, t[43] = g, t[44] = tt, t[45] = st, t[46] = lt, t[47] = Z, t[48] = at, t[49] = ut, t[50] = _, t[51] = Q, t[52] = ct, t[53] = ft, t[54] = J, t[55] = et, t[56] = nt, t[57] = ot, t[58] = ht, t[59] = gt;
568
+ }, initial: "initial", animate: i ? "whileInView" : "initial" }, `${c.source}-${c.target}`) }, `${c.source}-${c.target}`)), t[8] = N.duration, t[9] = L?.graphObjectValues, t[10] = l, t[11] = o, t[12] = R, t[13] = X, t[14] = jt, t[15] = wt, t[16] = x, t[17] = I, t[18] = q, t[19] = B, t[20] = i, t[21] = a, t[22] = p.left, t[23] = p.right, t[24] = p.top, t[25] = D, t[26] = j, t[27] = O, t[28] = W, t[29] = P, t[30] = n, t[31] = d, t[32] = kt, t[33] = y, t[34] = C, t[35] = r, t[36] = S, t[37] = K, t[38] = F, t[39] = V?.graphObjectValues, t[40] = k, t[41] = G, t[42] = h, t[43] = g, t[44] = tt, t[45] = st, t[46] = lt, t[47] = U, t[48] = at, t[49] = ut, t[50] = Z, t[51] = Q, t[52] = ct, t[53] = ft, t[54] = J, t[55] = et, t[56] = nt, t[57] = ot, t[58] = ht, t[59] = gt;
569
569
  } else
570
- tt = t[44], st = t[45], lt = t[46], Z = t[47], at = t[48], ut = t[49], _ = t[50], Q = t[51], ct = t[52], ft = t[53], J = t[54], et = t[55], nt = t[56], ot = t[57], ht = t[58], gt = t[59];
570
+ tt = t[44], st = t[45], lt = t[46], U = t[47], at = t[48], ut = t[49], Z = t[50], Q = t[51], ct = t[52], ft = t[53], J = t[54], et = t[55], nt = t[56], ot = t[57], ht = t[58], gt = t[59];
571
571
  let dt;
572
572
  t[97] !== tt || t[98] !== ct ? (dt = /* @__PURE__ */ m.jsx("g", { children: /* @__PURE__ */ m.jsx(tt, { children: ct }) }), t[97] = tt, t[98] = ct, t[99] = dt) : dt = t[99];
573
573
  let pt;
@@ -582,11 +582,11 @@ function un(e) {
582
582
  pt
583
583
  ] }), t[102] = dt, t[103] = pt, t[104] = ft, t[105] = J, t[106] = et, t[107] = nt, t[108] = ot, t[109] = mt) : mt = t[109];
584
584
  let it;
585
- t[110] !== st || t[111] !== lt || t[112] !== Z || t[113] !== at || t[114] !== ut || t[115] !== _ || t[116] !== Q || t[117] !== mt || t[118] !== ht || t[119] !== gt ? (it = /* @__PURE__ */ m.jsxs(st, { width: ht, height: gt, viewBox: lt, style: Z, direction: at, ref: ut, children: [
586
- _,
585
+ t[110] !== st || t[111] !== lt || t[112] !== U || t[113] !== at || t[114] !== ut || t[115] !== Z || t[116] !== Q || t[117] !== mt || t[118] !== ht || t[119] !== gt ? (it = /* @__PURE__ */ m.jsxs(st, { width: ht, height: gt, viewBox: lt, style: U, direction: at, ref: ut, children: [
586
+ Z,
587
587
  Q,
588
588
  mt
589
- ] }), t[110] = st, t[111] = lt, t[112] = Z, t[113] = at, t[114] = ut, t[115] = _, t[116] = Q, t[117] = mt, t[118] = ht, t[119] = gt, t[120] = it) : it = t[120];
589
+ ] }), t[110] = st, t[111] = lt, t[112] = U, t[113] = at, t[114] = ut, t[115] = Z, t[116] = Q, t[117] = mt, t[118] = ht, t[119] = gt, t[120] = it) : it = t[120];
590
590
  let yt;
591
591
  t[121] !== L?.tooltip || t[122] !== Y || t[123] !== Ot || t[124] !== f || t[125] !== V?.tooltip || t[126] !== $ ? (yt = f && $ && Y && Ot ? /* @__PURE__ */ m.jsx(ze, { data: f, body: $, xPos: Y, yPos: Ot, backgroundStyle: V?.tooltip, className: L?.tooltip }) : null, t[121] = L?.tooltip, t[122] = Y, t[123] = Ot, t[124] = f, t[125] = V?.tooltip, t[126] = $, t[127] = yt) : yt = t[127];
592
592
  let rt;
@@ -632,14 +632,14 @@ function Xn(e) {
632
632
  leftMargin: g,
633
633
  rightMargin: x,
634
634
  topMargin: b,
635
- bottomMargin: j,
635
+ bottomMargin: w,
636
636
  truncateBy: $,
637
637
  height: P,
638
638
  width: k,
639
639
  footNote: d,
640
640
  padding: S,
641
641
  backgroundColor: W,
642
- tooltip: w,
642
+ tooltip: j,
643
643
  onSeriesMouseOver: O,
644
644
  suffix: B,
645
645
  prefix: I,
@@ -665,21 +665,21 @@ function Xn(e) {
665
665
  defaultLinkOpacity: C,
666
666
  sourceTitle: H,
667
667
  targetTitle: Y,
668
- sortNodes: U,
668
+ sortNodes: _,
669
669
  resetSelectionOnDoubleClick: Ot,
670
670
  detailsOnClick: Nt,
671
671
  styles: M,
672
672
  classNames: p,
673
- animate: jt,
674
- precision: wt,
673
+ animate: wt,
674
+ precision: jt,
675
675
  customLayers: tt
676
- } = e, st = h === void 0 ? !0 : h, lt = g === void 0 ? 75 : g, Z = x === void 0 ? 75 : x, at = b === void 0 ? 30 : b, ut = j === void 0 ? 10 : j, _ = $ === void 0 ? 999 : $, Q = W === void 0 ? !1 : W, ct = B === void 0 ? "" : B, ft = I === void 0 ? "" : I, J = R === void 0 ? !0 : R, et = N === void 0 ? !1 : N, nt = K === void 0 ? !1 : K, ot = kt === void 0 ? !0 : kt, ht = X === void 0 ? "en" : X, gt = V === void 0 ? 0 : V, dt = L === void 0 ? "light" : L, pt = f === void 0 ? 5 : f, mt = v === void 0 ? 5 : v;
676
+ } = e, st = h === void 0 ? !0 : h, lt = g === void 0 ? 75 : g, U = x === void 0 ? 75 : x, at = b === void 0 ? 30 : b, ut = w === void 0 ? 10 : w, Z = $ === void 0 ? 999 : $, Q = W === void 0 ? !1 : W, ct = B === void 0 ? "" : B, ft = I === void 0 ? "" : I, J = R === void 0 ? !0 : R, et = N === void 0 ? !1 : N, nt = K === void 0 ? !1 : K, ot = kt === void 0 ? !0 : kt, ht = X === void 0 ? "en" : X, gt = V === void 0 ? 0 : V, dt = L === void 0 ? "light" : L, pt = f === void 0 ? 5 : f, mt = v === void 0 ? 5 : v;
677
677
  let it;
678
678
  t[0] !== D ? (it = D === void 0 ? [] : D, t[0] = D, t[1] = it) : it = t[1];
679
679
  const yt = it;
680
680
  let rt;
681
681
  t[2] !== z ? (rt = z === void 0 ? [] : z, t[2] = z, t[3] = rt) : rt = t[3];
682
- const $t = rt, Ht = C === void 0 ? 0.3 : C, T = U === void 0 ? "mostReadable" : U, Ct = Ot === void 0 ? !0 : Ot, Tt = jt === void 0 ? !1 : jt, Lt = wt === void 0 ? 2 : wt;
682
+ const $t = rt, Ht = C === void 0 ? 0.3 : C, T = _ === void 0 ? "mostReadable" : _, Ct = Ot === void 0 ? !0 : Ot, Tt = wt === void 0 ? !1 : wt, Lt = jt === void 0 ? 2 : jt;
683
683
  let bt;
684
684
  t[4] !== tt ? (bt = tt === void 0 ? [] : tt, t[4] = tt, t[5] = bt) : bt = t[5];
685
685
  const Mt = bt, [c, xt] = St(0), [vt, Ve] = St(0), [Wt, De] = St(void 0), Kt = ce(null), de = ce(null);
@@ -696,13 +696,13 @@ function Xn(e) {
696
696
  label: `${E}`,
697
697
  color: typeof l == "string" || !l ? l || ke.graphMainColor : l[(u || It(o, "source", !0)).findIndex((A) => `${A}` == `${E}`) > l.length ? l.length - 1 : (u || It(o, "source", !0)).findIndex((A) => `${A}` == `${E}`)],
698
698
  totalValue: ye(o.filter((A) => `${A.source}` == `${E}`).map(Mn))
699
- })), Ut = T === "asc" || T === "desc" ? xe(Vt, ["totalValue"], [T]) : Vt, pe = It(o, "target", !0).map((E) => ({
699
+ })), _t = T === "asc" || T === "desc" ? xe(Vt, ["totalValue"], [T]) : Vt, pe = It(o, "target", !0).map((E) => ({
700
700
  name: `target_${E}`,
701
701
  type: "target",
702
702
  label: `${E}`,
703
703
  color: typeof s == "string" || !s ? s || ke.graphMainColor : s[(i || It(o, "target", !0)).findIndex((A) => `${A}` == `${E}`) > s.length ? s.length - 1 : (i || It(o, "target", !0)).findIndex((A) => `${A}` == `${E}`)],
704
704
  totalValue: ye(o.filter((A) => `${A.target}` == `${E}`).map(Ln))
705
- })), Ce = T === "asc" || T === "desc" ? xe(pe, ["totalValue"], [T]) : pe, ie = [...Ut, ...Ce];
705
+ })), Ce = T === "asc" || T === "desc" ? xe(pe, ["totalValue"], [T]) : pe, ie = [..._t, ...Ce];
706
706
  te({
707
707
  nodes: ie,
708
708
  links: o.map((E) => ({
@@ -719,8 +719,8 @@ function Xn(e) {
719
719
  t[15] !== o || t[16] !== T || t[17] !== u || t[18] !== l || t[19] !== i || t[20] !== s ? (qt = [o, T, u, l, i, s], t[15] = o, t[16] = T, t[17] = u, t[18] = l, t[19] = i, t[20] = s, t[21] = qt) : qt = t[21], me(Gt, qt);
720
720
  let Ft, Xt;
721
721
  t[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ft = () => {
722
- const Vt = new ResizeObserver((Ut) => {
723
- xt(Ut[0].target.clientWidth || 620), Ve(Ut[0].target.clientHeight || 480);
722
+ const Vt = new ResizeObserver((_t) => {
723
+ xt(_t[0].target.clientWidth || 620), Ve(_t[0].target.clientHeight || 480);
724
724
  });
725
725
  return Kt.current && Vt.observe(Kt.current), () => Vt.disconnect();
726
726
  }, Xt = [], t[22] = Ft, t[23] = Xt) : (Ft = t[22], Xt = t[23]), me(Ft, Xt);
@@ -732,11 +732,11 @@ function Xn(e) {
732
732
  }, classNames: {
733
733
  title: p?.title,
734
734
  description: p?.description
735
- }, graphTitle: r, graphDescription: y, width: k, graphDownload: et ? de : void 0, dataDownload: nt ? o.map($n).filter(wn).length > 0 ? o.map(jn).filter(bn) : o.filter(kn) : null }) : null, t[24] = p?.description, t[25] = p?.title, t[26] = o, t[27] = nt, t[28] = y, t[29] = et, t[30] = r, t[31] = M?.description, t[32] = M?.title, t[33] = k, t[34] = Pt) : Pt = t[34];
735
+ }, graphTitle: r, graphDescription: y, width: k, graphDownload: et ? de : void 0, dataDownload: nt ? o.map($n).filter(jn).length > 0 ? o.map(wn).filter(bn) : o.filter(kn) : null }) : null, t[24] = p?.description, t[25] = p?.title, t[26] = o, t[27] = nt, t[28] = y, t[29] = et, t[30] = r, t[31] = M?.description, t[32] = M?.title, t[33] = k, t[34] = Pt) : Pt = t[34];
736
736
  let zt;
737
737
  t[35] !== o.length ? (zt = o.length === 0 && /* @__PURE__ */ m.jsx(Re, {}), t[35] = o.length, t[36] = zt) : zt = t[36];
738
738
  let Et;
739
- t[37] !== Tt || t[38] !== ut || t[39] !== p || t[40] !== Mt || t[41] !== o.length || t[42] !== Ht || t[43] !== Nt || t[44] !== ot || t[45] !== yt || t[46] !== $t || t[47] !== lt || t[48] !== pt || t[49] !== mt || t[50] !== G || t[51] !== O || t[52] !== Lt || t[53] !== ft || t[54] !== Ct || t[55] !== Z || t[56] !== Wt || t[57] !== st || t[58] !== J || t[59] !== T || t[60] !== H || t[61] !== M || t[62] !== ct || t[63] !== vt || t[64] !== c || t[65] !== Y || t[66] !== w || t[67] !== at || t[68] !== _ || t[69] !== k ? (Et = c && vt && Wt && o.length > 0 ? /* @__PURE__ */ m.jsx(un, { data: Wt, nodePadding: pt, nodeWidth: mt, width: ot || !k || c < k ? c : k, height: vt, showLabels: st, leftMargin: lt, rightMargin: Z, topMargin: at, bottomMargin: ut, truncateBy: _, tooltip: w, onSeriesMouseOver: O, showValues: J, suffix: ct, prefix: ft, onSeriesMouseClick: G, id: We(8), highlightedSourceDataPoints: yt.map(vn), highlightedTargetDataPoints: $t.map(xn), defaultLinkOpacity: Ht, sourceTitle: H, targetTitle: Y, sortNodes: T, resetSelectionOnDoubleClick: Ct, styles: M, classNames: p, detailsOnClick: Nt, animate: Tt === !0 ? {
739
+ t[37] !== Tt || t[38] !== ut || t[39] !== p || t[40] !== Mt || t[41] !== o.length || t[42] !== Ht || t[43] !== Nt || t[44] !== ot || t[45] !== yt || t[46] !== $t || t[47] !== lt || t[48] !== pt || t[49] !== mt || t[50] !== G || t[51] !== O || t[52] !== Lt || t[53] !== ft || t[54] !== Ct || t[55] !== U || t[56] !== Wt || t[57] !== st || t[58] !== J || t[59] !== T || t[60] !== H || t[61] !== M || t[62] !== ct || t[63] !== vt || t[64] !== c || t[65] !== Y || t[66] !== j || t[67] !== at || t[68] !== Z || t[69] !== k ? (Et = c && vt && Wt && o.length > 0 ? /* @__PURE__ */ m.jsx(un, { data: Wt, nodePadding: pt, nodeWidth: mt, width: ot || !k || c < k ? c : k, height: vt, showLabels: st, leftMargin: lt, rightMargin: U, topMargin: at, bottomMargin: ut, truncateBy: Z, tooltip: j, onSeriesMouseOver: O, showValues: J, suffix: ct, prefix: ft, onSeriesMouseClick: G, id: We(8), highlightedSourceDataPoints: yt.map(vn), highlightedTargetDataPoints: $t.map(xn), defaultLinkOpacity: Ht, sourceTitle: H, targetTitle: Y, sortNodes: T, resetSelectionOnDoubleClick: Ct, styles: M, classNames: p, detailsOnClick: Nt, animate: Tt === !0 ? {
740
740
  duration: 0.5,
741
741
  once: !0,
742
742
  amount: 0.5
@@ -744,7 +744,7 @@ function Xn(e) {
744
744
  duration: 0,
745
745
  once: !0,
746
746
  amount: 0
747
- }, precision: Lt, customLayers: Mt }) : null, t[37] = Tt, t[38] = ut, t[39] = p, t[40] = Mt, t[41] = o.length, t[42] = Ht, t[43] = Nt, t[44] = ot, t[45] = yt, t[46] = $t, t[47] = lt, t[48] = pt, t[49] = mt, t[50] = G, t[51] = O, t[52] = Lt, t[53] = ft, t[54] = Ct, t[55] = Z, t[56] = Wt, t[57] = st, t[58] = J, t[59] = T, t[60] = H, t[61] = M, t[62] = ct, t[63] = vt, t[64] = c, t[65] = Y, t[66] = w, t[67] = at, t[68] = _, t[69] = k, t[70] = Et) : Et = t[70];
747
+ }, precision: Lt, customLayers: Mt }) : null, t[37] = Tt, t[38] = ut, t[39] = p, t[40] = Mt, t[41] = o.length, t[42] = Ht, t[43] = Nt, t[44] = ot, t[45] = yt, t[46] = $t, t[47] = lt, t[48] = pt, t[49] = mt, t[50] = G, t[51] = O, t[52] = Lt, t[53] = ft, t[54] = Ct, t[55] = U, t[56] = Wt, t[57] = st, t[58] = J, t[59] = T, t[60] = H, t[61] = M, t[62] = ct, t[63] = vt, t[64] = c, t[65] = Y, t[66] = j, t[67] = at, t[68] = Z, t[69] = k, t[70] = Et) : Et = t[70];
748
748
  let Bt;
749
749
  t[71] !== zt || t[72] !== Et ? (Bt = /* @__PURE__ */ m.jsxs(Ge, { ref: Kt, children: [
750
750
  zt,
@@ -777,10 +777,10 @@ function kn(e) {
777
777
  function bn(e) {
778
778
  return e !== void 0;
779
779
  }
780
- function jn(e) {
780
+ function wn(e) {
781
781
  return e.data;
782
782
  }
783
- function wn(e) {
783
+ function jn(e) {
784
784
  return e !== void 0;
785
785
  }
786
786
  function $n(e) {