courthive-components 0.9.28-beta.4 → 0.9.28-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30710,7 +30710,7 @@ function yue(e) {
|
|
|
30710
30710
|
}), Ko.show(), Ko.setProps({ interactive: !0 })), Ko;
|
|
30711
30711
|
}
|
|
30712
30712
|
function vue() {
|
|
30713
|
-
return "0.9.28-beta.
|
|
30713
|
+
return "0.9.28-beta.5";
|
|
30714
30714
|
}
|
|
30715
30715
|
const Sue = {
|
|
30716
30716
|
// Best of 3 sets
|
|
@@ -191,7 +191,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
191
191
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
192
192
|
|
|
193
193
|
`,`1) content: element.innerHTML
|
|
194
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=n.reduce(function(c,u){var l=u&&lie(u,i);return l&&c.push(l),c},[]);return Hf(e)?s[0]:s}nu.defaultProps=yn,nu.setDefaultProps=oie,nu.currentInput=Qa,Object.assign({},k2,{effect:function(t){var r=t.state,i={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,i.popper),r.styles=i,r.elements.arrow&&Object.assign(r.elements.arrow.style,i.arrow)}}),nu.setDefaultProps({render:h$});function kP(e){return typeof e=="function"}let Rs;function zf(e){Rs&&(Rs?.destroy(!0),Rs=void 0),e?.remove&&e.remove()}function die(e){const{title:t,options:r,menuItems:i=[],coords:n,callback:a,config:o}=e;let{target:s,items:c}=e;if(!r?.length&&!c?.length&&!i)return;zf();const u=document.createElement("div");let l;const d=()=>{c=c?.filter(m=>!m.hide&&!m.disabled).map(m=>({...m,onClick:()=>{zf(u),kP(m.onClick)&&m.onClick()}}))||r?.filter(m=>!m.hide&&!m.disabled).map(m=>({text:typeof m=="object"?m.option:m,style:m.style,onClick:()=>{m.subMenu?Rs.setContent("IMPLEMENT SUB MENU"):kP(m.onClick)?(zf(u),m.onClick()):kP(a)&&a&&(zf(u),a(typeof m=="object"?{...m,coords:n}:m))}}));const p=[{text:t,items:c},...i];return l=A2(u,p).focusElement,u};return s=s||n?.evt?.target,s&&(Rs=nu(s,{content:d,theme:"light-border",trigger:"click",onShown:()=>{l&&setTimeout(()=>l?.focus(),0)},...o}),Rs.show(),Rs.setProps({interactive:!0})),Rs}function pie(){return"0.9.28-beta.4"}const fie={SET3_S6_TB7:"SET3-S:6/TB7",SET3_S6_TB7_F_TB10:"SET3-S:6/TB7-F:TB10",SET3_S6_TB10:"SET3-S:6/TB10",SET3_S6_F_TB10:"SET3-S:6-F:TB10",SET3_S6_TB7_NOAD:"SET3-S:6/TB7NOAD",SET3_S8_TB7:"SET3-S:8/TB7",SET3_S8_TB7_AT7:"SET3-S:8/TB7@7",SET3_S4_TB7:"SET3-S:4/TB7",SET3_S4_TB7_F_TB10:"SET3-S:4/TB7-F:TB10",SET3_S4_TB5_AT3_F_TB10:"SET3-S:4/TB5@3-F:TB10",SET5_S6_TB7:"SET5-S:6/TB7",SET5_S6_TB7_F_TB10:"SET5-S:6/TB7-F:TB10",SET1_S6_TB7:"SET1-S:6/TB7",SET1_S6_TB10:"SET1-S:6/TB10",SET1_S6_TB7_AT5:"SET1-S:6/TB7@5",SET1_S8_TB7:"SET1-S:8/TB7",SET1_S4_TB7:"SET1-S:4/TB7",SET1_S5_TB9_AT4:"SET1-S:5/TB9@4",SET1_S_TB7:"SET1-S:T7",SET1_S_TB10:"SET1-S:TB10",SET1_S_TB21:"SET1-S:T21",SET1_S8:"SET1-S:8",SET1_S10:"SET1-S:10",FAST4:"SET5-S:4/NOAD",SET3X_T10A_TB1:"SET3XA-S:T10-F:TB1",SET3X_T10A_TB1_NOAD:"SET3XA-S:T10-F:TB1NOAD",SET4X_T10A_TB1:"SET4XA-S:T10-F:TB1"};function mie(e,t,r){if(!e)return{elements:{}};const i={};for(const n of t||[]){if(!n?.label||n.hide)continue;const a=document.createElement("button");n.id&&(i[n.id]=a,a.id=n.id),a.style.marginRight=".5em",a.className="button font-medium",n.intent&&a.classList.add(n.intent),a.innerHTML=n.label,n.disabled&&(a.disabled=!0),a.onclick=o=>{o.stopPropagation(),!o.target.disabled&&Xt(n.onClick)&&n.onClick(),r&&Xt(r)&&r()},e.appendChild(a)}return{elements:i}}const hie=(e,t)=>r=>r?.trim().length>=e&&(!t||r?.trim().length<=t);function g$(e){return gf.isConvertableInteger(e)&&parseInt(e.toString())>=0}const gie=(e,t)=>r=>g$(r)&&Number(r)>=e&&Number(r)<=t,Iie=e=>/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?\d)(?=.*?[#?!@$%^&*-]).{8,12}$/.test(e);function yie(e){return gf.dateTime.dateValidation.test(e)}const vie=(e,t)=>r=>{const i=(r||"").trim().split(" ").length;return i>=e&&(!t||i<=t)},Sie=/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,bie=Object.freeze(Object.defineProperty({__proto__:null,dateValidator:yie,emailValidator:e=>Sie.exec(e),nameValidator:hie,numericRange:gie,numericValidator:g$,passwordValidator:Iie,wordValidator:vie},Symbol.toStringTag,{value:"Module"}));class Tie{constructor({tournamentRecord:t,drawId:r,structureId:i,eventId:n}){this.tournamentRecord=t,this.drawId=r,this.structureId=i,this.eventId=n||t.events?.[0]?.eventId,Ur.setState(t)}setRenderCallback(t){this.renderCallback=t}getAllParticipants(){Ur.setState(this.tournamentRecord);const{participants:t=[]}=Ur.getParticipants()||{};return t.map(r=>({participantId:r.participantId,participantName:r.participantName,participantType:r.participantType,person:r.person,individualParticipants:r.individualParticipants}))}getAvailableParticipants(){Ur.setState(this.tournamentRecord);const t=this.getAllParticipants(),{assignedParticipantIds:r=[]}=Ur.getAssignedParticipantIds({drawId:this.drawId})||{};return t.filter(i=>!r.includes(i.participantId))}removeAssignment({drawPosition:t}){Ur.setState(this.tournamentRecord);const a=this.getMatchUps().find(c=>c.sides?.some(u=>u.drawPosition===t))?.sides?.find(c=>c.drawPosition===t)?.bye===!0,o=Ur.removeDrawPositionAssignment({drawId:this.drawId,structureId:this.structureId,drawPosition:t});if(o.error)return{success:!1,error:o.error};const{tournamentRecord:s}=Ur.getState()||{};return this.tournamentRecord=s,a&&this.renderCallback&&this.renderCallback(),{success:!0}}assignParticipant({drawPosition:t,participantId:r}){Ur.setState(this.tournamentRecord);const i=Ur.assignDrawPosition({drawId:this.drawId,structureId:this.structureId,drawPosition:t,participantId:r});if(i.error)return{success:!1,error:i.error};const{tournamentRecord:n}=Ur.getState()||{};return this.tournamentRecord=n,this.focusDrawPosition=t+1,this.renderCallback&&this.renderCallback(),{success:!0}}getAndClearFocusDrawPosition(){const t=this.focusDrawPosition;return this.focusDrawPosition=void 0,t}assignBye({drawPosition:t}){Ur.setState(this.tournamentRecord);const r=Ur.assignDrawPositionBye({drawId:this.drawId,structureId:this.structureId,drawPosition:t});if(r.error)return{success:!1,error:r.error};const{tournamentRecord:i}=Ur.getState()||{};return this.tournamentRecord=i,this.focusDrawPosition=t+1,this.renderCallback&&this.renderCallback(),{success:!0}}assignQualifier({drawPosition:t}){Ur.setState(this.tournamentRecord);const r=Ur.assignDrawPosition({drawId:this.drawId,structureId:this.structureId,drawPosition:t,qualifier:!0});if(r.error)return{success:!1,error:r.error};const{tournamentRecord:i}=Ur.getState()||{};return this.tournamentRecord=i,this.focusDrawPosition=t+1,this.renderCallback&&this.renderCallback(),{success:!0}}getMatchUps(){Ur.setState(this.tournamentRecord);const{eventData:t}=Ur.getEventData({eventId:this.eventId})||{},n=t?.drawsData?.find(o=>o.drawId===this.drawId)?.structures?.find(o=>o.structureId===this.structureId)?.roundMatchUps;return n?Object.values(n).flat():[]}getState(){return this.tournamentRecord}getContext(){return{drawId:this.drawId,structureId:this.structureId}}}function ly(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function wie(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function I$(e){let t,r,i;e.length!==2?(t=ly,r=(s,c)=>ly(e(s),c),i=(s,c)=>e(s)-c):(t=e===ly||e===wie?e:Uie,r=e,i=e);function n(s,c,u=0,l=s.length){if(u<l){if(t(c,c)!==0)return l;do{const d=u+l>>>1;r(s[d],c)<0?u=d+1:l=d}while(u<l)}return u}function a(s,c,u=0,l=s.length){if(u<l){if(t(c,c)!==0)return l;do{const d=u+l>>>1;r(s[d],c)<=0?u=d+1:l=d}while(u<l)}return u}function o(s,c,u=0,l=s.length){const d=n(s,c,u,l-1);return d>u&&i(s[d-1],c)>-i(s[d],c)?d-1:d}return{left:n,center:o,right:a}}function Uie(){return 0}function Die(e){return e===null?NaN:+e}const Pie=I$(ly).right;I$(Die).center;const Eie=Math.sqrt(50),Nie=Math.sqrt(10),Aie=Math.sqrt(2);function dy(e,t,r){const i=(t-e)/Math.max(0,r),n=Math.floor(Math.log10(i)),a=i/Math.pow(10,n),o=a>=Eie?10:a>=Nie?5:a>=Aie?2:1;let s,c,u;return n<0?(u=Math.pow(10,-n)/o,s=Math.round(e*u),c=Math.round(t*u),s/u<e&&++s,c/u>t&&--c,u=-u):(u=Math.pow(10,n)*o,s=Math.round(e/u),c=Math.round(t/u),s*u<e&&++s,c*u>t&&--c),c<s&&.5<=r&&r<2?dy(e,t,r*2):[s,c,u]}function Cie(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const i=t<e,[n,a,o]=i?dy(t,e,r):dy(e,t,r);if(!(a>=n))return[];const s=a-n+1,c=new Array(s);if(i)if(o<0)for(let u=0;u<s;++u)c[u]=(a-u)/-o;else for(let u=0;u<s;++u)c[u]=(a-u)*o;else if(o<0)for(let u=0;u<s;++u)c[u]=(n+u)/-o;else for(let u=0;u<s;++u)c[u]=(n+u)*o;return c}function OP(e,t,r){return t=+t,e=+e,r=+r,dy(e,t,r)[2]}function Mie(e,t,r){t=+t,e=+e,r=+r;const i=t<e,n=i?OP(t,e,r):OP(e,t,r);return(i?-1:1)*(n<0?1/-n:n)}function xP(e,t,r){e=+e,t=+t,r=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+r;for(var i=-1,n=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(n);++i<n;)a[i]=e+i*r;return a}var Rie={value:()=>{}};function y$(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new py(r)}function py(e){this._=e}function kie(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",n=r.indexOf(".");if(n>=0&&(i=r.slice(n+1),r=r.slice(0,n)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}py.prototype=y$.prototype={constructor:py,on:function(e,t){var r=this._,i=kie(e+"",r),n,a=-1,o=i.length;if(arguments.length<2){for(;++a<o;)if((n=(e=i[a]).type)&&(n=Oie(r[n],e.name)))return n;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(n=(e=i[a]).type)r[n]=v$(r[n],e.name,t);else if(t==null)for(n in r)r[n]=v$(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new py(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var r=new Array(n),i=0,n,a;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],i=0,n=a.length;i<n;++i)a[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],n=0,a=i.length;n<a;++n)i[n].value.apply(t,r)}};function Oie(e,t){for(var r=0,i=e.length,n;r<i;++r)if((n=e[r]).name===t)return n.value}function v$(e,t,r){for(var i=0,n=e.length;i<n;++i)if(e[i].name===t){e[i]=Rie,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var FP="http://www.w3.org/1999/xhtml";const S$={svg:"http://www.w3.org/2000/svg",xhtml:FP,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fy(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),S$.hasOwnProperty(t)?{space:S$[t],local:e}:e}function xie(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===FP&&t.documentElement.namespaceURI===FP?t.createElement(e):t.createElementNS(r,e)}}function Fie(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function b$(e){var t=fy(e);return(t.local?Fie:xie)(t)}function _ie(){}function _P(e){return e==null?_ie:function(){return this.querySelector(e)}}function Lie(e){typeof e!="function"&&(e=_P(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var a=t[n],o=a.length,s=i[n]=new Array(o),c,u,l=0;l<o;++l)(c=a[l])&&(u=e.call(c,c.__data__,l,a))&&("__data__"in c&&(u.__data__=c.__data__),s[l]=u);return new vn(i,this._parents)}function Bie(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function $ie(){return[]}function T$(e){return e==null?$ie:function(){return this.querySelectorAll(e)}}function Vie(e){return function(){return Bie(e.apply(this,arguments))}}function Gie(e){typeof e=="function"?e=Vie(e):e=T$(e);for(var t=this._groups,r=t.length,i=[],n=[],a=0;a<r;++a)for(var o=t[a],s=o.length,c,u=0;u<s;++u)(c=o[u])&&(i.push(e.call(c,c.__data__,u,o)),n.push(c));return new vn(i,n)}function w$(e){return function(){return this.matches(e)}}function U$(e){return function(t){return t.matches(e)}}var jie=Array.prototype.find;function Wie(e){return function(){return jie.call(this.children,e)}}function qie(){return this.firstElementChild}function Hie(e){return this.select(e==null?qie:Wie(typeof e=="function"?e:U$(e)))}var Yie=Array.prototype.filter;function zie(){return Array.from(this.children)}function Kie(e){return function(){return Yie.call(this.children,e)}}function Qie(e){return this.selectAll(e==null?zie:Kie(typeof e=="function"?e:U$(e)))}function Xie(e){typeof e!="function"&&(e=w$(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var a=t[n],o=a.length,s=i[n]=[],c,u=0;u<o;++u)(c=a[u])&&e.call(c,c.__data__,u,a)&&s.push(c);return new vn(i,this._parents)}function D$(e){return new Array(e.length)}function Jie(){return new vn(this._enter||this._groups.map(D$),this._parents)}function my(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}my.prototype={constructor:my,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Zie(e){return function(){return e}}function ene(e,t,r,i,n,a){for(var o=0,s,c=t.length,u=a.length;o<u;++o)(s=t[o])?(s.__data__=a[o],i[o]=s):r[o]=new my(e,a[o]);for(;o<c;++o)(s=t[o])&&(n[o]=s)}function tne(e,t,r,i,n,a,o){var s,c,u=new Map,l=t.length,d=a.length,p=new Array(l),f;for(s=0;s<l;++s)(c=t[s])&&(p[s]=f=o.call(c,c.__data__,s,t)+"",u.has(f)?n[s]=c:u.set(f,c));for(s=0;s<d;++s)f=o.call(e,a[s],s,a)+"",(c=u.get(f))?(i[s]=c,c.__data__=a[s],u.delete(f)):r[s]=new my(e,a[s]);for(s=0;s<l;++s)(c=t[s])&&u.get(p[s])===c&&(n[s]=c)}function rne(e){return e.__data__}function ine(e,t){if(!arguments.length)return Array.from(this,rne);var r=t?tne:ene,i=this._parents,n=this._groups;typeof e!="function"&&(e=Zie(e));for(var a=n.length,o=new Array(a),s=new Array(a),c=new Array(a),u=0;u<a;++u){var l=i[u],d=n[u],p=d.length,f=nne(e.call(l,l&&l.__data__,u,i)),m=f.length,h=s[u]=new Array(m),g=o[u]=new Array(m),I=c[u]=new Array(p);r(l,d,h,g,I,f,t);for(var y=0,S=0,v,b;y<m;++y)if(v=h[y]){for(y>=S&&(S=y+1);!(b=g[S])&&++S<m;);v._next=b||null}}return o=new vn(o,i),o._enter=s,o._exit=c,o}function nne(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ane(){return new vn(this._exit||this._groups.map(D$),this._parents)}function one(e,t,r){var i=this.enter(),n=this,a=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(n=t(n),n&&(n=n.selection())),r==null?a.remove():r(a),i&&n?i.merge(n).order():n}function sne(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,n=r.length,a=i.length,o=Math.min(n,a),s=new Array(n),c=0;c<o;++c)for(var u=r[c],l=i[c],d=u.length,p=s[c]=new Array(d),f,m=0;m<d;++m)(f=u[m]||l[m])&&(p[m]=f);for(;c<n;++c)s[c]=r[c];return new vn(s,this._parents)}function cne(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],n=i.length-1,a=i[n],o;--n>=0;)(o=i[n])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function une(e){e||(e=lne);function t(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var r=this._groups,i=r.length,n=new Array(i),a=0;a<i;++a){for(var o=r[a],s=o.length,c=n[a]=new Array(s),u,l=0;l<s;++l)(u=o[l])&&(c[l]=u);c.sort(t)}return new vn(n,this._parents).order()}function lne(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dne(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function pne(){return Array.from(this)}function fne(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],n=0,a=i.length;n<a;++n){var o=i[n];if(o)return o}return null}function mne(){let e=0;for(const t of this)++e;return e}function hne(){return!this.node()}function gne(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var n=t[r],a=0,o=n.length,s;a<o;++a)(s=n[a])&&e.call(s,s.__data__,a,n);return this}function Ine(e){return function(){this.removeAttribute(e)}}function yne(e){return function(){this.removeAttributeNS(e.space,e.local)}}function vne(e,t){return function(){this.setAttribute(e,t)}}function Sne(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function bne(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Tne(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function wne(e,t){var r=fy(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?yne:Ine:typeof t=="function"?r.local?Tne:bne:r.local?Sne:vne)(r,t))}function P$(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Une(e){return function(){this.style.removeProperty(e)}}function Dne(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Pne(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function Ene(e,t,r){return arguments.length>1?this.each((t==null?Une:typeof t=="function"?Pne:Dne)(e,t,r??"")):Kl(this.node(),e)}function Kl(e,t){return e.style.getPropertyValue(t)||P$(e).getComputedStyle(e,null).getPropertyValue(t)}function Nne(e){return function(){delete this[e]}}function Ane(e,t){return function(){this[e]=t}}function Cne(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Mne(e,t){return arguments.length>1?this.each((t==null?Nne:typeof t=="function"?Cne:Ane)(e,t)):this.node()[e]}function E$(e){return e.trim().split(/^|\s+/)}function LP(e){return e.classList||new N$(e)}function N$(e){this._node=e,this._names=E$(e.getAttribute("class")||"")}N$.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function A$(e,t){for(var r=LP(e),i=-1,n=t.length;++i<n;)r.add(t[i])}function C$(e,t){for(var r=LP(e),i=-1,n=t.length;++i<n;)r.remove(t[i])}function Rne(e){return function(){A$(this,e)}}function kne(e){return function(){C$(this,e)}}function One(e,t){return function(){(t.apply(this,arguments)?A$:C$)(this,e)}}function xne(e,t){var r=E$(e+"");if(arguments.length<2){for(var i=LP(this.node()),n=-1,a=r.length;++n<a;)if(!i.contains(r[n]))return!1;return!0}return this.each((typeof t=="function"?One:t?Rne:kne)(r,t))}function Fne(){this.textContent=""}function _ne(e){return function(){this.textContent=e}}function Lne(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Bne(e){return arguments.length?this.each(e==null?Fne:(typeof e=="function"?Lne:_ne)(e)):this.node().textContent}function $ne(){this.innerHTML=""}function Vne(e){return function(){this.innerHTML=e}}function Gne(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function jne(e){return arguments.length?this.each(e==null?$ne:(typeof e=="function"?Gne:Vne)(e)):this.node().innerHTML}function Wne(){this.nextSibling&&this.parentNode.appendChild(this)}function qne(){return this.each(Wne)}function Hne(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yne(){return this.each(Hne)}function zne(e){var t=typeof e=="function"?e:b$(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Kne(){return null}function Qne(e,t){var r=typeof e=="function"?e:b$(e),i=t==null?Kne:typeof t=="function"?t:_P(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function Xne(){var e=this.parentNode;e&&e.removeChild(this)}function Jne(){return this.each(Xne)}function Zne(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eae(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tae(e){return this.select(e?eae:Zne)}function rae(e){return arguments.length?this.property("__data__",e):this.node().__data__}function iae(e){return function(t){e.call(this,t,this.__data__)}}function nae(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function aae(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,n=t.length,a;r<n;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++i]=a;++i?t.length=i:delete this.__on}}}function oae(e,t,r){return function(){var i=this.__on,n,a=iae(t);if(i){for(var o=0,s=i.length;o<s;++o)if((n=i[o]).type===e.type&&n.name===e.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=a,n.options=r),n.value=t;return}}this.addEventListener(e.type,a,r),n={type:e.type,name:e.name,value:t,listener:a,options:r},i?i.push(n):this.__on=[n]}}function sae(e,t,r){var i=nae(e+""),n,a=i.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,u=s.length,l;c<u;++c)for(n=0,l=s[c];n<a;++n)if((o=i[n]).type===l.type&&o.name===l.name)return l.value}return}for(s=t?oae:aae,n=0;n<a;++n)this.each(s(i[n],t,r));return this}function M$(e,t,r){var i=P$(e),n=i.CustomEvent;typeof n=="function"?n=new n(t,r):(n=i.document.createEvent("Event"),r?(n.initEvent(t,r.bubbles,r.cancelable),n.detail=r.detail):n.initEvent(t,!1,!1)),e.dispatchEvent(n)}function cae(e,t){return function(){return M$(this,e,t)}}function uae(e,t){return function(){return M$(this,e,t.apply(this,arguments))}}function lae(e,t){return this.each((typeof t=="function"?uae:cae)(e,t))}function*dae(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],n=0,a=i.length,o;n<a;++n)(o=i[n])&&(yield o)}var R$=[null];function vn(e,t){this._groups=e,this._parents=t}function Kf(){return new vn([[document.documentElement]],R$)}function pae(){return this}vn.prototype=Kf.prototype={constructor:vn,select:Lie,selectAll:Gie,selectChild:Hie,selectChildren:Qie,filter:Xie,data:ine,enter:Jie,exit:ane,join:one,merge:sne,selection:pae,order:cne,sort:une,call:dne,nodes:pne,node:fne,size:mne,empty:hne,each:gne,attr:wne,style:Ene,property:Mne,classed:xne,text:Bne,html:jne,raise:qne,lower:Yne,append:zne,insert:Qne,remove:Jne,clone:tae,datum:rae,on:sae,dispatch:lae,[Symbol.iterator]:dae};function BP(e){return typeof e=="string"?new vn([[document.querySelector(e)]],[document.documentElement]):new vn([[e]],R$)}function $P(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function k$(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Qf(){}var Xf=.7,hy=1/Xf,Ql="\\s*([+-]?\\d+)\\s*",Jf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fae=/^#([0-9a-f]{3,8})$/,mae=new RegExp(`^rgb\\(${Ql},${Ql},${Ql}\\)$`),hae=new RegExp(`^rgb\\(${Xa},${Xa},${Xa}\\)$`),gae=new RegExp(`^rgba\\(${Ql},${Ql},${Ql},${Jf}\\)$`),Iae=new RegExp(`^rgba\\(${Xa},${Xa},${Xa},${Jf}\\)$`),yae=new RegExp(`^hsl\\(${Jf},${Xa},${Xa}\\)$`),vae=new RegExp(`^hsla\\(${Jf},${Xa},${Xa},${Jf}\\)$`),O$={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};$P(Qf,au,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:x$,formatHex:x$,formatHex8:Sae,formatHsl:bae,formatRgb:F$,toString:F$});function x$(){return this.rgb().formatHex()}function Sae(){return this.rgb().formatHex8()}function bae(){return V$(this).formatHsl()}function F$(){return this.rgb().formatRgb()}function au(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=fae.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?_$(t):r===3?new nn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?gy(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?gy(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=mae.exec(e))?new nn(t[1],t[2],t[3],1):(t=hae.exec(e))?new nn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gae.exec(e))?gy(t[1],t[2],t[3],t[4]):(t=Iae.exec(e))?gy(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yae.exec(e))?$$(t[1],t[2]/100,t[3]/100,1):(t=vae.exec(e))?$$(t[1],t[2]/100,t[3]/100,t[4]):O$.hasOwnProperty(e)?_$(O$[e]):e==="transparent"?new nn(NaN,NaN,NaN,0):null}function _$(e){return new nn(e>>16&255,e>>8&255,e&255,1)}function gy(e,t,r,i){return i<=0&&(e=t=r=NaN),new nn(e,t,r,i)}function Tae(e){return e instanceof Qf||(e=au(e)),e?(e=e.rgb(),new nn(e.r,e.g,e.b,e.opacity)):new nn}function VP(e,t,r,i){return arguments.length===1?Tae(e):new nn(e,t,r,i??1)}function nn(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}$P(nn,VP,k$(Qf,{brighter(e){return e=e==null?hy:Math.pow(hy,e),new nn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Xf:Math.pow(Xf,e),new nn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nn(ou(this.r),ou(this.g),ou(this.b),Iy(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:L$,formatHex:L$,formatHex8:wae,formatRgb:B$,toString:B$}));function L$(){return`#${su(this.r)}${su(this.g)}${su(this.b)}`}function wae(){return`#${su(this.r)}${su(this.g)}${su(this.b)}${su((isNaN(this.opacity)?1:this.opacity)*255)}`}function B$(){const e=Iy(this.opacity);return`${e===1?"rgb(":"rgba("}${ou(this.r)}, ${ou(this.g)}, ${ou(this.b)}${e===1?")":`, ${e})`}`}function Iy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ou(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function su(e){return e=ou(e),(e<16?"0":"")+e.toString(16)}function $$(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new va(e,t,r,i)}function V$(e){if(e instanceof va)return new va(e.h,e.s,e.l,e.opacity);if(e instanceof Qf||(e=au(e)),!e)return new va;if(e instanceof va)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,n=Math.min(t,r,i),a=Math.max(t,r,i),o=NaN,s=a-n,c=(a+n)/2;return s?(t===a?o=(r-i)/s+(r<i)*6:r===a?o=(i-t)/s+2:o=(t-r)/s+4,s/=c<.5?a+n:2-a-n,o*=60):s=c>0&&c<1?0:o,new va(o,s,c,e.opacity)}function Uae(e,t,r,i){return arguments.length===1?V$(e):new va(e,t,r,i??1)}function va(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}$P(va,Uae,k$(Qf,{brighter(e){return e=e==null?hy:Math.pow(hy,e),new va(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Xf:Math.pow(Xf,e),new va(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,n=2*r-i;return new nn(GP(e>=240?e-240:e+120,n,i),GP(e,n,i),GP(e<120?e+240:e-120,n,i),this.opacity)},clamp(){return new va(G$(this.h),yy(this.s),yy(this.l),Iy(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 e=Iy(this.opacity);return`${e===1?"hsl(":"hsla("}${G$(this.h)}, ${yy(this.s)*100}%, ${yy(this.l)*100}%${e===1?")":`, ${e})`}`}}));function G$(e){return e=(e||0)%360,e<0?e+360:e}function yy(e){return Math.max(0,Math.min(1,e||0))}function GP(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const jP=e=>()=>e;function Dae(e,t){return function(r){return e+r*t}}function Pae(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function Eae(e){return(e=+e)==1?j$:function(t,r){return r-t?Pae(t,r,e):jP(isNaN(t)?r:t)}}function j$(e,t){var r=t-e;return r?Dae(e,r):jP(isNaN(e)?t:e)}const vy=(function e(t){var r=Eae(t);function i(n,a){var o=r((n=VP(n)).r,(a=VP(a)).r),s=r(n.g,a.g),c=r(n.b,a.b),u=j$(n.opacity,a.opacity);return function(l){return n.r=o(l),n.g=s(l),n.b=c(l),n.opacity=u(l),n+""}}return i.gamma=e,i})(1);function Nae(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,i=t.slice(),n;return function(a){for(n=0;n<r;++n)i[n]=e[n]*(1-a)+t[n]*a;return i}}function Aae(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Cae(e,t){var r=t?t.length:0,i=e?Math.min(r,e.length):0,n=new Array(i),a=new Array(r),o;for(o=0;o<i;++o)n[o]=HP(e[o],t[o]);for(;o<r;++o)a[o]=t[o];return function(s){for(o=0;o<i;++o)a[o]=n[o](s);return a}}function Mae(e,t){var r=new Date;return e=+e,t=+t,function(i){return r.setTime(e*(1-i)+t*i),r}}function Sa(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Rae(e,t){var r={},i={},n;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(n in t)n in e?r[n]=HP(e[n],t[n]):i[n]=t[n];return function(a){for(n in r)i[n]=r[n](a);return i}}var WP=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qP=new RegExp(WP.source,"g");function kae(e){return function(){return e}}function Oae(e){return function(t){return e(t)+""}}function W$(e,t){var r=WP.lastIndex=qP.lastIndex=0,i,n,a,o=-1,s=[],c=[];for(e=e+"",t=t+"";(i=WP.exec(e))&&(n=qP.exec(t));)(a=n.index)>r&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(i=i[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,c.push({i:o,x:Sa(i,n)})),r=qP.lastIndex;return r<t.length&&(a=t.slice(r),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Oae(c[0].x):kae(t):(t=c.length,function(u){for(var l=0,d;l<t;++l)s[(d=c[l]).i]=d.x(u);return s.join("")})}function HP(e,t){var r=typeof t,i;return t==null||r==="boolean"?jP(t):(r==="number"?Sa:r==="string"?(i=au(t))?(t=i,vy):W$:t instanceof au?vy:t instanceof Date?Mae:Aae(t)?Nae:Array.isArray(t)?Cae:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Rae:Sa)(e,t)}function xae(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var q$=180/Math.PI,YP={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function H$(e,t,r,i,n,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*r+t*i)&&(r-=e*c,i-=t*c),(s=Math.sqrt(r*r+i*i))&&(r/=s,i/=s,c/=s),e*i<t*r&&(e=-e,t=-t,c=-c,o=-o),{translateX:n,translateY:a,rotate:Math.atan2(t,e)*q$,skewX:Math.atan(c)*q$,scaleX:o,scaleY:s}}var Sy;function Fae(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?YP:H$(t.a,t.b,t.c,t.d,t.e,t.f)}function _ae(e){return e==null||(Sy||(Sy=document.createElementNS("http://www.w3.org/2000/svg","g")),Sy.setAttribute("transform",e),!(e=Sy.transform.baseVal.consolidate()))?YP:(e=e.matrix,H$(e.a,e.b,e.c,e.d,e.e,e.f))}function Y$(e,t,r,i){function n(u){return u.length?u.pop()+" ":""}function a(u,l,d,p,f,m){if(u!==d||l!==p){var h=f.push("translate(",null,t,null,r);m.push({i:h-4,x:Sa(u,d)},{i:h-2,x:Sa(l,p)})}else(d||p)&&f.push("translate("+d+t+p+r)}function o(u,l,d,p){u!==l?(u-l>180?l+=360:l-u>180&&(u+=360),p.push({i:d.push(n(d)+"rotate(",null,i)-2,x:Sa(u,l)})):l&&d.push(n(d)+"rotate("+l+i)}function s(u,l,d,p){u!==l?p.push({i:d.push(n(d)+"skewX(",null,i)-2,x:Sa(u,l)}):l&&d.push(n(d)+"skewX("+l+i)}function c(u,l,d,p,f,m){if(u!==d||l!==p){var h=f.push(n(f)+"scale(",null,",",null,")");m.push({i:h-4,x:Sa(u,d)},{i:h-2,x:Sa(l,p)})}else(d!==1||p!==1)&&f.push(n(f)+"scale("+d+","+p+")")}return function(u,l){var d=[],p=[];return u=e(u),l=e(l),a(u.translateX,u.translateY,l.translateX,l.translateY,d,p),o(u.rotate,l.rotate,d,p),s(u.skewX,l.skewX,d,p),c(u.scaleX,u.scaleY,l.scaleX,l.scaleY,d,p),u=l=null,function(f){for(var m=-1,h=p.length,g;++m<h;)d[(g=p[m]).i]=g.x(f);return d.join("")}}}var Lae=Y$(Fae,"px, ","px)","deg)"),Bae=Y$(_ae,", ",")",")"),Xl=0,Zf=0,em=0,z$=1e3,by,tm,Ty=0,cu=0,wy=0,rm=typeof performance=="object"&&performance.now?performance:Date,K$=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zP(){return cu||(K$($ae),cu=rm.now()+wy)}function $ae(){cu=0}function Uy(){this._call=this._time=this._next=null}Uy.prototype=Q$.prototype={constructor:Uy,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?zP():+r)+(t==null?0:+t),!this._next&&tm!==this&&(tm?tm._next=this:by=this,tm=this),this._call=e,this._time=r,KP()},stop:function(){this._call&&(this._call=null,this._time=1/0,KP())}};function Q$(e,t,r){var i=new Uy;return i.restart(e,t,r),i}function Vae(){zP(),++Xl;for(var e=by,t;e;)(t=cu-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Xl}function X$(){cu=(Ty=rm.now())+wy,Xl=Zf=0;try{Vae()}finally{Xl=0,jae(),cu=0}}function Gae(){var e=rm.now(),t=e-Ty;t>z$&&(wy-=t,Ty=e)}function jae(){for(var e,t=by,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:by=r);tm=e,KP(i)}function KP(e){if(!Xl){Zf&&(Zf=clearTimeout(Zf));var t=e-cu;t>24?(e<1/0&&(Zf=setTimeout(X$,e-rm.now()-wy)),em&&(em=clearInterval(em))):(em||(Ty=rm.now(),em=setInterval(Gae,z$)),Xl=1,K$(X$))}}function J$(e,t,r){var i=new Uy;return t=t==null?0:+t,i.restart(n=>{i.stop(),e(n+t)},t,r),i}var Wae=y$("start","end","cancel","interrupt"),qae=[],Z$=0,eV=1,QP=2,Dy=3,tV=4,XP=5,Py=6;function Ey(e,t,r,i,n,a){var o=e.__transition;if(!o)e.__transition={};else if(r in o)return;Hae(e,r,{name:t,index:i,group:n,on:Wae,tween:qae,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Z$})}function JP(e,t){var r=ba(e,t);if(r.state>Z$)throw new Error("too late; already scheduled");return r}function Ja(e,t){var r=ba(e,t);if(r.state>Dy)throw new Error("too late; already running");return r}function ba(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Hae(e,t,r){var i=e.__transition,n;i[t]=r,r.timer=Q$(a,0,r.time);function a(u){r.state=eV,r.timer.restart(o,r.delay,r.time),r.delay<=u&&o(u-r.delay)}function o(u){var l,d,p,f;if(r.state!==eV)return c();for(l in i)if(f=i[l],f.name===r.name){if(f.state===Dy)return J$(o);f.state===tV?(f.state=Py,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[l]):+l<t&&(f.state=Py,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[l])}if(J$(function(){r.state===Dy&&(r.state=tV,r.timer.restart(s,r.delay,r.time),s(u))}),r.state=QP,r.on.call("start",e,e.__data__,r.index,r.group),r.state===QP){for(r.state=Dy,n=new Array(p=r.tween.length),l=0,d=-1;l<p;++l)(f=r.tween[l].value.call(e,e.__data__,r.index,r.group))&&(n[++d]=f);n.length=d+1}}function s(u){for(var l=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(c),r.state=XP,1),d=-1,p=n.length;++d<p;)n[d].call(e,l);r.state===XP&&(r.on.call("end",e,e.__data__,r.index,r.group),c())}function c(){r.state=Py,r.timer.stop(),delete i[t];for(var u in i)return;delete e.__transition}}function Yae(e,t){var r=e.__transition,i,n,a=!0,o;if(r){t=t==null?null:t+"";for(o in r){if((i=r[o]).name!==t){a=!1;continue}n=i.state>QP&&i.state<XP,i.state=Py,i.timer.stop(),i.on.call(n?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[o]}a&&delete e.__transition}}function zae(e){return this.each(function(){Yae(this,e)})}function Kae(e,t){var r,i;return function(){var n=Ja(this,e),a=n.tween;if(a!==r){i=r=a;for(var o=0,s=i.length;o<s;++o)if(i[o].name===t){i=i.slice(),i.splice(o,1);break}}n.tween=i}}function Qae(e,t,r){var i,n;if(typeof r!="function")throw new Error;return function(){var a=Ja(this,e),o=a.tween;if(o!==i){n=(i=o).slice();for(var s={name:t,value:r},c=0,u=n.length;c<u;++c)if(n[c].name===t){n[c]=s;break}c===u&&n.push(s)}a.tween=n}}function Xae(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=ba(this.node(),r).tween,n=0,a=i.length,o;n<a;++n)if((o=i[n]).name===e)return o.value;return null}return this.each((t==null?Kae:Qae)(r,e,t))}function ZP(e,t,r){var i=e._id;return e.each(function(){var n=Ja(this,i);(n.value||(n.value={}))[t]=r.apply(this,arguments)}),function(n){return ba(n,i).value[t]}}function rV(e,t){var r;return(typeof t=="number"?Sa:t instanceof au?vy:(r=au(t))?(t=r,vy):W$)(e,t)}function Jae(e){return function(){this.removeAttribute(e)}}function Zae(e){return function(){this.removeAttributeNS(e.space,e.local)}}function eoe(e,t,r){var i,n=r+"",a;return function(){var o=this.getAttribute(e);return o===n?null:o===i?a:a=t(i=o,r)}}function toe(e,t,r){var i,n=r+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===n?null:o===i?a:a=t(i=o,r)}}function roe(e,t,r){var i,n,a;return function(){var o,s=r(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+"",o===c?null:o===i&&c===n?a:(n=c,a=t(i=o,s)))}}function ioe(e,t,r){var i,n,a;return function(){var o,s=r(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+"",o===c?null:o===i&&c===n?a:(n=c,a=t(i=o,s)))}}function noe(e,t){var r=fy(e),i=r==="transform"?Bae:rV;return this.attrTween(e,typeof t=="function"?(r.local?ioe:roe)(r,i,ZP(this,"attr."+e,t)):t==null?(r.local?Zae:Jae)(r):(r.local?toe:eoe)(r,i,t))}function aoe(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function ooe(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function soe(e,t){var r,i;function n(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&ooe(e,a)),r}return n._value=t,n}function coe(e,t){var r,i;function n(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&aoe(e,a)),r}return n._value=t,n}function uoe(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=fy(e);return this.tween(r,(i.local?soe:coe)(i,t))}function loe(e,t){return function(){JP(this,e).delay=+t.apply(this,arguments)}}function doe(e,t){return t=+t,function(){JP(this,e).delay=t}}function poe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?loe:doe)(t,e)):ba(this.node(),t).delay}function foe(e,t){return function(){Ja(this,e).duration=+t.apply(this,arguments)}}function moe(e,t){return t=+t,function(){Ja(this,e).duration=t}}function hoe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?foe:moe)(t,e)):ba(this.node(),t).duration}function goe(e,t){if(typeof t!="function")throw new Error;return function(){Ja(this,e).ease=t}}function Ioe(e){var t=this._id;return arguments.length?this.each(goe(t,e)):ba(this.node(),t).ease}function yoe(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ja(this,e).ease=r}}function voe(e){if(typeof e!="function")throw new Error;return this.each(yoe(this._id,e))}function Soe(e){typeof e!="function"&&(e=w$(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var a=t[n],o=a.length,s=i[n]=[],c,u=0;u<o;++u)(c=a[u])&&e.call(c,c.__data__,u,a)&&s.push(c);return new Bo(i,this._parents,this._name,this._id)}function boe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,n=r.length,a=Math.min(i,n),o=new Array(i),s=0;s<a;++s)for(var c=t[s],u=r[s],l=c.length,d=o[s]=new Array(l),p,f=0;f<l;++f)(p=c[f]||u[f])&&(d[f]=p);for(;s<i;++s)o[s]=t[s];return new Bo(o,this._parents,this._name,this._id)}function Toe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function woe(e,t,r){var i,n,a=Toe(t)?JP:Ja;return function(){var o=a(this,e),s=o.on;s!==i&&(n=(i=s).copy()).on(t,r),o.on=n}}function Uoe(e,t){var r=this._id;return arguments.length<2?ba(this.node(),r).on.on(e):this.each(woe(r,e,t))}function Doe(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Poe(){return this.on("end.remove",Doe(this._id))}function Eoe(e){var t=this._name,r=this._id;typeof e!="function"&&(e=_P(e));for(var i=this._groups,n=i.length,a=new Array(n),o=0;o<n;++o)for(var s=i[o],c=s.length,u=a[o]=new Array(c),l,d,p=0;p<c;++p)(l=s[p])&&(d=e.call(l,l.__data__,p,s))&&("__data__"in l&&(d.__data__=l.__data__),u[p]=d,Ey(u[p],t,r,p,u,ba(l,r)));return new Bo(a,this._parents,t,r)}function Noe(e){var t=this._name,r=this._id;typeof e!="function"&&(e=T$(e));for(var i=this._groups,n=i.length,a=[],o=[],s=0;s<n;++s)for(var c=i[s],u=c.length,l,d=0;d<u;++d)if(l=c[d]){for(var p=e.call(l,l.__data__,d,c),f,m=ba(l,r),h=0,g=p.length;h<g;++h)(f=p[h])&&Ey(f,t,r,h,p,m);a.push(p),o.push(l)}return new Bo(a,o,t,r)}var Aoe=Kf.prototype.constructor;function Coe(){return new Aoe(this._groups,this._parents)}function Moe(e,t){var r,i,n;return function(){var a=Kl(this,e),o=(this.style.removeProperty(e),Kl(this,e));return a===o?null:a===r&&o===i?n:n=t(r=a,i=o)}}function iV(e){return function(){this.style.removeProperty(e)}}function Roe(e,t,r){var i,n=r+"",a;return function(){var o=Kl(this,e);return o===n?null:o===i?a:a=t(i=o,r)}}function koe(e,t,r){var i,n,a;return function(){var o=Kl(this,e),s=r(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),Kl(this,e))),o===c?null:o===i&&c===n?a:(n=c,a=t(i=o,s))}}function Ooe(e,t){var r,i,n,a="style."+t,o="end."+a,s;return function(){var c=Ja(this,e),u=c.on,l=c.value[a]==null?s||(s=iV(t)):void 0;(u!==r||n!==l)&&(i=(r=u).copy()).on(o,n=l),c.on=i}}function xoe(e,t,r){var i=(e+="")=="transform"?Lae:rV;return t==null?this.styleTween(e,Moe(e,i)).on("end.style."+e,iV(e)):typeof t=="function"?this.styleTween(e,koe(e,i,ZP(this,"style."+e,t))).each(Ooe(this._id,e)):this.styleTween(e,Roe(e,i,t),r).on("end.style."+e,null)}function Foe(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function _oe(e,t,r){var i,n;function a(){var o=t.apply(this,arguments);return o!==n&&(i=(n=o)&&Foe(e,o,r)),i}return a._value=t,a}function Loe(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,_oe(e,t,r??""))}function Boe(e){return function(){this.textContent=e}}function $oe(e){return function(){var t=e(this);this.textContent=t??""}}function Voe(e){return this.tween("text",typeof e=="function"?$oe(ZP(this,"text",e)):Boe(e==null?"":e+""))}function Goe(e){return function(t){this.textContent=e.call(this,t)}}function joe(e){var t,r;function i(){var n=e.apply(this,arguments);return n!==r&&(t=(r=n)&&Goe(n)),t}return i._value=e,i}function Woe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,joe(e))}function qoe(){for(var e=this._name,t=this._id,r=nV(),i=this._groups,n=i.length,a=0;a<n;++a)for(var o=i[a],s=o.length,c,u=0;u<s;++u)if(c=o[u]){var l=ba(c,t);Ey(c,e,r,u,o,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new Bo(i,this._parents,e,r)}function Hoe(){var e,t,r=this,i=r._id,n=r.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--n===0&&a()}};r.each(function(){var u=Ja(this,i),l=u.on;l!==e&&(t=(e=l).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),u.on=t}),n===0&&a()})}var Yoe=0;function Bo(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function nV(){return++Yoe}var $o=Kf.prototype;Bo.prototype={constructor:Bo,select:Eoe,selectAll:Noe,selectChild:$o.selectChild,selectChildren:$o.selectChildren,filter:Soe,merge:boe,selection:Coe,transition:qoe,call:$o.call,nodes:$o.nodes,node:$o.node,size:$o.size,empty:$o.empty,each:$o.each,on:Uoe,attr:noe,attrTween:uoe,style:xoe,styleTween:Loe,text:Voe,textTween:Woe,remove:Poe,tween:Xae,delay:poe,duration:hoe,ease:Ioe,easeVarying:voe,end:Hoe,[Symbol.iterator]:$o[Symbol.iterator]};function zoe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Koe={time:null,delay:0,duration:250,ease:zoe};function Qoe(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Xoe(e){var t,r;e instanceof Bo?(t=e._id,e=e._name):(t=nV(),(r=Koe).time=zP(),e=e==null?null:e+"");for(var i=this._groups,n=i.length,a=0;a<n;++a)for(var o=i[a],s=o.length,c,u=0;u<s;++u)(c=o[u])&&Ey(c,e,t,u,o,r||Qoe(c,t));return new Bo(i,this._parents,e,t)}Kf.prototype.interrupt=zae,Kf.prototype.transition=Xoe;const eE=Math.PI,tE=2*eE,uu=1e-6,Joe=tE-uu;function aV(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Zoe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return aV;const r=10**t;return function(i){this._+=i[0];for(let n=1,a=i.length;n<a;++n)this._+=Math.round(arguments[n]*r)/r+i[n]}}class ese{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?aV:Zoe(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,n){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+n}`}bezierCurveTo(t,r,i,n,a,o){this._append`C${+t},${+r},${+i},${+n},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,i,n,a){if(t=+t,r=+r,i=+i,n=+n,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,s=this._y1,c=i-t,u=n-r,l=o-t,d=s-r,p=l*l+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(p>uu)if(!(Math.abs(d*c-u*l)>uu)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let f=i-o,m=n-s,h=c*c+u*u,g=f*f+m*m,I=Math.sqrt(h),y=Math.sqrt(p),S=a*Math.tan((eE-Math.acos((h+p-g)/(2*I*y)))/2),v=S/y,b=S/I;Math.abs(v-1)>uu&&this._append`L${t+v*l},${r+v*d}`,this._append`A${a},${a},0,0,${+(d*f>l*m)},${this._x1=t+b*c},${this._y1=r+b*u}`}}arc(t,r,i,n,a,o){if(t=+t,r=+r,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let s=i*Math.cos(n),c=i*Math.sin(n),u=t+s,l=r+c,d=1^o,p=o?n-a:a-n;this._x1===null?this._append`M${u},${l}`:(Math.abs(this._x1-u)>uu||Math.abs(this._y1-l)>uu)&&this._append`L${u},${l}`,i&&(p<0&&(p=p%tE+tE),p>Joe?this._append`A${i},${i},0,1,${d},${t-s},${r-c}A${i},${i},0,1,${d},${this._x1=u},${this._y1=l}`:p>uu&&this._append`A${i},${i},0,${+(p>=eE)},${d},${this._x1=t+i*Math.cos(a)},${this._y1=r+i*Math.sin(a)}`)}rect(t,r,i,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+n}h${-i}Z`}toString(){return this._}}function tse(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ny(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),i=e.slice(0,r);return[i.length>1?i[0]+i.slice(2):i,+e.slice(r+1)]}function Jl(e){return e=Ny(Math.abs(e)),e?e[1]:NaN}function rse(e,t){return function(r,i){for(var n=r.length,a=[],o=0,s=e[0],c=0;n>0&&s>0&&(c+s+1>i&&(s=Math.max(1,i-c)),a.push(r.substring(n-=s,n+s)),!((c+=s+1)>i));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function ise(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var nse=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ay(e){if(!(t=nse.exec(e)))throw new Error("invalid format: "+e);var t;return new rE({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ay.prototype=rE.prototype;function rE(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}rE.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 ase(e){e:for(var t=e.length,r=1,i=-1,n;r<t;++r)switch(e[r]){case".":i=n=r;break;case"0":i===0&&(i=r),n=r;break;default:if(!+e[r])break e;i>0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(n+1):e}var Cy;function ose(e,t){var r=Ny(e,t);if(!r)return Cy=void 0,e.toPrecision(t);var i=r[0],n=r[1],a=n-(Cy=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,o=i.length;return a===o?i:a>o?i+new Array(a-o+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+Ny(e,Math.max(0,t+a-1))[0]}function oV(e,t){var r=Ny(e,t);if(!r)return e+"";var i=r[0],n=r[1];return n<0?"0."+new Array(-n).join("0")+i:i.length>n+1?i.slice(0,n+1)+"."+i.slice(n+1):i+new Array(n-i.length+2).join("0")}const sV={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:tse,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>oV(e*100,t),r:oV,s:ose,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cV(e){return e}var uV=Array.prototype.map,lV=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function sse(e){var t=e.grouping===void 0||e.thousands===void 0?cV:rse(uV.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",n=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?cV:ise(uV.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d,p){d=Ay(d);var f=d.fill,m=d.align,h=d.sign,g=d.symbol,I=d.zero,y=d.width,S=d.comma,v=d.precision,b=d.trim,T=d.type;T==="n"?(S=!0,T="g"):sV[T]||(v===void 0&&(v=12),b=!0,T="g"),(I||f==="0"&&m==="=")&&(I=!0,f="0",m="=");var w=(p&&p.prefix!==void 0?p.prefix:"")+(g==="$"?r:g==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),U=(g==="$"?i:/[%p]/.test(T)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),E=sV[T],D=/[defgprs%]/.test(T);v=v===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function P(N){var C=w,A=U,M,R,O;if(T==="c")A=E(N)+A,N="";else{N=+N;var k=N<0||1/N<0;if(N=isNaN(N)?c:E(Math.abs(N),v),b&&(N=ase(N)),k&&+N==0&&h!=="+"&&(k=!1),C=(k?h==="("?h:s:h==="-"||h==="("?"":h)+C,A=(T==="s"&&!isNaN(N)&&Cy!==void 0?lV[8+Cy/3]:"")+A+(k&&h==="("?")":""),D){for(M=-1,R=N.length;++M<R;)if(O=N.charCodeAt(M),48>O||O>57){A=(O===46?n+N.slice(M+1):N.slice(M))+A,N=N.slice(0,M);break}}}S&&!I&&(N=t(N,1/0));var _=C.length+N.length+A.length,x=_<y?new Array(y-_+1).join(f):"";switch(S&&I&&(N=t(x+N,x.length?y-A.length:1/0),x=""),m){case"<":N=C+N+A+x;break;case"=":N=C+x+N+A;break;case"^":N=x.slice(0,_=x.length>>1)+C+N+A+x.slice(_);break;default:N=x+C+N+A;break}return a(N)}return P.toString=function(){return d+""},P}function l(d,p){var f=Math.max(-8,Math.min(8,Math.floor(Jl(p)/3)))*3,m=Math.pow(10,-f),h=u((d=Ay(d),d.type="f",d),{suffix:lV[8+f/3]});return function(g){return h(m*g)}}return{format:u,formatPrefix:l}}var My,dV,pV;cse({thousands:",",grouping:[3],currency:["$",""]});function cse(e){return My=sse(e),dV=My.format,pV=My.formatPrefix,My}function use(e){return Math.max(0,-Jl(Math.abs(e)))}function lse(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jl(t)/3)))*3-Jl(Math.abs(e)))}function dse(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jl(t)-Jl(e))+1}function pse(e){var t=0,r=e.children,i=r&&r.length;if(!i)t=1;else for(;--i>=0;)t+=r[i].value;e.value=t}function fse(){return this.eachAfter(pse)}function mse(e,t){let r=-1;for(const i of this)e.call(t,i,++r,this);return this}function hse(e,t){for(var r=this,i=[r],n,a,o=-1;r=i.pop();)if(e.call(t,r,++o,this),n=r.children)for(a=n.length-1;a>=0;--a)i.push(n[a]);return this}function gse(e,t){for(var r=this,i=[r],n=[],a,o,s,c=-1;r=i.pop();)if(n.push(r),a=r.children)for(o=0,s=a.length;o<s;++o)i.push(a[o]);for(;r=n.pop();)e.call(t,r,++c,this);return this}function Ise(e,t){let r=-1;for(const i of this)if(e.call(t,i,++r,this))return i}function yse(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,i=t.children,n=i&&i.length;--n>=0;)r+=i[n].value;t.value=r})}function vse(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Sse(e){for(var t=this,r=bse(t,e),i=[t];t!==r;)t=t.parent,i.push(t);for(var n=i.length;e!==r;)i.splice(n,0,e),e=e.parent;return i}function bse(e,t){if(e===t)return e;var r=e.ancestors(),i=t.ancestors(),n=null;for(e=r.pop(),t=i.pop();e===t;)n=e,e=r.pop(),t=i.pop();return n}function Tse(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function wse(){return Array.from(this)}function Use(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Dse(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t}function*Pse(){var e=this,t,r=[e],i,n,a;do for(t=r.reverse(),r=[];e=t.pop();)if(yield e,i=e.children)for(n=0,a=i.length;n<a;++n)r.push(i[n]);while(r.length)}function iE(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ase)):t===void 0&&(t=Nse);for(var r=new Ry(e),i,n=[r],a,o,s,c;i=n.pop();)if((o=t(i.data))&&(c=(o=Array.from(o)).length))for(i.children=o,s=c-1;s>=0;--s)n.push(a=o[s]=new Ry(o[s])),a.parent=i,a.depth=i.depth+1;return r.eachBefore(Mse)}function Ese(){return iE(this).eachBefore(Cse)}function Nse(e){return e.children}function Ase(e){return Array.isArray(e)?e[1]:null}function Cse(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Mse(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ry(e){this.data=e,this.depth=this.height=0,this.parent=null}Ry.prototype=iE.prototype={constructor:Ry,count:fse,each:mse,eachAfter:gse,eachBefore:hse,find:Ise,sum:yse,sort:vse,path:Sse,ancestors:Tse,descendants:wse,leaves:Use,links:Dse,copy:Ese,[Symbol.iterator]:Pse};function Rse(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function kse(e,t,r,i,n){for(var a=e.children,o,s=-1,c=a.length,u=e.value&&(i-t)/e.value;++s<c;)o=a[s],o.y0=r,o.y1=n,o.x0=t,o.x1=t+=o.value*u}function Ose(){var e=1,t=1,r=0,i=!1;function n(o){var s=o.height+1;return o.x0=o.y0=r,o.x1=e,o.y1=t/s,o.eachBefore(a(t,s)),i&&o.eachBefore(Rse),o}function a(o,s){return function(c){c.children&&kse(c,c.x0,o*(c.depth+1)/s,c.x1,o*(c.depth+2)/s);var u=c.x0,l=c.y0,d=c.x1-r,p=c.y1-r;d<u&&(u=d=(u+d)/2),p<l&&(l=p=(l+p)/2),c.x0=u,c.y0=l,c.x1=d,c.y1=p}}return n.round=function(o){return arguments.length?(i=!!o,n):i},n.size=function(o){return arguments.length?(e=+o[0],t=+o[1],n):[e,t]},n.padding=function(o){return arguments.length?(r=+o,n):r},n}function xse(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Fse(e){return function(){return e}}function _se(e){return+e}var fV=[0,1];function Zl(e){return e}function nE(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Fse(isNaN(t)?NaN:.5)}function Lse(e,t){var r;return e>t&&(r=e,e=t,t=r),function(i){return Math.max(e,Math.min(t,i))}}function Bse(e,t,r){var i=e[0],n=e[1],a=t[0],o=t[1];return n<i?(i=nE(n,i),a=r(o,a)):(i=nE(i,n),a=r(a,o)),function(s){return a(i(s))}}function $se(e,t,r){var i=Math.min(e.length,t.length)-1,n=new Array(i),a=new Array(i),o=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<i;)n[o]=nE(e[o],e[o+1]),a[o]=r(t[o],t[o+1]);return function(s){var c=Pie(e,s,1,i)-1;return a[c](n[c](s))}}function Vse(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Gse(){var e=fV,t=fV,r=HP,i,n,a,o=Zl,s,c,u;function l(){var p=Math.min(e.length,t.length);return o!==Zl&&(o=Lse(e[0],e[p-1])),s=p>2?$se:Bse,c=u=null,d}function d(p){return p==null||isNaN(p=+p)?a:(c||(c=s(e.map(i),t,r)))(i(o(p)))}return d.invert=function(p){return o(n((u||(u=s(t,e.map(i),Sa)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,_se),l()):e.slice()},d.range=function(p){return arguments.length?(t=Array.from(p),l()):t.slice()},d.rangeRound=function(p){return t=Array.from(p),r=xae,l()},d.clamp=function(p){return arguments.length?(o=p?!0:Zl,l()):o!==Zl},d.interpolate=function(p){return arguments.length?(r=p,l()):r},d.unknown=function(p){return arguments.length?(a=p,d):a},function(p,f){return i=p,n=f,l()}}function jse(){return Gse()(Zl,Zl)}function Wse(e,t,r,i){var n=Mie(e,t,r),a;switch(i=Ay(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(a=lse(n,o))&&(i.precision=a),pV(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(a=dse(n,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=a-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(a=use(n))&&(i.precision=a-(i.type==="%")*2);break}}return dV(i)}function qse(e){var t=e.domain;return e.ticks=function(r){var i=t();return Cie(i[0],i[i.length-1],r??10)},e.tickFormat=function(r,i){var n=t();return Wse(n[0],n[n.length-1],r??10,i)},e.nice=function(r){r==null&&(r=10);var i=t(),n=0,a=i.length-1,o=i[n],s=i[a],c,u,l=10;for(s<o&&(u=o,o=s,s=u,u=n,n=a,a=u);l-- >0;){if(u=OP(o,s,r),u===c)return i[n]=o,i[a]=s,t(i);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;c=u}return e},e}function lu(){var e=jse();return e.copy=function(){return Vse(e,lu())},xse.apply(e,arguments),qse(e)}function ks(e){return function(){return e}}const mV=Math.abs,Ti=Math.atan2,du=Math.cos,Hse=Math.max,aE=Math.min,Za=Math.sin,ed=Math.sqrt,an=1e-12,im=Math.PI,ky=im/2,Yse=2*im;function zse(e){return e>1?0:e<-1?im:Math.acos(e)}function hV(e){return e>=1?ky:e<=-1?-ky:Math.asin(e)}function Kse(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new ese(t)}function Qse(e){return e.innerRadius}function Xse(e){return e.outerRadius}function Jse(e){return e.startAngle}function Zse(e){return e.endAngle}function ece(e){return e&&e.padAngle}function tce(e,t,r,i,n,a,o,s){var c=r-e,u=i-t,l=o-n,d=s-a,p=d*c-l*u;if(!(p*p<an))return p=(l*(t-a)-d*(e-n))/p,[e+p*c,t+p*u]}function Oy(e,t,r,i,n,a,o){var s=e-r,c=t-i,u=(o?a:-a)/ed(s*s+c*c),l=u*c,d=-u*s,p=e+l,f=t+d,m=r+l,h=i+d,g=(p+m)/2,I=(f+h)/2,y=m-p,S=h-f,v=y*y+S*S,b=n-a,T=p*h-m*f,w=(S<0?-1:1)*ed(Hse(0,b*b*v-T*T)),U=(T*S-y*w)/v,E=(-T*y-S*w)/v,D=(T*S+y*w)/v,P=(-T*y+S*w)/v,N=U-g,C=E-I,A=D-g,M=P-I;return N*N+C*C>A*A+M*M&&(U=D,E=P),{cx:U,cy:E,x01:-l,y01:-d,x11:U*(n/b-1),y11:E*(n/b-1)}}function rce(){var e=Qse,t=Xse,r=ks(0),i=null,n=Jse,a=Zse,o=ece,s=null,c=Kse(u);function u(){var l,d,p=+e.apply(this,arguments),f=+t.apply(this,arguments),m=n.apply(this,arguments)-ky,h=a.apply(this,arguments)-ky,g=mV(h-m),I=h>m;if(s||(s=l=c()),f<p&&(d=f,f=p,p=d),!(f>an))s.moveTo(0,0);else if(g>Yse-an)s.moveTo(f*du(m),f*Za(m)),s.arc(0,0,f,m,h,!I),p>an&&(s.moveTo(p*du(h),p*Za(h)),s.arc(0,0,p,h,m,I));else{var y=m,S=h,v=m,b=h,T=g,w=g,U=o.apply(this,arguments)/2,E=U>an&&(i?+i.apply(this,arguments):ed(p*p+f*f)),D=aE(mV(f-p)/2,+r.apply(this,arguments)),P=D,N=D,C,A;if(E>an){var M=hV(E/p*Za(U)),R=hV(E/f*Za(U));(T-=M*2)>an?(M*=I?1:-1,v+=M,b-=M):(T=0,v=b=(m+h)/2),(w-=R*2)>an?(R*=I?1:-1,y+=R,S-=R):(w=0,y=S=(m+h)/2)}var O=f*du(y),k=f*Za(y),_=p*du(b),x=p*Za(b);if(D>an){var F=f*du(S),B=f*Za(S),W=p*du(v),V=p*Za(v),H;if(g<im)if(H=tce(O,k,W,V,F,B,_,x)){var j=O-H[0],G=k-H[1],q=F-H[0],Y=B-H[1],z=1/Za(zse((j*q+G*Y)/(ed(j*j+G*G)*ed(q*q+Y*Y)))/2),X=ed(H[0]*H[0]+H[1]*H[1]);P=aE(D,(p-X)/(z-1)),N=aE(D,(f-X)/(z+1))}else P=N=0}w>an?N>an?(C=Oy(W,V,O,k,f,N,I),A=Oy(F,B,_,x,f,N,I),s.moveTo(C.cx+C.x01,C.cy+C.y01),N<D?s.arc(C.cx,C.cy,N,Ti(C.y01,C.x01),Ti(A.y01,A.x01),!I):(s.arc(C.cx,C.cy,N,Ti(C.y01,C.x01),Ti(C.y11,C.x11),!I),s.arc(0,0,f,Ti(C.cy+C.y11,C.cx+C.x11),Ti(A.cy+A.y11,A.cx+A.x11),!I),s.arc(A.cx,A.cy,N,Ti(A.y11,A.x11),Ti(A.y01,A.x01),!I))):(s.moveTo(O,k),s.arc(0,0,f,y,S,!I)):s.moveTo(O,k),!(p>an)||!(T>an)?s.lineTo(_,x):P>an?(C=Oy(_,x,F,B,p,-P,I),A=Oy(O,k,W,V,p,-P,I),s.lineTo(C.cx+C.x01,C.cy+C.y01),P<D?s.arc(C.cx,C.cy,P,Ti(C.y01,C.x01),Ti(A.y01,A.x01),!I):(s.arc(C.cx,C.cy,P,Ti(C.y01,C.x01),Ti(C.y11,C.x11),!I),s.arc(0,0,p,Ti(C.cy+C.y11,C.cx+C.x11),Ti(A.cy+A.y11,A.cx+A.x11),I),s.arc(A.cx,A.cy,P,Ti(A.y11,A.x11),Ti(A.y01,A.x01),!I))):s.arc(0,0,p,b,v,I)}if(s.closePath(),l)return s=null,l+""||null}return u.centroid=function(){var l=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+n.apply(this,arguments)+ +a.apply(this,arguments))/2-im/2;return[du(d)*l,Za(d)*l]},u.innerRadius=function(l){return arguments.length?(e=typeof l=="function"?l:ks(+l),u):e},u.outerRadius=function(l){return arguments.length?(t=typeof l=="function"?l:ks(+l),u):t},u.cornerRadius=function(l){return arguments.length?(r=typeof l=="function"?l:ks(+l),u):r},u.padRadius=function(l){return arguments.length?(i=l==null?null:typeof l=="function"?l:ks(+l),u):i},u.startAngle=function(l){return arguments.length?(n=typeof l=="function"?l:ks(+l),u):n},u.endAngle=function(l){return arguments.length?(a=typeof l=="function"?l:ks(+l),u):a},u.padAngle=function(l){return arguments.length?(o=typeof l=="function"?l:ks(+l),u):o},u.context=function(l){return arguments.length?(s=l??null,u):s},u}function nm(e,t,r){this.k=e,this.x=t,this.y=r}nm.prototype={constructor:nm,scale:function(e){return e===1?this:new nm(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new nm(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},nm.prototype;function ice(e,t=15){const r=e.split(" "),i=[];let n=[],a=0;return r.forEach(o=>{a+o.length>t?(n.length&&i.push(n.join(" ")),n=[o],a=o.length):(n.push(o),a+=o.length+(n.length>0?1:0))}),n.length&&i.push(n.join(" ")),i}const xy="text-anchor",Fy="dominant-baseline",Os="fill-opacity",nce=Object.assign({},...Ns.countries.filter(e=>e.ioc).map(e=>({[e.ioc]:e.iso2})),...Ns.countries.filter(e=>e.iso).map(e=>({[e.iso]:e.iso2})));function oE(e){const t=Math.floor(e.length/2),r=e.slice(0,t),i=e.slice(t).reverse();return[...r,...i]}function gV(e){if(e)switch(e){case"WILDCARD":return"WC";case"QUALIFIER":return"Q";case"LUCKY_LOSER":return"LL";default:return e}}function ace(e,t){const r=[];for(const i of e)for(const n of i.sides){const a=i.matchUpStatus==="BYE"&&!n.participantName;r.push({name:n.participantName||(a?"BYE":""),participantName:n.participantName||(a?"BYE":void 0),drawPosition:n.drawPosition,seedNumber:n.seedNumber,entryStatus:gV(n.entryStatus),nationalityCode:n.nationalityCode,matchUp:i,depth:t,value:1})}return r}function oce(e,t){let r=e.winningSide!==void 0&&e.winningSide!==null?e.sides.find(a=>a.sideNumber===e.winningSide):void 0;!r&&e.matchUpStatus==="BYE"&&(r=e.sides.find(a=>a.participantName));const i=r?.participantName,n=i?t.get(i):void 0;return{winnerName:i,winnerSide:r,winnerLookup:n}}function IV(e,t,r,i){return e.map((n,a)=>{const o=a*2,s=[t[o],t[o+1]].filter(Boolean),{winnerName:c,winnerSide:u,winnerLookup:l}=oce(n,i);return{name:c||"",participantName:c,drawPosition:l?.drawPosition??u?.drawPosition,seedNumber:u?.seedNumber??l?.seedNumber,entryStatus:gV(u?.entryStatus)??l?.entryStatus,nationalityCode:u?.nationalityCode??l?.nationalityCode,scoreString:n.scoreString,matchUpStatus:n.matchUpStatus,matchUp:n,depth:r,children:s.length>0?s:void 0}})}function sce(e){const{roundMatchUps:t}=e,r=Object.keys(t).map(Number).sort((u,l)=>u-l);if(r.length===0)throw new Error("No round data found in draw");const i=t[r[0]],n=ace(i,r.length),a=oE(n),o=new Map;for(const u of a)u.participantName&&u.participantName!=="BYE"&&o.set(u.participantName,u);const s=oE(i);let c=IV(s,a,r.length-1,o);for(let u=1;u<r.length;u++){const l=oE(t[r[u]]);c=IV(l,c,r.length-1-u,o)}return c.length===1?c[0]:{name:"Tournament",depth:0,children:c}}function yV(e,t){if(!e)return;const{seedNumber:r,entryStatus:i,drawPosition:n,participantName:a}=e;let o;if(a?.trim().toUpperCase()==="BYE")o="#B0BEC5";else if(r){const s=Number(r),c=lu().domain([1,32]).range(["0","1"]);o=lu().domain(xP(0,1,1/7)).range(["#81D4FA","#42A5F5","#1E88E5","#1565C0","#5C6BC0","#673AB7","#9C27B0"])(Number(c(s)))}else if(i?.toUpperCase()==="WC")o="red";else if(i&&(i==="Q"||i==="LL"))o=lu().domain(xP(0,1,.3333333333333333)).range(["#FFF176","#FBC02D","#FF9800"])(t(n));else{const s=["#C8E6C9","#81C784","#66BB6A","#4CAF50","#43A047","#388E3C","#2E7D32","#1B5E20","#A5D6A7","#90CAF9","#64B5F6","#42A5F5","#2196F3","#1E88E5","#1976D2","#1565C0"];o=lu().domain(xP(0,1,1/s.length)).range(s)(t(n))}e.color=o,e.children&&e.children.forEach(s=>{s.participantName===e.participantName&&(s.color=o),yV(s,t)})}function cce(e,t){const r=[];return e.seedNumber?r.push(`Seed ${e.seedNumber}`):e.entryStatus&&r.push(e.entryStatus),t===7&&e.drawPosition&&r.push(`Draw ${e.drawPosition}`),r.length>0?r.join(" • "):void 0}function uce(e,t){const r=e.find(i=>i.data.participantName&&i.data.participantName!==t);return r?.data.participantName?r.data:void 0}function lce(e,t){const r=[e.participantName];let i;if(t.children&&t.children.length>0)e.scoreString&&r.push(e.scoreString),i=uce(t.children,e.participantName),i&&r.push(i.participantName);else{const a=cce(e,t.depth);a&&r.push(a)}return{messageLines:r,opponentData:i}}function dce(e,t){return-(e*t/2)+t/2}function pce(e,t,r){const i=BP(e).append("svg").attr("width",t).attr("height",r).style("display","block"),n=i.append("g").attr("transform",`translate(${t/2}, ${r/2})`),a=n.append("g").attr("class","flags-group"),o=n.append("g").attr("class","winning-flags-group"),s=n.append("g").attr("class","losing-flags-group");return{svg:i,g:n,flagsGroup:a,winningFlagsGroup:o,losingFlagsGroup:s}}function fce(e,t,r,i,n){const a=e.append("text").attr("x",t/2).attr("y",r/2).attr(xy,"middle").attr(Fy,"middle").attr("font-size",`${i}px`).attr("font-weight","bold").style("fill","var(--chc-text-primary, #333)").attr("pointer-events","none"),o=i+n*.5,s=e.append("text").attr("x",t/2).attr("y",r/2+o).attr(xy,"middle").attr(Fy,"middle").attr("font-size",`${n}px`).style("fill","var(--chc-text-secondary, #666)").attr("pointer-events","none");return{centerText:a,centerText2:s}}function vV(e,t,r,i,n,a,o){r&&(n?(t.flagsGroup.selectAll("text").remove(),t.winningFlagsGroup.selectAll("text").remove(),t.losingFlagsGroup.selectAll("text").remove()):e.selectAll("text").remove(),e.append("text").attr("font-size",`${o}px`).attr(xy,"middle").attr(Fy,"middle").attr("transform",`translate(0, ${i*a})`).text(SV(r)))}function mce(e,t,r,i={}){const n=i.width||800,a=i.height||800,o=Math.min(n,a)/800*(i.textScaleFactor??1),s=28*o,c=24*o,u=30*o,l=r||i.title||"Tournament",d=Object.assign({},...Ns.countries.filter(j=>j.label).map(j=>({[j.ioc]:j.label}))),p=sce(t),f=iE(p,j=>j.children).sum(j=>j.value||0),m=Math.min(n,a)/2,h=m/2,g=j=>j*m/200;Ose().size([2*Math.PI,m-h])(f);const I=lu().domain([0,t.drawSize||128]).range([0,1]);yV(p,I);const y=f.descendants(),S=rce().startAngle(j=>j.x0).endAngle(j=>j.x1).innerRadius(j=>j.y0+h).outerRadius(j=>j.y1+h),{svg:v,g:b,flagsGroup:T,winningFlagsGroup:w,losingFlagsGroup:U}=pce(e,n,a),E=new Set,D=j=>{j.nationalityCode&&E.add(j.nationalityCode),j.children&&j.children.forEach(D)};D(p);const P=Array.from(E),{centerText:N,centerText2:C}=fce(v,n,a,s,c);function A(){const j=ice(l,15);N.text(""),N.selectAll("tspan").remove(),C.text(""),C.selectAll("tspan").remove(),N.selectAll("tspan").data(j).join("tspan").attr("x",n/2).attr("dy",(z,X)=>X===0?0:u).text(z=>z);const Y=-(j.length*u/2)+u/2;N.attr("y",a/2+Y),N.style("display","block"),C.style("display","none")}function M(){if(T.selectAll("text").remove(),w.selectAll("text").remove(),U.selectAll("text").remove(),P.length===0)return;const j=lu().domain([0,P.length]).range([0,Math.PI*2]),G=g(20),q=h-G+10;T.selectAll("text").data(P).join("text").attr("font-size",`${G}px`).attr(xy,"middle").attr(Fy,"middle").attr("transform",(Y,z)=>{const X=j(z),Q=Math.cos(X)*q,J=Math.sin(X)*q;return`translate(${Q}, ${J})`}).text(Y=>SV(Y)).style("cursor","pointer").on("mouseover",function(Y,z){const X=d[z]||z;N.selectAll("tspan").remove(),N.attr("y",a/2),N.text(X).style("display","block"),C.selectAll("tspan").remove(),C.text("").style("display","none"),O||b.selectAll("path").attr(Os,Q=>Q.data.nationalityCode===z?.9:.3)}).on("mouseout",function(){O||b.selectAll("path").attr(Os,.8),A()})}M(),A();const R=i.eventHandlers?.clickCenter;R&&b.insert("circle",":first-child").attr("r",h).attr("fill","transparent").style("cursor","pointer").on("click",R);let O=!1,k;function _(j,G){const q=G.data;if(q.participantName){const{messageLines:J,opponentData:Z}=lce(q,G);Z&&(q.opponent=Z),N.selectAll("tspan").remove(),N.text(""),N.selectAll("tspan").data(J).join("tspan").attr("x",n/2).attr("dy",(ee,ae)=>ae===0?0:u).text(ee=>ee);const re=dce(J.length,u);N.attr("y",a/2+re),N.style("display","block"),C.style("display","none")}O?q.participantName?.toLowerCase()===k?.toLowerCase()||BP(j.currentTarget).attr(Os,.9):b.selectAll("path").attr(Os,J=>J.data.participantName===G.data.participantName?.9:.3);const z=g(30),X=h-z-10,Q={flagsGroup:T,winningFlagsGroup:w,losingFlagsGroup:U};vV(w,Q,q.nationalityCode,-1,!0,X,z),q.opponent&&vV(U,Q,q.opponent.nationalityCode,1,!1,X,z)}function x(j,G){if(O){const q=G.data.participantName?.toLowerCase()===k?.toLowerCase();BP(j.currentTarget).attr(Os,q?1:.2)}else b.selectAll("path").attr(Os,.8);M(),A()}const F=i.eventHandlers?.clickSegment;function B(j,G){if(!F)return;const q=G.data;F({participantName:q.participantName,drawPosition:q.drawPosition,seedNumber:q.seedNumber,entryStatus:q.entryStatus,nationalityCode:q.nationalityCode,scoreString:q.scoreString,matchUpStatus:q.matchUpStatus,roundName:q.roundName,depth:q.depth,matchUp:q.matchUp})}const W=b.selectAll("path").data(y).join("path").attr("d",j=>S(j)).attr("fill",j=>j.data.color||"#ccc").attr(Os,.8).attr("stroke","#fff").attr("stroke-width",1).on("mouseover",_).on("mouseout",x);F&&W.style("cursor","pointer").on("click",B),W.append("title").text(j=>{const G=j.data;return G.participantName?`${G.participantName}
|
|
194
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=n.reduce(function(c,u){var l=u&&lie(u,i);return l&&c.push(l),c},[]);return Hf(e)?s[0]:s}nu.defaultProps=yn,nu.setDefaultProps=oie,nu.currentInput=Qa,Object.assign({},k2,{effect:function(t){var r=t.state,i={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,i.popper),r.styles=i,r.elements.arrow&&Object.assign(r.elements.arrow.style,i.arrow)}}),nu.setDefaultProps({render:h$});function kP(e){return typeof e=="function"}let Rs;function zf(e){Rs&&(Rs?.destroy(!0),Rs=void 0),e?.remove&&e.remove()}function die(e){const{title:t,options:r,menuItems:i=[],coords:n,callback:a,config:o}=e;let{target:s,items:c}=e;if(!r?.length&&!c?.length&&!i)return;zf();const u=document.createElement("div");let l;const d=()=>{c=c?.filter(m=>!m.hide&&!m.disabled).map(m=>({...m,onClick:()=>{zf(u),kP(m.onClick)&&m.onClick()}}))||r?.filter(m=>!m.hide&&!m.disabled).map(m=>({text:typeof m=="object"?m.option:m,style:m.style,onClick:()=>{m.subMenu?Rs.setContent("IMPLEMENT SUB MENU"):kP(m.onClick)?(zf(u),m.onClick()):kP(a)&&a&&(zf(u),a(typeof m=="object"?{...m,coords:n}:m))}}));const p=[{text:t,items:c},...i];return l=A2(u,p).focusElement,u};return s=s||n?.evt?.target,s&&(Rs=nu(s,{content:d,theme:"light-border",trigger:"click",onShown:()=>{l&&setTimeout(()=>l?.focus(),0)},...o}),Rs.show(),Rs.setProps({interactive:!0})),Rs}function pie(){return"0.9.28-beta.5"}const fie={SET3_S6_TB7:"SET3-S:6/TB7",SET3_S6_TB7_F_TB10:"SET3-S:6/TB7-F:TB10",SET3_S6_TB10:"SET3-S:6/TB10",SET3_S6_F_TB10:"SET3-S:6-F:TB10",SET3_S6_TB7_NOAD:"SET3-S:6/TB7NOAD",SET3_S8_TB7:"SET3-S:8/TB7",SET3_S8_TB7_AT7:"SET3-S:8/TB7@7",SET3_S4_TB7:"SET3-S:4/TB7",SET3_S4_TB7_F_TB10:"SET3-S:4/TB7-F:TB10",SET3_S4_TB5_AT3_F_TB10:"SET3-S:4/TB5@3-F:TB10",SET5_S6_TB7:"SET5-S:6/TB7",SET5_S6_TB7_F_TB10:"SET5-S:6/TB7-F:TB10",SET1_S6_TB7:"SET1-S:6/TB7",SET1_S6_TB10:"SET1-S:6/TB10",SET1_S6_TB7_AT5:"SET1-S:6/TB7@5",SET1_S8_TB7:"SET1-S:8/TB7",SET1_S4_TB7:"SET1-S:4/TB7",SET1_S5_TB9_AT4:"SET1-S:5/TB9@4",SET1_S_TB7:"SET1-S:T7",SET1_S_TB10:"SET1-S:TB10",SET1_S_TB21:"SET1-S:T21",SET1_S8:"SET1-S:8",SET1_S10:"SET1-S:10",FAST4:"SET5-S:4/NOAD",SET3X_T10A_TB1:"SET3XA-S:T10-F:TB1",SET3X_T10A_TB1_NOAD:"SET3XA-S:T10-F:TB1NOAD",SET4X_T10A_TB1:"SET4XA-S:T10-F:TB1"};function mie(e,t,r){if(!e)return{elements:{}};const i={};for(const n of t||[]){if(!n?.label||n.hide)continue;const a=document.createElement("button");n.id&&(i[n.id]=a,a.id=n.id),a.style.marginRight=".5em",a.className="button font-medium",n.intent&&a.classList.add(n.intent),a.innerHTML=n.label,n.disabled&&(a.disabled=!0),a.onclick=o=>{o.stopPropagation(),!o.target.disabled&&Xt(n.onClick)&&n.onClick(),r&&Xt(r)&&r()},e.appendChild(a)}return{elements:i}}const hie=(e,t)=>r=>r?.trim().length>=e&&(!t||r?.trim().length<=t);function g$(e){return gf.isConvertableInteger(e)&&parseInt(e.toString())>=0}const gie=(e,t)=>r=>g$(r)&&Number(r)>=e&&Number(r)<=t,Iie=e=>/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?\d)(?=.*?[#?!@$%^&*-]).{8,12}$/.test(e);function yie(e){return gf.dateTime.dateValidation.test(e)}const vie=(e,t)=>r=>{const i=(r||"").trim().split(" ").length;return i>=e&&(!t||i<=t)},Sie=/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,bie=Object.freeze(Object.defineProperty({__proto__:null,dateValidator:yie,emailValidator:e=>Sie.exec(e),nameValidator:hie,numericRange:gie,numericValidator:g$,passwordValidator:Iie,wordValidator:vie},Symbol.toStringTag,{value:"Module"}));class Tie{constructor({tournamentRecord:t,drawId:r,structureId:i,eventId:n}){this.tournamentRecord=t,this.drawId=r,this.structureId=i,this.eventId=n||t.events?.[0]?.eventId,Ur.setState(t)}setRenderCallback(t){this.renderCallback=t}getAllParticipants(){Ur.setState(this.tournamentRecord);const{participants:t=[]}=Ur.getParticipants()||{};return t.map(r=>({participantId:r.participantId,participantName:r.participantName,participantType:r.participantType,person:r.person,individualParticipants:r.individualParticipants}))}getAvailableParticipants(){Ur.setState(this.tournamentRecord);const t=this.getAllParticipants(),{assignedParticipantIds:r=[]}=Ur.getAssignedParticipantIds({drawId:this.drawId})||{};return t.filter(i=>!r.includes(i.participantId))}removeAssignment({drawPosition:t}){Ur.setState(this.tournamentRecord);const a=this.getMatchUps().find(c=>c.sides?.some(u=>u.drawPosition===t))?.sides?.find(c=>c.drawPosition===t)?.bye===!0,o=Ur.removeDrawPositionAssignment({drawId:this.drawId,structureId:this.structureId,drawPosition:t});if(o.error)return{success:!1,error:o.error};const{tournamentRecord:s}=Ur.getState()||{};return this.tournamentRecord=s,a&&this.renderCallback&&this.renderCallback(),{success:!0}}assignParticipant({drawPosition:t,participantId:r}){Ur.setState(this.tournamentRecord);const i=Ur.assignDrawPosition({drawId:this.drawId,structureId:this.structureId,drawPosition:t,participantId:r});if(i.error)return{success:!1,error:i.error};const{tournamentRecord:n}=Ur.getState()||{};return this.tournamentRecord=n,this.focusDrawPosition=t+1,this.renderCallback&&this.renderCallback(),{success:!0}}getAndClearFocusDrawPosition(){const t=this.focusDrawPosition;return this.focusDrawPosition=void 0,t}assignBye({drawPosition:t}){Ur.setState(this.tournamentRecord);const r=Ur.assignDrawPositionBye({drawId:this.drawId,structureId:this.structureId,drawPosition:t});if(r.error)return{success:!1,error:r.error};const{tournamentRecord:i}=Ur.getState()||{};return this.tournamentRecord=i,this.focusDrawPosition=t+1,this.renderCallback&&this.renderCallback(),{success:!0}}assignQualifier({drawPosition:t}){Ur.setState(this.tournamentRecord);const r=Ur.assignDrawPosition({drawId:this.drawId,structureId:this.structureId,drawPosition:t,qualifier:!0});if(r.error)return{success:!1,error:r.error};const{tournamentRecord:i}=Ur.getState()||{};return this.tournamentRecord=i,this.focusDrawPosition=t+1,this.renderCallback&&this.renderCallback(),{success:!0}}getMatchUps(){Ur.setState(this.tournamentRecord);const{eventData:t}=Ur.getEventData({eventId:this.eventId})||{},n=t?.drawsData?.find(o=>o.drawId===this.drawId)?.structures?.find(o=>o.structureId===this.structureId)?.roundMatchUps;return n?Object.values(n).flat():[]}getState(){return this.tournamentRecord}getContext(){return{drawId:this.drawId,structureId:this.structureId}}}function ly(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function wie(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function I$(e){let t,r,i;e.length!==2?(t=ly,r=(s,c)=>ly(e(s),c),i=(s,c)=>e(s)-c):(t=e===ly||e===wie?e:Uie,r=e,i=e);function n(s,c,u=0,l=s.length){if(u<l){if(t(c,c)!==0)return l;do{const d=u+l>>>1;r(s[d],c)<0?u=d+1:l=d}while(u<l)}return u}function a(s,c,u=0,l=s.length){if(u<l){if(t(c,c)!==0)return l;do{const d=u+l>>>1;r(s[d],c)<=0?u=d+1:l=d}while(u<l)}return u}function o(s,c,u=0,l=s.length){const d=n(s,c,u,l-1);return d>u&&i(s[d-1],c)>-i(s[d],c)?d-1:d}return{left:n,center:o,right:a}}function Uie(){return 0}function Die(e){return e===null?NaN:+e}const Pie=I$(ly).right;I$(Die).center;const Eie=Math.sqrt(50),Nie=Math.sqrt(10),Aie=Math.sqrt(2);function dy(e,t,r){const i=(t-e)/Math.max(0,r),n=Math.floor(Math.log10(i)),a=i/Math.pow(10,n),o=a>=Eie?10:a>=Nie?5:a>=Aie?2:1;let s,c,u;return n<0?(u=Math.pow(10,-n)/o,s=Math.round(e*u),c=Math.round(t*u),s/u<e&&++s,c/u>t&&--c,u=-u):(u=Math.pow(10,n)*o,s=Math.round(e/u),c=Math.round(t/u),s*u<e&&++s,c*u>t&&--c),c<s&&.5<=r&&r<2?dy(e,t,r*2):[s,c,u]}function Cie(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const i=t<e,[n,a,o]=i?dy(t,e,r):dy(e,t,r);if(!(a>=n))return[];const s=a-n+1,c=new Array(s);if(i)if(o<0)for(let u=0;u<s;++u)c[u]=(a-u)/-o;else for(let u=0;u<s;++u)c[u]=(a-u)*o;else if(o<0)for(let u=0;u<s;++u)c[u]=(n+u)/-o;else for(let u=0;u<s;++u)c[u]=(n+u)*o;return c}function OP(e,t,r){return t=+t,e=+e,r=+r,dy(e,t,r)[2]}function Mie(e,t,r){t=+t,e=+e,r=+r;const i=t<e,n=i?OP(t,e,r):OP(e,t,r);return(i?-1:1)*(n<0?1/-n:n)}function xP(e,t,r){e=+e,t=+t,r=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+r;for(var i=-1,n=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(n);++i<n;)a[i]=e+i*r;return a}var Rie={value:()=>{}};function y$(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new py(r)}function py(e){this._=e}function kie(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",n=r.indexOf(".");if(n>=0&&(i=r.slice(n+1),r=r.slice(0,n)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}py.prototype=y$.prototype={constructor:py,on:function(e,t){var r=this._,i=kie(e+"",r),n,a=-1,o=i.length;if(arguments.length<2){for(;++a<o;)if((n=(e=i[a]).type)&&(n=Oie(r[n],e.name)))return n;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(n=(e=i[a]).type)r[n]=v$(r[n],e.name,t);else if(t==null)for(n in r)r[n]=v$(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new py(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var r=new Array(n),i=0,n,a;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],i=0,n=a.length;i<n;++i)a[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],n=0,a=i.length;n<a;++n)i[n].value.apply(t,r)}};function Oie(e,t){for(var r=0,i=e.length,n;r<i;++r)if((n=e[r]).name===t)return n.value}function v$(e,t,r){for(var i=0,n=e.length;i<n;++i)if(e[i].name===t){e[i]=Rie,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var FP="http://www.w3.org/1999/xhtml";const S$={svg:"http://www.w3.org/2000/svg",xhtml:FP,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fy(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),S$.hasOwnProperty(t)?{space:S$[t],local:e}:e}function xie(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===FP&&t.documentElement.namespaceURI===FP?t.createElement(e):t.createElementNS(r,e)}}function Fie(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function b$(e){var t=fy(e);return(t.local?Fie:xie)(t)}function _ie(){}function _P(e){return e==null?_ie:function(){return this.querySelector(e)}}function Lie(e){typeof e!="function"&&(e=_P(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var a=t[n],o=a.length,s=i[n]=new Array(o),c,u,l=0;l<o;++l)(c=a[l])&&(u=e.call(c,c.__data__,l,a))&&("__data__"in c&&(u.__data__=c.__data__),s[l]=u);return new vn(i,this._parents)}function Bie(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function $ie(){return[]}function T$(e){return e==null?$ie:function(){return this.querySelectorAll(e)}}function Vie(e){return function(){return Bie(e.apply(this,arguments))}}function Gie(e){typeof e=="function"?e=Vie(e):e=T$(e);for(var t=this._groups,r=t.length,i=[],n=[],a=0;a<r;++a)for(var o=t[a],s=o.length,c,u=0;u<s;++u)(c=o[u])&&(i.push(e.call(c,c.__data__,u,o)),n.push(c));return new vn(i,n)}function w$(e){return function(){return this.matches(e)}}function U$(e){return function(t){return t.matches(e)}}var jie=Array.prototype.find;function Wie(e){return function(){return jie.call(this.children,e)}}function qie(){return this.firstElementChild}function Hie(e){return this.select(e==null?qie:Wie(typeof e=="function"?e:U$(e)))}var Yie=Array.prototype.filter;function zie(){return Array.from(this.children)}function Kie(e){return function(){return Yie.call(this.children,e)}}function Qie(e){return this.selectAll(e==null?zie:Kie(typeof e=="function"?e:U$(e)))}function Xie(e){typeof e!="function"&&(e=w$(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var a=t[n],o=a.length,s=i[n]=[],c,u=0;u<o;++u)(c=a[u])&&e.call(c,c.__data__,u,a)&&s.push(c);return new vn(i,this._parents)}function D$(e){return new Array(e.length)}function Jie(){return new vn(this._enter||this._groups.map(D$),this._parents)}function my(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}my.prototype={constructor:my,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Zie(e){return function(){return e}}function ene(e,t,r,i,n,a){for(var o=0,s,c=t.length,u=a.length;o<u;++o)(s=t[o])?(s.__data__=a[o],i[o]=s):r[o]=new my(e,a[o]);for(;o<c;++o)(s=t[o])&&(n[o]=s)}function tne(e,t,r,i,n,a,o){var s,c,u=new Map,l=t.length,d=a.length,p=new Array(l),f;for(s=0;s<l;++s)(c=t[s])&&(p[s]=f=o.call(c,c.__data__,s,t)+"",u.has(f)?n[s]=c:u.set(f,c));for(s=0;s<d;++s)f=o.call(e,a[s],s,a)+"",(c=u.get(f))?(i[s]=c,c.__data__=a[s],u.delete(f)):r[s]=new my(e,a[s]);for(s=0;s<l;++s)(c=t[s])&&u.get(p[s])===c&&(n[s]=c)}function rne(e){return e.__data__}function ine(e,t){if(!arguments.length)return Array.from(this,rne);var r=t?tne:ene,i=this._parents,n=this._groups;typeof e!="function"&&(e=Zie(e));for(var a=n.length,o=new Array(a),s=new Array(a),c=new Array(a),u=0;u<a;++u){var l=i[u],d=n[u],p=d.length,f=nne(e.call(l,l&&l.__data__,u,i)),m=f.length,h=s[u]=new Array(m),g=o[u]=new Array(m),I=c[u]=new Array(p);r(l,d,h,g,I,f,t);for(var y=0,S=0,v,b;y<m;++y)if(v=h[y]){for(y>=S&&(S=y+1);!(b=g[S])&&++S<m;);v._next=b||null}}return o=new vn(o,i),o._enter=s,o._exit=c,o}function nne(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ane(){return new vn(this._exit||this._groups.map(D$),this._parents)}function one(e,t,r){var i=this.enter(),n=this,a=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(n=t(n),n&&(n=n.selection())),r==null?a.remove():r(a),i&&n?i.merge(n).order():n}function sne(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,n=r.length,a=i.length,o=Math.min(n,a),s=new Array(n),c=0;c<o;++c)for(var u=r[c],l=i[c],d=u.length,p=s[c]=new Array(d),f,m=0;m<d;++m)(f=u[m]||l[m])&&(p[m]=f);for(;c<n;++c)s[c]=r[c];return new vn(s,this._parents)}function cne(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],n=i.length-1,a=i[n],o;--n>=0;)(o=i[n])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function une(e){e||(e=lne);function t(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var r=this._groups,i=r.length,n=new Array(i),a=0;a<i;++a){for(var o=r[a],s=o.length,c=n[a]=new Array(s),u,l=0;l<s;++l)(u=o[l])&&(c[l]=u);c.sort(t)}return new vn(n,this._parents).order()}function lne(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dne(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function pne(){return Array.from(this)}function fne(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],n=0,a=i.length;n<a;++n){var o=i[n];if(o)return o}return null}function mne(){let e=0;for(const t of this)++e;return e}function hne(){return!this.node()}function gne(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var n=t[r],a=0,o=n.length,s;a<o;++a)(s=n[a])&&e.call(s,s.__data__,a,n);return this}function Ine(e){return function(){this.removeAttribute(e)}}function yne(e){return function(){this.removeAttributeNS(e.space,e.local)}}function vne(e,t){return function(){this.setAttribute(e,t)}}function Sne(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function bne(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Tne(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function wne(e,t){var r=fy(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?yne:Ine:typeof t=="function"?r.local?Tne:bne:r.local?Sne:vne)(r,t))}function P$(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Une(e){return function(){this.style.removeProperty(e)}}function Dne(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Pne(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function Ene(e,t,r){return arguments.length>1?this.each((t==null?Une:typeof t=="function"?Pne:Dne)(e,t,r??"")):Kl(this.node(),e)}function Kl(e,t){return e.style.getPropertyValue(t)||P$(e).getComputedStyle(e,null).getPropertyValue(t)}function Nne(e){return function(){delete this[e]}}function Ane(e,t){return function(){this[e]=t}}function Cne(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Mne(e,t){return arguments.length>1?this.each((t==null?Nne:typeof t=="function"?Cne:Ane)(e,t)):this.node()[e]}function E$(e){return e.trim().split(/^|\s+/)}function LP(e){return e.classList||new N$(e)}function N$(e){this._node=e,this._names=E$(e.getAttribute("class")||"")}N$.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function A$(e,t){for(var r=LP(e),i=-1,n=t.length;++i<n;)r.add(t[i])}function C$(e,t){for(var r=LP(e),i=-1,n=t.length;++i<n;)r.remove(t[i])}function Rne(e){return function(){A$(this,e)}}function kne(e){return function(){C$(this,e)}}function One(e,t){return function(){(t.apply(this,arguments)?A$:C$)(this,e)}}function xne(e,t){var r=E$(e+"");if(arguments.length<2){for(var i=LP(this.node()),n=-1,a=r.length;++n<a;)if(!i.contains(r[n]))return!1;return!0}return this.each((typeof t=="function"?One:t?Rne:kne)(r,t))}function Fne(){this.textContent=""}function _ne(e){return function(){this.textContent=e}}function Lne(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Bne(e){return arguments.length?this.each(e==null?Fne:(typeof e=="function"?Lne:_ne)(e)):this.node().textContent}function $ne(){this.innerHTML=""}function Vne(e){return function(){this.innerHTML=e}}function Gne(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function jne(e){return arguments.length?this.each(e==null?$ne:(typeof e=="function"?Gne:Vne)(e)):this.node().innerHTML}function Wne(){this.nextSibling&&this.parentNode.appendChild(this)}function qne(){return this.each(Wne)}function Hne(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yne(){return this.each(Hne)}function zne(e){var t=typeof e=="function"?e:b$(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Kne(){return null}function Qne(e,t){var r=typeof e=="function"?e:b$(e),i=t==null?Kne:typeof t=="function"?t:_P(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function Xne(){var e=this.parentNode;e&&e.removeChild(this)}function Jne(){return this.each(Xne)}function Zne(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eae(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tae(e){return this.select(e?eae:Zne)}function rae(e){return arguments.length?this.property("__data__",e):this.node().__data__}function iae(e){return function(t){e.call(this,t,this.__data__)}}function nae(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function aae(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,n=t.length,a;r<n;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++i]=a;++i?t.length=i:delete this.__on}}}function oae(e,t,r){return function(){var i=this.__on,n,a=iae(t);if(i){for(var o=0,s=i.length;o<s;++o)if((n=i[o]).type===e.type&&n.name===e.name){this.removeEventListener(n.type,n.listener,n.options),this.addEventListener(n.type,n.listener=a,n.options=r),n.value=t;return}}this.addEventListener(e.type,a,r),n={type:e.type,name:e.name,value:t,listener:a,options:r},i?i.push(n):this.__on=[n]}}function sae(e,t,r){var i=nae(e+""),n,a=i.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,u=s.length,l;c<u;++c)for(n=0,l=s[c];n<a;++n)if((o=i[n]).type===l.type&&o.name===l.name)return l.value}return}for(s=t?oae:aae,n=0;n<a;++n)this.each(s(i[n],t,r));return this}function M$(e,t,r){var i=P$(e),n=i.CustomEvent;typeof n=="function"?n=new n(t,r):(n=i.document.createEvent("Event"),r?(n.initEvent(t,r.bubbles,r.cancelable),n.detail=r.detail):n.initEvent(t,!1,!1)),e.dispatchEvent(n)}function cae(e,t){return function(){return M$(this,e,t)}}function uae(e,t){return function(){return M$(this,e,t.apply(this,arguments))}}function lae(e,t){return this.each((typeof t=="function"?uae:cae)(e,t))}function*dae(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],n=0,a=i.length,o;n<a;++n)(o=i[n])&&(yield o)}var R$=[null];function vn(e,t){this._groups=e,this._parents=t}function Kf(){return new vn([[document.documentElement]],R$)}function pae(){return this}vn.prototype=Kf.prototype={constructor:vn,select:Lie,selectAll:Gie,selectChild:Hie,selectChildren:Qie,filter:Xie,data:ine,enter:Jie,exit:ane,join:one,merge:sne,selection:pae,order:cne,sort:une,call:dne,nodes:pne,node:fne,size:mne,empty:hne,each:gne,attr:wne,style:Ene,property:Mne,classed:xne,text:Bne,html:jne,raise:qne,lower:Yne,append:zne,insert:Qne,remove:Jne,clone:tae,datum:rae,on:sae,dispatch:lae,[Symbol.iterator]:dae};function BP(e){return typeof e=="string"?new vn([[document.querySelector(e)]],[document.documentElement]):new vn([[e]],R$)}function $P(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function k$(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Qf(){}var Xf=.7,hy=1/Xf,Ql="\\s*([+-]?\\d+)\\s*",Jf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fae=/^#([0-9a-f]{3,8})$/,mae=new RegExp(`^rgb\\(${Ql},${Ql},${Ql}\\)$`),hae=new RegExp(`^rgb\\(${Xa},${Xa},${Xa}\\)$`),gae=new RegExp(`^rgba\\(${Ql},${Ql},${Ql},${Jf}\\)$`),Iae=new RegExp(`^rgba\\(${Xa},${Xa},${Xa},${Jf}\\)$`),yae=new RegExp(`^hsl\\(${Jf},${Xa},${Xa}\\)$`),vae=new RegExp(`^hsla\\(${Jf},${Xa},${Xa},${Jf}\\)$`),O$={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};$P(Qf,au,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:x$,formatHex:x$,formatHex8:Sae,formatHsl:bae,formatRgb:F$,toString:F$});function x$(){return this.rgb().formatHex()}function Sae(){return this.rgb().formatHex8()}function bae(){return V$(this).formatHsl()}function F$(){return this.rgb().formatRgb()}function au(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=fae.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?_$(t):r===3?new nn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?gy(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?gy(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=mae.exec(e))?new nn(t[1],t[2],t[3],1):(t=hae.exec(e))?new nn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gae.exec(e))?gy(t[1],t[2],t[3],t[4]):(t=Iae.exec(e))?gy(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yae.exec(e))?$$(t[1],t[2]/100,t[3]/100,1):(t=vae.exec(e))?$$(t[1],t[2]/100,t[3]/100,t[4]):O$.hasOwnProperty(e)?_$(O$[e]):e==="transparent"?new nn(NaN,NaN,NaN,0):null}function _$(e){return new nn(e>>16&255,e>>8&255,e&255,1)}function gy(e,t,r,i){return i<=0&&(e=t=r=NaN),new nn(e,t,r,i)}function Tae(e){return e instanceof Qf||(e=au(e)),e?(e=e.rgb(),new nn(e.r,e.g,e.b,e.opacity)):new nn}function VP(e,t,r,i){return arguments.length===1?Tae(e):new nn(e,t,r,i??1)}function nn(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}$P(nn,VP,k$(Qf,{brighter(e){return e=e==null?hy:Math.pow(hy,e),new nn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Xf:Math.pow(Xf,e),new nn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nn(ou(this.r),ou(this.g),ou(this.b),Iy(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:L$,formatHex:L$,formatHex8:wae,formatRgb:B$,toString:B$}));function L$(){return`#${su(this.r)}${su(this.g)}${su(this.b)}`}function wae(){return`#${su(this.r)}${su(this.g)}${su(this.b)}${su((isNaN(this.opacity)?1:this.opacity)*255)}`}function B$(){const e=Iy(this.opacity);return`${e===1?"rgb(":"rgba("}${ou(this.r)}, ${ou(this.g)}, ${ou(this.b)}${e===1?")":`, ${e})`}`}function Iy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ou(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function su(e){return e=ou(e),(e<16?"0":"")+e.toString(16)}function $$(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new va(e,t,r,i)}function V$(e){if(e instanceof va)return new va(e.h,e.s,e.l,e.opacity);if(e instanceof Qf||(e=au(e)),!e)return new va;if(e instanceof va)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,n=Math.min(t,r,i),a=Math.max(t,r,i),o=NaN,s=a-n,c=(a+n)/2;return s?(t===a?o=(r-i)/s+(r<i)*6:r===a?o=(i-t)/s+2:o=(t-r)/s+4,s/=c<.5?a+n:2-a-n,o*=60):s=c>0&&c<1?0:o,new va(o,s,c,e.opacity)}function Uae(e,t,r,i){return arguments.length===1?V$(e):new va(e,t,r,i??1)}function va(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}$P(va,Uae,k$(Qf,{brighter(e){return e=e==null?hy:Math.pow(hy,e),new va(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Xf:Math.pow(Xf,e),new va(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,n=2*r-i;return new nn(GP(e>=240?e-240:e+120,n,i),GP(e,n,i),GP(e<120?e+240:e-120,n,i),this.opacity)},clamp(){return new va(G$(this.h),yy(this.s),yy(this.l),Iy(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 e=Iy(this.opacity);return`${e===1?"hsl(":"hsla("}${G$(this.h)}, ${yy(this.s)*100}%, ${yy(this.l)*100}%${e===1?")":`, ${e})`}`}}));function G$(e){return e=(e||0)%360,e<0?e+360:e}function yy(e){return Math.max(0,Math.min(1,e||0))}function GP(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const jP=e=>()=>e;function Dae(e,t){return function(r){return e+r*t}}function Pae(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function Eae(e){return(e=+e)==1?j$:function(t,r){return r-t?Pae(t,r,e):jP(isNaN(t)?r:t)}}function j$(e,t){var r=t-e;return r?Dae(e,r):jP(isNaN(e)?t:e)}const vy=(function e(t){var r=Eae(t);function i(n,a){var o=r((n=VP(n)).r,(a=VP(a)).r),s=r(n.g,a.g),c=r(n.b,a.b),u=j$(n.opacity,a.opacity);return function(l){return n.r=o(l),n.g=s(l),n.b=c(l),n.opacity=u(l),n+""}}return i.gamma=e,i})(1);function Nae(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,i=t.slice(),n;return function(a){for(n=0;n<r;++n)i[n]=e[n]*(1-a)+t[n]*a;return i}}function Aae(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Cae(e,t){var r=t?t.length:0,i=e?Math.min(r,e.length):0,n=new Array(i),a=new Array(r),o;for(o=0;o<i;++o)n[o]=HP(e[o],t[o]);for(;o<r;++o)a[o]=t[o];return function(s){for(o=0;o<i;++o)a[o]=n[o](s);return a}}function Mae(e,t){var r=new Date;return e=+e,t=+t,function(i){return r.setTime(e*(1-i)+t*i),r}}function Sa(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Rae(e,t){var r={},i={},n;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(n in t)n in e?r[n]=HP(e[n],t[n]):i[n]=t[n];return function(a){for(n in r)i[n]=r[n](a);return i}}var WP=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,qP=new RegExp(WP.source,"g");function kae(e){return function(){return e}}function Oae(e){return function(t){return e(t)+""}}function W$(e,t){var r=WP.lastIndex=qP.lastIndex=0,i,n,a,o=-1,s=[],c=[];for(e=e+"",t=t+"";(i=WP.exec(e))&&(n=qP.exec(t));)(a=n.index)>r&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(i=i[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,c.push({i:o,x:Sa(i,n)})),r=qP.lastIndex;return r<t.length&&(a=t.slice(r),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Oae(c[0].x):kae(t):(t=c.length,function(u){for(var l=0,d;l<t;++l)s[(d=c[l]).i]=d.x(u);return s.join("")})}function HP(e,t){var r=typeof t,i;return t==null||r==="boolean"?jP(t):(r==="number"?Sa:r==="string"?(i=au(t))?(t=i,vy):W$:t instanceof au?vy:t instanceof Date?Mae:Aae(t)?Nae:Array.isArray(t)?Cae:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Rae:Sa)(e,t)}function xae(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var q$=180/Math.PI,YP={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function H$(e,t,r,i,n,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*r+t*i)&&(r-=e*c,i-=t*c),(s=Math.sqrt(r*r+i*i))&&(r/=s,i/=s,c/=s),e*i<t*r&&(e=-e,t=-t,c=-c,o=-o),{translateX:n,translateY:a,rotate:Math.atan2(t,e)*q$,skewX:Math.atan(c)*q$,scaleX:o,scaleY:s}}var Sy;function Fae(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?YP:H$(t.a,t.b,t.c,t.d,t.e,t.f)}function _ae(e){return e==null||(Sy||(Sy=document.createElementNS("http://www.w3.org/2000/svg","g")),Sy.setAttribute("transform",e),!(e=Sy.transform.baseVal.consolidate()))?YP:(e=e.matrix,H$(e.a,e.b,e.c,e.d,e.e,e.f))}function Y$(e,t,r,i){function n(u){return u.length?u.pop()+" ":""}function a(u,l,d,p,f,m){if(u!==d||l!==p){var h=f.push("translate(",null,t,null,r);m.push({i:h-4,x:Sa(u,d)},{i:h-2,x:Sa(l,p)})}else(d||p)&&f.push("translate("+d+t+p+r)}function o(u,l,d,p){u!==l?(u-l>180?l+=360:l-u>180&&(u+=360),p.push({i:d.push(n(d)+"rotate(",null,i)-2,x:Sa(u,l)})):l&&d.push(n(d)+"rotate("+l+i)}function s(u,l,d,p){u!==l?p.push({i:d.push(n(d)+"skewX(",null,i)-2,x:Sa(u,l)}):l&&d.push(n(d)+"skewX("+l+i)}function c(u,l,d,p,f,m){if(u!==d||l!==p){var h=f.push(n(f)+"scale(",null,",",null,")");m.push({i:h-4,x:Sa(u,d)},{i:h-2,x:Sa(l,p)})}else(d!==1||p!==1)&&f.push(n(f)+"scale("+d+","+p+")")}return function(u,l){var d=[],p=[];return u=e(u),l=e(l),a(u.translateX,u.translateY,l.translateX,l.translateY,d,p),o(u.rotate,l.rotate,d,p),s(u.skewX,l.skewX,d,p),c(u.scaleX,u.scaleY,l.scaleX,l.scaleY,d,p),u=l=null,function(f){for(var m=-1,h=p.length,g;++m<h;)d[(g=p[m]).i]=g.x(f);return d.join("")}}}var Lae=Y$(Fae,"px, ","px)","deg)"),Bae=Y$(_ae,", ",")",")"),Xl=0,Zf=0,em=0,z$=1e3,by,tm,Ty=0,cu=0,wy=0,rm=typeof performance=="object"&&performance.now?performance:Date,K$=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zP(){return cu||(K$($ae),cu=rm.now()+wy)}function $ae(){cu=0}function Uy(){this._call=this._time=this._next=null}Uy.prototype=Q$.prototype={constructor:Uy,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?zP():+r)+(t==null?0:+t),!this._next&&tm!==this&&(tm?tm._next=this:by=this,tm=this),this._call=e,this._time=r,KP()},stop:function(){this._call&&(this._call=null,this._time=1/0,KP())}};function Q$(e,t,r){var i=new Uy;return i.restart(e,t,r),i}function Vae(){zP(),++Xl;for(var e=by,t;e;)(t=cu-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Xl}function X$(){cu=(Ty=rm.now())+wy,Xl=Zf=0;try{Vae()}finally{Xl=0,jae(),cu=0}}function Gae(){var e=rm.now(),t=e-Ty;t>z$&&(wy-=t,Ty=e)}function jae(){for(var e,t=by,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:by=r);tm=e,KP(i)}function KP(e){if(!Xl){Zf&&(Zf=clearTimeout(Zf));var t=e-cu;t>24?(e<1/0&&(Zf=setTimeout(X$,e-rm.now()-wy)),em&&(em=clearInterval(em))):(em||(Ty=rm.now(),em=setInterval(Gae,z$)),Xl=1,K$(X$))}}function J$(e,t,r){var i=new Uy;return t=t==null?0:+t,i.restart(n=>{i.stop(),e(n+t)},t,r),i}var Wae=y$("start","end","cancel","interrupt"),qae=[],Z$=0,eV=1,QP=2,Dy=3,tV=4,XP=5,Py=6;function Ey(e,t,r,i,n,a){var o=e.__transition;if(!o)e.__transition={};else if(r in o)return;Hae(e,r,{name:t,index:i,group:n,on:Wae,tween:qae,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Z$})}function JP(e,t){var r=ba(e,t);if(r.state>Z$)throw new Error("too late; already scheduled");return r}function Ja(e,t){var r=ba(e,t);if(r.state>Dy)throw new Error("too late; already running");return r}function ba(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Hae(e,t,r){var i=e.__transition,n;i[t]=r,r.timer=Q$(a,0,r.time);function a(u){r.state=eV,r.timer.restart(o,r.delay,r.time),r.delay<=u&&o(u-r.delay)}function o(u){var l,d,p,f;if(r.state!==eV)return c();for(l in i)if(f=i[l],f.name===r.name){if(f.state===Dy)return J$(o);f.state===tV?(f.state=Py,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[l]):+l<t&&(f.state=Py,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[l])}if(J$(function(){r.state===Dy&&(r.state=tV,r.timer.restart(s,r.delay,r.time),s(u))}),r.state=QP,r.on.call("start",e,e.__data__,r.index,r.group),r.state===QP){for(r.state=Dy,n=new Array(p=r.tween.length),l=0,d=-1;l<p;++l)(f=r.tween[l].value.call(e,e.__data__,r.index,r.group))&&(n[++d]=f);n.length=d+1}}function s(u){for(var l=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(c),r.state=XP,1),d=-1,p=n.length;++d<p;)n[d].call(e,l);r.state===XP&&(r.on.call("end",e,e.__data__,r.index,r.group),c())}function c(){r.state=Py,r.timer.stop(),delete i[t];for(var u in i)return;delete e.__transition}}function Yae(e,t){var r=e.__transition,i,n,a=!0,o;if(r){t=t==null?null:t+"";for(o in r){if((i=r[o]).name!==t){a=!1;continue}n=i.state>QP&&i.state<XP,i.state=Py,i.timer.stop(),i.on.call(n?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[o]}a&&delete e.__transition}}function zae(e){return this.each(function(){Yae(this,e)})}function Kae(e,t){var r,i;return function(){var n=Ja(this,e),a=n.tween;if(a!==r){i=r=a;for(var o=0,s=i.length;o<s;++o)if(i[o].name===t){i=i.slice(),i.splice(o,1);break}}n.tween=i}}function Qae(e,t,r){var i,n;if(typeof r!="function")throw new Error;return function(){var a=Ja(this,e),o=a.tween;if(o!==i){n=(i=o).slice();for(var s={name:t,value:r},c=0,u=n.length;c<u;++c)if(n[c].name===t){n[c]=s;break}c===u&&n.push(s)}a.tween=n}}function Xae(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=ba(this.node(),r).tween,n=0,a=i.length,o;n<a;++n)if((o=i[n]).name===e)return o.value;return null}return this.each((t==null?Kae:Qae)(r,e,t))}function ZP(e,t,r){var i=e._id;return e.each(function(){var n=Ja(this,i);(n.value||(n.value={}))[t]=r.apply(this,arguments)}),function(n){return ba(n,i).value[t]}}function rV(e,t){var r;return(typeof t=="number"?Sa:t instanceof au?vy:(r=au(t))?(t=r,vy):W$)(e,t)}function Jae(e){return function(){this.removeAttribute(e)}}function Zae(e){return function(){this.removeAttributeNS(e.space,e.local)}}function eoe(e,t,r){var i,n=r+"",a;return function(){var o=this.getAttribute(e);return o===n?null:o===i?a:a=t(i=o,r)}}function toe(e,t,r){var i,n=r+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===n?null:o===i?a:a=t(i=o,r)}}function roe(e,t,r){var i,n,a;return function(){var o,s=r(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+"",o===c?null:o===i&&c===n?a:(n=c,a=t(i=o,s)))}}function ioe(e,t,r){var i,n,a;return function(){var o,s=r(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+"",o===c?null:o===i&&c===n?a:(n=c,a=t(i=o,s)))}}function noe(e,t){var r=fy(e),i=r==="transform"?Bae:rV;return this.attrTween(e,typeof t=="function"?(r.local?ioe:roe)(r,i,ZP(this,"attr."+e,t)):t==null?(r.local?Zae:Jae)(r):(r.local?toe:eoe)(r,i,t))}function aoe(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function ooe(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function soe(e,t){var r,i;function n(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&ooe(e,a)),r}return n._value=t,n}function coe(e,t){var r,i;function n(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&aoe(e,a)),r}return n._value=t,n}function uoe(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=fy(e);return this.tween(r,(i.local?soe:coe)(i,t))}function loe(e,t){return function(){JP(this,e).delay=+t.apply(this,arguments)}}function doe(e,t){return t=+t,function(){JP(this,e).delay=t}}function poe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?loe:doe)(t,e)):ba(this.node(),t).delay}function foe(e,t){return function(){Ja(this,e).duration=+t.apply(this,arguments)}}function moe(e,t){return t=+t,function(){Ja(this,e).duration=t}}function hoe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?foe:moe)(t,e)):ba(this.node(),t).duration}function goe(e,t){if(typeof t!="function")throw new Error;return function(){Ja(this,e).ease=t}}function Ioe(e){var t=this._id;return arguments.length?this.each(goe(t,e)):ba(this.node(),t).ease}function yoe(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ja(this,e).ease=r}}function voe(e){if(typeof e!="function")throw new Error;return this.each(yoe(this._id,e))}function Soe(e){typeof e!="function"&&(e=w$(e));for(var t=this._groups,r=t.length,i=new Array(r),n=0;n<r;++n)for(var a=t[n],o=a.length,s=i[n]=[],c,u=0;u<o;++u)(c=a[u])&&e.call(c,c.__data__,u,a)&&s.push(c);return new Bo(i,this._parents,this._name,this._id)}function boe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,n=r.length,a=Math.min(i,n),o=new Array(i),s=0;s<a;++s)for(var c=t[s],u=r[s],l=c.length,d=o[s]=new Array(l),p,f=0;f<l;++f)(p=c[f]||u[f])&&(d[f]=p);for(;s<i;++s)o[s]=t[s];return new Bo(o,this._parents,this._name,this._id)}function Toe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function woe(e,t,r){var i,n,a=Toe(t)?JP:Ja;return function(){var o=a(this,e),s=o.on;s!==i&&(n=(i=s).copy()).on(t,r),o.on=n}}function Uoe(e,t){var r=this._id;return arguments.length<2?ba(this.node(),r).on.on(e):this.each(woe(r,e,t))}function Doe(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Poe(){return this.on("end.remove",Doe(this._id))}function Eoe(e){var t=this._name,r=this._id;typeof e!="function"&&(e=_P(e));for(var i=this._groups,n=i.length,a=new Array(n),o=0;o<n;++o)for(var s=i[o],c=s.length,u=a[o]=new Array(c),l,d,p=0;p<c;++p)(l=s[p])&&(d=e.call(l,l.__data__,p,s))&&("__data__"in l&&(d.__data__=l.__data__),u[p]=d,Ey(u[p],t,r,p,u,ba(l,r)));return new Bo(a,this._parents,t,r)}function Noe(e){var t=this._name,r=this._id;typeof e!="function"&&(e=T$(e));for(var i=this._groups,n=i.length,a=[],o=[],s=0;s<n;++s)for(var c=i[s],u=c.length,l,d=0;d<u;++d)if(l=c[d]){for(var p=e.call(l,l.__data__,d,c),f,m=ba(l,r),h=0,g=p.length;h<g;++h)(f=p[h])&&Ey(f,t,r,h,p,m);a.push(p),o.push(l)}return new Bo(a,o,t,r)}var Aoe=Kf.prototype.constructor;function Coe(){return new Aoe(this._groups,this._parents)}function Moe(e,t){var r,i,n;return function(){var a=Kl(this,e),o=(this.style.removeProperty(e),Kl(this,e));return a===o?null:a===r&&o===i?n:n=t(r=a,i=o)}}function iV(e){return function(){this.style.removeProperty(e)}}function Roe(e,t,r){var i,n=r+"",a;return function(){var o=Kl(this,e);return o===n?null:o===i?a:a=t(i=o,r)}}function koe(e,t,r){var i,n,a;return function(){var o=Kl(this,e),s=r(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),Kl(this,e))),o===c?null:o===i&&c===n?a:(n=c,a=t(i=o,s))}}function Ooe(e,t){var r,i,n,a="style."+t,o="end."+a,s;return function(){var c=Ja(this,e),u=c.on,l=c.value[a]==null?s||(s=iV(t)):void 0;(u!==r||n!==l)&&(i=(r=u).copy()).on(o,n=l),c.on=i}}function xoe(e,t,r){var i=(e+="")=="transform"?Lae:rV;return t==null?this.styleTween(e,Moe(e,i)).on("end.style."+e,iV(e)):typeof t=="function"?this.styleTween(e,koe(e,i,ZP(this,"style."+e,t))).each(Ooe(this._id,e)):this.styleTween(e,Roe(e,i,t),r).on("end.style."+e,null)}function Foe(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function _oe(e,t,r){var i,n;function a(){var o=t.apply(this,arguments);return o!==n&&(i=(n=o)&&Foe(e,o,r)),i}return a._value=t,a}function Loe(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,_oe(e,t,r??""))}function Boe(e){return function(){this.textContent=e}}function $oe(e){return function(){var t=e(this);this.textContent=t??""}}function Voe(e){return this.tween("text",typeof e=="function"?$oe(ZP(this,"text",e)):Boe(e==null?"":e+""))}function Goe(e){return function(t){this.textContent=e.call(this,t)}}function joe(e){var t,r;function i(){var n=e.apply(this,arguments);return n!==r&&(t=(r=n)&&Goe(n)),t}return i._value=e,i}function Woe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,joe(e))}function qoe(){for(var e=this._name,t=this._id,r=nV(),i=this._groups,n=i.length,a=0;a<n;++a)for(var o=i[a],s=o.length,c,u=0;u<s;++u)if(c=o[u]){var l=ba(c,t);Ey(c,e,r,u,o,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new Bo(i,this._parents,e,r)}function Hoe(){var e,t,r=this,i=r._id,n=r.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--n===0&&a()}};r.each(function(){var u=Ja(this,i),l=u.on;l!==e&&(t=(e=l).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),u.on=t}),n===0&&a()})}var Yoe=0;function Bo(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function nV(){return++Yoe}var $o=Kf.prototype;Bo.prototype={constructor:Bo,select:Eoe,selectAll:Noe,selectChild:$o.selectChild,selectChildren:$o.selectChildren,filter:Soe,merge:boe,selection:Coe,transition:qoe,call:$o.call,nodes:$o.nodes,node:$o.node,size:$o.size,empty:$o.empty,each:$o.each,on:Uoe,attr:noe,attrTween:uoe,style:xoe,styleTween:Loe,text:Voe,textTween:Woe,remove:Poe,tween:Xae,delay:poe,duration:hoe,ease:Ioe,easeVarying:voe,end:Hoe,[Symbol.iterator]:$o[Symbol.iterator]};function zoe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Koe={time:null,delay:0,duration:250,ease:zoe};function Qoe(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Xoe(e){var t,r;e instanceof Bo?(t=e._id,e=e._name):(t=nV(),(r=Koe).time=zP(),e=e==null?null:e+"");for(var i=this._groups,n=i.length,a=0;a<n;++a)for(var o=i[a],s=o.length,c,u=0;u<s;++u)(c=o[u])&&Ey(c,e,t,u,o,r||Qoe(c,t));return new Bo(i,this._parents,e,t)}Kf.prototype.interrupt=zae,Kf.prototype.transition=Xoe;const eE=Math.PI,tE=2*eE,uu=1e-6,Joe=tE-uu;function aV(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Zoe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return aV;const r=10**t;return function(i){this._+=i[0];for(let n=1,a=i.length;n<a;++n)this._+=Math.round(arguments[n]*r)/r+i[n]}}class ese{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?aV:Zoe(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,n){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+n}`}bezierCurveTo(t,r,i,n,a,o){this._append`C${+t},${+r},${+i},${+n},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,i,n,a){if(t=+t,r=+r,i=+i,n=+n,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,s=this._y1,c=i-t,u=n-r,l=o-t,d=s-r,p=l*l+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(p>uu)if(!(Math.abs(d*c-u*l)>uu)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let f=i-o,m=n-s,h=c*c+u*u,g=f*f+m*m,I=Math.sqrt(h),y=Math.sqrt(p),S=a*Math.tan((eE-Math.acos((h+p-g)/(2*I*y)))/2),v=S/y,b=S/I;Math.abs(v-1)>uu&&this._append`L${t+v*l},${r+v*d}`,this._append`A${a},${a},0,0,${+(d*f>l*m)},${this._x1=t+b*c},${this._y1=r+b*u}`}}arc(t,r,i,n,a,o){if(t=+t,r=+r,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let s=i*Math.cos(n),c=i*Math.sin(n),u=t+s,l=r+c,d=1^o,p=o?n-a:a-n;this._x1===null?this._append`M${u},${l}`:(Math.abs(this._x1-u)>uu||Math.abs(this._y1-l)>uu)&&this._append`L${u},${l}`,i&&(p<0&&(p=p%tE+tE),p>Joe?this._append`A${i},${i},0,1,${d},${t-s},${r-c}A${i},${i},0,1,${d},${this._x1=u},${this._y1=l}`:p>uu&&this._append`A${i},${i},0,${+(p>=eE)},${d},${this._x1=t+i*Math.cos(a)},${this._y1=r+i*Math.sin(a)}`)}rect(t,r,i,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+n}h${-i}Z`}toString(){return this._}}function tse(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ny(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),i=e.slice(0,r);return[i.length>1?i[0]+i.slice(2):i,+e.slice(r+1)]}function Jl(e){return e=Ny(Math.abs(e)),e?e[1]:NaN}function rse(e,t){return function(r,i){for(var n=r.length,a=[],o=0,s=e[0],c=0;n>0&&s>0&&(c+s+1>i&&(s=Math.max(1,i-c)),a.push(r.substring(n-=s,n+s)),!((c+=s+1)>i));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function ise(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var nse=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ay(e){if(!(t=nse.exec(e)))throw new Error("invalid format: "+e);var t;return new rE({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ay.prototype=rE.prototype;function rE(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}rE.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 ase(e){e:for(var t=e.length,r=1,i=-1,n;r<t;++r)switch(e[r]){case".":i=n=r;break;case"0":i===0&&(i=r),n=r;break;default:if(!+e[r])break e;i>0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(n+1):e}var Cy;function ose(e,t){var r=Ny(e,t);if(!r)return Cy=void 0,e.toPrecision(t);var i=r[0],n=r[1],a=n-(Cy=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,o=i.length;return a===o?i:a>o?i+new Array(a-o+1).join("0"):a>0?i.slice(0,a)+"."+i.slice(a):"0."+new Array(1-a).join("0")+Ny(e,Math.max(0,t+a-1))[0]}function oV(e,t){var r=Ny(e,t);if(!r)return e+"";var i=r[0],n=r[1];return n<0?"0."+new Array(-n).join("0")+i:i.length>n+1?i.slice(0,n+1)+"."+i.slice(n+1):i+new Array(n-i.length+2).join("0")}const sV={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:tse,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>oV(e*100,t),r:oV,s:ose,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cV(e){return e}var uV=Array.prototype.map,lV=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function sse(e){var t=e.grouping===void 0||e.thousands===void 0?cV:rse(uV.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",n=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?cV:ise(uV.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d,p){d=Ay(d);var f=d.fill,m=d.align,h=d.sign,g=d.symbol,I=d.zero,y=d.width,S=d.comma,v=d.precision,b=d.trim,T=d.type;T==="n"?(S=!0,T="g"):sV[T]||(v===void 0&&(v=12),b=!0,T="g"),(I||f==="0"&&m==="=")&&(I=!0,f="0",m="=");var w=(p&&p.prefix!==void 0?p.prefix:"")+(g==="$"?r:g==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),U=(g==="$"?i:/[%p]/.test(T)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),E=sV[T],D=/[defgprs%]/.test(T);v=v===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function P(N){var C=w,A=U,M,R,O;if(T==="c")A=E(N)+A,N="";else{N=+N;var k=N<0||1/N<0;if(N=isNaN(N)?c:E(Math.abs(N),v),b&&(N=ase(N)),k&&+N==0&&h!=="+"&&(k=!1),C=(k?h==="("?h:s:h==="-"||h==="("?"":h)+C,A=(T==="s"&&!isNaN(N)&&Cy!==void 0?lV[8+Cy/3]:"")+A+(k&&h==="("?")":""),D){for(M=-1,R=N.length;++M<R;)if(O=N.charCodeAt(M),48>O||O>57){A=(O===46?n+N.slice(M+1):N.slice(M))+A,N=N.slice(0,M);break}}}S&&!I&&(N=t(N,1/0));var _=C.length+N.length+A.length,x=_<y?new Array(y-_+1).join(f):"";switch(S&&I&&(N=t(x+N,x.length?y-A.length:1/0),x=""),m){case"<":N=C+N+A+x;break;case"=":N=C+x+N+A;break;case"^":N=x.slice(0,_=x.length>>1)+C+N+A+x.slice(_);break;default:N=x+C+N+A;break}return a(N)}return P.toString=function(){return d+""},P}function l(d,p){var f=Math.max(-8,Math.min(8,Math.floor(Jl(p)/3)))*3,m=Math.pow(10,-f),h=u((d=Ay(d),d.type="f",d),{suffix:lV[8+f/3]});return function(g){return h(m*g)}}return{format:u,formatPrefix:l}}var My,dV,pV;cse({thousands:",",grouping:[3],currency:["$",""]});function cse(e){return My=sse(e),dV=My.format,pV=My.formatPrefix,My}function use(e){return Math.max(0,-Jl(Math.abs(e)))}function lse(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jl(t)/3)))*3-Jl(Math.abs(e)))}function dse(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jl(t)-Jl(e))+1}function pse(e){var t=0,r=e.children,i=r&&r.length;if(!i)t=1;else for(;--i>=0;)t+=r[i].value;e.value=t}function fse(){return this.eachAfter(pse)}function mse(e,t){let r=-1;for(const i of this)e.call(t,i,++r,this);return this}function hse(e,t){for(var r=this,i=[r],n,a,o=-1;r=i.pop();)if(e.call(t,r,++o,this),n=r.children)for(a=n.length-1;a>=0;--a)i.push(n[a]);return this}function gse(e,t){for(var r=this,i=[r],n=[],a,o,s,c=-1;r=i.pop();)if(n.push(r),a=r.children)for(o=0,s=a.length;o<s;++o)i.push(a[o]);for(;r=n.pop();)e.call(t,r,++c,this);return this}function Ise(e,t){let r=-1;for(const i of this)if(e.call(t,i,++r,this))return i}function yse(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,i=t.children,n=i&&i.length;--n>=0;)r+=i[n].value;t.value=r})}function vse(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Sse(e){for(var t=this,r=bse(t,e),i=[t];t!==r;)t=t.parent,i.push(t);for(var n=i.length;e!==r;)i.splice(n,0,e),e=e.parent;return i}function bse(e,t){if(e===t)return e;var r=e.ancestors(),i=t.ancestors(),n=null;for(e=r.pop(),t=i.pop();e===t;)n=e,e=r.pop(),t=i.pop();return n}function Tse(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function wse(){return Array.from(this)}function Use(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Dse(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t}function*Pse(){var e=this,t,r=[e],i,n,a;do for(t=r.reverse(),r=[];e=t.pop();)if(yield e,i=e.children)for(n=0,a=i.length;n<a;++n)r.push(i[n]);while(r.length)}function iE(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ase)):t===void 0&&(t=Nse);for(var r=new Ry(e),i,n=[r],a,o,s,c;i=n.pop();)if((o=t(i.data))&&(c=(o=Array.from(o)).length))for(i.children=o,s=c-1;s>=0;--s)n.push(a=o[s]=new Ry(o[s])),a.parent=i,a.depth=i.depth+1;return r.eachBefore(Mse)}function Ese(){return iE(this).eachBefore(Cse)}function Nse(e){return e.children}function Ase(e){return Array.isArray(e)?e[1]:null}function Cse(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Mse(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Ry(e){this.data=e,this.depth=this.height=0,this.parent=null}Ry.prototype=iE.prototype={constructor:Ry,count:fse,each:mse,eachAfter:gse,eachBefore:hse,find:Ise,sum:yse,sort:vse,path:Sse,ancestors:Tse,descendants:wse,leaves:Use,links:Dse,copy:Ese,[Symbol.iterator]:Pse};function Rse(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function kse(e,t,r,i,n){for(var a=e.children,o,s=-1,c=a.length,u=e.value&&(i-t)/e.value;++s<c;)o=a[s],o.y0=r,o.y1=n,o.x0=t,o.x1=t+=o.value*u}function Ose(){var e=1,t=1,r=0,i=!1;function n(o){var s=o.height+1;return o.x0=o.y0=r,o.x1=e,o.y1=t/s,o.eachBefore(a(t,s)),i&&o.eachBefore(Rse),o}function a(o,s){return function(c){c.children&&kse(c,c.x0,o*(c.depth+1)/s,c.x1,o*(c.depth+2)/s);var u=c.x0,l=c.y0,d=c.x1-r,p=c.y1-r;d<u&&(u=d=(u+d)/2),p<l&&(l=p=(l+p)/2),c.x0=u,c.y0=l,c.x1=d,c.y1=p}}return n.round=function(o){return arguments.length?(i=!!o,n):i},n.size=function(o){return arguments.length?(e=+o[0],t=+o[1],n):[e,t]},n.padding=function(o){return arguments.length?(r=+o,n):r},n}function xse(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Fse(e){return function(){return e}}function _se(e){return+e}var fV=[0,1];function Zl(e){return e}function nE(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Fse(isNaN(t)?NaN:.5)}function Lse(e,t){var r;return e>t&&(r=e,e=t,t=r),function(i){return Math.max(e,Math.min(t,i))}}function Bse(e,t,r){var i=e[0],n=e[1],a=t[0],o=t[1];return n<i?(i=nE(n,i),a=r(o,a)):(i=nE(i,n),a=r(a,o)),function(s){return a(i(s))}}function $se(e,t,r){var i=Math.min(e.length,t.length)-1,n=new Array(i),a=new Array(i),o=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<i;)n[o]=nE(e[o],e[o+1]),a[o]=r(t[o],t[o+1]);return function(s){var c=Pie(e,s,1,i)-1;return a[c](n[c](s))}}function Vse(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Gse(){var e=fV,t=fV,r=HP,i,n,a,o=Zl,s,c,u;function l(){var p=Math.min(e.length,t.length);return o!==Zl&&(o=Lse(e[0],e[p-1])),s=p>2?$se:Bse,c=u=null,d}function d(p){return p==null||isNaN(p=+p)?a:(c||(c=s(e.map(i),t,r)))(i(o(p)))}return d.invert=function(p){return o(n((u||(u=s(t,e.map(i),Sa)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,_se),l()):e.slice()},d.range=function(p){return arguments.length?(t=Array.from(p),l()):t.slice()},d.rangeRound=function(p){return t=Array.from(p),r=xae,l()},d.clamp=function(p){return arguments.length?(o=p?!0:Zl,l()):o!==Zl},d.interpolate=function(p){return arguments.length?(r=p,l()):r},d.unknown=function(p){return arguments.length?(a=p,d):a},function(p,f){return i=p,n=f,l()}}function jse(){return Gse()(Zl,Zl)}function Wse(e,t,r,i){var n=Mie(e,t,r),a;switch(i=Ay(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(a=lse(n,o))&&(i.precision=a),pV(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(a=dse(n,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=a-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(a=use(n))&&(i.precision=a-(i.type==="%")*2);break}}return dV(i)}function qse(e){var t=e.domain;return e.ticks=function(r){var i=t();return Cie(i[0],i[i.length-1],r??10)},e.tickFormat=function(r,i){var n=t();return Wse(n[0],n[n.length-1],r??10,i)},e.nice=function(r){r==null&&(r=10);var i=t(),n=0,a=i.length-1,o=i[n],s=i[a],c,u,l=10;for(s<o&&(u=o,o=s,s=u,u=n,n=a,a=u);l-- >0;){if(u=OP(o,s,r),u===c)return i[n]=o,i[a]=s,t(i);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;c=u}return e},e}function lu(){var e=jse();return e.copy=function(){return Vse(e,lu())},xse.apply(e,arguments),qse(e)}function ks(e){return function(){return e}}const mV=Math.abs,Ti=Math.atan2,du=Math.cos,Hse=Math.max,aE=Math.min,Za=Math.sin,ed=Math.sqrt,an=1e-12,im=Math.PI,ky=im/2,Yse=2*im;function zse(e){return e>1?0:e<-1?im:Math.acos(e)}function hV(e){return e>=1?ky:e<=-1?-ky:Math.asin(e)}function Kse(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new ese(t)}function Qse(e){return e.innerRadius}function Xse(e){return e.outerRadius}function Jse(e){return e.startAngle}function Zse(e){return e.endAngle}function ece(e){return e&&e.padAngle}function tce(e,t,r,i,n,a,o,s){var c=r-e,u=i-t,l=o-n,d=s-a,p=d*c-l*u;if(!(p*p<an))return p=(l*(t-a)-d*(e-n))/p,[e+p*c,t+p*u]}function Oy(e,t,r,i,n,a,o){var s=e-r,c=t-i,u=(o?a:-a)/ed(s*s+c*c),l=u*c,d=-u*s,p=e+l,f=t+d,m=r+l,h=i+d,g=(p+m)/2,I=(f+h)/2,y=m-p,S=h-f,v=y*y+S*S,b=n-a,T=p*h-m*f,w=(S<0?-1:1)*ed(Hse(0,b*b*v-T*T)),U=(T*S-y*w)/v,E=(-T*y-S*w)/v,D=(T*S+y*w)/v,P=(-T*y+S*w)/v,N=U-g,C=E-I,A=D-g,M=P-I;return N*N+C*C>A*A+M*M&&(U=D,E=P),{cx:U,cy:E,x01:-l,y01:-d,x11:U*(n/b-1),y11:E*(n/b-1)}}function rce(){var e=Qse,t=Xse,r=ks(0),i=null,n=Jse,a=Zse,o=ece,s=null,c=Kse(u);function u(){var l,d,p=+e.apply(this,arguments),f=+t.apply(this,arguments),m=n.apply(this,arguments)-ky,h=a.apply(this,arguments)-ky,g=mV(h-m),I=h>m;if(s||(s=l=c()),f<p&&(d=f,f=p,p=d),!(f>an))s.moveTo(0,0);else if(g>Yse-an)s.moveTo(f*du(m),f*Za(m)),s.arc(0,0,f,m,h,!I),p>an&&(s.moveTo(p*du(h),p*Za(h)),s.arc(0,0,p,h,m,I));else{var y=m,S=h,v=m,b=h,T=g,w=g,U=o.apply(this,arguments)/2,E=U>an&&(i?+i.apply(this,arguments):ed(p*p+f*f)),D=aE(mV(f-p)/2,+r.apply(this,arguments)),P=D,N=D,C,A;if(E>an){var M=hV(E/p*Za(U)),R=hV(E/f*Za(U));(T-=M*2)>an?(M*=I?1:-1,v+=M,b-=M):(T=0,v=b=(m+h)/2),(w-=R*2)>an?(R*=I?1:-1,y+=R,S-=R):(w=0,y=S=(m+h)/2)}var O=f*du(y),k=f*Za(y),_=p*du(b),x=p*Za(b);if(D>an){var F=f*du(S),B=f*Za(S),W=p*du(v),V=p*Za(v),H;if(g<im)if(H=tce(O,k,W,V,F,B,_,x)){var j=O-H[0],G=k-H[1],q=F-H[0],Y=B-H[1],z=1/Za(zse((j*q+G*Y)/(ed(j*j+G*G)*ed(q*q+Y*Y)))/2),X=ed(H[0]*H[0]+H[1]*H[1]);P=aE(D,(p-X)/(z-1)),N=aE(D,(f-X)/(z+1))}else P=N=0}w>an?N>an?(C=Oy(W,V,O,k,f,N,I),A=Oy(F,B,_,x,f,N,I),s.moveTo(C.cx+C.x01,C.cy+C.y01),N<D?s.arc(C.cx,C.cy,N,Ti(C.y01,C.x01),Ti(A.y01,A.x01),!I):(s.arc(C.cx,C.cy,N,Ti(C.y01,C.x01),Ti(C.y11,C.x11),!I),s.arc(0,0,f,Ti(C.cy+C.y11,C.cx+C.x11),Ti(A.cy+A.y11,A.cx+A.x11),!I),s.arc(A.cx,A.cy,N,Ti(A.y11,A.x11),Ti(A.y01,A.x01),!I))):(s.moveTo(O,k),s.arc(0,0,f,y,S,!I)):s.moveTo(O,k),!(p>an)||!(T>an)?s.lineTo(_,x):P>an?(C=Oy(_,x,F,B,p,-P,I),A=Oy(O,k,W,V,p,-P,I),s.lineTo(C.cx+C.x01,C.cy+C.y01),P<D?s.arc(C.cx,C.cy,P,Ti(C.y01,C.x01),Ti(A.y01,A.x01),!I):(s.arc(C.cx,C.cy,P,Ti(C.y01,C.x01),Ti(C.y11,C.x11),!I),s.arc(0,0,p,Ti(C.cy+C.y11,C.cx+C.x11),Ti(A.cy+A.y11,A.cx+A.x11),I),s.arc(A.cx,A.cy,P,Ti(A.y11,A.x11),Ti(A.y01,A.x01),!I))):s.arc(0,0,p,b,v,I)}if(s.closePath(),l)return s=null,l+""||null}return u.centroid=function(){var l=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+n.apply(this,arguments)+ +a.apply(this,arguments))/2-im/2;return[du(d)*l,Za(d)*l]},u.innerRadius=function(l){return arguments.length?(e=typeof l=="function"?l:ks(+l),u):e},u.outerRadius=function(l){return arguments.length?(t=typeof l=="function"?l:ks(+l),u):t},u.cornerRadius=function(l){return arguments.length?(r=typeof l=="function"?l:ks(+l),u):r},u.padRadius=function(l){return arguments.length?(i=l==null?null:typeof l=="function"?l:ks(+l),u):i},u.startAngle=function(l){return arguments.length?(n=typeof l=="function"?l:ks(+l),u):n},u.endAngle=function(l){return arguments.length?(a=typeof l=="function"?l:ks(+l),u):a},u.padAngle=function(l){return arguments.length?(o=typeof l=="function"?l:ks(+l),u):o},u.context=function(l){return arguments.length?(s=l??null,u):s},u}function nm(e,t,r){this.k=e,this.x=t,this.y=r}nm.prototype={constructor:nm,scale:function(e){return e===1?this:new nm(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new nm(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},nm.prototype;function ice(e,t=15){const r=e.split(" "),i=[];let n=[],a=0;return r.forEach(o=>{a+o.length>t?(n.length&&i.push(n.join(" ")),n=[o],a=o.length):(n.push(o),a+=o.length+(n.length>0?1:0))}),n.length&&i.push(n.join(" ")),i}const xy="text-anchor",Fy="dominant-baseline",Os="fill-opacity",nce=Object.assign({},...Ns.countries.filter(e=>e.ioc).map(e=>({[e.ioc]:e.iso2})),...Ns.countries.filter(e=>e.iso).map(e=>({[e.iso]:e.iso2})));function oE(e){const t=Math.floor(e.length/2),r=e.slice(0,t),i=e.slice(t).reverse();return[...r,...i]}function gV(e){if(e)switch(e){case"WILDCARD":return"WC";case"QUALIFIER":return"Q";case"LUCKY_LOSER":return"LL";default:return e}}function ace(e,t){const r=[];for(const i of e)for(const n of i.sides){const a=i.matchUpStatus==="BYE"&&!n.participantName;r.push({name:n.participantName||(a?"BYE":""),participantName:n.participantName||(a?"BYE":void 0),drawPosition:n.drawPosition,seedNumber:n.seedNumber,entryStatus:gV(n.entryStatus),nationalityCode:n.nationalityCode,matchUp:i,depth:t,value:1})}return r}function oce(e,t){let r=e.winningSide!==void 0&&e.winningSide!==null?e.sides.find(a=>a.sideNumber===e.winningSide):void 0;!r&&e.matchUpStatus==="BYE"&&(r=e.sides.find(a=>a.participantName));const i=r?.participantName,n=i?t.get(i):void 0;return{winnerName:i,winnerSide:r,winnerLookup:n}}function IV(e,t,r,i){return e.map((n,a)=>{const o=a*2,s=[t[o],t[o+1]].filter(Boolean),{winnerName:c,winnerSide:u,winnerLookup:l}=oce(n,i);return{name:c||"",participantName:c,drawPosition:l?.drawPosition??u?.drawPosition,seedNumber:u?.seedNumber??l?.seedNumber,entryStatus:gV(u?.entryStatus)??l?.entryStatus,nationalityCode:u?.nationalityCode??l?.nationalityCode,scoreString:n.scoreString,matchUpStatus:n.matchUpStatus,matchUp:n,depth:r,children:s.length>0?s:void 0}})}function sce(e){const{roundMatchUps:t}=e,r=Object.keys(t).map(Number).sort((u,l)=>u-l);if(r.length===0)throw new Error("No round data found in draw");const i=t[r[0]],n=ace(i,r.length),a=oE(n),o=new Map;for(const u of a)u.participantName&&u.participantName!=="BYE"&&o.set(u.participantName,u);const s=oE(i);let c=IV(s,a,r.length-1,o);for(let u=1;u<r.length;u++){const l=oE(t[r[u]]);c=IV(l,c,r.length-1-u,o)}return c.length===1?c[0]:{name:"Tournament",depth:0,children:c}}function yV(e,t){if(!e)return;const{seedNumber:r,entryStatus:i,drawPosition:n,participantName:a}=e;let o;if(a?.trim().toUpperCase()==="BYE")o="#B0BEC5";else if(r){const s=Number(r),c=lu().domain([1,32]).range(["0","1"]);o=lu().domain(xP(0,1,1/7)).range(["#81D4FA","#42A5F5","#1E88E5","#1565C0","#5C6BC0","#673AB7","#9C27B0"])(Number(c(s)))}else if(i?.toUpperCase()==="WC")o="red";else if(i&&(i==="Q"||i==="LL"))o=lu().domain(xP(0,1,.3333333333333333)).range(["#FFF176","#FBC02D","#FF9800"])(t(n));else{const s=["#C8E6C9","#81C784","#66BB6A","#4CAF50","#43A047","#388E3C","#2E7D32","#1B5E20","#A5D6A7","#90CAF9","#64B5F6","#42A5F5","#2196F3","#1E88E5","#1976D2","#1565C0"];o=lu().domain(xP(0,1,1/s.length)).range(s)(t(n))}e.color=o,e.children&&e.children.forEach(s=>{s.participantName===e.participantName&&(s.color=o),yV(s,t)})}function cce(e,t){const r=[];return e.seedNumber?r.push(`Seed ${e.seedNumber}`):e.entryStatus&&r.push(e.entryStatus),t===7&&e.drawPosition&&r.push(`Draw ${e.drawPosition}`),r.length>0?r.join(" • "):void 0}function uce(e,t){const r=e.find(i=>i.data.participantName&&i.data.participantName!==t);return r?.data.participantName?r.data:void 0}function lce(e,t){const r=[e.participantName];let i;if(t.children&&t.children.length>0)e.scoreString&&r.push(e.scoreString),i=uce(t.children,e.participantName),i&&r.push(i.participantName);else{const a=cce(e,t.depth);a&&r.push(a)}return{messageLines:r,opponentData:i}}function dce(e,t){return-(e*t/2)+t/2}function pce(e,t,r){const i=BP(e).append("svg").attr("width",t).attr("height",r).style("display","block"),n=i.append("g").attr("transform",`translate(${t/2}, ${r/2})`),a=n.append("g").attr("class","flags-group"),o=n.append("g").attr("class","winning-flags-group"),s=n.append("g").attr("class","losing-flags-group");return{svg:i,g:n,flagsGroup:a,winningFlagsGroup:o,losingFlagsGroup:s}}function fce(e,t,r,i,n){const a=e.append("text").attr("x",t/2).attr("y",r/2).attr(xy,"middle").attr(Fy,"middle").attr("font-size",`${i}px`).attr("font-weight","bold").style("fill","var(--chc-text-primary, #333)").attr("pointer-events","none"),o=i+n*.5,s=e.append("text").attr("x",t/2).attr("y",r/2+o).attr(xy,"middle").attr(Fy,"middle").attr("font-size",`${n}px`).style("fill","var(--chc-text-secondary, #666)").attr("pointer-events","none");return{centerText:a,centerText2:s}}function vV(e,t,r,i,n,a,o){r&&(n?(t.flagsGroup.selectAll("text").remove(),t.winningFlagsGroup.selectAll("text").remove(),t.losingFlagsGroup.selectAll("text").remove()):e.selectAll("text").remove(),e.append("text").attr("font-size",`${o}px`).attr(xy,"middle").attr(Fy,"middle").attr("transform",`translate(0, ${i*a})`).text(SV(r)))}function mce(e,t,r,i={}){const n=i.width||800,a=i.height||800,o=Math.min(n,a)/800*(i.textScaleFactor??1),s=28*o,c=24*o,u=30*o,l=r||i.title||"Tournament",d=Object.assign({},...Ns.countries.filter(j=>j.label).map(j=>({[j.ioc]:j.label}))),p=sce(t),f=iE(p,j=>j.children).sum(j=>j.value||0),m=Math.min(n,a)/2,h=m/2,g=j=>j*m/200;Ose().size([2*Math.PI,m-h])(f);const I=lu().domain([0,t.drawSize||128]).range([0,1]);yV(p,I);const y=f.descendants(),S=rce().startAngle(j=>j.x0).endAngle(j=>j.x1).innerRadius(j=>j.y0+h).outerRadius(j=>j.y1+h),{svg:v,g:b,flagsGroup:T,winningFlagsGroup:w,losingFlagsGroup:U}=pce(e,n,a),E=new Set,D=j=>{j.nationalityCode&&E.add(j.nationalityCode),j.children&&j.children.forEach(D)};D(p);const P=Array.from(E),{centerText:N,centerText2:C}=fce(v,n,a,s,c);function A(){const j=ice(l,15);N.text(""),N.selectAll("tspan").remove(),C.text(""),C.selectAll("tspan").remove(),N.selectAll("tspan").data(j).join("tspan").attr("x",n/2).attr("dy",(z,X)=>X===0?0:u).text(z=>z);const Y=-(j.length*u/2)+u/2;N.attr("y",a/2+Y),N.style("display","block"),C.style("display","none")}function M(){if(T.selectAll("text").remove(),w.selectAll("text").remove(),U.selectAll("text").remove(),P.length===0)return;const j=lu().domain([0,P.length]).range([0,Math.PI*2]),G=g(20),q=h-G+10;T.selectAll("text").data(P).join("text").attr("font-size",`${G}px`).attr(xy,"middle").attr(Fy,"middle").attr("transform",(Y,z)=>{const X=j(z),Q=Math.cos(X)*q,J=Math.sin(X)*q;return`translate(${Q}, ${J})`}).text(Y=>SV(Y)).style("cursor","pointer").on("mouseover",function(Y,z){const X=d[z]||z;N.selectAll("tspan").remove(),N.attr("y",a/2),N.text(X).style("display","block"),C.selectAll("tspan").remove(),C.text("").style("display","none"),O||b.selectAll("path").attr(Os,Q=>Q.data.nationalityCode===z?.9:.3)}).on("mouseout",function(){O||b.selectAll("path").attr(Os,.8),A()})}M(),A();const R=i.eventHandlers?.clickCenter;R&&b.insert("circle",":first-child").attr("r",h).attr("fill","transparent").style("cursor","pointer").on("click",R);let O=!1,k;function _(j,G){const q=G.data;if(q.participantName){const{messageLines:J,opponentData:Z}=lce(q,G);Z&&(q.opponent=Z),N.selectAll("tspan").remove(),N.text(""),N.selectAll("tspan").data(J).join("tspan").attr("x",n/2).attr("dy",(ee,ae)=>ae===0?0:u).text(ee=>ee);const re=dce(J.length,u);N.attr("y",a/2+re),N.style("display","block"),C.style("display","none")}O?q.participantName?.toLowerCase()===k?.toLowerCase()||BP(j.currentTarget).attr(Os,.9):b.selectAll("path").attr(Os,J=>J.data.participantName===G.data.participantName?.9:.3);const z=g(30),X=h-z-10,Q={flagsGroup:T,winningFlagsGroup:w,losingFlagsGroup:U};vV(w,Q,q.nationalityCode,-1,!0,X,z),q.opponent&&vV(U,Q,q.opponent.nationalityCode,1,!1,X,z)}function x(j,G){if(O){const q=G.data.participantName?.toLowerCase()===k?.toLowerCase();BP(j.currentTarget).attr(Os,q?1:.2)}else b.selectAll("path").attr(Os,.8);M(),A()}const F=i.eventHandlers?.clickSegment;function B(j,G){if(!F)return;const q=G.data;F({participantName:q.participantName,drawPosition:q.drawPosition,seedNumber:q.seedNumber,entryStatus:q.entryStatus,nationalityCode:q.nationalityCode,scoreString:q.scoreString,matchUpStatus:q.matchUpStatus,roundName:q.roundName,depth:q.depth,matchUp:q.matchUp})}const W=b.selectAll("path").data(y).join("path").attr("d",j=>S(j)).attr("fill",j=>j.data.color||"#ccc").attr(Os,.8).attr("stroke","#fff").attr("stroke-width",1).on("mouseover",_).on("mouseout",x);F&&W.style("cursor","pointer").on("click",B),W.append("title").text(j=>{const G=j.data;return G.participantName?`${G.participantName}
|
|
195
195
|
Draw: ${G.drawPosition||"N/A"}`:`${G.name}
|
|
196
196
|
Depth: ${j.depth}`});function V(j){let G=0;return O=!!j,k=j,b.selectAll("path").attr(Os,q=>j?q.data.participantName?.toLowerCase()===j.toLowerCase()?(G+=1,1):.2:.8),G}function H(j){v.style("display",j?"none":"block")}return{highlightPlayer:V,hide:H}}function hce(e={}){return{render:(t,r,i)=>mce(t,r,i,e)}}function gce(e){return e?.length!==2?"":e&&String.fromCodePoint!==void 0?e.toUpperCase().replaceAll(/./g,t=>String.fromCodePoint((t.codePointAt(0)??0)+127397)):e}function SV(e){const t=nce[e]||e;return gce(t)}function Ice(e){const t={};for(const[i,n]of Object.entries(e.roundMatchUps))t[Number(i)]=n.map(a=>({...a,winningSide:a.winningSide,drawPositions:a.drawPositions||[],scoreString:a.winningSide===1?a.score?.scoreStringSide1:a.winningSide===2?a.score?.scoreStringSide2:void 0,sides:(a.sides||[]).map(o=>({sideNumber:o.sideNumber,drawPosition:o.drawPosition,participantName:o.participant?.participantName,nationalityCode:o.participant?.person?.nationalityCode,seedNumber:o.seedNumber,entryStatus:o.participant?.entryStatus}))}));return{drawSize:(t[1]?.length||0)*2,roundMatchUps:t,seedAssignments:e.seedAssignments}}const yce={LL:"LUCKY_LOSER",WC:"WILDCARD",Q:"QUALIFIER"},vce=["R128","R64","R32","R16","QF","SF","F"];function Sce(e){const t=[];let r=!1;for(const l of vce){const d=e[l];d&&d.length>0&&(r=!0),r&&d&&d.length>0&&t.push({key:l,data:d})}if(t.length===0)return{drawSize:0,roundMatchUps:{}};const i=t[0].data,n=i.length,a=new Map;i.forEach((l,d)=>{const p=Vo(l.player);p&&p!=="BYE"&&a.set(p,{drawPosition:l.Draw??d+1,country:l.country,seed:l.seed,entry:l.entry})});const o=new Map;for(let l=0;l<t.length;l++){const d=l+1<t.length?t[l+1].data:e.W||[],p=new Set;for(const f of d){const m=Vo(f.player);m&&p.add(m)}o.set(t[l].key,p)}const s={},c=[],u=o.get(t[0].key)||new Set;for(let l=0;l<i.length;l+=2){const d=i[l],p=i[l+1],f=Vo(d?.player),m=Vo(p?.player),h=f==="BYE"||m==="BYE",g=h?f==="BYE"?2:1:u.has(f)?1:u.has(m)?2:void 0;let I;if(!h&&t.length>1){const S=t[1].data,v=g===1?f:m;I=S.find(T=>Vo(T.player)===v)?.score}const y=h?"BYE":g?"COMPLETED":"TO_BE_PLAYED";c.push({roundNumber:1,matchUpStatus:y,winningSide:g,drawPositions:[d?.Draw??l+1,p?.Draw??l+2],scoreString:I,sides:[TV(1,d,l+1),TV(2,p,l+2)]})}s[1]=c;for(let l=1;l<t.length;l++){const d=l+1,p=t[l].data,f=o.get(t[l].key)||new Set,m=[];for(let h=0;h<p.length;h+=2){const g=p[h],I=p[h+1],y=Vo(g?.player),S=Vo(I?.player),v=f.has(y)?1:f.has(S)?2:void 0,T=(v===1?g:v===2?I:void 0)?.score,w=v?"COMPLETED":"TO_BE_PLAYED";m.push({roundNumber:d,matchUpStatus:w,winningSide:v,drawPositions:[a.get(y)?.drawPosition??0,a.get(S)?.drawPosition??0],scoreString:T,sides:[wV(1,g,a),wV(2,I,a)]})}s[d]=m}return{drawSize:n,roundMatchUps:s}}function Vo(e){if(!e)return"";const t=e.trim();return t.toUpperCase()==="BYE"?"BYE":t}function bV(e){if(e)return yce[e.toUpperCase()]||e}function TV(e,t,r){if(!t)return{sideNumber:e,drawPosition:r};const i=Vo(t.player);return{sideNumber:e,drawPosition:t.Draw??r,participantName:i||void 0,nationalityCode:t.country||void 0,seedNumber:t.seed?Number(t.seed):void 0,entryStatus:bV(t.entry)}}function wV(e,t,r){if(!t)return{sideNumber:e,drawPosition:0};const i=Vo(t.player),n=r.get(i);return{sideNumber:e,drawPosition:n?.drawPosition??0,participantName:i||void 0,nationalityCode:t.country||n?.country||void 0,seedNumber:t.seed?Number(t.seed):n?.seed?Number(n.seed):void 0,entryStatus:bV(t.entry||n?.entry)}}const bce="right",sE="font-medium";function cE({target:e,button:t,stateChange:r}){let i=0;const n=()=>(i+=1,`Item${i}`),a=document.createElement("div");t.class&&a.classList.add(t.class),a.classList.add("dropdown"),t.id&&(a.id=t.id),t.align===bce?(a.classList.add("is-right"),a.style.cssText="margin-left: 1em"):a.style.cssText="margin-right: 1em";const o=I=>I.classList.contains("is-active"),s=()=>{o(a)&&a.classList.remove("is-active")},c=I=>o(I)?(I.classList.remove("is-active"),!1):(I.classList.add("is-active"),!0);a.onmouseleave=s,a.onclick=()=>c(a);const u=document.createElement("div");u.classList.add("dropdown-trigger");const l=document.createElement("button");l.className="button font-medium",t.intent&&l.classList.add(t.intent),l.setAttribute("aria-haspopup","true");const d=document.createElement("span");Xt(t.onClick)&&(d.onclick=t.onClick),d.style.cssText="margin-right: 1em",d.innerHTML=t.label,l.appendChild(d);const p=document.createElement("span");Xt(t.onClick)&&(p.onclick=t.onClick),p.innerHTML=`
|
|
197
197
|
<span class="icon is-small font-medium">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "courthive-components",
|
|
3
|
-
"version": "0.9.28-beta.
|
|
3
|
+
"version": "0.9.28-beta.5",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20.19.0 < 25"
|
|
6
6
|
},
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"import": "./dist/courthive-components.es.js",
|
|
18
18
|
"require": "./dist/courthive-components.umd.js"
|
|
19
19
|
},
|
|
20
|
-
"./dist
|
|
20
|
+
"./dist/*": "./dist/*"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|