@unovis/mcp 1.7.0-mcp.2 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/codegen/index.js +23 -8
  2. package/dist/codegen/index.js.map +1 -1
  3. package/dist/recipes/bar.d.ts +1 -1
  4. package/dist/recipes/bar.js +4 -1
  5. package/dist/recipes/bar.js.map +1 -1
  6. package/dist/recipes/shared.js +1 -1
  7. package/dist/recipes/shared.js.map +1 -1
  8. package/dist/render/materialize.js +25 -8
  9. package/dist/render/materialize.js.map +1 -1
  10. package/dist/render/spec-schema.d.ts +3 -3
  11. package/dist/render/spec-schema.js +2 -2
  12. package/dist/render/spec-schema.js.map +1 -1
  13. package/dist/render/spec.d.ts +9 -4
  14. package/dist/render/spec.js +8 -3
  15. package/dist/render/spec.js.map +1 -1
  16. package/dist/server.js +12 -3
  17. package/dist/server.js.map +1 -1
  18. package/dist/tools/register.d.ts +11 -1
  19. package/dist/tools/register.js +70 -12
  20. package/dist/tools/register.js.map +1 -1
  21. package/dist/widget/bundle.js +423 -426
  22. package/dist/widget/bundle.meta.json +2 -2
  23. package/dist/widget/bundle.standard.js +215 -218
  24. package/dist/widget/entry.js +79 -2
  25. package/dist/widget/entry.js.map +1 -1
  26. package/dist/widget/events.js +3 -1
  27. package/dist/widget/events.js.map +1 -1
  28. package/dist/widget/unpack.js +1 -1
  29. package/dist/widget/unpack.js.map +1 -1
  30. package/docs/README.md +1 -1
  31. package/docs/architecture.md +12 -89
  32. package/docs/chart-spec.md +15 -12
  33. package/docs/interactive.md +24 -12
  34. package/docs/output-types.md +8 -9
  35. package/docs/tools.md +1 -1
  36. package/docs/troubleshooting.md +13 -44
  37. package/docs/webview.md +4 -6
  38. package/package.json +5 -4
  39. package/schema/{chart-spec.v1.baseline.json → chart-spec.v0.1.baseline.json} +5 -5
  40. package/schema/{chart-spec.v1.json → chart-spec.v0.1.json} +5 -5
@@ -1,18 +1,18 @@
1
- "use strict";(()=>{var U0=Object.defineProperty;var Rt=(t,e)=>{for(var n in e)U0(t,n,{get:e[n],enumerable:!0})};var tl={};Rt(tl,{Area:()=>Og,Axis:()=>Jm,Boxplot:()=>fx,BulletLegend:()=>Js,Crosshair:()=>D0,Donut:()=>Wx,GroupedBar:()=>Vg,Line:()=>Eg,NestedDonut:()=>p0,Plotband:()=>Tx,Plotline:()=>Ix,RadialBar:()=>w0,Scatter:()=>tx,SingleContainer:()=>Zr,StackedBar:()=>Gg,Timeline:()=>sx,Tooltip:()=>C0,XYContainer:()=>Gr,XYLabels:()=>vx});var X0=!1;function q0(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function Z0(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var Ef=(function(){function t(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!X0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Z0(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=q0(i);try{o.insertRule(r,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},t})();var Ot="-ms-",ui="-moz-",J="-webkit-",No="comm",fr="rule",hr="decl";var Lf="@import";var Po="@keyframes";var $f="@layer";var If=Math.abs,En=String.fromCharCode,Bf=Object.assign;function Of(t,e){return _t(t,0)^45?(((e<<2^_t(t,0))<<2^_t(t,1))<<2^_t(t,2))<<2^_t(t,3):0}function Fo(t){return t.trim()}function rl(t,e){return(t=e.exec(t))?t[0]:t}function j(t,e,n){return t.replace(e,n)}function fi(t,e){return t.indexOf(e)}function _t(t,e){return t.charCodeAt(e)|0}function pn(t,e,n){return t.slice(e,n)}function Gt(t){return t.length}function dr(t){return t.length}function pr(t,e){return e.push(t),t}function il(t,e){return t.map(e).join("")}var zo=1,mr=1,Nf=0,Ut=0,Ct=0,xr="";function hi(t,e,n,r,i,o,a){return{value:t,root:e,parent:n,type:r,props:i,children:o,line:zo,column:mr,length:a,return:""}}function yr(t,e){return Bf(hi("",null,null,"",null,null,0),t,{length:-t.length},e)}function Pf(){return Ct}function Ff(){return Ct=Ut>0?_t(xr,--Ut):0,mr--,Ct===10&&(mr=1,zo--),Ct}function Xt(){return Ct=Ut<Nf?_t(xr,Ut++):0,mr++,Ct===10&&(mr=1,zo++),Ct}function ce(){return _t(xr,Ut)}function di(){return Ut}function vr(t,e){return pn(xr,t,e)}function gr(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Vo(t){return zo=mr=1,Nf=Gt(xr=t),Ut=0,[]}function Wo(t){return xr="",t}function br(t){return Fo(vr(Ut-1,ol(t===91?t+2:t===40?t+1:t)))}function zf(t){for(;(Ct=ce())&&Ct<33;)Xt();return gr(t)>2||gr(Ct)>3?"":" "}function Vf(t,e){for(;--e&&Xt()&&!(Ct<48||Ct>102||Ct>57&&Ct<65||Ct>70&&Ct<97););return vr(t,di()+(e<6&&ce()==32&&Xt()==32))}function ol(t){for(;Xt();)switch(Ct){case t:return Ut;case 34:case 39:t!==34&&t!==39&&ol(Ct);break;case 40:t===41&&ol(t);break;case 92:Xt();break}return Ut}function Wf(t,e){for(;Xt()&&t+Ct!==57;)if(t+Ct===84&&ce()===47)break;return"/*"+vr(e,Ut-1)+"*"+En(t===47?t:Xt())}function Hf(t){for(;!gr(ce());)Xt();return vr(t,Ut)}function Uf(t){return Wo(Ho("",null,null,null,[""],t=Vo(t),0,[0],t))}function Ho(t,e,n,r,i,o,a,s,c){for(var l=0,u=0,f=a,h=0,d=0,g=0,p=1,x=1,y=1,b=0,v="",m=i,_=o,w=r,k=v;x;)switch(g=b,b=Xt()){case 40:if(g!=108&&_t(k,f-1)==58){fi(k+=j(br(b),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:k+=br(b);break;case 9:case 10:case 13:case 32:k+=zf(g);break;case 92:k+=Vf(di()-1,7);continue;case 47:switch(ce()){case 42:case 47:pr(j0(Wf(Xt(),di()),e,n),c);break;default:k+="/"}break;case 123*p:s[l++]=Gt(k)*y;case 125*p:case 59:case 0:switch(b){case 0:case 125:x=0;case 59+u:y==-1&&(k=j(k,/\f/g,"")),d>0&&Gt(k)-f&&pr(d>32?Gf(k+";",r,n,f-1):Gf(j(k," ","")+";",r,n,f-2),c);break;case 59:k+=";";default:if(pr(w=Yf(k,e,n,l,u,i,s,v,m=[],_=[],f),o),b===123)if(u===0)Ho(k,e,w,w,m,o,f,s,_);else switch(h===99&&_t(k,3)===110?100:h){case 100:case 108:case 109:case 115:Ho(t,w,w,r&&pr(Yf(t,w,w,0,0,i,s,v,i,m=[],f),_),i,_,f,s,r?m:_);break;default:Ho(k,w,w,w,[""],_,0,s,_)}}l=u=d=0,p=y=1,v=k="",f=a;break;case 58:f=1+Gt(k),d=g;default:if(p<1){if(b==123)--p;else if(b==125&&p++==0&&Ff()==125)continue}switch(k+=En(b),b*p){case 38:y=u>0?1:(k+="\f",-1);break;case 44:s[l++]=(Gt(k)-1)*y,y=1;break;case 64:ce()===45&&(k+=br(Xt())),h=ce(),u=f=Gt(v=k+=Hf(di())),b++;break;case 45:g===45&&Gt(k)==2&&(p=0)}}return o}function Yf(t,e,n,r,i,o,a,s,c,l,u){for(var f=i-1,h=i===0?o:[""],d=dr(h),g=0,p=0,x=0;g<r;++g)for(var y=0,b=pn(t,f+1,f=If(p=a[g])),v=t;y<d;++y)(v=Fo(p>0?h[y]+" "+b:j(b,/&\f/g,h[y])))&&(c[x++]=v);return hi(t,e,n,i===0?fr:s,c,l,u)}function j0(t,e,n){return hi(t,e,n,No,En(Pf()),pn(t,2,-2),0)}function Gf(t,e,n,r){return hi(t,e,n,hr,pn(t,0,r),pn(t,r+1,-1),r)}function Ln(t,e){for(var n="",r=dr(t),i=0;i<r;i++)n+=e(t[i],i,t,e)||"";return n}function Xf(t,e,n,r){switch(t.type){case $f:if(t.children.length)break;case Lf:case hr:return t.return=t.return||t.value;case No:return"";case Po:return t.return=t.value+"{"+Ln(t.children,r)+"}";case fr:t.value=t.props.join(",")}return Gt(n=Ln(t.children,r))?t.return=t.value+"{"+n+"}":""}function qf(t){var e=dr(t);return function(n,r,i,o){for(var a="",s=0;s<e;s++)a+=t[s](n,r,i,o)||"";return a}}function Zf(t){return function(e){e.root||(e=e.return)&&t(e)}}function jf(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var K0=function(e,n,r){for(var i=0,o=0;i=o,o=ce(),i===38&&o===12&&(n[r]=1),!gr(o);)Xt();return vr(e,Ut)},Q0=function(e,n){var r=-1,i=44;do switch(gr(i)){case 0:i===38&&ce()===12&&(n[r]=1),e[r]+=K0(Ut-1,n,r);break;case 2:e[r]+=br(i);break;case 4:if(i===44){e[++r]=ce()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=En(i)}while(i=Xt());return e},J0=function(e,n){return Wo(Q0(Vo(e),n))},Kf=new WeakMap,ty=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!Kf.get(r))&&!i){Kf.set(e,!0);for(var o=[],a=J0(n,o),s=r.props,c=0,l=0;c<a.length;c++)for(var u=0;u<s.length;u++,l++)e.props[l]=o[c]?a[c].replace(/&\f/g,s[u]):s[u]+" "+a[c]}}},ey=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function Qf(t,e){switch(Of(t,e)){case 5103:return J+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return J+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return J+t+ui+t+Ot+t+t;case 6828:case 4268:return J+t+Ot+t+t;case 6165:return J+t+Ot+"flex-"+t+t;case 5187:return J+t+j(t,/(\w+).+(:[^]+)/,J+"box-$1$2"+Ot+"flex-$1$2")+t;case 5443:return J+t+Ot+"flex-item-"+j(t,/flex-|-self/,"")+t;case 4675:return J+t+Ot+"flex-line-pack"+j(t,/align-content|flex-|-self/,"")+t;case 5548:return J+t+Ot+j(t,"shrink","negative")+t;case 5292:return J+t+Ot+j(t,"basis","preferred-size")+t;case 6060:return J+"box-"+j(t,"-grow","")+J+t+Ot+j(t,"grow","positive")+t;case 4554:return J+j(t,/([^-])(transform)/g,"$1"+J+"$2")+t;case 6187:return j(j(j(t,/(zoom-|grab)/,J+"$1"),/(image-set)/,J+"$1"),t,"")+t;case 5495:case 3959:return j(t,/(image-set\([^]*)/,J+"$1$`$1");case 4968:return j(j(t,/(.+:)(flex-)?(.*)/,J+"box-pack:$3"+Ot+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+J+t+t;case 4095:case 3583:case 4068:case 2532:return j(t,/(.+)-inline(.+)/,J+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Gt(t)-1-e>6)switch(_t(t,e+1)){case 109:if(_t(t,e+4)!==45)break;case 102:return j(t,/(.+:)(.+)-([^]+)/,"$1"+J+"$2-$3$1"+ui+(_t(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~fi(t,"stretch")?Qf(j(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(_t(t,e+1)!==115)break;case 6444:switch(_t(t,Gt(t)-3-(~fi(t,"!important")&&10))){case 107:return j(t,":",":"+J)+t;case 101:return j(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+J+(_t(t,14)===45?"inline-":"")+"box$3$1"+J+"$2$3$1"+Ot+"$2box$3")+t}break;case 5936:switch(_t(t,e+11)){case 114:return J+t+Ot+j(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return J+t+Ot+j(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return J+t+Ot+j(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return J+t+Ot+t+t}return t}var ny=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case hr:e.return=Qf(e.value,e.length);break;case Po:return Ln([yr(e,{value:j(e.value,"@","@"+J)})],i);case fr:if(e.length)return il(e.props,function(o){switch(rl(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ln([yr(e,{props:[j(o,/:(read-\w+)/,":"+ui+"$1")]})],i);case"::placeholder":return Ln([yr(e,{props:[j(o,/:(plac\w+)/,":"+J+"input-$1")]}),yr(e,{props:[j(o,/:(plac\w+)/,":"+ui+"$1")]}),yr(e,{props:[j(o,/:(plac\w+)/,Ot+"input-$1")]})],i)}return""})}},ry=[ny],Jf=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var x=p.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=e.stylisPlugins||ry,o={},a,s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var x=p.getAttribute("data-emotion").split(" "),y=1;y<x.length;y++)o[x[y]]=!0;s.push(p)});var c,l=[ty,ey];{var u,f=[Xf,Zf(function(p){u.insert(p)})],h=qf(l.concat(i,f)),d=function(x){return Ln(Uf(x),h)};c=function(x,y,b,v){u=b,d(x?x+"{"+y.styles+"}":y.styles),v&&(g.inserted[y.name]=!0)}}var g={key:n,sheet:new Ef({key:n,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:c};return g.sheet.hydrate(s),g};function th(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var eh={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var iy=!1,oy=/[A-Z]|^ms/g,ay=/_EMO_([^_]+?)_([^]*?)_EMO_/g,oh=function(e){return e.charCodeAt(1)===45},nh=function(e){return e!=null&&typeof e!="boolean"},al=jf(function(t){return oh(t)?t:t.replace(oy,"-$&").toLowerCase()}),rh=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(ay,function(r,i,o){return $e={name:i,styles:o,next:$e},i})}return eh[e]!==1&&!oh(e)&&typeof n=="number"&&n!==0?n+"px":n},sy="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function pi(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return $e={name:i.name,styles:i.styles,next:$e},i.name;var o=n;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)$e={name:a.name,styles:a.styles,next:$e},a=a.next;var s=o.styles+";";return s}return ly(t,e,n)}case"function":{if(t!==void 0){var c=$e,l=n(t);return $e=c,pi(t,e,l)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function ly(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=pi(t,e,n[i])+";";else for(var o in n){var a=n[o];if(typeof a!="object"){var s=a;e!=null&&e[s]!==void 0?r+=o+"{"+e[s]+"}":nh(s)&&(r+=al(o)+":"+rh(o,s)+";")}else{if(o==="NO_COMPONENT_SELECTOR"&&iy)throw new Error(sy);if(Array.isArray(a)&&typeof a[0]=="string"&&(e==null||e[a[0]]===void 0))for(var c=0;c<a.length;c++)nh(a[c])&&(r+=al(o)+":"+rh(o,a[c])+";");else{var l=pi(t,e,a);switch(o){case"animation":case"animationName":{r+=al(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}}return r}var ih=/label:\s*([^\s;{]+)\s*(;|$)/g,$e;function Yo(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,i="";$e=void 0;var o=t[0];if(o==null||o.raw===void 0)r=!1,i+=pi(n,e,o);else{var a=o;i+=a[0]}for(var s=1;s<t.length;s++)if(i+=pi(n,e,t[s]),r){var c=o;i+=c[s]}ih.lastIndex=0;for(var l="",u;(u=ih.exec(i))!==null;)l+="-"+u[1];var f=th(i)+l;return{name:f,styles:i,next:$e}}var cy=!0;function sl(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):i&&(r+=i+" ")}),r}var uy=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||cy===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},ah=function(e,n,r){uy(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var o=n;do e.insert(n===o?"."+i:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function sh(t,e){if(t.inserted[e.name]===void 0)return t.insert("",e,t.sheet,!0)}function lh(t,e,n){var r=[],i=sl(t,r,n);return r.length<2?n:i+e(r)}var ch=function(e){var n=Jf(e);n.sheet.speedy=function(s){this.isSpeedy=s},n.compat=!0;var r=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var f=Yo(l,n.registered,void 0);return ah(n,f,!1),n.key+"-"+f.name},i=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var f=Yo(l,n.registered),h="animation-"+f.name;return sh(n,{name:f.name,styles:"@keyframes "+h+"{"+f.styles+"}"}),h},o=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var f=Yo(l,n.registered);sh(n,f)},a=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];return lh(n.registered,r,fy(l))};return{css:r,cx:a,injectGlobal:o,keyframes:i,hydrate:function(c){c.forEach(function(l){n.inserted[l]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:sl.bind(null,n.registered),merge:lh.bind(null,n.registered,r)}},fy=function t(e){for(var n="",r=0;r<e.length;r++){var i=e[r];if(i!=null){var o=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))o=t(i);else{o="";for(var a in i)i[a]&&a&&(o&&(o+=" "),o+=a)}break}default:o=i}o&&(n&&(n+=" "),n+=o)}}return n};var Ie=ch({key:"css"}),ZS=Ie.flush,jS=Ie.hydrate,KS=Ie.cx,QS=Ie.merge,JS=Ie.getRegisteredStyles,lt=Ie.injectGlobal,tk=Ie.keyframes,C=Ie.css,ek=Ie.sheet,nk=Ie.cache;function jt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ll(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function $n(t){let e,n,r;t.length!==2?(e=jt,n=(s,c)=>jt(t(s),c),r=(s,c)=>t(s)-c):(e=t===jt||t===ll?t:hy,n=t,r=t);function i(s,c,l=0,u=s.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;n(s[f],c)<0?l=f+1:u=f}while(l<u)}return l}function o(s,c,l=0,u=s.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;n(s[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function a(s,c,l=0,u=s.length){let f=i(s,c,l,u-1);return f>l&&r(s[f-1],c)>-r(s[f],c)?f-1:f}return{left:i,center:a,right:o}}function hy(){return 0}function mi(t){return t===null?NaN:+t}var uh=$n(jt),Go=uh.right,cl=uh.left,dy=$n(mi).center,je=Go;function Uo(t,e){let n,r;if(e===void 0)for(let i of t)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}var mn=class extends Map{constructor(e,n=gy){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let[r,i]of e)this.set(r,i)}get(e){return super.get(fh(this,e))}has(e){return super.has(fh(this,e))}set(e,n){return super.set(py(this,e),n)}delete(e){return super.delete(my(this,e))}};function fh({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):n}function py({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function my({_intern:t,_key:e},n){let r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function gy(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Xo(t){return t}function qo(t,...e){return xy(t,Xo,Xo,e)}function xy(t,e,n,r){return(function i(o,a){if(a>=r.length)return n(o);let s=new mn,c=r[a++],l=-1;for(let u of o){let f=c(u,++l,o),h=s.get(f);h?h.push(u):s.set(f,[u])}for(let[u,f]of s)s.set(u,i(f,a));return e(s)})(t,0)}var yy=Math.sqrt(50),vy=Math.sqrt(10),by=Math.sqrt(2);function Zo(t,e,n){let r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=yy?10:o>=vy?5:o>=by?2:1,s,c,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?Zo(t,e,n*2):[s,c,l]}function In(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];let r=e<t,[i,o,a]=r?Zo(e,t,n):Zo(t,e,n);if(!(o>=i))return[];let s=o-i+1,c=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)c[l]=(o-l)/-a;else for(let l=0;l<s;++l)c[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)c[l]=(i+l)/-a;else for(let l=0;l<s;++l)c[l]=(i+l)*a;return c}function gi(t,e,n){return e=+e,t=+t,n=+n,Zo(t,e,n)[2]}function _r(t,e,n){e=+e,t=+t,n=+n;let r=e<t,i=r?gi(e,t,n):gi(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function pt(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function wt(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function xi(t,e){let n,r=-1,i=-1;if(e===void 0)for(let o of t)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function ul(t,e,n=mi){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),s=+n(t[o+1],o+1,t);return a+(s-a)*(i-o)}}function Bn(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function*_y(t){for(let e of t)yield*e}function jo(t){return Array.from(_y(t))}function wr(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}function Ko(t,e=jt){let n,r=!1;if(e.length===1){let i;for(let o of t){let a=e(o);(r?jt(a,i)<0:jt(a,a)===0)&&(n=o,i=a,r=!0)}}else for(let i of t)(r?e(i,n)<0:e(i,i)===0)&&(n=i,r=!0);return n}function Qo(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function hh(t,e,n){var r=n||{},i=r.noTrailing,o=i===void 0?!1:i,a=r.noLeading,s=a===void 0?!1:a,c=r.debounceMode,l=c===void 0?void 0:c,u,f=!1,h=0;function d(){u&&clearTimeout(u)}function g(x){var y=x||{},b=y.upcomingOnly,v=b===void 0?!1:b;d(),f=!v}function p(){for(var x=arguments.length,y=new Array(x),b=0;b<x;b++)y[b]=arguments[b];var v=this,m=Date.now()-h;if(f)return;function _(){h=Date.now(),e.apply(v,y)}function w(){u=void 0}!s&&l&&!u&&_(),d(),l===void 0&&m>t?s?(h=Date.now(),o||(u=setTimeout(l?w:_,t))):_():o!==!0&&(u=setTimeout(l?w:_,l===void 0?t-m:t))}return p.cancel=g,p}var Be=(t=>(t.Left="left",t.Right="right",t.Auto="auto",t))(Be||{});var U=t=>typeof t=="number",Kt=t=>typeof t=="function";var fl=t=>typeof t=="string",At=t=>Array.isArray(t),wy=t=>t instanceof Object,hl=t=>t.constructor.name!=="Function"&&t.constructor.name!=="Object",Jo=t=>wy(t)&&!At(t)&&!Kt(t)&&!hl(t),On=t=>[Object,Array].includes((t||{}).constructor)&&!Object.entries(t||{}).length,Ke=(t,e,n=[],r=new Set)=>{if(t===e)return!0;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;if(r.has(t))return!0;r.add(t);for(let i=0;i<t.length;i++)if(!Ke(t[i],e[i],n,r))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(typeof t=="object"&&t!==null&&e!==null){if(typeof e!="object")return!1;if(t===e)return!0;let i=Object.keys(t).filter(a=>!n.includes(a)),o=Object.keys(e).filter(a=>!n.includes(a));if(i.length!==o.length)return!1;if(r.has(t))return!0;r.add(t);for(let a of i)if(!Ke(t[a],e[a],n,r))return!1;return!0}return t===e};var gn=t=>t.flat(),yi=(t,e=new Map)=>{if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let n=[];e.set(t,n);for(let r of t)n.push(e.has(r)?e.get(r):yi(r,e));return n}if(hl(t))return t;if(t instanceof Object){let n={};e.set(t,n);let r=t;return Object.keys(t).reduce((i,o)=>(i[o]=e.has(r[o])?e.get(r[o]):yi(r[o],e),i),n),n}return t},Qt=(t,e,n=new Map)=>{if(!t||!e)return t&&yi(t);if(t===e)return t;let r=hl(t)?t:yi(t);return n.has(e)?n.get(e):(n.set(e,r),Object.keys(e).forEach(i=>{i==="__proto__"||i==="constructor"||(Jo(t[i])&&Jo(e[i])?r[i]=Qt(t[i],e[i],n):r[i]=yi(e[i]))}),r)};var dh=(t,e)=>t.reduce((n,r,i,o,a=e(r,i))=>((n[a]||(n[a]=[])).push(r),n),{});var Sr=(t,e,n)=>hh(e,t,n);function K(t,e,n){return Kt(e)?e(t,n):e}function G(t,e,n){return K(t,e,n)}function L(t,e,n){return K(t,e,n)}function kr(t){return t.filter(e=>e&&!U(e))}function it(t,e,n){return Math.min(Math.max(t,e),n)}function ph(t){return[...Array(t).keys()]}function ta(t,e,...n){if(!t)return[void 0,void 0];if(At(n)){let r,i;return t.forEach((o,a)=>{let s=L(o,e,a)||0,c=s,l=s;for(let u of n){let f=L(o,u,a)||0;f>=0?c+=f:l+=f}(i===void 0||c>i)&&(i=c),(r===void 0||l<r)&&(r=l)}),[r??0,i??0]}}function dl(t,e,...n){let r=[],i=0,o=0;for(let a of n){let s=L(t,a,e)||0;s>=0?r.push(i+=s):r.push(o+=s)}return r}function ea(t,e,n,r){let i=t.map((s,c)=>L(s,e,c)||0),o=n.map((s,c)=>{let l=Bn(t,(u,f)=>L(u,s,f)||0);return l===0&&Array.isArray(r)?r[c]:l<0}),a=n.map(()=>[]);return t.forEach((s,c)=>{let l=i[c],u=i[c];n.forEach((f,h)=>{let d=L(s,f,c)||0;d>=0?a[h].push([l,l+=d]):a[h].push([u,u+=d])})}),a.forEach((s,c)=>{s.isMostlyNegative=o[c]}),a}function Nn(t,...e){return t?wt(t,(r,i)=>wt(e,o=>L(r,o,i))):void 0}function Pn(t,...e){return t?pt(t,(r,i)=>pt(e,o=>L(r,o,i))):void 0}function ue(t,...e){return[Nn(t,...e),Pn(t,...e)]}function vi(t,e,n,r=Be.Auto){if(t.length<=1)return t[0];let o=t.map((c,l)=>[c,l]).sort(([c,l],[u,f])=>L(c,n,l)-L(u,n,f)),a=o.map(([c,l])=>L(c,n,l)),s=r===Be.Right?cl(a,e,0,t.length-1):Go(a,e,1,t.length);return r===Be.Right?o[s][0]:r===Be.Left?o[s-1][0]:e-a[s-1]>a[s]-e?o[s][0]:o[s-1][0]}function mh(t,e,n,r,i,o=[],a=[],s){if(!t?.length||!i)return;let[c,l]=e,u,f=-1,h=1/0;for(let d=0;d<t.length;d++){let g=t[d],p=n(L(g,i,d));if(!isFinite(p))continue;let x=(p-c)**2;if(a.length){let y=L(g,s,d)||0,b=dl(g,d,...a);for(let v=0;v<b.length;v++){if(!U(L(g,a[v],v)))continue;let m=r(b[v]+y),_=x+(m-l)**2;_<h&&(h=_,u=g,f=d)}}for(let y=0;y<o.length;y++){let b=L(g,o[y],d);if(!U(b))continue;let v=r(b),m=x+(v-l)**2;m<h&&(h=m,u=g,f=d)}}if(f!==-1)return{datum:u,index:f,distanceSq:h}}function na(t,e,n,r=!1){if(!n)return[];let i=t.filter((o,a)=>{let s=L(o,n,a);return s>=e[0]&&s<=e[1]});if(r){if(i.length===0){let f=vi(t,e[0],n,Be.Left),h=vi(t,e[1],n,Be.Right);return[f,h].filter(Boolean)}let o=i[0],a=i[i.length-1],s=t.findIndex(f=>f===o),c=t.findIndex(f=>f===a),l=Math.max(0,s-1),u=Math.min(t.length-1,c+1);return t.slice(l,u+1)}return i}function bi(t,e){return t>=e[0]&&t<=e[1]||t>=e[1]&&t<=e[0]}var gh=t=>t==null?[]:Array.isArray(t)?t:[t];function pl(t){t=String(t);let e=parseFloat(t),n=t.match(/[\d.\-+]*\s*(.*)/)?.[1]||"";return[e,n]}function xh(){return typeof window<"u"&&typeof document<"u"}function ml(t,e){let n=pl(getComputedStyle(t).getPropertyValue(e));return n[0]*(Jt(n[1],t)??1)}function yh(t,e){let n=document.createElement("div");n.style.height=`128${t}`,e.appendChild(n);let r=ml(n,"height")/128;return e.removeChild(n),r}var ra=null;function _i(){return xh()?(ra===null&&(ra=96,ra=yh("in",document.body)),ra):96}function Jt(t,e){if(!t&&t!==0)return null;if(!xh()){let o=pl(String(t));if(!isNaN(o[0])){let a=o[1]?.toLowerCase()||"px";if(a==="px"||a==="")return o[0];if(a==="em"||a==="rem")return o[0]*16;if(a==="in")return o[0]*96;if(a==="cm")return o[0]*(96/2.54);if(a==="mm")return o[0]*(96/25.4);if(a==="pt")return o[0]*(96/72);if(a==="pc")return o[0]*(96/6)}return null}let n=document.body;e&&e!==window&&e!==document&&(n=e);let r=(String(t)||"px").trim().toLowerCase();switch(r){case"%":return n.clientHeight/100;case"ch":case"ex":return yh(r,n);case"em":return ml(n,"font-size");case"rem":return ml(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return _i();case"cm":return _i()/2.54;case"mm":return _i()/25.4;case"pt":return _i()/72;case"pc":return _i()/6;case"px":return 1}let i=pl(r);if(!isNaN(i[0])){if(i[1]){let o=Jt(i[1],n);return typeof o=="number"?i[0]*o:null}return i[0]}return null}function Cr(){let t=()=>Math.floor((1+crypto.getRandomValues(new Uint32Array(1))[0])*65536).toString(16).substring(1);return`${t()+t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`}function bh(t){return(t||"").replace(/\W/g,"_")}function Tr(t){return fl(t)?t.substring(0,6)==="var(--":!1}var vh=new WeakMap;function Qe(t,e){if(!fl(t))return"";let n=t.substr(4,t.length-5),r=vh.get(e);if(r||(r=new Map,vh.set(e,r)),r.has(n))return r.get(n);let i=getComputedStyle(e).getPropertyValue(n);return r.set(n,i),i}function te(t,e){let n=Qe(t,e);return Jt(n)}function wi(t){return typeof t=="number"?t:Jt(t)}function _h(t,e){let n=Math.sin(e),r=Math.cos(e),i=[[t.x,t.y],[t.x+t.width,t.y],[t.x,t.y+t.height],[t.x+t.width,t.y+t.height]],o=i.map(([l,u])=>l*r-u*n),a=i.map(([l,u])=>l*n+u*r),s=Math.min(...o),c=Math.min(...a);return{x:s,y:c,width:Math.max(...o)-s,height:Math.max(...a)-c}}function Je(t,e,n=0){let[r,i,o,a]=[t.x+n,t.y+t.height-2*n,t.x+t.width-2*n,t.y+n],[s,c,l,u]=[e.x+n,e.y+e.height-2*n,e.x+e.width-2*n,e.y+n];return!(i<u||c<a||o<s||l<r)}var St='html[data-theme="dark"],html.dark-theme,body.dark-theme,html.theme-dark,body.theme-dark';function ia(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function gl(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ci(){}var Si=.7,sa=1/Si,Ar="\\s*([+-]?\\d+)\\s*",ki="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Oe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Sy=/^#([0-9a-f]{3,8})$/,ky=new RegExp(`^rgb\\(${Ar},${Ar},${Ar}\\)$`),Cy=new RegExp(`^rgb\\(${Oe},${Oe},${Oe}\\)$`),Ty=new RegExp(`^rgba\\(${Ar},${Ar},${Ar},${ki}\\)$`),Ay=new RegExp(`^rgba\\(${Oe},${Oe},${Oe},${ki}\\)$`),My=new RegExp(`^hsl\\(${ki},${Oe},${Oe}\\)$`),Dy=new RegExp(`^hsla\\(${ki},${Oe},${Oe},${ki}\\)$`),wh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ia(Ci,gt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Sh,formatHex:Sh,formatHex8:Ry,formatHsl:Ey,formatRgb:kh,toString:kh});function Sh(){return this.rgb().formatHex()}function Ry(){return this.rgb().formatHex8()}function Ey(){return Rh(this).formatHsl()}function kh(){return this.rgb().formatRgb()}function gt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Sy.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Ch(e):n===3?new ee(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?oa(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?oa(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=ky.exec(t))?new ee(e[1],e[2],e[3],1):(e=Cy.exec(t))?new ee(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ty.exec(t))?oa(e[1],e[2],e[3],e[4]):(e=Ay.exec(t))?oa(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=My.exec(t))?Mh(e[1],e[2]/100,e[3]/100,1):(e=Dy.exec(t))?Mh(e[1],e[2]/100,e[3]/100,e[4]):wh.hasOwnProperty(t)?Ch(wh[t]):t==="transparent"?new ee(NaN,NaN,NaN,0):null}function Ch(t){return new ee(t>>16&255,t>>8&255,t&255,1)}function oa(t,e,n,r){return r<=0&&(t=e=n=NaN),new ee(t,e,n,r)}function Ly(t){return t instanceof Ci||(t=gt(t)),t?(t=t.rgb(),new ee(t.r,t.g,t.b,t.opacity)):new ee}function Mr(t,e,n,r){return arguments.length===1?Ly(t):new ee(t,e,n,r??1)}function ee(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ia(ee,Mr,gl(Ci,{brighter(t){return t=t==null?sa:Math.pow(sa,t),new ee(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Si:Math.pow(Si,t),new ee(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ee(zn(this.r),zn(this.g),zn(this.b),la(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Th,formatHex:Th,formatHex8:$y,formatRgb:Ah,toString:Ah}));function Th(){return`#${Fn(this.r)}${Fn(this.g)}${Fn(this.b)}`}function $y(){return`#${Fn(this.r)}${Fn(this.g)}${Fn(this.b)}${Fn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ah(){let t=la(this.opacity);return`${t===1?"rgb(":"rgba("}${zn(this.r)}, ${zn(this.g)}, ${zn(this.b)}${t===1?")":`, ${t})`}`}function la(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function zn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Fn(t){return t=zn(t),(t<16?"0":"")+t.toString(16)}function Mh(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Se(t,e,n,r)}function Rh(t){if(t instanceof Se)return new Se(t.h,t.s,t.l,t.opacity);if(t instanceof Ci||(t=gt(t)),!t)return new Se;if(t instanceof Se)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,c=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new Se(a,s,c,t.opacity)}function Ti(t,e,n,r){return arguments.length===1?Rh(t):new Se(t,e,n,r??1)}function Se(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ia(Se,Ti,gl(Ci,{brighter(t){return t=t==null?sa:Math.pow(sa,t),new Se(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Si:Math.pow(Si,t),new Se(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ee(xl(t>=240?t-240:t+120,i,r),xl(t,i,r),xl(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Se(Dh(this.h),aa(this.s),aa(this.l),la(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=la(this.opacity);return`${t===1?"hsl(":"hsla("}${Dh(this.h)}, ${aa(this.s)*100}%, ${aa(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Dh(t){return t=(t||0)%360,t<0?t+360:t}function aa(t){return Math.max(0,Math.min(1,t||0))}function xl(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var Ne=globalThis?.UNOVIS_COLORS||["#4D8CFD","#FF6B7E","#F4B83E","#A6CC74","#00C19A","#6859BE"],Eh=globalThis?.UNOVIS_COLORS_DARK||["#4D8CFD","#FF6B7E","#FFC16D","#A6CC74","#00C19A","#7887E0"],xn=t=>`--vis-${U(t)?`color${t%Ne.length}`:t}`;function Lh(t,e=.4){let n=Ti(t);return n.l=n.l*(1+e),n.formatHex()}function $h(t,e=.4,n=.6){let r=Ti(t);return r.s=r.s*(1-n),r.l=r.l*(1-e),r.formatHex()}var Pe=10,Ai=[{id:"stripes-diagonal",svg:'<path d="M-1,1 l2,-2 M0,10 l10,-10 M9,11 l2,-2" stroke="#000"/>'},{id:"dots",svg:'<path d="m0-1.5a1 1 0 010 3m10-3a1 1 0 000 3M5 3.5a1 1 0 010 3 1 1 0 010-3M0 8.5 a1 1 0 010 3m10-3a1 1 0 000 3" fill"#000"/>'},{id:"stripes-vertical",svg:'<path d="M 5,-1 L5,11" stroke="#000"/>'},{id:"crosshatch",svg:'<path d="M0 0L10 10ZM10 0L0 10Z" stroke="#000"/>'},{id:"waves",svg:'<path d="M0 4Q2.5 1 5 4 7.5 7 10 4v2Q7.5 9 5 6 2.5 3 0 6Z" fill="#000"/>'},{id:"circles",svg:'<circle cx="5" cy="5" r="3" stroke="#000" fill="#fff"/>'}],Dr=[{id:"circle",marker:'<circle cx="5" cy="5" r="5"/>',dashArray:[]},{id:"triangle",marker:'<path d="M5,0 L10,9 L0,9Z">',dashArray:[9,1]},{id:"diamond",marker:'<path d="M 0 5 L5 0 L 10 5 L 5 10 L 0 5Z">',dashArray:[2]},{id:"arrow",marker:'<path d="M4 0 0 0 6 5 0 10 4 10 10 5Z">',dashArray:[2,3,8,3]},{id:"square",marker:'<rect x="1" y="1" width="8" height="8"/>',dashArray:[6]},{id:"star",marker:'<path d="m2 9 3-9 3 9L0 3h10Z"/>',dashArray:[1,6]}],Iy=new Map(Ai.map(t=>[t.id,t])),By=new Map(Dr.map(t=>[t.id,t]));function Vn(t){return`vis-${`pattern-${t.svg?"fill":"marker"}`}-${t.id}`}function yl(t){return`vis-pattern-fill-${t}`}function vl(t){return`vis-pattern-marker-${t}`}function bl(t){return`vis-pattern-marker-ctx-${t}`}function Ih(t){return Iy.get(t)??By.get(t)??null}var Oy=t=>`<mask id="${yl(t.id)}">
1
+ "use strict";(()=>{var ay=Object.defineProperty;var Lt=(t,e)=>{for(var n in e)ay(t,n,{get:e[n],enumerable:!0})};var hl={};Lt(hl,{Area:()=>Ug,Axis:()=>cg,Boxplot:()=>Sx,BulletLegend:()=>fl,Crosshair:()=>V0,Donut:()=>t0,GroupedBar:()=>Qg,Line:()=>Vg,NestedDonut:()=>A0,Plotband:()=>Px,Plotline:()=>Ux,RadialBar:()=>I0,Scatter:()=>hx,SingleContainer:()=>ri,StackedBar:()=>rx,Timeline:()=>vx,Tooltip:()=>B0,XYContainer:()=>jr,XYLabels:()=>Ex});var bl={};Lt(bl,{cache:()=>Ny,css:()=>Iy,cx:()=>Ly,flush:()=>Cy,getRegisteredStyles:()=>Ey,hydrate:()=>My,injectGlobal:()=>Dy,keyframes:()=>$y,merge:()=>Ry,sheet:()=>Oy});var ly=!1;function cy(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function uy(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var Hf=(function(){function t(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!ly:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(uy(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=cy(i);try{o.insertRule(r,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},t})();var Pt="-ms-",pi="-moz-",nt="-webkit-",Wo="comm",mr="rule",gr="decl";var Yf="@import";var Ho="@keyframes";var Gf="@layer";var Uf=Math.abs,$n=String.fromCharCode,Xf=Object.assign;function qf(t,e){return kt(t,0)^45?(((e<<2^kt(t,0))<<2^kt(t,1))<<2^kt(t,2))<<2^kt(t,3):0}function Yo(t){return t.trim()}function ml(t,e){return(t=e.exec(t))?t[0]:t}function J(t,e,n){return t.replace(e,n)}function mi(t,e){return t.indexOf(e)}function kt(t,e){return t.charCodeAt(e)|0}function pn(t,e,n){return t.slice(e,n)}function Xt(t){return t.length}function xr(t){return t.length}function yr(t,e){return e.push(t),t}function gl(t,e){return t.map(e).join("")}var Go=1,vr=1,jf=0,qt=0,Mt=0,_r="";function gi(t,e,n,r,i,o,s){return{value:t,root:e,parent:n,type:r,props:i,children:o,line:Go,column:vr,length:s,return:""}}function wr(t,e){return Xf(gi("",null,null,"",null,null,0),t,{length:-t.length},e)}function Zf(){return Mt}function Kf(){return Mt=qt>0?kt(_r,--qt):0,vr--,Mt===10&&(vr=1,Go--),Mt}function jt(){return Mt=qt<jf?kt(_r,qt++):0,vr++,Mt===10&&(vr=1,Go++),Mt}function ue(){return kt(_r,qt)}function xi(){return qt}function Sr(t,e){return pn(_r,t,e)}function br(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Uo(t){return Go=vr=1,jf=Xt(_r=t),qt=0,[]}function Xo(t){return _r="",t}function kr(t){return Yo(Sr(qt-1,xl(t===91?t+2:t===40?t+1:t)))}function Qf(t){for(;(Mt=ue())&&Mt<33;)jt();return br(t)>2||br(Mt)>3?"":" "}function Jf(t,e){for(;--e&&jt()&&!(Mt<48||Mt>102||Mt>57&&Mt<65||Mt>70&&Mt<97););return Sr(t,xi()+(e<6&&ue()==32&&jt()==32))}function xl(t){for(;jt();)switch(Mt){case t:return qt;case 34:case 39:t!==34&&t!==39&&xl(Mt);break;case 40:t===41&&xl(t);break;case 92:jt();break}return qt}function th(t,e){for(;jt()&&t+Mt!==57;)if(t+Mt===84&&ue()===47)break;return"/*"+Sr(e,qt-1)+"*"+$n(t===47?t:jt())}function eh(t){for(;!br(ue());)jt();return Sr(t,qt)}function ih(t){return Xo(qo("",null,null,null,[""],t=Uo(t),0,[0],t))}function qo(t,e,n,r,i,o,s,a,c){for(var l=0,u=0,f=s,h=0,d=0,x=0,p=1,g=1,v=1,b=0,y="",m=i,_=o,w=r,k=y;g;)switch(x=b,b=jt()){case 40:if(x!=108&&kt(k,f-1)==58){mi(k+=J(kr(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:k+=kr(b);break;case 9:case 10:case 13:case 32:k+=Qf(x);break;case 92:k+=Jf(xi()-1,7);continue;case 47:switch(ue()){case 42:case 47:yr(fy(th(jt(),xi()),e,n),c);break;default:k+="/"}break;case 123*p:a[l++]=Xt(k)*v;case 125*p:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+u:v==-1&&(k=J(k,/\f/g,"")),d>0&&Xt(k)-f&&yr(d>32?rh(k+";",r,n,f-1):rh(J(k," ","")+";",r,n,f-2),c);break;case 59:k+=";";default:if(yr(w=nh(k,e,n,l,u,i,a,y,m=[],_=[],f),o),b===123)if(u===0)qo(k,e,w,w,m,o,f,a,_);else switch(h===99&&kt(k,3)===110?100:h){case 100:case 108:case 109:case 115:qo(t,w,w,r&&yr(nh(t,w,w,0,0,i,a,y,i,m=[],f),_),i,_,f,a,r?m:_);break;default:qo(k,w,w,w,[""],_,0,a,_)}}l=u=d=0,p=v=1,y=k="",f=s;break;case 58:f=1+Xt(k),d=x;default:if(p<1){if(b==123)--p;else if(b==125&&p++==0&&Kf()==125)continue}switch(k+=$n(b),b*p){case 38:v=u>0?1:(k+="\f",-1);break;case 44:a[l++]=(Xt(k)-1)*v,v=1;break;case 64:ue()===45&&(k+=kr(jt())),h=ue(),u=f=Xt(y=k+=eh(xi())),b++;break;case 45:x===45&&Xt(k)==2&&(p=0)}}return o}function nh(t,e,n,r,i,o,s,a,c,l,u){for(var f=i-1,h=i===0?o:[""],d=xr(h),x=0,p=0,g=0;x<r;++x)for(var v=0,b=pn(t,f+1,f=Uf(p=s[x])),y=t;v<d;++v)(y=Yo(p>0?h[v]+" "+b:J(b,/&\f/g,h[v])))&&(c[g++]=y);return gi(t,e,n,i===0?mr:a,c,l,u)}function fy(t,e,n){return gi(t,e,n,Wo,$n(Zf()),pn(t,2,-2),0)}function rh(t,e,n,r){return gi(t,e,n,gr,pn(t,0,r),pn(t,r+1,-1),r)}function In(t,e){for(var n="",r=xr(t),i=0;i<r;i++)n+=e(t[i],i,t,e)||"";return n}function oh(t,e,n,r){switch(t.type){case Gf:if(t.children.length)break;case Yf:case gr:return t.return=t.return||t.value;case Wo:return"";case Ho:return t.return=t.value+"{"+In(t.children,r)+"}";case mr:t.value=t.props.join(",")}return Xt(n=In(t.children,r))?t.return=t.value+"{"+n+"}":""}function sh(t){var e=xr(t);return function(n,r,i,o){for(var s="",a=0;a<e;a++)s+=t[a](n,r,i,o)||"";return s}}function ah(t){return function(e){e.root||(e=e.return)&&t(e)}}function lh(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var hy=function(e,n,r){for(var i=0,o=0;i=o,o=ue(),i===38&&o===12&&(n[r]=1),!br(o);)jt();return Sr(e,qt)},dy=function(e,n){var r=-1,i=44;do switch(br(i)){case 0:i===38&&ue()===12&&(n[r]=1),e[r]+=hy(qt-1,n,r);break;case 2:e[r]+=kr(i);break;case 4:if(i===44){e[++r]=ue()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=$n(i)}while(i=jt());return e},py=function(e,n){return Xo(dy(Uo(e),n))},ch=new WeakMap,my=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!ch.get(r))&&!i){ch.set(e,!0);for(var o=[],s=py(n,o),a=r.props,c=0,l=0;c<s.length;c++)for(var u=0;u<a.length;u++,l++)e.props[l]=o[c]?s[c].replace(/&\f/g,a[u]):a[u]+" "+s[c]}}},gy=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function uh(t,e){switch(qf(t,e)){case 5103:return nt+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return nt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return nt+t+pi+t+Pt+t+t;case 6828:case 4268:return nt+t+Pt+t+t;case 6165:return nt+t+Pt+"flex-"+t+t;case 5187:return nt+t+J(t,/(\w+).+(:[^]+)/,nt+"box-$1$2"+Pt+"flex-$1$2")+t;case 5443:return nt+t+Pt+"flex-item-"+J(t,/flex-|-self/,"")+t;case 4675:return nt+t+Pt+"flex-line-pack"+J(t,/align-content|flex-|-self/,"")+t;case 5548:return nt+t+Pt+J(t,"shrink","negative")+t;case 5292:return nt+t+Pt+J(t,"basis","preferred-size")+t;case 6060:return nt+"box-"+J(t,"-grow","")+nt+t+Pt+J(t,"grow","positive")+t;case 4554:return nt+J(t,/([^-])(transform)/g,"$1"+nt+"$2")+t;case 6187:return J(J(J(t,/(zoom-|grab)/,nt+"$1"),/(image-set)/,nt+"$1"),t,"")+t;case 5495:case 3959:return J(t,/(image-set\([^]*)/,nt+"$1$`$1");case 4968:return J(J(t,/(.+:)(flex-)?(.*)/,nt+"box-pack:$3"+Pt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+nt+t+t;case 4095:case 3583:case 4068:case 2532:return J(t,/(.+)-inline(.+)/,nt+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Xt(t)-1-e>6)switch(kt(t,e+1)){case 109:if(kt(t,e+4)!==45)break;case 102:return J(t,/(.+:)(.+)-([^]+)/,"$1"+nt+"$2-$3$1"+pi+(kt(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~mi(t,"stretch")?uh(J(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(kt(t,e+1)!==115)break;case 6444:switch(kt(t,Xt(t)-3-(~mi(t,"!important")&&10))){case 107:return J(t,":",":"+nt)+t;case 101:return J(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nt+(kt(t,14)===45?"inline-":"")+"box$3$1"+nt+"$2$3$1"+Pt+"$2box$3")+t}break;case 5936:switch(kt(t,e+11)){case 114:return nt+t+Pt+J(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nt+t+Pt+J(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nt+t+Pt+J(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return nt+t+Pt+t+t}return t}var xy=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case gr:e.return=uh(e.value,e.length);break;case Ho:return In([wr(e,{value:J(e.value,"@","@"+nt)})],i);case mr:if(e.length)return gl(e.props,function(o){switch(ml(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return In([wr(e,{props:[J(o,/:(read-\w+)/,":"+pi+"$1")]})],i);case"::placeholder":return In([wr(e,{props:[J(o,/:(plac\w+)/,":"+nt+"input-$1")]}),wr(e,{props:[J(o,/:(plac\w+)/,":"+pi+"$1")]}),wr(e,{props:[J(o,/:(plac\w+)/,Pt+"input-$1")]})],i)}return""})}},yy=[xy],fh=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var g=p.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=e.stylisPlugins||yy,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var g=p.getAttribute("data-emotion").split(" "),v=1;v<g.length;v++)o[g[v]]=!0;a.push(p)});var c,l=[my,gy];{var u,f=[oh,ah(function(p){u.insert(p)})],h=sh(l.concat(i,f)),d=function(g){return In(ih(g),h)};c=function(g,v,b,y){u=b,d(g?g+"{"+v.styles+"}":v.styles),y&&(x.inserted[v.name]=!0)}}var x={key:n,sheet:new Hf({key:n,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:c};return x.sheet.hydrate(a),x};function hh(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var dh={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var vy=!1,by=/[A-Z]|^ms/g,_y=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xh=function(e){return e.charCodeAt(1)===45},ph=function(e){return e!=null&&typeof e!="boolean"},yl=lh(function(t){return xh(t)?t:t.replace(by,"-$&").toLowerCase()}),mh=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(_y,function(r,i,o){return $e={name:i,styles:o,next:$e},i})}return dh[e]!==1&&!xh(e)&&typeof n=="number"&&n!==0?n+"px":n},wy="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function yi(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return $e={name:i.name,styles:i.styles,next:$e},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)$e={name:s.name,styles:s.styles,next:$e},s=s.next;var a=o.styles+";";return a}return Sy(t,e,n)}case"function":{if(t!==void 0){var c=$e,l=n(t);return $e=c,yi(t,e,l)}break}}var u=n;if(e==null)return u;var f=e[u];return f!==void 0?f:u}function Sy(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=yi(t,e,n[i])+";";else for(var o in n){var s=n[o];if(typeof s!="object"){var a=s;e!=null&&e[a]!==void 0?r+=o+"{"+e[a]+"}":ph(a)&&(r+=yl(o)+":"+mh(o,a)+";")}else{if(o==="NO_COMPONENT_SELECTOR"&&vy)throw new Error(wy);if(Array.isArray(s)&&typeof s[0]=="string"&&(e==null||e[s[0]]===void 0))for(var c=0;c<s.length;c++)ph(s[c])&&(r+=yl(o)+":"+mh(o,s[c])+";");else{var l=yi(t,e,s);switch(o){case"animation":case"animationName":{r+=yl(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}}return r}var gh=/label:\s*([^\s;{]+)\s*(;|$)/g,$e;function jo(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,i="";$e=void 0;var o=t[0];if(o==null||o.raw===void 0)r=!1,i+=yi(n,e,o);else{var s=o;i+=s[0]}for(var a=1;a<t.length;a++)if(i+=yi(n,e,t[a]),r){var c=o;i+=c[a]}gh.lastIndex=0;for(var l="",u;(u=gh.exec(i))!==null;)l+="-"+u[1];var f=hh(i)+l;return{name:f,styles:i,next:$e}}var ky=!0;function vl(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):i&&(r+=i+" ")}),r}var Ty=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||ky===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},yh=function(e,n,r){Ty(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var o=n;do e.insert(n===o?"."+i:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function vh(t,e){if(t.inserted[e.name]===void 0)return t.insert("",e,t.sheet,!0)}function bh(t,e,n){var r=[],i=vl(t,r,n);return r.length<2?n:i+e(r)}var Zo=function(e){var n=fh(e);n.sheet.speedy=function(a){this.isSpeedy=a},n.compat=!0;var r=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var f=jo(l,n.registered,void 0);return yh(n,f,!1),n.key+"-"+f.name},i=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var f=jo(l,n.registered),h="animation-"+f.name;return vh(n,{name:f.name,styles:"@keyframes "+h+"{"+f.styles+"}"}),h},o=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];var f=jo(l,n.registered);vh(n,f)},s=function(){for(var c=arguments.length,l=new Array(c),u=0;u<c;u++)l[u]=arguments[u];return bh(n.registered,r,Ay(l))};return{css:r,cx:s,injectGlobal:o,keyframes:i,hydrate:function(c){c.forEach(function(l){n.inserted[l]=!0})},flush:function(){n.registered={},n.inserted={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:vl.bind(null,n.registered),merge:bh.bind(null,n.registered,r)}},Ay=function t(e){for(var n="",r=0;r<e.length;r++){var i=e[r];if(i!=null){var o=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))o=t(i);else{o="";for(var s in i)i[s]&&s&&(o&&(o+=" "),o+=s)}break}default:o=i}o&&(n&&(n+=" "),n+=o)}}return n};var Ie=Zo({key:"css"}),Cy=Ie.flush,My=Ie.hydrate,Ly=Ie.cx,Ry=Ie.merge,Ey=Ie.getRegisteredStyles,Dy=Ie.injectGlobal,$y=Ie.keyframes,Iy=Ie.css,Oy=Ie.sheet,Ny=Ie.cache;var _h=globalThis?.UNOVIS_NONCE,By=_h?Zo({key:"unovis",nonce:_h}):bl,{css:T,cx:wk,injectGlobal:ut,keyframes:Sk,cache:kk,sheet:Tk}=By;function Qt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function _l(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function On(t){let e,n,r;t.length!==2?(e=Qt,n=(a,c)=>Qt(t(a),c),r=(a,c)=>t(a)-c):(e=t===Qt||t===_l?t:Py,n=t,r=t);function i(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;n(a[f],c)<0?l=f+1:u=f}while(l<u)}return l}function o(a,c,l=0,u=a.length){if(l<u){if(e(c,c)!==0)return u;do{let f=l+u>>>1;n(a[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function s(a,c,l=0,u=a.length){let f=i(a,c,l,u-1);return f>l&&r(a[f-1],c)>-r(a[f],c)?f-1:f}return{left:i,center:s,right:o}}function Py(){return 0}function vi(t){return t===null?NaN:+t}var wh=On(Qt),Ko=wh.right,wl=wh.left,Fy=On(vi).center,Ze=Ko;function Qo(t,e){let n,r;if(e===void 0)for(let i of t)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}var mn=class extends Map{constructor(e,n=Wy){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(let[r,i]of e)this.set(r,i)}get(e){return super.get(Sh(this,e))}has(e){return super.has(Sh(this,e))}set(e,n){return super.set(zy(this,e),n)}delete(e){return super.delete(Vy(this,e))}};function Sh({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):n}function zy({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Vy({_intern:t,_key:e},n){let r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Wy(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Jo(t){return t}function ts(t,...e){return Hy(t,Jo,Jo,e)}function Hy(t,e,n,r){return(function i(o,s){if(s>=r.length)return n(o);let a=new mn,c=r[s++],l=-1;for(let u of o){let f=c(u,++l,o),h=a.get(f);h?h.push(u):a.set(f,[u])}for(let[u,f]of a)a.set(u,i(f,s));return e(a)})(t,0)}var Yy=Math.sqrt(50),Gy=Math.sqrt(10),Uy=Math.sqrt(2);function es(t,e,n){let r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=Yy?10:o>=Gy?5:o>=Uy?2:1,a,c,l;return i<0?(l=Math.pow(10,-i)/s,a=Math.round(t*l),c=Math.round(e*l),a/l<t&&++a,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*s,a=Math.round(t/l),c=Math.round(e/l),a*l<t&&++a,c*l>e&&--c),c<a&&.5<=n&&n<2?es(t,e,n*2):[a,c,l]}function Nn(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];let r=e<t,[i,o,s]=r?es(e,t,n):es(t,e,n);if(!(o>=i))return[];let a=o-i+1,c=new Array(a);if(r)if(s<0)for(let l=0;l<a;++l)c[l]=(o-l)/-s;else for(let l=0;l<a;++l)c[l]=(o-l)*s;else if(s<0)for(let l=0;l<a;++l)c[l]=(i+l)/-s;else for(let l=0;l<a;++l)c[l]=(i+l)*s;return c}function bi(t,e,n){return e=+e,t=+t,n=+n,es(t,e,n)[2]}function Tr(t,e,n){e=+e,t=+t,n=+n;let r=e<t,i=r?bi(e,t,n):bi(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function xt(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Tt(t,e){let n;if(e===void 0)for(let r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function _i(t,e){let n,r=-1,i=-1;if(e===void 0)for(let o of t)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of t)(o=e(o,++i,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Sl(t,e,n=vi){if(!(!(r=t.length)||isNaN(e=+e))){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),s=+n(t[o],o,t),a=+n(t[o+1],o+1,t);return s+(a-s)*(i-o)}}function Bn(t,e){let n=0,r=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)(o=e(o,++i,t))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function*Xy(t){for(let e of t)yield*e}function ns(t){return Array.from(Xy(t))}function Ar(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}function rs(t,e=Qt){let n,r=!1;if(e.length===1){let i;for(let o of t){let s=e(o);(r?Qt(s,i)<0:Qt(s,s)===0)&&(n=o,i=s,r=!0)}}else for(let i of t)(r?e(i,n)<0:e(i,i)===0)&&(n=i,r=!0);return n}function is(t,e){let n=0;if(e===void 0)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function kh(t,e,n){var r=n||{},i=r.noTrailing,o=i===void 0?!1:i,s=r.noLeading,a=s===void 0?!1:s,c=r.debounceMode,l=c===void 0?void 0:c,u,f=!1,h=0;function d(){u&&clearTimeout(u)}function x(g){var v=g||{},b=v.upcomingOnly,y=b===void 0?!1:b;d(),f=!y}function p(){for(var g=arguments.length,v=new Array(g),b=0;b<g;b++)v[b]=arguments[b];var y=this,m=Date.now()-h;if(f)return;function _(){h=Date.now(),e.apply(y,v)}function w(){u=void 0}!a&&l&&!u&&_(),d(),l===void 0&&m>t?a?(h=Date.now(),o||(u=setTimeout(l?w:_,t))):_():o!==!0&&(u=setTimeout(l?w:_,l===void 0?t-m:t))}return p.cancel=x,p}var Oe=(t=>(t.Left="left",t.Right="right",t.Auto="auto",t))(Oe||{});var U=t=>typeof t=="number",Jt=t=>typeof t=="function";var gn=t=>typeof t=="string",mt=t=>Array.isArray(t),qy=t=>t instanceof Object,kl=t=>t.constructor.name!=="Function"&&t.constructor.name!=="Object",os=t=>qy(t)&&!mt(t)&&!Jt(t)&&!kl(t),Pn=t=>[Object,Array].includes((t||{}).constructor)&&!Object.entries(t||{}).length,Ke=(t,e,n=[],r=new Set)=>{if(t===e)return!0;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;if(r.has(t))return!0;r.add(t);for(let i=0;i<t.length;i++)if(!Ke(t[i],e[i],n,r))return!1;return r.delete(t),!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(typeof t=="object"&&t!==null&&e!==null){if(typeof e!="object")return!1;let i=Object.keys(t).filter(s=>!n.includes(s)),o=Object.keys(e).filter(s=>!n.includes(s));if(i.length!==o.length)return!1;if(r.has(t))return!0;r.add(t);for(let s of i)if(!Ke(t[s],e[s],n,r))return!1;return r.delete(t),!0}return t===e};var xn=t=>t.flat(),wi=(t,e=new Map)=>{if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let n=[];e.set(t,n);for(let r of t)n.push(e.has(r)?e.get(r):wi(r,e));return n}if(kl(t))return t;if(t instanceof Object){let n={};e.set(t,n);let r=t;return Object.keys(t).reduce((i,o)=>(i[o]=e.has(r[o])?e.get(r[o]):wi(r[o],e),i),n),n}return t},te=(t,e,n=new Map)=>{if(!t||!e)return t&&wi(t);if(t===e)return t;let r=kl(t)?t:wi(t);return n.has(e)?n.get(e):(n.set(e,r),Object.keys(e).forEach(i=>{i==="__proto__"||i==="constructor"||(os(t[i])&&os(e[i])?r[i]=te(t[i],e[i],n):r[i]=wi(e[i]))}),r)};var Th=(t,e)=>t.reduce((n,r,i,o,s=e(r,i))=>((n[s]||(n[s]=[])).push(r),n),{});var Cr=(t,e,n)=>kh(e,t,n);function K(t,e,n){return Jt(e)?e(t,n):e}function q(t,e,n){return K(t,e,n)}function I(t,e,n){return K(t,e,n)}function Mr(t){return t.filter(e=>e&&!U(e))}function tt(t,e,n){return Math.min(Math.max(t,e),n)}function Ah(t){return[...Array(t).keys()]}function ss(t,e,...n){if(!t)return[void 0,void 0];if(mt(n)){let r,i;return t.forEach((o,s)=>{let a=I(o,e,s)||0,c=a,l=a;for(let u of n){let f=I(o,u,s)||0;f>=0?c+=f:l+=f}(i===void 0||c>i)&&(i=c),(r===void 0||l<r)&&(r=l)}),[r??0,i??0]}}function Tl(t,e,...n){let r=[],i=0,o=0;for(let s of n){let a=I(t,s,e)||0;a>=0?r.push(i+=a):r.push(o+=a)}return r}function as(t,e,n,r){let i=t.map((a,c)=>I(a,e,c)||0),o=n.map((a,c)=>{let l=Bn(t,(u,f)=>I(u,a,f)||0);return l===0&&Array.isArray(r)?r[c]:l<0}),s=n.map(()=>[]);return t.forEach((a,c)=>{let l=i[c],u=i[c];n.forEach((f,h)=>{let d=I(a,f,c)||0;d>=0?s[h].push([l,l+=d]):s[h].push([u,u+=d])})}),s.forEach((a,c)=>{a.isMostlyNegative=o[c]}),s}function Fn(t,...e){return t?Tt(t,(r,i)=>Tt(e,o=>I(r,o,i))):void 0}function zn(t,...e){return t?xt(t,(r,i)=>xt(e,o=>I(r,o,i))):void 0}function fe(t,...e){return[Fn(t,...e),zn(t,...e)]}function Si(t,e,n,r=Oe.Auto){if(t.length<=1)return t[0];let o=t.map((c,l)=>[c,l]).sort(([c,l],[u,f])=>I(c,n,l)-I(u,n,f)),s=o.map(([c,l])=>I(c,n,l)),a=r===Oe.Right?wl(s,e,0,t.length-1):Ko(s,e,1,t.length);return r===Oe.Right?o[a][0]:r===Oe.Left?o[a-1][0]:e-s[a-1]>s[a]-e?o[a][0]:o[a-1][0]}function Ch(t,e,n,r,i,o=[],s=[],a){if(!t?.length||!i)return;let[c,l]=e,u,f=-1,h=1/0;for(let d=0;d<t.length;d++){let x=t[d],p=n(I(x,i,d));if(!isFinite(p))continue;let g=(p-c)**2;if(s.length){let v=I(x,a,d)||0,b=Tl(x,d,...s);for(let y=0;y<b.length;y++){if(!U(I(x,s[y],y)))continue;let m=r(b[y]+v),_=g+(m-l)**2;_<h&&(h=_,u=x,f=d)}}for(let v=0;v<o.length;v++){let b=I(x,o[v],d);if(!U(b))continue;let y=r(b),m=g+(y-l)**2;m<h&&(h=m,u=x,f=d)}}if(f!==-1)return{datum:u,index:f,distanceSq:h}}function ls(t,e,n,r=!1){if(!n)return[];let i=t.filter((o,s)=>{let a=I(o,n,s);return a>=e[0]&&a<=e[1]});if(r){if(i.length===0){let f=Si(t,e[0],n,Oe.Left),h=Si(t,e[1],n,Oe.Right);return[f,h].filter(Boolean)}let o=i[0],s=i[i.length-1],a=t.findIndex(f=>f===o),c=t.findIndex(f=>f===s),l=Math.max(0,a-1),u=Math.min(t.length-1,c+1);return t.slice(l,u+1)}return i}function Vn(t,e){return t>=e[0]&&t<=e[1]||t>=e[1]&&t<=e[0]}var Mh=t=>t==null?[]:Array.isArray(t)?t:[t];function Al(t){t=String(t);let e=parseFloat(t),n=t.match(/[\d.\-+]*\s*(.*)/)?.[1]||"";return[e,n]}function Lh(){return typeof window<"u"&&typeof document<"u"}function Cl(t,e){let n=Al(getComputedStyle(t).getPropertyValue(e));return n[0]*(ee(n[1],t)??1)}function Rh(t,e){let n=document.createElement("div");n.style.height=`128${t}`,e.appendChild(n);let r=Cl(n,"height")/128;return e.removeChild(n),r}var cs=null;function ki(){return Lh()?(cs===null&&(cs=96,cs=Rh("in",document.body)),cs):96}function ee(t,e){if(!t&&t!==0)return null;if(!Lh()){let o=Al(String(t));if(!isNaN(o[0])){let s=o[1]?.toLowerCase()||"px";if(s==="px"||s==="")return o[0];if(s==="em"||s==="rem")return o[0]*16;if(s==="in")return o[0]*96;if(s==="cm")return o[0]*(96/2.54);if(s==="mm")return o[0]*(96/25.4);if(s==="pt")return o[0]*(96/72);if(s==="pc")return o[0]*(96/6)}return null}let n=document.body;e&&e!==window&&e!==document&&(n=e);let r=(String(t)||"px").trim().toLowerCase();switch(r){case"%":return n.clientHeight/100;case"ch":case"ex":return Rh(r,n);case"em":return Cl(n,"font-size");case"rem":return Cl(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return ki();case"cm":return ki()/2.54;case"mm":return ki()/25.4;case"pt":return ki()/72;case"pc":return ki()/6;case"px":return 1}let i=Al(r);if(!isNaN(i[0])){if(i[1]){let o=ee(i[1],n);return typeof o=="number"?i[0]*o:null}return i[0]}return null}function Lr(){let t=()=>Math.floor((1+crypto.getRandomValues(new Uint32Array(1))[0])*65536).toString(16).substring(1);return`${t()+t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`}function Dh(t){return(t||"").replace(/\W/g,"_")}function Rr(t){return gn(t)?t.substring(0,6)==="var(--":!1}var Eh=new WeakMap;function Qe(t,e){if(!gn(t))return"";let n=t.substr(4,t.length-5),r=Eh.get(e);if(r||(r=new Map,Eh.set(e,r)),r.has(n))return r.get(n);let i=getComputedStyle(e).getPropertyValue(n);return r.set(n,i),i}function Dt(t,e){let n=Qe(t,e);return ee(n)}function Ti(t){return typeof t=="number"?t:ee(t)}function us(t,e){let n=Math.sin(e),r=Math.cos(e),i=[[t.x,t.y],[t.x+t.width,t.y],[t.x,t.y+t.height],[t.x+t.width,t.y+t.height]],o=i.map(([l,u])=>l*r-u*n),s=i.map(([l,u])=>l*n+u*r),a=Math.min(...o),c=Math.min(...s);return{x:a,y:c,width:Math.max(...o)-a,height:Math.max(...s)-c}}function fs(t,e){return{dx:Math.max(e.x-t.x,Math.min(0,e.x+e.width-t.x-t.width)),dy:Math.max(e.y-t.y,Math.min(0,e.y+e.height-t.y-t.height))}}function Je(t,e,n=0){let[r,i,o,s]=[t.x+n,t.y+t.height-2*n,t.x+t.width-2*n,t.y+n],[a,c,l,u]=[e.x+n,e.y+e.height-2*n,e.x+e.width-2*n,e.y+n];return!(i<u||c<s||o<a||l<r)}var At='html[data-theme="dark"],html.dark-theme,body.dark-theme,html.theme-dark,body.theme-dark';function hs(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Ml(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Mi(){}var Ai=.7,ms=1/Ai,Er="\\s*([+-]?\\d+)\\s*",Ci="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ne="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jy=/^#([0-9a-f]{3,8})$/,Zy=new RegExp(`^rgb\\(${Er},${Er},${Er}\\)$`),Ky=new RegExp(`^rgb\\(${Ne},${Ne},${Ne}\\)$`),Qy=new RegExp(`^rgba\\(${Er},${Er},${Er},${Ci}\\)$`),Jy=new RegExp(`^rgba\\(${Ne},${Ne},${Ne},${Ci}\\)$`),tv=new RegExp(`^hsl\\(${Ci},${Ne},${Ne}\\)$`),ev=new RegExp(`^hsla\\(${Ci},${Ne},${Ne},${Ci}\\)$`),$h={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};hs(Mi,vt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ih,formatHex:Ih,formatHex8:nv,formatHsl:rv,formatRgb:Oh,toString:Oh});function Ih(){return this.rgb().formatHex()}function nv(){return this.rgb().formatHex8()}function rv(){return Vh(this).formatHsl()}function Oh(){return this.rgb().formatRgb()}function vt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=jy.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Nh(e):n===3?new ne(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ds(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ds(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Zy.exec(t))?new ne(e[1],e[2],e[3],1):(e=Ky.exec(t))?new ne(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Qy.exec(t))?ds(e[1],e[2],e[3],e[4]):(e=Jy.exec(t))?ds(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=tv.exec(t))?Fh(e[1],e[2]/100,e[3]/100,1):(e=ev.exec(t))?Fh(e[1],e[2]/100,e[3]/100,e[4]):$h.hasOwnProperty(t)?Nh($h[t]):t==="transparent"?new ne(NaN,NaN,NaN,0):null}function Nh(t){return new ne(t>>16&255,t>>8&255,t&255,1)}function ds(t,e,n,r){return r<=0&&(t=e=n=NaN),new ne(t,e,n,r)}function iv(t){return t instanceof Mi||(t=vt(t)),t?(t=t.rgb(),new ne(t.r,t.g,t.b,t.opacity)):new ne}function Dr(t,e,n,r){return arguments.length===1?iv(t):new ne(t,e,n,r??1)}function ne(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}hs(ne,Dr,Ml(Mi,{brighter(t){return t=t==null?ms:Math.pow(ms,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ai:Math.pow(Ai,t),new ne(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ne(Hn(this.r),Hn(this.g),Hn(this.b),gs(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Bh,formatHex:Bh,formatHex8:ov,formatRgb:Ph,toString:Ph}));function Bh(){return`#${Wn(this.r)}${Wn(this.g)}${Wn(this.b)}`}function ov(){return`#${Wn(this.r)}${Wn(this.g)}${Wn(this.b)}${Wn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ph(){let t=gs(this.opacity);return`${t===1?"rgb(":"rgba("}${Hn(this.r)}, ${Hn(this.g)}, ${Hn(this.b)}${t===1?")":`, ${t})`}`}function gs(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Hn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Wn(t){return t=Hn(t),(t<16?"0":"")+t.toString(16)}function Fh(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ke(t,e,n,r)}function Vh(t){if(t instanceof ke)return new ke(t.h,t.s,t.l,t.opacity);if(t instanceof Mi||(t=vt(t)),!t)return new ke;if(t instanceof ke)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,c=(o+i)/2;return a?(e===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-e)/a+2:s=(e-n)/a+4,a/=c<.5?o+i:2-o-i,s*=60):a=c>0&&c<1?0:s,new ke(s,a,c,t.opacity)}function Li(t,e,n,r){return arguments.length===1?Vh(t):new ke(t,e,n,r??1)}function ke(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}hs(ke,Li,Ml(Mi,{brighter(t){return t=t==null?ms:Math.pow(ms,t),new ke(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ai:Math.pow(Ai,t),new ke(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new ne(Ll(t>=240?t-240:t+120,i,r),Ll(t,i,r),Ll(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new ke(zh(this.h),ps(this.s),ps(this.l),gs(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=gs(this.opacity);return`${t===1?"hsl(":"hsla("}${zh(this.h)}, ${ps(this.s)*100}%, ${ps(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zh(t){return t=(t||0)%360,t<0?t+360:t}function ps(t){return Math.max(0,Math.min(1,t||0))}function Ll(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}var Be=globalThis?.UNOVIS_COLORS||["#4D8CFD","#FF6B7E","#F4B83E","#A6CC74","#00C19A","#6859BE"],Wh=globalThis?.UNOVIS_COLORS_DARK||["#4D8CFD","#FF6B7E","#FFC16D","#A6CC74","#00C19A","#7887E0"],yn=t=>`--vis-${U(t)?`color${t%Be.length}`:t}`;function Hh(t,e=.4){let n=Li(t);return n.l=n.l*(1+e),n.formatHex()}function Yh(t,e=.4,n=.6){let r=Li(t);return r.s=r.s*(1-n),r.l=r.l*(1-e),r.formatHex()}var Pe=10,Ri=[{id:"stripes-diagonal",svg:'<path d="M-1,1 l2,-2 M0,10 l10,-10 M9,11 l2,-2" stroke="#000"/>'},{id:"dots",svg:'<path d="m0-1.5a1 1 0 010 3m10-3a1 1 0 000 3M5 3.5a1 1 0 010 3 1 1 0 010-3M0 8.5 a1 1 0 010 3m10-3a1 1 0 000 3" fill"#000"/>'},{id:"stripes-vertical",svg:'<path d="M 5,-1 L5,11" stroke="#000"/>'},{id:"crosshatch",svg:'<path d="M0 0L10 10ZM10 0L0 10Z" stroke="#000"/>'},{id:"waves",svg:'<path d="M0 4Q2.5 1 5 4 7.5 7 10 4v2Q7.5 9 5 6 2.5 3 0 6Z" fill="#000"/>'},{id:"circles",svg:'<circle cx="5" cy="5" r="3" stroke="#000" fill="#fff"/>'}],$r=[{id:"circle",marker:'<circle cx="5" cy="5" r="5"/>',dashArray:[]},{id:"triangle",marker:'<path d="M5,0 L10,9 L0,9Z">',dashArray:[9,1]},{id:"diamond",marker:'<path d="M 0 5 L5 0 L 10 5 L 5 10 L 0 5Z">',dashArray:[2]},{id:"arrow",marker:'<path d="M4 0 0 0 6 5 0 10 4 10 10 5Z">',dashArray:[2,3,8,3]},{id:"square",marker:'<rect x="1" y="1" width="8" height="8"/>',dashArray:[6]},{id:"star",marker:'<path d="m2 9 3-9 3 9L0 3h10Z"/>',dashArray:[1,6]}],sv=new Map(Ri.map(t=>[t.id,t])),av=new Map($r.map(t=>[t.id,t]));function Yn(t){return`vis-${`pattern-${t.svg?"fill":"marker"}`}-${t.id}`}function Rl(t){return`vis-pattern-fill-${t}`}function El(t){return`vis-pattern-marker-${t}`}function Dl(t){return`vis-pattern-marker-ctx-${t}`}function Gh(t){return sv.get(t)??av.get(t)??null}var lv=t=>`<mask id="${Rl(t.id)}">
2
2
  <pattern id="vis-pattern-tile-${t.id}" viewBox="0 0 10 10" width="${Pe}" height="${Pe}" patternUnits="userSpaceOnUse">
3
3
  <rect width="10" height="10" fill="#fff"/>
4
4
  ${t.svg}
5
5
  </pattern>
6
6
  <rect x="-100000" y="-100000" width="200000" height="200000" fill="url(#vis-pattern-tile-${t.id})"/>
7
- </mask>`,Ny=(t,e)=>`<marker id="${vl(t.id)}"
8
- fill="var(${xn(e)})"
7
+ </mask>`,cv=(t,e)=>`<marker id="${El(t.id)}"
8
+ fill="var(${yn(e)})"
9
9
  markerUnits="userSpaceOnUse"
10
10
  refX="5"
11
11
  refY="5"
12
12
  markerWidth="${Pe}"
13
13
  markerHeight="${Pe}">
14
14
  ${t.marker}
15
- </marker>`,Py=t=>`<marker id="${bl(t.id)}"
15
+ </marker>`,uv=t=>`<marker id="${Dl(t.id)}"
16
16
  fill="context-stroke"
17
17
  markerUnits="userSpaceOnUse"
18
18
  refX="5"
@@ -20,74 +20,74 @@
20
20
  markerWidth="${Pe}"
21
21
  markerHeight="${Pe}">
22
22
  ${t.marker}
23
- </marker>`;function Bh(t,e,n){let r=document.createElementNS("http://www.w3.org/2000/svg","marker");return r.setAttribute("id",e),r.setAttribute("fill",n),r.setAttribute("markerUnits","userSpaceOnUse"),r.setAttribute("refX","5"),r.setAttribute("refY","5"),r.setAttribute("markerWidth",String(Pe)),r.setAttribute("markerHeight",String(Pe)),r.innerHTML=t.marker,r}function Fy(){let t=Dr.map((r,i)=>Ny(r,i)).concat(Dr.map(Py)),e=Ai.map(Oy).concat(t).join(""),n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("height","0"),n.setAttribute("width","0"),n.style.position="fixed",n.style.zIndex="-99999999",n.innerHTML=`<defs>${e}</defs>`,document.body.appendChild(n)}typeof window<"u"&&Fy();function xt(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function ca(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}var _l=Symbol("implicit");function ke(){var t=new mn,e=[],n=[],r=_l;function i(o){let a=t.get(o);if(a===void 0){if(r!==_l)return r;t.set(o,a=e.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new mn;for(let a of o)t.has(a)||t.set(a,e.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return ke(e,n).unknown(r)},xt.apply(i,arguments),i}function yn(){var t=ke().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,a,s=!1,c=0,l=0,u=.5;delete t.unknown;function f(){var h=e().length,d=i<r,g=d?i:r,p=d?r:i;o=(p-g)/Math.max(1,h-c+l*2),s&&(o=Math.floor(o)),g+=(p-g-o*(h-c))*u,a=o*(1-c),s&&(g=Math.round(g),a=Math.round(a));var x=wr(h).map(function(y){return g+o*y});return n(d?x.reverse():x)}return t.domain=function(h){return arguments.length?(e(h),f()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,s=!0,f()},t.bandwidth=function(){return a},t.step=function(){return o},t.round=function(h){return arguments.length?(s=!!h,f()):s},t.padding=function(h){return arguments.length?(c=Math.min(1,l=+h),f()):c},t.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},t.paddingOuter=function(h){return arguments.length?(l=+h,f()):l},t.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),f()):u},t.copy=function(){return yn(e(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},xt.apply(f(),arguments)}function Oh(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Oh(e())},t}function wl(){return Oh(yn.apply(null,arguments).paddingInner(1))}function Sl(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function Nh(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return Sl((n-r/e)*e,a,i,o,s)}}function Ph(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return Sl((n-r/e)*e,i,o,a,s)}}var Mi=t=>()=>t;function zy(t,e){return function(n){return t+n*e}}function Vy(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Fh(t){return(t=+t)==1?ua:function(e,n){return n-e?Vy(e,n,t):Mi(isNaN(e)?n:e)}}function ua(t,e){var n=e-t;return n?zy(t,n):Mi(isNaN(t)?e:t)}var Wn=(function t(e){var n=Fh(e);function r(i,o){var a=n((i=Mr(i)).r,(o=Mr(o)).r),s=n(i.g,o.g),c=n(i.b,o.b),l=ua(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=t,r})(1);function zh(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a,s;for(a=0;a<n;++a)s=Mr(e[a]),r[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return r=t(r),i=t(i),o=t(o),s.opacity=1,function(c){return s.r=r(c),s.g=i(c),s.b=o(c),s+""}}}var Wy=zh(Nh),Hy=zh(Ph);function Vh(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function Wh(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Hh(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=kt(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function Yh(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Nt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Gh(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=kt(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Cl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kl=new RegExp(Cl.source,"g");function Yy(t){return function(){return t}}function Gy(t){return function(e){return t(e)+""}}function Di(t,e){var n=Cl.lastIndex=kl.lastIndex=0,r,i,o,a=-1,s=[],c=[];for(t=t+"",e=e+"";(r=Cl.exec(t))&&(i=kl.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,c.push({i:a,x:Nt(r,i)})),n=kl.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?c[0]?Gy(c[0].x):Yy(e):(e=c.length,function(l){for(var u=0,f;u<e;++u)s[(f=c[u]).i]=f.x(l);return s.join("")})}function kt(t,e){var n=typeof e,r;return e==null||n==="boolean"?Mi(e):(n==="number"?Nt:n==="string"?(r=gt(e))?(e=r,Wn):Di:e instanceof gt?Wn:e instanceof Date?Yh:Wh(e)?Vh:Array.isArray(e)?Hh:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Gh:Nt)(t,e)}function Hn(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Uh=180/Math.PI,fa={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tl(t,e,n,r,i,o){var a,s,c;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),t*r<e*n&&(t=-t,e=-e,c=-c,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Uh,skewX:Math.atan(c)*Uh,scaleX:a,scaleY:s}}var ha;function Xh(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?fa:Tl(e.a,e.b,e.c,e.d,e.e,e.f)}function qh(t){return t==null?fa:(ha||(ha=document.createElementNS("http://www.w3.org/2000/svg","g")),ha.setAttribute("transform",t),(t=ha.transform.baseVal.consolidate())?(t=t.matrix,Tl(t.a,t.b,t.c,t.d,t.e,t.f)):fa)}function Zh(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,f,h,d,g){if(l!==f||u!==h){var p=d.push("translate(",null,e,null,n);g.push({i:p-4,x:Nt(l,f)},{i:p-2,x:Nt(u,h)})}else(f||h)&&d.push("translate("+f+e+h+n)}function a(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Nt(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function s(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Nt(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,h,d,g){if(l!==f||u!==h){var p=d.push(i(d)+"scale(",null,",",null,")");g.push({i:p-4,x:Nt(l,f)},{i:p-2,x:Nt(u,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=t(l),u=t(u),o(l.translateX,l.translateY,u.translateX,u.translateY,f,h),a(l.rotate,u.rotate,f,h),s(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(d){for(var g=-1,p=h.length,x;++g<p;)f[(x=h[g]).i]=x.x(d);return f.join("")}}}var Al=Zh(Xh,"px, ","px)","deg)"),Ml=Zh(qh,", ",")",")");function da(t,e){e===void 0&&(e=t,t=kt);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(a){var s=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return o[s](a-s)}}function Dl(t){return function(){return t}}function Rr(t){return+t}var jh=[0,1];function Pt(t){return t}function Rl(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Dl(isNaN(e)?NaN:.5)}function Uy(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Xy(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Rl(i,r),o=n(a,o)):(r=Rl(r,i),o=n(o,a)),function(s){return o(r(s))}}function qy(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Rl(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(s){var c=je(t,s,1,r)-1;return o[c](i[c](s))}}function Fe(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Yn(){var t=jh,e=jh,n=kt,r,i,o,a=Pt,s,c,l;function u(){var h=Math.min(t.length,e.length);return a!==Pt&&(a=Uy(t[0],t[h-1])),s=h>2?qy:Xy,c=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(c||(c=s(t.map(r),e,n)))(r(a(h)))}return f.invert=function(h){return a(i((l||(l=s(e,t.map(r),Nt)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,Rr),u()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),u()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=Hn,u()},f.clamp=function(h){return arguments.length?(a=h?!0:Pt,u()):a!==Pt},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,d){return r=h,i=d,u()}}function Ri(){return Yn()(Pt,Pt)}function Kh(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Gn(t,e){if(!isFinite(t)||t===0)return null;var n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function ze(t){return t=Gn(Math.abs(t)),t?t[1]:NaN}function Qh(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function Jh(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Zy=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ve(t){if(!(e=Zy.exec(t)))throw new Error("invalid format: "+t);var e;return new pa({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ve.prototype=pa.prototype;function pa(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}pa.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function td(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Ei;function ed(t,e){var n=Gn(t,e);if(!n)return Ei=void 0,t.toPrecision(e);var r=n[0],i=n[1],o=i-(Ei=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Gn(t,Math.max(0,e+o-1))[0]}function El(t,e){var n=Gn(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}var Ll={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Kh,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>El(t*100,e),r:El,s:ed,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function $l(t){return t}var nd=Array.prototype.map,rd=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function id(t){var e=t.grouping===void 0||t.thousands===void 0?$l:Qh(nd.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?$l:Jh(nd.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"\u2212":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function l(f,h){f=Ve(f);var d=f.fill,g=f.align,p=f.sign,x=f.symbol,y=f.zero,b=f.width,v=f.comma,m=f.precision,_=f.trim,w=f.type;w==="n"?(v=!0,w="g"):Ll[w]||(m===void 0&&(m=12),_=!0,w="g"),(y||d==="0"&&g==="=")&&(y=!0,d="0",g="=");var k=(h&&h.prefix!==void 0?h.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),A=(x==="$"?r:/[%p]/.test(w)?a:"")+(h&&h.suffix!==void 0?h.suffix:""),I=Ll[w],O=/[defgprs%]/.test(w);m=m===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m));function N(M){var E=k,B=A,Q,F,q;if(w==="c")B=I(M)+B,M="";else{M=+M;var rt=M<0||1/M<0;if(M=isNaN(M)?c:I(Math.abs(M),m),_&&(M=td(M)),rt&&+M==0&&p!=="+"&&(rt=!1),E=(rt?p==="("?p:s:p==="-"||p==="("?"":p)+E,B=(w==="s"&&!isNaN(M)&&Ei!==void 0?rd[8+Ei/3]:"")+B+(rt&&p==="("?")":""),O){for(Q=-1,F=M.length;++Q<F;)if(q=M.charCodeAt(Q),48>q||q>57){B=(q===46?i+M.slice(Q+1):M.slice(Q))+B,M=M.slice(0,Q);break}}}v&&!y&&(M=e(M,1/0));var st=E.length+M.length+B.length,et=st<b?new Array(b-st+1).join(d):"";switch(v&&y&&(M=e(et+M,et.length?b-B.length:1/0),et=""),g){case"<":M=E+M+B+et;break;case"=":M=E+et+M+B;break;case"^":M=et.slice(0,st=et.length>>1)+E+M+B+et.slice(st);break;default:M=et+E+M+B;break}return o(M)}return N.toString=function(){return f+""},N}function u(f,h){var d=Math.max(-8,Math.min(8,Math.floor(ze(h)/3)))*3,g=Math.pow(10,-d),p=l((f=Ve(f),f.type="f",f),{suffix:rd[8+d/3]});return function(x){return p(g*x)}}return{format:l,formatPrefix:u}}var ma,Er,ga;Il({thousands:",",grouping:[3],currency:["$",""]});function Il(t){return ma=id(t),Er=ma.format,ga=ma.formatPrefix,ma}function Bl(t){return Math.max(0,-ze(Math.abs(t)))}function Ol(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ze(e)/3)))*3-ze(Math.abs(t)))}function Nl(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ze(e)-ze(t))+1}function Pl(t,e,n,r){var i=_r(t,e,n),o;switch(r=Ve(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=Ol(i,a))&&(r.precision=o),ga(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Nl(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Bl(i))&&(r.precision=o-(r.type==="%")*2);break}}return Er(r)}function oe(t){var e=t.domain;return t.ticks=function(n){var r=e();return In(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Pl(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],s=r[o],c,l,u=10;for(s<a&&(l=a,a=s,s=l,l=i,i=o,o=l);u-- >0;){if(l=gi(a,s,n),l===c)return r[i]=a,r[o]=s,e(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;c=l}return t},t}function vn(){var t=Ri();return t.copy=function(){return Fe(t,vn())},xt.apply(t,arguments),oe(t)}function Li(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,Rr),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Li(t).unknown(e)},t=arguments.length?Array.from(t,Rr):[0,1],oe(n)}function $i(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],a;return o<i&&(a=n,n=r,r=a,a=i,i=o,o=a),t[n]=e.floor(i),t[r]=e.ceil(o),t}function od(t){return Math.log(t)}function ad(t){return Math.exp(t)}function jy(t){return-Math.log(-t)}function Ky(t){return-Math.exp(-t)}function Qy(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Jy(t){return t===10?Qy:t===Math.E?Math.exp:e=>Math.pow(t,e)}function tv(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function sd(t){return(e,n)=>-t(-e,n)}function ev(t){let e=t(od,ad),n=e.domain,r=10,i,o;function a(){return i=tv(r),o=Jy(r),n()[0]<0?(i=sd(i),o=sd(o),t(jy,Ky)):t(od,ad),e}return e.base=function(s){return arguments.length?(r=+s,a()):r},e.domain=function(s){return arguments.length?(n(s),a()):n()},e.ticks=s=>{let c=n(),l=c[0],u=c[c.length-1],f=u<l;f&&([l,u]=[u,l]);let h=i(l),d=i(u),g,p,x=s==null?10:+s,y=[];if(!(r%1)&&d-h<x){if(h=Math.floor(h),d=Math.ceil(d),l>0){for(;h<=d;++h)for(g=1;g<r;++g)if(p=h<0?g/o(-h):g*o(h),!(p<l)){if(p>u)break;y.push(p)}}else for(;h<=d;++h)for(g=r-1;g>=1;--g)if(p=h>0?g/o(-h):g*o(h),!(p<l)){if(p>u)break;y.push(p)}y.length*2<x&&(y=In(l,u,x))}else y=In(h,d,Math.min(d-h,x)).map(o);return f?y.reverse():y},e.tickFormat=(s,c)=>{if(s==null&&(s=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Ve(c)).precision==null&&(c.trim=!0),c=Er(c)),s===1/0)return c;let l=Math.max(1,r*s/e.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=l?c(u):""}},e.nice=()=>n($i(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),e}function Ii(){let t=ev(Yn()).domain([1,10]);return t.copy=()=>Fe(t,Ii()).base(t.base()),xt.apply(t,arguments),t}function ld(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function cd(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function nv(t){var e=1,n=t(ld(e),cd(e));return n.constant=function(r){return arguments.length?t(ld(e=+r),cd(e)):e},oe(n)}function Bi(){var t=nv(Yn());return t.copy=function(){return Fe(t,Bi()).constant(t.constant())},xt.apply(t,arguments)}function ud(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function rv(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function iv(t){return t<0?-t*t:t*t}function ov(t){var e=t(Pt,Pt),n=1;function r(){return n===1?t(Pt,Pt):n===.5?t(rv,iv):t(ud(n),ud(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},oe(e)}function Lr(){var t=ov(Yn());return t.copy=function(){return Fe(t,Lr()).exponent(t.exponent())},xt.apply(t,arguments),t}function Fl(){return Lr.apply(null,arguments).exponent(.5)}function Oi(){var t=[],e=[],n=[],r;function i(){var a=0,s=Math.max(1,e.length);for(n=new Array(s-1);++a<s;)n[a-1]=ul(t,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:e[je(n,a)]}return o.invertExtent=function(a){var s=e.indexOf(a);return s<0?[NaN,NaN]:[s>0?n[s-1]:t[0],s<n.length?n[s]:t[t.length-1]]},o.domain=function(a){if(!arguments.length)return t.slice();t=[];for(let s of a)s!=null&&!isNaN(s=+s)&&t.push(s);return t.sort(jt),i()},o.range=function(a){return arguments.length?(e=Array.from(a),i()):e.slice()},o.unknown=function(a){return arguments.length?(r=a,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return Oi().domain(t).range(e).unknown(r)},xt.apply(o,arguments)}function Ni(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(c){return c!=null&&c<=c?i[je(r,c,0,n)]:o}function s(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*e-(c-n)*t)/(n+1);return a}return a.domain=function(c){return arguments.length?([t,e]=c,t=+t,e=+e,s()):[t,e]},a.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,s()):i.slice()},a.invertExtent=function(c){var l=i.indexOf(c);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},a.unknown=function(c){return arguments.length&&(o=c),a},a.thresholds=function(){return r.slice()},a.copy=function(){return Ni().domain([t,e]).range(i).unknown(o)},xt.apply(oe(a),arguments)}function Pi(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[je(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var a=e.indexOf(o);return[t[a-1],t[a]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Pi().domain(t).range(e).unknown(n)},xt.apply(i,arguments)}var zl=new Date,Vl=new Date;function ot(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{let a=i(o),s=i.ceil(o);return o-a<s-o?a:s},i.offset=(o,a)=>(e(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{let c=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o<a)||!(s>0))return c;let l;do c.push(l=new Date(+o)),e(o,s),t(o);while(l<o&&o<a);return c},i.filter=o=>ot(a=>{if(a>=a)for(;t(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;e(a,-1),!o(a););else for(;--s>=0;)for(;e(a,1),!o(a););}),n&&(i.count=(o,a)=>(zl.setTime(+o),Vl.setTime(+a),t(zl),t(Vl),Math.floor(n(zl,Vl))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?a=>r(a)%o===0:a=>i.count(0,a)%o===0):i)),i}var Fi=ot(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Fi.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ot(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Fi);var iM=Fi.range;var fe=ot(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),fd=fe.range;var $r=ot(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),av=$r.range,Ir=ot(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),sv=Ir.range;var Br=ot(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),lv=Br.range,Or=ot(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),cv=Or.range;var tn=ot(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),uv=tn.range,qn=ot(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),fv=qn.range,xa=ot(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),hv=xa.range;function Zn(t){return ot(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var en=Zn(0),Nr=Zn(1),dd=Zn(2),pd=Zn(3),bn=Zn(4),md=Zn(5),gd=Zn(6),xd=en.range,dv=Nr.range,pv=dd.range,mv=pd.range,gv=bn.range,xv=md.range,yv=gd.range;function jn(t){return ot(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/6048e5)}var nn=jn(0),Pr=jn(1),yd=jn(2),vd=jn(3),_n=jn(4),bd=jn(5),_d=jn(6),wd=nn.range,vv=Pr.range,bv=yd.range,_v=vd.range,wv=_n.range,Sv=bd.range,kv=_d.range;var Fr=ot(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),Cv=Fr.range,zr=ot(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),Tv=zr.range;var ae=ot(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ae.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ot(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});var Av=ae.range,se=ot(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());se.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ot(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});var Mv=se.range;function kd(t,e,n,r,i,o){let a=[[fe,1,1e3],[fe,5,5*1e3],[fe,15,15*1e3],[fe,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[r,1,864e5],[r,2,2*864e5],[n,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function s(l,u,f){let h=u<l;h&&([l,u]=[u,l]);let d=f&&typeof f.range=="function"?f:c(l,u,f),g=d?d.range(l,+u+1):[];return h?g.reverse():g}function c(l,u,f){let h=Math.abs(u-l)/f,d=$n(([,,x])=>x).right(a,h);if(d===a.length)return t.every(_r(l/31536e6,u/31536e6,f));if(d===0)return Fi.every(Math.max(_r(l,u,f),1));let[g,p]=a[h/a[d-1][2]<a[d][2]/h?d-1:d];return g.every(p)}return[s,c]}var[Wl,Hl]=kd(se,zr,nn,xa,Or,Ir),[Yl,Gl]=kd(ae,Fr,en,tn,Br,$r);function Ul(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Xl(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Vi(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function ql(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,c=t.shortMonths,l=Wi(i),u=Hi(i),f=Wi(o),h=Hi(o),d=Wi(a),g=Hi(a),p=Wi(s),x=Hi(s),y=Wi(c),b=Hi(c),v={a:q,A:rt,b:st,B:et,c:null,d:Rd,e:Rd,f:Qv,g:lb,G:ub,H:Zv,I:jv,j:Kv,L:Bd,m:Jv,M:tb,p:Vt,q:Ht,Q:$d,s:Id,S:eb,u:nb,U:rb,V:ib,w:ob,W:ab,x:null,X:null,y:sb,Y:cb,Z:fb,"%":Ld},m={a:re,A:ie,b:Dt,B:we,c:null,d:Ed,e:Ed,f:mb,g:Cb,G:Ab,H:hb,I:db,j:pb,L:Nd,m:gb,M:xb,p:le,q:S,Q:$d,s:Id,S:yb,u:vb,U:bb,V:_b,w:wb,W:Sb,x:null,X:null,y:kb,Y:Tb,Z:Mb,"%":Ld},_={a:O,A:N,b:M,B:E,c:B,d:Md,e:Md,f:Gv,g:Ad,G:Td,H:Dd,I:Dd,j:Vv,L:Yv,m:zv,M:Wv,p:I,q:Fv,Q:Xv,s:qv,S:Hv,u:Iv,U:Bv,V:Ov,w:$v,W:Nv,x:Q,X:F,y:Ad,Y:Td,Z:Pv,"%":Uv};v.x=w(n,v),v.X=w(r,v),v.c=w(e,v),m.x=w(n,m),m.X=w(r,m),m.c=w(e,m);function w(T,z){return function(V){var D=[],mt=-1,nt=0,Bt=T.length,Yt,Rn,Rf;for(V instanceof Date||(V=new Date(+V));++mt<Bt;)T.charCodeAt(mt)===37&&(D.push(T.slice(nt,mt)),(Rn=Cd[Yt=T.charAt(++mt)])!=null?Yt=T.charAt(++mt):Rn=Yt==="e"?" ":"0",(Rf=z[Yt])&&(Yt=Rf(V,Rn)),D.push(Yt),nt=mt+1);return D.push(T.slice(nt,mt)),D.join("")}}function k(T,z){return function(V){var D=Vi(1900,void 0,1),mt=A(D,T,V+="",0),nt,Bt;if(mt!=V.length)return null;if("Q"in D)return new Date(D.Q);if("s"in D)return new Date(D.s*1e3+("L"in D?D.L:0));if(z&&!("Z"in D)&&(D.Z=0),"p"in D&&(D.H=D.H%12+D.p*12),D.m===void 0&&(D.m="q"in D?D.q:0),"V"in D){if(D.V<1||D.V>53)return null;"w"in D||(D.w=1),"Z"in D?(nt=Xl(Vi(D.y,0,1)),Bt=nt.getUTCDay(),nt=Bt>4||Bt===0?Pr.ceil(nt):Pr(nt),nt=qn.offset(nt,(D.V-1)*7),D.y=nt.getUTCFullYear(),D.m=nt.getUTCMonth(),D.d=nt.getUTCDate()+(D.w+6)%7):(nt=Ul(Vi(D.y,0,1)),Bt=nt.getDay(),nt=Bt>4||Bt===0?Nr.ceil(nt):Nr(nt),nt=tn.offset(nt,(D.V-1)*7),D.y=nt.getFullYear(),D.m=nt.getMonth(),D.d=nt.getDate()+(D.w+6)%7)}else("W"in D||"U"in D)&&("w"in D||(D.w="u"in D?D.u%7:"W"in D?1:0),Bt="Z"in D?Xl(Vi(D.y,0,1)).getUTCDay():Ul(Vi(D.y,0,1)).getDay(),D.m=0,D.d="W"in D?(D.w+6)%7+D.W*7-(Bt+5)%7:D.w+D.U*7-(Bt+6)%7);return"Z"in D?(D.H+=D.Z/100|0,D.M+=D.Z%100,Xl(D)):Ul(D)}}function A(T,z,V,D){for(var mt=0,nt=z.length,Bt=V.length,Yt,Rn;mt<nt;){if(D>=Bt)return-1;if(Yt=z.charCodeAt(mt++),Yt===37){if(Yt=z.charAt(mt++),Rn=_[Yt in Cd?z.charAt(mt++):Yt],!Rn||(D=Rn(T,V,D))<0)return-1}else if(Yt!=V.charCodeAt(D++))return-1}return D}function I(T,z,V){var D=l.exec(z.slice(V));return D?(T.p=u.get(D[0].toLowerCase()),V+D[0].length):-1}function O(T,z,V){var D=d.exec(z.slice(V));return D?(T.w=g.get(D[0].toLowerCase()),V+D[0].length):-1}function N(T,z,V){var D=f.exec(z.slice(V));return D?(T.w=h.get(D[0].toLowerCase()),V+D[0].length):-1}function M(T,z,V){var D=y.exec(z.slice(V));return D?(T.m=b.get(D[0].toLowerCase()),V+D[0].length):-1}function E(T,z,V){var D=p.exec(z.slice(V));return D?(T.m=x.get(D[0].toLowerCase()),V+D[0].length):-1}function B(T,z,V){return A(T,e,z,V)}function Q(T,z,V){return A(T,n,z,V)}function F(T,z,V){return A(T,r,z,V)}function q(T){return a[T.getDay()]}function rt(T){return o[T.getDay()]}function st(T){return c[T.getMonth()]}function et(T){return s[T.getMonth()]}function Vt(T){return i[+(T.getHours()>=12)]}function Ht(T){return 1+~~(T.getMonth()/3)}function re(T){return a[T.getUTCDay()]}function ie(T){return o[T.getUTCDay()]}function Dt(T){return c[T.getUTCMonth()]}function we(T){return s[T.getUTCMonth()]}function le(T){return i[+(T.getUTCHours()>=12)]}function S(T){return 1+~~(T.getUTCMonth()/3)}return{format:function(T){var z=w(T+="",v);return z.toString=function(){return T},z},parse:function(T){var z=k(T+="",!1);return z.toString=function(){return T},z},utcFormat:function(T){var z=w(T+="",m);return z.toString=function(){return T},z},utcParse:function(T){var z=k(T+="",!0);return z.toString=function(){return T},z}}}var Cd={"-":"",_:" ",0:"0"},Et=/^\s*\d+/,Rv=/^%/,Ev=/[\\^$*+?|[\]().{}]/g;function tt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function Lv(t){return t.replace(Ev,"\\$&")}function Wi(t){return new RegExp("^(?:"+t.map(Lv).join("|")+")","i")}function Hi(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function $v(t,e,n){var r=Et.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Iv(t,e,n){var r=Et.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Bv(t,e,n){var r=Et.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Ov(t,e,n){var r=Et.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Nv(t,e,n){var r=Et.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Td(t,e,n){var r=Et.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Ad(t,e,n){var r=Et.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Pv(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Fv(t,e,n){var r=Et.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function zv(t,e,n){var r=Et.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Md(t,e,n){var r=Et.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Vv(t,e,n){var r=Et.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Dd(t,e,n){var r=Et.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Wv(t,e,n){var r=Et.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Hv(t,e,n){var r=Et.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Yv(t,e,n){var r=Et.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Gv(t,e,n){var r=Et.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Uv(t,e,n){var r=Rv.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Xv(t,e,n){var r=Et.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function qv(t,e,n){var r=Et.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Rd(t,e){return tt(t.getDate(),e,2)}function Zv(t,e){return tt(t.getHours(),e,2)}function jv(t,e){return tt(t.getHours()%12||12,e,2)}function Kv(t,e){return tt(1+tn.count(ae(t),t),e,3)}function Bd(t,e){return tt(t.getMilliseconds(),e,3)}function Qv(t,e){return Bd(t,e)+"000"}function Jv(t,e){return tt(t.getMonth()+1,e,2)}function tb(t,e){return tt(t.getMinutes(),e,2)}function eb(t,e){return tt(t.getSeconds(),e,2)}function nb(t){var e=t.getDay();return e===0?7:e}function rb(t,e){return tt(en.count(ae(t)-1,t),e,2)}function Od(t){var e=t.getDay();return e>=4||e===0?bn(t):bn.ceil(t)}function ib(t,e){return t=Od(t),tt(bn.count(ae(t),t)+(ae(t).getDay()===4),e,2)}function ob(t){return t.getDay()}function ab(t,e){return tt(Nr.count(ae(t)-1,t),e,2)}function sb(t,e){return tt(t.getFullYear()%100,e,2)}function lb(t,e){return t=Od(t),tt(t.getFullYear()%100,e,2)}function cb(t,e){return tt(t.getFullYear()%1e4,e,4)}function ub(t,e){var n=t.getDay();return t=n>=4||n===0?bn(t):bn.ceil(t),tt(t.getFullYear()%1e4,e,4)}function fb(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+tt(e/60|0,"0",2)+tt(e%60,"0",2)}function Ed(t,e){return tt(t.getUTCDate(),e,2)}function hb(t,e){return tt(t.getUTCHours(),e,2)}function db(t,e){return tt(t.getUTCHours()%12||12,e,2)}function pb(t,e){return tt(1+qn.count(se(t),t),e,3)}function Nd(t,e){return tt(t.getUTCMilliseconds(),e,3)}function mb(t,e){return Nd(t,e)+"000"}function gb(t,e){return tt(t.getUTCMonth()+1,e,2)}function xb(t,e){return tt(t.getUTCMinutes(),e,2)}function yb(t,e){return tt(t.getUTCSeconds(),e,2)}function vb(t){var e=t.getUTCDay();return e===0?7:e}function bb(t,e){return tt(nn.count(se(t)-1,t),e,2)}function Pd(t){var e=t.getUTCDay();return e>=4||e===0?_n(t):_n.ceil(t)}function _b(t,e){return t=Pd(t),tt(_n.count(se(t),t)+(se(t).getUTCDay()===4),e,2)}function wb(t){return t.getUTCDay()}function Sb(t,e){return tt(Pr.count(se(t)-1,t),e,2)}function kb(t,e){return tt(t.getUTCFullYear()%100,e,2)}function Cb(t,e){return t=Pd(t),tt(t.getUTCFullYear()%100,e,2)}function Tb(t,e){return tt(t.getUTCFullYear()%1e4,e,4)}function Ab(t,e){var n=t.getUTCDay();return t=n>=4||n===0?_n(t):_n.ceil(t),tt(t.getUTCFullYear()%1e4,e,4)}function Mb(){return"+0000"}function Ld(){return"%"}function $d(t){return+t}function Id(t){return Math.floor(+t/1e3)}var Vr,ya,Fd,va,zd;Zl({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Zl(t){return Vr=ql(t),ya=Vr.format,Fd=Vr.parse,va=Vr.utcFormat,zd=Vr.utcParse,Vr}function Db(t){return new Date(t)}function Rb(t){return t instanceof Date?+t:+new Date(+t)}function ba(t,e,n,r,i,o,a,s,c,l){var u=Ri(),f=u.invert,h=u.domain,d=l(".%L"),g=l(":%S"),p=l("%I:%M"),x=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),m=l("%Y");function _(w){return(c(w)<w?d:s(w)<w?g:a(w)<w?p:o(w)<w?x:r(w)<w?i(w)<w?y:b:n(w)<w?v:m)(w)}return u.invert=function(w){return new Date(f(w))},u.domain=function(w){return arguments.length?h(Array.from(w,Rb)):h().map(Db)},u.ticks=function(w){var k=h();return t(k[0],k[k.length-1],w??10)},u.tickFormat=function(w,k){return k==null?_:l(k)},u.nice=function(w){var k=h();return(!w||typeof w.range!="function")&&(w=e(k[0],k[k.length-1],w??10)),w?h($i(k,w)):u},u.copy=function(){return Fe(u,ba(t,e,n,r,i,o,a,s,c,l))},u}function _a(){return xt.apply(ba(Yl,Gl,ae,Fr,en,tn,Br,$r,fe,ya).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function wa(){return xt.apply(ba(Wl,Hl,se,zr,nn,qn,Or,Ir,fe,va).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Eb(){var t=0,e=1,n,r,i,o,a=Pt,s=!1,c;function l(f){return f==null||isNaN(f=+f)?c:a(i===0?.5:(f=(o(f)-n)*i,s?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([t,e]=f,n=o(t=+t),r=o(e=+e),i=n===r?0:1/(r-n),l):[t,e]},l.clamp=function(f){return arguments.length?(s=!!f,l):s},l.interpolator=function(f){return arguments.length?(a=f,l):a};function u(f){return function(h){var d,g;return arguments.length?([d,g]=h,a=f(d,g),l):[a(0),a(1)]}}return l.range=u(kt),l.rangeRound=u(Hn),l.unknown=function(f){return arguments.length?(c=f,l):c},function(f){return o=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),l}}function jl(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Yi(){var t=oe(Eb()(Pt));return t.copy=function(){return jl(t,Yi())},ca.apply(t,arguments)}function Lb(){var t=0,e=.5,n=1,r=1,i,o,a,s,c,l=Pt,u,f=!1,h;function d(p){return isNaN(p=+p)?h:(p=.5+((p=+u(p))-o)*(r*p<r*o?s:c),l(f?Math.max(0,Math.min(1,p)):p))}d.domain=function(p){return arguments.length?([t,e,n]=p,i=u(t=+t),o=u(e=+e),a=u(n=+n),s=i===o?0:.5/(o-i),c=o===a?0:.5/(a-o),r=o<i?-1:1,d):[t,e,n]},d.clamp=function(p){return arguments.length?(f=!!p,d):f},d.interpolator=function(p){return arguments.length?(l=p,d):l};function g(p){return function(x){var y,b,v;return arguments.length?([y,b,v]=x,l=da(p,[y,b,v]),d):[l(0),l(.5),l(1)]}}return d.range=g(kt),d.rangeRound=g(Hn),d.unknown=function(p){return arguments.length?(h=p,d):h},function(p){return u=p,i=p(t),o=p(e),a=p(n),s=i===o?0:.5/(o-i),c=o===a?0:.5/(a-o),r=o<i?-1:1,d}}function Gi(){var t=oe(Lb()(Pt));return t.copy=function(){return jl(t,Gi())},ca.apply(t,arguments)}var $b=ke().range(Array.from({length:Ne.length},(t,e)=>`var(${xn(e)})`)).domain(Array.from({length:Ne.length},(t,e)=>e));function H(t,e,n,r,i){if(Array.isArray(e)&&isFinite(n))return e[n%e.length];let o;if(Kt(e)?o=e(t,n,r):o=e,o)return o;let a=i?.colorFn??$b;if(typeof r=="string"&&r)return a(r);let s=i?.dontFallbackToCssVar??r===!0;return U(n)&&!s?a(n%Ne.length):null}function Ib(t){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:{r:0,g:0,b:0}}function Kl(t){return(.2126*t.r+.7152*t.g+.0722*t.b)/255}function Sa(t){let e=Ib(t);return Kl(e)}function Ui(t,e){let n=Tr(t)?Qe(t,e):t;return gt(n)?.formatHex()}function Vd(t,e){let n=gt(t)?.rgb();if(!n||n.opacity===1)return n;let r=1-n.opacity,i=gt(e??"#fff").rgb();return{r:Math.round((n.opacity*(n.r/255)+r*(i.r/255))*255),g:Math.round((n.opacity*(n.g/255)+r*(i.g/255))*255),b:Math.round((n.opacity*(n.b/255)+r*(i.b/255))*255)}}var dt="unovis-pattern-index",Wd="unovis-pattern-defs";function ft(t,e,n){let r=K(t,e,n);return r?Ih(r):null}function yt(t){return!t||!("svg"in t)?null:`url(#${yl(t.id)})`}var Ql;function Bb(){return Ql===void 0&&(Ql=typeof CSS<"u"&&!!CSS.supports?.("fill","context-stroke")),Ql}function Ob(t,e){return`${vl(t)}-${bh(e.replace("#",""))}`}function Nb(t){let e=t.querySelector(`defs.${Wd}`);return e||(e=document.createElementNS("http://www.w3.org/2000/svg","defs"),e.setAttribute("class",Wd),t.insertBefore(e,t.firstChild)),e}function Wr(t,e,n){if(!t||!("marker"in t))return null;let r=t.dashArray?.length?t.dashArray.join(" "):null;if(Bb())return{marker:`url(#${bl(t.id)})`,dashArray:r};let i=(n instanceof SVGElement?n.ownerSVGElement:null)??n?.closest("svg");if(!i||!e)return{marker:null,dashArray:r};let o=Ui(e,i)||e,a=Ob(t.id,o),s=Nb(i);return s.querySelector(`#${CSS.escape(a)}`)||s.appendChild(Bh(t,a,o)),{marker:`url(#${a})`,dashArray:r}}var tD=globalThis?.UNOVIS_ICON_FONT_FAMILY||"FontAwesome",Hd=globalThis?.UNOVIS_FONT_W2H_RATIO_DEFAULT||.5,Jl=globalThis?.UNOVIS_TEXT_SEPARATOR_DEFAULT||[" ","-",".",","],tc=globalThis?.UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT||"-",ka=globalThis?.UNOVIS_TEXT_DEFAULT_FONT_SIZE||12,rn=globalThis?.UNOVIS_TEXT_DEFAULT||{text:"",fontSize:ka,fontFamily:"var(--vis-font-family)",lineHeight:1.25,marginTop:0,marginBottom:0},eD=lt`
23
+ </marker>`;function Uh(t,e,n){let r=document.createElementNS("http://www.w3.org/2000/svg","marker");return r.setAttribute("id",e),r.setAttribute("fill",n),r.setAttribute("markerUnits","userSpaceOnUse"),r.setAttribute("refX","5"),r.setAttribute("refY","5"),r.setAttribute("markerWidth",String(Pe)),r.setAttribute("markerHeight",String(Pe)),r.innerHTML=t.marker,r}function fv(){let t=$r.map((r,i)=>cv(r,i)).concat($r.map(uv)),e=Ri.map(lv).concat(t).join(""),n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("height","0"),n.setAttribute("width","0"),n.style.position="fixed",n.style.zIndex="-99999999",n.innerHTML=`<defs>${e}</defs>`,document.body.appendChild(n)}typeof window<"u"&&fv();function bt(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function xs(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}var $l=Symbol("implicit");function Te(){var t=new mn,e=[],n=[],r=$l;function i(o){let s=t.get(o);if(s===void 0){if(r!==$l)return r;t.set(o,s=e.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new mn;for(let s of o)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Te(e,n).unknown(r)},bt.apply(i,arguments),i}function vn(){var t=Te().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,s,a=!1,c=0,l=0,u=.5;delete t.unknown;function f(){var h=e().length,d=i<r,x=d?i:r,p=d?r:i;o=(p-x)/Math.max(1,h-c+l*2),a&&(o=Math.floor(o)),x+=(p-x-o*(h-c))*u,s=o*(1-c),a&&(x=Math.round(x),s=Math.round(s));var g=Ar(h).map(function(v){return x+o*v});return n(d?g.reverse():g)}return t.domain=function(h){return arguments.length?(e(h),f()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,a=!0,f()},t.bandwidth=function(){return s},t.step=function(){return o},t.round=function(h){return arguments.length?(a=!!h,f()):a},t.padding=function(h){return arguments.length?(c=Math.min(1,l=+h),f()):c},t.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},t.paddingOuter=function(h){return arguments.length?(l=+h,f()):l},t.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),f()):u},t.copy=function(){return vn(e(),[r,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},bt.apply(f(),arguments)}function Xh(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Xh(e())},t}function Il(){return Xh(vn.apply(null,arguments).paddingInner(1))}function Ol(t,e,n,r,i){var o=t*t,s=o*t;return((1-3*t+3*o-s)*e+(4-6*o+3*s)*n+(1+3*t+3*o-3*s)*r+s*i)/6}function qh(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=r<e-1?t[r+2]:2*o-i;return Ol((n-r/e)*e,s,i,o,a)}}function jh(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],s=t[(r+1)%e],a=t[(r+2)%e];return Ol((n-r/e)*e,i,o,s,a)}}var Ei=t=>()=>t;function hv(t,e){return function(n){return t+n*e}}function dv(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Zh(t){return(t=+t)==1?ys:function(e,n){return n-e?dv(e,n,t):Ei(isNaN(e)?n:e)}}function ys(t,e){var n=e-t;return n?hv(t,n):Ei(isNaN(t)?e:t)}var Gn=(function t(e){var n=Zh(e);function r(i,o){var s=n((i=Dr(i)).r,(o=Dr(o)).r),a=n(i.g,o.g),c=n(i.b,o.b),l=ys(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=t,r})(1);function Kh(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;s<n;++s)a=Dr(e[s]),r[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return r=t(r),i=t(i),o=t(o),a.opacity=1,function(c){return a.r=r(c),a.g=i(c),a.b=o(c),a+""}}}var pv=Kh(qh),mv=Kh(jh);function Qh(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function Jh(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function td(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=Ct(t[s],e[s]);for(;s<n;++s)o[s]=e[s];return function(a){for(s=0;s<r;++s)o[s]=i[s](a);return o}}function ed(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Ft(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function nd(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Ct(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Bl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Nl=new RegExp(Bl.source,"g");function gv(t){return function(){return t}}function xv(t){return function(e){return t(e)+""}}function Di(t,e){var n=Bl.lastIndex=Nl.lastIndex=0,r,i,o,s=-1,a=[],c=[];for(t=t+"",e=e+"";(r=Bl.exec(t))&&(i=Nl.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,c.push({i:s,x:Ft(r,i)})),n=Nl.lastIndex;return n<e.length&&(o=e.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?c[0]?xv(c[0].x):gv(e):(e=c.length,function(l){for(var u=0,f;u<e;++u)a[(f=c[u]).i]=f.x(l);return a.join("")})}function Ct(t,e){var n=typeof e,r;return e==null||n==="boolean"?Ei(e):(n==="number"?Ft:n==="string"?(r=vt(e))?(e=r,Gn):Di:e instanceof vt?Gn:e instanceof Date?ed:Jh(e)?Qh:Array.isArray(e)?td:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?nd:Ft)(t,e)}function Un(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var rd=180/Math.PI,vs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pl(t,e,n,r,i,o){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*rd,skewX:Math.atan(c)*rd,scaleX:s,scaleY:a}}var bs;function id(t){let e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?vs:Pl(e.a,e.b,e.c,e.d,e.e,e.f)}function od(t){return t==null?vs:(bs||(bs=document.createElementNS("http://www.w3.org/2000/svg","g")),bs.setAttribute("transform",t),(t=bs.transform.baseVal.consolidate())?(t=t.matrix,Pl(t.a,t.b,t.c,t.d,t.e,t.f)):vs)}function sd(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,u,f,h,d,x){if(l!==f||u!==h){var p=d.push("translate(",null,e,null,n);x.push({i:p-4,x:Ft(l,f)},{i:p-2,x:Ft(u,h)})}else(f||h)&&d.push("translate("+f+e+h+n)}function s(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Ft(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Ft(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,h,d,x){if(l!==f||u!==h){var p=d.push(i(d)+"scale(",null,",",null,")");x.push({i:p-4,x:Ft(l,f)},{i:p-2,x:Ft(u,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=t(l),u=t(u),o(l.translateX,l.translateY,u.translateX,u.translateY,f,h),s(l.rotate,u.rotate,f,h),a(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(d){for(var x=-1,p=h.length,g;++x<p;)f[(g=h[x]).i]=g.x(d);return f.join("")}}}var Fl=sd(id,"px, ","px)","deg)"),zl=sd(od,", ",")",")");function _s(t,e){e===void 0&&(e=t,t=Ct);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(s){var a=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return o[a](s-a)}}function Vl(t){return function(){return t}}function Ir(t){return+t}var ad=[0,1];function zt(t){return t}function Wl(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Vl(isNaN(e)?NaN:.5)}function yv(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function vv(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1];return i<r?(r=Wl(i,r),o=n(s,o)):(r=Wl(r,i),o=n(o,s)),function(a){return o(r(a))}}function bv(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)i[s]=Wl(t[s],t[s+1]),o[s]=n(e[s],e[s+1]);return function(a){var c=Ze(t,a,1,r)-1;return o[c](i[c](a))}}function Fe(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Xn(){var t=ad,e=ad,n=Ct,r,i,o,s=zt,a,c,l;function u(){var h=Math.min(t.length,e.length);return s!==zt&&(s=yv(t[0],t[h-1])),a=h>2?bv:vv,c=l=null,f}function f(h){return h==null||isNaN(h=+h)?o:(c||(c=a(t.map(r),e,n)))(r(s(h)))}return f.invert=function(h){return s(i((l||(l=a(e,t.map(r),Ft)))(h)))},f.domain=function(h){return arguments.length?(t=Array.from(h,Ir),u()):t.slice()},f.range=function(h){return arguments.length?(e=Array.from(h),u()):e.slice()},f.rangeRound=function(h){return e=Array.from(h),n=Un,u()},f.clamp=function(h){return arguments.length?(s=h?!0:zt,u()):s!==zt},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(o=h,f):o},function(h,d){return r=h,i=d,u()}}function $i(){return Xn()(zt,zt)}function ld(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function qn(t,e){if(!isFinite(t)||t===0)return null;var n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function ze(t){return t=qn(Math.abs(t)),t?t[1]:NaN}function cd(t,e){return function(n,r){for(var i=n.length,o=[],s=0,a=t[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),o.push(n.substring(i-=a,i+a)),!((c+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function ud(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var _v=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ve(t){if(!(e=_v.exec(t)))throw new Error("invalid format: "+t);var e;return new ws({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ve.prototype=ws.prototype;function ws(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}ws.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function fd(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Ii;function hd(t,e){var n=qn(t,e);if(!n)return Ii=void 0,t.toPrecision(e);var r=n[0],i=n[1],o=i-(Ii=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+qn(t,Math.max(0,e+o-1))[0]}function Hl(t,e){var n=qn(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}var Yl={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:ld,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Hl(t*100,e),r:Hl,s:hd,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Gl(t){return t}var dd=Array.prototype.map,pd=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function md(t){var e=t.grouping===void 0||t.thousands===void 0?Gl:cd(dd.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?Gl:ud(dd.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"\u2212":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function l(f,h){f=Ve(f);var d=f.fill,x=f.align,p=f.sign,g=f.symbol,v=f.zero,b=f.width,y=f.comma,m=f.precision,_=f.trim,w=f.type;w==="n"?(y=!0,w="g"):Yl[w]||(m===void 0&&(m=12),_=!0,w="g"),(v||d==="0"&&x==="=")&&(v=!0,d="0",x="=");var k=(h&&h.prefix!==void 0?h.prefix:"")+(g==="$"?n:g==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),M=(g==="$"?r:/[%p]/.test(w)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),N=Yl[w],P=/[defgprs%]/.test(w);m=m===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m));function F(R){var $=k,B=M,et,V,Z;if(w==="c")B=N(R)+B,R="";else{R=+R;var st=R<0||1/R<0;if(R=isNaN(R)?c:N(Math.abs(R),m),_&&(R=fd(R)),st&&+R==0&&p!=="+"&&(st=!1),$=(st?p==="("?p:a:p==="-"||p==="("?"":p)+$,B=(w==="s"&&!isNaN(R)&&Ii!==void 0?pd[8+Ii/3]:"")+B+(st&&p==="("?")":""),P){for(et=-1,V=R.length;++et<V;)if(Z=R.charCodeAt(et),48>Z||Z>57){B=(Z===46?i+R.slice(et+1):R.slice(et))+B,R=R.slice(0,et);break}}}y&&!v&&(R=e(R,1/0));var ct=$.length+R.length+B.length,it=ct<b?new Array(b-ct+1).join(d):"";switch(y&&v&&(R=e(it+R,it.length?b-B.length:1/0),it=""),x){case"<":R=$+R+B+it;break;case"=":R=$+it+R+B;break;case"^":R=it.slice(0,ct=it.length>>1)+$+R+B+it.slice(ct);break;default:R=it+$+R+B;break}return o(R)}return F.toString=function(){return f+""},F}function u(f,h){var d=Math.max(-8,Math.min(8,Math.floor(ze(h)/3)))*3,x=Math.pow(10,-d),p=l((f=Ve(f),f.type="f",f),{suffix:pd[8+d/3]});return function(g){return p(x*g)}}return{format:l,formatPrefix:u}}var Ss,Or,ks;Ul({thousands:",",grouping:[3],currency:["$",""]});function Ul(t){return Ss=md(t),Or=Ss.format,ks=Ss.formatPrefix,Ss}function Xl(t){return Math.max(0,-ze(Math.abs(t)))}function ql(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ze(e)/3)))*3-ze(Math.abs(t)))}function jl(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ze(e)-ze(t))+1}function Zl(t,e,n,r){var i=Tr(t,e,n),o;switch(r=Ve(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=ql(i,s))&&(r.precision=o),ks(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=jl(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Xl(i))&&(r.precision=o-(r.type==="%")*2);break}}return Or(r)}function se(t){var e=t.domain;return t.ticks=function(n){var r=e();return Nn(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Zl(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,s=r[i],a=r[o],c,l,u=10;for(a<s&&(l=s,s=a,a=l,l=i,i=o,o=l);u-- >0;){if(l=bi(s,a,n),l===c)return r[i]=s,r[o]=a,e(r);if(l>0)s=Math.floor(s/l)*l,a=Math.ceil(a/l)*l;else if(l<0)s=Math.ceil(s*l)/l,a=Math.floor(a*l)/l;else break;c=l}return t},t}function bn(){var t=$i();return t.copy=function(){return Fe(t,bn())},bt.apply(t,arguments),se(t)}function Oi(t){var e;function n(r){return r==null||isNaN(r=+r)?e:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(t=Array.from(r,Ir),n):t.slice()},n.unknown=function(r){return arguments.length?(e=r,n):e},n.copy=function(){return Oi(t).unknown(e)},t=arguments.length?Array.from(t,Ir):[0,1],se(n)}function Ni(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),t[n]=e.floor(i),t[r]=e.ceil(o),t}function gd(t){return Math.log(t)}function xd(t){return Math.exp(t)}function wv(t){return-Math.log(-t)}function Sv(t){return-Math.exp(-t)}function kv(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Tv(t){return t===10?kv:t===Math.E?Math.exp:e=>Math.pow(t,e)}function Av(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function yd(t){return(e,n)=>-t(-e,n)}function Cv(t){let e=t(gd,xd),n=e.domain,r=10,i,o;function s(){return i=Av(r),o=Tv(r),n()[0]<0?(i=yd(i),o=yd(o),t(wv,Sv)):t(gd,xd),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{let c=n(),l=c[0],u=c[c.length-1],f=u<l;f&&([l,u]=[u,l]);let h=i(l),d=i(u),x,p,g=a==null?10:+a,v=[];if(!(r%1)&&d-h<g){if(h=Math.floor(h),d=Math.ceil(d),l>0){for(;h<=d;++h)for(x=1;x<r;++x)if(p=h<0?x/o(-h):x*o(h),!(p<l)){if(p>u)break;v.push(p)}}else for(;h<=d;++h)for(x=r-1;x>=1;--x)if(p=h>0?x/o(-h):x*o(h),!(p<l)){if(p>u)break;v.push(p)}v.length*2<g&&(v=Nn(l,u,g))}else v=Nn(h,d,Math.min(d-h,g)).map(o);return f?v.reverse():v},e.tickFormat=(a,c)=>{if(a==null&&(a=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Ve(c)).precision==null&&(c.trim=!0),c=Or(c)),a===1/0)return c;let l=Math.max(1,r*a/e.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=l?c(u):""}},e.nice=()=>n(Ni(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),e}function Bi(){let t=Cv(Xn()).domain([1,10]);return t.copy=()=>Fe(t,Bi()).base(t.base()),bt.apply(t,arguments),t}function vd(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function bd(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Mv(t){var e=1,n=t(vd(e),bd(e));return n.constant=function(r){return arguments.length?t(vd(e=+r),bd(e)):e},se(n)}function Pi(){var t=Mv(Xn());return t.copy=function(){return Fe(t,Pi()).constant(t.constant())},bt.apply(t,arguments)}function _d(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Lv(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Rv(t){return t<0?-t*t:t*t}function Ev(t){var e=t(zt,zt),n=1;function r(){return n===1?t(zt,zt):n===.5?t(Lv,Rv):t(_d(n),_d(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},se(e)}function Nr(){var t=Ev(Xn());return t.copy=function(){return Fe(t,Nr()).exponent(t.exponent())},bt.apply(t,arguments),t}function Kl(){return Nr.apply(null,arguments).exponent(.5)}function Fi(){var t=[],e=[],n=[],r;function i(){var s=0,a=Math.max(1,e.length);for(n=new Array(a-1);++s<a;)n[s-1]=Sl(t,s/a);return o}function o(s){return s==null||isNaN(s=+s)?r:e[Ze(n,s)]}return o.invertExtent=function(s){var a=e.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:t[0],a<n.length?n[a]:t[t.length-1]]},o.domain=function(s){if(!arguments.length)return t.slice();t=[];for(let a of s)a!=null&&!isNaN(a=+a)&&t.push(a);return t.sort(Qt),i()},o.range=function(s){return arguments.length?(e=Array.from(s),i()):e.slice()},o.unknown=function(s){return arguments.length?(r=s,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return Fi().domain(t).range(e).unknown(r)},bt.apply(o,arguments)}function zi(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function s(c){return c!=null&&c<=c?i[Ze(r,c,0,n)]:o}function a(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*e-(c-n)*t)/(n+1);return s}return s.domain=function(c){return arguments.length?([t,e]=c,t=+t,e=+e,a()):[t,e]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,a()):i.slice()},s.invertExtent=function(c){var l=i.indexOf(c);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},s.unknown=function(c){return arguments.length&&(o=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return zi().domain([t,e]).range(i).unknown(o)},bt.apply(se(s),arguments)}function Vi(){var t=[.5],e=[0,1],n,r=1;function i(o){return o!=null&&o<=o?e[Ze(t,o,0,r)]:n}return i.domain=function(o){return arguments.length?(t=Array.from(o),r=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(o){return arguments.length?(e=Array.from(o),r=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(o){var s=e.indexOf(o);return[t[s-1],t[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Vi().domain(t).range(e).unknown(n)},bt.apply(i,arguments)}var Ql=new Date,Jl=new Date;function at(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{let s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{let c=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return c;let l;do c.push(l=new Date(+o)),e(o,a),t(o);while(l<o&&o<s);return c},i.filter=o=>at(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(i.count=(o,s)=>(Ql.setTime(+o),Jl.setTime(+s),t(Ql),t(Jl),Math.floor(n(Ql,Jl))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}var Wi=at(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Wi.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?at(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Wi);var CM=Wi.range;var he=at(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),wd=he.range;var Br=at(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),Dv=Br.range,Pr=at(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),$v=Pr.range;var Fr=at(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),Iv=Fr.range,zr=at(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),Ov=zr.range;var tn=at(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),Nv=tn.range,Kn=at(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),Bv=Kn.range,Ts=at(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),Pv=Ts.range;function Qn(t){return at(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}var en=Qn(0),Vr=Qn(1),kd=Qn(2),Td=Qn(3),_n=Qn(4),Ad=Qn(5),Cd=Qn(6),Md=en.range,Fv=Vr.range,zv=kd.range,Vv=Td.range,Wv=_n.range,Hv=Ad.range,Yv=Cd.range;function Jn(t){return at(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/6048e5)}var nn=Jn(0),Wr=Jn(1),Ld=Jn(2),Rd=Jn(3),wn=Jn(4),Ed=Jn(5),Dd=Jn(6),$d=nn.range,Gv=Wr.range,Uv=Ld.range,Xv=Rd.range,qv=wn.range,jv=Ed.range,Zv=Dd.range;var Hr=at(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),Kv=Hr.range,Yr=at(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),Qv=Yr.range;var ae=at(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());ae.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:at(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});var Jv=ae.range,le=at(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());le.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:at(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});var tb=le.range;function Od(t,e,n,r,i,o){let s=[[he,1,1e3],[he,5,5*1e3],[he,15,15*1e3],[he,30,30*1e3],[o,1,6e4],[o,5,5*6e4],[o,15,15*6e4],[o,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[r,1,864e5],[r,2,2*864e5],[n,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function a(l,u,f){let h=u<l;h&&([l,u]=[u,l]);let d=f&&typeof f.range=="function"?f:c(l,u,f),x=d?d.range(l,+u+1):[];return h?x.reverse():x}function c(l,u,f){let h=Math.abs(u-l)/f,d=On(([,,g])=>g).right(s,h);if(d===s.length)return t.every(Tr(l/31536e6,u/31536e6,f));if(d===0)return Wi.every(Math.max(Tr(l,u,f),1));let[x,p]=s[h/s[d-1][2]<s[d][2]/h?d-1:d];return x.every(p)}return[a,c]}var[tc,ec]=Od(le,Yr,nn,Ts,zr,Pr),[nc,rc]=Od(ae,Hr,en,tn,Fr,Br);function ic(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function oc(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Yi(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function sc(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,s=t.shortDays,a=t.months,c=t.shortMonths,l=Gi(i),u=Ui(i),f=Gi(o),h=Ui(o),d=Gi(s),x=Ui(s),p=Gi(a),g=Ui(a),v=Gi(c),b=Ui(c),y={a:Z,A:st,b:ct,B:it,c:null,d:Vd,e:Vd,f:kb,g:Ib,G:Nb,H:_b,I:wb,j:Sb,L:Ud,m:Tb,M:Ab,p:Ht,q:Gt,Q:Yd,s:Gd,S:Cb,u:Mb,U:Lb,V:Rb,w:Eb,W:Db,x:null,X:null,y:$b,Y:Ob,Z:Bb,"%":Hd},m={a:ie,A:oe,b:Et,B:Se,c:null,d:Wd,e:Wd,f:Vb,g:Kb,G:Jb,H:Pb,I:Fb,j:zb,L:qd,m:Wb,M:Hb,p:ce,q:S,Q:Yd,s:Gd,S:Yb,u:Gb,U:Ub,V:Xb,w:qb,W:jb,x:null,X:null,y:Zb,Y:Qb,Z:t_,"%":Hd},_={a:P,A:F,b:R,B:$,c:B,d:Fd,e:Fd,f:xb,g:Pd,G:Bd,H:zd,I:zd,j:db,L:gb,m:hb,M:pb,p:N,q:fb,Q:vb,s:bb,S:mb,u:sb,U:ab,V:lb,w:ob,W:cb,x:et,X:V,y:Pd,Y:Bd,Z:ub,"%":yb};y.x=w(n,y),y.X=w(r,y),y.c=w(e,y),m.x=w(n,m),m.X=w(r,m),m.c=w(e,m);function w(A,W){return function(H){var E=[],yt=-1,ot=0,Bt=A.length,Ut,Dn,Wf;for(H instanceof Date||(H=new Date(+H));++yt<Bt;)A.charCodeAt(yt)===37&&(E.push(A.slice(ot,yt)),(Dn=Nd[Ut=A.charAt(++yt)])!=null?Ut=A.charAt(++yt):Dn=Ut==="e"?" ":"0",(Wf=W[Ut])&&(Ut=Wf(H,Dn)),E.push(Ut),ot=yt+1);return E.push(A.slice(ot,yt)),E.join("")}}function k(A,W){return function(H){var E=Yi(1900,void 0,1),yt=M(E,A,H+="",0),ot,Bt;if(yt!=H.length)return null;if("Q"in E)return new Date(E.Q);if("s"in E)return new Date(E.s*1e3+("L"in E?E.L:0));if(W&&!("Z"in E)&&(E.Z=0),"p"in E&&(E.H=E.H%12+E.p*12),E.m===void 0&&(E.m="q"in E?E.q:0),"V"in E){if(E.V<1||E.V>53)return null;"w"in E||(E.w=1),"Z"in E?(ot=oc(Yi(E.y,0,1)),Bt=ot.getUTCDay(),ot=Bt>4||Bt===0?Wr.ceil(ot):Wr(ot),ot=Kn.offset(ot,(E.V-1)*7),E.y=ot.getUTCFullYear(),E.m=ot.getUTCMonth(),E.d=ot.getUTCDate()+(E.w+6)%7):(ot=ic(Yi(E.y,0,1)),Bt=ot.getDay(),ot=Bt>4||Bt===0?Vr.ceil(ot):Vr(ot),ot=tn.offset(ot,(E.V-1)*7),E.y=ot.getFullYear(),E.m=ot.getMonth(),E.d=ot.getDate()+(E.w+6)%7)}else("W"in E||"U"in E)&&("w"in E||(E.w="u"in E?E.u%7:"W"in E?1:0),Bt="Z"in E?oc(Yi(E.y,0,1)).getUTCDay():ic(Yi(E.y,0,1)).getDay(),E.m=0,E.d="W"in E?(E.w+6)%7+E.W*7-(Bt+5)%7:E.w+E.U*7-(Bt+6)%7);return"Z"in E?(E.H+=E.Z/100|0,E.M+=E.Z%100,oc(E)):ic(E)}}function M(A,W,H,E){for(var yt=0,ot=W.length,Bt=H.length,Ut,Dn;yt<ot;){if(E>=Bt)return-1;if(Ut=W.charCodeAt(yt++),Ut===37){if(Ut=W.charAt(yt++),Dn=_[Ut in Nd?W.charAt(yt++):Ut],!Dn||(E=Dn(A,H,E))<0)return-1}else if(Ut!=H.charCodeAt(E++))return-1}return E}function N(A,W,H){var E=l.exec(W.slice(H));return E?(A.p=u.get(E[0].toLowerCase()),H+E[0].length):-1}function P(A,W,H){var E=d.exec(W.slice(H));return E?(A.w=x.get(E[0].toLowerCase()),H+E[0].length):-1}function F(A,W,H){var E=f.exec(W.slice(H));return E?(A.w=h.get(E[0].toLowerCase()),H+E[0].length):-1}function R(A,W,H){var E=v.exec(W.slice(H));return E?(A.m=b.get(E[0].toLowerCase()),H+E[0].length):-1}function $(A,W,H){var E=p.exec(W.slice(H));return E?(A.m=g.get(E[0].toLowerCase()),H+E[0].length):-1}function B(A,W,H){return M(A,e,W,H)}function et(A,W,H){return M(A,n,W,H)}function V(A,W,H){return M(A,r,W,H)}function Z(A){return s[A.getDay()]}function st(A){return o[A.getDay()]}function ct(A){return c[A.getMonth()]}function it(A){return a[A.getMonth()]}function Ht(A){return i[+(A.getHours()>=12)]}function Gt(A){return 1+~~(A.getMonth()/3)}function ie(A){return s[A.getUTCDay()]}function oe(A){return o[A.getUTCDay()]}function Et(A){return c[A.getUTCMonth()]}function Se(A){return a[A.getUTCMonth()]}function ce(A){return i[+(A.getUTCHours()>=12)]}function S(A){return 1+~~(A.getUTCMonth()/3)}return{format:function(A){var W=w(A+="",y);return W.toString=function(){return A},W},parse:function(A){var W=k(A+="",!1);return W.toString=function(){return A},W},utcFormat:function(A){var W=w(A+="",m);return W.toString=function(){return A},W},utcParse:function(A){var W=k(A+="",!0);return W.toString=function(){return A},W}}}var Nd={"-":"",_:" ",0:"0"},$t=/^\s*\d+/,nb=/^%/,rb=/[\\^$*+?|[\]().{}]/g;function rt(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function ib(t){return t.replace(rb,"\\$&")}function Gi(t){return new RegExp("^(?:"+t.map(ib).join("|")+")","i")}function Ui(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function ob(t,e,n){var r=$t.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function sb(t,e,n){var r=$t.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function ab(t,e,n){var r=$t.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function lb(t,e,n){var r=$t.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function cb(t,e,n){var r=$t.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Bd(t,e,n){var r=$t.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Pd(t,e,n){var r=$t.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ub(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function fb(t,e,n){var r=$t.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function hb(t,e,n){var r=$t.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Fd(t,e,n){var r=$t.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function db(t,e,n){var r=$t.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function zd(t,e,n){var r=$t.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function pb(t,e,n){var r=$t.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function mb(t,e,n){var r=$t.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function gb(t,e,n){var r=$t.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function xb(t,e,n){var r=$t.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function yb(t,e,n){var r=nb.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function vb(t,e,n){var r=$t.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function bb(t,e,n){var r=$t.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Vd(t,e){return rt(t.getDate(),e,2)}function _b(t,e){return rt(t.getHours(),e,2)}function wb(t,e){return rt(t.getHours()%12||12,e,2)}function Sb(t,e){return rt(1+tn.count(ae(t),t),e,3)}function Ud(t,e){return rt(t.getMilliseconds(),e,3)}function kb(t,e){return Ud(t,e)+"000"}function Tb(t,e){return rt(t.getMonth()+1,e,2)}function Ab(t,e){return rt(t.getMinutes(),e,2)}function Cb(t,e){return rt(t.getSeconds(),e,2)}function Mb(t){var e=t.getDay();return e===0?7:e}function Lb(t,e){return rt(en.count(ae(t)-1,t),e,2)}function Xd(t){var e=t.getDay();return e>=4||e===0?_n(t):_n.ceil(t)}function Rb(t,e){return t=Xd(t),rt(_n.count(ae(t),t)+(ae(t).getDay()===4),e,2)}function Eb(t){return t.getDay()}function Db(t,e){return rt(Vr.count(ae(t)-1,t),e,2)}function $b(t,e){return rt(t.getFullYear()%100,e,2)}function Ib(t,e){return t=Xd(t),rt(t.getFullYear()%100,e,2)}function Ob(t,e){return rt(t.getFullYear()%1e4,e,4)}function Nb(t,e){var n=t.getDay();return t=n>=4||n===0?_n(t):_n.ceil(t),rt(t.getFullYear()%1e4,e,4)}function Bb(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+rt(e/60|0,"0",2)+rt(e%60,"0",2)}function Wd(t,e){return rt(t.getUTCDate(),e,2)}function Pb(t,e){return rt(t.getUTCHours(),e,2)}function Fb(t,e){return rt(t.getUTCHours()%12||12,e,2)}function zb(t,e){return rt(1+Kn.count(le(t),t),e,3)}function qd(t,e){return rt(t.getUTCMilliseconds(),e,3)}function Vb(t,e){return qd(t,e)+"000"}function Wb(t,e){return rt(t.getUTCMonth()+1,e,2)}function Hb(t,e){return rt(t.getUTCMinutes(),e,2)}function Yb(t,e){return rt(t.getUTCSeconds(),e,2)}function Gb(t){var e=t.getUTCDay();return e===0?7:e}function Ub(t,e){return rt(nn.count(le(t)-1,t),e,2)}function jd(t){var e=t.getUTCDay();return e>=4||e===0?wn(t):wn.ceil(t)}function Xb(t,e){return t=jd(t),rt(wn.count(le(t),t)+(le(t).getUTCDay()===4),e,2)}function qb(t){return t.getUTCDay()}function jb(t,e){return rt(Wr.count(le(t)-1,t),e,2)}function Zb(t,e){return rt(t.getUTCFullYear()%100,e,2)}function Kb(t,e){return t=jd(t),rt(t.getUTCFullYear()%100,e,2)}function Qb(t,e){return rt(t.getUTCFullYear()%1e4,e,4)}function Jb(t,e){var n=t.getUTCDay();return t=n>=4||n===0?wn(t):wn.ceil(t),rt(t.getUTCFullYear()%1e4,e,4)}function t_(){return"+0000"}function Hd(){return"%"}function Yd(t){return+t}function Gd(t){return Math.floor(+t/1e3)}var Gr,As,Zd,Cs,Kd;ac({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function ac(t){return Gr=sc(t),As=Gr.format,Zd=Gr.parse,Cs=Gr.utcFormat,Kd=Gr.utcParse,Gr}function e_(t){return new Date(t)}function n_(t){return t instanceof Date?+t:+new Date(+t)}function Ms(t,e,n,r,i,o,s,a,c,l){var u=$i(),f=u.invert,h=u.domain,d=l(".%L"),x=l(":%S"),p=l("%I:%M"),g=l("%I %p"),v=l("%a %d"),b=l("%b %d"),y=l("%B"),m=l("%Y");function _(w){return(c(w)<w?d:a(w)<w?x:s(w)<w?p:o(w)<w?g:r(w)<w?i(w)<w?v:b:n(w)<w?y:m)(w)}return u.invert=function(w){return new Date(f(w))},u.domain=function(w){return arguments.length?h(Array.from(w,n_)):h().map(e_)},u.ticks=function(w){var k=h();return t(k[0],k[k.length-1],w??10)},u.tickFormat=function(w,k){return k==null?_:l(k)},u.nice=function(w){var k=h();return(!w||typeof w.range!="function")&&(w=e(k[0],k[k.length-1],w??10)),w?h(Ni(k,w)):u},u.copy=function(){return Fe(u,Ms(t,e,n,r,i,o,s,a,c,l))},u}function Ls(){return bt.apply(Ms(nc,rc,ae,Hr,en,tn,Fr,Br,he,As).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Rs(){return bt.apply(Ms(tc,ec,le,Yr,nn,Kn,zr,Pr,he,Cs).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function r_(){var t=0,e=1,n,r,i,o,s=zt,a=!1,c;function l(f){return f==null||isNaN(f=+f)?c:s(i===0?.5:(f=(o(f)-n)*i,a?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([t,e]=f,n=o(t=+t),r=o(e=+e),i=n===r?0:1/(r-n),l):[t,e]},l.clamp=function(f){return arguments.length?(a=!!f,l):a},l.interpolator=function(f){return arguments.length?(s=f,l):s};function u(f){return function(h){var d,x;return arguments.length?([d,x]=h,s=f(d,x),l):[s(0),s(1)]}}return l.range=u(Ct),l.rangeRound=u(Un),l.unknown=function(f){return arguments.length?(c=f,l):c},function(f){return o=f,n=f(t),r=f(e),i=n===r?0:1/(r-n),l}}function lc(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Xi(){var t=se(r_()(zt));return t.copy=function(){return lc(t,Xi())},xs.apply(t,arguments)}function i_(){var t=0,e=.5,n=1,r=1,i,o,s,a,c,l=zt,u,f=!1,h;function d(p){return isNaN(p=+p)?h:(p=.5+((p=+u(p))-o)*(r*p<r*o?a:c),l(f?Math.max(0,Math.min(1,p)):p))}d.domain=function(p){return arguments.length?([t,e,n]=p,i=u(t=+t),o=u(e=+e),s=u(n=+n),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,d):[t,e,n]},d.clamp=function(p){return arguments.length?(f=!!p,d):f},d.interpolator=function(p){return arguments.length?(l=p,d):l};function x(p){return function(g){var v,b,y;return arguments.length?([v,b,y]=g,l=_s(p,[v,b,y]),d):[l(0),l(.5),l(1)]}}return d.range=x(Ct),d.rangeRound=x(Un),d.unknown=function(p){return arguments.length?(h=p,d):h},function(p){return u=p,i=p(t),o=p(e),s=p(n),a=i===o?0:.5/(o-i),c=o===s?0:.5/(s-o),r=o<i?-1:1,d}}function qi(){var t=se(i_()(zt));return t.copy=function(){return lc(t,qi())},xs.apply(t,arguments)}var o_=Te().range(Array.from({length:Be.length},(t,e)=>`var(${yn(e)})`)).domain(Array.from({length:Be.length},(t,e)=>e));function X(t,e,n,r,i){if(Array.isArray(e)&&isFinite(n))return e[n%e.length];let o;if(Jt(e)?o=e(t,n,r):o=e,o)return o;let s=i?.colorFn??o_;if(typeof r=="string"&&r)return s(r);let a=i?.dontFallbackToCssVar??r===!0;return U(n)&&!a?s(n%Be.length):null}function s_(t){let e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:{r:0,g:0,b:0}}function cc(t){return(.2126*t.r+.7152*t.g+.0722*t.b)/255}function Es(t){let e=s_(t);return cc(e)}function ji(t,e){let n=Rr(t)?Qe(t,e):t;return vt(n)?.formatHex()}function Qd(t,e){let n=vt(t)?.rgb();if(!n||n.opacity===1)return n;let r=1-n.opacity,i=vt(e??"#fff").rgb();return{r:Math.round((n.opacity*(n.r/255)+r*(i.r/255))*255),g:Math.round((n.opacity*(n.g/255)+r*(i.g/255))*255),b:Math.round((n.opacity*(n.b/255)+r*(i.b/255))*255)}}var gt="unovis-pattern-index",Jd="unovis-pattern-defs";function dt(t,e,n){let r=K(t,e,n);return r?Gh(r):null}function _t(t){return!t||!("svg"in t)?null:`url(#${Rl(t.id)})`}var uc;function a_(){return uc===void 0&&(uc=typeof CSS<"u"&&!!CSS.supports?.("fill","context-stroke")),uc}function l_(t,e){return`${El(t)}-${Dh(e.replace("#",""))}`}function c_(t){let e=t.querySelector(`defs.${Jd}`);return e||(e=document.createElementNS("http://www.w3.org/2000/svg","defs"),e.setAttribute("class",Jd),t.insertBefore(e,t.firstChild)),e}function Ur(t,e,n){if(!t||!("marker"in t))return null;let r=t.dashArray?.length?t.dashArray.join(" "):null;if(a_())return{marker:`url(#${Dl(t.id)})`,dashArray:r};let i=(n instanceof SVGElement?n.ownerSVGElement:null)??n?.closest("svg");if(!i||!e)return{marker:null,dashArray:r};let o=ji(e,i)||e,s=l_(t.id,o),a=c_(i);return a.querySelector(`#${CSS.escape(s)}`)||a.appendChild(Uh(t,s,o)),{marker:`url(#${s})`,dashArray:r}}var SL=globalThis?.UNOVIS_ICON_FONT_FAMILY||"FontAwesome",tp=globalThis?.UNOVIS_FONT_W2H_RATIO_DEFAULT||.5,fc=globalThis?.UNOVIS_TEXT_SEPARATOR_DEFAULT||[" ","-",".",","],hc=globalThis?.UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT||"-",Sn=globalThis?.UNOVIS_TEXT_DEFAULT_FONT_SIZE||12,rn=globalThis?.UNOVIS_TEXT_DEFAULT||{text:"",fontSize:Sn,fontFamily:"var(--vis-font-family)",lineHeight:1.25,marginTop:0,marginBottom:0},kL=ut`
24
24
  :root {
25
25
  label: vis-root-styles;
26
26
  --vis-font-family: Inter, Arial, "Helvetica Neue", Helvetica, sans-serif;
27
- --vis-font-wh-ratio: ${Hd};
28
- --vis-color-main: var(${xn(0)});
29
- --vis-color-main-light: ${Lh(Ne[0])};
30
- --vis-color-main-dark: ${$h(Ne[0])};
27
+ --vis-font-wh-ratio: ${tp};
28
+ --vis-color-main: var(${yn(0)});
29
+ --vis-color-main-light: ${Hh(Be[0])};
30
+ --vis-color-main-dark: ${Yh(Be[0])};
31
31
  --vis-color-grey: #2a2a2a;
32
- ${Ne.map((t,e)=>`${xn(e)}: ${t};`)}
33
- ${Eh.map((t,e)=>`--vis-dark-color${e}: ${t};`)}
34
- ${Ai.map((t,e)=>`
35
- --${Vn(t)}: url(#${Vn(t)});
36
- --vis-pattern-fill${e}: var(--${Vn(t)});
32
+ ${Be.map((t,e)=>`${yn(e)}: ${t};`)}
33
+ ${Wh.map((t,e)=>`--vis-dark-color${e}: ${t};`)}
34
+ ${Ri.map((t,e)=>`
35
+ --${Yn(t)}: url(#${Yn(t)});
36
+ --vis-pattern-fill${e}: var(--${Yn(t)});
37
37
  `)}
38
- ${Dr.map((t,e)=>`
39
- --${Vn(t)}: url(#${Vn(t)});
40
- --vis-pattern-marker${e}: var(--${Vn(t)});
38
+ ${$r.map((t,e)=>`
39
+ --${Yn(t)}: url(#${Yn(t)});
40
+ --vis-pattern-marker${e}: var(--${Yn(t)});
41
41
  --vis-pattern-dasharray${e}: ${t.dashArray?.join(" ")};
42
42
  `)}
43
43
 
44
- ${St} {
45
- ${Ne.map((t,e)=>`${xn(e)}: var(--vis-dark-color${e});`)}
44
+ ${At} {
45
+ ${Be.map((t,e)=>`${yn(e)}: var(--vis-dark-color${e});`)}
46
46
  }
47
47
 
48
48
  body.theme-patterns {
49
- ${Ai.map((t,e)=>`path[${dt}="${e}"][style*="fill"]:not([style*="mask"]) {
49
+ ${Ri.map((t,e)=>`path[${gt}="${e}"][style*="fill"]:not([style*="mask"]) {
50
50
  mask: var(--vis-pattern-fill${e});
51
51
  }`)}
52
- ${Dr.map((t,e)=>`
53
- path[${dt}="${e}"]:not([style*="fill"]):not([style*="marker"]) {
52
+ ${$r.map((t,e)=>`
53
+ path[${gt}="${e}"]:not([style*="fill"]):not([style*="marker"]) {
54
54
  marker: var(--vis-pattern-marker${e});
55
55
  stroke-dasharray: var(--vis-pattern-dasharray${e});
56
56
  }
57
57
  `)}
58
58
  }
59
- `;function Xi(t=window?.document.body){return t?+Qe("var(--vis-font-wh-ratio)",t):Hd}var Ca="http://www.w3.org/1999/xhtml",ec={svg:"http://www.w3.org/2000/svg",xhtml:Ca,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function on(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),ec.hasOwnProperty(e)?{space:ec[e],local:t}:t}function Pb(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ca&&e.documentElement.namespaceURI===Ca?e.createElement(t):e.createElementNS(n,t)}}function Fb(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ta(t){var e=on(t);return(e.local?Fb:Pb)(e)}function zb(){}function Kn(t){return t==null?zb:function(){return this.querySelector(t)}}function Yd(t){typeof t!="function"&&(t=Kn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),c,l,u=0;u<a;++u)(c=o[u])&&(l=t.call(c,c.__data__,u,o))&&("__data__"in c&&(l.__data__=c.__data__),s[u]=l);return new vt(r,this._parents)}function nc(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Vb(){return[]}function qi(t){return t==null?Vb:function(){return this.querySelectorAll(t)}}function Wb(t){return function(){return nc(t.apply(this,arguments))}}function Gd(t){typeof t=="function"?t=Wb(t):t=qi(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,c,l=0;l<s;++l)(c=a[l])&&(r.push(t.call(c,c.__data__,l,a)),i.push(c));return new vt(r,i)}function Zi(t){return function(){return this.matches(t)}}function Aa(t){return function(e){return e.matches(t)}}var Hb=Array.prototype.find;function Yb(t){return function(){return Hb.call(this.children,t)}}function Gb(){return this.firstElementChild}function Ud(t){return this.select(t==null?Gb:Yb(typeof t=="function"?t:Aa(t)))}var Ub=Array.prototype.filter;function Xb(){return Array.from(this.children)}function qb(t){return function(){return Ub.call(this.children,t)}}function Xd(t){return this.selectAll(t==null?Xb:qb(typeof t=="function"?t:Aa(t)))}function qd(t){typeof t!="function"&&(t=Zi(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],c,l=0;l<a;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&s.push(c);return new vt(r,this._parents)}function Ma(t){return new Array(t.length)}function Zd(){return new vt(this._enter||this._groups.map(Ma),this._parents)}function ji(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ji.prototype={constructor:ji,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function jd(t){return function(){return t}}function Zb(t,e,n,r,i,o){for(var a=0,s,c=e.length,l=o.length;a<l;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new ji(t,o[a]);for(;a<c;++a)(s=e[a])&&(i[a]=s)}function jb(t,e,n,r,i,o,a){var s,c,l=new Map,u=e.length,f=o.length,h=new Array(u),d;for(s=0;s<u;++s)(c=e[s])&&(h[s]=d=a.call(c,c.__data__,s,e)+"",l.has(d)?i[s]=c:l.set(d,c));for(s=0;s<f;++s)d=a.call(t,o[s],s,o)+"",(c=l.get(d))?(r[s]=c,c.__data__=o[s],l.delete(d)):n[s]=new ji(t,o[s]);for(s=0;s<u;++s)(c=e[s])&&l.get(h[s])===c&&(i[s]=c)}function Kb(t){return t.__data__}function Kd(t,e){if(!arguments.length)return Array.from(this,Kb);var n=e?jb:Zb,r=this._parents,i=this._groups;typeof t!="function"&&(t=jd(t));for(var o=i.length,a=new Array(o),s=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],f=i[l],h=f.length,d=Qb(t.call(u,u&&u.__data__,l,r)),g=d.length,p=s[l]=new Array(g),x=a[l]=new Array(g),y=c[l]=new Array(h);n(u,f,p,x,y,d,e);for(var b=0,v=0,m,_;b<g;++b)if(m=p[b]){for(b>=v&&(v=b+1);!(_=x[v])&&++v<g;);m._next=_||null}}return a=new vt(a,r),a._enter=s,a._exit=c,a}function Qb(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Qd(){return new vt(this._exit||this._groups.map(Ma),this._parents)}function Jd(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function tp(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),c=0;c<a;++c)for(var l=n[c],u=r[c],f=l.length,h=s[c]=new Array(f),d,g=0;g<f;++g)(d=l[g]||u[g])&&(h[g]=d);for(;c<i;++c)s[c]=n[c];return new vt(s,this._parents)}function ep(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function np(t){t||(t=Jb);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,c=i[o]=new Array(s),l,u=0;u<s;++u)(l=a[u])&&(c[u]=l);c.sort(e)}return new vt(i,this._parents).order()}function Jb(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function rp(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ip(){return Array.from(this)}function op(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function ap(){let t=0;for(let e of this)++t;return t}function sp(){return!this.node()}function lp(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function t_(t){return function(){this.removeAttribute(t)}}function e_(t){return function(){this.removeAttributeNS(t.space,t.local)}}function n_(t,e){return function(){this.setAttribute(t,e)}}function r_(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function i_(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function o_(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function cp(t,e){var n=on(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?e_:t_:typeof e=="function"?n.local?o_:i_:n.local?r_:n_)(n,e))}function Da(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function a_(t){return function(){this.style.removeProperty(t)}}function s_(t,e,n){return function(){this.style.setProperty(t,e,n)}}function l_(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function up(t,e,n){return arguments.length>1?this.each((e==null?a_:typeof e=="function"?l_:s_)(t,e,n??"")):wn(this.node(),t)}function wn(t,e){return t.style.getPropertyValue(e)||Da(t).getComputedStyle(t,null).getPropertyValue(e)}function c_(t){return function(){delete this[t]}}function u_(t,e){return function(){this[t]=e}}function f_(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function fp(t,e){return arguments.length>1?this.each((e==null?c_:typeof e=="function"?f_:u_)(t,e)):this.node()[t]}function hp(t){return t.trim().split(/^|\s+/)}function rc(t){return t.classList||new dp(t)}function dp(t){this._node=t,this._names=hp(t.getAttribute("class")||"")}dp.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function pp(t,e){for(var n=rc(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function mp(t,e){for(var n=rc(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function h_(t){return function(){pp(this,t)}}function d_(t){return function(){mp(this,t)}}function p_(t,e){return function(){(e.apply(this,arguments)?pp:mp)(this,t)}}function gp(t,e){var n=hp(t+"");if(arguments.length<2){for(var r=rc(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?p_:e?h_:d_)(n,e))}function m_(){this.textContent=""}function g_(t){return function(){this.textContent=t}}function x_(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function xp(t){return arguments.length?this.each(t==null?m_:(typeof t=="function"?x_:g_)(t)):this.node().textContent}function y_(){this.innerHTML=""}function v_(t){return function(){this.innerHTML=t}}function b_(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function yp(t){return arguments.length?this.each(t==null?y_:(typeof t=="function"?b_:v_)(t)):this.node().innerHTML}function __(){this.nextSibling&&this.parentNode.appendChild(this)}function vp(){return this.each(__)}function w_(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function bp(){return this.each(w_)}function _p(t){var e=typeof t=="function"?t:Ta(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function S_(){return null}function wp(t,e){var n=typeof t=="function"?t:Ta(t),r=e==null?S_:typeof e=="function"?e:Kn(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function k_(){var t=this.parentNode;t&&t.removeChild(this)}function Sp(){return this.each(k_)}function C_(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function T_(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function kp(t){return this.select(t?T_:C_)}function Cp(t){return arguments.length?this.property("__data__",t):this.node().__data__}function A_(t){return function(e){t.call(this,e,this.__data__)}}function M_(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function D_(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function R_(t,e,n){return function(){var r=this.__on,i,o=A_(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Tp(t,e,n){var r=M_(t+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<o;++i)if((a=r[i]).type===u.type&&a.name===u.name)return u.value}return}for(s=e?R_:D_,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function Ap(t,e,n){var r=Da(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function E_(t,e){return function(){return Ap(this,t,e)}}function L_(t,e){return function(){return Ap(this,t,e.apply(this,arguments))}}function Mp(t,e){return this.each((typeof e=="function"?L_:E_)(t,e))}function*Dp(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var ic=[null];function vt(t,e){this._groups=t,this._parents=e}function Rp(){return new vt([[document.documentElement]],ic)}function $_(){return this}vt.prototype=Rp.prototype={constructor:vt,select:Yd,selectAll:Gd,selectChild:Ud,selectChildren:Xd,filter:qd,data:Kd,enter:Zd,exit:Qd,join:Jd,merge:tp,selection:$_,order:ep,sort:np,call:rp,nodes:ip,node:op,size:ap,empty:sp,each:lp,attr:cp,style:up,property:fp,classed:gp,text:xp,html:yp,raise:vp,lower:bp,append:_p,insert:wp,remove:Sp,clone:kp,datum:Cp,on:Tp,dispatch:Mp,[Symbol.iterator]:Dp};var an=Rp;function W(t){return typeof t=="string"?new vt([[document.querySelector(t)]],[document.documentElement]):new vt([[t]],ic)}function Ep(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Ce(t,e){if(t=Ep(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var Ki=(t=>(t[t.SVG=0]="SVG",t[t.HTML=1]="HTML",t))(Ki||{}),he=(t=>(t.Fit="fit",t.Extend="extend",t.FitWidth="fit_width",t))(he||{});var de=[];var Lp=function(){return de.some(function(t){return t.activeTargets.length>0})};var $p=function(){return de.some(function(t){return t.skippedTargets.length>0})};var Ip="ResizeObserver loop completed with undelivered notifications.",Bp=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Ip}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Ip),window.dispatchEvent(t)};var Qn;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Qn||(Qn={}));var Te=function(t){return Object.freeze(t)};var oc=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,Te(this)}return t})();var ac=(function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Te(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,o=e.right,a=e.bottom,s=e.left,c=e.width,l=e.height;return{x:n,y:r,top:i,right:o,bottom:a,left:s,width:c,height:l}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})();var Qi=function(t){return t instanceof SVGElement&&"getBBox"in t},Ra=function(t){if(Qi(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||t.getClientRects().length)},sc=function(t){var e;if(t instanceof Element)return!0;var n=(e=t?.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Op=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1};var Jn=typeof window<"u"?window:{};var Ea=new WeakMap,Np=/auto|scroll/,I_=/^tb|vertical/,B_=/msie|trident/i.test(Jn.navigator&&Jn.navigator.userAgent),He=function(t){return parseFloat(t||"0")},Hr=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new oc((n?e:t)||0,(n?t:e)||0)},Pp=Te({devicePixelContentBoxSize:Hr(),borderBoxSize:Hr(),contentBoxSize:Hr(),contentRect:new ac(0,0,0,0)}),lc=function(t,e){if(e===void 0&&(e=!1),Ea.has(t)&&!e)return Ea.get(t);if(Ra(t))return Ea.set(t,Pp),Pp;var n=getComputedStyle(t),r=Qi(t)&&t.ownerSVGElement&&t.getBBox(),i=!B_&&n.boxSizing==="border-box",o=I_.test(n.writingMode||""),a=!r&&Np.test(n.overflowY||""),s=!r&&Np.test(n.overflowX||""),c=r?0:He(n.paddingTop),l=r?0:He(n.paddingRight),u=r?0:He(n.paddingBottom),f=r?0:He(n.paddingLeft),h=r?0:He(n.borderTopWidth),d=r?0:He(n.borderRightWidth),g=r?0:He(n.borderBottomWidth),p=r?0:He(n.borderLeftWidth),x=f+l,y=c+u,b=p+d,v=h+g,m=s?t.offsetHeight-v-t.clientHeight:0,_=a?t.offsetWidth-b-t.clientWidth:0,w=i?x+b:0,k=i?y+v:0,A=r?r.width:He(n.width)-w-_,I=r?r.height:He(n.height)-k-m,O=A+x+_+b,N=I+y+m+v,M=Te({devicePixelContentBoxSize:Hr(Math.round(A*devicePixelRatio),Math.round(I*devicePixelRatio),o),borderBoxSize:Hr(O,N,o),contentBoxSize:Hr(A,I,o),contentRect:new ac(f,c,A,I)});return Ea.set(t,M),M},La=function(t,e,n){var r=lc(t,n),i=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Qn.DEVICE_PIXEL_CONTENT_BOX:return a;case Qn.BORDER_BOX:return i;default:return o}};var cc=(function(){function t(e){var n=lc(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=Te([n.borderBoxSize]),this.contentBoxSize=Te([n.contentBoxSize]),this.devicePixelContentBoxSize=Te([n.devicePixelContentBoxSize])}return t})();var $a=function(t){if(Ra(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e};var Fp=function(){var t=1/0,e=[];de.forEach(function(a){if(a.activeTargets.length!==0){var s=[];a.activeTargets.forEach(function(l){var u=new cc(l.target),f=$a(l.target);s.push(u),l.lastReportedSize=La(l.target,l.observedBox),f<t&&(t=f)}),e.push(function(){a.callback.call(a.observer,s,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var i=r[n];i()}return t};var uc=function(t){de.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(i){i.isActive()&&($a(i.target)>t?n.activeTargets.push(i):n.skippedTargets.push(i))})})};var zp=function(){var t=0;for(uc(t);Lp();)t=Fp(),uc(t);return $p()&&Bp(),t>0};var fc,Vp=[],O_=function(){return Vp.splice(0).forEach(function(t){return t()})},Wp=function(t){if(!fc){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return O_()}).observe(n,r),fc=function(){n.textContent="".concat(e?e--:e++)}}Vp.push(t),fc()};var Hp=function(t){Wp(function(){requestAnimationFrame(t)})};var Ia=0,N_=function(){return!!Ia},P_=250,F_={attributes:!0,characterData:!0,childList:!0,subtree:!0},Yp=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Gp=function(t){return t===void 0&&(t=0),Date.now()+t},hc=!1,z_=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=P_),!hc){hc=!0;var r=Gp(e);Hp(function(){var i=!1;try{i=zp()}finally{if(hc=!1,e=r-Gp(),!N_())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,F_)};document.body?n():Jn.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Yp.forEach(function(n){return Jn.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Yp.forEach(function(n){return Jn.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),Ba=new z_,dc=function(t){!Ia&&t>0&&Ba.start(),Ia+=t,!Ia&&Ba.stop()};var V_=function(t){return!Qi(t)&&!Op(t)&&getComputedStyle(t).display==="inline"},Up=(function(){function t(e,n){this.target=e,this.observedBox=n||Qn.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=La(this.target,this.observedBox,!0);return V_(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})();var Xp=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})();var Oa=new WeakMap,qp=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Ji=(function(){function t(){}return t.connect=function(e,n){var r=new Xp(e,n);Oa.set(e,r)},t.observe=function(e,n,r){var i=Oa.get(e),o=i.observationTargets.length===0;qp(i.observationTargets,n)<0&&(o&&de.push(i),i.observationTargets.push(new Up(n,r&&r.box)),dc(1),Ba.schedule())},t.unobserve=function(e,n){var r=Oa.get(e),i=qp(r.observationTargets,n),o=r.observationTargets.length===1;i>=0&&(o&&de.splice(de.indexOf(r),1),r.observationTargets.splice(i,1),dc(-1))},t.disconnect=function(e){var n=this,r=Oa.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})();var pc=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ji.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!sc(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ji.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!sc(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ji.unobserve(this,e)},t.prototype.disconnect=function(){Ji.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();var Zp=globalThis.ResizeObserver||pc;var Yr={duration:void 0,margin:{top:0,bottom:0,left:0,right:0},padding:{top:0,bottom:0,left:0,right:0},sizing:he.Fit,width:void 0,height:void 0,svgDefs:void 0,ariaLabel:void 0,colorFunction:void 0};var jp=class mc{constructor(e){this._defaultConfig=Yr,this._isFirstRender=!0,this._renderAnimationFrameId=null,this._container=e;let n=W(this._container);n.attr("role","figure"),this.svg=n.append("svg").style("display","block").attr("xmlns","http://www.w3.org/2000/svg").attr("height",mc.DEFAULT_CONTAINER_HEIGHT).attr("aria-hidden",!0),this._svgDefs=this.svg.append("defs"),this._svgDefsExternal=this.svg.append("defs"),this.element=this.svg.node()}updateContainer(e){this.prevConfig=this.config,this.config=Qt(this._defaultConfig,e),e?.svgDefs!==this.prevConfig?.svgDefs&&(this._svgDefsExternal.selectAll("*").remove(),this._svgDefsExternal.html(e.svgDefs))}_preRender(){}_render(e){let{config:n}=this;W(this._container).attr("aria-label",n.ariaLabel),this._isFirstRender=!1}render(e=this.config.duration){let n=this.config.width||this.containerWidth,r=this.config.height||this.containerHeight;this.svg.attr("width",n).attr("height",r),this._resizeObserver||this._setUpResizeObserver(),cancelAnimationFrame(this._renderAnimationFrameId),this._renderAnimationFrameId=requestAnimationFrame(()=>{this._preRender(),this._render(e)})}get containerWidth(){return this.config.width?this.element.clientWidth||wi(this.config.width)||0:this._container.clientWidth||this._container.getBoundingClientRect().width}get containerHeight(){return this.config.height?this.element.clientHeight||wi(this.config.height)||0:this._container.clientHeight||this._container.getBoundingClientRect().height||mc.DEFAULT_CONTAINER_HEIGHT}get width(){return it(this.containerWidth-this.config.margin.left-this.config.margin.right,0,Number.POSITIVE_INFINITY)}get height(){return it(this.containerHeight-this.config.margin.top-this.config.margin.bottom,0,Number.POSITIVE_INFINITY)}_removeAllChildren(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild)}_onResize(){let{config:e}=this;(e.sizing===he.Fit||e.sizing===he.FitWidth)&&this.render(0)}_setUpResizeObserver(){if(this._resizeObserver)return;let e=this._container.getBoundingClientRect();this._containerSize={width:e.width,height:e.height},this._resizeObserver=new Zp((n,r)=>{cancelAnimationFrame(this._resizeObserverAnimationFrameId),this._resizeObserverAnimationFrameId=requestAnimationFrame(()=>{let i=this._container.getBoundingClientRect(),o={width:i.width,height:i.height};!Ke(this._containerSize,o)&&o.width&&o.height&&(this._containerSize=o,this._onResize())})}),this._resizeObserver.observe(this._container)}destroy(){cancelAnimationFrame(this._renderAnimationFrameId),cancelAnimationFrame(this._resizeObserverAnimationFrameId),this._resizeObserver?.disconnect(),this.svg.remove()}};jp.DEFAULT_CONTAINER_HEIGHT=300;var Na=jp;var Sn=class{get data(){return this._data}set data(e){this._data=e}constructor(e){this.data=e}};var Y=(t=>(t.X="x",t.Y="y",t))(Y||{});var to={scaleLinear:vn,scalePow:Lr,scaleSqrt:Fl,scaleLog:Ii,scaleSymlog:Bi,scaleIdentity:Li,scaleTime:_a,scaleUtc:wa,scaleSequential:Yi,scaleDiverging:Gi,scaleQuantize:Ni,scaleQuantile:Oi,scaleThreshold:Pi,scaleOrdinal:ke,scaleBand:yn,scalePoint:wl},bt=(t=>(t.X="x",t.Y="y",t))(bt||{});var Lt=(t=>(t.West="west",t.East="east",t.North="north",t.South="south",t))(Lt||{});var Kp={...Yr,components:[],tooltip:void 0,crosshair:void 0,annotations:void 0,xAxis:void 0,yAxis:void 0,autoMargin:!0,xScale:void 0,xDomain:void 0,xDomainMinConstraint:void 0,xDomainMaxConstraint:void 0,xRange:void 0,yScale:void 0,yDomain:void 0,yDomainMinConstraint:void 0,yDomainMaxConstraint:void 0,yRange:void 0,yDirection:Lt.North,preventEmptyDomain:null,scaleByDomain:!1,clipPathExtend:2,bleed:void 0};var Gr=class extends Na{constructor(e,n,r){super(e),this._defaultConfig=Kp,this.datamodel=new Sn,this.config=this._defaultConfig,this._clipPathId=Cr(),this._axisMargin={top:0,bottom:0,left:0,right:0},this._firstRender=!0,this._clipPath=this.svg.append("clipPath").attr("id",this._clipPathId),this._clipPath.append("rect");let i="saturate",o=window.location.href.replace(window.location.hash,"");this.svg.attr("class",C`
59
+ `;function Zi(t=window?.document.body){return t?+Qe("var(--vis-font-wh-ratio)",t):tp}var Ds="http://www.w3.org/1999/xhtml",dc={svg:"http://www.w3.org/2000/svg",xhtml:Ds,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function on(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),dc.hasOwnProperty(e)?{space:dc[e],local:t}:t}function u_(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ds&&e.documentElement.namespaceURI===Ds?e.createElement(t):e.createElementNS(n,t)}}function f_(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function $s(t){var e=on(t);return(e.local?f_:u_)(e)}function h_(){}function tr(t){return t==null?h_:function(){return this.querySelector(t)}}function ep(t){typeof t!="function"&&(t=tr(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=new Array(s),c,l,u=0;u<s;++u)(c=o[u])&&(l=t.call(c,c.__data__,u,o))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new wt(r,this._parents)}function pc(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function d_(){return[]}function Ki(t){return t==null?d_:function(){return this.querySelectorAll(t)}}function p_(t){return function(){return pc(t.apply(this,arguments))}}function np(t){typeof t=="function"?t=p_(t):t=Ki(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var s=e[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(r.push(t.call(c,c.__data__,l,s)),i.push(c));return new wt(r,i)}function Qi(t){return function(){return this.matches(t)}}function Is(t){return function(e){return e.matches(t)}}var m_=Array.prototype.find;function g_(t){return function(){return m_.call(this.children,t)}}function x_(){return this.firstElementChild}function rp(t){return this.select(t==null?x_:g_(typeof t=="function"?t:Is(t)))}var y_=Array.prototype.filter;function v_(){return Array.from(this.children)}function b_(t){return function(){return y_.call(this.children,t)}}function ip(t){return this.selectAll(t==null?v_:b_(typeof t=="function"?t:Is(t)))}function op(t){typeof t!="function"&&(t=Qi(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new wt(r,this._parents)}function Os(t){return new Array(t.length)}function sp(){return new wt(this._enter||this._groups.map(Os),this._parents)}function Ji(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ji.prototype={constructor:Ji,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function ap(t){return function(){return t}}function __(t,e,n,r,i,o){for(var s=0,a,c=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new Ji(t,o[s]);for(;s<c;++s)(a=e[s])&&(i[s]=a)}function w_(t,e,n,r,i,o,s){var a,c,l=new Map,u=e.length,f=o.length,h=new Array(u),d;for(a=0;a<u;++a)(c=e[a])&&(h[a]=d=s.call(c,c.__data__,a,e)+"",l.has(d)?i[a]=c:l.set(d,c));for(a=0;a<f;++a)d=s.call(t,o[a],a,o)+"",(c=l.get(d))?(r[a]=c,c.__data__=o[a],l.delete(d)):n[a]=new Ji(t,o[a]);for(a=0;a<u;++a)(c=e[a])&&l.get(h[a])===c&&(i[a]=c)}function S_(t){return t.__data__}function lp(t,e){if(!arguments.length)return Array.from(this,S_);var n=e?w_:__,r=this._parents,i=this._groups;typeof t!="function"&&(t=ap(t));for(var o=i.length,s=new Array(o),a=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],f=i[l],h=f.length,d=k_(t.call(u,u&&u.__data__,l,r)),x=d.length,p=a[l]=new Array(x),g=s[l]=new Array(x),v=c[l]=new Array(h);n(u,f,p,g,v,d,e);for(var b=0,y=0,m,_;b<x;++b)if(m=p[b]){for(b>=y&&(y=b+1);!(_=g[y])&&++y<x;);m._next=_||null}}return s=new wt(s,r),s._enter=a,s._exit=c,s}function k_(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function cp(){return new wt(this._exit||this._groups.map(Os),this._parents)}function up(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function fp(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],f=l.length,h=a[c]=new Array(f),d,x=0;x<f;++x)(d=l[x]||u[x])&&(h[x]=d);for(;c<i;++c)a[c]=n[c];return new wt(a,this._parents)}function hp(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function dp(t){t||(t=T_);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,c=i[o]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(e)}return new wt(i,this._parents).order()}function T_(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function pp(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function mp(){return Array.from(this)}function gp(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function xp(){let t=0;for(let e of this)++t;return t}function yp(){return!this.node()}function vp(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function A_(t){return function(){this.removeAttribute(t)}}function C_(t){return function(){this.removeAttributeNS(t.space,t.local)}}function M_(t,e){return function(){this.setAttribute(t,e)}}function L_(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function R_(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function E_(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function bp(t,e){var n=on(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?C_:A_:typeof e=="function"?n.local?E_:R_:n.local?L_:M_)(n,e))}function Ns(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function D_(t){return function(){this.style.removeProperty(t)}}function $_(t,e,n){return function(){this.style.setProperty(t,e,n)}}function I_(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function _p(t,e,n){return arguments.length>1?this.each((e==null?D_:typeof e=="function"?I_:$_)(t,e,n??"")):kn(this.node(),t)}function kn(t,e){return t.style.getPropertyValue(e)||Ns(t).getComputedStyle(t,null).getPropertyValue(e)}function O_(t){return function(){delete this[t]}}function N_(t,e){return function(){this[t]=e}}function B_(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function wp(t,e){return arguments.length>1?this.each((e==null?O_:typeof e=="function"?B_:N_)(t,e)):this.node()[t]}function Sp(t){return t.trim().split(/^|\s+/)}function mc(t){return t.classList||new kp(t)}function kp(t){this._node=t,this._names=Sp(t.getAttribute("class")||"")}kp.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Tp(t,e){for(var n=mc(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Ap(t,e){for(var n=mc(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function P_(t){return function(){Tp(this,t)}}function F_(t){return function(){Ap(this,t)}}function z_(t,e){return function(){(e.apply(this,arguments)?Tp:Ap)(this,t)}}function Cp(t,e){var n=Sp(t+"");if(arguments.length<2){for(var r=mc(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?z_:e?P_:F_)(n,e))}function V_(){this.textContent=""}function W_(t){return function(){this.textContent=t}}function H_(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Mp(t){return arguments.length?this.each(t==null?V_:(typeof t=="function"?H_:W_)(t)):this.node().textContent}function Y_(){this.innerHTML=""}function G_(t){return function(){this.innerHTML=t}}function U_(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Lp(t){return arguments.length?this.each(t==null?Y_:(typeof t=="function"?U_:G_)(t)):this.node().innerHTML}function X_(){this.nextSibling&&this.parentNode.appendChild(this)}function Rp(){return this.each(X_)}function q_(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ep(){return this.each(q_)}function Dp(t){var e=typeof t=="function"?t:$s(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function j_(){return null}function $p(t,e){var n=typeof t=="function"?t:$s(t),r=e==null?j_:typeof e=="function"?e:tr(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Z_(){var t=this.parentNode;t&&t.removeChild(this)}function Ip(){return this.each(Z_)}function K_(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Q_(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Op(t){return this.select(t?Q_:K_)}function Np(t){return arguments.length?this.property("__data__",t):this.node().__data__}function J_(t){return function(e){t.call(this,e,this.__data__)}}function t1(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function e1(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function n1(t,e,n){return function(){var r=this.__on,i,o=J_(e);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Bp(t,e,n){var r=t1(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(i=0,u=a[c];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?n1:e1,i=0;i<o;++i)this.each(a(r[i],e,n));return this}function Pp(t,e,n){var r=Ns(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function r1(t,e){return function(){return Pp(this,t,e)}}function i1(t,e){return function(){return Pp(this,t,e.apply(this,arguments))}}function Fp(t,e){return this.each((typeof e=="function"?i1:r1)(t,e))}function*zp(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var gc=[null];function wt(t,e){this._groups=t,this._parents=e}function Vp(){return new wt([[document.documentElement]],gc)}function o1(){return this}wt.prototype=Vp.prototype={constructor:wt,select:ep,selectAll:np,selectChild:rp,selectChildren:ip,filter:op,data:lp,enter:sp,exit:cp,join:up,merge:fp,selection:o1,order:hp,sort:dp,call:pp,nodes:mp,node:gp,size:xp,empty:yp,each:vp,attr:bp,style:_p,property:wp,classed:Cp,text:Mp,html:Lp,raise:Rp,lower:Ep,append:Dp,insert:$p,remove:Ip,clone:Op,datum:Np,on:Bp,dispatch:Fp,[Symbol.iterator]:zp};var sn=Vp;function Y(t){return typeof t=="string"?new wt([[document.querySelector(t)]],[document.documentElement]):new wt([[t]],gc)}function Wp(t){let e;for(;e=t.sourceEvent;)t=e;return t}function He(t,e){if(t=Wp(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}var to=(t=>(t[t.SVG=0]="SVG",t[t.HTML=1]="HTML",t))(to||{}),de=(t=>(t.Fit="fit",t.Extend="extend",t.FitWidth="fit_width",t))(de||{});var pe=[];var Hp=function(){return pe.some(function(t){return t.activeTargets.length>0})};var Yp=function(){return pe.some(function(t){return t.skippedTargets.length>0})};var Gp="ResizeObserver loop completed with undelivered notifications.",Up=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Gp}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Gp),window.dispatchEvent(t)};var er;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(er||(er={}));var Ae=function(t){return Object.freeze(t)};var xc=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,Ae(this)}return t})();var yc=(function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Ae(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,o=e.right,s=e.bottom,a=e.left,c=e.width,l=e.height;return{x:n,y:r,top:i,right:o,bottom:s,left:a,width:c,height:l}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})();var eo=function(t){return t instanceof SVGElement&&"getBBox"in t},Bs=function(t){if(eo(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||t.getClientRects().length)},vc=function(t){var e;if(t instanceof Element)return!0;var n=(e=t?.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Xp=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1};var nr=typeof window<"u"?window:{};var Ps=new WeakMap,qp=/auto|scroll/,s1=/^tb|vertical/,a1=/msie|trident/i.test(nr.navigator&&nr.navigator.userAgent),Ye=function(t){return parseFloat(t||"0")},Xr=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new xc((n?e:t)||0,(n?t:e)||0)},jp=Ae({devicePixelContentBoxSize:Xr(),borderBoxSize:Xr(),contentBoxSize:Xr(),contentRect:new yc(0,0,0,0)}),bc=function(t,e){if(e===void 0&&(e=!1),Ps.has(t)&&!e)return Ps.get(t);if(Bs(t))return Ps.set(t,jp),jp;var n=getComputedStyle(t),r=eo(t)&&t.ownerSVGElement&&t.getBBox(),i=!a1&&n.boxSizing==="border-box",o=s1.test(n.writingMode||""),s=!r&&qp.test(n.overflowY||""),a=!r&&qp.test(n.overflowX||""),c=r?0:Ye(n.paddingTop),l=r?0:Ye(n.paddingRight),u=r?0:Ye(n.paddingBottom),f=r?0:Ye(n.paddingLeft),h=r?0:Ye(n.borderTopWidth),d=r?0:Ye(n.borderRightWidth),x=r?0:Ye(n.borderBottomWidth),p=r?0:Ye(n.borderLeftWidth),g=f+l,v=c+u,b=p+d,y=h+x,m=a?t.offsetHeight-y-t.clientHeight:0,_=s?t.offsetWidth-b-t.clientWidth:0,w=i?g+b:0,k=i?v+y:0,M=r?r.width:Ye(n.width)-w-_,N=r?r.height:Ye(n.height)-k-m,P=M+g+_+b,F=N+v+m+y,R=Ae({devicePixelContentBoxSize:Xr(Math.round(M*devicePixelRatio),Math.round(N*devicePixelRatio),o),borderBoxSize:Xr(P,F,o),contentBoxSize:Xr(M,N,o),contentRect:new yc(f,c,M,N)});return Ps.set(t,R),R},Fs=function(t,e,n){var r=bc(t,n),i=r.borderBoxSize,o=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case er.DEVICE_PIXEL_CONTENT_BOX:return s;case er.BORDER_BOX:return i;default:return o}};var _c=(function(){function t(e){var n=bc(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=Ae([n.borderBoxSize]),this.contentBoxSize=Ae([n.contentBoxSize]),this.devicePixelContentBoxSize=Ae([n.devicePixelContentBoxSize])}return t})();var zs=function(t){if(Bs(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e};var Zp=function(){var t=1/0,e=[];pe.forEach(function(s){if(s.activeTargets.length!==0){var a=[];s.activeTargets.forEach(function(l){var u=new _c(l.target),f=zs(l.target);a.push(u),l.lastReportedSize=Fs(l.target,l.observedBox),f<t&&(t=f)}),e.push(function(){s.callback.call(s.observer,a,s.observer)}),s.activeTargets.splice(0,s.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var i=r[n];i()}return t};var wc=function(t){pe.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(i){i.isActive()&&(zs(i.target)>t?n.activeTargets.push(i):n.skippedTargets.push(i))})})};var Kp=function(){var t=0;for(wc(t);Hp();)t=Zp(),wc(t);return Yp()&&Up(),t>0};var Sc,Qp=[],l1=function(){return Qp.splice(0).forEach(function(t){return t()})},Jp=function(t){if(!Sc){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return l1()}).observe(n,r),Sc=function(){n.textContent="".concat(e?e--:e++)}}Qp.push(t),Sc()};var tm=function(t){Jp(function(){requestAnimationFrame(t)})};var Vs=0,c1=function(){return!!Vs},u1=250,f1={attributes:!0,characterData:!0,childList:!0,subtree:!0},em=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],nm=function(t){return t===void 0&&(t=0),Date.now()+t},kc=!1,h1=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=u1),!kc){kc=!0;var r=nm(e);tm(function(){var i=!1;try{i=Kp()}finally{if(kc=!1,e=r-nm(),!c1())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,f1)};document.body?n():nr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),em.forEach(function(n){return nr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),em.forEach(function(n){return nr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),Ws=new h1,Tc=function(t){!Vs&&t>0&&Ws.start(),Vs+=t,!Vs&&Ws.stop()};var d1=function(t){return!eo(t)&&!Xp(t)&&getComputedStyle(t).display==="inline"},rm=(function(){function t(e,n){this.target=e,this.observedBox=n||er.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Fs(this.target,this.observedBox,!0);return d1(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})();var im=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})();var Hs=new WeakMap,om=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},no=(function(){function t(){}return t.connect=function(e,n){var r=new im(e,n);Hs.set(e,r)},t.observe=function(e,n,r){var i=Hs.get(e),o=i.observationTargets.length===0;om(i.observationTargets,n)<0&&(o&&pe.push(i),i.observationTargets.push(new rm(n,r&&r.box)),Tc(1),Ws.schedule())},t.unobserve=function(e,n){var r=Hs.get(e),i=om(r.observationTargets,n),o=r.observationTargets.length===1;i>=0&&(o&&pe.splice(pe.indexOf(r),1),r.observationTargets.splice(i,1),Tc(-1))},t.disconnect=function(e){var n=this,r=Hs.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})();var Ac=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");no.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!vc(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");no.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!vc(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");no.unobserve(this,e)},t.prototype.disconnect=function(){no.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();var sm=globalThis.ResizeObserver||Ac;var qr={duration:void 0,margin:{top:0,bottom:0,left:0,right:0},padding:{top:0,bottom:0,left:0,right:0},sizing:de.Fit,width:void 0,height:void 0,svgDefs:void 0,ariaLabel:void 0,colorFunction:void 0};var am=class Cc{constructor(e){this._defaultConfig=qr,this._isFirstRender=!0,this._renderAnimationFrameId=null,this._container=e;let n=Y(this._container);n.attr("role","figure"),this.svg=n.append("svg").style("display","block").attr("xmlns","http://www.w3.org/2000/svg").attr("height",Cc.DEFAULT_CONTAINER_HEIGHT).attr("aria-hidden",!0),this._svgDefs=this.svg.append("defs"),this._svgDefsExternal=this.svg.append("defs"),this.element=this.svg.node()}updateContainer(e){this.prevConfig=this.config,this.config=te(this._defaultConfig,e),e?.svgDefs!==this.prevConfig?.svgDefs&&(this._svgDefsExternal.selectAll("*").remove(),this._svgDefsExternal.html(e.svgDefs))}_preRender(){}_propagateSizeAndStyleToComponents(e,n){for(let r of e)r&&(r.setSize(this.width,this.height,this.containerWidth,this.containerHeight),r.setContainerMargin(n),r.setColorFunction(this.config.colorFunction))}_render(e){let{config:n}=this;Y(this._container).attr("aria-label",n.ariaLabel),this._isFirstRender=!1}render(e=this.config.duration){let n=this.config.width||this.containerWidth,r=this.config.height||this.containerHeight;this.svg.attr("width",n).attr("height",r),this._resizeObserver||this._setUpResizeObserver(),cancelAnimationFrame(this._renderAnimationFrameId),this._renderAnimationFrameId=requestAnimationFrame(()=>{this._preRender(),this._render(e)})}get containerWidth(){return this.config.width?this.element.clientWidth||Ti(this.config.width)||0:this._container.clientWidth||this._container.getBoundingClientRect().width}get containerHeight(){return this.config.height?this.element.clientHeight||Ti(this.config.height)||0:this._container.clientHeight||this._container.getBoundingClientRect().height||Cc.DEFAULT_CONTAINER_HEIGHT}get width(){return tt(this.containerWidth-this.config.margin.left-this.config.margin.right,0,Number.POSITIVE_INFINITY)}get height(){return tt(this.containerHeight-this.config.margin.top-this.config.margin.bottom,0,Number.POSITIVE_INFINITY)}_removeAllChildren(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild)}_reconcileChildren(e){let n=e.filter(Boolean),r=new Set(n),i=this.element.firstChild;for(;i;){let s=i.nextSibling;r.has(i)||this.element.removeChild(i),i=s}let o=this.element.firstChild;for(let s of n)s===o?o=o.nextSibling:this.element.insertBefore(s,o)}_onResize(){let{config:e}=this;(e.sizing===de.Fit||e.sizing===de.FitWidth)&&this.render(0)}_setUpResizeObserver(){if(this._resizeObserver)return;let e=this._container.getBoundingClientRect();this._containerSize={width:e.width,height:e.height},this._resizeObserver=new sm((n,r)=>{cancelAnimationFrame(this._resizeObserverAnimationFrameId),this._resizeObserverAnimationFrameId=requestAnimationFrame(()=>{let i=this._container.getBoundingClientRect(),o={width:i.width,height:i.height};!Ke(this._containerSize,o)&&o.width&&o.height&&(this._containerSize=o,this._onResize())})}),this._resizeObserver.observe(this._container)}destroy(){cancelAnimationFrame(this._renderAnimationFrameId),cancelAnimationFrame(this._resizeObserverAnimationFrameId),this._resizeObserver?.disconnect(),this.svg.remove()}};am.DEFAULT_CONTAINER_HEIGHT=300;var Ys=am;var Tn=class{get data(){return this._data}set data(e){this._data=e}constructor(e){this.data=e}};var G=(t=>(t.X="x",t.Y="y",t))(G||{});var ro={scaleLinear:bn,scalePow:Nr,scaleSqrt:Kl,scaleLog:Bi,scaleSymlog:Pi,scaleIdentity:Oi,scaleTime:Ls,scaleUtc:Rs,scaleSequential:Xi,scaleDiverging:qi,scaleQuantize:zi,scaleQuantile:Fi,scaleThreshold:Vi,scaleOrdinal:Te,scaleBand:vn,scalePoint:Il},St=(t=>(t.X="x",t.Y="y",t))(St||{});var It=(t=>(t.West="west",t.East="east",t.North="north",t.South="south",t))(It||{});var lm={...qr,components:[],tooltip:void 0,crosshair:void 0,annotations:void 0,xAxis:void 0,yAxis:void 0,autoMargin:!0,xScale:void 0,xDomain:void 0,xDomainMinConstraint:void 0,xDomainMaxConstraint:void 0,xRange:void 0,yScale:void 0,yDomain:void 0,yDomainMinConstraint:void 0,yDomainMaxConstraint:void 0,yRange:void 0,yDirection:It.North,preventEmptyDomain:null,scaleByDomain:!1,clipPathExtend:2,bleed:void 0};var jr=class extends Ys{constructor(e,n,r){super(e),this._defaultConfig=lm,this.datamodel=new Tn,this.config=this._defaultConfig,this._clipPathId=Lr(),this._axisMargin={top:0,bottom:0,left:0,right:0},this._firstRender=!0,this._clipPath=this.svg.append("clipPath").attr("id",this._clipPathId),this._clipPath.append("rect");let i="saturate",o=window.location.href.replace(window.location.hash,"");this.svg.attr("class",T`
60
60
  --highlight-filter-id: url(${o}#${i}); // defining a css variable
61
- `),this._svgDefs.append("filter").attr("id",i).attr("filterUnits","objectBoundingBox").html('<feColorMatrix type="saturate" in="SourceGraphic" values="1.35"/>'),n&&this.updateContainer(n,!0),r&&this.setData(r,!0),(this.config.xAxis||this.config.yAxis||this.components?.some(a=>a.datamodel.data))&&this.render(),document.fonts?.ready.then(()=>{this._firstRender||this._renderAxes(0)})}get components(){return this.config.components}get width(){let e=this._getMargin();return it(this.containerWidth-e.left-e.right,0,Number.POSITIVE_INFINITY)}get height(){let e=this._getMargin();return it(this.containerHeight-e.top-e.bottom,0,Number.POSITIVE_INFINITY)}setData(e,n){let{components:r,config:i}=this;if(!e)return;let o=this.datamodel.data!==e;this.datamodel.data=e,r.forEach(a=>{a.setData(e)}),i.crosshair?.setData(e),i.xAxis?.setData(e),i.yAxis?.setData(e),o&&(i.tooltip?.hide(),i.crosshair?.hide()),n||this.render()}updateContainer(e,n){super.updateContainer(e),this._removeAllChildren(),this.setData(this.datamodel.data,!0),e.xAxis&&(this.config.xAxis.config.type=Y.X,this.element.appendChild(e.xAxis.element)),e.yAxis&&(this.config.yAxis.config.type=Y.Y,this.element.appendChild(e.yAxis.element));for(let a of this.components)this.element.appendChild(a.element);let r=e.tooltip;r&&(r.hasContainer()||r.setContainer(this._container),r.setComponents(this.components));let i=e.crosshair;i&&(i.setContainer(this.svg),i.tooltip=r,this.element.appendChild(i.element));let o=e.annotations;o&&this.element.appendChild(o.element),this.element.appendChild(this._clipPath.node()),this.element.appendChild(this._svgDefs.node()),this.element.appendChild(this._svgDefsExternal.node()),n||this.render()}updateComponents(e,n){let{config:r}=this;e&&e.length!==this.components.length&&console.warn("Unovis | XY Container: The number of provided component configs doesn't match the number of components. Configs are matched to components by index, so some components won't be updated"),this.components.forEach((i,o)=>{e[o]&&i.setConfig(e[o])}),this._updateScales(...this.components,r.xAxis,r.yAxis,r.crosshair),n||this.render()}update(e,n,r){r&&(this.datamodel.data=r),e&&this.updateContainer(e,!0),n&&this.updateComponents(n,!0),this.render()}_preRender(){let{config:e}=this;super._preRender(),e.autoMargin&&this._setAutoMargin();let n=kr([...this.components,e.xAxis,e.yAxis,e.crosshair,e.annotations]),r=this._getMargin();for(let i of n)i.setSize(this.width,this.height,this.containerWidth,this.containerHeight),i.setContainerMargin(r),i.setColorFunction(e.colorFunction);this._updateScales(...this.components,e.xAxis,e.yAxis,e.crosshair)}_render(e){let{config:n}=this;super._render();let r=this._getMargin();for(let a of this.components)a.g.attr("transform",`translate(${r.left},${r.top})`).style("clip-path",a.clippable?`url(#${this._clipPathId})`:null).style("-webkit-clip-path",a.clippable?`url(#${this._clipPathId})`:null),a.render(e);this._renderAxes(this._firstRender?0:e);let i=n.clipPathExtend;this._clipPath.select("rect").attr("x",-i).attr("y",-i).attr("width",this.width+2*i).attr("height",this.height+2*i),n.tooltip?.update();let o=n.crosshair;if(o){let a=this.components.filter(d=>!d.stacked),s=this.components.filter(d=>d.stacked),c=a.map(d=>d.config.y),l=s.map(d=>d.config.y),f=this.components.find(d=>d.config.baseline)?.config?.baseline;o.accessors={x:this.components[0]?.config.x,y:gn(c),yStacked:gn(l),baseline:f};let h=[a.map(d=>d.config.colorKeys),s.map(d=>d.config.colorKeys)].flat(2);o.colorKeys=h,o.g.attr("transform",`translate(${r.left},${r.top})`).style("clip-path",`url(#${this._clipPathId})`).style("-webkit-clip-path",`url(#${this._clipPathId})`),o.render()}n.annotations?.g.attr("transform",`translate(${r.left},${r.top})`),n.annotations?.render(),this._firstRender=!1,n.onRenderComplete?.(this.svg.node(),r,this._getBleed(this.components),this.containerWidth,this.containerHeight,this.width,this.height)}_updateScales(...e){let n=kr(e||this.components);this._setScales(...n),this._updateScalesDomain(...n),this._updateScalesRange(...n)}_setScales(...e){let{config:n}=this;e&&(n.xScale&&e.forEach(r=>r.setScale(bt.X,n.xScale)),n.yScale&&e.forEach(r=>r.setScale(bt.Y,n.yScale)))}_updateScalesDomain(...e){let{config:n}=this;if(!e)return;let r=e.filter(i=>!i.config.excludeFromDomainCalculation);Object.values(bt).forEach(i=>{let[o,a]=Uo(jo(r.map(d=>d.getDataExtent(i,n.scaleByDomain)))),s=i===bt.Y?n.yDomain:n.xDomain,c=i===bt.Y?n.yDomainMinConstraint:n.xDomainMinConstraint,l=i===bt.Y?n.yDomainMaxConstraint:n.xDomainMaxConstraint,u=s?.[0]??o??0,f=s?.[1]??a??1,h=[it(u,c?.[0]??Number.NEGATIVE_INFINITY,c?.[1]??Number.POSITIVE_INFINITY),it(f,l?.[0]??Number.NEGATIVE_INFINITY,l?.[1]??Number.POSITIVE_INFINITY)];if(h[0]===h[1]){let d=r.some(g=>g.datamodel.data?.length>0);(n.preventEmptyDomain||n.preventEmptyDomain===null&&(!d||i===bt.Y))&&(h[1]=h[0]+1)}e.forEach(d=>d.setScaleDomain(i,h))})}_updateScalesRange(...e){let{config:n}=this;if(!e)return;let r=n.yDirection===Lt.South,i=[n.padding.left??0,this.width-(n.padding.right??0)],o=[this.height-(n.padding.bottom??0),n.padding.top??0];r&&o.reverse();for(let s of e)s.setSize(this.width,this.height,this.containerWidth,this.containerHeight),s.setScaleRange(bt.X,n.xRange??i),s.setScaleRange(bt.Y,n.yRange??o);let a=this._getBleed(e);for(let s of e)s.setScaleRange(bt.X,[i[0]+a.left,i[1]-a.right]),s.setScaleRange(bt.Y,r?[o[0]+a.top,o[1]-a.bottom]:[o[0]-a.bottom,o[1]+a.top])}_renderAxes(e){let{config:{xAxis:n,yAxis:r}}=this,i=this._getMargin();kr([n,r]).forEach(a=>{let s=a.getOffset(i);a.g.attr("transform",`translate(${s.left},${s.top})`),a.render(e)})}_setAutoMargin(){let{config:{xAxis:e,yAxis:n}}=this,r=kr([...this.components,e,n]);this._setScales(...r),this._updateScalesDomain(...r);let i=this._firstRender?2:1;for(let o=0;o<i;o+=1){let a={top:0,bottom:0,left:0,right:0};this._updateScalesRange(...r),kr([e,n]).forEach(c=>{c.preRender();let l=c.getRequiredMargin();a.top<l.top&&(a.top=l.top),a.bottom<l.bottom&&(a.bottom=l.bottom),a.left<l.left&&(a.left=l.left),a.right<l.right&&(a.right=l.right)}),this._axisMargin=a}}_getMargin(){let{config:{margin:e}}=this,r=e||{top:0,bottom:0,left:0,right:0};return{top:(r.top||0)+this._axisMargin.top,bottom:(r.bottom||0)+this._axisMargin.bottom,left:(r.left||0)+this._axisMargin.left,right:(r.right||0)+this._axisMargin.right}}_onResize(){let{config:e}=this;super._onResize(),e.tooltip?.hide(),e.crosshair?.hide()}_getBleed(e){let n=e.map(i=>i.bleed).reduce((i,o)=>{for(let a of Object.keys(i)){let s=a;i[s]<o[s]&&(i[s]=o[s])}return i},{top:0,bottom:0,left:0,right:0}),r=Kt(this.config.bleed)?this.config.bleed(e):this.config.bleed;return r?{top:r.top??n.top,bottom:r.bottom??n.bottom,left:r.left??n.left,right:r.right??n.right}:n}destroy(){let{components:e,config:{tooltip:n,crosshair:r,annotations:i,xAxis:o,yAxis:a}}=this;super.destroy();for(let s of e)s?.destroy();n?.destroy(),r?.destroy(),i?.destroy(),o?.destroy(),a?.destroy()}};var W_={value:()=>{}};function Jp(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Pa(n)}function Pa(t){this._=t}function H_(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Pa.prototype=Jp.prototype={constructor:Pa,on:function(t,e){var n=this._,r=H_(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=Y_(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=Qp(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Qp(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Pa(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function Y_(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Qp(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=W_,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var eo=Jp;var Ur=0,ro=0,no=0,em=1e3,Fa,io,za=0,tr=0,Va=0,oo=typeof performance=="object"&&performance.now?performance:Date,nm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function so(){return tr||(nm(G_),tr=oo.now()+Va)}function G_(){tr=0}function ao(){this._call=this._time=this._next=null}ao.prototype=Wa.prototype={constructor:ao,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?so():+n)+(e==null?0:+e),!this._next&&io!==this&&(io?io._next=this:Fa=this,io=this),this._call=t,this._time=n,gc()},stop:function(){this._call&&(this._call=null,this._time=1/0,gc())}};function Wa(t,e,n){var r=new ao;return r.restart(t,e,n),r}function rm(){so(),++Ur;for(var t=Fa,e;t;)(e=tr-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Ur}function tm(){tr=(za=oo.now())+Va,Ur=ro=0;try{rm()}finally{Ur=0,X_(),tr=0}}function U_(){var t=oo.now(),e=t-za;e>em&&(Va-=e,za=t)}function X_(){for(var t,e=Fa,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Fa=n);io=t,gc(r)}function gc(t){if(!Ur){ro&&(ro=clearTimeout(ro));var e=t-tr;e>24?(t<1/0&&(ro=setTimeout(tm,t-oo.now()-Va)),no&&(no=clearInterval(no))):(no||(za=oo.now(),no=setInterval(U_,em)),Ur=1,nm(tm))}}function Ha(t,e,n){var r=new ao;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var q_=eo("start","end","cancel","interrupt"),Z_=[],am=0,im=1,Ga=2,Ya=3,om=4,Ua=5,lo=6;function kn(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;j_(t,n,{name:e,index:r,group:i,on:q_,tween:Z_,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:am})}function co(t,e){var n=Mt(t,e);if(n.state>am)throw new Error("too late; already scheduled");return n}function Ft(t,e){var n=Mt(t,e);if(n.state>Ya)throw new Error("too late; already running");return n}function Mt(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function j_(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Wa(o,0,n.time);function o(l){n.state=im,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var u,f,h,d;if(n.state!==im)return c();for(u in r)if(d=r[u],d.name===n.name){if(d.state===Ya)return Ha(a);d.state===om?(d.state=lo,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[u]):+u<e&&(d.state=lo,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[u])}if(Ha(function(){n.state===Ya&&(n.state=om,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=Ga,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ga){for(n.state=Ya,i=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=d);i.length=f+1}}function s(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Ua,1),f=-1,h=i.length;++f<h;)i[f].call(t,u);n.state===Ua&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=lo,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function er(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>Ga&&r.state<Ua,r.state=lo,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function sm(t){return this.each(function(){er(this,t)})}function K_(t,e){var n,r;return function(){var i=Ft(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function Q_(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Ft(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===e){i[c]=s;break}c===l&&i.push(s)}o.tween=i}}function lm(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Mt(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?K_:Q_)(n,t,e))}function Xr(t,e,n){var r=t._id;return t.each(function(){var i=Ft(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Mt(i,r).value[e]}}function Xa(t,e){var n;return(typeof e=="number"?Nt:e instanceof gt?Wn:(n=gt(e))?(e=n,Wn):Di)(t,e)}function J_(t){return function(){this.removeAttribute(t)}}function t1(t){return function(){this.removeAttributeNS(t.space,t.local)}}function e1(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function n1(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function r1(t,e,n){var r,i,o;return function(){var a,s=n(this),c;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),c=s+"",a===c?null:a===r&&c===i?o:(i=c,o=e(r=a,s)))}}function i1(t,e,n){var r,i,o;return function(){var a,s=n(this),c;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),c=s+"",a===c?null:a===r&&c===i?o:(i=c,o=e(r=a,s)))}}function cm(t,e){var n=on(t),r=n==="transform"?Ml:Xa;return this.attrTween(t,typeof e=="function"?(n.local?i1:r1)(n,r,Xr(this,"attr."+t,e)):e==null?(n.local?t1:J_)(n):(n.local?n1:e1)(n,r,e))}function o1(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function a1(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function s1(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&a1(t,o)),n}return i._value=e,i}function l1(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&o1(t,o)),n}return i._value=e,i}function um(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=on(t);return this.tween(n,(r.local?s1:l1)(r,e))}function c1(t,e){return function(){co(this,t).delay=+e.apply(this,arguments)}}function u1(t,e){return e=+e,function(){co(this,t).delay=e}}function fm(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?c1:u1)(e,t)):Mt(this.node(),e).delay}function f1(t,e){return function(){Ft(this,t).duration=+e.apply(this,arguments)}}function h1(t,e){return e=+e,function(){Ft(this,t).duration=e}}function hm(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?f1:h1)(e,t)):Mt(this.node(),e).duration}function d1(t,e){if(typeof e!="function")throw new Error;return function(){Ft(this,t).ease=e}}function dm(t){var e=this._id;return arguments.length?this.each(d1(e,t)):Mt(this.node(),e).ease}function p1(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Ft(this,t).ease=n}}function pm(t){if(typeof t!="function")throw new Error;return this.each(p1(this._id,t))}function mm(t){typeof t!="function"&&(t=Zi(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],c,l=0;l<a;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&s.push(c);return new qt(r,this._parents,this._name,this._id)}function gm(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var c=e[s],l=n[s],u=c.length,f=a[s]=new Array(u),h,d=0;d<u;++d)(h=c[d]||l[d])&&(f[d]=h);for(;s<r;++s)a[s]=e[s];return new qt(a,this._parents,this._name,this._id)}function m1(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function g1(t,e,n){var r,i,o=m1(e)?co:Ft;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function xm(t,e){var n=this._id;return arguments.length<2?Mt(this.node(),n).on.on(t):this.each(g1(n,t,e))}function x1(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ym(){return this.on("end.remove",x1(this._id))}function vm(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Kn(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],c=s.length,l=o[a]=new Array(c),u,f,h=0;h<c;++h)(u=s[h])&&(f=t.call(u,u.__data__,h,s))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f,kn(l[h],e,n,h,l,Mt(u,n)));return new qt(o,this._parents,e,n)}function bm(t){var e=this._name,n=this._id;typeof t!="function"&&(t=qi(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,f=0;f<l;++f)if(u=c[f]){for(var h=t.call(u,u.__data__,f,c),d,g=Mt(u,n),p=0,x=h.length;p<x;++p)(d=h[p])&&kn(d,e,n,p,h,g);o.push(h),a.push(u)}return new qt(o,a,e,n)}var y1=an.prototype.constructor;function _m(){return new y1(this._groups,this._parents)}function v1(t,e){var n,r,i;return function(){var o=wn(this,t),a=(this.style.removeProperty(t),wn(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function wm(t){return function(){this.style.removeProperty(t)}}function b1(t,e,n){var r,i=n+"",o;return function(){var a=wn(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function _1(t,e,n){var r,i,o;return function(){var a=wn(this,t),s=n(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(t),wn(this,t))),a===c?null:a===r&&c===i?o:(i=c,o=e(r=a,s))}}function w1(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var c=Ft(this,t),l=c.on,u=c.value[o]==null?s||(s=wm(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(a,i=u),c.on=r}}function Sm(t,e,n){var r=(t+="")=="transform"?Al:Xa;return e==null?this.styleTween(t,v1(t,r)).on("end.style."+t,wm(t)):typeof e=="function"?this.styleTween(t,_1(t,r,Xr(this,"style."+t,e))).each(w1(this._id,t)):this.styleTween(t,b1(t,r,e),n).on("end.style."+t,null)}function S1(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function k1(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&S1(t,a,n)),r}return o._value=e,o}function km(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,k1(t,e,n??""))}function C1(t){return function(){this.textContent=t}}function T1(t){return function(){var e=t(this);this.textContent=e??""}}function Cm(t){return this.tween("text",typeof t=="function"?T1(Xr(this,"text",t)):C1(t==null?"":t+""))}function A1(t){return function(e){this.textContent=t.call(this,e)}}function M1(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&A1(i)),e}return r._value=t,r}function Tm(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,M1(t))}function Am(){for(var t=this._name,e=this._id,n=qa(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,c,l=0;l<s;++l)if(c=a[l]){var u=Mt(c,e);kn(c,t,n,l,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new qt(r,this._parents,t,n)}function Mm(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},c={value:function(){--i===0&&o()}};n.each(function(){var l=Ft(this,r),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(c)),l.on=e}),i===0&&o()})}var D1=0;function qt(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Dm(t){return an().transition(t)}function qa(){return++D1}var sn=an.prototype;qt.prototype=Dm.prototype={constructor:qt,select:vm,selectAll:bm,selectChild:sn.selectChild,selectChildren:sn.selectChildren,filter:mm,merge:gm,selection:_m,transition:Am,call:sn.call,nodes:sn.nodes,node:sn.node,size:sn.size,empty:sn.empty,each:sn.each,on:xm,attr:cm,attrTween:um,style:Sm,styleTween:km,text:Cm,textTween:Tm,remove:ym,tween:lm,delay:fm,duration:hm,ease:dm,easeVarying:pm,end:Mm,[Symbol.iterator]:sn[Symbol.iterator]};var qr=t=>+t;function Za(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var R1={time:null,delay:0,duration:250,ease:Za};function E1(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Rm(t){var e,n;t instanceof qt?(e=t._id,t=t._name):(e=qa(),(n=R1).time=so(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,c,l=0;l<s;++l)(c=a[l])&&kn(c,t,e,l,a,n||E1(c,e));return new qt(r,this._parents,t,e)}an.prototype.interrupt=sm;an.prototype.transition=Rm;function R(t,e,n){if(t.nodes().forEach(r=>er(r)),e){let r=t.transition().duration(e);return n&&r.ease(n),r}else return t}var Em={...Yr,tooltip:void 0,annotations:void 0};var Zr=class extends Na{constructor(e,n,r){super(e),this._defaultConfig=Em,this.config=this._defaultConfig,n&&(this.updateContainer(n,!0),this.component=n.component),r&&this.setData(r,!0),this.component?.datamodel.data&&this.render()}setData(e,n){let{config:r}=this,i=this.component?.datamodel.data!==e;this.component&&this.component.setData(e),n||this.render(),i&&r.tooltip?.hide()}updateContainer(e,n){super.updateContainer(e),this._removeAllChildren(),this.component=e.component,e.sizing&&(this.component.sizing=e.sizing),this.element.appendChild(this.component.element);let r=e.tooltip;r&&(r.hasContainer()||r.setContainer(this._container),r.setComponents([this.component]));let i=e.annotations;i&&this.element.appendChild(i.element),this.element.appendChild(this._svgDefs.node()),this.element.appendChild(this._svgDefsExternal.node()),n||this.render()}updateComponent(e,n){this.component.setConfig(e),n||this.render()}update(e,n,r){e&&this.updateContainer(e,!0),n&&this.updateComponent(n,!0),r&&this.setData(r,!0),this.render()}getFitWidthScale(){let{config:e,component:n}=this,r=n;if(!r.getWidth)return 1;let i=r.getWidth()+e.margin.left+e.margin.right;return this.width/i}_preRender(){let{config:e}=this;super._preRender(),this.component.setSize(this.width,this.height,this.containerWidth,this.containerHeight),this.component.setContainerMargin(e.margin),this.component.setColorFunction(e.colorFunction),e.annotations?.setSize(this.width,this.height,this.containerWidth,this.containerHeight),e.annotations?.setContainerMargin(e.margin)}_render(e){let{config:n,component:r}=this;super._render(e),r.g.attr("transform",`translate(${n.margin.left},${n.margin.top})`),r.render(e),n.annotations?.render(e),n.tooltip&&n.tooltip.update(),n.onRenderComplete?.(this.svg.node(),n.margin,this.containerWidth,this.containerHeight,this.width,this.height)}render(e=this.config.duration){let{config:n,component:r}=this;if(n.sizing===he.Extend||n.sizing===he.FitWidth){let i=n.sizing===he.FitWidth,o=r,a=o.getWidth()+n.margin.left+n.margin.right,s=o.getHeight()+n.margin.top+n.margin.bottom,c=i?this.getFitWidthScale():1,l=this.svg.attr("width"),u=this.svg.attr("height"),f=a*c,h=s*c,d=l||u;R(this.svg,d?e:0).attr("width",f).attr("height",h).attr("viewBox",`0 0 ${a} ${i?h:s}`).attr("preserveAspectRatio","xMinYMin")}else this.svg.attr("width",this.config.width||this.containerWidth).attr("height",this.config.height||this.containerHeight);this._resizeObserver||this._setUpResizeObserver(),cancelAnimationFrame(this._renderAnimationFrameId),this._renderAnimationFrameId=requestAnimationFrame(()=>{this._preRender(),this._render(e)})}_onResize(){let{config:e}=this;super._onResize(),e.tooltip?.hide()}destroy(){let{component:e,config:n}=this;super.destroy(),e?.destroy(),n.tooltip?.destroy(),n.annotations?.destroy()}};function Lm(t){return t}var ja=1,Ka=2,xc=3,uo=4,$m=1e-6;function L1(t){return"translate("+t+",0)"}function $1(t){return"translate(0,"+t+")"}function I1(t){return e=>+t(e)}function B1(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function O1(){return!this.__axis}function Qa(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=t===ja||t===uo?-1:1,u=t===uo||t===Ka?"x":"y",f=t===ja||t===xc?L1:$1;function h(d){var g=r??(e.ticks?e.ticks.apply(e,n):e.domain()),p=i??(e.tickFormat?e.tickFormat.apply(e,n):Lm),x=Math.max(o,0)+s,y=e.range(),b=+y[0]+c,v=+y[y.length-1]+c,m=(e.bandwidth?B1:I1)(e.copy(),c),_=d.selection?d.selection():d,w=_.selectAll(".domain").data([null]),k=_.selectAll(".tick").data(g,e).order(),A=k.exit(),I=k.enter().append("g").attr("class","tick"),O=k.select("line"),N=k.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(I),O=O.merge(I.append("line").attr("stroke","currentColor").attr(u+"2",l*o)),N=N.merge(I.append("text").attr("fill","currentColor").attr(u,l*x).attr("dy",t===ja?"0em":t===xc?"0.71em":"0.32em")),d!==_&&(w=w.transition(d),k=k.transition(d),O=O.transition(d),N=N.transition(d),A=A.transition(d).attr("opacity",$m).attr("transform",function(M){return isFinite(M=m(M))?f(M+c):this.getAttribute("transform")}),I.attr("opacity",$m).attr("transform",function(M){var E=this.parentNode.__axis;return f((E&&isFinite(E=E(M))?E:m(M))+c)})),A.remove(),w.attr("d",t===uo||t===Ka?a?"M"+l*a+","+b+"H"+c+"V"+v+"H"+l*a:"M"+c+","+b+"V"+v:a?"M"+b+","+l*a+"V"+c+"H"+v+"V"+l*a:"M"+b+","+c+"H"+v),k.attr("opacity",1).attr("transform",function(M){return f(m(M)+c)}),O.attr(u+"2",l*o),N.attr(u,l*x).text(p),_.filter(O1).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Ka?"start":t===uo?"end":"middle"),_.each(function(){this.__axis=m})}return h.scale=function(d){return arguments.length?(e=d,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(r=d==null?null:Array.from(d),h):r&&r.slice()},h.tickFormat=function(d){return arguments.length?(i=d,h):i},h.tickSize=function(d){return arguments.length?(o=a=+d,h):o},h.tickSizeInner=function(d){return arguments.length?(o=+d,h):o},h.tickSizeOuter=function(d){return arguments.length?(a=+d,h):a},h.tickPadding=function(d){return arguments.length?(s=+d,h):s},h.offset=function(d){return arguments.length?(c=+d,h):c},h}function yc(t){return Qa(ja,t)}function vc(t){return Qa(Ka,t)}function bc(t){return Qa(xc,t)}function _c(t){return Qa(uo,t)}var Ye={duration:600,events:{},attributes:{}};var Ge=class{constructor(e=Ki.SVG){this.type=Ki.SVG,this.datamodel=new Sn,this.sizing=he.Fit,this.events={},this._defaultConfig=Ye,this._width=400,this._height=200,this._containerWidth=void 0,this._containerHeight=void 0,this._containerMargin={top:0,bottom:0,left:0,right:0},this._colorFunction=void 0,this._setUpComponentEventsThrottled=Sr(this._setUpComponentEvents,500),this._setCustomAttributesThrottled=Sr(this._setCustomAttributes,500),e===Ki.SVG?this.element=document.createElementNS("http://www.w3.org/2000/svg","g"):this.element=document.createElement("div"),this.uid=Cr(),this.g=W(this.element);let n=this.constructor?.selectors?.root;n&&this.g.attr("class",n)}setContainerMargin(e){this._containerMargin=e}setColorFunction(e){this._colorFunction=e}setConfig(e){this.prevConfig=this.config,this.config=Qt(this._defaultConfig,e)}setData(e){this.datamodel.data=e}setSize(e,n,r,i){isFinite(e)&&(this._width=e),isFinite(n)&&(this._height=n),isFinite(r)&&(this._containerWidth=r),isFinite(i)&&(this._containerHeight=i)}render(e=this.config.duration){this._render(e);let n="animating";e&&(this.g.attr(n,""),this.g.transition(n).duration(e).on("end interrupt",()=>{this.g.attr(n,null)})),this._setUpComponentEventsThrottled(),this._setCustomAttributesThrottled()}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e=this.config.duration){}_setCustomAttributes(){let e=this.config.attributes;Object.keys(e).forEach(n=>{Object.keys(e[n]).forEach(r=>{this.g.selectAll(`.${n}`).attr(r,e[n][r])})})}_setUpComponentEvents(){this._bindEvents(()=>this.events),this._bindEvents(()=>this.config.events,".user")}_mapEventDatum(e,n){return{datum:e,index:n}}_bindEvents(e,n=""){let r=e()??{};Object.keys(r).forEach(i=>{Object.keys(r[i]).forEach(o=>{let a=this.g.selectAll(`.${i}`),s=a.nodes();a.on(o+n,(c,l)=>{let u=e()?.[i]?.[o];if(!u)return;let f=s.indexOf(c.currentTarget),{datum:h,index:d}=this._mapEventDatum(l,f);return u(h,c,d,s)})})})}_onDestroy(){}destroy(){this.isDestroyed()||(this._onDestroy(),this.g?.remove(),this.element=void 0)}isDestroyed(){return!this.element}};var Ue=class extends Sn{constructor(e){super(e)}get data(){return this._data??[]}set data(e){Array.isArray(e)&&(this._data=e)}};var ct={...Ye,x:void 0,y:void 0,id:(t,e)=>t.id??`${e}`,color:t=>t.color,xScale:void 0,yScale:void 0,excludeFromDomainCalculation:!1};var ut=class extends Ge{constructor(){super(...arguments),this.datamodel=new Ue,this.clippable=!0,this.stacked=!1,this._defaultConfig=ct,this._xScale=to.scaleLinear(),this._yScale=to.scaleLinear()}get xScale(){return this.config.xScale||this._xScale}get yScale(){return this.config.yScale||this._yScale}setConfig(e){e&&(this.config?.xScale&&(e.xScale=this.config.xScale),this.config?.yScale&&(e.yScale=this.config.yScale)),super.setConfig(e)}setScaleDomain(e,n){e===bt.X&&this._xScale?.domain(n),e===bt.Y&&this._yScale?.domain(n)}setScaleRange(e,n){e===bt.X&&this._xScale?.range(n),e===bt.Y&&this._yScale?.range(n)}setScale(e,n){n&&e===bt.X&&(this._xScale=n),n&&e===bt.Y&&(this._yScale=n)}getDataExtent(e,n){let{config:r,datamodel:i}=this;switch(e){case bt.X:return this.getXDataExtent();case bt.Y:return this.getYDataExtent(n);default:return ue(i.data,r[e])}}getXDataExtent(){let{config:e,datamodel:n}=this;return ue(n.data,e.x)}getYDataExtent(e){let{config:n,datamodel:r}=this,i=this.xScale.domain(),o=e?na(r.data,i,n.x,!0):r.data,a=At(n.y)?n.y:[n.y];return ue(o,...a)}};var $=(t=>(t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t.Center="center",t.Auto="auto",t))($||{});var ne=(t=>(t.Inside="inside",t.Outside="outside",t.Center="center",t))(ne||{}),ln=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(ln||{});var Ae=(t=>(t.Start="start",t.Middle="middle",t.End="end",t))(Ae||{}),Xe=(t=>(t.Top="top",t.Middle="middle",t.Bottom="bottom",t))(Xe||{}),Me=(t=>(t.Wrap="wrap",t.Trim="trim",t))(Me||{}),Tt=(t=>(t.Left="left",t.Center="center",t.Right="right",t))(Tt||{});function Im(t){switch(t){case Tt.Center:return"middle";case Tt.Right:return"end";case Tt.Left:default:return"start"}}function Ja(t,e,n){if(t.size>=5e3&&!t.has(e)){let r=t.keys().next().value;r!==void 0&&t.delete(r)}t.set(e,n)}var Bm="",fo=new Map,wc=new WeakMap,Sc=new Map,jr=globalThis?.document?.createElement("canvas").getContext("2d")??null,Om=(t,e)=>`${e}${Bm}${t}`;function N1(){fo.clear(),Sc.clear()}globalThis?.document?.fonts?.ready?.then(N1);function cn(t,e,n=Xi()){return t.length*e*n||0}function Nm(t,e){if(jr)return jr.font!==e&&(jr.font=e),jr.measureText(t).width;let n=/(\d*\.?\d+)(px|pt|pc|rem|em|ex|ch|cm|mm|in|vmin|vmax|vw|vh|%)/.exec(e)?.[0],r=Jt(n)??ka;return cn(t,r,Xi())}function P1(t){let e="",n=t;for(;n&&(e+=`${Bm}${n.getAttribute("class")||""};${n.getAttribute("style")||""}`,n.localName!=="svg");)n=n.parentElement;return e}function Pm(t){let e=wc.get(t);if(e)return e;let n=P1(t);if(e=Sc.get(n),e)return wc.set(t,e),e;let r=window.getComputedStyle(t),i=r.fontSize||`${ka}px`;return e={font:`${r.fontStyle||"normal"} ${r.fontWeight||"normal"} ${i} ${r.fontFamily||"sans-serif"}`,fontSizePx:Jt(i)},Ja(Sc,n,e),wc.set(t,e),e}function kc(t){return Pm(t).fontSizePx}function Kr(t){let e=t.textContent||"",{font:n}=Pm(t),r=Om(e,n),i=fo.get(r);if(i!==void 0)return i;let o=jr?Nm(e,n):t.getComputedTextLength();return Ja(fo,r,o),o}function Cn(t,e,n,r){let i=typeof n=="number"?`${n}px`:n,o=`${r??""} ${i} ${e}`.trimStart(),a=Om(t,o),s=fo.get(a);if(s!==void 0)return s;let c;if(!jr&&globalThis.document){let l="http://www.w3.org/2000/svg",u=document.createElementNS(l,"svg"),f=document.createElementNS(l,"text");f.textContent=t,f.setAttribute("font-size",i),f.setAttribute("font-family",e),r!==void 0&&f.setAttribute("font-weight",`${r}`),u.appendChild(f),document.body.appendChild(u),c=f.getComputedTextLength(),document.body.removeChild(u)}else c=Nm(t,o);return Ja(fo,a,c),c}var ts=t=>{switch(t){case Tt.Left:return"start";case Tt.Right:return"end";case Tt.Center:return"middle";default:return null}};function zm(t){return t.replace(/-([a-z])/g,(e,n)=>n.toUpperCase())}function F1(t,e=15){return t?t.length>e?`\u2026${t.substr(t.length-e,e)}`:t:""}function z1(t,e=15){if(!t)return"";let n=Math.floor((e-3)/2);return t.length>e?`${t.substr(0,n)}\u2026${t.substr(-n,n)}`:t}function V1(t,e=15){return t?t.length>e?`${t.substr(0,e)}\u2026`:t:""}function Cc(t,e=15,n=Ae.Middle){if(!t)return"";let r=V1(t,e);return n===Ae.Start?r=F1(t,e):n===Ae.Middle&&(r=z1(t,e)),r}function Vm(t,e=[" "]){let n=[t];for(let r=0;r<e.length;r++){let i=e[r];n.forEach((o,a)=>{let s=o.split(i),c=s.map((l,u)=>`${l}${u===s.length-1?"":i}`);n[a]=c}),n=gn(n)}return n}function qe(t,e,n=[" ","-",".",","]){let r=t.text();if(!r)return;let i=At(n)?n:[n],o=Vm(r,i),a=parseFloat(t.attr("x"))||0;t.text("");let s=t.append("tspan").attr("x",a),c=`${o[0]}`;s.text(c),o.forEach((l,u)=>{if(u===0)return;let f=`${c}${l}`;s.text(f),Kr(s.node())>e?(s.text(c.trim()),s=t.append("tspan").attr("x",a).attr("dy","1.2em").text(l),c=l):c+=l})}function Qr(t,e=50,n=Ae.Middle,r=!1,i=Jt(window.getComputedStyle(t.node())?.fontSize||rn.fontSize),o=Xi()){let a=t.text()||"",s=a.length;if(!s)return!1;if(r){let h=cn(a,i,o),g=Math.ceil(s*e/(1.1*h));return g<s?(t.text(Cc(a,g,n)),!0):!1}let c=t.node();if(Kr(c)<=e)return!1;let l=0,u=s,f=0;for(;l<=u;){let h=l+u>>1;t.text(Cc(a,h,n)),Kr(c)<=e?(f=h,l=h+1):u=h-1}return t.text(Cc(a,f,n)),!0}function W1(t,e=void 0,n=!0,r=Jl,i=!1){let o=`${t.text}`;if(!o)return[];let a=t.fontSize??rn.fontSize,s=t.fontFamily??rn.fontFamily,c=t.fontWeight,l=t.fontWidthToHeightRatio??rn.fontWidthToHeightRatio,u=Array.isArray(r)?r:[r];return o.split(`
62
- `).map(h=>{let d=[];if(!e)return[h];let g=Vm(h,u),p="";for(let x=0;x<g.length;x+=1){(n?cn(p+g[x],a,l):Cn(p+g[x],s,a,c))<e||x===0?p+=g[x]:(d.push(p.trim()),p=g[x]);let b=2;if(i)for(;p.trim().length>b&&(n?cn(p,a,l):Cn(p,s,a,c))>e;){let m=p.trim().length-b;for(;m>0;){let _=`${p.substring(0,m)}${tc}`;if((n?cn(_,a,l):Cn(_,s,a,c))<=e||m===1){d.push(_.trim()),p=p.substring(m);break}m--}}}return p&&d.push(p.trim()),d}).flat()}function Tc(t,e=void 0,n=void 0,r=!0,i=Jl,o=!1){let a=Array.isArray(t)?t.map(f=>Qt(rn,f)):[Qt(rn,t)],s=a.map(f=>W1(f,f.width??e,r,f.separator??i,f.wordBreak??o)),c=a[0],l=-c.fontSize*(c.lineHeight-1),u=[];return a.forEach((f,h)=>{let d=s[h],g=h>0?u[h-1]:void 0,p=g?g.marginBottom:0,x=f.marginTop,y=Math.max(p,x);l+=y;let b=f.fontSize*f.lineHeight,v=0,m=_=>r?cn(_,f.fontSize,f.fontWidthToHeightRatio):Cn(_,f.fontFamily,f.fontSize);for(let _=0;_<d.length;_+=1){let w=d[_];if(l+=b,n&&l+b>n&&_!==d.length-1){w.charAt(w.length-1)===tc&&(w=w.substr(0,w.length-1));let A=`${w} \u2026`;m(A)<(f.width??e)?d[_]=A:d[_]=`${w.substr(0,w.length-2)}\u2026`,v=Math.max(m(d[_]),v),d=d.slice(0,_+1);break}v=Math.max(m(w),v)}u.push({...f,_lines:d,_estimatedHeight:l-(g?._estimatedHeight||0),_maxWidth:v})}),u}var Fm="http://www.w3.org/2000/svg";function H1(t,e=0,n,r){return t.map((i,o)=>{let a=o>0?t[o-1]:void 0,s=a?a.marginBottom/a.fontSize:0,c=i.marginTop/i.fontSize,l=Math.max(s,c),u=document.createElementNS(Fm,"tspan");return i.className&&u.setAttribute("class",i.className),i.fontSize&&u.setAttribute("font-size",`${i.fontSize}`),i.fontFamily&&u.setAttribute("font-family",`${i.fontFamily}`),i.fontWeight&&u.setAttribute("font-weight",`${i.fontWeight}`),i.color&&u.setAttribute("fill",`${i.color}`),o===0&&n&&u.setAttribute("y",`${n}`),i._lines.forEach((f,h)=>{let d;o===0&&h===0?d=l:h===0?d=l+i.lineHeight:d=i.lineHeight;let g=document.createElementNS(Fm,"tspan");g.setAttribute("x",`${e}`),g.setAttribute("dy",`${d}em`),g.setAttribute("dominant-baseline",r??"auto"),g.textContent=f.length?f:"\xA0",u.appendChild(g)}),u})}function Ac(t){return Qo(t,e=>e._estimatedHeight)}function Wm(t,e,n,r){let i=Tc(e,n.width,void 0,n.fastMode,n.separator,n.wordBreak),o=n.x??+t.getAttribute("x"),a=n.y??+t.getAttribute("y"),s=o??0,c=a??0;if(n.textAlign&&t.setAttribute("text-anchor",Im(n.textAlign)),n.verticalAlign&&n.verticalAlign!==Xe.Top){let l=Ac(i),u=n.verticalAlign===Xe.Middle?-l/2:n.verticalAlign===Xe.Bottom?-l:0;c+=u}n.textRotationAngle?t.setAttribute("transform",`rotate(${n.textRotationAngle===0||n.textRotationAngle?n.textRotationAngle:0} ${s} ${c})`):t.removeAttribute("transform"),t.textContent="";for(let l of H1(i,s,c,r))t.appendChild(l);return i}function Mc(t,e={}){let{tolerance:n=0,priorities:r}=e,i=t.length,o=new Array(i).fill(!0);if(i<2)return o;let a=1/0,s=-1/0,c=1/0,l=-1/0;for(let x of t){let y=x.x+x.width/2,b=x.y+x.height/2;y<a&&(a=y),y>s&&(s=y),b<c&&(c=b),b>l&&(l=b)}let u=s-a>=l-c,f=x=>u?x.x:x.y,h=x=>u?x.x+x.width:x.y+x.height,d=x=>r?.[x]??0,g=t.map((x,y)=>y).sort((x,y)=>f(t[x])-f(t[y])),p=[];for(let x of g){let y=f(t[x]);for(let m=p.length-1;m>=0;m-=1)h(t[p[m]])-3*n<y&&p.splice(m,1);let b=[],v=!1;for(let m of p)if(Je(t[x],t[m],n)){if(d(m)>=d(x)){v=!0;break}b.push(m)}if(v)o[x]=!1;else{for(let m of b)o[m]=!1,p.splice(p.indexOf(m),1);p.push(x)}}return o}function Hm(t,e={}){let n=t.nodes();if(n.length<2){t.style("opacity",1);return}let r=n.map(o=>{let{x:a,y:s,width:c,height:l}=o.getBoundingClientRect();return{x:a,y:s,width:c,height:l}}),i=Mc(r,e);n.forEach((o,a)=>W(o).style("opacity",i[a]?1:0))}var nr=t=>String(+t),Ym=(t,e)=>{let n=new Set(t.map(nr)),r=e.filter(i=>!n.has(nr(i)));return r.length?[...t,...r].sort((i,o)=>+i-+o):t};function Gm(t,e,n=t.ticks(e)){if(n.length<2||n[0]instanceof Date)return n;let r=n[1]-n[0],i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i);return Math.round(o)!==2?n:t.ticks(e*2)}function Um(t,e){let n=[];for(let r=e;r>=1;r-=1){let i=t.ticks(r),o=n[n.length-1];(!o||!Ke(i,o))&&n.push(i)}return n}function Xm(t){let e=[];for(let n=1;n<=t.length;n+=1){let r=t.filter((o,a)=>a%n===0),i=e[e.length-1];(!i||r.length<i.length)&&e.push(r)}return e}function Y1(t,e){let n=[];for(let r=0;r<t.length-1;r+=1)Je(t[r],t[r+1],e)&&n.push(r);return n}function qm(t,e,n=0){let r=o=>Mc(o,{tolerance:n}).every(a=>a);for(let o of t){let a=e(o);if(r(a))return{fittedTicks:o,labeledTicks:o};let s=Y1(a,n),c=0,l=a.length-2;if(!(s.length>0&&s.every(h=>h===c||h===l)))continue;let f=[...o];if(s.includes(l)&&f.pop(),s.includes(c)&&f.shift(),f.length||f.push(o[0]),r(e(f)))return{fittedTicks:o,labeledTicks:f}}let i=t[t.length-1];return i&&{fittedTicks:i,labeledTicks:i}}var Zm={...ct,position:void 0,type:void 0,label:void 0,labelFontSize:null,labelTextFitMode:Me.Wrap,labelTextTrimType:Ae.Middle,labelTextSeparator:void 0,gridLine:!0,tickLine:!0,domainLine:!0,numTicks:void 0,tickSpacing:175,minMaxTicksOnly:!1,minMaxTicksOnlyWhenWidthIsLess:250,minMaxTicksOnlyShowGridLines:!1,tickTextWidth:void 0,tickTextSeparator:void 0,tickTextForceWordBreak:!1,tickTextTrimType:Ae.Middle,tickTextFitMode:Me.Wrap,tickTextFontSize:null,tickTextAlign:void 0,tickTextColor:null,tickTextAngle:void 0,labelMargin:8,labelColor:null,tickFormat:void 0,tickValues:void 0,fullSize:!0,tickPadding:8,tickSize:6,tickTextAdaptiveSets:void 0,tickTextHideOverlapping:void 0};var Ic={};Rt(Ic,{axis:()=>Rc,cssVarDefaults:()=>Dc,grid:()=>Ec,gridTickHidden:()=>Lc,hideDomain:()=>ns,hideTickLine:()=>es,label:()=>os,root:()=>jm,tick:()=>rs,tickLabel:()=>as,tickLabelHideable:()=>$c,tickTextExiting:()=>ho,tickTextHidden:()=>is,variables:()=>at});function pe(t,e){let n="--vis-",r=Object.entries(t);return Object.fromEntries(r.map(([i])=>[zm(i.replace(e??n,"")),i]))}function me(t,e){lt({":root":t,[`${St} .${e}`]:Object.keys(t).filter(n=>n.includes("--vis-dark")).map(n=>({[n.replace("--vis-dark","--vis")]:`var(${n})`}))})}function un(t){return`var(${t})`}var jm=C`
61
+ `),this._svgDefs.append("filter").attr("id",i).attr("filterUnits","objectBoundingBox").html('<feColorMatrix type="saturate" in="SourceGraphic" values="1.35"/>'),n&&this.updateContainer(n,!0),r&&this.setData(r,!0),(this.config.xAxis||this.config.yAxis||this.components?.some(s=>s.datamodel.data))&&this.render(),document.fonts?.ready.then(()=>{this._firstRender||this._renderAxes(0)})}get components(){return this.config.components}get width(){let e=this._getMargin();return tt(this.containerWidth-e.left-e.right,0,Number.POSITIVE_INFINITY)}get height(){let e=this._getMargin();return tt(this.containerHeight-e.top-e.bottom,0,Number.POSITIVE_INFINITY)}setData(e,n){let{components:r,config:i}=this;if(!e)return;let o=this.datamodel.data!==e;this.datamodel.data=e,r.forEach(s=>{s.datamodel.data!==e&&s.setData(e)}),i.crosshair&&i.crosshair.datamodel.data!==e&&i.crosshair.setData(e),i.xAxis&&i.xAxis.datamodel.data!==e&&i.xAxis.setData(e),i.yAxis&&i.yAxis.datamodel.data!==e&&i.yAxis.setData(e),o&&(i.tooltip?.hide(),i.crosshair?.hide()),n||this.render()}updateContainer(e,n){super.updateContainer(e),this.setData(this.datamodel.data,!0),e.xAxis&&(this.config.xAxis.config.type=G.X),e.yAxis&&(this.config.yAxis.config.type=G.Y);let r=e.tooltip;r&&(r.hasContainer()||r.setContainer(this._container),r.setComponents(this.components));let i=e.crosshair;i&&(i.setContainer(this.svg),i.tooltip=r),this._reconcileChildren([e.xAxis?.element,e.yAxis?.element,...this.components.map(o=>o.element),i?.element,e.annotations?.element,this._clipPath.node(),this._svgDefs.node(),this._svgDefsExternal.node()]),n||this.render()}updateComponents(e,n){let{config:r}=this;e&&e.length!==this.components.length&&console.warn("Unovis | XY Container: The number of provided component configs doesn't match the number of components. Configs are matched to components by index, so some components won't be updated"),this.components.forEach((i,o)=>{e[o]&&i.setConfig(e[o])}),this._updateScales(...this.components,r.xAxis,r.yAxis,r.crosshair),n||this.render()}update(e,n,r){r&&(this.datamodel.data=r),e&&this.updateContainer(e,!0),n&&this.updateComponents(n,!0),this.render()}_preRender(){let{config:e}=this;super._preRender(),e.autoMargin&&this._setAutoMargin();let n=Mr([...this.components,e.xAxis,e.yAxis,e.crosshair,e.annotations]);this._propagateSizeAndStyleToComponents(n,this._getMargin()),this._updateScales(...this.components,e.xAxis,e.yAxis,e.crosshair)}_render(e){let{config:n}=this;super._render();let r=this._getMargin();for(let s of this.components)s.g.attr("transform",`translate(${r.left},${r.top})`).style("clip-path",s.clippable?`url(#${this._clipPathId})`:null).style("-webkit-clip-path",s.clippable?`url(#${this._clipPathId})`:null),s.render(e);this._renderAxes(this._firstRender?0:e);let i=n.clipPathExtend;this._clipPath.select("rect").attr("x",-i).attr("y",-i).attr("width",this.width+2*i).attr("height",this.height+2*i),n.tooltip?.update();let o=n.crosshair;if(o){let s=this.components.filter(d=>!d.stacked),a=this.components.filter(d=>d.stacked),c=s.map(d=>d.config.y),l=a.map(d=>d.config.y),f=this.components.find(d=>d.config.baseline)?.config?.baseline;o.accessors={x:this.components[0]?.config.x,y:xn(c),yStacked:xn(l),baseline:f};let h=[s.map(d=>d.config.colorKeys),a.map(d=>d.config.colorKeys)].flat(2);o.colorKeys=h,o.g.attr("transform",`translate(${r.left},${r.top})`).style("clip-path",`url(#${this._clipPathId})`).style("-webkit-clip-path",`url(#${this._clipPathId})`),o.render()}n.annotations?.g.attr("transform",`translate(${r.left},${r.top})`),n.annotations?.render(),this._firstRender=!1,n.onRenderComplete?.(this.svg.node(),r,this._getBleed(this.components),this.containerWidth,this.containerHeight,this.width,this.height)}_updateScales(...e){let n=Mr(e||this.components);this._setScales(...n),this._updateScalesDomain(...n),this._updateScalesRange(...n)}_setScales(...e){let{config:n}=this;e&&(n.xScale&&e.forEach(r=>r.setScale(St.X,n.xScale)),n.yScale&&e.forEach(r=>r.setScale(St.Y,n.yScale)))}_updateScalesDomain(...e){let{config:n}=this;if(!e)return;let r=e.filter(i=>!i.config.excludeFromDomainCalculation);Object.values(St).forEach(i=>{let[o,s]=Qo(ns(r.map(d=>d.getDataExtent(i,n.scaleByDomain)))),a=i===St.Y?n.yDomain:n.xDomain,c=i===St.Y?n.yDomainMinConstraint:n.xDomainMinConstraint,l=i===St.Y?n.yDomainMaxConstraint:n.xDomainMaxConstraint,u=a?.[0]??o??0,f=a?.[1]??s??1,h=[tt(u,c?.[0]??Number.NEGATIVE_INFINITY,c?.[1]??Number.POSITIVE_INFINITY),tt(f,l?.[0]??Number.NEGATIVE_INFINITY,l?.[1]??Number.POSITIVE_INFINITY)];if(h[0]===h[1]){let d=r.some(x=>x.datamodel.data?.length>0);(n.preventEmptyDomain||n.preventEmptyDomain===null&&(!d||i===St.Y))&&(h[1]=h[0]+1)}e.forEach(d=>d.setScaleDomain(i,h))})}_updateScalesRange(...e){let{config:n}=this;if(!e)return;let r=n.yDirection===It.South,i=[n.padding.left??0,this.width-(n.padding.right??0)],o=[this.height-(n.padding.bottom??0),n.padding.top??0];r&&o.reverse();for(let a of e)a.setSize(this.width,this.height,this.containerWidth,this.containerHeight),a.setScaleRange(St.X,n.xRange??i),a.setScaleRange(St.Y,n.yRange??o);let s=this._getBleed(e);for(let a of e)a.setScaleRange(St.X,[i[0]+s.left,i[1]-s.right]),a.setScaleRange(St.Y,r?[o[0]+s.top,o[1]-s.bottom]:[o[0]-s.bottom,o[1]+s.top])}_renderAxes(e){let{config:{xAxis:n,yAxis:r}}=this,i=this._getMargin();Mr([n,r]).forEach(s=>{let a=s.getOffset(i);s.g.attr("transform",`translate(${a.left},${a.top})`),s.render(e)})}_setAutoMargin(){let{config:{xAxis:e,yAxis:n}}=this,r=Mr([...this.components,e,n]);this._setScales(...r),this._updateScalesDomain(...r);let i=this._firstRender?2:1;for(let o=0;o<i;o+=1){let s={top:0,bottom:0,left:0,right:0};this._updateScalesRange(...r),Mr([e,n]).forEach(c=>{c.preRender();let l=c.getRequiredMargin();s.top<l.top&&(s.top=l.top),s.bottom<l.bottom&&(s.bottom=l.bottom),s.left<l.left&&(s.left=l.left),s.right<l.right&&(s.right=l.right)}),this._axisMargin=s}}_getMargin(){let{config:{margin:e}}=this,r=e||{top:0,bottom:0,left:0,right:0};return{top:(r.top||0)+this._axisMargin.top,bottom:(r.bottom||0)+this._axisMargin.bottom,left:(r.left||0)+this._axisMargin.left,right:(r.right||0)+this._axisMargin.right}}_onResize(){let{config:e}=this;super._onResize(),e.tooltip?.hide(),e.crosshair?.hide()}_getBleed(e){let n=e.map(i=>i.bleed).reduce((i,o)=>{for(let s of Object.keys(i)){let a=s;i[a]<o[a]&&(i[a]=o[a])}return i},{top:0,bottom:0,left:0,right:0}),r=Jt(this.config.bleed)?this.config.bleed(e):this.config.bleed;return r?{top:r.top??n.top,bottom:r.bottom??n.bottom,left:r.left??n.left,right:r.right??n.right}:n}destroy(){let{components:e,config:{tooltip:n,crosshair:r,annotations:i,xAxis:o,yAxis:s}}=this;super.destroy();for(let a of e)a?.destroy();n?.destroy(),r?.destroy(),i?.destroy(),o?.destroy(),s?.destroy()}};var p1={value:()=>{}};function um(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Gs(n)}function Gs(t){this._=t}function m1(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Gs.prototype=um.prototype={constructor:Gs,on:function(t,e){var n=this._,r=m1(t+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=g1(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<s;)if(i=(t=r[o]).type)n[i]=cm(n[i],t.name,e);else if(e==null)for(i in n)n[i]=cm(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Gs(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function g1(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function cm(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=p1,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var io=um;var Zr=0,so=0,oo=0,hm=1e3,Us,ao,Xs=0,rr=0,qs=0,lo=typeof performance=="object"&&performance.now?performance:Date,dm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function uo(){return rr||(dm(x1),rr=lo.now()+qs)}function x1(){rr=0}function co(){this._call=this._time=this._next=null}co.prototype=js.prototype={constructor:co,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?uo():+n)+(e==null?0:+e),!this._next&&ao!==this&&(ao?ao._next=this:Us=this,ao=this),this._call=t,this._time=n,Mc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Mc())}};function js(t,e,n){var r=new co;return r.restart(t,e,n),r}function pm(){uo(),++Zr;for(var t=Us,e;t;)(e=rr-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Zr}function fm(){rr=(Xs=lo.now())+qs,Zr=so=0;try{pm()}finally{Zr=0,v1(),rr=0}}function y1(){var t=lo.now(),e=t-Xs;e>hm&&(qs-=e,Xs=t)}function v1(){for(var t,e=Us,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Us=n);ao=t,Mc(r)}function Mc(t){if(!Zr){so&&(so=clearTimeout(so));var e=t-rr;e>24?(t<1/0&&(so=setTimeout(fm,t-lo.now()-qs)),oo&&(oo=clearInterval(oo))):(oo||(Xs=lo.now(),oo=setInterval(y1,hm)),Zr=1,dm(fm))}}function Zs(t,e,n){var r=new co;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var b1=io("start","end","cancel","interrupt"),_1=[],xm=0,mm=1,Qs=2,Ks=3,gm=4,Js=5,fo=6;function An(t,e,n,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;w1(t,n,{name:e,index:r,group:i,on:b1,tween:_1,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:xm})}function ho(t,e){var n=Rt(t,e);if(n.state>xm)throw new Error("too late; already scheduled");return n}function Vt(t,e){var n=Rt(t,e);if(n.state>Ks)throw new Error("too late; already running");return n}function Rt(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function w1(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=js(o,0,n.time);function o(l){n.state=mm,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,f,h,d;if(n.state!==mm)return c();for(u in r)if(d=r[u],d.name===n.name){if(d.state===Ks)return Zs(s);d.state===gm?(d.state=fo,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[u]):+u<e&&(d.state=fo,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[u])}if(Zs(function(){n.state===Ks&&(n.state=gm,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Qs,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Qs){for(n.state=Ks,i=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=d);i.length=f+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Js,1),f=-1,h=i.length;++f<h;)i[f].call(t,u);n.state===Js&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=fo,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function ir(t,e){var n=t.__transition,r,i,o=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){o=!1;continue}i=r.state>Qs&&r.state<Js,r.state=fo,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}o&&delete t.__transition}}function ym(t){return this.each(function(){ir(this,t)})}function S1(t,e){var n,r;return function(){var i=Vt(this,t),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function k1(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Vt(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:e,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===e){i[c]=a;break}c===l&&i.push(a)}o.tween=i}}function vm(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Rt(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===t)return s.value;return null}return this.each((e==null?S1:k1)(n,t,e))}function Kr(t,e,n){var r=t._id;return t.each(function(){var i=Vt(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Rt(i,r).value[e]}}function ta(t,e){var n;return(typeof e=="number"?Ft:e instanceof vt?Gn:(n=vt(e))?(e=n,Gn):Di)(t,e)}function T1(t){return function(){this.removeAttribute(t)}}function A1(t){return function(){this.removeAttributeNS(t.space,t.local)}}function C1(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttribute(t);return s===i?null:s===r?o:o=e(r=s,n)}}function M1(t,e,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===r?o:o=e(r=s,n)}}function L1(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function R1(t,e,n){var r,i,o;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a)))}}function bm(t,e){var n=on(t),r=n==="transform"?zl:ta;return this.attrTween(t,typeof e=="function"?(n.local?R1:L1)(n,r,Kr(this,"attr."+t,e)):e==null?(n.local?A1:T1)(n):(n.local?M1:C1)(n,r,e))}function E1(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function D1(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function $1(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&D1(t,o)),n}return i._value=e,i}function I1(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&E1(t,o)),n}return i._value=e,i}function _m(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=on(t);return this.tween(n,(r.local?$1:I1)(r,e))}function O1(t,e){return function(){ho(this,t).delay=+e.apply(this,arguments)}}function N1(t,e){return e=+e,function(){ho(this,t).delay=e}}function wm(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?O1:N1)(e,t)):Rt(this.node(),e).delay}function B1(t,e){return function(){Vt(this,t).duration=+e.apply(this,arguments)}}function P1(t,e){return e=+e,function(){Vt(this,t).duration=e}}function Sm(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?B1:P1)(e,t)):Rt(this.node(),e).duration}function F1(t,e){if(typeof e!="function")throw new Error;return function(){Vt(this,t).ease=e}}function km(t){var e=this._id;return arguments.length?this.each(F1(e,t)):Rt(this.node(),e).ease}function z1(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Vt(this,t).ease=n}}function Tm(t){if(typeof t!="function")throw new Error;return this.each(z1(this._id,t))}function Am(t){typeof t!="function"&&(t=Qi(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],s=o.length,a=r[i]=[],c,l=0;l<s;++l)(c=o[l])&&t.call(c,c.__data__,l,o)&&a.push(c);return new Zt(r,this._parents,this._name,this._id)}function Cm(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var c=e[a],l=n[a],u=c.length,f=s[a]=new Array(u),h,d=0;d<u;++d)(h=c[d]||l[d])&&(f[d]=h);for(;a<r;++a)s[a]=e[a];return new Zt(s,this._parents,this._name,this._id)}function V1(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function W1(t,e,n){var r,i,o=V1(e)?ho:Vt;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(e,n),s.on=i}}function Mm(t,e){var n=this._id;return arguments.length<2?Rt(this.node(),n).on.on(t):this.each(W1(n,t,e))}function H1(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Lm(){return this.on("end.remove",H1(this._id))}function Rm(t){var e=this._name,n=this._id;typeof t!="function"&&(t=tr(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],c=a.length,l=o[s]=new Array(c),u,f,h=0;h<c;++h)(u=a[h])&&(f=t.call(u,u.__data__,h,a))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f,An(l[h],e,n,h,l,Rt(u,n)));return new Zt(o,this._parents,e,n)}function Em(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ki(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var c=r[a],l=c.length,u,f=0;f<l;++f)if(u=c[f]){for(var h=t.call(u,u.__data__,f,c),d,x=Rt(u,n),p=0,g=h.length;p<g;++p)(d=h[p])&&An(d,e,n,p,h,x);o.push(h),s.push(u)}return new Zt(o,s,e,n)}var Y1=sn.prototype.constructor;function Dm(){return new Y1(this._groups,this._parents)}function G1(t,e){var n,r,i;return function(){var o=kn(this,t),s=(this.style.removeProperty(t),kn(this,t));return o===s?null:o===n&&s===r?i:i=e(n=o,r=s)}}function $m(t){return function(){this.style.removeProperty(t)}}function U1(t,e,n){var r,i=n+"",o;return function(){var s=kn(this,t);return s===i?null:s===r?o:o=e(r=s,n)}}function X1(t,e,n){var r,i,o;return function(){var s=kn(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),kn(this,t))),s===c?null:s===r&&c===i?o:(i=c,o=e(r=s,a))}}function q1(t,e){var n,r,i,o="style."+e,s="end."+o,a;return function(){var c=Vt(this,t),l=c.on,u=c.value[o]==null?a||(a=$m(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function Im(t,e,n){var r=(t+="")=="transform"?Fl:ta;return e==null?this.styleTween(t,G1(t,r)).on("end.style."+t,$m(t)):typeof e=="function"?this.styleTween(t,X1(t,r,Kr(this,"style."+t,e))).each(q1(this._id,t)):this.styleTween(t,U1(t,r,e),n).on("end.style."+t,null)}function j1(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Z1(t,e,n){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&j1(t,s,n)),r}return o._value=e,o}function Om(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,Z1(t,e,n??""))}function K1(t){return function(){this.textContent=t}}function Q1(t){return function(){var e=t(this);this.textContent=e??""}}function Nm(t){return this.tween("text",typeof t=="function"?Q1(Kr(this,"text",t)):K1(t==null?"":t+""))}function J1(t){return function(e){this.textContent=t.call(this,e)}}function tw(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&J1(i)),e}return r._value=t,r}function Bm(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,tw(t))}function Pm(){for(var t=this._name,e=this._id,n=ea(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=Rt(c,e);An(c,t,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Zt(r,this._parents,t,n)}function Fm(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},c={value:function(){--i===0&&o()}};n.each(function(){var l=Vt(this,r),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),l.on=e}),i===0&&o()})}var ew=0;function Zt(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function zm(t){return sn().transition(t)}function ea(){return++ew}var an=sn.prototype;Zt.prototype=zm.prototype={constructor:Zt,select:Rm,selectAll:Em,selectChild:an.selectChild,selectChildren:an.selectChildren,filter:Am,merge:Cm,selection:Dm,transition:Pm,call:an.call,nodes:an.nodes,node:an.node,size:an.size,empty:an.empty,each:an.each,on:Mm,attr:bm,attrTween:_m,style:Im,styleTween:Om,text:Nm,textTween:Bm,remove:Lm,tween:vm,delay:wm,duration:Sm,ease:km,easeVarying:Tm,end:Fm,[Symbol.iterator]:an[Symbol.iterator]};var Qr=t=>+t;function na(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var nw={time:null,delay:0,duration:250,ease:na};function rw(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Vm(t){var e,n;t instanceof Zt?(e=t._id,t=t._name):(e=ea(),(n=nw).time=uo(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,c,l=0;l<a;++l)(c=s[l])&&An(c,t,e,l,s,n||rw(c,e));return new Zt(r,this._parents,t,e)}sn.prototype.interrupt=ym;sn.prototype.transition=Vm;var Ce=(t=>(t.Start="start",t.Middle="middle",t.End="end",t))(Ce||{}),L=(t=>(t.Top="top",t.Middle="middle",t.Bottom="bottom",t))(L||{}),Me=(t=>(t.Wrap="wrap",t.Trim="trim",t))(Me||{}),C=(t=>(t.Left="left",t.Center="center",t.Right="right",t))(C||{});function Wm(t){switch(t){case C.Center:return"middle";case C.Right:return"end";case C.Left:default:return"start"}}function ra(t,e,n){if(t.size>=5e3&&!t.has(e)){let r=t.keys().next().value;r!==void 0&&t.delete(r)}t.set(e,n)}var Hm="",po=new Map,Lc=new WeakMap,Rc=new Map,Jr=globalThis?.document?.createElement("canvas").getContext("2d")??null,Ym=(t,e)=>`${e}${Hm}${t}`;function iw(){po.clear(),Rc.clear()}globalThis?.document?.fonts?.ready?.then(iw);function ln(t,e,n=Zi()){return t.length*e*n||0}function Gm(t,e){if(Jr)return Jr.font!==e&&(Jr.font=e),Jr.measureText(t).width;let n=/(\d*\.?\d+)(px|pt|pc|rem|em|ex|ch|cm|mm|in|vmin|vmax|vw|vh|%)/.exec(e)?.[0],r=ee(n)??Sn;return ln(t,r,Zi())}function ow(t){let e="",n=t;for(;n&&(e+=`${Hm}${n.getAttribute("class")||""};${n.getAttribute("style")||""}`,n.localName!=="svg");)n=n.parentElement;return e}function Ec(t){let e=Lc.get(t);if(e)return e;let n=ow(t);if(e=Rc.get(n),e)return Lc.set(t,e),e;let r=window.getComputedStyle(t),i=r.fontSize||`${Sn}px`,o=r.fontFamily||"sans-serif";return e={font:`${r.fontStyle||"normal"} ${r.fontWeight||"normal"} ${i} ${o}`,fontFamily:o,fontSizePx:ee(i)},ra(Rc,n,e),Lc.set(t,e),e}function Dc(t){return Ec(t).fontSizePx}function ia(t){return Ec(t).fontFamily}function ti(t){let e=t.textContent||"",{font:n}=Ec(t),r=Ym(e,n),i=po.get(r);if(i!==void 0)return i;let o=Jr?Gm(e,n):t.getComputedTextLength();return ra(po,r,o),o}function Cn(t,e,n,r){let i=typeof n=="number"?`${n}px`:n,o=`${r??""} ${i} ${e}`.trimStart(),s=Ym(t,o),a=po.get(s);if(a!==void 0)return a;let c;if(!Jr&&globalThis.document){let l="http://www.w3.org/2000/svg",u=document.createElementNS(l,"svg"),f=document.createElementNS(l,"text");f.textContent=t,f.setAttribute("font-size",i),f.setAttribute("font-family",e),r!==void 0&&f.setAttribute("font-weight",`${r}`),u.appendChild(f),document.body.appendChild(u),c=f.getComputedTextLength(),document.body.removeChild(u)}else c=Gm(t,o);return ra(po,s,c),c}var oa=t=>{switch(t){case C.Left:return"start";case C.Right:return"end";case C.Center:return"middle";default:return null}};function Xm(t){return t.replace(/-([a-z])/g,(e,n)=>n.toUpperCase())}function qm(t){return t.match(/[A-Z]{2,}(?=[A-Z][a-z0-9]*|\b)|[A-Z]?[a-z0-9]*|[A-Z]|[0-9]+/g)?.filter(Boolean).map(e=>e.toLowerCase()).join("-")}function sw(t,e=15){return t?t.length>e?`\u2026${t.substr(t.length-e,e)}`:t:""}function aw(t,e=15){if(!t)return"";let n=Math.floor((e-3)/2);return t.length>e?`${t.substr(0,n)}\u2026${t.substr(-n,n)}`:t}function lw(t,e=15){return t?t.length>e?`${t.substr(0,e)}\u2026`:t:""}function $c(t,e=15,n=Ce.Middle){if(!t)return"";let r=lw(t,e);return n===Ce.Start?r=sw(t,e):n===Ce.Middle&&(r=aw(t,e)),r}function jm(t,e=[" "]){let n=[t];for(let r=0;r<e.length;r++){let i=e[r];n.forEach((o,s)=>{let a=o.split(i),c=a.map((l,u)=>`${l}${u===a.length-1?"":i}`);n[s]=c}),n=xn(n)}return n}function Ge(t,e,n=[" ","-",".",","]){let r=t.text();if(!r)return;let i=mt(n)?n:[n],o=jm(r,i),s=parseFloat(t.attr("x"))||0;t.text("");let a=t.append("tspan").attr("x",s),c=`${o[0]}`;a.text(c),o.forEach((l,u)=>{if(u===0)return;let f=`${c}${l}`;a.text(f),ti(a.node())>e?(a.text(c.trim()),a=t.append("tspan").attr("x",s).attr("dy","1.2em").text(l),c=l):c+=l})}function ei(t,e=50,n=Ce.Middle,r=!1,i=ee(window.getComputedStyle(t.node())?.fontSize||rn.fontSize),o=Zi()){let s=t.text()||"",a=s.length;if(!a)return!1;if(r){let h=ln(s,i,o),x=Math.ceil(a*e/(1.1*h));return x<a?(t.text($c(s,x,n)),!0):!1}let c=t.node();if(ti(c)<=e)return!1;let l=0,u=a,f=0;for(;l<=u;){let h=l+u>>1;t.text($c(s,h,n)),ti(c)<=e?(f=h,l=h+1):u=h-1}return t.text($c(s,f,n)),!0}function cw(t,e=void 0,n=!0,r=fc,i=!1){let o=`${t.text}`;if(!o)return[];let s=t.fontSize??rn.fontSize,a=t.fontFamily??rn.fontFamily,c=t.fontWeight,l=t.fontWidthToHeightRatio??rn.fontWidthToHeightRatio,u=Array.isArray(r)?r:[r];return o.split(`
62
+ `).map(h=>{let d=[];if(!e)return[h];let x=jm(h,u),p="";for(let g=0;g<x.length;g+=1){(n?ln(p+x[g],s,l):Cn(p+x[g],a,s,c))<e||g===0?p+=x[g]:(d.push(p.trim()),p=x[g]);let b=2;if(i)for(;p.trim().length>b&&(n?ln(p,s,l):Cn(p,a,s,c))>e;){let m=p.trim().length-b;for(;m>0;){let _=`${p.substring(0,m)}${hc}`;if((n?ln(_,s,l):Cn(_,a,s,c))<=e||m===1){d.push(_.trim()),p=p.substring(m);break}m--}}}return p&&d.push(p.trim()),d}).flat()}function or(t,e=void 0,n=void 0,r=!0,i=fc,o=!1){let s=Array.isArray(t)?t.map(f=>te(rn,f)):[te(rn,t)],a=s.map(f=>cw(f,f.width??e,r,f.separator??i,f.wordBreak??o)),c=0,l,u=[];return s.forEach((f,h)=>{let d=a[h],x=c,p=f.fontSize*f.lineHeight,g=0,v=b=>r?ln(b,f.fontSize,f.fontWidthToHeightRatio):Cn(b,f.fontFamily,f.fontSize);for(let b=0;b<d.length;b+=1){let y=d[b];if(b===0&&!l?c+=f.marginTop+f.fontSize:b===0?c+=Math.max(l.marginBottom,f.marginTop)+l.fontSize*(l.lineHeight-1)+f.fontSize:c+=p,n&&c+p>n&&b!==d.length-1){y.charAt(y.length-1)===hc&&(y=y.substr(0,y.length-1));let _=`${y} \u2026`;v(_)<(f.width??e)?d[b]=_:d[b]=`${y.substr(0,y.length-2)}\u2026`,g=Math.max(v(d[b]),g),d=d.slice(0,b+1);break}g=Math.max(v(y),g)}u.push({...f,_lines:d,_estimatedHeight:c-x,_maxWidth:g}),d.length&&(l=u[u.length-1])}),u}var Um="http://www.w3.org/2000/svg";function uw(t,e=0,n,r){let i;return t.map((o,s)=>{let a=Math.max(i?.marginBottom??0,o.marginTop),c=i?a+i.fontSize*i.lineHeight:o.marginTop,l=document.createElementNS(Um,"tspan");return o.className&&l.setAttribute("class",o.className),o.fontSize&&l.setAttribute("font-size",`${o.fontSize}`),o.fontFamily&&l.setAttribute("font-family",`${o.fontFamily}`),o.fontWeight&&l.setAttribute("font-weight",`${o.fontWeight}`),o.color&&l.setAttribute("fill",`${o.color}`),s===0&&n&&l.setAttribute("y",`${n}`),o._lines.forEach((u,f)=>{let h=f===0?c/o.fontSize:o.lineHeight,d=document.createElementNS(Um,"tspan");d.setAttribute("x",`${e}`),d.setAttribute("dy",`${h}em`),d.setAttribute("dominant-baseline",r??"auto"),d.textContent=u.length?u:"\xA0",l.appendChild(d)}),o._lines.length&&(i=o),l})}function sa(t){return is(t,e=>e._estimatedHeight)}function fw(t){return{width:t.length?Math.max(...t.map(e=>e._maxWidth)):0,height:sa(t)}}function aa(t,e,n,r=0){let{width:i,height:o}=fw(t),s=e===C.Center?-i/2:e===C.Right?-i:0,a=n===L.Middle?-o/2:n===L.Bottom?-o:0,c={x:s,y:a,width:i,height:o};return r?us(c,r*Math.PI/180):c}function ni(t,e,n,r){let i=or(e,n.width,void 0,n.fastMode,n.separator,n.wordBreak),o=n.x??+t.getAttribute("x"),s=n.y??+t.getAttribute("y"),a=o??0,c=s??0;if(n.textAlign&&t.setAttribute("text-anchor",Wm(n.textAlign)),n.verticalAlign&&n.verticalAlign!==L.Top){let l=sa(i),u=n.verticalAlign===L.Middle?-l/2:n.verticalAlign===L.Bottom?-l:0;c+=u}n.textRotationAngle?t.setAttribute("transform",`rotate(${n.textRotationAngle===0||n.textRotationAngle?n.textRotationAngle:0} ${a} ${c})`):t.removeAttribute("transform"),t.textContent="";for(let l of uw(i,a,c,r))t.appendChild(l);return i}function D(t,e,n){if(t.nodes().forEach(r=>ir(r)),e){let r=t.transition().duration(e);return n&&r.ease(n),r}else return t}var Ic=new WeakMap;function la(t,e,n){t.each((r,i,o)=>{let s=o[i],a=e(r,i)??{},c=[];for(let u of Object.keys(a)){if(n?.has(u))continue;let f=a[u];if(f==null)continue;let h=u.startsWith("--")?u:qm(u);s.style.setProperty(h,`${f}`),c.push(h)}let l=Ic.get(s);if(l)for(let u of l)c.includes(u)||s.style.removeProperty(u);c.length?Ic.set(s,c):Ic.delete(s)})}var Zm={...qr,tooltip:void 0,annotations:void 0};var ri=class extends Ys{constructor(e,n,r){super(e),this._defaultConfig=Zm,this.config=this._defaultConfig,n&&(this.updateContainer(n,!0),this.component=n.component),r&&this.setData(r,!0),this.component?.datamodel.data&&this.render()}setData(e,n){let{config:r}=this,i=this.component?.datamodel.data!==e;this.component&&this.component.setData(e),n||this.render(),i&&r.tooltip?.hide()}updateContainer(e,n){super.updateContainer(e),this.component=e.component,e.sizing&&(this.component.sizing=e.sizing);let r=e.tooltip;r&&(r.hasContainer()||r.setContainer(this._container),r.setComponents([this.component])),this._reconcileChildren([this.component?.element,e.annotations?.element,this._svgDefs.node(),this._svgDefsExternal.node()]),n||this.render()}updateComponent(e,n){this.component.setConfig(e),n||this.render()}update(e,n,r){e&&this.updateContainer(e,!0),n&&this.updateComponent(n,!0),r&&this.setData(r,!0),this.render()}getFitWidthScale(){let{config:e,component:n}=this,r=n;if(!r.getWidth)return 1;let i=r.getWidth()+e.margin.left+e.margin.right;return this.width/i}_preRender(){let{config:e}=this;super._preRender(),this._propagateSizeAndStyleToComponents([this.component,e.annotations],e.margin)}_render(e){let{config:n,component:r}=this;super._render(e),r.g.attr("transform",`translate(${n.margin.left},${n.margin.top})`),r.render(e),n.annotations?.render(e),n.tooltip&&n.tooltip.update(),n.onRenderComplete?.(this.svg.node(),n.margin,this.containerWidth,this.containerHeight,this.width,this.height)}render(e=this.config.duration){let{config:n,component:r}=this;if(n.sizing===de.Extend||n.sizing===de.FitWidth){let i=n.sizing===de.FitWidth,o=r,s=o.getWidth()+n.margin.left+n.margin.right,a=o.getHeight()+n.margin.top+n.margin.bottom,c=i?this.getFitWidthScale():1,l=this.svg.attr("width"),u=this.svg.attr("height"),f=s*c,h=a*c,d=l||u;D(this.svg,d?e:0).attr("width",f).attr("height",h).attr("viewBox",`0 0 ${s} ${i?h:a}`).attr("preserveAspectRatio","xMinYMin")}else this.svg.attr("width",this.config.width||this.containerWidth).attr("height",this.config.height||this.containerHeight);this._resizeObserver||this._setUpResizeObserver(),cancelAnimationFrame(this._renderAnimationFrameId),this._renderAnimationFrameId=requestAnimationFrame(()=>{this._preRender(),this._render(e)})}_onResize(){let{config:e}=this;super._onResize(),e.tooltip?.hide()}destroy(){let{component:e,config:n}=this;super.destroy(),e?.destroy(),n.tooltip?.destroy(),n.annotations?.destroy()}};function Km(t){return t}var ca=1,ua=2,Oc=3,mo=4,Qm=1e-6;function hw(t){return"translate("+t+",0)"}function dw(t){return"translate(0,"+t+")"}function pw(t){return e=>+t(e)}function mw(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function gw(){return!this.__axis}function fa(t,e){var n=[],r=null,i=null,o=6,s=6,a=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=t===ca||t===mo?-1:1,u=t===mo||t===ua?"x":"y",f=t===ca||t===Oc?hw:dw;function h(d){var x=r??(e.ticks?e.ticks.apply(e,n):e.domain()),p=i??(e.tickFormat?e.tickFormat.apply(e,n):Km),g=Math.max(o,0)+a,v=e.range(),b=+v[0]+c,y=+v[v.length-1]+c,m=(e.bandwidth?mw:pw)(e.copy(),c),_=d.selection?d.selection():d,w=_.selectAll(".domain").data([null]),k=_.selectAll(".tick").data(x,e).order(),M=k.exit(),N=k.enter().append("g").attr("class","tick"),P=k.select("line"),F=k.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(N),P=P.merge(N.append("line").attr("stroke","currentColor").attr(u+"2",l*o)),F=F.merge(N.append("text").attr("fill","currentColor").attr(u,l*g).attr("dy",t===ca?"0em":t===Oc?"0.71em":"0.32em")),d!==_&&(w=w.transition(d),k=k.transition(d),P=P.transition(d),F=F.transition(d),M=M.transition(d).attr("opacity",Qm).attr("transform",function(R){return isFinite(R=m(R))?f(R+c):this.getAttribute("transform")}),N.attr("opacity",Qm).attr("transform",function(R){var $=this.parentNode.__axis;return f(($&&isFinite($=$(R))?$:m(R))+c)})),M.remove(),w.attr("d",t===mo||t===ua?s?"M"+l*s+","+b+"H"+c+"V"+y+"H"+l*s:"M"+c+","+b+"V"+y:s?"M"+b+","+l*s+"V"+c+"H"+y+"V"+l*s:"M"+b+","+c+"H"+y),k.attr("opacity",1).attr("transform",function(R){return f(m(R)+c)}),P.attr(u+"2",l*o),F.attr(u,l*g).text(p),_.filter(gw).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===ua?"start":t===mo?"end":"middle"),_.each(function(){this.__axis=m})}return h.scale=function(d){return arguments.length?(e=d,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(r=d==null?null:Array.from(d),h):r&&r.slice()},h.tickFormat=function(d){return arguments.length?(i=d,h):i},h.tickSize=function(d){return arguments.length?(o=s=+d,h):o},h.tickSizeInner=function(d){return arguments.length?(o=+d,h):o},h.tickSizeOuter=function(d){return arguments.length?(s=+d,h):s},h.tickPadding=function(d){return arguments.length?(a=+d,h):a},h.offset=function(d){return arguments.length?(c=+d,h):c},h}function Nc(t){return fa(ca,t)}function Bc(t){return fa(ua,t)}function Pc(t){return fa(Oc,t)}function Fc(t){return fa(mo,t)}var Ue={duration:600,events:{},attributes:{}};var Xe=class{constructor(e=to.SVG){this.type=to.SVG,this.datamodel=new Tn,this.sizing=de.Fit,this.events={},this._defaultConfig=Ue,this._width=400,this._height=200,this._containerWidth=void 0,this._containerHeight=void 0,this._containerMargin={top:0,bottom:0,left:0,right:0},this._colorFunction=void 0,this._setUpComponentEventsThrottled=Cr(this._setUpComponentEvents,500),this._setCustomAttributesThrottled=Cr(this._setCustomAttributes,500),e===to.SVG?this.element=document.createElementNS("http://www.w3.org/2000/svg","g"):this.element=document.createElement("div"),this.uid=Lr(),this.g=Y(this.element);let n=this.constructor?.selectors?.root;n&&this.g.attr("class",n)}setContainerMargin(e){this._containerMargin=e}setColorFunction(e){this._colorFunction=e}setConfig(e){this.prevConfig=this.config,this.config=te(this._defaultConfig,e)}setData(e){this.datamodel.data=e}setSize(e,n,r,i){isFinite(e)&&(this._width=e),isFinite(n)&&(this._height=n),isFinite(r)&&(this._containerWidth=r),isFinite(i)&&(this._containerHeight=i)}render(e=this.config.duration){this._render(e);let n="animating";e&&(this.g.attr(n,""),this.g.transition(n).duration(e).on("end interrupt",()=>{this.g.attr(n,null)})),this._setUpComponentEventsThrottled(),this._setCustomAttributesThrottled()}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e=this.config.duration){}_setCustomAttributes(){let e=this.config.attributes;Object.keys(e).forEach(n=>{Object.keys(e[n]).forEach(r=>{this.g.selectAll(`.${n}`).attr(r,e[n][r])})})}_setUpComponentEvents(){this._bindEvents(()=>this.events),this._bindEvents(()=>this.config.events,".user")}_mapEventDatum(e,n){return{datum:e,index:n}}_bindEvents(e,n=""){let r=e()??{};Object.keys(r).forEach(i=>{Object.keys(r[i]).forEach(o=>{let s=this.g.selectAll(`.${i}`),a=s.nodes();s.on(o+n,(c,l)=>{let u=e()?.[i]?.[o];if(!u)return;let f=a.indexOf(c.currentTarget),{datum:h,index:d}=this._mapEventDatum(l,f);return u(h,c,d,a)})})})}_onDestroy(){}destroy(){this.isDestroyed()||(this._onDestroy(),this.g?.remove(),this.element=void 0)}isDestroyed(){return!this.element}};var qe=class extends Tn{constructor(e){super(e)}get data(){return this._data??[]}set data(e){Array.isArray(e)&&(this._data=e)}};var ft={...Ue,x:void 0,y:void 0,id:(t,e)=>t.id??`${e}`,color:t=>t.color,xScale:void 0,yScale:void 0,excludeFromDomainCalculation:!1};var ht=class extends Xe{constructor(){super(...arguments),this.datamodel=new qe,this.clippable=!0,this.stacked=!1,this._defaultConfig=ft,this._xScale=ro.scaleLinear(),this._yScale=ro.scaleLinear()}get xScale(){return this.config.xScale||this._xScale}get yScale(){return this.config.yScale||this._yScale}setConfig(e){e&&(this.config?.xScale&&(e.xScale=this.config.xScale),this.config?.yScale&&(e.yScale=this.config.yScale)),super.setConfig(e)}setScaleDomain(e,n){e===St.X&&this._xScale?.domain(n),e===St.Y&&this._yScale?.domain(n)}setScaleRange(e,n){e===St.X&&this._xScale?.range(n),e===St.Y&&this._yScale?.range(n)}setScale(e,n){n&&e===St.X&&(this._xScale=n),n&&e===St.Y&&(this._yScale=n)}getDataExtent(e,n){let{config:r,datamodel:i}=this;switch(e){case St.X:return this.getXDataExtent();case St.Y:return this.getYDataExtent(n);default:return fe(i.data,r[e])}}getXDataExtent(){let{config:e,datamodel:n}=this;return fe(n.data,e.x)}getYDataExtent(e){let{config:n,datamodel:r}=this,i=this.xScale.domain(),o=e?ls(r.data,i,n.x,!0):r.data,s=mt(n.y)?n.y:[n.y];return fe(o,...s)}};var O=(t=>(t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t.Center="center",t.Auto="auto",t))(O||{});var re=(t=>(t.Inside="inside",t.Outside="outside",t.Center="center",t))(re||{}),cn=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(cn||{});function zc(t,e={}){let{tolerance:n=0,priorities:r}=e,i=t.length,o=new Array(i).fill(!0);if(i<2)return o;let s=1/0,a=-1/0,c=1/0,l=-1/0;for(let g of t){let v=g.x+g.width/2,b=g.y+g.height/2;v<s&&(s=v),v>a&&(a=v),b<c&&(c=b),b>l&&(l=b)}let u=a-s>=l-c,f=g=>u?g.x:g.y,h=g=>u?g.x+g.width:g.y+g.height,d=g=>r?.[g]??0,x=t.map((g,v)=>v).sort((g,v)=>f(t[g])-f(t[v])),p=[];for(let g of x){let v=f(t[g]);for(let m=p.length-1;m>=0;m-=1)h(t[p[m]])-3*n<v&&p.splice(m,1);let b=[],y=!1;for(let m of p)if(Je(t[g],t[m],n)){if(d(m)>=d(g)){y=!0;break}b.push(m)}if(y)o[g]=!1;else{for(let m of b)o[m]=!1,p.splice(p.indexOf(m),1);p.push(g)}}return o}function Jm(t,e={}){let n=t.nodes();if(n.length<2){t.style("opacity",1);return}let r=n.map(o=>{let{x:s,y:a,width:c,height:l}=o.getBoundingClientRect();return{x:s,y:a,width:c,height:l}}),i=zc(r,e);n.forEach((o,s)=>Y(o).style("opacity",i[s]?1:0))}var sr=t=>String(+t),tg=(t,e)=>{let n=new Set(t.map(sr)),r=e.filter(i=>!n.has(sr(i)));return r.length?[...t,...r].sort((i,o)=>+i-+o):t};function eg(t,e,n=t.ticks(e)){if(n.length<2||n[0]instanceof Date)return n;let r=n[1]-n[0],i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i);return Math.round(o)!==2?n:t.ticks(e*2)}function ng(t,e){let n=[];for(let r=e;r>=1;r-=1){let i=t.ticks(r),o=n[n.length-1];(!o||!Ke(i,o))&&n.push(i)}return n}function rg(t){let e=[];for(let n=1;n<=t.length;n+=1){let r=t.filter((o,s)=>s%n===0),i=e[e.length-1];(!i||r.length<i.length)&&e.push(r)}return e}function xw(t,e){let n=[];for(let r=0;r<t.length-1;r+=1)Je(t[r],t[r+1],e)&&n.push(r);return n}function ig(t,e,n=0){let r=o=>zc(o,{tolerance:n}).every(s=>s);for(let o of t){let s=e(o);if(r(s))return{fittedTicks:o,labeledTicks:o};let a=xw(s,n),c=0,l=s.length-2;if(!(a.length>0&&a.every(h=>h===c||h===l)))continue;let f=[...o];if(a.includes(l)&&f.pop(),a.includes(c)&&f.shift(),f.length||f.push(o[0]),r(e(f)))return{fittedTicks:o,labeledTicks:f}}let i=t[t.length-1];return i&&{fittedTicks:i,labeledTicks:i}}var og={...ft,position:void 0,type:void 0,label:void 0,labelFontSize:null,labelTextFitMode:Me.Wrap,labelTextTrimType:Ce.Middle,labelTextSeparator:void 0,gridLine:!0,tickLine:!0,domainLine:!0,numTicks:void 0,tickSpacing:175,minMaxTicksOnly:!1,minMaxTicksOnlyWhenWidthIsLess:250,minMaxTicksOnlyShowGridLines:!1,tickTextWidth:void 0,tickTextSeparator:void 0,tickTextForceWordBreak:!1,tickTextTrimType:Ce.Middle,tickTextFitMode:Me.Wrap,tickTextFontSize:null,tickTextAlign:void 0,tickTextColor:null,tickTextAngle:void 0,labelMargin:8,labelColor:null,tickFormat:void 0,tickValues:void 0,fullSize:!0,tickPadding:8,tickSize:6,tickTextAdaptiveSets:void 0,tickTextHideOverlapping:void 0};var Uc={};Lt(Uc,{axis:()=>Wc,cssVarDefaults:()=>Vc,grid:()=>Hc,gridTickHidden:()=>Yc,hideDomain:()=>da,hideTickLine:()=>ha,label:()=>ga,root:()=>sg,tick:()=>pa,tickLabel:()=>xa,tickLabelHideable:()=>Gc,tickTextExiting:()=>go,tickTextHidden:()=>ma,variables:()=>lt});function me(t,e){let n="--vis-",r=Object.entries(t);return Object.fromEntries(r.map(([i])=>[Xm(i.replace(e??n,"")),i]))}function ge(t,e){ut({":root":t,[`${At} .${e}`]:Object.keys(t).filter(n=>n.includes("--vis-dark")).map(n=>({[n.replace("--vis-dark","--vis")]:`var(${n})`}))})}function un(t){return`var(${t})`}var sg=T`
63
63
  label: axis-component;
64
- `,Dc={"--vis-axis-font-family":void 0,"--vis-axis-tick-color":"#e8e9ef","--vis-axis-domain-color":void 0,"--vis-axis-domain-line-dasharray":void 0,"--vis-axis-grid-color":"#e8e9ef","--vis-axis-grid-line-width":"1px","--vis-axis-grid-line-dasharray":"none","--vis-axis-grid-opacity":"1","--vis-axis-grid-transition":"none","--vis-axis-label-font-size":"14px","--vis-axis-label-color":"#6c778c","--vis-axis-label-weight":"500","--vis-axis-tick-label-color":"#6c778c","--vis-axis-tick-label-font-size":"12px","--vis-axis-tick-label-weight":"500","--vis-axis-tick-label-cursor":"default","--vis-axis-tick-label-text-decoration":"none","--vis-axis-tick-line-width":"1px","--vis-axis-tick-label-hide-transition":"opacity 400ms ease-in-out","--vis-axis-domain-line-width":void 0,"--vis-dark-axis-tick-color":"#6c778c","--vis-dark-axis-domain-color":void 0,"--vis-dark-axis-tick-label-color":"#e8e9ef","--vis-dark-axis-grid-color":"#6c778c","--vis-dark-axis-label-color":"#fefefe"},at=pe(Dc);me(Dc,jm);var es=C`
64
+ `,Vc={"--vis-axis-font-family":void 0,"--vis-axis-tick-color":"#e8e9ef","--vis-axis-domain-color":void 0,"--vis-axis-domain-line-dasharray":void 0,"--vis-axis-grid-color":"#e8e9ef","--vis-axis-grid-line-width":"1px","--vis-axis-grid-line-dasharray":"none","--vis-axis-grid-opacity":"1","--vis-axis-grid-transition":"none","--vis-axis-label-font-size":"14px","--vis-axis-label-color":"#6c778c","--vis-axis-label-weight":"500","--vis-axis-tick-label-color":"#6c778c","--vis-axis-tick-label-font-size":"12px","--vis-axis-tick-label-weight":"500","--vis-axis-tick-label-cursor":"default","--vis-axis-tick-label-text-decoration":"none","--vis-axis-tick-line-width":"1px","--vis-axis-tick-label-hide-transition":"opacity 400ms ease-in-out","--vis-axis-domain-line-width":void 0,"--vis-dark-axis-tick-color":"#6c778c","--vis-dark-axis-domain-color":void 0,"--vis-dark-axis-tick-label-color":"#e8e9ef","--vis-dark-axis-grid-color":"#6c778c","--vis-dark-axis-label-color":"#fefefe"},lt=me(Vc);ge(Vc,sg);var ha=T`
65
65
  label: hide-tick-line;
66
- `,ns=C`
66
+ `,da=T`
67
67
  label: hide-domain;
68
- `,Rc=C`
68
+ `,Wc=T`
69
69
  label: axis;
70
70
 
71
71
  user-select: none;
72
72
 
73
73
  .domain {
74
- stroke: var(${at.axisDomainColor}, var(${at.axisTickColor}));
75
- stroke-width: var(${at.axisDomainLineWidth}, var(${at.axisGridLineWidth}));
76
- stroke-dasharray: var(${at.axisDomainLineDasharray}, var(${at.axisGridLineDasharray}));
74
+ stroke: var(${lt.axisDomainColor}, var(${lt.axisTickColor}));
75
+ stroke-width: var(${lt.axisDomainLineWidth}, var(${lt.axisGridLineWidth}));
76
+ stroke-dasharray: var(${lt.axisDomainLineDasharray}, var(${lt.axisGridLineDasharray}));
77
77
  }
78
78
 
79
- &${`.${es}`} {
79
+ &${`.${ha}`} {
80
80
  .tick > line {
81
81
  opacity: 0;
82
82
  }
83
83
  }
84
84
 
85
- &${`.${ns}`} {
85
+ &${`.${da}`} {
86
86
  .domain {
87
87
  opacity: 0;
88
88
  }
89
89
  }
90
- `,Ec=C`
90
+ `,Hc=T`
91
91
  label: grid;
92
92
 
93
93
  .domain {
@@ -95,56 +95,56 @@
95
95
  }
96
96
 
97
97
  line {
98
- stroke: var(${at.axisGridColor});
99
- stroke-width: var(${at.axisGridLineWidth});
100
- stroke-dasharray: var(${at.axisGridLineDasharray});
101
- opacity: var(${at.axisGridOpacity});
102
- transition: var(${at.axisGridTransition});
98
+ stroke: var(${lt.axisGridColor});
99
+ stroke-width: var(${lt.axisGridLineWidth});
100
+ stroke-dasharray: var(${lt.axisGridLineDasharray});
101
+ opacity: var(${lt.axisGridOpacity});
102
+ transition: var(${lt.axisGridTransition});
103
103
  }
104
- `,rs=C`
104
+ `,pa=T`
105
105
  label: tick;
106
106
 
107
107
  stroke: none;
108
- font-size: var(${at.axisTickLabelFontSize});
109
- font-weight: var(${at.axisTickLabelWeight});
108
+ font-size: var(${lt.axisTickLabelFontSize});
109
+ font-weight: var(${lt.axisTickLabelWeight});
110
110
 
111
111
  line {
112
- stroke: var(${at.axisTickColor});
113
- stroke-width: var(${at.axisTickLineWidth});
112
+ stroke: var(${lt.axisTickColor});
113
+ stroke-width: var(${lt.axisTickLineWidth});
114
114
  }
115
115
 
116
116
  text {
117
- fill: var(${at.axisTickLabelColor});
118
- cursor: var(${at.axisTickLabelCursor});
119
- font-family: var(${at.axisFontFamily}, var(--vis-font-family));
120
- text-decoration: var(${at.axisTickLabelTextDecoration});
117
+ fill: var(${lt.axisTickLabelColor});
118
+ cursor: var(${lt.axisTickLabelCursor});
119
+ font-family: var(${lt.axisFontFamily}, var(--vis-font-family));
120
+ text-decoration: var(${lt.axisTickLabelTextDecoration});
121
121
  stroke: none;
122
122
  }
123
- `,ho=C`
123
+ `,go=T`
124
124
  label: tick-text-exiting;
125
- `,Lc=C`
125
+ `,Yc=T`
126
126
  label: grid-tick-hidden;
127
127
  opacity: 0;
128
- transition: var(${at.axisTickLabelHideTransition});
129
- `,is=C`
128
+ transition: var(${lt.axisTickLabelHideTransition});
129
+ `,ma=T`
130
130
  label: tick-text-hidden;
131
131
  opacity: 0;
132
- transition: var(${at.axisTickLabelHideTransition});
133
- `,os=C`
132
+ transition: var(${lt.axisTickLabelHideTransition});
133
+ `,ga=T`
134
134
  label: label;
135
- fill: var(${at.axisLabelColor});
136
- font-size: var(${at.axisLabelFontSize});
137
- font-weight: var(${at.axisLabelWeight});
138
- font-family: var(${at.axisFontFamily}, var(--vis-font-family));
135
+ fill: var(${lt.axisLabelColor});
136
+ font-size: var(${lt.axisLabelFontSize});
137
+ font-weight: var(${lt.axisLabelWeight});
138
+ font-family: var(${lt.axisFontFamily}, var(--vis-font-family));
139
139
  text-anchor: middle;
140
- `,as=C`
140
+ `,xa=T`
141
141
  label: tick-label;
142
- `,$c=C`
142
+ `,Gc=T`
143
143
  label: tick-label-hideable;
144
144
  opacity: 0;
145
- transition: var(${at.axisTickLabelHideTransition});
146
- `;var Km=-5,Qm=class extends ut{constructor(e){super(),this._defaultConfig=Zm,this.config=this._defaultConfig,this._defaultNumTicks=3,this.events={},this.setConfig(e),this.g.attr("axis-type",this.config.type),this.axisGroup=this.g.append("g"),this.gridGroup=this.g.append("g").attr("class",Ec)}setConfig(e){e?.tickTextFontSize!==this.config.tickTextFontSize&&(this._tickTextStyleCached=void 0),super.setConfig(e)}preRender(){let{config:e}=this,n=this.g.append("g").attr("opacity",0);this._renderAxis(n,0,this._getFittingTickValues()?.fittedTicks),e.tickTextAlign&&this._alignTickLabels(n),this._axisRawBBox=n.node().getBBox(),this._renderAxisLabel(n),this._axisSizeBBox=this._getAxisSize(n),this._requiredMargin=this._getRequiredMargin(this._axisSizeBBox),n.remove()}getPosition(){let{config:{type:e,position:n}}=this;return n??(e===Y.X?$.Bottom:$.Left)}_getAxisSize(e){return e.node().getBBox()}_getRequiredMargin(e=this._axisSizeBBox){let{config:{type:n,position:r}}=this;switch(n){case Y.X:{let o=this._axisSizeBBox.x+this._axisSizeBBox.width,a=this._axisSizeBBox.x<0?Math.abs(this._axisSizeBBox.x):0,s=o-this._width>1?o-this._width:0;switch(r){case $.Top:return{top:e.height,left:a,right:s};case $.Bottom:default:return{bottom:e.height,left:a,right:s}}}case Y.Y:{let i=e.height>this._height?(e.height-this._height)/2:0,o=i,a=i;switch(r){case $.Right:return{right:e.width,top:o,bottom:a};case $.Left:default:return{left:e.width,top:o,bottom:a}}}}}getRequiredMargin(){return this._requiredMargin}getOffset(e){let{config:{type:n,position:r}}=this;switch(n){case Y.X:switch(r){case $.Top:return{top:e.top,left:e.left};case $.Bottom:default:return{top:e.top+this._height,left:e.left}}case Y.Y:switch(r){case $.Right:return{top:e.top,left:e.left+this._width};case $.Left:default:return{top:e.top,left:e.left}}}}_render(e=this.config.duration,n=this.axisGroup){let{config:r}=this,i=this._getFittingTickValues(),o=i&&Ym(i.originalTicks,i.fittedTicks),a=i&&new Set(i.labeledTicks.map(nr));if(this._renderAxis(n,e,o,a),this._renderAxisLabel(n),r.gridLine){let s=this._buildGrid(o);this.gridGroup.selectAll("*").interrupt(),R(this.gridGroup,e).call(s).style("opacity",1),this.gridGroup.selectAll("g.tick").classed(Lc,c=>a?!a.has(nr(c)):!1)}else R(this.gridGroup,e).style("opacity",0);r.tickTextAlign&&this._alignTickLabels(),this._resolveTickLabelOverlap(n)}_getAxisGen(){let{config:e}=this;switch(e.type){case Y.X:switch(e.position){case $.Top:return yc(this.xScale);case $.Bottom:default:return bc(this.xScale)}case Y.Y:switch(e.position){case $.Right:return vc(this.yScale);case $.Left:default:return _c(this.yScale)}}}_buildAxis(){let{config:{tickPadding:e,tickSize:n}}=this,r=Array.isArray(n)?n[0]:n,i=Array.isArray(n)?n[1]:n,o=this._getNumTicks(),a=this._getAxisGen();return a.ticks(o).tickPadding(e).tickSizeInner(r).tickSizeOuter(i),a}_buildGrid(e){let{config:n}=this,r=this._getAxisGen();r.tickSize(n.type===Y.X?-this._height:-this._width).tickSizeOuter(0).tickFormat(()=>"");let i=this._getNumTicks()*2,o=r.scale(),a=o.domain(),s=()=>{if(!n.minMaxTicksOnlyShowGridLines)return a;let l=o.ticks(i);if(l.length<2)return a;let u=+l[1]-+l[0],f=a[1];return+f-+l[l.length-1]>u/2?[...l,f]:l},c=e??(n.tickValues?this._getConfiguredTickValues():this._shouldRenderMinMaxTicksOnly()?s():o.ticks(i));return r.tickValues(c),r}_renderAxis(e=this.axisGroup,n=this.config.duration,r,i){let{config:o}=this,a=this._buildAxis(),s=a.scale(),c=r??(o.tickValues?this._getConfiguredTickValues():this._shouldRenderMinMaxTicksOnly()?s.domain():s.ticks(this._getNumTicks())),l=c.length;a.tickValues(c),e.selectAll("*").interrupt();let u=R(e,n).call(a);e.selectAll("text").attr("dy",null).attr("y",null),u.on("end",()=>{this._resolveTickLabelOverlap(e)}),e.selectAll("g.tick").classed(rs,!0).style("font-size",o.tickTextFontSize);let h=e.selectAll("g.tick > text").filter(x=>c.some(y=>Ke(x,y))).classed(as,!0).classed($c,!!o.tickTextHideOverlapping).classed(is,x=>i?!i.has(nr(x)):!1).style("fill",o.tickTextColor);i&&h.filter(x=>!i.has(nr(x))).style("opacity",null),e.selectAll("g.tick > text").filter(x=>!c.some(y=>Ke(x,y))).classed(ho,!0),h.nodes().forEach(x=>er(x));let d=a.tickSize(),g=this.getPosition(),p=this._getTickTextMaxWidth(i?.size??l);if(h.each((x,y,b)=>{let v=o.tickFormat?.(x,y,c)??`${x}`,m=b[y],_=this._getTickTextStyle(m),[w,k]=this._getTickTextOffset(g,d,_.fontSize),A={...this._getTickTextOptions(p),x:w,y:k};if(o.tickTextFitMode===Me.Trim){let N=W(m).text(v);Qr(N,p,o.tickTextTrimType),v=W(m).text()}let I={text:v,..._},O=o.type===Y.X?"central":"hanging";Wm(m,I,A,O)}),e.classed(Rc,!0).classed(es,!o.tickLine).classed(ns,!o.domainLine),o.fullSize){let x=this._getFullDomainPath(0);R(e.select(".domain"),n).attr("d",x)}}_resolveTickLabelOverlap(e=this.axisGroup){let{config:n}=this,r=e.selectAll(`g.tick > text:not(.${ho}):not(.${is})`);if(!n.tickTextHideOverlapping){r.style("opacity",null);return}cancelAnimationFrame(this._collideTickLabelsAnimFrameId),this._collideTickLabelsAnimFrameId=requestAnimationFrame(()=>{Hm(r,{tolerance:Km})})}_getFittingTickValues(){let{config:e}=this;if(!e.tickTextAdaptiveSets||this._shouldRenderMinMaxTicksOnly())return;let n=e.type===Y.X?this.xScale:this.yScale,r=Math.ceil(this._getNumTicks()),i=this._getConfiguredTickValues(),o=i?Xm(i):Um(n,r),a=qm(o,c=>this._getTickLabelRects(c),Km);if(!a)return;let s=i??Gm(n,r,o[0]);return{...a,originalTicks:s}}_getTickTextMaxWidth(e){let{config:n}=this;return n.tickTextWidth||(n.type===Y.X?this._containerWidth/(e+1):this._containerWidth/5)}_getTickTextOptions(e){let{config:n}=this;return{verticalAlign:n.type===Y.X?Xe.Top:Xe.Middle,width:e,textRotationAngle:n.tickTextAngle,separator:n.tickTextSeparator,wordBreak:n.tickTextForceWordBreak,fastMode:!1}}_getTickLabelRects(e){let{config:n}=this,r=n.type===Y.X,i=r?this.xScale:this.yScale,o=this._getTickTextStyle(),a=this._getTickTextOptions(this._getTickTextMaxWidth(e.length)),s=o.fontSize*rn.lineHeight,c=(n.tickTextAngle??0)/180*Math.PI;return e.map((l,u)=>{let f=n.tickFormat?.(l,u,e)??`${l}`,h,d;if(n.tickTextFitMode===Me.Trim){let _=Cn(f,o.fontFamily,o.fontSize,o.fontWeight);h=Math.min(_,a.width),d=s}else{let _=Tc({text:f,...o},a.width,void 0,a.fastMode,a.separator,a.wordBreak),k=_.flatMap(A=>A._lines).map(A=>Cn(A,o.fontFamily,o.fontSize,o.fontWeight));h=Math.max(0,...k),d=Ac(_)}let g=i(l),p=r?[g,0]:[0,g],x=Kt(n.tickTextAlign)?n.tickTextAlign(l,u,e,p,this._width,this._height):n.tickTextAlign,y;r?x===Tt.Left?y=0:x===Tt.Right?y=-h:y=-h/2:y=this.getPosition()===$.Left?-h:0;let b=r?-s/2:-d/2,v={x:y,y:b,width:h,height:d},m=c?_h(v,c):v;return{...m,x:p[0]+m.x,y:p[1]+m.y}})}_getTickTextStyle(e){if(this._tickTextStyleCached)return this._tickTextStyleCached;let n=e?void 0:this.g.append("g").attr("class",rs).style("font-size",this.config.tickTextFontSize),r=e??n.append("text").attr("class",as).node(),i=getComputedStyle(r);return this._tickTextStyleCached={fontSize:Number.parseFloat(i.fontSize),fontFamily:i.fontFamily,fontWeight:Number.parseFloat(i.fontWeight)||void 0},n?.remove(),this._tickTextStyleCached}_getNumTicks(){let{config:{type:e,numTicks:n,tickSpacing:r}}=this;if(n)return n;if(e===Y.X){let i=this.xScale.range(),o=i[1]-i[0];return Math.max(1,Math.floor(o/r))}if(e===Y.Y){let i=this.yScale.range(),o=Math.abs(i[0]-i[1]);return Math.max(1,Math.pow(o,.85)/25)}return this._defaultNumTicks}_getConfiguredTickValues(){let{config:e}=this,r=(e.type===Y.X?this.xScale:this.yScale)?.domain();return e.tickValues?e.tickValues.filter(i=>i>=r[0]&&i<=r[1]):null}_shouldRenderMinMaxTicksOnly(){let{config:e}=this;return e.minMaxTicksOnly?!0:e.tickTextAdaptiveSets?!1:e.type===Y.X&&this._width<e.minMaxTicksOnlyWhenWidthIsLess}_getFullDomainPath(e=0){let{config:{type:n}}=this;switch(n){case Y.X:return`M0.5, ${e} V0.5 H${this._width+.5} V${e}`;case Y.Y:return`M${-e}, ${this._height+.5} H0.5 V0.5 H${-e}`}}_renderAxisLabel(e=this.axisGroup){let{type:n,label:r,labelMargin:i,labelFontSize:o,labelTextFitMode:a,labelTextSeparator:s}=this.config;if(e.selectAll(`.${os}`).remove(),!r)return;let c=this.getPosition(),{width:l,height:u}=this._axisRawBBox??e.node().getBBox(),f=n===Y.Y?-90:0,h=e.append("text").attr("class",os).attr("dy",`${this._getLabelDY()}em`).style("font-size",o).style("fill",this.config.labelColor);h.text(r);let d=!1;if(a===Me.Wrap){let m=n===Y.Y?this._height:this._width;Kr(h.node())>m&&(qe(h,m,s),d=!0)}let g=l,p=u;if(a===Me.Wrap){let m=h.node().getBBox();g=m.width,p=m.height}else{let m=n===Y.X?g:p;Qr(h,m,this.config.labelTextTrimType);let _=h.node().getBBox();g=_.width,p=_.height}let x=n===Y.X?this._width/2:n===Y.Y&&a===Me.Wrap&&d?c===$.Left?-l-p/2-10:l:(-1)**+(c===$.Left)*l,y=n===Y.Y?this._height/2:n===Y.X&&a===Me.Wrap?c===$.Top?-u-p/2:u:(-1)**+(c===$.Top)*u,b=n===Y.X?0:(-1)**+(c===$.Left)*i,v=n===Y.X?(-1)**+(c===$.Top)*i:0;h.attr("transform",`translate(${x+b},${y+v}) rotate(${f})`)}_getLabelDY(){let{type:e,position:n}=this.config;switch(e){case Y.X:switch(n){case $.Top:return 0;case $.Bottom:default:return .75}case Y.Y:switch(n){case $.Right:return .75;case $.Left:default:return-.25}}}_getTickTextOffset(e,n,r){let{config:i}=this,o=(i.tickTextAngle??0)/180*Math.PI,a=n+i.tickPadding;if(i.type===Y.X){let s=e===$.Bottom?1:-1;return[s*a*Math.sin(o),s*(a+r/2)*Math.cos(o)]}else{let s=e===$.Right?1:-1;return[s*a*Math.cos(o),s*a*Math.sin(o)]}}_alignTickLabels(e=this.axisGroup){let{config:{type:n,tickTextAlign:r,tickTextAngle:i,position:o}}=this,a=e.selectAll(`g.tick > text:not(.${ho})`),s=a.data();a.each((c,l,u)=>{let f=u[l],h=s[l],d=n===Y.X?[this.xScale(h),0]:[0,this.yScale(h)],g=Kt(r)?r(h,l,s,d,this._width,this._height):r,p=ts(g),x=n===Y.X?0:this._getYTickTextTranslate(g,o),y=i?`translate(${x},0) rotate(${i})`:`translate(${x},0)`;W(f).attr("transform",y).attr("text-anchor",p)})}_getYTickTextTranslate(e,n=$.Left){let r=this.config.tickPadding+1,i=(this._axisRawBBox?.width??this.axisGroup.node()?.getBBox().width??0)-r;switch(e){case Tt.Left:return n===$.Left?i*-1:0;case Tt.Right:return n===$.Left?0:i;case Tt.Center:return n===$.Left?i*-.5:i*.5;default:return 0}}_onDestroy(){cancelAnimationFrame(this._collideTickLabelsAnimFrameId)}};Qm.selectors=Ic;var Jm=Qm;function X(t){return function(){return t}}var Bc=Math.abs,zt=Math.atan2,De=Math.cos,tg=Math.max,ss=Math.min,Wt=Math.sin,ht=Math.sqrt,$t=1e-12,Re=Math.PI,po=Re/2,ge=2*Re;function eg(t){return t>1?0:t<-1?Re:Math.acos(t)}function Oc(t){return t>=1?po:t<=-1?-po:Math.asin(t)}var Nc=Math.PI,Pc=2*Nc,rr=1e-6,G1=Pc-rr;function ng(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function U1(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return ng;let n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}var ir=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?ng:U1(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,o,a){this._append`C${+e},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(e,n,r,i,o){if(e=+e,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,c=r-e,l=i-n,u=a-e,f=s-n,h=u*u+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(h>rr)if(!(Math.abs(f*c-l*u)>rr)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let d=r-a,g=i-s,p=c*c+l*l,x=d*d+g*g,y=Math.sqrt(p),b=Math.sqrt(h),v=o*Math.tan((Nc-Math.acos((p+h-x)/(2*y*b)))/2),m=v/b,_=v/y;Math.abs(m-1)>rr&&this._append`L${e+m*u},${n+m*f}`,this._append`A${o},${o},0,0,${+(f*d>u*g)},${this._x1=e+_*c},${this._y1=n+_*l}`}}arc(e,n,r,i,o,a){if(e=+e,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),c=r*Math.sin(i),l=e+s,u=n+c,f=1^a,h=a?i-o:o-i;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>rr||Math.abs(this._y1-u)>rr)&&this._append`L${l},${u}`,r&&(h<0&&(h=h%Pc+Pc),h>G1?this._append`A${r},${r},0,1,${f},${e-s},${n-c}A${r},${r},0,1,${f},${this._x1=l},${this._y1=u}`:h>rr&&this._append`A${r},${r},0,${+(h>=Nc)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function rg(){return new ir}rg.prototype=ir.prototype;function Tn(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{let r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new ir(e)}function X1(t){return t.innerRadius}function q1(t){return t.outerRadius}function Z1(t){return t.startAngle}function j1(t){return t.endAngle}function K1(t){return t&&t.padAngle}function Q1(t,e,n,r,i,o,a,s){var c=n-t,l=r-e,u=a-i,f=s-o,h=f*c-u*l;if(!(h*h<$t))return h=(u*(e-o)-f*(t-i))/h,[t+h*c,e+h*l]}function ls(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/ht(s*s+c*c),u=l*c,f=-l*s,h=t+u,d=e+f,g=n+u,p=r+f,x=(h+g)/2,y=(d+p)/2,b=g-h,v=p-d,m=b*b+v*v,_=i-o,w=h*p-g*d,k=(v<0?-1:1)*ht(tg(0,_*_*m-w*w)),A=(w*v-b*k)/m,I=(-w*b-v*k)/m,O=(w*v+b*k)/m,N=(-w*b+v*k)/m,M=A-x,E=I-y,B=O-x,Q=N-y;return M*M+E*E>B*B+Q*Q&&(A=O,I=N),{cx:A,cy:I,x01:-u,y01:-f,x11:A*(i/_-1),y11:I*(i/_-1)}}function or(){var t=X1,e=q1,n=X(0),r=null,i=Z1,o=j1,a=K1,s=null,c=Tn(l);function l(){var u,f,h=+t.apply(this,arguments),d=+e.apply(this,arguments),g=i.apply(this,arguments)-po,p=o.apply(this,arguments)-po,x=Bc(p-g),y=p>g;if(s||(s=u=c()),d<h&&(f=d,d=h,h=f),!(d>$t))s.moveTo(0,0);else if(x>ge-$t)s.moveTo(d*De(g),d*Wt(g)),s.arc(0,0,d,g,p,!y),h>$t&&(s.moveTo(h*De(p),h*Wt(p)),s.arc(0,0,h,p,g,y));else{var b=g,v=p,m=g,_=p,w=x,k=x,A=a.apply(this,arguments)/2,I=A>$t&&(r?+r.apply(this,arguments):ht(h*h+d*d)),O=ss(Bc(d-h)/2,+n.apply(this,arguments)),N=O,M=O,E,B;if(I>$t){var Q=Oc(I/h*Wt(A)),F=Oc(I/d*Wt(A));(w-=Q*2)>$t?(Q*=y?1:-1,m+=Q,_-=Q):(w=0,m=_=(g+p)/2),(k-=F*2)>$t?(F*=y?1:-1,b+=F,v-=F):(k=0,b=v=(g+p)/2)}var q=d*De(b),rt=d*Wt(b),st=h*De(_),et=h*Wt(_);if(O>$t){var Vt=d*De(v),Ht=d*Wt(v),re=h*De(m),ie=h*Wt(m),Dt;if(x<Re)if(Dt=Q1(q,rt,re,ie,Vt,Ht,st,et)){var we=q-Dt[0],le=rt-Dt[1],S=Vt-Dt[0],T=Ht-Dt[1],z=1/Wt(eg((we*S+le*T)/(ht(we*we+le*le)*ht(S*S+T*T)))/2),V=ht(Dt[0]*Dt[0]+Dt[1]*Dt[1]);N=ss(O,(h-V)/(z-1)),M=ss(O,(d-V)/(z+1))}else N=M=0}k>$t?M>$t?(E=ls(re,ie,q,rt,d,M,y),B=ls(Vt,Ht,st,et,d,M,y),s.moveTo(E.cx+E.x01,E.cy+E.y01),M<O?s.arc(E.cx,E.cy,M,zt(E.y01,E.x01),zt(B.y01,B.x01),!y):(s.arc(E.cx,E.cy,M,zt(E.y01,E.x01),zt(E.y11,E.x11),!y),s.arc(0,0,d,zt(E.cy+E.y11,E.cx+E.x11),zt(B.cy+B.y11,B.cx+B.x11),!y),s.arc(B.cx,B.cy,M,zt(B.y11,B.x11),zt(B.y01,B.x01),!y))):(s.moveTo(q,rt),s.arc(0,0,d,b,v,!y)):s.moveTo(q,rt),!(h>$t)||!(w>$t)?s.lineTo(st,et):N>$t?(E=ls(st,et,Vt,Ht,h,-N,y),B=ls(q,rt,re,ie,h,-N,y),s.lineTo(E.cx+E.x01,E.cy+E.y01),N<O?s.arc(E.cx,E.cy,N,zt(E.y01,E.x01),zt(B.y01,B.x01),!y):(s.arc(E.cx,E.cy,N,zt(E.y01,E.x01),zt(E.y11,E.x11),!y),s.arc(0,0,h,zt(E.cy+E.y11,E.cx+E.x11),zt(B.cy+B.y11,B.cx+B.x11),y),s.arc(B.cx,B.cy,N,zt(B.y11,B.x11),zt(B.y01,B.x01),!y))):s.arc(0,0,h,_,m,y)}if(s.closePath(),u)return s=null,u+""||null}return l.centroid=function(){var u=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Re/2;return[De(f)*u,Wt(f)*u]},l.innerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:X(+u),l):t},l.outerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:X(+u),l):e},l.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:X(+u),l):n},l.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:X(+u),l):r},l.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:X(+u),l):i},l.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:X(+u),l):o},l.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:X(+u),l):a},l.context=function(u){return arguments.length?(s=u??null,l):s},l}var XO=Array.prototype.slice;function Jr(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ig(t){this._context=t}ig.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function ar(t){return new ig(t)}function cs(t){return t[0]}function us(t){return t[1]}function sr(t,e){var n=X(!0),r=null,i=ar,o=null,a=Tn(s);t=typeof t=="function"?t:t===void 0?cs:X(t),e=typeof e=="function"?e:e===void 0?us:X(e);function s(c){var l,u=(c=Jr(c)).length,f,h=!1,d;for(r==null&&(o=i(d=a())),l=0;l<=u;++l)!(l<u&&n(f=c[l],l,c))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(f,l,c),+e(f,l,c));if(d)return o=null,d+""||null}return s.x=function(c){return arguments.length?(t=typeof c=="function"?c:X(+c),s):t},s.y=function(c){return arguments.length?(e=typeof c=="function"?c:X(+c),s):e},s.defined=function(c){return arguments.length?(n=typeof c=="function"?c:X(!!c),s):n},s.curve=function(c){return arguments.length?(i=c,r!=null&&(o=i(r)),s):i},s.context=function(c){return arguments.length?(c==null?r=o=null:o=i(r=c),s):r},s}function Fc(t,e,n){var r=null,i=X(!0),o=null,a=ar,s=null,c=Tn(l);t=typeof t=="function"?t:t===void 0?cs:X(+t),e=typeof e=="function"?e:e===void 0?X(0):X(+e),n=typeof n=="function"?n:n===void 0?us:X(+n);function l(f){var h,d,g,p=(f=Jr(f)).length,x,y=!1,b,v=new Array(p),m=new Array(p);for(o==null&&(s=a(b=c())),h=0;h<=p;++h){if(!(h<p&&i(x=f[h],h,f))===y)if(y=!y)d=h,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),g=h-1;g>=d;--g)s.point(v[g],m[g]);s.lineEnd(),s.areaEnd()}y&&(v[h]=+t(x,h,f),m[h]=+e(x,h,f),s.point(r?+r(x,h,f):v[h],n?+n(x,h,f):m[h]))}if(b)return s=null,b+""||null}function u(){return sr().defined(i).curve(a).context(o)}return l.x=function(f){return arguments.length?(t=typeof f=="function"?f:X(+f),r=null,l):t},l.x0=function(f){return arguments.length?(t=typeof f=="function"?f:X(+f),l):t},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:X(+f),l):r},l.y=function(f){return arguments.length?(e=typeof f=="function"?f:X(+f),n=null,l):e},l.y0=function(f){return arguments.length?(e=typeof f=="function"?f:X(+f),l):e},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:X(+f),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:X(!!f),l):i},l.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),l):a},l.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),l):o},l}function og(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function ag(t){return t}function mo(){var t=ag,e=og,n=null,r=X(0),i=X(ge),o=X(0);function a(s){var c,l=(s=Jr(s)).length,u,f,h=0,d=new Array(l),g=new Array(l),p=+r.apply(this,arguments),x=Math.min(ge,Math.max(-ge,i.apply(this,arguments)-p)),y,b=Math.min(Math.abs(x)/l,o.apply(this,arguments)),v=b*(x<0?-1:1),m;for(c=0;c<l;++c)(m=g[d[c]=c]=+t(s[c],c,s))>0&&(h+=m);for(e!=null?d.sort(function(_,w){return e(g[_],g[w])}):n!=null&&d.sort(function(_,w){return n(s[_],s[w])}),c=0,f=h?(x-l*v)/h:0;c<l;++c,p=y)u=d[c],m=g[u],y=p+(m>0?m*f:0)+v,g[u]={data:s[u],index:c,value:m,startAngle:p,endAngle:y,padAngle:b};return g}return a.value=function(s){return arguments.length?(t=typeof s=="function"?s:X(+s),a):t},a.sortValues=function(s){return arguments.length?(e=s,n=null,a):e},a.sort=function(s){return arguments.length?(n=s,e=null,a):n},a.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:X(+s),a):r},a.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:X(+s),a):i},a.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:X(+s),a):o},a}var go={draw(t,e){let n=ht(e/Re);t.moveTo(n,0),t.arc(0,0,n,0,ge)}};var zc={draw(t,e){let n=ht(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}};var sg=ht(1/3),J1=sg*2,Vc={draw(t,e){let n=ht(e/J1),r=n*sg;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}};var Wc={draw(t,e){let n=ht(e),r=-n/2;t.rect(r,r,n,n)}};var tw=.8908130915292852,lg=Wt(Re/10)/Wt(7*Re/10),ew=Wt(ge/10)*lg,nw=-De(ge/10)*lg,Hc={draw(t,e){let n=ht(e*tw),r=ew*n,i=nw*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){let a=ge*o/5,s=De(a),c=Wt(a);t.lineTo(c*n,-s*n),t.lineTo(s*r-c*i,c*r+s*i)}t.closePath()}};var Yc=ht(3),Gc={draw(t,e){let n=-ht(e/(Yc*3));t.moveTo(0,n*2),t.lineTo(-Yc*n,-n),t.lineTo(Yc*n,-n),t.closePath()}};var xe=-.5,ye=ht(3)/2,Uc=1/ht(12),rw=(Uc/2+1)*3,Xc={draw(t,e){let n=ht(e/rw),r=n/2,i=n*Uc,o=r,a=n*Uc+n,s=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(s,c),t.lineTo(xe*r-ye*i,ye*r+xe*i),t.lineTo(xe*o-ye*a,ye*o+xe*a),t.lineTo(xe*s-ye*c,ye*s+xe*c),t.lineTo(xe*r+ye*i,xe*i-ye*r),t.lineTo(xe*o+ye*a,xe*a-ye*o),t.lineTo(xe*s+ye*c,xe*c-ye*s),t.closePath()}};function ti(t,e){let n=null,r=Tn(i);t=typeof t=="function"?t:X(t||go),e=typeof e=="function"?e:X(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:X(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:X(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function ve(){}function ei(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function xo(t){this._context=t}xo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ei(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ei(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function qc(t){return new xo(t)}function cg(t){this._context=t}cg.prototype={areaStart:ve,areaEnd:ve,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:ei(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Zc(t){return new cg(t)}function ug(t){this._context=t}ug.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ei(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function jc(t){return new ug(t)}function fg(t,e){this._basis=new xo(t),this._beta=e}fg.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],i=e[0],o=t[n]-r,a=e[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(r+c*o),this._beta*e[s]+(1-this._beta)*(i+c*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var Kc=(function t(e){function n(r){return e===1?new xo(r):new fg(r,e)}return n.beta=function(r){return t(+r)},n})(.85);function ni(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function fs(t,e){this._context=t,this._k=(1-e)/6}fs.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ni(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ni(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Qc=(function t(e){function n(r){return new fs(r,e)}return n.tension=function(r){return t(+r)},n})(0);function hs(t,e){this._context=t,this._k=(1-e)/6}hs.prototype={areaStart:ve,areaEnd:ve,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ni(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Jc=(function t(e){function n(r){return new hs(r,e)}return n.tension=function(r){return t(+r)},n})(0);function ds(t,e){this._context=t,this._k=(1-e)/6}ds.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ni(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var tu=(function t(e){function n(r){return new ds(r,e)}return n.tension=function(r){return t(+r)},n})(0);function yo(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>$t){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>$t){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function hg(t,e){this._context=t,this._alpha=e}hg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:yo(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var eu=(function t(e){function n(r){return e?new hg(r,e):new fs(r,0)}return n.alpha=function(r){return t(+r)},n})(.5);function dg(t,e){this._context=t,this._alpha=e}dg.prototype={areaStart:ve,areaEnd:ve,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:yo(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var nu=(function t(e){function n(r){return e?new dg(r,e):new hs(r,0)}return n.alpha=function(r){return t(+r)},n})(.5);function pg(t,e){this._context=t,this._alpha=e}pg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:yo(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ru=(function t(e){function n(r){return e?new pg(r,e):new ds(r,0)}return n.alpha=function(r){return t(+r)},n})(.5);function mg(t){this._context=t}mg.prototype={areaStart:ve,areaEnd:ve,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function iu(t){return new mg(t)}function gg(t){return t<0?-1:1}function xg(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(gg(o)+gg(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function yg(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ou(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function ps(t){this._context=t}ps.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ou(this,this._t0,yg(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,ou(this,yg(this,n=xg(this,t,e)),n);break;default:ou(this,this._t0,n=xg(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function vg(t){this._context=new bg(t)}(vg.prototype=Object.create(ps.prototype)).point=function(t,e){ps.prototype.point.call(this,e,t)};function bg(t){this._context=t}bg.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function au(t){return new ps(t)}function su(t){return new vg(t)}function wg(t){this._context=t}wg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=_g(t),i=_g(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],e[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function _g(t){var e,n=t.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/o[e-1],o[e]-=r,a[e]-=r*a[e-1];for(i[n-1]=a[n-1]/o[n-1],e=n-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}function lu(t){return new wg(t)}function ms(t,e){this._context=t,this._t=e}ms.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function cu(t){return new ms(t,.5)}function uu(t){return new ms(t,0)}function fu(t){return new ms(t,1)}function Sg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ow(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Sg(Object(n),!0).forEach(function(r){aw(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Sg(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function vo(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vo=function(e){return typeof e}:vo=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vo(t)}function aw(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gs(){return gs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},gs.apply(this,arguments)}function sw(t,e){if(t){if(typeof t=="string")return kg(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kg(t,e)}}function kg(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ag(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=sw(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
147
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return o=c.done,c},e:function(c){a=!0,s=c},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function lw(t,e){var n=[],r=[];function i(o,a){if(o.length===1)n.push(o[0]),r.push(o[0]);else{for(var s=Array(o.length-1),c=0;c<s.length;c++)c===0&&n.push(o[0]),c===s.length-1&&r.push(o[c+1]),s[c]=[(1-a)*o[c][0]+a*o[c+1][0],(1-a)*o[c][1]+a*o[c+1][1]];i(s,a)}}return t.length&&i(t,e),{left:n,right:r.reverse()}}function cw(t){var e={};return t.length===4&&(e.x2=t[2][0],e.y2=t[2][1]),t.length>=3&&(e.x1=t[1][0],e.y1=t[1][1]),e.x=t[t.length-1][0],e.y=t[t.length-1][1],t.length===4?e.type="C":t.length===3?e.type="Q":e.type="L",e}function uw(t,e){e=e||2;for(var n=[],r=t,i=1/e,o=0;o<e-1;o++){var a=i/(1-i*o),s=lw(r,a);n.push(s.left),r=s.right}return n.push(r),n}function fw(t,e,n){var r=[[t.x,t.y]];return e.x1!=null&&r.push([e.x1,e.y1]),e.x2!=null&&r.push([e.x2,e.y2]),r.push([e.x,e.y]),uw(r,n).map(cw)}var hw=/[MLCSTQAHVZmlcstqahv]|-?[\d.e+-]+/g,ri={M:["x","y"],L:["x","y"],H:["x"],V:["y"],C:["x1","y1","x2","y2","x","y"],S:["x2","y2","x","y"],Q:["x1","y1","x","y"],T:["x","y"],A:["rx","ry","xAxisRotation","largeArcFlag","sweepFlag","x","y"],Z:[]};Object.keys(ri).forEach(function(t){ri[t.toLowerCase()]=ri[t]});function hu(t,e){for(var n=Array(t),r=0;r<t;r++)n[r]=e;return n}function dw(t){return"".concat(t.type).concat(ri[t.type].map(function(e){return t[e]}).join(","))}function pw(t,e){var n={x1:"x",y1:"y",x2:"x",y2:"y"},r=["xAxisRotation","largeArcFlag","sweepFlag"];if(t.type!==e.type&&e.type.toUpperCase()!=="M"){var i={};Object.keys(e).forEach(function(o){var a=e[o],s=t[o];s===void 0&&(r.includes(o)?s=a:(s===void 0&&n[o]&&(s=t[n[o]]),s===void 0&&(s=0))),i[o]=s}),i.type=e.type,t=i}return t}function mw(t,e,n){var r=[];if(e.type==="L"||e.type==="Q"||e.type==="C")r=r.concat(fw(t,e,n));else{var i=gs({},t);i.type==="M"&&(i.type="L"),r=r.concat(hu(n-1).map(function(){return i})),r.push(e)}return r}function Cg(t,e,n){var r=t.length-1,i=e.length-1,o=r/i,a=hu(i).reduce(function(c,l,u){var f=Math.floor(o*u);if(n&&f<t.length-1&&n(t[f],t[f+1])){var h=o*u%1<.5;c[f]&&(h?f>0?f-=1:f<t.length-1&&(f+=1):f<t.length-1?f+=1:f>0&&(f-=1))}return c[f]=(c[f]||0)+1,c},[]),s=a.reduce(function(c,l,u){if(u===t.length-1){var f=hu(l,gs({},t[t.length-1]));return f[0].type==="M"&&f.forEach(function(h){h.type="L"}),c.concat(f)}return c.concat(mw(t[u],t[u+1],l))},[]);return s.unshift(t[0]),s}function Tg(t){for(var e=(t||"").match(hw)||[],n=[],r,i,o=0;o<e.length;++o)if(r=ri[e[o]],r){i={type:e[o]};for(var a=0;a<r.length;++a)i[r[a]]=+e[o+a+1];o+=r.length,n.push(i)}return n}function gw(t,e,n){var r=t==null?[]:t.slice(),i=e==null?[]:e.slice(),o=vo(n)==="object"?n:{excludeSegment:n,snapEndsToInput:!0},a=o.excludeSegment,s=o.snapEndsToInput;if(!r.length&&!i.length)return function(){return[]};var c=(r.length===0||r[r.length-1].type==="Z")&&(i.length===0||i[i.length-1].type==="Z");r.length>0&&r[r.length-1].type==="Z"&&r.pop(),i.length>0&&i[i.length-1].type==="Z"&&i.pop(),r.length?i.length||i.push(r[0]):r.push(i[0]);var l=Math.abs(i.length-r.length);l!==0&&(i.length>r.length?r=Cg(r,i,a):i.length<r.length&&(i=Cg(i,r,a))),r=r.map(function(f,h){return pw(f,i[h])});var u=r.map(function(f){return ow({},f)});return c&&(u.push({type:"Z"}),r.push({type:"Z"})),function(h){if(h===1&&s)return e??[];if(h===0)return r;for(var d=0;d<u.length;++d){var g=r[d],p=i[d],x=u[d],y=Ag(ri[x.type]),b;try{for(y.s();!(b=y.n()).done;){var v=b.value;x[v]=(1-h)*g[v]+h*p[v],(v==="largeArcFlag"||v==="sweepFlag")&&(x[v]=Math.round(x[v]))}}catch(m){y.e(m)}finally{y.f()}}return u}}function bo(t,e,n){var r=Tg(t),i=Tg(e),o=vo(n)==="object"?n:{excludeSegment:n,snapEndsToInput:!0},a=o.excludeSegment,s=o.snapEndsToInput;if(!r.length&&!i.length)return function(){return""};var c=gw(r,i,{excludeSegment:a,snapEndsToInput:s});return function(u){if(u===1&&s)return e??"";var f=c(u),h="",d=Ag(f),g;try{for(d.s();!(g=d.n()).done;){var p=g.value;h+=dw(p)}}catch(x){d.e(x)}finally{d.f()}return h}}var lr=(t=>(t.Basis="basis",t.BasisClosed="basisClosed",t.BasisOpen="basisOpen",t.Bundle="bundle",t.Cardinal="cardinal",t.CardinalClosed="cardinalClosed",t.CardinalOpen="cardinalOpen",t.CatmullRom="catmullRom",t.CatmullRomClosed="catmullRomClosed",t.CatmullRomOpen="catmullRomOpen",t.Linear="linear",t.LinearClosed="linearClosed",t.MonotoneX="monotoneX",t.MonotoneY="monotoneY",t.Natural="natural",t.Step="step",t.StepAfter="stepAfter",t.StepBefore="stepBefore",t))(lr||{}),ii={basis:qc,basisClosed:Zc,basisOpen:jc,bundle:Kc,cardinal:Qc,cardinalClosed:Jc,cardinalOpen:tu,catmullRom:eu,catmullRomClosed:nu,catmullRomOpen:ru,linear:ar,linearClosed:iu,monotoneX:au,monotoneY:su,natural:lu,step:cu,stepAfter:fu,stepBefore:uu};var Mg={...ct,curveType:lr.MonotoneX,lineWidth:2,lineDashArray:void 0,fallbackValue:void 0,highlightOnHover:!1,cursor:null,interpolateMissingData:!1};var du={};Rt(du,{dim:()=>vs,globalStyles:()=>xw,interpolatedPath:()=>bs,line:()=>oi,linePath:()=>xs,lineSelectionHelper:()=>ys,root:()=>yw});var xw=lt`
145
+ transition: var(${lt.axisTickLabelHideTransition});
146
+ `;var ag=-5,lg=class extends ht{constructor(e){super(),this._defaultConfig=og,this.config=this._defaultConfig,this._defaultNumTicks=3,this.events={},this.setConfig(e),this.g.attr("axis-type",this.config.type),this.axisGroup=this.g.append("g"),this.gridGroup=this.g.append("g").attr("class",Hc)}setConfig(e){e?.tickTextFontSize!==this.config.tickTextFontSize&&(this._tickTextStyleCached=void 0),super.setConfig(e)}preRender(){let{config:e}=this,n=this.g.append("g").attr("opacity",0);this._renderAxis(n,0,this._getFittingTickValues()?.fittedTicks),e.tickTextAlign&&this._alignTickLabels(n),this._axisRawBBox=n.node().getBBox(),this._renderAxisLabel(n),this._axisSizeBBox=this._getAxisSize(n),this._requiredMargin=this._getRequiredMargin(this._axisSizeBBox),n.remove()}getPosition(){let{config:{type:e,position:n}}=this;return n??(e===G.X?O.Bottom:O.Left)}_getAxisSize(e){return e.node().getBBox()}_getRequiredMargin(e=this._axisSizeBBox){let{config:{type:n,position:r}}=this;switch(n){case G.X:{let o=this._axisSizeBBox.x+this._axisSizeBBox.width,s=this._axisSizeBBox.x<0?Math.abs(this._axisSizeBBox.x):0,a=o-this._width>1?o-this._width:0;switch(r){case O.Top:return{top:e.height,left:s,right:a};case O.Bottom:default:return{bottom:e.height,left:s,right:a}}}case G.Y:{let i=e.height>this._height?(e.height-this._height)/2:0,o=i,s=i;switch(r){case O.Right:return{right:e.width,top:o,bottom:s};case O.Left:default:return{left:e.width,top:o,bottom:s}}}}}getRequiredMargin(){return this._requiredMargin}getOffset(e){let{config:{type:n,position:r}}=this;switch(n){case G.X:switch(r){case O.Top:return{top:e.top,left:e.left};case O.Bottom:default:return{top:e.top+this._height,left:e.left}}case G.Y:switch(r){case O.Right:return{top:e.top,left:e.left+this._width};case O.Left:default:return{top:e.top,left:e.left}}}}_render(e=this.config.duration,n=this.axisGroup){let{config:r}=this,i=this._getFittingTickValues(),o=i&&tg(i.originalTicks,i.fittedTicks),s=i&&new Set(i.labeledTicks.map(sr));if(this._renderAxis(n,e,o,s),this._renderAxisLabel(n),r.gridLine){let a=this._buildGrid(o);this.gridGroup.selectAll("*").interrupt(),D(this.gridGroup,e).call(a).style("opacity",1),this.gridGroup.selectAll("g.tick").classed(Yc,c=>s?!s.has(sr(c)):!1)}else D(this.gridGroup,e).style("opacity",0);r.tickTextAlign&&this._alignTickLabels(),this._resolveTickLabelOverlap(n)}_getAxisGen(){let{config:e}=this;switch(e.type){case G.X:switch(e.position){case O.Top:return Nc(this.xScale);case O.Bottom:default:return Pc(this.xScale)}case G.Y:switch(e.position){case O.Right:return Bc(this.yScale);case O.Left:default:return Fc(this.yScale)}}}_buildAxis(){let{config:{tickPadding:e,tickSize:n}}=this,r=Array.isArray(n)?n[0]:n,i=Array.isArray(n)?n[1]:n,o=this._getNumTicks(),s=this._getAxisGen();return s.ticks(o).tickPadding(e).tickSizeInner(r).tickSizeOuter(i),s}_buildGrid(e){let{config:n}=this,r=this._getAxisGen();r.tickSize(n.type===G.X?-this._height:-this._width).tickSizeOuter(0).tickFormat(()=>"");let i=this._getNumTicks()*2,o=r.scale(),s=o.domain(),a=()=>{if(!n.minMaxTicksOnlyShowGridLines)return s;let l=o.ticks(i);if(l.length<2)return s;let u=+l[1]-+l[0],f=s[1];return+f-+l[l.length-1]>u/2?[...l,f]:l},c=e??(n.tickValues?this._getConfiguredTickValues():this._shouldRenderMinMaxTicksOnly()?a():o.ticks(i));return r.tickValues(c),r}_renderAxis(e=this.axisGroup,n=this.config.duration,r,i){let{config:o}=this,s=this._buildAxis(),a=s.scale(),c=r??(o.tickValues?this._getConfiguredTickValues():this._shouldRenderMinMaxTicksOnly()?a.domain():a.ticks(this._getNumTicks())),l=c.length;s.tickValues(c),e.selectAll("*").interrupt();let u=D(e,n).call(s);e.selectAll("text").attr("dy",null).attr("y",null),u.on("end",()=>{this._resolveTickLabelOverlap(e)}),e.selectAll("g.tick").classed(pa,!0).style("font-size",o.tickTextFontSize);let h=e.selectAll("g.tick > text").filter(g=>c.some(v=>Ke(g,v))).classed(xa,!0).classed(Gc,!!o.tickTextHideOverlapping).classed(ma,g=>i?!i.has(sr(g)):!1).style("fill",o.tickTextColor);i&&h.filter(g=>!i.has(sr(g))).style("opacity",null),e.selectAll("g.tick > text").filter(g=>!c.some(v=>Ke(g,v))).classed(go,!0),h.nodes().forEach(g=>ir(g));let d=s.tickSize(),x=this.getPosition(),p=this._getTickTextMaxWidth(i?.size??l);if(h.each((g,v,b)=>{let y=o.tickFormat?.(g,v,c)??`${g}`,m=b[v],_=this._getTickTextStyle(m),[w,k]=this._getTickTextOffset(x,d,_.fontSize),M={...this._getTickTextOptions(p),x:w,y:k};if(o.tickTextFitMode===Me.Trim){let F=Y(m).text(y);ei(F,p,o.tickTextTrimType),y=Y(m).text()}let N={text:y,..._},P=o.type===G.X?"central":"hanging";ni(m,N,M,P)}),e.classed(Wc,!0).classed(ha,!o.tickLine).classed(da,!o.domainLine),o.fullSize){let g=this._getFullDomainPath(0);D(e.select(".domain"),n).attr("d",g)}}_resolveTickLabelOverlap(e=this.axisGroup){let{config:n}=this,r=e.selectAll(`g.tick > text:not(.${go}):not(.${ma})`);if(!n.tickTextHideOverlapping){r.style("opacity",null);return}cancelAnimationFrame(this._collideTickLabelsAnimFrameId),this._collideTickLabelsAnimFrameId=requestAnimationFrame(()=>{Jm(r,{tolerance:ag})})}_getFittingTickValues(){let{config:e}=this;if(!e.tickTextAdaptiveSets||this._shouldRenderMinMaxTicksOnly())return;let n=e.type===G.X?this.xScale:this.yScale,r=Math.ceil(this._getNumTicks()),i=this._getConfiguredTickValues(),o=i?rg(i):ng(n,r),s=ig(o,c=>this._getTickLabelRects(c),ag);if(!s)return;let a=i??eg(n,r,o[0]);return{...s,originalTicks:a}}_getTickTextMaxWidth(e){let{config:n}=this;return n.tickTextWidth||(n.type===G.X?this._containerWidth/(e+1):this._containerWidth/5)}_getTickTextOptions(e){let{config:n}=this;return{verticalAlign:n.type===G.X?L.Top:L.Middle,width:e,textRotationAngle:n.tickTextAngle,separator:n.tickTextSeparator,wordBreak:n.tickTextForceWordBreak,fastMode:!1}}_getTickLabelRects(e){let{config:n}=this,r=n.type===G.X,i=r?this.xScale:this.yScale,o=this._getTickTextStyle(),s=this._getTickTextOptions(this._getTickTextMaxWidth(e.length)),a=o.fontSize*rn.lineHeight,c=(n.tickTextAngle??0)/180*Math.PI;return e.map((l,u)=>{let f=n.tickFormat?.(l,u,e)??`${l}`,h,d;if(n.tickTextFitMode===Me.Trim){let _=Cn(f,o.fontFamily,o.fontSize,o.fontWeight);h=Math.min(_,s.width),d=a}else{let _=or({text:f,...o},s.width,void 0,s.fastMode,s.separator,s.wordBreak),k=_.flatMap(M=>M._lines).map(M=>Cn(M,o.fontFamily,o.fontSize,o.fontWeight));h=Math.max(0,...k),d=sa(_)}let x=i(l),p=r?[x,0]:[0,x],g=Jt(n.tickTextAlign)?n.tickTextAlign(l,u,e,p,this._width,this._height):n.tickTextAlign,v;r?g===C.Left?v=0:g===C.Right?v=-h:v=-h/2:v=this.getPosition()===O.Left?-h:0;let b=r?-a/2:-d/2,y={x:v,y:b,width:h,height:d},m=c?us(y,c):y;return{...m,x:p[0]+m.x,y:p[1]+m.y}})}_getTickTextStyle(e){if(this._tickTextStyleCached)return this._tickTextStyleCached;let n=e?void 0:this.g.append("g").attr("class",pa).style("font-size",this.config.tickTextFontSize),r=e??n.append("text").attr("class",xa).node(),i=getComputedStyle(r);return this._tickTextStyleCached={fontSize:Number.parseFloat(i.fontSize),fontFamily:i.fontFamily,fontWeight:Number.parseFloat(i.fontWeight)||void 0},n?.remove(),this._tickTextStyleCached}_getNumTicks(){let{config:{type:e,numTicks:n,tickSpacing:r}}=this;if(n)return n;if(e===G.X){let i=this.xScale.range(),o=i[1]-i[0];return Math.max(1,Math.floor(o/r))}if(e===G.Y){let i=this.yScale.range(),o=Math.abs(i[0]-i[1]);return Math.max(1,Math.pow(o,.85)/25)}return this._defaultNumTicks}_getConfiguredTickValues(){let{config:e}=this,r=(e.type===G.X?this.xScale:this.yScale)?.domain();return e.tickValues?e.tickValues.filter(i=>i>=r[0]&&i<=r[1]):null}_shouldRenderMinMaxTicksOnly(){let{config:e}=this;return e.minMaxTicksOnly?!0:e.tickTextAdaptiveSets?!1:e.type===G.X&&this._width<e.minMaxTicksOnlyWhenWidthIsLess}_getFullDomainPath(e=0){let{config:{type:n}}=this;switch(n){case G.X:return`M0.5, ${e} V0.5 H${this._width+.5} V${e}`;case G.Y:return`M${-e}, ${this._height+.5} H0.5 V0.5 H${-e}`}}_renderAxisLabel(e=this.axisGroup){let{type:n,label:r,labelMargin:i,labelFontSize:o,labelTextFitMode:s,labelTextSeparator:a}=this.config;if(e.selectAll(`.${ga}`).remove(),!r)return;let c=this.getPosition(),{width:l,height:u}=this._axisRawBBox??e.node().getBBox(),f=n===G.Y?-90:0,h=e.append("text").attr("class",ga).attr("dy",`${this._getLabelDY()}em`).style("font-size",o).style("fill",this.config.labelColor);h.text(r);let d=!1;if(s===Me.Wrap){let m=n===G.Y?this._height:this._width;ti(h.node())>m&&(Ge(h,m,a),d=!0)}let x=l,p=u;if(s===Me.Wrap){let m=h.node().getBBox();x=m.width,p=m.height}else{let m=n===G.X?x:p;ei(h,m,this.config.labelTextTrimType);let _=h.node().getBBox();x=_.width,p=_.height}let g=n===G.X?this._width/2:n===G.Y&&s===Me.Wrap&&d?c===O.Left?-l-p/2-10:l:(-1)**+(c===O.Left)*l,v=n===G.Y?this._height/2:n===G.X&&s===Me.Wrap?c===O.Top?-u-p/2:u:(-1)**+(c===O.Top)*u,b=n===G.X?0:(-1)**+(c===O.Left)*i,y=n===G.X?(-1)**+(c===O.Top)*i:0;h.attr("transform",`translate(${g+b},${v+y}) rotate(${f})`)}_getLabelDY(){let{type:e,position:n}=this.config;switch(e){case G.X:switch(n){case O.Top:return 0;case O.Bottom:default:return .75}case G.Y:switch(n){case O.Right:return .75;case O.Left:default:return-.25}}}_getTickTextOffset(e,n,r){let{config:i}=this,o=(i.tickTextAngle??0)/180*Math.PI,s=n+i.tickPadding;if(i.type===G.X){let a=e===O.Bottom?1:-1;return[a*s*Math.sin(o),a*(s+r/2)*Math.cos(o)]}else{let a=e===O.Right?1:-1;return[a*s*Math.cos(o),a*s*Math.sin(o)]}}_alignTickLabels(e=this.axisGroup){let{config:{type:n,tickTextAlign:r,tickTextAngle:i,position:o}}=this,s=e.selectAll(`g.tick > text:not(.${go})`),a=s.data();s.each((c,l,u)=>{let f=u[l],h=a[l],d=n===G.X?[this.xScale(h),0]:[0,this.yScale(h)],x=Jt(r)?r(h,l,a,d,this._width,this._height):r,p=oa(x),g=n===G.X?0:this._getYTickTextTranslate(x,o),v=i?`translate(${g},0) rotate(${i})`:`translate(${g},0)`;Y(f).attr("transform",v).attr("text-anchor",p)})}_getYTickTextTranslate(e,n=O.Left){let r=this.config.tickPadding+1,i=(this._axisRawBBox?.width??this.axisGroup.node()?.getBBox().width??0)-r;switch(e){case C.Left:return n===O.Left?i*-1:0;case C.Right:return n===O.Left?0:i;case C.Center:return n===O.Left?i*-.5:i*.5;default:return 0}}_onDestroy(){cancelAnimationFrame(this._collideTickLabelsAnimFrameId)}};lg.selectors=Uc;var cg=lg;function j(t){return function(){return t}}var Xc=Math.abs,Wt=Math.atan2,Le=Math.cos,ug=Math.max,ya=Math.min,Yt=Math.sin,pt=Math.sqrt,Ot=1e-12,Re=Math.PI,xo=Re/2,xe=2*Re;function fg(t){return t>1?0:t<-1?Re:Math.acos(t)}function qc(t){return t>=1?xo:t<=-1?-xo:Math.asin(t)}var jc=Math.PI,Zc=2*jc,ar=1e-6,yw=Zc-ar;function hg(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function vw(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return hg;let n=10**e;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}var lr=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?hg:vw(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,o,s){this._append`C${+e},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(e,n,r,i,o){if(e=+e,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,c=r-e,l=i-n,u=s-e,f=a-n,h=u*u+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(h>ar)if(!(Math.abs(f*c-l*u)>ar)||!o)this._append`L${this._x1=e},${this._y1=n}`;else{let d=r-s,x=i-a,p=c*c+l*l,g=d*d+x*x,v=Math.sqrt(p),b=Math.sqrt(h),y=o*Math.tan((jc-Math.acos((p+h-g)/(2*v*b)))/2),m=y/b,_=y/v;Math.abs(m-1)>ar&&this._append`L${e+m*u},${n+m*f}`,this._append`A${o},${o},0,0,${+(f*d>u*x)},${this._x1=e+_*c},${this._y1=n+_*l}`}}arc(e,n,r,i,o,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),c=r*Math.sin(i),l=e+a,u=n+c,f=1^s,h=s?i-o:o-i;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>ar||Math.abs(this._y1-u)>ar)&&this._append`L${l},${u}`,r&&(h<0&&(h=h%Zc+Zc),h>yw?this._append`A${r},${r},0,1,${f},${e-a},${n-c}A${r},${r},0,1,${f},${this._x1=l},${this._y1=u}`:h>ar&&this._append`A${r},${r},0,${+(h>=jc)},${f},${this._x1=e+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function dg(){return new lr}dg.prototype=lr.prototype;function Mn(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{let r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new lr(e)}function bw(t){return t.innerRadius}function _w(t){return t.outerRadius}function ww(t){return t.startAngle}function Sw(t){return t.endAngle}function kw(t){return t&&t.padAngle}function Tw(t,e,n,r,i,o,s,a){var c=n-t,l=r-e,u=s-i,f=a-o,h=f*c-u*l;if(!(h*h<Ot))return h=(u*(e-o)-f*(t-i))/h,[t+h*c,e+h*l]}function va(t,e,n,r,i,o,s){var a=t-n,c=e-r,l=(s?o:-o)/pt(a*a+c*c),u=l*c,f=-l*a,h=t+u,d=e+f,x=n+u,p=r+f,g=(h+x)/2,v=(d+p)/2,b=x-h,y=p-d,m=b*b+y*y,_=i-o,w=h*p-x*d,k=(y<0?-1:1)*pt(ug(0,_*_*m-w*w)),M=(w*y-b*k)/m,N=(-w*b-y*k)/m,P=(w*y+b*k)/m,F=(-w*b+y*k)/m,R=M-g,$=N-v,B=P-g,et=F-v;return R*R+$*$>B*B+et*et&&(M=P,N=F),{cx:M,cy:N,x01:-u,y01:-f,x11:M*(i/_-1),y11:N*(i/_-1)}}function cr(){var t=bw,e=_w,n=j(0),r=null,i=ww,o=Sw,s=kw,a=null,c=Mn(l);function l(){var u,f,h=+t.apply(this,arguments),d=+e.apply(this,arguments),x=i.apply(this,arguments)-xo,p=o.apply(this,arguments)-xo,g=Xc(p-x),v=p>x;if(a||(a=u=c()),d<h&&(f=d,d=h,h=f),!(d>Ot))a.moveTo(0,0);else if(g>xe-Ot)a.moveTo(d*Le(x),d*Yt(x)),a.arc(0,0,d,x,p,!v),h>Ot&&(a.moveTo(h*Le(p),h*Yt(p)),a.arc(0,0,h,p,x,v));else{var b=x,y=p,m=x,_=p,w=g,k=g,M=s.apply(this,arguments)/2,N=M>Ot&&(r?+r.apply(this,arguments):pt(h*h+d*d)),P=ya(Xc(d-h)/2,+n.apply(this,arguments)),F=P,R=P,$,B;if(N>Ot){var et=qc(N/h*Yt(M)),V=qc(N/d*Yt(M));(w-=et*2)>Ot?(et*=v?1:-1,m+=et,_-=et):(w=0,m=_=(x+p)/2),(k-=V*2)>Ot?(V*=v?1:-1,b+=V,y-=V):(k=0,b=y=(x+p)/2)}var Z=d*Le(b),st=d*Yt(b),ct=h*Le(_),it=h*Yt(_);if(P>Ot){var Ht=d*Le(y),Gt=d*Yt(y),ie=h*Le(m),oe=h*Yt(m),Et;if(g<Re)if(Et=Tw(Z,st,ie,oe,Ht,Gt,ct,it)){var Se=Z-Et[0],ce=st-Et[1],S=Ht-Et[0],A=Gt-Et[1],W=1/Yt(fg((Se*S+ce*A)/(pt(Se*Se+ce*ce)*pt(S*S+A*A)))/2),H=pt(Et[0]*Et[0]+Et[1]*Et[1]);F=ya(P,(h-H)/(W-1)),R=ya(P,(d-H)/(W+1))}else F=R=0}k>Ot?R>Ot?($=va(ie,oe,Z,st,d,R,v),B=va(Ht,Gt,ct,it,d,R,v),a.moveTo($.cx+$.x01,$.cy+$.y01),R<P?a.arc($.cx,$.cy,R,Wt($.y01,$.x01),Wt(B.y01,B.x01),!v):(a.arc($.cx,$.cy,R,Wt($.y01,$.x01),Wt($.y11,$.x11),!v),a.arc(0,0,d,Wt($.cy+$.y11,$.cx+$.x11),Wt(B.cy+B.y11,B.cx+B.x11),!v),a.arc(B.cx,B.cy,R,Wt(B.y11,B.x11),Wt(B.y01,B.x01),!v))):(a.moveTo(Z,st),a.arc(0,0,d,b,y,!v)):a.moveTo(Z,st),!(h>Ot)||!(w>Ot)?a.lineTo(ct,it):F>Ot?($=va(ct,it,Ht,Gt,h,-F,v),B=va(Z,st,ie,oe,h,-F,v),a.lineTo($.cx+$.x01,$.cy+$.y01),F<P?a.arc($.cx,$.cy,F,Wt($.y01,$.x01),Wt(B.y01,B.x01),!v):(a.arc($.cx,$.cy,F,Wt($.y01,$.x01),Wt($.y11,$.x11),!v),a.arc(0,0,h,Wt($.cy+$.y11,$.cx+$.x11),Wt(B.cy+B.y11,B.cx+B.x11),v),a.arc(B.cx,B.cy,F,Wt(B.y11,B.x11),Wt(B.y01,B.x01),!v))):a.arc(0,0,h,_,m,v)}if(a.closePath(),u)return a=null,u+""||null}return l.centroid=function(){var u=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Re/2;return[Le(f)*u,Yt(f)*u]},l.innerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:j(+u),l):t},l.outerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:j(+u),l):e},l.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:j(+u),l):n},l.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:j(+u),l):r},l.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:j(+u),l):i},l.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:j(+u),l):o},l.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:j(+u),l):s},l.context=function(u){return arguments.length?(a=u??null,l):a},l}var yB=Array.prototype.slice;function ii(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function pg(t){this._context=t}pg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function ur(t){return new pg(t)}function ba(t){return t[0]}function _a(t){return t[1]}function fr(t,e){var n=j(!0),r=null,i=ur,o=null,s=Mn(a);t=typeof t=="function"?t:t===void 0?ba:j(t),e=typeof e=="function"?e:e===void 0?_a:j(e);function a(c){var l,u=(c=ii(c)).length,f,h=!1,d;for(r==null&&(o=i(d=s())),l=0;l<=u;++l)!(l<u&&n(f=c[l],l,c))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(f,l,c),+e(f,l,c));if(d)return o=null,d+""||null}return a.x=function(c){return arguments.length?(t=typeof c=="function"?c:j(+c),a):t},a.y=function(c){return arguments.length?(e=typeof c=="function"?c:j(+c),a):e},a.defined=function(c){return arguments.length?(n=typeof c=="function"?c:j(!!c),a):n},a.curve=function(c){return arguments.length?(i=c,r!=null&&(o=i(r)),a):i},a.context=function(c){return arguments.length?(c==null?r=o=null:o=i(r=c),a):r},a}function Kc(t,e,n){var r=null,i=j(!0),o=null,s=ur,a=null,c=Mn(l);t=typeof t=="function"?t:t===void 0?ba:j(+t),e=typeof e=="function"?e:e===void 0?j(0):j(+e),n=typeof n=="function"?n:n===void 0?_a:j(+n);function l(f){var h,d,x,p=(f=ii(f)).length,g,v=!1,b,y=new Array(p),m=new Array(p);for(o==null&&(a=s(b=c())),h=0;h<=p;++h){if(!(h<p&&i(g=f[h],h,f))===v)if(v=!v)d=h,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),x=h-1;x>=d;--x)a.point(y[x],m[x]);a.lineEnd(),a.areaEnd()}v&&(y[h]=+t(g,h,f),m[h]=+e(g,h,f),a.point(r?+r(g,h,f):y[h],n?+n(g,h,f):m[h]))}if(b)return a=null,b+""||null}function u(){return fr().defined(i).curve(s).context(o)}return l.x=function(f){return arguments.length?(t=typeof f=="function"?f:j(+f),r=null,l):t},l.x0=function(f){return arguments.length?(t=typeof f=="function"?f:j(+f),l):t},l.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:j(+f),l):r},l.y=function(f){return arguments.length?(e=typeof f=="function"?f:j(+f),n=null,l):e},l.y0=function(f){return arguments.length?(e=typeof f=="function"?f:j(+f),l):e},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:j(+f),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:j(!!f),l):i},l.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),l):s},l.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),l):o},l}function mg(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function gg(t){return t}function yo(){var t=gg,e=mg,n=null,r=j(0),i=j(xe),o=j(0);function s(a){var c,l=(a=ii(a)).length,u,f,h=0,d=new Array(l),x=new Array(l),p=+r.apply(this,arguments),g=Math.min(xe,Math.max(-xe,i.apply(this,arguments)-p)),v,b=Math.min(Math.abs(g)/l,o.apply(this,arguments)),y=b*(g<0?-1:1),m;for(c=0;c<l;++c)(m=x[d[c]=c]=+t(a[c],c,a))>0&&(h+=m);for(e!=null?d.sort(function(_,w){return e(x[_],x[w])}):n!=null&&d.sort(function(_,w){return n(a[_],a[w])}),c=0,f=h?(g-l*y)/h:0;c<l;++c,p=v)u=d[c],m=x[u],v=p+(m>0?m*f:0)+y,x[u]={data:a[u],index:c,value:m,startAngle:p,endAngle:v,padAngle:b};return x}return s.value=function(a){return arguments.length?(t=typeof a=="function"?a:j(+a),s):t},s.sortValues=function(a){return arguments.length?(e=a,n=null,s):e},s.sort=function(a){return arguments.length?(n=a,e=null,s):n},s.startAngle=function(a){return arguments.length?(r=typeof a=="function"?a:j(+a),s):r},s.endAngle=function(a){return arguments.length?(i=typeof a=="function"?a:j(+a),s):i},s.padAngle=function(a){return arguments.length?(o=typeof a=="function"?a:j(+a),s):o},s}var vo={draw(t,e){let n=pt(e/Re);t.moveTo(n,0),t.arc(0,0,n,0,xe)}};var Qc={draw(t,e){let n=pt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}};var xg=pt(1/3),Aw=xg*2,Jc={draw(t,e){let n=pt(e/Aw),r=n*xg;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}};var tu={draw(t,e){let n=pt(e),r=-n/2;t.rect(r,r,n,n)}};var Cw=.8908130915292852,yg=Yt(Re/10)/Yt(7*Re/10),Mw=Yt(xe/10)*yg,Lw=-Le(xe/10)*yg,eu={draw(t,e){let n=pt(e*Cw),r=Mw*n,i=Lw*n;t.moveTo(0,-n),t.lineTo(r,i);for(let o=1;o<5;++o){let s=xe*o/5,a=Le(s),c=Yt(s);t.lineTo(c*n,-a*n),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}};var nu=pt(3),ru={draw(t,e){let n=-pt(e/(nu*3));t.moveTo(0,n*2),t.lineTo(-nu*n,-n),t.lineTo(nu*n,-n),t.closePath()}};var ye=-.5,ve=pt(3)/2,iu=1/pt(12),Rw=(iu/2+1)*3,ou={draw(t,e){let n=pt(e/Rw),r=n/2,i=n*iu,o=r,s=n*iu+n,a=-o,c=s;t.moveTo(r,i),t.lineTo(o,s),t.lineTo(a,c),t.lineTo(ye*r-ve*i,ve*r+ye*i),t.lineTo(ye*o-ve*s,ve*o+ye*s),t.lineTo(ye*a-ve*c,ve*a+ye*c),t.lineTo(ye*r+ve*i,ye*i-ve*r),t.lineTo(ye*o+ve*s,ye*s-ve*o),t.lineTo(ye*a+ve*c,ye*c-ve*a),t.closePath()}};function oi(t,e){let n=null,r=Mn(i);t=typeof t=="function"?t:j(t||vo),e=typeof e=="function"?e:j(e===void 0?64:+e);function i(){let o;if(n||(n=o=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(t=typeof o=="function"?o:j(o),i):t},i.size=function(o){return arguments.length?(e=typeof o=="function"?o:j(+o),i):e},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function be(){}function si(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function bo(t){this._context=t}bo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:si(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:si(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function su(t){return new bo(t)}function vg(t){this._context=t}vg.prototype={areaStart:be,areaEnd:be,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:si(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function au(t){return new vg(t)}function bg(t){this._context=t}bg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:si(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function lu(t){return new bg(t)}function _g(t,e){this._basis=new bo(t),this._beta=e}_g.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r=t[0],i=e[0],o=t[n]-r,s=e[n]-i,a=-1,c;++a<=n;)c=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(r+c*o),this._beta*e[a]+(1-this._beta)*(i+c*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var cu=(function t(e){function n(r){return e===1?new bo(r):new _g(r,e)}return n.beta=function(r){return t(+r)},n})(.85);function ai(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function wa(t,e){this._context=t,this._k=(1-e)/6}wa.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ai(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ai(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var uu=(function t(e){function n(r){return new wa(r,e)}return n.tension=function(r){return t(+r)},n})(0);function Sa(t,e){this._context=t,this._k=(1-e)/6}Sa.prototype={areaStart:be,areaEnd:be,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ai(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var fu=(function t(e){function n(r){return new Sa(r,e)}return n.tension=function(r){return t(+r)},n})(0);function ka(t,e){this._context=t,this._k=(1-e)/6}ka.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ai(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var hu=(function t(e){function n(r){return new ka(r,e)}return n.tension=function(r){return t(+r)},n})(0);function _o(t,e,n){var r=t._x1,i=t._y1,o=t._x2,s=t._y2;if(t._l01_a>Ot){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Ot){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,s,t._x2,t._y2)}function wg(t,e){this._context=t,this._alpha=e}wg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:_o(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var du=(function t(e){function n(r){return e?new wg(r,e):new wa(r,0)}return n.alpha=function(r){return t(+r)},n})(.5);function Sg(t,e){this._context=t,this._alpha=e}Sg.prototype={areaStart:be,areaEnd:be,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:_o(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var pu=(function t(e){function n(r){return e?new Sg(r,e):new Sa(r,0)}return n.alpha=function(r){return t(+r)},n})(.5);function kg(t,e){this._context=t,this._alpha=e}kg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:_o(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var mu=(function t(e){function n(r){return e?new kg(r,e):new ka(r,0)}return n.alpha=function(r){return t(+r)},n})(.5);function Tg(t){this._context=t}Tg.prototype={areaStart:be,areaEnd:be,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function gu(t){return new Tg(t)}function Ag(t){return t<0?-1:1}function Cg(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),s=(n-t._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(Ag(o)+Ag(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function Mg(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function xu(t,e,n){var r=t._x0,i=t._y0,o=t._x1,s=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*e,o-a,s-a*n,o,s)}function Ta(t){this._context=t}Ta.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:xu(this,this._t0,Mg(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,xu(this,Mg(this,n=Cg(this,t,e)),n);break;default:xu(this,this._t0,n=Cg(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function Lg(t){this._context=new Rg(t)}(Lg.prototype=Object.create(Ta.prototype)).point=function(t,e){Ta.prototype.point.call(this,e,t)};function Rg(t){this._context=t}Rg.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};function yu(t){return new Ta(t)}function vu(t){return new Lg(t)}function Dg(t){this._context=t}Dg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var r=Eg(t),i=Eg(e),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[s],e[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function Eg(t){var e,n=t.length-1,r,i=new Array(n),o=new Array(n),s=new Array(n);for(i[0]=0,o[0]=2,s[0]=t[0]+2*t[1],e=1;e<n-1;++e)i[e]=1,o[e]=4,s[e]=4*t[e]+2*t[e+1];for(i[n-1]=2,o[n-1]=7,s[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)r=i[e]/o[e-1],o[e]-=r,s[e]-=r*s[e-1];for(i[n-1]=s[n-1]/o[n-1],e=n-2;e>=0;--e)i[e]=(s[e]-i[e+1])/o[e];for(o[n-1]=(t[n]+i[n-1])/2,e=0;e<n-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}function bu(t){return new Dg(t)}function Aa(t,e){this._context=t,this._t=e}Aa.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function _u(t){return new Aa(t,.5)}function wu(t){return new Aa(t,0)}function Su(t){return new Aa(t,1)}function $g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Dw(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$g(Object(n),!0).forEach(function(r){$w(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$g(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function wo(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wo=function(e){return typeof e}:wo=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wo(t)}function $w(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ca(){return Ca=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ca.apply(this,arguments)}function Iw(t,e){if(t){if(typeof t=="string")return Ig(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ig(t,e)}}function Ig(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Bg(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Iw(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
147
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function Ow(t,e){var n=[],r=[];function i(o,s){if(o.length===1)n.push(o[0]),r.push(o[0]);else{for(var a=Array(o.length-1),c=0;c<a.length;c++)c===0&&n.push(o[0]),c===a.length-1&&r.push(o[c+1]),a[c]=[(1-s)*o[c][0]+s*o[c+1][0],(1-s)*o[c][1]+s*o[c+1][1]];i(a,s)}}return t.length&&i(t,e),{left:n,right:r.reverse()}}function Nw(t){var e={};return t.length===4&&(e.x2=t[2][0],e.y2=t[2][1]),t.length>=3&&(e.x1=t[1][0],e.y1=t[1][1]),e.x=t[t.length-1][0],e.y=t[t.length-1][1],t.length===4?e.type="C":t.length===3?e.type="Q":e.type="L",e}function Bw(t,e){e=e||2;for(var n=[],r=t,i=1/e,o=0;o<e-1;o++){var s=i/(1-i*o),a=Ow(r,s);n.push(a.left),r=a.right}return n.push(r),n}function Pw(t,e,n){var r=[[t.x,t.y]];return e.x1!=null&&r.push([e.x1,e.y1]),e.x2!=null&&r.push([e.x2,e.y2]),r.push([e.x,e.y]),Bw(r,n).map(Nw)}var Fw=/[MLCSTQAHVZmlcstqahv]|-?[\d.e+-]+/g,li={M:["x","y"],L:["x","y"],H:["x"],V:["y"],C:["x1","y1","x2","y2","x","y"],S:["x2","y2","x","y"],Q:["x1","y1","x","y"],T:["x","y"],A:["rx","ry","xAxisRotation","largeArcFlag","sweepFlag","x","y"],Z:[]};Object.keys(li).forEach(function(t){li[t.toLowerCase()]=li[t]});function ku(t,e){for(var n=Array(t),r=0;r<t;r++)n[r]=e;return n}function zw(t){return"".concat(t.type).concat(li[t.type].map(function(e){return t[e]}).join(","))}function Vw(t,e){var n={x1:"x",y1:"y",x2:"x",y2:"y"},r=["xAxisRotation","largeArcFlag","sweepFlag"];if(t.type!==e.type&&e.type.toUpperCase()!=="M"){var i={};Object.keys(e).forEach(function(o){var s=e[o],a=t[o];a===void 0&&(r.includes(o)?a=s:(a===void 0&&n[o]&&(a=t[n[o]]),a===void 0&&(a=0))),i[o]=a}),i.type=e.type,t=i}return t}function Ww(t,e,n){var r=[];if(e.type==="L"||e.type==="Q"||e.type==="C")r=r.concat(Pw(t,e,n));else{var i=Ca({},t);i.type==="M"&&(i.type="L"),r=r.concat(ku(n-1).map(function(){return i})),r.push(e)}return r}function Og(t,e,n){var r=t.length-1,i=e.length-1,o=r/i,s=ku(i).reduce(function(c,l,u){var f=Math.floor(o*u);if(n&&f<t.length-1&&n(t[f],t[f+1])){var h=o*u%1<.5;c[f]&&(h?f>0?f-=1:f<t.length-1&&(f+=1):f<t.length-1?f+=1:f>0&&(f-=1))}return c[f]=(c[f]||0)+1,c},[]),a=s.reduce(function(c,l,u){if(u===t.length-1){var f=ku(l,Ca({},t[t.length-1]));return f[0].type==="M"&&f.forEach(function(h){h.type="L"}),c.concat(f)}return c.concat(Ww(t[u],t[u+1],l))},[]);return a.unshift(t[0]),a}function Ng(t){for(var e=(t||"").match(Fw)||[],n=[],r,i,o=0;o<e.length;++o)if(r=li[e[o]],r){i={type:e[o]};for(var s=0;s<r.length;++s)i[r[s]]=+e[o+s+1];o+=r.length,n.push(i)}return n}function Hw(t,e,n){var r=t==null?[]:t.slice(),i=e==null?[]:e.slice(),o=wo(n)==="object"?n:{excludeSegment:n,snapEndsToInput:!0},s=o.excludeSegment,a=o.snapEndsToInput;if(!r.length&&!i.length)return function(){return[]};var c=(r.length===0||r[r.length-1].type==="Z")&&(i.length===0||i[i.length-1].type==="Z");r.length>0&&r[r.length-1].type==="Z"&&r.pop(),i.length>0&&i[i.length-1].type==="Z"&&i.pop(),r.length?i.length||i.push(r[0]):r.push(i[0]);var l=Math.abs(i.length-r.length);l!==0&&(i.length>r.length?r=Og(r,i,s):i.length<r.length&&(i=Og(i,r,s))),r=r.map(function(f,h){return Vw(f,i[h])});var u=r.map(function(f){return Dw({},f)});return c&&(u.push({type:"Z"}),r.push({type:"Z"})),function(h){if(h===1&&a)return e??[];if(h===0)return r;for(var d=0;d<u.length;++d){var x=r[d],p=i[d],g=u[d],v=Bg(li[g.type]),b;try{for(v.s();!(b=v.n()).done;){var y=b.value;g[y]=(1-h)*x[y]+h*p[y],(y==="largeArcFlag"||y==="sweepFlag")&&(g[y]=Math.round(g[y]))}}catch(m){v.e(m)}finally{v.f()}}return u}}function So(t,e,n){var r=Ng(t),i=Ng(e),o=wo(n)==="object"?n:{excludeSegment:n,snapEndsToInput:!0},s=o.excludeSegment,a=o.snapEndsToInput;if(!r.length&&!i.length)return function(){return""};var c=Hw(r,i,{excludeSegment:s,snapEndsToInput:a});return function(u){if(u===1&&a)return e??"";var f=c(u),h="",d=Bg(f),x;try{for(d.s();!(x=d.n()).done;){var p=x.value;h+=zw(p)}}catch(g){d.e(g)}finally{d.f()}return h}}var hr=(t=>(t.Basis="basis",t.BasisClosed="basisClosed",t.BasisOpen="basisOpen",t.Bundle="bundle",t.Cardinal="cardinal",t.CardinalClosed="cardinalClosed",t.CardinalOpen="cardinalOpen",t.CatmullRom="catmullRom",t.CatmullRomClosed="catmullRomClosed",t.CatmullRomOpen="catmullRomOpen",t.Linear="linear",t.LinearClosed="linearClosed",t.MonotoneX="monotoneX",t.MonotoneY="monotoneY",t.Natural="natural",t.Step="step",t.StepAfter="stepAfter",t.StepBefore="stepBefore",t))(hr||{}),ci={basis:su,basisClosed:au,basisOpen:lu,bundle:cu,cardinal:uu,cardinalClosed:fu,cardinalOpen:hu,catmullRom:du,catmullRomClosed:pu,catmullRomOpen:mu,linear:ur,linearClosed:gu,monotoneX:yu,monotoneY:vu,natural:bu,step:_u,stepAfter:Su,stepBefore:wu};var Pg={...ft,curveType:hr.MonotoneX,lineWidth:2,lineDashArray:void 0,fallbackValue:void 0,highlightOnHover:!1,cursor:null,interpolateMissingData:!1};var Tu={};Lt(Tu,{dim:()=>Ra,globalStyles:()=>Yw,interpolatedPath:()=>Ea,line:()=>ui,linePath:()=>Ma,lineSelectionHelper:()=>La,root:()=>Gw});var Yw=ut`
148
148
  :root {
149
149
  --vis-line-cursor: default;
150
150
  --vis-line-stroke-dasharray: none;
@@ -154,33 +154,33 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
154
154
  --vis-line-gapfill-stroke-opacity: 0.8;
155
155
  --vis-line-gapfill-stroke-dashoffset: 0;
156
156
  }
157
- `,yw=C`
157
+ `,Gw=T`
158
158
  label: line-component;
159
- `,oi=C`
159
+ `,ui=T`
160
160
  label: line;
161
161
  transition: opacity 200ms;
162
162
  cursor: var(--vis-line-cursor);
163
- `,xs=C`
163
+ `,Ma=T`
164
164
  label: linePath;
165
165
  fill: none;
166
166
  stroke-dasharray: var(--vis-line-stroke-dasharray);
167
167
  stroke-dashoffset: var(--vis-line-stroke-dashoffset);
168
- `,ys=C`
168
+ `,La=T`
169
169
  label: lineSelectionHelper;
170
170
  fill: none;
171
171
  stroke: rgba(0, 0, 0, 0);
172
172
  stroke-width: 8px;
173
- `,vs=C`
173
+ `,Ra=T`
174
174
  opacity: 0.2;
175
- `,bs=C`
175
+ `,Ea=T`
176
176
  label: interpolated-path;
177
177
  fill: none;
178
178
  stroke-dasharray: var(--vis-line-gapfill-stroke-dasharray);
179
179
  stroke-dashoffset: var(--vis-line-gapfill-stroke-dashoffset);
180
180
  stroke-opacity: var(--vis-line-gapfill-stroke-opacity);
181
- `;var Dg=class Rg extends ut{constructor(e){super(),this._defaultConfig=Mg,this.config=this._defaultConfig,this.curve=ii[lr.MonotoneX],this.events={[Rg.selectors.line]:{mouseover:this._highlight.bind(this),mouseleave:this._resetHighlight.bind(this)}},this.setConfig(e)}get bleed(){let{config:{lineWidth:e}}=this,n=this.yScale.domain(),i=(this.yScale.range()[0]>this.yScale.range()[1]?Lt.North:Lt.South)===Lt.South,o=e>3,a=e>=10;return{top:!a&&(!i&&n[1]===0||i&&n[0]===0)?0:e/2,bottom:!a&&(!i&&n[0]===0||i&&n[1]===0)?0:e/2,left:o?e/2:0,right:o?e/2:0}}_render(e){super._render(e);let{config:n,datamodel:{data:r}}=this,i=U(e)?e:n.duration,o={colorFn:this._colorFunction};this.curve=ii[n.curveType],this.lineGen=sr().x(h=>h.x).y(h=>h.y).defined(h=>h.defined).curve(this.curve);let a=At(n.y)?n.y:[n.y],s=r.map((h,d)=>this.xScale(L(h,n.x,d))),c=a.map(h=>{let d=r.map((b,v)=>{let m=L(b,h,v),_=(U(m)||m===null)&&isFinite(m)?m:n.fallbackValue,w=n.interpolateMissingData?(U(m)||m===null)&&isFinite(m):isFinite(_);return{x:s[v],y:this.yScale(_??0),defined:w,value:_}}),g=d.reduce((b,v)=>v.defined||b,!1),p=!1,x=d.reduce((b,v,m)=>{!v.defined&&isFinite(n.fallbackValue)&&b.push({...v,defined:!0}),!v.defined&&!p&&(p=!0);let _=m>0&&!d[m-1].defined||m<d.length-1&&!d[m+1].defined;return v.defined&&_&&(p||b.push({...v,defined:!1}),b.push(v),p=!1),b},[]),y=g&&d.some(b=>b.value!==null);return{values:d,defined:g,gaps:x,visible:y}}),l=this.g.selectAll(`.${oi}`).data(c),u=l.enter().append("g").attr("class",oi);u.append("path").attr("class",xs).attr(dt,(h,d)=>d).attr("stroke",(h,d)=>H(r,n.color,d,n.colorKeys?.[d],o)).attr("stroke-opacity",0).attr("stroke-width",n.lineWidth),u.append("path").attr("class",ys).attr("d",this._emptyPath()),u.append("path").attr("class",bs).attr("d",this._emptyPath()).style("opacity",0);let f=u.merge(l);f.style("cursor",(h,d)=>G(r,n.cursor,d)),f.each((h,d,g)=>{let p=W(g[d]),x=p.select(`.${xs}`),y=p.select(`.${ys}`),b=p.select(`.${bs}`),v=h.visible,m=H(r,n.color,d,n.colorKeys?.[d],o),_=Wr(ft(r,n.pattern,d),m,x.node()),k=K(r,n.lineDashArray,d)?.join(" ")??_?.dashArray??null;x.style("marker",_?.marker??null);let A=R(x,i).attr("stroke",m).attr("stroke-width",n.lineWidth).attr("stroke-opacity",v?1:0).style("stroke-dasharray",k),I=h.values.some(N=>!N.defined),O=this.lineGen(h.values);if(i&&!I){let N=x.attr("d")||this._emptyPath(),M=O||this._emptyPath();A.attrTween("d",()=>bo(N,M))}else h.visible&&A.attr("d",O);y.attr("d",O).attr("visibility",v?null:"hidden"),I&&n.interpolateMissingData?R(b,i).attr("d",this.lineGen(h.gaps)).attr("stroke",H(r,n.color,d,n.colorKeys?.[d],o)).attr("stroke-width",n.lineWidth-1).style("opacity",1):b.transition().duration(i).style("opacity",0)}),R(l.exit(),i).style("opacity",0).remove()}_emptyPath(){let e=this.xScale.range(),n=this.yScale.range();return`M${e[0]},${n[0]} L${e[1]},${n[0]}`}_highlight(e){let{config:n}=this;n.highlightOnHover&&this.g.selectAll(`.${oi}`).classed(vs,r=>r!==e)}_resetHighlight(){let{config:e}=this;e.highlightOnHover&&this.g.selectAll(`.${oi}`).classed(vs,!1)}};Dg.selectors=du;var Eg=Dg;var Lg={...ct,color:void 0,curveType:lr.MonotoneX,baseline:()=>0,opacity:1,cursor:null,line:!1,lineColor:void 0,lineWidth:2,lineDashArray:void 0,minHeight1Px:!1,minHeight:void 0,stackMinHeight:!1};var pu={};Rt(pu,{area:()=>_o,areaLinePath:()=>_s,globalStyles:()=>vw,root:()=>$g});var $g=C`
181
+ `;var Fg=class zg extends ht{constructor(e){super(),this._defaultConfig=Pg,this.config=this._defaultConfig,this.curve=ci[hr.MonotoneX],this.events={[zg.selectors.line]:{mouseover:this._highlight.bind(this),mouseleave:this._resetHighlight.bind(this)}},this.setConfig(e)}get bleed(){let{config:{lineWidth:e}}=this,n=this.yScale.domain(),i=(this.yScale.range()[0]>this.yScale.range()[1]?It.North:It.South)===It.South,o=e>3,s=e>=10;return{top:!s&&(!i&&n[1]===0||i&&n[0]===0)?0:e/2,bottom:!s&&(!i&&n[0]===0||i&&n[1]===0)?0:e/2,left:o?e/2:0,right:o?e/2:0}}_render(e){super._render(e);let{config:n,datamodel:{data:r}}=this,i=U(e)?e:n.duration,o={colorFn:this._colorFunction};this.curve=ci[n.curveType],this.lineGen=fr().x(h=>h.x).y(h=>h.y).defined(h=>h.defined).curve(this.curve);let s=mt(n.y)?n.y:[n.y],a=r.map((h,d)=>this.xScale(I(h,n.x,d))),c=s.map(h=>{let d=r.map((b,y)=>{let m=I(b,h,y),_=(U(m)||m===null)&&isFinite(m)?m:n.fallbackValue,w=n.interpolateMissingData?(U(m)||m===null)&&isFinite(m):isFinite(_);return{x:a[y],y:this.yScale(_??0),defined:w,value:_}}),x=d.reduce((b,y)=>y.defined||b,!1),p=!1,g=d.reduce((b,y,m)=>{!y.defined&&isFinite(n.fallbackValue)&&b.push({...y,defined:!0}),!y.defined&&!p&&(p=!0);let _=m>0&&!d[m-1].defined||m<d.length-1&&!d[m+1].defined;return y.defined&&_&&(p||b.push({...y,defined:!1}),b.push(y),p=!1),b},[]),v=x&&d.some(b=>b.value!==null);return{values:d,defined:x,gaps:g,visible:v}}),l=this.g.selectAll(`.${ui}`).data(c),u=l.enter().append("g").attr("class",ui);u.append("path").attr("class",Ma).attr(gt,(h,d)=>d).attr("stroke",(h,d)=>X(r,n.color,d,n.colorKeys?.[d],o)).attr("stroke-opacity",0).attr("stroke-width",n.lineWidth),u.append("path").attr("class",La).attr("d",this._emptyPath()),u.append("path").attr("class",Ea).attr("d",this._emptyPath()).style("opacity",0);let f=u.merge(l);f.style("cursor",(h,d)=>q(r,n.cursor,d)),f.each((h,d,x)=>{let p=Y(x[d]),g=p.select(`.${Ma}`),v=p.select(`.${La}`),b=p.select(`.${Ea}`),y=h.visible,m=X(r,n.color,d,n.colorKeys?.[d],o),_=Ur(dt(r,n.pattern,d),m,g.node()),k=K(r,n.lineDashArray,d)?.join(" ")??_?.dashArray??null;g.style("marker",_?.marker??null);let M=D(g,i).attr("stroke",m).attr("stroke-width",n.lineWidth).attr("stroke-opacity",y?1:0).style("stroke-dasharray",k),N=h.values.some(F=>!F.defined),P=this.lineGen(h.values);if(i&&!N){let F=g.attr("d")||this._emptyPath(),R=P||this._emptyPath();M.attrTween("d",()=>So(F,R))}else h.visible&&M.attr("d",P);v.attr("d",P).attr("visibility",y?null:"hidden"),N&&n.interpolateMissingData?D(b,i).attr("d",this.lineGen(h.gaps)).attr("stroke",X(r,n.color,d,n.colorKeys?.[d],o)).attr("stroke-width",n.lineWidth-1).style("opacity",1):b.transition().duration(i).style("opacity",0)}),D(l.exit(),i).style("opacity",0).remove()}_emptyPath(){let e=this.xScale.range(),n=this.yScale.range();return`M${e[0]},${n[0]} L${e[1]},${n[0]}`}_highlight(e){let{config:n}=this;n.highlightOnHover&&this.g.selectAll(`.${ui}`).classed(Ra,r=>r!==e)}_resetHighlight(){let{config:e}=this;e.highlightOnHover&&this.g.selectAll(`.${ui}`).classed(Ra,!1)}};Fg.selectors=Tu;var Vg=Fg;var Wg={...ft,color:void 0,curveType:hr.MonotoneX,baseline:()=>0,opacity:1,cursor:null,line:!1,lineColor:void 0,lineWidth:2,lineDashArray:void 0,minHeight1Px:!1,minHeight:void 0,stackMinHeight:!1};var Au={};Lt(Au,{area:()=>ko,areaLinePath:()=>Da,globalStyles:()=>Uw,root:()=>Hg});var Hg=T`
182
182
  label: area-component;
183
- `,vw=lt`
183
+ `,Uw=ut`
184
184
  :root {
185
185
  --vis-area-cursor: default;
186
186
  --vis-area-fill-opacity: 1;
@@ -195,12 +195,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
195
195
  --vis-dark-area-stroke-color: none;
196
196
  }
197
197
 
198
- ${St} ${`.${$g}`} {
199
- --vis-area-fill-opacity: 0.5;
198
+ ${At} ${`.${Hg}`} {
200
199
  --vis-area-stroke-color: var(--vis-dark-area-stroke-color);
201
200
  }
202
201
 
203
- `,_o=C`
202
+ `,ko=T`
204
203
  label: area;
205
204
  cursor: var(--vis-area-cursor);
206
205
  fill-opacity: var(--vis-area-fill-opacity);
@@ -213,14 +212,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
213
212
  fill-opacity: var(--vis-area-hover-fill-opacity);
214
213
  stroke-width: var(--vis-area-hover-stroke-width);
215
214
  }
216
- `,_s=C`
215
+ `,Da=T`
217
216
  label: areaLinePath;
218
217
  fill: none;
219
218
  stroke-dasharray: var(--vis-line-stroke-dasharray);
220
219
  stroke-dashoffset: var(--vis-line-stroke-dashoffset);
221
- `;var Ig=class Bg extends ut{constructor(e){super(),this._defaultConfig=Lg,this.config=this._defaultConfig,this.stacked=!0,this.events={[Bg.selectors.area]:{}},this.setConfig(e),this.stacked=Array.isArray(this.config.y)}get bleed(){let{config:{line:e,lineWidth:n}}=this;if(!e)return{top:0,bottom:0,left:0,right:0};let r=this.yScale.domain(),o=(this.yScale.range()[0]>this.yScale.range()[1]?Lt.North:Lt.South)===Lt.South,a=n>3,s=n>=10;return{top:!s&&(!o&&r[1]===0||o&&r[0]===0)?0:n/2,bottom:!s&&(!o&&r[0]===0||o&&r[1]===0)?0:n/2,left:a?n/2:0,right:a?n/2:0}}_render(e){super._render(e);let{config:n,datamodel:{data:r}}=this,i=U(e)?e:n.duration,o={colorFn:this._colorFunction},a=ii[n.curveType];this._areaGen=Fc().x(m=>m.x).y0(m=>m.y0).y1(m=>m.y1).curve(a);let s=At(n.y)?n.y:[n.y],c=r.map((m,_)=>this.xScale(L(m,n.x,_))),l=ea(r,n.baseline,s,this._prevNegative);this._prevNegative=l.map(m=>!!m.isMostlyNegative);let u=this.yScale.range(),f=Math.min(u[0],u[1]),h=Math.max(u[0],u[1]),d=[],g=l.map(m=>m.map((_,w)=>{let k=c[w],A=it(this.yScale(_[0]),f,h),I=it(this.yScale(_[1]),f,h),O=I>A,N=n.stackMinHeight&&d[w]||0,M=O?A+N:A-N,E=O?I+N:I-N,B=0;return(n.minHeight||n.minHeight1Px)&&Math.abs(E-M)<(n.minHeight??1)&&(B=(n.minHeight??1)-Math.abs(E-M),n.stackMinHeight&&(d[w]=N+B)),{x:k,y0:M,y1:O?E+B:E-B}})),p=g.length-1,x=[...g].reverse(),y=this.g.selectAll(`.${_o}`).data(x),b=y.enter().append("path").attr("class",_o).attr("d",m=>this._areaGen(m)||this._emptyPath()).attr(dt,(m,_)=>p-_).style("opacity",0).style("fill",(m,_)=>H(r,n.color,p-_,n.colorKeys?.[p-_],o)).style("mask",(m,_)=>yt(ft(r,n.pattern,p-_))),v=R(b.merge(y),i).style("opacity",(m,_)=>m.some(k=>k.y0-k.y1!==0)?L(r,n.opacity,p-_):0).style("fill",(m,_)=>H(r,n.color,p-_,n.colorKeys?.[p-_],o)).style("mask",(m,_)=>yt(ft(r,n.pattern,p-_))).style("cursor",(m,_)=>G(r,n.cursor,p-_));i?v.attrTween("d",(_,w,k)=>{let A=W(k[w]).attr("d"),I=this._areaGen(_)||this._emptyPath();return bo(A,I)}):v.attr("d",m=>this._areaGen(m)||this._emptyPath()),R(y.exit(),i).style("opacity",0).remove(),this._renderLines(i,n.line?g:[])}_renderLines(e,n){let{config:r,datamodel:{data:i}}=this,o={colorFn:this._colorFunction},a=n.length-1,s=[...n].reverse(),c=r.lineColor??r.color,l=this.g.selectAll(`.${_s}`).data(s),u=this.g.selectAll(`.${_o}`).nodes(),f=y=>H(i,c,a-y,r.colorKeys?.[a-y],o),h=(y,b)=>Wr(ft(i,r.linePattern,a-y),f(y),b),d=y=>K(i,r.lineDashArray,y)?.join(" ")??h(y)?.dashArray??null,g=l.enter().insert("path",(y,b)=>u[b+1]).attr("class",_s).attr(dt,(y,b)=>a-b).attr("stroke",(y,b)=>f(b)).attr("stroke-width",r.lineWidth).attr("stroke-opacity",0).style("marker",function(y,b){return h(b,this)?.marker??null}),p=R(g.merge(l),e).attr("stroke",(y,b)=>f(b)).attr("stroke-width",r.lineWidth).attr("stroke-opacity",1).attr("cursor",(y,b)=>G(i,r.cursor,a-b)).style("marker",(y,b,v)=>h(b,v[b])?.marker??null).style("stroke-dasharray",(y,b)=>d(b)),x=ii[r.curveType];this._lineGen=sr().x(y=>y.x).y(y=>y.y1).curve(x),e?p.attrTween("d",(b,v,m)=>{let _=W(m[v]).attr("d")||this._emptyLinePath(),w=this._lineGen(b)||this._emptyLinePath();return bo(_,w)}):p.attr("d",y=>this._lineGen(y)||this._emptyLinePath()),R(l.exit(),e).style("opacity",0).remove()}getYDataExtent(e){let{config:n,datamodel:r}=this,i=At(n.y)?n.y:[n.y],o=this.xScale.domain(),a=e?na(r.data,o,n.x,!0):r.data;return ta(a,n.baseline,...i)}_emptyPath(){let e=this.xScale.range(),n=this.yScale.domain(),r=this.yScale((n[0]+n[1])/2),i=r;return this._areaGen([{y0:r,y1:i,x:e[0]},{y0:r,y1:i,x:e[1]}])}_emptyLinePath(){let e=this.xScale.range(),n=this.yScale.range();return`M${e[0]},${n[0]} L${e[1]},${n[0]}`}};Ig.selectors=pu;var Og=Ig;function ai({x:t,y:e,w:n,h:r,tl:i=!1,tr:o=!1,bl:a=!1,br:s=!1,r:c=0}){let l;l=`M${t+c},${e}h${n-2*c}`;let u=o?c:0,f=o?0:c;return l+=`a${u},${u} 0 0 1 ${u},${u}`,l+=`h${f}v${f}`,l+=`v${r-2*c}`,u=s?c:0,f=s?0:c,l+=`a${u},${u} 0 0 1 ${-u},${u}`,l+=`v${f}h${-f}`,l+=`h${2*c-n}`,u=a?c:0,f=a?0:c,l+=`a${u},${u} 0 0 1 ${-u},${-u}`,l+=`h${-f}v${-f}`,l+=`v${2*c-r}`,u=i?c:0,f=i?0:c,l+=`a${u},${u} 0 0 1 ${u},${-u}`,l+=`v${-f}h${f}`,l+="z",l}function Ng(t,e=8,n=6,r=5){if(t.length<2)return"";let i=0;for(let O=0;O<t.length-1;O++){let[N,M]=t[O],[E,B]=t[O+1];i+=Math.sqrt(Math.pow(E-N,2)+Math.pow(B-M,2))}if(i===0)return"";let o=e,a=n,s=e*2;if(i<s){let O=i/s;o*=O,a*=O}o=Math.min(o/2,i);let[c,l]=t[t.length-1],[u,f]=t[t.length-2],h=c-u,d=l-f,g=Math.sqrt(h*h+d*d),p=h/g,x=d/g,y=c-o*p,b=l-o*x,v=-x,m=p,_=y+a/2*v,w=b+a/2*m,k=y-a/2*v,A=b-a/2*m,I=[];if(t.length===2){let[O,N]=t[0],M=Math.min(r,g/3),E=O+p*M,B=N+x*M+m*M*.5,Q=y-p*M,F=b-x*M+m*M*.5;I.push(`M${O},${N}`),I.push(`C${E},${B} ${Q},${F} ${c},${l}`)}else{I.push(`M${t[0][0]},${t[0][1]}`);for(let O=0;O<t.length-2;O++){let[N,M]=t[O],[E,B]=t[O+1],[Q,F]=t[O+2],q=E-N,rt=B-M,st=Q-E,et=F-B,Vt=Math.sqrt(q*q+rt*rt),Ht=Math.sqrt(st*st+et*et),re=q/Vt,ie=rt/Vt,Dt=st/Ht,we=et/Ht,le=Math.min(Vt,Ht),S=Math.min(r,le/3),T=E-re*S,z=B-ie*S,V=E+Dt*S,D=B+we*S;I.push(`L${T},${z}`),I.push(`C${E},${B} ${E},${B} ${V},${D}`)}I.push(`L${c},${l}`)}return I.push(`M${_},${w} L${c},${l} L${k},${A}`),I.join(" ")}var Pg={...ct,color:void 0,pattern:void 0,groupMaxWidth:void 0,groupWidth:void 0,dataStep:void 0,groupPadding:.05,barPadding:0,roundedCorners:2,barMinHeight:2,cursor:null,orientation:ln.Vertical};var gu={};Rt(gu,{bar:()=>wo,barGroup:()=>ws,barGroupExit:()=>mu,globalStyles:()=>bw,root:()=>Fg});var Fg=C`
220
+ `;var Yg=class Gg extends ht{constructor(e){super(),this._defaultConfig=Wg,this.config=this._defaultConfig,this.stacked=!0,this.events={[Gg.selectors.area]:{}},this.setConfig(e),this.stacked=Array.isArray(this.config.y)}get bleed(){let{config:{line:e,lineWidth:n}}=this;if(!e)return{top:0,bottom:0,left:0,right:0};let r=this.yScale.domain(),o=(this.yScale.range()[0]>this.yScale.range()[1]?It.North:It.South)===It.South,s=n>3,a=n>=10;return{top:!a&&(!o&&r[1]===0||o&&r[0]===0)?0:n/2,bottom:!a&&(!o&&r[0]===0||o&&r[1]===0)?0:n/2,left:s?n/2:0,right:s?n/2:0}}_render(e){super._render(e);let{config:n,datamodel:{data:r}}=this,i=U(e)?e:n.duration,o={colorFn:this._colorFunction},s=ci[n.curveType];this._areaGen=Kc().x(m=>m.x).y0(m=>m.y0).y1(m=>m.y1).curve(s);let a=mt(n.y)?n.y:[n.y],c=r.map((m,_)=>this.xScale(I(m,n.x,_))),l=as(r,n.baseline,a,this._prevNegative);this._prevNegative=l.map(m=>!!m.isMostlyNegative);let u=this.yScale.range(),f=Math.min(u[0],u[1]),h=Math.max(u[0],u[1]),d=[],x=l.map(m=>m.map((_,w)=>{let k=c[w],M=tt(this.yScale(_[0]),f,h),N=tt(this.yScale(_[1]),f,h),P=N>M,F=n.stackMinHeight&&d[w]||0,R=P?M+F:M-F,$=P?N+F:N-F,B=0;return(n.minHeight||n.minHeight1Px)&&Math.abs($-R)<(n.minHeight??1)&&(B=(n.minHeight??1)-Math.abs($-R),n.stackMinHeight&&(d[w]=F+B)),{x:k,y0:R,y1:P?$+B:$-B}})),p=x.length-1,g=[...x].reverse(),v=this.g.selectAll(`.${ko}`).data(g),b=v.enter().append("path").attr("class",ko).attr("d",m=>this._areaGen(m)||this._emptyPath()).attr(gt,(m,_)=>p-_).style("opacity",0).style("fill",(m,_)=>X(r,n.color,p-_,n.colorKeys?.[p-_],o)).style("mask",(m,_)=>_t(dt(r,n.pattern,p-_))),y=D(b.merge(v),i).style("opacity",(m,_)=>m.some(k=>k.y0-k.y1!==0)?I(r,n.opacity,p-_):0).style("fill",(m,_)=>X(r,n.color,p-_,n.colorKeys?.[p-_],o)).style("mask",(m,_)=>_t(dt(r,n.pattern,p-_))).style("cursor",(m,_)=>q(r,n.cursor,p-_));i?y.attrTween("d",(_,w,k)=>{let M=Y(k[w]).attr("d"),N=this._areaGen(_)||this._emptyPath();return So(M,N)}):y.attr("d",m=>this._areaGen(m)||this._emptyPath()),D(v.exit(),i).style("opacity",0).remove(),this._renderLines(i,n.line?x:[])}_renderLines(e,n){let{config:r,datamodel:{data:i}}=this,o={colorFn:this._colorFunction},s=n.length-1,a=[...n].reverse(),c=r.lineColor??r.color,l=this.g.selectAll(`.${Da}`).data(a),u=this.g.selectAll(`.${ko}`).nodes(),f=v=>X(i,c,s-v,r.colorKeys?.[s-v],o),h=(v,b)=>Ur(dt(i,r.linePattern,s-v),f(v),b),d=v=>K(i,r.lineDashArray,v)?.join(" ")??h(v)?.dashArray??null,x=l.enter().insert("path",(v,b)=>u[b+1]).attr("class",Da).attr(gt,(v,b)=>s-b).attr("stroke",(v,b)=>f(b)).attr("stroke-width",r.lineWidth).attr("stroke-opacity",0).style("marker",function(v,b){return h(b,this)?.marker??null}),p=D(x.merge(l),e).attr("stroke",(v,b)=>f(b)).attr("stroke-width",r.lineWidth).attr("stroke-opacity",1).attr("cursor",(v,b)=>q(i,r.cursor,s-b)).style("marker",(v,b,y)=>h(b,y[b])?.marker??null).style("stroke-dasharray",(v,b)=>d(b)),g=ci[r.curveType];this._lineGen=fr().x(v=>v.x).y(v=>v.y1).curve(g),e?p.attrTween("d",(b,y,m)=>{let _=Y(m[y]).attr("d")||this._emptyLinePath(),w=this._lineGen(b)||this._emptyLinePath();return So(_,w)}):p.attr("d",v=>this._lineGen(v)||this._emptyLinePath()),D(l.exit(),e).style("opacity",0).remove()}getYDataExtent(e){let{config:n,datamodel:r}=this,i=mt(n.y)?n.y:[n.y],o=this.xScale.domain(),s=e?ls(r.data,o,n.x,!0):r.data;return ss(s,n.baseline,...i)}_emptyPath(){let e=this.xScale.range(),n=this.yScale.domain(),r=this.yScale((n[0]+n[1])/2),i=r;return this._areaGen([{y0:r,y1:i,x:e[0]},{y0:r,y1:i,x:e[1]}])}_emptyLinePath(){let e=this.xScale.range(),n=this.yScale.range();return`M${e[0]},${n[0]} L${e[1]},${n[0]}`}};Yg.selectors=Au;var Ug=Yg;function fi({x:t,y:e,w:n,h:r,tl:i=!1,tr:o=!1,bl:s=!1,br:a=!1,r:c=0}){let l;l=`M${t+c},${e}h${n-2*c}`;let u=o?c:0,f=o?0:c;return l+=`a${u},${u} 0 0 1 ${u},${u}`,l+=`h${f}v${f}`,l+=`v${r-2*c}`,u=a?c:0,f=a?0:c,l+=`a${u},${u} 0 0 1 ${-u},${u}`,l+=`v${f}h${-f}`,l+=`h${2*c-n}`,u=s?c:0,f=s?0:c,l+=`a${u},${u} 0 0 1 ${-u},${-u}`,l+=`h${-f}v${-f}`,l+=`v${2*c-r}`,u=i?c:0,f=i?0:c,l+=`a${u},${u} 0 0 1 ${u},${-u}`,l+=`v${-f}h${f}`,l+="z",l}function Xg(t,e=8,n=6,r=5){if(t.length<2)return"";let i=0;for(let P=0;P<t.length-1;P++){let[F,R]=t[P],[$,B]=t[P+1];i+=Math.sqrt(Math.pow($-F,2)+Math.pow(B-R,2))}if(i===0)return"";let o=e,s=n,a=e*2;if(i<a){let P=i/a;o*=P,s*=P}o=Math.min(o/2,i);let[c,l]=t[t.length-1],[u,f]=t[t.length-2],h=c-u,d=l-f,x=Math.sqrt(h*h+d*d),p=h/x,g=d/x,v=c-o*p,b=l-o*g,y=-g,m=p,_=v+s/2*y,w=b+s/2*m,k=v-s/2*y,M=b-s/2*m,N=[];if(t.length===2){let[P,F]=t[0],R=Math.min(r,x/3),$=P+p*R,B=F+g*R+m*R*.5,et=v-p*R,V=b-g*R+m*R*.5;N.push(`M${P},${F}`),N.push(`C${$},${B} ${et},${V} ${c},${l}`)}else{N.push(`M${t[0][0]},${t[0][1]}`);for(let P=0;P<t.length-2;P++){let[F,R]=t[P],[$,B]=t[P+1],[et,V]=t[P+2],Z=$-F,st=B-R,ct=et-$,it=V-B,Ht=Math.sqrt(Z*Z+st*st),Gt=Math.sqrt(ct*ct+it*it),ie=Z/Ht,oe=st/Ht,Et=ct/Gt,Se=it/Gt,ce=Math.min(Ht,Gt),S=Math.min(r,ce/3),A=$-ie*S,W=B-oe*S,H=$+Et*S,E=B+Se*S;N.push(`L${A},${W}`),N.push(`C${$},${B} ${$},${B} ${H},${E}`)}N.push(`L${c},${l}`)}return N.push(`M${_},${w} L${c},${l} L${k},${M}`),N.join(" ")}var qg={...ft,color:void 0,pattern:void 0,barStyle:void 0,groupMaxWidth:void 0,groupWidth:void 0,dataStep:void 0,groupPadding:.05,barPadding:0,roundedCorners:2,barMinHeight:2,cursor:null,orientation:cn.Vertical};var jg=new Set(["fill","cursor","mask"]);var Mu={};Lt(Mu,{bar:()=>To,barGroup:()=>$a,barGroupExit:()=>Cu,globalStyles:()=>Xw,root:()=>Zg});var Zg=T`
222
221
  label: grouped-bar-component;
223
- `,bw=lt`
222
+ `,Xw=ut`
224
223
  :root {
225
224
  --vis-grouped-bar-cursor: default;
226
225
  --vis-grouped-bar-fill-color: var(--vis-color-main);
@@ -234,10 +233,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
234
233
  --vis-dark-grouped-bar-stroke-color: none;
235
234
  }
236
235
 
237
- ${St} ${`.${Fg}`} {
236
+ ${At} ${`.${Zg}`} {
238
237
  --vis-grouped-bar-stroke-color: var(--vis-dark-grouped-bar-stroke-color);
239
238
  }
240
- `,wo=C`
239
+ `,To=T`
241
240
  label: bar;
242
241
  fill: var(--vis-grouped-bar-fill-color);
243
242
  stroke: var(--vis-grouped-bar-stroke-color);
@@ -248,13 +247,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
248
247
  stroke-width: var(--vis-grouped-bar-hover-stroke-width);
249
248
  stroke: var(--vis-grouped-bar-hover-stroke-color);
250
249
  }
251
- `,ws=C`
250
+ `,$a=T`
252
251
  label: barGroup;
253
- `,mu=C`
252
+ `,Cu=T`
254
253
  label: barGroupExit;
255
- `;var zg=class extends ut{constructor(e){super(),this._defaultConfig=Pg,this.config=this._defaultConfig,this.getAccessors=()=>At(this.config.y)?this.config.y:[this.config.y],this.events={},this._barData=[],this.setConfig(e)}get bleed(){if(this._barData=this._getVisibleData(),this._barData.length===0)return{top:0,bottom:0,left:0,right:0};let e=!this.isVertical()&&this.dataScale.range()[0]>this.dataScale.range()[1],n=this.dataScale.domain(),r=this._getGroupWidth()/2,i=this._barData.map((d,g)=>L(d,this.config.x,g)),o=wt(i),a=pt(i),s=this.dataScale(o),c=this.dataScale(a),l=this.dataScale.invert(s+(e?r:-r)),u=this.dataScale.invert(c+(e?-r:r)),f=l<=n[0]?this.dataScale(n[0])-this.dataScale(l):0,h=u>n[1]?this.dataScale(u)-this.dataScale(n[1]):0;return{top:this.isVertical()?0:e?-h:f,bottom:this.isVertical()?0:e?-f:h,left:this.isVertical()?f:0,right:this.isVertical()?h:0}}get dataScale(){return this.isVertical()?this.xScale:this.yScale}get valueScale(){return this.isVertical()?this.yScale:this.xScale}isVertical(){return this.config.orientation===ln.Vertical}_render(e){let{config:n}=this,r=U(e)?e:n.duration,i={colorFn:this._colorFunction},o=this._getGroupWidth(),a=this.getAccessors(),s=[-o/2,o/2],c=yn().domain(wr(a.length)).range(s).paddingInner(n.barPadding).paddingOuter(n.barPadding),l=this.g.selectAll(`.${ws}`).data(this._barData,(v,m)=>`${G(v,n.id,m)??m}`),u=(v,m)=>{let _=this.dataScale(L(v,n.x,m)),w=this.isVertical()?_:0,k=this.isVertical()?0:_;return`translate(${w},${k})`},h=l.enter().append("g").attr("class",ws).attr("transform",u).style("opacity",1).merge(l);R(h,r).attr("transform",u).style("opacity",1);let d=l.exit().attr("class",mu);R(d,r).style("opacity",0).remove(),R(d.selectAll(`.${wo}`),r).attr("transform",(v,m,_)=>this.isVertical()?`translate(0,${this.yScale(0)}) scale(1,0)`:`translate(${this.xScale(0)},0) scale(0,1)`);let g=c.bandwidth(),p=h.selectAll(`.${wo}`).data(v=>a.map(()=>v)),x=this._getValueAxisDirection(),b=p.enter().append("path").attr("class",wo).attr("d",(v,m)=>{let _=c(m),w=this.valueScale(0),k=g;return this._getBarPath(_,w,k,0,!1,x)}).attr(dt,(v,m)=>m).style("fill",(v,m)=>H(v,n.color,m,n.colorKeys?.[m],i)).style("mask",(v,m)=>yt(ft(v,n.pattern,m))).merge(p);b.style("mask",(v,m)=>yt(ft(v,n.pattern,m))),R(b,r).attr("d",(v,m)=>{let _=c(m),w=g,k=L(v,a[m]),A=k<0,I=A?this.valueScale(0):this.valueScale(k||0),O=Math.abs(this.valueScale(0)-this.valueScale(k))||0;if(O<n.barMinHeight){let N=x===Lt.North?-1:1;I=this.valueScale(0)+N*n.barMinHeight,O=n.barMinHeight}return this._getBarPath(_,I,w,O,A,x)}).style("fill",(v,m)=>H(v,n.color,m,n.colorKeys?.[m],i)).style("cursor",(v,m)=>G(v,n.cursor,m)),R(p.exit(),r).remove()}_getValueAxisDirection(){return this.valueScale.range()[0]>this.valueScale.range()[1]?Lt.North:Lt.South}_getVisibleData(){let{config:e,datamodel:{data:n}}=this,r=this._getGroupWidth(),i=n.length<2?0:r/2,o=this.dataScale,a=Math.abs(o.invert(i)-o.invert(0));return n?.filter((c,l)=>{let u=L(c,e.x,l),f=o.domain(),h=+f[0],d=+f[1];return u>=h-a&&u<=d+a})}_getBarPath(e,n,r,i,o,a){let{config:s}=this,c=s.roundedCorners?U(s.roundedCorners)?+s.roundedCorners:r/2:0,l=it(c,0,Math.min(i,r)/2),u=a===Lt.North,f=this.isVertical()&&o!==u,h=this.isVertical()&&o===u,d=!this.isVertical()&&o,g=!this.isVertical()&&!o;return ai({x:this.isVertical()?e:n+(u?0:-i),y:this.isVertical()?n+(u?0:-i):e,w:this.isVertical()?r:i,h:this.isVertical()?i:r,tl:f||d,tr:f||g,bl:h||d,br:h||g,r:l})}_getGroupWidth(){let{config:e,datamodel:{data:n}}=this;if(On(n))return 0;if(e.groupWidth)return wt([e.groupWidth,e.groupMaxWidth]);let r=this.dataScale.bandwidth,i=this.dataScale.domain?this.dataScale.domain():[],a=1+(r?i.length:i[1]-i[0])/e.dataStep||!r&&n.filter((l,u)=>{let f=L(l,e.x,u);return f>=i[0]&&f<=i[1]}).length||n.length;!r&&a>=2&&(a+=1);let c=(a<2?1:1-e.groupPadding)*(this.isVertical()?this._width:this._height)/a;return wt([c,e.groupMaxWidth])}getValueScaleExtent(e){let{datamodel:n}=this,r=this.getAccessors(),i=e?this._getVisibleData():n.data,o=Nn(i,...r),a=Pn(i,...r);return[o>0?0:o,a<0?0:a]}getDataScaleExtent(){let{config:e,datamodel:n}=this;return ue(n.data,e.x)}getYDataExtent(e){return this.isVertical()?this.getValueScaleExtent(e):this.getDataScaleExtent()}getXDataExtent(){return this.isVertical()?this.getDataScaleExtent():this.getValueScaleExtent(!1)}};zg.selectors=gu;var Vg=zg;var Wg={...ct,color:void 0,pattern:void 0,baseline:void 0,barMaxWidth:void 0,barWidth:void 0,dataStep:void 0,barPadding:0,roundedCorners:2,cursor:null,barMinHeight1Px:!1,barMinHeightZeroValue:null,orientation:ln.Vertical};var yu={};Rt(yu,{bar:()=>So,barGroup:()=>Ss,barGroupExit:()=>xu,globalStyles:()=>_w,root:()=>Hg});var Hg=C`
254
+ `;var Kg=class extends ht{constructor(e){super(),this._defaultConfig=qg,this.config=this._defaultConfig,this.getAccessors=()=>mt(this.config.y)?this.config.y:[this.config.y],this.events={},this._barData=[],this.setConfig(e)}get bleed(){if(this._barData=this._getVisibleData(),this._barData.length===0)return{top:0,bottom:0,left:0,right:0};let e=!this.isVertical()&&this.dataScale.range()[0]>this.dataScale.range()[1],n=this.dataScale.domain(),r=this._getGroupWidth()/2,i=this._barData.map((d,x)=>I(d,this.config.x,x)),o=Tt(i),s=xt(i),a=this.dataScale(o),c=this.dataScale(s),l=this.dataScale.invert(a+(e?r:-r)),u=this.dataScale.invert(c+(e?-r:r)),f=l<=n[0]?this.dataScale(n[0])-this.dataScale(l):0,h=u>n[1]?this.dataScale(u)-this.dataScale(n[1]):0;return{top:this.isVertical()?0:e?-h:f,bottom:this.isVertical()?0:e?-f:h,left:this.isVertical()?f:0,right:this.isVertical()?h:0}}get dataScale(){return this.isVertical()?this.xScale:this.yScale}get valueScale(){return this.isVertical()?this.yScale:this.xScale}isVertical(){return this.config.orientation===cn.Vertical}_render(e){let{config:n}=this,r=U(e)?e:n.duration,i={colorFn:this._colorFunction},o=this._getGroupWidth(),s=this.getAccessors(),a=[-o/2,o/2],c=vn().domain(Ar(s.length)).range(a).paddingInner(n.barPadding).paddingOuter(n.barPadding),l=this.g.selectAll(`.${$a}`).data(this._barData,(y,m)=>`${q(y,n.id,m)??m}`),u=(y,m)=>{let _=this.dataScale(I(y,n.x,m)),w=this.isVertical()?_:0,k=this.isVertical()?0:_;return`translate(${w},${k})`},h=l.enter().append("g").attr("class",$a).attr("transform",u).style("opacity",1).merge(l);D(h,r).attr("transform",u).style("opacity",1);let d=l.exit().attr("class",Cu);D(d,r).style("opacity",0).remove().on("interrupt",function(){this.remove()}),D(d.selectAll(`.${To}`),r).attr("transform",(y,m,_)=>this.isVertical()?`translate(0,${this.yScale(0)}) scale(1,0)`:`translate(${this.xScale(0)},0) scale(0,1)`);let x=c.bandwidth(),p=h.selectAll(`.${To}`).data(y=>s.map(()=>y)),g=this._getValueAxisDirection(),b=p.enter().append("path").attr("class",To).attr("d",(y,m)=>{let _=c(m),w=this.valueScale(0),k=x;return this._getBarPath(_,w,k,0,!1,g)}).attr(gt,(y,m)=>m).style("fill",(y,m)=>this._getBarStyle(y,m)?.fill??X(y,n.color,m,n.colorKeys?.[m],i)).style("mask",(y,m)=>this._getBarStyle(y,m)?.mask??_t(dt(y,n.pattern,m))).merge(p);b.style("mask",(y,m)=>this._getBarStyle(y,m)?.mask??_t(dt(y,n.pattern,m))),la(b,(y,m)=>this._getBarStyle(y,m),jg),D(b,r).attr("d",(y,m)=>{let _=c(m),w=x,k=I(y,s[m]),M=k<0,N=M?this.valueScale(0):this.valueScale(k||0),P=Math.abs(this.valueScale(0)-this.valueScale(k))||0;if(P<n.barMinHeight){let F=g===It.North?-1:1;N=this.valueScale(0)+F*n.barMinHeight,P=n.barMinHeight}return this._getBarPath(_,N,w,P,M,g)}).style("fill",(y,m)=>this._getBarStyle(y,m)?.fill??X(y,n.color,m,n.colorKeys?.[m],i)).style("cursor",(y,m)=>this._getBarStyle(y,m)?.cursor??q(y,n.cursor,m)),D(p.exit(),r).remove()}_getBarStyle(e,n){return K(e,this.config.barStyle,n)}_getValueAxisDirection(){return this.valueScale.range()[0]>this.valueScale.range()[1]?It.North:It.South}_getVisibleData(){let{config:e,datamodel:{data:n}}=this,r=this._getGroupWidth(),i=n.length<2?0:r/2,o=this.dataScale,s=Math.abs(o.invert(i)-o.invert(0));return n?.filter((c,l)=>{let u=I(c,e.x,l),f=o.domain(),h=+f[0],d=+f[1];return u>=h-s&&u<=d+s})}_getBarPath(e,n,r,i,o,s){let{config:a}=this,c=a.roundedCorners?U(a.roundedCorners)?+a.roundedCorners:r/2:0,l=tt(c,0,Math.min(i,r)/2),u=s===It.North,f=this.isVertical()&&o!==u,h=this.isVertical()&&o===u,d=!this.isVertical()&&o,x=!this.isVertical()&&!o;return fi({x:this.isVertical()?e:n+(u?0:-i),y:this.isVertical()?n+(u?0:-i):e,w:this.isVertical()?r:i,h:this.isVertical()?i:r,tl:f||d,tr:f||x,bl:h||d,br:h||x,r:l})}_getGroupWidth(){let{config:e,datamodel:{data:n}}=this;if(Pn(n))return 0;if(e.groupWidth)return Tt([e.groupWidth,e.groupMaxWidth]);let r=this.dataScale.bandwidth,i=this.dataScale.domain?this.dataScale.domain():[],s=1+(r?i.length:i[1]-i[0])/e.dataStep||!r&&n.filter((l,u)=>{let f=I(l,e.x,u);return f>=i[0]&&f<=i[1]}).length||n.length;!r&&s>=2&&(s+=1);let c=(s<2?1:1-e.groupPadding)*(this.isVertical()?this._width:this._height)/s;return Tt([c,e.groupMaxWidth])}getValueScaleExtent(e){let{datamodel:n}=this,r=this.getAccessors(),i=e?this._getVisibleData():n.data,o=Fn(i,...r),s=zn(i,...r);return[o>0?0:o,s<0?0:s]}getDataScaleExtent(){let{config:e,datamodel:n}=this;return fe(n.data,e.x)}getYDataExtent(e){return this.isVertical()?this.getValueScaleExtent(e):this.getDataScaleExtent()}getXDataExtent(){return this.isVertical()?this.getDataScaleExtent():this.getValueScaleExtent(!1)}};Kg.selectors=Mu;var Qg=Kg;var Jg={...ft,color:void 0,pattern:void 0,barStyle:void 0,baseline:void 0,barMaxWidth:void 0,barWidth:void 0,dataStep:void 0,barPadding:0,roundedCorners:2,cursor:null,barMinHeight1Px:!1,barMinHeightZeroValue:null,orientation:cn.Vertical};var tx=new Set(["fill","opacity","cursor","mask"]);var Ru={};Lt(Ru,{bar:()=>Ao,barGroup:()=>Ia,barGroupExit:()=>Lu,globalStyles:()=>qw,root:()=>ex});var ex=T`
256
255
  label: stacked-bar-component;
257
- `,_w=lt`
256
+ `,qw=ut`
258
257
  :root {
259
258
  --vis-stacked-bar-cursor: default;
260
259
  --vis-stacked-bar-fill-color: var(--vis-color-main);
@@ -267,10 +266,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
267
266
  --vis-dark-stacked-bar-stroke-color: none;
268
267
  }
269
268
 
270
- ${St} ${`.${Hg}`} {
269
+ ${At} ${`.${ex}`} {
271
270
  --vis-stacked-bar-stroke-color: var(--vis-dark-stacked-bar-stroke-color);
272
271
  }
273
- `,So=C`
272
+ `,Ao=T`
274
273
  label: bar;
275
274
  fill: var(--vis-stacked-bar-fill-color);
276
275
  stroke: var(--vis-stacked-bar-stroke-color);
@@ -281,11 +280,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
281
280
  stroke-width: var(--vis-stacked-bar-hover-stroke-width);
282
281
  stroke: var(--vis-stacked-bar-hover-stroke-color);
283
282
  }
284
- `,Ss=C`
283
+ `,Ia=T`
285
284
  label: barGroup;
286
- `,xu=C`
285
+ `,Lu=T`
287
286
  label: barGroupExit;
288
- `;var Yg=class extends ut{constructor(e){super(),this._defaultConfig=Wg,this.config=this._defaultConfig,this.getAccessors=()=>At(this.config.y)?this.config.y:[this.config.y],this.stacked=!0,this.events={},this._barData=[],this.setConfig(e)}get bleed(){if(this._barData=this._getVisibleData(),this._barData.length===0)return{top:0,bottom:0,left:0,right:0};let e=!this.isVertical()&&this.dataScale.range()[0]>this.dataScale.range()[1],n=this.dataScale.domain(),r=this._getBarWidth()/2,i=this._barData.map((d,g)=>L(d,this.config.x,g)),o=wt(i),a=pt(i),s=this.dataScale(o),c=this.dataScale(a),l=this.dataScale.invert(s+(e?r:-r)),u=this.dataScale.invert(c+(e?-r:r)),f=l<=n[0]?this.dataScale(n[0])-this.dataScale(l):0,h=u>n[1]?this.dataScale(u)-this.dataScale(n[1]):0;return{top:this.isVertical()?0:e?-h:f,bottom:this.isVertical()?0:e?-f:h,left:this.isVertical()?f:0,right:this.isVertical()?h:0}}get dataScale(){return this.isVertical()?this.xScale:this.yScale}get valueScale(){return this.isVertical()?this.yScale:this.xScale}isVertical(){return this.config.orientation===ln.Vertical}_render(e){let{config:n}=this,r=U(e)?e:n.duration,i={colorFn:this._colorFunction},o=this.getAccessors(),a=ea(this._barData,n.baseline,o,this._prevNegative);this._prevNegative=a.map(p=>!!p.isMostlyNegative);let s=this.g.selectAll(`.${Ss}`).data(this._barData,(p,x)=>`${G(p,n.id,x)??x}`),c=(p,x)=>{let y=this.dataScale(L(p,n.x,x)),b=this.isVertical()?y:0,v=this.isVertical()?0:y;return`translate(${b},${v})`},u=s.enter().append("g").attr("class",Ss).attr("transform",c).style("opacity",1).merge(s);R(u,r).attr("transform",c).style("opacity",1);let f=s.exit().attr("class",xu);R(f,r).style("opacity",0).remove().on("interrupt",function(){this.remove()}),R(f.selectAll(`.${So}`),r).attr("transform",this.isVertical()?`translate(0,${this._height/3})`:`translate(${this._width/6},0)`);let h=u.selectAll(`.${So}`).data((p,x)=>{let y=a.map((b,v)=>({datum:p,index:x,stacked:b[x],stackIndex:v})).filter(b=>{if(b.stacked[0]!==b.stacked[1])return!0;if(!n.barMinHeight1Px)return!1;let v=L(b.datum,o[b.stackIndex],b.index);return isFinite(v)&&v!==n.barMinHeightZeroValue});return y.forEach((b,v)=>{b.isEnding=v===y.length-1||v<=y.length-1&&y[v+1].stacked[0]!==b.stacked[1],b.isStarting=!y.some(m=>m!==b&&m.stacked[1]===b.stacked[0])}),y},p=>p.stackIndex),g=h.enter().append("path").attr("class",So).attr("d",p=>this._getBarPath(p,!0)).attr(dt,p=>p.stackIndex).style("fill",p=>H(p.datum,n.color,p.stackIndex,n.colorKeys?.[p.stackIndex],i)).style("mask",p=>yt(ft(p.datum,n.pattern,p.stackIndex))).merge(h);g.style("mask",p=>yt(ft(p.datum,n.pattern,p.stackIndex))),R(g,r).attr("d",p=>this._getBarPath(p)).style("fill",p=>H(p.datum,n.color,p.stackIndex,n.colorKeys?.[p.stackIndex],i)).style("cursor",p=>G(p.datum,n.cursor,p.stackIndex)),R(h.exit(),r).style("opacity",0).remove().on("interrupt",function(){this.remove()})}_getBarWidth(){let{config:e,datamodel:{data:n}}=this;if(On(n))return 0;if(e.barWidth)return wt([e.barWidth,e.barMaxWidth]);let r=this.dataScale.bandwidth,i=this.dataScale.domain?this.dataScale.domain():[],a=1+(r?i.length:i[1]-i[0])/e.dataStep||!r&&n.filter((l,u)=>{let f=L(l,e.x,u);return f>=i[0]&&f<=i[1]}).length||n.length;!r&&a>=2&&(a+=1);let c=(a<2?1:1-e.barPadding)*(this.isVertical()?this._width:this._height)/a;return wt([c,e.barMaxWidth])}_getVisibleData(){let{config:e,datamodel:{data:n}}=this,r=this._getBarWidth(),i=n.length<2?0:r/2,o=this.dataScale,a=Math.abs(o.invert(i)-o.invert(0));return n?.filter((c,l)=>{let u=L(c,e.x,l),f=o.domain(),h=+f[0],d=+f[1];return u>=h-a&&u<=d+a})}_getBarPath(e,n=!1){let{config:r}=this,i=this.getAccessors(),o=this._getBarWidth(),a=e.stacked[1]<e.stacked[0],s=e.isEnding,c=L(e.datum,i[e.stackIndex],e.index),l=n?0:Math.abs(this.valueScale(e.stacked[0])-this.valueScale(e.stacked[1])),u=!n&&r.barMinHeight1Px&&l<1&&isFinite(c)&&c!==r.barMinHeightZeroValue?1:l,f=n?this.valueScale(e.stacked[0]):this.valueScale(a?e.stacked[0]:e.stacked[1])-(l<1&&r.barMinHeight1Px?1:0),h=-o/2,d=o,g=r.roundedCorners?U(r.roundedCorners)?+r.roundedCorners:d/2:0,p=it(g,0,Math.min(l,d)/2),x=this.yScale.range()[0]>this.yScale.range()[1],y=s,b=e.isStarting&&e.stacked[0]!==0,v=!a&&x||a&&!x,m=a;return ai({x:this.isVertical()?h:f-u,y:this.isVertical()?f+(x?0:-u):h,w:this.isVertical()?d:u,h:this.isVertical()?u:d,tl:this.isVertical()?v?y:b:m?y:b,tr:this.isVertical()?v?y:b:m?b:y,br:this.isVertical()?v?b:y:m?b:y,bl:this.isVertical()?v?b:y:m?y:b,r:p})}_mapEventDatum(e){return{datum:{...e,...e.datum},index:e.index}}getValueScaleExtent(e){let{config:n,datamodel:r}=this,i=this.getAccessors(),o=e?this._getVisibleData():r.data;return ta(o,n.baseline,...i)}getDataScaleExtent(){let{config:e,datamodel:n}=this;return ue(n.data,e.x)}getYDataExtent(e){return this.isVertical()?this.getValueScaleExtent(e):this.getDataScaleExtent()}getXDataExtent(){return this.isVertical()?this.getDataScaleExtent():this.getValueScaleExtent(!1)}};Yg.selectors=yu;var Gg=Yg;var ko=(t=>(t.Circle="circle",t.Cross="cross",t.Diamond="diamond",t.Square="square",t.Star="star",t.Triangle="triangle",t.Wye="wye",t))(ko||{}),ks={circle:go,cross:zc,diamond:Vc,square:Wc,star:Hc,triangle:Gc,wye:Xc};var Ug={...ct,color:t=>t.color,pattern:void 0,size:10,sizeScale:to.scaleSqrt(),sizeRange:void 0,shape:ko.Circle,label:void 0,labelColor:void 0,labelPosition:$.Bottom,labelHideOverlapping:!0,cursor:null,labelTextBrightnessRatio:.65,strokeColor:void 0,strokeWidth:void 0};function Xg(t){return t!==$.Top&&t!==$.Bottom&&t!==$.Left&&t!==$.Right}function vu(t,e){return e?.7*t/Math.pow(e,.5):0}function bu(t,e,n=5){switch(t){case $.Top:return[0,-e/2-n];case $.Bottom:return[0,e/2+n];case $.Left:return[-e/2-n,0];case $.Right:return[e/2+n,0];default:return[0,0]}}function Cs(t,e,n,r,i){let o=n(t._point.xValue),a=r(t._point.yValue),s=t._point.sizePx,c=t._point.label??"",l=c.length,u=vu(s,l),f=cn(c,Xg(e)?u:i,.6),h=i,d=bu(e,s),g=e===$.Left?-f:e===$.Right?0:-f/2,p=e===$.Top?-h:e===$.Bottom?0:-h/2;return{x:o+d[0]+g,y:a+d[1]+p,width:f,height:h}}function qg(t,e,n,r){t.each((i,o,a)=>{let s=a[o];s._labelVisible=!0}),t.each((i,o,a)=>{let s=a[o],c=K(i,e.labelPosition,i._point.pointIndex);if(!s._labelVisible||Xg(c))return;let l=W(s).select("text"),u=kc(l.node()),f=Cs(i,c,n,r,u);for(let h=0;h<a.length;h+=1){if(o===h)continue;let d=a[h],g=W(d),p=g.select("text"),x=g.datum(),y=[n(x._point.xValue),r(x._point.yValue)],b=x._point.sizePx/2,v={x:y[0]-b,y:y[1]-b,width:2*b,height:2*b},m=Je(f,v,2),_=d._labelVisible;if(!m&&_){let w=kc(p.node()),k=K(x,e.labelPosition,x._point.pointIndex),A=Cs(x,k,n,r,w);m=Je(f,A,.25)}if(m)if(s._forceShowLabel)d._labelVisible=!1;else{s._labelVisible=!1;break}}}),t.each((i,o,a)=>{let s=a[o];W(s).select("text").attr("opacity",s._labelVisible?1:0)})}function Zg(t,e,n){t.attr("transform",r=>`translate(${r._point.xValue},${r._point.yValue})`),t.append("path").attr(dt,r=>r._point.groupIndex).style("fill",r=>r._point.color).style("mask",r=>r._point.mask),t.append("text").style("pointer-events","none"),t.attr("transform",r=>`translate(${e(r._point.xValue)},${n(r._point.yValue)}) scale(0)`)}function jg(t,e,n,r,i){let o=ti();t.each((a,s,c)=>{let l=W(c[s]),u=l.select("text"),f=l.select("path"),h=a._point.sizePx,d=a._point.color,g=a._point.strokeColor??null,p=a._point.strokeWidthPx??null;f.attr("d",()=>a._point.shape?o.size(Math.PI*h*h/4).type(ks[a._point.shape])():null),R(f,i).style("fill",d).style("mask",a._point.mask).style("stroke",g).style("stroke-width",`${p}px`);let x=a._point.labelPosition,y=x!==$.Top&&x!==$.Bottom&&x!==$.Left&&x!==$.Right,b=a._point.label??"",v=b.length,m=vu(h,v),_=a._point.labelColor;if(!_&&y){let k=d||"var(--vis-scatter-fill-color)",A=gt(Tr(k)?Qe(k,l.node()):k)?.hex();_=Sa(A)>e.labelTextBrightnessRatio?"var(--vis-scatter-point-label-text-color-dark)":"var(--vis-scatter-point-label-text-color-light)"}let w=bu(x,h);u.html(b).attr("x",w[0]).attr("y",w[1]).style("font-size",y?m:null).style("text-anchor",()=>{switch(x){case $.Right:return null;case $.Left:return"end";default:return"middle"}}).style("dominant-baseline",()=>{switch(x){case $.Top:return null;case $.Bottom:return"hanging";default:return"central"}}),R(u,i).style("fill",_),f.style("cursor",a._point.cursor)}),R(t,i).attr("transform",a=>`translate(${n(a._point.xValue)},${r(a._point.yValue)}) scale(1)`)}function Kg(t,e,n,r){R(t,r).attr("transform",i=>`translate(${e(i._point.xValue)},${n(i._point.yValue)}) scale(0)`).remove()}var wu={};Rt(wu,{globalStyles:()=>ww,point:()=>As,pointGroup:()=>Ts,pointGroupExit:()=>_u,root:()=>Sw});var ww=lt`
287
+ `;var nx=class extends ht{constructor(e){super(),this._defaultConfig=Jg,this.config=this._defaultConfig,this.getAccessors=()=>mt(this.config.y)?this.config.y:[this.config.y],this.stacked=!0,this.events={},this._barData=[],this.setConfig(e)}get bleed(){if(this._barData=this._getVisibleData(),this._barData.length===0)return{top:0,bottom:0,left:0,right:0};let e=!this.isVertical()&&this.dataScale.range()[0]>this.dataScale.range()[1],n=this.dataScale.domain(),r=this._getBarWidth()/2,i=this._barData.map((d,x)=>I(d,this.config.x,x)),o=Tt(i),s=xt(i),a=this.dataScale(o),c=this.dataScale(s),l=this.dataScale.invert(a+(e?r:-r)),u=this.dataScale.invert(c+(e?-r:r)),f=l<=n[0]?this.dataScale(n[0])-this.dataScale(l):0,h=u>n[1]?this.dataScale(u)-this.dataScale(n[1]):0;return{top:this.isVertical()?0:e?-h:f,bottom:this.isVertical()?0:e?-f:h,left:this.isVertical()?f:0,right:this.isVertical()?h:0}}get dataScale(){return this.isVertical()?this.xScale:this.yScale}get valueScale(){return this.isVertical()?this.yScale:this.xScale}isVertical(){return this.config.orientation===cn.Vertical}_render(e){let{config:n}=this,r=U(e)?e:n.duration,i={colorFn:this._colorFunction},o=this.getAccessors(),s=as(this._barData,n.baseline,o,this._prevNegative);this._prevNegative=s.map(g=>!!g.isMostlyNegative);let a=this.g.selectAll(`.${Ia}`).data(this._barData,(g,v)=>`${q(g,n.id,v)??v}`),c=(g,v)=>{let b=this.dataScale(I(g,n.x,v)),y=this.isVertical()?b:0,m=this.isVertical()?0:b;return`translate(${y},${m})`},l=a.enter().append("g").attr("class",Ia).attr("transform",c).style("opacity",1),u=l.merge(a);D(u,r).attr("transform",c).style("opacity",1);let f=a.exit().attr("class",Lu);D(f,r).style("opacity",0).remove().on("interrupt",function(){this.remove()}),D(f.selectAll(`.${Ao}`),r).attr("transform",this.isVertical()?`translate(0,${this._height/3})`:`translate(${this._width/6},0)`);let h=u.selectAll(`.${Ao}`).data((g,v)=>{let b=s.map((y,m)=>({datum:g,index:v,stacked:y[v],stackIndex:m})).filter(y=>{if(y.stacked[0]!==y.stacked[1])return!0;if(!n.barMinHeight1Px)return!1;let m=I(y.datum,o[y.stackIndex],y.index);return isFinite(m)&&m!==n.barMinHeightZeroValue});return b.forEach((y,m)=>{y.isEnding=m===b.length-1||m<=b.length-1&&b[m+1].stacked[0]!==y.stacked[1],y.isStarting=!b.some(_=>_!==y&&_.stacked[1]===y.stacked[0])}),b},g=>g.stackIndex),d=new Set(l.nodes()),p=h.enter().append("path").attr("class",Ao).attr("d",(g,v,b)=>this._getBarPath(g,!0,d.has(b[v].parentNode))).attr(gt,g=>g.stackIndex).style("fill",g=>this._getBarStyle(g)?.fill??X(g.datum,n.color,g.stackIndex,n.colorKeys?.[g.stackIndex],i)).style("mask",g=>this._getBarStyle(g)?.mask??_t(dt(g.datum,n.pattern,g.stackIndex))).merge(h);p.style("mask",g=>this._getBarStyle(g)?.mask??_t(dt(g.datum,n.pattern,g.stackIndex))),la(p,g=>this._getBarStyle(g),tx),D(p,r).attr("d",g=>this._getBarPath(g)).style("opacity",g=>this._getBarStyle(g)?.opacity??1).style("fill",g=>this._getBarStyle(g)?.fill??X(g.datum,n.color,g.stackIndex,n.colorKeys?.[g.stackIndex],i)).style("cursor",g=>this._getBarStyle(g)?.cursor??q(g.datum,n.cursor,g.stackIndex)),D(h.exit(),r).style("opacity",0).remove()}_getBarWidth(){let{config:e,datamodel:{data:n}}=this;if(Pn(n))return 0;if(e.barWidth)return Tt([e.barWidth,e.barMaxWidth]);let r=this.dataScale.bandwidth,i=this.dataScale.domain?this.dataScale.domain():[],s=1+(r?i.length:i[1]-i[0])/e.dataStep||!r&&n.filter((l,u)=>{let f=I(l,e.x,u);return f>=i[0]&&f<=i[1]}).length||n.length;!r&&s>=2&&(s+=1);let c=(s<2?1:1-e.barPadding)*(this.isVertical()?this._width:this._height)/s;return Tt([c,e.barMaxWidth])}_getVisibleData(){let{config:e,datamodel:{data:n}}=this,r=this._getBarWidth(),i=n.length<2?0:r/2,o=this.dataScale,s=Math.abs(o.invert(i)-o.invert(0));return n?.filter((c,l)=>{let u=I(c,e.x,l),f=o.domain(),h=+f[0],d=+f[1];return u>=h-s&&u<=d+s})}_getBarStyle(e){return K(e.datum,this.config.barStyle,e.stackIndex)}_getBarPath(e,n=!1,r=!0){let{config:i}=this,o=this.getAccessors(),s=this._getBarWidth(),a=e.stacked[1]<e.stacked[0],c=e.isEnding,l=I(e.datum,o[e.stackIndex],e.index),u=n?0:Math.abs(this.valueScale(e.stacked[0])-this.valueScale(e.stacked[1])),f=!n&&i.barMinHeight1Px&&u<1&&isFinite(l)&&l!==i.barMinHeightZeroValue?1:u,h=i.baseline&&I(e.datum,i.baseline,e.index)||0,d=n?this.valueScale(r?h:e.stacked[0]):this.valueScale(a?e.stacked[0]:e.stacked[1])-(u<1&&i.barMinHeight1Px?1:0),x=-s/2,p=s,g=i.roundedCorners?U(i.roundedCorners)?+i.roundedCorners:p/2:0,v=tt(g,0,Math.min(u,p)/2),b=this.yScale.range()[0]>this.yScale.range()[1],y=c,m=e.isStarting&&e.stacked[0]!==0,_=!a&&b||a&&!b,w=a;return fi({x:this.isVertical()?x:d-f,y:this.isVertical()?d+(b?0:-f):x,w:this.isVertical()?p:f,h:this.isVertical()?f:p,tl:this.isVertical()?_?y:m:w?y:m,tr:this.isVertical()?_?y:m:w?m:y,br:this.isVertical()?_?m:y:w?m:y,bl:this.isVertical()?_?m:y:w?y:m,r:v})}_mapEventDatum(e){return{datum:{...e,...e.datum},index:e.index}}getValueScaleExtent(e){let{config:n,datamodel:r}=this,i=this.getAccessors(),o=e?this._getVisibleData():r.data;return ss(o,n.baseline,...i)}getDataScaleExtent(){let{config:e,datamodel:n}=this;return fe(n.data,e.x)}getYDataExtent(e){return this.isVertical()?this.getValueScaleExtent(e):this.getDataScaleExtent()}getXDataExtent(){return this.isVertical()?this.getDataScaleExtent():this.getValueScaleExtent(!1)}};nx.selectors=Ru;var rx=nx;var Co=(t=>(t.Circle="circle",t.Cross="cross",t.Diamond="diamond",t.Square="square",t.Star="star",t.Triangle="triangle",t.Wye="wye",t))(Co||{}),Oa={circle:vo,cross:Qc,diamond:Jc,square:tu,star:eu,triangle:ru,wye:ou};var ix={...ft,color:t=>t.color,pattern:void 0,size:10,sizeScale:ro.scaleSqrt(),sizeRange:void 0,shape:Co.Circle,label:void 0,labelColor:void 0,labelPosition:O.Bottom,labelHideOverlapping:!0,cursor:null,labelTextBrightnessRatio:.65,strokeColor:void 0,strokeWidth:void 0};function ox(t){return t!==O.Top&&t!==O.Bottom&&t!==O.Left&&t!==O.Right}function Eu(t,e){return e?.7*t/Math.pow(e,.5):0}function Du(t,e,n=5){switch(t){case O.Top:return[0,-e/2-n];case O.Bottom:return[0,e/2+n];case O.Left:return[-e/2-n,0];case O.Right:return[e/2+n,0];default:return[0,0]}}function Na(t,e,n,r,i){let o=n(t._point.xValue),s=r(t._point.yValue),a=t._point.sizePx,c=t._point.label??"",l=c.length,u=Eu(a,l),f=ln(c,ox(e)?u:i,.6),h=i,d=Du(e,a),x=e===O.Left?-f:e===O.Right?0:-f/2,p=e===O.Top?-h:e===O.Bottom?0:-h/2;return{x:o+d[0]+x,y:s+d[1]+p,width:f,height:h}}function sx(t,e,n,r){t.each((i,o,s)=>{let a=s[o];a._labelVisible=!0}),t.each((i,o,s)=>{let a=s[o],c=K(i,e.labelPosition,i._point.pointIndex);if(!a._labelVisible||ox(c))return;let l=Y(a).select("text"),u=Dc(l.node()),f=Na(i,c,n,r,u);for(let h=0;h<s.length;h+=1){if(o===h)continue;let d=s[h],x=Y(d),p=x.select("text"),g=x.datum(),v=[n(g._point.xValue),r(g._point.yValue)],b=g._point.sizePx/2,y={x:v[0]-b,y:v[1]-b,width:2*b,height:2*b},m=Je(f,y,2),_=d._labelVisible;if(!m&&_){let w=Dc(p.node()),k=K(g,e.labelPosition,g._point.pointIndex),M=Na(g,k,n,r,w);m=Je(f,M,.25)}if(m)if(a._forceShowLabel)d._labelVisible=!1;else{a._labelVisible=!1;break}}}),t.each((i,o,s)=>{let a=s[o];Y(a).select("text").attr("opacity",a._labelVisible?1:0)})}function ax(t,e,n){t.attr("transform",r=>`translate(${r._point.xValue},${r._point.yValue})`),t.append("path").attr(gt,r=>r._point.groupIndex).style("fill",r=>r._point.color).style("mask",r=>r._point.mask),t.append("text").style("pointer-events","none"),t.attr("transform",r=>`translate(${e(r._point.xValue)},${n(r._point.yValue)}) scale(0)`)}function lx(t,e,n,r,i){let o=oi();t.each((s,a,c)=>{let l=Y(c[a]),u=l.select("text"),f=l.select("path"),h=s._point.sizePx,d=s._point.color,x=s._point.strokeColor??null,p=s._point.strokeWidthPx??null;f.attr("d",()=>s._point.shape?o.size(Math.PI*h*h/4).type(Oa[s._point.shape])():null),D(f,i).style("fill",d).style("mask",s._point.mask).style("stroke",x).style("stroke-width",`${p}px`);let g=s._point.labelPosition,v=g!==O.Top&&g!==O.Bottom&&g!==O.Left&&g!==O.Right,b=s._point.label??"",y=b.length,m=Eu(h,y),_=s._point.labelColor;if(!_&&v){let k=d||"var(--vis-scatter-fill-color)",M=vt(Rr(k)?Qe(k,l.node()):k)?.hex();_=Es(M)>e.labelTextBrightnessRatio?"var(--vis-scatter-point-label-text-color-dark)":"var(--vis-scatter-point-label-text-color-light)"}let w=Du(g,h);u.html(b).attr("x",w[0]).attr("y",w[1]).style("font-size",v?m:null).style("text-anchor",()=>{switch(g){case O.Right:return null;case O.Left:return"end";default:return"middle"}}).style("dominant-baseline",()=>{switch(g){case O.Top:return null;case O.Bottom:return"hanging";default:return"central"}}),D(u,i).style("fill",_),f.style("cursor",s._point.cursor)}),D(t,i).attr("transform",s=>`translate(${n(s._point.xValue)},${r(s._point.yValue)}) scale(1)`)}function cx(t,e,n,r){D(t,r).attr("transform",i=>`translate(${e(i._point.xValue)},${n(i._point.yValue)}) scale(0)`).remove()}var Iu={};Lt(Iu,{globalStyles:()=>jw,point:()=>Pa,pointGroup:()=>Ba,pointGroupExit:()=>$u,root:()=>Zw});var jw=ut`
289
288
  :root {
290
289
  --vis-scatter-cursor: default;
291
290
  --vis-scatter-fill-color: var(--vis-color-main);
@@ -302,13 +301,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
302
301
  // Undefined by default to allow proper fallback to var(--vis-font-family)
303
302
  /* --vis-scatter-point-label-text-font-family: */
304
303
  }
305
- `,Sw=C`
304
+ `,Zw=T`
306
305
  label: scatter-component;
307
- `,Ts=C`
306
+ `,Ba=T`
308
307
  label: point-group;
309
- `,_u=C`
308
+ `,$u=T`
310
309
  label: point-group-exit;
311
- `,As=C`
310
+ `,Pa=T`
312
311
  label: point;
313
312
 
314
313
  > path {
@@ -331,15 +330,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
331
330
  fill: var(--vis-scatter-point-label-text-color-dark);
332
331
  user-select: none;
333
332
  }
334
- `;var Qg=class Jg extends ut{constructor(e){super(),this._defaultConfig=Ug,this.config=this._defaultConfig,this.events={[Jg.selectors.point]:{mouseenter:this._onPointMouseOver.bind(this),mouseleave:this._onPointMouseOut.bind(this)}},this._pointData=[],this.setConfig(e)}setConfig(e){super.setConfig(e),this._updateSizeScale()}setData(e){super.setData(e),this._updateSizeScale()}get bleed(){this._pointData=this._getOnScreenData();let e=gn(this._pointData),n=wt(this.yScale.range()),r=pt(this.yScale.range()),i=this.xScale.range()[0],o=this.xScale.range()[1],a=te("var(--vis-scatter-point-label-text-font-size)",this.element),s=e.reduce((d,g)=>{let p=this.xScale(g._point.xValue),x=this.yScale(g._point.yValue),y=g._point.sizePx/2;if(d.minX=Math.min(d.minX,p-y),d.maxX=Math.max(d.maxX,p+y),d.minY=Math.min(d.minY,x-y),d.maxY=Math.max(d.maxY,x+y),g._point.label){let b=Cs(g,g._point.labelPosition,this.xScale,this.yScale,a);d.minX=Math.min(d.minX,b.x),d.maxX=Math.max(d.maxX,b.x+b.width),d.minY=Math.min(d.minY,b.y),d.maxY=Math.max(d.maxY,b.y+b.height)}return d},{minX:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY}),c=1.2,l=s.minY<n?c*(n-s.minY):0,u=s.maxY>r?c*(s.maxY-r):0,f=s.minX<i?c*(i-s.minX):0,h=s.maxX>o?c*(s.maxX-o):0;return{top:l,bottom:u,left:f,right:h}}_render(e){let{config:n}=this,r=U(e)?e:n.duration,i=this.g.selectAll(`.${Ts}`).data(this._pointData),a=i.enter().append("g").attr("class",Ts).merge(i);R(a,r).style("opacity",1);let s=i.exit().attr("class",_u);R(s,r).style("opacity",0).remove();let c=a.selectAll(`.${As}`).data(u=>u,u=>`${G(u,n.id,u._point.pointIndex)??u._point.pointIndex}`),l=c.enter().append("g").attr("class",As);Zg(l,this.xScale,this.yScale),this._points=l.merge(c),jg(this._points,n,this.xScale,this.yScale,r),Kg(c.exit(),this.xScale,this.yScale,r),this._resolveLabelOverlap()}_resolveLabelOverlap(){if(this.config.label){if(!this.config.labelHideOverlapping){this._points.selectAll("text").attr("opacity",null);return}cancelAnimationFrame(this._collideLabelsAnimFrameId),this._collideLabelsAnimFrameId=requestAnimationFrame(()=>{let e=this._points.filter(n=>!!n._point.label);qg(e,this.config,this.xScale,this.yScale)})}}_updateSizeScale(){let{config:e,datamodel:n}=this;this._sizeScale=e.sizeScale.copy(),this._sizeScale.domain(ue(n.data,e.size)),this._sizeScale.range(e.sizeRange??[0,0])}_getOnScreenData(){let{config:e,datamodel:{data:n}}=this,r=this.xScale.domain().map(h=>+h),i=this.yScale.domain().map(h=>+h),o=At(e.y)?e.y:[e.y],a=pt(gn(o.map((h,d)=>n?.map(g=>L(g,e.size,d))))),s=e.sizeRange?this._sizeScale(a):a,c=this.xScale.invert(s)-this.xScale.invert(0),l=Math.abs(this.yScale.invert(s)-this.yScale.invert(0)),u={colorFn:this._colorFunction},f={...u,dontFallbackToCssVar:!0};return o.map((h,d)=>n?.reduce((g,p,x)=>{let y=L(p,e.x,x),b=L(p,h,d);if(y==null||b==null)return g;let v=L(p,e.size,x),m=e.sizeRange?this._sizeScale(v):v,_=this.xScale.invert(m)-this.xScale.invert(0),w=Math.abs(this.yScale.invert(m)-this.yScale.invert(0));return y-_/2>=r[0]-c/2&&y+_/2<=r[1]+c/2&&b-w/2>=i[0]-l/2&&b+w/2<=i[1]+l/2&&g.push({...p,_point:{xValue:y,yValue:b,sizePx:m,color:H(p,e.color,d,e.colorKeys?.[d],u),mask:yt(ft(p,e.pattern,d)),strokeColor:H(p,e.strokeColor,d,e.colorKeys?.[d],f),strokeWidthPx:L(p,e.strokeWidth,d),shape:G(p,e.shape,d),label:G(p,e.label,d),labelColor:H(p,e.labelColor,d,e.colorKeys?.[d],f),labelPosition:K(p,e.labelPosition,x),cursor:G(p,e.cursor,d),groupIndex:d,pointIndex:x}}),g},[])??[])}_mapEventDatum(e){return{datum:e,index:e._point.pointIndex}}_onPointMouseOver(e,n){let r=W(n.target),i=r.node();i&&(i._forceShowLabel=!0),r.raise(),this._resolveLabelOverlap()}_onPointMouseOut(e,n){let r=W(n.target).node();r&&delete r._forceShowLabel,this._resolveLabelOverlap()}};Qg.selectors=wu;var tx=Qg;var ex={passive:!1},cr={capture:!0,passive:!1};function Ms(t){t.stopImmediatePropagation()}function An(t){t.preventDefault(),t.stopImmediatePropagation()}function nx(t){var e=t.document.documentElement,n=W(t).on("dragstart.drag",An,cr);"onselectstart"in e?n.on("selectstart.drag",An,cr):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function rx(t,e){var n=t.document.documentElement,r=W(t).on("dragstart.drag",null);e&&(r.on("click.drag",An,cr),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Co=t=>()=>t;function To(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}To.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function kw(t){return!t.ctrlKey&&!t.button}function Cw(){return this.parentNode}function Tw(t,e){return e??{x:t.x,y:t.y}}function Aw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Su(){var t=kw,e=Cw,n=Tw,r=Aw,i={},o=eo("start","drag","end"),a=0,s,c,l,u,f=0;function h(m){m.on("mousedown.drag",d).filter(r).on("touchstart.drag",x).on("touchmove.drag",y,ex).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(m,_){if(!(u||!t.call(this,m,_))){var w=v(this,e.call(this,m,_),m,_,"mouse");w&&(W(m.view).on("mousemove.drag",g,cr).on("mouseup.drag",p,cr),nx(m.view),Ms(m),l=!1,s=m.clientX,c=m.clientY,w("start",m))}}function g(m){if(An(m),!l){var _=m.clientX-s,w=m.clientY-c;l=_*_+w*w>f}i.mouse("drag",m)}function p(m){W(m.view).on("mousemove.drag mouseup.drag",null),rx(m.view,l),An(m),i.mouse("end",m)}function x(m,_){if(t.call(this,m,_)){var w=m.changedTouches,k=e.call(this,m,_),A=w.length,I,O;for(I=0;I<A;++I)(O=v(this,k,m,_,w[I].identifier,w[I]))&&(Ms(m),O("start",m,w[I]))}}function y(m){var _=m.changedTouches,w=_.length,k,A;for(k=0;k<w;++k)(A=i[_[k].identifier])&&(An(m),A("drag",m,_[k]))}function b(m){var _=m.changedTouches,w=_.length,k,A;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),k=0;k<w;++k)(A=i[_[k].identifier])&&(Ms(m),A("end",m,_[k]))}function v(m,_,w,k,A,I){var O=o.copy(),N=Ce(I||w,_),M,E,B;if((B=n.call(m,new To("beforestart",{sourceEvent:w,target:h,identifier:A,active:a,x:N[0],y:N[1],dx:0,dy:0,dispatch:O}),k))!=null)return M=B.x-N[0]||0,E=B.y-N[1]||0,function Q(F,q,rt){var st=N,et;switch(F){case"start":i[A]=Q,et=a++;break;case"end":delete i[A],--a;case"drag":N=Ce(rt||q,_),et=a;break}O.call(F,m,new To(F,{sourceEvent:q,subject:B,target:h,identifier:A,active:et,x:N[0]+M,y:N[1]+E,dx:N[0]-st[0],dy:N[1]-st[1],dispatch:O}),k)}}return h.filter=function(m){return arguments.length?(t=typeof m=="function"?m:Co(!!m),h):t},h.container=function(m){return arguments.length?(e=typeof m=="function"?m:Co(m),h):e},h.subject=function(m){return arguments.length?(n=typeof m=="function"?m:Co(m),h):n},h.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Co(!!m),h):r},h.on=function(){var m=o.on.apply(o,arguments);return m===o?h:m},h.clickDistance=function(m){return arguments.length?(f=(m=+m)*m,h):Math.sqrt(f)},h}var Zt={...ko,Line:"line"},Ao=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(Ao||{});var Ee=(t=>(t.AbsolutePx="absolute_px",t.AbsolutePercentage="absolute_percentage",t.DataSpace="data_space",t))(Ee||{});var si=(t=>(t.Inwards="inwards",t.Outwards="outwards",t))(si||{}),fn=(t=>(t.Along="along",t.Perpendicular="perpendicular",t.Straight="straight",t))(fn||{});var ku=(t=>(t.Solid="solid",t.Dash="dash",t.DashDot="dashDot",t.Dot="dot",t.LongDash="longDash",t.LongDashDot="longDashDot",t.LongDashDotDot="longDashDotDot",t.ShortDash="shortDash",t.ShortDashDot="shortDashDot",t.ShortDashDotDot="shortDashDotDot",t.ShortDot="shortDot",t))(ku||{}),Z=(t=>(t.TopLeft="top-left",t.Top="top",t.TopRight="top-right",t.Right="right",t.BottomRight="bottom-right",t.Bottom="bottom",t.BottomLeft="bottom-left",t.Left="left",t))(Z||{}),Mo=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(Mo||{});var P=(t=>(t.TopLeftInside="top-left-inside",t.TopLeftOutside="top-left-outside",t.TopInside="top-inside",t.TopOutside="top-outside",t.TopRightInside="top-right-inside",t.TopRightOutside="top-right-outside",t.RightInside="right-inside",t.RightOutside="right-outside",t.BottomRightInside="bottom-right-inside",t.BottomRightOutside="bottom-right-outside",t.BottomInside="bottom-inside",t.BottomOutside="bottom-outside",t.BottomLeftInside="bottom-left-inside",t.BottomLeftOutside="bottom-left-outside",t.LeftInside="left-inside",t.LeftOutside="left-outside",t))(P||{}),Cu=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(Cu||{});var ix={...ct,id:void 0,cursor:void 0,type:t=>t.type,length:t=>t.length,color:t=>t.color,pattern:void 0,lineRow:void 0,lineDuration:void 0,lineWidth:8,lineCap:!1,lineCursor:void 0,showEmptySegments:!1,showEmptySegmentsCorrectPosition:!0,lineStartIcon:void 0,lineStartIconColor:void 0,lineStartIconSize:void 0,lineStartIconArrangement:ne.Inside,lineEndIcon:void 0,lineEndIconColor:void 0,lineEndIconSize:void 0,lineEndIconArrangement:ne.Inside,rowHeight:22,alternatingRowColors:!0,showLabels:!1,labelWidth:void 0,maxLabelWidth:120,showRowLabels:void 0,rowLabelFormatter:void 0,rowIcon:void 0,rowLabelStyle:void 0,rowLabelWidth:void 0,rowMaxLabelWidth:void 0,rowLabelTextAlign:Tt.Right,rowLabelTrimMode:Ae.Middle,rowLabelMargin:[0,6],rowFillEmptySpace:!0,arrows:void 0,animationLineEnterPosition:void 0,onScroll:void 0};var Nu={};Rt(Nu,{arrow:()=>$s,arrows:()=>Du,background:()=>Au,cssVarDefaults:()=>Tu,label:()=>Do,labelBackground:()=>Bs,labels:()=>Bu,line:()=>Rs,lineEndIcon:()=>Ls,lineGroup:()=>Ds,lineStartIcon:()=>Es,lines:()=>Mu,root:()=>ox,row:()=>Is,rowIcon:()=>Os,rowIcons:()=>Ou,rowOdd:()=>Eu,rows:()=>Ru,scrollbar:()=>Lu,scrollbarBackground:()=>Iu,scrollbarHandle:()=>$u,variables:()=>Mw});var ox=C`
333
+ `;var ux=class fx extends ht{constructor(e){super(),this._defaultConfig=ix,this.config=this._defaultConfig,this.events={[fx.selectors.point]:{mouseenter:this._onPointMouseOver.bind(this),mouseleave:this._onPointMouseOut.bind(this)}},this._pointData=[],this.setConfig(e)}setConfig(e){super.setConfig(e),this._updateSizeScale()}setData(e){super.setData(e),this._updateSizeScale()}get bleed(){this._pointData=this._getOnScreenData();let e=xn(this._pointData),n=Tt(this.yScale.range()),r=xt(this.yScale.range()),i=this.xScale.range()[0],o=this.xScale.range()[1],s=Dt("var(--vis-scatter-point-label-text-font-size)",this.element),a=e.reduce((d,x)=>{let p=this.xScale(x._point.xValue),g=this.yScale(x._point.yValue),v=x._point.sizePx/2;if(d.minX=Math.min(d.minX,p-v),d.maxX=Math.max(d.maxX,p+v),d.minY=Math.min(d.minY,g-v),d.maxY=Math.max(d.maxY,g+v),x._point.label){let b=Na(x,x._point.labelPosition,this.xScale,this.yScale,s);d.minX=Math.min(d.minX,b.x),d.maxX=Math.max(d.maxX,b.x+b.width),d.minY=Math.min(d.minY,b.y),d.maxY=Math.max(d.maxY,b.y+b.height)}return d},{minX:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY}),c=1.2,l=a.minY<n?c*(n-a.minY):0,u=a.maxY>r?c*(a.maxY-r):0,f=a.minX<i?c*(i-a.minX):0,h=a.maxX>o?c*(a.maxX-o):0;return{top:l,bottom:u,left:f,right:h}}_render(e){let{config:n}=this,r=U(e)?e:n.duration,i=this.g.selectAll(`.${Ba}`).data(this._pointData),s=i.enter().append("g").attr("class",Ba).merge(i);D(s,r).style("opacity",1);let a=i.exit().attr("class",$u);D(a,r).style("opacity",0).remove();let c=s.selectAll(`.${Pa}`).data(u=>u,u=>`${q(u,n.id,u._point.pointIndex)??u._point.pointIndex}`),l=c.enter().append("g").attr("class",Pa);ax(l,this.xScale,this.yScale),this._points=l.merge(c),lx(this._points,n,this.xScale,this.yScale,r),cx(c.exit(),this.xScale,this.yScale,r),this._resolveLabelOverlap()}_resolveLabelOverlap(){if(this.config.label){if(!this.config.labelHideOverlapping){this._points.selectAll("text").attr("opacity",null);return}cancelAnimationFrame(this._collideLabelsAnimFrameId),this._collideLabelsAnimFrameId=requestAnimationFrame(()=>{let e=this._points.filter(n=>!!n._point.label);sx(e,this.config,this.xScale,this.yScale)})}}_updateSizeScale(){let{config:e,datamodel:n}=this;this._sizeScale=e.sizeScale.copy(),this._sizeScale.domain(fe(n.data,e.size)),this._sizeScale.range(e.sizeRange??[0,0])}_getOnScreenData(){let{config:e,datamodel:{data:n}}=this,r=this.xScale.domain().map(h=>+h),i=this.yScale.domain().map(h=>+h),o=mt(e.y)?e.y:[e.y],s=xt(xn(o.map((h,d)=>n?.map(x=>I(x,e.size,d))))),a=e.sizeRange?this._sizeScale(s):s,c=this.xScale.invert(a)-this.xScale.invert(0),l=Math.abs(this.yScale.invert(a)-this.yScale.invert(0)),u={colorFn:this._colorFunction},f={...u,dontFallbackToCssVar:!0};return o.map((h,d)=>n?.reduce((x,p,g)=>{let v=I(p,e.x,g),b=I(p,h,d);if(v==null||b==null)return x;let y=I(p,e.size,g),m=e.sizeRange?this._sizeScale(y):y,_=this.xScale.invert(m)-this.xScale.invert(0),w=Math.abs(this.yScale.invert(m)-this.yScale.invert(0));return v-_/2>=r[0]-c/2&&v+_/2<=r[1]+c/2&&b-w/2>=i[0]-l/2&&b+w/2<=i[1]+l/2&&x.push({...p,_point:{xValue:v,yValue:b,sizePx:m,color:X(p,e.color,d,e.colorKeys?.[d],u),mask:_t(dt(p,e.pattern,d)),strokeColor:X(p,e.strokeColor,d,e.colorKeys?.[d],f),strokeWidthPx:I(p,e.strokeWidth,d),shape:q(p,e.shape,d),label:q(p,e.label,d),labelColor:X(p,e.labelColor,d,e.colorKeys?.[d],f),labelPosition:K(p,e.labelPosition,g),cursor:q(p,e.cursor,d),groupIndex:d,pointIndex:g}}),x},[])??[])}_mapEventDatum(e){return{datum:e,index:e._point.pointIndex}}_onPointMouseOver(e,n){let r=Y(n.target),i=r.node();i&&(i._forceShowLabel=!0),r.raise(),this._resolveLabelOverlap()}_onPointMouseOut(e,n){let r=Y(n.target).node();r&&delete r._forceShowLabel,this._resolveLabelOverlap()}};ux.selectors=Iu;var hx=ux;var dx={passive:!1},dr={capture:!0,passive:!1};function Fa(t){t.stopImmediatePropagation()}function Ln(t){t.preventDefault(),t.stopImmediatePropagation()}function px(t){var e=t.document.documentElement,n=Y(t).on("dragstart.drag",Ln,dr);"onselectstart"in e?n.on("selectstart.drag",Ln,dr):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function mx(t,e){var n=t.document.documentElement,r=Y(t).on("dragstart.drag",null);e&&(r.on("click.drag",Ln,dr),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Mo=t=>()=>t;function Lo(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Lo.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Kw(t){return!t.ctrlKey&&!t.button}function Qw(){return this.parentNode}function Jw(t,e){return e??{x:t.x,y:t.y}}function tS(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ou(){var t=Kw,e=Qw,n=Jw,r=tS,i={},o=io("start","drag","end"),s=0,a,c,l,u,f=0;function h(m){m.on("mousedown.drag",d).filter(r).on("touchstart.drag",g).on("touchmove.drag",v,dx).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(m,_){if(!(u||!t.call(this,m,_))){var w=y(this,e.call(this,m,_),m,_,"mouse");w&&(Y(m.view).on("mousemove.drag",x,dr).on("mouseup.drag",p,dr),px(m.view),Fa(m),l=!1,a=m.clientX,c=m.clientY,w("start",m))}}function x(m){if(Ln(m),!l){var _=m.clientX-a,w=m.clientY-c;l=_*_+w*w>f}i.mouse("drag",m)}function p(m){Y(m.view).on("mousemove.drag mouseup.drag",null),mx(m.view,l),Ln(m),i.mouse("end",m)}function g(m,_){if(t.call(this,m,_)){var w=m.changedTouches,k=e.call(this,m,_),M=w.length,N,P;for(N=0;N<M;++N)(P=y(this,k,m,_,w[N].identifier,w[N]))&&(Fa(m),P("start",m,w[N]))}}function v(m){var _=m.changedTouches,w=_.length,k,M;for(k=0;k<w;++k)(M=i[_[k].identifier])&&(Ln(m),M("drag",m,_[k]))}function b(m){var _=m.changedTouches,w=_.length,k,M;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),k=0;k<w;++k)(M=i[_[k].identifier])&&(Fa(m),M("end",m,_[k]))}function y(m,_,w,k,M,N){var P=o.copy(),F=He(N||w,_),R,$,B;if((B=n.call(m,new Lo("beforestart",{sourceEvent:w,target:h,identifier:M,active:s,x:F[0],y:F[1],dx:0,dy:0,dispatch:P}),k))!=null)return R=B.x-F[0]||0,$=B.y-F[1]||0,function et(V,Z,st){var ct=F,it;switch(V){case"start":i[M]=et,it=s++;break;case"end":delete i[M],--s;case"drag":F=He(st||Z,_),it=s;break}P.call(V,m,new Lo(V,{sourceEvent:Z,subject:B,target:h,identifier:M,active:it,x:F[0]+R,y:F[1]+$,dx:F[0]-ct[0],dy:F[1]-ct[1],dispatch:P}),k)}}return h.filter=function(m){return arguments.length?(t=typeof m=="function"?m:Mo(!!m),h):t},h.container=function(m){return arguments.length?(e=typeof m=="function"?m:Mo(m),h):e},h.subject=function(m){return arguments.length?(n=typeof m=="function"?m:Mo(m),h):n},h.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Mo(!!m),h):r},h.on=function(){var m=o.on.apply(o,arguments);return m===o?h:m},h.clickDistance=function(m){return arguments.length?(f=(m=+m)*m,h):Math.sqrt(f)},h}var Kt={...Co,Line:"line"},Ro=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(Ro||{});var Ee=(t=>(t.AbsolutePx="absolute_px",t.AbsolutePercentage="absolute_percentage",t.DataSpace="data_space",t))(Ee||{});var hi=(t=>(t.Inwards="inwards",t.Outwards="outwards",t))(hi||{}),fn=(t=>(t.Along="along",t.Perpendicular="perpendicular",t.Straight="straight",t))(fn||{});var Nu=(t=>(t.Solid="solid",t.Dash="dash",t.DashDot="dashDot",t.Dot="dot",t.LongDash="longDash",t.LongDashDot="longDashDot",t.LongDashDotDot="longDashDotDot",t.ShortDash="shortDash",t.ShortDashDot="shortDashDot",t.ShortDashDotDot="shortDashDotDot",t.ShortDot="shortDot",t))(Nu||{}),Q=(t=>(t.TopLeft="top-left",t.Top="top",t.TopRight="top-right",t.Right="right",t.BottomRight="bottom-right",t.Bottom="bottom",t.BottomLeft="bottom-left",t.Left="left",t))(Q||{}),Eo=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(Eo||{});var z=(t=>(t.TopLeftInside="top-left-inside",t.TopLeftOutside="top-left-outside",t.TopInside="top-inside",t.TopOutside="top-outside",t.TopRightInside="top-right-inside",t.TopRightOutside="top-right-outside",t.RightInside="right-inside",t.RightOutside="right-outside",t.BottomRightInside="bottom-right-inside",t.BottomRightOutside="bottom-right-outside",t.BottomInside="bottom-inside",t.BottomOutside="bottom-outside",t.BottomLeftInside="bottom-left-inside",t.BottomLeftOutside="bottom-left-outside",t.LeftInside="left-inside",t.LeftOutside="left-outside",t))(z||{}),Do=(t=>(t.Horizontal="horizontal",t.Vertical="vertical",t))(Do||{});var gx={...ft,id:void 0,cursor:void 0,type:t=>t.type,length:t=>t.length,color:t=>t.color,pattern:void 0,lineRow:void 0,lineDuration:void 0,lineWidth:8,lineCap:!1,lineCursor:void 0,showEmptySegments:!1,showEmptySegmentsCorrectPosition:!0,lineStartIcon:void 0,lineStartIconColor:void 0,lineStartIconSize:void 0,lineStartIconArrangement:re.Inside,lineEndIcon:void 0,lineEndIconColor:void 0,lineEndIconSize:void 0,lineEndIconArrangement:re.Inside,rowHeight:22,alternatingRowColors:!0,showLabels:!1,labelWidth:void 0,maxLabelWidth:120,showRowLabels:void 0,rowLabelFormatter:void 0,rowIcon:void 0,rowLabelStyle:void 0,rowLabelWidth:void 0,rowMaxLabelWidth:void 0,rowLabelTextAlign:C.Right,rowLabelTrimMode:Ce.Middle,rowLabelMargin:[0,6],rowFillEmptySpace:!0,arrows:void 0,animationLineEnterPosition:void 0,onScroll:void 0};var qu={};Lt(qu,{arrow:()=>Ya,arrows:()=>zu,background:()=>Pu,cssVarDefaults:()=>Bu,label:()=>$o,labelBackground:()=>Ua,labels:()=>Uu,line:()=>Va,lineEndIcon:()=>Ha,lineGroup:()=>za,lineStartIcon:()=>Wa,lines:()=>Fu,root:()=>xx,row:()=>Ga,rowIcon:()=>Xa,rowIcons:()=>Xu,rowOdd:()=>Wu,rows:()=>Vu,scrollbar:()=>Hu,scrollbarBackground:()=>Gu,scrollbarHandle:()=>Yu,variables:()=>eS});var xx=T`
335
334
  label: timeline-component;
336
- `,Tu={"--vis-timeline-row-even-fill-color":"#FFFFFF","--vis-timeline-row-odd-fill-color":"#F7FAFC","--vis-timeline-row-background-opacity":"1","--vis-timeline-scrollbar-background-color":"#E6E9F3","--vis-timeline-scrollbar-color":"#9EA7B8","--vis-timeline-label-font-size":"12px","--vis-timeline-label-color":"#6C778C","--vis-timeline-label-user-select":"none","--vis-timeline-label-pointer-events":"all","--vis-timeline-arrow-color":"#6C778C","--vis-timeline-arrow-stroke-width":"1.5","--vis-timeline-cursor":"default","--vis-timeline-line-color":"var(--vis-color-main)","--vis-timeline-line-stroke-color":void 0,"--vis-timeline-line-stroke-width":"0","--vis-timeline-line-hover-stroke-width":"0","--vis-timeline-line-hover-stroke-color":"#6C778C","--vis-timeline-row-icon-cursor":"default","--vis-dark-timeline-row-even-fill-color":"#292B34","--vis-dark-timeline-row-odd-fill-color":"#333742","--vis-dark-timeline-scrollbar-background-color":"#292B34","--vis-dark-timeline-scrollbar-color":"#6C778C","--vis-dark-timeline-label-color":"#EFF5F8","--vis-dark-timeline-arrow-color":"#EFF5F8","--vis-dark-timeline-line-hover-stroke-color":"#EFF5F8"},Mw=pe(Tu);me(Tu,ox);var Au=C`
335
+ `,Bu={"--vis-timeline-row-even-fill-color":"#FFFFFF","--vis-timeline-row-odd-fill-color":"#F7FAFC","--vis-timeline-row-background-opacity":"1","--vis-timeline-scrollbar-background-color":"#E6E9F3","--vis-timeline-scrollbar-color":"#9EA7B8","--vis-timeline-label-font-size":"12px","--vis-timeline-label-color":"#6C778C","--vis-timeline-label-user-select":"none","--vis-timeline-label-pointer-events":"all","--vis-timeline-arrow-color":"#6C778C","--vis-timeline-arrow-stroke-width":"1.5","--vis-timeline-cursor":"default","--vis-timeline-line-color":"var(--vis-color-main)","--vis-timeline-line-stroke-color":void 0,"--vis-timeline-line-stroke-width":"0","--vis-timeline-line-hover-stroke-width":"0","--vis-timeline-line-hover-stroke-color":"#6C778C","--vis-timeline-row-icon-cursor":"default","--vis-dark-timeline-row-even-fill-color":"#292B34","--vis-dark-timeline-row-odd-fill-color":"#333742","--vis-dark-timeline-scrollbar-background-color":"#292B34","--vis-dark-timeline-scrollbar-color":"#6C778C","--vis-dark-timeline-label-color":"#EFF5F8","--vis-dark-timeline-arrow-color":"#EFF5F8","--vis-dark-timeline-line-hover-stroke-color":"#EFF5F8"},eS=me(Bu);ge(Bu,xx);var Pu=T`
337
336
  label: background;
338
- `,Mu=C`
337
+ `,Fu=T`
339
338
  label: lines;
340
- `,Ds=C`
339
+ `,za=T`
341
340
  label: line-group;
342
- `,Rs=C`
341
+ `,Va=T`
343
342
  label: line;
344
343
  fill: var(--vis-timeline-line-color);
345
344
  cursor: var(--vis-timeline-cursor);
@@ -355,37 +354,37 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
355
354
  stroke-width: var(--vis-timeline-line-hover-stroke-width);
356
355
  stroke: var(--vis-timeline-line-hover-stroke-color);
357
356
  }
358
- `,Es=C`
357
+ `,Wa=T`
359
358
  label: line-start-icon;
360
- `,Ls=C`
359
+ `,Ha=T`
361
360
  label: line-end-icon;
362
- `,Du=C`
361
+ `,zu=T`
363
362
  label: arrows;
364
- `,$s=C`
363
+ `,Ya=T`
365
364
  label: arrow;
366
365
  fill: none;
367
366
  stroke: var(--vis-timeline-arrow-color);
368
367
  stroke-width: var(--vis-timeline-arrow-stroke-width);
369
- `,Ru=C`
368
+ `,Vu=T`
370
369
  label: rows;
371
- `,Is=C`
370
+ `,Ga=T`
372
371
  label: row;
373
372
  fill: var(--vis-timeline-row-even-fill-color);
374
373
  opacity: var(--vis-timeline-row-background-opacity);
375
- `,Eu=C`
374
+ `,Wu=T`
376
375
  label: row-odd;
377
376
  fill: var(--vis-timeline-row-odd-fill-color);
378
- `,Lu=C`
377
+ `,Hu=T`
379
378
  label: scroll-bar;
380
- `,$u=C`
379
+ `,Yu=T`
381
380
  label: scroll-bar-handle;
382
381
  fill: var(--vis-timeline-scrollbar-color);
383
- `,Iu=C`
382
+ `,Gu=T`
384
383
  label: scroll-bar-background;
385
384
  fill: var(--vis-timeline-scrollbar-background-color);
386
- `,Bu=C`
385
+ `,Uu=T`
387
386
  label: labels;
388
- `,Do=C`
387
+ `,$o=T`
389
388
  label: label;
390
389
  dominant-baseline: middle;
391
390
  font-size: var(--vis-timeline-label-font-size);
@@ -393,41 +392,41 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
393
392
  text-anchor: end;
394
393
  user-select: var(--vis-timeline-label-user-select);
395
394
  pointer-events: var(--vis-timeline-label-pointer-events);
396
- `,Bs=C`
395
+ `,Ua=T`
397
396
  label: label-background;
398
397
  fill: transparent;
399
398
  pointer-events: all;
400
- `,Ou=C`
399
+ `,Xu=T`
401
400
  label: row-icons;
402
- `,Os=C`
401
+ `,Xa=T`
403
402
  label: row-icon;
404
403
  cursor: var(--vis-timeline-row-icon-cursor);
405
- `;var Pu=(t,e,n,r,i,o)=>{if(!G(t,n,e))return 0;let s=L(t,r,e)||o/2,c=K(t,i,e);return c===ne.Outside?s:c===ne.Center?s/2:0};var ax=class li extends ut{constructor(e){super(),this._defaultConfig=ix,this.config=this._defaultConfig,this.events={[li.selectors.background]:{wheel:this._onMouseWheel.bind(this)},[li.selectors.label]:{wheel:this._onMouseWheel.bind(this)},[li.selectors.labelBackground]:{wheel:this._onMouseWheel.bind(this)},[li.selectors.rows]:{wheel:this._onMouseWheel.bind(this)},[li.selectors.line]:{wheel:this._onMouseWheel.bind(this)}},this._scrollBarWidth=5,this._scrollDistance=0,this._scrollBarMargin=5,this._maxScroll=0,this._scrollbarHeight=0,this._labelWidth=0,this._lineIconBleed=[0,0],this._lineBleed=[0,0],this._clipPathId=Cr(),this.setConfig(e),this._background=this.g.append("rect").attr("class",Au),this._clipPath=this.g.append("clipPath").attr("id",this._clipPathId),this._clipPath.append("rect"),this._rowsGroup=this.g.append("g").attr("class",Ru).style("clip-path",`url(#${this._clipPathId})`),this._arrowsGroup=this.g.append("g").attr("class",Du).style("clip-path",`url(#${this._clipPathId})`),this._linesGroup=this.g.append("g").attr("class",Mu).style("clip-path",`url(#${this._clipPathId})`),this._labelsGroup=this.g.append("g").attr("class",Bu),this._rowIconsGroup=this.g.append("g").attr("class",Ou),this._scrollBarGroup=this.g.append("g").attr("class",Lu),this._scrollBarBackground=this._scrollBarGroup.append("rect").attr("class",Iu),this._scrollBarHandle=this._scrollBarGroup.append("rect").attr("class",$u);let n=Su().on("drag",this._onScrollbarDrag.bind(this));this._scrollBarHandle.call(n)}setConfig(e){super.setConfig(e)}setData(e){super.setData(e)}get bleed(){let{config:e,datamodel:{data:n}}=this,r=this._getRowLabels(n),i=e.rowHeight||this._height/(r.length||1),o=r.some(v=>v.iconHref),a=pt(r.map(v=>v.iconSize||0));if(e.showRowLabels??e.showLabels){let[v,m]=this._getRowLabelMargin();if(e.rowLabelWidth??e.labelWidth)this._labelWidth=(e.rowLabelWidth??e.labelWidth)+v+m;else{let _=r.map(k=>this._labelsGroup.append("text").attr("class",Do).text(k.formattedLabel||"").call(Qr,e.rowMaxLabelWidth??e.maxLabelWidth,e.rowLabelTrimMode)),w=pt(_.map(k=>k.node().getBBox().width))||0;_.forEach(k=>k.remove()),this._labelWidth=w?w+v+m:0}}let s=wt(n,(v,m)=>L(v,e.x,m)),c=n.filter((v,m)=>L(v,e.x,m)===s),l=xi(c,(v,m)=>this._getLineDuration(v,m)),u=n.findIndex(v=>v===c[l]),f=n[u],h=pt(n,(v,m)=>L(v,e.x,m)+this._getLineDuration(v,m)),d=n.filter((v,m)=>L(v,e.x,m)+this._getLineDuration(v,m)===h),g=xi(d,(v,m)=>this._getLineDuration(v,m)),p=n.findIndex(v=>v===d[g]),x=n[p],y=[1,1];if(e.showEmptySegments&&e.lineCap&&f&&x){let v=L(f,e.x,u),m=L(f,e.x,u)+this._getLineDuration(f,u),_=L(x,e.x,p),w=L(x,e.x,p)+this._getLineDuration(x,p),k=w-v,A=this._getLineWidth(f,u,i),I=this._getLineWidth(x,p,i);(m-v)/k*this._width<A&&(y[0]=e.showEmptySegmentsCorrectPosition?A/2:0),(w-_)/k*this._width<I&&(y[1]=e.showEmptySegmentsCorrectPosition?I/2:I)}this._lineBleed=y;let b=[0,0];return e.lineStartIcon&&(b[0]=pt(n,(v,m)=>Pu(v,m,e.lineStartIcon,e.lineStartIconSize,e.lineStartIconArrangement,i))||0),e.lineEndIcon&&(b[1]=pt(n,(v,m)=>Pu(v,m,e.lineEndIcon,e.lineEndIconSize,e.lineEndIconArrangement,i))||0),this._lineIconBleed=b,{top:0,bottom:0,left:this._labelWidth+b[0]+(o?a:0)+y[0],right:this._scrollBarWidth+this._scrollBarMargin+b[1]+y[1]}}_render(e){super._render(e);let{config:n,datamodel:{data:r}}=this,i=U(e)?e:n.duration,o=this.xScale.range(),a=this.yScale.range(),s=Math.min(...a),c=Math.abs(a[1]-a[0]),l=this._getRowLabels(r),u=l.length,f=n.rowHeight||c/(u||1),h=ke().range(ph(u)).domain(l.map(S=>S.label)),d=this._prepareLinesData(r,h,f),g={colorFn:this._colorFunction};this._background.attr("width",this._width).attr("height",this._height).attr("opacity",0);let p=this._rowIconsGroup.selectAll(`.${Os}`).data(l.filter(S=>S.iconSize),S=>S?.label),x=p.enter().append("use").attr("class",Os).attr("x",0).attr("width",S=>S.iconSize).attr("height",S=>S.iconSize).attr("y",S=>s+(h(S.label)+.5)*f-S.iconSize/2).style("color",S=>S.iconColor).style("opacity",0);R(x.merge(p),i).attr("href",S=>S.iconHref).attr("x",0).attr("y",S=>s+(h(S.label)+.5)*f-S.iconSize/2).attr("width",S=>S.iconSize).attr("height",S=>S.iconSize).style("color",S=>S.iconColor).style("opacity",1),R(p.exit(),i).style("opacity",0).remove();let y=this._labelsGroup.selectAll(`.${Do}`).data(n.showRowLabels??n.showLabels?l:[],S=>S?.label),[b,v]=this._getRowLabelMargin(),m=n.rowLabelTextAlign===Tt.Center?this._labelWidth/2:n.rowLabelTextAlign===Tt.Left?this._labelWidth-b:v,_=o[0]-this._lineBleed[0]-this._lineIconBleed[0],w=_-m,k=this._labelsGroup.selectAll(`.${Bs}`).data(n.showRowLabels??n.showLabels?l:[],S=>S?.label);k.enter().append("rect").attr("class",Bs).attr("x",_-this._labelWidth).attr("y",S=>s+h(S.label)*f).attr("width",this._labelWidth).attr("height",f).merge(k).attr("x",_-this._labelWidth).attr("y",S=>s+h(S.label)*f).attr("width",this._labelWidth).attr("height",f),k.exit().remove();let O=y.enter().append("text").attr("class",Do).attr("x",w).attr("y",S=>s+(h(S.label)+.5)*f).style("opacity",0).merge(y).text(S=>S.formattedLabel).each((S,T,z)=>{let V=W(z[T]),D=(n.rowLabelWidth??n.labelWidth)||(n.rowMaxLabelWidth??n.maxLabelWidth);Qr(V,D,n.rowLabelTrimMode);let mt=K(S,n.rowLabelStyle);if(Jo(mt))for(let[nt,Bt]of Object.entries(mt))V.style(nt,Bt)}).style("text-anchor",ts(n.rowLabelTextAlign));R(O,i).attr("x",w).attr("y",S=>s+(h(S.label)+.5)*f).style("opacity",1),R(y.exit(),i).style("opacity",0).remove();let N=o[1]-o[0]+this._lineIconBleed[0]+this._lineIconBleed[1]+this._lineBleed[0]+this._lineBleed[1],M=n.rowFillEmptySpace?Math.max(Math.floor(c/f),u):u,E=Array(M).fill(null).map((S,T)=>l[T]),B=this._rowsGroup.selectAll(`.${Is}`).data(E),F=B.enter().append("rect").attr("class",Is).attr("x",_).attr("width",N).attr("y",(S,T)=>s+T*f).attr("height",f).style("opacity",0).merge(B).classed(Eu,n.alternatingRowColors?(S,T)=>!(T%2):null);R(F,i).attr("x",_).attr("width",N).attr("y",(S,T)=>s+T*f).attr("height",f).style("opacity",1),R(B.exit(),i).style("opacity",0).remove();let q=this._linesGroup.selectAll(`.${Ds}`).data(d,S=>S._id),rt=q.enter().append("g").attr("class",Ds).style("opacity",0).attr("transform",(S,T)=>{let z=Kt(n.animationLineEnterPosition)?n.animationLineEnterPosition(S,T,d):n.animationLineEnterPosition,[V,D]=[z?.[0]??S._xPx,z?.[1]??S._yPx];return`translate(${V}, ${D})`});rt.append("rect").attr("class",Rs).attr(dt,(S,T)=>h(this._getRecordKey(S,T))).style("fill",(S,T)=>H(S,n.color,h(this._getRecordKey(S,T)),void 0,g)).style("mask",(S,T)=>yt(ft(S,n.pattern,h(this._getRecordKey(S,T))))).call(this._renderLines.bind(this),f),rt.append("use").attr("class",Es),rt.append("use").attr("class",Ls);let st=rt.merge(q);R(st,i).attr("transform",S=>`translate(${S._xPx+S._xOffsetPx}, ${S._yPx})`).style("opacity",1);let et=st.selectAll(`.${Rs}`).data(S=>[S]);R(et,i).style("fill",(S,T)=>H(S,n.color,h(this._getRecordKey(S,T)),void 0,g)).style("mask",(S,T)=>yt(ft(S,n.pattern,h(this._getRecordKey(S,T))))).style("cursor",(S,T)=>G(S,n.lineCursor??n.cursor,T)).call(this._renderLines.bind(this),f),st.selectAll(`.${Es}`).data(S=>[S]).attr("href",(S,T)=>G(S,n.lineStartIcon,T)).attr("x",S=>{let T=S._startIconSize,z=S._startIconArrangement;return z===ne.Inside?0:z===ne.Center?-T/2:-T}).attr("y",S=>-(S._startIconSize-S._height)/2||0).attr("width",S=>S._startIconSize).attr("height",S=>S._startIconSize).style("color",S=>S._startIconColor),st.selectAll(`.${Ls}`).data(S=>[S]).attr("href",(S,T)=>G(S,n.lineEndIcon,T)).attr("x",S=>{let T=S._lengthCorrected,z=S._endIconSize,V=S._endIconArrangement,D=V===ne.Inside?-z:V===ne.Center?-z/2:0;return T+D}).attr("y",S=>-((S._endIconSize-S._height)/2)||0).attr("width",S=>S._endIconSize).attr("height",S=>S._endIconSize).style("color",S=>S._endIconColor);let Vt=q.exit();R(Vt,i).style("opacity",0).attr("transform",(S,T)=>{let z=Kt(n.animationLineExitPosition)?n.animationLineExitPosition(S,T,d):n.animationLineExitPosition,[V,D]=[z?.[0]??S._xPx,z?.[1]??S._yPx];return`translate(${V}, ${D})`}).remove();let Ht=this._prepareArrowsData(r,h,f),re=this._arrowsGroup.selectAll(`.${$s}`).data(Ht??[],S=>S.id),ie=re.enter().append("path").attr("class",$s).style("opacity",0);R(ie.merge(re),i).attr("d",S=>Ng(S._points,S.arrowHeadLength??8,S.arrowHeadWidth??6)).style("opacity",1),R(re.exit(),i).style("opacity",0).remove();let Dt=E.length*f;this._scrollbarHeight=c*c/Dt||0,this._maxScroll=Math.max(Dt-c,0),this._scrollBarGroup.attr("transform",`translate(${this._width-this._scrollBarWidth}, ${s})`).attr("opacity",this._maxScroll?1:0),this._scrollBarBackground.attr("width",this._scrollBarWidth).attr("height",this._height).attr("rx",this._scrollBarWidth/2).attr("ry",this._scrollBarWidth/2),this._scrollBarHandle.attr("width",this._scrollBarWidth).attr("height",this._scrollbarHeight).attr("rx",this._scrollBarWidth/2).attr("ry",this._scrollBarWidth/2),this._updateScrollPosition(0);let we=pt(Ht??[],S=>S.arrowHeadWidth??6)??0,le=this._clipPath.select("rect");R(le,le.attr("width")?i:0).attr("x",_-we/2).attr("width",N+we).attr("height",this._height)}_getRowLabelMargin(){let e=this.config.rowLabelMargin;return Array.isArray(e)?e:[e,e]}_getLineLength(e,n){let{config:r,xScale:i}=this,o=L(e,r.x,n),a=L(e,r.lineDuration??r.length,n)??0;return i(o+a)-i(o)}_getLineWidth(e,n,r){let{config:i}=this;return L(e,i.lineWidth,n)??Math.max(Math.floor(r/2),1)}_getLineDuration(e,n){let{config:r}=this;return L(e,r.lineDuration??r.length,n)??0}_prepareLinesData(e,n,r){let{config:i,xScale:o,yScale:a}=this,s=a.range(),c=Math.min(...s);return e.map((l,u)=>{let f=G(l,i.id,u)??[this._getRecordKey(l,u),L(l,i.x,u)].join("-"),h=this._getLineWidth(l,u,r),d=this._getLineLength(l,u);d<0&&console.warn("Unovis | Timeline: Line segments should not have negative lengths. Setting to 0.");let g=i.showEmptySegments?Math.max(i.lineCap?h:1,d):Math.max(0,d),p=o(L(l,i.x,u)),x=c+n(this._getRecordKey(l,u))*r+(r-h)/2,b=i.showEmptySegments&&i.showEmptySegmentsCorrectPosition&&i.lineCap&&d<h?-(g-d)/2:0;return{...l,_id:f,_xPx:p,_yPx:x,_xOffsetPx:b,_length:d,_height:h,_lengthCorrected:g,_startIconSize:L(l,i.lineStartIconSize,u)??h,_endIconSize:L(l,i.lineEndIconSize,u)??h,_startIconColor:G(l,i.lineStartIconColor,u),_endIconColor:G(l,i.lineEndIconColor,u),_startIconArrangement:K(l,i.lineStartIconArrangement,u)??ne.Outside,_endIconArrangement:K(l,i.lineEndIconArrangement,u)??ne.Outside}})}_prepareArrowsData(e,n,r){let{config:i}=this;return i.arrows?.map(a=>{let s=e.findIndex((E,B)=>G(E,i.id,B)===a.lineSourceId),c=e.findIndex((E,B)=>G(E,i.id,B)===a.lineTargetId),l=e[s],u=e[c];if(!l||!u){console.warn("Unovis | Timeline: Arrow references a non-existent line. Skipping...",a);return}let f=n(this._getRecordKey(l,s))*r+r/2,h=n(this._getRecordKey(u,c))*r+r/2,d=this._getLineWidth(l,s,r),g=this._getLineWidth(u,c,r),p=(a.xSource?this.xScale(a.xSource):this.xScale(L(l,i.x,s))+this._getLineLength(l,s))+(a.xSourceOffsetPx??0),x=this._getLineLength(u,c),y=i.showEmptySegments&&i.lineCap&&x<g,b=this.xScale(L(u,i.x,c))+(y?-g/2:0),v=(a.xTarget?this.xScale(a.xTarget):b)+(a.xTargetOffsetPx??0),m=v<b||v>b,_=a.lineSourceMarginPx??3,w=a.lineTargetMarginPx??3,k=f<h?f+d/2+_:f-d/2-_,A=f<h?h-g/2-w:h+g/2+w,I=a.arrowHeadLength??8,O=p<v&&!m,N=I+(O?w:0),M=[[p,k]];if(Math.abs(v-p)>N)if(O)M.push([p,(k+h)/2]),M.push([p,h]),M.push([v-w,h]);else{let E=Math.sign(h-f)*(r/4);M.push([p,A-E]),M.push([v,A-E]),M.push([v,A])}else{let E=(A-k)/4;M.push([p,k+E]),M.push([p,k+3*E]),M.push([p,A])}return{...a,_points:M}}).filter(Boolean)}_renderLines(e){let{config:n}=this;e.attr("width",r=>r._lengthCorrected).attr("height",r=>r._height).attr("rx",r=>n.lineCap?r._height/2:null)}_onScrollbarDrag(e){let n=this.yScale.range(),r=Math.abs(n[1]-n[0]);this._updateScrollPosition(e.dy*this._maxScroll/(r-this._scrollbarHeight))}_onMouseWheel(e,n){let{config:r}=this;this._updateScrollPosition(n?.deltaY),this._scrollDistance>0&&this._scrollDistance<this._maxScroll&&n?.preventDefault(),r.onScroll?.(this._scrollDistance);let i=new Event("mousemove");this.element.dispatchEvent(i)}_updateScrollPosition(e){let n=this.yScale.range(),r=Math.abs(n[1]-n[0]);this._scrollDistance+=e,this._scrollDistance=Math.max(0,this._scrollDistance),this._scrollDistance=Math.min(this._maxScroll,this._scrollDistance),this._clipPath.attr("transform",`translate(0,${this._scrollDistance})`),this._linesGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._rowsGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._labelsGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._rowIconsGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._arrowsGroup.attr("transform",`translate(0,${-this._scrollDistance})`);let i=this._scrollDistance/this._maxScroll*(r-this._scrollbarHeight)||0;this._scrollBarHandle.attr("y",i)}_getRecordKey(e,n){return G(e,this.config.lineRow??this.config.type)||`__${n}`}_getRowLabels(e){let n=dh(e,(i,o)=>G(i,this.config.lineRow??this.config.type)||`${o+1}`);return Object.entries(n).map(([i,o],a)=>{let s=this.config.rowIcon?.(i,o,a);return{label:i,formattedLabel:this.config.rowLabelFormatter?.(i,o,a)??i,iconHref:s?.href,iconSize:s?.size,iconColor:s?.color,data:o}})}getXDataExtent(){let{config:e,datamodel:n}=this,r=Nn(n.data,e.x),i=Pn(n.data,(o,a)=>L(o,e.x,a)+(L(o,e.lineDuration??e.length,a)??0));return[r,i]}};ax.selectors=Nu;var sx=ax;var lx={...ct,color:void 0,median:void 0,quartiles:void 0,whiskers:void 0,barWidth:void 0,barMaxWidth:void 0,dataStep:void 0,barPadding:.25,roundedCorners:2,cursor:null};var Vu={};Rt(Vu,{box:()=>Ps,boxGroup:()=>Ns,boxGroupExit:()=>zu,cssVarDefaults:()=>Fu,median:()=>Fs,root:()=>cx,variables:()=>be,whisker:()=>Ro,whiskerCap:()=>Eo});var cx=C`
404
+ `;var ju=(t,e,n,r,i,o)=>{if(!q(t,n,e))return 0;let a=I(t,r,e)||o/2,c=K(t,i,e);return c===re.Outside?a:c===re.Center?a/2:0};var yx=class di extends ht{constructor(e){super(),this._defaultConfig=gx,this.config=this._defaultConfig,this.events={[di.selectors.background]:{wheel:this._onMouseWheel.bind(this)},[di.selectors.label]:{wheel:this._onMouseWheel.bind(this)},[di.selectors.labelBackground]:{wheel:this._onMouseWheel.bind(this)},[di.selectors.rows]:{wheel:this._onMouseWheel.bind(this)},[di.selectors.line]:{wheel:this._onMouseWheel.bind(this)}},this._scrollBarWidth=5,this._scrollDistance=0,this._scrollBarMargin=5,this._maxScroll=0,this._scrollbarHeight=0,this._labelWidth=0,this._lineIconBleed=[0,0],this._lineBleed=[0,0],this._clipPathId=Lr(),this.setConfig(e),this._background=this.g.append("rect").attr("class",Pu),this._clipPath=this.g.append("clipPath").attr("id",this._clipPathId),this._clipPath.append("rect"),this._rowsGroup=this.g.append("g").attr("class",Vu).style("clip-path",`url(#${this._clipPathId})`),this._arrowsGroup=this.g.append("g").attr("class",zu).style("clip-path",`url(#${this._clipPathId})`),this._linesGroup=this.g.append("g").attr("class",Fu).style("clip-path",`url(#${this._clipPathId})`),this._labelsGroup=this.g.append("g").attr("class",Uu),this._rowIconsGroup=this.g.append("g").attr("class",Xu),this._scrollBarGroup=this.g.append("g").attr("class",Hu),this._scrollBarBackground=this._scrollBarGroup.append("rect").attr("class",Gu),this._scrollBarHandle=this._scrollBarGroup.append("rect").attr("class",Yu);let n=Ou().on("drag",this._onScrollbarDrag.bind(this));this._scrollBarHandle.call(n)}setConfig(e){super.setConfig(e)}setData(e){super.setData(e)}get bleed(){let{config:e,datamodel:{data:n}}=this,r=this._getRowLabels(n),i=e.rowHeight||this._height/(r.length||1),o=r.some(y=>y.iconHref),s=xt(r.map(y=>y.iconSize||0));if(e.showRowLabels??e.showLabels){let[y,m]=this._getRowLabelMargin();if(e.rowLabelWidth??e.labelWidth)this._labelWidth=(e.rowLabelWidth??e.labelWidth)+y+m;else{let _=r.map(k=>this._labelsGroup.append("text").attr("class",$o).text(k.formattedLabel||"").call(ei,e.rowMaxLabelWidth??e.maxLabelWidth,e.rowLabelTrimMode)),w=xt(_.map(k=>k.node().getBBox().width))||0;_.forEach(k=>k.remove()),this._labelWidth=w?w+y+m:0}}let a=Tt(n,(y,m)=>I(y,e.x,m)),c=n.filter((y,m)=>I(y,e.x,m)===a),l=_i(c,(y,m)=>this._getLineDuration(y,m)),u=n.findIndex(y=>y===c[l]),f=n[u],h=xt(n,(y,m)=>I(y,e.x,m)+this._getLineDuration(y,m)),d=n.filter((y,m)=>I(y,e.x,m)+this._getLineDuration(y,m)===h),x=_i(d,(y,m)=>this._getLineDuration(y,m)),p=n.findIndex(y=>y===d[x]),g=n[p],v=[1,1];if(e.showEmptySegments&&e.lineCap&&f&&g){let y=I(f,e.x,u),m=I(f,e.x,u)+this._getLineDuration(f,u),_=I(g,e.x,p),w=I(g,e.x,p)+this._getLineDuration(g,p),k=w-y,M=this._getLineWidth(f,u,i),N=this._getLineWidth(g,p,i);(m-y)/k*this._width<M&&(v[0]=e.showEmptySegmentsCorrectPosition?M/2:0),(w-_)/k*this._width<N&&(v[1]=e.showEmptySegmentsCorrectPosition?N/2:N)}this._lineBleed=v;let b=[0,0];return e.lineStartIcon&&(b[0]=xt(n,(y,m)=>ju(y,m,e.lineStartIcon,e.lineStartIconSize,e.lineStartIconArrangement,i))||0),e.lineEndIcon&&(b[1]=xt(n,(y,m)=>ju(y,m,e.lineEndIcon,e.lineEndIconSize,e.lineEndIconArrangement,i))||0),this._lineIconBleed=b,{top:0,bottom:0,left:this._labelWidth+b[0]+(o?s:0)+v[0],right:this._scrollBarWidth+this._scrollBarMargin+b[1]+v[1]}}_render(e){super._render(e);let{config:n,datamodel:{data:r}}=this,i=U(e)?e:n.duration,o=this.xScale.range(),s=this.yScale.range(),a=Math.min(...s),c=Math.abs(s[1]-s[0]),l=this._getRowLabels(r),u=l.length,f=n.rowHeight||c/(u||1),h=Te().range(Ah(u)).domain(l.map(S=>S.label)),d=this._prepareLinesData(r,h,f),x={colorFn:this._colorFunction};this._background.attr("width",this._width).attr("height",this._height).attr("opacity",0);let p=this._rowIconsGroup.selectAll(`.${Xa}`).data(l.filter(S=>S.iconSize),S=>S?.label),g=p.enter().append("use").attr("class",Xa).attr("x",0).attr("width",S=>S.iconSize).attr("height",S=>S.iconSize).attr("y",S=>a+(h(S.label)+.5)*f-S.iconSize/2).style("color",S=>S.iconColor).style("opacity",0);D(g.merge(p),i).attr("href",S=>S.iconHref).attr("x",0).attr("y",S=>a+(h(S.label)+.5)*f-S.iconSize/2).attr("width",S=>S.iconSize).attr("height",S=>S.iconSize).style("color",S=>S.iconColor).style("opacity",1),D(p.exit(),i).style("opacity",0).remove();let v=this._labelsGroup.selectAll(`.${$o}`).data(n.showRowLabels??n.showLabels?l:[],S=>S?.label),[b,y]=this._getRowLabelMargin(),m=n.rowLabelTextAlign===C.Center?this._labelWidth/2:n.rowLabelTextAlign===C.Left?this._labelWidth-b:y,_=o[0]-this._lineBleed[0]-this._lineIconBleed[0],w=_-m,k=this._labelsGroup.selectAll(`.${Ua}`).data(n.showRowLabels??n.showLabels?l:[],S=>S?.label);k.enter().append("rect").attr("class",Ua).attr("x",_-this._labelWidth).attr("y",S=>a+h(S.label)*f).attr("width",this._labelWidth).attr("height",f).merge(k).attr("x",_-this._labelWidth).attr("y",S=>a+h(S.label)*f).attr("width",this._labelWidth).attr("height",f),k.exit().remove();let P=v.enter().append("text").attr("class",$o).attr("x",w).attr("y",S=>a+(h(S.label)+.5)*f).style("opacity",0).merge(v).text(S=>S.formattedLabel).each((S,A,W)=>{let H=Y(W[A]),E=(n.rowLabelWidth??n.labelWidth)||(n.rowMaxLabelWidth??n.maxLabelWidth);ei(H,E,n.rowLabelTrimMode);let yt=K(S,n.rowLabelStyle);if(os(yt))for(let[ot,Bt]of Object.entries(yt))H.style(ot,Bt)}).style("text-anchor",oa(n.rowLabelTextAlign));D(P,i).attr("x",w).attr("y",S=>a+(h(S.label)+.5)*f).style("opacity",1),D(v.exit(),i).style("opacity",0).remove();let F=o[1]-o[0]+this._lineIconBleed[0]+this._lineIconBleed[1]+this._lineBleed[0]+this._lineBleed[1],R=n.rowFillEmptySpace?Math.max(Math.floor(c/f),u):u,$=Array(R).fill(null).map((S,A)=>l[A]),B=this._rowsGroup.selectAll(`.${Ga}`).data($),V=B.enter().append("rect").attr("class",Ga).attr("x",_).attr("width",F).attr("y",(S,A)=>a+A*f).attr("height",f).style("opacity",0).merge(B).classed(Wu,n.alternatingRowColors?(S,A)=>!(A%2):null);D(V,i).attr("x",_).attr("width",F).attr("y",(S,A)=>a+A*f).attr("height",f).style("opacity",1),D(B.exit(),i).style("opacity",0).remove();let Z=this._linesGroup.selectAll(`.${za}`).data(d,S=>S._id),st=Z.enter().append("g").attr("class",za).style("opacity",0).attr("transform",(S,A)=>{let W=Jt(n.animationLineEnterPosition)?n.animationLineEnterPosition(S,A,d):n.animationLineEnterPosition,[H,E]=[W?.[0]??S._xPx,W?.[1]??S._yPx];return`translate(${H}, ${E})`});st.append("rect").attr("class",Va).attr(gt,(S,A)=>h(this._getRecordKey(S,A))).style("fill",(S,A)=>X(S,n.color,h(this._getRecordKey(S,A)),void 0,x)).style("mask",(S,A)=>_t(dt(S,n.pattern,h(this._getRecordKey(S,A))))).call(this._renderLines.bind(this)),st.append("use").attr("class",Wa),st.append("use").attr("class",Ha);let ct=st.merge(Z);D(ct,i).attr("transform",S=>`translate(${S._xPx+S._xOffsetPx}, ${S._yPx})`).style("opacity",1);let it=ct.selectAll(`.${Va}`).data(S=>[S]);D(it,i).style("fill",(S,A)=>X(S,n.color,h(this._getRecordKey(S,A)),void 0,x)).style("mask",(S,A)=>_t(dt(S,n.pattern,h(this._getRecordKey(S,A))))).style("cursor",(S,A)=>q(S,n.lineCursor??n.cursor,A)).call(this._renderLines.bind(this)),ct.selectAll(`.${Wa}`).data(S=>[S]).attr("href",(S,A)=>q(S,n.lineStartIcon,A)).attr("x",S=>{let A=S._startIconSize,W=S._startIconArrangement;return W===re.Inside?0:W===re.Center?-A/2:-A}).attr("y",S=>-(S._startIconSize-S._height)/2||0).attr("width",S=>S._startIconSize).attr("height",S=>S._startIconSize).style("color",S=>S._startIconColor),ct.selectAll(`.${Ha}`).data(S=>[S]).attr("href",(S,A)=>q(S,n.lineEndIcon,A)).attr("x",S=>{let A=S._lengthCorrected,W=S._endIconSize,H=S._endIconArrangement,E=H===re.Inside?-W:H===re.Center?-W/2:0;return A+E}).attr("y",S=>-((S._endIconSize-S._height)/2)||0).attr("width",S=>S._endIconSize).attr("height",S=>S._endIconSize).style("color",S=>S._endIconColor);let Ht=Z.exit();D(Ht,i).style("opacity",0).attr("transform",(S,A)=>{let W=Jt(n.animationLineExitPosition)?n.animationLineExitPosition(S,A,d):n.animationLineExitPosition,[H,E]=[W?.[0]??S._xPx,W?.[1]??S._yPx];return`translate(${H}, ${E})`}).remove();let Gt=this._prepareArrowsData(r,h,f),ie=this._arrowsGroup.selectAll(`.${Ya}`).data(Gt??[],S=>S.id),oe=ie.enter().append("path").attr("class",Ya).style("opacity",0);D(oe.merge(ie),i).attr("d",S=>Xg(S._points,S.arrowHeadLength??8,S.arrowHeadWidth??6)).style("opacity",1),D(ie.exit(),i).style("opacity",0).remove();let Et=$.length*f;this._scrollbarHeight=c*c/Et||0,this._maxScroll=Math.max(Et-c,0),this._scrollBarGroup.attr("transform",`translate(${this._width-this._scrollBarWidth}, ${a})`).attr("opacity",this._maxScroll?1:0),this._scrollBarBackground.attr("width",this._scrollBarWidth).attr("height",this._height).attr("rx",this._scrollBarWidth/2).attr("ry",this._scrollBarWidth/2),this._scrollBarHandle.attr("width",this._scrollBarWidth).attr("height",this._scrollbarHeight).attr("rx",this._scrollBarWidth/2).attr("ry",this._scrollBarWidth/2),this._updateScrollPosition(0);let Se=xt(Gt??[],S=>S.arrowHeadWidth??6)??0,ce=this._clipPath.select("rect");D(ce,ce.attr("width")?i:0).attr("x",_-Se/2).attr("width",F+Se).attr("height",this._height)}_getRowLabelMargin(){let e=this.config.rowLabelMargin;return Array.isArray(e)?e:[e,e]}_getLineLength(e,n){let{config:r,xScale:i}=this,o=I(e,r.x,n),s=I(e,r.lineDuration??r.length,n)??0;return i(o+s)-i(o)}_getLineWidth(e,n,r){let{config:i}=this;return I(e,i.lineWidth,n)??Math.max(Math.floor(r/2),1)}_getLineDuration(e,n){let{config:r}=this;return I(e,r.lineDuration??r.length,n)??0}_prepareLinesData(e,n,r){let{config:i,xScale:o,yScale:s}=this,a=s.range(),c=Math.min(...a);return e.map((l,u)=>{let f=q(l,i.id,u)??[this._getRecordKey(l,u),I(l,i.x,u)].join("-"),h=this._getLineWidth(l,u,r),d=this._getLineLength(l,u);d<0&&console.warn("Unovis | Timeline: Line segments should not have negative lengths. Setting to 0.");let x=i.showEmptySegments?Math.max(i.lineCap?h:1,d):Math.max(0,d),p=o(I(l,i.x,u)),g=c+n(this._getRecordKey(l,u))*r+(r-h)/2,b=i.showEmptySegments&&i.showEmptySegmentsCorrectPosition&&i.lineCap&&d<h?-(x-d)/2:0;return{...l,_id:f,_xPx:p,_yPx:g,_xOffsetPx:b,_length:d,_height:h,_lengthCorrected:x,_startIconSize:I(l,i.lineStartIconSize,u)??h,_endIconSize:I(l,i.lineEndIconSize,u)??h,_startIconColor:q(l,i.lineStartIconColor,u),_endIconColor:q(l,i.lineEndIconColor,u),_startIconArrangement:K(l,i.lineStartIconArrangement,u)??re.Outside,_endIconArrangement:K(l,i.lineEndIconArrangement,u)??re.Outside}})}_prepareArrowsData(e,n,r){let{config:i}=this;return i.arrows?.map(s=>{let a=e.findIndex(($,B)=>q($,i.id,B)===s.lineSourceId),c=e.findIndex(($,B)=>q($,i.id,B)===s.lineTargetId),l=e[a],u=e[c];if(!l||!u){console.warn("Unovis | Timeline: Arrow references a non-existent line. Skipping...",s);return}let f=n(this._getRecordKey(l,a))*r+r/2,h=n(this._getRecordKey(u,c))*r+r/2,d=this._getLineWidth(l,a,r),x=this._getLineWidth(u,c,r),p=(s.xSource?this.xScale(s.xSource):this.xScale(I(l,i.x,a))+this._getLineLength(l,a))+(s.xSourceOffsetPx??0),g=this._getLineLength(u,c),v=i.showEmptySegments&&i.lineCap&&g<x,b=this.xScale(I(u,i.x,c))+(v?-x/2:0),y=(s.xTarget?this.xScale(s.xTarget):b)+(s.xTargetOffsetPx??0),m=y<b||y>b,_=s.lineSourceMarginPx??3,w=s.lineTargetMarginPx??3,k=f<h?f+d/2+_:f-d/2-_,M=f<h?h-x/2-w:h+x/2+w,N=s.arrowHeadLength??8,P=p<y&&!m,F=N+(P?w:0),R=[[p,k]];if(Math.abs(y-p)>F)if(P)R.push([p,(k+h)/2]),R.push([p,h]),R.push([y-w,h]);else{let $=Math.sign(h-f)*(r/4);R.push([p,M-$]),R.push([y,M-$]),R.push([y,M])}else{let $=(M-k)/4;R.push([p,k+$]),R.push([p,k+3*$]),R.push([p,M])}return{...s,_points:R}}).filter(Boolean)}_renderLines(e){let{config:n}=this;e.attr("width",r=>r._lengthCorrected).attr("height",r=>r._height).attr("rx",r=>n.lineCap?r._height/2:null)}_onScrollbarDrag(e){let n=this.yScale.range(),r=Math.abs(n[1]-n[0]);this._updateScrollPosition(e.dy*this._maxScroll/(r-this._scrollbarHeight))}_onMouseWheel(e,n){let{config:r}=this;this._updateScrollPosition(n?.deltaY),this._scrollDistance>0&&this._scrollDistance<this._maxScroll&&n?.preventDefault(),r.onScroll?.(this._scrollDistance);let i=new Event("mousemove");this.element.dispatchEvent(i)}_updateScrollPosition(e){let n=this.yScale.range(),r=Math.abs(n[1]-n[0]);this._scrollDistance+=e,this._scrollDistance=Math.max(0,this._scrollDistance),this._scrollDistance=Math.min(this._maxScroll,this._scrollDistance),this._clipPath.attr("transform",`translate(0,${this._scrollDistance})`),this._linesGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._rowsGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._labelsGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._rowIconsGroup.attr("transform",`translate(0,${-this._scrollDistance})`),this._arrowsGroup.attr("transform",`translate(0,${-this._scrollDistance})`);let i=this._scrollDistance/this._maxScroll*(r-this._scrollbarHeight)||0;this._scrollBarHandle.attr("y",i)}_getRecordKey(e,n){return q(e,this.config.lineRow??this.config.type)||`__${n}`}_getRowLabels(e){let n=Th(e,(i,o)=>q(i,this.config.lineRow??this.config.type)||`${o+1}`);return Object.entries(n).map(([i,o],s)=>{let a=this.config.rowIcon?.(i,o,s);return{label:i,formattedLabel:this.config.rowLabelFormatter?.(i,o,s)??i,iconHref:a?.href,iconSize:a?.size,iconColor:a?.color,data:o}})}getXDataExtent(){let{config:e,datamodel:n}=this,r=Fn(n.data,e.x),i=zn(n.data,(o,s)=>I(o,e.x,s)+(I(o,e.lineDuration??e.length,s)??0));return[r,i]}};yx.selectors=qu;var vx=yx;var bx={...ft,color:void 0,median:void 0,quartiles:void 0,whiskers:void 0,barWidth:void 0,barMaxWidth:void 0,dataStep:void 0,barPadding:.25,roundedCorners:2,cursor:null};var Qu={};Lt(Qu,{box:()=>ja,boxGroup:()=>qa,boxGroupExit:()=>Ku,cssVarDefaults:()=>Zu,median:()=>Za,root:()=>_x,variables:()=>_e,whisker:()=>Io,whiskerCap:()=>Oo});var _x=T`
406
405
  label: boxplot-component;
407
- `,Fu={"--vis-boxplot-cursor":"default","--vis-boxplot-fill-color":"var(--vis-color-main)","--vis-boxplot-fill-opacity":"0.2","--vis-boxplot-stroke-color":"var(--vis-color-main)","--vis-boxplot-stroke-width":"1.5px","--vis-boxplot-median-stroke-color":"var(--vis-color-main)","--vis-boxplot-median-stroke-width":"1.5px","--vis-boxplot-whisker-stroke-color":"var(--vis-color-main)","--vis-boxplot-whisker-stroke-width":"1.5px","--vis-dark-boxplot-fill-color":"var(--vis-color-main)","--vis-dark-boxplot-stroke-color":"var(--vis-color-main)","--vis-dark-boxplot-median-stroke-color":"var(--vis-color-main)","--vis-dark-boxplot-whisker-stroke-color":"var(--vis-color-main)"},be=pe(Fu);me(Fu,cx);var Ns=C`
406
+ `,Zu={"--vis-boxplot-cursor":"default","--vis-boxplot-fill-color":"var(--vis-color-main)","--vis-boxplot-fill-opacity":"0.2","--vis-boxplot-stroke-color":"var(--vis-color-main)","--vis-boxplot-stroke-width":"1.5px","--vis-boxplot-median-stroke-color":"var(--vis-color-main)","--vis-boxplot-median-stroke-width":"1.5px","--vis-boxplot-whisker-stroke-color":"var(--vis-color-main)","--vis-boxplot-whisker-stroke-width":"1.5px","--vis-dark-boxplot-fill-color":"var(--vis-color-main)","--vis-dark-boxplot-stroke-color":"var(--vis-color-main)","--vis-dark-boxplot-median-stroke-color":"var(--vis-color-main)","--vis-dark-boxplot-whisker-stroke-color":"var(--vis-color-main)"},_e=me(Zu);ge(Zu,_x);var qa=T`
408
407
  label: boxGroup;
409
- `,zu=C`
408
+ `,Ku=T`
410
409
  label: boxGroupExit;
411
- `,Ps=C`
410
+ `,ja=T`
412
411
  label: box;
413
- fill: var(${be.boxplotFillColor});
414
- fill-opacity: var(${be.boxplotFillOpacity});
415
- stroke: var(${be.boxplotStrokeColor});
416
- stroke-width: var(${be.boxplotStrokeWidth});
417
- cursor: var(${be.boxplotCursor});
418
- `,Fs=C`
412
+ fill: var(${_e.boxplotFillColor});
413
+ fill-opacity: var(${_e.boxplotFillOpacity});
414
+ stroke: var(${_e.boxplotStrokeColor});
415
+ stroke-width: var(${_e.boxplotStrokeWidth});
416
+ cursor: var(${_e.boxplotCursor});
417
+ `,Za=T`
419
418
  label: median;
420
- stroke: var(${be.boxplotMedianStrokeColor});
421
- stroke-width: var(${be.boxplotMedianStrokeWidth});
422
- `,Ro=C`
419
+ stroke: var(${_e.boxplotMedianStrokeColor});
420
+ stroke-width: var(${_e.boxplotMedianStrokeWidth});
421
+ `,Io=T`
423
422
  label: whisker;
424
- stroke: var(${be.boxplotWhiskerStrokeColor});
425
- stroke-width: var(${be.boxplotWhiskerStrokeWidth});
426
- `,Eo=C`
423
+ stroke: var(${_e.boxplotWhiskerStrokeColor});
424
+ stroke-width: var(${_e.boxplotWhiskerStrokeWidth});
425
+ `,Oo=T`
427
426
  label: whiskerCap;
428
- stroke: var(${be.boxplotWhiskerStrokeColor});
429
- stroke-width: var(${be.boxplotWhiskerStrokeWidth});
430
- `;var ux=class extends ut{constructor(e){super(),this._defaultConfig=lx,this.config=this._defaultConfig,this.events={},this._boxData=[],this.setConfig(e)}get bleed(){if(this._boxData=this._getVisibleData(),this._boxData.length===0)return{top:0,bottom:0,left:0,right:0};let e=this.xScale.domain(),n=this._getBarWidth()/2,r=this._boxData.map((d,g)=>L(d,this.config.x,g)),i=wt(r),o=pt(r),a=this.xScale(i),s=this.xScale(o),c=this.xScale.invert(a-n),l=this.xScale.invert(s+n),u=c<=e[0]?this.xScale(e[0])-this.xScale(c):0,f=l>e[1]?this.xScale(l)-this.xScale(e[1]):0,h=2;return{top:0,bottom:0,left:u+h,right:f+h}}_render(e){let{config:n}=this,r=U(e)?e:n.duration,i=this._getBarWidth();On(this._boxData)&&(this._boxData=this._getVisibleData());let o=this._boxData.map((f,h)=>({datum:f,index:h,median:L(f,n.median,h),quartiles:K(f,n.quartiles,h),whiskers:K(f,n.whiskers,h)})),a=this.g.selectAll(`.${Ns}`).data(o,f=>`${G(f.datum,n.id,f.index)??f.index}`),s=f=>`translate(${this.xScale(L(f.datum,n.x,f.index))},0)`,c=a.enter().append("g").attr("class",Ns).attr("transform",s).style("opacity",0);c.append("path").attr("class",Ps),c.append("line").attr("class",Ro).attr("data-end","lower"),c.append("line").attr("class",Ro).attr("data-end","upper"),c.append("line").attr("class",Eo).attr("data-end","lower"),c.append("line").attr("class",Eo).attr("data-end","upper"),c.append("line").attr("class",Fs),c.each((f,h,d)=>{this._renderBox(W(d[h]),f,i,0)});let l=c.merge(a);R(l,r).attr("transform",s).style("opacity",1),a.each((f,h,d)=>{this._renderBox(W(d[h]),f,i,r)});let u=a.exit().attr("class",zu);R(u,r).style("opacity",0).remove().on("interrupt",function(){this.remove()})}_renderBox(e,n,r,i){let{config:o}=this,a=-r/2,s=r/2,c=Array.isArray(n.quartiles)&&Number.isFinite(n.quartiles[0])&&Number.isFinite(n.quartiles[1]),l=Number.isFinite(n.median),u=c&&Array.isArray(n.whiskers)&&Number.isFinite(n.whiskers[0])&&Number.isFinite(n.whiskers[1]),f=o.color?H(n.datum,o.color,n.index):null,h=e.select(`.${Ps}`).style("fill",f).style("stroke",f),d=R(h,i).style("opacity",c?1:0);if(c){let v=this.yScale(n.quartiles[1]),m=this.yScale(n.quartiles[0]),_=Math.abs(m-v),w=o.roundedCorners?U(o.roundedCorners)?+o.roundedCorners:r/2:0,k=it(w,0,Math.min(_,r)/2);d.attr("d",ai({x:a,y:Math.min(v,m),w:r,h:_,tl:!0,tr:!0,bl:!0,br:!0,r:k}))}let g=R(e.select(`.${Fs}`).style("stroke",f),i).style("opacity",l?1:0);if(l){let v=this.yScale(n.median);g.attr("x1",a).attr("x2",a+r).attr("y1",v).attr("y2",v)}let p=u?this.yScale(n.whiskers[0]):0,x=u?this.yScale(n.whiskers[1]):0,y=c?this.yScale(n.quartiles[0]):0,b=c?this.yScale(n.quartiles[1]):0;e.selectAll(`.${Ro}`).each((v,m,_)=>{let w=W(_[m]).style("stroke",f),k=w.attr("data-end")==="lower",A=R(w,i).style("opacity",u?1:0);u&&A.attr("x1",0).attr("x2",0).attr("y1",k?y:b).attr("y2",k?p:x)}),e.selectAll(`.${Eo}`).each((v,m,_)=>{let w=W(_[m]).style("stroke",f),k=w.attr("data-end")==="lower",A=R(w,i).style("opacity",u?1:0);if(u){let I=k?p:x;A.attr("x1",-s/2).attr("x2",s/2).attr("y1",I).attr("y2",I)}})}_getBarWidth(){let{config:e,datamodel:{data:n}}=this;if(On(n))return 0;if(e.barWidth)return wt([e.barWidth,e.barMaxWidth]);let r=this.xScale.domain(),o=1+(r[1]-r[0])/e.dataStep||n.filter((c,l)=>{let u=L(c,e.x,l);return u>=r[0]&&u<=r[1]}).length||n.length;o>=2&&(o+=1);let s=(o<2?1:1-e.barPadding)*this._width/o;return wt([s,e.barMaxWidth])}_getVisibleData(){let{config:e,datamodel:{data:n}}=this,r=this.xScale.domain(),i=+r[0],o=+r[1];return n?.filter((a,s)=>{let c=L(a,e.x,s);return c>=i&&c<=o})}getValueScaleExtent(e){let{config:n,datamodel:r}=this,i=e?this._getVisibleData():r.data,o=[n.median,(a,s)=>K(a,n.quartiles,s)?.[0],(a,s)=>K(a,n.quartiles,s)?.[1],(a,s)=>K(a,n.whiskers,s)?.[0],(a,s)=>K(a,n.whiskers,s)?.[1]];return[Nn(i,...o),Pn(i,...o)]}getDataScaleExtent(){let{config:e,datamodel:n}=this;return ue(n.data,e.x)}getYDataExtent(e){return this.getValueScaleExtent(e)}getXDataExtent(){return this.getDataScaleExtent()}};ux.selectors=Vu;var fx=ux;var hx={...ct,color:t=>t.color,y:void 0,xPositioning:Ee.DataSpace,yPositioning:Ee.DataSpace,labelFontSize:void 0,label:void 0,backgroundColor:void 0,cursor:null,labelTextBrightnessRatio:.65,clustering:!0,clusterLabel:t=>t.length.toString(),clusterFontSize:void 0,clusterBackgroundColor:void 0,clusterCursor:void 0,clusterLabelColor:null};function px(t){t.attr("transform",e=>`translate(${e._screen.x},${e._screen.y})`),t.append("rect").style("fill",e=>e._screen.backgroundColor),t.append("text").style("text-anchor","middle").style("dominant-baseline","central").style("fill",e=>e._screen.backgroundColor).style("pointer-events","none"),t.attr("transform",e=>`translate(${e._screen.x},${e._screen.y}) scale(0)`)}function mx(t,e,n){t.each((r,i,o)=>{let a=W(o[i]),s=a.select("text"),c=a.select("rect"),l=r._screen.backgroundColor,u=r._screen.labelText??"",f=r._screen.fontSize,h=r._screen.labelColor,d=f*1.7,g=f*u.length*.7;if(g<d&&(g=d),R(c,n).attr("width",g).attr("height",d).attr("x",-g/2).attr("y",-d/2).attr("rx",f).attr("ry",f).style("fill",l),!h){let p=gt(Tr(l)?Qe(l,a.node()):l)?.hex();h=Sa(p)>e.labelTextBrightnessRatio?"var(--vis-xy-label-text-color-dark)":"var(--vis-xy-label-text-color-light)"}s.html(u).attr("font-size",f),R(s,n).style("fill",h),c.style("cursor",r._screen.cursor)}),R(t,n).attr("transform",r=>`translate(${r._screen.x},${r._screen.y}) scale(1)`)}function gx(t,e){R(t,e).attr("transform",n=>`translate(${n._screen.x},${n._screen.y}) scale(0)`).remove()}function dx(t,e,n){switch(e){case Ee.DataSpace:return n(t)??0;case Ee.AbsolutePx:return t;case Ee.AbsolutePercentage:{let r=n.range();return r[0]+(r[1]-r[0])*t/100}}}function Wu(t,e,n,r,i,o,a){let s={colorFn:a},c=Array.isArray(t),l=c?L(t,n.clusterFontSize)??te("var(--vis-xy-label-cluster-font-size)",e):L(t,n.labelFontSize)??te("var(--vis-xy-label-font-size)",e),u=(c?G(t,n.clusterLabel):G(t,n.label))||"",f=l*1.7,h=l*u.length*.7;h<f&&(h=f);let d=c?Bn(t,p=>p._screen.x):dx(L(t,n.x),K(t,n.xPositioning),r),g=c?Bn(t,p=>p._screen.y):dx(L(t,n.y),K(t,n.yPositioning),i);return{x:d,y:g,fontSize:l,labelText:u,labelColor:c?H(t,n.clusterLabelColor):H(t,n.color,o,n.colorKeys?.[o],s),backgroundColor:c?H(t,n.clusterBackgroundColor):H(t,n.backgroundColor,o,n.colorKeys?.[o],s),cursor:c?G(t,n.clusterCursor):G(t,n.cursor),width:h,height:f}}var Gu={};Rt(Gu,{cluster:()=>Hu,globalStyles:()=>Lw,label:()=>Yu,labelGroup:()=>zs,root:()=>$w});var Lw=lt`
427
+ stroke: var(${_e.boxplotWhiskerStrokeColor});
428
+ stroke-width: var(${_e.boxplotWhiskerStrokeWidth});
429
+ `;var wx=class extends ht{constructor(e){super(),this._defaultConfig=bx,this.config=this._defaultConfig,this.events={},this._boxData=[],this.setConfig(e)}get bleed(){if(this._boxData=this._getVisibleData(),this._boxData.length===0)return{top:0,bottom:0,left:0,right:0};let e=this.xScale.domain(),n=this._getBarWidth()/2,r=this._boxData.map((d,x)=>I(d,this.config.x,x)),i=Tt(r),o=xt(r),s=this.xScale(i),a=this.xScale(o),c=this.xScale.invert(s-n),l=this.xScale.invert(a+n),u=c<=e[0]?this.xScale(e[0])-this.xScale(c):0,f=l>e[1]?this.xScale(l)-this.xScale(e[1]):0,h=2;return{top:0,bottom:0,left:u+h,right:f+h}}_render(e){let{config:n}=this,r=U(e)?e:n.duration,i=this._getBarWidth();Pn(this._boxData)&&(this._boxData=this._getVisibleData());let o=this._boxData.map((f,h)=>({datum:f,index:h,median:I(f,n.median,h),quartiles:K(f,n.quartiles,h),whiskers:K(f,n.whiskers,h)})),s=this.g.selectAll(`.${qa}`).data(o,f=>`${q(f.datum,n.id,f.index)??f.index}`),a=f=>`translate(${this.xScale(I(f.datum,n.x,f.index))},0)`,c=s.enter().append("g").attr("class",qa).attr("transform",a).style("opacity",0);c.append("path").attr("class",ja),c.append("line").attr("class",Io).attr("data-end","lower"),c.append("line").attr("class",Io).attr("data-end","upper"),c.append("line").attr("class",Oo).attr("data-end","lower"),c.append("line").attr("class",Oo).attr("data-end","upper"),c.append("line").attr("class",Za),c.each((f,h,d)=>{this._renderBox(Y(d[h]),f,i,0)});let l=c.merge(s);D(l,r).attr("transform",a).style("opacity",1),s.each((f,h,d)=>{this._renderBox(Y(d[h]),f,i,r)});let u=s.exit().attr("class",Ku);D(u,r).style("opacity",0).remove().on("interrupt",function(){this.remove()})}_renderBox(e,n,r,i){let{config:o}=this,s=-r/2,a=r/2,c=Array.isArray(n.quartiles)&&Number.isFinite(n.quartiles[0])&&Number.isFinite(n.quartiles[1]),l=Number.isFinite(n.median),u=c&&Array.isArray(n.whiskers)&&Number.isFinite(n.whiskers[0])&&Number.isFinite(n.whiskers[1]),f=o.color?X(n.datum,o.color,n.index):null,h=e.select(`.${ja}`).style("fill",f).style("stroke",f),d=D(h,i).style("opacity",c?1:0);if(c){let y=this.yScale(n.quartiles[1]),m=this.yScale(n.quartiles[0]),_=Math.abs(m-y),w=o.roundedCorners?U(o.roundedCorners)?+o.roundedCorners:r/2:0,k=tt(w,0,Math.min(_,r)/2);d.attr("d",fi({x:s,y:Math.min(y,m),w:r,h:_,tl:!0,tr:!0,bl:!0,br:!0,r:k}))}let x=D(e.select(`.${Za}`).style("stroke",f),i).style("opacity",l?1:0);if(l){let y=this.yScale(n.median);x.attr("x1",s).attr("x2",s+r).attr("y1",y).attr("y2",y)}let p=u?this.yScale(n.whiskers[0]):0,g=u?this.yScale(n.whiskers[1]):0,v=c?this.yScale(n.quartiles[0]):0,b=c?this.yScale(n.quartiles[1]):0;e.selectAll(`.${Io}`).each((y,m,_)=>{let w=Y(_[m]).style("stroke",f),k=w.attr("data-end")==="lower",M=D(w,i).style("opacity",u?1:0);u&&M.attr("x1",0).attr("x2",0).attr("y1",k?v:b).attr("y2",k?p:g)}),e.selectAll(`.${Oo}`).each((y,m,_)=>{let w=Y(_[m]).style("stroke",f),k=w.attr("data-end")==="lower",M=D(w,i).style("opacity",u?1:0);if(u){let N=k?p:g;M.attr("x1",-a/2).attr("x2",a/2).attr("y1",N).attr("y2",N)}})}_getBarWidth(){let{config:e,datamodel:{data:n}}=this;if(Pn(n))return 0;if(e.barWidth)return Tt([e.barWidth,e.barMaxWidth]);let r=this.xScale.domain(),o=1+(r[1]-r[0])/e.dataStep||n.filter((c,l)=>{let u=I(c,e.x,l);return u>=r[0]&&u<=r[1]}).length||n.length;o>=2&&(o+=1);let a=(o<2?1:1-e.barPadding)*this._width/o;return Tt([a,e.barMaxWidth])}_getVisibleData(){let{config:e,datamodel:{data:n}}=this,r=this.xScale.domain(),i=+r[0],o=+r[1];return n?.filter((s,a)=>{let c=I(s,e.x,a);return c>=i&&c<=o})}getValueScaleExtent(e){let{config:n,datamodel:r}=this,i=e?this._getVisibleData():r.data,o=[n.median,(s,a)=>K(s,n.quartiles,a)?.[0],(s,a)=>K(s,n.quartiles,a)?.[1],(s,a)=>K(s,n.whiskers,a)?.[0],(s,a)=>K(s,n.whiskers,a)?.[1]];return[Fn(i,...o),zn(i,...o)]}getDataScaleExtent(){let{config:e,datamodel:n}=this;return fe(n.data,e.x)}getYDataExtent(e){return this.getValueScaleExtent(e)}getXDataExtent(){return this.getDataScaleExtent()}};wx.selectors=Qu;var Sx=wx;var kx={...ft,color:t=>t.color,y:void 0,xPositioning:Ee.DataSpace,yPositioning:Ee.DataSpace,labelFontSize:void 0,label:void 0,backgroundColor:void 0,cursor:null,labelTextBrightnessRatio:.65,clustering:!0,clusterLabel:t=>t.length.toString(),clusterFontSize:void 0,clusterBackgroundColor:void 0,clusterCursor:void 0,clusterLabelColor:null};function Ax(t){t.attr("transform",e=>`translate(${e._screen.x},${e._screen.y})`),t.append("rect").style("fill",e=>e._screen.backgroundColor),t.append("text").style("text-anchor","middle").style("dominant-baseline","central").style("fill",e=>e._screen.backgroundColor).style("pointer-events","none"),t.attr("transform",e=>`translate(${e._screen.x},${e._screen.y}) scale(0)`)}function Cx(t,e,n){t.each((r,i,o)=>{let s=Y(o[i]),a=s.select("text"),c=s.select("rect"),l=r._screen.backgroundColor,u=r._screen.labelText??"",f=r._screen.fontSize,h=r._screen.labelColor,d=f*1.7,x=f*u.length*.7;if(x<d&&(x=d),D(c,n).attr("width",x).attr("height",d).attr("x",-x/2).attr("y",-d/2).attr("rx",f).attr("ry",f).style("fill",l),!h){let p=vt(Rr(l)?Qe(l,s.node()):l)?.hex();h=Es(p)>e.labelTextBrightnessRatio?"var(--vis-xy-label-text-color-dark)":"var(--vis-xy-label-text-color-light)"}a.html(u).attr("font-size",f),D(a,n).style("fill",h),c.style("cursor",r._screen.cursor)}),D(t,n).attr("transform",r=>`translate(${r._screen.x},${r._screen.y}) scale(1)`)}function Mx(t,e){D(t,e).attr("transform",n=>`translate(${n._screen.x},${n._screen.y}) scale(0)`).remove()}function Tx(t,e,n){switch(e){case Ee.DataSpace:return n(t)??0;case Ee.AbsolutePx:return t;case Ee.AbsolutePercentage:{let r=n.range();return r[0]+(r[1]-r[0])*t/100}}}function Ju(t,e,n,r,i,o,s){let a={colorFn:s},c=Array.isArray(t),l=c?I(t,n.clusterFontSize)??Dt("var(--vis-xy-label-cluster-font-size)",e):I(t,n.labelFontSize)??Dt("var(--vis-xy-label-font-size)",e),u=(c?q(t,n.clusterLabel):q(t,n.label))||"",f=l*1.7,h=l*u.length*.7;h<f&&(h=f);let d=c?Bn(t,p=>p._screen.x):Tx(I(t,n.x),K(t,n.xPositioning),r),x=c?Bn(t,p=>p._screen.y):Tx(I(t,n.y),K(t,n.yPositioning),i);return{x:d,y:x,fontSize:l,labelText:u,labelColor:c?X(t,n.clusterLabelColor):X(t,n.color,o,n.colorKeys?.[o],a),backgroundColor:c?X(t,n.clusterBackgroundColor):X(t,n.backgroundColor,o,n.colorKeys?.[o],a),cursor:c?q(t,n.clusterCursor):q(t,n.cursor),width:h,height:f}}var nf={};Lt(nf,{cluster:()=>tf,globalStyles:()=>oS,label:()=>ef,labelGroup:()=>Ka,root:()=>sS});var oS=ut`
431
430
  :root {
432
431
  --vis-xy-label-cursor: default;
433
432
  // Undefined by default to allow proper fallback to var(--vis-color-main)
@@ -444,9 +443,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
444
443
  --vis-xy-label-text-color-light: #fff;
445
444
  --vis-xy-label-text-font-weight: 500;
446
445
  }
447
- `,$w=C`
446
+ `,sS=T`
448
447
  label: xy-labels-component;
449
- `,zs=C`
448
+ `,Ka=T`
450
449
  label: label-g;
451
450
 
452
451
  > rect, text {
@@ -469,13 +468,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
469
468
  stroke-width: var(--vis-xy-label-hover-stroke-width);
470
469
  }
471
470
  }
472
- `,Hu=C`
471
+ `,tf=T`
473
472
  label: cluster;
474
- `,Yu=C`
473
+ `,ef=T`
475
474
  label: label;
476
- `;var xx=class yx extends ut{constructor(e){super(),this.clippable=!1,this._defaultConfig=hx,this.config=this._defaultConfig,this.events={[yx.selectors.label]:{}},this.setConfig(e)}_render(e){let{config:n}=this,r=U(e)?e:n.duration,i=this.g.selectAll(`.${zs}`).data(this._getDataToRender()),o=i.exit();gx(o,r),i.enter().append("g").attr("class",zs).call(px).merge(i).classed(Hu,c=>!!c.records).classed(Yu,c=>!c.records).call(mx,n,r)}_getDataToRender(){let{config:e,datamodel:n}=this,r=this.xScale.range(),i=this.yScale.range(),o=n.data?.reduce((a,s,c)=>{let l=K(s,e.xPositioning),u=K(s,e.yPositioning),f=Wu(s,this.element,e,this.xScale,this.yScale,c,this._colorFunction);return(l!==Ee.DataSpace||bi(f.x,r))&&(u!==Ee.DataSpace||bi(f.y,i))&&a.push({...s,_screen:f}),a},[])??[];return e.clustering?this._getClusteredLabels(o):o}_getClusteredLabels(e){let n=[...e],r=new Map;for(let o=0;o<n.length;o+=1){let a=n[o];for(let s=o+1;s<n.length;s+=1){let c=n[s];Je(a._screen,c._screen)&&(r.has(a)||r.set(a,[a]),r.get(a).push(c),n.splice(s,1),s-=1)}r.has(a)&&(n.splice(o,1),o-=1)}let i=Array.from(r.values()).map(o=>({_screen:Wu(o,this.element,this.config,this.xScale,this.yScale,void 0,this._colorFunction),records:o}));return[...n,...i]}};xx.selectors=Gu;var vx=xx;var bx={[P.TopLeftOutside]:({startX:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAnchor:"end",dominantBaseline:"text-before-edge"}),[P.TopLeftInside]:({startX:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAnchor:"start",dominantBaseline:"text-before-edge"}),[P.TopOutside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[P.TopInside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[P.TopRightOutside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e+n,y:r,textAnchor:"start",dominantBaseline:"text-before-edge"}),[P.TopRightInside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e-n,y:r,textAnchor:"end",dominantBaseline:"text-before-edge"}),[P.RightOutside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e+r,y:n/2,textAnchor:"start",dominantBaseline:"middle"}),[P.RightInside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e-r,y:n/2,textAnchor:"end",dominantBaseline:"middle"}),[P.BottomRightOutside]:({startX:t,width:e,height:n,offsetX:r,offsetY:i})=>({x:t+e+r,y:n-i,textAnchor:"start",dominantBaseline:"text-after-edge"}),[P.BottomRightInside]:({startX:t,width:e,height:n,offsetX:r,offsetY:i})=>({x:t+e-r,y:n-i,textAnchor:"end",dominantBaseline:"text-after-edge"}),[P.BottomOutside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[P.BottomInside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[P.BottomLeftOutside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[P.BottomLeftInside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[P.LeftOutside]:({startX:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAnchor:"end",dominantBaseline:"middle"}),[P.LeftInside]:({startX:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAnchor:"start",dominantBaseline:"middle"})},_x={[P.TopLeftOutside]:({startX:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAnchor:"end",dominantBaseline:"text-after-edge"}),[P.TopLeftInside]:({startX:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAnchor:"end",dominantBaseline:"text-before-edge"}),[P.TopOutside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAnchor:"end",dominantBaseline:"middle"}),[P.TopInside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAnchor:"end",dominantBaseline:"middle"}),[P.TopRightOutside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e+n,y:r,textAnchor:"end",dominantBaseline:"text-before-edge"}),[P.TopRightInside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e-n,y:r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[P.RightOutside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e+r,y:n/2,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[P.RightInside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e-r,y:n/2,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[P.BottomRightOutside]:({startX:t,width:e,height:n,offsetX:r,offsetY:i})=>({x:t+e+r,y:n-i,textAnchor:"start",dominantBaseline:"text-before-edge"}),[P.BottomRightInside]:({startX:t,width:e,height:n,offsetX:r,offsetY:i})=>({x:t+e-r,y:n-i,textAnchor:"start",dominantBaseline:"text-after-edge"}),[P.BottomOutside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"start",dominantBaseline:"middle"}),[P.BottomInside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"start",dominantBaseline:"middle"}),[P.BottomLeftOutside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[P.BottomLeftInside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAnchor:"start",dominantBaseline:"text-before-edge"}),[P.LeftOutside]:({startX:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[P.LeftInside]:({startX:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAnchor:"middle",dominantBaseline:"text-before-edge"})},wx={[P.TopLeftOutside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t-n,textAnchor:"start",dominantBaseline:"text-after-edge"}),[P.TopLeftInside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t+n,textAnchor:"start",dominantBaseline:"text-before-edge"}),[P.TopOutside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[P.TopInside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n+r,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[P.TopRightOutside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t-r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[P.TopRightInside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t+r,textAnchor:"end",dominantBaseline:"text-before-edge"}),[P.RightOutside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAnchor:"end",dominantBaseline:"middle"}),[P.RightInside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAnchor:"end",dominantBaseline:"middle"}),[P.BottomRightOutside]:({startY:t,height:e,width:n,offsetX:r,offsetY:i})=>({x:n-r,y:t+e+i,textAnchor:"end",dominantBaseline:"text-before-edge"}),[P.BottomRightInside]:({startY:t,height:e,width:n,offsetX:r,offsetY:i})=>({x:n-r,y:t+e-i,textAnchor:"end",dominantBaseline:"text-after-edge"}),[P.BottomOutside]:({startX:t,width:e,startY:n,height:r,offsetY:i})=>({x:t+e/2,y:n+r+i,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[P.BottomInside]:({startX:t,width:e,startY:n,height:r,offsetY:i})=>({x:t+e/2,y:n+r-i,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[P.BottomLeftOutside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e+r,textAnchor:"start",dominantBaseline:"text-before-edge"}),[P.BottomLeftInside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[P.LeftOutside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAnchor:"start",dominantBaseline:"middle"}),[P.LeftInside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAnchor:"start",dominantBaseline:"middle"})},Sx={[P.TopLeftOutside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t-n,textAnchor:"start",dominantBaseline:"text-after-edge",rotation:-90}),[P.TopLeftInside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t+n,textAnchor:"end",dominantBaseline:"text-before-edge",rotation:-90}),[P.TopOutside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n-r,textAnchor:"end",dominantBaseline:"middle",rotation:-90}),[P.TopInside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n+r,textAnchor:"end",dominantBaseline:"middle",rotation:-90}),[P.TopRightOutside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t-r,textAnchor:"start",dominantBaseline:"text-after-edge",rotation:-90}),[P.TopRightInside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t+r,textAnchor:"end",dominantBaseline:"text-after-edge",rotation:-90}),[P.RightOutside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAnchor:"middle",dominantBaseline:"text-after-edge",rotation:-90}),[P.RightInside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAnchor:"middle",dominantBaseline:"text-after-edge",rotation:-90}),[P.BottomRightOutside]:({startY:t,height:e,width:n,offsetX:r,offsetY:i})=>({x:n-r,y:t+e+i,textAnchor:"start",dominantBaseline:"text-before-edge",rotation:-90}),[P.BottomRightInside]:({startY:t,height:e,width:n,offsetX:r,offsetY:i})=>({x:n-r,y:t+e-i,textAnchor:"start",dominantBaseline:"text-after-edge",rotation:-90}),[P.BottomOutside]:({startX:t,width:e,startY:n,height:r,offsetY:i})=>({x:t+e/2,y:n+r+i,textAnchor:"start",dominantBaseline:"middle",rotation:-90}),[P.BottomInside]:({startX:t,width:e,startY:n,height:r,offsetY:i})=>({x:t+e/2,y:n+r-i,textAnchor:"start",dominantBaseline:"middle",rotation:-90}),[P.BottomLeftOutside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e+r,textAnchor:"end",dominantBaseline:"text-before-edge",rotation:-90}),[P.BottomLeftInside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e-r,textAnchor:"start",dominantBaseline:"text-before-edge",rotation:-90}),[P.LeftOutside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAnchor:"middle",dominantBaseline:"text-before-edge",rotation:-90}),[P.LeftInside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAnchor:"middle",dominantBaseline:"text-before-edge",rotation:-90})};var kx={...ct,axis:Y.Y,from:0,to:0,color:void 0,duration:300,labelPosition:P.TopLeftOutside,labelOffsetX:14,labelOffsetY:14,labelOrientation:Cu.Horizontal};var qu={};Rt(qu,{globalStyles:()=>Iw,label:()=>Xu,plotband:()=>Uu,root:()=>Bw});var Iw=lt`
475
+ `;var Lx=class Rx extends ht{constructor(e){super(),this.clippable=!1,this._defaultConfig=kx,this.config=this._defaultConfig,this.events={[Rx.selectors.label]:{}},this.setConfig(e)}_render(e){let{config:n}=this,r=U(e)?e:n.duration,i=this.g.selectAll(`.${Ka}`).data(this._getDataToRender()),o=i.exit();Mx(o,r),i.enter().append("g").attr("class",Ka).call(Ax).merge(i).classed(tf,c=>!!c.records).classed(ef,c=>!c.records).call(Cx,n,r)}_getDataToRender(){let{config:e,datamodel:n}=this,r=this.xScale.range(),i=this.yScale.range(),o=n.data?.reduce((s,a,c)=>{let l=K(a,e.xPositioning),u=K(a,e.yPositioning),f=Ju(a,this.element,e,this.xScale,this.yScale,c,this._colorFunction);return(l!==Ee.DataSpace||Vn(f.x,r))&&(u!==Ee.DataSpace||Vn(f.y,i))&&s.push({...a,_screen:f}),s},[])??[];return e.clustering?this._getClusteredLabels(o):o}_getClusteredLabels(e){let n=[...e],r=new Map;for(let o=0;o<n.length;o+=1){let s=n[o];for(let a=o+1;a<n.length;a+=1){let c=n[a];Je(s._screen,c._screen)&&(r.has(s)||r.set(s,[s]),r.get(s).push(c),n.splice(a,1),a-=1)}r.has(s)&&(n.splice(o,1),o-=1)}let i=Array.from(r.values()).map(o=>({_screen:Ju(o,this.element,this.config,this.xScale,this.yScale,void 0,this._colorFunction),records:o}));return[...n,...i]}};Lx.selectors=nf;var Ex=Lx;function Qa(t,e,n,r=1/3){let i=n?t.y:t.x,o=i+(n?t.height:t.width),s=Math.min(...e),a=Math.max(...e),c=r*(a-s),l=1.2,u=tt(l*(s-i),0,c),f=tt(l*(o-a),0,c);return{top:n?u:0,bottom:n?f:0,left:n?0:u,right:n?0:f}}var Dx={[z.TopLeftOutside]:({startX:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAlign:C.Right,verticalAlign:L.Top}),[z.TopLeftInside]:({startX:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAlign:C.Left,verticalAlign:L.Top}),[z.TopOutside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAlign:C.Center,verticalAlign:L.Top}),[z.TopInside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAlign:C.Center,verticalAlign:L.Top}),[z.TopRightOutside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e+n,y:r,textAlign:C.Left,verticalAlign:L.Top}),[z.TopRightInside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e-n,y:r,textAlign:C.Right,verticalAlign:L.Top}),[z.RightOutside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e+r,y:n/2,textAlign:C.Left,verticalAlign:L.Middle}),[z.RightInside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e-r,y:n/2,textAlign:C.Right,verticalAlign:L.Middle}),[z.BottomRightOutside]:({startX:t,width:e,height:n,offsetX:r,offsetY:i})=>({x:t+e+r,y:n-i,textAlign:C.Left,verticalAlign:L.Bottom}),[z.BottomRightInside]:({startX:t,width:e,height:n,offsetX:r,offsetY:i})=>({x:t+e-r,y:n-i,textAlign:C.Right,verticalAlign:L.Bottom}),[z.BottomOutside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAlign:C.Center,verticalAlign:L.Bottom}),[z.BottomInside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAlign:C.Center,verticalAlign:L.Bottom}),[z.BottomLeftOutside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAlign:C.Right,verticalAlign:L.Bottom}),[z.BottomLeftInside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAlign:C.Left,verticalAlign:L.Bottom}),[z.LeftOutside]:({startX:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAlign:C.Right,verticalAlign:L.Middle}),[z.LeftInside]:({startX:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAlign:C.Left,verticalAlign:L.Middle})},$x={[z.TopLeftOutside]:({startX:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAlign:C.Right,verticalAlign:L.Bottom}),[z.TopLeftInside]:({startX:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAlign:C.Right,verticalAlign:L.Top}),[z.TopOutside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAlign:C.Right,verticalAlign:L.Middle}),[z.TopInside]:({startX:t,width:e,offsetY:n})=>({x:t+e/2,y:n,textAlign:C.Right,verticalAlign:L.Middle}),[z.TopRightOutside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e+n,y:r,textAlign:C.Right,verticalAlign:L.Top}),[z.TopRightInside]:({startX:t,width:e,offsetX:n,offsetY:r})=>({x:t+e-n,y:r,textAlign:C.Right,verticalAlign:L.Bottom}),[z.RightOutside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e+r,y:n/2,textAlign:C.Center,verticalAlign:L.Top}),[z.RightInside]:({startX:t,width:e,height:n,offsetX:r})=>({x:t+e-r,y:n/2,textAlign:C.Center,verticalAlign:L.Bottom}),[z.BottomRightOutside]:({startX:t,width:e,height:n,offsetX:r,offsetY:i})=>({x:t+e+r,y:n-i,textAlign:C.Left,verticalAlign:L.Top}),[z.BottomRightInside]:({startX:t,width:e,height:n,offsetX:r,offsetY:i})=>({x:t+e-r,y:n-i,textAlign:C.Left,verticalAlign:L.Bottom}),[z.BottomOutside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAlign:C.Left,verticalAlign:L.Middle}),[z.BottomInside]:({startX:t,width:e,height:n,offsetY:r})=>({x:t+e/2,y:n-r,textAlign:C.Left,verticalAlign:L.Middle}),[z.BottomLeftOutside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAlign:C.Left,verticalAlign:L.Bottom}),[z.BottomLeftInside]:({startX:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAlign:C.Left,verticalAlign:L.Top}),[z.LeftOutside]:({startX:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAlign:C.Center,verticalAlign:L.Bottom}),[z.LeftInside]:({startX:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAlign:C.Center,verticalAlign:L.Top})},Ix={[z.TopLeftOutside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t-n,textAlign:C.Left,verticalAlign:L.Bottom}),[z.TopLeftInside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t+n,textAlign:C.Left,verticalAlign:L.Top}),[z.TopOutside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n-r,textAlign:C.Center,verticalAlign:L.Bottom}),[z.TopInside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n+r,textAlign:C.Center,verticalAlign:L.Top}),[z.TopRightOutside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t-r,textAlign:C.Right,verticalAlign:L.Bottom}),[z.TopRightInside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t+r,textAlign:C.Right,verticalAlign:L.Top}),[z.RightOutside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAlign:C.Right,verticalAlign:L.Middle}),[z.RightInside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAlign:C.Right,verticalAlign:L.Middle}),[z.BottomRightOutside]:({startY:t,height:e,width:n,offsetX:r,offsetY:i})=>({x:n-r,y:t+e+i,textAlign:C.Right,verticalAlign:L.Top}),[z.BottomRightInside]:({startY:t,height:e,width:n,offsetX:r,offsetY:i})=>({x:n-r,y:t+e-i,textAlign:C.Right,verticalAlign:L.Bottom}),[z.BottomOutside]:({startX:t,width:e,startY:n,height:r,offsetY:i})=>({x:t+e/2,y:n+r+i,textAlign:C.Center,verticalAlign:L.Top}),[z.BottomInside]:({startX:t,width:e,startY:n,height:r,offsetY:i})=>({x:t+e/2,y:n+r-i,textAlign:C.Center,verticalAlign:L.Bottom}),[z.BottomLeftOutside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e+r,textAlign:C.Left,verticalAlign:L.Top}),[z.BottomLeftInside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e-r,textAlign:C.Left,verticalAlign:L.Bottom}),[z.LeftOutside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAlign:C.Left,verticalAlign:L.Middle}),[z.LeftInside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAlign:C.Left,verticalAlign:L.Middle})},Ox={[z.TopLeftOutside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t-n,textAlign:C.Left,verticalAlign:L.Bottom}),[z.TopLeftInside]:({startY:t,offsetX:e,offsetY:n})=>({x:e,y:t+n,textAlign:C.Right,verticalAlign:L.Top}),[z.TopOutside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n-r,textAlign:C.Right,verticalAlign:L.Middle}),[z.TopInside]:({startX:t,width:e,startY:n,offsetY:r})=>({x:t+e/2,y:n+r,textAlign:C.Right,verticalAlign:L.Middle}),[z.TopRightOutside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t-r,textAlign:C.Left,verticalAlign:L.Bottom}),[z.TopRightInside]:({startY:t,width:e,offsetX:n,offsetY:r})=>({x:e-n,y:t+r,textAlign:C.Right,verticalAlign:L.Bottom}),[z.RightOutside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAlign:C.Center,verticalAlign:L.Bottom}),[z.RightInside]:({startY:t,height:e,width:n,offsetX:r})=>({x:n-r,y:t+e/2,textAlign:C.Center,verticalAlign:L.Bottom}),[z.BottomRightOutside]:({startY:t,height:e,width:n,offsetX:r,offsetY:i})=>({x:n-r,y:t+e+i,textAlign:C.Left,verticalAlign:L.Top}),[z.BottomRightInside]:({startY:t,height:e,width:n,offsetX:r,offsetY:i})=>({x:n-r,y:t+e-i,textAlign:C.Left,verticalAlign:L.Bottom}),[z.BottomOutside]:({startX:t,width:e,startY:n,height:r,offsetY:i})=>({x:t+e/2,y:n+r+i,textAlign:C.Left,verticalAlign:L.Middle}),[z.BottomInside]:({startX:t,width:e,startY:n,height:r,offsetY:i})=>({x:t+e/2,y:n+r-i,textAlign:C.Left,verticalAlign:L.Middle}),[z.BottomLeftOutside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e+r,textAlign:C.Right,verticalAlign:L.Top}),[z.BottomLeftInside]:({startY:t,height:e,offsetX:n,offsetY:r})=>({x:n,y:t+e-r,textAlign:C.Left,verticalAlign:L.Top}),[z.LeftOutside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAlign:C.Center,verticalAlign:L.Top}),[z.LeftInside]:({startY:t,height:e,offsetX:n})=>({x:n,y:t+e/2,textAlign:C.Center,verticalAlign:L.Top})};var Nx={...ft,axis:G.Y,from:0,to:0,color:void 0,duration:300,labelPosition:z.TopLeftOutside,labelOffsetX:14,labelOffsetY:14,labelOrientation:Do.Horizontal};var sf={};Lt(sf,{globalStyles:()=>aS,label:()=>of,plotband:()=>rf,root:()=>lS});var aS=ut`
477
476
  :root {
478
477
  --vis-plotband-color: rgba(255, 255, 90, 0.2);
478
+ --vis-plotband-cursor: default;
479
479
  --vis-plotband-label-font-size: 12px;
480
480
  --vis-plotband-label-color: #000;
481
481
 
@@ -483,26 +483,25 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
483
483
  --vis-dark-plotband-label-color: #e5e9f7;
484
484
  }
485
485
 
486
- ${St} {
486
+ ${At} {
487
487
  --vis-plotband-color: var(--vis-dark-plotband-color);
488
488
  --vis-plotband-label-color: var(--vis-dark-tooltip-text-color);
489
489
  }
490
- `,Bw=C`
490
+ `,lS=T`
491
491
  label: plotband-component;
492
- `,Uu=C`
492
+ `,rf=T`
493
493
  label: plotband-area;
494
494
  transition: opacity 200ms;
495
- cursor: var(--vis-line-cursor);
495
+ cursor: var(--vis-plotband-cursor);
496
496
  fill: var(--vis-plotband-color);
497
- `,Xu=C`
498
- label: plotline-label;
497
+ `,of=T`
498
+ label: plotband-label;
499
499
 
500
500
  user-select: none;
501
- text-anchor: middle;
502
501
  pointer-events: none;
503
502
  font-size: var(--vis-plotband-label-font-size);
504
503
  fill: var(--vis-plotband-label-color);
505
- `;var Cx=class extends ut{constructor(e){super(),this._defaultConfig=kx,this.setConfig(e),this.plotband=this.g.append("rect").attr("class",Uu),this.label=this.g.append("text").attr("class",Xu)}_render(e){super._render(e);let{config:n}=this;if(this.from=n.from,this.to=n.to,this.plotband.style("fill",n.color),this.from==null||this.to==null)return;let r=0,i=0,o=0,a=0;if(n.axis==="y"){let s=this.yScale(this.from),c=this.yScale(this.to);i=Math.min(s,c),a=Math.abs(s-c),r=0,o=this._width}else{let s=this.xScale(this.from),c=this.xScale(this.to);r=Math.min(s,c),o=Math.abs(s-c),i=0,a=this._height}if(R(this.plotband,n.duration).attr("x",r).attr("y",i).attr("width",o).attr("height",a),n.labelText){let s=this.computeLabel(n.axis,r,i,o,a,n.labelPosition,n.labelOffsetX,n.labelOffsetY,n.labelOrientation);this.label.attr("dominant-baseline",s.dominantBaseline).attr("transform",s.transform).style("text-anchor",s.textAnchor).style("fill",n.labelColor).style("font-size",n.labelSize?`${n.labelSize}px`:void 0),R(this.label,n.duration).text(n.labelText).attr("x",s.x).attr("y",s.y)}R(this.plotband.exit()).style("opacity",0).remove()}computeLabel(e,n,r,i,o,a,s,c,l){let u=l==="vertical",f=u?-90:0,h={startX:n,startY:r,width:i,height:o,offsetX:s,offsetY:c},d;e===Y.X?d=(u?_x:bx)[a](h):d=(u?Sx:wx)[a](h);let{x:g,y:p,textAnchor:x,dominantBaseline:y}=d,b=f!==0?`rotate(${f}, ${g}, ${p})`:"";return{x:g,y:p,rotation:f,textAnchor:x,transform:b,dominantBaseline:y}}};Cx.selectors=qu;var Tx=Cx;var Ax={solid:"none",shortDash:"6,2",shortDot:"2,2",shortDashDot:"6,2,2,2",shortDashDotDot:"6,2,2,2,2,2",dot:"2,6",dash:"8,6",longDash:"16,6",dashDot:"8,6,2,6",longDashDot:"16,6,2,6",longDashDotDot:"16,6,2,6,2,6"},Mx={[Z.TopLeft]:({width:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAnchor:"end",dominantBaseline:"text-before-edge"}),[Z.Top]:({width:t,offsetY:e})=>({x:t,y:e,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[Z.TopRight]:({width:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAnchor:"start",dominantBaseline:"text-before-edge"}),[Z.Right]:({width:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAnchor:"start",dominantBaseline:"middle"}),[Z.BottomRight]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[Z.Bottom]:({width:t,height:e,offsetY:n})=>({x:t,y:e-n,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[Z.BottomLeft]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[Z.Left]:({width:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAnchor:"end",dominantBaseline:"middle"})},Dx={[Z.TopLeft]:({width:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAnchor:"end",dominantBaseline:"text-after-edge"}),[Z.Top]:({width:t,offsetY:e})=>({x:t,y:e,textAnchor:"end",dominantBaseline:"middle"}),[Z.TopRight]:({width:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAnchor:"end",dominantBaseline:"text-before-edge"}),[Z.Right]:({width:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[Z.BottomRight]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAnchor:"start",dominantBaseline:"text-before-edge"}),[Z.Bottom]:({width:t,height:e,offsetY:n})=>({x:t,y:e-n,textAnchor:"start",dominantBaseline:"middle"}),[Z.BottomLeft]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[Z.Left]:({width:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAnchor:"middle",dominantBaseline:"text-after-edge"})},Rx={[Z.TopLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e-n,textAnchor:"start",dominantBaseline:"text-after-edge"}),[Z.Top]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e-n,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[Z.TopRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n-r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[Z.Right]:({width:t,offsetX:e,height:n})=>({x:t-e,y:n,textAnchor:"end",dominantBaseline:"middle"}),[Z.BottomRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n+r,textAnchor:"end",dominantBaseline:"text-before-edge"}),[Z.Bottom]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e+n,textAnchor:"middle",dominantBaseline:"text-before-edge"}),[Z.BottomLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e+n,textAnchor:"start",dominantBaseline:"text-before-edge"}),[Z.Left]:({offsetX:t,height:e})=>({x:t,y:e,textAnchor:"start",dominantBaseline:"middle"})},Ex={[Z.TopLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e-n,textAnchor:"start",dominantBaseline:"text-before-edge"}),[Z.Top]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e-n,textAnchor:"start",dominantBaseline:"central"}),[Z.TopRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n-r,textAnchor:"start",dominantBaseline:"text-after-edge"}),[Z.Right]:({width:t,offsetX:e,height:n})=>({x:t-e,y:n,textAnchor:"middle",dominantBaseline:"text-after-edge"}),[Z.BottomRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n+r,textAnchor:"end",dominantBaseline:"text-after-edge"}),[Z.Bottom]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e+n,textAnchor:"end",dominantBaseline:"central"}),[Z.BottomLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e+n,textAnchor:"end",dominantBaseline:"text-before-edge"}),[Z.Left]:({offsetX:t,height:e})=>({x:t,y:e,textAnchor:"middle",dominantBaseline:"text-before-edge"})};var Lx={...ct,lineWidth:2,axis:Y.Y,value:0,duration:300,color:void 0,lineStyle:ku.Solid,labelPosition:Z.TopRight,labelOffsetX:14,labelOffsetY:14,labelOrientation:Mo.Horizontal};var Ku={};Rt(Ku,{globalStyles:()=>Ow,label:()=>ju,plotline:()=>Zu,root:()=>Nw});var Ow=lt`
504
+ `;var Bx=class extends ht{constructor(e){super(),this._defaultConfig=Nx,this.setConfig(e),this.plotband=this.g.append("rect").attr("class",rf),this.labelGroup=this.g.append("g"),this.label=this.labelGroup.append("text").attr("class",of)}get bleed(){let{config:e}=this,n={top:0,bottom:0,left:0,right:0},r=this._getLabelTextBlocks();if(!r.length||!U(e.from)||!U(e.to))return n;let i=this._getVisibleBandRect();if(!i)return n;let o=e.axis===G.Y,s=o?this.yScale:this.xScale;return Qa(this._getLabelBBox(this._getLabelLayout(i),r),s.range(),o)}_render(e){super._render(e);let{config:n}=this,r=U(e)?e:n.duration;this.from=n.from,this.to=n.to,this.plotband.style("fill",n.color);let i=U(this.from)&&U(this.to);if(this.g.style("display",i?null:"none"),!i)return;let{x:o,y:s,width:a,height:c}=this._getBandRect();D(this.plotband,r).attr("x",o).attr("y",s).attr("width",a).attr("height",c);let l=this._getVisibleBandRect(),u=this._getLabelTextBlocks();if(u.length&&l){let f=this._getLabelLayout(l),h=fs(this._getLabelBBox(f,u),{x:0,y:0,width:this._width,height:this._height});ni(this.label.node(),u,{x:0,y:0,textAlign:f.textAlign,verticalAlign:f.verticalAlign,fastMode:!1},"hanging"),D(this.labelGroup,r).attr("transform",`translate(${f.x+h.dx},${f.y+h.dy}) rotate(${f.rotation})`)}else this.label.text(null)}_getLabelFontSize(){let{config:e}=this;return e.labelSize||Dt("var(--vis-plotband-label-font-size)",this.element)||Sn}_getLabelBBox(e,n){let r=or(n,void 0,void 0,!1),i=aa(r,e.textAlign,e.verticalAlign,e.rotation);return{...i,x:e.x+i.x,y:e.y+i.y}}_getLabelTextBlocks(){let{config:e}=this;if(!e.labelText)return[];let n={fontSize:this._getLabelFontSize(),fontFamily:ia(this.label.node()),color:e.labelColor};return(gn(e.labelText)?[{...n,text:e.labelText}]:(mt(e.labelText)?e.labelText:[e.labelText]).map(i=>({...n,...i}))).filter(i=>i.text)}_getBandRect(){let{config:e}=this;if(e.axis===G.Y){let i=this.yScale(e.from),o=this.yScale(e.to);return{x:0,y:Math.min(i,o),width:this._width,height:Math.abs(i-o)}}let n=this.xScale(e.from),r=this.xScale(e.to);return{x:Math.min(n,r),y:0,width:Math.abs(n-r),height:this._height}}_getVisibleBandRect(){let{config:e}=this,n=e.axis===G.Y,r=n?this.yScale:this.xScale,i=Math.min(...r.range()),o=Math.max(...r.range()),s=this._getBandRect(),a=n?s.y:s.x,c=a+(n?s.height:s.width);if(!isFinite(a)||!isFinite(c)||c<i||a>o)return null;let l=tt(a,i,o),u=tt(c,i,o);return n?{...s,y:l,height:u-l}:{...s,x:l,width:u-l}}_getLabelLayout(e){let{config:n}=this;return this.computeLabel(n.axis,e.x,e.y,e.width,e.height,n.labelPosition,n.labelOffsetX,n.labelOffsetY,n.labelOrientation)}computeLabel(e,n,r,i,o,s,a,c,l){let u=l===Do.Vertical,f=u?-90:0,h={startX:n,startY:r,width:i,height:o,offsetX:a,offsetY:c},d=e===G.X?u?$x:Dx:u?Ox:Ix;return{...(Object.prototype.hasOwnProperty.call(d,s)?d[s]:d[z.TopLeftOutside])(h),rotation:f}}};Bx.selectors=sf;var Px=Bx;var Fx={solid:"none",shortDash:"6,2",shortDot:"2,2",shortDashDot:"6,2,2,2",shortDashDotDot:"6,2,2,2,2,2",dot:"2,6",dash:"8,6",longDash:"16,6",dashDot:"8,6,2,6",longDashDot:"16,6,2,6",longDashDotDot:"16,6,2,6,2,6"},zx={[Q.TopLeft]:({width:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAlign:C.Right,verticalAlign:L.Top}),[Q.Top]:({width:t,offsetY:e})=>({x:t,y:e,textAlign:C.Center,verticalAlign:L.Top}),[Q.TopRight]:({width:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAlign:C.Left,verticalAlign:L.Top}),[Q.Right]:({width:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAlign:C.Left,verticalAlign:L.Middle}),[Q.BottomRight]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAlign:C.Left,verticalAlign:L.Bottom}),[Q.Bottom]:({width:t,height:e,offsetY:n})=>({x:t,y:e-n,textAlign:C.Center,verticalAlign:L.Bottom}),[Q.BottomLeft]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAlign:C.Right,verticalAlign:L.Bottom}),[Q.Left]:({width:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAlign:C.Right,verticalAlign:L.Middle})},Vx={[Q.TopLeft]:({width:t,offsetX:e,offsetY:n})=>({x:t-e,y:n,textAlign:C.Right,verticalAlign:L.Bottom}),[Q.Top]:({width:t,offsetY:e})=>({x:t,y:e,textAlign:C.Right,verticalAlign:L.Middle}),[Q.TopRight]:({width:t,offsetX:e,offsetY:n})=>({x:t+e,y:n,textAlign:C.Right,verticalAlign:L.Top}),[Q.Right]:({width:t,height:e,offsetX:n})=>({x:t+n,y:e/2,textAlign:C.Center,verticalAlign:L.Top}),[Q.BottomRight]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t+n,y:e-r,textAlign:C.Left,verticalAlign:L.Top}),[Q.Bottom]:({width:t,height:e,offsetY:n})=>({x:t,y:e-n,textAlign:C.Left,verticalAlign:L.Middle}),[Q.BottomLeft]:({width:t,height:e,offsetX:n,offsetY:r})=>({x:t-n,y:e-r,textAlign:C.Left,verticalAlign:L.Bottom}),[Q.Left]:({width:t,height:e,offsetX:n})=>({x:t-n,y:e/2,textAlign:C.Center,verticalAlign:L.Bottom})},Wx={[Q.TopLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e-n,textAlign:C.Left,verticalAlign:L.Bottom}),[Q.Top]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e-n,textAlign:C.Center,verticalAlign:L.Bottom}),[Q.TopRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n-r,textAlign:C.Right,verticalAlign:L.Bottom}),[Q.Right]:({width:t,offsetX:e,height:n})=>({x:t-e,y:n,textAlign:C.Right,verticalAlign:L.Middle}),[Q.BottomRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n+r,textAlign:C.Right,verticalAlign:L.Top}),[Q.Bottom]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e+n,textAlign:C.Center,verticalAlign:L.Top}),[Q.BottomLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e+n,textAlign:C.Left,verticalAlign:L.Top}),[Q.Left]:({offsetX:t,height:e})=>({x:t,y:e,textAlign:C.Left,verticalAlign:L.Middle})},Hx={[Q.TopLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e-n,textAlign:C.Left,verticalAlign:L.Top}),[Q.Top]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e-n,textAlign:C.Left,verticalAlign:L.Middle}),[Q.TopRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n-r,textAlign:C.Left,verticalAlign:L.Bottom}),[Q.Right]:({width:t,offsetX:e,height:n})=>({x:t-e,y:n,textAlign:C.Center,verticalAlign:L.Bottom}),[Q.BottomRight]:({width:t,offsetX:e,height:n,offsetY:r})=>({x:t-e,y:n+r,textAlign:C.Right,verticalAlign:L.Bottom}),[Q.Bottom]:({width:t,height:e,offsetY:n})=>({x:t/2,y:e+n,textAlign:C.Right,verticalAlign:L.Middle}),[Q.BottomLeft]:({offsetX:t,height:e,offsetY:n})=>({x:t,y:e+n,textAlign:C.Right,verticalAlign:L.Top}),[Q.Left]:({offsetX:t,height:e})=>({x:t,y:e,textAlign:C.Center,verticalAlign:L.Top})};var Yx={...ft,lineWidth:2,axis:G.Y,value:0,duration:300,color:void 0,lineStyle:Nu.Solid,labelPosition:Q.TopRight,labelOffsetX:14,labelOffsetY:14,labelOrientation:Eo.Horizontal};var cf={};Lt(cf,{globalStyles:()=>cS,label:()=>lf,plotline:()=>af,root:()=>uS});var cS=ut`
506
505
  :root {
507
506
  --vis-plotline-color: rgb(226, 32, 58);
508
507
  --vis-plotline-width: 2;
@@ -514,12 +513,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
514
513
  --vis-dark-plotline-label-color: #e5e9f7;
515
514
  }
516
515
 
517
- ${St} {
516
+ ${At} {
518
517
  --vis-plotline-label-color: var(--vis-dark-tooltip-text-color);
519
518
  }
520
- `,Nw=C`
519
+ `,uS=T`
521
520
  label: plotline-component;
522
- `,Zu=C`
521
+ `,af=T`
523
522
  label: plotline;
524
523
  transition: opacity 200ms;
525
524
  stroke-linecap: round;
@@ -528,16 +527,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
528
527
  stroke-width: var(--vis-plotline-width);
529
528
  stroke-dasharray: var(--vis-plotline-dasharray);
530
529
  stroke-dashoffset: var(--vis-plotline-stroke-dashoffset);
531
- `,ju=C`
530
+ `,lf=T`
532
531
  label: plotline-label;
533
- text-anchor: middle;
534
- /* dominant-baseline: middle; */
535
532
  pointer-events: none;
536
533
  font-size: var(--vis-plotline-label-font-size);
537
534
  fill: var(--vis-plotline-label-color);
538
- `;var $x=class extends ut{constructor(e){super(),this._defaultConfig=Lx,this.setConfig(e),this.plotline=this.g.append("line").attr("class",Zu),this.label=this.g.append("text").attr("class",ju)}_render(e){super._render(e);let{config:n}=this;this.value=n.value;let r;typeof n?.lineStyle=="string"?r=Ax[n.lineStyle]:Array.isArray(n.lineStyle)?r=n.lineStyle.join(","):r="none",this.value=n.value,this.plotline.attr("stroke-opacity",1).style("stroke-width",n.lineWidth).style("stroke-dasharray",r).style("stroke",n.color);let i=0,o=0,a=0,s=0;if(n.axis===Y.Y?(a=this.yScale(this.value),s=this.yScale(this.value),i=0,o=this._width):(a=0,s=this._height,i=this.xScale(this.value),o=this.xScale(this.value)),R(this.plotline,n.duration).attr("x1",i).attr("x2",o).attr("y1",a).attr("y2",s),n.labelText){let c=this.computeLabel(n.axis,o,s,n.labelPosition,n.labelOffsetX,n.labelOffsetY,n.labelOrientation);this.label.text(n.labelText).attr("transform",c.transform).attr("dominant-baseline",c.dominantBaseline).style("fill",n.labelColor).style("text-anchor",c.textAnchor).style("font-size",n.labelSize?`${n.labelSize}px`:void 0),R(this.label,n.duration).attr("x",c.x).attr("y",c.y)}R(this.plotline.exit()).style("opacity",0).remove()}computeLabel(e,n,r,i,o,a,s){let c=s===Mo.Vertical,l=c?-90:0,u;e===Y.X?u=(c?Dx:Mx)[i]({width:n,height:r,offsetX:o,offsetY:a}):u=(c?Ex:Rx)[i]({width:n,height:r,offsetX:o,offsetY:a});let f=l?`rotate(${l}, ${u.x}, ${u.y})`:"";return{...u,rotation:l,transform:f}}};$x.selectors=Ku;var Ix=$x;var Bx={...Ye,id:(t,e)=>t.id??e,value:void 0,angleRange:[0,2*Math.PI],padAngle:0,minSegmentAngle:void 0,sortFunction:void 0,cornerRadius:0,color:void 0,pattern:void 0,radius:void 0,arcWidth:20,centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,showEmptySegments:!1,emptySegmentAngle:.5*Math.PI/180,showBackground:!0,backgroundAngleRange:void 0,centralLabelOffsetX:void 0,centralLabelOffsetY:void 0};function Ox(t,e){t.attr(dt,n=>n.index).style("fill",n=>H(n.data,e.color,n.index)).style("mask",n=>yt(ft(n.data,e.pattern,n.index))).style("opacity",0).each((n,r,i)=>{let o=i[r],a=(n.startAngle+n.endAngle)/2,s=(n.endAngle-n.startAngle)/2;o._animState={startAngle:a-s,endAngle:a+s,innerRadius:n.innerRadius,outerRadius:n.outerRadius,padAngle:n.padAngle}})}function Nx(t,e,n,r){t.style("transition",`fill ${r}ms`).attr(dt,o=>o.index).style("fill",o=>H(o.data,e.color,o.index)).style("mask",o=>yt(ft(o.data,e.pattern,o.index)));let i=o=>e.showEmptySegments||o.value?1:0;r?R(t,r).style("opacity",i).attrTween("d",(a,s,c)=>{let l=c[s],u={startAngle:a.startAngle,endAngle:a.endAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,padAngle:a.padAngle},f=kt(l._animState,u);return h=>(l._animState=f(h),n(l._animState))}):t.attr("d",n).style("opacity",i)}function Px(t,e){R(t,e).style("opacity",0).remove()}function Fx(t,e,n){if(!t.length)return;let r=t[0].padAngle,o=n[1]-n[0]-t.length*r,a=e-r;if(o<=0||a<=0)return;let s=t.filter(x=>x.value>0),c=x=>s.reduce((y,b)=>x.has(b)?y:y+b.value,0),l=new Set,u=!0;for(;u;){u=!1;let x=o-l.size*a,y=c(l);for(let b of s){if(l.has(b))continue;(y>0?x*b.value/y:0)<a&&(l.add(b),u=!0)}}if(!l.size)return;let f=Math.min(a,o/l.size),h=o-l.size*f,d=c(l),g=[...t].sort((x,y)=>x.startAngle-y.startAngle),p=n[0];for(let x of g){let y=l.has(x)?f:x.value>0?h*x.value/d:0;x.startAngle=p,x.endAngle=p+y+r,p=x.endAngle}}var Qu=Array.from({length:4},(t,e)=>{let n=-Math.PI/2+e*Math.PI/2;return[n,n+Math.PI]}),[cW,uW,fW,hW]=Qu;var rf={};Rt(rf,{background:()=>Ju,centralLabel:()=>ef,centralSubLabel:()=>nf,root:()=>zx,segment:()=>Vs,segmentExit:()=>tf,variables:()=>Pw});var zx=C`
535
+ `;var Gx=class extends ht{constructor(e){super(),this._defaultConfig=Yx,this.setConfig(e),this.plotline=this.g.append("line").attr("class",af),this.labelGroup=this.g.append("g"),this.label=this.labelGroup.append("text").attr("class",lf)}get bleed(){let{config:e}=this,n=this._getLabelTextBlocks();if(!n.length||!this._isValueWithinDomain())return{top:0,bottom:0,left:0,right:0};let r=e.axis===G.Y,i=r?this.yScale:this.xScale;return Qa(this._getLabelBBox(this._getLabelLayout(),n),i.range(),r)}_render(e){super._render(e);let{config:n}=this,r=U(e)?e:n.duration;this.value=n.value;let i=U(this.value);if(this.g.style("display",i?null:"none"),!i)return;let o=gn(n.lineStyle)?Fx[n.lineStyle]:mt(n.lineStyle)?n.lineStyle.join(","):"none";this.plotline.attr("stroke-opacity",1).style("stroke-width",n.lineWidth).style("stroke-dasharray",o).style("stroke",n.color);let{x1:s,y1:a,x2:c,y2:l}=this._getLineCoordinates();D(this.plotline,r).attr("x1",s).attr("x2",c).attr("y1",a).attr("y2",l);let u=this._getLabelTextBlocks();if(u.length&&this._isValueWithinDomain()){let f=this._getLabelLayout(),h=fs(this._getLabelBBox(f,u),{x:0,y:0,width:this._width,height:this._height});ni(this.label.node(),u,{x:0,y:0,textAlign:f.textAlign,verticalAlign:f.verticalAlign,fastMode:!1},"hanging"),D(this.labelGroup,r).attr("transform",`translate(${f.x+h.dx},${f.y+h.dy}) rotate(${f.rotation})`)}else this.label.text(null)}_isValueWithinDomain(){let{config:e}=this,r=(e.axis===G.Y?this.yScale:this.xScale).domain();return U(e.value)&&Vn(e.value,r)}_getLineCoordinates(){let{config:e}=this;if(e.axis===G.Y){let r=this.yScale(e.value);return{x1:0,y1:r,x2:this._width,y2:r}}let n=this.xScale(e.value);return{x1:n,y1:0,x2:n,y2:this._height}}_getLabelFontSize(){let{config:e}=this;return e.labelSize||Dt("var(--vis-plotline-label-font-size)",this.element)||Sn}_getLabelTextBlocks(){let{config:e}=this;if(!e.labelText)return[];let n={fontSize:this._getLabelFontSize(),fontFamily:ia(this.label.node()),color:e.labelColor};return(gn(e.labelText)?[{...n,text:e.labelText}]:(mt(e.labelText)?e.labelText:[e.labelText]).map(i=>({...n,...i}))).filter(i=>i.text)}_getLabelBBox(e,n){let r=or(n,void 0,void 0,!1),i=aa(r,e.textAlign,e.verticalAlign,e.rotation);return{...i,x:e.x+i.x,y:e.y+i.y}}_getLabelLayout(){let{config:e}=this,n=e.axis===G.Y;return this.computeLabel(e.axis,n?this._width:this.xScale(e.value),n?this.yScale(e.value):this._height,e.labelPosition,e.labelOffsetX,e.labelOffsetY,e.labelOrientation)}computeLabel(e,n,r,i,o,s,a){let c=a===Eo.Vertical,l=c?-90:0,u=e===G.X?c?Vx:zx:c?Hx:Wx;return{...(Object.prototype.hasOwnProperty.call(u,i)?u[i]:u[Q.TopRight])({width:n,height:r,offsetX:o,offsetY:s}),rotation:l}}};Gx.selectors=cf;var Ux=Gx;var Xx={...Ue,id:(t,e)=>t.id??e,value:void 0,angleRange:[0,2*Math.PI],padAngle:0,minSegmentAngle:void 0,sortFunction:void 0,cornerRadius:0,color:void 0,pattern:void 0,radius:void 0,arcWidth:20,centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,showEmptySegments:!1,emptySegmentAngle:.5*Math.PI/180,showBackground:!0,backgroundAngleRange:void 0,centralLabelOffsetX:void 0,centralLabelOffsetY:void 0};function qx(t,e){t.attr(gt,n=>n.index).style("fill",n=>X(n.data,e.color,n.index)).style("mask",n=>_t(dt(n.data,e.pattern,n.index))).style("opacity",0).each((n,r,i)=>{let o=i[r],s=(n.startAngle+n.endAngle)/2,a=(n.endAngle-n.startAngle)/2;o._animState={startAngle:s-a,endAngle:s+a,innerRadius:n.innerRadius,outerRadius:n.outerRadius,padAngle:n.padAngle}})}function jx(t,e,n,r){t.style("transition",`fill ${r}ms`).attr(gt,o=>o.index).style("fill",o=>X(o.data,e.color,o.index)).style("mask",o=>_t(dt(o.data,e.pattern,o.index)));let i=o=>e.showEmptySegments||o.value?1:0;r?D(t,r).style("opacity",i).attrTween("d",(s,a,c)=>{let l=c[a],u={startAngle:s.startAngle,endAngle:s.endAngle,innerRadius:s.innerRadius,outerRadius:s.outerRadius,padAngle:s.padAngle},f=Ct(l._animState,u);return h=>(l._animState=f(h),n(l._animState))}):t.attr("d",n).style("opacity",i)}function Zx(t,e){D(t,e).style("opacity",0).remove()}function Kx(t,e,n){if(!t.length)return;let r=t[0].padAngle,o=n[1]-n[0]-t.length*r,s=e-r;if(o<=0||s<=0)return;let a=t.filter(g=>g.value>0),c=g=>a.reduce((v,b)=>g.has(b)?v:v+b.value,0),l=new Set,u=!0;for(;u;){u=!1;let g=o-l.size*s,v=c(l);for(let b of a){if(l.has(b))continue;(v>0?g*b.value/v:0)<s&&(l.add(b),u=!0)}}if(!l.size)return;let f=Math.min(s,o/l.size),h=o-l.size*f,d=c(l),x=[...t].sort((g,v)=>g.startAngle-v.startAngle),p=n[0];for(let g of x){let v=l.has(g)?f:g.value>0?h*g.value/d:0;g.startAngle=p,g.endAngle=p+v+r,p=g.endAngle}}var uf=Array.from({length:4},(t,e)=>{let n=-Math.PI/2+e*Math.PI/2;return[n,n+Math.PI]}),[e3,n3,r3,i3]=uf;var mf={};Lt(mf,{background:()=>ff,centralLabel:()=>df,centralSubLabel:()=>pf,root:()=>Qx,segment:()=>Ja,segmentExit:()=>hf,variables:()=>fS});var Qx=T`
539
536
  label: donut-component;
540
- `,Pw=lt`
537
+ `,fS=ut`
541
538
  :root {
542
539
  --vis-donut-central-label-font-size: 16px;
543
540
  --vis-donut-central-label-text-color: #5b5f6d;
@@ -562,21 +559,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
562
559
  --vis-dark-donut-background-color: #18160C;
563
560
  }
564
561
 
565
- ${St} ${`.${zx}`} {
562
+ ${At} ${`.${Qx}`} {
566
563
  --vis-donut-central-label-text-color: var(--vis-dark-donut-central-label-text-color);
567
564
  --vis-donut-central-sub-label-text-color: var(--vis-dark-donut-central-sub-label-text-color);
568
565
  --vis-donut-background-color: var(--vis-dark-donut-background-color);
569
566
  }
570
- `,Ju=C`
567
+ `,ff=T`
571
568
  label: background;
572
569
  fill: var(--vis-donut-background-color);
573
- `,Vs=C`
570
+ `,Ja=T`
574
571
  label: segment;
575
572
  stroke-width: var(--vis-donut-segment-stroke-width);
576
573
  stroke: var(--vis-donut-segment-stroke-color, var(--vis-donut-background-color));
577
- `,tf=C`
574
+ `,hf=T`
578
575
  label: segment-exit;
579
- `,ef=C`
576
+ `,df=T`
580
577
  label: central-label;
581
578
  text-anchor: middle;
582
579
  dominant-baseline: middle;
@@ -584,7 +581,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
584
581
  font-family: var(--vis-donut-central-label-font-family, var(--vis-font-family));
585
582
  font-weight: var(--vis-donut-central-label-font-weight);
586
583
  fill: var(--vis-donut-central-label-text-color);
587
- `,nf=C`
584
+ `,pf=T`
588
585
  label: central-label;
589
586
  text-anchor: middle;
590
587
  dominant-baseline: middle;
@@ -592,30 +589,30 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
592
589
  font-family: var(--vis-donut-central-sub-label-font-family, var(--vis-font-family));
593
590
  font-weight: var(--vis-donut-central-sub-label-font-weight);
594
591
  fill: var(--vis-donut-central-sub-label-text-color);
595
- `;var Vx=class extends Ge{constructor(e){super(),this._defaultConfig=Bx,this.config=this._defaultConfig,this.datamodel=new Ue,this.arcGen=or(),this.events={},this._firstRender=!0,this.setConfig(e),this.arcBackground=this.g.append("path"),this.arcGroup=this.g.append("g"),this.centralLabel=this.g.append("text").attr("class",ef),this.centralSubLabel=this.g.append("text").attr("class",nf)}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e){let{config:n,datamodel:r,bleed:i}=this,o=r.data.map((F,q)=>({index:q,datum:F})).filter(F=>n.showEmptySegments||L(F.datum,n.value,F.index)),a=U(e)?e:n.duration,[s,c,l,u]=Qu.map(F=>n.angleRange&&n.angleRange[0]===F[0]&&n.angleRange[1]===F[1]),f=s||l,h=c||u,d=this._width*(h?2:1),g=this._height*(f?2:1),p=n.radius||Math.min(d-i.left-i.right,g-i.top-i.bottom)/2,x=n.arcWidth===0?0:it(p-n.arcWidth,0,p-1),y=this._height/2+(s?p/2:l?-p/2:0),b=this._width/2+(u?p/2:c?-p/2:0),v=`translate(${b},${y})`,m=this._firstRender?0:a;R(this.arcGroup,m).attr("transform",v),this.arcGen.startAngle(F=>F.startAngle).endAngle(F=>F.endAngle).innerRadius(F=>F.innerRadius).outerRadius(F=>F.outerRadius).padAngle(F=>F.padAngle).cornerRadius(n.cornerRadius);let w=mo().startAngle(n.angleRange?.[0]??0).endAngle(n.angleRange?.[1]??2*Math.PI).padAngle(n.padAngle).value(F=>L(F.datum,n.value,F.index)||0).sort((F,q)=>n.sortFunction?.(F.datum,q.datum))(o);U(n.minSegmentAngle)&&Fx(w,n.minSegmentAngle,[n.angleRange?.[0]??0,n.angleRange?.[1]??2*Math.PI]);let k=w.map(F=>{let q={...F,data:F.data.datum,index:F.data.index,innerRadius:x,outerRadius:p};return n.showEmptySegments&&F.endAngle-F.startAngle-F.padAngle<=Number.EPSILON&&(q.endAngle=F.startAngle+Math.max(n.emptySegmentAngle,n.padAngle),q.padAngle=F.padAngle/2),q}),A=this.arcGroup.selectAll(`.${Vs}`).data(k,F=>n.id(F.data,F.index)),I=A.enter().append("path").attr("class",Vs).call(Ox,n),O=A.merge(I);O.call(Nx,n,this.arcGen,a),O.sort((F,q)=>q.value-F.value),A.exit().attr("class",tf).call(Px,a);let N=c?"start":u?"end":"middle";this.centralLabel.attr("dy",n.centralSubLabel?"-0.55em":null).style("text-anchor",N).text(n.centralLabel??null),this.centralSubLabel.attr("dy",n.centralLabel?"0.55em":null).style("text-anchor",N).text(n.centralSubLabel??null),n.centralSubLabelWrap&&qe(this.centralSubLabel,x*1.9);let M=(n.centralLabelOffsetX||0)+b,E=(n.centralLabelOffsetY||0)+y;f&&n.centralLabelOffsetX===void 0&&n.centralLabelOffsetY===void 0&&(E=(s?-this.centralSubLabel.node().getBoundingClientRect().height:l?this.centralLabel.node().getBoundingClientRect().height:0)+y);let B=`translate(${M},${E})`;R(this.centralLabel,m).attr("transform",B),R(this.centralSubLabel,m).attr("transform",B),this.arcBackground.attr("class",Ju).attr("visibility",n.showBackground?null:"hidden");let Q={startAngle:n.backgroundAngleRange?.[0]??n.angleRange?.[0]??0,endAngle:n.backgroundAngleRange?.[1]??n.angleRange?.[1]??2*Math.PI,innerRadius:x,outerRadius:p};if(m){let F=this.arcBackground.node(),q=F._animState??Q,rt=kt(q,Q);R(this.arcBackground,m).attr("transform",v).attrTween("d",()=>et=>(F._animState=rt(et),this.arcGen(F._animState)))}else{let F=this.arcBackground.node();F._animState=Q,this.arcBackground.attr("transform",v).attr("d",this.arcGen(Q))}this._firstRender=!1}};Vx.selectors=rf;var Wx=Vx;function Fw(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function Hx(){return this.eachAfter(Fw)}function Yx(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this}function Gx(t,e){for(var n=this,r=[n],i,o,a=-1;n=r.pop();)if(t.call(e,n,++a,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function Ux(t,e){for(var n=this,r=[n],i=[],o,a,s,c=-1;n=r.pop();)if(i.push(n),o=n.children)for(a=0,s=o.length;a<s;++a)r.push(o[a]);for(;n=i.pop();)t.call(e,n,++c,this);return this}function Xx(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r}function qx(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})}function Zx(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function jx(t){for(var e=this,n=zw(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function zw(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function Kx(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Qx(){return Array.from(this)}function Jx(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function t0(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*e0(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function ur(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=Hw)):e===void 0&&(e=Ww);for(var n=new Lo(t),r,i=[n],o,a,s,c;r=i.pop();)if((a=e(r.data))&&(c=(a=Array.from(a)).length))for(r.children=a,s=c-1;s>=0;--s)i.push(o=a[s]=new Lo(a[s])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(Gw)}function Vw(){return ur(this).eachBefore(Yw)}function Ww(t){return t.children}function Hw(t){return Array.isArray(t)?t[1]:null}function Yw(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Gw(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Lo(t){this.data=t,this.depth=this.height=0,this.parent=null}Lo.prototype=ur.prototype={constructor:Lo,count:Hx,each:Yx,eachAfter:Ux,eachBefore:Gx,find:Xx,sum:qx,sort:Zx,path:jx,ancestors:Kx,descendants:Qx,leaves:Jx,links:t0,copy:Vw,[Symbol.iterator]:e0};function n0(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function r0(t,e,n,r,i){for(var o=t.children,a,s=-1,c=o.length,l=t.value&&(r-e)/t.value;++s<c;)a=o[s],a.y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*l}function of(){var t=1,e=1,n=0,r=!1;function i(a){var s=a.height+1;return a.x0=a.y0=n,a.x1=t,a.y1=e/s,a.eachBefore(o(e,s)),r&&a.eachBefore(n0),a}function o(a,s){return function(c){c.children&&r0(c,c.x0,a*(c.depth+1)/s,c.x1,a*(c.depth+2)/s);var l=c.x0,u=c.y0,f=c.x1-n,h=c.y1-n;f<l&&(l=f=(l+f)/2),h<u&&(u=h=(u+h)/2),c.x0=l,c.y0=u,c.x1=f,c.y1=h}}return i.round=function(a){return arguments.length?(r=!!a,i):r},i.size=function(a){return arguments.length?(t=+a[0],e=+a[1],i):[t,e]},i.padding=function(a){return arguments.length?(n=+a,i):n},i}var i0={...Ye,angleRange:[0,2*Math.PI],centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,cornerRadius:0,direction:si.Inwards,emptySegmentAngle:Math.PI/180,hideOverflowingSegmentLabels:!0,layers:[],layerPadding:0,layerSettings:void 0,segmentColor:void 0,segmentPattern:void 0,segmentLabel:void 0,segmentLabelColor:void 0,showBackground:!1,showEmptySegments:!1,showSegmentLabels:!0,sort:void 0,value:void 0};function o0(t,e){t.attr(dt,n=>n._index).style("fill",n=>H(n,e.segmentColor)??n._state?.fill).style("mask",n=>yt(ft(n,e.segmentPattern,n._index))).style("opacity",0).each((n,r,i)=>{let o=i[r],a=(n.x0+n.x1)/2,s=(n.x1-n.x0)/2;o._animState={x0:a-s,x1:a+s,y0:n.y0,y1:n.y1}})}function a0(t,e,n,r){t.style("transition",`fill ${r}ms`).attr(dt,i=>i._index).style("fill",i=>i._state.fill).style("fill-opacity",i=>i._state.fillOpacity).style("mask",i=>yt(ft(i,e.segmentPattern,i._index))),r?R(t,r).style("opacity",1).attrTween("d",(o,a,s)=>{let c=s[a],l={x0:o.x0,x1:o.x1,y0:o.y0,y1:o.y1},u=kt(c._animState,l);return f=>(c._animState=u(f),n(c._animState))}):t.attr("d",n).style("opacity",1)}function s0(t,e){R(t,e).style("opacity",0).remove()}var cf={};Rt(cf,{background:()=>Ws,centralLabel:()=>sf,centralSubLabel:()=>lf,root:()=>c0,segment:()=>Hs,segmentArc:()=>Gs,segmentExit:()=>Ys,segmentLabel:()=>Us,segmentsGroup:()=>af,variables:()=>hn});var l0={"--vis-nested-donut-font-family":void 0,"--vis-nested-donut-background-color":"#E7E9F3","--vis-nested-donut-central-label-font-size":"16px","--vis-nested-donut-central-label-font-weight":600,"--vis-nested-donut-central-label-text-color":"#5b5f6d","--vis-nested-donut-central-sublabel-font-size":"12px;","--vis-nested-donut-central-sublabel-font-weight":500,"--vis-nested-donut-central-sublabel-text-color":"#5b5f6d","--vis-nested-donut-segment-stroke-width":"1px","--vis-nested-donut-segment-stroke-color":"var(--vis-nested-donut-background-color)","--vis-nested-donut-segment-label-text-color-light":"#5b5f6d","--vis-nested-donut-segment-label-text-color-dark":"#fff","--vis-nested-donut-segment-label-font-size":"1em","--vis-dark-nested-donut-background-color":"#18160C","--vis-dark-nested-donut-central-label-text-color":"#fff","--vis-dark-nested-donut-central-sublabel-text-color":"#fff"},c0=C`
592
+ `;var Jx=class extends Xe{constructor(e){super(),this._defaultConfig=Xx,this.config=this._defaultConfig,this.datamodel=new qe,this.arcGen=cr(),this.events={},this._firstRender=!0,this.setConfig(e),this.arcBackground=this.g.append("path"),this.arcGroup=this.g.append("g"),this.centralLabel=this.g.append("text").attr("class",df),this.centralSubLabel=this.g.append("text").attr("class",pf)}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e){let{config:n,datamodel:r,bleed:i}=this,o=r.data.map((V,Z)=>({index:Z,datum:V})).filter(V=>n.showEmptySegments||I(V.datum,n.value,V.index)),s=U(e)?e:n.duration,[a,c,l,u]=uf.map(V=>n.angleRange&&n.angleRange[0]===V[0]&&n.angleRange[1]===V[1]),f=a||l,h=c||u,d=this._width*(h?2:1),x=this._height*(f?2:1),p=n.radius||Math.min(d-i.left-i.right,x-i.top-i.bottom)/2,g=n.arcWidth===0?0:tt(p-n.arcWidth,0,p-1),v=this._height/2+(a?p/2:l?-p/2:0),b=this._width/2+(u?p/2:c?-p/2:0),y=`translate(${b},${v})`,m=this._firstRender?0:s;D(this.arcGroup,m).attr("transform",y),this.arcGen.startAngle(V=>V.startAngle).endAngle(V=>V.endAngle).innerRadius(V=>V.innerRadius).outerRadius(V=>V.outerRadius).padAngle(V=>V.padAngle).cornerRadius(n.cornerRadius);let w=yo().startAngle(n.angleRange?.[0]??0).endAngle(n.angleRange?.[1]??2*Math.PI).padAngle(n.padAngle).value(V=>I(V.datum,n.value,V.index)||0).sort((V,Z)=>n.sortFunction?.(V.datum,Z.datum))(o);U(n.minSegmentAngle)&&Kx(w,n.minSegmentAngle,[n.angleRange?.[0]??0,n.angleRange?.[1]??2*Math.PI]);let k=w.map(V=>{let Z={...V,data:V.data.datum,index:V.data.index,innerRadius:g,outerRadius:p};return n.showEmptySegments&&V.endAngle-V.startAngle-V.padAngle<=Number.EPSILON&&(Z.endAngle=V.startAngle+Math.max(n.emptySegmentAngle,n.padAngle),Z.padAngle=V.padAngle/2),Z}),M=this.arcGroup.selectAll(`.${Ja}`).data(k,V=>n.id(V.data,V.index)),N=M.enter().append("path").attr("class",Ja).call(qx,n),P=M.merge(N);P.call(jx,n,this.arcGen,s),P.sort((V,Z)=>Z.value-V.value),M.exit().attr("class",hf).call(Zx,s);let F=c?"start":u?"end":"middle";this.centralLabel.attr("dy",n.centralSubLabel?"-0.55em":null).style("text-anchor",F).text(n.centralLabel??null),this.centralSubLabel.attr("dy",n.centralLabel?"0.55em":null).style("text-anchor",F).text(n.centralSubLabel??null),n.centralSubLabelWrap&&Ge(this.centralSubLabel,g*1.9);let R=(n.centralLabelOffsetX||0)+b,$=(n.centralLabelOffsetY||0)+v;f&&n.centralLabelOffsetX===void 0&&n.centralLabelOffsetY===void 0&&($=(a?-this.centralSubLabel.node().getBoundingClientRect().height:l?this.centralLabel.node().getBoundingClientRect().height:0)+v);let B=`translate(${R},${$})`;D(this.centralLabel,m).attr("transform",B),D(this.centralSubLabel,m).attr("transform",B),this.arcBackground.attr("class",ff).attr("visibility",n.showBackground?null:"hidden");let et={startAngle:n.backgroundAngleRange?.[0]??n.angleRange?.[0]??0,endAngle:n.backgroundAngleRange?.[1]??n.angleRange?.[1]??2*Math.PI,innerRadius:g,outerRadius:p};if(m){let V=this.arcBackground.node(),Z=V._animState??et,st=Ct(Z,et);D(this.arcBackground,m).attr("transform",y).attrTween("d",()=>it=>(V._animState=st(it),this.arcGen(V._animState)))}else{let V=this.arcBackground.node();V._animState=et,this.arcBackground.attr("transform",y).attr("d",this.arcGen(et))}this._firstRender=!1}};Jx.selectors=mf;var t0=Jx;function hS(t){var e=0,n=t.children,r=n&&n.length;if(!r)e=1;else for(;--r>=0;)e+=n[r].value;t.value=e}function e0(){return this.eachAfter(hS)}function n0(t,e){let n=-1;for(let r of this)t.call(e,r,++n,this);return this}function r0(t,e){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(t.call(e,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function i0(t,e){for(var n=this,r=[n],i=[],o,s,a,c=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)r.push(o[s]);for(;n=i.pop();)t.call(e,n,++c,this);return this}function o0(t,e){let n=-1;for(let r of this)if(t.call(e,r,++n,this))return r}function s0(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n})}function a0(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function l0(t){for(var e=this,n=dS(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r}function dS(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}function c0(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function u0(){return Array.from(this)}function f0(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function h0(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*d0(){var t=this,e,n=[t],r,i,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,r=t.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function pr(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=gS)):e===void 0&&(e=mS);for(var n=new No(t),r,i=[n],o,s,a,c;r=i.pop();)if((s=e(r.data))&&(c=(s=Array.from(s)).length))for(r.children=s,a=c-1;a>=0;--a)i.push(o=s[a]=new No(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(yS)}function pS(){return pr(this).eachBefore(xS)}function mS(t){return t.children}function gS(t){return Array.isArray(t)?t[1]:null}function xS(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function yS(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function No(t){this.data=t,this.depth=this.height=0,this.parent=null}No.prototype=pr.prototype={constructor:No,count:e0,each:n0,eachAfter:i0,eachBefore:r0,find:o0,sum:s0,sort:a0,path:l0,ancestors:c0,descendants:u0,leaves:f0,links:h0,copy:pS,[Symbol.iterator]:d0};function p0(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function m0(t,e,n,r,i){for(var o=t.children,s,a=-1,c=o.length,l=t.value&&(r-e)/t.value;++a<c;)s=o[a],s.y0=n,s.y1=i,s.x0=e,s.x1=e+=s.value*l}function gf(){var t=1,e=1,n=0,r=!1;function i(s){var a=s.height+1;return s.x0=s.y0=n,s.x1=t,s.y1=e/a,s.eachBefore(o(e,a)),r&&s.eachBefore(p0),s}function o(s,a){return function(c){c.children&&m0(c,c.x0,s*(c.depth+1)/a,c.x1,s*(c.depth+2)/a);var l=c.x0,u=c.y0,f=c.x1-n,h=c.y1-n;f<l&&(l=f=(l+f)/2),h<u&&(u=h=(u+h)/2),c.x0=l,c.y0=u,c.x1=f,c.y1=h}}return i.round=function(s){return arguments.length?(r=!!s,i):r},i.size=function(s){return arguments.length?(t=+s[0],e=+s[1],i):[t,e]},i.padding=function(s){return arguments.length?(n=+s,i):n},i}var g0={...Ue,angleRange:[0,2*Math.PI],centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,cornerRadius:0,direction:hi.Inwards,emptySegmentAngle:Math.PI/180,hideOverflowingSegmentLabels:!0,layers:[],layerPadding:0,layerSettings:void 0,segmentColor:void 0,segmentPattern:void 0,segmentLabel:void 0,segmentLabelColor:void 0,showBackground:!1,showEmptySegments:!1,showSegmentLabels:!0,sort:void 0,value:void 0};function x0(t,e){t.attr(gt,n=>n._index).style("fill",n=>X(n,e.segmentColor)??n._state?.fill).style("mask",n=>_t(dt(n,e.segmentPattern,n._index))).style("opacity",0).each((n,r,i)=>{let o=i[r],s=(n.x0+n.x1)/2,a=(n.x1-n.x0)/2;o._animState={x0:s-a,x1:s+a,y0:n.y0,y1:n.y1}})}function y0(t,e,n,r){t.style("transition",`fill ${r}ms`).attr(gt,i=>i._index).style("fill",i=>i._state.fill).style("fill-opacity",i=>i._state.fillOpacity).style("mask",i=>_t(dt(i,e.segmentPattern,i._index))),r?D(t,r).style("opacity",1).attrTween("d",(o,s,a)=>{let c=a[s],l={x0:o.x0,x1:o.x1,y0:o.y0,y1:o.y1},u=Ct(c._animState,l);return f=>(c._animState=u(f),n(c._animState))}):t.attr("d",n).style("opacity",1)}function v0(t,e){D(t,e).style("opacity",0).remove()}var bf={};Lt(bf,{background:()=>tl,centralLabel:()=>yf,centralSubLabel:()=>vf,root:()=>_0,segment:()=>el,segmentArc:()=>rl,segmentExit:()=>nl,segmentLabel:()=>il,segmentsGroup:()=>xf,variables:()=>hn});var b0={"--vis-nested-donut-font-family":void 0,"--vis-nested-donut-background-color":"#E7E9F3","--vis-nested-donut-central-label-font-size":"16px","--vis-nested-donut-central-label-font-weight":600,"--vis-nested-donut-central-label-text-color":"#5b5f6d","--vis-nested-donut-central-sublabel-font-size":"12px;","--vis-nested-donut-central-sublabel-font-weight":500,"--vis-nested-donut-central-sublabel-text-color":"#5b5f6d","--vis-nested-donut-segment-stroke-width":"1px","--vis-nested-donut-segment-stroke-color":"var(--vis-nested-donut-background-color)","--vis-nested-donut-segment-label-text-color-light":"#5b5f6d","--vis-nested-donut-segment-label-text-color-dark":"#fff","--vis-nested-donut-segment-label-font-size":"1em","--vis-dark-nested-donut-background-color":"#18160C","--vis-dark-nested-donut-central-label-text-color":"#fff","--vis-dark-nested-donut-central-sublabel-text-color":"#fff"},_0=T`
596
593
  label: nested-donut-component;
597
- `,af=C`
594
+ `,xf=T`
598
595
  label: nested-donut-segments-group;
599
- `,hn=pe(l0);me(l0,c0);var Ws=C`
596
+ `,hn=me(b0);ge(b0,_0);var tl=T`
600
597
  label: background;
601
598
  fill: var(--vis-nested-donut-background-color);
602
599
  stroke-width: var(--vis-nested-donut-segment-stroke-width);
603
600
  stroke: var(--vis-nested-donut-segment-stroke-color);
604
- `,Hs=C`
601
+ `,el=T`
605
602
  label: segment;
606
- `,Ys=C`
603
+ `,nl=T`
607
604
  label: segment-exit;
608
- `,Gs=C`
605
+ `,rl=T`
609
606
  label: segment-arc;
610
607
  stroke-width: var(--vis-nested-donut-segment-stroke-width);
611
608
  stroke: var(--vis-nested-donut-segment-stroke-color);
612
- `,Us=C`
609
+ `,il=T`
613
610
  label: segment-label;
614
611
  text-anchor: middle;
615
612
  dominant-baseline: middle;
616
613
  user-select: none;
617
614
  font-size: var(--vis-nested-donut-segment-label-font-size);
618
- `,sf=C`
615
+ `,yf=T`
619
616
  label: central-label;
620
617
  text-anchor: middle;
621
618
  dominant-baseline: middle;
@@ -623,7 +620,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
623
620
  font-family: var(--vis-nested-donut-central-label-font-family, var(--vis-font-family));
624
621
  font-weight: var(--vis-nested-donut-central-label-font-weight);
625
622
  fill: var(--vis-nested-donut-central-label-text-color);
626
- `,lf=C`
623
+ `,vf=T`
627
624
  label: central-sub-label;
628
625
  text-anchor: middle;
629
626
  dominant-baseline: middle;
@@ -631,34 +628,34 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
631
628
  font-family: var(--vis-nested-donut-central-sublabel-font-family, var(--vis-font-family));
632
629
  font-weight: var(--vis-nested-donut-central-sublabel-font-weight);
633
630
  fill: var(--vis-nested-donut-central-sublabel-text-color);
634
- `;function Uw(t,e){let r=(gt(t._state.fill)??gt(Ui(t._state.fill,e)))?.rgb(),i=r&&t._state.fillOpacity?Vd(`rgba(${r.r},${r.g},${r.b},${t._state.fillOpacity})`,Ui(un(hn.nestedDonutBackgroundColor),e)):r,o=i?Kl(i):0;return un(o>.65?hn.nestedDonutSegmentLabelTextColorLight:hn.nestedDonutSegmentLabelTextColorDark)}function u0(t,e){let n=`translate(${e.centroid(t)})`,r=180/Math.PI*(e.startAngle()(t)+e.endAngle()(t))/2-90;switch(t._layer.labelAlignment){case fn.Along:return`${n} rotate(${r+90})`;case fn.Perpendicular:return`${n} rotate(${r>90?r-180:r})`;default:return`${n}`}}function Xw(t){let e=t.y1-t.y0,n=t._layer._innerRadius*(t.x1-t.x0),r=Math.max(Math.abs(Math.cos(t.x0+(t.x1-t.x0)/2-Math.PI/2)*e),e);switch(t._layer.labelAlignment){case fn.Perpendicular:return{width:e,height:n};case fn.Along:return{width:n,height:e};case fn.Straight:return{width:r,height:r}}}function f0(t,e){t.attr("transform",n=>u0(n,e)).style("visibility",null).style("opacity",0)}function h0(t,e,n,r){t.text(i=>G(i,e.segmentLabel)??i.data.key).style("transition",`fill ${r}ms`).style("fill",(i,o,a)=>H(i,e.segmentLabelColor)??Uw(i,a[o])).each((i,o,a)=>{let s=Xw(i),c=W(a[o]).call(qe,s.width),{width:l,height:u}=c.node().getBBox();if(e.hideOverflowingSegmentLabels&&(l>s.width||u>s.height))c.attr("visibility","hidden");else{let f=te(un(hn.nestedDonutSegmentLabelFontSize),a[o]),h=c.selectChildren().size()-1;c.attr("dy",-f/2*h)}}),R(t,r).attr("transform",i=>u0(i,n)).style("opacity",1)}function d0(t,e){R(t,e).style("opacity",0).remove()}var uf=class extends Ge{constructor(e){super(),this._defaultConfig=i0,this.config=this._defaultConfig,this.datamodel=new Ue,this.arcGen=or(),this.colorScale=vn(),this.events={},this.setConfig(e),this.arcBackground=this.g.append("g"),this.arcGroup=this.g.append("g").attr("class",af),this.centralLabel=this.g.append("text").attr("class",sf),this.centralSubLabel=this.g.append("text").attr("class",lf)}_render(e){let{config:n}=this,r=U(e)?e:n.duration;if(n.layers===void 0||n.layers.length===0){console.warn("Unovis | Nested Donut: No layers defined.");return}let i=this._getLayerSettings(),o=this._getHierarchyData(i);this.arcGen.startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.y0).outerRadius(d=>d.y1).cornerRadius(n.cornerRadius),this.arcGroup.attr("transform",`translate(${this._width/2},${this._height/2})`),this.arcBackground.attr("transform",`translate(${this._width/2},${this._height/2})`),this.centralLabel.attr("transform",`translate(${this._width/2},${this._height/2})`),this.centralSubLabel.attr("transform",`translate(${this._width/2},${this._height/2})`);let a=this.arcBackground.selectAll(`.${Ws}`).data(i,d=>d._id),s=a.enter().append("path").attr("class",Ws).attr("visibility",n.showBackground?null:"hidden"),c=a.merge(s).style("transition",`fill ${r}ms`).style("fill",d=>d.backgroundColor);R(c,r).attr("d",d=>this.arcGen({x0:n.angleRange?.[0]??0,x1:n.angleRange?.[1]??2*Math.PI,y0:d._innerRadius,y1:d._outerRadius})),R(a.exit(),r).style("opacity",0).remove();let l=this.arcGroup.selectAll(`${Hs}`).data(o,d=>d._id),u=l.enter().append("g").attr("class",Hs);l.merge(u),R(l.exit(),r).attr("class",Ys).style("opacity",0).remove();let f=this.arcGroup.selectAll(`.${Gs}`).data(o,d=>d._id),h=u.append("path").attr("class",Gs).call(o0,n);if(f.merge(h).call(a0,n,this.arcGen,r),f.exit().attr("class",Ys).call(s0,r),n.showSegmentLabels){let d=this.arcGroup.selectAll(`.${Us}`).data(o,p=>p._id),g=u.append("text").attr("class",Us).call(f0,this.arcGen);d.merge(g).call(h0,n,this.arcGen,r),d.exit().call(d0,r)}this.centralLabel.attr("dy",n.centralSubLabel?"-0.55em":null).text(n.centralLabel??null),this.centralSubLabel.attr("dy",n.centralLabel?"0.55em":null).text(n.centralSubLabel??null),n.centralSubLabelWrap&&qe(this.centralSubLabel,i[0]._innerRadius*1.9,Xe.Top)}_getHierarchyData(e){let{config:n,datamodel:{data:r}}=this,i=n.layers?.map(l=>u=>G(r[u],l,u)),o=qo(r.keys(),...i),a=n.value!==void 0?ur(o).sum(l=>typeof l=="number"&&L(r[l],n.value,l)):ur(o).count(),s=of().size([n.angleRange[1],1])(a);return s.each(l=>{let u=l;l.data={key:u.data[0],values:Array.isArray(u.data[1])?u.data[1].map(f=>r[f]):[],root:l.parent?.data?.root??u.data[0]},l._id=`root${s.path(l).map(f=>f.data.key).join("->")}`,bi(l.depth-1,[0,e.length-1])&&(l._layer=e[l.depth-1],l.y0=l._layer._innerRadius,l.y1=l._layer._outerRadius)}).eachBefore(l=>{if(!l.children||l.depth===a.height-1)return;let u=mo().startAngle(l.parent?l.x0:n.angleRange?.[0]).endAngle(l.parent?l.x1:n.angleRange?.[1]).value(h=>n.showEmptySegments&&h.value===0?n.emptySegmentAngle:h.x1-h.x0).sort(n.sort)(l.children),f=vn().domain([-1,l.children.length]).range([l._state?.fillOpacity??1,0]);l.children.forEach((h,d)=>{h._index=d,h.x0=u[d].startAngle,h.x1=u[d].endAngle;let g=H(h,n.segmentColor,u[d].index,void 0,{dontFallbackToCssVar:h.depth!==1});h._state={fill:g??l._state.fill,fillOpacity:g===null?f(u[d].index):null}})}).eachAfter(l=>{l.children?.forEach(u=>l.data.values.push(...u.data.values))}),s.descendants().filter(l=>l.parent?.value&&l.data.key)}_getLayerSettings(){let{direction:e,layers:n,layerPadding:r,layerSettings:i}=this.config,o=Math.min(this._width,this._height)/2,a={backgroundColor:un(hn.nestedDonutBackgroundColor),labelAlignment:fn.Perpendicular,width:o*.75/n.length},s=n.reduceRight((c,l,u)=>{let f=e===si.Outwards?u:c.length,h=Qt(a,K(f,i)),d=c.length?c[0]._innerRadius-r:o,g=wi(h.width);return g===null&&console.warn(`Unovis | Nested Donut: Could not parse width ${h.width}. Setting to default.`),c.unshift({...h,_id:f,_outerRadius:d,_innerRadius:d-(g??a.width)}),c},new Array);return e===si.Inwards?s.reverse():s}};uf.selectors=cf;uf.cssVariables=hn;var p0=uf;var m0={...Ye,id:(t,e)=>t?.id??e,value:void 0,maxValue:void 0,angleRange:[0,2*Math.PI],padAngle:0,barMinAngle:.01,sortFunction:void 0,cornerRadius:0,color:void 0,radius:void 0,trackWidth:16,trackPadding:4,reverseOrder:!1,centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,centralLabelOffsetX:void 0,centralLabelOffsetY:void 0,showBackground:!0,backgroundAngleRange:void 0};function g0(t,e){t.style("fill",n=>H(n.data,e.color,n.index)).style("opacity",0).each((n,r,i)=>{let o=i[r];o._animState={startAngle:n.startAngle,endAngle:n.startAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius,padAngle:n.padAngle}})}function x0(t,e,n,r){t.style("transition",`fill ${r}ms`).style("fill",o=>H(o.data,e.color,o.index));let i=o=>o.value||o.endAngle!==o.startAngle?1:0;r?R(t,r).style("opacity",i).attrTween("d",(a,s,c)=>{let l=c[s],u={startAngle:a.startAngle,endAngle:a.endAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,padAngle:a.padAngle},f=kt(l._animState,u);return h=>(l._animState=f(h),n(l._animState))}):t.attr("d",n).style("opacity",i)}function y0(t,e){R(t,e).style("opacity",0).remove()}function v0(t,e){let n=e-t;if(Math.abs(n)>=2*Math.PI)return{xMin:-1,xMax:1,yMin:-1,yMax:1};let r=Math.min(t,e),i=Math.max(t,e),o=0,a=0,s=0,c=0,l=(f,h)=>{f<o&&(o=f),f>a&&(a=f),h<s&&(s=h),h>c&&(c=h)};l(Math.sin(t),-Math.cos(t)),l(Math.sin(e),-Math.cos(e));let u=f=>{let h=Math.ceil((r-f)/(2*Math.PI)),d=Math.floor((i-f)/(2*Math.PI));return h<=d};return u(Math.PI/2)&&(a=1),u(-Math.PI/2)&&(o=-1),u(0)&&(s=-1),u(Math.PI)&&(c=1),{xMin:o,xMax:a,yMin:s,yMax:c}}var mf={};Rt(mf,{background:()=>Xs,bar:()=>qs,barExit:()=>hf,centralLabel:()=>df,centralSubLabel:()=>pf,cssVarDefaults:()=>ff,root:()=>b0,variables:()=>It});var b0=C`
631
+ `;function vS(t,e){let r=(vt(t._state.fill)??vt(ji(t._state.fill,e)))?.rgb(),i=r&&t._state.fillOpacity?Qd(`rgba(${r.r},${r.g},${r.b},${t._state.fillOpacity})`,ji(un(hn.nestedDonutBackgroundColor),e)):r,o=i?cc(i):0;return un(o>.65?hn.nestedDonutSegmentLabelTextColorLight:hn.nestedDonutSegmentLabelTextColorDark)}function w0(t,e){let n=`translate(${e.centroid(t)})`,r=180/Math.PI*(e.startAngle()(t)+e.endAngle()(t))/2-90;switch(t._layer.labelAlignment){case fn.Along:return`${n} rotate(${r+90})`;case fn.Perpendicular:return`${n} rotate(${r>90?r-180:r})`;default:return`${n}`}}function bS(t){let e=t.y1-t.y0,n=t._layer._innerRadius*(t.x1-t.x0),r=Math.max(Math.abs(Math.cos(t.x0+(t.x1-t.x0)/2-Math.PI/2)*e),e);switch(t._layer.labelAlignment){case fn.Perpendicular:return{width:e,height:n};case fn.Along:return{width:n,height:e};case fn.Straight:return{width:r,height:r}}}function S0(t,e){t.attr("transform",n=>w0(n,e)).style("visibility",null).style("opacity",0)}function k0(t,e,n,r){t.text(i=>q(i,e.segmentLabel)??i.data.key).style("transition",`fill ${r}ms`).style("fill",(i,o,s)=>X(i,e.segmentLabelColor)??vS(i,s[o])).each((i,o,s)=>{let a=bS(i),c=Y(s[o]).call(Ge,a.width),{width:l,height:u}=c.node().getBBox();if(e.hideOverflowingSegmentLabels&&(l>a.width||u>a.height))c.attr("visibility","hidden");else{let f=Dt(un(hn.nestedDonutSegmentLabelFontSize),s[o]),h=c.selectChildren().size()-1;c.attr("dy",-f/2*h)}}),D(t,r).attr("transform",i=>w0(i,n)).style("opacity",1)}function T0(t,e){D(t,e).style("opacity",0).remove()}var _f=class extends Xe{constructor(e){super(),this._defaultConfig=g0,this.config=this._defaultConfig,this.datamodel=new qe,this.arcGen=cr(),this.colorScale=bn(),this.events={},this.setConfig(e),this.arcBackground=this.g.append("g"),this.arcGroup=this.g.append("g").attr("class",xf),this.centralLabel=this.g.append("text").attr("class",yf),this.centralSubLabel=this.g.append("text").attr("class",vf)}_render(e){let{config:n}=this,r=U(e)?e:n.duration;if(n.layers===void 0||n.layers.length===0){console.warn("Unovis | Nested Donut: No layers defined.");return}let i=this._getLayerSettings(),o=this._getHierarchyData(i);this.arcGen.startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.y0).outerRadius(d=>d.y1).cornerRadius(n.cornerRadius),this.arcGroup.attr("transform",`translate(${this._width/2},${this._height/2})`),this.arcBackground.attr("transform",`translate(${this._width/2},${this._height/2})`),this.centralLabel.attr("transform",`translate(${this._width/2},${this._height/2})`),this.centralSubLabel.attr("transform",`translate(${this._width/2},${this._height/2})`);let s=this.arcBackground.selectAll(`.${tl}`).data(i,d=>d._id),a=s.enter().append("path").attr("class",tl).attr("visibility",n.showBackground?null:"hidden"),c=s.merge(a).style("transition",`fill ${r}ms`).style("fill",d=>d.backgroundColor);D(c,r).attr("d",d=>this.arcGen({x0:n.angleRange?.[0]??0,x1:n.angleRange?.[1]??2*Math.PI,y0:d._innerRadius,y1:d._outerRadius})),D(s.exit(),r).style("opacity",0).remove();let l=this.arcGroup.selectAll(`${el}`).data(o,d=>d._id),u=l.enter().append("g").attr("class",el);l.merge(u),D(l.exit(),r).attr("class",nl).style("opacity",0).remove();let f=this.arcGroup.selectAll(`.${rl}`).data(o,d=>d._id),h=u.append("path").attr("class",rl).call(x0,n);if(f.merge(h).call(y0,n,this.arcGen,r),f.exit().attr("class",nl).call(v0,r),n.showSegmentLabels){let d=this.arcGroup.selectAll(`.${il}`).data(o,p=>p._id),x=u.append("text").attr("class",il).call(S0,this.arcGen);d.merge(x).call(k0,n,this.arcGen,r),d.exit().call(T0,r)}this.centralLabel.attr("dy",n.centralSubLabel?"-0.55em":null).text(n.centralLabel??null),this.centralSubLabel.attr("dy",n.centralLabel?"0.55em":null).text(n.centralSubLabel??null),n.centralSubLabelWrap&&Ge(this.centralSubLabel,i[0]._innerRadius*1.9,L.Top)}_getHierarchyData(e){let{config:n,datamodel:{data:r}}=this,i=n.layers?.map(l=>u=>q(r[u],l,u)),o=ts(r.keys(),...i),s=n.value!==void 0?pr(o).sum(l=>typeof l=="number"&&I(r[l],n.value,l)):pr(o).count(),a=gf().size([n.angleRange[1],1])(s);return a.each(l=>{let u=l;l.data={key:u.data[0],values:Array.isArray(u.data[1])?u.data[1].map(f=>r[f]):[],root:l.parent?.data?.root??u.data[0]},l._id=`root${a.path(l).map(f=>f.data.key).join("->")}`,Vn(l.depth-1,[0,e.length-1])&&(l._layer=e[l.depth-1],l.y0=l._layer._innerRadius,l.y1=l._layer._outerRadius)}).eachBefore(l=>{if(!l.children||l.depth===s.height-1)return;let u=yo().startAngle(l.parent?l.x0:n.angleRange?.[0]).endAngle(l.parent?l.x1:n.angleRange?.[1]).value(h=>n.showEmptySegments&&h.value===0?n.emptySegmentAngle:h.x1-h.x0).sort(n.sort)(l.children),f=bn().domain([-1,l.children.length]).range([l._state?.fillOpacity??1,0]);l.children.forEach((h,d)=>{h._index=d,h.x0=u[d].startAngle,h.x1=u[d].endAngle;let x=X(h,n.segmentColor,u[d].index,void 0,{dontFallbackToCssVar:h.depth!==1});h._state={fill:x??l._state.fill,fillOpacity:x===null?f(u[d].index):null}})}).eachAfter(l=>{l.children?.forEach(u=>l.data.values.push(...u.data.values))}),a.descendants().filter(l=>l.parent?.value&&l.data.key)}_getLayerSettings(){let{direction:e,layers:n,layerPadding:r,layerSettings:i}=this.config,o=Math.min(this._width,this._height)/2,s={backgroundColor:un(hn.nestedDonutBackgroundColor),labelAlignment:fn.Perpendicular,width:o*.75/n.length},a=n.reduceRight((c,l,u)=>{let f=e===hi.Outwards?u:c.length,h=te(s,K(f,i)),d=c.length?c[0]._innerRadius-r:o,x=Ti(h.width);return x===null&&console.warn(`Unovis | Nested Donut: Could not parse width ${h.width}. Setting to default.`),c.unshift({...h,_id:f,_outerRadius:d,_innerRadius:d-(x??s.width)}),c},new Array);return e===hi.Inwards?a.reverse():a}};_f.selectors=bf;_f.cssVariables=hn;var A0=_f;var C0={...Ue,id:(t,e)=>t?.id??e,value:void 0,maxValue:void 0,angleRange:[0,2*Math.PI],padAngle:0,barMinAngle:.01,sortFunction:void 0,cornerRadius:0,color:void 0,radius:void 0,trackWidth:16,trackPadding:4,reverseOrder:!1,centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,centralLabelOffsetX:void 0,centralLabelOffsetY:void 0,showBackground:!0,backgroundAngleRange:void 0};function M0(t,e){t.style("fill",n=>X(n.data,e.color,n.index)).style("opacity",0).each((n,r,i)=>{let o=i[r];o._animState={startAngle:n.startAngle,endAngle:n.startAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius,padAngle:n.padAngle}})}function L0(t,e,n,r){t.style("transition",`fill ${r}ms`).style("fill",o=>X(o.data,e.color,o.index));let i=o=>o.value||o.endAngle!==o.startAngle?1:0;r?D(t,r).style("opacity",i).attrTween("d",(s,a,c)=>{let l=c[a],u={startAngle:s.startAngle,endAngle:s.endAngle,innerRadius:s.innerRadius,outerRadius:s.outerRadius,padAngle:s.padAngle},f=Ct(l._animState,u);return h=>(l._animState=f(h),n(l._animState))}):t.attr("d",n).style("opacity",i)}function R0(t,e){D(t,e).style("opacity",0).remove()}function E0(t,e){let n=e-t;if(Math.abs(n)>=2*Math.PI)return{xMin:-1,xMax:1,yMin:-1,yMax:1};let r=Math.min(t,e),i=Math.max(t,e),o=0,s=0,a=0,c=0,l=(f,h)=>{f<o&&(o=f),f>s&&(s=f),h<a&&(a=h),h>c&&(c=h)};l(Math.sin(t),-Math.cos(t)),l(Math.sin(e),-Math.cos(e));let u=f=>{let h=Math.ceil((r-f)/(2*Math.PI)),d=Math.floor((i-f)/(2*Math.PI));return h<=d};return u(Math.PI/2)&&(s=1),u(-Math.PI/2)&&(o=-1),u(0)&&(a=-1),u(Math.PI)&&(c=1),{xMin:o,xMax:s,yMin:a,yMax:c}}var Af={};Lt(Af,{background:()=>ol,bar:()=>sl,barExit:()=>Sf,centralLabel:()=>kf,centralSubLabel:()=>Tf,cssVarDefaults:()=>wf,root:()=>D0,variables:()=>Nt});var D0=T`
635
632
  label: radial-bar-component;
636
- `,ff={"--vis-radial-bar-central-label-font-size":"24px","--vis-radial-bar-central-label-text-color":"#5b5f6d","--vis-radial-bar-central-label-font-family":void 0,"--vis-radial-bar-central-label-font-weight":"600","--vis-radial-bar-central-label-text-anchor":"middle","--vis-radial-bar-central-sub-label-font-size":"12px","--vis-radial-bar-central-sub-label-text-color":"#5b5f6d","--vis-radial-bar-central-sub-label-font-family":void 0,"--vis-radial-bar-central-sub-label-font-weight":"500","--vis-radial-bar-central-sub-label-text-anchor":"middle","--vis-radial-bar-background-color":"#E7E9F3","--vis-radial-bar-bar-stroke-width":"0","--vis-radial-bar-bar-stroke-color":void 0,"--vis-dark-radial-bar-central-label-text-color":"#C2BECE","--vis-dark-radial-bar-central-sub-label-text-color":"#C2BECE","--vis-dark-radial-bar-background-color":"#444444"},It=pe(ff);me(ff,b0);var Xs=C`
633
+ `,wf={"--vis-radial-bar-central-label-font-size":"24px","--vis-radial-bar-central-label-text-color":"#5b5f6d","--vis-radial-bar-central-label-font-family":void 0,"--vis-radial-bar-central-label-font-weight":"600","--vis-radial-bar-central-label-text-anchor":"middle","--vis-radial-bar-central-sub-label-font-size":"12px","--vis-radial-bar-central-sub-label-text-color":"#5b5f6d","--vis-radial-bar-central-sub-label-font-family":void 0,"--vis-radial-bar-central-sub-label-font-weight":"500","--vis-radial-bar-central-sub-label-text-anchor":"middle","--vis-radial-bar-background-color":"#E7E9F3","--vis-radial-bar-bar-stroke-width":"0","--vis-radial-bar-bar-stroke-color":void 0,"--vis-dark-radial-bar-central-label-text-color":"#C2BECE","--vis-dark-radial-bar-central-sub-label-text-color":"#C2BECE","--vis-dark-radial-bar-background-color":"#444444"},Nt=me(wf);ge(wf,D0);var ol=T`
637
634
  label: background;
638
- fill: var(${It.radialBarBackgroundColor});
639
- `,qs=C`
635
+ fill: var(${Nt.radialBarBackgroundColor});
636
+ `,sl=T`
640
637
  label: bar;
641
- stroke-width: var(${It.radialBarBarStrokeWidth});
642
- stroke: var(${It.radialBarBarStrokeColor}, var(${It.radialBarBackgroundColor}));
643
- `,hf=C`
638
+ stroke-width: var(${Nt.radialBarBarStrokeWidth});
639
+ stroke: var(${Nt.radialBarBarStrokeColor}, var(${Nt.radialBarBackgroundColor}));
640
+ `,Sf=T`
644
641
  label: bar-exit;
645
- `,df=C`
642
+ `,kf=T`
646
643
  label: central-label;
647
- text-anchor: var(${It.radialBarCentralLabelTextAnchor});
644
+ text-anchor: var(${Nt.radialBarCentralLabelTextAnchor});
648
645
  dominant-baseline: middle;
649
- font-size: var(${It.radialBarCentralLabelFontSize});
650
- font-family: var(${It.radialBarCentralLabelFontFamily}, var(--vis-font-family));
651
- font-weight: var(${It.radialBarCentralLabelFontWeight});
652
- fill: var(${It.radialBarCentralLabelTextColor});
653
- `,pf=C`
646
+ font-size: var(${Nt.radialBarCentralLabelFontSize});
647
+ font-family: var(${Nt.radialBarCentralLabelFontFamily}, var(--vis-font-family));
648
+ font-weight: var(${Nt.radialBarCentralLabelFontWeight});
649
+ fill: var(${Nt.radialBarCentralLabelTextColor});
650
+ `,Tf=T`
654
651
  label: central-sub-label;
655
- text-anchor: var(${It.radialBarCentralSubLabelTextAnchor});
652
+ text-anchor: var(${Nt.radialBarCentralSubLabelTextAnchor});
656
653
  dominant-baseline: middle;
657
- font-size: var(${It.radialBarCentralSubLabelFontSize});
658
- font-family: var(${It.radialBarCentralSubLabelFontFamily}, var(--vis-font-family));
659
- font-weight: var(${It.radialBarCentralSubLabelFontWeight});
660
- fill: var(${It.radialBarCentralSubLabelTextColor});
661
- `;var _0=class extends Ge{constructor(e){super(),this._defaultConfig=m0,this.config=this._defaultConfig,this.datamodel=new Ue,this.arcGen=or(),this.events={},this.setConfig(e),this.trackGroup=this.g.append("g"),this.barGroup=this.g.append("g"),this.centralLabel=this.g.append("text").attr("class",df),this.centralSubLabel=this.g.append("text").attr("class",pf)}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e){let{config:n,datamodel:r,bleed:i}=this,o=r.data.map((S,T)=>({index:T,datum:S}));n.sortFunction&&o.sort((S,T)=>n.sortFunction(S.datum,T.datum));let a=U(e)?e:n.duration,s=this._width,c=this._height,l=s-i.left-i.right,u=c-i.top-i.bottom,f=n.angleRange?.[0]??0,h=n.angleRange?.[1]??2*Math.PI,d=h-f,g=d<0?-1:1,p=it(n.barMinAngle??0,0,Math.abs(d)),x=v0(f,h),y=x.xMax-x.xMin,b=x.yMax-x.yMin,v=n.radius??Math.min(l/y,u/b),m=(x.xMin+x.xMax)/2,_=(x.yMin+x.yMax)/2,w=i.left+l/2-m*v,k=i.top+u/2-_*v,A=o.length,I=Math.max(0,n.trackWidth),O=Math.max(0,n.trackPadding),N=I*A+O*Math.max(0,A-1),M=N>v?v/Math.max(1,A):I+O,E=N>v?it(M-O,1,M):I,B=o.map(S=>{let T=L(S.datum,n.value,S.index);return U(T)&&isFinite(T)?T:null}),Q=pt(B)??0,F=o.map(S=>{let T=n.maxValue;if(Array.isArray(T)){let V=T[S.index];return(U(V)?V:Q)||1}return(L(S.datum,T,S.index)??Q)||1}),q=o.map((S,T)=>{let z=n.reverseOrder?A-1-T:T,V=v-z*M,D=it(V-E,0,V-1),mt=B[T],nt=F[T],Bt=mt===null?0:it(mt/nt,0,1),Yt=mt===null?0:Math.max(Math.abs(Bt*d),p);return{data:S.datum,index:S.index,ringIndex:z,value:mt,startAngle:f,endAngle:f+g*Yt,innerRadius:D,outerRadius:V,padAngle:n.padAngle}}),rt=`translate(${w},${k})`;this.barGroup.attr("transform",rt),this.trackGroup.attr("transform",rt),this.arcGen.startAngle(S=>S.startAngle).endAngle(S=>S.endAngle).innerRadius(S=>S.innerRadius).outerRadius(S=>S.outerRadius).padAngle(S=>S.padAngle).cornerRadius(n.cornerRadius);let st=n.backgroundAngleRange?.[0]??f,et=n.backgroundAngleRange?.[1]??h,Vt=this.trackGroup.selectAll(`.${Xs}`).data(n.showBackground?q:[],S=>n.id(S.data,S.index)),Ht=Vt.enter().append("path").attr("class",Xs).style("opacity",0),re=Vt.merge(Ht);R(re,a).style("opacity",1).attr("d",S=>this.arcGen({startAngle:st,endAngle:et,innerRadius:S.innerRadius,outerRadius:S.outerRadius,padAngle:S.padAngle})),R(Vt.exit(),a).style("opacity",0).remove();let ie=this.barGroup.selectAll(`.${qs}`).data(q,S=>n.id(S.data,S.index)),Dt=ie.enter().append("path").attr("class",qs).call(g0,n);ie.merge(Dt).call(x0,n,this.arcGen,a),ie.exit().attr("class",hf).call(y0,a);let le=q.length?Math.min(...q.map(S=>S.innerRadius)):v;this._renderCentralLabels(w,k,le)}_renderCentralLabels(e,n,r){let{config:i}=this;this.centralLabel.text(i.centralLabel??null),this.centralSubLabel.text(i.centralSubLabel??null),i.centralSubLabelWrap&&qe(this.centralSubLabel,r*1.9);let o=!!i.centralLabel,a=!!i.centralSubLabel,s=o?te(un(It.radialBarCentralLabelFontSize),this.element):0,c=a?te(un(It.radialBarCentralSubLabelFontSize),this.element):0,u=this.centralSubLabel.node().childElementCount||(a?1:0),f=c*1.2,h=u>0?c+(u-1)*f:0,d=o&&a?c*.25:0,g=(o?s:0)+d+h,p=-g/2+s/2,x=-g/2+(o?s+d:0)+c/2;this.centralLabel.attr("y",o?p:null).attr("dy",null),this.centralSubLabel.attr("y",a?x:null).attr("dy",null);let y=(i.centralLabelOffsetX||0)+e,b=(i.centralLabelOffsetY||0)+n,v=`translate(${y},${b})`;this.centralLabel.attr("transform",v),this.centralSubLabel.attr("transform",v)}};_0.selectors=mf;var w0=_0;var S0={components:[],container:void 0,followCursor:!0,allowHover:!1,horizontalPlacement:$.Auto,horizontalShift:0,verticalPlacement:$.Top,verticalShift:0,attributes:{},triggers:{},className:void 0,showDelay:void 0,hideDelay:void 0};var yf={};Rt(yf,{hidden:()=>ci,nonInteractive:()=>xf,positionFixed:()=>gf,root:()=>$o,show:()=>Io,tooltip:()=>qw,variables:()=>Zw});var $o=C`
654
+ font-size: var(${Nt.radialBarCentralSubLabelFontSize});
655
+ font-family: var(${Nt.radialBarCentralSubLabelFontFamily}, var(--vis-font-family));
656
+ font-weight: var(${Nt.radialBarCentralSubLabelFontWeight});
657
+ fill: var(${Nt.radialBarCentralSubLabelTextColor});
658
+ `;var $0=class extends Xe{constructor(e){super(),this._defaultConfig=C0,this.config=this._defaultConfig,this.datamodel=new qe,this.arcGen=cr(),this.events={},this.setConfig(e),this.trackGroup=this.g.append("g"),this.barGroup=this.g.append("g"),this.centralLabel=this.g.append("text").attr("class",kf),this.centralSubLabel=this.g.append("text").attr("class",Tf)}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e){let{config:n,datamodel:r,bleed:i}=this,o=r.data.map((S,A)=>({index:A,datum:S}));n.sortFunction&&o.sort((S,A)=>n.sortFunction(S.datum,A.datum));let s=U(e)?e:n.duration,a=this._width,c=this._height,l=a-i.left-i.right,u=c-i.top-i.bottom,f=n.angleRange?.[0]??0,h=n.angleRange?.[1]??2*Math.PI,d=h-f,x=d<0?-1:1,p=tt(n.barMinAngle??0,0,Math.abs(d)),g=E0(f,h),v=g.xMax-g.xMin,b=g.yMax-g.yMin,y=n.radius??Math.min(l/v,u/b),m=(g.xMin+g.xMax)/2,_=(g.yMin+g.yMax)/2,w=i.left+l/2-m*y,k=i.top+u/2-_*y,M=o.length,N=Math.max(0,n.trackWidth),P=Math.max(0,n.trackPadding),F=N*M+P*Math.max(0,M-1),R=F>y?y/Math.max(1,M):N+P,$=F>y?tt(R-P,1,R):N,B=o.map(S=>{let A=I(S.datum,n.value,S.index);return U(A)&&isFinite(A)?A:null}),et=xt(B)??0,V=o.map(S=>{let A=n.maxValue;if(Array.isArray(A)){let H=A[S.index];return(U(H)?H:et)||1}return(I(S.datum,A,S.index)??et)||1}),Z=o.map((S,A)=>{let W=n.reverseOrder?M-1-A:A,H=y-W*R,E=tt(H-$,0,H-1),yt=B[A],ot=V[A],Bt=yt===null?0:tt(yt/ot,0,1),Ut=yt===null?0:Math.max(Math.abs(Bt*d),p);return{data:S.datum,index:S.index,ringIndex:W,value:yt,startAngle:f,endAngle:f+x*Ut,innerRadius:E,outerRadius:H,padAngle:n.padAngle}}),st=`translate(${w},${k})`;this.barGroup.attr("transform",st),this.trackGroup.attr("transform",st),this.arcGen.startAngle(S=>S.startAngle).endAngle(S=>S.endAngle).innerRadius(S=>S.innerRadius).outerRadius(S=>S.outerRadius).padAngle(S=>S.padAngle).cornerRadius(n.cornerRadius);let ct=n.backgroundAngleRange?.[0]??f,it=n.backgroundAngleRange?.[1]??h,Ht=this.trackGroup.selectAll(`.${ol}`).data(n.showBackground?Z:[],S=>n.id(S.data,S.index)),Gt=Ht.enter().append("path").attr("class",ol).style("opacity",0),ie=Ht.merge(Gt);D(ie,s).style("opacity",1).attr("d",S=>this.arcGen({startAngle:ct,endAngle:it,innerRadius:S.innerRadius,outerRadius:S.outerRadius,padAngle:S.padAngle})),D(Ht.exit(),s).style("opacity",0).remove();let oe=this.barGroup.selectAll(`.${sl}`).data(Z,S=>n.id(S.data,S.index)),Et=oe.enter().append("path").attr("class",sl).call(M0,n);oe.merge(Et).call(L0,n,this.arcGen,s),oe.exit().attr("class",Sf).call(R0,s);let ce=Z.length?Math.min(...Z.map(S=>S.innerRadius)):y;this._renderCentralLabels(w,k,ce)}_renderCentralLabels(e,n,r){let{config:i}=this;this.centralLabel.text(i.centralLabel??null),this.centralSubLabel.text(i.centralSubLabel??null),i.centralSubLabelWrap&&Ge(this.centralSubLabel,r*1.9);let o=!!i.centralLabel,s=!!i.centralSubLabel,a=o?Dt(un(Nt.radialBarCentralLabelFontSize),this.element):0,c=s?Dt(un(Nt.radialBarCentralSubLabelFontSize),this.element):0,u=this.centralSubLabel.node().childElementCount||(s?1:0),f=c*1.2,h=u>0?c+(u-1)*f:0,d=o&&s?c*.25:0,x=(o?a:0)+d+h,p=-x/2+a/2,g=-x/2+(o?a+d:0)+c/2;this.centralLabel.attr("y",o?p:null).attr("dy",null),this.centralSubLabel.attr("y",s?g:null).attr("dy",null);let v=(i.centralLabelOffsetX||0)+e,b=(i.centralLabelOffsetY||0)+n,y=`translate(${v},${b})`;this.centralLabel.attr("transform",y),this.centralSubLabel.attr("transform",y)}};$0.selectors=Af;var I0=$0;var O0={components:[],container:void 0,followCursor:!0,allowHover:!1,horizontalPlacement:O.Auto,horizontalShift:0,verticalPlacement:O.Top,verticalShift:0,attributes:{},triggers:{},className:void 0,showDelay:void 0,hideDelay:void 0};var Lf={};Lt(Lf,{hidden:()=>Fo,nonInteractive:()=>Mf,positionFixed:()=>Cf,root:()=>Bo,show:()=>Po,tooltip:()=>_S,variables:()=>wS});var Bo=T`
662
659
  label: tooltip;
663
660
  display: inline-block;
664
661
  left: 0;
@@ -676,7 +673,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
676
673
  border: solid 1px var(--vis-tooltip-border-color);
677
674
  background-color: var(--vis-tooltip-background-color);
678
675
  backdrop-filter: var(--vis-tooltip-backdrop-filter);
679
- `,qw=$o,Zw=lt`
676
+ `,_S=Bo,wS=ut`
680
677
  :root {
681
678
  --vis-tooltip-background-color: rgba(255, 255, 255, 0.95);
682
679
  --vis-tooltip-border-color: #e5e9f7;
@@ -694,52 +691,52 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
694
691
  --vis-dark-tooltip-shadow-color: rgba(0,0,0, 0.95);
695
692
  }
696
693
 
697
- ${St} ${`.${$o}`} {
694
+ ${At} ${`.${Bo}`} {
698
695
  --vis-tooltip-background-color: var(--vis-dark-tooltip-background-color);
699
696
  --vis-tooltip-text-color: var(--vis-dark-tooltip-text-color);
700
697
  --vis-tooltip-border-color: var(--vis-dark-tooltip-border-color);
701
698
  --vis-tooltip-shadow-color: var(--vis-dark-tooltip-shadow-color);
702
699
  }
703
700
 
704
- ${St} {
701
+ ${At} {
705
702
  --vis-tooltip-background-color: rgba(30,30,30, 0.95);
706
703
  --vis-tooltip-text-color: #e5e9f7;
707
704
  --vis-tooltip-border-color: var(--vis-color-grey);
708
705
  --vis-tooltip-shadow-color: rgba(0,0,0, 0.95);
709
706
  }
710
- `,gf=C`
707
+ `,Cf=T`
711
708
  bottom: unset;
712
709
  position: fixed;
713
- `,Io=C`
710
+ `,Po=T`
714
711
  opacity: 1;
715
- `,ci=C`
712
+ `,Fo=T`
716
713
  display: none;
717
- `,xf=C`
714
+ `,Mf=T`
718
715
  label: non-interactive;
719
716
  pointer-events: none;
720
717
  user-select: none;
721
- `;var k0=class{constructor(e={}){this._defaultConfig=S0,this.config=this._defaultConfig,this._setUpEventsThrottled=Sr(this._setUpEvents,500),this._setContainerPositionThrottled=Sr(this._setContainerPosition,500),this._isShown=!1,this.element=document.createElement("div"),this.div=W(this.element).attr("class",$o).classed(Io,!1).classed(ci,!0),this.setConfig(e),this.components=this.config.components,this._mutationObserver=new MutationObserver(()=>{this._isShown&&(!this.config.followCursor&&this._hoveredElement?this.placeByElement(this._hoveredElement):this._position&&this.place({x:this._position[0],y:this._position[1]}))}),this._mutationObserver.observe(this.div.node(),{childList:!0,subtree:!0})}setConfig(e){this.prevConfig=this.config,this.config=Qt(this._defaultConfig,e),this.prevConfig.horizontalPlacement!==this.config.horizontalPlacement&&this.overrideHorizontalPlacement(void 0),this.config.container&&this.config.container!==this.prevConfig?.container&&this.setContainer(this.config.container),this._setUpAttributes()}setContainer(e){this.element.parentNode?.removeChild(this.element),this._container=e,this._container.appendChild(this.element),this._setContainerPositionThrottled()}getContainer(){return this._container}hasContainer(){return!!this._container&&this._container.isConnected}setComponents(e){this.components=e}update(){this._container&&this._setUpEventsThrottled()}show(e,n){this.render(e),this.place(n)}_hide(){this.div.classed(Io,!1).on("transitionend",()=>{this.div.classed(ci,!this._isShown)}),this._isShown=!1}hide(){window.clearTimeout(this._showDelayTimeoutId),this.config.hideDelay?(window.clearTimeout(this._hideDelayTimeoutId),this._hideDelayTimeoutId=setTimeout(()=>this._hide(),this.config.hideDelay)):this._hide()}_display(){window.clearTimeout(this._hideDelayTimeoutId),this.div.classed(ci,!1),this.element.getBoundingClientRect(),this.div.classed(Io,!0),this._isShown=!0}display(){this._isShown||(this.config.showDelay?(window.clearTimeout(this._showDelayTimeoutId),this._showDelayTimeoutId=setTimeout(()=>{this._display(),this.place({x:this._position[0],y:this._position[1]})},this.config.showDelay)):this._display())}place(e){if(this._position=[e.x,e.y],!this.hasContainer()){console.warn("Unovis | Tooltip: Container was not set or is not initialized yet");return}let{config:n}=this,r=this.element.offsetWidth,i=this.element.offsetHeight,o=this._overriddenHorizontalPlacement||(n.horizontalPlacement===$.Auto?$.Center:n.horizontalPlacement),a=n.verticalPlacement===$.Auto?e.y-i<0?$.Bottom:$.Top:n.verticalPlacement,s=5,c=o===$.Left?-r-s-n.horizontalShift:o===$.Center?-r/2:s+n.horizontalShift,l=a===$.Bottom?s+n.verticalShift:a===$.Center?-i/2:-s-n.verticalShift-i,[u,f]=this._constraintPosToContainer(e.x+c,e.y+l,r,i);this._applyPosition(u,f,i)}placeByElement(e){let{config:n}=this;this._hoveredElement=e;let r=5,i=this.element.offsetWidth,o=this.element.offsetHeight,a=this.isContainerBody(),s=a?window.innerWidth:this._container.scrollWidth,c=e.getBoundingClientRect(),l=a?[c.x,c.y]:Ce({clientX:c.x,clientY:c.y,pageX:c.x,pageY:c.y},this._container),u=this._overriddenHorizontalPlacement||(n.horizontalPlacement===$.Auto?l[0]-i<0?$.Right:l[0]+i>s?$.Left:$.Center:n.horizontalPlacement),f=0;switch(u){case $.Left:f=-i-r-n.horizontalShift;break;case $.Right:f=c.width+r+n.horizontalShift;break;case $.Center:default:f=(-i+c.width)/2;break}let h=n.verticalPlacement===$.Auto?u!==$.Center?$.Center:l[1]-o<0?$.Bottom:$.Top:n.verticalPlacement,d=-o;switch(h){case $.Center:d+=(o+c.height)/2;break;case $.Bottom:d+=o+c.height+r+n.verticalShift;break;case $.Top:default:d+=-r-n.verticalShift;break}let[g,p]=this._constraintPosToContainer(l[0]+f,l[1]+d,i,o);this._applyPosition(g,p,o)}isContainerBody(){return this._container===document.body}overrideHorizontalPlacement(e){this._overriddenHorizontalPlacement=e}render(e){let{config:n,prevConfig:r}=this;e instanceof HTMLElement?this.div.select(":first-child").node()!==e&&this.div.html("").append(()=>e):e!=null&&e!==""&&this.div.html(e),this.div.classed(n.className??"",!!n.className).classed(xf,!n.allowHover),r?.className&&r.className!==n.className&&this.div.classed(r.className,!1),this.display()}_applyPosition(e,n,r){let i=this.isContainerBody(),o=i?window.innerHeight:this._container.scrollHeight;this.div.classed(gf,i).style("top",i?`${n}px`:"unset").style("bottom",i?"unset":`${o-n-r}px`).style("left",`${e}px`)}_constraintPosToContainer(e,n,r,i){let o=this.isContainerBody(),a=o?window.innerHeight:this._container.scrollHeight,s=o?window.innerWidth:this._container.scrollWidth,c=10,l=e>s-r-c,u=e<c,f=l?s-r-c:u?c:e,h=10,d=n>a-i-h,g=n<h,p=d?a-i-h:g?h:n;return[s<r?0:f,a<i?0:p]}_setContainerPosition(){this._container!==document.body&&getComputedStyle(this._container)?.position==="static"&&(this._container.style.position="relative")}_setUpEvents(){let{config:e}=this;[...this.components.map(r=>r.element),this._container].forEach(r=>{let i=W(r);i.on("mousemove.tooltip",o=>{let{config:a}=this,s=o.composedPath&&o.composedPath()||o.path||[o.target];if(!s.includes(this.element)){for(let c of Object.keys(a.triggers)){let l=a.triggers[c];if(l)for(let u of s){if(u===i.node())break;if(u.classList.contains(c)){let f=i.selectAll(`.${c}`).nodes(),h=f.indexOf(u),d=W(u).datum(),g=l(d,h,f),[p,x]=this.isContainerBody()?[o.clientX,o.clientY]:Ce(o,this._container);g===null?this.hide():(this.render(g),a.followCursor?this.place({x:p,y:x}):this.placeByElement(u)),o.stopPropagation();return}}}if(a.followCursor&&!this.div.classed(ci)){let[c,l]=this.isContainerBody()?[o.clientX,o.clientY]:Ce(o,this._container);this.place({x:c,y:l})}this._isShown&&this.hide()}}).on("mouseleave.tooltip",o=>{o.stopPropagation(),this.hide()})}),e.allowHover?this.div.on("mouseenter.tooltip",this._display.bind(this)).on("mouseleave.tooltip",this.hide.bind(this)):this.div.on("mouseenter.tooltip",null).on("mouseleave.tooltip",null)}_setUpAttributes(){let e=this.config.attributes;e&&Object.keys(e).forEach(n=>{this.div.attr(n,e[n])})}destroy(){this._mutationObserver.disconnect(),window.clearTimeout(this._hideDelayTimeoutId),window.clearTimeout(this._showDelayTimeoutId),this.div?.remove()}};k0.selectors=yf;var C0=k0;var Bo=(t=>(t.X="x",t.XY="xy",t))(Bo||{});var T0={...ct,yStacked:void 0,baseline:null,duration:100,tooltip:void 0,template:(t,e,n,r)=>"",hideWhenFarFromPointer:!0,hideWhenFarFromPointerDistance:100,snapToData:!0,snapMode:Bo.X,getCircles:void 0,color:void 0,strokeColor:void 0,strokeWidth:void 0,circleRadius:4,showHorizontalLine:!1,onCrosshairMove:void 0,forceShowAt:void 0,skipRangeCheck:!1,visibilityThreshold:.35};var Sf={};Rt(Sf,{circle:()=>wf,cssVarDefaults:()=>vf,line:()=>bf,lineHorizontal:()=>_f,root:()=>A0,variables:()=>_e});var A0=C`
718
+ `;var N0=class{constructor(e={}){this._defaultConfig=O0,this.config=this._defaultConfig,this._setUpEventsThrottled=Cr(this._setUpEvents,500),this._setContainerPositionThrottled=Cr(this._setContainerPosition,500),this._isShown=!1,this.element=document.createElement("div"),this.div=Y(this.element).attr("class",Bo).classed(Po,!1).classed(Fo,!0),this.setConfig(e),this.components=this.config.components,this._mutationObserver=new MutationObserver(()=>{this._isShown&&(!this.config.followCursor&&this._hoveredElement?this.placeByElement(this._hoveredElement):this._position&&this.place({x:this._position[0],y:this._position[1]}))}),this._mutationObserver.observe(this.div.node(),{childList:!0,subtree:!0})}setConfig(e){this.prevConfig=this.config,this.config=te(this._defaultConfig,e),this.prevConfig.horizontalPlacement!==this.config.horizontalPlacement&&this.overrideHorizontalPlacement(void 0),this.config.container&&this.config.container!==this.prevConfig?.container&&this.setContainer(this.config.container),this._setUpAttributes()}setContainer(e){this.element.parentNode?.removeChild(this.element),this._container=e,this._container.appendChild(this.element),this._setContainerPositionThrottled()}getContainer(){return this._container}hasContainer(){return!!this._container&&this._container.isConnected}setComponents(e){this.components=e}update(){this._container&&this._setUpEventsThrottled()}show(e,n){this.render(e),this.place(n)}_hide(){this.div.classed(Po,!1).on("transitionend",()=>{this.div.classed(Fo,!this._isShown)}),this._isShown=!1}hide(){window.clearTimeout(this._showDelayTimeoutId),this.config.hideDelay?(window.clearTimeout(this._hideDelayTimeoutId),this._hideDelayTimeoutId=setTimeout(()=>this._hide(),this.config.hideDelay)):this._hide()}_display(){window.clearTimeout(this._hideDelayTimeoutId),this.div.classed(Fo,!1).classed(Po,!0),this._isShown=!0}display(){this._isShown||(this.config.showDelay?(window.clearTimeout(this._showDelayTimeoutId),this._showDelayTimeoutId=setTimeout(()=>{this._display(),this.place({x:this._position[0],y:this._position[1]})},this.config.showDelay)):this._display())}place(e){if(this._position=[e.x,e.y],!this.hasContainer()){console.warn("Unovis | Tooltip: Container was not set or is not initialized yet");return}let{config:n}=this,r=this.element.offsetWidth,i=this.element.offsetHeight,o=this._overriddenHorizontalPlacement||(n.horizontalPlacement===O.Auto?O.Center:n.horizontalPlacement),s=n.verticalPlacement===O.Auto?e.y-i<0?O.Bottom:O.Top:n.verticalPlacement,a=5,c=o===O.Left?-r-a-n.horizontalShift:o===O.Center?-r/2:a+n.horizontalShift,l=s===O.Bottom?a+n.verticalShift:s===O.Center?-i/2:-a-n.verticalShift-i,[u,f]=this._constraintPosToContainer(e.x+c,e.y+l,r,i);this._applyPosition(u,f,i)}placeByElement(e){let{config:n}=this;this._hoveredElement=e;let r=5,i=this.element.offsetWidth,o=this.element.offsetHeight,s=this.isContainerBody(),a=s?window.innerWidth:this._container.scrollWidth,c=e.getBoundingClientRect(),l=s?[c.x,c.y]:He({clientX:c.x,clientY:c.y,pageX:c.x,pageY:c.y},this._container),u=this._overriddenHorizontalPlacement||(n.horizontalPlacement===O.Auto?l[0]-i<0?O.Right:l[0]+i>a?O.Left:O.Center:n.horizontalPlacement),f=0;switch(u){case O.Left:f=-i-r-n.horizontalShift;break;case O.Right:f=c.width+r+n.horizontalShift;break;case O.Center:default:f=(-i+c.width)/2;break}let h=n.verticalPlacement===O.Auto?u!==O.Center?O.Center:l[1]-o<0?O.Bottom:O.Top:n.verticalPlacement,d=-o;switch(h){case O.Center:d+=(o+c.height)/2;break;case O.Bottom:d+=o+c.height+r+n.verticalShift;break;case O.Top:default:d+=-r-n.verticalShift;break}let[x,p]=this._constraintPosToContainer(l[0]+f,l[1]+d,i,o);this._applyPosition(x,p,o)}isContainerBody(){return this._container===document.body}overrideHorizontalPlacement(e){this._overriddenHorizontalPlacement=e}render(e){let{config:n,prevConfig:r}=this;e instanceof HTMLElement?this.div.select(":first-child").node()!==e&&this.div.html("").append(()=>e):e!=null&&e!==""&&this.div.html(e),this.div.classed(n.className??"",!!n.className).classed(Mf,!n.allowHover),r?.className&&r.className!==n.className&&this.div.classed(r.className,!1),this.display()}_applyPosition(e,n,r){let i=this.isContainerBody(),o=i?window.innerHeight:this._container.scrollHeight;this.div.classed(Cf,i).style("top",i?`${n}px`:"unset").style("bottom",i?"unset":`${o-n-r}px`).style("left",`${e}px`)}_constraintPosToContainer(e,n,r,i){let o=this.isContainerBody(),s=o?window.innerHeight:this._container.scrollHeight,a=o?window.innerWidth:this._container.scrollWidth,c=10,l=e>a-r-c,u=e<c,f=l?a-r-c:u?c:e,h=10,d=n>s-i-h,x=n<h,p=d?s-i-h:x?h:n;return[a<r?0:f,s<i?0:p]}_setContainerPosition(){this._container!==document.body&&getComputedStyle(this._container)?.position==="static"&&(this._container.style.position="relative")}_setUpEvents(){let{config:e}=this;this.components.forEach(n=>{let r=Y(n.element);r.on("mousemove.tooltip",i=>{let{config:o}=this,s=i.composedPath&&i.composedPath()||i.path||[i.target];for(let a of Object.keys(o.triggers)){let c=o.triggers[a];if(c)for(let l of s){if(l===r.node())break;if(l.classList.contains(a)){let u=r.selectAll(`.${a}`).nodes(),f=u.indexOf(l),h=Y(l).datum(),d=c(h,f,u),[x,p]=this.isContainerBody()?[i.clientX,i.clientY]:He(i,this._container);d===null?this.hide():(this.render(d),o.followCursor?this.place({x,y:p}):this.placeByElement(l)),i.stopPropagation();return}}}this._isShown&&this.hide()}).on("mouseleave.tooltip",i=>{i.stopPropagation(),this.hide()})}),e.allowHover?this.div.on("mouseenter.tooltip",this._display.bind(this)).on("mouseleave.tooltip",this.hide.bind(this)):this.div.on("mouseenter.tooltip",null).on("mouseleave.tooltip",null)}_setUpAttributes(){let e=this.config.attributes;e&&Object.keys(e).forEach(n=>{this.div.attr(n,e[n])})}destroy(){this._mutationObserver.disconnect(),window.clearTimeout(this._hideDelayTimeoutId),window.clearTimeout(this._showDelayTimeoutId),this.div?.remove()}};N0.selectors=Lf;var B0=N0;var zo=(t=>(t.X="x",t.XY="xy",t))(zo||{});var P0={...ft,yStacked:void 0,baseline:null,duration:100,tooltip:void 0,template:(t,e,n,r)=>"",hideWhenFarFromPointer:!0,hideWhenFarFromPointerDistance:100,snapToData:!0,snapMode:zo.X,getCircles:void 0,color:void 0,strokeColor:void 0,strokeWidth:void 0,circleRadius:4,showHorizontalLine:!1,onCrosshairMove:void 0,forceShowAt:void 0,skipRangeCheck:!1,visibilityThreshold:.35};var If={};Lt(If,{circle:()=>$f,cssVarDefaults:()=>Rf,line:()=>Ef,lineHorizontal:()=>Df,root:()=>F0,variables:()=>we});var F0=T`
722
719
  label: crosshair-component;
723
- `,vf={"--vis-crosshair-line-stroke-color":"#888","--vis-crosshair-line-stroke-width":"1px","--vis-crosshair-line-stroke-opacity":"1","--vis-crosshair-line-stroke-dasharray":"none","--vis-crosshair-circle-stroke-color":"#fff","--vis-crosshair-circle-stroke-width":"1px","--vis-crosshair-circle-stroke-opacity":"0.75"},_e=pe(vf);me(vf,A0);var bf=C`
724
- stroke: var(${_e.crosshairLineStrokeColor});
725
- stroke-width: var(${_e.crosshairLineStrokeWidth});
726
- stroke-opacity: var(${_e.crosshairLineStrokeOpacity});
727
- stroke-dasharray: var(${_e.crosshairLineStrokeDasharray});
720
+ `,Rf={"--vis-crosshair-line-stroke-color":"#888","--vis-crosshair-line-stroke-width":"1px","--vis-crosshair-line-stroke-opacity":"1","--vis-crosshair-line-stroke-dasharray":"none","--vis-crosshair-circle-stroke-color":"#fff","--vis-crosshair-circle-stroke-width":"1px","--vis-crosshair-circle-stroke-opacity":"0.75"},we=me(Rf);ge(Rf,F0);var Ef=T`
721
+ stroke: var(${we.crosshairLineStrokeColor});
722
+ stroke-width: var(${we.crosshairLineStrokeWidth});
723
+ stroke-opacity: var(${we.crosshairLineStrokeOpacity});
724
+ stroke-dasharray: var(${we.crosshairLineStrokeDasharray});
728
725
  pointer-events: none;
729
- `,_f=C`
730
- stroke: var(${_e.crosshairLineStrokeColor});
731
- stroke-width: var(${_e.crosshairLineStrokeWidth});
732
- stroke-opacity: var(${_e.crosshairLineStrokeOpacity});
733
- stroke-dasharray: var(${_e.crosshairLineStrokeDasharray});
726
+ `,Df=T`
727
+ stroke: var(${we.crosshairLineStrokeColor});
728
+ stroke-width: var(${we.crosshairLineStrokeWidth});
729
+ stroke-opacity: var(${we.crosshairLineStrokeOpacity});
730
+ stroke-dasharray: var(${we.crosshairLineStrokeDasharray});
734
731
  pointer-events: none;
735
- `,wf=C`
736
- stroke: var(${_e.crosshairCircleStrokeColor});
737
- stroke-width: var(${_e.crosshairCircleStrokeWidth});
738
- stroke-opacity: var(${_e.crosshairCircleStrokeOpacity});
732
+ `,$f=T`
733
+ stroke: var(${we.crosshairCircleStrokeColor});
734
+ stroke-width: var(${we.crosshairCircleStrokeWidth});
735
+ stroke-opacity: var(${we.crosshairCircleStrokeOpacity});
739
736
  pointer-events: none;
740
- `;var M0=class extends ut{constructor(e){super(),this.clippable=!0,this._defaultConfig=T0,this.config=this._defaultConfig,this._xPx=void 0,this._yPx=void 0,this._mouseEvent=void 0,this._animFrameId=null,this._accessors={x:void 0,y:void 0,yStacked:void 0,baseline:void 0},this._colorKeys=[],this.setConfig(e),this.g.style("opacity",0),this.line=this.g.append("line").attr("class",bf),this.lineHorizontal=this.g.append("line").attr("class",_f).style("display","none")}set colorKeys(e){this._colorKeys=e}get colorKeys(){return this.config.colorKeys??this._colorKeys}set accessors(e){this._accessors=e}get accessors(){let{config:e}=this,n=!!(e.x||e.y||e.yStacked),r=n?e.x:this._accessors.x,i=n?e.y:this._accessors.y,o=i?At(i)?i:[i]:void 0,a=n?e.yStacked:this._accessors.yStacked,s=e.baseline??this._accessors.baseline;return{x:r,y:o,yStacked:a,baseline:s}}_isContainerInViewport(){if(!this.container?.node())return!1;let e=this.container.node().getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=Math.max(0,Math.min(e.right,n)-Math.max(e.left,0)),o=Math.max(0,Math.min(e.bottom,r)-Math.max(e.top,0)),a=e.width*e.height,s=i*o;return a>0&&s/a>=this.config.visibilityThreshold}get bleed(){let{config:{circleRadius:e}}=this;return{top:e,left:e,right:e}}setContainer(e){this.container!==e&&(this.container=e,this.container.on("mousemove.crosshair",this._onMouseMove.bind(this)),this.container.on("mouseout.crosshair",this._onMouseOut.bind(this)),this.container.on("wheel.crosshair",this._onWheel.bind(this)))}_render(e){let{config:n,datamodel:r}=this,i=U(e)?e:n.duration,o=n.forceShowAt!==void 0,a=o?this.xScale(n.forceShowAt):this._xPx,s=this.xScale.invert(a),c=r.data?.length&&this.accessors.x?r.data.indexOf(vi(r.data,s,this.accessors.x,Be.Left)):void 0,l,u,f;if(n.snapToData)if(!this.accessors.y&&!this.accessors.yStacked&&r.data?.length&&console.warn("Unovis | Crosshair: Y accessors have not been configured. Please check if they're present in the configuration object"),!r.data?.length&&this._mouseEvent&&console.warn("Unovis | Crosshair: No data to snap to. Make sure the data has been passed to the container or to the crosshair itself"),n.snapMode===Bo.XY&&!o&&this._yPx!==void 0){let I=mh(r.data,[this._xPx,this._yPx],this.xScale,this.yScale,this.accessors.x,this.accessors.y,this.accessors.yStacked,this.accessors.baseline);I&&(l=I.datum,u=I.index,f=I.distanceSq)}else l=vi(r.data,s,this.accessors.x),u=r.data.indexOf(l);let h=this.xScale.range(),d=this.yScale.range(),g=n.snapToData&&l?it(Math.round(this.xScale(L(l,this.accessors.x,u))),0,this._width):it(a,h[0],h[1]),p=a>=h[0]&&a<=h[1],x=this._yPx>=Math.min(d[0],d[1])&&this._yPx<=Math.max(d[0],d[1]),y=n.skipRangeCheck?!!this._xPx:this._xPx?p&&x:p,b=f!==void 0?Math.sqrt(f):Math.abs(g-+a);n.hideWhenFarFromPointer&&b>=n.hideWhenFarFromPointerDistance&&(y=!1);let v=n.tooltip??this.tooltip;if(y&&v&&this._isContainerInViewport()){let A=v.getContainer()||this.container.node(),I=v.isContainerBody(),N=(this.accessors.x&&l!==void 0?L(l,this.accessors.x,u):void 0)??s;if(o){let M=this.container.node().getBoundingClientRect(),E=(I?a+M.left:a)+this._containerMargin.left,B=this._height/2+(I?M.top:0),Q=[E,B];this._showTooltip(l,N,Q,c)}else if(this._mouseEvent){let M=I?[this._mouseEvent.clientX,this._mouseEvent.clientY]:Ce(this._mouseEvent,A);this._showTooltip(l,N,M,c)}}else this._hideTooltip();if(this._mouseEvent&&(n.onCrosshairMove?.(y?this.xScale.invert(this._xPx):void 0,l,u,this._mouseEvent),this._mouseEvent=void 0),R(this.g,i).style("opacity",y?1:0),!isFinite(a))return;let m=Kt(n.getCircles)?n.getCircles(s,r.data,this.yScale,c):this.getCircleData(l,u);this.line.attr("y1",0).attr("y2",this._height),R(this.line,i,qr).attr("x1",g).attr("x2",g);let _=n.showHorizontalLine?this.getLineHorizontalY(m):void 0;this.lineHorizontal.style("display",_===void 0?"none":null).attr("x1",0).attr("x2",this._width),_!==void 0&&R(this.lineHorizontal,i,qr).attr("y1",_).attr("y2",_);let w=this.g.selectAll("circle").data(m,(A,I)=>A.id??I),k=w.enter().append("circle").attr("class",wf).attr("r",0).attr("cx",g).attr("cy",A=>A.y).style("fill",A=>A.color).style("stroke",A=>A.strokeColor).style("stroke-width",A=>A.strokeWidth);R(k.merge(w),i,qr).attr("cx",g).attr("cy",A=>A.y).attr("r",n.circleRadius).style("opacity",A=>A.opacity).style("fill",A=>A.color).style("stroke",A=>A.strokeColor).style("stroke-width",A=>A.strokeWidth),R(w.exit(),i,qr).attr("r",0).style("opacity",0).remove().on("interrupt",function(){this.remove()})}hide(e){window.cancelAnimationFrame(this._animFrameId),this._animFrameId=window.requestAnimationFrame(()=>{this._xPx=void 0,this._yPx=void 0,this._mouseEvent=void 0,this.config.onCrosshairMove?.(void 0,void 0,void 0,e),this._render()})}_onMouseMove(e){let{datamodel:n,element:r}=this;!this.accessors.x&&n.data?.length&&console.warn("Unovis | Crosshair: X accessor function has not been configured. Please check if it's present in the configuration object");let[i,o]=Ce(e,r);this._xPx=i,this._yPx=o,this._mouseEvent=e,window.cancelAnimationFrame(this._animFrameId),this._animFrameId=window.requestAnimationFrame(()=>{this._render()})}_onMouseOut(e){(!e||!this.container?.node().contains(e.relatedTarget))&&this.hide(e)}_onWheel(e){this.hide(e)}_onDestroy(){window.cancelAnimationFrame(this._animFrameId),this.container?.on(".crosshair",null)}_showTooltip(e,n,r,i){let{config:o,datamodel:a}=this,s=o.tooltip??this.tooltip;if(!s||!r)return;let[c,l]=r,u=o.template(e,n,a.data,i);if(s.config.followCursor=!0,!s.config.horizontalPlacement||s.config.horizontalPlacement===$.Auto){let f=s.isContainerBody()?c-this.container.node().getBoundingClientRect().left:c;s.overrideHorizontalPlacement(f>this._containerWidth/2?$.Left:$.Right)}u&&s.show(u,{x:c,y:l})}_hideTooltip(){let{config:e}=this;(e.tooltip??this.tooltip)?.hide()}getYDataExtent(){return[void 0,void 0]}getLineHorizontalY(e){let n=this._yPx,r=e.filter(o=>o.opacity!==0&&isFinite(o.y)).map(o=>o.y),i=(n===void 0?r[0]:Ko(r,o=>Math.abs(o-n)))??n;return isFinite(i)?it(Math.round(i),0,this._height):void 0}getCircleData(e,n){let{config:r}=this,i={colorFn:this._colorFunction},o=this.colorKeys;if(r.snapToData&&e){let a=this.accessors.y??[],s=this.accessors.yStacked??[],c=L(e,this.accessors.baseline,n)||0,l=dl(e,n,...s).map((f,h)=>({id:`stacked-${h}`,y:this.yScale(f+c),opacity:U(L(e,s[h],h))?1:0,color:H(e,r.color,h,o?.[h],i),strokeColor:r.strokeColor?H(e,r.strokeColor,h,o?.[h],i):void 0,strokeWidth:r.strokeWidth?L(e,r.strokeWidth,h):void 0})),u=a.map((f,h)=>{let d=L(e,f,n);return{id:`regular-${h}`,y:this.yScale(d),opacity:U(d)?1:0,color:H(e,r.color,l.length+h,o?.[l.length+h],i),strokeColor:r.strokeColor?H(e,r.strokeColor,h,o?.[h],i):void 0,strokeWidth:r.strokeWidth?L(e,r.strokeWidth,h):void 0}});return l.concat(u).filter(f=>U(f.y))}return[]}};M0.selectors=Sf;var D0=M0;var R0={items:[],labelClassName:"",onLegendItemClick:void 0,labelFontSize:null,labelMaxWidth:null,bulletSize:null,bulletSpacing:4,bulletShape:t=>t.shape??Zt.Circle,orientation:Ao.Horizontal,renderIntoProvidedDomNode:!1};var Zs=Pe*3,jw={[Zt.Circle]:Math.PI/4,[Zt.Cross]:5/9,[Zt.Diamond]:Math.sqrt(3)/6,[Zt.Square]:1,[Zt.Star]:.3,[Zt.Triangle]:Math.sqrt(3)/4,[Zt.Wye]:5/11};function kf(t,e,n){return e<1?0:t*e+n*(e-1)}function E0(t){t.each((e,n,r)=>{W(r[n]).append("svg").attr("width","100%").attr("height","100%").append("path")})}function L0(t,e,n,r){let i={colorFn:r};t.each((o,a,s)=>{let c=G(o,e.bulletShape,a),l=gh(o.color??H(o,n,a,o.colorKey,i)),u=l.length,f=Zs,h=Jt(e.bulletSize)||te("var(--vis-legend-bullet-size)",s[a]),d=e.bulletSpacing*(Zs/h),g=kf(f,u,d),p=c===Zt.Line?Zs/2.5:Zs,x=W(s[a]).select("svg").attr("viewBox",`0 0 ${g} ${p}`);x.selectAll("path").remove();let y=o.inactive?"var(--vis-legend-bullet-inactive-opacity)":1,b=ft(o,o.pattern,a),v=yt(b),m=x.node();l.forEach((_,w)=>{let k=x.append("path").attr(dt,a),A=Wr(b,_,m);if(c===Zt.Line){let I=w*(f+d),O=I+f;k.attr("d",`M${I},${p/2} L${O},${p/2}`).attr("transform",null).style("opacity",y).style("stroke",_).style("stroke-width","3px").style("fill",null).style("fill-opacity",null).style("marker",A?.marker??null).style("stroke-dasharray",A?.dashArray??null).style("marker-start","none").style("marker-end","none")}else{let I=ti().type(ks[c]).size(f*p*jw[c]),O=(f-2)/f,N=p/2;switch(c){case Zt.Triangle:N+=p/8;break;case Zt.Star:N+=p/16;break;case Zt.Wye:N-=p/16;break}let M=w*(f+d)+f/2;k.attr("d",I).attr("transform",`translate(${M}, ${Math.round(N)}) scale(${O})`).style("stroke",_).style("stroke-width","1px").style("opacity",null).style("fill",_).style("fill-opacity",y).style("mask",v)}})})}var Af={};Rt(Af,{bullet:()=>Qs,clickable:()=>Tf,item:()=>Oo,itemVertical:()=>Cf,label:()=>Ks,root:()=>js,variables:()=>Kw});var js=C`
737
+ `;var z0=class extends ht{constructor(e){super(),this.clippable=!0,this._defaultConfig=P0,this.config=this._defaultConfig,this._xPx=void 0,this._yPx=void 0,this._mouseEvent=void 0,this._animFrameId=null,this._accessors={x:void 0,y:void 0,yStacked:void 0,baseline:void 0},this._colorKeys=[],this.setConfig(e),this.g.style("opacity",0),this.line=this.g.append("line").attr("class",Ef),this.lineHorizontal=this.g.append("line").attr("class",Df).style("display","none")}set colorKeys(e){this._colorKeys=e}get colorKeys(){return this.config.colorKeys??this._colorKeys}set accessors(e){this._accessors=e}get accessors(){let{config:e}=this,n=!!(e.x||e.y||e.yStacked),r=n?e.x:this._accessors.x,i=n?e.y:this._accessors.y,o=i?mt(i)?i:[i]:void 0,s=n?e.yStacked:this._accessors.yStacked,a=e.baseline??this._accessors.baseline;return{x:r,y:o,yStacked:s,baseline:a}}_isContainerInViewport(){if(!this.container?.node())return!1;let e=this.container.node().getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=Math.max(0,Math.min(e.right,n)-Math.max(e.left,0)),o=Math.max(0,Math.min(e.bottom,r)-Math.max(e.top,0)),s=e.width*e.height,a=i*o;return s>0&&a/s>=this.config.visibilityThreshold}get bleed(){let{config:{circleRadius:e}}=this;return{top:e,left:e,right:e}}setContainer(e){this.container!==e&&(this.container=e,this.container.on("mousemove.crosshair",this._onMouseMove.bind(this)),this.container.on("mouseout.crosshair",this._onMouseOut.bind(this)),this.container.on("wheel.crosshair",this._onWheel.bind(this)))}_render(e){let{config:n,datamodel:r}=this,i=U(e)?e:n.duration,o=n.forceShowAt!==void 0,s=o?this.xScale(n.forceShowAt):this._xPx,a=this.xScale.invert(s),c=r.data?.length&&this.accessors.x?r.data.indexOf(Si(r.data,a,this.accessors.x,Oe.Left)):void 0,l,u,f;if(n.snapToData)if(!this.accessors.y&&!this.accessors.yStacked&&r.data?.length&&console.warn("Unovis | Crosshair: Y accessors have not been configured. Please check if they're present in the configuration object"),!r.data?.length&&this._mouseEvent&&console.warn("Unovis | Crosshair: No data to snap to. Make sure the data has been passed to the container or to the crosshair itself"),n.snapMode===zo.XY&&!o&&this._yPx!==void 0){let N=Ch(r.data,[this._xPx,this._yPx],this.xScale,this.yScale,this.accessors.x,this.accessors.y,this.accessors.yStacked,this.accessors.baseline);N&&(l=N.datum,u=N.index,f=N.distanceSq)}else l=Si(r.data,a,this.accessors.x),u=r.data.indexOf(l);let h=this.xScale.range(),d=this.yScale.range(),x=n.snapToData&&l?tt(Math.round(this.xScale(I(l,this.accessors.x,u))),0,this._width):tt(s,h[0],h[1]),p=s>=h[0]&&s<=h[1],g=this._yPx>=Math.min(d[0],d[1])&&this._yPx<=Math.max(d[0],d[1]),v=n.skipRangeCheck?!!this._xPx:this._xPx?p&&g:p,b=f!==void 0?Math.sqrt(f):Math.abs(x-+s);n.hideWhenFarFromPointer&&b>=n.hideWhenFarFromPointerDistance&&(v=!1);let y=n.tooltip??this.tooltip;if(v&&y&&this._isContainerInViewport()){let M=y.getContainer()||this.container.node(),N=y.isContainerBody(),F=(this.accessors.x&&l!==void 0?I(l,this.accessors.x,u):void 0)??a;if(o){let R=this.container.node().getBoundingClientRect(),$=(N?s+R.left:s)+this._containerMargin.left,B=this._height/2+(N?R.top:0),et=[$,B];this._showTooltip(l,F,et,c)}else if(this._mouseEvent){let R=N?[this._mouseEvent.clientX,this._mouseEvent.clientY]:He(this._mouseEvent,M);this._showTooltip(l,F,R,c)}}else this._hideTooltip();if(this._mouseEvent&&(n.onCrosshairMove?.(v?this.xScale.invert(this._xPx):void 0,l,u,this._mouseEvent),this._mouseEvent=void 0),D(this.g,i).style("opacity",v?1:0),!isFinite(s))return;let m=Jt(n.getCircles)?n.getCircles(a,r.data,this.yScale,c):this.getCircleData(l,u);this.line.attr("y1",0).attr("y2",this._height),D(this.line,i,Qr).attr("x1",x).attr("x2",x);let _=n.showHorizontalLine?this.getLineHorizontalY(m):void 0;this.lineHorizontal.style("display",_===void 0?"none":null).attr("x1",0).attr("x2",this._width),_!==void 0&&D(this.lineHorizontal,i,Qr).attr("y1",_).attr("y2",_);let w=this.g.selectAll("circle").data(m,(M,N)=>M.id??N),k=w.enter().append("circle").attr("class",$f).attr("r",0).attr("cx",x).attr("cy",M=>M.y).style("fill",M=>M.color).style("stroke",M=>M.strokeColor).style("stroke-width",M=>M.strokeWidth);D(k.merge(w),i,Qr).attr("cx",x).attr("cy",M=>M.y).attr("r",n.circleRadius).style("opacity",M=>M.opacity).style("fill",M=>M.color).style("stroke",M=>M.strokeColor).style("stroke-width",M=>M.strokeWidth),D(w.exit(),i,Qr).attr("r",0).style("opacity",0).remove().on("interrupt",function(){this.remove()})}hide(e){window.cancelAnimationFrame(this._animFrameId),this._animFrameId=window.requestAnimationFrame(()=>{this._xPx=void 0,this._yPx=void 0,this._mouseEvent=void 0,this.config.onCrosshairMove?.(void 0,void 0,void 0,e),this._render()})}_onMouseMove(e){let{datamodel:n,element:r}=this;!this.accessors.x&&n.data?.length&&console.warn("Unovis | Crosshair: X accessor function has not been configured. Please check if it's present in the configuration object");let[i,o]=He(e,r);this._xPx=i,this._yPx=o,this._mouseEvent=e,window.cancelAnimationFrame(this._animFrameId),this._animFrameId=window.requestAnimationFrame(()=>{this._render()})}_onMouseOut(e){(!e||!this.container?.node().contains(e.relatedTarget))&&this.hide(e)}_onWheel(e){this.hide(e)}_onDestroy(){window.cancelAnimationFrame(this._animFrameId),this.container?.on(".crosshair",null)}_showTooltip(e,n,r,i){let{config:o,datamodel:s}=this,a=o.tooltip??this.tooltip;if(!a||!r)return;let[c,l]=r,u=o.template(e,n,s.data,i);if(a.config.followCursor=!0,!a.config.horizontalPlacement||a.config.horizontalPlacement===O.Auto){let f=a.isContainerBody()?c-this.container.node().getBoundingClientRect().left:c;a.overrideHorizontalPlacement(f>this._containerWidth/2?O.Left:O.Right)}u&&a.show(u,{x:c,y:l})}_hideTooltip(){let{config:e}=this;(e.tooltip??this.tooltip)?.hide()}getYDataExtent(){return[void 0,void 0]}getLineHorizontalY(e){let n=this._yPx,r=e.filter(o=>o.opacity!==0&&isFinite(o.y)).map(o=>o.y),i=(n===void 0?r[0]:rs(r,o=>Math.abs(o-n)))??n;return isFinite(i)?tt(Math.round(i),0,this._height):void 0}getCircleData(e,n){let{config:r}=this,i={colorFn:this._colorFunction},o=this.colorKeys;if(r.snapToData&&e){let s=this.accessors.y??[],a=this.accessors.yStacked??[],c=I(e,this.accessors.baseline,n)||0,l=Tl(e,n,...a).map((f,h)=>({id:`stacked-${h}`,y:this.yScale(f+c),opacity:U(I(e,a[h],h))?1:0,color:X(e,r.color,h,o?.[h],i),strokeColor:r.strokeColor?X(e,r.strokeColor,h,o?.[h],i):void 0,strokeWidth:r.strokeWidth?I(e,r.strokeWidth,h):void 0})),u=s.map((f,h)=>{let d=I(e,f,n);return{id:`regular-${h}`,y:this.yScale(d),opacity:U(d)?1:0,color:X(e,r.color,l.length+h,o?.[l.length+h],i),strokeColor:r.strokeColor?X(e,r.strokeColor,h,o?.[h],i):void 0,strokeWidth:r.strokeWidth?I(e,r.strokeWidth,h):void 0}});return l.concat(u).filter(f=>U(f.y))}return[]}};z0.selectors=If;var V0=z0;var W0={items:[],labelClassName:"",onLegendItemClick:void 0,labelFontSize:null,labelMaxWidth:null,bulletSize:null,bulletSpacing:4,bulletShape:t=>t.shape??Kt.Circle,orientation:Ro.Horizontal,renderIntoProvidedDomNode:!1};var al=Pe*3,SS={[Kt.Circle]:Math.PI/4,[Kt.Cross]:5/9,[Kt.Diamond]:Math.sqrt(3)/6,[Kt.Square]:1,[Kt.Star]:.3,[Kt.Triangle]:Math.sqrt(3)/4,[Kt.Wye]:5/11};function Of(t,e,n){return e<1?0:t*e+n*(e-1)}function H0(t){t.each((e,n,r)=>{Y(r[n]).append("svg").attr("width","100%").attr("height","100%").append("path")})}function Y0(t,e,n,r){let i={colorFn:r};t.each((o,s,a)=>{let c=q(o,e.bulletShape,s),l=Mh(o.color??X(o,n,s,o.colorKey,i)),u=l.length,f=al,h=ee(e.bulletSize)||Dt("var(--vis-legend-bullet-size)",a[s]),d=e.bulletSpacing*(al/h),x=Of(f,u,d),p=c===Kt.Line?al/2.5:al,g=Y(a[s]).select("svg").attr("viewBox",`0 0 ${x} ${p}`);g.selectAll("path").remove();let v=o.inactive?"var(--vis-legend-bullet-inactive-opacity)":1,b=dt(o,o.pattern,s),y=_t(b),m=g.node();l.forEach((_,w)=>{let k=g.append("path").attr(gt,s),M=Ur(b,_,m);if(c===Kt.Line){let N=w*(f+d),P=N+f;k.attr("d",`M${N},${p/2} L${P},${p/2}`).attr("transform",null).style("opacity",v).style("stroke",_).style("stroke-width","3px").style("fill",null).style("fill-opacity",null).style("marker",M?.marker??null).style("stroke-dasharray",M?.dashArray??null).style("marker-start","none").style("marker-end","none")}else{let N=oi().type(Oa[c]).size(f*p*SS[c]),P=(f-2)/f,F=p/2;switch(c){case Kt.Triangle:F+=p/8;break;case Kt.Star:F+=p/16;break;case Kt.Wye:F-=p/16;break}let R=w*(f+d)+f/2;k.attr("d",N).attr("transform",`translate(${R}, ${Math.round(F)}) scale(${P})`).style("stroke",_).style("stroke-width","1px").style("opacity",null).style("fill",_).style("fill-opacity",v).style("mask",y)}})})}var Pf={};Lt(Pf,{bullet:()=>ul,clickable:()=>Bf,item:()=>Vo,itemVertical:()=>Nf,label:()=>cl,root:()=>ll,variables:()=>kS});var ll=T`
741
738
  label: bullet-legend-component;
742
- `,Kw=lt`
739
+ `,kS=ut`
743
740
  :root {
744
741
  // Undefined by default to allow proper fallback to var(--vis-font-family)
745
742
  /* --vis-legend-font-family: */
@@ -756,14 +753,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
756
753
  --vis-dark-legend-label-color: #eee;
757
754
  }
758
755
 
759
- ${St} ${`.${js}`} {
756
+ ${At} ${`.${ll}`} {
760
757
  --vis-legend-label-color: var(--vis-dark-legend-label-color);
761
758
  }
762
759
 
763
760
  body.theme-patterns {
764
761
  --vis-legend-bullet-size: 14px;
765
762
  }
766
- `,Oo=C`
763
+ `,Vo=T`
767
764
  label: legendItem;
768
765
  display: inline-flex;
769
766
  align-items: center;
@@ -773,13 +770,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
773
770
  cursor: default;
774
771
  user-select: none;
775
772
  max-width: min-content;
776
- `,Cf=C`
773
+ `,Nf=T`
777
774
  label: legendItemVertical;
778
775
  display: flex;
779
776
  margin-top: var(--vis-legend-vertical-item-spacing);
780
- `,Tf=C`
777
+ `,Bf=T`
781
778
  cursor: pointer;
782
- `,Ks=C`
779
+ `,cl=T`
783
780
  label: legendItemLabel;
784
781
  font-size: var(--vis-legend-label-font-size);
785
782
  display: inline-block;
@@ -789,7 +786,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
789
786
  text-overflow: ellipsis;
790
787
  overflow: hidden;
791
788
  white-space: nowrap;
792
- `,Qs=C`
789
+ `,ul=T`
793
790
  flex: 0 0 auto;
794
791
  label: legendItemBullet;
795
792
  margin-right: var(--vis-legend-bullet-label-spacing);
@@ -799,4 +796,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
799
796
  svg {
800
797
  display: block;
801
798
  }
802
- `;var $0=class{constructor(e,n){this._defaultConfig=R0,this.config=this._defaultConfig,this._colorAccessor=r=>r.color,this._container=e,this.div=n?.renderIntoProvidedDomNode?W(this._container):W(this._container).append("div"),this.div.classed(js,!0),this.element=this.div.node(),this.setConfig(n)}setConfig(e){this.prevConfig=this.config,this.config=Qt(this._defaultConfig,e),this.render()}update(e){this.setConfig(e)}render(){let{config:e}=this,n=this.div.selectAll(`.${Oo}`).data(e.items),r=n.enter().append("div").on("click",this._onItemClick.bind(this)),i=r.merge(n);i.attr("class",o=>`${Oo} ${o.className??""}`).classed(Cf,e.orientation===Ao.Vertical).classed(Tf,o=>!!e.onLegendItemClick&&this._isItemClickable(o)).attr("title",o=>o.name).style("display",o=>o.hidden?"none":null),r.append("span").attr("class",Qs).call(E0),i.select(`.${Qs}`).style("width",function(o){let s=(Array.isArray(o.color)?o.color:[o.color]).length,c=e.bulletSize?Jt(e.bulletSize):te("var(--vis-legend-bullet-size)",this)||9,l=e.bulletSpacing;return`${kf(c,s,l)}px`}).style("height",e.bulletSize).style("box-sizing","content-box").call(L0,this.config,this._colorAccessor,e.colorFunction),r.append("span").attr("class",Ks).classed(e.labelClassName,!0).style("max-width",e.labelMaxWidth).style("font-size",e.labelFontSize),i.select(`.${Ks}`).text(o=>o.name),n.exit().remove()}_isItemClickable(e){return e.pointer===void 0?!0:e.pointer}_onItemClick(e,n){let{config:{onLegendItemClick:r}}=this,o=this.div.selectAll(`.${Oo}`).nodes().indexOf(e.currentTarget);r&&r(n,o)}destroy(){this.element!==this._container&&this.div.remove()}};$0.selectors=Af;var Js=$0;var I0=t=>typeof t!="object"||t===null||Array.isArray(t)?!1:Object.keys(t).some(n=>["$field","$index","$const","$dateTickFormat","$numTickFormat","$lookup","$format","$mapField"].includes(n));function Qw(t,e,n=7){let r=e-t;if(!Number.isFinite(r)||r<=0)return;let i=[];if(r>=60*864e5){let o=Math.max(1,Math.ceil(r/2592e6/n)),a=new Date(t),s=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1));for(s.getTime()<t&&(s=new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth()+1,1)));s.getTime()<=e&&i.length<24;)i.push(s.getTime()),s=new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth()+o,1))}else{let o=r>=1728e5?864e5:r>=72e5?36e5:6e4,a=o===864e5?[1,2,7,14]:o===36e5?[1,2,3,6,12]:[1,2,5,10,15,30],s=r/o/n,c=(a.find(l=>l>=s)??Math.ceil(s))*o;for(let l=Math.ceil(t/c)*c;l<=e&&i.length<24;l+=c)i.push(l)}return i.length>=2?i:void 0}function B0(t,e){let n=1/0,r=-1/0;for(let i of t){let o=i[e];if(o==null||o==="")continue;let a=typeof o=="number"?o:new Date(String(o)).getTime();Number.isNaN(a)||(a<n&&(n=a),a>r&&(r=a))}return Qw(n,r)}var Mn=class extends Error{},Jw=t=>{if(t==null||t==="")return;let e=Number(t);return Number.isNaN(e)?void 0:e},tS=t=>{if(t==null||t==="")return;if(typeof t=="number")return t;let e=new Date(t).getTime();return Number.isNaN(e)?void 0:e},eS=(t,e="en-US")=>{let n=typeof t=="number"?t:Number(t),r=Number.isFinite(n)?n:new Date(String(t)).getTime();if(!Number.isFinite(r))return String(t);let i=new Date(r),o=i.getUTCHours()===0&&i.getUTCMinutes()===0?i.getUTCDate()===1?{year:"numeric",month:"short"}:{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"};return i.toLocaleString(e,{...o,timeZone:"UTC"})},nl=(t,e="en-US")=>{let n=Number(t);return Number.isFinite(n)?n.toLocaleString(e,{maximumFractionDigits:6}):String(t)};function nS(t,e){if("$field"in t){let{$field:n,as:r}=t;return r==="number"?i=>Jw(i?.[n]):r==="date"?i=>tS(i?.[n]):i=>i?.[n]}if("$index"in t)return(n,r)=>r;if("$const"in t)return()=>t.$const;if("$dateTickFormat"in t)return n=>eS(n,e);if("$numTickFormat"in t)return n=>nl(n,e);if("$lookup"in t){let n=t.$lookup;return r=>n[Math.round(Number(r))%n.length]??String(r)}if("$format"in t){let{field:n,prefix:r="",suffix:i=""}=t.$format;return o=>{let a=o?.[n];return a==null?"":`${r}${nl(a,e)}${i}`}}if("$mapField"in t){let{field:n,mapping:r,fallback:i}=t.$mapField;return o=>r[String(o?.[n])]??i}return t}function dn(t,e){if(I0(t))return nS(t,e);if(Array.isArray(t))return t.map(n=>dn(n,e));if(typeof t=="object"&&t!==null){let n={};for(let[r,i]of Object.entries(t))n[r]=dn(i,e);return n}return t}var N0=new Set(["Line","Area","GroupedBar","StackedBar","Scatter","Timeline","Boxplot","XYLabels","Plotband","Plotline"]),rS=new Set(["Donut","NestedDonut","RadialBar","Sankey","Heatmap","Treemap","ChordDiagram","Graph","TopoJSONMap"]),iS=new Set(["Graph"]);function O0(t,e,n,r){if(!(N0.has(e.type)||rS.has(e.type)))throw new Mn(`Unsupported component type: ${e.type}`);let o=t[e.type];if(!o)throw new Mn(`Component ${e.type} is not available in this bundle \u2014 regenerate the document for this chart type`);let a=dn(e.config,r);a.duration=n.duration??0,iS.has(e.type)&&n.onComponentComplete&&(a.onRenderComplete=n.onComponentComplete);let s=a.projection;if(s?.$mapProjection){let l=t.MapProjection?.[s.$mapProjection];if(!l)throw new Mn(`Unknown map projection: ${s.$mapProjection}`);a.projection=l()}return new o(a)}function P0(t,e,n={}){if(e.specVersion!==void 0&&Math.floor(e.specVersion)>1)throw new Mn(`Chart spec version ${e.specVersion} is newer than this renderer supports (${1}) \u2014 upgrade @unovis/mcp`);let r=e.locale,i=dn(e.containerConfig??{},r),o=n.duration??0,a=n.responsive?{}:{width:e.width,height:e.height};if(e.container==="xy"){let c=e.components.map(u=>{if(!N0.has(u.type))throw new Mn(`${u.type} cannot be used in an XY container`);return O0(t,u,n,r)}),l=(u,f)=>{if(u)return new t.Axis({...dn(u,r),type:f,duration:o})};if(e.xAxis&&"$dateTickFormat"in(e.xAxis.tickFormat??{})&&e.xAxis.tickValues===void 0){let u=e.components[0]?.config?.x?.$field,f=Array.isArray(e.data)?e.data:void 0;if(u&&f){let h=B0(f,u);h&&(e={...e,xAxis:{...e.xAxis,tickValues:h}})}}return{containerType:"xy",containerConfig:{...i,components:c,xAxis:l(e.xAxis,"x"),yAxis:l(e.yAxis,"y"),...a,duration:o,onRenderComplete:n.onRenderComplete},data:e.data}}if(e.components.length!==1)throw new Mn("single container requires exactly one component");let s=O0(t,e.components[0],n,r);return{containerType:"single",containerConfig:{...i,component:s,...a,duration:o,onRenderComplete:n.onRenderComplete},data:e.data}}var Mf=t=>String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),oS=(t,e)=>t==null?"\u2014":typeof t=="number"?nl(t,e):Mf(t),Dn=(t,e,n)=>`<div class="uv-tt-row"><span class="uv-tt-key">${Mf(t)}</span><span class="uv-tt-val">${oS(e,n)}</span></div>`,Ze=t=>`<div class="uv-tt-title">${Mf(t)}</div>`;function F0(t){let e=[],n=r=>{if(Array.isArray(r)){r.forEach(n);return}if(typeof r=="object"&&r!==null){let i=r;if(typeof i.$field=="string"){e.includes(i.$field)||e.push(i.$field);return}Object.values(r).forEach(n)}};return n(t),e}var aS=t=>Object.entries(t??{}).filter(([e,n])=>!e.startsWith("_")&&(n===null||typeof n!="object"));function sS(t,e,n){return r=>{if(!r)return"";let i=e&&r[e]!==void 0?Ze(r[e]):"",o=t.length?t.filter(a=>r[a]!==void 0).map(a=>Dn(a,r[a],n)):aS(r).map(([a,s])=>Dn(a,s,n));return`${i}${o.join("")}`||Ze("no data")}}function z0(t,e){let n={},r={};for(let s of e.components){if(!t[s.type])continue;let c=F0(s.config),l=sS(c,void 0,e.locale);switch(s.type){case"Line":case"Area":break;case"GroupedBar":case"StackedBar":{let u=s.type==="StackedBar"?t.StackedBar:t.GroupedBar;r[u.selectors.bar]=l;break}case"Scatter":r[t.Scatter.selectors.point]=l;break;case"Boxplot":r[t.Boxplot.selectors.box]=l;break;case"Timeline":r[t.Timeline.selectors.line]=l;break;case"Donut":r[t.Donut.selectors.segment]=u=>l(u?.data??u);break;case"NestedDonut":r[t.NestedDonut.selectors.segment]=u=>`${Ze(u?.data?.key??"")}${Dn("value",u?.value??u?.data?.value)}`;break;case"RadialBar":r[t.RadialBar.selectors.segment]=u=>l(u?.data??u);break;case"Heatmap":r[t.Heatmap.selectors.node]=l;break;case"Treemap":r[t.Treemap.selectors.tile]=u=>`${Ze(u?.data?.key??u?.key??"")}${Dn("value",u?.value)}`;break;case"Sankey":r[t.Sankey.selectors.node]=u=>`${Ze(u?.label??u?.id??"")}${Dn("total",u?.value)}`,r[t.Sankey.selectors.link]=u=>`${Ze(`${u?.source?.label??u?.source?.id??""} \u2192 ${u?.target?.label??u?.target?.id??""}`)}${Dn("value",u?.value)}`;break;case"ChordDiagram":r[t.ChordDiagram.selectors.node]=u=>Ze(u?.data?.label??u?.key??"");break;case"Graph":r[t.Graph.selectors.node]=u=>l(u?._state?u:u?.data??u),r[t.Graph.selectors.link]=u=>Ze(`${u?.source?.id??""} \u2192 ${u?.target?.id??""}`);break;case"TopoJSONMap":r[t.TopoJSONMap.selectors.feature]=u=>{let f=u?.data??u;return!f?.id&&!f?.name?"":`${Ze(f.name??f.id)}${f.value!==void 0?Dn("value",f.value):""}`};break}}let i=e.components.find(s=>s.type==="Line"||s.type==="Area"),o=e.container==="xy"&&!!i;if((Object.keys(r).length||o)&&(n.tooltip=new t.Tooltip({triggers:r,horizontalPlacement:"center"})),o&&i){let s=dn(i.config.x,e.locale),c=F0(i.config).filter(h=>h!==i.config.x?.$field),l=e.legend?.map(h=>h.name)??c,u=i.config.x?.$field,f=e.xAxis?.tickFormat?dn(e.xAxis.tickFormat,e.locale):void 0;n.crosshair=new t.Crosshair({x:s,y:dn(i.config.y,e.locale),template:h=>{let d=u?h?.[u]:void 0,g=d!==void 0?Ze(f?f(d):d):"",p=c.map((x,y)=>Dn(l[y]??x,h?.[x],e.locale));return`${g}${p.join("")}`}})}let a=e.legend?.length?e.legend.map(s=>({name:s.name,color:s.color})):void 0;return{containerConfig:n,legendItems:a}}var Le=t=>{if(t===null||typeof t!="object")return t;let e={};for(let[n,r]of Object.entries(t))n.startsWith("_")||(r===null||typeof r=="string"||typeof r=="number"||typeof r=="boolean")&&(e[n]=r);return e},lS={GroupedBar:t=>Le(t?.datum??t),StackedBar:t=>Le(t?.datum??t),Scatter:t=>Le(t?.datum??t),Boxplot:t=>Le(t?.datum??t),Timeline:t=>Le(t?.datum??t),Donut:t=>Le(t?.data??t),NestedDonut:t=>({key:t?.data?.key,value:t?.value??t?.data?.value}),RadialBar:t=>Le(t?.data??t),Heatmap:t=>Le(t?.datum??t),Treemap:t=>({key:t?.data?.key??t?.key,value:t?.value}),Sankey:t=>t?.source||t?.target?{source:t?.source?.label??t?.source?.id,target:t?.target?.label??t?.target?.id,value:t?.value}:{id:t?.id,label:t?.label,value:t?.value},ChordDiagram:t=>({label:t?.data?.label??t?.key,value:t?.value??t?.data?.value}),Graph:t=>t?.source||t?.target?{source:t?.source?.id,target:t?.target?.id}:Le(t?._state?t:t?.data??t),TopoJSONMap:t=>Le(t?.data??t)};function cS(t,e){if(!t[e])return[];switch(e){case"GroupedBar":return[t.GroupedBar.selectors.bar];case"StackedBar":return[t.StackedBar.selectors.bar];case"Scatter":return[t.Scatter.selectors.point];case"Boxplot":return[t.Boxplot.selectors.box];case"Timeline":return[t.Timeline.selectors.line];case"Donut":return[t.Donut.selectors.segment];case"NestedDonut":return[t.NestedDonut.selectors.segment];case"RadialBar":return[t.RadialBar.selectors.segment];case"Heatmap":return[t.Heatmap.selectors.node];case"Treemap":return[t.Treemap.selectors.tile];case"Sankey":return[t.Sankey.selectors.node,t.Sankey.selectors.link];case"ChordDiagram":return[t.ChordDiagram.selectors.node];case"Graph":return[t.Graph.selectors.node,t.Graph.selectors.link];case"TopoJSONMap":return[t.TopoJSONMap.selectors.feature];default:return[]}}function V0(t,e,n,r){let i=cS(t,e.type);if(!i.length)return;let o=lS[e.type]??Le,a={};for(let s of i)a[s]={click:c=>r({component:e.type,componentIndex:n,event:"click",datum:o(c)})};return a}var uS="1.7.0-mcp.2",W0="data-theme";function Y0(t){let e=document.documentElement;t==="dark"?e.setAttribute(W0,"dark"):e.removeAttribute(W0)}function fS(t,e){e?.forEach((n,r)=>{t.style.setProperty(`--vis-color${r}`,n),t.style.setProperty(`--vis-dark-color${r}`,n)})}function Df(t,e,n={}){if(e.innerHTML="",e.classList.add("uv-root"),Y0(t.theme),fS(e,t.colors),n.showTitle!==!1&&t.title){let h=document.createElement("div");h.className="uv-title",h.textContent=t.title,e.appendChild(h)}let r=tl,{containerConfig:i,legendItems:o}=z0(r,t),a=n.onEvent;a&&(t={...t,components:t.components.map((h,d)=>{let g=V0(r,h,d,a);return g?{...h,config:{...h.config,events:g}}:h})});let s;if(o?.length){let h=document.createElement("div");h.className="uv-legend",e.appendChild(h),s=new Js(h,{items:o})}let c=document.createElement("div");c.className="uv-chart",e.appendChild(c);let l=P0(r,t,{duration:n.duration??400,responsive:!0}),u={...l.containerConfig,...i},f=l.containerType==="xy"?new Gr(c,u,l.data):new Zr(c,u,l.data);return{element:e,destroy:()=>{try{f.destroy(),s?.destroy?.()}finally{e.innerHTML=""}}}}function G0(){let t=document.getElementById("uv-embed-root")??document.body,e,n,r,i=c=>{let l=window.ReactNativeWebView;l?l.postMessage(JSON.stringify(c)):window.parent?.postMessage(c,"*")},o=()=>{i({type:"unovis:size",width:t.scrollWidth,height:t.scrollHeight})},a=(c,l)=>{e?.destroy();try{let{events:u,...f}=l??{};u&&(f.onEvent=h=>i({type:"unovis:event",...h})),e=Df(c,t,f),n=c,r=l,o()}catch(u){t.innerHTML=`<div class="uv-error">${String(u instanceof Error?u.message:u)}</div>`}},s=c=>{let l=c.data,u;if(typeof l=="string")try{u=JSON.parse(l)}catch{return}else u=l;u?.type==="unovis:render"&&u.spec&&a(u.spec,u.options),u?.type==="unovis:theme"&&(u.theme==="light"||u.theme==="dark")&&(n?a({...n,theme:u.theme},r):Y0(u.theme))};window.addEventListener("message",s),document.addEventListener("message",s),i({type:"unovis:ready",version:uS,specVersion:1})}function H0(){let t=document.getElementById("uv-spec"),e=document.getElementById("uv-options"),n=document.getElementById("uv-root");if(!(!t?.textContent||!n))try{let r=e?.textContent?JSON.parse(e.textContent):{};Df(JSON.parse(t.textContent),n,r)}catch(r){n.innerHTML=`<div class="uv-error">Failed to render chart: ${String(r instanceof Error?r.message:r)}</div>`}}window.UnovisChart={render:Df,startEmbed:G0,unovis:tl};window.location.hash==="#embed"?G0():document.readyState==="loading"?document.addEventListener("DOMContentLoaded",H0):H0();})();
799
+ `;var G0=class{constructor(e,n){this._defaultConfig=W0,this.config=this._defaultConfig,this._colorAccessor=r=>r.color,this._container=e,this.div=n?.renderIntoProvidedDomNode?Y(this._container):Y(this._container).append("div"),this.div.classed(ll,!0),this.element=this.div.node(),this.setConfig(n)}setConfig(e){this.prevConfig=this.config,this.config=te(this._defaultConfig,e),this.render()}update(e){this.setConfig(e)}render(){let{config:e}=this,n=this.div.selectAll(`.${Vo}`).data(e.items),r=n.enter().append("div").on("click",this._onItemClick.bind(this)),i=r.merge(n);i.attr("class",o=>`${Vo} ${o.className??""}`).classed(Nf,e.orientation===Ro.Vertical).classed(Bf,o=>!!e.onLegendItemClick&&this._isItemClickable(o)).attr("title",o=>o.name).style("display",o=>o.hidden?"none":null),r.append("span").attr("class",ul).call(H0),i.select(`.${ul}`).style("width",function(o){let a=(Array.isArray(o.color)?o.color:[o.color]).length,c=e.bulletSize?ee(e.bulletSize):Dt("var(--vis-legend-bullet-size)",this)||9,l=e.bulletSpacing;return`${Of(c,a,l)}px`}).style("height",e.bulletSize).style("box-sizing","content-box").call(Y0,this.config,this._colorAccessor,e.colorFunction),r.append("span").attr("class",cl).classed(e.labelClassName,!0).style("max-width",e.labelMaxWidth).style("font-size",e.labelFontSize),i.select(`.${cl}`).text(o=>o.name),n.exit().remove()}_isItemClickable(e){return e.pointer===void 0?!0:e.pointer}_onItemClick(e,n){let{config:{onLegendItemClick:r}}=this,o=this.div.selectAll(`.${Vo}`).nodes().indexOf(e.currentTarget);r&&r(n,o)}destroy(){this.element!==this._container&&this.div.remove()}};G0.selectors=Pf;var fl=G0;var U0=t=>typeof t!="object"||t===null||Array.isArray(t)?!1:Object.keys(t).some(n=>["$field","$index","$const","$dateTickFormat","$numTickFormat","$lookup","$format","$mapField"].includes(n));function TS(t,e,n=7){let r=e-t;if(!Number.isFinite(r)||r<=0)return;let i=[];if(r>=60*864e5){let o=Math.max(1,Math.ceil(r/2592e6/n)),s=new Date(t),a=new Date(Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),1));for(a.getTime()<t&&(a=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth()+1,1)));a.getTime()<=e&&i.length<24;)i.push(a.getTime()),a=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth()+o,1))}else{let o=r>=1728e5?864e5:r>=72e5?36e5:6e4,s=o===864e5?[1,2,7,14]:o===36e5?[1,2,3,6,12]:[1,2,5,10,15,30],a=r/o/n,c=(s.find(l=>l>=a)??Math.ceil(a))*o;for(let l=Math.ceil(t/c)*c;l<=e&&i.length<24;l+=c)i.push(l)}return i.length>=2?i:void 0}function X0(t,e){let n=1/0,r=-1/0;for(let i of t){let o=i[e];if(o==null||o==="")continue;let s=typeof o=="number"?o:new Date(String(o)).getTime();Number.isNaN(s)||(s<n&&(n=s),s>r&&(r=s))}return TS(n,r)}var Rn=class extends Error{},AS=t=>{if(t==null||t==="")return;let e=Number(t);return Number.isNaN(e)?void 0:e},CS=t=>{if(t==null||t==="")return;if(typeof t=="number")return t;let e=new Date(t).getTime();return Number.isNaN(e)?void 0:e},MS=(t,e="en-US")=>{let n=typeof t=="number"?t:Number(t),r=Number.isFinite(n)?n:new Date(String(t)).getTime();if(!Number.isFinite(r))return String(t);let i=new Date(r),o=i.getUTCHours()===0&&i.getUTCMinutes()===0?i.getUTCDate()===1?{year:"numeric",month:"short"}:{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"};return i.toLocaleString(e,{...o,timeZone:"UTC"})},pl=(t,e="en-US")=>{let n=Number(t);return Number.isFinite(n)?n.toLocaleString(e,{maximumFractionDigits:6}):String(t)};function LS(t,e){if("$field"in t){let{$field:n,as:r}=t;return r==="number"?i=>AS(i?.[n]):r==="date"?i=>CS(i?.[n]):i=>i?.[n]}if("$index"in t)return(n,r)=>r;if("$const"in t)return()=>t.$const;if("$dateTickFormat"in t)return n=>MS(n,e);if("$numTickFormat"in t)return n=>pl(n,e);if("$lookup"in t){let n=t.$lookup;return r=>n[Math.round(Number(r))%n.length]??String(r)}if("$format"in t){let{field:n,prefix:r="",suffix:i=""}=t.$format;return o=>{let s=o?.[n];return s==null?"":`${r}${pl(s,e)}${i}`}}if("$mapField"in t){let{field:n,mapping:r,fallback:i}=t.$mapField;return o=>r[String(o?.[n])]??i}return t}function dn(t,e){if(U0(t))return LS(t,e);if(Array.isArray(t))return t.map(n=>dn(n,e));if(typeof t=="object"&&t!==null){let n={};for(let[r,i]of Object.entries(t))n[r]=dn(i,e);return n}return t}var j0=new Set(["Line","Area","GroupedBar","StackedBar","Scatter","Timeline","Boxplot","XYLabels","Plotband","Plotline"]),RS=new Set(["Donut","NestedDonut","RadialBar","Sankey","Heatmap","Treemap","ChordDiagram","Graph","TopoJSONMap"]),ES=new Set(["Graph"]);function q0(t,e,n,r){if(!(j0.has(e.type)||RS.has(e.type)))throw new Rn(`Unsupported component type: ${e.type}`);let o=Object.prototype.hasOwnProperty.call(t,e.type)?t[e.type]:void 0;if(typeof o!="function")throw new Rn(`Component ${e.type} is not available in this bundle \u2014 regenerate the document for this chart type`);let s=dn(e.config,r);s.duration=n.duration??0,ES.has(e.type)&&n.onComponentComplete&&(s.onRenderComplete=n.onComponentComplete);let a=s.projection;if(a?.$mapProjection){let c=t.MapProjection,l=c&&Object.prototype.hasOwnProperty.call(c,a.$mapProjection)?c[a.$mapProjection]:void 0;if(typeof l!="function")throw new Rn(`Unknown map projection: ${a.$mapProjection}`);s.projection=l()}return new o(s)}function Z0(t,e,n={}){if(e.specVersion!==void 0){let c=x=>{let p=/^(\d+)\.(\d+)$/.exec(String(x));return p?[Number(p[1]),Number(p[2])]:[Number.POSITIVE_INFINITY,0]},[l,u]=c(e.specVersion),[f,h]=c("0.1");if(l>f||l===0&&f===0&&u>h)throw new Rn(`Chart spec version ${e.specVersion} is newer than this renderer supports (${"0.1"}) \u2014 upgrade @unovis/mcp`)}let r=e.locale,i=dn(e.containerConfig??{},r),o=n.duration??0,s=n.responsive?{}:{width:e.width,height:e.height};if(e.container==="xy"){let c=e.components.map(u=>{if(!j0.has(u.type))throw new Rn(`${u.type} cannot be used in an XY container`);return q0(t,u,n,r)}),l=(u,f)=>{if(u)return new t.Axis({...dn(u,r),type:f,duration:o})};if(e.xAxis&&"$dateTickFormat"in(e.xAxis.tickFormat??{})&&e.xAxis.tickValues===void 0){let u=e.components[0]?.config?.x?.$field,f=Array.isArray(e.data)?e.data:void 0;if(u&&f){let h=X0(f,u);h&&(e={...e,xAxis:{...e.xAxis,tickValues:h}})}}return{containerType:"xy",containerConfig:{...i,components:c,xAxis:l(e.xAxis,"x"),yAxis:l(e.yAxis,"y"),...s,duration:o,onRenderComplete:n.onRenderComplete},data:e.data}}if(e.components.length!==1)throw new Rn("single container requires exactly one component");let a=q0(t,e.components[0],n,r);return{containerType:"single",containerConfig:{...i,component:a,...s,duration:o,onRenderComplete:n.onRenderComplete},data:e.data}}var Ff=t=>String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),DS=(t,e)=>t==null?"\u2014":typeof t=="number"?pl(t,e):Ff(t),En=(t,e,n)=>`<div class="uv-tt-row"><span class="uv-tt-key">${Ff(t)}</span><span class="uv-tt-val">${DS(e,n)}</span></div>`,je=t=>`<div class="uv-tt-title">${Ff(t)}</div>`;function K0(t){let e=[],n=r=>{if(Array.isArray(r)){r.forEach(n);return}if(typeof r=="object"&&r!==null){let i=r;if(typeof i.$field=="string"){e.includes(i.$field)||e.push(i.$field);return}Object.values(r).forEach(n)}};return n(t),e}var $S=t=>Object.entries(t??{}).filter(([e,n])=>!e.startsWith("_")&&(n===null||typeof n!="object"));function IS(t,e,n){return r=>{if(!r)return"";let i=e&&r[e]!==void 0?je(r[e]):"",o=t.length?t.filter(s=>r[s]!==void 0).map(s=>En(s,r[s],n)):$S(r).map(([s,a])=>En(s,a,n));return`${i}${o.join("")}`||je("no data")}}function Q0(t,e){let n={},r={};for(let a of e.components){if(!t[a.type])continue;let c=K0(a.config),l=IS(c,void 0,e.locale);switch(a.type){case"Line":case"Area":break;case"GroupedBar":case"StackedBar":{let u=a.type==="StackedBar"?t.StackedBar:t.GroupedBar;r[u.selectors.bar]=l;break}case"Scatter":r[t.Scatter.selectors.point]=l;break;case"Boxplot":r[t.Boxplot.selectors.box]=l;break;case"Timeline":r[t.Timeline.selectors.line]=l;break;case"Donut":r[t.Donut.selectors.segment]=u=>l(u?.data??u);break;case"NestedDonut":r[t.NestedDonut.selectors.segment]=u=>`${je(u?.data?.key??"")}${En("value",u?.value??u?.data?.value)}`;break;case"RadialBar":r[t.RadialBar.selectors.segment]=u=>l(u?.data??u);break;case"Heatmap":r[t.Heatmap.selectors.node]=l;break;case"Treemap":r[t.Treemap.selectors.tile]=u=>`${je(u?.data?.key??u?.key??"")}${En("value",u?.value)}`;break;case"Sankey":r[t.Sankey.selectors.node]=u=>`${je(u?.label??u?.id??"")}${En("total",u?.value)}`,r[t.Sankey.selectors.link]=u=>`${je(`${u?.source?.label??u?.source?.id??""} \u2192 ${u?.target?.label??u?.target?.id??""}`)}${En("value",u?.value)}`;break;case"ChordDiagram":r[t.ChordDiagram.selectors.node]=u=>je(u?.data?.label??u?.key??"");break;case"Graph":r[t.Graph.selectors.node]=u=>l(u?._state?u:u?.data??u),r[t.Graph.selectors.link]=u=>je(`${u?.source?.id??""} \u2192 ${u?.target?.id??""}`);break;case"TopoJSONMap":r[t.TopoJSONMap.selectors.feature]=u=>{let f=u?.data??u;return!f?.id&&!f?.name?"":`${je(f.name??f.id)}${f.value!==void 0?En("value",f.value):""}`};break}}let i=e.components.find(a=>a.type==="Line"||a.type==="Area"),o=e.container==="xy"&&!!i;if((Object.keys(r).length||o)&&(n.tooltip=new t.Tooltip({triggers:r,horizontalPlacement:"center"})),o&&i){let a=dn(i.config.x,e.locale),c=K0(i.config).filter(h=>h!==i.config.x?.$field),l=e.legend?.map(h=>h.name)??c,u=i.config.x?.$field,f=e.xAxis?.tickFormat?dn(e.xAxis.tickFormat,e.locale):void 0;n.crosshair=new t.Crosshair({x:a,y:dn(i.config.y,e.locale),template:h=>{let d=u?h?.[u]:void 0,x=d!==void 0?je(f?f(d):d):"",p=c.map((g,v)=>En(l[v]??g,h?.[g],e.locale));return`${x}${p.join("")}`}})}let s=e.legend?.length?e.legend.map(a=>({name:a.name,color:a.color})):void 0;return{containerConfig:n,legendItems:s}}var De=t=>{if(t===null||typeof t!="object")return t;let e={};for(let[n,r]of Object.entries(t))n.startsWith("_")||(r===null||typeof r=="string"||typeof r=="number"||typeof r=="boolean")&&(e[n]=r);return e},J0={GroupedBar:t=>De(t?.datum??t),StackedBar:t=>De(t?.datum??t),Scatter:t=>De(t?.datum??t),Boxplot:t=>De(t?.datum??t),Timeline:t=>De(t?.datum??t),Donut:t=>De(t?.data??t),NestedDonut:t=>({key:t?.data?.key,value:t?.value??t?.data?.value}),RadialBar:t=>De(t?.data??t),Heatmap:t=>De(t?.datum??t),Treemap:t=>({key:t?.data?.key??t?.key,value:t?.value}),Sankey:t=>t?.source||t?.target?{source:t?.source?.label??t?.source?.id,target:t?.target?.label??t?.target?.id,value:t?.value}:{id:t?.id,label:t?.label,value:t?.value},ChordDiagram:t=>({label:t?.data?.label??t?.key,value:t?.value??t?.data?.value}),Graph:t=>t?.source||t?.target?{source:t?.source?.id,target:t?.target?.id}:De(t?._state?t:t?.data??t),TopoJSONMap:t=>De(t?.data??t)};function OS(t,e){if(!t[e])return[];switch(e){case"GroupedBar":return[t.GroupedBar.selectors.bar];case"StackedBar":return[t.StackedBar.selectors.bar];case"Scatter":return[t.Scatter.selectors.point];case"Boxplot":return[t.Boxplot.selectors.box];case"Timeline":return[t.Timeline.selectors.line];case"Donut":return[t.Donut.selectors.segment];case"NestedDonut":return[t.NestedDonut.selectors.segment];case"RadialBar":return[t.RadialBar.selectors.segment];case"Heatmap":return[t.Heatmap.selectors.node];case"Treemap":return[t.Treemap.selectors.tile];case"Sankey":return[t.Sankey.selectors.node,t.Sankey.selectors.link];case"ChordDiagram":return[t.ChordDiagram.selectors.node];case"Graph":return[t.Graph.selectors.node,t.Graph.selectors.link];case"TopoJSONMap":return[t.TopoJSONMap.selectors.feature];default:return[]}}function ty(t,e,n,r){let i=OS(t,e.type);if(!i.length)return;let o=Object.prototype.hasOwnProperty.call(J0,e.type)?J0[e.type]:void 0,s=typeof o=="function"?o:De,a={};for(let c of i)a[c]={click:l=>r({component:e.type,componentIndex:n,event:"click",datum:s(l)})};return a}function oy(t,e){let n=document.createElement("div");n.className="uv-error",n.textContent=e,t.replaceChildren(n)}var ey="1.7.0",ny="data-theme";function zf(t){let e=document.documentElement;t==="dark"?e.setAttribute(ny,"dark"):e.removeAttribute(ny)}function NS(t,e){e?.forEach((n,r)=>{t.style.setProperty(`--vis-color${r}`,n),t.style.setProperty(`--vis-dark-color${r}`,n)})}function Vf(t,e,n={}){if(e.innerHTML="",e.classList.add("uv-root"),zf(t.theme),NS(e,t.colors),n.showTitle!==!1&&t.title){let h=document.createElement("div");h.className="uv-title",h.textContent=t.title,e.appendChild(h)}let r=hl,{containerConfig:i,legendItems:o}=Q0(r,t),s=n.onEvent;s&&(t={...t,components:t.components.map((h,d)=>{let x=ty(r,h,d,s);return x?{...h,config:{...h.config,events:x}}:h})});let a;if(o?.length){let h=document.createElement("div");h.className="uv-legend",e.appendChild(h),a=new fl(h,{items:o})}let c=document.createElement("div");c.className="uv-chart",e.appendChild(c);let l=Z0(r,t,{duration:n.duration??400,responsive:!0}),u={...l.containerConfig,...i},f=l.containerType==="xy"?new jr(c,u,l.data):new ri(c,u,l.data);return{element:e,destroy:()=>{try{f.destroy(),a?.destroy?.()}finally{e.innerHTML=""}}}}var BS="2026-01-26",ry="unovis-ui-init";function sy(){let t=document.getElementById("uv-embed-root")??document.body,e,n,r,i=!1,o=x=>{let p=window.ReactNativeWebView;p?p.postMessage(JSON.stringify(x)):window.parent?.postMessage(x,"*")},s=()=>{o({type:"unovis:size",width:t.scrollWidth,height:t.scrollHeight}),o({jsonrpc:"2.0",method:"ui/notifications/size-changed",params:{width:t.scrollWidth,height:t.scrollHeight}})},a=(x,p)=>{e?.destroy();try{let{events:g,...v}=p??{};g&&(v.onEvent=b=>o({type:"unovis:event",...b})),e=Vf(x,t,v),n=x,r=p,s()}catch(g){oy(t,String(g instanceof Error?g.message:g))}},c=x=>{x!=="dark"&&x!=="light"||(n?a({...n,theme:x},r):zf(x))},l=x=>{if(x.jsonrpc!=="2.0")return!1;if(x.id===ry&&x.result)return i=!0,c(x.result.hostContext?.theme),o({jsonrpc:"2.0",method:"ui/notifications/initialized"}),!0;if(x.method==="ui/notifications/tool-result"){let p=x.params?.structuredContent?.spec;return p&&a(p,{events:!0}),!0}return x.method==="ui/notifications/host-context-changed"?(c(x.params?.hostContext?.theme),!0):(x.method==="ping"&&x.id!==void 0&&o({jsonrpc:"2.0",id:x.id,result:{}}),!0)},u=x=>{let p=x.data,g;if(typeof p=="string")try{g=JSON.parse(p)}catch{return}else g=p;l(g)||(g?.type==="unovis:render"&&g.spec&&a(g.spec,g.options),g?.type==="unovis:theme"&&(g.theme==="light"||g.theme==="dark")&&(n?a({...n,theme:g.theme},r):zf(g.theme)))};window.addEventListener("message",u),document.addEventListener("message",u),o({type:"unovis:ready",version:ey,specVersion:"0.1"});let f=()=>o({jsonrpc:"2.0",id:ry,method:"ui/initialize",params:{protocolVersion:BS,appInfo:{name:"unovis-chart-widget",version:ey},appCapabilities:{}}});f();let h=0,d=setInterval(()=>{if(i||++h>8){clearInterval(d);return}f()},500)}function iy(){let t=document.getElementById("uv-spec"),e=document.getElementById("uv-options"),n=document.getElementById("uv-root");if(!(!t?.textContent||!n))try{let r=e?.textContent?JSON.parse(e.textContent):{};Vf(JSON.parse(t.textContent),n,r)}catch(r){oy(n,`Failed to render chart: ${String(r instanceof Error?r.message:r)}`)}}window.UnovisChart={render:Vf,startEmbed:sy,unovis:hl};window.location.hash==="#embed"?sy():document.readyState==="loading"?document.addEventListener("DOMContentLoaded",iy):iy();})();