@orbcharts/core 3.0.0-alpha.33 → 3.0.0-alpha.35

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.
@@ -1,3 +1,3 @@
1
- (function($,Ct){typeof exports=="object"&&typeof module<"u"?Ct(exports):typeof define=="function"&&define.amd?define(["exports"],Ct):($=typeof globalThis<"u"?globalThis:$||self,Ct($["orbcharts-core"]={}))})(this,function($){"use strict";const Ct={preset:{}},sn={top:60,right:60,bottom:60,left:60},ln={padding:sn,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#454545",secondary:"#e1e1e1",white:"#ffffff",background:"#ffffff"},dark:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#f0f0f0",secondary:"#e1e1e1",white:"#ffffff",background:"#000000"}},styles:{textSize:14,unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},si=800,li=500,j={position:"left",scaleDomain:[0,"auto"],scaleRange:[0,.9],label:""},ci={position:"bottom",scaleDomain:[0,"auto"],scalePadding:.5,label:""},fi={type:"series",visibleFilter:(t,e,n,r)=>!0,unitLabel:"",seriesLabels:[],sort:null},cn={visibleFilter:(t,e,n,r)=>!0,gridData:{seriesDirection:"row",rowLabels:[],columnLabels:[]},valueAxis:{...j},groupAxis:{...ci},slotIndex:0,seriesSlotIndexes:null},hi={type:"grid",grid:{...cn},container:{gap:120,rowAmount:1,columnAmount:1}},Ut={...cn},di={type:"multiGrid",visibleFilter:(t,e,n,r)=>!0,gridList:[{...Ut}],container:{gap:120,rowAmount:1,columnAmount:1}},pi={type:"multiValue",visibleFilter:(t,e,n,r)=>!0,multiValue:[],xAxis:{...j},yAxis:{...j}},mi={type:"tree",visibleFilter:(t,e,n,r)=>!0},gi={type:"relationship",visibleFilter:(t,e,n,r)=>!0};function Ht(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function vi(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fn(t){let e,n,r;t.length!==2?(e=Ht,n=(u,s)=>Ht(t(u),s),r=(u,s)=>t(u)-s):(e=t===Ht||t===vi?t:yi,n=t,r=t);function i(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<0?l=c+1:f=c}while(l<f)}return l}function a(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<=0?l=c+1:f=c}while(l<f)}return l}function o(u,s,l=0,f=u.length){const c=i(u,s,l,f-1);return c>l&&r(u[c-1],s)>-r(u[c],s)?c-1:c}return{left:i,center:o,right:a}}function yi(){return 0}function wi(t){return t===null?NaN:+t}const hn=fn(Ht).right;fn(wi).center;class dn extends Map{constructor(e,n=_i){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(pn(this,e))}has(e){return super.has(pn(this,e))}set(e,n){return super.set(bi(this,e),n)}delete(e){return super.delete(xi(this,e))}}function pn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function bi({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function xi({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function _i(t){return t!==null&&typeof t=="object"?t.valueOf():t}const $i=Math.sqrt(50),Ai=Math.sqrt(10),Di=Math.sqrt(2);function Xt(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=$i?10:a>=Ai?5:a>=Di?2:1;let u,s,l;return i<0?(l=Math.pow(10,-i)/o,u=Math.round(t*l),s=Math.round(e*l),u/l<t&&++u,s/l>e&&--s,l=-l):(l=Math.pow(10,i)*o,u=Math.round(t/l),s=Math.round(e/l),u*l<t&&++u,s*l>e&&--s),s<u&&.5<=n&&n<2?Xt(t,e,n*2):[u,s,l]}function Si(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,o]=r?Xt(e,t,n):Xt(t,e,n);if(!(a>=i))return[];const u=a-i+1,s=new Array(u);if(r)if(o<0)for(let l=0;l<u;++l)s[l]=(a-l)/-o;else for(let l=0;l<u;++l)s[l]=(a-l)*o;else if(o<0)for(let l=0;l<u;++l)s[l]=(i+l)/-o;else for(let l=0;l<u;++l)s[l]=(i+l)*o;return s}function _e(t,e,n){return e=+e,t=+t,n=+n,Xt(t,e,n)[2]}function Mi(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?_e(e,t,n):_e(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function Ci(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,a=new Array(i);++r<i;)a[r]=t+r*n;return a}var Pi={value:()=>{}};function mn(){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 Yt(n)}function Yt(t){this._=t}function Ei(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}})}Yt.prototype=mn.prototype={constructor:Yt,on:function(t,e){var n=this._,r=Ei(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=Fi(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=gn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=gn(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 Yt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[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,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function Fi(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function gn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Pi,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var $e="http://www.w3.org/1999/xhtml";const vn={svg:"http://www.w3.org/2000/svg",xhtml:$e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Bt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),vn.hasOwnProperty(e)?{space:vn[e],local:t}:t}function Ti(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===$e&&e.documentElement.namespaceURI===$e?e.createElement(t):e.createElementNS(n,t)}}function Ii(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yn(t){var e=Bt(t);return(e.local?Ii:Ti)(e)}function Ni(){}function Ae(t){return t==null?Ni:function(){return this.querySelector(t)}}function Oi(t){typeof t!="function"&&(t=Ae(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=new Array(o),s,l,f=0;f<o;++f)(s=a[f])&&(l=t.call(s,s.__data__,f,a))&&("__data__"in s&&(l.__data__=s.__data__),u[f]=l);return new L(r,this._parents)}function ki(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Ri(){return[]}function wn(t){return t==null?Ri:function(){return this.querySelectorAll(t)}}function Li(t){return function(){return ki(t.apply(this,arguments))}}function Gi(t){typeof t=="function"?t=Li(t):t=wn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],u=o.length,s,l=0;l<u;++l)(s=o[l])&&(r.push(t.call(s,s.__data__,l,o)),i.push(s));return new L(r,i)}function bn(t){return function(){return this.matches(t)}}function xn(t){return function(e){return e.matches(t)}}var Vi=Array.prototype.find;function zi(t){return function(){return Vi.call(this.children,t)}}function Ui(){return this.firstElementChild}function Hi(t){return this.select(t==null?Ui:zi(typeof t=="function"?t:xn(t)))}var Xi=Array.prototype.filter;function Yi(){return Array.from(this.children)}function Bi(t){return function(){return Xi.call(this.children,t)}}function Wi(t){return this.selectAll(t==null?Yi:Bi(typeof t=="function"?t:xn(t)))}function qi(t){typeof t!="function"&&(t=bn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&u.push(s);return new L(r,this._parents)}function _n(t){return new Array(t.length)}function ji(){return new L(this._enter||this._groups.map(_n),this._parents)}function Wt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Wt.prototype={constructor:Wt,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 Ki(t){return function(){return t}}function Ji(t,e,n,r,i,a){for(var o=0,u,s=e.length,l=a.length;o<l;++o)(u=e[o])?(u.__data__=a[o],r[o]=u):n[o]=new Wt(t,a[o]);for(;o<s;++o)(u=e[o])&&(i[o]=u)}function Zi(t,e,n,r,i,a,o){var u,s,l=new Map,f=e.length,c=a.length,h=new Array(f),d;for(u=0;u<f;++u)(s=e[u])&&(h[u]=d=o.call(s,s.__data__,u,e)+"",l.has(d)?i[u]=s:l.set(d,s));for(u=0;u<c;++u)d=o.call(t,a[u],u,a)+"",(s=l.get(d))?(r[u]=s,s.__data__=a[u],l.delete(d)):n[u]=new Wt(t,a[u]);for(u=0;u<f;++u)(s=e[u])&&l.get(h[u])===s&&(i[u]=s)}function Qi(t){return t.__data__}function ta(t,e){if(!arguments.length)return Array.from(this,Qi);var n=e?Zi:Ji,r=this._parents,i=this._groups;typeof t!="function"&&(t=Ki(t));for(var a=i.length,o=new Array(a),u=new Array(a),s=new Array(a),l=0;l<a;++l){var f=r[l],c=i[l],h=c.length,d=ea(t.call(f,f&&f.__data__,l,r)),m=d.length,p=u[l]=new Array(m),g=o[l]=new Array(m),_=s[l]=new Array(h);n(f,c,p,g,_,d,e);for(var A=0,v=0,x,y;A<m;++A)if(x=p[A]){for(A>=v&&(v=A+1);!(y=g[v])&&++v<m;);x._next=y||null}}return o=new L(o,r),o._enter=u,o._exit=s,o}function ea(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function na(){return new L(this._exit||this._groups.map(_n),this._parents)}function ra(t,e,n){var r=this.enter(),i=this,a=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?a.remove():n(a),r&&i?r.merge(i).order():i}function ia(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),u=new Array(i),s=0;s<o;++s)for(var l=n[s],f=r[s],c=l.length,h=u[s]=new Array(c),d,m=0;m<c;++m)(d=l[m]||f[m])&&(h[m]=d);for(;s<i;++s)u[s]=n[s];return new L(u,this._parents)}function aa(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function oa(t){t||(t=ua);function e(c,h){return c&&h?t(c.__data__,h.__data__):!c-!h}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],u=o.length,s=i[a]=new Array(u),l,f=0;f<u;++f)(l=o[f])&&(s[f]=l);s.sort(e)}return new L(i,this._parents).order()}function ua(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function sa(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function la(){return Array.from(this)}function ca(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function fa(){let t=0;for(const e of this)++t;return t}function ha(){return!this.node()}function da(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,u;a<o;++a)(u=i[a])&&t.call(u,u.__data__,a,i);return this}function pa(t){return function(){this.removeAttribute(t)}}function ma(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ga(t,e){return function(){this.setAttribute(t,e)}}function va(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ya(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function wa(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 ba(t,e){var n=Bt(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?ma:pa:typeof e=="function"?n.local?wa:ya:n.local?va:ga)(n,e))}function $n(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function xa(t){return function(){this.style.removeProperty(t)}}function _a(t,e,n){return function(){this.style.setProperty(t,e,n)}}function $a(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Aa(t,e,n){return arguments.length>1?this.each((e==null?xa:typeof e=="function"?$a:_a)(t,e,n??"")):pt(this.node(),t)}function pt(t,e){return t.style.getPropertyValue(e)||$n(t).getComputedStyle(t,null).getPropertyValue(e)}function Da(t){return function(){delete this[t]}}function Sa(t,e){return function(){this[t]=e}}function Ma(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ca(t,e){return arguments.length>1?this.each((e==null?Da:typeof e=="function"?Ma:Sa)(t,e)):this.node()[t]}function An(t){return t.trim().split(/^|\s+/)}function De(t){return t.classList||new Dn(t)}function Dn(t){this._node=t,this._names=An(t.getAttribute("class")||"")}Dn.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 Sn(t,e){for(var n=De(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Mn(t,e){for(var n=De(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Pa(t){return function(){Sn(this,t)}}function Ea(t){return function(){Mn(this,t)}}function Fa(t,e){return function(){(e.apply(this,arguments)?Sn:Mn)(this,t)}}function Ta(t,e){var n=An(t+"");if(arguments.length<2){for(var r=De(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Fa:e?Pa:Ea)(n,e))}function Ia(){this.textContent=""}function Na(t){return function(){this.textContent=t}}function Oa(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function ka(t){return arguments.length?this.each(t==null?Ia:(typeof t=="function"?Oa:Na)(t)):this.node().textContent}function Ra(){this.innerHTML=""}function La(t){return function(){this.innerHTML=t}}function Ga(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Va(t){return arguments.length?this.each(t==null?Ra:(typeof t=="function"?Ga:La)(t)):this.node().innerHTML}function za(){this.nextSibling&&this.parentNode.appendChild(this)}function Ua(){return this.each(za)}function Ha(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Xa(){return this.each(Ha)}function Ya(t){var e=typeof t=="function"?t:yn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Ba(){return null}function Wa(t,e){var n=typeof t=="function"?t:yn(t),r=e==null?Ba:typeof e=="function"?e:Ae(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function qa(){var t=this.parentNode;t&&t.removeChild(this)}function ja(){return this.each(qa)}function Ka(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ja(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Za(t){return this.select(t?Ja:Ka)}function Qa(t){return arguments.length?this.property("__data__",t):this.node().__data__}function to(t){return function(e){t.call(this,e,this.__data__)}}function eo(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 no(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function ro(t,e,n){return function(){var r=this.__on,i,a=to(e);if(r){for(var o=0,u=r.length;o<u;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=e;return}}this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function io(t,e,n){var r=eo(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var s=0,l=u.length,f;s<l;++s)for(i=0,f=u[s];i<a;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(u=e?ro:no,i=0;i<a;++i)this.each(u(r[i],e,n));return this}function Cn(t,e,n){var r=$n(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 ao(t,e){return function(){return Cn(this,t,e)}}function oo(t,e){return function(){return Cn(this,t,e.apply(this,arguments))}}function uo(t,e){return this.each((typeof e=="function"?oo:ao)(t,e))}function*so(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Pn=[null];function L(t,e){this._groups=t,this._parents=e}function Pt(){return new L([[document.documentElement]],Pn)}function lo(){return this}L.prototype=Pt.prototype={constructor:L,select:Oi,selectAll:Gi,selectChild:Hi,selectChildren:Wi,filter:qi,data:ta,enter:ji,exit:na,join:ra,merge:ia,selection:lo,order:aa,sort:oa,call:sa,nodes:la,node:ca,size:fa,empty:ha,each:da,attr:ba,style:Aa,property:Ca,classed:Ta,text:ka,html:Va,raise:Ua,lower:Xa,append:Ya,insert:Wa,remove:ja,clone:Za,datum:Qa,on:io,dispatch:uo,[Symbol.iterator]:so};function qt(t){return typeof t=="string"?new L([[document.querySelector(t)]],[document.documentElement]):new L([[t]],Pn)}function Se(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function En(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Et(){}var Ft=.7,jt=1/Ft,mt="\\s*([+-]?\\d+)\\s*",Tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",B="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",co=/^#([0-9a-f]{3,8})$/,fo=new RegExp(`^rgb\\(${mt},${mt},${mt}\\)$`),ho=new RegExp(`^rgb\\(${B},${B},${B}\\)$`),po=new RegExp(`^rgba\\(${mt},${mt},${mt},${Tt}\\)$`),mo=new RegExp(`^rgba\\(${B},${B},${B},${Tt}\\)$`),go=new RegExp(`^hsl\\(${Tt},${B},${B}\\)$`),vo=new RegExp(`^hsla\\(${Tt},${B},${B},${Tt}\\)$`),Fn={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};Se(Et,ut,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Tn,formatHex:Tn,formatHex8:yo,formatHsl:wo,formatRgb:In,toString:In});function Tn(){return this.rgb().formatHex()}function yo(){return this.rgb().formatHex8()}function wo(){return Ln(this).formatHsl()}function In(){return this.rgb().formatRgb()}function ut(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=co.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Nn(e):n===3?new R(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Kt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Kt(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=fo.exec(t))?new R(e[1],e[2],e[3],1):(e=ho.exec(t))?new R(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=po.exec(t))?Kt(e[1],e[2],e[3],e[4]):(e=mo.exec(t))?Kt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=go.exec(t))?Rn(e[1],e[2]/100,e[3]/100,1):(e=vo.exec(t))?Rn(e[1],e[2]/100,e[3]/100,e[4]):Fn.hasOwnProperty(t)?Nn(Fn[t]):t==="transparent"?new R(NaN,NaN,NaN,0):null}function Nn(t){return new R(t>>16&255,t>>8&255,t&255,1)}function Kt(t,e,n,r){return r<=0&&(t=e=n=NaN),new R(t,e,n,r)}function bo(t){return t instanceof Et||(t=ut(t)),t?(t=t.rgb(),new R(t.r,t.g,t.b,t.opacity)):new R}function Me(t,e,n,r){return arguments.length===1?bo(t):new R(t,e,n,r??1)}function R(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Se(R,Me,En(Et,{brighter(t){return t=t==null?jt:Math.pow(jt,t),new R(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new R(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new R(st(this.r),st(this.g),st(this.b),Jt(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:On,formatHex:On,formatHex8:xo,formatRgb:kn,toString:kn}));function On(){return`#${lt(this.r)}${lt(this.g)}${lt(this.b)}`}function xo(){return`#${lt(this.r)}${lt(this.g)}${lt(this.b)}${lt((isNaN(this.opacity)?1:this.opacity)*255)}`}function kn(){const t=Jt(this.opacity);return`${t===1?"rgb(":"rgba("}${st(this.r)}, ${st(this.g)}, ${st(this.b)}${t===1?")":`, ${t})`}`}function Jt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function st(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function lt(t){return t=st(t),(t<16?"0":"")+t.toString(16)}function Rn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new z(t,e,n,r)}function Ln(t){if(t instanceof z)return new z(t.h,t.s,t.l,t.opacity);if(t instanceof Et||(t=ut(t)),!t)return new z;if(t instanceof z)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,s=(a+i)/2;return u?(e===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-e)/u+2:o=(e-n)/u+4,u/=s<.5?a+i:2-a-i,o*=60):u=s>0&&s<1?0:o,new z(o,u,s,t.opacity)}function _o(t,e,n,r){return arguments.length===1?Ln(t):new z(t,e,n,r??1)}function z(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Se(z,_o,En(Et,{brighter(t){return t=t==null?jt:Math.pow(jt,t),new z(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new z(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 R(Ce(t>=240?t-240:t+120,i,r),Ce(t,i,r),Ce(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new z(Gn(this.h),Zt(this.s),Zt(this.l),Jt(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(){const t=Jt(this.opacity);return`${t===1?"hsl(":"hsla("}${Gn(this.h)}, ${Zt(this.s)*100}%, ${Zt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Gn(t){return t=(t||0)%360,t<0?t+360:t}function Zt(t){return Math.max(0,Math.min(1,t||0))}function Ce(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Pe=t=>()=>t;function $o(t,e){return function(n){return t+n*e}}function Ao(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 Do(t){return(t=+t)==1?Vn:function(e,n){return n-e?Ao(e,n,t):Pe(isNaN(e)?n:e)}}function Vn(t,e){var n=e-t;return n?$o(t,n):Pe(isNaN(t)?e:t)}const Qt=function t(e){var n=Do(e);function r(i,a){var o=n((i=Me(i)).r,(a=Me(a)).r),u=n(i.g,a.g),s=n(i.b,a.b),l=Vn(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=s(f),i.opacity=l(f),i+""}}return r.gamma=t,r}(1);function So(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=t[i]*(1-a)+e[i]*a;return r}}function Mo(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Co(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=Te(t[o],e[o]);for(;o<n;++o)a[o]=e[o];return function(u){for(o=0;o<r;++o)a[o]=i[o](u);return a}}function Po(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function U(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Eo(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]=Te(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Ee=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fe=new RegExp(Ee.source,"g");function Fo(t){return function(){return t}}function To(t){return function(e){return t(e)+""}}function zn(t,e){var n=Ee.lastIndex=Fe.lastIndex=0,r,i,a,o=-1,u=[],s=[];for(t=t+"",e=e+"";(r=Ee.exec(t))&&(i=Fe.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,s.push({i:o,x:U(r,i)})),n=Fe.lastIndex;return n<e.length&&(a=e.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?s[0]?To(s[0].x):Fo(e):(e=s.length,function(l){for(var f=0,c;f<e;++f)u[(c=s[f]).i]=c.x(l);return u.join("")})}function Te(t,e){var n=typeof e,r;return e==null||n==="boolean"?Pe(e):(n==="number"?U:n==="string"?(r=ut(e))?(e=r,Qt):zn:e instanceof ut?Qt:e instanceof Date?Po:Mo(e)?So:Array.isArray(e)?Co:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Eo:U)(t,e)}function Io(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Un=180/Math.PI,Ie={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Hn(t,e,n,r,i,a){var o,u,s;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Un,skewX:Math.atan(s)*Un,scaleX:o,scaleY:u}}var te;function No(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ie:Hn(e.a,e.b,e.c,e.d,e.e,e.f)}function Oo(t){return t==null||(te||(te=document.createElementNS("http://www.w3.org/2000/svg","g")),te.setAttribute("transform",t),!(t=te.transform.baseVal.consolidate()))?Ie:(t=t.matrix,Hn(t.a,t.b,t.c,t.d,t.e,t.f))}function Xn(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,f,c,h,d,m){if(l!==c||f!==h){var p=d.push("translate(",null,e,null,n);m.push({i:p-4,x:U(l,c)},{i:p-2,x:U(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function o(l,f,c,h){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),h.push({i:c.push(i(c)+"rotate(",null,r)-2,x:U(l,f)})):f&&c.push(i(c)+"rotate("+f+r)}function u(l,f,c,h){l!==f?h.push({i:c.push(i(c)+"skewX(",null,r)-2,x:U(l,f)}):f&&c.push(i(c)+"skewX("+f+r)}function s(l,f,c,h,d,m){if(l!==c||f!==h){var p=d.push(i(d)+"scale(",null,",",null,")");m.push({i:p-4,x:U(l,c)},{i:p-2,x:U(f,h)})}else(c!==1||h!==1)&&d.push(i(d)+"scale("+c+","+h+")")}return function(l,f){var c=[],h=[];return l=t(l),f=t(f),a(l.translateX,l.translateY,f.translateX,f.translateY,c,h),o(l.rotate,f.rotate,c,h),u(l.skewX,f.skewX,c,h),s(l.scaleX,l.scaleY,f.scaleX,f.scaleY,c,h),l=f=null,function(d){for(var m=-1,p=h.length,g;++m<p;)c[(g=h[m]).i]=g.x(d);return c.join("")}}}var ko=Xn(No,"px, ","px)","deg)"),Ro=Xn(Oo,", ",")",")"),gt=0,It=0,Nt=0,Yn=1e3,ee,Ot,ne=0,ct=0,re=0,kt=typeof performance=="object"&&performance.now?performance:Date,Bn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ne(){return ct||(Bn(Lo),ct=kt.now()+re)}function Lo(){ct=0}function ie(){this._call=this._time=this._next=null}ie.prototype=Wn.prototype={constructor:ie,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ne():+n)+(e==null?0:+e),!this._next&&Ot!==this&&(Ot?Ot._next=this:ee=this,Ot=this),this._call=t,this._time=n,Oe()},stop:function(){this._call&&(this._call=null,this._time=1/0,Oe())}};function Wn(t,e,n){var r=new ie;return r.restart(t,e,n),r}function Go(){Ne(),++gt;for(var t=ee,e;t;)(e=ct-t._time)>=0&&t._call.call(void 0,e),t=t._next;--gt}function qn(){ct=(ne=kt.now())+re,gt=It=0;try{Go()}finally{gt=0,zo(),ct=0}}function Vo(){var t=kt.now(),e=t-ne;e>Yn&&(re-=e,ne=t)}function zo(){for(var t,e=ee,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:ee=n);Ot=t,Oe(r)}function Oe(t){if(!gt){It&&(It=clearTimeout(It));var e=t-ct;e>24?(t<1/0&&(It=setTimeout(qn,t-kt.now()-re)),Nt&&(Nt=clearInterval(Nt))):(Nt||(ne=kt.now(),Nt=setInterval(Vo,Yn)),gt=1,Bn(qn))}}function jn(t,e,n){var r=new ie;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Uo=mn("start","end","cancel","interrupt"),Ho=[],Kn=0,Jn=1,ke=2,ae=3,Zn=4,Re=5,oe=6;function ue(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Xo(t,n,{name:e,index:r,group:i,on:Uo,tween:Ho,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Kn})}function Le(t,e){var n=H(t,e);if(n.state>Kn)throw new Error("too late; already scheduled");return n}function W(t,e){var n=H(t,e);if(n.state>ae)throw new Error("too late; already running");return n}function H(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Xo(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Wn(a,0,n.time);function a(l){n.state=Jn,n.timer.restart(o,n.delay,n.time),n.delay<=l&&o(l-n.delay)}function o(l){var f,c,h,d;if(n.state!==Jn)return s();for(f in r)if(d=r[f],d.name===n.name){if(d.state===ae)return jn(o);d.state===Zn?(d.state=oe,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=oe,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(jn(function(){n.state===ae&&(n.state=Zn,n.timer.restart(u,n.delay,n.time),u(l))}),n.state=ke,n.on.call("start",t,t.__data__,n.index,n.group),n.state===ke){for(n.state=ae,i=new Array(h=n.tween.length),f=0,c=-1;f<h;++f)(d=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=d);i.length=c+1}}function u(l){for(var f=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(s),n.state=Re,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===Re&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){n.state=oe,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Yo(t,e){var n=t.__transition,r,i,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=!1;continue}i=r.state>ke&&r.state<Re,r.state=oe,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function Bo(t){return this.each(function(){Yo(this,t)})}function Wo(t,e){var n,r;return function(){var i=W(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,u=r.length;o<u;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function qo(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=W(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},s=0,l=i.length;s<l;++s)if(i[s].name===e){i[s]=u;break}s===l&&i.push(u)}a.tween=i}}function jo(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=H(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Wo:qo)(n,t,e))}function Ge(t,e,n){var r=t._id;return t.each(function(){var i=W(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return H(i,r).value[e]}}function Qn(t,e){var n;return(typeof e=="number"?U:e instanceof ut?Qt:(n=ut(e))?(e=n,Qt):zn)(t,e)}function Ko(t){return function(){this.removeAttribute(t)}}function Jo(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zo(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function Qo(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function tu(t,e,n){var r,i,a;return function(){var o,u=n(this),s;return u==null?void this.removeAttribute(t):(o=this.getAttribute(t),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u)))}}function eu(t,e,n){var r,i,a;return function(){var o,u=n(this),s;return u==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u)))}}function nu(t,e){var n=Bt(t),r=n==="transform"?Ro:Qn;return this.attrTween(t,typeof e=="function"?(n.local?eu:tu)(n,r,Ge(this,"attr."+t,e)):e==null?(n.local?Jo:Ko)(n):(n.local?Qo:Zo)(n,r,e))}function ru(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function iu(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function au(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&iu(t,a)),n}return i._value=e,i}function ou(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&ru(t,a)),n}return i._value=e,i}function uu(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=Bt(t);return this.tween(n,(r.local?au:ou)(r,e))}function su(t,e){return function(){Le(this,t).delay=+e.apply(this,arguments)}}function lu(t,e){return e=+e,function(){Le(this,t).delay=e}}function cu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?su:lu)(e,t)):H(this.node(),e).delay}function fu(t,e){return function(){W(this,t).duration=+e.apply(this,arguments)}}function hu(t,e){return e=+e,function(){W(this,t).duration=e}}function du(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?fu:hu)(e,t)):H(this.node(),e).duration}function pu(t,e){if(typeof e!="function")throw new Error;return function(){W(this,t).ease=e}}function mu(t){var e=this._id;return arguments.length?this.each(pu(e,t)):H(this.node(),e).ease}function gu(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;W(this,t).ease=n}}function vu(t){if(typeof t!="function")throw new Error;return this.each(gu(this._id,t))}function yu(t){typeof t!="function"&&(t=bn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&u.push(s);return new K(r,this._parents,this._name,this._id)}function wu(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u)for(var s=e[u],l=n[u],f=s.length,c=o[u]=new Array(f),h,d=0;d<f;++d)(h=s[d]||l[d])&&(c[d]=h);for(;u<r;++u)o[u]=e[u];return new K(o,this._parents,this._name,this._id)}function bu(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 xu(t,e,n){var r,i,a=bu(e)?Le:W;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}function _u(t,e){var n=this._id;return arguments.length<2?H(this.node(),n).on.on(t):this.each(xu(n,t,e))}function $u(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Au(){return this.on("end.remove",$u(this._id))}function Du(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ae(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var u=r[o],s=u.length,l=a[o]=new Array(s),f,c,h=0;h<s;++h)(f=u[h])&&(c=t.call(f,f.__data__,h,u))&&("__data__"in f&&(c.__data__=f.__data__),l[h]=c,ue(l[h],e,n,h,l,H(f,n)));return new K(a,this._parents,e,n)}function Su(t){var e=this._name,n=this._id;typeof t!="function"&&(t=wn(t));for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u)for(var s=r[u],l=s.length,f,c=0;c<l;++c)if(f=s[c]){for(var h=t.call(f,f.__data__,c,s),d,m=H(f,n),p=0,g=h.length;p<g;++p)(d=h[p])&&ue(d,e,n,p,h,m);a.push(h),o.push(f)}return new K(a,o,e,n)}var Mu=Pt.prototype.constructor;function Cu(){return new Mu(this._groups,this._parents)}function Pu(t,e){var n,r,i;return function(){var a=pt(this,t),o=(this.style.removeProperty(t),pt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function tr(t){return function(){this.style.removeProperty(t)}}function Eu(t,e,n){var r,i=n+"",a;return function(){var o=pt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function Fu(t,e,n){var r,i,a;return function(){var o=pt(this,t),u=n(this),s=u+"";return u==null&&(s=u=(this.style.removeProperty(t),pt(this,t))),o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}function Tu(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var s=W(this,t),l=s.on,f=s.value[a]==null?u||(u=tr(e)):void 0;(l!==n||i!==f)&&(r=(n=l).copy()).on(o,i=f),s.on=r}}function Iu(t,e,n){var r=(t+="")=="transform"?ko:Qn;return e==null?this.styleTween(t,Pu(t,r)).on("end.style."+t,tr(t)):typeof e=="function"?this.styleTween(t,Fu(t,r,Ge(this,"style."+t,e))).each(Tu(this._id,t)):this.styleTween(t,Eu(t,r,e),n).on("end.style."+t,null)}function Nu(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Ou(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Nu(t,o,n)),r}return a._value=e,a}function ku(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,Ou(t,e,n??""))}function Ru(t){return function(){this.textContent=t}}function Lu(t){return function(){var e=t(this);this.textContent=e??""}}function Gu(t){return this.tween("text",typeof t=="function"?Lu(Ge(this,"text",t)):Ru(t==null?"":t+""))}function Vu(t){return function(e){this.textContent=t.call(this,e)}}function zu(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Vu(i)),e}return r._value=t,r}function Uu(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,zu(t))}function Hu(){for(var t=this._name,e=this._id,n=er(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,s,l=0;l<u;++l)if(s=o[l]){var f=H(s,e);ue(s,t,n,l,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new K(r,this._parents,t,n)}function Xu(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var u={value:o},s={value:function(){--i===0&&a()}};n.each(function(){var l=W(this,r),f=l.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(s)),l.on=e}),i===0&&a()})}var Yu=0;function K(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function er(){return++Yu}var J=Pt.prototype;K.prototype={constructor:K,select:Du,selectAll:Su,selectChild:J.selectChild,selectChildren:J.selectChildren,filter:yu,merge:wu,selection:Cu,transition:Hu,call:J.call,nodes:J.nodes,node:J.node,size:J.size,empty:J.empty,each:J.each,on:_u,attr:nu,attrTween:uu,style:Iu,styleTween:ku,text:Gu,textTween:Uu,remove:Au,tween:jo,delay:cu,duration:du,ease:mu,easeVarying:vu,end:Xu,[Symbol.iterator]:J[Symbol.iterator]};function Bu(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Wu={time:null,delay:0,duration:250,ease:Bu};function qu(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 ju(t){var e,n;t instanceof K?(e=t._id,t=t._name):(e=er(),(n=Wu).time=Ne(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,s,l=0;l<u;++l)(s=o[l])&&ue(s,t,e,l,o,n||qu(s,e));return new K(r,this._parents,t,e)}Pt.prototype.interrupt=Bo,Pt.prototype.transition=ju;function Ku(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function se(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function vt(t){return t=se(Math.abs(t)),t?t[1]:NaN}function Ju(t,e){return function(n,r){for(var i=n.length,a=[],o=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),a.push(n.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Zu(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Qu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function le(t){if(!(e=Qu.exec(t)))throw new Error("invalid format: "+t);var e;return new Ve({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]})}le.prototype=Ve.prototype;function Ve(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+""}Ve.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 ts(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 nr;function es(t,e){var n=se(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(nr=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+se(t,Math.max(0,e+a-1))[0]}function rr(t,e){var n=se(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")}const ir={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Ku,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)=>rr(t*100,e),r:rr,s:es,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ar(t){return t}var or=Array.prototype.map,ur=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ns(t){var e=t.grouping===void 0||t.thousands===void 0?ar:Ju(or.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+"",a=t.numerals===void 0?ar:Zu(or.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",s=t.nan===void 0?"NaN":t.nan+"";function l(c){c=le(c);var h=c.fill,d=c.align,m=c.sign,p=c.symbol,g=c.zero,_=c.width,A=c.comma,v=c.precision,x=c.trim,y=c.type;y==="n"?(A=!0,y="g"):ir[y]||(v===void 0&&(v=12),x=!0,y="g"),(g||h==="0"&&d==="=")&&(g=!0,h="0",d="=");var M=p==="$"?n:p==="#"&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w=p==="$"?r:/[%p]/.test(y)?o:"",S=ir[y],C=/[defgprs%]/.test(y);v=v===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function tt(b){var V=M,k=w,et,St,Mt;if(y==="c")k=S(b)+k,b="";else{b=+b;var nt=b<0||1/b<0;if(b=isNaN(b)?s:S(Math.abs(b),v),x&&(b=ts(b)),nt&&+b==0&&m!=="+"&&(nt=!1),V=(nt?m==="("?m:u:m==="-"||m==="("?"":m)+V,k=(y==="s"?ur[8+nr/3]:"")+k+(nt&&m==="("?")":""),C){for(et=-1,St=b.length;++et<St;)if(Mt=b.charCodeAt(et),48>Mt||Mt>57){k=(Mt===46?i+b.slice(et+1):b.slice(et))+k,b=b.slice(0,et);break}}}A&&!g&&(b=e(b,1/0));var dt=V.length+b.length+k.length,rt=dt<_?new Array(_-dt+1).join(h):"";switch(A&&g&&(b=e(rt+b,rt.length?_-k.length:1/0),rt=""),d){case"<":b=V+b+k+rt;break;case"=":b=V+rt+b+k;break;case"^":b=rt.slice(0,dt=rt.length>>1)+V+b+k+rt.slice(dt);break;default:b=rt+V+b+k;break}return a(b)}return tt.toString=function(){return c+""},tt}function f(c,h){var d=l((c=le(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor(vt(h)/3)))*3,p=Math.pow(10,-m),g=ur[8+m/3];return function(_){return d(p*_)+g}}return{format:l,formatPrefix:f}}var ce,ze,sr;rs({thousands:",",grouping:[3],currency:["$",""]});function rs(t){return ce=ns(t),ze=ce.format,sr=ce.formatPrefix,ce}function is(t){return Math.max(0,-vt(Math.abs(t)))}function as(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vt(e)/3)))*3-vt(Math.abs(t)))}function os(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,vt(e)-vt(t))+1}function fe(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const lr=Symbol("implicit");function cr(){var t=new dn,e=[],n=[],r=lr;function i(a){let o=t.get(a);if(o===void 0){if(r!==lr)return r;t.set(a,o=e.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new dn;for(const o of a)t.has(o)||t.set(o,e.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return cr(e,n).unknown(r)},fe.apply(i,arguments),i}function fr(){var t=cr().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,o,u=!1,s=0,l=0,f=.5;delete t.unknown;function c(){var h=e().length,d=i<r,m=d?i:r,p=d?r:i;a=(p-m)/Math.max(1,h-s+l*2),u&&(a=Math.floor(a)),m+=(p-m-a*(h-s))*f,o=a*(1-s),u&&(m=Math.round(m),o=Math.round(o));var g=Ci(h).map(function(_){return m+a*_});return n(d?g.reverse():g)}return t.domain=function(h){return arguments.length?(e(h),c()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,c()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,u=!0,c()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(h){return arguments.length?(u=!!h,c()):u},t.padding=function(h){return arguments.length?(s=Math.min(1,l=+h),c()):s},t.paddingInner=function(h){return arguments.length?(s=Math.min(1,h),c()):s},t.paddingOuter=function(h){return arguments.length?(l=+h,c()):l},t.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),c()):f},t.copy=function(){return fr(e(),[r,i]).round(u).paddingInner(s).paddingOuter(l).align(f)},fe.apply(c(),arguments)}function hr(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return hr(e())},t}function us(){return hr(fr.apply(null,arguments).paddingInner(1))}function ss(t){return function(){return t}}function ls(t){return+t}var dr=[0,1];function yt(t){return t}function Ue(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:ss(isNaN(e)?NaN:.5)}function cs(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function fs(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=Ue(i,r),a=n(o,a)):(r=Ue(r,i),a=n(a,o)),function(u){return a(r(u))}}function hs(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=Ue(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(u){var s=hn(t,u,1,r)-1;return a[s](i[s](u))}}function ds(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ps(){var t=dr,e=dr,n=Te,r,i,a,o=yt,u,s,l;function f(){var h=Math.min(t.length,e.length);return o!==yt&&(o=cs(t[0],t[h-1])),u=h>2?hs:fs,s=l=null,c}function c(h){return h==null||isNaN(h=+h)?a:(s||(s=u(t.map(r),e,n)))(r(o(h)))}return c.invert=function(h){return o(i((l||(l=u(e,t.map(r),U)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,ls),f()):t.slice()},c.range=function(h){return arguments.length?(e=Array.from(h),f()):e.slice()},c.rangeRound=function(h){return e=Array.from(h),n=Io,f()},c.clamp=function(h){return arguments.length?(o=h?!0:yt,f()):o!==yt},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(a=h,c):a},function(h,d){return r=h,i=d,f()}}function ms(){return ps()(yt,yt)}function gs(t,e,n,r){var i=Mi(t,e,n),a;switch(r=le(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=as(i,o))&&(r.precision=a),sr(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=os(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=is(i))&&(r.precision=a-(r.type==="%")*2);break}}return ze(r)}function pr(t){var e=t.domain;return t.ticks=function(n){var r=e();return Si(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return gs(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,o=r[i],u=r[a],s,l,f=10;for(u<o&&(l=o,o=u,u=l,l=i,i=a,a=l);f-- >0;){if(l=_e(o,u,n),l===s)return r[i]=o,r[a]=u,e(r);if(l>0)o=Math.floor(o/l)*l,u=Math.ceil(u/l)*l;else if(l<0)o=Math.ceil(o*l)/l,u=Math.floor(u*l)/l;else break;s=l}return t},t}function mr(){var t=ms();return t.copy=function(){return ds(t,mr())},fe.apply(t,arguments),pr(t)}function gr(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function o(s){return s!=null&&s<=s?i[hn(r,s,0,n)]:a}function u(){var s=-1;for(r=new Array(n);++s<n;)r[s]=((s+1)*e-(s-n)*t)/(n+1);return o}return o.domain=function(s){return arguments.length?([t,e]=s,t=+t,e=+e,u()):[t,e]},o.range=function(s){return arguments.length?(n=(i=Array.from(s)).length-1,u()):i.slice()},o.invertExtent=function(s){var l=i.indexOf(s);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},o.unknown=function(s){return arguments.length&&(a=s),o},o.thresholds=function(){return r.slice()},o.copy=function(){return gr().domain([t,e]).range(i).unknown(a)},fe.apply(pr(o),arguments)}function Rt(t,e,n){this.k=t,this.x=e,this.y=n}Rt.prototype={constructor:Rt,scale:function(t){return t===1?this:new Rt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Rt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Rt.prototype;function q(t){return Object.prototype.toString.call(t)==="[object Object]"}function vs(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function Z(t,e){if(q(t)===!1||q(e)===!1)return Object.assign({},e);const n=(r,i)=>{const a=Object.assign({},i);for(let o of Object.keys(r)){if(!(o in i))continue;let u;q(r[o])&&q(i[o])?(u=n(r[o],i[o]),a[o]=u):a[o]=r[o]}return a};return n(t,e)}function ys(t=0){try{let e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}catch(e){console.error(e)}}function ws(t,e){return e instanceof Function?e(t):ze(e)(t)}function he(t,e,n,r){let i=`${t}_${e}_${n}`;return r!=null&&(i+=`_${r}`),i}function He(t,e){return`${t}_series${e}`}function vr(t,e){return`${t}_group${e}`}function yr({transposedDataGrid:t,dataFormatter:e,chartType:n="grid",gridIndex:r=0}){const i=e.grid.gridData.seriesDirection==="row"?e.grid.gridData.rowLabels:e.grid.gridData.columnLabels;return t.map((a,o)=>i[o]!=null?i[o]:He(`${n}_grid${r}`,o))}function wr({transposedDataGrid:t,dataFormatter:e,chartType:n="grid",gridIndex:r=0}){if(t[0]==null)return[];const i=e.grid.gridData.seriesDirection==="row"?e.grid.gridData.columnLabels:e.grid.gridData.rowLabels;return t[0].map((a,o)=>i[o]!=null?i[o]:vr(`${n}_grid${r}`,o))}function wt(t){const e=[0,0];return t.length?t.reduce((r,i)=>[i<r[0]?i:r[0],i>r[1]?i:r[1]],[t[0],t[0]]):e}function de(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return wt(e)}function bs(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function Xe(t){const n=t.flat().filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function xs(t){const n=t.flat().flat().filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function _s(t,e=2){const r=t.flat().filter((i,a)=>a==e).filter(i=>(i==null||q(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return wt(r)}function br(t,e){if(t==="row")return Object.assign([],e);const n=e.length,r=e.reduce((a,o)=>Math.max(a,o.length),0),i=new Array(r).fill(null).map(()=>new Array(n).fill(null));for(let a=0;a<n;a++)for(let o=0;o<r;o++)i[o][a]=e[a][o];return i}function pe(t,e){return t<e.colors[e.colorScheme].series.length?e.colors[e.colorScheme].series[t]:e.colors[e.colorScheme].series[t%e.colors[e.colorScheme].series.length]}function Lt(t,e,n,r){const{gap:i,rowAmount:a,columnAmount:o}=e,u=(t.width-i*(o-1))/o,s=(t.height-i*(a-1))/a,l=r*u+r*i,f=n*s+n*i,c=[l,f],h=[u/t.width,s/t.height];return{translate:c,scale:h}}function $s(t,e){const n=new Map;let r=Object.assign([],t),i=[];return r.forEach((a,o)=>{Array.isArray(a)?a.forEach((u,s)=>{i.push({rowIndex:o,columnIndex:s,index:-1,datum:u})}):i.push({rowIndex:o,columnIndex:0,index:-1,datum:a})}),i.sort((a,o)=>e(a.datum,o.datum)),i=i.map((a,o)=>({...a,index:o})),i.forEach(a=>{n.set(String([a.rowIndex,a.columnIndex]),a.index)}),n}const As=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i=[];try{const a=(u=>{if(u){const s=$s(e,n.sort);return(l,f,c)=>s.get(String([f,c]))}else return(s,l,f)=>s.length})(n.sort!=null),o=(u,s,l,f,c)=>{const h=he(n.type,s,l),d=n.seriesLabels[s]||He("series",s),m=pe(s,r),p=n.visibleFilter(u,s,l,t);return typeof u=="number"?{id:h,index:f,sortedIndex:c,label:h,description:"",data:{},value:u,seriesIndex:s,seriesLabel:d,color:m,visible:p}:{id:u.id?u.id:h,index:f,sortedIndex:c,label:u.label?u.label:h,description:u.description,data:u.data??{},value:u.value,seriesIndex:s,seriesLabel:d,color:m,visible:p}};e.forEach((u,s)=>{if(Array.isArray(u))u.forEach((l,f)=>{const c=a(i,s,f),h=o(l,s,f,i.length,c);i.push(h)});else{const l=a(i,s,0),f=o(u,s,0,i.length,l);i.push(f)}})}catch(a){throw Error(a)}return i};var Ye=function(t,e){return Ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Ye(t,e)};function Q(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ye(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function Ds(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function u(f){try{l(r.next(f))}catch(c){o(c)}}function s(f){try{l(r.throw(f))}catch(c){o(c)}}function l(f){f.done?a(f.value):i(f.value).then(u,s)}l((r=r.apply(t,e||[])).next())})}function xr(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(l){return function(f){return s([l,f])}}function s(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(f){l=[6,f],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function bt(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function it(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function at(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}function xt(t){return this instanceof xt?(this.v=t,this):new xt(t)}function Ss(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,a=[];return i={},u("next"),u("throw"),u("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(m){return Promise.resolve(m).then(d,c)}}function u(d,m){r[d]&&(i[d]=function(p){return new Promise(function(g,_){a.push([d,p,g,_])>1||s(d,p)})},m&&(i[d]=m(i[d])))}function s(d,m){try{l(r[d](m))}catch(p){h(a[0][3],p)}}function l(d){d.value instanceof xt?Promise.resolve(d.value.v).then(f,c):h(a[0][2],d)}function f(d){s("next",d)}function c(d){s("throw",d)}function h(d,m){d(m),a.shift(),a.length&&s(a[0][0],a[0][1])}}function Ms(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof bt=="function"?bt(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=t[a]&&function(o){return new Promise(function(u,s){o=t[a](o),i(u,s,o.done,o.value)})}}function i(a,o,u,s){Promise.resolve(s).then(function(l){a({value:l,done:u})},o)}}typeof SuppressedError=="function"&&SuppressedError;function T(t){return typeof t=="function"}function Be(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var We=Be(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
1
+ (function(_,Ct){typeof exports=="object"&&typeof module<"u"?Ct(exports):typeof define=="function"&&define.amd?define(["exports"],Ct):(_=typeof globalThis<"u"?globalThis:_||self,Ct(_["orbcharts-core"]={}))})(this,function(_){"use strict";const Ct={preset:{}},cn={top:60,right:60,bottom:60,left:60},fn={padding:cn,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#454545",secondary:"#e1e1e1",white:"#ffffff",background:"#ffffff"},dark:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#f0f0f0",secondary:"#e1e1e1",white:"#ffffff",background:"#000000"}},styles:{textSize:14,unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},di=800,pi=500,j={position:"left",scaleDomain:[0,"auto"],scaleRange:[0,.9],label:""},mi={position:"bottom",scaleDomain:[0,"auto"],scalePadding:.5,label:""},gi={type:"series",visibleFilter:(t,e,n,r)=>!0,unitLabel:"",seriesLabels:[],sort:null},hn={visibleFilter:(t,e,n,r)=>!0,gridData:{seriesDirection:"row",rowLabels:[],columnLabels:[]},valueAxis:{...j},groupAxis:{...mi},slotIndex:0,seriesSlotIndexes:null},vi={type:"grid",grid:{...hn},container:{gap:120,rowAmount:1,columnAmount:1}},Ht={...hn},yi={type:"multiGrid",visibleFilter:(t,e,n,r)=>!0,gridList:[{...Ht}],container:{gap:120,rowAmount:1,columnAmount:1}},wi={type:"multiValue",visibleFilter:(t,e,n,r)=>!0,multiValue:[],xAxis:{...j},yAxis:{...j}},bi={type:"tree",visibleFilter:(t,e,n,r)=>!0},xi={type:"relationship",visibleFilter:(t,e,n,r)=>!0};function Yt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function _i(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function dn(t){let e,n,r;t.length!==2?(e=Yt,n=(u,s)=>Yt(t(u),s),r=(u,s)=>t(u)-s):(e=t===Yt||t===_i?t:$i,n=t,r=t);function i(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<0?l=c+1:f=c}while(l<f)}return l}function a(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<=0?l=c+1:f=c}while(l<f)}return l}function o(u,s,l=0,f=u.length){const c=i(u,s,l,f-1);return c>l&&r(u[c-1],s)>-r(u[c],s)?c-1:c}return{left:i,center:o,right:a}}function $i(){return 0}function Di(t){return t===null?NaN:+t}const pn=dn(Yt).right;dn(Di).center;class mn extends Map{constructor(e,n=Mi){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(gn(this,e))}has(e){return super.has(gn(this,e))}set(e,n){return super.set(Ai(this,e),n)}delete(e){return super.delete(Si(this,e))}}function gn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Ai({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Si({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Mi(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Ci=Math.sqrt(50),Pi=Math.sqrt(10),Ei=Math.sqrt(2);function Xt(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Ci?10:a>=Pi?5:a>=Ei?2:1;let u,s,l;return i<0?(l=Math.pow(10,-i)/o,u=Math.round(t*l),s=Math.round(e*l),u/l<t&&++u,s/l>e&&--s,l=-l):(l=Math.pow(10,i)*o,u=Math.round(t/l),s=Math.round(e/l),u*l<t&&++u,s*l>e&&--s),s<u&&.5<=n&&n<2?Xt(t,e,n*2):[u,s,l]}function Fi(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,o]=r?Xt(e,t,n):Xt(t,e,n);if(!(a>=i))return[];const u=a-i+1,s=new Array(u);if(r)if(o<0)for(let l=0;l<u;++l)s[l]=(a-l)/-o;else for(let l=0;l<u;++l)s[l]=(a-l)*o;else if(o<0)for(let l=0;l<u;++l)s[l]=(i+l)/-o;else for(let l=0;l<u;++l)s[l]=(i+l)*o;return s}function $e(t,e,n){return e=+e,t=+t,n=+n,Xt(t,e,n)[2]}function Ti(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?$e(e,t,n):$e(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function Ii(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,a=new Array(i);++r<i;)a[r]=t+r*n;return a}var Ni={value:()=>{}};function vn(){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 Wt(n)}function Wt(t){this._=t}function Oi(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}})}Wt.prototype=vn.prototype={constructor:Wt,on:function(t,e){var n=this._,r=Oi(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=ki(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=yn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=yn(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 Wt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[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,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function ki(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function yn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Ni,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var De="http://www.w3.org/1999/xhtml";const wn={svg:"http://www.w3.org/2000/svg",xhtml:De,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Bt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),wn.hasOwnProperty(e)?{space:wn[e],local:t}:t}function Li(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===De&&e.documentElement.namespaceURI===De?e.createElement(t):e.createElementNS(n,t)}}function Ri(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function bn(t){var e=Bt(t);return(e.local?Ri:Li)(e)}function Gi(){}function Ae(t){return t==null?Gi:function(){return this.querySelector(t)}}function Vi(t){typeof t!="function"&&(t=Ae(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=new Array(o),s,l,f=0;f<o;++f)(s=a[f])&&(l=t.call(s,s.__data__,f,a))&&("__data__"in s&&(l.__data__=s.__data__),u[f]=l);return new R(r,this._parents)}function zi(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Ui(){return[]}function xn(t){return t==null?Ui:function(){return this.querySelectorAll(t)}}function Hi(t){return function(){return zi(t.apply(this,arguments))}}function Yi(t){typeof t=="function"?t=Hi(t):t=xn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],u=o.length,s,l=0;l<u;++l)(s=o[l])&&(r.push(t.call(s,s.__data__,l,o)),i.push(s));return new R(r,i)}function _n(t){return function(){return this.matches(t)}}function $n(t){return function(e){return e.matches(t)}}var Xi=Array.prototype.find;function Wi(t){return function(){return Xi.call(this.children,t)}}function Bi(){return this.firstElementChild}function qi(t){return this.select(t==null?Bi:Wi(typeof t=="function"?t:$n(t)))}var ji=Array.prototype.filter;function Ki(){return Array.from(this.children)}function Zi(t){return function(){return ji.call(this.children,t)}}function Ji(t){return this.selectAll(t==null?Ki:Zi(typeof t=="function"?t:$n(t)))}function Qi(t){typeof t!="function"&&(t=_n(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&u.push(s);return new R(r,this._parents)}function Dn(t){return new Array(t.length)}function ta(){return new R(this._enter||this._groups.map(Dn),this._parents)}function qt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}qt.prototype={constructor:qt,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 ea(t){return function(){return t}}function na(t,e,n,r,i,a){for(var o=0,u,s=e.length,l=a.length;o<l;++o)(u=e[o])?(u.__data__=a[o],r[o]=u):n[o]=new qt(t,a[o]);for(;o<s;++o)(u=e[o])&&(i[o]=u)}function ra(t,e,n,r,i,a,o){var u,s,l=new Map,f=e.length,c=a.length,h=new Array(f),d;for(u=0;u<f;++u)(s=e[u])&&(h[u]=d=o.call(s,s.__data__,u,e)+"",l.has(d)?i[u]=s:l.set(d,s));for(u=0;u<c;++u)d=o.call(t,a[u],u,a)+"",(s=l.get(d))?(r[u]=s,s.__data__=a[u],l.delete(d)):n[u]=new qt(t,a[u]);for(u=0;u<f;++u)(s=e[u])&&l.get(h[u])===s&&(i[u]=s)}function ia(t){return t.__data__}function aa(t,e){if(!arguments.length)return Array.from(this,ia);var n=e?ra:na,r=this._parents,i=this._groups;typeof t!="function"&&(t=ea(t));for(var a=i.length,o=new Array(a),u=new Array(a),s=new Array(a),l=0;l<a;++l){var f=r[l],c=i[l],h=c.length,d=oa(t.call(f,f&&f.__data__,l,r)),p=d.length,m=u[l]=new Array(p),g=o[l]=new Array(p),y=s[l]=new Array(h);n(f,c,m,g,y,d,e);for(var $=0,x=0,A,v;$<p;++$)if(A=m[$]){for($>=x&&(x=$+1);!(v=g[x])&&++x<p;);A._next=v||null}}return o=new R(o,r),o._enter=u,o._exit=s,o}function oa(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ua(){return new R(this._exit||this._groups.map(Dn),this._parents)}function sa(t,e,n){var r=this.enter(),i=this,a=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?a.remove():n(a),r&&i?r.merge(i).order():i}function la(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),u=new Array(i),s=0;s<o;++s)for(var l=n[s],f=r[s],c=l.length,h=u[s]=new Array(c),d,p=0;p<c;++p)(d=l[p]||f[p])&&(h[p]=d);for(;s<i;++s)u[s]=n[s];return new R(u,this._parents)}function ca(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function fa(t){t||(t=ha);function e(c,h){return c&&h?t(c.__data__,h.__data__):!c-!h}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],u=o.length,s=i[a]=new Array(u),l,f=0;f<u;++f)(l=o[f])&&(s[f]=l);s.sort(e)}return new R(i,this._parents).order()}function ha(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function da(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function pa(){return Array.from(this)}function ma(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function ga(){let t=0;for(const e of this)++t;return t}function va(){return!this.node()}function ya(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,u;a<o;++a)(u=i[a])&&t.call(u,u.__data__,a,i);return this}function wa(t){return function(){this.removeAttribute(t)}}function ba(t){return function(){this.removeAttributeNS(t.space,t.local)}}function xa(t,e){return function(){this.setAttribute(t,e)}}function _a(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function $a(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Da(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 Aa(t,e){var n=Bt(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?ba:wa:typeof e=="function"?n.local?Da:$a:n.local?_a:xa)(n,e))}function An(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Sa(t){return function(){this.style.removeProperty(t)}}function Ma(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Ca(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Pa(t,e,n){return arguments.length>1?this.each((e==null?Sa:typeof e=="function"?Ca:Ma)(t,e,n??"")):pt(this.node(),t)}function pt(t,e){return t.style.getPropertyValue(e)||An(t).getComputedStyle(t,null).getPropertyValue(e)}function Ea(t){return function(){delete this[t]}}function Fa(t,e){return function(){this[t]=e}}function Ta(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ia(t,e){return arguments.length>1?this.each((e==null?Ea:typeof e=="function"?Ta:Fa)(t,e)):this.node()[t]}function Sn(t){return t.trim().split(/^|\s+/)}function Se(t){return t.classList||new Mn(t)}function Mn(t){this._node=t,this._names=Sn(t.getAttribute("class")||"")}Mn.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 Cn(t,e){for(var n=Se(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Pn(t,e){for(var n=Se(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Na(t){return function(){Cn(this,t)}}function Oa(t){return function(){Pn(this,t)}}function ka(t,e){return function(){(e.apply(this,arguments)?Cn:Pn)(this,t)}}function La(t,e){var n=Sn(t+"");if(arguments.length<2){for(var r=Se(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?ka:e?Na:Oa)(n,e))}function Ra(){this.textContent=""}function Ga(t){return function(){this.textContent=t}}function Va(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function za(t){return arguments.length?this.each(t==null?Ra:(typeof t=="function"?Va:Ga)(t)):this.node().textContent}function Ua(){this.innerHTML=""}function Ha(t){return function(){this.innerHTML=t}}function Ya(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Xa(t){return arguments.length?this.each(t==null?Ua:(typeof t=="function"?Ya:Ha)(t)):this.node().innerHTML}function Wa(){this.nextSibling&&this.parentNode.appendChild(this)}function Ba(){return this.each(Wa)}function qa(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ja(){return this.each(qa)}function Ka(t){var e=typeof t=="function"?t:bn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Za(){return null}function Ja(t,e){var n=typeof t=="function"?t:bn(t),r=e==null?Za:typeof e=="function"?e:Ae(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Qa(){var t=this.parentNode;t&&t.removeChild(this)}function to(){return this.each(Qa)}function eo(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function no(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ro(t){return this.select(t?no:eo)}function io(t){return arguments.length?this.property("__data__",t):this.node().__data__}function ao(t){return function(e){t.call(this,e,this.__data__)}}function oo(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 uo(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function so(t,e,n){return function(){var r=this.__on,i,a=ao(e);if(r){for(var o=0,u=r.length;o<u;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=e;return}}this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function lo(t,e,n){var r=oo(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var s=0,l=u.length,f;s<l;++s)for(i=0,f=u[s];i<a;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(u=e?so:uo,i=0;i<a;++i)this.each(u(r[i],e,n));return this}function En(t,e,n){var r=An(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 co(t,e){return function(){return En(this,t,e)}}function fo(t,e){return function(){return En(this,t,e.apply(this,arguments))}}function ho(t,e){return this.each((typeof e=="function"?fo:co)(t,e))}function*po(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Fn=[null];function R(t,e){this._groups=t,this._parents=e}function Pt(){return new R([[document.documentElement]],Fn)}function mo(){return this}R.prototype=Pt.prototype={constructor:R,select:Vi,selectAll:Yi,selectChild:qi,selectChildren:Ji,filter:Qi,data:aa,enter:ta,exit:ua,join:sa,merge:la,selection:mo,order:ca,sort:fa,call:da,nodes:pa,node:ma,size:ga,empty:va,each:ya,attr:Aa,style:Pa,property:Ia,classed:La,text:za,html:Xa,raise:Ba,lower:ja,append:Ka,insert:Ja,remove:to,clone:ro,datum:io,on:lo,dispatch:ho,[Symbol.iterator]:po};function jt(t){return typeof t=="string"?new R([[document.querySelector(t)]],[document.documentElement]):new R([[t]],Fn)}function Me(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Tn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Et(){}var Ft=.7,Kt=1/Ft,mt="\\s*([+-]?\\d+)\\s*",Tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",W="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",go=/^#([0-9a-f]{3,8})$/,vo=new RegExp(`^rgb\\(${mt},${mt},${mt}\\)$`),yo=new RegExp(`^rgb\\(${W},${W},${W}\\)$`),wo=new RegExp(`^rgba\\(${mt},${mt},${mt},${Tt}\\)$`),bo=new RegExp(`^rgba\\(${W},${W},${W},${Tt}\\)$`),xo=new RegExp(`^hsl\\(${Tt},${W},${W}\\)$`),_o=new RegExp(`^hsla\\(${Tt},${W},${W},${Tt}\\)$`),In={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};Me(Et,ot,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Nn,formatHex:Nn,formatHex8:$o,formatHsl:Do,formatRgb:On,toString:On});function Nn(){return this.rgb().formatHex()}function $o(){return this.rgb().formatHex8()}function Do(){return Vn(this).formatHsl()}function On(){return this.rgb().formatRgb()}function ot(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=go.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?kn(e):n===3?new L(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Zt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Zt(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=vo.exec(t))?new L(e[1],e[2],e[3],1):(e=yo.exec(t))?new L(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=wo.exec(t))?Zt(e[1],e[2],e[3],e[4]):(e=bo.exec(t))?Zt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=xo.exec(t))?Gn(e[1],e[2]/100,e[3]/100,1):(e=_o.exec(t))?Gn(e[1],e[2]/100,e[3]/100,e[4]):In.hasOwnProperty(t)?kn(In[t]):t==="transparent"?new L(NaN,NaN,NaN,0):null}function kn(t){return new L(t>>16&255,t>>8&255,t&255,1)}function Zt(t,e,n,r){return r<=0&&(t=e=n=NaN),new L(t,e,n,r)}function Ao(t){return t instanceof Et||(t=ot(t)),t?(t=t.rgb(),new L(t.r,t.g,t.b,t.opacity)):new L}function Ce(t,e,n,r){return arguments.length===1?Ao(t):new L(t,e,n,r??1)}function L(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Me(L,Ce,Tn(Et,{brighter(t){return t=t==null?Kt:Math.pow(Kt,t),new L(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new L(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new L(ut(this.r),ut(this.g),ut(this.b),Jt(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:Ln,formatHex:Ln,formatHex8:So,formatRgb:Rn,toString:Rn}));function Ln(){return`#${st(this.r)}${st(this.g)}${st(this.b)}`}function So(){return`#${st(this.r)}${st(this.g)}${st(this.b)}${st((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rn(){const t=Jt(this.opacity);return`${t===1?"rgb(":"rgba("}${ut(this.r)}, ${ut(this.g)}, ${ut(this.b)}${t===1?")":`, ${t})`}`}function Jt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ut(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function st(t){return t=ut(t),(t<16?"0":"")+t.toString(16)}function Gn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new z(t,e,n,r)}function Vn(t){if(t instanceof z)return new z(t.h,t.s,t.l,t.opacity);if(t instanceof Et||(t=ot(t)),!t)return new z;if(t instanceof z)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,s=(a+i)/2;return u?(e===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-e)/u+2:o=(e-n)/u+4,u/=s<.5?a+i:2-a-i,o*=60):u=s>0&&s<1?0:o,new z(o,u,s,t.opacity)}function Mo(t,e,n,r){return arguments.length===1?Vn(t):new z(t,e,n,r??1)}function z(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Me(z,Mo,Tn(Et,{brighter(t){return t=t==null?Kt:Math.pow(Kt,t),new z(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new z(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 L(Pe(t>=240?t-240:t+120,i,r),Pe(t,i,r),Pe(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new z(zn(this.h),Qt(this.s),Qt(this.l),Jt(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(){const t=Jt(this.opacity);return`${t===1?"hsl(":"hsla("}${zn(this.h)}, ${Qt(this.s)*100}%, ${Qt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zn(t){return t=(t||0)%360,t<0?t+360:t}function Qt(t){return Math.max(0,Math.min(1,t||0))}function Pe(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Ee=t=>()=>t;function Co(t,e){return function(n){return t+n*e}}function Po(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 Eo(t){return(t=+t)==1?Un:function(e,n){return n-e?Po(e,n,t):Ee(isNaN(e)?n:e)}}function Un(t,e){var n=e-t;return n?Co(t,n):Ee(isNaN(t)?e:t)}const te=function t(e){var n=Eo(e);function r(i,a){var o=n((i=Ce(i)).r,(a=Ce(a)).r),u=n(i.g,a.g),s=n(i.b,a.b),l=Un(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=s(f),i.opacity=l(f),i+""}}return r.gamma=t,r}(1);function Fo(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=t[i]*(1-a)+e[i]*a;return r}}function To(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Io(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=Ie(t[o],e[o]);for(;o<n;++o)a[o]=e[o];return function(u){for(o=0;o<r;++o)a[o]=i[o](u);return a}}function No(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function U(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Oo(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]=Ie(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Fe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Te=new RegExp(Fe.source,"g");function ko(t){return function(){return t}}function Lo(t){return function(e){return t(e)+""}}function Hn(t,e){var n=Fe.lastIndex=Te.lastIndex=0,r,i,a,o=-1,u=[],s=[];for(t=t+"",e=e+"";(r=Fe.exec(t))&&(i=Te.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,s.push({i:o,x:U(r,i)})),n=Te.lastIndex;return n<e.length&&(a=e.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?s[0]?Lo(s[0].x):ko(e):(e=s.length,function(l){for(var f=0,c;f<e;++f)u[(c=s[f]).i]=c.x(l);return u.join("")})}function Ie(t,e){var n=typeof e,r;return e==null||n==="boolean"?Ee(e):(n==="number"?U:n==="string"?(r=ot(e))?(e=r,te):Hn:e instanceof ot?te:e instanceof Date?No:To(e)?Fo:Array.isArray(e)?Io:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Oo:U)(t,e)}function Ro(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Yn=180/Math.PI,Ne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xn(t,e,n,r,i,a){var o,u,s;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Yn,skewX:Math.atan(s)*Yn,scaleX:o,scaleY:u}}var ee;function Go(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ne:Xn(e.a,e.b,e.c,e.d,e.e,e.f)}function Vo(t){return t==null||(ee||(ee=document.createElementNS("http://www.w3.org/2000/svg","g")),ee.setAttribute("transform",t),!(t=ee.transform.baseVal.consolidate()))?Ne:(t=t.matrix,Xn(t.a,t.b,t.c,t.d,t.e,t.f))}function Wn(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,f,c,h,d,p){if(l!==c||f!==h){var m=d.push("translate(",null,e,null,n);p.push({i:m-4,x:U(l,c)},{i:m-2,x:U(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function o(l,f,c,h){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),h.push({i:c.push(i(c)+"rotate(",null,r)-2,x:U(l,f)})):f&&c.push(i(c)+"rotate("+f+r)}function u(l,f,c,h){l!==f?h.push({i:c.push(i(c)+"skewX(",null,r)-2,x:U(l,f)}):f&&c.push(i(c)+"skewX("+f+r)}function s(l,f,c,h,d,p){if(l!==c||f!==h){var m=d.push(i(d)+"scale(",null,",",null,")");p.push({i:m-4,x:U(l,c)},{i:m-2,x:U(f,h)})}else(c!==1||h!==1)&&d.push(i(d)+"scale("+c+","+h+")")}return function(l,f){var c=[],h=[];return l=t(l),f=t(f),a(l.translateX,l.translateY,f.translateX,f.translateY,c,h),o(l.rotate,f.rotate,c,h),u(l.skewX,f.skewX,c,h),s(l.scaleX,l.scaleY,f.scaleX,f.scaleY,c,h),l=f=null,function(d){for(var p=-1,m=h.length,g;++p<m;)c[(g=h[p]).i]=g.x(d);return c.join("")}}}var zo=Wn(Go,"px, ","px)","deg)"),Uo=Wn(Vo,", ",")",")"),gt=0,It=0,Nt=0,Bn=1e3,ne,Ot,re=0,lt=0,ie=0,kt=typeof performance=="object"&&performance.now?performance:Date,qn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Oe(){return lt||(qn(Ho),lt=kt.now()+ie)}function Ho(){lt=0}function ae(){this._call=this._time=this._next=null}ae.prototype=jn.prototype={constructor:ae,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Oe():+n)+(e==null?0:+e),!this._next&&Ot!==this&&(Ot?Ot._next=this:ne=this,Ot=this),this._call=t,this._time=n,ke()},stop:function(){this._call&&(this._call=null,this._time=1/0,ke())}};function jn(t,e,n){var r=new ae;return r.restart(t,e,n),r}function Yo(){Oe(),++gt;for(var t=ne,e;t;)(e=lt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--gt}function Kn(){lt=(re=kt.now())+ie,gt=It=0;try{Yo()}finally{gt=0,Wo(),lt=0}}function Xo(){var t=kt.now(),e=t-re;e>Bn&&(ie-=e,re=t)}function Wo(){for(var t,e=ne,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:ne=n);Ot=t,ke(r)}function ke(t){if(!gt){It&&(It=clearTimeout(It));var e=t-lt;e>24?(t<1/0&&(It=setTimeout(Kn,t-kt.now()-ie)),Nt&&(Nt=clearInterval(Nt))):(Nt||(re=kt.now(),Nt=setInterval(Xo,Bn)),gt=1,qn(Kn))}}function Zn(t,e,n){var r=new ae;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Bo=vn("start","end","cancel","interrupt"),qo=[],Jn=0,Qn=1,Le=2,oe=3,tr=4,Re=5,ue=6;function se(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;jo(t,n,{name:e,index:r,group:i,on:Bo,tween:qo,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Jn})}function Ge(t,e){var n=H(t,e);if(n.state>Jn)throw new Error("too late; already scheduled");return n}function B(t,e){var n=H(t,e);if(n.state>oe)throw new Error("too late; already running");return n}function H(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function jo(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=jn(a,0,n.time);function a(l){n.state=Qn,n.timer.restart(o,n.delay,n.time),n.delay<=l&&o(l-n.delay)}function o(l){var f,c,h,d;if(n.state!==Qn)return s();for(f in r)if(d=r[f],d.name===n.name){if(d.state===oe)return Zn(o);d.state===tr?(d.state=ue,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=ue,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(Zn(function(){n.state===oe&&(n.state=tr,n.timer.restart(u,n.delay,n.time),u(l))}),n.state=Le,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Le){for(n.state=oe,i=new Array(h=n.tween.length),f=0,c=-1;f<h;++f)(d=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=d);i.length=c+1}}function u(l){for(var f=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(s),n.state=Re,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===Re&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){n.state=ue,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Ko(t,e){var n=t.__transition,r,i,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=!1;continue}i=r.state>Le&&r.state<Re,r.state=ue,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function Zo(t){return this.each(function(){Ko(this,t)})}function Jo(t,e){var n,r;return function(){var i=B(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,u=r.length;o<u;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Qo(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=B(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},s=0,l=i.length;s<l;++s)if(i[s].name===e){i[s]=u;break}s===l&&i.push(u)}a.tween=i}}function tu(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=H(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Jo:Qo)(n,t,e))}function Ve(t,e,n){var r=t._id;return t.each(function(){var i=B(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return H(i,r).value[e]}}function er(t,e){var n;return(typeof e=="number"?U:e instanceof ot?te:(n=ot(e))?(e=n,te):Hn)(t,e)}function eu(t){return function(){this.removeAttribute(t)}}function nu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ru(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function iu(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function au(t,e,n){var r,i,a;return function(){var o,u=n(this),s;return u==null?void this.removeAttribute(t):(o=this.getAttribute(t),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u)))}}function ou(t,e,n){var r,i,a;return function(){var o,u=n(this),s;return u==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u)))}}function uu(t,e){var n=Bt(t),r=n==="transform"?Uo:er;return this.attrTween(t,typeof e=="function"?(n.local?ou:au)(n,r,Ve(this,"attr."+t,e)):e==null?(n.local?nu:eu)(n):(n.local?iu:ru)(n,r,e))}function su(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function lu(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function cu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&lu(t,a)),n}return i._value=e,i}function fu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&su(t,a)),n}return i._value=e,i}function hu(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=Bt(t);return this.tween(n,(r.local?cu:fu)(r,e))}function du(t,e){return function(){Ge(this,t).delay=+e.apply(this,arguments)}}function pu(t,e){return e=+e,function(){Ge(this,t).delay=e}}function mu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?du:pu)(e,t)):H(this.node(),e).delay}function gu(t,e){return function(){B(this,t).duration=+e.apply(this,arguments)}}function vu(t,e){return e=+e,function(){B(this,t).duration=e}}function yu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?gu:vu)(e,t)):H(this.node(),e).duration}function wu(t,e){if(typeof e!="function")throw new Error;return function(){B(this,t).ease=e}}function bu(t){var e=this._id;return arguments.length?this.each(wu(e,t)):H(this.node(),e).ease}function xu(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;B(this,t).ease=n}}function _u(t){if(typeof t!="function")throw new Error;return this.each(xu(this._id,t))}function $u(t){typeof t!="function"&&(t=_n(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&u.push(s);return new K(r,this._parents,this._name,this._id)}function Du(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u)for(var s=e[u],l=n[u],f=s.length,c=o[u]=new Array(f),h,d=0;d<f;++d)(h=s[d]||l[d])&&(c[d]=h);for(;u<r;++u)o[u]=e[u];return new K(o,this._parents,this._name,this._id)}function Au(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 Su(t,e,n){var r,i,a=Au(e)?Ge:B;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}function Mu(t,e){var n=this._id;return arguments.length<2?H(this.node(),n).on.on(t):this.each(Su(n,t,e))}function Cu(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Pu(){return this.on("end.remove",Cu(this._id))}function Eu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ae(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var u=r[o],s=u.length,l=a[o]=new Array(s),f,c,h=0;h<s;++h)(f=u[h])&&(c=t.call(f,f.__data__,h,u))&&("__data__"in f&&(c.__data__=f.__data__),l[h]=c,se(l[h],e,n,h,l,H(f,n)));return new K(a,this._parents,e,n)}function Fu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=xn(t));for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u)for(var s=r[u],l=s.length,f,c=0;c<l;++c)if(f=s[c]){for(var h=t.call(f,f.__data__,c,s),d,p=H(f,n),m=0,g=h.length;m<g;++m)(d=h[m])&&se(d,e,n,m,h,p);a.push(h),o.push(f)}return new K(a,o,e,n)}var Tu=Pt.prototype.constructor;function Iu(){return new Tu(this._groups,this._parents)}function Nu(t,e){var n,r,i;return function(){var a=pt(this,t),o=(this.style.removeProperty(t),pt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function nr(t){return function(){this.style.removeProperty(t)}}function Ou(t,e,n){var r,i=n+"",a;return function(){var o=pt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function ku(t,e,n){var r,i,a;return function(){var o=pt(this,t),u=n(this),s=u+"";return u==null&&(s=u=(this.style.removeProperty(t),pt(this,t))),o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}function Lu(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var s=B(this,t),l=s.on,f=s.value[a]==null?u||(u=nr(e)):void 0;(l!==n||i!==f)&&(r=(n=l).copy()).on(o,i=f),s.on=r}}function Ru(t,e,n){var r=(t+="")=="transform"?zo:er;return e==null?this.styleTween(t,Nu(t,r)).on("end.style."+t,nr(t)):typeof e=="function"?this.styleTween(t,ku(t,r,Ve(this,"style."+t,e))).each(Lu(this._id,t)):this.styleTween(t,Ou(t,r,e),n).on("end.style."+t,null)}function Gu(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Vu(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Gu(t,o,n)),r}return a._value=e,a}function zu(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,Vu(t,e,n??""))}function Uu(t){return function(){this.textContent=t}}function Hu(t){return function(){var e=t(this);this.textContent=e??""}}function Yu(t){return this.tween("text",typeof t=="function"?Hu(Ve(this,"text",t)):Uu(t==null?"":t+""))}function Xu(t){return function(e){this.textContent=t.call(this,e)}}function Wu(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Xu(i)),e}return r._value=t,r}function Bu(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,Wu(t))}function qu(){for(var t=this._name,e=this._id,n=rr(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,s,l=0;l<u;++l)if(s=o[l]){var f=H(s,e);se(s,t,n,l,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new K(r,this._parents,t,n)}function ju(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var u={value:o},s={value:function(){--i===0&&a()}};n.each(function(){var l=B(this,r),f=l.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(s)),l.on=e}),i===0&&a()})}var Ku=0;function K(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function rr(){return++Ku}var Z=Pt.prototype;K.prototype={constructor:K,select:Eu,selectAll:Fu,selectChild:Z.selectChild,selectChildren:Z.selectChildren,filter:$u,merge:Du,selection:Iu,transition:qu,call:Z.call,nodes:Z.nodes,node:Z.node,size:Z.size,empty:Z.empty,each:Z.each,on:Mu,attr:uu,attrTween:hu,style:Ru,styleTween:zu,text:Yu,textTween:Bu,remove:Pu,tween:tu,delay:mu,duration:yu,ease:bu,easeVarying:_u,end:ju,[Symbol.iterator]:Z[Symbol.iterator]};function Zu(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Ju={time:null,delay:0,duration:250,ease:Zu};function Qu(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 ts(t){var e,n;t instanceof K?(e=t._id,t=t._name):(e=rr(),(n=Ju).time=Oe(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,s,l=0;l<u;++l)(s=o[l])&&se(s,t,e,l,o,n||Qu(s,e));return new K(r,this._parents,t,e)}Pt.prototype.interrupt=Zo,Pt.prototype.transition=ts;function es(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function le(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function vt(t){return t=le(Math.abs(t)),t?t[1]:NaN}function ns(t,e){return function(n,r){for(var i=n.length,a=[],o=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),a.push(n.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function rs(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var is=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ce(t){if(!(e=is.exec(t)))throw new Error("invalid format: "+t);var e;return new ze({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]})}ce.prototype=ze.prototype;function ze(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+""}ze.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 as(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 ir;function os(t,e){var n=le(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(ir=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+le(t,Math.max(0,e+a-1))[0]}function ar(t,e){var n=le(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")}const or={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:es,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)=>ar(t*100,e),r:ar,s:os,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ur(t){return t}var sr=Array.prototype.map,lr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function us(t){var e=t.grouping===void 0||t.thousands===void 0?ur:ns(sr.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+"",a=t.numerals===void 0?ur:rs(sr.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",s=t.nan===void 0?"NaN":t.nan+"";function l(c){c=ce(c);var h=c.fill,d=c.align,p=c.sign,m=c.symbol,g=c.zero,y=c.width,$=c.comma,x=c.precision,A=c.trim,v=c.type;v==="n"?($=!0,v="g"):or[v]||(x===void 0&&(x=12),A=!0,v="g"),(g||h==="0"&&d==="=")&&(g=!0,h="0",d="=");var C=m==="$"?n:m==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",w=m==="$"?r:/[%p]/.test(v)?o:"",S=or[v],M=/[defgprs%]/.test(v);x=x===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function ht(b){var V=C,k=w,Q,St,Mt;if(v==="c")k=S(b)+k,b="";else{b=+b;var tt=b<0||1/b<0;if(b=isNaN(b)?s:S(Math.abs(b),x),A&&(b=as(b)),tt&&+b==0&&p!=="+"&&(tt=!1),V=(tt?p==="("?p:u:p==="-"||p==="("?"":p)+V,k=(v==="s"?lr[8+ir/3]:"")+k+(tt&&p==="("?")":""),M){for(Q=-1,St=b.length;++Q<St;)if(Mt=b.charCodeAt(Q),48>Mt||Mt>57){k=(Mt===46?i+b.slice(Q+1):b.slice(Q))+k,b=b.slice(0,Q);break}}}$&&!g&&(b=e(b,1/0));var dt=V.length+b.length+k.length,et=dt<y?new Array(y-dt+1).join(h):"";switch($&&g&&(b=e(et+b,et.length?y-k.length:1/0),et=""),d){case"<":b=V+b+k+et;break;case"=":b=V+et+b+k;break;case"^":b=et.slice(0,dt=et.length>>1)+V+b+k+et.slice(dt);break;default:b=et+V+b+k;break}return a(b)}return ht.toString=function(){return c+""},ht}function f(c,h){var d=l((c=ce(c),c.type="f",c)),p=Math.max(-8,Math.min(8,Math.floor(vt(h)/3)))*3,m=Math.pow(10,-p),g=lr[8+p/3];return function(y){return d(m*y)+g}}return{format:l,formatPrefix:f}}var fe,Ue,cr;ss({thousands:",",grouping:[3],currency:["$",""]});function ss(t){return fe=us(t),Ue=fe.format,cr=fe.formatPrefix,fe}function ls(t){return Math.max(0,-vt(Math.abs(t)))}function cs(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vt(e)/3)))*3-vt(Math.abs(t)))}function fs(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,vt(e)-vt(t))+1}function he(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const fr=Symbol("implicit");function hr(){var t=new mn,e=[],n=[],r=fr;function i(a){let o=t.get(a);if(o===void 0){if(r!==fr)return r;t.set(a,o=e.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new mn;for(const o of a)t.has(o)||t.set(o,e.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return hr(e,n).unknown(r)},he.apply(i,arguments),i}function dr(){var t=hr().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,o,u=!1,s=0,l=0,f=.5;delete t.unknown;function c(){var h=e().length,d=i<r,p=d?i:r,m=d?r:i;a=(m-p)/Math.max(1,h-s+l*2),u&&(a=Math.floor(a)),p+=(m-p-a*(h-s))*f,o=a*(1-s),u&&(p=Math.round(p),o=Math.round(o));var g=Ii(h).map(function(y){return p+a*y});return n(d?g.reverse():g)}return t.domain=function(h){return arguments.length?(e(h),c()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,c()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,u=!0,c()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(h){return arguments.length?(u=!!h,c()):u},t.padding=function(h){return arguments.length?(s=Math.min(1,l=+h),c()):s},t.paddingInner=function(h){return arguments.length?(s=Math.min(1,h),c()):s},t.paddingOuter=function(h){return arguments.length?(l=+h,c()):l},t.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),c()):f},t.copy=function(){return dr(e(),[r,i]).round(u).paddingInner(s).paddingOuter(l).align(f)},he.apply(c(),arguments)}function pr(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return pr(e())},t}function hs(){return pr(dr.apply(null,arguments).paddingInner(1))}function ds(t){return function(){return t}}function ps(t){return+t}var mr=[0,1];function yt(t){return t}function He(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:ds(isNaN(e)?NaN:.5)}function ms(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function gs(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=He(i,r),a=n(o,a)):(r=He(r,i),a=n(a,o)),function(u){return a(r(u))}}function vs(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=He(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(u){var s=pn(t,u,1,r)-1;return a[s](i[s](u))}}function ys(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ws(){var t=mr,e=mr,n=Ie,r,i,a,o=yt,u,s,l;function f(){var h=Math.min(t.length,e.length);return o!==yt&&(o=ms(t[0],t[h-1])),u=h>2?vs:gs,s=l=null,c}function c(h){return h==null||isNaN(h=+h)?a:(s||(s=u(t.map(r),e,n)))(r(o(h)))}return c.invert=function(h){return o(i((l||(l=u(e,t.map(r),U)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,ps),f()):t.slice()},c.range=function(h){return arguments.length?(e=Array.from(h),f()):e.slice()},c.rangeRound=function(h){return e=Array.from(h),n=Ro,f()},c.clamp=function(h){return arguments.length?(o=h?!0:yt,f()):o!==yt},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(a=h,c):a},function(h,d){return r=h,i=d,f()}}function bs(){return ws()(yt,yt)}function xs(t,e,n,r){var i=Ti(t,e,n),a;switch(r=ce(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=cs(i,o))&&(r.precision=a),cr(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=fs(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=ls(i))&&(r.precision=a-(r.type==="%")*2);break}}return Ue(r)}function gr(t){var e=t.domain;return t.ticks=function(n){var r=e();return Fi(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return xs(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,o=r[i],u=r[a],s,l,f=10;for(u<o&&(l=o,o=u,u=l,l=i,i=a,a=l);f-- >0;){if(l=$e(o,u,n),l===s)return r[i]=o,r[a]=u,e(r);if(l>0)o=Math.floor(o/l)*l,u=Math.ceil(u/l)*l;else if(l<0)o=Math.ceil(o*l)/l,u=Math.floor(u*l)/l;else break;s=l}return t},t}function vr(){var t=bs();return t.copy=function(){return ys(t,vr())},he.apply(t,arguments),gr(t)}function yr(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function o(s){return s!=null&&s<=s?i[pn(r,s,0,n)]:a}function u(){var s=-1;for(r=new Array(n);++s<n;)r[s]=((s+1)*e-(s-n)*t)/(n+1);return o}return o.domain=function(s){return arguments.length?([t,e]=s,t=+t,e=+e,u()):[t,e]},o.range=function(s){return arguments.length?(n=(i=Array.from(s)).length-1,u()):i.slice()},o.invertExtent=function(s){var l=i.indexOf(s);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},o.unknown=function(s){return arguments.length&&(a=s),o},o.thresholds=function(){return r.slice()},o.copy=function(){return yr().domain([t,e]).range(i).unknown(a)},he.apply(gr(o),arguments)}function Lt(t,e,n){this.k=t,this.x=e,this.y=n}Lt.prototype={constructor:Lt,scale:function(t){return t===1?this:new Lt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Lt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Lt.prototype;function q(t){return Object.prototype.toString.call(t)==="[object Object]"}function _s(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function nt(t,e){if(q(t)===!1||q(e)===!1)return Object.assign({},e);const n=(r,i)=>{const a=Object.assign({},i);for(let o of Object.keys(r)){if(!(o in i))continue;let u;q(r[o])&&q(i[o])?(u=n(r[o],i[o]),a[o]=u):a[o]=r[o]}return a};return n(t,e)}function $s(t=0){try{let e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}catch(e){console.error(e)}}function Ds(t,e){return e instanceof Function?e(t):Ue(e)(t)}function Rt(t,e,n,r){let i=`${t}_${e}_${n}`;return r!=null&&(i+=`_${r}`),i}function de(t,e){return`${t}_series${e}`}function Ye(t,e){return`${t}_group${e}`}function Xe({transposedDataGrid:t,dataFormatter:e,chartType:n="grid"}){const r=e.grid.gridData.seriesDirection==="row"?e.grid.gridData.rowLabels:e.grid.gridData.columnLabels;return t.map((i,a)=>r[a]!=null?r[a]:de(n,a))}function wr({transposedDataGrid:t,dataFormatter:e,chartType:n="multiGrid",gridIndex:r=0}){const i=e.grid.gridData.seriesDirection==="row"?e.grid.gridData.rowLabels:e.grid.gridData.columnLabels;return t.map((a,o)=>i[o]!=null?i[o]:de(`${n}_grid${r}`,o))}function br({transposedDataGrid:t,dataFormatter:e,chartType:n="grid"}){if(t[0]==null)return[];const r=e.grid.gridData.seriesDirection==="row"?e.grid.gridData.columnLabels:e.grid.gridData.rowLabels;return t[0].map((i,a)=>r[a]!=null?r[a]:Ye(n,a))}function xr({transposedDataGrid:t,dataFormatter:e,chartType:n="multiGrid",gridIndex:r=0}){if(t[0]==null)return[];const i=e.grid.gridData.seriesDirection==="row"?e.grid.gridData.columnLabels:e.grid.gridData.rowLabels;return t[0].map((a,o)=>i[o]!=null?i[o]:Ye(`${n}_grid${r}`,o))}function wt(t){const e=[0,0];return t.length?t.reduce((r,i)=>[i<r[0]?i:r[0],i>r[1]?i:r[1]],[t[0],t[0]]):e}function pe(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return wt(e)}function As(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function We(t){const n=t.flat().filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function Ss(t){const n=t.flat().flat().filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function Ms(t,e=2){const r=t.flat().filter((i,a)=>a==e).filter(i=>(i==null||q(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return wt(r)}function _r(t,e){if(t==="row")return Object.assign([],e);const n=e.length,r=e.reduce((a,o)=>Math.max(a,o.length),0),i=new Array(r).fill(null).map(()=>new Array(n).fill(null));for(let a=0;a<n;a++)for(let o=0;o<r;o++)i[o][a]=e[a][o];return i}function me(t,e){return t<e.colors[e.colorScheme].series.length?e.colors[e.colorScheme].series[t]:e.colors[e.colorScheme].series[t%e.colors[e.colorScheme].series.length]}function Gt(t,e,n,r){const{gap:i,rowAmount:a,columnAmount:o}=e,u=(t.width-i*(o-1))/o,s=(t.height-i*(a-1))/a,l=r*u+r*i,f=n*s+n*i,c=[l,f],h=[u/t.width,s/t.height];return{translate:c,scale:h}}function Cs(t,e){const n=new Map;let r=Object.assign([],t),i=[];return r.forEach((a,o)=>{Array.isArray(a)?a.forEach((u,s)=>{i.push({rowIndex:o,columnIndex:s,index:-1,datum:u})}):i.push({rowIndex:o,columnIndex:0,index:-1,datum:a})}),i.sort((a,o)=>e(a.datum,o.datum)),i=i.map((a,o)=>({...a,index:o})),i.forEach(a=>{n.set(String([a.rowIndex,a.columnIndex]),a.index)}),n}const Ps=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i=[];try{const a=(u=>{if(u){const s=Cs(e,n.sort);return(l,f,c)=>s.get(String([f,c]))}else return(s,l,f)=>s.length})(n.sort!=null),o=(u,s,l,f,c)=>{const h=Rt(n.type,s,l),d=n.seriesLabels[s]||de("series",s),p=me(s,r),m=n.visibleFilter(u,s,l,t);return typeof u=="number"?{id:h,index:f,sortedIndex:c,label:h,description:"",data:{},value:u,seriesIndex:s,seriesLabel:d,color:p,visible:m}:{id:u.id?u.id:h,index:f,sortedIndex:c,label:u.label?u.label:h,description:u.description,data:u.data??{},value:u.value,seriesIndex:s,seriesLabel:d,color:p,visible:m}};e.forEach((u,s)=>{if(Array.isArray(u))u.forEach((l,f)=>{const c=a(i,s,f),h=o(l,s,f,i.length,c);i.push(h)});else{const l=a(i,s,0),f=o(u,s,0,i.length,l);i.push(f)}})}catch(a){throw Error(a)}return i};var Be=function(t,e){return Be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Be(t,e)};function J(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Be(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function Es(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function u(f){try{l(r.next(f))}catch(c){o(c)}}function s(f){try{l(r.throw(f))}catch(c){o(c)}}function l(f){f.done?a(f.value):i(f.value).then(u,s)}l((r=r.apply(t,e||[])).next())})}function $r(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(l){return function(f){return s([l,f])}}function s(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(f){l=[6,f],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function bt(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function rt(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function it(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}function xt(t){return this instanceof xt?(this.v=t,this):new xt(t)}function Fs(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,a=[];return i={},u("next"),u("throw"),u("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(p){return Promise.resolve(p).then(d,c)}}function u(d,p){r[d]&&(i[d]=function(m){return new Promise(function(g,y){a.push([d,m,g,y])>1||s(d,m)})},p&&(i[d]=p(i[d])))}function s(d,p){try{l(r[d](p))}catch(m){h(a[0][3],m)}}function l(d){d.value instanceof xt?Promise.resolve(d.value.v).then(f,c):h(a[0][2],d)}function f(d){s("next",d)}function c(d){s("throw",d)}function h(d,p){d(p),a.shift(),a.length&&s(a[0][0],a[0][1])}}function Ts(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof bt=="function"?bt(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=t[a]&&function(o){return new Promise(function(u,s){o=t[a](o),i(u,s,o.done,o.value)})}}function i(a,o,u,s){Promise.resolve(s).then(function(l){a({value:l,done:u})},o)}}typeof SuppressedError=="function"&&SuppressedError;function T(t){return typeof t=="function"}function qe(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var je=qe(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
2
2
  `+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=n}});function me(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Gt=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,a;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var u=bt(o),s=u.next();!s.done;s=u.next()){var l=s.value;l.remove(this)}}catch(p){e={error:p}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(T(f))try{f()}catch(p){a=p instanceof We?p.errors:[p]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=bt(c),d=h.next();!d.done;d=h.next()){var m=d.value;try{Ar(m)}catch(p){a=a??[],p instanceof We?a=at(at([],it(a)),it(p.errors)):a.push(p)}}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(a)throw new We(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Ar(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&me(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&me(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),_r=Gt.EMPTY;function $r(t){return t instanceof Gt||t&&"closed"in t&&T(t.remove)&&T(t.add)&&T(t.unsubscribe)}function Ar(t){T(t)?t():t.unsubscribe()}var Dr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Sr={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,at([t,e],it(n)))},clearTimeout:function(t){var e=Sr.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Mr(t){Sr.setTimeout(function(){throw t})}function qe(){}function ge(t){t()}var je=function(t){Q(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,$r(n)&&n.add(r)):r.destination=Fs,r}return e.create=function(n,r,i){return new Vt(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Gt),Cs=Function.prototype.bind;function Ke(t,e){return Cs.call(t,e)}var Ps=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){ve(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){ve(r)}else ve(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){ve(n)}},t}(),Vt=function(t){Q(e,t);function e(n,r,i){var a=t.call(this)||this,o;if(T(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;a&&Dr.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&Ke(n.next,u),error:n.error&&Ke(n.error,u),complete:n.complete&&Ke(n.complete,u)}):o=n}return a.destination=new Ps(o),a}return e}(je);function ve(t){Mr(t)}function Es(t){throw t}var Fs={closed:!0,next:qe,error:Es,complete:qe},Je=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function _t(t){return t}function Ts(t){return t.length===0?_t:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var P=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,a=Ns(e)?e:new Vt(e,n,r);return ge(function(){var o=i,u=o.operator,s=o.source;a.add(u?u.call(a,s):s?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Cr(n),new n(function(i,a){var o=new Vt({next:function(u){try{e(u)}catch(s){a(s),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Je]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Ts(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Cr(e),new e(function(r,i){var a;n.subscribe(function(o){return a=o},function(o){return i(o)},function(){return r(a)})})},t.create=function(e){return new t(e)},t}();function Cr(t){var e;return(e=t??Dr.Promise)!==null&&e!==void 0?e:Promise}function Is(t){return t&&T(t.next)&&T(t.error)&&T(t.complete)}function Ns(t){return t&&t instanceof je||Is(t)&&$r(t)}function Os(t){return T(t==null?void 0:t.lift)}function I(t){return function(e){if(Os(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function N(t,e,n,r,i){return new ks(t,e,n,r,i)}var ks=function(t){Q(e,t);function e(n,r,i,a,o,u){var s=t.call(this,n)||this;return s.onFinalize=o,s.shouldUnsubscribe=u,s._next=r?function(l){try{r(l)}catch(f){n.error(f)}}:t.prototype._next,s._error=a?function(l){try{a(l)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,s._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,s}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(je),Rs=Be(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),E=function(t){Q(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Pr(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new Rs},e.prototype.next=function(n){var r=this;ge(function(){var i,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=bt(r.currentObservers),u=o.next();!u.done;u=o.next()){var s=u.value;s.next(n)}}catch(l){i={error:l}}finally{try{u&&!u.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;ge(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;ge(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,a=i.hasError,o=i.isStopped,u=i.observers;return a||o?_r:(this.currentObservers=null,u.push(n),new Gt(function(){r.currentObservers=null,me(u,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,a=r.thrownError,o=r.isStopped;i?n.error(a):o&&n.complete()},e.prototype.asObservable=function(){var n=new P;return n.source=this,n},e.create=function(n,r){return new Pr(n,r)},e}(P),Pr=function(t){Q(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:_r},e}(E),Ze={now:function(){return(Ze.delegate||Date).now()},delegate:void 0},Ls=function(t){Q(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Ze);var a=t.call(this)||this;return a._bufferSize=n,a._windowTime=r,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=r===1/0,a._bufferSize=Math.max(1,n),a._windowTime=Math.max(1,r),a}return e.prototype.next=function(n){var r=this,i=r.isStopped,a=r._buffer,o=r._infiniteTimeWindow,u=r._timestampProvider,s=r._windowTime;i||(a.push(n),!o&&a.push(u.now()+s)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,a=i._infiniteTimeWindow,o=i._buffer,u=o.slice(),s=0;s<u.length&&!n.closed;s+=a?1:2)n.next(u[s]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,a=n._buffer,o=n._infiniteTimeWindow,u=(o?1:2)*r;if(r<1/0&&u<a.length&&a.splice(0,a.length-u),!o){for(var s=i.now(),l=0,f=1;f<a.length&&a[f]<=s;f+=2)l=f;l&&a.splice(0,l+1)}},e}(E),Gs=function(t){Q(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Gt),Qe={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,at([t,e],it(n)))},clearInterval:function(t){var e=Qe.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},Vs=function(t){Q(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var a=this.id,o=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(o,a,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),Qe.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Qe.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,a;try{this.work(n)}catch(o){i=!0,a=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),a},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,me(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Gs),Er=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=Ze.now,t}(),zs=function(t){Q(e,t);function e(n,r){r===void 0&&(r=Er.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(Er),tn=new zs(Vs),Us=tn,en=new P(function(t){return t.complete()});function Fr(t){return t&&T(t.schedule)}function nn(t){return t[t.length-1]}function Hs(t){return T(nn(t))?t.pop():void 0}function $t(t){return Fr(nn(t))?t.pop():void 0}function Tr(t,e){return typeof nn(t)=="number"?t.pop():e}var Ir=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Nr(t){return T(t==null?void 0:t.then)}function Or(t){return T(t[Je])}function kr(t){return Symbol.asyncIterator&&T(t==null?void 0:t[Symbol.asyncIterator])}function Rr(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Xs(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Lr=Xs();function Gr(t){return T(t==null?void 0:t[Lr])}function Vr(t){return Ss(this,arguments,function(){var n,r,i,a;return xr(this,function(o){switch(o.label){case 0:n=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,xt(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,xt(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,xt(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function zr(t){return T(t==null?void 0:t.getReader)}function G(t){if(t instanceof P)return t;if(t!=null){if(Or(t))return Ys(t);if(Ir(t))return Bs(t);if(Nr(t))return Ws(t);if(kr(t))return Ur(t);if(Gr(t))return qs(t);if(zr(t))return js(t)}throw Rr(t)}function Ys(t){return new P(function(e){var n=t[Je]();if(T(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Bs(t){return new P(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Ws(t){return new P(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Mr)})}function qs(t){return new P(function(e){var n,r;try{for(var i=bt(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Ur(t){return new P(function(e){Ks(t,e).catch(function(n){return e.error(n)})})}function js(t){return Ur(Vr(t))}function Ks(t,e){var n,r,i,a;return Ds(this,void 0,void 0,function(){var o,u;return xr(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),n=Ms(t),s.label=1;case 1:return[4,n.next()];case 2:if(r=s.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=s.sent(),i={error:u},[3,11];case 6:return s.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function ot(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(a),!i)return a}function Hr(t,e){return e===void 0&&(e=0),I(function(n,r){n.subscribe(N(r,function(i){return ot(r,t,function(){return r.next(i)},e)},function(){return ot(r,t,function(){return r.complete()},e)},function(i){return ot(r,t,function(){return r.error(i)},e)}))})}function Xr(t,e){return e===void 0&&(e=0),I(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Js(t,e){return G(t).pipe(Xr(e),Hr(e))}function Zs(t,e){return G(t).pipe(Xr(e),Hr(e))}function Qs(t,e){return new P(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function tl(t,e){return new P(function(n){var r;return ot(n,e,function(){r=t[Lr](),ot(n,e,function(){var i,a,o;try{i=r.next(),a=i.value,o=i.done}catch(u){n.error(u);return}o?n.complete():n.next(a)},0,!0)}),function(){return T(r==null?void 0:r.return)&&r.return()}})}function Yr(t,e){if(!t)throw new Error("Iterable cannot be null");return new P(function(n){ot(n,e,function(){var r=t[Symbol.asyncIterator]();ot(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function el(t,e){return Yr(Vr(t),e)}function nl(t,e){if(t!=null){if(Or(t))return Js(t,e);if(Ir(t))return Qs(t,e);if(Nr(t))return Zs(t,e);if(kr(t))return Yr(t,e);if(Gr(t))return tl(t,e);if(zr(t))return el(t,e)}throw Rr(t)}function At(t,e){return e?nl(t,e):G(t)}function zt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t);return At(t,n)}var Br=Be(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function rl(t){return t instanceof Date&&!isNaN(t)}function F(t,e){return I(function(n,r){var i=0;n.subscribe(N(r,function(a){r.next(t.call(e,a,i++))}))})}var il=Array.isArray;function al(t,e){return il(e)?t.apply(void 0,at([],it(e))):t(e)}function ol(t){return F(function(e){return al(t,e)})}var ul=Array.isArray,sl=Object.getPrototypeOf,ll=Object.prototype,cl=Object.keys;function fl(t){if(t.length===1){var e=t[0];if(ul(e))return{args:e,keys:null};if(hl(e)){var n=cl(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function hl(t){return t&&typeof t=="object"&&sl(t)===ll}function dl(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function X(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=Hs(t),i=fl(t),a=i.args,o=i.keys;if(a.length===0)return At([],n);var u=new P(pl(a,n,o?function(s){return dl(o,s)}:_t));return r?u.pipe(ol(r)):u}function pl(t,e,n){return n===void 0&&(n=_t),function(r){Wr(e,function(){for(var i=t.length,a=new Array(i),o=i,u=i,s=function(f){Wr(e,function(){var c=At(t[f],e),h=!1;c.subscribe(N(r,function(d){a[f]=d,h||(h=!0,u--),u||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)s(l)},r)}}function Wr(t,e,n){t?ot(n,t,e):e()}function ml(t,e,n,r,i,a,o,u){var s=[],l=0,f=0,c=!1,h=function(){c&&!s.length&&!l&&e.complete()},d=function(p){return l<r?m(p):s.push(p)},m=function(p){l++;var g=!1;G(n(p,f++)).subscribe(N(e,function(_){e.next(_)},function(){g=!0},void 0,function(){if(g)try{l--;for(var _=function(){var A=s.shift();o||m(A)};s.length&&l<r;)_();h()}catch(A){e.error(A)}}))};return t.subscribe(N(e,d,function(){c=!0,h()})),function(){}}function qr(t,e,n){return n===void 0&&(n=1/0),T(e)?qr(function(r,i){return F(function(a,o){return e(r,a,i,o)})(G(t(r,i)))},n):(typeof e=="number"&&(n=e),I(function(r,i){return ml(r,i,t,n)}))}function rn(t){return t===void 0&&(t=1/0),qr(_t,t)}function gl(){return rn(1)}function jr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return gl()(At(t,$t(t)))}function vl(t){return new P(function(e){G(t()).subscribe(e)})}function yl(t,e,n){return vl(function(){return t()?e:n})}function wl(t,e,n){n===void 0&&(n=Us);var r=-1;return e!=null&&(Fr(e)?n=e:r=e),new P(function(i){var a=rl(t)?+t-n.now():t;a<0&&(a=0);var o=0;return n.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},a)})}function bl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=Tr(t,1/0),i=t;return i.length?i.length===1?G(i[0]):rn(r)(At(i,n)):en}var xl=Array.isArray;function _l(t){return t.length===1&&xl(t[0])?t[0]:t}function Kr(t,e){return I(function(n,r){var i=0;n.subscribe(N(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function Jr(t){return I(function(e,n){var r=null,i=!1,a;r=e.subscribe(N(n,void 0,void 0,function(o){a=G(t(o,Jr(t)(e))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function $l(t,e){return e===void 0&&(e=tn),I(function(n,r){var i=null,a=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var l=a;a=null,r.next(l)}};function s(){var l=o+t,f=e.now();if(f<l){i=this.schedule(void 0,l-f),r.add(i);return}u()}n.subscribe(N(r,function(l){a=l,o=e.now(),i||(i=e.schedule(s,t),r.add(i))},function(){u(),r.complete()},void 0,function(){a=i=null}))})}function Al(t){return I(function(e,n){var r=!1;e.subscribe(N(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function Dl(t){return t<=0?function(){return en}:I(function(e,n){var r=0;e.subscribe(N(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function ye(t,e){return e===void 0&&(e=_t),t=t??Sl,I(function(n,r){var i,a=!0;n.subscribe(N(r,function(o){var u=e(o);(a||!t(i,u))&&(a=!1,i=u,r.next(o))}))})}function Sl(t,e){return t===e}function Ml(t){return t===void 0&&(t=Cl),I(function(e,n){var r=!1;e.subscribe(N(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function Cl(){return new Br}function Pl(t,e){var n=arguments.length>=2;return function(r){return r.pipe(_t,Dl(1),n?Al(e):Ml(function(){return new Br}))}}function El(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=Tr(t,1/0);return t=_l(t),I(function(i,a){rn(r)(At(at([i],it(t)),n)).subscribe(a)})}function Fl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return El.apply(void 0,at([],it(t)))}function an(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new E}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,u=t.resetOnRefCountZero,s=u===void 0?!0:u;return function(l){var f,c,h,d=0,m=!1,p=!1,g=function(){c==null||c.unsubscribe(),c=void 0},_=function(){g(),f=h=void 0,m=p=!1},A=function(){var v=f;_(),v==null||v.unsubscribe()};return I(function(v,x){d++,!p&&!m&&g();var y=h=h??n();x.add(function(){d--,d===0&&!p&&!m&&(c=on(A,s))}),y.subscribe(x),!f&&d>0&&(f=new Vt({next:function(M){return y.next(M)},error:function(M){p=!0,g(),c=on(_,i,M),y.error(M)},complete:function(){m=!0,g(),c=on(_,o),y.complete()}}),G(v).subscribe(f))})(l)}}function on(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Vt({next:function(){i.unsubscribe(),t()}});return G(e.apply(void 0,at([],it(n)))).subscribe(i)}}function D(t,e,n){var r,i=!1;return r=t,an({connector:function(){return new Ls(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function we(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t);return I(function(r,i){(n?jr(t,r,n):jr(t,r)).subscribe(i)})}function Y(t,e){return I(function(n,r){var i=null,a=0,o=!1,u=function(){return o&&!i&&r.complete()};n.subscribe(N(r,function(s){i==null||i.unsubscribe();var l=0,f=a++;G(t(s,f)).subscribe(i=N(r,function(c){return r.next(e?e(s,c,f,l++):c)},function(){i=null,u()}))},function(){o=!0,u()}))})}function O(t){return I(function(e,n){G(t).subscribe(N(n,function(){return n.complete()},qe)),!n.closed&&e.subscribe(n)})}function Tl(t,e){return I(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,u=i.trailing,s=u===void 0?!1:u,l=!1,f=null,c=null,h=!1,d=function(){c==null||c.unsubscribe(),c=null,s&&(g(),h&&r.complete())},m=function(){c=null,h&&r.complete()},p=function(_){return c=G(t(_)).subscribe(N(r,d,m))},g=function(){if(l){l=!1;var _=f;f=null,r.next(_),!h&&p(_)}};n.subscribe(N(r,function(_){l=!0,f=_,!(c&&!c.closed)&&(o?g():p(_))},function(){h=!0,!(s&&l&&c&&!c.closed)&&r.complete()}))})}function Il(t,e,n){e===void 0&&(e=tn);var r=wl(t,e);return Tl(function(){return r},n)}const be=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new E,i=e.pipe(O(r),F(s=>({id:null,seriesLabel:null,groupLabel:null,highlightDefault:s.highlightDefault})),ye()),a=n.pipe(O(r),Kr(s=>s.eventName==="mouseover"||s.eventName==="mousemove"),F(s=>s.datum?{id:s.datum.id,seriesLabel:s.datum.seriesLabel,groupLabel:s.datum.groupLabel,highlightDefault:null}:{id:null,seriesLabel:null,groupLabel:null,highlightDefault:null})),o=n.pipe(O(r),Kr(s=>s.eventName==="mouseout"),Y(s=>i)),u=({data:s,id:l,seriesLabel:f,groupLabel:c,highlightDefault:h,target:d})=>{let m=[];if(h!=null&&h!=""){if(d==="datum")l=h;else if(d==="series"){const p=s.flat().find(g=>g.id===h||g.seriesLabel===h);f=p&&p.seriesLabel?p.seriesLabel:null}else if(d==="group"){const p=s.flat().find(g=>g.id===h||g.groupLabel===h);c=p&&p.groupLabel?p.groupLabel:null}}if(d==="datum"&&l!=null&&l!="")m.push(l);else if(d==="series"&&f!=null&&f!=""){const p=s.flat().filter(g=>g.seriesLabel===f).map(g=>g.id);m=m.concat(p)}else if(d==="group"&&c!=null&&c!=""){const p=s.flat().filter(g=>g.groupLabel===c).map(g=>g.id);m=m.concat(p)}return m};return new P(s=>(X({target:bl(a,o,i),datumList:t,fullChartParams:e}).pipe(O(r)).subscribe(l=>{const f=u({data:l.datumList,id:l.target.id,seriesLabel:l.target.seriesLabel,groupLabel:l.target.groupLabel,highlightDefault:l.target.highlightDefault,target:l.fullChartParams.highlightTarget});s.next(f)}),function(){r.next(void 0)}))},xe=({datumList$:t})=>t.pipe(F(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),un=({datumList$:t})=>t.pipe(F(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),Nl=({subject:t,observer:e})=>{const n=be({datumList$:e.computedData$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(D(1)),r=xe({datumList$:e.computedData$}).pipe(D(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,seriesHighlight$:n,SeriesDataMap$:r}},ft=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=j.scaleDomain,scaleRange:i=j.scaleRange})=>{const a=r[0]??j.scaleDomain[0],o=r[1]??j.scaleDomain[1],u=i[0]??j.scaleRange[0],s=i[1]??j.scaleRange[1],l=a==="auto"?e:a,f=o==="auto"?t:o;let c=n*u,h=n*s;return mr().domain([l,f]).range([c,h])},Ol=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return us().domain(t).range(r).padding(n)},kl=({axisLabels:t,axisWidth:e,padding:n=.5,reverse:r=!1})=>{let a=t.map((o,u)=>u);return r&&a.reverse(),gr().domain([-0,e+0]).range(a)},Rl={series:!1,grid:!0,multiGrid:!0,multiValue:!0,tree:!1,relationship:!1};function Ll(t){return new P(e=>{const n=new ResizeObserver(r=>{const i=r[0];i&&i.contentRect&&e.next(i.contentRect)});return n.observe(t),function(){n.unobserve(t)}})}const Gl=({defaultDataFormatter:t,computedDataFn:e,contextObserverFn:n})=>{const r=new E,i=t.type;return function(o,u){qt(o).selectAll("svg").remove();const s=qt(o).append("svg");s.attr("xmlns:xlink","http://www.w3.org/1999/xlink").attr("xmls","http://www.w3.org/2000/svg").attr("version","1.1").style("position","absolute").classed("orbcharts__root",!0);const l=s.append("g");l.classed("orbcharts__layout",!0);const f=l.append("g");f.classed("orbcharts__plugins",!0);const c={data$:new E,dataFormatter$:new E,plugins$:new E,chartParams$:new E,event$:new E},h=(w=>{const S=w||Ct,C=S.preset?S.preset:{};return{chartParams:C.chartParams?Z(C.chartParams,ln):ln,dataFormatter:C.dataFormatter?Z(C.dataFormatter,t):t,allPluginParams:C.allPluginParams?C.allPluginParams:{},description:C.description??""}})(u),d=c.data$.pipe(D(1)),m=c.dataFormatter$.pipe(O(r),we({}),F(w=>{const S=Z(w,h.dataFormatter);return i==="multiGrid"&&w.gridList!=null&&(S.gridList=w.gridList.map(C=>Z(C,h.dataFormatter.gridList[0]))),S}),D(1)),p=c.chartParams$.pipe(O(r),we({}),F(w=>Z(w,h.chartParams)),D(1)),g=p.pipe(O(r),we({}),F(w=>Z(w.padding??{},sn)));g.pipe(O(r),Pl()).subscribe(w=>{l.attr("transform",`translate(${w.left}, ${w.top})`)}),g.subscribe(w=>{l.transition().attr("transform",`translate(${w.left}, ${w.top})`)});const _=Ll(o).pipe(O(r),an()),A=zt().pipe(Fl(_.pipe($l(250)),_.pipe(Il(250))),ye((w,S)=>JSON.stringify(w)===JSON.stringify(S)),an()),v=A.subscribe(),x=X({rootSize:A,mergedPadding:g}).pipe(O(r),Y(async w=>{const S=w.rootSize.width>0?w.rootSize.width:si,C=w.rootSize.height>0?w.rootSize.height:li;return{width:S-w.mergedPadding.left-w.mergedPadding.right,height:C-w.mergedPadding.top-w.mergedPadding.bottom,top:w.mergedPadding.top,right:w.mergedPadding.right,bottom:w.mergedPadding.bottom,left:w.mergedPadding.left,rootWidth:S,rootHeight:C}}),D(1));x.subscribe(w=>{s.attr("width",w.rootWidth).attr("height",w.rootHeight)});const y=X({data:d,dataFormatter:m,chartParams:p,layout:yl(()=>Rl[i]===!0,x,zt(void 0))}).pipe(O(r),Y(async w=>w),Y(w=>zt(w).pipe(F(S=>{try{return e({data:S.data,dataFormatter:S.dataFormatter,chartParams:S.chartParams,layout:S.layout})}catch(C){throw console.error(C),new Error(C)}}),Jr(()=>en))),D(1));y.subscribe();const M={};return c.plugins$.subscribe(w=>{if(!w)return;const S=f.selectAll("g.orbcharts__plugin").data(w,b=>b.name),C=S.enter().append("g").attr("class",b=>`orbcharts__plugin orbcharts__${b.name}`);S.exit().remove().each((b,V,k)=>{M[b.name]&&M[b.name].destroy()}),C.each((b,V,k)=>{const et={fullParams$:new P,fullChartParams$:p,fullDataFormatter$:m,computedData$:y,layout$:x},St=n({observer:et,subject:c}),nt={selection:qt(k[V]),rootSelection:s,name:b.name,chartType:i,subject:c,observer:St};b.setPresetParams(h.allPluginParams[b.name]??{}),b.setContext(nt),M[nt.name]=b,b.init()})}),{...c,selection:s,destroy(){qt(o).selectAll("svg").remove(),r.next(void 0),v.unsubscribe()}}}};class Dt{constructor({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r},i,a){this.data$=new E,this.dataFormatter$=new E,this.plugins$=new E,this.chartParams$=new E,this.event$=new E;const u=Gl({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r})(i,a);this.selection=u.selection,this.destroy=u.destroy,this.data$=u.data$,this.dataFormatter$=u.dataFormatter$,this.plugins$=u.plugins$,this.chartParams$=u.chartParams$,this.event$=u.event$}}class Vl extends Dt{constructor(e,n){super({defaultDataFormatter:fi,computedDataFn:As,contextObserverFn:Nl},e,n)}}const zl=t=>Zr(t,"grid",0),Zr=(t,e,n=0)=>{const{data:r=[],dataFormatter:i,chartParams:a,layout:o}=t;if(!r.length)return[];let u;try{const s=r.reduce((A,v)=>v.length>A?v.length:A,0),f=r.map((A,v)=>{if(A.length===s)return A;const x=Object.assign([],A);for(let y=x.length;y<s;y++)x[y]=null;return x}).map((A,v)=>A.map((x,y)=>{const M=i.grid.visibleFilter(x,v,y,t);return x==null?{id:"",label:"",data:{},value:null,_visible:M}:typeof x=="number"?{id:"",label:"",data:{},value:x,_visible:M}:{id:x.id??"",label:x.label??"",data:x.data??{},value:x.value,_visible:M}})),c=br(i.grid.gridData.seriesDirection,f),{groupScale:h}=(()=>{const A=i.grid.groupAxis.position==="top"||i.grid.groupAxis.position==="bottom"?o.width:o.height,v=c[0]?c[0].length-1:0;return{groupScale:ft({maxValue:v,minValue:0,axisWidth:A,scaleDomain:[0,v],scaleRange:[0,1]})}})(),d=yr({transposedDataGrid:c,dataFormatter:i,chartType:e,gridIndex:n}),m=wr({transposedDataGrid:c,dataFormatter:i,chartType:e,gridIndex:n}),p=(()=>{const A=i.grid.valueAxis.position==="left"||i.grid.valueAxis.position==="right"?o.height:o.width,v=c.flat().filter(M=>M._visible!=!1),[x,y]=de(v);return c.map((M,w)=>ft({maxValue:y,minValue:x,axisWidth:A,scaleDomain:[x,y],scaleRange:[0,1]}))})(),g=c.map((A,v)=>p[v](0));let _=0;u=c.map((A,v)=>A.map((x,y)=>{const M=he(e,n,v,y),w=m[y],S=p[v],C=S(x.value??0),tt=g[v],b={id:x.id?x.id:M,index:_,label:x.label?x.label:M,description:x.description??"",data:x.data,value:x.value,gridIndex:n,accSeriesIndex:v,seriesIndex:v,seriesLabel:d[v],groupIndex:y,groupLabel:w,color:pe(v,a),axisX:h(y),axisY:C,axisYFromZero:C-tt,visible:x._visible};return _++,b}))}catch(s){throw Error(s)}return u},Qr=({fullDataFormatter$:t,layout$:e})=>{const n=new E;function r({xAxis:i,yAxis:a,width:o,height:u}){if(!i||!a)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let s=0,l=0,f=0,c=0,h=0;return i.position==="bottom"?a.position==="left"?(c=180,l=u):a.position==="right"?(c=180,h=180,s=o,l=u):(c=180,l=u):i.position==="top"?a.position==="left"||(a.position==="right"?(h=180,s=o):(c=180,l=u)):i.position==="left"?a.position==="bottom"?(f=-90,l=u):a.position==="top"?(f=-90,h=180):(c=180,l=u):i.position==="right"&&(a.position==="bottom"?(f=-90,c=180,l=u,s=o):a.position==="top"?(f=-90,c=180,h=180,s=o):(c=180,l=u)),{translate:[s,l],scale:[1,1],rotate:f,rotateX:c,rotateY:h,value:`translate(${s}px, ${l}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new P(i=>(X({fullDataFormatter:t,layout:e}).pipe(O(n),Y(async a=>a)).subscribe(a=>{const o=r({xAxis:a.fullDataFormatter.grid.groupAxis,yAxis:a.fullDataFormatter.grid.valueAxis,width:a.layout.width,height:a.layout.height});i.next(o)}),function(){n.next(void 0)}))},ti=({gridAxesTransform$:t})=>t.pipe(F(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,a=e.rotateX*-1,o=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:a,rotateY:o,value:`translate(${n[0]}px, ${n[1]}px) rotate(${i}deg) rotateX(${a}deg) rotateY(${o}deg)`}})),ei=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new E;function i({data:a,groupAxis:o,valueAxis:u,width:s,height:l}){let f=0,c=0,h=0,d=0;const m=o.position==="top"||o.position==="bottom"?s:l,p=0,g=a[0]?a[0].length-1:0,_=o.scaleDomain[0]==="auto"?p-o.scalePadding:o.scaleDomain[0]-o.scalePadding,A=o.scaleDomain[1]==="auto"?g+o.scalePadding:o.scaleDomain[1]+o.scalePadding,v=ft({maxValue:g,minValue:p,axisWidth:m,scaleDomain:[_,A],scaleRange:[0,1]}),x=v(p),y=v(g);f=x,h=(y-x)/m;const w=a.map((St,Mt)=>St.filter((nt,dt)=>dt>=_&&dt<=A&&nt.visible==!0)),S=Xe(w),C=u.position==="left"||u.position==="right"?l:s,tt=ft({maxValue:S[1],minValue:S[0],axisWidth:C,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),b=Xe(a),V=tt(b[0]),k=tt(b[1]);return c=V,d=(k-V)/C,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new P(a=>(X({computedData:t,fullDataFormatter:e,layout:n}).pipe(O(r),Y(async o=>o)).subscribe(o=>{const u=i({data:o.computedData,groupAxis:o.fullDataFormatter.grid.groupAxis,valueAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});a.next(u)}),function(){r.next(void 0)}))},ni=({gridContainer$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>X({gridContainer:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(Y(async r=>r),F(r=>r.gridAxesTransform.rotate==0||r.gridAxesTransform.rotate==180?r.gridContainer.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainer[a].scale[0],1/r.gridGraphicTransform.scale[1]/r.gridContainer[a].scale[1]]):r.gridContainer.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainer[a].scale[1],1/r.gridGraphicTransform.scale[1]/r.gridContainer[a].scale[0]]))),ri=({fullDataFormatter$:t,layout$:e})=>{const n=new E;function r({xAxisPosition:i,yAxisPosition:a,width:o,height:u}){if((i==="bottom"||i==="top")&&(a==="left"||a==="right"))return{width:o,height:u};if((i==="left"||i==="right")&&(a==="bottom"||a==="top"))return{width:u,height:o}}return new P(i=>{X({fullDataFormatter:t,layout:e}).pipe(O(n),Y(async a=>a)).subscribe(a=>{const o=r({xAxisPosition:a.fullDataFormatter.grid.groupAxis.position,yAxisPosition:a.fullDataFormatter.grid.valueAxis.position,width:a.layout.width,height:a.layout.height});return i.next(o),function(){n.next(void 0)}})})},ii=({computedData$:t})=>t.pipe(F(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),ye((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),ai=({computedData$:t})=>t.pipe(F(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),oi=({computedData$:t,fullDataFormatter$:e})=>X({computedData:t,fullDataFormatter:e}).pipe(F(n=>!!(n.fullDataFormatter.grid.seriesSlotIndexes&&n.fullDataFormatter.grid.seriesSlotIndexes.length===n.computedData.length)),ye()),ui=({computedData$:t,fullDataFormatter$:e,fullChartParams$:n,layout$:r})=>X({computedData:t,fullDataFormatter:e,fullChartParams:n,layout:r}).pipe(Y(async a=>a),F(a=>{const o=a.fullDataFormatter.grid;if(!!(o.seriesSlotIndexes&&o.seriesSlotIndexes.length===a.computedData.length))return a.computedData.map((s,l)=>{const f=o.seriesSlotIndexes[l]%a.fullDataFormatter.container.columnAmount,c=Math.floor(o.seriesSlotIndexes[l]/a.fullDataFormatter.container.columnAmount),{translate:h,scale:d}=Lt(a.layout,a.fullDataFormatter.container,c,f);return{slotIndex:o.seriesSlotIndexes[l],rowIndex:c,columnIndex:f,translate:h,scale:d}});{const s=o.slotIndex%a.fullDataFormatter.container.columnAmount,l=Math.floor(o.slotIndex/a.fullDataFormatter.container.columnAmount);return a.computedData.map((f,c)=>{const{translate:h,scale:d}=Lt(a.layout,a.fullDataFormatter.container,l,s);return{slotIndex:o.slotIndex,rowIndex:l,columnIndex:s,translate:h,scale:d}})}})),Ul=({subject:t,observer:e})=>{const n=oi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(D(1)),r=ui({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,fullChartParams$:e.fullChartParams$,layout$:e.layout$}),i=Qr({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(D(1)),a=ti({gridAxesTransform$:i}).pipe(D(1)),o=ei({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(D(1)),u=ni({gridContainer$:r,gridAxesTransform$:i,gridGraphicTransform$:o}),s=ri({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(D(1)),l=e.computedData$.pipe(F(p=>p.flat())).pipe(D(1)),f=be({datumList$:l,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(D(1)),c=ii({computedData$:e.computedData$}),h=xe({datumList$:l}).pipe(D(1)),d=un({datumList$:l}).pipe(D(1)),m=ai({computedData$:e.computedData$}).pipe(D(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,isSeriesPositionSeprate$:n,gridContainer$:r,gridAxesTransform$:i,gridAxesReverseTransform$:a,gridGraphicTransform$:o,gridGraphicReverseScale$:u,gridAxesSize$:s,gridHighlight$:f,existedSeriesLabels$:c,SeriesDataMap$:h,GroupDataMap$:d,visibleComputedData$:m}};class Hl extends Dt{constructor(e,n){super({defaultDataFormatter:hi,computedDataFn:zl,contextObserverFn:Ul},e,n)}}const Xl=({data:t=[],dataFormatter:e,chartParams:n,layout:r})=>{if(!t.length)return[];let i=[];try{const a=e.gridList[0]||Ut;i=t.map((u,s)=>{const l=e.gridList[s]||a;return Zr({data:u,dataFormatter:{type:"grid",grid:{...l},container:{...e.container}},chartParams:n,layout:r},"multiGrid",s)});let o=-1;i=i.map((u,s)=>u.map((l,f)=>(o++,l.map(c=>(c.accSeriesIndex=o,c.color=pe(o,n),c)))))}catch(a){throw Error(a)}return i},Yl=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{function a({gridDataFormatter$:u,gridComputedData$:s,layout$:l,fullChartParams$:f,event$:c}){const h=oi({computedData$:s,fullDataFormatter$:u}).pipe(D(1)),d=ui({computedData$:s,fullDataFormatter$:u,fullChartParams$:f,layout$:l}).pipe(D(1)),m=Qr({fullDataFormatter$:u,layout$:l}).pipe(D(1)),p=ti({gridAxesTransform$:m}).pipe(D(1)),g=ei({computedData$:s,fullDataFormatter$:u,layout$:l}).pipe(D(1)),_=ni({gridContainer$:d,gridAxesTransform$:m,gridGraphicTransform$:g}),A=ri({fullDataFormatter$:u,layout$:l}).pipe(D(1)),v=s.pipe(F(C=>C.flat())).pipe(D(1)),x=be({datumList$:v,fullChartParams$:f,event$:c}).pipe(D(1)),y=ii({computedData$:s}),M=xe({datumList$:v}).pipe(D(1)),w=un({datumList$:v}).pipe(D(1)),S=ai({computedData$:s}).pipe(D(1));return{isSeriesPositionSeprate$:h,gridContainer$:d,gridAxesTransform$:m,gridAxesReverseTransform$:p,gridGraphicTransform$:g,gridGraphicReverseScale$:_,gridAxesSize$:A,gridHighlight$:x,existedSeriesLabels$:y,SeriesDataMap$:M,GroupDataMap$:w,visibleComputedData$:S}}const o=new E;return X({fullDataFormatter:t,computedData:e}).pipe(Y(async u=>u),F(u=>{o.next(void 0);const s=u.fullDataFormatter.gridList[0]??Ut;return u.computedData.map((l,f)=>{const h={type:"grid",grid:{...u.fullDataFormatter.gridList[f]??s},container:{...u.fullDataFormatter.container}},d=zt(h).pipe(O(o),D(1)),m=zt(l).pipe(O(o),D(1));return a({gridDataFormatter$:d,gridComputedData$:m,layout$:n,fullChartParams$:r,event$:i})})}))},Bl=({computedData$:t,fullDataFormatter$:e,fullChartParams$:n,layout$:r})=>X({computedData:t,fullDataFormatter:e,fullChartParams:n,layout:r}).pipe(Y(async a=>a),F(a=>{const o=a.fullDataFormatter.gridList[0]??Ut;return a.computedData.map((s,l)=>{const f=a.fullDataFormatter.gridList[l]??o;if(!!(f.seriesSlotIndexes&&f.seriesSlotIndexes.length===s.length))return s.map((h,d)=>{const m=f.seriesSlotIndexes[d]%a.fullDataFormatter.container.columnAmount,p=Math.floor(f.seriesSlotIndexes[d]/a.fullDataFormatter.container.columnAmount),{translate:g,scale:_}=Lt(a.layout,a.fullDataFormatter.container,p,m);return{slotIndex:f.seriesSlotIndexes[d],rowIndex:p,columnIndex:m,translate:g,scale:_}});{const h=f.slotIndex%a.fullDataFormatter.container.columnAmount,d=Math.floor(f.slotIndex/a.fullDataFormatter.container.columnAmount);return s.map((m,p)=>{const{translate:g,scale:_}=Lt(a.layout,a.fullDataFormatter.container,d,h);return{slotIndex:f.slotIndex,rowIndex:d,columnIndex:h,translate:g,scale:_}})}})})),Wl=({subject:t,observer:e})=>{const n=Yl({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(D(1)),r=Bl({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,fullChartParams$:e.fullChartParams$,layout$:e.layout$});return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,multiGridEachDetail$:n,multiGridContainer$:r}};class ql extends Dt{constructor(e,n){super({defaultDataFormatter:di,computedDataFn:Xl,contextObserverFn:Wl},e,n)}}const jl=t=>{const{data:e,dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let a=[];try{const o=e.map((v,x)=>v.map((y,M)=>typeof y=="number"?{id:"",label:"",description:"",data:{},value:y}:{id:y.id??"",label:y.label??"",description:y.description??"",data:y.data??{},value:y.value})),[u,s]=de(o.map(v=>v[0])),[l,f]=de(o.map(v=>v[1])),c=n.xAxis.position==="top"||n.xAxis.position==="bottom"?i.width:i.height,h=n.yAxis.position==="left"||n.yAxis.position==="right"?i.height:i.width,d=ft({maxValue:s,minValue:u,axisWidth:c,scaleDomain:[u,s],scaleRange:[0,1]}),m=ft({maxValue:f,minValue:l,axisWidth:h,scaleDomain:[l,f],scaleRange:[0,1]}),p=[n.xAxis.scaleDomain[0]==="auto"?u:n.xAxis.scaleDomain[0],n.xAxis.scaleDomain[1]==="auto"?s:n.xAxis.scaleDomain[1]],g=[n.yAxis.scaleDomain[0]==="auto"?l:n.yAxis.scaleDomain[0],n.yAxis.scaleDomain[1]==="auto"?f:n.yAxis.scaleDomain[1]],_=(v,x,y,M)=>y===0&&v.value!=null&&(v.value<p[0]||v.value>p[1])||y===1&&v.value!=null&&(v.value<g[0]||v.value>g[1])?!1:n.visibleFilter(v,x,y,M);let A=0;a=o.map((v,x)=>v.map((y,M)=>{const w=A;A++;const S=he(n.type,x,M),C=_(y,x,M,t);return{id:y.id?y.id:S,index:w,label:y.label?y.label:S,description:y.description??"",data:y.data,value:y.value,axis:M==0?d(y.value):m(y.value),visible:C}}))}catch(o){throw Error(o)}return a},Kl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Jl extends Dt{constructor(e,n){super({defaultDataFormatter:pi,computedDataFn:jl,contextObserverFn:Kl},e,n)}}const Zl=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;let i=[],a=[];try{let o=[],u=[];if(e.nodes)o=e.nodes,u=e.edges;else if(e[0])o=e[0],u=e[1];else return{nodes:[],edges:[]};i=o.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,startNodes:[],startNodeIds:[],endNodes:[],endNodeIds:[],visible:n.visibleFilter(c,0,h,t)}));const s=new Map(i.map(c=>[c.id,c]));a=u.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,startNode:s.get(c.start),startNodeId:c.start,endNode:s.get(c.end),endNodeId:c.end,visible:n.visibleFilter(c,1,h,t)}));const l=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.endNodeId)??[];d.push(h.startNode),c.set(h.endNodeId,d)}),c}(),f=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.startNodeId)??[];d.push(h.endNode),c.set(h.startNodeId,d)}),c}();Array.from(s).forEach(([c,h])=>{h.startNodes=l.get(c),h.startNodeIds=h.startNodes.map(d=>d.id),h.endNodes=f.get(c),h.endNodeIds=h.endNodes.map(d=>d.id)})}catch(o){throw Error(o)}return{nodes:i,edges:a}},Ql=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class tc extends Dt{constructor(e,n){super({defaultDataFormatter:gi,computedDataFn:Zl,contextObserverFn:Ql},e,n)}}const ec=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;let i={id:"",index:0,label:"",description:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const a=function(){if(q(e)===!0)return structuredClone(e);if(Array.isArray(e)===!1)return{id:""};let s;const l=new Map;e.forEach(c=>{if(!c.parent)s=c;else{const h=l.get(c.parent)??[];h.push(c),l.set(c.parent,h)}});const f=c=>({id:c.id,label:c.label,data:c.data,value:c.value,children:(l.get(c.id)??[]).map(h=>f(h))});return s?f(s):{id:""}}();let o=0;const u=(s,l,f)=>{const c=l+1,h=n.visibleFilter(s,l,f,t),d=o;return o++,{id:s.id,index:d,level:l,seq:f,label:s.label??"",description:s.description??"",data:s.data??{},value:s.value,visible:h,children:(s.children??[]).map((m,p)=>u(m,c,p))}};i=u(a,0,0)}catch(a){throw Error(a)}return i},nc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class rc extends Dt{constructor(e,n){super({defaultDataFormatter:mi,computedDataFn:ec,contextObserverFn:nc},e,n)}}function ic({name:t,defaultParams:e,initFn:n}){const r=new E,i=new E,a=new WeakMap;let o=()=>{},u,s=e;return{params$:i,name:t,defaultParams:e,init(){u&&(o=n(u)??(()=>{}),a.set(u.selection,u))},destroy(){o(),u&&(u.selection.remove(),u=void 0),r.next(void 0)},setPresetParams:l=>{s=Z(l,e)},setContext:l=>{u=l,u.observer.fullParams$=i.pipe(O(r),we({}),F(f=>Z(f,s)),D(1))}}}const ht=()=>function(e,n){return function(i){return class{constructor(){const o=ic({name:e,defaultParams:n,initFn:i});this.params$=o.params$,this.name=o.name,this.defaultParams=o.defaultParams,this.init=o.init,this.destroy=o.destroy,this.setPresetParams=o.setPresetParams,this.setContext=o.setContext}}}},ac=ht(),oc=ht(),uc=ht(),sc=ht(),lc=ht(),cc=ht(),fc=ht();$.GridChart=Hl,$.MultiGridChart=ql,$.MultiValueChart=Jl,$.RelationshipChart=tc,$.SeriesChart=Vl,$.TreeChart=rc,$.calcGridContainerPosition=Lt,$.createAxisLinearScale=ft,$.createAxisPointScale=Ol,$.createAxisQuantizeScale=kl,$.createDefaultDatumId=he,$.createDefaultGroupLabel=vr,$.createDefaultSeriesLabel=He,$.createGridGroupLabels=wr,$.createGridSeriesLabels=yr,$.defineGridPlugin=oc,$.defineMultiGridPlugin=uc,$.defineMultiValuePlugin=sc,$.defineNoneDataPlugin=lc,$.defineRelationshipPlugin=cc,$.defineSeriesPlugin=ac,$.defineTreePlugin=fc,$.formatCommaNumber=ys,$.formatValueToLabel=ws,$.getMinAndMax=wt,$.getMinAndMaxGrid=Xe,$.getMinAndMaxMultiGrid=xs,$.getMinAndMaxMultiValue=_s,$.getMinAndMaxSeries=bs,$.getMinAndMaxValue=de,$.groupDataMapObservable=un,$.highlightObservable=be,$.isFunction=vs,$.isObject=q,$.mergeOptionsWithDefault=Z,$.seriesColorPredicate=pe,$.seriesDataMapObservable=xe,$.transposeData=br,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
3
+ `):"",this.name="UnsubscriptionError",this.errors=n}});function ge(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Vt=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,a;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var u=bt(o),s=u.next();!s.done;s=u.next()){var l=s.value;l.remove(this)}}catch(m){e={error:m}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(T(f))try{f()}catch(m){a=m instanceof je?m.errors:[m]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=bt(c),d=h.next();!d.done;d=h.next()){var p=d.value;try{Sr(p)}catch(m){a=a??[],m instanceof je?a=it(it([],rt(a)),rt(m.errors)):a.push(m)}}}catch(m){r={error:m}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(a)throw new je(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Sr(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&ge(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&ge(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Dr=Vt.EMPTY;function Ar(t){return t instanceof Vt||t&&"closed"in t&&T(t.remove)&&T(t.add)&&T(t.unsubscribe)}function Sr(t){T(t)?t():t.unsubscribe()}var Mr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Cr={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,it([t,e],rt(n)))},clearTimeout:function(t){var e=Cr.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Pr(t){Cr.setTimeout(function(){throw t})}function Ke(){}function ve(t){t()}var Ze=function(t){J(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Ar(n)&&n.add(r)):r.destination=ks,r}return e.create=function(n,r,i){return new zt(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Vt),Is=Function.prototype.bind;function Je(t,e){return Is.call(t,e)}var Ns=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){ye(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){ye(r)}else ye(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){ye(n)}},t}(),zt=function(t){J(e,t);function e(n,r,i){var a=t.call(this)||this,o;if(T(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;a&&Mr.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&Je(n.next,u),error:n.error&&Je(n.error,u),complete:n.complete&&Je(n.complete,u)}):o=n}return a.destination=new Ns(o),a}return e}(Ze);function ye(t){Pr(t)}function Os(t){throw t}var ks={closed:!0,next:Ke,error:Os,complete:Ke},Qe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function _t(t){return t}function Ls(t){return t.length===0?_t:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var P=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,a=Gs(e)?e:new zt(e,n,r);return ve(function(){var o=i,u=o.operator,s=o.source;a.add(u?u.call(a,s):s?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Er(n),new n(function(i,a){var o=new zt({next:function(u){try{e(u)}catch(s){a(s),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Qe]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Ls(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Er(e),new e(function(r,i){var a;n.subscribe(function(o){return a=o},function(o){return i(o)},function(){return r(a)})})},t.create=function(e){return new t(e)},t}();function Er(t){var e;return(e=t??Mr.Promise)!==null&&e!==void 0?e:Promise}function Rs(t){return t&&T(t.next)&&T(t.error)&&T(t.complete)}function Gs(t){return t&&t instanceof Ze||Rs(t)&&Ar(t)}function Vs(t){return T(t==null?void 0:t.lift)}function I(t){return function(e){if(Vs(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function N(t,e,n,r,i){return new zs(t,e,n,r,i)}var zs=function(t){J(e,t);function e(n,r,i,a,o,u){var s=t.call(this,n)||this;return s.onFinalize=o,s.shouldUnsubscribe=u,s._next=r?function(l){try{r(l)}catch(f){n.error(f)}}:t.prototype._next,s._error=a?function(l){try{a(l)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,s._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,s}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Ze),Us=qe(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),E=function(t){J(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Fr(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new Us},e.prototype.next=function(n){var r=this;ve(function(){var i,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=bt(r.currentObservers),u=o.next();!u.done;u=o.next()){var s=u.value;s.next(n)}}catch(l){i={error:l}}finally{try{u&&!u.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;ve(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;ve(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,a=i.hasError,o=i.isStopped,u=i.observers;return a||o?Dr:(this.currentObservers=null,u.push(n),new Vt(function(){r.currentObservers=null,ge(u,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,a=r.thrownError,o=r.isStopped;i?n.error(a):o&&n.complete()},e.prototype.asObservable=function(){var n=new P;return n.source=this,n},e.create=function(n,r){return new Fr(n,r)},e}(P),Fr=function(t){J(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:Dr},e}(E),tn={now:function(){return(tn.delegate||Date).now()},delegate:void 0},Hs=function(t){J(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=tn);var a=t.call(this)||this;return a._bufferSize=n,a._windowTime=r,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=r===1/0,a._bufferSize=Math.max(1,n),a._windowTime=Math.max(1,r),a}return e.prototype.next=function(n){var r=this,i=r.isStopped,a=r._buffer,o=r._infiniteTimeWindow,u=r._timestampProvider,s=r._windowTime;i||(a.push(n),!o&&a.push(u.now()+s)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,a=i._infiniteTimeWindow,o=i._buffer,u=o.slice(),s=0;s<u.length&&!n.closed;s+=a?1:2)n.next(u[s]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,a=n._buffer,o=n._infiniteTimeWindow,u=(o?1:2)*r;if(r<1/0&&u<a.length&&a.splice(0,a.length-u),!o){for(var s=i.now(),l=0,f=1;f<a.length&&a[f]<=s;f+=2)l=f;l&&a.splice(0,l+1)}},e}(E),Ys=function(t){J(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Vt),en={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,it([t,e],rt(n)))},clearInterval:function(t){var e=en.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},Xs=function(t){J(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var a=this.id,o=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(o,a,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),en.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&en.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,a;try{this.work(n)}catch(o){i=!0,a=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),a},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ge(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Ys),Tr=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=tn.now,t}(),Ws=function(t){J(e,t);function e(n,r){r===void 0&&(r=Tr.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(Tr),nn=new Ws(Xs),Bs=nn,rn=new P(function(t){return t.complete()});function Ir(t){return t&&T(t.schedule)}function an(t){return t[t.length-1]}function qs(t){return T(an(t))?t.pop():void 0}function $t(t){return Ir(an(t))?t.pop():void 0}function Nr(t,e){return typeof an(t)=="number"?t.pop():e}var Or=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function kr(t){return T(t==null?void 0:t.then)}function Lr(t){return T(t[Qe])}function Rr(t){return Symbol.asyncIterator&&T(t==null?void 0:t[Symbol.asyncIterator])}function Gr(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function js(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Vr=js();function zr(t){return T(t==null?void 0:t[Vr])}function Ur(t){return Fs(this,arguments,function(){var n,r,i,a;return $r(this,function(o){switch(o.label){case 0:n=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,xt(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,xt(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,xt(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Hr(t){return T(t==null?void 0:t.getReader)}function G(t){if(t instanceof P)return t;if(t!=null){if(Lr(t))return Ks(t);if(Or(t))return Zs(t);if(kr(t))return Js(t);if(Rr(t))return Yr(t);if(zr(t))return Qs(t);if(Hr(t))return tl(t)}throw Gr(t)}function Ks(t){return new P(function(e){var n=t[Qe]();if(T(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Zs(t){return new P(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Js(t){return new P(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Pr)})}function Qs(t){return new P(function(e){var n,r;try{for(var i=bt(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Yr(t){return new P(function(e){el(t,e).catch(function(n){return e.error(n)})})}function tl(t){return Yr(Ur(t))}function el(t,e){var n,r,i,a;return Es(this,void 0,void 0,function(){var o,u;return $r(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),n=Ts(t),s.label=1;case 1:return[4,n.next()];case 2:if(r=s.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=s.sent(),i={error:u},[3,11];case 6:return s.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function at(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(a),!i)return a}function Xr(t,e){return e===void 0&&(e=0),I(function(n,r){n.subscribe(N(r,function(i){return at(r,t,function(){return r.next(i)},e)},function(){return at(r,t,function(){return r.complete()},e)},function(i){return at(r,t,function(){return r.error(i)},e)}))})}function Wr(t,e){return e===void 0&&(e=0),I(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function nl(t,e){return G(t).pipe(Wr(e),Xr(e))}function rl(t,e){return G(t).pipe(Wr(e),Xr(e))}function il(t,e){return new P(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function al(t,e){return new P(function(n){var r;return at(n,e,function(){r=t[Vr](),at(n,e,function(){var i,a,o;try{i=r.next(),a=i.value,o=i.done}catch(u){n.error(u);return}o?n.complete():n.next(a)},0,!0)}),function(){return T(r==null?void 0:r.return)&&r.return()}})}function Br(t,e){if(!t)throw new Error("Iterable cannot be null");return new P(function(n){at(n,e,function(){var r=t[Symbol.asyncIterator]();at(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function ol(t,e){return Br(Ur(t),e)}function ul(t,e){if(t!=null){if(Lr(t))return nl(t,e);if(Or(t))return il(t,e);if(kr(t))return rl(t,e);if(Rr(t))return Br(t,e);if(zr(t))return al(t,e);if(Hr(t))return ol(t,e)}throw Gr(t)}function Dt(t,e){return e?ul(t,e):G(t)}function Ut(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t);return Dt(t,n)}var qr=qe(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function sl(t){return t instanceof Date&&!isNaN(t)}function F(t,e){return I(function(n,r){var i=0;n.subscribe(N(r,function(a){r.next(t.call(e,a,i++))}))})}var ll=Array.isArray;function cl(t,e){return ll(e)?t.apply(void 0,it([],rt(e))):t(e)}function fl(t){return F(function(e){return cl(t,e)})}var hl=Array.isArray,dl=Object.getPrototypeOf,pl=Object.prototype,ml=Object.keys;function gl(t){if(t.length===1){var e=t[0];if(hl(e))return{args:e,keys:null};if(vl(e)){var n=ml(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function vl(t){return t&&typeof t=="object"&&dl(t)===pl}function yl(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function Y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=qs(t),i=gl(t),a=i.args,o=i.keys;if(a.length===0)return Dt([],n);var u=new P(wl(a,n,o?function(s){return yl(o,s)}:_t));return r?u.pipe(fl(r)):u}function wl(t,e,n){return n===void 0&&(n=_t),function(r){jr(e,function(){for(var i=t.length,a=new Array(i),o=i,u=i,s=function(f){jr(e,function(){var c=Dt(t[f],e),h=!1;c.subscribe(N(r,function(d){a[f]=d,h||(h=!0,u--),u||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)s(l)},r)}}function jr(t,e,n){t?at(n,t,e):e()}function bl(t,e,n,r,i,a,o,u){var s=[],l=0,f=0,c=!1,h=function(){c&&!s.length&&!l&&e.complete()},d=function(m){return l<r?p(m):s.push(m)},p=function(m){l++;var g=!1;G(n(m,f++)).subscribe(N(e,function(y){e.next(y)},function(){g=!0},void 0,function(){if(g)try{l--;for(var y=function(){var $=s.shift();o||p($)};s.length&&l<r;)y();h()}catch($){e.error($)}}))};return t.subscribe(N(e,d,function(){c=!0,h()})),function(){}}function Kr(t,e,n){return n===void 0&&(n=1/0),T(e)?Kr(function(r,i){return F(function(a,o){return e(r,a,i,o)})(G(t(r,i)))},n):(typeof e=="number"&&(n=e),I(function(r,i){return bl(r,i,t,n)}))}function on(t){return t===void 0&&(t=1/0),Kr(_t,t)}function xl(){return on(1)}function Zr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return xl()(Dt(t,$t(t)))}function _l(t){return new P(function(e){G(t()).subscribe(e)})}function $l(t,e,n){return _l(function(){return t()?e:n})}function Dl(t,e,n){n===void 0&&(n=Bs);var r=-1;return e!=null&&(Ir(e)?n=e:r=e),new P(function(i){var a=sl(t)?+t-n.now():t;a<0&&(a=0);var o=0;return n.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},a)})}function Al(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=Nr(t,1/0),i=t;return i.length?i.length===1?G(i[0]):on(r)(Dt(i,n)):rn}var Sl=Array.isArray;function Ml(t){return t.length===1&&Sl(t[0])?t[0]:t}function Jr(t,e){return I(function(n,r){var i=0;n.subscribe(N(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function Qr(t){return I(function(e,n){var r=null,i=!1,a;r=e.subscribe(N(n,void 0,void 0,function(o){a=G(t(o,Qr(t)(e))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function Cl(t,e){return e===void 0&&(e=nn),I(function(n,r){var i=null,a=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var l=a;a=null,r.next(l)}};function s(){var l=o+t,f=e.now();if(f<l){i=this.schedule(void 0,l-f),r.add(i);return}u()}n.subscribe(N(r,function(l){a=l,o=e.now(),i||(i=e.schedule(s,t),r.add(i))},function(){u(),r.complete()},void 0,function(){a=i=null}))})}function Pl(t){return I(function(e,n){var r=!1;e.subscribe(N(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function El(t){return t<=0?function(){return rn}:I(function(e,n){var r=0;e.subscribe(N(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function we(t,e){return e===void 0&&(e=_t),t=t??Fl,I(function(n,r){var i,a=!0;n.subscribe(N(r,function(o){var u=e(o);(a||!t(i,u))&&(a=!1,i=u,r.next(o))}))})}function Fl(t,e){return t===e}function Tl(t){return t===void 0&&(t=Il),I(function(e,n){var r=!1;e.subscribe(N(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function Il(){return new qr}function Nl(t,e){var n=arguments.length>=2;return function(r){return r.pipe(_t,El(1),n?Pl(e):Tl(function(){return new qr}))}}function Ol(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=Nr(t,1/0);return t=Ml(t),I(function(i,a){on(r)(Dt(it([i],rt(t)),n)).subscribe(a)})}function kl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ol.apply(void 0,it([],rt(t)))}function un(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new E}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,u=t.resetOnRefCountZero,s=u===void 0?!0:u;return function(l){var f,c,h,d=0,p=!1,m=!1,g=function(){c==null||c.unsubscribe(),c=void 0},y=function(){g(),f=h=void 0,p=m=!1},$=function(){var x=f;y(),x==null||x.unsubscribe()};return I(function(x,A){d++,!m&&!p&&g();var v=h=h??n();A.add(function(){d--,d===0&&!m&&!p&&(c=sn($,s))}),v.subscribe(A),!f&&d>0&&(f=new zt({next:function(C){return v.next(C)},error:function(C){m=!0,g(),c=sn(y,i,C),v.error(C)},complete:function(){p=!0,g(),c=sn(y,o),v.complete()}}),G(x).subscribe(f))})(l)}}function sn(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new zt({next:function(){i.unsubscribe(),t()}});return G(e.apply(void 0,it([],rt(n)))).subscribe(i)}}function D(t,e,n){var r,i=!1;return r=t,un({connector:function(){return new Hs(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function be(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t);return I(function(r,i){(n?Zr(t,r,n):Zr(t,r)).subscribe(i)})}function X(t,e){return I(function(n,r){var i=null,a=0,o=!1,u=function(){return o&&!i&&r.complete()};n.subscribe(N(r,function(s){i==null||i.unsubscribe();var l=0,f=a++;G(t(s,f)).subscribe(i=N(r,function(c){return r.next(e?e(s,c,f,l++):c)},function(){i=null,u()}))},function(){o=!0,u()}))})}function O(t){return I(function(e,n){G(t).subscribe(N(n,function(){return n.complete()},Ke)),!n.closed&&e.subscribe(n)})}function Ll(t,e){return I(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,u=i.trailing,s=u===void 0?!1:u,l=!1,f=null,c=null,h=!1,d=function(){c==null||c.unsubscribe(),c=null,s&&(g(),h&&r.complete())},p=function(){c=null,h&&r.complete()},m=function(y){return c=G(t(y)).subscribe(N(r,d,p))},g=function(){if(l){l=!1;var y=f;f=null,r.next(y),!h&&m(y)}};n.subscribe(N(r,function(y){l=!0,f=y,!(c&&!c.closed)&&(o?g():m(y))},function(){h=!0,!(s&&l&&c&&!c.closed)&&r.complete()}))})}function Rl(t,e,n){e===void 0&&(e=nn);var r=Dl(t,e);return Ll(function(){return r},n)}const xe=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new E,i=e.pipe(O(r),F(s=>({id:null,seriesLabel:null,groupLabel:null,highlightDefault:s.highlightDefault})),we()),a=n.pipe(O(r),Jr(s=>s.eventName==="mouseover"||s.eventName==="mousemove"),F(s=>s.datum?{id:s.datum.id,seriesLabel:s.datum.seriesLabel,groupLabel:s.datum.groupLabel,highlightDefault:null}:{id:null,seriesLabel:null,groupLabel:null,highlightDefault:null})),o=n.pipe(O(r),Jr(s=>s.eventName==="mouseout"),X(s=>i)),u=({data:s,id:l,seriesLabel:f,groupLabel:c,highlightDefault:h,target:d})=>{let p=[];if(h!=null&&h!=""){if(d==="datum")l=h;else if(d==="series"){const m=s.flat().find(g=>g.id===h||g.seriesLabel===h);f=m&&m.seriesLabel?m.seriesLabel:null}else if(d==="group"){const m=s.flat().find(g=>g.id===h||g.groupLabel===h);c=m&&m.groupLabel?m.groupLabel:null}}if(d==="datum"&&l!=null&&l!="")p.push(l);else if(d==="series"&&f!=null&&f!=""){const m=s.flat().filter(g=>g.seriesLabel===f).map(g=>g.id);p=p.concat(m)}else if(d==="group"&&c!=null&&c!=""){const m=s.flat().filter(g=>g.groupLabel===c).map(g=>g.id);p=p.concat(m)}return p};return new P(s=>(Y({target:Al(a,o,i),datumList:t,fullChartParams:e}).pipe(O(r)).subscribe(l=>{const f=u({data:l.datumList,id:l.target.id,seriesLabel:l.target.seriesLabel,groupLabel:l.target.groupLabel,highlightDefault:l.target.highlightDefault,target:l.fullChartParams.highlightTarget});s.next(f)}),function(){r.next(void 0)}))},_e=({datumList$:t})=>t.pipe(F(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),ln=({datumList$:t})=>t.pipe(F(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),Gl=({subject:t,observer:e})=>{const n=xe({datumList$:e.computedData$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(D(1)),r=_e({datumList$:e.computedData$}).pipe(D(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,seriesHighlight$:n,SeriesDataMap$:r}},ct=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=j.scaleDomain,scaleRange:i=j.scaleRange})=>{const a=r[0]??j.scaleDomain[0],o=r[1]??j.scaleDomain[1],u=i[0]??j.scaleRange[0],s=i[1]??j.scaleRange[1],l=a==="auto"?e:a,f=o==="auto"?t:o;let c=n*u,h=n*s;return vr().domain([l,f]).range([c,h])},Vl=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return hs().domain(t).range(r).padding(n)},zl=({axisLabels:t,axisWidth:e,padding:n=.5,reverse:r=!1})=>{let a=t.map((o,u)=>u);return r&&a.reverse(),yr().domain([-0,e+0]).range(a)},Ul={series:!1,grid:!0,multiGrid:!0,multiValue:!0,tree:!1,relationship:!1};function Hl(t){return new P(e=>{const n=new ResizeObserver(r=>{const i=r[0];i&&i.contentRect&&e.next(i.contentRect)});return n.observe(t),function(){n.unobserve(t)}})}function ti(t,e,n){const r=nt(t,e);return n==="multiGrid"&&t.gridList!=null&&(r.gridList=t.gridList.map((i,a)=>{const o=e.gridList[a]||e.gridList[0];return nt(i,o)})),console.log(r),r}const Yl=({defaultDataFormatter:t,computedDataFn:e,contextObserverFn:n})=>{const r=new E,i=t.type;return function(o,u){jt(o).selectAll("svg").remove();const s=jt(o).append("svg");s.attr("xmlns:xlink","http://www.w3.org/1999/xlink").attr("xmls","http://www.w3.org/2000/svg").attr("version","1.1").style("position","absolute").classed("orbcharts__root",!0);const l=s.append("g");l.classed("orbcharts__layout",!0);const f=l.append("g");f.classed("orbcharts__plugins",!0);const c={data$:new E,dataFormatter$:new E,plugins$:new E,chartParams$:new E,event$:new E},h=(w=>{const S=w||Ct,M=S.preset?S.preset:{};return{chartParams:M.chartParams?nt(M.chartParams,fn):fn,dataFormatter:M.dataFormatter?ti(M.dataFormatter,t,i):t,allPluginParams:M.allPluginParams?M.allPluginParams:{},description:M.description??""}})(u),d=c.data$.pipe(D(1)),p=c.dataFormatter$.pipe(O(r),be({}),F(w=>ti(w,h.dataFormatter,i)),D(1)),m=c.chartParams$.pipe(O(r),be({}),F(w=>nt(w,h.chartParams)),D(1)),g=m.pipe(O(r),be({}),F(w=>nt(w.padding??{},cn)));g.pipe(O(r),Nl()).subscribe(w=>{l.attr("transform",`translate(${w.left}, ${w.top})`)}),g.subscribe(w=>{l.transition().attr("transform",`translate(${w.left}, ${w.top})`)});const y=Hl(o).pipe(O(r),un()),$=Ut().pipe(kl(y.pipe(Cl(250)),y.pipe(Rl(250))),we((w,S)=>JSON.stringify(w)===JSON.stringify(S)),un()),x=$.subscribe(),A=Y({rootSize:$,mergedPadding:g}).pipe(O(r),X(async w=>{const S=w.rootSize.width>0?w.rootSize.width:di,M=w.rootSize.height>0?w.rootSize.height:pi;return{width:S-w.mergedPadding.left-w.mergedPadding.right,height:M-w.mergedPadding.top-w.mergedPadding.bottom,top:w.mergedPadding.top,right:w.mergedPadding.right,bottom:w.mergedPadding.bottom,left:w.mergedPadding.left,rootWidth:S,rootHeight:M}}),D(1));A.subscribe(w=>{s.attr("width",w.rootWidth).attr("height",w.rootHeight)});const v=Y({data:d,dataFormatter:p,chartParams:m,layout:$l(()=>Ul[i]===!0,A,Ut(void 0))}).pipe(O(r),X(async w=>w),X(w=>Ut(w).pipe(F(S=>{try{return e({data:S.data,dataFormatter:S.dataFormatter,chartParams:S.chartParams,layout:S.layout})}catch(M){throw console.error(M),new Error(M)}}),Qr(()=>rn))),D(1));v.subscribe();const C={};return c.plugins$.subscribe(w=>{if(!w)return;const S=f.selectAll("g.orbcharts__plugin").data(w,b=>b.name),M=S.enter().append("g").attr("class",b=>`orbcharts__plugin orbcharts__${b.name}`);S.exit().remove().each((b,V,k)=>{C[b.name]&&C[b.name].destroy()}),M.each((b,V,k)=>{const Q={fullParams$:new P,fullChartParams$:m,fullDataFormatter$:p,computedData$:v,layout$:A},St=n({observer:Q,subject:c}),tt={selection:jt(k[V]),rootSelection:s,name:b.name,chartType:i,subject:c,observer:St};b.setPresetParams(h.allPluginParams[b.name]??{}),b.setContext(tt),C[tt.name]=b,b.init()})}),{...c,selection:s,destroy(){jt(o).selectAll("svg").remove(),r.next(void 0),x.unsubscribe()}}}};class At{constructor({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r},i,a){this.data$=new E,this.dataFormatter$=new E,this.plugins$=new E,this.chartParams$=new E,this.event$=new E;const u=Yl({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r})(i,a);this.selection=u.selection,this.destroy=u.destroy,this.data$=u.data$,this.dataFormatter$=u.dataFormatter$,this.plugins$=u.plugins$,this.chartParams$=u.chartParams$,this.event$=u.event$}}class Xl extends At{constructor(e,n){super({defaultDataFormatter:gi,computedDataFn:Ps,contextObserverFn:Gl},e,n)}}function ei(t){const{data:e=[],dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];try{const a=e.reduce((l,f)=>f.length>l?f.length:l,0),u=e.map((l,f)=>{if(l.length===a)return l;const c=Object.assign([],l);for(let h=c.length;h<a;h++)c[h]=null;return c}).map((l,f)=>l.map((c,h)=>{const d=n.grid.visibleFilter(c,f,h,t);return c==null?{id:"",label:"",data:{},value:null,_visible:d}:typeof c=="number"?{id:"",label:"",data:{},value:c,_visible:d}:{id:c.id??"",label:c.label??"",data:c.data??{},value:c.value,_visible:d}}));return _r(n.grid.gridData.seriesDirection,u)}catch{return[]}}function ni(t,e,n){const r=e.grid.groupAxis.position==="top"||e.grid.groupAxis.position==="bottom"?n.width:n.height,i=t[0]?t[0].length-1:0;return ct({maxValue:i,minValue:0,axisWidth:r,scaleDomain:[0,i],scaleRange:[0,1]})}function ri(t,e,n){const r=e.grid.valueAxis.position==="left"||e.grid.valueAxis.position==="right"?n.height:n.width,i=t.flat().filter(u=>u._visible!=!1),[a,o]=pe(i);return t.map((u,s)=>ct({maxValue:o,minValue:a,axisWidth:r,scaleDomain:[a,o],scaleRange:[0,1]}))}const Wl=t=>{const{data:e=[],dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let a;try{const o=ei(t),u=ni(o,n,i),s=Xe({transposedDataGrid:o,dataFormatter:n,chartType:"grid"}),l=br({transposedDataGrid:o,dataFormatter:n,chartType:"grid"}),f=ri(o,n,i),c=o.map((d,p)=>f[p](0));let h=0;a=o.map((d,p)=>d.map((m,g)=>{const y=Rt("grid",0,p,g),$=l[g],x=f[p],A=x(m.value??0),v=c[p],C={id:m.id?m.id:y,index:h,label:m.label?m.label:y,description:m.description??"",data:m.data,value:m.value,gridIndex:0,seriesIndex:p,seriesLabel:s[p],groupIndex:g,groupLabel:$,color:me(p,r),axisX:u(g),axisY:A,axisYFromZero:A-v,visible:m._visible};return h++,C}))}catch(o){throw Error(o)}return a},ii=({fullDataFormatter$:t,layout$:e})=>{const n=new E;function r({xAxis:i,yAxis:a,width:o,height:u}){if(!i||!a)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let s=0,l=0,f=0,c=0,h=0;return i.position==="bottom"?a.position==="left"?(c=180,l=u):a.position==="right"?(c=180,h=180,s=o,l=u):(c=180,l=u):i.position==="top"?a.position==="left"||(a.position==="right"?(h=180,s=o):(c=180,l=u)):i.position==="left"?a.position==="bottom"?(f=-90,l=u):a.position==="top"?(f=-90,h=180):(c=180,l=u):i.position==="right"&&(a.position==="bottom"?(f=-90,c=180,l=u,s=o):a.position==="top"?(f=-90,c=180,h=180,s=o):(c=180,l=u)),{translate:[s,l],scale:[1,1],rotate:f,rotateX:c,rotateY:h,value:`translate(${s}px, ${l}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new P(i=>(Y({fullDataFormatter:t,layout:e}).pipe(O(n),X(async a=>a)).subscribe(a=>{const o=r({xAxis:a.fullDataFormatter.grid.groupAxis,yAxis:a.fullDataFormatter.grid.valueAxis,width:a.layout.width,height:a.layout.height});i.next(o)}),function(){n.next(void 0)}))},ai=({gridAxesTransform$:t})=>t.pipe(F(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,a=e.rotateX*-1,o=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:a,rotateY:o,value:`translate(${n[0]}px, ${n[1]}px) rotate(${i}deg) rotateX(${a}deg) rotateY(${o}deg)`}})),oi=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new E;function i({data:a,groupAxis:o,valueAxis:u,width:s,height:l}){let f=0,c=0,h=0,d=0;const p=o.position==="top"||o.position==="bottom"?s:l,m=0,g=a[0]?a[0].length-1:0,y=o.scaleDomain[0]==="auto"?m-o.scalePadding:o.scaleDomain[0]-o.scalePadding,$=o.scaleDomain[1]==="auto"?g+o.scalePadding:o.scaleDomain[1]+o.scalePadding,x=ct({maxValue:g,minValue:m,axisWidth:p,scaleDomain:[y,$],scaleRange:[0,1]}),A=x(m),v=x(g);f=A,h=(v-A)/p;const w=a.map((St,Mt)=>St.filter((tt,dt)=>dt>=y&&dt<=$&&tt.visible==!0)),S=We(w),M=u.position==="left"||u.position==="right"?l:s,ht=ct({maxValue:S[1],minValue:S[0],axisWidth:M,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),b=We(a),V=ht(b[0]),k=ht(b[1]);return c=V,d=(k-V)/M,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new P(a=>(Y({computedData:t,fullDataFormatter:e,layout:n}).pipe(O(r),X(async o=>o)).subscribe(o=>{const u=i({data:o.computedData,groupAxis:o.fullDataFormatter.grid.groupAxis,valueAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});a.next(u)}),function(){r.next(void 0)}))},ui=({gridContainer$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>Y({gridContainer:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(X(async r=>r),F(r=>r.gridAxesTransform.rotate==0||r.gridAxesTransform.rotate==180?r.gridContainer.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainer[a].scale[0],1/r.gridGraphicTransform.scale[1]/r.gridContainer[a].scale[1]]):r.gridContainer.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainer[a].scale[1],1/r.gridGraphicTransform.scale[1]/r.gridContainer[a].scale[0]]))),si=({fullDataFormatter$:t,layout$:e})=>{const n=new E;function r({xAxisPosition:i,yAxisPosition:a,width:o,height:u}){if((i==="bottom"||i==="top")&&(a==="left"||a==="right"))return{width:o,height:u};if((i==="left"||i==="right")&&(a==="bottom"||a==="top"))return{width:u,height:o}}return new P(i=>{Y({fullDataFormatter:t,layout:e}).pipe(O(n),X(async a=>a)).subscribe(a=>{const o=r({xAxisPosition:a.fullDataFormatter.grid.groupAxis.position,yAxisPosition:a.fullDataFormatter.grid.valueAxis.position,width:a.layout.width,height:a.layout.height});return i.next(o),function(){n.next(void 0)}})})},li=({computedData$:t})=>t.pipe(F(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),we((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),ci=({computedData$:t})=>t.pipe(F(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),fi=({computedData$:t,fullDataFormatter$:e})=>Y({computedData:t,fullDataFormatter:e}).pipe(F(n=>!!(n.fullDataFormatter.grid.seriesSlotIndexes&&n.fullDataFormatter.grid.seriesSlotIndexes.length===n.computedData.length)),we()),hi=({computedData$:t,fullDataFormatter$:e,fullChartParams$:n,layout$:r})=>Y({computedData:t,fullDataFormatter:e,fullChartParams:n,layout:r}).pipe(X(async a=>a),F(a=>{const o=a.fullDataFormatter.grid;if(!!(o.seriesSlotIndexes&&o.seriesSlotIndexes.length===a.computedData.length))return a.computedData.map((s,l)=>{const f=o.seriesSlotIndexes[l]%a.fullDataFormatter.container.columnAmount,c=Math.floor(o.seriesSlotIndexes[l]/a.fullDataFormatter.container.columnAmount),{translate:h,scale:d}=Gt(a.layout,a.fullDataFormatter.container,c,f);return{slotIndex:o.seriesSlotIndexes[l],rowIndex:c,columnIndex:f,translate:h,scale:d}});{const s=o.slotIndex%a.fullDataFormatter.container.columnAmount,l=Math.floor(o.slotIndex/a.fullDataFormatter.container.columnAmount);return a.computedData.map((f,c)=>{const{translate:h,scale:d}=Gt(a.layout,a.fullDataFormatter.container,l,s);return{slotIndex:o.slotIndex,rowIndex:l,columnIndex:s,translate:h,scale:d}})}})),Bl=({subject:t,observer:e})=>{const n=fi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(D(1)),r=hi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,fullChartParams$:e.fullChartParams$,layout$:e.layout$}),i=ii({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(D(1)),a=ai({gridAxesTransform$:i}).pipe(D(1)),o=oi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(D(1)),u=ui({gridContainer$:r,gridAxesTransform$:i,gridGraphicTransform$:o}),s=si({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(D(1)),l=e.computedData$.pipe(F(m=>m.flat())).pipe(D(1)),f=xe({datumList$:l,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(D(1)),c=li({computedData$:e.computedData$}),h=_e({datumList$:l}).pipe(D(1)),d=ln({datumList$:l}).pipe(D(1)),p=ci({computedData$:e.computedData$}).pipe(D(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,isSeriesPositionSeprate$:n,gridContainer$:r,gridAxesTransform$:i,gridAxesReverseTransform$:a,gridGraphicTransform$:o,gridGraphicReverseScale$:u,gridAxesSize$:s,gridHighlight$:f,existedSeriesLabels$:c,SeriesDataMap$:h,GroupDataMap$:d,visibleComputedData$:p}};class ql extends At{constructor(e,n){super({defaultDataFormatter:vi,computedDataFn:Wl,contextObserverFn:Bl},e,n)}}function jl({context:t,gridIndex:e,transposedDataGrid:n,gridSeriesLabels:r,SeriesLabelColorMap:i}){const{data:a=[],dataFormatter:o,chartParams:u,layout:s}=t;if(!a.length)return[];const l=ni(n,o,s),f=xr({transposedDataGrid:n,dataFormatter:o,chartType:"multiGrid",gridIndex:e}),c=ri(n,o,s),h=n.map((m,g)=>c[g](0));let d=0;return n.map((m,g)=>m.map((y,$)=>{const x=Rt("multiGrid",e,g,$),A=f[$],v=r[g],C=c[g],w=C(y.value??0),S=h[g],M={id:y.id?y.id:x,index:d,label:y.label?y.label:x,description:y.description??"",data:y.data,value:y.value,gridIndex:e,seriesIndex:g,seriesLabel:v,groupIndex:$,groupLabel:A,color:i.get(v),axisX:l($),axisY:w,axisYFromZero:w-S,visible:y._visible};return d++,M}))}const Kl=({data:t=[],dataFormatter:e,chartParams:n,layout:r})=>{if(!t.length)return[];let i=[];try{const a=e.gridList[0]||Ht,o=t.map((d,p)=>({type:"grid",grid:{...e.gridList[p]||a},container:{...e.container}})),u=t.map((d,p)=>({data:d,dataFormatter:o[p],chartParams:n,layout:r})),s=t.map((d,p)=>ei(u[p])),l=new Set(o.map(m=>m.grid.slotIndex)).size!==o.length?wr:Xe,f=s.map((d,p)=>l({transposedDataGrid:d,dataFormatter:o[p],chartType:"multiGrid",gridIndex:p})),c=new Map;let h=0;f.flat().forEach((d,p)=>{if(!c.has(d)){const m=me(h,n);c.set(d,m),h++}}),i=t.map((d,p)=>jl({context:u[p],gridIndex:p,transposedDataGrid:s[p],gridSeriesLabels:f[p],SeriesLabelColorMap:c}))}catch(a){throw Error(a)}return i},Zl=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{function a({gridDataFormatter$:u,gridComputedData$:s,layout$:l,fullChartParams$:f,event$:c}){const h=fi({computedData$:s,fullDataFormatter$:u}).pipe(D(1)),d=hi({computedData$:s,fullDataFormatter$:u,fullChartParams$:f,layout$:l}).pipe(D(1)),p=ii({fullDataFormatter$:u,layout$:l}).pipe(D(1)),m=ai({gridAxesTransform$:p}).pipe(D(1)),g=oi({computedData$:s,fullDataFormatter$:u,layout$:l}).pipe(D(1)),y=ui({gridContainer$:d,gridAxesTransform$:p,gridGraphicTransform$:g}),$=si({fullDataFormatter$:u,layout$:l}).pipe(D(1)),x=s.pipe(F(M=>M.flat())).pipe(D(1)),A=xe({datumList$:x,fullChartParams$:f,event$:c}).pipe(D(1)),v=li({computedData$:s}),C=_e({datumList$:x}).pipe(D(1)),w=ln({datumList$:x}).pipe(D(1)),S=ci({computedData$:s}).pipe(D(1));return{isSeriesPositionSeprate$:h,gridContainer$:d,gridAxesTransform$:p,gridAxesReverseTransform$:m,gridGraphicTransform$:g,gridGraphicReverseScale$:y,gridAxesSize$:$,gridHighlight$:A,existedSeriesLabels$:v,SeriesDataMap$:C,GroupDataMap$:w,visibleComputedData$:S}}const o=new E;return Y({fullDataFormatter:t,computedData:e}).pipe(X(async u=>u),F(u=>{o.next(void 0);const s=u.fullDataFormatter.gridList[0]??Ht;return u.computedData.map((l,f)=>{const h={type:"grid",grid:{...u.fullDataFormatter.gridList[f]??s},container:{...u.fullDataFormatter.container}},d=Ut(h).pipe(O(o),D(1)),p=Ut(l).pipe(O(o),D(1));return a({gridDataFormatter$:d,gridComputedData$:p,layout$:n,fullChartParams$:r,event$:i})})}))},Jl=({computedData$:t,fullDataFormatter$:e,fullChartParams$:n,layout$:r})=>Y({computedData:t,fullDataFormatter:e,fullChartParams:n,layout:r}).pipe(X(async a=>a),F(a=>{const o=a.fullDataFormatter.gridList[0]??Ht;return a.computedData.map((s,l)=>{const f=a.fullDataFormatter.gridList[l]??o;if(!!(f.seriesSlotIndexes&&f.seriesSlotIndexes.length===s.length))return s.map((h,d)=>{const p=f.seriesSlotIndexes[d]%a.fullDataFormatter.container.columnAmount,m=Math.floor(f.seriesSlotIndexes[d]/a.fullDataFormatter.container.columnAmount),{translate:g,scale:y}=Gt(a.layout,a.fullDataFormatter.container,m,p);return{slotIndex:f.seriesSlotIndexes[d],rowIndex:m,columnIndex:p,translate:g,scale:y}});{const h=f.slotIndex%a.fullDataFormatter.container.columnAmount,d=Math.floor(f.slotIndex/a.fullDataFormatter.container.columnAmount);return s.map((p,m)=>{const{translate:g,scale:y}=Gt(a.layout,a.fullDataFormatter.container,d,h);return{slotIndex:f.slotIndex,rowIndex:d,columnIndex:h,translate:g,scale:y}})}})})),Ql=({subject:t,observer:e})=>{const n=Zl({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(D(1)),r=Jl({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,fullChartParams$:e.fullChartParams$,layout$:e.layout$});return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,multiGridEachDetail$:n,multiGridContainer$:r}};class tc extends At{constructor(e,n){super({defaultDataFormatter:yi,computedDataFn:Kl,contextObserverFn:Ql},e,n)}}const ec=t=>{const{data:e,dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let a=[];try{const o=e.map((x,A)=>x.map((v,C)=>typeof v=="number"?{id:"",label:"",description:"",data:{},value:v}:{id:v.id??"",label:v.label??"",description:v.description??"",data:v.data??{},value:v.value})),[u,s]=pe(o.map(x=>x[0])),[l,f]=pe(o.map(x=>x[1])),c=n.xAxis.position==="top"||n.xAxis.position==="bottom"?i.width:i.height,h=n.yAxis.position==="left"||n.yAxis.position==="right"?i.height:i.width,d=ct({maxValue:s,minValue:u,axisWidth:c,scaleDomain:[u,s],scaleRange:[0,1]}),p=ct({maxValue:f,minValue:l,axisWidth:h,scaleDomain:[l,f],scaleRange:[0,1]}),m=[n.xAxis.scaleDomain[0]==="auto"?u:n.xAxis.scaleDomain[0],n.xAxis.scaleDomain[1]==="auto"?s:n.xAxis.scaleDomain[1]],g=[n.yAxis.scaleDomain[0]==="auto"?l:n.yAxis.scaleDomain[0],n.yAxis.scaleDomain[1]==="auto"?f:n.yAxis.scaleDomain[1]];debugger;const y=(x,A,v,C)=>v===0&&x.value!=null&&(x.value<m[0]||x.value>m[1])||v===1&&x.value!=null&&(x.value<g[0]||x.value>g[1])?!1:n.visibleFilter(x,A,v,C);let $=0;a=o.map((x,A)=>x.map((v,C)=>{const w=$;$++;const S=Rt(n.type,A,C),M=y(v,A,C,t);return{id:v.id?v.id:S,index:w,label:v.label?v.label:S,description:v.description??"",data:v.data,value:v.value,axis:C==0?d(v.value):p(v.value),visible:M}}))}catch(o){throw Error(o)}return a},nc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class rc extends At{constructor(e,n){super({defaultDataFormatter:wi,computedDataFn:ec,contextObserverFn:nc},e,n)}}const ic=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;let i=[],a=[];try{let o=[],u=[];if(e.nodes)o=e.nodes,u=e.edges;else if(e[0])o=e[0],u=e[1];else return{nodes:[],edges:[]};i=o.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,startNodes:[],startNodeIds:[],endNodes:[],endNodeIds:[],visible:n.visibleFilter(c,0,h,t)}));const s=new Map(i.map(c=>[c.id,c]));a=u.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,startNode:s.get(c.start),startNodeId:c.start,endNode:s.get(c.end),endNodeId:c.end,visible:n.visibleFilter(c,1,h,t)}));const l=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.endNodeId)??[];d.push(h.startNode),c.set(h.endNodeId,d)}),c}(),f=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.startNodeId)??[];d.push(h.endNode),c.set(h.startNodeId,d)}),c}();Array.from(s).forEach(([c,h])=>{h.startNodes=l.get(c),h.startNodeIds=h.startNodes.map(d=>d.id),h.endNodes=f.get(c),h.endNodeIds=h.endNodes.map(d=>d.id)})}catch(o){throw Error(o)}return{nodes:i,edges:a}},ac=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class oc extends At{constructor(e,n){super({defaultDataFormatter:xi,computedDataFn:ic,contextObserverFn:ac},e,n)}}const uc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;let i={id:"",index:0,label:"",description:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const a=function(){if(q(e)===!0)return structuredClone(e);if(Array.isArray(e)===!1)return{id:""};let s;const l=new Map;e.forEach(c=>{if(!c.parent)s=c;else{const h=l.get(c.parent)??[];h.push(c),l.set(c.parent,h)}});const f=c=>({id:c.id,label:c.label,data:c.data,value:c.value,children:(l.get(c.id)??[]).map(h=>f(h))});return s?f(s):{id:""}}();let o=0;const u=(s,l,f)=>{const c=l+1,h=n.visibleFilter(s,l,f,t),d=o;return o++,{id:s.id,index:d,level:l,seq:f,label:s.label??"",description:s.description??"",data:s.data??{},value:s.value,visible:h,children:(s.children??[]).map((p,m)=>u(p,c,m))}};i=u(a,0,0)}catch(a){throw Error(a)}return i},sc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class lc extends At{constructor(e,n){super({defaultDataFormatter:bi,computedDataFn:uc,contextObserverFn:sc},e,n)}}function cc({name:t,defaultParams:e,initFn:n}){const r=new E,i=new E,a=new WeakMap;let o=()=>{},u,s=e;return{params$:i,name:t,defaultParams:e,init(){u&&(o=n(u)??(()=>{}),a.set(u.selection,u))},destroy(){o(),u&&(u.selection.remove(),u=void 0),r.next(void 0)},setPresetParams:l=>{s=nt(l,e)},setContext:l=>{u=l,u.observer.fullParams$=i.pipe(O(r),be({}),F(f=>nt(f,s)),D(1))}}}const ft=()=>function(e,n){return function(i){return class{constructor(){const o=cc({name:e,defaultParams:n,initFn:i});this.params$=o.params$,this.name=o.name,this.defaultParams=o.defaultParams,this.init=o.init,this.destroy=o.destroy,this.setPresetParams=o.setPresetParams,this.setContext=o.setContext}}}},fc=ft(),hc=ft(),dc=ft(),pc=ft(),mc=ft(),gc=ft(),vc=ft();_.GridChart=ql,_.MultiGridChart=tc,_.MultiValueChart=rc,_.RelationshipChart=oc,_.SeriesChart=Xl,_.TreeChart=lc,_.calcGridContainerPosition=Gt,_.createAxisLinearScale=ct,_.createAxisPointScale=Vl,_.createAxisQuantizeScale=zl,_.createDefaultDatumId=Rt,_.createDefaultGroupLabel=Ye,_.createDefaultSeriesLabel=de,_.createGridGroupLabels=br,_.createGridSeriesLabels=Xe,_.createMultiGridGroupLabels=xr,_.createMultiGridSeriesLabels=wr,_.defineGridPlugin=hc,_.defineMultiGridPlugin=dc,_.defineMultiValuePlugin=pc,_.defineNoneDataPlugin=mc,_.defineRelationshipPlugin=gc,_.defineSeriesPlugin=fc,_.defineTreePlugin=vc,_.formatCommaNumber=$s,_.formatValueToLabel=Ds,_.getMinAndMax=wt,_.getMinAndMaxGrid=We,_.getMinAndMaxMultiGrid=Ss,_.getMinAndMaxMultiValue=Ms,_.getMinAndMaxSeries=As,_.getMinAndMaxValue=pe,_.groupDataMapObservable=ln,_.highlightObservable=xe,_.isFunction=_s,_.isPlainObject=q,_.mergeOptionsWithDefault=nt,_.seriesColorPredicate=me,_.seriesDataMapObservable=_e,_.transposeData=_r,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
@@ -1,6 +1,13 @@
1
1
  import { ComputedDataFn } from '../types/ComputedData';
2
+ import { DataGridDatum } from '../types/DataGrid';
2
3
  import { DataFormatterContext } from '../types/DataFormatter';
3
- import { ComputedDatumGrid } from '../types/ComputedDataGrid';
4
-
4
+ import { DataFormatterGrid } from '../types/DataFormatterGrid';
5
+ import { Layout } from '../types/Layout';
6
+ import * as d3 from 'd3';
7
+ export interface DataGridDatumTemp extends DataGridDatum {
8
+ _visible: boolean;
9
+ }
10
+ export declare function createTransposedDataGrid(context: DataFormatterContext<'grid'>): DataGridDatumTemp[][];
11
+ export declare function createGroupScale(transposedDataGrid: DataGridDatumTemp[][], dataFormatter: DataFormatterGrid, layout: Layout): d3.ScaleLinear<number, number, never>;
12
+ export declare function createSeriesValueScaleArr(transposedDataGrid: DataGridDatumTemp[][], dataFormatter: DataFormatterGrid, layout: Layout): d3.ScaleLinear<number, number, never>[];
5
13
  export declare const computeGridData: ComputedDataFn<'grid'>;
6
- export declare const computeBaseGridData: (context: DataFormatterContext<"grid">, chartType: "grid" | "multiGrid", gridIndex?: number) => ComputedDatumGrid[][];
@@ -1,7 +1,6 @@
1
1
  import { ComputedDatumBase, ComputedDatumSeriesValue } from './ComputedData';
2
2
 
3
3
  export interface ComputedDatumGrid extends ComputedDatumBase, ComputedDatumSeriesValue {
4
- accSeriesIndex: number;
5
4
  gridIndex: number;
6
5
  groupIndex: number;
7
6
  groupLabel: string;
@@ -1,4 +1,4 @@
1
- export declare function isObject(variable: any): boolean;
1
+ export declare function isPlainObject(variable: any): boolean;
2
2
  export declare function isFunction(fn: any): boolean;
3
3
  export declare function mergeOptionsWithDefault<Options extends {
4
4
  [key: string]: any;