@decidables/prospectable-elements
Version:
prospectable-elements: Web Components for visualizing Cumulative Prospect Theory
22 lines • 1.13 MB
JavaScript
!function(t,B){"object"==typeof exports&&"undefined"!=typeof module?B(exports):"function"==typeof define&&define.amd?define(["exports"],B):B((t="undefined"!=typeof globalThis?globalThis:t||self).prospectableElements={})}(this,function(t){"use strict";
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const B=globalThis,s=B.ShadowRoot&&(void 0===B.ShadyCSS||B.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Q=Symbol(),F=new WeakMap;let i=class{constructor(t,B,s){if(this._$cssResult$=!0,s!==Q)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=B}get styleSheet(){let t=this.o;const B=this.t;if(s&&void 0===t){const s=void 0!==B&&1===B.length;s&&(t=F.get(B)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(B,t))}return t}toString(){return this.cssText}};const U=t=>new i("string"==typeof t?t:t+"",void 0,Q),g=(t,...B)=>{const s=1===t.length?t[0]:B.reduce((B,s,Q)=>B+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[Q+1],t[0]);return new i(s,t,Q)},e=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let B="";for(const s of t.cssRules)B+=s.cssText;return U(B)})(t):t,{is:I,defineProperty:l,getOwnPropertyDescriptor:c,getOwnPropertyNames:n,getOwnPropertySymbols:a,getPrototypeOf:d}=Object,o=globalThis,b=o.trustedTypes,C=b?b.emptyScript:"",r=o.reactiveElementPolyfillSupport,u=(t,B)=>t,h={toAttribute(t,B){switch(B){case Boolean:t=t?C:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,B){let s=t;switch(B){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},x=(t,B)=>!I(t,B),G={attribute:!0,type:String,converter:h,reflect:!1,useDefault:!1,hasChanged:x};
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/Symbol.metadata??=Symbol("metadata"),o.litPropertyMetadata??=new WeakMap;let y=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,B=G){if(B.state&&(B.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((B=Object.create(B)).wrapped=!0),this.elementProperties.set(t,B),!B.noAccessor){const s=Symbol(),Q=this.getPropertyDescriptor(t,s,B);void 0!==Q&&l(this.prototype,t,Q)}}static getPropertyDescriptor(t,B,s){const{get:Q,set:F}=c(this.prototype,t)??{get(){return this[B]},set(t){this[B]=t}};return{get:Q,set(B){const i=Q?.call(this);F?.call(this,B),this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??G}static _$Ei(){if(this.hasOwnProperty(u("elementProperties")))return;const t=d(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(u("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(u("properties"))){const t=this.properties,B=[...n(t),...a(t)];for(const s of B)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const B=litPropertyMetadata.get(t);if(void 0!==B)for(const[t,s]of B)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,B]of this.elementProperties){const s=this._$Eu(t,B);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const B=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)B.unshift(e(t))}else void 0!==t&&B.push(e(t));return B}static _$Eu(t,B){const s=B.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,B=this.constructor.elementProperties;for(const s of B.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,Q)=>{if(s)t.adoptedStyleSheets=Q.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of Q){const Q=document.createElement("style"),F=B.litNonce;void 0!==F&&Q.setAttribute("nonce",F),Q.textContent=s.cssText,t.appendChild(Q)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,B,s){this._$AK(t,s)}_$ET(t,B){const s=this.constructor.elementProperties.get(t),Q=this.constructor._$Eu(t,s);if(void 0!==Q&&!0===s.reflect){const F=(void 0!==s.converter?.toAttribute?s.converter:h).toAttribute(B,s.type);this._$Em=t,null==F?this.removeAttribute(Q):this.setAttribute(Q,F),this._$Em=null}}_$AK(t,B){const s=this.constructor,Q=s._$Eh.get(t);if(void 0!==Q&&this._$Em!==Q){const t=s.getPropertyOptions(Q),F="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:h;this._$Em=Q;const i=F.fromAttribute(B,t.type);this[Q]=i??this._$Ej?.get(Q)??i,this._$Em=null}}requestUpdate(t,B,s){if(void 0!==t){const Q=this.constructor,F=this[t];if(s??=Q.getPropertyOptions(t),!((s.hasChanged??x)(F,B)||s.useDefault&&s.reflect&&F===this._$Ej?.get(t)&&!this.hasAttribute(Q._$Eu(t,s))))return;this.C(t,B,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,B,{useDefault:s,reflect:Q,wrapped:F},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??B??this[t]),!0!==F||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||s||(B=void 0),this._$AL.set(t,B)),!0===Q&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,B]of this._$Ep)this[t]=B;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[B,s]of t){const{wrapped:t}=s,Q=this[B];!0!==t||this._$AL.has(B)||void 0===Q||this.C(B,void 0,s,Q)}}let t=!1;const B=this._$AL;try{t=this.shouldUpdate(B),t?(this.willUpdate(B),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(B)):this._$EM()}catch(B){throw t=!1,this._$EM(),B}t&&this._$AE(B)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[u("elementProperties")]=new Map,y[u("finalized")]=new Map,r?.({ReactiveElement:y}),(o.reactiveElementVersions??=[]).push("2.1.1");
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const A=globalThis,L=A.trustedTypes,R=L?L.createPolicy("lit-html",{createHTML:t=>t}):void 0,m="$lit$",V=`lit$${Math.random().toFixed(9).slice(2)}$`,S="?"+V,Z=`<${S}>`,p=document,E=()=>p.createComment(""),N=t=>null===t||"object"!=typeof t&&"function"!=typeof t,X=Array.isArray,W="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,f=/>/g,w=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),v=/'/g,Y=/"/g,J=/^(?:script|style|textarea|title)$/i,k=t=>(B,...s)=>({_$litType$:t,strings:B,values:s}),M=k(1),T=k(2),z=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),O=new WeakMap,P=p.createTreeWalker(p,129);function j(t,B){if(!X(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==R?R.createHTML(B):B}let _=class t{constructor({strings:B,_$litType$:s},Q){let F;this.parts=[];let i=0,U=0;const g=B.length-1,e=this.parts,[I,l]=((t,B)=>{const s=t.length-1,Q=[];let F,i=2===B?"<svg>":3===B?"<math>":"",U=H;for(let B=0;B<s;B++){const s=t[B];let g,e,I=-1,l=0;for(;l<s.length&&(U.lastIndex=l,e=U.exec(s),null!==e);)l=U.lastIndex,U===H?"!--"===e[1]?U=D:void 0!==e[1]?U=f:void 0!==e[2]?(J.test(e[2])&&(F=RegExp("</"+e[2],"g")),U=w):void 0!==e[3]&&(U=w):U===w?">"===e[0]?(U=F??H,I=-1):void 0===e[1]?I=-2:(I=U.lastIndex-e[2].length,g=e[1],U=void 0===e[3]?w:'"'===e[3]?Y:v):U===Y||U===v?U=w:U===D||U===f?U=H:(U=w,F=void 0);const c=U===w&&t[B+1].startsWith("/>")?" ":"";i+=U===H?s+Z:I>=0?(Q.push(g),s.slice(0,I)+m+s.slice(I)+V+c):s+V+(-2===I?B:c)}return[j(t,i+(t[s]||"<?>")+(2===B?"</svg>":3===B?"</math>":"")),Q]})(B,s);if(this.el=t.createElement(I,Q),P.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(F=P.nextNode())&&e.length<g;){if(1===F.nodeType){if(F.hasAttributes())for(const t of F.getAttributeNames())if(t.endsWith(m)){const B=l[U++],s=F.getAttribute(t).split(V),Q=/([.?@])?(.*)/.exec(B);e.push({type:1,index:i,name:Q[2],strings:s,ctor:"."===Q[1]?st:"?"===Q[1]?Qt:"@"===Q[1]?Ft:Bt}),F.removeAttribute(t)}else t.startsWith(V)&&(e.push({type:6,index:i}),F.removeAttribute(t));if(J.test(F.tagName)){const t=F.textContent.split(V),B=t.length-1;if(B>0){F.textContent=L?L.emptyScript:"";for(let s=0;s<B;s++)F.append(t[s],E()),P.nextNode(),e.push({type:2,index:++i});F.append(t[B],E())}}}else if(8===F.nodeType)if(F.data===S)e.push({type:2,index:i});else{let t=-1;for(;-1!==(t=F.data.indexOf(V,t+1));)e.push({type:7,index:i}),t+=V.length-1}i++}}static createElement(t,B){const s=p.createElement("template");return s.innerHTML=t,s}};function $(t,B,s=t,Q){if(B===z)return B;let F=void 0!==Q?s._$Co?.[Q]:s._$Cl;const i=N(B)?void 0:B._$litDirective$;return F?.constructor!==i&&(F?._$AO?.(!1),void 0===i?F=void 0:(F=new i(t),F._$AT(t,s,Q)),void 0!==Q?(s._$Co??=[])[Q]=F:s._$Cl=F),void 0!==F&&(B=$(t,F._$AS(t,B.values),F,Q)),B}let q=class{constructor(t,B){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=B}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:B},parts:s}=this._$AD,Q=(t?.creationScope??p).importNode(B,!0);P.currentNode=Q;let F=P.nextNode(),i=0,U=0,g=s[0];for(;void 0!==g;){if(i===g.index){let B;2===g.type?B=new tt(F,F.nextSibling,this,t):1===g.type?B=new g.ctor(F,g.name,g.strings,this,t):6===g.type&&(B=new Ut(F,this,t)),this._$AV.push(B),g=s[++U]}i!==g?.index&&(F=P.nextNode(),i++)}return P.currentNode=p,Q}p(t){let B=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,B),B+=s.strings.length-2):s._$AI(t[B])),B++}};class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,B,s,Q){this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=t,this._$AB=B,this._$AM=s,this.options=Q,this._$Cv=Q?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const B=this._$AM;return void 0!==B&&11===t?.nodeType&&(t=B.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,B=this){t=$(this,t,B),N(t)?t===K||null==t||""===t?(this._$AH!==K&&this._$AR(),this._$AH=K):t!==this._$AH&&t!==z&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>X(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==K&&N(this._$AH)?this._$AA.nextSibling.data=t:this.T(p.createTextNode(t)),this._$AH=t}$(t){const{values:B,_$litType$:s}=t,Q="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=_.createElement(j(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===Q)this._$AH.p(B);else{const t=new q(Q,this),s=t.u(this.options);t.p(B),this.T(s),this._$AH=t}}_$AC(t){let B=O.get(t.strings);return void 0===B&&O.set(t.strings,B=new _(t)),B}k(t){X(this._$AH)||(this._$AH=[],this._$AR());const B=this._$AH;let s,Q=0;for(const F of t)Q===B.length?B.push(s=new tt(this.O(E()),this.O(E()),this,this.options)):s=B[Q],s._$AI(F),Q++;Q<B.length&&(this._$AR(s&&s._$AB.nextSibling,Q),B.length=Q)}_$AR(t=this._$AA.nextSibling,B){for(this._$AP?.(!1,!0,B);t!==this._$AB;){const B=t.nextSibling;t.remove(),t=B}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}let Bt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,B,s,Q,F){this.type=1,this._$AH=K,this._$AN=void 0,this.element=t,this.name=B,this._$AM=Q,this.options=F,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=K}_$AI(t,B=this,s,Q){const F=this.strings;let i=!1;if(void 0===F)t=$(this,t,B,0),i=!N(t)||t!==this._$AH&&t!==z,i&&(this._$AH=t);else{const Q=t;let U,g;for(t=F[0],U=0;U<F.length-1;U++)g=$(this,Q[s+U],B,U),g===z&&(g=this._$AH[U]),i||=!N(g)||g!==this._$AH[U],g===K?t=K:t!==K&&(t+=(g??"")+F[U+1]),this._$AH[U]=g}i&&!Q&&this.j(t)}j(t){t===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class st extends Bt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===K?void 0:t}}class Qt extends Bt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==K)}}class Ft extends Bt{constructor(t,B,s,Q,F){super(t,B,s,Q,F),this.type=5}_$AI(t,B=this){if((t=$(this,t,B,0)??K)===z)return;const s=this._$AH,Q=t===K&&s!==K||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,F=t!==K&&(s===K||Q);Q&&this.element.removeEventListener(this.name,this,s),F&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Ut{constructor(t,B,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=B,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){$(this,t)}}const gt=A.litHtmlPolyfillSupport;gt?.(_,tt),(A.litHtmlVersions??=[]).push("3.3.1");const et=(t,B,s)=>{const Q=s?.renderBefore??B;let F=Q._$litPart$;if(void 0===F){const t=s?.renderBefore??null;Q._$litPart$=F=new tt(B.insertBefore(E(),t),t,void 0,s??{})}return F._$AI(t),F},It=globalThis;
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/let lt=class extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const B=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=et(B,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};lt._$litElement$=!0,lt.finalized=!0,It.litElementHydrateSupport?.({LitElement:lt});const ct=It.litElementPolyfillSupport;function nt(t,B){return null==t||null==B?NaN:t<B?-1:t>B?1:t>=B?0:NaN}function at(t,B){return null==t||null==B?NaN:B<t?-1:B>t?1:B>=t?0:NaN}function dt(t){let B,s,Q;function F(t,Q,F=0,i=t.length){if(F<i){if(0!==B(Q,Q))return i;do{const B=F+i>>>1;s(t[B],Q)<0?F=B+1:i=B}while(F<i)}return F}return 2!==t.length?(B=nt,s=(B,s)=>nt(t(B),s),Q=(B,s)=>t(B)-s):(B=t===nt||t===at?t:ot,s=t,Q=t),{left:F,center:function(t,B,s=0,i=t.length){const U=F(t,B,s,i-1);return U>s&&Q(t[U-1],B)>-Q(t[U],B)?U-1:U},right:function(t,Q,F=0,i=t.length){if(F<i){if(0!==B(Q,Q))return i;do{const B=F+i>>>1;s(t[B],Q)<=0?F=B+1:i=B}while(F<i)}return F}}}function ot(){return 0}function bt(t){return null===t?NaN:+t}ct?.({LitElement:lt}),(It.litElementVersions??=[]).push("4.2.1");const Ct=dt(nt).right;function rt(t,B){let s=0;for(let B of t)null!=B&&(B=+B)>=B&&++s;return s}function ut(t){return 0|t.length}function ht(t){return!(t>0)}function xt(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function Gt(t,B){var s=0;return Float64Array.from(t,t=>s+=+t||0)}function yt(t,B){let s,Q=0,F=0,i=0;if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(s=B-F,F+=s/++Q,i+=s*(B-F));else{let U=-1;for(let g of t)null!=(g=B(g,++U,t))&&(g=+g)>=g&&(s=g-F,F+=s/++Q,i+=s*(g-F))}if(Q>1)return i/(Q-1)}function At(t,B){const s=yt(t,B);return s?Math.sqrt(s):s}function Lt(t,B){let s,Q;if(void 0===B)for(const B of t)null!=B&&(void 0===s?B>=B&&(s=Q=B):(s>B&&(s=B),Q<B&&(Q=B)));else{let F=-1;for(let i of t)null!=(i=B(i,++F,t))&&(void 0===s?i>=i&&(s=Q=i):(s>i&&(s=i),Q<i&&(Q=i)))}return[s,Q]}dt(bt).center;class Rt{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const B=this._partials;let s=0;for(let Q=0;Q<this._n&&Q<32;Q++){const F=B[Q],i=t+F,U=Math.abs(t)<Math.abs(F)?t-(i-F):F-(i-t);U&&(B[s++]=U),t=i}return B[s]=t,this._n=s+1,this}valueOf(){const t=this._partials;let B,s,Q,F=this._n,i=0;if(F>0){for(i=t[--F];F>0&&(B=i,s=t[--F],i=B+s,Q=s-(i-B),!Q););F>0&&(Q<0&&t[F-1]<0||Q>0&&t[F-1]>0)&&(s=2*Q,B=i+s,s==B-i&&(i=B))}return i}}class mt extends Map{constructor(t,B=Et){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:B}}),null!=t)for(const[B,s]of t)this.set(B,s)}get(t){return super.get(St(this,t))}has(t){return super.has(St(this,t))}set(t,B){return super.set(Zt(this,t),B)}delete(t){return super.delete(pt(this,t))}}class Vt extends Set{constructor(t,B=Et){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:B}}),null!=t)for(const B of t)this.add(B)}has(t){return super.has(St(this,t))}add(t){return super.add(Zt(this,t))}delete(t){return super.delete(pt(this,t))}}function St({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)?t.get(Q):s}function Zt({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)?t.get(Q):(t.set(Q,s),s)}function pt({_intern:t,_key:B},s){const Q=B(s);return t.has(Q)&&(s=t.get(Q),t.delete(Q)),s}function Et(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Nt(t){return t}function Xt(t,...B){return Dt(t,Nt,Nt,B)}function Wt(t,B,...s){return Dt(t,Nt,B,s)}function Ht(t,B,...s){return Dt(t,Array.from,B,s)}function Dt(t,B,s,Q){return function t(F,i){if(i>=Q.length)return s(F);const U=new mt,g=Q[i++];let e=-1;for(const t of F){const B=g(t,++e,F),s=U.get(B);s?s.push(t):U.set(B,[t])}for(const[B,s]of U)U.set(B,t(s,i));return B(U)}(t,0)}function ft(t,...B){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[s]=B;if(s&&2!==s.length||B.length>1){const i=Uint32Array.from(t,(t,B)=>B);return B.length>1?(B=B.map(B=>t.map(B)),i.sort((t,s)=>{for(const Q of B){const B=vt(Q[t],Q[s]);if(B)return B}})):(s=t.map(s),i.sort((t,B)=>vt(s[t],s[B]))),Q=t,F=i,Array.from(F,t=>Q[t])}var Q,F;return t.sort(wt(s))}function wt(t=nt){if(t===nt)return vt;if("function"!=typeof t)throw new TypeError("compare is not a function");return(B,s)=>{const Q=t(B,s);return Q||0===Q?Q:(0===t(s,s))-(0===t(B,B))}}function vt(t,B){return(null==t||!(t>=t))-(null==B||!(B>=B))||(t<B?-1:t>B?1:0)}function Yt(t,B,s){return(2!==B.length?ft(Wt(t,B,s),([t,B],[s,Q])=>nt(B,Q)||nt(t,s)):ft(Xt(t,s),([t,s],[Q,F])=>B(s,F)||nt(t,Q))).map(([t])=>t)}const Jt=Math.sqrt(50),kt=Math.sqrt(10),Mt=Math.sqrt(2);function Tt(t,B,s){const Q=(B-t)/Math.max(0,s),F=Math.floor(Math.log10(Q)),i=Q/Math.pow(10,F),U=i>=Jt?10:i>=kt?5:i>=Mt?2:1;let g,e,I;return F<0?(I=Math.pow(10,-F)/U,g=Math.round(t*I),e=Math.round(B*I),g/I<t&&++g,e/I>B&&--e,I=-I):(I=Math.pow(10,F)*U,g=Math.round(t/I),e=Math.round(B/I),g*I<t&&++g,e*I>B&&--e),e<g&&.5<=s&&s<2?Tt(t,B,2*s):[g,e,I]}function zt(t,B,s){if(!((s=+s)>0))return[];if((t=+t)===(B=+B))return[t];const Q=B<t,[F,i,U]=Q?Tt(B,t,s):Tt(t,B,s);if(!(i>=F))return[];const g=i-F+1,e=new Array(g);if(Q)if(U<0)for(let t=0;t<g;++t)e[t]=(i-t)/-U;else for(let t=0;t<g;++t)e[t]=(i-t)*U;else if(U<0)for(let t=0;t<g;++t)e[t]=(F+t)/-U;else for(let t=0;t<g;++t)e[t]=(F+t)*U;return e}function Kt(t,B,s){return Tt(t=+t,B=+B,s=+s)[2]}function Ot(t,B,s){s=+s;const Q=(B=+B)<(t=+t),F=Q?Kt(B,t,s):Kt(t,B,s);return(Q?-1:1)*(F<0?1/-F:F)}function Pt(t){return Math.max(1,Math.ceil(Math.log(rt(t))/Math.LN2)+1)}function jt(t,B){let s;if(void 0===B)for(const B of t)null!=B&&(s<B||void 0===s&&B>=B)&&(s=B);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&(s<F||void 0===s&&F>=F)&&(s=F)}return s}function _t(t,B){let s,Q=-1,F=-1;if(void 0===B)for(const B of t)++F,null!=B&&(s<B||void 0===s&&B>=B)&&(s=B,Q=F);else for(let i of t)null!=(i=B(i,++F,t))&&(s<i||void 0===s&&i>=i)&&(s=i,Q=F);return Q}function $t(t,B){let s;if(void 0===B)for(const B of t)null!=B&&(s>B||void 0===s&&B>=B)&&(s=B);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&(s>F||void 0===s&&F>=F)&&(s=F)}return s}function qt(t,B){let s,Q=-1,F=-1;if(void 0===B)for(const B of t)++F,null!=B&&(s>B||void 0===s&&B>=B)&&(s=B,Q=F);else for(let i of t)null!=(i=B(i,++F,t))&&(s>i||void 0===s&&i>=i)&&(s=i,Q=F);return Q}function tB(t,B,s=0,Q=1/0,F){if(B=Math.floor(B),s=Math.floor(Math.max(0,s)),Q=Math.floor(Math.min(t.length-1,Q)),!(s<=B&&B<=Q))return t;for(F=void 0===F?vt:wt(F);Q>s;){if(Q-s>600){const i=Q-s+1,U=B-s+1,g=Math.log(i),e=.5*Math.exp(2*g/3),I=.5*Math.sqrt(g*e*(i-e)/i)*(U-i/2<0?-1:1);tB(t,B,Math.max(s,Math.floor(B-U*e/i+I)),Math.min(Q,Math.floor(B+(i-U)*e/i+I)),F)}const i=t[B];let U=s,g=Q;for(BB(t,s,B),F(t[Q],i)>0&&BB(t,s,Q);U<g;){for(BB(t,U,g),++U,--g;F(t[U],i)<0;)++U;for(;F(t[g],i)>0;)--g}0===F(t[s],i)?BB(t,s,g):(++g,BB(t,g,Q)),g<=B&&(s=g+1),B<=g&&(Q=g-1)}return t}function BB(t,B,s){const Q=t[B];t[B]=t[s],t[s]=Q}function sB(t,B=nt){let s,Q=!1;if(1===B.length){let F;for(const i of t){const t=B(i);(Q?nt(t,F)>0:0===nt(t,t))&&(s=i,F=t,Q=!0)}}else for(const F of t)(Q?B(F,s)>0:0===B(F,F))&&(s=F,Q=!0);return s}function QB(t,B,s){if(t=Float64Array.from(function*(t,B){if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(yield B);else{let s=-1;for(let Q of t)null!=(Q=B(Q,++s,t))&&(Q=+Q)>=Q&&(yield Q)}}(t,s)),(Q=t.length)&&!isNaN(B=+B)){if(B<=0||Q<2)return $t(t);if(B>=1)return jt(t);var Q,F=(Q-1)*B,i=Math.floor(F),U=jt(tB(t,i).subarray(0,i+1));return U+($t(t.subarray(i+1))-U)*(F-i)}}function FB(t,B,s=bt){if((Q=t.length)&&!isNaN(B=+B)){if(B<=0||Q<2)return+s(t[0],0,t);if(B>=1)return+s(t[Q-1],Q-1,t);var Q,F=(Q-1)*B,i=Math.floor(F),U=+s(t[i],i,t);return U+(+s(t[i+1],i+1,t)-U)*(F-i)}}function iB(t,B,s){const Q=rt(t),F=QB(t,.75)-QB(t,.25);return Q&&F?Math.ceil((s-B)/(2*F*Math.pow(Q,-1/3))):1}function UB(t,B,s){const Q=rt(t),F=At(t);return Q&&F?Math.ceil((s-B)*Math.cbrt(Q)/(3.49*F)):1}function gB(t,B){let s=0,Q=0;if(void 0===B)for(let B of t)null!=B&&(B=+B)>=B&&(++s,Q+=B);else{let F=-1;for(let i of t)null!=(i=B(i,++F,t))&&(i=+i)>=i&&(++s,Q+=i)}if(s)return Q/s}function eB(t,B){return QB(t,.5,B)}function IB(t){return Array.from(function*(t){for(const B of t)yield*B}(t))}function lB(t,B){const s=new mt;if(void 0===B)for(let B of t)null!=B&&B>=B&&s.set(B,(s.get(B)||0)+1);else{let Q=-1;for(let F of t)null!=(F=B(F,++Q,t))&&F>=F&&s.set(F,(s.get(F)||0)+1)}let Q,F=0;for(const[t,B]of s)B>F&&(F=B,Q=t);return Q}function cB(t,B){return[t,B]}function nB(t,B,s){t=+t,B=+B,s=(F=arguments.length)<2?(B=t,t=0,1):F<3?1:+s;for(var Q=-1,F=0|Math.max(0,Math.ceil((B-t)/s)),i=new Array(F);++Q<F;)i[Q]=t+Q*s;return i}function aB(t,B){let s=0;if(void 0===B)for(let B of t)(B=+B)&&(s+=B);else{let Q=-1;for(let F of t)(F=+B(F,++Q,t))&&(s+=F)}return s}function dB(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()}function oB(t){return t}var bB=1e-6;function CB(t){return"translate("+t+",0)"}function rB(t){return"translate(0,"+t+")"}function uB(t){return B=>+t(B)}function hB(t,B){return B=Math.max(0,t.bandwidth()-2*B)/2,t.round()&&(B=Math.round(B)),s=>+t(s)+B}function xB(){return!this.__axis}function GB(t,B){var s=[],Q=null,F=null,i=6,U=6,g=3,e="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,I=1===t||4===t?-1:1,l=4===t||2===t?"x":"y",c=1===t||3===t?CB:rB;function n(n){var a=null==Q?B.ticks?B.ticks.apply(B,s):B.domain():Q,d=null==F?B.tickFormat?B.tickFormat.apply(B,s):oB:F,o=Math.max(i,0)+g,b=B.range(),C=+b[0]+e,r=+b[b.length-1]+e,u=(B.bandwidth?hB:uB)(B.copy(),e),h=n.selection?n.selection():n,x=h.selectAll(".domain").data([null]),G=h.selectAll(".tick").data(a,B).order(),y=G.exit(),A=G.enter().append("g").attr("class","tick"),L=G.select("line"),R=G.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),G=G.merge(A),L=L.merge(A.append("line").attr("stroke","currentColor").attr(l+"2",I*i)),R=R.merge(A.append("text").attr("fill","currentColor").attr(l,I*o).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),n!==h&&(x=x.transition(n),G=G.transition(n),L=L.transition(n),R=R.transition(n),y=y.transition(n).attr("opacity",bB).attr("transform",function(t){return isFinite(t=u(t))?c(t+e):this.getAttribute("transform")}),A.attr("opacity",bB).attr("transform",function(t){var B=this.parentNode.__axis;return c((B&&isFinite(B=B(t))?B:u(t))+e)})),y.remove(),x.attr("d",4===t||2===t?U?"M"+I*U+","+C+"H"+e+"V"+r+"H"+I*U:"M"+e+","+C+"V"+r:U?"M"+C+","+I*U+"V"+e+"H"+r+"V"+I*U:"M"+C+","+e+"H"+r),G.attr("opacity",1).attr("transform",function(t){return c(u(t)+e)}),L.attr(l+"2",I*i),R.attr(l,I*o).text(d),h.filter(xB).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),h.each(function(){this.__axis=u})}return n.scale=function(t){return arguments.length?(B=t,n):B},n.ticks=function(){return s=Array.from(arguments),n},n.tickArguments=function(t){return arguments.length?(s=null==t?[]:Array.from(t),n):s.slice()},n.tickValues=function(t){return arguments.length?(Q=null==t?null:Array.from(t),n):Q&&Q.slice()},n.tickFormat=function(t){return arguments.length?(F=t,n):F},n.tickSize=function(t){return arguments.length?(i=U=+t,n):i},n.tickSizeInner=function(t){return arguments.length?(i=+t,n):i},n.tickSizeOuter=function(t){return arguments.length?(U=+t,n):U},n.tickPadding=function(t){return arguments.length?(g=+t,n):g},n.offset=function(t){return arguments.length?(e=+t,n):e},n}function yB(t){return GB(3,t)}function AB(t){return GB(4,t)}var LB={value:()=>{}};function RB(){for(var t,B=0,s=arguments.length,Q={};B<s;++B){if(!(t=arguments[B]+"")||t in Q||/[\s.]/.test(t))throw new Error("illegal type: "+t);Q[t]=[]}return new mB(Q)}function mB(t){this._=t}function VB(t,B){for(var s,Q=0,F=t.length;Q<F;++Q)if((s=t[Q]).name===B)return s.value}function SB(t,B,s){for(var Q=0,F=t.length;Q<F;++Q)if(t[Q].name===B){t[Q]=LB,t=t.slice(0,Q).concat(t.slice(Q+1));break}return null!=s&&t.push({name:B,value:s}),t}mB.prototype=RB.prototype={constructor:mB,on:function(t,B){var s,Q,F=this._,i=(Q=F,(t+"").trim().split(/^|\s+/).map(function(t){var B="",s=t.indexOf(".");if(s>=0&&(B=t.slice(s+1),t=t.slice(0,s)),t&&!Q.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:B}})),U=-1,g=i.length;if(!(arguments.length<2)){if(null!=B&&"function"!=typeof B)throw new Error("invalid callback: "+B);for(;++U<g;)if(s=(t=i[U]).type)F[s]=SB(F[s],t.name,B);else if(null==B)for(s in F)F[s]=SB(F[s],t.name,null);return this}for(;++U<g;)if((s=(t=i[U]).type)&&(s=VB(F[s],t.name)))return s},copy:function(){var t={},B=this._;for(var s in B)t[s]=B[s].slice();return new mB(t)},call:function(t,B){if((s=arguments.length-2)>0)for(var s,Q,F=new Array(s),i=0;i<s;++i)F[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,s=(Q=this._[t]).length;i<s;++i)Q[i].value.apply(B,F)},apply:function(t,B,s){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var Q=this._[t],F=0,i=Q.length;F<i;++F)Q[F].value.apply(B,s)}};var ZB="http://www.w3.org/1999/xhtml",pB={svg:"http://www.w3.org/2000/svg",xhtml:ZB,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function EB(t){var B=t+="",s=B.indexOf(":");return s>=0&&"xmlns"!==(B=t.slice(0,s))&&(t=t.slice(s+1)),pB.hasOwnProperty(B)?{space:pB[B],local:t}:t}function NB(t){return function(){var B=this.ownerDocument,s=this.namespaceURI;return s===ZB&&B.documentElement.namespaceURI===ZB?B.createElement(t):B.createElementNS(s,t)}}function XB(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function WB(t){var B=EB(t);return(B.local?XB:NB)(B)}function HB(){}function DB(t){return null==t?HB:function(){return this.querySelector(t)}}function fB(){return[]}function wB(t){return null==t?fB:function(){return this.querySelectorAll(t)}}function vB(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function YB(t){return function(){return this.matches(t)}}function JB(t){return function(B){return B.matches(t)}}var kB=Array.prototype.find;function MB(){return this.firstElementChild}var TB=Array.prototype.filter;function zB(){return Array.from(this.children)}function KB(t){return new Array(t.length)}function OB(t,B){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=B}function PB(t,B,s,Q,F,i){for(var U,g=0,e=B.length,I=i.length;g<I;++g)(U=B[g])?(U.__data__=i[g],Q[g]=U):s[g]=new OB(t,i[g]);for(;g<e;++g)(U=B[g])&&(F[g]=U)}function jB(t,B,s,Q,F,i,U){var g,e,I,l=new Map,c=B.length,n=i.length,a=new Array(c);for(g=0;g<c;++g)(e=B[g])&&(a[g]=I=U.call(e,e.__data__,g,B)+"",l.has(I)?F[g]=e:l.set(I,e));for(g=0;g<n;++g)I=U.call(t,i[g],g,i)+"",(e=l.get(I))?(Q[g]=e,e.__data__=i[g],l.delete(I)):s[g]=new OB(t,i[g]);for(g=0;g<c;++g)(e=B[g])&&l.get(a[g])===e&&(F[g]=e)}function _B(t){return t.__data__}function $B(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function qB(t,B){return t<B?-1:t>B?1:t>=B?0:NaN}function ts(t){return function(){this.removeAttribute(t)}}function Bs(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ss(t,B){return function(){this.setAttribute(t,B)}}function Qs(t,B){return function(){this.setAttributeNS(t.space,t.local,B)}}function Fs(t,B){return function(){var s=B.apply(this,arguments);null==s?this.removeAttribute(t):this.setAttribute(t,s)}}function is(t,B){return function(){var s=B.apply(this,arguments);null==s?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,s)}}function Us(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function gs(t){return function(){this.style.removeProperty(t)}}function es(t,B,s){return function(){this.style.setProperty(t,B,s)}}function Is(t,B,s){return function(){var Q=B.apply(this,arguments);null==Q?this.style.removeProperty(t):this.style.setProperty(t,Q,s)}}function ls(t,B){return t.style.getPropertyValue(B)||Us(t).getComputedStyle(t,null).getPropertyValue(B)}function cs(t){return function(){delete this[t]}}function ns(t,B){return function(){this[t]=B}}function as(t,B){return function(){var s=B.apply(this,arguments);null==s?delete this[t]:this[t]=s}}function ds(t){return t.trim().split(/^|\s+/)}function os(t){return t.classList||new bs(t)}function bs(t){this._node=t,this._names=ds(t.getAttribute("class")||"")}function Cs(t,B){for(var s=os(t),Q=-1,F=B.length;++Q<F;)s.add(B[Q])}function rs(t,B){for(var s=os(t),Q=-1,F=B.length;++Q<F;)s.remove(B[Q])}function us(t){return function(){Cs(this,t)}}function hs(t){return function(){rs(this,t)}}function xs(t,B){return function(){(B.apply(this,arguments)?Cs:rs)(this,t)}}function Gs(){this.textContent=""}function ys(t){return function(){this.textContent=t}}function As(t){return function(){var B=t.apply(this,arguments);this.textContent=null==B?"":B}}function Ls(){this.innerHTML=""}function Rs(t){return function(){this.innerHTML=t}}function ms(t){return function(){var B=t.apply(this,arguments);this.innerHTML=null==B?"":B}}function Vs(){this.nextSibling&&this.parentNode.appendChild(this)}function Ss(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Zs(){return null}function ps(){var t=this.parentNode;t&&t.removeChild(this)}function Es(){var t=this.cloneNode(!1),B=this.parentNode;return B?B.insertBefore(t,this.nextSibling):t}function Ns(){var t=this.cloneNode(!0),B=this.parentNode;return B?B.insertBefore(t,this.nextSibling):t}function Xs(t){return function(){var B=this.__on;if(B){for(var s,Q=0,F=-1,i=B.length;Q<i;++Q)s=B[Q],t.type&&s.type!==t.type||s.name!==t.name?B[++F]=s:this.removeEventListener(s.type,s.listener,s.options);++F?B.length=F:delete this.__on}}}function Ws(t,B,s){return function(){var Q,F=this.__on,i=function(t){return function(B){t.call(this,B,this.__data__)}}(B);if(F)for(var U=0,g=F.length;U<g;++U)if((Q=F[U]).type===t.type&&Q.name===t.name)return this.removeEventListener(Q.type,Q.listener,Q.options),this.addEventListener(Q.type,Q.listener=i,Q.options=s),void(Q.value=B);this.addEventListener(t.type,i,s),Q={type:t.type,name:t.name,value:B,listener:i,options:s},F?F.push(Q):this.__on=[Q]}}function Hs(t,B,s){var Q=Us(t),F=Q.CustomEvent;"function"==typeof F?F=new F(B,s):(F=Q.document.createEvent("Event"),s?(F.initEvent(B,s.bubbles,s.cancelable),F.detail=s.detail):F.initEvent(B,!1,!1)),t.dispatchEvent(F)}function Ds(t,B){return function(){return Hs(this,t,B)}}function fs(t,B){return function(){return Hs(this,t,B.apply(this,arguments))}}OB.prototype={constructor:OB,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,B){return this._parent.insertBefore(t,B)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},bs.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var B=this._names.indexOf(t);B>=0&&(this._names.splice(B,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ws=[null];function vs(t,B){this._groups=t,this._parents=B}function Ys(){return new vs([[document.documentElement]],ws)}function Js(t){return"string"==typeof t?new vs([[document.querySelector(t)]],[document.documentElement]):new vs([[t]],ws)}function ks(t,B){if(t=function(t){let B;for(;B=t.sourceEvent;)t=B;return t}(t),void 0===B&&(B=t.currentTarget),B){var s=B.ownerSVGElement||B;if(s.createSVGPoint){var Q=s.createSVGPoint();return Q.x=t.clientX,Q.y=t.clientY,[(Q=Q.matrixTransform(B.getScreenCTM().inverse())).x,Q.y]}if(B.getBoundingClientRect){var F=B.getBoundingClientRect();return[t.clientX-F.left-B.clientLeft,t.clientY-F.top-B.clientTop]}}return[t.pageX,t.pageY]}vs.prototype=Ys.prototype={constructor:vs,select:function(t){"function"!=typeof t&&(t=DB(t));for(var B=this._groups,s=B.length,Q=new Array(s),F=0;F<s;++F)for(var i,U,g=B[F],e=g.length,I=Q[F]=new Array(e),l=0;l<e;++l)(i=g[l])&&(U=t.call(i,i.__data__,l,g))&&("__data__"in i&&(U.__data__=i.__data__),I[l]=U);return new vs(Q,this._parents)},selectAll:function(t){t="function"==typeof t?vB(t):wB(t);for(var B=this._groups,s=B.length,Q=[],F=[],i=0;i<s;++i)for(var U,g=B[i],e=g.length,I=0;I<e;++I)(U=g[I])&&(Q.push(t.call(U,U.__data__,I,g)),F.push(U));return new vs(Q,F)},selectChild:function(t){return this.select(null==t?MB:function(t){return function(){return kB.call(this.children,t)}}("function"==typeof t?t:JB(t)))},selectChildren:function(t){return this.selectAll(null==t?zB:function(t){return function(){return TB.call(this.children,t)}}("function"==typeof t?t:JB(t)))},filter:function(t){"function"!=typeof t&&(t=YB(t));for(var B=this._groups,s=B.length,Q=new Array(s),F=0;F<s;++F)for(var i,U=B[F],g=U.length,e=Q[F]=[],I=0;I<g;++I)(i=U[I])&&t.call(i,i.__data__,I,U)&&e.push(i);return new vs(Q,this._parents)},data:function(t,B){if(!arguments.length)return Array.from(this,_B);var s=B?jB:PB,Q=this._parents,F=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var i=F.length,U=new Array(i),g=new Array(i),e=new Array(i),I=0;I<i;++I){var l=Q[I],c=F[I],n=c.length,a=$B(t.call(l,l&&l.__data__,I,Q)),d=a.length,o=g[I]=new Array(d),b=U[I]=new Array(d);s(l,c,o,b,e[I]=new Array(n),a,B);for(var C,r,u=0,h=0;u<d;++u)if(C=o[u]){for(u>=h&&(h=u+1);!(r=b[h])&&++h<d;);C._next=r||null}}return(U=new vs(U,Q))._enter=g,U._exit=e,U},enter:function(){return new vs(this._enter||this._groups.map(KB),this._parents)},exit:function(){return new vs(this._exit||this._groups.map(KB),this._parents)},join:function(t,B,s){var Q=this.enter(),F=this,i=this.exit();return"function"==typeof t?(Q=t(Q))&&(Q=Q.selection()):Q=Q.append(t+""),null!=B&&(F=B(F))&&(F=F.selection()),null==s?i.remove():s(i),Q&&F?Q.merge(F).order():F},merge:function(t){for(var B=t.selection?t.selection():t,s=this._groups,Q=B._groups,F=s.length,i=Q.length,U=Math.min(F,i),g=new Array(F),e=0;e<U;++e)for(var I,l=s[e],c=Q[e],n=l.length,a=g[e]=new Array(n),d=0;d<n;++d)(I=l[d]||c[d])&&(a[d]=I);for(;e<F;++e)g[e]=s[e];return new vs(g,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,B=-1,s=t.length;++B<s;)for(var Q,F=t[B],i=F.length-1,U=F[i];--i>=0;)(Q=F[i])&&(U&&4^Q.compareDocumentPosition(U)&&U.parentNode.insertBefore(Q,U),U=Q);return this},sort:function(t){function B(B,s){return B&&s?t(B.__data__,s.__data__):!B-!s}t||(t=qB);for(var s=this._groups,Q=s.length,F=new Array(Q),i=0;i<Q;++i){for(var U,g=s[i],e=g.length,I=F[i]=new Array(e),l=0;l<e;++l)(U=g[l])&&(I[l]=U);I.sort(B)}return new vs(F,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,B=0,s=t.length;B<s;++B)for(var Q=t[B],F=0,i=Q.length;F<i;++F){var U=Q[F];if(U)return U}return null},size:function(){let t=0;for(const B of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var B=this._groups,s=0,Q=B.length;s<Q;++s)for(var F,i=B[s],U=0,g=i.length;U<g;++U)(F=i[U])&&t.call(F,F.__data__,U,i);return this},attr:function(t,B){var s=EB(t);if(arguments.length<2){var Q=this.node();return s.local?Q.getAttributeNS(s.space,s.local):Q.getAttribute(s)}return this.each((null==B?s.local?Bs:ts:"function"==typeof B?s.local?is:Fs:s.local?Qs:ss)(s,B))},style:function(t,B,s){return arguments.length>1?this.each((null==B?gs:"function"==typeof B?Is:es)(t,B,null==s?"":s)):ls(this.node(),t)},property:function(t,B){return arguments.length>1?this.each((null==B?cs:"function"==typeof B?as:ns)(t,B)):this.node()[t]},classed:function(t,B){var s=ds(t+"");if(arguments.length<2){for(var Q=os(this.node()),F=-1,i=s.length;++F<i;)if(!Q.contains(s[F]))return!1;return!0}return this.each(("function"==typeof B?xs:B?us:hs)(s,B))},text:function(t){return arguments.length?this.each(null==t?Gs:("function"==typeof t?As:ys)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Ls:("function"==typeof t?ms:Rs)(t)):this.node().innerHTML},raise:function(){return this.each(Vs)},lower:function(){return this.each(Ss)},append:function(t){var B="function"==typeof t?t:WB(t);return this.select(function(){return this.appendChild(B.apply(this,arguments))})},insert:function(t,B){var s="function"==typeof t?t:WB(t),Q=null==B?Zs:"function"==typeof B?B:DB(B);return this.select(function(){return this.insertBefore(s.apply(this,arguments),Q.apply(this,arguments)||null)})},remove:function(){return this.each(ps)},clone:function(t){return this.select(t?Ns:Es)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,B,s){var Q,F,i=function(t){return t.trim().split(/^|\s+/).map(function(t){var B="",s=t.indexOf(".");return s>=0&&(B=t.slice(s+1),t=t.slice(0,s)),{type:t,name:B}})}(t+""),U=i.length;if(!(arguments.length<2)){for(g=B?Ws:Xs,Q=0;Q<U;++Q)this.each(g(i[Q],B,s));return this}var g=this.node().__on;if(g)for(var e,I=0,l=g.length;I<l;++I)for(Q=0,e=g[I];Q<U;++Q)if((F=i[Q]).type===e.type&&F.name===e.name)return e.value},dispatch:function(t,B){return this.each(("function"==typeof B?fs:Ds)(t,B))},[Symbol.iterator]:function*(){for(var t=this._groups,B=0,s=t.length;B<s;++B)for(var Q,F=t[B],i=0,U=F.length;i<U;++i)(Q=F[i])&&(yield Q)}};const Ms={passive:!1},Ts={capture:!0,passive:!1};function zs(t){t.stopImmediatePropagation()}function Ks(t){t.preventDefault(),t.stopImmediatePropagation()}var Os=t=>()=>t;function Ps(t,{sourceEvent:B,subject:s,target:Q,identifier:F,active:i,x:U,y:g,dx:e,dy:I,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:B,enumerable:!0,configurable:!0},subject:{value:s,enumerable:!0,configurable:!0},target:{value:Q,enumerable:!0,configurable:!0},identifier:{value:F,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:U,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:e,enumerable:!0,configurable:!0},dy:{value:I,enumerable:!0,configurable:!0},_:{value:l}})}function js(t){return!t.ctrlKey&&!t.button}function _s(){return this.parentNode}function $s(t,B){return null==B?{x:t.x,y:t.y}:B}function qs(){return navigator.maxTouchPoints||"ontouchstart"in this}function tQ(){var t,B,s,Q,F=js,i=_s,U=$s,g=qs,e={},I=RB("start","drag","end"),l=0,c=0;function n(t){t.on("mousedown.drag",a).filter(g).on("touchstart.drag",b).on("touchmove.drag",C,Ms).on("touchend.drag touchcancel.drag",r).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function a(U,g){if(!Q&&F.call(this,U,g)){var e=u(this,i.call(this,U,g),U,g,"mouse");e&&(Js(U.view).on("mousemove.drag",d,Ts).on("mouseup.drag",o,Ts),function(t){var B=t.document.documentElement,s=Js(t).on("dragstart.drag",Ks,Ts);"onselectstart"in B?s.on("selectstart.drag",Ks,Ts):(B.__noselect=B.style.MozUserSelect,B.style.MozUserSelect="none")}(U.view),zs(U),s=!1,t=U.clientX,B=U.clientY,e("start",U))}}function d(Q){if(Ks(Q),!s){var F=Q.clientX-t,i=Q.clientY-B;s=F*F+i*i>c}e.mouse("drag",Q)}function o(t){Js(t.view).on("mousemove.drag mouseup.drag",null),function(t,B){var s=t.document.documentElement,Q=Js(t).on("dragstart.drag",null);B&&(Q.on("click.drag",Ks,Ts),setTimeout(function(){Q.on("click.drag",null)},0)),"onselectstart"in s?Q.on("selectstart.drag",null):(s.style.MozUserSelect=s.__noselect,delete s.__noselect)}(t.view,s),Ks(t),e.mouse("end",t)}function b(t,B){if(F.call(this,t,B)){var s,Q,U=t.changedTouches,g=i.call(this,t,B),e=U.length;for(s=0;s<e;++s)(Q=u(this,g,t,B,U[s].identifier,U[s]))&&(zs(t),Q("start",t,U[s]))}}function C(t){var B,s,Q=t.changedTouches,F=Q.length;for(B=0;B<F;++B)(s=e[Q[B].identifier])&&(Ks(t),s("drag",t,Q[B]))}function r(t){var B,s,F=t.changedTouches,i=F.length;for(Q&&clearTimeout(Q),Q=setTimeout(function(){Q=null},500),B=0;B<i;++B)(s=e[F[B].identifier])&&(zs(t),s("end",t,F[B]))}function u(t,B,s,Q,F,i){var g,c,a,d=I.copy(),o=ks(i||s,B);if(null!=(a=U.call(t,new Ps("beforestart",{sourceEvent:s,target:n,identifier:F,active:l,x:o[0],y:o[1],dx:0,dy:0,dispatch:d}),Q)))return g=a.x-o[0]||0,c=a.y-o[1]||0,function s(i,U,I){var b,C=o;switch(i){case"start":e[F]=s,b=l++;break;case"end":delete e[F],--l;case"drag":o=ks(I||U,B),b=l}d.call(i,t,new Ps(i,{sourceEvent:U,subject:a,target:n,identifier:F,active:b,x:o[0]+g,y:o[1]+c,dx:o[0]-C[0],dy:o[1]-C[1],dispatch:d}),Q)}}return n.filter=function(t){return arguments.length?(F="function"==typeof t?t:Os(!!t),n):F},n.container=function(t){return arguments.length?(i="function"==typeof t?t:Os(t),n):i},n.subject=function(t){return arguments.length?(U="function"==typeof t?t:Os(t),n):U},n.touchable=function(t){return arguments.length?(g="function"==typeof t?t:Os(!!t),n):g},n.on=function(){var t=I.on.apply(I,arguments);return t===I?n:t},n.clickDistance=function(t){return arguments.length?(c=(t=+t)*t,n):Math.sqrt(c)},n}function BQ(t,B,s){t.prototype=B.prototype=s,s.constructor=t}function sQ(t,B){var s=Object.create(t.prototype);for(var Q in B)s[Q]=B[Q];return s}function QQ(){}Ps.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var FQ=.7,iQ=1/FQ,UQ="\\s*([+-]?\\d+)\\s*",gQ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",eQ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",IQ=/^#([0-9a-f]{3,8})$/,lQ=new RegExp(`^rgb\\(${UQ},${UQ},${UQ}\\)$`),cQ=new RegExp(`^rgb\\(${eQ},${eQ},${eQ}\\)$`),nQ=new RegExp(`^rgba\\(${UQ},${UQ},${UQ},${gQ}\\)$`),aQ=new RegExp(`^rgba\\(${eQ},${eQ},${eQ},${gQ}\\)$`),dQ=new RegExp(`^hsl\\(${gQ},${eQ},${eQ}\\)$`),oQ=new RegExp(`^hsla\\(${gQ},${eQ},${eQ},${gQ}\\)$`),bQ={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};function CQ(){return this.rgb().formatHex()}function rQ(){return this.rgb().formatRgb()}function uQ(t){var B,s;return t=(t+"").trim().toLowerCase(),(B=IQ.exec(t))?(s=B[1].length,B=parseInt(B[1],16),6===s?hQ(B):3===s?new AQ(B>>8&15|B>>4&240,B>>4&15|240&B,(15&B)<<4|15&B,1):8===s?xQ(B>>24&255,B>>16&255,B>>8&255,(255&B)/255):4===s?xQ(B>>12&15|B>>8&240,B>>8&15|B>>4&240,B>>4&15|240&B,((15&B)<<4|15&B)/255):null):(B=lQ.exec(t))?new AQ(B[1],B[2],B[3],1):(B=cQ.exec(t))?new AQ(255*B[1]/100,255*B[2]/100,255*B[3]/100,1):(B=nQ.exec(t))?xQ(B[1],B[2],B[3],B[4]):(B=aQ.exec(t))?xQ(255*B[1]/100,255*B[2]/100,255*B[3]/100,B[4]):(B=dQ.exec(t))?ZQ(B[1],B[2]/100,B[3]/100,1):(B=oQ.exec(t))?ZQ(B[1],B[2]/100,B[3]/100,B[4]):bQ.hasOwnProperty(t)?hQ(bQ[t]):"transparent"===t?new AQ(NaN,NaN,NaN,0):null}function hQ(t){return new AQ(t>>16&255,t>>8&255,255&t,1)}function xQ(t,B,s,Q){return Q<=0&&(t=B=s=NaN),new AQ(t,B,s,Q)}function GQ(t){return t instanceof QQ||(t=uQ(t)),t?new AQ((t=t.rgb()).r,t.g,t.b,t.opacity):new AQ}function yQ(t,B,s,Q){return 1===arguments.length?GQ(t):new AQ(t,B,s,null==Q?1:Q)}function AQ(t,B,s,Q){this.r=+t,this.g=+B,this.b=+s,this.opacity=+Q}function LQ(){return`#${SQ(this.r)}${SQ(this.g)}${SQ(this.b)}`}function RQ(){const t=mQ(this.opacity);return`${1===t?"rgb(":"rgba("}${VQ(this.r)}, ${VQ(this.g)}, ${VQ(this.b)}${1===t?")":`, ${t})`}`}function mQ(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function VQ(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function SQ(t){return((t=VQ(t))<16?"0":"")+t.toString(16)}function ZQ(t,B,s,Q){return Q<=0?t=B=s=NaN:s<=0||s>=1?t=B=NaN:B<=0&&(t=NaN),new NQ(t,B,s,Q)}function pQ(t){if(t instanceof NQ)return new NQ(t.h,t.s,t.l,t.opacity);if(t instanceof QQ||(t=uQ(t)),!t)return new NQ;if(t instanceof NQ)return t;var B=(t=t.rgb()).r/255,s=t.g/255,Q=t.b/255,F=Math.min(B,s,Q),i=Math.max(B,s,Q),U=NaN,g=i-F,e=(i+F)/2;return g?(U=B===i?(s-Q)/g+6*(s<Q):s===i?(Q-B)/g+2:(B-s)/g+4,g/=e<.5?i+F:2-i-F,U*=60):g=e>0&&e<1?0:U,new NQ(U,g,e,t.opacity)}function EQ(t,B,s,Q){return 1===arguments.length?pQ(t):new NQ(t,B,s,null==Q?1:Q)}function NQ(t,B,s,Q){this.h=+t,this.s=+B,this.l=+s,this.opacity=+Q}function XQ(t){return(t=(t||0)%360)<0?t+360:t}function WQ(t){return Math.max(0,Math.min(1,t||0))}function HQ(t,B,s){return 255*(t<60?B+(s-B)*t/60:t<180?s:t<240?B+(s-B)*(240-t)/60:B)}BQ(QQ,uQ,{copy(t