gf-components 0.1.89 → 0.1.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +14 -28
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -493,7 +493,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
493
493
|
font-size: 20px;
|
|
494
494
|
line-height: 30px;
|
|
495
495
|
align-items: center;
|
|
496
|
-
`,o61=({pieChartData:e,title:t,isEmpty:C,tooltip:n=null,customStyle:r={},customMargin:i={}})=>{const o=({centerX:a,centerY:s})=>b.jsx("text",{x:a,y:s,textAnchor:"middle",dominantBaseline:"central",style:{fontSize:"16px",fontWeight:400},children:C?"Data niet openbaar beschikbaar":""});return b.jsxs(b.Fragment,{children:[b.jsx(O2,{}),b.jsx("div",{style:{width:"100%",height:500,position:"relative",...r},children:b.jsxs(J4,{children:[b.jsx(R7,{justify:"center",children:b.jsx(i61,{children:t})}),b.jsx(R7,{style:{width:"100%",height:500,position:"relative"},justify:"center",children:b.jsx(r61,{colors:{scheme:C?"greys":"nivo"},data:e,enableArcLabels:!C,enableArcLinkLabels:!C,margin:{top:20,right:120,bottom:100,left:120,...i},innerRadius:.5,padAngle:.7,cornerRadius:3,activeOuterRadiusOffset:8,borderWidth:1,borderColor:{from:"color",modifiers:[["darker",.2]]},arcLinkLabelsSkipAngle:10,arcLinkLabelsTextColor:"#333333",arcLinkLabelsThickness:2,arcLinkLabelsColor:{from:"color"},arcLabelsSkipAngle:10,arcLabelsTextColor:{from:"color",modifiers:[["darker",2]]},isInteractive:!C,layers:["arcs","arcLabels","arcLinkLabels","legends",o],defs:[{id:"dots",type:"patternDots",background:"inherit",color:"rgba(255, 255, 255, 0.3)",size:4,padding:1,stagger:!0},{id:"lines",type:"patternLines",background:"inherit",color:"rgba(255, 255, 255, 0.3)",rotation:-45,lineWidth:6,spacing:10}],tooltip:({datum:{id:a,value:s,unit:l}})=>b.jsx(v4,{body:(n==null?void 0:n({id:a,value:s,unit:l}))||b.jsx("span",{children:"Pie chart tooltip"})})})})]})})]})};var a61=nn,s61=uu,l61=1,c61=2;function u61(e,t,C,n){var r=C.length,i=r,o=!n;if(e==null)return!i;for(e=Object(e);r--;){var a=C[r];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<i;){a=C[r];var s=a[0],l=e[s],c=a[1];if(o&&a[2]){if(l===void 0&&!(s in e))return!1}else{var u=new a61;if(n)var d=n(l,c,s,e,t,u);if(!(d===void 0?s61(c,l,l61|c61,n,u):d))return!1}}return!0}var d61=u61,f61=$3;function h61(e){return e===e&&!f61(e)}var m$=h61,g61=m$,v61=be;function m61(e){for(var t=v61(e),C=t.length;C--;){var n=t[C],r=e[n];t[C]=[n,r,g61(r)]}return t}var p61=m61;function b61(e,t){return function(C){return C==null?!1:C[e]===t&&(t!==void 0||e in Object(C))}}var p$=b61,y61=d61,x61=p61,w61=p$;function S61(e){var t=x61(e);return t.length==1&&t[0][2]?w61(t[0][0],t[0][1]):function(C){return C===e||y61(C,e,t)}}var $61=S61,M61=uu,E61=xw,_61=yS,O61=Tl,V61=m$,T61=p$,R61=a6,H61=1,k61=2;function L61(e,t){return O61(e)&&V61(t)?T61(R61(e),t):function(C){var n=E61(C,e);return n===void 0&&n===t?_61(C,e):M61(t,n,H61|k61)}}var P61=L61;function j61(e){return function(t){return t==null?void 0:t[e]}}var I61=j61,A61=he;function N61(e){return function(t){return A61(t,e)}}var D61=N61,F61=I61,z61=D61,B61=Tl,W61=a6;function U61(e){return B61(e)?F61(W61(e)):z61(e)}var Z61=U61,q61=$61,G61=P61,Y61=ln,K61=b4,X61=Z61;function Q61(e){return typeof e=="function"?e:e==null?Y61:typeof e=="object"?K61(e)?G61(e[0],e[1]):q61(e):X61(e)}var mu=Q61,J61=mu,e01=fx;function t01(e,t){return e&&e.length?e01(e,J61(t)):[]}var C01=t01;const _a=p2(C01);var n01=nw,r01=be;function i01(e,t){return e&&n01(e,t,r01)}var o01=i01,a01=n6;function s01(e,t){return function(C,n){if(C==null)return C;if(!a01(C))return e(C,n);for(var r=C.length,i=t?r:-1,o=Object(C);(t?i--:++i<r)&&n(o[i],i,o)!==!1;);return C}}var l01=s01,c01=o01,u01=l01,d01=u01(c01),b$=d01,f01=b$,h01=n6;function g01(e,t){var C=-1,n=h01(e)?Array(e.length):[];return f01(e,function(r,i,o){n[++C]=t(r,i,o)}),n}var v01=g01;function m01(e,t){var C=e.length;for(e.sort(t);C--;)e[C]=e[C].value;return e}var p01=m01,zv=cn;function b01(e,t){if(e!==t){var C=e!==void 0,n=e===null,r=e===e,i=zv(e),o=t!==void 0,a=t===null,s=t===t,l=zv(t);if(!a&&!l&&!i&&e>t||i&&o&&s&&!a&&!l||n&&o&&s||!C&&s||!r)return 1;if(!n&&!i&&!l&&e<t||l&&C&&r&&!n&&!i||a&&C&&r||!o&&r||!s)return-1}return 0}var y01=b01,x01=y01;function w01(e,t,C){for(var n=-1,r=e.criteria,i=t.criteria,o=r.length,a=C.length;++n<o;){var s=x01(r[n],i[n]);if(s){if(n>=a)return s;var l=C[n];return s*(l=="desc"?-1:1)}}return e.index-t.index}var S01=w01,mi=un,$01=he,M01=mu,E01=v01,_01=p01,O01=r6,V01=S01,T01=ln,R01=b4;function H01(e,t,C){t.length?t=mi(t,function(i){return R01(i)?function(o){return $01(o,i.length===1?i[0]:i)}:i}):t=[T01];var n=-1;t=mi(t,O01(M01));var r=E01(e,function(i,o,a){var s=mi(t,function(l){return l(i)});return{criteria:s,index:++n,value:i}});return _01(r,function(i,o){return V01(i,o,C)})}var k01=H01,L01=wS,P01=k01,j01=Ol,Bv=pw,I01=j01(function(e,t){if(e==null)return[];var C=t.length;return C>1&&Bv(e,t[0],t[1])?t=[]:C>2&&Bv(t[0],t[1],t[2])&&(t=[t[0]]),P01(e,L01(t,1),[])}),A01=I01;const N01=p2(A01);var D01=g7,F01=Z4,z01="[object Date]";function B01(e){return F01(e)&&D01(e)==z01}var W01=B01,U01=W01,Z01=r6,Wv=an,Uv=Wv&&Wv.isDate,q01=Uv?Z01(Uv):U01,G01=q01;const Y01=p2(G01);var pi=new Date,bi=new Date;function w2(e,t,C,n){function r(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return r.floor=function(i){return e(i=new Date(+i)),i},r.ceil=function(i){return e(i=new Date(i-1)),t(i,1),e(i),i},r.round=function(i){var o=r(i),a=r.ceil(i);return i-o<a-i?o:a},r.offset=function(i,o){return t(i=new Date(+i),o==null?1:Math.floor(o)),i},r.range=function(i,o,a){var s=[],l;if(i=r.ceil(i),a=a==null?1:Math.floor(a),!(i<o)||!(a>0))return s;do s.push(l=new Date(+i)),t(i,a),e(i);while(l<i&&i<o);return s},r.filter=function(i){return w2(function(o){if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},function(o,a){if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!i(o););else for(;--a>=0;)for(;t(o,1),!i(o););})},C&&(r.count=function(i,o){return pi.setTime(+i),bi.setTime(+o),e(pi),e(bi),Math.floor(C(pi,bi))},r.every=function(i){return i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?r.filter(n?function(o){return n(o)%i===0}:function(o){return r.count(0,o)%i===0}):r}),r}var f7=w2(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});f7.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?w2(function(t){t.setTime(Math.floor(t/e)*e)},function(t,C){t.setTime(+t+C*e)},function(t,C){return(C-t)/e}):f7};f7.range;var dC=1e3,z9=6e4,fC=36e5,y$=6048e5,w8=w2(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*dC)},function(e,t){return(t-e)/dC},function(e){return e.getUTCSeconds()});w8.range;var Rn=w2(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*dC)},function(e,t){e.setTime(+e+t*z9)},function(e,t){return(t-e)/z9},function(e){return e.getMinutes()});Rn.range;var Hn=w2(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*dC-e.getMinutes()*z9)},function(e,t){e.setTime(+e+t*fC)},function(e,t){return(t-e)/fC},function(e){return e.getHours()});Hn.range;function W8(e){return w2(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,C){t.setDate(t.getDate()+C*7)},function(t,C){return(C-t-(C.getTimezoneOffset()-t.getTimezoneOffset())*z9)/y$})}var S8=W8(0),kn=W8(1),Ln=W8(2),Pn=W8(3),jn=W8(4),In=W8(5),An=W8(6);S8.range;kn.range;Ln.range;Pn.range;jn.range;In.range;An.range;var Nn=w2(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()});Nn.range;var xe=w2(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});xe.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:w2(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,C){t.setFullYear(t.getFullYear()+C*e)})};xe.range;var Dn=w2(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*z9)},function(e,t){return(t-e)/z9},function(e){return e.getUTCMinutes()});Dn.range;var Fn=w2(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*fC)},function(e,t){return(t-e)/fC},function(e){return e.getUTCHours()});Fn.range;function U8(e){return w2(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,C){t.setUTCDate(t.getUTCDate()+C*7)},function(t,C){return(C-t)/y$})}var $8=U8(0),zn=U8(1),Bn=U8(2),Wn=U8(3),Un=U8(4),Zn=U8(5),qn=U8(6);$8.range;zn.range;Bn.range;Wn.range;Un.range;Zn.range;qn.range;var Gn=w2(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()});Gn.range;var we=w2(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});we.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:w2(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,C){t.setUTCFullYear(t.getUTCFullYear()+C*e)})};we.range;function t8(){return t8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},t8.apply(this,arguments)}var a9=[function(e){return e.setMilliseconds(0)},function(e){return e.setSeconds(0)},function(e){return e.setMinutes(0)},function(e){return e.setHours(0)},function(e){return e.setDate(1)},function(e){return e.setMonth(0)}],K01={millisecond:[],second:a9.slice(0,1),minute:a9.slice(0,2),hour:a9.slice(0,3),day:a9.slice(0,4),month:a9.slice(0,5),year:a9.slice(0,6)},X01=function(e){return function(t){return K01[e].forEach(function(C){C(t)}),t}},x$=function(e){var t=e.format,C=t===void 0?"native":t,n=e.precision,r=n===void 0?"millisecond":n,i=e.useUTC,o=i===void 0||i,a=X01(r);return function(s){if(s===void 0)return s;if(C==="native"||s instanceof Date)return a(s);var l=o?su(C):au(C);return a(l(s))}},Q01=function(e,t,C,n){var r,i,o,a,s=e.min,l=s===void 0?0:s,c=e.max,u=c===void 0?"auto":c,d=e.stacked,f=d!==void 0&&d,v=e.reverse,g=v!==void 0&&v,h=e.clamp,m=h!==void 0&&h,p=e.nice,x=p!==void 0&&p;l==="auto"?r=f===!0?(i=t.minStacked)!=null?i:0:t.min:r=l,u==="auto"?o=f===!0?(a=t.maxStacked)!=null?a:0:t.max:o=u;var S=P8().rangeRound(n==="x"?[0,C]:[C,0]).domain(g?[o,r]:[r,o]).clamp(m);return x===!0?S.nice():typeof x=="number"&&S.nice(x),J01(S,f)},J01=function(e,t){t===void 0&&(t=!1);var C=e;return C.type="linear",C.stacked=t,C},ee1=function(e,t,C){var n=Hw().range([0,C]).domain(t.all);return n.type="point",n},te1=function(e,t,C,n){var r=e.round,i=r===void 0||r,o=j9().range(n==="x"?[0,C]:[C,0]).domain(t.all).round(i);return Ce1(o)},Ce1=function(e){var t=e;return t.type="band",t},ne1=function(e,t,C){var n,r,i=e.format,o=i===void 0?"native":i,a=e.precision,s=a===void 0?"millisecond":a,l=e.min,c=l===void 0?"auto":l,u=e.max,d=u===void 0?"auto":u,f=e.useUTC,v=f===void 0||f,g=e.nice,h=g!==void 0&&g,m=x$({format:o,precision:s,useUTC:v});n=c==="auto"?m(t.min):o!=="native"?m(c):c,r=d==="auto"?m(t.max):o!=="native"?m(d):d;var p=v?qw():Zw();p.range([0,C]),n&&r&&p.domain([n,r]),h===!0?p.nice():typeof h!="object"&&typeof h!="number"||p.nice(h);var x=p;return x.type="time",x.useUTC=v,x},re1=function(e,t,C,n){var r,i=e.base,o=i===void 0?10:i,a=e.min,s=a===void 0?"auto":a,l=e.max,c=l===void 0?"auto":l;if(t.all.some(function(g){return g===0}))throw new Error("a log scale domain must not include or cross zero");var u,d,f=!1;if(t.all.filter(function(g){return g!=null}).forEach(function(g){f||(r===void 0?r=Math.sign(g):Math.sign(g)!==r&&(f=!0))}),f)throw new Error("a log scale domain must be strictly-positive or strictly-negative");u=s==="auto"?t.min:s,d=c==="auto"?t.max:c;var v=Fl().domain([u,d]).rangeRound(n==="x"?[0,C]:[C,0]).base(o).nice();return v.type="log",v},ie1=function(e,t,C,n){var r,i,o=e.constant,a=o===void 0?1:o,s=e.min,l=s===void 0?"auto":s,c=e.max,u=c===void 0?"auto":c,d=e.reverse,f=d!==void 0&&d;r=l==="auto"?t.min:l,i=u==="auto"?t.max:u;var v=zl().constant(a).rangeRound(n==="x"?[0,C]:[C,0]).nice();f===!0?v.domain([i,r]):v.domain([r,i]);var g=v;return g.type="symlog",g},oe1=function(e){return e==="x"?"y":"x"},ae1=function(e,t){return e===t},se1=function(e,t){return e.getTime()===t.getTime()};function Zv(e,t,C,n){switch(e.type){case"linear":return Q01(e,t,C,n);case"point":return ee1(e,t,C);case"band":return te1(e,t,C,n);case"time":return ne1(e,t,C);case"log":return re1(e,t,C,n);case"symlog":return ie1(e,t,C,n);default:throw new Error("invalid scale spec")}}var qv=function(e,t,C){var n;if("stacked"in C&&C.stacked){var r=e.data[t==="x"?"xStacked":"yStacked"];return r==null?null:C(r)}return(n=C(e.data[t]))!=null?n:null},w$=function(e,t,C,n,r){var i=e.map(function(c){return function(u){return t8({},u,{data:u.data.map(function(d){return{data:t8({},d)}})})}(c)}),o=le1(i,t,C);"stacked"in t&&t.stacked===!0&&ce1(o,i),"stacked"in C&&C.stacked===!0&&ue1(o,i);var a=Zv(t,o.x,n,"x"),s=Zv(C,o.y,r,"y"),l=i.map(function(c){return t8({},c,{data:c.data.map(function(u){return t8({},u,{position:{x:qv(u,"x",a),y:qv(u,"y",s)}})})})});return t8({},o,{series:l,xScale:a,yScale:s})},le1=function(e,t,C){return{x:Gv(e,"x",t),y:Gv(e,"y",C)}},Gv=function(e,t,C,n){var r={},i=r.getValue,o=i===void 0?function(v){return v.data[t]}:i,a=r.setValue,s=a===void 0?function(v,g){v.data[t]=g}:a;if(C.type==="linear")e.forEach(function(v){v.data.forEach(function(g){var h=o(g);h&&s(g,parseFloat(String(h)))})});else if(C.type==="time"&&C.format!=="native"){var l=x$(C);e.forEach(function(v){v.data.forEach(function(g){var h=o(g);h&&s(g,l(h))})})}var c=[];switch(e.forEach(function(v){v.data.forEach(function(g){c.push(o(g))})}),C.type){case"linear":var u=N01(Bo(c).filter(function(v){return v!==null}),function(v){return v});return{all:u,min:Math.min.apply(Math,u),max:Math.max.apply(Math,u)};case"time":var d=_a(c,function(v){return v.getTime()}).slice(0).sort(function(v,g){return g.getTime()-v.getTime()}).reverse();return{all:d,min:d[0],max:c1(d)};default:var f=Bo(c);return{all:f,min:f[0],max:c1(f)}}},S$=function(e,t,C){var n=oe1(e),r=[];t[n].all.forEach(function(i){var o=Y01(i)?se1:ae1,a=[];C.forEach(function(s){var l=s.data.find(function(f){return o(f.data[n],i)}),c=null,u=null;if(l!==void 0){if((c=l.data[e])!==null){var d=c1(a);d===void 0?u=c:d!==null&&(u=d+c)}l.data[e==="x"?"xStacked":"yStacked"]=u}a.push(u),u!==null&&r.push(u)})}),t[e].minStacked=Math.min.apply(Math,r),t[e].maxStacked=Math.max.apply(Math,r)},ce1=function(e,t){return S$("x",e,t)},ue1=function(e,t){return S$("y",e,t)},$$=function(e){var t=e.bandwidth();if(t===0)return e;var C=t/2;return e.round()&&(C=Math.round(C)),function(n){var r;return((r=e(n))!=null?r:0)+C}},M$={millisecond:[f7,f7],second:[w8,w8],minute:[Rn,Dn],hour:[Hn,Fn],day:[w2(function(e){return e.setHours(0,0,0,0)},function(e,t){return e.setDate(e.getDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)}),w2(function(e){return e.setUTCHours(0,0,0,0)},function(e,t){return e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)})],week:[S8,$8],sunday:[S8,$8],monday:[kn,zn],tuesday:[Ln,Bn],wednesday:[Pn,Wn],thursday:[jn,Un],friday:[In,Zn],saturday:[An,qn],month:[Nn,Gn],year:[xe,we]},de1=Object.keys(M$),fe1=new RegExp("^every\\s*(\\d+)?\\s*("+de1.join("|")+")s?$","i"),E$=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var C=t.match(fe1);if(C){var n=C[1],r=C[2],i=M$[r][e.useUTC?1:0];if(r==="day"){var o,a,s=e.domain(),l=s[0],c=s[1],u=new Date(c);return u.setDate(u.getDate()+1),(o=(a=i.every(Number(n??1)))==null?void 0:a.range(l,u))!=null?o:[]}if(n===void 0)return e.ticks(i);var d=i.every(Number(n));if(d)return e.ticks(d)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(f=t)=="number"&&isFinite(f)&&Math.floor(f)===f)return e.ticks(t)}var f;return e.domain()};function D4(){return D4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},D4.apply(this,arguments)}var _$=function(e){var t,C=e.axis,n=e.scale,r=e.ticksPosition,i=e.tickValues,o=e.tickSize,a=e.tickPadding,s=e.tickRotation,l=e.truncateTickAt,c=e.engine,u=c===void 0?"svg":c,d=E$(n,i),f=q41[u],v="bandwidth"in n?$$(n):n,g={lineX:0,lineY:0},h={textX:0,textY:0},m=typeof document=="object"&&document.dir==="rtl",p=f.align.center,x=f.baseline.center;return C==="x"?(t=function(S){var w;return{x:(w=v(S))!=null?w:0,y:0}},g.lineY=o*(r==="after"?1:-1),h.textY=(o+a)*(r==="after"?1:-1),x=r==="after"?f.baseline.top:f.baseline.bottom,s===0?p=f.align.center:r==="after"&&s<0||r==="before"&&s>0?(p=f.align[m?"left":"right"],x=f.baseline.center):(r==="after"&&s>0||r==="before"&&s<0)&&(p=f.align[m?"right":"left"],x=f.baseline.center)):(t=function(S){var w;return{x:0,y:(w=v(S))!=null?w:0}},g.lineX=o*(r==="after"?1:-1),h.textX=(o+a)*(r==="after"?1:-1),p=r==="after"?f.align.left:f.align.right),{ticks:d.map(function(S){var w=typeof S=="string"?function(M){var _=String(M).length;return l&&l>0&&_>l?""+String(M).slice(0,l).concat("..."):""+M}(S):S;return D4({key:S instanceof Date?""+S.valueOf():""+S,value:w},t(S),g,h)}),textAlign:p,textBaseline:x}},O$=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var C=F8(e);return function(n){return C(n instanceof Date?n:new Date(n))}}return A8(e)},Oa=function(e){var t,C=e.width,n=e.height,r=e.scale,i=e.axis,o=e.values,a=(t=o,(Array.isArray(t)?o:void 0)||E$(r,o)),s="bandwidth"in r?$$(r):r,l=i==="x"?a.map(function(c){var u,d;return{key:c instanceof Date?""+c.valueOf():""+c,x1:(u=s(c))!=null?u:0,x2:(d=s(c))!=null?d:0,y1:0,y2:n}}):a.map(function(c){var u,d;return{key:c instanceof Date?""+c.valueOf():""+c,x1:0,x2:C,y1:(u=s(c))!=null?u:0,y2:(d=s(c))!=null?d:0}});return l},he1=$.memo(function(e){var t,C=e.value,n=e.format,r=e.lineX,i=e.lineY,o=e.onClick,a=e.textBaseline,s=e.textAnchor,l=e.animatedProps,c=W5(),u=c.axis.ticks.line,d=c.axis.ticks.text,f=(t=n==null?void 0:n(C))!=null?t:C,v=$.useMemo(function(){var g={opacity:l.opacity};return o?{style:D4({},g,{cursor:"pointer"}),onClick:function(h){return o(h,f)}}:{style:g}},[l.opacity,o,f]);return b.jsxs(e5.g,D4({transform:l.transform},v,{children:[b.jsx("line",{x1:0,x2:r,y1:0,y2:i,style:u}),d.outlineWidth>0&&b.jsx(e5.text,{dominantBaseline:a,textAnchor:s,transform:l.textTransform,style:d,strokeWidth:2*d.outlineWidth,stroke:d.outlineColor,strokeLinejoin:"round",children:""+f}),b.jsx(e5.text,{dominantBaseline:a,textAnchor:s,transform:l.textTransform,style:fu(d),children:""+f})]}))}),ge1=function(e){var t=e.axis,C=e.scale,n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.length,s=e.ticksPosition,l=e.tickValues,c=e.tickSize,u=c===void 0?5:c,d=e.tickPadding,f=d===void 0?5:d,v=e.tickRotation,g=v===void 0?0:v,h=e.format,m=e.renderTick,p=m===void 0?he1:m,x=e.truncateTickAt,S=e.legend,w=e.legendPosition,M=w===void 0?"end":w,_=e.legendOffset,E=_===void 0?0:_,O=e.onClick,T=e.ariaHidden,k=W5(),A=k.axis.legend.text,V=$.useMemo(function(){return O$(h,C)},[h,C]),R=_$({axis:t,scale:C,ticksPosition:s,tickValues:l,tickSize:u,tickPadding:f,tickRotation:g,truncateTickAt:x}),P=R.ticks,L=R.textAlign,H=R.textBaseline,I=null;if(S!==void 0){var j,N=0,z=0,q=0;t==="y"?(q=-90,N=E,M==="start"?(j="start",z=a):M==="middle"?(j="middle",z=a/2):M==="end"&&(j="end")):(z=E,M==="start"?j="start":M==="middle"?(j="middle",N=a/2):M==="end"&&(j="end",N=a)),I=b.jsxs(b.Fragment,{children:[A.outlineWidth>0&&b.jsx("text",{transform:"translate("+N+", "+z+") rotate("+q+")",textAnchor:j,style:D4({dominantBaseline:"central"},A),strokeWidth:2*A.outlineWidth,stroke:A.outlineColor,strokeLinejoin:"round",children:S}),b.jsx("text",{transform:"translate("+N+", "+z+") rotate("+q+")",textAnchor:j,style:D4({dominantBaseline:"central"},A),children:S})]})}var G=A2(),Y=G.animate,e1=G.config,Q=X5({transform:"translate("+r+","+o+")",lineX2:t==="x"?a:0,lineY2:t==="x"?0:a,config:e1,immediate:!Y}),K=$.useCallback(function(U){return{opacity:1,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+g+")"}},[g]),J=$.useCallback(function(U){return{opacity:0,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+g+")"}},[g]),W=p4(P,{keys:function(U){return U.key},initial:K,from:J,enter:K,update:K,leave:{opacity:0},config:e1,immediate:!Y});return b.jsxs(e5.g,{transform:Q.transform,"aria-hidden":T,children:[W(function(U,Z,D,n1){return y.createElement(p,D4({tickIndex:n1,format:V,rotate:g,textBaseline:H,textAnchor:L,truncateTickAt:x,animatedProps:U},Z,O?{onClick:O}:{}))}),b.jsx(e5.line,{style:k.axis.domain.line,x1:0,x2:Q.lineX2,y1:0,y2:Q.lineY2}),I]})},ve1=$.memo(ge1),V$=["top","right","bottom","left"],T$=$.memo(function(e){var t=e.xScale,C=e.yScale,n=e.width,r=e.height,i={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return b.jsx(b.Fragment,{children:V$.map(function(o){var a=i[o];if(!a)return null;var s=o==="top"||o==="bottom";return b.jsx(ve1,D4({},a,{axis:s?"x":"y",x:o==="right"?n:0,y:o==="bottom"?r:0,scale:s?t:C,length:s?n:r,ticksPosition:o==="top"||o==="left"?"before":"after",truncateTickAt:a.truncateTickAt}),o)})})}),me1=$.memo(function(e){var t=e.animatedProps,C=W5();return b.jsx(e5.line,D4({},t,C.grid.line))}),Yv=$.memo(function(e){var t=e.lines,C=A2(),n=C.animate,r=C.config,i=p4(t,{keys:function(o){return o.key},initial:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},from:function(o){return{opacity:0,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},enter:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},update:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},leave:{opacity:0},config:r,immediate:!n});return b.jsx("g",{children:i(function(o,a){return $.createElement(me1,D4({},a,{key:a.key,animatedProps:o}))})})}),R$=$.memo(function(e){var t=e.width,C=e.height,n=e.xScale,r=e.yScale,i=e.xValues,o=e.yValues,a=$.useMemo(function(){return!!n&&Oa({width:t,height:C,scale:n,axis:"x",values:i})},[n,i,t,C]),s=$.useMemo(function(){return!!r&&Oa({width:t,height:C,scale:r,axis:"y",values:o})},[C,t,r,o]);return b.jsxs(b.Fragment,{children:[a&&b.jsx(Yv,{lines:a}),s&&b.jsx(Yv,{lines:s})]})}),pe1=function(e,t){var C,n=t.axis,r=t.scale,i=t.x,o=i===void 0?0:i,a=t.y,s=a===void 0?0:a,l=t.length,c=t.ticksPosition,u=t.tickValues,d=t.tickSize,f=d===void 0?5:d,v=t.tickPadding,g=v===void 0?5:v,h=t.tickRotation,m=h===void 0?0:h,p=t.format,x=t.legend,S=t.legendPosition,w=S===void 0?"end":S,M=t.legendOffset,_=M===void 0?0:M,E=t.theme,O=_$({axis:n,scale:r,ticksPosition:c,tickValues:u,tickSize:f,tickPadding:g,tickRotation:m,engine:"canvas"}),T=O.ticks,k=O.textAlign,A=O.textBaseline;e.save(),e.translate(o,s),e.textAlign=k,e.textBaseline=A;var V=E.axis.ticks.text;e.font=(V.fontWeight?V.fontWeight+" ":"")+V.fontSize+"px "+V.fontFamily,((C=E.axis.domain.line.strokeWidth)!=null?C:0)>0&&(e.lineWidth=Number(E.axis.domain.line.strokeWidth),e.lineCap="square",E.axis.domain.line.stroke&&(e.strokeStyle=E.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(n==="x"?l:0,n==="x"?0:l),e.stroke());var R=typeof p=="function"?p:function(j){return""+j};if(T.forEach(function(j){var N;((N=E.axis.ticks.line.strokeWidth)!=null?N:0)>0&&(e.lineWidth=Number(E.axis.ticks.line.strokeWidth),e.lineCap="square",E.axis.ticks.line.stroke&&(e.strokeStyle=E.axis.ticks.line.stroke),e.beginPath(),e.moveTo(j.x,j.y),e.lineTo(j.x+j.lineX,j.y+j.lineY),e.stroke());var z=R(j.value);e.save(),e.translate(j.x+j.textX,j.y+j.textY),e.rotate(N4(m)),V.outlineWidth>0&&(e.strokeStyle=V.outlineColor,e.lineWidth=2*V.outlineWidth,e.lineJoin="round",e.strokeText(""+z,0,0)),E.axis.ticks.text.fill&&(e.fillStyle=V.fill),e.fillText(""+z,0,0),e.restore()}),x!==void 0){var P=0,L=0,H=0,I="center";n==="y"?(H=-90,P=_,w==="start"?(I="start",L=l):w==="middle"?(I="center",L=l/2):w==="end"&&(I="end")):(L=_,w==="start"?I="start":w==="middle"?(I="center",P=l/2):w==="end"&&(I="end",P=l)),e.translate(P,L),e.rotate(N4(H)),e.font=(E.axis.legend.text.fontWeight?E.axis.legend.text.fontWeight+" ":"")+E.axis.legend.text.fontSize+"px "+E.axis.legend.text.fontFamily,E.axis.legend.text.fill&&(e.fillStyle=E.axis.legend.text.fill),e.textAlign=I,e.textBaseline="middle",e.fillText(x,0,0)}e.restore()},H$=function(e,t){var C=t.xScale,n=t.yScale,r=t.width,i=t.height,o=t.top,a=t.right,s=t.bottom,l=t.left,c=t.theme,u={top:o,right:a,bottom:s,left:l};V$.forEach(function(d){var f=u[d];if(!f)return null;var v=d==="top"||d==="bottom",g=d==="top"||d==="left"?"before":"after",h=v?C:n,m=O$(f.format,h);pe1(e,D4({},f,{axis:v?"x":"y",x:d==="right"?r:0,y:d==="bottom"?i:0,scale:h,format:m,length:v?r:i,ticksPosition:g,theme:c}))})},hC=function(e,t){var C=t.width,n=t.height,r=t.scale,i=t.axis,o=t.values;Oa({width:C,height:n,scale:r,axis:i,values:o}).forEach(function(a){e.beginPath(),e.moveTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.stroke()})},be1=b$;function ye1(e,t){var C=[];return be1(e,function(n,r,i){t(n,r,i)&&C.push(n)}),C}var xe1=ye1,we1=_S,Se1=xe1,$e1=mu,Me1=b4;function Ee1(e,t){var C=Me1(e)?we1:Se1;return C(e,$e1(t))}var _e1=Ee1;const pu=p2(_e1);var Oe1=g7,Ve1=Z4,Te1="[object Number]";function Re1(e){return typeof e=="number"||Ve1(e)&&Oe1(e)==Te1}var He1=Re1;const M8=p2(He1);function ke1(e,t,C){var n=-1,r=e.length;t<0&&(t=-t>r?0:r+t),C=C>r?r:C,C<0&&(C+=r),r=t>C?0:C-t>>>0,t>>>=0;for(var i=Array(r);++n<r;)i[n]=e[n+t];return i}var k$=ke1,Le1=he,Pe1=k$;function je1(e,t){return t.length<2?e:Le1(e,Pe1(t,0,-1))}var Ie1=je1,Ae1=o6,Ne1=Ow,De1=Ie1,Fe1=a6;function ze1(e,t){return t=Ae1(t,e),e=De1(e,t),e==null||delete e[Fe1(Ne1(t))]}var Be1=ze1,We1=Ml;function Ue1(e){return We1(e)?void 0:e}var Ze1=Ue1,qe1=un,Ge1=c$,Ye1=Be1,Ke1=o6,Xe1=i6,Qe1=Ze1,Je1=SS,et1=o$,tt1=1,Ct1=2,nt1=4,rt1=Je1(function(e,t){var C={};if(e==null)return C;var n=!1;t=qe1(t,function(i){return i=Ke1(i,e),n||(n=i.length>1),i}),Xe1(e,et1(e),C),n&&(C=Ge1(C,tt1|Ct1|nt1,Qe1));for(var r=t.length;r--;)Ye1(C,t[r]);return C}),it1=rt1;const Z8=p2(it1);function j7(){return j7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},j7.apply(this,arguments)}var Va={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},ot1=function(e){var t=typeof e;return $.isValidElement(e)||t==="string"||t==="function"||t==="object"},at1=function(e){var t=typeof e;return t==="string"||t==="function"},U0=function(e){return e.type==="circle"},Ta=function(e){return e.type==="dot"},Z0=function(e){return e.type==="rect"},st1=function(e){var t=e.data,C=e.annotations,n=e.getPosition,r=e.getDimensions;return C.reduce(function(i,o){var a=o.offset||0;return[].concat(i,pu(t,o.match).map(function(s){var l=n(s),c=r(s);return(U0(o)||Z0(o))&&(c.size=c.size+2*a,c.width=c.width+2*a,c.height=c.height+2*a),j7({},Z8(o,["match","offset"]),l,c,{size:o.size||c.size,datum:s})}))},[])},lt1=function(e,t,C,n){var r=Math.atan2(n-t,C-e);return Z41(Vn(r))},ct1=function(e){var t,C,n=e.x,r=e.y,i=e.noteX,o=e.noteY,a=e.noteWidth,s=a===void 0?Va.noteWidth:a,l=e.noteTextOffset,c=l===void 0?Va.noteTextOffset:l;if(M8(i))t=n+i;else{if(i.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=i.abs}if(M8(o))C=r+o;else{if(o.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");C=o.abs}var u=n,d=r,f=lt1(n,r,t,C);if(U0(e)){var v=f8(N4(f),e.size/2);u+=v.x,d+=v.y}if(Z0(e)){var g=Math.round((f+90)/45)%8;g===0&&(d-=e.height/2),g===1&&(u+=e.width/2,d-=e.height/2),g===2&&(u+=e.width/2),g===3&&(u+=e.width/2,d+=e.height/2),g===4&&(d+=e.height/2),g===5&&(u-=e.width/2,d+=e.height/2),g===6&&(u-=e.width/2),g===7&&(u-=e.width/2,d-=e.height/2)}var h=t,m=t;return(f+90)%360>180?(h-=s,m-=s):m+=s,{points:[[u,d],[t,C],[m,C]],text:[h,C-c],angle:f+90}},ut1=function(e){var t=e.data,C=e.annotations,n=e.getPosition,r=e.getDimensions;return $.useMemo(function(){return st1({data:t,annotations:C,getPosition:n,getDimensions:r})},[t,C,n,r])},dt1=function(e){return $.useMemo(function(){return ct1(e)},[e])},ft1=function(e){var t=e.datum,C=e.x,n=e.y,r=e.note,i=W5(),o=A2(),a=o.animate,s=o.config,l=X5({x:C,y:n,config:s,immediate:!a});return typeof r=="function"?$.createElement(r,{x:C,y:n,datum:t}):b.jsxs(b.Fragment,{children:[i.annotations.text.outlineWidth>0&&b.jsx(e5.text,{x:l.x,y:l.y,style:j7({},i.annotations.text,{strokeLinejoin:"round",strokeWidth:2*i.annotations.text.outlineWidth,stroke:i.annotations.text.outlineColor}),children:r}),b.jsx(e5.text,{x:l.x,y:l.y,style:Z8(i.annotations.text,["outlineWidth","outlineColor"]),children:r})]})},Kv=function(e){var t=e.points,C=e.isOutline,n=C!==void 0&&C,r=W5(),i=$.useMemo(function(){var s=t[0];return t.slice(1).reduce(function(l,c){return l+" L"+c[0]+","+c[1]},"M"+s[0]+","+s[1])},[t]),o=On(i);if(n&&r.annotations.link.outlineWidth<=0)return null;var a=j7({},r.annotations.link);return n&&(a.strokeLinecap="square",a.strokeWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,a.stroke=r.annotations.link.outlineColor,a.opacity=r.annotations.link.outlineOpacity),b.jsx(e5.path,{fill:"none",d:o,style:a})},ht1=function(e){var t=e.x,C=e.y,n=e.size,r=W5(),i=A2(),o=i.animate,a=i.config,s=X5({x:t,y:C,radius:n/2,config:a,immediate:!o});return b.jsxs(b.Fragment,{children:[r.annotations.outline.outlineWidth>0&&b.jsx(e5.circle,{cx:s.x,cy:s.y,r:s.radius,style:j7({},r.annotations.outline,{fill:"none",strokeWidth:r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,stroke:r.annotations.outline.outlineColor,opacity:r.annotations.outline.outlineOpacity})}),b.jsx(e5.circle,{cx:s.x,cy:s.y,r:s.radius,style:r.annotations.outline})]})},gt1=function(e){var t=e.x,C=e.y,n=e.size,r=n===void 0?Va.dotSize:n,i=W5(),o=A2(),a=o.animate,s=o.config,l=X5({x:t,y:C,radius:r/2,config:s,immediate:!a});return b.jsxs(b.Fragment,{children:[i.annotations.outline.outlineWidth>0&&b.jsx(e5.circle,{cx:l.x,cy:l.y,r:l.radius,style:j7({},i.annotations.outline,{fill:"none",strokeWidth:2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),b.jsx(e5.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.symbol})]})},vt1=function(e){var t=e.x,C=e.y,n=e.width,r=e.height,i=e.borderRadius,o=i===void 0?6:i,a=W5(),s=A2(),l=s.animate,c=s.config,u=X5({x:t-n/2,y:C-r/2,width:n,height:r,config:c,immediate:!l});return b.jsxs(b.Fragment,{children:[a.annotations.outline.outlineWidth>0&&b.jsx(e5.rect,{x:u.x,y:u.y,rx:o,ry:o,width:u.width,height:u.height,style:j7({},a.annotations.outline,{fill:"none",strokeWidth:a.annotations.outline.strokeWidth+2*a.annotations.outline.outlineWidth,stroke:a.annotations.outline.outlineColor,opacity:a.annotations.outline.outlineOpacity})}),b.jsx(e5.rect,{x:u.x,y:u.y,rx:o,ry:o,width:u.width,height:u.height,style:a.annotations.outline})]})},mt1=function(e){var t=e.datum,C=e.x,n=e.y,r=e.note,i=dt1(e);if(!ot1(r))throw new Error("note should be a valid react element");return b.jsxs(b.Fragment,{children:[b.jsx(Kv,{points:i.points,isOutline:!0}),U0(e)&&b.jsx(ht1,{x:C,y:n,size:e.size}),Ta(e)&&b.jsx(gt1,{x:C,y:n,size:e.size}),Z0(e)&&b.jsx(vt1,{x:C,y:n,width:e.width,height:e.height,borderRadius:e.borderRadius}),b.jsx(Kv,{points:i.points}),b.jsx(ft1,{datum:t,x:i.text[0],y:i.text[1],note:r})]})},Xv=function(e,t){t.forEach(function(C,n){var r=C[0],i=C[1];n===0?e.moveTo(r,i):e.lineTo(r,i)})},pt1=function(e,t){var C=t.annotations,n=t.theme;C.length!==0&&(e.save(),C.forEach(function(r){if(!at1(r.note))throw new Error("note is invalid for canvas implementation");n.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=n.annotations.link.outlineColor,e.lineWidth=n.annotations.link.strokeWidth+2*n.annotations.link.outlineWidth,e.beginPath(),Xv(e,r.computed.points),e.stroke(),e.lineCap="butt"),U0(r)&&n.annotations.outline.outlineWidth>0&&(e.strokeStyle=n.annotations.outline.outlineColor,e.lineWidth=n.annotations.outline.strokeWidth+2*n.annotations.outline.outlineWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),Ta(r)&&n.annotations.symbol.outlineWidth>0&&(e.strokeStyle=n.annotations.symbol.outlineColor,e.lineWidth=2*n.annotations.symbol.outlineWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),Z0(r)&&n.annotations.outline.outlineWidth>0&&(e.strokeStyle=n.annotations.outline.outlineColor,e.lineWidth=n.annotations.outline.strokeWidth+2*n.annotations.outline.outlineWidth,e.beginPath(),e.rect(r.x-r.width/2,r.y-r.height/2,r.width,r.height),e.stroke()),e.strokeStyle=n.annotations.link.stroke,e.lineWidth=n.annotations.link.strokeWidth,e.beginPath(),Xv(e,r.computed.points),e.stroke(),U0(r)&&(e.strokeStyle=n.annotations.outline.stroke,e.lineWidth=n.annotations.outline.strokeWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),Ta(r)&&(e.fillStyle=n.annotations.symbol.fill,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.fill()),Z0(r)&&(e.strokeStyle=n.annotations.outline.stroke,e.lineWidth=n.annotations.outline.strokeWidth,e.beginPath(),e.rect(r.x-r.width/2,r.y-r.height/2,r.width,r.height),e.stroke()),typeof r.note=="function"?r.note(e,{datum:r.datum,x:r.computed.text[0],y:r.computed.text[1],theme:n}):(e.font=n.annotations.text.fontSize+"px "+n.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=n.annotations.text.fill,e.strokeStyle=n.annotations.text.outlineColor,e.lineWidth=2*n.annotations.text.outlineWidth,n.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(r.note,r.computed.text[0],r.computed.text[1]),e.lineJoin="miter"),e.fillText(r.note,r.computed.text[0],r.computed.text[1]))}),e.restore())};const a7=11102230246251565e-32,J2=134217729,bt1=(3+8*a7)*a7;function yi(e,t,C,n,r){let i,o,a,s,l=t[0],c=n[0],u=0,d=0;c>l==c>-l?(i=l,l=t[++u]):(i=c,c=n[++d]);let f=0;if(u<e&&d<C)for(c>l==c>-l?(o=l+i,a=i-(o-l),l=t[++u]):(o=c+i,a=i-(o-c),c=n[++d]),i=o,a!==0&&(r[f++]=a);u<e&&d<C;)c>l==c>-l?(o=i+l,s=o-i,a=i-(o-s)+(l-s),l=t[++u]):(o=i+c,s=o-i,a=i-(o-s)+(c-s),c=n[++d]),i=o,a!==0&&(r[f++]=a);for(;u<e;)o=i+l,s=o-i,a=i-(o-s)+(l-s),l=t[++u],i=o,a!==0&&(r[f++]=a);for(;d<C;)o=i+c,s=o-i,a=i-(o-s)+(c-s),c=n[++d],i=o,a!==0&&(r[f++]=a);return(i!==0||f===0)&&(r[f++]=i),f}function yt1(e,t){let C=t[0];for(let n=1;n<e;n++)C+=t[n];return C}function Se(e){return new Float64Array(e)}const xt1=(3+16*a7)*a7,wt1=(2+12*a7)*a7,St1=(9+64*a7)*a7*a7,s9=Se(4),Qv=Se(8),Jv=Se(12),em=Se(16),s4=Se(4);function $t1(e,t,C,n,r,i,o){let a,s,l,c,u,d,f,v,g,h,m,p,x,S,w,M,_,E;const O=e-r,T=C-r,k=t-i,A=n-i;S=O*A,d=J2*O,f=d-(d-O),v=O-f,d=J2*A,g=d-(d-A),h=A-g,w=v*h-(S-f*g-v*g-f*h),M=k*T,d=J2*k,f=d-(d-k),v=k-f,d=J2*T,g=d-(d-T),h=T-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,s9[0]=w-(m+u)+(u-_),p=S+m,u=p-S,x=S-(p-u)+(m-u),m=x-M,u=x-m,s9[1]=x-(m+u)+(u-M),E=p+m,u=E-p,s9[2]=p-(E-u)+(m-u),s9[3]=E;let V=yt1(4,s9),R=wt1*o;if(V>=R||-V>=R||(u=e-O,a=e-(O+u)+(u-r),u=C-T,l=C-(T+u)+(u-r),u=t-k,s=t-(k+u)+(u-i),u=n-A,c=n-(A+u)+(u-i),a===0&&s===0&&l===0&&c===0)||(R=St1*o+bt1*Math.abs(V),V+=O*c+A*a-(k*l+T*s),V>=R||-V>=R))return V;S=a*A,d=J2*a,f=d-(d-a),v=a-f,d=J2*A,g=d-(d-A),h=A-g,w=v*h-(S-f*g-v*g-f*h),M=s*T,d=J2*s,f=d-(d-s),v=s-f,d=J2*T,g=d-(d-T),h=T-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,s4[0]=w-(m+u)+(u-_),p=S+m,u=p-S,x=S-(p-u)+(m-u),m=x-M,u=x-m,s4[1]=x-(m+u)+(u-M),E=p+m,u=E-p,s4[2]=p-(E-u)+(m-u),s4[3]=E;const P=yi(4,s9,4,s4,Qv);S=O*c,d=J2*O,f=d-(d-O),v=O-f,d=J2*c,g=d-(d-c),h=c-g,w=v*h-(S-f*g-v*g-f*h),M=k*l,d=J2*k,f=d-(d-k),v=k-f,d=J2*l,g=d-(d-l),h=l-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,s4[0]=w-(m+u)+(u-_),p=S+m,u=p-S,x=S-(p-u)+(m-u),m=x-M,u=x-m,s4[1]=x-(m+u)+(u-M),E=p+m,u=E-p,s4[2]=p-(E-u)+(m-u),s4[3]=E;const L=yi(P,Qv,4,s4,Jv);S=a*c,d=J2*a,f=d-(d-a),v=a-f,d=J2*c,g=d-(d-c),h=c-g,w=v*h-(S-f*g-v*g-f*h),M=s*l,d=J2*s,f=d-(d-s),v=s-f,d=J2*l,g=d-(d-l),h=l-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,s4[0]=w-(m+u)+(u-_),p=S+m,u=p-S,x=S-(p-u)+(m-u),m=x-M,u=x-m,s4[1]=x-(m+u)+(u-M),E=p+m,u=E-p,s4[2]=p-(E-u)+(m-u),s4[3]=E;const H=yi(L,Jv,4,s4,em);return em[H-1]}function it(e,t,C,n,r,i){const o=(t-i)*(C-r),a=(e-r)*(n-i),s=o-a,l=Math.abs(o+a);return Math.abs(s)>=xt1*l?s:-$t1(e,t,C,n,r,i,l)}const tm=Math.pow(2,-52),ot=new Uint32Array(512);class gC{static from(t,C=Vt1,n=Tt1){const r=t.length,i=new Float64Array(r*2);for(let o=0;o<r;o++){const a=t[o];i[2*o]=C(a),i[2*o+1]=n(a)}return new gC(i)}constructor(t){const C=t.length>>1;if(C>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*C-5,0);this._triangles=new Uint32Array(n*3),this._halfedges=new Int32Array(n*3),this._hashSize=Math.ceil(Math.sqrt(C)),this._hullPrev=new Uint32Array(C),this._hullNext=new Uint32Array(C),this._hullTri=new Uint32Array(C),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(C),this._dists=new Float64Array(C),this.update()}update(){const{coords:t,_hullPrev:C,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,s=1/0,l=-1/0,c=-1/0;for(let O=0;O<o;O++){const T=t[2*O],k=t[2*O+1];T<a&&(a=T),k<s&&(s=k),T>l&&(l=T),k>c&&(c=k),this._ids[O]=O}const u=(a+l)/2,d=(s+c)/2;let f,v,g;for(let O=0,T=1/0;O<o;O++){const k=xi(u,d,t[2*O],t[2*O+1]);k<T&&(f=O,T=k)}const h=t[2*f],m=t[2*f+1];for(let O=0,T=1/0;O<o;O++){if(O===f)continue;const k=xi(h,m,t[2*O],t[2*O+1]);k<T&&k>0&&(v=O,T=k)}let p=t[2*v],x=t[2*v+1],S=1/0;for(let O=0;O<o;O++){if(O===f||O===v)continue;const T=_t1(h,m,p,x,t[2*O],t[2*O+1]);T<S&&(g=O,S=T)}let w=t[2*g],M=t[2*g+1];if(S===1/0){for(let k=0;k<o;k++)this._dists[k]=t[2*k]-t[0]||t[2*k+1]-t[1];p9(this._ids,this._dists,0,o-1);const O=new Uint32Array(o);let T=0;for(let k=0,A=-1/0;k<o;k++){const V=this._ids[k],R=this._dists[V];R>A&&(O[T++]=V,A=R)}this.hull=O.subarray(0,T),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(it(h,m,p,x,w,M)<0){const O=v,T=p,k=x;v=g,p=w,x=M,g=O,w=T,M=k}const _=Ot1(h,m,p,x,w,M);this._cx=_.x,this._cy=_.y;for(let O=0;O<o;O++)this._dists[O]=xi(t[2*O],t[2*O+1],_.x,_.y);p9(this._ids,this._dists,0,o-1),this._hullStart=f;let E=3;n[f]=C[g]=v,n[v]=C[f]=g,n[g]=C[v]=f,r[f]=0,r[v]=1,r[g]=2,i.fill(-1),i[this._hashKey(h,m)]=f,i[this._hashKey(p,x)]=v,i[this._hashKey(w,M)]=g,this.trianglesLen=0,this._addTriangle(f,v,g,-1,-1,-1);for(let O=0,T,k;O<this._ids.length;O++){const A=this._ids[O],V=t[2*A],R=t[2*A+1];if(O>0&&Math.abs(V-T)<=tm&&Math.abs(R-k)<=tm||(T=V,k=R,A===f||A===v||A===g))continue;let P=0;for(let N=0,z=this._hashKey(V,R);N<this._hashSize&&(P=i[(z+N)%this._hashSize],!(P!==-1&&P!==n[P]));N++);P=C[P];let L=P,H;for(;H=n[L],it(V,R,t[2*L],t[2*L+1],t[2*H],t[2*H+1])>=0;)if(L=H,L===P){L=-1;break}if(L===-1)continue;let I=this._addTriangle(L,A,n[L],-1,-1,r[L]);r[A]=this._legalize(I+2),r[L]=I,E++;let j=n[L];for(;H=n[j],it(V,R,t[2*j],t[2*j+1],t[2*H],t[2*H+1])<0;)I=this._addTriangle(j,A,H,r[A],-1,r[j]),r[A]=this._legalize(I+2),n[j]=j,E--,j=H;if(L===P)for(;H=C[L],it(V,R,t[2*H],t[2*H+1],t[2*L],t[2*L+1])<0;)I=this._addTriangle(H,A,L,-1,r[L],r[H]),this._legalize(I+2),r[H]=I,n[L]=L,E--,L=H;this._hullStart=C[A]=L,n[L]=C[j]=A,n[A]=j,i[this._hashKey(V,R)]=A,i[this._hashKey(t[2*L],t[2*L+1])]=L}this.hull=new Uint32Array(E);for(let O=0,T=this._hullStart;O<E;O++)this.hull[O]=T,T=n[T];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,C){return Math.floor(Mt1(t-this._cx,C-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:C,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,a===-1){if(i===0)break;t=ot[--i];continue}const l=a-a%3,c=s+(t+1)%3,u=l+(a+2)%3,d=C[o],f=C[t],v=C[c],g=C[u];if(Et1(r[2*d],r[2*d+1],r[2*f],r[2*f+1],r[2*v],r[2*v+1],r[2*g],r[2*g+1])){C[t]=g,C[a]=d;const m=n[u];if(m===-1){let x=this._hullStart;do{if(this._hullTri[x]===u){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,m),this._link(a,n[o]),this._link(o,u);const p=l+(a+1)%3;i<ot.length&&(ot[i++]=p)}else{if(i===0)break;t=ot[--i]}}return o}_link(t,C){this._halfedges[t]=C,C!==-1&&(this._halfedges[C]=t)}_addTriangle(t,C,n,r,i,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=C,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}function Mt1(e,t){const C=e/(Math.abs(e)+Math.abs(t));return(t>0?3-C:1+C)/4}function xi(e,t,C,n){const r=e-C,i=t-n;return r*r+i*i}function Et1(e,t,C,n,r,i,o,a){const s=e-o,l=t-a,c=C-o,u=n-a,d=r-o,f=i-a,v=s*s+l*l,g=c*c+u*u,h=d*d+f*f;return s*(u*h-g*f)-l*(c*h-g*d)+v*(c*f-u*d)<0}function _t1(e,t,C,n,r,i){const o=C-e,a=n-t,s=r-e,l=i-t,c=o*o+a*a,u=s*s+l*l,d=.5/(o*l-a*s),f=(l*c-a*u)*d,v=(o*u-s*c)*d;return f*f+v*v}function Ot1(e,t,C,n,r,i){const o=C-e,a=n-t,s=r-e,l=i-t,c=o*o+a*a,u=s*s+l*l,d=.5/(o*l-a*s),f=e+(l*c-a*u)*d,v=t+(o*u-s*c)*d;return{x:f,y:v}}function p9(e,t,C,n){if(n-C<=20)for(let r=C+1;r<=n;r++){const i=e[r],o=t[i];let a=r-1;for(;a>=C&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=i}else{const r=C+n>>1;let i=C+1,o=n;W6(e,r,i),t[e[C]]>t[e[n]]&&W6(e,C,n),t[e[i]]>t[e[n]]&&W6(e,i,n),t[e[C]]>t[e[i]]&&W6(e,C,i);const a=e[i],s=t[a];for(;;){do i++;while(t[e[i]]<s);do o--;while(t[e[o]]>s);if(o<i)break;W6(e,i,o)}e[C+1]=e[o],e[o]=a,n-i+1>=o-C?(p9(e,t,i,n),p9(e,t,C,o-1)):(p9(e,t,C,o-1),p9(e,t,i,n))}}function W6(e,t,C){const n=e[t];e[t]=e[C],e[C]=n}function Vt1(e){return e[0]}function Tt1(e){return e[1]}const Cm=1e-6;class s8{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,C){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+C}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,C){this._+=`L${this._x1=+t},${this._y1=+C}`}arc(t,C,n){t=+t,C=+C,n=+n;const r=t+n,i=C;if(n<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Cm||Math.abs(this._y1-i)>Cm)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${C}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,C,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+C}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Ra{constructor(){this._=[]}moveTo(t,C){this._.push([t,C])}closePath(){this._.push(this._[0].slice())}lineTo(t,C){this._.push([t,C])}value(){return this._.length?this._:null}}class Rt1{constructor(t,[C,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(C=+C))||!((i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=C,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:C,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let g=0,h=0,m=n.length,p,x;g<m;g+=3,h+=2){const S=n[g]*2,w=n[g+1]*2,M=n[g+2]*2,_=t[S],E=t[S+1],O=t[w],T=t[w+1],k=t[M],A=t[M+1],V=O-_,R=T-E,P=k-_,L=A-E,H=(V*L-R*P)*2;if(Math.abs(H)<1e-9){if(i===void 0){i=o=0;for(const j of C)i+=t[j*2],o+=t[j*2+1];i/=C.length,o/=C.length}const I=1e9*Math.sign((i-_)*L-(o-E)*P);p=(_+k)/2-I*L,x=(E+A)/2+I*P}else{const I=1/H,j=V*V+R*R,N=P*P+L*L;p=_+(L*j-R*N)*I,x=E+(V*N-P*j)*I}a[h]=p,a[h+1]=x}let s=C[C.length-1],l,c=s*4,u,d=t[2*s],f,v=t[2*s+1];r.fill(0);for(let g=0;g<C.length;++g)s=C[g],l=c,u=d,f=v,c=s*4,d=t[2*s],v=t[2*s+1],r[l+2]=r[c]=f-v,r[l+3]=r[c+1]=d-u}render(t){const C=t==null?t=new s8:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:o,vectors:a}=this;if(i.length<=1)return null;for(let c=0,u=n.length;c<u;++c){const d=n[c];if(d<c)continue;const f=Math.floor(c/3)*2,v=Math.floor(d/3)*2,g=o[f],h=o[f+1],m=o[v],p=o[v+1];this._renderSegment(g,h,m,p,t)}let s,l=i[i.length-1];for(let c=0;c<i.length;++c){s=l,l=i[c];const u=Math.floor(r[l]/3)*2,d=o[u],f=o[u+1],v=s*4,g=this._project(d,f,a[v+2],a[v+3]);g&&this._renderSegment(d,f,g[0],g[1],t)}return C&&C.value()}renderBounds(t){const C=t==null?t=new s8:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),C&&C.value()}renderCell(t,C){const n=C==null?C=new s8:void 0,r=this._clip(t);if(r===null||!r.length)return;C.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let o=2;o<i;o+=2)(r[o]!==r[o-2]||r[o+1]!==r[o-1])&&C.lineTo(r[o],r[o+1]);return C.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let C=0,n=t.length/2;C<n;++C){const r=this.cellPolygon(C);r&&(r.index=C,yield r)}}cellPolygon(t){const C=new Ra;return this.renderCell(t,C),C.value()}_renderSegment(t,C,n,r,i){let o;const a=this._regioncode(t,C),s=this._regioncode(n,r);a===0&&s===0?(i.moveTo(t,C),i.lineTo(n,r)):(o=this._clipSegment(t,C,n,r,a,s))&&(i.moveTo(o[0],o[1]),i.lineTo(o[2],o[3]))}contains(t,C,n){return C=+C,C!==C||(n=+n,n!==n)?!1:this.delaunay._step(t,C,n)===t}*neighbors(t){const C=this._clip(t);if(C)for(const n of this.delaunay.neighbors(t)){const r=this._clip(n);if(r){e:for(let i=0,o=C.length;i<o;i+=2)for(let a=0,s=r.length;a<s;a+=2)if(C[i]===r[a]&&C[i+1]===r[a+1]&&C[(i+2)%o]===r[(a+s-2)%s]&&C[(i+3)%o]===r[(a+s-1)%s]){yield n;break e}}}}_cell(t){const{circumcenters:C,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,o=n[t];if(o===-1)return null;const a=[];let s=o;do{const l=Math.floor(s/3);if(a.push(C[l*2],C[l*2+1]),s=s%3===2?s-2:s+1,i[s]!==t)break;s=r[s]}while(s!==o&&s!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const C=this._cell(t);if(C===null)return null;const{vectors:n}=this,r=t*4;return this._simplify(n[r]||n[r+1]?this._clipInfinite(t,C,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,C))}_clipFinite(t,C){const n=C.length;let r=null,i,o,a=C[n-2],s=C[n-1],l,c=this._regioncode(a,s),u,d=0;for(let f=0;f<n;f+=2)if(i=a,o=s,a=C[f],s=C[f+1],l=c,c=this._regioncode(a,s),l===0&&c===0)u=d,d=0,r?r.push(a,s):r=[a,s];else{let v,g,h,m,p;if(l===0){if((v=this._clipSegment(i,o,a,s,l,c))===null)continue;[g,h,m,p]=v}else{if((v=this._clipSegment(a,s,i,o,c,l))===null)continue;[m,p,g,h]=v,u=d,d=this._edgecode(g,h),u&&d&&this._edge(t,u,d,r,r.length),r?r.push(g,h):r=[g,h]}u=d,d=this._edgecode(m,p),u&&d&&this._edge(t,u,d,r,r.length),r?r.push(m,p):r=[m,p]}if(r)u=d,d=this._edgecode(r[0],r[1]),u&&d&&this._edge(t,u,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,C,n,r,i,o){const a=i<o;for(a&&([t,C,n,r,i,o]=[n,r,t,C,o,i]);;){if(i===0&&o===0)return a?[n,r,t,C]:[t,C,n,r];if(i&o)return null;let s,l,c=i||o;c&8?(s=t+(n-t)*(this.ymax-C)/(r-C),l=this.ymax):c&4?(s=t+(n-t)*(this.ymin-C)/(r-C),l=this.ymin):c&2?(l=C+(r-C)*(this.xmax-t)/(n-t),s=this.xmax):(l=C+(r-C)*(this.xmin-t)/(n-t),s=this.xmin),i?(t=s,C=l,i=this._regioncode(t,C)):(n=s,r=l,o=this._regioncode(n,r))}}_clipInfinite(t,C,n,r,i,o){let a=Array.from(C),s;if((s=this._project(a[0],a[1],n,r))&&a.unshift(s[0],s[1]),(s=this._project(a[a.length-2],a[a.length-1],i,o))&&a.push(s[0],s[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,u,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)u=d,d=this._edgecode(a[l],a[l+1]),u&&d&&(l=this._edge(t,u,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,C,n,r,i){for(;C!==n;){let o,a;switch(C){case 5:C=4;continue;case 4:C=6,o=this.xmax,a=this.ymin;break;case 6:C=2;continue;case 2:C=10,o=this.xmax,a=this.ymax;break;case 10:C=8;continue;case 8:C=9,o=this.xmin,a=this.ymax;break;case 9:C=1;continue;case 1:C=5,o=this.xmin,a=this.ymin;break}(r[i]!==o||r[i+1]!==a)&&this.contains(t,o,a)&&(r.splice(i,0,o,a),i+=2)}return i}_project(t,C,n,r){let i=1/0,o,a,s;if(r<0){if(C<=this.ymin)return null;(o=(this.ymin-C)/r)<i&&(s=this.ymin,a=t+(i=o)*n)}else if(r>0){if(C>=this.ymax)return null;(o=(this.ymax-C)/r)<i&&(s=this.ymax,a=t+(i=o)*n)}if(n>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/n)<i&&(a=this.xmax,s=C+(i=o)*r)}else if(n<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/n)<i&&(a=this.xmin,s=C+(i=o)*r)}return[a,s]}_edgecode(t,C){return(t===this.xmin?1:t===this.xmax?2:0)|(C===this.ymin?4:C===this.ymax?8:0)}_regioncode(t,C){return(t<this.xmin?1:t>this.xmax?2:0)|(C<this.ymin?4:C>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let C=0;C<t.length;C+=2){const n=(C+2)%t.length,r=(C+4)%t.length;(t[C]===t[n]&&t[n]===t[r]||t[C+1]===t[n+1]&&t[n+1]===t[r+1])&&(t.splice(n,2),C-=2)}t.length||(t=null)}return t}}const Ht1=2*Math.PI,l9=Math.pow;function kt1(e){return e[0]}function Lt1(e){return e[1]}function Pt1(e){const{triangles:t,coords:C}=e;for(let n=0;n<t.length;n+=3){const r=2*t[n],i=2*t[n+1],o=2*t[n+2];if((C[o]-C[r])*(C[i+1]-C[r+1])-(C[i]-C[r])*(C[o+1]-C[r+1])>1e-10)return!1}return!0}function jt1(e,t,C){return[e+Math.sin(e+t)*C,t+Math.cos(e-t)*C]}class bu{static from(t,C=kt1,n=Lt1,r){return new bu("length"in t?It1(t,C,n,r):Float64Array.from(At1(t,C,n,r)))}constructor(t){this._delaunator=new gC(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,C=this.points;if(t.hull&&t.hull.length>2&&Pt1(t)){this.collinear=Int32Array.from({length:C.length/2},(d,f)=>f).sort((d,f)=>C[2*d]-C[2*f]||C[2*d+1]-C[2*f+1]);const s=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[C[2*s],C[2*s+1],C[2*l],C[2*l+1]],u=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,f=C.length/2;d<f;++d){const v=jt1(C[2*d],C[2*d+1],u);C[2*d]=v[0],C[2*d+1]=v[1]}this._delaunator=new gC(C)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let s=0,l=n.length;s<l;++s){const c=i[s%3===2?s-2:s+1];(n[s]===-1||o[c]===-1)&&(o[c]=s)}for(let s=0,l=r.length;s<l;++s)a[r[s]]=s;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Rt1(this,t)}*neighbors(t){const{inedges:C,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const u=a.indexOf(t);u>0&&(yield a[u-1]),u<a.length-1&&(yield a[u+1]);return}const s=C[t];if(s===-1)return;let l=s,c=-1;do{if(yield c=o[l],l=l%3===2?l-2:l+1,o[l]!==t)return;if(l=i[l],l===-1){const u=n[(r[t]+1)%n.length];u!==c&&(yield u);return}}while(l!==s)}find(t,C,n=0){if(t=+t,t!==t||(C=+C,C!==C))return-1;const r=n;let i;for(;(i=this._step(n,t,C))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,C,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,u=l9(C-l[t*2],2)+l9(n-l[t*2+1],2);const d=r[t];let f=d;do{let v=s[f];const g=l9(C-l[v*2],2)+l9(n-l[v*2+1],2);if(g<u&&(u=g,c=v),f=f%3===2?f-2:f+1,s[f]!==t)break;if(f=a[f],f===-1){if(f=i[(o[t]+1)%i.length],f!==v&&l9(C-l[f*2],2)+l9(n-l[f*2+1],2)<u)return f;break}}while(f!==d);return c}render(t){const C=t==null?t=new s8:void 0,{points:n,halfedges:r,triangles:i}=this;for(let o=0,a=r.length;o<a;++o){const s=r[o];if(s<o)continue;const l=i[o]*2,c=i[s]*2;t.moveTo(n[l],n[l+1]),t.lineTo(n[c],n[c+1])}return this.renderHull(t),C&&C.value()}renderPoints(t,C){C===void 0&&(!t||typeof t.moveTo!="function")&&(C=t,t=null),C=C==null?2:+C;const n=t==null?t=new s8:void 0,{points:r}=this;for(let i=0,o=r.length;i<o;i+=2){const a=r[i],s=r[i+1];t.moveTo(a+C,s),t.arc(a,s,C,0,Ht1)}return n&&n.value()}renderHull(t){const C=t==null?t=new s8:void 0,{hull:n,points:r}=this,i=n[0]*2,o=n.length;t.moveTo(r[i],r[i+1]);for(let a=1;a<o;++a){const s=2*n[a];t.lineTo(r[s],r[s+1])}return t.closePath(),C&&C.value()}hullPolygon(){const t=new Ra;return this.renderHull(t),t.value()}renderTriangle(t,C){const n=C==null?C=new s8:void 0,{points:r,triangles:i}=this,o=i[t*=3]*2,a=i[t+1]*2,s=i[t+2]*2;return C.moveTo(r[o],r[o+1]),C.lineTo(r[a],r[a+1]),C.lineTo(r[s],r[s+1]),C.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let C=0,n=t.length/3;C<n;++C)yield this.trianglePolygon(C)}trianglePolygon(t){const C=new Ra;return this.renderTriangle(t,C),C.value()}}function It1(e,t,C,n){const r=e.length,i=new Float64Array(r*2);for(let o=0;o<r;++o){const a=e[o];i[o*2]=t.call(n,a,o,e),i[o*2+1]=C.call(n,a,o,e)}return i}function*At1(e,t,C,n){let r=0;for(const i of e)yield t.call(n,i,r,e),yield C.call(n,i,r,e),++r}var yu=function(e){return[e.x,e.y]},$e=jS,L$="cursor",P$="top",Nt1=function(e){var t=e.points,C=e.getNodePosition,n=C===void 0?yu:C,r=e.margin,i=r===void 0?$e:r;return t.map(function(o){var a=n(o),s=a[0],l=a[1];return[s+i.left,l+i.top]})},Dt1=function(e){var t=e.points,C=e.width,n=e.height,r=e.margin,i=r===void 0?$e:r,o=e.debug,a=bu.from(t),s=o?a.voronoi([0,0,i.left+C+i.right,i.top+n+i.bottom]):void 0;return{points:t,delaunay:a,voronoi:s}},xu=function(e){var t=e.points,C=e.getNodePosition,n=C===void 0?yu:C,r=e.width,i=e.height,o=e.margin,a=o===void 0?$e:o,s=e.debug;return $.useMemo(function(){return Dt1({points:Nt1({points:t,margin:a,getNodePosition:n}),width:r,height:i,margin:a,debug:s})},[t,r,i,a,s])},Ft1=function(e){var t=e.elementRef,C=e.nodes,n=e.getNodePosition,r=n===void 0?yu:n,i=e.delaunay,o=e.setCurrent,a=e.margin,s=a===void 0?$e:a,l=e.detectionRadius,c=l===void 0?1/0:l,u=e.isInteractive,d=u===void 0||u,f=e.onMouseEnter,v=e.onMouseMove,g=e.onMouseLeave,h=e.onClick,m=e.onTouchStart,p=e.onTouchMove,x=e.onTouchEnd,S=e.enableTouchCrosshair,w=S!==void 0&&S,M=e.tooltip,_=e.tooltipPosition,E=_===void 0?L$:_,O=e.tooltipAnchor,T=O===void 0?P$:O,k=$.useState(null),A=k[0],V=k[1],R=$.useRef(null);$.useEffect(function(){R.current=A},[R,A]);var P=$.useCallback(function(J){if(!t.current)return null;var W=hu(t.current,J),U=W[0],Z=W[1],D=i.find(U,Z),n1=D!==void 0?C[D]:null;if(n1&&c!==1/0){var B=r(n1),r1=B[0],i1=B[1];C31(U,Z,r1+s.left,i1+s.top)>c&&(D=null,n1=null)}return D===null||n1===null?null:[D,n1]},[t,i,C,r,s,c]),L=s3(),H=L.showTooltipAt,I=L.showTooltipFromEvent,j=L.hideTooltip,N=$.useMemo(function(){if(M)return E==="cursor"?function(J,W){I(M(J),W,T)}:function(J){var W=r(J),U=W[0],Z=W[1];H(M(J),[U+s.left,Z+s.top],T)}},[H,I,M,E,T,r,s]),z=$.useCallback(function(J){var W=P(J);if(V(W),o==null||o(W?W[1]:null),W){var U=W[1];N==null||N(U,J),f==null||f(W[1],J)}},[P,V,o,N,f]),q=$.useCallback(function(J){var W=P(J);if(V(W),W){var U=W[0],Z=W[1];if(o==null||o(Z),N==null||N(Z,J),R.current){var D=R.current,n1=D[0],B=D[1];U!==n1?g==null||g(B,J):v==null||v(Z,J)}else f==null||f(Z,J)}else o==null||o(null),j==null||j(),R.current&&(g==null||g(R.current[1],J))},[P,V,R,f,v,g,N,j]),G=$.useCallback(function(J){V(null),o==null||o(null),j(),g&&R.current&&g(R.current[1],J)},[V,o,R,j,g]),Y=$.useCallback(function(J){var W=P(J);V(W),W&&(h==null||h(W[1],J))},[P,V,h]),e1=$.useCallback(function(J){var W=P(J);w&&(V(W),o==null||o(W?W[1]:null)),W&&(m==null||m(W[1],J))},[P,V,o,w,m]),Q=$.useCallback(function(J){var W=P(J);w&&(V(W),o==null||o(W?W[1]:null)),W&&(p==null||p(W[1],J))},[P,V,o,w,p]),K=$.useCallback(function(J){w&&(V(null),o==null||o(null)),x&&R.current&&x(R.current[1],J)},[w,V,o,x,R]);return{current:A,handleMouseEnter:d?z:void 0,handleMouseMove:d?q:void 0,handleMouseLeave:d?G:void 0,handleClick:d?Y:void 0,handleTouchStart:d?e1:void 0,handleTouchMove:d?Q:void 0,handleTouchEnd:d?K:void 0}},j$=function(e){var t=e.nodes,C=e.width,n=e.height,r=e.margin,i=r===void 0?$e:r,o=e.getNodePosition,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd,g=e.enableTouchCrosshair,h=g!==void 0&&g,m=e.detectionRadius,p=m===void 0?1/0:m,x=e.tooltip,S=e.tooltipPosition,w=S===void 0?L$:S,M=e.tooltipAnchor,_=M===void 0?P$:M,E=e.debug,O=$.useRef(null),T=xu({points:t,getNodePosition:o,width:C,height:n,margin:i,debug:E}),k=T.delaunay,A=T.voronoi,V=Ft1({elementRef:O,nodes:t,delaunay:k,margin:i,detectionRadius:p,setCurrent:a,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onClick:u,onTouchStart:d,onTouchMove:f,onTouchEnd:v,enableTouchCrosshair:h,tooltip:x,tooltipPosition:w,tooltipAnchor:_}),R=V.current,P=V.handleMouseEnter,L=V.handleMouseMove,H=V.handleMouseLeave,I=V.handleClick,j=V.handleTouchStart,N=V.handleTouchMove,z=V.handleTouchEnd,q=$.useMemo(function(){if(E&&A)return A.render()},[E,A]);return b.jsxs("g",{ref:O,transform:"translate("+-i.left+","+-i.top+")",children:[E&&A&&b.jsxs(b.Fragment,{children:[b.jsx("path",{d:q,stroke:"red",strokeWidth:1,opacity:.75}),p<1/0&&b.jsx("path",{stroke:"red",strokeWidth:.35,fill:"none",d:k.renderPoints(void 0,p)}),R&&b.jsx("path",{fill:"pink",opacity:.35,d:A.renderCell(R[0])})]}),b.jsx("rect",{"data-ref":"mesh-interceptor",width:i.left+C+i.right,height:i.top+n+i.bottom,fill:"red",opacity:0,style:{cursor:"auto"},onMouseEnter:P,onMouseMove:L,onMouseLeave:H,onTouchStart:j,onTouchMove:N,onTouchEnd:z,onClick:I})]})},I$=function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()},A$=function(e,t,C){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(C,e),e.fillStyle="pink",e.fill(),e.restore()};function O4(){return O4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},O4.apply(this,arguments)}function N$(e,t){if(e==null)return{};var C,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)C=i[n],t.indexOf(C)>=0||(r[C]=e[C]);return r}var zt1=function(e){if(typeof e=="function")return e;if(M8(e))return function(){return e};if(function(C){return B7(C)}(e)){if(!vn(e.key))throw new Error("symbolSize is invalid, key should be a string pointing to the property to use to determine node size");if(!Array.isArray(e.values)||e.values.length!==2)throw new Error("symbolSize is invalid, values spec should be an array containing two values, min and max");if(!Array.isArray(e.sizes)||e.sizes.length!==2)throw new Error("symbolSize is invalid, sizes spec should be an array containing two values, min and max");var t=P8().domain([e.values[0],e.values[1]]).range([e.sizes[0],e.sizes[1]]);return function(C){return t(v2(C,e.key))}}throw new Error("nodeSize is invalid, it should be either a function, a number or an object")},D$=function(e){var t,C=e.data,n=e.xScaleSpec,r=e.xFormat,i=e.yScaleSpec,o=e.yFormat,a=e.width,s=e.height,l=e.nodeId,c=e.nodeSize,u=e.colors,d=$.useMemo(function(){return w$(C,n,i,a,s)},[C,n,i,a,s]),f=d.series,v=d.xScale,g=d.yScale,h=L7(r),m=L7(o),p=m3(l),x=$.useMemo(function(){return function(M){var _=M.series,E=M.formatX,O=M.formatY,T=M.getNodeId,k=[];return _.forEach(function(A){A.data.forEach(function(V,R){var P={index:k.length,serieIndex:R,serieId:A.id,x:V.position.x,xValue:V.data.x,formattedX:E(V.data.x),y:V.position.y,yValue:V.data.y,formattedY:O(V.data.y),data:V.data};k.push(O4({},P,{id:T(P)}))})}),k}({series:f,formatX:h,formatY:m,getNodeId:p})},[f,h,m,p]),S=$.useMemo(function(){return zt1(t)},[t=c]),w=ye(u,"serieId");return{xScale:v,yScale:g,nodes:$.useMemo(function(){return x.map(function(M){return O4({},M,{size:S(M),color:w({serieId:M.serieId})})})},[x,S,w]),legendData:$.useMemo(function(){return f.map(function(M){return{id:M.id,label:M.id,color:w({serieId:M.id})}})},[f,w])}},F$=function(e,t){return ut1({data:e,annotations:t,getPosition:function(C){return{x:C.x,y:C.y}},getDimensions:function(C){return{size:C.size,width:C.size,height:C.size}}})},Bt1=function(e){return e/2},z$={xScale:{type:"linear",min:0,max:"auto"},yScale:{type:"linear",min:0,max:"auto"},enableGridX:!0,enableGridY:!0,axisBottom:{},axisLeft:{},nodeId:function(e){return e.serieId+"."+e.index},nodeSize:9,nodeComponent:function(e){var t=e.node,C=e.style,n=e.blendMode,r=e.isInteractive,i=e.onMouseEnter,o=e.onMouseMove,a=e.onMouseLeave,s=e.onClick,l=$.useCallback(function(f){return i==null?void 0:i(t,f)},[t,i]),c=$.useCallback(function(f){return o==null?void 0:o(t,f)},[t,o]),u=$.useCallback(function(f){return a==null?void 0:a(t,f)},[t,a]),d=$.useCallback(function(f){return s==null?void 0:s(t,f)},[t,s]);return b.jsx(e5.circle,{cx:C.x,cy:C.y,r:C.size.to(Bt1),fill:C.color,style:{mixBlendMode:n},onMouseEnter:r?l:void 0,onMouseMove:r?c:void 0,onMouseLeave:r?u:void 0,onClick:r?d:void 0})},colors:{scheme:"nivo"},isInteractive:!0,debugMesh:!1,tooltip:function(e){var t=e.node;return b.jsx(L9,{id:t.serieId,value:"x: "+t.formattedX+", y: "+t.formattedY,enableChip:!0,color:t.color})},markers:[],legends:[],annotations:[]},h2=O4({},z$,{blendMode:"normal",layers:["grid","axes","nodes","markers","mesh","legends","annotations"],role:"img",useMesh:!0,animate:!0,motionConfig:"default"}),e4=O4({},z$,{layers:["grid","axes","nodes","mesh","legends","annotations"],pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,renderNode:function(e,t){e.beginPath(),e.arc(t.x,t.y,t.size/2,0,2*Math.PI),e.fillStyle=t.color,e.fill()}}),Wt1=function(e){var t=e.nodes,C=e.annotations,n=F$(t,C);return b.jsx(b.Fragment,{children:n.map(function(r,i){return b.jsx(mt1,O4({},r),i)})})},Ut1=function(e){return e.id},wi=function(e){return{x:e.x,y:e.y,size:e.size,color:e.color}},Zt1=function(e){return{x:e.x,y:e.y,size:0,color:e.color}},qt1=function(e){var t=e.nodes,C=e.nodeComponent,n=e.isInteractive,r=e.onMouseEnter,i=e.onMouseMove,o=e.onMouseLeave,a=e.onClick,s=e.tooltip,l=e.blendMode,c=A2(),u=c.animate,d=c.config,f=p4(t,{keys:Ut1,from:wi,enter:wi,update:wi,leave:Zt1,config:d,immediate:!u}),v=s3(),g=v.showTooltipFromEvent,h=v.hideTooltip,m=$.useCallback(function(w,M){g($.createElement(s,{node:w}),M),r==null||r(w,M)},[s,g,r]),p=$.useCallback(function(w,M){g($.createElement(s,{node:w}),M),i==null||i(w,M)},[s,g,i]),x=$.useCallback(function(w,M){h(),o==null||o(w,M)},[h,o]),S=$.useCallback(function(w,M){return a==null?void 0:a(w,M)},[a]);return b.jsx(b.Fragment,{children:f(function(w,M){return $.createElement(C,{node:M,style:w,blendMode:l,isInteractive:n,onMouseEnter:n?m:void 0,onMouseMove:n?p:void 0,onMouseLeave:n?x:void 0,onClick:n?S:void 0})})})},Gt1=function(e){var t=e.nodes,C=e.width,n=e.height,r=e.onMouseEnter,i=e.onMouseMove,o=e.onMouseLeave,a=e.onClick,s=e.tooltip,l=e.debug,c=s3(),u=c.showTooltipFromEvent,d=c.hideTooltip,f=$.useCallback(function(m,p){u($.createElement(s,{node:m}),p),r&&r(m,p)},[u,s,r]),v=$.useCallback(function(m,p){u($.createElement(s,{node:m}),p),i&&i(m,p)},[u,s,i]),g=$.useCallback(function(m,p){d(),o&&o(m,p)},[d,o]),h=$.useCallback(function(m,p){a&&a(m,p)},[a]);return b.jsx(j$,{nodes:t,width:C,height:n,onMouseEnter:f,onMouseMove:v,onMouseLeave:g,onClick:h,debug:l})},Yt1=["isInteractive","animate","motionConfig","theme","renderWrapper"],Kt1=function(e){var t=e.data,C=e.xScale,n=C===void 0?h2.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?h2.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.margin,u=e.layers,d=u===void 0?h2.layers:u,f=e.colors,v=f===void 0?h2.colors:f,g=e.blendMode,h=g===void 0?h2.blendMode:g,m=e.nodeId,p=m===void 0?h2.nodeId:m,x=e.nodeSize,S=x===void 0?h2.nodeSize:x,w=e.nodeComponent,M=w===void 0?h2.nodeComponent:w,_=e.enableGridX,E=_===void 0?h2.enableGridX:_,O=e.enableGridY,T=O===void 0?h2.enableGridY:O,k=e.gridXValues,A=e.gridYValues,V=e.axisTop,R=e.axisRight,P=e.axisBottom,L=P===void 0?h2.axisBottom:P,H=e.axisLeft,I=H===void 0?h2.axisLeft:H,j=e.annotations,N=j===void 0?h2.annotations:j,z=e.isInteractive,q=z===void 0?h2.isInteractive:z,G=e.useMesh,Y=G===void 0?h2.useMesh:G,e1=e.debugMesh,Q=e1===void 0?h2.debugMesh:e1,K=e.onMouseEnter,J=e.onMouseMove,W=e.onMouseLeave,U=e.onClick,Z=e.tooltip,D=Z===void 0?h2.tooltip:Z,n1=e.markers,B=n1===void 0?h2.markers:n1,r1=e.legends,i1=r1===void 0?h2.legends:r1,g1=e.role,y1=g1===void 0?h2.role:g1,m1=e.ariaLabel,b1=e.ariaLabelledBy,S1=e.ariaDescribedBy,v1=z8(s,l,c),h1=v1.margin,l1=v1.innerWidth,$1=v1.innerHeight,f1=v1.outerWidth,A1=v1.outerHeight,I1=D$({data:t,xScaleSpec:n,xFormat:r,yScaleSpec:o,yFormat:a,width:l1,height:$1,nodeId:p,nodeSize:S,colors:v}),R1=I1.xScale,k1=I1.yScale,Y1=I1.nodes,X1=I1.legendData,D1=$.useMemo(function(){return{xScale:R1,yScale:k1,nodes:Y1,margin:h1,innerWidth:l1,innerHeight:$1,outerWidth:f1,outerHeight:A1}},[R1,k1,Y1,h1,l1,$1,f1,A1]),L1={grid:null,axes:null,nodes:null,markers:null,mesh:null,annotations:null,legends:null};return d.includes("grid")&&(L1.grid=b.jsx(R$,{width:l1,height:$1,xScale:E?R1:null,yScale:T?k1:null,xValues:k,yValues:A},"grid")),d.includes("axes")&&(L1.axes=b.jsx(T$,{xScale:R1,yScale:k1,width:l1,height:$1,top:V,right:R,bottom:L,left:I},"axes")),d.includes("nodes")&&(L1.nodes=b.jsx(qt1,{nodes:Y1,nodeComponent:M,isInteractive:q,tooltip:D,blendMode:h,onMouseEnter:K,onMouseMove:J,onMouseLeave:W,onClick:U},"nodes")),d.includes("markers")&&(L1.markers=b.jsx(YS,{markers:B,width:l1,height:$1,xScale:R1,yScale:k1},"markers")),d.includes("mesh")&&q&&Y&&(L1.mesh=b.jsx(Gt1,{nodes:Y1,width:l1,height:$1,onMouseEnter:K,onMouseMove:J,onMouseLeave:W,onClick:U,tooltip:D,debug:Q},"mesh")),d.includes("annotations")&&(L1.annotations=b.jsx(Wt1,{nodes:Y1,annotations:N},"annotations")),d.includes("legends")&&(L1.legends=i1.map(function(Q1,U1){return b.jsx(Tn,O4({},Q1,{containerWidth:l1,containerHeight:$1,data:X1}),U1)})),b.jsx(y6,{width:f1,height:A1,margin:h1,role:y1,ariaLabel:m1,ariaLabelledBy:b1,ariaDescribedBy:S1,children:d.map(function(Q1,U1){if(typeof Q1=="string"&&L1[Q1]!==void 0)return L1[Q1];if(typeof Q1=="function")return b.jsx($.Fragment,{children:$.createElement(Q1,D1)},U1);throw new Error("Unknown layer ("+Q1+")")})})},Xt1=function(e){var t=e.isInteractive,C=t===void 0?h2.isInteractive:t,n=e.animate,r=n===void 0?h2.animate:n,i=e.motionConfig,o=i===void 0?h2.motionConfig:i,a=e.theme,s=e.renderWrapper,l=N$(e,Yt1);return b.jsx(B8,{animate:r,isInteractive:C,motionConfig:o,renderWrapper:s,theme:a,children:b.jsx(Kt1,O4({isInteractive:C},l))})},B$=function(e){return b.jsx(U7,{children:function(t){var C=t.width,n=t.height;return b.jsx(Xt1,O4({width:C,height:n},e))}})},Qt1=["isInteractive","renderWrapper","theme"],Jt1=function(e){var t=e.data,C=e.xScale,n=C===void 0?e4.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?e4.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.margin,u=e.pixelRatio,d=u===void 0?e4.pixelRatio:u,f=e.layers,v=f===void 0?e4.layers:f,g=e.colors,h=g===void 0?e4.colors:g,m=e.nodeId,p=m===void 0?h2.nodeId:m,x=e.nodeSize,S=x===void 0?e4.nodeSize:x,w=e.renderNode,M=w===void 0?e4.renderNode:w,_=e.enableGridX,E=_===void 0?e4.enableGridX:_,O=e.gridXValues,T=e.enableGridY,k=T===void 0?e4.enableGridY:T,A=e.gridYValues,V=e.axisTop,R=e.axisRight,P=e.axisBottom,L=P===void 0?e4.axisBottom:P,H=e.axisLeft,I=H===void 0?e4.axisLeft:H,j=e.annotations,N=j===void 0?e4.annotations:j,z=e.isInteractive,q=z===void 0?e4.isInteractive:z,G=e.debugMesh,Y=G===void 0?e4.debugMesh:G,e1=e.onMouseEnter,Q=e.onMouseMove,K=e.onMouseLeave,J=e.onClick,W=e.tooltip,U=W===void 0?e4.tooltip:W,Z=e.legends,D=Z===void 0?e4.legends:Z,n1=e.canvasRef,B=$.useRef(null),r1=W5(),i1=$.useState(null),g1=i1[0],y1=i1[1],m1=z8(s,l,c),b1=m1.margin,S1=m1.innerWidth,v1=m1.innerHeight,h1=m1.outerWidth,l1=m1.outerHeight,$1=D$({data:t,xScaleSpec:n,xFormat:r,yScaleSpec:o,yFormat:a,width:S1,height:v1,nodeId:p,nodeSize:S,colors:h}),f1=$1.xScale,A1=$1.yScale,I1=$1.nodes,R1=$1.legendData,k1=F$(I1,N),Y1=xu({points:I1,width:S1,height:v1,debug:Y}),X1=Y1.delaunay,D1=Y1.voronoi,L1=$.useMemo(function(){return{xScale:f1,yScale:A1,nodes:I1,margin:b1,innerWidth:S1,innerHeight:v1,outerWidth:h1,outerHeight:l1}},[f1,A1,I1,b1,S1,v1,h1,l1]);$.useEffect(function(){if(B.current){B.current.width=h1*d,B.current.height=l1*d;var N1=B.current.getContext("2d");N1.scale(d,d),N1.fillStyle=r1.background,N1.fillRect(0,0,h1,l1),N1.translate(b1.left,b1.top),v.forEach(function(z1){if(z1==="grid")N1.lineWidth=r1.grid.line.strokeWidth,N1.strokeStyle=r1.grid.line.stroke,E&&hC(N1,{width:S1,height:v1,scale:f1,axis:"x",values:O}),k&&hC(N1,{width:S1,height:v1,scale:A1,axis:"y",values:A});else if(z1==="annotations")pt1(N1,{annotations:k1,theme:r1});else if(z1==="axes")H$(N1,{xScale:f1,yScale:A1,width:S1,height:v1,top:V,right:R,bottom:L,left:I,theme:r1});else if(z1==="nodes")I1.forEach(function(F1){M(N1,F1)});else if(z1==="mesh")Y&&(I$(N1,D1),g1&&A$(N1,D1,g1.index));else if(z1==="legends")D.forEach(function(F1){n$(N1,O4({},F1,{data:R1,containerWidth:S1,containerHeight:v1,theme:r1}))});else{if(typeof z1!="function")throw new Error("Invalid layer: "+z1);z1(N1,L1)}})}},[B,S1,v1,h1,l1,b1.top,b1.left,d,M,v,L1,r1,f1,A1,I1,E,k,V,R,L,I,D,R1,Y,D1,g1,k1]);var Q1=s3(),U1=Q1.showTooltipFromEvent,q1=Q1.hideTooltip,u1=$.useCallback(function(N1){var z1=hu(B.current,N1),F1=z1[0],J1=z1[1];if(!XS(b1.left,b1.top,S1,v1,F1,J1))return null;var t5=X1.find(F1-b1.left,J1-b1.top);return I1[t5]},[B,b1,S1,v1,X1]),_1=$.useCallback(function(N1){var z1=u1(N1);y1(z1),z1?(U1($.createElement(U,{node:z1}),N1),g1&&g1.id!==z1.id&&(K&&K(g1,N1),e1&&e1(z1,N1)),g1||e1&&e1(z1,N1),Q&&Q(z1,N1)):(q1(),g1&&K&&K(g1,N1))},[u1,g1,y1,U1,q1,U,e1,Q,K]),K1=$.useCallback(function(N1){q1(),y1(null),g1&&K&&K(g1,N1)},[q1,g1,y1,K]),C5=$.useCallback(function(N1){if(J){var z1=u1(N1);z1&&J(z1,N1)}},[u1,J]);return b.jsx("canvas",{ref:function(N1){B.current=N1,n1&&"current"in n1&&(n1.current=N1)},width:h1*d,height:l1*d,style:{width:h1,height:l1,cursor:q?"auto":"normal"},onMouseEnter:q?_1:void 0,onMouseMove:q?_1:void 0,onMouseLeave:q?K1:void 0,onClick:q?C5:void 0})},eC1=$.forwardRef(function(e,t){var C=e.isInteractive,n=e.renderWrapper,r=e.theme,i=N$(e,Qt1);return b.jsx(B8,{isInteractive:C,renderWrapper:n,theme:r,animate:!1,children:b.jsx(Jt1,O4({},i,{canvasRef:t}))})});$.forwardRef(function(e,t){return b.jsx(U7,{children:function(C){var n=C.width,r=C.height;return b.jsx(eC1,O4({width:n,height:r},e,{ref:t}))}})});const tC1=({x1:e,x2:t,y1:C,y2:n})=>b.jsx("g",{children:b.jsx("line",{x1:e,y1:C,x2:t,y2:n,stroke:"red",strokeWidth:"3"})}),CC1=({scatterPlotData:e,style:t={},margin:C={},axisBottom:n={},axisLeft:r={},tooltip:i=null})=>{const o=e==null?void 0:e.line,a=o==null?void 0:o.x1,s=o==null?void 0:o.y1,l=o==null?void 0:o.x2,c=o==null?void 0:o.y2;return b.jsxs(b.Fragment,{children:[b.jsx(O2,{}),b.jsx("div",{style:{width:"100%",height:600,...t},children:b.jsx(B$,{data:[e==null?void 0:e.points],margin:{top:20,right:120,bottom:100,left:120,...C},xScale:{type:"point"},axisBottom:{orient:"bottom",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:46,truncateTickAt:0,legend:"axisBottom",...n},axisLeft:{orient:"left",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:-60,truncateTickAt:0,legend:"axisLeft",...r},layers:["grid","markers","axes","nodes","legends",u=>b.jsx(tC1,{x1:u.xScale(a),y1:u.yScale(s),x2:u.xScale(l),y2:u.yScale(c)})],tooltip:({node:u})=>b.jsx(v4,{body:(i==null?void 0:i({node:u}))||b.jsx("span",{children:"Scatterplot tooltip"})})})})]})};function nC1(e,t,C,n){var r=-1,i=e==null?0:e.length;for(n&&i&&(C=e[++r]);++r<i;)C=t(C,e[r],r,e);return C}var rC1=nC1;function iC1(e){return function(t){return e==null?void 0:e[t]}}var oC1=iC1,aC1=oC1,sC1={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},lC1=aC1(sC1),cC1=lC1,uC1=cC1,dC1=fe,fC1=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hC1="\\u0300-\\u036f",gC1="\\ufe20-\\ufe2f",vC1="\\u20d0-\\u20ff",mC1=hC1+gC1+vC1,pC1="["+mC1+"]",bC1=RegExp(pC1,"g");function yC1(e){return e=dC1(e),e&&e.replace(fC1,uC1).replace(bC1,"")}var xC1=yC1,wC1=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function SC1(e){return e.match(wC1)||[]}var $C1=SC1,MC1=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function EC1(e){return MC1.test(e)}var _C1=EC1,W$="\\ud800-\\udfff",OC1="\\u0300-\\u036f",VC1="\\ufe20-\\ufe2f",TC1="\\u20d0-\\u20ff",RC1=OC1+VC1+TC1,U$="\\u2700-\\u27bf",Z$="a-z\\xdf-\\xf6\\xf8-\\xff",HC1="\\xac\\xb1\\xd7\\xf7",kC1="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",LC1="\\u2000-\\u206f",PC1=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",q$="A-Z\\xc0-\\xd6\\xd8-\\xde",jC1="\\ufe0e\\ufe0f",G$=HC1+kC1+LC1+PC1,Y$="['’]",nm="["+G$+"]",IC1="["+RC1+"]",K$="\\d+",AC1="["+U$+"]",X$="["+Z$+"]",Q$="[^"+W$+G$+K$+U$+Z$+q$+"]",NC1="\\ud83c[\\udffb-\\udfff]",DC1="(?:"+IC1+"|"+NC1+")",FC1="[^"+W$+"]",J$="(?:\\ud83c[\\udde6-\\uddff]){2}",eM="[\\ud800-\\udbff][\\udc00-\\udfff]",f9="["+q$+"]",zC1="\\u200d",rm="(?:"+X$+"|"+Q$+")",BC1="(?:"+f9+"|"+Q$+")",im="(?:"+Y$+"(?:d|ll|m|re|s|t|ve))?",om="(?:"+Y$+"(?:D|LL|M|RE|S|T|VE))?",tM=DC1+"?",CM="["+jC1+"]?",WC1="(?:"+zC1+"(?:"+[FC1,J$,eM].join("|")+")"+CM+tM+")*",UC1="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ZC1="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qC1=CM+tM+WC1,GC1="(?:"+[AC1,J$,eM].join("|")+")"+qC1,YC1=RegExp([f9+"?"+X$+"+"+im+"(?="+[nm,f9,"$"].join("|")+")",BC1+"+"+om+"(?="+[nm,f9+rm,"$"].join("|")+")",f9+"?"+rm+"+"+im,f9+"+"+om,ZC1,UC1,K$,GC1].join("|"),"g");function KC1(e){return e.match(YC1)||[]}var XC1=KC1,QC1=$C1,JC1=_C1,en1=fe,tn1=XC1;function Cn1(e,t,C){return e=en1(e),t=C?void 0:t,t===void 0?JC1(e)?tn1(e):QC1(e):e.match(t)||[]}var nn1=Cn1,rn1=rC1,in1=xC1,on1=nn1,an1="['’]",sn1=RegExp(an1,"g");function ln1(e){return function(t){return rn1(on1(in1(t).replace(sn1,"")),e,"")}}var cn1=ln1,un1=k$;function dn1(e,t,C){var n=e.length;return C=C===void 0?n:C,!t&&C>=n?e:un1(e,t,C)}var fn1=dn1,hn1="\\ud800-\\udfff",gn1="\\u0300-\\u036f",vn1="\\ufe20-\\ufe2f",mn1="\\u20d0-\\u20ff",pn1=gn1+vn1+mn1,bn1="\\ufe0e\\ufe0f",yn1="\\u200d",xn1=RegExp("["+yn1+hn1+pn1+bn1+"]");function wn1(e){return xn1.test(e)}var nM=wn1;function Sn1(e){return e.split("")}var $n1=Sn1,rM="\\ud800-\\udfff",Mn1="\\u0300-\\u036f",En1="\\ufe20-\\ufe2f",_n1="\\u20d0-\\u20ff",On1=Mn1+En1+_n1,Vn1="\\ufe0e\\ufe0f",Tn1="["+rM+"]",Ha="["+On1+"]",ka="\\ud83c[\\udffb-\\udfff]",Rn1="(?:"+Ha+"|"+ka+")",iM="[^"+rM+"]",oM="(?:\\ud83c[\\udde6-\\uddff]){2}",aM="[\\ud800-\\udbff][\\udc00-\\udfff]",Hn1="\\u200d",sM=Rn1+"?",lM="["+Vn1+"]?",kn1="(?:"+Hn1+"(?:"+[iM,oM,aM].join("|")+")"+lM+sM+")*",Ln1=lM+sM+kn1,Pn1="(?:"+[iM+Ha+"?",Ha,oM,aM,Tn1].join("|")+")",jn1=RegExp(ka+"(?="+ka+")|"+Pn1+Ln1,"g");function In1(e){return e.match(jn1)||[]}var An1=In1,Nn1=$n1,Dn1=nM,Fn1=An1;function zn1(e){return Dn1(e)?Fn1(e):Nn1(e)}var Bn1=zn1,Wn1=fn1,Un1=nM,Zn1=Bn1,qn1=fe;function Gn1(e){return function(t){t=qn1(t);var C=Un1(t)?Zn1(t):void 0,n=C?C[0]:t.charAt(0),r=C?Wn1(C,1).join(""):t.slice(1);return n[e]()+r}}var Yn1=Gn1,Kn1=Yn1,Xn1=Kn1("toUpperCase"),Qn1=Xn1,Jn1=cn1,er1=Qn1,tr1=Jn1(function(e,t,C){return e+(C?" ":"")+er1(t)}),Cr1=tr1;const nr1=p2(Cr1);function rr1(e){var t=0,C=e.children,n=C&&C.length;if(!n)t=1;else for(;--n>=0;)t+=C[n].value;e.value=t}function ir1(){return this.eachAfter(rr1)}function or1(e){var t=this,C,n=[t],r,i,o;do for(C=n.reverse(),n=[];t=C.pop();)if(e(t),r=t.children,r)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length);return this}function ar1(e){for(var t=this,C=[t],n,r;t=C.pop();)if(e(t),n=t.children,n)for(r=n.length-1;r>=0;--r)C.push(n[r]);return this}function sr1(e){for(var t=this,C=[t],n=[],r,i,o;t=C.pop();)if(n.push(t),r=t.children,r)for(i=0,o=r.length;i<o;++i)C.push(r[i]);for(;t=n.pop();)e(t);return this}function lr1(e){return this.eachAfter(function(t){for(var C=+e(t.data)||0,n=t.children,r=n&&n.length;--r>=0;)C+=n[r].value;t.value=C})}function cr1(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function ur1(e){for(var t=this,C=dr1(t,e),n=[t];t!==C;)t=t.parent,n.push(t);for(var r=n.length;e!==C;)n.splice(r,0,e),e=e.parent;return n}function dr1(e,t){if(e===t)return e;var C=e.ancestors(),n=t.ancestors(),r=null;for(e=C.pop(),t=n.pop();e===t;)r=e,e=C.pop(),t=n.pop();return r}function fr1(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function hr1(){var e=[];return this.each(function(t){e.push(t)}),e}function gr1(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function vr1(){var e=this,t=[];return e.each(function(C){C!==e&&t.push({source:C.parent,target:C})}),t}function wu(e,t){var C=new vC(e),n=+e.value&&(C.value=e.value),r,i=[C],o,a,s,l;for(t==null&&(t=pr1);r=i.pop();)if(n&&(r.value=+r.data.value),(a=t(r.data))&&(l=a.length))for(r.children=new Array(l),s=l-1;s>=0;--s)i.push(o=r.children[s]=new vC(a[s])),o.parent=r,o.depth=r.depth+1;return C.eachBefore(yr1)}function mr1(){return wu(this).eachBefore(br1)}function pr1(e){return e.children}function br1(e){e.data=e.data.data}function yr1(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function vC(e){this.data=e,this.depth=this.height=0,this.parent=null}vC.prototype=wu.prototype={constructor:vC,count:ir1,each:or1,eachAfter:sr1,eachBefore:ar1,sum:lr1,sort:cr1,path:ur1,ancestors:fr1,descendants:hr1,leaves:gr1,links:vr1,copy:mr1};function xr1(e){if(typeof e!="function")throw new Error;return e}function U6(){return 0}function Z6(e){return function(){return e}}function wr1(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Su(e,t,C,n,r){for(var i=e.children,o,a=-1,s=i.length,l=e.value&&(n-t)/e.value;++a<s;)o=i[a],o.y0=C,o.y1=r,o.x0=t,o.x1=t+=o.value*l}function $u(e,t,C,n,r){for(var i=e.children,o,a=-1,s=i.length,l=e.value&&(r-C)/e.value;++a<s;)o=i[a],o.x0=t,o.x1=n,o.y0=C,o.y1=C+=o.value*l}var Sr1=(1+Math.sqrt(5))/2;function $r1(e,t,C,n,r,i){for(var o=[],a=t.children,s,l,c=0,u=0,d=a.length,f,v,g=t.value,h,m,p,x,S,w,M;c<d;){f=r-C,v=i-n;do h=a[u++].value;while(!h&&u<d);for(m=p=h,w=Math.max(v/f,f/v)/(g*e),M=h*h*w,S=Math.max(p/M,M/m);u<d;++u){if(h+=l=a[u].value,l<m&&(m=l),l>p&&(p=l),M=h*h*w,x=Math.max(p/M,M/m),x>S){h-=l;break}S=x}o.push(s={value:h,dice:f<v,children:a.slice(c,u)}),s.dice?Su(s,C,n,r,g?n+=v*h/g:i):$u(s,C,n,g?C+=f*h/g:r,i),g-=h,c=u}return o}const cM=function e(t){function C(n,r,i,o,a){$r1(t,n,r,i,o,a)}return C.ratio=function(n){return e((n=+n)>1?n:1)},C}(Sr1);function Mr1(){var e=cM,t=!1,C=1,n=1,r=[0],i=U6,o=U6,a=U6,s=U6,l=U6;function c(d){return d.x0=d.y0=0,d.x1=C,d.y1=n,d.eachBefore(u),r=[0],t&&d.eachBefore(wr1),d}function u(d){var f=r[d.depth],v=d.x0+f,g=d.y0+f,h=d.x1-f,m=d.y1-f;h<v&&(v=h=(v+h)/2),m<g&&(g=m=(g+m)/2),d.x0=v,d.y0=g,d.x1=h,d.y1=m,d.children&&(f=r[d.depth+1]=i(d)/2,v+=l(d)-f,g+=o(d)-f,h-=a(d)-f,m-=s(d)-f,h<v&&(v=h=(v+h)/2),m<g&&(g=m=(g+m)/2),e(d,v,g,h,m))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(C=+d[0],n=+d[1],c):[C,n]},c.tile=function(d){return arguments.length?(e=xr1(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(i=typeof d=="function"?d:Z6(+d),c):i},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(o=typeof d=="function"?d:Z6(+d),c):o},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Z6(+d),c):a},c.paddingBottom=function(d){return arguments.length?(s=typeof d=="function"?d:Z6(+d),c):s},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Z6(+d),c):l},c}function Er1(e,t,C,n,r){var i=e.children,o,a=i.length,s,l=new Array(a+1);for(l[0]=s=o=0;o<a;++o)l[o+1]=s+=i[o].value;c(0,a,e.value,t,C,n,r);function c(u,d,f,v,g,h,m){if(u>=d-1){var p=i[u];p.x0=v,p.y0=g,p.x1=h,p.y1=m;return}for(var x=l[u],S=f/2+x,w=u+1,M=d-1;w<M;){var _=w+M>>>1;l[_]<S?w=_+1:M=_}S-l[w-1]<l[w]-S&&u+1<w&&--w;var E=l[w]-x,O=f-E;if(h-v>m-g){var T=(v*O+h*E)/f;c(u,w,E,v,g,T,m),c(w,d,O,T,g,h,m)}else{var k=(g*O+m*E)/f;c(u,w,E,v,g,h,k),c(w,d,O,v,k,h,m)}}}function _r1(e,t,C,n,r){(e.depth&1?$u:Su)(e,t,C,n,r)}function V4(){return V4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},V4.apply(this,arguments)}function Or1(e,t){if(e==null)return{};var C,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)C=i[n],t.indexOf(C)>=0||(r[C]=e[C]);return r}var Vr1=function(e,t){return _2([e,t],function(C,n){return"translate("+C+","+n+")"})},Tr1=function(e,t){return _2([e,t],function(C,n){return"translate("+C+"px, "+n+"px)"})},am=function(e,t,C){return _2([e,t,C],function(n,r,i){return"translate("+n+","+r+") rotate("+i+")"})},Rr1=function(e,t,C){return _2([e,t,C],function(n,r,i){return"translate("+n+"px,"+r+"px) rotate("+i+"deg)"})},Hr1=function(e,t,C){return _2([e,t,C],function(n,r,i){return"translate("+(n-(i===0?0:5))+"px,"+(r-(i===0?5:0))+"px) rotate("+i+"deg)"})},kr1=$.memo(function(e){var t=e.node,C=e.animatedProps,n=e.borderWidth,r=e.enableLabel,i=e.enableParentLabel,o=e.labelSkipSize,a=W5(),s=r&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),l=i&&t.isParent;return b.jsxs(e5.g,{transform:Vr1(C.x,C.y),children:[b.jsx(e5.rect,{"data-testid":"node."+t.id,width:_2(C.width,function(c){return Math.max(c,0)}),height:_2(C.height,function(c){return Math.max(c,0)}),fill:t.fill?t.fill:C.color,strokeWidth:n,stroke:t.borderColor,fillOpacity:t.opacity,onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),s&&b.jsx(e5.text,{"data-testid":"label."+t.id,textAnchor:"middle",dominantBaseline:"central",style:V4({},a.labels.text,{fill:t.labelTextColor,pointerEvents:"none"}),fillOpacity:C.labelOpacity,transform:am(C.labelX,C.labelY,C.labelRotation),children:t.label}),l&&b.jsx(e5.text,{"data-testid":"parentLabel."+t.id,dominantBaseline:"central",style:V4({},a.labels.text,{fill:t.parentLabelTextColor,pointerEvents:"none"}),fillOpacity:C.parentLabelOpacity,transform:am(C.parentLabelX,C.parentLabelY,C.parentLabelRotation),children:t.parentLabel})]})}),Lr1=$.memo(function(e){var t=e.node;return b.jsx(L9,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})}),Pr1=$.memo(function(e){var t=e.node,C=e.animatedProps,n=e.borderWidth,r=e.enableLabel,i=e.enableParentLabel,o=e.labelSkipSize,a=W5(),s=r&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),l=i&&t.isParent;return b.jsxs(e5.div,{"data-testid":"node."+t.id,id:t.path.replace(/[^\w]/gi,"-"),style:{boxSizing:"border-box",position:"absolute",top:0,left:0,transform:Tr1(C.x,C.y),width:C.width,height:C.height,borderWidth:n,borderStyle:"solid",borderColor:t.borderColor,overflow:"hidden"},children:[b.jsx(e5.div,{style:{boxSizing:"border-box",position:"absolute",top:0,left:0,opacity:t.opacity,width:C.width,height:C.height,background:C.color},onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),s&&b.jsx(e5.span,{"data-testid":"label."+t.id,style:V4({},a.labels.text,{position:"absolute",display:"flex",top:-5,left:-5,width:10,height:10,justifyContent:"center",alignItems:"center",whiteSpace:"nowrap",color:t.labelTextColor,transformOrigin:"center center",transform:Rr1(C.labelX,C.labelY,C.labelRotation),opacity:C.labelOpacity,pointerEvents:"none"}),children:t.label}),l&&b.jsx(e5.span,{"data-testid":"parentLabel."+t.id,style:V4({},a.labels.text,{position:"absolute",display:"flex",justifyContent:"flex-start",alignItems:"center",whiteSpace:"nowrap",width:10,height:10,color:t.parentLabelTextColor,transformOrigin:"top left",transform:Hr1(C.parentLabelX,C.parentLabelY,C.parentLabelRotation),opacity:C.parentLabelOpacity,pointerEvents:"none"}),children:t.parentLabel})]})}),x2={layers:["nodes"],identity:"id",value:"value",tile:"squarify",leavesOnly:!1,innerPadding:0,outerPadding:0,colors:{scheme:"nivo"},colorBy:"pathComponents.1",nodeOpacity:.33,enableLabel:!0,label:"formattedValue",labelSkipSize:0,labelTextColor:{from:"color",modifiers:[["darker",1]]},orientLabel:!0,enableParentLabel:!0,parentLabel:"id",parentLabelSize:20,parentLabelPosition:"top",parentLabelPadding:6,parentLabelTextColor:{from:"color",modifiers:[["darker",1]]},borderWidth:1,borderColor:{from:"color",modifiers:[["darker",1]]},isInteractive:!0,tooltip:Lr1,role:"img",animate:!0,motionConfig:"gentle"},U5=V4({},x2,{nodeComponent:kr1,defs:[],fill:[]});V4({},x2,{nodeComponent:Pr1});V4({},x2,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var jr1={binary:Er1,dice:Su,slice:$u,sliceDice:_r1,squarify:cM},Ir1=function(e){var t=e.root,C=e.getValue;return $.useMemo(function(){return wu(t).sum(C)},[t,C])},Ar1=function(e){var t=e.data,C=e.width,n=e.height,r=e.identity,i=r===void 0?x2.identity:r,o=e.value,a=o===void 0?x2.value:o,s=e.valueFormat,l=e.leavesOnly,c=l===void 0?x2.leavesOnly:l,u=e.tile,d=u===void 0?x2.tile:u,f=e.innerPadding,v=f===void 0?x2.innerPadding:f,g=e.outerPadding,h=g===void 0?x2.outerPadding:g,m=e.label,p=m===void 0?x2.label:m,x=e.orientLabel,S=x===void 0?x2.orientLabel:x,w=e.enableParentLabel,M=w===void 0?x2.enableParentLabel:w,_=e.parentLabel,E=_===void 0?x2.parentLabel:_,O=e.parentLabelSize,T=O===void 0?x2.parentLabelSize:O,k=e.parentLabelPosition,A=k===void 0?x2.parentLabelPosition:k,V=e.parentLabelPadding,R=V===void 0?x2.parentLabelPadding:V,P=e.colors,L=P===void 0?x2.colors:P,H=e.colorBy,I=H===void 0?x2.colorBy:H,j=e.nodeOpacity,N=j===void 0?x2.nodeOpacity:j,z=e.borderColor,q=z===void 0?x2.borderColor:z,G=e.labelTextColor,Y=G===void 0?x2.labelTextColor:G,e1=e.parentLabelTextColor,Q=e1===void 0?x2.parentLabelTextColor:e1,K=m3(i),J=m3(a),W=L7(s),U=m3(p),Z=m3(E),D=function(v1){var h1=v1.width,l1=v1.height,$1=v1.tile,f1=v1.innerPadding,A1=v1.outerPadding,I1=v1.enableParentLabel,R1=v1.parentLabelSize,k1=v1.parentLabelPosition,Y1=v1.leavesOnly;return $.useMemo(function(){var X1=Mr1().size([h1,l1]).tile(jr1[$1]).round(!0).paddingInner(f1).paddingOuter(A1);if(I1&&!Y1){var D1=R1+2*A1;X1["padding"+nr1(k1)](D1)}return X1},[h1,l1,$1,f1,A1,I1,R1,k1,Y1])}({width:C,height:n,tile:d,innerPadding:v,outerPadding:h,enableParentLabel:M,parentLabelSize:T,parentLabelPosition:A,leavesOnly:c}),n1=Ir1({root:t,getValue:J}),B=$.useMemo(function(){var v1=u$(n1);return D(v1),c?v1.leaves():v1.descendants()},[n1,D,c]),r1=$.useMemo(function(){return B.map(function(v1){var h1=function(A1,I1){var R1=A1.ancestors().map(function(k1){return I1(k1.data)}).reverse();return{path:R1.join("."),pathComponents:R1}}(v1,K),l1=h1.path,$1=h1.pathComponents,f1={id:K(v1.data),path:l1,pathComponents:$1,data:Z8(v1.data,"children"),x:v1.x0,y:v1.y0,width:v1.x1-v1.x0,height:v1.y1-v1.y0,value:v1.value,formattedValue:W(v1.value),treeDepth:v1.depth,treeHeight:v1.height,isParent:v1.height>0,isLeaf:v1.height===0,parentLabelX:0,parentLabelY:0,parentLabelRotation:0};return f1.labelRotation=S&&f1.height>f1.width?-90:0,A==="top"&&(f1.parentLabelX=h+R,f1.parentLabelY=h+T/2),A==="right"&&(f1.parentLabelX=f1.width-h-T/2,f1.parentLabelY=f1.height-h-R,f1.parentLabelRotation=-90),A==="bottom"&&(f1.parentLabelX=h+R,f1.parentLabelY=f1.height-h-T/2),A==="left"&&(f1.parentLabelX=h+T/2,f1.parentLabelY=f1.height-h-R,f1.parentLabelRotation=-90),f1.label=U(f1),f1.parentLabel=Z(f1),f1})},[B,K,W,U,S,Z,T,A,R,h]),i1=W5(),g1=ye(L,I),y1=E4(q,i1),m1=E4(Y,i1),b1=E4(Q,i1),S1=$.useMemo(function(){return r1.map(function(v1){var h1=V4({},v1,{color:g1(v1),opacity:N});return h1.borderColor=y1(h1),h1.labelTextColor=m1(h1),h1.parentLabelTextColor=b1(h1),h1})},[r1,g1,N,y1,m1,b1]);return{hierarchy:n1,nodes:S1,layout:D}},Nr1=function(e){var t=e.nodes;return $.useMemo(function(){return{nodes:t}},[t])},Si=function(e){return{x:e.x,y:e.y,width:e.width,height:e.height,color:e.color,labelX:e.width/2,labelY:e.height/2,labelRotation:e.labelRotation,labelOpacity:1,parentLabelX:e.parentLabelX,parentLabelY:e.parentLabelY,parentLabelRotation:e.parentLabelRotation,parentLabelOpacity:1}},sm=function(e){return{x:e.x+e.width/2,y:e.y+e.height/2,width:0,height:0,color:e.color,labelX:0,labelY:0,labelRotation:e.labelRotation,labelOpacity:0,parentLabelX:0,parentLabelY:0,parentLabelRotation:e.parentLabelRotation,parentLabelOpacity:0}},Dr1=$.memo(function(e){var t=e.nodes,C=e.nodeComponent,n=e.borderWidth,r=e.enableLabel,i=e.labelSkipSize,o=e.enableParentLabel,a=function(d,f){var v=f.isInteractive,g=f.onMouseEnter,h=f.onMouseMove,m=f.onMouseLeave,p=f.onClick,x=f.tooltip,S=s3(),w=S.showTooltipFromEvent,M=S.hideTooltip,_=$.useCallback(function(A,V){w($.createElement(x,{node:A}),V,"left")},[w,x]),E=$.useCallback(function(A,V){_(A,V),g==null||g(A,V)},[g,_]),O=$.useCallback(function(A,V){_(A,V),h==null||h(A,V)},[h,_]),T=$.useCallback(function(A,V){M(),m==null||m(A,V)},[m,M]),k=$.useCallback(function(A,V){p==null||p(A,V)},[p]);return $.useMemo(function(){return d.map(function(A){return v?V4({},A,{onMouseEnter:function(V){return E(A,V)},onMouseMove:function(V){return O(A,V)},onMouseLeave:function(V){return T(A,V)},onClick:function(V){return k(A,V)}}):A})},[v,d,E,O,T,k])}(t,{isInteractive:e.isInteractive,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseLeave:e.onMouseLeave,onClick:e.onClick,tooltip:e.tooltip}),s=A2(),l=s.animate,c=s.config,u=p4(a,{keys:function(d){return d.path},initial:Si,from:sm,enter:Si,update:Si,leave:sm,config:c,immediate:!l});return b.jsx(b.Fragment,{children:u(function(d,f){return $.createElement(C,{key:f.path,node:f,animatedProps:d,borderWidth:n,enableLabel:r,labelSkipSize:i,enableParentLabel:o})})})}),Fr1=["isInteractive","animate","motionConfig","theme","renderWrapper"],zr1=function(e){var t=e.data,C=e.identity,n=C===void 0?U5.identity:C,r=e.value,i=r===void 0?U5.value:r,o=e.valueFormat,a=e.tile,s=a===void 0?U5.tile:a,l=e.nodeComponent,c=l===void 0?U5.nodeComponent:l,u=e.innerPadding,d=u===void 0?U5.innerPadding:u,f=e.outerPadding,v=f===void 0?U5.outerPadding:f,g=e.leavesOnly,h=g===void 0?U5.leavesOnly:g,m=e.width,p=e.height,x=e.margin,S=e.layers,w=S===void 0?U5.layers:S,M=e.colors,_=M===void 0?U5.colors:M,E=e.colorBy,O=E===void 0?U5.colorBy:E,T=e.nodeOpacity,k=T===void 0?U5.nodeOpacity:T,A=e.borderWidth,V=A===void 0?U5.borderWidth:A,R=e.borderColor,P=R===void 0?U5.borderColor:R,L=e.defs,H=L===void 0?U5.defs:L,I=e.fill,j=I===void 0?U5.fill:I,N=e.enableLabel,z=N===void 0?U5.enableLabel:N,q=e.label,G=q===void 0?U5.label:q,Y=e.labelTextColor,e1=Y===void 0?U5.labelTextColor:Y,Q=e.orientLabel,K=Q===void 0?U5.orientLabel:Q,J=e.labelSkipSize,W=J===void 0?U5.labelSkipSize:J,U=e.enableParentLabel,Z=U===void 0?U5.enableParentLabel:U,D=e.parentLabel,n1=D===void 0?U5.parentLabel:D,B=e.parentLabelSize,r1=B===void 0?U5.parentLabelSize:B,i1=e.parentLabelPosition,g1=i1===void 0?U5.parentLabelPosition:i1,y1=e.parentLabelPadding,m1=y1===void 0?U5.parentLabelPadding:y1,b1=e.parentLabelTextColor,S1=b1===void 0?U5.parentLabelTextColor:b1,v1=e.isInteractive,h1=v1===void 0?U5.isInteractive:v1,l1=e.onMouseEnter,$1=e.onMouseMove,f1=e.onMouseLeave,A1=e.onClick,I1=e.tooltip,R1=I1===void 0?U5.tooltip:I1,k1=e.role,Y1=e.ariaLabel,X1=e.ariaLabelledBy,D1=e.ariaDescribedBy,L1=z8(m,p,x),Q1=L1.margin,U1=L1.innerWidth,q1=L1.innerHeight,u1=L1.outerWidth,_1=L1.outerHeight,K1=Ar1({data:t,identity:n,value:i,valueFormat:o,leavesOnly:h,width:U1,height:q1,tile:s,innerPadding:d,outerPadding:v,colors:_,colorBy:O,nodeOpacity:k,borderColor:P,label:G,labelTextColor:e1,orientLabel:K,enableParentLabel:Z,parentLabel:n1,parentLabelSize:r1,parentLabelPosition:g1,parentLabelPadding:m1,parentLabelTextColor:S1}).nodes,C5={nodes:null};w.includes("nodes")&&(C5.nodes=b.jsx(Dr1,{nodes:K1,nodeComponent:c,borderWidth:V,enableLabel:z,labelSkipSize:W,enableParentLabel:Z,isInteractive:h1,onMouseEnter:l1,onMouseMove:$1,onMouseLeave:f1,onClick:A1,tooltip:R1},"nodes"));var N1=Nr1({nodes:K1}),z1=gu(H,K1,j);return b.jsx(y6,{width:u1,height:_1,margin:Q1,defs:z1,role:k1,ariaLabel:Y1,ariaLabelledBy:X1,ariaDescribedBy:D1,children:w.map(function(F1,J1){var t5;return typeof F1=="function"?b.jsx($.Fragment,{children:$.createElement(F1,N1)},J1):(t5=C5==null?void 0:C5[F1])!=null?t5:null})})},Br1=function(e){var t=e.isInteractive,C=t===void 0?U5.isInteractive:t,n=e.animate,r=n===void 0?U5.animate:n,i=e.motionConfig,o=i===void 0?U5.motionConfig:i,a=e.theme,s=e.renderWrapper,l=Or1(e,Fr1);return b.jsx(B8,{animate:r,isInteractive:C,motionConfig:o,renderWrapper:s,theme:a,children:b.jsx(zr1,V4({isInteractive:C},l))})},Wr1=function(e){return b.jsx(U7,{children:function(t){var C=t.width,n=t.height;return b.jsx(Br1,V4({width:C,height:n},e))}})};function Ur1(e,t){if(e.startsWith("rgba"))return e.replace(/rgba?\((\d+), (\d+), (\d+),? ([\d.]+)?\)/,(C,n,r,i,o)=>`rgba(${n}, ${r}, ${i}, ${t})`);if(e.startsWith("rgb"))return e.replace(/rgb\((\d+), (\d+), (\d+)\)/,(C,n,r,i)=>`rgba(${n}, ${r}, ${i}, ${t})`);if(e.startsWith("hsl"))return e.replace(/hsl\((\d+), (\d+)%?, (\d+)%?\)/,(C,n,r,i)=>`hsla(${n}, ${r}%, ${i}%, ${t})`);if(e.startsWith("hsla"))return e.replace(/hsla?\((\d+), (\d+)%?, (\d+)%?,? ([\d.]+)?\)/,(C,n,r,i,o)=>`hsla(${n}, ${r}%, ${i}%, ${t})`);if(e.startsWith("#")){const C=Zr1(e);return`rgba(${C.r}, ${C.g}, ${C.b}, ${t})`}throw new Error("Unsupported color format")}function Zr1(e){const t=e.startsWith("#")?e.slice(1):e,C=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return{r:C,g:n,b:r}}const qr1=({treeMapData:e,style:t={},colors:C={scheme:"nivo"},identity:n="name",value:r="loc",margin:i={},nodeOpacity:o=.67,labelTextColor:a="black",borderColor:s="white",labelTitle:l="name",labelTitleSize:c=16,labelText:u="name",labelTextSize:d=10,labelPadding:f=5,tooltip:v=null})=>{const g=({node:m})=>{var E,O;const p=$.useRef(null),x=$.useRef(null),[S,w]=$.useState(!1),[M,_]=$.useState(!1);return $.useEffect(()=>{if(!(p!=null&&p.current))return;const T=()=>{const A=p.current.getBoundingClientRect();w(A.height>m.height-f*2||A.width>m.width-f*2)},k=new ResizeObserver(T);return k.observe(p==null?void 0:p.current),T(),()=>{k.disconnect()}},[]),$.useEffect(()=>{if(!(x!=null&&x.current)||!(p!=null&&p.current))return;const T=()=>{const A=x.current.getBoundingClientRect(),V=p.current.getBoundingClientRect(),R=Math.max([A,V]);_(A.height+V.height>m.height-f*2||R>m.width-f*2)},k=new ResizeObserver(T);return k.observe(p==null?void 0:p.current),T(),()=>{k.disconnect()}},[]),m.isParent?b.jsx(b.Fragment,{}):b.jsx("g",{transform:`translate(${m.x}, ${m.y})`,children:b.jsx("foreignObject",{width:m.width,height:m.height,style:{backgroundColor:Ur1(m.color,o),border:`1px solid ${s}`},children:b.jsxs("div",{style:{font:"var(--gf-label-lg-default)",color:a,padding:f,display:S?"none":"auto"},children:[b.jsx("div",{ref:p,style:{fontSize:c,display:"inline-block"},children:b.jsx("b",{children:((E=m==null?void 0:m.data)==null?void 0:E[l])||"Title"})}),b.jsx("div",{style:{display:M?"none":"auto"},children:b.jsx("div",{ref:x,style:{fontSize:d,display:"inline-block"},children:((O=m==null?void 0:m.data)==null?void 0:O[u])||"Text"})})]})})})},h=({nodes:m})=>m.map(p=>b.jsx(g,{node:p},p.id));return b.jsxs(b.Fragment,{children:[b.jsx(O2,{}),b.jsx("div",{style:{width:"100%",height:600,...t},children:b.jsx(Wr1,{data:e,colors:C,identity:n,value:r,margin:{top:10,right:10,bottom:10,left:10,...i},enableParentLabel:!1,enableLabel:!1,nodeOpacity:0,borderWidth:0,tooltip:({node:m})=>b.jsx(v4,{body:(v==null?void 0:v({node:m}))||b.jsx("span",{children:"Treemap tooltip"})}),layers:[h,"nodes"]})})]})};var Gr1=fe,Yr1=0;function Kr1(e){var t=++Yr1;return Gr1(e)+t}var Xr1=Kr1;const Qr1=p2(Xr1);function c4(){return c4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},c4.apply(this,arguments)}var Mu=$.memo(function(e){var t=e.point;return b.jsx(L9,{id:b.jsxs("span",{children:["x: ",b.jsx("strong",{children:t.data.xFormatted}),", y:"," ",b.jsx("strong",{children:t.data.yFormatted})]}),enableChip:!0,color:t.serieColor})}),uM=$.memo(function(e){var t=e.slice,C=e.axis,n=W5(),r=C==="x"?"y":"x";return b.jsx(Qx,{rows:t.points.map(function(i){return[b.jsx(Zt,{color:i.serieColor,style:n.tooltip.chip},"chip"),i.serieId,b.jsx("span",{style:n.tooltip.tableCellValue,children:i.data[r+"Formatted"]},"value")]})})}),dM={curve:"linear",xScale:{type:"point"},yScale:{type:"linear",min:0,max:"auto"},layers:["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"],axisBottom:{},axisLeft:{},enableGridX:!0,enableGridY:!0,enablePoints:!0,pointSize:6,pointColor:{from:"color"},pointBorderWidth:0,pointBorderColor:{theme:"background"},enablePointLabel:!1,pointLabel:"yFormatted",colors:{scheme:"nivo"},enableArea:!1,areaBaselineValue:0,areaOpacity:.2,areaBlendMode:"normal",lineWidth:2,legends:[],isInteractive:!0,tooltip:Mu,enableSlices:!1,debugSlices:!1,sliceTooltip:uM,debugMesh:!1,enableCrosshair:!0,crosshairType:"bottom-left"},x7=c4({},dM,{enablePointLabel:!1,useMesh:!1,enableTouchCrosshair:!1,animate:!0,motionConfig:"gentle",defs:[],fill:[],role:"img"});c4({},dM,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var Jr1=function(e){var t=e.curve;return $.useMemo(function(){return W0().defined(function(C){return C.x!==null&&C.y!==null}).x(function(C){return C.x}).y(function(C){return C.y}).curve(PS(t))},[t])},ei1=function(e){var t=e.curve,C=e.yScale,n=e.areaBaselineValue;return $.useMemo(function(){return eS().defined(function(r){return r.x!==null&&r.y!==null}).x(function(r){return r.x}).y1(function(r){return r.y}).curve(PS(t)).y0(C(n))},[t,C,n])},ti1=function(e){var t=e.componentId,C=e.enableSlices,n=e.points,r=e.width,i=e.height;return $.useMemo(function(){if(C===!1)return[];if(C==="x"){var o=new Map;return n.forEach(function(s){s.data.x!==null&&s.data.y!==null&&(o.has(s.x)?o.get(s.x).push(s):o.set(s.x,[s]))}),Array.from(o.entries()).sort(function(s,l){return s[0]-l[0]}).map(function(s,l,c){var u,d,f=s[0],v=s[1],g=c[l-1],h=c[l+1];return u=g?f-(f-g[0])/2:f,d=h?f-u+(h[0]-f)/2:r-u,{id:"slice:"+t+":"+f,x0:u,x:f,y0:0,y:0,width:d,height:i,points:v.reverse()}})}if(C==="y"){var a=new Map;return n.forEach(function(s){s.data.x!==null&&s.data.y!==null&&(a.has(s.y)?a.get(s.y).push(s):a.set(s.y,[s]))}),Array.from(a.entries()).sort(function(s,l){return s[0]-l[0]}).map(function(s,l,c){var u,d,f=s[0],v=s[1],g=c[l-1],h=c[l+1];return u=g?f-(f-g[0])/2:f,d=h?f-u+(h[0]-f)/2:i-u,{id:f,x0:0,x:0,y0:u,y:f,width:r,height:d,points:v.reverse()}})}},[t,C,i,n,r])},Ci1="line",fM=function(e){var t=e.data,C=e.xScale,n=C===void 0?x7.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?x7.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.colors,u=c===void 0?x7.colors:c,d=e.curve,f=d===void 0?x7.curve:d,v=e.areaBaselineValue,g=v===void 0?x7.areaBaselineValue:v,h=e.pointColor,m=h===void 0?x7.pointColor:h,p=e.pointBorderColor,x=p===void 0?x7.pointBorderColor:p,S=e.enableSlices,w=S===void 0?x7.enableSlicesTooltip:S,M=$.useState(Qr1(Ci1))[0],_=L7(r),E=L7(a),O=ye(u,"id"),T=W5(),k=E4(m,T),A=E4(x,T),V=$.useState([]),R=V[0],P=V[1],L=$.useMemo(function(){return w$(t.filter(function(Q){return R.indexOf(Q.id)===-1}),n,o,s,l)},[t,R,n,o,s,l]),H=L.xScale,I=L.yScale,j=L.series,N=$.useMemo(function(){var Q=t.map(function(J){return{id:J.id,label:J.id,color:O(J)}}),K=Q.map(function(J){return c4({},j.find(function(W){return W.id===J.id}),{color:J.color})}).filter(function(J){return!!J.id});return{legendData:Q.map(function(J){return c4({},J,{hidden:!K.find(function(W){return W.id===J.id})})}).reverse(),series:K}},[t,j,O]),z=N.legendData,q=N.series,G=$.useCallback(function(Q){P(function(K){return K.indexOf(Q)>-1?K.filter(function(J){return J!==Q}):[].concat(K,[Q])})},[]),Y=function(Q){var K=Q.series,J=Q.getPointColor,W=Q.getPointBorderColor,U=Q.formatX,Z=Q.formatY;return $.useMemo(function(){return K.reduce(function(D,n1){return[].concat(D,n1.data.filter(function(B){return B.position.x!==null&&B.position.y!==null}).map(function(B,r1){var i1={id:n1.id+"."+r1,index:D.length+r1,serieId:n1.id,serieColor:n1.color,x:B.position.x,y:B.position.y};return i1.color=J(n1),i1.borderColor=W(i1),i1.data=c4({},B.data,{xFormatted:U(B.data.x),yFormatted:Z(B.data.y)}),i1}))},[])},[K,J,W,U,Z])}({series:q,getPointColor:k,getPointBorderColor:A,formatX:_,formatY:E}),e1=ti1({componentId:M,enableSlices:w,points:Y,width:s,height:l});return{legendData:z,toggleSerie:G,lineGenerator:Jr1({curve:f}),areaGenerator:ei1({curve:f,yScale:I,areaBaselineValue:g}),getColor:O,series:q,xScale:H,yScale:I,slices:e1,points:Y}},ni1=function(e){var t=e.areaBlendMode,C=e.areaOpacity,n=e.color,r=e.fill,i=e.path,o=A2(),a=o.animate,s=o.config,l=On(i),c=X5({color:n,config:s,immediate:!a});return b.jsx(e5.path,{d:l,fill:r||c.color,fillOpacity:C,strokeWidth:0,style:{mixBlendMode:t}})},ri1=$.memo(function(e){var t=e.areaGenerator,C=e.areaOpacity,n=e.areaBlendMode,r=e.lines.slice(0).reverse();return b.jsx("g",{children:r.map(function(i){return b.jsx(ni1,c4({path:t(i.data.map(function(o){return o.position}))},c4({areaOpacity:C,areaBlendMode:n},i)),i.id)})})}),ii1=$.memo(function(e){var t=e.lineGenerator,C=e.points,n=e.color,r=e.thickness,i=$.useMemo(function(){return t(C)},[t,C]),o=On(i);return b.jsx(e5.path,{d:o,fill:"none",strokeWidth:r,stroke:n})}),oi1=$.memo(function(e){var t=e.lines,C=e.lineGenerator,n=e.lineWidth;return t.slice(0).reverse().map(function(r){var i=r.id,o=r.data,a=r.color;return b.jsx(ii1,{id:i,points:o.map(function(s){return s.position}),lineGenerator:C,color:a,thickness:n},i)})}),ai1=$.memo(function(e){var t=e.slice,C=e.slices,n=e.axis,r=e.debug,i=e.tooltip,o=e.isCurrent,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd,g=s3(),h=g.showTooltipFromEvent,m=g.hideTooltip,p=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),a(t),s&&s(t,O)},[h,i,t,n,a,s]),x=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),l&&l(t,O)},[h,i,t,n,l]),S=$.useCallback(function(O){m(),a(null),c&&c(t,O)},[m,a,c,t]),w=$.useCallback(function(O){u&&u(t,O)},[t,u]),M=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),a(t),d&&d(t,O)},[n,d,a,h,t,i]),_=$.useCallback(function(O){var T=O.touches[0],k=document.elementFromPoint(T.clientX,T.clientY),A=k==null?void 0:k.getAttribute("data-ref");if(A){var V=C.find(function(R){return R.id===A});V&&(h($.createElement(i,{slice:V,axis:n}),O,"right"),a(V))}f&&f(t,O)},[n,f,a,h,t,C,i]),E=$.useCallback(function(O){m(),a(null),v&&v(t,O)},[m,a,v,t]);return b.jsx("rect",{x:t.x0,y:t.y0,width:t.width,height:t.height,stroke:"red",strokeWidth:r?1:0,strokeOpacity:.75,fill:"red",fillOpacity:o&&r?.35:0,onMouseEnter:p,onMouseMove:x,onMouseLeave:S,onClick:w,onTouchStart:M,onTouchMove:_,onTouchEnd:E,"data-ref":t.id})}),si1=$.memo(function(e){var t=e.slices,C=e.axis,n=e.debug,r=e.height,i=e.tooltip,o=e.current,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd;return t.map(function(g){return b.jsx(ai1,{slice:g,slices:t,axis:C,debug:n,height:r,tooltip:i,setCurrent:a,isCurrent:o!==null&&o.id===g.id,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onClick:u,onTouchStart:d,onTouchMove:f,onTouchEnd:v},g.id)})}),li1=$.memo(function(e){var t=e.points,C=e.symbol,n=e.size,r=e.borderWidth,i=e.enableLabel,o=e.label,a=e.labelYOffset,s=W5(),l=e31(o),c=t.slice(0).reverse().map(function(u){return{id:u.id,x:u.x,y:u.y,datum:u.data,fill:u.color,stroke:u.borderColor,label:i?l(u):null}});return b.jsx("g",{children:c.map(function(u){return b.jsx(X41,{x:u.x,y:u.y,datum:u.datum,symbol:C,size:n,color:u.fill,borderWidth:r,borderColor:u.stroke,label:u.label,labelYOffset:a,theme:s},u.id)})})}),ci1=$.memo(function(e){var t=e.points,C=e.width,n=e.height,r=e.margin,i=e.setCurrent,o=e.onMouseEnter,a=e.onMouseMove,s=e.onMouseLeave,l=e.onClick,c=e.onTouchStart,u=e.onTouchMove,d=e.onTouchEnd,f=e.tooltip,v=e.debug,g=e.enableTouchCrosshair,h=s3(),m=h.showTooltipAt,p=h.hideTooltip,x=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),o&&o(T,k)},[m,f,o,r]),S=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),a&&a(T,k)},[m,f,r.left,r.top,a]),w=$.useCallback(function(T,k){p(),s&&s(T,k)},[p,s]),M=$.useCallback(function(T,k){l&&l(T,k)},[l]),_=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),c&&c(T,k)},[r.left,r.top,c,m,f]),E=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),u&&u(T,k)},[r.left,r.top,u,m,f]),O=$.useCallback(function(T,k){p(),d&&d(T,k)},[d,p]);return b.jsx(j$,{nodes:t,width:C,height:n,setCurrent:i,onMouseEnter:x,onMouseMove:S,onMouseLeave:w,onClick:M,onTouchStart:_,onTouchMove:E,onTouchEnd:O,enableTouchCrosshair:g,debug:v})}),ui1=KS(function(e){var t=e.data,C=e.xScale,n=C===void 0?{type:"point"}:C,r=e.xFormat,i=e.yScale,o=i===void 0?{type:"linear",min:0,max:"auto"}:i,a=e.yFormat,s=e.layers,l=s===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:s,c=e.curve,u=c===void 0?"linear":c,d=e.areaBaselineValue,f=d===void 0?0:d,v=e.colors,g=v===void 0?{scheme:"nivo"}:v,h=e.margin,m=e.width,p=e.height,x=e.axisTop,S=e.axisRight,w=e.axisBottom,M=w===void 0?{}:w,_=e.axisLeft,E=_===void 0?{}:_,O=e.enableGridX,T=O===void 0||O,k=e.enableGridY,A=k===void 0||k,V=e.gridXValues,R=e.gridYValues,P=e.lineWidth,L=P===void 0?2:P,H=e.enableArea,I=H!==void 0&&H,j=e.areaOpacity,N=j===void 0?.2:j,z=e.areaBlendMode,q=z===void 0?"normal":z,G=e.enablePoints,Y=G===void 0||G,e1=e.pointSymbol,Q=e.pointSize,K=Q===void 0?6:Q,J=e.pointColor,W=J===void 0?{from:"color"}:J,U=e.pointBorderWidth,Z=U===void 0?0:U,D=e.pointBorderColor,n1=D===void 0?{theme:"background"}:D,B=e.enablePointLabel,r1=B!==void 0&&B,i1=e.pointLabel,g1=i1===void 0?"data.yFormatted":i1,y1=e.pointLabelYOffset,m1=e.defs,b1=m1===void 0?[]:m1,S1=e.fill,v1=S1===void 0?[]:S1,h1=e.markers,l1=e.legends,$1=l1===void 0?[]:l1,f1=e.isInteractive,A1=f1===void 0||f1,I1=e.useMesh,R1=I1!==void 0&&I1,k1=e.debugMesh,Y1=k1!==void 0&&k1,X1=e.onMouseEnter,D1=e.onMouseMove,L1=e.onMouseLeave,Q1=e.onClick,U1=e.onTouchStart,q1=e.onTouchMove,u1=e.onTouchEnd,_1=e.tooltip,K1=_1===void 0?Mu:_1,C5=e.enableSlices,N1=C5!==void 0&&C5,z1=e.debugSlices,F1=z1!==void 0&&z1,J1=e.sliceTooltip,t5=J1===void 0?uM:J1,B1=e.enableCrosshair,P1=B1===void 0||B1,l5=e.crosshairType,m5=l5===void 0?"bottom-left":l5,O1=e.enableTouchCrosshair,d1=O1!==void 0&&O1,w1=e.role,V1=w1===void 0?"img":w1,G1=z8(m,p,h),W1=G1.margin,n5=G1.innerWidth,X=G1.innerHeight,o1=G1.outerWidth,a1=G1.outerHeight,T1=fM({data:t,xScale:n,xFormat:r,yScale:o,yFormat:a,width:n5,height:X,colors:g,curve:u,areaBaselineValue:f,pointColor:W,pointBorderColor:n1,enableSlices:N1}),r5=T1.legendData,o5=T1.toggleSerie,a5=T1.lineGenerator,d5=T1.areaGenerator,p1=T1.series,x1=T1.xScale,H1=T1.yScale,i5=T1.slices,g5=T1.points,y5=W5(),f5=E4(W,y5),V5=E4(n1,y5),C2=$.useState(null),I5=C2[0],c2=C2[1],i4=$.useState(null),N5=i4[0],V2=i4[1],s5={grid:b.jsx(R$,{theme:y5,width:n5,height:X,xScale:T?x1:null,yScale:A?H1:null,xValues:V,yValues:R},"grid"),markers:b.jsx(YS,{markers:h1,width:n5,height:X,xScale:x1,yScale:H1,theme:y5},"markers"),axes:b.jsx(T$,{xScale:x1,yScale:H1,width:n5,height:X,theme:y5,top:x,right:S,bottom:M,left:E},"axes"),areas:null,lines:b.jsx(oi1,{lines:p1,lineGenerator:a5,lineWidth:L},"lines"),slices:null,points:null,crosshair:null,mesh:null,legends:$1.map(function(a2,u2){return b.jsx(Tn,c4({},a2,{containerWidth:n5,containerHeight:X,data:a2.data||r5,theme:y5,toggleSerie:a2.toggleSerie?o5:void 0}),"legend."+u2)})},S2=gu(b1,p1,v1);return I&&(s5.areas=b.jsx(ri1,{areaGenerator:d5,areaOpacity:N,areaBlendMode:q,lines:p1},"areas")),A1&&N1!==!1&&(s5.slices=b.jsx(si1,{slices:i5,axis:N1,debug:F1,height:X,tooltip:t5,current:N5,setCurrent:V2,onMouseEnter:X1,onMouseMove:D1,onMouseLeave:L1,onClick:Q1,onTouchStart:U1,onTouchMove:q1,onTouchEnd:u1},"slices")),Y&&(s5.points=b.jsx(li1,{points:g5,symbol:e1,size:K,color:f5,borderWidth:Z,borderColor:V5,enableLabel:r1,label:g1,labelYOffset:y1},"points")),A1&&P1&&(I5!==null&&(s5.crosshair=b.jsx(ia,{width:n5,height:X,x:I5.x,y:I5.y,type:m5},"crosshair")),N5!==null&&(s5.crosshair=b.jsx(ia,{width:n5,height:X,x:N5.x,y:N5.y,type:N1},"crosshair"))),A1&&R1&&N1===!1&&(s5.mesh=b.jsx(ci1,{points:g5,width:n5,height:X,margin:W1,current:I5,setCurrent:c2,onMouseEnter:X1,onMouseMove:D1,onMouseLeave:L1,onClick:Q1,onTouchStart:U1,onTouchMove:q1,onTouchEnd:u1,tooltip:K1,enableTouchCrosshair:d1,debug:Y1},"mesh")),b.jsx(y6,{defs:S2,width:o1,height:a1,margin:W1,role:V1,children:l.map(function(a2,u2){return typeof a2=="function"?b.jsx($.Fragment,{children:a2(c4({},e,{innerWidth:n5,innerHeight:X,series:p1,slices:i5,points:g5,xScale:x1,yScale:H1,lineGenerator:a5,areaGenerator:d5,currentPoint:I5,setCurrentPoint:c2,currentSlice:N5,setCurrentSlice:V2}))},u2):s5[a2]})})}),di1=function(e){return b.jsx(U7,{children:function(t){var C=t.width,n=t.height;return b.jsx(ui1,c4({width:C,height:n},e))}})},fi1=KS(function(e){var t=$.useRef(null),C=e.width,n=e.height,r=e.margin,i=e.pixelRatio,o=i===void 0?typeof window<"u"&&window.devicePixelRatio||1:i,a=e.data,s=e.xScale,l=s===void 0?{type:"point"}:s,c=e.xFormat,u=e.yScale,d=u===void 0?{type:"linear",min:0,max:"auto"}:u,f=e.yFormat,v=e.curve,g=v===void 0?"linear":v,h=e.layers,m=h===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:h,p=e.colors,x=p===void 0?{scheme:"nivo"}:p,S=e.lineWidth,w=S===void 0?2:S,M=e.enableArea,_=M!==void 0&&M,E=e.areaBaselineValue,O=E===void 0?0:E,T=e.areaOpacity,k=T===void 0?.2:T,A=e.enablePoints,V=A===void 0||A,R=e.pointSize,P=R===void 0?6:R,L=e.pointColor,H=L===void 0?{from:"color"}:L,I=e.pointBorderWidth,j=I===void 0?0:I,N=e.pointBorderColor,z=N===void 0?{theme:"background"}:N,q=e.enableGridX,G=q===void 0||q,Y=e.gridXValues,e1=e.enableGridY,Q=e1===void 0||e1,K=e.gridYValues,J=e.axisTop,W=e.axisRight,U=e.axisBottom,Z=U===void 0?{}:U,D=e.axisLeft,n1=D===void 0?{}:D,B=e.legends,r1=B===void 0?[]:B,i1=e.isInteractive,g1=i1===void 0||i1,y1=e.debugMesh,m1=y1!==void 0&&y1,b1=e.onMouseLeave,S1=e.onClick,v1=e.tooltip,h1=v1===void 0?Mu:v1,l1=e.canvasRef,$1=z8(C,n,r),f1=$1.margin,A1=$1.innerWidth,I1=$1.innerHeight,R1=$1.outerWidth,k1=$1.outerHeight,Y1=W5(),X1=$.useState(null),D1=X1[0],L1=X1[1],Q1=fM({data:a,xScale:l,xFormat:c,yScale:d,yFormat:f,width:A1,height:I1,colors:x,curve:g,areaBaselineValue:O,pointColor:H,pointBorderColor:z}),U1=Q1.lineGenerator,q1=Q1.areaGenerator,u1=Q1.series,_1=Q1.xScale,K1=Q1.yScale,C5=Q1.points,N1=xu({points:C5,width:A1,height:I1,debug:m1}),z1=N1.delaunay,F1=N1.voronoi;$.useEffect(function(){l1&&(l1.current=t.current),t.current.width=R1*o,t.current.height=k1*o;var d1=t.current.getContext("2d");d1.scale(o,o),d1.fillStyle=Y1.background,d1.fillRect(0,0,R1,k1),d1.translate(f1.left,f1.top),m.forEach(function(w1){if(typeof w1=="function"&&w1({ctx:d1,innerWidth:A1,innerHeight:I1,series:u1,points:C5,xScale:_1,yScale:K1,lineWidth:w,lineGenerator:U1,areaGenerator:q1,currentPoint:D1,setCurrentPoint:L1}),w1==="grid"&&Y1.grid.line.strokeWidth>0&&(d1.lineWidth=Y1.grid.line.strokeWidth,d1.strokeStyle=Y1.grid.line.stroke,G&&hC(d1,{width:A1,height:I1,scale:_1,axis:"x",values:Y}),Q&&hC(d1,{width:A1,height:I1,scale:K1,axis:"y",values:K})),w1==="axes"&&H$(d1,{xScale:_1,yScale:K1,width:A1,height:I1,top:J,right:W,bottom:Z,left:n1,theme:Y1}),w1==="areas"&&_===!0){d1.save(),d1.globalAlpha=k,q1.context(d1);for(var V1=u1.length-1;V1>=0;V1--)d1.fillStyle=u1[V1].color,d1.beginPath(),q1(u1[V1].data.map(function(W1){return W1.position})),d1.fill();d1.restore()}if(w1==="lines"&&(U1.context(d1),u1.forEach(function(W1){d1.strokeStyle=W1.color,d1.lineWidth=w,d1.beginPath(),U1(W1.data.map(function(n5){return n5.position})),d1.stroke()})),w1==="points"&&V===!0&&P>0&&C5.forEach(function(W1){d1.fillStyle=W1.color,d1.beginPath(),d1.arc(W1.x,W1.y,P/2,0,2*Math.PI),d1.fill(),j>0&&(d1.strokeStyle=W1.borderColor,d1.lineWidth=j,d1.stroke())}),w1==="mesh"&&m1===!0&&(I$(d1,F1),D1&&A$(d1,F1,D1.index)),w1==="legends"){var G1=u1.map(function(W1){return{id:W1.id,label:W1.id,color:W1.color}}).reverse();r1.forEach(function(W1){n$(d1,c4({},W1,{data:W1.data||G1,containerWidth:A1,containerHeight:I1,theme:Y1}))})}})},[t,R1,k1,m,Y1,U1,u1,_1,K1,G,Y,Q,K,J,W,Z,n1,r1,C5,V,P,D1]);var J1=$.useCallback(function(d1){var w1=hu(t.current,d1),V1=w1[0],G1=w1[1];if(!XS(f1.left,f1.top,A1,I1,V1,G1))return null;var W1=z1.find(V1-f1.left,G1-f1.top);return C5[W1]},[t,f1,A1,I1,z1]),t5=s3(),B1=t5.showTooltipFromEvent,P1=t5.hideTooltip,l5=$.useCallback(function(d1){var w1=J1(d1);L1(w1),w1?B1($.createElement(h1,{point:w1}),d1):P1()},[J1,L1,B1,P1,h1]),m5=$.useCallback(function(d1){P1(),L1(null),D1&&b1&&b1(D1,d1)},[P1,L1,b1]),O1=$.useCallback(function(d1){if(S1){var w1=J1(d1);w1&&S1(w1,d1)}},[J1,S1]);return b.jsx("canvas",{ref:t,width:R1*o,height:k1*o,style:{width:R1,height:k1,cursor:g1?"auto":"normal"},onMouseEnter:g1?l5:void 0,onMouseMove:g1?l5:void 0,onMouseLeave:g1?m5:void 0,onClick:g1?O1:void 0})}),hi1=$.forwardRef(function(e,t){return b.jsx(fi1,c4({},e,{canvasRef:t}))});$.forwardRef(function(e,t){return b.jsx(U7,{children:function(C){var n=C.width,r=C.height;return b.jsx(hi1,c4({width:n,height:r},e,{ref:t}))}})});const gi1=({trendsData:e,height:t=null,margin:C={},colors:n=null,xLeg:r,yLeg:i,tooltip:o=null})=>b.jsxs(b.Fragment,{children:[b.jsx(O2,{}),b.jsx("div",{style:{width:"100%",height:t||600},children:b.jsx(di1,{data:e,margin:{top:50,right:90,bottom:50,left:90,...C},colors:n||{scheme:"nivo"},xScale:{type:"point"},yScale:{type:"linear",min:"auto",max:"auto",reverse:!1},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:0,legend:r,legendOffset:36,legendPosition:"middle"},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:i,legendOffset:-70,legendPosition:"middle"},pointSize:10,pointColor:{theme:"background"},pointBorderWidth:2,pointBorderColor:{from:"serieColor"},pointLabelYOffset:-12,useMesh:!0,legends:[{anchor:"top-right",direction:"column",justify:!1,translateX:210,translateY:-40,itemsSpacing:0,itemDirection:"left-to-right",itemWidth:200,itemHeight:20,itemOpacity:.9,symbolSize:8,symbolShape:"circle",symbolBorderColor:"rgba(0, 0, 0, .5)",effects:[{on:"hover",style:{itemBackground:"rgba(0, 0, 0, .03)",itemOpacity:1}}]}],tooltip:a=>b.jsx(v4,{body:(o==null?void 0:o(a))||b.jsx("span",{children:"Line tooltip"})})})})]}),vi1=_5.h3`
|
|
496
|
+
`,o61=({pieChartData:e,title:t,isEmpty:C,tooltip:n=null,customStyle:r={},customMargin:i={}})=>{const o=({centerX:a,centerY:s})=>b.jsx("text",{x:a,y:s,textAnchor:"middle",dominantBaseline:"central",style:{fontSize:"16px",fontWeight:400},children:C?"Data niet openbaar beschikbaar":""});return b.jsxs(b.Fragment,{children:[b.jsx(O2,{}),b.jsx("div",{style:{width:"100%",height:500,position:"relative",...r},children:b.jsxs(J4,{children:[b.jsx(R7,{justify:"center",children:b.jsx(i61,{children:t})}),b.jsx(R7,{style:{width:"100%",height:500,position:"relative"},justify:"center",children:b.jsx(r61,{colors:{scheme:C?"greys":"nivo"},data:e,enableArcLabels:!C,enableArcLinkLabels:!C,margin:{top:20,right:120,bottom:100,left:120,...i},innerRadius:.5,padAngle:.7,cornerRadius:3,activeOuterRadiusOffset:8,borderWidth:1,borderColor:{from:"color",modifiers:[["darker",.2]]},arcLinkLabelsSkipAngle:10,arcLinkLabelsTextColor:"#333333",arcLinkLabelsThickness:2,arcLinkLabelsColor:{from:"color"},arcLabelsSkipAngle:10,arcLabelsTextColor:{from:"color",modifiers:[["darker",2]]},isInteractive:!C,layers:["arcs","arcLabels","arcLinkLabels","legends",o],defs:[{id:"dots",type:"patternDots",background:"inherit",color:"rgba(255, 255, 255, 0.3)",size:4,padding:1,stagger:!0},{id:"lines",type:"patternLines",background:"inherit",color:"rgba(255, 255, 255, 0.3)",rotation:-45,lineWidth:6,spacing:10}],tooltip:({datum:{id:a,value:s,unit:l}})=>b.jsx(v4,{body:(n==null?void 0:n({id:a,value:s,unit:l}))||b.jsx("span",{children:"Pie chart tooltip"})})})})]})})]})};var a61=nn,s61=uu,l61=1,c61=2;function u61(e,t,C,n){var r=C.length,i=r,o=!n;if(e==null)return!i;for(e=Object(e);r--;){var a=C[r];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<i;){a=C[r];var s=a[0],l=e[s],c=a[1];if(o&&a[2]){if(l===void 0&&!(s in e))return!1}else{var u=new a61;if(n)var d=n(l,c,s,e,t,u);if(!(d===void 0?s61(c,l,l61|c61,n,u):d))return!1}}return!0}var d61=u61,f61=$3;function h61(e){return e===e&&!f61(e)}var m$=h61,g61=m$,v61=be;function m61(e){for(var t=v61(e),C=t.length;C--;){var n=t[C],r=e[n];t[C]=[n,r,g61(r)]}return t}var p61=m61;function b61(e,t){return function(C){return C==null?!1:C[e]===t&&(t!==void 0||e in Object(C))}}var p$=b61,y61=d61,x61=p61,w61=p$;function S61(e){var t=x61(e);return t.length==1&&t[0][2]?w61(t[0][0],t[0][1]):function(C){return C===e||y61(C,e,t)}}var $61=S61,M61=uu,E61=xw,_61=yS,O61=Tl,V61=m$,T61=p$,R61=a6,H61=1,k61=2;function L61(e,t){return O61(e)&&V61(t)?T61(R61(e),t):function(C){var n=E61(C,e);return n===void 0&&n===t?_61(C,e):M61(t,n,H61|k61)}}var P61=L61;function j61(e){return function(t){return t==null?void 0:t[e]}}var I61=j61,A61=he;function N61(e){return function(t){return A61(t,e)}}var D61=N61,F61=I61,z61=D61,B61=Tl,W61=a6;function U61(e){return B61(e)?F61(W61(e)):z61(e)}var Z61=U61,q61=$61,G61=P61,Y61=ln,K61=b4,X61=Z61;function Q61(e){return typeof e=="function"?e:e==null?Y61:typeof e=="object"?K61(e)?G61(e[0],e[1]):q61(e):X61(e)}var mu=Q61,J61=mu,e01=fx;function t01(e,t){return e&&e.length?e01(e,J61(t)):[]}var C01=t01;const _a=p2(C01);var n01=nw,r01=be;function i01(e,t){return e&&n01(e,t,r01)}var o01=i01,a01=n6;function s01(e,t){return function(C,n){if(C==null)return C;if(!a01(C))return e(C,n);for(var r=C.length,i=t?r:-1,o=Object(C);(t?i--:++i<r)&&n(o[i],i,o)!==!1;);return C}}var l01=s01,c01=o01,u01=l01,d01=u01(c01),b$=d01,f01=b$,h01=n6;function g01(e,t){var C=-1,n=h01(e)?Array(e.length):[];return f01(e,function(r,i,o){n[++C]=t(r,i,o)}),n}var v01=g01;function m01(e,t){var C=e.length;for(e.sort(t);C--;)e[C]=e[C].value;return e}var p01=m01,zv=cn;function b01(e,t){if(e!==t){var C=e!==void 0,n=e===null,r=e===e,i=zv(e),o=t!==void 0,a=t===null,s=t===t,l=zv(t);if(!a&&!l&&!i&&e>t||i&&o&&s&&!a&&!l||n&&o&&s||!C&&s||!r)return 1;if(!n&&!i&&!l&&e<t||l&&C&&r&&!n&&!i||a&&C&&r||!o&&r||!s)return-1}return 0}var y01=b01,x01=y01;function w01(e,t,C){for(var n=-1,r=e.criteria,i=t.criteria,o=r.length,a=C.length;++n<o;){var s=x01(r[n],i[n]);if(s){if(n>=a)return s;var l=C[n];return s*(l=="desc"?-1:1)}}return e.index-t.index}var S01=w01,mi=un,$01=he,M01=mu,E01=v01,_01=p01,O01=r6,V01=S01,T01=ln,R01=b4;function H01(e,t,C){t.length?t=mi(t,function(i){return R01(i)?function(o){return $01(o,i.length===1?i[0]:i)}:i}):t=[T01];var n=-1;t=mi(t,O01(M01));var r=E01(e,function(i,o,a){var s=mi(t,function(l){return l(i)});return{criteria:s,index:++n,value:i}});return _01(r,function(i,o){return V01(i,o,C)})}var k01=H01,L01=wS,P01=k01,j01=Ol,Bv=pw,I01=j01(function(e,t){if(e==null)return[];var C=t.length;return C>1&&Bv(e,t[0],t[1])?t=[]:C>2&&Bv(t[0],t[1],t[2])&&(t=[t[0]]),P01(e,L01(t,1),[])}),A01=I01;const N01=p2(A01);var D01=g7,F01=Z4,z01="[object Date]";function B01(e){return F01(e)&&D01(e)==z01}var W01=B01,U01=W01,Z01=r6,Wv=an,Uv=Wv&&Wv.isDate,q01=Uv?Z01(Uv):U01,G01=q01;const Y01=p2(G01);var pi=new Date,bi=new Date;function w2(e,t,C,n){function r(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return r.floor=function(i){return e(i=new Date(+i)),i},r.ceil=function(i){return e(i=new Date(i-1)),t(i,1),e(i),i},r.round=function(i){var o=r(i),a=r.ceil(i);return i-o<a-i?o:a},r.offset=function(i,o){return t(i=new Date(+i),o==null?1:Math.floor(o)),i},r.range=function(i,o,a){var s=[],l;if(i=r.ceil(i),a=a==null?1:Math.floor(a),!(i<o)||!(a>0))return s;do s.push(l=new Date(+i)),t(i,a),e(i);while(l<i&&i<o);return s},r.filter=function(i){return w2(function(o){if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},function(o,a){if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!i(o););else for(;--a>=0;)for(;t(o,1),!i(o););})},C&&(r.count=function(i,o){return pi.setTime(+i),bi.setTime(+o),e(pi),e(bi),Math.floor(C(pi,bi))},r.every=function(i){return i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?r.filter(n?function(o){return n(o)%i===0}:function(o){return r.count(0,o)%i===0}):r}),r}var f7=w2(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});f7.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?w2(function(t){t.setTime(Math.floor(t/e)*e)},function(t,C){t.setTime(+t+C*e)},function(t,C){return(C-t)/e}):f7};f7.range;var dC=1e3,z9=6e4,fC=36e5,y$=6048e5,w8=w2(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*dC)},function(e,t){return(t-e)/dC},function(e){return e.getUTCSeconds()});w8.range;var Rn=w2(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*dC)},function(e,t){e.setTime(+e+t*z9)},function(e,t){return(t-e)/z9},function(e){return e.getMinutes()});Rn.range;var Hn=w2(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*dC-e.getMinutes()*z9)},function(e,t){e.setTime(+e+t*fC)},function(e,t){return(t-e)/fC},function(e){return e.getHours()});Hn.range;function W8(e){return w2(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,C){t.setDate(t.getDate()+C*7)},function(t,C){return(C-t-(C.getTimezoneOffset()-t.getTimezoneOffset())*z9)/y$})}var S8=W8(0),kn=W8(1),Ln=W8(2),Pn=W8(3),jn=W8(4),In=W8(5),An=W8(6);S8.range;kn.range;Ln.range;Pn.range;jn.range;In.range;An.range;var Nn=w2(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()});Nn.range;var xe=w2(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});xe.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:w2(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,C){t.setFullYear(t.getFullYear()+C*e)})};xe.range;var Dn=w2(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*z9)},function(e,t){return(t-e)/z9},function(e){return e.getUTCMinutes()});Dn.range;var Fn=w2(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*fC)},function(e,t){return(t-e)/fC},function(e){return e.getUTCHours()});Fn.range;function U8(e){return w2(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,C){t.setUTCDate(t.getUTCDate()+C*7)},function(t,C){return(C-t)/y$})}var $8=U8(0),zn=U8(1),Bn=U8(2),Wn=U8(3),Un=U8(4),Zn=U8(5),qn=U8(6);$8.range;zn.range;Bn.range;Wn.range;Un.range;Zn.range;qn.range;var Gn=w2(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()});Gn.range;var we=w2(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});we.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:w2(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,C){t.setUTCFullYear(t.getUTCFullYear()+C*e)})};we.range;function t8(){return t8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},t8.apply(this,arguments)}var a9=[function(e){return e.setMilliseconds(0)},function(e){return e.setSeconds(0)},function(e){return e.setMinutes(0)},function(e){return e.setHours(0)},function(e){return e.setDate(1)},function(e){return e.setMonth(0)}],K01={millisecond:[],second:a9.slice(0,1),minute:a9.slice(0,2),hour:a9.slice(0,3),day:a9.slice(0,4),month:a9.slice(0,5),year:a9.slice(0,6)},X01=function(e){return function(t){return K01[e].forEach(function(C){C(t)}),t}},x$=function(e){var t=e.format,C=t===void 0?"native":t,n=e.precision,r=n===void 0?"millisecond":n,i=e.useUTC,o=i===void 0||i,a=X01(r);return function(s){if(s===void 0)return s;if(C==="native"||s instanceof Date)return a(s);var l=o?su(C):au(C);return a(l(s))}},Q01=function(e,t,C,n){var r,i,o,a,s=e.min,l=s===void 0?0:s,c=e.max,u=c===void 0?"auto":c,d=e.stacked,f=d!==void 0&&d,v=e.reverse,g=v!==void 0&&v,h=e.clamp,m=h!==void 0&&h,p=e.nice,x=p!==void 0&&p;l==="auto"?r=f===!0?(i=t.minStacked)!=null?i:0:t.min:r=l,u==="auto"?o=f===!0?(a=t.maxStacked)!=null?a:0:t.max:o=u;var S=P8().rangeRound(n==="x"?[0,C]:[C,0]).domain(g?[o,r]:[r,o]).clamp(m);return x===!0?S.nice():typeof x=="number"&&S.nice(x),J01(S,f)},J01=function(e,t){t===void 0&&(t=!1);var C=e;return C.type="linear",C.stacked=t,C},ee1=function(e,t,C){var n=Hw().range([0,C]).domain(t.all);return n.type="point",n},te1=function(e,t,C,n){var r=e.round,i=r===void 0||r,o=j9().range(n==="x"?[0,C]:[C,0]).domain(t.all).round(i);return Ce1(o)},Ce1=function(e){var t=e;return t.type="band",t},ne1=function(e,t,C){var n,r,i=e.format,o=i===void 0?"native":i,a=e.precision,s=a===void 0?"millisecond":a,l=e.min,c=l===void 0?"auto":l,u=e.max,d=u===void 0?"auto":u,f=e.useUTC,v=f===void 0||f,g=e.nice,h=g!==void 0&&g,m=x$({format:o,precision:s,useUTC:v});n=c==="auto"?m(t.min):o!=="native"?m(c):c,r=d==="auto"?m(t.max):o!=="native"?m(d):d;var p=v?qw():Zw();p.range([0,C]),n&&r&&p.domain([n,r]),h===!0?p.nice():typeof h!="object"&&typeof h!="number"||p.nice(h);var x=p;return x.type="time",x.useUTC=v,x},re1=function(e,t,C,n){var r,i=e.base,o=i===void 0?10:i,a=e.min,s=a===void 0?"auto":a,l=e.max,c=l===void 0?"auto":l;if(t.all.some(function(g){return g===0}))throw new Error("a log scale domain must not include or cross zero");var u,d,f=!1;if(t.all.filter(function(g){return g!=null}).forEach(function(g){f||(r===void 0?r=Math.sign(g):Math.sign(g)!==r&&(f=!0))}),f)throw new Error("a log scale domain must be strictly-positive or strictly-negative");u=s==="auto"?t.min:s,d=c==="auto"?t.max:c;var v=Fl().domain([u,d]).rangeRound(n==="x"?[0,C]:[C,0]).base(o).nice();return v.type="log",v},ie1=function(e,t,C,n){var r,i,o=e.constant,a=o===void 0?1:o,s=e.min,l=s===void 0?"auto":s,c=e.max,u=c===void 0?"auto":c,d=e.reverse,f=d!==void 0&&d;r=l==="auto"?t.min:l,i=u==="auto"?t.max:u;var v=zl().constant(a).rangeRound(n==="x"?[0,C]:[C,0]).nice();f===!0?v.domain([i,r]):v.domain([r,i]);var g=v;return g.type="symlog",g},oe1=function(e){return e==="x"?"y":"x"},ae1=function(e,t){return e===t},se1=function(e,t){return e.getTime()===t.getTime()};function Zv(e,t,C,n){switch(e.type){case"linear":return Q01(e,t,C,n);case"point":return ee1(e,t,C);case"band":return te1(e,t,C,n);case"time":return ne1(e,t,C);case"log":return re1(e,t,C,n);case"symlog":return ie1(e,t,C,n);default:throw new Error("invalid scale spec")}}var qv=function(e,t,C){var n;if("stacked"in C&&C.stacked){var r=e.data[t==="x"?"xStacked":"yStacked"];return r==null?null:C(r)}return(n=C(e.data[t]))!=null?n:null},w$=function(e,t,C,n,r){var i=e.map(function(c){return function(u){return t8({},u,{data:u.data.map(function(d){return{data:t8({},d)}})})}(c)}),o=le1(i,t,C);"stacked"in t&&t.stacked===!0&&ce1(o,i),"stacked"in C&&C.stacked===!0&&ue1(o,i);var a=Zv(t,o.x,n,"x"),s=Zv(C,o.y,r,"y"),l=i.map(function(c){return t8({},c,{data:c.data.map(function(u){return t8({},u,{position:{x:qv(u,"x",a),y:qv(u,"y",s)}})})})});return t8({},o,{series:l,xScale:a,yScale:s})},le1=function(e,t,C){return{x:Gv(e,"x",t),y:Gv(e,"y",C)}},Gv=function(e,t,C,n){var r={},i=r.getValue,o=i===void 0?function(v){return v.data[t]}:i,a=r.setValue,s=a===void 0?function(v,g){v.data[t]=g}:a;if(C.type==="linear")e.forEach(function(v){v.data.forEach(function(g){var h=o(g);h&&s(g,parseFloat(String(h)))})});else if(C.type==="time"&&C.format!=="native"){var l=x$(C);e.forEach(function(v){v.data.forEach(function(g){var h=o(g);h&&s(g,l(h))})})}var c=[];switch(e.forEach(function(v){v.data.forEach(function(g){c.push(o(g))})}),C.type){case"linear":var u=N01(Bo(c).filter(function(v){return v!==null}),function(v){return v});return{all:u,min:Math.min.apply(Math,u),max:Math.max.apply(Math,u)};case"time":var d=_a(c,function(v){return v.getTime()}).slice(0).sort(function(v,g){return g.getTime()-v.getTime()}).reverse();return{all:d,min:d[0],max:c1(d)};default:var f=Bo(c);return{all:f,min:f[0],max:c1(f)}}},S$=function(e,t,C){var n=oe1(e),r=[];t[n].all.forEach(function(i){var o=Y01(i)?se1:ae1,a=[];C.forEach(function(s){var l=s.data.find(function(f){return o(f.data[n],i)}),c=null,u=null;if(l!==void 0){if((c=l.data[e])!==null){var d=c1(a);d===void 0?u=c:d!==null&&(u=d+c)}l.data[e==="x"?"xStacked":"yStacked"]=u}a.push(u),u!==null&&r.push(u)})}),t[e].minStacked=Math.min.apply(Math,r),t[e].maxStacked=Math.max.apply(Math,r)},ce1=function(e,t){return S$("x",e,t)},ue1=function(e,t){return S$("y",e,t)},$$=function(e){var t=e.bandwidth();if(t===0)return e;var C=t/2;return e.round()&&(C=Math.round(C)),function(n){var r;return((r=e(n))!=null?r:0)+C}},M$={millisecond:[f7,f7],second:[w8,w8],minute:[Rn,Dn],hour:[Hn,Fn],day:[w2(function(e){return e.setHours(0,0,0,0)},function(e,t){return e.setDate(e.getDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)}),w2(function(e){return e.setUTCHours(0,0,0,0)},function(e,t){return e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)})],week:[S8,$8],sunday:[S8,$8],monday:[kn,zn],tuesday:[Ln,Bn],wednesday:[Pn,Wn],thursday:[jn,Un],friday:[In,Zn],saturday:[An,qn],month:[Nn,Gn],year:[xe,we]},de1=Object.keys(M$),fe1=new RegExp("^every\\s*(\\d+)?\\s*("+de1.join("|")+")s?$","i"),E$=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var C=t.match(fe1);if(C){var n=C[1],r=C[2],i=M$[r][e.useUTC?1:0];if(r==="day"){var o,a,s=e.domain(),l=s[0],c=s[1],u=new Date(c);return u.setDate(u.getDate()+1),(o=(a=i.every(Number(n??1)))==null?void 0:a.range(l,u))!=null?o:[]}if(n===void 0)return e.ticks(i);var d=i.every(Number(n));if(d)return e.ticks(d)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(f=t)=="number"&&isFinite(f)&&Math.floor(f)===f)return e.ticks(t)}var f;return e.domain()};function D4(){return D4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},D4.apply(this,arguments)}var _$=function(e){var t,C=e.axis,n=e.scale,r=e.ticksPosition,i=e.tickValues,o=e.tickSize,a=e.tickPadding,s=e.tickRotation,l=e.truncateTickAt,c=e.engine,u=c===void 0?"svg":c,d=E$(n,i),f=q41[u],v="bandwidth"in n?$$(n):n,g={lineX:0,lineY:0},h={textX:0,textY:0},m=typeof document=="object"&&document.dir==="rtl",p=f.align.center,x=f.baseline.center;return C==="x"?(t=function(S){var w;return{x:(w=v(S))!=null?w:0,y:0}},g.lineY=o*(r==="after"?1:-1),h.textY=(o+a)*(r==="after"?1:-1),x=r==="after"?f.baseline.top:f.baseline.bottom,s===0?p=f.align.center:r==="after"&&s<0||r==="before"&&s>0?(p=f.align[m?"left":"right"],x=f.baseline.center):(r==="after"&&s>0||r==="before"&&s<0)&&(p=f.align[m?"right":"left"],x=f.baseline.center)):(t=function(S){var w;return{x:0,y:(w=v(S))!=null?w:0}},g.lineX=o*(r==="after"?1:-1),h.textX=(o+a)*(r==="after"?1:-1),p=r==="after"?f.align.left:f.align.right),{ticks:d.map(function(S){var w=typeof S=="string"?function(M){var _=String(M).length;return l&&l>0&&_>l?""+String(M).slice(0,l).concat("..."):""+M}(S):S;return D4({key:S instanceof Date?""+S.valueOf():""+S,value:w},t(S),g,h)}),textAlign:p,textBaseline:x}},O$=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var C=F8(e);return function(n){return C(n instanceof Date?n:new Date(n))}}return A8(e)},Oa=function(e){var t,C=e.width,n=e.height,r=e.scale,i=e.axis,o=e.values,a=(t=o,(Array.isArray(t)?o:void 0)||E$(r,o)),s="bandwidth"in r?$$(r):r,l=i==="x"?a.map(function(c){var u,d;return{key:c instanceof Date?""+c.valueOf():""+c,x1:(u=s(c))!=null?u:0,x2:(d=s(c))!=null?d:0,y1:0,y2:n}}):a.map(function(c){var u,d;return{key:c instanceof Date?""+c.valueOf():""+c,x1:0,x2:C,y1:(u=s(c))!=null?u:0,y2:(d=s(c))!=null?d:0}});return l},he1=$.memo(function(e){var t,C=e.value,n=e.format,r=e.lineX,i=e.lineY,o=e.onClick,a=e.textBaseline,s=e.textAnchor,l=e.animatedProps,c=W5(),u=c.axis.ticks.line,d=c.axis.ticks.text,f=(t=n==null?void 0:n(C))!=null?t:C,v=$.useMemo(function(){var g={opacity:l.opacity};return o?{style:D4({},g,{cursor:"pointer"}),onClick:function(h){return o(h,f)}}:{style:g}},[l.opacity,o,f]);return b.jsxs(e5.g,D4({transform:l.transform},v,{children:[b.jsx("line",{x1:0,x2:r,y1:0,y2:i,style:u}),d.outlineWidth>0&&b.jsx(e5.text,{dominantBaseline:a,textAnchor:s,transform:l.textTransform,style:d,strokeWidth:2*d.outlineWidth,stroke:d.outlineColor,strokeLinejoin:"round",children:""+f}),b.jsx(e5.text,{dominantBaseline:a,textAnchor:s,transform:l.textTransform,style:fu(d),children:""+f})]}))}),ge1=function(e){var t=e.axis,C=e.scale,n=e.x,r=n===void 0?0:n,i=e.y,o=i===void 0?0:i,a=e.length,s=e.ticksPosition,l=e.tickValues,c=e.tickSize,u=c===void 0?5:c,d=e.tickPadding,f=d===void 0?5:d,v=e.tickRotation,g=v===void 0?0:v,h=e.format,m=e.renderTick,p=m===void 0?he1:m,x=e.truncateTickAt,S=e.legend,w=e.legendPosition,M=w===void 0?"end":w,_=e.legendOffset,E=_===void 0?0:_,O=e.onClick,T=e.ariaHidden,k=W5(),A=k.axis.legend.text,V=$.useMemo(function(){return O$(h,C)},[h,C]),R=_$({axis:t,scale:C,ticksPosition:s,tickValues:l,tickSize:u,tickPadding:f,tickRotation:g,truncateTickAt:x}),P=R.ticks,L=R.textAlign,H=R.textBaseline,I=null;if(S!==void 0){var j,N=0,z=0,q=0;t==="y"?(q=-90,N=E,M==="start"?(j="start",z=a):M==="middle"?(j="middle",z=a/2):M==="end"&&(j="end")):(z=E,M==="start"?j="start":M==="middle"?(j="middle",N=a/2):M==="end"&&(j="end",N=a)),I=b.jsxs(b.Fragment,{children:[A.outlineWidth>0&&b.jsx("text",{transform:"translate("+N+", "+z+") rotate("+q+")",textAnchor:j,style:D4({dominantBaseline:"central"},A),strokeWidth:2*A.outlineWidth,stroke:A.outlineColor,strokeLinejoin:"round",children:S}),b.jsx("text",{transform:"translate("+N+", "+z+") rotate("+q+")",textAnchor:j,style:D4({dominantBaseline:"central"},A),children:S})]})}var G=A2(),Y=G.animate,e1=G.config,Q=X5({transform:"translate("+r+","+o+")",lineX2:t==="x"?a:0,lineY2:t==="x"?0:a,config:e1,immediate:!Y}),K=$.useCallback(function(U){return{opacity:1,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+g+")"}},[g]),J=$.useCallback(function(U){return{opacity:0,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+g+")"}},[g]),W=p4(P,{keys:function(U){return U.key},initial:K,from:J,enter:K,update:K,leave:{opacity:0},config:e1,immediate:!Y});return b.jsxs(e5.g,{transform:Q.transform,"aria-hidden":T,children:[W(function(U,Z,D,n1){return y.createElement(p,D4({tickIndex:n1,format:V,rotate:g,textBaseline:H,textAnchor:L,truncateTickAt:x,animatedProps:U},Z,O?{onClick:O}:{}))}),b.jsx(e5.line,{style:k.axis.domain.line,x1:0,x2:Q.lineX2,y1:0,y2:Q.lineY2}),I]})},ve1=$.memo(ge1),V$=["top","right","bottom","left"],T$=$.memo(function(e){var t=e.xScale,C=e.yScale,n=e.width,r=e.height,i={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return b.jsx(b.Fragment,{children:V$.map(function(o){var a=i[o];if(!a)return null;var s=o==="top"||o==="bottom";return b.jsx(ve1,D4({},a,{axis:s?"x":"y",x:o==="right"?n:0,y:o==="bottom"?r:0,scale:s?t:C,length:s?n:r,ticksPosition:o==="top"||o==="left"?"before":"after",truncateTickAt:a.truncateTickAt}),o)})})}),me1=$.memo(function(e){var t=e.animatedProps,C=W5();return b.jsx(e5.line,D4({},t,C.grid.line))}),Yv=$.memo(function(e){var t=e.lines,C=A2(),n=C.animate,r=C.config,i=p4(t,{keys:function(o){return o.key},initial:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},from:function(o){return{opacity:0,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},enter:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},update:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},leave:{opacity:0},config:r,immediate:!n});return b.jsx("g",{children:i(function(o,a){return $.createElement(me1,D4({},a,{key:a.key,animatedProps:o}))})})}),R$=$.memo(function(e){var t=e.width,C=e.height,n=e.xScale,r=e.yScale,i=e.xValues,o=e.yValues,a=$.useMemo(function(){return!!n&&Oa({width:t,height:C,scale:n,axis:"x",values:i})},[n,i,t,C]),s=$.useMemo(function(){return!!r&&Oa({width:t,height:C,scale:r,axis:"y",values:o})},[C,t,r,o]);return b.jsxs(b.Fragment,{children:[a&&b.jsx(Yv,{lines:a}),s&&b.jsx(Yv,{lines:s})]})}),pe1=function(e,t){var C,n=t.axis,r=t.scale,i=t.x,o=i===void 0?0:i,a=t.y,s=a===void 0?0:a,l=t.length,c=t.ticksPosition,u=t.tickValues,d=t.tickSize,f=d===void 0?5:d,v=t.tickPadding,g=v===void 0?5:v,h=t.tickRotation,m=h===void 0?0:h,p=t.format,x=t.legend,S=t.legendPosition,w=S===void 0?"end":S,M=t.legendOffset,_=M===void 0?0:M,E=t.theme,O=_$({axis:n,scale:r,ticksPosition:c,tickValues:u,tickSize:f,tickPadding:g,tickRotation:m,engine:"canvas"}),T=O.ticks,k=O.textAlign,A=O.textBaseline;e.save(),e.translate(o,s),e.textAlign=k,e.textBaseline=A;var V=E.axis.ticks.text;e.font=(V.fontWeight?V.fontWeight+" ":"")+V.fontSize+"px "+V.fontFamily,((C=E.axis.domain.line.strokeWidth)!=null?C:0)>0&&(e.lineWidth=Number(E.axis.domain.line.strokeWidth),e.lineCap="square",E.axis.domain.line.stroke&&(e.strokeStyle=E.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(n==="x"?l:0,n==="x"?0:l),e.stroke());var R=typeof p=="function"?p:function(j){return""+j};if(T.forEach(function(j){var N;((N=E.axis.ticks.line.strokeWidth)!=null?N:0)>0&&(e.lineWidth=Number(E.axis.ticks.line.strokeWidth),e.lineCap="square",E.axis.ticks.line.stroke&&(e.strokeStyle=E.axis.ticks.line.stroke),e.beginPath(),e.moveTo(j.x,j.y),e.lineTo(j.x+j.lineX,j.y+j.lineY),e.stroke());var z=R(j.value);e.save(),e.translate(j.x+j.textX,j.y+j.textY),e.rotate(N4(m)),V.outlineWidth>0&&(e.strokeStyle=V.outlineColor,e.lineWidth=2*V.outlineWidth,e.lineJoin="round",e.strokeText(""+z,0,0)),E.axis.ticks.text.fill&&(e.fillStyle=V.fill),e.fillText(""+z,0,0),e.restore()}),x!==void 0){var P=0,L=0,H=0,I="center";n==="y"?(H=-90,P=_,w==="start"?(I="start",L=l):w==="middle"?(I="center",L=l/2):w==="end"&&(I="end")):(L=_,w==="start"?I="start":w==="middle"?(I="center",P=l/2):w==="end"&&(I="end",P=l)),e.translate(P,L),e.rotate(N4(H)),e.font=(E.axis.legend.text.fontWeight?E.axis.legend.text.fontWeight+" ":"")+E.axis.legend.text.fontSize+"px "+E.axis.legend.text.fontFamily,E.axis.legend.text.fill&&(e.fillStyle=E.axis.legend.text.fill),e.textAlign=I,e.textBaseline="middle",e.fillText(x,0,0)}e.restore()},H$=function(e,t){var C=t.xScale,n=t.yScale,r=t.width,i=t.height,o=t.top,a=t.right,s=t.bottom,l=t.left,c=t.theme,u={top:o,right:a,bottom:s,left:l};V$.forEach(function(d){var f=u[d];if(!f)return null;var v=d==="top"||d==="bottom",g=d==="top"||d==="left"?"before":"after",h=v?C:n,m=O$(f.format,h);pe1(e,D4({},f,{axis:v?"x":"y",x:d==="right"?r:0,y:d==="bottom"?i:0,scale:h,format:m,length:v?r:i,ticksPosition:g,theme:c}))})},hC=function(e,t){var C=t.width,n=t.height,r=t.scale,i=t.axis,o=t.values;Oa({width:C,height:n,scale:r,axis:i,values:o}).forEach(function(a){e.beginPath(),e.moveTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.stroke()})},be1=b$;function ye1(e,t){var C=[];return be1(e,function(n,r,i){t(n,r,i)&&C.push(n)}),C}var xe1=ye1,we1=_S,Se1=xe1,$e1=mu,Me1=b4;function Ee1(e,t){var C=Me1(e)?we1:Se1;return C(e,$e1(t))}var _e1=Ee1;const pu=p2(_e1);var Oe1=g7,Ve1=Z4,Te1="[object Number]";function Re1(e){return typeof e=="number"||Ve1(e)&&Oe1(e)==Te1}var He1=Re1;const M8=p2(He1);function ke1(e,t,C){var n=-1,r=e.length;t<0&&(t=-t>r?0:r+t),C=C>r?r:C,C<0&&(C+=r),r=t>C?0:C-t>>>0,t>>>=0;for(var i=Array(r);++n<r;)i[n]=e[n+t];return i}var k$=ke1,Le1=he,Pe1=k$;function je1(e,t){return t.length<2?e:Le1(e,Pe1(t,0,-1))}var Ie1=je1,Ae1=o6,Ne1=Ow,De1=Ie1,Fe1=a6;function ze1(e,t){return t=Ae1(t,e),e=De1(e,t),e==null||delete e[Fe1(Ne1(t))]}var Be1=ze1,We1=Ml;function Ue1(e){return We1(e)?void 0:e}var Ze1=Ue1,qe1=un,Ge1=c$,Ye1=Be1,Ke1=o6,Xe1=i6,Qe1=Ze1,Je1=SS,et1=o$,tt1=1,Ct1=2,nt1=4,rt1=Je1(function(e,t){var C={};if(e==null)return C;var n=!1;t=qe1(t,function(i){return i=Ke1(i,e),n||(n=i.length>1),i}),Xe1(e,et1(e),C),n&&(C=Ge1(C,tt1|Ct1|nt1,Qe1));for(var r=t.length;r--;)Ye1(C,t[r]);return C}),it1=rt1;const Z8=p2(it1);function j7(){return j7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},j7.apply(this,arguments)}var Va={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},ot1=function(e){var t=typeof e;return $.isValidElement(e)||t==="string"||t==="function"||t==="object"},at1=function(e){var t=typeof e;return t==="string"||t==="function"},U0=function(e){return e.type==="circle"},Ta=function(e){return e.type==="dot"},Z0=function(e){return e.type==="rect"},st1=function(e){var t=e.data,C=e.annotations,n=e.getPosition,r=e.getDimensions;return C.reduce(function(i,o){var a=o.offset||0;return[].concat(i,pu(t,o.match).map(function(s){var l=n(s),c=r(s);return(U0(o)||Z0(o))&&(c.size=c.size+2*a,c.width=c.width+2*a,c.height=c.height+2*a),j7({},Z8(o,["match","offset"]),l,c,{size:o.size||c.size,datum:s})}))},[])},lt1=function(e,t,C,n){var r=Math.atan2(n-t,C-e);return Z41(Vn(r))},ct1=function(e){var t,C,n=e.x,r=e.y,i=e.noteX,o=e.noteY,a=e.noteWidth,s=a===void 0?Va.noteWidth:a,l=e.noteTextOffset,c=l===void 0?Va.noteTextOffset:l;if(M8(i))t=n+i;else{if(i.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=i.abs}if(M8(o))C=r+o;else{if(o.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");C=o.abs}var u=n,d=r,f=lt1(n,r,t,C);if(U0(e)){var v=f8(N4(f),e.size/2);u+=v.x,d+=v.y}if(Z0(e)){var g=Math.round((f+90)/45)%8;g===0&&(d-=e.height/2),g===1&&(u+=e.width/2,d-=e.height/2),g===2&&(u+=e.width/2),g===3&&(u+=e.width/2,d+=e.height/2),g===4&&(d+=e.height/2),g===5&&(u-=e.width/2,d+=e.height/2),g===6&&(u-=e.width/2),g===7&&(u-=e.width/2,d-=e.height/2)}var h=t,m=t;return(f+90)%360>180?(h-=s,m-=s):m+=s,{points:[[u,d],[t,C],[m,C]],text:[h,C-c],angle:f+90}},ut1=function(e){var t=e.data,C=e.annotations,n=e.getPosition,r=e.getDimensions;return $.useMemo(function(){return st1({data:t,annotations:C,getPosition:n,getDimensions:r})},[t,C,n,r])},dt1=function(e){return $.useMemo(function(){return ct1(e)},[e])},ft1=function(e){var t=e.datum,C=e.x,n=e.y,r=e.note,i=W5(),o=A2(),a=o.animate,s=o.config,l=X5({x:C,y:n,config:s,immediate:!a});return typeof r=="function"?$.createElement(r,{x:C,y:n,datum:t}):b.jsxs(b.Fragment,{children:[i.annotations.text.outlineWidth>0&&b.jsx(e5.text,{x:l.x,y:l.y,style:j7({},i.annotations.text,{strokeLinejoin:"round",strokeWidth:2*i.annotations.text.outlineWidth,stroke:i.annotations.text.outlineColor}),children:r}),b.jsx(e5.text,{x:l.x,y:l.y,style:Z8(i.annotations.text,["outlineWidth","outlineColor"]),children:r})]})},Kv=function(e){var t=e.points,C=e.isOutline,n=C!==void 0&&C,r=W5(),i=$.useMemo(function(){var s=t[0];return t.slice(1).reduce(function(l,c){return l+" L"+c[0]+","+c[1]},"M"+s[0]+","+s[1])},[t]),o=On(i);if(n&&r.annotations.link.outlineWidth<=0)return null;var a=j7({},r.annotations.link);return n&&(a.strokeLinecap="square",a.strokeWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,a.stroke=r.annotations.link.outlineColor,a.opacity=r.annotations.link.outlineOpacity),b.jsx(e5.path,{fill:"none",d:o,style:a})},ht1=function(e){var t=e.x,C=e.y,n=e.size,r=W5(),i=A2(),o=i.animate,a=i.config,s=X5({x:t,y:C,radius:n/2,config:a,immediate:!o});return b.jsxs(b.Fragment,{children:[r.annotations.outline.outlineWidth>0&&b.jsx(e5.circle,{cx:s.x,cy:s.y,r:s.radius,style:j7({},r.annotations.outline,{fill:"none",strokeWidth:r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,stroke:r.annotations.outline.outlineColor,opacity:r.annotations.outline.outlineOpacity})}),b.jsx(e5.circle,{cx:s.x,cy:s.y,r:s.radius,style:r.annotations.outline})]})},gt1=function(e){var t=e.x,C=e.y,n=e.size,r=n===void 0?Va.dotSize:n,i=W5(),o=A2(),a=o.animate,s=o.config,l=X5({x:t,y:C,radius:r/2,config:s,immediate:!a});return b.jsxs(b.Fragment,{children:[i.annotations.outline.outlineWidth>0&&b.jsx(e5.circle,{cx:l.x,cy:l.y,r:l.radius,style:j7({},i.annotations.outline,{fill:"none",strokeWidth:2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),b.jsx(e5.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.symbol})]})},vt1=function(e){var t=e.x,C=e.y,n=e.width,r=e.height,i=e.borderRadius,o=i===void 0?6:i,a=W5(),s=A2(),l=s.animate,c=s.config,u=X5({x:t-n/2,y:C-r/2,width:n,height:r,config:c,immediate:!l});return b.jsxs(b.Fragment,{children:[a.annotations.outline.outlineWidth>0&&b.jsx(e5.rect,{x:u.x,y:u.y,rx:o,ry:o,width:u.width,height:u.height,style:j7({},a.annotations.outline,{fill:"none",strokeWidth:a.annotations.outline.strokeWidth+2*a.annotations.outline.outlineWidth,stroke:a.annotations.outline.outlineColor,opacity:a.annotations.outline.outlineOpacity})}),b.jsx(e5.rect,{x:u.x,y:u.y,rx:o,ry:o,width:u.width,height:u.height,style:a.annotations.outline})]})},mt1=function(e){var t=e.datum,C=e.x,n=e.y,r=e.note,i=dt1(e);if(!ot1(r))throw new Error("note should be a valid react element");return b.jsxs(b.Fragment,{children:[b.jsx(Kv,{points:i.points,isOutline:!0}),U0(e)&&b.jsx(ht1,{x:C,y:n,size:e.size}),Ta(e)&&b.jsx(gt1,{x:C,y:n,size:e.size}),Z0(e)&&b.jsx(vt1,{x:C,y:n,width:e.width,height:e.height,borderRadius:e.borderRadius}),b.jsx(Kv,{points:i.points}),b.jsx(ft1,{datum:t,x:i.text[0],y:i.text[1],note:r})]})},Xv=function(e,t){t.forEach(function(C,n){var r=C[0],i=C[1];n===0?e.moveTo(r,i):e.lineTo(r,i)})},pt1=function(e,t){var C=t.annotations,n=t.theme;C.length!==0&&(e.save(),C.forEach(function(r){if(!at1(r.note))throw new Error("note is invalid for canvas implementation");n.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=n.annotations.link.outlineColor,e.lineWidth=n.annotations.link.strokeWidth+2*n.annotations.link.outlineWidth,e.beginPath(),Xv(e,r.computed.points),e.stroke(),e.lineCap="butt"),U0(r)&&n.annotations.outline.outlineWidth>0&&(e.strokeStyle=n.annotations.outline.outlineColor,e.lineWidth=n.annotations.outline.strokeWidth+2*n.annotations.outline.outlineWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),Ta(r)&&n.annotations.symbol.outlineWidth>0&&(e.strokeStyle=n.annotations.symbol.outlineColor,e.lineWidth=2*n.annotations.symbol.outlineWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),Z0(r)&&n.annotations.outline.outlineWidth>0&&(e.strokeStyle=n.annotations.outline.outlineColor,e.lineWidth=n.annotations.outline.strokeWidth+2*n.annotations.outline.outlineWidth,e.beginPath(),e.rect(r.x-r.width/2,r.y-r.height/2,r.width,r.height),e.stroke()),e.strokeStyle=n.annotations.link.stroke,e.lineWidth=n.annotations.link.strokeWidth,e.beginPath(),Xv(e,r.computed.points),e.stroke(),U0(r)&&(e.strokeStyle=n.annotations.outline.stroke,e.lineWidth=n.annotations.outline.strokeWidth,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.stroke()),Ta(r)&&(e.fillStyle=n.annotations.symbol.fill,e.beginPath(),e.arc(r.x,r.y,r.size/2,0,2*Math.PI),e.fill()),Z0(r)&&(e.strokeStyle=n.annotations.outline.stroke,e.lineWidth=n.annotations.outline.strokeWidth,e.beginPath(),e.rect(r.x-r.width/2,r.y-r.height/2,r.width,r.height),e.stroke()),typeof r.note=="function"?r.note(e,{datum:r.datum,x:r.computed.text[0],y:r.computed.text[1],theme:n}):(e.font=n.annotations.text.fontSize+"px "+n.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=n.annotations.text.fill,e.strokeStyle=n.annotations.text.outlineColor,e.lineWidth=2*n.annotations.text.outlineWidth,n.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(r.note,r.computed.text[0],r.computed.text[1]),e.lineJoin="miter"),e.fillText(r.note,r.computed.text[0],r.computed.text[1]))}),e.restore())};const a7=11102230246251565e-32,J2=134217729,bt1=(3+8*a7)*a7;function yi(e,t,C,n,r){let i,o,a,s,l=t[0],c=n[0],u=0,d=0;c>l==c>-l?(i=l,l=t[++u]):(i=c,c=n[++d]);let f=0;if(u<e&&d<C)for(c>l==c>-l?(o=l+i,a=i-(o-l),l=t[++u]):(o=c+i,a=i-(o-c),c=n[++d]),i=o,a!==0&&(r[f++]=a);u<e&&d<C;)c>l==c>-l?(o=i+l,s=o-i,a=i-(o-s)+(l-s),l=t[++u]):(o=i+c,s=o-i,a=i-(o-s)+(c-s),c=n[++d]),i=o,a!==0&&(r[f++]=a);for(;u<e;)o=i+l,s=o-i,a=i-(o-s)+(l-s),l=t[++u],i=o,a!==0&&(r[f++]=a);for(;d<C;)o=i+c,s=o-i,a=i-(o-s)+(c-s),c=n[++d],i=o,a!==0&&(r[f++]=a);return(i!==0||f===0)&&(r[f++]=i),f}function yt1(e,t){let C=t[0];for(let n=1;n<e;n++)C+=t[n];return C}function Se(e){return new Float64Array(e)}const xt1=(3+16*a7)*a7,wt1=(2+12*a7)*a7,St1=(9+64*a7)*a7*a7,s9=Se(4),Qv=Se(8),Jv=Se(12),em=Se(16),s4=Se(4);function $t1(e,t,C,n,r,i,o){let a,s,l,c,u,d,f,v,g,h,m,p,x,S,w,M,_,E;const O=e-r,T=C-r,k=t-i,A=n-i;S=O*A,d=J2*O,f=d-(d-O),v=O-f,d=J2*A,g=d-(d-A),h=A-g,w=v*h-(S-f*g-v*g-f*h),M=k*T,d=J2*k,f=d-(d-k),v=k-f,d=J2*T,g=d-(d-T),h=T-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,s9[0]=w-(m+u)+(u-_),p=S+m,u=p-S,x=S-(p-u)+(m-u),m=x-M,u=x-m,s9[1]=x-(m+u)+(u-M),E=p+m,u=E-p,s9[2]=p-(E-u)+(m-u),s9[3]=E;let V=yt1(4,s9),R=wt1*o;if(V>=R||-V>=R||(u=e-O,a=e-(O+u)+(u-r),u=C-T,l=C-(T+u)+(u-r),u=t-k,s=t-(k+u)+(u-i),u=n-A,c=n-(A+u)+(u-i),a===0&&s===0&&l===0&&c===0)||(R=St1*o+bt1*Math.abs(V),V+=O*c+A*a-(k*l+T*s),V>=R||-V>=R))return V;S=a*A,d=J2*a,f=d-(d-a),v=a-f,d=J2*A,g=d-(d-A),h=A-g,w=v*h-(S-f*g-v*g-f*h),M=s*T,d=J2*s,f=d-(d-s),v=s-f,d=J2*T,g=d-(d-T),h=T-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,s4[0]=w-(m+u)+(u-_),p=S+m,u=p-S,x=S-(p-u)+(m-u),m=x-M,u=x-m,s4[1]=x-(m+u)+(u-M),E=p+m,u=E-p,s4[2]=p-(E-u)+(m-u),s4[3]=E;const P=yi(4,s9,4,s4,Qv);S=O*c,d=J2*O,f=d-(d-O),v=O-f,d=J2*c,g=d-(d-c),h=c-g,w=v*h-(S-f*g-v*g-f*h),M=k*l,d=J2*k,f=d-(d-k),v=k-f,d=J2*l,g=d-(d-l),h=l-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,s4[0]=w-(m+u)+(u-_),p=S+m,u=p-S,x=S-(p-u)+(m-u),m=x-M,u=x-m,s4[1]=x-(m+u)+(u-M),E=p+m,u=E-p,s4[2]=p-(E-u)+(m-u),s4[3]=E;const L=yi(P,Qv,4,s4,Jv);S=a*c,d=J2*a,f=d-(d-a),v=a-f,d=J2*c,g=d-(d-c),h=c-g,w=v*h-(S-f*g-v*g-f*h),M=s*l,d=J2*s,f=d-(d-s),v=s-f,d=J2*l,g=d-(d-l),h=l-g,_=v*h-(M-f*g-v*g-f*h),m=w-_,u=w-m,s4[0]=w-(m+u)+(u-_),p=S+m,u=p-S,x=S-(p-u)+(m-u),m=x-M,u=x-m,s4[1]=x-(m+u)+(u-M),E=p+m,u=E-p,s4[2]=p-(E-u)+(m-u),s4[3]=E;const H=yi(L,Jv,4,s4,em);return em[H-1]}function it(e,t,C,n,r,i){const o=(t-i)*(C-r),a=(e-r)*(n-i),s=o-a,l=Math.abs(o+a);return Math.abs(s)>=xt1*l?s:-$t1(e,t,C,n,r,i,l)}const tm=Math.pow(2,-52),ot=new Uint32Array(512);class gC{static from(t,C=Vt1,n=Tt1){const r=t.length,i=new Float64Array(r*2);for(let o=0;o<r;o++){const a=t[o];i[2*o]=C(a),i[2*o+1]=n(a)}return new gC(i)}constructor(t){const C=t.length>>1;if(C>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*C-5,0);this._triangles=new Uint32Array(n*3),this._halfedges=new Int32Array(n*3),this._hashSize=Math.ceil(Math.sqrt(C)),this._hullPrev=new Uint32Array(C),this._hullNext=new Uint32Array(C),this._hullTri=new Uint32Array(C),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(C),this._dists=new Float64Array(C),this.update()}update(){const{coords:t,_hullPrev:C,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,s=1/0,l=-1/0,c=-1/0;for(let O=0;O<o;O++){const T=t[2*O],k=t[2*O+1];T<a&&(a=T),k<s&&(s=k),T>l&&(l=T),k>c&&(c=k),this._ids[O]=O}const u=(a+l)/2,d=(s+c)/2;let f,v,g;for(let O=0,T=1/0;O<o;O++){const k=xi(u,d,t[2*O],t[2*O+1]);k<T&&(f=O,T=k)}const h=t[2*f],m=t[2*f+1];for(let O=0,T=1/0;O<o;O++){if(O===f)continue;const k=xi(h,m,t[2*O],t[2*O+1]);k<T&&k>0&&(v=O,T=k)}let p=t[2*v],x=t[2*v+1],S=1/0;for(let O=0;O<o;O++){if(O===f||O===v)continue;const T=_t1(h,m,p,x,t[2*O],t[2*O+1]);T<S&&(g=O,S=T)}let w=t[2*g],M=t[2*g+1];if(S===1/0){for(let k=0;k<o;k++)this._dists[k]=t[2*k]-t[0]||t[2*k+1]-t[1];p9(this._ids,this._dists,0,o-1);const O=new Uint32Array(o);let T=0;for(let k=0,A=-1/0;k<o;k++){const V=this._ids[k],R=this._dists[V];R>A&&(O[T++]=V,A=R)}this.hull=O.subarray(0,T),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(it(h,m,p,x,w,M)<0){const O=v,T=p,k=x;v=g,p=w,x=M,g=O,w=T,M=k}const _=Ot1(h,m,p,x,w,M);this._cx=_.x,this._cy=_.y;for(let O=0;O<o;O++)this._dists[O]=xi(t[2*O],t[2*O+1],_.x,_.y);p9(this._ids,this._dists,0,o-1),this._hullStart=f;let E=3;n[f]=C[g]=v,n[v]=C[f]=g,n[g]=C[v]=f,r[f]=0,r[v]=1,r[g]=2,i.fill(-1),i[this._hashKey(h,m)]=f,i[this._hashKey(p,x)]=v,i[this._hashKey(w,M)]=g,this.trianglesLen=0,this._addTriangle(f,v,g,-1,-1,-1);for(let O=0,T,k;O<this._ids.length;O++){const A=this._ids[O],V=t[2*A],R=t[2*A+1];if(O>0&&Math.abs(V-T)<=tm&&Math.abs(R-k)<=tm||(T=V,k=R,A===f||A===v||A===g))continue;let P=0;for(let N=0,z=this._hashKey(V,R);N<this._hashSize&&(P=i[(z+N)%this._hashSize],!(P!==-1&&P!==n[P]));N++);P=C[P];let L=P,H;for(;H=n[L],it(V,R,t[2*L],t[2*L+1],t[2*H],t[2*H+1])>=0;)if(L=H,L===P){L=-1;break}if(L===-1)continue;let I=this._addTriangle(L,A,n[L],-1,-1,r[L]);r[A]=this._legalize(I+2),r[L]=I,E++;let j=n[L];for(;H=n[j],it(V,R,t[2*j],t[2*j+1],t[2*H],t[2*H+1])<0;)I=this._addTriangle(j,A,H,r[A],-1,r[j]),r[A]=this._legalize(I+2),n[j]=j,E--,j=H;if(L===P)for(;H=C[L],it(V,R,t[2*H],t[2*H+1],t[2*L],t[2*L+1])<0;)I=this._addTriangle(H,A,L,-1,r[L],r[H]),this._legalize(I+2),r[H]=I,n[L]=L,E--,L=H;this._hullStart=C[A]=L,n[L]=C[j]=A,n[A]=j,i[this._hashKey(V,R)]=A,i[this._hashKey(t[2*L],t[2*L+1])]=L}this.hull=new Uint32Array(E);for(let O=0,T=this._hullStart;O<E;O++)this.hull[O]=T,T=n[T];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,C){return Math.floor(Mt1(t-this._cx,C-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:C,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,a===-1){if(i===0)break;t=ot[--i];continue}const l=a-a%3,c=s+(t+1)%3,u=l+(a+2)%3,d=C[o],f=C[t],v=C[c],g=C[u];if(Et1(r[2*d],r[2*d+1],r[2*f],r[2*f+1],r[2*v],r[2*v+1],r[2*g],r[2*g+1])){C[t]=g,C[a]=d;const m=n[u];if(m===-1){let x=this._hullStart;do{if(this._hullTri[x]===u){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,m),this._link(a,n[o]),this._link(o,u);const p=l+(a+1)%3;i<ot.length&&(ot[i++]=p)}else{if(i===0)break;t=ot[--i]}}return o}_link(t,C){this._halfedges[t]=C,C!==-1&&(this._halfedges[C]=t)}_addTriangle(t,C,n,r,i,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=C,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}function Mt1(e,t){const C=e/(Math.abs(e)+Math.abs(t));return(t>0?3-C:1+C)/4}function xi(e,t,C,n){const r=e-C,i=t-n;return r*r+i*i}function Et1(e,t,C,n,r,i,o,a){const s=e-o,l=t-a,c=C-o,u=n-a,d=r-o,f=i-a,v=s*s+l*l,g=c*c+u*u,h=d*d+f*f;return s*(u*h-g*f)-l*(c*h-g*d)+v*(c*f-u*d)<0}function _t1(e,t,C,n,r,i){const o=C-e,a=n-t,s=r-e,l=i-t,c=o*o+a*a,u=s*s+l*l,d=.5/(o*l-a*s),f=(l*c-a*u)*d,v=(o*u-s*c)*d;return f*f+v*v}function Ot1(e,t,C,n,r,i){const o=C-e,a=n-t,s=r-e,l=i-t,c=o*o+a*a,u=s*s+l*l,d=.5/(o*l-a*s),f=e+(l*c-a*u)*d,v=t+(o*u-s*c)*d;return{x:f,y:v}}function p9(e,t,C,n){if(n-C<=20)for(let r=C+1;r<=n;r++){const i=e[r],o=t[i];let a=r-1;for(;a>=C&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=i}else{const r=C+n>>1;let i=C+1,o=n;W6(e,r,i),t[e[C]]>t[e[n]]&&W6(e,C,n),t[e[i]]>t[e[n]]&&W6(e,i,n),t[e[C]]>t[e[i]]&&W6(e,C,i);const a=e[i],s=t[a];for(;;){do i++;while(t[e[i]]<s);do o--;while(t[e[o]]>s);if(o<i)break;W6(e,i,o)}e[C+1]=e[o],e[o]=a,n-i+1>=o-C?(p9(e,t,i,n),p9(e,t,C,o-1)):(p9(e,t,C,o-1),p9(e,t,i,n))}}function W6(e,t,C){const n=e[t];e[t]=e[C],e[C]=n}function Vt1(e){return e[0]}function Tt1(e){return e[1]}const Cm=1e-6;class s8{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,C){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+C}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,C){this._+=`L${this._x1=+t},${this._y1=+C}`}arc(t,C,n){t=+t,C=+C,n=+n;const r=t+n,i=C;if(n<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Cm||Math.abs(this._y1-i)>Cm)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${C}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,C,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+C}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Ra{constructor(){this._=[]}moveTo(t,C){this._.push([t,C])}closePath(){this._.push(this._[0].slice())}lineTo(t,C){this._.push([t,C])}value(){return this._.length?this._:null}}class Rt1{constructor(t,[C,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(C=+C))||!((i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=C,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:C,triangles:n},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let g=0,h=0,m=n.length,p,x;g<m;g+=3,h+=2){const S=n[g]*2,w=n[g+1]*2,M=n[g+2]*2,_=t[S],E=t[S+1],O=t[w],T=t[w+1],k=t[M],A=t[M+1],V=O-_,R=T-E,P=k-_,L=A-E,H=(V*L-R*P)*2;if(Math.abs(H)<1e-9){if(i===void 0){i=o=0;for(const j of C)i+=t[j*2],o+=t[j*2+1];i/=C.length,o/=C.length}const I=1e9*Math.sign((i-_)*L-(o-E)*P);p=(_+k)/2-I*L,x=(E+A)/2+I*P}else{const I=1/H,j=V*V+R*R,N=P*P+L*L;p=_+(L*j-R*N)*I,x=E+(V*N-P*j)*I}a[h]=p,a[h+1]=x}let s=C[C.length-1],l,c=s*4,u,d=t[2*s],f,v=t[2*s+1];r.fill(0);for(let g=0;g<C.length;++g)s=C[g],l=c,u=d,f=v,c=s*4,d=t[2*s],v=t[2*s+1],r[l+2]=r[c]=f-v,r[l+3]=r[c+1]=d-u}render(t){const C=t==null?t=new s8:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:o,vectors:a}=this;if(i.length<=1)return null;for(let c=0,u=n.length;c<u;++c){const d=n[c];if(d<c)continue;const f=Math.floor(c/3)*2,v=Math.floor(d/3)*2,g=o[f],h=o[f+1],m=o[v],p=o[v+1];this._renderSegment(g,h,m,p,t)}let s,l=i[i.length-1];for(let c=0;c<i.length;++c){s=l,l=i[c];const u=Math.floor(r[l]/3)*2,d=o[u],f=o[u+1],v=s*4,g=this._project(d,f,a[v+2],a[v+3]);g&&this._renderSegment(d,f,g[0],g[1],t)}return C&&C.value()}renderBounds(t){const C=t==null?t=new s8:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),C&&C.value()}renderCell(t,C){const n=C==null?C=new s8:void 0,r=this._clip(t);if(r===null||!r.length)return;C.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let o=2;o<i;o+=2)(r[o]!==r[o-2]||r[o+1]!==r[o-1])&&C.lineTo(r[o],r[o+1]);return C.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let C=0,n=t.length/2;C<n;++C){const r=this.cellPolygon(C);r&&(r.index=C,yield r)}}cellPolygon(t){const C=new Ra;return this.renderCell(t,C),C.value()}_renderSegment(t,C,n,r,i){let o;const a=this._regioncode(t,C),s=this._regioncode(n,r);a===0&&s===0?(i.moveTo(t,C),i.lineTo(n,r)):(o=this._clipSegment(t,C,n,r,a,s))&&(i.moveTo(o[0],o[1]),i.lineTo(o[2],o[3]))}contains(t,C,n){return C=+C,C!==C||(n=+n,n!==n)?!1:this.delaunay._step(t,C,n)===t}*neighbors(t){const C=this._clip(t);if(C)for(const n of this.delaunay.neighbors(t)){const r=this._clip(n);if(r){e:for(let i=0,o=C.length;i<o;i+=2)for(let a=0,s=r.length;a<s;a+=2)if(C[i]===r[a]&&C[i+1]===r[a+1]&&C[(i+2)%o]===r[(a+s-2)%s]&&C[(i+3)%o]===r[(a+s-1)%s]){yield n;break e}}}}_cell(t){const{circumcenters:C,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,o=n[t];if(o===-1)return null;const a=[];let s=o;do{const l=Math.floor(s/3);if(a.push(C[l*2],C[l*2+1]),s=s%3===2?s-2:s+1,i[s]!==t)break;s=r[s]}while(s!==o&&s!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const C=this._cell(t);if(C===null)return null;const{vectors:n}=this,r=t*4;return this._simplify(n[r]||n[r+1]?this._clipInfinite(t,C,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,C))}_clipFinite(t,C){const n=C.length;let r=null,i,o,a=C[n-2],s=C[n-1],l,c=this._regioncode(a,s),u,d=0;for(let f=0;f<n;f+=2)if(i=a,o=s,a=C[f],s=C[f+1],l=c,c=this._regioncode(a,s),l===0&&c===0)u=d,d=0,r?r.push(a,s):r=[a,s];else{let v,g,h,m,p;if(l===0){if((v=this._clipSegment(i,o,a,s,l,c))===null)continue;[g,h,m,p]=v}else{if((v=this._clipSegment(a,s,i,o,c,l))===null)continue;[m,p,g,h]=v,u=d,d=this._edgecode(g,h),u&&d&&this._edge(t,u,d,r,r.length),r?r.push(g,h):r=[g,h]}u=d,d=this._edgecode(m,p),u&&d&&this._edge(t,u,d,r,r.length),r?r.push(m,p):r=[m,p]}if(r)u=d,d=this._edgecode(r[0],r[1]),u&&d&&this._edge(t,u,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,C,n,r,i,o){const a=i<o;for(a&&([t,C,n,r,i,o]=[n,r,t,C,o,i]);;){if(i===0&&o===0)return a?[n,r,t,C]:[t,C,n,r];if(i&o)return null;let s,l,c=i||o;c&8?(s=t+(n-t)*(this.ymax-C)/(r-C),l=this.ymax):c&4?(s=t+(n-t)*(this.ymin-C)/(r-C),l=this.ymin):c&2?(l=C+(r-C)*(this.xmax-t)/(n-t),s=this.xmax):(l=C+(r-C)*(this.xmin-t)/(n-t),s=this.xmin),i?(t=s,C=l,i=this._regioncode(t,C)):(n=s,r=l,o=this._regioncode(n,r))}}_clipInfinite(t,C,n,r,i,o){let a=Array.from(C),s;if((s=this._project(a[0],a[1],n,r))&&a.unshift(s[0],s[1]),(s=this._project(a[a.length-2],a[a.length-1],i,o))&&a.push(s[0],s[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,u,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)u=d,d=this._edgecode(a[l],a[l+1]),u&&d&&(l=this._edge(t,u,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,C,n,r,i){for(;C!==n;){let o,a;switch(C){case 5:C=4;continue;case 4:C=6,o=this.xmax,a=this.ymin;break;case 6:C=2;continue;case 2:C=10,o=this.xmax,a=this.ymax;break;case 10:C=8;continue;case 8:C=9,o=this.xmin,a=this.ymax;break;case 9:C=1;continue;case 1:C=5,o=this.xmin,a=this.ymin;break}(r[i]!==o||r[i+1]!==a)&&this.contains(t,o,a)&&(r.splice(i,0,o,a),i+=2)}return i}_project(t,C,n,r){let i=1/0,o,a,s;if(r<0){if(C<=this.ymin)return null;(o=(this.ymin-C)/r)<i&&(s=this.ymin,a=t+(i=o)*n)}else if(r>0){if(C>=this.ymax)return null;(o=(this.ymax-C)/r)<i&&(s=this.ymax,a=t+(i=o)*n)}if(n>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/n)<i&&(a=this.xmax,s=C+(i=o)*r)}else if(n<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/n)<i&&(a=this.xmin,s=C+(i=o)*r)}return[a,s]}_edgecode(t,C){return(t===this.xmin?1:t===this.xmax?2:0)|(C===this.ymin?4:C===this.ymax?8:0)}_regioncode(t,C){return(t<this.xmin?1:t>this.xmax?2:0)|(C<this.ymin?4:C>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let C=0;C<t.length;C+=2){const n=(C+2)%t.length,r=(C+4)%t.length;(t[C]===t[n]&&t[n]===t[r]||t[C+1]===t[n+1]&&t[n+1]===t[r+1])&&(t.splice(n,2),C-=2)}t.length||(t=null)}return t}}const Ht1=2*Math.PI,l9=Math.pow;function kt1(e){return e[0]}function Lt1(e){return e[1]}function Pt1(e){const{triangles:t,coords:C}=e;for(let n=0;n<t.length;n+=3){const r=2*t[n],i=2*t[n+1],o=2*t[n+2];if((C[o]-C[r])*(C[i+1]-C[r+1])-(C[i]-C[r])*(C[o+1]-C[r+1])>1e-10)return!1}return!0}function jt1(e,t,C){return[e+Math.sin(e+t)*C,t+Math.cos(e-t)*C]}class bu{static from(t,C=kt1,n=Lt1,r){return new bu("length"in t?It1(t,C,n,r):Float64Array.from(At1(t,C,n,r)))}constructor(t){this._delaunator=new gC(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,C=this.points;if(t.hull&&t.hull.length>2&&Pt1(t)){this.collinear=Int32Array.from({length:C.length/2},(d,f)=>f).sort((d,f)=>C[2*d]-C[2*f]||C[2*d+1]-C[2*f+1]);const s=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[C[2*s],C[2*s+1],C[2*l],C[2*l+1]],u=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,f=C.length/2;d<f;++d){const v=jt1(C[2*d],C[2*d+1],u);C[2*d]=v[0],C[2*d+1]=v[1]}this._delaunator=new gC(C)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let s=0,l=n.length;s<l;++s){const c=i[s%3===2?s-2:s+1];(n[s]===-1||o[c]===-1)&&(o[c]=s)}for(let s=0,l=r.length;s<l;++s)a[r[s]]=s;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Rt1(this,t)}*neighbors(t){const{inedges:C,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const u=a.indexOf(t);u>0&&(yield a[u-1]),u<a.length-1&&(yield a[u+1]);return}const s=C[t];if(s===-1)return;let l=s,c=-1;do{if(yield c=o[l],l=l%3===2?l-2:l+1,o[l]!==t)return;if(l=i[l],l===-1){const u=n[(r[t]+1)%n.length];u!==c&&(yield u);return}}while(l!==s)}find(t,C,n=0){if(t=+t,t!==t||(C=+C,C!==C))return-1;const r=n;let i;for(;(i=this._step(n,t,C))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,C,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,u=l9(C-l[t*2],2)+l9(n-l[t*2+1],2);const d=r[t];let f=d;do{let v=s[f];const g=l9(C-l[v*2],2)+l9(n-l[v*2+1],2);if(g<u&&(u=g,c=v),f=f%3===2?f-2:f+1,s[f]!==t)break;if(f=a[f],f===-1){if(f=i[(o[t]+1)%i.length],f!==v&&l9(C-l[f*2],2)+l9(n-l[f*2+1],2)<u)return f;break}}while(f!==d);return c}render(t){const C=t==null?t=new s8:void 0,{points:n,halfedges:r,triangles:i}=this;for(let o=0,a=r.length;o<a;++o){const s=r[o];if(s<o)continue;const l=i[o]*2,c=i[s]*2;t.moveTo(n[l],n[l+1]),t.lineTo(n[c],n[c+1])}return this.renderHull(t),C&&C.value()}renderPoints(t,C){C===void 0&&(!t||typeof t.moveTo!="function")&&(C=t,t=null),C=C==null?2:+C;const n=t==null?t=new s8:void 0,{points:r}=this;for(let i=0,o=r.length;i<o;i+=2){const a=r[i],s=r[i+1];t.moveTo(a+C,s),t.arc(a,s,C,0,Ht1)}return n&&n.value()}renderHull(t){const C=t==null?t=new s8:void 0,{hull:n,points:r}=this,i=n[0]*2,o=n.length;t.moveTo(r[i],r[i+1]);for(let a=1;a<o;++a){const s=2*n[a];t.lineTo(r[s],r[s+1])}return t.closePath(),C&&C.value()}hullPolygon(){const t=new Ra;return this.renderHull(t),t.value()}renderTriangle(t,C){const n=C==null?C=new s8:void 0,{points:r,triangles:i}=this,o=i[t*=3]*2,a=i[t+1]*2,s=i[t+2]*2;return C.moveTo(r[o],r[o+1]),C.lineTo(r[a],r[a+1]),C.lineTo(r[s],r[s+1]),C.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let C=0,n=t.length/3;C<n;++C)yield this.trianglePolygon(C)}trianglePolygon(t){const C=new Ra;return this.renderTriangle(t,C),C.value()}}function It1(e,t,C,n){const r=e.length,i=new Float64Array(r*2);for(let o=0;o<r;++o){const a=e[o];i[o*2]=t.call(n,a,o,e),i[o*2+1]=C.call(n,a,o,e)}return i}function*At1(e,t,C,n){let r=0;for(const i of e)yield t.call(n,i,r,e),yield C.call(n,i,r,e),++r}var yu=function(e){return[e.x,e.y]},$e=jS,L$="cursor",P$="top",Nt1=function(e){var t=e.points,C=e.getNodePosition,n=C===void 0?yu:C,r=e.margin,i=r===void 0?$e:r;return t.map(function(o){var a=n(o),s=a[0],l=a[1];return[s+i.left,l+i.top]})},Dt1=function(e){var t=e.points,C=e.width,n=e.height,r=e.margin,i=r===void 0?$e:r,o=e.debug,a=bu.from(t),s=o?a.voronoi([0,0,i.left+C+i.right,i.top+n+i.bottom]):void 0;return{points:t,delaunay:a,voronoi:s}},xu=function(e){var t=e.points,C=e.getNodePosition,n=C===void 0?yu:C,r=e.width,i=e.height,o=e.margin,a=o===void 0?$e:o,s=e.debug;return $.useMemo(function(){return Dt1({points:Nt1({points:t,margin:a,getNodePosition:n}),width:r,height:i,margin:a,debug:s})},[t,r,i,a,s])},Ft1=function(e){var t=e.elementRef,C=e.nodes,n=e.getNodePosition,r=n===void 0?yu:n,i=e.delaunay,o=e.setCurrent,a=e.margin,s=a===void 0?$e:a,l=e.detectionRadius,c=l===void 0?1/0:l,u=e.isInteractive,d=u===void 0||u,f=e.onMouseEnter,v=e.onMouseMove,g=e.onMouseLeave,h=e.onClick,m=e.onTouchStart,p=e.onTouchMove,x=e.onTouchEnd,S=e.enableTouchCrosshair,w=S!==void 0&&S,M=e.tooltip,_=e.tooltipPosition,E=_===void 0?L$:_,O=e.tooltipAnchor,T=O===void 0?P$:O,k=$.useState(null),A=k[0],V=k[1],R=$.useRef(null);$.useEffect(function(){R.current=A},[R,A]);var P=$.useCallback(function(J){if(!t.current)return null;var W=hu(t.current,J),U=W[0],Z=W[1],D=i.find(U,Z),n1=D!==void 0?C[D]:null;if(n1&&c!==1/0){var B=r(n1),r1=B[0],i1=B[1];C31(U,Z,r1+s.left,i1+s.top)>c&&(D=null,n1=null)}return D===null||n1===null?null:[D,n1]},[t,i,C,r,s,c]),L=s3(),H=L.showTooltipAt,I=L.showTooltipFromEvent,j=L.hideTooltip,N=$.useMemo(function(){if(M)return E==="cursor"?function(J,W){I(M(J),W,T)}:function(J){var W=r(J),U=W[0],Z=W[1];H(M(J),[U+s.left,Z+s.top],T)}},[H,I,M,E,T,r,s]),z=$.useCallback(function(J){var W=P(J);if(V(W),o==null||o(W?W[1]:null),W){var U=W[1];N==null||N(U,J),f==null||f(W[1],J)}},[P,V,o,N,f]),q=$.useCallback(function(J){var W=P(J);if(V(W),W){var U=W[0],Z=W[1];if(o==null||o(Z),N==null||N(Z,J),R.current){var D=R.current,n1=D[0],B=D[1];U!==n1?g==null||g(B,J):v==null||v(Z,J)}else f==null||f(Z,J)}else o==null||o(null),j==null||j(),R.current&&(g==null||g(R.current[1],J))},[P,V,R,f,v,g,N,j]),G=$.useCallback(function(J){V(null),o==null||o(null),j(),g&&R.current&&g(R.current[1],J)},[V,o,R,j,g]),Y=$.useCallback(function(J){var W=P(J);V(W),W&&(h==null||h(W[1],J))},[P,V,h]),e1=$.useCallback(function(J){var W=P(J);w&&(V(W),o==null||o(W?W[1]:null)),W&&(m==null||m(W[1],J))},[P,V,o,w,m]),Q=$.useCallback(function(J){var W=P(J);w&&(V(W),o==null||o(W?W[1]:null)),W&&(p==null||p(W[1],J))},[P,V,o,w,p]),K=$.useCallback(function(J){w&&(V(null),o==null||o(null)),x&&R.current&&x(R.current[1],J)},[w,V,o,x,R]);return{current:A,handleMouseEnter:d?z:void 0,handleMouseMove:d?q:void 0,handleMouseLeave:d?G:void 0,handleClick:d?Y:void 0,handleTouchStart:d?e1:void 0,handleTouchMove:d?Q:void 0,handleTouchEnd:d?K:void 0}},j$=function(e){var t=e.nodes,C=e.width,n=e.height,r=e.margin,i=r===void 0?$e:r,o=e.getNodePosition,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd,g=e.enableTouchCrosshair,h=g!==void 0&&g,m=e.detectionRadius,p=m===void 0?1/0:m,x=e.tooltip,S=e.tooltipPosition,w=S===void 0?L$:S,M=e.tooltipAnchor,_=M===void 0?P$:M,E=e.debug,O=$.useRef(null),T=xu({points:t,getNodePosition:o,width:C,height:n,margin:i,debug:E}),k=T.delaunay,A=T.voronoi,V=Ft1({elementRef:O,nodes:t,delaunay:k,margin:i,detectionRadius:p,setCurrent:a,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onClick:u,onTouchStart:d,onTouchMove:f,onTouchEnd:v,enableTouchCrosshair:h,tooltip:x,tooltipPosition:w,tooltipAnchor:_}),R=V.current,P=V.handleMouseEnter,L=V.handleMouseMove,H=V.handleMouseLeave,I=V.handleClick,j=V.handleTouchStart,N=V.handleTouchMove,z=V.handleTouchEnd,q=$.useMemo(function(){if(E&&A)return A.render()},[E,A]);return b.jsxs("g",{ref:O,transform:"translate("+-i.left+","+-i.top+")",children:[E&&A&&b.jsxs(b.Fragment,{children:[b.jsx("path",{d:q,stroke:"red",strokeWidth:1,opacity:.75}),p<1/0&&b.jsx("path",{stroke:"red",strokeWidth:.35,fill:"none",d:k.renderPoints(void 0,p)}),R&&b.jsx("path",{fill:"pink",opacity:.35,d:A.renderCell(R[0])})]}),b.jsx("rect",{"data-ref":"mesh-interceptor",width:i.left+C+i.right,height:i.top+n+i.bottom,fill:"red",opacity:0,style:{cursor:"auto"},onMouseEnter:P,onMouseMove:L,onMouseLeave:H,onTouchStart:j,onTouchMove:N,onTouchEnd:z,onClick:I})]})},I$=function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()},A$=function(e,t,C){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(C,e),e.fillStyle="pink",e.fill(),e.restore()};function O4(){return O4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},O4.apply(this,arguments)}function N$(e,t){if(e==null)return{};var C,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)C=i[n],t.indexOf(C)>=0||(r[C]=e[C]);return r}var zt1=function(e){if(typeof e=="function")return e;if(M8(e))return function(){return e};if(function(C){return B7(C)}(e)){if(!vn(e.key))throw new Error("symbolSize is invalid, key should be a string pointing to the property to use to determine node size");if(!Array.isArray(e.values)||e.values.length!==2)throw new Error("symbolSize is invalid, values spec should be an array containing two values, min and max");if(!Array.isArray(e.sizes)||e.sizes.length!==2)throw new Error("symbolSize is invalid, sizes spec should be an array containing two values, min and max");var t=P8().domain([e.values[0],e.values[1]]).range([e.sizes[0],e.sizes[1]]);return function(C){return t(v2(C,e.key))}}throw new Error("nodeSize is invalid, it should be either a function, a number or an object")},D$=function(e){var t,C=e.data,n=e.xScaleSpec,r=e.xFormat,i=e.yScaleSpec,o=e.yFormat,a=e.width,s=e.height,l=e.nodeId,c=e.nodeSize,u=e.colors,d=$.useMemo(function(){return w$(C,n,i,a,s)},[C,n,i,a,s]),f=d.series,v=d.xScale,g=d.yScale,h=L7(r),m=L7(o),p=m3(l),x=$.useMemo(function(){return function(M){var _=M.series,E=M.formatX,O=M.formatY,T=M.getNodeId,k=[];return _.forEach(function(A){A.data.forEach(function(V,R){var P={index:k.length,serieIndex:R,serieId:A.id,x:V.position.x,xValue:V.data.x,formattedX:E(V.data.x),y:V.position.y,yValue:V.data.y,formattedY:O(V.data.y),data:V.data};k.push(O4({},P,{id:T(P)}))})}),k}({series:f,formatX:h,formatY:m,getNodeId:p})},[f,h,m,p]),S=$.useMemo(function(){return zt1(t)},[t=c]),w=ye(u,"serieId");return{xScale:v,yScale:g,nodes:$.useMemo(function(){return x.map(function(M){return O4({},M,{size:S(M),color:w({serieId:M.serieId})})})},[x,S,w]),legendData:$.useMemo(function(){return f.map(function(M){return{id:M.id,label:M.id,color:w({serieId:M.id})}})},[f,w])}},F$=function(e,t){return ut1({data:e,annotations:t,getPosition:function(C){return{x:C.x,y:C.y}},getDimensions:function(C){return{size:C.size,width:C.size,height:C.size}}})},Bt1=function(e){return e/2},z$={xScale:{type:"linear",min:0,max:"auto"},yScale:{type:"linear",min:0,max:"auto"},enableGridX:!0,enableGridY:!0,axisBottom:{},axisLeft:{},nodeId:function(e){return e.serieId+"."+e.index},nodeSize:9,nodeComponent:function(e){var t=e.node,C=e.style,n=e.blendMode,r=e.isInteractive,i=e.onMouseEnter,o=e.onMouseMove,a=e.onMouseLeave,s=e.onClick,l=$.useCallback(function(f){return i==null?void 0:i(t,f)},[t,i]),c=$.useCallback(function(f){return o==null?void 0:o(t,f)},[t,o]),u=$.useCallback(function(f){return a==null?void 0:a(t,f)},[t,a]),d=$.useCallback(function(f){return s==null?void 0:s(t,f)},[t,s]);return b.jsx(e5.circle,{cx:C.x,cy:C.y,r:C.size.to(Bt1),fill:C.color,style:{mixBlendMode:n},onMouseEnter:r?l:void 0,onMouseMove:r?c:void 0,onMouseLeave:r?u:void 0,onClick:r?d:void 0})},colors:{scheme:"nivo"},isInteractive:!0,debugMesh:!1,tooltip:function(e){var t=e.node;return b.jsx(L9,{id:t.serieId,value:"x: "+t.formattedX+", y: "+t.formattedY,enableChip:!0,color:t.color})},markers:[],legends:[],annotations:[]},h2=O4({},z$,{blendMode:"normal",layers:["grid","axes","nodes","markers","mesh","legends","annotations"],role:"img",useMesh:!0,animate:!0,motionConfig:"default"}),e4=O4({},z$,{layers:["grid","axes","nodes","mesh","legends","annotations"],pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,renderNode:function(e,t){e.beginPath(),e.arc(t.x,t.y,t.size/2,0,2*Math.PI),e.fillStyle=t.color,e.fill()}}),Wt1=function(e){var t=e.nodes,C=e.annotations,n=F$(t,C);return b.jsx(b.Fragment,{children:n.map(function(r,i){return b.jsx(mt1,O4({},r),i)})})},Ut1=function(e){return e.id},wi=function(e){return{x:e.x,y:e.y,size:e.size,color:e.color}},Zt1=function(e){return{x:e.x,y:e.y,size:0,color:e.color}},qt1=function(e){var t=e.nodes,C=e.nodeComponent,n=e.isInteractive,r=e.onMouseEnter,i=e.onMouseMove,o=e.onMouseLeave,a=e.onClick,s=e.tooltip,l=e.blendMode,c=A2(),u=c.animate,d=c.config,f=p4(t,{keys:Ut1,from:wi,enter:wi,update:wi,leave:Zt1,config:d,immediate:!u}),v=s3(),g=v.showTooltipFromEvent,h=v.hideTooltip,m=$.useCallback(function(w,M){g($.createElement(s,{node:w}),M),r==null||r(w,M)},[s,g,r]),p=$.useCallback(function(w,M){g($.createElement(s,{node:w}),M),i==null||i(w,M)},[s,g,i]),x=$.useCallback(function(w,M){h(),o==null||o(w,M)},[h,o]),S=$.useCallback(function(w,M){return a==null?void 0:a(w,M)},[a]);return b.jsx(b.Fragment,{children:f(function(w,M){return $.createElement(C,{node:M,style:w,blendMode:l,isInteractive:n,onMouseEnter:n?m:void 0,onMouseMove:n?p:void 0,onMouseLeave:n?x:void 0,onClick:n?S:void 0})})})},Gt1=function(e){var t=e.nodes,C=e.width,n=e.height,r=e.onMouseEnter,i=e.onMouseMove,o=e.onMouseLeave,a=e.onClick,s=e.tooltip,l=e.debug,c=s3(),u=c.showTooltipFromEvent,d=c.hideTooltip,f=$.useCallback(function(m,p){u($.createElement(s,{node:m}),p),r&&r(m,p)},[u,s,r]),v=$.useCallback(function(m,p){u($.createElement(s,{node:m}),p),i&&i(m,p)},[u,s,i]),g=$.useCallback(function(m,p){d(),o&&o(m,p)},[d,o]),h=$.useCallback(function(m,p){a&&a(m,p)},[a]);return b.jsx(j$,{nodes:t,width:C,height:n,onMouseEnter:f,onMouseMove:v,onMouseLeave:g,onClick:h,debug:l})},Yt1=["isInteractive","animate","motionConfig","theme","renderWrapper"],Kt1=function(e){var t=e.data,C=e.xScale,n=C===void 0?h2.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?h2.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.margin,u=e.layers,d=u===void 0?h2.layers:u,f=e.colors,v=f===void 0?h2.colors:f,g=e.blendMode,h=g===void 0?h2.blendMode:g,m=e.nodeId,p=m===void 0?h2.nodeId:m,x=e.nodeSize,S=x===void 0?h2.nodeSize:x,w=e.nodeComponent,M=w===void 0?h2.nodeComponent:w,_=e.enableGridX,E=_===void 0?h2.enableGridX:_,O=e.enableGridY,T=O===void 0?h2.enableGridY:O,k=e.gridXValues,A=e.gridYValues,V=e.axisTop,R=e.axisRight,P=e.axisBottom,L=P===void 0?h2.axisBottom:P,H=e.axisLeft,I=H===void 0?h2.axisLeft:H,j=e.annotations,N=j===void 0?h2.annotations:j,z=e.isInteractive,q=z===void 0?h2.isInteractive:z,G=e.useMesh,Y=G===void 0?h2.useMesh:G,e1=e.debugMesh,Q=e1===void 0?h2.debugMesh:e1,K=e.onMouseEnter,J=e.onMouseMove,W=e.onMouseLeave,U=e.onClick,Z=e.tooltip,D=Z===void 0?h2.tooltip:Z,n1=e.markers,B=n1===void 0?h2.markers:n1,r1=e.legends,i1=r1===void 0?h2.legends:r1,g1=e.role,y1=g1===void 0?h2.role:g1,m1=e.ariaLabel,b1=e.ariaLabelledBy,S1=e.ariaDescribedBy,v1=z8(s,l,c),h1=v1.margin,l1=v1.innerWidth,$1=v1.innerHeight,f1=v1.outerWidth,A1=v1.outerHeight,I1=D$({data:t,xScaleSpec:n,xFormat:r,yScaleSpec:o,yFormat:a,width:l1,height:$1,nodeId:p,nodeSize:S,colors:v}),R1=I1.xScale,k1=I1.yScale,Y1=I1.nodes,X1=I1.legendData,D1=$.useMemo(function(){return{xScale:R1,yScale:k1,nodes:Y1,margin:h1,innerWidth:l1,innerHeight:$1,outerWidth:f1,outerHeight:A1}},[R1,k1,Y1,h1,l1,$1,f1,A1]),L1={grid:null,axes:null,nodes:null,markers:null,mesh:null,annotations:null,legends:null};return d.includes("grid")&&(L1.grid=b.jsx(R$,{width:l1,height:$1,xScale:E?R1:null,yScale:T?k1:null,xValues:k,yValues:A},"grid")),d.includes("axes")&&(L1.axes=b.jsx(T$,{xScale:R1,yScale:k1,width:l1,height:$1,top:V,right:R,bottom:L,left:I},"axes")),d.includes("nodes")&&(L1.nodes=b.jsx(qt1,{nodes:Y1,nodeComponent:M,isInteractive:q,tooltip:D,blendMode:h,onMouseEnter:K,onMouseMove:J,onMouseLeave:W,onClick:U},"nodes")),d.includes("markers")&&(L1.markers=b.jsx(YS,{markers:B,width:l1,height:$1,xScale:R1,yScale:k1},"markers")),d.includes("mesh")&&q&&Y&&(L1.mesh=b.jsx(Gt1,{nodes:Y1,width:l1,height:$1,onMouseEnter:K,onMouseMove:J,onMouseLeave:W,onClick:U,tooltip:D,debug:Q},"mesh")),d.includes("annotations")&&(L1.annotations=b.jsx(Wt1,{nodes:Y1,annotations:N},"annotations")),d.includes("legends")&&(L1.legends=i1.map(function(Q1,U1){return b.jsx(Tn,O4({},Q1,{containerWidth:l1,containerHeight:$1,data:X1}),U1)})),b.jsx(y6,{width:f1,height:A1,margin:h1,role:y1,ariaLabel:m1,ariaLabelledBy:b1,ariaDescribedBy:S1,children:d.map(function(Q1,U1){if(typeof Q1=="string"&&L1[Q1]!==void 0)return L1[Q1];if(typeof Q1=="function")return b.jsx($.Fragment,{children:$.createElement(Q1,D1)},U1);throw new Error("Unknown layer ("+Q1+")")})})},Xt1=function(e){var t=e.isInteractive,C=t===void 0?h2.isInteractive:t,n=e.animate,r=n===void 0?h2.animate:n,i=e.motionConfig,o=i===void 0?h2.motionConfig:i,a=e.theme,s=e.renderWrapper,l=N$(e,Yt1);return b.jsx(B8,{animate:r,isInteractive:C,motionConfig:o,renderWrapper:s,theme:a,children:b.jsx(Kt1,O4({isInteractive:C},l))})},B$=function(e){return b.jsx(U7,{children:function(t){var C=t.width,n=t.height;return b.jsx(Xt1,O4({width:C,height:n},e))}})},Qt1=["isInteractive","renderWrapper","theme"],Jt1=function(e){var t=e.data,C=e.xScale,n=C===void 0?e4.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?e4.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.margin,u=e.pixelRatio,d=u===void 0?e4.pixelRatio:u,f=e.layers,v=f===void 0?e4.layers:f,g=e.colors,h=g===void 0?e4.colors:g,m=e.nodeId,p=m===void 0?h2.nodeId:m,x=e.nodeSize,S=x===void 0?e4.nodeSize:x,w=e.renderNode,M=w===void 0?e4.renderNode:w,_=e.enableGridX,E=_===void 0?e4.enableGridX:_,O=e.gridXValues,T=e.enableGridY,k=T===void 0?e4.enableGridY:T,A=e.gridYValues,V=e.axisTop,R=e.axisRight,P=e.axisBottom,L=P===void 0?e4.axisBottom:P,H=e.axisLeft,I=H===void 0?e4.axisLeft:H,j=e.annotations,N=j===void 0?e4.annotations:j,z=e.isInteractive,q=z===void 0?e4.isInteractive:z,G=e.debugMesh,Y=G===void 0?e4.debugMesh:G,e1=e.onMouseEnter,Q=e.onMouseMove,K=e.onMouseLeave,J=e.onClick,W=e.tooltip,U=W===void 0?e4.tooltip:W,Z=e.legends,D=Z===void 0?e4.legends:Z,n1=e.canvasRef,B=$.useRef(null),r1=W5(),i1=$.useState(null),g1=i1[0],y1=i1[1],m1=z8(s,l,c),b1=m1.margin,S1=m1.innerWidth,v1=m1.innerHeight,h1=m1.outerWidth,l1=m1.outerHeight,$1=D$({data:t,xScaleSpec:n,xFormat:r,yScaleSpec:o,yFormat:a,width:S1,height:v1,nodeId:p,nodeSize:S,colors:h}),f1=$1.xScale,A1=$1.yScale,I1=$1.nodes,R1=$1.legendData,k1=F$(I1,N),Y1=xu({points:I1,width:S1,height:v1,debug:Y}),X1=Y1.delaunay,D1=Y1.voronoi,L1=$.useMemo(function(){return{xScale:f1,yScale:A1,nodes:I1,margin:b1,innerWidth:S1,innerHeight:v1,outerWidth:h1,outerHeight:l1}},[f1,A1,I1,b1,S1,v1,h1,l1]);$.useEffect(function(){if(B.current){B.current.width=h1*d,B.current.height=l1*d;var N1=B.current.getContext("2d");N1.scale(d,d),N1.fillStyle=r1.background,N1.fillRect(0,0,h1,l1),N1.translate(b1.left,b1.top),v.forEach(function(z1){if(z1==="grid")N1.lineWidth=r1.grid.line.strokeWidth,N1.strokeStyle=r1.grid.line.stroke,E&&hC(N1,{width:S1,height:v1,scale:f1,axis:"x",values:O}),k&&hC(N1,{width:S1,height:v1,scale:A1,axis:"y",values:A});else if(z1==="annotations")pt1(N1,{annotations:k1,theme:r1});else if(z1==="axes")H$(N1,{xScale:f1,yScale:A1,width:S1,height:v1,top:V,right:R,bottom:L,left:I,theme:r1});else if(z1==="nodes")I1.forEach(function(F1){M(N1,F1)});else if(z1==="mesh")Y&&(I$(N1,D1),g1&&A$(N1,D1,g1.index));else if(z1==="legends")D.forEach(function(F1){n$(N1,O4({},F1,{data:R1,containerWidth:S1,containerHeight:v1,theme:r1}))});else{if(typeof z1!="function")throw new Error("Invalid layer: "+z1);z1(N1,L1)}})}},[B,S1,v1,h1,l1,b1.top,b1.left,d,M,v,L1,r1,f1,A1,I1,E,k,V,R,L,I,D,R1,Y,D1,g1,k1]);var Q1=s3(),U1=Q1.showTooltipFromEvent,q1=Q1.hideTooltip,u1=$.useCallback(function(N1){var z1=hu(B.current,N1),F1=z1[0],J1=z1[1];if(!XS(b1.left,b1.top,S1,v1,F1,J1))return null;var t5=X1.find(F1-b1.left,J1-b1.top);return I1[t5]},[B,b1,S1,v1,X1]),_1=$.useCallback(function(N1){var z1=u1(N1);y1(z1),z1?(U1($.createElement(U,{node:z1}),N1),g1&&g1.id!==z1.id&&(K&&K(g1,N1),e1&&e1(z1,N1)),g1||e1&&e1(z1,N1),Q&&Q(z1,N1)):(q1(),g1&&K&&K(g1,N1))},[u1,g1,y1,U1,q1,U,e1,Q,K]),K1=$.useCallback(function(N1){q1(),y1(null),g1&&K&&K(g1,N1)},[q1,g1,y1,K]),C5=$.useCallback(function(N1){if(J){var z1=u1(N1);z1&&J(z1,N1)}},[u1,J]);return b.jsx("canvas",{ref:function(N1){B.current=N1,n1&&"current"in n1&&(n1.current=N1)},width:h1*d,height:l1*d,style:{width:h1,height:l1,cursor:q?"auto":"normal"},onMouseEnter:q?_1:void 0,onMouseMove:q?_1:void 0,onMouseLeave:q?K1:void 0,onClick:q?C5:void 0})},eC1=$.forwardRef(function(e,t){var C=e.isInteractive,n=e.renderWrapper,r=e.theme,i=N$(e,Qt1);return b.jsx(B8,{isInteractive:C,renderWrapper:n,theme:r,animate:!1,children:b.jsx(Jt1,O4({},i,{canvasRef:t}))})});$.forwardRef(function(e,t){return b.jsx(U7,{children:function(C){var n=C.width,r=C.height;return b.jsx(eC1,O4({width:n,height:r},e,{ref:t}))}})});const tC1=({x1:e,x2:t,y1:C,y2:n})=>b.jsx("g",{children:b.jsx("line",{x1:e,y1:C,x2:t,y2:n,stroke:"red",strokeWidth:"3"})}),CC1=({scatterPlotData:e,style:t={},margin:C={},axisBottom:n={},axisLeft:r={},tooltip:i=null})=>{const o=e==null?void 0:e.line,a=o==null?void 0:o.x1,s=o==null?void 0:o.y1,l=o==null?void 0:o.x2,c=o==null?void 0:o.y2;return b.jsxs(b.Fragment,{children:[b.jsx(O2,{}),b.jsx("div",{style:{width:"100%",height:600,...t},children:b.jsx(B$,{data:[e==null?void 0:e.points],margin:{top:20,right:120,bottom:100,left:120,...C},xScale:{type:"point"},axisBottom:{orient:"bottom",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:46,truncateTickAt:0,legend:"axisBottom",...n},axisLeft:{orient:"left",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:-60,truncateTickAt:0,legend:"axisLeft",...r},layers:["grid","markers","axes","nodes","legends",u=>b.jsx(tC1,{x1:u.xScale(a),y1:u.yScale(s),x2:u.xScale(l),y2:u.yScale(c)})],tooltip:({node:u})=>b.jsx(v4,{body:(i==null?void 0:i({node:u}))||b.jsx("span",{children:"Scatterplot tooltip"})})})})]})};function nC1(e,t,C,n){var r=-1,i=e==null?0:e.length;for(n&&i&&(C=e[++r]);++r<i;)C=t(C,e[r],r,e);return C}var rC1=nC1;function iC1(e){return function(t){return e==null?void 0:e[t]}}var oC1=iC1,aC1=oC1,sC1={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},lC1=aC1(sC1),cC1=lC1,uC1=cC1,dC1=fe,fC1=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,hC1="\\u0300-\\u036f",gC1="\\ufe20-\\ufe2f",vC1="\\u20d0-\\u20ff",mC1=hC1+gC1+vC1,pC1="["+mC1+"]",bC1=RegExp(pC1,"g");function yC1(e){return e=dC1(e),e&&e.replace(fC1,uC1).replace(bC1,"")}var xC1=yC1,wC1=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function SC1(e){return e.match(wC1)||[]}var $C1=SC1,MC1=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function EC1(e){return MC1.test(e)}var _C1=EC1,W$="\\ud800-\\udfff",OC1="\\u0300-\\u036f",VC1="\\ufe20-\\ufe2f",TC1="\\u20d0-\\u20ff",RC1=OC1+VC1+TC1,U$="\\u2700-\\u27bf",Z$="a-z\\xdf-\\xf6\\xf8-\\xff",HC1="\\xac\\xb1\\xd7\\xf7",kC1="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",LC1="\\u2000-\\u206f",PC1=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",q$="A-Z\\xc0-\\xd6\\xd8-\\xde",jC1="\\ufe0e\\ufe0f",G$=HC1+kC1+LC1+PC1,Y$="['’]",nm="["+G$+"]",IC1="["+RC1+"]",K$="\\d+",AC1="["+U$+"]",X$="["+Z$+"]",Q$="[^"+W$+G$+K$+U$+Z$+q$+"]",NC1="\\ud83c[\\udffb-\\udfff]",DC1="(?:"+IC1+"|"+NC1+")",FC1="[^"+W$+"]",J$="(?:\\ud83c[\\udde6-\\uddff]){2}",eM="[\\ud800-\\udbff][\\udc00-\\udfff]",f9="["+q$+"]",zC1="\\u200d",rm="(?:"+X$+"|"+Q$+")",BC1="(?:"+f9+"|"+Q$+")",im="(?:"+Y$+"(?:d|ll|m|re|s|t|ve))?",om="(?:"+Y$+"(?:D|LL|M|RE|S|T|VE))?",tM=DC1+"?",CM="["+jC1+"]?",WC1="(?:"+zC1+"(?:"+[FC1,J$,eM].join("|")+")"+CM+tM+")*",UC1="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ZC1="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qC1=CM+tM+WC1,GC1="(?:"+[AC1,J$,eM].join("|")+")"+qC1,YC1=RegExp([f9+"?"+X$+"+"+im+"(?="+[nm,f9,"$"].join("|")+")",BC1+"+"+om+"(?="+[nm,f9+rm,"$"].join("|")+")",f9+"?"+rm+"+"+im,f9+"+"+om,ZC1,UC1,K$,GC1].join("|"),"g");function KC1(e){return e.match(YC1)||[]}var XC1=KC1,QC1=$C1,JC1=_C1,en1=fe,tn1=XC1;function Cn1(e,t,C){return e=en1(e),t=C?void 0:t,t===void 0?JC1(e)?tn1(e):QC1(e):e.match(t)||[]}var nn1=Cn1,rn1=rC1,in1=xC1,on1=nn1,an1="['’]",sn1=RegExp(an1,"g");function ln1(e){return function(t){return rn1(on1(in1(t).replace(sn1,"")),e,"")}}var cn1=ln1,un1=k$;function dn1(e,t,C){var n=e.length;return C=C===void 0?n:C,!t&&C>=n?e:un1(e,t,C)}var fn1=dn1,hn1="\\ud800-\\udfff",gn1="\\u0300-\\u036f",vn1="\\ufe20-\\ufe2f",mn1="\\u20d0-\\u20ff",pn1=gn1+vn1+mn1,bn1="\\ufe0e\\ufe0f",yn1="\\u200d",xn1=RegExp("["+yn1+hn1+pn1+bn1+"]");function wn1(e){return xn1.test(e)}var nM=wn1;function Sn1(e){return e.split("")}var $n1=Sn1,rM="\\ud800-\\udfff",Mn1="\\u0300-\\u036f",En1="\\ufe20-\\ufe2f",_n1="\\u20d0-\\u20ff",On1=Mn1+En1+_n1,Vn1="\\ufe0e\\ufe0f",Tn1="["+rM+"]",Ha="["+On1+"]",ka="\\ud83c[\\udffb-\\udfff]",Rn1="(?:"+Ha+"|"+ka+")",iM="[^"+rM+"]",oM="(?:\\ud83c[\\udde6-\\uddff]){2}",aM="[\\ud800-\\udbff][\\udc00-\\udfff]",Hn1="\\u200d",sM=Rn1+"?",lM="["+Vn1+"]?",kn1="(?:"+Hn1+"(?:"+[iM,oM,aM].join("|")+")"+lM+sM+")*",Ln1=lM+sM+kn1,Pn1="(?:"+[iM+Ha+"?",Ha,oM,aM,Tn1].join("|")+")",jn1=RegExp(ka+"(?="+ka+")|"+Pn1+Ln1,"g");function In1(e){return e.match(jn1)||[]}var An1=In1,Nn1=$n1,Dn1=nM,Fn1=An1;function zn1(e){return Dn1(e)?Fn1(e):Nn1(e)}var Bn1=zn1,Wn1=fn1,Un1=nM,Zn1=Bn1,qn1=fe;function Gn1(e){return function(t){t=qn1(t);var C=Un1(t)?Zn1(t):void 0,n=C?C[0]:t.charAt(0),r=C?Wn1(C,1).join(""):t.slice(1);return n[e]()+r}}var Yn1=Gn1,Kn1=Yn1,Xn1=Kn1("toUpperCase"),Qn1=Xn1,Jn1=cn1,er1=Qn1,tr1=Jn1(function(e,t,C){return e+(C?" ":"")+er1(t)}),Cr1=tr1;const nr1=p2(Cr1);function rr1(e){var t=0,C=e.children,n=C&&C.length;if(!n)t=1;else for(;--n>=0;)t+=C[n].value;e.value=t}function ir1(){return this.eachAfter(rr1)}function or1(e){var t=this,C,n=[t],r,i,o;do for(C=n.reverse(),n=[];t=C.pop();)if(e(t),r=t.children,r)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length);return this}function ar1(e){for(var t=this,C=[t],n,r;t=C.pop();)if(e(t),n=t.children,n)for(r=n.length-1;r>=0;--r)C.push(n[r]);return this}function sr1(e){for(var t=this,C=[t],n=[],r,i,o;t=C.pop();)if(n.push(t),r=t.children,r)for(i=0,o=r.length;i<o;++i)C.push(r[i]);for(;t=n.pop();)e(t);return this}function lr1(e){return this.eachAfter(function(t){for(var C=+e(t.data)||0,n=t.children,r=n&&n.length;--r>=0;)C+=n[r].value;t.value=C})}function cr1(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function ur1(e){for(var t=this,C=dr1(t,e),n=[t];t!==C;)t=t.parent,n.push(t);for(var r=n.length;e!==C;)n.splice(r,0,e),e=e.parent;return n}function dr1(e,t){if(e===t)return e;var C=e.ancestors(),n=t.ancestors(),r=null;for(e=C.pop(),t=n.pop();e===t;)r=e,e=C.pop(),t=n.pop();return r}function fr1(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function hr1(){var e=[];return this.each(function(t){e.push(t)}),e}function gr1(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function vr1(){var e=this,t=[];return e.each(function(C){C!==e&&t.push({source:C.parent,target:C})}),t}function wu(e,t){var C=new vC(e),n=+e.value&&(C.value=e.value),r,i=[C],o,a,s,l;for(t==null&&(t=pr1);r=i.pop();)if(n&&(r.value=+r.data.value),(a=t(r.data))&&(l=a.length))for(r.children=new Array(l),s=l-1;s>=0;--s)i.push(o=r.children[s]=new vC(a[s])),o.parent=r,o.depth=r.depth+1;return C.eachBefore(yr1)}function mr1(){return wu(this).eachBefore(br1)}function pr1(e){return e.children}function br1(e){e.data=e.data.data}function yr1(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function vC(e){this.data=e,this.depth=this.height=0,this.parent=null}vC.prototype=wu.prototype={constructor:vC,count:ir1,each:or1,eachAfter:sr1,eachBefore:ar1,sum:lr1,sort:cr1,path:ur1,ancestors:fr1,descendants:hr1,leaves:gr1,links:vr1,copy:mr1};function xr1(e){if(typeof e!="function")throw new Error;return e}function U6(){return 0}function Z6(e){return function(){return e}}function wr1(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Su(e,t,C,n,r){for(var i=e.children,o,a=-1,s=i.length,l=e.value&&(n-t)/e.value;++a<s;)o=i[a],o.y0=C,o.y1=r,o.x0=t,o.x1=t+=o.value*l}function $u(e,t,C,n,r){for(var i=e.children,o,a=-1,s=i.length,l=e.value&&(r-C)/e.value;++a<s;)o=i[a],o.x0=t,o.x1=n,o.y0=C,o.y1=C+=o.value*l}var Sr1=(1+Math.sqrt(5))/2;function $r1(e,t,C,n,r,i){for(var o=[],a=t.children,s,l,c=0,u=0,d=a.length,f,v,g=t.value,h,m,p,x,S,w,M;c<d;){f=r-C,v=i-n;do h=a[u++].value;while(!h&&u<d);for(m=p=h,w=Math.max(v/f,f/v)/(g*e),M=h*h*w,S=Math.max(p/M,M/m);u<d;++u){if(h+=l=a[u].value,l<m&&(m=l),l>p&&(p=l),M=h*h*w,x=Math.max(p/M,M/m),x>S){h-=l;break}S=x}o.push(s={value:h,dice:f<v,children:a.slice(c,u)}),s.dice?Su(s,C,n,r,g?n+=v*h/g:i):$u(s,C,n,g?C+=f*h/g:r,i),g-=h,c=u}return o}const cM=function e(t){function C(n,r,i,o,a){$r1(t,n,r,i,o,a)}return C.ratio=function(n){return e((n=+n)>1?n:1)},C}(Sr1);function Mr1(){var e=cM,t=!1,C=1,n=1,r=[0],i=U6,o=U6,a=U6,s=U6,l=U6;function c(d){return d.x0=d.y0=0,d.x1=C,d.y1=n,d.eachBefore(u),r=[0],t&&d.eachBefore(wr1),d}function u(d){var f=r[d.depth],v=d.x0+f,g=d.y0+f,h=d.x1-f,m=d.y1-f;h<v&&(v=h=(v+h)/2),m<g&&(g=m=(g+m)/2),d.x0=v,d.y0=g,d.x1=h,d.y1=m,d.children&&(f=r[d.depth+1]=i(d)/2,v+=l(d)-f,g+=o(d)-f,h-=a(d)-f,m-=s(d)-f,h<v&&(v=h=(v+h)/2),m<g&&(g=m=(g+m)/2),e(d,v,g,h,m))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(C=+d[0],n=+d[1],c):[C,n]},c.tile=function(d){return arguments.length?(e=xr1(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(i=typeof d=="function"?d:Z6(+d),c):i},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(o=typeof d=="function"?d:Z6(+d),c):o},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Z6(+d),c):a},c.paddingBottom=function(d){return arguments.length?(s=typeof d=="function"?d:Z6(+d),c):s},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Z6(+d),c):l},c}function Er1(e,t,C,n,r){var i=e.children,o,a=i.length,s,l=new Array(a+1);for(l[0]=s=o=0;o<a;++o)l[o+1]=s+=i[o].value;c(0,a,e.value,t,C,n,r);function c(u,d,f,v,g,h,m){if(u>=d-1){var p=i[u];p.x0=v,p.y0=g,p.x1=h,p.y1=m;return}for(var x=l[u],S=f/2+x,w=u+1,M=d-1;w<M;){var _=w+M>>>1;l[_]<S?w=_+1:M=_}S-l[w-1]<l[w]-S&&u+1<w&&--w;var E=l[w]-x,O=f-E;if(h-v>m-g){var T=(v*O+h*E)/f;c(u,w,E,v,g,T,m),c(w,d,O,T,g,h,m)}else{var k=(g*O+m*E)/f;c(u,w,E,v,g,h,k),c(w,d,O,v,k,h,m)}}}function _r1(e,t,C,n,r){(e.depth&1?$u:Su)(e,t,C,n,r)}function V4(){return V4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},V4.apply(this,arguments)}function Or1(e,t){if(e==null)return{};var C,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)C=i[n],t.indexOf(C)>=0||(r[C]=e[C]);return r}var Vr1=function(e,t){return _2([e,t],function(C,n){return"translate("+C+","+n+")"})},Tr1=function(e,t){return _2([e,t],function(C,n){return"translate("+C+"px, "+n+"px)"})},am=function(e,t,C){return _2([e,t,C],function(n,r,i){return"translate("+n+","+r+") rotate("+i+")"})},Rr1=function(e,t,C){return _2([e,t,C],function(n,r,i){return"translate("+n+"px,"+r+"px) rotate("+i+"deg)"})},Hr1=function(e,t,C){return _2([e,t,C],function(n,r,i){return"translate("+(n-(i===0?0:5))+"px,"+(r-(i===0?5:0))+"px) rotate("+i+"deg)"})},kr1=$.memo(function(e){var t=e.node,C=e.animatedProps,n=e.borderWidth,r=e.enableLabel,i=e.enableParentLabel,o=e.labelSkipSize,a=W5(),s=r&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),l=i&&t.isParent;return b.jsxs(e5.g,{transform:Vr1(C.x,C.y),children:[b.jsx(e5.rect,{"data-testid":"node."+t.id,width:_2(C.width,function(c){return Math.max(c,0)}),height:_2(C.height,function(c){return Math.max(c,0)}),fill:t.fill?t.fill:C.color,strokeWidth:n,stroke:t.borderColor,fillOpacity:t.opacity,onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),s&&b.jsx(e5.text,{"data-testid":"label."+t.id,textAnchor:"middle",dominantBaseline:"central",style:V4({},a.labels.text,{fill:t.labelTextColor,pointerEvents:"none"}),fillOpacity:C.labelOpacity,transform:am(C.labelX,C.labelY,C.labelRotation),children:t.label}),l&&b.jsx(e5.text,{"data-testid":"parentLabel."+t.id,dominantBaseline:"central",style:V4({},a.labels.text,{fill:t.parentLabelTextColor,pointerEvents:"none"}),fillOpacity:C.parentLabelOpacity,transform:am(C.parentLabelX,C.parentLabelY,C.parentLabelRotation),children:t.parentLabel})]})}),Lr1=$.memo(function(e){var t=e.node;return b.jsx(L9,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})}),Pr1=$.memo(function(e){var t=e.node,C=e.animatedProps,n=e.borderWidth,r=e.enableLabel,i=e.enableParentLabel,o=e.labelSkipSize,a=W5(),s=r&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),l=i&&t.isParent;return b.jsxs(e5.div,{"data-testid":"node."+t.id,id:t.path.replace(/[^\w]/gi,"-"),style:{boxSizing:"border-box",position:"absolute",top:0,left:0,transform:Tr1(C.x,C.y),width:C.width,height:C.height,borderWidth:n,borderStyle:"solid",borderColor:t.borderColor,overflow:"hidden"},children:[b.jsx(e5.div,{style:{boxSizing:"border-box",position:"absolute",top:0,left:0,opacity:t.opacity,width:C.width,height:C.height,background:C.color},onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),s&&b.jsx(e5.span,{"data-testid":"label."+t.id,style:V4({},a.labels.text,{position:"absolute",display:"flex",top:-5,left:-5,width:10,height:10,justifyContent:"center",alignItems:"center",whiteSpace:"nowrap",color:t.labelTextColor,transformOrigin:"center center",transform:Rr1(C.labelX,C.labelY,C.labelRotation),opacity:C.labelOpacity,pointerEvents:"none"}),children:t.label}),l&&b.jsx(e5.span,{"data-testid":"parentLabel."+t.id,style:V4({},a.labels.text,{position:"absolute",display:"flex",justifyContent:"flex-start",alignItems:"center",whiteSpace:"nowrap",width:10,height:10,color:t.parentLabelTextColor,transformOrigin:"top left",transform:Hr1(C.parentLabelX,C.parentLabelY,C.parentLabelRotation),opacity:C.parentLabelOpacity,pointerEvents:"none"}),children:t.parentLabel})]})}),x2={layers:["nodes"],identity:"id",value:"value",tile:"squarify",leavesOnly:!1,innerPadding:0,outerPadding:0,colors:{scheme:"nivo"},colorBy:"pathComponents.1",nodeOpacity:.33,enableLabel:!0,label:"formattedValue",labelSkipSize:0,labelTextColor:{from:"color",modifiers:[["darker",1]]},orientLabel:!0,enableParentLabel:!0,parentLabel:"id",parentLabelSize:20,parentLabelPosition:"top",parentLabelPadding:6,parentLabelTextColor:{from:"color",modifiers:[["darker",1]]},borderWidth:1,borderColor:{from:"color",modifiers:[["darker",1]]},isInteractive:!0,tooltip:Lr1,role:"img",animate:!0,motionConfig:"gentle"},U5=V4({},x2,{nodeComponent:kr1,defs:[],fill:[]});V4({},x2,{nodeComponent:Pr1});V4({},x2,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var jr1={binary:Er1,dice:Su,slice:$u,sliceDice:_r1,squarify:cM},Ir1=function(e){var t=e.root,C=e.getValue;return $.useMemo(function(){return wu(t).sum(C)},[t,C])},Ar1=function(e){var t=e.data,C=e.width,n=e.height,r=e.identity,i=r===void 0?x2.identity:r,o=e.value,a=o===void 0?x2.value:o,s=e.valueFormat,l=e.leavesOnly,c=l===void 0?x2.leavesOnly:l,u=e.tile,d=u===void 0?x2.tile:u,f=e.innerPadding,v=f===void 0?x2.innerPadding:f,g=e.outerPadding,h=g===void 0?x2.outerPadding:g,m=e.label,p=m===void 0?x2.label:m,x=e.orientLabel,S=x===void 0?x2.orientLabel:x,w=e.enableParentLabel,M=w===void 0?x2.enableParentLabel:w,_=e.parentLabel,E=_===void 0?x2.parentLabel:_,O=e.parentLabelSize,T=O===void 0?x2.parentLabelSize:O,k=e.parentLabelPosition,A=k===void 0?x2.parentLabelPosition:k,V=e.parentLabelPadding,R=V===void 0?x2.parentLabelPadding:V,P=e.colors,L=P===void 0?x2.colors:P,H=e.colorBy,I=H===void 0?x2.colorBy:H,j=e.nodeOpacity,N=j===void 0?x2.nodeOpacity:j,z=e.borderColor,q=z===void 0?x2.borderColor:z,G=e.labelTextColor,Y=G===void 0?x2.labelTextColor:G,e1=e.parentLabelTextColor,Q=e1===void 0?x2.parentLabelTextColor:e1,K=m3(i),J=m3(a),W=L7(s),U=m3(p),Z=m3(E),D=function(v1){var h1=v1.width,l1=v1.height,$1=v1.tile,f1=v1.innerPadding,A1=v1.outerPadding,I1=v1.enableParentLabel,R1=v1.parentLabelSize,k1=v1.parentLabelPosition,Y1=v1.leavesOnly;return $.useMemo(function(){var X1=Mr1().size([h1,l1]).tile(jr1[$1]).round(!0).paddingInner(f1).paddingOuter(A1);if(I1&&!Y1){var D1=R1+2*A1;X1["padding"+nr1(k1)](D1)}return X1},[h1,l1,$1,f1,A1,I1,R1,k1,Y1])}({width:C,height:n,tile:d,innerPadding:v,outerPadding:h,enableParentLabel:M,parentLabelSize:T,parentLabelPosition:A,leavesOnly:c}),n1=Ir1({root:t,getValue:J}),B=$.useMemo(function(){var v1=u$(n1);return D(v1),c?v1.leaves():v1.descendants()},[n1,D,c]),r1=$.useMemo(function(){return B.map(function(v1){var h1=function(A1,I1){var R1=A1.ancestors().map(function(k1){return I1(k1.data)}).reverse();return{path:R1.join("."),pathComponents:R1}}(v1,K),l1=h1.path,$1=h1.pathComponents,f1={id:K(v1.data),path:l1,pathComponents:$1,data:Z8(v1.data,"children"),x:v1.x0,y:v1.y0,width:v1.x1-v1.x0,height:v1.y1-v1.y0,value:v1.value,formattedValue:W(v1.value),treeDepth:v1.depth,treeHeight:v1.height,isParent:v1.height>0,isLeaf:v1.height===0,parentLabelX:0,parentLabelY:0,parentLabelRotation:0};return f1.labelRotation=S&&f1.height>f1.width?-90:0,A==="top"&&(f1.parentLabelX=h+R,f1.parentLabelY=h+T/2),A==="right"&&(f1.parentLabelX=f1.width-h-T/2,f1.parentLabelY=f1.height-h-R,f1.parentLabelRotation=-90),A==="bottom"&&(f1.parentLabelX=h+R,f1.parentLabelY=f1.height-h-T/2),A==="left"&&(f1.parentLabelX=h+T/2,f1.parentLabelY=f1.height-h-R,f1.parentLabelRotation=-90),f1.label=U(f1),f1.parentLabel=Z(f1),f1})},[B,K,W,U,S,Z,T,A,R,h]),i1=W5(),g1=ye(L,I),y1=E4(q,i1),m1=E4(Y,i1),b1=E4(Q,i1),S1=$.useMemo(function(){return r1.map(function(v1){var h1=V4({},v1,{color:g1(v1),opacity:N});return h1.borderColor=y1(h1),h1.labelTextColor=m1(h1),h1.parentLabelTextColor=b1(h1),h1})},[r1,g1,N,y1,m1,b1]);return{hierarchy:n1,nodes:S1,layout:D}},Nr1=function(e){var t=e.nodes;return $.useMemo(function(){return{nodes:t}},[t])},Si=function(e){return{x:e.x,y:e.y,width:e.width,height:e.height,color:e.color,labelX:e.width/2,labelY:e.height/2,labelRotation:e.labelRotation,labelOpacity:1,parentLabelX:e.parentLabelX,parentLabelY:e.parentLabelY,parentLabelRotation:e.parentLabelRotation,parentLabelOpacity:1}},sm=function(e){return{x:e.x+e.width/2,y:e.y+e.height/2,width:0,height:0,color:e.color,labelX:0,labelY:0,labelRotation:e.labelRotation,labelOpacity:0,parentLabelX:0,parentLabelY:0,parentLabelRotation:e.parentLabelRotation,parentLabelOpacity:0}},Dr1=$.memo(function(e){var t=e.nodes,C=e.nodeComponent,n=e.borderWidth,r=e.enableLabel,i=e.labelSkipSize,o=e.enableParentLabel,a=function(d,f){var v=f.isInteractive,g=f.onMouseEnter,h=f.onMouseMove,m=f.onMouseLeave,p=f.onClick,x=f.tooltip,S=s3(),w=S.showTooltipFromEvent,M=S.hideTooltip,_=$.useCallback(function(A,V){w($.createElement(x,{node:A}),V,"left")},[w,x]),E=$.useCallback(function(A,V){_(A,V),g==null||g(A,V)},[g,_]),O=$.useCallback(function(A,V){_(A,V),h==null||h(A,V)},[h,_]),T=$.useCallback(function(A,V){M(),m==null||m(A,V)},[m,M]),k=$.useCallback(function(A,V){p==null||p(A,V)},[p]);return $.useMemo(function(){return d.map(function(A){return v?V4({},A,{onMouseEnter:function(V){return E(A,V)},onMouseMove:function(V){return O(A,V)},onMouseLeave:function(V){return T(A,V)},onClick:function(V){return k(A,V)}}):A})},[v,d,E,O,T,k])}(t,{isInteractive:e.isInteractive,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseLeave:e.onMouseLeave,onClick:e.onClick,tooltip:e.tooltip}),s=A2(),l=s.animate,c=s.config,u=p4(a,{keys:function(d){return d.path},initial:Si,from:sm,enter:Si,update:Si,leave:sm,config:c,immediate:!l});return b.jsx(b.Fragment,{children:u(function(d,f){return $.createElement(C,{key:f.path,node:f,animatedProps:d,borderWidth:n,enableLabel:r,labelSkipSize:i,enableParentLabel:o})})})}),Fr1=["isInteractive","animate","motionConfig","theme","renderWrapper"],zr1=function(e){var t=e.data,C=e.identity,n=C===void 0?U5.identity:C,r=e.value,i=r===void 0?U5.value:r,o=e.valueFormat,a=e.tile,s=a===void 0?U5.tile:a,l=e.nodeComponent,c=l===void 0?U5.nodeComponent:l,u=e.innerPadding,d=u===void 0?U5.innerPadding:u,f=e.outerPadding,v=f===void 0?U5.outerPadding:f,g=e.leavesOnly,h=g===void 0?U5.leavesOnly:g,m=e.width,p=e.height,x=e.margin,S=e.layers,w=S===void 0?U5.layers:S,M=e.colors,_=M===void 0?U5.colors:M,E=e.colorBy,O=E===void 0?U5.colorBy:E,T=e.nodeOpacity,k=T===void 0?U5.nodeOpacity:T,A=e.borderWidth,V=A===void 0?U5.borderWidth:A,R=e.borderColor,P=R===void 0?U5.borderColor:R,L=e.defs,H=L===void 0?U5.defs:L,I=e.fill,j=I===void 0?U5.fill:I,N=e.enableLabel,z=N===void 0?U5.enableLabel:N,q=e.label,G=q===void 0?U5.label:q,Y=e.labelTextColor,e1=Y===void 0?U5.labelTextColor:Y,Q=e.orientLabel,K=Q===void 0?U5.orientLabel:Q,J=e.labelSkipSize,W=J===void 0?U5.labelSkipSize:J,U=e.enableParentLabel,Z=U===void 0?U5.enableParentLabel:U,D=e.parentLabel,n1=D===void 0?U5.parentLabel:D,B=e.parentLabelSize,r1=B===void 0?U5.parentLabelSize:B,i1=e.parentLabelPosition,g1=i1===void 0?U5.parentLabelPosition:i1,y1=e.parentLabelPadding,m1=y1===void 0?U5.parentLabelPadding:y1,b1=e.parentLabelTextColor,S1=b1===void 0?U5.parentLabelTextColor:b1,v1=e.isInteractive,h1=v1===void 0?U5.isInteractive:v1,l1=e.onMouseEnter,$1=e.onMouseMove,f1=e.onMouseLeave,A1=e.onClick,I1=e.tooltip,R1=I1===void 0?U5.tooltip:I1,k1=e.role,Y1=e.ariaLabel,X1=e.ariaLabelledBy,D1=e.ariaDescribedBy,L1=z8(m,p,x),Q1=L1.margin,U1=L1.innerWidth,q1=L1.innerHeight,u1=L1.outerWidth,_1=L1.outerHeight,K1=Ar1({data:t,identity:n,value:i,valueFormat:o,leavesOnly:h,width:U1,height:q1,tile:s,innerPadding:d,outerPadding:v,colors:_,colorBy:O,nodeOpacity:k,borderColor:P,label:G,labelTextColor:e1,orientLabel:K,enableParentLabel:Z,parentLabel:n1,parentLabelSize:r1,parentLabelPosition:g1,parentLabelPadding:m1,parentLabelTextColor:S1}).nodes,C5={nodes:null};w.includes("nodes")&&(C5.nodes=b.jsx(Dr1,{nodes:K1,nodeComponent:c,borderWidth:V,enableLabel:z,labelSkipSize:W,enableParentLabel:Z,isInteractive:h1,onMouseEnter:l1,onMouseMove:$1,onMouseLeave:f1,onClick:A1,tooltip:R1},"nodes"));var N1=Nr1({nodes:K1}),z1=gu(H,K1,j);return b.jsx(y6,{width:u1,height:_1,margin:Q1,defs:z1,role:k1,ariaLabel:Y1,ariaLabelledBy:X1,ariaDescribedBy:D1,children:w.map(function(F1,J1){var t5;return typeof F1=="function"?b.jsx($.Fragment,{children:$.createElement(F1,N1)},J1):(t5=C5==null?void 0:C5[F1])!=null?t5:null})})},Br1=function(e){var t=e.isInteractive,C=t===void 0?U5.isInteractive:t,n=e.animate,r=n===void 0?U5.animate:n,i=e.motionConfig,o=i===void 0?U5.motionConfig:i,a=e.theme,s=e.renderWrapper,l=Or1(e,Fr1);return b.jsx(B8,{animate:r,isInteractive:C,motionConfig:o,renderWrapper:s,theme:a,children:b.jsx(zr1,V4({isInteractive:C},l))})},Wr1=function(e){return b.jsx(U7,{children:function(t){var C=t.width,n=t.height;return b.jsx(Br1,V4({width:C,height:n},e))}})};function Ur1(e,t){if(e.startsWith("rgba"))return e.replace(/rgba?\((\d+), (\d+), (\d+),? ([\d.]+)?\)/,(C,n,r,i,o)=>`rgba(${n}, ${r}, ${i}, ${t})`);if(e.startsWith("rgb"))return e.replace(/rgb\((\d+), (\d+), (\d+)\)/,(C,n,r,i)=>`rgba(${n}, ${r}, ${i}, ${t})`);if(e.startsWith("hsl"))return e.replace(/hsl\((\d+), (\d+)%?, (\d+)%?\)/,(C,n,r,i)=>`hsla(${n}, ${r}%, ${i}%, ${t})`);if(e.startsWith("hsla"))return e.replace(/hsla?\((\d+), (\d+)%?, (\d+)%?,? ([\d.]+)?\)/,(C,n,r,i,o)=>`hsla(${n}, ${r}%, ${i}%, ${t})`);if(e.startsWith("#")){const C=Zr1(e);return`rgba(${C.r}, ${C.g}, ${C.b}, ${t})`}throw new Error("Unsupported color format")}function Zr1(e){const t=e.startsWith("#")?e.slice(1):e,C=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return{r:C,g:n,b:r}}const qr1=({treeMapData:e,style:t={},colors:C={scheme:"nivo"},identity:n="name",value:r="loc",margin:i={},nodeOpacity:o=.67,labelTextColor:a="black",borderColor:s="white",labelTitle:l="name",labelTitleSize:c=16,labelText:u="name",labelTextSize:d=10,labelPadding:f=5,tooltip:v=null})=>{const g=({node:m})=>{var O,T;const p=$.useRef(null),x=$.useRef(null),[S,w]=$.useState(!1),[M,_]=$.useState(!1),E=()=>{if(!(p!=null&&p.current)||!(x!=null&&x.current))return;const k=x.current.getBoundingClientRect(),A=p.current.getBoundingClientRect(),V=Math.max([k,A]);w(A.height>m.height-f*2||A.width>m.width-f*2),_(k.height+A.height>m.height-f*2||V>m.width-f*2)};return $.useEffect(()=>{E()},[]),m.isParent?b.jsx(b.Fragment,{}):b.jsx("g",{transform:`translate(${m.x}, ${m.y})`,children:b.jsx("foreignObject",{width:m.width,height:m.height,style:{backgroundColor:Ur1(m.color,o),border:`1px solid ${s}`},children:b.jsxs("div",{style:{font:"var(--gf-label-lg-default)",color:a,padding:f,display:S?"none":"auto"},children:[b.jsx("span",{ref:p,style:{fontSize:c,display:"inline-block"},children:b.jsx("b",{children:((O=m==null?void 0:m.data)==null?void 0:O[l])||"Title"})}),b.jsx("div",{style:{display:M?"none":"auto"},children:b.jsx("span",{ref:x,style:{fontSize:d,display:"inline-block"},children:((T=m==null?void 0:m.data)==null?void 0:T[u])||"Text"})})]})})})},h=({nodes:m})=>m.map(p=>b.jsx(g,{node:p},p.id));return b.jsxs(b.Fragment,{children:[b.jsx(O2,{}),b.jsx("div",{style:{width:"100%",height:600,...t},children:b.jsx(Wr1,{data:e,colors:C,identity:n,value:r,margin:{top:10,right:10,bottom:10,left:10,...i},enableParentLabel:!1,enableLabel:!1,nodeOpacity:0,borderWidth:0,tooltip:({node:m})=>b.jsx(v4,{body:(v==null?void 0:v({node:m}))||b.jsx("span",{children:"Treemap tooltip"})}),layers:[h,"nodes"]})})]})};var Gr1=fe,Yr1=0;function Kr1(e){var t=++Yr1;return Gr1(e)+t}var Xr1=Kr1;const Qr1=p2(Xr1);function c4(){return c4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var C=arguments[t];for(var n in C)Object.prototype.hasOwnProperty.call(C,n)&&(e[n]=C[n])}return e},c4.apply(this,arguments)}var Mu=$.memo(function(e){var t=e.point;return b.jsx(L9,{id:b.jsxs("span",{children:["x: ",b.jsx("strong",{children:t.data.xFormatted}),", y:"," ",b.jsx("strong",{children:t.data.yFormatted})]}),enableChip:!0,color:t.serieColor})}),uM=$.memo(function(e){var t=e.slice,C=e.axis,n=W5(),r=C==="x"?"y":"x";return b.jsx(Qx,{rows:t.points.map(function(i){return[b.jsx(Zt,{color:i.serieColor,style:n.tooltip.chip},"chip"),i.serieId,b.jsx("span",{style:n.tooltip.tableCellValue,children:i.data[r+"Formatted"]},"value")]})})}),dM={curve:"linear",xScale:{type:"point"},yScale:{type:"linear",min:0,max:"auto"},layers:["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"],axisBottom:{},axisLeft:{},enableGridX:!0,enableGridY:!0,enablePoints:!0,pointSize:6,pointColor:{from:"color"},pointBorderWidth:0,pointBorderColor:{theme:"background"},enablePointLabel:!1,pointLabel:"yFormatted",colors:{scheme:"nivo"},enableArea:!1,areaBaselineValue:0,areaOpacity:.2,areaBlendMode:"normal",lineWidth:2,legends:[],isInteractive:!0,tooltip:Mu,enableSlices:!1,debugSlices:!1,sliceTooltip:uM,debugMesh:!1,enableCrosshair:!0,crosshairType:"bottom-left"},x7=c4({},dM,{enablePointLabel:!1,useMesh:!1,enableTouchCrosshair:!1,animate:!0,motionConfig:"gentle",defs:[],fill:[],role:"img"});c4({},dM,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var Jr1=function(e){var t=e.curve;return $.useMemo(function(){return W0().defined(function(C){return C.x!==null&&C.y!==null}).x(function(C){return C.x}).y(function(C){return C.y}).curve(PS(t))},[t])},ei1=function(e){var t=e.curve,C=e.yScale,n=e.areaBaselineValue;return $.useMemo(function(){return eS().defined(function(r){return r.x!==null&&r.y!==null}).x(function(r){return r.x}).y1(function(r){return r.y}).curve(PS(t)).y0(C(n))},[t,C,n])},ti1=function(e){var t=e.componentId,C=e.enableSlices,n=e.points,r=e.width,i=e.height;return $.useMemo(function(){if(C===!1)return[];if(C==="x"){var o=new Map;return n.forEach(function(s){s.data.x!==null&&s.data.y!==null&&(o.has(s.x)?o.get(s.x).push(s):o.set(s.x,[s]))}),Array.from(o.entries()).sort(function(s,l){return s[0]-l[0]}).map(function(s,l,c){var u,d,f=s[0],v=s[1],g=c[l-1],h=c[l+1];return u=g?f-(f-g[0])/2:f,d=h?f-u+(h[0]-f)/2:r-u,{id:"slice:"+t+":"+f,x0:u,x:f,y0:0,y:0,width:d,height:i,points:v.reverse()}})}if(C==="y"){var a=new Map;return n.forEach(function(s){s.data.x!==null&&s.data.y!==null&&(a.has(s.y)?a.get(s.y).push(s):a.set(s.y,[s]))}),Array.from(a.entries()).sort(function(s,l){return s[0]-l[0]}).map(function(s,l,c){var u,d,f=s[0],v=s[1],g=c[l-1],h=c[l+1];return u=g?f-(f-g[0])/2:f,d=h?f-u+(h[0]-f)/2:i-u,{id:f,x0:0,x:0,y0:u,y:f,width:r,height:d,points:v.reverse()}})}},[t,C,i,n,r])},Ci1="line",fM=function(e){var t=e.data,C=e.xScale,n=C===void 0?x7.xScale:C,r=e.xFormat,i=e.yScale,o=i===void 0?x7.yScale:i,a=e.yFormat,s=e.width,l=e.height,c=e.colors,u=c===void 0?x7.colors:c,d=e.curve,f=d===void 0?x7.curve:d,v=e.areaBaselineValue,g=v===void 0?x7.areaBaselineValue:v,h=e.pointColor,m=h===void 0?x7.pointColor:h,p=e.pointBorderColor,x=p===void 0?x7.pointBorderColor:p,S=e.enableSlices,w=S===void 0?x7.enableSlicesTooltip:S,M=$.useState(Qr1(Ci1))[0],_=L7(r),E=L7(a),O=ye(u,"id"),T=W5(),k=E4(m,T),A=E4(x,T),V=$.useState([]),R=V[0],P=V[1],L=$.useMemo(function(){return w$(t.filter(function(Q){return R.indexOf(Q.id)===-1}),n,o,s,l)},[t,R,n,o,s,l]),H=L.xScale,I=L.yScale,j=L.series,N=$.useMemo(function(){var Q=t.map(function(J){return{id:J.id,label:J.id,color:O(J)}}),K=Q.map(function(J){return c4({},j.find(function(W){return W.id===J.id}),{color:J.color})}).filter(function(J){return!!J.id});return{legendData:Q.map(function(J){return c4({},J,{hidden:!K.find(function(W){return W.id===J.id})})}).reverse(),series:K}},[t,j,O]),z=N.legendData,q=N.series,G=$.useCallback(function(Q){P(function(K){return K.indexOf(Q)>-1?K.filter(function(J){return J!==Q}):[].concat(K,[Q])})},[]),Y=function(Q){var K=Q.series,J=Q.getPointColor,W=Q.getPointBorderColor,U=Q.formatX,Z=Q.formatY;return $.useMemo(function(){return K.reduce(function(D,n1){return[].concat(D,n1.data.filter(function(B){return B.position.x!==null&&B.position.y!==null}).map(function(B,r1){var i1={id:n1.id+"."+r1,index:D.length+r1,serieId:n1.id,serieColor:n1.color,x:B.position.x,y:B.position.y};return i1.color=J(n1),i1.borderColor=W(i1),i1.data=c4({},B.data,{xFormatted:U(B.data.x),yFormatted:Z(B.data.y)}),i1}))},[])},[K,J,W,U,Z])}({series:q,getPointColor:k,getPointBorderColor:A,formatX:_,formatY:E}),e1=ti1({componentId:M,enableSlices:w,points:Y,width:s,height:l});return{legendData:z,toggleSerie:G,lineGenerator:Jr1({curve:f}),areaGenerator:ei1({curve:f,yScale:I,areaBaselineValue:g}),getColor:O,series:q,xScale:H,yScale:I,slices:e1,points:Y}},ni1=function(e){var t=e.areaBlendMode,C=e.areaOpacity,n=e.color,r=e.fill,i=e.path,o=A2(),a=o.animate,s=o.config,l=On(i),c=X5({color:n,config:s,immediate:!a});return b.jsx(e5.path,{d:l,fill:r||c.color,fillOpacity:C,strokeWidth:0,style:{mixBlendMode:t}})},ri1=$.memo(function(e){var t=e.areaGenerator,C=e.areaOpacity,n=e.areaBlendMode,r=e.lines.slice(0).reverse();return b.jsx("g",{children:r.map(function(i){return b.jsx(ni1,c4({path:t(i.data.map(function(o){return o.position}))},c4({areaOpacity:C,areaBlendMode:n},i)),i.id)})})}),ii1=$.memo(function(e){var t=e.lineGenerator,C=e.points,n=e.color,r=e.thickness,i=$.useMemo(function(){return t(C)},[t,C]),o=On(i);return b.jsx(e5.path,{d:o,fill:"none",strokeWidth:r,stroke:n})}),oi1=$.memo(function(e){var t=e.lines,C=e.lineGenerator,n=e.lineWidth;return t.slice(0).reverse().map(function(r){var i=r.id,o=r.data,a=r.color;return b.jsx(ii1,{id:i,points:o.map(function(s){return s.position}),lineGenerator:C,color:a,thickness:n},i)})}),ai1=$.memo(function(e){var t=e.slice,C=e.slices,n=e.axis,r=e.debug,i=e.tooltip,o=e.isCurrent,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd,g=s3(),h=g.showTooltipFromEvent,m=g.hideTooltip,p=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),a(t),s&&s(t,O)},[h,i,t,n,a,s]),x=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),l&&l(t,O)},[h,i,t,n,l]),S=$.useCallback(function(O){m(),a(null),c&&c(t,O)},[m,a,c,t]),w=$.useCallback(function(O){u&&u(t,O)},[t,u]),M=$.useCallback(function(O){h($.createElement(i,{slice:t,axis:n}),O,"right"),a(t),d&&d(t,O)},[n,d,a,h,t,i]),_=$.useCallback(function(O){var T=O.touches[0],k=document.elementFromPoint(T.clientX,T.clientY),A=k==null?void 0:k.getAttribute("data-ref");if(A){var V=C.find(function(R){return R.id===A});V&&(h($.createElement(i,{slice:V,axis:n}),O,"right"),a(V))}f&&f(t,O)},[n,f,a,h,t,C,i]),E=$.useCallback(function(O){m(),a(null),v&&v(t,O)},[m,a,v,t]);return b.jsx("rect",{x:t.x0,y:t.y0,width:t.width,height:t.height,stroke:"red",strokeWidth:r?1:0,strokeOpacity:.75,fill:"red",fillOpacity:o&&r?.35:0,onMouseEnter:p,onMouseMove:x,onMouseLeave:S,onClick:w,onTouchStart:M,onTouchMove:_,onTouchEnd:E,"data-ref":t.id})}),si1=$.memo(function(e){var t=e.slices,C=e.axis,n=e.debug,r=e.height,i=e.tooltip,o=e.current,a=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onClick,d=e.onTouchStart,f=e.onTouchMove,v=e.onTouchEnd;return t.map(function(g){return b.jsx(ai1,{slice:g,slices:t,axis:C,debug:n,height:r,tooltip:i,setCurrent:a,isCurrent:o!==null&&o.id===g.id,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onClick:u,onTouchStart:d,onTouchMove:f,onTouchEnd:v},g.id)})}),li1=$.memo(function(e){var t=e.points,C=e.symbol,n=e.size,r=e.borderWidth,i=e.enableLabel,o=e.label,a=e.labelYOffset,s=W5(),l=e31(o),c=t.slice(0).reverse().map(function(u){return{id:u.id,x:u.x,y:u.y,datum:u.data,fill:u.color,stroke:u.borderColor,label:i?l(u):null}});return b.jsx("g",{children:c.map(function(u){return b.jsx(X41,{x:u.x,y:u.y,datum:u.datum,symbol:C,size:n,color:u.fill,borderWidth:r,borderColor:u.stroke,label:u.label,labelYOffset:a,theme:s},u.id)})})}),ci1=$.memo(function(e){var t=e.points,C=e.width,n=e.height,r=e.margin,i=e.setCurrent,o=e.onMouseEnter,a=e.onMouseMove,s=e.onMouseLeave,l=e.onClick,c=e.onTouchStart,u=e.onTouchMove,d=e.onTouchEnd,f=e.tooltip,v=e.debug,g=e.enableTouchCrosshair,h=s3(),m=h.showTooltipAt,p=h.hideTooltip,x=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),o&&o(T,k)},[m,f,o,r]),S=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),a&&a(T,k)},[m,f,r.left,r.top,a]),w=$.useCallback(function(T,k){p(),s&&s(T,k)},[p,s]),M=$.useCallback(function(T,k){l&&l(T,k)},[l]),_=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),c&&c(T,k)},[r.left,r.top,c,m,f]),E=$.useCallback(function(T,k){m($.createElement(f,{point:T}),[T.x+r.left,T.y+r.top],"top"),u&&u(T,k)},[r.left,r.top,u,m,f]),O=$.useCallback(function(T,k){p(),d&&d(T,k)},[d,p]);return b.jsx(j$,{nodes:t,width:C,height:n,setCurrent:i,onMouseEnter:x,onMouseMove:S,onMouseLeave:w,onClick:M,onTouchStart:_,onTouchMove:E,onTouchEnd:O,enableTouchCrosshair:g,debug:v})}),ui1=KS(function(e){var t=e.data,C=e.xScale,n=C===void 0?{type:"point"}:C,r=e.xFormat,i=e.yScale,o=i===void 0?{type:"linear",min:0,max:"auto"}:i,a=e.yFormat,s=e.layers,l=s===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:s,c=e.curve,u=c===void 0?"linear":c,d=e.areaBaselineValue,f=d===void 0?0:d,v=e.colors,g=v===void 0?{scheme:"nivo"}:v,h=e.margin,m=e.width,p=e.height,x=e.axisTop,S=e.axisRight,w=e.axisBottom,M=w===void 0?{}:w,_=e.axisLeft,E=_===void 0?{}:_,O=e.enableGridX,T=O===void 0||O,k=e.enableGridY,A=k===void 0||k,V=e.gridXValues,R=e.gridYValues,P=e.lineWidth,L=P===void 0?2:P,H=e.enableArea,I=H!==void 0&&H,j=e.areaOpacity,N=j===void 0?.2:j,z=e.areaBlendMode,q=z===void 0?"normal":z,G=e.enablePoints,Y=G===void 0||G,e1=e.pointSymbol,Q=e.pointSize,K=Q===void 0?6:Q,J=e.pointColor,W=J===void 0?{from:"color"}:J,U=e.pointBorderWidth,Z=U===void 0?0:U,D=e.pointBorderColor,n1=D===void 0?{theme:"background"}:D,B=e.enablePointLabel,r1=B!==void 0&&B,i1=e.pointLabel,g1=i1===void 0?"data.yFormatted":i1,y1=e.pointLabelYOffset,m1=e.defs,b1=m1===void 0?[]:m1,S1=e.fill,v1=S1===void 0?[]:S1,h1=e.markers,l1=e.legends,$1=l1===void 0?[]:l1,f1=e.isInteractive,A1=f1===void 0||f1,I1=e.useMesh,R1=I1!==void 0&&I1,k1=e.debugMesh,Y1=k1!==void 0&&k1,X1=e.onMouseEnter,D1=e.onMouseMove,L1=e.onMouseLeave,Q1=e.onClick,U1=e.onTouchStart,q1=e.onTouchMove,u1=e.onTouchEnd,_1=e.tooltip,K1=_1===void 0?Mu:_1,C5=e.enableSlices,N1=C5!==void 0&&C5,z1=e.debugSlices,F1=z1!==void 0&&z1,J1=e.sliceTooltip,t5=J1===void 0?uM:J1,B1=e.enableCrosshair,P1=B1===void 0||B1,l5=e.crosshairType,m5=l5===void 0?"bottom-left":l5,O1=e.enableTouchCrosshair,d1=O1!==void 0&&O1,w1=e.role,V1=w1===void 0?"img":w1,G1=z8(m,p,h),W1=G1.margin,n5=G1.innerWidth,X=G1.innerHeight,o1=G1.outerWidth,a1=G1.outerHeight,T1=fM({data:t,xScale:n,xFormat:r,yScale:o,yFormat:a,width:n5,height:X,colors:g,curve:u,areaBaselineValue:f,pointColor:W,pointBorderColor:n1,enableSlices:N1}),r5=T1.legendData,o5=T1.toggleSerie,a5=T1.lineGenerator,d5=T1.areaGenerator,p1=T1.series,x1=T1.xScale,H1=T1.yScale,i5=T1.slices,g5=T1.points,y5=W5(),f5=E4(W,y5),V5=E4(n1,y5),C2=$.useState(null),I5=C2[0],c2=C2[1],i4=$.useState(null),N5=i4[0],V2=i4[1],s5={grid:b.jsx(R$,{theme:y5,width:n5,height:X,xScale:T?x1:null,yScale:A?H1:null,xValues:V,yValues:R},"grid"),markers:b.jsx(YS,{markers:h1,width:n5,height:X,xScale:x1,yScale:H1,theme:y5},"markers"),axes:b.jsx(T$,{xScale:x1,yScale:H1,width:n5,height:X,theme:y5,top:x,right:S,bottom:M,left:E},"axes"),areas:null,lines:b.jsx(oi1,{lines:p1,lineGenerator:a5,lineWidth:L},"lines"),slices:null,points:null,crosshair:null,mesh:null,legends:$1.map(function(a2,u2){return b.jsx(Tn,c4({},a2,{containerWidth:n5,containerHeight:X,data:a2.data||r5,theme:y5,toggleSerie:a2.toggleSerie?o5:void 0}),"legend."+u2)})},S2=gu(b1,p1,v1);return I&&(s5.areas=b.jsx(ri1,{areaGenerator:d5,areaOpacity:N,areaBlendMode:q,lines:p1},"areas")),A1&&N1!==!1&&(s5.slices=b.jsx(si1,{slices:i5,axis:N1,debug:F1,height:X,tooltip:t5,current:N5,setCurrent:V2,onMouseEnter:X1,onMouseMove:D1,onMouseLeave:L1,onClick:Q1,onTouchStart:U1,onTouchMove:q1,onTouchEnd:u1},"slices")),Y&&(s5.points=b.jsx(li1,{points:g5,symbol:e1,size:K,color:f5,borderWidth:Z,borderColor:V5,enableLabel:r1,label:g1,labelYOffset:y1},"points")),A1&&P1&&(I5!==null&&(s5.crosshair=b.jsx(ia,{width:n5,height:X,x:I5.x,y:I5.y,type:m5},"crosshair")),N5!==null&&(s5.crosshair=b.jsx(ia,{width:n5,height:X,x:N5.x,y:N5.y,type:N1},"crosshair"))),A1&&R1&&N1===!1&&(s5.mesh=b.jsx(ci1,{points:g5,width:n5,height:X,margin:W1,current:I5,setCurrent:c2,onMouseEnter:X1,onMouseMove:D1,onMouseLeave:L1,onClick:Q1,onTouchStart:U1,onTouchMove:q1,onTouchEnd:u1,tooltip:K1,enableTouchCrosshair:d1,debug:Y1},"mesh")),b.jsx(y6,{defs:S2,width:o1,height:a1,margin:W1,role:V1,children:l.map(function(a2,u2){return typeof a2=="function"?b.jsx($.Fragment,{children:a2(c4({},e,{innerWidth:n5,innerHeight:X,series:p1,slices:i5,points:g5,xScale:x1,yScale:H1,lineGenerator:a5,areaGenerator:d5,currentPoint:I5,setCurrentPoint:c2,currentSlice:N5,setCurrentSlice:V2}))},u2):s5[a2]})})}),di1=function(e){return b.jsx(U7,{children:function(t){var C=t.width,n=t.height;return b.jsx(ui1,c4({width:C,height:n},e))}})},fi1=KS(function(e){var t=$.useRef(null),C=e.width,n=e.height,r=e.margin,i=e.pixelRatio,o=i===void 0?typeof window<"u"&&window.devicePixelRatio||1:i,a=e.data,s=e.xScale,l=s===void 0?{type:"point"}:s,c=e.xFormat,u=e.yScale,d=u===void 0?{type:"linear",min:0,max:"auto"}:u,f=e.yFormat,v=e.curve,g=v===void 0?"linear":v,h=e.layers,m=h===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:h,p=e.colors,x=p===void 0?{scheme:"nivo"}:p,S=e.lineWidth,w=S===void 0?2:S,M=e.enableArea,_=M!==void 0&&M,E=e.areaBaselineValue,O=E===void 0?0:E,T=e.areaOpacity,k=T===void 0?.2:T,A=e.enablePoints,V=A===void 0||A,R=e.pointSize,P=R===void 0?6:R,L=e.pointColor,H=L===void 0?{from:"color"}:L,I=e.pointBorderWidth,j=I===void 0?0:I,N=e.pointBorderColor,z=N===void 0?{theme:"background"}:N,q=e.enableGridX,G=q===void 0||q,Y=e.gridXValues,e1=e.enableGridY,Q=e1===void 0||e1,K=e.gridYValues,J=e.axisTop,W=e.axisRight,U=e.axisBottom,Z=U===void 0?{}:U,D=e.axisLeft,n1=D===void 0?{}:D,B=e.legends,r1=B===void 0?[]:B,i1=e.isInteractive,g1=i1===void 0||i1,y1=e.debugMesh,m1=y1!==void 0&&y1,b1=e.onMouseLeave,S1=e.onClick,v1=e.tooltip,h1=v1===void 0?Mu:v1,l1=e.canvasRef,$1=z8(C,n,r),f1=$1.margin,A1=$1.innerWidth,I1=$1.innerHeight,R1=$1.outerWidth,k1=$1.outerHeight,Y1=W5(),X1=$.useState(null),D1=X1[0],L1=X1[1],Q1=fM({data:a,xScale:l,xFormat:c,yScale:d,yFormat:f,width:A1,height:I1,colors:x,curve:g,areaBaselineValue:O,pointColor:H,pointBorderColor:z}),U1=Q1.lineGenerator,q1=Q1.areaGenerator,u1=Q1.series,_1=Q1.xScale,K1=Q1.yScale,C5=Q1.points,N1=xu({points:C5,width:A1,height:I1,debug:m1}),z1=N1.delaunay,F1=N1.voronoi;$.useEffect(function(){l1&&(l1.current=t.current),t.current.width=R1*o,t.current.height=k1*o;var d1=t.current.getContext("2d");d1.scale(o,o),d1.fillStyle=Y1.background,d1.fillRect(0,0,R1,k1),d1.translate(f1.left,f1.top),m.forEach(function(w1){if(typeof w1=="function"&&w1({ctx:d1,innerWidth:A1,innerHeight:I1,series:u1,points:C5,xScale:_1,yScale:K1,lineWidth:w,lineGenerator:U1,areaGenerator:q1,currentPoint:D1,setCurrentPoint:L1}),w1==="grid"&&Y1.grid.line.strokeWidth>0&&(d1.lineWidth=Y1.grid.line.strokeWidth,d1.strokeStyle=Y1.grid.line.stroke,G&&hC(d1,{width:A1,height:I1,scale:_1,axis:"x",values:Y}),Q&&hC(d1,{width:A1,height:I1,scale:K1,axis:"y",values:K})),w1==="axes"&&H$(d1,{xScale:_1,yScale:K1,width:A1,height:I1,top:J,right:W,bottom:Z,left:n1,theme:Y1}),w1==="areas"&&_===!0){d1.save(),d1.globalAlpha=k,q1.context(d1);for(var V1=u1.length-1;V1>=0;V1--)d1.fillStyle=u1[V1].color,d1.beginPath(),q1(u1[V1].data.map(function(W1){return W1.position})),d1.fill();d1.restore()}if(w1==="lines"&&(U1.context(d1),u1.forEach(function(W1){d1.strokeStyle=W1.color,d1.lineWidth=w,d1.beginPath(),U1(W1.data.map(function(n5){return n5.position})),d1.stroke()})),w1==="points"&&V===!0&&P>0&&C5.forEach(function(W1){d1.fillStyle=W1.color,d1.beginPath(),d1.arc(W1.x,W1.y,P/2,0,2*Math.PI),d1.fill(),j>0&&(d1.strokeStyle=W1.borderColor,d1.lineWidth=j,d1.stroke())}),w1==="mesh"&&m1===!0&&(I$(d1,F1),D1&&A$(d1,F1,D1.index)),w1==="legends"){var G1=u1.map(function(W1){return{id:W1.id,label:W1.id,color:W1.color}}).reverse();r1.forEach(function(W1){n$(d1,c4({},W1,{data:W1.data||G1,containerWidth:A1,containerHeight:I1,theme:Y1}))})}})},[t,R1,k1,m,Y1,U1,u1,_1,K1,G,Y,Q,K,J,W,Z,n1,r1,C5,V,P,D1]);var J1=$.useCallback(function(d1){var w1=hu(t.current,d1),V1=w1[0],G1=w1[1];if(!XS(f1.left,f1.top,A1,I1,V1,G1))return null;var W1=z1.find(V1-f1.left,G1-f1.top);return C5[W1]},[t,f1,A1,I1,z1]),t5=s3(),B1=t5.showTooltipFromEvent,P1=t5.hideTooltip,l5=$.useCallback(function(d1){var w1=J1(d1);L1(w1),w1?B1($.createElement(h1,{point:w1}),d1):P1()},[J1,L1,B1,P1,h1]),m5=$.useCallback(function(d1){P1(),L1(null),D1&&b1&&b1(D1,d1)},[P1,L1,b1]),O1=$.useCallback(function(d1){if(S1){var w1=J1(d1);w1&&S1(w1,d1)}},[J1,S1]);return b.jsx("canvas",{ref:t,width:R1*o,height:k1*o,style:{width:R1,height:k1,cursor:g1?"auto":"normal"},onMouseEnter:g1?l5:void 0,onMouseMove:g1?l5:void 0,onMouseLeave:g1?m5:void 0,onClick:g1?O1:void 0})}),hi1=$.forwardRef(function(e,t){return b.jsx(fi1,c4({},e,{canvasRef:t}))});$.forwardRef(function(e,t){return b.jsx(U7,{children:function(C){var n=C.width,r=C.height;return b.jsx(hi1,c4({width:n,height:r},e,{ref:t}))}})});const gi1=({trendsData:e,height:t=null,margin:C={},colors:n=null,xLeg:r,yLeg:i,tooltip:o=null})=>b.jsxs(b.Fragment,{children:[b.jsx(O2,{}),b.jsx("div",{style:{width:"100%",height:t||600},children:b.jsx(di1,{data:e,margin:{top:50,right:90,bottom:50,left:90,...C},colors:n||{scheme:"nivo"},xScale:{type:"point"},yScale:{type:"linear",min:"auto",max:"auto",reverse:!1},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:0,legend:r,legendOffset:36,legendPosition:"middle"},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:i,legendOffset:-70,legendPosition:"middle"},pointSize:10,pointColor:{theme:"background"},pointBorderWidth:2,pointBorderColor:{from:"serieColor"},pointLabelYOffset:-12,useMesh:!0,legends:[{anchor:"top-right",direction:"column",justify:!1,translateX:210,translateY:-40,itemsSpacing:0,itemDirection:"left-to-right",itemWidth:200,itemHeight:20,itemOpacity:.9,symbolSize:8,symbolShape:"circle",symbolBorderColor:"rgba(0, 0, 0, .5)",effects:[{on:"hover",style:{itemBackground:"rgba(0, 0, 0, .03)",itemOpacity:1}}]}],tooltip:a=>b.jsx(v4,{body:(o==null?void 0:o(a))||b.jsx("span",{children:"Line tooltip"})})})})]}),vi1=_5.h3`
|
|
497
497
|
color: var(--gf-color-button-primary);
|
|
498
498
|
`,mi1=({selectors:e,setter:t})=>{const C=24/e.length;return b.jsxs(b.Fragment,{children:[b.jsx(O2,{}),b.jsx(Y9,{cardtype:"default",style:{width:"100%"},children:b.jsx(R7,{gutter:20,children:e.map((n,r)=>b.jsxs(J4,{span:C,children:[b.jsx(vi1,{children:n.title}),b.jsx(H8,{defaultValue:n.defaultValue,style:{width:"100%"},onChange:i=>{t(n.key,i)},options:n.options})]},`col-${r}`))})})]})},$i=_5.span`
|
|
499
499
|
font: var(--gf-label-md-default);
|
|
@@ -584,7 +584,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
584
584
|
color: var(--gf-color-text-secondary);
|
|
585
585
|
font-size: ${J7}px;
|
|
586
586
|
line-height: ${Ja}px;
|
|
587
|
-
`,ac1=(e,t=12)=>{const n=document.createElement("canvas").getContext("2d");return n.font=`${t}px Roboto`,n.measureText(e)},Vm=(e,t,C=12)=>{const n=e.split(" "),r=[];let i=n[0];for(let o=1;o<n.length;o++){const a=`${i} ${n[o]}`;ac1(a,C).width>t?(r.push(i),i=n[o]):i=a}return r.push(i),r},sc1=({data:e,height:t=1300,margin:C={},xLabelWidth:n=110,xLabelPadding:r=20,yLabelWidth:i=200,yLabelPadding:o=40,yNumeralWidth:a=30,yNumeralPadding:s=50,scalePadding:l=10,scaleTextPadding:c=5,tooltip:u=null})=>{const d=i+o+a+s+l+c,f=$.useRef(null),[v,g]=$.useState({width:0,height:0});$.useEffect(()=>{if(!(f!=null&&f.current))return;const A=()=>{const R=f.current.getBoundingClientRect();g({width:R.width,height:R.height})},V=new ResizeObserver(A);return V.observe(f==null?void 0:f.current),A(),()=>{V.disconnect()}},[]);const h=e.reduce((A,V)=>(A[V.id]=V.worth,A),{}),m=({cell:A,text:V,transX:R,transY:P,textAnchor:L="start",textStyle:H={}})=>{const I=$.useRef(null),[j,N]=$.useState(0);V=V||"label";const z=Vm(V,i,J7);return $.useEffect(()=>{if(I.current){const q=I.current.getBoundingClientRect();N(q.height)}},[]),P=P||A.y-j/2,b.jsx("g",{ref:I,transform:`translate(-${R}, ${P})`,children:b.jsx("text",{textAnchor:L,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignmentBaseline:"middle"},children:z.map((q,G)=>b.jsx(u9,{x:0,dy:G>0?Ja:J7,style:H,children:q},G))})})},p=({cell:A,text:V,transX:R,transY:P,textAnchor:L="start",textStyle:H={},rotate:I=-90})=>{var G;const j=$.useRef(null),[N,z]=$.useState(0);V=V||((G=A==null?void 0:A.data)==null?void 0:G.x)||"label";const q=Vm(V,n,J7);return $.useEffect(()=>{if(j.current){const Y=j.current.getBoundingClientRect();z(Y.width)}},[]),R=R||A.x-N/2,P=P||-(r+l+c),b.jsx("g",{ref:j,transform:`translate(${R}, ${P}) rotate(${I})`,children:b.jsx("text",{textAnchor:L,style:{display:"flex",flexDirection:"column",justifyContent:"left",alignmentBaseline:"middle"},children:q.map((Y,e1)=>b.jsx(u9,{x:0,dy:e1>0?Ja:J7,style:H,children:Y},e1))})})};let x=null;const S=({cells:A})=>A.map((V,R)=>{const P=V==null?void 0:V.serieId;if(P!==x)return x=P,b.jsx(m,{cell:V,text:V==null?void 0:V.serieId,transX:d},`cell-ylabel-${R}`)}),w=({cells:A})=>b.jsx(m,{text:"Goederengroep",transX:d,transY:-20,textStyle:{fontWeight:"bold"}}),M=({cells:A})=>A.map((V,R)=>{const P=V==null?void 0:V.serieId;if(P!==x)return x=P,b.jsx(m,{cell:V,text:h[P].toString(),transX:s,textAnchor:"end"},`cell-ynumeral-${R}`)}),_=({cells:A})=>b.jsx(m,{text:"Invoerwaarde in mln €",transX:s,transY:-20,textStyle:{fontWeight:"bold"},textAnchor:"end"});x=null;const E=({cells:A})=>A.map((V,R)=>{if((V==null?void 0:V.serieId)===x)return b.jsx(p,{cell:V},`cell-ylabel-${R}`)})
|
|
587
|
+
`,ac1=(e,t=12)=>{const n=document.createElement("canvas").getContext("2d");return n.font=`${t}px Roboto`,n.measureText(e)},Vm=(e,t,C=12)=>{const n=e.split(" "),r=[];let i=n[0];for(let o=1;o<n.length;o++){const a=`${i} ${n[o]}`;ac1(a,C).width>t?(r.push(i),i=n[o]):i=a}return r.push(i),r},sc1=({data:e,height:t=1300,margin:C={},xLabelWidth:n=110,xLabelPadding:r=20,yLabelWidth:i=200,yLabelPadding:o=40,yNumeralWidth:a=30,yNumeralPadding:s=50,scalePadding:l=10,scaleTextPadding:c=5,tooltip:u=null})=>{const d=i+o+a+s+l+c,f=$.useRef(null),[v,g]=$.useState({width:0,height:0});$.useEffect(()=>{if(!(f!=null&&f.current))return;const A=()=>{const R=f.current.getBoundingClientRect();g({width:R.width,height:R.height})},V=new ResizeObserver(A);return V.observe(f==null?void 0:f.current),A(),()=>{V.disconnect()}},[]);const h=e.reduce((A,V)=>(A[V.id]=V.worth,A),{}),m=({cell:A,text:V,transX:R,transY:P,textAnchor:L="start",textStyle:H={}})=>{const I=$.useRef(null),[j,N]=$.useState(0);V=V||"label";const z=Vm(V,i,J7);return $.useEffect(()=>{if(I.current){const q=I.current.getBoundingClientRect();N(q.height)}},[]),P=P||A.y-j/2,b.jsx("g",{ref:I,transform:`translate(-${R}, ${P})`,children:b.jsx("text",{textAnchor:L,style:{display:"flex",flexDirection:"column",justifyContent:"center",alignmentBaseline:"middle"},children:z.map((q,G)=>b.jsx(u9,{x:0,dy:G>0?Ja:J7,style:H,children:q},G))})})},p=({cell:A,text:V,transX:R,transY:P,textAnchor:L="start",textStyle:H={},rotate:I=-90})=>{var G;const j=$.useRef(null),[N,z]=$.useState(0);V=V||((G=A==null?void 0:A.data)==null?void 0:G.x)||"label";const q=Vm(V,n,J7);return $.useEffect(()=>{if(j.current){const Y=j.current.getBoundingClientRect();z(Y.width)}},[]),R=R||A.x-N/2,P=P||-(r+l+c),b.jsx("g",{ref:j,transform:`translate(${R}, ${P}) rotate(${I})`,children:b.jsx("text",{textAnchor:L,style:{display:"flex",flexDirection:"column",justifyContent:"left",alignmentBaseline:"middle"},children:q.map((Y,e1)=>b.jsx(u9,{x:0,dy:e1>0?Ja:J7,style:H,children:Y},e1))})})};let x=null;const S=({cells:A})=>A.map((V,R)=>{const P=V==null?void 0:V.serieId;if(P!==x)return x=P,b.jsx(m,{cell:V,text:V==null?void 0:V.serieId,transX:d},`cell-ylabel-${R}`)}),w=({cells:A})=>b.jsx(m,{text:"Goederengroep",transX:d,transY:-20,textStyle:{fontWeight:"bold"}}),M=({cells:A})=>A.map((V,R)=>{const P=V==null?void 0:V.serieId;if(P!==x)return x=P,b.jsx(m,{cell:V,text:h[P].toString(),transX:s,textAnchor:"end"},`cell-ynumeral-${R}`)}),_=({cells:A})=>b.jsx(m,{text:"Invoerwaarde in mln €",transX:s,transY:-20,textStyle:{fontWeight:"bold"},textAnchor:"end"});x=null;const E=({cells:A})=>A.map((V,R)=>{if((V==null?void 0:V.serieId)===x)return b.jsx(p,{cell:V},`cell-ylabel-${R}`)}),O=({cells:A})=>b.jsx(p,{text:"Kritische materialen",transX:(v.width-d)/2-n/2,transY:-(r+l+c+n),rotate:0,textStyle:{fontWeight:"bold"}}),T=()=>b.jsxs("g",{children:[b.jsxs("defs",{children:[b.jsx("marker",{id:"arrow-left",markerWidth:"5",markerHeight:"5",refX:"0",refY:"2.5",orient:"auto",children:b.jsx("path",{d:"M5,0 L0,2.5 L5,5 Z",fill:"black"})}),b.jsx("marker",{id:"arrow-right",markerWidth:"5",markerHeight:"5",refX:"5",refY:"2.5",orient:"auto",children:b.jsx("path",{d:"M0,0 L5,2.5 L0,5 Z",fill:"black"})})]}),b.jsx("line",{x1:"0",y1:-l,x2:v.width-d,y2:-l,stroke:"black",strokeWidth:"1",markerStart:"url(#arrow-left)",markerEnd:"url(#arrow-right)"}),b.jsx("text",{transform:`translate(10, -${l+c})`,children:b.jsx(u9,{children:"Heel kritiek (40 “Zie toelichting”)"})}),b.jsx("text",{textAnchor:"end",transform:`translate(${v.width-d-10}, -${l+c})`,children:b.jsx(u9,{children:"Minder kritiek (0 “Zie toelichting”)"})})]}),k=()=>b.jsxs("g",{children:[b.jsxs("defs",{children:[b.jsx("marker",{id:"arrow-up",markerWidth:"5",markerHeight:"5",refX:"2.5",refY:"2.5",orient:"auto",children:b.jsx("path",{d:"M5,0 L0,2.5 L5,5 Z",fill:"black"})}),b.jsx("marker",{id:"arrow-down",markerWidth:"5",markerHeight:"5",refX:"5",refY:"2.5",orient:"auto",children:b.jsx("path",{d:"M0,0 L5,2.5 L0,5 Z",fill:"black"})})]}),b.jsx("line",{x1:-l,y1:"5",x2:-l,y2:v.height-(n+r+l+c)-80,stroke:"black",strokeWidth:"1",markerStart:"url(#arrow-up)",markerEnd:"url(#arrow-down)"}),b.jsx("text",{transform:`
|
|
588
588
|
translate(-${l+c+J7}, 10) rotate(90)`,children:b.jsx(u9,{children:"Veel ingevoerd"})}),b.jsx("text",{textAnchor:"end",transform:`
|
|
589
589
|
translate(-${l+c+J7},
|
|
590
590
|
${v.height-(n+r+l+c)-10-80})
|