summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2019-03-17 16:17:39 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2019-03-17 16:17:39 -0400
commit7f68a8f0f79ac1548aaece3ebd65a296714163a6 (patch)
tree31dba52b0b4bffe6ca81fc7e8c32f9d914c63244
parentd2b7391ab8a864f4addcb8dff6a0f07e0c859ef3 (diff)
parent4cfb3d44ec6ea088380554a844e82f4e9d699d2a (diff)
Merge branch 'tmp'
-rw-r--r--Makefile1
-rw-r--r--mirrors/views/mirrorlist.py6
-rw-r--r--sitestatic/archnavbar/archlogo.svg41
-rw-r--r--sitestatic/archnavbar/archnavbar.css4
-rw-r--r--sitestatic/netboot/ipxe.efibin937248 -> 970656 bytes
-rw-r--r--sitestatic/netboot/ipxe.efi.sigbin565 -> 588 bytes
-rw-r--r--sitestatic/netboot/ipxe.lkrnbin339041 -> 340463 bytes
-rw-r--r--sitestatic/netboot/ipxe.lkrn.sigbin565 -> 588 bytes
-rw-r--r--sitestatic/netboot/ipxe.pxebin339737 -> 340873 bytes
-rw-r--r--sitestatic/netboot/ipxe.pxe.sigbin565 -> 588 bytes
-rw-r--r--templates/base.html1
-rw-r--r--templates/mirrors/mirrorlist_generate.html2
-rw-r--r--templates/mirrors/mirrorlist_status.txt4
-rw-r--r--templates/releng/archlinux.ipxe1
-rw-r--r--visualize/static/d3-3.0.6.min.js2
15 files changed, 55 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index d0c933ae..d39e856d 100644
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,7 @@ konami-ver=c0f686e647765860ff4d2fcb7b48122785432b75
branding-images = \
sitestatic/favicon.ico sitestatic/silhouette.png \
sitestatic/archnavbar/archlogo.png \
+ sitestatic/archnavbar/archlogo.svg \
sitestatic/logos/apple-touch-icon-114x114.png \
sitestatic/logos/apple-touch-icon-144x144.png \
sitestatic/logos/apple-touch-icon-57x57.png \
diff --git a/mirrors/views/mirrorlist.py b/mirrors/views/mirrorlist.py
index 3c68d036..7a9ffad0 100644
--- a/mirrors/views/mirrorlist.py
+++ b/mirrors/views/mirrorlist.py
@@ -10,6 +10,7 @@ from django_countries import countries
from ..models import MirrorUrl, MirrorProtocol
from ..utils import get_mirror_statuses
+import random
class MirrorlistForm(forms.Form):
country = forms.MultipleChoiceField(required=False,
@@ -80,8 +81,9 @@ def status_filter(original_urls):
# (as opposed to those that have been set with no score)
if (u.id not in scores) or (u.score and u.score < 100.0):
urls.append(u)
- # if a url doesn't have a score, treat it as the highest possible
- return sorted(urls, key=lambda x: x.score or 100.0)
+ # randomize list to prevent users from overloading the first mirror in the returned list
+ random.shuffle(urls)
+ return urls
def find_mirrors(request, countries=None, protocols=None, use_status=False,
diff --git a/sitestatic/archnavbar/archlogo.svg b/sitestatic/archnavbar/archlogo.svg
new file mode 100644
index 00000000..bcb43b5b
--- /dev/null
+++ b/sitestatic/archnavbar/archlogo.svg
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
+ width="324" height="50">
+ <g transform="scale(.3125)">
+ <path style="fill:#787dab"
+ d="m 148.61515553,5
+ c -4.58342,0.43796 -9.44975,1.24294 -14.52578,2.31649
+ l -32.15841,33.00327
+ c 3.68608,0.44343 7.05945,1.17552 10.13806,2.20749
+ L 148.61515553,5
+ z
+ m 22.64718,1.85319
+ -44.50399,45.64862
+ c 12.51629,16.22018 8.10738,48.80242 -18.23218,102.49819
+ 19.48728,-21.27235 104.53594,-126.9849 65.62498,-146.92041
+ -0.90341,-0.46286 -1.89131,-0.861 -2.88881,-1.2264
+ z
+ m -59.30231,6.4317
+ c -6.15635,1.95909 -12.422699,4.18004 -18.668237,6.54069
+ l -21.28452,21.82957
+ c 4.882365,-0.79156 9.511695,-1.32363 13.87173,-1.60792
+ L 111.96002553,13.28489
+ z
+ M 80.04687853,25.03088
+ C 41.21574853,41.00354 6.49128833,60.51418 6.49128833,60.51418
+ 27.11934853,52.78365 45.74921353,47.00453 62.00544853,43.5356
+ l 18.04143,-18.50472
+ z" />
+ <g transform="translate(194.22346366,80) scale(1.77)">
+ <text style="fill:#ffffff;font-size:84.94529191px;font-family:URW Gothic"
+ x="0" y="30.83513921" >Parabola</text>
+ <g style="fill:#787dab;font-weight:600;font-family:URW Gothic;">
+ <text style="font-size:39.62505691px"
+ x="379.18563779" y="13.06347097">GNU</text>
+ <text style="font-size:18.28203671px"
+ x="379.18563779" y="31.70176442">Linux-libre</text>
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/sitestatic/archnavbar/archnavbar.css b/sitestatic/archnavbar/archnavbar.css
index c4921f9a..ae573ad5 100644
--- a/sitestatic/archnavbar/archnavbar.css
+++ b/sitestatic/archnavbar/archnavbar.css
@@ -7,6 +7,10 @@
/* container for the entire bar */
#archnavbar { height: 40px !important; padding: 10px 15px !important; background: #404060 !important; border-bottom: 5px #787DAB solid !important; }
#archnavbarlogo { float: left !important; margin: -5px 0 0 0 !important; padding: 0 !important; height: 50px !important; width: 324px !important; background: url('archlogo.png') no-repeat !important; }
+@media (-webkit-min-device-pixel-ratio: 1.2), (min--moz-device-pixel-ratio: 1.2), (-o-min-device-pixel-ratio: 2/1) {
+ #archnavbarlogo { float: left !important; margin: -5px 0 0 0 !important; padding: 0 !important; height: 50px !important; width: 324px !important; background: url('archlogo.svg') no-repeat !important;background-size:100% !important;
+ }
+}
/* move the heading/paragraph text offscreen */
#archnavbarlogo p { margin: 0 !important; padding: 0 !important; text-indent: -9999px !important; }
diff --git a/sitestatic/netboot/ipxe.efi b/sitestatic/netboot/ipxe.efi
index e491dc38..d5d21f18 100644
--- a/sitestatic/netboot/ipxe.efi
+++ b/sitestatic/netboot/ipxe.efi
Binary files differ
diff --git a/sitestatic/netboot/ipxe.efi.sig b/sitestatic/netboot/ipxe.efi.sig
index 65f652c9..4d211e16 100644
--- a/sitestatic/netboot/ipxe.efi.sig
+++ b/sitestatic/netboot/ipxe.efi.sig
Binary files differ
diff --git a/sitestatic/netboot/ipxe.lkrn b/sitestatic/netboot/ipxe.lkrn
index a55ee8d1..3b4d69cd 100644
--- a/sitestatic/netboot/ipxe.lkrn
+++ b/sitestatic/netboot/ipxe.lkrn
Binary files differ
diff --git a/sitestatic/netboot/ipxe.lkrn.sig b/sitestatic/netboot/ipxe.lkrn.sig
index b7852f5c..a8c6e161 100644
--- a/sitestatic/netboot/ipxe.lkrn.sig
+++ b/sitestatic/netboot/ipxe.lkrn.sig
Binary files differ
diff --git a/sitestatic/netboot/ipxe.pxe b/sitestatic/netboot/ipxe.pxe
index d1cad8f5..5cff4459 100644
--- a/sitestatic/netboot/ipxe.pxe
+++ b/sitestatic/netboot/ipxe.pxe
Binary files differ
diff --git a/sitestatic/netboot/ipxe.pxe.sig b/sitestatic/netboot/ipxe.pxe.sig
index deecc79e..ab7bea07 100644
--- a/sitestatic/netboot/ipxe.pxe.sig
+++ b/sitestatic/netboot/ipxe.pxe.sig
Binary files differ
diff --git a/templates/base.html b/templates/base.html
index 1892dcdd..b19639d0 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -24,6 +24,7 @@
<!-- Social with GNU Social, Diaspora or another, it needs consensus -->
<li id="anb-wiki"><a href="{% wiki_url %}" title="Community documentation">Wiki</a></li>
<li id="anb-bugs"><a href="{{ BUGTRACKER_URL }}" title="Report and track bugs">Issues</a></li>
+ <!-- security -->
<!-- PUR -->
<li id="anb-projects"><a href="{{ PROJECTS_URL }}" title="Our code">Projects</a></li>
<li id="anb-download"><a href="{% url 'page-download' as pdl %}{{ pdl }}" title="Get {{ BRANDING_DISTRONAME }}">Download</a></li>
diff --git a/templates/mirrors/mirrorlist_generate.html b/templates/mirrors/mirrorlist_generate.html
index 7501a9af..5cf25e80 100644
--- a/templates/mirrors/mirrorlist_generate.html
+++ b/templates/mirrors/mirrorlist_generate.html
@@ -34,7 +34,7 @@
desired protocol(s). Simply replace the contents of
<code>/etc/pacman.d/mirrorlist</code> with your generated list.
Additionally, the mirror status data can be incorporated into the generated
- mirror list and used to pre-order the mirrors.</p>
+ mirror list and used to only list up to date mirrors.</p>
<form id="list-generator" method="get">
{{ mirrorlist_form.as_div }}
diff --git a/templates/mirrors/mirrorlist_status.txt b/templates/mirrors/mirrorlist_status.txt
index 746aae76..34f62cc8 100644
--- a/templates/mirrors/mirrorlist_status.txt
+++ b/templates/mirrors/mirrorlist_status.txt
@@ -5,10 +5,10 @@ forget about where line breaks are happening until you are done getting the
content right, and then go back later to fix it all up.
{% endcomment %}{% autoescape off %}##
## {{ BRANDING_DISTRONAME }} repository mirrorlist
-## Sorted by mirror score from mirror status page
+## Filtered by mirror score from mirror status page
## Generated on {% now "Y-m-d" %}
##
{% for mirror_url in mirror_urls %}
-## Score: {{ mirror_url.score|floatvalue:1|default:'unknown' }}, {{ mirror_url.country.name|default:'Worldwide' }}
+## {{ mirror_url.country.name|default:'Worldwide' }}
#Server = {{ mirror_url.url}}$repo/os/$arch{% endfor %}
{% endautoescape %}
diff --git a/templates/releng/archlinux.ipxe b/templates/releng/archlinux.ipxe
index 70232dfd..a604227f 100644
--- a/templates/releng/archlinux.ipxe
+++ b/templates/releng/archlinux.ipxe
@@ -10,7 +10,6 @@ imgtrust
# initial options
set bootarch ${cpuarch}
set release {{ releases.0 }}
-set mirrorurl
set extrabootoptions ip=dhcp net.ifnames=0
set countrycode
diff --git a/visualize/static/d3-3.0.6.min.js b/visualize/static/d3-3.0.6.min.js
index d3c39b71..bf868624 100644
--- a/visualize/static/d3-3.0.6.min.js
+++ b/visualize/static/d3-3.0.6.min.js
@@ -432,4 +432,4 @@ d3 = function() {
if (arguments.length === 2 && typeof data === "function") callback = data, data = null;
request.open(method, url, true);
if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*";
-d3=function(){var k=Math.PI,z=1e-6,F={version:"3.0.6"},b=k/180,x=180/k,u=document,N=window;function t(t){return t.target}function e(t){return t.source}var a=[3,3];Date.now||(Date.now=function(){return+new Date});try{u.createElement("div").style.setProperty("opacity",0,"")}catch(t){var n=N.CSSStyleDeclaration.prototype,r=n.setProperty;n.setProperty=function(t,n,e){r.call(this,t,n+"",e)}}var f=function(t){return Array.prototype.slice.call(t)};function i(t){for(var n=-1,e=t.length,r=[];++n<e;)r.push(t[n]);return r}try{f(u.documentElement.childNodes)[0].nodeType}catch(t){f=i}var o=[].__proto__?function(t,n){t.__proto__=n}:function(t,n){for(var e in n)t[e]=n[e]};function M(){}F.map=function(t){var n=new M;for(var e in t)n.set(e,t[e]);return n},function(n,e){try{for(var t in e)Object.defineProperty(n.prototype,t,{value:e[t],enumerable:!1})}catch(t){n.prototype=e}}(M,{has:function(t){return c+t in this},get:function(t){return this[c+t]},set:function(t,n){return this[c+t]=n},remove:function(t){return(t=c+t)in this&&delete this[t]},keys:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},values:function(){var e=[];return this.forEach(function(t,n){e.push(n)}),e},entries:function(){var e=[];return this.forEach(function(t,n){e.push({key:t,value:n})}),e},forEach:function(t){for(var n in this)n.charCodeAt(0)===l&&t.call(this,n.substring(1),this[n])}});var c="\0",l=c.charCodeAt(0);function S(t){return t}function E(){return!0}function A(t){return"function"==typeof t?t:function(){return t}}function s(n,e,r){return function(){var t=r.apply(e,arguments);return arguments.length?n:t}}function h(t){return null!=t&&!isNaN(t)}function g(t){return t.length}F.functor=A,F.rebind=function(t,n){for(var e,r=1,i=arguments.length;++r<i;)t[e=arguments[r]]=s(t,n,n[e]);return t},F.ascending=function(t,n){return t<n?-1:n<t?1:n<=t?0:NaN},F.descending=function(t,n){return n<t?-1:t<n?1:t<=n?0:NaN},F.mean=function(t,n){var e,r=t.length,i=0,o=-1,u=0;if(1===arguments.length)for(;++o<r;)h(e=t[o])&&(i+=(e-i)/++u);else for(;++o<r;)h(e=n.call(t,t[o],o))&&(i+=(e-i)/++u);return u?i:void 0},F.median=function(t,n){return 1<arguments.length&&(t=t.map(n)),(t=t.filter(h)).length?F.quantile(t.sort(F.ascending),.5):void 0},F.min=function(t,n){var e,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o&&(null==(e=t[i])||e!=e);)e=void 0;for(;++i<o;)null!=(r=t[i])&&r<e&&(e=r)}else{for(;++i<o&&(null==(e=n.call(t,t[i],i))||e!=e);)e=void 0;for(;++i<o;)null!=(r=n.call(t,t[i],i))&&r<e&&(e=r)}return e},F.max=function(t,n){var e,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o&&(null==(e=t[i])||e!=e);)e=void 0;for(;++i<o;)null!=(r=t[i])&&e<r&&(e=r)}else{for(;++i<o&&(null==(e=n.call(t,t[i],i))||e!=e);)e=void 0;for(;++i<o;)null!=(r=n.call(t,t[i],i))&&e<r&&(e=r)}return e},F.extent=function(t,n){var e,r,i,o=-1,u=t.length;if(1===arguments.length){for(;++o<u&&(null==(e=i=t[o])||e!=e);)e=i=void 0;for(;++o<u;)null!=(r=t[o])&&(r<e&&(e=r),i<r&&(i=r))}else{for(;++o<u&&(null==(e=i=n.call(t,t[o],o))||e!=e);)e=void 0;for(;++o<u;)null!=(r=n.call(t,t[o],o))&&(r<e&&(e=r),i<r&&(i=r))}return[e,i]},F.random={normal:function(r,i){var t=arguments.length;return t<2&&(i=1),t<1&&(r=0),function(){for(var t,n,e;!(e=(t=2*Math.random()-1)*t+(n=2*Math.random()-1)*n)||1<e;);return r+i*t*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(){var t=F.random.normal.apply(F,arguments);return function(){return Math.exp(t())}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t/e}}},F.sum=function(t,n){var e,r=0,i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)isNaN(e=+t[o])||(r+=e);else for(;++o<i;)isNaN(e=+n.call(t,t[o],o))||(r+=e);return r},F.quantile=function(t,n){var e=(t.length-1)*n+1,r=Math.floor(e),i=+t[r-1],o=e-r;return o?i+o*(t[r]-i):i},F.shuffle=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t},F.transpose=function(t){return F.zip.apply(F,t)},F.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,n=F.min(arguments,g),e=new Array(n);++t<n;)for(var r,i=-1,o=e[t]=new Array(r);++i<r;)o[i]=arguments[i][t];return e},F.bisector=function(o){return{left:function(t,n,e,r){for(arguments.length<3&&(e=0),arguments.length<4&&(r=t.length);e<r;){var i=e+r>>>1;o.call(t,t[i],i)<n?e=i+1:r=i}return e},right:function(t,n,e,r){for(arguments.length<3&&(e=0),arguments.length<4&&(r=t.length);e<r;){var i=e+r>>>1;n<o.call(t,t[i],i)?r=i:e=i+1}return e}}};var p=F.bisector(function(t){return t});function d(t){return t.trim().replace(/\s+/g," ")}F.bisectLeft=p.left,F.bisect=F.bisectRight=p.right,F.nest=function(){var f,s,h={},g=[],u=[];function p(t,e){if(e>=g.length)return s?s.call(h,t):f?t.sort(f):t;for(var n,r,i,o=-1,u=t.length,a=g[e++],c=new M,l={};++o<u;)(i=c.get(n=a(r=t[o])))?i.push(r):c.set(n,[r]);return c.forEach(function(t,n){l[t]=p(n,e)}),l}return h.map=function(t){return p(t,0)},h.entries=function(t){return function t(n,e){if(e>=g.length)return n;var r,i=[],o=u[e++];for(r in n)i.push({key:r,values:t(n[r],e)});return o&&i.sort(function(t,n){return o(t.key,n.key)}),i}(p(t,0),0)},h.key=function(t){return g.push(t),h},h.sortKeys=function(t){return u[g.length-1]=t,h},h.sortValues=function(t){return f=t,h},h.rollup=function(t){return s=t,h},h},F.keys=function(t){var n=[];for(var e in t)n.push(e);return n},F.values=function(t){var n=[];for(var e in t)n.push(t[e]);return n},F.entries=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},F.permute=function(t,n){for(var e=[],r=-1,i=n.length;++r<i;)e[r]=t[n[r]];return e},F.merge=function(t){return Array.prototype.concat.apply([],t)},F.range=function(t,n,e){if(arguments.length<3&&(e=1,arguments.length<2&&(n=t,t=0)),(n-t)/e==1/0)throw new Error("infinite range");var r,i=[],o=function(t){var n=1;for(;t*n%1;)n*=10;return n}(Math.abs(e)),u=-1;if(t*=o,n*=o,(e*=o)<0)for(;(r=t+e*++u)>n;)i.push(r/o);else for(;(r=t+e*++u)<n;)i.push(r/o);return i},F.requote=function(t){return t.replace(v,"\\$&")};var v=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;function m(t){return t.responseText}function y(t){return JSON.parse(t.responseText)}function _(t){var n=u.createRange();return n.selectNode(u.body),n.createContextualFragment(t.responseText)}function w(t){return t.responseXML}F.round=function(t,n){return n?Math.round(t*(n=Math.pow(10,n)))/n:Math.round(t)},F.xhr=function(i,o,t){var e,u={},r=F.dispatch("progress","load","error"),a={},n=S,c=new(N.XDomainRequest&&/^(http(s)?:)?\/\//.test(i)?XDomainRequest:XMLHttpRequest);function l(){var t=c.status;!t&&c.responseText||200<=t&&t<300||304===t?r.load.call(u,n.call(u,c)):r.error.call(u,c)}return"onload"in c?c.onload=c.onerror=l:c.onreadystatechange=function(){3<c.readyState&&l()},c.onprogress=function(t){var n=F.event;F.event=t;try{r.progress.call(u,c)}finally{F.event=n}},u.header=function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?a[t]:(null==n?delete a[t]:a[t]=n+"",u)},u.mimeType=function(t){return arguments.length?(o=null==t?null:t+"",u):o},u.response=function(t){return n=t,u},["get","post"].forEach(function(t){u[t]=function(){return u.send.apply(u,[t].concat(f(arguments)))}}),u.send=function(t,n,e){if(2===arguments.length&&"function"==typeof n&&(e=n,n=null),c.open(t,i,!0),null==o||"accept"in a||(a.accept=o+",*/*"),c.setRequestHeader)for(var r in a)c.setRequestHeader(r,a[r]);return null!=o&&c.overrideMimeType&&c.overrideMimeType(o),null!=e&&u.on("error",e).on("load",function(t){e(null,t)}),c.send(null==n?null:n),u},u.abort=function(){return c.abort(),u},F.rebind(u,r,"on"),2===arguments.length&&"function"==typeof o&&(t=o,o=null),null==t?u:u.get(1===(e=t).length?function(t,n){e(null==t?n:null)}:e)},F.text=function(){return F.xhr.apply(F,arguments).response(m)},F.json=function(t,n){return F.xhr(t,"application/json",n).response(y)},F.html=function(t,n){return F.xhr(t,"text/html",n).response(_)},F.xml=function(){return F.xhr.apply(F,arguments).response(w)};var T={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function q(){}function C(i){var o=[],u=new M;function t(){for(var t,n=o,e=-1,r=n.length;++e<r;)(t=n[e].on)&&t.apply(this,arguments);return i}return t.on=function(t,n){var e,r=u.get(t);return arguments.length<2?r&&r.on:(r&&(r.on=null,o=o.slice(0,e=o.indexOf(r)).concat(o.slice(e+1)),u.remove(t)),n&&o.push(u.set(t,{on:n})),i)},t}F.ns={prefix:T,qualify:function(t){var n=t.indexOf(":"),e=t;return 0<=n&&(e=t.substring(0,n),t=t.substring(n+1)),T.hasOwnProperty(e)?{space:T[e],local:t}:t}},F.dispatch=function(){for(var t=new q,n=-1,e=arguments.length;++n<e;)t[arguments[n]]=C(t);return t},q.prototype.on=function(t,n){var e=t.indexOf("."),r="";return 0<e&&(r=t.substring(e+1),t=t.substring(0,e)),arguments.length<2?this[t].on(r):this[t].on(r,n)},F.format=function(t){var n=D.exec(t),o=n[1]||" ",u=n[2]||">",a=n[3]||"",c=n[4]||"",l=n[5],f=+n[6],s=n[7],h=n[8],g=n[9],p=1,d="",v=!1;switch(h&&(h=+h.substring(1)),(l||"0"===o&&"="===u)&&(l=o="0",u="=",s&&(f-=Math.floor((f-1)/4))),g){case"n":s=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":c&&(c="0"+g.toLowerCase());case"c":case"d":v=!0,h=0;break;case"s":p=-1,g="r"}"#"===c&&(c=""),"r"!=g||h||(g="g"),g=L.get(g)||j;var m=l&&s;return function(t){if(v&&t%1)return"";var n=t<0||0===t&&1/t<0?(t=-t,"-"):a;if(p<0){var e=F.formatPrefix(t,h);t=e.scale(t),d=e.symbol}else t*=p;t=g(t,h),!l&&s&&(t=P(t));var r=c.length+t.length+(m?0:n.length),i=r<f?new Array(r=f-r+1).join(o):"";return m&&(t=P(i+t)),t.replace(".","."),n+=c,("<"===u?n+t+i:">"===u?i+n+t:"^"===u?i.substring(0,r>>=1)+n+t+i.substring(r):n+(m?t:i+t))+d}};var D=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,L=F.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,n){return t.toPrecision(n)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},r:function(t,n){return(t=F.round(t,H(t,n))).toFixed(Math.max(0,Math.min(20,H(t*(1+1e-15),n))))}});function H(t,n){return n-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function j(t){return t+""}var P=S,R=a.length;P=function(t){for(var n=t.lastIndexOf("."),e=0<=n?"."+t.substring(n+1):(n=t.length,""),r=[],i=0,o=a[0];0<n&&0<o;)r.push(t.substring(n-=o,n+o)),o=a[i=(i+1)%R];return r.reverse().join(",")+e};var O=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(function(t,n){var e=Math.pow(10,3*Math.abs(8-n));return{scale:8<n?function(t){return t/e}:function(t){return t*e},symbol:t}});F.formatPrefix=function(t,n){var e=0;return t&&(t<0&&(t*=-1),n&&(t=F.round(t,H(t,n))),e=1+Math.floor(1e-12+Math.log(t)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e<=0?e+1:e-1)/3)))),O[8+e/3]};var Y=function(){return S},U=F.map({linear:Y,poly:function(n){return function(t){return Math.pow(t,n)}},quad:function(){return Z},cubic:function(){return B},sin:function(){return $},exp:function(){return J},circle:function(){return G},elastic:function(n,e){var r;arguments.length<2&&(e=.45);r=arguments.length?e/(2*k)*Math.asin(1/n):(n=1,e/4);return function(t){return 1+n*Math.pow(2,10*-t)*Math.sin(2*(t-r)*k/e)}},back:function(n){n||(n=1.70158);return function(t){return t*t*((n+1)*t-n)}},bounce:function(){return K}}),I=F.map({in:S,out:V,"in-out":X,"out-in":function(t){return X(V(t))}});function V(n){return function(t){return 1-n(1-t)}}function X(n){return function(t){return.5*(t<.5?n(2*t):2-n(2-2*t))}}function Z(t){return t*t}function B(t){return t*t*t}function $(t){return 1-Math.cos(t*k/2)}function J(t){return Math.pow(2,10*(t-1))}function G(t){return 1-Math.sqrt(1-t*t)}function K(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function W(){F.event.stopPropagation(),F.event.preventDefault()}function Q(){for(var t,n=F.event;t=n.sourceEvent;)n=t;return n}function tt(i){for(var o=new q,t=0,n=arguments.length;++t<n;)o[arguments[t]]=C(o);return o.of=function(e,r){return function(t){try{var n=t.sourceEvent=F.event;t.target=i,F.event=t,o[t.type].apply(e,r)}finally{F.event=n}}},o}function nt(t){var n,e,r,i=[t.a,t.b],o=[t.c,t.d],u=rt(i),a=et(i,o),c=rt(((n=o)[0]+=(r=-a)*(e=i)[0],n[1]+=r*e[1],n))||0;i[0]*o[1]<o[0]*i[1]&&(i[0]*=-1,i[1]*=-1,u*=-1,a*=-1),this.rotate=(u?Math.atan2(i[1],i[0]):Math.atan2(-o[0],o[1]))*x,this.translate=[t.e,t.f],this.scale=[u,c],this.skew=c?Math.atan2(a,c)*x:0}function et(t,n){return t[0]*n[0]+t[1]*n[1]}function rt(t){var n=Math.sqrt(et(t,t));return n&&(t[0]/=n,t[1]/=n),n}F.ease=function(t){var n,e=t.indexOf("-"),r=0<=e?t.substring(0,e):t,i=0<=e?t.substring(e+1):"in";return r=U.get(r)||Y,i=I.get(i)||S,n=i(r.apply(null,Array.prototype.slice.call(arguments,1))),function(t){return t<=0?0:1<=t?1:n(t)}},F.event=null,F.transform=function(t){var e=u.createElementNS(F.ns.prefix.svg,"g");return(F.transform=function(t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate();return new nt(n?n.matrix:it)})(t)},nt.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var it={a:1,b:0,c:0,d:1,e:0,f:0};F.interpolate=function(t,n){for(var e,r=F.interpolators.length;0<=--r&&!(e=F.interpolators[r](t,n)););return e},F.interpolateNumber=function(n,e){return e-=n,function(t){return n+e*t}},F.interpolateRound=function(n,e){return e-=n,function(t){return Math.round(n+e*t)}},F.interpolateString=function(t,n){var e,r,i,o,u,a=0,c=[],l=[];for(ot.lastIndex=0,r=0;e=ot.exec(n);++r)e.index&&c.push(n.substring(a,e.index)),l.push({i:c.length,x:e[0]}),c.push(null),a=ot.lastIndex;for(a<n.length&&c.push(n.substring(a)),r=0,o=l.length;(e=ot.exec(t))&&r<o;++r)if((u=l[r]).x==e[0]){if(u.i)if(null==c[u.i+1])for(c[u.i-1]+=u.x,c.splice(u.i,1),i=r+1;i<o;++i)l[i].i--;else for(c[u.i-1]+=u.x+c[u.i+1],c.splice(u.i,2),i=r+1;i<o;++i)l[i].i-=2;else if(null==c[u.i+1])c[u.i]=u.x;else for(c[u.i]=u.x+c[u.i+1],c.splice(u.i+1,1),i=r+1;i<o;++i)l[i].i--;l.splice(r,1),o--,r--}else u.x=F.interpolateNumber(parseFloat(e[0]),parseFloat(u.x));for(;r<o;)u=l.pop(),null==c[u.i+1]?c[u.i]=u.x:(c[u.i]=u.x+c[u.i+1],c.splice(u.i+1,1)),o--;return 1===c.length?null==c[0]?l[0].x:function(){return n}:function(t){for(r=0;r<o;++r)c[(u=l[r]).i]=u.x(t);return c.join("")}},F.interpolateTransform=function(t,n){var r,i=[],o=[],e=F.transform(t),u=F.transform(n),a=e.translate,c=u.translate,l=e.rotate,f=u.rotate,s=e.skew,h=u.skew,g=e.scale,p=u.scale;return a[0]!=c[0]||a[1]!=c[1]?(i.push("translate(",null,",",null,")"),o.push({i:1,x:F.interpolateNumber(a[0],c[0])},{i:3,x:F.interpolateNumber(a[1],c[1])})):c[0]||c[1]?i.push("translate("+c+")"):i.push(""),l!=f?(180<l-f?f+=360:180<f-l&&(l+=360),o.push({i:i.push(i.pop()+"rotate(",null,")")-2,x:F.interpolateNumber(l,f)})):f&&i.push(i.pop()+"rotate("+f+")"),s!=h?o.push({i:i.push(i.pop()+"skewX(",null,")")-2,x:F.interpolateNumber(s,h)}):h&&i.push(i.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(r=i.push(i.pop()+"scale(",null,",",null,")"),o.push({i:r-4,x:F.interpolateNumber(g[0],p[0])},{i:r-2,x:F.interpolateNumber(g[1],p[1])})):1==p[0]&&1==p[1]||i.push(i.pop()+"scale("+p+")"),r=o.length,function(t){for(var n,e=-1;++e<r;)i[(n=o[e]).i]=n.x(t);return i.join("")}},F.interpolateRgb=function(t,n){t=F.rgb(t),n=F.rgb(n);var e=t.r,r=t.g,i=t.b,o=n.r-e,u=n.g-r,a=n.b-i;return function(t){return"#"+gt(Math.round(e+o*t))+gt(Math.round(r+u*t))+gt(Math.round(i+a*t))}},F.interpolateHsl=function(t,n){t=F.hsl(t),n=F.hsl(n);var e=t.h,r=t.s,i=t.l,o=n.h-e,u=n.s-r,a=n.l-i;return 180<o?o-=360:o<-180&&(o+=360),function(t){return wt(e+o*t,r+u*t,i+a*t)+""}},F.interpolateLab=function(t,n){t=F.lab(t),n=F.lab(n);var e=t.l,r=t.a,i=t.b,o=n.l-e,u=n.a-r,a=n.b-i;return function(t){return Ft(e+o*t,r+u*t,i+a*t)+""}},F.interpolateHcl=function(t,n){t=F.hcl(t),n=F.hcl(n);var e=t.h,r=t.c,i=t.l,o=n.h-e,u=n.c-r,a=n.l-i;return 180<o?o-=360:o<-180&&(o+=360),function(t){return Nt(e+o*t,r+u*t,i+a*t)+""}},F.interpolateArray=function(t,n){var e,r=[],i=[],o=t.length,u=n.length,a=Math.min(t.length,n.length);for(e=0;e<a;++e)r.push(F.interpolate(t[e],n[e]));for(;e<o;++e)i[e]=t[e];for(;e<u;++e)i[e]=n[e];return function(t){for(e=0;e<a;++e)i[e]=r[e](t);return i}},F.interpolateObject=function(t,n){var e,r={},i={};for(e in t)e in n?r[e]=ut(e)(t[e],n[e]):i[e]=t[e];for(e in n)e in t||(i[e]=n[e]);return function(t){for(e in r)i[e]=r[e](t);return i}};var ot=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;function ut(t){return"transform"==t?F.interpolateTransform:F.interpolate}function at(n,e){return e=e-(n=+n)?1/(e-n):0,function(t){return(t-n)*e}}function ct(n,e){return e=e-(n=+n)?1/(e-n):0,function(t){return Math.max(0,Math.min(1,(t-n)*e))}}function lt(){}function ft(t,n,e){return new st(t,n,e)}function st(t,n,e){this.r=t,this.g=n,this.b=e}F.interpolators=[F.interpolateObject,function(t,n){return n instanceof Array&&F.interpolateArray(t,n)},function(t,n){return("string"==typeof t||"string"==typeof n)&&F.interpolateString(t+"",n+"")},function(t,n){return("string"==typeof n?Mt.has(n)||/^(#|rgb\(|hsl\()/.test(n):n instanceof lt)&&F.interpolateRgb(t,n)},function(t,n){return!isNaN(t=+t)&&!isNaN(n=+n)&&F.interpolateNumber(t,n)}],lt.prototype.toString=function(){return this.rgb()+""},F.rgb=function(t,n,e){return 1===arguments.length?t instanceof st?ft(t.r,t.g,t.b):pt(""+t,ft,wt):ft(~~t,~~n,~~e)};var ht=st.prototype=new lt;function gt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function pt(t,n,e){var r,i,o,u=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return n(yt(i[0]),yt(i[1]),yt(i[2]))}return(o=Mt.get(t))?n(o.r,o.g,o.b):(null!=t&&"#"===t.charAt(0)&&(4===t.length?(u=t.charAt(1),u+=u,a=t.charAt(2),a+=a,c=t.charAt(3),c+=c):7===t.length&&(u=t.substring(1,3),a=t.substring(3,5),c=t.substring(5,7)),u=parseInt(u,16),a=parseInt(a,16),c=parseInt(c,16)),n(u,a,c))}function dt(t,n,e){var r,i,o=Math.min(t/=255,n/=255,e/=255),u=Math.max(t,n,e),a=u-o,c=(u+o)/2;return a?(i=c<.5?a/(u+o):a/(2-u-o),r=t==u?(n-e)/a+(n<e?6:0):n==u?(e-t)/a+2:(t-n)/a+4,r*=60):i=r=0,bt(r,i,c)}function vt(t,n,e){var r=Pt((.4124564*(t=mt(t))+.3575761*(n=mt(n))+.1804375*(e=mt(e)))/Ct),i=Pt((.2126729*t+.7151522*n+.072175*e)/zt);return At(116*i-16,500*(r-i),200*(i-Pt((.0193339*t+.119192*n+.9503041*e)/Dt)))}function mt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yt(t){var n=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*n):n}ht.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var n=this.r,e=this.g,r=this.b;return n||e||r?(n&&n<30&&(n=30),e&&e<30&&(e=30),r&&r<30&&(r=30),ft(Math.min(255,Math.floor(n/t)),Math.min(255,Math.floor(e/t)),Math.min(255,Math.floor(r/t)))):ft(30,30,30)},ht.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),ft(Math.floor(t*this.r),Math.floor(t*this.g),Math.floor(t*this.b))},ht.hsl=function(){return dt(this.r,this.g,this.b)},ht.toString=function(){return"#"+gt(this.r)+gt(this.g)+gt(this.b)};var Mt=F.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});function bt(t,n,e){return new xt(t,n,e)}function xt(t,n,e){this.h=t,this.s=n,this.l=e}Mt.forEach(function(t,n){Mt.set(t,pt(n,ft,wt))}),F.hsl=function(t,n,e){return 1===arguments.length?t instanceof xt?bt(t.h,t.s,t.l):pt(""+t,dt,bt):bt(+t,+n,+e)};var _t=xt.prototype=new lt;function wt(t,n,e){var r,i;function o(t){return Math.round(255*(360<(n=t)?n-=360:n<0&&(n+=360),n<60?r+(i-r)*n/60:n<180?i:n<240?r+(i-r)*(240-n)/60:r));var n}return(t%=360)<0&&(t+=360),n=n<0?0:1<n?1:n,r=2*(e=e<0?0:1<e?1:e)-(i=e<=.5?e*(1+n):e+n-e*n),ft(o(t+120),o(t),o(t-120))}function St(t,n,e){return new kt(t,n,e)}function kt(t,n,e){this.h=t,this.c=n,this.l=e}_t.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),bt(this.h,this.s,this.l/t)},_t.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),bt(this.h,this.s,t*this.l)},_t.rgb=function(){return wt(this.h,this.s,this.l)},F.hcl=function(t,n,e){return 1===arguments.length?t instanceof kt?St(t.h,t.c,t.l):Ht(t instanceof Tt?t.l:(t=vt((t=F.rgb(t)).r,t.g,t.b)).l,t.a,t.b):St(+t,+n,+e)};var Et=kt.prototype=new lt;function Nt(t,n,e){return At(e,Math.cos(t*=b)*n,Math.sin(t)*n)}function At(t,n,e){return new Tt(t,n,e)}function Tt(t,n,e){this.l=t,this.a=n,this.b=e}Et.brighter=function(t){return St(this.h,this.c,Math.min(100,this.l+qt*(arguments.length?t:1)))},Et.darker=function(t){return St(this.h,this.c,Math.max(0,this.l-qt*(arguments.length?t:1)))},Et.rgb=function(){return Nt(this.h,this.c,this.l).rgb()},F.lab=function(t,n,e){return 1===arguments.length?t instanceof Tt?At(t.l,t.a,t.b):t instanceof kt?Nt(t.l,t.c,t.h):vt((t=F.rgb(t)).r,t.g,t.b):At(+t,+n,+e)};var qt=18,Ct=.95047,zt=1,Dt=1.08883,Lt=Tt.prototype=new lt;function Ft(t,n,e){var r=(t+16)/116,i=r+n/500,o=r-e/200;return ft(Rt(3.2404542*(i=jt(i)*Ct)-1.5371385*(r=jt(r)*zt)-.4985314*(o=jt(o)*Dt)),Rt(-.969266*i+1.8760108*r+.041556*o),Rt(.0556434*i-.2040259*r+1.0572252*o))}function Ht(t,n,e){return St(Math.atan2(e,n)/k*180,Math.sqrt(n*n+e*e),t)}function jt(t){return.206893034<t?t*t*t:(t-4/29)/7.787037}function Pt(t){return.008856<t?Math.pow(t,1/3):7.787037*t+4/29}function Rt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Ot(t){return o(t,Zt),t}Lt.brighter=function(t){return At(Math.min(100,this.l+qt*(arguments.length?t:1)),this.a,this.b)},Lt.darker=function(t){return At(Math.max(0,this.l-qt*(arguments.length?t:1)),this.a,this.b)},Lt.rgb=function(){return Ft(this.l,this.a,this.b)};var Yt=function(t,n){return n.querySelector(t)},Ut=function(t,n){return n.querySelectorAll(t)},It=u.documentElement,Vt=It.matchesSelector||It.webkitMatchesSelector||It.mozMatchesSelector||It.msMatchesSelector||It.oMatchesSelector,Xt=function(t,n){return Vt.call(t,n)};"function"==typeof Sizzle&&(Yt=function(t,n){return Sizzle(t,n)[0]||null},Ut=function(t,n){return Sizzle.uniqueSort(Sizzle(t,n))},Xt=Sizzle.matchesSelector);var Zt=[];function Bt(t){return function(){return Yt(t,this)}}function $t(t){return function(){return Ut(t,this)}}function Jt(n,e){return n=F.ns.qualify(n),null==e?n.local?function(){this.removeAttributeNS(n.space,n.local)}:function(){this.removeAttribute(n)}:"function"==typeof e?n.local?function(){var t=e.apply(this,arguments);null==t?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}:function(){var t=e.apply(this,arguments);null==t?this.removeAttribute(n):this.setAttribute(n,t)}:n.local?function(){this.setAttributeNS(n.space,n.local,e)}:function(){this.setAttribute(n,e)}}function Gt(t){return new RegExp("(?:^|\\s+)"+F.requote(t)+"(?:\\s+|$)","g")}function Kt(e,r){var i=(e=e.trim().split(/\s+/).map(Wt)).length;return"function"==typeof r?function(){for(var t=-1,n=r.apply(this,arguments);++t<i;)e[t](this,n)}:function(){for(var t=-1;++t<i;)e[t](this,r)}}function Wt(o){var u=Gt(o);return function(t,n){if(e=t.classList)return n?e.add(o):e.remove(o);var e=t.className,r=null!=e.baseVal,i=r?e.baseVal:e;n?(u.lastIndex=0,u.test(i)||(i=d(i+" "+o),r?e.baseVal=i:t.className=i)):i&&(i=d(i.replace(u," ")),r?e.baseVal=i:t.className=i)}}function Qt(n,e,r){return null==e?function(){this.style.removeProperty(n)}:"function"==typeof e?function(){var t=e.apply(this,arguments);null==t?this.style.removeProperty(n):this.style.setProperty(n,t,r)}:function(){this.style.setProperty(n,e,r)}}function tn(n,e){return null==e?function(){delete this[n]}:"function"==typeof e?function(){var t=e.apply(this,arguments);null==t?delete this[n]:this[n]=t}:function(){this[n]=e}}function nn(t){return{__data__:t}}function en(t){return function(){return Xt(this,t)}}function rn(n,i,o){var u="__on"+n,t=n.indexOf(".");function a(){var t=this[u];t&&(this.removeEventListener(n,t,t.$),delete this[u])}return 0<t&&(n=n.substring(0,t)),i?function(){var e=this,r=f(arguments);function t(t){var n=F.event;F.event=t,r[0]=e.__data__;try{i.apply(e,r)}finally{F.event=n}}a.call(this),this.addEventListener(n,this[u]=t,t.$=o),t._=i}:a}function on(t,n){for(var e=0,r=t.length;e<r;e++)for(var i,o=t[e],u=0,a=o.length;u<a;u++)(i=o[u])&&n(i,u,e);return t}F.selection=function(){return un},(F.selection.prototype=Zt).select=function(t){var n,e,r,i,o=[];"function"!=typeof t&&(t=Bt(t));for(var u=-1,a=this.length;++u<a;){o.push(n=[]),n.parentNode=(r=this[u]).parentNode;for(var c=-1,l=r.length;++c<l;)(i=r[c])?(n.push(e=t.call(i,i.__data__,c)),e&&"__data__"in i&&(e.__data__=i.__data__)):n.push(null)}return Ot(o)},Zt.selectAll=function(t){var n,e,r=[];"function"!=typeof t&&(t=$t(t));for(var i=-1,o=this.length;++i<o;)for(var u=this[i],a=-1,c=u.length;++a<c;)(e=u[a])&&(r.push(n=f(t.call(e,e.__data__,a))),n.parentNode=e);return Ot(r)},Zt.attr=function(t,n){if(arguments.length<2){if("string"==typeof t){var e=this.node();return(t=F.ns.qualify(t)).local?e.getAttributeNS(t.space,t.local):e.getAttribute(t)}for(n in t)this.each(Jt(n,t[n]));return this}return this.each(Jt(t,n))},Zt.classed=function(t,n){if(arguments.length<2){if("string"==typeof t){var e=this.node(),r=(t=t.trim().split(/^|\s+/g)).length,i=-1;if(n=e.classList){for(;++i<r;)if(!n.contains(t[i]))return!1}else for(null!=(n=e.className).baseVal&&(n=n.baseVal);++i<r;)if(!Gt(t[i]).test(n))return!1;return!0}for(n in t)this.each(Kt(n,t[n]));return this}return this.each(Kt(t,n))},Zt.style=function(t,n,e){var r=arguments.length;if(r<3){if("string"!=typeof t){for(e in r<2&&(n=""),t)this.each(Qt(e,t[e],n));return this}if(r<2)return N.getComputedStyle(this.node(),null).getPropertyValue(t);e=""}return this.each(Qt(t,n,e))},Zt.property=function(t,n){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(n in t)this.each(tn(n,t[n]));return this}return this.each(tn(t,n))},Zt.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Zt.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Zt.append=function(t){return t=F.ns.qualify(t),this.select(t.local?function(){return this.appendChild(u.createElementNS(t.space,t.local))}:function(){return this.appendChild(u.createElementNS(this.namespaceURI,t))})},Zt.insert=function(t,n){return t=F.ns.qualify(t),this.select(t.local?function(){return this.insertBefore(u.createElementNS(t.space,t.local),Yt(n,this))}:function(){return this.insertBefore(u.createElementNS(this.namespaceURI,t),Yt(n,this))})},Zt.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},Zt.data=function(t,d){var n,e,r=-1,i=this.length;if(!arguments.length){for(t=new Array(i=(n=this[0]).length);++r<i;)(e=n[r])&&(t[r]=e.__data__);return t}function o(t,n){var e,r,i,o=t.length,u=n.length,a=Math.min(o,u),c=new Array(u),l=new Array(u),f=new Array(o);if(d){var s,h=new M,g=new M,p=[];for(e=-1;++e<o;)s=d.call(r=t[e],r.__data__,e),h.has(s)?f[e]=r:h.set(s,r),p.push(s);for(e=-1;++e<u;)s=d.call(n,i=n[e],e),(r=h.get(s))?(c[e]=r).__data__=i:g.has(s)||(l[e]=nn(i)),g.set(s,i),h.remove(s);for(e=-1;++e<o;)h.has(p[e])&&(f[e]=t[e])}else{for(e=-1;++e<a;)r=t[e],i=n[e],r?(r.__data__=i,c[e]=r):l[e]=nn(i);for(;e<u;++e)l[e]=nn(n[e]);for(;e<o;++e)f[e]=t[e]}l.update=c,l.parentNode=c.parentNode=f.parentNode=t.parentNode,v.push(l),m.push(c),y.push(f)}var v=an([]),m=Ot([]),y=Ot([]);if("function"==typeof t)for(;++r<i;)o(n=this[r],t.call(n,n.parentNode.__data__,r));else for(;++r<i;)o(n=this[r],t);return m.enter=function(){return v},m.exit=function(){return y},m},Zt.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Zt.filter=function(t){var n,e,r,i=[];"function"!=typeof t&&(t=en(t));for(var o=0,u=this.length;o<u;o++){i.push(n=[]),n.parentNode=(e=this[o]).parentNode;for(var a=0,c=e.length;a<c;a++)(r=e[a])&&t.call(r,r.__data__,a)&&n.push(r)}return Ot(i)},Zt.order=function(){for(var t=-1,n=this.length;++t<n;)for(var e,r=this[t],i=r.length-1,o=r[i];0<=--i;)(e=r[i])&&(o&&o!==e.nextSibling&&o.parentNode.insertBefore(e,o),o=e);return this},Zt.sort=function(t){t=function(e){arguments.length||(e=F.ascending);return function(t,n){return!t-!n||e(t.__data__,n.__data__)}}.apply(this,arguments);for(var n=-1,e=this.length;++n<e;)this[n].sort(t);return this.order()},Zt.on=function(t,n,e){var r=arguments.length;if(r<3){if("string"!=typeof t){for(e in r<2&&(n=!1),t)this.each(rn(e,t[e],n));return this}if(r<2)return(r=this.node()["__on"+t])&&r._;e=!1}return this.each(rn(t,n,e))},Zt.each=function(r){return on(this,function(t,n,e){r.call(t,t.__data__,n,e)})},Zt.call=function(t){var n=f(arguments);return t.apply(n[0]=this,n),this},Zt.empty=function(){return!this.node()},Zt.node=function(){for(var t=0,n=this.length;t<n;t++)for(var e=this[t],r=0,i=e.length;r<i;r++){var o=e[r];if(o)return o}return null},Zt.transition=function(){var t,n,e=fn||++hn,r=[],i=Object.create(gn);i.time=Date.now();for(var o=-1,u=this.length;++o<u;){r.push(t=[]);for(var a=this[o],c=-1,l=a.length;++c<l;)(n=a[c])&&pn(n,c,e,i),t.push(n)}return ln(r,e)};var un=Ot([[u]]);function an(t){return o(t,cn),t}un[0].parentNode=It,F.select=function(t){return"string"==typeof t?un.select(t):Ot([[t]])},F.selectAll=function(t){return"string"==typeof t?un.selectAll(t):Ot([f(t)])};var cn=[];function ln(t,n){return o(t,sn),t.id=n,t}F.selection.enter=an,(F.selection.enter.prototype=cn).append=Zt.append,cn.insert=Zt.insert,cn.empty=Zt.empty,cn.node=Zt.node,cn.select=function(t){for(var n,e,r,i,o,u=[],a=-1,c=this.length;++a<c;){r=(i=this[a]).update,u.push(n=[]),n.parentNode=i.parentNode;for(var l=-1,f=i.length;++l<f;)(o=i[l])?(n.push(r[l]=e=t.call(i.parentNode,o.__data__,l)),e.__data__=o.__data__):n.push(null)}return Ot(u)};var fn,sn=[],hn=0,gn={ease:function(t){if(t<=0)return 0;if(1<=t)return 1;var n=t*t,e=n*t;return 4*(t<.5?e:3*(t-n)+e-.75)},delay:0,duration:250};function pn(s,h,g,t){var p=s.__transition__||(s.__transition__={active:0,count:0}),r=p[g];if(!r){var d=t.time;return r=p[g]={tween:new M,event:F.dispatch("start","end"),time:d,ease:t.ease,delay:t.delay,duration:t.duration},++p.count,F.timer(function(t){var i=s.__data__,o=r.ease,u=r.event,a=r.delay,c=r.duration,l=[];return a<=t?n(t):F.timer(n,a,d),1;function n(t){return p.active>g?f():(p.active=g,u.start.call(s,i,h),r.tween.forEach(function(t,n){(n=n.call(s,i,h))&&l.push(n)}),e(t)||F.timer(e,0,d),1)}function e(t){if(p.active!==g)return f();for(var n=(t-a)/c,e=o(n),r=l.length;0<r;)l[--r].call(s,e);return 1<=n?(f(),u.end.call(s,i,h),1):void 0}function f(){return--p.count?delete p[g]:delete s.__transition__,1}},0,d),r}}function dn(t){return null==t&&(t=""),function(){this.textContent=t}}function vn(t,r,i,o){var u=t.id;return on(t,"function"==typeof i?function(t,n,e){t.__transition__[u].tween.set(r,o(i.call(t,t.__data__,n,e)))}:(i=o(i),function(t){t.__transition__[u].tween.set(r,i)}))}sn.call=Zt.call,sn.empty=Zt.empty,sn.node=Zt.node,F.transition=function(t){return arguments.length?fn?t.transition():t:un.transition()},(F.transition.prototype=sn).select=function(t){var n,e,r,i=this.id,o=[];"function"!=typeof t&&(t=Bt(t));for(var u=-1,a=this.length;++u<a;){o.push(n=[]);for(var c=this[u],l=-1,f=c.length;++l<f;)(r=c[l])&&(e=t.call(r,r.__data__,l))?("__data__"in r&&(e.__data__=r.__data__),pn(e,l,i,r.__transition__[i]),n.push(e)):n.push(null)}return ln(o,i)},sn.selectAll=function(t){var n,e,r,i,o,u=this.id,a=[];"function"!=typeof t&&(t=$t(t));for(var c=-1,l=this.length;++c<l;)for(var f=this[c],s=-1,h=f.length;++s<h;)if(r=f[s]){o=r.__transition__[u],e=t.call(r,r.__data__,s),a.push(n=[]);for(var g=-1,p=e.length;++g<p;)pn(i=e[g],g,u,o),n.push(i)}return ln(a,u)},sn.filter=function(t){var n,e,r=[];"function"!=typeof t&&(t=en(t));for(var i=0,o=this.length;i<o;i++){r.push(n=[]);for(var u,a=0,c=(u=this[i]).length;a<c;a++)(e=u[a])&&t.call(e,e.__data__,a)&&n.push(e)}return ln(r,this.id,this.time).ease(this.ease())},sn.attr=function(t,n){if(arguments.length<2){for(n in t)this.attr(n,t[n]);return this}var r=ut(t),i=F.ns.qualify(t);function o(){this.removeAttribute(i)}function u(){this.removeAttributeNS(i.space,i.local)}return vn(this,"attr."+t,n,function(e){return null==e?i.local?u:o:(e+="",i.local?function(){var n,t=this.getAttributeNS(i.space,i.local);return t!==e&&(n=r(t,e),function(t){this.setAttributeNS(i.space,i.local,n(t))})}:function(){var n,t=this.getAttribute(i);return t!==e&&(n=r(t,e),function(t){this.setAttribute(i,n(t))})})})},sn.attrTween=function(t,r){var i=F.ns.qualify(t);return this.tween("attr."+t,i.local?function(t,n){var e=r.call(this,t,n,this.getAttributeNS(i.space,i.local));return e&&function(t){this.setAttributeNS(i.space,i.local,e(t))}}:function(t,n){var e=r.call(this,t,n,this.getAttribute(i));return e&&function(t){this.setAttribute(i,e(t))}})},sn.style=function(r,t,i){var n=arguments.length;if(n<3){if("string"!=typeof r){for(i in n<2&&(t=""),r)this.style(i,r[i],t);return this}i=""}var o=ut(r);function u(){this.style.removeProperty(r)}return vn(this,"style."+r,t,function(e){return null==e?u:(e+="",function(){var n,t=N.getComputedStyle(this,null).getPropertyValue(r);return t!==e&&(n=o(t,e),function(t){this.style.setProperty(r,n(t),i)})})})},sn.styleTween=function(r,i,o){return arguments.length<3&&(o=""),this.tween("style."+r,function(t,n){var e=i.call(this,t,n,N.getComputedStyle(this,null).getPropertyValue(r));return e&&function(t){this.style.setProperty(r,e(t),o)}})},sn.text=function(t){return vn(this,"text",t,dn)},sn.remove=function(){return this.each("end.transition",function(){var t;!this.__transition__&&(t=this.parentNode)&&t.removeChild(this)})},sn.ease=function(n){var e=this.id;return arguments.length<1?this.node().__transition__[e].ease:("function"!=typeof n&&(n=F.ease.apply(F,arguments)),on(this,function(t){t.__transition__[e].ease=n}))},sn.delay=function(r){var i=this.id;return on(this,"function"==typeof r?function(t,n,e){t.__transition__[i].delay=0|r.call(t,t.__data__,n,e)}:(r|=0,function(t){t.__transition__[i].delay=r}))},sn.duration=function(r){var i=this.id;return on(this,"function"==typeof r?function(t,n,e){t.__transition__[i].duration=Math.max(1,0|r.call(t,t.__data__,n,e))}:(r=Math.max(1,0|r),function(t){t.__transition__[i].duration=r}))},sn.each=function(r,n){var i=this.id;if(arguments.length<2){var t=gn,e=fn;fn=i,on(this,function(t,n,e){gn=t.__transition__[i],r.call(t,t.__data__,n,e)}),gn=t,fn=e}else on(this,function(t){t.__transition__[i].event.on(r,n)});return this},sn.transition=function(){for(var t,n,e,r=this.id,i=++hn,o=[],u=0,a=this.length;u<a;u++){o.push(t=[]);for(var c,l=0,f=(c=this[u]).length;l<f;l++)(n=c[l])&&((e=Object.create(n.__transition__[r])).delay+=e.duration,pn(n,l,i,e)),t.push(n)}return ln(o,i)},sn.tween=function(n,e){var r=this.id;return arguments.length<2?this.node().__transition__[r].tween.get(n):on(this,null==e?function(t){t.__transition__[r].tween.remove(n)}:function(t){t.__transition__[r].tween.set(n,e)})};var mn,yn,Mn=0,bn={},xn=null;function _n(){for(var t,n=Date.now(),e=xn;e;)(t=n-e.then)>=e.delay&&(e.flush=e.callback(t)),e=e.next;var r=wn()-n;24<r?(isFinite(r)&&(clearTimeout(yn),yn=setTimeout(_n,r)),mn=0):(mn=1,Sn(_n))}function wn(){for(var t=null,n=xn,e=1/0;n;)n=n.flush?(delete bn[n.callback.id],t?t.next=n.next:xn=n.next):(e=Math.min(e,n.then+n.delay),(t=n).next);return e}F.timer=function(t,n,e){if(arguments.length<3){if(arguments.length<2)n=0;else if(!isFinite(n))return;e=Date.now()}var r=bn[t.id];r&&r.callback===t?(r.then=e,r.delay=n):bn[t.id=++Mn]=xn={callback:t,then:e,delay:n,next:xn},mn||(yn=clearTimeout(yn),mn=1,Sn(_n))},F.timer.flush=function(){for(var t,n=Date.now(),e=xn;e;)t=n-e.then,e.delay||(e.flush=e.callback(t)),e=e.next;wn()};var Sn=N.requestAnimationFrame||N.webkitRequestAnimationFrame||N.mozRequestAnimationFrame||N.oRequestAnimationFrame||N.msRequestAnimationFrame||function(t){setTimeout(t,17)};F.mouse=function(t){return En(t,Q())};var kn=/WebKit/.test(N.navigator.userAgent)?-1:0;function En(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();if(kn<0&&(N.scrollX||N.scrollY)){var i=(e=F.select(u.body).append("svg").style("position","absolute").style("top",0).style("left",0))[0][0].getScreenCTM();kn=!(i.f||i.e),e.remove()}return r.y=kn?(r.x=n.pageX,n.pageY):(r.x=n.clientX,n.clientY),[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var o=t.getBoundingClientRect();return[n.clientX-o.left-t.clientLeft,n.clientY-o.top-t.clientTop]}function Nn(){}function An(t){var n=t[0],e=t[t.length-1];return n<e?[n,e]:[e,n]}function Tn(t){return t.rangeExtent?t.rangeExtent():An(t.range())}function qn(t,n){var e,r=0,i=t.length-1,o=t[r],u=t[i];return u<o&&(e=r,r=i,i=e,e=o,o=u,u=e),(n=n(u-o))&&(t[r]=n.floor(o),t[i]=n.ceil(u)),t}function Cn(){return Math}function zn(t,n){return F.rebind(t,n,"range","rangeRound","interpolate","clamp")}function Dn(n){return(n=Math.pow(10,Math.round(Math.log(n)/Math.LN10)-1))&&{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}}function Ln(t,n){var e=An(t),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/n)/Math.LN10)),o=n/r*i;return o<=.15?i*=10:o<=.35?i*=5:o<=.75&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function Fn(t,n){return F.range.apply(F,Ln(t,n))}function Hn(t,n){return F.format(",."+Math.max(0,-Math.floor(Math.log(Ln(t,n)[2])/Math.LN10+.01))+"f")}function jn(t,n,e,r){var i=e(t[0],t[1]),o=r(n[0],n[1]);return function(t){return o(i(t))}}function Pn(e,t,n,r){var i=[],o=[],u=0,a=Math.min(e.length,t.length)-1;for(e[a]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++u<=a;)i.push(n(e[u-1],e[u])),o.push(r(t[u-1],t[u]));return function(t){var n=F.bisect(e,t,1,a)-1;return o[n](i[n](t))}}F.touches=function(e,t){return arguments.length<2&&(t=Q().touches),t?f(t).map(function(t){var n=En(e,t);return n.identifier=t.identifier,n}):[]},F.scale={},F.scale.linear=function(){return function t(e,r,i,o){var u,a;function n(){var t=2<Math.min(e.length,r.length)?Pn:jn,n=o?ct:at;return u=t(e,r,n,i),a=t(r,e,n,F.interpolate),c}function c(t){return u(t)}c.invert=function(t){return a(t)};c.domain=function(t){return arguments.length?(e=t.map(Number),n()):e};c.range=function(t){return arguments.length?(r=t,n()):r};c.rangeRound=function(t){return c.range(t).interpolate(F.interpolateRound)};c.clamp=function(t){return arguments.length?(o=t,n()):o};c.interpolate=function(t){return arguments.length?(i=t,n()):i};c.ticks=function(t){return Fn(e,t)};c.tickFormat=function(t){return Hn(e,t)};c.nice=function(){return qn(e,Dn),n()};c.copy=function(){return t(e,r,i,o)};return n()}([0,1],[0,1],F.interpolate,!1)},F.scale.log=function(){return function t(a,c){var l=c.pow;function o(t){return a(c(t))}o.invert=function(t){return l(a.invert(t))};o.domain=function(t){return arguments.length?(c=t[0]<0?Yn:On,l=c.pow,a.domain(t.map(c)),o):a.domain().map(l)};o.nice=function(){return a.domain(qn(a.domain(),Cn)),o};o.ticks=function(){var t=An(a.domain()),n=[];if(t.every(isFinite)){var e=Math.floor(t[0]),r=Math.ceil(t[1]),i=l(t[0]),o=l(t[1]);if(c===Yn)for(n.push(l(e));e++<r;)for(var u=9;0<u;u--)n.push(l(e)*u);else{for(;e<r;e++)for(var u=1;u<10;u++)n.push(l(e)*u);n.push(l(e))}for(e=0;n[e]<i;e++);for(r=n.length;n[r-1]>o;r--);n=n.slice(e,r)}return n};o.tickFormat=function(t,n){if(arguments.length<2&&(n=Rn),!arguments.length)return n;var e,r=Math.max(.1,t/o.ticks().length),i=c===Yn?(e=-1e-12,Math.floor):(e=1e-12,Math.ceil);return function(t){return t/l(i(c(t)+e))<=r?n(t):""}};o.copy=function(){return t(a.copy(),c)};return zn(o,a)}(F.scale.linear(),On)};var Rn=F.format(".0e");function On(t){return Math.log(t<0?0:t)/Math.LN10}function Yn(t){return-Math.log(0<t?0:-t)/Math.LN10}function Un(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}On.pow=function(t){return Math.pow(10,t)},Yn.pow=function(t){return-Math.pow(10,-t)},F.scale.pow=function(){return function t(n,e){var r=Un(e),i=Un(1/e);function o(t){return n(r(t))}o.invert=function(t){return i(n.invert(t))};o.domain=function(t){return arguments.length?(n.domain(t.map(r)),o):n.domain().map(i)};o.ticks=function(t){return Fn(o.domain(),t)};o.tickFormat=function(t){return Hn(o.domain(),t)};o.nice=function(){return o.domain(qn(o.domain(),Dn))};o.exponent=function(t){if(!arguments.length)return e;var n=o.domain();return r=Un(e=t),i=Un(1/e),o.domain(n)};o.copy=function(){return t(n.copy(),e)};return zn(o,n)}(F.scale.linear(),1)},F.scale.sqrt=function(){return F.scale.pow().exponent(.5)},F.scale.ordinal=function(){return function t(c,l){var i,f,s;function h(t){return f[((i.get(t)||i.set(t,c.push(t)))-1)%f.length]}function g(n,e){return F.range(c.length).map(function(t){return n+e*t})}h.domain=function(t){if(!arguments.length)return c;c=[],i=new M;for(var n,e=-1,r=t.length;++e<r;)i.has(n=t[e])||i.set(n,c.push(n));return h[l.t].apply(h,l.a)};h.range=function(t){return arguments.length?(f=t,s=0,l={t:"range",a:arguments},h):f};h.rangePoints=function(t,n){arguments.length<2&&(n=0);var e=t[0],r=t[1],i=(r-e)/(Math.max(1,c.length-1)+n);return f=g(c.length<2?(e+r)/2:e+i*n/2,i),s=0,l={t:"rangePoints",a:arguments},h};h.rangeBands=function(t,n,e){arguments.length<2&&(n=0),arguments.length<3&&(e=n);var r=t[1]<t[0],i=t[r-0],o=t[1-r],u=(o-i)/(c.length-n+2*e);return f=g(i+u*e,u),r&&f.reverse(),s=u*(1-n),l={t:"rangeBands",a:arguments},h};h.rangeRoundBands=function(t,n,e){arguments.length<2&&(n=0),arguments.length<3&&(e=n);var r=t[1]<t[0],i=t[r-0],o=t[1-r],u=Math.floor((o-i)/(c.length-n+2*e)),a=o-i-(c.length-n)*u;return f=g(i+Math.round(a/2),u),r&&f.reverse(),s=Math.round(u*(1-n)),l={t:"rangeRoundBands",a:arguments},h};h.rangeBand=function(){return s};h.rangeExtent=function(){return An(l.a[0])};h.copy=function(){return t(c,l)};return h.domain(c)}([],{t:"range",a:[[]]})},F.scale.category10=function(){return F.scale.ordinal().range(In)},F.scale.category20=function(){return F.scale.ordinal().range(Vn)},F.scale.category20b=function(){return F.scale.ordinal().range(Xn)},F.scale.category20c=function(){return F.scale.ordinal().range(Zn)};var In=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Vn=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],Xn=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],Zn=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];F.scale.quantile=function(){return function t(e,r){var i;function n(){var t=0,n=r.length;for(i=[];++t<n;)i[t-1]=F.quantile(e,t/n);return o}function o(t){return isNaN(t=+t)?NaN:r[F.bisect(i,t)]}o.domain=function(t){return arguments.length?(e=t.filter(function(t){return!isNaN(t)}).sort(F.ascending),n()):e};o.range=function(t){return arguments.length?(r=t,n()):r};o.quantiles=function(){return i};o.copy=function(){return t(e,r)};return n()}([],[])},F.scale.quantize=function(){return function t(n,e,r){var i,o;function u(t){return r[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function a(){return i=r.length/(e-n),o=r.length-1,u}u.domain=function(t){return arguments.length?(n=+t[0],e=+t[t.length-1],a()):[n,e]};u.range=function(t){return arguments.length?(r=t,a()):r};u.copy=function(){return t(n,e,r)};return a()}(0,1,[0,1])},F.scale.threshold=function(){return function t(n,e){function r(t){return e[F.bisect(n,t)]}r.domain=function(t){return arguments.length?(n=t,r):n};r.range=function(t){return arguments.length?(e=t,r):e};r.copy=function(){return t(n,e)};return r}([.5],[0,1])},F.scale.identity=function(){return function t(n){function e(t){return+t}e.invert=e;e.domain=e.range=function(t){return arguments.length?(n=t.map(e),e):n};e.ticks=function(t){return Fn(n,t)};e.tickFormat=function(t){return Hn(n,t)};e.copy=function(){return t(n)};return e}([0,1])},F.svg={},F.svg.arc=function(){var f=Jn,s=Gn,h=Kn,g=Wn;function n(){var t=f.apply(this,arguments),n=s.apply(this,arguments),e=h.apply(this,arguments)+Bn,r=g.apply(this,arguments)+Bn,i=(r<e&&(i=e,e=r,r=i),r-e),o=i<k?"0":"1",u=Math.cos(e),a=Math.sin(e),c=Math.cos(r),l=Math.sin(r);return $n<=i?t?"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z":t?"M"+n*u+","+n*a+"A"+n+","+n+" 0 "+o+",1 "+n*c+","+n*l+"L"+t*c+","+t*l+"A"+t+","+t+" 0 "+o+",0 "+t*u+","+t*a+"Z":"M"+n*u+","+n*a+"A"+n+","+n+" 0 "+o+",1 "+n*c+","+n*l+"L0,0Z"}return n.innerRadius=function(t){return arguments.length?(f=A(t),n):f},n.outerRadius=function(t){return arguments.length?(s=A(t),n):s},n.startAngle=function(t){return arguments.length?(h=A(t),n):h},n.endAngle=function(t){return arguments.length?(g=A(t),n):g},n.centroid=function(){var t=(f.apply(this,arguments)+s.apply(this,arguments))/2,n=(h.apply(this,arguments)+g.apply(this,arguments))/2+Bn;return[Math.cos(n)*t,Math.sin(n)*t]},n};var Bn=-k/2,$n=2*k-1e-6;function Jn(t){return t.innerRadius}function Gn(t){return t.outerRadius}function Kn(t){return t.startAngle}function Wn(t){return t.endAngle}function Qn(l){var f=te,s=ne,h=E,g=re,n=g.key,p=.7;function e(t){var n,e=[],r=[],i=-1,o=t.length,u=A(f),a=A(s);function c(){e.push("M",g(l(r),p))}for(;++i<o;)h.call(this,n=t[i],i)?r.push([+u.call(this,n,i),+a.call(this,n,i)]):r.length&&(c(),r=[]);return r.length&&c(),e.length?e.join(""):null}return e.x=function(t){return arguments.length?(f=t,e):f},e.y=function(t){return arguments.length?(s=t,e):s},e.defined=function(t){return arguments.length?(h=t,e):h},e.interpolate=function(t){return arguments.length?(n="function"==typeof t?g=t:(g=ee.get(t)||re).key,e):n},e.tension=function(t){return arguments.length?(p=t,e):p},e}function te(t){return t[0]}function ne(t){return t[1]}F.svg.line=function(){return Qn(S)};var ee=F.map({linear:re,"linear-closed":function(t){return re(t)+"Z"},"step-before":ie,"step-after":oe,basis:ce,"basis-open":function(t){if(t.length<4)return re(t);var n,e=[],r=-1,i=t.length,o=[0],u=[0];for(;++r<3;)n=t[r],o.push(n[0]),u.push(n[1]);e.push(le(he,o)+","+le(he,u)),--r;for(;++r<i;)n=t[r],o.shift(),o.push(n[0]),u.shift(),u.push(n[1]),ge(e,o,u);return e.join("")},"basis-closed":function(t){var n,e,r=-1,i=t.length,o=i+4,u=[],a=[];for(;++r<4;)e=t[r%i],u.push(e[0]),a.push(e[1]);n=[le(he,u),",",le(he,a)],--r;for(;++r<o;)e=t[r%i],u.shift(),u.push(e[0]),a.shift(),a.push(e[1]),ge(n,u,a);return n.join("")},bundle:function(t,n){var e=t.length-1;if(e)for(var r,i,o=t[0][0],u=t[0][1],a=t[e][0]-o,c=t[e][1]-u,l=-1;++l<=e;)r=t[l],i=l/e,r[0]=n*r[0]+(1-n)*(o+i*a),r[1]=n*r[1]+(1-n)*(u+i*c);return ce(t)},cardinal:function(t,n){return t.length<3?re(t):t[0]+ue(t,ae(t,n))},"cardinal-open":function(t,n){return t.length<4?re(t):t[1]+ue(t.slice(1,t.length-1),ae(t,n))},"cardinal-closed":function(t,n){return t.length<3?re(t):t[0]+ue((t.push(t[0]),t),ae([t[t.length-2]].concat(t,[t[1]]),n))},monotone:function(t){return t.length<3?re(t):t[0]+ue(t,function(t){var n,e,r,i,o=[],u=function(t){var n=0,e=t.length-1,r=[],i=t[0],o=t[1],u=r[0]=pe(i,o);for(;++n<e;)r[n]=(u+(u=pe(i=o,o=t[n+1])))/2;return r[n]=u,r}(t),a=-1,c=t.length-1;for(;++a<c;)n=pe(t[a],t[a+1]),Math.abs(n)<1e-6?u[a]=u[a+1]=0:(e=u[a]/n,r=u[a+1]/n,9<(i=e*e+r*r)&&(i=3*n/Math.sqrt(i),u[a]=i*e,u[a+1]=i*r));a=-1;for(;++a<=c;)i=(t[Math.min(c,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+u[a]*u[a])),o.push([i||0,u[a]*i||0]);return o}(t))}});function re(t){return t.join("L")}function ie(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];++n<e;)i.push("V",(r=t[n])[1],"H",r[0]);return i.join("")}function oe(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];++n<e;)i.push("H",(r=t[n])[0],"V",r[1]);return i.join("")}function ue(t,n){if(n.length<1||t.length!=n.length&&t.length!=n.length+2)return re(t);var e=t.length!=n.length,r="",i=t[0],o=t[1],u=n[0],a=u,c=1;if(e&&(r+="Q"+(o[0]-2*u[0]/3)+","+(o[1]-2*u[1]/3)+","+o[0]+","+o[1],i=t[1],c=2),1<n.length){a=n[1],o=t[c],c++,r+="C"+(i[0]+u[0])+","+(i[1]+u[1])+","+(o[0]-a[0])+","+(o[1]-a[1])+","+o[0]+","+o[1];for(var l=2;l<n.length;l++,c++)o=t[c],a=n[l],r+="S"+(o[0]-a[0])+","+(o[1]-a[1])+","+o[0]+","+o[1]}if(e){var f=t[c];r+="Q"+(o[0]+2*a[0]/3)+","+(o[1]+2*a[1]/3)+","+f[0]+","+f[1]}return r}function ae(t,n){for(var e,r=[],i=(1-n)/2,o=t[0],u=t[1],a=1,c=t.length;++a<c;)e=o,o=u,u=t[a],r.push([i*(u[0]-e[0]),i*(u[1]-e[1])]);return r}function ce(t){if(t.length<3)return re(t);var n=1,e=t.length,r=t[0],i=r[0],o=r[1],u=[i,i,i,(r=t[1])[0]],a=[o,o,o,r[1]],c=[i,",",o];for(ge(c,u,a);++n<e;)r=t[n],u.shift(),u.push(r[0]),a.shift(),a.push(r[1]),ge(c,u,a);for(n=-1;++n<2;)u.shift(),u.push(r[0]),a.shift(),a.push(r[1]),ge(c,u,a);return c.join("")}function le(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}ee.forEach(function(t,n){n.key=t,n.closed=/-closed$/.test(t)});var fe=[0,2/3,1/3,0],se=[0,1/3,2/3,0],he=[0,1/6,2/3,1/6];function ge(t,n,e){t.push("C",le(fe,n),",",le(fe,e),",",le(se,n),",",le(se,e),",",le(he,n),",",le(he,e))}function pe(t,n){return(n[1]-t[1])/(n[0]-t[0])}function de(t){for(var n,e,r,i=-1,o=t.length;++i<o;)e=(n=t[i])[0],r=n[1]+Bn,n[0]=e*Math.cos(r),n[1]=e*Math.sin(r);return t}function ve(p){var d=te,v=te,m=0,y=ne,M=E,b=re,n=b.key,x=b,_="L",w=.7;function e(t){var n,e,r,i=[],o=[],u=[],a=-1,c=t.length,l=A(d),f=A(m),s=d===v?function(){return e}:A(v),h=m===y?function(){return r}:A(y);function g(){i.push("M",b(p(u),w),_,x(p(o.reverse()),w),"Z")}for(;++a<c;)M.call(this,n=t[a],a)?(o.push([e=+l.call(this,n,a),r=+f.call(this,n,a)]),u.push([+s.call(this,n,a),+h.call(this,n,a)])):o.length&&(g(),o=[],u=[]);return o.length&&g(),i.length?i.join(""):null}return e.x=function(t){return arguments.length?(d=v=t,e):v},e.x0=function(t){return arguments.length?(d=t,e):d},e.x1=function(t){return arguments.length?(v=t,e):v},e.y=function(t){return arguments.length?(m=y=t,e):y},e.y0=function(t){return arguments.length?(m=t,e):m},e.y1=function(t){return arguments.length?(y=t,e):y},e.defined=function(t){return arguments.length?(M=t,e):M},e.interpolate=function(t){return arguments.length?(n="function"==typeof t?b=t:(b=ee.get(t)||re).key,x=b.reverse||b,_=b.closed?"M":"L",e):n},e.tension=function(t){return arguments.length?(w=t,e):w},e}function me(t){return t.radius}function ye(t){return[t.x,t.y]}function Me(){return 64}function be(){return"circle"}function xe(t){var n=Math.sqrt(t/k);return"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z"}F.svg.line.radial=function(){var t=Qn(de);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},(ie.reverse=oe).reverse=ie,F.svg.area=function(){return ve(S)},F.svg.area.radial=function(){var t=ve(de);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},F.svg.chord=function(){var u=e,a=t,c=me,l=Kn,f=Wn;function n(t,n){var e,r,i=s(this,u,t,n),o=s(this,a,t,n);return"M"+i.p0+h(i.r,i.p1,i.a1-i.a0)+(r=o,(e=i).a0==r.a0&&e.a1==r.a1?g(i.r,i.p1,i.r,i.p0):g(i.r,i.p1,o.r,o.p0)+h(o.r,o.p1,o.a1-o.a0)+g(o.r,o.p1,i.r,i.p0))+"Z"}function s(t,n,e,r){var i=n.call(t,e,r),o=c.call(t,i,r),u=l.call(t,i,r)+Bn,a=f.call(t,i,r)+Bn;return{r:o,a0:u,a1:a,p0:[o*Math.cos(u),o*Math.sin(u)],p1:[o*Math.cos(a),o*Math.sin(a)]}}function h(t,n,e){return"A"+t+","+t+" 0 "+ +(k<e)+",1 "+n}function g(t,n,e,r){return"Q 0,0 "+r}return n.radius=function(t){return arguments.length?(c=A(t),n):c},n.source=function(t){return arguments.length?(u=A(t),n):u},n.target=function(t){return arguments.length?(a=A(t),n):a},n.startAngle=function(t){return arguments.length?(l=A(t),n):l},n.endAngle=function(t){return arguments.length?(f=A(t),n):f},n},F.svg.diagonal=function(){var u=e,a=t,c=ye;function n(t,n){var e=u.call(this,t,n),r=a.call(this,t,n),i=(e.y+r.y)/2,o=[e,{x:e.x,y:i},{x:r.x,y:i},r];return"M"+(o=o.map(c))[0]+"C"+o[1]+" "+o[2]+" "+o[3]}return n.source=function(t){return arguments.length?(u=A(t),n):u},n.target=function(t){return arguments.length?(a=A(t),n):a},n.projection=function(t){return arguments.length?(c=t,n):c},n},F.svg.diagonal.radial=function(){var t=F.svg.diagonal(),n=ye,e=t.projection;return t.projection=function(t){return arguments.length?e((r=n=t,function(){var t=r.apply(this,arguments),n=t[0],e=t[1]+Bn;return[n*Math.cos(e),n*Math.sin(e)]})):n;var r},t},F.svg.symbol=function(){var e=be,r=Me;function n(t,n){return(_e.get(e.call(this,t,n))||xe)(r.call(this,t,n))}return n.type=function(t){return arguments.length?(e=A(t),n):e},n.size=function(t){return arguments.length?(r=A(t),n):r},n};var _e=F.map({circle:xe,cross:function(t){var n=Math.sqrt(t/5)/2;return"M"+-3*n+","+-n+"H"+-n+"V"+-3*n+"H"+n+"V"+-n+"H"+3*n+"V"+n+"H"+n+"V"+3*n+"H"+-n+"V"+n+"H"+-3*n+"Z"},diamond:function(t){var n=Math.sqrt(t/(2*Se)),e=n*Se;return"M0,"+-n+"L"+e+",0 0,"+n+" "+-e+",0Z"},square:function(t){var n=Math.sqrt(t)/2;return"M"+-n+","+-n+"L"+n+","+-n+" "+n+","+n+" "+-n+","+n+"Z"},"triangle-down":function(t){var n=Math.sqrt(t/we),e=n*we/2;return"M0,"+e+"L"+n+","+-e+" "+-n+","+-e+"Z"},"triangle-up":function(t){var n=Math.sqrt(t/we),e=n*we/2;return"M0,"+-e+"L"+n+","+e+" "+-n+","+e+"Z"}});F.svg.symbolTypes=_e.keys();var we=Math.sqrt(3),Se=Math.tan(30*b);F.svg.axis=function(){var k,E=F.scale.linear(),N=ke,A=6,T=6,q=6,C=3,z=[10],D=null,L=0;function r(t){t.each(function(){var t,n=F.select(this),e=null==D?E.ticks?E.ticks.apply(E,z):E.domain():D,r=null==k?E.tickFormat?E.tickFormat.apply(E,z):String:k,i=function(t,n,e){if(r=[],e&&1<n.length){for(var r,i,o,u=An(t.domain()),a=-1,c=n.length,l=(n[1]-n[0])/++e;++a<c;)for(i=e;0<--i;)(o=+n[a]-i*l)>=u[0]&&r.push(o);for(--a,i=0;++i<e&&(o=+n[a]+i*l)<u[1];)r.push(o)}return r}(E,e,L),o=n.selectAll(".tick.minor").data(i,String),u=o.enter().insert("line",".tick").attr("class","tick minor").style("opacity",1e-6),a=F.transition(o.exit()).style("opacity",1e-6).remove(),c=F.transition(o).style("opacity",1),l=n.selectAll(".tick.major").data(e,String),f=l.enter().insert("g","path").attr("class","tick major").style("opacity",1e-6),s=F.transition(l.exit()).style("opacity",1e-6).remove(),h=F.transition(l).style("opacity",1),g=Tn(E),p=n.selectAll(".domain").data([0]),d=(p.enter().append("path").attr("class","domain"),F.transition(p)),v=E.copy(),m=this.__chart__||v;this.__chart__=v,f.append("line"),f.append("text");var y=f.select("line"),M=h.select("line"),b=l.select("text").text(r),x=f.select("text"),_=h.select("text");switch(N){case"bottom":t=Ne,u.attr("y2",T),c.attr("x2",0).attr("y2",T),y.attr("y2",A),x.attr("y",Math.max(A,0)+C),M.attr("x2",0).attr("y2",A),_.attr("x",0).attr("y",Math.max(A,0)+C),b.attr("dy",".71em").style("text-anchor","middle"),d.attr("d","M"+g[0]+","+q+"V0H"+g[1]+"V"+q);break;case"top":t=Ne,u.attr("y2",-T),c.attr("x2",0).attr("y2",-T),y.attr("y2",-A),x.attr("y",-(Math.max(A,0)+C)),M.attr("x2",0).attr("y2",-A),_.attr("x",0).attr("y",-(Math.max(A,0)+C)),b.attr("dy","0em").style("text-anchor","middle"),d.attr("d","M"+g[0]+","+-q+"V0H"+g[1]+"V"+-q);break;case"left":t=Ae,u.attr("x2",-T),c.attr("x2",-T).attr("y2",0),y.attr("x2",-A),x.attr("x",-(Math.max(A,0)+C)),M.attr("x2",-A).attr("y2",0),_.attr("x",-(Math.max(A,0)+C)).attr("y",0),b.attr("dy",".32em").style("text-anchor","end"),d.attr("d","M"+-q+","+g[0]+"H0V"+g[1]+"H"+-q);break;case"right":t=Ae,u.attr("x2",T),c.attr("x2",T).attr("y2",0),y.attr("x2",A),x.attr("x",Math.max(A,0)+C),M.attr("x2",A).attr("y2",0),_.attr("x",Math.max(A,0)+C).attr("y",0),b.attr("dy",".32em").style("text-anchor","start"),d.attr("d","M"+q+","+g[0]+"H0V"+g[1]+"H"+q)}if(E.ticks)f.call(t,m),h.call(t,v),s.call(t,v),u.call(t,m),c.call(t,v),a.call(t,v);else{var w=v.rangeBand()/2,S=function(t){return v(t)+w};f.call(t,S),h.call(t,S)}})}return r.scale=function(t){return arguments.length?(E=t,r):E},r.orient=function(t){return arguments.length?(N=t in Ee?t+"":ke,r):N},r.ticks=function(){return arguments.length?(z=arguments,r):z},r.tickValues=function(t){return arguments.length?(D=t,r):D},r.tickFormat=function(t){return arguments.length?(k=t,r):k},r.tickSize=function(t,n){if(!arguments.length)return A;var e=arguments.length-1;return A=+t,T=1<e?+n:A,q=0<e?+arguments[e]:A,r},r.tickPadding=function(t){return arguments.length?(C=+t,r):C},r.tickSubdivide=function(t){return arguments.length?(L=+t,r):L},r};var ke="bottom",Ee={top:1,right:1,bottom:1,left:1};function Ne(t,n){t.attr("transform",function(t){return"translate("+n(t)+",0)"})}function Ae(t,n){t.attr("transform",function(t){return"translate(0,"+n(t)+")"})}F.svg.brush=function(){var y,M=tt(w,"brushstart","brush","brushend"),b=null,x=null,o=qe[0],_=[[0,0],[0,0]];function w(t){t.each(function(){var t,n=F.select(this),e=n.selectAll(".background").data([0]),r=n.selectAll(".extent").data([0]),i=n.selectAll(".resize").data(o,String);n.style("pointer-events","all").on("mousedown.brush",u).on("touchstart.brush",u),e.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),r.enter().append("rect").attr("class","extent").style("cursor","move"),i.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Te[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),i.style("display",w.empty()?"none":null),i.exit().remove(),b&&(t=Tn(b),e.attr("x",t[0]).attr("width",t[1]-t[0]),k(n)),x&&(t=Tn(x),e.attr("y",t[0]).attr("height",t[1]-t[0]),E(n)),S(n)})}function S(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+_[+/e$/.test(t)][0]+","+_[+/^s/.test(t)][1]+")"})}function k(t){t.select(".extent").attr("x",_[0][0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",_[1][0]-_[0][0])}function E(t){t.select(".extent").attr("y",_[0][1]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",_[1][1]-_[0][1])}function u(){var f,e,n=this,t=F.select(F.event.target),r=M.of(n,arguments),i=F.select(n),o=t.datum(),u=!/^(n|s)$/.test(o)&&b,a=!/^(e|w)$/.test(o)&&x,s=t.classed("extent"),h=p(),c=F.select(N).on("mousemove.brush",d).on("mouseup.brush",m).on("touchmove.brush",d).on("touchend.brush",m).on("keydown.brush",function(){32==F.event.keyCode&&(s||(f=null,h[0]-=_[1][0],h[1]-=_[1][1],s=2),W())}).on("keyup.brush",function(){32==F.event.keyCode&&2==s&&(h[0]+=_[1][0],h[1]+=_[1][1],s=0,W())});if(s)h[0]=_[0][0]-h[0],h[1]=_[0][1]-h[1];else if(o){var l=+/w$/.test(o),g=+/^n/.test(o);e=[_[1-l][0]-h[0],_[1-g][1]-h[1]],h[0]=_[l][0],h[1]=_[g][1]}else F.event.altKey&&(f=h.slice());function p(){var t=F.event.changedTouches;return t?F.touches(n,t)[0]:F.mouse(n)}function d(){var t=p(),n=!1;e&&(t[0]+=e[0],t[1]+=e[1]),s||(F.event.altKey?(f||(f=[(_[0][0]+_[1][0])/2,(_[0][1]+_[1][1])/2]),h[0]=_[+(t[0]<f[0])][0],h[1]=_[+(t[1]<f[1])][1]):f=null),u&&v(t,b,0)&&(k(i),n=!0),a&&v(t,x,1)&&(E(i),n=!0),n&&(S(i),r({type:"brush",mode:s?"move":"resize"}))}function v(t,n,e){var r,i,o=Tn(n),u=o[0],a=o[1],c=h[e],l=_[1][e]-_[0][e];if(s&&(u-=c,a-=l+c),r=Math.max(u,Math.min(a,t[e])),s?i=(r+=c)+l:(f&&(c=Math.max(u,Math.min(a,2*f[e]-r))),c<r?(i=r,r=c):i=c),_[0][e]!==r||_[1][e]!==i)return y=null,_[0][e]=r,_[1][e]=i,!0}function m(){d(),i.style("pointer-events","all").selectAll(".resize").style("display",w.empty()?"none":null),F.select("body").style("cursor",null),c.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),r({type:"brushend"}),W()}i.style("pointer-events","none").selectAll(".resize").style("display",null),F.select("body").style("cursor",t.style("cursor")),r({type:"brushstart"}),d(),W()}return w.x=function(t){return arguments.length?(o=qe[!(b=t)<<1|!x],w):b},w.y=function(t){return arguments.length?(o=qe[!b<<1|!(x=t)],w):x},w.extent=function(t){var n,e,r,i,o;return arguments.length?(y=[[0,0],[0,0]],b&&(n=t[0],e=t[1],x&&(n=n[0],e=e[0]),y[0][0]=n,y[1][0]=e,b.invert&&(n=b(n),e=b(e)),e<n&&(o=n,n=e,e=o),_[0][0]=0|n,_[1][0]=0|e),x&&(r=t[0],i=t[1],b&&(r=r[1],i=i[1]),y[0][1]=r,y[1][1]=i,x.invert&&(r=x(r),i=x(i)),i<r&&(o=r,r=i,i=o),_[0][1]=0|r,_[1][1]=0|i),w):(t=y||_,b&&(n=t[0][0],e=t[1][0],y||(n=_[0][0],e=_[1][0],b.invert&&(n=b.invert(n),e=b.invert(e)),e<n&&(o=n,n=e,e=o))),x&&(r=t[0][1],i=t[1][1],y||(r=_[0][1],i=_[1][1],x.invert&&(r=x.invert(r),i=x.invert(i)),i<r&&(o=r,r=i,i=o))),b&&x?[[n,r],[e,i]]:b?[n,e]:x&&[r,i])},w.clear=function(){return y=null,_[0][0]=_[0][1]=_[1][0]=_[1][1]=0,w},w.empty=function(){return b&&_[0][0]===_[1][0]||x&&_[0][1]===_[1][1]},F.rebind(w,M,"on")};var Te={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},qe=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];F.behavior={},F.behavior.drag=function(){var s=tt(n,"drag","dragstart","dragend"),h=null;function n(){this.on("mousedown.drag",t).on("touchstart.drag",t)}function t(){var r,i=this,o=s.of(i,arguments),t=F.event.target,n=F.event.touches?F.event.changedTouches[0].identifier:null,u=c(),a=0,e=F.select(N).on(null!=n?"touchmove.drag-"+n:"mousemove.drag",function(){if(!i.parentNode)return l();var t=c(),n=t[0]-u[0],e=t[1]-u[1];a|=n|e,u=t,W(),o({type:"drag",x:t[0]+r[0],y:t[1]+r[1],dx:n,dy:e})}).on(null!=n?"touchend.drag-"+n:"mouseup.drag",l,!0);function c(){var t=i.parentNode;return null!=n?F.touches(t).filter(function(t){return t.identifier===n})[0]:F.mouse(t)}function l(){o({type:"dragend"}),a&&(W(),F.event.target===t&&e.on("click.drag",f,!0)),e.on(null!=n?"touchmove.drag-"+n:"mousemove.drag",null).on(null!=n?"touchend.drag-"+n:"mouseup.drag",null)}function f(){W(),e.on("click.drag",null)}r=h?[(r=h.apply(i,arguments)).x-u[0],r.y-u[1]]:[0,0],null==n&&W(),o({type:"dragstart"})}return n.origin=function(t){return arguments.length?(h=t,n):h},F.rebind(n,s,"on")},F.behavior.zoom=function(){var o,u,n,e,r,i,a,c=[0,0],l=1,f=ze,s=tt(h,"zoom");function h(){this.on("mousedown.zoom",t).on("mousemove.zoom",M).on(De+".zoom",y).on("dblclick.zoom",b).on("touchstart.zoom",x).on("touchmove.zoom",_).on("touchend.zoom",x)}function g(t){return[(t[0]-c[0])/l,(t[1]-c[1])/l]}function p(t){l=Math.max(f[0],Math.min(f[1],t))}function d(t,n){var e;n=[(e=n)[0]*l+c[0],e[1]*l+c[1]],c[0]+=t[0]-n[0],c[1]+=t[1]-n[1]}function v(){e&&e.domain(n.range().map(function(t){return(t-c[0])/l}).map(n.invert)),i&&i.domain(r.range().map(function(t){return(t-c[1])/l}).map(r.invert))}function m(t){v(),F.event.preventDefault(),t({type:"zoom",scale:l,translate:c})}function t(){var t=this,n=s.of(t,arguments),e=F.event.target,r=0,i=F.select(N).on("mousemove.zoom",function(){r=1,d(F.mouse(t),o),m(n)}).on("mouseup.zoom",function(){r&&W();i.on("mousemove.zoom",null).on("mouseup.zoom",null),r&&F.event.target===e&&i.on("click.zoom",u,!0)}),o=g(F.mouse(t));function u(){W(),i.on("click.zoom",null)}N.focus(),W()}function y(){o||(o=g(F.mouse(this))),p(Math.pow(2,.002*Ce())*l),d(F.mouse(this),o),m(s.of(this,arguments))}function M(){o=null}function b(){var t=F.mouse(this),n=g(t),e=Math.log(l)/Math.LN2;p(Math.pow(2,F.event.shiftKey?Math.ceil(e)-1:Math.floor(e)+1)),d(t,n),m(s.of(this,arguments))}function x(){var t=F.touches(this),n=Date.now();if(u=l,o={},t.forEach(function(t){o[t.identifier]=g(t)}),W(),1===t.length){if(n-a<500){var e=t[0],r=g(t[0]);p(2*l),d(e,r),m(s.of(this,arguments))}a=n}}function _(){var t=F.touches(this),n=t[0],e=o[n.identifier];if(r=t[1]){var r,i=o[r.identifier];n=[(n[0]+r[0])/2,(n[1]+r[1])/2],e=[(e[0]+i[0])/2,(e[1]+i[1])/2],p(F.event.scale*u)}d(n,e),a=null,m(s.of(this,arguments))}return h.translate=function(t){return arguments.length?(c=t.map(Number),v(),h):c},h.scale=function(t){return arguments.length?(l=+t,v(),h):l},h.scaleExtent=function(t){return arguments.length?(f=null==t?ze:t.map(Number),h):f},h.x=function(t){return arguments.length?(n=(e=t).copy(),c=[0,0],l=1,h):e},h.y=function(t){return arguments.length?(r=(i=t).copy(),c=[0,0],l=1,h):i},F.rebind(h,s,"on")};var Ce,ze=[0,1/0],De="onwheel"in document?(Ce=function(){return-F.event.deltaY*(F.event.deltaMode?120:1)},"wheel"):"onmousewheel"in document?(Ce=function(){return F.event.wheelDelta},"mousewheel"):(Ce=function(){return-F.event.detail},"MozMousePixelScroll");function Le(t){for(var n=t.source,e=t.target,r=function(t,n){if(t===n)return t;var e=Fe(t),r=Fe(n),i=e.pop(),o=r.pop(),u=null;for(;i===o;)u=i,i=e.pop(),o=r.pop();return u}(n,e),i=[n];n!==r;)n=n.parent,i.push(n);for(var o=i.length;e!==r;)i.splice(o,0,e),e=e.parent;return i}function Fe(t){for(var n=[],e=t.parent;null!=e;)n.push(t),e=(t=e).parent;return n.push(t),n}function He(t){t.fixed|=2}function je(t){t.fixed&=-7}function Pe(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Re(t){t.fixed&=-5}F.layout={},F.layout.bundle=function(){return function(t){for(var n=[],e=-1,r=t.length;++e<r;)n.push(Le(t[e]));return n}},F.layout.chord=function(){var v,m,y,M,b,x,_,n={},w=0;function t(){var t,n,e,r,i,o={},u=[],a=F.range(M),c=[];for(v=[],m=[],t=0,r=-1;++r<M;){for(n=0,i=-1;++i<M;)n+=y[r][i];u.push(n),c.push(F.range(M)),t+=n}for(b&&a.sort(function(t,n){return b(u[t],u[n])}),x&&c.forEach(function(t,e){t.sort(function(t,n){return x(y[e][t],y[e][n])})}),t=(2*k-w*M)/t,n=0,r=-1;++r<M;){for(e=n,i=-1;++i<M;){var l=a[r],f=c[l][i],s=y[l][f],h=n,g=n+=s*t;o[l+"-"+f]={index:l,subindex:f,startAngle:h,endAngle:g,value:s}}m[l]={index:l,startAngle:e,endAngle:n,value:(n-e)/t},n+=w}for(r=-1;++r<M;)for(i=r-1;++i<M;){var p=o[r+"-"+i],d=o[i+"-"+r];(p.value||d.value)&&v.push(p.value<d.value?{source:d,target:p}:{source:p,target:d})}_&&S()}function S(){v.sort(function(t,n){return _((t.source.value+t.target.value)/2,(n.source.value+n.target.value)/2)})}return n.matrix=function(t){return arguments.length?(M=(y=t)&&y.length,v=m=null,n):y},n.padding=function(t){return arguments.length?(w=t,v=m=null,n):w},n.sortGroups=function(t){return arguments.length?(b=t,v=m=null,n):b},n.sortSubgroups=function(t){return arguments.length?(x=t,v=null,n):x},n.sortChords=function(t){return arguments.length?(_=t,v&&S(),n):_},n.chords=function(){return v||t(),v},n.groups=function(){return m||t(),m},n},F.layout.force=function(){var t,s,h,g,p,i={},d=F.dispatch("start","tick","end"),v=[1,1],m=.9,o=Oe,y=Ye,M=-30,b=.1,l=.8,x=[],_=[];function w(c){return function(t,n,e,r){if(t.point!==c){var i=t.cx-c.x,o=t.cy-c.y,u=1/Math.sqrt(i*i+o*o);if((r-n)*u<l){var a=t.charge*u*u;return c.px-=i*a,c.py-=o*a,!0}if(t.point&&isFinite(u)){a=t.pointCharge*u*u;c.px-=i*a,c.py-=o*a}}return!t.charge}}function n(t){t.px=F.event.x,t.py=F.event.y,i.resume()}return i.tick=function(){if((s*=.99)<.005)return d.end({type:"end",alpha:s=0}),!0;var t,n,e,r,i,o,u,a,c,l=x.length,f=_.length;for(n=0;n<f;++n)r=(e=_[n]).source,(o=(a=(i=e.target).x-r.x)*a+(c=i.y-r.y)*c)&&(a*=o=s*g[n]*((o=Math.sqrt(o))-h[n])/o,c*=o,i.x-=a*(u=r.weight/(i.weight+r.weight)),i.y-=c*u,r.x+=a*(u=1-u),r.y+=c*u);if((u=s*b)&&(a=v[0]/2,c=v[1]/2,n=-1,u))for(;++n<l;)(e=x[n]).x+=(a-e.x)*u,e.y+=(c-e.y)*u;if(M)for(!function t(n,e,r){var i=0,o=0;n.charge=0;if(!n.leaf)for(var u,a=n.nodes,c=a.length,l=-1;++l<c;)null!=(u=a[l])&&(t(u,e,r),n.charge+=u.charge,i+=u.charge*u.cx,o+=u.charge*u.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var f=e*r[n.point.index];n.charge+=n.pointCharge=f,i+=f*n.point.x,o+=f*n.point.y}n.cx=i/n.charge;n.cy=o/n.charge}(t=F.geom.quadtree(x),s,p),n=-1;++n<l;)(e=x[n]).fixed||t.visit(w(e));for(n=-1;++n<l;)(e=x[n]).fixed?(e.x=e.px,e.y=e.py):(e.x-=(e.px-(e.px=e.x))*m,e.y-=(e.py-(e.py=e.y))*m);d.tick({type:"tick",alpha:s})},i.nodes=function(t){return arguments.length?(x=t,i):x},i.links=function(t){return arguments.length?(_=t,i):_},i.size=function(t){return arguments.length?(v=t,i):v},i.linkDistance=function(t){return arguments.length?(o="function"==typeof t?t:+t,i):o},i.distance=i.linkDistance,i.linkStrength=function(t){return arguments.length?(y="function"==typeof t?t:+t,i):y},i.friction=function(t){return arguments.length?(m=+t,i):m},i.charge=function(t){return arguments.length?(M="function"==typeof t?t:+t,i):M},i.gravity=function(t){return arguments.length?(b=+t,i):b},i.theta=function(t){return arguments.length?(l=+t,i):l},i.alpha=function(t){return arguments.length?(t=+t,s?s=0<t?t:0:0<t&&(d.start({type:"start",alpha:s=t}),F.timer(i.tick)),i):s},i.start=function(){var u,a,c,t,l=x.length,f=_.length,n=v[0],e=v[1];for(u=0;u<l;++u)(t=x[u]).index=u,t.weight=0;for(u=0;u<f;++u)"number"==typeof(t=_[u]).source&&(t.source=x[t.source]),"number"==typeof t.target&&(t.target=x[t.target]),++t.source.weight,++t.target.weight;for(u=0;u<l;++u)t=x[u],isNaN(t.x)&&(t.x=r("x",n)),isNaN(t.y)&&(t.y=r("y",e)),isNaN(t.px)&&(t.px=t.x),isNaN(t.py)&&(t.py=t.y);if(h=[],"function"==typeof o)for(u=0;u<f;++u)h[u]=+o.call(this,_[u],u);else for(u=0;u<f;++u)h[u]=o;if(g=[],"function"==typeof y)for(u=0;u<f;++u)g[u]=+y.call(this,_[u],u);else for(u=0;u<f;++u)g[u]=y;if(p=[],"function"==typeof M)for(u=0;u<l;++u)p[u]=+M.call(this,x[u],u);else for(u=0;u<l;++u)p[u]=M;function r(t,n){for(var e,r=function(){if(!c){for(c=[],a=0;a<l;++a)c[a]=[];for(a=0;a<f;++a){var t=_[a];c[t.source.index].push(t.target),c[t.target.index].push(t.source)}}return c[u]}(),i=-1,o=r.length;++i<o;)if(!isNaN(e=r[i][t]))return e;return Math.random()*n}return i.resume()},i.resume=function(){return i.alpha(.1)},i.stop=function(){return i.alpha(0)},i.drag=function(){if(t||(t=F.behavior.drag().origin(S).on("dragstart.force",He).on("drag.force",n).on("dragend.force",je)),!arguments.length)return t;this.on("mouseover.force",Pe).on("mouseout.force",Re).call(t)},F.rebind(i,d,"on")};var Oe=20,Ye=1;F.layout.partition=function(){var r=F.layout.hierarchy(),i=[1,1];function n(t,n){var e=r.call(this,t,n);return function t(n,e,r,i){var o=n.children;if(n.x=e,n.y=n.depth*i,n.dx=r,n.dy=i,o&&(u=o.length)){var u,a,c,l=-1;for(r=n.value?r/n.value:0;++l<u;)t(a=o[l],e,c=a.value*r,i),e+=c}}(e[0],0,i[0],i[1]/function t(n){var e=n.children,r=0;if(e&&(i=e.length))for(var i,o=-1;++o<i;)r=Math.max(r,t(e[o]));return 1+r}(e[0])),e}return n.size=function(t){return arguments.length?(i=t,n):i},er(n,r)},F.layout.pie=function(){var a=Number,c=Ue,n=0,l=2*k;function f(e){var r=e.map(function(t,n){return+a.call(f,t,n)}),i=+("function"==typeof n?n.apply(this,arguments):n),o=(("function"==typeof l?l.apply(this,arguments):l)-n)/F.sum(r),t=F.range(e.length);null!=c&&t.sort(c===Ue?function(t,n){return r[n]-r[t]}:function(t,n){return c(e[t],e[n])});var u=[];return t.forEach(function(t){var n;u[t]={data:e[t],value:n=r[t],startAngle:i,endAngle:i+=n*o}}),u}return f.value=function(t){return arguments.length?(a=t,f):a},f.sort=function(t){return arguments.length?(c=t,f):c},f.startAngle=function(t){return arguments.length?(n=t,f):n},f.endAngle=function(t){return arguments.length?(l=t,f):l},f};var Ue={};function Ie(t){return t.x}function Ve(t){return t.y}function Xe(t,n,e){t.y0=n,t.y=e}F.layout.stack=function(){var s=S,h=$e,g=Je,p=Xe,d=Ie,v=Ve;function m(t,n){var e=t.map(function(t,n){return s.call(m,t,n)}),r=e.map(function(t){return t.map(function(t,n){return[d.call(m,t,n),v.call(m,t,n)]})}),i=h.call(m,r,n);e=F.permute(e,i),r=F.permute(r,i);var o,u,a,c=g.call(m,r,n),l=e.length,f=e[0].length;for(u=0;u<f;++u)for(p.call(m,e[0][u],a=c[u],r[0][u][1]),o=1;o<l;++o)p.call(m,e[o][u],a+=r[o-1][u][1],r[o][u][1]);return t}return m.values=function(t){return arguments.length?(s=t,m):s},m.order=function(t){return arguments.length?(h="function"==typeof t?t:Ze.get(t)||$e,m):h},m.offset=function(t){return arguments.length?(g="function"==typeof t?t:Be.get(t)||Je,m):g},m.x=function(t){return arguments.length?(d=t,m):d},m.y=function(t){return arguments.length?(v=t,m):v},m.out=function(t){return arguments.length?(p=t,m):p},m};var Ze=F.map({"inside-out":function(t){var n,e,r=t.length,i=t.map(Ge),o=t.map(Ke),u=F.range(r).sort(function(t,n){return i[t]-i[n]}),a=0,c=0,l=[],f=[];for(n=0;n<r;++n)e=u[n],a<c?(a+=o[e],l.push(e)):(c+=o[e],f.push(e));return f.reverse().concat(l)},reverse:function(t){return F.range(t.length).reverse()},default:$e}),Be=F.map({silhouette:function(t){var n,e,r,i=t.length,o=t[0].length,u=[],a=0,c=[];for(e=0;e<o;++e){for(r=n=0;n<i;n++)r+=t[n][e][1];a<r&&(a=r),u.push(r)}for(e=0;e<o;++e)c[e]=(a-u[e])/2;return c},wiggle:function(t){var n,e,r,i,o,u,a,c,l,f=t.length,s=t[0],h=s.length,g=[];for(g[0]=c=l=0,e=1;e<h;++e){for(i=n=0;n<f;++n)i+=t[n][e][1];for(o=n=0,a=s[e][0]-s[e-1][0];n<f;++n){for(r=0,u=(t[n][e][1]-t[n][e-1][1])/(2*a);r<n;++r)u+=(t[r][e][1]-t[r][e-1][1])/a;o+=u*t[n][e][1]}g[e]=c-=i?o/i*a:0,c<l&&(l=c)}for(e=0;e<h;++e)g[e]-=l;return g},expand:function(t){var n,e,r,i=t.length,o=t[0].length,u=1/i,a=[];for(e=0;e<o;++e){for(r=n=0;n<i;n++)r+=t[n][e][1];if(r)for(n=0;n<i;n++)t[n][e][1]/=r;else for(n=0;n<i;n++)t[n][e][1]=u}for(e=0;e<o;++e)a[e]=0;return a},zero:Je});function $e(t){return F.range(t.length)}function Je(t){for(var n=-1,e=t[0].length,r=[];++n<e;)r[n]=0;return r}function Ge(t){for(var n,e=1,r=0,i=t[0][1],o=t.length;e<o;++e)(n=t[e][1])>i&&(r=e,i=n);return r}function Ke(t){return t.reduce(We,0)}function We(t,n){return t+n[1]}function Qe(t,n){return tr(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function tr(t,n){for(var e=-1,r=+t[0],i=(t[1]-r)/n,o=[];++e<=n;)o[e]=i*e+r;return o}function nr(t){return[F.min(t),F.max(t)]}function er(t,n){return F.rebind(t,n,"sort","children","value"),(t.nodes=t).links=ur,t}function rr(t){return t.children}function ir(t){return t.value}function or(t,n){return n.value-t.value}function ur(t){return F.merge(t.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function ar(t,n){return t.value-n.value}function cr(t,n){var e=t._pack_next;(t._pack_next=n)._pack_prev=t,(n._pack_next=e)._pack_prev=n}function lr(t,n){(t._pack_next=n)._pack_prev=t}function fr(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r+n.r;return.001<i*i-e*e-r*r}function sr(t){if((n=t.children)&&(c=n.length)){var n,e,r,i,o,u,a,c,l=1/0,f=-1/0,s=1/0,h=-1/0;if(n.forEach(hr),(e=n[0]).x=-e.r,e.y=0,M(e),1<c&&((r=n[1]).x=r.r,r.y=0,M(r),2<c))for(pr(e,r,i=n[2]),M(i),cr(e,i),cr(e._pack_prev=i,r),r=e._pack_next,o=3;o<c;o++){pr(e,r,i=n[o]);var g=0,p=1,d=1;for(u=r._pack_next;u!==r;u=u._pack_next,p++)if(fr(u,i)){g=1;break}if(1==g)for(a=e._pack_prev;a!==u._pack_prev&&!fr(a,i);a=a._pack_prev,d++);g?(p<d||p==d&&r.r<e.r?lr(e,r=u):lr(e=a,r),o--):(cr(e,i),M(r=i))}var v=(l+f)/2,m=(s+h)/2,y=0;for(o=0;o<c;o++)(i=n[o]).x-=v,i.y-=m,y=Math.max(y,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=y,n.forEach(gr)}function M(t){l=Math.min(t.x-t.r,l),f=Math.max(t.x+t.r,f),s=Math.min(t.y-t.r,s),h=Math.max(t.y+t.r,h)}}function hr(t){t._pack_next=t._pack_prev=t}function gr(t){delete t._pack_next,delete t._pack_prev}function pr(t,n,e){var r=t.r+e.r,i=n.x-t.x,o=n.y-t.y;if(r&&(i||o)){var u=n.r+e.r,a=i*i+o*o,c=.5+((r*=r)-(u*=u))/(2*a),l=Math.sqrt(Math.max(0,2*u*(r+a)-(r-=a)*r-u*u))/(2*a);e.x=t.x+c*i+l*o,e.y=t.y+c*o-l*i}else e.x=t.x+r,e.y=t.y}function dr(t,n){return t.parent==n.parent?1:2}function vr(t){var n=t.children;return n&&n.length?n[0]:t._tree.thread}function mr(t){var n,e=t.children;return e&&(n=e.length)?e[n-1]:t._tree.thread}function yr(t,n){var e=t.children;if(e&&(i=e.length))for(var r,i,o=-1;++o<i;)0<n(r=yr(e[o],n),t)&&(t=r);return t}function Mr(t,n){return t.x-n.x}function br(t,n){return n.x-t.x}function xr(t,n){return t.depth-n.depth}function _r(t,c){!function t(n,e){var r=n.children;if(r&&(o=r.length))for(var i,o,u=null,a=-1;++a<o;)t(i=r[a],u),u=i;c(n,e)}(t,null)}function wr(t,n,e){t=t._tree;var r=e/((n=n._tree).number-t.number);t.change+=r,n.change-=r,n.shift+=e,n.prelim+=e,n.mod+=e}function Sr(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function kr(t,n){var e=t.x+n[3],r=t.y+n[0],i=t.dx-n[1]-n[3],o=t.dy-n[0]-n[2];return i<0&&(e+=i/2,i=0),o<0&&(r+=o/2,o=0),{x:e,y:r,dx:i,dy:o}}function Er(n,e){var r=new RegExp('["'+n+"\n]"),h=n.charCodeAt(0);function i(t,n){return F.xhr(t,e,n).response(o)}function o(t){return i.parse(t.responseText)}function u(t){return t.map(a).join(n)}function a(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t){var n;return i.parseRows(t,function(t){if(n)return n(t);n=new Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}")})},i.parseRows=function(i,t){var n,o,u={},a={},e=[],c=i.length,l=0,r=0;function f(){if(c<=l)return a;if(o)return o=!1,u;var t=l;if(34===i.charCodeAt(t)){for(var n=t;n++<c;)if(34===i.charCodeAt(n)){if(34!==i.charCodeAt(n+1))break;++n}return l=n+2,13===(e=i.charCodeAt(n+1))?(o=!0,10===i.charCodeAt(n+2)&&++l):10===e&&(o=!0),i.substring(t+1,n).replace(/""/g,'"')}for(;l<c;){var e,r=1;if(10===(e=i.charCodeAt(l++)))o=!0;else if(13===e)o=!0,10===i.charCodeAt(l)&&(++l,++r);else if(e!==h)continue;return i.substring(t,l-r)}return i.substring(t)}for(;(n=f())!==a;){for(var s=[];n!==u&&n!==a;)s.push(n),n=f();t&&!(s=t(s,r++))||e.push(s)}return e},i.format=function(t){return t.map(u).join("\n")},i}function Nr(t,n){Tr.hasOwnProperty(t.type)&&Tr[t.type](t,n)}F.layout.histogram=function(){var s=!0,h=Number,g=nr,p=Qe;function e(t,n){for(var e,r,i=[],o=t.map(h,this),u=g.call(this,o,n),a=p.call(this,u,o,n),c=(n=-1,o.length),l=a.length-1,f=s?1:1/c;++n<l;)(e=i[n]=[]).dx=a[n+1]-(e.x=a[n]),e.y=0;if(0<l)for(n=-1;++n<c;)(r=o[n])>=u[0]&&r<=u[1]&&((e=i[F.bisect(a,r,1,l)-1]).y+=f,e.push(t[n]));return i}return e.value=function(t){return arguments.length?(h=t,e):h},e.range=function(t){return arguments.length?(g=A(t),e):g},e.bins=function(n){return arguments.length?(p="number"==typeof n?function(t){return tr(t,n)}:A(n),e):p},e.frequency=function(t){return arguments.length?(s=!!t,e):s},e},F.layout.hierarchy=function(){var s=or,h=rr,g=ir;function p(t){var n=[];return function t(n,e,r){var i=h.call(p,n,e);if(n.depth=e,r.push(n),i&&(o=i.length)){for(var o,u,a=-1,c=n.children=[],l=0,f=e+1;++a<o;)(u=t(i[a],f,r)).parent=n,c.push(u),l+=u.value;s&&c.sort(s),g&&(n.value=l)}else g&&(n.value=+g.call(p,n,e)||0);return n}(t,0,n),n}return p.sort=function(t){return arguments.length?(s=t,p):s},p.children=function(t){return arguments.length?(h=t,p):h},p.value=function(t){return arguments.length?(g=t,p):g},p.revalue=function(t){return function t(n,e){var r=n.children,i=0;if(r&&(o=r.length))for(var o,u=-1,a=e+1;++u<o;)i+=t(r[u],a);else g&&(i=+g.call(p,n,e)||0);return g&&(n.value=i),i}(t,0),t},p},F.layout.pack=function(){var c=F.layout.hierarchy().sort(ar),l=0,f=[1,1];function n(t,n){var e=c.call(this,t,n),r=e[0];r.x=0,r.y=0,_r(r,function(t){t.r=Math.sqrt(t.value)}),_r(r,sr);var i=f[0],o=f[1],u=Math.max(2*r.r/i,2*r.r/o);if(0<l){var a=l*u/2;_r(r,function(t){t.r+=a}),_r(r,sr),_r(r,function(t){t.r-=a}),u=Math.max(2*r.r/i,2*r.r/o)}return function t(n,e,r,i){var o=n.children;n.x=e+=i*n.x;n.y=r+=i*n.y;n.r*=i;if(o)for(var u=-1,a=o.length;++u<a;)t(o[u],e,r,i)}(r,i/2,o/2,1/u),e}return n.size=function(t){return arguments.length?(f=t,n):f},n.padding=function(t){return arguments.length?(l=+t,n):l},er(n,c)},F.layout.cluster=function(){var f=F.layout.hierarchy().sort(null).value(null),s=dr,h=[1,1];function n(t,n){var i,e=f.call(this,t,n),r=e[0],o=0;_r(r,function(t){var n,e,r=t.children;r&&r.length?(t.x=(e=r).reduce(function(t,n){return t+n.x},0)/e.length,t.y=(n=r,1+F.max(n,function(t){return t.y}))):(t.x=i?o+=s(t,i):0,t.y=0,i=t)});var u=function t(n){var e=n.children;return e&&e.length?t(e[0]):n}(r),a=function t(n){var e,r=n.children;return r&&(e=r.length)?t(r[e-1]):n}(r),c=u.x-s(u,a)/2,l=a.x+s(a,u)/2;return _r(r,function(t){t.x=(t.x-c)/(l-c)*h[0],t.y=(1-(r.y?t.y/r.y:1))*h[1]}),e}return n.separation=function(t){return arguments.length?(s=t,n):s},n.size=function(t){return arguments.length?(h=t,n):h},er(n,f)},F.layout.tree=function(){var f=F.layout.hierarchy().sort(null).value(null),d=dr,s=[1,1];function n(t,n){var e=f.call(this,t,n),r=e[0];function h(t,n,e){if(n){for(var r,i=t,o=t,u=n,a=t.parent.children[0],c=i._tree.mod,l=o._tree.mod,f=u._tree.mod,s=a._tree.mod;u=mr(u),i=vr(i),u&&i;)a=vr(a),(o=mr(o))._tree.ancestor=t,0<(r=u._tree.prelim+f-i._tree.prelim-c+d(u,i))&&(wr((g=t,p=e,(h=u)._tree.ancestor.parent==g.parent?h._tree.ancestor:p),t,r),c+=r,l+=r),f+=u._tree.mod,c+=i._tree.mod,s+=a._tree.mod,l+=o._tree.mod;u&&!mr(o)&&(o._tree.thread=u,o._tree.mod+=f-l),i&&!vr(a)&&(a._tree.thread=i,a._tree.mod+=c-s,e=t)}var h,g,p;return e}_r(r,function(t,n){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number:n?n._tree.number+1:0}}),function t(n,e){var r=n.children,i=n._tree;if(r&&(o=r.length)){for(var o,u,a,c=r[0],l=c,f=-1;++f<o;)t(a=r[f],u),l=h(a,u,l),u=a;!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;0<=--o;)(n=i[o]._tree).prelim+=e,n.mod+=e,e+=n.shift+(r+=n.change)}(n);var s=.5*(c._tree.prelim+a._tree.prelim);e?(i.prelim=e._tree.prelim+d(n,e),i.mod=i.prelim-s):i.prelim=s}else e&&(i.prelim=e._tree.prelim+d(n,e))}(r),function t(n,e){n.x=n._tree.prelim+e;var r=n.children;if(r&&(i=r.length)){var i,o=-1;for(e+=n._tree.mod;++o<i;)t(r[o],e)}}(r,-r._tree.prelim);var i=yr(r,br),o=yr(r,Mr),u=yr(r,xr),a=i.x-d(i,o)/2,c=o.x+d(o,i)/2,l=u.depth||1;return _r(r,function(t){t.x=(t.x-a)/(c-a)*s[0],t.y=t.depth/l*s[1],delete t._tree}),e}return n.separation=function(t){return arguments.length?(d=t,n):d},n.size=function(t){return arguments.length?(s=t,n):s},er(n,f)},F.layout.treemap=function(){var r,i=F.layout.hierarchy(),f=Math.round,o=[1,1],u=null,s=Sr,a=!1,h="squarify",c=.5*(1+Math.sqrt(5));function g(t,n){for(var e,r,i=-1,o=t.length;++i<o;)r=(e=t[i]).value*(n<0?0:n),e.area=isNaN(r)||r<=0?0:r}function p(t){var n=t.children;if(n&&n.length){var e,r,i,o=s(t),u=[],a=n.slice(),c=1/0,l="slice"===h?o.dx:"dice"===h?o.dy:"slice-dice"===h?1&t.depth?o.dy:o.dx:Math.min(o.dx,o.dy);for(g(a,o.dx*o.dy/t.value),u.area=0;0<(i=a.length);)u.push(e=a[i-1]),u.area+=e.area,c="squarify"!==h||(r=d(u,l))<=c?(a.pop(),r):(u.area-=u.pop().area,v(u,l,o,!1),l=Math.min(o.dx,o.dy),u.length=u.area=0,1/0);u.length&&(v(u,l,o,!0),u.length=u.area=0),n.forEach(p)}}function l(t){var n=t.children;if(n&&n.length){var e,r=s(t),i=n.slice(),o=[];for(g(i,r.dx*r.dy/t.value),o.area=0;e=i.pop();)o.push(e),o.area+=e.area,null!=e.z&&(v(o,e.z?r.dx:r.dy,r,!i.length),o.length=o.area=0);n.forEach(l)}}function d(t,n){for(var e,r=t.area,i=0,o=1/0,u=-1,a=t.length;++u<a;)(e=t[u].area)&&(e<o&&(o=e),i<e&&(i=e));return n*=n,(r*=r)?Math.max(n*i*c/r,r/(n*o*c)):1/0}function v(t,n,e,r){var i,o=-1,u=t.length,a=e.x,c=e.y,l=n?f(t.area/n):0;if(n==e.dx){for((r||l>e.dy)&&(l=e.dy);++o<u;)(i=t[o]).x=a,i.y=c,i.dy=l,a+=i.dx=Math.min(e.x+e.dx-a,l?f(i.area/l):0);i.z=!0,i.dx+=e.x+e.dx-a,e.y+=l,e.dy-=l}else{for((r||l>e.dx)&&(l=e.dx);++o<u;)(i=t[o]).x=a,i.y=c,i.dx=l,c+=i.dy=Math.min(e.y+e.dy-c,l?f(i.area/l):0);i.z=!1,i.dy+=e.y+e.dy-c,e.x+=l,e.dx-=l}}function m(t){var n=r||i(t),e=n[0];return e.x=0,e.y=0,e.dx=o[0],e.dy=o[1],r&&i.revalue(e),g([e],e.dx*e.dy/e.value),(r?l:p)(e),a&&(r=n),n}return m.size=function(t){return arguments.length?(o=t,m):o},m.padding=function(e){if(!arguments.length)return u;function t(t){return kr(t,e)}var n;return s=null==(u=e)?Sr:"function"==(n=typeof e)?function(t){var n=e.call(m,t,t.depth);return null==n?Sr(t):kr(t,"number"==typeof n?[n,n,n,n]:n)}:("number"===n&&(e=[e,e,e,e]),t),m},m.round=function(t){return arguments.length?(f=t?Math.round:Number,m):f!=Number},m.sticky=function(t){return arguments.length?(a=t,r=null,m):a},m.ratio=function(t){return arguments.length?(c=t,m):c},m.mode=function(t){return arguments.length?(h=t+"",m):h},er(m,i)},F.csv=Er(",","text/csv"),F.tsv=Er("\t","text/tab-separated-values"),F.geo={},F.geo.stream=function(t,n){Ar.hasOwnProperty(t.type)?Ar[t.type](t,n):Nr(t,n)};var Ar={Feature:function(t,n){Nr(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)Nr(e[r].geometry,n)}},Tr={Sphere:function(t,n){n.sphere()},Point:function(t,n){var e=t.coordinates;n.point(e[0],e[1])},MultiPoint:function(t,n){for(var e,r=t.coordinates,i=-1,o=r.length;++i<o;)e=r[i],n.point(e[0],e[1])},LineString:function(t,n){qr(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)qr(e[r],n,0)},Polygon:function(t,n){Cr(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)Cr(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)Nr(e[r],n)}};function qr(t,n,e){var r,i=-1,o=t.length-e;for(n.lineStart();++i<o;)r=t[i],n.point(r[0],r[1]);n.lineEnd()}function Cr(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)qr(t[e],n,1);n.polygonEnd()}function zr(t){return[Math.atan2(t[1],t[0]),Math.asin(Math.max(-1,Math.min(1,t[2])))]}function Dr(t,n){return Math.abs(t[0]-n[0])<z&&Math.abs(t[1]-n[1])<z}function Lr(t){var n=t[0],e=t[1],r=Math.cos(e);return[r*Math.cos(n),r*Math.sin(n),Math.sin(e)]}function Fr(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Hr(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function jr(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Pr(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Rr(T){var q=.5,y=16;function n(c){var l,f,s,h,g,p,d={point:t,lineStart:n,lineEnd:m,polygonStart:function(){c.polygonStart(),d.lineStart=e},polygonEnd:function(){c.polygonEnd(),d.lineStart=n}};function t(t,n){t=T(t,n),c.point(t[0],t[1])}function n(){f=NaN,d.point=v,c.lineStart()}function v(t,n){var e=Lr([t,n]),r=T(t,n);C(f,s,l,h,g,p,f=r[0],s=r[1],l=t,h=e[0],g=e[1],p=e[2],y,c),c.point(f,s)}function m(){d.point=t,c.lineEnd()}function e(){var e,r,i,o,u,a;n(),d.point=function(t,n){v(e=t,n),r=f,i=s,o=h,u=g,a=p,d.point=v},d.lineEnd=function(){C(f,s,l,h,g,p,r,i,e,o,u,a,y,c),(d.lineEnd=m)()}}return d}function C(t,n,e,r,i,o,u,a,c,l,f,s,h,g){var p=u-t,d=a-n,v=p*p+d*d;if(4*q<v&&h--){var m=r+l,y=i+f,M=o+s,b=Math.sqrt(m*m+y*y+M*M),x=Math.asin(M/=b),_=Math.abs(Math.abs(M)-1)<z?(e+c)/2:Math.atan2(y,m),w=T(_,x),S=w[0],k=w[1],E=S-t,N=k-n,A=d*E-p*N;(q<A*A/v||.3<Math.abs((p*E+d*N)/v-.5))&&(C(t,n,e,r,i,o,S,k,_,m/=b,y/=b,M,h,g),g.point(S,k),C(S,k,_,m,y,M,u,a,c,l,f,s,h,g))}}return n.precision=function(t){return arguments.length?(y=0<(q=t*t)&&16,n):Math.sqrt(q)},n}function Or(t,n){var e=Math.sin(t),r=(e+Math.sin(n))/2,i=1+e*(2*r-e),o=Math.sqrt(i)/r;function u(t,n){var e=Math.sqrt(i-2*r*Math.sin(n))/r;return[e*Math.sin(t*=r),o-e*Math.cos(t)]}return u.invert=function(t,n){var e=o-n;return[Math.atan2(t,e)/r,Math.asin((i-(t*t+e*e)*r*r)/(2*r))]},u}F.geo.albersUsa=function(){var i=F.geo.albers(),o=F.geo.albers().rotate([160,0]).center([0,60]).parallels([55,65]),u=F.geo.albers().rotate([160,0]).center([0,20]).parallels([8,18]),a=F.geo.albers().rotate([60,0]).center([0,10]).parallels([8,18]);function c(t){return e=(n=t)[0],(50<(r=n[1])?o:e<-140?u:r<21?a:i)(t);var n,e,r}return c.scale=function(t){return arguments.length?(i.scale(t),o.scale(.6*t),u.scale(t),a.scale(1.5*t),c.translate(i.translate())):i.scale()},c.translate=function(t){if(!arguments.length)return i.translate();var n=i.scale(),e=t[0],r=t[1];return i.translate(t),o.translate([e-.4*n,r+.17*n]),u.translate([e-.19*n,r+.2*n]),a.translate([e+.58*n,r+.43*n]),c},c.scale(i.scale())},(F.geo.albers=function(){var n=29.5*b,e=45.5*b,r=Ci(Or),t=r(n,e);return t.parallels=function(t){return arguments.length?r(n=t[0]*b,e=t[1]*b):[n*x,e*x]},t.rotate([98,0]).center([0,38]).scale(1e3)}).raw=Or;var Yr=ji(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(F.geo.azimuthalEqualArea=function(){return qi(Yr)}).raw=Yr;var Ur,Ir,Vr,Xr,Zr,Br=ji(function(t){var n=Math.acos(t);return n&&n/Math.sin(n)},S);function $r(n){var e,r,i,o,u={point:t,lineStart:Nn,lineEnd:Nn,polygonStart:function(){u.lineEnd=a},polygonEnd:function(){u.point=t}};function t(t,n){t<e&&(e=t),i<t&&(i=t),n<r&&(r=n),o<n&&(o=n)}function a(){u.point=u.lineEnd=Nn}return function(t){return o=i=-(e=r=1/0),F.geo.stream(t,n(u)),[[e,r],[i,o]]}}(F.geo.azimuthalEquidistant=function(){return qi(Br)}).raw=Br,F.geo.bounds=$r(S),F.geo.centroid=function(t){var n;if(Ur=Ir=Vr=Xr=Zr=0,F.geo.stream(t,Jr),Ir&&Math.abs(n=Math.sqrt(Vr*Vr+Xr*Xr+Zr*Zr))>z)return[Math.atan2(Xr,Vr)*x,Math.asin(Math.max(-1,Math.min(1,Zr/n)))*x]};var Jr={sphere:function(){Ur<2&&(Ur=2,Ir=Vr=Xr=Zr=0)},point:Gr,lineStart:Wr,lineEnd:Qr,polygonStart:function(){Ur<2&&(Ur=2,Ir=Vr=Xr=Zr=0),Jr.lineStart=Kr},polygonEnd:function(){Jr.lineStart=Wr}};function Gr(t,n){if(!Ur){++Ir,t*=b;var e=Math.cos(n*=b);Vr+=(e*Math.cos(t)-Vr)/Ir,Xr+=(e*Math.sin(t)-Xr)/Ir,Zr+=(Math.sin(n)-Zr)/Ir}}function Kr(){var e,r;Ur=1,Wr(),Ur=2;var i=Jr.point;Jr.point=function(t,n){i(e=t,r=n)},Jr.lineEnd=function(){Jr.point(e,r),Qr(),Jr.lineEnd=Qr}}function Wr(){var a,c,l;function r(t,n){t*=b;var e=Math.cos(n*=b),r=e*Math.cos(t),i=e*Math.sin(t),o=Math.sin(n),u=Math.atan2(Math.sqrt((u=c*o-l*i)*u+(u=l*r-a*o)*u+(u=a*i-c*r)*u),a*r+c*i+l*o);Ir+=u,Vr+=u*(a+(a=r)),Xr+=u*(c+(c=i)),Zr+=u*(l+(l=o))}1<Ur||(Ur<1&&(Ur=1,Ir=Vr=Xr=Zr=0),Jr.point=function(t,n){t*=b;var e=Math.cos(n*=b);a=e*Math.cos(t),c=e*Math.sin(t),l=Math.sin(n),Jr.point=r})}function Qr(){Jr.point=Gr}function ti(a,c){var l=Math.cos(a),f=Math.sin(a);return function(t,n,e,r){var i;null!=t?(t=ni(l,t),n=ni(l,n),(0<e?t<n:n<t)&&(t+=2*e*k)):(t=a+2*e*k,n=a);for(var o=e*c,u=t;0<e?n<u:u<n;u-=o)r.point((i=zr([l,-f*Math.cos(u),-f*Math.sin(u)]))[0],i[1])}}function ni(t,n){var e,r,i=Lr(n);i[0]-=t,e=i,r=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=r,e[1]/=r,e[2]/=r;var o=Math.acos(Math.max(-1,Math.min(1,-i[1])));return((-i[2]<0?-o:o)+2*Math.PI-z)%(2*Math.PI)}function ei(M,b,x){return function(u){var a,c,l,f,e=b(u),t={point:n,lineStart:i,lineEnd:o,polygonStart:function(){t.point=v,t.lineStart=m,t.lineEnd=y,f=!1,l=c=0,a=[],u.polygonStart()},polygonEnd:function(){t.point=n,t.lineStart=i,t.lineEnd=o,(a=F.merge(a)).length?function(t,n,e){var u=[],a=[];if(t.forEach(function(t){var n=t.length;if(!(n<=1)){var e=t[0],r=t[n-1],i={point:e,points:t,other:null,visited:!1,entry:!0,subject:!0},o={point:e,points:[e],other:i,visited:!1,entry:!1,subject:!1};i.other=o,u.push(i),a.push(o),o={point:r,points:[r],other:i={point:r,points:[r],other:null,visited:!1,entry:!1,subject:!0},visited:!1,entry:!0,subject:!1},i.other=o,u.push(i),a.push(o)}}),a.sort(ii),ri(u),ri(a),!u.length)return;var r,i,o,c=u[0];for(;;){for(r=c;r.visited;)if((r=r.next)===c)return;i=r.points,e.lineStart();do{if(r.visited=r.other.visited=!0,r.entry){if(r.subject)for(var l=0;l<i.length;l++)e.point((o=i[l])[0],o[1]);else n(r.point,r.next.point,1,e);r=r.next}else{if(r.subject)for(var l=(i=r.prev.points).length;0<=--l;)e.point((o=i[l])[0],o[1]);else n(r.point,r.prev.point,-1,e);r=r.prev}r=r.other,i=r.points}while(!r.visited);e.lineEnd()}}(a,x,u):(c<-z||f&&l<-z)&&(u.lineStart(),x(null,null,1,u),u.lineEnd()),u.polygonEnd(),a=null},sphere:function(){u.polygonStart(),u.lineStart(),x(null,null,1,u),u.lineEnd(),u.polygonEnd()}};function n(t,n){M(t,n)&&u.point(t,n)}function r(t,n){e.point(t,n)}function i(){t.point=r,e.lineStart()}function o(){t.point=n,e.lineEnd()}var s,h,g,p=(g=[],{lineStart:function(){g.push(h=[])},point:function(t,n){h.push([t,n])},lineEnd:Nn,buffer:function(){var t=g;return g=[],h=null,t}}),d=b(p);function v(t,n){d.point(t,n),s.push([t,n])}function m(){d.lineStart(),s=[]}function y(){v(s[0][0],s[0][1]),d.lineEnd();var t,n=d.clean(),e=p.buffer();if(!(i=e.length))return f=!0,l+=ui(s,-1),void(s=null);if(s=null,1&n){t=e[0],c+=ui(t,1);var r,i=t.length-1,o=-1;for(u.lineStart();++o<i;)u.point((r=t[o])[0],r[1]);u.lineEnd()}else 1<i&&2&n&&e.push(e.pop().concat(e.shift())),a.push(e.filter(oi))}return t}}function ri(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r<n;)i.next=e=t[r],e.prev=i,i=e;i.next=e=t[0],e.prev=i}}function ii(t,n){return((t=t.point)[0]<0?t[1]-k/2-z:k/2-t[1])-((n=n.point)[0]<0?n[1]-k/2-z:k/2-n[1])}function oi(t){return 1<t.length}function ui(t,n){if(!(e=t.length))return 0;for(var e,r,i,o=0,u=0,a=t[0],c=a[0],l=a[1],f=Math.cos(l),s=Math.atan2(n*Math.sin(c)*f,Math.sin(l)),h=1-n*Math.cos(c)*f,g=s;++o<e;)a=t[o],f=Math.cos(l=a[1]),r=Math.atan2(n*Math.sin(c=a[0])*f,Math.sin(l)),i=1-n*Math.cos(c)*f,Math.abs(h-2)<z&&Math.abs(i-2)<z||(Math.abs(i)<z||Math.abs(h)<z||(Math.abs(Math.abs(r-s)-k)<z?2<i+h&&(u+=4*(r-s)):Math.abs(h-2)<z?u+=4*(r-g):u+=((3*k+r-s)%(2*k)-k)*(h+i)),g=s,s=r,h=i);return u}F.geo.circle=function(){var n,i,o=[0,0],e=6;function r(){var t="function"==typeof o?o.apply(this,arguments):o,e=zi(-t[0]*b,-t[1]*b,0).invert,r=[];return i(null,null,1,{point:function(t,n){r.push(t=e(t,n)),t[0]*=x,t[1]*=x}}),{type:"Polygon",coordinates:[r]}}return r.origin=function(t){return arguments.length?(o=t,r):o},r.angle=function(t){return arguments.length?(i=ti((n=+t)*b,e*b),r):n},r.precision=function(t){return arguments.length?(i=ti(n*b,(e=+t)*b),r):e},r.angle(90)};var ai=ei(E,function(s){var h,g=NaN,p=NaN,d=NaN;return{lineStart:function(){s.lineStart(),h=1},point:function(t,n){var e,r,i,o,u,a,c,l=0<t?k:-k,f=Math.abs(t-g);Math.abs(f-k)<z?(s.point(g,p=0<(p+n)/2?k/2:-k/2),s.point(d,p),s.lineEnd(),s.lineStart(),s.point(l,p),s.point(t,p),h=0):d!==l&&k<=f&&(Math.abs(g-d)<z&&(g-=d*z),Math.abs(t-l)<z&&(t-=l*z),e=g,r=p,i=t,o=n,c=Math.sin(e-i),p=Math.abs(c)>z?Math.atan((Math.sin(r)*(a=Math.cos(o))*Math.sin(i)-Math.sin(o)*(u=Math.cos(r))*Math.sin(e))/(u*a*c)):(r+o)/2,s.point(d,p),s.lineEnd(),s.lineStart(),s.point(l,p),h=0),s.point(g=t,p=n),d=l},lineEnd:function(){s.lineEnd(),g=p=NaN},clean:function(){return 2-h}}},function(t,n,e,r){var i;if(null==t)i=e*k/2,r.point(-k,i),r.point(0,i),r.point(k,i),r.point(k,0),r.point(k,-i),r.point(0,-i),r.point(-k,-i),r.point(-k,0),r.point(-k,i);else if(Math.abs(t[0]-n[0])>z){var o=(t[0]<n[0]?1:-1)*k;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(n[0],n[1])});function ci(e,r){function t(t,n){return t=e(t,n),r(t[0],t[1])}return e.invert&&r.invert&&(t.invert=function(t,n){return(t=r.invert(t,n))&&e.invert(t[0],t[1])}),t}function li(t,n){return[t,n]}(F.geo.equirectangular=function(){return qi(li).scale(250/k)}).raw=li.invert=li;var fi=ji(function(t){return 1/t},Math.atan);function si(t,n){return[t/(2*k),Math.max(-.5,Math.min(.5,Math.log(Math.tan(k/4+n/2))/(2*k)))]}(F.geo.gnomonic=function(){return qi(fi)}).raw=fi,F.geo.graticule=function(){var l,f,s,h,g,p,n=22.5,e=n,d=2.5;function v(){return{type:"MultiLineString",coordinates:t()}}function t(){return F.range(Math.ceil(f/n)*n,l,n).map(g).concat(F.range(Math.ceil(h/e)*e,s,e).map(p))}return v.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},v.outline=function(){return{type:"Polygon",coordinates:[g(f).concat(p(s).slice(1),g(l).reverse().slice(1),p(h).reverse().slice(1))]}},v.extent=function(t){return arguments.length?(f=+t[0][0],l=+t[1][0],h=+t[0][1],s=+t[1][1],l<f&&(t=f,f=l,l=t),s<h&&(t=h,h=s,s=t),v.precision(d)):[[f,h],[l,s]]},v.step=function(t){return arguments.length?(n=+t[0],e=+t[1],v):[n,e]},v.precision=function(t){return arguments.length?(n=h,e=s,r=d=+t,i=F.range(n,e-z,r).concat(e),g=function(n){return i.map(function(t){return[n,t]})},o=f,u=l,a=d,c=F.range(o,u-z,a).concat(u),p=function(n){return c.map(function(t){return[t,n]})},v):d;var n,e,r,i,o,u,a,c},v.extent([[-180+z,-90+z],[180-z,90-z]])},F.geo.interpolate=function(t,n){return function(t,n,e,r){var i=Math.cos(n),u=Math.sin(n),o=Math.cos(r),a=Math.sin(r),c=i*Math.cos(t),l=i*Math.sin(t),f=o*Math.cos(e),s=o*Math.sin(e),h=Math.acos(Math.max(-1,Math.min(1,u*a+i*o*Math.cos(e-t)))),g=1/Math.sin(h);function p(t){var n=Math.sin(t*=h)*g,e=Math.sin(h-t)*g,r=e*c+n*f,i=e*l+n*s,o=e*u+n*a;return[Math.atan2(i,r)/b,Math.atan2(o,Math.sqrt(r*r+i*i))/b]}return p.distance=h,p}(t[0]*b,t[1]*b,n[0]*b,n[1]*b)},F.geo.greatArc=function(){var u,a,c,l=e,f=t,s=6*b;function n(){for(var t=u||l.apply(this,arguments),n=a||f.apply(this,arguments),e=c||F.geo.interpolate(t,n),r=0,i=s/e.distance,o=[t];(r+=i)<1;)o.push(e(r));return o.push(n),{type:"LineString",coordinates:o}}return n.distance=function(){return(c||F.geo.interpolate(u||l.apply(this,arguments),a||f.apply(this,arguments))).distance},n.source=function(t){return arguments.length?(c=(u="function"==typeof(l=t)?null:t)&&a?F.geo.interpolate(u,a):null,n):l},n.target=function(t){return arguments.length?(a="function"==typeof(f=t)?null:t,c=u&&a?F.geo.interpolate(u,a):null,n):f},n.precision=function(t){return arguments.length?(s=t*b,n):s/b},n},si.invert=function(t,n){return[2*k*t,2*Math.atan(Math.exp(2*k*n))-k/2]},(F.geo.mercator=function(){return qi(si).scale(500)}).raw=si;var hi=ji(function(){return 1},Math.asin);function gi(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function pi(){var e=gi(4.5),r=[],i={point:t,lineStart:function(){i.point=n},lineEnd:u,polygonStart:function(){i.lineEnd=a},polygonEnd:function(){i.lineEnd=u,i.point=t},pointRadius:function(t){return e=gi(t),i},result:function(){if(r.length){var t=r.join("");return r=[],t}}};function t(t,n){r.push("M",t,",",n,e)}function n(t,n){r.push("M",t,",",n),i.point=o}function o(t,n){r.push("L",t,",",n)}function u(){i.point=t}function a(){r.push("Z")}return i}function di(e){var r=4.5,i={point:t,lineStart:function(){i.point=n},lineEnd:u,polygonStart:function(){i.lineEnd=a},polygonEnd:function(){i.lineEnd=u,i.point=t},pointRadius:function(t){return r=t,i},result:Nn};function t(t,n){e.moveTo(t,n),e.arc(t,n,r,0,2*k)}function n(t,n){e.moveTo(t,n),i.point=o}function o(t,n){e.lineTo(t,n)}function u(){i.point=t}function a(){e.closePath()}return i}(F.geo.orthographic=function(){return qi(hi)}).raw=hi,F.geo.path=function(){var r,n,i,e,o=4.5;function u(t){return t&&F.geo.stream(t,i(e.pointRadius("function"==typeof o?+o.apply(this,arguments):o))),e.result()}return u.area=function(t){return vi=0,F.geo.stream(t,i(yi)),vi},u.centroid=function(t){return Ur=Vr=Xr=Zr=0,F.geo.stream(t,i(wi)),Zr?[Vr/Zr,Xr/Zr]:void 0},u.bounds=function(t){return $r(i)(t)},u.projection=function(t){return arguments.length?(i=(r=t)?t.stream||(e=t,n=Rr(function(t,n){return e([t*x,n*x])}),function(e){return e=n(e),{point:function(t,n){e.point(t*b,n*b)},sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}):S,u):r;var e,n},u.context=function(t){return arguments.length?(e=null==(n=t)?new pi:new di(t),u):n},u.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:+t,u):o},u.projection(F.geo.albersUsa()).context(null)};var vi,mi,yi={point:Nn,lineStart:Nn,lineEnd:Nn,polygonStart:function(){mi=0,yi.lineStart=Mi},polygonEnd:function(){yi.lineStart=yi.lineEnd=yi.point=Nn,vi+=Math.abs(mi/2)}};function Mi(){var e,r,i,o;function u(t,n){mi+=o*t-i*n,i=t,o=n}yi.point=function(t,n){yi.point=u,e=i=t,r=o=n},yi.lineEnd=function(){u(e,r)}}var bi,xi,_i,wi={point:Si,lineStart:ki,lineEnd:Ei,polygonStart:function(){wi.lineStart=Ni},polygonEnd:function(){wi.point=Si,wi.lineStart=ki,wi.lineEnd=Ei}};function Si(t,n){Ur||(Vr+=t,Xr+=n,++Zr)}function ki(){var o,u;if(1!==Ur){if(!(Ur<1))return;Ur=1,Vr=Xr=Zr=0}function e(t,n){var e=t-o,r=n-u,i=Math.sqrt(e*e+r*r);Vr+=i*(o+t)/2,Xr+=i*(u+n)/2,Zr+=i,o=t,u=n}wi.point=function(t,n){wi.point=e,o=t,u=n}}function Ei(){wi.point=Si}function Ni(){var e,r,i,o;function u(t,n){var e=o*t-i*n;Vr+=e*(i+t),Xr+=e*(o+n),Zr+=3*e,i=t,o=n}Ur<2&&(Ur=2,Vr=Xr=Zr=0),wi.point=function(t,n){wi.point=u,e=i=t,r=o=n},wi.lineEnd=function(){u(e,r)}}F.geo.area=function(t){return bi=0,F.geo.stream(t,Ai),bi};var Ai={sphere:function(){bi+=4*k},point:Nn,lineStart:Nn,lineEnd:Nn,polygonStart:function(){xi=1,_i=0,Ai.lineStart=Ti},polygonEnd:function(){var t=2*Math.atan2(_i,xi);bi+=t<0?4*k+t:t,Ai.lineStart=Ai.lineEnd=Ai.point=Nn}};function Ti(){var e,r,f,s,h;function i(t,n){n=n*b/2+k/4;var e=(t*=b)-f,r=Math.cos(n),i=Math.sin(n),o=h*i,u=xi,a=_i,c=s*r+o*Math.cos(e),l=o*Math.sin(e);xi=u*c-a*l,_i=a*c+u*l,f=t,s=r,h=i}Ai.point=function(t,n){Ai.point=i,f=(e=t)*b,s=Math.cos(n=(r=n)*b/2+k/4),h=Math.sin(n)},Ai.lineEnd=function(){i(e,r)}}function qi(t){return Ci(function(){return t})()}function Ci(t){var e,n,r,i,o,u=Rr(function(t,n){return[(t=e(t,n))[0]*a+i,o-t[1]*a]}),a=150,c=480,l=250,f=0,s=0,h=0,g=0,p=0,d=ai,v=null;function m(t){return[(t=r(t[0]*b,t[1]*b))[0]*a+i,o-t[1]*a]}function y(t){return(t=r.invert((t[0]-i)/a,(o-t[1])/a))&&[t[0]*x,t[1]*x]}function M(){r=ci(n=zi(h,g,p),e);var t=e(f,s);return i=c-t[0]*a,o=l+t[1]*a,m}return m.stream=function(t){return e=n,r=d(u(t)),{point:function(t,n){n=e(t*b,n*b),t=n[0],r.point(k<t?t-2*k:t<-k?t+2*k:t,n[1])},sphere:function(){r.sphere()},lineStart:function(){r.lineStart()},lineEnd:function(){r.lineEnd()},polygonStart:function(){r.polygonStart()},polygonEnd:function(){r.polygonEnd()}};var e,r},m.clipAngle=function(t){return arguments.length?(d=null==t?(v=t,ai):function(t){var n=t*b,d=Math.cos(n);return ei(f,function(o){var u,a,c,l;return{lineStart:function(){c=a=!1,l=1},point:function(t,n){var e,r=[t,n],i=f(t,n);!u&&(c=a=i)&&o.lineStart(),i!==a&&(e=s(u,r),(Dr(u,e)||Dr(r,e))&&(r[0]+=z,r[1]+=z,i=f(r[0],r[1]))),i!==a&&(l=0,(a=i)?(o.lineStart(),e=s(r,u),o.point(e[0],e[1])):(e=s(u,r),o.point(e[0],e[1]),o.lineEnd()),u=e),!i||u&&Dr(u,r)||o.point(r[0],r[1]),u=r},lineEnd:function(){a&&o.lineEnd(),u=null},clean:function(){return l|(c&&a)<<1}}},ti(n,6*b));function f(t,n){return Math.cos(t)*Math.cos(n)>d}function s(t,n){var e=[1,0,0],r=Hr(Lr(t),Lr(n)),i=Fr(r,r),o=r[0],u=i-o*o;if(!u)return t;var a=d*i/u,c=-d*o/u,l=Hr(e,r),f=Pr(e,a);jr(f,Pr(r,c));var s=l,h=Fr(f,s),g=Fr(s,s),p=Pr(s,(-h-Math.sqrt(h*h-g*(Fr(f,f)-1)))/g);return jr(p,f),zr(p)}}(v=+t),m):v},m.scale=function(t){return arguments.length?(a=+t,M()):a},m.translate=function(t){return arguments.length?(c=+t[0],l=+t[1],M()):[c,l]},m.center=function(t){return arguments.length?(f=t[0]%360*b,s=t[1]%360*b,M()):[f*x,s*x]},m.rotate=function(t){return arguments.length?(h=t[0]%360*b,g=t[1]%360*b,p=2<t.length?t[2]%360*b:0,M()):[h*x,g*x,p*x]},F.rebind(m,u,"precision"),function(){return e=t.apply(this,arguments),m.invert=e.invert&&y,M()}}function zi(t,n,e){return t?n||e?ci(Li(t),Fi(n,e)):Li(t):n||e?Fi(n,e):li}function Di(e){return function(t,n){return[k<(t+=e)?t-2*k:t<-k?t+2*k:t,n]}}function Li(t){var n=Di(t);return n.invert=Di(-t),n}function Fi(t,n){var a=Math.cos(t),c=Math.sin(t),l=Math.cos(n),f=Math.sin(n);function e(t,n){var e=Math.cos(n),r=Math.cos(t)*e,i=Math.sin(t)*e,o=Math.sin(n),u=o*a+r*c;return[Math.atan2(i*l-u*f,r*a-o*c),Math.asin(Math.max(-1,Math.min(1,u*l+i*f)))]}return e.invert=function(t,n){var e=Math.cos(n),r=Math.cos(t)*e,i=Math.sin(t)*e,o=Math.sin(n),u=o*l-i*f;return[Math.atan2(i*l+o*f,r*a+u*c),Math.asin(Math.max(-1,Math.min(1,u*a-r*c)))]},e}F.geo.projection=qi,F.geo.projectionMutator=Ci;var Hi=ji(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});function ji(o,u){function t(t,n){var e=Math.cos(t),r=Math.cos(n),i=o(e*r);return[i*r*Math.sin(t),i*Math.sin(n)]}return t.invert=function(t,n){var e=Math.sqrt(t*t+n*n),r=u(e),i=Math.sin(r),o=Math.cos(r);return[Math.atan2(t*i,e*o),Math.asin(e&&n*i/e)]},t}function Pi(t,n,e,r){var i,o,u,a,c,l;return o=(i=r[t])[0],u=i[1],a=(i=r[n])[0],c=i[1],l=(i=r[e])[0],0<(i[1]-u)*(a-o)-(c-u)*(l-o)}function Ri(t,n,e){return(e[0]-n[0])*(t[1]-n[1])<(e[1]-n[1])*(t[0]-n[0])}function Oi(t,n,e,r){var i=t[0],o=e[0],u=n[0]-i,a=r[0]-o,c=t[1],l=e[1],f=n[1]-c,s=r[1]-l,h=(a*(c-l)-s*(i-o))/(s*u-a*f);return[i+h*u,c+h*f]}(F.geo.stereographic=function(){return qi(Hi)}).raw=Hi,F.geom={},F.geom.hull=function(t){if(t.length<3)return[];var n,e,r,i,o,u,a,c,l,f,s=t.length,h=s-1,g=[],p=[],d=0;for(n=1;n<s;++n)t[n][1]<t[d][1]?d=n:t[n][1]==t[d][1]&&(d=t[n][0]<t[d][0]?n:d);for(n=0;n<s;++n)n!==d&&(i=t[n][1]-t[d][1],r=t[n][0]-t[d][0],g.push({angle:Math.atan2(i,r),index:n}));for(g.sort(function(t,n){return t.angle-n.angle}),l=g[0].angle,c=g[0].index,a=0,n=1;n<h;++n)e=g[n].index,l==g[n].angle?(r=t[c][0]-t[d][0],i=t[c][1]-t[d][1],(o=t[e][0]-t[d][0])*o+(u=t[e][1]-t[d][1])*u<=r*r+i*i?g[n].index=-1:(g[a].index=-1,l=g[n].angle,a=n,c=e)):(l=g[n].angle,a=n,c=e);for(p.push(d),e=n=0;n<2;++e)-1!==g[e].index&&(p.push(g[e].index),n++);for(f=p.length;e<h;++e)if(-1!==g[e].index){for(;!Pi(p[f-2],p[f-1],g[e].index,t);)--f;p[f++]=g[e].index}var v=[];for(n=0;n<f;++n)v.push(t[p[n]]);return v},F.geom.polygon=function(f){return f.area=function(){for(var t=0,n=f.length,e=f[n-1][1]*f[0][0]-f[n-1][0]*f[0][1];++t<n;)e+=f[t-1][1]*f[t][0]-f[t-1][0]*f[t][1];return.5*e},f.centroid=function(t){var n,e,r=-1,i=f.length,o=0,u=0,a=f[i-1];for(arguments.length||(t=-1/(6*f.area()));++r<i;)n=a,a=f[r],e=n[0]*a[1]-a[0]*n[1],o+=(n[0]+a[0])*e,u+=(n[1]+a[1])*e;return[o*t,u*t]},f.clip=function(t){for(var n,e,r,i,o,u,a=-1,c=f.length,l=f[c-1];++a<c;){for(n=t.slice(),t.length=0,i=f[a],o=n[(r=n.length)-1],e=-1;++e<r;)Ri(u=n[e],l,i)?(Ri(o,l,i)||t.push(Oi(o,u,l,i)),t.push(u)):Ri(o,l,i)&&t.push(Oi(o,u,l,i)),o=u;l=i}return t},f},F.geom.voronoi=function(m){var l=m.map(function(){return[]}),y=1e6;return Ui(m,function(t){var n,e,r,i,o,u;e=1===t.a&&0<=t.b?(n=t.ep.r,t.ep.l):(n=t.ep.l,t.ep.r),1===t.a?(o=n?n.y:-y,r=t.c-t.b*o,u=e?e.y:y,i=t.c-t.b*u):(r=n?n.x:-y,o=t.c-t.a*r,i=e?e.x:y,u=t.c-t.a*i);var a=[r,o],c=[i,u];l[t.region.l.index].push(a,c),l[t.region.r.index].push(a,c)}),(l=l.map(function(n,t){var e=m[t][0],r=m[t][1],i=n.map(function(t){return Math.atan2(t[0]-e,t[1]-r)}),o=F.range(n.length).sort(function(t,n){return i[t]-i[n]});return o.filter(function(t,n){return!n||i[t]-i[o[n-1]]>z}).map(function(t){return n[t]})})).forEach(function(t,n){var e=t.length;if(!e)return t.push([-y,-y],[-y,y],[y,y],[y,-y]);if(!(2<e)){var r=m[n],i=t[0],o=t[1],u=r[0],a=r[1],c=i[0],l=i[1],f=o[0],s=o[1],h=Math.abs(f-c),g=s-l;if(Math.abs(g)<z){var p=a<l?-y:y;t.push([-y,p],[y,p])}else if(h<z){var d=u<c?-y:y;t.push([d,-y],[d,y])}else{p=(f-c)*(l-a)<(c-u)*(s-l)?y:-y;var v=Math.abs(g)-h;Math.abs(v)<z?t.push([g<0?p:-p,p]):(0<v&&(p*=-1),t.push([-y,p],[y,p]))}}}),l};var Yi={l:"r",r:"l"};function Ui(t,r){var n={list:t.map(function(t,n){return{index:n,x:t[0],y:t[1]}}).sort(function(t,n){return t.y<n.y?-1:t.y>n.y?1:t.x<n.x?-1:t.x>n.x?1:0}),bottomSite:null},e={list:[],leftEnd:null,rightEnd:null,init:function(){e.leftEnd=e.createHalfEdge(null,"l"),e.rightEnd=e.createHalfEdge(null,"l"),e.leftEnd.r=e.rightEnd,e.rightEnd.l=e.leftEnd,e.list.unshift(e.leftEnd,e.rightEnd)},createHalfEdge:function(t,n){return{edge:t,side:n,vertex:null,l:null,r:null}},insert:function(t,n){n.l=t,n.r=t.r,t.r.l=n,t.r=n},leftBound:function(t){for(var n=e.leftEnd;(n=n.r)!=e.rightEnd&&i.rightOf(n,t););return n=n.l},del:function(t){t.l.r=t.r,t.r.l=t.l,t.edge=null},right:function(t){return t.r},left:function(t){return t.l},leftRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[Yi[t.side]]}},i={bisect:function(t,n){var e={region:{l:t,r:n},ep:{l:null,r:null}},r=n.x-t.x,i=n.y-t.y,o=0<r?r:-r,u=0<i?i:-i;return e.c=t.x*r+t.y*i+.5*(r*r+i*i),u<o?(e.a=1,e.b=i/r,e.c/=r):(e.b=1,e.a=r/i,e.c/=i),e},intersect:function(t,n){var e=t.edge,r=n.edge;if(!e||!r||e.region.r==r.region.r)return null;var i=e.a*r.b-e.b*r.a;if(Math.abs(i)<1e-10)return null;var o,u=(e.c*r.b-r.c*e.b)/i,a=(r.c*e.a-e.c*r.a)/i,c=e.region.r,l=r.region.r,f=u>=(c.y<l.y||c.y==l.y&&c.x<l.x?(o=t,e):(o=n,r)).region.r.x;return f&&"l"===o.side||!f&&"r"===o.side?null:{x:u,y:a}},rightOf:function(t,n){var e=t.edge,r=e.region.r,i=n.x>r.x;if(i&&"l"===t.side)return 1;if(!i&&"r"===t.side)return 0;if(1===e.a){var o=n.y-r.y,u=n.x-r.x,a=0,c=0;if(!i&&e.b<0||i&&0<=e.b?c=a=o>=e.b*u:(c=n.x+n.y*e.b>e.c,e.b<0&&(c=!c),c||(a=1)),!a){var l=r.x-e.region.l.x;c=e.b*(u*u-o*o)<l*o*(1+2*u/l+e.b*e.b),e.b<0&&(c=!c)}}else{var f=e.c-e.a*n.x,s=n.y-f,h=n.x-r.x,g=f-r.y;c=h*h+g*g<s*s}return"l"===t.side?c:!c},endPoint:function(t,n,e){t.ep[n]=e,t.ep[Yi[n]]&&r(t)},distance:function(t,n){var e=t.x-n.x,r=t.y-n.y;return Math.sqrt(e*e+r*r)}},a={list:[],insert:function(t,n,e){t.vertex=n,t.ystar=n.y+e;for(var r=0,i=a.list,o=i.length;r<o;r++){var u=i[r];if(!(t.ystar>u.ystar||t.ystar==u.ystar&&n.x>u.vertex.x))break}i.splice(r,0,t)},del:function(t){for(var n=0,e=a.list,r=e.length;n<r&&e[n]!=t;++n);e.splice(n,1)},empty:function(){return 0===a.list.length},nextEvent:function(t){for(var n=0,e=a.list,r=e.length;n<r;++n)if(e[n]==t)return e[n+1];return null},min:function(){var t=a.list[0];return{x:t.vertex.x,y:t.ystar}},extractMin:function(){return a.list.shift()}};e.init(),n.bottomSite=n.list.shift();for(var o,u,c,l,f,s,h,g,p,d,v,m,y,M=n.list.shift();;)if(a.empty()||(o=a.min()),M&&(a.empty()||M.y<o.y||M.y==o.y&&M.x<o.x))u=e.leftBound(M),c=e.right(u),h=e.rightRegion(u),m=i.bisect(h,M),s=e.createHalfEdge(m,"l"),e.insert(u,s),(d=i.intersect(u,s))&&(a.del(u),a.insert(u,d,i.distance(d,M))),u=s,s=e.createHalfEdge(m,"r"),e.insert(u,s),(d=i.intersect(s,c))&&a.insert(s,d,i.distance(d,M)),M=n.list.shift();else{if(a.empty())break;u=a.extractMin(),l=e.left(u),c=e.right(u),f=e.right(c),h=e.leftRegion(u),g=e.rightRegion(c),v=u.vertex,i.endPoint(u.edge,u.side,v),i.endPoint(c.edge,c.side,v),e.del(u),a.del(c),e.del(c),y="l",h.y>g.y&&(p=h,h=g,g=p,y="r"),m=i.bisect(h,g),s=e.createHalfEdge(m,y),e.insert(l,s),i.endPoint(m,Yi[y],v),(d=i.intersect(l,s))&&(a.del(l),a.insert(l,d,i.distance(d,h))),(d=i.intersect(s,f))&&a.insert(s,d,i.distance(d,h))}for(u=e.right(e.leftEnd);u!=e.rightEnd;u=e.right(u))r(u.edge)}F.geom.delaunay=function(a){var n=a.map(function(){return[]}),c=[];return Ui(a,function(t){n[t.region.l.index].push(a[t.region.r.index])}),n.forEach(function(t,n){var e=a[n],r=e[0],i=e[1];t.forEach(function(t){t.angle=Math.atan2(t[0]-r,t[1]-i)}),t.sort(function(t,n){return t.angle-n.angle});for(var o=0,u=t.length-1;o<u;o++)c.push([e,t[o],t[o+1]])}),c},F.geom.quadtree=function(t,n,e,r,i){var o,u=-1,a=t.length;if(arguments.length<5)if(3===arguments.length)i=e,r=n,e=n=0;else for(n=e=1/0,r=i=-1/0;++u<a;)(o=t[u]).x<n&&(n=o.x),o.y<e&&(e=o.y),o.x>r&&(r=o.x),o.y>i&&(i=o.y);var c=r-n,l=i-e;function s(t,n,e,r,i,o){if(!isNaN(n.x)&&!isNaN(n.y))if(t.leaf){var u=t.point;u?(Math.abs(u.x-n.x)+Math.abs(u.y-n.y)<.01||(t.point=null,f(t,u,e,r,i,o)),f(t,n,e,r,i,o)):t.point=n}else f(t,n,e,r,i,o)}function f(t,n,e,r,i,o){var u=.5*(e+i),a=.5*(r+o),c=n.x>=u,l=n.y>=a,f=(l<<1)+c;t.leaf=!1,c?e=u:i=u,l?r=a:o=a,s(t=t.nodes[f]||(t.nodes[f]={leaf:!0,nodes:[],point:null}),n,e,r,i,o)}l<c?i=e+c:r=n+l;var h={leaf:!0,nodes:[],point:null,add:function(t){s(h,t,n,e,r,i)}};return h.visit=function(t){!function t(n,e,r,i,o,u){if(!n(e,r,i,o,u)){var a=.5*(r+o),c=.5*(i+u),l=e.nodes;l[0]&&t(n,l[0],r,i,a,c),l[1]&&t(n,l[1],a,i,o,c),l[2]&&t(n,l[2],r,c,a,u),l[3]&&t(n,l[3],a,c,o,u)}}(t,h,n,e,r,i)},t.forEach(h.add),h},F.time={};var Ii=Date;function Vi(){this._=new Date(1<arguments.length?Date.UTC.apply(this,arguments):arguments[0])}Vi.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Xi.setUTCDate.apply(this._,arguments)},setDay:function(){Xi.setUTCDay.apply(this._,arguments)},setFullYear:function(){Xi.setUTCFullYear.apply(this._,arguments)},setHours:function(){Xi.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Xi.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Xi.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Xi.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Xi.setUTCSeconds.apply(this._,arguments)},setTime:function(){Xi.setTime.apply(this._,arguments)}};var Xi=Date.prototype,Zi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Bi=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],$i=["January","February","March","April","May","June","July","August","September","October","November","December"],Ji=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Gi(t,n,e,r){for(var i,o,u=0,a=n.length,c=e.length;u<a;){if(c<=r)return-1;if(37===(i=n.charCodeAt(u++))){if(!(o=co[n.charAt(u++)])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function Ki(t){return new RegExp("^(?:"+t.map(F.requote).join("|")+")","i")}function Wi(t){for(var n=new M,e=-1,r=t.length;++e<r;)n.set(t[e].toLowerCase(),e);return n}function Qi(t,n,e){var r=(t+="").length;return r<e?new Array(e-r+1).join(n)+t:t}F.time.format=function(a){var c=a.length;function t(t){for(var n,e,r,i=[],o=-1,u=0;++o<c;)37===a.charCodeAt(o)&&(i.push(a.substring(u,o)),null!=(e=uo[n=a.charAt(++o)])&&(n=a.charAt(++o)),(r=ao[n])&&(n=r(t,null==e?"e"===n?" ":"0":e)),i.push(n),u=o+1);return i.push(a.substring(u,o)),i.join("")}return t.parse=function(t){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0};if(Gi(n,a,t,0)!=t.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var e=new Ii;return e.setFullYear(n.y,n.m,n.d),e.setHours(n.H,n.M,n.S,n.L),e},t.toString=function(){return a},t};var to=Ki(Zi),no=Ki(Bi),eo=Ki($i),ro=Wi($i),io=Ki(Ji),oo=Wi(Ji),uo={"-":"",_:" ",0:"0"},ao={a:function(t){return Bi[t.getDay()]},A:function(t){return Zi[t.getDay()]},b:function(t){return Ji[t.getMonth()]},B:function(t){return $i[t.getMonth()]},c:F.time.format("%a %b %e %X %Y"),d:function(t,n){return Qi(t.getDate(),n,2)},e:function(t,n){return Qi(t.getDate(),n,2)},H:function(t,n){return Qi(t.getHours(),n,2)},I:function(t,n){return Qi(t.getHours()%12||12,n,2)},j:function(t,n){return Qi(1+F.time.dayOfYear(t),n,3)},L:function(t,n){return Qi(t.getMilliseconds(),n,3)},m:function(t,n){return Qi(t.getMonth()+1,n,2)},M:function(t,n){return Qi(t.getMinutes(),n,2)},p:function(t){return 12<=t.getHours()?"PM":"AM"},S:function(t,n){return Qi(t.getSeconds(),n,2)},U:function(t,n){return Qi(F.time.sundayOfYear(t),n,2)},w:function(t){return t.getDay()},W:function(t,n){return Qi(F.time.mondayOfYear(t),n,2)},x:F.time.format("%m/%d/%Y"),X:F.time.format("%H:%M:%S"),y:function(t,n){return Qi(t.getFullYear()%100,n,2)},Y:function(t,n){return Qi(t.getFullYear()%1e4,n,4)},Z:function(t){var n=t.getTimezoneOffset(),e=0<n?"-":"+",r=~~(Math.abs(n)/60),i=Math.abs(n)%60;return e+Qi(r,"0",2)+Qi(i,"0",2)},"%":function(){return"%"}},co={a:function(t,n,e){no.lastIndex=0;var r=no.exec(n.substring(e));return r?e+=r[0].length:-1},A:function(t,n,e){to.lastIndex=0;var r=to.exec(n.substring(e));return r?e+=r[0].length:-1},b:function(t,n,e){io.lastIndex=0;var r=io.exec(n.substring(e));return r?(t.m=oo.get(r[0].toLowerCase()),e+=r[0].length):-1},B:function(t,n,e){eo.lastIndex=0;var r=eo.exec(n.substring(e));return r?(t.m=ro.get(r[0].toLowerCase()),e+=r[0].length):-1},c:function(t,n,e){return Gi(t,ao.c.toString(),n,e)},d:lo,e:lo,H:fo,I:fo,L:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+3));return r?(t.L=+r[0],e+=r[0].length):-1},m:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.m=r[0]-1,e+=r[0].length):-1},M:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.M=+r[0],e+=r[0].length):-1},p:function(t,n,e){var r=ho.get(n.substring(e,e+=2).toLowerCase());return null==r?-1:(t.p=r,e)},S:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.S=+r[0],e+=r[0].length):-1},x:function(t,n,e){return Gi(t,ao.x.toString(),n,e)},X:function(t,n,e){return Gi(t,ao.X.toString(),n,e)},y:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.y=(i=+r[0],i+(68<i?1900:2e3)),e+=r[0].length):-1;var i},Y:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+4));return r?(t.y=+r[0],e+=r[0].length):-1}};function lo(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.d=+r[0],e+=r[0].length):-1}function fo(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.H=+r[0],e+=r[0].length):-1}var so=/^\s*\d+/;var ho=F.map({am:0,pm:1});F.time.format.utc=function(t){var e=F.time.format(t);function n(t){try{var n=new(Ii=Vi);return n._=t,e(n)}finally{Ii=Date}}return n.parse=function(t){try{Ii=Vi;var n=e.parse(t);return n&&n._}finally{Ii=Date}},n.toString=e.toString,n};var go=F.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");function po(t){return t.toISOString()}function vo(r,o,u){function t(t){var n=r(t),e=i(n,1);return t-n<e-t?n:e}function a(t){return o(t=r(new Ii(t-1)),1),t}function i(t,n){return o(t=new Ii(+t),n),t}function c(t,n,e){var r=a(t),i=[];if(1<e)for(;r<n;)u(r)%e||i.push(new Date(+r)),o(r,1);else for(;r<n;)i.push(new Date(+r)),o(r,1);return i}(r.floor=r).round=t,r.ceil=a,r.offset=i,r.range=c;var n=r.utc=mo(r);return(n.floor=n).round=mo(t),n.ceil=mo(a),n.offset=mo(i),n.range=function(t,n,e){try{var r=new(Ii=Vi);return r._=t,c(r,n,e)}finally{Ii=Date}},r}function mo(r){return function(t,n){try{var e=new(Ii=Vi);return e._=t,r(e,n)._}finally{Ii=Date}}}function yo(c,l,t){function f(t){return c(t)}return f.invert=function(t){return Mo(c.invert(t))},f.domain=function(t){return arguments.length?(c.domain(t),f):c.domain().map(Mo)},f.nice=function(t){return f.domain(qn(f.domain(),function(){return t}))},f.ticks=function(t,n){var e,r,i,o=(e=f.domain(),r=e[0],i=e[e.length-1],r<i?[r,i]:[i,r]);if("function"!=typeof t){var u=(o[1]-o[0])/t,a=F.bisect(wo,u);if(a==wo.length)return l.year(o,t);if(!a)return c.ticks(t).map(Mo);Math.log(u/wo[a-1])<Math.log(wo[a]/u)&&--a,n=(t=l[a])[1],t=t[0].range}return t(o[0],new Date(+o[1]+1),n)},f.tickFormat=function(){return t},f.copy=function(){return yo(c.copy(),l,t)},F.rebind(f,c,"range","rangeRound","interpolate","clamp")}function Mo(t){return new Date(t)}function bo(r){return function(t){for(var n=r.length-1,e=r[n];!e[1](t);)e=r[--n];return e[0](t)}}function xo(t){var n=new Date(t,0,1);return n.setFullYear(t),n}function _o(t){var n=t.getFullYear(),e=xo(n);return n+(t-e)/(xo(n+1)-e)}F.time.format.iso=Date.prototype.toISOString?po:go,po.parse=function(t){var n=new Date(t);return isNaN(n)?null:n},po.toString=go.toString,F.time.second=vo(function(t){return new Ii(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(t.getTime()+1e3*Math.floor(n))},function(t){return t.getSeconds()}),F.time.seconds=F.time.second.range,F.time.seconds.utc=F.time.second.utc.range,F.time.minute=vo(function(t){return new Ii(6e4*Math.floor(t/6e4))},function(t,n){t.setTime(t.getTime()+6e4*Math.floor(n))},function(t){return t.getMinutes()}),F.time.minutes=F.time.minute.range,F.time.minutes.utc=F.time.minute.utc.range,F.time.hour=vo(function(t){var n=t.getTimezoneOffset()/60;return new Ii(36e5*(Math.floor(t/36e5-n)+n))},function(t,n){t.setTime(t.getTime()+36e5*Math.floor(n))},function(t){return t.getHours()}),F.time.hours=F.time.hour.range,F.time.hours.utc=F.time.hour.utc.range,F.time.day=vo(function(t){var n=new Ii(1970,0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n},function(t,n){t.setDate(t.getDate()+n)},function(t){return t.getDate()-1}),F.time.days=F.time.day.range,F.time.days.utc=F.time.day.utc.range,F.time.dayOfYear=function(t){var n=F.time.year(t);return Math.floor((t-n-6e4*(t.getTimezoneOffset()-n.getTimezoneOffset()))/864e5)},["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].forEach(function(t,e){t=t.toLowerCase(),e=7-e;var n=F.time[t]=vo(function(t){return(t=F.time.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,n){t.setDate(t.getDate()+7*Math.floor(n))},function(t){var n=F.time.year(t).getDay();return Math.floor((F.time.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});F.time[t+"s"]=n.range,F.time[t+"s"].utc=n.utc.range,F.time[t+"OfYear"]=function(t){var n=F.time.year(t).getDay();return Math.floor((F.time.dayOfYear(t)+(n+e)%7)/7)}}),F.time.week=F.time.sunday,F.time.weeks=F.time.sunday.range,F.time.weeks.utc=F.time.sunday.utc.range,F.time.weekOfYear=F.time.sundayOfYear,F.time.month=vo(function(t){return(t=F.time.day(t)).setDate(1),t},function(t,n){t.setMonth(t.getMonth()+n)},function(t){return t.getMonth()}),F.time.months=F.time.month.range,F.time.months.utc=F.time.month.utc.range,F.time.year=vo(function(t){return(t=F.time.day(t)).setMonth(0,1),t},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t){return t.getFullYear()}),F.time.years=F.time.year.range,F.time.years.utc=F.time.year.utc.range;var wo=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],So=[[F.time.second,1],[F.time.second,5],[F.time.second,15],[F.time.second,30],[F.time.minute,1],[F.time.minute,5],[F.time.minute,15],[F.time.minute,30],[F.time.hour,1],[F.time.hour,3],[F.time.hour,6],[F.time.hour,12],[F.time.day,1],[F.time.day,2],[F.time.week,1],[F.time.month,1],[F.time.month,3],[F.time.year,1]],ko=[[F.time.format("%Y"),E],[F.time.format("%B"),function(t){return t.getMonth()}],[F.time.format("%b %d"),function(t){return 1!=t.getDate()}],[F.time.format("%a %d"),function(t){return t.getDay()&&1!=t.getDate()}],[F.time.format("%I %p"),function(t){return t.getHours()}],[F.time.format("%I:%M"),function(t){return t.getMinutes()}],[F.time.format(":%S"),function(t){return t.getSeconds()}],[F.time.format(".%L"),function(t){return t.getMilliseconds()}]],Eo=F.scale.linear(),No=bo(ko);So.year=function(t,n){return Eo.domain(t.map(_o)).ticks(n).map(xo)},F.time.scale=function(){return yo(F.scale.linear(),So,No)};var Ao=So.map(function(t){return[t[0].utc,t[1]]}),To=bo([[F.time.format.utc("%Y"),E],[F.time.format.utc("%B"),function(t){return t.getUTCMonth()}],[F.time.format.utc("%b %d"),function(t){return 1!=t.getUTCDate()}],[F.time.format.utc("%a %d"),function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[F.time.format.utc("%I %p"),function(t){return t.getUTCHours()}],[F.time.format.utc("%I:%M"),function(t){return t.getUTCMinutes()}],[F.time.format.utc(":%S"),function(t){return t.getUTCSeconds()}],[F.time.format.utc(".%L"),function(t){return t.getUTCMilliseconds()}]]);function qo(t){var n=new Date(Date.UTC(t,0,1));return n.setUTCFullYear(t),n}function Co(t){var n=t.getUTCFullYear(),e=qo(n);return n+(t-e)/(qo(n+1)-e)}return Ao.year=function(t,n){return Eo.domain(t.map(Co)).ticks(n).map(qo)},F.time.scale.utc=function(){return yo(F.scale.linear(),Ao,To)},F}();
+d3=function(){var k=Math.PI,z=1e-6,F={version:"3.0.6"},b=k/180,x=180/k,u=document,N=window;function t(t){return t.target}function e(t){return t.source}var a=[3,3];Date.now||(Date.now=function(){return+new Date});try{u.createElement("div").style.setProperty("opacity",0,"")}catch(t){var n=N.CSSStyleDeclaration.prototype,r=n.setProperty;n.setProperty=function(t,n,e){r.call(this,t,n+"",e)}}var f=function(t){return Array.prototype.slice.call(t)};function i(t){for(var n=-1,e=t.length,r=[];++n<e;)r.push(t[n]);return r}try{f(u.documentElement.childNodes)[0].nodeType}catch(t){f=i}var o=[].__proto__?function(t,n){t.__proto__=n}:function(t,n){for(var e in n)t[e]=n[e]};function M(){}F.map=function(t){var n=new M;for(var e in t)n.set(e,t[e]);return n},function(n,e){try{for(var t in e)Object.defineProperty(n.prototype,t,{value:e[t],enumerable:!1})}catch(t){n.prototype=e}}(M,{has:function(t){return c+t in this},get:function(t){return this[c+t]},set:function(t,n){return this[c+t]=n},remove:function(t){return(t=c+t)in this&&delete this[t]},keys:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},values:function(){var e=[];return this.forEach(function(t,n){e.push(n)}),e},entries:function(){var e=[];return this.forEach(function(t,n){e.push({key:t,value:n})}),e},forEach:function(t){for(var n in this)n.charCodeAt(0)===l&&t.call(this,n.substring(1),this[n])}});var c="\0",l=c.charCodeAt(0);function S(t){return t}function E(){return!0}function A(t){return"function"==typeof t?t:function(){return t}}function s(n,e,r){return function(){var t=r.apply(e,arguments);return arguments.length?n:t}}function h(t){return null!=t&&!isNaN(t)}function g(t){return t.length}F.functor=A,F.rebind=function(t,n){for(var e,r=1,i=arguments.length;++r<i;)t[e=arguments[r]]=s(t,n,n[e]);return t},F.ascending=function(t,n){return t<n?-1:n<t?1:n<=t?0:NaN},F.descending=function(t,n){return n<t?-1:t<n?1:t<=n?0:NaN},F.mean=function(t,n){var e,r=t.length,i=0,o=-1,u=0;if(1===arguments.length)for(;++o<r;)h(e=t[o])&&(i+=(e-i)/++u);else for(;++o<r;)h(e=n.call(t,t[o],o))&&(i+=(e-i)/++u);return u?i:void 0},F.median=function(t,n){return 1<arguments.length&&(t=t.map(n)),(t=t.filter(h)).length?F.quantile(t.sort(F.ascending),.5):void 0},F.min=function(t,n){var e,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o&&(null==(e=t[i])||e!=e);)e=void 0;for(;++i<o;)null!=(r=t[i])&&r<e&&(e=r)}else{for(;++i<o&&(null==(e=n.call(t,t[i],i))||e!=e);)e=void 0;for(;++i<o;)null!=(r=n.call(t,t[i],i))&&r<e&&(e=r)}return e},F.max=function(t,n){var e,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o&&(null==(e=t[i])||e!=e);)e=void 0;for(;++i<o;)null!=(r=t[i])&&e<r&&(e=r)}else{for(;++i<o&&(null==(e=n.call(t,t[i],i))||e!=e);)e=void 0;for(;++i<o;)null!=(r=n.call(t,t[i],i))&&e<r&&(e=r)}return e},F.extent=function(t,n){var e,r,i,o=-1,u=t.length;if(1===arguments.length){for(;++o<u&&(null==(e=i=t[o])||e!=e);)e=i=void 0;for(;++o<u;)null!=(r=t[o])&&(r<e&&(e=r),i<r&&(i=r))}else{for(;++o<u&&(null==(e=i=n.call(t,t[o],o))||e!=e);)e=void 0;for(;++o<u;)null!=(r=n.call(t,t[o],o))&&(r<e&&(e=r),i<r&&(i=r))}return[e,i]},F.random={normal:function(r,i){var t=arguments.length;return t<2&&(i=1),t<1&&(r=0),function(){for(var t,n,e;!(e=(t=2*Math.random()-1)*t+(n=2*Math.random()-1)*n)||1<e;);return r+i*t*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(){var t=F.random.normal.apply(F,arguments);return function(){return Math.exp(t())}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t/e}}},F.sum=function(t,n){var e,r=0,i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)isNaN(e=+t[o])||(r+=e);else for(;++o<i;)isNaN(e=+n.call(t,t[o],o))||(r+=e);return r},F.quantile=function(t,n){var e=(t.length-1)*n+1,r=Math.floor(e),i=+t[r-1],o=e-r;return o?i+o*(t[r]-i):i},F.shuffle=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t},F.transpose=function(t){return F.zip.apply(F,t)},F.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,n=F.min(arguments,g),e=new Array(n);++t<n;)for(var r,i=-1,o=e[t]=new Array(r);++i<r;)o[i]=arguments[i][t];return e},F.bisector=function(o){return{left:function(t,n,e,r){for(arguments.length<3&&(e=0),arguments.length<4&&(r=t.length);e<r;){var i=e+r>>>1;o.call(t,t[i],i)<n?e=i+1:r=i}return e},right:function(t,n,e,r){for(arguments.length<3&&(e=0),arguments.length<4&&(r=t.length);e<r;){var i=e+r>>>1;n<o.call(t,t[i],i)?r=i:e=i+1}return e}}};var p=F.bisector(function(t){return t});function d(t){return t.trim().replace(/\s+/g," ")}F.bisectLeft=p.left,F.bisect=F.bisectRight=p.right,F.nest=function(){var f,s,h={},g=[],u=[];function p(t,e){if(e>=g.length)return s?s.call(h,t):f?t.sort(f):t;for(var n,r,i,o=-1,u=t.length,a=g[e++],c=new M,l={};++o<u;)(i=c.get(n=a(r=t[o])))?i.push(r):c.set(n,[r]);return c.forEach(function(t,n){l[t]=p(n,e)}),l}return h.map=function(t){return p(t,0)},h.entries=function(t){return function t(n,e){if(e>=g.length)return n;var r,i=[],o=u[e++];for(r in n)i.push({key:r,values:t(n[r],e)});return o&&i.sort(function(t,n){return o(t.key,n.key)}),i}(p(t,0),0)},h.key=function(t){return g.push(t),h},h.sortKeys=function(t){return u[g.length-1]=t,h},h.sortValues=function(t){return f=t,h},h.rollup=function(t){return s=t,h},h},F.keys=function(t){var n=[];for(var e in t)n.push(e);return n},F.values=function(t){var n=[];for(var e in t)n.push(t[e]);return n},F.entries=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},F.permute=function(t,n){for(var e=[],r=-1,i=n.length;++r<i;)e[r]=t[n[r]];return e},F.merge=function(t){return Array.prototype.concat.apply([],t)},F.range=function(t,n,e){if(arguments.length<3&&(e=1,arguments.length<2&&(n=t,t=0)),(n-t)/e==1/0)throw new Error("infinite range");var r,i=[],o=function(t){var n=1;for(;t*n%1;)n*=10;return n}(Math.abs(e)),u=-1;if(t*=o,n*=o,(e*=o)<0)for(;(r=t+e*++u)>n;)i.push(r/o);else for(;(r=t+e*++u)<n;)i.push(r/o);return i},F.requote=function(t){return t.replace(v,"\\$&")};var v=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;function m(t){return t.responseText}function y(t){return JSON.parse(t.responseText)}function _(t){var n=u.createRange();return n.selectNode(u.body),n.createContextualFragment(t.responseText)}function w(t){return t.responseXML}F.round=function(t,n){return n?Math.round(t*(n=Math.pow(10,n)))/n:Math.round(t)},F.xhr=function(i,o,t){var e,u={},r=F.dispatch("progress","load","error"),a={},n=S,c=new(N.XDomainRequest&&/^(http(s)?:)?\/\//.test(i)?XDomainRequest:XMLHttpRequest);function l(){var t=c.status;!t&&c.responseText||200<=t&&t<300||304===t?r.load.call(u,n.call(u,c)):r.error.call(u,c)}return"onload"in c?c.onload=c.onerror=l:c.onreadystatechange=function(){3<c.readyState&&l()},c.onprogress=function(t){var n=F.event;F.event=t;try{r.progress.call(u,c)}finally{F.event=n}},u.header=function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?a[t]:(null==n?delete a[t]:a[t]=n+"",u)},u.mimeType=function(t){return arguments.length?(o=null==t?null:t+"",u):o},u.response=function(t){return n=t,u},["get","post"].forEach(function(t){u[t]=function(){return u.send.apply(u,[t].concat(f(arguments)))}}),u.send=function(t,n,e){if(2===arguments.length&&"function"==typeof n&&(e=n,n=null),c.open(t,i,!0),null==o||"accept"in a||(a.accept=o+",*/*"),c.setRequestHeader)for(var r in a)c.setRequestHeader(r,a[r]);return null!=o&&c.overrideMimeType&&c.overrideMimeType(o),null!=e&&u.on("error",e).on("load",function(t){e(null,t)}),c.send(null==n?null:n),u},u.abort=function(){return c.abort(),u},F.rebind(u,r,"on"),2===arguments.length&&"function"==typeof o&&(t=o,o=null),null==t?u:u.get(1===(e=t).length?function(t,n){e(null==t?n:null)}:e)},F.text=function(){return F.xhr.apply(F,arguments).response(m)},F.json=function(t,n){return F.xhr(t,"application/json",n).response(y)},F.html=function(t,n){return F.xhr(t,"text/html",n).response(_)},F.xml=function(){return F.xhr.apply(F,arguments).response(w)};var T={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function q(){}function C(i){var o=[],u=new M;function t(){for(var t,n=o,e=-1,r=n.length;++e<r;)(t=n[e].on)&&t.apply(this,arguments);return i}return t.on=function(t,n){var e,r=u.get(t);return arguments.length<2?r&&r.on:(r&&(r.on=null,o=o.slice(0,e=o.indexOf(r)).concat(o.slice(e+1)),u.remove(t)),n&&o.push(u.set(t,{on:n})),i)},t}F.ns={prefix:T,qualify:function(t){var n=t.indexOf(":"),e=t;return 0<=n&&(e=t.substring(0,n),t=t.substring(n+1)),T.hasOwnProperty(e)?{space:T[e],local:t}:t}},F.dispatch=function(){for(var t=new q,n=-1,e=arguments.length;++n<e;)t[arguments[n]]=C(t);return t},q.prototype.on=function(t,n){var e=t.indexOf("."),r="";return 0<e&&(r=t.substring(e+1),t=t.substring(0,e)),arguments.length<2?this[t].on(r):this[t].on(r,n)},F.format=function(t){var n=D.exec(t),o=n[1]||" ",u=n[2]||">",a=n[3]||"",c=n[4]||"",l=n[5],f=+n[6],s=n[7],h=n[8],g=n[9],p=1,d="",v=!1;switch(h&&(h=+h.substring(1)),(l||"0"===o&&"="===u)&&(l=o="0",u="=",s&&(f-=Math.floor((f-1)/4))),g){case"n":s=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":c&&(c="0"+g.toLowerCase());case"c":case"d":v=!0,h=0;break;case"s":p=-1,g="r"}"#"===c&&(c=""),"r"!=g||h||(g="g"),g=L.get(g)||j;var m=l&&s;return function(t){if(v&&t%1)return"";var n=t<0||0===t&&1/t<0?(t=-t,"-"):a;if(p<0){var e=F.formatPrefix(t,h);t=e.scale(t),d=e.symbol}else t*=p;t=g(t,h),!l&&s&&(t=P(t));var r=c.length+t.length+(m?0:n.length),i=r<f?new Array(r=f-r+1).join(o):"";return m&&(t=P(i+t)),t.replace(".","."),n+=c,("<"===u?n+t+i:">"===u?i+n+t:"^"===u?i.substring(0,r>>=1)+n+t+i.substring(r):n+(m?t:i+t))+d}};var D=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,L=F.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,n){return t.toPrecision(n)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},r:function(t,n){return(t=F.round(t,H(t,n))).toFixed(Math.max(0,Math.min(20,H(t*(1+1e-15),n))))}});function H(t,n){return n-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function j(t){return t+""}var P=S,R=a.length;P=function(t){for(var n=t.lastIndexOf("."),e=0<=n?"."+t.substring(n+1):(n=t.length,""),r=[],i=0,o=a[0];0<n&&0<o;)r.push(t.substring(n-=o,n+o)),o=a[i=(i+1)%R];return r.reverse().join(",")+e};var O=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(function(t,n){var e=Math.pow(10,3*Math.abs(8-n));return{scale:8<n?function(t){return t/e}:function(t){return t*e},symbol:t}});F.formatPrefix=function(t,n){var e=0;return t&&(t<0&&(t*=-1),n&&(t=F.round(t,H(t,n))),e=1+Math.floor(1e-12+Math.log(t)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e<=0?e+1:e-1)/3)))),O[8+e/3]};var Y=function(){return S},U=F.map({linear:Y,poly:function(n){return function(t){return Math.pow(t,n)}},quad:function(){return Z},cubic:function(){return B},sin:function(){return $},exp:function(){return J},circle:function(){return G},elastic:function(n,e){var r;arguments.length<2&&(e=.45);r=arguments.length?e/(2*k)*Math.asin(1/n):(n=1,e/4);return function(t){return 1+n*Math.pow(2,10*-t)*Math.sin(2*(t-r)*k/e)}},back:function(n){n||(n=1.70158);return function(t){return t*t*((n+1)*t-n)}},bounce:function(){return K}}),I=F.map({in:S,out:V,"in-out":X,"out-in":function(t){return X(V(t))}});function V(n){return function(t){return 1-n(1-t)}}function X(n){return function(t){return.5*(t<.5?n(2*t):2-n(2-2*t))}}function Z(t){return t*t}function B(t){return t*t*t}function $(t){return 1-Math.cos(t*k/2)}function J(t){return Math.pow(2,10*(t-1))}function G(t){return 1-Math.sqrt(1-t*t)}function K(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function W(){F.event.stopPropagation(),F.event.preventDefault()}function Q(){for(var t,n=F.event;t=n.sourceEvent;)n=t;return n}function tt(i){for(var o=new q,t=0,n=arguments.length;++t<n;)o[arguments[t]]=C(o);return o.of=function(e,r){return function(t){try{var n=t.sourceEvent=F.event;t.target=i,F.event=t,o[t.type].apply(e,r)}finally{F.event=n}}},o}function nt(t){var n,e,r,i=[t.a,t.b],o=[t.c,t.d],u=rt(i),a=et(i,o),c=rt(((n=o)[0]+=(r=-a)*(e=i)[0],n[1]+=r*e[1],n))||0;i[0]*o[1]<o[0]*i[1]&&(i[0]*=-1,i[1]*=-1,u*=-1,a*=-1),this.rotate=(u?Math.atan2(i[1],i[0]):Math.atan2(-o[0],o[1]))*x,this.translate=[t.e,t.f],this.scale=[u,c],this.skew=c?Math.atan2(a,c)*x:0}function et(t,n){return t[0]*n[0]+t[1]*n[1]}function rt(t){var n=Math.sqrt(et(t,t));return n&&(t[0]/=n,t[1]/=n),n}F.ease=function(t){var n,e=t.indexOf("-"),r=0<=e?t.substring(0,e):t,i=0<=e?t.substring(e+1):"in";return r=U.get(r)||Y,i=I.get(i)||S,n=i(r.apply(null,Array.prototype.slice.call(arguments,1))),function(t){return t<=0?0:1<=t?1:n(t)}},F.event=null,F.transform=function(t){var e=u.createElementNS(F.ns.prefix.svg,"g");return(F.transform=function(t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate();return new nt(n?n.matrix:it)})(t)},nt.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var it={a:1,b:0,c:0,d:1,e:0,f:0};F.interpolate=function(t,n){for(var e,r=F.interpolators.length;0<=--r&&!(e=F.interpolators[r](t,n)););return e},F.interpolateNumber=function(n,e){return e-=n,function(t){return n+e*t}},F.interpolateRound=function(n,e){return e-=n,function(t){return Math.round(n+e*t)}},F.interpolateString=function(t,n){var e,r,i,o,u,a=0,c=[],l=[];for(ot.lastIndex=0,r=0;e=ot.exec(n);++r)e.index&&c.push(n.substring(a,e.index)),l.push({i:c.length,x:e[0]}),c.push(null),a=ot.lastIndex;for(a<n.length&&c.push(n.substring(a)),r=0,o=l.length;(e=ot.exec(t))&&r<o;++r)if((u=l[r]).x==e[0]){if(u.i)if(null==c[u.i+1])for(c[u.i-1]+=u.x,c.splice(u.i,1),i=r+1;i<o;++i)l[i].i--;else for(c[u.i-1]+=u.x+c[u.i+1],c.splice(u.i,2),i=r+1;i<o;++i)l[i].i-=2;else if(null==c[u.i+1])c[u.i]=u.x;else for(c[u.i]=u.x+c[u.i+1],c.splice(u.i+1,1),i=r+1;i<o;++i)l[i].i--;l.splice(r,1),o--,r--}else u.x=F.interpolateNumber(parseFloat(e[0]),parseFloat(u.x));for(;r<o;)u=l.pop(),null==c[u.i+1]?c[u.i]=u.x:(c[u.i]=u.x+c[u.i+1],c.splice(u.i+1,1)),o--;return 1===c.length?null==c[0]?l[0].x:function(){return n}:function(t){for(r=0;r<o;++r)c[(u=l[r]).i]=u.x(t);return c.join("")}},F.interpolateTransform=function(t,n){var r,i=[],o=[],e=F.transform(t),u=F.transform(n),a=e.translate,c=u.translate,l=e.rotate,f=u.rotate,s=e.skew,h=u.skew,g=e.scale,p=u.scale;return a[0]!=c[0]||a[1]!=c[1]?(i.push("translate(",null,",",null,")"),o.push({i:1,x:F.interpolateNumber(a[0],c[0])},{i:3,x:F.interpolateNumber(a[1],c[1])})):c[0]||c[1]?i.push("translate("+c+")"):i.push(""),l!=f?(180<l-f?f+=360:180<f-l&&(l+=360),o.push({i:i.push(i.pop()+"rotate(",null,")")-2,x:F.interpolateNumber(l,f)})):f&&i.push(i.pop()+"rotate("+f+")"),s!=h?o.push({i:i.push(i.pop()+"skewX(",null,")")-2,x:F.interpolateNumber(s,h)}):h&&i.push(i.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(r=i.push(i.pop()+"scale(",null,",",null,")"),o.push({i:r-4,x:F.interpolateNumber(g[0],p[0])},{i:r-2,x:F.interpolateNumber(g[1],p[1])})):1==p[0]&&1==p[1]||i.push(i.pop()+"scale("+p+")"),r=o.length,function(t){for(var n,e=-1;++e<r;)i[(n=o[e]).i]=n.x(t);return i.join("")}},F.interpolateRgb=function(t,n){t=F.rgb(t),n=F.rgb(n);var e=t.r,r=t.g,i=t.b,o=n.r-e,u=n.g-r,a=n.b-i;return function(t){return"#"+gt(Math.round(e+o*t))+gt(Math.round(r+u*t))+gt(Math.round(i+a*t))}},F.interpolateHsl=function(t,n){t=F.hsl(t),n=F.hsl(n);var e=t.h,r=t.s,i=t.l,o=n.h-e,u=n.s-r,a=n.l-i;return 180<o?o-=360:o<-180&&(o+=360),function(t){return wt(e+o*t,r+u*t,i+a*t)+""}},F.interpolateLab=function(t,n){t=F.lab(t),n=F.lab(n);var e=t.l,r=t.a,i=t.b,o=n.l-e,u=n.a-r,a=n.b-i;return function(t){return Ft(e+o*t,r+u*t,i+a*t)+""}},F.interpolateHcl=function(t,n){t=F.hcl(t),n=F.hcl(n);var e=t.h,r=t.c,i=t.l,o=n.h-e,u=n.c-r,a=n.l-i;return 180<o?o-=360:o<-180&&(o+=360),function(t){return Nt(e+o*t,r+u*t,i+a*t)+""}},F.interpolateArray=function(t,n){var e,r=[],i=[],o=t.length,u=n.length,a=Math.min(t.length,n.length);for(e=0;e<a;++e)r.push(F.interpolate(t[e],n[e]));for(;e<o;++e)i[e]=t[e];for(;e<u;++e)i[e]=n[e];return function(t){for(e=0;e<a;++e)i[e]=r[e](t);return i}},F.interpolateObject=function(t,n){var e,r={},i={};for(e in t)e in n?r[e]=ut(e)(t[e],n[e]):i[e]=t[e];for(e in n)e in t||(i[e]=n[e]);return function(t){for(e in r)i[e]=r[e](t);return i}};var ot=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;function ut(t){return"transform"==t?F.interpolateTransform:F.interpolate}function at(n,e){return e=e-(n=+n)?1/(e-n):0,function(t){return(t-n)*e}}function ct(n,e){return e=e-(n=+n)?1/(e-n):0,function(t){return Math.max(0,Math.min(1,(t-n)*e))}}function lt(){}function ft(t,n,e){return new st(t,n,e)}function st(t,n,e){this.r=t,this.g=n,this.b=e}F.interpolators=[F.interpolateObject,function(t,n){return n instanceof Array&&F.interpolateArray(t,n)},function(t,n){return("string"==typeof t||"string"==typeof n)&&F.interpolateString(t+"",n+"")},function(t,n){return("string"==typeof n?Mt.has(n)||/^(#|rgb\(|hsl\()/.test(n):n instanceof lt)&&F.interpolateRgb(t,n)},function(t,n){return!isNaN(t=+t)&&!isNaN(n=+n)&&F.interpolateNumber(t,n)}],lt.prototype.toString=function(){return this.rgb()+""},F.rgb=function(t,n,e){return 1===arguments.length?t instanceof st?ft(t.r,t.g,t.b):pt(""+t,ft,wt):ft(~~t,~~n,~~e)};var ht=st.prototype=new lt;function gt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function pt(t,n,e){var r,i,o,u=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return n(yt(i[0]),yt(i[1]),yt(i[2]))}return(o=Mt.get(t))?n(o.r,o.g,o.b):(null!=t&&"#"===t.charAt(0)&&(4===t.length?(u=t.charAt(1),u+=u,a=t.charAt(2),a+=a,c=t.charAt(3),c+=c):7===t.length&&(u=t.substring(1,3),a=t.substring(3,5),c=t.substring(5,7)),u=parseInt(u,16),a=parseInt(a,16),c=parseInt(c,16)),n(u,a,c))}function dt(t,n,e){var r,i,o=Math.min(t/=255,n/=255,e/=255),u=Math.max(t,n,e),a=u-o,c=(u+o)/2;return a?(i=c<.5?a/(u+o):a/(2-u-o),r=t==u?(n-e)/a+(n<e?6:0):n==u?(e-t)/a+2:(t-n)/a+4,r*=60):i=r=0,bt(r,i,c)}function vt(t,n,e){var r=Pt((.4124564*(t=mt(t))+.3575761*(n=mt(n))+.1804375*(e=mt(e)))/Ct),i=Pt((.2126729*t+.7151522*n+.072175*e)/zt);return At(116*i-16,500*(r-i),200*(i-Pt((.0193339*t+.119192*n+.9503041*e)/Dt)))}function mt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yt(t){var n=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*n):n}ht.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var n=this.r,e=this.g,r=this.b;return n||e||r?(n&&n<30&&(n=30),e&&e<30&&(e=30),r&&r<30&&(r=30),ft(Math.min(255,Math.floor(n/t)),Math.min(255,Math.floor(e/t)),Math.min(255,Math.floor(r/t)))):ft(30,30,30)},ht.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),ft(Math.floor(t*this.r),Math.floor(t*this.g),Math.floor(t*this.b))},ht.hsl=function(){return dt(this.r,this.g,this.b)},ht.toString=function(){return"#"+gt(this.r)+gt(this.g)+gt(this.b)};var Mt=F.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});function bt(t,n,e){return new xt(t,n,e)}function xt(t,n,e){this.h=t,this.s=n,this.l=e}Mt.forEach(function(t,n){Mt.set(t,pt(n,ft,wt))}),F.hsl=function(t,n,e){return 1===arguments.length?t instanceof xt?bt(t.h,t.s,t.l):pt(""+t,dt,bt):bt(+t,+n,+e)};var _t=xt.prototype=new lt;function wt(t,n,e){var r,i;function o(t){return Math.round(255*(360<(n=t)?n-=360:n<0&&(n+=360),n<60?r+(i-r)*n/60:n<180?i:n<240?r+(i-r)*(240-n)/60:r));var n}return(t%=360)<0&&(t+=360),n=n<0?0:1<n?1:n,r=2*(e=e<0?0:1<e?1:e)-(i=e<=.5?e*(1+n):e+n-e*n),ft(o(t+120),o(t),o(t-120))}function St(t,n,e){return new kt(t,n,e)}function kt(t,n,e){this.h=t,this.c=n,this.l=e}_t.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),bt(this.h,this.s,this.l/t)},_t.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),bt(this.h,this.s,t*this.l)},_t.rgb=function(){return wt(this.h,this.s,this.l)},F.hcl=function(t,n,e){return 1===arguments.length?t instanceof kt?St(t.h,t.c,t.l):Ht(t instanceof Tt?t.l:(t=vt((t=F.rgb(t)).r,t.g,t.b)).l,t.a,t.b):St(+t,+n,+e)};var Et=kt.prototype=new lt;function Nt(t,n,e){return At(e,Math.cos(t*=b)*n,Math.sin(t)*n)}function At(t,n,e){return new Tt(t,n,e)}function Tt(t,n,e){this.l=t,this.a=n,this.b=e}Et.brighter=function(t){return St(this.h,this.c,Math.min(100,this.l+qt*(arguments.length?t:1)))},Et.darker=function(t){return St(this.h,this.c,Math.max(0,this.l-qt*(arguments.length?t:1)))},Et.rgb=function(){return Nt(this.h,this.c,this.l).rgb()},F.lab=function(t,n,e){return 1===arguments.length?t instanceof Tt?At(t.l,t.a,t.b):t instanceof kt?Nt(t.l,t.c,t.h):vt((t=F.rgb(t)).r,t.g,t.b):At(+t,+n,+e)};var qt=18,Ct=.95047,zt=1,Dt=1.08883,Lt=Tt.prototype=new lt;function Ft(t,n,e){var r=(t+16)/116,i=r+n/500,o=r-e/200;return ft(Rt(3.2404542*(i=jt(i)*Ct)-1.5371385*(r=jt(r)*zt)-.4985314*(o=jt(o)*Dt)),Rt(-.969266*i+1.8760108*r+.041556*o),Rt(.0556434*i-.2040259*r+1.0572252*o))}function Ht(t,n,e){return St(Math.atan2(e,n)/k*180,Math.sqrt(n*n+e*e),t)}function jt(t){return.206893034<t?t*t*t:(t-4/29)/7.787037}function Pt(t){return.008856<t?Math.pow(t,1/3):7.787037*t+4/29}function Rt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function Ot(t){return o(t,Zt),t}Lt.brighter=function(t){return At(Math.min(100,this.l+qt*(arguments.length?t:1)),this.a,this.b)},Lt.darker=function(t){return At(Math.max(0,this.l-qt*(arguments.length?t:1)),this.a,this.b)},Lt.rgb=function(){return Ft(this.l,this.a,this.b)};var Yt=function(t,n){return n.querySelector(t)},Ut=function(t,n){return n.querySelectorAll(t)},It=u.documentElement,Vt=It.matchesSelector||It.webkitMatchesSelector||It.mozMatchesSelector||It.msMatchesSelector||It.oMatchesSelector,Xt=function(t,n){return Vt.call(t,n)};"function"==typeof Sizzle&&(Yt=function(t,n){return Sizzle(t,n)[0]||null},Ut=function(t,n){return Sizzle.uniqueSort(Sizzle(t,n))},Xt=Sizzle.matchesSelector);var Zt=[];function Bt(t){return function(){return Yt(t,this)}}function $t(t){return function(){return Ut(t,this)}}function Jt(n,e){return n=F.ns.qualify(n),null==e?n.local?function(){this.removeAttributeNS(n.space,n.local)}:function(){this.removeAttribute(n)}:"function"==typeof e?n.local?function(){var t=e.apply(this,arguments);null==t?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}:function(){var t=e.apply(this,arguments);null==t?this.removeAttribute(n):this.setAttribute(n,t)}:n.local?function(){this.setAttributeNS(n.space,n.local,e)}:function(){this.setAttribute(n,e)}}function Gt(t){return new RegExp("(?:^|\\s+)"+F.requote(t)+"(?:\\s+|$)","g")}function Kt(e,r){var i=(e=e.trim().split(/\s+/).map(Wt)).length;return"function"==typeof r?function(){for(var t=-1,n=r.apply(this,arguments);++t<i;)e[t](this,n)}:function(){for(var t=-1;++t<i;)e[t](this,r)}}function Wt(o){var u=Gt(o);return function(t,n){if(e=t.classList)return n?e.add(o):e.remove(o);var e=t.className,r=null!=e.baseVal,i=r?e.baseVal:e;n?(u.lastIndex=0,u.test(i)||(i=d(i+" "+o),r?e.baseVal=i:t.className=i)):i&&(i=d(i.replace(u," ")),r?e.baseVal=i:t.className=i)}}function Qt(n,e,r){return null==e?function(){this.style.removeProperty(n)}:"function"==typeof e?function(){var t=e.apply(this,arguments);null==t?this.style.removeProperty(n):this.style.setProperty(n,t,r)}:function(){this.style.setProperty(n,e,r)}}function tn(n,e){return null==e?function(){delete this[n]}:"function"==typeof e?function(){var t=e.apply(this,arguments);null==t?delete this[n]:this[n]=t}:function(){this[n]=e}}function nn(t){return{__data__:t}}function en(t){return function(){return Xt(this,t)}}function rn(n,i,o){var u="__on"+n,t=n.indexOf(".");function a(){var t=this[u];t&&(this.removeEventListener(n,t,t.$),delete this[u])}return 0<t&&(n=n.substring(0,t)),i?function(){var e=this,r=f(arguments);function t(t){var n=F.event;F.event=t,r[0]=e.__data__;try{i.apply(e,r)}finally{F.event=n}}a.call(this),this.addEventListener(n,this[u]=t,t.$=o),t._=i}:a}function on(t,n){for(var e=0,r=t.length;e<r;e++)for(var i,o=t[e],u=0,a=o.length;u<a;u++)(i=o[u])&&n(i,u,e);return t}F.selection=function(){return un},(F.selection.prototype=Zt).select=function(t){var n,e,r,i,o=[];"function"!=typeof t&&(t=Bt(t));for(var u=-1,a=this.length;++u<a;){o.push(n=[]),n.parentNode=(r=this[u]).parentNode;for(var c=-1,l=r.length;++c<l;)(i=r[c])?(n.push(e=t.call(i,i.__data__,c)),e&&"__data__"in i&&(e.__data__=i.__data__)):n.push(null)}return Ot(o)},Zt.selectAll=function(t){var n,e,r=[];"function"!=typeof t&&(t=$t(t));for(var i=-1,o=this.length;++i<o;)for(var u=this[i],a=-1,c=u.length;++a<c;)(e=u[a])&&(r.push(n=f(t.call(e,e.__data__,a))),n.parentNode=e);return Ot(r)},Zt.attr=function(t,n){if(arguments.length<2){if("string"==typeof t){var e=this.node();return(t=F.ns.qualify(t)).local?e.getAttributeNS(t.space,t.local):e.getAttribute(t)}for(n in t)this.each(Jt(n,t[n]));return this}return this.each(Jt(t,n))},Zt.classed=function(t,n){if(arguments.length<2){if("string"==typeof t){var e=this.node(),r=(t=t.trim().split(/^|\s+/g)).length,i=-1;if(n=e.classList){for(;++i<r;)if(!n.contains(t[i]))return!1}else for(null!=(n=e.className).baseVal&&(n=n.baseVal);++i<r;)if(!Gt(t[i]).test(n))return!1;return!0}for(n in t)this.each(Kt(n,t[n]));return this}return this.each(Kt(t,n))},Zt.style=function(t,n,e){var r=arguments.length;if(r<3){if("string"!=typeof t){for(e in r<2&&(n=""),t)this.each(Qt(e,t[e],n));return this}if(r<2)return N.getComputedStyle(this.node(),null).getPropertyValue(t);e=""}return this.each(Qt(t,n,e))},Zt.property=function(t,n){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(n in t)this.each(tn(n,t[n]));return this}return this.each(tn(t,n))},Zt.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Zt.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Zt.append=function(t){return t=F.ns.qualify(t),this.select(t.local?function(){return this.appendChild(u.createElementNS(t.space,t.local))}:function(){return this.appendChild(u.createElementNS(this.namespaceURI,t))})},Zt.insert=function(t,n){return t=F.ns.qualify(t),this.select(t.local?function(){return this.insertBefore(u.createElementNS(t.space,t.local),Yt(n,this))}:function(){return this.insertBefore(u.createElementNS(this.namespaceURI,t),Yt(n,this))})},Zt.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},Zt.data=function(t,d){var n,e,r=-1,i=this.length;if(!arguments.length){for(t=new Array(i=(n=this[0]).length);++r<i;)(e=n[r])&&(t[r]=e.__data__);return t}function o(t,n){var e,r,i,o=t.length,u=n.length,a=Math.min(o,u),c=new Array(u),l=new Array(u),f=new Array(o);if(d){var s,h=new M,g=new M,p=[];for(e=-1;++e<o;)s=d.call(r=t[e],r.__data__,e),h.has(s)?f[e]=r:h.set(s,r),p.push(s);for(e=-1;++e<u;)s=d.call(n,i=n[e],e),(r=h.get(s))?(c[e]=r).__data__=i:g.has(s)||(l[e]=nn(i)),g.set(s,i),h.remove(s);for(e=-1;++e<o;)h.has(p[e])&&(f[e]=t[e])}else{for(e=-1;++e<a;)r=t[e],i=n[e],r?(r.__data__=i,c[e]=r):l[e]=nn(i);for(;e<u;++e)l[e]=nn(n[e]);for(;e<o;++e)f[e]=t[e]}l.update=c,l.parentNode=c.parentNode=f.parentNode=t.parentNode,v.push(l),m.push(c),y.push(f)}var v=an([]),m=Ot([]),y=Ot([]);if("function"==typeof t)for(;++r<i;)o(n=this[r],t.call(n,n.parentNode.__data__,r));else for(;++r<i;)o(n=this[r],t);return m.enter=function(){return v},m.exit=function(){return y},m},Zt.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},Zt.filter=function(t){var n,e,r,i=[];"function"!=typeof t&&(t=en(t));for(var o=0,u=this.length;o<u;o++){i.push(n=[]),n.parentNode=(e=this[o]).parentNode;for(var a=0,c=e.length;a<c;a++)(r=e[a])&&t.call(r,r.__data__,a)&&n.push(r)}return Ot(i)},Zt.order=function(){for(var t=-1,n=this.length;++t<n;)for(var e,r=this[t],i=r.length-1,o=r[i];0<=--i;)(e=r[i])&&(o&&o!==e.nextSibling&&o.parentNode.insertBefore(e,o),o=e);return this},Zt.sort=function(t){t=function(e){arguments.length||(e=F.ascending);return function(t,n){return!t-!n||e(t.__data__,n.__data__)}}.apply(this,arguments);for(var n=-1,e=this.length;++n<e;)this[n].sort(t);return this.order()},Zt.on=function(t,n,e){var r=arguments.length;if(r<3){if("string"!=typeof t){for(e in r<2&&(n=!1),t)this.each(rn(e,t[e],n));return this}if(r<2)return(r=this.node()["__on"+t])&&r._;e=!1}return this.each(rn(t,n,e))},Zt.each=function(r){return on(this,function(t,n,e){r.call(t,t.__data__,n,e)})},Zt.call=function(t){var n=f(arguments);return t.apply(n[0]=this,n),this},Zt.empty=function(){return!this.node()},Zt.node=function(){for(var t=0,n=this.length;t<n;t++)for(var e=this[t],r=0,i=e.length;r<i;r++){var o=e[r];if(o)return o}return null},Zt.transition=function(){var t,n,e=fn||++hn,r=[],i=Object.create(gn);i.time=Date.now();for(var o=-1,u=this.length;++o<u;){r.push(t=[]);for(var a=this[o],c=-1,l=a.length;++c<l;)(n=a[c])&&pn(n,c,e,i),t.push(n)}return ln(r,e)};var un=Ot([[u]]);function an(t){return o(t,cn),t}un[0].parentNode=It,F.select=function(t){return"string"==typeof t?un.select(t):Ot([[t]])},F.selectAll=function(t){return"string"==typeof t?un.selectAll(t):Ot([f(t)])};var cn=[];function ln(t,n){return o(t,sn),t.id=n,t}F.selection.enter=an,(F.selection.enter.prototype=cn).append=Zt.append,cn.insert=Zt.insert,cn.empty=Zt.empty,cn.node=Zt.node,cn.select=function(t){for(var n,e,r,i,o,u=[],a=-1,c=this.length;++a<c;){r=(i=this[a]).update,u.push(n=[]),n.parentNode=i.parentNode;for(var l=-1,f=i.length;++l<f;)(o=i[l])?(n.push(r[l]=e=t.call(i.parentNode,o.__data__,l)),e.__data__=o.__data__):n.push(null)}return Ot(u)};var fn,sn=[],hn=0,gn={ease:function(t){if(t<=0)return 0;if(1<=t)return 1;var n=t*t,e=n*t;return 4*(t<.5?e:3*(t-n)+e-.75)},delay:0,duration:250};function pn(s,h,g,t){var p=s.__transition__||(s.__transition__={active:0,count:0}),r=p[g];if(!r){var d=t.time;return r=p[g]={tween:new M,event:F.dispatch("start","end"),time:d,ease:t.ease,delay:t.delay,duration:t.duration},++p.count,F.timer(function(t){var i=s.__data__,o=r.ease,u=r.event,a=r.delay,c=r.duration,l=[];return a<=t?n(t):F.timer(n,a,d),1;function n(t){return p.active>g?f():(p.active=g,u.start.call(s,i,h),r.tween.forEach(function(t,n){(n=n.call(s,i,h))&&l.push(n)}),e(t)||F.timer(e,0,d),1)}function e(t){if(p.active!==g)return f();for(var n=(t-a)/c,e=o(n),r=l.length;0<r;)l[--r].call(s,e);return 1<=n?(f(),u.end.call(s,i,h),1):void 0}function f(){return--p.count?delete p[g]:delete s.__transition__,1}},0,d),r}}function dn(t){return null==t&&(t=""),function(){this.textContent=t}}function vn(t,r,i,o){var u=t.id;return on(t,"function"==typeof i?function(t,n,e){t.__transition__[u].tween.set(r,o(i.call(t,t.__data__,n,e)))}:(i=o(i),function(t){t.__transition__[u].tween.set(r,i)}))}sn.call=Zt.call,sn.empty=Zt.empty,sn.node=Zt.node,F.transition=function(t){return arguments.length?fn?t.transition():t:un.transition()},(F.transition.prototype=sn).select=function(t){var n,e,r,i=this.id,o=[];"function"!=typeof t&&(t=Bt(t));for(var u=-1,a=this.length;++u<a;){o.push(n=[]);for(var c=this[u],l=-1,f=c.length;++l<f;)(r=c[l])&&(e=t.call(r,r.__data__,l))?("__data__"in r&&(e.__data__=r.__data__),pn(e,l,i,r.__transition__[i]),n.push(e)):n.push(null)}return ln(o,i)},sn.selectAll=function(t){var n,e,r,i,o,u=this.id,a=[];"function"!=typeof t&&(t=$t(t));for(var c=-1,l=this.length;++c<l;)for(var f=this[c],s=-1,h=f.length;++s<h;)if(r=f[s]){o=r.__transition__[u],e=t.call(r,r.__data__,s),a.push(n=[]);for(var g=-1,p=e.length;++g<p;)pn(i=e[g],g,u,o),n.push(i)}return ln(a,u)},sn.filter=function(t){var n,e,r=[];"function"!=typeof t&&(t=en(t));for(var i=0,o=this.length;i<o;i++){r.push(n=[]);for(var u,a=0,c=(u=this[i]).length;a<c;a++)(e=u[a])&&t.call(e,e.__data__,a)&&n.push(e)}return ln(r,this.id,this.time).ease(this.ease())},sn.attr=function(t,n){if(arguments.length<2){for(n in t)this.attr(n,t[n]);return this}var r=ut(t),i=F.ns.qualify(t);function o(){this.removeAttribute(i)}function u(){this.removeAttributeNS(i.space,i.local)}return vn(this,"attr."+t,n,function(e){return null==e?i.local?u:o:(e+="",i.local?function(){var n,t=this.getAttributeNS(i.space,i.local);return t!==e&&(n=r(t,e),function(t){this.setAttributeNS(i.space,i.local,n(t))})}:function(){var n,t=this.getAttribute(i);return t!==e&&(n=r(t,e),function(t){this.setAttribute(i,n(t))})})})},sn.attrTween=function(t,r){var i=F.ns.qualify(t);return this.tween("attr."+t,i.local?function(t,n){var e=r.call(this,t,n,this.getAttributeNS(i.space,i.local));return e&&function(t){this.setAttributeNS(i.space,i.local,e(t))}}:function(t,n){var e=r.call(this,t,n,this.getAttribute(i));return e&&function(t){this.setAttribute(i,e(t))}})},sn.style=function(r,t,i){var n=arguments.length;if(n<3){if("string"!=typeof r){for(i in n<2&&(t=""),r)this.style(i,r[i],t);return this}i=""}var o=ut(r);function u(){this.style.removeProperty(r)}return vn(this,"style."+r,t,function(e){return null==e?u:(e+="",function(){var n,t=N.getComputedStyle(this,null).getPropertyValue(r);return t!==e&&(n=o(t,e),function(t){this.style.setProperty(r,n(t),i)})})})},sn.styleTween=function(r,i,o){return arguments.length<3&&(o=""),this.tween("style."+r,function(t,n){var e=i.call(this,t,n,N.getComputedStyle(this,null).getPropertyValue(r));return e&&function(t){this.style.setProperty(r,e(t),o)}})},sn.text=function(t){return vn(this,"text",t,dn)},sn.remove=function(){return this.each("end.transition",function(){var t;!this.__transition__&&(t=this.parentNode)&&t.removeChild(this)})},sn.ease=function(n){var e=this.id;return arguments.length<1?this.node().__transition__[e].ease:("function"!=typeof n&&(n=F.ease.apply(F,arguments)),on(this,function(t){t.__transition__[e].ease=n}))},sn.delay=function(r){var i=this.id;return on(this,"function"==typeof r?function(t,n,e){t.__transition__[i].delay=0|r.call(t,t.__data__,n,e)}:(r|=0,function(t){t.__transition__[i].delay=r}))},sn.duration=function(r){var i=this.id;return on(this,"function"==typeof r?function(t,n,e){t.__transition__[i].duration=Math.max(1,0|r.call(t,t.__data__,n,e))}:(r=Math.max(1,0|r),function(t){t.__transition__[i].duration=r}))},sn.each=function(r,n){var i=this.id;if(arguments.length<2){var t=gn,e=fn;fn=i,on(this,function(t,n,e){gn=t.__transition__[i],r.call(t,t.__data__,n,e)}),gn=t,fn=e}else on(this,function(t){t.__transition__[i].event.on(r,n)});return this},sn.transition=function(){for(var t,n,e,r=this.id,i=++hn,o=[],u=0,a=this.length;u<a;u++){o.push(t=[]);for(var c,l=0,f=(c=this[u]).length;l<f;l++)(n=c[l])&&((e=Object.create(n.__transition__[r])).delay+=e.duration,pn(n,l,i,e)),t.push(n)}return ln(o,i)},sn.tween=function(n,e){var r=this.id;return arguments.length<2?this.node().__transition__[r].tween.get(n):on(this,null==e?function(t){t.__transition__[r].tween.remove(n)}:function(t){t.__transition__[r].tween.set(n,e)})};var mn,yn,Mn=0,bn={},xn=null;function _n(){for(var t,n=Date.now(),e=xn;e;)(t=n-e.then)>=e.delay&&(e.flush=e.callback(t)),e=e.next;var r=wn()-n;24<r?(isFinite(r)&&(clearTimeout(yn),yn=setTimeout(_n,r)),mn=0):(mn=1,Sn(_n))}function wn(){for(var t=null,n=xn,e=1/0;n;)n=n.flush?(delete bn[n.callback.id],t?t.next=n.next:xn=n.next):(e=Math.min(e,n.then+n.delay),(t=n).next);return e}F.timer=function(t,n,e){if(arguments.length<3){if(arguments.length<2)n=0;else if(!isFinite(n))return;e=Date.now()}var r=bn[t.id];r&&r.callback===t?(r.then=e,r.delay=n):bn[t.id=++Mn]=xn={callback:t,then:e,delay:n,next:xn},mn||(yn=clearTimeout(yn),mn=1,Sn(_n))},F.timer.flush=function(){for(var t,n=Date.now(),e=xn;e;)t=n-e.then,e.delay||(e.flush=e.callback(t)),e=e.next;wn()};var Sn=N.requestAnimationFrame||N.webkitRequestAnimationFrame||N.mozRequestAnimationFrame||N.oRequestAnimationFrame||N.msRequestAnimationFrame||function(t){setTimeout(t,17)};F.mouse=function(t){return En(t,Q())};var kn=/WebKit/.test(N.navigator.userAgent)?-1:0;function En(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();if(kn<0&&(N.scrollX||N.scrollY)){var i=(e=F.select(u.body).append("svg").style("position","absolute").style("top",0).style("left",0))[0][0].getScreenCTM();kn=!(i.f||i.e),e.remove()}return kn?(r.x=n.pageX,r.y=n.pageY):(r.x=n.clientX,r.y=n.clientY),[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var o=t.getBoundingClientRect();return[n.clientX-o.left-t.clientLeft,n.clientY-o.top-t.clientTop]}function Nn(){}function An(t){var n=t[0],e=t[t.length-1];return n<e?[n,e]:[e,n]}function Tn(t){return t.rangeExtent?t.rangeExtent():An(t.range())}function qn(t,n){var e,r=0,i=t.length-1,o=t[r],u=t[i];return u<o&&(e=r,r=i,i=e,e=o,o=u,u=e),(n=n(u-o))&&(t[r]=n.floor(o),t[i]=n.ceil(u)),t}function Cn(){return Math}function zn(t,n){return F.rebind(t,n,"range","rangeRound","interpolate","clamp")}function Dn(n){return(n=Math.pow(10,Math.round(Math.log(n)/Math.LN10)-1))&&{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}}function Ln(t,n){var e=An(t),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/n)/Math.LN10)),o=n/r*i;return o<=.15?i*=10:o<=.35?i*=5:o<=.75&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function Fn(t,n){return F.range.apply(F,Ln(t,n))}function Hn(t,n){return F.format(",."+Math.max(0,-Math.floor(Math.log(Ln(t,n)[2])/Math.LN10+.01))+"f")}function jn(t,n,e,r){var i=e(t[0],t[1]),o=r(n[0],n[1]);return function(t){return o(i(t))}}function Pn(e,t,n,r){var i=[],o=[],u=0,a=Math.min(e.length,t.length)-1;for(e[a]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++u<=a;)i.push(n(e[u-1],e[u])),o.push(r(t[u-1],t[u]));return function(t){var n=F.bisect(e,t,1,a)-1;return o[n](i[n](t))}}F.touches=function(e,t){return arguments.length<2&&(t=Q().touches),t?f(t).map(function(t){var n=En(e,t);return n.identifier=t.identifier,n}):[]},F.scale={},F.scale.linear=function(){return function t(e,r,i,o){var u,a;function n(){var t=2<Math.min(e.length,r.length)?Pn:jn,n=o?ct:at;return u=t(e,r,n,i),a=t(r,e,n,F.interpolate),c}function c(t){return u(t)}c.invert=function(t){return a(t)};c.domain=function(t){return arguments.length?(e=t.map(Number),n()):e};c.range=function(t){return arguments.length?(r=t,n()):r};c.rangeRound=function(t){return c.range(t).interpolate(F.interpolateRound)};c.clamp=function(t){return arguments.length?(o=t,n()):o};c.interpolate=function(t){return arguments.length?(i=t,n()):i};c.ticks=function(t){return Fn(e,t)};c.tickFormat=function(t){return Hn(e,t)};c.nice=function(){return qn(e,Dn),n()};c.copy=function(){return t(e,r,i,o)};return n()}([0,1],[0,1],F.interpolate,!1)},F.scale.log=function(){return function t(a,c){var l=c.pow;function o(t){return a(c(t))}o.invert=function(t){return l(a.invert(t))};o.domain=function(t){return arguments.length?(c=t[0]<0?Yn:On,l=c.pow,a.domain(t.map(c)),o):a.domain().map(l)};o.nice=function(){return a.domain(qn(a.domain(),Cn)),o};o.ticks=function(){var t=An(a.domain()),n=[];if(t.every(isFinite)){var e=Math.floor(t[0]),r=Math.ceil(t[1]),i=l(t[0]),o=l(t[1]);if(c===Yn)for(n.push(l(e));e++<r;)for(var u=9;0<u;u--)n.push(l(e)*u);else{for(;e<r;e++)for(var u=1;u<10;u++)n.push(l(e)*u);n.push(l(e))}for(e=0;n[e]<i;e++);for(r=n.length;n[r-1]>o;r--);n=n.slice(e,r)}return n};o.tickFormat=function(t,n){if(arguments.length<2&&(n=Rn),!arguments.length)return n;var e,r=Math.max(.1,t/o.ticks().length),i=c===Yn?(e=-1e-12,Math.floor):(e=1e-12,Math.ceil);return function(t){return t/l(i(c(t)+e))<=r?n(t):""}};o.copy=function(){return t(a.copy(),c)};return zn(o,a)}(F.scale.linear(),On)};var Rn=F.format(".0e");function On(t){return Math.log(t<0?0:t)/Math.LN10}function Yn(t){return-Math.log(0<t?0:-t)/Math.LN10}function Un(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}On.pow=function(t){return Math.pow(10,t)},Yn.pow=function(t){return-Math.pow(10,-t)},F.scale.pow=function(){return function t(n,e){var r=Un(e),i=Un(1/e);function o(t){return n(r(t))}o.invert=function(t){return i(n.invert(t))};o.domain=function(t){return arguments.length?(n.domain(t.map(r)),o):n.domain().map(i)};o.ticks=function(t){return Fn(o.domain(),t)};o.tickFormat=function(t){return Hn(o.domain(),t)};o.nice=function(){return o.domain(qn(o.domain(),Dn))};o.exponent=function(t){if(!arguments.length)return e;var n=o.domain();return r=Un(e=t),i=Un(1/e),o.domain(n)};o.copy=function(){return t(n.copy(),e)};return zn(o,n)}(F.scale.linear(),1)},F.scale.sqrt=function(){return F.scale.pow().exponent(.5)},F.scale.ordinal=function(){return function t(c,l){var i,f,s;function h(t){return f[((i.get(t)||i.set(t,c.push(t)))-1)%f.length]}function g(n,e){return F.range(c.length).map(function(t){return n+e*t})}h.domain=function(t){if(!arguments.length)return c;c=[],i=new M;for(var n,e=-1,r=t.length;++e<r;)i.has(n=t[e])||i.set(n,c.push(n));return h[l.t].apply(h,l.a)};h.range=function(t){return arguments.length?(f=t,s=0,l={t:"range",a:arguments},h):f};h.rangePoints=function(t,n){arguments.length<2&&(n=0);var e=t[0],r=t[1],i=(r-e)/(Math.max(1,c.length-1)+n);return f=g(c.length<2?(e+r)/2:e+i*n/2,i),s=0,l={t:"rangePoints",a:arguments},h};h.rangeBands=function(t,n,e){arguments.length<2&&(n=0),arguments.length<3&&(e=n);var r=t[1]<t[0],i=t[r-0],o=t[1-r],u=(o-i)/(c.length-n+2*e);return f=g(i+u*e,u),r&&f.reverse(),s=u*(1-n),l={t:"rangeBands",a:arguments},h};h.rangeRoundBands=function(t,n,e){arguments.length<2&&(n=0),arguments.length<3&&(e=n);var r=t[1]<t[0],i=t[r-0],o=t[1-r],u=Math.floor((o-i)/(c.length-n+2*e)),a=o-i-(c.length-n)*u;return f=g(i+Math.round(a/2),u),r&&f.reverse(),s=Math.round(u*(1-n)),l={t:"rangeRoundBands",a:arguments},h};h.rangeBand=function(){return s};h.rangeExtent=function(){return An(l.a[0])};h.copy=function(){return t(c,l)};return h.domain(c)}([],{t:"range",a:[[]]})},F.scale.category10=function(){return F.scale.ordinal().range(In)},F.scale.category20=function(){return F.scale.ordinal().range(Vn)},F.scale.category20b=function(){return F.scale.ordinal().range(Xn)},F.scale.category20c=function(){return F.scale.ordinal().range(Zn)};var In=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Vn=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],Xn=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],Zn=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];F.scale.quantile=function(){return function t(e,r){var i;function n(){var t=0,n=r.length;for(i=[];++t<n;)i[t-1]=F.quantile(e,t/n);return o}function o(t){return isNaN(t=+t)?NaN:r[F.bisect(i,t)]}o.domain=function(t){return arguments.length?(e=t.filter(function(t){return!isNaN(t)}).sort(F.ascending),n()):e};o.range=function(t){return arguments.length?(r=t,n()):r};o.quantiles=function(){return i};o.copy=function(){return t(e,r)};return n()}([],[])},F.scale.quantize=function(){return function t(n,e,r){var i,o;function u(t){return r[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function a(){return i=r.length/(e-n),o=r.length-1,u}u.domain=function(t){return arguments.length?(n=+t[0],e=+t[t.length-1],a()):[n,e]};u.range=function(t){return arguments.length?(r=t,a()):r};u.copy=function(){return t(n,e,r)};return a()}(0,1,[0,1])},F.scale.threshold=function(){return function t(n,e){function r(t){return e[F.bisect(n,t)]}r.domain=function(t){return arguments.length?(n=t,r):n};r.range=function(t){return arguments.length?(e=t,r):e};r.copy=function(){return t(n,e)};return r}([.5],[0,1])},F.scale.identity=function(){return function t(n){function e(t){return+t}e.invert=e;e.domain=e.range=function(t){return arguments.length?(n=t.map(e),e):n};e.ticks=function(t){return Fn(n,t)};e.tickFormat=function(t){return Hn(n,t)};e.copy=function(){return t(n)};return e}([0,1])},F.svg={},F.svg.arc=function(){var f=Jn,s=Gn,h=Kn,g=Wn;function n(){var t=f.apply(this,arguments),n=s.apply(this,arguments),e=h.apply(this,arguments)+Bn,r=g.apply(this,arguments)+Bn,i=(r<e&&(i=e,e=r,r=i),r-e),o=i<k?"0":"1",u=Math.cos(e),a=Math.sin(e),c=Math.cos(r),l=Math.sin(r);return $n<=i?t?"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z":t?"M"+n*u+","+n*a+"A"+n+","+n+" 0 "+o+",1 "+n*c+","+n*l+"L"+t*c+","+t*l+"A"+t+","+t+" 0 "+o+",0 "+t*u+","+t*a+"Z":"M"+n*u+","+n*a+"A"+n+","+n+" 0 "+o+",1 "+n*c+","+n*l+"L0,0Z"}return n.innerRadius=function(t){return arguments.length?(f=A(t),n):f},n.outerRadius=function(t){return arguments.length?(s=A(t),n):s},n.startAngle=function(t){return arguments.length?(h=A(t),n):h},n.endAngle=function(t){return arguments.length?(g=A(t),n):g},n.centroid=function(){var t=(f.apply(this,arguments)+s.apply(this,arguments))/2,n=(h.apply(this,arguments)+g.apply(this,arguments))/2+Bn;return[Math.cos(n)*t,Math.sin(n)*t]},n};var Bn=-k/2,$n=2*k-1e-6;function Jn(t){return t.innerRadius}function Gn(t){return t.outerRadius}function Kn(t){return t.startAngle}function Wn(t){return t.endAngle}function Qn(l){var f=te,s=ne,h=E,g=re,n=g.key,p=.7;function e(t){var n,e=[],r=[],i=-1,o=t.length,u=A(f),a=A(s);function c(){e.push("M",g(l(r),p))}for(;++i<o;)h.call(this,n=t[i],i)?r.push([+u.call(this,n,i),+a.call(this,n,i)]):r.length&&(c(),r=[]);return r.length&&c(),e.length?e.join(""):null}return e.x=function(t){return arguments.length?(f=t,e):f},e.y=function(t){return arguments.length?(s=t,e):s},e.defined=function(t){return arguments.length?(h=t,e):h},e.interpolate=function(t){return arguments.length?(n="function"==typeof t?g=t:(g=ee.get(t)||re).key,e):n},e.tension=function(t){return arguments.length?(p=t,e):p},e}function te(t){return t[0]}function ne(t){return t[1]}F.svg.line=function(){return Qn(S)};var ee=F.map({linear:re,"linear-closed":function(t){return re(t)+"Z"},"step-before":ie,"step-after":oe,basis:ce,"basis-open":function(t){if(t.length<4)return re(t);var n,e=[],r=-1,i=t.length,o=[0],u=[0];for(;++r<3;)n=t[r],o.push(n[0]),u.push(n[1]);e.push(le(he,o)+","+le(he,u)),--r;for(;++r<i;)n=t[r],o.shift(),o.push(n[0]),u.shift(),u.push(n[1]),ge(e,o,u);return e.join("")},"basis-closed":function(t){var n,e,r=-1,i=t.length,o=i+4,u=[],a=[];for(;++r<4;)e=t[r%i],u.push(e[0]),a.push(e[1]);n=[le(he,u),",",le(he,a)],--r;for(;++r<o;)e=t[r%i],u.shift(),u.push(e[0]),a.shift(),a.push(e[1]),ge(n,u,a);return n.join("")},bundle:function(t,n){var e=t.length-1;if(e)for(var r,i,o=t[0][0],u=t[0][1],a=t[e][0]-o,c=t[e][1]-u,l=-1;++l<=e;)r=t[l],i=l/e,r[0]=n*r[0]+(1-n)*(o+i*a),r[1]=n*r[1]+(1-n)*(u+i*c);return ce(t)},cardinal:function(t,n){return t.length<3?re(t):t[0]+ue(t,ae(t,n))},"cardinal-open":function(t,n){return t.length<4?re(t):t[1]+ue(t.slice(1,t.length-1),ae(t,n))},"cardinal-closed":function(t,n){return t.length<3?re(t):t[0]+ue((t.push(t[0]),t),ae([t[t.length-2]].concat(t,[t[1]]),n))},monotone:function(t){return t.length<3?re(t):t[0]+ue(t,function(t){var n,e,r,i,o=[],u=function(t){var n=0,e=t.length-1,r=[],i=t[0],o=t[1],u=r[0]=pe(i,o);for(;++n<e;)r[n]=(u+(u=pe(i=o,o=t[n+1])))/2;return r[n]=u,r}(t),a=-1,c=t.length-1;for(;++a<c;)n=pe(t[a],t[a+1]),Math.abs(n)<1e-6?u[a]=u[a+1]=0:(e=u[a]/n,r=u[a+1]/n,9<(i=e*e+r*r)&&(i=3*n/Math.sqrt(i),u[a]=i*e,u[a+1]=i*r));a=-1;for(;++a<=c;)i=(t[Math.min(c,a+1)][0]-t[Math.max(0,a-1)][0])/(6*(1+u[a]*u[a])),o.push([i||0,u[a]*i||0]);return o}(t))}});function re(t){return t.join("L")}function ie(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];++n<e;)i.push("V",(r=t[n])[1],"H",r[0]);return i.join("")}function oe(t){for(var n=0,e=t.length,r=t[0],i=[r[0],",",r[1]];++n<e;)i.push("H",(r=t[n])[0],"V",r[1]);return i.join("")}function ue(t,n){if(n.length<1||t.length!=n.length&&t.length!=n.length+2)return re(t);var e=t.length!=n.length,r="",i=t[0],o=t[1],u=n[0],a=u,c=1;if(e&&(r+="Q"+(o[0]-2*u[0]/3)+","+(o[1]-2*u[1]/3)+","+o[0]+","+o[1],i=t[1],c=2),1<n.length){a=n[1],o=t[c],c++,r+="C"+(i[0]+u[0])+","+(i[1]+u[1])+","+(o[0]-a[0])+","+(o[1]-a[1])+","+o[0]+","+o[1];for(var l=2;l<n.length;l++,c++)o=t[c],a=n[l],r+="S"+(o[0]-a[0])+","+(o[1]-a[1])+","+o[0]+","+o[1]}if(e){var f=t[c];r+="Q"+(o[0]+2*a[0]/3)+","+(o[1]+2*a[1]/3)+","+f[0]+","+f[1]}return r}function ae(t,n){for(var e,r=[],i=(1-n)/2,o=t[0],u=t[1],a=1,c=t.length;++a<c;)e=o,o=u,u=t[a],r.push([i*(u[0]-e[0]),i*(u[1]-e[1])]);return r}function ce(t){if(t.length<3)return re(t);var n=1,e=t.length,r=t[0],i=r[0],o=r[1],u=[i,i,i,(r=t[1])[0]],a=[o,o,o,r[1]],c=[i,",",o];for(ge(c,u,a);++n<e;)r=t[n],u.shift(),u.push(r[0]),a.shift(),a.push(r[1]),ge(c,u,a);for(n=-1;++n<2;)u.shift(),u.push(r[0]),a.shift(),a.push(r[1]),ge(c,u,a);return c.join("")}function le(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}ee.forEach(function(t,n){n.key=t,n.closed=/-closed$/.test(t)});var fe=[0,2/3,1/3,0],se=[0,1/3,2/3,0],he=[0,1/6,2/3,1/6];function ge(t,n,e){t.push("C",le(fe,n),",",le(fe,e),",",le(se,n),",",le(se,e),",",le(he,n),",",le(he,e))}function pe(t,n){return(n[1]-t[1])/(n[0]-t[0])}function de(t){for(var n,e,r,i=-1,o=t.length;++i<o;)e=(n=t[i])[0],r=n[1]+Bn,n[0]=e*Math.cos(r),n[1]=e*Math.sin(r);return t}function ve(p){var d=te,v=te,m=0,y=ne,M=E,b=re,n=b.key,x=b,_="L",w=.7;function e(t){var n,e,r,i=[],o=[],u=[],a=-1,c=t.length,l=A(d),f=A(m),s=d===v?function(){return e}:A(v),h=m===y?function(){return r}:A(y);function g(){i.push("M",b(p(u),w),_,x(p(o.reverse()),w),"Z")}for(;++a<c;)M.call(this,n=t[a],a)?(o.push([e=+l.call(this,n,a),r=+f.call(this,n,a)]),u.push([+s.call(this,n,a),+h.call(this,n,a)])):o.length&&(g(),o=[],u=[]);return o.length&&g(),i.length?i.join(""):null}return e.x=function(t){return arguments.length?(d=v=t,e):v},e.x0=function(t){return arguments.length?(d=t,e):d},e.x1=function(t){return arguments.length?(v=t,e):v},e.y=function(t){return arguments.length?(m=y=t,e):y},e.y0=function(t){return arguments.length?(m=t,e):m},e.y1=function(t){return arguments.length?(y=t,e):y},e.defined=function(t){return arguments.length?(M=t,e):M},e.interpolate=function(t){return arguments.length?(n="function"==typeof t?b=t:(b=ee.get(t)||re).key,x=b.reverse||b,_=b.closed?"M":"L",e):n},e.tension=function(t){return arguments.length?(w=t,e):w},e}function me(t){return t.radius}function ye(t){return[t.x,t.y]}function Me(){return 64}function be(){return"circle"}function xe(t){var n=Math.sqrt(t/k);return"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z"}F.svg.line.radial=function(){var t=Qn(de);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},(ie.reverse=oe).reverse=ie,F.svg.area=function(){return ve(S)},F.svg.area.radial=function(){var t=ve(de);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},F.svg.chord=function(){var u=e,a=t,c=me,l=Kn,f=Wn;function n(t,n){var e,r,i=s(this,u,t,n),o=s(this,a,t,n);return"M"+i.p0+h(i.r,i.p1,i.a1-i.a0)+(r=o,(e=i).a0==r.a0&&e.a1==r.a1?g(i.r,i.p1,i.r,i.p0):g(i.r,i.p1,o.r,o.p0)+h(o.r,o.p1,o.a1-o.a0)+g(o.r,o.p1,i.r,i.p0))+"Z"}function s(t,n,e,r){var i=n.call(t,e,r),o=c.call(t,i,r),u=l.call(t,i,r)+Bn,a=f.call(t,i,r)+Bn;return{r:o,a0:u,a1:a,p0:[o*Math.cos(u),o*Math.sin(u)],p1:[o*Math.cos(a),o*Math.sin(a)]}}function h(t,n,e){return"A"+t+","+t+" 0 "+ +(k<e)+",1 "+n}function g(t,n,e,r){return"Q 0,0 "+r}return n.radius=function(t){return arguments.length?(c=A(t),n):c},n.source=function(t){return arguments.length?(u=A(t),n):u},n.target=function(t){return arguments.length?(a=A(t),n):a},n.startAngle=function(t){return arguments.length?(l=A(t),n):l},n.endAngle=function(t){return arguments.length?(f=A(t),n):f},n},F.svg.diagonal=function(){var u=e,a=t,c=ye;function n(t,n){var e=u.call(this,t,n),r=a.call(this,t,n),i=(e.y+r.y)/2,o=[e,{x:e.x,y:i},{x:r.x,y:i},r];return"M"+(o=o.map(c))[0]+"C"+o[1]+" "+o[2]+" "+o[3]}return n.source=function(t){return arguments.length?(u=A(t),n):u},n.target=function(t){return arguments.length?(a=A(t),n):a},n.projection=function(t){return arguments.length?(c=t,n):c},n},F.svg.diagonal.radial=function(){var t=F.svg.diagonal(),n=ye,e=t.projection;return t.projection=function(t){return arguments.length?e((r=n=t,function(){var t=r.apply(this,arguments),n=t[0],e=t[1]+Bn;return[n*Math.cos(e),n*Math.sin(e)]})):n;var r},t},F.svg.symbol=function(){var e=be,r=Me;function n(t,n){return(_e.get(e.call(this,t,n))||xe)(r.call(this,t,n))}return n.type=function(t){return arguments.length?(e=A(t),n):e},n.size=function(t){return arguments.length?(r=A(t),n):r},n};var _e=F.map({circle:xe,cross:function(t){var n=Math.sqrt(t/5)/2;return"M"+-3*n+","+-n+"H"+-n+"V"+-3*n+"H"+n+"V"+-n+"H"+3*n+"V"+n+"H"+n+"V"+3*n+"H"+-n+"V"+n+"H"+-3*n+"Z"},diamond:function(t){var n=Math.sqrt(t/(2*Se)),e=n*Se;return"M0,"+-n+"L"+e+",0 0,"+n+" "+-e+",0Z"},square:function(t){var n=Math.sqrt(t)/2;return"M"+-n+","+-n+"L"+n+","+-n+" "+n+","+n+" "+-n+","+n+"Z"},"triangle-down":function(t){var n=Math.sqrt(t/we),e=n*we/2;return"M0,"+e+"L"+n+","+-e+" "+-n+","+-e+"Z"},"triangle-up":function(t){var n=Math.sqrt(t/we),e=n*we/2;return"M0,"+-e+"L"+n+","+e+" "+-n+","+e+"Z"}});F.svg.symbolTypes=_e.keys();var we=Math.sqrt(3),Se=Math.tan(30*b);F.svg.axis=function(){var k,E=F.scale.linear(),N=ke,A=6,T=6,q=6,C=3,z=[10],D=null,L=0;function r(t){t.each(function(){var t,n=F.select(this),e=null==D?E.ticks?E.ticks.apply(E,z):E.domain():D,r=null==k?E.tickFormat?E.tickFormat.apply(E,z):String:k,i=function(t,n,e){if(r=[],e&&1<n.length){for(var r,i,o,u=An(t.domain()),a=-1,c=n.length,l=(n[1]-n[0])/++e;++a<c;)for(i=e;0<--i;)(o=+n[a]-i*l)>=u[0]&&r.push(o);for(--a,i=0;++i<e&&(o=+n[a]+i*l)<u[1];)r.push(o)}return r}(E,e,L),o=n.selectAll(".tick.minor").data(i,String),u=o.enter().insert("line",".tick").attr("class","tick minor").style("opacity",1e-6),a=F.transition(o.exit()).style("opacity",1e-6).remove(),c=F.transition(o).style("opacity",1),l=n.selectAll(".tick.major").data(e,String),f=l.enter().insert("g","path").attr("class","tick major").style("opacity",1e-6),s=F.transition(l.exit()).style("opacity",1e-6).remove(),h=F.transition(l).style("opacity",1),g=Tn(E),p=n.selectAll(".domain").data([0]),d=(p.enter().append("path").attr("class","domain"),F.transition(p)),v=E.copy(),m=this.__chart__||v;this.__chart__=v,f.append("line"),f.append("text");var y=f.select("line"),M=h.select("line"),b=l.select("text").text(r),x=f.select("text"),_=h.select("text");switch(N){case"bottom":t=Ne,u.attr("y2",T),c.attr("x2",0).attr("y2",T),y.attr("y2",A),x.attr("y",Math.max(A,0)+C),M.attr("x2",0).attr("y2",A),_.attr("x",0).attr("y",Math.max(A,0)+C),b.attr("dy",".71em").style("text-anchor","middle"),d.attr("d","M"+g[0]+","+q+"V0H"+g[1]+"V"+q);break;case"top":t=Ne,u.attr("y2",-T),c.attr("x2",0).attr("y2",-T),y.attr("y2",-A),x.attr("y",-(Math.max(A,0)+C)),M.attr("x2",0).attr("y2",-A),_.attr("x",0).attr("y",-(Math.max(A,0)+C)),b.attr("dy","0em").style("text-anchor","middle"),d.attr("d","M"+g[0]+","+-q+"V0H"+g[1]+"V"+-q);break;case"left":t=Ae,u.attr("x2",-T),c.attr("x2",-T).attr("y2",0),y.attr("x2",-A),x.attr("x",-(Math.max(A,0)+C)),M.attr("x2",-A).attr("y2",0),_.attr("x",-(Math.max(A,0)+C)).attr("y",0),b.attr("dy",".32em").style("text-anchor","end"),d.attr("d","M"+-q+","+g[0]+"H0V"+g[1]+"H"+-q);break;case"right":t=Ae,u.attr("x2",T),c.attr("x2",T).attr("y2",0),y.attr("x2",A),x.attr("x",Math.max(A,0)+C),M.attr("x2",A).attr("y2",0),_.attr("x",Math.max(A,0)+C).attr("y",0),b.attr("dy",".32em").style("text-anchor","start"),d.attr("d","M"+q+","+g[0]+"H0V"+g[1]+"H"+q)}if(E.ticks)f.call(t,m),h.call(t,v),s.call(t,v),u.call(t,m),c.call(t,v),a.call(t,v);else{var w=v.rangeBand()/2,S=function(t){return v(t)+w};f.call(t,S),h.call(t,S)}})}return r.scale=function(t){return arguments.length?(E=t,r):E},r.orient=function(t){return arguments.length?(N=t in Ee?t+"":ke,r):N},r.ticks=function(){return arguments.length?(z=arguments,r):z},r.tickValues=function(t){return arguments.length?(D=t,r):D},r.tickFormat=function(t){return arguments.length?(k=t,r):k},r.tickSize=function(t,n){if(!arguments.length)return A;var e=arguments.length-1;return A=+t,T=1<e?+n:A,q=0<e?+arguments[e]:A,r},r.tickPadding=function(t){return arguments.length?(C=+t,r):C},r.tickSubdivide=function(t){return arguments.length?(L=+t,r):L},r};var ke="bottom",Ee={top:1,right:1,bottom:1,left:1};function Ne(t,n){t.attr("transform",function(t){return"translate("+n(t)+",0)"})}function Ae(t,n){t.attr("transform",function(t){return"translate(0,"+n(t)+")"})}F.svg.brush=function(){var y,M=tt(w,"brushstart","brush","brushend"),b=null,x=null,o=qe[0],_=[[0,0],[0,0]];function w(t){t.each(function(){var t,n=F.select(this),e=n.selectAll(".background").data([0]),r=n.selectAll(".extent").data([0]),i=n.selectAll(".resize").data(o,String);n.style("pointer-events","all").on("mousedown.brush",u).on("touchstart.brush",u),e.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),r.enter().append("rect").attr("class","extent").style("cursor","move"),i.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Te[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),i.style("display",w.empty()?"none":null),i.exit().remove(),b&&(t=Tn(b),e.attr("x",t[0]).attr("width",t[1]-t[0]),k(n)),x&&(t=Tn(x),e.attr("y",t[0]).attr("height",t[1]-t[0]),E(n)),S(n)})}function S(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+_[+/e$/.test(t)][0]+","+_[+/^s/.test(t)][1]+")"})}function k(t){t.select(".extent").attr("x",_[0][0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",_[1][0]-_[0][0])}function E(t){t.select(".extent").attr("y",_[0][1]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",_[1][1]-_[0][1])}function u(){var f,e,n=this,t=F.select(F.event.target),r=M.of(n,arguments),i=F.select(n),o=t.datum(),u=!/^(n|s)$/.test(o)&&b,a=!/^(e|w)$/.test(o)&&x,s=t.classed("extent"),h=p(),c=F.select(N).on("mousemove.brush",d).on("mouseup.brush",m).on("touchmove.brush",d).on("touchend.brush",m).on("keydown.brush",function(){32==F.event.keyCode&&(s||(f=null,h[0]-=_[1][0],h[1]-=_[1][1],s=2),W())}).on("keyup.brush",function(){32==F.event.keyCode&&2==s&&(h[0]+=_[1][0],h[1]+=_[1][1],s=0,W())});if(s)h[0]=_[0][0]-h[0],h[1]=_[0][1]-h[1];else if(o){var l=+/w$/.test(o),g=+/^n/.test(o);e=[_[1-l][0]-h[0],_[1-g][1]-h[1]],h[0]=_[l][0],h[1]=_[g][1]}else F.event.altKey&&(f=h.slice());function p(){var t=F.event.changedTouches;return t?F.touches(n,t)[0]:F.mouse(n)}function d(){var t=p(),n=!1;e&&(t[0]+=e[0],t[1]+=e[1]),s||(F.event.altKey?(f||(f=[(_[0][0]+_[1][0])/2,(_[0][1]+_[1][1])/2]),h[0]=_[+(t[0]<f[0])][0],h[1]=_[+(t[1]<f[1])][1]):f=null),u&&v(t,b,0)&&(k(i),n=!0),a&&v(t,x,1)&&(E(i),n=!0),n&&(S(i),r({type:"brush",mode:s?"move":"resize"}))}function v(t,n,e){var r,i,o=Tn(n),u=o[0],a=o[1],c=h[e],l=_[1][e]-_[0][e];if(s&&(u-=c,a-=l+c),r=Math.max(u,Math.min(a,t[e])),s?i=(r+=c)+l:(f&&(c=Math.max(u,Math.min(a,2*f[e]-r))),c<r?(i=r,r=c):i=c),_[0][e]!==r||_[1][e]!==i)return y=null,_[0][e]=r,_[1][e]=i,!0}function m(){d(),i.style("pointer-events","all").selectAll(".resize").style("display",w.empty()?"none":null),F.select("body").style("cursor",null),c.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),r({type:"brushend"}),W()}i.style("pointer-events","none").selectAll(".resize").style("display",null),F.select("body").style("cursor",t.style("cursor")),r({type:"brushstart"}),d(),W()}return w.x=function(t){return arguments.length?(o=qe[!(b=t)<<1|!x],w):b},w.y=function(t){return arguments.length?(o=qe[!b<<1|!(x=t)],w):x},w.extent=function(t){var n,e,r,i,o;return arguments.length?(y=[[0,0],[0,0]],b&&(n=t[0],e=t[1],x&&(n=n[0],e=e[0]),y[0][0]=n,y[1][0]=e,b.invert&&(n=b(n),e=b(e)),e<n&&(o=n,n=e,e=o),_[0][0]=0|n,_[1][0]=0|e),x&&(r=t[0],i=t[1],b&&(r=r[1],i=i[1]),y[0][1]=r,y[1][1]=i,x.invert&&(r=x(r),i=x(i)),i<r&&(o=r,r=i,i=o),_[0][1]=0|r,_[1][1]=0|i),w):(t=y||_,b&&(n=t[0][0],e=t[1][0],y||(n=_[0][0],e=_[1][0],b.invert&&(n=b.invert(n),e=b.invert(e)),e<n&&(o=n,n=e,e=o))),x&&(r=t[0][1],i=t[1][1],y||(r=_[0][1],i=_[1][1],x.invert&&(r=x.invert(r),i=x.invert(i)),i<r&&(o=r,r=i,i=o))),b&&x?[[n,r],[e,i]]:b?[n,e]:x&&[r,i])},w.clear=function(){return y=null,_[0][0]=_[0][1]=_[1][0]=_[1][1]=0,w},w.empty=function(){return b&&_[0][0]===_[1][0]||x&&_[0][1]===_[1][1]},F.rebind(w,M,"on")};var Te={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},qe=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];F.behavior={},F.behavior.drag=function(){var s=tt(n,"drag","dragstart","dragend"),h=null;function n(){this.on("mousedown.drag",t).on("touchstart.drag",t)}function t(){var r,i=this,o=s.of(i,arguments),t=F.event.target,n=F.event.touches?F.event.changedTouches[0].identifier:null,u=c(),a=0,e=F.select(N).on(null!=n?"touchmove.drag-"+n:"mousemove.drag",function(){if(!i.parentNode)return l();var t=c(),n=t[0]-u[0],e=t[1]-u[1];a|=n|e,u=t,W(),o({type:"drag",x:t[0]+r[0],y:t[1]+r[1],dx:n,dy:e})}).on(null!=n?"touchend.drag-"+n:"mouseup.drag",l,!0);function c(){var t=i.parentNode;return null!=n?F.touches(t).filter(function(t){return t.identifier===n})[0]:F.mouse(t)}function l(){o({type:"dragend"}),a&&(W(),F.event.target===t&&e.on("click.drag",f,!0)),e.on(null!=n?"touchmove.drag-"+n:"mousemove.drag",null).on(null!=n?"touchend.drag-"+n:"mouseup.drag",null)}function f(){W(),e.on("click.drag",null)}r=h?[(r=h.apply(i,arguments)).x-u[0],r.y-u[1]]:[0,0],null==n&&W(),o({type:"dragstart"})}return n.origin=function(t){return arguments.length?(h=t,n):h},F.rebind(n,s,"on")},F.behavior.zoom=function(){var o,u,n,e,r,i,a,c=[0,0],l=1,f=ze,s=tt(h,"zoom");function h(){this.on("mousedown.zoom",t).on("mousemove.zoom",M).on(De+".zoom",y).on("dblclick.zoom",b).on("touchstart.zoom",x).on("touchmove.zoom",_).on("touchend.zoom",x)}function g(t){return[(t[0]-c[0])/l,(t[1]-c[1])/l]}function p(t){l=Math.max(f[0],Math.min(f[1],t))}function d(t,n){var e;n=[(e=n)[0]*l+c[0],e[1]*l+c[1]],c[0]+=t[0]-n[0],c[1]+=t[1]-n[1]}function v(){e&&e.domain(n.range().map(function(t){return(t-c[0])/l}).map(n.invert)),i&&i.domain(r.range().map(function(t){return(t-c[1])/l}).map(r.invert))}function m(t){v(),F.event.preventDefault(),t({type:"zoom",scale:l,translate:c})}function t(){var t=this,n=s.of(t,arguments),e=F.event.target,r=0,i=F.select(N).on("mousemove.zoom",function(){r=1,d(F.mouse(t),o),m(n)}).on("mouseup.zoom",function(){r&&W();i.on("mousemove.zoom",null).on("mouseup.zoom",null),r&&F.event.target===e&&i.on("click.zoom",u,!0)}),o=g(F.mouse(t));function u(){W(),i.on("click.zoom",null)}N.focus(),W()}function y(){o||(o=g(F.mouse(this))),p(Math.pow(2,.002*Ce())*l),d(F.mouse(this),o),m(s.of(this,arguments))}function M(){o=null}function b(){var t=F.mouse(this),n=g(t),e=Math.log(l)/Math.LN2;p(Math.pow(2,F.event.shiftKey?Math.ceil(e)-1:Math.floor(e)+1)),d(t,n),m(s.of(this,arguments))}function x(){var t=F.touches(this),n=Date.now();if(u=l,o={},t.forEach(function(t){o[t.identifier]=g(t)}),W(),1===t.length){if(n-a<500){var e=t[0],r=g(t[0]);p(2*l),d(e,r),m(s.of(this,arguments))}a=n}}function _(){var t=F.touches(this),n=t[0],e=o[n.identifier];if(r=t[1]){var r,i=o[r.identifier];n=[(n[0]+r[0])/2,(n[1]+r[1])/2],e=[(e[0]+i[0])/2,(e[1]+i[1])/2],p(F.event.scale*u)}d(n,e),a=null,m(s.of(this,arguments))}return h.translate=function(t){return arguments.length?(c=t.map(Number),v(),h):c},h.scale=function(t){return arguments.length?(l=+t,v(),h):l},h.scaleExtent=function(t){return arguments.length?(f=null==t?ze:t.map(Number),h):f},h.x=function(t){return arguments.length?(n=(e=t).copy(),c=[0,0],l=1,h):e},h.y=function(t){return arguments.length?(r=(i=t).copy(),c=[0,0],l=1,h):i},F.rebind(h,s,"on")};var Ce,ze=[0,1/0],De="onwheel"in document?(Ce=function(){return-F.event.deltaY*(F.event.deltaMode?120:1)},"wheel"):"onmousewheel"in document?(Ce=function(){return F.event.wheelDelta},"mousewheel"):(Ce=function(){return-F.event.detail},"MozMousePixelScroll");function Le(t){for(var n=t.source,e=t.target,r=function(t,n){if(t===n)return t;var e=Fe(t),r=Fe(n),i=e.pop(),o=r.pop(),u=null;for(;i===o;)u=i,i=e.pop(),o=r.pop();return u}(n,e),i=[n];n!==r;)n=n.parent,i.push(n);for(var o=i.length;e!==r;)i.splice(o,0,e),e=e.parent;return i}function Fe(t){for(var n=[],e=t.parent;null!=e;)n.push(t),e=(t=e).parent;return n.push(t),n}function He(t){t.fixed|=2}function je(t){t.fixed&=-7}function Pe(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Re(t){t.fixed&=-5}F.layout={},F.layout.bundle=function(){return function(t){for(var n=[],e=-1,r=t.length;++e<r;)n.push(Le(t[e]));return n}},F.layout.chord=function(){var v,m,y,M,b,x,_,n={},w=0;function t(){var t,n,e,r,i,o={},u=[],a=F.range(M),c=[];for(v=[],m=[],t=0,r=-1;++r<M;){for(n=0,i=-1;++i<M;)n+=y[r][i];u.push(n),c.push(F.range(M)),t+=n}for(b&&a.sort(function(t,n){return b(u[t],u[n])}),x&&c.forEach(function(t,e){t.sort(function(t,n){return x(y[e][t],y[e][n])})}),t=(2*k-w*M)/t,n=0,r=-1;++r<M;){for(e=n,i=-1;++i<M;){var l=a[r],f=c[l][i],s=y[l][f],h=n,g=n+=s*t;o[l+"-"+f]={index:l,subindex:f,startAngle:h,endAngle:g,value:s}}m[l]={index:l,startAngle:e,endAngle:n,value:(n-e)/t},n+=w}for(r=-1;++r<M;)for(i=r-1;++i<M;){var p=o[r+"-"+i],d=o[i+"-"+r];(p.value||d.value)&&v.push(p.value<d.value?{source:d,target:p}:{source:p,target:d})}_&&S()}function S(){v.sort(function(t,n){return _((t.source.value+t.target.value)/2,(n.source.value+n.target.value)/2)})}return n.matrix=function(t){return arguments.length?(M=(y=t)&&y.length,v=m=null,n):y},n.padding=function(t){return arguments.length?(w=t,v=m=null,n):w},n.sortGroups=function(t){return arguments.length?(b=t,v=m=null,n):b},n.sortSubgroups=function(t){return arguments.length?(x=t,v=null,n):x},n.sortChords=function(t){return arguments.length?(_=t,v&&S(),n):_},n.chords=function(){return v||t(),v},n.groups=function(){return m||t(),m},n},F.layout.force=function(){var t,s,h,g,p,i={},d=F.dispatch("start","tick","end"),v=[1,1],m=.9,o=Oe,y=Ye,M=-30,b=.1,l=.8,x=[],_=[];function w(c){return function(t,n,e,r){if(t.point!==c){var i=t.cx-c.x,o=t.cy-c.y,u=1/Math.sqrt(i*i+o*o);if((r-n)*u<l){var a=t.charge*u*u;return c.px-=i*a,c.py-=o*a,!0}if(t.point&&isFinite(u)){a=t.pointCharge*u*u;c.px-=i*a,c.py-=o*a}}return!t.charge}}function n(t){t.px=F.event.x,t.py=F.event.y,i.resume()}return i.tick=function(){if((s*=.99)<.005)return d.end({type:"end",alpha:s=0}),!0;var t,n,e,r,i,o,u,a,c,l=x.length,f=_.length;for(n=0;n<f;++n)r=(e=_[n]).source,(o=(a=(i=e.target).x-r.x)*a+(c=i.y-r.y)*c)&&(a*=o=s*g[n]*((o=Math.sqrt(o))-h[n])/o,c*=o,i.x-=a*(u=r.weight/(i.weight+r.weight)),i.y-=c*u,r.x+=a*(u=1-u),r.y+=c*u);if((u=s*b)&&(a=v[0]/2,c=v[1]/2,n=-1,u))for(;++n<l;)(e=x[n]).x+=(a-e.x)*u,e.y+=(c-e.y)*u;if(M)for(!function t(n,e,r){var i=0,o=0;n.charge=0;if(!n.leaf)for(var u,a=n.nodes,c=a.length,l=-1;++l<c;)null!=(u=a[l])&&(t(u,e,r),n.charge+=u.charge,i+=u.charge*u.cx,o+=u.charge*u.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var f=e*r[n.point.index];n.charge+=n.pointCharge=f,i+=f*n.point.x,o+=f*n.point.y}n.cx=i/n.charge;n.cy=o/n.charge}(t=F.geom.quadtree(x),s,p),n=-1;++n<l;)(e=x[n]).fixed||t.visit(w(e));for(n=-1;++n<l;)(e=x[n]).fixed?(e.x=e.px,e.y=e.py):(e.x-=(e.px-(e.px=e.x))*m,e.y-=(e.py-(e.py=e.y))*m);d.tick({type:"tick",alpha:s})},i.nodes=function(t){return arguments.length?(x=t,i):x},i.links=function(t){return arguments.length?(_=t,i):_},i.size=function(t){return arguments.length?(v=t,i):v},i.linkDistance=function(t){return arguments.length?(o="function"==typeof t?t:+t,i):o},i.distance=i.linkDistance,i.linkStrength=function(t){return arguments.length?(y="function"==typeof t?t:+t,i):y},i.friction=function(t){return arguments.length?(m=+t,i):m},i.charge=function(t){return arguments.length?(M="function"==typeof t?t:+t,i):M},i.gravity=function(t){return arguments.length?(b=+t,i):b},i.theta=function(t){return arguments.length?(l=+t,i):l},i.alpha=function(t){return arguments.length?(t=+t,s?s=0<t?t:0:0<t&&(d.start({type:"start",alpha:s=t}),F.timer(i.tick)),i):s},i.start=function(){var u,a,c,t,l=x.length,f=_.length,n=v[0],e=v[1];for(u=0;u<l;++u)(t=x[u]).index=u,t.weight=0;for(u=0;u<f;++u)"number"==typeof(t=_[u]).source&&(t.source=x[t.source]),"number"==typeof t.target&&(t.target=x[t.target]),++t.source.weight,++t.target.weight;for(u=0;u<l;++u)t=x[u],isNaN(t.x)&&(t.x=r("x",n)),isNaN(t.y)&&(t.y=r("y",e)),isNaN(t.px)&&(t.px=t.x),isNaN(t.py)&&(t.py=t.y);if(h=[],"function"==typeof o)for(u=0;u<f;++u)h[u]=+o.call(this,_[u],u);else for(u=0;u<f;++u)h[u]=o;if(g=[],"function"==typeof y)for(u=0;u<f;++u)g[u]=+y.call(this,_[u],u);else for(u=0;u<f;++u)g[u]=y;if(p=[],"function"==typeof M)for(u=0;u<l;++u)p[u]=+M.call(this,x[u],u);else for(u=0;u<l;++u)p[u]=M;function r(t,n){for(var e,r=function(){if(!c){for(c=[],a=0;a<l;++a)c[a]=[];for(a=0;a<f;++a){var t=_[a];c[t.source.index].push(t.target),c[t.target.index].push(t.source)}}return c[u]}(),i=-1,o=r.length;++i<o;)if(!isNaN(e=r[i][t]))return e;return Math.random()*n}return i.resume()},i.resume=function(){return i.alpha(.1)},i.stop=function(){return i.alpha(0)},i.drag=function(){if(t||(t=F.behavior.drag().origin(S).on("dragstart.force",He).on("drag.force",n).on("dragend.force",je)),!arguments.length)return t;this.on("mouseover.force",Pe).on("mouseout.force",Re).call(t)},F.rebind(i,d,"on")};var Oe=20,Ye=1;F.layout.partition=function(){var r=F.layout.hierarchy(),i=[1,1];function n(t,n){var e=r.call(this,t,n);return function t(n,e,r,i){var o=n.children;if(n.x=e,n.y=n.depth*i,n.dx=r,n.dy=i,o&&(u=o.length)){var u,a,c,l=-1;for(r=n.value?r/n.value:0;++l<u;)t(a=o[l],e,c=a.value*r,i),e+=c}}(e[0],0,i[0],i[1]/function t(n){var e=n.children,r=0;if(e&&(i=e.length))for(var i,o=-1;++o<i;)r=Math.max(r,t(e[o]));return 1+r}(e[0])),e}return n.size=function(t){return arguments.length?(i=t,n):i},er(n,r)},F.layout.pie=function(){var a=Number,c=Ue,n=0,l=2*k;function f(e){var r=e.map(function(t,n){return+a.call(f,t,n)}),i=+("function"==typeof n?n.apply(this,arguments):n),o=(("function"==typeof l?l.apply(this,arguments):l)-n)/F.sum(r),t=F.range(e.length);null!=c&&t.sort(c===Ue?function(t,n){return r[n]-r[t]}:function(t,n){return c(e[t],e[n])});var u=[];return t.forEach(function(t){var n;u[t]={data:e[t],value:n=r[t],startAngle:i,endAngle:i+=n*o}}),u}return f.value=function(t){return arguments.length?(a=t,f):a},f.sort=function(t){return arguments.length?(c=t,f):c},f.startAngle=function(t){return arguments.length?(n=t,f):n},f.endAngle=function(t){return arguments.length?(l=t,f):l},f};var Ue={};function Ie(t){return t.x}function Ve(t){return t.y}function Xe(t,n,e){t.y0=n,t.y=e}F.layout.stack=function(){var s=S,h=$e,g=Je,p=Xe,d=Ie,v=Ve;function m(t,n){var e=t.map(function(t,n){return s.call(m,t,n)}),r=e.map(function(t){return t.map(function(t,n){return[d.call(m,t,n),v.call(m,t,n)]})}),i=h.call(m,r,n);e=F.permute(e,i),r=F.permute(r,i);var o,u,a,c=g.call(m,r,n),l=e.length,f=e[0].length;for(u=0;u<f;++u)for(p.call(m,e[0][u],a=c[u],r[0][u][1]),o=1;o<l;++o)p.call(m,e[o][u],a+=r[o-1][u][1],r[o][u][1]);return t}return m.values=function(t){return arguments.length?(s=t,m):s},m.order=function(t){return arguments.length?(h="function"==typeof t?t:Ze.get(t)||$e,m):h},m.offset=function(t){return arguments.length?(g="function"==typeof t?t:Be.get(t)||Je,m):g},m.x=function(t){return arguments.length?(d=t,m):d},m.y=function(t){return arguments.length?(v=t,m):v},m.out=function(t){return arguments.length?(p=t,m):p},m};var Ze=F.map({"inside-out":function(t){var n,e,r=t.length,i=t.map(Ge),o=t.map(Ke),u=F.range(r).sort(function(t,n){return i[t]-i[n]}),a=0,c=0,l=[],f=[];for(n=0;n<r;++n)e=u[n],a<c?(a+=o[e],l.push(e)):(c+=o[e],f.push(e));return f.reverse().concat(l)},reverse:function(t){return F.range(t.length).reverse()},default:$e}),Be=F.map({silhouette:function(t){var n,e,r,i=t.length,o=t[0].length,u=[],a=0,c=[];for(e=0;e<o;++e){for(r=n=0;n<i;n++)r+=t[n][e][1];a<r&&(a=r),u.push(r)}for(e=0;e<o;++e)c[e]=(a-u[e])/2;return c},wiggle:function(t){var n,e,r,i,o,u,a,c,l,f=t.length,s=t[0],h=s.length,g=[];for(g[0]=c=l=0,e=1;e<h;++e){for(i=n=0;n<f;++n)i+=t[n][e][1];for(o=n=0,a=s[e][0]-s[e-1][0];n<f;++n){for(r=0,u=(t[n][e][1]-t[n][e-1][1])/(2*a);r<n;++r)u+=(t[r][e][1]-t[r][e-1][1])/a;o+=u*t[n][e][1]}g[e]=c-=i?o/i*a:0,c<l&&(l=c)}for(e=0;e<h;++e)g[e]-=l;return g},expand:function(t){var n,e,r,i=t.length,o=t[0].length,u=1/i,a=[];for(e=0;e<o;++e){for(r=n=0;n<i;n++)r+=t[n][e][1];if(r)for(n=0;n<i;n++)t[n][e][1]/=r;else for(n=0;n<i;n++)t[n][e][1]=u}for(e=0;e<o;++e)a[e]=0;return a},zero:Je});function $e(t){return F.range(t.length)}function Je(t){for(var n=-1,e=t[0].length,r=[];++n<e;)r[n]=0;return r}function Ge(t){for(var n,e=1,r=0,i=t[0][1],o=t.length;e<o;++e)(n=t[e][1])>i&&(r=e,i=n);return r}function Ke(t){return t.reduce(We,0)}function We(t,n){return t+n[1]}function Qe(t,n){return tr(t,Math.ceil(Math.log(n.length)/Math.LN2+1))}function tr(t,n){for(var e=-1,r=+t[0],i=(t[1]-r)/n,o=[];++e<=n;)o[e]=i*e+r;return o}function nr(t){return[F.min(t),F.max(t)]}function er(t,n){return F.rebind(t,n,"sort","children","value"),(t.nodes=t).links=ur,t}function rr(t){return t.children}function ir(t){return t.value}function or(t,n){return n.value-t.value}function ur(t){return F.merge(t.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function ar(t,n){return t.value-n.value}function cr(t,n){var e=t._pack_next;(t._pack_next=n)._pack_prev=t,(n._pack_next=e)._pack_prev=n}function lr(t,n){(t._pack_next=n)._pack_prev=t}function fr(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r+n.r;return.001<i*i-e*e-r*r}function sr(t){if((n=t.children)&&(c=n.length)){var n,e,r,i,o,u,a,c,l=1/0,f=-1/0,s=1/0,h=-1/0;if(n.forEach(hr),(e=n[0]).x=-e.r,e.y=0,M(e),1<c&&((r=n[1]).x=r.r,r.y=0,M(r),2<c))for(pr(e,r,i=n[2]),M(i),cr(e,i),cr(e._pack_prev=i,r),r=e._pack_next,o=3;o<c;o++){pr(e,r,i=n[o]);var g=0,p=1,d=1;for(u=r._pack_next;u!==r;u=u._pack_next,p++)if(fr(u,i)){g=1;break}if(1==g)for(a=e._pack_prev;a!==u._pack_prev&&!fr(a,i);a=a._pack_prev,d++);g?(p<d||p==d&&r.r<e.r?lr(e,r=u):lr(e=a,r),o--):(cr(e,i),M(r=i))}var v=(l+f)/2,m=(s+h)/2,y=0;for(o=0;o<c;o++)(i=n[o]).x-=v,i.y-=m,y=Math.max(y,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=y,n.forEach(gr)}function M(t){l=Math.min(t.x-t.r,l),f=Math.max(t.x+t.r,f),s=Math.min(t.y-t.r,s),h=Math.max(t.y+t.r,h)}}function hr(t){t._pack_next=t._pack_prev=t}function gr(t){delete t._pack_next,delete t._pack_prev}function pr(t,n,e){var r=t.r+e.r,i=n.x-t.x,o=n.y-t.y;if(r&&(i||o)){var u=n.r+e.r,a=i*i+o*o,c=.5+((r*=r)-(u*=u))/(2*a),l=Math.sqrt(Math.max(0,2*u*(r+a)-(r-=a)*r-u*u))/(2*a);e.x=t.x+c*i+l*o,e.y=t.y+c*o-l*i}else e.x=t.x+r,e.y=t.y}function dr(t,n){return t.parent==n.parent?1:2}function vr(t){var n=t.children;return n&&n.length?n[0]:t._tree.thread}function mr(t){var n,e=t.children;return e&&(n=e.length)?e[n-1]:t._tree.thread}function yr(t,n){var e=t.children;if(e&&(i=e.length))for(var r,i,o=-1;++o<i;)0<n(r=yr(e[o],n),t)&&(t=r);return t}function Mr(t,n){return t.x-n.x}function br(t,n){return n.x-t.x}function xr(t,n){return t.depth-n.depth}function _r(t,c){!function t(n,e){var r=n.children;if(r&&(o=r.length))for(var i,o,u=null,a=-1;++a<o;)t(i=r[a],u),u=i;c(n,e)}(t,null)}function wr(t,n,e){t=t._tree;var r=e/((n=n._tree).number-t.number);t.change+=r,n.change-=r,n.shift+=e,n.prelim+=e,n.mod+=e}function Sr(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function kr(t,n){var e=t.x+n[3],r=t.y+n[0],i=t.dx-n[1]-n[3],o=t.dy-n[0]-n[2];return i<0&&(e+=i/2,i=0),o<0&&(r+=o/2,o=0),{x:e,y:r,dx:i,dy:o}}function Er(n,e){var r=new RegExp('["'+n+"\n]"),h=n.charCodeAt(0);function i(t,n){return F.xhr(t,e,n).response(o)}function o(t){return i.parse(t.responseText)}function u(t){return t.map(a).join(n)}function a(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return i.parse=function(t){var n;return i.parseRows(t,function(t){if(n)return n(t);n=new Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}")})},i.parseRows=function(i,t){var n,o,u={},a={},e=[],c=i.length,l=0,r=0;function f(){if(c<=l)return a;if(o)return o=!1,u;var t=l;if(34===i.charCodeAt(t)){for(var n=t;n++<c;)if(34===i.charCodeAt(n)){if(34!==i.charCodeAt(n+1))break;++n}return l=n+2,13===(e=i.charCodeAt(n+1))?(o=!0,10===i.charCodeAt(n+2)&&++l):10===e&&(o=!0),i.substring(t+1,n).replace(/""/g,'"')}for(;l<c;){var e,r=1;if(10===(e=i.charCodeAt(l++)))o=!0;else if(13===e)o=!0,10===i.charCodeAt(l)&&(++l,++r);else if(e!==h)continue;return i.substring(t,l-r)}return i.substring(t)}for(;(n=f())!==a;){for(var s=[];n!==u&&n!==a;)s.push(n),n=f();t&&!(s=t(s,r++))||e.push(s)}return e},i.format=function(t){return t.map(u).join("\n")},i}function Nr(t,n){Tr.hasOwnProperty(t.type)&&Tr[t.type](t,n)}F.layout.histogram=function(){var s=!0,h=Number,g=nr,p=Qe;function e(t,n){for(var e,r,i=[],o=t.map(h,this),u=g.call(this,o,n),a=p.call(this,u,o,n),c=(n=-1,o.length),l=a.length-1,f=s?1:1/c;++n<l;)(e=i[n]=[]).dx=a[n+1]-(e.x=a[n]),e.y=0;if(0<l)for(n=-1;++n<c;)(r=o[n])>=u[0]&&r<=u[1]&&((e=i[F.bisect(a,r,1,l)-1]).y+=f,e.push(t[n]));return i}return e.value=function(t){return arguments.length?(h=t,e):h},e.range=function(t){return arguments.length?(g=A(t),e):g},e.bins=function(n){return arguments.length?(p="number"==typeof n?function(t){return tr(t,n)}:A(n),e):p},e.frequency=function(t){return arguments.length?(s=!!t,e):s},e},F.layout.hierarchy=function(){var s=or,h=rr,g=ir;function p(t){var n=[];return function t(n,e,r){var i=h.call(p,n,e);if(n.depth=e,r.push(n),i&&(o=i.length)){for(var o,u,a=-1,c=n.children=[],l=0,f=e+1;++a<o;)(u=t(i[a],f,r)).parent=n,c.push(u),l+=u.value;s&&c.sort(s),g&&(n.value=l)}else g&&(n.value=+g.call(p,n,e)||0);return n}(t,0,n),n}return p.sort=function(t){return arguments.length?(s=t,p):s},p.children=function(t){return arguments.length?(h=t,p):h},p.value=function(t){return arguments.length?(g=t,p):g},p.revalue=function(t){return function t(n,e){var r=n.children,i=0;if(r&&(o=r.length))for(var o,u=-1,a=e+1;++u<o;)i+=t(r[u],a);else g&&(i=+g.call(p,n,e)||0);return g&&(n.value=i),i}(t,0),t},p},F.layout.pack=function(){var c=F.layout.hierarchy().sort(ar),l=0,f=[1,1];function n(t,n){var e=c.call(this,t,n),r=e[0];r.x=0,r.y=0,_r(r,function(t){t.r=Math.sqrt(t.value)}),_r(r,sr);var i=f[0],o=f[1],u=Math.max(2*r.r/i,2*r.r/o);if(0<l){var a=l*u/2;_r(r,function(t){t.r+=a}),_r(r,sr),_r(r,function(t){t.r-=a}),u=Math.max(2*r.r/i,2*r.r/o)}return function t(n,e,r,i){var o=n.children;n.x=e+=i*n.x;n.y=r+=i*n.y;n.r*=i;if(o)for(var u=-1,a=o.length;++u<a;)t(o[u],e,r,i)}(r,i/2,o/2,1/u),e}return n.size=function(t){return arguments.length?(f=t,n):f},n.padding=function(t){return arguments.length?(l=+t,n):l},er(n,c)},F.layout.cluster=function(){var f=F.layout.hierarchy().sort(null).value(null),s=dr,h=[1,1];function n(t,n){var i,e=f.call(this,t,n),r=e[0],o=0;_r(r,function(t){var n,e,r=t.children;r&&r.length?(t.x=(e=r).reduce(function(t,n){return t+n.x},0)/e.length,t.y=(n=r,1+F.max(n,function(t){return t.y}))):(t.x=i?o+=s(t,i):0,t.y=0,i=t)});var u=function t(n){var e=n.children;return e&&e.length?t(e[0]):n}(r),a=function t(n){var e,r=n.children;return r&&(e=r.length)?t(r[e-1]):n}(r),c=u.x-s(u,a)/2,l=a.x+s(a,u)/2;return _r(r,function(t){t.x=(t.x-c)/(l-c)*h[0],t.y=(1-(r.y?t.y/r.y:1))*h[1]}),e}return n.separation=function(t){return arguments.length?(s=t,n):s},n.size=function(t){return arguments.length?(h=t,n):h},er(n,f)},F.layout.tree=function(){var f=F.layout.hierarchy().sort(null).value(null),d=dr,s=[1,1];function n(t,n){var e=f.call(this,t,n),r=e[0];function h(t,n,e){if(n){for(var r,i=t,o=t,u=n,a=t.parent.children[0],c=i._tree.mod,l=o._tree.mod,f=u._tree.mod,s=a._tree.mod;u=mr(u),i=vr(i),u&&i;)a=vr(a),(o=mr(o))._tree.ancestor=t,0<(r=u._tree.prelim+f-i._tree.prelim-c+d(u,i))&&(wr((g=t,p=e,(h=u)._tree.ancestor.parent==g.parent?h._tree.ancestor:p),t,r),c+=r,l+=r),f+=u._tree.mod,c+=i._tree.mod,s+=a._tree.mod,l+=o._tree.mod;u&&!mr(o)&&(o._tree.thread=u,o._tree.mod+=f-l),i&&!vr(a)&&(a._tree.thread=i,a._tree.mod+=c-s,e=t)}var h,g,p;return e}_r(r,function(t,n){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number:n?n._tree.number+1:0}}),function t(n,e){var r=n.children,i=n._tree;if(r&&(o=r.length)){for(var o,u,a,c=r[0],l=c,f=-1;++f<o;)t(a=r[f],u),l=h(a,u,l),u=a;!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;0<=--o;)(n=i[o]._tree).prelim+=e,n.mod+=e,e+=n.shift+(r+=n.change)}(n);var s=.5*(c._tree.prelim+a._tree.prelim);e?(i.prelim=e._tree.prelim+d(n,e),i.mod=i.prelim-s):i.prelim=s}else e&&(i.prelim=e._tree.prelim+d(n,e))}(r),function t(n,e){n.x=n._tree.prelim+e;var r=n.children;if(r&&(i=r.length)){var i,o=-1;for(e+=n._tree.mod;++o<i;)t(r[o],e)}}(r,-r._tree.prelim);var i=yr(r,br),o=yr(r,Mr),u=yr(r,xr),a=i.x-d(i,o)/2,c=o.x+d(o,i)/2,l=u.depth||1;return _r(r,function(t){t.x=(t.x-a)/(c-a)*s[0],t.y=t.depth/l*s[1],delete t._tree}),e}return n.separation=function(t){return arguments.length?(d=t,n):d},n.size=function(t){return arguments.length?(s=t,n):s},er(n,f)},F.layout.treemap=function(){var r,i=F.layout.hierarchy(),f=Math.round,o=[1,1],u=null,s=Sr,a=!1,h="squarify",c=.5*(1+Math.sqrt(5));function g(t,n){for(var e,r,i=-1,o=t.length;++i<o;)r=(e=t[i]).value*(n<0?0:n),e.area=isNaN(r)||r<=0?0:r}function p(t){var n=t.children;if(n&&n.length){var e,r,i,o=s(t),u=[],a=n.slice(),c=1/0,l="slice"===h?o.dx:"dice"===h?o.dy:"slice-dice"===h?1&t.depth?o.dy:o.dx:Math.min(o.dx,o.dy);for(g(a,o.dx*o.dy/t.value),u.area=0;0<(i=a.length);)u.push(e=a[i-1]),u.area+=e.area,c="squarify"!==h||(r=d(u,l))<=c?(a.pop(),r):(u.area-=u.pop().area,v(u,l,o,!1),l=Math.min(o.dx,o.dy),u.length=u.area=0,1/0);u.length&&(v(u,l,o,!0),u.length=u.area=0),n.forEach(p)}}function l(t){var n=t.children;if(n&&n.length){var e,r=s(t),i=n.slice(),o=[];for(g(i,r.dx*r.dy/t.value),o.area=0;e=i.pop();)o.push(e),o.area+=e.area,null!=e.z&&(v(o,e.z?r.dx:r.dy,r,!i.length),o.length=o.area=0);n.forEach(l)}}function d(t,n){for(var e,r=t.area,i=0,o=1/0,u=-1,a=t.length;++u<a;)(e=t[u].area)&&(e<o&&(o=e),i<e&&(i=e));return n*=n,(r*=r)?Math.max(n*i*c/r,r/(n*o*c)):1/0}function v(t,n,e,r){var i,o=-1,u=t.length,a=e.x,c=e.y,l=n?f(t.area/n):0;if(n==e.dx){for((r||l>e.dy)&&(l=e.dy);++o<u;)(i=t[o]).x=a,i.y=c,i.dy=l,a+=i.dx=Math.min(e.x+e.dx-a,l?f(i.area/l):0);i.z=!0,i.dx+=e.x+e.dx-a,e.y+=l,e.dy-=l}else{for((r||l>e.dx)&&(l=e.dx);++o<u;)(i=t[o]).x=a,i.y=c,i.dx=l,c+=i.dy=Math.min(e.y+e.dy-c,l?f(i.area/l):0);i.z=!1,i.dy+=e.y+e.dy-c,e.x+=l,e.dx-=l}}function m(t){var n=r||i(t),e=n[0];return e.x=0,e.y=0,e.dx=o[0],e.dy=o[1],r&&i.revalue(e),g([e],e.dx*e.dy/e.value),(r?l:p)(e),a&&(r=n),n}return m.size=function(t){return arguments.length?(o=t,m):o},m.padding=function(e){if(!arguments.length)return u;function t(t){return kr(t,e)}var n;return s=null==(u=e)?Sr:"function"==(n=typeof e)?function(t){var n=e.call(m,t,t.depth);return null==n?Sr(t):kr(t,"number"==typeof n?[n,n,n,n]:n)}:("number"===n&&(e=[e,e,e,e]),t),m},m.round=function(t){return arguments.length?(f=t?Math.round:Number,m):f!=Number},m.sticky=function(t){return arguments.length?(a=t,r=null,m):a},m.ratio=function(t){return arguments.length?(c=t,m):c},m.mode=function(t){return arguments.length?(h=t+"",m):h},er(m,i)},F.csv=Er(",","text/csv"),F.tsv=Er("\t","text/tab-separated-values"),F.geo={},F.geo.stream=function(t,n){Ar.hasOwnProperty(t.type)?Ar[t.type](t,n):Nr(t,n)};var Ar={Feature:function(t,n){Nr(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)Nr(e[r].geometry,n)}},Tr={Sphere:function(t,n){n.sphere()},Point:function(t,n){var e=t.coordinates;n.point(e[0],e[1])},MultiPoint:function(t,n){for(var e,r=t.coordinates,i=-1,o=r.length;++i<o;)e=r[i],n.point(e[0],e[1])},LineString:function(t,n){qr(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)qr(e[r],n,0)},Polygon:function(t,n){Cr(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)Cr(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)Nr(e[r],n)}};function qr(t,n,e){var r,i=-1,o=t.length-e;for(n.lineStart();++i<o;)r=t[i],n.point(r[0],r[1]);n.lineEnd()}function Cr(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)qr(t[e],n,1);n.polygonEnd()}function zr(t){return[Math.atan2(t[1],t[0]),Math.asin(Math.max(-1,Math.min(1,t[2])))]}function Dr(t,n){return Math.abs(t[0]-n[0])<z&&Math.abs(t[1]-n[1])<z}function Lr(t){var n=t[0],e=t[1],r=Math.cos(e);return[r*Math.cos(n),r*Math.sin(n),Math.sin(e)]}function Fr(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Hr(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function jr(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Pr(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Rr(T){var q=.5,y=16;function n(c){var l,f,s,h,g,p,d={point:t,lineStart:n,lineEnd:m,polygonStart:function(){c.polygonStart(),d.lineStart=e},polygonEnd:function(){c.polygonEnd(),d.lineStart=n}};function t(t,n){t=T(t,n),c.point(t[0],t[1])}function n(){f=NaN,d.point=v,c.lineStart()}function v(t,n){var e=Lr([t,n]),r=T(t,n);C(f,s,l,h,g,p,f=r[0],s=r[1],l=t,h=e[0],g=e[1],p=e[2],y,c),c.point(f,s)}function m(){d.point=t,c.lineEnd()}function e(){var e,r,i,o,u,a;n(),d.point=function(t,n){v(e=t,n),r=f,i=s,o=h,u=g,a=p,d.point=v},d.lineEnd=function(){C(f,s,l,h,g,p,r,i,e,o,u,a,y,c),(d.lineEnd=m)()}}return d}function C(t,n,e,r,i,o,u,a,c,l,f,s,h,g){var p=u-t,d=a-n,v=p*p+d*d;if(4*q<v&&h--){var m=r+l,y=i+f,M=o+s,b=Math.sqrt(m*m+y*y+M*M),x=Math.asin(M/=b),_=Math.abs(Math.abs(M)-1)<z?(e+c)/2:Math.atan2(y,m),w=T(_,x),S=w[0],k=w[1],E=S-t,N=k-n,A=d*E-p*N;(q<A*A/v||.3<Math.abs((p*E+d*N)/v-.5))&&(C(t,n,e,r,i,o,S,k,_,m/=b,y/=b,M,h,g),g.point(S,k),C(S,k,_,m,y,M,u,a,c,l,f,s,h,g))}}return n.precision=function(t){return arguments.length?(y=0<(q=t*t)&&16,n):Math.sqrt(q)},n}function Or(t,n){var e=Math.sin(t),r=(e+Math.sin(n))/2,i=1+e*(2*r-e),o=Math.sqrt(i)/r;function u(t,n){var e=Math.sqrt(i-2*r*Math.sin(n))/r;return[e*Math.sin(t*=r),o-e*Math.cos(t)]}return u.invert=function(t,n){var e=o-n;return[Math.atan2(t,e)/r,Math.asin((i-(t*t+e*e)*r*r)/(2*r))]},u}F.geo.albersUsa=function(){var i=F.geo.albers(),o=F.geo.albers().rotate([160,0]).center([0,60]).parallels([55,65]),u=F.geo.albers().rotate([160,0]).center([0,20]).parallels([8,18]),a=F.geo.albers().rotate([60,0]).center([0,10]).parallels([8,18]);function c(t){return e=(n=t)[0],(50<(r=n[1])?o:e<-140?u:r<21?a:i)(t);var n,e,r}return c.scale=function(t){return arguments.length?(i.scale(t),o.scale(.6*t),u.scale(t),a.scale(1.5*t),c.translate(i.translate())):i.scale()},c.translate=function(t){if(!arguments.length)return i.translate();var n=i.scale(),e=t[0],r=t[1];return i.translate(t),o.translate([e-.4*n,r+.17*n]),u.translate([e-.19*n,r+.2*n]),a.translate([e+.58*n,r+.43*n]),c},c.scale(i.scale())},(F.geo.albers=function(){var n=29.5*b,e=45.5*b,r=Ci(Or),t=r(n,e);return t.parallels=function(t){return arguments.length?r(n=t[0]*b,e=t[1]*b):[n*x,e*x]},t.rotate([98,0]).center([0,38]).scale(1e3)}).raw=Or;var Yr=ji(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(F.geo.azimuthalEqualArea=function(){return qi(Yr)}).raw=Yr;var Ur,Ir,Vr,Xr,Zr,Br=ji(function(t){var n=Math.acos(t);return n&&n/Math.sin(n)},S);function $r(n){var e,r,i,o,u={point:t,lineStart:Nn,lineEnd:Nn,polygonStart:function(){u.lineEnd=a},polygonEnd:function(){u.point=t}};function t(t,n){t<e&&(e=t),i<t&&(i=t),n<r&&(r=n),o<n&&(o=n)}function a(){u.point=u.lineEnd=Nn}return function(t){return o=i=-(e=r=1/0),F.geo.stream(t,n(u)),[[e,r],[i,o]]}}(F.geo.azimuthalEquidistant=function(){return qi(Br)}).raw=Br,F.geo.bounds=$r(S),F.geo.centroid=function(t){var n;if(Ur=Ir=Vr=Xr=Zr=0,F.geo.stream(t,Jr),Ir&&Math.abs(n=Math.sqrt(Vr*Vr+Xr*Xr+Zr*Zr))>z)return[Math.atan2(Xr,Vr)*x,Math.asin(Math.max(-1,Math.min(1,Zr/n)))*x]};var Jr={sphere:function(){Ur<2&&(Ur=2,Ir=Vr=Xr=Zr=0)},point:Gr,lineStart:Wr,lineEnd:Qr,polygonStart:function(){Ur<2&&(Ur=2,Ir=Vr=Xr=Zr=0),Jr.lineStart=Kr},polygonEnd:function(){Jr.lineStart=Wr}};function Gr(t,n){if(!Ur){++Ir,t*=b;var e=Math.cos(n*=b);Vr+=(e*Math.cos(t)-Vr)/Ir,Xr+=(e*Math.sin(t)-Xr)/Ir,Zr+=(Math.sin(n)-Zr)/Ir}}function Kr(){var e,r;Ur=1,Wr(),Ur=2;var i=Jr.point;Jr.point=function(t,n){i(e=t,r=n)},Jr.lineEnd=function(){Jr.point(e,r),Qr(),Jr.lineEnd=Qr}}function Wr(){var a,c,l;function r(t,n){t*=b;var e=Math.cos(n*=b),r=e*Math.cos(t),i=e*Math.sin(t),o=Math.sin(n),u=Math.atan2(Math.sqrt((u=c*o-l*i)*u+(u=l*r-a*o)*u+(u=a*i-c*r)*u),a*r+c*i+l*o);Ir+=u,Vr+=u*(a+(a=r)),Xr+=u*(c+(c=i)),Zr+=u*(l+(l=o))}1<Ur||(Ur<1&&(Ur=1,Ir=Vr=Xr=Zr=0),Jr.point=function(t,n){t*=b;var e=Math.cos(n*=b);a=e*Math.cos(t),c=e*Math.sin(t),l=Math.sin(n),Jr.point=r})}function Qr(){Jr.point=Gr}function ti(a,c){var l=Math.cos(a),f=Math.sin(a);return function(t,n,e,r){var i;null!=t?(t=ni(l,t),n=ni(l,n),(0<e?t<n:n<t)&&(t+=2*e*k)):(t=a+2*e*k,n=a);for(var o=e*c,u=t;0<e?n<u:u<n;u-=o)r.point((i=zr([l,-f*Math.cos(u),-f*Math.sin(u)]))[0],i[1])}}function ni(t,n){var e,r,i=Lr(n);i[0]-=t,e=i,r=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),e[0]/=r,e[1]/=r,e[2]/=r;var o=Math.acos(Math.max(-1,Math.min(1,-i[1])));return((-i[2]<0?-o:o)+2*Math.PI-z)%(2*Math.PI)}function ei(M,b,x){return function(u){var a,c,l,f,e=b(u),t={point:n,lineStart:i,lineEnd:o,polygonStart:function(){t.point=v,t.lineStart=m,t.lineEnd=y,f=!1,l=c=0,a=[],u.polygonStart()},polygonEnd:function(){t.point=n,t.lineStart=i,t.lineEnd=o,(a=F.merge(a)).length?function(t,n,e){var u=[],a=[];if(t.forEach(function(t){var n=t.length;if(!(n<=1)){var e=t[0],r=t[n-1],i={point:e,points:t,other:null,visited:!1,entry:!0,subject:!0},o={point:e,points:[e],other:i,visited:!1,entry:!1,subject:!1};i.other=o,u.push(i),a.push(o),o={point:r,points:[r],other:i={point:r,points:[r],other:null,visited:!1,entry:!1,subject:!0},visited:!1,entry:!0,subject:!1},i.other=o,u.push(i),a.push(o)}}),a.sort(ii),ri(u),ri(a),!u.length)return;var r,i,o,c=u[0];for(;;){for(r=c;r.visited;)if((r=r.next)===c)return;i=r.points,e.lineStart();do{if(r.visited=r.other.visited=!0,r.entry){if(r.subject)for(var l=0;l<i.length;l++)e.point((o=i[l])[0],o[1]);else n(r.point,r.next.point,1,e);r=r.next}else{if(r.subject)for(var l=(i=r.prev.points).length;0<=--l;)e.point((o=i[l])[0],o[1]);else n(r.point,r.prev.point,-1,e);r=r.prev}r=r.other,i=r.points}while(!r.visited);e.lineEnd()}}(a,x,u):(c<-z||f&&l<-z)&&(u.lineStart(),x(null,null,1,u),u.lineEnd()),u.polygonEnd(),a=null},sphere:function(){u.polygonStart(),u.lineStart(),x(null,null,1,u),u.lineEnd(),u.polygonEnd()}};function n(t,n){M(t,n)&&u.point(t,n)}function r(t,n){e.point(t,n)}function i(){t.point=r,e.lineStart()}function o(){t.point=n,e.lineEnd()}var s,h,g,p=(g=[],{lineStart:function(){g.push(h=[])},point:function(t,n){h.push([t,n])},lineEnd:Nn,buffer:function(){var t=g;return g=[],h=null,t}}),d=b(p);function v(t,n){d.point(t,n),s.push([t,n])}function m(){d.lineStart(),s=[]}function y(){v(s[0][0],s[0][1]),d.lineEnd();var t,n=d.clean(),e=p.buffer();if(!(i=e.length))return f=!0,l+=ui(s,-1),void(s=null);if(s=null,1&n){t=e[0],c+=ui(t,1);var r,i=t.length-1,o=-1;for(u.lineStart();++o<i;)u.point((r=t[o])[0],r[1]);u.lineEnd()}else 1<i&&2&n&&e.push(e.pop().concat(e.shift())),a.push(e.filter(oi))}return t}}function ri(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r<n;)i.next=e=t[r],e.prev=i,i=e;i.next=e=t[0],e.prev=i}}function ii(t,n){return((t=t.point)[0]<0?t[1]-k/2-z:k/2-t[1])-((n=n.point)[0]<0?n[1]-k/2-z:k/2-n[1])}function oi(t){return 1<t.length}function ui(t,n){if(!(e=t.length))return 0;for(var e,r,i,o=0,u=0,a=t[0],c=a[0],l=a[1],f=Math.cos(l),s=Math.atan2(n*Math.sin(c)*f,Math.sin(l)),h=1-n*Math.cos(c)*f,g=s;++o<e;)a=t[o],f=Math.cos(l=a[1]),r=Math.atan2(n*Math.sin(c=a[0])*f,Math.sin(l)),i=1-n*Math.cos(c)*f,Math.abs(h-2)<z&&Math.abs(i-2)<z||(Math.abs(i)<z||Math.abs(h)<z||(Math.abs(Math.abs(r-s)-k)<z?2<i+h&&(u+=4*(r-s)):Math.abs(h-2)<z?u+=4*(r-g):u+=((3*k+r-s)%(2*k)-k)*(h+i)),g=s,s=r,h=i);return u}F.geo.circle=function(){var n,i,o=[0,0],e=6;function r(){var t="function"==typeof o?o.apply(this,arguments):o,e=zi(-t[0]*b,-t[1]*b,0).invert,r=[];return i(null,null,1,{point:function(t,n){r.push(t=e(t,n)),t[0]*=x,t[1]*=x}}),{type:"Polygon",coordinates:[r]}}return r.origin=function(t){return arguments.length?(o=t,r):o},r.angle=function(t){return arguments.length?(i=ti((n=+t)*b,e*b),r):n},r.precision=function(t){return arguments.length?(i=ti(n*b,(e=+t)*b),r):e},r.angle(90)};var ai=ei(E,function(s){var h,g=NaN,p=NaN,d=NaN;return{lineStart:function(){s.lineStart(),h=1},point:function(t,n){var e,r,i,o,u,a,c,l=0<t?k:-k,f=Math.abs(t-g);Math.abs(f-k)<z?(s.point(g,p=0<(p+n)/2?k/2:-k/2),s.point(d,p),s.lineEnd(),s.lineStart(),s.point(l,p),s.point(t,p),h=0):d!==l&&k<=f&&(Math.abs(g-d)<z&&(g-=d*z),Math.abs(t-l)<z&&(t-=l*z),e=g,r=p,i=t,o=n,c=Math.sin(e-i),p=Math.abs(c)>z?Math.atan((Math.sin(r)*(a=Math.cos(o))*Math.sin(i)-Math.sin(o)*(u=Math.cos(r))*Math.sin(e))/(u*a*c)):(r+o)/2,s.point(d,p),s.lineEnd(),s.lineStart(),s.point(l,p),h=0),s.point(g=t,p=n),d=l},lineEnd:function(){s.lineEnd(),g=p=NaN},clean:function(){return 2-h}}},function(t,n,e,r){var i;if(null==t)i=e*k/2,r.point(-k,i),r.point(0,i),r.point(k,i),r.point(k,0),r.point(k,-i),r.point(0,-i),r.point(-k,-i),r.point(-k,0),r.point(-k,i);else if(Math.abs(t[0]-n[0])>z){var o=(t[0]<n[0]?1:-1)*k;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(n[0],n[1])});function ci(e,r){function t(t,n){return t=e(t,n),r(t[0],t[1])}return e.invert&&r.invert&&(t.invert=function(t,n){return(t=r.invert(t,n))&&e.invert(t[0],t[1])}),t}function li(t,n){return[t,n]}(F.geo.equirectangular=function(){return qi(li).scale(250/k)}).raw=li.invert=li;var fi=ji(function(t){return 1/t},Math.atan);function si(t,n){return[t/(2*k),Math.max(-.5,Math.min(.5,Math.log(Math.tan(k/4+n/2))/(2*k)))]}(F.geo.gnomonic=function(){return qi(fi)}).raw=fi,F.geo.graticule=function(){var l,f,s,h,g,p,n=22.5,e=n,d=2.5;function v(){return{type:"MultiLineString",coordinates:t()}}function t(){return F.range(Math.ceil(f/n)*n,l,n).map(g).concat(F.range(Math.ceil(h/e)*e,s,e).map(p))}return v.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},v.outline=function(){return{type:"Polygon",coordinates:[g(f).concat(p(s).slice(1),g(l).reverse().slice(1),p(h).reverse().slice(1))]}},v.extent=function(t){return arguments.length?(f=+t[0][0],l=+t[1][0],h=+t[0][1],s=+t[1][1],l<f&&(t=f,f=l,l=t),s<h&&(t=h,h=s,s=t),v.precision(d)):[[f,h],[l,s]]},v.step=function(t){return arguments.length?(n=+t[0],e=+t[1],v):[n,e]},v.precision=function(t){return arguments.length?(n=h,e=s,r=d=+t,i=F.range(n,e-z,r).concat(e),g=function(n){return i.map(function(t){return[n,t]})},o=f,u=l,a=d,c=F.range(o,u-z,a).concat(u),p=function(n){return c.map(function(t){return[t,n]})},v):d;var n,e,r,i,o,u,a,c},v.extent([[-180+z,-90+z],[180-z,90-z]])},F.geo.interpolate=function(t,n){return function(t,n,e,r){var i=Math.cos(n),u=Math.sin(n),o=Math.cos(r),a=Math.sin(r),c=i*Math.cos(t),l=i*Math.sin(t),f=o*Math.cos(e),s=o*Math.sin(e),h=Math.acos(Math.max(-1,Math.min(1,u*a+i*o*Math.cos(e-t)))),g=1/Math.sin(h);function p(t){var n=Math.sin(t*=h)*g,e=Math.sin(h-t)*g,r=e*c+n*f,i=e*l+n*s,o=e*u+n*a;return[Math.atan2(i,r)/b,Math.atan2(o,Math.sqrt(r*r+i*i))/b]}return p.distance=h,p}(t[0]*b,t[1]*b,n[0]*b,n[1]*b)},F.geo.greatArc=function(){var u,a,c,l=e,f=t,s=6*b;function n(){for(var t=u||l.apply(this,arguments),n=a||f.apply(this,arguments),e=c||F.geo.interpolate(t,n),r=0,i=s/e.distance,o=[t];(r+=i)<1;)o.push(e(r));return o.push(n),{type:"LineString",coordinates:o}}return n.distance=function(){return(c||F.geo.interpolate(u||l.apply(this,arguments),a||f.apply(this,arguments))).distance},n.source=function(t){return arguments.length?(c=(u="function"==typeof(l=t)?null:t)&&a?F.geo.interpolate(u,a):null,n):l},n.target=function(t){return arguments.length?(a="function"==typeof(f=t)?null:t,c=u&&a?F.geo.interpolate(u,a):null,n):f},n.precision=function(t){return arguments.length?(s=t*b,n):s/b},n},si.invert=function(t,n){return[2*k*t,2*Math.atan(Math.exp(2*k*n))-k/2]},(F.geo.mercator=function(){return qi(si).scale(500)}).raw=si;var hi=ji(function(){return 1},Math.asin);function gi(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function pi(){var e=gi(4.5),r=[],i={point:t,lineStart:function(){i.point=n},lineEnd:u,polygonStart:function(){i.lineEnd=a},polygonEnd:function(){i.lineEnd=u,i.point=t},pointRadius:function(t){return e=gi(t),i},result:function(){if(r.length){var t=r.join("");return r=[],t}}};function t(t,n){r.push("M",t,",",n,e)}function n(t,n){r.push("M",t,",",n),i.point=o}function o(t,n){r.push("L",t,",",n)}function u(){i.point=t}function a(){r.push("Z")}return i}function di(e){var r=4.5,i={point:t,lineStart:function(){i.point=n},lineEnd:u,polygonStart:function(){i.lineEnd=a},polygonEnd:function(){i.lineEnd=u,i.point=t},pointRadius:function(t){return r=t,i},result:Nn};function t(t,n){e.moveTo(t,n),e.arc(t,n,r,0,2*k)}function n(t,n){e.moveTo(t,n),i.point=o}function o(t,n){e.lineTo(t,n)}function u(){i.point=t}function a(){e.closePath()}return i}(F.geo.orthographic=function(){return qi(hi)}).raw=hi,F.geo.path=function(){var r,n,i,e,o=4.5;function u(t){return t&&F.geo.stream(t,i(e.pointRadius("function"==typeof o?+o.apply(this,arguments):o))),e.result()}return u.area=function(t){return vi=0,F.geo.stream(t,i(yi)),vi},u.centroid=function(t){return Ur=Vr=Xr=Zr=0,F.geo.stream(t,i(wi)),Zr?[Vr/Zr,Xr/Zr]:void 0},u.bounds=function(t){return $r(i)(t)},u.projection=function(t){return arguments.length?(i=(r=t)?t.stream||(e=t,n=Rr(function(t,n){return e([t*x,n*x])}),function(e){return e=n(e),{point:function(t,n){e.point(t*b,n*b)},sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}):S,u):r;var e,n},u.context=function(t){return arguments.length?(e=null==(n=t)?new pi:new di(t),u):n},u.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:+t,u):o},u.projection(F.geo.albersUsa()).context(null)};var vi,mi,yi={point:Nn,lineStart:Nn,lineEnd:Nn,polygonStart:function(){mi=0,yi.lineStart=Mi},polygonEnd:function(){yi.lineStart=yi.lineEnd=yi.point=Nn,vi+=Math.abs(mi/2)}};function Mi(){var e,r,i,o;function u(t,n){mi+=o*t-i*n,i=t,o=n}yi.point=function(t,n){yi.point=u,e=i=t,r=o=n},yi.lineEnd=function(){u(e,r)}}var bi,xi,_i,wi={point:Si,lineStart:ki,lineEnd:Ei,polygonStart:function(){wi.lineStart=Ni},polygonEnd:function(){wi.point=Si,wi.lineStart=ki,wi.lineEnd=Ei}};function Si(t,n){Ur||(Vr+=t,Xr+=n,++Zr)}function ki(){var o,u;if(1!==Ur){if(!(Ur<1))return;Ur=1,Vr=Xr=Zr=0}function e(t,n){var e=t-o,r=n-u,i=Math.sqrt(e*e+r*r);Vr+=i*(o+t)/2,Xr+=i*(u+n)/2,Zr+=i,o=t,u=n}wi.point=function(t,n){wi.point=e,o=t,u=n}}function Ei(){wi.point=Si}function Ni(){var e,r,i,o;function u(t,n){var e=o*t-i*n;Vr+=e*(i+t),Xr+=e*(o+n),Zr+=3*e,i=t,o=n}Ur<2&&(Ur=2,Vr=Xr=Zr=0),wi.point=function(t,n){wi.point=u,e=i=t,r=o=n},wi.lineEnd=function(){u(e,r)}}F.geo.area=function(t){return bi=0,F.geo.stream(t,Ai),bi};var Ai={sphere:function(){bi+=4*k},point:Nn,lineStart:Nn,lineEnd:Nn,polygonStart:function(){xi=1,_i=0,Ai.lineStart=Ti},polygonEnd:function(){var t=2*Math.atan2(_i,xi);bi+=t<0?4*k+t:t,Ai.lineStart=Ai.lineEnd=Ai.point=Nn}};function Ti(){var e,r,f,s,h;function i(t,n){n=n*b/2+k/4;var e=(t*=b)-f,r=Math.cos(n),i=Math.sin(n),o=h*i,u=xi,a=_i,c=s*r+o*Math.cos(e),l=o*Math.sin(e);xi=u*c-a*l,_i=a*c+u*l,f=t,s=r,h=i}Ai.point=function(t,n){Ai.point=i,f=(e=t)*b,s=Math.cos(n=(r=n)*b/2+k/4),h=Math.sin(n)},Ai.lineEnd=function(){i(e,r)}}function qi(t){return Ci(function(){return t})()}function Ci(t){var e,n,r,i,o,u=Rr(function(t,n){return[(t=e(t,n))[0]*a+i,o-t[1]*a]}),a=150,c=480,l=250,f=0,s=0,h=0,g=0,p=0,d=ai,v=null;function m(t){return[(t=r(t[0]*b,t[1]*b))[0]*a+i,o-t[1]*a]}function y(t){return(t=r.invert((t[0]-i)/a,(o-t[1])/a))&&[t[0]*x,t[1]*x]}function M(){r=ci(n=zi(h,g,p),e);var t=e(f,s);return i=c-t[0]*a,o=l+t[1]*a,m}return m.stream=function(t){return e=n,r=d(u(t)),{point:function(t,n){n=e(t*b,n*b),t=n[0],r.point(k<t?t-2*k:t<-k?t+2*k:t,n[1])},sphere:function(){r.sphere()},lineStart:function(){r.lineStart()},lineEnd:function(){r.lineEnd()},polygonStart:function(){r.polygonStart()},polygonEnd:function(){r.polygonEnd()}};var e,r},m.clipAngle=function(t){return arguments.length?(d=null==t?(v=t,ai):function(t){var n=t*b,d=Math.cos(n);return ei(f,function(o){var u,a,c,l;return{lineStart:function(){c=a=!1,l=1},point:function(t,n){var e,r=[t,n],i=f(t,n);!u&&(c=a=i)&&o.lineStart(),i!==a&&(e=s(u,r),(Dr(u,e)||Dr(r,e))&&(r[0]+=z,r[1]+=z,i=f(r[0],r[1]))),i!==a&&(l=0,(a=i)?(o.lineStart(),e=s(r,u),o.point(e[0],e[1])):(e=s(u,r),o.point(e[0],e[1]),o.lineEnd()),u=e),!i||u&&Dr(u,r)||o.point(r[0],r[1]),u=r},lineEnd:function(){a&&o.lineEnd(),u=null},clean:function(){return l|(c&&a)<<1}}},ti(n,6*b));function f(t,n){return Math.cos(t)*Math.cos(n)>d}function s(t,n){var e=[1,0,0],r=Hr(Lr(t),Lr(n)),i=Fr(r,r),o=r[0],u=i-o*o;if(!u)return t;var a=d*i/u,c=-d*o/u,l=Hr(e,r),f=Pr(e,a);jr(f,Pr(r,c));var s=l,h=Fr(f,s),g=Fr(s,s),p=Pr(s,(-h-Math.sqrt(h*h-g*(Fr(f,f)-1)))/g);return jr(p,f),zr(p)}}(v=+t),m):v},m.scale=function(t){return arguments.length?(a=+t,M()):a},m.translate=function(t){return arguments.length?(c=+t[0],l=+t[1],M()):[c,l]},m.center=function(t){return arguments.length?(f=t[0]%360*b,s=t[1]%360*b,M()):[f*x,s*x]},m.rotate=function(t){return arguments.length?(h=t[0]%360*b,g=t[1]%360*b,p=2<t.length?t[2]%360*b:0,M()):[h*x,g*x,p*x]},F.rebind(m,u,"precision"),function(){return e=t.apply(this,arguments),m.invert=e.invert&&y,M()}}function zi(t,n,e){return t?n||e?ci(Li(t),Fi(n,e)):Li(t):n||e?Fi(n,e):li}function Di(e){return function(t,n){return[k<(t+=e)?t-2*k:t<-k?t+2*k:t,n]}}function Li(t){var n=Di(t);return n.invert=Di(-t),n}function Fi(t,n){var a=Math.cos(t),c=Math.sin(t),l=Math.cos(n),f=Math.sin(n);function e(t,n){var e=Math.cos(n),r=Math.cos(t)*e,i=Math.sin(t)*e,o=Math.sin(n),u=o*a+r*c;return[Math.atan2(i*l-u*f,r*a-o*c),Math.asin(Math.max(-1,Math.min(1,u*l+i*f)))]}return e.invert=function(t,n){var e=Math.cos(n),r=Math.cos(t)*e,i=Math.sin(t)*e,o=Math.sin(n),u=o*l-i*f;return[Math.atan2(i*l+o*f,r*a+u*c),Math.asin(Math.max(-1,Math.min(1,u*a-r*c)))]},e}F.geo.projection=qi,F.geo.projectionMutator=Ci;var Hi=ji(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});function ji(o,u){function t(t,n){var e=Math.cos(t),r=Math.cos(n),i=o(e*r);return[i*r*Math.sin(t),i*Math.sin(n)]}return t.invert=function(t,n){var e=Math.sqrt(t*t+n*n),r=u(e),i=Math.sin(r),o=Math.cos(r);return[Math.atan2(t*i,e*o),Math.asin(e&&n*i/e)]},t}function Pi(t,n,e,r){var i,o,u,a,c,l;return o=(i=r[t])[0],u=i[1],a=(i=r[n])[0],c=i[1],l=(i=r[e])[0],0<(i[1]-u)*(a-o)-(c-u)*(l-o)}function Ri(t,n,e){return(e[0]-n[0])*(t[1]-n[1])<(e[1]-n[1])*(t[0]-n[0])}function Oi(t,n,e,r){var i=t[0],o=e[0],u=n[0]-i,a=r[0]-o,c=t[1],l=e[1],f=n[1]-c,s=r[1]-l,h=(a*(c-l)-s*(i-o))/(s*u-a*f);return[i+h*u,c+h*f]}(F.geo.stereographic=function(){return qi(Hi)}).raw=Hi,F.geom={},F.geom.hull=function(t){if(t.length<3)return[];var n,e,r,i,o,u,a,c,l,f,s=t.length,h=s-1,g=[],p=[],d=0;for(n=1;n<s;++n)t[n][1]<t[d][1]?d=n:t[n][1]==t[d][1]&&(d=t[n][0]<t[d][0]?n:d);for(n=0;n<s;++n)n!==d&&(i=t[n][1]-t[d][1],r=t[n][0]-t[d][0],g.push({angle:Math.atan2(i,r),index:n}));for(g.sort(function(t,n){return t.angle-n.angle}),l=g[0].angle,c=g[0].index,a=0,n=1;n<h;++n)e=g[n].index,l==g[n].angle?(r=t[c][0]-t[d][0],i=t[c][1]-t[d][1],(o=t[e][0]-t[d][0])*o+(u=t[e][1]-t[d][1])*u<=r*r+i*i?g[n].index=-1:(g[a].index=-1,l=g[n].angle,a=n,c=e)):(l=g[n].angle,a=n,c=e);for(p.push(d),e=n=0;n<2;++e)-1!==g[e].index&&(p.push(g[e].index),n++);for(f=p.length;e<h;++e)if(-1!==g[e].index){for(;!Pi(p[f-2],p[f-1],g[e].index,t);)--f;p[f++]=g[e].index}var v=[];for(n=0;n<f;++n)v.push(t[p[n]]);return v},F.geom.polygon=function(f){return f.area=function(){for(var t=0,n=f.length,e=f[n-1][1]*f[0][0]-f[n-1][0]*f[0][1];++t<n;)e+=f[t-1][1]*f[t][0]-f[t-1][0]*f[t][1];return.5*e},f.centroid=function(t){var n,e,r=-1,i=f.length,o=0,u=0,a=f[i-1];for(arguments.length||(t=-1/(6*f.area()));++r<i;)n=a,a=f[r],e=n[0]*a[1]-a[0]*n[1],o+=(n[0]+a[0])*e,u+=(n[1]+a[1])*e;return[o*t,u*t]},f.clip=function(t){for(var n,e,r,i,o,u,a=-1,c=f.length,l=f[c-1];++a<c;){for(n=t.slice(),t.length=0,i=f[a],o=n[(r=n.length)-1],e=-1;++e<r;)Ri(u=n[e],l,i)?(Ri(o,l,i)||t.push(Oi(o,u,l,i)),t.push(u)):Ri(o,l,i)&&t.push(Oi(o,u,l,i)),o=u;l=i}return t},f},F.geom.voronoi=function(m){var l=m.map(function(){return[]}),y=1e6;return Ui(m,function(t){var n,e,r,i,o,u;e=1===t.a&&0<=t.b?(n=t.ep.r,t.ep.l):(n=t.ep.l,t.ep.r),1===t.a?(o=n?n.y:-y,r=t.c-t.b*o,u=e?e.y:y,i=t.c-t.b*u):(r=n?n.x:-y,o=t.c-t.a*r,i=e?e.x:y,u=t.c-t.a*i);var a=[r,o],c=[i,u];l[t.region.l.index].push(a,c),l[t.region.r.index].push(a,c)}),(l=l.map(function(n,t){var e=m[t][0],r=m[t][1],i=n.map(function(t){return Math.atan2(t[0]-e,t[1]-r)}),o=F.range(n.length).sort(function(t,n){return i[t]-i[n]});return o.filter(function(t,n){return!n||i[t]-i[o[n-1]]>z}).map(function(t){return n[t]})})).forEach(function(t,n){var e=t.length;if(!e)return t.push([-y,-y],[-y,y],[y,y],[y,-y]);if(!(2<e)){var r=m[n],i=t[0],o=t[1],u=r[0],a=r[1],c=i[0],l=i[1],f=o[0],s=o[1],h=Math.abs(f-c),g=s-l;if(Math.abs(g)<z){var p=a<l?-y:y;t.push([-y,p],[y,p])}else if(h<z){var d=u<c?-y:y;t.push([d,-y],[d,y])}else{p=(f-c)*(l-a)<(c-u)*(s-l)?y:-y;var v=Math.abs(g)-h;Math.abs(v)<z?t.push([g<0?p:-p,p]):(0<v&&(p*=-1),t.push([-y,p],[y,p]))}}}),l};var Yi={l:"r",r:"l"};function Ui(t,r){var n={list:t.map(function(t,n){return{index:n,x:t[0],y:t[1]}}).sort(function(t,n){return t.y<n.y?-1:t.y>n.y?1:t.x<n.x?-1:t.x>n.x?1:0}),bottomSite:null},e={list:[],leftEnd:null,rightEnd:null,init:function(){e.leftEnd=e.createHalfEdge(null,"l"),e.rightEnd=e.createHalfEdge(null,"l"),e.leftEnd.r=e.rightEnd,e.rightEnd.l=e.leftEnd,e.list.unshift(e.leftEnd,e.rightEnd)},createHalfEdge:function(t,n){return{edge:t,side:n,vertex:null,l:null,r:null}},insert:function(t,n){n.l=t,n.r=t.r,t.r.l=n,t.r=n},leftBound:function(t){for(var n=e.leftEnd;(n=n.r)!=e.rightEnd&&i.rightOf(n,t););return n=n.l},del:function(t){t.l.r=t.r,t.r.l=t.l,t.edge=null},right:function(t){return t.r},left:function(t){return t.l},leftRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[Yi[t.side]]}},i={bisect:function(t,n){var e={region:{l:t,r:n},ep:{l:null,r:null}},r=n.x-t.x,i=n.y-t.y,o=0<r?r:-r,u=0<i?i:-i;return e.c=t.x*r+t.y*i+.5*(r*r+i*i),u<o?(e.a=1,e.b=i/r,e.c/=r):(e.b=1,e.a=r/i,e.c/=i),e},intersect:function(t,n){var e=t.edge,r=n.edge;if(!e||!r||e.region.r==r.region.r)return null;var i=e.a*r.b-e.b*r.a;if(Math.abs(i)<1e-10)return null;var o,u=(e.c*r.b-r.c*e.b)/i,a=(r.c*e.a-e.c*r.a)/i,c=e.region.r,l=r.region.r,f=u>=(c.y<l.y||c.y==l.y&&c.x<l.x?(o=t,e):(o=n,r)).region.r.x;return f&&"l"===o.side||!f&&"r"===o.side?null:{x:u,y:a}},rightOf:function(t,n){var e=t.edge,r=e.region.r,i=n.x>r.x;if(i&&"l"===t.side)return 1;if(!i&&"r"===t.side)return 0;if(1===e.a){var o=n.y-r.y,u=n.x-r.x,a=0,c=0;if(!i&&e.b<0||i&&0<=e.b?c=a=o>=e.b*u:(c=n.x+n.y*e.b>e.c,e.b<0&&(c=!c),c||(a=1)),!a){var l=r.x-e.region.l.x;c=e.b*(u*u-o*o)<l*o*(1+2*u/l+e.b*e.b),e.b<0&&(c=!c)}}else{var f=e.c-e.a*n.x,s=n.y-f,h=n.x-r.x,g=f-r.y;c=h*h+g*g<s*s}return"l"===t.side?c:!c},endPoint:function(t,n,e){t.ep[n]=e,t.ep[Yi[n]]&&r(t)},distance:function(t,n){var e=t.x-n.x,r=t.y-n.y;return Math.sqrt(e*e+r*r)}},a={list:[],insert:function(t,n,e){t.vertex=n,t.ystar=n.y+e;for(var r=0,i=a.list,o=i.length;r<o;r++){var u=i[r];if(!(t.ystar>u.ystar||t.ystar==u.ystar&&n.x>u.vertex.x))break}i.splice(r,0,t)},del:function(t){for(var n=0,e=a.list,r=e.length;n<r&&e[n]!=t;++n);e.splice(n,1)},empty:function(){return 0===a.list.length},nextEvent:function(t){for(var n=0,e=a.list,r=e.length;n<r;++n)if(e[n]==t)return e[n+1];return null},min:function(){var t=a.list[0];return{x:t.vertex.x,y:t.ystar}},extractMin:function(){return a.list.shift()}};e.init(),n.bottomSite=n.list.shift();for(var o,u,c,l,f,s,h,g,p,d,v,m,y,M=n.list.shift();;)if(a.empty()||(o=a.min()),M&&(a.empty()||M.y<o.y||M.y==o.y&&M.x<o.x))u=e.leftBound(M),c=e.right(u),h=e.rightRegion(u),m=i.bisect(h,M),s=e.createHalfEdge(m,"l"),e.insert(u,s),(d=i.intersect(u,s))&&(a.del(u),a.insert(u,d,i.distance(d,M))),u=s,s=e.createHalfEdge(m,"r"),e.insert(u,s),(d=i.intersect(s,c))&&a.insert(s,d,i.distance(d,M)),M=n.list.shift();else{if(a.empty())break;u=a.extractMin(),l=e.left(u),c=e.right(u),f=e.right(c),h=e.leftRegion(u),g=e.rightRegion(c),v=u.vertex,i.endPoint(u.edge,u.side,v),i.endPoint(c.edge,c.side,v),e.del(u),a.del(c),e.del(c),y="l",h.y>g.y&&(p=h,h=g,g=p,y="r"),m=i.bisect(h,g),s=e.createHalfEdge(m,y),e.insert(l,s),i.endPoint(m,Yi[y],v),(d=i.intersect(l,s))&&(a.del(l),a.insert(l,d,i.distance(d,h))),(d=i.intersect(s,f))&&a.insert(s,d,i.distance(d,h))}for(u=e.right(e.leftEnd);u!=e.rightEnd;u=e.right(u))r(u.edge)}F.geom.delaunay=function(a){var n=a.map(function(){return[]}),c=[];return Ui(a,function(t){n[t.region.l.index].push(a[t.region.r.index])}),n.forEach(function(t,n){var e=a[n],r=e[0],i=e[1];t.forEach(function(t){t.angle=Math.atan2(t[0]-r,t[1]-i)}),t.sort(function(t,n){return t.angle-n.angle});for(var o=0,u=t.length-1;o<u;o++)c.push([e,t[o],t[o+1]])}),c},F.geom.quadtree=function(t,n,e,r,i){var o,u=-1,a=t.length;if(arguments.length<5)if(3===arguments.length)i=e,r=n,e=n=0;else for(n=e=1/0,r=i=-1/0;++u<a;)(o=t[u]).x<n&&(n=o.x),o.y<e&&(e=o.y),o.x>r&&(r=o.x),o.y>i&&(i=o.y);var c=r-n,l=i-e;function s(t,n,e,r,i,o){if(!isNaN(n.x)&&!isNaN(n.y))if(t.leaf){var u=t.point;u?(Math.abs(u.x-n.x)+Math.abs(u.y-n.y)<.01||(t.point=null,f(t,u,e,r,i,o)),f(t,n,e,r,i,o)):t.point=n}else f(t,n,e,r,i,o)}function f(t,n,e,r,i,o){var u=.5*(e+i),a=.5*(r+o),c=n.x>=u,l=n.y>=a,f=(l<<1)+c;t.leaf=!1,c?e=u:i=u,l?r=a:o=a,s(t=t.nodes[f]||(t.nodes[f]={leaf:!0,nodes:[],point:null}),n,e,r,i,o)}l<c?i=e+c:r=n+l;var h={leaf:!0,nodes:[],point:null,add:function(t){s(h,t,n,e,r,i)}};return h.visit=function(t){!function t(n,e,r,i,o,u){if(!n(e,r,i,o,u)){var a=.5*(r+o),c=.5*(i+u),l=e.nodes;l[0]&&t(n,l[0],r,i,a,c),l[1]&&t(n,l[1],a,i,o,c),l[2]&&t(n,l[2],r,c,a,u),l[3]&&t(n,l[3],a,c,o,u)}}(t,h,n,e,r,i)},t.forEach(h.add),h},F.time={};var Ii=Date;function Vi(){this._=new Date(1<arguments.length?Date.UTC.apply(this,arguments):arguments[0])}Vi.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Xi.setUTCDate.apply(this._,arguments)},setDay:function(){Xi.setUTCDay.apply(this._,arguments)},setFullYear:function(){Xi.setUTCFullYear.apply(this._,arguments)},setHours:function(){Xi.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Xi.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Xi.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Xi.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Xi.setUTCSeconds.apply(this._,arguments)},setTime:function(){Xi.setTime.apply(this._,arguments)}};var Xi=Date.prototype,Zi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Bi=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],$i=["January","February","March","April","May","June","July","August","September","October","November","December"],Ji=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Gi(t,n,e,r){for(var i,o,u=0,a=n.length,c=e.length;u<a;){if(c<=r)return-1;if(37===(i=n.charCodeAt(u++))){if(!(o=co[n.charAt(u++)])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function Ki(t){return new RegExp("^(?:"+t.map(F.requote).join("|")+")","i")}function Wi(t){for(var n=new M,e=-1,r=t.length;++e<r;)n.set(t[e].toLowerCase(),e);return n}function Qi(t,n,e){var r=(t+="").length;return r<e?new Array(e-r+1).join(n)+t:t}F.time.format=function(a){var c=a.length;function t(t){for(var n,e,r,i=[],o=-1,u=0;++o<c;)37===a.charCodeAt(o)&&(i.push(a.substring(u,o)),null!=(e=uo[n=a.charAt(++o)])&&(n=a.charAt(++o)),(r=ao[n])&&(n=r(t,null==e?"e"===n?" ":"0":e)),i.push(n),u=o+1);return i.push(a.substring(u,o)),i.join("")}return t.parse=function(t){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0};if(Gi(n,a,t,0)!=t.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var e=new Ii;return e.setFullYear(n.y,n.m,n.d),e.setHours(n.H,n.M,n.S,n.L),e},t.toString=function(){return a},t};var to=Ki(Zi),no=Ki(Bi),eo=Ki($i),ro=Wi($i),io=Ki(Ji),oo=Wi(Ji),uo={"-":"",_:" ",0:"0"},ao={a:function(t){return Bi[t.getDay()]},A:function(t){return Zi[t.getDay()]},b:function(t){return Ji[t.getMonth()]},B:function(t){return $i[t.getMonth()]},c:F.time.format("%a %b %e %X %Y"),d:function(t,n){return Qi(t.getDate(),n,2)},e:function(t,n){return Qi(t.getDate(),n,2)},H:function(t,n){return Qi(t.getHours(),n,2)},I:function(t,n){return Qi(t.getHours()%12||12,n,2)},j:function(t,n){return Qi(1+F.time.dayOfYear(t),n,3)},L:function(t,n){return Qi(t.getMilliseconds(),n,3)},m:function(t,n){return Qi(t.getMonth()+1,n,2)},M:function(t,n){return Qi(t.getMinutes(),n,2)},p:function(t){return 12<=t.getHours()?"PM":"AM"},S:function(t,n){return Qi(t.getSeconds(),n,2)},U:function(t,n){return Qi(F.time.sundayOfYear(t),n,2)},w:function(t){return t.getDay()},W:function(t,n){return Qi(F.time.mondayOfYear(t),n,2)},x:F.time.format("%m/%d/%Y"),X:F.time.format("%H:%M:%S"),y:function(t,n){return Qi(t.getFullYear()%100,n,2)},Y:function(t,n){return Qi(t.getFullYear()%1e4,n,4)},Z:function(t){var n=t.getTimezoneOffset(),e=0<n?"-":"+",r=~~(Math.abs(n)/60),i=Math.abs(n)%60;return e+Qi(r,"0",2)+Qi(i,"0",2)},"%":function(){return"%"}},co={a:function(t,n,e){no.lastIndex=0;var r=no.exec(n.substring(e));return r?e+=r[0].length:-1},A:function(t,n,e){to.lastIndex=0;var r=to.exec(n.substring(e));return r?e+=r[0].length:-1},b:function(t,n,e){io.lastIndex=0;var r=io.exec(n.substring(e));return r?(t.m=oo.get(r[0].toLowerCase()),e+=r[0].length):-1},B:function(t,n,e){eo.lastIndex=0;var r=eo.exec(n.substring(e));return r?(t.m=ro.get(r[0].toLowerCase()),e+=r[0].length):-1},c:function(t,n,e){return Gi(t,ao.c.toString(),n,e)},d:lo,e:lo,H:fo,I:fo,L:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+3));return r?(t.L=+r[0],e+=r[0].length):-1},m:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.m=r[0]-1,e+=r[0].length):-1},M:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.M=+r[0],e+=r[0].length):-1},p:function(t,n,e){var r=ho.get(n.substring(e,e+=2).toLowerCase());return null==r?-1:(t.p=r,e)},S:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.S=+r[0],e+=r[0].length):-1},x:function(t,n,e){return Gi(t,ao.x.toString(),n,e)},X:function(t,n,e){return Gi(t,ao.X.toString(),n,e)},y:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.y=(i=+r[0],i+(68<i?1900:2e3)),e+=r[0].length):-1;var i},Y:function(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+4));return r?(t.y=+r[0],e+=r[0].length):-1}};function lo(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.d=+r[0],e+=r[0].length):-1}function fo(t,n,e){so.lastIndex=0;var r=so.exec(n.substring(e,e+2));return r?(t.H=+r[0],e+=r[0].length):-1}var so=/^\s*\d+/;var ho=F.map({am:0,pm:1});F.time.format.utc=function(t){var e=F.time.format(t);function n(t){try{var n=new(Ii=Vi);return n._=t,e(n)}finally{Ii=Date}}return n.parse=function(t){try{Ii=Vi;var n=e.parse(t);return n&&n._}finally{Ii=Date}},n.toString=e.toString,n};var go=F.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");function po(t){return t.toISOString()}function vo(r,o,u){function t(t){var n=r(t),e=i(n,1);return t-n<e-t?n:e}function a(t){return o(t=r(new Ii(t-1)),1),t}function i(t,n){return o(t=new Ii(+t),n),t}function c(t,n,e){var r=a(t),i=[];if(1<e)for(;r<n;)u(r)%e||i.push(new Date(+r)),o(r,1);else for(;r<n;)i.push(new Date(+r)),o(r,1);return i}(r.floor=r).round=t,r.ceil=a,r.offset=i,r.range=c;var n=r.utc=mo(r);return(n.floor=n).round=mo(t),n.ceil=mo(a),n.offset=mo(i),n.range=function(t,n,e){try{var r=new(Ii=Vi);return r._=t,c(r,n,e)}finally{Ii=Date}},r}function mo(r){return function(t,n){try{var e=new(Ii=Vi);return e._=t,r(e,n)._}finally{Ii=Date}}}function yo(c,l,t){function f(t){return c(t)}return f.invert=function(t){return Mo(c.invert(t))},f.domain=function(t){return arguments.length?(c.domain(t),f):c.domain().map(Mo)},f.nice=function(t){return f.domain(qn(f.domain(),function(){return t}))},f.ticks=function(t,n){var e,r,i,o=(e=f.domain(),r=e[0],i=e[e.length-1],r<i?[r,i]:[i,r]);if("function"!=typeof t){var u=(o[1]-o[0])/t,a=F.bisect(wo,u);if(a==wo.length)return l.year(o,t);if(!a)return c.ticks(t).map(Mo);Math.log(u/wo[a-1])<Math.log(wo[a]/u)&&--a,n=(t=l[a])[1],t=t[0].range}return t(o[0],new Date(+o[1]+1),n)},f.tickFormat=function(){return t},f.copy=function(){return yo(c.copy(),l,t)},F.rebind(f,c,"range","rangeRound","interpolate","clamp")}function Mo(t){return new Date(t)}function bo(r){return function(t){for(var n=r.length-1,e=r[n];!e[1](t);)e=r[--n];return e[0](t)}}function xo(t){var n=new Date(t,0,1);return n.setFullYear(t),n}function _o(t){var n=t.getFullYear(),e=xo(n);return n+(t-e)/(xo(n+1)-e)}F.time.format.iso=Date.prototype.toISOString?po:go,po.parse=function(t){var n=new Date(t);return isNaN(n)?null:n},po.toString=go.toString,F.time.second=vo(function(t){return new Ii(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(t.getTime()+1e3*Math.floor(n))},function(t){return t.getSeconds()}),F.time.seconds=F.time.second.range,F.time.seconds.utc=F.time.second.utc.range,F.time.minute=vo(function(t){return new Ii(6e4*Math.floor(t/6e4))},function(t,n){t.setTime(t.getTime()+6e4*Math.floor(n))},function(t){return t.getMinutes()}),F.time.minutes=F.time.minute.range,F.time.minutes.utc=F.time.minute.utc.range,F.time.hour=vo(function(t){var n=t.getTimezoneOffset()/60;return new Ii(36e5*(Math.floor(t/36e5-n)+n))},function(t,n){t.setTime(t.getTime()+36e5*Math.floor(n))},function(t){return t.getHours()}),F.time.hours=F.time.hour.range,F.time.hours.utc=F.time.hour.utc.range,F.time.day=vo(function(t){var n=new Ii(1970,0);return n.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),n},function(t,n){t.setDate(t.getDate()+n)},function(t){return t.getDate()-1}),F.time.days=F.time.day.range,F.time.days.utc=F.time.day.utc.range,F.time.dayOfYear=function(t){var n=F.time.year(t);return Math.floor((t-n-6e4*(t.getTimezoneOffset()-n.getTimezoneOffset()))/864e5)},["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].forEach(function(t,e){t=t.toLowerCase(),e=7-e;var n=F.time[t]=vo(function(t){return(t=F.time.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,n){t.setDate(t.getDate()+7*Math.floor(n))},function(t){var n=F.time.year(t).getDay();return Math.floor((F.time.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});F.time[t+"s"]=n.range,F.time[t+"s"].utc=n.utc.range,F.time[t+"OfYear"]=function(t){var n=F.time.year(t).getDay();return Math.floor((F.time.dayOfYear(t)+(n+e)%7)/7)}}),F.time.week=F.time.sunday,F.time.weeks=F.time.sunday.range,F.time.weeks.utc=F.time.sunday.utc.range,F.time.weekOfYear=F.time.sundayOfYear,F.time.month=vo(function(t){return(t=F.time.day(t)).setDate(1),t},function(t,n){t.setMonth(t.getMonth()+n)},function(t){return t.getMonth()}),F.time.months=F.time.month.range,F.time.months.utc=F.time.month.utc.range,F.time.year=vo(function(t){return(t=F.time.day(t)).setMonth(0,1),t},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t){return t.getFullYear()}),F.time.years=F.time.year.range,F.time.years.utc=F.time.year.utc.range;var wo=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],So=[[F.time.second,1],[F.time.second,5],[F.time.second,15],[F.time.second,30],[F.time.minute,1],[F.time.minute,5],[F.time.minute,15],[F.time.minute,30],[F.time.hour,1],[F.time.hour,3],[F.time.hour,6],[F.time.hour,12],[F.time.day,1],[F.time.day,2],[F.time.week,1],[F.time.month,1],[F.time.month,3],[F.time.year,1]],ko=[[F.time.format("%Y"),E],[F.time.format("%B"),function(t){return t.getMonth()}],[F.time.format("%b %d"),function(t){return 1!=t.getDate()}],[F.time.format("%a %d"),function(t){return t.getDay()&&1!=t.getDate()}],[F.time.format("%I %p"),function(t){return t.getHours()}],[F.time.format("%I:%M"),function(t){return t.getMinutes()}],[F.time.format(":%S"),function(t){return t.getSeconds()}],[F.time.format(".%L"),function(t){return t.getMilliseconds()}]],Eo=F.scale.linear(),No=bo(ko);So.year=function(t,n){return Eo.domain(t.map(_o)).ticks(n).map(xo)},F.time.scale=function(){return yo(F.scale.linear(),So,No)};var Ao=So.map(function(t){return[t[0].utc,t[1]]}),To=bo([[F.time.format.utc("%Y"),E],[F.time.format.utc("%B"),function(t){return t.getUTCMonth()}],[F.time.format.utc("%b %d"),function(t){return 1!=t.getUTCDate()}],[F.time.format.utc("%a %d"),function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[F.time.format.utc("%I %p"),function(t){return t.getUTCHours()}],[F.time.format.utc("%I:%M"),function(t){return t.getUTCMinutes()}],[F.time.format.utc(":%S"),function(t){return t.getUTCSeconds()}],[F.time.format.utc(".%L"),function(t){return t.getUTCMilliseconds()}]]);function qo(t){var n=new Date(Date.UTC(t,0,1));return n.setUTCFullYear(t),n}function Co(t){var n=t.getUTCFullYear(),e=qo(n);return n+(t-e)/(qo(n+1)-e)}return Ao.year=function(t,n){return Eo.domain(t.map(Co)).ticks(n).map(qo)},F.time.scale.utc=function(){return yo(F.scale.linear(),Ao,To)},F}();