UNPKG

@iqmo/browser

Version:

Browser Stlite

1 lines 852 kB
var aa=Object.defineProperty,sa=(t,e,r)=>e in t?aa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zt=(t,e,r)=>sa(t,typeof e!="symbol"?e+"":e,r);import{c as ua,r as Pn,b5 as la,l as ca,j as vr}from"./index-C9lG8Cnd.js";import{T as ha,t as yr,d as xe,a as ze,i as mr,n as gr,b as fa,p as da}from"./timer-CG6h77SV.js";import{q as wr,u as fe,x as Er,A as de,k as zn,b as zt}from"./value-DKQTM160.js";import{S as Yn,T as pa}from"./Toolbar-CicI5PGk.js";import{w as _a,E as va}from"./withFullScreenWrapper-mfur2-_a.js";function te(t,e,r){var n=new ha;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var br="http://www.w3.org/1999/xhtml";const jn={svg:"http://www.w3.org/2000/svg",xhtml:br,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ye(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),jn.hasOwnProperty(e)?{space:jn[e],local:t}:t}function ya(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===br&&e.documentElement.namespaceURI===br?e.createElement(t):e.createElementNS(r,t)}}function ma(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Tn(t){var e=Ye(t);return(e.local?ma:ya)(e)}function ga(){}function xr(t){return t==null?ga:function(){return this.querySelector(t)}}function wa(t){typeof t!="function"&&(t=xr(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var u=e[i],s=u.length,c=n[i]=new Array(s),h,p,_=0;_<s;++_)(h=u[_])&&(p=t.call(h,h.__data__,_,u))&&("__data__"in h&&(p.__data__=h.__data__),c[_]=p);return new Bt(n,this._parents)}function Ea(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function ba(){return[]}function Cn(t){return t==null?ba:function(){return this.querySelectorAll(t)}}function xa(t){return function(){return Ea(t.apply(this,arguments))}}function Ba(t){typeof t=="function"?t=xa(t):t=Cn(t);for(var e=this._groups,r=e.length,n=[],i=[],u=0;u<r;++u)for(var s=e[u],c=s.length,h,p=0;p<c;++p)(h=s[p])&&(n.push(t.call(h,h.__data__,p,s)),i.push(h));return new Bt(n,i)}function Un(t){return function(){return this.matches(t)}}function Zn(t){return function(e){return e.matches(t)}}var La=Array.prototype.find;function Oa(t){return function(){return La.call(this.children,t)}}function Ga(){return this.firstElementChild}function Da(t){return this.select(t==null?Ga:Oa(typeof t=="function"?t:Zn(t)))}var Ia=Array.prototype.filter;function Fa(){return Array.from(this.children)}function Ma(t){return function(){return Ia.call(this.children,t)}}function Sa(t){return this.selectAll(t==null?Fa:Ma(typeof t=="function"?t:Zn(t)))}function Ra(t){typeof t!="function"&&(t=Un(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var u=e[i],s=u.length,c=n[i]=[],h,p=0;p<s;++p)(h=u[p])&&t.call(h,h.__data__,p,u)&&c.push(h);return new Bt(n,this._parents)}function Wn(t){return new Array(t.length)}function Pa(){return new Bt(this._enter||this._groups.map(Wn),this._parents)}function je(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}je.prototype={constructor:je,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 za(t){return function(){return t}}function Ya(t,e,r,n,i,u){for(var s=0,c,h=e.length,p=u.length;s<p;++s)(c=e[s])?(c.__data__=u[s],n[s]=c):r[s]=new je(t,u[s]);for(;s<h;++s)(c=e[s])&&(i[s]=c)}function ja(t,e,r,n,i,u,s){var c,h,p=new Map,_=e.length,E=u.length,w=new Array(_),g;for(c=0;c<_;++c)(h=e[c])&&(w[c]=g=s.call(h,h.__data__,c,e)+"",p.has(g)?i[c]=h:p.set(g,h));for(c=0;c<E;++c)g=s.call(t,u[c],c,u)+"",(h=p.get(g))?(n[c]=h,h.__data__=u[c],p.delete(g)):r[c]=new je(t,u[c]);for(c=0;c<_;++c)(h=e[c])&&p.get(w[c])===h&&(i[c]=h)}function Ta(t){return t.__data__}function Ca(t,e){if(!arguments.length)return Array.from(this,Ta);var r=e?ja:Ya,n=this._parents,i=this._groups;typeof t!="function"&&(t=za(t));for(var u=i.length,s=new Array(u),c=new Array(u),h=new Array(u),p=0;p<u;++p){var _=n[p],E=i[p],w=E.length,g=Ua(t.call(_,_&&_.__data__,p,n)),F=g.length,B=c[p]=new Array(F),D=s[p]=new Array(F),G=h[p]=new Array(w);r(_,E,B,D,G,g,e);for(var j=0,z=0,M,S;j<F;++j)if(M=B[j]){for(j>=z&&(z=j+1);!(S=D[z])&&++z<F;);M._next=S||null}}return s=new Bt(s,n),s._enter=c,s._exit=h,s}function Ua(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Za(){return new Bt(this._exit||this._groups.map(Wn),this._parents)}function Wa(t,e,r){var n=this.enter(),i=this,u=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),r==null?u.remove():r(u),n&&i?n.merge(i).order():i}function Ka(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,i=r.length,u=n.length,s=Math.min(i,u),c=new Array(i),h=0;h<s;++h)for(var p=r[h],_=n[h],E=p.length,w=c[h]=new Array(E),g,F=0;F<E;++F)(g=p[F]||_[F])&&(w[F]=g);for(;h<i;++h)c[h]=r[h];return new Bt(c,this._parents)}function Ha(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n=t[e],i=n.length-1,u=n[i],s;--i>=0;)(s=n[i])&&(u&&s.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(s,u),u=s);return this}function Qa(t){t||(t=Xa);function e(E,w){return E&&w?t(E.__data__,w.__data__):!E-!w}for(var r=this._groups,n=r.length,i=new Array(n),u=0;u<n;++u){for(var s=r[u],c=s.length,h=i[u]=new Array(c),p,_=0;_<c;++_)(p=s[_])&&(h[_]=p);h.sort(e)}return new Bt(i,this._parents).order()}function Xa(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Na(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ka(){return Array.from(this)}function Va(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,u=n.length;i<u;++i){var s=n[i];if(s)return s}return null}function qa(){let t=0;for(const e of this)++t;return t}function $a(){return!this.node()}function Ja(t){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var i=e[r],u=0,s=i.length,c;u<s;++u)(c=i[u])&&t.call(c,c.__data__,u,i);return this}function Aa(t){return function(){this.removeAttribute(t)}}function ts(t){return function(){this.removeAttributeNS(t.space,t.local)}}function es(t,e){return function(){this.setAttribute(t,e)}}function rs(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ns(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function os(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function is(t,e){var r=Ye(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?ts:Aa:typeof e=="function"?r.local?os:ns:r.local?rs:es)(r,e))}function Kn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function as(t){return function(){this.style.removeProperty(t)}}function ss(t,e,r){return function(){this.style.setProperty(t,e,r)}}function us(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function ls(t,e,r){return arguments.length>1?this.each((e==null?as:typeof e=="function"?us:ss)(t,e,r??"")):pe(this.node(),t)}function pe(t,e){return t.style.getPropertyValue(e)||Kn(t).getComputedStyle(t,null).getPropertyValue(e)}function cs(t){return function(){delete this[t]}}function hs(t,e){return function(){this[t]=e}}function fs(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function ds(t,e){return arguments.length>1?this.each((e==null?cs:typeof e=="function"?fs:hs)(t,e)):this.node()[t]}function Hn(t){return t.trim().split(/^|\s+/)}function Br(t){return t.classList||new Qn(t)}function Qn(t){this._node=t,this._names=Hn(t.getAttribute("class")||"")}Qn.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 r=Br(t),n=-1,i=e.length;++n<i;)r.add(e[n])}function Nn(t,e){for(var r=Br(t),n=-1,i=e.length;++n<i;)r.remove(e[n])}function ps(t){return function(){Xn(this,t)}}function _s(t){return function(){Nn(this,t)}}function vs(t,e){return function(){(e.apply(this,arguments)?Xn:Nn)(this,t)}}function ys(t,e){var r=Hn(t+"");if(arguments.length<2){for(var n=Br(this.node()),i=-1,u=r.length;++i<u;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof e=="function"?vs:e?ps:_s)(r,e))}function ms(){this.textContent=""}function gs(t){return function(){this.textContent=t}}function ws(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Es(t){return arguments.length?this.each(t==null?ms:(typeof t=="function"?ws:gs)(t)):this.node().textContent}function bs(){this.innerHTML=""}function xs(t){return function(){this.innerHTML=t}}function Bs(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Ls(t){return arguments.length?this.each(t==null?bs:(typeof t=="function"?Bs:xs)(t)):this.node().innerHTML}function Os(){this.nextSibling&&this.parentNode.appendChild(this)}function Gs(){return this.each(Os)}function Ds(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Is(){return this.each(Ds)}function Fs(t){var e=typeof t=="function"?t:Tn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Ms(){return null}function Ss(t,e){var r=typeof t=="function"?t:Tn(t),n=e==null?Ms:typeof e=="function"?e:xr(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function Rs(){var t=this.parentNode;t&&t.removeChild(this)}function Ps(){return this.each(Rs)}function zs(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ys(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function js(t){return this.select(t?Ys:zs)}function Ts(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Cs(t){return function(e){t.call(this,e,this.__data__)}}function Us(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function Zs(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,u;r<i;++r)u=e[r],(!t.type||u.type===t.type)&&u.name===t.name?this.removeEventListener(u.type,u.listener,u.options):e[++n]=u;++n?e.length=n:delete this.__on}}}function Ws(t,e,r){return function(){var n=this.__on,i,u=Cs(e);if(n){for(var s=0,c=n.length;s<c;++s)if((i=n[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=u,i.options=r),i.value=e;return}}this.addEventListener(t.type,u,r),i={type:t.type,name:t.name,value:e,listener:u,options:r},n?n.push(i):this.__on=[i]}}function Ks(t,e,r){var n=Us(t+""),i,u=n.length,s;if(arguments.length<2){var c=this.node().__on;if(c){for(var h=0,p=c.length,_;h<p;++h)for(i=0,_=c[h];i<u;++i)if((s=n[i]).type===_.type&&s.name===_.name)return _.value}return}for(c=e?Ws:Zs,i=0;i<u;++i)this.each(c(n[i],e,r));return this}function kn(t,e,r){var n=Kn(t),i=n.CustomEvent;typeof i=="function"?i=new i(e,r):(i=n.document.createEvent("Event"),r?(i.initEvent(e,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Hs(t,e){return function(){return kn(this,t,e)}}function Qs(t,e){return function(){return kn(this,t,e.apply(this,arguments))}}function Xs(t,e){return this.each((typeof e=="function"?Qs:Hs)(t,e))}function*Ns(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,u=n.length,s;i<u;++i)(s=n[i])&&(yield s)}var Vn=[null];function Bt(t,e){this._groups=t,this._parents=e}function Be(){return new Bt([[document.documentElement]],Vn)}function ks(){return this}Bt.prototype=Be.prototype={constructor:Bt,select:wa,selectAll:Ba,selectChild:Da,selectChildren:Sa,filter:Ra,data:Ca,enter:Pa,exit:Za,join:Wa,merge:Ka,selection:ks,order:Ha,sort:Qa,call:Na,nodes:ka,node:Va,size:qa,empty:$a,each:Ja,attr:is,style:ls,property:ds,classed:ys,text:Es,html:Ls,raise:Gs,lower:Is,append:Fs,insert:Ss,remove:Ps,clone:js,datum:Ts,on:Ks,dispatch:Xs,[Symbol.iterator]:Ns};function Vs(t){return typeof t=="string"?new Bt([[document.querySelector(t)]],[document.documentElement]):new Bt([[t]],Vn)}var qs=xe("start","end","cancel","interrupt"),$s=[],qn=0,$n=1,Lr=2,Te=3,Jn=4,Or=5,Ce=6;function Ue(t,e,r,n,i,u){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;Js(t,r,{name:e,index:n,group:i,on:qs,tween:$s,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:qn})}function Gr(t,e){var r=Yt(t,e);if(r.state>qn)throw new Error("too late; already scheduled");return r}function Wt(t,e){var r=Yt(t,e);if(r.state>Te)throw new Error("too late; already running");return r}function Yt(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Js(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=yr(u,0,r.time);function u(p){r.state=$n,r.timer.restart(s,r.delay,r.time),r.delay<=p&&s(p-r.delay)}function s(p){var _,E,w,g;if(r.state!==$n)return h();for(_ in n)if(g=n[_],g.name===r.name){if(g.state===Te)return te(s);g.state===Jn?(g.state=Ce,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete n[_]):+_<e&&(g.state=Ce,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete n[_])}if(te(function(){r.state===Te&&(r.state=Jn,r.timer.restart(c,r.delay,r.time),c(p))}),r.state=Lr,r.on.call("start",t,t.__data__,r.index,r.group),r.state===Lr){for(r.state=Te,i=new Array(w=r.tween.length),_=0,E=-1;_<w;++_)(g=r.tween[_].value.call(t,t.__data__,r.index,r.group))&&(i[++E]=g);i.length=E+1}}function c(p){for(var _=p<r.duration?r.ease.call(null,p/r.duration):(r.timer.restart(h),r.state=Or,1),E=-1,w=i.length;++E<w;)i[E].call(t,_);r.state===Or&&(r.on.call("end",t,t.__data__,r.index,r.group),h())}function h(){r.state=Ce,r.timer.stop(),delete n[e];for(var p in n)return;delete t.__transition}}function As(t,e){var r=t.__transition,n,i,u=!0,s;if(r){e=e==null?null:e+"";for(s in r){if((n=r[s]).name!==e){u=!1;continue}i=n.state>Lr&&n.state<Or,n.state=Ce,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[s]}u&&delete t.__transition}}function tu(t){return this.each(function(){As(this,t)})}function eu(t,e){var r,n;return function(){var i=Wt(this,t),u=i.tween;if(u!==r){n=r=u;for(var s=0,c=n.length;s<c;++s)if(n[s].name===e){n=n.slice(),n.splice(s,1);break}}i.tween=n}}function ru(t,e,r){var n,i;if(typeof r!="function")throw new Error;return function(){var u=Wt(this,t),s=u.tween;if(s!==n){i=(n=s).slice();for(var c={name:e,value:r},h=0,p=i.length;h<p;++h)if(i[h].name===e){i[h]=c;break}h===p&&i.push(c)}u.tween=i}}function nu(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n=Yt(this.node(),r).tween,i=0,u=n.length,s;i<u;++i)if((s=n[i]).name===t)return s.value;return null}return this.each((e==null?eu:ru)(r,t,e))}function Dr(t,e,r){var n=t._id;return t.each(function(){var i=Wt(this,n);(i.value||(i.value={}))[e]=r.apply(this,arguments)}),function(i){return Yt(i,n).value[e]}}function An(t,e){var r;return(typeof e=="number"?wr:e instanceof de?fe:(r=de(e))?(e=r,fe):Er)(t,e)}function ou(t){return function(){this.removeAttribute(t)}}function iu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function au(t,e,r){var n,i=r+"",u;return function(){var s=this.getAttribute(t);return s===i?null:s===n?u:u=e(n=s,r)}}function su(t,e,r){var n,i=r+"",u;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===n?u:u=e(n=s,r)}}function uu(t,e,r){var n,i,u;return function(){var s,c=r(this),h;return c==null?void this.removeAttribute(t):(s=this.getAttribute(t),h=c+"",s===h?null:s===n&&h===i?u:(i=h,u=e(n=s,c)))}}function lu(t,e,r){var n,i,u;return function(){var s,c=r(this),h;return c==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),h=c+"",s===h?null:s===n&&h===i?u:(i=h,u=e(n=s,c)))}}function cu(t,e){var r=Ye(t),n=r==="transform"?ze:An;return this.attrTween(t,typeof e=="function"?(r.local?lu:uu)(r,n,Dr(this,"attr."+t,e)):e==null?(r.local?iu:ou)(r):(r.local?su:au)(r,n,e))}function hu(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function fu(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function du(t,e){var r,n;function i(){var u=e.apply(this,arguments);return u!==n&&(r=(n=u)&&fu(t,u)),r}return i._value=e,i}function pu(t,e){var r,n;function i(){var u=e.apply(this,arguments);return u!==n&&(r=(n=u)&&hu(t,u)),r}return i._value=e,i}function _u(t,e){var r="attr."+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;var n=Ye(t);return this.tween(r,(n.local?du:pu)(n,e))}function vu(t,e){return function(){Gr(this,t).delay=+e.apply(this,arguments)}}function yu(t,e){return e=+e,function(){Gr(this,t).delay=e}}function mu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?vu:yu)(e,t)):Yt(this.node(),e).delay}function gu(t,e){return function(){Wt(this,t).duration=+e.apply(this,arguments)}}function wu(t,e){return e=+e,function(){Wt(this,t).duration=e}}function Eu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?gu:wu)(e,t)):Yt(this.node(),e).duration}function bu(t,e){if(typeof e!="function")throw new Error;return function(){Wt(this,t).ease=e}}function xu(t){var e=this._id;return arguments.length?this.each(bu(e,t)):Yt(this.node(),e).ease}function Bu(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;Wt(this,t).ease=r}}function Lu(t){if(typeof t!="function")throw new Error;return this.each(Bu(this._id,t))}function Ou(t){typeof t!="function"&&(t=Un(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var u=e[i],s=u.length,c=n[i]=[],h,p=0;p<s;++p)(h=u[p])&&t.call(h,h.__data__,p,u)&&c.push(h);return new Nt(n,this._parents,this._name,this._id)}function Gu(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,i=r.length,u=Math.min(n,i),s=new Array(n),c=0;c<u;++c)for(var h=e[c],p=r[c],_=h.length,E=s[c]=new Array(_),w,g=0;g<_;++g)(w=h[g]||p[g])&&(E[g]=w);for(;c<n;++c)s[c]=e[c];return new Nt(s,this._parents,this._name,this._id)}function Du(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function Iu(t,e,r){var n,i,u=Du(e)?Gr:Wt;return function(){var s=u(this,t),c=s.on;c!==n&&(i=(n=c).copy()).on(e,r),s.on=i}}function Fu(t,e){var r=this._id;return arguments.length<2?Yt(this.node(),r).on.on(t):this.each(Iu(r,t,e))}function Mu(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Su(){return this.on("end.remove",Mu(this._id))}function Ru(t){var e=this._name,r=this._id;typeof t!="function"&&(t=xr(t));for(var n=this._groups,i=n.length,u=new Array(i),s=0;s<i;++s)for(var c=n[s],h=c.length,p=u[s]=new Array(h),_,E,w=0;w<h;++w)(_=c[w])&&(E=t.call(_,_.__data__,w,c))&&("__data__"in _&&(E.__data__=_.__data__),p[w]=E,Ue(p[w],e,r,w,p,Yt(_,r)));return new Nt(u,this._parents,e,r)}function Pu(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Cn(t));for(var n=this._groups,i=n.length,u=[],s=[],c=0;c<i;++c)for(var h=n[c],p=h.length,_,E=0;E<p;++E)if(_=h[E]){for(var w=t.call(_,_.__data__,E,h),g,F=Yt(_,r),B=0,D=w.length;B<D;++B)(g=w[B])&&Ue(g,e,r,B,w,F);u.push(w),s.push(_)}return new Nt(u,s,e,r)}var zu=Be.prototype.constructor;function Yu(){return new zu(this._groups,this._parents)}function ju(t,e){var r,n,i;return function(){var u=pe(this,t),s=(this.style.removeProperty(t),pe(this,t));return u===s?null:u===r&&s===n?i:i=e(r=u,n=s)}}function to(t){return function(){this.style.removeProperty(t)}}function Tu(t,e,r){var n,i=r+"",u;return function(){var s=pe(this,t);return s===i?null:s===n?u:u=e(n=s,r)}}function Cu(t,e,r){var n,i,u;return function(){var s=pe(this,t),c=r(this),h=c+"";return c==null&&(h=c=(this.style.removeProperty(t),pe(this,t))),s===h?null:s===n&&h===i?u:(i=h,u=e(n=s,c))}}function Uu(t,e){var r,n,i,u="style."+e,s="end."+u,c;return function(){var h=Wt(this,t),p=h.on,_=h.value[u]==null?c||(c=to(e)):void 0;(p!==r||i!==_)&&(n=(r=p).copy()).on(s,i=_),h.on=n}}function Zu(t,e,r){var n=(t+="")=="transform"?mr:An;return e==null?this.styleTween(t,ju(t,n)).on("end.style."+t,to(t)):typeof e=="function"?this.styleTween(t,Cu(t,n,Dr(this,"style."+t,e))).each(Uu(this._id,t)):this.styleTween(t,Tu(t,n,e),r).on("end.style."+t,null)}function Wu(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function Ku(t,e,r){var n,i;function u(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&Wu(t,s,r)),n}return u._value=e,u}function Hu(t,e,r){var n="style."+(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;return this.tween(n,Ku(t,e,r??""))}function Qu(t){return function(){this.textContent=t}}function Xu(t){return function(){var e=t(this);this.textContent=e??""}}function Nu(t){return this.tween("text",typeof t=="function"?Xu(Dr(this,"text",t)):Qu(t==null?"":t+""))}function ku(t){return function(e){this.textContent=t.call(this,e)}}function Vu(t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&ku(i)),e}return n._value=t,n}function qu(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,Vu(t))}function $u(){for(var t=this._name,e=this._id,r=eo(),n=this._groups,i=n.length,u=0;u<i;++u)for(var s=n[u],c=s.length,h,p=0;p<c;++p)if(h=s[p]){var _=Yt(h,e);Ue(h,t,r,p,s,{time:_.time+_.delay+_.duration,delay:0,duration:_.duration,ease:_.ease})}return new Nt(n,this._parents,t,r)}function Ju(){var t,e,r=this,n=r._id,i=r.size();return new Promise(function(u,s){var c={value:s},h={value:function(){--i===0&&u()}};r.each(function(){var p=Wt(this,n),_=p.on;_!==t&&(e=(t=_).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(h)),p.on=e}),i===0&&u()})}var Au=0;function Nt(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function eo(){return++Au}var kt=Be.prototype;Nt.prototype={constructor:Nt,select:Ru,selectAll:Pu,selectChild:kt.selectChild,selectChildren:kt.selectChildren,filter:Ou,merge:Gu,selection:Yu,transition:$u,call:kt.call,nodes:kt.nodes,node:kt.node,size:kt.size,empty:kt.empty,each:kt.each,on:Fu,attr:cu,attrTween:_u,style:Zu,styleTween:Hu,text:Nu,textTween:qu,remove:Su,tween:nu,delay:mu,duration:Eu,ease:xu,easeVarying:Lu,end:Ju,[Symbol.iterator]:kt[Symbol.iterator]};function tl(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var el={time:null,delay:0,duration:250,ease:tl};function rl(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function nl(t){var e,r;t instanceof Nt?(e=t._id,t=t._name):(e=eo(),(r=el).time=gr(),t=t==null?null:t+"");for(var n=this._groups,i=n.length,u=0;u<i;++u)for(var s=n[u],c=s.length,h,p=0;p<c;++p)(h=s[p])&&Ue(h,t,e,p,s,r||rl(h,e));return new Nt(n,this._parents,t,e)}Be.prototype.interrupt=tu,Be.prototype.transition=nl;var Ir="http://www.w3.org/1999/xhtml";const ro={svg:"http://www.w3.org/2000/svg",xhtml:Ir,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ze(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),ro.hasOwnProperty(e)?{space:ro[e],local:t}:t}function ol(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Ir&&e.documentElement.namespaceURI===Ir?e.createElement(t):e.createElementNS(r,t)}}function il(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function no(t){var e=Ze(t);return(e.local?il:ol)(e)}function al(){}function Fr(t){return t==null?al:function(){return this.querySelector(t)}}function sl(t){typeof t!="function"&&(t=Fr(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var u=e[i],s=u.length,c=n[i]=new Array(s),h,p,_=0;_<s;++_)(h=u[_])&&(p=t.call(h,h.__data__,_,u))&&("__data__"in h&&(p.__data__=h.__data__),c[_]=p);return new Lt(n,this._parents)}function ul(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function ll(){return[]}function oo(t){return t==null?ll:function(){return this.querySelectorAll(t)}}function cl(t){return function(){return ul(t.apply(this,arguments))}}function hl(t){typeof t=="function"?t=cl(t):t=oo(t);for(var e=this._groups,r=e.length,n=[],i=[],u=0;u<r;++u)for(var s=e[u],c=s.length,h,p=0;p<c;++p)(h=s[p])&&(n.push(t.call(h,h.__data__,p,s)),i.push(h));return new Lt(n,i)}function io(t){return function(){return this.matches(t)}}function ao(t){return function(e){return e.matches(t)}}var fl=Array.prototype.find;function dl(t){return function(){return fl.call(this.children,t)}}function pl(){return this.firstElementChild}function _l(t){return this.select(t==null?pl:dl(typeof t=="function"?t:ao(t)))}var vl=Array.prototype.filter;function yl(){return Array.from(this.children)}function ml(t){return function(){return vl.call(this.children,t)}}function gl(t){return this.selectAll(t==null?yl:ml(typeof t=="function"?t:ao(t)))}function wl(t){typeof t!="function"&&(t=io(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var u=e[i],s=u.length,c=n[i]=[],h,p=0;p<s;++p)(h=u[p])&&t.call(h,h.__data__,p,u)&&c.push(h);return new Lt(n,this._parents)}function so(t){return new Array(t.length)}function El(){return new Lt(this._enter||this._groups.map(so),this._parents)}function We(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}We.prototype={constructor:We,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 bl(t){return function(){return t}}function xl(t,e,r,n,i,u){for(var s=0,c,h=e.length,p=u.length;s<p;++s)(c=e[s])?(c.__data__=u[s],n[s]=c):r[s]=new We(t,u[s]);for(;s<h;++s)(c=e[s])&&(i[s]=c)}function Bl(t,e,r,n,i,u,s){var c,h,p=new Map,_=e.length,E=u.length,w=new Array(_),g;for(c=0;c<_;++c)(h=e[c])&&(w[c]=g=s.call(h,h.__data__,c,e)+"",p.has(g)?i[c]=h:p.set(g,h));for(c=0;c<E;++c)g=s.call(t,u[c],c,u)+"",(h=p.get(g))?(n[c]=h,h.__data__=u[c],p.delete(g)):r[c]=new We(t,u[c]);for(c=0;c<_;++c)(h=e[c])&&p.get(w[c])===h&&(i[c]=h)}function Ll(t){return t.__data__}function Ol(t,e){if(!arguments.length)return Array.from(this,Ll);var r=e?Bl:xl,n=this._parents,i=this._groups;typeof t!="function"&&(t=bl(t));for(var u=i.length,s=new Array(u),c=new Array(u),h=new Array(u),p=0;p<u;++p){var _=n[p],E=i[p],w=E.length,g=Gl(t.call(_,_&&_.__data__,p,n)),F=g.length,B=c[p]=new Array(F),D=s[p]=new Array(F),G=h[p]=new Array(w);r(_,E,B,D,G,g,e);for(var j=0,z=0,M,S;j<F;++j)if(M=B[j]){for(j>=z&&(z=j+1);!(S=D[z])&&++z<F;);M._next=S||null}}return s=new Lt(s,n),s._enter=c,s._exit=h,s}function Gl(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Dl(){return new Lt(this._exit||this._groups.map(so),this._parents)}function Il(t,e,r){var n=this.enter(),i=this,u=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),r==null?u.remove():r(u),n&&i?n.merge(i).order():i}function Fl(t){for(var e=t.selection?t.selection():t,r=this._groups,n=e._groups,i=r.length,u=n.length,s=Math.min(i,u),c=new Array(i),h=0;h<s;++h)for(var p=r[h],_=n[h],E=p.length,w=c[h]=new Array(E),g,F=0;F<E;++F)(g=p[F]||_[F])&&(w[F]=g);for(;h<i;++h)c[h]=r[h];return new Lt(c,this._parents)}function Ml(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var n=t[e],i=n.length-1,u=n[i],s;--i>=0;)(s=n[i])&&(u&&s.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(s,u),u=s);return this}function Sl(t){t||(t=Rl);function e(E,w){return E&&w?t(E.__data__,w.__data__):!E-!w}for(var r=this._groups,n=r.length,i=new Array(n),u=0;u<n;++u){for(var s=r[u],c=s.length,h=i[u]=new Array(c),p,_=0;_<c;++_)(p=s[_])&&(h[_]=p);h.sort(e)}return new Lt(i,this._parents).order()}function Rl(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Pl(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function zl(){return Array.from(this)}function Yl(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,u=n.length;i<u;++i){var s=n[i];if(s)return s}return null}function jl(){let t=0;for(const e of this)++t;return t}function Tl(){return!this.node()}function Cl(t){for(var e=this._groups,r=0,n=e.length;r<n;++r)for(var i=e[r],u=0,s=i.length,c;u<s;++u)(c=i[u])&&t.call(c,c.__data__,u,i);return this}function Ul(t){return function(){this.removeAttribute(t)}}function Zl(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Wl(t,e){return function(){this.setAttribute(t,e)}}function Kl(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Hl(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function Ql(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function Xl(t,e){var r=Ze(t);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((e==null?r.local?Zl:Ul:typeof e=="function"?r.local?Ql:Hl:r.local?Kl:Wl)(r,e))}function uo(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Nl(t){return function(){this.style.removeProperty(t)}}function kl(t,e,r){return function(){this.style.setProperty(t,e,r)}}function Vl(t,e,r){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function ql(t,e,r){return arguments.length>1?this.each((e==null?Nl:typeof e=="function"?Vl:kl)(t,e,r??"")):_e(this.node(),t)}function _e(t,e){return t.style.getPropertyValue(e)||uo(t).getComputedStyle(t,null).getPropertyValue(e)}function $l(t){return function(){delete this[t]}}function Jl(t,e){return function(){this[t]=e}}function Al(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function tc(t,e){return arguments.length>1?this.each((e==null?$l:typeof e=="function"?Al:Jl)(t,e)):this.node()[t]}function lo(t){return t.trim().split(/^|\s+/)}function Mr(t){return t.classList||new co(t)}function co(t){this._node=t,this._names=lo(t.getAttribute("class")||"")}co.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 ho(t,e){for(var r=Mr(t),n=-1,i=e.length;++n<i;)r.add(e[n])}function fo(t,e){for(var r=Mr(t),n=-1,i=e.length;++n<i;)r.remove(e[n])}function ec(t){return function(){ho(this,t)}}function rc(t){return function(){fo(this,t)}}function nc(t,e){return function(){(e.apply(this,arguments)?ho:fo)(this,t)}}function oc(t,e){var r=lo(t+"");if(arguments.length<2){for(var n=Mr(this.node()),i=-1,u=r.length;++i<u;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof e=="function"?nc:e?ec:rc)(r,e))}function ic(){this.textContent=""}function ac(t){return function(){this.textContent=t}}function sc(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function uc(t){return arguments.length?this.each(t==null?ic:(typeof t=="function"?sc:ac)(t)):this.node().textContent}function lc(){this.innerHTML=""}function cc(t){return function(){this.innerHTML=t}}function hc(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function fc(t){return arguments.length?this.each(t==null?lc:(typeof t=="function"?hc:cc)(t)):this.node().innerHTML}function dc(){this.nextSibling&&this.parentNode.appendChild(this)}function pc(){return this.each(dc)}function _c(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vc(){return this.each(_c)}function yc(t){var e=typeof t=="function"?t:no(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function mc(){return null}function gc(t,e){var r=typeof t=="function"?t:no(t),n=e==null?mc:typeof e=="function"?e:Fr(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function wc(){var t=this.parentNode;t&&t.removeChild(this)}function Ec(){return this.each(wc)}function bc(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function xc(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Bc(t){return this.select(t?xc:bc)}function Lc(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Oc(t){return function(e){t.call(this,e,this.__data__)}}function Gc(t){return t.trim().split(/^|\s+/).map(function(e){var r="",n=e.indexOf(".");return n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function Dc(t){return function(){var e=this.__on;if(e){for(var r=0,n=-1,i=e.length,u;r<i;++r)u=e[r],(!t.type||u.type===t.type)&&u.name===t.name?this.removeEventListener(u.type,u.listener,u.options):e[++n]=u;++n?e.length=n:delete this.__on}}}function Ic(t,e,r){return function(){var n=this.__on,i,u=Oc(e);if(n){for(var s=0,c=n.length;s<c;++s)if((i=n[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=u,i.options=r),i.value=e;return}}this.addEventListener(t.type,u,r),i={type:t.type,name:t.name,value:e,listener:u,options:r},n?n.push(i):this.__on=[i]}}function Fc(t,e,r){var n=Gc(t+""),i,u=n.length,s;if(arguments.length<2){var c=this.node().__on;if(c){for(var h=0,p=c.length,_;h<p;++h)for(i=0,_=c[h];i<u;++i)if((s=n[i]).type===_.type&&s.name===_.name)return _.value}return}for(c=e?Ic:Dc,i=0;i<u;++i)this.each(c(n[i],e,r));return this}function po(t,e,r){var n=uo(t),i=n.CustomEvent;typeof i=="function"?i=new i(e,r):(i=n.document.createEvent("Event"),r?(i.initEvent(e,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Mc(t,e){return function(){return po(this,t,e)}}function Sc(t,e){return function(){return po(this,t,e.apply(this,arguments))}}function Rc(t,e){return this.each((typeof e=="function"?Sc:Mc)(t,e))}function*Pc(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var n=t[e],i=0,u=n.length,s;i<u;++i)(s=n[i])&&(yield s)}var _o=[null];function Lt(t,e){this._groups=t,this._parents=e}function Le(){return new Lt([[document.documentElement]],_o)}function zc(){return this}Lt.prototype=Le.prototype={constructor:Lt,select:sl,selectAll:hl,selectChild:_l,selectChildren:gl,filter:wl,data:Ol,enter:El,exit:Dl,join:Il,merge:Fl,selection:zc,order:Ml,sort:Sl,call:Pl,nodes:zl,node:Yl,size:jl,empty:Tl,each:Cl,attr:Xl,style:ql,property:tc,classed:oc,text:uc,html:fc,raise:pc,lower:vc,append:yc,insert:gc,remove:Ec,clone:Bc,datum:Lc,on:Fc,dispatch:Rc,[Symbol.iterator]:Pc};function oe(t){return typeof t=="string"?new Lt([[document.querySelector(t)]],[document.documentElement]):new Lt([[t]],_o)}function Yc(t){let e;for(;e=t.sourceEvent;)t=e;return t}function ie(t,e){if(t=Yc(t),e===void 0&&(e=t.currentTarget),e){var r=e.ownerSVGElement||e;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const Sr={capture:!0,passive:!1};function Rr(t){t.preventDefault(),t.stopImmediatePropagation()}function jc(t){var e=t.document.documentElement,r=oe(t).on("dragstart.drag",Rr,Sr);"onselectstart"in e?r.on("selectstart.drag",Rr,Sr):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Tc(t,e){var r=t.document.documentElement,n=oe(t).on("dragstart.drag",null);e&&(n.on("click.drag",Rr,Sr),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}var Cc=xe("start","end","cancel","interrupt"),Uc=[],vo=0,yo=1,Pr=2,Ke=3,mo=4,zr=5,He=6;function Qe(t,e,r,n,i,u){var s=t.__transition;if(!s)t.__transition={};else if(r in s)return;Zc(t,r,{name:e,index:n,group:i,on:Cc,tween:Uc,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:vo})}function Yr(t,e){var r=jt(t,e);if(r.state>vo)throw new Error("too late; already scheduled");return r}function Kt(t,e){var r=jt(t,e);if(r.state>Ke)throw new Error("too late; already running");return r}function jt(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Zc(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=yr(u,0,r.time);function u(p){r.state=yo,r.timer.restart(s,r.delay,r.time),r.delay<=p&&s(p-r.delay)}function s(p){var _,E,w,g;if(r.state!==yo)return h();for(_ in n)if(g=n[_],g.name===r.name){if(g.state===Ke)return te(s);g.state===mo?(g.state=He,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete n[_]):+_<e&&(g.state=He,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete n[_])}if(te(function(){r.state===Ke&&(r.state=mo,r.timer.restart(c,r.delay,r.time),c(p))}),r.state=Pr,r.on.call("start",t,t.__data__,r.index,r.group),r.state===Pr){for(r.state=Ke,i=new Array(w=r.tween.length),_=0,E=-1;_<w;++_)(g=r.tween[_].value.call(t,t.__data__,r.index,r.group))&&(i[++E]=g);i.length=E+1}}function c(p){for(var _=p<r.duration?r.ease.call(null,p/r.duration):(r.timer.restart(h),r.state=zr,1),E=-1,w=i.length;++E<w;)i[E].call(t,_);r.state===zr&&(r.on.call("end",t,t.__data__,r.index,r.group),h())}function h(){r.state=He,r.timer.stop(),delete n[e];for(var p in n)return;delete t.__transition}}function Xe(t,e){var r=t.__transition,n,i,u=!0,s;if(r){e=e==null?null:e+"";for(s in r){if((n=r[s]).name!==e){u=!1;continue}i=n.state>Pr&&n.state<zr,n.state=He,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[s]}u&&delete t.__transition}}function Wc(t){return this.each(function(){Xe(this,t)})}function Kc(t,e){var r,n;return function(){var i=Kt(this,t),u=i.tween;if(u!==r){n=r=u;for(var s=0,c=n.length;s<c;++s)if(n[s].name===e){n=n.slice(),n.splice(s,1);break}}i.tween=n}}function Hc(t,e,r){var n,i;if(typeof r!="function")throw new Error;return function(){var u=Kt(this,t),s=u.tween;if(s!==n){i=(n=s).slice();for(var c={name:e,value:r},h=0,p=i.length;h<p;++h)if(i[h].name===e){i[h]=c;break}h===p&&i.push(c)}u.tween=i}}function Qc(t,e){var r=this._id;if(t+="",arguments.length<2){for(var n=jt(this.node(),r).tween,i=0,u=n.length,s;i<u;++i)if((s=n[i]).name===t)return s.value;return null}return this.each((e==null?Kc:Hc)(r,t,e))}function jr(t,e,r){var n=t._id;return t.each(function(){var i=Kt(this,n);(i.value||(i.value={}))[e]=r.apply(this,arguments)}),function(i){return jt(i,n).value[e]}}function go(t,e){var r;return(typeof e=="number"?wr:e instanceof de?fe:(r=de(e))?(e=r,fe):Er)(t,e)}function Xc(t){return function(){this.removeAttribute(t)}}function Nc(t){return function(){this.removeAttributeNS(t.space,t.local)}}function kc(t,e,r){var n,i=r+"",u;return function(){var s=this.getAttribute(t);return s===i?null:s===n?u:u=e(n=s,r)}}function Vc(t,e,r){var n,i=r+"",u;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===n?u:u=e(n=s,r)}}function qc(t,e,r){var n,i,u;return function(){var s,c=r(this),h;return c==null?void this.removeAttribute(t):(s=this.getAttribute(t),h=c+"",s===h?null:s===n&&h===i?u:(i=h,u=e(n=s,c)))}}function $c(t,e,r){var n,i,u;return function(){var s,c=r(this),h;return c==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),h=c+"",s===h?null:s===n&&h===i?u:(i=h,u=e(n=s,c)))}}function Jc(t,e){var r=Ze(t),n=r==="transform"?ze:go;return this.attrTween(t,typeof e=="function"?(r.local?$c:qc)(r,n,jr(this,"attr."+t,e)):e==null?(r.local?Nc:Xc)(r):(r.local?Vc:kc)(r,n,e))}function Ac(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function th(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function eh(t,e){var r,n;function i(){var u=e.apply(this,arguments);return u!==n&&(r=(n=u)&&th(t,u)),r}return i._value=e,i}function rh(t,e){var r,n;function i(){var u=e.apply(this,arguments);return u!==n&&(r=(n=u)&&Ac(t,u)),r}return i._value=e,i}function nh(t,e){var r="attr."+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;var n=Ze(t);return this.tween(r,(n.local?eh:rh)(n,e))}function oh(t,e){return function(){Yr(this,t).delay=+e.apply(this,arguments)}}function ih(t,e){return e=+e,function(){Yr(this,t).delay=e}}function ah(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?oh:ih)(e,t)):jt(this.node(),e).delay}function sh(t,e){return function(){Kt(this,t).duration=+e.apply(this,arguments)}}function uh(t,e){return e=+e,function(){Kt(this,t).duration=e}}function lh(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?sh:uh)(e,t)):jt(this.node(),e).duration}function ch(t,e){if(typeof e!="function")throw new Error;return function(){Kt(this,t).ease=e}}function hh(t){var e=this._id;return arguments.length?this.each(ch(e,t)):jt(this.node(),e).ease}function fh(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;Kt(this,t).ease=r}}function dh(t){if(typeof t!="function")throw new Error;return this.each(fh(this._id,t))}function ph(t){typeof t!="function"&&(t=io(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i<r;++i)for(var u=e[i],s=u.length,c=n[i]=[],h,p=0;p<s;++p)(h=u[p])&&t.call(h,h.__data__,p,u)&&c.push(h);return new Vt(n,this._parents,this._name,this._id)}function _h(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,n=e.length,i=r.length,u=Math.min(n,i),s=new Array(n),c=0;c<u;++c)for(var h=e[c],p=r[c],_=h.length,E=s[c]=new Array(_),w,g=0;g<_;++g)(w=h[g]||p[g])&&(E[g]=w);for(;c<n;++c)s[c]=e[c];return new Vt(s,this._parents,this._name,this._id)}function vh(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function yh(t,e,r){var n,i,u=vh(e)?Yr:Kt;return function(){var s=u(this,t),c=s.on;c!==n&&(i=(n=c).copy()).on(e,r),s.on=i}}function mh(t,e){var r=this._id;return arguments.length<2?jt(this.node(),r).on.on(t):this.each(yh(r,t,e))}function gh(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function wh(){return this.on("end.remove",gh(this._id))}function Eh(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Fr(t));for(var n=this._groups,i=n.length,u=new Array(i),s=0;s<i;++s)for(var c=n[s],h=c.length,p=u[s]=new Array(h),_,E,w=0;w<h;++w)(_=c[w])&&(E=t.call(_,_.__data__,w,c))&&("__data__"in _&&(E.__data__=_.__data__),p[w]=E,Qe(p[w],e,r,w,p,jt(_,r)));return new Vt(u,this._parents,e,r)}function bh(t){var e=this._name,r=this._id;typeof t!="function"&&(t=oo(t));for(var n=this._groups,i=n.length,u=[],s=[],c=0;c<i;++c)for(var h=n[c],p=h.length,_,E=0;E<p;++E)if(_=h[E]){for(var w=t.call(_,_.__data__,E,h),g,F=jt(_,r),B=0,D=w.length;B<D;++B)(g=w[B])&&Qe(g,e,r,B,w,F);u.push(w),s.push(_)}return new Vt(u,s,e,r)}var xh=Le.prototype.constructor;function Bh(){return new xh(this._groups,this._parents)}function Lh(t,e){var r,n,i;return function(){var u=_e(this,t),s=(this.style.removeProperty(t),_e(this,t));return u===s?null:u===r&&s===n?i:i=e(r=u,n=s)}}function wo(t){return function(){this.style.removeProperty(t)}}function Oh(t,e,r){var n,i=r+"",u;return function(){var s=_e(this,t);return s===i?null:s===n?u:u=e(n=s,r)}}function Gh(t,e,r){var n,i,u;return function(){var s=_e(this,t),c=r(this),h=c+"";return c==null&&(h=c=(this.style.removeProperty(t),_e(this,t))),s===h?null:s===n&&h===i?u:(i=h,u=e(n=s,c))}}function Dh(t,e){var r,n,i,u="style."+e,s="end."+u,c;return function(){var h=Kt(this,t),p=h.on,_=h.value[u]==null?c||(c=wo(e)):void 0;(p!==r||i!==_)&&(n=(r=p).copy()).on(s,i=_),h.on=n}}function Ih(t,e,r){var n=(t+="")=="transform"?mr:go;return e==null?this.styleTween(t,Lh(t,n)).on("end.style."+t,wo(t)):typeof e=="function"?this.styleTween(t,Gh(t,n,jr(this,"style."+t,e))).each(Dh(this._id,t)):this.styleTween(t,Oh(t,n,e),r).on("end.style."+t,null)}function Fh(t,e,r){return function(n){this.style.setProperty(t,e.call(this,n),r)}}function Mh(t,e,r){var n,i;function u(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&Fh(t,s,r)),n}return u._value=e,u}function Sh(t,e,r){var n="style."+(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;return this.tween(n,Mh(t,e,r??""))}function Rh(t){return function(){this.textContent=t}}function Ph(t){return function(){var e=t(this);this.textContent=e??""}}function zh(t){return this.tween("text",typeof t=="function"?Ph(jr(this,"text",t)):Rh(t==null?"":t+""))}function Yh(t){return function(e){this.textContent=t.call(this,e)}}function jh(t){var e,r;function n(){var i=t.apply(this,arguments);return i!==r&&(e=(r=i)&&Yh(i)),e}return n._value=t,n}function Th(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,jh(t))}function Ch(){for(var t=this._name,e=this._id,r=Eo(),n=this._groups,i=n.length,u=0;u<i;++u)for(var s=n[u],c=s.length,h,p=0;p<c;++p)if(h=s[p]){var _=jt(h,e);Qe(h,t,r,p,s,{time:_.time+_.delay+_.duration,delay:0,duration:_.duration,ease:_.ease})}return new Vt(n,this._parents,t,r)}function Uh(){var t,e,r=this,n=r._id,i=r.size();return new Promise(function(u,s){var c={value:s},h={value:function(){--i===0&&u()}};r.each(function(){var p=Kt(this,n),_=p.on;_!==t&&(e=(t=_).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(h)),p.on=e}),i===0&&u()})}var Zh=0;function Vt(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function Eo(){return++Zh}var qt=Le.prototype;Vt.prototype={constructor:Vt,select:Eh,selectAll:bh,selectChild:qt.selectChild,selectChildren:qt.selectChildren,filter:ph,merge:_h,selection:Bh,transition:Ch,call:qt.call,nodes:qt.nodes,node:qt.node,size:qt.size,empty:qt.empty,each:qt.each,on:mh,attr:Jc,attrTween:nh,style:Ih,styleTween:Sh,text:zh,textTween:Th,remove:wh,tween:Qc,delay:ah,duration:lh,ease:hh,easeVarying:dh,end:Uh,[Symbol.iterator]:qt[Symbol.iterator]};function Wh(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Kh={time:null,delay:0,duration:250,ease:Wh};function Hh(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function Qh(t){var e,r;t instanceof Vt?(e=t._id,t=t._name):(e=Eo(),(r=Kh).time=gr(),t=t==null?null:t+"");for(var n=this._groups,i=n.length,u=0;u<i;++u)for(var s=n[u],c=s.length,h,p=0;p<c;++p)(h=s[p])&&Qe(h,t,e,p,s,r||Hh(h,e));return new Vt(n,this._parents,t,e)}Le.prototype.interrupt=Wc,Le.prototype.transition=Qh;const Ne=t=>()=>t;function Xh(t,{sourceEvent:e,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}function $t(t,e,r){this.k=t,this.x=e,this.y=r}$t.prototype={constructor:$t,scale:function(t){return t===1?this:new $t(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new $t(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+")"}};var ke=new $t(1,0,0);Ve.prototype=$t.prototype;function Ve(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ke;return t.__zoom}function Tr(t){t.stopImmediatePropagation()}function Oe(t){t.preventDefault(),t.stopImmediatePropagation()}function Nh(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function kh(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function bo(){return this.__zoom||ke}function Vh(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function qh(){return navigator.maxTouchPoints||"ontouchstart"in this}function $h(t,e,r){var n=t.invertX(e[0][0])-r[0][0],i=t.invertX(e[1][0])-r[1][0],u=t.invertY(e[0][1])-r[0][1],s=t.invertY(e[