From 773ddb88563f98dbef8390b887e16a0cb1903ac8 Mon Sep 17 00:00:00 2001 From: Jay Wang Date: Sun, 21 May 2023 16:25:06 -0400 Subject: [PATCH] Update explorer Signed-off-by: Jay Wang --- .gitignore | 3 +- explorer/assets/index.0e0bc693.js | 198 ++++++++++++++++++++++++++++++ explorer/assets/index.b921769d.js | 198 ------------------------------ explorer/index.html | 2 +- 4 files changed, 201 insertions(+), 200 deletions(-) create mode 100644 explorer/assets/index.0e0bc693.js delete mode 100644 explorer/assets/index.b921769d.js diff --git a/.gitignore b/.gitignore index 188d42c..8ae9691 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store test*.ipynb .ipynb_checkpoints -Pipfile.lock \ No newline at end of file +Pipfile.lock +explorer/*/*.ndjson \ No newline at end of file diff --git a/explorer/assets/index.0e0bc693.js b/explorer/assets/index.0e0bc693.js new file mode 100644 index 0000000..c95e1f8 --- /dev/null +++ b/explorer/assets/index.0e0bc693.js @@ -0,0 +1,198 @@ +var Lu=Object.defineProperty;var Nu=(t,e,n)=>e in t?Lu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var D=(t,e,n)=>(Nu(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerpolicy&&(o.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?o.credentials="include":r.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();function Lt(){}function G(t,e,n,i,r){t.__svelte_meta={loc:{file:e,line:n,column:i,char:r}}}function Na(t){return t()}function Ko(){return Object.create(null)}function nn(t){t.forEach(Na)}function Aa(t){return typeof t=="function"}function rn(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function Au(t){return Object.keys(t).length===0}function Pu(t,e){t.appendChild(e)}function Pa(t,e,n){t.insertBefore(e,n||null)}function po(t){t.parentNode.removeChild(t)}function Z(t){return document.createElement(t)}function bi(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Pr(t){return document.createTextNode(t)}function J(){return Pr(" ")}function Eu(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function zu(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Du(t){return Array.from(t.childNodes)}function lt(t,e,n){t.classList[n?"add":"remove"](e)}function Wu(t,e,{bubbles:n=!1,cancelable:i=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,i,e),r}class Ou{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=bi(n.nodeName):this.e=Z(n.nodeName),this.t=n,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let n=0;n{pi.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}const Yu=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function bn(t){t&&t.c()}function Oe(t,e,n,i){const{fragment:r,after_update:o}=t.$$;r&&r.m(e,n),i||zr(()=>{const s=t.$$.on_mount.map(Na).filter(Aa);t.$$.on_destroy?t.$$.on_destroy.push(...s):nn(s),t.$$.on_mount=[]}),o.forEach(zr)}function Ie(t,e){const n=t.$$;n.fragment!==null&&(nn(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Vu(t,e){t.$$.dirty[0]===-1&&(vn.push(t),za(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const p=d.length?d[0]:h;return u.ctx&&r(u.ctx[c],u.ctx[c]=p)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](p),f&&Vu(t,c)),h}):[],u.update(),f=!0,nn(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=Du(e.target);u.fragment&&u.fragment.l(c),c.forEach(po)}else u.fragment&&u.fragment.c();e.intro&&We(t.$$.fragment),Oe(t,e.target,e.anchor,e.customElement),Da()}An(l)}class $u{$destroy(){Ie(this,1),this.$destroy=Lt}$on(e,n){if(!Aa(n))return Lt;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!Au(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function pt(t,e){document.dispatchEvent(Wu(t,Object.assign({version:"3.52.0"},e),{bubbles:!0}))}function N(t,e){pt("SvelteDOMInsert",{target:t,node:e}),Pu(t,e)}function qe(t,e,n){pt("SvelteDOMInsert",{target:t,node:e,anchor:n}),Pa(t,e,n)}function oe(t){pt("SvelteDOMRemove",{node:t}),po(t)}function dt(t,e,n,i,r,o){const s=i===!0?["capture"]:i?Array.from(Object.keys(i)):[];r&&s.push("preventDefault"),o&&s.push("stopPropagation"),pt("SvelteDOMAddEventListener",{node:t,event:e,handler:n,modifiers:s});const a=Eu(t,e,n,i);return()=>{pt("SvelteDOMRemoveEventListener",{node:t,event:e,handler:n,modifiers:s}),a()}}function P(t,e,n){zu(t,e,n),n==null?pt("SvelteDOMRemoveAttribute",{node:t,attribute:e}):pt("SvelteDOMSetAttribute",{node:t,attribute:e,value:n})}function Uu(t,e,n){t[e]=n,pt("SvelteDOMSetProperty",{node:t,property:e,value:n})}function Xn(t,e,n){for(const i of Object.keys(e))~n.indexOf(i)||console.warn(`<${t}> received an unexpected slot "${i}".`)}class Bn extends $u{constructor(e){if(!e||!e.target&&!e.$$inline)throw new Error("'target' is a required option");super()}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}var Dr="http://www.w3.org/1999/xhtml";const Jo={svg:"http://www.w3.org/2000/svg",xhtml:Dr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gi(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Jo.hasOwnProperty(e)?{space:Jo[e],local:t}:t}function Gu(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Dr&&e.documentElement.namespaceURI===Dr?e.createElement(t):e.createElementNS(n,t)}}function Zu(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Wa(t){var e=Gi(t);return(e.local?Zu:Gu)(e)}function qu(){}function mo(t){return t==null?qu:function(){return this.querySelector(t)}}function Xu(t){typeof t!="function"&&(t=mo(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r=w&&(w=x+1);!(M=m[w])&&++w=0;)(s=i[r])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function yc(t){t||(t=wc);function e(c,h){return c&&h?t(c.__data__,h.__data__):!c-!h}for(var n=this._groups,i=n.length,r=new Array(i),o=0;oe?1:t>=e?0:NaN}function vc(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function xc(){return Array.from(this)}function bc(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?Ec:typeof e=="function"?Dc:zc)(t,e,n==null?"":n)):Xe(this.node(),t)}function Xe(t,e){return t.style.getPropertyValue(e)||Va(t).getComputedStyle(t,null).getPropertyValue(e)}function Oc(t){return function(){delete this[t]}}function Ic(t,e){return function(){this[t]=e}}function Rc(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Fc(t,e){return arguments.length>1?this.each((e==null?Oc:typeof e=="function"?Rc:Ic)(t,e)):this.node()[t]}function $a(t){return t.trim().split(/^|\s+/)}function yo(t){return t.classList||new Ua(t)}function Ua(t){this._node=t,this._names=$a(t.getAttribute("class")||"")}Ua.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Ga(t,e){for(var n=yo(t),i=-1,r=e.length;++i=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function dh(t){return function(){var e=this.__on;if(!!e){for(var n=0,i=-1,r=e.length,o;ne?1:t>=e?0:NaN}function Th(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function Xa(t){let e,n,i;t.length!==2?(e=Ye,n=(a,l)=>Ye(t(a),l),i=(a,l)=>t(a)-l):(e=t===Ye||t===Th?t:Sh,n=t,i=t);function r(a,l,u=0,f=a.length){if(u>>1;n(a[c],l)<0?u=c+1:f=c}while(u>>1;n(a[c],l)<=0?u=c+1:f=c}while(uu&&i(a[c-1],l)>-i(a[c],l)?c-1:c}return{left:r,center:s,right:o}}function Sh(){return 0}function Ch(t){return t===null?NaN:+t}const Lh=Xa(Ye),Nh=Lh.right;Xa(Ch).center;const Ba=Nh;function Ah(t,e){let n=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&++n;else{let i=-1;for(let r of t)(r=e(r,++i,t))!=null&&(r=+r)>=r&&++n}return n}function Pn(t,e){let n,i;if(e===void 0)for(const r of t)r!=null&&(n===void 0?r>=r&&(n=i=r):(n>r&&(n=r),i=o&&(n=i=o):(n>o&&(n=o),i0){for(s=e[--n];n>0&&(i=s,r=e[--n],s=i+r,o=r-(s-i),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(r=o*2,i=s+r,r==i-s&&(s=i))}return s}}class ts extends Map{constructor(e,n=zh){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[i,r]of e)this.set(i,r)}get(e){return super.get(es(this,e))}has(e){return super.has(es(this,e))}set(e,n){return super.set(Ph(this,e),n)}delete(e){return super.delete(Eh(this,e))}}function es({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function Ph({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function Eh({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function zh(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Dh(t){return t}function Wh(t=Ye){if(t===Ye)return Ha;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const i=t(e,n);return i||i===0?i:(t(n,n)===0)-(t(e,e)===0)}}function Ha(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}var Oh=Array.prototype,Ih=Oh.slice;function ni(t){return()=>t}var Wr=Math.sqrt(50),Or=Math.sqrt(10),Ir=Math.sqrt(2);function zn(t,e,n){var i,r=-1,o,s,a;if(e=+e,t=+t,n=+n,t===e&&n>0)return[t];if((i=e0){let l=Math.round(t/a),u=Math.round(e/a);for(l*ae&&--u,s=new Array(o=u-l+1);++re&&--u,s=new Array(o=u-l+1);++r=0?(o>=Wr?10:o>=Or?5:o>=Ir?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=Wr?10:o>=Or?5:o>=Ir?2:1)}function ja(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=Wr?r*=10:o>=Or?r*=5:o>=Ir&&(r*=2),e0?(t=Math.floor(t/r)*r,e=Math.ceil(e/r)*r):r<0&&(t=Math.ceil(t*r)/r,e=Math.floor(e*r)/r),i=r}}function Ka(t){return Math.ceil(Math.log(Ah(t))/Math.LN2)+1}function Fh(){var t=Dh,e=Pn,n=Ka;function i(r){Array.isArray(r)||(r=Array.from(r));var o,s=r.length,a,l,u=new Array(s);for(o=0;o=h)if(g>=h&&e===Pn){const w=Dn(c,h,x);isFinite(w)&&(w>0?h=(Math.floor(h/w)+1)*w:w<0&&(h=(Math.ceil(h*-w)+1)/-w))}else d.pop()}for(var p=d.length;d[0]<=c;)d.shift(),--p;for(;d[p-1]>h;)d.pop(),--p;var b=new Array(p+1),m;for(o=0;o<=p;++o)m=b[o]=[],m.x0=o>0?d[o-1]:c,m.x1=o0)for(o=0;o=i)&&(n=i);else{let i=-1;for(let r of t)(r=e(r,++i,t))!=null&&(n=r)&&(n=r)}return n}function Vh(t,e){let n,i=-1,r=-1;if(e===void 0)for(const o of t)++r,o!=null&&(n=o)&&(n=o,i=r);else for(let o of t)(o=e(o,++r,t))!=null&&(n=o)&&(n=o,i=r);return i}function $h(t,e){let n;if(e===void 0)for(const i of t)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of t)(r=e(r,++i,t))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function Uh(t,e){let n,i=-1,r=-1;if(e===void 0)for(const o of t)++r,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,i=r);else for(let o of t)(o=e(o,++r,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,i=r);return i}function Qa(t,e,n=0,i=t.length-1,r){for(r=r===void 0?Ha:Wh(r);i>n;){if(i-n>600){const l=i-n+1,u=e-n+1,f=Math.log(l),c=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*c*(l-c)/l)*(u-l/2<0?-1:1),d=Math.max(n,Math.floor(e-u*c/l+h)),p=Math.min(i,Math.floor(e+(l-u)*c/l+h));Qa(t,e,d,p,r)}const o=t[e];let s=n,a=i;for(un(t,n,e),r(t[i],o)>0&&un(t,n,i);s0;)--a}r(t[n],o)===0?un(t,n,a):(++a,un(t,a,i)),a<=e&&(n=a+1),e<=a&&(i=a-1)}return t}function un(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Gh(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(r);++i>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ii(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ii(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Kh.exec(t))?new gt(e[1],e[2],e[3],1):(e=Qh.exec(t))?new gt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Jh.exec(t))?ii(e[1],e[2],e[3],e[4]):(e=tf.exec(t))?ii(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ef.exec(t))?us(e[1],e[2]/100,e[3]/100,1):(e=nf.exec(t))?us(e[1],e[2]/100,e[3]/100,e[4]):is.hasOwnProperty(t)?ss(is[t]):t==="transparent"?new gt(NaN,NaN,NaN,0):null}function ss(t){return new gt(t>>16&255,t>>8&255,t&255,1)}function ii(t,e,n,i){return i<=0&&(t=e=n=NaN),new gt(t,e,n,i)}function bo(t){return t instanceof fe||(t=ce(t)),t?(t=t.rgb(),new gt(t.r,t.g,t.b,t.opacity)):new gt}function Mi(t,e,n,i){return arguments.length===1?bo(t):new gt(t,e,n,i==null?1:i)}function gt(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}sn(gt,Mi,jn(fe,{brighter(t){return t=t==null?He:Math.pow(He,t),new gt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ke:Math.pow(ke,t),new gt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new gt(be(this.r),be(this.g),be(this.b),Ti(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:as,formatHex:as,formatHex8:sf,formatRgb:ls,toString:ls}));function as(){return`#${xe(this.r)}${xe(this.g)}${xe(this.b)}`}function sf(){return`#${xe(this.r)}${xe(this.g)}${xe(this.b)}${xe((isNaN(this.opacity)?1:this.opacity)*255)}`}function ls(){const t=Ti(this.opacity);return`${t===1?"rgb(":"rgba("}${be(this.r)}, ${be(this.g)}, ${be(this.b)}${t===1?")":`, ${t})`}`}function Ti(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function be(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function xe(t){return t=be(t),(t<16?"0":"")+t.toString(16)}function us(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new It(t,e,n,i)}function tl(t){if(t instanceof It)return new It(t.h,t.s,t.l,t.opacity);if(t instanceof fe||(t=ce(t)),!t)return new It;if(t instanceof It)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(e===o?s=(n-i)/a+(n0&&l<1?0:s,new It(s,a,l,t.opacity)}function Si(t,e,n,i){return arguments.length===1?tl(t):new It(t,e,n,i==null?1:i)}function It(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}sn(It,Si,jn(fe,{brighter(t){return t=t==null?He:Math.pow(He,t),new It(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ke:Math.pow(ke,t),new It(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new gt(tr(t>=240?t-240:t+120,r,i),tr(t,r,i),tr(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new It(cs(this.h),ri(this.s),ri(this.l),Ti(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ti(this.opacity);return`${t===1?"hsl(":"hsla("}${cs(this.h)}, ${ri(this.s)*100}%, ${ri(this.l)*100}%${t===1?")":`, ${t})`}`}}));function cs(t){return t=(t||0)%360,t<0?t+360:t}function ri(t){return Math.max(0,Math.min(1,t||0))}function tr(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const el=Math.PI/180,nl=180/Math.PI,Ci=18,il=.96422,rl=1,ol=.82521,sl=4/29,$e=6/29,al=3*$e*$e,af=$e*$e*$e;function ll(t){if(t instanceof Bt)return new Bt(t.l,t.a,t.b,t.opacity);if(t instanceof qt)return cl(t);t instanceof gt||(t=bo(t));var e=rr(t.r),n=rr(t.g),i=rr(t.b),r=er((.2225045*e+.7168786*n+.0606169*i)/rl),o,s;return e===n&&n===i?o=s=r:(o=er((.4360747*e+.3850649*n+.1430804*i)/il),s=er((.0139322*e+.0971045*n+.7141733*i)/ol)),new Bt(116*r-16,500*(o-r),200*(r-s),t.opacity)}function Rr(t,e,n,i){return arguments.length===1?ll(t):new Bt(t,e,n,i==null?1:i)}function Bt(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}sn(Bt,Rr,jn(fe,{brighter(t){return new Bt(this.l+Ci*(t==null?1:t),this.a,this.b,this.opacity)},darker(t){return new Bt(this.l-Ci*(t==null?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=il*nr(e),t=rl*nr(t),n=ol*nr(n),new gt(ir(3.1338561*e-1.6168667*t-.4906146*n),ir(-.9787684*e+1.9161415*t+.033454*n),ir(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function er(t){return t>af?Math.pow(t,1/3):t/al+sl}function nr(t){return t>$e?t*t*t:al*(t-sl)}function ir(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function rr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ul(t){if(t instanceof qt)return new qt(t.h,t.c,t.l,t.opacity);if(t instanceof Bt||(t=ll(t)),t.a===0&&t.b===0)return new qt(NaN,0=1?(n=1,e-1):Math.floor(n*e),r=t[i],o=t[i+1],s=i>0?t[i-1]:2*r-o,a=i()=>t;function fl(t,e){return function(n){return t+n*e}}function df(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function dl(t,e){var n=e-t;return n?fl(t,n>180||n<-180?n-360*Math.round(n/360):n):qi(isNaN(t)?e:t)}function gf(t){return(t=+t)==1?At:function(e,n){return n-e?df(e,n,t):qi(isNaN(e)?n:e)}}function At(t,e){var n=e-t;return n?fl(t,n):qi(isNaN(t)?e:t)}const In=function t(e){var n=gf(e);function i(r,o){var s=n((r=Mi(r)).r,(o=Mi(o)).r),a=n(r.g,o.g),l=n(r.b,o.b),u=At(r.opacity,o.opacity);return function(f){return r.r=s(f),r.g=a(f),r.b=l(f),r.opacity=u(f),r+""}}return i.gamma=t,i}(1);function pf(t){return function(e){var n=e.length,i=new Array(n),r=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(i=i[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:Ot(i,r)})),n=or.lastIndex;return n180?f+=360:f-u>180&&(u+=360),h.push({i:c.push(r(c)+"rotate(",null,i)-2,x:Ot(u,f)})):f&&c.push(r(c)+"rotate("+f+i)}function a(u,f,c,h){u!==f?h.push({i:c.push(r(c)+"skewX(",null,i)-2,x:Ot(u,f)}):f&&c.push(r(c)+"skewX("+f+i)}function l(u,f,c,h,d,p){if(u!==c||f!==h){var b=d.push(r(d)+"scale(",null,",",null,")");p.push({i:b-4,x:Ot(u,c)},{i:b-2,x:Ot(f,h)})}else(c!==1||h!==1)&&d.push(r(d)+"scale("+c+","+h+")")}return function(u,f){var c=[],h=[];return u=t(u),f=t(f),o(u.translateX,u.translateY,f.translateX,f.translateY,c,h),s(u.rotate,f.rotate,c,h),a(u.skewX,f.skewX,c,h),l(u.scaleX,u.scaleY,f.scaleX,f.scaleY,c,h),u=f=null,function(d){for(var p=-1,b=h.length,m;++pe&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function If(t,e,n){var i=t[0],r=t[1],o=e[0],s=e[1];return r2?Rf:If,l=u=null,c}function c(h){return h==null||isNaN(h=+h)?o:(l||(l=a(t.map(i),e,n)))(i(s(h)))}return c.invert=function(h){return s(r((u||(u=a(e,t.map(i),Ot)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,Wf),f()):t.slice()},c.range=function(h){return arguments.length?(e=Array.from(h),f()):e.slice()},c.rangeRound=function(h){return e=Array.from(h),n=ml,f()},c.clamp=function(h){return arguments.length?(s=h?!0:Et,f()):s!==Et},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(o=h,c):o},function(h,d){return i=h,r=d,f()}}function Ff(){return To()(Et,Et)}function Yf(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Li(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function je(t){return t=Li(Math.abs(t)),t?t[1]:NaN}function Vf(t,e){return function(n,i){for(var r=n.length,o=[],s=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(n.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function $f(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Uf=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Rn(t){if(!(e=Uf.exec(t)))throw new Error("invalid format: "+t);var e;return new So({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Rn.prototype=So.prototype;function So(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}So.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 Gf(t){t:for(var e=t.length,n=1,i=-1,r;n0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(r+1):t}var _l;function Zf(t,e){var n=Li(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(_l=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Li(t,Math.max(0,e+o-1))[0]}function ys(t,e){var n=Li(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const ws={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Yf,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ys(t*100,e),r:ys,s:Zf,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function vs(t){return t}var xs=Array.prototype.map,bs=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function qf(t){var e=t.grouping===void 0||t.thousands===void 0?vs:Vf(xs.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?vs:$f(xs.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"\u2212":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(c){c=Rn(c);var h=c.fill,d=c.align,p=c.sign,b=c.symbol,m=c.zero,g=c.width,x=c.comma,w=c.precision,y=c.trim,M=c.type;M==="n"?(x=!0,M="g"):ws[M]||(w===void 0&&(w=12),y=!0,M="g"),(m||h==="0"&&d==="=")&&(m=!0,h="0",d="=");var W=b==="$"?n:b==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",R=b==="$"?i:/[%p]/.test(M)?s:"",_=ws[M],V=/[defgprs%]/.test(M);w=w===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function L(C){var O=W,E=R,v,A,k;if(M==="c")E=_(C)+E,C="";else{C=+C;var S=C<0||1/C<0;if(C=isNaN(C)?l:_(Math.abs(C),w),y&&(C=Gf(C)),S&&+C==0&&p!=="+"&&(S=!1),O=(S?p==="("?p:a:p==="-"||p==="("?"":p)+O,E=(M==="s"?bs[8+_l/3]:"")+E+(S&&p==="("?")":""),V){for(v=-1,A=C.length;++vk||k>57){E=(k===46?r+C.slice(v+1):C.slice(v))+E,C=C.slice(0,v);break}}}x&&!m&&(C=e(C,1/0));var $=O.length+C.length+E.length,I=$>1)+O+C+E+I.slice($);break;default:C=I+O+C+E;break}return o(C)}return L.toString=function(){return c+""},L}function f(c,h){var d=u((c=Rn(c),c.type="f",c)),p=Math.max(-8,Math.min(8,Math.floor(je(h)/3)))*3,b=Math.pow(10,-p),m=bs[8+p/3];return function(g){return d(b*g)+m}}return{format:u,formatPrefix:f}}var si,Xi,kl;Xf({thousands:",",grouping:[3],currency:["$",""]});function Xf(t){return si=qf(t),Xi=si.format,kl=si.formatPrefix,si}function Bf(t){return Math.max(0,-je(Math.abs(t)))}function Hf(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(je(e)/3)))*3-je(Math.abs(t)))}function jf(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,je(e)-je(t))+1}function Kf(t,e,n,i){var r=ja(t,e,n),o;switch(i=Rn(i==null?",f":i),i.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(o=Hf(r,s))&&(i.precision=o),kl(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=jf(r,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=Bf(r))&&(i.precision=o-(i.type==="%")*2);break}}return Xi(i)}function Co(t){var e=t.domain;return t.ticks=function(n){var i=e();return zn(i[0],i[i.length-1],n==null?10:n)},t.tickFormat=function(n,i){var r=e();return Kf(r[0],r[r.length-1],n==null?10:n,i)},t.nice=function(n){n==null&&(n=10);var i=e(),r=0,o=i.length-1,s=i[r],a=i[o],l,u,f=10;for(a0;){if(u=Dn(s,a,n),u===l)return i[r]=s,i[o]=a,e(i);if(u>0)s=Math.floor(s/u)*u,a=Math.ceil(a/u)*u;else if(u<0)s=Math.ceil(s*u)/u,a=Math.floor(a*u)/u;else break;l=u}return t},t}function Ml(){var t=Ff();return t.copy=function(){return Mo(t,Ml())},Hn.apply(t,arguments),Co(t)}function Qf(t,e){t=t.slice();var n=0,i=t.length-1,r=t[n],o=t[i],s;return oMath.pow(t,e)}function i0(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function Ms(t){return(e,n)=>-t(-e,n)}function r0(t){const e=t(_s,ks),n=e.domain;let i=10,r,o;function s(){return r=i0(i),o=n0(i),n()[0]<0?(r=Ms(r),o=Ms(o),t(Jf,t0)):t(_s,ks),e}return e.base=function(a){return arguments.length?(i=+a,s()):i},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{const l=n();let u=l[0],f=l[l.length-1];const c=f0){for(;h<=d;++h)for(p=1;pf)break;g.push(b)}}else for(;h<=d;++h)for(p=i-1;p>=1;--p)if(b=h>0?p/o(-h):p*o(h),!(bf)break;g.push(b)}g.length*2{if(a==null&&(a=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=Rn(l)).precision==null&&(l.trim=!0),l=Xi(l)),a===1/0)return l;const u=Math.max(1,i*a/e.ticks().length);return f=>{let c=f/o(Math.round(r(f)));return c*in(Qf(n(),{floor:a=>o(Math.floor(r(a))),ceil:a=>o(Math.ceil(r(a)))})),e}function Tl(){const t=r0(To()).domain([1,10]);return t.copy=()=>Mo(t,Tl()).base(t.base()),Hn.apply(t,arguments),t}function Ts(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function o0(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function s0(t){return t<0?-t*t:t*t}function a0(t){var e=t(Et,Et),n=1;function i(){return n===1?t(Et,Et):n===.5?t(o0,s0):t(Ts(n),Ts(1/n))}return e.exponent=function(r){return arguments.length?(n=+r,i()):n},Co(e)}function Lo(){var t=a0(To());return t.copy=function(){return Mo(t,Lo()).exponent(t.exponent())},Hn.apply(t,arguments),t}function l0(){return Lo.apply(null,arguments).exponent(.5)}const sr=new Date,ar=new Date;function Ht(t,e,n,i){function r(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return r.floor=o=>(t(o=new Date(+o)),o),r.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),r.round=o=>{const s=r(o),a=r.ceil(o);return o-s(e(o=new Date(+o),s==null?1:Math.floor(s)),o),r.range=(o,s,a)=>{const l=[];if(o=r.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let u;do l.push(u=new Date(+o)),e(o,a),t(o);while(uHt(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(r.count=(o,s)=>(sr.setTime(+o),ar.setTime(+s),t(sr),t(ar),Math.floor(n(sr,ar))),r.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?r.filter(i?s=>i(s)%o===0:s=>r.count(0,s)%o===0):r)),r}const u0=1e3,No=u0*60,c0=No*60,Fn=c0*24,Sl=Fn*7,Ao=Ht(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*No)/Fn,t=>t.getDate()-1);Ao.range;const Po=Ht(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Fn,t=>t.getUTCDate()-1);Po.range;const h0=Ht(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Fn,t=>Math.floor(t/Fn));h0.range;function Ne(t){return Ht(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*No)/Sl)}const Cl=Ne(0),Ni=Ne(1),f0=Ne(2),d0=Ne(3),Ke=Ne(4),g0=Ne(5),p0=Ne(6);Cl.range;Ni.range;f0.range;d0.range;Ke.range;g0.range;p0.range;function Ae(t){return Ht(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Sl)}const Ll=Ae(0),Ai=Ae(1),m0=Ae(2),y0=Ae(3),Qe=Ae(4),w0=Ae(5),v0=Ae(6);Ll.range;Ai.range;m0.range;y0.range;Qe.range;w0.range;v0.range;const Me=Ht(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Me.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ht(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Me.range;const Te=Ht(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Te.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ht(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});Te.range;function lr(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ur(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function cn(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function x0(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,u=hn(r),f=fn(r),c=hn(o),h=fn(o),d=hn(s),p=fn(s),b=hn(a),m=fn(a),g=hn(l),x=fn(l),w={a:S,A:$,b:I,B:T,c:null,d:Ps,e:Ps,f:U0,g:J0,G:e1,H:Y0,I:V0,j:$0,L:Nl,m:G0,M:Z0,p:F,q:U,Q:Ds,s:Ws,S:q0,u:X0,U:B0,V:H0,w:j0,W:K0,x:null,X:null,y:Q0,Y:t1,Z:n1,"%":zs},y={a:ot,A:H,b:at,B:ut,c:null,d:Es,e:Es,f:s1,g:m1,G:w1,H:i1,I:r1,j:o1,L:Pl,m:a1,M:l1,p:K,q:Q,Q:Ds,s:Ws,S:u1,u:c1,U:h1,V:f1,w:d1,W:g1,x:null,X:null,y:p1,Y:y1,Z:v1,"%":zs},M={a:L,A:C,b:O,B:E,c:v,d:Ns,e:Ns,f:O0,g:Ls,G:Cs,H:As,I:As,j:E0,L:W0,m:P0,M:z0,p:V,q:A0,Q:R0,s:F0,S:D0,u:T0,U:S0,V:C0,w:M0,W:L0,x:A,X:k,y:Ls,Y:Cs,Z:N0,"%":I0};w.x=W(n,w),w.X=W(i,w),w.c=W(e,w),y.x=W(n,y),y.X=W(i,y),y.c=W(e,y);function W(Y,X){return function(et){var z=[],nt=-1,q=0,ct=Y.length,ft,j,it;for(et instanceof Date||(et=new Date(+et));++nt53)return null;"w"in z||(z.w=1),"Z"in z?(q=ur(cn(z.y,0,1)),ct=q.getUTCDay(),q=ct>4||ct===0?Ai.ceil(q):Ai(q),q=Po.offset(q,(z.V-1)*7),z.y=q.getUTCFullYear(),z.m=q.getUTCMonth(),z.d=q.getUTCDate()+(z.w+6)%7):(q=lr(cn(z.y,0,1)),ct=q.getDay(),q=ct>4||ct===0?Ni.ceil(q):Ni(q),q=Ao.offset(q,(z.V-1)*7),z.y=q.getFullYear(),z.m=q.getMonth(),z.d=q.getDate()+(z.w+6)%7)}else("W"in z||"U"in z)&&("w"in z||(z.w="u"in z?z.u%7:"W"in z?1:0),ct="Z"in z?ur(cn(z.y,0,1)).getUTCDay():lr(cn(z.y,0,1)).getDay(),z.m=0,z.d="W"in z?(z.w+6)%7+z.W*7-(ct+5)%7:z.w+z.U*7-(ct+6)%7);return"Z"in z?(z.H+=z.Z/100|0,z.M+=z.Z%100,ur(z)):lr(z)}}function _(Y,X,et,z){for(var nt=0,q=X.length,ct=et.length,ft,j;nt=ct)return-1;if(ft=X.charCodeAt(nt++),ft===37){if(ft=X.charAt(nt++),j=M[ft in Ss?X.charAt(nt++):ft],!j||(z=j(Y,et,z))<0)return-1}else if(ft!=et.charCodeAt(z++))return-1}return z}function V(Y,X,et){var z=u.exec(X.slice(et));return z?(Y.p=f.get(z[0].toLowerCase()),et+z[0].length):-1}function L(Y,X,et){var z=d.exec(X.slice(et));return z?(Y.w=p.get(z[0].toLowerCase()),et+z[0].length):-1}function C(Y,X,et){var z=c.exec(X.slice(et));return z?(Y.w=h.get(z[0].toLowerCase()),et+z[0].length):-1}function O(Y,X,et){var z=g.exec(X.slice(et));return z?(Y.m=x.get(z[0].toLowerCase()),et+z[0].length):-1}function E(Y,X,et){var z=b.exec(X.slice(et));return z?(Y.m=m.get(z[0].toLowerCase()),et+z[0].length):-1}function v(Y,X,et){return _(Y,e,X,et)}function A(Y,X,et){return _(Y,n,X,et)}function k(Y,X,et){return _(Y,i,X,et)}function S(Y){return s[Y.getDay()]}function $(Y){return o[Y.getDay()]}function I(Y){return l[Y.getMonth()]}function T(Y){return a[Y.getMonth()]}function F(Y){return r[+(Y.getHours()>=12)]}function U(Y){return 1+~~(Y.getMonth()/3)}function ot(Y){return s[Y.getUTCDay()]}function H(Y){return o[Y.getUTCDay()]}function at(Y){return l[Y.getUTCMonth()]}function ut(Y){return a[Y.getUTCMonth()]}function K(Y){return r[+(Y.getUTCHours()>=12)]}function Q(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var X=W(Y+="",w);return X.toString=function(){return Y},X},parse:function(Y){var X=R(Y+="",!1);return X.toString=function(){return Y},X},utcFormat:function(Y){var X=W(Y+="",y);return X.toString=function(){return Y},X},utcParse:function(Y){var X=R(Y+="",!0);return X.toString=function(){return Y},X}}}var Ss={"-":"",_:" ",0:"0"},mt=/^\s*\d+/,b0=/^%/,_0=/[\\^$*+?|[\]().{}]/g;function st(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o[e.toLowerCase(),n]))}function M0(t,e,n){var i=mt.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function T0(t,e,n){var i=mt.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function S0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function C0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function L0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Cs(t,e,n){var i=mt.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Ls(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function N0(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function A0(t,e,n){var i=mt.exec(e.slice(n,n+1));return i?(t.q=i[0]*3-3,n+i[0].length):-1}function P0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Ns(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function E0(t,e,n){var i=mt.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function As(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function z0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function D0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function W0(t,e,n){var i=mt.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function O0(t,e,n){var i=mt.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function I0(t,e,n){var i=b0.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function R0(t,e,n){var i=mt.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function F0(t,e,n){var i=mt.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Ps(t,e){return st(t.getDate(),e,2)}function Y0(t,e){return st(t.getHours(),e,2)}function V0(t,e){return st(t.getHours()%12||12,e,2)}function $0(t,e){return st(1+Ao.count(Me(t),t),e,3)}function Nl(t,e){return st(t.getMilliseconds(),e,3)}function U0(t,e){return Nl(t,e)+"000"}function G0(t,e){return st(t.getMonth()+1,e,2)}function Z0(t,e){return st(t.getMinutes(),e,2)}function q0(t,e){return st(t.getSeconds(),e,2)}function X0(t){var e=t.getDay();return e===0?7:e}function B0(t,e){return st(Cl.count(Me(t)-1,t),e,2)}function Al(t){var e=t.getDay();return e>=4||e===0?Ke(t):Ke.ceil(t)}function H0(t,e){return t=Al(t),st(Ke.count(Me(t),t)+(Me(t).getDay()===4),e,2)}function j0(t){return t.getDay()}function K0(t,e){return st(Ni.count(Me(t)-1,t),e,2)}function Q0(t,e){return st(t.getFullYear()%100,e,2)}function J0(t,e){return t=Al(t),st(t.getFullYear()%100,e,2)}function t1(t,e){return st(t.getFullYear()%1e4,e,4)}function e1(t,e){var n=t.getDay();return t=n>=4||n===0?Ke(t):Ke.ceil(t),st(t.getFullYear()%1e4,e,4)}function n1(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+st(e/60|0,"0",2)+st(e%60,"0",2)}function Es(t,e){return st(t.getUTCDate(),e,2)}function i1(t,e){return st(t.getUTCHours(),e,2)}function r1(t,e){return st(t.getUTCHours()%12||12,e,2)}function o1(t,e){return st(1+Po.count(Te(t),t),e,3)}function Pl(t,e){return st(t.getUTCMilliseconds(),e,3)}function s1(t,e){return Pl(t,e)+"000"}function a1(t,e){return st(t.getUTCMonth()+1,e,2)}function l1(t,e){return st(t.getUTCMinutes(),e,2)}function u1(t,e){return st(t.getUTCSeconds(),e,2)}function c1(t){var e=t.getUTCDay();return e===0?7:e}function h1(t,e){return st(Ll.count(Te(t)-1,t),e,2)}function El(t){var e=t.getUTCDay();return e>=4||e===0?Qe(t):Qe.ceil(t)}function f1(t,e){return t=El(t),st(Qe.count(Te(t),t)+(Te(t).getUTCDay()===4),e,2)}function d1(t){return t.getUTCDay()}function g1(t,e){return st(Ai.count(Te(t)-1,t),e,2)}function p1(t,e){return st(t.getUTCFullYear()%100,e,2)}function m1(t,e){return t=El(t),st(t.getUTCFullYear()%100,e,2)}function y1(t,e){return st(t.getUTCFullYear()%1e4,e,4)}function w1(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Qe(t):Qe.ceil(t),st(t.getUTCFullYear()%1e4,e,4)}function v1(){return"+0000"}function zs(){return"%"}function Ds(t){return+t}function Ws(t){return Math.floor(+t/1e3)}var Pe,zl;x1({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function x1(t){return Pe=x0(t),zl=Pe.format,Pe.parse,Pe.utcFormat,Pe.utcParse,Pe}function b1(){var t=0,e=1,n,i,r,o,s=Et,a=!1,l;function u(c){return c==null||isNaN(c=+c)?l:s(r===0?.5:(c=(o(c)-n)*r,a?Math.max(0,Math.min(1,c)):c))}u.domain=function(c){return arguments.length?([t,e]=c,n=o(t=+t),i=o(e=+e),r=n===i?0:1/(i-n),u):[t,e]},u.clamp=function(c){return arguments.length?(a=!!c,u):a},u.interpolator=function(c){return arguments.length?(s=c,u):s};function f(c){return function(h){var d,p;return arguments.length?([d,p]=h,s=c(d,p),u):[s(0),s(1)]}}return u.range=f(an),u.rangeRound=f(ml),u.unknown=function(c){return arguments.length?(l=c,u):l},function(c){return o=c,n=c(t),i=c(e),r=n===i?0:1/(i-n),u}}function _1(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Dl(){var t=Co(b1()(Et));return t.copy=function(){return _1(t,Dl())},Bh.apply(t,arguments)}function Eo(t){for(var e=t.length/6|0,n=new Array(e),i=0;igl(t[t.length-1]);var S1=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Eo);const C1=T1(S1);bl(he(-100,.75,.35),he(80,1.5,.8));bl(he(260,.75,.35),he(80,1.5,.8));var ai=he();function L1(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return ai.h=360*t-100,ai.s=1.5-1.5*e,ai.l=.8-.9*e,ai+""}var Je=0,_n=0,dn=0,Wl=1e3,Pi,kn,Ei=0,Se=0,Bi=0,Yn=typeof performance=="object"&&performance.now?performance:Date,Ol=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function zo(){return Se||(Ol(N1),Se=Yn.now()+Bi)}function N1(){Se=0}function zi(){this._call=this._time=this._next=null}zi.prototype=Il.prototype={constructor:zi,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?zo():+n)+(e==null?0:+e),!this._next&&kn!==this&&(kn?kn._next=this:Pi=this,kn=this),this._call=t,this._time=n,$r()},stop:function(){this._call&&(this._call=null,this._time=1/0,$r())}};function Il(t,e,n){var i=new zi;return i.restart(t,e,n),i}function A1(){zo(),++Je;for(var t=Pi,e;t;)(e=Se-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Je}function Os(){Se=(Ei=Yn.now())+Bi,Je=_n=0;try{A1()}finally{Je=0,E1(),Se=0}}function P1(){var t=Yn.now(),e=t-Ei;e>Wl&&(Bi-=e,Ei=t)}function E1(){for(var t,e=Pi,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Pi=n);kn=t,$r(i)}function $r(t){if(!Je){_n&&(_n=clearTimeout(_n));var e=t-Se;e>24?(t<1/0&&(_n=setTimeout(Os,t-Yn.now()-Bi)),dn&&(dn=clearInterval(dn))):(dn||(Ei=Yn.now(),dn=setInterval(P1,Wl)),Je=1,Ol(Os))}}function Ur(t,e,n){var i=new zi;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}var z1={value:()=>{}};function Kn(){for(var t=0,e=arguments.length,n={},i;t=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}mi.prototype=Kn.prototype={constructor:mi,on:function(t,e){var n=this._,i=D1(t+"",n),r,o=-1,s=i.length;if(arguments.length<2){for(;++o0)for(var n=new Array(r),i=0,r,o;iRl)throw new Error("too late; already scheduled");return n}function jt(t,e){var n=Vt(t,e);if(n.state>yi)throw new Error("too late; already running");return n}function Vt(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function R1(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=Il(o,0,n.time);function o(u){n.state=Rs,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var f,c,h,d;if(n.state!==Rs)return l();for(f in i)if(d=i[f],d.name===n.name){if(d.state===yi)return Ur(s);d.state===Fs?(d.state=wi,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[f]):+fGr&&i.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function gd(t,e,n){var i,r,o=dd(e)?Do:jt;return function(){var s=o(this,t),a=s.on;a!==i&&(r=(i=a).copy()).on(e,n),s.on=r}}function pd(t,e){var n=this._id;return arguments.length<2?Vt(this.node(),n).on.on(t):this.each(gd(n,t,e))}function md(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function yd(){return this.on("end.remove",md(this._id))}function wd(t){var e=this._name,n=this._id;typeof t!="function"&&(t=mo(t));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s+t;function Yd(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function Ul(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Oo=3;(function t(e){e=+e;function n(i){return Math.pow(i,e)}return n.exponent=t,n})(Oo);(function t(e){e=+e;function n(i){return 1-Math.pow(1-i,e)}return n.exponent=t,n})(Oo);var Vd=function t(e){e=+e;function n(i){return((i*=2)<=1?Math.pow(i,e):2-Math.pow(2-i,e))/2}return n.exponent=t,n}(Oo);function Di(t){return(Math.pow(2,-10*t)-.0009765625)*1.0009775171065494}var tn=2*Math.PI,Io=1,Ro=.3;(function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=tn);function r(o){return e*Di(- --o)*Math.sin((i-o)/n)}return r.amplitude=function(o){return t(o,n*tn)},r.period=function(o){return t(e,o)},r})(Io,Ro);var $d=function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=tn);function r(o){return 1-e*Di(o=+o)*Math.sin((o+i)/n)}return r.amplitude=function(o){return t(o,n*tn)},r.period=function(o){return t(e,o)},r}(Io,Ro);(function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=tn);function r(o){return((o=o*2-1)<0?e*Di(-o)*Math.sin((i-o)/n):2-e*Di(o)*Math.sin((i+o)/n))/2}return r.amplitude=function(o){return t(o,n*tn)},r.period=function(o){return t(e,o)},r})(Io,Ro);var Ud={time:null,delay:0,duration:250,ease:Ul};function Gd(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Zd(t){var e,n;t instanceof ae?(e=t._id,t=t._name):(e=$l(),(n=Ud).time=zo(),t=t==null?null:t+"");for(var i=this._groups,r=i.length,o=0;o+t(e)}function jd(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Kd(){return!this.__axis}function Gl(t,e){var n=[],i=null,r=null,o=6,s=6,a=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===cr||t===Mn?-1:1,f=t===Mn||t===hr?"x":"y",c=t===cr||t===qr?Xd:Bd;function h(d){var p=i==null?e.ticks?e.ticks.apply(e,n):e.domain():i,b=r==null?e.tickFormat?e.tickFormat.apply(e,n):qd:r,m=Math.max(o,0)+a,g=e.range(),x=+g[0]+l,w=+g[g.length-1]+l,y=(e.bandwidth?jd:Hd)(e.copy(),l),M=d.selection?d.selection():d,W=M.selectAll(".domain").data([null]),R=M.selectAll(".tick").data(p,e).order(),_=R.exit(),V=R.enter().append("g").attr("class","tick"),L=R.select("line"),C=R.select("text");W=W.merge(W.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),R=R.merge(V),L=L.merge(V.append("line").attr("stroke","currentColor").attr(f+"2",u*o)),C=C.merge(V.append("text").attr("fill","currentColor").attr(f,u*m).attr("dy",t===cr?"0em":t===qr?"0.71em":"0.32em")),d!==M&&(W=W.transition(d),R=R.transition(d),L=L.transition(d),C=C.transition(d),_=_.transition(d).attr("opacity",Ys).attr("transform",function(O){return isFinite(O=y(O))?c(O+l):this.getAttribute("transform")}),V.attr("opacity",Ys).attr("transform",function(O){var E=this.parentNode.__axis;return c((E&&isFinite(E=E(O))?E:y(O))+l)})),_.remove(),W.attr("d",t===Mn||t===hr?s?"M"+u*s+","+x+"H"+l+"V"+w+"H"+u*s:"M"+l+","+x+"V"+w:s?"M"+x+","+u*s+"V"+l+"H"+w+"V"+u*s:"M"+x+","+l+"H"+w),R.attr("opacity",1).attr("transform",function(O){return c(y(O)+l)}),L.attr(f+"2",u*o),C.attr(f,u*m).text(b),M.filter(Kd).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===hr?"start":t===Mn?"end":"middle"),M.each(function(){this.__axis=y})}return h.scale=function(d){return arguments.length?(e=d,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(i=d==null?null:Array.from(d),h):i&&i.slice()},h.tickFormat=function(d){return arguments.length?(r=d,h):r},h.tickSize=function(d){return arguments.length?(o=s=+d,h):o},h.tickSizeInner=function(d){return arguments.length?(o=+d,h):o},h.tickSizeOuter=function(d){return arguments.length?(s=+d,h):s},h.tickPadding=function(d){return arguments.length?(a=+d,h):a},h.offset=function(d){return arguments.length?(l=+d,h):l},h}function Qd(t){return Gl(qr,t)}function Jd(t){return Gl(Mn,t)}const Xr=Math.PI,Br=2*Xr,we=1e-6,tg=Br-we;function Hr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Qn(){return new Hr}Hr.prototype=Qn.prototype={constructor:Hr,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,s=this._y1,a=n-t,l=i-e,u=o-t,f=s-e,c=u*u+f*f;if(r<0)throw new Error("negative radius: "+r);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(c>we)if(!(Math.abs(f*a-l*u)>we)||!r)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var h=n-o,d=i-s,p=a*a+l*l,b=h*h+d*d,m=Math.sqrt(p),g=Math.sqrt(c),x=r*Math.tan((Xr-Math.acos((p+c-b)/(2*m*g)))/2),w=x/g,y=x/m;Math.abs(w-1)>we&&(this._+="L"+(t+w*u)+","+(e+w*f)),this._+="A"+r+","+r+",0,0,"+ +(f*h>u*d)+","+(this._x1=t+y*a)+","+(this._y1=e+y*l)}},arc:function(t,e,n,i,r,o){t=+t,e=+e,n=+n,o=!!o;var s=n*Math.cos(i),a=n*Math.sin(i),l=t+s,u=e+a,f=1^o,c=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>we||Math.abs(this._y1-u)>we)&&(this._+="L"+l+","+u),n&&(c<0&&(c=c%Br+Br),c>tg?this._+="A"+n+","+n+",0,1,"+f+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+f+","+(this._x1=l)+","+(this._y1=u):c>we&&(this._+="A"+n+","+n+",0,"+ +(c>=Xr)+","+f+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};function xt(t){return function(){return t}}const Vs=Math.abs,yt=Math.atan2,me=Math.cos,eg=Math.max,fr=Math.min,Ut=Math.sin,Re=Math.sqrt,Ct=1e-12,Vn=Math.PI,Wi=Vn/2,ng=2*Vn;function ig(t){return t>1?0:t<-1?Vn:Math.acos(t)}function $s(t){return t>=1?Wi:t<=-1?-Wi:Math.asin(t)}function rg(t){return t.innerRadius}function og(t){return t.outerRadius}function sg(t){return t.startAngle}function ag(t){return t.endAngle}function lg(t){return t&&t.padAngle}function ug(t,e,n,i,r,o,s,a){var l=n-t,u=i-e,f=s-r,c=a-o,h=c*l-f*u;if(!(h*hv*v+A*A&&(_=L,V=C),{cx:_,cy:V,x01:-f,y01:-c,x11:_*(r/M-1),y11:V*(r/M-1)}}function cg(){var t=rg,e=og,n=xt(0),i=null,r=sg,o=ag,s=lg,a=null;function l(){var u,f,c=+t.apply(this,arguments),h=+e.apply(this,arguments),d=r.apply(this,arguments)-Wi,p=o.apply(this,arguments)-Wi,b=Vs(p-d),m=p>d;if(a||(a=u=Qn()),hCt))a.moveTo(0,0);else if(b>ng-Ct)a.moveTo(h*me(d),h*Ut(d)),a.arc(0,0,h,d,p,!m),c>Ct&&(a.moveTo(c*me(p),c*Ut(p)),a.arc(0,0,c,p,d,m));else{var g=d,x=p,w=d,y=p,M=b,W=b,R=s.apply(this,arguments)/2,_=R>Ct&&(i?+i.apply(this,arguments):Re(c*c+h*h)),V=fr(Vs(h-c)/2,+n.apply(this,arguments)),L=V,C=V,O,E;if(_>Ct){var v=$s(_/c*Ut(R)),A=$s(_/h*Ut(R));(M-=v*2)>Ct?(v*=m?1:-1,w+=v,y-=v):(M=0,w=y=(d+p)/2),(W-=A*2)>Ct?(A*=m?1:-1,g+=A,x-=A):(W=0,g=x=(d+p)/2)}var k=h*me(g),S=h*Ut(g),$=c*me(y),I=c*Ut(y);if(V>Ct){var T=h*me(x),F=h*Ut(x),U=c*me(w),ot=c*Ut(w),H;if(bCt?C>Ct?(O=li(U,ot,k,S,h,C,m),E=li(T,F,$,I,h,C,m),a.moveTo(O.cx+O.x01,O.cy+O.y01),CCt)||!(M>Ct)?a.lineTo($,I):L>Ct?(O=li($,I,T,F,c,-L,m),E=li(k,S,U,ot,c,-L,m),a.lineTo(O.cx+O.x01,O.cy+O.y01),L=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Mg(t){return new Jl(t,1)}function Tg(t){var e=0,n=t.children,i=n&&n.length;if(!i)e=1;else for(;--i>=0;)e+=n[i].value;t.value=e}function Sg(){return this.eachAfter(Tg)}function Cg(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this}function Lg(t,e){for(var n=this,i=[n],r,o,s=-1;n=i.pop();)if(t.call(e,n,++s,this),r=n.children)for(o=r.length-1;o>=0;--o)i.push(r[o]);return this}function Ng(t,e){for(var n=this,i=[n],r=[],o,s,a,l=-1;n=i.pop();)if(r.push(n),o=n.children)for(s=0,a=o.length;s=0;)n+=i[r].value;e.value=n})}function Eg(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function zg(t){for(var e=this,n=Dg(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i}function Dg(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}function Wg(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Og(){return Array.from(this)}function Ig(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Rg(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*Fg(){var t=this,e,n=[t],i,r,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,i=t.children)for(r=0,o=i.length;r=0;--a)r.push(o=s[a]=new $n(s[a])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(Gg)}function Yg(){return Fo(this).eachBefore(Ug)}function Vg(t){return t.children}function $g(t){return Array.isArray(t)?t[1]:null}function Ug(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Gg(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function $n(t){this.data=t,this.depth=this.height=0,this.parent=null}$n.prototype=Fo.prototype={constructor:$n,count:Sg,each:Cg,eachAfter:Ng,eachBefore:Lg,find:Ag,sum:Pg,sort:Eg,path:zg,ancestors:Wg,descendants:Og,leaves:Ig,links:Rg,copy:Yg,[Symbol.iterator]:Fg};function Zg(t){return t==null?null:qg(t)}function qg(t){if(typeof t!="function")throw new Error;return t}function Xs(){return 0}function Xg(t){return function(){return t}}const Bg=1664525,Hg=1013904223,Bs=4294967296;function jg(){let t=1;return()=>(t=(Bg*t+Hg)%Bs)/Bs}function Kg(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Qg(t,e){let n=t.length,i,r;for(;n;)r=e()*n--|0,i=t[n],t[n]=t[r],t[r]=i;return t}function Jg(t,e){for(var n=0,i=(t=Qg(Array.from(t),e)).length,r=[],o,s;n0&&n*n>i*i+r*r}function gr(t,e){for(var n=0;n1e-6?(C+Math.sqrt(C*C-4*L*O))/(2*L):O/C);return{x:i+W+R*E,y:r+_+V*E,r:E}}function Hs(t,e,n){var i=t.x-e.x,r,o,s=t.y-e.y,a,l,u=i*i+s*s;u?(o=e.r+n.r,o*=o,l=t.r+n.r,l*=l,o>l?(r=(u+l-o)/(2*u),a=Math.sqrt(Math.max(0,l/u-r*r)),n.x=t.x-r*i-a*s,n.y=t.y-r*s+a*i):(r=(u+o-l)/(2*u),a=Math.sqrt(Math.max(0,o/u-r*r)),n.x=e.x+r*i-a*s,n.y=e.y+r*s+a*i)):(n.x=e.x+n.r,n.y=e.y)}function js(t,e){var n=t.r+e.r-1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function Ks(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,o=(e.y*n.r+n.y*e.r)/i;return r*r+o*o}function ci(t){this._=t,this.next=null,this.previous=null}function ip(t,e){if(!(o=(t=Kg(t)).length))return 0;var n,i,r,o,s,a,l,u,f,c,h;if(n=t[0],n.x=0,n.y=0,!(o>1))return n.r;if(i=t[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;Hs(i,n,r=t[2]),n=new ci(n),i=new ci(i),r=new ci(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;t:for(l=3;l=0;)o=i[r],o.z+=e,o.m+=e,e+=o.s+(n+=o.c)}function fp(t,e,n){return t.a.parent===e.parent?t.a:n}function vi(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}vi.prototype=Object.create($n.prototype);function dp(t){for(var e=new vi(t,0),n,i=[e],r,o,s,a;n=i.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)i.push(r=n.children[s]=new vi(o[s],s)),r.parent=n;return(e.parent=new vi(null,0)).children=[e],e}function gp(){var t=up,e=1,n=1,i=null;function r(u){var f=dp(u);if(f.eachAfter(o),f.parent.m=-f.z,f.eachBefore(s),i)u.eachBefore(l);else{var c=u,h=u,d=u;u.eachBefore(function(x){x.xh.x&&(h=x),x.depth>d.depth&&(d=x)});var p=c===h?1:t(c,h)/2,b=p-c.x,m=e/(h.x+p+b),g=n/(d.depth||1);u.eachBefore(function(x){x.x=(x.x+b)*m,x.y=x.depth*g})}return u}function o(u){var f=u.children,c=u.parent.children,h=u.i?c[u.i-1]:null;if(f){hp(u);var d=(f[0].z+f[f.length-1].z)/2;h?(u.z=h.z+t(u._,h._),u.m=u.z-d):u.z=d}else h&&(u.z=h.z+t(u._,h._));u.parent.A=a(u,h,u.parent.A||c[0])}function s(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function a(u,f,c){if(f){for(var h=u,d=u,p=f,b=h.parent.children[0],m=h.m,g=d.m,x=p.m,w=b.m,y;p=yr(p),h=mr(h),p&&h;)b=mr(b),d=yr(d),d.a=u,y=p.z+x-h.z-m+t(p._,h._),y>0&&(cp(fp(p,u,c),u,y),m+=y,g+=y),x+=p.m,m+=h.m,w+=b.m,g+=d.m;p&&!yr(d)&&(d.t=p,d.m+=x-g),h&&!mr(b)&&(b.t=h,b.m+=m-w,c=u)}return c}function l(u){u.x*=e,u.y=u.depth*n}return r.separation=function(u){return arguments.length?(t=u,r):t},r.size=function(u){return arguments.length?(i=!1,e=+u[0],n=+u[1],r):i?null:[e,n]},r.nodeSize=function(u){return arguments.length?(i=!0,e=+u[0],n=+u[1],r):i?[e,n]:null},r}const pp={passive:!1},Un={capture:!0,passive:!1};function wr(t){t.stopImmediatePropagation()}function Ge(t){t.preventDefault(),t.stopImmediatePropagation()}function Yo(t){var e=t.document.documentElement,n=kt(t).on("dragstart.drag",Ge,Un);"onselectstart"in e?n.on("selectstart.drag",Ge,Un):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Vo(t,e){var n=t.document.documentElement,i=kt(t).on("dragstart.drag",null);e&&(i.on("click.drag",Ge,Un),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const hi=t=>()=>t;function jr(t,{sourceEvent:e,subject:n,target:i,identifier:r,active:o,x:s,y:a,dx:l,dy:u,dispatch:f}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:f}})}jr.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function mp(t){return!t.ctrlKey&&!t.button}function yp(){return this.parentNode}function wp(t,e){return e==null?{x:t.x,y:t.y}:e}function vp(){return navigator.maxTouchPoints||"ontouchstart"in this}function xp(){var t=mp,e=yp,n=wp,i=vp,r={},o=Kn("start","drag","end"),s=0,a,l,u,f,c=0;function h(y){y.on("mousedown.drag",d).filter(i).on("touchstart.drag",m).on("touchmove.drag",g,pp).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(y,M){if(!(f||!t.call(this,y,M))){var W=w(this,e.call(this,y,M),y,M,"mouse");!W||(kt(y.view).on("mousemove.drag",p,Un).on("mouseup.drag",b,Un),Yo(y.view),wr(y),u=!1,a=y.clientX,l=y.clientY,W("start",y))}}function p(y){if(Ge(y),!u){var M=y.clientX-a,W=y.clientY-l;u=M*M+W*W>c}r.mouse("drag",y)}function b(y){kt(y.view).on("mousemove.drag mouseup.drag",null),Vo(y.view,u),Ge(y),r.mouse("end",y)}function m(y,M){if(!!t.call(this,y,M)){var W=y.changedTouches,R=e.call(this,y,M),_=W.length,V,L;for(V=0;V<_;++V)(L=w(this,R,y,M,W[V].identifier,W[V]))&&(wr(y),L("start",y,W[V]))}}function g(y){var M=y.changedTouches,W=M.length,R,_;for(R=0;R()=>t;function bp(t,{sourceEvent:e,target:n,selection:i,mode:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function _p(t){t.stopImmediatePropagation()}function xr(t){t.preventDefault(),t.stopImmediatePropagation()}var ta={name:"drag"},br={name:"space"},Ee={name:"handle"},ze={name:"center"};const{abs:ea,max:wt,min:vt}=Math;function na(t){return[+t[0],+t[1]]}function Kr(t){return[na(t[0]),na(t[1])]}var _r={name:"x",handles:["w","e"].map(Gn),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},kr={name:"y",handles:["n","s"].map(Gn),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},kp={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Gn),input:function(t){return t==null?null:Kr(t)},output:function(t){return t}},ne={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ia={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},ra={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Mp={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Tp={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Gn(t){return{type:t}}function Sp(t){return!t.ctrlKey&&!t.button}function Cp(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Lp(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mr(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Np(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Ap(){return Pp(kp)}function Pp(t){var e=Cp,n=Sp,i=Lp,r=!0,o=Kn("start","brush","end"),s=6,a;function l(m){var g=m.property("__brush",b).selectAll(".overlay").data([Gn("overlay")]);g.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ne.overlay).merge(g).each(function(){var w=Mr(this).extent;kt(this).attr("x",w[0][0]).attr("y",w[0][1]).attr("width",w[1][0]-w[0][0]).attr("height",w[1][1]-w[0][1])}),m.selectAll(".selection").data([Gn("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ne.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var x=m.selectAll(".handle").data(t.handles,function(w){return w.type});x.exit().remove(),x.enter().append("rect").attr("class",function(w){return"handle handle--"+w.type}).attr("cursor",function(w){return ne[w.type]}),m.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,g,x){m.tween?m.on("start.brush",function(w){f(this,arguments).beforestart().start(w)}).on("interrupt.brush end.brush",function(w){f(this,arguments).end(w)}).tween("brush",function(){var w=this,y=w.__brush,M=f(w,arguments),W=y.selection,R=t.input(typeof g=="function"?g.apply(this,arguments):g,y.extent),_=an(W,R);function V(L){y.selection=L===1&&R===null?null:_(L),u.call(w),M.brush()}return W!==null&&R!==null?V:V(1)}):m.each(function(){var w=this,y=arguments,M=w.__brush,W=t.input(typeof g=="function"?g.apply(w,y):g,M.extent),R=f(w,y).beforestart();Ue(w),M.selection=W===null?null:W,u.call(w),R.start(x).brush(x).end(x)})},l.clear=function(m,g){l.move(m,null,g)};function u(){var m=kt(this),g=Mr(this).selection;g?(m.selectAll(".selection").style("display",null).attr("x",g[0][0]).attr("y",g[0][1]).attr("width",g[1][0]-g[0][0]).attr("height",g[1][1]-g[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(x){return x.type[x.type.length-1]==="e"?g[1][0]-s/2:g[0][0]-s/2}).attr("y",function(x){return x.type[0]==="s"?g[1][1]-s/2:g[0][1]-s/2}).attr("width",function(x){return x.type==="n"||x.type==="s"?g[1][0]-g[0][0]+s:s}).attr("height",function(x){return x.type==="e"||x.type==="w"?g[1][1]-g[0][1]+s:s})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function f(m,g,x){var w=m.__brush.emitter;return w&&(!x||!w.clean)?w:new c(m,g,x)}function c(m,g,x){this.that=m,this.args=g,this.state=m.__brush,this.active=0,this.clean=x}c.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,g){return this.starting?(this.starting=!1,this.emit("start",m,g)):this.emit("brush",m),this},brush:function(m,g){return this.emit("brush",m,g),this},end:function(m,g){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,g)),this},emit:function(m,g,x){var w=kt(this.that).datum();o.call(m,this.that,new bp(m,{sourceEvent:g,target:l,selection:t.output(this.state.selection),mode:x,dispatch:o}),w)}};function h(m){if(a&&!m.touches||!n.apply(this,arguments))return;var g=this,x=m.target.__data__.type,w=(r&&m.metaKey?x="overlay":x)==="selection"?ta:r&&m.altKey?ze:Ee,y=t===kr?null:Mp[x],M=t===_r?null:Tp[x],W=Mr(g),R=W.extent,_=W.selection,V=R[0][0],L,C,O=R[0][1],E,v,A=R[1][0],k,S,$=R[1][1],I,T,F=0,U=0,ot,H=y&&M&&r&&m.shiftKey,at,ut,K=Array.from(m.touches||[m],j=>{const it=j.identifier;return j=Wt(j,g),j.point0=j.slice(),j.identifier=it,j});Ue(g);var Q=f(g,arguments,!0).beforestart();if(x==="overlay"){_&&(ot=!0);const j=[K[0],K[1]||K[0]];W.selection=_=[[L=t===kr?V:vt(j[0][0],j[1][0]),E=t===_r?O:vt(j[0][1],j[1][1])],[k=t===kr?A:wt(j[0][0],j[1][0]),I=t===_r?$:wt(j[0][1],j[1][1])]],K.length>1&&nt(m)}else L=_[0][0],E=_[0][1],k=_[1][0],I=_[1][1];C=L,v=E,S=k,T=I;var Y=kt(g).attr("pointer-events","none"),X=Y.selectAll(".overlay").attr("cursor",ne[x]);if(m.touches)Q.moved=z,Q.ended=q;else{var et=kt(m.view).on("mousemove.brush",z,!0).on("mouseup.brush",q,!0);r&&et.on("keydown.brush",ct,!0).on("keyup.brush",ft,!0),Yo(m.view)}u.call(g),Q.start(m,w.name);function z(j){for(const it of j.changedTouches||[j])for(const $t of K)$t.identifier===it.identifier&&($t.cur=Wt(it,g));if(H&&!at&&!ut&&K.length===1){const it=K[0];ea(it.cur[0]-it[0])>ea(it.cur[1]-it[1])?ut=!0:at=!0}for(const it of K)it.cur&&(it[0]=it.cur[0],it[1]=it.cur[1]);ot=!0,xr(j),nt(j)}function nt(j){const it=K[0],$t=it.point0;var zt;switch(F=it[0]-$t[0],U=it[1]-$t[1],w){case br:case ta:{y&&(F=wt(V-L,vt(A-k,F)),C=L+F,S=k+F),M&&(U=wt(O-E,vt($-I,U)),v=E+U,T=I+U);break}case Ee:{K[1]?(y&&(C=wt(V,vt(A,K[0][0])),S=wt(V,vt(A,K[1][0])),y=1),M&&(v=wt(O,vt($,K[0][1])),T=wt(O,vt($,K[1][1])),M=1)):(y<0?(F=wt(V-L,vt(A-L,F)),C=L+F,S=k):y>0&&(F=wt(V-k,vt(A-k,F)),C=L,S=k+F),M<0?(U=wt(O-E,vt($-E,U)),v=E+U,T=I):M>0&&(U=wt(O-I,vt($-I,U)),v=E,T=I+U));break}case ze:{y&&(C=wt(V,vt(A,L-F*y)),S=wt(V,vt(A,k+F*y))),M&&(v=wt(O,vt($,E-U*M)),T=wt(O,vt($,I+U*M)));break}}S0&&(L=C-F),M<0?I=T-U:M>0&&(E=v-U),w=br,X.attr("cursor",ne.selection),nt(j));break}default:return}xr(j)}function ft(j){switch(j.keyCode){case 16:{H&&(at=ut=H=!1,nt(j));break}case 18:{w===ze&&(y<0?k=S:y>0&&(L=C),M<0?I=T:M>0&&(E=v),w=Ee,nt(j));break}case 32:{w===br&&(j.altKey?(y&&(k=S-F*y,L=C+F*y),M&&(I=T-U*M,E=v+U*M),w=ze):(y<0?k=S:y>0&&(L=C),M<0?I=T:M>0&&(E=v),w=Ee),X.attr("cursor",ne[x]),nt(j));break}default:return}xr(j)}}function d(m){f(this,arguments).moved(m)}function p(m){f(this,arguments).ended(m)}function b(){var m=this.__brush||{selection:null};return m.extent=Kr(e.apply(this,arguments)),m.dim=t,m}return l.extent=function(m){return arguments.length?(e=typeof m=="function"?m:vr(Kr(m)),l):e},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:vr(!!m),l):n},l.touchable=function(m){return arguments.length?(i=typeof m=="function"?m:vr(!!m),l):i},l.handleSize=function(m){return arguments.length?(s=+m,l):s},l.keyModifiers=function(m){return arguments.length?(r=!!m,l):r},l.on=function(){var m=o.on.apply(o,arguments);return m===o?l:m},l}const fi=t=>()=>t;function Ep(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function se(t,e,n){this.k=t,this.x=e,this.y=n}se.prototype={constructor:se,scale:function(t){return t===1?this:new se(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new se(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ji=new se(1,0,0);nu.prototype=se.prototype;function nu(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ji;return t.__zoom}function Tr(t){t.stopImmediatePropagation()}function gn(t){t.preventDefault(),t.stopImmediatePropagation()}function zp(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Dp(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function oa(){return this.__zoom||ji}function Wp(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Op(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ip(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function Rp(){var t=zp,e=Dp,n=Ip,i=Wp,r=Op,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=vl,u=Kn("start","zoom","end"),f,c,h,d=500,p=150,b=0,m=10;function g(v){v.property("__zoom",oa).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",V).on("dblclick.zoom",L).filter(r).on("touchstart.zoom",C).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",E).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(v,A,k,S){var $=v.selection?v.selection():v;$.property("__zoom",oa),v!==$?M(v,A,k,S):$.interrupt().each(function(){W(this,arguments).event(S).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},g.scaleBy=function(v,A,k,S){g.scaleTo(v,function(){var $=this.__zoom.k,I=typeof A=="function"?A.apply(this,arguments):A;return $*I},k,S)},g.scaleTo=function(v,A,k,S){g.transform(v,function(){var $=e.apply(this,arguments),I=this.__zoom,T=k==null?y($):typeof k=="function"?k.apply(this,arguments):k,F=I.invert(T),U=typeof A=="function"?A.apply(this,arguments):A;return n(w(x(I,U),T,F),$,s)},k,S)},g.translateBy=function(v,A,k,S){g.transform(v,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof k=="function"?k.apply(this,arguments):k),e.apply(this,arguments),s)},null,S)},g.translateTo=function(v,A,k,S,$){g.transform(v,function(){var I=e.apply(this,arguments),T=this.__zoom,F=S==null?y(I):typeof S=="function"?S.apply(this,arguments):S;return n(ji.translate(F[0],F[1]).scale(T.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof k=="function"?-k.apply(this,arguments):-k),I,s)},S,$)};function x(v,A){return A=Math.max(o[0],Math.min(o[1],A)),A===v.k?v:new se(A,v.x,v.y)}function w(v,A,k){var S=A[0]-k[0]*v.k,$=A[1]-k[1]*v.k;return S===v.x&&$===v.y?v:new se(v.k,S,$)}function y(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function M(v,A,k,S){v.on("start.zoom",function(){W(this,arguments).event(S).start()}).on("interrupt.zoom end.zoom",function(){W(this,arguments).event(S).end()}).tween("zoom",function(){var $=this,I=arguments,T=W($,I).event(S),F=e.apply($,I),U=k==null?y(F):typeof k=="function"?k.apply($,I):k,ot=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),H=$.__zoom,at=typeof A=="function"?A.apply($,I):A,ut=l(H.invert(U).concat(ot/H.k),at.invert(U).concat(ot/at.k));return function(K){if(K===1)K=at;else{var Q=ut(K),Y=ot/Q[2];K=new se(Y,U[0]-Q[0]*Y,U[1]-Q[1]*Y)}T.zoom(null,K)}})}function W(v,A,k){return!k&&v.__zooming||new R(v,A)}function R(v,A){this.that=v,this.args=A,this.active=0,this.sourceEvent=null,this.extent=e.apply(v,A),this.taps=0}R.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,A){return this.mouse&&v!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var A=kt(this.that).datum();u.call(v,this.that,new Ep(v,{sourceEvent:this.sourceEvent,target:g,type:v,transform:this.that.__zoom,dispatch:u}),A)}};function _(v,...A){if(!t.apply(this,arguments))return;var k=W(this,A).event(v),S=this.__zoom,$=Math.max(o[0],Math.min(o[1],S.k*Math.pow(2,i.apply(this,arguments)))),I=Wt(v);if(k.wheel)(k.mouse[0][0]!==I[0]||k.mouse[0][1]!==I[1])&&(k.mouse[1]=S.invert(k.mouse[0]=I)),clearTimeout(k.wheel);else{if(S.k===$)return;k.mouse=[I,S.invert(I)],Ue(this),k.start()}gn(v),k.wheel=setTimeout(T,p),k.zoom("mouse",n(w(x(S,$),k.mouse[0],k.mouse[1]),k.extent,s));function T(){k.wheel=null,k.end()}}function V(v,...A){if(h||!t.apply(this,arguments))return;var k=v.currentTarget,S=W(this,A,!0).event(v),$=kt(v.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",ot,!0),I=Wt(v,k),T=v.clientX,F=v.clientY;Yo(v.view),Tr(v),S.mouse=[I,this.__zoom.invert(I)],Ue(this),S.start();function U(H){if(gn(H),!S.moved){var at=H.clientX-T,ut=H.clientY-F;S.moved=at*at+ut*ut>b}S.event(H).zoom("mouse",n(w(S.that.__zoom,S.mouse[0]=Wt(H,k),S.mouse[1]),S.extent,s))}function ot(H){$.on("mousemove.zoom mouseup.zoom",null),Vo(H.view,S.moved),gn(H),S.event(H).end()}}function L(v,...A){if(!!t.apply(this,arguments)){var k=this.__zoom,S=Wt(v.changedTouches?v.changedTouches[0]:v,this),$=k.invert(S),I=k.k*(v.shiftKey?.5:2),T=n(w(x(k,I),S,$),e.apply(this,A),s);gn(v),a>0?kt(this).transition().duration(a).call(M,T,S,v):kt(this).call(g.transform,T,S,v)}}function C(v,...A){if(!!t.apply(this,arguments)){var k=v.touches,S=k.length,$=W(this,A,v.changedTouches.length===S).event(v),I,T,F,U;for(Tr(v),T=0;T(e=Vp*e+$p|0,sa*(e>>>0))}var Gp=Array.prototype,Zp=Gp.slice;function qp(t,e){return t-e}function Xp(t){for(var e=0,n=t.length,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e()=>t;function Bp(t,e){for(var n=-1,i=e.length,r;++ni!=d>i&&n<(h-u)*(i-f)/(d-f)+u&&(r=-r)}return r}function jp(t,e,n){var i;return Kp(t,e,n)&&Qp(t[i=+(t[0]===e[0])],n[i],e[i])}function Kp(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function Qp(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function Jp(){}var ie=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function tm(){var t=1,e=1,n=Ka,i=l;function r(u){var f=n(u);if(Array.isArray(f))f=f.slice().sort(qp);else{const c=Pn(u),h=ja(c[0],c[1],f);f=zn(Math.floor(c[0]/h)*h,Math.floor(c[1]/h-1)*h,f)}return f.map(c=>o(u,c))}function o(u,f){var c=[],h=[];return s(u,f,function(d){i(d,u,f),Xp(d)>0?c.push([d]):h.push(d)}),h.forEach(function(d){for(var p=0,b=c.length,m;p=f,ie[g<<1].forEach(y);++p=f,ie[m|g<<1].forEach(y);for(ie[g<<0].forEach(y);++b=f,x=u[b*t]>=f,ie[g<<1|x<<2].forEach(y);++p=f,w=x,x=u[b*t+p+1]>=f,ie[m|g<<1|x<<2|w<<3].forEach(y);ie[g|x<<3].forEach(y)}for(p=-1,x=u[b*t]>=f,ie[x<<2].forEach(y);++p=f,ie[x<<2|w<<3].forEach(y);ie[x<<3].forEach(y);function y(M){var W=[M[0][0]+p,M[0][1]+b],R=[M[1][0]+p,M[1][1]+b],_=a(W),V=a(R),L,C;(L=d[_])?(C=h[V])?(delete d[L.end],delete h[C.start],L===C?(L.ring.push(R),c(L.ring)):h[L.start]=d[C.end]={start:L.start,end:C.end,ring:L.ring.concat(C.ring)}):(delete d[L.end],L.ring.push(R),d[L.end=V]=L):(L=h[V])?(C=d[_])?(delete h[L.start],delete d[C.end],L===C?(L.ring.push(R),c(L.ring)):h[C.start]=d[L.end]={start:C.start,end:L.end,ring:C.ring.concat(L.ring)}):(delete h[L.start],L.ring.unshift(W),h[L.start=_]=L):h[_]=d[V]={start:_,end:V,ring:[W,R]}}}function a(u){return u[0]*2+u[1]*(t+1)*4}function l(u,f,c){u.forEach(function(h){var d=h[0],p=h[1],b=d|0,m=p|0,g,x=f[m*t+b];d>0&&d0&&p=0&&c>=0))throw new Error("invalid size");return t=f,e=c,r},r.thresholds=function(u){return arguments.length?(n=typeof u=="function"?u:Array.isArray(u)?aa(Zp.call(u)):aa(u),r):n},r.smooth=function(u){return arguments.length?(i=u?l:Jp,r):i===l},r}var em=Math.PI,nm=em*2,im=Math.abs,$o=Math.sqrt;function Yt(){}function Ii(t,e){t&&ua.hasOwnProperty(t.type)&&ua[t.type](t,e)}var la={Feature:function(t,e){Ii(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++it;var Sr=new Be,Jr=new Be,ru,ou,to,eo,ue={point:Yt,lineStart:Yt,lineEnd:Yt,polygonStart:function(){ue.lineStart=om,ue.lineEnd=am},polygonEnd:function(){ue.lineStart=ue.lineEnd=ue.point=Yt,Sr.add(im(Jr)),Jr=new Be},result:function(){var t=Sr/2;return Sr=new Be,t}};function om(){ue.point=sm}function sm(t,e){ue.point=su,ru=to=t,ou=eo=e}function su(t,e){Jr.add(eo*t-to*e),to=t,eo=e}function am(){su(ru,ou)}const ha=ue;var en=1/0,Ri=en,Zn=-en,Fi=Zn,lm={point:um,lineStart:Yt,lineEnd:Yt,polygonStart:Yt,polygonEnd:Yt,result:function(){var t=[[en,Ri],[Zn,Fi]];return Zn=Fi=-(Ri=en=1/0),t}};function um(t,e){tZn&&(Zn=t),eFi&&(Fi=e)}const fa=lm;var no=0,io=0,Sn=0,Yi=0,Vi=0,Fe=0,ro=0,oo=0,Cn=0,au,lu,Gt,Zt,Rt={point:Ce,lineStart:da,lineEnd:ga,polygonStart:function(){Rt.lineStart=fm,Rt.lineEnd=dm},polygonEnd:function(){Rt.point=Ce,Rt.lineStart=da,Rt.lineEnd=ga},result:function(){var t=Cn?[ro/Cn,oo/Cn]:Fe?[Yi/Fe,Vi/Fe]:Sn?[no/Sn,io/Sn]:[NaN,NaN];return no=io=Sn=Yi=Vi=Fe=ro=oo=Cn=0,t}};function Ce(t,e){no+=t,io+=e,++Sn}function da(){Rt.point=cm}function cm(t,e){Rt.point=hm,Ce(Gt=t,Zt=e)}function hm(t,e){var n=t-Gt,i=e-Zt,r=$o(n*n+i*i);Yi+=r*(Gt+t)/2,Vi+=r*(Zt+e)/2,Fe+=r,Ce(Gt=t,Zt=e)}function ga(){Rt.point=Ce}function fm(){Rt.point=gm}function dm(){uu(au,lu)}function gm(t,e){Rt.point=uu,Ce(au=Gt=t,lu=Zt=e)}function uu(t,e){var n=t-Gt,i=e-Zt,r=$o(n*n+i*i);Yi+=r*(Gt+t)/2,Vi+=r*(Zt+e)/2,Fe+=r,r=Zt*t-Gt*e,ro+=r*(Gt+t),oo+=r*(Zt+e),Cn+=r*3,Ce(Gt=t,Zt=e)}const pa=Rt;function cu(t){this._context=t}cu.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,nm);break}}},result:Yt};var so=new Be,Cr,hu,fu,Ln,Nn,$i={point:Yt,lineStart:function(){$i.point=pm},lineEnd:function(){Cr&&du(hu,fu),$i.point=Yt},polygonStart:function(){Cr=!0},polygonEnd:function(){Cr=null},result:function(){var t=+so;return so=new Be,t}};function pm(t,e){$i.point=du,hu=Ln=t,fu=Nn=e}function du(t,e){Ln-=t,Nn-=e,so.add($o(Ln*Ln+Nn*Nn)),Ln=t,Nn=e}const ma=$i;function gu(){this._string=[]}gu.prototype={_radius:4.5,_circle:ya(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._string.push("M",t,",",e),this._point=1;break}case 1:{this._string.push("L",t,",",e);break}default:{this._circle==null&&(this._circle=ya(this._radius)),this._string.push("M",t,",",e,this._circle);break}}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}else return null}};function ya(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function mm(t,e){var n=4.5,i,r;function o(s){return s&&(typeof n=="function"&&r.pointRadius(+n.apply(this,arguments)),pn(s,i(r))),r.result()}return o.area=function(s){return pn(s,i(ha)),ha.result()},o.measure=function(s){return pn(s,i(ma)),ma.result()},o.bounds=function(s){return pn(s,i(fa)),fa.result()},o.centroid=function(s){return pn(s,i(pa)),pa.result()},o.projection=function(s){return arguments.length?(i=s==null?(t=null,rm):(t=s).stream,o):t},o.context=function(s){return arguments.length?(r=s==null?(e=null,new gu):new cu(e=s),typeof n!="function"&&r.pointRadius(n),o):e},o.pointRadius=function(s){return arguments.length?(n=typeof s=="function"?s:(r.pointRadius(+s),+s),o):n},o.projection(t).context(e)}function ym(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return pu(this.cover(e,n),e,n,t)}function pu(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,o=t._root,s={data:i},a=t._x0,l=t._y0,u=t._x1,f=t._y1,c,h,d,p,b,m,g,x;if(!o)return t._root=s,t;for(;o.length;)if((b=e>=(c=(a+u)/2))?a=c:u=c,(m=n>=(h=(l+f)/2))?l=h:f=h,r=o,!(o=o[g=m<<1|b]))return r[g]=s,t;if(d=+t._x.call(null,o.data),p=+t._y.call(null,o.data),e===d&&n===p)return s.next=o,r?r[g]=s:t._root=s,t;do r=r?r[g]=new Array(4):t._root=new Array(4),(b=e>=(c=(a+u)/2))?a=c:u=c,(m=n>=(h=(l+f)/2))?l=h:f=h;while((g=m<<1|b)===(x=(p>=h)<<1|d>=c));return r[x]=o,r[g]=s,t}function wm(t){var e,n,i=t.length,r,o,s=new Array(i),a=new Array(i),l=1/0,u=1/0,f=-1/0,c=-1/0;for(n=0;nf&&(f=r),oc&&(c=o));if(l>f||u>c)return this;for(this.cover(l,u).cover(f,c),n=0;nt||t>=r||i>e||e>=o;)switch(u=(ef||(a=p.y0)>c||(l=p.x1)=g)<<1|t>=m)&&(p=h[h.length-1],h[h.length-1]=h[h.length-1-b],h[h.length-1-b]=p)}else{var x=t-+this._x.call(null,d.data),w=e-+this._y.call(null,d.data),y=x*x+w*w;if(y=(h=(s+l)/2))?s=h:l=h,(b=c>=(d=(a+u)/2))?a=d:u=d,e=n,!(n=n[m=b<<1|p]))return this;if(!n.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(i=e,g=m)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,r?(o?r.next=o:delete r.next,this):e?(o?e[m]=o:delete e[m],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(i?i[g]=n:this._root=n),this):(this._root=o,this)}function Mm(t){for(var e=0,n=t.length;e{e&&(Lr.has(t)?(console.timeEnd(t),Lr.delete(t)):(console.time(t),Lr.add(t)))},ao=(t,e,n)=>{const i=r=>{const o=r.toString(16);return o.length==1?`0${o}`:o};return`#${i(t)}${i(e)}${i(n)}`},ve=(t,e)=>{const n=t.x+t.width,i=e.x+e.width,r=t.y+t.height,o=e.y+e.height;return t.xe.x&&t.ye.y},zm=()=>new Promise(t=>{setTimeout(t,0)});var rt=(t=>(t.top="top",t.bottom="bottom",t.left="left",t.right="right",t))(rt||{});const Dm=[[" ",19.3],["!",34.3],['"',39.7],["#",58],["$",58],["%",78.6],["&",70.3],["'",23],["(",30],[")",30],["*",40],["+",58],[",",21.2],["-",34.7],[".",21.2],["/",37.3],["0",58],["1",58],["2",58],["3",58],["4",58],["5",58],["6",58],["7",58],["8",58],["9",58],[":",25.2],[";",25.2],["<",58],["=",58],[">",58],["?",39.8],["@",82.2],["A",68],["B",64.7],["C",68.5],["D",75.3],["E",58.1],["F",56.6],["G",73.4],["H",75.6],["I",30.7],["J",44.4],["K",68.1],["L",51.4],["M",92],["N",75.6],["O",79.8],["P",61.1],["Q",79.8],["R",64.4],["S",53],["T",59],["U",73],["V",68],["W",101.9],["X",64.3],["Y",62.9],["Z",62.4],["[",30],["\\",37.5],["]",30],["^",58],["_",39.4],["`",30.7],["a",50.7],["b",55.9],["c",46.7],["d",55.9],["e",52.4],["f",33.7],["g",51.1],["h",55.6],["i",25.6],["j",25.4],["k",52.4],["l",25.6],["m",82.1],["n",55.6],["o",55.6],["p",55.2],["q",55.9],["r",40.3],["s",43.4],["t",37.3],["u",55.6],["v",51.2],["w",76.6],["x",50.4],["y",51.2],["z",46.2],["{",30],["|",30],["}",30],["~",58],["_median",55.9]],Wm=[['"&',-9.1],['",',-11.4],['"-',-8.9],['".',-11.4],['"/',-9.1],['"@',-2.3],['"A',-9.1],['"C',-2.3],['"G',-2.3],['"O',-2.3],['"Q',-2.3],['"V',2.4],['"W',2.4],['"Y',1.5],['"\\',2.4],['"a',-3.2],['"c',-4.6],['"d',-4.6],['"e',-4.6],['"o',-4.6],['"q',-4.6],["'&",-9.1],["',",-11.4],["'-",-8.9],["'.",-11.4],["'/",-9.1],["'@",-2.3],["'A",-9.1],["'C",-2.3],["'G",-2.3],["'O",-2.3],["'Q",-2.3],["'V",2.4],["'W",2.4],["'Y",1.5],["'\\",2.4],["'a",-3.2],["'c",-4.6],["'d",-4.6],["'e",-4.6],["'o",-4.6],["'q",-4.6],["(@",-2],["(C",-2],["(G",-2],["(O",-2],["(Q",-2],["(c",-1.6],["(d",-1.6],["(e",-1.6],["(o",-1.6],["(q",-1.6],["*&",-9.1],["*,",-11.4],["*-",-8.9],["*.",-11.4],["*/",-9.1],["*@",-2.3],["*A",-9.1],["*C",-2.3],["*G",-2.3],["*O",-2.3],["*Q",-2.3],["*V",2.4],["*W",2.4],["*Y",1.5],["*\\",2.4],["*a",-3.2],["*c",-4.6],["*d",-4.6],["*e",-4.6],["*o",-4.6],["*q",-4.6],[',"',-11.4],[",'",-11.4],[",*",-11.4],[",-",-6.8],[",@",-2.8],[",C",-2.8],[",G",-2.8],[",O",-2.8],[",Q",-2.8],[",T",-9],[",V",-9],[",W",-6.1],[",Y",-7.6],[",\\",-9],[",v",-6.6],[",w",-3.1],[",y",-6.6],['-"',-8.9],["-&",-2.6],["-'",-8.9],["-*",-8.9],["-,",-6.8],["-.",-6.8],["-/",-2.6],["-A",-2.6],["-T",-9],["-V",-5.6],["-W",-1.6],["-X",-3.1],["-Y",-8],["-Z",-2.3],["-\\",-5.6],['."',-11.4],[".'",-11.4],[".*",-11.4],[".-",-6.8],[".@",-2.8],[".C",-2.8],[".G",-2.8],[".O",-2.8],[".Q",-2.8],[".T",-9],[".V",-9],[".W",-6.1],[".Y",-7.6],[".\\",-9],[".v",-6.6],[".w",-3.1],[".y",-6.6],['/"',2.4],["/&",-6.8],["/'",2.4],["/*",2.4],["/,",-9.6],["/-",-5.6],["/.",-9.6],["//",-6.8],["/:",-4.4],["/;",-4.4],["/?",2.4],["/@",-2.6],["/A",-6.8],["/C",-2.6],["/G",-2.6],["/J",-7.6],["/O",-2.6],["/Q",-2.6],["/a",-5.8],["/c",-5.8],["/d",-5.8],["/e",-5.8],["/f",-1.5],["/g",-6.8],["/m",-4.4],["/n",-4.4],["/o",-5.8],["/p",-4.4],["/q",-5.8],["/r",-4.4],["/s",-5.3],["/t",-2.1],["/u",-4.4],["/v",-2.4],["/x",-2.6],["/y",-2.4],["/z",-4.1],['@"',-2.3],["@&",-2.1],["@'",-2.3],["@)",-2],["@*",-2.3],["@,",-2.8],["@.",-2.8],["@/",-2.1],["@A",-2.1],["@T",-4.9],["@V",-2.6],["@X",-1.5],["@Y",-4],["@Z",-3.5],["@\\",-2.6],["@]",-2],["@}",-2],['A"',-9.1],["A'",-9.1],["A*",-9.1],["A-",-2.6],["A?",-2.8],["A@",-2.1],["AC",-2.1],["AG",-2.1],["AJ",2.5],["AO",-2.1],["AQ",-2.1],["AT",-6.6],["AU",-2.8],["AV",-6.8],["AW",-4.2],["AY",-8.2],["A\\",-6.8],["Av",-4.1],["Ay",-4.1],["C-",-7.5],['D"',-2.3],["D&",-2.1],["D'",-2.3],["D)",-2],["D*",-2.3],["D,",-2.8],["D.",-2.8],["D/",-2.1],["DA",-2.1],["DT",-4.9],["DV",-2.6],["DX",-1.5],["DY",-4],["DZ",-3.5],["D\\",-2.6],["D]",-2],["D}",-2],["F&",-6.6],["F,",-9],["F.",-9],["F/",-6.6],["F:",-3],["F;",-3],["F?",1.5],["FA",-6.6],["FJ",-9.9],["Fc",-3.5],["Fd",-3.5],["Fe",-3.5],["Fm",-3],["Fn",-3],["Fo",-3.5],["Fp",-3],["Fq",-3.5],["Fr",-3],["Fu",-3],["J&",-2.8],["J,",-2.5],["J.",-2.5],["J/",-2.8],["JA",-2.8],["K-",-3.1],["K@",-1.5],["KC",-1.5],["KG",-1.5],["KO",-1.5],["KQ",-1.5],["Kc",-1.8],["Kd",-1.8],["Ke",-1.8],["Kf",-2.6],["Ko",-1.8],["Kq",-1.8],["Kt",-4.1],["Kv",-3.3],["Kw",-2.8],["Ky",-3.3],['L"',-14.5],["L'",-14.5],["L*",-14.5],["L,",2.7],["L-",-9.9],["L.",2.7],["L?",-2.5],["L@",-4],["LC",-4],["LG",-4],["LO",-4],["LQ",-4],["LT",-8.6],["LV",-9.1],["LW",-7.6],["LY",-10.6],["L\\",-9.1],["Lc",-1.8],["Ld",-1.8],["Le",-1.8],["Lo",-1.8],["Lq",-1.8],["Lv",-5.4],["Lw",-4],["Ly",-5.4],['O"',-2.3],["O&",-2.1],["O'",-2.3],["O)",-2],["O*",-2.3],["O,",-2.8],["O.",-2.8],["O/",-2.1],["OA",-2.1],["OT",-4.9],["OV",-2.6],["OX",-1.5],["OY",-4],["OZ",-3.5],["O\\",-2.6],["O]",-2],["O}",-2],["P&",-6.9],["P,",-12.4],["P.",-12.4],["P/",-6.9],["PA",-6.9],["PJ",-9.1],["Pa",-2.5],["Pc",-1.5],["Pd",-1.5],["Pe",-1.5],["Po",-1.5],["Pq",-1.5],['Q"',-2.3],["Q&",-2.1],["Q'",-2.3],["Q)",-2],["Q*",-2.3],["Q,",-2.8],["Q.",-2.8],["Q/",-2.1],["QA",-2.1],["QT",-4.9],["QV",-2.6],["QX",-1.5],["QY",-4],["QZ",-3.5],["Q\\",-2.6],["Q]",-2],["Q}",-2],["R@",-2.3],["RC",-2.3],["RG",-2.3],["RO",-2.3],["RQ",-2.3],["RT",-2.6],["RU",-2.1],["T&",-6.6],["T,",-9],["T-",-9],["T.",-9],["T/",-6.6],["T:",-8],["T;",-8],["T@",-4.9],["TA",-6.6],["TC",-4.9],["TG",-4.9],["TJ",-10],["TO",-4.9],["TQ",-4.9],["Ta",-12.5],["Tc",-10.5],["Td",-10.5],["Te",-10.5],["Tg",-9.4],["Tm",-8],["Tn",-8],["To",-10.5],["Tp",-8],["Tq",-10.5],["Tr",-8],["Ts",-8.1],["Tu",-8],["Tv",-9],["Tw",-7],["Tx",-7.2],["Ty",-9],["Tz",-6],["U&",-2.8],["U,",-2.5],["U.",-2.5],["U/",-2.8],["UA",-2.8],['V"',2.4],["V&",-6.8],["V'",2.4],["V*",2.4],["V,",-9.6],["V-",-5.6],["V.",-9.6],["V/",-6.8],["V:",-4.4],["V;",-4.4],["V?",2.4],["V@",-2.6],["VA",-6.8],["VC",-2.6],["VG",-2.6],["VJ",-7.6],["VO",-2.6],["VQ",-2.6],["Va",-5.8],["Vc",-5.8],["Vd",-5.8],["Ve",-5.8],["Vf",-1.5],["Vg",-6.8],["Vm",-4.4],["Vn",-4.4],["Vo",-5.8],["Vp",-4.4],["Vq",-5.8],["Vr",-4.4],["Vs",-5.3],["Vt",-2.1],["Vu",-4.4],["Vv",-2.4],["Vx",-2.6],["Vy",-2.4],["Vz",-4.1],['W"',2.4],["W&",-4.7],["W'",2.4],["W*",2.4],["W,",-6.1],["W-",-1.6],["W.",-6.1],["W/",-4.7],["W?",1.7],["WA",-4.7],["WJ",-5.1],["Wa",-4.4],["Wc",-1.6],["Wd",-1.6],["We",-1.6],["Wg",-4.9],["Wo",-1.6],["Wq",-1.6],["Ws",-2.3],["X-",-3.1],["X@",-1.5],["XC",-1.5],["XG",-1.5],["XO",-1.5],["XQ",-1.5],["Xc",-1.8],["Xd",-1.8],["Xe",-1.8],["Xf",-2.6],["Xo",-1.8],["Xq",-1.8],["Xt",-4.1],["Xv",-3.3],["Xw",-2.8],["Xy",-3.3],['Y"',1.5],["Y&",-8.2],["Y'",1.5],["Y*",1.5],["Y,",-7.6],["Y-",-8],["Y.",-7.6],["Y/",-8.2],["Y:",-6.1],["Y;",-6.1],["Y?",1.7],["Y@",-4],["YA",-8.2],["YC",-4],["YG",-4],["YJ",-10],["YO",-4],["YQ",-4],["Ya",-6.4],["Yc",-8],["Yd",-8],["Ye",-8],["Yg",-8.6],["Ym",-6.1],["Yn",-6.1],["Yo",-8],["Yp",-6.1],["Yq",-8],["Yr",-6.1],["Ys",-6.4],["Yu",-6.1],["Yv",-5],["Yw",-4.6],["Yx",-6.6],["Yy",-5],["Z-",-3.5],["Z?",1.7],["Z@",-2.9],["ZC",-2.9],["ZG",-2.9],["ZO",-2.9],["ZQ",-2.9],["Zc",-1.9],["Zd",-1.9],["Ze",-1.9],["Zo",-1.9],["Zq",-1.9],["Zs",-1.4],["Zv",-2],["Zy",-2],["[@",-2],["[C",-2],["[G",-2],["[O",-2],["[Q",-2],["[c",-1.6],["[d",-1.6],["[e",-1.6],["[o",-1.6],["[q",-1.6],['\\"',-9.1],["\\'",-9.1],["\\*",-9.1],["\\-",-2.6],["\\?",-2.8],["\\@",-2.1],["\\C",-2.1],["\\G",-2.1],["\\J",2.5],["\\O",-2.1],["\\Q",-2.1],["\\T",-6.6],["\\U",-2.8],["\\V",-6.8],["\\W",-4.2],["\\Y",-8.2],["\\\\",-6.8],["\\v",-4.1],["\\y",-4.1],['a"',-3.6],["a'",-3.6],["a*",-3.6],["av",-1.6],["aw",-.8],["ay",-1.6],['b"',-4.6],["b'",-4.6],["b)",-1.6],["b*",-4.6],["bV",-5.8],["bW",-1.6],["b\\",-5.8],["b]",-1.6],["bv",-1.3],["bx",-3],["by",-1.3],["b}",-1.6],['e"',-4.6],["e'",-4.6],["e)",-1.6],["e*",-4.6],["eV",-5.8],["eW",-1.6],["e\\",-5.8],["e]",-1.6],["ev",-1.3],["ex",-3],["ey",-1.3],["e}",-1.6],['f"',3.4],["f'",3.4],["f*",3.4],["f,",-6.5],["f.",-6.5],["fi",-2.3],['h"',-3.6],["h'",-3.6],["h*",-3.6],["hv",-1.6],["hw",-.8],["hy",-1.6],["kc",-3],["kd",-3],["ke",-3],["ko",-3],["kq",-3],['m"',-3.6],["m'",-3.6],["m*",-3.6],["mv",-1.6],["mw",-.8],["my",-1.6],['n"',-3.6],["n'",-3.6],["n*",-3.6],["nv",-1.6],["nw",-.8],["ny",-1.6],['o"',-4.6],["o'",-4.6],["o)",-1.6],["o*",-4.6],["oV",-5.8],["oW",-1.6],["o\\",-5.8],["o]",-1.6],["ov",-1.3],["ox",-3],["oy",-1.3],["o}",-1.6],['p"',-4.6],["p'",-4.6],["p)",-1.6],["p*",-4.6],["pV",-5.8],["pW",-1.6],["p\\",-5.8],["p]",-1.6],["pv",-1.3],["px",-3],["py",-1.3],["p}",-1.6],["r,",-6.6],["r.",-6.6],["ra",-1.9],["v&",-4.1],["v,",-6.6],["v.",-6.6],["v/",-4.1],["vA",-4.1],["vc",-1.3],["vd",-1.3],["ve",-1.3],["vo",-1.3],["vq",-1.3],["w,",-3.1],["w.",-3.1],["xc",-3],["xd",-3],["xe",-3],["xo",-3],["xq",-3],["y&",-4.1],["y,",-6.6],["y.",-6.6],["y/",-4.1],["yA",-4.1],["yc",-1.3],["yd",-1.3],["ye",-1.3],["yo",-1.3],["yq",-1.3],["{@",-2],["{C",-2],["{G",-2],["{O",-2],["{Q",-2],["{c",-1.6],["{d",-1.6],["{e",-1.6],["{o",-1.6],["{q",-1.6]],Om={textWidth:Dm,kerningWidth:Wm},Im=(t,e,n=16)=>{const i=new Map(t.textWidth),r=new Map(t.kerningWidth),o=[...e];let s=0;for(const[a,l]of o.entries())s+=i.get(l)||i.get("_median"),a!==o.length-1&&(s+=r.get(`${l}${o[a+1]}`)||0);return s/(100/n)},Ft=(t,e=16)=>Im(Om,t,e),xi={sunburstWidth:650,treeWindowWidth:150,treeWindowHeaderHeight:26,treeWindowHeight:0,toolbarHeight:36},Rm={mouseenterDelay:300};xi.treeWindowHeight=xi.treeWindowHeaderHeight+xi.treeWindowWidth;const Fm={"red-50":"hsl(350, 100.0%, 96.08%)","red-100":"hsl(354, 100.0%, 90.2%)","red-200":"hsl(0, 72.65%, 77.06%)","red-300":"hsl(0, 68.67%, 67.45%)","red-400":"hsl(1, 83.25%, 62.55%)","red-500":"hsl(4, 89.62%, 58.43%)","red-600":"hsl(1, 77.19%, 55.29%)","red-700":"hsl(0, 65.08%, 50.59%)","red-800":"hsl(0, 66.39%, 46.67%)","red-900":"hsl(0, 73.46%, 41.37%)","red-a100":"hsl(4, 100.0%, 75.1%)","red-a200":"hsl(0, 100.0%, 66.08%)","red-a400":"hsl(348, 100.0%, 54.51%)","red-a700":"hsl(0, 100.0%, 41.76%)","pink-50":"hsl(340, 80.0%, 94.12%)","pink-100":"hsl(339, 81.33%, 85.29%)","pink-200":"hsl(339, 82.11%, 75.88%)","pink-300":"hsl(339, 82.56%, 66.27%)","pink-400":"hsl(339, 81.9%, 58.82%)","pink-500":"hsl(339, 82.19%, 51.57%)","pink-600":"hsl(338, 77.78%, 47.65%)","pink-700":"hsl(336, 77.98%, 42.75%)","pink-800":"hsl(333, 79.27%, 37.84%)","pink-900":"hsl(328, 81.33%, 29.41%)","pink-a100":"hsl(339, 100.0%, 75.1%)","pink-a200":"hsl(339, 100.0%, 62.55%)","pink-a400":"hsl(338, 100.0%, 48.04%)","pink-a700":"hsl(333, 84.11%, 41.96%)","purple-50":"hsl(292, 44.44%, 92.94%)","purple-100":"hsl(291, 46.07%, 82.55%)","purple-200":"hsl(291, 46.94%, 71.18%)","purple-300":"hsl(291, 46.6%, 59.61%)","purple-400":"hsl(291, 46.61%, 50.78%)","purple-500":"hsl(291, 63.72%, 42.16%)","purple-600":"hsl(287, 65.05%, 40.39%)","purple-700":"hsl(282, 67.88%, 37.84%)","purple-800":"hsl(277, 70.17%, 35.49%)","purple-900":"hsl(267, 75.0%, 31.37%)","purple-a100":"hsl(291, 95.38%, 74.51%)","purple-a200":"hsl(291, 95.9%, 61.76%)","purple-a400":"hsl(291, 100.0%, 48.82%)","purple-a700":"hsl(280, 100.0%, 50.0%)","deep-purple-50":"hsl(264, 45.45%, 93.53%)","deep-purple-100":"hsl(261, 45.68%, 84.12%)","deep-purple-200":"hsl(261, 46.27%, 73.73%)","deep-purple-300":"hsl(261, 46.81%, 63.14%)","deep-purple-400":"hsl(261, 46.72%, 55.1%)","deep-purple-500":"hsl(261, 51.87%, 47.25%)","deep-purple-600":"hsl(259, 53.91%, 45.1%)","deep-purple-700":"hsl(257, 57.75%, 41.76%)","deep-purple-800":"hsl(254, 60.8%, 39.02%)","deep-purple-900":"hsl(251, 68.79%, 33.92%)","deep-purple-a100":"hsl(261, 100.0%, 76.67%)","deep-purple-a200":"hsl(255, 100.0%, 65.1%)","deep-purple-a400":"hsl(258, 100.0%, 56.08%)","deep-purple-a700":"hsl(265, 100.0%, 45.88%)","indigo-50":"hsl(231, 43.75%, 93.73%)","indigo-100":"hsl(231, 45.0%, 84.31%)","indigo-200":"hsl(230, 44.36%, 73.92%)","indigo-300":"hsl(230, 44.09%, 63.53%)","indigo-400":"hsl(230, 44.25%, 55.69%)","indigo-500":"hsl(230, 48.36%, 47.84%)","indigo-600":"hsl(231, 50.0%, 44.71%)","indigo-700":"hsl(231, 53.62%, 40.59%)","indigo-800":"hsl(232, 57.22%, 36.67%)","indigo-900":"hsl(234, 65.79%, 29.8%)","indigo-a100":"hsl(230, 100.0%, 77.45%)","indigo-a200":"hsl(230, 98.84%, 66.08%)","indigo-a400":"hsl(230, 98.97%, 61.76%)","indigo-a700":"hsl(230, 99.04%, 59.22%)","blue-50":"hsl(205, 86.67%, 94.12%)","blue-100":"hsl(207, 88.89%, 85.88%)","blue-200":"hsl(206, 89.74%, 77.06%)","blue-300":"hsl(206, 89.02%, 67.84%)","blue-400":"hsl(206, 89.95%, 60.98%)","blue-500":"hsl(206, 89.74%, 54.12%)","blue-600":"hsl(208, 79.28%, 50.78%)","blue-700":"hsl(209, 78.72%, 46.08%)","blue-800":"hsl(211, 80.28%, 41.76%)","blue-900":"hsl(216, 85.06%, 34.12%)","blue-a100":"hsl(217, 100.0%, 75.49%)","blue-a200":"hsl(217, 100.0%, 63.33%)","blue-a400":"hsl(217, 100.0%, 58.04%)","blue-a700":"hsl(224, 100.0%, 58.04%)","light-blue-50":"hsl(198, 93.55%, 93.92%)","light-blue-100":"hsl(198, 92.41%, 84.51%)","light-blue-200":"hsl(198, 92.37%, 74.31%)","light-blue-300":"hsl(198, 91.3%, 63.92%)","light-blue-400":"hsl(198, 91.93%, 56.27%)","light-blue-500":"hsl(198, 97.57%, 48.43%)","light-blue-600":"hsl(199, 97.41%, 45.49%)","light-blue-700":"hsl(201, 98.1%, 41.37%)","light-blue-800":"hsl(202, 97.91%, 37.45%)","light-blue-900":"hsl(206, 98.72%, 30.59%)","light-blue-a100":"hsl(198, 100.0%, 75.1%)","light-blue-a200":"hsl(198, 100.0%, 62.55%)","light-blue-a400":"hsl(198, 100.0%, 50.0%)","light-blue-a700":"hsl(202, 100.0%, 45.88%)","cyan-50":"hsl(186, 72.22%, 92.94%)","cyan-100":"hsl(186, 71.11%, 82.35%)","cyan-200":"hsl(186, 71.62%, 70.98%)","cyan-300":"hsl(186, 71.15%, 59.22%)","cyan-400":"hsl(186, 70.87%, 50.2%)","cyan-500":"hsl(186, 100.0%, 41.57%)","cyan-600":"hsl(186, 100.0%, 37.84%)","cyan-700":"hsl(185, 100.0%, 32.75%)","cyan-800":"hsl(185, 100.0%, 28.04%)","cyan-900":"hsl(182, 100.0%, 19.61%)","cyan-a100":"hsl(180, 100.0%, 75.88%)","cyan-a200":"hsl(180, 100.0%, 54.71%)","cyan-a400":"hsl(186, 100.0%, 50.0%)","cyan-a700":"hsl(187, 100.0%, 41.57%)","teal-50":"hsl(176, 40.91%, 91.37%)","teal-100":"hsl(174, 41.28%, 78.63%)","teal-200":"hsl(174, 41.9%, 64.9%)","teal-300":"hsl(174, 41.83%, 50.78%)","teal-400":"hsl(174, 62.75%, 40.0%)","teal-500":"hsl(174, 100.0%, 29.41%)","teal-600":"hsl(173, 100.0%, 26.86%)","teal-700":"hsl(173, 100.0%, 23.73%)","teal-800":"hsl(172, 100.0%, 20.59%)","teal-900":"hsl(169, 100.0%, 15.1%)","teal-a100":"hsl(166, 100.0%, 82.75%)","teal-a200":"hsl(165, 100.0%, 69.61%)","teal-a400":"hsl(165, 82.26%, 51.37%)","teal-a700":"hsl(171, 100.0%, 37.45%)","green-50":"hsl(124, 39.39%, 93.53%)","green-100":"hsl(121, 37.5%, 84.31%)","green-200":"hsl(122, 37.4%, 74.31%)","green-300":"hsl(122, 38.46%, 64.31%)","green-400":"hsl(122, 38.46%, 56.67%)","green-500":"hsl(122, 39.44%, 49.22%)","green-600":"hsl(122, 40.97%, 44.51%)","green-700":"hsl(122, 43.43%, 38.82%)","green-800":"hsl(123, 46.2%, 33.53%)","green-900":"hsl(124, 55.37%, 23.73%)","green-a100":"hsl(136, 77.22%, 84.51%)","green-a200":"hsl(150, 81.82%, 67.65%)","green-a400":"hsl(150, 100.0%, 45.1%)","green-a700":"hsl(144, 100.0%, 39.22%)","light-green-50":"hsl(88, 51.72%, 94.31%)","light-green-100":"hsl(87, 50.68%, 85.69%)","light-green-200":"hsl(88, 50.0%, 76.47%)","light-green-300":"hsl(87, 50.0%, 67.06%)","light-green-400":"hsl(87, 50.24%, 59.8%)","light-green-500":"hsl(87, 50.21%, 52.75%)","light-green-600":"hsl(89, 46.12%, 48.04%)","light-green-700":"hsl(92, 47.91%, 42.16%)","light-green-800":"hsl(95, 49.46%, 36.47%)","light-green-900":"hsl(103, 55.56%, 26.47%)","light-green-a100":"hsl(87, 100.0%, 78.24%)","light-green-a200":"hsl(87, 100.0%, 67.45%)","light-green-a400":"hsl(92, 100.0%, 50.59%)","light-green-a700":"hsl(96, 81.15%, 47.84%)","lime-50":"hsl(65, 71.43%, 94.51%)","lime-100":"hsl(64, 69.01%, 86.08%)","lime-200":"hsl(65, 70.69%, 77.25%)","lime-300":"hsl(65, 70.37%, 68.24%)","lime-400":"hsl(65, 69.7%, 61.18%)","lime-500":"hsl(65, 69.96%, 54.31%)","lime-600":"hsl(63, 59.68%, 49.61%)","lime-700":"hsl(62, 61.43%, 43.73%)","lime-800":"hsl(59, 62.89%, 38.04%)","lime-900":"hsl(53, 69.93%, 30.0%)","lime-a100":"hsl(65, 100.0%, 75.29%)","lime-a200":"hsl(65, 100.0%, 62.75%)","lime-a400":"hsl(73, 100.0%, 50.0%)","lime-a700":"hsl(75, 100.0%, 45.88%)","yellow-50":"hsl(55, 100.0%, 95.29%)","yellow-100":"hsl(53, 100.0%, 88.43%)","yellow-200":"hsl(53, 100.0%, 80.78%)","yellow-300":"hsl(53, 100.0%, 73.14%)","yellow-400":"hsl(53, 100.0%, 67.25%)","yellow-500":"hsl(53, 100.0%, 61.57%)","yellow-600":"hsl(48, 98.04%, 60.0%)","yellow-700":"hsl(42, 96.26%, 58.04%)","yellow-800":"hsl(37, 94.64%, 56.08%)","yellow-900":"hsl(28, 91.74%, 52.55%)","yellow-a100":"hsl(60, 100.0%, 77.65%)","yellow-a200":"hsl(60, 100.0%, 50.0%)","yellow-a400":"hsl(55, 100.0%, 50.0%)","yellow-a700":"hsl(50, 100.0%, 50.0%)","amber-50":"hsl(46, 100.0%, 94.12%)","amber-100":"hsl(45, 100.0%, 85.1%)","amber-200":"hsl(45, 100.0%, 75.49%)","amber-300":"hsl(45, 100.0%, 65.49%)","amber-400":"hsl(45, 100.0%, 57.84%)","amber-500":"hsl(45, 100.0%, 51.37%)","amber-600":"hsl(42, 100.0%, 50.0%)","amber-700":"hsl(37, 100.0%, 50.0%)","amber-800":"hsl(33, 100.0%, 50.0%)","amber-900":"hsl(26, 100.0%, 50.0%)","amber-a100":"hsl(47, 100.0%, 74.9%)","amber-a200":"hsl(47, 100.0%, 62.55%)","amber-a400":"hsl(46, 100.0%, 50.0%)","amber-a700":"hsl(40, 100.0%, 50.0%)","orange-50":"hsl(36, 100.0%, 93.92%)","orange-100":"hsl(35, 100.0%, 84.9%)","orange-200":"hsl(35, 100.0%, 75.1%)","orange-300":"hsl(35, 100.0%, 65.1%)","orange-400":"hsl(35, 100.0%, 57.45%)","orange-500":"hsl(35, 100.0%, 50.0%)","orange-600":"hsl(33, 100.0%, 49.22%)","orange-700":"hsl(30, 100.0%, 48.04%)","orange-800":"hsl(27, 100.0%, 46.86%)","orange-900":"hsl(21, 100.0%, 45.1%)","orange-a100":"hsl(38, 100.0%, 75.1%)","orange-a200":"hsl(33, 100.0%, 62.55%)","orange-a400":"hsl(34, 100.0%, 50.0%)","orange-a700":"hsl(25, 100.0%, 50.0%)","deep-orange-50":"hsl(5, 71.43%, 94.51%)","deep-orange-100":"hsl(14, 100.0%, 86.86%)","deep-orange-200":"hsl(14, 100.0%, 78.43%)","deep-orange-300":"hsl(14, 100.0%, 69.8%)","deep-orange-400":"hsl(14, 100.0%, 63.14%)","deep-orange-500":"hsl(14, 100.0%, 56.67%)","deep-orange-600":"hsl(14, 90.68%, 53.73%)","deep-orange-700":"hsl(14, 80.39%, 50.0%)","deep-orange-800":"hsl(14, 82.28%, 46.47%)","deep-orange-900":"hsl(14, 88.18%, 39.8%)","deep-orange-a100":"hsl(14, 100.0%, 75.1%)","deep-orange-a200":"hsl(14, 100.0%, 62.55%)","deep-orange-a400":"hsl(14, 100.0%, 50.0%)","deep-orange-a700":"hsl(11, 100.0%, 43.33%)","brown-50":"hsl(19, 15.79%, 92.55%)","brown-100":"hsl(16, 15.79%, 81.37%)","brown-200":"hsl(14, 15.19%, 69.02%)","brown-300":"hsl(15, 15.32%, 56.47%)","brown-400":"hsl(15, 17.5%, 47.06%)","brown-500":"hsl(15, 25.39%, 37.84%)","brown-600":"hsl(15, 25.29%, 34.12%)","brown-700":"hsl(14, 25.68%, 29.02%)","brown-800":"hsl(11, 25.81%, 24.31%)","brown-900":"hsl(8, 27.84%, 19.02%)","gray-50":"hsl(0, 0.0%, 98.04%)","gray-100":"hsl(0, 0.0%, 96.08%)","gray-200":"hsl(0, 0.0%, 93.33%)","gray-300":"hsl(0, 0.0%, 87.84%)","gray-400":"hsl(0, 0.0%, 74.12%)","gray-500":"hsl(0, 0.0%, 61.96%)","gray-600":"hsl(0, 0.0%, 45.88%)","gray-700":"hsl(0, 0.0%, 38.04%)","gray-800":"hsl(0, 0.0%, 25.88%)","gray-900":"hsl(0, 0.0%, 12.94%)","blue-gray-50":"hsl(204, 15.15%, 93.53%)","blue-gray-100":"hsl(198, 15.66%, 83.73%)","blue-gray-200":"hsl(199, 15.33%, 73.14%)","blue-gray-300":"hsl(199, 15.63%, 62.35%)","blue-gray-400":"hsl(200, 15.38%, 54.12%)","blue-gray-500":"hsl(199, 18.3%, 46.08%)","blue-gray-600":"hsl(198, 18.45%, 40.39%)","blue-gray-700":"hsl(199, 18.34%, 33.14%)","blue-gray-800":"hsl(199, 17.91%, 26.27%)","blue-gray-900":"hsl(199, 19.15%, 18.43%)","blue-gray-1000":"hsl(199, 20.93%, 8.43%)"},Nt={colors:Fm,layout:xi,time:Rm,debug:!0,gridColorLight:"hsl(0, 0%, 100%)",gridColorDark:"hsl(0, 0%, 30%)"},va=35,xa="-";let mn=null,yn=null;function Ym(t,e,n,i,r){const o=B.transition("label-addition").duration(300).ease(B.easeCubicInOut),s=B.transition("label-removal").duration(100).ease(B.easeLinear),a=c=>{const h=c.append("g").attr("class",`label-group zoom-${i}`).classed("hidden",p=>p.toHide);this.lastLabelNames.size>0&&h.style("opacity",0).transition(o).style("opacity",1);const d=h.append("text").attr("class",p=>`topic-label ${p.direction}`).attr("transform",p=>`translate(${p.labelX}, ${p.labelY})`).style("font-size",`${r}px`).text(p=>p.lines.length>1?null:p.lines[0]).attr("paint-order","stroke").style("stroke","#fff").style("stroke-width",3.2/this.curZoomTransform.k);return d.append("tspan").attr("class","line-1").attr("x",0).attr("y",0).text(p=>p.lines.length>1?p.lines[0]:""),d.append("tspan").attr("class","line-2").attr("x",0).attr("y",0).attr("dy",.96*r).text(p=>p.lines.length>1?p.lines[1]:""),h.append("rect").attr("class","topic-tile").attr("x",p=>this.xScale(p.tileX)).attr("y",p=>this.yScale(p.tileY)).attr("rx",4/this.curZoomTransform.k).attr("ry",4/this.curZoomTransform.k).attr("width",n).attr("height",n).style("stroke-width",1.6/this.curZoomTransform.k),h.append("path").attr("class","direction-indicator").attr("transform-origin","center").each((p,b,m)=>this.addTileIndicatorPath(p,b,m,n)),h},l=c=>{const h=c.each((d,p,b)=>{const m=B.select(b[p]),g=m.classed("hidden");!g&&d.toHide&&this.contoursInitialized?m.style("opacity",1).transition(s).style("opacity",0).on("end",()=>{m.classed("hidden",d.toHide)}):g&&!d.toHide&&this.contoursInitialized?m.style("opacity",0).classed("hidden",d.toHide).transition(s).style("opacity",1):m.classed("hidden",d.toHide)});return h.select("text").style("stroke-width",3.2/this.curZoomTransform.k).style("font-size",`${r}px`).each((d,p,b)=>{const m=B.select(b[p]),g=m.attr("class"),x=`topic-label ${d.direction}`;m.attr("class",x).select(".line-2").attr("dy",.96*r),x!==g?m.transition("update").duration(300).ease(B.easeCubicInOut).attr("transform",`translate(${d.labelX}, ${d.labelY})`):m.attr("transform",`translate(${d.labelX}, ${d.labelY})`)}),h.select("rect.topic-tile").attr("x",d=>this.xScale(d.tileX)).attr("y",d=>this.yScale(d.tileY)).attr("rx",4/this.curZoomTransform.k).attr("ry",4/this.curZoomTransform.k).attr("width",n).attr("height",n).style("stroke-width",1.6/this.curZoomTransform.k),h.select("path.direction-indicator").each((d,p,b)=>this.addTileIndicatorPath(d,p,b,n)),c},u=c=>this.lastLabelNames.size>0&&this.contoursInitialized?(c.transition(s).style("opacity",0).on("end",()=>{c.remove()}),c):c.remove();return t.selectAll("g.label-group").data(e,c=>c.name).join(c=>a(c),c=>l(c),c=>u(c))}function Vm(t=null){if(!this.showGrid)return;const e=this.getIdealTopicTreeLevel();if(e!==null){if(this.lastGridTreeLevels.length>0){const n=this.lastGridTreeLevels[this.lastGridTreeLevels.length-1];e!==n&&(this.topicCanvases[n%2].classed("faded",!0).on("transitionend",()=>{this.lastGridTreeLevels[0]===n&&this.lastGridTreeLevels.shift()}),this.topicCanvases[e%2].classed("faded",!1),this.lastGridTreeLevels.push(e),this.lastGridTreeLevels.length>2&&this.lastGridTreeLevels.shift())}this.lastGridTreeLevels.length===0&&this.lastGridTreeLevels.push(e);for(const n of this.lastGridTreeLevels){const r=this.topicCanvases[n%2].node().getContext("2d");if(r===null)return;const o=this.topicLevelTrees.get(n),s=o.extent(),a=(s[1][0]-s[0][0])/Math.pow(2,n),l=Math.abs(this.xScale(a)-this.xScale(0)),u=this.getCurZoomBox(),f=o.data().map(c=>({x:this.xScale(c[0]-a/2),y:this.yScale(c[1]-a/2),width:l,height:l,name:`${c[0],c[1]}`,label:c[2]})).filter(c=>ve(c,u));r.save(),t?r.strokeStyle=t:this.showContour?r.strokeStyle=Nt.gridColorLight:r.strokeStyle=Nt.gridColorDark,r.lineWidth=1/(4*this.curZoomTransform.k);for(const c of f)r.moveTo(c.x,c.y),Um(r,c.x,c.y,c.width,c.height,4/this.curZoomTransform.k),r.stroke();r.restore()}}}function $m(t,e,n,i){const o=(t-(e||t))/n;if(o>1)return;const s=i(o);this.redrawTopicGrid(s),requestAnimationFrame(a=>{this.drawTopicGridFrame(a,e||t,n,i)})}function Um(t,e,n,i,r,o){const s={tl:0,tr:0,br:0,bl:0};typeof o=="number"?(s.tl=o,s.tr=o,s.br=o,s.bl=o):(s.tl=o[0],s.tr=o[1],s.br=o[2],s.bl=o[3]),t.beginPath(),t.moveTo(e+s.tl,n),t.lineTo(e+i-s.tr,n),t.quadraticCurveTo(e+i,n,e+i,n+s.tr),t.lineTo(e+i,n+r-s.br),t.quadraticCurveTo(e+i,n+r,e+i-s.br,n+r),t.lineTo(e+s.bl,n+r),t.quadraticCurveTo(e,n+r,e,n+r-s.bl),t.lineTo(e,n+s.tl),t.quadraticCurveTo(e,n,e+s.tl,n),t.closePath()}function Gm(t=null){if(this.topicLevelTrees.size<=1||this.contours===null||!this.showLabel)return;const e=this.topSvg.select("g.top-content g.topics"),n=[];for(let _=this.contours.length-1;_>=0;_--){const V=this.contours[_];for(const L of V.coordinates){const C=[],O=[];for(const A of L[0])C.push(A[0]),O.push(A[1]);const E=C.reduce((A,k)=>A+k)/C.length,v=O.reduce((A,k)=>A+k)/O.length;n.push([E,v,V.value])}}const i=this.getCurZoomBox(),r=this.getIdealTopicTreeLevel(),o=this.topicLevelTrees.get(r),s=o.extent(),a=(s[1][0]-s[0][0])/Math.pow(2,r),l=Math.abs(this.xScale(a)-this.xScale(0)),u=B.transition("removal").duration(400).ease(B.easeCubicInOut),f=e.selectAll("g.topics-content").data([r],_=>_).join(_=>{const V=_.append("g").attr("class",L=>`topics-content zoom-${L}`).style("opacity",0);return V.transition(u).style("opacity",1),_.empty()||(this.lastLabelNames=new Map),V},_=>_,_=>this.lastLabelTreeLevel!==r?_.transition(u).style("opacity",0).on("end",()=>{_.remove()}):_);this.lastLabelTreeLevel=r;const c=new Map,h=new Map;for(const _ of n){const V=this.xScale.invert(_[0]),L=this.yScale.invert(_[1]),C=a*.5,O=jm(o,V-C,L-C,V+C,L+C);for(const E of O){const v={tileX:E[0]-a/2,tileY:E[1]+a/2,tileCenterX:E[0],tileCenterY:E[1],pointX:V,pointY:L,name:E[2]};h.has(v.name)?h.set(v.name,h.get(v.name)+_[2]):(h.set(v.name,_[2]),c.set(v.name,v))}}const d=[...h].sort((_,V)=>V[1]-_[1]).map(_=>c.get(_[0])),p=[],b=[],m=14/this.curZoomTransform.k,g=m*1.1,x=6.4/this.curZoomTransform.k,w=6.4/this.curZoomTransform.k;let y=0,M=0;for(const _ of d){const V=_.name.length>12;let L=_.name.slice(0,Math.floor(_.name.length/2)),C=_.name.slice(Math.floor(_.name.length/2));if(V&&_.name.split(xa).length>=4){const F=_.name.split(xa);L=F.slice(0,2).join("-")+"-",C=F.slice(2).join("-")}const O=V?Math.max(Ft(L,m),Ft(C,m)):Ft(_.name,m),E=V?g*1.8:g;let v=!0,A=null,k=null;const S=[rt.left,rt.right,rt.bottom,rt.top];_.tileCenterX>=(s[0][0]+s[1][0])/2&&(S[0]=rt.right,S[1]=rt.left);let $=null,I=!1;const T={x:this.xScale(_.tileX),y:this.yScale(_.tileY),width:l,height:l};for(const F of p){if(ve(T,F)){I=!0;break}const U=Math.abs(F.tileX-_.tileX),ot=Math.abs(F.tileY-_.tileY);U+ot<=a&&($=F.direction)}if(!I){switch($){case rt.left:{S.splice(S.indexOf(rt.right),1),S.unshift(rt.right);break}case rt.right:{S.splice(S.indexOf(rt.left),1),S.unshift(rt.left);break}case rt.top:{S.splice(S.indexOf(rt.bottom),1),S.unshift(rt.bottom);break}case rt.bottom:{S.splice(S.indexOf(rt.top),1),S.unshift(rt.top);break}}for(const F of d)if(F.tileY===_.tileY){const U=F.tileX-_.tileX;U===a?(S.splice(S.indexOf(rt.left),1),S.unshift(rt.left)):U===-a&&(S.splice(S.indexOf(rt.right),1),S.unshift(rt.right))}if(this.lastLabelNames.has(_.name)){const F=this.lastLabelNames.get(_.name);S.splice(S.indexOf(F),1),S.unshift(F)}for(const F of S){v=!0;const U={x:0,y:0,width:O,height:E};switch(F){case rt.top:U.x=this.xScale(_.tileCenterX)-O/2,U.y=this.yScale(_.tileCenterY)-l/2-E-x;break;case rt.bottom:U.x=this.xScale(_.tileCenterX)-O/2,U.y=this.yScale(_.tileCenterY)+l/2+x;break;case rt.left:U.x=this.xScale(_.tileCenterX)-l/2-O-w,U.y=this.yScale(_.tileCenterY)-E/2;break;case rt.right:U.x=this.xScale(_.tileCenterX)+l/2+w,U.y=this.yScale(_.tileCenterY)-E/2;break;default:console.error("Unknown direction value.");break}for(const ot of p)if(ve(U,ot)){v=!1;break}for(const ot of b)if(ve(U,ot)){v=!1;break}if(v){A=U,k=F;break}}if(v&&A&&k){const F={x:A.x,y:A.y,width:A.width,height:A.height,direction:k,pointX:_.pointX,pointY:_.pointY,tileX:_.tileX,tileY:_.tileY,toHide:!1,name:_.name,lines:V?[L,C]:[_.name],labelX:this.xScale(_.tileCenterX),labelY:this.yScale(_.tileCenterY)},U={x:this.xScale(_.tileX),y:this.yScale(_.tileY),width:l,height:l};switch(F.toHide=!ve(A,i)&&!ve(U,i),F.toHide||(M+=1,t!==null&&(y>=t&&(!this.contoursInitialized||!this.lastLabelNames.has(_.name))?F.toHide=!0:y+=1)),k){case rt.top:{F.labelY-=x+l/2+(V?g:0);break}case rt.bottom:{F.labelY+=x+l/2;break}case rt.left:{F.labelX-=w+l/2,F.labelY-=V?g:0;break}case rt.right:{F.labelX+=w+l/2,F.labelY-=V?g:0;break}default:{console.error("Unknown layout value.");break}}p.push(F),b.push(U)}}}this.drawLabels(f,p,l,r,m),this.lastLabelNames=new Map,p.filter(_=>!_.toHide).forEach(_=>this.lastLabelNames.set(_.name,_.direction)),this.maxLabelNum=M,this.curLabelNum=y;const W=this.component.querySelector("input#slider-label-num");W.max=`${this.maxLabelNum}`,W.value=`${this.curLabelNum}`;const R=this.component.querySelector("span.slider-count");R.innerText=`${this.curLabelNum}`}function Zm(){if(this.topicLevelTrees.size<1)return null;let t=-1,e=1/0;for(const n of this.topicLevelTrees.keys()){const i=this.topicLevelTrees.get(n).extent(),r=i[1][0]-i[0][0],o=Math.pow(2,n),s=r/o,a=Math.max(this.xScale(s)-this.xScale(0),this.yScale(s)-this.yScale(0))*this.curZoomTransform.k;Math.abs(a-va){yn!==null&&(clearTimeout(yn),yn=null),yn=setTimeout(()=>{i.classed("faded",!1),s.interrupt("top-fade").remove(),o.remove(),this.tooltipStoreValue.show=!1,this.tooltipStore.set(this.tooltipStoreValue),yn=null},50)};if(t===null||e===null){l();return}const u=this.xScale.invert(this.curZoomTransform.invertX(t)),f=this.yScale.invert(this.curZoomTransform.invertY(e)),c=this.getIdealTopicTreeLevel(),h=this.topicLevelTrees.get(c),d=h.extent(),p=(d[1][0]-d[0][0])/Math.pow(2,c),b=Math.abs(this.xScale(p)-this.xScale(0)),m=Math.sqrt(2)*p,g=h.find(u,f,m);if(g===void 0){o.empty()||l();return}if(o.empty()){const x=n.append("rect").attr("class","highlight-tile").attr("x",this.xScale(g[0])-b/2).attr("y",this.yScale(g[1])-b/2).attr("width",b).attr("height",b).attr("rx",4/this.curZoomTransform.k).attr("ry",4/this.curZoomTransform.k).style("stroke-width",2.6/this.curZoomTransform.k).style("stroke",this.showContour?Nt.gridColorLight:Nt.gridColorDark),w=x.node().getBoundingClientRect(),y=w.width,M=w.x+y/2,W=w.y;this.tooltipStoreValue.html=` +
+ ${g[2]} +
+ `,this.tooltipStoreValue.x=M,this.tooltipStoreValue.y=W,this.tooltipStoreValue.show=!0;const R=x.clone(!0).style("stroke",null).remove().node(),_=B.select(r.node().appendChild(R));mn=g[2],_.style("opacity",0).transition("top-fade").duration(a).ease(B.easeCubicInOut).on("end",()=>{_.style("opacity",1),i.classed("faded",!0),this.tooltipStore.set(this.tooltipStoreValue),mn=null})}else{o.attr("x",this.xScale(g[0])-b/2).attr("y",this.yScale(g[1])-b/2).attr("width",b).attr("height",b).attr("rx",4/this.curZoomTransform.k).attr("ry",4/this.curZoomTransform.k).style("stroke-width",2.6/this.curZoomTransform.k),s.attr("x",this.xScale(g[0])-b/2).attr("y",this.yScale(g[1])-b/2).attr("width",b).attr("height",b).attr("rx",4/this.curZoomTransform.k).attr("ry",4/this.curZoomTransform.k).style("stroke-width",2.6/this.curZoomTransform.k);const x=o.node().getBoundingClientRect(),w=x.width,y=x.x+w/2,M=x.y;this.tooltipStoreValue.html=` +
+ ${g[2]} +
+ `,this.tooltipStoreValue.x=y,this.tooltipStoreValue.y=M,this.tooltipStoreValue.show=!0,mn===null?this.tooltipStore.set(this.tooltipStoreValue):(mn=g[2],s.interrupt("top-fade").style("opacity",0).transition("top-fade").duration(a).ease(B.easeCubicInOut).on("end",()=>{s.style("opacity",1),i.classed("faded",!0),this.tooltipStore.set(this.tooltipStoreValue),mn=null}))}}function Hm(t=null){const e=this.topicCanvases.map(n=>n.node().getContext("2d"));for(const n of e)n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,this.svgFullSize.width,this.svgFullSize.height),n.translate(this.curZoomTransform.x,this.curZoomTransform.y),n.scale(this.curZoomTransform.k,this.curZoomTransform.k);this.drawTopicGrid(t)}const jm=(t,e,n,i,r)=>{const o=[];return t.visit((s,a,l,u,f)=>{if(!s.length){let c=s;do{const h=c.data;h[0]>=e&&h[0]=n&&h[1]=i||l>=r||u=256*256*256)return console.error("Unique color overflow."),"#fffff";const t=B.randomInt(0,256);let e=ao(t(),t(),t());for(;this.colorPointMap.has(e)||e==="#000000";)e=ao(t(),t(),t());return e}function Jm(){if(!this.showPoint)return;const t=yu*this.initZoomTransform.k/Math.sqrt(this.curZoomTransform.k);this.pointCtx.globalAlpha=.5;for(const e of this.promptPoints){const n=this.xScale(e.x),i=this.yScale(e.y);this.pointCtx.beginPath(),this.pointCtx.arc(n,i,t,0,wu);const r=Nt.colors["gray-900"];this.pointCtx.fillStyle=r,this.pointCtx.fill()}}function t2(){if(!this.showPoint)return;this.colorPointMap.clear();const t=Km*this.initZoomTransform.k,e=Math.max(t,3.5*t-this.curZoomTransform.k);for(const n of this.promptPoints){this.pointBackCtx.beginPath();const i=this.xScale(n.x),r=this.yScale(n.y);this.pointBackCtx.arc(i,r,e,0,wu);const o=this.getNextUniqueColor();this.colorPointMap.set(o,n),this.pointBackCtx.fillStyle=o,this.pointBackCtx.fill()}}function e2(t){if(this.hoverMode!=="point"||!this.showPoint||t===this.hoverPoint)return;const e=this.topSvg.select("g.top-content g.highlights"),n=e.select("circle.highlight-point");if(t===void 0){n.empty()||(le!==null&&(clearTimeout(le),le=null),le=setTimeout(()=>{this.hoverPoint=null,n.remove(),this.tooltipStoreValue.show=!1,this.tooltipStore.set(this.tooltipStoreValue),le=null},50));return}this.hoverPoint=t,le!==null&&(clearTimeout(le),le=null);const i=Math.max(yu*1.5,7/this.curZoomTransform.k),r=1.2/this.curZoomTransform.k;if(n.empty()){const s=e.append("circle").attr("class","highlight-point").attr("cx",this.xScale(t.x)).attr("cy",this.yScale(t.y)).attr("r",i).style("stroke-width",r).node().getBoundingClientRect(),a=s.width,l=s.x+a/2,u=s.y;this.tooltipStoreValue.html=` +
+ ${t.prompt} +
+ `,this.tooltipStoreValue.x=l,this.tooltipStoreValue.y=u,this.tooltipStoreValue.show=!0,re!==null&&(clearTimeout(re),re=null),re=setTimeout(()=>{this.tooltipStore.set(this.tooltipStoreValue),re=null},300)}else{n.attr("cx",this.xScale(t.x)).attr("cy",this.yScale(t.y)).attr("r",i).style("stroke-width",r);const o=n.node().getBoundingClientRect(),s=o.width,a=o.x+s/2,l=o.y;this.tooltipStoreValue.html=` +
+ ${t.prompt} +
+ `,this.tooltipStoreValue.x=a,this.tooltipStoreValue.y=l,this.tooltipStoreValue.show=!0,re!==null?(clearTimeout(re),re=setTimeout(()=>{this.tooltipStore.set(this.tooltipStoreValue),re=null},300)):this.tooltipStore.set(this.tooltipStoreValue)}}function n2(){this.pointCtx.save(),this.pointCtx.setTransform(1,0,0,1,0,0),this.pointCtx.clearRect(0,0,this.svgFullSize.width,this.svgFullSize.height),this.pointCtx.translate(this.curZoomTransform.x,this.curZoomTransform.y),this.pointCtx.scale(this.curZoomTransform.k,this.curZoomTransform.k),this.drawScatterCanvas(),this.pointCtx.restore()}function i2(){this.pointBackCtx.save(),this.pointBackCtx.setTransform(1,0,0,1,0,0),this.pointBackCtx.clearRect(0,0,this.svgFullSize.width,this.svgFullSize.height),this.pointBackCtx.translate(this.curZoomTransform.x,this.curZoomTransform.y),this.pointBackCtx.scale(this.curZoomTransform.k,this.curZoomTransform.k),this.drawScatterBackCanvas(),this.pointBackCtx.restore()}const De=[];function r2(t,e=Lt){let n;const i=new Set;function r(a){if(rn(t,a)&&(t=a,n)){const l=!De.length;for(const u of i)u[1](),De.push(u,t);if(l){for(let u=0;u{i.delete(u),i.size===0&&(n(),n=null)}}return{set:r,update:o,subscribe:s}}const Le=()=>({show:!1,html:"null",x:0,y:0,width:0,maxWidth:300,fontSize:14,orientation:"s",mouseoverTimeout:null}),ba=()=>r2(Le()),_a=Nt.debug,o2=300;let ka="/diffusiondb/explorer/data";console.log({BASE_URL:"/diffusiondb/explorer/",MODE:"github",DEV:!0,PROD:!1});class Ma{constructor({component:e,tooltipStore:n,updateEmbedding:i,defaultSetting:r,embeddingName:o}){D(this,"svg");D(this,"svgFullSize");D(this,"svgSize");D(this,"svgPadding");D(this,"topSvg");D(this,"pointCanvas");D(this,"topicCanvases");D(this,"pointCtx");D(this,"pointBackCanvas");D(this,"pointBackCtx");D(this,"colorPointMap",new Map);D(this,"hoverPoint",null);D(this,"xScale");D(this,"yScale");D(this,"component");D(this,"updateEmbedding");D(this,"embeddingName");D(this,"pointURL");D(this,"gridURL");D(this,"zoom",null);D(this,"initZoomTransform",B.zoomIdentity);D(this,"curZoomTransform",B.zoomIdentity);D(this,"curZoomLevel",1);D(this,"lastMouseClientPosition",null);D(this,"hoverMode","label");D(this,"showContour");D(this,"showGrid");D(this,"showPoint");D(this,"showLabel");D(this,"promptPoints",[]);D(this,"gridData",null);D(this,"tileData",null);D(this,"contours",null);D(this,"contoursInitialized",!1);D(this,"lastRefillID",0);D(this,"lsatRefillTime",0);D(this,"topicLevelTrees",new Map);D(this,"maxLabelNum",0);D(this,"curLabelNum",0);D(this,"userMaxLabelNum",20);D(this,"lastLabelNames",new Map);D(this,"lastLabelTreeLevel",null);D(this,"lastGridTreeLevels",[]);D(this,"tooltipStore");D(this,"tooltipStoreValue",Le());D(this,"embeddingWorker");D(this,"drawLabels",Ym);D(this,"layoutTopicLabels",Gm);D(this,"addTileIndicatorPath",qm);D(this,"getIdealTopicTreeLevel",Zm);D(this,"labelNumSliderChanged",Xm);D(this,"mouseoverLabel",Bm);D(this,"drawTopicGrid",Vm);D(this,"redrawTopicGrid",Hm);D(this,"drawTopicGridFrame",$m);D(this,"drawScatterCanvas",Jm);D(this,"drawScatterBackCanvas",t2);D(this,"getNextUniqueColor",Qm);D(this,"highlightPoint",e2);D(this,"redrawFrontPoints",n2);D(this,"redrawBackPoints",i2);D(this,"initStores",()=>{this.tooltipStore.subscribe(e=>{this.tooltipStoreValue=e})});D(this,"initTopSvg",()=>{const e=B.select(this.component).select(".top-svg").attr("width",this.svgFullSize.width).attr("height",this.svgFullSize.height).on("pointermove",r=>this.mousemoveHandler(r)).on("mouseleave",()=>{this.highlightPoint(void 0),this.mouseoverLabel(null,null)}),n=e.append("g").attr("class","top-group");n.append("rect").attr("class","mouse-track-rect").attr("width",this.svgFullSize.width).attr("height",this.svgFullSize.height);const i=n.append("g").attr("class","top-content");return i.append("g").attr("class","topics-bottom"),i.append("g").attr("class","topics").classed("hidden",!this.showLabel),i.append("g").attr("class","topics-top"),i.append("g").attr("class","highlights"),e});D(this,"initData",async()=>{const e=await B.json(this.gridURL);if(e===void 0)throw Error("Fail to load grid data.");this.gridData=e;const n=this.gridData.xRange,i=this.gridData.yRange;let r=n[1]-n[0],o=i[1]-i[0];this.gridData.padded||(r{if(l)for(const u of Object.keys(l.data)){const f=B.quadtree().x(c=>c[0]).y(c=>c[1]).addAll(l.data[u]);this.topicLevelTrees.set(parseInt(u),f)}else console.error("Fail to read topic data.")});Promise.all([a]).then(()=>{this.drawTopicGrid(),this.layoutTopicLabels(this.userMaxLabelNum),setTimeout(()=>{this.component.querySelector("input#slider-label-num").value=`${this.curLabelNum}`},500)})});D(this,"initSVGGroups",()=>{const e=this.svg.append("g").attr("class","umap-group").attr("transform",`translate(${this.svgPadding.left}, ${this.svgPadding.top})`);e.append("g").attr("class","contour-group").classed("hidden",!this.showContour),e.append("g").attr("class","quad-group"),e.append("g").attr("class","tile-group"),e.append("g").attr("class","scatter-group")});D(this,"drawQuadtree",()=>{const e=this.svg.select("g.quad-group"),n=B.quadtree().x(r=>r.x).y(r=>r.y).extent([[this.xScale.domain()[0],this.yScale.domain()[0]],[this.xScale.domain()[1],this.yScale.domain()[1]]]).addAll(this.promptPoints),i=[];n.visit((r,o,s,a,l)=>{if(r.length===void 0){const u={x0:o,x1:a,y0:s,y1:l};i.push(u)}}),e.selectAll(".quadtree-node").data(i).join("rect").attr("class","quadtree-node").attr("x",r=>this.xScale(r.x0)).attr("y",r=>this.yScale(r.y1)).attr("width",r=>this.yScale(r.y0)-this.yScale(r.y1)).attr("height",r=>this.xScale(r.x1)-this.xScale(r.x0)).style("fill","none").style("stroke","gray").style("stroke-width",.4).style("opacity",.9)});D(this,"drawContour",()=>{if(this.gridData==null)return console.error("Grid data not initialized"),null;const e=this.svg.select(".contour-group"),n=[];for(const x of this.gridData.grid)for(const w of x)n.push(w);const i=12,r=[],o=Math.min(...n),a=(Math.max(...n)-o)/i;for(let x=0;x(x.coordinates=x.coordinates.map(w=>w.map(y=>y.map(M=>[this.xScale(u(M[0])),this.yScale(f(M[1]))]))),x));const c=B.interpolateLab("#ffffff",Nt.colors["light-blue-800"]);let h=B.scaleSequential(B.extent(r),x=>c(x/1));if(this.embeddingName==="image"){const x=B.interpolateLab("#ffffff",Nt.colors["pink-900"]);h=B.scaleSequential(B.extent(r),w=>x(w/1))}e.selectAll("path").data(l).join("path").attr("fill",x=>h(x.value)).attr("d",B.geoPath());let d=1/0,p=1/0,b=-1/0,m=-1/0;if(l.length>1)for(const x of l[1].coordinates)for(const w of x)for(const y of w)y[0]b&&(b=y[0]),y[1]>m&&(m=y[1]);const g=Math.min(this.svgFullSize.width/(b-d),this.svgFullSize.height/(m-p));return this.initZoomTransform=B.zoomIdentity.translate(this.svgSize.width/2,this.svgSize.height/2).scale(g).translate(-d-(b-d)/2,-p-(m-p)/2),this.embeddingName==="image"&&(this.initZoomTransform=B.zoomIdentity.translate(this.svgSize.width/2,this.svgSize.height/2).scale(1.6).translate(-340,-376)),this.topSvg.transition().duration(300).call(x=>{var w;return(w=this.zoom)==null?void 0:w.transform(x,this.initZoomTransform)}).on("end",()=>{this.contoursInitialized=!0}),this.topSvg.on("dblclick",()=>{this.topSvg.transition().duration(700).call(x=>{var w;(w=this.zoom)==null||w.transform(x,this.initZoomTransform)})}),l});D(this,"zoomed",async e=>{const n=e.transform;if(this.curZoomTransform=n,this.svg.select(".umap-group").attr("transform",`${n.toString()}`),this.topSvg.select(".top-group").attr("transform",`${n.toString()}`),Date.now()-this.lsatRefillTime>o2){const i={command:"startRefillRegion",payload:{refillID:++this.lastRefillID,viewRange:this.getCurViewRanges()}};this.embeddingWorker.postMessage(i),this.lsatRefillTime=Date.now()}this.showPoint&&this.redrawFrontPoints(),this.showLabel&&this.layoutTopicLabels(this.userMaxLabelNum),this.showGrid&&this.redrawTopicGrid(),this.hoverMode==="label"&&this.lastMouseClientPosition&&this.mouseoverLabel(this.lastMouseClientPosition.x,this.lastMouseClientPosition.y),await zm(),this.showPoint&&this.redrawBackPoints()});D(this,"zoomEnded",()=>{const e={command:"startRefillRegion",payload:{refillID:++this.lastRefillID,viewRange:this.getCurViewRanges()}};this.embeddingWorker.postMessage(e)});D(this,"embeddingWorkerMessageHandler",e=>{switch(e.data.command){case"finishLoadData":{e.data.payload.isFirstBatch&&e.data.payload.points?(this.promptPoints=e.data.payload.points,this.redrawFrontPoints(),this.redrawBackPoints()):console.log("Finished loading all");break}case"finishRefillRegion":{e.data.payload.refillID===this.lastRefillID&&(this.promptPoints=e.data.payload.points,this.redrawFrontPoints(),this.redrawBackPoints());break}default:{console.error("Unknown message",e.data.command);break}}});D(this,"mousemoveHandler",e=>{const n=e.offsetX,i=e.offsetY;this.lastMouseClientPosition={x:n,y:i};const r=this.pointBackCtx.getImageData(n,i,1,1),o=ao(r.data[0],r.data[1],r.data[2]),s=this.colorPointMap.get(o);this.highlightPoint(s),this.mouseoverLabel(n,i)});D(this,"getCurZoomBox",()=>({x:this.curZoomTransform.invertX(0),y:this.curZoomTransform.invertY(0),width:Math.abs(this.curZoomTransform.invertX(this.svgFullSize.width)-this.curZoomTransform.invertX(0)),height:Math.abs(this.curZoomTransform.invertY(this.svgFullSize.height)-this.curZoomTransform.invertY(0))}));D(this,"getCurViewRanges",()=>{const e=this.getCurZoomBox(),n=this.xScale.invert(e.x),i=this.xScale.invert(e.x+e.width),r=this.yScale.invert(e.y+e.height),o=this.yScale.invert(e.y);return[n,i,r,o]});D(this,"hoverModeChanged",e=>{this.hoverMode=e});D(this,"displayCheckboxChanged",(e,n)=>{switch(e){case"contour":{if(this.showContour=n,this.svg.select("g.contour-group").classed("hidden",!this.showContour),this.showGrid){let i,r;this.showContour?(i=Nt.gridColorDark,r=Nt.gridColorLight):(i=Nt.gridColorLight,r=Nt.gridColorDark);const o=300,s=B.interpolateHsl(i,r);requestAnimationFrame(a=>{this.drawTopicGridFrame(a,null,o,s)})}break}case"point":{this.showPoint=n,this.pointCanvas.classed("hidden",!this.showPoint).classed("faded",this.showPoint&&this.showLabel),this.showPoint&&(this.redrawFrontPoints(),this.redrawBackPoints()),this.showGrid&&this.redrawTopicGrid();break}case"grid":{this.showGrid=n,this.topicCanvases.forEach(i=>i.classed("hidden",!this.showGrid)),this.showGrid&&this.redrawTopicGrid();break}case"label":{this.showLabel=n,this.topSvg.select("g.top-content g.topics").classed("hidden",!this.showLabel),this.pointCanvas.classed("faded",this.showPoint&&this.showLabel),this.showLabel&&this.layoutTopicLabels(this.userMaxLabelNum);break}default:{console.error("Unknown checkbox name",e);break}}});var a;this.component=e,this.tooltipStore=n,this.updateEmbedding=i,this.embeddingName=o,this.pointURL=ka+"/umap-1m.ndjson",this.gridURL="/diffusiondb/explorer/data/umap-1m-grid.json",o==="image"&&(this.pointURL=ka+"/umap-image-150k.ndjson",this.gridURL="/diffusiondb/explorer/data/umap-image-1m-grid.json"),this.hoverMode=r.hover,this.showContour=r.showContour,this.showGrid=r.showGrid,this.showPoint=r.showPoint,this.showLabel=r.showLabel,this.embeddingWorker=new Worker(new URL("/diffusiondb/explorer/assets/EmbeddingWorker.65f7e4d8.js",self.location),{type:"module"}),this.embeddingWorker.onmessage=l=>{this.embeddingWorkerMessageHandler(l)},this.svg=B.select(this.component).select(".embedding-svg"),this.svgFullSize={width:0,height:0};const s=(a=this.svg.node())==null?void 0:a.getBoundingClientRect();s!==void 0&&(this.svgFullSize.width=s.width,this.svgFullSize.height=s.height),this.svgPadding={top:5,bottom:5,left:5,right:5},this.svgSize={width:this.svgFullSize.width-this.svgPadding.left-this.svgPadding.right,height:this.svgFullSize.width-this.svgPadding.top-this.svgPadding.bottom},this.xScale=B.scaleLinear(),this.yScale=B.scaleLinear(),this.initSVGGroups(),this.topSvg=this.initTopSvg(),this.pointCanvas=B.select(this.component).select(".embedding-canvas").attr("width",this.svgFullSize.width).attr("height",this.svgFullSize.height),this.pointCtx=this.pointCanvas.node().getContext("2d"),this.topicCanvases=[];for(const l of["top","bottom"])this.topicCanvases.push(B.select(this.component).select(`.topic-grid-canvas.${l}`).attr("width",this.svgFullSize.width).attr("height",this.svgFullSize.height).classed("hidden",!this.showGrid));this.pointBackCanvas=B.select(this.component).select(".embedding-canvas-back").attr("width",this.svgFullSize.width).attr("height",this.svgFullSize.height),this.pointBackCtx=this.pointBackCanvas.node().getContext("2d",{willReadFrequently:!0}),this.pointBackCtx.imageSmoothingEnabled=!1,this.zoom=B.zoom().extent([[0,0],[this.svgSize.width,this.svgSize.height]]).scaleExtent([1,8]).on("zoom",l=>{(async()=>await this.zoomed(l))()}).on("end",()=>this.zoomEnded()),this.topSvg.call(this.zoom).on("dblclick.zoom",null),Ui("Init data",_a),this.initData().then(()=>{Ui("Init data",_a)}),this.initStores()}}const vu=` + + + + + + + + + + +`;const tt="src/components/embedding/Embedding.svelte";function lo(t){let e,n,i,r,o,s,a,l,u,f,c,h,d,p,b,m,g,x,w,y,M,W,R,_,V,L,C,O,E,v,A,k,S,$,I,T,F,U,ot,H,at,ut,K,Q,Y,X,et,z,nt,q,ct,ft,j,it,$t,zt,Jn,Go,de,ln,Zo,Kt,Qt,qo,Jt,Xo,te,Bo,ge,pe,Ki,Ho;const jo={c:function(){e=Z("div"),n=Z("div"),i=bi("svg"),r=J(),o=Z("canvas"),s=J(),a=Z("canvas"),l=J(),u=Z("canvas"),f=J(),c=Z("canvas"),h=J(),d=bi("svg"),p=J(),b=Z("div"),m=Z("div"),m.textContent="Setting",g=J(),x=Z("div"),w=J(),y=Z("div"),M=Z("div"),M.textContent="Display",W=J(),R=Z("div"),_=Z("input"),V=J(),L=Z("label"),L.textContent="Density Contour",C=J(),O=Z("div"),E=Z("input"),v=J(),A=Z("label"),A.textContent="Data Points",k=J(),S=Z("div"),$=Z("input"),I=J(),T=Z("label"),T.textContent="Label Grid",F=J(),U=Z("div"),ot=J(),H=Z("div"),at=Z("div"),at.textContent="Automatic Labeling",ut=J(),K=Z("div"),Q=Z("input"),Y=J(),X=Z("label"),X.textContent="High Density Region",et=J(),z=Z("div"),nt=Z("div"),q=Z("label"),q.textContent="Number of Labels",ct=J(),ft=Z("span"),ft.textContent="0",j=J(),it=Z("input"),zt=J(),Jn=Z("div"),Go=J(),de=Z("div"),ln=Z("div"),ln.textContent="Mouse Hover Mode",Zo=J(),Kt=Z("div"),Qt=Z("div"),Qt.textContent="Label",qo=J(),Jt=Z("div"),Jt.textContent="Point",Xo=J(),te=Z("div"),te.textContent="None",Bo=J(),ge=Z("div"),pe=Z("div"),P(i,"class","top-svg s-ovhWPbaoO3ET"),G(i,tt,422,4,8893),P(o,"class","embedding-canvas s-ovhWPbaoO3ET"),G(o,tt,423,4,8921),P(a,"class","embedding-canvas-back s-ovhWPbaoO3ET"),G(a,tt,424,4,8961),P(u,"class","topic-grid-canvas top s-ovhWPbaoO3ET"),G(u,tt,425,4,9006),P(c,"class","topic-grid-canvas bottom s-ovhWPbaoO3ET"),G(c,tt,426,4,9051),P(d,"class","embedding-svg s-ovhWPbaoO3ET"),G(d,tt,427,4,9099),P(n,"class","embedding s-ovhWPbaoO3ET"),G(n,tt,421,2,8865),P(m,"class","header s-ovhWPbaoO3ET"),G(m,tt,431,4,9199),P(x,"class","splitter s-ovhWPbaoO3ET"),G(x,tt,433,4,9238),P(M,"class","item-header s-ovhWPbaoO3ET"),G(M,tt,436,6,9301),P(_,"type","checkbox"),P(_,"class","checkbox s-ovhWPbaoO3ET"),P(_,"id","checkbox-contour"),P(_,"name","checkbox-contour"),G(_,tt,439,8,9381),P(L,"for","checkbox-contour"),P(L,"class","s-ovhWPbaoO3ET"),G(L,tt,447,8,9641),P(R,"class","control-row s-ovhWPbaoO3ET"),G(R,tt,438,6,9347),P(E,"type","checkbox"),P(E,"class","checkbox s-ovhWPbaoO3ET"),P(E,"id","checkbox-point"),P(E,"name","checkbox-point"),G(E,tt,451,8,9749),P(A,"for","checkbox-point"),P(A,"class","s-ovhWPbaoO3ET"),G(A,tt,459,8,10001),P(O,"class","control-row s-ovhWPbaoO3ET"),G(O,tt,450,6,9715),P($,"type","checkbox"),P($,"class","checkbox s-ovhWPbaoO3ET"),P($,"id","checkbox-grid"),P($,"name","checkbox-grid"),G($,tt,463,8,10103),P(T,"for","checkbox-grid"),P(T,"class","s-ovhWPbaoO3ET"),G(T,tt,471,8,10351),P(S,"class","control-row s-ovhWPbaoO3ET"),G(S,tt,462,6,10069),P(y,"class","control-item s-ovhWPbaoO3ET"),G(y,tt,435,4,9268),P(U,"class","splitter s-ovhWPbaoO3ET"),G(U,tt,475,4,10426),P(at,"class","item-header s-ovhWPbaoO3ET"),G(at,tt,478,6,10489),P(Q,"type","checkbox"),P(Q,"class","checkbox s-ovhWPbaoO3ET"),P(Q,"id","checkbox-label"),P(Q,"name","checkbox-label"),G(Q,tt,481,8,10580),P(X,"for","checkbox-label"),P(X,"class","s-ovhWPbaoO3ET"),G(X,tt,489,8,10832),P(K,"class","control-row s-ovhWPbaoO3ET"),G(K,tt,480,6,10546),P(H,"class","control-item s-ovhWPbaoO3ET"),G(H,tt,477,4,10456),P(q,"class","slider-label s-ovhWPbaoO3ET"),P(q,"for","slider-label-num"),G(q,tt,495,8,10996),P(ft,"class","slider-count s-ovhWPbaoO3ET"),G(ft,tt,498,8,11100),P(nt,"class","control-row s-ovhWPbaoO3ET"),G(nt,tt,494,6,10962),P(it,"type","range"),P(it,"class","slider s-ovhWPbaoO3ET"),P(it,"id","slider-label-num"),P(it,"name","label-num"),it.disabled=$t=!t[3].showLabel,P(it,"min","0"),P(it,"max","0"),G(it,tt,501,6,11156),P(z,"class","control-item slider-item s-ovhWPbaoO3ET"),G(z,tt,493,4,10917),P(Jn,"class","splitter s-ovhWPbaoO3ET"),G(Jn,tt,514,4,11456),P(ln,"class","item-header s-ovhWPbaoO3ET"),G(ln,tt,517,6,11519),P(Qt,"class","segmented-control-option s-ovhWPbaoO3ET"),lt(Qt,"selected",t[3].hover==="label"),G(Qt,tt,520,8,11614),P(Jt,"class","segmented-control-option s-ovhWPbaoO3ET"),lt(Jt,"selected",t[3].hover==="point"),G(Jt,tt,532,8,11934),P(te,"class","segmented-control-option s-ovhWPbaoO3ET"),lt(te,"selected",t[3].hover==="none"),G(te,tt,544,8,12254),P(Kt,"class","segmented-control s-ovhWPbaoO3ET"),G(Kt,tt,519,6,11574),P(de,"class","control-item s-ovhWPbaoO3ET"),G(de,tt,516,4,11486),P(b,"class","control-panel s-ovhWPbaoO3ET"),lt(b,"shown",t[2]),G(b,tt,430,2,9141),P(pe,"class","icon-wrapper svg-icon s-ovhWPbaoO3ET"),lt(pe,"activated",t[2]),G(pe,tt,569,4,12765),P(ge,"class","setting-icon s-ovhWPbaoO3ET"),G(ge,tt,560,2,12598),P(e,"class","embedding-wrapper s-ovhWPbaoO3ET"),G(e,tt,420,0,8809)},l:function(bt){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(bt,Pt){qe(bt,e,Pt),N(e,n),N(n,i),N(n,r),N(n,o),N(n,s),N(n,a),N(n,l),N(n,u),N(n,f),N(n,c),N(n,h),N(n,d),N(e,p),N(e,b),N(b,m),N(b,g),N(b,x),N(b,w),N(b,y),N(y,M),N(y,W),N(y,R),N(R,_),_.checked=t[3].showContour,N(R,V),N(R,L),N(y,C),N(y,O),N(O,E),E.checked=t[3].showPoint,N(O,v),N(O,A),N(y,k),N(y,S),N(S,$),$.checked=t[3].showGrid,N(S,I),N(S,T),N(b,F),N(b,U),N(b,ot),N(b,H),N(H,at),N(H,ut),N(H,K),N(K,Q),Q.checked=t[3].showLabel,N(K,Y),N(K,X),N(b,et),N(b,z),N(z,nt),N(nt,q),N(nt,ct),N(nt,ft),N(z,j),N(z,it),N(b,zt),N(b,Jn),N(b,Go),N(b,de),N(de,ln),N(de,Zo),N(de,Kt),N(Kt,Qt),N(Kt,qo),N(Kt,Jt),N(Kt,Xo),N(Kt,te),N(e,Bo),N(e,ge),N(ge,pe),pe.innerHTML=vu,t[27](e),Ki||(Ho=[dt(_,"change",t[10]),dt(_,"input",t[11],!1,!1,!1),dt(E,"change",t[12]),dt(E,"input",t[13],!1,!1,!1),dt($,"change",t[14]),dt($,"input",t[15],!1,!1,!1),dt(Q,"change",t[16]),dt(Q,"input",t[17],!1,!1,!1),dt(it,"input",t[18],!1,!1,!1),dt(Qt,"click",t[19],!1,!1,!1),dt(Qt,"keypress",t[20],!1,!1,!1),dt(Jt,"click",t[21],!1,!1,!1),dt(Jt,"keypress",t[22],!1,!1,!1),dt(te,"click",t[23],!1,!1,!1),dt(te,"keypress",t[24],!1,!1,!1),dt(ge,"click",t[25],!1,!1,!1),dt(ge,"keypress",t[26],!1,!1,!1)],Ki=!0)},p:function(bt,[Pt]){Pt&8&&(_.checked=bt[3].showContour),Pt&8&&(E.checked=bt[3].showPoint),Pt&8&&($.checked=bt[3].showGrid),Pt&8&&(Q.checked=bt[3].showLabel),Pt&8&&$t!==($t=!bt[3].showLabel)&&Uu(it,"disabled",$t),Pt&8&<(Qt,"selected",bt[3].hover==="label"),Pt&8&<(Jt,"selected",bt[3].hover==="point"),Pt&8&<(te,"selected",bt[3].hover==="none"),Pt&4&<(b,"shown",bt[2]),Pt&4&<(pe,"activated",bt[2])},i:Lt,o:Lt,d:function(bt){bt&&oe(e),t[27](null),Ki=!1,nn(Ho)}};return pt("SvelteRegisterBlock",{block:jo,id:lo.name,type:"component",source:"",ctx:t}),jo}function s2(t,e,n){let{$$slots:i={},$$scope:r}=e;Xn("Embedding",i,[]);let o=null,s=!1,a=!1,l=null,u=!1;const f={showContour:!0,showPoint:!1,showGrid:!0,showLabel:!0,hover:"none"};let{tooltipStore:c=null}=e,{embeddingName:h="prompt"}=e;_i(()=>{n(8,s=!0)});const d=()=>{n(1,l)},p=T=>{f.hover!==T&&(l==null||l.hoverModeChanged(T)),(T==="point"||T==="label"||T==="none")&&n(3,f.hover=T,f)},b=(T,F)=>{const U=T.target.checked;l==null||l.displayCheckboxChanged(F,U)},m=()=>{n(9,a=!0),o&&c&&n(1,l=new Ma({component:o,tooltipStore:c,updateEmbedding:d,defaultSetting:f,embeddingName:h}))},g=["tooltipStore","embeddingName"];Object.keys(e).forEach(T=>{!~g.indexOf(T)&&T.slice(0,2)!=="$$"&&T!=="slot"&&console.warn(` was created with unknown prop '${T}'`)});function x(){f.showContour=this.checked,n(3,f)}const w=T=>b(T,"contour");function y(){f.showPoint=this.checked,n(3,f)}const M=T=>b(T,"point");function W(){f.showGrid=this.checked,n(3,f)}const R=T=>b(T,"grid");function _(){f.showLabel=this.checked,n(3,f)}const V=T=>b(T,"label"),L=T=>l?l.labelNumSliderChanged(T):()=>{},C=()=>{p("label")},O=()=>{p("label")},E=()=>{p("point")},v=()=>{p("point")},A=()=>{p("none")},k=()=>{p("none")},S=()=>{n(2,u=!u)},$=()=>{n(2,u=!u)};function I(T){Ze[T?"unshift":"push"](()=>{o=T,n(0,o)})}return t.$$set=T=>{"tooltipStore"in T&&n(6,c=T.tooltipStore),"embeddingName"in T&&n(7,h=T.embeddingName)},t.$capture_state=()=>({Embedding:Ma,onMount:_i,getTooltipStoreDefaultValue:Le,iconGear:vu,component:o,mounted:s,initialized:a,embedding:l,showControl:u,defaultSetting:f,tooltipStore:c,embeddingName:h,updateEmbedding:d,hoverModeClicked:p,displayCheckboxChanged:b,initView:m}),t.$inject_state=T=>{"component"in T&&n(0,o=T.component),"mounted"in T&&n(8,s=T.mounted),"initialized"in T&&n(9,a=T.initialized),"embedding"in T&&n(1,l=T.embedding),"showControl"in T&&n(2,u=T.showControl),"tooltipStore"in T&&n(6,c=T.tooltipStore),"embeddingName"in T&&n(7,h=T.embeddingName)},e&&"$$inject"in e&&t.$inject_state(e.$$inject),t.$$.update=()=>{t.$$.dirty&833&&s&&!a&&o&&c&&m()},[o,l,u,f,p,b,c,h,s,a,x,w,y,M,W,R,_,V,L,C,O,E,v,A,k,S,$,I]}class uo extends Bn{constructor(e){super(e),qn(this,e,s2,lo,rn,{tooltipStore:6,embeddingName:7}),pt("SvelteRegisterComponent",{component:this,tagName:"Embedding_1",options:e,id:lo.name})}get tooltipStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set tooltipStore(e){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get embeddingName(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set embeddingName(e){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const Ta=Nt.debug,_t=12,Sa=4,xu=3;let Dt=null,ye=null;class Ca{constructor({component:e,tooltipStore:n,updatePacker:i}){D(this,"svg");D(this,"svgFullSize");D(this,"svgSize");D(this,"svgPadding");D(this,"svgBBox");D(this,"xScale");D(this,"yScale");D(this,"component");D(this,"updatePacker");D(this,"pack",null);D(this,"focusNode",null);D(this,"view",null);D(this,"baseView",null);D(this,"circleGroups",null);D(this,"topTextGroups",null);D(this,"hoverNode",null);D(this,"tooltipStore");D(this,"tooltipStoreValue",Le());D(this,"initData",async()=>{const e="/diffusiondb/explorer/data/phrases-tree.json",n=await B.json(e),i=B.hierarchy(n,r=>r.c).sum(r=>r.v).sort((r,o)=>o.data.v-r.data.v);this.pack=B.pack().padding(3).size([this.svgSize.width,this.svgSize.height])(i)});D(this,"drawCirclePacking",()=>{if(this.pack===null)return;const e=this.svg.select("g.content"),n=e.append("g").attr("class","content-circle");for(let l=1;l`circle-group circle-group-${l.depth}`).attr("id",l=>`circle-group-${l.data.id}`).attr("transform",l=>`translate(${l.x}, ${l.y})`).classed("no-pointer",l=>l.r<10&&l.children===void 0).style("font-size",`${_t}px`),this.circleGroups.append("circle").attr("class","phrase-circle").attr("cx",0).attr("cy",0).attr("r",l=>l.r).on("mouseenter",(l,u)=>this.circleMouseenterHandler(l,u)).on("mouseleave",l=>this.circleMouseleaveHandler(l)).on("click",(l,u)=>this.circleClickHandler(l,u)),this.circleGroups.append("text").attr("class",l=>`phrase-label phrase-label-${l.depth}`).each((l,u,f)=>Nr({d:l,i:u,g:f,hideParent:!0,checkHidden:!0,showHalo:!1,scale:1,markVisible:!0}));const o=i.filter(l=>l.depth===1),s=[];for(const l of o){let u=!1;for(const c of l.descendants())if(c.data.textInfo.visible){u=!0;break}if(u)continue;Math.min(l.data.textInfo.infos[0].diagonal,l.data.textInfo.infos[1].diagonal)<2*l.r&&s.push(l)}const a=this.svg.select("g.content-text-1");this.topTextGroups=a.selectAll("g.top-text-group").data(s).join("g").attr("class","top-text-group").attr("transform",l=>`translate(${l.x-l.r}, ${l.y-l.r})`).style("font-size",`${_t}px`),this.topTextGroups.append("text").attr("class","phrase-label").attr("transform",l=>`translate(${l.r}, ${l.r})`).each((l,u,f)=>Nr({d:l,i:u,g:f,hideParent:!1,checkHidden:!0,showHalo:!0,scale:1,markVisible:!1})),this.zoomToView(this.view)});D(this,"circleMouseenterHandler",(e,n)=>{if(this.circleGroups===null||this.focusNode&&this.focusNode.ancestors().includes(n))return;B.select(e.target).classed("hovered",!0),ye!==null&&(clearTimeout(ye),ye=null);const o=this.svg.select(`#circle-group-${n.data.id}`).node().getBoundingClientRect(),s=o.width,a=o.x+s/2,l=Math.max(this.svgBBox.y,o.y);this.tooltipStoreValue.html=this.getTooltipMessage(n),this.tooltipStoreValue.x=a,this.tooltipStoreValue.y=l,this.tooltipStoreValue.show=!0,this.hoverNode===null?(Dt&&clearTimeout(Dt),Dt=setTimeout(()=>{this.hoverNode=n,this.tooltipStore.set(this.tooltipStoreValue),Dt=null},500)):(Dt&&clearTimeout(Dt),Dt=setTimeout(()=>{this.hoverNode=n,this.tooltipStore.set(this.tooltipStoreValue),Dt=null},200))});D(this,"circleMouseleaveHandler",e=>{B.select(e.target).classed("hovered",!1),Dt!==null&&(clearTimeout(Dt),Dt=null),this.hoverNode!==null&&(ye!==null&&(clearTimeout(ye),ye=null),ye=setTimeout(()=>{this.hoverNode=null,this.tooltipStoreValue.show=!1,this.tooltipStore.set(this.tooltipStoreValue)},50))});D(this,"getTooltipMessage",e=>{var o;let n="",i=`"${e.data.n}"`;if(e.depth>1){n=e.parent.data.n;const s=(o=e.data.n.match(new RegExp(n,"i")))==null?void 0:o.index;s!==void 0&&(s==0?(i=`${n}`,i+=`${e.data.n.slice(n.length)}`):(i=`${e.data.n.slice(0,s)}`,i+=`${n}`,i+=`${e.data.n.slice(s+n.length)}`))}return` +
+
+ ${i} +
+ +
+ +
+ Count: ${e.data.v} +
+ +
+ `});D(this,"zoomToView",e=>{var o;this.view=e;const n=this.svgSize.width/e[2],i=e[0]-e[2]/2,r=e[1]-e[2]/2;(o=this.circleGroups)==null||o.attr("transform",s=>`translate(${(s.x-i)*n},${(s.y-r)*n})`).style("font-size",`${_t*n}px`).select(".phrase-circle").attr("r",s=>s.r*n)});D(this,"circleClickHandler",(e,n)=>{var u;if(this.focusNode===null||this.view===null||n===this.focusNode)return;e.stopPropagation(),this.resetZoomInteractions();const i=this.svg.select("g.content-text-1"),r=this.focusNode;this.focusNode=n;const o=this.focusNode.x-this.focusNode.r,s=this.focusNode.y-this.focusNode.r,a=this.svgSize.width/(this.focusNode.r*2),l=this.svg.transition("zoom").duration(800).tween("zoom",()=>{const f=B.interpolateZoom(this.view,[this.focusNode.x,this.focusNode.y,this.focusNode.r*2]);return c=>this.zoomToView(f(c))});if(this.focusNode!==this.pack){if(!this.circleGroups)return;i.transition("label-removal").duration(150).style("opacity",0);const f=this.svg.select(`g.content-text-${r.depth+1}`),c=this.svg.select(`g.content-text-${this.focusNode.depth+1}`);f.transition("label-removal").duration(150).style("opacity",0),c.style("opacity",0).selectAll("*").remove(),this.circleGroups.filter(w=>w.ancestors().slice(0,3).includes(this.focusNode)).style("--base-stroke",`${a}px`).classed("no-pointer",!1),this.circleGroups.filter(w=>w==this.focusNode).classed("no-pointer",!0);const h=[],d=[];let p=-1;const b=[];for(const w of this.focusNode.descendants().slice(1))w.depth!==p&&(b.unshift([]),p=w.depth),b[0].push(w);b.forEach(w=>B.shuffle(w));let m=b.length===0?[]:b.reduce((w,y)=>w.concat(y));m.length===0&&(m=this.focusNode.descendants());for(const w of m)if(!w.data.textInfo.visible){const y={x:(w.x-o)*a-w.data.textInfo.infos[1].width/2,y:(w.y-s)*a-w.data.textInfo.infos[1].height/2,width:w.data.textInfo.infos[1].width,height:w.data.textInfo.infos[1].height,node:w};if(y.height>w.r*a*2-5||y.width>w.r*a*3)continue;let M=!1;for(const W of d){if(ve(W,y)){M=!0;break}if(w===W.node.parent){M=!0;break}}M||(h.push(w),d.push(y))}let g=_t;if(m.length===1){let w=5;for(;w<150;)if(((u=m[0].data.textInfo)==null?void 0:u.infos[1].lines.length)==1){const y=Ft(m[0].data.textInfo.infos[0].lines[0],w),M=w;if(Math.sqrt(y**2+M**2)>m[0].r*2*a){w-=10;break}w+=5}else{const y=Math.max(Ft(m[0].data.textInfo.infos[1].lines[0],w),Ft(m[0].data.textInfo.infos[1].lines[1],w)),M=2*w;if(Math.sqrt(y**2+M**2)>m[0].r*2*a){w-=10;break}w+=5}g=w}c.selectAll("g.top-text-group").data(h).join("g").attr("class","top-text-group").attr("transform",w=>`translate(${(w.x-o)*a}, ${(w.y-s)*a})`).style("font-size",`${m.length===1?g:_t}px`).append("text").attr("class","phrase-label").classed("phrase-label-2",w=>m.length===1&&w.depth>1).each((w,y,M)=>Nr({d:w,i:y,g:M,hideParent:!1,checkHidden:!1,showHalo:m.length>1,scale:a,markVisible:!1})),l.on("end",()=>{c.transition("show-top-label").duration(200).style("opacity",1)})}else{const f=this.svg.select(`g.content-text-${r.depth+1}`);f.transition("label-removal").duration(150).style("opacity",0).on("end",()=>{f.selectAll("*").remove()}),l.on("end",()=>{i.transition("label-show").duration(150).style("opacity",1)})}});D(this,"resetZoomInteractions",()=>{this.circleGroups!==null&&this.circleGroups.style("--base-stroke","1px").classed("no-pointer",e=>e.r<10&&e.children===void 0).style("font-size",`${_t}px`)});this.component=e,this.updatePacker=i,this.svg=B.select(this.component).select("svg.packing-svg"),this.svgFullSize={width:0,height:0},this.svgBBox=this.svg.node().getBoundingClientRect(),this.svgFullSize.width=this.svgBBox.width,this.svgFullSize.height=this.svgBBox.height,this.svgPadding={top:5,bottom:5,left:5,right:5},this.svgSize={width:this.svgFullSize.width-this.svgPadding.left-this.svgPadding.right,height:this.svgFullSize.width-this.svgPadding.top-this.svgPadding.bottom},this.svg.append("g").attr("class","content").attr("transform",`translate(${this.svgPadding.left}, ${this.svgPadding.top})`).append("rect").attr("class","back-rect").attr("width",this.svgSize.width).attr("height",this.svgSize.height).on("click",o=>{this.pack&&this.circleClickHandler(o,this.pack)}),this.tooltipStore=n,this.tooltipStore.subscribe(o=>{this.tooltipStoreValue=o}),this.xScale=B.scaleLinear().domain([0,1]).range([0,this.svgSize.width]),this.yScale=B.scaleLinear().domain([0,1]).range([this.svgSize.height,0]),this.initData().then(()=>{Ui("Draw circle packing",Ta),this.drawCirclePacking(),Ui("Draw circle packing",Ta)})}}const a2=t=>{const e=t.split(" "),n={width:Ft(t,_t),height:_t,diagonal:Math.sqrt(Ft(t,_t)**2+_t**2),lines:[t]},i={width:0,height:0,diagonal:0,lines:[t]};if(e.length==1)i.width=Ft(t,_t),i.height=_t;else{const o=e.slice(0,Math.floor(e.length/2)).join(" "),s=e.slice(Math.floor(e.length/2)).join(" ");i.lines=[o,s],i.width=Math.max(Ft(o,_t),Ft(s,_t)),i.height=_t*2}return i.diagonal=Math.sqrt(i.width**2+i.height**2),{visible:!1,infos:[n,i]}},l2=(t,e,n)=>e&&t.children!==void 0?!0:t.data.textInfo?Math.min(t.data.textInfo.infos[0].diagonal,t.data.textInfo.infos[1].diagonal)>2*t.r*n+xu:!0,Nr=({d:t,i:e,g:n,hideParent:i,checkHidden:r,showHalo:o,scale:s,markVisible:a})=>{if(t.data.textInfo===void 0||r&&l2(t,i,s))return;a&&(t.data.textInfo.visible=!0);const l=B.select(n[e]);if(r&&t.data.textInfo.infos[0].diagonal<2*t.r*s+xu||!r&&t.data.textInfo.infos[1].lines.length==1){const u=l.append("tspan").attr("class","line-1").attr("x",0).attr("y",0).text(t.data.textInfo.infos[0].lines[0]);o&&u.attr("paint-order","stroke").attr("stroke","white").attr("stroke-width",Sa)}else{const u=l.append("tspan").attr("class","line-1").attr("x",0).attr("y",0).attr("dy","-0.5em").text(t.data.textInfo.infos[1].lines[0]),f=l.append("tspan").attr("class","line-2").attr("x",0).attr("y",0).attr("dy","0.5em").text(t.data.textInfo.infos[1].lines[1]);if(o)for(const c of[u,f])c.attr("paint-order","stroke").attr("stroke","white").attr("stroke-width",Sa)}};const Ar="src/components/packing/Packing.svelte";function co(t){let e,n,i;const r={c:function(){e=Z("div"),n=Z("div"),i=bi("svg"),P(i,"class","packing-svg s-YNG4QXDgBbeZ"),G(i,Ar,139,4,2932),P(n,"class","packing s-YNG4QXDgBbeZ"),G(n,Ar,138,2,2906),P(e,"class","packing-wrapper s-YNG4QXDgBbeZ"),G(e,Ar,137,0,2852)},l:function(s){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(s,a){qe(s,e,a),N(e,n),N(n,i),t[4](e)},p:Lt,i:Lt,o:Lt,d:function(s){s&&oe(e),t[4](null)}};return pt("SvelteRegisterBlock",{block:r,id:co.name,type:"component",source:"",ctx:t}),r}function u2(t,e,n){let{$$slots:i={},$$scope:r}=e;Xn("Packing",i,[]);let o=null,s=!1,a=!1,l=null,{tooltipStore:u=null}=e;_i(()=>{n(2,s=!0)});const f=()=>{l=l},c=()=>{n(3,a=!0),o&&u&&(l=new Ca({component:o,tooltipStore:u,updatePacker:f}))},h=["tooltipStore"];Object.keys(e).forEach(p=>{!~h.indexOf(p)&&p.slice(0,2)!=="$$"&&p!=="slot"&&console.warn(` was created with unknown prop '${p}'`)});function d(p){Ze[p?"unshift":"push"](()=>{o=p,n(0,o)})}return t.$$set=p=>{"tooltipStore"in p&&n(1,u=p.tooltipStore)},t.$capture_state=()=>({Packer:Ca,onMount:_i,getTooltipStoreDefaultValue:Le,component:o,mounted:s,initialized:a,packer:l,tooltipStore:u,updatePacker:f,initView:c}),t.$inject_state=p=>{"component"in p&&n(0,o=p.component),"mounted"in p&&n(2,s=p.mounted),"initialized"in p&&n(3,a=p.initialized),"packer"in p&&(l=p.packer),"tooltipStore"in p&&n(1,u=p.tooltipStore)},e&&"$$inject"in e&&t.$inject_state(e.$$inject),t.$$.update=()=>{t.$$.dirty&15&&s&&!a&&o&&u&&c()},[o,u,s,a,d]}class bu extends Bn{constructor(e){super(e),qn(this,e,u2,co,rn,{tooltipStore:1}),pt("SvelteRegisterComponent",{component:this,tagName:"Packing",options:e,id:co.name})}get tooltipStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set tooltipStore(e){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const La="src/components/Tooltip.svelte";function ho(t){let e,n,i,r,o=t[1].html+"";const s={c:function(){e=Z("div"),n=Z("div"),i=J(),r=new Ou(!1),P(n,"class","s-IRuyl3SM_s-U"),lt(n,"arrow-up",t[1].orientation==="n"),lt(n,"arrow-down",t[1].orientation==="s"),G(n,La,174,2,5502),r.a=null,P(e,"class","tooltip s-IRuyl3SM_s-U"),P(e,"style",t[2]),lt(e,"hidden",!t[1].show),G(e,La,168,0,5406)},l:function(l){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(l,u){qe(l,e,u),N(e,n),N(e,i),r.m(o,e),t[5](e)},p:function(l,[u]){u&2&<(n,"arrow-up",l[1].orientation==="n"),u&2&<(n,"arrow-down",l[1].orientation==="s"),u&2&&o!==(o=l[1].html+"")&&r.p(o),u&4&&P(e,"style",l[2]),u&2&<(e,"hidden",!l[1].show)},i:Lt,o:Lt,d:function(l){l&&oe(e),t[5](null)}};return pt("SvelteRegisterBlock",{block:s,id:ho.name,type:"component",source:"",ctx:t}),s}const wn=10;function c2(t,e,n){let{$$slots:i={},$$scope:r}=e;Xn("Tooltip",i,[]);let{tooltipStore:o=null}=e,s=Le(),a="",l=null,u=!1,f=0,c=0,h=0;const d=()=>{s.width===0?n(2,a=`left: ${c}px; top: ${h}px; + max-width: ${s.maxWidth}px; + font-size: ${s.fontSize}px; opacity: ${f}`):n(2,a=`left: ${c}px; top: ${h}px; + width: ${s.width}px; max-width: ${s.maxWidth}px; + font-size: ${s.fontSize}px; opacity: ${f}`)},p=()=>{o!==null&&l!==null&&(n(4,u=!0),o.subscribe(g=>{g!==null&&(g.show?(g.html===""&&(g.html=" "),f=1,c=g.x,h=g.y,n(1,s=g),n(1,s.width=0,s),Qi().then(()=>{const x=l==null?void 0:l.getBoundingClientRect();x&&(c+x.width>=window.innerWidth-2||c-x.width<=2?(n(1,s.width=Math.min(2*(window.innerWidth-c),2*c,s.maxWidth),s),c-=s.width/2,d(),Qi().then(()=>{const w=l==null?void 0:l.getBoundingClientRect();w&&(s.orientation==="n"?(h+=w.height,h+=wn):(h-=w.height,h-=wn),f=1,d())})):(n(1,s.width=0,s),c-=x.width/2,s.orientation==="n"?(h+=x.height,h+=wn):(h-=x.height,h-=wn),f=1,d()))})):(f=0,n(1,s=g)),d())}))},b=["tooltipStore"];Object.keys(e).forEach(g=>{!~b.indexOf(g)&&g.slice(0,2)!=="$$"&&g!=="slot"&&console.warn(` was created with unknown prop '${g}'`)});function m(g){Ze[g?"unshift":"push"](()=>{l=g,n(0,l)})}return t.$$set=g=>{"tooltipStore"in g&&n(3,o=g.tooltipStore)},t.$capture_state=()=>({d3:B,tick:Qi,getTooltipStoreDefaultValue:Le,tooltipStore:o,V_GAP:wn,tooltipConfig:s,style:a,tooltip:l,initialized:u,opacity:f,left:c,top:h,updateStyle:d,initView:p}),t.$inject_state=g=>{"tooltipStore"in g&&n(3,o=g.tooltipStore),"tooltipConfig"in g&&n(1,s=g.tooltipConfig),"style"in g&&n(2,a=g.style),"tooltip"in g&&n(0,l=g.tooltip),"initialized"in g&&n(4,u=g.initialized),"opacity"in g&&(f=g.opacity),"left"in g&&(c=g.left),"top"in g&&(h=g.top)},e&&"$$inject"in e&&t.$inject_state(e.$$inject),t.$$.update=()=>{t.$$.dirty&25&&o&&!u&&l&&p()},[l,s,a,o,u,m]}class _u extends Bn{constructor(e){super(e),qn(this,e,c2,ho,rn,{tooltipStore:3}),pt("SvelteRegisterComponent",{component:this,tagName:"Tooltip",options:e,id:ho.name})}get tooltipStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set tooltipStore(e){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const ku=` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`,Mu='',Tu=` + + + + + + + + + + +`,Su=` + + + + + + + + + + + +`;const{console:h2}=Yu,ht="src/components/diffusiondbvis/DiffusiondbVis.svelte";function fo(t){let e,n,i,r,o,s,a,l,u,f,c,h,d,p,b,m,g,x,w,y,M,W,R,_,V,L,C,O,E,v,A,k,S,$,I,T,F,U,ot,H,at,ut,K,Q,Y,X,et;n=new _u({props:{tooltipStore:t[2]},$$inline:!0}),x=new uo({props:{tooltipStore:t[2],embeddingName:"prompt"},$$inline:!0}),M=new uo({props:{tooltipStore:t[2],embeddingName:"image"},$$inline:!0}),_=new bu({props:{tooltipStore:t[2]},$$inline:!0});const z={c:function(){e=Z("div"),bn(n.$$.fragment),i=J(),r=Z("div"),o=Z("div"),s=Z("div"),a=Z("div"),l=J(),u=Z("span"),u.textContent="DiffusionDB Explorer",f=J(),c=Z("div"),h=Z("a"),d=J(),p=Z("a"),b=J(),m=Z("div"),g=Z("div"),bn(x.$$.fragment),w=J(),y=Z("div"),bn(M.$$.fragment),W=J(),R=Z("div"),bn(_.$$.fragment),V=J(),L=Z("div"),C=Z("div"),O=J(),E=Z("div"),v=Pr("Visit "),A=Z("a"),k=Z("em"),k.textContent="WizMap",S=Pr(" to search and visualize 1M+ prompts and images"),$=J(),I=Z("div"),T=Z("button"),T.textContent="Prompt Embedding",F=J(),U=Z("span"),ot=J(),H=Z("button"),H.textContent="Image Embedding",at=J(),ut=Z("span"),K=J(),Q=Z("button"),Q.textContent="Popular Phrases",P(a,"class","app-icon s-mWjcjWMNKh9l"),G(a,ht,239,8,5165),P(u,"class","app-name s-mWjcjWMNKh9l"),G(u,ht,242,8,5245),P(s,"class","title-left s-mWjcjWMNKh9l"),G(s,ht,238,6,5132),P(h,"class","title-link s-mWjcjWMNKh9l"),P(h,"href","https://github.com/poloclub/diffusiondb"),P(h,"target","_blank"),G(h,ht,246,8,5352),P(p,"class","title-link title-file s-mWjcjWMNKh9l"),P(p,"href","https://arxiv.org/abs/2210.14896"),P(p,"target","_blank"),G(p,ht,253,8,5527),P(c,"class","title-right s-mWjcjWMNKh9l"),G(c,ht,245,6,5318),P(o,"class","app-title s-mWjcjWMNKh9l"),G(o,ht,237,4,5102),P(g,"class","main-app-container s-mWjcjWMNKh9l"),lt(g,"hidden",t[1]!=="prompt-embedding"),G(g,ht,264,6,5776),P(y,"class","main-app-container s-mWjcjWMNKh9l"),lt(y,"hidden",t[1]!=="image-embedding"),G(y,ht,271,6,5957),P(R,"class","main-app-container s-mWjcjWMNKh9l"),lt(R,"hidden",t[1]!=="phrase"),G(R,ht,275,6,6113),P(C,"class","svg-icon s-mWjcjWMNKh9l"),G(C,ht,280,8,6298),P(k,"class","s-mWjcjWMNKh9l"),G(k,ht,285,13,6492),P(A,"href","https://poloclub.github.io/wizmap/"),P(A,"target","_blank"),P(A,"class","s-mWjcjWMNKh9l"),G(A,ht,284,16,6418),P(E,"class","label-text s-mWjcjWMNKh9l"),G(E,ht,283,8,6377),P(L,"class","app-label s-mWjcjWMNKh9l"),lt(L,"hidden",t[1]=="phrase"),G(L,ht,279,6,6234),P(m,"class","main-app s-mWjcjWMNKh9l"),G(m,ht,263,4,5725),P(T,"class","tab s-mWjcjWMNKh9l"),P(T,"data-text","Prompt Embedding"),lt(T,"selected",t[1]==="prompt-embedding"),G(T,ht,292,6,6643),P(U,"class","splitter s-mWjcjWMNKh9l"),G(U,ht,301,6,6875),P(H,"class","tab s-mWjcjWMNKh9l"),P(H,"data-text","Image Embedding"),lt(H,"selected",t[1]==="image-embedding"),G(H,ht,303,6,6908),P(ut,"class","splitter s-mWjcjWMNKh9l"),G(ut,ht,312,6,7136),P(Q,"class","tab s-mWjcjWMNKh9l"),P(Q,"data-text","Popular Phrases"),lt(Q,"selected",t[1]==="phrase"),G(Q,ht,314,6,7169),P(I,"class","app-tabs s-mWjcjWMNKh9l"),G(I,ht,291,4,6614),P(r,"class","app-wrapper s-mWjcjWMNKh9l"),G(r,ht,236,2,5072),P(e,"class","diffusiondbvis-page s-mWjcjWMNKh9l"),G(e,ht,233,0,5006)},l:function(q){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(q,ct){qe(q,e,ct),Oe(n,e,null),N(e,i),N(e,r),N(r,o),N(o,s),N(s,a),a.innerHTML=ku,N(s,l),N(s,u),N(o,f),N(o,c),N(c,h),h.innerHTML=Mu,N(c,d),N(c,p),p.innerHTML=Tu,N(r,b),N(r,m),N(m,g),Oe(x,g,null),N(m,w),N(m,y),Oe(M,y,null),N(m,W),N(m,R),Oe(_,R,null),N(m,V),N(m,L),N(L,C),C.innerHTML=Su,N(L,O),N(L,E),N(E,v),N(E,A),N(A,k),N(E,S),t[3](m),N(r,$),N(r,I),N(I,T),N(I,F),N(I,U),N(I,ot),N(I,H),N(I,at),N(I,ut),N(I,K),N(I,Q),Y=!0,X||(et=[dt(T,"click",t[4],!1,!1,!1),dt(H,"click",t[5],!1,!1,!1),dt(Q,"click",t[6],!1,!1,!1)],X=!0)},p:function(q,[ct]){(!Y||ct&2)&<(g,"hidden",q[1]!=="prompt-embedding"),(!Y||ct&2)&<(y,"hidden",q[1]!=="image-embedding"),(!Y||ct&2)&<(R,"hidden",q[1]!=="phrase"),(!Y||ct&2)&<(L,"hidden",q[1]=="phrase"),(!Y||ct&2)&<(T,"selected",q[1]==="prompt-embedding"),(!Y||ct&2)&<(H,"selected",q[1]==="image-embedding"),(!Y||ct&2)&<(Q,"selected",q[1]==="phrase")},i:function(q){Y||(We(n.$$.fragment,q),We(x.$$.fragment,q),We(M.$$.fragment,q),We(_.$$.fragment,q),Y=!0)},o:function(q){xn(n.$$.fragment,q),xn(x.$$.fragment,q),xn(M.$$.fragment,q),xn(_.$$.fragment,q),Y=!1},d:function(q){q&&oe(e),Ie(n),Ie(x),Ie(M),Ie(_),t[3](null),X=!1,nn(et)}};return pt("SvelteRegisterBlock",{block:z,id:fo.name,type:"component",source:"",ctx:t}),z}function f2(t,e,n){let{$$slots:i={},$$scope:r}=e;Xn("DiffusiondbVis",i,[]);let o=null,s="prompt-embedding";if(window.location.hash){const d=window.location.hash.slice(1);switch(console.log(d),d){case"phrase":{s="phrase";break}case"prompt-embedding":{s="prompt-embedding";break}case"image-embedding":{s="image-embedding";break}}}const a=ba(),l=[];Object.keys(e).forEach(d=>{!~l.indexOf(d)&&d.slice(0,2)!=="$$"&&d!=="slot"&&h2.warn(` was created with unknown prop '${d}'`)});function u(d){Ze[d?"unshift":"push"](()=>{o=d,n(0,o)})}const f=()=>{n(1,s="prompt-embedding")},c=()=>{n(1,s="image-embedding")},h=()=>{n(1,s="phrase")};return t.$capture_state=()=>({Embedding:uo,Packing:bu,Tooltip:_u,getTooltipStore:ba,logoDiffusionDB:ku,iconGithub:Mu,iconFile:Tu,iconArrowRight:Su,component:o,view:s,tooltipStore:a}),t.$inject_state=d=>{"component"in d&&n(0,o=d.component),"view"in d&&n(1,s=d.view)},e&&"$$inject"in e&&t.$inject_state(e.$$inject),[o,s,a,u,f,c,h]}class Cu extends Bn{constructor(e){super(e),qn(this,e,f2,fo,rn,{}),pt("SvelteRegisterComponent",{component:this,tagName:"DiffusiondbVis",options:e,id:fo.name})}}const di="App.svelte";function go(t){let e,n,i,r,o,s,a;s=new Cu({$$inline:!0});const l={c:function(){e=Z("link"),n=Z("link"),i=Z("link"),r=J(),o=Z("div"),bn(s.$$.fragment),P(e,"rel","preconnect"),P(e,"href","https://fonts.googleapis.com"),G(e,di,6,2,146),P(n,"rel","preconnect"),P(n,"href","https://fonts.gstatic.com"),P(n,"crossorigin",""),G(n,di,7,2,210),P(i,"href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),P(i,"rel","stylesheet"),G(i,di,8,2,283),P(o,"class","stand-alone-page"),G(o,di,14,0,401)},l:function(f){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(f,c){N(document.head,e),N(document.head,n),N(document.head,i),qe(f,r,c),qe(f,o,c),Oe(s,o,null),a=!0},p:Lt,i:function(f){a||(We(s.$$.fragment,f),a=!0)},o:function(f){xn(s.$$.fragment,f),a=!1},d:function(f){oe(e),oe(n),oe(i),f&&oe(r),f&&oe(o),Ie(s)}};return pt("SvelteRegisterBlock",{block:l,id:go.name,type:"component",source:"",ctx:t}),l}function d2(t,e,n){let{$$slots:i={},$$scope:r}=e;Xn("App",i,[]);const o=[];return Object.keys(e).forEach(s=>{!~o.indexOf(s)&&s.slice(0,2)!=="$$"&&s!=="slot"&&console.warn(` was created with unknown prop '${s}'`)}),t.$capture_state=()=>({DiffusiondbVis:Cu}),[]}class g2 extends Bn{constructor(e){super(e),qn(this,e,d2,go,rn,{}),pt("SvelteRegisterComponent",{component:this,tagName:"App",options:e,id:go.name})}}new g2({target:document.getElementById("app")}); diff --git a/explorer/assets/index.b921769d.js b/explorer/assets/index.b921769d.js deleted file mode 100644 index 762564a..0000000 --- a/explorer/assets/index.b921769d.js +++ /dev/null @@ -1,198 +0,0 @@ -var Lu=Object.defineProperty;var Nu=(t,e,n)=>e in t?Lu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var D=(t,e,n)=>(Nu(t,typeof e!="symbol"?e+"":e,n),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerpolicy&&(o.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?o.credentials="include":r.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();function Lt(){}function G(t,e,n,i,r){t.__svelte_meta={loc:{file:e,line:n,column:i,char:r}}}function Na(t){return t()}function Ko(){return Object.create(null)}function nn(t){t.forEach(Na)}function Aa(t){return typeof t=="function"}function rn(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function Au(t){return Object.keys(t).length===0}function Pu(t,e){t.appendChild(e)}function Pa(t,e,n){t.insertBefore(e,n||null)}function po(t){t.parentNode.removeChild(t)}function Z(t){return document.createElement(t)}function bi(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Pr(t){return document.createTextNode(t)}function J(){return Pr(" ")}function Eu(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function zu(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Du(t){return Array.from(t.childNodes)}function lt(t,e,n){t.classList[n?"add":"remove"](e)}function Wu(t,e,{bubbles:n=!1,cancelable:i=!1}={}){const r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n,i,e),r}class Iu{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=bi(n.nodeName):this.e=Z(n.nodeName),this.t=n,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let n=0;n{pi.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}function bn(t){t&&t.c()}function Ie(t,e,n,i){const{fragment:r,after_update:o}=t.$$;r&&r.m(e,n),i||zr(()=>{const s=t.$$.on_mount.map(Na).filter(Aa);t.$$.on_destroy?t.$$.on_destroy.push(...s):nn(s),t.$$.on_mount=[]}),o.forEach(zr)}function Oe(t,e){const n=t.$$;n.fragment!==null&&(nn(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Yu(t,e){t.$$.dirty[0]===-1&&(vn.push(t),za(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const p=d.length?d[0]:h;return u.ctx&&r(u.ctx[c],u.ctx[c]=p)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](p),f&&Yu(t,c)),h}):[],u.update(),f=!0,nn(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=Du(e.target);u.fragment&&u.fragment.l(c),c.forEach(po)}else u.fragment&&u.fragment.c();e.intro&&We(t.$$.fragment),Ie(t,e.target,e.anchor,e.customElement),Da()}An(l)}class Vu{$destroy(){Oe(this,1),this.$destroy=Lt}$on(e,n){if(!Aa(n))return Lt;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!Au(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function pt(t,e){document.dispatchEvent(Wu(t,Object.assign({version:"3.52.0"},e),{bubbles:!0}))}function N(t,e){pt("SvelteDOMInsert",{target:t,node:e}),Pu(t,e)}function qe(t,e,n){pt("SvelteDOMInsert",{target:t,node:e,anchor:n}),Pa(t,e,n)}function oe(t){pt("SvelteDOMRemove",{node:t}),po(t)}function dt(t,e,n,i,r,o){const s=i===!0?["capture"]:i?Array.from(Object.keys(i)):[];r&&s.push("preventDefault"),o&&s.push("stopPropagation"),pt("SvelteDOMAddEventListener",{node:t,event:e,handler:n,modifiers:s});const a=Eu(t,e,n,i);return()=>{pt("SvelteDOMRemoveEventListener",{node:t,event:e,handler:n,modifiers:s}),a()}}function P(t,e,n){zu(t,e,n),n==null?pt("SvelteDOMRemoveAttribute",{node:t,attribute:e}):pt("SvelteDOMSetAttribute",{node:t,attribute:e,value:n})}function $u(t,e,n){t[e]=n,pt("SvelteDOMSetProperty",{node:t,property:e,value:n})}function Xn(t,e,n){for(const i of Object.keys(e))~n.indexOf(i)||console.warn(`<${t}> received an unexpected slot "${i}".`)}class Bn extends Vu{constructor(e){if(!e||!e.target&&!e.$$inline)throw new Error("'target' is a required option");super()}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}var Dr="http://www.w3.org/1999/xhtml";const Jo={svg:"http://www.w3.org/2000/svg",xhtml:Dr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gi(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Jo.hasOwnProperty(e)?{space:Jo[e],local:t}:t}function Uu(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Dr&&e.documentElement.namespaceURI===Dr?e.createElement(t):e.createElementNS(n,t)}}function Gu(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Wa(t){var e=Gi(t);return(e.local?Gu:Uu)(e)}function Zu(){}function mo(t){return t==null?Zu:function(){return this.querySelector(t)}}function qu(t){typeof t!="function"&&(t=mo(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r=w&&(w=x+1);!(M=m[w])&&++w=0;)(s=i[r])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function mc(t){t||(t=yc);function e(c,h){return c&&h?t(c.__data__,h.__data__):!c-!h}for(var n=this._groups,i=n.length,r=new Array(i),o=0;oe?1:t>=e?0:NaN}function wc(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function vc(){return Array.from(this)}function xc(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?Pc:typeof e=="function"?zc:Ec)(t,e,n==null?"":n)):Xe(this.node(),t)}function Xe(t,e){return t.style.getPropertyValue(e)||Va(t).getComputedStyle(t,null).getPropertyValue(e)}function Wc(t){return function(){delete this[t]}}function Ic(t,e){return function(){this[t]=e}}function Oc(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Rc(t,e){return arguments.length>1?this.each((e==null?Wc:typeof e=="function"?Oc:Ic)(t,e)):this.node()[t]}function $a(t){return t.trim().split(/^|\s+/)}function yo(t){return t.classList||new Ua(t)}function Ua(t){this._node=t,this._names=$a(t.getAttribute("class")||"")}Ua.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Ga(t,e){for(var n=yo(t),i=-1,r=e.length;++i=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function fh(t){return function(){var e=this.__on;if(!!e){for(var n=0,i=-1,r=e.length,o;ne?1:t>=e?0:NaN}function Mh(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function Xa(t){let e,n,i;t.length!==2?(e=Ye,n=(a,l)=>Ye(t(a),l),i=(a,l)=>t(a)-l):(e=t===Ye||t===Mh?t:Th,n=t,i=t);function r(a,l,u=0,f=a.length){if(u>>1;n(a[c],l)<0?u=c+1:f=c}while(u>>1;n(a[c],l)<=0?u=c+1:f=c}while(uu&&i(a[c-1],l)>-i(a[c],l)?c-1:c}return{left:r,center:s,right:o}}function Th(){return 0}function Sh(t){return t===null?NaN:+t}const Ch=Xa(Ye),Lh=Ch.right;Xa(Sh).center;const Ba=Lh;function Nh(t,e){let n=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&++n;else{let i=-1;for(let r of t)(r=e(r,++i,t))!=null&&(r=+r)>=r&&++n}return n}function Pn(t,e){let n,i;if(e===void 0)for(const r of t)r!=null&&(n===void 0?r>=r&&(n=i=r):(n>r&&(n=r),i=o&&(n=i=o):(n>o&&(n=o),i0){for(s=e[--n];n>0&&(i=s,r=e[--n],s=i+r,o=r-(s-i),!o););n>0&&(o<0&&e[n-1]<0||o>0&&e[n-1]>0)&&(r=o*2,i=s+r,r==i-s&&(s=i))}return s}}class ts extends Map{constructor(e,n=Eh){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[i,r]of e)this.set(i,r)}get(e){return super.get(es(this,e))}has(e){return super.has(es(this,e))}set(e,n){return super.set(Ah(this,e),n)}delete(e){return super.delete(Ph(this,e))}}function es({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function Ah({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}function Ph({_intern:t,_key:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}function Eh(t){return t!==null&&typeof t=="object"?t.valueOf():t}function zh(t){return t}function Dh(t=Ye){if(t===Ye)return Ha;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,n)=>{const i=t(e,n);return i||i===0?i:(t(n,n)===0)-(t(e,e)===0)}}function Ha(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}var Wh=Array.prototype,Ih=Wh.slice;function ni(t){return()=>t}var Wr=Math.sqrt(50),Ir=Math.sqrt(10),Or=Math.sqrt(2);function zn(t,e,n){var i,r=-1,o,s,a;if(e=+e,t=+t,n=+n,t===e&&n>0)return[t];if((i=e0){let l=Math.round(t/a),u=Math.round(e/a);for(l*ae&&--u,s=new Array(o=u-l+1);++re&&--u,s=new Array(o=u-l+1);++r=0?(o>=Wr?10:o>=Ir?5:o>=Or?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=Wr?10:o>=Ir?5:o>=Or?2:1)}function ja(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),o=i/r;return o>=Wr?r*=10:o>=Ir?r*=5:o>=Or&&(r*=2),e0?(t=Math.floor(t/r)*r,e=Math.ceil(e/r)*r):r<0&&(t=Math.ceil(t*r)/r,e=Math.floor(e*r)/r),i=r}}function Ka(t){return Math.ceil(Math.log(Nh(t))/Math.LN2)+1}function Rh(){var t=zh,e=Pn,n=Ka;function i(r){Array.isArray(r)||(r=Array.from(r));var o,s=r.length,a,l,u=new Array(s);for(o=0;o=h)if(g>=h&&e===Pn){const w=Dn(c,h,x);isFinite(w)&&(w>0?h=(Math.floor(h/w)+1)*w:w<0&&(h=(Math.ceil(h*-w)+1)/-w))}else d.pop()}for(var p=d.length;d[0]<=c;)d.shift(),--p;for(;d[p-1]>h;)d.pop(),--p;var b=new Array(p+1),m;for(o=0;o<=p;++o)m=b[o]=[],m.x0=o>0?d[o-1]:c,m.x1=o0)for(o=0;o=i)&&(n=i);else{let i=-1;for(let r of t)(r=e(r,++i,t))!=null&&(n=r)&&(n=r)}return n}function Yh(t,e){let n,i=-1,r=-1;if(e===void 0)for(const o of t)++r,o!=null&&(n=o)&&(n=o,i=r);else for(let o of t)(o=e(o,++r,t))!=null&&(n=o)&&(n=o,i=r);return i}function Vh(t,e){let n;if(e===void 0)for(const i of t)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of t)(r=e(r,++i,t))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function $h(t,e){let n,i=-1,r=-1;if(e===void 0)for(const o of t)++r,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,i=r);else for(let o of t)(o=e(o,++r,t))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,i=r);return i}function Qa(t,e,n=0,i=t.length-1,r){for(r=r===void 0?Ha:Dh(r);i>n;){if(i-n>600){const l=i-n+1,u=e-n+1,f=Math.log(l),c=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*c*(l-c)/l)*(u-l/2<0?-1:1),d=Math.max(n,Math.floor(e-u*c/l+h)),p=Math.min(i,Math.floor(e+(l-u)*c/l+h));Qa(t,e,d,p,r)}const o=t[e];let s=n,a=i;for(un(t,n,e),r(t[i],o)>0&&un(t,n,i);s0;)--a}r(t[n],o)===0?un(t,n,a):(++a,un(t,a,i)),a<=e&&(n=a+1),e<=a&&(i=a-1)}return t}function un(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function Uh(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(r);++i>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ii(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ii(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=jh.exec(t))?new gt(e[1],e[2],e[3],1):(e=Kh.exec(t))?new gt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Qh.exec(t))?ii(e[1],e[2],e[3],e[4]):(e=Jh.exec(t))?ii(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=tf.exec(t))?us(e[1],e[2]/100,e[3]/100,1):(e=ef.exec(t))?us(e[1],e[2]/100,e[3]/100,e[4]):is.hasOwnProperty(t)?ss(is[t]):t==="transparent"?new gt(NaN,NaN,NaN,0):null}function ss(t){return new gt(t>>16&255,t>>8&255,t&255,1)}function ii(t,e,n,i){return i<=0&&(t=e=n=NaN),new gt(t,e,n,i)}function bo(t){return t instanceof fe||(t=ce(t)),t?(t=t.rgb(),new gt(t.r,t.g,t.b,t.opacity)):new gt}function Mi(t,e,n,i){return arguments.length===1?bo(t):new gt(t,e,n,i==null?1:i)}function gt(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}sn(gt,Mi,jn(fe,{brighter(t){return t=t==null?He:Math.pow(He,t),new gt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ke:Math.pow(ke,t),new gt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new gt(be(this.r),be(this.g),be(this.b),Ti(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:as,formatHex:as,formatHex8:of,formatRgb:ls,toString:ls}));function as(){return`#${xe(this.r)}${xe(this.g)}${xe(this.b)}`}function of(){return`#${xe(this.r)}${xe(this.g)}${xe(this.b)}${xe((isNaN(this.opacity)?1:this.opacity)*255)}`}function ls(){const t=Ti(this.opacity);return`${t===1?"rgb(":"rgba("}${be(this.r)}, ${be(this.g)}, ${be(this.b)}${t===1?")":`, ${t})`}`}function Ti(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function be(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function xe(t){return t=be(t),(t<16?"0":"")+t.toString(16)}function us(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ot(t,e,n,i)}function tl(t){if(t instanceof Ot)return new Ot(t.h,t.s,t.l,t.opacity);if(t instanceof fe||(t=ce(t)),!t)return new Ot;if(t instanceof Ot)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=NaN,a=o-r,l=(o+r)/2;return a?(e===o?s=(n-i)/a+(n0&&l<1?0:s,new Ot(s,a,l,t.opacity)}function Si(t,e,n,i){return arguments.length===1?tl(t):new Ot(t,e,n,i==null?1:i)}function Ot(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}sn(Ot,Si,jn(fe,{brighter(t){return t=t==null?He:Math.pow(He,t),new Ot(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ke:Math.pow(ke,t),new Ot(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new gt(tr(t>=240?t-240:t+120,r,i),tr(t,r,i),tr(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Ot(cs(this.h),ri(this.s),ri(this.l),Ti(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ti(this.opacity);return`${t===1?"hsl(":"hsla("}${cs(this.h)}, ${ri(this.s)*100}%, ${ri(this.l)*100}%${t===1?")":`, ${t})`}`}}));function cs(t){return t=(t||0)%360,t<0?t+360:t}function ri(t){return Math.max(0,Math.min(1,t||0))}function tr(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const el=Math.PI/180,nl=180/Math.PI,Ci=18,il=.96422,rl=1,ol=.82521,sl=4/29,$e=6/29,al=3*$e*$e,sf=$e*$e*$e;function ll(t){if(t instanceof Bt)return new Bt(t.l,t.a,t.b,t.opacity);if(t instanceof qt)return cl(t);t instanceof gt||(t=bo(t));var e=rr(t.r),n=rr(t.g),i=rr(t.b),r=er((.2225045*e+.7168786*n+.0606169*i)/rl),o,s;return e===n&&n===i?o=s=r:(o=er((.4360747*e+.3850649*n+.1430804*i)/il),s=er((.0139322*e+.0971045*n+.7141733*i)/ol)),new Bt(116*r-16,500*(o-r),200*(r-s),t.opacity)}function Rr(t,e,n,i){return arguments.length===1?ll(t):new Bt(t,e,n,i==null?1:i)}function Bt(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}sn(Bt,Rr,jn(fe,{brighter(t){return new Bt(this.l+Ci*(t==null?1:t),this.a,this.b,this.opacity)},darker(t){return new Bt(this.l-Ci*(t==null?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=il*nr(e),t=rl*nr(t),n=ol*nr(n),new gt(ir(3.1338561*e-1.6168667*t-.4906146*n),ir(-.9787684*e+1.9161415*t+.033454*n),ir(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function er(t){return t>sf?Math.pow(t,1/3):t/al+sl}function nr(t){return t>$e?t*t*t:al*(t-sl)}function ir(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function rr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ul(t){if(t instanceof qt)return new qt(t.h,t.c,t.l,t.opacity);if(t instanceof Bt||(t=ll(t)),t.a===0&&t.b===0)return new qt(NaN,0=1?(n=1,e-1):Math.floor(n*e),r=t[i],o=t[i+1],s=i>0?t[i-1]:2*r-o,a=i()=>t;function fl(t,e){return function(n){return t+n*e}}function ff(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function dl(t,e){var n=e-t;return n?fl(t,n>180||n<-180?n-360*Math.round(n/360):n):qi(isNaN(t)?e:t)}function df(t){return(t=+t)==1?At:function(e,n){return n-e?ff(e,n,t):qi(isNaN(e)?n:e)}}function At(t,e){var n=e-t;return n?fl(t,n):qi(isNaN(t)?e:t)}const On=function t(e){var n=df(e);function i(r,o){var s=n((r=Mi(r)).r,(o=Mi(o)).r),a=n(r.g,o.g),l=n(r.b,o.b),u=At(r.opacity,o.opacity);return function(f){return r.r=s(f),r.g=a(f),r.b=l(f),r.opacity=u(f),r+""}}return i.gamma=t,i}(1);function gf(t){return function(e){var n=e.length,i=new Array(n),r=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(i=i[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:It(i,r)})),n=or.lastIndex;return n180?f+=360:f-u>180&&(u+=360),h.push({i:c.push(r(c)+"rotate(",null,i)-2,x:It(u,f)})):f&&c.push(r(c)+"rotate("+f+i)}function a(u,f,c,h){u!==f?h.push({i:c.push(r(c)+"skewX(",null,i)-2,x:It(u,f)}):f&&c.push(r(c)+"skewX("+f+i)}function l(u,f,c,h,d,p){if(u!==c||f!==h){var b=d.push(r(d)+"scale(",null,",",null,")");p.push({i:b-4,x:It(u,c)},{i:b-2,x:It(f,h)})}else(c!==1||h!==1)&&d.push(r(d)+"scale("+c+","+h+")")}return function(u,f){var c=[],h=[];return u=t(u),f=t(f),o(u.translateX,u.translateY,f.translateX,f.translateY,c,h),s(u.rotate,f.rotate,c,h),a(u.skewX,f.skewX,c,h),l(u.scaleX,u.scaleY,f.scaleX,f.scaleY,c,h),u=f=null,function(d){for(var p=-1,b=h.length,m;++pe&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function If(t,e,n){var i=t[0],r=t[1],o=e[0],s=e[1];return r2?Of:If,l=u=null,c}function c(h){return h==null||isNaN(h=+h)?o:(l||(l=a(t.map(i),e,n)))(i(s(h)))}return c.invert=function(h){return s(r((u||(u=a(e,t.map(i),It)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,Df),f()):t.slice()},c.range=function(h){return arguments.length?(e=Array.from(h),f()):e.slice()},c.rangeRound=function(h){return e=Array.from(h),n=ml,f()},c.clamp=function(h){return arguments.length?(s=h?!0:Et,f()):s!==Et},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(o=h,c):o},function(h,d){return i=h,r=d,f()}}function Rf(){return To()(Et,Et)}function Ff(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Li(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function je(t){return t=Li(Math.abs(t)),t?t[1]:NaN}function Yf(t,e){return function(n,i){for(var r=n.length,o=[],s=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(n.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function Vf(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var $f=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Rn(t){if(!(e=$f.exec(t)))throw new Error("invalid format: "+t);var e;return new So({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Rn.prototype=So.prototype;function So(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}So.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 Uf(t){t:for(var e=t.length,n=1,i=-1,r;n0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(r+1):t}var _l;function Gf(t,e){var n=Li(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(_l=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,s=i.length;return o===s?i:o>s?i+new Array(o-s+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Li(t,Math.max(0,e+o-1))[0]}function ys(t,e){var n=Li(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const ws={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Ff,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ys(t*100,e),r:ys,s:Gf,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function vs(t){return t}var xs=Array.prototype.map,bs=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Zf(t){var e=t.grouping===void 0||t.thousands===void 0?vs:Yf(xs.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?vs:Vf(xs.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"\u2212":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(c){c=Rn(c);var h=c.fill,d=c.align,p=c.sign,b=c.symbol,m=c.zero,g=c.width,x=c.comma,w=c.precision,y=c.trim,M=c.type;M==="n"?(x=!0,M="g"):ws[M]||(w===void 0&&(w=12),y=!0,M="g"),(m||h==="0"&&d==="=")&&(m=!0,h="0",d="=");var W=b==="$"?n:b==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",R=b==="$"?i:/[%p]/.test(M)?s:"",_=ws[M],V=/[defgprs%]/.test(M);w=w===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function L(C){var I=W,E=R,v,A,k;if(M==="c")E=_(C)+E,C="";else{C=+C;var S=C<0||1/C<0;if(C=isNaN(C)?l:_(Math.abs(C),w),y&&(C=Uf(C)),S&&+C==0&&p!=="+"&&(S=!1),I=(S?p==="("?p:a:p==="-"||p==="("?"":p)+I,E=(M==="s"?bs[8+_l/3]:"")+E+(S&&p==="("?")":""),V){for(v=-1,A=C.length;++vk||k>57){E=(k===46?r+C.slice(v+1):C.slice(v))+E,C=C.slice(0,v);break}}}x&&!m&&(C=e(C,1/0));var $=I.length+C.length+E.length,O=$>1)+I+C+E+O.slice($);break;default:C=O+I+C+E;break}return o(C)}return L.toString=function(){return c+""},L}function f(c,h){var d=u((c=Rn(c),c.type="f",c)),p=Math.max(-8,Math.min(8,Math.floor(je(h)/3)))*3,b=Math.pow(10,-p),m=bs[8+p/3];return function(g){return d(b*g)+m}}return{format:u,formatPrefix:f}}var si,Xi,kl;qf({thousands:",",grouping:[3],currency:["$",""]});function qf(t){return si=Zf(t),Xi=si.format,kl=si.formatPrefix,si}function Xf(t){return Math.max(0,-je(Math.abs(t)))}function Bf(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(je(e)/3)))*3-je(Math.abs(t)))}function Hf(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,je(e)-je(t))+1}function jf(t,e,n,i){var r=ja(t,e,n),o;switch(i=Rn(i==null?",f":i),i.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(o=Bf(r,s))&&(i.precision=o),kl(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=Hf(r,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=Xf(r))&&(i.precision=o-(i.type==="%")*2);break}}return Xi(i)}function Co(t){var e=t.domain;return t.ticks=function(n){var i=e();return zn(i[0],i[i.length-1],n==null?10:n)},t.tickFormat=function(n,i){var r=e();return jf(r[0],r[r.length-1],n==null?10:n,i)},t.nice=function(n){n==null&&(n=10);var i=e(),r=0,o=i.length-1,s=i[r],a=i[o],l,u,f=10;for(a0;){if(u=Dn(s,a,n),u===l)return i[r]=s,i[o]=a,e(i);if(u>0)s=Math.floor(s/u)*u,a=Math.ceil(a/u)*u;else if(u<0)s=Math.ceil(s*u)/u,a=Math.floor(a*u)/u;else break;l=u}return t},t}function Ml(){var t=Rf();return t.copy=function(){return Mo(t,Ml())},Hn.apply(t,arguments),Co(t)}function Kf(t,e){t=t.slice();var n=0,i=t.length-1,r=t[n],o=t[i],s;return oMath.pow(t,e)}function n0(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function Ms(t){return(e,n)=>-t(-e,n)}function i0(t){const e=t(_s,ks),n=e.domain;let i=10,r,o;function s(){return r=n0(i),o=e0(i),n()[0]<0?(r=Ms(r),o=Ms(o),t(Qf,Jf)):t(_s,ks),e}return e.base=function(a){return arguments.length?(i=+a,s()):i},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{const l=n();let u=l[0],f=l[l.length-1];const c=f0){for(;h<=d;++h)for(p=1;pf)break;g.push(b)}}else for(;h<=d;++h)for(p=i-1;p>=1;--p)if(b=h>0?p/o(-h):p*o(h),!(bf)break;g.push(b)}g.length*2{if(a==null&&(a=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=Rn(l)).precision==null&&(l.trim=!0),l=Xi(l)),a===1/0)return l;const u=Math.max(1,i*a/e.ticks().length);return f=>{let c=f/o(Math.round(r(f)));return c*in(Kf(n(),{floor:a=>o(Math.floor(r(a))),ceil:a=>o(Math.ceil(r(a)))})),e}function Tl(){const t=i0(To()).domain([1,10]);return t.copy=()=>Mo(t,Tl()).base(t.base()),Hn.apply(t,arguments),t}function Ts(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function r0(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function o0(t){return t<0?-t*t:t*t}function s0(t){var e=t(Et,Et),n=1;function i(){return n===1?t(Et,Et):n===.5?t(r0,o0):t(Ts(n),Ts(1/n))}return e.exponent=function(r){return arguments.length?(n=+r,i()):n},Co(e)}function Lo(){var t=s0(To());return t.copy=function(){return Mo(t,Lo()).exponent(t.exponent())},Hn.apply(t,arguments),t}function a0(){return Lo.apply(null,arguments).exponent(.5)}const sr=new Date,ar=new Date;function Ht(t,e,n,i){function r(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return r.floor=o=>(t(o=new Date(+o)),o),r.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),r.round=o=>{const s=r(o),a=r.ceil(o);return o-s(e(o=new Date(+o),s==null?1:Math.floor(s)),o),r.range=(o,s,a)=>{const l=[];if(o=r.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let u;do l.push(u=new Date(+o)),e(o,a),t(o);while(uHt(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(r.count=(o,s)=>(sr.setTime(+o),ar.setTime(+s),t(sr),t(ar),Math.floor(n(sr,ar))),r.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?r.filter(i?s=>i(s)%o===0:s=>r.count(0,s)%o===0):r)),r}const l0=1e3,No=l0*60,u0=No*60,Fn=u0*24,Sl=Fn*7,Ao=Ht(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*No)/Fn,t=>t.getDate()-1);Ao.range;const Po=Ht(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Fn,t=>t.getUTCDate()-1);Po.range;const c0=Ht(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Fn,t=>Math.floor(t/Fn));c0.range;function Ne(t){return Ht(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*No)/Sl)}const Cl=Ne(0),Ni=Ne(1),h0=Ne(2),f0=Ne(3),Ke=Ne(4),d0=Ne(5),g0=Ne(6);Cl.range;Ni.range;h0.range;f0.range;Ke.range;d0.range;g0.range;function Ae(t){return Ht(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Sl)}const Ll=Ae(0),Ai=Ae(1),p0=Ae(2),m0=Ae(3),Qe=Ae(4),y0=Ae(5),w0=Ae(6);Ll.range;Ai.range;p0.range;m0.range;Qe.range;y0.range;w0.range;const Me=Ht(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Me.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ht(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Me.range;const Te=Ht(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Te.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ht(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});Te.range;function lr(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ur(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function cn(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function v0(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,u=hn(r),f=fn(r),c=hn(o),h=fn(o),d=hn(s),p=fn(s),b=hn(a),m=fn(a),g=hn(l),x=fn(l),w={a:S,A:$,b:O,B:T,c:null,d:Ps,e:Ps,f:$0,g:Q0,G:t1,H:F0,I:Y0,j:V0,L:Nl,m:U0,M:G0,p:F,q:U,Q:Ds,s:Ws,S:Z0,u:q0,U:X0,V:B0,w:H0,W:j0,x:null,X:null,y:K0,Y:J0,Z:e1,"%":zs},y={a:ot,A:H,b:at,B:ut,c:null,d:Es,e:Es,f:o1,g:p1,G:y1,H:n1,I:i1,j:r1,L:Pl,m:s1,M:a1,p:K,q:Q,Q:Ds,s:Ws,S:l1,u:u1,U:c1,V:h1,w:f1,W:d1,x:null,X:null,y:g1,Y:m1,Z:w1,"%":zs},M={a:L,A:C,b:I,B:E,c:v,d:Ns,e:Ns,f:W0,g:Ls,G:Cs,H:As,I:As,j:P0,L:D0,m:A0,M:E0,p:V,q:N0,Q:O0,s:R0,S:z0,u:M0,U:T0,V:S0,w:k0,W:C0,x:A,X:k,y:Ls,Y:Cs,Z:L0,"%":I0};w.x=W(n,w),w.X=W(i,w),w.c=W(e,w),y.x=W(n,y),y.X=W(i,y),y.c=W(e,y);function W(Y,X){return function(et){var z=[],nt=-1,q=0,ct=Y.length,ft,j,it;for(et instanceof Date||(et=new Date(+et));++nt53)return null;"w"in z||(z.w=1),"Z"in z?(q=ur(cn(z.y,0,1)),ct=q.getUTCDay(),q=ct>4||ct===0?Ai.ceil(q):Ai(q),q=Po.offset(q,(z.V-1)*7),z.y=q.getUTCFullYear(),z.m=q.getUTCMonth(),z.d=q.getUTCDate()+(z.w+6)%7):(q=lr(cn(z.y,0,1)),ct=q.getDay(),q=ct>4||ct===0?Ni.ceil(q):Ni(q),q=Ao.offset(q,(z.V-1)*7),z.y=q.getFullYear(),z.m=q.getMonth(),z.d=q.getDate()+(z.w+6)%7)}else("W"in z||"U"in z)&&("w"in z||(z.w="u"in z?z.u%7:"W"in z?1:0),ct="Z"in z?ur(cn(z.y,0,1)).getUTCDay():lr(cn(z.y,0,1)).getDay(),z.m=0,z.d="W"in z?(z.w+6)%7+z.W*7-(ct+5)%7:z.w+z.U*7-(ct+6)%7);return"Z"in z?(z.H+=z.Z/100|0,z.M+=z.Z%100,ur(z)):lr(z)}}function _(Y,X,et,z){for(var nt=0,q=X.length,ct=et.length,ft,j;nt=ct)return-1;if(ft=X.charCodeAt(nt++),ft===37){if(ft=X.charAt(nt++),j=M[ft in Ss?X.charAt(nt++):ft],!j||(z=j(Y,et,z))<0)return-1}else if(ft!=et.charCodeAt(z++))return-1}return z}function V(Y,X,et){var z=u.exec(X.slice(et));return z?(Y.p=f.get(z[0].toLowerCase()),et+z[0].length):-1}function L(Y,X,et){var z=d.exec(X.slice(et));return z?(Y.w=p.get(z[0].toLowerCase()),et+z[0].length):-1}function C(Y,X,et){var z=c.exec(X.slice(et));return z?(Y.w=h.get(z[0].toLowerCase()),et+z[0].length):-1}function I(Y,X,et){var z=g.exec(X.slice(et));return z?(Y.m=x.get(z[0].toLowerCase()),et+z[0].length):-1}function E(Y,X,et){var z=b.exec(X.slice(et));return z?(Y.m=m.get(z[0].toLowerCase()),et+z[0].length):-1}function v(Y,X,et){return _(Y,e,X,et)}function A(Y,X,et){return _(Y,n,X,et)}function k(Y,X,et){return _(Y,i,X,et)}function S(Y){return s[Y.getDay()]}function $(Y){return o[Y.getDay()]}function O(Y){return l[Y.getMonth()]}function T(Y){return a[Y.getMonth()]}function F(Y){return r[+(Y.getHours()>=12)]}function U(Y){return 1+~~(Y.getMonth()/3)}function ot(Y){return s[Y.getUTCDay()]}function H(Y){return o[Y.getUTCDay()]}function at(Y){return l[Y.getUTCMonth()]}function ut(Y){return a[Y.getUTCMonth()]}function K(Y){return r[+(Y.getUTCHours()>=12)]}function Q(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var X=W(Y+="",w);return X.toString=function(){return Y},X},parse:function(Y){var X=R(Y+="",!1);return X.toString=function(){return Y},X},utcFormat:function(Y){var X=W(Y+="",y);return X.toString=function(){return Y},X},utcParse:function(Y){var X=R(Y+="",!0);return X.toString=function(){return Y},X}}}var Ss={"-":"",_:" ",0:"0"},mt=/^\s*\d+/,x0=/^%/,b0=/[\\^$*+?|[\]().{}]/g;function st(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o[e.toLowerCase(),n]))}function k0(t,e,n){var i=mt.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function M0(t,e,n){var i=mt.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function T0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function S0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function C0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function Cs(t,e,n){var i=mt.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function Ls(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function L0(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function N0(t,e,n){var i=mt.exec(e.slice(n,n+1));return i?(t.q=i[0]*3-3,n+i[0].length):-1}function A0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function Ns(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function P0(t,e,n){var i=mt.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function As(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function E0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function z0(t,e,n){var i=mt.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function D0(t,e,n){var i=mt.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function W0(t,e,n){var i=mt.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function I0(t,e,n){var i=x0.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function O0(t,e,n){var i=mt.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function R0(t,e,n){var i=mt.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Ps(t,e){return st(t.getDate(),e,2)}function F0(t,e){return st(t.getHours(),e,2)}function Y0(t,e){return st(t.getHours()%12||12,e,2)}function V0(t,e){return st(1+Ao.count(Me(t),t),e,3)}function Nl(t,e){return st(t.getMilliseconds(),e,3)}function $0(t,e){return Nl(t,e)+"000"}function U0(t,e){return st(t.getMonth()+1,e,2)}function G0(t,e){return st(t.getMinutes(),e,2)}function Z0(t,e){return st(t.getSeconds(),e,2)}function q0(t){var e=t.getDay();return e===0?7:e}function X0(t,e){return st(Cl.count(Me(t)-1,t),e,2)}function Al(t){var e=t.getDay();return e>=4||e===0?Ke(t):Ke.ceil(t)}function B0(t,e){return t=Al(t),st(Ke.count(Me(t),t)+(Me(t).getDay()===4),e,2)}function H0(t){return t.getDay()}function j0(t,e){return st(Ni.count(Me(t)-1,t),e,2)}function K0(t,e){return st(t.getFullYear()%100,e,2)}function Q0(t,e){return t=Al(t),st(t.getFullYear()%100,e,2)}function J0(t,e){return st(t.getFullYear()%1e4,e,4)}function t1(t,e){var n=t.getDay();return t=n>=4||n===0?Ke(t):Ke.ceil(t),st(t.getFullYear()%1e4,e,4)}function e1(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+st(e/60|0,"0",2)+st(e%60,"0",2)}function Es(t,e){return st(t.getUTCDate(),e,2)}function n1(t,e){return st(t.getUTCHours(),e,2)}function i1(t,e){return st(t.getUTCHours()%12||12,e,2)}function r1(t,e){return st(1+Po.count(Te(t),t),e,3)}function Pl(t,e){return st(t.getUTCMilliseconds(),e,3)}function o1(t,e){return Pl(t,e)+"000"}function s1(t,e){return st(t.getUTCMonth()+1,e,2)}function a1(t,e){return st(t.getUTCMinutes(),e,2)}function l1(t,e){return st(t.getUTCSeconds(),e,2)}function u1(t){var e=t.getUTCDay();return e===0?7:e}function c1(t,e){return st(Ll.count(Te(t)-1,t),e,2)}function El(t){var e=t.getUTCDay();return e>=4||e===0?Qe(t):Qe.ceil(t)}function h1(t,e){return t=El(t),st(Qe.count(Te(t),t)+(Te(t).getUTCDay()===4),e,2)}function f1(t){return t.getUTCDay()}function d1(t,e){return st(Ai.count(Te(t)-1,t),e,2)}function g1(t,e){return st(t.getUTCFullYear()%100,e,2)}function p1(t,e){return t=El(t),st(t.getUTCFullYear()%100,e,2)}function m1(t,e){return st(t.getUTCFullYear()%1e4,e,4)}function y1(t,e){var n=t.getUTCDay();return t=n>=4||n===0?Qe(t):Qe.ceil(t),st(t.getUTCFullYear()%1e4,e,4)}function w1(){return"+0000"}function zs(){return"%"}function Ds(t){return+t}function Ws(t){return Math.floor(+t/1e3)}var Pe,zl;v1({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function v1(t){return Pe=v0(t),zl=Pe.format,Pe.parse,Pe.utcFormat,Pe.utcParse,Pe}function x1(){var t=0,e=1,n,i,r,o,s=Et,a=!1,l;function u(c){return c==null||isNaN(c=+c)?l:s(r===0?.5:(c=(o(c)-n)*r,a?Math.max(0,Math.min(1,c)):c))}u.domain=function(c){return arguments.length?([t,e]=c,n=o(t=+t),i=o(e=+e),r=n===i?0:1/(i-n),u):[t,e]},u.clamp=function(c){return arguments.length?(a=!!c,u):a},u.interpolator=function(c){return arguments.length?(s=c,u):s};function f(c){return function(h){var d,p;return arguments.length?([d,p]=h,s=c(d,p),u):[s(0),s(1)]}}return u.range=f(an),u.rangeRound=f(ml),u.unknown=function(c){return arguments.length?(l=c,u):l},function(c){return o=c,n=c(t),i=c(e),r=n===i?0:1/(i-n),u}}function b1(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Dl(){var t=Co(x1()(Et));return t.copy=function(){return b1(t,Dl())},Xh.apply(t,arguments)}function Eo(t){for(var e=t.length/6|0,n=new Array(e),i=0;igl(t[t.length-1]);var T1=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Eo);const S1=M1(T1);bl(he(-100,.75,.35),he(80,1.5,.8));bl(he(260,.75,.35),he(80,1.5,.8));var ai=he();function C1(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return ai.h=360*t-100,ai.s=1.5-1.5*e,ai.l=.8-.9*e,ai+""}var Je=0,_n=0,dn=0,Wl=1e3,Pi,kn,Ei=0,Se=0,Bi=0,Yn=typeof performance=="object"&&performance.now?performance:Date,Il=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function zo(){return Se||(Il(L1),Se=Yn.now()+Bi)}function L1(){Se=0}function zi(){this._call=this._time=this._next=null}zi.prototype=Ol.prototype={constructor:zi,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?zo():+n)+(e==null?0:+e),!this._next&&kn!==this&&(kn?kn._next=this:Pi=this,kn=this),this._call=t,this._time=n,$r()},stop:function(){this._call&&(this._call=null,this._time=1/0,$r())}};function Ol(t,e,n){var i=new zi;return i.restart(t,e,n),i}function N1(){zo(),++Je;for(var t=Pi,e;t;)(e=Se-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Je}function Is(){Se=(Ei=Yn.now())+Bi,Je=_n=0;try{N1()}finally{Je=0,P1(),Se=0}}function A1(){var t=Yn.now(),e=t-Ei;e>Wl&&(Bi-=e,Ei=t)}function P1(){for(var t,e=Pi,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Pi=n);kn=t,$r(i)}function $r(t){if(!Je){_n&&(_n=clearTimeout(_n));var e=t-Se;e>24?(t<1/0&&(_n=setTimeout(Is,t-Yn.now()-Bi)),dn&&(dn=clearInterval(dn))):(dn||(Ei=Yn.now(),dn=setInterval(A1,Wl)),Je=1,Il(Is))}}function Ur(t,e,n){var i=new zi;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}var E1={value:()=>{}};function Kn(){for(var t=0,e=arguments.length,n={},i;t=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}mi.prototype=Kn.prototype={constructor:mi,on:function(t,e){var n=this._,i=z1(t+"",n),r,o=-1,s=i.length;if(arguments.length<2){for(;++o0)for(var n=new Array(r),i=0,r,o;iRl)throw new Error("too late; already scheduled");return n}function jt(t,e){var n=Vt(t,e);if(n.state>yi)throw new Error("too late; already running");return n}function Vt(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function O1(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=Ol(o,0,n.time);function o(u){n.state=Rs,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var f,c,h,d;if(n.state!==Rs)return l();for(f in i)if(d=i[f],d.name===n.name){if(d.state===yi)return Ur(s);d.state===Fs?(d.state=wi,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[f]):+fGr&&i.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function dd(t,e,n){var i,r,o=fd(e)?Do:jt;return function(){var s=o(this,t),a=s.on;a!==i&&(r=(i=a).copy()).on(e,n),s.on=r}}function gd(t,e){var n=this._id;return arguments.length<2?Vt(this.node(),n).on.on(t):this.each(dd(n,t,e))}function pd(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function md(){return this.on("end.remove",pd(this._id))}function yd(t){var e=this._name,n=this._id;typeof t!="function"&&(t=mo(t));for(var i=this._groups,r=i.length,o=new Array(r),s=0;s+t;function Fd(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function Ul(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Io=3;(function t(e){e=+e;function n(i){return Math.pow(i,e)}return n.exponent=t,n})(Io);(function t(e){e=+e;function n(i){return 1-Math.pow(1-i,e)}return n.exponent=t,n})(Io);var Yd=function t(e){e=+e;function n(i){return((i*=2)<=1?Math.pow(i,e):2-Math.pow(2-i,e))/2}return n.exponent=t,n}(Io);function Di(t){return(Math.pow(2,-10*t)-.0009765625)*1.0009775171065494}var tn=2*Math.PI,Oo=1,Ro=.3;(function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=tn);function r(o){return e*Di(- --o)*Math.sin((i-o)/n)}return r.amplitude=function(o){return t(o,n*tn)},r.period=function(o){return t(e,o)},r})(Oo,Ro);var Vd=function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=tn);function r(o){return 1-e*Di(o=+o)*Math.sin((o+i)/n)}return r.amplitude=function(o){return t(o,n*tn)},r.period=function(o){return t(e,o)},r}(Oo,Ro);(function t(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=tn);function r(o){return((o=o*2-1)<0?e*Di(-o)*Math.sin((i-o)/n):2-e*Di(o)*Math.sin((i+o)/n))/2}return r.amplitude=function(o){return t(o,n*tn)},r.period=function(o){return t(e,o)},r})(Oo,Ro);var $d={time:null,delay:0,duration:250,ease:Ul};function Ud(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Gd(t){var e,n;t instanceof ae?(e=t._id,t=t._name):(e=$l(),(n=$d).time=zo(),t=t==null?null:t+"");for(var i=this._groups,r=i.length,o=0;o+t(e)}function Hd(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function jd(){return!this.__axis}function Gl(t,e){var n=[],i=null,r=null,o=6,s=6,a=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===cr||t===Mn?-1:1,f=t===Mn||t===hr?"x":"y",c=t===cr||t===qr?qd:Xd;function h(d){var p=i==null?e.ticks?e.ticks.apply(e,n):e.domain():i,b=r==null?e.tickFormat?e.tickFormat.apply(e,n):Zd:r,m=Math.max(o,0)+a,g=e.range(),x=+g[0]+l,w=+g[g.length-1]+l,y=(e.bandwidth?Hd:Bd)(e.copy(),l),M=d.selection?d.selection():d,W=M.selectAll(".domain").data([null]),R=M.selectAll(".tick").data(p,e).order(),_=R.exit(),V=R.enter().append("g").attr("class","tick"),L=R.select("line"),C=R.select("text");W=W.merge(W.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),R=R.merge(V),L=L.merge(V.append("line").attr("stroke","currentColor").attr(f+"2",u*o)),C=C.merge(V.append("text").attr("fill","currentColor").attr(f,u*m).attr("dy",t===cr?"0em":t===qr?"0.71em":"0.32em")),d!==M&&(W=W.transition(d),R=R.transition(d),L=L.transition(d),C=C.transition(d),_=_.transition(d).attr("opacity",Ys).attr("transform",function(I){return isFinite(I=y(I))?c(I+l):this.getAttribute("transform")}),V.attr("opacity",Ys).attr("transform",function(I){var E=this.parentNode.__axis;return c((E&&isFinite(E=E(I))?E:y(I))+l)})),_.remove(),W.attr("d",t===Mn||t===hr?s?"M"+u*s+","+x+"H"+l+"V"+w+"H"+u*s:"M"+l+","+x+"V"+w:s?"M"+x+","+u*s+"V"+l+"H"+w+"V"+u*s:"M"+x+","+l+"H"+w),R.attr("opacity",1).attr("transform",function(I){return c(y(I)+l)}),L.attr(f+"2",u*o),C.attr(f,u*m).text(b),M.filter(jd).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===hr?"start":t===Mn?"end":"middle"),M.each(function(){this.__axis=y})}return h.scale=function(d){return arguments.length?(e=d,h):e},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),h):n.slice()},h.tickValues=function(d){return arguments.length?(i=d==null?null:Array.from(d),h):i&&i.slice()},h.tickFormat=function(d){return arguments.length?(r=d,h):r},h.tickSize=function(d){return arguments.length?(o=s=+d,h):o},h.tickSizeInner=function(d){return arguments.length?(o=+d,h):o},h.tickSizeOuter=function(d){return arguments.length?(s=+d,h):s},h.tickPadding=function(d){return arguments.length?(a=+d,h):a},h.offset=function(d){return arguments.length?(l=+d,h):l},h}function Kd(t){return Gl(qr,t)}function Qd(t){return Gl(Mn,t)}const Xr=Math.PI,Br=2*Xr,we=1e-6,Jd=Br-we;function Hr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Qn(){return new Hr}Hr.prototype=Qn.prototype={constructor:Hr,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,s=this._y1,a=n-t,l=i-e,u=o-t,f=s-e,c=u*u+f*f;if(r<0)throw new Error("negative radius: "+r);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(c>we)if(!(Math.abs(f*a-l*u)>we)||!r)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var h=n-o,d=i-s,p=a*a+l*l,b=h*h+d*d,m=Math.sqrt(p),g=Math.sqrt(c),x=r*Math.tan((Xr-Math.acos((p+c-b)/(2*m*g)))/2),w=x/g,y=x/m;Math.abs(w-1)>we&&(this._+="L"+(t+w*u)+","+(e+w*f)),this._+="A"+r+","+r+",0,0,"+ +(f*h>u*d)+","+(this._x1=t+y*a)+","+(this._y1=e+y*l)}},arc:function(t,e,n,i,r,o){t=+t,e=+e,n=+n,o=!!o;var s=n*Math.cos(i),a=n*Math.sin(i),l=t+s,u=e+a,f=1^o,c=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+u:(Math.abs(this._x1-l)>we||Math.abs(this._y1-u)>we)&&(this._+="L"+l+","+u),n&&(c<0&&(c=c%Br+Br),c>Jd?this._+="A"+n+","+n+",0,1,"+f+","+(t-s)+","+(e-a)+"A"+n+","+n+",0,1,"+f+","+(this._x1=l)+","+(this._y1=u):c>we&&(this._+="A"+n+","+n+",0,"+ +(c>=Xr)+","+f+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};function xt(t){return function(){return t}}const Vs=Math.abs,yt=Math.atan2,me=Math.cos,tg=Math.max,fr=Math.min,Ut=Math.sin,Re=Math.sqrt,Ct=1e-12,Vn=Math.PI,Wi=Vn/2,eg=2*Vn;function ng(t){return t>1?0:t<-1?Vn:Math.acos(t)}function $s(t){return t>=1?Wi:t<=-1?-Wi:Math.asin(t)}function ig(t){return t.innerRadius}function rg(t){return t.outerRadius}function og(t){return t.startAngle}function sg(t){return t.endAngle}function ag(t){return t&&t.padAngle}function lg(t,e,n,i,r,o,s,a){var l=n-t,u=i-e,f=s-r,c=a-o,h=c*l-f*u;if(!(h*hv*v+A*A&&(_=L,V=C),{cx:_,cy:V,x01:-f,y01:-c,x11:_*(r/M-1),y11:V*(r/M-1)}}function ug(){var t=ig,e=rg,n=xt(0),i=null,r=og,o=sg,s=ag,a=null;function l(){var u,f,c=+t.apply(this,arguments),h=+e.apply(this,arguments),d=r.apply(this,arguments)-Wi,p=o.apply(this,arguments)-Wi,b=Vs(p-d),m=p>d;if(a||(a=u=Qn()),hCt))a.moveTo(0,0);else if(b>eg-Ct)a.moveTo(h*me(d),h*Ut(d)),a.arc(0,0,h,d,p,!m),c>Ct&&(a.moveTo(c*me(p),c*Ut(p)),a.arc(0,0,c,p,d,m));else{var g=d,x=p,w=d,y=p,M=b,W=b,R=s.apply(this,arguments)/2,_=R>Ct&&(i?+i.apply(this,arguments):Re(c*c+h*h)),V=fr(Vs(h-c)/2,+n.apply(this,arguments)),L=V,C=V,I,E;if(_>Ct){var v=$s(_/c*Ut(R)),A=$s(_/h*Ut(R));(M-=v*2)>Ct?(v*=m?1:-1,w+=v,y-=v):(M=0,w=y=(d+p)/2),(W-=A*2)>Ct?(A*=m?1:-1,g+=A,x-=A):(W=0,g=x=(d+p)/2)}var k=h*me(g),S=h*Ut(g),$=c*me(y),O=c*Ut(y);if(V>Ct){var T=h*me(x),F=h*Ut(x),U=c*me(w),ot=c*Ut(w),H;if(bCt?C>Ct?(I=li(U,ot,k,S,h,C,m),E=li(T,F,$,O,h,C,m),a.moveTo(I.cx+I.x01,I.cy+I.y01),CCt)||!(M>Ct)?a.lineTo($,O):L>Ct?(I=li($,O,T,F,c,-L,m),E=li(k,S,U,ot,c,-L,m),a.lineTo(I.cx+I.x01,I.cy+I.y01),L=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function kg(t){return new Jl(t,1)}function Mg(t){var e=0,n=t.children,i=n&&n.length;if(!i)e=1;else for(;--i>=0;)e+=n[i].value;t.value=e}function Tg(){return this.eachAfter(Mg)}function Sg(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this}function Cg(t,e){for(var n=this,i=[n],r,o,s=-1;n=i.pop();)if(t.call(e,n,++s,this),r=n.children)for(o=r.length-1;o>=0;--o)i.push(r[o]);return this}function Lg(t,e){for(var n=this,i=[n],r=[],o,s,a,l=-1;n=i.pop();)if(r.push(n),o=n.children)for(s=0,a=o.length;s=0;)n+=i[r].value;e.value=n})}function Pg(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Eg(t){for(var e=this,n=zg(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i}function zg(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}function Dg(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Wg(){return Array.from(this)}function Ig(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Og(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*Rg(){var t=this,e,n=[t],i,r,o;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,i=t.children)for(r=0,o=i.length;r=0;--a)r.push(o=s[a]=new $n(s[a])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(Ug)}function Fg(){return Fo(this).eachBefore($g)}function Yg(t){return t.children}function Vg(t){return Array.isArray(t)?t[1]:null}function $g(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ug(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function $n(t){this.data=t,this.depth=this.height=0,this.parent=null}$n.prototype=Fo.prototype={constructor:$n,count:Tg,each:Sg,eachAfter:Lg,eachBefore:Cg,find:Ng,sum:Ag,sort:Pg,path:Eg,ancestors:Dg,descendants:Wg,leaves:Ig,links:Og,copy:Fg,[Symbol.iterator]:Rg};function Gg(t){return t==null?null:Zg(t)}function Zg(t){if(typeof t!="function")throw new Error;return t}function Xs(){return 0}function qg(t){return function(){return t}}const Xg=1664525,Bg=1013904223,Bs=4294967296;function Hg(){let t=1;return()=>(t=(Xg*t+Bg)%Bs)/Bs}function jg(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Kg(t,e){let n=t.length,i,r;for(;n;)r=e()*n--|0,i=t[n],t[n]=t[r],t[r]=i;return t}function Qg(t,e){for(var n=0,i=(t=Kg(Array.from(t),e)).length,r=[],o,s;n0&&n*n>i*i+r*r}function gr(t,e){for(var n=0;n1e-6?(C+Math.sqrt(C*C-4*L*I))/(2*L):I/C);return{x:i+W+R*E,y:r+_+V*E,r:E}}function Hs(t,e,n){var i=t.x-e.x,r,o,s=t.y-e.y,a,l,u=i*i+s*s;u?(o=e.r+n.r,o*=o,l=t.r+n.r,l*=l,o>l?(r=(u+l-o)/(2*u),a=Math.sqrt(Math.max(0,l/u-r*r)),n.x=t.x-r*i-a*s,n.y=t.y-r*s+a*i):(r=(u+o-l)/(2*u),a=Math.sqrt(Math.max(0,o/u-r*r)),n.x=e.x+r*i-a*s,n.y=e.y+r*s+a*i)):(n.x=e.x+n.r,n.y=e.y)}function js(t,e){var n=t.r+e.r-1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function Ks(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,o=(e.y*n.r+n.y*e.r)/i;return r*r+o*o}function ci(t){this._=t,this.next=null,this.previous=null}function np(t,e){if(!(o=(t=jg(t)).length))return 0;var n,i,r,o,s,a,l,u,f,c,h;if(n=t[0],n.x=0,n.y=0,!(o>1))return n.r;if(i=t[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;Hs(i,n,r=t[2]),n=new ci(n),i=new ci(i),r=new ci(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;t:for(l=3;l=0;)o=i[r],o.z+=e,o.m+=e,e+=o.s+(n+=o.c)}function hp(t,e,n){return t.a.parent===e.parent?t.a:n}function vi(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}vi.prototype=Object.create($n.prototype);function fp(t){for(var e=new vi(t,0),n,i=[e],r,o,s,a;n=i.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)i.push(r=n.children[s]=new vi(o[s],s)),r.parent=n;return(e.parent=new vi(null,0)).children=[e],e}function dp(){var t=lp,e=1,n=1,i=null;function r(u){var f=fp(u);if(f.eachAfter(o),f.parent.m=-f.z,f.eachBefore(s),i)u.eachBefore(l);else{var c=u,h=u,d=u;u.eachBefore(function(x){x.xh.x&&(h=x),x.depth>d.depth&&(d=x)});var p=c===h?1:t(c,h)/2,b=p-c.x,m=e/(h.x+p+b),g=n/(d.depth||1);u.eachBefore(function(x){x.x=(x.x+b)*m,x.y=x.depth*g})}return u}function o(u){var f=u.children,c=u.parent.children,h=u.i?c[u.i-1]:null;if(f){cp(u);var d=(f[0].z+f[f.length-1].z)/2;h?(u.z=h.z+t(u._,h._),u.m=u.z-d):u.z=d}else h&&(u.z=h.z+t(u._,h._));u.parent.A=a(u,h,u.parent.A||c[0])}function s(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function a(u,f,c){if(f){for(var h=u,d=u,p=f,b=h.parent.children[0],m=h.m,g=d.m,x=p.m,w=b.m,y;p=yr(p),h=mr(h),p&&h;)b=mr(b),d=yr(d),d.a=u,y=p.z+x-h.z-m+t(p._,h._),y>0&&(up(hp(p,u,c),u,y),m+=y,g+=y),x+=p.m,m+=h.m,w+=b.m,g+=d.m;p&&!yr(d)&&(d.t=p,d.m+=x-g),h&&!mr(b)&&(b.t=h,b.m+=m-w,c=u)}return c}function l(u){u.x*=e,u.y=u.depth*n}return r.separation=function(u){return arguments.length?(t=u,r):t},r.size=function(u){return arguments.length?(i=!1,e=+u[0],n=+u[1],r):i?null:[e,n]},r.nodeSize=function(u){return arguments.length?(i=!0,e=+u[0],n=+u[1],r):i?[e,n]:null},r}const gp={passive:!1},Un={capture:!0,passive:!1};function wr(t){t.stopImmediatePropagation()}function Ge(t){t.preventDefault(),t.stopImmediatePropagation()}function Yo(t){var e=t.document.documentElement,n=kt(t).on("dragstart.drag",Ge,Un);"onselectstart"in e?n.on("selectstart.drag",Ge,Un):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Vo(t,e){var n=t.document.documentElement,i=kt(t).on("dragstart.drag",null);e&&(i.on("click.drag",Ge,Un),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const hi=t=>()=>t;function jr(t,{sourceEvent:e,subject:n,target:i,identifier:r,active:o,x:s,y:a,dx:l,dy:u,dispatch:f}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:f}})}jr.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function pp(t){return!t.ctrlKey&&!t.button}function mp(){return this.parentNode}function yp(t,e){return e==null?{x:t.x,y:t.y}:e}function wp(){return navigator.maxTouchPoints||"ontouchstart"in this}function vp(){var t=pp,e=mp,n=yp,i=wp,r={},o=Kn("start","drag","end"),s=0,a,l,u,f,c=0;function h(y){y.on("mousedown.drag",d).filter(i).on("touchstart.drag",m).on("touchmove.drag",g,gp).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(y,M){if(!(f||!t.call(this,y,M))){var W=w(this,e.call(this,y,M),y,M,"mouse");!W||(kt(y.view).on("mousemove.drag",p,Un).on("mouseup.drag",b,Un),Yo(y.view),wr(y),u=!1,a=y.clientX,l=y.clientY,W("start",y))}}function p(y){if(Ge(y),!u){var M=y.clientX-a,W=y.clientY-l;u=M*M+W*W>c}r.mouse("drag",y)}function b(y){kt(y.view).on("mousemove.drag mouseup.drag",null),Vo(y.view,u),Ge(y),r.mouse("end",y)}function m(y,M){if(!!t.call(this,y,M)){var W=y.changedTouches,R=e.call(this,y,M),_=W.length,V,L;for(V=0;V<_;++V)(L=w(this,R,y,M,W[V].identifier,W[V]))&&(wr(y),L("start",y,W[V]))}}function g(y){var M=y.changedTouches,W=M.length,R,_;for(R=0;R()=>t;function xp(t,{sourceEvent:e,target:n,selection:i,mode:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function bp(t){t.stopImmediatePropagation()}function xr(t){t.preventDefault(),t.stopImmediatePropagation()}var ta={name:"drag"},br={name:"space"},Ee={name:"handle"},ze={name:"center"};const{abs:ea,max:wt,min:vt}=Math;function na(t){return[+t[0],+t[1]]}function Kr(t){return[na(t[0]),na(t[1])]}var _r={name:"x",handles:["w","e"].map(Gn),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},kr={name:"y",handles:["n","s"].map(Gn),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},_p={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Gn),input:function(t){return t==null?null:Kr(t)},output:function(t){return t}},ne={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ia={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},ra={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},kp={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Mp={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Gn(t){return{type:t}}function Tp(t){return!t.ctrlKey&&!t.button}function Sp(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Cp(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mr(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Lp(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Np(){return Ap(_p)}function Ap(t){var e=Sp,n=Tp,i=Cp,r=!0,o=Kn("start","brush","end"),s=6,a;function l(m){var g=m.property("__brush",b).selectAll(".overlay").data([Gn("overlay")]);g.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ne.overlay).merge(g).each(function(){var w=Mr(this).extent;kt(this).attr("x",w[0][0]).attr("y",w[0][1]).attr("width",w[1][0]-w[0][0]).attr("height",w[1][1]-w[0][1])}),m.selectAll(".selection").data([Gn("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ne.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var x=m.selectAll(".handle").data(t.handles,function(w){return w.type});x.exit().remove(),x.enter().append("rect").attr("class",function(w){return"handle handle--"+w.type}).attr("cursor",function(w){return ne[w.type]}),m.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(m,g,x){m.tween?m.on("start.brush",function(w){f(this,arguments).beforestart().start(w)}).on("interrupt.brush end.brush",function(w){f(this,arguments).end(w)}).tween("brush",function(){var w=this,y=w.__brush,M=f(w,arguments),W=y.selection,R=t.input(typeof g=="function"?g.apply(this,arguments):g,y.extent),_=an(W,R);function V(L){y.selection=L===1&&R===null?null:_(L),u.call(w),M.brush()}return W!==null&&R!==null?V:V(1)}):m.each(function(){var w=this,y=arguments,M=w.__brush,W=t.input(typeof g=="function"?g.apply(w,y):g,M.extent),R=f(w,y).beforestart();Ue(w),M.selection=W===null?null:W,u.call(w),R.start(x).brush(x).end(x)})},l.clear=function(m,g){l.move(m,null,g)};function u(){var m=kt(this),g=Mr(this).selection;g?(m.selectAll(".selection").style("display",null).attr("x",g[0][0]).attr("y",g[0][1]).attr("width",g[1][0]-g[0][0]).attr("height",g[1][1]-g[0][1]),m.selectAll(".handle").style("display",null).attr("x",function(x){return x.type[x.type.length-1]==="e"?g[1][0]-s/2:g[0][0]-s/2}).attr("y",function(x){return x.type[0]==="s"?g[1][1]-s/2:g[0][1]-s/2}).attr("width",function(x){return x.type==="n"||x.type==="s"?g[1][0]-g[0][0]+s:s}).attr("height",function(x){return x.type==="e"||x.type==="w"?g[1][1]-g[0][1]+s:s})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function f(m,g,x){var w=m.__brush.emitter;return w&&(!x||!w.clean)?w:new c(m,g,x)}function c(m,g,x){this.that=m,this.args=g,this.state=m.__brush,this.active=0,this.clean=x}c.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,g){return this.starting?(this.starting=!1,this.emit("start",m,g)):this.emit("brush",m),this},brush:function(m,g){return this.emit("brush",m,g),this},end:function(m,g){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,g)),this},emit:function(m,g,x){var w=kt(this.that).datum();o.call(m,this.that,new xp(m,{sourceEvent:g,target:l,selection:t.output(this.state.selection),mode:x,dispatch:o}),w)}};function h(m){if(a&&!m.touches||!n.apply(this,arguments))return;var g=this,x=m.target.__data__.type,w=(r&&m.metaKey?x="overlay":x)==="selection"?ta:r&&m.altKey?ze:Ee,y=t===kr?null:kp[x],M=t===_r?null:Mp[x],W=Mr(g),R=W.extent,_=W.selection,V=R[0][0],L,C,I=R[0][1],E,v,A=R[1][0],k,S,$=R[1][1],O,T,F=0,U=0,ot,H=y&&M&&r&&m.shiftKey,at,ut,K=Array.from(m.touches||[m],j=>{const it=j.identifier;return j=Wt(j,g),j.point0=j.slice(),j.identifier=it,j});Ue(g);var Q=f(g,arguments,!0).beforestart();if(x==="overlay"){_&&(ot=!0);const j=[K[0],K[1]||K[0]];W.selection=_=[[L=t===kr?V:vt(j[0][0],j[1][0]),E=t===_r?I:vt(j[0][1],j[1][1])],[k=t===kr?A:wt(j[0][0],j[1][0]),O=t===_r?$:wt(j[0][1],j[1][1])]],K.length>1&&nt(m)}else L=_[0][0],E=_[0][1],k=_[1][0],O=_[1][1];C=L,v=E,S=k,T=O;var Y=kt(g).attr("pointer-events","none"),X=Y.selectAll(".overlay").attr("cursor",ne[x]);if(m.touches)Q.moved=z,Q.ended=q;else{var et=kt(m.view).on("mousemove.brush",z,!0).on("mouseup.brush",q,!0);r&&et.on("keydown.brush",ct,!0).on("keyup.brush",ft,!0),Yo(m.view)}u.call(g),Q.start(m,w.name);function z(j){for(const it of j.changedTouches||[j])for(const $t of K)$t.identifier===it.identifier&&($t.cur=Wt(it,g));if(H&&!at&&!ut&&K.length===1){const it=K[0];ea(it.cur[0]-it[0])>ea(it.cur[1]-it[1])?ut=!0:at=!0}for(const it of K)it.cur&&(it[0]=it.cur[0],it[1]=it.cur[1]);ot=!0,xr(j),nt(j)}function nt(j){const it=K[0],$t=it.point0;var zt;switch(F=it[0]-$t[0],U=it[1]-$t[1],w){case br:case ta:{y&&(F=wt(V-L,vt(A-k,F)),C=L+F,S=k+F),M&&(U=wt(I-E,vt($-O,U)),v=E+U,T=O+U);break}case Ee:{K[1]?(y&&(C=wt(V,vt(A,K[0][0])),S=wt(V,vt(A,K[1][0])),y=1),M&&(v=wt(I,vt($,K[0][1])),T=wt(I,vt($,K[1][1])),M=1)):(y<0?(F=wt(V-L,vt(A-L,F)),C=L+F,S=k):y>0&&(F=wt(V-k,vt(A-k,F)),C=L,S=k+F),M<0?(U=wt(I-E,vt($-E,U)),v=E+U,T=O):M>0&&(U=wt(I-O,vt($-O,U)),v=E,T=O+U));break}case ze:{y&&(C=wt(V,vt(A,L-F*y)),S=wt(V,vt(A,k+F*y))),M&&(v=wt(I,vt($,E-U*M)),T=wt(I,vt($,O+U*M)));break}}S0&&(L=C-F),M<0?O=T-U:M>0&&(E=v-U),w=br,X.attr("cursor",ne.selection),nt(j));break}default:return}xr(j)}function ft(j){switch(j.keyCode){case 16:{H&&(at=ut=H=!1,nt(j));break}case 18:{w===ze&&(y<0?k=S:y>0&&(L=C),M<0?O=T:M>0&&(E=v),w=Ee,nt(j));break}case 32:{w===br&&(j.altKey?(y&&(k=S-F*y,L=C+F*y),M&&(O=T-U*M,E=v+U*M),w=ze):(y<0?k=S:y>0&&(L=C),M<0?O=T:M>0&&(E=v),w=Ee),X.attr("cursor",ne[x]),nt(j));break}default:return}xr(j)}}function d(m){f(this,arguments).moved(m)}function p(m){f(this,arguments).ended(m)}function b(){var m=this.__brush||{selection:null};return m.extent=Kr(e.apply(this,arguments)),m.dim=t,m}return l.extent=function(m){return arguments.length?(e=typeof m=="function"?m:vr(Kr(m)),l):e},l.filter=function(m){return arguments.length?(n=typeof m=="function"?m:vr(!!m),l):n},l.touchable=function(m){return arguments.length?(i=typeof m=="function"?m:vr(!!m),l):i},l.handleSize=function(m){return arguments.length?(s=+m,l):s},l.keyModifiers=function(m){return arguments.length?(r=!!m,l):r},l.on=function(){var m=o.on.apply(o,arguments);return m===o?l:m},l}const fi=t=>()=>t;function Pp(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function se(t,e,n){this.k=t,this.x=e,this.y=n}se.prototype={constructor:se,scale:function(t){return t===1?this:new se(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new se(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ji=new se(1,0,0);nu.prototype=se.prototype;function nu(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ji;return t.__zoom}function Tr(t){t.stopImmediatePropagation()}function gn(t){t.preventDefault(),t.stopImmediatePropagation()}function Ep(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function zp(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function oa(){return this.__zoom||ji}function Dp(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Wp(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ip(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function Op(){var t=Ep,e=zp,n=Ip,i=Dp,r=Wp,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=vl,u=Kn("start","zoom","end"),f,c,h,d=500,p=150,b=0,m=10;function g(v){v.property("__zoom",oa).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",V).on("dblclick.zoom",L).filter(r).on("touchstart.zoom",C).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",E).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(v,A,k,S){var $=v.selection?v.selection():v;$.property("__zoom",oa),v!==$?M(v,A,k,S):$.interrupt().each(function(){W(this,arguments).event(S).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},g.scaleBy=function(v,A,k,S){g.scaleTo(v,function(){var $=this.__zoom.k,O=typeof A=="function"?A.apply(this,arguments):A;return $*O},k,S)},g.scaleTo=function(v,A,k,S){g.transform(v,function(){var $=e.apply(this,arguments),O=this.__zoom,T=k==null?y($):typeof k=="function"?k.apply(this,arguments):k,F=O.invert(T),U=typeof A=="function"?A.apply(this,arguments):A;return n(w(x(O,U),T,F),$,s)},k,S)},g.translateBy=function(v,A,k,S){g.transform(v,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof k=="function"?k.apply(this,arguments):k),e.apply(this,arguments),s)},null,S)},g.translateTo=function(v,A,k,S,$){g.transform(v,function(){var O=e.apply(this,arguments),T=this.__zoom,F=S==null?y(O):typeof S=="function"?S.apply(this,arguments):S;return n(ji.translate(F[0],F[1]).scale(T.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof k=="function"?-k.apply(this,arguments):-k),O,s)},S,$)};function x(v,A){return A=Math.max(o[0],Math.min(o[1],A)),A===v.k?v:new se(A,v.x,v.y)}function w(v,A,k){var S=A[0]-k[0]*v.k,$=A[1]-k[1]*v.k;return S===v.x&&$===v.y?v:new se(v.k,S,$)}function y(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function M(v,A,k,S){v.on("start.zoom",function(){W(this,arguments).event(S).start()}).on("interrupt.zoom end.zoom",function(){W(this,arguments).event(S).end()}).tween("zoom",function(){var $=this,O=arguments,T=W($,O).event(S),F=e.apply($,O),U=k==null?y(F):typeof k=="function"?k.apply($,O):k,ot=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),H=$.__zoom,at=typeof A=="function"?A.apply($,O):A,ut=l(H.invert(U).concat(ot/H.k),at.invert(U).concat(ot/at.k));return function(K){if(K===1)K=at;else{var Q=ut(K),Y=ot/Q[2];K=new se(Y,U[0]-Q[0]*Y,U[1]-Q[1]*Y)}T.zoom(null,K)}})}function W(v,A,k){return!k&&v.__zooming||new R(v,A)}function R(v,A){this.that=v,this.args=A,this.active=0,this.sourceEvent=null,this.extent=e.apply(v,A),this.taps=0}R.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,A){return this.mouse&&v!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var A=kt(this.that).datum();u.call(v,this.that,new Pp(v,{sourceEvent:this.sourceEvent,target:g,type:v,transform:this.that.__zoom,dispatch:u}),A)}};function _(v,...A){if(!t.apply(this,arguments))return;var k=W(this,A).event(v),S=this.__zoom,$=Math.max(o[0],Math.min(o[1],S.k*Math.pow(2,i.apply(this,arguments)))),O=Wt(v);if(k.wheel)(k.mouse[0][0]!==O[0]||k.mouse[0][1]!==O[1])&&(k.mouse[1]=S.invert(k.mouse[0]=O)),clearTimeout(k.wheel);else{if(S.k===$)return;k.mouse=[O,S.invert(O)],Ue(this),k.start()}gn(v),k.wheel=setTimeout(T,p),k.zoom("mouse",n(w(x(S,$),k.mouse[0],k.mouse[1]),k.extent,s));function T(){k.wheel=null,k.end()}}function V(v,...A){if(h||!t.apply(this,arguments))return;var k=v.currentTarget,S=W(this,A,!0).event(v),$=kt(v.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",ot,!0),O=Wt(v,k),T=v.clientX,F=v.clientY;Yo(v.view),Tr(v),S.mouse=[O,this.__zoom.invert(O)],Ue(this),S.start();function U(H){if(gn(H),!S.moved){var at=H.clientX-T,ut=H.clientY-F;S.moved=at*at+ut*ut>b}S.event(H).zoom("mouse",n(w(S.that.__zoom,S.mouse[0]=Wt(H,k),S.mouse[1]),S.extent,s))}function ot(H){$.on("mousemove.zoom mouseup.zoom",null),Vo(H.view,S.moved),gn(H),S.event(H).end()}}function L(v,...A){if(!!t.apply(this,arguments)){var k=this.__zoom,S=Wt(v.changedTouches?v.changedTouches[0]:v,this),$=k.invert(S),O=k.k*(v.shiftKey?.5:2),T=n(w(x(k,O),S,$),e.apply(this,A),s);gn(v),a>0?kt(this).transition().duration(a).call(M,T,S,v):kt(this).call(g.transform,T,S,v)}}function C(v,...A){if(!!t.apply(this,arguments)){var k=v.touches,S=k.length,$=W(this,A,v.changedTouches.length===S).event(v),O,T,F,U;for(Tr(v),T=0;T(e=Yp*e+Vp|0,sa*(e>>>0))}var Up=Array.prototype,Gp=Up.slice;function Zp(t,e){return t-e}function qp(t){for(var e=0,n=t.length,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e()=>t;function Xp(t,e){for(var n=-1,i=e.length,r;++ni!=d>i&&n<(h-u)*(i-f)/(d-f)+u&&(r=-r)}return r}function Hp(t,e,n){var i;return jp(t,e,n)&&Kp(t[i=+(t[0]===e[0])],n[i],e[i])}function jp(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function Kp(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function Qp(){}var ie=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Jp(){var t=1,e=1,n=Ka,i=l;function r(u){var f=n(u);if(Array.isArray(f))f=f.slice().sort(Zp);else{const c=Pn(u),h=ja(c[0],c[1],f);f=zn(Math.floor(c[0]/h)*h,Math.floor(c[1]/h-1)*h,f)}return f.map(c=>o(u,c))}function o(u,f){var c=[],h=[];return s(u,f,function(d){i(d,u,f),qp(d)>0?c.push([d]):h.push(d)}),h.forEach(function(d){for(var p=0,b=c.length,m;p=f,ie[g<<1].forEach(y);++p=f,ie[m|g<<1].forEach(y);for(ie[g<<0].forEach(y);++b=f,x=u[b*t]>=f,ie[g<<1|x<<2].forEach(y);++p=f,w=x,x=u[b*t+p+1]>=f,ie[m|g<<1|x<<2|w<<3].forEach(y);ie[g|x<<3].forEach(y)}for(p=-1,x=u[b*t]>=f,ie[x<<2].forEach(y);++p=f,ie[x<<2|w<<3].forEach(y);ie[x<<3].forEach(y);function y(M){var W=[M[0][0]+p,M[0][1]+b],R=[M[1][0]+p,M[1][1]+b],_=a(W),V=a(R),L,C;(L=d[_])?(C=h[V])?(delete d[L.end],delete h[C.start],L===C?(L.ring.push(R),c(L.ring)):h[L.start]=d[C.end]={start:L.start,end:C.end,ring:L.ring.concat(C.ring)}):(delete d[L.end],L.ring.push(R),d[L.end=V]=L):(L=h[V])?(C=d[_])?(delete h[L.start],delete d[C.end],L===C?(L.ring.push(R),c(L.ring)):h[C.start]=d[L.end]={start:C.start,end:L.end,ring:C.ring.concat(L.ring)}):(delete h[L.start],L.ring.unshift(W),h[L.start=_]=L):h[_]=d[V]={start:_,end:V,ring:[W,R]}}}function a(u){return u[0]*2+u[1]*(t+1)*4}function l(u,f,c){u.forEach(function(h){var d=h[0],p=h[1],b=d|0,m=p|0,g,x=f[m*t+b];d>0&&d0&&p=0&&c>=0))throw new Error("invalid size");return t=f,e=c,r},r.thresholds=function(u){return arguments.length?(n=typeof u=="function"?u:Array.isArray(u)?aa(Gp.call(u)):aa(u),r):n},r.smooth=function(u){return arguments.length?(i=u?l:Qp,r):i===l},r}var tm=Math.PI,em=tm*2,nm=Math.abs,$o=Math.sqrt;function Yt(){}function Oi(t,e){t&&ua.hasOwnProperty(t.type)&&ua[t.type](t,e)}var la={Feature:function(t,e){Oi(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++it;var Sr=new Be,Jr=new Be,ru,ou,to,eo,ue={point:Yt,lineStart:Yt,lineEnd:Yt,polygonStart:function(){ue.lineStart=rm,ue.lineEnd=sm},polygonEnd:function(){ue.lineStart=ue.lineEnd=ue.point=Yt,Sr.add(nm(Jr)),Jr=new Be},result:function(){var t=Sr/2;return Sr=new Be,t}};function rm(){ue.point=om}function om(t,e){ue.point=su,ru=to=t,ou=eo=e}function su(t,e){Jr.add(eo*t-to*e),to=t,eo=e}function sm(){su(ru,ou)}const ha=ue;var en=1/0,Ri=en,Zn=-en,Fi=Zn,am={point:lm,lineStart:Yt,lineEnd:Yt,polygonStart:Yt,polygonEnd:Yt,result:function(){var t=[[en,Ri],[Zn,Fi]];return Zn=Fi=-(Ri=en=1/0),t}};function lm(t,e){tZn&&(Zn=t),eFi&&(Fi=e)}const fa=am;var no=0,io=0,Sn=0,Yi=0,Vi=0,Fe=0,ro=0,oo=0,Cn=0,au,lu,Gt,Zt,Rt={point:Ce,lineStart:da,lineEnd:ga,polygonStart:function(){Rt.lineStart=hm,Rt.lineEnd=fm},polygonEnd:function(){Rt.point=Ce,Rt.lineStart=da,Rt.lineEnd=ga},result:function(){var t=Cn?[ro/Cn,oo/Cn]:Fe?[Yi/Fe,Vi/Fe]:Sn?[no/Sn,io/Sn]:[NaN,NaN];return no=io=Sn=Yi=Vi=Fe=ro=oo=Cn=0,t}};function Ce(t,e){no+=t,io+=e,++Sn}function da(){Rt.point=um}function um(t,e){Rt.point=cm,Ce(Gt=t,Zt=e)}function cm(t,e){var n=t-Gt,i=e-Zt,r=$o(n*n+i*i);Yi+=r*(Gt+t)/2,Vi+=r*(Zt+e)/2,Fe+=r,Ce(Gt=t,Zt=e)}function ga(){Rt.point=Ce}function hm(){Rt.point=dm}function fm(){uu(au,lu)}function dm(t,e){Rt.point=uu,Ce(au=Gt=t,lu=Zt=e)}function uu(t,e){var n=t-Gt,i=e-Zt,r=$o(n*n+i*i);Yi+=r*(Gt+t)/2,Vi+=r*(Zt+e)/2,Fe+=r,r=Zt*t-Gt*e,ro+=r*(Gt+t),oo+=r*(Zt+e),Cn+=r*3,Ce(Gt=t,Zt=e)}const pa=Rt;function cu(t){this._context=t}cu.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e),this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,em);break}}},result:Yt};var so=new Be,Cr,hu,fu,Ln,Nn,$i={point:Yt,lineStart:function(){$i.point=gm},lineEnd:function(){Cr&&du(hu,fu),$i.point=Yt},polygonStart:function(){Cr=!0},polygonEnd:function(){Cr=null},result:function(){var t=+so;return so=new Be,t}};function gm(t,e){$i.point=du,hu=Ln=t,fu=Nn=e}function du(t,e){Ln-=t,Nn-=e,so.add($o(Ln*Ln+Nn*Nn)),Ln=t,Nn=e}const ma=$i;function gu(){this._string=[]}gu.prototype={_radius:4.5,_circle:ya(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._string.push("M",t,",",e),this._point=1;break}case 1:{this._string.push("L",t,",",e);break}default:{this._circle==null&&(this._circle=ya(this._radius)),this._string.push("M",t,",",e,this._circle);break}}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}else return null}};function ya(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function pm(t,e){var n=4.5,i,r;function o(s){return s&&(typeof n=="function"&&r.pointRadius(+n.apply(this,arguments)),pn(s,i(r))),r.result()}return o.area=function(s){return pn(s,i(ha)),ha.result()},o.measure=function(s){return pn(s,i(ma)),ma.result()},o.bounds=function(s){return pn(s,i(fa)),fa.result()},o.centroid=function(s){return pn(s,i(pa)),pa.result()},o.projection=function(s){return arguments.length?(i=s==null?(t=null,im):(t=s).stream,o):t},o.context=function(s){return arguments.length?(r=s==null?(e=null,new gu):new cu(e=s),typeof n!="function"&&r.pointRadius(n),o):e},o.pointRadius=function(s){return arguments.length?(n=typeof s=="function"?s:(r.pointRadius(+s),+s),o):n},o.projection(t).context(e)}function mm(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return pu(this.cover(e,n),e,n,t)}function pu(t,e,n,i){if(isNaN(e)||isNaN(n))return t;var r,o=t._root,s={data:i},a=t._x0,l=t._y0,u=t._x1,f=t._y1,c,h,d,p,b,m,g,x;if(!o)return t._root=s,t;for(;o.length;)if((b=e>=(c=(a+u)/2))?a=c:u=c,(m=n>=(h=(l+f)/2))?l=h:f=h,r=o,!(o=o[g=m<<1|b]))return r[g]=s,t;if(d=+t._x.call(null,o.data),p=+t._y.call(null,o.data),e===d&&n===p)return s.next=o,r?r[g]=s:t._root=s,t;do r=r?r[g]=new Array(4):t._root=new Array(4),(b=e>=(c=(a+u)/2))?a=c:u=c,(m=n>=(h=(l+f)/2))?l=h:f=h;while((g=m<<1|b)===(x=(p>=h)<<1|d>=c));return r[x]=o,r[g]=s,t}function ym(t){var e,n,i=t.length,r,o,s=new Array(i),a=new Array(i),l=1/0,u=1/0,f=-1/0,c=-1/0;for(n=0;nf&&(f=r),oc&&(c=o));if(l>f||u>c)return this;for(this.cover(l,u).cover(f,c),n=0;nt||t>=r||i>e||e>=o;)switch(u=(ef||(a=p.y0)>c||(l=p.x1)=g)<<1|t>=m)&&(p=h[h.length-1],h[h.length-1]=h[h.length-1-b],h[h.length-1-b]=p)}else{var x=t-+this._x.call(null,d.data),w=e-+this._y.call(null,d.data),y=x*x+w*w;if(y=(h=(s+l)/2))?s=h:l=h,(b=c>=(d=(a+u)/2))?a=d:u=d,e=n,!(n=n[m=b<<1|p]))return this;if(!n.length)break;(e[m+1&3]||e[m+2&3]||e[m+3&3])&&(i=e,g=m)}for(;n.data!==t;)if(r=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,r?(o?r.next=o:delete r.next,this):e?(o?e[m]=o:delete e[m],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(i?i[g]=n:this._root=n),this):(this._root=o,this)}function km(t){for(var e=0,n=t.length;e{e&&(Lr.has(t)?(console.timeEnd(t),Lr.delete(t)):(console.time(t),Lr.add(t)))},ao=(t,e,n)=>{const i=r=>{const o=r.toString(16);return o.length==1?`0${o}`:o};return`#${i(t)}${i(e)}${i(n)}`},ve=(t,e)=>{const n=t.x+t.width,i=e.x+e.width,r=t.y+t.height,o=e.y+e.height;return t.xe.x&&t.ye.y},Em=()=>new Promise(t=>{setTimeout(t,0)});var rt=(t=>(t.top="top",t.bottom="bottom",t.left="left",t.right="right",t))(rt||{});const zm=[[" ",19.3],["!",34.3],['"',39.7],["#",58],["$",58],["%",78.6],["&",70.3],["'",23],["(",30],[")",30],["*",40],["+",58],[",",21.2],["-",34.7],[".",21.2],["/",37.3],["0",58],["1",58],["2",58],["3",58],["4",58],["5",58],["6",58],["7",58],["8",58],["9",58],[":",25.2],[";",25.2],["<",58],["=",58],[">",58],["?",39.8],["@",82.2],["A",68],["B",64.7],["C",68.5],["D",75.3],["E",58.1],["F",56.6],["G",73.4],["H",75.6],["I",30.7],["J",44.4],["K",68.1],["L",51.4],["M",92],["N",75.6],["O",79.8],["P",61.1],["Q",79.8],["R",64.4],["S",53],["T",59],["U",73],["V",68],["W",101.9],["X",64.3],["Y",62.9],["Z",62.4],["[",30],["\\",37.5],["]",30],["^",58],["_",39.4],["`",30.7],["a",50.7],["b",55.9],["c",46.7],["d",55.9],["e",52.4],["f",33.7],["g",51.1],["h",55.6],["i",25.6],["j",25.4],["k",52.4],["l",25.6],["m",82.1],["n",55.6],["o",55.6],["p",55.2],["q",55.9],["r",40.3],["s",43.4],["t",37.3],["u",55.6],["v",51.2],["w",76.6],["x",50.4],["y",51.2],["z",46.2],["{",30],["|",30],["}",30],["~",58],["_median",55.9]],Dm=[['"&',-9.1],['",',-11.4],['"-',-8.9],['".',-11.4],['"/',-9.1],['"@',-2.3],['"A',-9.1],['"C',-2.3],['"G',-2.3],['"O',-2.3],['"Q',-2.3],['"V',2.4],['"W',2.4],['"Y',1.5],['"\\',2.4],['"a',-3.2],['"c',-4.6],['"d',-4.6],['"e',-4.6],['"o',-4.6],['"q',-4.6],["'&",-9.1],["',",-11.4],["'-",-8.9],["'.",-11.4],["'/",-9.1],["'@",-2.3],["'A",-9.1],["'C",-2.3],["'G",-2.3],["'O",-2.3],["'Q",-2.3],["'V",2.4],["'W",2.4],["'Y",1.5],["'\\",2.4],["'a",-3.2],["'c",-4.6],["'d",-4.6],["'e",-4.6],["'o",-4.6],["'q",-4.6],["(@",-2],["(C",-2],["(G",-2],["(O",-2],["(Q",-2],["(c",-1.6],["(d",-1.6],["(e",-1.6],["(o",-1.6],["(q",-1.6],["*&",-9.1],["*,",-11.4],["*-",-8.9],["*.",-11.4],["*/",-9.1],["*@",-2.3],["*A",-9.1],["*C",-2.3],["*G",-2.3],["*O",-2.3],["*Q",-2.3],["*V",2.4],["*W",2.4],["*Y",1.5],["*\\",2.4],["*a",-3.2],["*c",-4.6],["*d",-4.6],["*e",-4.6],["*o",-4.6],["*q",-4.6],[',"',-11.4],[",'",-11.4],[",*",-11.4],[",-",-6.8],[",@",-2.8],[",C",-2.8],[",G",-2.8],[",O",-2.8],[",Q",-2.8],[",T",-9],[",V",-9],[",W",-6.1],[",Y",-7.6],[",\\",-9],[",v",-6.6],[",w",-3.1],[",y",-6.6],['-"',-8.9],["-&",-2.6],["-'",-8.9],["-*",-8.9],["-,",-6.8],["-.",-6.8],["-/",-2.6],["-A",-2.6],["-T",-9],["-V",-5.6],["-W",-1.6],["-X",-3.1],["-Y",-8],["-Z",-2.3],["-\\",-5.6],['."',-11.4],[".'",-11.4],[".*",-11.4],[".-",-6.8],[".@",-2.8],[".C",-2.8],[".G",-2.8],[".O",-2.8],[".Q",-2.8],[".T",-9],[".V",-9],[".W",-6.1],[".Y",-7.6],[".\\",-9],[".v",-6.6],[".w",-3.1],[".y",-6.6],['/"',2.4],["/&",-6.8],["/'",2.4],["/*",2.4],["/,",-9.6],["/-",-5.6],["/.",-9.6],["//",-6.8],["/:",-4.4],["/;",-4.4],["/?",2.4],["/@",-2.6],["/A",-6.8],["/C",-2.6],["/G",-2.6],["/J",-7.6],["/O",-2.6],["/Q",-2.6],["/a",-5.8],["/c",-5.8],["/d",-5.8],["/e",-5.8],["/f",-1.5],["/g",-6.8],["/m",-4.4],["/n",-4.4],["/o",-5.8],["/p",-4.4],["/q",-5.8],["/r",-4.4],["/s",-5.3],["/t",-2.1],["/u",-4.4],["/v",-2.4],["/x",-2.6],["/y",-2.4],["/z",-4.1],['@"',-2.3],["@&",-2.1],["@'",-2.3],["@)",-2],["@*",-2.3],["@,",-2.8],["@.",-2.8],["@/",-2.1],["@A",-2.1],["@T",-4.9],["@V",-2.6],["@X",-1.5],["@Y",-4],["@Z",-3.5],["@\\",-2.6],["@]",-2],["@}",-2],['A"',-9.1],["A'",-9.1],["A*",-9.1],["A-",-2.6],["A?",-2.8],["A@",-2.1],["AC",-2.1],["AG",-2.1],["AJ",2.5],["AO",-2.1],["AQ",-2.1],["AT",-6.6],["AU",-2.8],["AV",-6.8],["AW",-4.2],["AY",-8.2],["A\\",-6.8],["Av",-4.1],["Ay",-4.1],["C-",-7.5],['D"',-2.3],["D&",-2.1],["D'",-2.3],["D)",-2],["D*",-2.3],["D,",-2.8],["D.",-2.8],["D/",-2.1],["DA",-2.1],["DT",-4.9],["DV",-2.6],["DX",-1.5],["DY",-4],["DZ",-3.5],["D\\",-2.6],["D]",-2],["D}",-2],["F&",-6.6],["F,",-9],["F.",-9],["F/",-6.6],["F:",-3],["F;",-3],["F?",1.5],["FA",-6.6],["FJ",-9.9],["Fc",-3.5],["Fd",-3.5],["Fe",-3.5],["Fm",-3],["Fn",-3],["Fo",-3.5],["Fp",-3],["Fq",-3.5],["Fr",-3],["Fu",-3],["J&",-2.8],["J,",-2.5],["J.",-2.5],["J/",-2.8],["JA",-2.8],["K-",-3.1],["K@",-1.5],["KC",-1.5],["KG",-1.5],["KO",-1.5],["KQ",-1.5],["Kc",-1.8],["Kd",-1.8],["Ke",-1.8],["Kf",-2.6],["Ko",-1.8],["Kq",-1.8],["Kt",-4.1],["Kv",-3.3],["Kw",-2.8],["Ky",-3.3],['L"',-14.5],["L'",-14.5],["L*",-14.5],["L,",2.7],["L-",-9.9],["L.",2.7],["L?",-2.5],["L@",-4],["LC",-4],["LG",-4],["LO",-4],["LQ",-4],["LT",-8.6],["LV",-9.1],["LW",-7.6],["LY",-10.6],["L\\",-9.1],["Lc",-1.8],["Ld",-1.8],["Le",-1.8],["Lo",-1.8],["Lq",-1.8],["Lv",-5.4],["Lw",-4],["Ly",-5.4],['O"',-2.3],["O&",-2.1],["O'",-2.3],["O)",-2],["O*",-2.3],["O,",-2.8],["O.",-2.8],["O/",-2.1],["OA",-2.1],["OT",-4.9],["OV",-2.6],["OX",-1.5],["OY",-4],["OZ",-3.5],["O\\",-2.6],["O]",-2],["O}",-2],["P&",-6.9],["P,",-12.4],["P.",-12.4],["P/",-6.9],["PA",-6.9],["PJ",-9.1],["Pa",-2.5],["Pc",-1.5],["Pd",-1.5],["Pe",-1.5],["Po",-1.5],["Pq",-1.5],['Q"',-2.3],["Q&",-2.1],["Q'",-2.3],["Q)",-2],["Q*",-2.3],["Q,",-2.8],["Q.",-2.8],["Q/",-2.1],["QA",-2.1],["QT",-4.9],["QV",-2.6],["QX",-1.5],["QY",-4],["QZ",-3.5],["Q\\",-2.6],["Q]",-2],["Q}",-2],["R@",-2.3],["RC",-2.3],["RG",-2.3],["RO",-2.3],["RQ",-2.3],["RT",-2.6],["RU",-2.1],["T&",-6.6],["T,",-9],["T-",-9],["T.",-9],["T/",-6.6],["T:",-8],["T;",-8],["T@",-4.9],["TA",-6.6],["TC",-4.9],["TG",-4.9],["TJ",-10],["TO",-4.9],["TQ",-4.9],["Ta",-12.5],["Tc",-10.5],["Td",-10.5],["Te",-10.5],["Tg",-9.4],["Tm",-8],["Tn",-8],["To",-10.5],["Tp",-8],["Tq",-10.5],["Tr",-8],["Ts",-8.1],["Tu",-8],["Tv",-9],["Tw",-7],["Tx",-7.2],["Ty",-9],["Tz",-6],["U&",-2.8],["U,",-2.5],["U.",-2.5],["U/",-2.8],["UA",-2.8],['V"',2.4],["V&",-6.8],["V'",2.4],["V*",2.4],["V,",-9.6],["V-",-5.6],["V.",-9.6],["V/",-6.8],["V:",-4.4],["V;",-4.4],["V?",2.4],["V@",-2.6],["VA",-6.8],["VC",-2.6],["VG",-2.6],["VJ",-7.6],["VO",-2.6],["VQ",-2.6],["Va",-5.8],["Vc",-5.8],["Vd",-5.8],["Ve",-5.8],["Vf",-1.5],["Vg",-6.8],["Vm",-4.4],["Vn",-4.4],["Vo",-5.8],["Vp",-4.4],["Vq",-5.8],["Vr",-4.4],["Vs",-5.3],["Vt",-2.1],["Vu",-4.4],["Vv",-2.4],["Vx",-2.6],["Vy",-2.4],["Vz",-4.1],['W"',2.4],["W&",-4.7],["W'",2.4],["W*",2.4],["W,",-6.1],["W-",-1.6],["W.",-6.1],["W/",-4.7],["W?",1.7],["WA",-4.7],["WJ",-5.1],["Wa",-4.4],["Wc",-1.6],["Wd",-1.6],["We",-1.6],["Wg",-4.9],["Wo",-1.6],["Wq",-1.6],["Ws",-2.3],["X-",-3.1],["X@",-1.5],["XC",-1.5],["XG",-1.5],["XO",-1.5],["XQ",-1.5],["Xc",-1.8],["Xd",-1.8],["Xe",-1.8],["Xf",-2.6],["Xo",-1.8],["Xq",-1.8],["Xt",-4.1],["Xv",-3.3],["Xw",-2.8],["Xy",-3.3],['Y"',1.5],["Y&",-8.2],["Y'",1.5],["Y*",1.5],["Y,",-7.6],["Y-",-8],["Y.",-7.6],["Y/",-8.2],["Y:",-6.1],["Y;",-6.1],["Y?",1.7],["Y@",-4],["YA",-8.2],["YC",-4],["YG",-4],["YJ",-10],["YO",-4],["YQ",-4],["Ya",-6.4],["Yc",-8],["Yd",-8],["Ye",-8],["Yg",-8.6],["Ym",-6.1],["Yn",-6.1],["Yo",-8],["Yp",-6.1],["Yq",-8],["Yr",-6.1],["Ys",-6.4],["Yu",-6.1],["Yv",-5],["Yw",-4.6],["Yx",-6.6],["Yy",-5],["Z-",-3.5],["Z?",1.7],["Z@",-2.9],["ZC",-2.9],["ZG",-2.9],["ZO",-2.9],["ZQ",-2.9],["Zc",-1.9],["Zd",-1.9],["Ze",-1.9],["Zo",-1.9],["Zq",-1.9],["Zs",-1.4],["Zv",-2],["Zy",-2],["[@",-2],["[C",-2],["[G",-2],["[O",-2],["[Q",-2],["[c",-1.6],["[d",-1.6],["[e",-1.6],["[o",-1.6],["[q",-1.6],['\\"',-9.1],["\\'",-9.1],["\\*",-9.1],["\\-",-2.6],["\\?",-2.8],["\\@",-2.1],["\\C",-2.1],["\\G",-2.1],["\\J",2.5],["\\O",-2.1],["\\Q",-2.1],["\\T",-6.6],["\\U",-2.8],["\\V",-6.8],["\\W",-4.2],["\\Y",-8.2],["\\\\",-6.8],["\\v",-4.1],["\\y",-4.1],['a"',-3.6],["a'",-3.6],["a*",-3.6],["av",-1.6],["aw",-.8],["ay",-1.6],['b"',-4.6],["b'",-4.6],["b)",-1.6],["b*",-4.6],["bV",-5.8],["bW",-1.6],["b\\",-5.8],["b]",-1.6],["bv",-1.3],["bx",-3],["by",-1.3],["b}",-1.6],['e"',-4.6],["e'",-4.6],["e)",-1.6],["e*",-4.6],["eV",-5.8],["eW",-1.6],["e\\",-5.8],["e]",-1.6],["ev",-1.3],["ex",-3],["ey",-1.3],["e}",-1.6],['f"',3.4],["f'",3.4],["f*",3.4],["f,",-6.5],["f.",-6.5],["fi",-2.3],['h"',-3.6],["h'",-3.6],["h*",-3.6],["hv",-1.6],["hw",-.8],["hy",-1.6],["kc",-3],["kd",-3],["ke",-3],["ko",-3],["kq",-3],['m"',-3.6],["m'",-3.6],["m*",-3.6],["mv",-1.6],["mw",-.8],["my",-1.6],['n"',-3.6],["n'",-3.6],["n*",-3.6],["nv",-1.6],["nw",-.8],["ny",-1.6],['o"',-4.6],["o'",-4.6],["o)",-1.6],["o*",-4.6],["oV",-5.8],["oW",-1.6],["o\\",-5.8],["o]",-1.6],["ov",-1.3],["ox",-3],["oy",-1.3],["o}",-1.6],['p"',-4.6],["p'",-4.6],["p)",-1.6],["p*",-4.6],["pV",-5.8],["pW",-1.6],["p\\",-5.8],["p]",-1.6],["pv",-1.3],["px",-3],["py",-1.3],["p}",-1.6],["r,",-6.6],["r.",-6.6],["ra",-1.9],["v&",-4.1],["v,",-6.6],["v.",-6.6],["v/",-4.1],["vA",-4.1],["vc",-1.3],["vd",-1.3],["ve",-1.3],["vo",-1.3],["vq",-1.3],["w,",-3.1],["w.",-3.1],["xc",-3],["xd",-3],["xe",-3],["xo",-3],["xq",-3],["y&",-4.1],["y,",-6.6],["y.",-6.6],["y/",-4.1],["yA",-4.1],["yc",-1.3],["yd",-1.3],["ye",-1.3],["yo",-1.3],["yq",-1.3],["{@",-2],["{C",-2],["{G",-2],["{O",-2],["{Q",-2],["{c",-1.6],["{d",-1.6],["{e",-1.6],["{o",-1.6],["{q",-1.6]],Wm={textWidth:zm,kerningWidth:Dm},Im=(t,e,n=16)=>{const i=new Map(t.textWidth),r=new Map(t.kerningWidth),o=[...e];let s=0;for(const[a,l]of o.entries())s+=i.get(l)||i.get("_median"),a!==o.length-1&&(s+=r.get(`${l}${o[a+1]}`)||0);return s/(100/n)},Ft=(t,e=16)=>Im(Wm,t,e),xi={sunburstWidth:650,treeWindowWidth:150,treeWindowHeaderHeight:26,treeWindowHeight:0,toolbarHeight:36},Om={mouseenterDelay:300};xi.treeWindowHeight=xi.treeWindowHeaderHeight+xi.treeWindowWidth;const Rm={"red-50":"hsl(350, 100.0%, 96.08%)","red-100":"hsl(354, 100.0%, 90.2%)","red-200":"hsl(0, 72.65%, 77.06%)","red-300":"hsl(0, 68.67%, 67.45%)","red-400":"hsl(1, 83.25%, 62.55%)","red-500":"hsl(4, 89.62%, 58.43%)","red-600":"hsl(1, 77.19%, 55.29%)","red-700":"hsl(0, 65.08%, 50.59%)","red-800":"hsl(0, 66.39%, 46.67%)","red-900":"hsl(0, 73.46%, 41.37%)","red-a100":"hsl(4, 100.0%, 75.1%)","red-a200":"hsl(0, 100.0%, 66.08%)","red-a400":"hsl(348, 100.0%, 54.51%)","red-a700":"hsl(0, 100.0%, 41.76%)","pink-50":"hsl(340, 80.0%, 94.12%)","pink-100":"hsl(339, 81.33%, 85.29%)","pink-200":"hsl(339, 82.11%, 75.88%)","pink-300":"hsl(339, 82.56%, 66.27%)","pink-400":"hsl(339, 81.9%, 58.82%)","pink-500":"hsl(339, 82.19%, 51.57%)","pink-600":"hsl(338, 77.78%, 47.65%)","pink-700":"hsl(336, 77.98%, 42.75%)","pink-800":"hsl(333, 79.27%, 37.84%)","pink-900":"hsl(328, 81.33%, 29.41%)","pink-a100":"hsl(339, 100.0%, 75.1%)","pink-a200":"hsl(339, 100.0%, 62.55%)","pink-a400":"hsl(338, 100.0%, 48.04%)","pink-a700":"hsl(333, 84.11%, 41.96%)","purple-50":"hsl(292, 44.44%, 92.94%)","purple-100":"hsl(291, 46.07%, 82.55%)","purple-200":"hsl(291, 46.94%, 71.18%)","purple-300":"hsl(291, 46.6%, 59.61%)","purple-400":"hsl(291, 46.61%, 50.78%)","purple-500":"hsl(291, 63.72%, 42.16%)","purple-600":"hsl(287, 65.05%, 40.39%)","purple-700":"hsl(282, 67.88%, 37.84%)","purple-800":"hsl(277, 70.17%, 35.49%)","purple-900":"hsl(267, 75.0%, 31.37%)","purple-a100":"hsl(291, 95.38%, 74.51%)","purple-a200":"hsl(291, 95.9%, 61.76%)","purple-a400":"hsl(291, 100.0%, 48.82%)","purple-a700":"hsl(280, 100.0%, 50.0%)","deep-purple-50":"hsl(264, 45.45%, 93.53%)","deep-purple-100":"hsl(261, 45.68%, 84.12%)","deep-purple-200":"hsl(261, 46.27%, 73.73%)","deep-purple-300":"hsl(261, 46.81%, 63.14%)","deep-purple-400":"hsl(261, 46.72%, 55.1%)","deep-purple-500":"hsl(261, 51.87%, 47.25%)","deep-purple-600":"hsl(259, 53.91%, 45.1%)","deep-purple-700":"hsl(257, 57.75%, 41.76%)","deep-purple-800":"hsl(254, 60.8%, 39.02%)","deep-purple-900":"hsl(251, 68.79%, 33.92%)","deep-purple-a100":"hsl(261, 100.0%, 76.67%)","deep-purple-a200":"hsl(255, 100.0%, 65.1%)","deep-purple-a400":"hsl(258, 100.0%, 56.08%)","deep-purple-a700":"hsl(265, 100.0%, 45.88%)","indigo-50":"hsl(231, 43.75%, 93.73%)","indigo-100":"hsl(231, 45.0%, 84.31%)","indigo-200":"hsl(230, 44.36%, 73.92%)","indigo-300":"hsl(230, 44.09%, 63.53%)","indigo-400":"hsl(230, 44.25%, 55.69%)","indigo-500":"hsl(230, 48.36%, 47.84%)","indigo-600":"hsl(231, 50.0%, 44.71%)","indigo-700":"hsl(231, 53.62%, 40.59%)","indigo-800":"hsl(232, 57.22%, 36.67%)","indigo-900":"hsl(234, 65.79%, 29.8%)","indigo-a100":"hsl(230, 100.0%, 77.45%)","indigo-a200":"hsl(230, 98.84%, 66.08%)","indigo-a400":"hsl(230, 98.97%, 61.76%)","indigo-a700":"hsl(230, 99.04%, 59.22%)","blue-50":"hsl(205, 86.67%, 94.12%)","blue-100":"hsl(207, 88.89%, 85.88%)","blue-200":"hsl(206, 89.74%, 77.06%)","blue-300":"hsl(206, 89.02%, 67.84%)","blue-400":"hsl(206, 89.95%, 60.98%)","blue-500":"hsl(206, 89.74%, 54.12%)","blue-600":"hsl(208, 79.28%, 50.78%)","blue-700":"hsl(209, 78.72%, 46.08%)","blue-800":"hsl(211, 80.28%, 41.76%)","blue-900":"hsl(216, 85.06%, 34.12%)","blue-a100":"hsl(217, 100.0%, 75.49%)","blue-a200":"hsl(217, 100.0%, 63.33%)","blue-a400":"hsl(217, 100.0%, 58.04%)","blue-a700":"hsl(224, 100.0%, 58.04%)","light-blue-50":"hsl(198, 93.55%, 93.92%)","light-blue-100":"hsl(198, 92.41%, 84.51%)","light-blue-200":"hsl(198, 92.37%, 74.31%)","light-blue-300":"hsl(198, 91.3%, 63.92%)","light-blue-400":"hsl(198, 91.93%, 56.27%)","light-blue-500":"hsl(198, 97.57%, 48.43%)","light-blue-600":"hsl(199, 97.41%, 45.49%)","light-blue-700":"hsl(201, 98.1%, 41.37%)","light-blue-800":"hsl(202, 97.91%, 37.45%)","light-blue-900":"hsl(206, 98.72%, 30.59%)","light-blue-a100":"hsl(198, 100.0%, 75.1%)","light-blue-a200":"hsl(198, 100.0%, 62.55%)","light-blue-a400":"hsl(198, 100.0%, 50.0%)","light-blue-a700":"hsl(202, 100.0%, 45.88%)","cyan-50":"hsl(186, 72.22%, 92.94%)","cyan-100":"hsl(186, 71.11%, 82.35%)","cyan-200":"hsl(186, 71.62%, 70.98%)","cyan-300":"hsl(186, 71.15%, 59.22%)","cyan-400":"hsl(186, 70.87%, 50.2%)","cyan-500":"hsl(186, 100.0%, 41.57%)","cyan-600":"hsl(186, 100.0%, 37.84%)","cyan-700":"hsl(185, 100.0%, 32.75%)","cyan-800":"hsl(185, 100.0%, 28.04%)","cyan-900":"hsl(182, 100.0%, 19.61%)","cyan-a100":"hsl(180, 100.0%, 75.88%)","cyan-a200":"hsl(180, 100.0%, 54.71%)","cyan-a400":"hsl(186, 100.0%, 50.0%)","cyan-a700":"hsl(187, 100.0%, 41.57%)","teal-50":"hsl(176, 40.91%, 91.37%)","teal-100":"hsl(174, 41.28%, 78.63%)","teal-200":"hsl(174, 41.9%, 64.9%)","teal-300":"hsl(174, 41.83%, 50.78%)","teal-400":"hsl(174, 62.75%, 40.0%)","teal-500":"hsl(174, 100.0%, 29.41%)","teal-600":"hsl(173, 100.0%, 26.86%)","teal-700":"hsl(173, 100.0%, 23.73%)","teal-800":"hsl(172, 100.0%, 20.59%)","teal-900":"hsl(169, 100.0%, 15.1%)","teal-a100":"hsl(166, 100.0%, 82.75%)","teal-a200":"hsl(165, 100.0%, 69.61%)","teal-a400":"hsl(165, 82.26%, 51.37%)","teal-a700":"hsl(171, 100.0%, 37.45%)","green-50":"hsl(124, 39.39%, 93.53%)","green-100":"hsl(121, 37.5%, 84.31%)","green-200":"hsl(122, 37.4%, 74.31%)","green-300":"hsl(122, 38.46%, 64.31%)","green-400":"hsl(122, 38.46%, 56.67%)","green-500":"hsl(122, 39.44%, 49.22%)","green-600":"hsl(122, 40.97%, 44.51%)","green-700":"hsl(122, 43.43%, 38.82%)","green-800":"hsl(123, 46.2%, 33.53%)","green-900":"hsl(124, 55.37%, 23.73%)","green-a100":"hsl(136, 77.22%, 84.51%)","green-a200":"hsl(150, 81.82%, 67.65%)","green-a400":"hsl(150, 100.0%, 45.1%)","green-a700":"hsl(144, 100.0%, 39.22%)","light-green-50":"hsl(88, 51.72%, 94.31%)","light-green-100":"hsl(87, 50.68%, 85.69%)","light-green-200":"hsl(88, 50.0%, 76.47%)","light-green-300":"hsl(87, 50.0%, 67.06%)","light-green-400":"hsl(87, 50.24%, 59.8%)","light-green-500":"hsl(87, 50.21%, 52.75%)","light-green-600":"hsl(89, 46.12%, 48.04%)","light-green-700":"hsl(92, 47.91%, 42.16%)","light-green-800":"hsl(95, 49.46%, 36.47%)","light-green-900":"hsl(103, 55.56%, 26.47%)","light-green-a100":"hsl(87, 100.0%, 78.24%)","light-green-a200":"hsl(87, 100.0%, 67.45%)","light-green-a400":"hsl(92, 100.0%, 50.59%)","light-green-a700":"hsl(96, 81.15%, 47.84%)","lime-50":"hsl(65, 71.43%, 94.51%)","lime-100":"hsl(64, 69.01%, 86.08%)","lime-200":"hsl(65, 70.69%, 77.25%)","lime-300":"hsl(65, 70.37%, 68.24%)","lime-400":"hsl(65, 69.7%, 61.18%)","lime-500":"hsl(65, 69.96%, 54.31%)","lime-600":"hsl(63, 59.68%, 49.61%)","lime-700":"hsl(62, 61.43%, 43.73%)","lime-800":"hsl(59, 62.89%, 38.04%)","lime-900":"hsl(53, 69.93%, 30.0%)","lime-a100":"hsl(65, 100.0%, 75.29%)","lime-a200":"hsl(65, 100.0%, 62.75%)","lime-a400":"hsl(73, 100.0%, 50.0%)","lime-a700":"hsl(75, 100.0%, 45.88%)","yellow-50":"hsl(55, 100.0%, 95.29%)","yellow-100":"hsl(53, 100.0%, 88.43%)","yellow-200":"hsl(53, 100.0%, 80.78%)","yellow-300":"hsl(53, 100.0%, 73.14%)","yellow-400":"hsl(53, 100.0%, 67.25%)","yellow-500":"hsl(53, 100.0%, 61.57%)","yellow-600":"hsl(48, 98.04%, 60.0%)","yellow-700":"hsl(42, 96.26%, 58.04%)","yellow-800":"hsl(37, 94.64%, 56.08%)","yellow-900":"hsl(28, 91.74%, 52.55%)","yellow-a100":"hsl(60, 100.0%, 77.65%)","yellow-a200":"hsl(60, 100.0%, 50.0%)","yellow-a400":"hsl(55, 100.0%, 50.0%)","yellow-a700":"hsl(50, 100.0%, 50.0%)","amber-50":"hsl(46, 100.0%, 94.12%)","amber-100":"hsl(45, 100.0%, 85.1%)","amber-200":"hsl(45, 100.0%, 75.49%)","amber-300":"hsl(45, 100.0%, 65.49%)","amber-400":"hsl(45, 100.0%, 57.84%)","amber-500":"hsl(45, 100.0%, 51.37%)","amber-600":"hsl(42, 100.0%, 50.0%)","amber-700":"hsl(37, 100.0%, 50.0%)","amber-800":"hsl(33, 100.0%, 50.0%)","amber-900":"hsl(26, 100.0%, 50.0%)","amber-a100":"hsl(47, 100.0%, 74.9%)","amber-a200":"hsl(47, 100.0%, 62.55%)","amber-a400":"hsl(46, 100.0%, 50.0%)","amber-a700":"hsl(40, 100.0%, 50.0%)","orange-50":"hsl(36, 100.0%, 93.92%)","orange-100":"hsl(35, 100.0%, 84.9%)","orange-200":"hsl(35, 100.0%, 75.1%)","orange-300":"hsl(35, 100.0%, 65.1%)","orange-400":"hsl(35, 100.0%, 57.45%)","orange-500":"hsl(35, 100.0%, 50.0%)","orange-600":"hsl(33, 100.0%, 49.22%)","orange-700":"hsl(30, 100.0%, 48.04%)","orange-800":"hsl(27, 100.0%, 46.86%)","orange-900":"hsl(21, 100.0%, 45.1%)","orange-a100":"hsl(38, 100.0%, 75.1%)","orange-a200":"hsl(33, 100.0%, 62.55%)","orange-a400":"hsl(34, 100.0%, 50.0%)","orange-a700":"hsl(25, 100.0%, 50.0%)","deep-orange-50":"hsl(5, 71.43%, 94.51%)","deep-orange-100":"hsl(14, 100.0%, 86.86%)","deep-orange-200":"hsl(14, 100.0%, 78.43%)","deep-orange-300":"hsl(14, 100.0%, 69.8%)","deep-orange-400":"hsl(14, 100.0%, 63.14%)","deep-orange-500":"hsl(14, 100.0%, 56.67%)","deep-orange-600":"hsl(14, 90.68%, 53.73%)","deep-orange-700":"hsl(14, 80.39%, 50.0%)","deep-orange-800":"hsl(14, 82.28%, 46.47%)","deep-orange-900":"hsl(14, 88.18%, 39.8%)","deep-orange-a100":"hsl(14, 100.0%, 75.1%)","deep-orange-a200":"hsl(14, 100.0%, 62.55%)","deep-orange-a400":"hsl(14, 100.0%, 50.0%)","deep-orange-a700":"hsl(11, 100.0%, 43.33%)","brown-50":"hsl(19, 15.79%, 92.55%)","brown-100":"hsl(16, 15.79%, 81.37%)","brown-200":"hsl(14, 15.19%, 69.02%)","brown-300":"hsl(15, 15.32%, 56.47%)","brown-400":"hsl(15, 17.5%, 47.06%)","brown-500":"hsl(15, 25.39%, 37.84%)","brown-600":"hsl(15, 25.29%, 34.12%)","brown-700":"hsl(14, 25.68%, 29.02%)","brown-800":"hsl(11, 25.81%, 24.31%)","brown-900":"hsl(8, 27.84%, 19.02%)","gray-50":"hsl(0, 0.0%, 98.04%)","gray-100":"hsl(0, 0.0%, 96.08%)","gray-200":"hsl(0, 0.0%, 93.33%)","gray-300":"hsl(0, 0.0%, 87.84%)","gray-400":"hsl(0, 0.0%, 74.12%)","gray-500":"hsl(0, 0.0%, 61.96%)","gray-600":"hsl(0, 0.0%, 45.88%)","gray-700":"hsl(0, 0.0%, 38.04%)","gray-800":"hsl(0, 0.0%, 25.88%)","gray-900":"hsl(0, 0.0%, 12.94%)","blue-gray-50":"hsl(204, 15.15%, 93.53%)","blue-gray-100":"hsl(198, 15.66%, 83.73%)","blue-gray-200":"hsl(199, 15.33%, 73.14%)","blue-gray-300":"hsl(199, 15.63%, 62.35%)","blue-gray-400":"hsl(200, 15.38%, 54.12%)","blue-gray-500":"hsl(199, 18.3%, 46.08%)","blue-gray-600":"hsl(198, 18.45%, 40.39%)","blue-gray-700":"hsl(199, 18.34%, 33.14%)","blue-gray-800":"hsl(199, 17.91%, 26.27%)","blue-gray-900":"hsl(199, 19.15%, 18.43%)","blue-gray-1000":"hsl(199, 20.93%, 8.43%)"},Nt={colors:Rm,layout:xi,time:Om,debug:!0,gridColorLight:"hsl(0, 0%, 100%)",gridColorDark:"hsl(0, 0%, 30%)"},va=35,xa="-";let mn=null,yn=null;function Fm(t,e,n,i,r){const o=B.transition("label-addition").duration(300).ease(B.easeCubicInOut),s=B.transition("label-removal").duration(100).ease(B.easeLinear),a=c=>{const h=c.append("g").attr("class",`label-group zoom-${i}`).classed("hidden",p=>p.toHide);this.lastLabelNames.size>0&&h.style("opacity",0).transition(o).style("opacity",1);const d=h.append("text").attr("class",p=>`topic-label ${p.direction}`).attr("transform",p=>`translate(${p.labelX}, ${p.labelY})`).style("font-size",`${r}px`).text(p=>p.lines.length>1?null:p.lines[0]).attr("paint-order","stroke").style("stroke","#fff").style("stroke-width",3.2/this.curZoomTransform.k);return d.append("tspan").attr("class","line-1").attr("x",0).attr("y",0).text(p=>p.lines.length>1?p.lines[0]:""),d.append("tspan").attr("class","line-2").attr("x",0).attr("y",0).attr("dy",.96*r).text(p=>p.lines.length>1?p.lines[1]:""),h.append("rect").attr("class","topic-tile").attr("x",p=>this.xScale(p.tileX)).attr("y",p=>this.yScale(p.tileY)).attr("rx",4/this.curZoomTransform.k).attr("ry",4/this.curZoomTransform.k).attr("width",n).attr("height",n).style("stroke-width",1.6/this.curZoomTransform.k),h.append("path").attr("class","direction-indicator").attr("transform-origin","center").each((p,b,m)=>this.addTileIndicatorPath(p,b,m,n)),h},l=c=>{const h=c.each((d,p,b)=>{const m=B.select(b[p]),g=m.classed("hidden");!g&&d.toHide&&this.contoursInitialized?m.style("opacity",1).transition(s).style("opacity",0).on("end",()=>{m.classed("hidden",d.toHide)}):g&&!d.toHide&&this.contoursInitialized?m.style("opacity",0).classed("hidden",d.toHide).transition(s).style("opacity",1):m.classed("hidden",d.toHide)});return h.select("text").style("stroke-width",3.2/this.curZoomTransform.k).style("font-size",`${r}px`).each((d,p,b)=>{const m=B.select(b[p]),g=m.attr("class"),x=`topic-label ${d.direction}`;m.attr("class",x).select(".line-2").attr("dy",.96*r),x!==g?m.transition("update").duration(300).ease(B.easeCubicInOut).attr("transform",`translate(${d.labelX}, ${d.labelY})`):m.attr("transform",`translate(${d.labelX}, ${d.labelY})`)}),h.select("rect.topic-tile").attr("x",d=>this.xScale(d.tileX)).attr("y",d=>this.yScale(d.tileY)).attr("rx",4/this.curZoomTransform.k).attr("ry",4/this.curZoomTransform.k).attr("width",n).attr("height",n).style("stroke-width",1.6/this.curZoomTransform.k),h.select("path.direction-indicator").each((d,p,b)=>this.addTileIndicatorPath(d,p,b,n)),c},u=c=>this.lastLabelNames.size>0&&this.contoursInitialized?(c.transition(s).style("opacity",0).on("end",()=>{c.remove()}),c):c.remove();return t.selectAll("g.label-group").data(e,c=>c.name).join(c=>a(c),c=>l(c),c=>u(c))}function Ym(t=null){if(!this.showGrid)return;const e=this.getIdealTopicTreeLevel();if(e!==null){if(this.lastGridTreeLevels.length>0){const n=this.lastGridTreeLevels[this.lastGridTreeLevels.length-1];e!==n&&(this.topicCanvases[n%2].classed("faded",!0).on("transitionend",()=>{this.lastGridTreeLevels[0]===n&&this.lastGridTreeLevels.shift()}),this.topicCanvases[e%2].classed("faded",!1),this.lastGridTreeLevels.push(e),this.lastGridTreeLevels.length>2&&this.lastGridTreeLevels.shift())}this.lastGridTreeLevels.length===0&&this.lastGridTreeLevels.push(e);for(const n of this.lastGridTreeLevels){const r=this.topicCanvases[n%2].node().getContext("2d");if(r===null)return;const o=this.topicLevelTrees.get(n),s=o.extent(),a=(s[1][0]-s[0][0])/Math.pow(2,n),l=Math.abs(this.xScale(a)-this.xScale(0)),u=this.getCurZoomBox(),f=o.data().map(c=>({x:this.xScale(c[0]-a/2),y:this.yScale(c[1]-a/2),width:l,height:l,name:`${c[0],c[1]}`,label:c[2]})).filter(c=>ve(c,u));r.save(),t?r.strokeStyle=t:this.showContour?r.strokeStyle=Nt.gridColorLight:r.strokeStyle=Nt.gridColorDark,r.lineWidth=1/(4*this.curZoomTransform.k);for(const c of f)r.moveTo(c.x,c.y),$m(r,c.x,c.y,c.width,c.height,4/this.curZoomTransform.k),r.stroke();r.restore()}}}function Vm(t,e,n,i){const o=(t-(e||t))/n;if(o>1)return;const s=i(o);this.redrawTopicGrid(s),requestAnimationFrame(a=>{this.drawTopicGridFrame(a,e||t,n,i)})}function $m(t,e,n,i,r,o){const s={tl:0,tr:0,br:0,bl:0};typeof o=="number"?(s.tl=o,s.tr=o,s.br=o,s.bl=o):(s.tl=o[0],s.tr=o[1],s.br=o[2],s.bl=o[3]),t.beginPath(),t.moveTo(e+s.tl,n),t.lineTo(e+i-s.tr,n),t.quadraticCurveTo(e+i,n,e+i,n+s.tr),t.lineTo(e+i,n+r-s.br),t.quadraticCurveTo(e+i,n+r,e+i-s.br,n+r),t.lineTo(e+s.bl,n+r),t.quadraticCurveTo(e,n+r,e,n+r-s.bl),t.lineTo(e,n+s.tl),t.quadraticCurveTo(e,n,e+s.tl,n),t.closePath()}function Um(t=null){if(this.topicLevelTrees.size<=1||this.contours===null||!this.showLabel)return;const e=this.topSvg.select("g.top-content g.topics"),n=[];for(let _=this.contours.length-1;_>=0;_--){const V=this.contours[_];for(const L of V.coordinates){const C=[],I=[];for(const A of L[0])C.push(A[0]),I.push(A[1]);const E=C.reduce((A,k)=>A+k)/C.length,v=I.reduce((A,k)=>A+k)/I.length;n.push([E,v,V.value])}}const i=this.getCurZoomBox(),r=this.getIdealTopicTreeLevel(),o=this.topicLevelTrees.get(r),s=o.extent(),a=(s[1][0]-s[0][0])/Math.pow(2,r),l=Math.abs(this.xScale(a)-this.xScale(0)),u=B.transition("removal").duration(400).ease(B.easeCubicInOut),f=e.selectAll("g.topics-content").data([r],_=>_).join(_=>{const V=_.append("g").attr("class",L=>`topics-content zoom-${L}`).style("opacity",0);return V.transition(u).style("opacity",1),_.empty()||(this.lastLabelNames=new Map),V},_=>_,_=>this.lastLabelTreeLevel!==r?_.transition(u).style("opacity",0).on("end",()=>{_.remove()}):_);this.lastLabelTreeLevel=r;const c=new Map,h=new Map;for(const _ of n){const V=this.xScale.invert(_[0]),L=this.yScale.invert(_[1]),C=a*.5,I=Hm(o,V-C,L-C,V+C,L+C);for(const E of I){const v={tileX:E[0]-a/2,tileY:E[1]+a/2,tileCenterX:E[0],tileCenterY:E[1],pointX:V,pointY:L,name:E[2]};h.has(v.name)?h.set(v.name,h.get(v.name)+_[2]):(h.set(v.name,_[2]),c.set(v.name,v))}}const d=[...h].sort((_,V)=>V[1]-_[1]).map(_=>c.get(_[0])),p=[],b=[],m=14/this.curZoomTransform.k,g=m*1.1,x=6.4/this.curZoomTransform.k,w=6.4/this.curZoomTransform.k;let y=0,M=0;for(const _ of d){const V=_.name.length>12;let L=_.name.slice(0,Math.floor(_.name.length/2)),C=_.name.slice(Math.floor(_.name.length/2));if(V&&_.name.split(xa).length>=4){const F=_.name.split(xa);L=F.slice(0,2).join("-")+"-",C=F.slice(2).join("-")}const I=V?Math.max(Ft(L,m),Ft(C,m)):Ft(_.name,m),E=V?g*1.8:g;let v=!0,A=null,k=null;const S=[rt.left,rt.right,rt.bottom,rt.top];_.tileCenterX>=(s[0][0]+s[1][0])/2&&(S[0]=rt.right,S[1]=rt.left);let $=null,O=!1;const T={x:this.xScale(_.tileX),y:this.yScale(_.tileY),width:l,height:l};for(const F of p){if(ve(T,F)){O=!0;break}const U=Math.abs(F.tileX-_.tileX),ot=Math.abs(F.tileY-_.tileY);U+ot<=a&&($=F.direction)}if(!O){switch($){case rt.left:{S.splice(S.indexOf(rt.right),1),S.unshift(rt.right);break}case rt.right:{S.splice(S.indexOf(rt.left),1),S.unshift(rt.left);break}case rt.top:{S.splice(S.indexOf(rt.bottom),1),S.unshift(rt.bottom);break}case rt.bottom:{S.splice(S.indexOf(rt.top),1),S.unshift(rt.top);break}}for(const F of d)if(F.tileY===_.tileY){const U=F.tileX-_.tileX;U===a?(S.splice(S.indexOf(rt.left),1),S.unshift(rt.left)):U===-a&&(S.splice(S.indexOf(rt.right),1),S.unshift(rt.right))}if(this.lastLabelNames.has(_.name)){const F=this.lastLabelNames.get(_.name);S.splice(S.indexOf(F),1),S.unshift(F)}for(const F of S){v=!0;const U={x:0,y:0,width:I,height:E};switch(F){case rt.top:U.x=this.xScale(_.tileCenterX)-I/2,U.y=this.yScale(_.tileCenterY)-l/2-E-x;break;case rt.bottom:U.x=this.xScale(_.tileCenterX)-I/2,U.y=this.yScale(_.tileCenterY)+l/2+x;break;case rt.left:U.x=this.xScale(_.tileCenterX)-l/2-I-w,U.y=this.yScale(_.tileCenterY)-E/2;break;case rt.right:U.x=this.xScale(_.tileCenterX)+l/2+w,U.y=this.yScale(_.tileCenterY)-E/2;break;default:console.error("Unknown direction value.");break}for(const ot of p)if(ve(U,ot)){v=!1;break}for(const ot of b)if(ve(U,ot)){v=!1;break}if(v){A=U,k=F;break}}if(v&&A&&k){const F={x:A.x,y:A.y,width:A.width,height:A.height,direction:k,pointX:_.pointX,pointY:_.pointY,tileX:_.tileX,tileY:_.tileY,toHide:!1,name:_.name,lines:V?[L,C]:[_.name],labelX:this.xScale(_.tileCenterX),labelY:this.yScale(_.tileCenterY)},U={x:this.xScale(_.tileX),y:this.yScale(_.tileY),width:l,height:l};switch(F.toHide=!ve(A,i)&&!ve(U,i),F.toHide||(M+=1,t!==null&&(y>=t&&(!this.contoursInitialized||!this.lastLabelNames.has(_.name))?F.toHide=!0:y+=1)),k){case rt.top:{F.labelY-=x+l/2+(V?g:0);break}case rt.bottom:{F.labelY+=x+l/2;break}case rt.left:{F.labelX-=w+l/2,F.labelY-=V?g:0;break}case rt.right:{F.labelX+=w+l/2,F.labelY-=V?g:0;break}default:{console.error("Unknown layout value.");break}}p.push(F),b.push(U)}}}this.drawLabels(f,p,l,r,m),this.lastLabelNames=new Map,p.filter(_=>!_.toHide).forEach(_=>this.lastLabelNames.set(_.name,_.direction)),this.maxLabelNum=M,this.curLabelNum=y;const W=this.component.querySelector("input#slider-label-num");W.max=`${this.maxLabelNum}`,W.value=`${this.curLabelNum}`;const R=this.component.querySelector("span.slider-count");R.innerText=`${this.curLabelNum}`}function Gm(){if(this.topicLevelTrees.size<1)return null;let t=-1,e=1/0;for(const n of this.topicLevelTrees.keys()){const i=this.topicLevelTrees.get(n).extent(),r=i[1][0]-i[0][0],o=Math.pow(2,n),s=r/o,a=Math.max(this.xScale(s)-this.xScale(0),this.yScale(s)-this.yScale(0))*this.curZoomTransform.k;Math.abs(a-va){yn!==null&&(clearTimeout(yn),yn=null),yn=setTimeout(()=>{i.classed("faded",!1),s.interrupt("top-fade").remove(),o.remove(),this.tooltipStoreValue.show=!1,this.tooltipStore.set(this.tooltipStoreValue),yn=null},50)};if(t===null||e===null){l();return}const u=this.xScale.invert(this.curZoomTransform.invertX(t)),f=this.yScale.invert(this.curZoomTransform.invertY(e)),c=this.getIdealTopicTreeLevel(),h=this.topicLevelTrees.get(c),d=h.extent(),p=(d[1][0]-d[0][0])/Math.pow(2,c),b=Math.abs(this.xScale(p)-this.xScale(0)),m=Math.sqrt(2)*p,g=h.find(u,f,m);if(g===void 0){o.empty()||l();return}if(o.empty()){const x=n.append("rect").attr("class","highlight-tile").attr("x",this.xScale(g[0])-b/2).attr("y",this.yScale(g[1])-b/2).attr("width",b).attr("height",b).attr("rx",4/this.curZoomTransform.k).attr("ry",4/this.curZoomTransform.k).style("stroke-width",2.6/this.curZoomTransform.k).style("stroke",this.showContour?Nt.gridColorLight:Nt.gridColorDark),w=x.node().getBoundingClientRect(),y=w.width,M=w.x+y/2,W=w.y;this.tooltipStoreValue.html=` -
- ${g[2]} -
- `,this.tooltipStoreValue.x=M,this.tooltipStoreValue.y=W,this.tooltipStoreValue.show=!0;const R=x.clone(!0).style("stroke",null).remove().node(),_=B.select(r.node().appendChild(R));mn=g[2],_.style("opacity",0).transition("top-fade").duration(a).ease(B.easeCubicInOut).on("end",()=>{_.style("opacity",1),i.classed("faded",!0),this.tooltipStore.set(this.tooltipStoreValue),mn=null})}else{o.attr("x",this.xScale(g[0])-b/2).attr("y",this.yScale(g[1])-b/2).attr("width",b).attr("height",b).attr("rx",4/this.curZoomTransform.k).attr("ry",4/this.curZoomTransform.k).style("stroke-width",2.6/this.curZoomTransform.k),s.attr("x",this.xScale(g[0])-b/2).attr("y",this.yScale(g[1])-b/2).attr("width",b).attr("height",b).attr("rx",4/this.curZoomTransform.k).attr("ry",4/this.curZoomTransform.k).style("stroke-width",2.6/this.curZoomTransform.k);const x=o.node().getBoundingClientRect(),w=x.width,y=x.x+w/2,M=x.y;this.tooltipStoreValue.html=` -
- ${g[2]} -
- `,this.tooltipStoreValue.x=y,this.tooltipStoreValue.y=M,this.tooltipStoreValue.show=!0,mn===null?this.tooltipStore.set(this.tooltipStoreValue):(mn=g[2],s.interrupt("top-fade").style("opacity",0).transition("top-fade").duration(a).ease(B.easeCubicInOut).on("end",()=>{s.style("opacity",1),i.classed("faded",!0),this.tooltipStore.set(this.tooltipStoreValue),mn=null}))}}function Bm(t=null){const e=this.topicCanvases.map(n=>n.node().getContext("2d"));for(const n of e)n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,this.svgFullSize.width,this.svgFullSize.height),n.translate(this.curZoomTransform.x,this.curZoomTransform.y),n.scale(this.curZoomTransform.k,this.curZoomTransform.k);this.drawTopicGrid(t)}const Hm=(t,e,n,i,r)=>{const o=[];return t.visit((s,a,l,u,f)=>{if(!s.length){let c=s;do{const h=c.data;h[0]>=e&&h[0]=n&&h[1]=i||l>=r||u=256*256*256)return console.error("Unique color overflow."),"#fffff";const t=B.randomInt(0,256);let e=ao(t(),t(),t());for(;this.colorPointMap.has(e)||e==="#000000";)e=ao(t(),t(),t());return e}function Qm(){if(!this.showPoint)return;const t=yu*this.initZoomTransform.k/Math.sqrt(this.curZoomTransform.k);this.pointCtx.globalAlpha=.5;for(const e of this.promptPoints){const n=this.xScale(e.x),i=this.yScale(e.y);this.pointCtx.beginPath(),this.pointCtx.arc(n,i,t,0,wu);const r=Nt.colors["gray-900"];this.pointCtx.fillStyle=r,this.pointCtx.fill()}}function Jm(){if(!this.showPoint)return;this.colorPointMap.clear();const t=jm*this.initZoomTransform.k,e=Math.max(t,3.5*t-this.curZoomTransform.k);for(const n of this.promptPoints){this.pointBackCtx.beginPath();const i=this.xScale(n.x),r=this.yScale(n.y);this.pointBackCtx.arc(i,r,e,0,wu);const o=this.getNextUniqueColor();this.colorPointMap.set(o,n),this.pointBackCtx.fillStyle=o,this.pointBackCtx.fill()}}function t2(t){if(this.hoverMode!=="point"||!this.showPoint||t===this.hoverPoint)return;const e=this.topSvg.select("g.top-content g.highlights"),n=e.select("circle.highlight-point");if(t===void 0){n.empty()||(le!==null&&(clearTimeout(le),le=null),le=setTimeout(()=>{this.hoverPoint=null,n.remove(),this.tooltipStoreValue.show=!1,this.tooltipStore.set(this.tooltipStoreValue),le=null},50));return}this.hoverPoint=t,le!==null&&(clearTimeout(le),le=null);const i=Math.max(yu*1.5,7/this.curZoomTransform.k),r=1.2/this.curZoomTransform.k;if(n.empty()){const s=e.append("circle").attr("class","highlight-point").attr("cx",this.xScale(t.x)).attr("cy",this.yScale(t.y)).attr("r",i).style("stroke-width",r).node().getBoundingClientRect(),a=s.width,l=s.x+a/2,u=s.y;this.tooltipStoreValue.html=` -
- ${t.prompt} -
- `,this.tooltipStoreValue.x=l,this.tooltipStoreValue.y=u,this.tooltipStoreValue.show=!0,re!==null&&(clearTimeout(re),re=null),re=setTimeout(()=>{this.tooltipStore.set(this.tooltipStoreValue),re=null},300)}else{n.attr("cx",this.xScale(t.x)).attr("cy",this.yScale(t.y)).attr("r",i).style("stroke-width",r);const o=n.node().getBoundingClientRect(),s=o.width,a=o.x+s/2,l=o.y;this.tooltipStoreValue.html=` -
- ${t.prompt} -
- `,this.tooltipStoreValue.x=a,this.tooltipStoreValue.y=l,this.tooltipStoreValue.show=!0,re!==null?(clearTimeout(re),re=setTimeout(()=>{this.tooltipStore.set(this.tooltipStoreValue),re=null},300)):this.tooltipStore.set(this.tooltipStoreValue)}}function e2(){this.pointCtx.save(),this.pointCtx.setTransform(1,0,0,1,0,0),this.pointCtx.clearRect(0,0,this.svgFullSize.width,this.svgFullSize.height),this.pointCtx.translate(this.curZoomTransform.x,this.curZoomTransform.y),this.pointCtx.scale(this.curZoomTransform.k,this.curZoomTransform.k),this.drawScatterCanvas(),this.pointCtx.restore()}function n2(){this.pointBackCtx.save(),this.pointBackCtx.setTransform(1,0,0,1,0,0),this.pointBackCtx.clearRect(0,0,this.svgFullSize.width,this.svgFullSize.height),this.pointBackCtx.translate(this.curZoomTransform.x,this.curZoomTransform.y),this.pointBackCtx.scale(this.curZoomTransform.k,this.curZoomTransform.k),this.drawScatterBackCanvas(),this.pointBackCtx.restore()}const De=[];function i2(t,e=Lt){let n;const i=new Set;function r(a){if(rn(t,a)&&(t=a,n)){const l=!De.length;for(const u of i)u[1](),De.push(u,t);if(l){for(let u=0;u{i.delete(u),i.size===0&&(n(),n=null)}}return{set:r,update:o,subscribe:s}}const Le=()=>({show:!1,html:"null",x:0,y:0,width:0,maxWidth:300,fontSize:14,orientation:"s",mouseoverTimeout:null}),ba=()=>i2(Le()),_a=Nt.debug,r2=300;let ka="/diffusiondb/explorer/data";class Ma{constructor({component:e,tooltipStore:n,updateEmbedding:i,defaultSetting:r,embeddingName:o}){D(this,"svg");D(this,"svgFullSize");D(this,"svgSize");D(this,"svgPadding");D(this,"topSvg");D(this,"pointCanvas");D(this,"topicCanvases");D(this,"pointCtx");D(this,"pointBackCanvas");D(this,"pointBackCtx");D(this,"colorPointMap",new Map);D(this,"hoverPoint",null);D(this,"xScale");D(this,"yScale");D(this,"component");D(this,"updateEmbedding");D(this,"embeddingName");D(this,"pointURL");D(this,"gridURL");D(this,"zoom",null);D(this,"initZoomTransform",B.zoomIdentity);D(this,"curZoomTransform",B.zoomIdentity);D(this,"curZoomLevel",1);D(this,"lastMouseClientPosition",null);D(this,"hoverMode","label");D(this,"showContour");D(this,"showGrid");D(this,"showPoint");D(this,"showLabel");D(this,"promptPoints",[]);D(this,"gridData",null);D(this,"tileData",null);D(this,"contours",null);D(this,"contoursInitialized",!1);D(this,"lastRefillID",0);D(this,"lsatRefillTime",0);D(this,"topicLevelTrees",new Map);D(this,"maxLabelNum",0);D(this,"curLabelNum",0);D(this,"userMaxLabelNum",20);D(this,"lastLabelNames",new Map);D(this,"lastLabelTreeLevel",null);D(this,"lastGridTreeLevels",[]);D(this,"tooltipStore");D(this,"tooltipStoreValue",Le());D(this,"embeddingWorker");D(this,"drawLabels",Fm);D(this,"layoutTopicLabels",Um);D(this,"addTileIndicatorPath",Zm);D(this,"getIdealTopicTreeLevel",Gm);D(this,"labelNumSliderChanged",qm);D(this,"mouseoverLabel",Xm);D(this,"drawTopicGrid",Ym);D(this,"redrawTopicGrid",Bm);D(this,"drawTopicGridFrame",Vm);D(this,"drawScatterCanvas",Qm);D(this,"drawScatterBackCanvas",Jm);D(this,"getNextUniqueColor",Km);D(this,"highlightPoint",t2);D(this,"redrawFrontPoints",e2);D(this,"redrawBackPoints",n2);D(this,"initStores",()=>{this.tooltipStore.subscribe(e=>{this.tooltipStoreValue=e})});D(this,"initTopSvg",()=>{const e=B.select(this.component).select(".top-svg").attr("width",this.svgFullSize.width).attr("height",this.svgFullSize.height).on("pointermove",r=>this.mousemoveHandler(r)).on("mouseleave",()=>{this.highlightPoint(void 0),this.mouseoverLabel(null,null)}),n=e.append("g").attr("class","top-group");n.append("rect").attr("class","mouse-track-rect").attr("width",this.svgFullSize.width).attr("height",this.svgFullSize.height);const i=n.append("g").attr("class","top-content");return i.append("g").attr("class","topics-bottom"),i.append("g").attr("class","topics").classed("hidden",!this.showLabel),i.append("g").attr("class","topics-top"),i.append("g").attr("class","highlights"),e});D(this,"initData",async()=>{const e=await B.json(this.gridURL);if(e===void 0)throw Error("Fail to load grid data.");this.gridData=e;const n=this.gridData.xRange,i=this.gridData.yRange;let r=n[1]-n[0],o=i[1]-i[0];this.gridData.padded||(r{if(l)for(const u of Object.keys(l.data)){const f=B.quadtree().x(c=>c[0]).y(c=>c[1]).addAll(l.data[u]);this.topicLevelTrees.set(parseInt(u),f)}else console.error("Fail to read topic data.")});Promise.all([a]).then(()=>{this.drawTopicGrid(),this.layoutTopicLabels(this.userMaxLabelNum),setTimeout(()=>{this.component.querySelector("input#slider-label-num").value=`${this.curLabelNum}`},500)})});D(this,"initSVGGroups",()=>{const e=this.svg.append("g").attr("class","umap-group").attr("transform",`translate(${this.svgPadding.left}, ${this.svgPadding.top})`);e.append("g").attr("class","contour-group").classed("hidden",!this.showContour),e.append("g").attr("class","quad-group"),e.append("g").attr("class","tile-group"),e.append("g").attr("class","scatter-group")});D(this,"drawQuadtree",()=>{const e=this.svg.select("g.quad-group"),n=B.quadtree().x(r=>r.x).y(r=>r.y).extent([[this.xScale.domain()[0],this.yScale.domain()[0]],[this.xScale.domain()[1],this.yScale.domain()[1]]]).addAll(this.promptPoints),i=[];n.visit((r,o,s,a,l)=>{if(r.length===void 0){const u={x0:o,x1:a,y0:s,y1:l};i.push(u)}}),e.selectAll(".quadtree-node").data(i).join("rect").attr("class","quadtree-node").attr("x",r=>this.xScale(r.x0)).attr("y",r=>this.yScale(r.y1)).attr("width",r=>this.yScale(r.y0)-this.yScale(r.y1)).attr("height",r=>this.xScale(r.x1)-this.xScale(r.x0)).style("fill","none").style("stroke","gray").style("stroke-width",.4).style("opacity",.9)});D(this,"drawContour",()=>{if(this.gridData==null)return console.error("Grid data not initialized"),null;const e=this.svg.select(".contour-group"),n=[];for(const x of this.gridData.grid)for(const w of x)n.push(w);const i=12,r=[],o=Math.min(...n),a=(Math.max(...n)-o)/i;for(let x=0;x(x.coordinates=x.coordinates.map(w=>w.map(y=>y.map(M=>[this.xScale(u(M[0])),this.yScale(f(M[1]))]))),x));const c=B.interpolateLab("#ffffff",Nt.colors["light-blue-800"]);let h=B.scaleSequential(B.extent(r),x=>c(x/1));if(this.embeddingName==="image"){const x=B.interpolateLab("#ffffff",Nt.colors["pink-900"]);h=B.scaleSequential(B.extent(r),w=>x(w/1))}e.selectAll("path").data(l).join("path").attr("fill",x=>h(x.value)).attr("d",B.geoPath());let d=1/0,p=1/0,b=-1/0,m=-1/0;if(l.length>1)for(const x of l[1].coordinates)for(const w of x)for(const y of w)y[0]b&&(b=y[0]),y[1]>m&&(m=y[1]);const g=Math.min(this.svgFullSize.width/(b-d),this.svgFullSize.height/(m-p));return this.initZoomTransform=B.zoomIdentity.translate(this.svgSize.width/2,this.svgSize.height/2).scale(g).translate(-d-(b-d)/2,-p-(m-p)/2),this.embeddingName==="image"&&(this.initZoomTransform=B.zoomIdentity.translate(this.svgSize.width/2,this.svgSize.height/2).scale(1.6).translate(-340,-376)),this.topSvg.transition().duration(300).call(x=>{var w;return(w=this.zoom)==null?void 0:w.transform(x,this.initZoomTransform)}).on("end",()=>{this.contoursInitialized=!0}),this.topSvg.on("dblclick",()=>{this.topSvg.transition().duration(700).call(x=>{var w;(w=this.zoom)==null||w.transform(x,this.initZoomTransform)})}),l});D(this,"zoomed",async e=>{const n=e.transform;if(this.curZoomTransform=n,this.svg.select(".umap-group").attr("transform",`${n.toString()}`),this.topSvg.select(".top-group").attr("transform",`${n.toString()}`),Date.now()-this.lsatRefillTime>r2){const i={command:"startRefillRegion",payload:{refillID:++this.lastRefillID,viewRange:this.getCurViewRanges()}};this.embeddingWorker.postMessage(i),this.lsatRefillTime=Date.now()}this.showPoint&&this.redrawFrontPoints(),this.showLabel&&this.layoutTopicLabels(this.userMaxLabelNum),this.showGrid&&this.redrawTopicGrid(),this.hoverMode==="label"&&this.lastMouseClientPosition&&this.mouseoverLabel(this.lastMouseClientPosition.x,this.lastMouseClientPosition.y),await Em(),this.showPoint&&this.redrawBackPoints()});D(this,"zoomEnded",()=>{const e={command:"startRefillRegion",payload:{refillID:++this.lastRefillID,viewRange:this.getCurViewRanges()}};this.embeddingWorker.postMessage(e)});D(this,"embeddingWorkerMessageHandler",e=>{switch(e.data.command){case"finishLoadData":{e.data.payload.isFirstBatch&&e.data.payload.points?(this.promptPoints=e.data.payload.points,this.redrawFrontPoints(),this.redrawBackPoints()):console.log("Finished loading all");break}case"finishRefillRegion":{e.data.payload.refillID===this.lastRefillID&&(this.promptPoints=e.data.payload.points,this.redrawFrontPoints(),this.redrawBackPoints());break}default:{console.error("Unknown message",e.data.command);break}}});D(this,"mousemoveHandler",e=>{const n=e.offsetX,i=e.offsetY;this.lastMouseClientPosition={x:n,y:i};const r=this.pointBackCtx.getImageData(n,i,1,1),o=ao(r.data[0],r.data[1],r.data[2]),s=this.colorPointMap.get(o);this.highlightPoint(s),this.mouseoverLabel(n,i)});D(this,"getCurZoomBox",()=>({x:this.curZoomTransform.invertX(0),y:this.curZoomTransform.invertY(0),width:Math.abs(this.curZoomTransform.invertX(this.svgFullSize.width)-this.curZoomTransform.invertX(0)),height:Math.abs(this.curZoomTransform.invertY(this.svgFullSize.height)-this.curZoomTransform.invertY(0))}));D(this,"getCurViewRanges",()=>{const e=this.getCurZoomBox(),n=this.xScale.invert(e.x),i=this.xScale.invert(e.x+e.width),r=this.yScale.invert(e.y+e.height),o=this.yScale.invert(e.y);return[n,i,r,o]});D(this,"hoverModeChanged",e=>{this.hoverMode=e});D(this,"displayCheckboxChanged",(e,n)=>{switch(e){case"contour":{if(this.showContour=n,this.svg.select("g.contour-group").classed("hidden",!this.showContour),this.showGrid){let i,r;this.showContour?(i=Nt.gridColorDark,r=Nt.gridColorLight):(i=Nt.gridColorLight,r=Nt.gridColorDark);const o=300,s=B.interpolateHsl(i,r);requestAnimationFrame(a=>{this.drawTopicGridFrame(a,null,o,s)})}break}case"point":{this.showPoint=n,this.pointCanvas.classed("hidden",!this.showPoint).classed("faded",this.showPoint&&this.showLabel),this.showPoint&&(this.redrawFrontPoints(),this.redrawBackPoints()),this.showGrid&&this.redrawTopicGrid();break}case"grid":{this.showGrid=n,this.topicCanvases.forEach(i=>i.classed("hidden",!this.showGrid)),this.showGrid&&this.redrawTopicGrid();break}case"label":{this.showLabel=n,this.topSvg.select("g.top-content g.topics").classed("hidden",!this.showLabel),this.pointCanvas.classed("faded",this.showPoint&&this.showLabel),this.showLabel&&this.layoutTopicLabels(this.userMaxLabelNum);break}default:{console.error("Unknown checkbox name",e);break}}});var a;this.component=e,this.tooltipStore=n,this.updateEmbedding=i,this.embeddingName=o,this.pointURL=ka+"/umap-1m.ndjson",this.gridURL="/diffusiondb/explorer/data/umap-1m-grid.json",o==="image"&&(this.pointURL=ka+"/umap-image-150k.ndjson",this.gridURL="/diffusiondb/explorer/data/umap-image-1m-grid.json"),this.hoverMode=r.hover,this.showContour=r.showContour,this.showGrid=r.showGrid,this.showPoint=r.showPoint,this.showLabel=r.showLabel,this.embeddingWorker=new Worker(new URL("/diffusiondb/explorer/assets/EmbeddingWorker.65f7e4d8.js",self.location),{type:"module"}),this.embeddingWorker.onmessage=l=>{this.embeddingWorkerMessageHandler(l)},this.svg=B.select(this.component).select(".embedding-svg"),this.svgFullSize={width:0,height:0};const s=(a=this.svg.node())==null?void 0:a.getBoundingClientRect();s!==void 0&&(this.svgFullSize.width=s.width,this.svgFullSize.height=s.height),this.svgPadding={top:5,bottom:5,left:5,right:5},this.svgSize={width:this.svgFullSize.width-this.svgPadding.left-this.svgPadding.right,height:this.svgFullSize.width-this.svgPadding.top-this.svgPadding.bottom},this.xScale=B.scaleLinear(),this.yScale=B.scaleLinear(),this.initSVGGroups(),this.topSvg=this.initTopSvg(),this.pointCanvas=B.select(this.component).select(".embedding-canvas").attr("width",this.svgFullSize.width).attr("height",this.svgFullSize.height),this.pointCtx=this.pointCanvas.node().getContext("2d"),this.topicCanvases=[];for(const l of["top","bottom"])this.topicCanvases.push(B.select(this.component).select(`.topic-grid-canvas.${l}`).attr("width",this.svgFullSize.width).attr("height",this.svgFullSize.height).classed("hidden",!this.showGrid));this.pointBackCanvas=B.select(this.component).select(".embedding-canvas-back").attr("width",this.svgFullSize.width).attr("height",this.svgFullSize.height),this.pointBackCtx=this.pointBackCanvas.node().getContext("2d",{willReadFrequently:!0}),this.pointBackCtx.imageSmoothingEnabled=!1,this.zoom=B.zoom().extent([[0,0],[this.svgSize.width,this.svgSize.height]]).scaleExtent([1,8]).on("zoom",l=>{(async()=>await this.zoomed(l))()}).on("end",()=>this.zoomEnded()),this.topSvg.call(this.zoom).on("dblclick.zoom",null),Ui("Init data",_a),this.initData().then(()=>{Ui("Init data",_a)}),this.initStores()}}const vu=` - - - - - - - - - - -`;const tt="src/components/embedding/Embedding.svelte";function lo(t){let e,n,i,r,o,s,a,l,u,f,c,h,d,p,b,m,g,x,w,y,M,W,R,_,V,L,C,I,E,v,A,k,S,$,O,T,F,U,ot,H,at,ut,K,Q,Y,X,et,z,nt,q,ct,ft,j,it,$t,zt,Jn,Go,de,ln,Zo,Kt,Qt,qo,Jt,Xo,te,Bo,ge,pe,Ki,Ho;const jo={c:function(){e=Z("div"),n=Z("div"),i=bi("svg"),r=J(),o=Z("canvas"),s=J(),a=Z("canvas"),l=J(),u=Z("canvas"),f=J(),c=Z("canvas"),h=J(),d=bi("svg"),p=J(),b=Z("div"),m=Z("div"),m.textContent="Setting",g=J(),x=Z("div"),w=J(),y=Z("div"),M=Z("div"),M.textContent="Display",W=J(),R=Z("div"),_=Z("input"),V=J(),L=Z("label"),L.textContent="Density Contour",C=J(),I=Z("div"),E=Z("input"),v=J(),A=Z("label"),A.textContent="Data Points",k=J(),S=Z("div"),$=Z("input"),O=J(),T=Z("label"),T.textContent="Label Grid",F=J(),U=Z("div"),ot=J(),H=Z("div"),at=Z("div"),at.textContent="Automatic Labeling",ut=J(),K=Z("div"),Q=Z("input"),Y=J(),X=Z("label"),X.textContent="High Density Region",et=J(),z=Z("div"),nt=Z("div"),q=Z("label"),q.textContent="Number of Labels",ct=J(),ft=Z("span"),ft.textContent="0",j=J(),it=Z("input"),zt=J(),Jn=Z("div"),Go=J(),de=Z("div"),ln=Z("div"),ln.textContent="Mouse Hover Mode",Zo=J(),Kt=Z("div"),Qt=Z("div"),Qt.textContent="Label",qo=J(),Jt=Z("div"),Jt.textContent="Point",Xo=J(),te=Z("div"),te.textContent="None",Bo=J(),ge=Z("div"),pe=Z("div"),P(i,"class","top-svg s-ovhWPbaoO3ET"),G(i,tt,422,4,8893),P(o,"class","embedding-canvas s-ovhWPbaoO3ET"),G(o,tt,423,4,8921),P(a,"class","embedding-canvas-back s-ovhWPbaoO3ET"),G(a,tt,424,4,8961),P(u,"class","topic-grid-canvas top s-ovhWPbaoO3ET"),G(u,tt,425,4,9006),P(c,"class","topic-grid-canvas bottom s-ovhWPbaoO3ET"),G(c,tt,426,4,9051),P(d,"class","embedding-svg s-ovhWPbaoO3ET"),G(d,tt,427,4,9099),P(n,"class","embedding s-ovhWPbaoO3ET"),G(n,tt,421,2,8865),P(m,"class","header s-ovhWPbaoO3ET"),G(m,tt,431,4,9199),P(x,"class","splitter s-ovhWPbaoO3ET"),G(x,tt,433,4,9238),P(M,"class","item-header s-ovhWPbaoO3ET"),G(M,tt,436,6,9301),P(_,"type","checkbox"),P(_,"class","checkbox s-ovhWPbaoO3ET"),P(_,"id","checkbox-contour"),P(_,"name","checkbox-contour"),G(_,tt,439,8,9381),P(L,"for","checkbox-contour"),P(L,"class","s-ovhWPbaoO3ET"),G(L,tt,447,8,9641),P(R,"class","control-row s-ovhWPbaoO3ET"),G(R,tt,438,6,9347),P(E,"type","checkbox"),P(E,"class","checkbox s-ovhWPbaoO3ET"),P(E,"id","checkbox-point"),P(E,"name","checkbox-point"),G(E,tt,451,8,9749),P(A,"for","checkbox-point"),P(A,"class","s-ovhWPbaoO3ET"),G(A,tt,459,8,10001),P(I,"class","control-row s-ovhWPbaoO3ET"),G(I,tt,450,6,9715),P($,"type","checkbox"),P($,"class","checkbox s-ovhWPbaoO3ET"),P($,"id","checkbox-grid"),P($,"name","checkbox-grid"),G($,tt,463,8,10103),P(T,"for","checkbox-grid"),P(T,"class","s-ovhWPbaoO3ET"),G(T,tt,471,8,10351),P(S,"class","control-row s-ovhWPbaoO3ET"),G(S,tt,462,6,10069),P(y,"class","control-item s-ovhWPbaoO3ET"),G(y,tt,435,4,9268),P(U,"class","splitter s-ovhWPbaoO3ET"),G(U,tt,475,4,10426),P(at,"class","item-header s-ovhWPbaoO3ET"),G(at,tt,478,6,10489),P(Q,"type","checkbox"),P(Q,"class","checkbox s-ovhWPbaoO3ET"),P(Q,"id","checkbox-label"),P(Q,"name","checkbox-label"),G(Q,tt,481,8,10580),P(X,"for","checkbox-label"),P(X,"class","s-ovhWPbaoO3ET"),G(X,tt,489,8,10832),P(K,"class","control-row s-ovhWPbaoO3ET"),G(K,tt,480,6,10546),P(H,"class","control-item s-ovhWPbaoO3ET"),G(H,tt,477,4,10456),P(q,"class","slider-label s-ovhWPbaoO3ET"),P(q,"for","slider-label-num"),G(q,tt,495,8,10996),P(ft,"class","slider-count s-ovhWPbaoO3ET"),G(ft,tt,498,8,11100),P(nt,"class","control-row s-ovhWPbaoO3ET"),G(nt,tt,494,6,10962),P(it,"type","range"),P(it,"class","slider s-ovhWPbaoO3ET"),P(it,"id","slider-label-num"),P(it,"name","label-num"),it.disabled=$t=!t[3].showLabel,P(it,"min","0"),P(it,"max","0"),G(it,tt,501,6,11156),P(z,"class","control-item slider-item s-ovhWPbaoO3ET"),G(z,tt,493,4,10917),P(Jn,"class","splitter s-ovhWPbaoO3ET"),G(Jn,tt,514,4,11456),P(ln,"class","item-header s-ovhWPbaoO3ET"),G(ln,tt,517,6,11519),P(Qt,"class","segmented-control-option s-ovhWPbaoO3ET"),lt(Qt,"selected",t[3].hover==="label"),G(Qt,tt,520,8,11614),P(Jt,"class","segmented-control-option s-ovhWPbaoO3ET"),lt(Jt,"selected",t[3].hover==="point"),G(Jt,tt,532,8,11934),P(te,"class","segmented-control-option s-ovhWPbaoO3ET"),lt(te,"selected",t[3].hover==="none"),G(te,tt,544,8,12254),P(Kt,"class","segmented-control s-ovhWPbaoO3ET"),G(Kt,tt,519,6,11574),P(de,"class","control-item s-ovhWPbaoO3ET"),G(de,tt,516,4,11486),P(b,"class","control-panel s-ovhWPbaoO3ET"),lt(b,"shown",t[2]),G(b,tt,430,2,9141),P(pe,"class","icon-wrapper svg-icon s-ovhWPbaoO3ET"),lt(pe,"activated",t[2]),G(pe,tt,569,4,12765),P(ge,"class","setting-icon s-ovhWPbaoO3ET"),G(ge,tt,560,2,12598),P(e,"class","embedding-wrapper s-ovhWPbaoO3ET"),G(e,tt,420,0,8809)},l:function(bt){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(bt,Pt){qe(bt,e,Pt),N(e,n),N(n,i),N(n,r),N(n,o),N(n,s),N(n,a),N(n,l),N(n,u),N(n,f),N(n,c),N(n,h),N(n,d),N(e,p),N(e,b),N(b,m),N(b,g),N(b,x),N(b,w),N(b,y),N(y,M),N(y,W),N(y,R),N(R,_),_.checked=t[3].showContour,N(R,V),N(R,L),N(y,C),N(y,I),N(I,E),E.checked=t[3].showPoint,N(I,v),N(I,A),N(y,k),N(y,S),N(S,$),$.checked=t[3].showGrid,N(S,O),N(S,T),N(b,F),N(b,U),N(b,ot),N(b,H),N(H,at),N(H,ut),N(H,K),N(K,Q),Q.checked=t[3].showLabel,N(K,Y),N(K,X),N(b,et),N(b,z),N(z,nt),N(nt,q),N(nt,ct),N(nt,ft),N(z,j),N(z,it),N(b,zt),N(b,Jn),N(b,Go),N(b,de),N(de,ln),N(de,Zo),N(de,Kt),N(Kt,Qt),N(Kt,qo),N(Kt,Jt),N(Kt,Xo),N(Kt,te),N(e,Bo),N(e,ge),N(ge,pe),pe.innerHTML=vu,t[27](e),Ki||(Ho=[dt(_,"change",t[10]),dt(_,"input",t[11],!1,!1,!1),dt(E,"change",t[12]),dt(E,"input",t[13],!1,!1,!1),dt($,"change",t[14]),dt($,"input",t[15],!1,!1,!1),dt(Q,"change",t[16]),dt(Q,"input",t[17],!1,!1,!1),dt(it,"input",t[18],!1,!1,!1),dt(Qt,"click",t[19],!1,!1,!1),dt(Qt,"keypress",t[20],!1,!1,!1),dt(Jt,"click",t[21],!1,!1,!1),dt(Jt,"keypress",t[22],!1,!1,!1),dt(te,"click",t[23],!1,!1,!1),dt(te,"keypress",t[24],!1,!1,!1),dt(ge,"click",t[25],!1,!1,!1),dt(ge,"keypress",t[26],!1,!1,!1)],Ki=!0)},p:function(bt,[Pt]){Pt&8&&(_.checked=bt[3].showContour),Pt&8&&(E.checked=bt[3].showPoint),Pt&8&&($.checked=bt[3].showGrid),Pt&8&&(Q.checked=bt[3].showLabel),Pt&8&&$t!==($t=!bt[3].showLabel)&&$u(it,"disabled",$t),Pt&8&<(Qt,"selected",bt[3].hover==="label"),Pt&8&<(Jt,"selected",bt[3].hover==="point"),Pt&8&<(te,"selected",bt[3].hover==="none"),Pt&4&<(b,"shown",bt[2]),Pt&4&<(pe,"activated",bt[2])},i:Lt,o:Lt,d:function(bt){bt&&oe(e),t[27](null),Ki=!1,nn(Ho)}};return pt("SvelteRegisterBlock",{block:jo,id:lo.name,type:"component",source:"",ctx:t}),jo}function o2(t,e,n){let{$$slots:i={},$$scope:r}=e;Xn("Embedding",i,[]);let o=null,s=!1,a=!1,l=null,u=!1;const f={showContour:!0,showPoint:!1,showGrid:!0,showLabel:!0,hover:"none"};let{tooltipStore:c=null}=e,{embeddingName:h="prompt"}=e;_i(()=>{n(8,s=!0)});const d=()=>{n(1,l)},p=T=>{f.hover!==T&&(l==null||l.hoverModeChanged(T)),(T==="point"||T==="label"||T==="none")&&n(3,f.hover=T,f)},b=(T,F)=>{const U=T.target.checked;l==null||l.displayCheckboxChanged(F,U)},m=()=>{n(9,a=!0),o&&c&&n(1,l=new Ma({component:o,tooltipStore:c,updateEmbedding:d,defaultSetting:f,embeddingName:h}))},g=["tooltipStore","embeddingName"];Object.keys(e).forEach(T=>{!~g.indexOf(T)&&T.slice(0,2)!=="$$"&&T!=="slot"&&console.warn(` was created with unknown prop '${T}'`)});function x(){f.showContour=this.checked,n(3,f)}const w=T=>b(T,"contour");function y(){f.showPoint=this.checked,n(3,f)}const M=T=>b(T,"point");function W(){f.showGrid=this.checked,n(3,f)}const R=T=>b(T,"grid");function _(){f.showLabel=this.checked,n(3,f)}const V=T=>b(T,"label"),L=T=>l?l.labelNumSliderChanged(T):()=>{},C=()=>{p("label")},I=()=>{p("label")},E=()=>{p("point")},v=()=>{p("point")},A=()=>{p("none")},k=()=>{p("none")},S=()=>{n(2,u=!u)},$=()=>{n(2,u=!u)};function O(T){Ze[T?"unshift":"push"](()=>{o=T,n(0,o)})}return t.$$set=T=>{"tooltipStore"in T&&n(6,c=T.tooltipStore),"embeddingName"in T&&n(7,h=T.embeddingName)},t.$capture_state=()=>({Embedding:Ma,onMount:_i,getTooltipStoreDefaultValue:Le,iconGear:vu,component:o,mounted:s,initialized:a,embedding:l,showControl:u,defaultSetting:f,tooltipStore:c,embeddingName:h,updateEmbedding:d,hoverModeClicked:p,displayCheckboxChanged:b,initView:m}),t.$inject_state=T=>{"component"in T&&n(0,o=T.component),"mounted"in T&&n(8,s=T.mounted),"initialized"in T&&n(9,a=T.initialized),"embedding"in T&&n(1,l=T.embedding),"showControl"in T&&n(2,u=T.showControl),"tooltipStore"in T&&n(6,c=T.tooltipStore),"embeddingName"in T&&n(7,h=T.embeddingName)},e&&"$$inject"in e&&t.$inject_state(e.$$inject),t.$$.update=()=>{t.$$.dirty&833&&s&&!a&&o&&c&&m()},[o,l,u,f,p,b,c,h,s,a,x,w,y,M,W,R,_,V,L,C,I,E,v,A,k,S,$,O]}class uo extends Bn{constructor(e){super(e),qn(this,e,o2,lo,rn,{tooltipStore:6,embeddingName:7}),pt("SvelteRegisterComponent",{component:this,tagName:"Embedding_1",options:e,id:lo.name})}get tooltipStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set tooltipStore(e){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}get embeddingName(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set embeddingName(e){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const Ta=Nt.debug,_t=12,Sa=4,xu=3;let Dt=null,ye=null;class Ca{constructor({component:e,tooltipStore:n,updatePacker:i}){D(this,"svg");D(this,"svgFullSize");D(this,"svgSize");D(this,"svgPadding");D(this,"svgBBox");D(this,"xScale");D(this,"yScale");D(this,"component");D(this,"updatePacker");D(this,"pack",null);D(this,"focusNode",null);D(this,"view",null);D(this,"baseView",null);D(this,"circleGroups",null);D(this,"topTextGroups",null);D(this,"hoverNode",null);D(this,"tooltipStore");D(this,"tooltipStoreValue",Le());D(this,"initData",async()=>{const e="/diffusiondb/explorer/data/phrases-tree.json",n=await B.json(e),i=B.hierarchy(n,r=>r.c).sum(r=>r.v).sort((r,o)=>o.data.v-r.data.v);this.pack=B.pack().padding(3).size([this.svgSize.width,this.svgSize.height])(i)});D(this,"drawCirclePacking",()=>{if(this.pack===null)return;const e=this.svg.select("g.content"),n=e.append("g").attr("class","content-circle");for(let l=1;l`circle-group circle-group-${l.depth}`).attr("id",l=>`circle-group-${l.data.id}`).attr("transform",l=>`translate(${l.x}, ${l.y})`).classed("no-pointer",l=>l.r<10&&l.children===void 0).style("font-size",`${_t}px`),this.circleGroups.append("circle").attr("class","phrase-circle").attr("cx",0).attr("cy",0).attr("r",l=>l.r).on("mouseenter",(l,u)=>this.circleMouseenterHandler(l,u)).on("mouseleave",l=>this.circleMouseleaveHandler(l)).on("click",(l,u)=>this.circleClickHandler(l,u)),this.circleGroups.append("text").attr("class",l=>`phrase-label phrase-label-${l.depth}`).each((l,u,f)=>Nr({d:l,i:u,g:f,hideParent:!0,checkHidden:!0,showHalo:!1,scale:1,markVisible:!0}));const o=i.filter(l=>l.depth===1),s=[];for(const l of o){let u=!1;for(const c of l.descendants())if(c.data.textInfo.visible){u=!0;break}if(u)continue;Math.min(l.data.textInfo.infos[0].diagonal,l.data.textInfo.infos[1].diagonal)<2*l.r&&s.push(l)}const a=this.svg.select("g.content-text-1");this.topTextGroups=a.selectAll("g.top-text-group").data(s).join("g").attr("class","top-text-group").attr("transform",l=>`translate(${l.x-l.r}, ${l.y-l.r})`).style("font-size",`${_t}px`),this.topTextGroups.append("text").attr("class","phrase-label").attr("transform",l=>`translate(${l.r}, ${l.r})`).each((l,u,f)=>Nr({d:l,i:u,g:f,hideParent:!1,checkHidden:!0,showHalo:!0,scale:1,markVisible:!1})),this.zoomToView(this.view)});D(this,"circleMouseenterHandler",(e,n)=>{if(this.circleGroups===null||this.focusNode&&this.focusNode.ancestors().includes(n))return;B.select(e.target).classed("hovered",!0),ye!==null&&(clearTimeout(ye),ye=null);const o=this.svg.select(`#circle-group-${n.data.id}`).node().getBoundingClientRect(),s=o.width,a=o.x+s/2,l=Math.max(this.svgBBox.y,o.y);this.tooltipStoreValue.html=this.getTooltipMessage(n),this.tooltipStoreValue.x=a,this.tooltipStoreValue.y=l,this.tooltipStoreValue.show=!0,this.hoverNode===null?(Dt&&clearTimeout(Dt),Dt=setTimeout(()=>{this.hoverNode=n,this.tooltipStore.set(this.tooltipStoreValue),Dt=null},500)):(Dt&&clearTimeout(Dt),Dt=setTimeout(()=>{this.hoverNode=n,this.tooltipStore.set(this.tooltipStoreValue),Dt=null},200))});D(this,"circleMouseleaveHandler",e=>{B.select(e.target).classed("hovered",!1),Dt!==null&&(clearTimeout(Dt),Dt=null),this.hoverNode!==null&&(ye!==null&&(clearTimeout(ye),ye=null),ye=setTimeout(()=>{this.hoverNode=null,this.tooltipStoreValue.show=!1,this.tooltipStore.set(this.tooltipStoreValue)},50))});D(this,"getTooltipMessage",e=>{var o;let n="",i=`"${e.data.n}"`;if(e.depth>1){n=e.parent.data.n;const s=(o=e.data.n.match(new RegExp(n,"i")))==null?void 0:o.index;s!==void 0&&(s==0?(i=`${n}`,i+=`${e.data.n.slice(n.length)}`):(i=`${e.data.n.slice(0,s)}`,i+=`${n}`,i+=`${e.data.n.slice(s+n.length)}`))}return` -
-
- ${i} -
- -
- -
- Count: ${e.data.v} -
- -
- `});D(this,"zoomToView",e=>{var o;this.view=e;const n=this.svgSize.width/e[2],i=e[0]-e[2]/2,r=e[1]-e[2]/2;(o=this.circleGroups)==null||o.attr("transform",s=>`translate(${(s.x-i)*n},${(s.y-r)*n})`).style("font-size",`${_t*n}px`).select(".phrase-circle").attr("r",s=>s.r*n)});D(this,"circleClickHandler",(e,n)=>{var u;if(this.focusNode===null||this.view===null||n===this.focusNode)return;e.stopPropagation(),this.resetZoomInteractions();const i=this.svg.select("g.content-text-1"),r=this.focusNode;this.focusNode=n;const o=this.focusNode.x-this.focusNode.r,s=this.focusNode.y-this.focusNode.r,a=this.svgSize.width/(this.focusNode.r*2),l=this.svg.transition("zoom").duration(800).tween("zoom",()=>{const f=B.interpolateZoom(this.view,[this.focusNode.x,this.focusNode.y,this.focusNode.r*2]);return c=>this.zoomToView(f(c))});if(this.focusNode!==this.pack){if(!this.circleGroups)return;i.transition("label-removal").duration(150).style("opacity",0);const f=this.svg.select(`g.content-text-${r.depth+1}`),c=this.svg.select(`g.content-text-${this.focusNode.depth+1}`);f.transition("label-removal").duration(150).style("opacity",0),c.style("opacity",0).selectAll("*").remove(),this.circleGroups.filter(w=>w.ancestors().slice(0,3).includes(this.focusNode)).style("--base-stroke",`${a}px`).classed("no-pointer",!1),this.circleGroups.filter(w=>w==this.focusNode).classed("no-pointer",!0);const h=[],d=[];let p=-1;const b=[];for(const w of this.focusNode.descendants().slice(1))w.depth!==p&&(b.unshift([]),p=w.depth),b[0].push(w);b.forEach(w=>B.shuffle(w));let m=b.length===0?[]:b.reduce((w,y)=>w.concat(y));m.length===0&&(m=this.focusNode.descendants());for(const w of m)if(!w.data.textInfo.visible){const y={x:(w.x-o)*a-w.data.textInfo.infos[1].width/2,y:(w.y-s)*a-w.data.textInfo.infos[1].height/2,width:w.data.textInfo.infos[1].width,height:w.data.textInfo.infos[1].height,node:w};if(y.height>w.r*a*2-5||y.width>w.r*a*3)continue;let M=!1;for(const W of d){if(ve(W,y)){M=!0;break}if(w===W.node.parent){M=!0;break}}M||(h.push(w),d.push(y))}let g=_t;if(m.length===1){let w=5;for(;w<150;)if(((u=m[0].data.textInfo)==null?void 0:u.infos[1].lines.length)==1){const y=Ft(m[0].data.textInfo.infos[0].lines[0],w),M=w;if(Math.sqrt(y**2+M**2)>m[0].r*2*a){w-=10;break}w+=5}else{const y=Math.max(Ft(m[0].data.textInfo.infos[1].lines[0],w),Ft(m[0].data.textInfo.infos[1].lines[1],w)),M=2*w;if(Math.sqrt(y**2+M**2)>m[0].r*2*a){w-=10;break}w+=5}g=w}c.selectAll("g.top-text-group").data(h).join("g").attr("class","top-text-group").attr("transform",w=>`translate(${(w.x-o)*a}, ${(w.y-s)*a})`).style("font-size",`${m.length===1?g:_t}px`).append("text").attr("class","phrase-label").classed("phrase-label-2",w=>m.length===1&&w.depth>1).each((w,y,M)=>Nr({d:w,i:y,g:M,hideParent:!1,checkHidden:!1,showHalo:m.length>1,scale:a,markVisible:!1})),l.on("end",()=>{c.transition("show-top-label").duration(200).style("opacity",1)})}else{const f=this.svg.select(`g.content-text-${r.depth+1}`);f.transition("label-removal").duration(150).style("opacity",0).on("end",()=>{f.selectAll("*").remove()}),l.on("end",()=>{i.transition("label-show").duration(150).style("opacity",1)})}});D(this,"resetZoomInteractions",()=>{this.circleGroups!==null&&this.circleGroups.style("--base-stroke","1px").classed("no-pointer",e=>e.r<10&&e.children===void 0).style("font-size",`${_t}px`)});this.component=e,this.updatePacker=i,this.svg=B.select(this.component).select("svg.packing-svg"),this.svgFullSize={width:0,height:0},this.svgBBox=this.svg.node().getBoundingClientRect(),this.svgFullSize.width=this.svgBBox.width,this.svgFullSize.height=this.svgBBox.height,this.svgPadding={top:5,bottom:5,left:5,right:5},this.svgSize={width:this.svgFullSize.width-this.svgPadding.left-this.svgPadding.right,height:this.svgFullSize.width-this.svgPadding.top-this.svgPadding.bottom},this.svg.append("g").attr("class","content").attr("transform",`translate(${this.svgPadding.left}, ${this.svgPadding.top})`).append("rect").attr("class","back-rect").attr("width",this.svgSize.width).attr("height",this.svgSize.height).on("click",o=>{this.pack&&this.circleClickHandler(o,this.pack)}),this.tooltipStore=n,this.tooltipStore.subscribe(o=>{this.tooltipStoreValue=o}),this.xScale=B.scaleLinear().domain([0,1]).range([0,this.svgSize.width]),this.yScale=B.scaleLinear().domain([0,1]).range([this.svgSize.height,0]),this.initData().then(()=>{Ui("Draw circle packing",Ta),this.drawCirclePacking(),Ui("Draw circle packing",Ta)})}}const s2=t=>{const e=t.split(" "),n={width:Ft(t,_t),height:_t,diagonal:Math.sqrt(Ft(t,_t)**2+_t**2),lines:[t]},i={width:0,height:0,diagonal:0,lines:[t]};if(e.length==1)i.width=Ft(t,_t),i.height=_t;else{const o=e.slice(0,Math.floor(e.length/2)).join(" "),s=e.slice(Math.floor(e.length/2)).join(" ");i.lines=[o,s],i.width=Math.max(Ft(o,_t),Ft(s,_t)),i.height=_t*2}return i.diagonal=Math.sqrt(i.width**2+i.height**2),{visible:!1,infos:[n,i]}},a2=(t,e,n)=>e&&t.children!==void 0?!0:t.data.textInfo?Math.min(t.data.textInfo.infos[0].diagonal,t.data.textInfo.infos[1].diagonal)>2*t.r*n+xu:!0,Nr=({d:t,i:e,g:n,hideParent:i,checkHidden:r,showHalo:o,scale:s,markVisible:a})=>{if(t.data.textInfo===void 0||r&&a2(t,i,s))return;a&&(t.data.textInfo.visible=!0);const l=B.select(n[e]);if(r&&t.data.textInfo.infos[0].diagonal<2*t.r*s+xu||!r&&t.data.textInfo.infos[1].lines.length==1){const u=l.append("tspan").attr("class","line-1").attr("x",0).attr("y",0).text(t.data.textInfo.infos[0].lines[0]);o&&u.attr("paint-order","stroke").attr("stroke","white").attr("stroke-width",Sa)}else{const u=l.append("tspan").attr("class","line-1").attr("x",0).attr("y",0).attr("dy","-0.5em").text(t.data.textInfo.infos[1].lines[0]),f=l.append("tspan").attr("class","line-2").attr("x",0).attr("y",0).attr("dy","0.5em").text(t.data.textInfo.infos[1].lines[1]);if(o)for(const c of[u,f])c.attr("paint-order","stroke").attr("stroke","white").attr("stroke-width",Sa)}};const Ar="src/components/packing/Packing.svelte";function co(t){let e,n,i;const r={c:function(){e=Z("div"),n=Z("div"),i=bi("svg"),P(i,"class","packing-svg s-YNG4QXDgBbeZ"),G(i,Ar,139,4,2932),P(n,"class","packing s-YNG4QXDgBbeZ"),G(n,Ar,138,2,2906),P(e,"class","packing-wrapper s-YNG4QXDgBbeZ"),G(e,Ar,137,0,2852)},l:function(s){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(s,a){qe(s,e,a),N(e,n),N(n,i),t[4](e)},p:Lt,i:Lt,o:Lt,d:function(s){s&&oe(e),t[4](null)}};return pt("SvelteRegisterBlock",{block:r,id:co.name,type:"component",source:"",ctx:t}),r}function l2(t,e,n){let{$$slots:i={},$$scope:r}=e;Xn("Packing",i,[]);let o=null,s=!1,a=!1,l=null,{tooltipStore:u=null}=e;_i(()=>{n(2,s=!0)});const f=()=>{l=l},c=()=>{n(3,a=!0),o&&u&&(l=new Ca({component:o,tooltipStore:u,updatePacker:f}))},h=["tooltipStore"];Object.keys(e).forEach(p=>{!~h.indexOf(p)&&p.slice(0,2)!=="$$"&&p!=="slot"&&console.warn(` was created with unknown prop '${p}'`)});function d(p){Ze[p?"unshift":"push"](()=>{o=p,n(0,o)})}return t.$$set=p=>{"tooltipStore"in p&&n(1,u=p.tooltipStore)},t.$capture_state=()=>({Packer:Ca,onMount:_i,getTooltipStoreDefaultValue:Le,component:o,mounted:s,initialized:a,packer:l,tooltipStore:u,updatePacker:f,initView:c}),t.$inject_state=p=>{"component"in p&&n(0,o=p.component),"mounted"in p&&n(2,s=p.mounted),"initialized"in p&&n(3,a=p.initialized),"packer"in p&&(l=p.packer),"tooltipStore"in p&&n(1,u=p.tooltipStore)},e&&"$$inject"in e&&t.$inject_state(e.$$inject),t.$$.update=()=>{t.$$.dirty&15&&s&&!a&&o&&u&&c()},[o,u,s,a,d]}class bu extends Bn{constructor(e){super(e),qn(this,e,l2,co,rn,{tooltipStore:1}),pt("SvelteRegisterComponent",{component:this,tagName:"Packing",options:e,id:co.name})}get tooltipStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set tooltipStore(e){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const La="src/components/Tooltip.svelte";function ho(t){let e,n,i,r,o=t[1].html+"";const s={c:function(){e=Z("div"),n=Z("div"),i=J(),r=new Iu(!1),P(n,"class","s-IRuyl3SM_s-U"),lt(n,"arrow-up",t[1].orientation==="n"),lt(n,"arrow-down",t[1].orientation==="s"),G(n,La,174,2,5502),r.a=null,P(e,"class","tooltip s-IRuyl3SM_s-U"),P(e,"style",t[2]),lt(e,"hidden",!t[1].show),G(e,La,168,0,5406)},l:function(l){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(l,u){qe(l,e,u),N(e,n),N(e,i),r.m(o,e),t[5](e)},p:function(l,[u]){u&2&<(n,"arrow-up",l[1].orientation==="n"),u&2&<(n,"arrow-down",l[1].orientation==="s"),u&2&&o!==(o=l[1].html+"")&&r.p(o),u&4&&P(e,"style",l[2]),u&2&<(e,"hidden",!l[1].show)},i:Lt,o:Lt,d:function(l){l&&oe(e),t[5](null)}};return pt("SvelteRegisterBlock",{block:s,id:ho.name,type:"component",source:"",ctx:t}),s}const wn=10;function u2(t,e,n){let{$$slots:i={},$$scope:r}=e;Xn("Tooltip",i,[]);let{tooltipStore:o=null}=e,s=Le(),a="",l=null,u=!1,f=0,c=0,h=0;const d=()=>{s.width===0?n(2,a=`left: ${c}px; top: ${h}px; - max-width: ${s.maxWidth}px; - font-size: ${s.fontSize}px; opacity: ${f}`):n(2,a=`left: ${c}px; top: ${h}px; - width: ${s.width}px; max-width: ${s.maxWidth}px; - font-size: ${s.fontSize}px; opacity: ${f}`)},p=()=>{o!==null&&l!==null&&(n(4,u=!0),o.subscribe(g=>{g!==null&&(g.show?(g.html===""&&(g.html=" "),f=1,c=g.x,h=g.y,n(1,s=g),n(1,s.width=0,s),Qi().then(()=>{const x=l==null?void 0:l.getBoundingClientRect();x&&(c+x.width>=window.innerWidth-2||c-x.width<=2?(n(1,s.width=Math.min(2*(window.innerWidth-c),2*c,s.maxWidth),s),c-=s.width/2,d(),Qi().then(()=>{const w=l==null?void 0:l.getBoundingClientRect();w&&(s.orientation==="n"?(h+=w.height,h+=wn):(h-=w.height,h-=wn),f=1,d())})):(n(1,s.width=0,s),c-=x.width/2,s.orientation==="n"?(h+=x.height,h+=wn):(h-=x.height,h-=wn),f=1,d()))})):(f=0,n(1,s=g)),d())}))},b=["tooltipStore"];Object.keys(e).forEach(g=>{!~b.indexOf(g)&&g.slice(0,2)!=="$$"&&g!=="slot"&&console.warn(` was created with unknown prop '${g}'`)});function m(g){Ze[g?"unshift":"push"](()=>{l=g,n(0,l)})}return t.$$set=g=>{"tooltipStore"in g&&n(3,o=g.tooltipStore)},t.$capture_state=()=>({d3:B,tick:Qi,getTooltipStoreDefaultValue:Le,tooltipStore:o,V_GAP:wn,tooltipConfig:s,style:a,tooltip:l,initialized:u,opacity:f,left:c,top:h,updateStyle:d,initView:p}),t.$inject_state=g=>{"tooltipStore"in g&&n(3,o=g.tooltipStore),"tooltipConfig"in g&&n(1,s=g.tooltipConfig),"style"in g&&n(2,a=g.style),"tooltip"in g&&n(0,l=g.tooltip),"initialized"in g&&n(4,u=g.initialized),"opacity"in g&&(f=g.opacity),"left"in g&&(c=g.left),"top"in g&&(h=g.top)},e&&"$$inject"in e&&t.$inject_state(e.$$inject),t.$$.update=()=>{t.$$.dirty&25&&o&&!u&&l&&p()},[l,s,a,o,u,m]}class _u extends Bn{constructor(e){super(e),qn(this,e,u2,ho,rn,{tooltipStore:3}),pt("SvelteRegisterComponent",{component:this,tagName:"Tooltip",options:e,id:ho.name})}get tooltipStore(){throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''")}set tooltipStore(e){throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''")}}const ku=` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`,Mu='',Tu=` - - - - - - - - - - -`,Su=` - - - - - - - - - - - -`;const ht="src/components/diffusiondbvis/DiffusiondbVis.svelte";function fo(t){let e,n,i,r,o,s,a,l,u,f,c,h,d,p,b,m,g,x,w,y,M,W,R,_,V,L,C,I,E,v,A,k,S,$,O,T,F,U,ot,H,at,ut,K,Q,Y,X,et;n=new _u({props:{tooltipStore:t[2]},$$inline:!0}),x=new uo({props:{tooltipStore:t[2],embeddingName:"prompt"},$$inline:!0}),M=new uo({props:{tooltipStore:t[2],embeddingName:"image"},$$inline:!0}),_=new bu({props:{tooltipStore:t[2]},$$inline:!0});const z={c:function(){e=Z("div"),bn(n.$$.fragment),i=J(),r=Z("div"),o=Z("div"),s=Z("div"),a=Z("div"),l=J(),u=Z("span"),u.textContent="DiffusionDB Explorer",f=J(),c=Z("div"),h=Z("a"),d=J(),p=Z("a"),b=J(),m=Z("div"),g=Z("div"),bn(x.$$.fragment),w=J(),y=Z("div"),bn(M.$$.fragment),W=J(),R=Z("div"),bn(_.$$.fragment),V=J(),L=Z("div"),C=Z("div"),I=J(),E=Z("div"),v=Pr("Visit "),A=Z("a"),k=Z("em"),k.textContent="WizMap",S=Pr(" to search and visualize 1M+ prompts and images"),$=J(),O=Z("div"),T=Z("button"),T.textContent="Prompt Embedding",F=J(),U=Z("span"),ot=J(),H=Z("button"),H.textContent="Image Embedding",at=J(),ut=Z("span"),K=J(),Q=Z("button"),Q.textContent="Popular Phrases",P(a,"class","app-icon s-mWjcjWMNKh9l"),G(a,ht,238,8,5142),P(u,"class","app-name s-mWjcjWMNKh9l"),G(u,ht,241,8,5222),P(s,"class","title-left s-mWjcjWMNKh9l"),G(s,ht,237,6,5109),P(h,"class","title-link s-mWjcjWMNKh9l"),P(h,"href","https://github.com/poloclub/diffusiondb"),P(h,"target","_blank"),G(h,ht,245,8,5329),P(p,"class","title-link title-file s-mWjcjWMNKh9l"),P(p,"href","https://arxiv.org/abs/2210.14896"),P(p,"target","_blank"),G(p,ht,252,8,5504),P(c,"class","title-right s-mWjcjWMNKh9l"),G(c,ht,244,6,5295),P(o,"class","app-title s-mWjcjWMNKh9l"),G(o,ht,236,4,5079),P(g,"class","main-app-container s-mWjcjWMNKh9l"),lt(g,"hidden",t[1]!=="prompt-embedding"),G(g,ht,263,6,5753),P(y,"class","main-app-container s-mWjcjWMNKh9l"),lt(y,"hidden",t[1]!=="image-embedding"),G(y,ht,270,6,5934),P(R,"class","main-app-container s-mWjcjWMNKh9l"),lt(R,"hidden",t[1]!=="phrase"),G(R,ht,274,6,6090),P(C,"class","svg-icon s-mWjcjWMNKh9l"),G(C,ht,279,8,6275),P(k,"class","s-mWjcjWMNKh9l"),G(k,ht,284,13,6469),P(A,"href","https://poloclub.github.io/wizmap/"),P(A,"target","_blank"),P(A,"class","s-mWjcjWMNKh9l"),G(A,ht,283,16,6395),P(E,"class","label-text s-mWjcjWMNKh9l"),G(E,ht,282,8,6354),P(L,"class","app-label s-mWjcjWMNKh9l"),lt(L,"hidden",t[1]=="phrase"),G(L,ht,278,6,6211),P(m,"class","main-app s-mWjcjWMNKh9l"),G(m,ht,262,4,5702),P(T,"class","tab s-mWjcjWMNKh9l"),P(T,"data-text","Prompt Embedding"),lt(T,"selected",t[1]==="prompt-embedding"),G(T,ht,291,6,6620),P(U,"class","splitter s-mWjcjWMNKh9l"),G(U,ht,300,6,6852),P(H,"class","tab s-mWjcjWMNKh9l"),P(H,"data-text","Image Embedding"),lt(H,"selected",t[1]==="image-embedding"),G(H,ht,302,6,6885),P(ut,"class","splitter s-mWjcjWMNKh9l"),G(ut,ht,311,6,7113),P(Q,"class","tab s-mWjcjWMNKh9l"),P(Q,"data-text","Popular Phrases"),lt(Q,"selected",t[1]==="phrase"),G(Q,ht,313,6,7146),P(O,"class","app-tabs s-mWjcjWMNKh9l"),G(O,ht,290,4,6591),P(r,"class","app-wrapper s-mWjcjWMNKh9l"),G(r,ht,235,2,5049),P(e,"class","diffusiondbvis-page s-mWjcjWMNKh9l"),G(e,ht,232,0,4983)},l:function(q){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(q,ct){qe(q,e,ct),Ie(n,e,null),N(e,i),N(e,r),N(r,o),N(o,s),N(s,a),a.innerHTML=ku,N(s,l),N(s,u),N(o,f),N(o,c),N(c,h),h.innerHTML=Mu,N(c,d),N(c,p),p.innerHTML=Tu,N(r,b),N(r,m),N(m,g),Ie(x,g,null),N(m,w),N(m,y),Ie(M,y,null),N(m,W),N(m,R),Ie(_,R,null),N(m,V),N(m,L),N(L,C),C.innerHTML=Su,N(L,I),N(L,E),N(E,v),N(E,A),N(A,k),N(E,S),t[3](m),N(r,$),N(r,O),N(O,T),N(O,F),N(O,U),N(O,ot),N(O,H),N(O,at),N(O,ut),N(O,K),N(O,Q),Y=!0,X||(et=[dt(T,"click",t[4],!1,!1,!1),dt(H,"click",t[5],!1,!1,!1),dt(Q,"click",t[6],!1,!1,!1)],X=!0)},p:function(q,[ct]){(!Y||ct&2)&<(g,"hidden",q[1]!=="prompt-embedding"),(!Y||ct&2)&<(y,"hidden",q[1]!=="image-embedding"),(!Y||ct&2)&<(R,"hidden",q[1]!=="phrase"),(!Y||ct&2)&<(L,"hidden",q[1]=="phrase"),(!Y||ct&2)&<(T,"selected",q[1]==="prompt-embedding"),(!Y||ct&2)&<(H,"selected",q[1]==="image-embedding"),(!Y||ct&2)&<(Q,"selected",q[1]==="phrase")},i:function(q){Y||(We(n.$$.fragment,q),We(x.$$.fragment,q),We(M.$$.fragment,q),We(_.$$.fragment,q),Y=!0)},o:function(q){xn(n.$$.fragment,q),xn(x.$$.fragment,q),xn(M.$$.fragment,q),xn(_.$$.fragment,q),Y=!1},d:function(q){q&&oe(e),Oe(n),Oe(x),Oe(M),Oe(_),t[3](null),X=!1,nn(et)}};return pt("SvelteRegisterBlock",{block:z,id:fo.name,type:"component",source:"",ctx:t}),z}function c2(t,e,n){let{$$slots:i={},$$scope:r}=e;Xn("DiffusiondbVis",i,[]);let o=null,s="prompt-embedding";if(window.location.hash)switch(window.location.hash.slice(1)){case"phrase":{s="phrase";break}case"prompt-embedding":{s="prompt-embedding";break}case"image-embedding":{s="image-embedding";break}}const a=ba(),l=[];Object.keys(e).forEach(d=>{!~l.indexOf(d)&&d.slice(0,2)!=="$$"&&d!=="slot"&&console.warn(` was created with unknown prop '${d}'`)});function u(d){Ze[d?"unshift":"push"](()=>{o=d,n(0,o)})}const f=()=>{n(1,s="prompt-embedding")},c=()=>{n(1,s="image-embedding")},h=()=>{n(1,s="phrase")};return t.$capture_state=()=>({Embedding:uo,Packing:bu,Tooltip:_u,getTooltipStore:ba,logoDiffusionDB:ku,iconGithub:Mu,iconFile:Tu,iconArrowRight:Su,component:o,view:s,tooltipStore:a}),t.$inject_state=d=>{"component"in d&&n(0,o=d.component),"view"in d&&n(1,s=d.view)},e&&"$$inject"in e&&t.$inject_state(e.$$inject),[o,s,a,u,f,c,h]}class Cu extends Bn{constructor(e){super(e),qn(this,e,c2,fo,rn,{}),pt("SvelteRegisterComponent",{component:this,tagName:"DiffusiondbVis",options:e,id:fo.name})}}const di="App.svelte";function go(t){let e,n,i,r,o,s,a;s=new Cu({$$inline:!0});const l={c:function(){e=Z("link"),n=Z("link"),i=Z("link"),r=J(),o=Z("div"),bn(s.$$.fragment),P(e,"rel","preconnect"),P(e,"href","https://fonts.googleapis.com"),G(e,di,6,2,146),P(n,"rel","preconnect"),P(n,"href","https://fonts.gstatic.com"),P(n,"crossorigin",""),G(n,di,7,2,210),P(i,"href","https://fonts.googleapis.com/css2?family=Lato&display=swap"),P(i,"rel","stylesheet"),G(i,di,8,2,283),P(o,"class","stand-alone-page"),G(o,di,14,0,401)},l:function(f){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(f,c){N(document.head,e),N(document.head,n),N(document.head,i),qe(f,r,c),qe(f,o,c),Ie(s,o,null),a=!0},p:Lt,i:function(f){a||(We(s.$$.fragment,f),a=!0)},o:function(f){xn(s.$$.fragment,f),a=!1},d:function(f){oe(e),oe(n),oe(i),f&&oe(r),f&&oe(o),Oe(s)}};return pt("SvelteRegisterBlock",{block:l,id:go.name,type:"component",source:"",ctx:t}),l}function h2(t,e,n){let{$$slots:i={},$$scope:r}=e;Xn("App",i,[]);const o=[];return Object.keys(e).forEach(s=>{!~o.indexOf(s)&&s.slice(0,2)!=="$$"&&s!=="slot"&&console.warn(` was created with unknown prop '${s}'`)}),t.$capture_state=()=>({DiffusiondbVis:Cu}),[]}class f2 extends Bn{constructor(e){super(e),qn(this,e,h2,go,rn,{}),pt("SvelteRegisterComponent",{component:this,tagName:"App",options:e,id:go.name})}}new f2({target:document.getElementById("app")}); diff --git a/explorer/index.html b/explorer/index.html index 943e5df..9e43efd 100644 --- a/explorer/index.html +++ b/explorer/index.html @@ -5,7 +5,7 @@ DiffusionDB Explorer - +