You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3 lines
57 KiB
3 lines
57 KiB
import{p as Ke,d as Ze,t as Cn,Q as Ge,H as Qe,c as Je,o as je,b as tr,k as nr,n as er,s as rr}from"./index-bVOhw2NF.js";import{c as ir}from"./cloneDeep-C6NKQlMO.js";import"./_initCloneObject-K-Y0ueWp.js";import"./_getTag-BJ2nhJXz.js";function Rn(t,n){let e;if(n===void 0)for(const r of t)r!=null&&(e<r||e===void 0&&r>=r)&&(e=r);else{let r=-1;for(let i of t)(i=n(i,++r,t))!=null&&(e<i||e===void 0&&i>=i)&&(e=i)}return e}function ue(t,n){let e;if(n===void 0)for(const r of t)r!=null&&(e>r||e===void 0&&r>=r)&&(e=r);else{let r=-1;for(let i of t)(i=n(i,++r,t))!=null&&(e>i||e===void 0&&i>=i)&&(e=i)}return e}function Gt(t,n){let e=0;if(n===void 0)for(let r of t)(r=+r)&&(e+=r);else{let r=-1;for(let i of t)(i=+n(i,++r,t))&&(e+=i)}return e}class In extends Map{constructor(n,e=le){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),n!=null)for(const[r,i]of n)this.set(r,i)}get(n){return super.get(tn(this,n))}has(n){return super.has(tn(this,n))}set(n,e){return super.set(fe(this,n),e)}delete(n){return super.delete(ce(this,n))}}class or extends Set{constructor(n,e=le){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),n!=null)for(const r of n)this.add(r)}has(n){return super.has(tn(this,n))}add(n){return super.add(fe(this,n))}delete(n){return super.delete(ce(this,n))}}function tn({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):e}function fe({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):(t.set(r,e),e)}function ce({_intern:t,_key:n},e){const r=n(e);return t.has(r)&&(e=t.get(r),t.delete(r)),e}function le(t){return t!==null&&typeof t=="object"?t.valueOf():t}function q(t,n){if(typeof t[Symbol.iterator]!="function")throw new TypeError("values is not iterable");if(typeof n!="function")throw new TypeError("mapper is not a function");return Array.from(t,(e,r)=>n(e,r,t))}function sr(...t){const n=new or;for(const e of t)for(const r of e)n.add(r);return n}var ar={value:()=>{}};function he(){for(var t=0,n=arguments.length,e={},r;t<n;++t){if(!(r=arguments[t]+"")||r in e||/[\s.]/.test(r))throw new Error("illegal type: "+r);e[r]=[]}return new Ht(e)}function Ht(t){this._=t}function ur(t,n){return t.trim().split(/^|\s+/).map(function(e){var r="",i=e.indexOf(".");if(i>=0&&(r=e.slice(i+1),e=e.slice(0,i)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}Ht.prototype=he.prototype={constructor:Ht,on:function(t,n){var e=this._,r=ur(t+"",e),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(t=r[o]).type)&&(i=fr(e[i],t.name)))return i;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<s;)if(i=(t=r[o]).type)e[i]=Hn(e[i],t.name,n);else if(n==null)for(i in e)e[i]=Hn(e[i],t.name,null);return this},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Ht(t)},call:function(t,n){if((i=arguments.length-2)>0)for(var e=new Array(i),r=0,i,o;r<i;++r)e[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(n,e)},apply:function(t,n,e){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(n,e)}};function fr(t,n){for(var e=0,r=t.length,i;e<r;++e)if((i=t[e]).name===n)return i.value}function Hn(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=ar,t=t.slice(0,r).concat(t.slice(r+1));break}return e!=null&&t.push({name:n,value:e}),t}var nn="http://www.w3.org/1999/xhtml";const zn={svg:"http://www.w3.org/2000/svg",xhtml:nn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ut(t){var n=t+="",e=n.indexOf(":");return e>=0&&(n=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),zn.hasOwnProperty(n)?{space:zn[n],local:t}:t}function cr(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===nn&&n.documentElement.namespaceURI===nn?n.createElement(t):n.createElementNS(e,t)}}function lr(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function dn(t){var n=Ut(t);return(n.local?lr:cr)(n)}function hr(){}function pn(t){return t==null?hr:function(){return this.querySelector(t)}}function dr(t){typeof t!="function"&&(t=pn(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],s=o.length,a=r[i]=new Array(s),u,f,c=0;c<s;++c)(u=o[c])&&(f=t.call(u,u.__data__,c,o))&&("__data__"in u&&(f.__data__=u.__data__),a[c]=f);return new H(r,this._parents)}function pr(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function gr(){return[]}function de(t){return t==null?gr:function(){return this.querySelectorAll(t)}}function yr(t){return function(){return pr(t.apply(this,arguments))}}function mr(t){typeof t=="function"?t=yr(t):t=de(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var s=n[o],a=s.length,u,f=0;f<a;++f)(u=s[f])&&(r.push(t.call(u,u.__data__,f,s)),i.push(u));return new H(r,i)}function pe(t){return function(){return this.matches(t)}}function ge(t){return function(n){return n.matches(t)}}var xr=Array.prototype.find;function _r(t){return function(){return xr.call(this.children,t)}}function wr(){return this.firstElementChild}function vr(t){return this.select(t==null?wr:_r(typeof t=="function"?t:ge(t)))}var br=Array.prototype.filter;function kr(){return Array.from(this.children)}function $r(t){return function(){return br.call(this.children,t)}}function Ar(t){return this.selectAll(t==null?kr:$r(typeof t=="function"?t:ge(t)))}function Sr(t){typeof t!="function"&&(t=pe(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],s=o.length,a=r[i]=[],u,f=0;f<s;++f)(u=o[f])&&t.call(u,u.__data__,f,o)&&a.push(u);return new H(r,this._parents)}function ye(t){return new Array(t.length)}function Nr(){return new H(this._enter||this._groups.map(ye),this._parents)}function Pt(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}Pt.prototype={constructor:Pt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Mr(t){return function(){return t}}function Er(t,n,e,r,i,o){for(var s=0,a,u=n.length,f=o.length;s<f;++s)(a=n[s])?(a.__data__=o[s],r[s]=a):e[s]=new Pt(t,o[s]);for(;s<u;++s)(a=n[s])&&(i[s]=a)}function Tr(t,n,e,r,i,o,s){var a,u,f=new Map,c=n.length,h=o.length,y=new Array(c),m;for(a=0;a<c;++a)(u=n[a])&&(y[a]=m=s.call(u,u.__data__,a,n)+"",f.has(m)?i[a]=u:f.set(m,u));for(a=0;a<h;++a)m=s.call(t,o[a],a,o)+"",(u=f.get(m))?(r[a]=u,u.__data__=o[a],f.delete(m)):e[a]=new Pt(t,o[a]);for(a=0;a<c;++a)(u=n[a])&&f.get(y[a])===u&&(i[a]=u)}function Lr(t){return t.__data__}function Cr(t,n){if(!arguments.length)return Array.from(this,Lr);var e=n?Tr:Er,r=this._parents,i=this._groups;typeof t!="function"&&(t=Mr(t));for(var o=i.length,s=new Array(o),a=new Array(o),u=new Array(o),f=0;f<o;++f){var c=r[f],h=i[f],y=h.length,m=Rr(t.call(c,c&&c.__data__,f,r)),_=m.length,$=a[f]=new Array(_),N=s[f]=new Array(_),C=u[f]=new Array(y);e(c,h,$,N,C,m,n);for(var T=0,M=0,I,E;T<_;++T)if(I=$[T]){for(T>=M&&(M=T+1);!(E=N[M])&&++M<_;);I._next=E||null}}return s=new H(s,r),s._enter=a,s._exit=u,s}function Rr(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Ir(){return new H(this._exit||this._groups.map(ye),this._parents)}function Hr(t,n,e){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),n!=null&&(i=n(i),i&&(i=i.selection())),e==null?o.remove():e(o),r&&i?r.merge(i).order():i}function zr(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,s=Math.min(i,o),a=new Array(i),u=0;u<s;++u)for(var f=e[u],c=r[u],h=f.length,y=a[u]=new Array(h),m,_=0;_<h;++_)(m=f[_]||c[_])&&(y[_]=m);for(;u<i;++u)a[u]=e[u];return new H(a,this._parents)}function Fr(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r=t[n],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function Pr(t){t||(t=Or);function n(h,y){return h&&y?t(h.__data__,y.__data__):!h-!y}for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var s=e[o],a=s.length,u=i[o]=new Array(a),f,c=0;c<a;++c)(f=s[c])&&(u[c]=f);u.sort(n)}return new H(i,this._parents).order()}function Or(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function Dr(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function qr(){return Array.from(this)}function Br(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function Xr(){let t=0;for(const n of this)++t;return t}function Vr(){return!this.node()}function Yr(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i=n[e],o=0,s=i.length,a;o<s;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this}function Ur(t){return function(){this.removeAttribute(t)}}function Wr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Kr(t,n){return function(){this.setAttribute(t,n)}}function Zr(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Gr(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}}function Qr(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Jr(t,n){var e=Ut(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((n==null?e.local?Wr:Ur:typeof n=="function"?e.local?Qr:Gr:e.local?Zr:Kr)(e,n))}function me(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function jr(t){return function(){this.style.removeProperty(t)}}function ti(t,n,e){return function(){this.style.setProperty(t,n,e)}}function ni(t,n,e){return function(){var r=n.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function ei(t,n,e){return arguments.length>1?this.each((n==null?jr:typeof n=="function"?ni:ti)(t,n,e??"")):ct(this.node(),t)}function ct(t,n){return t.style.getPropertyValue(n)||me(t).getComputedStyle(t,null).getPropertyValue(n)}function ri(t){return function(){delete this[t]}}function ii(t,n){return function(){this[t]=n}}function oi(t,n){return function(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}}function si(t,n){return arguments.length>1?this.each((n==null?ri:typeof n=="function"?oi:ii)(t,n)):this.node()[t]}function xe(t){return t.trim().split(/^|\s+/)}function gn(t){return t.classList||new _e(t)}function _e(t){this._node=t,this._names=xe(t.getAttribute("class")||"")}_e.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function we(t,n){for(var e=gn(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function ve(t,n){for(var e=gn(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function ai(t){return function(){we(this,t)}}function ui(t){return function(){ve(this,t)}}function fi(t,n){return function(){(n.apply(this,arguments)?we:ve)(this,t)}}function ci(t,n){var e=xe(t+"");if(arguments.length<2){for(var r=gn(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each((typeof n=="function"?fi:n?ai:ui)(e,n))}function li(){this.textContent=""}function hi(t){return function(){this.textContent=t}}function di(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function pi(t){return arguments.length?this.each(t==null?li:(typeof t=="function"?di:hi)(t)):this.node().textContent}function gi(){this.innerHTML=""}function yi(t){return function(){this.innerHTML=t}}function mi(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function xi(t){return arguments.length?this.each(t==null?gi:(typeof t=="function"?mi:yi)(t)):this.node().innerHTML}function _i(){this.nextSibling&&this.parentNode.appendChild(this)}function wi(){return this.each(_i)}function vi(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function bi(){return this.each(vi)}function ki(t){var n=typeof t=="function"?t:dn(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function $i(){return null}function Ai(t,n){var e=typeof t=="function"?t:dn(t),r=n==null?$i:typeof n=="function"?n:pn(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function Si(){var t=this.parentNode;t&&t.removeChild(this)}function Ni(){return this.each(Si)}function Mi(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Ei(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Ti(t){return this.select(t?Ei:Mi)}function Li(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ci(t){return function(n){t.call(this,n,this.__data__)}}function Ri(t){return t.trim().split(/^|\s+/).map(function(n){var e="",r=n.indexOf(".");return r>=0&&(e=n.slice(r+1),n=n.slice(0,r)),{type:n,name:e}})}function Ii(t){return function(){var n=this.__on;if(n){for(var e=0,r=-1,i=n.length,o;e<i;++e)o=n[e],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):n[++r]=o;++r?n.length=r:delete this.__on}}}function Hi(t,n,e){return function(){var r=this.__on,i,o=Ci(n);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=e),i.value=n;return}}this.addEventListener(t.type,o,e),i={type:t.type,name:t.name,value:n,listener:o,options:e},r?r.push(i):this.__on=[i]}}function zi(t,n,e){var r=Ri(t+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var u=0,f=a.length,c;u<f;++u)for(i=0,c=a[u];i<o;++i)if((s=r[i]).type===c.type&&s.name===c.name)return c.value}return}for(a=n?Hi:Ii,i=0;i<o;++i)this.each(a(r[i],n,e));return this}function be(t,n,e){var r=me(t),i=r.CustomEvent;typeof i=="function"?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function Fi(t,n){return function(){return be(this,t,n)}}function Pi(t,n){return function(){return be(this,t,n.apply(this,arguments))}}function Oi(t,n){return this.each((typeof n=="function"?Pi:Fi)(t,n))}function*Di(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var ke=[null];function H(t,n){this._groups=t,this._parents=n}function $t(){return new H([[document.documentElement]],ke)}function qi(){return this}H.prototype=$t.prototype={constructor:H,select:dr,selectAll:mr,selectChild:vr,selectChildren:Ar,filter:Sr,data:Cr,enter:Nr,exit:Ir,join:Hr,merge:zr,selection:qi,order:Fr,sort:Pr,call:Dr,nodes:qr,node:Br,size:Xr,empty:Vr,each:Yr,attr:Jr,style:ei,property:si,classed:ci,text:pi,html:xi,raise:wi,lower:bi,append:ki,insert:Ai,remove:Ni,clone:Ti,datum:Li,on:zi,dispatch:Oi,[Symbol.iterator]:Di};function ut(t){return typeof t=="string"?new H([[document.querySelector(t)]],[document.documentElement]):new H([[t]],ke)}function Bi(t){return ut(dn(t).call(document.documentElement))}function yn(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function $e(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function At(){}var wt=.7,Ot=1/wt,ft="\\s*([+-]?\\d+)\\s*",vt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Y="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xi=/^#([0-9a-f]{3,8})$/,Vi=new RegExp(`^rgb\\(${ft},${ft},${ft}\\)$`),Yi=new RegExp(`^rgb\\(${Y},${Y},${Y}\\)$`),Ui=new RegExp(`^rgba\\(${ft},${ft},${ft},${vt}\\)$`),Wi=new RegExp(`^rgba\\(${Y},${Y},${Y},${vt}\\)$`),Ki=new RegExp(`^hsl\\(${vt},${Y},${Y}\\)$`),Zi=new RegExp(`^hsla\\(${vt},${Y},${Y},${vt}\\)$`),Fn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};yn(At,bt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Pn,formatHex:Pn,formatHex8:Gi,formatHsl:Qi,formatRgb:On,toString:On});function Pn(){return this.rgb().formatHex()}function Gi(){return this.rgb().formatHex8()}function Qi(){return Ae(this).formatHsl()}function On(){return this.rgb().formatRgb()}function bt(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Xi.exec(t))?(e=n[1].length,n=parseInt(n[1],16),e===6?Dn(n):e===3?new R(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):e===8?Tt(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):e===4?Tt(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Vi.exec(t))?new R(n[1],n[2],n[3],1):(n=Yi.exec(t))?new R(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=Ui.exec(t))?Tt(n[1],n[2],n[3],n[4]):(n=Wi.exec(t))?Tt(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Ki.exec(t))?Xn(n[1],n[2]/100,n[3]/100,1):(n=Zi.exec(t))?Xn(n[1],n[2]/100,n[3]/100,n[4]):Fn.hasOwnProperty(t)?Dn(Fn[t]):t==="transparent"?new R(NaN,NaN,NaN,0):null}function Dn(t){return new R(t>>16&255,t>>8&255,t&255,1)}function Tt(t,n,e,r){return r<=0&&(t=n=e=NaN),new R(t,n,e,r)}function Ji(t){return t instanceof At||(t=bt(t)),t?(t=t.rgb(),new R(t.r,t.g,t.b,t.opacity)):new R}function en(t,n,e,r){return arguments.length===1?Ji(t):new R(t,n,e,r??1)}function R(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}yn(R,en,$e(At,{brighter(t){return t=t==null?Ot:Math.pow(Ot,t),new R(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?wt:Math.pow(wt,t),new R(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new R(it(this.r),it(this.g),it(this.b),Dt(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:qn,formatHex:qn,formatHex8:ji,formatRgb:Bn,toString:Bn}));function qn(){return`#${rt(this.r)}${rt(this.g)}${rt(this.b)}`}function ji(){return`#${rt(this.r)}${rt(this.g)}${rt(this.b)}${rt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Bn(){const t=Dt(this.opacity);return`${t===1?"rgb(":"rgba("}${it(this.r)}, ${it(this.g)}, ${it(this.b)}${t===1?")":`, ${t})`}`}function Dt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function it(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function rt(t){return t=it(t),(t<16?"0":"")+t.toString(16)}function Xn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new B(t,n,e,r)}function Ae(t){if(t instanceof B)return new B(t.h,t.s,t.l,t.opacity);if(t instanceof At||(t=bt(t)),!t)return new B;if(t instanceof B)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),s=NaN,a=o-i,u=(o+i)/2;return a?(n===o?s=(e-r)/a+(e<r)*6:e===o?s=(r-n)/a+2:s=(n-e)/a+4,a/=u<.5?o+i:2-o-i,s*=60):a=u>0&&u<1?0:s,new B(s,a,u,t.opacity)}function to(t,n,e,r){return arguments.length===1?Ae(t):new B(t,n,e,r??1)}function B(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}yn(B,to,$e(At,{brighter(t){return t=t==null?Ot:Math.pow(Ot,t),new B(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?wt:Math.pow(wt,t),new B(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new R(Qt(t>=240?t-240:t+120,i,r),Qt(t,i,r),Qt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new B(Vn(this.h),Lt(this.s),Lt(this.l),Dt(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=Dt(this.opacity);return`${t===1?"hsl(":"hsla("}${Vn(this.h)}, ${Lt(this.s)*100}%, ${Lt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Vn(t){return t=(t||0)%360,t<0?t+360:t}function Lt(t){return Math.max(0,Math.min(1,t||0))}function Qt(t,n,e){return(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)*255}const Se=t=>()=>t;function no(t,n){return function(e){return t+e*n}}function eo(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function ro(t){return(t=+t)==1?Ne:function(n,e){return e-n?eo(n,e,t):Se(isNaN(n)?e:n)}}function Ne(t,n){var e=n-t;return e?no(t,e):Se(isNaN(t)?n:t)}const Yn=function t(n){var e=ro(n);function r(i,o){var s=e((i=en(i)).r,(o=en(o)).r),a=e(i.g,o.g),u=e(i.b,o.b),f=Ne(i.opacity,o.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=u(c),i.opacity=f(c),i+""}}return r.gamma=t,r}(1);function Z(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var rn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Jt=new RegExp(rn.source,"g");function io(t){return function(){return t}}function oo(t){return function(n){return t(n)+""}}function so(t,n){var e=rn.lastIndex=Jt.lastIndex=0,r,i,o,s=-1,a=[],u=[];for(t=t+"",n=n+"";(r=rn.exec(t))&&(i=Jt.exec(n));)(o=i.index)>e&&(o=n.slice(e,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,u.push({i:s,x:Z(r,i)})),e=Jt.lastIndex;return e<n.length&&(o=n.slice(e),a[s]?a[s]+=o:a[++s]=o),a.length<2?u[0]?oo(u[0].x):io(n):(n=u.length,function(f){for(var c=0,h;c<n;++c)a[(h=u[c]).i]=h.x(f);return a.join("")})}var Un=180/Math.PI,on={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Me(t,n,e,r,i,o){var s,a,u;return(s=Math.sqrt(t*t+n*n))&&(t/=s,n/=s),(u=t*e+n*r)&&(e-=t*u,r-=n*u),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,u/=a),t*r<n*e&&(t=-t,n=-n,u=-u,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Un,skewX:Math.atan(u)*Un,scaleX:s,scaleY:a}}var Ct;function ao(t){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?on:Me(n.a,n.b,n.c,n.d,n.e,n.f)}function uo(t){return t==null||(Ct||(Ct=document.createElementNS("http://www.w3.org/2000/svg","g")),Ct.setAttribute("transform",t),!(t=Ct.transform.baseVal.consolidate()))?on:(t=t.matrix,Me(t.a,t.b,t.c,t.d,t.e,t.f))}function Ee(t,n,e,r){function i(f){return f.length?f.pop()+" ":""}function o(f,c,h,y,m,_){if(f!==h||c!==y){var $=m.push("translate(",null,n,null,e);_.push({i:$-4,x:Z(f,h)},{i:$-2,x:Z(c,y)})}else(h||y)&&m.push("translate("+h+n+y+e)}function s(f,c,h,y){f!==c?(f-c>180?c+=360:c-f>180&&(f+=360),y.push({i:h.push(i(h)+"rotate(",null,r)-2,x:Z(f,c)})):c&&h.push(i(h)+"rotate("+c+r)}function a(f,c,h,y){f!==c?y.push({i:h.push(i(h)+"skewX(",null,r)-2,x:Z(f,c)}):c&&h.push(i(h)+"skewX("+c+r)}function u(f,c,h,y,m,_){if(f!==h||c!==y){var $=m.push(i(m)+"scale(",null,",",null,")");_.push({i:$-4,x:Z(f,h)},{i:$-2,x:Z(c,y)})}else(h!==1||y!==1)&&m.push(i(m)+"scale("+h+","+y+")")}return function(f,c){var h=[],y=[];return f=t(f),c=t(c),o(f.translateX,f.translateY,c.translateX,c.translateY,h,y),s(f.rotate,c.rotate,h,y),a(f.skewX,c.skewX,h,y),u(f.scaleX,f.scaleY,c.scaleX,c.scaleY,h,y),f=c=null,function(m){for(var _=-1,$=y.length,N;++_<$;)h[(N=y[_]).i]=N.x(m);return h.join("")}}}var fo=Ee(ao,"px, ","px)","deg)"),co=Ee(uo,", ",")",")"),lt=0,mt=0,yt=0,Te=1e3,qt,xt,Bt=0,ot=0,Wt=0,kt=typeof performance=="object"&&performance.now?performance:Date,Le=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function mn(){return ot||(Le(lo),ot=kt.now()+Wt)}function lo(){ot=0}function Xt(){this._call=this._time=this._next=null}Xt.prototype=Ce.prototype={constructor:Xt,restart:function(t,n,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?mn():+e)+(n==null?0:+n),!this._next&&xt!==this&&(xt?xt._next=this:qt=this,xt=this),this._call=t,this._time=e,sn()},stop:function(){this._call&&(this._call=null,this._time=1/0,sn())}};function Ce(t,n,e){var r=new Xt;return r.restart(t,n,e),r}function ho(){mn(),++lt;for(var t=qt,n;t;)(n=ot-t._time)>=0&&t._call.call(void 0,n),t=t._next;--lt}function Wn(){ot=(Bt=kt.now())+Wt,lt=mt=0;try{ho()}finally{lt=0,go(),ot=0}}function po(){var t=kt.now(),n=t-Bt;n>Te&&(Wt-=n,Bt=t)}function go(){for(var t,n=qt,e,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:qt=e);xt=t,sn(r)}function sn(t){if(!lt){mt&&(mt=clearTimeout(mt));var n=t-ot;n>24?(t<1/0&&(mt=setTimeout(Wn,t-kt.now()-Wt)),yt&&(yt=clearInterval(yt))):(yt||(Bt=kt.now(),yt=setInterval(po,Te)),lt=1,Le(Wn))}}function Kn(t,n,e){var r=new Xt;return n=n==null?0:+n,r.restart(i=>{r.stop(),t(i+n)},n,e),r}var yo=he("start","end","cancel","interrupt"),mo=[],Re=0,Zn=1,an=2,zt=3,Gn=4,un=5,Ft=6;function Kt(t,n,e,r,i,o){var s=t.__transition;if(!s)t.__transition={};else if(e in s)return;xo(t,e,{name:n,index:r,group:i,on:yo,tween:mo,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Re})}function xn(t,n){var e=X(t,n);if(e.state>Re)throw new Error("too late; already scheduled");return e}function U(t,n){var e=X(t,n);if(e.state>zt)throw new Error("too late; already running");return e}function X(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function xo(t,n,e){var r=t.__transition,i;r[n]=e,e.timer=Ce(o,0,e.time);function o(f){e.state=Zn,e.timer.restart(s,e.delay,e.time),e.delay<=f&&s(f-e.delay)}function s(f){var c,h,y,m;if(e.state!==Zn)return u();for(c in r)if(m=r[c],m.name===e.name){if(m.state===zt)return Kn(s);m.state===Gn?(m.state=Ft,m.timer.stop(),m.on.call("interrupt",t,t.__data__,m.index,m.group),delete r[c]):+c<n&&(m.state=Ft,m.timer.stop(),m.on.call("cancel",t,t.__data__,m.index,m.group),delete r[c])}if(Kn(function(){e.state===zt&&(e.state=Gn,e.timer.restart(a,e.delay,e.time),a(f))}),e.state=an,e.on.call("start",t,t.__data__,e.index,e.group),e.state===an){for(e.state=zt,i=new Array(y=e.tween.length),c=0,h=-1;c<y;++c)(m=e.tween[c].value.call(t,t.__data__,e.index,e.group))&&(i[++h]=m);i.length=h+1}}function a(f){for(var c=f<e.duration?e.ease.call(null,f/e.duration):(e.timer.restart(u),e.state=un,1),h=-1,y=i.length;++h<y;)i[h].call(t,c);e.state===un&&(e.on.call("end",t,t.__data__,e.index,e.group),u())}function u(){e.state=Ft,e.timer.stop(),delete r[n];for(var f in r)return;delete t.__transition}}function _o(t,n){var e=t.__transition,r,i,o=!0,s;if(e){n=n==null?null:n+"";for(s in e){if((r=e[s]).name!==n){o=!1;continue}i=r.state>an&&r.state<un,r.state=Ft,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete e[s]}o&&delete t.__transition}}function wo(t){return this.each(function(){_o(this,t)})}function vo(t,n){var e,r;return function(){var i=U(this,t),o=i.tween;if(o!==e){r=e=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===n){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function bo(t,n,e){var r,i;if(typeof e!="function")throw new Error;return function(){var o=U(this,t),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:n,value:e},u=0,f=i.length;u<f;++u)if(i[u].name===n){i[u]=a;break}u===f&&i.push(a)}o.tween=i}}function ko(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r=X(this.node(),e).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===t)return s.value;return null}return this.each((n==null?vo:bo)(e,t,n))}function _n(t,n,e){var r=t._id;return t.each(function(){var i=U(this,r);(i.value||(i.value={}))[n]=e.apply(this,arguments)}),function(i){return X(i,r).value[n]}}function Ie(t,n){var e;return(typeof n=="number"?Z:n instanceof bt?Yn:(e=bt(n))?(n=e,Yn):so)(t,n)}function $o(t){return function(){this.removeAttribute(t)}}function Ao(t){return function(){this.removeAttributeNS(t.space,t.local)}}function So(t,n,e){var r,i=e+"",o;return function(){var s=this.getAttribute(t);return s===i?null:s===r?o:o=n(r=s,e)}}function No(t,n,e){var r,i=e+"",o;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===r?o:o=n(r=s,e)}}function Mo(t,n,e){var r,i,o;return function(){var s,a=e(this),u;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),u=a+"",s===u?null:s===r&&u===i?o:(i=u,o=n(r=s,a)))}}function Eo(t,n,e){var r,i,o;return function(){var s,a=e(this),u;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),u=a+"",s===u?null:s===r&&u===i?o:(i=u,o=n(r=s,a)))}}function To(t,n){var e=Ut(t),r=e==="transform"?co:Ie;return this.attrTween(t,typeof n=="function"?(e.local?Eo:Mo)(e,r,_n(this,"attr."+t,n)):n==null?(e.local?Ao:$o)(e):(e.local?No:So)(e,r,n))}function Lo(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function Co(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function Ro(t,n){var e,r;function i(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&Co(t,o)),e}return i._value=n,i}function Io(t,n){var e,r;function i(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&Lo(t,o)),e}return i._value=n,i}function Ho(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;var r=Ut(t);return this.tween(e,(r.local?Ro:Io)(r,n))}function zo(t,n){return function(){xn(this,t).delay=+n.apply(this,arguments)}}function Fo(t,n){return n=+n,function(){xn(this,t).delay=n}}function Po(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?zo:Fo)(n,t)):X(this.node(),n).delay}function Oo(t,n){return function(){U(this,t).duration=+n.apply(this,arguments)}}function Do(t,n){return n=+n,function(){U(this,t).duration=n}}function qo(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?Oo:Do)(n,t)):X(this.node(),n).duration}function Bo(t,n){if(typeof n!="function")throw new Error;return function(){U(this,t).ease=n}}function Xo(t){var n=this._id;return arguments.length?this.each(Bo(n,t)):X(this.node(),n).ease}function Vo(t,n){return function(){var e=n.apply(this,arguments);if(typeof e!="function")throw new Error;U(this,t).ease=e}}function Yo(t){if(typeof t!="function")throw new Error;return this.each(Vo(this._id,t))}function Uo(t){typeof t!="function"&&(t=pe(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],s=o.length,a=r[i]=[],u,f=0;f<s;++f)(u=o[f])&&t.call(u,u.__data__,f,o)&&a.push(u);return new K(r,this._parents,this._name,this._id)}function Wo(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var u=n[a],f=e[a],c=u.length,h=s[a]=new Array(c),y,m=0;m<c;++m)(y=u[m]||f[m])&&(h[m]=y);for(;a<r;++a)s[a]=n[a];return new K(s,this._parents,this._name,this._id)}function Ko(t){return(t+"").trim().split(/^|\s+/).every(function(n){var e=n.indexOf(".");return e>=0&&(n=n.slice(0,e)),!n||n==="start"})}function Zo(t,n,e){var r,i,o=Ko(n)?xn:U;return function(){var s=o(this,t),a=s.on;a!==r&&(i=(r=a).copy()).on(n,e),s.on=i}}function Go(t,n){var e=this._id;return arguments.length<2?X(this.node(),e).on.on(t):this.each(Zo(e,t,n))}function Qo(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function Jo(){return this.on("end.remove",Qo(this._id))}function jo(t){var n=this._name,e=this._id;typeof t!="function"&&(t=pn(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],u=a.length,f=o[s]=new Array(u),c,h,y=0;y<u;++y)(c=a[y])&&(h=t.call(c,c.__data__,y,a))&&("__data__"in c&&(h.__data__=c.__data__),f[y]=h,Kt(f[y],n,e,y,f,X(c,e)));return new K(o,this._parents,n,e)}function ts(t){var n=this._name,e=this._id;typeof t!="function"&&(t=de(t));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var u=r[a],f=u.length,c,h=0;h<f;++h)if(c=u[h]){for(var y=t.call(c,c.__data__,h,u),m,_=X(c,e),$=0,N=y.length;$<N;++$)(m=y[$])&&Kt(m,n,e,$,y,_);o.push(y),s.push(c)}return new K(o,s,n,e)}var ns=$t.prototype.constructor;function es(){return new ns(this._groups,this._parents)}function rs(t,n){var e,r,i;return function(){var o=ct(this,t),s=(this.style.removeProperty(t),ct(this,t));return o===s?null:o===e&&s===r?i:i=n(e=o,r=s)}}function He(t){return function(){this.style.removeProperty(t)}}function is(t,n,e){var r,i=e+"",o;return function(){var s=ct(this,t);return s===i?null:s===r?o:o=n(r=s,e)}}function os(t,n,e){var r,i,o;return function(){var s=ct(this,t),a=e(this),u=a+"";return a==null&&(u=a=(this.style.removeProperty(t),ct(this,t))),s===u?null:s===r&&u===i?o:(i=u,o=n(r=s,a))}}function ss(t,n){var e,r,i,o="style."+n,s="end."+o,a;return function(){var u=U(this,t),f=u.on,c=u.value[o]==null?a||(a=He(n)):void 0;(f!==e||i!==c)&&(r=(e=f).copy()).on(s,i=c),u.on=r}}function as(t,n,e){var r=(t+="")=="transform"?fo:Ie;return n==null?this.styleTween(t,rs(t,r)).on("end.style."+t,He(t)):typeof n=="function"?this.styleTween(t,os(t,r,_n(this,"style."+t,n))).each(ss(this._id,t)):this.styleTween(t,is(t,r,n),e).on("end.style."+t,null)}function us(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function fs(t,n,e){var r,i;function o(){var s=n.apply(this,arguments);return s!==i&&(r=(i=s)&&us(t,s,e)),r}return o._value=n,o}function cs(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;return this.tween(r,fs(t,n,e??""))}function ls(t){return function(){this.textContent=t}}function hs(t){return function(){var n=t(this);this.textContent=n??""}}function ds(t){return this.tween("text",typeof t=="function"?hs(_n(this,"text",t)):ls(t==null?"":t+""))}function ps(t){return function(n){this.textContent=t.call(this,n)}}function gs(t){var n,e;function r(){var i=t.apply(this,arguments);return i!==e&&(n=(e=i)&&ps(i)),n}return r._value=t,r}function ys(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,gs(t))}function ms(){for(var t=this._name,n=this._id,e=ze(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,u,f=0;f<a;++f)if(u=s[f]){var c=X(u,n);Kt(u,t,e,f,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new K(r,this._parents,t,e)}function xs(){var t,n,e=this,r=e._id,i=e.size();return new Promise(function(o,s){var a={value:s},u={value:function(){--i===0&&o()}};e.each(function(){var f=U(this,r),c=f.on;c!==t&&(n=(t=c).copy(),n._.cancel.push(a),n._.interrupt.push(a),n._.end.push(u)),f.on=n}),i===0&&o()})}var _s=0;function K(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function ze(){return++_s}var W=$t.prototype;K.prototype={constructor:K,select:jo,selectAll:ts,selectChild:W.selectChild,selectChildren:W.selectChildren,filter:Uo,merge:Wo,selection:es,transition:ms,call:W.call,nodes:W.nodes,node:W.node,size:W.size,empty:W.empty,each:W.each,on:Go,attr:To,attrTween:Ho,style:as,styleTween:cs,text:ds,textTween:ys,remove:Jo,tween:ko,delay:Po,duration:qo,ease:Xo,easeVarying:Yo,end:xs,[Symbol.iterator]:W[Symbol.iterator]};function ws(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var vs={time:null,delay:0,duration:250,ease:ws};function bs(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}function ks(t){var n,e;t instanceof K?(n=t._id,t=t._name):(n=ze(),(e=vs).time=mn(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,u,f=0;f<a;++f)(u=s[f])&&Kt(u,t,n,f,s,e||bs(u,n));return new K(r,this._parents,t,n)}$t.prototype.interrupt=wo;$t.prototype.transition=ks;function $s(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Vt(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function As(t){return t=Vt(Math.abs(t)),t?t[1]:NaN}function Ss(t,n){return function(e,r){for(var i=e.length,o=[],s=0,a=t[0],u=0;i>0&&a>0&&(u+a+1>r&&(a=Math.max(1,r-u)),o.push(e.substring(i-=a,i+a)),!((u+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(n)}}function Ns(t){return function(n){return n.replace(/[0-9]/g,function(e){return t[+e]})}}var Ms=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function fn(t){if(!(n=Ms.exec(t)))throw new Error("invalid format: "+t);var n;return new wn({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}fn.prototype=wn.prototype;function wn(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+""}wn.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 Es(t){t:for(var n=t.length,e=1,r=-1,i;e<n;++e)switch(t[e]){case".":r=i=e;break;case"0":r===0&&(r=e),i=e;break;default:if(!+t[e])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Fe;function Ts(t,n){var e=Vt(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(Fe=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Vt(t,Math.max(0,n+o-1))[0]}function Qn(t,n){var e=Vt(t,n);if(!e)return t+"";var r=e[0],i=e[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 Jn={"%":(t,n)=>(t*100).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:$s,e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>Qn(t*100,n),r:Qn,s:Ts,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function jn(t){return t}var te=Array.prototype.map,ne=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ls(t){var n=t.grouping===void 0||t.thousands===void 0?jn:Ss(te.call(t.grouping,Number),t.thousands+""),e=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?jn:Ns(te.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function f(h){h=fn(h);var y=h.fill,m=h.align,_=h.sign,$=h.symbol,N=h.zero,C=h.width,T=h.comma,M=h.precision,I=h.trim,E=h.type;E==="n"?(T=!0,E="g"):Jn[E]||(M===void 0&&(M=12),I=!0,E="g"),(N||y==="0"&&m==="=")&&(N=!0,y="0",m="=");var ht=$==="$"?e:$==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",dt=$==="$"?r:/[%p]/.test(E)?s:"",G=Jn[E],st=/[defgprs%]/.test(E);M=M===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function Q(k){var F=ht,L=dt,P,l,w;if(E==="c")L=G(k)+L,k="";else{k=+k;var g=k<0||1/k<0;if(k=isNaN(k)?u:G(Math.abs(k),M),I&&(k=Es(k)),g&&+k==0&&_!=="+"&&(g=!1),F=(g?_==="("?_:a:_==="-"||_==="("?"":_)+F,L=(E==="s"?ne[8+Fe/3]:"")+L+(g&&_==="("?")":""),st){for(P=-1,l=k.length;++P<l;)if(w=k.charCodeAt(P),48>w||w>57){L=(w===46?i+k.slice(P+1):k.slice(P))+L,k=k.slice(0,P);break}}}T&&!N&&(k=n(k,1/0));var x=F.length+k.length+L.length,p=x<C?new Array(C-x+1).join(y):"";switch(T&&N&&(k=n(p+k,p.length?C-L.length:1/0),p=""),m){case"<":k=F+k+L+p;break;case"=":k=F+p+k+L;break;case"^":k=p.slice(0,x=p.length>>1)+F+k+L+p.slice(x);break;default:k=p+F+k+L;break}return o(k)}return Q.toString=function(){return h+""},Q}function c(h,y){var m=f((h=fn(h),h.type="f",h)),_=Math.max(-8,Math.min(8,Math.floor(As(y)/3)))*3,$=Math.pow(10,-_),N=ne[8+_/3];return function(C){return m($*C)+N}}return{format:f,formatPrefix:c}}var Rt,Pe;Cs({thousands:",",grouping:[3],currency:["$",""]});function Cs(t){return Rt=Ls(t),Pe=Rt.format,Rt.formatPrefix,Rt}function Rs(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t);break}return this}const ee=Symbol("implicit");function Oe(){var t=new In,n=[],e=[],r=ee;function i(o){let s=t.get(o);if(s===void 0){if(r!==ee)return r;t.set(o,s=n.push(o)-1)}return e[s%e.length]}return i.domain=function(o){if(!arguments.length)return n.slice();n=[],t=new In;for(const s of o)t.has(s)||t.set(s,n.push(s)-1);return i},i.range=function(o){return arguments.length?(e=Array.from(o),i):e.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Oe(n,e).unknown(r)},Rs.apply(i,arguments),i}function St(t){for(var n=t.length/6|0,e=new Array(n),r=0;r<n;)e[r]="#"+t.slice(r*6,++r*6);return e}const Is=St("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Hs=St("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),zs=St("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Fs=St("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Ps=St("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function _t(t,n,e){this.k=t,this.x=n,this.y=e}_t.prototype={constructor:_t,scale:function(t){return t===1?this:new _t(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new _t(this.k,this.x+this.k*t,this.y+this.k*n)},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+")"}};_t.prototype;function Os(t){return t.target.depth}function Ds(t){return t.depth}function qs(t,n){return n-1-t.height}function De(t,n){return t.sourceLinks.length?t.depth:n-1}function Bs(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?ue(t.sourceLinks,Os)-1:0}function It(t){return function(){return t}}function re(t,n){return Yt(t.source,n.source)||t.index-n.index}function ie(t,n){return Yt(t.target,n.target)||t.index-n.index}function Yt(t,n){return t.y0-n.y0}function jt(t){return t.value}function Xs(t){return t.index}function Vs(t){return t.nodes}function Ys(t){return t.links}function oe(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function se({nodes:t}){for(const n of t){let e=n.y0,r=e;for(const i of n.sourceLinks)i.y0=e+i.width/2,e+=i.width;for(const i of n.targetLinks)i.y1=r+i.width/2,r+=i.width}}function Us(){let t=0,n=0,e=1,r=1,i=24,o=8,s,a=Xs,u=De,f,c,h=Vs,y=Ys,m=6;function _(){const l={nodes:h.apply(null,arguments),links:y.apply(null,arguments)};return $(l),N(l),C(l),T(l),E(l),se(l),l}_.update=function(l){return se(l),l},_.nodeId=function(l){return arguments.length?(a=typeof l=="function"?l:It(l),_):a},_.nodeAlign=function(l){return arguments.length?(u=typeof l=="function"?l:It(l),_):u},_.nodeSort=function(l){return arguments.length?(f=l,_):f},_.nodeWidth=function(l){return arguments.length?(i=+l,_):i},_.nodePadding=function(l){return arguments.length?(o=s=+l,_):o},_.nodes=function(l){return arguments.length?(h=typeof l=="function"?l:It(l),_):h},_.links=function(l){return arguments.length?(y=typeof l=="function"?l:It(l),_):y},_.linkSort=function(l){return arguments.length?(c=l,_):c},_.size=function(l){return arguments.length?(t=n=0,e=+l[0],r=+l[1],_):[e-t,r-n]},_.extent=function(l){return arguments.length?(t=+l[0][0],e=+l[1][0],n=+l[0][1],r=+l[1][1],_):[[t,n],[e,r]]},_.iterations=function(l){return arguments.length?(m=+l,_):m};function $({nodes:l,links:w}){for(const[x,p]of l.entries())p.index=x,p.sourceLinks=[],p.targetLinks=[];const g=new Map(l.map((x,p)=>[a(x,p,l),x]));for(const[x,p]of w.entries()){p.index=x;let{source:b,target:A}=p;typeof b!="object"&&(b=p.source=oe(g,b)),typeof A!="object"&&(A=p.target=oe(g,A)),b.sourceLinks.push(p),A.targetLinks.push(p)}if(c!=null)for(const{sourceLinks:x,targetLinks:p}of l)x.sort(c),p.sort(c)}function N({nodes:l}){for(const w of l)w.value=w.fixedValue===void 0?Math.max(Gt(w.sourceLinks,jt),Gt(w.targetLinks,jt)):w.fixedValue}function C({nodes:l}){const w=l.length;let g=new Set(l),x=new Set,p=0;for(;g.size;){for(const b of g){b.depth=p;for(const{target:A}of b.sourceLinks)x.add(A)}if(++p>w)throw new Error("circular link");g=x,x=new Set}}function T({nodes:l}){const w=l.length;let g=new Set(l),x=new Set,p=0;for(;g.size;){for(const b of g){b.height=p;for(const{source:A}of b.targetLinks)x.add(A)}if(++p>w)throw new Error("circular link");g=x,x=new Set}}function M({nodes:l}){const w=Rn(l,p=>p.depth)+1,g=(e-t-i)/(w-1),x=new Array(w);for(const p of l){const b=Math.max(0,Math.min(w-1,Math.floor(u.call(null,p,w))));p.layer=b,p.x0=t+b*g,p.x1=p.x0+i,x[b]?x[b].push(p):x[b]=[p]}if(f)for(const p of x)p.sort(f);return x}function I(l){const w=ue(l,g=>(r-n-(g.length-1)*s)/Gt(g,jt));for(const g of l){let x=n;for(const p of g){p.y0=x,p.y1=x+p.value*w,x=p.y1+s;for(const b of p.sourceLinks)b.width=b.value*w}x=(r-x+s)/(g.length+1);for(let p=0;p<g.length;++p){const b=g[p];b.y0+=x*(p+1),b.y1+=x*(p+1)}F(g)}}function E(l){const w=M(l);s=Math.min(o,(r-n)/(Rn(w,g=>g.length)-1)),I(w);for(let g=0;g<m;++g){const x=Math.pow(.99,g),p=Math.max(1-x,(g+1)/m);dt(w,x,p),ht(w,x,p)}}function ht(l,w,g){for(let x=1,p=l.length;x<p;++x){const b=l[x];for(const A of b){let O=0,D=0;for(const{source:j,value:pt}of A.targetLinks){let tt=pt*(A.layer-j.layer);O+=L(j,A)*tt,D+=tt}if(!(D>0))continue;let J=(O/D-A.y0)*w;A.y0+=J,A.y1+=J,k(A)}f===void 0&&b.sort(Yt),G(b,g)}}function dt(l,w,g){for(let x=l.length,p=x-2;p>=0;--p){const b=l[p];for(const A of b){let O=0,D=0;for(const{target:j,value:pt}of A.sourceLinks){let tt=pt*(j.layer-A.layer);O+=P(A,j)*tt,D+=tt}if(!(D>0))continue;let J=(O/D-A.y0)*w;A.y0+=J,A.y1+=J,k(A)}f===void 0&&b.sort(Yt),G(b,g)}}function G(l,w){const g=l.length>>1,x=l[g];Q(l,x.y0-s,g-1,w),st(l,x.y1+s,g+1,w),Q(l,r,l.length-1,w),st(l,n,0,w)}function st(l,w,g,x){for(;g<l.length;++g){const p=l[g],b=(w-p.y0)*x;b>1e-6&&(p.y0+=b,p.y1+=b),w=p.y1+s}}function Q(l,w,g,x){for(;g>=0;--g){const p=l[g],b=(p.y1-w)*x;b>1e-6&&(p.y0-=b,p.y1-=b),w=p.y0-s}}function k({sourceLinks:l,targetLinks:w}){if(c===void 0){for(const{source:{sourceLinks:g}}of w)g.sort(ie);for(const{target:{targetLinks:g}}of l)g.sort(re)}}function F(l){if(c===void 0)for(const{sourceLinks:w,targetLinks:g}of l)w.sort(ie),g.sort(re)}function L(l,w){let g=l.y0-(l.sourceLinks.length-1)*s/2;for(const{target:x,width:p}of l.sourceLinks){if(x===w)break;g+=p+s}for(const{source:x,width:p}of w.targetLinks){if(x===l)break;g-=p}return g}function P(l,w){let g=w.y0-(w.targetLinks.length-1)*s/2;for(const{source:x,width:p}of w.targetLinks){if(x===l)break;g+=p+s}for(const{target:x,width:p}of l.sourceLinks){if(x===w)break;g-=p}return g}return _}var cn=Math.PI,ln=2*cn,et=1e-6,Ws=ln-et;function hn(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function qe(){return new hn}hn.prototype=qe.prototype={constructor:hn,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,r){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+r)},bezierCurveTo:function(t,n,e,r,i,o){this._+="C"+ +t+","+ +n+","+ +e+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,n,e,r,i){t=+t,n=+n,e=+e,r=+r,i=+i;var o=this._x1,s=this._y1,a=e-t,u=r-n,f=o-t,c=s-n,h=f*f+c*c;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(h>et)if(!(Math.abs(c*a-u*f)>et)||!i)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var y=e-o,m=r-s,_=a*a+u*u,$=y*y+m*m,N=Math.sqrt(_),C=Math.sqrt(h),T=i*Math.tan((cn-Math.acos((_+h-$)/(2*N*C)))/2),M=T/C,I=T/N;Math.abs(M-1)>et&&(this._+="L"+(t+M*f)+","+(n+M*c)),this._+="A"+i+","+i+",0,0,"+ +(c*y>f*m)+","+(this._x1=t+I*a)+","+(this._y1=n+I*u)}},arc:function(t,n,e,r,i,o){t=+t,n=+n,e=+e,o=!!o;var s=e*Math.cos(r),a=e*Math.sin(r),u=t+s,f=n+a,c=1^o,h=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);this._x1===null?this._+="M"+u+","+f:(Math.abs(this._x1-u)>et||Math.abs(this._y1-f)>et)&&(this._+="L"+u+","+f),e&&(h<0&&(h=h%ln+ln),h>Ws?this._+="A"+e+","+e+",0,1,"+c+","+(t-s)+","+(n-a)+"A"+e+","+e+",0,1,"+c+","+(this._x1=u)+","+(this._y1=f):h>et&&(this._+="A"+e+","+e+",0,"+ +(h>=cn)+","+c+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};function ae(t){return function(){return t}}function Ks(t){return t[0]}function Zs(t){return t[1]}var Gs=Array.prototype.slice;function Qs(t){return t.source}function Js(t){return t.target}function js(t){var n=Qs,e=Js,r=Ks,i=Zs,o=null;function s(){var a,u=Gs.call(arguments),f=n.apply(this,u),c=e.apply(this,u);if(o||(o=a=qe()),t(o,+r.apply(this,(u[0]=f,u)),+i.apply(this,u),+r.apply(this,(u[0]=c,u)),+i.apply(this,u)),a)return o=null,a+""||null}return s.source=function(a){return arguments.length?(n=a,s):n},s.target=function(a){return arguments.length?(e=a,s):e},s.x=function(a){return arguments.length?(r=typeof a=="function"?a:ae(+a),s):r},s.y=function(a){return arguments.length?(i=typeof a=="function"?a:ae(+a),s):i},s.context=function(a){return arguments.length?(o=a??null,s):o},s}function ta(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function na(){return js(ta)}function ea(t){return[t.source.x1,t.y0]}function ra(t){return[t.target.x0,t.y1]}function ia(){return na().source(ea).target(ra)}const oa=Ze({name:"EsSankeychart",components:{},props:{options:{type:Object,default:()=>({})},datasets:{type:[String,Number,Array,Object],default:()=>[]},eventData:{type:[String,Boolean,Number],default:""},element:{type:Object,default:()=>({})}},setup(t){function n({nodes:r,links:i},{format:o=",",align:s="center",nodeId:a=S=>S.id,nodeGroup:u=S=>S.id.split(/\W/)[0],nodeGroups:f,nodeLabel:c,nodeLabelPosition:h="inside",nodeLabelColor:y="#eee",nodeUnit:m=({unit:S})=>S,nodeTitle:_=S=>`${S.id}
|
|
${o(S.value)} ${m(S)||""}`,nodeAlign:$=s,nodeSort:N,nodeWidth:C=15,nodePadding:T=14,leftNodeLabelPadding:M=6,rightNodeLabelPadding:I=6,middleNodeLabelPadding:E=6,nodeLabelFontSize:ht=14,nodeStroke:dt="currentColor",nodeStrokeWidth:G,nodeStrokeOpacity:st=1,nodeStrokeLinejoin:Q,linkSource:k=({source:S})=>S,linkTarget:F=({target:S})=>S,linkValue:L=({value:S})=>S,linkUnit:P=({unit:S})=>S,linkPath:l=ia(),linkTitle:w=S=>`${S.source.id} → ${S.target.id}
|
|
${o(S.value)} ${P(S)||""}`,linkColor:g="source-target",linkStrokeOpacity:x=.5,linkColorNoOpacity:p=!1,linkMixBlendMode:b="multiply",colors:A=Fs.concat(Hs).concat(zs).concat(Ps).concat(Is),width:O=1920,height:D=1080,marginTop:J=5,marginRight:j=1,marginBottom:pt=5,marginLeft:tt=1,enableAutoFlow:Be=!0}={}){typeof $!="function"&&($={left:Ds,right:qs,center:Bs}[$]??De);function S(d){return d!==null&&typeof d=="object"?d.valueOf():d}const vn=q(i,k).map(S),bn=q(i,F).map(S),Xe=q(i,L),kn=q(i,P);r===void 0&&(r=Array.from(sr(vn,bn),d=>({id:d})));const Zt=q(r,a).map(S),V=u==null?null:q(r,u).map(S);r=q(r,(d,v)=>({id:Zt[v],unit:kn[v]})),i=q(i,(d,v)=>({source:vn[v],target:bn[v],value:Xe[v],unit:kn[v]})),!V&&["source","target","source-target"].includes(g)&&(g="currentColor"),V&&f===void 0&&(f=V);const nt=u==null?null:Oe(f,A);Us().nodeId(({index:d})=>Zt[d]).nodeAlign($).nodeWidth(C).nodePadding(T).nodeSort(N).extent([[tt,J],[O-j,D-pt]])({nodes:r,links:i}),typeof o!="function"&&(o=Pe(o));const $n=c===void 0?Zt:c==null?null:q(r,c),An=_==null?null:q(r,_),Sn=w==null?null:q(i,w),at=`O-${Math.random().toString(16).slice(2)}`,Nt=Bi("svg").attr("width",O).attr("height",D).attr("viewBox",[0,0,O,D]).attr("style","max-width: 100%; height: auto; height: intrinsic;"),Nn=Nt.append("g").attr("fill","none").attr("stroke-opacity",x).selectAll("g").data(i).join("g").style("mix-blend-mode",b),Mn=function(d){if(d.length===0)return;const v=d.pop();ut(`#${at}-path-${v.index}`).attr("stroke-dashoffset",5e3).transition().duration(1500).attr("stroke-dashoffset",0).on("end",()=>{Mn(window.structuredClone(d))})},Ve=function(){ut(this).attr("stroke-dasharray",5e3).attr("stroke-dashoffset",0)},En=Nt.append("g").attr("stroke",dt).attr("stroke-width",G).attr("stroke-opacity",st).attr("stroke-linejoin",Q).selectAll("rect").data(r).join("rect").attr("x",d=>d.x0).attr("y",d=>d.y0).attr("height",d=>d.y1-d.y0<3?3:d.y1-d.y0).attr("width",d=>d.x1-d.x0).attr("fill",(d,v)=>A[v]).attr("id",d=>d.id).on("mouseover",(d,v)=>{Mn(window.structuredClone(v.sourceLinks))}).on("mouseout",(d,v)=>{v.sourceLinks.forEach(z=>{Ve.call(document.getElementById(`#${at}-path-${z.index}`))})});V&&En.attr("fill",({index:d})=>nt(V[d])),An&&En.append("title").text(({index:d})=>An[d]),g==="source-target"&&Nn.append("linearGradient").attr("id",d=>`${at}-link-${d.index}`).attr("gradientUnits","userSpaceOnUse").attr("x1",d=>d.source.x1).attr("x2",d=>d.target.x0).call(d=>d.append("stop").attr("offset","0%").attr("stop-color",({source:{index:v}})=>nt(V[v]))).call(d=>d.append("stop").attr("offset","100%").attr("stop-color",({target:{index:v},source:{index:z}})=>nt(p?V[z]:V[v]))),Nn.append("path").attr("d",l).attr("class","sankeyPath").attr("id",({index:d})=>`${at}-path-${d}`).attr("stroke",g==="source-target"?({index:d})=>`url(#${at}-link-${d})`:g==="source"?({source:{index:d}})=>nt(V[d]):g==="target"?({target:{index:d}})=>nt(V[d]):g).attr("stroke-width",({width:d})=>Math.max(1,d)).attr("stroke-dasharray",5e3).attr("stroke-dashoffset",5e3).call(Sn?d=>{d.append("title").text(({index:v})=>Sn[v])}:()=>{}).each((d,v,z)=>{const Et=(v+1)*50;setTimeout(()=>{ut(z[v]).transition().duration(1500).attr("stroke-dashoffset",0)},Et)});const Tn=Math.max(...new Set(r.map(d=>d.layer)));$n&&Nt.append("g").attr("font-family","sans-serif").attr("font-size",10).selectAll("text").data(r).join("text").attr("x",d=>{if(h==="inside")return d.layer===0?d.x1+M:d.layer===Tn?d.x0-I:d.x1+E;if(h==="outside")return d.layer===0?d.x0-M:d.layer===Tn?d.x1+I:d.x1+E}).attr("y",d=>(d.y1+d.y0)/2).attr("dy","0.35em").attr("font-size",ht).attr("fill",y).attr("text-anchor",d=>d.x0<O/2?"start":"end").text(({index:d})=>$n[d]);const Ye=r.reduce((d,v)=>v.layer===0?d+(v.y1-v.y0)+T:d,0),Ue=r.reduce((d,v)=>v.layer===1?d+(v.y1-v.y0)+T:d,0),We=r.reduce((d,v)=>v.layer===2?d+(v.y1-v.y0)+T:d,0),Ln=Math.max(Ye,Ue,We),gt=Nt.node();gt.style.overflow="visible",gt.setAttribute("height",Ln),gt.setAttribute("viewBox",`0 0 ${O} ${Ln}`);const Mt=rr(!1);if(Be){const d=function(v){if(v.length===0){Mt.value=!1;return}const z=v.pop();ut(`#${at}-path-${z.index}`).attr("stroke-dashoffset",5e3).transition().duration(1500).attr("stroke-dashoffset",0).on("end",()=>{d(window.structuredClone(v))})};setTimeout(()=>{const v=r.reduce((z,Et)=>Et.sourceLinks.length!==0?z.concat(Et.sourceLinks):z,[]);Mt.value=!0,d(window.structuredClone(v)),Cn(Mt,z=>{z===!1&&(Mt.value=!0,d(window.structuredClone(v)))})},2e3)}Object.assign(gt,{scales:{color:nt}}),ut(`.chart-${t.element.id}`).selectAll("*").remove(),document.querySelector(`.chart-${t.element.id}`).appendChild(gt)}return Cn([()=>t.datasets,()=>t.options],([r,i])=>{r&&Ge(()=>{const o=ir(Qe(i));if(o.colors.length===0)delete o.colors;else{const s=o.colors.map(a=>a.color);o.colors=s}n({links:r},o)})},{immediate:!0,deep:!0}),{margins:Je(()=>{const{marginTop:r,marginRight:i,marginBottom:o,marginLeft:s}=t.options;return{padding:`${r}px ${i}px ${o}px ${s}px`}})}}});function sa(t,n,e,r,i,o){return je(),tr("div",{class:nr(`chart-${t.element.id}`),width:"100%",height:"100%",style:er(t.margins)},null,6)}const da=Ke(oa,[["render",sa]]);export{da as default};
|