forked from feross/p2p-graph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp2p-graph.min.js
1 lines (1 loc) · 169 KB
/
p2p-graph.min.js
1
!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).P2PGraph=n()}}(function(){return function o(u,a,l){function c(e,n){if(!a[e]){if(!u[e]){var t="function"==typeof require&&require;if(!n&&t)return t(e,!0);if(s)return s(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var i=a[e]={exports:{}};u[e][0].call(i.exports,function(n){var t=u[e][1][n];return c(t||n)},i,i.exports,o,u,a,l)}return a[e].exports}for(var s="function"==typeof require&&require,n=0;n<l.length;n++)c(l[n]);return c}({1:[function(n,Ra,t){!function(){var q={version:"3.5.17"},o=[].slice,h=function(n){return o.call(n)},x=this.document;function a(n){return n&&(n.ownerDocument||n.document||n).documentElement}function D(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}if(x)try{h(x.documentElement.childNodes)[0].nodeType}catch(n){h=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),x)try{x.createElement("DIV").style.setProperty("opacity",0,"")}catch(n){var t=this.Element.prototype,e=t.setAttribute,r=t.setAttributeNS,i=this.CSSStyleDeclaration.prototype,u=i.setProperty;t.setAttribute=function(n,t){e.call(this,n,t+"")},t.setAttributeNS=function(n,t,e){r.call(this,n,t,e+"")},i.setProperty=function(n,t,e){u.call(this,n,t+"",e)}}function l(n,t){return n<t?-1:t<n?1:t<=n?0:NaN}function c(n){return null===n?NaN:+n}function s(n){return!isNaN(n)}function n(o){return{left:function(n,t,e,r){for(arguments.length<3&&(e=0),arguments.length<4&&(r=n.length);e<r;){var i=e+r>>>1;o(n[i],t)<0?e=i+1:r=i}return e},right:function(n,t,e,r){for(arguments.length<3&&(e=0),arguments.length<4&&(r=n.length);e<r;){var i=e+r>>>1;0<o(n[i],t)?r=i:e=i+1}return e}}}q.ascending=l,q.descending=function(n,t){return t<n?-1:n<t?1:n<=t?0:NaN},q.min=function(n,t){var e,r,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=n[i])&&r<=r){e=r;break}for(;++i<o;)null!=(r=n[i])&&r<e&&(e=r)}else{for(;++i<o;)if(null!=(r=t.call(n,n[i],i))&&r<=r){e=r;break}for(;++i<o;)null!=(r=t.call(n,n[i],i))&&r<e&&(e=r)}return e},q.max=function(n,t){var e,r,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=n[i])&&r<=r){e=r;break}for(;++i<o;)null!=(r=n[i])&&e<r&&(e=r)}else{for(;++i<o;)if(null!=(r=t.call(n,n[i],i))&&r<=r){e=r;break}for(;++i<o;)null!=(r=t.call(n,n[i],i))&&e<r&&(e=r)}return e},q.extent=function(n,t){var e,r,i,o=-1,u=n.length;if(1===arguments.length){for(;++o<u;)if(null!=(r=n[o])&&r<=r){e=i=r;break}for(;++o<u;)null!=(r=n[o])&&(r<e&&(e=r),i<r&&(i=r))}else{for(;++o<u;)if(null!=(r=t.call(n,n[o],o))&&r<=r){e=i=r;break}for(;++o<u;)null!=(r=t.call(n,n[o],o))&&(r<e&&(e=r),i<r&&(i=r))}return[e,i]},q.sum=function(n,t){var e,r=0,i=n.length,o=-1;if(1===arguments.length)for(;++o<i;)s(e=+n[o])&&(r+=e);else for(;++o<i;)s(e=+t.call(n,n[o],o))&&(r+=e);return r},q.mean=function(n,t){var e,r=0,i=n.length,o=-1,u=i;if(1===arguments.length)for(;++o<i;)s(e=c(n[o]))?r+=e:--u;else for(;++o<i;)s(e=c(t.call(n,n[o],o)))?r+=e:--u;if(u)return r/u},q.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),i=+n[r-1],o=e-r;return o?i+o*(n[r]-i):i},q.median=function(n,t){var e,r=[],i=n.length,o=-1;if(1===arguments.length)for(;++o<i;)s(e=c(n[o]))&&r.push(e);else for(;++o<i;)s(e=c(t.call(n,n[o],o)))&&r.push(e);if(r.length)return q.quantile(r.sort(l),.5)},q.variance=function(n,t){var e,r,i=n.length,o=0,u=0,a=-1,l=0;if(1===arguments.length)for(;++a<i;)s(e=c(n[a]))&&(u+=(r=e-o)*(e-(o+=r/++l)));else for(;++a<i;)s(e=c(t.call(n,n[a],a)))&&(u+=(r=e-o)*(e-(o+=r/++l)));if(1<l)return u/(l-1)},q.deviation=function(){var n=q.variance.apply(this,arguments);return n?Math.sqrt(n):n};var f=n(l);function p(n){return n.length}q.bisectLeft=f.left,q.bisect=q.bisectRight=f.right,q.bisector=function(e){return n(1===e.length?function(n,t){return l(e(n),t)}:e)},q.shuffle=function(n,t,e){(o=arguments.length)<3&&(e=n.length,o<2&&(t=0));for(var r,i,o=e-t;o;)i=Math.random()*o--|0,r=n[o+t],n[o+t]=n[i+t],n[i+t]=r;return n},q.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},q.pairs=function(n){for(var t=0,e=n.length-1,r=n[0],i=new Array(e<0?0:e);t<e;)i[t]=[r,r=n[++t]];return i},q.transpose=function(n){if(!(i=n.length))return[];for(var t=-1,e=q.min(n,p),r=new Array(e);++t<e;)for(var i,o=-1,u=r[t]=new Array(i);++o<i;)u[o]=n[o][t];return r},q.zip=function(){return q.transpose(arguments)},q.keys=function(n){var t=[];for(var e in n)t.push(e);return t},q.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},q.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},q.merge=function(n){for(var t,e,r,i=n.length,o=-1,u=0;++o<i;)u+=n[o].length;for(e=new Array(u);0<=--i;)for(t=(r=n[i]).length;0<=--t;)e[--u]=r[t];return e};var z=Math.abs;function d(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function m(){this._=Object.create(null)}q.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e==1/0)throw new Error("infinite range");var r,i=[],o=function(n){var t=1;for(;n*t%1;)t*=10;return t}(z(e)),u=-1;if(n*=o,t*=o,(e*=o)<0)for(;(r=n+e*++u)>t;)i.push(r/o);else for(;(r=n+e*++u)<t;)i.push(r/o);return i},q.map=function(n,t){var e=new m;if(n instanceof m)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,i=-1,o=n.length;if(1===arguments.length)for(;++i<o;)e.set(i,n[i]);else for(;++i<o;)e.set(t.call(n,r=n[i],i),r)}else for(var u in n)e.set(u,n[u]);return e};var g="__proto__",v="\0";function y(n){return(n+="")===g||n[0]===v?v+n:n}function M(n){return(n+="")[0]===v?n.slice(1):n}function _(n){return y(n)in this._}function w(n){return(n=y(n))in this._&&delete this._[n]}function b(){var n=[];for(var t in this._)n.push(M(t));return n}function k(){var n=0;for(var t in this._)++n;return n}function C(){for(var n in this._)return!1;return!0}function E(){this._=Object.create(null)}function R(n){return n}function N(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function S(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=A.length;e<r;++e){var i=A[e]+t;if(i in n)return i}}d(m,{has:_,get:function(n){return this._[y(n)]},set:function(n,t){return this._[y(n)]=t},remove:w,keys:b,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:M(t),value:this._[t]});return n},size:k,empty:C,forEach:function(n){for(var t in this._)n.call(this,M(t),this._[t])}}),q.nest=function(){var f,h,p={},d=[],t=[];function g(e,n,r){if(r>=d.length)return h?h.call(p,n):f?n.sort(f):n;for(var t,i,o,u,a=-1,l=n.length,c=d[r++],s=new m;++a<l;)(u=s.get(t=c(i=n[a])))?u.push(i):s.set(t,[i]);return e?(i=e(),o=function(n,t){i.set(n,g(e,t,r))}):(i={},o=function(n,t){i[n]=g(e,t,r)}),s.forEach(o),i}return p.map=function(n,t){return g(t,n,0)},p.entries=function(n){return function e(n,r){if(r>=d.length)return n;var i=[],o=t[r++];return n.forEach(function(n,t){i.push({key:n,values:e(t,r)})}),o?i.sort(function(n,t){return o(n.key,t.key)}):i}(g(q.map,n,0),0)},p.key=function(n){return d.push(n),p},p.sortKeys=function(n){return t[d.length-1]=n,p},p.sortValues=function(n){return f=n,p},p.rollup=function(n){return h=n,p},p},q.set=function(n){var t=new E;if(n)for(var e=0,r=n.length;e<r;++e)t.add(n[e]);return t},d(E,{has:_,add:function(n){return this._[y(n+="")]=!0,n},remove:w,values:b,size:k,empty:C,forEach:function(n){for(var t in this._)n.call(this,M(t))}}),q.behavior={},q.rebind=function(n,t){for(var e,r=1,i=arguments.length;++r<i;)n[e=arguments[r]]=N(n,t,t[e]);return n};var A=["webkit","ms","moz","Moz","o","O"];function L(){}function F(){}function T(i){var o=[],u=new m;function n(){for(var n,t=o,e=-1,r=t.length;++e<r;)(n=t[e].on)&&n.apply(this,arguments);return i}return n.on=function(n,t){var e,r=u.get(n);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(n)),t&&o.push(u.set(n,{on:t})),i)},n}function j(){q.event.preventDefault()}function P(){for(var n,t=q.event;n=t.sourceEvent;)t=n;return t}function O(i){for(var o=new F,n=0,t=arguments.length;++n<t;)o[arguments[n]]=T(o);return o.of=function(e,r){return function(n){try{var t=n.sourceEvent=q.event;n.target=i,q.event=n,o[n.type].apply(e,r)}finally{q.event=t}}},o}q.dispatch=function(){for(var n=new F,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=T(n);return n},F.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(0<=e&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},q.event=null,q.requote=function(n){return n.replace(U,"\\$&")};var U=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,I={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]};function H(n){return I(n,$),n}var Y=function(n,t){return t.querySelector(n)},Z=function(n,t){return t.querySelectorAll(n)},V=function(n,t){var e=n.matches||n[S(n,"matchesSelector")];return(V=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(Y=function(n,t){return Sizzle(n,t)[0]||null},Z=Sizzle,V=Sizzle.matchesSelector),q.selection=function(){return q.select(x.documentElement)};var $=q.selection.prototype=[];function B(n){return"function"==typeof n?n:function(){return Y(n,this)}}function X(n){return"function"==typeof n?n:function(){return Z(n,this)}}$.select=function(n){var t,e,r,i,o=[];n=B(n);for(var u=-1,a=this.length;++u<a;){o.push(t=[]),t.parentNode=(r=this[u]).parentNode;for(var l=-1,c=r.length;++l<c;)(i=r[l])?(t.push(e=n.call(i,i.__data__,l,u)),e&&"__data__"in i&&(e.__data__=i.__data__)):t.push(null)}return H(o)},$.selectAll=function(n){var t,e,r=[];n=X(n);for(var i=-1,o=this.length;++i<o;)for(var u=this[i],a=-1,l=u.length;++a<l;)(e=u[a])&&(r.push(t=h(n.call(e,e.__data__,a,i))),t.parentNode=e);return H(r)};var W="http://www.w3.org/1999/xhtml",J={svg:"http://www.w3.org/2000/svg",xhtml:W,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function G(t,e){return t=q.ns.qualify(t),null==e?t.local?function(){this.removeAttributeNS(t.space,t.local)}:function(){this.removeAttribute(t)}:"function"==typeof e?t.local?function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}:function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}:t.local?function(){this.setAttributeNS(t.space,t.local,e)}:function(){this.setAttribute(t,e)}}function K(n){return n.trim().replace(/\s+/g," ")}function Q(n){return new RegExp("(?:^|\\s+)"+q.requote(n)+"(?:\\s+|$)","g")}function nn(n){return(n+"").trim().split(/^|\s+/)}function tn(e,r){var i=(e=nn(e).map(en)).length;return"function"==typeof r?function(){for(var n=-1,t=r.apply(this,arguments);++n<i;)e[n](this,t)}:function(){for(var n=-1;++n<i;)e[n](this,r)}}function en(r){var i=Q(r);return function(n,t){if(e=n.classList)return t?e.add(r):e.remove(r);var e=n.getAttribute("class")||"";t?(i.lastIndex=0,i.test(e)||n.setAttribute("class",K(e+" "+r))):n.setAttribute("class",K(e.replace(i," ")))}}function rn(t,e,r){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}:function(){this.style.setProperty(t,e,r)}}function on(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}:function(){this[t]=e}}function un(e){return"function"==typeof e?e:(e=q.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var n=this.ownerDocument,t=this.namespaceURI;return t===W&&n.documentElement.namespaceURI===W?n.createElement(e):n.createElementNS(t,e)}}function an(){var n=this.parentNode;n&&n.removeChild(this)}function ln(n){return{__data__:n}}function cn(n){return function(){return V(this,n)}}function sn(n,t){for(var e=0,r=n.length;e<r;e++)for(var i,o=n[e],u=0,a=o.length;u<a;u++)(i=o[u])&&t(i,u,e);return n}function fn(n){return I(n,hn),n}q.ns={prefix:J,qualify:function(n){var t=n.indexOf(":"),e=n;return 0<=t&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),J.hasOwnProperty(e)?{space:J[e],local:n}:n}},$.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return(n=q.ns.qualify(n)).local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(G(t,n[t]));return this}return this.each(G(n,t))},$.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=nn(n)).length,i=-1;if(t=e.classList){for(;++i<r;)if(!t.contains(n[i]))return!1}else for(t=e.getAttribute("class");++i<r;)if(!Q(n[i]).test(t))return!1;return!0}for(t in n)this.each(tn(t,n[t]));return this}return this.each(tn(n,t))},$.style=function(n,t,e){var r=arguments.length;if(r<3){if("string"!=typeof n){for(e in r<2&&(t=""),n)this.each(rn(e,n[e],t));return this}if(r<2){var i=this.node();return D(i).getComputedStyle(i,null).getPropertyValue(n)}e=""}return this.each(rn(n,t,e))},$.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(on(t,n[t]));return this}return this.each(on(n,t))},$.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},$.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},$.append=function(n){return n=un(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},$.insert=function(n,t){return n=un(n),t=B(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},$.remove=function(){return this.each(an)},$.data=function(n,d){var t,e,r=-1,i=this.length;if(!arguments.length){for(n=new Array(i=(t=this[0]).length);++r<i;)(e=t[r])&&(n[r]=e.__data__);return n}function o(n,t){var e,r,i,o=n.length,u=t.length,a=Math.min(o,u),l=new Array(u),c=new Array(u),s=new Array(o);if(d){var f,h=new m,p=new Array(o);for(e=-1;++e<o;)(r=n[e])&&(h.has(f=d.call(r,r.__data__,e))?s[e]=r:h.set(f,r),p[e]=f);for(e=-1;++e<u;)(r=h.get(f=d.call(t,i=t[e],e)))?!0!==r&&((l[e]=r).__data__=i):c[e]=ln(i),h.set(f,!0);for(e=-1;++e<o;)e in p&&!0!==h.get(p[e])&&(s[e]=n[e])}else{for(e=-1;++e<a;)r=n[e],i=t[e],r?(r.__data__=i,l[e]=r):c[e]=ln(i);for(;e<u;++e)c[e]=ln(t[e]);for(;e<o;++e)s[e]=n[e]}c.update=l,c.parentNode=l.parentNode=s.parentNode=n.parentNode,g.push(c),v.push(l),y.push(s)}var g=fn([]),v=H([]),y=H([]);if("function"==typeof n)for(;++r<i;)o(t=this[r],n.call(t,t.parentNode.__data__,r));else for(;++r<i;)o(t=this[r],n);return v.enter=function(){return g},v.exit=function(){return y},v},$.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},$.filter=function(n){var t,e,r,i=[];"function"!=typeof n&&(n=cn(n));for(var o=0,u=this.length;o<u;o++){i.push(t=[]),t.parentNode=(e=this[o]).parentNode;for(var a=0,l=e.length;a<l;a++)(r=e[a])&&n.call(r,r.__data__,a,o)&&t.push(r)}return H(i)},$.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],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},$.sort=function(n){n=function(e){arguments.length||(e=l);return function(n,t){return n&&t?e(n.__data__,t.__data__):!n-!t}}.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},$.each=function(r){return sn(this,function(n,t,e){r.call(n,n.__data__,t,e)})},$.call=function(n){var t=h(arguments);return n.apply(t[0]=this,t),this},$.empty=function(){return!this.node()},$.node=function(){for(var n=0,t=this.length;n<t;n++)for(var e=this[n],r=0,i=e.length;r<i;r++){var o=e[r];if(o)return o}return null},$.size=function(){var n=0;return sn(this,function(){++n}),n};var hn=[];function pn(i,t,e){var r="__on"+i,n=i.indexOf("."),o=gn;0<n&&(i=i.slice(0,n));var u=dn.get(i);function a(){var n=this[r];n&&(this.removeEventListener(i,n,n.$),delete this[r])}return u&&(i=u,o=vn),n?t?function(){var n=o(t,h(arguments));a.call(this),this.addEventListener(i,this[r]=n,n.$=e),n._=t}:a:t?L:function(){var n,t=new RegExp("^__on([^.]+)"+q.requote(i)+"$");for(var e in this)if(n=e.match(t)){var r=this[e];this.removeEventListener(n[1],r,r.$),delete this[e]}}}q.selection.enter=fn,(q.selection.enter.prototype=hn).append=$.append,hn.empty=$.empty,hn.node=$.node,hn.call=$.call,hn.size=$.size,hn.select=function(n){for(var t,e,r,i,o,u=[],a=-1,l=this.length;++a<l;){r=(i=this[a]).update,u.push(t=[]),t.parentNode=i.parentNode;for(var c=-1,s=i.length;++c<s;)(o=i[c])?(t.push(r[c]=e=n.call(i.parentNode,o.__data__,c,a)),e.__data__=o.__data__):t.push(null)}return H(u)},hn.insert=function(n,t){var u,a,l;return arguments.length<2&&(u=this,t=function(n,t,e){var r,i=u[e].update,o=i.length;for(e!=l&&(l=e,a=0),a<=t&&(a=t+1);!(r=i[a])&&++a<o;);return r}),$.insert.call(this,n,t)},q.select=function(n){var t;return"string"==typeof n?(t=[Y(n,x)]).parentNode=x.documentElement:(t=[n]).parentNode=a(n),H([t])},q.selectAll=function(n){var t;return"string"==typeof n?(t=h(Z(n,x))).parentNode=x.documentElement:(t=h(n)).parentNode=null,H([t])},$.on=function(n,t,e){var r=arguments.length;if(r<3){if("string"!=typeof n){for(e in r<2&&(t=!1),n)this.each(pn(e,n[e],t));return this}if(r<2)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(pn(n,t,e))};var dn=q.map({mouseenter:"mouseover",mouseleave:"mouseout"});function gn(e,r){return function(n){var t=q.event;q.event=n,r[0]=this.__data__;try{e.apply(this,r)}finally{q.event=t}}}function vn(n,t){var e=gn(n,t);return function(n){var t=n.relatedTarget;t&&(t===this||8&t.compareDocumentPosition(this))||e.call(this,n)}}x&&dn.forEach(function(n){"on"+n in x&&dn.remove(n)});var yn,mn=0;function xn(n){var e=".dragsuppress-"+ ++mn,r="click"+e,i=q.select(D(n)).on("touchmove"+e,j).on("dragstart"+e,j).on("selectstart"+e,j);if(null==yn&&(yn=!("onselectstart"in n)&&S(n.style,"userSelect")),yn){var o=a(n).style,u=o[yn];o[yn]="none"}return function(n){if(i.on(e,null),yn&&(o[yn]=u),n){var t=function(){i.on(r,null)};i.on(r,function(){j(),t()},!0),setTimeout(t,0)}}}q.mouse=function(n){return _n(n,P())};var Mn=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function _n(n,t){t.changedTouches&&(t=t.changedTouches[0]);var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();if(Mn<0){var i=D(n);if(i.scrollX||i.scrollY){var o=(e=q.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();Mn=!(o.f||o.e),e.remove()}}return Mn?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}var u=n.getBoundingClientRect();return[t.clientX-u.left-n.clientLeft,t.clientY-u.top-n.clientTop]}function wn(){return q.event.changedTouches[0].identifier}q.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=P().changedTouches),t)for(var r,i=0,o=t.length;i<o;++i)if((r=t[i]).identifier===e)return _n(n,r)},q.behavior.drag=function(){var g=O(e,"drag","dragstart","dragend"),v=null,n=r(L,q.mouse,D,"mousemove","mouseup"),t=r(wn,q.touch,R,"touchmove","touchend");function e(){this.on("mousedown.drag",n).on("touchstart.drag",t)}function r(s,f,h,p,d){return function(){var r,n=q.event.target.correspondingElement||q.event.target,i=this.parentNode,o=g.of(this,arguments),u=0,a=s(),t=".drag"+(null==a?"":"-"+a),e=q.select(h(n)).on(p+t,function(){var n,t,e=f(i,a);if(!e)return;n=e[0]-c[0],t=e[1]-c[1],u|=n|t,o({type:"drag",x:(c=e)[0]+r[0],y:e[1]+r[1],dx:n,dy:t})}).on(d+t,function(){if(!f(i,a))return;e.on(p+t,null).on(d+t,null),l(u),o({type:"dragend"})}),l=xn(n),c=f(i,a);r=v?[(r=v.apply(this,arguments)).x-c[0],r.y-c[1]]:[0,0],o({type:"dragstart"})}}return e.origin=function(n){return arguments.length?(v=n,e):v},q.rebind(e,g,"on")},q.touches=function(e,n){return arguments.length<2&&(n=P().touches),n?h(n).map(function(n){var t=_n(e,n);return t.identifier=n.identifier,t}):[]};var bn=1e-6,kn=bn*bn,Cn=Math.PI,En=2*Cn,Nn=En-bn,Sn=Cn/2,An=Cn/180,Ln=180/Cn;function Fn(n){return 0<n?1:n<0?-1:0}function Tn(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function zn(n){return 1<n?0:n<-1?Cn:Math.acos(n)}function qn(n){return 1<n?Sn:n<-1?-Sn:Math.asin(n)}function Dn(n){return((n=Math.exp(n))+1/n)/2}function Rn(n){return(n=Math.sin(n/2))*n}var jn=Math.SQRT2;q.interpolateZoom=function(n,t){var e,u,a=n[0],l=n[1],c=n[2],r=t[0],i=t[1],o=t[2],s=r-a,f=i-l,h=s*s+f*f;if(h<kn)u=Math.log(o/c)/jn,e=function(n){return[a+n*s,l+n*f,c*Math.exp(jn*n*u)]};else{var p=Math.sqrt(h),d=(o*o-c*c+4*h)/(2*c*2*p),g=(o*o-c*c-4*h)/(2*o*2*p),v=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(g*g+1)-g);u=(y-v)/jn,e=function(n){var t,e,r=n*u,i=Dn(v),o=c/(2*p)*(i*(e=jn*r+v,((e=Math.exp(2*e))-1)/(e+1))-(t=v,((t=Math.exp(t))-1/t)/2));return[a+o*s,l+o*f,c*i/Dn(jn*r+v)]}}return e.duration=1e3*u,e},q.behavior.zoom=function(){var t,l,e,r,M,i,o,u,a,_={x:0,y:0,k:1},c=[960,500],s=Un,f=250,h=0,w="mousedown.zoom",p="mousemove.zoom",d="mouseup.zoom",b="touchstart.zoom",k=O(g,"zoomstart","zoom","zoomend");function g(n){n.on(w,T).on(On+".zoom",y).on("dblclick.zoom",m).on(b,z)}function C(n){return[(n[0]-_.x)/_.k,(n[1]-_.y)/_.k]}function E(n){_.k=Math.max(s[0],Math.min(s[1],n))}function N(n,t){var e;t=[(e=t)[0]*_.k+_.x,e[1]*_.k+_.y],_.x+=n[0]-t[0],_.y+=n[1]-t[1]}function S(n,t,e,r){n.__chart__={x:_.x,y:_.y,k:_.k},E(Math.pow(2,r)),N(l=t,e),n=q.select(n),0<f&&(n=n.transition().duration(f)),n.call(g.event)}function v(){o&&o.domain(i.range().map(function(n){return(n-_.x)/_.k}).map(i.invert)),a&&a.domain(u.range().map(function(n){return(n-_.y)/_.k}).map(u.invert))}function A(n){h++||n({type:"zoomstart"})}function L(n){v(),n({type:"zoom",scale:_.k,translate:[_.x,_.y]})}function F(n){--h||(n({type:"zoomend"}),l=null)}function T(){var n=this,t=k.of(n,arguments),e=0,r=q.select(D(n)).on(p,function(){e=1,N(q.mouse(n),i),L(t)}).on(d,function(){r.on(p,null).on(d,null),o(e),F(t)}),i=C(q.mouse(n)),o=xn(n);oa.call(n),A(t)}function z(){var c,s=this,f=k.of(s,arguments),h={},p=0,i=".zoom-"+q.event.changedTouches[0].identifier,d="touchmove"+i,g="touchend"+i,v=[],o=q.select(s),u=xn(s);function y(){var n=q.touches(s);return c=_.k,n.forEach(function(n){n.identifier in h&&(h[n.identifier]=C(n))}),n}function n(){var n=q.event.target;q.select(n).on(d,m).on(g,x),v.push(n);for(var t=q.event.changedTouches,e=0,r=t.length;e<r;++e)h[t[e].identifier]=null;var i=y(),o=Date.now();if(1===i.length){if(o-M<500){var u=i[0];S(s,u,h[u.identifier],Math.floor(Math.log(_.k)/Math.LN2)+1),j()}M=o}else if(1<i.length){u=i[0];var a=i[1],l=u[0]-a[0],c=u[1]-a[1];p=l*l+c*c}}function m(){var n,t,e,r,i=q.touches(s);oa.call(s);for(var o=0,u=i.length;o<u;++o,r=null)if(e=i[o],r=h[e.identifier]){if(t)break;n=e,t=r}if(r){var a=(a=e[0]-n[0])*a+(a=e[1]-n[1])*a,l=p&&Math.sqrt(a/p);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],E(l*c)}M=null,N(n,t),L(f)}function x(){if(q.event.touches.length){for(var n=q.event.changedTouches,t=0,e=n.length;t<e;++t)delete h[n[t].identifier];for(var r in h)return void y()}q.selectAll(v).on(i,null),o.on(w,T).on(b,z),u(),F(f)}n(),A(f),o.on(w,null).on(b,n)}function y(){var n=k.of(this,arguments);r?clearTimeout(r):(oa.call(this),t=C(l=e||q.mouse(this)),A(n)),r=setTimeout(function(){r=null,F(n)},50),j(),E(Math.pow(2,.002*Pn())*_.k),N(l,t),L(n)}function m(){var n=q.mouse(this),t=Math.log(_.k)/Math.LN2;S(this,n,C(n),q.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}return On||(On="onwheel"in x?(Pn=function(){return-q.event.deltaY*(q.event.deltaMode?120:1)},"wheel"):"onmousewheel"in x?(Pn=function(){return q.event.wheelDelta},"mousewheel"):(Pn=function(){return-q.event.detail},"MozMousePixelScroll")),g.event=function(n){n.each(function(){var a=k.of(this,arguments),t=_;la?q.select(this).transition().each("start.zoom",function(){_=this.__chart__||{x:0,y:0,k:1},A(a)}).tween("zoom:zoom",function(){var r=c[0],n=c[1],i=l?l[0]:r/2,o=l?l[1]:n/2,u=q.interpolateZoom([(i-_.x)/_.k,(o-_.y)/_.k,r/_.k],[(i-t.x)/t.k,(o-t.y)/t.k,r/t.k]);return function(n){var t=u(n),e=r/t[2];this.__chart__=_={x:i-t[0]*e,y:o-t[1]*e,k:e},L(a)}}).each("interrupt.zoom",function(){F(a)}).each("end.zoom",function(){F(a)}):(this.__chart__=_,A(a),L(a),F(a))})},g.translate=function(n){return arguments.length?(_={x:+n[0],y:+n[1],k:_.k},v(),g):[_.x,_.y]},g.scale=function(n){return arguments.length?(_={x:_.x,y:_.y,k:null},E(+n),v(),g):_.k},g.scaleExtent=function(n){return arguments.length?(s=null==n?Un:[+n[0],+n[1]],g):s},g.center=function(n){return arguments.length?(e=n&&[+n[0],+n[1]],g):e},g.size=function(n){return arguments.length?(c=n&&[+n[0],+n[1]],g):c},g.duration=function(n){return arguments.length?(f=+n,g):f},g.x=function(n){return arguments.length?(i=(o=n).copy(),_={x:0,y:0,k:1},g):o},g.y=function(n){return arguments.length?(u=(a=n).copy(),_={x:0,y:0,k:1},g):a},q.rebind(g,k,"on")};var Pn,On,Un=[0,1/0];function In(){}function Hn(n,t,e){return this instanceof Hn?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof Hn?new Hn(n.h,n.s,n.l):st(""+n,ft,Hn):new Hn(n,t,e)}(q.color=In).prototype.toString=function(){return this.rgb()+""};var Yn=(q.hsl=Hn).prototype=new In;function Zn(n,t,e){var r,i;function o(n){return Math.round(255*(360<(t=n)?t-=360:t<0&&(t+=360),t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r));var t}return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:t<0?0:1<t?1:t,r=2*(e=e<0?0:1<e?1:e)-(i=e<=.5?e*(1+t):e+t-e*t),new ot(o(n+120),o(n),o(n-120))}function Vn(n,t,e){return this instanceof Vn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof Vn?new Vn(n.h,n.c,n.l):tt(n instanceof Xn?n.l:(n=ht((n=q.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new Vn(n,t,e)}Yn.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new Hn(this.h,this.s,this.l/n)},Yn.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new Hn(this.h,this.s,n*this.l)},Yn.rgb=function(){return Zn(this.h,this.s,this.l)};var $n=(q.hcl=Vn).prototype=new In;function Bn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new Xn(e,Math.cos(n*=An)*t,Math.sin(n)*t)}function Xn(n,t,e){return this instanceof Xn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof Xn?new Xn(n.l,n.a,n.b):n instanceof Vn?Bn(n.h,n.c,n.l):ht((n=ot(n)).r,n.g,n.b):new Xn(n,t,e)}$n.brighter=function(n){return new Vn(this.h,this.c,Math.min(100,this.l+Wn*(arguments.length?n:1)))},$n.darker=function(n){return new Vn(this.h,this.c,Math.max(0,this.l-Wn*(arguments.length?n:1)))},$n.rgb=function(){return Bn(this.h,this.c,this.l).rgb()},q.lab=Xn;var Wn=18,Jn=.95047,Gn=1,Kn=1.08883,Qn=Xn.prototype=new In;function nt(n,t,e){var r=(n+16)/116,i=r+t/500,o=r-e/200;return new ot(it(3.2404542*(i=et(i)*Jn)-1.5371385*(r=et(r)*Gn)-.4985314*(o=et(o)*Kn)),it(-.969266*i+1.8760108*r+.041556*o),it(.0556434*i-.2040259*r+1.0572252*o))}function tt(n,t,e){return 0<n?new Vn(Math.atan2(e,t)*Ln,Math.sqrt(t*t+e*e),n):new Vn(NaN,NaN,n)}function et(n){return.206893034<n?n*n*n:(n-4/29)/7.787037}function rt(n){return.008856<n?Math.pow(n,1/3):7.787037*n+4/29}function it(n){return Math.round(255*(n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function ot(n,t,e){return this instanceof ot?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof ot?new ot(n.r,n.g,n.b):st(""+n,ot,Zn):new ot(n,t,e)}function ut(n){return new ot(n>>16,n>>8&255,255&n)}function at(n){return ut(n)+""}Qn.brighter=function(n){return new Xn(Math.min(100,this.l+Wn*(arguments.length?n:1)),this.a,this.b)},Qn.darker=function(n){return new Xn(Math.max(0,this.l-Wn*(arguments.length?n:1)),this.a,this.b)},Qn.rgb=function(){return nt(this.l,this.a,this.b)};var lt=(q.rgb=ot).prototype=new In;function ct(n){return n<16?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function st(n,t,e){var r,i,o,u=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))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 t(dt(i[0]),dt(i[1]),dt(i[2]))}return(o=gt.get(n))?t(o.r,o.g,o.b):(null==n||"#"!==n.charAt(0)||isNaN(o=parseInt(n.slice(1),16))||(4===n.length?(u=(3840&o)>>4,u|=u>>4,a=240&o,a|=a>>4,l=15&o,l|=l<<4):7===n.length&&(u=(16711680&o)>>16,a=(65280&o)>>8,l=255&o)),t(u,a,l))}function ft(n,t,e){var r,i,o=Math.min(n/=255,t/=255,e/=255),u=Math.max(n,t,e),a=u-o,l=(u+o)/2;return a?(i=l<.5?a/(u+o):a/(2-u-o),r=n==u?(t-e)/a+(t<e?6:0):t==u?(e-n)/a+2:(n-t)/a+4,r*=60):(r=NaN,i=0<l&&l<1?0:r),new Hn(r,i,l)}function ht(n,t,e){var r=rt((.4124564*(n=pt(n))+.3575761*(t=pt(t))+.1804375*(e=pt(e)))/Jn),i=rt((.2126729*n+.7151522*t+.072175*e)/Gn);return Xn(116*i-16,500*(r-i),200*(i-rt((.0193339*n+.119192*t+.9503041*e)/Kn)))}function pt(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function dt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}lt.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b;return t||e||r?(t&&t<30&&(t=30),e&&e<30&&(e=30),r&&r<30&&(r=30),new ot(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new ot(30,30,30)},lt.darker=function(n){return new ot((n=Math.pow(.7,arguments.length?n:1))*this.r,n*this.g,n*this.b)},lt.hsl=function(){return ft(this.r,this.g,this.b)},lt.toString=function(){return"#"+ct(this.r)+ct(this.g)+ct(this.b)};var gt=q.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function vt(n){return"function"==typeof n?n:function(){return n}}function yt(r){return function(n,t,e){return 2===arguments.length&&"function"==typeof t&&(e=t,t=null),mt(n,t,r,e)}}function mt(i,o,u,n){var e,a={},l=q.dispatch("beforesend","progress","load","error"),c={},s=new XMLHttpRequest,f=null;function t(){var n,t,e,r=s.status;if(!r&&((e=(t=s).responseType)&&"text"!==e?t.response:t.responseText)||200<=r&&r<300||304===r){try{n=u.call(a,s)}catch(n){return void l.error.call(a,n)}l.load.call(a,n)}else l.error.call(a,s)}return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(i)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=t:s.onreadystatechange=function(){3<s.readyState&&t()},s.onprogress=function(n){var t=q.event;q.event=n;try{l.progress.call(a,s)}finally{q.event=t}},a.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?c[n]:(null==t?delete c[n]:c[n]=t+"",a)},a.mimeType=function(n){return arguments.length?(o=null==n?null:n+"",a):o},a.responseType=function(n){return arguments.length?(f=n,a):f},a.response=function(n){return u=n,a},["get","post"].forEach(function(n){a[n]=function(){return a.send.apply(a,[n].concat(h(arguments)))}}),a.send=function(n,t,e){if(2===arguments.length&&"function"==typeof t&&(e=t,t=null),s.open(n,i,!0),null==o||"accept"in c||(c.accept=o+",*/*"),s.setRequestHeader)for(var r in c)s.setRequestHeader(r,c[r]);return null!=o&&s.overrideMimeType&&s.overrideMimeType(o),null!=f&&(s.responseType=f),null!=e&&a.on("error",e).on("load",function(n){e(null,n)}),l.beforesend.call(a,s),s.send(null==t?null:t),a},a.abort=function(){return s.abort(),a},q.rebind(a,l,"on"),null==n?a:a.get(1===(e=n).length?function(n,t){e(null==n?t:null)}:e)}gt.forEach(function(n,t){gt.set(n,ut(t))}),q.functor=vt,q.xhr=yt(R),q.dsv=function(i,o){var t=new RegExp('["'+i+"\n]"),h=i.charCodeAt(0);function u(n,t,e){arguments.length<3&&(e=t,t=null);var r=mt(n,o,null==t?a:l(t),e);return r.row=function(n){return arguments.length?r.response(null==(t=n)?a:l(n)):t},r}function a(n){return u.parse(n.responseText)}function l(t){return function(n){return u.parse(n.responseText,t)}}function e(n){return n.map(c).join(i)}function c(n){return t.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}return u.parse=function(n,r){var i;return u.parseRows(n,function(n,t){if(i)return i(n,t-1);var e=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");i=r?function(n,t){return r(e(n),t)}:e})},u.parseRows=function(i,n){var t,o,u={},a={},e=[],l=i.length,c=0,r=0;function s(){if(l<=c)return a;if(o)return o=!1,u;var n=c;if(34===i.charCodeAt(n)){for(var t=n;t++<l;)if(34===i.charCodeAt(t)){if(34!==i.charCodeAt(t+1))break;++t}return c=t+2,13===(e=i.charCodeAt(t+1))?(o=!0,10===i.charCodeAt(t+2)&&++c):10===e&&(o=!0),i.slice(n+1,t).replace(/""/g,'"')}for(;c<l;){var e,r=1;if(10===(e=i.charCodeAt(c++)))o=!0;else if(13===e)o=!0,10===i.charCodeAt(c)&&(++c,++r);else if(e!==h)continue;return i.slice(n,c-r)}return i.slice(n)}for(;(t=s())!==a;){for(var f=[];t!==u&&t!==a;)f.push(t),t=s();n&&null==(f=n(f,r++))||e.push(f)}return e},u.format=function(n){if(Array.isArray(n[0]))return u.formatRows(n);var e=new E,r=[];return n.forEach(function(n){for(var t in n)e.has(t)||r.push(e.add(t))}),[r.map(c).join(i)].concat(n.map(function(t){return r.map(function(n){return c(t[n])}).join(i)})).join("\n")},u.formatRows=function(n){return n.map(e).join("\n")},u},q.csv=q.dsv(",","text/csv"),q.tsv=q.dsv("\t","text/tab-separated-values");var xt,Mt,_t,wt,bt=this[S(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};function kt(n,t,e){var r=arguments.length;r<2&&(t=0),r<3&&(e=Date.now());var i={c:n,t:e+t,n:null};return Mt?Mt.n=i:xt=i,Mt=i,_t||(wt=clearTimeout(wt),_t=1,bt(Ct)),i}function Ct(){var n=Et(),t=Nt()-n;24<t?(isFinite(t)&&(clearTimeout(wt),wt=setTimeout(Ct,t)),_t=0):(_t=1,bt(Ct))}function Et(){for(var n=Date.now(),t=xt;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Nt(){for(var n,t=xt,e=1/0;t;)t.c?(t.t<e&&(e=t.t),t=(n=t).n):t=n?n.n=t.n:xt=t.n;return Mt=n,e}function St(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}q.timer=function(){kt.apply(this,arguments)},q.timer.flush=function(){Et(),Nt()},q.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var At=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(function(n,t){var e=Math.pow(10,3*z(8-t));return{scale:8<t?function(n){return n/e}:function(n){return n*e},symbol:n}});q.formatPrefix=function(n,t){var e=0;return(n=+n)&&(n<0&&(n*=-1),t&&(n=q.round(n,St(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),At[8+e/3]};var Lt=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ft=q.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=q.round(n,St(n,t))).toFixed(Math.max(0,Math.min(20,St(n*(1+1e-15),t))))}});function Tt(n){return n+""}var zt=q.time={},qt=Date;function Dt(){this._=new Date(1<arguments.length?Date.UTC.apply(this,arguments):arguments[0])}Dt.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(){Rt.setUTCDate.apply(this._,arguments)},setDay:function(){Rt.setUTCDay.apply(this._,arguments)},setFullYear:function(){Rt.setUTCFullYear.apply(this._,arguments)},setHours:function(){Rt.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Rt.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Rt.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Rt.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Rt.setUTCSeconds.apply(this._,arguments)},setTime:function(){Rt.setTime.apply(this._,arguments)}};var Rt=Date.prototype;function jt(r,o,u){function n(n){var t=r(n),e=i(t,1);return n-t<e-n?t:e}function a(n){return o(n=r(new qt(n-1)),1),n}function i(n,t){return o(n=new qt(+n),t),n}function l(n,t,e){var r=a(n),i=[];if(1<e)for(;r<t;)u(r)%e||i.push(new Date(+r)),o(r,1);else for(;r<t;)i.push(new Date(+r)),o(r,1);return i}(r.floor=r).round=n,r.ceil=a,r.offset=i,r.range=l;var t=r.utc=Pt(r);return(t.floor=t).round=Pt(n),t.ceil=Pt(a),t.offset=Pt(i),t.range=function(n,t,e){try{var r=new(qt=Dt);return r._=n,l(r,t,e)}finally{qt=Date}},r}function Pt(r){return function(n,t){try{var e=new(qt=Dt);return e._=n,r(e,t)._}finally{qt=Date}}}zt.year=jt(function(n){return(n=zt.day(n)).setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),zt.years=zt.year.range,zt.years.utc=zt.year.utc.range,zt.day=jt(function(n){var t=new qt(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),zt.days=zt.day.range,zt.days.utc=zt.day.utc.range,zt.dayOfYear=function(n){var t=zt.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,e){e=7-e;var t=zt[n]=jt(function(n){return(n=zt.day(n)).setDate(n.getDate()-(n.getDay()+e)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var t=zt.year(n).getDay();return Math.floor((zt.dayOfYear(n)+(t+e)%7)/7)-(t!==e)});zt[n+"s"]=t.range,zt[n+"s"].utc=t.utc.range,zt[n+"OfYear"]=function(n){var t=zt.year(n).getDay();return Math.floor((zt.dayOfYear(n)+(t+e)%7)/7)}}),zt.week=zt.sunday,zt.weeks=zt.sunday.range,zt.weeks.utc=zt.sunday.utc.range,zt.weekOfYear=zt.sundayOfYear;var Ot={"-":"",_:" ",0:"0"},Ut=/^\s*\d+/,It=/^%/;function Ht(n,t,e){var r=n<0?"-":"",i=(r?-n:n)+"",o=i.length;return r+(o<e?new Array(e-o+1).join(t)+i:i)}function Yt(n){return new RegExp("^(?:"+n.map(q.requote).join("|")+")","i")}function Zt(n){for(var t=new m,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function Vt(n,t,e){Ut.lastIndex=0;var r=Ut.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function $t(n,t,e){Ut.lastIndex=0;var r=Ut.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function Bt(n,t,e){Ut.lastIndex=0;var r=Ut.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Xt(n,t,e){Ut.lastIndex=0;var r=Ut.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Wt(n,t,e){Ut.lastIndex=0;var r,i=Ut.exec(t.slice(e,e+2));return i?(n.y=(r=+i[0])+(68<r?1900:2e3),e+i[0].length):-1}function Jt(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Gt(n,t,e){Ut.lastIndex=0;var r=Ut.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Kt(n,t,e){Ut.lastIndex=0;var r=Ut.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function Qt(n,t,e){Ut.lastIndex=0;var r=Ut.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function ne(n,t,e){Ut.lastIndex=0;var r=Ut.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function te(n,t,e){Ut.lastIndex=0;var r=Ut.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ee(n,t,e){Ut.lastIndex=0;var r=Ut.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function re(n,t,e){Ut.lastIndex=0;var r=Ut.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ie(n){var t=n.getTimezoneOffset(),e=0<t?"-":"+",r=z(t)/60|0,i=z(t)%60;return e+Ht(r,"0",2)+Ht(i,"0",2)}function oe(n,t,e){It.lastIndex=0;var r=It.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ue(r){for(var n=r.length,t=-1;++t<n;)r[t][0]=this(r[t][0]);return function(n){for(var t=0,e=r[t];!e[1](n);)e=r[++t];return e[0](n)}}q.locale=function(n){return{numberFormat:(t=n,k=t.decimal,a=t.thousands,l=t.grouping,r=t.currency,C=l&&a?function(n,t){for(var e=n.length,r=[],i=0,o=l[0],u=0;0<e&&0<o&&(t<u+o+1&&(o=Math.max(1,t-u)),r.push(n.substring(e-=o,e+o)),!((u+=o+1)>t));)o=l[i=(i+1)%l.length];return r.reverse().join(a)}:R,function(n){var t=Lt.exec(n),s=t[1]||" ",f=t[2]||">",h=t[3]||"-",e=t[4]||"",p=t[5],d=+t[6],g=t[7],v=t[8],y=t[9],m=1,x="",M="",_=!1,w=!0;switch(v&&(v=+v.substring(1)),(p||"0"===s&&"="===f)&&(p=s="0",f="="),y){case"n":g=!0,y="g";break;case"%":m=100,M="%",y="f";break;case"p":m=100,M="%",y="r";break;case"b":case"o":case"x":case"X":"#"===e&&(x="0"+y.toLowerCase());case"c":w=!1;case"d":_=!0,v=0;break;case"s":m=-1,y="r"}"$"===e&&(x=r[0],M=r[1]),"r"!=y||v||(y="g"),null!=v&&("g"==y?v=Math.max(1,Math.min(21,v)):"e"!=y&&"f"!=y||(v=Math.max(0,Math.min(20,v)))),y=Ft.get(y)||Tt;var b=p&&g;return function(n){var t=M;if(_&&n%1)return"";var e=n<0||0===n&&1/n<0?(n=-n,"-"):"-"===h?"":h;if(m<0){var r=q.formatPrefix(n,v);n=r.scale(n),t=r.symbol+M}else n*=m;var i,o,u=(n=y(n,v)).lastIndexOf(".");if(u<0){var a=w?n.lastIndexOf("e"):-1;a<0?(i=n,o=""):(i=n.substring(0,a),o=n.substring(a))}else i=n.substring(0,u),o=k+n.substring(u+1);!p&&g&&(i=C(i,1/0));var l=x.length+i.length+o.length+(b?0:e.length),c=l<d?new Array(l=d-l+1).join(s):"";return b&&(i=C(c+i,c.length?d-o.length:1/0)),e+=x,n=i+o,("<"===f?e+n+c:">"===f?c+e+n:"^"===f?c.substring(0,l>>=1)+e+n+c.substring(l):e+(b?n:c+n))+t}}),timeFormat:function(n){var t=n.dateTime,e=n.date,r=n.time,i=n.periods,o=n.days,u=n.shortDays,a=n.months,l=n.shortMonths;function c(a){var l=a.length;function n(n){for(var t,e,r,i=[],o=-1,u=0;++o<l;)37===a.charCodeAt(o)&&(i.push(a.slice(u,o)),null!=(e=Ot[t=a.charAt(++o)])&&(t=a.charAt(++o)),(r=M[t])&&(t=r(n,null==e?"e"===t?" ":"0":e)),i.push(t),u=o+1);return i.push(a.slice(u,o)),i.join("")}return n.parse=function(n){var t={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(s(t,a,n,0)!=n.length)return null;"p"in t&&(t.H=t.H%12+12*t.p);var e=null!=t.Z&&qt!==Dt,r=new(e?Dt:qt);return"j"in t?r.setFullYear(t.y,0,t.j):"W"in t||"U"in t?("w"in t||(t.w="W"in t?1:0),r.setFullYear(t.y,0,1),r.setFullYear(t.y,0,"W"in t?(t.w+6)%7+7*t.W-(r.getDay()+5)%7:t.w+7*t.U-(r.getDay()+6)%7)):r.setFullYear(t.y,t.m,t.d),r.setHours(t.H+(t.Z/100|0),t.M+t.Z%100,t.S,t.L),e?r._:r},n.toString=function(){return a},n}function s(n,t,e,r){for(var i,o,u,a=0,l=t.length,c=e.length;a<l;){if(c<=r)return-1;if(37===(i=t.charCodeAt(a++))){if(u=t.charAt(a++),!(o=_[u in Ot?t.charAt(a++):u])||(r=o(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}c.multi=(c.utc=function(n){var e=c(n);function t(n){try{var t=new(qt=Dt);return t._=n,e(t)}finally{qt=Date}}return t.parse=function(n){try{qt=Dt;var t=e.parse(n);return t&&t._}finally{qt=Date}},t.toString=e.toString,t}).multi=ue;var f=q.map(),h=Yt(o),p=Zt(o),d=Yt(u),g=Zt(u),v=Yt(a),y=Zt(a),m=Yt(l),x=Zt(l);i.forEach(function(n,t){f.set(n.toLowerCase(),t)});var M={a:function(n){return u[n.getDay()]},A:function(n){return o[n.getDay()]},b:function(n){return l[n.getMonth()]},B:function(n){return a[n.getMonth()]},c:c(t),d:function(n,t){return Ht(n.getDate(),t,2)},e:function(n,t){return Ht(n.getDate(),t,2)},H:function(n,t){return Ht(n.getHours(),t,2)},I:function(n,t){return Ht(n.getHours()%12||12,t,2)},j:function(n,t){return Ht(1+zt.dayOfYear(n),t,3)},L:function(n,t){return Ht(n.getMilliseconds(),t,3)},m:function(n,t){return Ht(n.getMonth()+1,t,2)},M:function(n,t){return Ht(n.getMinutes(),t,2)},p:function(n){return i[+(12<=n.getHours())]},S:function(n,t){return Ht(n.getSeconds(),t,2)},U:function(n,t){return Ht(zt.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Ht(zt.mondayOfYear(n),t,2)},x:c(e),X:c(r),y:function(n,t){return Ht(n.getFullYear()%100,t,2)},Y:function(n,t){return Ht(n.getFullYear()%1e4,t,4)},Z:ie,"%":function(){return"%"}},_={a:function(n,t,e){d.lastIndex=0;var r=d.exec(t.slice(e));return r?(n.w=g.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(n,t,e){h.lastIndex=0;var r=h.exec(t.slice(e));return r?(n.w=p.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(n,t,e){m.lastIndex=0;var r=m.exec(t.slice(e));return r?(n.m=x.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(n,t,e){v.lastIndex=0;var r=v.exec(t.slice(e));return r?(n.m=y.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(n,t,e){return s(n,M.c.toString(),t,e)},d:Kt,e:Kt,H:ne,I:ne,j:Qt,L:re,m:Gt,M:te,p:function(n,t,e){var r=f.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)},S:ee,U:$t,w:Vt,W:Bt,x:function(n,t,e){return s(n,M.x.toString(),t,e)},X:function(n,t,e){return s(n,M.X.toString(),t,e)},y:Wt,Y:Xt,Z:Jt,"%":oe};return c}(n)};var t,k,a,l,r,C};var ae=q.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function le(){}q.format=ae.numberFormat,q.geo={},le.prototype={s:0,t:0,add:function(n){se(n,this.t,ce),se(ce.s,this.s,this),this.s?this.t+=ce.t:this.s=ce.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ce=new le;function se(n,t,e){var r=e.s=n+t,i=r-n,o=r-i;e.t=n-o+(t-i)}function fe(n,t){n&&pe.hasOwnProperty(n.type)&&pe[n.type](n,t)}q.geo.stream=function(n,t){n&&he.hasOwnProperty(n.type)?he[n.type](n,t):fe(n,t)};var he={Feature:function(n,t){fe(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r<i;)fe(e[r].geometry,t)}},pe={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){de(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)de(e[r],t,0)},Polygon:function(n,t){ge(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)ge(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,i=e.length;++r<i;)fe(e[r],t)}};function de(n,t,e){var r,i=-1,o=n.length-e;for(t.lineStart();++i<o;)r=n[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function ge(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)de(n[e],t,1);t.polygonEnd()}q.geo.area=function(n){return ve=0,q.geo.stream(n,Ae),ve};var ve,ye,me,xe,Me,_e,we,be,ke,Ce,Ee,Ne,Se=new le,Ae={sphere:function(){ve+=4*Cn},point:L,lineStart:L,lineEnd:L,polygonStart:function(){Se.reset(),Ae.lineStart=Le},polygonEnd:function(){var n=2*Se;ve+=n<0?4*Cn+n:n,Ae.lineStart=Ae.lineEnd=Ae.point=L}};function Le(){var e,r,s,f,h;function i(n,t){t=t*An/2+Cn/4;var e=(n*=An)-s,r=0<=e?1:-1,i=r*e,o=Math.cos(t),u=Math.sin(t),a=h*u,l=f*o+a*Math.cos(i),c=a*r*Math.sin(i);Se.add(Math.atan2(c,l)),s=n,f=o,h=u}Ae.point=function(n,t){Ae.point=i,s=(e=n)*An,f=Math.cos(t=(r=t)*An/2+Cn/4),h=Math.sin(t)},Ae.lineEnd=function(){i(e,r)}}function Fe(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function Te(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function ze(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function qe(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function De(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Re(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function je(n){return[Math.atan2(n[1],n[0]),qn(n[2])]}function Pe(n,t){return z(n[0]-t[0])<bn&&z(n[1]-t[1])<bn}q.geo.bounds=function(){var s,f,h,p,d,r,i,g,o,l,c,v={point:y,lineStart:n,lineEnd:t,polygonStart:function(){v.point=e,v.lineStart=a,v.lineEnd=m,o=0,Ae.polygonStart()},polygonEnd:function(){Ae.polygonEnd(),v.point=y,v.lineStart=n,v.lineEnd=t,Se<0?(s=-(h=180),f=-(p=90)):bn<o?p=90:o<-bn&&(f=-90),c[0]=s,c[1]=h}};function y(n,t){l.push(c=[s=n,h=n]),t<f&&(f=t),p<t&&(p=t)}function u(n,t){var e=Fe([n*An,t*An]);if(g){var r=ze(g,e),i=ze([r[1],-r[0],0],r);Re(i),i=je(i);var o=n-d,u=0<o?1:-1,a=i[0]*Ln*u,l=180<z(o);if(l^(u*d<a&&a<u*n)){var c=i[1]*Ln;p<c&&(p=c)}else if(l^(u*d<(a=(a+360)%360-180)&&a<u*n)){(c=-i[1]*Ln)<f&&(f=c)}else t<f&&(f=t),p<t&&(p=t);l?n<d?x(s,n)>x(s,h)&&(h=n):x(n,h)>x(s,h)&&(s=n):s<=h?(n<s&&(s=n),h<n&&(h=n)):d<n?x(s,n)>x(s,h)&&(h=n):x(n,h)>x(s,h)&&(s=n)}else y(n,t);g=e,d=n}function n(){v.point=u}function t(){c[0]=s,c[1]=h,v.point=y,g=null}function e(n,t){if(g){var e=n-d;o+=180<z(e)?e+(0<e?360:-360):e}else r=n,i=t;Ae.point(n,t),u(n,t)}function a(){Ae.lineStart()}function m(){e(r,i),Ae.lineEnd(),z(o)>bn&&(s=-(h=180)),c[0]=s,c[1]=h,g=null}function x(n,t){return(t-=n)<0?t+360:t}function M(n,t){return n[0]-t[0]}function _(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}return function(n){if(p=h=-(s=f=1/0),l=[],q.geo.stream(n,v),i=l.length){l.sort(M);for(var t=1,e=[a=l[0]];t<i;++t)_((o=l[t])[0],a)||_(o[1],a)?(x(a[0],o[1])>x(a[0],a[1])&&(a[1]=o[1]),x(o[0],a[1])>x(a[0],a[1])&&(a[0]=o[0])):e.push(a=o);for(var r,i,o,u=-1/0,a=(t=0,e[i=e.length-1]);t<=i;a=o,++t)o=e[t],(r=x(a[1],o[0]))>u&&(u=r,s=o[0],h=a[1])}return l=c=null,s===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[s,f],[h,p]]}}(),q.geo.centroid=function(n){ye=me=xe=Me=_e=we=be=ke=Ce=Ee=Ne=0,q.geo.stream(n,Oe);var t=Ce,e=Ee,r=Ne,i=t*t+e*e+r*r;return i<kn&&(t=we,e=be,r=ke,me<bn&&(t=xe,e=Me,r=_e),(i=t*t+e*e+r*r)<kn)?[NaN,NaN]:[Math.atan2(e,t)*Ln,qn(r/Math.sqrt(i))*Ln]};var Oe={sphere:L,point:Ue,lineStart:He,lineEnd:Ye,polygonStart:function(){Oe.lineStart=Ze},polygonEnd:function(){Oe.lineStart=He}};function Ue(n,t){n*=An;var e=Math.cos(t*=An);Ie(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function Ie(n,t,e){xe+=(n-xe)/++ye,Me+=(t-Me)/ye,_e+=(e-_e)/ye}function He(){var a,l,c;function r(n,t){n*=An;var e=Math.cos(t*=An),r=e*Math.cos(n),i=e*Math.sin(n),o=Math.sin(t),u=Math.atan2(Math.sqrt((u=l*o-c*i)*u+(u=c*r-a*o)*u+(u=a*i-l*r)*u),a*r+l*i+c*o);me+=u,we+=u*(a+(a=r)),be+=u*(l+(l=i)),ke+=u*(c+(c=o)),Ie(a,l,c)}Oe.point=function(n,t){n*=An;var e=Math.cos(t*=An);a=e*Math.cos(n),l=e*Math.sin(n),c=Math.sin(t),Oe.point=r,Ie(a,l,c)}}function Ye(){Oe.point=Ue}function Ze(){var r,i,p,d,g;function o(n,t){n*=An;var e=Math.cos(t*=An),r=e*Math.cos(n),i=e*Math.sin(n),o=Math.sin(t),u=d*o-g*i,a=g*r-p*o,l=p*i-d*r,c=Math.sqrt(u*u+a*a+l*l),s=p*r+d*i+g*o,f=c&&-zn(s)/c,h=Math.atan2(c,s);Ce+=f*u,Ee+=f*a,Ne+=f*l,me+=h,we+=h*(p+(p=r)),be+=h*(d+(d=i)),ke+=h*(g+(g=o)),Ie(p,d,g)}Oe.point=function(n,t){r=n,i=t,Oe.point=o,n*=An;var e=Math.cos(t*=An);p=e*Math.cos(n),d=e*Math.sin(n),g=Math.sin(t),Ie(p,d,g)},Oe.lineEnd=function(){o(r,i),Oe.lineEnd=Ye,Oe.point=Ue}}function Ve(e,r){function n(n,t){return n=e(n,t),r(n[0],n[1])}return e.invert&&r.invert&&(n.invert=function(n,t){return(n=r.invert(n,t))&&e.invert(n[0],n[1])}),n}function $e(){return!0}function Be(n,t,e,r,a){var l=[],c=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(Pe(e,r)){a.lineStart();for(var i=0;i<t;++i)a.point((e=n[i])[0],e[1]);a.lineEnd()}else{var o=new We(e,n,null,!0),u=new We(e,null,o,!1);o.o=u,l.push(o),c.push(u),u=new We(r,null,o=new We(r,n,null,!1),!0),o.o=u,l.push(o),c.push(u)}}}),c.sort(t),Xe(l),Xe(c),l.length){for(var i=0,o=e,u=c.length;i<u;++i)c[i].e=o=!o;for(var s,f,h=l[0];;){for(var p=h,d=!0;p.v;)if((p=p.n)===h)return;s=p.z,a.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(i=0,u=s.length;i<u;++i)a.point((f=s[i])[0],f[1]);else r(p.x,p.n.x,1,a);p=p.n}else{if(d)for(i=(s=p.p.z).length-1;0<=i;--i)a.point((f=s[i])[0],f[1]);else r(p.x,p.p.x,-1,a);p=p.p}s=(p=p.o).z,d=!d}while(!p.v);a.lineEnd()}}}function Xe(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r<t;)i.n=e=n[r],e.p=i,i=e;i.n=e=n[0],e.p=i}}function We(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Je(m,x,M,_){return function(r,u){var a,i=x(u),t=r.invert(_[0],_[1]),e={point:o,lineStart:l,lineEnd:c,polygonStart:function(){e.point=g,e.lineStart=v,e.lineEnd=y,a=[],s=[]},polygonEnd:function(){e.point=o,e.lineStart=l,e.lineEnd=c,a=q.merge(a);var n=function(n,t){var e=n[0],r=n[1],i=[Math.sin(e),-Math.cos(e),0],o=0,u=0;Se.reset();for(var a=0,l=t.length;a<l;++a){var c=t[a],s=c.length;if(s)for(var f=c[0],h=f[0],p=f[1]/2+Cn/4,d=Math.sin(p),g=Math.cos(p),v=1;;){v===s&&(v=0);var y=(n=c[v])[0],m=n[1]/2+Cn/4,x=Math.sin(m),M=Math.cos(m),_=y-h,w=0<=_?1:-1,b=w*_,k=Cn<b,C=d*x;if(Se.add(Math.atan2(C*w*Math.sin(b),g*M+C*Math.cos(b))),o+=k?_+w*En:_,k^e<=h^e<=y){var E=ze(Fe(f),Fe(n));Re(E);var N=ze(i,E);Re(N);var S=(k^0<=_?-1:1)*qn(N[2]);(S<r||r===S&&(E[0]||E[1]))&&(u+=k^0<=_?1:-1)}if(!v++)break;h=y,d=x,g=M,f=n}}return(o<-bn||o<bn&&Se<-bn)^1&u}(t,s);a.length?(d||(u.polygonStart(),d=!0),Be(a,Qe,n,M,u)):n&&(d||(u.polygonStart(),d=!0),u.lineStart(),M(null,null,1,u),u.lineEnd()),d&&(u.polygonEnd(),d=!1),a=s=null},sphere:function(){u.polygonStart(),u.lineStart(),M(null,null,1,u),u.lineEnd(),u.polygonEnd()}};function o(n,t){var e=r(n,t);m(n=e[0],t=e[1])&&u.point(n,t)}function n(n,t){var e=r(n,t);i.point(e[0],e[1])}function l(){e.point=n,i.lineStart()}function c(){e.point=o,i.lineEnd()}var s,f,h=Ke(),p=x(h),d=!1;function g(n,t){f.push([n,t]);var e=r(n,t);p.point(e[0],e[1])}function v(){p.lineStart(),f=[]}function y(){g(f[0][0],f[0][1]),p.lineEnd();var n,t=p.clean(),e=h.buffer(),r=e.length;if(f.pop(),s.push(f),f=null,r)if(1&t){var i,o=-1;if(0<(r=(n=e[0]).length-1)){for(d||(u.polygonStart(),d=!0),u.lineStart();++o<r;)u.point((i=n[o])[0],i[1]);u.lineEnd()}}else 1<r&&2&t&&e.push(e.pop().concat(e.shift())),a.push(e.filter(Ge))}return e}}function Ge(n){return 1<n.length}function Ke(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(n,t){e.push([n,t])},lineEnd:L,buffer:function(){var n=t;return t=[],e=null,n},rejoin:function(){1<t.length&&t.push(t.pop().concat(t.shift()))}}}function Qe(n,t){return((n=n.x)[0]<0?n[1]-Sn-bn:Sn-n[1])-((t=t.x)[0]<0?t[1]-Sn-bn:Sn-t[1])}var nr=Je($e,function(f){var h,p=NaN,d=NaN,g=NaN;return{lineStart:function(){f.lineStart(),h=1},point:function(n,t){var e,r,i,o,u,a,l,c=0<n?Cn:-Cn,s=z(n-p);z(s-Cn)<bn?(f.point(p,d=0<(d+t)/2?Sn:-Sn),f.point(g,d),f.lineEnd(),f.lineStart(),f.point(c,d),f.point(n,d),h=0):g!==c&&Cn<=s&&(z(p-g)<bn&&(p-=g*bn),z(n-c)<bn&&(n-=c*bn),e=p,r=d,i=n,o=t,l=Math.sin(e-i),d=z(l)>bn?Math.atan((Math.sin(r)*(a=Math.cos(o))*Math.sin(i)-Math.sin(o)*(u=Math.cos(r))*Math.sin(e))/(u*a*l)):(r+o)/2,f.point(g,d),f.lineEnd(),f.lineStart(),f.point(c,d),h=0),f.point(p=n,d=t),g=c},lineEnd:function(){f.lineEnd(),p=d=NaN},clean:function(){return 2-h}}},function(n,t,e,r){var i;if(null==n)i=e*Sn,r.point(-Cn,i),r.point(0,i),r.point(Cn,i),r.point(Cn,0),r.point(Cn,-i),r.point(0,-i),r.point(-Cn,-i),r.point(-Cn,0),r.point(-Cn,i);else if(z(n[0]-t[0])>bn){var o=n[0]<t[0]?Cn:-Cn;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])},[-Cn,-Cn/2]);function tr(s,f,h,p){return function(n){var t,e=n.a,r=n.b,i=e.x,o=e.y,u=0,a=1,l=r.x-i,c=r.y-o;if(t=s-i,l||!(0<t)){if(t/=l,l<0){if(t<u)return;t<a&&(a=t)}else if(0<l){if(a<t)return;u<t&&(u=t)}if(t=h-i,l||!(t<0)){if(t/=l,l<0){if(a<t)return;u<t&&(u=t)}else if(0<l){if(t<u)return;t<a&&(a=t)}if(t=f-o,c||!(0<t)){if(t/=c,c<0){if(t<u)return;t<a&&(a=t)}else if(0<c){if(a<t)return;u<t&&(u=t)}if(t=p-o,c||!(t<0)){if(t/=c,c<0){if(a<t)return;u<t&&(u=t)}else if(0<c){if(t<u)return;t<a&&(a=t)}return 0<u&&(n.a={x:i+u*l,y:o+u*c}),a<1&&(n.b={x:i+a*l,y:o+a*c}),n}}}}}}var er=1e9;function rr(M,_,w,b){return function(i){var r,s,o,u,a,l,c,f,h,p,d,g=i,n=Ke(),v=tr(M,_,w,b),t={point:e,lineStart:function(){t.point=x,s&&s.push(o=[]);p=!0,h=!1,c=f=NaN},lineEnd:function(){r&&(x(u,a),l&&h&&n.rejoin(),r.push(n.buffer()));t.point=e,h&&i.lineEnd()},polygonStart:function(){i=n,r=[],s=[],d=!0},polygonEnd:function(){i=g,r=q.merge(r);var n=function(n){for(var t=0,e=s.length,r=n[1],i=0;i<e;++i)for(var o,u=1,a=s[i],l=a.length,c=a[0];u<l;++u)o=a[u],c[1]<=r?o[1]>r&&0<Tn(c,o,n)&&++t:o[1]<=r&&Tn(c,o,n)<0&&--t,c=o;return 0!==t}([M,b]),t=d&&n,e=r.length;(t||e)&&(i.polygonStart(),t&&(i.lineStart(),y(null,null,1,i),i.lineEnd()),e&&Be(r,C,n,y,i),i.polygonEnd()),r=s=o=null}};function y(n,t,e,r){var i=0,o=0;if(null==n||(i=k(n,e))!==(o=k(t,e))||E(n,t)<0^0<e)for(;r.point(0===i||3===i?M:w,1<i?b:_),(i=(i+e+4)%4)!==o;);else r.point(t[0],t[1])}function m(n,t){return M<=n&&n<=w&&_<=t&&t<=b}function e(n,t){m(n,t)&&i.point(n,t)}function x(n,t){var e=m(n=Math.max(-er,Math.min(er,n)),t=Math.max(-er,Math.min(er,t)));if(s&&o.push([n,t]),p)u=n,a=t,p=!1,(l=e)&&(i.lineStart(),i.point(n,t));else if(e&&h)i.point(n,t);else{var r={a:{x:c,y:f},b:{x:n,y:t}};v(r)?(h||(i.lineStart(),i.point(r.a.x,r.a.y)),i.point(r.b.x,r.b.y),e||i.lineEnd(),d=!1):e&&(i.lineStart(),i.point(n,t),d=!1)}c=n,f=t,h=e}return t};function k(n,t){return z(n[0]-M)<bn?0<t?0:3:z(n[0]-w)<bn?0<t?2:1:z(n[1]-_)<bn?0<t?1:0:0<t?3:2}function C(n,t){return E(n.x,t.x)}function E(n,t){var e=k(n,1),r=k(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}}function ir(n){var t=0,e=Cn/3,r=Er(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*Cn/180,e=n[1]*Cn/180):[t/Cn*180,e/Cn*180]},i}function or(n,t){var e=Math.sin(n),r=(e+Math.sin(t))/2,i=1+e*(2*r-e),o=Math.sqrt(i)/r;function u(n,t){var e=Math.sqrt(i-2*r*Math.sin(t))/r;return[e*Math.sin(n*=r),o-e*Math.cos(n)]}return u.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/r,qn((i-(n*n+e*e)*r*r)/(2*r))]},u}q.geo.clipExtent=function(){var t,e,r,i,o,u,a={stream:function(n){return o&&(o.valid=!1),(o=u(n)).valid=!0,o},extent:function(n){return arguments.length?(u=rr(t=+n[0][0],e=+n[0][1],r=+n[1][0],i=+n[1][1]),o&&(o.valid=!1,o=null),a):[[t,e],[r,i]]}};return a.extent([[0,0],[960,500]])},(q.geo.conicEqualArea=function(){return ir(or)}).raw=or,q.geo.albers=function(){return q.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},q.geo.albersUsa=function(){var r,i,o,u,a=q.geo.albers(),l=q.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=q.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(n,t){r=[n,t]}};function f(n){var t=n[0],e=n[1];return r=null,i(t,e),r||(o(t,e),r)||u(t,e),r}return f.invert=function(n){var t=a.scale(),e=a.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(.12<=i&&i<.234&&-.425<=r&&r<-.214?l:.166<=i&&i<.234&&-.214<=r&&r<-.115?c:a).invert(n)},f.stream=function(n){var e=a.stream(n),r=l.stream(n),i=c.stream(n);return{point:function(n,t){e.point(n,t),r.point(n,t),i.point(n,t)},sphere:function(){e.sphere(),r.sphere(),i.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),i.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),i.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),i.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),i.polygonEnd()}}},f.precision=function(n){return arguments.length?(a.precision(n),l.precision(n),c.precision(n),f):a.precision()},f.scale=function(n){return arguments.length?(a.scale(n),l.scale(.35*n),c.scale(n),f.translate(a.translate())):a.scale()},f.translate=function(n){if(!arguments.length)return a.translate();var t=a.scale(),e=+n[0],r=+n[1];return i=a.translate(n).clipExtent([[e-.455*t,r-.238*t],[e+.455*t,r+.238*t]]).stream(s).point,o=l.translate([e-.307*t,r+.201*t]).clipExtent([[e-.425*t+bn,r+.12*t+bn],[e-.214*t-bn,r+.234*t-bn]]).stream(s).point,u=c.translate([e-.205*t,r+.212*t]).clipExtent([[e-.214*t+bn,r+.166*t+bn],[e-.115*t-bn,r+.234*t-bn]]).stream(s).point,f},f.scale(1070)};var ur,ar,lr,cr,sr,fr,hr={point:L,lineStart:L,lineEnd:L,polygonStart:function(){ar=0,hr.lineStart=pr},polygonEnd:function(){hr.lineStart=hr.lineEnd=hr.point=L,ur+=z(ar/2)}};function pr(){var e,r,i,o;function u(n,t){ar+=o*n-i*t,i=n,o=t}hr.point=function(n,t){hr.point=u,e=i=n,r=o=t},hr.lineEnd=function(){u(e,r)}}var dr={point:function(n,t){n<lr&&(lr=n);sr<n&&(sr=n);t<cr&&(cr=t);fr<t&&(fr=t)},lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L};function gr(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}var vr,yr={point:mr,lineStart:xr,lineEnd:Mr,polygonStart:function(){yr.lineStart=_r},polygonEnd:function(){yr.point=mr,yr.lineStart=xr,yr.lineEnd=Mr}};function mr(n,t){xe+=n,Me+=t,++_e}function xr(){var o,u;function e(n,t){var e=n-o,r=t-u,i=Math.sqrt(e*e+r*r);we+=i*(o+n)/2,be+=i*(u+t)/2,ke+=i,mr(o=n,u=t)}yr.point=function(n,t){yr.point=e,mr(o=n,u=t)}}function Mr(){yr.point=mr}function _r(){var e,r,o,u;function i(n,t){var e=n-o,r=t-u,i=Math.sqrt(e*e+r*r);we+=i*(o+n)/2,be+=i*(u+t)/2,ke+=i,Ce+=(i=u*n-o*t)*(o+n),Ee+=i*(u+t),Ne+=3*i,mr(o=n,u=t)}yr.point=function(n,t){yr.point=i,mr(e=o=n,r=u=t)},yr.lineEnd=function(){i(e,r)}}function wr(A){var L=.5,F=Math.cos(30*An),_=16;function t(n){return(_?function(i){var e,r,o,u,a,l,c,s,f,h,p,d,g={point:n,lineStart:t,lineEnd:y,polygonStart:function(){i.polygonStart(),g.lineStart=m},polygonEnd:function(){i.polygonEnd(),g.lineStart=t}};function n(n,t){n=A(n,t),i.point(n[0],n[1])}function t(){s=NaN,g.point=v,i.lineStart()}function v(n,t){var e=Fe([n,t]),r=A(n,t);T(s,f,c,h,p,d,s=r[0],f=r[1],c=n,h=e[0],p=e[1],d=e[2],_,i),i.point(s,f)}function y(){g.point=n,i.lineEnd()}function m(){t(),g.point=x,g.lineEnd=M}function x(n,t){v(e=n,t),r=s,o=f,u=h,a=p,l=d,g.point=v}function M(){T(s,f,c,h,p,d,r,o,e,u,a,l,_,i),(g.lineEnd=y)()}return g}:function(e){return kr(e,function(n,t){n=A(n,t),e.point(n[0],n[1])})})(n)}function T(n,t,e,r,i,o,u,a,l,c,s,f,h,p){var d=u-n,g=a-t,v=d*d+g*g;if(4*L<v&&h--){var y=r+c,m=i+s,x=o+f,M=Math.sqrt(y*y+m*m+x*x),_=Math.asin(x/=M),w=z(z(x)-1)<bn||z(e-l)<bn?(e+l)/2:Math.atan2(m,y),b=A(w,_),k=b[0],C=b[1],E=k-n,N=C-t,S=g*E-d*N;(L<S*S/v||.3<z((d*E+g*N)/v-.5)||r*c+i*s+o*f<F)&&(T(n,t,e,r,i,o,k,C,w,y/=M,m/=M,x,h,p),p.point(k,C),T(k,C,w,y,m,x,u,a,l,c,s,f,h,p))}}return t.precision=function(n){return arguments.length?(_=0<(L=n*n)&&16,t):Math.sqrt(L)},t}function br(n){this.stream=n}function kr(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function Cr(n){return Er(function(){return n})()}function Er(n){var e,t,r,i,o,u,a=wr(function(n,t){return[(n=e(n,t))[0]*l+i,o-n[1]*l]}),l=150,c=480,s=250,f=0,h=0,p=0,d=0,g=0,v=nr,y=R,m=null,x=null;function M(n){return[(n=r(n[0]*An,n[1]*An))[0]*l+i,o-n[1]*l]}function _(n){return(n=r.invert((n[0]-i)/l,(o-n[1])/l))&&[n[0]*Ln,n[1]*Ln]}function w(){r=Ve(t=Lr(p,d,g),e);var n=e(f,h);return i=c-n[0]*l,o=s+n[1]*l,b()}function b(){return u&&(u.valid=!1,u=null),M}return M.stream=function(n){return u&&(u.valid=!1),(u=Nr(v(t,a(y(n))))).valid=!0,u},M.clipAngle=function(n){return arguments.length?(v=null==n?(m=n,nr):function(i){var E=Math.cos(i),p=0<E,d=z(E)>bn;return Je(g,function(a){var l,c,s,f,h;return{lineStart:function(){f=s=!1,h=1},point:function(n,t){var e,r=[n,t],i=g(n,t),o=p?i?0:y(n,t):i?y(n+(n<0?Cn:-Cn),t):0;if(!l&&(f=s=i)&&a.lineStart(),i!==s&&(e=v(l,r),(Pe(l,e)||Pe(r,e))&&(r[0]+=bn,r[1]+=bn,i=g(r[0],r[1]))),i!==s)h=0,i?(a.lineStart(),e=v(r,l),a.point(e[0],e[1])):(e=v(l,r),a.point(e[0],e[1]),a.lineEnd()),l=e;else if(d&&l&&p^i){var u;o&c||!(u=v(r,l,!0))||(h=0,p?(a.lineStart(),a.point(u[0][0],u[0][1]),a.point(u[1][0],u[1][1]),a.lineEnd()):(a.point(u[1][0],u[1][1]),a.lineEnd(),a.lineStart(),a.point(u[0][0],u[0][1])))}!i||l&&Pe(l,r)||a.point(r[0],r[1]),l=r,s=i,c=o},lineEnd:function(){s&&a.lineEnd(),l=null},clean:function(){return h|(f&&s)<<1}}},qr(i,6*An),p?[0,-i]:[-Cn,i-Cn]);function g(n,t){return Math.cos(n)*Math.cos(t)>E}function v(n,t,e){var r=[1,0,0],i=ze(Fe(n),Fe(t)),o=Te(i,i),u=i[0],a=o-u*u;if(!a)return!e&&n;var l=E*o/a,c=-E*u/a,s=ze(r,i),f=De(r,l);qe(f,De(i,c));var h=s,p=Te(f,h),d=Te(h,h),g=p*p-d*(Te(f,f)-1);if(!(g<0)){var v=Math.sqrt(g),y=De(h,(-p-v)/d);if(qe(y,f),y=je(y),!e)return y;var m,x=n[0],M=t[0],_=n[1],w=t[1];M<x&&(m=x,x=M,M=m);var b=M-x,k=z(b-Cn)<bn;if(!k&&w<_&&(m=_,_=w,w=m),k||b<bn?k?0<_+w^y[1]<(z(y[0]-x)<bn?_:w):_<=y[1]&&y[1]<=w:Cn<b^(x<=y[0]&&y[0]<=M)){var C=De(h,(-p+v)/d);return qe(C,f),[y,je(C)]}}}function y(n,t){var e=p?i:Cn-i,r=0;return n<-e?r|=1:e<n&&(r|=2),t<-e?r|=4:e<t&&(r|=8),r}}((m=+n)*An),b()):m},M.clipExtent=function(n){return arguments.length?(y=(x=n)?rr(n[0][0],n[0][1],n[1][0],n[1][1]):R,b()):x},M.scale=function(n){return arguments.length?(l=+n,w()):l},M.translate=function(n){return arguments.length?(c=+n[0],s=+n[1],w()):[c,s]},M.center=function(n){return arguments.length?(f=n[0]%360*An,h=n[1]%360*An,w()):[f*Ln,h*Ln]},M.rotate=function(n){return arguments.length?(p=n[0]%360*An,d=n[1]%360*An,g=2<n.length?n[2]%360*An:0,w()):[p*Ln,d*Ln,g*Ln]},q.rebind(M,a,"precision"),function(){return e=n.apply(this,arguments),M.invert=e.invert&&_,w()}}function Nr(e){return kr(e,function(n,t){e.point(n*An,t*An)})}function Sr(n,t){return[n,t]}function Ar(n,t){return[Cn<n?n-En:n<-Cn?n+En:n,t]}function Lr(n,t,e){return n?t||e?Ve(Tr(n),zr(t,e)):Tr(n):t||e?zr(t,e):Ar}function Fr(e){return function(n,t){return[Cn<(n+=e)?n-En:n<-Cn?n+En:n,t]}}function Tr(n){var t=Fr(n);return t.invert=Fr(-n),t}function zr(n,t){var a=Math.cos(n),l=Math.sin(n),c=Math.cos(t),s=Math.sin(t);function e(n,t){var e=Math.cos(t),r=Math.cos(n)*e,i=Math.sin(n)*e,o=Math.sin(t),u=o*a+r*l;return[Math.atan2(i*c-u*s,r*a-o*l),qn(u*c+i*s)]}return e.invert=function(n,t){var e=Math.cos(t),r=Math.cos(n)*e,i=Math.sin(n)*e,o=Math.sin(t),u=o*c-i*s;return[Math.atan2(i*c+o*s,r*a+u*l),qn(u*a-r*l)]},e}function qr(a,l){var c=Math.cos(a),s=Math.sin(a);return function(n,t,e,r){var i=e*l;null!=n?(n=Dr(c,n),t=Dr(c,t),(0<e?n<t:t<n)&&(n+=e*En)):(n=a+e*En,t=a-.5*i);for(var o,u=n;0<e?t<u:u<t;u-=i)r.point((o=je([c,-s*Math.cos(u),-s*Math.sin(u)]))[0],o[1])}}function Dr(n,t){var e=Fe(t);e[0]-=n,Re(e);var r=zn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-bn)%(2*Math.PI)}function Rr(n,t,e){var r=q.range(n,t-bn,e).concat(t);return function(t){return r.map(function(n){return[t,n]})}}function jr(n,t,e){var r=q.range(n,t-bn,e).concat(t);return function(t){return r.map(function(n){return[n,t]})}}function Pr(n){return n.source}function Or(n){return n.target}q.geo.path=function(){var r,t,i,e,o,u=4.5;function a(n){return n&&("function"==typeof u&&e.pointRadius(+u.apply(this,arguments)),o&&o.valid||(o=i(e)),q.geo.stream(n,o)),e.result()}function l(){return o=null,a}return a.area=function(n){return ur=0,q.geo.stream(n,i(hr)),ur},a.centroid=function(n){return xe=Me=_e=we=be=ke=Ce=Ee=Ne=0,q.geo.stream(n,i(yr)),Ne?[Ce/Ne,Ee/Ne]:ke?[we/ke,be/ke]:_e?[xe/_e,Me/_e]:[NaN,NaN]},a.bounds=function(n){return sr=fr=-(lr=cr=1/0),q.geo.stream(n,i(dr)),[[lr,cr],[sr,fr]]},a.projection=function(n){return arguments.length?(i=(r=n)?n.stream||(e=n,t=wr(function(n,t){return e([n*Ln,t*Ln])}),function(n){return Nr(t(n))}):R,l()):r;var e,t},a.context=function(n){return arguments.length?(e=null==(t=n)?new function(){var e=gr(4.5),r=[],i={point:n,lineStart:function(){i.point=t},lineEnd:u,polygonStart:function(){i.lineEnd=a},polygonEnd:function(){i.lineEnd=u,i.point=n},pointRadius:function(n){return e=gr(n),i},result:function(){if(r.length){var n=r.join("");return r=[],n}}};function n(n,t){r.push("M",n,",",t,e)}function t(n,t){r.push("M",n,",",t),i.point=o}function o(n,t){r.push("L",n,",",t)}function u(){i.point=n}function a(){r.push("Z")}return i}:new function(e){var r=4.5,i={point:n,lineStart:function(){i.point=t},lineEnd:u,polygonStart:function(){i.lineEnd=a},polygonEnd:function(){i.lineEnd=u,i.point=n},pointRadius:function(n){return r=n,i},result:L};function n(n,t){e.moveTo(n+r,t),e.arc(n,t,r,0,En)}function t(n,t){e.moveTo(n,t),i.point=o}function o(n,t){e.lineTo(n,t)}function u(){i.point=n}function a(){e.closePath()}return i}(n),"function"!=typeof u&&e.pointRadius(u),l()):t},a.pointRadius=function(n){return arguments.length?(u="function"==typeof n?n:(e.pointRadius(+n),+n),a):u},a.projection(q.geo.albersUsa()).context(null)},q.geo.transform=function(r){return{stream:function(n){var t=new br(n);for(var e in r)t[e]=r[e];return t}}},br.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},q.geo.projection=Cr,q.geo.projectionMutator=Er,(q.geo.equirectangular=function(){return Cr(Sr)}).raw=Sr.invert=Sr,q.geo.rotation=function(t){function n(n){return(n=t(n[0]*An,n[1]*An))[0]*=Ln,n[1]*=Ln,n}return t=Lr(t[0]%360*An,t[1]*An,2<t.length?t[2]*An:0),n.invert=function(n){return(n=t.invert(n[0]*An,n[1]*An))[0]*=Ln,n[1]*=Ln,n},n},Ar.invert=Sr,q.geo.circle=function(){var t,i,o=[0,0],e=6;function r(){var n="function"==typeof o?o.apply(this,arguments):o,e=Lr(-n[0]*An,-n[1]*An,0).invert,r=[];return i(null,null,1,{point:function(n,t){r.push(n=e(n,t)),n[0]*=Ln,n[1]*=Ln}}),{type:"Polygon",coordinates:[r]}}return r.origin=function(n){return arguments.length?(o=n,r):o},r.angle=function(n){return arguments.length?(i=qr((t=+n)*An,e*An),r):t},r.precision=function(n){return arguments.length?(i=qr(t*An,(e=+n)*An),r):e},r.angle(90)},q.geo.distance=function(n,t){var e,r=(t[0]-n[0])*An,i=n[1]*An,o=t[1]*An,u=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),s=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((e=f*u)*e+(e=c*s-l*f*a)*e),l*s+c*f*a)},q.geo.graticule=function(){var t,e,r,i,o,u,a,l,c,s,f,h,p=10,d=p,g=90,v=360,y=2.5;function m(){return{type:"MultiLineString",coordinates:n()}}function n(){return q.range(Math.ceil(i/g)*g,r,g).map(f).concat(q.range(Math.ceil(l/v)*v,a,v).map(h)).concat(q.range(Math.ceil(e/p)*p,t,p).filter(function(n){return z(n%g)>bn}).map(c)).concat(q.range(Math.ceil(u/d)*d,o,d).filter(function(n){return z(n%v)>bn}).map(s))}return m.lines=function(){return n().map(function(n){return{type:"LineString",coordinates:n}})},m.outline=function(){return{type:"Polygon",coordinates:[f(i).concat(h(a).slice(1),f(r).reverse().slice(1),h(l).reverse().slice(1))]}},m.extent=function(n){return arguments.length?m.majorExtent(n).minorExtent(n):m.minorExtent()},m.majorExtent=function(n){return arguments.length?(i=+n[0][0],r=+n[1][0],l=+n[0][1],a=+n[1][1],r<i&&(n=i,i=r,r=n),a<l&&(n=l,l=a,a=n),m.precision(y)):[[i,l],[r,a]]},m.minorExtent=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],u=+n[0][1],o=+n[1][1],t<e&&(n=e,e=t,t=n),o<u&&(n=u,u=o,o=n),m.precision(y)):[[e,u],[t,o]]},m.step=function(n){return arguments.length?m.majorStep(n).minorStep(n):m.minorStep()},m.majorStep=function(n){return arguments.length?(g=+n[0],v=+n[1],m):[g,v]},m.minorStep=function(n){return arguments.length?(p=+n[0],d=+n[1],m):[p,d]},m.precision=function(n){return arguments.length?(y=+n,c=Rr(u,o,90),s=jr(e,t,y),f=Rr(l,a,90),h=jr(i,r,y),m):y},m.majorExtent([[-180,-90+bn],[180,90-bn]]).minorExtent([[-180,-80-bn],[180,80+bn]])},q.geo.greatArc=function(){var t,e,r=Pr,i=Or;function o(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}return o.distance=function(){return q.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},o.source=function(n){return arguments.length?(t="function"==typeof(r=n)?null:n,o):r},o.target=function(n){return arguments.length?(e="function"==typeof(i=n)?null:n,o):i},o.precision=function(){return arguments.length?o:0},o},q.geo.interpolate=function(n,t){return e=n[0]*An,r=n[1]*An,i=t[0]*An,o=t[1]*An,u=Math.cos(r),a=Math.sin(r),l=Math.cos(o),c=Math.sin(o),s=u*Math.cos(e),f=u*Math.sin(e),h=l*Math.cos(i),p=l*Math.sin(i),d=2*Math.asin(Math.sqrt(Rn(o-r)+u*l*Rn(i-e))),g=1/Math.sin(d),(v=d?function(n){var t=Math.sin(n*=d)*g,e=Math.sin(d-n)*g,r=e*s+t*h,i=e*f+t*p,o=e*a+t*c;return[Math.atan2(i,r)*Ln,Math.atan2(o,Math.sqrt(r*r+i*i))*Ln]}:function(){return[e*Ln,r*Ln]}).distance=d,v;var e,r,i,o,u,a,l,c,s,f,h,p,d,g,v},q.geo.length=function(n){return vr=0,q.geo.stream(n,Ur),vr};var Ur={sphere:L,point:L,lineStart:function(){var u,a,l;function e(n,t){var e=Math.sin(t*=An),r=Math.cos(t),i=z((n*=An)-u),o=Math.cos(i);vr+=Math.atan2(Math.sqrt((i=r*Math.sin(i))*i+(i=l*e-a*r*o)*i),a*e+l*r*o),u=n,a=e,l=r}Ur.point=function(n,t){u=n*An,a=Math.sin(t*=An),l=Math.cos(t),Ur.point=e},Ur.lineEnd=function(){Ur.point=Ur.lineEnd=L}},lineEnd:L,polygonStart:L,polygonEnd:L};function Ir(o,u){function n(n,t){var e=Math.cos(n),r=Math.cos(t),i=o(e*r);return[i*r*Math.sin(n),i*Math.sin(t)]}return n.invert=function(n,t){var e=Math.sqrt(n*n+t*t),r=u(e),i=Math.sin(r),o=Math.cos(r);return[Math.atan2(n*i,e*o),Math.asin(e&&t*i/e)]},n}var Hr=Ir(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(q.geo.azimuthalEqualArea=function(){return Cr(Hr)}).raw=Hr;var Yr=Ir(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},R);function Zr(n,t){var e=Math.cos(n),r=function(n){return Math.tan(Cn/4+n/2)},i=n===t?Math.sin(n):Math.log(e/Math.cos(t))/Math.log(r(t)/r(n)),o=e*Math.pow(r(n),i)/i;if(!i)return Br;function u(n,t){0<o?t<-Sn+bn&&(t=-Sn+bn):Sn-bn<t&&(t=Sn-bn);var e=o/Math.pow(r(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}return u.invert=function(n,t){var e=o-t,r=Fn(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-Sn]},u}function Vr(n,t){var e=Math.cos(n),r=n===t?Math.sin(n):(e-Math.cos(t))/(t-n),i=e/r+n;if(z(r)<bn)return Sr;function o(n,t){var e=i-t;return[e*Math.sin(r*n),i-e*Math.cos(r*n)]}return o.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/r,i-Fn(r)*Math.sqrt(n*n+e*e)]},o}(q.geo.azimuthalEquidistant=function(){return Cr(Yr)}).raw=Yr,(q.geo.conicConformal=function(){return ir(Zr)}).raw=Zr,(q.geo.conicEquidistant=function(){return ir(Vr)}).raw=Vr;var $r=Ir(function(n){return 1/n},Math.atan);function Br(n,t){return[n,Math.log(Math.tan(Cn/4+t/2))]}function Xr(n){var i,o=Cr(n),u=o.scale,a=o.translate,l=o.clipExtent;return o.scale=function(){var n=u.apply(o,arguments);return n===o?i?o.clipExtent(null):o:n},o.translate=function(){var n=a.apply(o,arguments);return n===o?i?o.clipExtent(null):o:n},o.clipExtent=function(n){var t=l.apply(o,arguments);if(t===o){if(i=null==n){var e=Cn*u(),r=a();l([[r[0]-e,r[1]-e],[r[0]+e,r[1]+e]])}}else i&&(t=null);return t},o.clipExtent(null)}(q.geo.gnomonic=function(){return Cr($r)}).raw=$r,Br.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Sn]},(q.geo.mercator=function(){return Xr(Br)}).raw=Br;var Wr=Ir(function(){return 1},Math.asin);(q.geo.orthographic=function(){return Cr(Wr)}).raw=Wr;var Jr=Ir(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});function Gr(n,t){return[Math.log(Math.tan(Cn/4+t/2)),-n]}function Kr(n){return n[0]}function Qr(n){return n[1]}function ni(n){for(var t=n.length,e=[0,1],r=2,i=2;i<t;i++){for(;1<r&&Tn(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function ti(n,t){return n[0]-t[0]||n[1]-t[1]}(q.geo.stereographic=function(){return Cr(Jr)}).raw=Jr,Gr.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Sn]},(q.geo.transverseMercator=function(){var n=Xr(Gr),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):[(n=t())[1],-n[0]]},n.rotate=function(n){return n?e([n[0],n[1],2<n.length?n[2]+90:90]):[(n=e())[0],n[1],n[2]-90]},e([0,0,90])}).raw=Gr,q.geom={},q.geom.hull=function(n){var h=Kr,p=Qr;if(arguments.length)return t(n);function t(n){if(n.length<3)return[];var t,e=vt(h),r=vt(p),i=n.length,o=[],u=[];for(t=0;t<i;t++)o.push([+e.call(this,n[t],t),+r.call(this,n[t],t),t]);for(o.sort(ti),t=0;t<i;t++)u.push([o[t][0],-o[t][1]]);var a=ni(o),l=ni(u),c=l[0]===a[0],s=l[l.length-1]===a[a.length-1],f=[];for(t=a.length-1;0<=t;--t)f.push(n[o[a[t]][2]]);for(t=+c;t<l.length-s;++t)f.push(n[o[l[t]][2]]);return f}return t.x=function(n){return arguments.length?(h=n,t):h},t.y=function(n){return arguments.length?(p=n,t):p},t},q.geom.polygon=function(n){return I(n,ei),n};var ei=q.geom.polygon.prototype=[];function ri(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function ii(n,t,e,r){var i=n[0],o=e[0],u=t[0]-i,a=r[0]-o,l=n[1],c=e[1],s=t[1]-l,f=r[1]-c,h=(a*(l-c)-f*(i-o))/(f*u-a*s);return[i+h*u,l+h*s]}function oi(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}ei.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],i=0;++t<e;)n=r,r=this[t],i+=n[1]*r[0]-n[0]*r[1];return.5*i},ei.centroid=function(n){var t,e,r=-1,i=this.length,o=0,u=0,a=this[i-1];for(arguments.length||(n=-1/(6*this.area()));++r<i;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],o+=(t[0]+a[0])*e,u+=(t[1]+a[1])*e;return[o*n,u*n]},ei.clip=function(n){for(var t,e,r,i,o,u,a=oi(n),l=-1,c=this.length-oi(this),s=this[c-1];++l<c;){for(t=n.slice(),n.length=0,i=this[l],o=t[(r=t.length-a)-1],e=-1;++e<r;)ri(u=t[e],s,i)?(ri(o,s,i)||n.push(ii(o,u,s,i)),n.push(u)):ri(o,s,i)&&n.push(ii(o,u,s,i)),o=u;a&&n.push(n[0]),s=i}return n};var ui,ai,li,ci,si,fi=[],hi=[];function pi(n){var t=fi.pop()||new function(){Ai(this),this.edge=this.site=this.circle=null};return t.site=n,t}function di(n){wi(n),li.remove(n),fi.push(n),Ai(n)}function gi(n){var t=n.circle,e=t.x,r=t.cy,i={x:e,y:r},o=n.P,u=n.N,a=[n];di(n);for(var l=o;l.circle&&z(e-l.circle.x)<bn&&z(r-l.circle.cy)<bn;)o=l.P,a.unshift(l),di(l),l=o;a.unshift(l),wi(l);for(var c=u;c.circle&&z(e-c.circle.x)<bn&&z(r-c.circle.cy)<bn;)u=c.N,a.push(c),di(c),c=u;a.push(c),wi(c);var s,f=a.length;for(s=1;s<f;++s)c=a[s],l=a[s-1],Ei(c.edge,l.site,c.site,i);l=a[0],(c=a[f-1]).edge=Ci(l.site,c.site,null,i),_i(l),_i(c)}function vi(n){for(var t,e,r,i,o=n.x,u=n.y,a=li._;a;)if(r=yi(a,u)-o,bn<r)a=a.L;else{if(i=o-mi(a,u),!(bn<i)){-bn<r?(t=a.P,e=a):-bn<i?e=(t=a).N:t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=pi(n);if(li.insert(t,l),t||e){if(t===e)return wi(t),e=pi(t.site),li.insert(l,e),l.edge=e.edge=Ci(t.site,l.site),_i(t),void _i(e);if(e){wi(t),wi(e);var c=t.site,s=c.x,f=c.y,h=n.x-s,p=n.y-f,d=e.site,g=d.x-s,v=d.y-f,y=2*(h*v-p*g),m=h*h+p*p,x=g*g+v*v,M={x:(v*m-p*x)/y+s,y:(h*x-g*m)/y+f};Ei(e.edge,c,d,M),l.edge=Ci(c,n,null,M),e.edge=Ci(n,d,null,M),_i(t),_i(e)}else l.edge=Ci(t.site,l.site)}}function yi(n,t){var e=n.site,r=e.x,i=e.y,o=i-t;if(!o)return r;var u=n.P;if(!u)return-1/0;var a=(e=u.site).x,l=e.y,c=l-t;if(!c)return a;var s=a-r,f=1/o-1/c,h=s/c;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*c)-l+c/2+i-o/2)))/f+r:(r+a)/2}function mi(n,t){var e=n.N;if(e)return yi(e,t);var r=n.site;return r.y===t?r.x:1/0}function xi(n){this.site=n,this.edges=[]}function Mi(n,t){return t.angle-n.angle}function _i(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,i=n.site,o=e.site;if(r!==o){var u=i.x,a=i.y,l=r.x-u,c=r.y-a,s=o.x-u,f=2*(l*(v=o.y-a)-c*s);if(!(-kn<=f)){var h=l*l+c*c,p=s*s+v*v,d=(v*h-c*p)/f,g=(l*p-s*h)/f,v=g+a,y=hi.pop()||new function(){Ai(this),this.x=this.y=this.arc=this.site=this.cy=null};y.arc=n,y.site=i,y.x=d+u,y.y=v+Math.sqrt(d*d+g*g),y.cy=v,n.circle=y;for(var m=null,x=si._;x;)if(y.y<x.y||y.y===x.y&&y.x<=x.x){if(!x.L){m=x.P;break}x=x.L}else{if(!x.R){m=x;break}x=x.R}si.insert(m,y),m||(ci=y)}}}}function wi(n){var t=n.circle;t&&(t.P||(ci=t.N),si.remove(t),hi.push(t),Ai(t),n.circle=null)}function bi(n,t){var e=n.b;if(e)return!0;var r,i,o=n.a,u=t[0][0],a=t[1][0],l=t[0][1],c=t[1][1],s=n.l,f=n.r,h=s.x,p=s.y,d=f.x,g=f.y,v=(h+d)/2,y=(p+g)/2;if(g===p){if(v<u||a<=v)return;if(d<h){if(o){if(o.y>=c)return}else o={x:v,y:l};e={x:v,y:c}}else{if(o){if(o.y<l)return}else o={x:v,y:c};e={x:v,y:l}}}else if(i=y-(r=(h-d)/(g-p))*v,r<-1||1<r)if(d<h){if(o){if(o.y>=c)return}else o={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(o){if(o.y<l)return}else o={x:(c-i)/r,y:c};e={x:(l-i)/r,y:l}}else if(p<g){if(o){if(o.x>=a)return}else o={x:u,y:r*u+i};e={x:a,y:r*a+i}}else{if(o){if(o.x<u)return}else o={x:a,y:r*a+i};e={x:u,y:r*u+i}}return n.a=o,n.b=e,!0}function ki(n,t){this.l=n,this.r=t,this.a=this.b=null}function Ci(n,t,e,r){var i=new ki(n,t);return ui.push(i),e&&Ei(i,n,t,e),r&&Ei(i,t,n,r),ai[n.i].edges.push(new Ni(i,n,t)),ai[t.i].edges.push(new Ni(i,t,n)),i}function Ei(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function Ni(n,t,e){var r=n.a,i=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function Si(){this._=null}function Ai(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function Li(n,t){var e=t,r=t.R,i=e.U;i?i.L===e?i.L=r:i.R=r:n._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function Fi(n,t){var e=t,r=t.L,i=e.U;i?i.L===e?i.L=r:i.R=r:n._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function Ti(n){for(;n.L;)n=n.L;return n}function zi(n,t){var e,r,i,o=n.sort(qi).pop();for(ui=[],ai=new Array(n.length),li=new Si,si=new Si;;)if(i=ci,o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x))o.x===e&&o.y===r||(ai[o.i]=new xi(o),vi(o),e=o.x,r=o.y),o=n.pop();else{if(!i)break;gi(i.arc)}t&&(function(n){for(var t,e=ui,r=tr(n[0][0],n[0][1],n[1][0],n[1][1]),i=e.length;i--;)(!bi(t=e[i],n)||!r(t)||z(t.a.x-t.b.x)<bn&&z(t.a.y-t.b.y)<bn)&&(t.a=t.b=null,e.splice(i,1))}(t),function(n){for(var t,e,r,i,o,u,a,l,c,s,f=n[0][0],h=n[1][0],p=n[0][1],d=n[1][1],g=ai,v=g.length;v--;)if((o=g[v])&&o.prepare())for(l=(a=o.edges).length,u=0;u<l;)r=(s=a[u].end()).x,i=s.y,t=(c=a[++u%l].start()).x,e=c.y,(z(r-t)>bn||z(i-e)>bn)&&(a.splice(u,0,new Ni((y=o.site,m=s,x=z(r-f)<bn&&bn<d-i?{x:f,y:z(t-f)<bn?e:d}:z(i-d)<bn&&bn<h-r?{x:z(e-d)<bn?t:h,y:d}:z(r-h)<bn&&bn<i-p?{x:h,y:z(t-h)<bn?e:p}:z(i-p)<bn&&bn<r-f?{x:z(e-p)<bn?t:f,y:p}:null,M=void 0,M=new ki(y,null),M.a=m,M.b=x,ui.push(M),M),o.site,null)),++l);var y,m,x,M}(t));var u={cells:ai,edges:ui};return li=si=ui=ai=null,u}function qi(n,t){return t.y-n.y||t.x-n.x}xi.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)(n=t[e].edge).b&&n.a||t.splice(e,1);return t.sort(Mi),t.length},Ni.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Si.prototype={insert:function(n,t){var e,r,i;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=Ti(this._),t.P=null,(t.N=n).P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.R&&(Li(this,e),e=(n=e).U),e.C=!1,r.C=!0,Fi(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.L&&(Fi(this,e),e=(n=e).U),e.C=!1,r.C=!0,Li(this,r)),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,i=n.U,o=n.L,u=n.R;if(e=o?u?Ti(u):o:u,i?i.L===n?i.L=e:i.R=e:this._=e,o&&u?(r=e.C,e.C=n.C,((e.L=o).U=e)!==u?(i=e.U,e.U=n.U,n=e.R,i.L=n,(e.R=u).U=e):(e.U=i,n=(i=e).R)):(r=n.C,n=e),n&&(n.U=i),!r)if(n&&n.C)n.C=!1;else{do{if(n===this._)break;if(n===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,Li(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Fi(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,Li(this,i),n=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,Fi(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Li(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,Fi(this,i),n=this._;break}t.C=!0,i=(n=i).U}while(!n.C);n&&(n.C=!1)}}},q.geom.voronoi=function(n){var t=Kr,e=Qr,r=t,i=e,s=Di;if(n)return o(n);function o(i){var o=new Array(i.length),u=s[0][0],a=s[0][1],l=s[1][0],c=s[1][1];return zi(f(i),s).cells.forEach(function(n,t){var e=n.edges,r=n.site;(o[t]=e.length?e.map(function(n){var t=n.start();return[t.x,t.y]}):r.x>=u&&r.x<=l&&r.y>=a&&r.y<=c?[[u,c],[l,c],[l,a],[u,a]]:[]).point=i[t]}),o}function f(n){return n.map(function(n,t){return{x:Math.round(r(n,t)/bn)*bn,y:Math.round(i(n,t)/bn)*bn,i:t}})}return o.links=function(t){return zi(f(t)).edges.filter(function(n){return n.l&&n.r}).map(function(n){return{source:t[n.l.i],target:t[n.r.i]}})},o.triangles=function(h){var p=[];return zi(f(h)).cells.forEach(function(n,t){for(var e,r,i,o,u=n.site,a=n.edges.sort(Mi),l=-1,c=a.length,s=a[c-1].edge,f=s.l===u?s.r:s.l;++l<c;)s,e=f,f=(s=a[l].edge).l===u?s.r:s.l,t<e.i&&t<f.i&&(i=e,o=f,((r=u).x-o.x)*(i.y-r.y)-(r.x-i.x)*(o.y-r.y)<0)&&p.push([h[t],h[e.i],h[f.i]])}),p},o.x=function(n){return arguments.length?(r=vt(t=n),o):t},o.y=function(n){return arguments.length?(i=vt(e=n),o):e},o.clipExtent=function(n){return arguments.length?(s=null==n?Di:n,o):s===Di?null:s},o.size=function(n){return arguments.length?o.clipExtent(n&&[[0,0],n]):s===Di?null:s&&s[1]},o};var Di=[[-1e6,-1e6],[1e6,1e6]];function Ri(n){return n.x}function ji(n){return n.y}function Pi(n,t){n=q.rgb(n),t=q.rgb(t);var e=n.r,r=n.g,i=n.b,o=t.r-e,u=t.g-r,a=t.b-i;return function(n){return"#"+ct(Math.round(e+o*n))+ct(Math.round(r+u*n))+ct(Math.round(i+a*n))}}function Oi(n,t){var e,r={},i={};for(e in n)e in t?r[e]=Zi(n[e],t[e]):i[e]=n[e];for(e in t)e in n||(i[e]=t[e]);return function(n){for(e in r)i[e]=r[e](n);return i}}function Ui(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Ii(n,r){var t,e,i,o=Hi.lastIndex=Yi.lastIndex=0,u=-1,a=[],l=[];for(n+="",r+="";(t=Hi.exec(n))&&(e=Yi.exec(r));)(i=e.index)>o&&(i=r.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(t=t[0])===(e=e[0])?a[u]?a[u]+=e:a[++u]=e:(a[++u]=null,l.push({i:u,x:Ui(t,e)})),o=Yi.lastIndex;return o<r.length&&(i=r.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?l[0]?(r=l[0].x,function(n){return r(n)+""}):function(){return r}:(r=l.length,function(n){for(var t,e=0;e<r;++e)a[(t=l[e]).i]=t.x(n);return a.join("")})}q.geom.delaunay=function(n){return q.geom.voronoi().triangles(n)},q.geom.quadtree=function(n,m,x,M,_){var w,b=Kr,C=Qr;if(w=arguments.length)return b=Ri,C=ji,3===w&&(_=x,M=m,x=m=0),t(n);function t(n){var t,e,r,i,o,u,a,l,c,s=vt(b),f=vt(C);if(null!=m)u=m,a=x,l=M,c=_;else if(l=c=-(u=a=1/0),e=[],r=[],o=n.length,w)for(i=0;i<o;++i)(t=n[i]).x<u&&(u=t.x),t.y<a&&(a=t.y),t.x>l&&(l=t.x),t.y>c&&(c=t.y),e.push(t.x),r.push(t.y);else for(i=0;i<o;++i){var h=+s(t=n[i],i),p=+f(t,i);h<u&&(u=h),p<a&&(a=p),l<h&&(l=h),c<p&&(c=p),e.push(h),r.push(p)}var d=l-u,g=c-a;function v(n,t,e,r,i,o,u,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var l=n.x,c=n.y;if(null!=l)if(z(l-e)+z(c-r)<.01)y(n,t,e,r,i,o,u,a);else{var s=n.point;n.x=n.y=n.point=null,y(n,s,l,c,i,o,u,a),y(n,t,e,r,i,o,u,a)}else n.x=e,n.y=r,n.point=t}else y(n,t,e,r,i,o,u,a)}function y(n,t,e,r,i,o,u,a){var l=.5*(i+u),c=.5*(o+a),s=l<=e,f=c<=r,h=f<<1|s;n.leaf=!1,s?i=l:u=l,f?o=c:a=c,v(n=n.nodes[h]||(n.nodes[h]={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(n){v(k,n,+s(n,++i),+f(n,i),u,a,l,c)}}),t,e,r,i,o,u,a)}g<d?c=a+d:l=u+g;var k={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(n){v(k,n,+s(n,++i),+f(n,i),u,a,l,c)}};if(k.visit=function(n){!function n(t,e,r,i,o,u){if(!t(e,r,i,o,u)){var a=.5*(r+o),l=.5*(i+u),c=e.nodes;c[0]&&n(t,c[0],r,i,a,l),c[1]&&n(t,c[1],a,i,o,l),c[2]&&n(t,c[2],r,l,a,u),c[3]&&n(t,c[3],a,l,o,u)}}(n,k,u,a,l,c)},k.find=function(n){return t=k,v=n[0],y=n[1],b=1/0,function n(t,e,r,i,o){if(!(M<e||_<r||i<m||o<x)){if(u=t.point){var u,a=v-t.x,l=y-t.y,c=a*a+l*l;if(c<b){var s=Math.sqrt(b=c);m=v-s,x=y-s,M=v+s,_=y+s,w=u}}for(var f=t.nodes,h=.5*(e+i),p=.5*(r+o),d=(p<=y)<<1|h<=v,g=d+4;d<g;++d)if(t=f[3&d])switch(3&d){case 0:n(t,e,r,h,p);break;case 1:n(t,h,r,i,p);break;case 2:n(t,e,p,h,o);break;case 3:n(t,h,p,i,o)}}}(t,m=u,x=a,M=l,_=c),w;var t,v,y,m,x,M,_,w,b},i=-1,null==m){for(;++i<o;)v(k,n[i],e[i],r[i],u,a,l,c);--i}else n.forEach(k.add);return e=r=n=t=null,k}return t.x=function(n){return arguments.length?(b=n,t):b},t.y=function(n){return arguments.length?(C=n,t):C},t.extent=function(n){return arguments.length?(null==n?m=x=M=_=null:(m=+n[0][0],x=+n[0][1],M=+n[1][0],_=+n[1][1]),t):null==m?null:[[m,x],[M,_]]},t.size=function(n){return arguments.length?(null==n?m=x=M=_=null:(m=x=0,M=+n[0],_=+n[1]),t):null==m?null:[M-m,_-x]},t},q.interpolateRgb=Pi,q.interpolateObject=Oi,q.interpolateNumber=Ui,q.interpolateString=Ii;var Hi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yi=new RegExp(Hi.source,"g");function Zi(n,t){for(var e,r=q.interpolators.length;0<=--r&&!(e=q.interpolators[r](n,t)););return e}function Vi(n,t){var e,r=[],i=[],o=n.length,u=t.length,a=Math.min(n.length,t.length);for(e=0;e<a;++e)r.push(Zi(n[e],t[e]));for(;e<o;++e)i[e]=n[e];for(;e<u;++e)i[e]=t[e];return function(n){for(e=0;e<a;++e)i[e]=r[e](n);return i}}q.interpolate=Zi,q.interpolators=[function(n,t){var e=typeof t;return("string"===e?gt.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?Pi:Ii:t instanceof In?Pi:Array.isArray(t)?Vi:"object"===e&&isNaN(t)?Oi:Ui)(n,t)}],q.interpolateArray=Vi;var $i=function(){return R},Bi=q.map({linear:$i,poly:function(t){return function(n){return Math.pow(n,t)}},quad:function(){return Gi},cubic:function(){return Ki},sin:function(){return no},exp:function(){return to},circle:function(){return eo},elastic:function(t,e){var r;arguments.length<2&&(e=.45);arguments.length?r=e/En*Math.asin(1/t):(t=1,r=e/4);return function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*En/e)}},back:function(t){t||(t=1.70158);return function(n){return n*n*((t+1)*n-t)}},bounce:function(){return ro}}),Xi=q.map({in:R,out:Wi,"in-out":Ji,"out-in":function(n){return Ji(Wi(n))}});function Wi(t){return function(n){return 1-t(1-n)}}function Ji(t){return function(n){return.5*(n<.5?t(2*n):2-t(2-2*n))}}function Gi(n){return n*n}function Ki(n){return n*n*n}function Qi(n){if(n<=0)return 0;if(1<=n)return 1;var t=n*n,e=t*n;return 4*(n<.5?e:3*(n-t)+e-.75)}function no(n){return 1-Math.cos(n*Sn)}function to(n){return Math.pow(2,10*(n-1))}function eo(n){return 1-Math.sqrt(1-n*n)}function ro(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function io(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function oo(n){var t,e,r,i=[n.a,n.b],o=[n.c,n.d],u=ao(i),a=uo(i,o),l=ao(((t=o)[0]+=(r=-a)*(e=i)[0],t[1]+=r*e[1],t))||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]))*Ln,this.translate=[n.e,n.f],this.scale=[u,l],this.skew=l?Math.atan2(a,l)*Ln:0}function uo(n,t){return n[0]*t[0]+n[1]*t[1]}function ao(n){var t=Math.sqrt(uo(n,n));return t&&(n[0]/=t,n[1]/=t),t}q.ease=function(n){var t,e=n.indexOf("-"),r=0<=e?n.slice(0,e):n,i=0<=e?n.slice(e+1):"in";return r=Bi.get(r)||$i,i=Xi.get(i)||R,t=i(r.apply(null,o.call(arguments,1))),function(n){return n<=0?0:1<=n?1:t(n)}},q.interpolateHcl=function(n,t){n=q.hcl(n),t=q.hcl(t);var e=n.h,r=n.c,i=n.l,o=t.h-e,u=t.c-r,a=t.l-i;isNaN(u)&&(u=0,r=isNaN(r)?t.c:r);isNaN(o)?(o=0,e=isNaN(e)?t.h:e):180<o?o-=360:o<-180&&(o+=360);return function(n){return Bn(e+o*n,r+u*n,i+a*n)+""}},q.interpolateHsl=function(n,t){n=q.hsl(n),t=q.hsl(t);var e=n.h,r=n.s,i=n.l,o=t.h-e,u=t.s-r,a=t.l-i;isNaN(u)&&(u=0,r=isNaN(r)?t.s:r);isNaN(o)?(o=0,e=isNaN(e)?t.h:e):180<o?o-=360:o<-180&&(o+=360);return function(n){return Zn(e+o*n,r+u*n,i+a*n)+""}},q.interpolateLab=function(n,t){n=q.lab(n),t=q.lab(t);var e=n.l,r=n.a,i=n.b,o=t.l-e,u=t.a-r,a=t.b-i;return function(n){return nt(e+o*n,r+u*n,i+a*n)+""}},q.interpolateRound=io,q.transform=function(n){var e=x.createElementNS(q.ns.prefix.svg,"g");return(q.transform=function(n){if(null!=n){e.setAttribute("transform",n);var t=e.transform.baseVal.consolidate()}return new oo(t?t.matrix:lo)})(n)},oo.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var lo={a:1,b:0,c:0,d:1,e:0,f:0};function co(n){return n.length?n.pop()+",":""}function so(n,t){var e,r,i,o,u,a,l,c,s=[],f=[];return n=q.transform(n),t=q.transform(t),function(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push("translate(",null,",",null,")");r.push({i:i-4,x:Ui(n[0],t[0])},{i:i-2,x:Ui(n[1],t[1])})}else(t[0]||t[1])&&e.push("translate("+t+")")}(n.translate,t.translate,s,f),e=n.rotate,r=t.rotate,i=s,o=f,e!==r?(180<e-r?r+=360:180<r-e&&(e+=360),o.push({i:i.push(co(i)+"rotate(",null,")")-2,x:Ui(e,r)})):r&&i.push(co(i)+"rotate("+r+")"),u=n.skew,a=t.skew,l=s,c=f,u!==a?c.push({i:l.push(co(l)+"skewX(",null,")")-2,x:Ui(u,a)}):a&&l.push(co(l)+"skewX("+a+")"),function(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push(co(e)+"scale(",null,",",null,")");r.push({i:i-4,x:Ui(n[0],t[0])},{i:i-2,x:Ui(n[1],t[1])})}else 1===t[0]&&1===t[1]||e.push(co(e)+"scale("+t+")")}(n.scale,t.scale,s,f),n=t=null,function(n){for(var t,e=-1,r=f.length;++e<r;)s[(t=f[e]).i]=t.x(n);return s.join("")}}function fo(t,e){return e=(e-=t=+t)||1/e,function(n){return(n-t)/e}}function ho(t,e){return e=(e-=t=+t)||1/e,function(n){return Math.max(0,Math.min(1,(n-t)/e))}}function po(n){for(var t=n.source,e=n.target,r=function(n,t){if(n===t)return n;var e=go(n),r=go(t),i=e.pop(),o=r.pop(),u=null;for(;i===o;)u=i,i=e.pop(),o=r.pop();return u}(t,e),i=[t];t!==r;)t=t.parent,i.push(t);for(var o=i.length;e!==r;)i.splice(o,0,e),e=e.parent;return i}function go(n){for(var t=[],e=n.parent;null!=e;)t.push(n),e=(n=e).parent;return t.push(n),t}function vo(n){n.fixed|=2}function yo(n){n.fixed&=-7}function mo(n){n.fixed|=4,n.px=n.x,n.py=n.y}function xo(n){n.fixed&=-5}q.interpolateTransform=so,q.layout={},q.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(po(n[e]));return t}},q.layout.chord=function(){var v,y,m,x,M,_,w,t={},b=0;function n(){var n,t,e,r,i,o={},u=[],a=q.range(x),l=[];for(v=[],y=[],n=0,r=-1;++r<x;){for(t=0,i=-1;++i<x;)t+=m[r][i];u.push(t),l.push(q.range(x)),n+=t}for(M&&a.sort(function(n,t){return M(u[n],u[t])}),_&&l.forEach(function(n,e){n.sort(function(n,t){return _(m[e][n],m[e][t])})}),n=(En-b*x)/n,t=0,r=-1;++r<x;){for(e=t,i=-1;++i<x;){var c=a[r],s=l[c][i],f=m[c][s],h=t,p=t+=f*n;o[c+"-"+s]={index:c,subindex:s,startAngle:h,endAngle:p,value:f}}y[c]={index:c,startAngle:e,endAngle:t,value:u[c]},t+=b}for(r=-1;++r<x;)for(i=r-1;++i<x;){var d=o[r+"-"+i],g=o[i+"-"+r];(d.value||g.value)&&v.push(d.value<g.value?{source:g,target:d}:{source:d,target:g})}w&&k()}function k(){v.sort(function(n,t){return w((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}return t.matrix=function(n){return arguments.length?(x=(m=n)&&m.length,v=y=null,t):m},t.padding=function(n){return arguments.length?(b=n,v=y=null,t):b},t.sortGroups=function(n){return arguments.length?(M=n,v=y=null,t):M},t.sortSubgroups=function(n){return arguments.length?(_=n,v=null,t):_},t.sortChords=function(n){return arguments.length?(w=n,v&&k(),t):w},t.chords=function(){return v||n(),v},t.groups=function(){return y||n(),y},t},q.layout.force=function(){var f,n,h,p,d,g,i={},v=q.dispatch("start","tick","end"),y=[1,1],m=.9,o=Mo,u=_o,x=-30,s=wo,M=.1,_=.64,w=[],b=[];function k(c){return function(n,t,e,r){if(n.point!==c){var i=n.cx-c.x,o=n.cy-c.y,u=r-t,a=i*i+o*o;if(u*u/_<a){if(a<s){var l=n.charge/a;c.px-=i*l,c.py-=o*l}return!0}if(n.point&&a&&a<s){l=n.pointCharge/a;c.px-=i*l,c.py-=o*l}}return!n.charge}}function t(n){n.px=q.event.x,n.py=q.event.y,i.resume()}return i.tick=function(){if((h*=.99)<.005)return f=null,v.end({type:"end",alpha:h=0}),!0;var n,t,e,r,i,o,u,a,l,c=w.length,s=b.length;for(t=0;t<s;++t)r=(e=b[t]).source,(o=(a=(i=e.target).x-r.x)*a+(l=i.y-r.y)*l)&&(a*=o=h*d[t]*((o=Math.sqrt(o))-p[t])/o,l*=o,i.x-=a*(u=r.weight+i.weight?r.weight/(r.weight+i.weight):.5),i.y-=l*u,r.x+=a*(u=1-u),r.y+=l*u);if((u=h*M)&&(a=y[0]/2,l=y[1]/2,t=-1,u))for(;++t<c;)(e=w[t]).x+=(a-e.x)*u,e.y+=(l-e.y)*u;if(x)for(!function n(t,e,r){var i=0,o=0;t.charge=0;if(!t.leaf)for(var u,a=t.nodes,l=a.length,c=-1;++c<l;)null!=(u=a[c])&&(n(u,e,r),t.charge+=u.charge,i+=u.charge*u.cx,o+=u.charge*u.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var s=e*r[t.point.index];t.charge+=t.pointCharge=s,i+=s*t.point.x,o+=s*t.point.y}t.cx=i/t.charge;t.cy=o/t.charge}(n=q.geom.quadtree(w),h,g),t=-1;++t<c;)(e=w[t]).fixed||n.visit(k(e));for(t=-1;++t<c;)(e=w[t]).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);v.tick({type:"tick",alpha:h})},i.nodes=function(n){return arguments.length?(w=n,i):w},i.links=function(n){return arguments.length?(b=n,i):b},i.size=function(n){return arguments.length?(y=n,i):y},i.linkDistance=function(n){return arguments.length?(o="function"==typeof n?n:+n,i):o},i.distance=i.linkDistance,i.linkStrength=function(n){return arguments.length?(u="function"==typeof n?n:+n,i):u},i.friction=function(n){return arguments.length?(m=+n,i):m},i.charge=function(n){return arguments.length?(x="function"==typeof n?n:+n,i):x},i.chargeDistance=function(n){return arguments.length?(s=n*n,i):Math.sqrt(s)},i.gravity=function(n){return arguments.length?(M=+n,i):M},i.theta=function(n){return arguments.length?(_=n*n,i):Math.sqrt(_)},i.alpha=function(n){return arguments.length?(n=+n,h?0<n?h=n:(f.c=null,f.t=NaN,f=null,v.end({type:"end",alpha:h=0})):0<n&&(v.start({type:"start",alpha:h=n}),f=kt(i.tick)),i):h},i.start=function(){var a,l,n,c=w.length,s=b.length,t=y[0],e=y[1];for(a=0;a<c;++a)(n=w[a]).index=a,n.weight=0;for(a=0;a<s;++a)"number"==typeof(n=b[a]).source&&(n.source=w[n.source]),"number"==typeof n.target&&(n.target=w[n.target]),++n.source.weight,++n.target.weight;for(a=0;a<c;++a)n=w[a],isNaN(n.x)&&(n.x=r("x",t)),isNaN(n.y)&&(n.y=r("y",e)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(p=[],"function"==typeof o)for(a=0;a<s;++a)p[a]=+o.call(this,b[a],a);else for(a=0;a<s;++a)p[a]=o;if(d=[],"function"==typeof u)for(a=0;a<s;++a)d[a]=+u.call(this,b[a],a);else for(a=0;a<s;++a)d[a]=u;if(g=[],"function"==typeof x)for(a=0;a<c;++a)g[a]=+x.call(this,w[a],a);else for(a=0;a<c;++a)g[a]=x;function r(n,t){if(!l){for(l=new Array(c),o=0;o<c;++o)l[o]=[];for(o=0;o<s;++o){var e=b[o];l[e.source.index].push(e.target),l[e.target.index].push(e.source)}}for(var r,i=l[a],o=-1,u=i.length;++o<u;)if(!isNaN(r=i[o][n]))return r;return Math.random()*t}return i.resume()},i.resume=function(){return i.alpha(.1)},i.stop=function(){return i.alpha(0)},i.drag=function(){if(n||(n=q.behavior.drag().origin(R).on("dragstart.force",vo).on("drag.force",t).on("dragend.force",yo)),!arguments.length)return n;this.on("mouseover.force",mo).on("mouseout.force",xo).call(n)},q.rebind(i,v,"on")};var Mo=20,_o=1,wo=1/0;function bo(n,t){return q.rebind(n,t,"sort","children","value"),(n.nodes=n).links=Ao,n}function ko(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(i=n.children)&&(r=i.length))for(var r,i;0<=--r;)e.push(i[r])}function Co(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(o=n.children)&&(i=o.length))for(var i,o,u=-1;++u<i;)e.push(o[u]);for(;null!=(n=r.pop());)t(n)}function Eo(n){return n.children}function No(n){return n.value}function So(n,t){return t.value-n.value}function Ao(n){return q.merge(n.map(function(t){return(t.children||[]).map(function(n){return{source:t,target:n}})}))}q.layout.hierarchy=function(){var a=So,l=Eo,c=No;function s(n){var t,e=[n],r=[];for(n.depth=0;null!=(t=e.pop());)if(r.push(t),(o=l.call(s,t,t.depth))&&(i=o.length)){for(var i,o,u;0<=--i;)e.push(u=o[i]),u.parent=t,u.depth=t.depth+1;c&&(t.value=0),t.children=o}else c&&(t.value=+c.call(s,t,t.depth)||0),delete t.children;return Co(n,function(n){var t,e;a&&(t=n.children)&&t.sort(a),c&&(e=n.parent)&&(e.value+=n.value)}),r}return s.sort=function(n){return arguments.length?(a=n,s):a},s.children=function(n){return arguments.length?(l=n,s):l},s.value=function(n){return arguments.length?(c=n,s):c},s.revalue=function(n){return c&&(ko(n,function(n){n.children&&(n.value=0)}),Co(n,function(n){var t;n.children||(n.value=+c.call(s,n,n.depth)||0),(t=n.parent)&&(t.value+=n.value)})),n},s},q.layout.partition=function(){var r=q.layout.hierarchy(),i=[1,1];function t(n,t){var e=r.call(this,n,t);return function n(t,e,r,i){var o=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,o&&(u=o.length)){var u,a,l,c=-1;for(r=t.value?r/t.value:0;++c<u;)n(a=o[c],e,l=a.value*r,i),e+=l}}(e[0],0,i[0],i[1]/function n(t){var e=t.children,r=0;if(e&&(i=e.length))for(var i,o=-1;++o<i;)r=Math.max(r,n(e[o]));return 1+r}(e[0])),e}return t.size=function(n){return arguments.length?(i=n,t):i},bo(t,r)},q.layout.pie=function(){var h=Number,p=Lo,d=0,g=En,v=0;function y(e){var t,n=e.length,r=e.map(function(n,t){return+h.call(y,n,t)}),i=+("function"==typeof d?d.apply(this,arguments):d),o=("function"==typeof g?g.apply(this,arguments):g)-i,u=Math.min(Math.abs(o)/n,+("function"==typeof v?v.apply(this,arguments):v)),a=u*(o<0?-1:1),l=q.sum(r),c=l?(o-n*a)/l:0,s=q.range(n),f=[];return null!=p&&s.sort(p===Lo?function(n,t){return r[t]-r[n]}:function(n,t){return p(e[n],e[t])}),s.forEach(function(n){f[n]={data:e[n],value:t=r[n],startAngle:i,endAngle:i+=t*c+a,padAngle:u}}),f}return y.value=function(n){return arguments.length?(h=n,y):h},y.sort=function(n){return arguments.length?(p=n,y):p},y.startAngle=function(n){return arguments.length?(d=n,y):d},y.endAngle=function(n){return arguments.length?(g=n,y):g},y.padAngle=function(n){return arguments.length?(v=n,y):v},y};var Lo={};function Fo(n){return n.x}function To(n){return n.y}function zo(n,t,e){n.y0=t,n.y=e}q.layout.stack=function(){var f=R,h=Ro,p=jo,d=zo,g=Fo,v=To;function y(n,t){if(!(o=n.length))return n;var e=n.map(function(n,t){return f.call(y,n,t)}),r=e.map(function(n){return n.map(function(n,t){return[g.call(y,n,t),v.call(y,n,t)]})}),i=h.call(y,r,t);e=q.permute(e,i),r=q.permute(r,i);var o,u,a,l,c=p.call(y,r,t),s=e[0].length;for(a=0;a<s;++a)for(d.call(y,e[0][a],l=c[a],r[0][a][1]),u=1;u<o;++u)d.call(y,e[u][a],l+=r[u-1][a][1],r[u][a][1]);return n}return y.values=function(n){return arguments.length?(f=n,y):f},y.order=function(n){return arguments.length?(h="function"==typeof n?n:qo.get(n)||Ro,y):h},y.offset=function(n){return arguments.length?(p="function"==typeof n?n:Do.get(n)||jo,y):p},y.x=function(n){return arguments.length?(g=n,y):g},y.y=function(n){return arguments.length?(v=n,y):v},y.out=function(n){return arguments.length?(d=n,y):d},y};var qo=q.map({"inside-out":function(n){var t,e,r=n.length,i=n.map(Po),o=n.map(Oo),u=q.range(r).sort(function(n,t){return i[n]-i[t]}),a=0,l=0,c=[],s=[];for(t=0;t<r;++t)e=u[t],a<l?(a+=o[e],c.push(e)):(l+=o[e],s.push(e));return s.reverse().concat(c)},reverse:function(n){return q.range(n.length).reverse()},default:Ro}),Do=q.map({silhouette:function(n){var t,e,r,i=n.length,o=n[0].length,u=[],a=0,l=[];for(e=0;e<o;++e){for(r=t=0;t<i;t++)r+=n[t][e][1];a<r&&(a=r),u.push(r)}for(e=0;e<o;++e)l[e]=(a-u[e])/2;return l},wiggle:function(n){var t,e,r,i,o,u,a,l,c,s=n.length,f=n[0],h=f.length,p=[];for(p[0]=l=c=0,e=1;e<h;++e){for(i=t=0;t<s;++t)i+=n[t][e][1];for(o=t=0,a=f[e][0]-f[e-1][0];t<s;++t){for(r=0,u=(n[t][e][1]-n[t][e-1][1])/(2*a);r<t;++r)u+=(n[r][e][1]-n[r][e-1][1])/a;o+=u*n[t][e][1]}p[e]=l-=i?o/i*a:0,l<c&&(c=l)}for(e=0;e<h;++e)p[e]-=c;return p},expand:function(n){var t,e,r,i=n.length,o=n[0].length,u=1/i,a=[];for(e=0;e<o;++e){for(r=t=0;t<i;t++)r+=n[t][e][1];if(r)for(t=0;t<i;t++)n[t][e][1]/=r;else for(t=0;t<i;t++)n[t][e][1]=u}for(e=0;e<o;++e)a[e]=0;return a},zero:jo});function Ro(n){return q.range(n.length)}function jo(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function Po(n){for(var t,e=1,r=0,i=n[0][1],o=n.length;e<o;++e)(t=n[e][1])>i&&(r=e,i=t);return r}function Oo(n){return n.reduce(Uo,0)}function Uo(n,t){return n+t[1]}function Io(n,t){return Ho(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Ho(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,o=[];++e<=t;)o[e]=i*e+r;return o}function Yo(n){return[q.min(n),q.max(n)]}function Zo(n,t){return n.value-t.value}function Vo(n,t){var e=n._pack_next;(n._pack_next=t)._pack_prev=n,(t._pack_next=e)._pack_prev=t}function $o(n,t){(n._pack_next=t)._pack_prev=n}function Bo(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return e*e+r*r<.999*i*i}function Xo(n){if((t=n.children)&&(l=t.length)){var t,e,r,i,o,u,a,l,c=1/0,s=-1/0,f=1/0,h=-1/0;if(t.forEach(Wo),(e=t[0]).x=-e.r,e.y=0,x(e),1<l&&((r=t[1]).x=r.r,r.y=0,x(r),2<l))for(Go(e,r,i=t[2]),x(i),Vo(e,i),Vo(e._pack_prev=i,r),r=e._pack_next,o=3;o<l;o++){Go(e,r,i=t[o]);var p=0,d=1,g=1;for(u=r._pack_next;u!==r;u=u._pack_next,d++)if(Bo(u,i)){p=1;break}if(1==p)for(a=e._pack_prev;a!==u._pack_prev&&!Bo(a,i);a=a._pack_prev,g++);p?(d<g||d==g&&r.r<e.r?$o(e,r=u):$o(e=a,r),o--):(Vo(e,i),x(r=i))}var v=(c+s)/2,y=(f+h)/2,m=0;for(o=0;o<l;o++)(i=t[o]).x-=v,i.y-=y,m=Math.max(m,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=m,t.forEach(Jo)}function x(n){c=Math.min(n.x-n.r,c),s=Math.max(n.x+n.r,s),f=Math.min(n.y-n.r,f),h=Math.max(n.y+n.r,h)}}function Wo(n){n._pack_next=n._pack_prev=n}function Jo(n){delete n._pack_next,delete n._pack_prev}function Go(n,t,e){var r=n.r+e.r,i=t.x-n.x,o=t.y-n.y;if(r&&(i||o)){var u=t.r+e.r,a=i*i+o*o,l=.5+((r*=r)-(u*=u))/(2*a),c=Math.sqrt(Math.max(0,2*u*(r+a)-(r-=a)*r-u*u))/(2*a);e.x=n.x+l*i+c*o,e.y=n.y+l*o-c*i}else e.x=n.x+r,e.y=n.y}function Ko(n,t){return n.parent==t.parent?1:2}function Qo(n){var t=n.children;return t.length?t[0]:n.t}function nu(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function tu(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function eu(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function ru(n,t){var e=n.x+t[3],r=n.y+t[0],i=n.dx-t[1]-t[3],o=n.dy-t[0]-t[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 iu(n){var t=n[0],e=n[n.length-1];return t<e?[t,e]:[e,t]}function ou(n){return n.rangeExtent?n.rangeExtent():iu(n.range())}function uu(n,t,e,r){var i=e(n[0],n[1]),o=r(t[0],t[1]);return function(n){return o(i(n))}}function au(n,t){var e,r=0,i=n.length-1,o=n[r],u=n[i];return u<o&&(e=r,r=i,i=e,e=o,o=u,u=e),n[r]=t.floor(o),n[i]=t.ceil(u),n}function lu(t){return t?{floor:function(n){return Math.floor(n/t)*t},ceil:function(n){return Math.ceil(n/t)*t}}:cu}q.layout.histogram=function(){var f=!0,h=Number,p=Yo,d=Io;function e(n,t){for(var e,r,i=[],o=n.map(h,this),u=p.call(this,o,t),a=d.call(this,u,o,t),l=(t=-1,o.length),c=a.length-1,s=f?1:1/l;++t<c;)(e=i[t]=[]).dx=a[t+1]-(e.x=a[t]),e.y=0;if(0<c)for(t=-1;++t<l;)(r=o[t])>=u[0]&&r<=u[1]&&((e=i[q.bisect(a,r,1,c)-1]).y+=s,e.push(n[t]));return i}return e.value=function(n){return arguments.length?(h=n,e):h},e.range=function(n){return arguments.length?(p=vt(n),e):p},e.bins=function(t){return arguments.length?(d="number"==typeof t?function(n){return Ho(n,t)}:vt(t),e):d},e.frequency=function(n){return arguments.length?(f=!!n,e):f},e},q.layout.pack=function(){var l,c=q.layout.hierarchy().sort(Zo),s=0,f=[1,1];function t(n,t){var e=c.call(this,n,t),r=e[0],i=f[0],o=f[1],u=null==l?Math.sqrt:"function"==typeof l?l:function(){return l};if(r.x=r.y=0,Co(r,function(n){n.r=+u(n.value)}),Co(r,Xo),s){var a=s*(l?1:Math.max(2*r.r/i,2*r.r/o))/2;Co(r,function(n){n.r+=a}),Co(r,Xo),Co(r,function(n){n.r-=a})}return function n(t,e,r,i){var o=t.children;t.x=e+=i*t.x;t.y=r+=i*t.y;t.r*=i;if(o)for(var u=-1,a=o.length;++u<a;)n(o[u],e,r,i)}(r,i/2,o/2,l?1:1/Math.max(2*r.r/i,2*r.r/o)),e}return t.size=function(n){return arguments.length?(f=n,t):f},t.radius=function(n){return arguments.length?(l=null==n||"function"==typeof n?n:+n,t):l},t.padding=function(n){return arguments.length?(s=+n,t):s},bo(t,c)},q.layout.tree=function(){var f=q.layout.hierarchy().sort(null).value(null),g=Ko,h=[1,1],p=null;function t(n,t){var e=f.call(this,n,t),r=e[0],i=function(n){var t,e={A:null,children:[n]},r=[e];for(;null!=(t=r.pop());)for(var i,o=t.children,u=0,a=o.length;u<a;++u)r.push((o[u]=i={_:o[u],parent:t,children:(i=o[u].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:u}).a=i);return e.children[0]}(r);if(Co(i,d),i.parent.m=-i.z,ko(i,v),p)ko(r,y);else{var o=r,u=r,a=r;ko(r,function(n){n.x<o.x&&(o=n),n.x>u.x&&(u=n),n.depth>a.depth&&(a=n)});var l=g(o,u)/2-o.x,c=h[0]/(u.x+g(u,o)/2+l),s=h[1]/(a.depth||1);ko(r,function(n){n.x=(n.x+l)*c,n.y=n.depth*s})}return e}function d(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){!function(n){var t,e=0,r=0,i=n.children,o=i.length;for(;0<=--o;)(t=i[o]).z+=e,t.m+=e,e+=t.s+(r+=t.c)}(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+g(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+g(n._,r._));n.parent.A=function(n,t,e){if(t){for(var r,i=n,o=n,u=t,a=i.parent.children[0],l=i.m,c=o.m,s=u.m,f=a.m;u=nu(u),i=Qo(i),u&&i;)a=Qo(a),(o=nu(o)).a=n,0<(r=u.z+s-i.z-l+g(u._,i._))&&(tu((p=n,d=e,(h=u).a.parent===p.parent?h.a:d),n,r),l+=r,c+=r),s+=u.m,l+=i.m,f+=a.m,c+=o.m;u&&!nu(o)&&(o.t=u,o.m+=s-c),i&&!Qo(a)&&(a.t=i,a.m+=l-f,e=n)}var h,p,d;return e}(n,r,n.parent.A||e[0])}function v(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function y(n){n.x*=h[0],n.y=n.depth*h[1]}return t.separation=function(n){return arguments.length?(g=n,t):g},t.size=function(n){return arguments.length?(p=null==(h=n)?y:null,t):p?null:h},t.nodeSize=function(n){return arguments.length?(p=null==(h=n)?null:y,t):p?h:null},bo(t,f)},q.layout.cluster=function(){var s=q.layout.hierarchy().sort(null).value(null),f=Ko,h=[1,1],p=!1;function t(n,t){var i,e=s.call(this,n,t),r=e[0],o=0;Co(r,function(n){var t,e,r=n.children;r&&r.length?(n.x=(e=r).reduce(function(n,t){return n+t.x},0)/e.length,n.y=(t=r,1+q.max(t,function(n){return n.y}))):(n.x=i?o+=f(n,i):0,n.y=0,i=n)});var u=function n(t){var e=t.children;return e&&e.length?n(e[0]):t}(r),a=function n(t){var e,r=t.children;return r&&(e=r.length)?n(r[e-1]):t}(r),l=u.x-f(u,a)/2,c=a.x+f(a,u)/2;return Co(r,p?function(n){n.x=(n.x-r.x)*h[0],n.y=(r.y-n.y)*h[1]}:function(n){n.x=(n.x-l)/(c-l)*h[0],n.y=(1-(r.y?n.y/r.y:1))*h[1]}),e}return t.separation=function(n){return arguments.length?(f=n,t):f},t.size=function(n){return arguments.length?(p=null==(h=n),t):p?null:h},t.nodeSize=function(n){return arguments.length?(p=null!=(h=n),t):p?h:null},bo(t,s)},q.layout.treemap=function(){var r,i=q.layout.hierarchy(),s=Math.round,o=[1,1],u=null,f=eu,a=!1,h="squarify",l=.5*(1+Math.sqrt(5));function p(n,t){for(var e,r,i=-1,o=n.length;++i<o;)r=(e=n[i]).value*(t<0?0:t),e.area=isNaN(r)||r<=0?0:r}function d(n){var t=n.children;if(t&&t.length){var e,r,i,o=f(n),u=[],a=t.slice(),l=1/0,c="slice"===h?o.dx:"dice"===h?o.dy:"slice-dice"===h?1&n.depth?o.dy:o.dx:Math.min(o.dx,o.dy);for(p(a,o.dx*o.dy/n.value),u.area=0;0<(i=a.length);)u.push(e=a[i-1]),u.area+=e.area,"squarify"!==h||(r=g(u,c))<=l?(a.pop(),l=r):(u.area-=u.pop().area,v(u,c,o,!1),c=Math.min(o.dx,o.dy),u.length=u.area=0,l=1/0);u.length&&(v(u,c,o,!0),u.length=u.area=0),t.forEach(d)}}function c(n){var t=n.children;if(t&&t.length){var e,r=f(n),i=t.slice(),o=[];for(p(i,r.dx*r.dy/n.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);t.forEach(c)}}function g(n,t){for(var e,r=n.area,i=0,o=1/0,u=-1,a=n.length;++u<a;)(e=n[u].area)&&(e<o&&(o=e),i<e&&(i=e));return t*=t,(r*=r)?Math.max(t*i*l/r,r/(t*o*l)):1/0}function v(n,t,e,r){var i,o=-1,u=n.length,a=e.x,l=e.y,c=t?s(n.area/t):0;if(t==e.dx){for((r||c>e.dy)&&(c=e.dy);++o<u;)(i=n[o]).x=a,i.y=l,i.dy=c,a+=i.dx=Math.min(e.x+e.dx-a,c?s(i.area/c):0);i.z=!0,i.dx+=e.x+e.dx-a,e.y+=c,e.dy-=c}else{for((r||c>e.dx)&&(c=e.dx);++o<u;)(i=n[o]).x=a,i.y=l,i.dx=c,l+=i.dy=Math.min(e.y+e.dy-l,c?s(i.area/c):0);i.z=!1,i.dy+=e.y+e.dy-l,e.x+=c,e.dx-=c}}function y(n){var t=r||i(n),e=t[0];return e.x=e.y=0,e.value?(e.dx=o[0],e.dy=o[1]):e.dx=e.dy=0,r&&i.revalue(e),p([e],e.dx*e.dy/e.value),(r?c:d)(e),a&&(r=t),t}return y.size=function(n){return arguments.length?(o=n,y):o},y.padding=function(e){if(!arguments.length)return u;function n(n){return ru(n,e)}var t;return f=null==(u=e)?eu:"function"==(t=typeof e)?function(n){var t=e.call(y,n,n.depth);return null==t?eu(n):ru(n,"number"==typeof t?[t,t,t,t]:t)}:("number"===t&&(e=[e,e,e,e]),n),y},y.round=function(n){return arguments.length?(s=n?Math.round:Number,y):s!=Number},y.sticky=function(n){return arguments.length?(a=n,r=null,y):a},y.ratio=function(n){return arguments.length?(l=n,y):l},y.mode=function(n){return arguments.length?(h=n+"",y):h},bo(y,i)},q.random={normal:function(r,i){var n=arguments.length;return n<2&&(i=1),n<1&&(r=0),function(){for(var n,t,e;!(e=(n=2*Math.random()-1)*n+(t=2*Math.random()-1)*t)||1<e;);return r+i*n*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(){var n=q.random.normal.apply(q,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=q.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(e){return function(){for(var n=0,t=0;t<e;t++)n+=Math.random();return n}}},q.scale={};var cu={floor:R,ceil:R};function su(e,n,t,r){var i=[],o=[],u=0,a=Math.min(e.length,n.length)-1;for(e[a]<e[0]&&(e=e.slice().reverse(),n=n.slice().reverse());++u<=a;)i.push(t(e[u-1],e[u])),o.push(r(n[u-1],n[u]));return function(n){var t=q.bisect(e,n,1,a)-1;return o[t](i[t](n))}}function fu(n,t){return q.rebind(n,t,"range","rangeRound","interpolate","clamp")}function hu(n,t){return au(n,lu(pu(n,t)[2])),au(n,lu(pu(n,t)[2])),n}function pu(n,t){null==t&&(t=10);var e=iu(n),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),o=t/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 du(n,t){return q.range.apply(q,pu(n,t))}function gu(n,t,e){var r,i,o,u=pu(n,t);if(e){var a=Lt.exec(e);if(a.shift(),"s"===a[8]){var l=q.formatPrefix(Math.max(z(u[0]),z(u[1])));return a[7]||(a[7]="."+yu(l.scale(u[2]))),a[8]="f",e=q.format(a.join("")),function(n){return e(l.scale(n))+l.symbol}}a[7]||(a[7]="."+(r=a[8],o=yu((i=u)[2]),r in vu?Math.abs(o-yu(Math.max(z(i[0]),z(i[1]))))+ +("e"!==r):o-2*("%"===r))),e=a.join("")}else e=",."+yu(u[2])+"f";return q.format(e)}q.scale.linear=function(){return function n(e,r,i,o){var u,a;function t(){var n=2<Math.min(e.length,r.length)?su:uu,t=o?ho:fo;return u=n(e,r,t,i),a=n(r,e,t,Zi),l}function l(n){return u(n)}l.invert=function(n){return a(n)};l.domain=function(n){return arguments.length?(e=n.map(Number),t()):e};l.range=function(n){return arguments.length?(r=n,t()):r};l.rangeRound=function(n){return l.range(n).interpolate(io)};l.clamp=function(n){return arguments.length?(o=n,t()):o};l.interpolate=function(n){return arguments.length?(i=n,t()):i};l.ticks=function(n){return du(e,n)};l.tickFormat=function(n,t){return gu(e,n,t)};l.nice=function(n){return hu(e,n),t()};l.copy=function(){return n(e,r,i,o)};return t()}([0,1],[0,1],Zi,!1)};var vu={s:1,g:1,p:1,r:1,e:1};function yu(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}q.scale.log=function(){return function n(t,l,c,s){function f(n){return(c?Math.log(n<0?0:n):-Math.log(0<n?0:-n))/Math.log(l)}function h(n){return c?Math.pow(l,n):-Math.pow(l,-n)}function i(n){return t(f(n))}i.invert=function(n){return h(t.invert(n))};i.domain=function(n){return arguments.length?(c=0<=n[0],t.domain((s=n.map(Number)).map(f)),i):s};i.base=function(n){return arguments.length?(l=+n,t.domain(s.map(f)),i):l};i.nice=function(){var n=au(s.map(f),c?Math:xu);return t.domain(n),s=n.map(h),i};i.ticks=function(){var n=iu(s),t=[],e=n[0],r=n[1],i=Math.floor(f(e)),o=Math.ceil(f(r)),u=l%1?2:l;if(isFinite(o-i)){if(c){for(;i<o;i++)for(var a=1;a<u;a++)t.push(h(i)*a);t.push(h(i))}else for(t.push(h(i));i++<o;)for(var a=u-1;0<a;a--)t.push(h(i)*a);for(i=0;t[i]<e;i++);for(o=t.length;t[o-1]>r;o--);t=t.slice(i,o)}return t};i.tickFormat=function(n,e){if(!arguments.length)return mu;arguments.length<2?e=mu:"function"!=typeof e&&(e=q.format(e));var r=Math.max(1,l*n/i.ticks().length);return function(n){var t=n/h(Math.round(f(n)));return t*l<l-.5&&(t*=l),t<=r?e(n):""}};i.copy=function(){return n(t.copy(),l,c,s)};return fu(i,t)}(q.scale.linear().domain([0,1]),10,!0,[1,10])};var mu=q.format(".0e"),xu={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};function Mu(t){return function(n){return n<0?-Math.pow(-n,t):Math.pow(n,t)}}q.scale.pow=function(){return function n(t,e,r){var i=Mu(e),o=Mu(1/e);function u(n){return t(i(n))}u.invert=function(n){return o(t.invert(n))};u.domain=function(n){return arguments.length?(t.domain((r=n.map(Number)).map(i)),u):r};u.ticks=function(n){return du(r,n)};u.tickFormat=function(n,t){return gu(r,n,t)};u.nice=function(n){return u.domain(hu(r,n))};u.exponent=function(n){return arguments.length?(i=Mu(e=n),o=Mu(1/e),t.domain(r.map(i)),u):e};u.copy=function(){return n(t.copy(),e,r)};return fu(u,t)}(q.scale.linear(),1,[0,1])},q.scale.sqrt=function(){return q.scale.pow().exponent(.5)},q.scale.ordinal=function(){return function n(a,l){var i,c,s;function f(n){return c[((i.get(n)||("range"===l.t?i.set(n,a.push(n)):NaN))-1)%c.length]}function h(t,e){return q.range(a.length).map(function(n){return t+e*n})}f.domain=function(n){if(!arguments.length)return a;a=[],i=new m;for(var t,e=-1,r=n.length;++e<r;)i.has(t=n[e])||i.set(t,a.push(t));return f[l.t].apply(f,l.a)};f.range=function(n){return arguments.length?(c=n,s=0,l={t:"range",a:arguments},f):c};f.rangePoints=function(n,t){arguments.length<2&&(t=0);var e=n[0],r=n[1],i=a.length<2?(e=(e+r)/2,0):(r-e)/(a.length-1+t);return c=h(e+i*t/2,i),s=0,l={t:"rangePoints",a:arguments},f};f.rangeRoundPoints=function(n,t){arguments.length<2&&(t=0);var e=n[0],r=n[1],i=a.length<2?(e=r=Math.round((e+r)/2),0):(r-e)/(a.length-1+t)|0;return c=h(e+Math.round(i*t/2+(r-e-(a.length-1+t)*i)/2),i),s=0,l={t:"rangeRoundPoints",a:arguments},f};f.rangeBands=function(n,t,e){arguments.length<2&&(t=0),arguments.length<3&&(e=t);var r=n[1]<n[0],i=n[r-0],o=n[1-r],u=(o-i)/(a.length-t+2*e);return c=h(i+u*e,u),r&&c.reverse(),s=u*(1-t),l={t:"rangeBands",a:arguments},f};f.rangeRoundBands=function(n,t,e){arguments.length<2&&(t=0),arguments.length<3&&(e=t);var r=n[1]<n[0],i=n[r-0],o=n[1-r],u=Math.floor((o-i)/(a.length-t+2*e));return c=h(i+Math.round((o-i-(a.length-t)*u)/2),u),r&&c.reverse(),s=Math.round(u*(1-t)),l={t:"rangeRoundBands",a:arguments},f};f.rangeBand=function(){return s};f.rangeExtent=function(){return iu(l.a[0])};f.copy=function(){return n(a,l)};return f.domain(a)}([],{t:"range",a:[[]]})},q.scale.category10=function(){return q.scale.ordinal().range(_u)},q.scale.category20=function(){return q.scale.ordinal().range(wu)},q.scale.category20b=function(){return q.scale.ordinal().range(bu)},q.scale.category20c=function(){return q.scale.ordinal().range(ku)};var _u=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(at),wu=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(at),bu=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(at),ku=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(at);function Cu(){return 0}q.scale.quantile=function(){return function n(e,r){var i;function t(){var n=0,t=r.length;for(i=[];++n<t;)i[n-1]=q.quantile(e,n/t);return o}function o(n){if(!isNaN(n=+n))return r[q.bisect(i,n)]}o.domain=function(n){return arguments.length?(e=n.map(c).filter(s).sort(l),t()):e};o.range=function(n){return arguments.length?(r=n,t()):r};o.quantiles=function(){return i};o.invertExtent=function(n){return(n=r.indexOf(n))<0?[NaN,NaN]:[0<n?i[n-1]:e[0],n<i.length?i[n]:e[e.length-1]]};o.copy=function(){return n(e,r)};return t()}([],[])},q.scale.quantize=function(){return function n(t,e,r){var i,o;function u(n){return r[Math.max(0,Math.min(o,Math.floor(i*(n-t))))]}function a(){return i=r.length/(e-t),o=r.length-1,u}u.domain=function(n){return arguments.length?(t=+n[0],e=+n[n.length-1],a()):[t,e]};u.range=function(n){return arguments.length?(r=n,a()):r};u.invertExtent=function(n){return[n=(n=r.indexOf(n))<0?NaN:n/i+t,n+1/i]};u.copy=function(){return n(t,e,r)};return a()}(0,1,[0,1])},q.scale.threshold=function(){return function n(t,e){function r(n){if(n<=n)return e[q.bisect(t,n)]}r.domain=function(n){return arguments.length?(t=n,r):t};r.range=function(n){return arguments.length?(e=n,r):e};r.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]};r.copy=function(){return n(t,e)};return r}([.5],[0,1])},q.scale.identity=function(){return function n(e){function t(n){return+n}t.invert=t;t.domain=t.range=function(n){return arguments.length?(e=n.map(t),t):e};t.ticks=function(n){return du(e,n)};t.tickFormat=function(n,t){return gu(e,n,t)};t.copy=function(){return n(e)};return t}([0,1])},q.svg={},q.svg.arc=function(){var P=Nu,O=Su,U=Cu,I=Eu,H=Au,Y=Lu,Z=Fu;function t(){var n=Math.max(0,+P.apply(this,arguments)),t=Math.max(0,+O.apply(this,arguments)),e=H.apply(this,arguments)-Sn,r=Y.apply(this,arguments)-Sn,i=Math.abs(r-e),o=r<e?0:1;if(t<n&&(u=t,t=n,n=u),Nn<=i)return V(t,o)+(n?V(n,1-o):"")+"Z";var u,a,l,c,s,f,h,p,d,g,v,y,m=0,x=0,M=[];if((c=(+Z.apply(this,arguments)||0)/2)&&(l=I===Eu?Math.sqrt(n*n+t*t):+I.apply(this,arguments),o||(x*=-1),t&&(x=qn(l/t*Math.sin(c))),n&&(m=qn(l/n*Math.sin(c)))),t){s=t*Math.cos(e+x),f=t*Math.sin(e+x),h=t*Math.cos(r-x),p=t*Math.sin(r-x);var _=Math.abs(r-e-2*x)<=Cn?0:1;if(x&&Tu(s,f,h,p)===o^_){var w=(e+r)/2;s=t*Math.cos(w),f=t*Math.sin(w),h=p=null}}else s=f=0;if(n){d=n*Math.cos(r-m),g=n*Math.sin(r-m),v=n*Math.cos(e+m),y=n*Math.sin(e+m);var b=Math.abs(e-r+2*m)<=Cn?0:1;if(m&&Tu(d,g,v,y)===1-o^b){var k=(e+r)/2;d=n*Math.cos(k),g=n*Math.sin(k),v=y=null}}else d=g=0;if(bn<i&&.001<(u=Math.min(Math.abs(t-n)/2,+U.apply(this,arguments)))){a=n<t^o?0:1;var C=u,E=u;if(i<Cn){var N=null==v?[d,g]:null==h?[s,f]:ii([s,f],[v,y],[h,p],[d,g]),S=s-N[0],A=f-N[1],L=h-N[0],F=p-N[1],T=1/Math.sin(Math.acos((S*L+A*F)/(Math.sqrt(S*S+A*A)*Math.sqrt(L*L+F*F)))/2),z=Math.sqrt(N[0]*N[0]+N[1]*N[1]);E=Math.min(u,(n-z)/(T-1)),C=Math.min(u,(t-z)/(T+1))}if(null!=h){var q=zu(null==v?[d,g]:[v,y],[s,f],t,C,o),D=zu([h,p],[d,g],t,C,o);u===C?M.push("M",q[0],"A",C,",",C," 0 0,",a," ",q[1],"A",t,",",t," 0 ",1-o^Tu(q[1][0],q[1][1],D[1][0],D[1][1]),",",o," ",D[1],"A",C,",",C," 0 0,",a," ",D[0]):M.push("M",q[0],"A",C,",",C," 0 1,",a," ",D[0])}else M.push("M",s,",",f);if(null!=v){var R=zu([s,f],[v,y],n,-E,o),j=zu([d,g],null==h?[s,f]:[h,p],n,-E,o);u===E?M.push("L",j[0],"A",E,",",E," 0 0,",a," ",j[1],"A",n,",",n," 0 ",o^Tu(j[1][0],j[1][1],R[1][0],R[1][1]),",",1-o," ",R[1],"A",E,",",E," 0 0,",a," ",R[0]):M.push("L",j[0],"A",E,",",E," 0 0,",a," ",R[0])}else M.push("L",d,",",g)}else M.push("M",s,",",f),null!=h&&M.push("A",t,",",t," 0 ",_,",",o," ",h,",",p),M.push("L",d,",",g),null!=v&&M.push("A",n,",",n," 0 ",b,",",1-o," ",v,",",y);return M.push("Z"),M.join("")}function V(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}return t.innerRadius=function(n){return arguments.length?(P=vt(n),t):P},t.outerRadius=function(n){return arguments.length?(O=vt(n),t):O},t.cornerRadius=function(n){return arguments.length?(U=vt(n),t):U},t.padRadius=function(n){return arguments.length?(I=n==Eu?Eu:vt(n),t):I},t.startAngle=function(n){return arguments.length?(H=vt(n),t):H},t.endAngle=function(n){return arguments.length?(Y=vt(n),t):Y},t.padAngle=function(n){return arguments.length?(Z=vt(n),t):Z},t.centroid=function(){var n=(+P.apply(this,arguments)+ +O.apply(this,arguments))/2,t=(+H.apply(this,arguments)+ +Y.apply(this,arguments))/2-Sn;return[Math.cos(t)*n,Math.sin(t)*n]},t};var Eu="auto";function Nu(n){return n.innerRadius}function Su(n){return n.outerRadius}function Au(n){return n.startAngle}function Lu(n){return n.endAngle}function Fu(n){return n&&n.padAngle}function Tu(n,t,e,r){return 0<(n-e)*t-(t-r)*n?0:1}function zu(n,t,e,r,i){var o=n[0]-t[0],u=n[1]-t[1],a=(i?r:-r)/Math.sqrt(o*o+u*u),l=a*u,c=-a*o,s=n[0]+l,f=n[1]+c,h=t[0]+l,p=t[1]+c,d=(s+h)/2,g=(f+p)/2,v=h-s,y=p-f,m=v*v+y*y,x=e-r,M=s*p-h*f,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*m-M*M)),w=(M*y-v*_)/m,b=(-M*v-y*_)/m,k=(M*y+v*_)/m,C=(-M*v+y*_)/m,E=w-d,N=b-g,S=k-d,A=C-g;return S*S+A*A<E*E+N*N&&(w=k,b=C),[[w-l,b-c],[w*e/x,b*e/x]]}function qu(c){var s=Kr,f=Qr,h=$e,p=Ru,t=p.key,d=.7;function e(n){var t,e=[],r=[],i=-1,o=n.length,u=vt(s),a=vt(f);function l(){e.push("M",p(c(r),d))}for(;++i<o;)h.call(this,t=n[i],i)?r.push([+u.call(this,t,i),+a.call(this,t,i)]):r.length&&(l(),r=[]);return r.length&&l(),e.length?e.join(""):null}return e.x=function(n){return arguments.length?(s=n,e):s},e.y=function(n){return arguments.length?(f=n,e):f},e.defined=function(n){return arguments.length?(h=n,e):h},e.interpolate=function(n){return arguments.length?(t="function"==typeof n?p=n:(p=Du.get(n)||Ru).key,e):t},e.tension=function(n){return arguments.length?(d=n,e):d},e}q.svg.line=function(){return qu(R)};var Du=q.map({linear:Ru,"linear-closed":ju,step:function(n){var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];for(;++t<e;)i.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);1<e&&i.push("H",r[0]);return i.join("")},"step-before":Pu,"step-after":Ou,basis:Hu,"basis-open":function(n){if(n.length<4)return Ru(n);var t,e=[],r=-1,i=n.length,o=[0],u=[0];for(;++r<3;)t=n[r],o.push(t[0]),u.push(t[1]);e.push(Yu($u,o)+","+Yu($u,u)),--r;for(;++r<i;)t=n[r],o.shift(),o.push(t[0]),u.shift(),u.push(t[1]),Bu(e,o,u);return e.join("")},"basis-closed":function(n){var t,e,r=-1,i=n.length,o=i+4,u=[],a=[];for(;++r<4;)e=n[r%i],u.push(e[0]),a.push(e[1]);t=[Yu($u,u),",",Yu($u,a)],--r;for(;++r<o;)e=n[r%i],u.shift(),u.push(e[0]),a.shift(),a.push(e[1]),Bu(t,u,a);return t.join("")},bundle:function(n,t){var e=n.length-1;if(e)for(var r,i,o=n[0][0],u=n[0][1],a=n[e][0]-o,l=n[e][1]-u,c=-1;++c<=e;)r=n[c],i=c/e,r[0]=t*r[0]+(1-t)*(o+i*a),r[1]=t*r[1]+(1-t)*(u+i*l);return Hu(n)},cardinal:function(n,t){return n.length<3?Ru(n):n[0]+Uu(n,Iu(n,t))},"cardinal-open":function(n,t){return n.length<4?Ru(n):n[1]+Uu(n.slice(1,-1),Iu(n,t))},"cardinal-closed":function(n,t){return n.length<3?ju(n):n[0]+Uu((n.push(n[0]),n),Iu([n[n.length-2]].concat(n,[n[1]]),t))},monotone:function(n){return n.length<3?Ru(n):n[0]+Uu(n,function(n){var t,e,r,i,o=[],u=function(n){var t=0,e=n.length-1,r=[],i=n[0],o=n[1],u=r[0]=Xu(i,o);for(;++t<e;)r[t]=(u+(u=Xu(i=o,o=n[t+1])))/2;return r[t]=u,r}(n),a=-1,l=n.length-1;for(;++a<l;)t=Xu(n[a],n[a+1]),z(t)<bn?u[a]=u[a+1]=0:(e=u[a]/t,r=u[a+1]/t,9<(i=e*e+r*r)&&(i=3*t/Math.sqrt(i),u[a]=i*e,u[a+1]=i*r));a=-1;for(;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+u[a]*u[a])),o.push([i||0,u[a]*i||0]);return o}(n))}});function Ru(n){return 1<n.length?n.join("L"):n+"Z"}function ju(n){return n.join("L")+"Z"}function Pu(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("V",(r=n[t])[1],"H",r[0]);return i.join("")}function Ou(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("H",(r=n[t])[0],"V",r[1]);return i.join("")}function Uu(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return Ru(n);var e=n.length!=t.length,r="",i=n[0],o=n[1],u=t[0],a=u,l=1;if(e&&(r+="Q"+(o[0]-2*u[0]/3)+","+(o[1]-2*u[1]/3)+","+o[0]+","+o[1],i=n[1],l=2),1<t.length){a=t[1],o=n[l],l++,r+="C"+(i[0]+u[0])+","+(i[1]+u[1])+","+(o[0]-a[0])+","+(o[1]-a[1])+","+o[0]+","+o[1];for(var c=2;c<t.length;c++,l++)o=n[l],a=t[c],r+="S"+(o[0]-a[0])+","+(o[1]-a[1])+","+o[0]+","+o[1]}if(e){var s=n[l];r+="Q"+(o[0]+2*a[0]/3)+","+(o[1]+2*a[1]/3)+","+s[0]+","+s[1]}return r}function Iu(n,t){for(var e,r=[],i=(1-t)/2,o=n[0],u=n[1],a=1,l=n.length;++a<l;)e=o,o=u,u=n[a],r.push([i*(u[0]-e[0]),i*(u[1]-e[1])]);return r}function Hu(n){if(n.length<3)return Ru(n);var t=1,e=n.length,r=n[0],i=r[0],o=r[1],u=[i,i,i,(r=n[1])[0]],a=[o,o,o,r[1]],l=[i,",",o,"L",Yu($u,u),",",Yu($u,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],u.shift(),u.push(r[0]),a.shift(),a.push(r[1]),Bu(l,u,a);return n.pop(),l.push("L",r),l.join("")}function Yu(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}Du.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Zu=[0,2/3,1/3,0],Vu=[0,1/3,2/3,0],$u=[0,1/6,2/3,1/6];function Bu(n,t,e){n.push("C",Yu(Zu,t),",",Yu(Zu,e),",",Yu(Vu,t),",",Yu(Vu,e),",",Yu($u,t),",",Yu($u,e))}function Xu(n,t){return(t[1]-n[1])/(t[0]-n[0])}function Wu(n){for(var t,e,r,i=-1,o=n.length;++i<o;)e=(t=n[i])[0],r=t[1]-Sn,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Ju(d){var g=Kr,v=Kr,y=0,m=Qr,x=$e,M=Ru,t=M.key,_=M,w="L",b=.7;function e(n){var t,e,r,i=[],o=[],u=[],a=-1,l=n.length,c=vt(g),s=vt(y),f=g===v?function(){return e}:vt(v),h=y===m?function(){return r}:vt(m);function p(){i.push("M",M(d(u),b),w,_(d(o.reverse()),b),"Z")}for(;++a<l;)x.call(this,t=n[a],a)?(o.push([e=+c.call(this,t,a),r=+s.call(this,t,a)]),u.push([+f.call(this,t,a),+h.call(this,t,a)])):o.length&&(p(),o=[],u=[]);return o.length&&p(),i.length?i.join(""):null}return e.x=function(n){return arguments.length?(g=v=n,e):v},e.x0=function(n){return arguments.length?(g=n,e):g},e.x1=function(n){return arguments.length?(v=n,e):v},e.y=function(n){return arguments.length?(y=m=n,e):m},e.y0=function(n){return arguments.length?(y=n,e):y},e.y1=function(n){return arguments.length?(m=n,e):m},e.defined=function(n){return arguments.length?(x=n,e):x},e.interpolate=function(n){return arguments.length?(t="function"==typeof n?M=n:(M=Du.get(n)||Ru).key,_=M.reverse||M,w=M.closed?"M":"L",e):t},e.tension=function(n){return arguments.length?(b=n,e):b},e}function Gu(n){return n.radius}function Ku(n){return[n.x,n.y]}function Qu(){return 64}function na(){return"circle"}function ta(n){var t=Math.sqrt(n/Cn);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}q.svg.line.radial=function(){var n=qu(Wu);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},(Pu.reverse=Ou).reverse=Pu,q.svg.area=function(){return Ju(R)},q.svg.area.radial=function(){var n=Ju(Wu);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},q.svg.chord=function(){var u=Pr,a=Or,l=Gu,c=Au,s=Lu;function t(n,t){var e,r,i=f(this,u,n,t),o=f(this,a,n,t);return"M"+i.p0+h(i.r,i.p1,i.a1-i.a0)+(r=o,(e=i).a0==r.a0&&e.a1==r.a1?p(i.r,i.p1,i.r,i.p0):p(i.r,i.p1,o.r,o.p0)+h(o.r,o.p1,o.a1-o.a0)+p(o.r,o.p1,i.r,i.p0))+"Z"}function f(n,t,e,r){var i=t.call(n,e,r),o=l.call(n,i,r),u=c.call(n,i,r)-Sn,a=s.call(n,i,r)-Sn;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(n,t,e){return"A"+n+","+n+" 0 "+ +(Cn<e)+",1 "+t}function p(n,t,e,r){return"Q 0,0 "+r}return t.radius=function(n){return arguments.length?(l=vt(n),t):l},t.source=function(n){return arguments.length?(u=vt(n),t):u},t.target=function(n){return arguments.length?(a=vt(n),t):a},t.startAngle=function(n){return arguments.length?(c=vt(n),t):c},t.endAngle=function(n){return arguments.length?(s=vt(n),t):s},t},q.svg.diagonal=function(){var u=Pr,a=Or,l=Ku;function t(n,t){var e=u.call(this,n,t),r=a.call(this,n,t),i=(e.y+r.y)/2,o=[e,{x:e.x,y:i},{x:r.x,y:i},r];return"M"+(o=o.map(l))[0]+"C"+o[1]+" "+o[2]+" "+o[3]}return t.source=function(n){return arguments.length?(u=vt(n),t):u},t.target=function(n){return arguments.length?(a=vt(n),t):a},t.projection=function(n){return arguments.length?(l=n,t):l},t},q.svg.diagonal.radial=function(){var n=q.svg.diagonal(),t=Ku,e=n.projection;return n.projection=function(n){return arguments.length?e((r=t=n,function(){var n=r.apply(this,arguments),t=n[0],e=n[1]-Sn;return[t*Math.cos(e),t*Math.sin(e)]})):t;var r},n},q.svg.symbol=function(){var e=na,r=Qu;function t(n,t){return(ea.get(e.call(this,n,t))||ta)(r.call(this,n,t))}return t.type=function(n){return arguments.length?(e=vt(n),t):e},t.size=function(n){return arguments.length?(r=vt(n),t):r},t};var ea=q.map({circle:ta,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*ia)),e=t*ia;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/ra),e=t*ra/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/ra),e=t*ra/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});q.svg.symbolTypes=ea.keys();var ra=Math.sqrt(3),ia=Math.tan(30*An);$.transition=function(n){for(var t,e,r=la||++fa,i=da(n),o=[],u=ca||{time:Date.now(),ease:Qi,delay:0,duration:250},a=-1,l=this.length;++a<l;){o.push(t=[]);for(var c=this[a],s=-1,f=c.length;++s<f;)(e=c[s])&&ga(e,s,i,r,u),t.push(e)}return aa(o,i,r)},$.interrupt=function(n){return this.each(null==n?oa:ua(da(n)))};var oa=ua(da());function ua(r){return function(){var n,t,e;(n=this[r])&&(e=n[t=n.active])&&(e.timer.c=null,e.timer.t=NaN,--n.count?delete n[t]:delete this[r],n.active+=.5,e.event&&e.event.interrupt.call(this,this.__data__,e.index))}}function aa(n,t,e){return I(n,sa),n.namespace=t,n.id=e,n}var la,ca,sa=[],fa=0;function ha(n,r,i,o){var u=n.id,a=n.namespace;return sn(n,"function"==typeof i?function(n,t,e){n[a][u].tween.set(r,o(i.call(n,n.__data__,t,e)))}:(i=o(i),function(n){n[a][u].tween.set(r,i)}))}function pa(n){return null==n&&(n=""),function(){this.textContent=n}}function da(n){return null==n?"__transition__":"__transition_"+n+"__"}function ga(o,u,i,a,n){var l,c,s,f,h,p=o[i]||(o[i]={active:0,count:0}),d=p[a];function e(n){var t=p.active,e=p[t];for(var r in e&&(e.timer.c=null,e.timer.t=NaN,--p.count,delete p[t],e.event&&e.event.interrupt.call(o,o.__data__,e.index)),p)if(+r<a){var i=p[r];i.timer.c=null,i.timer.t=NaN,--p.count,delete p[r]}c.c=g,kt(function(){return c.c&&g(n||1)&&(c.c=null,c.t=NaN),1},0,l),p.active=a,d.event&&d.event.start.call(o,o.__data__,u),h=[],d.tween.forEach(function(n,t){(t=t.call(o,o.__data__,u))&&h.push(t)}),f=d.ease,s=d.duration}function g(n){for(var t=n/s,e=f(t),r=h.length;0<r;)h[--r].call(o,e);if(1<=t)return d.event&&d.event.end.call(o,o.__data__,u),--p.count?delete p[a]:delete o[i],1}d||(l=n.time,c=kt(function(n){var t=d.delay;if(c.t=t+l,t<=n)return e(n-t);c.c=e},0,l),d=p[a]={tween:new m,time:l,timer:c,delay:n.delay,duration:n.duration,ease:n.ease,index:u},n=null,++p.count)}sa.call=$.call,sa.empty=$.empty,sa.node=$.node,sa.size=$.size,q.transition=function(n,t){return n&&n.transition?la?n.transition(t):n:q.selection().transition(n)},(q.transition.prototype=sa).select=function(n){var t,e,r,i=this.id,o=this.namespace,u=[];n=B(n);for(var a=-1,l=this.length;++a<l;){u.push(t=[]);for(var c=this[a],s=-1,f=c.length;++s<f;)(r=c[s])&&(e=n.call(r,r.__data__,s,a))?("__data__"in r&&(e.__data__=r.__data__),ga(e,s,o,i,r[o][i]),t.push(e)):t.push(null)}return aa(u,o,i)},sa.selectAll=function(n){var t,e,r,i,o,u=this.id,a=this.namespace,l=[];n=X(n);for(var c=-1,s=this.length;++c<s;)for(var f=this[c],h=-1,p=f.length;++h<p;)if(r=f[h]){o=r[a][u],e=n.call(r,r.__data__,h,c),l.push(t=[]);for(var d=-1,g=e.length;++d<g;)(i=e[d])&&ga(i,d,a,u,o),t.push(i)}return aa(l,a,u)},sa.filter=function(n){var t,e,r=[];"function"!=typeof n&&(n=cn(n));for(var i=0,o=this.length;i<o;i++){r.push(t=[]);for(var u,a=0,l=(u=this[i]).length;a<l;a++)(e=u[a])&&n.call(e,e.__data__,a,i)&&t.push(e)}return aa(r,this.namespace,this.id)},sa.tween=function(t,e){var r=this.id,i=this.namespace;return arguments.length<2?this.node()[i][r].tween.get(t):sn(this,null==e?function(n){n[i][r].tween.remove(t)}:function(n){n[i][r].tween.set(t,e)})},sa.attr=function(n,t){if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var r="transform"==n?so:Zi,i=q.ns.qualify(n);function o(){this.removeAttribute(i)}function u(){this.removeAttributeNS(i.space,i.local)}return ha(this,"attr."+n,t,i.local?function(e){return null==e?u:(e+="",function(){var t,n=this.getAttributeNS(i.space,i.local);return n!==e&&(t=r(n,e),function(n){this.setAttributeNS(i.space,i.local,t(n))})})}:function(e){return null==e?o:(e+="",function(){var t,n=this.getAttribute(i);return n!==e&&(t=r(n,e),function(n){this.setAttribute(i,t(n))})})})},sa.attrTween=function(n,r){var i=q.ns.qualify(n);return this.tween("attr."+n,i.local?function(n,t){var e=r.call(this,n,t,this.getAttributeNS(i.space,i.local));return e&&function(n){this.setAttributeNS(i.space,i.local,e(n))}}:function(n,t){var e=r.call(this,n,t,this.getAttribute(i));return e&&function(n){this.setAttribute(i,e(n))}})},sa.style=function(r,n,i){var t=arguments.length;if(t<3){if("string"!=typeof r){for(i in t<2&&(n=""),r)this.style(i,r[i],n);return this}i=""}function o(){this.style.removeProperty(r)}return ha(this,"style."+r,n,function(e){return null==e?o:(e+="",function(){var t,n=D(this).getComputedStyle(this,null).getPropertyValue(r);return n!==e&&(t=Zi(n,e),function(n){this.style.setProperty(r,t(n),i)})})})},sa.styleTween=function(r,i,o){return arguments.length<3&&(o=""),this.tween("style."+r,function(n,t){var e=i.call(this,n,t,D(this).getComputedStyle(this,null).getPropertyValue(r));return e&&function(n){this.style.setProperty(r,e(n),o)}})},sa.text=function(n){return ha(this,"text",n,pa)},sa.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var n;this[t].count<2&&(n=this.parentNode)&&n.removeChild(this)})},sa.ease=function(t){var e=this.id,r=this.namespace;return arguments.length<1?this.node()[r][e].ease:("function"!=typeof t&&(t=q.ease.apply(q,arguments)),sn(this,function(n){n[r][e].ease=t}))},sa.delay=function(r){var i=this.id,o=this.namespace;return arguments.length<1?this.node()[o][i].delay:sn(this,"function"==typeof r?function(n,t,e){n[o][i].delay=+r.call(n,n.__data__,t,e)}:(r=+r,function(n){n[o][i].delay=r}))},sa.duration=function(r){var i=this.id,o=this.namespace;return arguments.length<1?this.node()[o][i].duration:sn(this,"function"==typeof r?function(n,t,e){n[o][i].duration=Math.max(1,r.call(n,n.__data__,t,e))}:(r=Math.max(1,r),function(n){n[o][i].duration=r}))},sa.each=function(r,e){var i=this.id,o=this.namespace;if(arguments.length<2){var n=ca,t=la;try{la=i,sn(this,function(n,t,e){ca=n[o][i],r.call(n,n.__data__,t,e)})}finally{ca=n,la=t}}else sn(this,function(n){var t=n[o][i];(t.event||(t.event=q.dispatch("start","end","interrupt"))).on(r,e)});return this},sa.transition=function(){for(var n,t,e,r=this.id,i=++fa,o=this.namespace,u=[],a=0,l=this.length;a<l;a++){u.push(n=[]);for(var c,s=0,f=(c=this[a]).length;s<f;s++)(t=c[s])&&ga(t,s,o,i,{time:(e=t[o][r]).time,ease:e.ease,delay:e.delay+e.duration,duration:e.duration}),n.push(t)}return aa(u,o,i)},q.svg.axis=function(){var E,N=q.scale.linear(),S=va,A=6,L=6,F=3,T=[10],z=null;function e(n){n.each(function(){var n,t=q.select(this),e=this.__chart__||N,r=this.__chart__=N.copy(),i=null==z?r.ticks?r.ticks.apply(r,T):r.domain():z,o=null==E?r.tickFormat?r.tickFormat.apply(r,T):R:E,u=t.selectAll(".tick").data(i,r),a=u.enter().insert("g",".domain").attr("class","tick").style("opacity",bn),l=q.transition(u.exit()).style("opacity",bn).remove(),c=q.transition(u.order()).style("opacity",1),s=Math.max(A,0)+F,f=ou(r),h=t.selectAll(".domain").data([0]),p=(h.enter().append("path").attr("class","domain"),q.transition(h));a.append("line"),a.append("text");var d,g,v,y,m=a.select("line"),x=c.select("line"),M=u.select("text").text(o),_=a.select("text"),w=c.select("text"),b="top"===S||"left"===S?-1:1;if("bottom"===S||"top"===S?(n=ma,d="x",v="y",g="x2",y="y2",M.attr("dy",b<0?"0em":".71em").style("text-anchor","middle"),p.attr("d","M"+f[0]+","+b*L+"V0H"+f[1]+"V"+b*L)):(n=xa,d="y",v="x",g="y2",y="x2",M.attr("dy",".32em").style("text-anchor",b<0?"end":"start"),p.attr("d","M"+b*L+","+f[0]+"H0V"+f[1]+"H"+b*L)),m.attr(y,b*A),_.attr(v,b*s),x.attr(g,0).attr(y,b*A),w.attr(d,0).attr(v,b*s),r.rangeBand){var k=r,C=k.rangeBand()/2;e=r=function(n){return k(n)+C}}else e.rangeBand?e=r:l.call(n,r,e);a.call(n,e,r),c.call(n,r,r)})}return e.scale=function(n){return arguments.length?(N=n,e):N},e.orient=function(n){return arguments.length?(S=n in ya?n+"":va,e):S},e.ticks=function(){return arguments.length?(T=h(arguments),e):T},e.tickValues=function(n){return arguments.length?(z=n,e):z},e.tickFormat=function(n){return arguments.length?(E=n,e):E},e.tickSize=function(n){var t=arguments.length;return t?(A=+n,L=+arguments[t-1],e):A},e.innerTickSize=function(n){return arguments.length?(A=+n,e):A},e.outerTickSize=function(n){return arguments.length?(L=+n,e):L},e.tickPadding=function(n){return arguments.length?(F=+n,e):F},e.tickSubdivide=function(){return arguments.length&&e},e};var va="bottom",ya={top:1,right:1,bottom:1,left:1};function ma(n,e,r){n.attr("transform",function(n){var t=e(n);return"translate("+(isFinite(t)?t:r(n))+",0)"})}function xa(n,e,r){n.attr("transform",function(n){var t=e(n);return"translate(0,"+(isFinite(t)?t:r(n))+")"})}q.svg.brush=function(){var m,x,M=O(N,"brushstart","brush","brushend"),_=null,w=null,b=[0,0],k=[0,0],C=!0,E=!0,u=_a[0];function N(n){n.each(function(){var n=q.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",a).on("touchstart.brush",a),t=n.selectAll(".background").data([0]);t.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var e=n.selectAll(".resize").data(u,R);e.exit().remove(),e.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Ma[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),e.style("display",N.empty()?"none":null);var r,i=q.transition(n),o=q.transition(t);_&&(r=ou(_),o.attr("x",r[0]).attr("width",r[1]-r[0]),A(i)),w&&(r=ou(w),o.attr("y",r[0]).attr("height",r[1]-r[0]),L(i)),S(i)})}function S(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+b[+/e$/.test(n)]+","+k[+/^s/.test(n)]+")"})}function A(n){n.select(".extent").attr("x",b[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",b[1]-b[0])}function L(n){n.select(".extent").attr("y",k[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",k[1]-k[0])}function a(){var f,e,r=this,n=q.select(q.event.target),i=M.of(r,arguments),o=q.select(r),t=n.datum(),u=!/^(n|s)$/.test(t)&&_,a=!/^(e|w)$/.test(t)&&w,h=n.classed("extent"),l=xn(r),p=q.mouse(r),c=q.select(D(r)).on("keydown.brush",function(){32==q.event.keyCode&&(h||(f=null,p[0]-=b[1],p[1]-=k[1],h=2),j())}).on("keyup.brush",function(){32==q.event.keyCode&&2==h&&(p[0]+=b[1],p[1]+=k[1],h=0,j())});if(q.event.changedTouches?c.on("touchmove.brush",g).on("touchend.brush",y):c.on("mousemove.brush",g).on("mouseup.brush",y),o.interrupt().selectAll("*").interrupt(),h)p[0]=b[0]-p[0],p[1]=k[0]-p[1];else if(t){var s=+/w$/.test(t),d=+/^n/.test(t);e=[b[1-s]-p[0],k[1-d]-p[1]],p[0]=b[s],p[1]=k[d]}else q.event.altKey&&(f=p.slice());function g(){var n=q.mouse(r),t=!1;e&&(n[0]+=e[0],n[1]+=e[1]),h||(q.event.altKey?(f||(f=[(b[0]+b[1])/2,(k[0]+k[1])/2]),p[0]=b[+(n[0]<f[0])],p[1]=k[+(n[1]<f[1])]):f=null),u&&v(n,_,0)&&(A(o),t=!0),a&&v(n,w,1)&&(L(o),t=!0),t&&(S(o),i({type:"brush",mode:h?"move":"resize"}))}function v(n,t,e){var r,i,o=ou(t),u=o[0],a=o[1],l=p[e],c=e?k:b,s=c[1]-c[0];if(h&&(u-=l,a-=s+l),r=(e?E:C)?Math.max(u,Math.min(a,n[e])):n[e],h?i=(r+=l)+s:(f&&(l=Math.max(u,Math.min(a,2*f[e]-r))),l<r?(i=r,r=l):i=l),c[0]!=r||c[1]!=i)return e?x=null:m=null,c[0]=r,c[1]=i,!0}function y(){g(),o.style("pointer-events","all").selectAll(".resize").style("display",N.empty()?"none":null),q.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),l(),i({type:"brushend"})}o.style("pointer-events","none").selectAll(".resize").style("display",null),q.select("body").style("cursor",n.style("cursor")),i({type:"brushstart"}),g()}return N.event=function(n){n.each(function(){var r=M.of(this,arguments),i={x:b,y:k,i:m,j:x},n=this.__chart__||i;this.__chart__=i,la?q.select(this).transition().each("start.brush",function(){m=n.i,x=n.j,b=n.x,k=n.y,r({type:"brushstart"})}).tween("brush:brush",function(){var t=Vi(b,i.x),e=Vi(k,i.y);return m=x=null,function(n){b=i.x=t(n),k=i.y=e(n),r({type:"brush",mode:"resize"})}}).each("end.brush",function(){m=i.i,x=i.j,r({type:"brush",mode:"resize"}),r({type:"brushend"})}):(r({type:"brushstart"}),r({type:"brush",mode:"resize"}),r({type:"brushend"}))})},N.x=function(n){return arguments.length?(u=_a[!(_=n)<<1|!w],N):_},N.y=function(n){return arguments.length?(u=_a[!_<<1|!(w=n)],N):w},N.clamp=function(n){return arguments.length?(_&&w?(C=!!n[0],E=!!n[1]):_?C=!!n:w&&(E=!!n),N):_&&w?[C,E]:_?C:w?E:null},N.extent=function(n){var t,e,r,i,o;return arguments.length?(_&&(t=n[0],e=n[1],w&&(t=t[0],e=e[0]),m=[t,e],_.invert&&(t=_(t),e=_(e)),e<t&&(o=t,t=e,e=o),t==b[0]&&e==b[1]||(b=[t,e])),w&&(r=n[0],i=n[1],_&&(r=r[1],i=i[1]),x=[r,i],w.invert&&(r=w(r),i=w(i)),i<r&&(o=r,r=i,i=o),r==k[0]&&i==k[1]||(k=[r,i])),N):(_&&(m?(t=m[0],e=m[1]):(t=b[0],e=b[1],_.invert&&(t=_.invert(t),e=_.invert(e)),e<t&&(o=t,t=e,e=o))),w&&(x?(r=x[0],i=x[1]):(r=k[0],i=k[1],w.invert&&(r=w.invert(r),i=w.invert(i)),i<r&&(o=r,r=i,i=o))),_&&w?[[t,r],[e,i]]:_?[t,e]:w&&[r,i])},N.clear=function(){return N.empty()||(b=[0,0],k=[0,0],m=x=null),N},N.empty=function(){return!!_&&b[0]==b[1]||!!w&&k[0]==k[1]},q.rebind(N,M,"on")};var Ma={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},_a=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],wa=zt.format=ae.timeFormat,ba=wa.utc,ka=ba("%Y-%m-%dT%H:%M:%S.%LZ");function Ca(n){return n.toISOString()}function Ea(t,i,n){function u(n){return t(n)}function a(n,t){var e=(n[1]-n[0])/t,r=q.bisect(Sa,e);return r==Sa.length?[i.year,pu(n.map(function(n){return n/31536e6}),t)[2]]:r?i[e/Sa[r-1]<Sa[r]/e?r-1:r]:[Fa,pu(n,t)[2]]}return u.invert=function(n){return Na(t.invert(n))},u.domain=function(n){return arguments.length?(t.domain(n),u):t.domain().map(Na)},u.nice=function(t,e){var n=u.domain(),r=iu(n),i=null==t?a(r,10):"number"==typeof t&&a(r,t);function o(n){return!isNaN(n)&&!t.range(n,Na(+n+1),e).length}return i&&(t=i[0],e=i[1]),u.domain(au(n,1<e?{floor:function(n){for(;o(n=t.floor(n));)n=Na(n-1);return n},ceil:function(n){for(;o(n=t.ceil(n));)n=Na(+n+1);return n}}:t))},u.ticks=function(n,t){var e=iu(u.domain()),r=null==n?a(e,10):"number"==typeof n?a(e,n):!n.range&&[{range:n},t];return r&&(n=r[0],t=r[1]),n.range(e[0],Na(+e[1]+1),t<1?1:t)},u.tickFormat=function(){return n},u.copy=function(){return Ea(t.copy(),i,n)},fu(u,t)}function Na(n){return new Date(n)}wa.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ca:ka,Ca.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Ca.toString=ka.toString,zt.second=jt(function(n){return new qt(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),zt.seconds=zt.second.range,zt.seconds.utc=zt.second.utc.range,zt.minute=jt(function(n){return new qt(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),zt.minutes=zt.minute.range,zt.minutes.utc=zt.minute.utc.range,zt.hour=jt(function(n){var t=n.getTimezoneOffset()/60;return new qt(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),zt.hours=zt.hour.range,zt.hours.utc=zt.hour.utc.range,zt.month=jt(function(n){return(n=zt.day(n)).setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),zt.months=zt.month.range,zt.months.utc=zt.month.utc.range;var Sa=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Aa=[[zt.second,1],[zt.second,5],[zt.second,15],[zt.second,30],[zt.minute,1],[zt.minute,5],[zt.minute,15],[zt.minute,30],[zt.hour,1],[zt.hour,3],[zt.hour,6],[zt.hour,12],[zt.day,1],[zt.day,2],[zt.week,1],[zt.month,1],[zt.month,3],[zt.year,1]],La=wa.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",$e]]),Fa={range:function(n,t,e){return q.range(Math.ceil(n/e)*e,+t,e).map(Na)},floor:R,ceil:R};Aa.year=zt.year,zt.scale=function(){return Ea(q.scale.linear(),Aa,La)};var Ta=Aa.map(function(n){return[n[0].utc,n[1]]}),za=ba.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",$e]]);function qa(n){return JSON.parse(n.responseText)}function Da(n){var t=x.createRange();return t.selectNode(x.body),t.createContextualFragment(n.responseText)}Ta.year=zt.year.utc,zt.scale.utc=function(){return Ea(q.scale.linear(),Ta,za)},q.text=yt(function(n){return n.responseText}),q.json=function(n,t){return mt(n,"application/json",qa,t)},q.html=function(n,t){return mt(n,"text/html",Da,t)},q.xml=yt(function(n){return n.responseXML}),"object"==typeof Ra&&Ra.exports?Ra.exports=q:this.d3=q}()},{}],2:[function(e,r,o){(function(t){function n(){var n;try{n=o.storage.debug}catch(n){}return!n&&void 0!==t&&"env"in t&&(n=t.env.DEBUG),n}(o=r.exports=e("./debug")).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},o.formatArgs=function(n){var t=this.useColors;if(n[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+n[0]+(t?"%c ":" ")+"+"+o.humanize(this.diff),!t)return;var e="color: "+this.color;n.splice(1,0,e,"color: inherit");var r=0,i=0;n[0].replace(/%[a-zA-Z%]/g,function(n){"%%"!==n&&(r++,"%c"===n&&(i=r))}),n.splice(i,0,e)},o.save=function(n){try{null==n?o.storage.removeItem("debug"):o.storage.debug=n}catch(n){}},o.load=n,o.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},o.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(n){}}(),o.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],o.formatters.j=function(n){try{return JSON.stringify(n)}catch(n){return"[UnexpectedJSONParseError]: "+n.message}},o.enable(n())}).call(this,e("_process"))},{"./debug":3,_process:7}],3:[function(n,t,l){function e(n){var r;function a(){if(a.enabled){var i=a,n=+new Date,t=n-(r||n);i.diff=t,i.prev=r,i.curr=n,r=n;for(var o=new Array(arguments.length),e=0;e<o.length;e++)o[e]=arguments[e];o[0]=l.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var u=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,t){if("%%"===n)return n;u++;var e=l.formatters[t];if("function"==typeof e){var r=o[u];n=e.call(i,r),o.splice(u,1),u--}return n}),l.formatArgs.call(i,o),(a.log||l.log||console.log.bind(console)).apply(i,o)}}return a.namespace=n,a.enabled=l.enabled(n),a.useColors=l.useColors(),a.color=function(n){var t,e=0;for(t in n)e=(e<<5)-e+n.charCodeAt(t),e|=0;return l.colors[Math.abs(e)%l.colors.length]}(n),a.destroy=i,"function"==typeof l.init&&l.init(a),l.instances.push(a),a}function i(){var n=l.instances.indexOf(this);return-1!==n&&(l.instances.splice(n,1),!0)}(l=t.exports=e.debug=e.default=e).coerce=function(n){return n instanceof Error?n.stack||n.message:n},l.disable=function(){l.enable("")},l.enable=function(n){var t;l.save(n),l.names=[],l.skips=[];var e=("string"==typeof n?n:"").split(/[\s,]+/),r=e.length;for(t=0;t<r;t++)e[t]&&("-"===(n=e[t].replace(/\*/g,".*?"))[0]?l.skips.push(new RegExp("^"+n.substr(1)+"$")):l.names.push(new RegExp("^"+n+"$")));for(t=0;t<l.instances.length;t++){var i=l.instances[t];i.enabled=l.enabled(i.namespace)}},l.enabled=function(n){if("*"===n[n.length-1])return!0;var t,e;for(t=0,e=l.skips.length;t<e;t++)if(l.skips[t].test(n))return!1;for(t=0,e=l.names.length;t<e;t++)if(l.names[t].test(n))return!0;return!1},l.humanize=n("ms"),l.instances=[],l.names=[],l.skips=[],l.formatters={}},{ms:6}],4:[function(n,t,e){var l=Object.create||function(n){var t=function(){};return t.prototype=n,new t},u=Object.keys||function(n){var t=[];for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.push(e);return e},o=Function.prototype.bind||function(n){var t=this;return function(){return t.apply(n,arguments)}};function r(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=l(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}((t.exports=r).EventEmitter=r).prototype._events=void 0,r.prototype._maxListeners=void 0;var i,a=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),i=0===c.x}catch(n){i=!1}function s(n){return void 0===n._maxListeners?r.defaultMaxListeners:n._maxListeners}function f(n,t,e,r){var i,o,u;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if((o=n._events)?(o.newListener&&(n.emit("newListener",t,e.listener?e.listener:e),o=n._events),u=o[t]):(o=n._events=l(null),n._eventsCount=0),u){if("function"==typeof u?u=o[t]=r?[e,u]:[u,e]:r?u.unshift(e):u.push(e),!u.warned&&(i=s(n))&&0<i&&u.length>i){u.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+u.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');a.name="MaxListenersExceededWarning",a.emitter=n,a.type=t,a.count=u.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",a.name,a.message)}}else u=o[t]=e,++n._eventsCount;return n}function h(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var n=new Array(arguments.length),t=0;t<n.length;++t)n[t]=arguments[t];this.listener.apply(this.target,n)}}function p(n,t,e){var r={fired:!1,wrapFn:void 0,target:n,type:t,listener:e},i=o.call(h,r);return i.listener=e,r.wrapFn=i}function d(n){var t=this._events;if(t){var e=t[n];if("function"==typeof e)return 1;if(e)return e.length}return 0}function g(n,t){for(var e=new Array(t),r=0;r<t;++r)e[r]=n[r];return e}i?Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(n){if("number"!=typeof n||n<0||n!=n)throw new TypeError('"defaultMaxListeners" must be a positive number');a=n}}):r.defaultMaxListeners=a,r.prototype.setMaxListeners=function(n){if("number"!=typeof n||n<0||isNaN(n))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=n,this},r.prototype.getMaxListeners=function(){return s(this)},r.prototype.emit=function(n){var t,e,r,i,o,u,a="error"===n;if(u=this._events)a=a&&null==u.error;else if(!a)return!1;if(a){if(1<arguments.length&&(t=arguments[1]),t instanceof Error)throw t;var l=new Error('Unhandled "error" event. ('+t+")");throw l.context=t,l}if(!(e=u[n]))return!1;var c="function"==typeof e;switch(r=arguments.length){case 1:!function(n,t,e){if(t)n.call(e);else for(var r=n.length,i=g(n,r),o=0;o<r;++o)i[o].call(e)}(e,c,this);break;case 2:!function(n,t,e,r){if(t)n.call(e,r);else for(var i=n.length,o=g(n,i),u=0;u<i;++u)o[u].call(e,r)}(e,c,this,arguments[1]);break;case 3:!function(n,t,e,r,i){if(t)n.call(e,r,i);else for(var o=n.length,u=g(n,o),a=0;a<o;++a)u[a].call(e,r,i)}(e,c,this,arguments[1],arguments[2]);break;case 4:!function(n,t,e,r,i,o){if(t)n.call(e,r,i,o);else for(var u=n.length,a=g(n,u),l=0;l<u;++l)a[l].call(e,r,i,o)}(e,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];!function(n,t,e,r){if(t)n.apply(e,r);else for(var i=n.length,o=g(n,i),u=0;u<i;++u)o[u].apply(e,r)}(e,c,this,i)}return!0},r.prototype.on=r.prototype.addListener=function(n,t){return f(this,n,t,!1)},r.prototype.prependListener=function(n,t){return f(this,n,t,!0)},r.prototype.once=function(n,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(n,p(this,n,t)),this},r.prototype.prependOnceListener=function(n,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(n,p(this,n,t)),this},r.prototype.removeListener=function(n,t){var e,r,i,o,u;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(e=r[n]))return this;if(e===t||e.listener===t)0==--this._eventsCount?this._events=l(null):(delete r[n],r.removeListener&&this.emit("removeListener",n,e.listener||t));else if("function"!=typeof e){for(i=-1,o=e.length-1;0<=o;o--)if(e[o]===t||e[o].listener===t){u=e[o].listener,i=o;break}if(i<0)return this;0===i?e.shift():function(n,t){for(var e=t,r=e+1,i=n.length;r<i;e+=1,r+=1)n[e]=n[r];n.pop()}(e,i),1===e.length&&(r[n]=e[0]),r.removeListener&&this.emit("removeListener",n,u||t)}return this},r.prototype.removeAllListeners=function(n){var t,e,r;if(!(e=this._events))return this;if(!e.removeListener)return 0===arguments.length?(this._events=l(null),this._eventsCount=0):e[n]&&(0==--this._eventsCount?this._events=l(null):delete e[n]),this;if(0===arguments.length){var i,o=u(e);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=l(null),this._eventsCount=0,this}if("function"==typeof(t=e[n]))this.removeListener(n,t);else if(t)for(r=t.length-1;0<=r;r--)this.removeListener(n,t[r]);return this},r.prototype.listeners=function(n){var t,e=this._events;return e&&(t=e[n])?"function"==typeof t?[t.listener||t]:function(n){for(var t=new Array(n.length),e=0;e<t.length;++e)t[e]=n[e].listener||n[e];return t}(t):[]},r.listenerCount=function(n,t){return"function"==typeof n.listenerCount?n.listenerCount(t):d.call(n,t)},r.prototype.listenerCount=d,r.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]}},{}],5:[function(n,t,e){"function"==typeof Object.create?t.exports=function(n,t){n.super_=t,n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(n,t){n.super_=t;var e=function(){};e.prototype=t.prototype,n.prototype=new e,n.prototype.constructor=n}},{}],6:[function(n,t,e){var i=1e3,o=60*i,u=60*o,a=24*u,l=365.25*a;function c(n,t,e){if(!(n<t))return n<1.5*t?Math.floor(n/t)+" "+e:Math.ceil(n/t)+" "+e+"s"}t.exports=function(n,t){t=t||{};var e,r=typeof n;if("string"===r&&0<n.length)return function(n){if(100<(n=String(n)).length)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(n);if(!t)return;var e=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return e*l;case"days":case"day":case"d":return e*a;case"hours":case"hour":case"hrs":case"hr":case"h":return e*u;case"minutes":case"minute":case"mins":case"min":case"m":return e*o;case"seconds":case"second":case"secs":case"sec":case"s":return e*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}(n);if("number"===r&&!1===isNaN(n))return t.long?c(e=n,a,"day")||c(e,u,"hour")||c(e,o,"minute")||c(e,i,"second")||e+" ms":function(n){if(a<=n)return Math.round(n/a)+"d";if(u<=n)return Math.round(n/u)+"h";if(o<=n)return Math.round(n/o)+"m";if(i<=n)return Math.round(n/i)+"s";return n+"ms"}(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))}},{}],7:[function(n,t,e){var r,i,o=t.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(t){if(r===setTimeout)return setTimeout(t,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(n){try{return r.call(null,t,0)}catch(n){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(n){r=u}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(n){i=a}}();var c,s=[],f=!1,h=-1;function p(){f&&c&&(f=!1,c.length?s=c.concat(s):h=-1,s.length&&d())}function d(){if(!f){var n=l(p);f=!0;for(var t=s.length;t;){for(c=s,s=[];++h<t;)c&&c[h].run();h=-1,t=s.length}c=null,f=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(n){try{return i.call(null,t)}catch(n){return i.call(this,t)}}}(n)}}function g(n,t){this.fun=n,this.array=t}function v(){}o.nextTick=function(n){var t=new Array(arguments.length-1);if(1<arguments.length)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];s.push(new g(n,t)),1!==s.length||f||l(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(n){return[]},o.binding=function(n){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(n){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],8:[function(n,t,e){t.exports=function(n,t){var e,r,i,o,u=0;return function(){e=this,r=arguments;var n=new Date-u;return o||(t<=n?a():o=setTimeout(a,t-n)),i};function a(){o=0,u=+new Date,i=n.apply(e,r),r=e=null}}},{}],9:[function(n,t,e){t.exports=f;var i=n("d3"),a=n("debug")("p2p-graph"),o=n("events"),r=n("inherits"),u=n("throttleit"),l={links:{width:.7,maxWidth:5,maxBytes:2097152}},c={color:"#C8C8C8"},s={method:function(n,t){return n.me?i.hsl(210,.7,.725):n.seeder?i.hsl(120,.7,.725):i.hsl(55,.7,.725)},hover:"#A9A9A9",dep:"#252929"};function f(n){var r=this;if(!(r instanceof f))return new f(n);o.call(r),"string"==typeof n&&(n=document.querySelector(n)),r._root=n,r._model={nodes:[],links:[],focused:null},r._model.links.forEach(function(n){var t=r._model.nodes[n.source],e=r._model.nodes[n.target];t.children=t.children||[],t.children.push(n.target),e.parents=e.parents||[],e.parents.push(n.source)}),r._svg=i.select(r._root).append("svg"),r._resize(),r._force=i.layout.force().size([r._width,r._height]).nodes(r._model.nodes).links(r._model.links).on("tick",function(){r._link.attr("x1",function(n){return n.source.x}).attr("y1",function(n){return n.source.y}).attr("x2",function(n){return n.target.x}).attr("y2",function(n){return n.target.y}),r._node.attr("cx",function(n){return n.x}).attr("cy",function(n){return n.y}),r._node.attr("transform",function(n){return"translate("+n.x+","+n.y+")"})}),r._node=r._svg.selectAll(".node"),r._link=r._svg.selectAll(".link"),r._update(),r._resizeThrottled=u(function(){r._resize()},500),window.addEventListener("resize",r._resizeThrottled)}r(f,o),f.prototype.list=function(){return a("list"),this._model.nodes},f.prototype.add=function(n){if(a("add %s %o",n.id,n),this._getNode(n.id))throw new Error("add: cannot add duplicate node");this._model.nodes.push(n),this._update()},f.prototype.remove=function(n){a("remove %s",n);var t=this._getNodeIndex(n);if(-1===t)throw new Error("remove: node does not exist");this._model.focused&&this._model.focused.id===n&&(this._model.focused=null,this.emit("select",!1)),this._model.nodes.splice(t,1),this._update()},f.prototype.connect=function(n,t){a("connect %s %s",n,t);var e=this._getNode(n);if(!e)throw new Error("connect: invalid source id");var r=this._getNode(t);if(!r)throw new Error("connect: invalid target id");if(this.getLink(e.index,r.index))throw new Error("connect: cannot make duplicate connection");this._model.links.push({source:e.index,target:r.index}),this._update()},f.prototype.disconnect=function(n,t){a("disconnect %s %s",n,t);var e=this._getNode(n);if(!e)throw new Error("disconnect: invalid source id");var r=this._getNode(t);if(!r)throw new Error("disconnect: invalid target id");var i=this.getLinkIndex(e.index,r.index);if(-1===i)throw new Error("disconnect: connection does not exist");this._model.links.splice(i,1),this._update()},f.prototype.hasPeer=function(){var t=this,n=Array.prototype.slice.call(arguments,0);return a("Checking for peers:",n),n.every(function(n){return t._getNode(n)})},f.prototype.hasLink=function(n,t){var e=this._getNode(n);if(!e)throw new Error("hasLink: invalid source id");var r=this._getNode(t);if(!r)throw new Error("hasLink: invalid target id");return!!this.getLink(e.index,r.index)},f.prototype.areConnected=function(n,t){var e=this._getNode(n);if(!e)throw new Error("areConnected: invalid source id");var r=this._getNode(t);if(!r)throw new Error("areConnected: invalid target id");return this.getLink(e.index,r.index)||this.getLink(r.index,e.index)},f.prototype.unchoke=function(n,t){a("unchoke %s %s",n,t)},f.prototype.choke=function(n,t){a("choke %s %s",n,t)},f.prototype.seed=function(n,t){if(a(n,"isSeeding:",t),"boolean"!=typeof t)throw new Error("seed: 2nd param must be a boolean");var e=this._getNodeIndex(n);if(-1===e)throw new Error("seed: node does not exist");this._model.nodes[e].seeder=t,this._update()},f.prototype.rate=function(n,t,e){if(a("rate update:",n+"<->"+t,"at",e),"number"!=typeof e||e<0)throw new Error("rate: 3th param must be a positive number");var r=this._getNode(n);if(!r)throw new Error("rate: invalid source id");var i=this._getNode(t);if(!i)throw new Error("rate: invalid target id");var o,u=this.getLinkIndex(r.index,i.index);if(-1===u)throw new Error("rate: connection does not exist");this._model.links[u].rate=(o=e,Math.min(o,l.links.maxBytes)*l.links.maxWidth/l.links.maxBytes),a("rate:",this._model.links[u].rate),this._update()},f.prototype.getLink=function(n,t){for(var e=0,r=this._model.links.length;e<r;e+=1){var i=this._model.links[e];if(i.source===this._model.nodes[n]&&i.target===this._model.nodes[t])return i}return null},f.prototype.destroy=function(){a("destroy"),this._root.remove(),window.removeEventListener("resize",this._resizeThrottled),this._root=null,this._resizeThrottled=null},f.prototype._update=function(){var e=this;e._link=e._link.data(e._model.links),e._node=e._node.data(e._model.nodes,function(n){return n.id}),e._link.enter().insert("line",".node").attr("class","link").style("stroke",c.color).style("opacity",.5),e._link.exit().remove(),e._link.style("stroke-width",function(n){return n.rate?n.rate<l.links.width?l.links.width:n.rate:l.links.width});var n=e._node.enter().append("g").attr("class","node");n.call(e._force.drag),n.append("circle").on("mouseover",function(n){i.select(this).style("fill",s.hover),i.selectAll(e._childNodes(n)).style("fill",s.hover).style("stroke",s.method).style("stroke-width",2),i.selectAll(e._parentNodes(n)).style("fill",s.dep).style("stroke",s.method).style("stroke-width",2)}).on("mouseout",function(n){i.select(this).style("fill",s.method),i.selectAll(e._childNodes(n)).style("fill",s.method).style("stroke",null),i.selectAll(e._parentNodes(n)).style("fill",s.method).style("stroke",null)}).on("click",function(t){if(e._model.focused===t)return e._force.charge(-200*e._scale()).linkDistance(100*e._scale()).linkStrength(1).start(),e._node.style("opacity",1),e._link.style("opacity",.3),e._model.focused=null,void e.emit("select",!1);e._model.focused=t,e.emit("select",t.id),e._node.style("opacity",function(n){return n.active=e._connected(t,n),n.active?1:.2}),e._force.charge(function(n){return(n.active?-100:-5)*e._scale()}).linkDistance(function(n){return(n.source.active&&n.target.active?100:60)*e._scale()}).linkStrength(function(n){return(n.source===t||n.target===t?1:0)*e._scale()}).start(),e._link.style("opacity",function(n,t){return n.source.active&&n.target.active?1:.02})}),e._node.select("circle").attr("r",function(n){return e._scale()*(n.me?15:10)}).style("fill",s.method),n.append("text").attr("class","text").text(function(n){return n.name}),e._node.select("text").attr("font-size",function(n){return n.me?16*e._scale():12*e._scale()}).attr("dx",0).attr("dy",function(n){return n.me?-22*e._scale():-15*e._scale()}),e._node.exit().remove(),e._force.linkDistance(100*e._scale()).charge(-200*e._scale()).start()},f.prototype._childNodes=function(n){var t=this;return n.children?n.children.map(function(n){return t._node[0][n]}).filter(function(n){return n}):[]},f.prototype._parentNodes=function(n){var t=this;return n.parents?n.parents.map(function(n){return t._node[0][n]}).filter(function(n){return n}):[]},f.prototype._connected=function(n,t){return t.id===n.id||n.children&&-1!==n.children.indexOf(t.id)||t.children&&-1!==t.children.indexOf(n.id)||t.parents&&-1!==t.parents.indexOf(n.id)||n.parents&&-1!==n.parents.indexOf(t.id)},f.prototype._getNode=function(n){for(var t=0,e=this._model.nodes.length;t<e;t+=1){var r=this._model.nodes[t];if(r.id===n)return r}return null},f.prototype._scale=function(){var n=this._model.nodes.length;return n<10?1:Math.max(.2,1-(n-10)/100)},f.prototype._resize=function(n){var t=this;t._width=t._root.offsetWidth,t._height=900<=window.innerWidth?400:250,t._svg.attr("width",t._width).attr("height",t._height),t._force&&t._force.size([t._width,t._height]).resume()},f.prototype._getNodeIndex=function(n){for(var t=0,e=this._model.nodes.length;t<e;t+=1){if(this._model.nodes[t].id===n)return t}return-1},f.prototype.getLinkIndex=function(n,t){for(var e=0,r=this._model.links.length;e<r;e+=1){var i=this._model.links[e];if(i.source===this._model.nodes[n]&&i.target===this._model.nodes[t])return e}return-1}},{d3:1,debug:2,events:4,inherits:5,throttleit:8}]},{},[9])(9)});