@orbcharts/core 3.0.0-alpha.21 → 3.0.0-alpha.22
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/orbcharts-core.es.js +686 -789
- package/dist/orbcharts-core.umd.js +2 -2
- package/dist/src/grid/gridObservables.d.ts +4 -4
- package/dist/src/series/seriesObservables.d.ts +1 -1
- package/dist/src/utils/d3Utils.d.ts +2 -8
- package/dist/src/utils/observables.d.ts +1 -1
- package/package.json +2 -1
- package/src/base/createBaseChart.ts +7 -2
- package/src/defaults.ts +5 -1
- package/src/types/Data.ts +1 -1
- package/.gitignore +0 -23
@@ -1,3 +1,3 @@
|
|
1
|
-
(function(x,Ct){typeof exports=="object"&&typeof module<"u"?Ct(exports):typeof define=="function"&&define.amd?define(["exports"],Ct):(x=typeof globalThis<"u"?globalThis:x||self,Ct(x["orbcharts-core"]={}))})(this,function(x){"use strict";const Ct={preset:{}},on={top:60,right:60,bottom:60,left:60},an={padding:on,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:"#f0f0f0",background:"#ffffff"},dark:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#f0f0f0",secondary:"#e1e1e1",white:"#f0f0f0",background:"#000000"}},styles:{textSize:14,unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},Kr=800,Zr=500,ht={type:"",visibleFilter:(t,e,n,r)=>!0,tooltipContentFormat:(t,e,n,r)=>{if(typeof t=="object"){if(t.tooltipContent)return t.tooltipContent;if(t.value)return String(t.value)}else return typeof t=="number"?String(t):""}},j={position:"left",scaleDomain:[0,"auto"],scaleRange:[0,.9],label:""},Jr={position:"bottom",scaleDomain:[0,"auto"],scalePadding:.5,label:""},Qr={...ht,type:"series",unitLabel:"",seriesLabels:[],colorsPredicate:(t,e,n,{chartParams:r})=>r.colors[r.colorScheme].series[e],sort:null},ti={...ht,type:"grid",grid:{rowLabels:[],columnLabels:[],seriesType:"row"},valueAxis:{...j},groupAxis:{...Jr},colorsPredicate:(t,e,n,{chartParams:r,dataFormatter:i})=>{const o=i.grid.seriesType==="row"?e:n;return r.colors[r.colorScheme].series[o]}},ei={...ht,type:"multiGrid",multiGrid:[]},ni={...ht,type:"multiValue",multiValue:[],xAxis:{...j},yAxis:{...j}},ri={...ht,type:"tree"},ii={...ht,type:"relationship"};function Ut(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function oi(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function un(t){let e,n,r;t.length!==2?(e=Ut,n=(u,s)=>Ut(t(u),s),r=(u,s)=>t(u)-s):(e=t===Ut||t===oi?t:ai,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 o(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){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:a,right:o}}function ai(){return 0}function ui(t){return t===null?NaN:+t}const sn=un(Ut).right;un(ui).center;class ln extends Map{constructor(e,n=ci){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(cn(this,e))}has(e){return super.has(cn(this,e))}set(e,n){return super.set(si(this,e),n)}delete(e){return super.delete(li(this,e))}}function cn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function si({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function li({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function ci(t){return t!==null&&typeof t=="object"?t.valueOf():t}const fi=Math.sqrt(50),hi=Math.sqrt(10),di=Math.sqrt(2);function Ht(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=fi?10:o>=hi?5:o>=di?2:1;let u,s,l;return i<0?(l=Math.pow(10,-i)/a,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)*a,u=Math.round(t/l),s=Math.round(e/l),u*l<t&&++u,s*l>e&&--s),s<u&&.5<=n&&n<2?Ht(t,e,n*2):[u,s,l]}function pi(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?Ht(e,t,n):Ht(t,e,n);if(!(o>=i))return[];const u=o-i+1,s=new Array(u);if(r)if(a<0)for(let l=0;l<u;++l)s[l]=(o-l)/-a;else for(let l=0;l<u;++l)s[l]=(o-l)*a;else if(a<0)for(let l=0;l<u;++l)s[l]=(i+l)/-a;else for(let l=0;l<u;++l)s[l]=(i+l)*a;return s}function ge(t,e,n){return e=+e,t=+t,n=+n,Ht(t,e,n)[2]}function mi(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?ge(e,t,n):ge(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function gi(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}var vi={value:()=>{}};function fn(){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 Xt(n)}function Xt(t){this._=t}function yi(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}})}Xt.prototype=fn.prototype={constructor:Xt,on:function(t,e){var n=this._,r=yi(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=wi(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=hn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=hn(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 Xt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function wi(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function hn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=vi,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var ve="http://www.w3.org/1999/xhtml";const dn={svg:"http://www.w3.org/2000/svg",xhtml:ve,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),dn.hasOwnProperty(e)?{space:dn[e],local:t}:t}function bi(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ve&&e.documentElement.namespaceURI===ve?e.createElement(t):e.createElementNS(n,t)}}function xi(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function pn(t){var e=Yt(t);return(e.local?xi:bi)(e)}function _i(){}function ye(t){return t==null?_i:function(){return this.querySelector(t)}}function Ai(t){typeof t!="function"&&(t=ye(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,u=r[i]=new Array(a),s,l,f=0;f<a;++f)(s=o[f])&&(l=t.call(s,s.__data__,f,o))&&("__data__"in s&&(l.__data__=s.__data__),u[f]=l);return new G(r,this._parents)}function $i(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Si(){return[]}function mn(t){return t==null?Si:function(){return this.querySelectorAll(t)}}function Mi(t){return function(){return $i(t.apply(this,arguments))}}function Di(t){typeof t=="function"?t=Mi(t):t=mn(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],u=a.length,s,l=0;l<u;++l)(s=a[l])&&(r.push(t.call(s,s.__data__,l,a)),i.push(s));return new G(r,i)}function gn(t){return function(){return this.matches(t)}}function vn(t){return function(e){return e.matches(t)}}var Ci=Array.prototype.find;function Ei(t){return function(){return Ci.call(this.children,t)}}function Pi(){return this.firstElementChild}function Ti(t){return this.select(t==null?Pi:Ei(typeof t=="function"?t:vn(t)))}var Fi=Array.prototype.filter;function Ni(){return Array.from(this.children)}function ki(t){return function(){return Fi.call(this.children,t)}}function Ii(t){return this.selectAll(t==null?Ni:ki(typeof t=="function"?t:vn(t)))}function Oi(t){typeof t!="function"&&(t=gn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,u=r[i]=[],s,l=0;l<a;++l)(s=o[l])&&t.call(s,s.__data__,l,o)&&u.push(s);return new G(r,this._parents)}function yn(t){return new Array(t.length)}function Ri(){return new G(this._enter||this._groups.map(yn),this._parents)}function zt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}zt.prototype={constructor:zt,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 Li(t){return function(){return t}}function Vi(t,e,n,r,i,o){for(var a=0,u,s=e.length,l=o.length;a<l;++a)(u=e[a])?(u.__data__=o[a],r[a]=u):n[a]=new zt(t,o[a]);for(;a<s;++a)(u=e[a])&&(i[a]=u)}function Gi(t,e,n,r,i,o,a){var u,s,l=new Map,f=e.length,c=o.length,h=new Array(f),d;for(u=0;u<f;++u)(s=e[u])&&(h[u]=d=a.call(s,s.__data__,u,e)+"",l.has(d)?i[u]=s:l.set(d,s));for(u=0;u<c;++u)d=a.call(t,o[u],u,o)+"",(s=l.get(d))?(r[u]=s,s.__data__=o[u],l.delete(d)):n[u]=new zt(t,o[u]);for(u=0;u<f;++u)(s=e[u])&&l.get(h[u])===s&&(i[u]=s)}function Ui(t){return t.__data__}function Hi(t,e){if(!arguments.length)return Array.from(this,Ui);var n=e?Gi:Vi,r=this._parents,i=this._groups;typeof t!="function"&&(t=Li(t));for(var o=i.length,a=new Array(o),u=new Array(o),s=new Array(o),l=0;l<o;++l){var f=r[l],c=i[l],h=c.length,d=Xi(t.call(f,f&&f.__data__,l,r)),m=d.length,p=u[l]=new Array(m),g=a[l]=new Array(m),A=s[l]=new Array(h);n(f,c,p,g,A,d,e);for(var S=0,_=0,M,w;S<m;++S)if(M=p[S]){for(S>=_&&(_=S+1);!(w=g[_])&&++_<m;);M._next=w||null}}return a=new G(a,r),a._enter=u,a._exit=s,a}function Xi(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Yi(){return new G(this._exit||this._groups.map(yn),this._parents)}function zi(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Wi(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),u=new Array(i),s=0;s<a;++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 G(u,this._parents)}function qi(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function Bi(t){t||(t=ji);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),o=0;o<r;++o){for(var a=n[o],u=a.length,s=i[o]=new Array(u),l,f=0;f<u;++f)(l=a[f])&&(s[f]=l);s.sort(e)}return new G(i,this._parents).order()}function ji(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ki(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Zi(){return Array.from(this)}function Ji(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function Qi(){let t=0;for(const e of this)++t;return t}function to(){return!this.node()}function eo(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,u;o<a;++o)(u=i[o])&&t.call(u,u.__data__,o,i);return this}function no(t){return function(){this.removeAttribute(t)}}function ro(t){return function(){this.removeAttributeNS(t.space,t.local)}}function io(t,e){return function(){this.setAttribute(t,e)}}function oo(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ao(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function uo(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 so(t,e){var n=Yt(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?ro:no:typeof e=="function"?n.local?uo:ao:n.local?oo:io)(n,e))}function wn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function lo(t){return function(){this.style.removeProperty(t)}}function co(t,e,n){return function(){this.style.setProperty(t,e,n)}}function fo(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function ho(t,e,n){return arguments.length>1?this.each((e==null?lo:typeof e=="function"?fo:co)(t,e,n??"")):dt(this.node(),t)}function dt(t,e){return t.style.getPropertyValue(e)||wn(t).getComputedStyle(t,null).getPropertyValue(e)}function po(t){return function(){delete this[t]}}function mo(t,e){return function(){this[t]=e}}function go(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function vo(t,e){return arguments.length>1?this.each((e==null?po:typeof e=="function"?go:mo)(t,e)):this.node()[t]}function bn(t){return t.trim().split(/^|\s+/)}function we(t){return t.classList||new xn(t)}function xn(t){this._node=t,this._names=bn(t.getAttribute("class")||"")}xn.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 _n(t,e){for(var n=we(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function An(t,e){for(var n=we(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function yo(t){return function(){_n(this,t)}}function wo(t){return function(){An(this,t)}}function bo(t,e){return function(){(e.apply(this,arguments)?_n:An)(this,t)}}function xo(t,e){var n=bn(t+"");if(arguments.length<2){for(var r=we(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?bo:e?yo:wo)(n,e))}function _o(){this.textContent=""}function Ao(t){return function(){this.textContent=t}}function $o(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function So(t){return arguments.length?this.each(t==null?_o:(typeof t=="function"?$o:Ao)(t)):this.node().textContent}function Mo(){this.innerHTML=""}function Do(t){return function(){this.innerHTML=t}}function Co(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Eo(t){return arguments.length?this.each(t==null?Mo:(typeof t=="function"?Co:Do)(t)):this.node().innerHTML}function Po(){this.nextSibling&&this.parentNode.appendChild(this)}function To(){return this.each(Po)}function Fo(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function No(){return this.each(Fo)}function ko(t){var e=typeof t=="function"?t:pn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Io(){return null}function Oo(t,e){var n=typeof t=="function"?t:pn(t),r=e==null?Io:typeof e=="function"?e:ye(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ro(){var t=this.parentNode;t&&t.removeChild(this)}function Lo(){return this.each(Ro)}function Vo(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Go(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Uo(t){return this.select(t?Go:Vo)}function Ho(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Xo(t){return function(e){t.call(this,e,this.__data__)}}function Yo(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 zo(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Wo(t,e,n){return function(){var r=this.__on,i,o=Xo(e);if(r){for(var a=0,u=r.length;a<u;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function qo(t,e,n){var r=Yo(t+""),i,o=r.length,a;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<o;++i)if((a=r[i]).type===f.type&&a.name===f.name)return f.value}return}for(u=e?Wo:zo,i=0;i<o;++i)this.each(u(r[i],e,n));return this}function $n(t,e,n){var r=wn(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 Bo(t,e){return function(){return $n(this,t,e)}}function jo(t,e){return function(){return $n(this,t,e.apply(this,arguments))}}function Ko(t,e){return this.each((typeof e=="function"?jo:Bo)(t,e))}function*Zo(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var Sn=[null];function G(t,e){this._groups=t,this._parents=e}function Et(){return new G([[document.documentElement]],Sn)}function Jo(){return this}G.prototype=Et.prototype={constructor:G,select:Ai,selectAll:Di,selectChild:Ti,selectChildren:Ii,filter:Oi,data:Hi,enter:Ri,exit:Yi,join:zi,merge:Wi,selection:Jo,order:qi,sort:Bi,call:Ki,nodes:Zi,node:Ji,size:Qi,empty:to,each:eo,attr:so,style:ho,property:vo,classed:xo,text:So,html:Eo,raise:To,lower:No,append:ko,insert:Oo,remove:Lo,clone:Uo,datum:Ho,on:qo,dispatch:Ko,[Symbol.iterator]:Zo};function Wt(t){return typeof t=="string"?new G([[document.querySelector(t)]],[document.documentElement]):new G([[t]],Sn)}function be(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Mn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Pt(){}var Tt=.7,qt=1/Tt,pt="\\s*([+-]?\\d+)\\s*",Ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",W="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qo=/^#([0-9a-f]{3,8})$/,ta=new RegExp(`^rgb\\(${pt},${pt},${pt}\\)$`),ea=new RegExp(`^rgb\\(${W},${W},${W}\\)$`),na=new RegExp(`^rgba\\(${pt},${pt},${pt},${Ft}\\)$`),ra=new RegExp(`^rgba\\(${W},${W},${W},${Ft}\\)$`),ia=new RegExp(`^hsl\\(${Ft},${W},${W}\\)$`),oa=new RegExp(`^hsla\\(${Ft},${W},${W},${Ft}\\)$`),Dn={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};be(Pt,ot,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Cn,formatHex:Cn,formatHex8:aa,formatHsl:ua,formatRgb:En,toString:En});function Cn(){return this.rgb().formatHex()}function aa(){return this.rgb().formatHex8()}function ua(){return kn(this).formatHsl()}function En(){return this.rgb().formatRgb()}function ot(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Qo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Pn(e):n===3?new L(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Bt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Bt(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=ta.exec(t))?new L(e[1],e[2],e[3],1):(e=ea.exec(t))?new L(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=na.exec(t))?Bt(e[1],e[2],e[3],e[4]):(e=ra.exec(t))?Bt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ia.exec(t))?Nn(e[1],e[2]/100,e[3]/100,1):(e=oa.exec(t))?Nn(e[1],e[2]/100,e[3]/100,e[4]):Dn.hasOwnProperty(t)?Pn(Dn[t]):t==="transparent"?new L(NaN,NaN,NaN,0):null}function Pn(t){return new L(t>>16&255,t>>8&255,t&255,1)}function Bt(t,e,n,r){return r<=0&&(t=e=n=NaN),new L(t,e,n,r)}function sa(t){return t instanceof Pt||(t=ot(t)),t?(t=t.rgb(),new L(t.r,t.g,t.b,t.opacity)):new L}function xe(t,e,n,r){return arguments.length===1?sa(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}be(L,xe,Mn(Pt,{brighter(t){return t=t==null?qt:Math.pow(qt,t),new L(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Tt:Math.pow(Tt,t),new L(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new L(at(this.r),at(this.g),at(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:Tn,formatHex:Tn,formatHex8:la,formatRgb:Fn,toString:Fn}));function Tn(){return`#${ut(this.r)}${ut(this.g)}${ut(this.b)}`}function la(){return`#${ut(this.r)}${ut(this.g)}${ut(this.b)}${ut((isNaN(this.opacity)?1:this.opacity)*255)}`}function Fn(){const t=jt(this.opacity);return`${t===1?"rgb(":"rgba("}${at(this.r)}, ${at(this.g)}, ${at(this.b)}${t===1?")":`, ${t})`}`}function jt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function at(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ut(t){return t=at(t),(t<16?"0":"")+t.toString(16)}function Nn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new H(t,e,n,r)}function kn(t){if(t instanceof H)return new H(t.h,t.s,t.l,t.opacity);if(t instanceof Pt||(t=ot(t)),!t)return new H;if(t instanceof H)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,s=(o+i)/2;return u?(e===o?a=(n-r)/u+(n<r)*6:n===o?a=(r-e)/u+2:a=(e-n)/u+4,u/=s<.5?o+i:2-o-i,a*=60):u=s>0&&s<1?0:a,new H(a,u,s,t.opacity)}function ca(t,e,n,r){return arguments.length===1?kn(t):new H(t,e,n,r??1)}function H(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}be(H,ca,Mn(Pt,{brighter(t){return t=t==null?qt:Math.pow(qt,t),new H(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Tt:Math.pow(Tt,t),new H(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(_e(t>=240?t-240:t+120,i,r),_e(t,i,r),_e(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new H(In(this.h),Kt(this.s),Kt(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("}${In(this.h)}, ${Kt(this.s)*100}%, ${Kt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function In(t){return t=(t||0)%360,t<0?t+360:t}function Kt(t){return Math.max(0,Math.min(1,t||0))}function _e(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 Ae=t=>()=>t;function fa(t,e){return function(n){return t+n*e}}function ha(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 da(t){return(t=+t)==1?On:function(e,n){return n-e?ha(e,n,t):Ae(isNaN(e)?n:e)}}function On(t,e){var n=e-t;return n?fa(t,n):Ae(isNaN(t)?e:t)}const Zt=function t(e){var n=da(e);function r(i,o){var a=n((i=xe(i)).r,(o=xe(o)).r),u=n(i.g,o.g),s=n(i.b,o.b),l=On(i.opacity,o.opacity);return function(f){return i.r=a(f),i.g=u(f),i.b=s(f),i.opacity=l(f),i+""}}return r.gamma=t,r}(1);function pa(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function ma(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ga(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=Me(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(u){for(a=0;a<r;++a)o[a]=i[a](u);return o}}function va(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function X(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function ya(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]=Me(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var $e=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Se=new RegExp($e.source,"g");function wa(t){return function(){return t}}function ba(t){return function(e){return t(e)+""}}function Rn(t,e){var n=$e.lastIndex=Se.lastIndex=0,r,i,o,a=-1,u=[],s=[];for(t=t+"",e=e+"";(r=$e.exec(t))&&(i=Se.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(i=i[0])?u[a]?u[a]+=i:u[++a]=i:(u[++a]=null,s.push({i:a,x:X(r,i)})),n=Se.lastIndex;return n<e.length&&(o=e.slice(n),u[a]?u[a]+=o:u[++a]=o),u.length<2?s[0]?ba(s[0].x):wa(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 Me(t,e){var n=typeof e,r;return e==null||n==="boolean"?Ae(e):(n==="number"?X:n==="string"?(r=ot(e))?(e=r,Zt):Rn:e instanceof ot?Zt:e instanceof Date?va:ma(e)?pa:Array.isArray(e)?ga:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?ya:X)(t,e)}function xa(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Ln=180/Math.PI,De={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Vn(t,e,n,r,i,o){var a,u,s;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(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,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Ln,skewX:Math.atan(s)*Ln,scaleX:a,scaleY:u}}var Jt;function _a(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?De:Vn(e.a,e.b,e.c,e.d,e.e,e.f)}function Aa(t){return t==null||(Jt||(Jt=document.createElementNS("http://www.w3.org/2000/svg","g")),Jt.setAttribute("transform",t),!(t=Jt.transform.baseVal.consolidate()))?De:(t=t.matrix,Vn(t.a,t.b,t.c,t.d,t.e,t.f))}function Gn(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(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:X(l,c)},{i:p-2,x:X(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function a(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:X(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:X(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:X(l,c)},{i:p-2,x:X(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),o(l.translateX,l.translateY,f.translateX,f.translateY,c,h),a(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 $a=Gn(_a,"px, ","px)","deg)"),Sa=Gn(Aa,", ",")",")"),mt=0,Nt=0,kt=0,Un=1e3,Qt,It,te=0,st=0,ee=0,Ot=typeof performance=="object"&&performance.now?performance:Date,Hn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ce(){return st||(Hn(Ma),st=Ot.now()+ee)}function Ma(){st=0}function ne(){this._call=this._time=this._next=null}ne.prototype=Xn.prototype={constructor:ne,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ce():+n)+(e==null?0:+e),!this._next&&It!==this&&(It?It._next=this:Qt=this,It=this),this._call=t,this._time=n,Ee()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ee())}};function Xn(t,e,n){var r=new ne;return r.restart(t,e,n),r}function Da(){Ce(),++mt;for(var t=Qt,e;t;)(e=st-t._time)>=0&&t._call.call(void 0,e),t=t._next;--mt}function Yn(){st=(te=Ot.now())+ee,mt=Nt=0;try{Da()}finally{mt=0,Ea(),st=0}}function Ca(){var t=Ot.now(),e=t-te;e>Un&&(ee-=e,te=t)}function Ea(){for(var t,e=Qt,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:Qt=n);It=t,Ee(r)}function Ee(t){if(!mt){Nt&&(Nt=clearTimeout(Nt));var e=t-st;e>24?(t<1/0&&(Nt=setTimeout(Yn,t-Ot.now()-ee)),kt&&(kt=clearInterval(kt))):(kt||(te=Ot.now(),kt=setInterval(Ca,Un)),mt=1,Hn(Yn))}}function zn(t,e,n){var r=new ne;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Pa=fn("start","end","cancel","interrupt"),Ta=[],Wn=0,qn=1,Pe=2,re=3,Bn=4,Te=5,ie=6;function oe(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;Fa(t,n,{name:e,index:r,group:i,on:Pa,tween:Ta,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Wn})}function Fe(t,e){var n=Y(t,e);if(n.state>Wn)throw new Error("too late; already scheduled");return n}function q(t,e){var n=Y(t,e);if(n.state>re)throw new Error("too late; already running");return n}function Y(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Fa(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Xn(o,0,n.time);function o(l){n.state=qn,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(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===re)return zn(a);d.state===Bn?(d.state=ie,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=ie,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(zn(function(){n.state===re&&(n.state=Bn,n.timer.restart(u,n.delay,n.time),u(l))}),n.state=Pe,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Pe){for(n.state=re,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=Te,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===Te&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){n.state=ie,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Na(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>Pe&&r.state<Te,r.state=ie,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function ka(t){return this.each(function(){Na(this,t)})}function Ia(t,e){var n,r;return function(){var i=q(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,u=r.length;a<u;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function Oa(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=q(this,t),a=o.tween;if(a!==r){i=(r=a).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)}o.tween=i}}function Ra(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Y(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?Ia:Oa)(n,t,e))}function Ne(t,e,n){var r=t._id;return t.each(function(){var i=q(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Y(i,r).value[e]}}function jn(t,e){var n;return(typeof e=="number"?X:e instanceof ot?Zt:(n=ot(e))?(e=n,Zt):Rn)(t,e)}function La(t){return function(){this.removeAttribute(t)}}function Va(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ga(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function Ua(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function Ha(t,e,n){var r,i,o;return function(){var a,u=n(this),s;return u==null?void this.removeAttribute(t):(a=this.getAttribute(t),s=u+"",a===s?null:a===r&&s===i?o:(i=s,o=e(r=a,u)))}}function Xa(t,e,n){var r,i,o;return function(){var a,u=n(this),s;return u==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),s=u+"",a===s?null:a===r&&s===i?o:(i=s,o=e(r=a,u)))}}function Ya(t,e){var n=Yt(t),r=n==="transform"?Sa:jn;return this.attrTween(t,typeof e=="function"?(n.local?Xa:Ha)(n,r,Ne(this,"attr."+t,e)):e==null?(n.local?Va:La)(n):(n.local?Ua:Ga)(n,r,e))}function za(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Wa(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function qa(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Wa(t,o)),n}return i._value=e,i}function Ba(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&za(t,o)),n}return i._value=e,i}function ja(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=Yt(t);return this.tween(n,(r.local?qa:Ba)(r,e))}function Ka(t,e){return function(){Fe(this,t).delay=+e.apply(this,arguments)}}function Za(t,e){return e=+e,function(){Fe(this,t).delay=e}}function Ja(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ka:Za)(e,t)):Y(this.node(),e).delay}function Qa(t,e){return function(){q(this,t).duration=+e.apply(this,arguments)}}function tu(t,e){return e=+e,function(){q(this,t).duration=e}}function eu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Qa:tu)(e,t)):Y(this.node(),e).duration}function nu(t,e){if(typeof e!="function")throw new Error;return function(){q(this,t).ease=e}}function ru(t){var e=this._id;return arguments.length?this.each(nu(e,t)):Y(this.node(),e).ease}function iu(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;q(this,t).ease=n}}function ou(t){if(typeof t!="function")throw new Error;return this.each(iu(this._id,t))}function au(t){typeof t!="function"&&(t=gn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,u=r[i]=[],s,l=0;l<a;++l)(s=o[l])&&t.call(s,s.__data__,l,o)&&u.push(s);return new K(r,this._parents,this._name,this._id)}function uu(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s=e[u],l=n[u],f=s.length,c=a[u]=new Array(f),h,d=0;d<f;++d)(h=s[d]||l[d])&&(c[d]=h);for(;u<r;++u)a[u]=e[u];return new K(a,this._parents,this._name,this._id)}function su(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 lu(t,e,n){var r,i,o=su(e)?Fe:q;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}function cu(t,e){var n=this._id;return arguments.length<2?Y(this.node(),n).on.on(t):this.each(lu(n,t,e))}function fu(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function hu(){return this.on("end.remove",fu(this._id))}function du(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ye(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var u=r[a],s=u.length,l=o[a]=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,oe(l[h],e,n,h,l,Y(f,n)));return new K(o,this._parents,e,n)}function pu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=mn(t));for(var r=this._groups,i=r.length,o=[],a=[],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=Y(f,n),p=0,g=h.length;p<g;++p)(d=h[p])&&oe(d,e,n,p,h,m);o.push(h),a.push(f)}return new K(o,a,e,n)}var mu=Et.prototype.constructor;function gu(){return new mu(this._groups,this._parents)}function vu(t,e){var n,r,i;return function(){var o=dt(this,t),a=(this.style.removeProperty(t),dt(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function Kn(t){return function(){this.style.removeProperty(t)}}function yu(t,e,n){var r,i=n+"",o;return function(){var a=dt(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function wu(t,e,n){var r,i,o;return function(){var a=dt(this,t),u=n(this),s=u+"";return u==null&&(s=u=(this.style.removeProperty(t),dt(this,t))),a===s?null:a===r&&s===i?o:(i=s,o=e(r=a,u))}}function bu(t,e){var n,r,i,o="style."+e,a="end."+o,u;return function(){var s=q(this,t),l=s.on,f=s.value[o]==null?u||(u=Kn(e)):void 0;(l!==n||i!==f)&&(r=(n=l).copy()).on(a,i=f),s.on=r}}function xu(t,e,n){var r=(t+="")=="transform"?$a:jn;return e==null?this.styleTween(t,vu(t,r)).on("end.style."+t,Kn(t)):typeof e=="function"?this.styleTween(t,wu(t,r,Ne(this,"style."+t,e))).each(bu(this._id,t)):this.styleTween(t,yu(t,r,e),n).on("end.style."+t,null)}function _u(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Au(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&_u(t,a,n)),r}return o._value=e,o}function $u(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,Au(t,e,n??""))}function Su(t){return function(){this.textContent=t}}function Mu(t){return function(){var e=t(this);this.textContent=e??""}}function Du(t){return this.tween("text",typeof t=="function"?Mu(Ne(this,"text",t)):Su(t==null?"":t+""))}function Cu(t){return function(e){this.textContent=t.call(this,e)}}function Eu(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Cu(i)),e}return r._value=t,r}function Pu(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,Eu(t))}function Tu(){for(var t=this._name,e=this._id,n=Zn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],u=a.length,s,l=0;l<u;++l)if(s=a[l]){var f=Y(s,e);oe(s,t,n,l,a,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new K(r,this._parents,t,n)}function Fu(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var u={value:a},s={value:function(){--i===0&&o()}};n.each(function(){var l=q(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&&o()})}var Nu=0;function K(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Zn(){return++Nu}var Z=Et.prototype;K.prototype={constructor:K,select:du,selectAll:pu,selectChild:Z.selectChild,selectChildren:Z.selectChildren,filter:au,merge:uu,selection:gu,transition:Tu,call:Z.call,nodes:Z.nodes,node:Z.node,size:Z.size,empty:Z.empty,each:Z.each,on:cu,attr:Ya,attrTween:ja,style:xu,styleTween:$u,text:Du,textTween:Pu,remove:hu,tween:Ra,delay:Ja,duration:eu,ease:ru,easeVarying:ou,end:Fu,[Symbol.iterator]:Z[Symbol.iterator]};function ku(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Iu={time:null,delay:0,duration:250,ease:ku};function Ou(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 Ru(t){var e,n;t instanceof K?(e=t._id,t=t._name):(e=Zn(),(n=Iu).time=Ce(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],u=a.length,s,l=0;l<u;++l)(s=a[l])&&oe(s,t,e,l,a,n||Ou(s,e));return new K(r,this._parents,t,e)}Et.prototype.interrupt=ka,Et.prototype.transition=Ru;function Lu(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ae(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 gt(t){return t=ae(Math.abs(t)),t?t[1]:NaN}function Vu(t,e){return function(n,r){for(var i=n.length,o=[],a=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),o.push(n.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[a=(a+1)%t.length];return o.reverse().join(e)}}function Gu(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Uu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ue(t){if(!(e=Uu.exec(t)))throw new Error("invalid format: "+t);var e;return new ke({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]})}ue.prototype=ke.prototype;function ke(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+""}ke.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 Hu(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 Jn;function Xu(t,e){var n=ae(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Jn=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ae(t,Math.max(0,e+o-1))[0]}function Qn(t,e){var n=ae(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 tr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Lu,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)=>Qn(t*100,e),r:Qn,s:Xu,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function er(t){return t}var nr=Array.prototype.map,rr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Yu(t){var e=t.grouping===void 0||t.thousands===void 0?er:Vu(nr.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?er:Gu(nr.call(t.numerals,String)),a=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=ue(c);var h=c.fill,d=c.align,m=c.sign,p=c.symbol,g=c.zero,A=c.width,S=c.comma,_=c.precision,M=c.trim,w=c.type;w==="n"?(S=!0,w="g"):tr[w]||(_===void 0&&(_=12),M=!0,w="g"),(g||h==="0"&&d==="=")&&(g=!0,h="0",d="=");var D=p==="$"?n:p==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",v=p==="$"?r:/[%p]/.test(w)?a:"",$=tr[w],b=/[defgprs%]/.test(w);_=_===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function F(y){var N=D,E=v,z,Mt,Dt;if(w==="c")E=$(y)+E,y="";else{y=+y;var tt=y<0||1/y<0;if(y=isNaN(y)?s:$(Math.abs(y),_),M&&(y=Hu(y)),tt&&+y==0&&m!=="+"&&(tt=!1),N=(tt?m==="("?m:u:m==="-"||m==="("?"":m)+N,E=(w==="s"?rr[8+Jn/3]:"")+E+(tt&&m==="("?")":""),b){for(z=-1,Mt=y.length;++z<Mt;)if(Dt=y.charCodeAt(z),48>Dt||Dt>57){E=(Dt===46?i+y.slice(z+1):y.slice(z))+E,y=y.slice(0,z);break}}}S&&!g&&(y=e(y,1/0));var ft=N.length+y.length+E.length,et=ft<A?new Array(A-ft+1).join(h):"";switch(S&&g&&(y=e(et+y,et.length?A-E.length:1/0),et=""),d){case"<":y=N+y+E+et;break;case"=":y=N+et+y+E;break;case"^":y=et.slice(0,ft=et.length>>1)+N+y+E+et.slice(ft);break;default:y=et+N+y+E;break}return o(y)}return F.toString=function(){return c+""},F}function f(c,h){var d=l((c=ue(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor(gt(h)/3)))*3,p=Math.pow(10,-m),g=rr[8+m/3];return function(A){return d(p*A)+g}}return{format:l,formatPrefix:f}}var se,Ie,ir;zu({thousands:",",grouping:[3],currency:["$",""]});function zu(t){return se=Yu(t),Ie=se.format,ir=se.formatPrefix,se}function Wu(t){return Math.max(0,-gt(Math.abs(t)))}function qu(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(gt(e)/3)))*3-gt(Math.abs(t)))}function Bu(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,gt(e)-gt(t))+1}function le(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const or=Symbol("implicit");function ar(){var t=new ln,e=[],n=[],r=or;function i(o){let a=t.get(o);if(a===void 0){if(r!==or)return r;t.set(o,a=e.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new ln;for(const a of o)t.has(a)||t.set(a,e.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return ar(e,n).unknown(r)},le.apply(i,arguments),i}function ur(){var t=ar().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,a,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;o=(p-m)/Math.max(1,h-s+l*2),u&&(o=Math.floor(o)),m+=(p-m-o*(h-s))*f,a=o*(1-s),u&&(m=Math.round(m),a=Math.round(a));var g=gi(h).map(function(A){return m+o*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 a},t.step=function(){return o},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 ur(e(),[r,i]).round(u).paddingInner(s).paddingOuter(l).align(f)},le.apply(c(),arguments)}function sr(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return sr(e())},t}function ju(){return sr(ur.apply(null,arguments).paddingInner(1))}function Ku(t){return function(){return t}}function Zu(t){return+t}var lr=[0,1];function vt(t){return t}function Oe(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Ku(isNaN(e)?NaN:.5)}function Ju(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Qu(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Oe(i,r),o=n(a,o)):(r=Oe(r,i),o=n(o,a)),function(u){return o(r(u))}}function ts(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Oe(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(u){var s=sn(t,u,1,r)-1;return o[s](i[s](u))}}function es(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ns(){var t=lr,e=lr,n=Me,r,i,o,a=vt,u,s,l;function f(){var h=Math.min(t.length,e.length);return a!==vt&&(a=Ju(t[0],t[h-1])),u=h>2?ts:Qu,s=l=null,c}function c(h){return h==null||isNaN(h=+h)?o:(s||(s=u(t.map(r),e,n)))(r(a(h)))}return c.invert=function(h){return a(i((l||(l=u(e,t.map(r),X)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,Zu),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=xa,f()},c.clamp=function(h){return arguments.length?(a=h?!0:vt,f()):a!==vt},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(o=h,c):o},function(h,d){return r=h,i=d,f()}}function rs(){return ns()(vt,vt)}function is(t,e,n,r){var i=mi(t,e,n),o;switch(r=ue(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=qu(i,a))&&(r.precision=o),ir(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Bu(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Wu(i))&&(r.precision=o-(r.type==="%")*2);break}}return Ie(r)}function cr(t){var e=t.domain;return t.ticks=function(n){var r=e();return pi(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return is(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],u=r[o],s,l,f=10;for(u<a&&(l=a,a=u,u=l,l=i,i=o,o=l);f-- >0;){if(l=ge(a,u,n),l===s)return r[i]=a,r[o]=u,e(r);if(l>0)a=Math.floor(a/l)*l,u=Math.ceil(u/l)*l;else if(l<0)a=Math.ceil(a*l)/l,u=Math.floor(u*l)/l;else break;s=l}return t},t}function fr(){var t=rs();return t.copy=function(){return es(t,fr())},le.apply(t,arguments),cr(t)}function hr(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(s){return s!=null&&s<=s?i[sn(r,s,0,n)]:o}function u(){var s=-1;for(r=new Array(n);++s<n;)r[s]=((s+1)*e-(s-n)*t)/(n+1);return a}return a.domain=function(s){return arguments.length?([t,e]=s,t=+t,e=+e,u()):[t,e]},a.range=function(s){return arguments.length?(n=(i=Array.from(s)).length-1,u()):i.slice()},a.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]]},a.unknown=function(s){return arguments.length&&(o=s),a},a.thresholds=function(){return r.slice()},a.copy=function(){return hr().domain([t,e]).range(i).unknown(o)},le.apply(cr(a),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 B(t){return Object.prototype.toString.call(t)==="[object Object]"}function os(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function nt(t,e){if(B(t)===!1||B(e)===!1)return Object.assign({},e);const n=(r,i)=>{const o=Object.assign({},i);for(let a of Object.keys(r)){if(!(a in i))continue;let u;B(r[a])&&B(i[a])?(u=n(r[a],i[a]),o[a]=u):o[a]=r[a]}return o};return n(t,e)}function as(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 us(t,e){return e instanceof Function?e(t):Ie(e)(t)}function ce(t,e,n){return`${t}_${e}_${n}`}function Re(t,e){return`${t}_series${e}`}function dr(t,e){return`${t}_group${e}`}function pr(t,e){const n=e.grid.seriesType==="row"?e.grid.rowLabels:e.grid.columnLabels;return t.map((r,i)=>n[i]!=null?n[i]:Re("grid",i))}function mr(t,e){if(t[0]==null)return[];const n=e.grid.seriesType==="row"?e.grid.columnLabels:e.grid.rowLabels;return t[0].map((r,i)=>n[i]!=null?n[i]:dr("grid",i))}function yt(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 fe(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return yt(e)}function ss(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||B(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return yt(n)}function Le(t){const n=t.flat().filter(r=>(r==null||B(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return yt(n)}function ls(t){const n=t.flat().flat().filter(r=>(r==null||B(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return yt(n)}function cs(t,e=2){const r=t.flat().filter((i,o)=>o==e).filter(i=>(i==null||B(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return yt(r)}function gr(t,e){if(t==="row")return Object.assign([],e);const n=e.length,r=e.reduce((o,a)=>Math.max(o,a.length),0),i=new Array(r).fill(null).map(()=>new Array(n).fill(null));for(let o=0;o<n;o++)for(let a=0;a<r;a++)i[a][o]=e[o][a];return i}function fs(t,e){const n=new Map;let r=Object.assign([],t),i=[];return r.forEach((o,a)=>{Array.isArray(o)?o.forEach((u,s)=>{i.push({rowIndex:a,columnIndex:s,index:-1,datum:u})}):i.push({rowIndex:a,columnIndex:0,index:-1,datum:o})}),i.sort((o,a)=>e(o.datum,a.datum)),i=i.map((o,a)=>({...o,index:a})),i.forEach(o=>{n.set(String([o.rowIndex,o.columnIndex]),o.index)}),n}const hs=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i=[];try{const o=(u=>{if(u){const s=fs(e,n.sort);return(l,f,c)=>s.get(String([f,c]))}else return(s,l,f)=>s.length})(n.sort!=null),a=(u,s,l,f,c)=>{const h=ce(n.type,s,l),d=n.seriesLabels[s]||Re("series",s),m=n.colorsPredicate(u,s,l,t),p=n.visibleFilter(u,s,l,t);return typeof u=="number"?{id:h,index:f,sortedIndex:c,label:h,tooltipContent:n.tooltipContentFormat(u,s,l,t),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,tooltipContent:u.tooltipContent?u.tooltipContent:n.tooltipContentFormat(u,s,l,t),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=o(i,s,f),h=a(l,s,f,i.length,c);i.push(h)});else{const l=o(i,s,0),f=a(u,s,0,i.length,l);i.push(f)}})}catch(o){throw Error(o)}return i};var Ve=function(t,e){return Ve=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])},Ve(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");Ve(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(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(f){try{l(r.next(f))}catch(c){a(c)}}function s(f){try{l(r.throw(f))}catch(c){a(c)}}function l(f){f.done?o(f.value):i(f.value).then(u,s)}l((r=r.apply(t,e||[])).next())})}function vr(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(l){return function(f){return s([l,f])}}function s(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=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(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(f){l=[6,f],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function wt(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,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function it(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function bt(t){return this instanceof bt?(this.v=t,this):new bt(t)}function ps(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(h){r[h]&&(i[h]=function(d){return new Promise(function(m,p){o.push([h,d,m,p])>1||u(h,d)})})}function u(h,d){try{s(r[h](d))}catch(m){c(o[0][3],m)}}function s(h){h.value instanceof bt?Promise.resolve(h.value.v).then(l,f):c(o[0][2],h)}function l(h){u("next",h)}function f(h){u("throw",h)}function c(h,d){h(d),o.shift(),o.length&&u(o[0][0],o[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 wt=="function"?wt(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(u,s){a=t[o](a),i(u,s,a.done,a.value)})}}function i(o,a,u,s){Promise.resolve(s).then(function(l){o({value:l,done:u})},a)}}typeof SuppressedError=="function"&&SuppressedError;function P(t){return typeof t=="function"}function Ge(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 Ue=Ge(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
1
|
+
(function(x,Ct){typeof exports=="object"&&typeof module<"u"?Ct(exports):typeof define=="function"&&define.amd?define(["exports"],Ct):(x=typeof globalThis<"u"?globalThis:x||self,Ct(x["orbcharts-core"]={}))})(this,function(x){"use strict";const Ct={preset:{}},rn={top:60,right:60,bottom:60,left:60},on={padding:rn,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:"#f0f0f0",background:"#ffffff"},dark:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#f0f0f0",secondary:"#e1e1e1",white:"#f0f0f0",background:"#000000"}},styles:{textSize:14,unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},Kr=800,Zr=500,ht={type:"",visibleFilter:(t,e,n,r)=>!0,tooltipContentFormat:(t,e,n,r)=>{if(typeof t=="object"){if(t.tooltipContent)return t.tooltipContent;if(t.value)return String(t.value)}else return typeof t=="number"?String(t):""}},j={position:"left",scaleDomain:[0,"auto"],scaleRange:[0,.9],label:""},Jr={position:"bottom",scaleDomain:[0,"auto"],scalePadding:.5,label:""},Qr={...ht,type:"series",unitLabel:"",seriesLabels:[],colorsPredicate:(t,e,n,{chartParams:r})=>e<r.colors[r.colorScheme].series.length?r.colors[r.colorScheme].series[e]:r.colors[r.colorScheme].series[e%r.colors[r.colorScheme].series.length],sort:null},ti={...ht,type:"grid",grid:{rowLabels:[],columnLabels:[],seriesType:"row"},valueAxis:{...j},groupAxis:{...Jr},colorsPredicate:(t,e,n,{chartParams:r,dataFormatter:i})=>{const o=i.grid.seriesType==="row"?e:n;return r.colors[r.colorScheme].series[o]}},ei={...ht,type:"multiGrid",multiGrid:[]},ni={...ht,type:"multiValue",multiValue:[],xAxis:{...j},yAxis:{...j}},ri={...ht,type:"tree"},ii={...ht,type:"relationship"};function zt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function oi(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function an(t){let e,n,r;t.length!==2?(e=zt,n=(u,s)=>zt(t(u),s),r=(u,s)=>t(u)-s):(e=t===zt||t===oi?t:ai,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 o(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){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:a,right:o}}function ai(){return 0}function ui(t){return t===null?NaN:+t}const un=an(zt).right;an(ui).center;class sn extends Map{constructor(e,n=ci){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(ln(this,e))}has(e){return super.has(ln(this,e))}set(e,n){return super.set(si(this,e),n)}delete(e){return super.delete(li(this,e))}}function ln({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function si({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function li({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function ci(t){return t!==null&&typeof t=="object"?t.valueOf():t}const fi=Math.sqrt(50),hi=Math.sqrt(10),di=Math.sqrt(2);function Ut(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=fi?10:o>=hi?5:o>=di?2:1;let u,s,l;return i<0?(l=Math.pow(10,-i)/a,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)*a,u=Math.round(t/l),s=Math.round(e/l),u*l<t&&++u,s*l>e&&--s),s<u&&.5<=n&&n<2?Ut(t,e,n*2):[u,s,l]}function pi(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?Ut(e,t,n):Ut(t,e,n);if(!(o>=i))return[];const u=o-i+1,s=new Array(u);if(r)if(a<0)for(let l=0;l<u;++l)s[l]=(o-l)/-a;else for(let l=0;l<u;++l)s[l]=(o-l)*a;else if(a<0)for(let l=0;l<u;++l)s[l]=(i+l)/-a;else for(let l=0;l<u;++l)s[l]=(i+l)*a;return s}function ge(t,e,n){return e=+e,t=+t,n=+n,Ut(t,e,n)[2]}function mi(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?ge(e,t,n):ge(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function gi(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}var vi={value:()=>{}};function cn(){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 Ht(n)}function Ht(t){this._=t}function yi(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}})}Ht.prototype=cn.prototype={constructor:Ht,on:function(t,e){var n=this._,r=yi(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=wi(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=fn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=fn(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 Ht(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function wi(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function fn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=vi,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var ve="http://www.w3.org/1999/xhtml";const hn={svg:"http://www.w3.org/2000/svg",xhtml:ve,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Xt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),hn.hasOwnProperty(e)?{space:hn[e],local:t}:t}function bi(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ve&&e.documentElement.namespaceURI===ve?e.createElement(t):e.createElementNS(n,t)}}function xi(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function dn(t){var e=Xt(t);return(e.local?xi:bi)(e)}function _i(){}function ye(t){return t==null?_i:function(){return this.querySelector(t)}}function Ai(t){typeof t!="function"&&(t=ye(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,u=r[i]=new Array(a),s,l,f=0;f<a;++f)(s=o[f])&&(l=t.call(s,s.__data__,f,o))&&("__data__"in s&&(l.__data__=s.__data__),u[f]=l);return new G(r,this._parents)}function $i(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Si(){return[]}function pn(t){return t==null?Si:function(){return this.querySelectorAll(t)}}function Mi(t){return function(){return $i(t.apply(this,arguments))}}function Di(t){typeof t=="function"?t=Mi(t):t=pn(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],u=a.length,s,l=0;l<u;++l)(s=a[l])&&(r.push(t.call(s,s.__data__,l,a)),i.push(s));return new G(r,i)}function mn(t){return function(){return this.matches(t)}}function gn(t){return function(e){return e.matches(t)}}var Ci=Array.prototype.find;function Ei(t){return function(){return Ci.call(this.children,t)}}function Pi(){return this.firstElementChild}function Ti(t){return this.select(t==null?Pi:Ei(typeof t=="function"?t:gn(t)))}var Fi=Array.prototype.filter;function Ni(){return Array.from(this.children)}function ki(t){return function(){return Fi.call(this.children,t)}}function Oi(t){return this.selectAll(t==null?Ni:ki(typeof t=="function"?t:gn(t)))}function Ii(t){typeof t!="function"&&(t=mn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,u=r[i]=[],s,l=0;l<a;++l)(s=o[l])&&t.call(s,s.__data__,l,o)&&u.push(s);return new G(r,this._parents)}function vn(t){return new Array(t.length)}function Ri(){return new G(this._enter||this._groups.map(vn),this._parents)}function Yt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Yt.prototype={constructor:Yt,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 Li(t){return function(){return t}}function Vi(t,e,n,r,i,o){for(var a=0,u,s=e.length,l=o.length;a<l;++a)(u=e[a])?(u.__data__=o[a],r[a]=u):n[a]=new Yt(t,o[a]);for(;a<s;++a)(u=e[a])&&(i[a]=u)}function Gi(t,e,n,r,i,o,a){var u,s,l=new Map,f=e.length,c=o.length,h=new Array(f),d;for(u=0;u<f;++u)(s=e[u])&&(h[u]=d=a.call(s,s.__data__,u,e)+"",l.has(d)?i[u]=s:l.set(d,s));for(u=0;u<c;++u)d=a.call(t,o[u],u,o)+"",(s=l.get(d))?(r[u]=s,s.__data__=o[u],l.delete(d)):n[u]=new Yt(t,o[u]);for(u=0;u<f;++u)(s=e[u])&&l.get(h[u])===s&&(i[u]=s)}function zi(t){return t.__data__}function Ui(t,e){if(!arguments.length)return Array.from(this,zi);var n=e?Gi:Vi,r=this._parents,i=this._groups;typeof t!="function"&&(t=Li(t));for(var o=i.length,a=new Array(o),u=new Array(o),s=new Array(o),l=0;l<o;++l){var f=r[l],c=i[l],h=c.length,d=Hi(t.call(f,f&&f.__data__,l,r)),m=d.length,p=u[l]=new Array(m),v=a[l]=new Array(m),A=s[l]=new Array(h);n(f,c,p,v,A,d,e);for(var S=0,_=0,M,w;S<m;++S)if(M=p[S]){for(S>=_&&(_=S+1);!(w=v[_])&&++_<m;);M._next=w||null}}return a=new G(a,r),a._enter=u,a._exit=s,a}function Hi(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Xi(){return new G(this._exit||this._groups.map(vn),this._parents)}function Yi(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Wi(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),u=new Array(i),s=0;s<a;++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 G(u,this._parents)}function Bi(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function qi(t){t||(t=ji);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),o=0;o<r;++o){for(var a=n[o],u=a.length,s=i[o]=new Array(u),l,f=0;f<u;++f)(l=a[f])&&(s[f]=l);s.sort(e)}return new G(i,this._parents).order()}function ji(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ki(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Zi(){return Array.from(this)}function Ji(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function Qi(){let t=0;for(const e of this)++t;return t}function to(){return!this.node()}function eo(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,u;o<a;++o)(u=i[o])&&t.call(u,u.__data__,o,i);return this}function no(t){return function(){this.removeAttribute(t)}}function ro(t){return function(){this.removeAttributeNS(t.space,t.local)}}function io(t,e){return function(){this.setAttribute(t,e)}}function oo(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ao(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function uo(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 so(t,e){var n=Xt(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?ro:no:typeof e=="function"?n.local?uo:ao:n.local?oo:io)(n,e))}function yn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function lo(t){return function(){this.style.removeProperty(t)}}function co(t,e,n){return function(){this.style.setProperty(t,e,n)}}function fo(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function ho(t,e,n){return arguments.length>1?this.each((e==null?lo:typeof e=="function"?fo:co)(t,e,n??"")):dt(this.node(),t)}function dt(t,e){return t.style.getPropertyValue(e)||yn(t).getComputedStyle(t,null).getPropertyValue(e)}function po(t){return function(){delete this[t]}}function mo(t,e){return function(){this[t]=e}}function go(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function vo(t,e){return arguments.length>1?this.each((e==null?po:typeof e=="function"?go:mo)(t,e)):this.node()[t]}function wn(t){return t.trim().split(/^|\s+/)}function we(t){return t.classList||new bn(t)}function bn(t){this._node=t,this._names=wn(t.getAttribute("class")||"")}bn.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 xn(t,e){for(var n=we(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function _n(t,e){for(var n=we(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function yo(t){return function(){xn(this,t)}}function wo(t){return function(){_n(this,t)}}function bo(t,e){return function(){(e.apply(this,arguments)?xn:_n)(this,t)}}function xo(t,e){var n=wn(t+"");if(arguments.length<2){for(var r=we(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?bo:e?yo:wo)(n,e))}function _o(){this.textContent=""}function Ao(t){return function(){this.textContent=t}}function $o(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function So(t){return arguments.length?this.each(t==null?_o:(typeof t=="function"?$o:Ao)(t)):this.node().textContent}function Mo(){this.innerHTML=""}function Do(t){return function(){this.innerHTML=t}}function Co(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Eo(t){return arguments.length?this.each(t==null?Mo:(typeof t=="function"?Co:Do)(t)):this.node().innerHTML}function Po(){this.nextSibling&&this.parentNode.appendChild(this)}function To(){return this.each(Po)}function Fo(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function No(){return this.each(Fo)}function ko(t){var e=typeof t=="function"?t:dn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Oo(){return null}function Io(t,e){var n=typeof t=="function"?t:dn(t),r=e==null?Oo:typeof e=="function"?e:ye(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ro(){var t=this.parentNode;t&&t.removeChild(this)}function Lo(){return this.each(Ro)}function Vo(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Go(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function zo(t){return this.select(t?Go:Vo)}function Uo(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ho(t){return function(e){t.call(this,e,this.__data__)}}function Xo(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 Yo(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Wo(t,e,n){return function(){var r=this.__on,i,o=Ho(e);if(r){for(var a=0,u=r.length;a<u;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Bo(t,e,n){var r=Xo(t+""),i,o=r.length,a;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<o;++i)if((a=r[i]).type===f.type&&a.name===f.name)return f.value}return}for(u=e?Wo:Yo,i=0;i<o;++i)this.each(u(r[i],e,n));return this}function An(t,e,n){var r=yn(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 qo(t,e){return function(){return An(this,t,e)}}function jo(t,e){return function(){return An(this,t,e.apply(this,arguments))}}function Ko(t,e){return this.each((typeof e=="function"?jo:qo)(t,e))}function*Zo(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var $n=[null];function G(t,e){this._groups=t,this._parents=e}function Et(){return new G([[document.documentElement]],$n)}function Jo(){return this}G.prototype=Et.prototype={constructor:G,select:Ai,selectAll:Di,selectChild:Ti,selectChildren:Oi,filter:Ii,data:Ui,enter:Ri,exit:Xi,join:Yi,merge:Wi,selection:Jo,order:Bi,sort:qi,call:Ki,nodes:Zi,node:Ji,size:Qi,empty:to,each:eo,attr:so,style:ho,property:vo,classed:xo,text:So,html:Eo,raise:To,lower:No,append:ko,insert:Io,remove:Lo,clone:zo,datum:Uo,on:Bo,dispatch:Ko,[Symbol.iterator]:Zo};function Wt(t){return typeof t=="string"?new G([[document.querySelector(t)]],[document.documentElement]):new G([[t]],$n)}function be(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Sn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Pt(){}var Tt=.7,Bt=1/Tt,pt="\\s*([+-]?\\d+)\\s*",Ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",W="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qo=/^#([0-9a-f]{3,8})$/,ta=new RegExp(`^rgb\\(${pt},${pt},${pt}\\)$`),ea=new RegExp(`^rgb\\(${W},${W},${W}\\)$`),na=new RegExp(`^rgba\\(${pt},${pt},${pt},${Ft}\\)$`),ra=new RegExp(`^rgba\\(${W},${W},${W},${Ft}\\)$`),ia=new RegExp(`^hsl\\(${Ft},${W},${W}\\)$`),oa=new RegExp(`^hsla\\(${Ft},${W},${W},${Ft}\\)$`),Mn={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};be(Pt,ot,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Dn,formatHex:Dn,formatHex8:aa,formatHsl:ua,formatRgb:Cn,toString:Cn});function Dn(){return this.rgb().formatHex()}function aa(){return this.rgb().formatHex8()}function ua(){return Nn(this).formatHsl()}function Cn(){return this.rgb().formatRgb()}function ot(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Qo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?En(e):n===3?new L(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?qt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?qt(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=ta.exec(t))?new L(e[1],e[2],e[3],1):(e=ea.exec(t))?new L(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=na.exec(t))?qt(e[1],e[2],e[3],e[4]):(e=ra.exec(t))?qt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ia.exec(t))?Fn(e[1],e[2]/100,e[3]/100,1):(e=oa.exec(t))?Fn(e[1],e[2]/100,e[3]/100,e[4]):Mn.hasOwnProperty(t)?En(Mn[t]):t==="transparent"?new L(NaN,NaN,NaN,0):null}function En(t){return new L(t>>16&255,t>>8&255,t&255,1)}function qt(t,e,n,r){return r<=0&&(t=e=n=NaN),new L(t,e,n,r)}function sa(t){return t instanceof Pt||(t=ot(t)),t?(t=t.rgb(),new L(t.r,t.g,t.b,t.opacity)):new L}function xe(t,e,n,r){return arguments.length===1?sa(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}be(L,xe,Sn(Pt,{brighter(t){return t=t==null?Bt:Math.pow(Bt,t),new L(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Tt:Math.pow(Tt,t),new L(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new L(at(this.r),at(this.g),at(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:Pn,formatHex:Pn,formatHex8:la,formatRgb:Tn,toString:Tn}));function Pn(){return`#${ut(this.r)}${ut(this.g)}${ut(this.b)}`}function la(){return`#${ut(this.r)}${ut(this.g)}${ut(this.b)}${ut((isNaN(this.opacity)?1:this.opacity)*255)}`}function Tn(){const t=jt(this.opacity);return`${t===1?"rgb(":"rgba("}${at(this.r)}, ${at(this.g)}, ${at(this.b)}${t===1?")":`, ${t})`}`}function jt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function at(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ut(t){return t=at(t),(t<16?"0":"")+t.toString(16)}function Fn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new U(t,e,n,r)}function Nn(t){if(t instanceof U)return new U(t.h,t.s,t.l,t.opacity);if(t instanceof Pt||(t=ot(t)),!t)return new U;if(t instanceof U)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,s=(o+i)/2;return u?(e===o?a=(n-r)/u+(n<r)*6:n===o?a=(r-e)/u+2:a=(e-n)/u+4,u/=s<.5?o+i:2-o-i,a*=60):u=s>0&&s<1?0:a,new U(a,u,s,t.opacity)}function ca(t,e,n,r){return arguments.length===1?Nn(t):new U(t,e,n,r??1)}function U(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}be(U,ca,Sn(Pt,{brighter(t){return t=t==null?Bt:Math.pow(Bt,t),new U(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Tt:Math.pow(Tt,t),new U(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(_e(t>=240?t-240:t+120,i,r),_e(t,i,r),_e(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new U(kn(this.h),Kt(this.s),Kt(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("}${kn(this.h)}, ${Kt(this.s)*100}%, ${Kt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function kn(t){return t=(t||0)%360,t<0?t+360:t}function Kt(t){return Math.max(0,Math.min(1,t||0))}function _e(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 Ae=t=>()=>t;function fa(t,e){return function(n){return t+n*e}}function ha(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 da(t){return(t=+t)==1?On:function(e,n){return n-e?ha(e,n,t):Ae(isNaN(e)?n:e)}}function On(t,e){var n=e-t;return n?fa(t,n):Ae(isNaN(t)?e:t)}const Zt=function t(e){var n=da(e);function r(i,o){var a=n((i=xe(i)).r,(o=xe(o)).r),u=n(i.g,o.g),s=n(i.b,o.b),l=On(i.opacity,o.opacity);return function(f){return i.r=a(f),i.g=u(f),i.b=s(f),i.opacity=l(f),i+""}}return r.gamma=t,r}(1);function pa(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function ma(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ga(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=Me(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(u){for(a=0;a<r;++a)o[a]=i[a](u);return o}}function va(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function H(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function ya(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]=Me(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var $e=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Se=new RegExp($e.source,"g");function wa(t){return function(){return t}}function ba(t){return function(e){return t(e)+""}}function In(t,e){var n=$e.lastIndex=Se.lastIndex=0,r,i,o,a=-1,u=[],s=[];for(t=t+"",e=e+"";(r=$e.exec(t))&&(i=Se.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(i=i[0])?u[a]?u[a]+=i:u[++a]=i:(u[++a]=null,s.push({i:a,x:H(r,i)})),n=Se.lastIndex;return n<e.length&&(o=e.slice(n),u[a]?u[a]+=o:u[++a]=o),u.length<2?s[0]?ba(s[0].x):wa(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 Me(t,e){var n=typeof e,r;return e==null||n==="boolean"?Ae(e):(n==="number"?H:n==="string"?(r=ot(e))?(e=r,Zt):In:e instanceof ot?Zt:e instanceof Date?va:ma(e)?pa:Array.isArray(e)?ga:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?ya:H)(t,e)}function xa(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Rn=180/Math.PI,De={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ln(t,e,n,r,i,o){var a,u,s;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(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,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Rn,skewX:Math.atan(s)*Rn,scaleX:a,scaleY:u}}var Jt;function _a(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?De:Ln(e.a,e.b,e.c,e.d,e.e,e.f)}function Aa(t){return t==null||(Jt||(Jt=document.createElementNS("http://www.w3.org/2000/svg","g")),Jt.setAttribute("transform",t),!(t=Jt.transform.baseVal.consolidate()))?De:(t=t.matrix,Ln(t.a,t.b,t.c,t.d,t.e,t.f))}function Vn(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(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:H(l,c)},{i:p-2,x:H(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function a(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:H(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:H(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:H(l,c)},{i:p-2,x:H(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),o(l.translateX,l.translateY,f.translateX,f.translateY,c,h),a(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,v;++m<p;)c[(v=h[m]).i]=v.x(d);return c.join("")}}}var $a=Vn(_a,"px, ","px)","deg)"),Sa=Vn(Aa,", ",")",")"),mt=0,Nt=0,kt=0,Gn=1e3,Qt,Ot,te=0,st=0,ee=0,It=typeof performance=="object"&&performance.now?performance:Date,zn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ce(){return st||(zn(Ma),st=It.now()+ee)}function Ma(){st=0}function ne(){this._call=this._time=this._next=null}ne.prototype=Un.prototype={constructor:ne,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ce():+n)+(e==null?0:+e),!this._next&&Ot!==this&&(Ot?Ot._next=this:Qt=this,Ot=this),this._call=t,this._time=n,Ee()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ee())}};function Un(t,e,n){var r=new ne;return r.restart(t,e,n),r}function Da(){Ce(),++mt;for(var t=Qt,e;t;)(e=st-t._time)>=0&&t._call.call(void 0,e),t=t._next;--mt}function Hn(){st=(te=It.now())+ee,mt=Nt=0;try{Da()}finally{mt=0,Ea(),st=0}}function Ca(){var t=It.now(),e=t-te;e>Gn&&(ee-=e,te=t)}function Ea(){for(var t,e=Qt,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:Qt=n);Ot=t,Ee(r)}function Ee(t){if(!mt){Nt&&(Nt=clearTimeout(Nt));var e=t-st;e>24?(t<1/0&&(Nt=setTimeout(Hn,t-It.now()-ee)),kt&&(kt=clearInterval(kt))):(kt||(te=It.now(),kt=setInterval(Ca,Gn)),mt=1,zn(Hn))}}function Xn(t,e,n){var r=new ne;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Pa=cn("start","end","cancel","interrupt"),Ta=[],Yn=0,Wn=1,Pe=2,re=3,Bn=4,Te=5,ie=6;function oe(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;Fa(t,n,{name:e,index:r,group:i,on:Pa,tween:Ta,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Yn})}function Fe(t,e){var n=X(t,e);if(n.state>Yn)throw new Error("too late; already scheduled");return n}function B(t,e){var n=X(t,e);if(n.state>re)throw new Error("too late; already running");return n}function X(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Fa(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Un(o,0,n.time);function o(l){n.state=Wn,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var f,c,h,d;if(n.state!==Wn)return s();for(f in r)if(d=r[f],d.name===n.name){if(d.state===re)return Xn(a);d.state===Bn?(d.state=ie,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=ie,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(Xn(function(){n.state===re&&(n.state=Bn,n.timer.restart(u,n.delay,n.time),u(l))}),n.state=Pe,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Pe){for(n.state=re,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=Te,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===Te&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){n.state=ie,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Na(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>Pe&&r.state<Te,r.state=ie,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function ka(t){return this.each(function(){Na(this,t)})}function Oa(t,e){var n,r;return function(){var i=B(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,u=r.length;a<u;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function Ia(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=B(this,t),a=o.tween;if(a!==r){i=(r=a).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)}o.tween=i}}function Ra(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=X(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?Oa:Ia)(n,t,e))}function Ne(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 X(i,r).value[e]}}function qn(t,e){var n;return(typeof e=="number"?H:e instanceof ot?Zt:(n=ot(e))?(e=n,Zt):In)(t,e)}function La(t){return function(){this.removeAttribute(t)}}function Va(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ga(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function za(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function Ua(t,e,n){var r,i,o;return function(){var a,u=n(this),s;return u==null?void this.removeAttribute(t):(a=this.getAttribute(t),s=u+"",a===s?null:a===r&&s===i?o:(i=s,o=e(r=a,u)))}}function Ha(t,e,n){var r,i,o;return function(){var a,u=n(this),s;return u==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),s=u+"",a===s?null:a===r&&s===i?o:(i=s,o=e(r=a,u)))}}function Xa(t,e){var n=Xt(t),r=n==="transform"?Sa:qn;return this.attrTween(t,typeof e=="function"?(n.local?Ha:Ua)(n,r,Ne(this,"attr."+t,e)):e==null?(n.local?Va:La)(n):(n.local?za:Ga)(n,r,e))}function Ya(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Wa(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Ba(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Wa(t,o)),n}return i._value=e,i}function qa(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Ya(t,o)),n}return i._value=e,i}function ja(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=Xt(t);return this.tween(n,(r.local?Ba:qa)(r,e))}function Ka(t,e){return function(){Fe(this,t).delay=+e.apply(this,arguments)}}function Za(t,e){return e=+e,function(){Fe(this,t).delay=e}}function Ja(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ka:Za)(e,t)):X(this.node(),e).delay}function Qa(t,e){return function(){B(this,t).duration=+e.apply(this,arguments)}}function tu(t,e){return e=+e,function(){B(this,t).duration=e}}function eu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Qa:tu)(e,t)):X(this.node(),e).duration}function nu(t,e){if(typeof e!="function")throw new Error;return function(){B(this,t).ease=e}}function ru(t){var e=this._id;return arguments.length?this.each(nu(e,t)):X(this.node(),e).ease}function iu(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;B(this,t).ease=n}}function ou(t){if(typeof t!="function")throw new Error;return this.each(iu(this._id,t))}function au(t){typeof t!="function"&&(t=mn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,u=r[i]=[],s,l=0;l<a;++l)(s=o[l])&&t.call(s,s.__data__,l,o)&&u.push(s);return new K(r,this._parents,this._name,this._id)}function uu(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s=e[u],l=n[u],f=s.length,c=a[u]=new Array(f),h,d=0;d<f;++d)(h=s[d]||l[d])&&(c[d]=h);for(;u<r;++u)a[u]=e[u];return new K(a,this._parents,this._name,this._id)}function su(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 lu(t,e,n){var r,i,o=su(e)?Fe:B;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}function cu(t,e){var n=this._id;return arguments.length<2?X(this.node(),n).on.on(t):this.each(lu(n,t,e))}function fu(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function hu(){return this.on("end.remove",fu(this._id))}function du(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ye(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var u=r[a],s=u.length,l=o[a]=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,oe(l[h],e,n,h,l,X(f,n)));return new K(o,this._parents,e,n)}function pu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=pn(t));for(var r=this._groups,i=r.length,o=[],a=[],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=X(f,n),p=0,v=h.length;p<v;++p)(d=h[p])&&oe(d,e,n,p,h,m);o.push(h),a.push(f)}return new K(o,a,e,n)}var mu=Et.prototype.constructor;function gu(){return new mu(this._groups,this._parents)}function vu(t,e){var n,r,i;return function(){var o=dt(this,t),a=(this.style.removeProperty(t),dt(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function jn(t){return function(){this.style.removeProperty(t)}}function yu(t,e,n){var r,i=n+"",o;return function(){var a=dt(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function wu(t,e,n){var r,i,o;return function(){var a=dt(this,t),u=n(this),s=u+"";return u==null&&(s=u=(this.style.removeProperty(t),dt(this,t))),a===s?null:a===r&&s===i?o:(i=s,o=e(r=a,u))}}function bu(t,e){var n,r,i,o="style."+e,a="end."+o,u;return function(){var s=B(this,t),l=s.on,f=s.value[o]==null?u||(u=jn(e)):void 0;(l!==n||i!==f)&&(r=(n=l).copy()).on(a,i=f),s.on=r}}function xu(t,e,n){var r=(t+="")=="transform"?$a:qn;return e==null?this.styleTween(t,vu(t,r)).on("end.style."+t,jn(t)):typeof e=="function"?this.styleTween(t,wu(t,r,Ne(this,"style."+t,e))).each(bu(this._id,t)):this.styleTween(t,yu(t,r,e),n).on("end.style."+t,null)}function _u(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Au(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&_u(t,a,n)),r}return o._value=e,o}function $u(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,Au(t,e,n??""))}function Su(t){return function(){this.textContent=t}}function Mu(t){return function(){var e=t(this);this.textContent=e??""}}function Du(t){return this.tween("text",typeof t=="function"?Mu(Ne(this,"text",t)):Su(t==null?"":t+""))}function Cu(t){return function(e){this.textContent=t.call(this,e)}}function Eu(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Cu(i)),e}return r._value=t,r}function Pu(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,Eu(t))}function Tu(){for(var t=this._name,e=this._id,n=Kn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],u=a.length,s,l=0;l<u;++l)if(s=a[l]){var f=X(s,e);oe(s,t,n,l,a,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new K(r,this._parents,t,n)}function Fu(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var u={value:a},s={value:function(){--i===0&&o()}};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&&o()})}var Nu=0;function K(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Kn(){return++Nu}var Z=Et.prototype;K.prototype={constructor:K,select:du,selectAll:pu,selectChild:Z.selectChild,selectChildren:Z.selectChildren,filter:au,merge:uu,selection:gu,transition:Tu,call:Z.call,nodes:Z.nodes,node:Z.node,size:Z.size,empty:Z.empty,each:Z.each,on:cu,attr:Xa,attrTween:ja,style:xu,styleTween:$u,text:Du,textTween:Pu,remove:hu,tween:Ra,delay:Ja,duration:eu,ease:ru,easeVarying:ou,end:Fu,[Symbol.iterator]:Z[Symbol.iterator]};function ku(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Ou={time:null,delay:0,duration:250,ease:ku};function Iu(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 Ru(t){var e,n;t instanceof K?(e=t._id,t=t._name):(e=Kn(),(n=Ou).time=Ce(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],u=a.length,s,l=0;l<u;++l)(s=a[l])&&oe(s,t,e,l,a,n||Iu(s,e));return new K(r,this._parents,t,e)}Et.prototype.interrupt=ka,Et.prototype.transition=Ru;function Lu(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ae(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 gt(t){return t=ae(Math.abs(t)),t?t[1]:NaN}function Vu(t,e){return function(n,r){for(var i=n.length,o=[],a=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),o.push(n.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[a=(a+1)%t.length];return o.reverse().join(e)}}function Gu(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var zu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ue(t){if(!(e=zu.exec(t)))throw new Error("invalid format: "+t);var e;return new ke({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]})}ue.prototype=ke.prototype;function ke(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+""}ke.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 Uu(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 Zn;function Hu(t,e){var n=ae(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Zn=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ae(t,Math.max(0,e+o-1))[0]}function Jn(t,e){var n=ae(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 Qn={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Lu,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)=>Jn(t*100,e),r:Jn,s:Hu,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function tr(t){return t}var er=Array.prototype.map,nr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Xu(t){var e=t.grouping===void 0||t.thousands===void 0?tr:Vu(er.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?tr:Gu(er.call(t.numerals,String)),a=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=ue(c);var h=c.fill,d=c.align,m=c.sign,p=c.symbol,v=c.zero,A=c.width,S=c.comma,_=c.precision,M=c.trim,w=c.type;w==="n"?(S=!0,w="g"):Qn[w]||(_===void 0&&(_=12),M=!0,w="g"),(v||h==="0"&&d==="=")&&(v=!0,h="0",d="=");var D=p==="$"?n:p==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",g=p==="$"?r:/[%p]/.test(w)?a:"",$=Qn[w],b=/[defgprs%]/.test(w);_=_===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function F(y){var N=D,E=g,Y,Mt,Dt;if(w==="c")E=$(y)+E,y="";else{y=+y;var Q=y<0||1/y<0;if(y=isNaN(y)?s:$(Math.abs(y),_),M&&(y=Uu(y)),Q&&+y==0&&m!=="+"&&(Q=!1),N=(Q?m==="("?m:u:m==="-"||m==="("?"":m)+N,E=(w==="s"?nr[8+Zn/3]:"")+E+(Q&&m==="("?")":""),b){for(Y=-1,Mt=y.length;++Y<Mt;)if(Dt=y.charCodeAt(Y),48>Dt||Dt>57){E=(Dt===46?i+y.slice(Y+1):y.slice(Y))+E,y=y.slice(0,Y);break}}}S&&!v&&(y=e(y,1/0));var ft=N.length+y.length+E.length,tt=ft<A?new Array(A-ft+1).join(h):"";switch(S&&v&&(y=e(tt+y,tt.length?A-E.length:1/0),tt=""),d){case"<":y=N+y+E+tt;break;case"=":y=N+tt+y+E;break;case"^":y=tt.slice(0,ft=tt.length>>1)+N+y+E+tt.slice(ft);break;default:y=tt+N+y+E;break}return o(y)}return F.toString=function(){return c+""},F}function f(c,h){var d=l((c=ue(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor(gt(h)/3)))*3,p=Math.pow(10,-m),v=nr[8+m/3];return function(A){return d(p*A)+v}}return{format:l,formatPrefix:f}}var se,Oe,rr;Yu({thousands:",",grouping:[3],currency:["$",""]});function Yu(t){return se=Xu(t),Oe=se.format,rr=se.formatPrefix,se}function Wu(t){return Math.max(0,-gt(Math.abs(t)))}function Bu(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(gt(e)/3)))*3-gt(Math.abs(t)))}function qu(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,gt(e)-gt(t))+1}function le(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const ir=Symbol("implicit");function or(){var t=new sn,e=[],n=[],r=ir;function i(o){let a=t.get(o);if(a===void 0){if(r!==ir)return r;t.set(o,a=e.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new sn;for(const a of o)t.has(a)||t.set(a,e.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return or(e,n).unknown(r)},le.apply(i,arguments),i}function ar(){var t=or().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,a,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;o=(p-m)/Math.max(1,h-s+l*2),u&&(o=Math.floor(o)),m+=(p-m-o*(h-s))*f,a=o*(1-s),u&&(m=Math.round(m),a=Math.round(a));var v=gi(h).map(function(A){return m+o*A});return n(d?v.reverse():v)}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 a},t.step=function(){return o},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 ar(e(),[r,i]).round(u).paddingInner(s).paddingOuter(l).align(f)},le.apply(c(),arguments)}function ur(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return ur(e())},t}function ju(){return ur(ar.apply(null,arguments).paddingInner(1))}function Ku(t){return function(){return t}}function Zu(t){return+t}var sr=[0,1];function vt(t){return t}function Ie(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Ku(isNaN(e)?NaN:.5)}function Ju(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Qu(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Ie(i,r),o=n(a,o)):(r=Ie(r,i),o=n(o,a)),function(u){return o(r(u))}}function ts(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Ie(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(u){var s=un(t,u,1,r)-1;return o[s](i[s](u))}}function es(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ns(){var t=sr,e=sr,n=Me,r,i,o,a=vt,u,s,l;function f(){var h=Math.min(t.length,e.length);return a!==vt&&(a=Ju(t[0],t[h-1])),u=h>2?ts:Qu,s=l=null,c}function c(h){return h==null||isNaN(h=+h)?o:(s||(s=u(t.map(r),e,n)))(r(a(h)))}return c.invert=function(h){return a(i((l||(l=u(e,t.map(r),H)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,Zu),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=xa,f()},c.clamp=function(h){return arguments.length?(a=h?!0:vt,f()):a!==vt},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(o=h,c):o},function(h,d){return r=h,i=d,f()}}function rs(){return ns()(vt,vt)}function is(t,e,n,r){var i=mi(t,e,n),o;switch(r=ue(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=Bu(i,a))&&(r.precision=o),rr(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=qu(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Wu(i))&&(r.precision=o-(r.type==="%")*2);break}}return Oe(r)}function lr(t){var e=t.domain;return t.ticks=function(n){var r=e();return pi(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return is(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],u=r[o],s,l,f=10;for(u<a&&(l=a,a=u,u=l,l=i,i=o,o=l);f-- >0;){if(l=ge(a,u,n),l===s)return r[i]=a,r[o]=u,e(r);if(l>0)a=Math.floor(a/l)*l,u=Math.ceil(u/l)*l;else if(l<0)a=Math.ceil(a*l)/l,u=Math.floor(u*l)/l;else break;s=l}return t},t}function cr(){var t=rs();return t.copy=function(){return es(t,cr())},le.apply(t,arguments),lr(t)}function fr(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(s){return s!=null&&s<=s?i[un(r,s,0,n)]:o}function u(){var s=-1;for(r=new Array(n);++s<n;)r[s]=((s+1)*e-(s-n)*t)/(n+1);return a}return a.domain=function(s){return arguments.length?([t,e]=s,t=+t,e=+e,u()):[t,e]},a.range=function(s){return arguments.length?(n=(i=Array.from(s)).length-1,u()):i.slice()},a.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]]},a.unknown=function(s){return arguments.length&&(o=s),a},a.thresholds=function(){return r.slice()},a.copy=function(){return fr().domain([t,e]).range(i).unknown(o)},le.apply(lr(a),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 os(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function et(t,e){if(q(t)===!1||q(e)===!1)return Object.assign({},e);const n=(r,i)=>{const o=Object.assign({},i);for(let a of Object.keys(r)){if(!(a in i))continue;let u;q(r[a])&&q(i[a])?(u=n(r[a],i[a]),o[a]=u):o[a]=r[a]}return o};return n(t,e)}function as(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 us(t,e){return e instanceof Function?e(t):Oe(e)(t)}function ce(t,e,n){return`${t}_${e}_${n}`}function Re(t,e){return`${t}_series${e}`}function hr(t,e){return`${t}_group${e}`}function dr(t,e){const n=e.grid.seriesType==="row"?e.grid.rowLabels:e.grid.columnLabels;return t.map((r,i)=>n[i]!=null?n[i]:Re("grid",i))}function pr(t,e){if(t[0]==null)return[];const n=e.grid.seriesType==="row"?e.grid.columnLabels:e.grid.rowLabels;return t[0].map((r,i)=>n[i]!=null?n[i]:hr("grid",i))}function yt(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 fe(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return yt(e)}function ss(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 yt(n)}function Le(t){const n=t.flat().filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return yt(n)}function ls(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 yt(n)}function cs(t,e=2){const r=t.flat().filter((i,o)=>o==e).filter(i=>(i==null||q(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return yt(r)}function mr(t,e){if(t==="row")return Object.assign([],e);const n=e.length,r=e.reduce((o,a)=>Math.max(o,a.length),0),i=new Array(r).fill(null).map(()=>new Array(n).fill(null));for(let o=0;o<n;o++)for(let a=0;a<r;a++)i[a][o]=e[o][a];return i}function fs(t,e){const n=new Map;let r=Object.assign([],t),i=[];return r.forEach((o,a)=>{Array.isArray(o)?o.forEach((u,s)=>{i.push({rowIndex:a,columnIndex:s,index:-1,datum:u})}):i.push({rowIndex:a,columnIndex:0,index:-1,datum:o})}),i.sort((o,a)=>e(o.datum,a.datum)),i=i.map((o,a)=>({...o,index:a})),i.forEach(o=>{n.set(String([o.rowIndex,o.columnIndex]),o.index)}),n}const hs=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i=[];try{const o=(u=>{if(u){const s=fs(e,n.sort);return(l,f,c)=>s.get(String([f,c]))}else return(s,l,f)=>s.length})(n.sort!=null),a=(u,s,l,f,c)=>{const h=ce(n.type,s,l),d=n.seriesLabels[s]||Re("series",s),m=n.colorsPredicate(u,s,l,t),p=n.visibleFilter(u,s,l,t);return typeof u=="number"?{id:h,index:f,sortedIndex:c,label:h,tooltipContent:n.tooltipContentFormat(u,s,l,t),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,tooltipContent:u.tooltipContent?u.tooltipContent:n.tooltipContentFormat(u,s,l,t),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=o(i,s,f),h=a(l,s,f,i.length,c);i.push(h)});else{const l=o(i,s,0),f=a(u,s,0,i.length,l);i.push(f)}})}catch(o){throw Error(o)}return i};var Ve=function(t,e){return Ve=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])},Ve(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");Ve(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(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(f){try{l(r.next(f))}catch(c){a(c)}}function s(f){try{l(r.throw(f))}catch(c){a(c)}}function l(f){f.done?o(f.value):i(f.value).then(u,s)}l((r=r.apply(t,e||[])).next())})}function gr(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(l){return function(f){return s([l,f])}}function s(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=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(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(f){l=[6,f],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function wt(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 nt(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function rt(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function bt(t){return this instanceof bt?(this.v=t,this):new bt(t)}function ps(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i={},u("next"),u("throw"),u("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(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(v,A){o.push([d,p,v,A])>1||s(d,p)})},m&&(i[d]=m(i[d])))}function s(d,m){try{l(r[d](m))}catch(p){h(o[0][3],p)}}function l(d){d.value instanceof bt?Promise.resolve(d.value.v).then(f,c):h(o[0][2],d)}function f(d){s("next",d)}function c(d){s("throw",d)}function h(d,m){d(m),o.shift(),o.length&&s(o[0][0],o[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 wt=="function"?wt(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(u,s){a=t[o](a),i(u,s,a.done,a.value)})}}function i(o,a,u,s){Promise.resolve(s).then(function(l){o({value:l,done:u})},a)}}typeof SuppressedError=="function"&&SuppressedError;function P(t){return typeof t=="function"}function Ge(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 ze=Ge(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 he(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Lt=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,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var u=wt(a),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 a.remove(this);var f=this.initialTeardown;if(P(f))try{f()}catch(p){o=p instanceof Ue?p.errors:[p]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=wt(c),d=h.next();!d.done;d=h.next()){var m=d.value;try{br(m)}catch(p){o=o??[],p instanceof Ue?o=it(it([],rt(o)),rt(p.errors)):o.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(o)throw new Ue(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)br(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)&&he(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&he(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),yr=Lt.EMPTY;function wr(t){return t instanceof Lt||t&&"closed"in t&&P(t.remove)&&P(t.add)&&P(t.unsubscribe)}function br(t){P(t)?t():t.unsubscribe()}var xr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},_r={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=_r.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Ar(t){_r.setTimeout(function(){throw t})}function He(){}function de(t){t()}var Xe=function(t){J(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,wr(n)&&n.add(r)):r.destination=ws,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}(Lt),gs=Function.prototype.bind;function Ye(t,e){return gs.call(t,e)}var vs=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){pe(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){pe(r)}else pe(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){pe(n)}},t}(),Vt=function(t){J(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(P(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;o&&xr.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Ye(n.next,u),error:n.error&&Ye(n.error,u),complete:n.complete&&Ye(n.complete,u)}):a=n}return o.destination=new vs(a),o}return e}(Xe);function pe(t){Ar(t)}function ys(t){throw t}var ws={closed:!0,next:He,error:ys,complete:He},ze=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function xt(t){return t}function bs(t){return t.length===0?xt:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var C=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,o=_s(e)?e:new Vt(e,n,r);return de(function(){var a=i,u=a.operator,s=a.source;o.add(u?u.call(o,s):s?i._subscribe(o):i._trySubscribe(o))}),o},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=$r(n),new n(function(i,o){var a=new Vt({next:function(u){try{e(u)}catch(s){o(s),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[ze]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return bs(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=$r(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function $r(t){var e;return(e=t??xr.Promise)!==null&&e!==void 0?e:Promise}function xs(t){return t&&P(t.next)&&P(t.error)&&P(t.complete)}function _s(t){return t&&t instanceof Xe||xs(t)&&wr(t)}function As(t){return P(t==null?void 0:t.lift)}function k(t){return function(e){if(As(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 I(t,e,n,r,i){return new $s(t,e,n,r,i)}var $s=function(t){J(e,t);function e(n,r,i,o,a,u){var s=t.call(this,n)||this;return s.onFinalize=a,s.shouldUnsubscribe=u,s._next=r?function(l){try{r(l)}catch(f){n.error(f)}}:t.prototype._next,s._error=o?function(l){try{o(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}(Xe),Ss=Ge(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),T=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 Sr(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new Ss},e.prototype.next=function(n){var r=this;de(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=wt(r.currentObservers),u=a.next();!u.done;u=a.next()){var s=u.value;s.next(n)}}catch(l){i={error:l}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;de(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;de(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,o=i.hasError,a=i.isStopped,u=i.observers;return o||a?yr:(this.currentObservers=null,u.push(n),new Lt(function(){r.currentObservers=null,he(u,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new C;return n.source=this,n},e.create=function(n,r){return new Sr(n,r)},e}(C),Sr=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:yr},e}(T),We={now:function(){return(We.delegate||Date).now()},delegate:void 0},Ms=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=We);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,u=r._timestampProvider,s=r._windowTime;i||(o.push(n),!a&&o.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,o=i._infiniteTimeWindow,a=i._buffer,u=a.slice(),s=0;s<u.length&&!n.closed;s+=o?1:2)n.next(u[s]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,u=(a?1:2)*r;if(r<1/0&&u<o.length&&o.splice(0,o.length-u),!a){for(var s=i.now(),l=0,f=1;f<o.length&&o[f]<=s;f+=2)l=f;l&&o.splice(0,l+1)}},e}(T),Ds=function(t){J(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Lt),qe={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=qe.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},Cs=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 o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,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,o;try{this.work(n)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,he(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Ds),Mr=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=We.now,t}(),Es=function(t){J(e,t);function e(n,r){r===void 0&&(r=Mr.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}(Mr),Be=new Es(Cs),Ps=Be,je=new C(function(t){return t.complete()});function Dr(t){return t&&P(t.schedule)}function Ke(t){return t[t.length-1]}function Ts(t){return P(Ke(t))?t.pop():void 0}function _t(t){return Dr(Ke(t))?t.pop():void 0}function Cr(t,e){return typeof Ke(t)=="number"?t.pop():e}var Er=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Pr(t){return P(t==null?void 0:t.then)}function Tr(t){return P(t[ze])}function Fr(t){return Symbol.asyncIterator&&P(t==null?void 0:t[Symbol.asyncIterator])}function Nr(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 Fs(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var kr=Fs();function Ir(t){return P(t==null?void 0:t[kr])}function Or(t){return ps(this,arguments,function(){var n,r,i,o;return vr(this,function(a){switch(a.label){case 0:n=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,bt(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,bt(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,bt(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Rr(t){return P(t==null?void 0:t.getReader)}function U(t){if(t instanceof C)return t;if(t!=null){if(Tr(t))return Ns(t);if(Er(t))return ks(t);if(Pr(t))return Is(t);if(Fr(t))return Lr(t);if(Ir(t))return Os(t);if(Rr(t))return Rs(t)}throw Nr(t)}function Ns(t){return new C(function(e){var n=t[ze]();if(P(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ks(t){return new C(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Is(t){return new C(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Ar)})}function Os(t){return new C(function(e){var n,r;try{for(var i=wt(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Lr(t){return new C(function(e){Ls(t,e).catch(function(n){return e.error(n)})})}function Rs(t){return Lr(Or(t))}function Ls(t,e){var n,r,i,o;return ds(this,void 0,void 0,function(){var a,u;return vr(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(a=r.value,e.next(a),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&&(o=n.return)?[4,o.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 Q(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function Vr(t,e){return e===void 0&&(e=0),k(function(n,r){n.subscribe(I(r,function(i){return Q(r,t,function(){return r.next(i)},e)},function(){return Q(r,t,function(){return r.complete()},e)},function(i){return Q(r,t,function(){return r.error(i)},e)}))})}function Gr(t,e){return e===void 0&&(e=0),k(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Vs(t,e){return U(t).pipe(Gr(e),Vr(e))}function Gs(t,e){return U(t).pipe(Gr(e),Vr(e))}function Us(t,e){return new C(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function Hs(t,e){return new C(function(n){var r;return Q(n,e,function(){r=t[kr](),Q(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(u){n.error(u);return}a?n.complete():n.next(o)},0,!0)}),function(){return P(r==null?void 0:r.return)&&r.return()}})}function Ur(t,e){if(!t)throw new Error("Iterable cannot be null");return new C(function(n){Q(n,e,function(){var r=t[Symbol.asyncIterator]();Q(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function Xs(t,e){return Ur(Or(t),e)}function Ys(t,e){if(t!=null){if(Tr(t))return Vs(t,e);if(Er(t))return Us(t,e);if(Pr(t))return Gs(t,e);if(Fr(t))return Ur(t,e);if(Ir(t))return Hs(t,e);if(Rr(t))return Xs(t,e)}throw Nr(t)}function At(t,e){return e?Ys(t,e):U(t)}function Ze(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=_t(t);return At(t,n)}var Hr=Ge(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function zs(t){return t instanceof Date&&!isNaN(t)}function V(t,e){return k(function(n,r){var i=0;n.subscribe(I(r,function(o){r.next(t.call(e,o,i++))}))})}var Ws=Array.isArray;function qs(t,e){return Ws(e)?t.apply(void 0,it([],rt(e))):t(e)}function Bs(t){return V(function(e){return qs(t,e)})}var js=Array.isArray,Ks=Object.getPrototypeOf,Zs=Object.prototype,Js=Object.keys;function Qs(t){if(t.length===1){var e=t[0];if(js(e))return{args:e,keys:null};if(tl(e)){var n=Js(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function tl(t){return t&&typeof t=="object"&&Ks(t)===Zs}function el(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function $t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=_t(t),r=Ts(t),i=Qs(t),o=i.args,a=i.keys;if(o.length===0)return At([],n);var u=new C(nl(o,n,a?function(s){return el(a,s)}:xt));return r?u.pipe(Bs(r)):u}function nl(t,e,n){return n===void 0&&(n=xt),function(r){Xr(e,function(){for(var i=t.length,o=new Array(i),a=i,u=i,s=function(f){Xr(e,function(){var c=At(t[f],e),h=!1;c.subscribe(I(r,function(d){o[f]=d,h||(h=!0,u--),u||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},l=0;l<i;l++)s(l)},r)}}function Xr(t,e,n){t?Q(n,t,e):e()}function rl(t,e,n,r,i,o,a,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){o&&e.next(p),l++;var g=!1;U(n(p,f++)).subscribe(I(e,function(A){i==null||i(A),o?d(A):e.next(A)},function(){g=!0},void 0,function(){if(g)try{l--;for(var A=function(){var S=s.shift();a?Q(e,a,function(){return m(S)}):m(S)};s.length&&l<r;)A();h()}catch(S){e.error(S)}}))};return t.subscribe(I(e,d,function(){c=!0,h()})),function(){u==null||u()}}function Yr(t,e,n){return n===void 0&&(n=1/0),P(e)?Yr(function(r,i){return V(function(o,a){return e(r,o,i,a)})(U(t(r,i)))},n):(typeof e=="number"&&(n=e),k(function(r,i){return rl(r,i,t,n)}))}function Je(t){return t===void 0&&(t=1/0),Yr(xt,t)}function il(){return Je(1)}function zr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return il()(At(t,_t(t)))}function ol(t){return new C(function(e){U(t()).subscribe(e)})}function al(t,e,n){return ol(function(){return t()?e:n})}function ul(t,e,n){t===void 0&&(t=0),n===void 0&&(n=Ps);var r=-1;return e!=null&&(Dr(e)?n=e:r=e),new C(function(i){var o=zs(t)?+t-n.now():t;o<0&&(o=0);var a=0;return n.schedule(function(){i.closed||(i.next(a++),0<=r?this.schedule(void 0,r):i.complete())},o)})}function sl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=_t(t),r=Cr(t,1/0),i=t;return i.length?i.length===1?U(i[0]):Je(r)(At(i,n)):je}var ll=Array.isArray;function cl(t){return t.length===1&&ll(t[0])?t[0]:t}function Qe(t,e){return k(function(n,r){var i=0;n.subscribe(I(r,function(o){return t.call(e,o,i++)&&r.next(o)}))})}function Wr(t){return k(function(e,n){var r=null,i=!1,o;r=e.subscribe(I(n,void 0,void 0,function(a){o=U(t(a,Wr(t)(e))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}function fl(t,e){return e===void 0&&(e=Be),k(function(n,r){var i=null,o=null,a=null,u=function(){if(i){i.unsubscribe(),i=null;var l=o;o=null,r.next(l)}};function s(){var l=a+t,f=e.now();if(f<l){i=this.schedule(void 0,l-f),r.add(i);return}u()}n.subscribe(I(r,function(l){o=l,a=e.now(),i||(i=e.schedule(s,t),r.add(i))},function(){u(),r.complete()},void 0,function(){o=i=null}))})}function hl(t){return k(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function dl(t){return t<=0?function(){return je}:k(function(e,n){var r=0;e.subscribe(I(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function qr(t,e){return e===void 0&&(e=xt),t=t??pl,k(function(n,r){var i,o=!0;n.subscribe(I(r,function(a){var u=e(a);(o||!t(i,u))&&(o=!1,i=u,r.next(a))}))})}function pl(t,e){return t===e}function ml(t){return t===void 0&&(t=gl),k(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function gl(){return new Hr}function vl(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Qe(function(i,o){return t(i,o,r)}):xt,dl(1),n?hl(e):ml(function(){return new Hr}))}}function yl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=_t(t),r=Cr(t,1/0);return t=cl(t),k(function(i,o){Je(r)(At(it([i],rt(t)),n)).subscribe(o)})}function wl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return yl.apply(void 0,it([],rt(t)))}function tn(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new T}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,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},A=function(){g(),f=h=void 0,m=p=!1},S=function(){var _=f;A(),_==null||_.unsubscribe()};return k(function(_,M){d++,!p&&!m&&g();var w=h=h??n();M.add(function(){d--,d===0&&!p&&!m&&(c=en(S,s))}),w.subscribe(M),!f&&d>0&&(f=new Vt({next:function(D){return w.next(D)},error:function(D){p=!0,g(),c=en(A,i,D),w.error(D)},complete:function(){m=!0,g(),c=en(A,a),w.complete()}}),U(_).subscribe(f))})(l)}}function en(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 U(e.apply(void 0,it([],rt(n)))).subscribe(i)}}function O(t,e,n){var r,i,o,a,u=!1;return t&&typeof t=="object"?(r=t.bufferSize,a=r===void 0?1/0:r,i=t.windowTime,e=i===void 0?1/0:i,o=t.refCount,u=o===void 0?!1:o,n=t.scheduler):a=t??1/0,tn({connector:function(){return new Ms(a,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:u})}function me(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=_t(t);return k(function(r,i){(n?zr(t,r,n):zr(t,r)).subscribe(i)})}function Gt(t,e){return k(function(n,r){var i=null,o=0,a=!1,u=function(){return a&&!i&&r.complete()};n.subscribe(I(r,function(s){i==null||i.unsubscribe();var l=0,f=o++;U(t(s,f)).subscribe(i=I(r,function(c){return r.next(e?e(s,c,f,l++):c)},function(){i=null,u()}))},function(){a=!0,u()}))})}function R(t){return k(function(e,n){U(t).subscribe(I(n,function(){return n.complete()},He)),!n.closed&&e.subscribe(n)})}function bl(t,e){return k(function(n,r){var i=e??{},o=i.leading,a=o===void 0?!0:o,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(A){return c=U(t(A)).subscribe(I(r,d,m))},g=function(){if(l){l=!1;var A=f;f=null,r.next(A),!h&&p(A)}};n.subscribe(I(r,function(A){l=!0,f=A,!(c&&!c.closed)&&(a?g():p(A))},function(){h=!0,!(s&&l&&c&&!c.closed)&&r.complete()}))})}function xl(t,e,n){e===void 0&&(e=Be);var r=ul(t,e);return bl(function(){return r},n)}const nn=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new T,i=e.pipe(R(r),V(s=>({id:null,seriesLabel:null,groupLabel:null,highlightDefault:s.highlightDefault})),qr()),o=n.pipe(R(r),Qe(s=>s.eventName==="mouseover"||s.eventName==="mousemove"),V(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})),a=n.pipe(R(r),Qe(s=>s.eventName==="mouseout"),Gt(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 C(s=>($t({target:sl(o,a,i),datumList:t,fullChartParams:e}).pipe(R(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)}))},rn=({datumList$:t})=>t.pipe(V(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),Br=({datumList$:t})=>t.pipe(V(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),_l=({subject:t,observer:e})=>{const n=nn({datumList$:e.computedData$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(O(1)),r=rn({datumList$:e.computedData$}).pipe(O(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,seriesHighlight$:n,SeriesDataMap$:r}},lt=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=j.scaleDomain,scaleRange:i=j.scaleRange})=>{const o=r[0]??j.scaleDomain[0],a=r[1]??j.scaleDomain[1],u=i[0]??j.scaleRange[0],s=i[1]??j.scaleRange[1],l=o==="auto"?e:o,f=a==="auto"?t:a;let c=n*u,h=n*s;return fr().domain([l,f]).range([c,h])},Al=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return ju().domain(t).range(r).padding(n)},$l=({axisLabels:t,axisWidth:e,padding:n=.5,reverse:r=!1})=>{let o=t.map((a,u)=>u);return r&&o.reverse(),hr().domain([-0,e+0]).range(o)},Sl={series:!1,grid:!0,multiGrid:!0,multiValue:!0,tree:!1,relationship:!1};function Ml(t){return new C(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 Dl=({defaultDataFormatter:t,computedDataFn:e,contextObserverFn:n})=>{const r=new T,i=t.type;return function(a,u){Wt(a).selectAll("svg").remove();const s=Wt(a).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").style("width","100%").style("height","100%").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 T,dataFormatter$:new T,plugins$:new T,chartParams$:new T,event$:new T},h=(v=>{const $=v||Ct,b=$.preset?$.preset:{};return{chartParams:b.chartParams?nt(b.chartParams,an):an,dataFormatter:b.dataFormatter?nt(b.dataFormatter,t):t,allPluginParams:b.allPluginParams?b.allPluginParams:{}}})(u),d=c.data$.pipe(O(1)),m=c.dataFormatter$.pipe(R(r),me({}),V(v=>nt(v,h.dataFormatter)),O(1)),p=c.chartParams$.pipe(R(r),me({}),V(v=>nt(v,h.chartParams)),O(1)),g=p.pipe(R(r),me({}),V(v=>nt(v.padding??{},on)));g.pipe(R(r),vl()).subscribe(v=>{l.attr("transform",`translate(${v.left}, ${v.top})`)}),g.subscribe(v=>{l.transition().attr("transform",`translate(${v.left}, ${v.top})`)});const A=Ml(a).pipe(R(r),tn()),S=Ze().pipe(wl(A.pipe(fl(250)),A.pipe(xl(250))),qr((v,$)=>JSON.stringify(v)===JSON.stringify($)),tn()),_=S.subscribe(),M=$t({rootSize:S,mergedPadding:g}).pipe(R(r),Gt(async v=>{const $=v.rootSize.width>0?v.rootSize.width:Kr,b=v.rootSize.height>0?v.rootSize.height:Zr;return{width:$-v.mergedPadding.left-v.mergedPadding.right,height:b-v.mergedPadding.top-v.mergedPadding.bottom,top:v.mergedPadding.top,right:v.mergedPadding.right,bottom:v.mergedPadding.bottom,left:v.mergedPadding.left,rootWidth:$,rootHeight:b}}),O(1)),w=$t({data:d,dataFormatter:m,chartParams:p,layout:al(()=>Sl[i]===!0,M,Ze(void 0))}).pipe(R(r),Gt(async v=>v),Gt(v=>Ze(v).pipe(V($=>{try{return e({data:$.data,dataFormatter:$.dataFormatter,chartParams:$.chartParams,layout:$.layout})}catch(b){throw console.error(b),new Error(b)}}),Wr(()=>je))),O(1)),D={};return c.plugins$.subscribe(v=>{if(!v)return;const $=f.selectAll("g.orbcharts__plugin").data(v,y=>y.name),b=$.enter().append("g").attr("class",y=>`orbcharts__plugin orbcharts__${y.name}`);$.exit().remove().each((y,N,E)=>{D[y.name]&&D[y.name].destroy()}),b.each((y,N,E)=>{const z={fullParams$:new C,fullChartParams$:p,fullDataFormatter$:m,computedData$:w,layout$:M},Mt=n({observer:z,subject:c}),tt={selection:Wt(E[N]),rootSelection:s,name:y.name,chartType:i,subject:c,observer:Mt};y.setPresetParams(h.allPluginParams[y.name]??{}),y.setContext(tt),D[tt.name]=y,y.init()})}),{...c,selection:s,destroy(){Wt(a).selectAll("svg").remove(),r.next(void 0),_.unsubscribe()}}}};class St{constructor({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r},i,o){this.data$=new T,this.dataFormatter$=new T,this.plugins$=new T,this.chartParams$=new T,this.event$=new T;const u=Dl({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r})(i,o);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 Cl extends St{constructor(e,n){super({defaultDataFormatter:Qr,computedDataFn:hs,contextObserverFn:_l},e,n)}}const jr=t=>{const{data:e=[],dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let o;try{const a=e.reduce((v,$)=>$.length>v?$.length:v,0),s=e.map((v,$)=>{if(v.length===a)return v;const b=Object.assign([],v);for(let F=b.length;F<a;F++)b[F]=null;return b}).map((v,$)=>v.map((b,F)=>{const y=n.colorsPredicate(b,$,F,t),N=n.visibleFilter(b,$,F,t);return b==null?{id:"",label:"",tooltipContent:"",data:{},value:null,_color:y,_visible:N}:typeof b=="number"?{id:"",label:"",tooltipContent:"",data:{},value:b,_color:y,_visible:N}:{id:b.id??"",label:b.label??"",tooltipContent:b.tooltipContent??"",data:b.data??{},value:b.value,_color:y,_visible:N}})),l=gr(n.grid.seriesType,s),f=n.groupAxis.position==="top"||n.groupAxis.position==="bottom"?i.width:i.height,c=l[0]?l[0].length-1:0,h=lt({maxValue:c,minValue:0,axisWidth:f,scaleDomain:[0,c],scaleRange:[0,1]}),d=[n.groupAxis.scaleDomain[0]==="auto"?0:n.groupAxis.scaleDomain[0],n.groupAxis.scaleDomain[1]==="auto"?c:n.groupAxis.scaleDomain[1]],m=l.flat().filter(v=>v._visible!=!1),[p,g]=fe(m),A=n.valueAxis.position==="left"||n.valueAxis.position==="right"?i.height:i.width,S=pr(l,n),_=mr(l,n),M=lt({maxValue:g,minValue:p,axisWidth:A,scaleDomain:[p,g],scaleRange:[0,1]}),w=M(0);let D=0;o=l.map((v,$)=>v.map((b,F)=>{const y=ce(n.type,$,F),N=_[F],E=M(b.value??0),z={id:b.id?b.id:y,index:D,label:b.label?b.label:y,tooltipContent:b.tooltipContent?b.tooltipContent:n.tooltipContentFormat(b,$,F,t),data:b.data,value:b.value,seriesIndex:$,seriesLabel:S[$],groupIndex:F,groupLabel:N,color:b._color,axisX:h(F),axisY:E,axisYFromZero:E-w,visible:b._visible};return D++,z}))}catch(a){throw Error(a)}return o},El=({fullDataFormatter$:t,layout$:e})=>{const n=new T;function r({xAxis:i,yAxis:o,width:a,height:u}){if(!i||!o)return{translate:[0,0],scale:[0,0],rotate:0,rotateX:0,rotateY:0,value:""};let s=0,l=0,f=0,c=0,h=0;return i.position==="bottom"?o.position==="left"?(c=180,l=u):o.position==="right"?(c=180,h=180,s=a,l=u):(c=180,l=u):i.position==="top"?o.position==="left"||(o.position==="right"?(h=180,s=a):(c=180,l=u)):i.position==="left"?o.position==="bottom"?(f=-90,l=u):o.position==="top"?(f=-90,h=180):(c=180,l=u):i.position==="right"&&(o.position==="bottom"?(f=-90,c=180,l=u,s=a):o.position==="top"?(f=-90,s=a):(c=180,l=u)),{translate:[s,l],scale:[0,0],rotate:f,rotateX:c,rotateY:h,value:`translate(${s}px, ${l}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new C(i=>($t({fullDataFormatter:t,layout:e}).pipe(R(n)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.groupAxis,yAxis:o.fullDataFormatter.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},Pl=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new T;function i({data:o,groupAxis:a,valueAxis:u,width:s,height:l}){let f=0,c=0,h=0,d=0;const m=a.position==="top"||a.position==="bottom"?s:l,p=0,g=o[0]?o[0].length-1:0,A=a.scaleDomain[0]==="auto"?p-a.scalePadding:a.scaleDomain[0]-a.scalePadding,S=a.scaleDomain[1]==="auto"?g+a.scalePadding:a.scaleDomain[1]+a.scalePadding,_=lt({maxValue:g,minValue:p,axisWidth:m,scaleDomain:[A,S],scaleRange:[0,1]}),M=_(p),w=_(g);f=M,h=(w-M)/m;const v=o.map((Mt,Dt)=>Mt.filter((tt,ft)=>ft>=A&&ft<=S&&tt.visible==!0)),$=Le(v),b=u.position==="left"||u.position==="right"?l:s,F=lt({maxValue:$[1],minValue:$[0],axisWidth:b,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),y=Le(o),N=F(y[0]),E=F(y[1]);return c=N,d=(E-N)/b,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new C(o=>($t({computedData:t,fullDataFormatter:e,layout:n}).pipe(R(r)).subscribe(a=>{const u=i({data:a.computedData,groupAxis:a.fullDataFormatter.groupAxis,valueAxis:a.fullDataFormatter.valueAxis,width:a.layout.width,height:a.layout.height});o.next(u)}),function(){r.next(void 0)}))},Tl=({gridAxesTransform$:t})=>t.pipe(V(e=>{const n=[0,0],r=[e.scale[0]*-1,e.scale[1]*-1],i=e.rotate*-1,o=e.rotateX*-1,a=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:o,rotateY:a,value:`translate(${n[0]}px, ${n[1]}px) rotate(${i}deg) rotateX(${o}deg) rotateY(${a}deg)`}})),Fl=({fullDataFormatter$:t,layout$:e})=>{const n=new T;function r({xAxisPosition:i,yAxisPosition:o,width:a,height:u}){if((i==="bottom"||i==="top")&&(o==="left"||o==="right"))return{width:a,height:u};if((i==="left"||i==="right")&&(o==="bottom"||o==="top"))return{width:u,height:a}}return new C(i=>{$t({fullDataFormatter:t,layout:e}).pipe(R(n),Gt(async o=>o)).subscribe(o=>{const a=r({xAxisPosition:o.fullDataFormatter.groupAxis.position,yAxisPosition:o.fullDataFormatter.valueAxis.position,width:o.layout.width,height:o.layout.height});return i.next(a),function(){n.next(void 0)}})})},Nl=({computedData$:t})=>t.pipe(V(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),kl=({subject:t,observer:e})=>{const n=El({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(O(1)),r=Pl({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(O(1)),i=Tl({gridAxesTransform$:n}).pipe(O(1)),o=Fl({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(O(1)),a=e.computedData$.pipe(V(c=>c.flat())).pipe(O(1)),u=nn({datumList$:a,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(O(1)),s=rn({datumList$:a}).pipe(O(1)),l=Br({datumList$:a}).pipe(O(1)),f=Nl({computedData$:e.computedData$}).pipe(O(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,gridAxesTransform$:n,gridGraphicTransform$:r,gridAxesOppositeTransform$:i,gridAxesSize$:o,gridHighlight$:u,SeriesDataMap$:s,GroupDataMap$:l,visibleComputedData$:f}};class Il extends St{constructor(e,n){super({defaultDataFormatter:ti,computedDataFn:jr,contextObserverFn:kl},e,n)}}const Ol=({data:t=[],dataFormatter:e,chartParams:n,layout:r})=>{if(!t.length)return[];let i=[];try{i=t.map((o,a)=>{const u={...e.multiGrid[a],type:`multiGrid_${a}`,colorsPredicate:e.multiGrid[a].colorsPredicate,visibleFilter:e.visibleFilter,tooltipContentFormat:e.tooltipContentFormat};return jr({data:o,dataFormatter:u,chartParams:n,layout:r})})}catch(o){throw Error(o)}return i},Rl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Ll extends St{constructor(e,n){super({defaultDataFormatter:ei,computedDataFn:Ol,contextObserverFn:Rl},e,n)}}const Vl=t=>{const{data:e,dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let o=[];try{const a=e.map((_,M)=>_.map((w,D)=>typeof w=="number"?{id:"",label:"",tooltipContent:"",data:{},value:w}:{id:w.id??"",label:w.label??"",tooltipContent:w.tooltipContent??"",data:w.data??{},value:w.value})),[u,s]=fe(a.map(_=>_[0])),[l,f]=fe(a.map(_=>_[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=lt({maxValue:s,minValue:u,axisWidth:c,scaleDomain:[u,s],scaleRange:[0,1]}),m=lt({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]],A=(_,M,w,D)=>w===0&&_.value!=null&&(_.value<p[0]||_.value>p[1])||w===1&&_.value!=null&&(_.value<g[0]||_.value>g[1])?!1:n.visibleFilter(_,M,w,D);let S=0;o=a.map((_,M)=>_.map((w,D)=>{const v=S;S++;const $=ce(n.type,M,D),b=A(w,M,D,t);return{id:w.id?w.id:$,index:v,label:w.label?w.label:$,tooltipContent:w.tooltipContent?w.tooltipContent:n.tooltipContentFormat(w,M,D,t),data:w.data,value:w.value,axis:D==0?d(w.value):m(w.value),visible:b}}))}catch(a){throw Error(a)}return o},Gl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Ul extends St{constructor(e,n){super({defaultDataFormatter:ni,computedDataFn:Vl,contextObserverFn:Gl},e,n)}}const Hl=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;let i=[],o=[];try{let a=[],u=[];if(e.nodes)a=e.nodes,u=e.edges;else if(e[0])a=e[0],u=e[1];else return{nodes:[],edges:[]};i=a.map((c,h)=>({id:c.id,index:h,label:c.label??"",tooltipContent:c.tooltipContent?c.tooltipContent:n.tooltipContentFormat(c,0,h,t),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]));o=u.map((c,h)=>({id:c.id,index:h,label:c.label??"",tooltipContent:c.tooltipContent?c.tooltipContent:n.tooltipContentFormat(c,1,h,t),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 o.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 o.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(a){throw Error(a)}return{nodes:i,edges:o}},Xl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Yl extends St{constructor(e,n){super({defaultDataFormatter:ii,computedDataFn:Hl,contextObserverFn:Xl},e,n)}}const zl=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;let i={id:"",index:0,label:"",visible:!0,tooltipContent:"",data:{},value:0,level:0,seq:0,children:[]};try{const o=function(){if(B(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,tooltipContent:c.tooltipContent,value:c.value,children:(l.get(c.id)??[]).map(h=>f(h))});return s?f(s):{id:""}}();let a=0;const u=(s,l,f)=>{const c=l+1,h=n.visibleFilter(s,l,f,t),d=a;return a++,{id:s.id,index:d,level:l,seq:f,label:s.label??"",data:s.data??{},tooltipContent:s.tooltipContent?s.tooltipContent:n.tooltipContentFormat(s,l,f,t),value:s.value,visible:h,children:(s.children??[]).map((m,p)=>u(m,c,p))}};i=u(o,0,0)}catch(o){throw Error(o)}return i},Wl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class ql extends St{constructor(e,n){super({defaultDataFormatter:ri,computedDataFn:zl,contextObserverFn:Wl},e,n)}}function Bl({name:t,defaultParams:e,initFn:n}){const r=new T,i=new T,o=new WeakMap;let a=()=>{},u,s=e;return{params$:i,name:t,defaultParams:e,init(){u&&(a=n(u)??(()=>{}),o.set(u.selection,u))},destroy(){a(),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(R(r),me({}),V(f=>nt(f,s)),O(1))}}}const ct=()=>function(e,n){return function(i){return class{constructor(){const a=Bl({name:e,defaultParams:n,initFn:i});this.params$=a.params$,this.name=a.name,this.defaultParams=a.defaultParams,this.init=a.init,this.destroy=a.destroy,this.setPresetParams=a.setPresetParams,this.setContext=a.setContext}}}},jl=ct(),Kl=ct(),Zl=ct(),Jl=ct(),Ql=ct(),tc=ct(),ec=ct();x.GridChart=Il,x.MultiGridChart=Ll,x.MultiValueChart=Ul,x.RelationshipChart=Yl,x.SeriesChart=Cl,x.TreeChart=ql,x.createAxisLinearScale=lt,x.createAxisPointScale=Al,x.createAxisQuantizeScale=$l,x.createDefaultDatumId=ce,x.createDefaultGroupLabel=dr,x.createDefaultSeriesLabel=Re,x.createGridGroupLabels=mr,x.createGridSeriesLabels=pr,x.defineGridPlugin=Kl,x.defineMultiGridPlugin=Zl,x.defineMultiValuePlugin=Jl,x.defineNoneDataPlugin=Ql,x.defineRelationshipPlugin=tc,x.defineSeriesPlugin=jl,x.defineTreePlugin=ec,x.formatCommaNumber=as,x.formatValueToLabel=us,x.getMinAndMax=yt,x.getMinAndMaxGrid=Le,x.getMinAndMaxMultiGrid=ls,x.getMinAndMaxMultiValue=cs,x.getMinAndMaxSeries=ss,x.getMinAndMaxValue=fe,x.groupDataMapObservable=Br,x.highlightObservable=nn,x.isFunction=os,x.isObject=B,x.mergeOptionsWithDefault=nt,x.seriesDataMapObservable=rn,x.transposeData=gr,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function he(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Lt=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,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var u=wt(a),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 a.remove(this);var f=this.initialTeardown;if(P(f))try{f()}catch(p){o=p instanceof ze?p.errors:[p]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=wt(c),d=h.next();!d.done;d=h.next()){var m=d.value;try{wr(m)}catch(p){o=o??[],p instanceof ze?o=rt(rt([],nt(o)),nt(p.errors)):o.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(o)throw new ze(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)wr(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)&&he(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&he(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),vr=Lt.EMPTY;function yr(t){return t instanceof Lt||t&&"closed"in t&&P(t.remove)&&P(t.add)&&P(t.unsubscribe)}function wr(t){P(t)?t():t.unsubscribe()}var br={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},xr={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,rt([t,e],nt(n)))},clearTimeout:function(t){var e=xr.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function _r(t){xr.setTimeout(function(){throw t})}function Ue(){}function de(t){t()}var He=function(t){J(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,yr(n)&&n.add(r)):r.destination=ws,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}(Lt),gs=Function.prototype.bind;function Xe(t,e){return gs.call(t,e)}var vs=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){pe(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){pe(r)}else pe(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){pe(n)}},t}(),Vt=function(t){J(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(P(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;o&&br.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&Xe(n.next,u),error:n.error&&Xe(n.error,u),complete:n.complete&&Xe(n.complete,u)}):a=n}return o.destination=new vs(a),o}return e}(He);function pe(t){_r(t)}function ys(t){throw t}var ws={closed:!0,next:Ue,error:ys,complete:Ue},Ye=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function xt(t){return t}function bs(t){return t.length===0?xt:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var C=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,o=_s(e)?e:new Vt(e,n,r);return de(function(){var a=i,u=a.operator,s=a.source;o.add(u?u.call(o,s):s?i._subscribe(o):i._trySubscribe(o))}),o},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=Ar(n),new n(function(i,o){var a=new Vt({next:function(u){try{e(u)}catch(s){o(s),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Ye]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return bs(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Ar(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function Ar(t){var e;return(e=t??br.Promise)!==null&&e!==void 0?e:Promise}function xs(t){return t&&P(t.next)&&P(t.error)&&P(t.complete)}function _s(t){return t&&t instanceof He||xs(t)&&yr(t)}function As(t){return P(t==null?void 0:t.lift)}function k(t){return function(e){if(As(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 O(t,e,n,r,i){return new $s(t,e,n,r,i)}var $s=function(t){J(e,t);function e(n,r,i,o,a,u){var s=t.call(this,n)||this;return s.onFinalize=a,s.shouldUnsubscribe=u,s._next=r?function(l){try{r(l)}catch(f){n.error(f)}}:t.prototype._next,s._error=o?function(l){try{o(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}(He),Ss=Ge(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),T=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 $r(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new Ss},e.prototype.next=function(n){var r=this;de(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=wt(r.currentObservers),u=a.next();!u.done;u=a.next()){var s=u.value;s.next(n)}}catch(l){i={error:l}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;de(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;de(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,o=i.hasError,a=i.isStopped,u=i.observers;return o||a?vr:(this.currentObservers=null,u.push(n),new Lt(function(){r.currentObservers=null,he(u,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new C;return n.source=this,n},e.create=function(n,r){return new $r(n,r)},e}(C),$r=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:vr},e}(T),We={now:function(){return(We.delegate||Date).now()},delegate:void 0},Ms=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=We);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,u=r._timestampProvider,s=r._windowTime;i||(o.push(n),!a&&o.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,o=i._infiniteTimeWindow,a=i._buffer,u=a.slice(),s=0;s<u.length&&!n.closed;s+=o?1:2)n.next(u[s]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,u=(a?1:2)*r;if(r<1/0&&u<o.length&&o.splice(0,o.length-u),!a){for(var s=i.now(),l=0,f=1;f<o.length&&o[f]<=s;f+=2)l=f;l&&o.splice(0,l+1)}},e}(T),Ds=function(t){J(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Lt),Be={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,rt([t,e],nt(n)))},clearInterval:function(t){var e=Be.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},Cs=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 o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),Be.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&&Be.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,o;try{this.work(n)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,he(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Ds),Sr=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=We.now,t}(),Es=function(t){J(e,t);function e(n,r){r===void 0&&(r=Sr.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}(Sr),qe=new Es(Cs),Ps=qe,je=new C(function(t){return t.complete()});function Mr(t){return t&&P(t.schedule)}function Ke(t){return t[t.length-1]}function Ts(t){return P(Ke(t))?t.pop():void 0}function _t(t){return Mr(Ke(t))?t.pop():void 0}function Dr(t,e){return typeof Ke(t)=="number"?t.pop():e}var Cr=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Er(t){return P(t==null?void 0:t.then)}function Pr(t){return P(t[Ye])}function Tr(t){return Symbol.asyncIterator&&P(t==null?void 0:t[Symbol.asyncIterator])}function Fr(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 Fs(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Nr=Fs();function kr(t){return P(t==null?void 0:t[Nr])}function Or(t){return ps(this,arguments,function(){var n,r,i,o;return gr(this,function(a){switch(a.label){case 0:n=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,bt(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,bt(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,bt(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Ir(t){return P(t==null?void 0:t.getReader)}function z(t){if(t instanceof C)return t;if(t!=null){if(Pr(t))return Ns(t);if(Cr(t))return ks(t);if(Er(t))return Os(t);if(Tr(t))return Rr(t);if(kr(t))return Is(t);if(Ir(t))return Rs(t)}throw Fr(t)}function Ns(t){return new C(function(e){var n=t[Ye]();if(P(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ks(t){return new C(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Os(t){return new C(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,_r)})}function Is(t){return new C(function(e){var n,r;try{for(var i=wt(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Rr(t){return new C(function(e){Ls(t,e).catch(function(n){return e.error(n)})})}function Rs(t){return Rr(Or(t))}function Ls(t,e){var n,r,i,o;return ds(this,void 0,void 0,function(){var a,u;return gr(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(a=r.value,e.next(a),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&&(o=n.return)?[4,o.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 it(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function Lr(t,e){return e===void 0&&(e=0),k(function(n,r){n.subscribe(O(r,function(i){return it(r,t,function(){return r.next(i)},e)},function(){return it(r,t,function(){return r.complete()},e)},function(i){return it(r,t,function(){return r.error(i)},e)}))})}function Vr(t,e){return e===void 0&&(e=0),k(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Vs(t,e){return z(t).pipe(Vr(e),Lr(e))}function Gs(t,e){return z(t).pipe(Vr(e),Lr(e))}function zs(t,e){return new C(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function Us(t,e){return new C(function(n){var r;return it(n,e,function(){r=t[Nr](),it(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(u){n.error(u);return}a?n.complete():n.next(o)},0,!0)}),function(){return P(r==null?void 0:r.return)&&r.return()}})}function Gr(t,e){if(!t)throw new Error("Iterable cannot be null");return new C(function(n){it(n,e,function(){var r=t[Symbol.asyncIterator]();it(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function Hs(t,e){return Gr(Or(t),e)}function Xs(t,e){if(t!=null){if(Pr(t))return Vs(t,e);if(Cr(t))return zs(t,e);if(Er(t))return Gs(t,e);if(Tr(t))return Gr(t,e);if(kr(t))return Us(t,e);if(Ir(t))return Hs(t,e)}throw Fr(t)}function At(t,e){return e?Xs(t,e):z(t)}function Ze(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=_t(t);return At(t,n)}var zr=Ge(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function Ys(t){return t instanceof Date&&!isNaN(t)}function V(t,e){return k(function(n,r){var i=0;n.subscribe(O(r,function(o){r.next(t.call(e,o,i++))}))})}var Ws=Array.isArray;function Bs(t,e){return Ws(e)?t.apply(void 0,rt([],nt(e))):t(e)}function qs(t){return V(function(e){return Bs(t,e)})}var js=Array.isArray,Ks=Object.getPrototypeOf,Zs=Object.prototype,Js=Object.keys;function Qs(t){if(t.length===1){var e=t[0];if(js(e))return{args:e,keys:null};if(tl(e)){var n=Js(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function tl(t){return t&&typeof t=="object"&&Ks(t)===Zs}function el(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function $t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=_t(t),r=Ts(t),i=Qs(t),o=i.args,a=i.keys;if(o.length===0)return At([],n);var u=new C(nl(o,n,a?function(s){return el(a,s)}:xt));return r?u.pipe(qs(r)):u}function nl(t,e,n){return n===void 0&&(n=xt),function(r){Ur(e,function(){for(var i=t.length,o=new Array(i),a=i,u=i,s=function(f){Ur(e,function(){var c=At(t[f],e),h=!1;c.subscribe(O(r,function(d){o[f]=d,h||(h=!0,u--),u||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},l=0;l<i;l++)s(l)},r)}}function Ur(t,e,n){t?it(n,t,e):e()}function rl(t,e,n,r,i,o,a,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 v=!1;z(n(p,f++)).subscribe(O(e,function(A){e.next(A)},function(){v=!0},void 0,function(){if(v)try{l--;for(var A=function(){var S=s.shift();a||m(S)};s.length&&l<r;)A();h()}catch(S){e.error(S)}}))};return t.subscribe(O(e,d,function(){c=!0,h()})),function(){}}function Hr(t,e,n){return n===void 0&&(n=1/0),P(e)?Hr(function(r,i){return V(function(o,a){return e(r,o,i,a)})(z(t(r,i)))},n):(typeof e=="number"&&(n=e),k(function(r,i){return rl(r,i,t,n)}))}function Je(t){return t===void 0&&(t=1/0),Hr(xt,t)}function il(){return Je(1)}function Xr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return il()(At(t,_t(t)))}function ol(t){return new C(function(e){z(t()).subscribe(e)})}function al(t,e,n){return ol(function(){return t()?e:n})}function ul(t,e,n){n===void 0&&(n=Ps);var r=-1;return e!=null&&(Mr(e)?n=e:r=e),new C(function(i){var o=Ys(t)?+t-n.now():t;o<0&&(o=0);var a=0;return n.schedule(function(){i.closed||(i.next(a++),0<=r?this.schedule(void 0,r):i.complete())},o)})}function sl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=_t(t),r=Dr(t,1/0),i=t;return i.length?i.length===1?z(i[0]):Je(r)(At(i,n)):je}var ll=Array.isArray;function cl(t){return t.length===1&&ll(t[0])?t[0]:t}function Yr(t,e){return k(function(n,r){var i=0;n.subscribe(O(r,function(o){return t.call(e,o,i++)&&r.next(o)}))})}function Wr(t){return k(function(e,n){var r=null,i=!1,o;r=e.subscribe(O(n,void 0,void 0,function(a){o=z(t(a,Wr(t)(e))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}function fl(t,e){return e===void 0&&(e=qe),k(function(n,r){var i=null,o=null,a=null,u=function(){if(i){i.unsubscribe(),i=null;var l=o;o=null,r.next(l)}};function s(){var l=a+t,f=e.now();if(f<l){i=this.schedule(void 0,l-f),r.add(i);return}u()}n.subscribe(O(r,function(l){o=l,a=e.now(),i||(i=e.schedule(s,t),r.add(i))},function(){u(),r.complete()},void 0,function(){o=i=null}))})}function hl(t){return k(function(e,n){var r=!1;e.subscribe(O(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function dl(t){return t<=0?function(){return je}:k(function(e,n){var r=0;e.subscribe(O(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function Br(t,e){return e===void 0&&(e=xt),t=t??pl,k(function(n,r){var i,o=!0;n.subscribe(O(r,function(a){var u=e(a);(o||!t(i,u))&&(o=!1,i=u,r.next(a))}))})}function pl(t,e){return t===e}function ml(t){return t===void 0&&(t=gl),k(function(e,n){var r=!1;e.subscribe(O(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function gl(){return new zr}function vl(t,e){var n=arguments.length>=2;return function(r){return r.pipe(xt,dl(1),n?hl(e):ml(function(){return new zr}))}}function yl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=_t(t),r=Dr(t,1/0);return t=cl(t),k(function(i,o){Je(r)(At(rt([i],nt(t)),n)).subscribe(o)})}function wl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return yl.apply(void 0,rt([],nt(t)))}function Qe(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new T}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,u=t.resetOnRefCountZero,s=u===void 0?!0:u;return function(l){var f,c,h,d=0,m=!1,p=!1,v=function(){c==null||c.unsubscribe(),c=void 0},A=function(){v(),f=h=void 0,m=p=!1},S=function(){var _=f;A(),_==null||_.unsubscribe()};return k(function(_,M){d++,!p&&!m&&v();var w=h=h??n();M.add(function(){d--,d===0&&!p&&!m&&(c=tn(S,s))}),w.subscribe(M),!f&&d>0&&(f=new Vt({next:function(D){return w.next(D)},error:function(D){p=!0,v(),c=tn(A,i,D),w.error(D)},complete:function(){m=!0,v(),c=tn(A,a),w.complete()}}),z(_).subscribe(f))})(l)}}function tn(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 z(e.apply(void 0,rt([],nt(n)))).subscribe(i)}}function I(t,e,n){var r,i=!1;return r=t,Qe({connector:function(){return new Ms(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function me(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=_t(t);return k(function(r,i){(n?Xr(t,r,n):Xr(t,r)).subscribe(i)})}function Gt(t,e){return k(function(n,r){var i=null,o=0,a=!1,u=function(){return a&&!i&&r.complete()};n.subscribe(O(r,function(s){i==null||i.unsubscribe();var l=0,f=o++;z(t(s,f)).subscribe(i=O(r,function(c){return r.next(e?e(s,c,f,l++):c)},function(){i=null,u()}))},function(){a=!0,u()}))})}function R(t){return k(function(e,n){z(t).subscribe(O(n,function(){return n.complete()},Ue)),!n.closed&&e.subscribe(n)})}function bl(t,e){return k(function(n,r){var i=e??{},o=i.leading,a=o===void 0?!0:o,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&&(v(),h&&r.complete())},m=function(){c=null,h&&r.complete()},p=function(A){return c=z(t(A)).subscribe(O(r,d,m))},v=function(){if(l){l=!1;var A=f;f=null,r.next(A),!h&&p(A)}};n.subscribe(O(r,function(A){l=!0,f=A,!(c&&!c.closed)&&(a?v():p(A))},function(){h=!0,!(s&&l&&c&&!c.closed)&&r.complete()}))})}function xl(t,e,n){e===void 0&&(e=qe);var r=ul(t,e);return bl(function(){return r},n)}const en=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new T,i=e.pipe(R(r),V(s=>({id:null,seriesLabel:null,groupLabel:null,highlightDefault:s.highlightDefault})),Br()),o=n.pipe(R(r),Yr(s=>s.eventName==="mouseover"||s.eventName==="mousemove"),V(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})),a=n.pipe(R(r),Yr(s=>s.eventName==="mouseout"),Gt(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(v=>v.id===h||v.seriesLabel===h);f=p&&p.seriesLabel?p.seriesLabel:null}else if(d==="group"){const p=s.flat().find(v=>v.id===h||v.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(v=>v.seriesLabel===f).map(v=>v.id);m=m.concat(p)}else if(d==="group"&&c!=null&&c!=""){const p=s.flat().filter(v=>v.groupLabel===c).map(v=>v.id);m=m.concat(p)}return m};return new C(s=>($t({target:sl(o,a,i),datumList:t,fullChartParams:e}).pipe(R(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)}))},nn=({datumList$:t})=>t.pipe(V(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),qr=({datumList$:t})=>t.pipe(V(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),_l=({subject:t,observer:e})=>{const n=en({datumList$:e.computedData$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(I(1)),r=nn({datumList$:e.computedData$}).pipe(I(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,seriesHighlight$:n,SeriesDataMap$:r}},lt=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=j.scaleDomain,scaleRange:i=j.scaleRange})=>{const o=r[0]??j.scaleDomain[0],a=r[1]??j.scaleDomain[1],u=i[0]??j.scaleRange[0],s=i[1]??j.scaleRange[1],l=o==="auto"?e:o,f=a==="auto"?t:a;let c=n*u,h=n*s;return cr().domain([l,f]).range([c,h])},Al=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return ju().domain(t).range(r).padding(n)},$l=({axisLabels:t,axisWidth:e,padding:n=.5,reverse:r=!1})=>{let o=t.map((a,u)=>u);return r&&o.reverse(),fr().domain([-0,e+0]).range(o)},Sl={series:!1,grid:!0,multiGrid:!0,multiValue:!0,tree:!1,relationship:!1};function Ml(t){return new C(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 Dl=({defaultDataFormatter:t,computedDataFn:e,contextObserverFn:n})=>{const r=new T,i=t.type;return function(a,u){Wt(a).selectAll("svg").remove();const s=Wt(a).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 T,dataFormatter$:new T,plugins$:new T,chartParams$:new T,event$:new T},h=(g=>{const $=g||Ct,b=$.preset?$.preset:{};return{chartParams:b.chartParams?et(b.chartParams,on):on,dataFormatter:b.dataFormatter?et(b.dataFormatter,t):t,allPluginParams:b.allPluginParams?b.allPluginParams:{}}})(u),d=c.data$.pipe(I(1)),m=c.dataFormatter$.pipe(R(r),me({}),V(g=>et(g,h.dataFormatter)),I(1)),p=c.chartParams$.pipe(R(r),me({}),V(g=>et(g,h.chartParams)),I(1)),v=p.pipe(R(r),me({}),V(g=>et(g.padding??{},rn)));v.pipe(R(r),vl()).subscribe(g=>{l.attr("transform",`translate(${g.left}, ${g.top})`)}),v.subscribe(g=>{l.transition().attr("transform",`translate(${g.left}, ${g.top})`)});const A=Ml(a).pipe(R(r),Qe()),S=Ze().pipe(wl(A.pipe(fl(250)),A.pipe(xl(250))),Br((g,$)=>JSON.stringify(g)===JSON.stringify($)),Qe()),_=S.subscribe(),M=$t({rootSize:S,mergedPadding:v}).pipe(R(r),Gt(async g=>{const $=g.rootSize.width>0?g.rootSize.width:Kr,b=g.rootSize.height>0?g.rootSize.height:Zr;return{width:$-g.mergedPadding.left-g.mergedPadding.right,height:b-g.mergedPadding.top-g.mergedPadding.bottom,top:g.mergedPadding.top,right:g.mergedPadding.right,bottom:g.mergedPadding.bottom,left:g.mergedPadding.left,rootWidth:$,rootHeight:b}}),I(1));M.subscribe(g=>{s.attr("width",g.rootWidth).attr("height",g.rootHeight)});const w=$t({data:d,dataFormatter:m,chartParams:p,layout:al(()=>Sl[i]===!0,M,Ze(void 0))}).pipe(R(r),Gt(async g=>g),Gt(g=>Ze(g).pipe(V($=>{try{return e({data:$.data,dataFormatter:$.dataFormatter,chartParams:$.chartParams,layout:$.layout})}catch(b){throw console.error(b),new Error(b)}}),Wr(()=>je))),I(1)),D={};return c.plugins$.subscribe(g=>{if(!g)return;const $=f.selectAll("g.orbcharts__plugin").data(g,y=>y.name),b=$.enter().append("g").attr("class",y=>`orbcharts__plugin orbcharts__${y.name}`);$.exit().remove().each((y,N,E)=>{D[y.name]&&D[y.name].destroy()}),b.each((y,N,E)=>{const Y={fullParams$:new C,fullChartParams$:p,fullDataFormatter$:m,computedData$:w,layout$:M},Mt=n({observer:Y,subject:c}),Q={selection:Wt(E[N]),rootSelection:s,name:y.name,chartType:i,subject:c,observer:Mt};y.setPresetParams(h.allPluginParams[y.name]??{}),y.setContext(Q),D[Q.name]=y,y.init()})}),{...c,selection:s,destroy(){Wt(a).selectAll("svg").remove(),r.next(void 0),_.unsubscribe()}}}};class St{constructor({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r},i,o){this.data$=new T,this.dataFormatter$=new T,this.plugins$=new T,this.chartParams$=new T,this.event$=new T;const u=Dl({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r})(i,o);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 Cl extends St{constructor(e,n){super({defaultDataFormatter:Qr,computedDataFn:hs,contextObserverFn:_l},e,n)}}const jr=t=>{const{data:e=[],dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let o;try{const a=e.reduce((g,$)=>$.length>g?$.length:g,0),s=e.map((g,$)=>{if(g.length===a)return g;const b=Object.assign([],g);for(let F=b.length;F<a;F++)b[F]=null;return b}).map((g,$)=>g.map((b,F)=>{const y=n.colorsPredicate(b,$,F,t),N=n.visibleFilter(b,$,F,t);return b==null?{id:"",label:"",tooltipContent:"",data:{},value:null,_color:y,_visible:N}:typeof b=="number"?{id:"",label:"",tooltipContent:"",data:{},value:b,_color:y,_visible:N}:{id:b.id??"",label:b.label??"",tooltipContent:b.tooltipContent??"",data:b.data??{},value:b.value,_color:y,_visible:N}})),l=mr(n.grid.seriesType,s),f=n.groupAxis.position==="top"||n.groupAxis.position==="bottom"?i.width:i.height,c=l[0]?l[0].length-1:0,h=lt({maxValue:c,minValue:0,axisWidth:f,scaleDomain:[0,c],scaleRange:[0,1]}),d=[n.groupAxis.scaleDomain[0]==="auto"?0:n.groupAxis.scaleDomain[0],n.groupAxis.scaleDomain[1]==="auto"?c:n.groupAxis.scaleDomain[1]],m=l.flat().filter(g=>g._visible!=!1),[p,v]=fe(m),A=n.valueAxis.position==="left"||n.valueAxis.position==="right"?i.height:i.width,S=dr(l,n),_=pr(l,n),M=lt({maxValue:v,minValue:p,axisWidth:A,scaleDomain:[p,v],scaleRange:[0,1]}),w=M(0);let D=0;o=l.map((g,$)=>g.map((b,F)=>{const y=ce(n.type,$,F),N=_[F],E=M(b.value??0),Y={id:b.id?b.id:y,index:D,label:b.label?b.label:y,tooltipContent:b.tooltipContent?b.tooltipContent:n.tooltipContentFormat(b,$,F,t),data:b.data,value:b.value,seriesIndex:$,seriesLabel:S[$],groupIndex:F,groupLabel:N,color:b._color,axisX:h(F),axisY:E,axisYFromZero:E-w,visible:b._visible};return D++,Y}))}catch(a){throw Error(a)}return o},El=({fullDataFormatter$:t,layout$:e})=>{const n=new T;function r({xAxis:i,yAxis:o,width:a,height:u}){if(!i||!o)return{translate:[0,0],scale:[0,0],rotate:0,rotateX:0,rotateY:0,value:""};let s=0,l=0,f=0,c=0,h=0;return i.position==="bottom"?o.position==="left"?(c=180,l=u):o.position==="right"?(c=180,h=180,s=a,l=u):(c=180,l=u):i.position==="top"?o.position==="left"||(o.position==="right"?(h=180,s=a):(c=180,l=u)):i.position==="left"?o.position==="bottom"?(f=-90,l=u):o.position==="top"?(f=-90,h=180):(c=180,l=u):i.position==="right"&&(o.position==="bottom"?(f=-90,c=180,l=u,s=a):o.position==="top"?(f=-90,s=a):(c=180,l=u)),{translate:[s,l],scale:[0,0],rotate:f,rotateX:c,rotateY:h,value:`translate(${s}px, ${l}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new C(i=>($t({fullDataFormatter:t,layout:e}).pipe(R(n)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.groupAxis,yAxis:o.fullDataFormatter.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},Pl=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new T;function i({data:o,groupAxis:a,valueAxis:u,width:s,height:l}){let f=0,c=0,h=0,d=0;const m=a.position==="top"||a.position==="bottom"?s:l,p=0,v=o[0]?o[0].length-1:0,A=a.scaleDomain[0]==="auto"?p-a.scalePadding:a.scaleDomain[0]-a.scalePadding,S=a.scaleDomain[1]==="auto"?v+a.scalePadding:a.scaleDomain[1]+a.scalePadding,_=lt({maxValue:v,minValue:p,axisWidth:m,scaleDomain:[A,S],scaleRange:[0,1]}),M=_(p),w=_(v);f=M,h=(w-M)/m;const g=o.map((Mt,Dt)=>Mt.filter((Q,ft)=>ft>=A&&ft<=S&&Q.visible==!0)),$=Le(g),b=u.position==="left"||u.position==="right"?l:s,F=lt({maxValue:$[1],minValue:$[0],axisWidth:b,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),y=Le(o),N=F(y[0]),E=F(y[1]);return c=N,d=(E-N)/b,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new C(o=>($t({computedData:t,fullDataFormatter:e,layout:n}).pipe(R(r)).subscribe(a=>{const u=i({data:a.computedData,groupAxis:a.fullDataFormatter.groupAxis,valueAxis:a.fullDataFormatter.valueAxis,width:a.layout.width,height:a.layout.height});o.next(u)}),function(){r.next(void 0)}))},Tl=({gridAxesTransform$:t})=>t.pipe(V(e=>{const n=[0,0],r=[e.scale[0]*-1,e.scale[1]*-1],i=e.rotate*-1,o=e.rotateX*-1,a=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:o,rotateY:a,value:`translate(${n[0]}px, ${n[1]}px) rotate(${i}deg) rotateX(${o}deg) rotateY(${a}deg)`}})),Fl=({fullDataFormatter$:t,layout$:e})=>{const n=new T;function r({xAxisPosition:i,yAxisPosition:o,width:a,height:u}){if((i==="bottom"||i==="top")&&(o==="left"||o==="right"))return{width:a,height:u};if((i==="left"||i==="right")&&(o==="bottom"||o==="top"))return{width:u,height:a}}return new C(i=>{$t({fullDataFormatter:t,layout:e}).pipe(R(n),Gt(async o=>o)).subscribe(o=>{const a=r({xAxisPosition:o.fullDataFormatter.groupAxis.position,yAxisPosition:o.fullDataFormatter.valueAxis.position,width:o.layout.width,height:o.layout.height});return i.next(a),function(){n.next(void 0)}})})},Nl=({computedData$:t})=>t.pipe(V(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),kl=({subject:t,observer:e})=>{const n=El({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(I(1)),r=Pl({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(I(1)),i=Tl({gridAxesTransform$:n}).pipe(I(1)),o=Fl({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(I(1)),a=e.computedData$.pipe(V(c=>c.flat())).pipe(I(1)),u=en({datumList$:a,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(I(1)),s=nn({datumList$:a}).pipe(I(1)),l=qr({datumList$:a}).pipe(I(1)),f=Nl({computedData$:e.computedData$}).pipe(I(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,gridAxesTransform$:n,gridGraphicTransform$:r,gridAxesOppositeTransform$:i,gridAxesSize$:o,gridHighlight$:u,SeriesDataMap$:s,GroupDataMap$:l,visibleComputedData$:f}};class Ol extends St{constructor(e,n){super({defaultDataFormatter:ti,computedDataFn:jr,contextObserverFn:kl},e,n)}}const Il=({data:t=[],dataFormatter:e,chartParams:n,layout:r})=>{if(!t.length)return[];let i=[];try{i=t.map((o,a)=>{const u={...e.multiGrid[a],type:`multiGrid_${a}`,colorsPredicate:e.multiGrid[a].colorsPredicate,visibleFilter:e.visibleFilter,tooltipContentFormat:e.tooltipContentFormat};return jr({data:o,dataFormatter:u,chartParams:n,layout:r})})}catch(o){throw Error(o)}return i},Rl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Ll extends St{constructor(e,n){super({defaultDataFormatter:ei,computedDataFn:Il,contextObserverFn:Rl},e,n)}}const Vl=t=>{const{data:e,dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let o=[];try{const a=e.map((_,M)=>_.map((w,D)=>typeof w=="number"?{id:"",label:"",tooltipContent:"",data:{},value:w}:{id:w.id??"",label:w.label??"",tooltipContent:w.tooltipContent??"",data:w.data??{},value:w.value})),[u,s]=fe(a.map(_=>_[0])),[l,f]=fe(a.map(_=>_[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=lt({maxValue:s,minValue:u,axisWidth:c,scaleDomain:[u,s],scaleRange:[0,1]}),m=lt({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]],v=[n.yAxis.scaleDomain[0]==="auto"?l:n.yAxis.scaleDomain[0],n.yAxis.scaleDomain[1]==="auto"?f:n.yAxis.scaleDomain[1]],A=(_,M,w,D)=>w===0&&_.value!=null&&(_.value<p[0]||_.value>p[1])||w===1&&_.value!=null&&(_.value<v[0]||_.value>v[1])?!1:n.visibleFilter(_,M,w,D);let S=0;o=a.map((_,M)=>_.map((w,D)=>{const g=S;S++;const $=ce(n.type,M,D),b=A(w,M,D,t);return{id:w.id?w.id:$,index:g,label:w.label?w.label:$,tooltipContent:w.tooltipContent?w.tooltipContent:n.tooltipContentFormat(w,M,D,t),data:w.data,value:w.value,axis:D==0?d(w.value):m(w.value),visible:b}}))}catch(a){throw Error(a)}return o},Gl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class zl extends St{constructor(e,n){super({defaultDataFormatter:ni,computedDataFn:Vl,contextObserverFn:Gl},e,n)}}const Ul=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;let i=[],o=[];try{let a=[],u=[];if(e.nodes)a=e.nodes,u=e.edges;else if(e[0])a=e[0],u=e[1];else return{nodes:[],edges:[]};i=a.map((c,h)=>({id:c.id,index:h,label:c.label??"",tooltipContent:c.tooltipContent?c.tooltipContent:n.tooltipContentFormat(c,0,h,t),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]));o=u.map((c,h)=>({id:c.id,index:h,label:c.label??"",tooltipContent:c.tooltipContent?c.tooltipContent:n.tooltipContentFormat(c,1,h,t),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 o.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 o.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(a){throw Error(a)}return{nodes:i,edges:o}},Hl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Xl extends St{constructor(e,n){super({defaultDataFormatter:ii,computedDataFn:Ul,contextObserverFn:Hl},e,n)}}const Yl=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;let i={id:"",index:0,label:"",visible:!0,tooltipContent:"",data:{},value:0,level:0,seq:0,children:[]};try{const o=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,tooltipContent:c.tooltipContent,value:c.value,children:(l.get(c.id)??[]).map(h=>f(h))});return s?f(s):{id:""}}();let a=0;const u=(s,l,f)=>{const c=l+1,h=n.visibleFilter(s,l,f,t),d=a;return a++,{id:s.id,index:d,level:l,seq:f,label:s.label??"",data:s.data??{},tooltipContent:s.tooltipContent?s.tooltipContent:n.tooltipContentFormat(s,l,f,t),value:s.value,visible:h,children:(s.children??[]).map((m,p)=>u(m,c,p))}};i=u(o,0,0)}catch(o){throw Error(o)}return i},Wl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Bl extends St{constructor(e,n){super({defaultDataFormatter:ri,computedDataFn:Yl,contextObserverFn:Wl},e,n)}}function ql({name:t,defaultParams:e,initFn:n}){const r=new T,i=new T,o=new WeakMap;let a=()=>{},u,s=e;return{params$:i,name:t,defaultParams:e,init(){u&&(a=n(u)??(()=>{}),o.set(u.selection,u))},destroy(){a(),u&&(u.selection.remove(),u=void 0),r.next(void 0)},setPresetParams:l=>{s=et(l,e)},setContext:l=>{u=l,u.observer.fullParams$=i.pipe(R(r),me({}),V(f=>et(f,s)),I(1))}}}const ct=()=>function(e,n){return function(i){return class{constructor(){const a=ql({name:e,defaultParams:n,initFn:i});this.params$=a.params$,this.name=a.name,this.defaultParams=a.defaultParams,this.init=a.init,this.destroy=a.destroy,this.setPresetParams=a.setPresetParams,this.setContext=a.setContext}}}},jl=ct(),Kl=ct(),Zl=ct(),Jl=ct(),Ql=ct(),tc=ct(),ec=ct();x.GridChart=Ol,x.MultiGridChart=Ll,x.MultiValueChart=zl,x.RelationshipChart=Xl,x.SeriesChart=Cl,x.TreeChart=Bl,x.createAxisLinearScale=lt,x.createAxisPointScale=Al,x.createAxisQuantizeScale=$l,x.createDefaultDatumId=ce,x.createDefaultGroupLabel=hr,x.createDefaultSeriesLabel=Re,x.createGridGroupLabels=pr,x.createGridSeriesLabels=dr,x.defineGridPlugin=Kl,x.defineMultiGridPlugin=Zl,x.defineMultiValuePlugin=Jl,x.defineNoneDataPlugin=Ql,x.defineRelationshipPlugin=tc,x.defineSeriesPlugin=jl,x.defineTreePlugin=ec,x.formatCommaNumber=as,x.formatValueToLabel=us,x.getMinAndMax=yt,x.getMinAndMaxGrid=Le,x.getMinAndMaxMultiGrid=ls,x.getMinAndMaxMultiValue=cs,x.getMinAndMaxSeries=ss,x.getMinAndMaxValue=fe,x.groupDataMapObservable=qr,x.highlightObservable=en,x.isFunction=os,x.isObject=q,x.mergeOptionsWithDefault=et,x.seriesDataMapObservable=nn,x.transposeData=mr,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
@@ -2,12 +2,12 @@ import { Observable } from 'rxjs';
|
|
2
2
|
import { ComputedDataTypeMap, DataFormatterTypeMap, DataFormatterGrid, Layout, TransformData } from '../types';
|
3
3
|
|
4
4
|
export declare const gridAxesTransformObservable: ({ fullDataFormatter$, layout$ }: {
|
5
|
-
fullDataFormatter$: Observable<DataFormatterTypeMap<
|
5
|
+
fullDataFormatter$: Observable<DataFormatterTypeMap<"grid">>;
|
6
6
|
layout$: Observable<Layout>;
|
7
7
|
}) => Observable<TransformData>;
|
8
8
|
export declare const gridGraphicTransformObservable: ({ computedData$, fullDataFormatter$, layout$ }: {
|
9
|
-
computedData$: Observable<ComputedDataTypeMap<
|
10
|
-
fullDataFormatter$: Observable<DataFormatterTypeMap<
|
9
|
+
computedData$: Observable<ComputedDataTypeMap<"grid">>;
|
10
|
+
fullDataFormatter$: Observable<DataFormatterTypeMap<"grid">>;
|
11
11
|
layout$: Observable<Layout>;
|
12
12
|
}) => Observable<TransformData>;
|
13
13
|
export declare const gridAxesOppositeTransformObservable: ({ gridAxesTransform$ }: {
|
@@ -21,5 +21,5 @@ export declare const gridAxesSizeObservable: ({ fullDataFormatter$, layout$ }: {
|
|
21
21
|
height: number;
|
22
22
|
}>;
|
23
23
|
export declare const gridVisibleComputedDataObservable: ({ computedData$ }: {
|
24
|
-
computedData$: Observable<ComputedDataTypeMap<
|
24
|
+
computedData$: Observable<ComputedDataTypeMap<"grid">>;
|
25
25
|
}) => Observable<import('../types').ComputedDatumGrid[][]>;
|
@@ -2,7 +2,7 @@ import { Subject, Observable } from 'rxjs';
|
|
2
2
|
import { ChartParams, ComputedDataTypeMap } from '../types';
|
3
3
|
|
4
4
|
export declare const seriesHighlightObservable: ({ computedData$, fullChartParams$, event$ }: {
|
5
|
-
computedData$: Observable<ComputedDataTypeMap<
|
5
|
+
computedData$: Observable<ComputedDataTypeMap<"series">>;
|
6
6
|
fullChartParams$: Observable<ChartParams>;
|
7
7
|
event$: Subject<any>;
|
8
8
|
}) => Observable<string[]>;
|
@@ -3,14 +3,8 @@ export declare const createAxisLinearScale: ({ maxValue, minValue, axisWidth, sc
|
|
3
3
|
maxValue: number;
|
4
4
|
minValue: number;
|
5
5
|
axisWidth: number;
|
6
|
-
scaleDomain: [
|
7
|
-
|
8
|
-
number | 'auto'
|
9
|
-
];
|
10
|
-
scaleRange: [
|
11
|
-
number,
|
12
|
-
number
|
13
|
-
];
|
6
|
+
scaleDomain: [number | "auto", number | "auto"];
|
7
|
+
scaleRange: [number, number];
|
14
8
|
}) => d3.ScaleLinear<number, number, never>;
|
15
9
|
export declare const createAxisPointScale: ({ axisLabels, axisWidth, padding }: {
|
16
10
|
axisLabels: string[];
|
@@ -2,7 +2,7 @@ import { Subject, Observable } from 'rxjs';
|
|
2
2
|
import { ChartType, ChartParams, ComputedDatumTypeMap } from '../types';
|
3
3
|
|
4
4
|
export declare const highlightObservable: ({ datumList$, fullChartParams$, event$ }: {
|
5
|
-
datumList$: Observable<ComputedDatumTypeMap<
|
5
|
+
datumList$: Observable<ComputedDatumTypeMap<"series" | "grid">[]>;
|
6
6
|
fullChartParams$: Observable<ChartParams>;
|
7
7
|
event$: Subject<any>;
|
8
8
|
}) => Observable<string[]>;
|