-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd3.min.js
More file actions
5 lines (5 loc) · 144 KB
/
Copy pathd3.min.js
File metadata and controls
5 lines (5 loc) · 144 KB
1
2
3
4
5
d3=function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function r(n){for(var t=1;n*t%1;)t*=10;return t}function e(n,t){try{for(var r in t)Object.defineProperty(n.prototype,r,{value:t[r],enumerable:!1})}catch(e){n.prototype=t}}function u(){}function i(){}function o(n,t,r){return function(){var e=r.apply(t,arguments);return e===t?n:e}}function a(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var r=0,e=Yo.length;e>r;++r){var u=Yo[r]+t;if(u in n)return u}}function c(){}function l(){}function s(n){function t(){for(var t,e=r,u=-1,i=e.length;++u<i;)(t=e[u].on)&&t.apply(this,arguments);return n}var r=[],e=new u;return t.on=function(t,u){var i,o=e.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,r=r.slice(0,i=r.indexOf(o)).concat(r.slice(i+1)),e.remove(t)),u&&r.push(e.set(t,{on:u})),n)},t}function f(){ko.event.preventDefault()}function h(){for(var n,t=ko.event;n=t.sourceEvent;)t=n;return t}function g(n){for(var t=new l,r=0,e=arguments.length;++r<e;)t[arguments[r]]=s(t);return t.of=function(r,e){return function(u){try{var i=u.sourceEvent=ko.event;u.target=n,ko.event=u,t[u.type].apply(r,e)}finally{ko.event=i}}},t}function p(n){return Zo(n,Wo),n}function d(n){return"function"==typeof n?n:function(){return Vo(n,this)}}function v(n){return"function"==typeof n?n:function(){return Xo(n,this)}}function m(n,t){function r(){this.removeAttribute(n)}function e(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var r=t.apply(this,arguments);null==r?this.removeAttribute(n):this.setAttribute(n,r)}function a(){var r=t.apply(this,arguments);null==r?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,r)}return n=ko.ns.qualify(n),null==t?n.local?e:r:"function"==typeof t?n.local?a:o:n.local?i:u}function y(n){return n.trim().replace(/\s+/g," ")}function M(n){return new RegExp("(?:^|\\s+)"+ko.requote(n)+"(?:\\s+|$)","g")}function x(n,t){function r(){for(var r=-1;++r<u;)n[r](this,t)}function e(){for(var r=-1,e=t.apply(this,arguments);++r<u;)n[r](this,e)}n=n.trim().split(/\s+/).map(b);var u=n.length;return"function"==typeof t?e:r}function b(n){var t=M(n);return function(r,e){if(u=r.classList)return e?u.add(n):u.remove(n);var u=r.getAttribute("class")||"";e?(t.lastIndex=0,t.test(u)||r.setAttribute("class",y(u+" "+n))):r.setAttribute("class",y(u.replace(t," ")))}}function _(n,t,r){function e(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,r)}function i(){var e=t.apply(this,arguments);null==e?this.style.removeProperty(n):this.style.setProperty(n,e,r)}return null==t?e:"function"==typeof t?i:u}function w(n,t){function r(){delete this[n]}function e(){this[n]=t}function u(){var r=t.apply(this,arguments);null==r?delete this[n]:this[n]=r}return null==t?r:"function"==typeof t?u:e}function S(n){return"function"==typeof n?n:(n=ko.ns.qualify(n)).local?function(){return To.createElementNS(n.space,n.local)}:function(){return To.createElementNS(this.namespaceURI,n)}}function E(n){return{__data__:n}}function k(n){return function(){return Bo(this,n)}}function A(n){return arguments.length||(n=ko.ascending),function(t,r){return t&&r?n(t.__data__,r.__data__):!t-!r}}function N(n,t){for(var r=0,e=n.length;e>r;r++)for(var u,i=n[r],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,r);return n}function T(n){return Zo(n,Go),n}function q(n){var t,r;return function(e,u,i){var o,a=n[i].update,c=a.length;for(i!=r&&(r=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t<c;);return o}}function z(){var n=this.__transition__;n&&++n.active}function C(n,t,r){function e(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=l(t,No(arguments));e.call(this),this.addEventListener(n,this[o]=u,u.$=r),u._=t}function i(){var t,r=new RegExp("^__on([^.]+)"+ko.requote(n)+"$");for(var e in this)if(t=e.match(r)){var u=this[e];this.removeEventListener(t[1],u,u.$),delete this[e]}}var o="__on"+n,a=n.indexOf("."),l=D;a>0&&(n=n.substring(0,a));var s=Qo.get(n);return s&&(n=s,l=j),a?t?u:e:t?c:i}function D(n,t){return function(r){var e=ko.event;ko.event=r,t[0]=this.__data__;try{n.apply(this,t)}finally{ko.event=e}}}function j(n,t){var r=D(n,t);return function(n){var t=this,e=n.relatedTarget;e&&(e===t||8&e.compareDocumentPosition(t))||r.call(t,n)}}function L(){var n=".dragsuppress-"+ ++ta,t="touchmove"+n,r="selectstart"+n,e="dragstart"+n,u="click"+n,i=ko.select(zo).on(t,f).on(r,f).on(e,f),o=qo.style,a=o[na];return o[na]="none",function(t){function r(){i.on(u,null)}i.on(n,null),o[na]=a,t&&(i.on(u,function(){f(),r()},!0),setTimeout(r,0))}}function H(n,t){t.changedTouches&&(t=t.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var e=r.createSVGPoint();if(0>ra&&(zo.scrollX||zo.scrollY)){r=ko.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=r[0][0].getScreenCTM();ra=!(u.f||u.e),r.remove()}return ra?(e.x=t.pageX,e.y=t.pageY):(e.x=t.clientX,e.y=t.clientY),e=e.matrixTransform(n.getScreenCTM().inverse()),[e.x,e.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}function P(n){return n>0?1:0>n?-1:0}function F(n){return n>1?0:-1>n?ea:Math.acos(n)}function O(n){return n>1?ea/2:-1>n?-ea/2:Math.asin(n)}function R(n){return(Math.exp(n)-Math.exp(-n))/2}function I(n){return(Math.exp(n)+Math.exp(-n))/2}function Y(n){return R(n)/I(n)}function U(n){return(n=Math.sin(n/2))*n}function Z(){}function V(n,t,r){return new X(n,t,r)}function X(n,t,r){this.h=n,this.s=t,this.l=r}function $(n,t,r){function e(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*e(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,r=0>r?0:r>1?1:r,o=.5>=r?r*(1+t):r+t-r*t,i=2*r-o,ot(u(n+120),u(n),u(n-120))}function B(n,t,r){return new W(n,t,r)}function W(n,t,r){this.h=n,this.c=t,this.l=r}function J(n,t,r){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),G(r,Math.cos(n*=oa)*t,Math.sin(n)*t)}function G(n,t,r){return new K(n,t,r)}function K(n,t,r){this.l=n,this.a=t,this.b=r}function Q(n,t,r){var e=(n+16)/116,u=e+t/500,i=e-r/200;return u=tt(u)*ma,e=tt(e)*ya,i=tt(i)*Ma,ot(et(3.2404542*u-1.5371385*e-.4985314*i),et(-.969266*u+1.8760108*e+.041556*i),et(.0556434*u-.2040259*e+1.0572252*i))}function nt(n,t,r){return n>0?B(Math.atan2(r,t)*aa,Math.sqrt(t*t+r*r),n):B(0/0,0/0,n)}function tt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function rt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function et(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function ut(n){return ot(n>>16,255&n>>8,255&n)}function it(n){return ut(n)+""}function ot(n,t,r){return new at(n,t,r)}function at(n,t,r){this.r=n,this.g=t,this.b=r}function ct(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function lt(n,t,r){var e,u,i,o=0,a=0,c=0;if(e=/([a-z]+)\((.*)\)/i.exec(n))switch(u=e[2].split(","),e[1]){case"hsl":return r(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(gt(u[0]),gt(u[1]),gt(u[2]))}return(i=_a.get(n))?t(i.r,i.g,i.b):(null!=n&&"#"===n.charAt(0)&&(4===n.length?(o=n.charAt(1),o+=o,a=n.charAt(2),a+=a,c=n.charAt(3),c+=c):7===n.length&&(o=n.substring(1,3),a=n.substring(3,5),c=n.substring(5,7)),o=parseInt(o,16),a=parseInt(a,16),c=parseInt(c,16)),t(o,a,c))}function st(n,t,r){var e,u,i=Math.min(n/=255,t/=255,r/=255),o=Math.max(n,t,r),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),e=n==o?(t-r)/a+(r>t?6:0):t==o?(r-n)/a+2:(n-t)/a+4,e*=60):(e=0/0,u=c>0&&1>c?0:e),V(e,u,c)}function ft(n,t,r){n=ht(n),t=ht(t),r=ht(r);var e=rt((.4124564*n+.3575761*t+.1804375*r)/ma),u=rt((.2126729*n+.7151522*t+.072175*r)/ya),i=rt((.0193339*n+.119192*t+.9503041*r)/Ma);return G(116*u-16,500*(e-u),200*(u-i))}function ht(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function gt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function pt(n){return"function"==typeof n?n:function(){return n}}function dt(n){return n}function vt(n){return function(t,r,e){return 2===arguments.length&&"function"==typeof r&&(e=r,r=null),mt(t,r,n,e)}}function mt(n,t,r,e){function u(){var n,t=c.status;if(!t&&c.responseText||t>=200&&300>t||304===t){try{n=r.call(i,c)}catch(e){return o.error.call(i,e),void 0}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=ko.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,l=null;return!zo.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=ko.event;ko.event=n;try{o.progress.call(i,c)}finally{ko.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(l=n,i):l},i.response=function(n){return r=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(No(arguments)))}}),i.send=function(r,e,u){if(2===arguments.length&&"function"==typeof e&&(u=e,e=null),c.open(r,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var s in a)c.setRequestHeader(s,a[s]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==e?null:e),i},i.abort=function(){return c.abort(),i},ko.rebind(i,o,"on"),null==e?i:i.get(yt(e))}function yt(n){return 1===n.length?function(t,r){n(null==t?r:null)}:n}function Mt(){var n=bt(),t=_t()-n;t>24?(isFinite(t)&&(clearTimeout(ka),ka=setTimeout(Mt,t)),Ea=0):(Ea=1,Na(Mt))}function xt(n,t,r){var e=arguments.length;2>e&&(t=0),3>e&&(r=Date.now()),Aa.callback=n,Aa.time=r+t}function bt(){var n=Date.now();for(Aa=wa;Aa;)n>=Aa.time&&(Aa.flush=Aa.callback(n-Aa.time)),Aa=Aa.next;return n}function _t(){for(var n,t=wa,r=1/0;t;)t.flush?t=n?n.next=t.next:wa=t.next:(t.time<r&&(r=t.time),t=(n=t).next);return Sa=n,r}function wt(n,t){var r=Math.pow(10,3*Math.abs(8-t));return{scale:t>8?function(n){return n/r}:function(n){return n*r},symbol:n}}function St(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Et(n){return n+""}function kt(){}function At(n,t,r){var e=r.s=n+t,u=e-n,i=e-u;r.t=n-i+(t-u)}function Nt(n,t){n&&Ra.hasOwnProperty(n.type)&&Ra[n.type](n,t)}function Tt(n,t,r){var e,u=-1,i=n.length-r;for(t.lineStart();++u<i;)e=n[u],t.point(e[0],e[1],e[2]);t.lineEnd()}function qt(n,t){var r=-1,e=n.length;for(t.polygonStart();++r<e;)Tt(n[r],t,1);t.polygonEnd()}function zt(){function n(n,t){n*=oa,t=t*oa/2+ea/4;var r=n-e,o=Math.cos(t),a=Math.sin(t),c=i*a,l=u*o+c*Math.cos(r),s=c*Math.sin(r);Ya.add(Math.atan2(s,l)),e=n,u=o,i=a}var t,r,e,u,i;Ua.point=function(o,a){Ua.point=n,e=(t=o)*oa,u=Math.cos(a=(r=a)*oa/2+ea/4),i=Math.sin(a)},Ua.lineEnd=function(){n(t,r)}}function Ct(n){var t=n[0],r=n[1],e=Math.cos(r);return[e*Math.cos(t),e*Math.sin(t),Math.sin(r)]}function Dt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function jt(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 Lt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function Ht(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Pt(n){var t=Math.sqrt(Dt(n,n));n[0]/=t,n[1]/=t,n[2]/=t}function Ft(n,t){var r=t[0]-n[0],e=t[1]-n[1],u=t[2]-n[2];return ia*ia>r*r+e*e+u*u}function Ot(n){return[Math.atan2(n[1],n[0]),O(n[2])]}function Rt(n,t){return Math.abs(n[1]-t[1])<ua&&(Math.abs(Math.abs(n[1])-ea/2)<ua||It(n[0],t[0])<ua)}function It(n,t){var r=Math.abs(t-n);return r>ea?2*ea-r:r}function Yt(n,t){n*=oa;var r=Math.cos(t*=oa);Ut(r*Math.cos(n),r*Math.sin(n),Math.sin(t))}function Ut(n,t,r){++Za,Xa+=(n-Xa)/Za,$a+=(t-$a)/Za,Ba+=(r-Ba)/Za}function Zt(){function n(n,u){n*=oa;var i=Math.cos(u*=oa),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),l=Math.atan2(Math.sqrt((l=r*c-e*a)*l+(l=e*o-t*c)*l+(l=t*a-r*o)*l),t*o+r*a+e*c);Va+=l,Wa+=l*(t+(t=o)),Ja+=l*(r+(r=a)),Ga+=l*(e+(e=c)),Ut(t,r,e)}var t,r,e;tc.point=function(u,i){u*=oa;var o=Math.cos(i*=oa);t=o*Math.cos(u),r=o*Math.sin(u),e=Math.sin(i),tc.point=n,Ut(t,r,e)}}function Vt(){tc.point=Yt}function Xt(){function n(n,t){n*=oa;var r=Math.cos(t*=oa),o=r*Math.cos(n),a=r*Math.sin(n),c=Math.sin(t),l=u*c-i*a,s=i*o-e*c,f=e*a-u*o,h=Math.sqrt(l*l+s*s+f*f),g=e*o+u*a+i*c,p=h&&-F(g)/h,d=Math.atan2(h,g);Ka+=p*l,Qa+=p*s,nc+=p*f,Va+=d,Wa+=d*(e+(e=o)),Ja+=d*(u+(u=a)),Ga+=d*(i+(i=c)),Ut(e,u,i)}var t,r,e,u,i;tc.point=function(o,a){t=o,r=a,tc.point=n,o*=oa;var c=Math.cos(a*=oa);e=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),Ut(e,u,i)},tc.lineEnd=function(){n(t,r),tc.lineEnd=Vt,tc.point=Yt}}function $t(){return!0}function Bt(n,t,r,e,u){var i=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,r=n[0],e=n[t];if(Math.abs(e[0]-r[0])<ua&&Math.abs(e[1]-r[1])<ua){u.lineStart();for(var a=0;t>a;++a)u.point((r=n[a])[0],r[1]);return u.lineEnd(),void 0}var c={point:r,points:n,other:null,visited:!1,entry:!0,subject:!0},l={point:r,points:[r],other:c,visited:!1,entry:!1,subject:!1};c.other=l,i.push(c),o.push(l),c={point:e,points:[e],other:null,visited:!1,entry:!1,subject:!0},l={point:e,points:[e],other:c,visited:!1,entry:!0,subject:!1},c.other=l,i.push(c),o.push(l)}}),o.sort(t),Wt(i),Wt(o),i.length){if(r)for(var a=1,c=!r(o[0].point),l=o.length;l>a;++a)o[a].entry=c=!c;for(var s,f,h,g=i[0];;){for(s=g;s.visited;)if((s=s.next)===g)return;f=s.points,u.lineStart();do{if(s.visited=s.other.visited=!0,s.entry){if(s.subject)for(var a=0;a<f.length;a++)u.point((h=f[a])[0],h[1]);else e(s.point,s.next.point,1,u);s=s.next}else{if(s.subject){f=s.prev.points;for(var a=f.length;--a>=0;)u.point((h=f[a])[0],h[1])}else e(s.point,s.prev.point,-1,u);s=s.prev}s=s.other,f=s.points}while(!s.visited);u.lineEnd()}}}function Wt(n){if(t=n.length){for(var t,r,e=0,u=n[0];++e<t;)u.next=r=n[e],r.prev=u,u=r;u.next=r=n[0],r.prev=u}}function Jt(n,t,r,e,u){return function(i){function o(t,r){n(t,r)&&i.point(t,r)}function a(n,t){v.point(n,t)}function c(){m.point=a,v.lineStart()}function l(){m.point=o,v.lineEnd()}function s(n,t,r){M.point(n,t,r),d.push([n,t])}function f(){M.lineStart(),d=[]}function h(){s(d[0][0],d[0][1],!0),M.lineEnd();var n,t=M.clean(),r=y.buffer(),e=r.length;if(d.pop(),p.push(d),d=null,e){if(1&t){n=r[0];var u,e=n.length-1,o=-1;for(i.lineStart();++o<e;)i.point((u=n[o])[0],u[1]);return i.lineEnd(),void 0}e>1&&2&t&&r.push(r.pop().concat(r.shift())),g.push(r.filter(Gt))}}var g,p,d,v=t(i),m={point:o,lineStart:c,lineEnd:l,polygonStart:function(){m.point=s,m.lineStart=f,m.lineEnd=h,g=[],p=[],i.polygonStart()},polygonEnd:function(){m.point=o,m.lineStart=c,m.lineEnd=l,g=ko.merge(g),g.length?Bt(g,u,null,r,i):e(p)&&(i.lineStart(),r(null,null,1,i),i.lineEnd()),i.polygonEnd(),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),r(null,null,1,i),i.lineEnd(),i.polygonEnd()}},y=Kt(),M=t(y);return m}}function Gt(n){return n.length>1}function Kt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,r,e,u){var i=[t,r];arguments.length>2&&(i.index=e,i.t=u),n.push(i)},lineEnd:c,buffer:function(){var r=t;return t=[],n=null,r},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Qt(n,t){var r=n[0],e=n[1],u=[Math.sin(r),-Math.cos(r),0],i=0,o=!1,a=!1,c=0;Ya.reset();for(var l=0,s=t.length;s>l;++l){var f=t[l],h=f.length;if(h){for(var g=f[0],p=g[0],d=g[1]/2+ea/4,v=Math.sin(d),m=Math.cos(d),y=1;;){y===h&&(y=0),n=f[y];var M=n[0],x=n[1]/2+ea/4,b=Math.sin(x),_=Math.cos(x),w=M-p,S=Math.abs(w)>ea,E=v*b;if(Ya.add(Math.atan2(E*Math.sin(w),m*_+E*Math.cos(w))),Math.abs(x)<ua&&(a=!0),i+=S?w+(w>=0?2:-2)*ea:w,S^p>=r^M>=r){var k=jt(Ct(g),Ct(n));Pt(k);var A=jt(u,k);Pt(A);var N=(S^w>=0?-1:1)*O(A[2]);e>N&&(c+=S^w>=0?1:-1)}if(!y++)break;p=M,v=b,m=_,g=n}Math.abs(i)>ua&&(o=!0)}}return(!a&&!o&&0>Ya||-ua>i)^1&c}function nr(n){var t,r=0/0,e=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?ea-ua:-ea,c=Math.abs(i-r);Math.abs(c-ea)<ua?(n.point(r,e=(e+o)/2>0?ea/2:-ea/2),n.point(u,e),n.lineEnd(),n.lineStart(),n.point(a,e),n.point(i,e),t=0):u!==a&&c>=ea&&(Math.abs(r-u)<ua&&(r-=u*ua),Math.abs(i-a)<ua&&(i-=a*ua),e=tr(r,e,i,o),n.point(u,e),n.lineEnd(),n.lineStart(),n.point(a,e),t=0),n.point(r=i,e=o),u=a},lineEnd:function(){n.lineEnd(),r=e=0/0},clean:function(){return 2-t}}}function tr(n,t,r,e){var u,i,o=Math.sin(n-r);return Math.abs(o)>ua?Math.atan((Math.sin(t)*(i=Math.cos(e))*Math.sin(r)-Math.sin(e)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+e)/2}function rr(n,t,r,e){var u;if(null==n)u=r*ea/2,e.point(-ea,u),e.point(0,u),e.point(ea-ua,u),e.point(ea-ua,0),e.point(ea-ua,-u),e.point(0,-u),e.point(-ea,-u),e.point(-ea,0),e.point(-ea,u);else if(Math.abs(n[0]-t[0])>ua){var i=-ea,o=ea-ua,a=(n[0]<t[0]?1:-1)*ea;t[0]<n[0]&&(i=ea-ua,o=-ea),u=r*a/2,e.point(i,u),e.point(0,u),e.point(o,u)}else e.point(t[0],t[1])}function er(n){return Qt(ec,n)}function ur(n,t){return((n=n.point)[0]<0?n[1]-ea/2-ua:ea/2-n[1])-((t=t.point)[0]<0?t[1]-ea/2-ua:ea/2-t[1])}function ir(n){return Math.abs(Math.abs(n)-ea)>ua}function or(n){function t(n,t){return Math.cos(n)*Math.cos(t)>o}function r(n){var r,e,o,a,s;return{lineStart:function(){a=o=!1,s=1},point:function(f,h){var g,p=[f,h],d=t(f,h),v=c?d?0:i(f,h):d?i(f+(0>f?ea:-ea),h):0;if(!r&&(a=o=d)&&n.lineStart(),d!==o&&(g=u(r,p),(Rt(r,g)||Rt(p,g))&&(p[0]+=ua,p[1]+=ua,d=t(p[0],p[1]))),d!==o)s=0,d?(n.lineStart(),g=u(p,r),n.point(g[0],g[1])):(g=u(r,p),n.point(g[0],g[1]),n.lineEnd()),r=g;else if(l&&r&&c^d){var m;v&e||!(m=u(p,r,!0))||(s=0,c?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!d||r&&Rt(r,p)||n.point(p[0],p[1]),r=p,o=d,e=v},lineEnd:function(){o&&n.lineEnd(),r=null},clean:function(){return s|(a&&o)<<1}}}function e(n){return Qt(a,n)}function u(n,t,r){var e=Ct(n),u=Ct(t),i=[1,0,0],a=jt(e,u),c=Dt(a,a),l=a[0],s=c-l*l;if(!s)return!r&&n;var f=o*c/s,h=-o*l/s,g=jt(i,a),p=Ht(i,f),d=Ht(a,h);Lt(p,d);var v=g,m=Dt(p,v),y=Dt(v,v),M=m*m-y*(Dt(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=Ht(v,(-m-x)/y);if(Lt(b,p),b=Ot(b),!r)return b;var _,w=n[0],S=t[0],E=n[1],k=t[1];w>S&&(_=w,w=S,S=_);var A=S-w,N=Math.abs(A-ea)<ua,T=N||ua>A;if(!N&&E>k&&(_=E,E=k,k=_),T?N?E+k>0^b[1]<(Math.abs(b[0]-w)<ua?E:k):E<=b[1]&&b[1]<=k:A>ea^(w<=b[0]&&b[0]<=S)){var q=Ht(v,(-m+x)/y);return Lt(q,p),[b,Ot(q)]}}}function i(t,r){var e=c?n:ea-n,u=0;return-e>t?u|=1:t>e&&(u|=2),-e>r?u|=4:r>e&&(u|=8),u}function e(n){return Qt(a,n)}var o=Math.cos(n),a=[n,0],c=o>0,a=[n,0],l=Math.abs(o)>ua,s=Fr(n,6*oa);return Jt(t,r,s,e,ur)}function ar(n,t){this.from=n,this.to=t,this.normal=jt(n,t),this.fromNormal=jt(this.normal,n),this.toNormal=jt(this.normal,t)}function cr(n,t){var r=jt(n.normal,t.normal);Pt(r);var e=Dt(r,n.fromNormal),u=Dt(r,n.toNormal),i=Dt(r,t.fromNormal),o=Dt(r,t.toNormal);return e>-ia&&ia>u&&i>-ia&&ia>o?r:ia>e&&u>-ia&&ia>i&&o>-ia?(r[0]=-r[0],r[1]=-r[1],r[2]=-r[2],r):void 0}function lr(n,t){var r=Dt(n,t.fromNormal),e=Dt(n,t.toNormal);return n=Dt(n,t.normal),Math.abs(n)<ia&&(r>-ia&&ia>e||ia>r&&e>-ia)}function sr(n){function t(t,r){return Qt([t,r],n)}function r(n){var r,e,u,o,a,c;return{lineStart:function(){r=null,c=1},point:function(l,s,f){f&&(l=e,s=u);var h=Ct([l,s]),g=a;if(r){for(var p=new ar(r,h),d=[],v=0,m=100;v<i.length&&m>0;++v){var y=i[v],M=cr(p,y);if(M){if(M===uc||Ft(M,r)||Ft(M,h)||Ft(M,y.from)||Ft(M,y.to)){var x=1e-4;l=(l+3*ea+(Math.random()<.5?x:-x))%(2*ea)-ea,s=Math.min(ea/2-1e-4,Math.max(1e-4-ea/2,s+(Math.random()<.5?x:-x))),p=new ar(r,h=Ct([l,s])),v=-1,--m,d.length=0;continue}var b=Ot(M);M.distance=hr(r,M),M.index=v,M.t=hr(y.from,M),M[0]=b[0],M[1]=b[1],M.pop(),d.push(M)}}if(d.length){c=0,d.sort(function(n,t){return n.distance-t.distance});for(var v=0;v<d.length;++v){var M=d[v];(g=!g)?(n.lineStart(),n.point(M[0],M[1],M.index,M.t)):(n.point(M[0],M[1],M.index,M.t),n.lineEnd())}}g&&n.point(l,s)}else{for(var v=0,m=100;v<i.length&&m>0;++v){var y=i[v];if(lr(h,y)){var x=1e-4;l=(l+3*ea+(Math.random()<.5?x:-x))%(2*ea)-ea,s=Math.min(ea/2-1e-4,Math.max(1e-4-ea/2,s+(Math.random()<.5?x:-x))),h=Ct([l,s]),v=-1,--m}}(o=g=t(e=l,u=s))&&(n.lineStart(),n.point(l,s))}r=h,a=g},lineEnd:function(){a&&n.lineEnd()},clean:function(){return c|(o&&a)<<1}}}function e(t,r,e,u){if(null==t){var o=n.length;n.forEach(function(n,t){n.forEach(function(n){u.point(n[0],n[1])}),o-1>t&&(u.lineEnd(),u.lineStart())})}else if(t.index!==r.index&&null!=t.index&&null!=r.index)for(var a=t.index;a!==r.index;a=(a+e+i.length)%i.length){var c=i[a],l=Ot(e>0?c.to:c.from);u.point(l[0],l[1])}}function u(n){return Qt(o,n)}var i=[];n=n.map(function(n){var t;return n=n.map(function(n,r){var e=Ct(n=[n[0]*oa,n[1]*oa]);return r&&i.push(new ar(t,e)),t=e,n}),n.pop(),n});var o=n[0][0];return Jt(t,r,e,u,fr)}function fr(n,t){return n=n.point,t=t.point,n.index-t.index||n.t-t.t}function hr(n,t){var r=jt(n,t);return Math.atan2(Math.sqrt(Dt(r,r)),Dt(n,t))}function gr(n,t,r,e){function u(e,u){return Math.abs(e[0]-n)<ua?u>0?0:3:Math.abs(e[0]-r)<ua?u>0?2:1:Math.abs(e[1]-t)<ua?u>0?1:0:u>0?3:2}function i(n,t){return o(n.point,t.point)}function o(n,t){var r=u(n,1),e=u(t,1);return r!==e?r-e:0===r?t[1]-n[1]:1===r?n[0]-t[0]:2===r?n[1]-t[1]:t[0]-n[0]}function a(u,i){var o=i[0]-u[0],a=i[1]-u[1],c=[0,1];return Math.abs(o)<ua&&Math.abs(a)<ua?n<=u[0]&&u[0]<=r&&t<=u[1]&&u[1]<=e:pr(n-u[0],o,c)&&pr(u[0]-r,-o,c)&&pr(t-u[1],a,c)&&pr(u[1]-e,-a,c)?(c[1]<1&&(i[0]=u[0]+c[1]*o,i[1]=u[1]+c[1]*a),c[0]>0&&(u[0]+=c[0]*o,u[1]+=c[0]*a),!0):!1}return function(c){function l(i){var o=u(i,-1),a=s([0===o||3===o?n:r,o>1?e:t]);return a}function s(n){for(var t=0,r=M.length,e=n[1],u=0;r>u;++u)for(var i,o=1,a=M[u],c=a.length,l=a[0];c>o;++o)i=a[o],l[1]<=e?i[1]>e&&f(l,i,n)>0&&++t:i[1]<=e&&f(l,i,n)<0&&--t,l=i;return 0!==t}function f(n,t,r){return(t[0]-n[0])*(r[1]-n[1])-(r[0]-n[0])*(t[1]-n[1])}function h(i,a,c,l){var s=0,f=0;if(null==i||(s=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do l.point(0===s||3===s?n:r,s>1?e:t);while((s=(s+c+4)%4)!==f)}else l.point(a[0],a[1])}function g(u,i){return u>=n&&r>=u&&i>=t&&e>=i}function p(n,t){g(n,t)&&c.point(n,t)}function d(){q.point=m,M&&M.push(x=[]),A=!0,k=!1,S=E=0/0}function v(){y&&(m(b,_),w&&k&&T.rejoin(),y.push(T.buffer())),q.point=p,k&&c.lineEnd()}function m(n,t){n=Math.max(-ic,Math.min(ic,n)),t=Math.max(-ic,Math.min(ic,t));var r=g(n,t);if(M&&x.push([n,t]),A)b=n,_=t,w=r,A=!1,r&&(c.lineStart(),c.point(n,t));else if(r&&k)c.point(n,t);else{var e=[S,E],u=[n,t];a(e,u)?(k||(c.lineStart(),c.point(e[0],e[1])),c.point(u[0],u[1]),r||c.lineEnd()):r&&(c.lineStart(),c.point(n,t))}S=n,E=t,k=r}var y,M,x,b,_,w,S,E,k,A,N=c,T=Kt(),q={point:p,lineStart:d,lineEnd:v,polygonStart:function(){c=T,y=[],M=[]},polygonEnd:function(){c=N,(y=ko.merge(y)).length?(c.polygonStart(),Bt(y,i,l,h,c),c.polygonEnd()):s([n,t])&&(c.polygonStart(),c.lineStart(),h(null,null,1,c),c.lineEnd(),c.polygonEnd()),y=M=x=null}};return q}}function pr(n,t,r){if(Math.abs(t)<ua)return 0>=n;var e=n/t;if(t>0){if(e>r[1])return!1;e>r[0]&&(r[0]=e)}else{if(e<r[0])return!1;e<r[1]&&(r[1]=e)}return!0}function dr(n,t){function r(r,e){return r=n(r,e),t(r[0],r[1])}return n.invert&&t.invert&&(r.invert=function(r,e){return r=t.invert(r,e),r&&n.invert(r[0],r[1])}),r}function vr(n){var t=0,r=ea/3,e=zr(n),u=e(t,r);return u.parallels=function(n){return arguments.length?e(t=n[0]*ea/180,r=n[1]*ea/180):[180*(t/ea),180*(r/ea)]},u}function mr(n,t){function r(n,t){var r=Math.sqrt(i-2*u*Math.sin(t))/u;return[r*Math.sin(n*=u),o-r*Math.cos(n)]}var e=Math.sin(n),u=(e+Math.sin(t))/2,i=1+e*(2*u-e),o=Math.sqrt(i)/u;return r.invert=function(n,t){var r=o-t;return[Math.atan2(n,r)/u,O((i-(n*n+r*r)*u*u)/(2*u))]},r}function yr(){function n(n,t){ac+=u*n-e*t,e=n,u=t}var t,r,e,u;hc.point=function(i,o){hc.point=n,t=e=i,r=u=o},hc.lineEnd=function(){n(t,r)}}function Mr(n,t){cc>n&&(cc=n),n>sc&&(sc=n),lc>t&&(lc=t),t>fc&&(fc=t)}function xr(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=r}function r(n,t){o.push("L",n,",",t)}function e(){a.point=n}function u(){o.push("Z")}var i=br(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:e,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=e,a.point=n},pointRadius:function(n){return i=br(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function br(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function _r(n,t){Xa+=n,$a+=t,++Ba}function wr(){function n(n,e){var u=n-t,i=e-r,o=Math.sqrt(u*u+i*i);Wa+=o*(t+n)/2,Ja+=o*(r+e)/2,Ga+=o,_r(t=n,r=e)}var t,r;pc.point=function(e,u){pc.point=n,_r(t=e,r=u)}}function Sr(){pc.point=_r}function Er(){function n(n,t){var r=n-e,i=t-u,o=Math.sqrt(r*r+i*i);Wa+=o*(e+n)/2,Ja+=o*(u+t)/2,Ga+=o,o=u*n-e*t,Ka+=o*(e+n),Qa+=o*(u+t),nc+=3*o,_r(e=n,u=t)}var t,r,e,u;pc.point=function(i,o){pc.point=n,_r(t=e=i,r=u=o)},pc.lineEnd=function(){n(t,r)}}function kr(n){function t(t,r){n.moveTo(t,r),n.arc(t,r,o,0,2*ea)}function r(t,r){n.moveTo(t,r),a.point=e}function e(t,r){n.lineTo(t,r)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=r},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:c};return a}function Ar(n){function t(t){function e(r,e){r=n(r,e),t.point(r[0],r[1])}function u(){M=0/0,S.point=o,t.lineStart()}function o(e,u){var o=Ct([e,u]),a=n(e,u);r(M,x,y,b,_,w,M=a[0],x=a[1],y=e,b=o[0],_=o[1],w=o[2],i,t),t.point(M,x)}function a(){S.point=e,t.lineEnd()}function c(){u(),S.point=l,S.lineEnd=s}function l(n,t){o(f=n,h=t),g=M,p=x,d=b,v=_,m=w,S.point=o}function s(){r(M,x,y,b,_,w,g,p,f,d,v,m,i,t),S.lineEnd=a,a()}var f,h,g,p,d,v,m,y,M,x,b,_,w,S={point:e,lineStart:u,lineEnd:a,polygonStart:function(){t.polygonStart(),S.lineStart=c},polygonEnd:function(){t.polygonEnd(),S.lineStart=u}};return S}function r(t,i,o,a,c,l,s,f,h,g,p,d,v,m){var y=s-t,M=f-i,x=y*y+M*M;if(x>4*e&&v--){var b=a+g,_=c+p,w=l+d,S=Math.sqrt(b*b+_*_+w*w),E=Math.asin(w/=S),k=Math.abs(Math.abs(w)-1)<ua?(o+h)/2:Math.atan2(_,b),A=n(k,E),N=A[0],T=A[1],q=N-t,z=T-i,C=M*q-y*z;(C*C/x>e||Math.abs((y*q+M*z)/x-.5)>.3||u>a*g+c*p+l*d)&&(r(t,i,o,a,c,l,N,T,k,b/=S,_/=S,w,v,m),m.point(N,T),r(N,T,k,b,_,w,s,f,h,g,p,d,v,m))}}var e=.5,u=Math.cos(30*oa),i=16;return t.precision=function(n){return arguments.length?(i=(e=n*n)>0&&16,t):Math.sqrt(e)},t}function Nr(n){this.stream=n}function Tr(n){var t=Ar(function(t,r){return n([t*aa,r*aa])});return function(n){var r=new Nr(n=t(n));return r.point=function(t,r){n.point(t*oa,r*oa)},r}}function qr(n){return zr(function(){return n})()}function zr(n){function t(n){return n=a(n[0]*oa,n[1]*oa),[n[0]*h+c,l-n[1]*h]}function r(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*aa,n[1]*aa]}function e(){a=dr(o=jr(m,y,M),i);var n=i(d,v);return c=g-n[0]*h,l=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,c,l,s,f=Ar(function(n,t){return n=i(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,g=480,p=250,d=0,v=0,m=0,y=0,M=0,x=rc,b=dt,_=null,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=Cr(o,x(f(b(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(x=null==n?(_=n,rc):or((_=+n)*oa),u()):_},t.clipExtent=function(n){return arguments.length?(S=n,b=n?gr(n[0][0],n[0][1],n[1][0],n[1][1]):dt,u()):S},t.scale=function(n){return arguments.length?(h=+n,e()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],e()):[g,p]},t.center=function(n){return arguments.length?(d=n[0]%360*oa,v=n[1]%360*oa,e()):[d*aa,v*aa]},t.rotate=function(n){return arguments.length?(m=n[0]%360*oa,y=n[1]%360*oa,M=n.length>2?n[2]%360*oa:0,e()):[m*aa,y*aa,M*aa]},ko.rebind(t,f,"precision"),t.clipPolygon=function(n){return arguments.length?(_=null,w=n,x=null==n?rc:sr(n),e()):w},function(){return i=n.apply(this,arguments),t.invert=i.invert&&r,e()}}function Cr(n,t){var r=new Nr(t);return r.point=function(r,e){e=n(r*oa,e*oa),r=e[0],t.point(r>ea?r-2*ea:-ea>r?r+2*ea:r,e[1])},r}function Dr(n,t){return[n,t]}function jr(n,t,r){return n?t||r?dr(Hr(n),Pr(t,r)):Hr(n):t||r?Pr(t,r):Dr}function Lr(n){return function(t,r){return t+=n,[t>ea?t-2*ea:-ea>t?t+2*ea:t,r]}}function Hr(n){var t=Lr(n);return t.invert=Lr(-n),t}function Pr(n,t){function r(n,t){var r=Math.cos(t),a=Math.cos(n)*r,c=Math.sin(n)*r,l=Math.sin(t),s=l*e+a*u;return[Math.atan2(c*i-s*o,a*e-l*u),O(s*i+c*o)]}var e=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return r.invert=function(n,t){var r=Math.cos(t),a=Math.cos(n)*r,c=Math.sin(n)*r,l=Math.sin(t),s=l*i-c*o;return[Math.atan2(c*i+l*o,a*e+s*u),O(s*e-a*u)]},r}function Fr(n,t){var r=Math.cos(n),e=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=Or(r,u),i=Or(r,i),(o>0?i>u:u>i)&&(u+=2*o*ea)):(u=n+2*o*ea,i=n-.5*c);for(var l,s=u;o>0?s>i:i>s;s-=c)a.point((l=Ot([r,-e*Math.cos(s),-e*Math.sin(s)]))[0],l[1])}}function Or(n,t){var r=Ct(t);r[0]-=n,Pt(r);var e=F(-r[1]);return((-r[2]<0?-e:e)+2*Math.PI-ua)%(2*Math.PI)}function Rr(n,t,r){var e=ko.range(n,t-ua,r).concat(t);return function(n){return e.map(function(t){return[n,t]})}}function Ir(n,t,r){var e=ko.range(n,t-ua,r).concat(t);return function(n){return e.map(function(t){return[t,n]})}}function Yr(n){return n.source}function Ur(n){return n.target}function Zr(n,t,r,e){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(e),a=Math.sin(e),c=u*Math.cos(n),l=u*Math.sin(n),s=o*Math.cos(r),f=o*Math.sin(r),h=2*Math.asin(Math.sqrt(U(e-t)+u*o*U(r-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,r=Math.sin(h-n)*g,e=r*c+t*s,u=r*l+t*f,o=r*i+t*a;return[Math.atan2(u,e)*aa,Math.atan2(o,Math.sqrt(e*e+u*u))*aa]}:function(){return[n*aa,t*aa]};return p.distance=h,p}function Vr(){function n(n,u){var i=Math.sin(u*=oa),o=Math.cos(u),a=Math.abs((n*=oa)-t),c=Math.cos(a);dc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=e*i-r*o*c)*a),r*i+e*o*c),t=n,r=i,e=o}var t,r,e;vc.point=function(u,i){t=u*oa,r=Math.sin(i*=oa),e=Math.cos(i),vc.point=n},vc.lineEnd=function(){vc.point=vc.lineEnd=c}}function Xr(n,t){function r(t,r){var e=Math.cos(t),u=Math.cos(r),i=n(e*u);return[i*u*Math.sin(t),i*Math.sin(r)]}return r.invert=function(n,r){var e=Math.sqrt(n*n+r*r),u=t(e),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,e*o),Math.asin(e&&r*i/e)]},r}function $r(n,t){function r(n,t){var r=Math.abs(Math.abs(t)-ea/2)<ua?0:o/Math.pow(u(t),i);return[r*Math.sin(i*n),o-r*Math.cos(i*n)]}var e=Math.cos(n),u=function(n){return Math.tan(ea/4+n/2)},i=n===t?Math.sin(n):Math.log(e/Math.cos(t))/Math.log(u(t)/u(n)),o=e*Math.pow(u(n),i)/i;return i?(r.invert=function(n,t){var r=o-t,e=P(i)*Math.sqrt(n*n+r*r);return[Math.atan2(n,r)/i,2*Math.atan(Math.pow(o/e,1/i))-ea/2]},r):Wr}function Br(n,t){function r(n,t){var r=i-t;return[r*Math.sin(u*n),i-r*Math.cos(u*n)]}var e=Math.cos(n),u=n===t?Math.sin(n):(e-Math.cos(t))/(t-n),i=e/u+n;return Math.abs(u)<ua?Dr:(r.invert=function(n,t){var r=i-t;return[Math.atan2(n,r)/u,i-P(u)*Math.sqrt(n*n+r*r)]},r)}function Wr(n,t){return[n,Math.log(Math.tan(ea/4+t/2))]}function Jr(n){var t,r=qr(n),e=r.scale,u=r.translate,i=r.clipExtent;return r.scale=function(){var n=e.apply(r,arguments);return n===r?t?r.clipExtent(null):r:n},r.translate=function(){var n=u.apply(r,arguments);return n===r?t?r.clipExtent(null):r:n},r.clipExtent=function(n){var o=i.apply(r,arguments);if(o===r){if(t=null==n){var a=ea*e(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},r.clipExtent(null)}function Gr(n,t){var r=Math.cos(t)*Math.sin(n);return[Math.log((1+r)/(1-r))/2,Math.atan2(Math.tan(t),Math.cos(n))]}function Kr(n){function t(t){function o(){l.push("M",i(n(s),a))}for(var c,l=[],s=[],f=-1,h=t.length,g=pt(r),p=pt(e);++f<h;)u.call(this,c=t[f],f)?s.push([+g.call(this,c,f),+p.call(this,c,f)]):s.length&&(o(),s=[]);return s.length&&o(),l.length?l.join(""):null}var r=Qr,e=ne,u=$t,i=te,o=i.key,a=.7;return t.x=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(e=n,t):e},t.defined=function(n){return arguments.length?(u=n,t):u
},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=_c.get(n)||te).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function Qr(n){return n[0]}function ne(n){return n[1]}function te(n){return n.join("L")}function re(n){return te(n)+"Z"}function ee(n){for(var t=0,r=n.length,e=n[0],u=[e[0],",",e[1]];++t<r;)u.push("H",(e[0]+(e=n[t])[0])/2,"V",e[1]);return r>1&&u.push("H",e[0]),u.join("")}function ue(n){for(var t=0,r=n.length,e=n[0],u=[e[0],",",e[1]];++t<r;)u.push("V",(e=n[t])[1],"H",e[0]);return u.join("")}function ie(n){for(var t=0,r=n.length,e=n[0],u=[e[0],",",e[1]];++t<r;)u.push("H",(e=n[t])[0],"V",e[1]);return u.join("")}function oe(n,t){return n.length<4?te(n):n[1]+le(n.slice(1,n.length-1),se(n,t))}function ae(n,t){return n.length<3?te(n):n[0]+le((n.push(n[0]),n),se([n[n.length-2]].concat(n,[n[1]]),t))}function ce(n,t){return n.length<3?te(n):n[0]+le(n,se(n,t))}function le(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return te(n);var r=n.length!=t.length,e="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(r&&(e+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,e+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var l=2;l<t.length;l++,c++)i=n[c],a=t[l],e+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(r){var s=n[c];e+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+s[0]+","+s[1]}return e}function se(n,t){for(var r,e=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;++a<c;)r=i,i=o,o=n[a],e.push([u*(o[0]-r[0]),u*(o[1]-r[1])]);return e}function fe(n){if(n.length<3)return te(n);var t=1,r=n.length,e=n[0],u=e[0],i=e[1],o=[u,u,u,(e=n[1])[0]],a=[i,i,i,e[1]],c=[u,",",i,"L",de(Ec,o),",",de(Ec,a)];for(n.push(n[r-1]);++t<=r;)e=n[t],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),ve(c,o,a);return n.pop(),c.push("L",e),c.join("")}function he(n){if(n.length<4)return te(n);for(var t,r=[],e=-1,u=n.length,i=[0],o=[0];++e<3;)t=n[e],i.push(t[0]),o.push(t[1]);for(r.push(de(Ec,i)+","+de(Ec,o)),--e;++e<u;)t=n[e],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),ve(r,i,o);return r.join("")}function ge(n){for(var t,r,e=-1,u=n.length,i=u+4,o=[],a=[];++e<4;)r=n[e%u],o.push(r[0]),a.push(r[1]);for(t=[de(Ec,o),",",de(Ec,a)],--e;++e<i;)r=n[e%u],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),ve(t,o,a);return t.join("")}function pe(n,t){var r=n.length-1;if(r)for(var e,u,i=n[0][0],o=n[0][1],a=n[r][0]-i,c=n[r][1]-o,l=-1;++l<=r;)e=n[l],u=l/r,e[0]=t*e[0]+(1-t)*(i+u*a),e[1]=t*e[1]+(1-t)*(o+u*c);return fe(n)}function de(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function ve(n,t,r){n.push("C",de(wc,t),",",de(wc,r),",",de(Sc,t),",",de(Sc,r),",",de(Ec,t),",",de(Ec,r))}function me(n,t){return(t[1]-n[1])/(t[0]-n[0])}function ye(n){for(var t=0,r=n.length-1,e=[],u=n[0],i=n[1],o=e[0]=me(u,i);++t<r;)e[t]=(o+(o=me(u=i,i=n[t+1])))/2;return e[t]=o,e}function Me(n){for(var t,r,e,u,i=[],o=ye(n),a=-1,c=n.length-1;++a<c;)t=me(n[a],n[a+1]),Math.abs(t)<1e-6?o[a]=o[a+1]=0:(r=o[a]/t,e=o[a+1]/t,u=r*r+e*e,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*r,o[a+1]=u*e));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function xe(n){return n.length<3?te(n):n[0]+le(n,Me(n))}function be(n,t,r,e){var u,i,o,a,c,l,s;return u=e[n],i=u[0],o=u[1],u=e[t],a=u[0],c=u[1],u=e[r],l=u[0],s=u[1],(s-o)*(a-i)-(c-o)*(l-i)>0}function _e(n,t,r){return(r[0]-t[0])*(n[1]-t[1])<(r[1]-t[1])*(n[0]-t[0])}function we(n,t,r,e){var u=n[0],i=r[0],o=t[0]-u,a=e[0]-i,c=n[1],l=r[1],s=t[1]-c,f=e[1]-l,h=(a*(c-l)-f*(u-i))/(f*o-a*s);return[u+h*o,c+h*s]}function Se(n){var t=n[0],r=n[n.length-1];return!(t[0]-r[0]||t[1]-r[1])}function Ee(n,t){var r={list:n.map(function(n,t){return{index:t,x:n[0],y:n[1]}}).sort(function(n,t){return n.y<t.y?-1:n.y>t.y?1:n.x<t.x?-1:n.x>t.x?1:0}),bottomSite:null},e={list:[],leftEnd:null,rightEnd:null,init:function(){e.leftEnd=e.createHalfEdge(null,"l"),e.rightEnd=e.createHalfEdge(null,"l"),e.leftEnd.r=e.rightEnd,e.rightEnd.l=e.leftEnd,e.list.unshift(e.leftEnd,e.rightEnd)},createHalfEdge:function(n,t){return{edge:n,side:t,vertex:null,l:null,r:null}},insert:function(n,t){t.l=n,t.r=n.r,n.r.l=t,n.r=t},leftBound:function(n){var t=e.leftEnd;do t=t.r;while(t!=e.rightEnd&&u.rightOf(t,n));return t=t.l},del:function(n){n.l.r=n.r,n.r.l=n.l,n.edge=null},right:function(n){return n.r},left:function(n){return n.l},leftRegion:function(n){return null==n.edge?r.bottomSite:n.edge.region[n.side]},rightRegion:function(n){return null==n.edge?r.bottomSite:n.edge.region[Ac[n.side]]}},u={bisect:function(n,t){var r={region:{l:n,r:t},ep:{l:null,r:null}},e=t.x-n.x,u=t.y-n.y,i=e>0?e:-e,o=u>0?u:-u;return r.c=n.x*e+n.y*u+.5*(e*e+u*u),i>o?(r.a=1,r.b=u/e,r.c/=e):(r.b=1,r.a=e/u,r.c/=u),r},intersect:function(n,t){var r=n.edge,e=t.edge;if(!r||!e||r.region.r==e.region.r)return null;var u=r.a*e.b-r.b*e.a;if(Math.abs(u)<1e-10)return null;var i,o,a=(r.c*e.b-e.c*r.b)/u,c=(e.c*r.a-r.c*e.a)/u,l=r.region.r,s=e.region.r;l.y<s.y||l.y==s.y&&l.x<s.x?(i=n,o=r):(i=t,o=e);var f=a>=o.region.r.x;return f&&"l"===i.side||!f&&"r"===i.side?null:{x:a,y:c}},rightOf:function(n,t){var r=n.edge,e=r.region.r,u=t.x>e.x;if(u&&"l"===n.side)return 1;if(!u&&"r"===n.side)return 0;if(1===r.a){var i=t.y-e.y,o=t.x-e.x,a=0,c=0;if(!u&&r.b<0||u&&r.b>=0?c=a=i>=r.b*o:(c=t.x+t.y*r.b>r.c,r.b<0&&(c=!c),c||(a=1)),!a){var l=e.x-r.region.l.x;c=r.b*(o*o-i*i)<l*i*(1+2*o/l+r.b*r.b),r.b<0&&(c=!c)}}else{var s=r.c-r.a*t.x,f=t.y-s,h=t.x-e.x,g=s-e.y;c=f*f>h*h+g*g}return"l"===n.side?c:!c},endPoint:function(n,r,e){n.ep[r]=e,n.ep[Ac[r]]&&t(n)},distance:function(n,t){var r=n.x-t.x,e=n.y-t.y;return Math.sqrt(r*r+e*e)}},i={list:[],insert:function(n,t,r){n.vertex=t,n.ystar=t.y+r;for(var e=0,u=i.list,o=u.length;o>e;e++){var a=u[e];if(!(n.ystar>a.ystar||n.ystar==a.ystar&&t.x>a.vertex.x))break}u.splice(e,0,n)},del:function(n){for(var t=0,r=i.list,e=r.length;e>t&&r[t]!=n;++t);r.splice(t,1)},empty:function(){return 0===i.list.length},nextEvent:function(n){for(var t=0,r=i.list,e=r.length;e>t;++t)if(r[t]==n)return r[t+1];return null},min:function(){var n=i.list[0];return{x:n.vertex.x,y:n.ystar}},extractMin:function(){return i.list.shift()}};e.init(),r.bottomSite=r.list.shift();for(var o,a,c,l,s,f,h,g,p,d,v,m,y,M=r.list.shift();;)if(i.empty()||(o=i.min()),M&&(i.empty()||M.y<o.y||M.y==o.y&&M.x<o.x))a=e.leftBound(M),c=e.right(a),h=e.rightRegion(a),m=u.bisect(h,M),f=e.createHalfEdge(m,"l"),e.insert(a,f),d=u.intersect(a,f),d&&(i.del(a),i.insert(a,d,u.distance(d,M))),a=f,f=e.createHalfEdge(m,"r"),e.insert(a,f),d=u.intersect(f,c),d&&i.insert(f,d,u.distance(d,M)),M=r.list.shift();else{if(i.empty())break;a=i.extractMin(),l=e.left(a),c=e.right(a),s=e.right(c),h=e.leftRegion(a),g=e.rightRegion(c),v=a.vertex,u.endPoint(a.edge,a.side,v),u.endPoint(c.edge,c.side,v),e.del(a),i.del(c),e.del(c),y="l",h.y>g.y&&(p=h,h=g,g=p,y="r"),m=u.bisect(h,g),f=e.createHalfEdge(m,y),e.insert(l,f),u.endPoint(m,Ac[y],v),d=u.intersect(l,f),d&&(i.del(l),i.insert(l,d,u.distance(d,h))),d=u.intersect(f,s),d&&i.insert(f,d,u.distance(d,h))}for(a=e.right(e.leftEnd);a!=e.rightEnd;a=e.right(a))t(a.edge)}function ke(n){return n.x}function Ae(n){return n.y}function Ne(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function Te(n,t,r,e,u,i){if(!n(t,r,e,u,i)){var o=.5*(r+u),a=.5*(e+i),c=t.nodes;c[0]&&Te(n,c[0],r,e,o,a),c[1]&&Te(n,c[1],o,e,u,a),c[2]&&Te(n,c[2],r,a,o,i),c[3]&&Te(n,c[3],o,a,u,i)}}function qe(n,t){n=ko.rgb(n),t=ko.rgb(t);var r=n.r,e=n.g,u=n.b,i=t.r-r,o=t.g-e,a=t.b-u;return function(n){return"#"+ct(Math.round(r+i*n))+ct(Math.round(e+o*n))+ct(Math.round(u+a*n))}}function ze(n,t){var r,e={},u={};for(r in n)r in t?e[r]=je(n[r],t[r]):u[r]=n[r];for(r in t)r in n||(u[r]=t[r]);return function(n){for(r in e)u[r]=e[r](n);return u}}function Ce(n,t){return t-=n=+n,function(r){return n+t*r}}function De(n,t){var r,e,u,i,o,a=0,c=0,l=[],s=[];for(n+="",t+="",Nc.lastIndex=0,e=0;r=Nc.exec(t);++e)r.index&&l.push(t.substring(a,c=r.index)),s.push({i:l.length,x:r[0]}),l.push(null),a=Nc.lastIndex;for(a<t.length&&l.push(t.substring(a)),e=0,i=s.length;(r=Nc.exec(n))&&i>e;++e)if(o=s[e],o.x==r[0]){if(o.i)if(null==l[o.i+1])for(l[o.i-1]+=o.x,l.splice(o.i,1),u=e+1;i>u;++u)s[u].i--;else for(l[o.i-1]+=o.x+l[o.i+1],l.splice(o.i,2),u=e+1;i>u;++u)s[u].i-=2;else if(null==l[o.i+1])l[o.i]=o.x;else for(l[o.i]=o.x+l[o.i+1],l.splice(o.i+1,1),u=e+1;i>u;++u)s[u].i--;s.splice(e,1),i--,e--}else o.x=Ce(parseFloat(r[0]),parseFloat(o.x));for(;i>e;)o=s.pop(),null==l[o.i+1]?l[o.i]=o.x:(l[o.i]=o.x+l[o.i+1],l.splice(o.i+1,1)),i--;return 1===l.length?null==l[0]?(o=s[0].x,function(n){return o(n)+""}):function(){return t}:function(n){for(e=0;i>e;++e)l[(o=s[e]).i]=o.x(n);return l.join("")}}function je(n,t){for(var r,e=ko.interpolators.length;--e>=0&&!(r=ko.interpolators[e](n,t)););return r}function Le(n,t){var r,e=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(r=0;a>r;++r)e.push(je(n[r],t[r]));for(;i>r;++r)u[r]=n[r];for(;o>r;++r)u[r]=t[r];return function(n){for(r=0;a>r;++r)u[r]=e[r](n);return u}}function He(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function Pe(n){return function(t){return 1-n(1-t)}}function Fe(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Oe(n){return n*n}function Re(n){return n*n*n}function Ie(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,r=t*n;return 4*(.5>n?r:3*(n-t)+r-.75)}function Ye(n){return function(t){return Math.pow(t,n)}}function Ue(n){return 1-Math.cos(n*ea/2)}function Ze(n){return Math.pow(2,10*(n-1))}function Ve(n){return 1-Math.sqrt(1-n*n)}function Xe(n,t){var r;return arguments.length<2&&(t=.45),arguments.length?r=t/(2*ea)*Math.asin(1/n):(n=1,r=t/4),function(e){return 1+n*Math.pow(2,10*-e)*Math.sin(2*(e-r)*ea/t)}}function $e(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Be(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function We(n,t){n=ko.hcl(n),t=ko.hcl(t);var r=n.h,e=n.c,u=n.l,i=t.h-r,o=t.c-e,a=t.l-u;return isNaN(o)&&(o=0,e=isNaN(e)?t.c:e),isNaN(i)?(i=0,r=isNaN(r)?t.h:r):i>180?i-=360:-180>i&&(i+=360),function(n){return J(r+i*n,e+o*n,u+a*n)+""}}function Je(n,t){n=ko.hsl(n),t=ko.hsl(t);var r=n.h,e=n.s,u=n.l,i=t.h-r,o=t.s-e,a=t.l-u;return isNaN(o)&&(o=0,e=isNaN(e)?t.s:e),isNaN(i)?(i=0,r=isNaN(r)?t.h:r):i>180?i-=360:-180>i&&(i+=360),function(n){return $(r+i*n,e+o*n,u+a*n)+""}}function Ge(n,t){n=ko.lab(n),t=ko.lab(t);var r=n.l,e=n.a,u=n.b,i=t.l-r,o=t.a-e,a=t.b-u;return function(n){return Q(r+i*n,e+o*n,u+a*n)+""}}function Ke(n,t){return t-=n,function(r){return Math.round(n+t*r)}}function Qe(n){var t=[n.a,n.b],r=[n.c,n.d],e=tu(t),u=nu(t,r),i=tu(ru(r,t,-u))||0;t[0]*r[1]<r[0]*t[1]&&(t[0]*=-1,t[1]*=-1,e*=-1,u*=-1),this.rotate=(e?Math.atan2(t[1],t[0]):Math.atan2(-r[0],r[1]))*aa,this.translate=[n.e,n.f],this.scale=[e,i],this.skew=i?Math.atan2(u,i)*aa:0}function nu(n,t){return n[0]*t[0]+n[1]*t[1]}function tu(n){var t=Math.sqrt(nu(n,n));return t&&(n[0]/=t,n[1]/=t),t}function ru(n,t,r){return n[0]+=r*t[0],n[1]+=r*t[1],n}function eu(n,t){var r,e=[],u=[],i=ko.transform(n),o=ko.transform(t),a=i.translate,c=o.translate,l=i.rotate,s=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(e.push("translate(",null,",",null,")"),u.push({i:1,x:Ce(a[0],c[0])},{i:3,x:Ce(a[1],c[1])})):c[0]||c[1]?e.push("translate("+c+")"):e.push(""),l!=s?(l-s>180?s+=360:s-l>180&&(l+=360),u.push({i:e.push(e.pop()+"rotate(",null,")")-2,x:Ce(l,s)})):s&&e.push(e.pop()+"rotate("+s+")"),f!=h?u.push({i:e.push(e.pop()+"skewX(",null,")")-2,x:Ce(f,h)}):h&&e.push(e.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(r=e.push(e.pop()+"scale(",null,",",null,")"),u.push({i:r-4,x:Ce(g[0],p[0])},{i:r-2,x:Ce(g[1],p[1])})):(1!=p[0]||1!=p[1])&&e.push(e.pop()+"scale("+p+")"),r=u.length,function(n){for(var t,i=-1;++i<r;)e[(t=u[i]).i]=t.x(n);return e.join("")}}function uu(n,t){return t=t-(n=+n)?1/(t-n):0,function(r){return(r-n)*t}}function iu(n,t){return t=t-(n=+n)?1/(t-n):0,function(r){return Math.max(0,Math.min(1,(r-n)*t))}}function ou(n){for(var t=n.source,r=n.target,e=cu(t,r),u=[t];t!==e;)t=t.parent,u.push(t);for(var i=u.length;r!==e;)u.splice(i,0,r),r=r.parent;return u}function au(n){for(var t=[],r=n.parent;null!=r;)t.push(n),n=r,r=r.parent;return t.push(n),t}function cu(n,t){if(n===t)return n;for(var r=au(n),e=au(t),u=r.pop(),i=e.pop(),o=null;u===i;)o=u,u=r.pop(),i=e.pop();return o}function lu(n){n.fixed|=2}function su(n){n.fixed&=-7}function fu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function hu(n){n.fixed&=-5}function gu(n,t,r){var e=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;++c<a;)i=o[c],null!=i&&(gu(i,t,r),n.charge+=i.charge,e+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var l=t*r[n.point.index];n.charge+=n.pointCharge=l,e+=l*n.point.x,u+=l*n.point.y}n.cx=e/n.charge,n.cy=u/n.charge}function pu(n,t){return ko.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=yu,n}function du(n){return n.children}function vu(n){return n.value}function mu(n,t){return t.value-n.value}function yu(n){return ko.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function Mu(n){return n.x}function xu(n){return n.y}function bu(n,t,r){n.y0=t,n.y=r}function _u(n){return ko.range(n.length)}function wu(n){for(var t=-1,r=n[0].length,e=[];++t<r;)e[t]=0;return e}function Su(n){for(var t,r=1,e=0,u=n[0][1],i=n.length;i>r;++r)(t=n[r][1])>u&&(e=r,u=t);return e}function Eu(n){return n.reduce(ku,0)}function ku(n,t){return n+t[1]}function Au(n,t){return Nu(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Nu(n,t){for(var r=-1,e=+n[0],u=(n[1]-e)/t,i=[];++r<=t;)i[r]=u*r+e;return i}function Tu(n){return[ko.min(n),ko.max(n)]}function qu(n,t){return n.parent==t.parent?1:2}function zu(n){var t=n.children;return t&&t.length?t[0]:n._tree.thread}function Cu(n){var t,r=n.children;return r&&(t=r.length)?r[t-1]:n._tree.thread}function Du(n,t){var r=n.children;if(r&&(u=r.length))for(var e,u,i=-1;++i<u;)t(e=Du(r[i],t),n)>0&&(n=e);return n}function ju(n,t){return n.x-t.x}function Lu(n,t){return t.x-n.x}function Hu(n,t){return n.depth-t.depth}function Pu(n,t){function r(n,e){var u=n.children;if(u&&(o=u.length))for(var i,o,a=null,c=-1;++c<o;)i=u[c],r(i,a),a=i;t(n,e)}r(n,null)}function Fu(n){for(var t,r=0,e=0,u=n.children,i=u.length;--i>=0;)t=u[i]._tree,t.prelim+=r,t.mod+=r,r+=t.shift+(e+=t.change)}function Ou(n,t,r){n=n._tree,t=t._tree;var e=r/(t.number-n.number);n.change+=e,t.change-=e,t.shift+=r,t.prelim+=r,t.mod+=r}function Ru(n,t,r){return n._tree.ancestor.parent==t.parent?n._tree.ancestor:r}function Iu(n,t){return n.value-t.value}function Yu(n,t){var r=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=r,r._pack_prev=t}function Uu(n,t){n._pack_next=t,t._pack_prev=n}function Zu(n,t){var r=t.x-n.x,e=t.y-n.y,u=n.r+t.r;return.999*u*u>r*r+e*e}function Vu(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((r=n.children)&&(l=r.length)){var r,e,u,i,o,a,c,l,s=1/0,f=-1/0,h=1/0,g=-1/0;if(r.forEach(Xu),e=r[0],e.x=-e.r,e.y=0,t(e),l>1&&(u=r[1],u.x=u.r,u.y=0,t(u),l>2))for(i=r[2],Wu(e,u,i),t(i),Yu(e,i),e._pack_prev=i,Yu(i,u),u=e._pack_next,o=3;l>o;o++){Wu(e,u,i=r[o]);var p=0,d=1,v=1;for(a=u._pack_next;a!==u;a=a._pack_next,d++)if(Zu(a,i)){p=1;break}if(1==p)for(c=e._pack_prev;c!==a._pack_prev&&!Zu(c,i);c=c._pack_prev,v++);p?(v>d||d==v&&u.r<e.r?Uu(e,u=a):Uu(e=c,u),o--):(Yu(e,i),u=i,t(i))}var m=(s+f)/2,y=(h+g)/2,M=0;for(o=0;l>o;o++)i=r[o],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,r.forEach($u)}}function Xu(n){n._pack_next=n._pack_prev=n}function $u(n){delete n._pack_next,delete n._pack_prev}function Bu(n,t,r,e){var u=n.children;if(n.x=t+=e*n.x,n.y=r+=e*n.y,n.r*=e,u)for(var i=-1,o=u.length;++i<o;)Bu(u[i],t,r,e)}function Wu(n,t,r){var e=n.r+r.r,u=t.x-n.x,i=t.y-n.y;if(e&&(u||i)){var o=t.r+r.r,a=u*u+i*i;o*=o,e*=e;var c=.5+(e-o)/(2*a),l=Math.sqrt(Math.max(0,2*o*(e+a)-(e-=a)*e-o*o))/(2*a);r.x=n.x+c*u+l*i,r.y=n.y+c*i-l*u}else r.x=n.x+e,r.y=n.y}function Ju(n){return 1+ko.max(n,function(n){return n.y})}function Gu(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Ku(n){var t=n.children;return t&&t.length?Ku(t[0]):n}function Qu(n){var t,r=n.children;return r&&(t=r.length)?Qu(r[t-1]):n}function ni(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function ti(n,t){var r=n.x+t[3],e=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(r+=u/2,u=0),0>i&&(e+=i/2,i=0),{x:r,y:e,dx:u,dy:i}}function ri(n){var t=n[0],r=n[n.length-1];return r>t?[t,r]:[r,t]}function ei(n){return n.rangeExtent?n.rangeExtent():ri(n.range())}function ui(n,t,r,e){var u=r(n[0],n[1]),i=e(t[0],t[1]);return function(n){return i(u(n))}}function ii(n,t){var r,e=0,u=n.length-1,i=n[e],o=n[u];return i>o&&(r=e,e=u,u=r,r=i,i=o,o=r),n[e]=t.floor(i),n[u]=t.ceil(o),n}function oi(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:Fc}function ai(n,t,r,e){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)u.push(r(n[o-1],n[o])),i.push(e(t[o-1],t[o]));return function(t){var r=ko.bisect(n,t,1,a)-1;return i[r](u[r](t))}}function ci(n,t,r,e){function u(){var u=Math.min(n.length,t.length)>2?ai:ui,c=e?iu:uu;return o=u(n,t,c,r),a=u(t,n,c,je),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Ke)},i.clamp=function(n){return arguments.length?(e=n,u()):e},i.interpolate=function(n){return arguments.length?(r=n,u()):r},i.ticks=function(t){return hi(n,t)},i.tickFormat=function(t,r){return gi(n,t,r)},i.nice=function(t){return si(n,t),u()},i.copy=function(){return ci(n,t,r,e)},u()}function li(n,t){return ko.rebind(n,t,"range","rangeRound","interpolate","clamp")}function si(n,t){return ii(n,oi(fi(n,t)[2]))}function fi(n,t){null==t&&(t=10);var r=ri(n),e=r[1]-r[0],u=Math.pow(10,Math.floor(Math.log(e/t)/Math.LN10)),i=t/e*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),r[0]=Math.ceil(r[0]/u)*u,r[1]=Math.floor(r[1]/u)*u+.5*u,r[2]=u,r}function hi(n,t){return ko.range.apply(ko,fi(n,t))}function gi(n,t,r){var e=-Math.floor(Math.log(fi(n,t)[2])/Math.LN10+.01);return ko.format(r?r.replace(ja,function(n,t,r,u,i,o,a,c,l,s){return[t,r,u,i,o,a,c,l||"."+(e-2*("%"===s)),s].join("")}):",."+e+"f")}function pi(n,t,r,e){function u(n){return(r?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return r?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(r=t[0]>=0,n.domain((e=t.map(Number)).map(u)),o):e},o.base=function(r){return arguments.length?(t=+r,n.domain(e.map(u)),o):t},o.nice=function(){var t=ii(e.map(u),r?Math:Rc);return n.domain(t),e=t.map(i),o},o.ticks=function(){var n=ri(e),o=[],a=n[0],c=n[1],l=Math.floor(u(a)),s=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(s-l)){if(r){for(;s>l;l++)for(var h=1;f>h;h++)o.push(i(l)*h);o.push(i(l))}else for(o.push(i(l));l++<s;)for(var h=f-1;h>0;h--)o.push(i(l)*h);for(l=0;o[l]<a;l++);for(s=o.length;o[s-1]>c;s--);o=o.slice(l,s)}return o},o.tickFormat=function(n,t){if(!arguments.length)return Oc;arguments.length<2?t=Oc:"function"!=typeof t&&(t=ko.format(t));var e,a=Math.max(.1,n/o.ticks().length),c=r?(e=1e-12,Math.ceil):(e=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+e))<=a?t(n):""}},o.copy=function(){return pi(n.copy(),t,r,e)},li(o,n)}function di(n,t,r){function e(t){return n(u(t))}var u=vi(t),i=vi(1/t);return e.invert=function(t){return i(n.invert(t))},e.domain=function(t){return arguments.length?(n.domain((r=t.map(Number)).map(u)),e):r},e.ticks=function(n){return hi(r,n)},e.tickFormat=function(n,t){return gi(r,n,t)},e.nice=function(n){return e.domain(si(r,n))},e.exponent=function(o){return arguments.length?(u=vi(t=o),i=vi(1/t),n.domain(r.map(u)),e):t},e.copy=function(){return di(n.copy(),t,r)},li(e,n)}function vi(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function mi(n,t){function r(t){return o[((i.get(t)||i.set(t,n.push(t)))-1)%o.length]}function e(t,r){return ko.range(n.length).map(function(n){return t+r*n})}var i,o,a;return r.domain=function(e){if(!arguments.length)return n;n=[],i=new u;for(var o,a=-1,c=e.length;++a<c;)i.has(o=e[a])||i.set(o,n.push(o));return r[t.t].apply(r,t.a)},r.range=function(n){return arguments.length?(o=n,a=0,t={t:"range",a:arguments},r):o},r.rangePoints=function(u,i){arguments.length<2&&(i=0);var c=u[0],l=u[1],s=(l-c)/(Math.max(1,n.length-1)+i);return o=e(n.length<2?(c+l)/2:c+s*i/2,s),a=0,t={t:"rangePoints",a:arguments},r},r.rangeBands=function(u,i,c){arguments.length<2&&(i=0),arguments.length<3&&(c=i);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=(f-s)/(n.length-i+2*c);return o=e(s+h*c,h),l&&o.reverse(),a=h*(1-i),t={t:"rangeBands",a:arguments},r},r.rangeRoundBands=function(u,i,c){arguments.length<2&&(i=0),arguments.length<3&&(c=i);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=Math.floor((f-s)/(n.length-i+2*c)),g=f-s-(n.length-i)*h;return o=e(s+Math.round(g/2),h),l&&o.reverse(),a=Math.round(h*(1-i)),t={t:"rangeRoundBands",a:arguments},r},r.rangeBand=function(){return a},r.rangeExtent=function(){return ri(t.a[0])},r.copy=function(){return mi(n,t)},r.domain(n)}function yi(n,t){function r(){var r=0,i=t.length;for(u=[];++r<i;)u[r-1]=ko.quantile(n,r/i);return e}function e(n){return isNaN(n=+n)?void 0:t[ko.bisect(u,n)]}var u;return e.domain=function(t){return arguments.length?(n=t.filter(function(n){return!isNaN(n)}).sort(ko.ascending),r()):n},e.range=function(n){return arguments.length?(t=n,r()):t},e.quantiles=function(){return u},e.invertExtent=function(r){return r=t.indexOf(r),0>r?[0/0,0/0]:[r>0?u[r-1]:n[0],r<u.length?u[r]:n[n.length-1]]},e.copy=function(){return yi(n,t)},r()}function Mi(n,t,r){function e(t){return r[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=r.length/(t-n),o=r.length-1,e}var i,o;return e.domain=function(r){return arguments.length?(n=+r[0],t=+r[r.length-1],u()):[n,t]},e.range=function(n){return arguments.length?(r=n,u()):r},e.invertExtent=function(t){return t=r.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},e.copy=function(){return Mi(n,t,r)},u()}function xi(n,t){function r(r){return r>=r?t[ko.bisect(n,r)]:void 0}return r.domain=function(t){return arguments.length?(n=t,r):n},r.range=function(n){return arguments.length?(t=n,r):t},r.invertExtent=function(r){return r=t.indexOf(r),[n[r-1],n[r]]},r.copy=function(){return xi(n,t)},r}function bi(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(r){return arguments.length?(n=r.map(t),t):n},t.ticks=function(t){return hi(n,t)},t.tickFormat=function(t,r){return gi(n,t,r)},t.copy=function(){return bi(n)},t}function _i(n){return n.innerRadius}function wi(n){return n.outerRadius}function Si(n){return n.startAngle}function Ei(n){return n.endAngle}function ki(n){for(var t,r,e,u=-1,i=n.length;++u<i;)t=n[u],r=t[0],e=t[1]+Vc,t[0]=r*Math.cos(e),t[1]=r*Math.sin(e);return n}function Ai(n){function t(t){function c(){d.push("M",a(n(m),f),s,l(n(v.reverse()),f),"Z")}for(var h,g,p,d=[],v=[],m=[],y=-1,M=t.length,x=pt(r),b=pt(u),_=r===e?function(){return g}:pt(e),w=u===i?function(){return p}:pt(i);++y<M;)o.call(this,h=t[y],y)?(v.push([g=+x.call(this,h,y),p=+b.call(this,h,y)]),m.push([+_.call(this,h,y),+w.call(this,h,y)])):v.length&&(c(),v=[],m=[]);return v.length&&c(),d.length?d.join(""):null}var r=Qr,e=Qr,u=0,i=ne,o=$t,a=te,c=a.key,l=a,s="L",f=.7;return t.x=function(n){return arguments.length?(r=e=n,t):e},t.x0=function(n){return arguments.length?(r=n,t):r},t.x1=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=_c.get(n)||te).key,l=a.reverse||a,s=a.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Ni(n){return n.radius}function Ti(n){return[n.x,n.y]}function qi(n){return function(){var t=n.apply(this,arguments),r=t[0],e=t[1]+Vc;return[r*Math.cos(e),r*Math.sin(e)]}}function zi(){return 64}function Ci(){return"circle"}function Di(n){var t=Math.sqrt(n/ea);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function ji(n,t){return Zo(n,Kc),n.id=t,n}function Li(n,t,r,e){var u=n.id;return N(n,"function"==typeof r?function(n,i,o){n.__transition__[u].tween.set(t,e(r.call(n,n.__data__,i,o)))}:(r=e(r),function(n){n.__transition__[u].tween.set(t,r)}))}function Hi(n){return null==n&&(n=""),function(){this.textContent=n}}function Pi(n,t,r,e){var i=n.__transition__||(n.__transition__={active:0,count:0}),o=i[r];if(!o){var a=e.time;o=i[r]={tween:new u,time:a,ease:e.ease,delay:e.delay,duration:e.duration},++i.count,ko.timer(function(e){function u(e){return i.active>r?l():(i.active=r,o.event&&o.event.start.call(n,s,t),o.tween.forEach(function(r,e){(e=e.call(n,s,t))&&p.push(e)}),c(e)?1:(xt(c,0,a),void 0))}function c(e){if(i.active!==r)return l();for(var u=(e-h)/g,a=f(u),c=p.length;c>0;)p[--c].call(n,a);return u>=1?(o.event&&o.event.end.call(n,s,t),l()):void 0}function l(){return--i.count?delete i[r]:delete n.__transition__,1}var s=n.__data__,f=o.ease,h=o.delay,g=o.duration,p=[];return e>=h?u(e):(xt(u,h,a),void 0)},0,a)}}function Fi(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function Oi(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function Ri(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ii(n,t,r){function e(t){var r=n(t),e=i(r,1);return e-t>t-r?r:e}function u(r){return t(r=n(new il(r-1)),1),r}function i(n,r){return t(n=new il(+n),r),n}function o(n,e,i){var o=u(n),a=[];if(i>1)for(;e>o;)r(o)%i||a.push(new Date(+o)),t(o,1);else for(;e>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,r){try{il=Ri;var e=new Ri;return e._=n,o(e,t,r)}finally{il=Date}}n.floor=n,n.round=e,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Yi(n);return c.floor=c,c.round=Yi(e),c.ceil=Yi(u),c.offset=Yi(i),c.range=a,n}function Yi(n){return function(t,r){try{il=Ri;var e=new Ri;return e._=t,n(e,r)._}finally{il=Date}}}function Ui(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.substring(c,a)),null!=(u=Sl[e=n.charAt(++a)])&&(e=n.charAt(++a)),(i=El[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),o.push(e),c=a+1);return o.push(n.substring(c,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},e=Zi(r,n,t,0);if(e!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var u=null!=r.Z&&il!==Ri,i=new(u?Ri:il);return"j"in r?i.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(i.setFullYear(r.y,0,1),i.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(i.getDay()+5)%7:r.w+7*r.U-(i.getDay()+6)%7)):i.setFullYear(r.y,r.m,r.d),i.setHours(r.H+Math.floor(r.Z/100),r.M+r.Z%100,r.S,r.L),u?i._:i},t.toString=function(){return n},t}function Zi(n,t,r,e){for(var u,i,o,a=0,c=t.length,l=r.length;c>a;){if(e>=l)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=kl[o in Sl?t.charAt(a++):o],!i||(e=i(n,r,e))<0)return-1}else if(u!=r.charCodeAt(e++))return-1}return e}function Vi(n){return new RegExp("^(?:"+n.map(ko.requote).join("|")+")","i")}function Xi(n){for(var t=new u,r=-1,e=n.length;++r<e;)t.set(n[r].toLowerCase(),r);return t}function $i(n,t,r){var e=0>n?"-":"",u=(e?-n:n)+"",i=u.length;return e+(r>i?new Array(r-i+1).join(t)+u:u)}function Bi(n,t,r){ml.lastIndex=0;var e=ml.exec(t.substring(r));return e?(n.w=yl.get(e[0].toLowerCase()),r+e[0].length):-1}function Wi(n,t,r){dl.lastIndex=0;var e=dl.exec(t.substring(r));return e?(n.w=vl.get(e[0].toLowerCase()),r+e[0].length):-1}function Ji(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r,r+1));return e?(n.w=+e[0],r+e[0].length):-1}function Gi(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r));return e?(n.U=+e[0],r+e[0].length):-1}function Ki(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r));return e?(n.W=+e[0],r+e[0].length):-1}function Qi(n,t,r){bl.lastIndex=0;var e=bl.exec(t.substring(r));return e?(n.m=_l.get(e[0].toLowerCase()),r+e[0].length):-1}function no(n,t,r){Ml.lastIndex=0;var e=Ml.exec(t.substring(r));return e?(n.m=xl.get(e[0].toLowerCase()),r+e[0].length):-1}function to(n,t,r){return Zi(n,El.c.toString(),t,r)}function ro(n,t,r){return Zi(n,El.x.toString(),t,r)}function eo(n,t,r){return Zi(n,El.X.toString(),t,r)}function uo(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r,r+4));return e?(n.y=+e[0],r+e[0].length):-1}function io(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r,r+2));return e?(n.y=ao(+e[0]),r+e[0].length):-1}function oo(n,t,r){return/^[+-]\d{4}$/.test(t=t.substring(r,r+5))?(n.Z=+t,r+5):-1}function ao(n){return n+(n>68?1900:2e3)}function co(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r,r+2));return e?(n.m=e[0]-1,r+e[0].length):-1}function lo(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r,r+2));return e?(n.d=+e[0],r+e[0].length):-1}function so(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r,r+3));return e?(n.j=+e[0],r+e[0].length):-1}function fo(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r,r+2));return e?(n.H=+e[0],r+e[0].length):-1}function ho(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r,r+2));return e?(n.M=+e[0],r+e[0].length):-1}function go(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r,r+2));return e?(n.S=+e[0],r+e[0].length):-1}function po(n,t,r){Al.lastIndex=0;var e=Al.exec(t.substring(r,r+3));return e?(n.L=+e[0],r+e[0].length):-1}function vo(n,t,r){var e=Nl.get(t.substring(r,r+=2).toLowerCase());return null==e?-1:(n.p=e,r)}function mo(n){var t=n.getTimezoneOffset(),r=t>0?"-":"+",e=~~(Math.abs(t)/60),u=Math.abs(t)%60;return r+$i(e,"0",2)+$i(u,"0",2)}function yo(n,t,r){wl.lastIndex=0;var e=wl.exec(t.substring(r,r+1));return e?r+e[0].length:-1}function Mo(n){function t(n){try{il=Ri;var t=new il;return t._=n,r(t)}finally{il=Date}}var r=Ui(n);return t.parse=function(n){try{il=Ri;var t=r.parse(n);return t&&t._}finally{il=Date}},t.toString=r.toString,t}function xo(n){return n.toISOString()}function bo(n,t,r){function e(t){return n(t)}function u(n,r){var e=n[1]-n[0],u=e/r,i=ko.bisect(ql,u);return i==ql.length?[t.year,fi(n.map(function(n){return n/31536e6}),r)[2]]:i?t[u/ql[i-1]<ql[i]/u?i-1:i]:[jl,fi(n,r)[2]]}return e.invert=function(t){return _o(n.invert(t))},e.domain=function(t){return arguments.length?(n.domain(t),e):n.domain().map(_o)},e.nice=function(n,t){function r(r){return!isNaN(r)&&!n.range(r,_o(+r+1),t).length}var i=e.domain(),o=ri(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),e.domain(ii(i,t>1?{floor:function(t){for(;r(t=n.floor(t));)t=_o(t-1);return t},ceil:function(t){for(;r(t=n.ceil(t));)t=_o(+t+1);return t}}:n))},e.ticks=function(n,t){var r=ri(e.domain()),i=null==n?u(r,10):"number"==typeof n?u(r,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(r[0],_o(+r[1]+1),t)},e.tickFormat=function(){return r},e.copy=function(){return bo(n.copy(),t,r)},li(e,n)}function _o(n){return new Date(n)}function wo(n){return function(t){for(var r=n.length-1,e=n[r];!e[1](t);)e=n[--r];return e[0](t)}}function So(n){return JSON.parse(n.responseText)}function Eo(n){var t=To.createRange();return t.selectNode(To.body),t.createContextualFragment(n.responseText)}var ko={version:"3.3.3"};Date.now||(Date.now=function(){return+new Date});var Ao=[].slice,No=function(n){return Ao.call(n)},To=document,qo=To.documentElement,zo=window;try{No(qo.childNodes)[0].nodeType}catch(Co){No=function(n){for(var t=n.length,r=new Array(t);t--;)r[t]=n[t];return r}}try{To.createElement("div").style.setProperty("opacity",0,"")}catch(Do){var jo=zo.Element.prototype,Lo=jo.setAttribute,Ho=jo.setAttributeNS,Po=zo.CSSStyleDeclaration.prototype,Fo=Po.setProperty;
jo.setAttribute=function(n,t){Lo.call(this,n,t+"")},jo.setAttributeNS=function(n,t,r){Ho.call(this,n,t,r+"")},Po.setProperty=function(n,t,r){Fo.call(this,n,t+"",r)}}ko.ascending=function(n,t){return t>n?-1:n>t?1:n>=t?0:0/0},ko.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},ko.min=function(n,t){var r,e,u=-1,i=n.length;if(1===arguments.length){for(;++u<i&&!(null!=(r=n[u])&&r>=r);)r=void 0;for(;++u<i;)null!=(e=n[u])&&r>e&&(r=e)}else{for(;++u<i&&!(null!=(r=t.call(n,n[u],u))&&r>=r);)r=void 0;for(;++u<i;)null!=(e=t.call(n,n[u],u))&&r>e&&(r=e)}return r},ko.max=function(n,t){var r,e,u=-1,i=n.length;if(1===arguments.length){for(;++u<i&&!(null!=(r=n[u])&&r>=r);)r=void 0;for(;++u<i;)null!=(e=n[u])&&e>r&&(r=e)}else{for(;++u<i&&!(null!=(r=t.call(n,n[u],u))&&r>=r);)r=void 0;for(;++u<i;)null!=(e=t.call(n,n[u],u))&&e>r&&(r=e)}return r},ko.extent=function(n,t){var r,e,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o&&!(null!=(r=u=n[i])&&r>=r);)r=u=void 0;for(;++i<o;)null!=(e=n[i])&&(r>e&&(r=e),e>u&&(u=e))}else{for(;++i<o&&!(null!=(r=u=t.call(n,n[i],i))&&r>=r);)r=void 0;for(;++i<o;)null!=(e=t.call(n,n[i],i))&&(r>e&&(r=e),e>u&&(u=e))}return[r,u]},ko.sum=function(n,t){var r,e=0,u=n.length,i=-1;if(1===arguments.length)for(;++i<u;)isNaN(r=+n[i])||(e+=r);else for(;++i<u;)isNaN(r=+t.call(n,n[i],i))||(e+=r);return e},ko.mean=function(t,r){var e,u=t.length,i=0,o=-1,a=0;if(1===arguments.length)for(;++o<u;)n(e=t[o])&&(i+=(e-i)/++a);else for(;++o<u;)n(e=r.call(t,t[o],o))&&(i+=(e-i)/++a);return a?i:void 0},ko.quantile=function(n,t){var r=(n.length-1)*t+1,e=Math.floor(r),u=+n[e-1],i=r-e;return i?u+i*(n[e]-u):u},ko.median=function(t,r){return arguments.length>1&&(t=t.map(r)),t=t.filter(n),t.length?ko.quantile(t.sort(ko.ascending),.5):void 0},ko.bisector=function(n){return{left:function(t,r,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=t.length);u>e;){var i=e+u>>>1;n.call(t,t[i],i)<r?e=i+1:u=i}return e},right:function(t,r,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=t.length);u>e;){var i=e+u>>>1;r<n.call(t,t[i],i)?u=i:e=i+1}return e}}};var Oo=ko.bisector(function(n){return n});ko.bisectLeft=Oo.left,ko.bisect=ko.bisectRight=Oo.right,ko.shuffle=function(n){for(var t,r,e=n.length;e;)r=0|Math.random()*e--,t=n[e],n[e]=n[r],n[r]=t;return n},ko.permute=function(n,t){for(var r=t.length,e=new Array(r);r--;)e[r]=n[t[r]];return e},ko.pairs=function(n){for(var t,r=0,e=n.length-1,u=n[0],i=new Array(0>e?0:e);e>r;)i[r]=[t=u,u=n[++r]];return i},ko.zip=function(){if(!(u=arguments.length))return[];for(var n=-1,r=ko.min(arguments,t),e=new Array(r);++n<r;)for(var u,i=-1,o=e[n]=new Array(u);++i<u;)o[i]=arguments[i][n];return e},ko.transpose=function(n){return ko.zip.apply(ko,n)},ko.keys=function(n){var t=[];for(var r in n)t.push(r);return t},ko.values=function(n){var t=[];for(var r in n)t.push(n[r]);return t},ko.entries=function(n){var t=[];for(var r in n)t.push({key:r,value:n[r]});return t},ko.merge=function(n){return Array.prototype.concat.apply([],n)},ko.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),1/0===(t-n)/e)throw new Error("infinite range");var u,i=[],o=r(Math.abs(e)),a=-1;if(n*=o,t*=o,e*=o,0>e)for(;(u=n+e*++a)>t;)i.push(u/o);else for(;(u=n+e*++a)<t;)i.push(u/o);return i},ko.map=function(n){var t=new u;if(n instanceof u)n.forEach(function(n,r){t.set(n,r)});else for(var r in n)t.set(r,n[r]);return t},e(u,{has:function(n){return Ro+n in this},get:function(n){return this[Ro+n]},set:function(n,t){return this[Ro+n]=t},remove:function(n){return n=Ro+n,n in this&&delete this[n]},keys:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},values:function(){var n=[];return this.forEach(function(t,r){n.push(r)}),n},entries:function(){var n=[];return this.forEach(function(t,r){n.push({key:t,value:r})}),n},forEach:function(n){for(var t in this)t.charCodeAt(0)===Io&&n.call(this,t.substring(1),this[t])}});var Ro="\0",Io=Ro.charCodeAt(0);ko.nest=function(){function n(t,a,c){if(c>=o.length)return e?e.call(i,a):r?a.sort(r):a;for(var l,s,f,h,g=-1,p=a.length,d=o[c++],v=new u;++g<p;)(h=v.get(l=d(s=a[g])))?h.push(s):v.set(l,[s]);return t?(s=t(),f=function(r,e){s.set(r,n(t,e,c))}):(s={},f=function(r,e){s[r]=n(t,e,c)}),v.forEach(f),s}function t(n,r){if(r>=o.length)return n;var e=[],u=a[r++];return n.forEach(function(n,u){e.push({key:n,values:t(u,r)})}),u?e.sort(function(n,t){return u(n.key,t.key)}):e}var r,e,i={},o=[],a=[];return i.map=function(t,r){return n(r,t,0)},i.entries=function(r){return t(n(ko.map,r,0),0)},i.key=function(n){return o.push(n),i},i.sortKeys=function(n){return a[o.length-1]=n,i},i.sortValues=function(n){return r=n,i},i.rollup=function(n){return e=n,i},i},ko.set=function(n){var t=new i;if(n)for(var r=0,e=n.length;e>r;++r)t.add(n[r]);return t},e(i,{has:function(n){return Ro+n in this},add:function(n){return this[Ro+n]=!0,n},remove:function(n){return n=Ro+n,n in this&&delete this[n]},values:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},forEach:function(n){for(var t in this)t.charCodeAt(0)===Io&&n.call(this,t.substring(1))}}),ko.behavior={},ko.rebind=function(n,t){for(var r,e=1,u=arguments.length;++e<u;)n[r=arguments[e]]=o(n,t,t[r]);return n};var Yo=["webkit","ms","moz","Moz","o","O"];ko.dispatch=function(){for(var n=new l,t=-1,r=arguments.length;++t<r;)n[arguments[t]]=s(n);return n},l.prototype.on=function(n,t){var r=n.indexOf("."),e="";if(r>=0&&(e=n.substring(r+1),n=n.substring(0,r)),n)return arguments.length<2?this[n].on(e):this[n].on(e,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(e,null);return this}},ko.event=null,ko.requote=function(n){return n.replace(Uo,"\\$&")};var Uo=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Zo={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var r in t)n[r]=t[r]},Vo=function(n,t){return t.querySelector(n)},Xo=function(n,t){return t.querySelectorAll(n)},$o=qo[a(qo,"matchesSelector")],Bo=function(n,t){return $o.call(n,t)};"function"==typeof Sizzle&&(Vo=function(n,t){return Sizzle(n,t)[0]||null},Xo=function(n,t){return Sizzle.uniqueSort(Sizzle(n,t))},Bo=Sizzle.matchesSelector),ko.selection=function(){return Ko};var Wo=ko.selection.prototype=[];Wo.select=function(n){var t,r,e,u,i=[];n=d(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]),t.parentNode=(e=this[o]).parentNode;for(var c=-1,l=e.length;++c<l;)(u=e[c])?(t.push(r=n.call(u,u.__data__,c,o)),r&&"__data__"in u&&(r.__data__=u.__data__)):t.push(null)}return p(i)},Wo.selectAll=function(n){var t,r,e=[];n=v(n);for(var u=-1,i=this.length;++u<i;)for(var o=this[u],a=-1,c=o.length;++a<c;)(r=o[a])&&(e.push(t=No(n.call(r,r.__data__,a,u))),t.parentNode=r);return p(e)};var Jo={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ko.ns={prefix:Jo,qualify:function(n){var t=n.indexOf(":"),r=n;return t>=0&&(r=n.substring(0,t),n=n.substring(t+1)),Jo.hasOwnProperty(r)?{space:Jo[r],local:n}:n}},Wo.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var r=this.node();return n=ko.ns.qualify(n),n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}for(t in n)this.each(m(t,n[t]));return this}return this.each(m(n,t))},Wo.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var r=this.node(),e=(n=n.trim().split(/^|\s+/g)).length,u=-1;if(t=r.classList){for(;++u<e;)if(!t.contains(n[u]))return!1}else for(t=r.getAttribute("class");++u<e;)if(!M(n[u]).test(t))return!1;return!0}for(t in n)this.each(x(t,n[t]));return this}return this.each(x(n,t))},Wo.style=function(n,t,r){var e=arguments.length;if(3>e){if("string"!=typeof n){2>e&&(t="");for(r in n)this.each(_(r,n[r],t));return this}if(2>e)return zo.getComputedStyle(this.node(),null).getPropertyValue(n);r=""}return this.each(_(n,t,r))},Wo.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(w(t,n[t]));return this}return this.each(w(n,t))},Wo.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Wo.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Wo.append=function(n){return n=S(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Wo.insert=function(n,t){return n=S(n),t=d(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments))})},Wo.remove=function(){return this.each(function(){var n=this.parentNode;n&&n.removeChild(this)})},Wo.data=function(n,t){function r(n,r){var e,i,o,a=n.length,f=r.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),d=new Array(a);if(t){var v,m=new u,y=new u,M=[];for(e=-1;++e<a;)v=t.call(i=n[e],i.__data__,e),m.has(v)?d[e]=i:m.set(v,i),M.push(v);for(e=-1;++e<f;)v=t.call(r,o=r[e],e),(i=m.get(v))?(g[e]=i,i.__data__=o):y.has(v)||(p[e]=E(o)),y.set(v,o),m.remove(v);for(e=-1;++e<a;)m.has(M[e])&&(d[e]=n[e])}else{for(e=-1;++e<h;)i=n[e],o=r[e],i?(i.__data__=o,g[e]=i):p[e]=E(o);for(;f>e;++e)p[e]=E(r[e]);for(;a>e;++e)d[e]=n[e]}p.update=g,p.parentNode=g.parentNode=d.parentNode=n.parentNode,c.push(p),l.push(g),s.push(d)}var e,i,o=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(e=this[0]).length);++o<a;)(i=e[o])&&(n[o]=i.__data__);return n}var c=T([]),l=p([]),s=p([]);if("function"==typeof n)for(;++o<a;)r(e=this[o],n.call(e,e.parentNode.__data__,o));else for(;++o<a;)r(e=this[o],n);return l.enter=function(){return c},l.exit=function(){return s},l},Wo.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},Wo.filter=function(n){var t,r,e,u=[];"function"!=typeof n&&(n=k(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(r=this[i]).parentNode;for(var a=0,c=r.length;c>a;a++)(e=r[a])&&n.call(e,e.__data__,a)&&t.push(e)}return p(u)},Wo.order=function(){for(var n=-1,t=this.length;++n<t;)for(var r,e=this[n],u=e.length-1,i=e[u];--u>=0;)(r=e[u])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},Wo.sort=function(n){n=A.apply(this,arguments);for(var t=-1,r=this.length;++t<r;)this[t].sort(n);return this.order()},Wo.each=function(n){return N(this,function(t,r,e){n.call(t,t.__data__,r,e)})},Wo.call=function(n){var t=No(arguments);return n.apply(t[0]=this,t),this},Wo.empty=function(){return!this.node()},Wo.node=function(){for(var n=0,t=this.length;t>n;n++)for(var r=this[n],e=0,u=r.length;u>e;e++){var i=r[e];if(i)return i}return null},Wo.size=function(){var n=0;return this.each(function(){++n}),n};var Go=[];ko.selection.enter=T,ko.selection.enter.prototype=Go,Go.append=Wo.append,Go.empty=Wo.empty,Go.node=Wo.node,Go.call=Wo.call,Go.size=Wo.size,Go.select=function(n){for(var t,r,e,u,i,o=[],a=-1,c=this.length;++a<c;){e=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var l=-1,s=u.length;++l<s;)(i=u[l])?(t.push(e[l]=r=n.call(u.parentNode,i.__data__,l,a)),r.__data__=i.__data__):t.push(null)}return p(o)},Go.insert=function(n,t){return arguments.length<2&&(t=q(this)),Wo.insert.call(this,n,t)},Wo.transition=function(){for(var n,t,r=Bc||++Qc,e=[],u=Wc||{time:Date.now(),ease:Ie,delay:0,duration:250},i=-1,o=this.length;++i<o;){e.push(n=[]);for(var a=this[i],c=-1,l=a.length;++c<l;)(t=a[c])&&Pi(t,c,r,u),n.push(t)}return ji(e,r)},Wo.interrupt=function(){return this.each(z)},ko.select=function(n){var t=["string"==typeof n?Vo(n,To):n];return t.parentNode=qo,p([t])},ko.selectAll=function(n){var t=No("string"==typeof n?Xo(n,To):n);return t.parentNode=qo,p([t])};var Ko=ko.select(qo);Wo.on=function(n,t,r){var e=arguments.length;if(3>e){if("string"!=typeof n){2>e&&(t=!1);for(r in n)this.each(C(r,n[r],t));return this}if(2>e)return(e=this.node()["__on"+n])&&e._;r=!1}return this.each(C(n,t,r))};var Qo=ko.map({mouseenter:"mouseover",mouseleave:"mouseout"});Qo.forEach(function(n){"on"+n in To&&Qo.remove(n)});var na=a(qo.style,"userSelect"),ta=0;ko.mouse=function(n){return H(n,h())};var ra=/WebKit/.test(zo.navigator.userAgent)?-1:0;ko.touches=function(n,t){return arguments.length<2&&(t=h().touches),t?No(t).map(function(t){var r=H(n,t);return r.identifier=t.identifier,r}):[]},ko.behavior.drag=function(){function n(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function t(){return ko.event.changedTouches[0].identifier}function r(n,t){return ko.touches(n).filter(function(n){return n.identifier===t})[0]}function e(n,t,r,e){return function(){function o(){if(!s)return a();var n=t(s,g),r=n[0]-d[0],e=n[1]-d[1];v|=r|e,d=n,f({type:"drag",x:n[0]+c[0],y:n[1]+c[1],dx:r,dy:e})}function a(){m.on(r+"."+p,null).on(e+"."+p,null),y(v&&ko.event.target===h),f({type:"dragend"})}var c,l=this,s=l.parentNode,f=u.of(l,arguments),h=ko.event.target,g=n(),p=null==g?"drag":"drag-"+g,d=t(s,g),v=0,m=ko.select(zo).on(r+"."+p,o).on(e+"."+p,a),y=L();i?(c=i.apply(l,arguments),c=[c.x-d[0],c.y-d[1]]):c=[0,0],f({type:"dragstart"})}}var u=g(n,"drag","dragstart","dragend"),i=null,o=e(c,ko.mouse,"mousemove","mouseup"),a=e(t,r,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},ko.rebind(n,u,"on")};var ea=Math.PI,ua=1e-6,ia=ua*ua,oa=ea/180,aa=180/ea,ca=Math.SQRT2,la=2,sa=4;ko.interpolateZoom=function(n,t){function r(n){var t=n*y;if(m){var r=I(d),o=i/(la*h)*(r*Y(ca*t+d)-R(d));return[e+o*l,u+o*s,i*r/I(ca*t+d)]}return[e+n*l,u+n*s,i*Math.exp(ca*t)]}var e=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],l=o-e,s=a-u,f=l*l+s*s,h=Math.sqrt(f),g=(c*c-i*i+sa*f)/(2*i*la*h),p=(c*c-i*i-sa*f)/(2*c*la*h),d=Math.log(Math.sqrt(g*g+1)-g),v=Math.log(Math.sqrt(p*p+1)-p),m=v-d,y=(m||Math.log(c/i))/ca;return r.duration=1e3*y,r},ko.behavior.zoom=function(){function n(n){n.on(A,l).on(ga+".zoom",h).on(N,p).on("dblclick.zoom",d).on(q,s)}function t(n){return[(n[0]-S.x)/S.k,(n[1]-S.y)/S.k]}function r(n){return[n[0]*S.k+S.x,n[1]*S.k+S.y]}function e(n){S.k=Math.max(k[0],Math.min(k[1],n))}function u(n,t){t=r(t),S.x+=n[0]-t[0],S.y+=n[1]-t[1]}function i(){b&&b.domain(x.range().map(function(n){return(n-S.x)/S.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-S.y)/S.k}).map(_.invert))}function o(n){n({type:"zoomstart"})}function a(n){i(),n({type:"zoom",scale:S.k,translate:[S.x,S.y]})}function c(n){n({type:"zoomend"})}function l(){function n(){s=1,u(ko.mouse(e),h),a(i)}function r(){f.on(N,zo===e?p:null).on(T,null),g(s&&ko.event.target===l),c(i)}var e=this,i=C.of(e,arguments),l=ko.event.target,s=0,f=ko.select(zo).on(N,n).on(T,r),h=t(ko.mouse(e)),g=L();z.call(e),o(i)}function s(){function n(){var n=ko.touches(p);return g=S.k,n.forEach(function(n){n.identifier in v&&(v[n.identifier]=t(n))}),n}function r(){for(var t=ko.event.changedTouches,r=0,i=t.length;i>r;++r)v[t[r].identifier]=null;var o=n(),c=Date.now();if(1===o.length){if(500>c-M){var l=o[0],s=v[l.identifier];e(2*S.k),u(l,s),f(),a(d)}M=c}else if(o.length>1){var l=o[0],h=o[1],g=l[0]-h[0],p=l[1]-h[1];m=g*g+p*p}}function i(){for(var n,t,r,i,o=ko.touches(p),c=0,l=o.length;l>c;++c,i=null)if(r=o[c],i=v[r.identifier]){if(t)break;n=r,t=i}if(i){var s=(s=r[0]-n[0])*s+(s=r[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+r[0])/2,(n[1]+r[1])/2],t=[(t[0]+i[0])/2,(t[1]+i[1])/2],e(f*g)}M=null,u(n,t),a(d)}function h(){if(ko.event.touches.length){for(var t=ko.event.changedTouches,r=0,e=t.length;e>r;++r)delete v[t[r].identifier];for(var u in v)return void n()}_.on(x,null).on(b,null),w.on(A,l).on(q,s),E(),c(d)}var g,p=this,d=C.of(p,arguments),v={},m=0,y=ko.event.changedTouches[0].identifier,x="touchmove.zoom-"+y,b="touchend.zoom-"+y,_=ko.select(zo).on(x,i).on(b,h),w=ko.select(p).on(A,null).on(q,r),E=L();z.call(p),r(),o(d)}function h(){var n=C.of(this,arguments);y?clearTimeout(y):(z.call(this),o(n)),y=setTimeout(function(){y=null,c(n)},50),f();var r=m||ko.mouse(this);v||(v=t(r)),e(Math.pow(2,.002*fa())*S.k),u(r,v),a(n)}function p(){v=null}function d(){var n=C.of(this,arguments),r=ko.mouse(this),i=t(r),l=Math.log(S.k)/Math.LN2;o(n),e(Math.pow(2,ko.event.shiftKey?Math.ceil(l)-1:Math.floor(l)+1)),u(r,i),a(n),c(n)}var v,m,y,M,x,b,_,w,S={x:0,y:0,k:1},E=[960,500],k=ha,A="mousedown.zoom",N="mousemove.zoom",T="mouseup.zoom",q="touchstart.zoom",C=g(n,"zoomstart","zoom","zoomend");return n.event=function(n){n.each(function(){var n=C.of(this,arguments),t=S;Bc?ko.select(this).transition().each("start.zoom",function(){S=this.__chart__||{x:0,y:0,k:1},o(n)}).tween("zoom:zoom",function(){var r=E[0],e=E[1],u=r/2,i=e/2,o=ko.interpolateZoom([(u-S.x)/S.k,(i-S.y)/S.k,r/S.k],[(u-t.x)/t.k,(i-t.y)/t.k,r/t.k]);return function(t){var e=o(t),c=r/e[2];this.__chart__=S={x:u-e[0]*c,y:i-e[1]*c,k:c},a(n)}}).each("end.zoom",function(){c(n)}):(this.__chart__=S,o(n),a(n),c(n))})},n.translate=function(t){return arguments.length?(S={x:+t[0],y:+t[1],k:S.k},i(),n):[S.x,S.y]},n.scale=function(t){return arguments.length?(S={x:S.x,y:S.y,k:+t},i(),n):S.k},n.scaleExtent=function(t){return arguments.length?(k=null==t?ha:[+t[0],+t[1]],n):k},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.x=function(t){return arguments.length?(b=t,x=t.copy(),S={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),S={x:0,y:0,k:1},n):w},ko.rebind(n,C,"on")};var fa,ha=[0,1/0],ga="onwheel"in To?(fa=function(){return-ko.event.deltaY*(ko.event.deltaMode?120:1)},"wheel"):"onmousewheel"in To?(fa=function(){return ko.event.wheelDelta},"mousewheel"):(fa=function(){return-ko.event.detail},"MozMousePixelScroll");Z.prototype.toString=function(){return this.rgb()+""},ko.hsl=function(n,t,r){return 1===arguments.length?n instanceof X?V(n.h,n.s,n.l):lt(""+n,st,V):V(+n,+t,+r)};var pa=X.prototype=new Z;pa.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),V(this.h,this.s,this.l/n)},pa.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),V(this.h,this.s,n*this.l)},pa.rgb=function(){return $(this.h,this.s,this.l)},ko.hcl=function(n,t,r){return 1===arguments.length?n instanceof W?B(n.h,n.c,n.l):n instanceof K?nt(n.l,n.a,n.b):nt((n=ft((n=ko.rgb(n)).r,n.g,n.b)).l,n.a,n.b):B(+n,+t,+r)};var da=W.prototype=new Z;da.brighter=function(n){return B(this.h,this.c,Math.min(100,this.l+va*(arguments.length?n:1)))},da.darker=function(n){return B(this.h,this.c,Math.max(0,this.l-va*(arguments.length?n:1)))},da.rgb=function(){return J(this.h,this.c,this.l).rgb()},ko.lab=function(n,t,r){return 1===arguments.length?n instanceof K?G(n.l,n.a,n.b):n instanceof W?J(n.l,n.c,n.h):ft((n=ko.rgb(n)).r,n.g,n.b):G(+n,+t,+r)};var va=18,ma=.95047,ya=1,Ma=1.08883,xa=K.prototype=new Z;xa.brighter=function(n){return G(Math.min(100,this.l+va*(arguments.length?n:1)),this.a,this.b)},xa.darker=function(n){return G(Math.max(0,this.l-va*(arguments.length?n:1)),this.a,this.b)},xa.rgb=function(){return Q(this.l,this.a,this.b)},ko.rgb=function(n,t,r){return 1===arguments.length?n instanceof at?ot(n.r,n.g,n.b):lt(""+n,ot,$):ot(~~n,~~t,~~r)};var ba=at.prototype=new Z;ba.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,r=this.g,e=this.b,u=30;return t||r||e?(t&&u>t&&(t=u),r&&u>r&&(r=u),e&&u>e&&(e=u),ot(Math.min(255,~~(t/n)),Math.min(255,~~(r/n)),Math.min(255,~~(e/n)))):ot(u,u,u)},ba.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),ot(~~(n*this.r),~~(n*this.g),~~(n*this.b))},ba.hsl=function(){return st(this.r,this.g,this.b)},ba.toString=function(){return"#"+ct(this.r)+ct(this.g)+ct(this.b)};var _a=ko.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,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});_a.forEach(function(n,t){_a.set(n,ut(t))}),ko.functor=pt,ko.xhr=vt(dt),ko.dsv=function(n,t){function r(n,r,i){arguments.length<3&&(i=r,r=null);var o=ko.xhr(n,t,i);return o.row=function(n){return arguments.length?o.response(null==(r=n)?e:u(n)):r},o.row(r)}function e(n){return r.parse(n.responseText)}function u(n){return function(t){return r.parse(t.responseText,n)}}function o(t){return t.map(a).join(n)}function a(n){return c.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var c=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return r.parse=function(n,t){var e;return r.parseRows(n,function(n,r){if(e)return e(n,r-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");e=t?function(n,r){return t(u(n),r)}:u})},r.parseRows=function(n,t){function r(){if(s>=c)return o;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var r=t;r++<c;)if(34===n.charCodeAt(r)){if(34!==n.charCodeAt(r+1))break;++r}s=r+2;var e=n.charCodeAt(r+1);return 13===e?(u=!0,10===n.charCodeAt(r+2)&&++s):10===e&&(u=!0),n.substring(t+1,r).replace(/""/g,'"')}for(;c>s;){var e=n.charCodeAt(s++),a=1;if(10===e)u=!0;else if(13===e)u=!0,10===n.charCodeAt(s)&&(++s,++a);else if(e!==l)continue;return n.substring(t,s-a)}return n.substring(t)}for(var e,u,i={},o={},a=[],c=n.length,s=0,f=0;(e=r())!==o;){for(var h=[];e!==i&&e!==o;)h.push(e),e=r();(!t||(h=t(h,f++)))&&a.push(h)}return a},r.format=function(t){if(Array.isArray(t[0]))return r.formatRows(t);var e=new i,u=[];return t.forEach(function(n){for(var t in n)e.has(t)||u.push(e.add(t))}),[u.map(a).join(n)].concat(t.map(function(t){return u.map(function(n){return a(t[n])}).join(n)})).join("\n")},r.formatRows=function(n){return n.map(o).join("\n")},r},ko.csv=ko.dsv(",","text/csv"),ko.tsv=ko.dsv(" ","text/tab-separated-values");var wa,Sa,Ea,ka,Aa,Na=zo[a(zo,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ko.timer=function(n,t,r){var e=arguments.length;2>e&&(t=0),3>e&&(r=Date.now());var u=r+t,i={callback:n,time:u,next:null};Sa?Sa.next=i:wa=i,Sa=i,Ea||(ka=clearTimeout(ka),Ea=1,Na(Mt))},ko.timer.flush=function(){bt(),_t()};var Ta=".",qa=",",za=[3,3],Ca="$",Da=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(wt);ko.formatPrefix=function(n,t){var r=0;return n&&(0>n&&(n*=-1),t&&(n=ko.round(n,St(n,t))),r=1+Math.floor(1e-12+Math.log(n)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((0>=r?r+1:r-1)/3)))),Da[8+r/3]},ko.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)},ko.format=function(n){var t=ja.exec(n),r=t[1]||" ",e=t[2]||">",u=t[3]||"",i=t[4]||"",o=t[5],a=+t[6],c=t[7],l=t[8],s=t[9],f=1,h="",g=!1;switch(l&&(l=+l.substring(1)),(o||"0"===r&&"="===e)&&(o=r="0",e="=",c&&(a-=Math.floor((a-1)/4))),s){case"n":c=!0,s="g";break;case"%":f=100,h="%",s="f";break;case"p":f=100,h="%",s="r";break;case"b":case"o":case"x":case"X":"#"===i&&(i="0"+s.toLowerCase());case"c":case"d":g=!0,l=0;break;case"s":f=-1,s="r"}"#"===i?i="":"$"===i&&(i=Ca),"r"!=s||l||(s="g"),null!=l&&("g"==s?l=Math.max(1,Math.min(21,l)):("e"==s||"f"==s)&&(l=Math.max(0,Math.min(20,l)))),s=La.get(s)||Et;var p=o&&c;return function(n){if(g&&n%1)return"";var t=0>n||0===n&&0>1/n?(n=-n,"-"):u;if(0>f){var d=ko.formatPrefix(n,l);n=d.scale(n),h=d.symbol}else n*=f;n=s(n,l);var v=n.lastIndexOf("."),m=0>v?n:n.substring(0,v),y=0>v?"":Ta+n.substring(v+1);!o&&c&&(m=Ha(m));var M=i.length+m.length+y.length+(p?0:t.length),x=a>M?new Array(M=a-M+1).join(r):"";return p&&(m=Ha(x+m)),t+=i,n=m+y,("<"===e?t+n+x:">"===e?x+t+n:"^"===e?x.substring(0,M>>=1)+t+n+x.substring(M):t+(p?n:x+n))+h}};var ja=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,La=ko.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=ko.round(n,St(n,t))).toFixed(Math.max(0,Math.min(20,St(n*(1+1e-15),t))))}}),Ha=dt;if(za){var Pa=za.length;Ha=function(n){for(var t=n.length,r=[],e=0,u=za[0];t>0&&u>0;)r.push(n.substring(t-=u,t+u)),u=za[e=(e+1)%Pa];return r.reverse().join(qa)}}ko.geo={},kt.prototype={s:0,t:0,add:function(n){At(n,this.t,Fa),At(Fa.s,this.s,this),this.s?this.t+=Fa.t:this.s=Fa.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var Fa=new kt;ko.geo.stream=function(n,t){n&&Oa.hasOwnProperty(n.type)?Oa[n.type](n,t):Nt(n,t)};var Oa={Feature:function(n,t){Nt(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,e=-1,u=r.length;++e<u;)Nt(r[e].geometry,t)}},Ra={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 r=n.coordinates,e=-1,u=r.length;++e<u;)n=r[e],t.point(n[0],n[1],n[2])},LineString:function(n,t){Tt(n.coordinates,t,0)},MultiLineString:function(n,t){for(var r=n.coordinates,e=-1,u=r.length;++e<u;)Tt(r[e],t,0)},Polygon:function(n,t){qt(n.coordinates,t)},MultiPolygon:function(n,t){for(var r=n.coordinates,e=-1,u=r.length;++e<u;)qt(r[e],t)},GeometryCollection:function(n,t){for(var r=n.geometries,e=-1,u=r.length;++e<u;)Nt(r[e],t)}};ko.geo.area=function(n){return Ia=0,ko.geo.stream(n,Ua),Ia};var Ia,Ya=new kt,Ua={sphere:function(){Ia+=4*ea},point:c,lineStart:c,lineEnd:c,polygonStart:function(){Ya.reset(),Ua.lineStart=zt},polygonEnd:function(){var n=2*Ya;Ia+=0>n?4*ea+n:n,Ua.lineStart=Ua.lineEnd=Ua.point=c}};ko.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,r){var e=Ct([t*oa,r*oa]);if(m){var u=jt(m,e),i=[u[1],-u[0],0],o=jt(i,u);Pt(o),o=Ot(o);var c=t-p,l=c>0?1:-1,d=o[0]*aa*l,v=Math.abs(c)>180;if(v^(d>l*p&&l*t>d)){var y=o[1]*aa;y>g&&(g=y)}else if(d=(d+360)%360-180,v^(d>l*p&&l*t>d)){var y=-o[1]*aa;f>y&&(f=y)}else f>r&&(f=r),r>g&&(g=r);v?p>t?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t)}else n(t,r);m=e,p=t}function r(){b.point=t}function e(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,r){if(m){var e=n-p;y+=Math.abs(e)>180?e+(e>0?360:-360):e}else d=n,v=r;Ua.point(n,r),t(n,r)}function i(){Ua.lineStart()}function o(){u(d,v),Ua.lineEnd(),Math.abs(y)>ua&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var s,f,h,g,p,d,v,m,y,M,x,b={point:n,lineStart:r,lineEnd:e,polygonStart:function(){b.point=u,b.lineStart=i,b.lineEnd=o,y=0,Ua.polygonStart()},polygonEnd:function(){Ua.polygonEnd(),b.point=n,b.lineStart=r,b.lineEnd=e,0>Ya?(s=-(h=180),f=-(g=90)):y>ua?g=90:-ua>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],ko.geo.stream(n,b);var t=M.length;if(t){M.sort(c);for(var r,e=1,u=M[0],i=[u];t>e;++e)r=M[e],l(r[0],u)||l(r[1],u)?(a(u[0],r[1])>a(u[0],u[1])&&(u[1]=r[1]),a(r[0],u[1])>a(u[0],u[1])&&(u[0]=r[0])):i.push(u=r);for(var o,r,p=-1/0,t=i.length-1,e=0,u=i[t];t>=e;u=r,++e)r=i[e],(o=a(u[1],r[0]))>p&&(p=o,s=r[0],h=u[1])}return M=x=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),ko.geo.centroid=function(n){Za=Va=Xa=$a=Ba=Wa=Ja=Ga=Ka=Qa=nc=0,ko.geo.stream(n,tc);var t=Ka,r=Qa,e=nc,u=t*t+r*r+e*e;return ia>u&&(t=Wa,r=Ja,e=Ga,ua>Va&&(t=Xa,r=$a,e=Ba),u=t*t+r*r+e*e,ia>u)?[0/0,0/0]:[Math.atan2(r,t)*aa,O(e/Math.sqrt(u))*aa]};var Za,Va,Xa,$a,Ba,Wa,Ja,Ga,Ka,Qa,nc,tc={sphere:c,point:Yt,lineStart:Zt,lineEnd:Vt,polygonStart:function(){tc.lineStart=Xt},polygonEnd:function(){tc.lineStart=Zt}};ko.geo.pointInPolygon=Qt;var rc=Jt(ir,nr,rr,er,ur),ec=[-ea,0];ko.geo.distance=function(n,t){var r,e=(t[0]-n[0])*oa,u=n[1]*oa,i=t[1]*oa,o=Math.sin(e),a=Math.cos(e),c=Math.sin(u),l=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((r=f*o)*r+(r=l*s-c*f*a)*r),c*s+l*f*a)};var uc={},ic=1e9;ko.geo.clipExtent=function(){var n,t,r,e,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=gr(n=+a[0][0],t=+a[0][1],r=+a[1][0],e=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[r,e]]}};return o.extent([[0,0],[960,500]])},(ko.geo.conicEqualArea=function(){return vr(mr)}).raw=mr,ko.geo.albers=function(){return ko.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ko.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,r(i,o),t||(e(i,o),t)||u(i,o),t}var t,r,e,u,i=ko.geo.albers(),o=ko.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ko.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,r){t=[n,r]}};return n.invert=function(n){var t=i.scale(),r=i.translate(),e=(n[0]-r[0])/t,u=(n[1]-r[1])/t;return(u>=.12&&.234>u&&e>=-.425&&-.214>e?o:u>=.166&&.234>u&&e>=-.214&&-.115>e?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),r=o.stream(n),e=a.stream(n);return{point:function(n,u){t.point(n,u),r.point(n,u),e.point(n,u)},sphere:function(){t.sphere(),r.sphere(),e.sphere()},lineStart:function(){t.lineStart(),r.lineStart(),e.lineStart()},lineEnd:function(){t.lineEnd(),r.lineEnd(),e.lineEnd()},polygonStart:function(){t.polygonStart(),r.polygonStart(),e.polygonStart()},polygonEnd:function(){t.polygonEnd(),r.polygonEnd(),e.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var l=i.scale(),s=+t[0],f=+t[1];return r=i.translate(t).clipExtent([[s-.455*l,f-.238*l],[s+.455*l,f+.238*l]]).stream(c).point,e=o.translate([s-.307*l,f+.201*l]).clipExtent([[s-.425*l+ua,f+.12*l+ua],[s-.214*l-ua,f+.234*l-ua]]).stream(c).point,u=a.translate([s-.205*l,f+.212*l]).clipExtent([[s-.214*l+ua,f+.166*l+ua],[s-.115*l-ua,f+.234*l-ua]]).stream(c).point,n
},n.scale(1070)};var oc,ac,cc,lc,sc,fc,hc={point:c,lineStart:c,lineEnd:c,polygonStart:function(){ac=0,hc.lineStart=yr},polygonEnd:function(){hc.lineStart=hc.lineEnd=hc.point=c,oc+=Math.abs(ac/2)}},gc={point:Mr,lineStart:c,lineEnd:c,polygonStart:c,polygonEnd:c},pc={point:_r,lineStart:wr,lineEnd:Sr,polygonStart:function(){pc.lineStart=Er},polygonEnd:function(){pc.point=_r,pc.lineStart=wr,pc.lineEnd=Sr}};ko.geo.transform=function(n){return{stream:function(t){var r=new Nr(t);for(var e in n)r[e]=n[e];return r}}},Nr.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()}},ko.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),ko.geo.stream(n,o)),i.result()}function t(){return o=null,n}var r,e,u,i,o,a=4.5;return n.area=function(n){return oc=0,ko.geo.stream(n,u(hc)),oc},n.centroid=function(n){return Xa=$a=Ba=Wa=Ja=Ga=Ka=Qa=nc=0,ko.geo.stream(n,u(pc)),nc?[Ka/nc,Qa/nc]:Ga?[Wa/Ga,Ja/Ga]:Ba?[Xa/Ba,$a/Ba]:[0/0,0/0]},n.bounds=function(n){return sc=fc=-(cc=lc=1/0),ko.geo.stream(n,u(gc)),[[cc,lc],[sc,fc]]},n.projection=function(n){return arguments.length?(u=(r=n)?n.stream||Tr(n):dt,t()):r},n.context=function(n){return arguments.length?(i=null==(e=n)?new xr:new kr(n),"function"!=typeof a&&i.pointRadius(a),t()):e},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(ko.geo.albersUsa()).context(null)},ko.geo.projection=qr,ko.geo.projectionMutator=zr,(ko.geo.equirectangular=function(){return qr(Dr)}).raw=Dr.invert=Dr,ko.geo.rotation=function(n){function t(t){return t=n(t[0]*oa,t[1]*oa),t[0]*=aa,t[1]*=aa,t}return n=jr(n[0]%360*oa,n[1]*oa,n.length>2?n[2]*oa:0),t.invert=function(t){return t=n.invert(t[0]*oa,t[1]*oa),t[0]*=aa,t[1]*=aa,t},t},ko.geo.circle=function(){function n(){var n="function"==typeof e?e.apply(this,arguments):e,t=jr(-n[0]*oa,-n[1]*oa,0).invert,u=[];return r(null,null,1,{point:function(n,r){u.push(n=t(n,r)),n[0]*=aa,n[1]*=aa}}),{type:"Polygon",coordinates:[u]}}var t,r,e=[0,0],u=6;return n.origin=function(t){return arguments.length?(e=t,n):e},n.angle=function(e){return arguments.length?(r=Fr((t=+e)*oa,u*oa),n):t},n.precision=function(e){return arguments.length?(r=Fr(t*oa,(u=+e)*oa),n):u},n.angle(90)},ko.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ko.range(Math.ceil(i/v)*v,u,v).map(h).concat(ko.range(Math.ceil(l/m)*m,c,m).map(g)).concat(ko.range(Math.ceil(e/p)*p,r,p).filter(function(n){return Math.abs(n%v)>ua}).map(s)).concat(ko.range(Math.ceil(a/d)*d,o,d).filter(function(n){return Math.abs(n%m)>ua}).map(f))}var r,e,u,i,o,a,c,l,s,f,h,g,p=10,d=p,v=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(l).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],l=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),l>c&&(t=l,l=c,c=t),n.precision(y)):[[i,l],[u,c]]},n.minorExtent=function(t){return arguments.length?(e=+t[0][0],r=+t[1][0],a=+t[0][1],o=+t[1][1],e>r&&(t=e,e=r,r=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[e,a],[r,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(v=+t[0],m=+t[1],n):[v,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],n):[p,d]},n.precision=function(t){return arguments.length?(y=+t,s=Rr(a,o,90),f=Ir(e,r,y),h=Rr(l,c,90),g=Ir(i,u,y),n):y},n.majorExtent([[-180,-90+ua],[180,90-ua]]).minorExtent([[-180,-80-ua],[180,80+ua]])},ko.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||e.apply(this,arguments),r||u.apply(this,arguments)]}}var t,r,e=Yr,u=Ur;return n.distance=function(){return ko.geo.distance(t||e.apply(this,arguments),r||u.apply(this,arguments))},n.source=function(r){return arguments.length?(e=r,t="function"==typeof r?null:r,n):e},n.target=function(t){return arguments.length?(u=t,r="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},ko.geo.interpolate=function(n,t){return Zr(n[0]*oa,n[1]*oa,t[0]*oa,t[1]*oa)},ko.geo.length=function(n){return dc=0,ko.geo.stream(n,vc),dc};var dc,vc={sphere:c,point:c,lineStart:Vr,lineEnd:c,polygonStart:c,polygonEnd:c},mc=Xr(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ko.geo.azimuthalEqualArea=function(){return qr(mc)}).raw=mc;var yc=Xr(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},dt);(ko.geo.azimuthalEquidistant=function(){return qr(yc)}).raw=yc,(ko.geo.conicConformal=function(){return vr($r)}).raw=$r,(ko.geo.conicEquidistant=function(){return vr(Br)}).raw=Br;var Mc=Xr(function(n){return 1/n},Math.atan);(ko.geo.gnomonic=function(){return qr(Mc)}).raw=Mc,Wr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-ea/2]},(ko.geo.mercator=function(){return Jr(Wr)}).raw=Wr;var xc=Xr(function(){return 1},Math.asin);(ko.geo.orthographic=function(){return qr(xc)}).raw=xc;var bc=Xr(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ko.geo.stereographic=function(){return qr(bc)}).raw=bc,Gr.invert=function(n,t){return[Math.atan2(R(n),Math.cos(t)),O(Math.sin(t)/I(n))]},(ko.geo.transverseMercator=function(){return Jr(Gr)}).raw=Gr,ko.geom={},ko.svg={},ko.svg.line=function(){return Kr(dt)};var _c=ko.map({linear:te,"linear-closed":re,step:ee,"step-before":ue,"step-after":ie,basis:fe,"basis-open":he,"basis-closed":ge,bundle:pe,cardinal:ce,"cardinal-open":oe,"cardinal-closed":ae,monotone:xe});_c.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var wc=[0,2/3,1/3,0],Sc=[0,1/3,2/3,0],Ec=[0,1/6,2/3,1/6];ko.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u,i,o,a,c,l,s,f,h,g,p,d=pt(r),v=pt(e),m=n.length,y=m-1,M=[],x=[],b=0;if(d===Qr&&e===ne)t=n;else for(i=0,t=[];m>i;++i)t.push([+d.call(this,u=n[i],i),+v.call(this,u,i)]);for(i=1;m>i;++i)(t[i][1]<t[b][1]||t[i][1]==t[b][1]&&t[i][0]<t[b][0])&&(b=i);for(i=0;m>i;++i)i!==b&&(c=t[i][1]-t[b][1],a=t[i][0]-t[b][0],M.push({angle:Math.atan2(c,a),index:i}));for(M.sort(function(n,t){return n.angle-t.angle}),g=M[0].angle,h=M[0].index,f=0,i=1;y>i;++i){if(o=M[i].index,g==M[i].angle){if(a=t[h][0]-t[b][0],c=t[h][1]-t[b][1],l=t[o][0]-t[b][0],s=t[o][1]-t[b][1],a*a+c*c>=l*l+s*s){M[i].index=-1;continue}M[f].index=-1}g=M[i].angle,f=i,h=o}for(x.push(b),i=0,o=0;2>i;++o)M[o].index>-1&&(x.push(M[o].index),i++);for(p=x.length;y>o;++o)if(!(M[o].index<0)){for(;!be(x[p-2],x[p-1],M[o].index,t);)--p;x[p++]=M[o].index}var _=[];for(i=p-1;i>=0;--i)_.push(n[x[i]]);return _}var r=Qr,e=ne;return arguments.length?t(n):(t.x=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(e=n,t):e},t)},ko.geom.polygon=function(n){return Zo(n,kc),n};var kc=ko.geom.polygon.prototype=[];kc.area=function(){for(var n,t=-1,r=this.length,e=this[r-1],u=0;++t<r;)n=e,e=this[t],u+=n[1]*e[0]-n[0]*e[1];return.5*u},kc.centroid=function(n){var t,r,e=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++e<u;)t=a,a=this[e],r=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*r,o+=(t[1]+a[1])*r;return[i*n,o*n]},kc.clip=function(n){for(var t,r,e,u,i,o,a=Se(n),c=-1,l=this.length-Se(this),s=this[l-1];++c<l;){for(t=n.slice(),n.length=0,u=this[c],i=t[(e=t.length-a)-1],r=-1;++r<e;)o=t[r],_e(o,s,u)?(_e(i,s,u)||n.push(we(i,o,s,u)),n.push(o)):_e(i,s,u)&&n.push(we(i,o,s,u)),i=o;a&&n.push(n[0]),s=u}return n},ko.geom.delaunay=function(n){var t=n.map(function(){return[]}),r=[];return Ee(n,function(r){t[r.region.l.index].push(n[r.region.r.index])}),t.forEach(function(t,e){var u=n[e],i=u[0],o=u[1];t.forEach(function(n){n.angle=Math.atan2(n[0]-i,n[1]-o)}),t.sort(function(n,t){return n.angle-t.angle});for(var a=0,c=t.length-1;c>a;a++)r.push([u,t[a],t[a+1]])}),r},ko.geom.voronoi=function(n){function t(n){var t,i,o,a=n.map(function(){return[]}),c=pt(r),l=pt(e),s=n.length,f=1e6;if(c===Qr&&l===ne)t=n;else for(t=new Array(s),o=0;s>o;++o)t[o]=[+c.call(this,i=n[o],o),+l.call(this,i,o)];if(Ee(t,function(n){var t,r,e,u,i,o;1===n.a&&n.b>=0?(t=n.ep.r,r=n.ep.l):(t=n.ep.l,r=n.ep.r),1===n.a?(i=t?t.y:-f,e=n.c-n.b*i,o=r?r.y:f,u=n.c-n.b*o):(e=t?t.x:-f,i=n.c-n.a*e,u=r?r.x:f,o=n.c-n.a*u);var c=[e,i],l=[u,o];a[n.region.l.index].push(c,l),a[n.region.r.index].push(c,l)}),a=a.map(function(n,r){var e=t[r][0],u=t[r][1],i=n.map(function(n){return Math.atan2(n[0]-e,n[1]-u)}),o=ko.range(n.length).sort(function(n,t){return i[n]-i[t]});return o.filter(function(n,t){return!t||i[n]-i[o[t-1]]>ua}).map(function(t){return n[t]})}),a.forEach(function(n,r){var e=n.length;if(!e)return n.push([-f,-f],[-f,f],[f,f],[f,-f]);if(!(e>2)){var u=t[r],i=n[0],o=n[1],a=u[0],c=u[1],l=i[0],s=i[1],h=o[0],g=o[1],p=Math.abs(h-l),d=g-s;if(Math.abs(d)<ua){var v=s>c?-f:f;n.push([-f,v],[f,v])}else if(ua>p){var m=l>a?-f:f;n.push([m,-f],[m,f])}else{var v=(l-a)*(g-s)>(h-l)*(s-c)?f:-f,y=Math.abs(d)-p;Math.abs(y)<ua?n.push([0>d?v:-v,v]):(y>0&&(v*=-1),n.push([-f,v],[f,v]))}}}),u)for(o=0;s>o;++o)u.clip(a[o]);for(o=0;s>o;++o)a[o].point=n[o];return a}var r=Qr,e=ne,u=null;return arguments.length?t(n):(t.x=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(e=n,t):e},t.clipExtent=function(n){if(!arguments.length)return u&&[u[0],u[2]];if(null==n)u=null;else{var r=+n[0][0],e=+n[0][1],i=+n[1][0],o=+n[1][1];u=ko.geom.polygon([[r,e],[r,o],[i,o],[i,e]])}return t},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):u&&u[2]},t.links=function(n){var t,u,i,o=n.map(function(){return[]}),a=[],c=pt(r),l=pt(e),s=n.length;if(c===Qr&&l===ne)t=n;else for(t=new Array(s),i=0;s>i;++i)t[i]=[+c.call(this,u=n[i],i),+l.call(this,u,i)];return Ee(t,function(t){var r=t.region.l.index,e=t.region.r.index;o[r][e]||(o[r][e]=o[e][r]=!0,a.push({source:n[r],target:n[e]}))}),a},t.triangles=function(n){if(r===Qr&&e===ne)return ko.geom.delaunay(n);for(var t,u=new Array(c),i=pt(r),o=pt(e),a=-1,c=n.length;++a<c;)(u[a]=[+i.call(this,t=n[a],a),+o.call(this,t,a)]).data=t;return ko.geom.delaunay(u).map(function(n){return n.map(function(n){return n.data})})},t)};var Ac={l:"r",r:"l"};ko.geom.quadtree=function(n,t,r,e,u){function i(n){function i(n,t,r,e,u,i,o,a){if(!isNaN(r)&&!isNaN(e))if(n.leaf){var c=n.x,s=n.y;if(null!=c)if(Math.abs(c-r)+Math.abs(s-e)<.01)l(n,t,r,e,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,l(n,f,c,s,u,i,o,a),l(n,t,r,e,u,i,o,a)}else n.x=r,n.y=e,n.point=t}else l(n,t,r,e,u,i,o,a)}function l(n,t,r,e,u,o,a,c){var l=.5*(u+a),s=.5*(o+c),f=r>=l,h=e>=s,g=(h<<1)+f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=Ne()),f?u=l:a=l,h?o=s:c=s,i(n,t,r,e,u,o,a,c)}var s,f,h,g,p,d,v,m,y,M=pt(a),x=pt(c);if(null!=t)d=t,v=r,m=e,y=u;else if(m=y=-(d=v=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)s=n[g],s.x<d&&(d=s.x),s.y<v&&(v=s.y),s.x>m&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);d>b&&(d=b),v>_&&(v=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-d,S=y-v;w>S?y=v+w:m=d+S;var E=Ne();if(E.add=function(n){i(E,n,+M(n,++g),+x(n,g),d,v,m,y)},E.visit=function(n){Te(n,E,d,v,m,y)},g=-1,null==t){for(;++g<p;)i(E,n[g],f[g],h[g],d,v,m,y);--g}else n.forEach(E.add);return f=h=n=s=null,E}var o,a=Qr,c=ne;return(o=arguments.length)?(a=ke,c=Ae,3===o&&(u=r,e=t,r=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=r=e=u=null:(t=+n[0][0],r=+n[0][1],e=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,r],[e,u]]},i.size=function(n){return arguments.length?(null==n?t=r=e=u=null:(t=r=0,e=+n[0],u=+n[1]),i):null==t?null:[e-t,u-r]},i)},ko.interpolateRgb=qe,ko.interpolateObject=ze,ko.interpolateNumber=Ce,ko.interpolateString=De;var Nc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;ko.interpolate=je,ko.interpolators=[function(n,t){var r=typeof t;return("string"===r?_a.has(t)||/^(#|rgb\(|hsl\()/.test(t)?qe:De:t instanceof Z?qe:"object"===r?Array.isArray(t)?Le:ze:Ce)(n,t)}],ko.interpolateArray=Le;var Tc=function(){return dt},qc=ko.map({linear:Tc,poly:Ye,quad:function(){return Oe},cubic:function(){return Re},sin:function(){return Ue},exp:function(){return Ze},circle:function(){return Ve},elastic:Xe,back:$e,bounce:function(){return Be}}),zc=ko.map({"in":dt,out:Pe,"in-out":Fe,"out-in":function(n){return Fe(Pe(n))}});ko.ease=function(n){var t=n.indexOf("-"),r=t>=0?n.substring(0,t):n,e=t>=0?n.substring(t+1):"in";return r=qc.get(r)||Tc,e=zc.get(e)||dt,He(e(r.apply(null,Array.prototype.slice.call(arguments,1))))},ko.interpolateHcl=We,ko.interpolateHsl=Je,ko.interpolateLab=Ge,ko.interpolateRound=Ke,ko.transform=function(n){var t=To.createElementNS(ko.ns.prefix.svg,"g");return(ko.transform=function(n){if(null!=n){t.setAttribute("transform",n);var r=t.transform.baseVal.consolidate()}return new Qe(r?r.matrix:Cc)})(n)},Qe.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Cc={a:1,b:0,c:0,d:1,e:0,f:0};ko.interpolateTransform=eu,ko.layout={},ko.layout.bundle=function(){return function(n){for(var t=[],r=-1,e=n.length;++r<e;)t.push(ou(n[r]));return t}},ko.layout.chord=function(){function n(){var n,l,f,h,g,p={},d=[],v=ko.range(i),m=[];for(r=[],e=[],n=0,h=-1;++h<i;){for(l=0,g=-1;++g<i;)l+=u[h][g];d.push(l),m.push(ko.range(i)),n+=l}for(o&&v.sort(function(n,t){return o(d[n],d[t])}),a&&m.forEach(function(n,t){n.sort(function(n,r){return a(u[t][n],u[t][r])})}),n=(2*ea-s*i)/n,l=0,h=-1;++h<i;){for(f=l,g=-1;++g<i;){var y=v[h],M=m[y][g],x=u[y][M],b=l,_=l+=x*n;p[y+"-"+M]={index:y,subindex:M,startAngle:b,endAngle:_,value:x}}e[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/n},l+=s}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&r.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){r.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var r,e,u,i,o,a,c,l={},s=0;return l.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,r=e=null,l):u},l.padding=function(n){return arguments.length?(s=n,r=e=null,l):s},l.sortGroups=function(n){return arguments.length?(o=n,r=e=null,l):o},l.sortSubgroups=function(n){return arguments.length?(a=n,r=null,l):a},l.sortChords=function(n){return arguments.length?(c=n,r&&t(),l):c},l.chords=function(){return r||n(),r},l.groups=function(){return e||n(),e},l},ko.layout.force=function(){function n(n){return function(t,r,e,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=1/Math.sqrt(i*i+o*o);if(d>(u-r)*a){var c=t.charge*a*a;return n.px-=i*c,n.py-=o*c,!0}if(t.point&&isFinite(a)){var c=t.pointCharge*a*a;n.px-=i*c,n.py-=o*c}}return!t.charge}}function t(n){n.px=ko.event.x,n.py=ko.event.y,a.resume()}var r,e,u,i,o,a={},c=ko.dispatch("start","tick","end"),l=[1,1],s=.9,f=Dc,h=jc,g=-30,p=.1,d=.8,v=[],m=[];return a.tick=function(){if((e*=.99)<.005)return c.end({type:"end",alpha:e=0}),!0;var t,r,a,f,h,d,y,M,x,b=v.length,_=m.length;for(r=0;_>r;++r)a=m[r],f=a.source,h=a.target,M=h.x-f.x,x=h.y-f.y,(d=M*M+x*x)&&(d=e*i[r]*((d=Math.sqrt(d))-u[r])/d,M*=d,x*=d,h.x-=M*(y=f.weight/(h.weight+f.weight)),h.y-=x*y,f.x+=M*(y=1-y),f.y+=x*y);if((y=e*p)&&(M=l[0]/2,x=l[1]/2,r=-1,y))for(;++r<b;)a=v[r],a.x+=(M-a.x)*y,a.y+=(x-a.y)*y;if(g)for(gu(t=ko.geom.quadtree(v),e,o),r=-1;++r<b;)(a=v[r]).fixed||t.visit(n(a));for(r=-1;++r<b;)a=v[r],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*s,a.y-=(a.py-(a.py=a.y))*s);c.tick({type:"tick",alpha:e})},a.nodes=function(n){return arguments.length?(v=n,a):v},a.links=function(n){return arguments.length?(m=n,a):m},a.size=function(n){return arguments.length?(l=n,a):l},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(s=+n,a):s},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.gravity=function(n){return arguments.length?(p=+n,a):p},a.theta=function(n){return arguments.length?(d=+n,a):d},a.alpha=function(n){return arguments.length?(n=+n,e?e=n>0?n:0:n>0&&(c.start({type:"start",alpha:e=n}),ko.timer(a.tick)),a):e},a.start=function(){function n(n,e){for(var u,i=t(r),o=-1,a=i.length;++o<a;)if(!isNaN(u=i[o][n]))return u;return Math.random()*e}function t(){if(!c){for(c=[],e=0;p>e;++e)c[e]=[];for(e=0;d>e;++e){var n=m[e];c[n.source.index].push(n.target),c[n.target.index].push(n.source)}}return c[r]}var r,e,c,s,p=v.length,d=m.length,y=l[0],M=l[1];for(r=0;p>r;++r)(s=v[r]).index=r,s.weight=0;for(r=0;d>r;++r)s=m[r],"number"==typeof s.source&&(s.source=v[s.source]),"number"==typeof s.target&&(s.target=v[s.target]),++s.source.weight,++s.target.weight;for(r=0;p>r;++r)s=v[r],isNaN(s.x)&&(s.x=n("x",y)),isNaN(s.y)&&(s.y=n("y",M)),isNaN(s.px)&&(s.px=s.x),isNaN(s.py)&&(s.py=s.y);if(u=[],"function"==typeof f)for(r=0;d>r;++r)u[r]=+f.call(this,m[r],r);else for(r=0;d>r;++r)u[r]=f;if(i=[],"function"==typeof h)for(r=0;d>r;++r)i[r]=+h.call(this,m[r],r);else for(r=0;d>r;++r)i[r]=h;if(o=[],"function"==typeof g)for(r=0;p>r;++r)o[r]=+g.call(this,v[r],r);else for(r=0;p>r;++r)o[r]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return r||(r=ko.behavior.drag().origin(dt).on("dragstart.force",lu).on("drag.force",t).on("dragend.force",su)),arguments.length?(this.on("mouseover.force",fu).on("mouseout.force",hu).call(r),void 0):r},ko.rebind(a,c,"on")};var Dc=20,jc=1;ko.layout.hierarchy=function(){function n(t,o,a){var c=u.call(r,t,o);if(t.depth=o,a.push(t),c&&(l=c.length)){for(var l,s,f=-1,h=t.children=[],g=0,p=o+1;++f<l;)s=n(c[f],p,a),s.parent=t,h.push(s),g+=s.value;e&&h.sort(e),i&&(t.value=g)}else i&&(t.value=+i.call(r,t,o)||0);return t}function t(n,e){var u=n.children,o=0;if(u&&(a=u.length))for(var a,c=-1,l=e+1;++c<a;)o+=t(u[c],l);else i&&(o=+i.call(r,n,e)||0);return i&&(n.value=o),o}function r(t){var r=[];return n(t,0,r),r}var e=mu,u=du,i=vu;return r.sort=function(n){return arguments.length?(e=n,r):e},r.children=function(n){return arguments.length?(u=n,r):u},r.value=function(n){return arguments.length?(i=n,r):i},r.revalue=function(n){return t(n,0),n},r},ko.layout.partition=function(){function n(t,r,e,u){var i=t.children;if(t.x=r,t.y=t.depth*u,t.dx=e,t.dy=u,i&&(o=i.length)){var o,a,c,l=-1;for(e=t.value?e/t.value:0;++l<o;)n(a=i[l],r,c=a.value*e,u),r+=c}}function t(n){var r=n.children,e=0;if(r&&(u=r.length))for(var u,i=-1;++i<u;)e=Math.max(e,t(r[i]));return 1+e}function r(r,i){var o=e.call(this,r,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var e=ko.layout.hierarchy(),u=[1,1];return r.size=function(n){return arguments.length?(u=n,r):u},pu(r,e)},ko.layout.pie=function(){function n(i){var o=i.map(function(r,e){return+t.call(n,r,e)}),a=+("function"==typeof e?e.apply(this,arguments):e),c=(("function"==typeof u?u.apply(this,arguments):u)-a)/ko.sum(o),l=ko.range(i.length);null!=r&&l.sort(r===Lc?function(n,t){return o[t]-o[n]}:function(n,t){return r(i[n],i[t])});var s=[];return l.forEach(function(n){var t;s[n]={data:i[n],value:t=o[n],startAngle:a,endAngle:a+=t*c}}),s}var t=Number,r=Lc,e=0,u=2*ea;return n.value=function(r){return arguments.length?(t=r,n):t},n.sort=function(t){return arguments.length?(r=t,n):r},n.startAngle=function(t){return arguments.length?(e=t,n):e},n.endAngle=function(t){return arguments.length?(u=t,n):u},n};var Lc={};ko.layout.stack=function(){function n(a,c){var l=a.map(function(r,e){return t.call(n,r,e)}),s=l.map(function(t){return t.map(function(t,r){return[i.call(n,t,r),o.call(n,t,r)]})}),f=r.call(n,s,c);l=ko.permute(l,f),s=ko.permute(s,f);var h,g,p,d=e.call(n,s,c),v=l.length,m=l[0].length;for(g=0;m>g;++g)for(u.call(n,l[0][g],p=d[g],s[0][g][1]),h=1;v>h;++h)u.call(n,l[h][g],p+=s[h-1][g][1],s[h][g][1]);return a}var t=dt,r=_u,e=wu,u=bu,i=Mu,o=xu;return n.values=function(r){return arguments.length?(t=r,n):t},n.order=function(t){return arguments.length?(r="function"==typeof t?t:Hc.get(t)||_u,n):r},n.offset=function(t){return arguments.length?(e="function"==typeof t?t:Pc.get(t)||wu,n):e},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var Hc=ko.map({"inside-out":function(n){var t,r,e=n.length,u=n.map(Su),i=n.map(Eu),o=ko.range(e).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,l=[],s=[];for(t=0;e>t;++t)r=o[t],c>a?(a+=i[r],l.push(r)):(c+=i[r],s.push(r));return s.reverse().concat(l)},reverse:function(n){return ko.range(n.length).reverse()},"default":_u}),Pc=ko.map({silhouette:function(n){var t,r,e,u=n.length,i=n[0].length,o=[],a=0,c=[];for(r=0;i>r;++r){for(t=0,e=0;u>t;t++)e+=n[t][r][1];e>a&&(a=e),o.push(e)}for(r=0;i>r;++r)c[r]=(a-o[r])/2;return c},wiggle:function(n){var t,r,e,u,i,o,a,c,l,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=l=0,r=1;h>r;++r){for(t=0,u=0;s>t;++t)u+=n[t][r][1];for(t=0,i=0,a=f[r][0]-f[r-1][0];s>t;++t){for(e=0,o=(n[t][r][1]-n[t][r-1][1])/(2*a);t>e;++e)o+=(n[e][r][1]-n[e][r-1][1])/a;i+=o*n[t][r][1]}g[r]=c-=u?i/u*a:0,l>c&&(l=c)}for(r=0;h>r;++r)g[r]-=l;return g},expand:function(n){var t,r,e,u=n.length,i=n[0].length,o=1/u,a=[];for(r=0;i>r;++r){for(t=0,e=0;u>t;t++)e+=n[t][r][1];if(e)for(t=0;u>t;t++)n[t][r][1]/=e;else for(t=0;u>t;t++)n[t][r][1]=o}for(r=0;i>r;++r)a[r]=0;return a},zero:wu});ko.layout.histogram=function(){function n(n,i){for(var o,a,c=[],l=n.map(r,this),s=e.call(this,l,i),f=u.call(this,s,l,i),i=-1,h=l.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=l[i],a>=s[0]&&a<=s[1]&&(o=c[ko.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,r=Number,e=Tu,u=Au;return n.value=function(t){return arguments.length?(r=t,n):r},n.range=function(t){return arguments.length?(e=pt(t),n):e},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return Nu(n,t)}:pt(t),n):u},n.frequency=function(r){return arguments.length?(t=!!r,n):t},n},ko.layout.tree=function(){function n(n,i){function o(n,t){var e=n.children,u=n._tree;if(e&&(i=e.length)){for(var i,a,l,s=e[0],f=s,h=-1;++h<i;)l=e[h],o(l,a),f=c(l,a,f),a=l;Fu(n);var g=.5*(s._tree.prelim+l._tree.prelim);t?(u.prelim=t._tree.prelim+r(n,t),u.mod=u.prelim-g):u.prelim=g}else t&&(u.prelim=t._tree.prelim+r(n,t))}function a(n,t){n.x=n._tree.prelim+t;var r=n.children;if(r&&(e=r.length)){var e,u=-1;for(t+=n._tree.mod;++u<e;)a(r[u],t)}}function c(n,t,e){if(t){for(var u,i=n,o=n,a=t,c=n.parent.children[0],l=i._tree.mod,s=o._tree.mod,f=a._tree.mod,h=c._tree.mod;a=Cu(a),i=zu(i),a&&i;)c=zu(c),o=Cu(o),o._tree.ancestor=n,u=a._tree.prelim+f-i._tree.prelim-l+r(a,i),u>0&&(Ou(Ru(a,n,e),n,u),l+=u,s+=u),f+=a._tree.mod,l+=i._tree.mod,h+=c._tree.mod,s+=o._tree.mod;a&&!Cu(o)&&(o._tree.thread=a,o._tree.mod+=f-s),i&&!zu(c)&&(c._tree.thread=i,c._tree.mod+=l-h,e=n)}return e}var l=t.call(this,n,i),s=l[0];Pu(s,function(n,t){n._tree={ancestor:n,prelim:0,mod:0,change:0,shift:0,number:t?t._tree.number+1:0}}),o(s),a(s,-s._tree.prelim);var f=Du(s,Lu),h=Du(s,ju),g=Du(s,Hu),p=f.x-r(f,h)/2,d=h.x+r(h,f)/2,v=g.depth||1;return Pu(s,u?function(n){n.x*=e[0],n.y=n.depth*e[1],delete n._tree}:function(n){n.x=(n.x-p)/(d-p)*e[0],n.y=n.depth/v*e[1],delete n._tree}),l}var t=ko.layout.hierarchy().sort(null).value(null),r=qu,e=[1,1],u=!1;return n.separation=function(t){return arguments.length?(r=t,n):r},n.size=function(t){return arguments.length?(u=null==(e=t),n):u?null:e},n.nodeSize=function(t){return arguments.length?(u=null!=(e=t),n):u?e:null},pu(n,t)},ko.layout.pack=function(){function n(n,i){var o=r.call(this,n,i),a=o[0],c=u[0],l=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Pu(a,function(n){n.r=+s(n.value)}),Pu(a,Vu),e){var f=e*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;Pu(a,function(n){n.r+=f}),Pu(a,Vu),Pu(a,function(n){n.r-=f})}return Bu(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,r=ko.layout.hierarchy().sort(Iu),e=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(r){return arguments.length?(t=null==r||"function"==typeof r?r:+r,n):t},n.padding=function(t){return arguments.length?(e=+t,n):e},pu(n,r)},ko.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],l=0;Pu(c,function(n){var t=n.children;t&&t.length?(n.x=Gu(t),n.y=Ju(t)):(n.x=o?l+=r(n,o):0,n.y=0,o=n)});var s=Ku(c),f=Qu(c),h=s.x-r(s,f)/2,g=f.x+r(f,s)/2;return Pu(c,u?function(n){n.x=(n.x-c.x)*e[0],n.y=(c.y-n.y)*e[1]}:function(n){n.x=(n.x-h)/(g-h)*e[0],n.y=(1-(c.y?n.y/c.y:1))*e[1]}),a}var t=ko.layout.hierarchy().sort(null).value(null),r=qu,e=[1,1],u=!1;return n.separation=function(t){return arguments.length?(r=t,n):r},n.size=function(t){return arguments.length?(u=null==(e=t),n):u?null:e},n.nodeSize=function(t){return arguments.length?(u=null!=(e=t),n):u?e:null},pu(n,t)},ko.layout.treemap=function(){function n(n,t){for(var r,e,u=-1,i=n.length;++u<i;)e=(r=n[u]).value*(0>t?0:t),r.area=isNaN(e)||0>=e?0:e}function t(r){var i=r.children;if(i&&i.length){var o,a,c,l=f(r),s=[],h=i.slice(),p=1/0,d="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&r.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/r.value),s.area=0;(c=h.length)>0;)s.push(o=h[c-1]),s.area+=o.area,"squarify"!==g||(a=e(s,d))<=p?(h.pop(),p=a):(s.area-=s.pop().area,u(s,d,l,!1),d=Math.min(l.dx,l.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,d,l,!0),s.length=s.area=0),i.forEach(t)}}function r(t){var e=t.children;if(e&&e.length){var i,o=f(t),a=e.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);e.forEach(r)}}function e(n,t){for(var r,e=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(r=n[o].area)&&(i>r&&(i=r),r>u&&(u=r));return e*=e,t*=t,e?Math.max(t*u*p/e,e/(t*i*p)):1/0}function u(n,t,r,e){var u,i=-1,o=n.length,a=r.x,l=r.y,s=t?c(n.area/t):0;if(t==r.dx){for((e||s>r.dy)&&(s=r.dy);++i<o;)u=n[i],u.x=a,u.y=l,u.dy=s,a+=u.dx=Math.min(r.x+r.dx-a,s?c(u.area/s):0);u.z=!0,u.dx+=r.x+r.dx-a,r.y+=s,r.dy-=s}else{for((e||s>r.dx)&&(s=r.dx);++i<o;)u=n[i],u.x=a,u.y=l,u.dx=s,l+=u.dy=Math.min(r.y+r.dy-l,s?c(u.area/s):0);u.z=!1,u.dy+=r.y+r.dy-l,r.x+=s,r.dx-=s}}function i(e){var u=o||a(e),i=u[0];return i.x=0,i.y=0,i.dx=l[0],i.dy=l[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?r:t)(i),h&&(o=u),u}var o,a=ko.layout.hierarchy(),c=Math.round,l=[1,1],s=null,f=ni,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(l=n,i):l},i.padding=function(n){function t(t){var r=n.call(i,t,t.depth);return null==r?ni(t):ti(t,"number"==typeof r?[r,r,r,r]:r)}function r(t){return ti(t,n)}if(!arguments.length)return s;var e;return f=null==(s=n)?ni:"function"==(e=typeof n)?t:"number"===e?(n=[n,n,n,n],r):r,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},pu(i,a)},ko.random={normal:function(n,t){var r=arguments.length;return 2>r&&(t=1),1>r&&(n=0),function(){var r,e,u;do r=2*Math.random()-1,e=2*Math.random()-1,u=r*r+e*e;while(!u||u>1);return n+t*r*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=ko.random.normal.apply(ko,arguments);return function(){return Math.exp(n())}},irwinHall:function(n){return function(){for(var t=0,r=0;n>r;r++)t+=Math.random();return t/n}}},ko.scale={};var Fc={floor:dt,ceil:dt};ko.scale.linear=function(){return ci([0,1],[0,1],je,!1)},ko.scale.log=function(){return pi(ko.scale.linear().domain([0,1]),10,!0,[1,10])};var Oc=ko.format(".0e"),Rc={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ko.scale.pow=function(){return di(ko.scale.linear(),1,[0,1])},ko.scale.sqrt=function(){return ko.scale.pow().exponent(.5)},ko.scale.ordinal=function(){return mi([],{t:"range",a:[[]]})},ko.scale.category10=function(){return ko.scale.ordinal().range(Ic)},ko.scale.category20=function(){return ko.scale.ordinal().range(Yc)},ko.scale.category20b=function(){return ko.scale.ordinal().range(Uc)},ko.scale.category20c=function(){return ko.scale.ordinal().range(Zc)};var Ic=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(it),Yc=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(it),Uc=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(it),Zc=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(it);ko.scale.quantile=function(){return yi([],[])},ko.scale.quantize=function(){return Mi(0,1,[0,1])},ko.scale.threshold=function(){return xi([.5],[0,1])},ko.scale.identity=function(){return bi([0,1])},ko.svg.arc=function(){function n(){var n=t.apply(this,arguments),i=r.apply(this,arguments),o=e.apply(this,arguments)+Vc,a=u.apply(this,arguments)+Vc,c=(o>a&&(c=o,o=a,a=c),a-o),l=ea>c?"0":"1",s=Math.cos(o),f=Math.sin(o),h=Math.cos(a),g=Math.sin(a);return c>=Xc?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+n+"A"+n+","+n+" 0 1,0 0,"+-n+"A"+n+","+n+" 0 1,0 0,"+n+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":n?"M"+i*s+","+i*f+"A"+i+","+i+" 0 "+l+",1 "+i*h+","+i*g+"L"+n*h+","+n*g+"A"+n+","+n+" 0 "+l+",0 "+n*s+","+n*f+"Z":"M"+i*s+","+i*f+"A"+i+","+i+" 0 "+l+",1 "+i*h+","+i*g+"L0,0"+"Z"}var t=_i,r=wi,e=Si,u=Ei;return n.innerRadius=function(r){return arguments.length?(t=pt(r),n):t},n.outerRadius=function(t){return arguments.length?(r=pt(t),n):r},n.startAngle=function(t){return arguments.length?(e=pt(t),n):e},n.endAngle=function(t){return arguments.length?(u=pt(t),n):u},n.centroid=function(){var n=(t.apply(this,arguments)+r.apply(this,arguments))/2,i=(e.apply(this,arguments)+u.apply(this,arguments))/2+Vc;return[Math.cos(i)*n,Math.sin(i)*n]},n};var Vc=-ea/2,Xc=2*ea-1e-6;ko.svg.line.radial=function(){var n=Kr(ki);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},ue.reverse=ie,ie.reverse=ue,ko.svg.area=function(){return Ai(dt)},ko.svg.area.radial=function(){var n=Ai(ki);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},ko.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),l=t(this,o,n,a);return"M"+c.p0+e(c.r,c.p1,c.a1-c.a0)+(r(c,l)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,l.r,l.p0)+e(l.r,l.p1,l.a1-l.a0)+u(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,r,e){var u=t.call(n,r,e),i=a.call(n,u,e),o=c.call(n,u,e)+Vc,s=l.call(n,u,e)+Vc;return{r:i,a0:o,a1:s,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function r(n,t){return n.a0==t.a0&&n.a1==t.a1}function e(n,t,r){return"A"+n+","+n+" 0 "+ +(r>ea)+",1 "+t}function u(n,t,r,e){return"Q 0,0 "+e}var i=Yr,o=Ur,a=Ni,c=Si,l=Ei;return n.radius=function(t){return arguments.length?(a=pt(t),n):a},n.source=function(t){return arguments.length?(i=pt(t),n):i},n.target=function(t){return arguments.length?(o=pt(t),n):o},n.startAngle=function(t){return arguments.length?(c=pt(t),n):c},n.endAngle=function(t){return arguments.length?(l=pt(t),n):l},n},ko.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=r.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(e),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=Yr,r=Ur,e=Ti;return n.source=function(r){return arguments.length?(t=pt(r),n):t
},n.target=function(t){return arguments.length?(r=pt(t),n):r},n.projection=function(t){return arguments.length?(e=t,n):e},n},ko.svg.diagonal.radial=function(){var n=ko.svg.diagonal(),t=Ti,r=n.projection;return n.projection=function(n){return arguments.length?r(qi(t=n)):t},n},ko.svg.symbol=function(){function n(n,e){return($c.get(t.call(this,n,e))||Di)(r.call(this,n,e))}var t=Ci,r=zi;return n.type=function(r){return arguments.length?(t=pt(r),n):t},n.size=function(t){return arguments.length?(r=pt(t),n):r},n};var $c=ko.map({circle:Di,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*Gc)),r=t*Gc;return"M0,"+-t+"L"+r+",0"+" 0,"+t+" "+-r+",0"+"Z"},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/Jc),r=t*Jc/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Jc),r=t*Jc/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});ko.svg.symbolTypes=$c.keys();var Bc,Wc,Jc=Math.sqrt(3),Gc=Math.tan(30*oa),Kc=[],Qc=0;Kc.call=Wo.call,Kc.empty=Wo.empty,Kc.node=Wo.node,Kc.size=Wo.size,ko.transition=function(n){return arguments.length?Bc?n.transition():n:Ko.transition()},ko.transition.prototype=Kc,Kc.select=function(n){var t,r,e,u=this.id,i=[];n=d(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]);for(var c=this[o],l=-1,s=c.length;++l<s;)(e=c[l])&&(r=n.call(e,e.__data__,l,o))?("__data__"in e&&(r.__data__=e.__data__),Pi(r,l,u,e.__transition__[u]),t.push(r)):t.push(null)}return ji(i,u)},Kc.selectAll=function(n){var t,r,e,u,i,o=this.id,a=[];n=v(n);for(var c=-1,l=this.length;++c<l;)for(var s=this[c],f=-1,h=s.length;++f<h;)if(e=s[f]){i=e.__transition__[o],r=n.call(e,e.__data__,f,c),a.push(t=[]);for(var g=-1,p=r.length;++g<p;)(u=r[g])&&Pi(u,g,o,i),t.push(u)}return ji(a,o)},Kc.filter=function(n){var t,r,e,u=[];"function"!=typeof n&&(n=k(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var r=this[i],a=0,c=r.length;c>a;a++)(e=r[a])&&n.call(e,e.__data__,a)&&t.push(e)}return ji(u,this.id)},Kc.tween=function(n,t){var r=this.id;return arguments.length<2?this.node().__transition__[r].tween.get(n):N(this,null==t?function(t){t.__transition__[r].tween.remove(n)}:function(e){e.__transition__[r].tween.set(n,t)})},Kc.attr=function(n,t){function r(){this.removeAttribute(a)}function e(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?r:(n+="",function(){var t,r=this.getAttribute(a);return r!==n&&(t=o(r,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?e:(n+="",function(){var t,r=this.getAttributeNS(a.space,a.local);return r!==n&&(t=o(r,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?eu:je,a=ko.ns.qualify(n);return Li(this,"attr."+n,t,a.local?i:u)},Kc.attrTween=function(n,t){function r(n,r){var e=t.call(this,n,r,this.getAttribute(u));return e&&function(n){this.setAttribute(u,e(n))}}function e(n,r){var e=t.call(this,n,r,this.getAttributeNS(u.space,u.local));return e&&function(n){this.setAttributeNS(u.space,u.local,e(n))}}var u=ko.ns.qualify(n);return this.tween("attr."+n,u.local?e:r)},Kc.style=function(n,t,r){function e(){this.style.removeProperty(n)}function u(t){return null==t?e:(t+="",function(){var e,u=zo.getComputedStyle(this,null).getPropertyValue(n);return u!==t&&(e=je(u,t),function(t){this.style.setProperty(n,e(t),r)})})}var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(t="");for(r in n)this.style(r,n[r],t);return this}r=""}return Li(this,"style."+n,t,u)},Kc.styleTween=function(n,t,r){function e(e,u){var i=t.call(this,e,u,zo.getComputedStyle(this,null).getPropertyValue(n));return i&&function(t){this.style.setProperty(n,i(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,e)},Kc.text=function(n){return Li(this,"text",n,Hi)},Kc.remove=function(){return this.each("end.transition",function(){var n;this.__transition__.count<2&&(n=this.parentNode)&&n.removeChild(this)})},Kc.ease=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:("function"!=typeof n&&(n=ko.ease.apply(ko,arguments)),N(this,function(r){r.__transition__[t].ease=n}))},Kc.delay=function(n){var t=this.id;return N(this,"function"==typeof n?function(r,e,u){r.__transition__[t].delay=+n.call(r,r.__data__,e,u)}:(n=+n,function(r){r.__transition__[t].delay=n}))},Kc.duration=function(n){var t=this.id;return N(this,"function"==typeof n?function(r,e,u){r.__transition__[t].duration=Math.max(1,n.call(r,r.__data__,e,u))}:(n=Math.max(1,n),function(r){r.__transition__[t].duration=n}))},Kc.each=function(n,t){var r=this.id;if(arguments.length<2){var e=Wc,u=Bc;Bc=r,N(this,function(t,e,u){Wc=t.__transition__[r],n.call(t,t.__data__,e,u)}),Wc=e,Bc=u}else N(this,function(e){var u=e.__transition__[r];(u.event||(u.event=ko.dispatch("start","end"))).on(n,t)});return this},Kc.transition=function(){for(var n,t,r,e,u=this.id,i=++Qc,o=[],a=0,c=this.length;c>a;a++){o.push(n=[]);for(var t=this[a],l=0,s=t.length;s>l;l++)(r=t[l])&&(e=Object.create(r.__transition__[u]),e.delay+=e.duration,Pi(r,l,i,e)),n.push(r)}return ji(o,i)},ko.svg.axis=function(){function n(n){n.each(function(){var n,l=ko.select(this),s=null==c?r.ticks?r.ticks.apply(r,a):r.domain():c,f=null==t?r.tickFormat?r.tickFormat.apply(r,a):dt:t,h=l.selectAll(".tick").data(s,dt),g=h.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),p=ko.transition(h.exit()).style("opacity",1e-6).remove(),d=ko.transition(h).style("opacity",1),v=ei(r),m=l.selectAll(".domain").data([0]),y=(m.enter().append("path").attr("class","domain"),ko.transition(m)),M=r.copy(),x=this.__chart__||M;this.__chart__=M,g.append("line"),g.append("text");var b=g.select("line"),_=d.select("line"),w=h.select("text").text(f),S=g.select("text"),E=d.select("text");switch(e){case"bottom":n=Fi,b.attr("y2",u),S.attr("y",Math.max(u,0)+o),_.attr("x2",0).attr("y2",u),E.attr("x",0).attr("y",Math.max(u,0)+o),w.attr("dy",".71em").style("text-anchor","middle"),y.attr("d","M"+v[0]+","+i+"V0H"+v[1]+"V"+i);break;case"top":n=Fi,b.attr("y2",-u),S.attr("y",-(Math.max(u,0)+o)),_.attr("x2",0).attr("y2",-u),E.attr("x",0).attr("y",-(Math.max(u,0)+o)),w.attr("dy","0em").style("text-anchor","middle"),y.attr("d","M"+v[0]+","+-i+"V0H"+v[1]+"V"+-i);break;case"left":n=Oi,b.attr("x2",-u),S.attr("x",-(Math.max(u,0)+o)),_.attr("x2",-u).attr("y2",0),E.attr("x",-(Math.max(u,0)+o)).attr("y",0),w.attr("dy",".32em").style("text-anchor","end"),y.attr("d","M"+-i+","+v[0]+"H0V"+v[1]+"H"+-i);break;case"right":n=Oi,b.attr("x2",u),S.attr("x",Math.max(u,0)+o),_.attr("x2",u).attr("y2",0),E.attr("x",Math.max(u,0)+o).attr("y",0),w.attr("dy",".32em").style("text-anchor","start"),y.attr("d","M"+i+","+v[0]+"H0V"+v[1]+"H"+i)}if(r.rangeBand){var k=M.rangeBand()/2,A=function(n){return M(n)+k};g.call(n,A),d.call(n,A)}else g.call(n,x),d.call(n,M),p.call(n,M)})}var t,r=ko.scale.linear(),e=nl,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(r=t,n):r},n.orient=function(t){return arguments.length?(e=t in tl?t+"":nl,n):e},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(r){return arguments.length?(t=r,n):t},n.tickSize=function(t){var r=arguments.length;return r?(u=+t,i=+arguments[r-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var nl="bottom",tl={top:1,right:1,bottom:1,left:1};ko.svg.brush=function(){function n(i){i.each(function(){var i=ko.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=i.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=i.selectAll(".resize").data(v,dt);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return rl[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"),a.style("display",n.empty()?"none":null);var s,f=ko.transition(i),h=ko.transition(o);c&&(s=ei(c),h.attr("x",s[0]).attr("width",s[1]-s[0]),r(f)),l&&(s=ei(l),h.attr("y",s[0]).attr("height",s[1]-s[0]),e(f)),t(f)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function e(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function u(){function u(){32==ko.event.keyCode&&(N||(M=null,q[0]-=s[1],q[1]-=h[1],N=2),f())}function g(){32==ko.event.keyCode&&2==N&&(q[0]+=s[1],q[1]+=h[1],N=0,f())}function v(){var n=ko.mouse(b),u=!1;x&&(n[0]+=x[0],n[1]+=x[1]),N||(ko.event.altKey?(M||(M=[(s[0]+s[1])/2,(h[0]+h[1])/2]),q[0]=s[+(n[0]<M[0])],q[1]=h[+(n[1]<M[1])]):M=null),k&&m(n,c,0)&&(r(S),u=!0),A&&m(n,l,1)&&(e(S),u=!0),u&&(t(S),w({type:"brush",mode:N?"move":"resize"}))}function m(n,t,r){var e,u,a=ei(t),c=a[0],l=a[1],f=q[r],g=r?h:s,v=g[1]-g[0];return N&&(c-=f,l-=v+f),e=(r?d:p)?Math.max(c,Math.min(l,n[r])):n[r],N?u=(e+=f)+v:(M&&(f=Math.max(c,Math.min(l,2*M[r]-e))),e>f?(u=e,e=f):u=f),g[0]!=e||g[1]!=u?(r?o=null:i=null,g[0]=e,g[1]=u,!0):void 0}function y(){v(),S.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ko.select("body").style("cursor",null),z.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),T(),w({type:"brushend"})}var M,x,b=this,_=ko.select(ko.event.target),w=a.of(b,arguments),S=ko.select(b),E=_.datum(),k=!/^(n|s)$/.test(E)&&c,A=!/^(e|w)$/.test(E)&&l,N=_.classed("extent"),T=L(),q=ko.mouse(b),z=ko.select(zo).on("keydown.brush",u).on("keyup.brush",g);if(ko.event.changedTouches?z.on("touchmove.brush",v).on("touchend.brush",y):z.on("mousemove.brush",v).on("mouseup.brush",y),S.interrupt().selectAll("*").interrupt(),N)q[0]=s[0]-q[0],q[1]=h[0]-q[1];else if(E){var C=+/w$/.test(E),D=+/^n/.test(E);x=[s[1-C]-q[0],h[1-D]-q[1]],q[0]=s[C],q[1]=h[D]}else ko.event.altKey&&(M=q.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),ko.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),v()}var i,o,a=g(n,"brushstart","brush","brushend"),c=null,l=null,s=[0,0],h=[0,0],p=!0,d=!0,v=el[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:s,y:h,i:i,j:o},r=this.__chart__||t;this.__chart__=t,Bc?ko.select(this).transition().each("start.brush",function(){i=r.i,o=r.j,s=r.x,h=r.y,n({type:"brushstart"})}).tween("brush:brush",function(){var r=Le(s,t.x),e=Le(h,t.y);return i=o=null,function(u){s=t.x=r(u),h=t.y=e(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=el[!c<<1|!l],n):c},n.y=function(t){return arguments.length?(l=t,v=el[!c<<1|!l],n):l},n.clamp=function(t){return arguments.length?(c&&l?(p=!!t[0],d=!!t[1]):c?p=!!t:l&&(d=!!t),n):c&&l?[p,d]:c?p:l?d:null},n.extent=function(t){var r,e,u,a,f;return arguments.length?(c&&(r=t[0],e=t[1],l&&(r=r[0],e=e[0]),i=[r,e],c.invert&&(r=c(r),e=c(e)),r>e&&(f=r,r=e,e=f),(r!=s[0]||e!=s[1])&&(s=[r,e])),l&&(u=t[0],a=t[1],c&&(u=u[1],a=a[1]),o=[u,a],l.invert&&(u=l(u),a=l(a)),u>a&&(f=u,u=a,a=f),(u!=h[0]||a!=h[1])&&(h=[u,a])),n):(c&&(i?(r=i[0],e=i[1]):(r=s[0],e=s[1],c.invert&&(r=c.invert(r),e=c.invert(e)),r>e&&(f=r,r=e,e=f))),l&&(o?(u=o[0],a=o[1]):(u=h[0],a=h[1],l.invert&&(u=l.invert(u),a=l.invert(a)),u>a&&(f=u,u=a,a=f))),c&&l?[[r,u],[e,a]]:c?[r,e]:l&&[u,a])},n.clear=function(){return n.empty()||(s=[0,0],h=[0,0],i=o=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!l&&h[0]==h[1]},ko.rebind(n,a,"on")};var rl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},el=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],ul=ko.time={},il=Date,ol=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Ri.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(){al.setUTCDate.apply(this._,arguments)},setDay:function(){al.setUTCDay.apply(this._,arguments)},setFullYear:function(){al.setUTCFullYear.apply(this._,arguments)},setHours:function(){al.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){al.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){al.setUTCMinutes.apply(this._,arguments)},setMonth:function(){al.setUTCMonth.apply(this._,arguments)},setSeconds:function(){al.setUTCSeconds.apply(this._,arguments)},setTime:function(){al.setTime.apply(this._,arguments)}};var al=Date.prototype,cl="%a %b %e %X %Y",ll="%m/%d/%Y",sl="%H:%M:%S",fl=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],hl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],gl=["January","February","March","April","May","June","July","August","September","October","November","December"],pl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];ul.year=Ii(function(n){return n=ul.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ul.years=ul.year.range,ul.years.utc=ul.year.utc.range,ul.day=Ii(function(n){var t=new il(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}),ul.days=ul.day.range,ul.days.utc=ul.day.utc.range,ul.dayOfYear=function(n){var t=ul.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},ol.forEach(function(n,t){n=n.toLowerCase(),t=7-t;var r=ul[n]=Ii(function(n){return(n=ul.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var r=ul.year(n).getDay();return Math.floor((ul.dayOfYear(n)+(r+t)%7)/7)-(r!==t)});ul[n+"s"]=r.range,ul[n+"s"].utc=r.utc.range,ul[n+"OfYear"]=function(n){var r=ul.year(n).getDay();return Math.floor((ul.dayOfYear(n)+(r+t)%7)/7)}}),ul.week=ul.sunday,ul.weeks=ul.sunday.range,ul.weeks.utc=ul.sunday.utc.range,ul.weekOfYear=ul.sundayOfYear,ul.format=Ui;var dl=Vi(fl),vl=Xi(fl),ml=Vi(hl),yl=Xi(hl),Ml=Vi(gl),xl=Xi(gl),bl=Vi(pl),_l=Xi(pl),wl=/^%/,Sl={"-":"",_:" ",0:"0"},El={a:function(n){return hl[n.getDay()]},A:function(n){return fl[n.getDay()]},b:function(n){return pl[n.getMonth()]},B:function(n){return gl[n.getMonth()]},c:Ui(cl),d:function(n,t){return $i(n.getDate(),t,2)},e:function(n,t){return $i(n.getDate(),t,2)},H:function(n,t){return $i(n.getHours(),t,2)},I:function(n,t){return $i(n.getHours()%12||12,t,2)},j:function(n,t){return $i(1+ul.dayOfYear(n),t,3)},L:function(n,t){return $i(n.getMilliseconds(),t,3)},m:function(n,t){return $i(n.getMonth()+1,t,2)},M:function(n,t){return $i(n.getMinutes(),t,2)},p:function(n){return n.getHours()>=12?"PM":"AM"},S:function(n,t){return $i(n.getSeconds(),t,2)},U:function(n,t){return $i(ul.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return $i(ul.mondayOfYear(n),t,2)},x:Ui(ll),X:Ui(sl),y:function(n,t){return $i(n.getFullYear()%100,t,2)},Y:function(n,t){return $i(n.getFullYear()%1e4,t,4)},Z:mo,"%":function(){return"%"}},kl={a:Bi,A:Wi,b:Qi,B:no,c:to,d:lo,e:lo,H:fo,I:fo,j:so,L:po,m:co,M:ho,p:vo,S:go,U:Gi,w:Ji,W:Ki,x:ro,X:eo,y:io,Y:uo,Z:oo,"%":yo},Al=/^\s*\d+/,Nl=ko.map({am:0,pm:1});Ui.utc=Mo;var Tl=Mo("%Y-%m-%dT%H:%M:%S.%LZ");Ui.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?xo:Tl,xo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},xo.toString=Tl.toString,ul.second=Ii(function(n){return new il(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ul.seconds=ul.second.range,ul.seconds.utc=ul.second.utc.range,ul.minute=Ii(function(n){return new il(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ul.minutes=ul.minute.range,ul.minutes.utc=ul.minute.utc.range,ul.hour=Ii(function(n){var t=n.getTimezoneOffset()/60;return new il(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ul.hours=ul.hour.range,ul.hours.utc=ul.hour.utc.range,ul.month=Ii(function(n){return n=ul.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ul.months=ul.month.range,ul.months.utc=ul.month.utc.range;var ql=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],zl=[[ul.second,1],[ul.second,5],[ul.second,15],[ul.second,30],[ul.minute,1],[ul.minute,5],[ul.minute,15],[ul.minute,30],[ul.hour,1],[ul.hour,3],[ul.hour,6],[ul.hour,12],[ul.day,1],[ul.day,2],[ul.week,1],[ul.month,1],[ul.month,3],[ul.year,1]],Cl=[[Ui("%Y"),$t],[Ui("%B"),function(n){return n.getMonth()}],[Ui("%b %d"),function(n){return 1!=n.getDate()}],[Ui("%a %d"),function(n){return n.getDay()&&1!=n.getDate()}],[Ui("%I %p"),function(n){return n.getHours()}],[Ui("%I:%M"),function(n){return n.getMinutes()}],[Ui(":%S"),function(n){return n.getSeconds()}],[Ui(".%L"),function(n){return n.getMilliseconds()}]],Dl=wo(Cl);zl.year=ul.year,ul.scale=function(){return bo(ko.scale.linear(),zl,Dl)};var jl={range:function(n,t,r){return ko.range(+n,+t,r).map(_o)}},Ll=zl.map(function(n){return[n[0].utc,n[1]]}),Hl=[[Mo("%Y"),$t],[Mo("%B"),function(n){return n.getUTCMonth()}],[Mo("%b %d"),function(n){return 1!=n.getUTCDate()}],[Mo("%a %d"),function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],[Mo("%I %p"),function(n){return n.getUTCHours()}],[Mo("%I:%M"),function(n){return n.getUTCMinutes()}],[Mo(":%S"),function(n){return n.getUTCSeconds()}],[Mo(".%L"),function(n){return n.getUTCMilliseconds()}]],Pl=wo(Hl);return Ll.year=ul.year.utc,ul.scale.utc=function(){return bo(ko.scale.linear(),Ll,Pl)},ko.text=vt(function(n){return n.responseText}),ko.json=function(n,t){return mt(n,"application/json",So,t)},ko.html=function(n,t){return mt(n,"text/html",Eo,t)},ko.xml=vt(function(n){return n.responseXML}),ko}();