c.x&&(c=t),t.depth>h.depth&&(h=t)}));var d=u===c?1:t(u,c)/2,f=d-u.x,p=e/(c.x+d+f),m=r/(h.depth||1);a.eachBefore((function(t){t.x=(t.x+f)*p,t.y=t.depth*m}))}return a}function i(e){var r=e.children,n=e.parent.children,a=e.i?n[e.i-1]:null;if(r){!function(t){for(var e,r=0,n=0,a=t.children,i=a.length;--i>=0;)(e=a[i]).z+=r,e.m+=r,r+=e.s+(n+=e.c)}(e);var i=(r[0].z+r[r.length-1].z)/2;a?(e.z=a.z+t(e._,a._),e.m=e.z-i):e.z=i}else a&&(e.z=a.z+t(e._,a._));e.parent.A=function(e,r,n){if(r){for(var a,i=e,o=e,s=r,l=i.parent.children[0],u=i.m,c=o.m,h=s.m,d=l.m;s=Y(s),i=N(i),s&&i;)l=N(l),(o=Y(o)).a=e,(a=s.z+h-i.z-u+t(s._,i._))>0&&(j(B(s,e,n),e,a),u+=a,c+=a),h+=s.m,u+=i.m,d+=l.m,c+=o.m;s&&!Y(o)&&(o.t=s,o.m+=h-c),i&&!N(l)&&(l.t=i,l.m+=u-d,n=e)}return n}(e,a,e.parent.A||n[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*r}return a.separation=function(e){return arguments.length?(t=e,a):t},a.size=function(t){return arguments.length?(n=!1,e=+t[0],r=+t[1],a):n?null:[e,r]},a.nodeSize=function(t){return arguments.length?(n=!0,e=+t[0],r=+t[1],a):n?[e,r]:null},a},t.treemap=function(){var t=G,e=!1,r=1,n=1,a=[0],i=T,o=T,s=T,l=T,u=T;function c(t){return t.x0=t.y0=0,t.x1=r,t.y1=n,t.eachBefore(h),a=[0],e&&t.eachBefore(D),t}function h(e){var r=a[e.depth],n=e.x0+r,c=e.y0+r,h=e.x1-r,d=e.y1-r;h=r-1){var c=s[e];return c.x0=a,c.y0=i,c.x1=o,void(c.y1=l)}for(var h=u[e],d=n/2+h,f=e+1,p=r-1;f>>1;u[m]l-i){var v=(a*y+o*g)/n;t(e,f,g,a,i,v,l),t(f,r,y,v,i,o,l)}else{var _=(i*y+l*g)/n;t(e,f,g,a,i,o,_),t(f,r,y,a,_,o,l)}}(0,l,t.value,e,r,n,a)},t.treemapDice=P,t.treemapSlice=U,t.treemapSliceDice=function(t,e,r,n,a){(1&t.depth?U:P)(t,e,r,n,a)},t.treemapSquarify=G,t.treemapResquarify=q,Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.d3=this.d3||{})},{}],158:[function(t,e,r){var n,a;n=this,a=function(t,e){function r(t,e,r,n,a){var i=t*t,o=i*t;return((1-3*t+3*i-o)*e+(4-6*i+3*o)*r+(1+3*t+3*i-3*o)*n+o*a)/6}function n(t){var e=t.length-1;return function(n){var a=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[a],o=t[a+1],s=a>0?t[a-1]:2*i-o,l=a180||r<-180?r-360*Math.round(r/360):r):i(isNaN(t)?e:t)}function l(t,e){var r=e-t;return r?o(t,r):i(isNaN(t)?e:t)}var u=function t(r){var n=function(t){return 1==(t=+t)?l:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):i(isNaN(e)?r:e)}}(r);function a(t,r){var a=n((t=e.rgb(t)).r,(r=e.rgb(r)).r),i=n(t.g,r.g),o=n(t.b,r.b),s=l(t.opacity,r.opacity);return function(e){return t.r=a(e),t.g=i(e),t.b=o(e),t.opacity=s(e),t+""}}return a.gamma=t,a}(1);function c(t){return function(r){var n,a,i=r.length,o=new Array(i),s=new Array(i),l=new Array(i);for(n=0;ni&&(a=e.slice(i,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:m(r,n)})),i=v.lastIndex;return i180?e+=360:e-t>180&&(t+=360),i.push({i:r.push(a(r)+"rotate(",null,n)-2,x:m(t,e)})):e&&r.push(a(r)+"rotate("+e+n)}(i.rotate,o.rotate,s,l),function(t,e,r,i){t!==e?i.push({i:r.push(a(r)+"skewX(",null,n)-2,x:m(t,e)}):e&&r.push(a(r)+"skewX("+e+n)}(i.skewX,o.skewX,s,l),function(t,e,r,n,i,o){if(t!==r||e!==n){var s=i.push(a(i)+"scale(",null,",",null,")");o.push({i:s-4,x:m(t,r)},{i:s-2,x:m(e,n)})}else 1===r&&1===n||i.push(a(i)+"scale("+r+","+n+")")}(i.scaleX,i.scaleY,o.scaleX,o.scaleY,s,l),i=o=null,function(t){for(var e,r=-1,n=l.length;++r1e-6)if(Math.abs(h*l-u*c)>1e-6&&i){var f=n-o,p=a-s,m=l*l+u*u,g=f*f+p*p,y=Math.sqrt(m),v=Math.sqrt(d),_=i*Math.tan((e-Math.acos((m+d-g)/(2*y*v)))/2),x=_/v,b=_/y;Math.abs(x-1)>1e-6&&(this._+="L"+(t+x*c)+","+(r+x*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>c*p)+","+(this._x1=t+b*l)+","+(this._y1=r+b*u)}else this._+="L"+(this._x1=t)+","+(this._y1=r)},arc:function(t,a,i,o,s,l){t=+t,a=+a;var u=(i=+i)*Math.cos(o),c=i*Math.sin(o),h=t+u,d=a+c,f=1^l,p=l?o-s:s-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+h+","+d:(Math.abs(this._x1-h)>1e-6||Math.abs(this._y1-d)>1e-6)&&(this._+="L"+h+","+d),i&&(p<0&&(p=p%r+r),p>n?this._+="A"+i+","+i+",0,1,"+f+","+(t-u)+","+(a-c)+"A"+i+","+i+",0,1,"+f+","+(this._x1=h)+","+(this._y1=d):p>1e-6&&(this._+="A"+i+","+i+",0,"+ +(p>=e)+","+f+","+(this._x1=t+i*Math.cos(s))+","+(this._y1=a+i*Math.sin(s))))},rect:function(t,e,r,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},t.path=i,Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.d3=this.d3||{})},{}],160:[function(t,e,r){(function(t){function e(t,e,r,n){if(isNaN(e)||isNaN(r))return t;var a,i,o,s,l,u,c,h,d,f=t._root,p={data:n},m=t._x0,g=t._y0,y=t._x1,v=t._y1;if(!f)return t._root=p,t;for(;f.length;)if((u=e>=(i=(m+y)/2))?m=i:y=i,(c=r>=(o=(g+v)/2))?g=o:v=o,a=f,!(f=f[h=c<<1|u]))return a[h]=p,t;if(s=+t._x.call(null,f.data),l=+t._y.call(null,f.data),e===s&&r===l)return p.next=f,a?a[h]=p:t._root=p,t;do{a=a?a[h]=new Array(4):t._root=new Array(4),(u=e>=(i=(m+y)/2))?m=i:y=i,(c=r>=(o=(g+v)/2))?g=o:v=o}while((h=c<<1|u)==(d=(l>=o)<<1|s>=i));return a[d]=f,a[h]=p,t}var r=function(t,e,r,n,a){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=a};function n(t){return t[0]}function a(t){return t[1]}function i(t,e,r){var i=new o(null==e?n:e,null==r?a:r,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function o(t,e,r,n,a,i){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=a,this._y1=i,this._root=void 0}function s(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var l=i.prototype=o.prototype;l.copy=function(){var t,e,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var a=0;a<4;++a)(e=n.source[a])&&(e.length?t.push({source:e,target:n.target[a]=new Array(4)}):n.target[a]=s(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,a,i,o=t.length,s=new Array(o),l=new Array(o),u=1/0,c=1/0,h=-1/0,d=-1/0;for(n=0;nh&&(h=a),id&&(d=i));for(ht||t>a||n>e||e>i))return this;var o,s,l=a-r,u=this._root;switch(s=(e<(n+i)/2)<<1|t<(r+a)/2){case 0:do{(o=new Array(4))[s]=u,u=o}while(i=n+(l*=2),t>(a=r+l)||e>i);break;case 1:do{(o=new Array(4))[s]=u,u=o}while(i=n+(l*=2),(r=a-l)>t||e>i);break;case 2:do{(o=new Array(4))[s]=u,u=o}while(n=i-(l*=2),t>(a=r+l)||n>e);break;case 3:do{(o=new Array(4))[s]=u,u=o}while(n=i-(l*=2),(r=a-l)>t||n>e)}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=n,this._x1=a,this._y1=i,this},l.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,n){var a,i,o,s,l,u,c,h=this._x0,d=this._y0,f=this._x1,p=this._y1,m=[],g=this._root;for(g&&m.push(new r(g,h,d,f,p)),null==n?n=1/0:(h=t-n,d=e-n,f=t+n,p=e+n,n*=n);u=m.pop();)if(!(!(g=u.node)||(i=u.x0)>f||(o=u.y0)>p||(s=u.x1)=v)<<1|t>=y)&&(u=m[m.length-1],m[m.length-1]=m[m.length-1-c],m[m.length-1-c]=u)}else{var _=t-+this._x.call(null,g.data),x=e-+this._y.call(null,g.data),b=_*_+x*x;if(b=(s=(p+g)/2))?p=s:g=s,(c=o>=(l=(m+y)/2))?m=l:y=l,e=f,!(f=f[h=c<<1|u]))return this;if(!f.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,d=h)}for(;f.data!==t;)if(n=f,!(f=f.next))return this;return(a=f.next)&&delete f.next,n?(a?n.next=a:delete n.next,this):e?(a?e[h]=a:delete e[h],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(r?r[d]=f:this._root=f),this):(this._root=a,this)},l.removeAll=function(t){for(var e=0,r=t.length;e=1?d:t<=-1?-d:Math.asin(t)}function m(t){return t.innerRadius}function g(t){return t.outerRadius}function y(t){return t.startAngle}function v(t){return t.endAngle}function _(t){return t&&t.padAngle}function x(t,e,r,n,a,i,s){var l=t-r,c=e-n,h=(s?i:-i)/u(l*l+c*c),d=h*c,f=-h*l,p=t+d,m=e+f,g=r+d,y=n+f,v=(p+g)/2,_=(m+y)/2,x=g-p,b=y-m,w=x*x+b*b,M=a-i,k=p*y-g*m,T=(b<0?-1:1)*u(o(0,M*M*w-k*k)),L=(k*b-x*T)/w,A=(-k*x-b*T)/w,S=(k*b+x*T)/w,E=(-k*x+b*T)/w,C=L-v,D=A-_,P=S-v,O=E-_;return C*C+D*D>P*P+O*O&&(L=S,A=E),{cx:L,cy:A,x01:-d,y01:-f,x11:L*(a/M-1),y11:A*(a/M-1)}}function b(t){this._context=t}function w(t){return new b(t)}function M(t){return t[0]}function k(t){return t[1]}function T(){var t=M,n=k,a=r(!0),i=null,o=w,s=null;function l(r){var l,u,c,h=r.length,d=!1;for(null==i&&(s=o(c=e.path())),l=0;l<=h;++l)!(l=h;--d)u.point(y[d],v[d]);u.lineEnd(),u.areaEnd()}g&&(y[c]=+t(f,c,r),v[c]=+a(f,c,r),u.point(n?+n(f,c,r):y[c],i?+i(f,c,r):v[c]))}if(p)return u=null,p+""||null}function h(){return T().defined(o).curve(l).context(s)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),n=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:r(+t),c):n},c.y=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),i=null,c):a},c.y0=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),c):a},c.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:r(+t),c):i},c.lineX0=c.lineY0=function(){return h().x(t).y(a)},c.lineY1=function(){return h().x(t).y(i)},c.lineX1=function(){return h().x(n).y(a)},c.defined=function(t){return arguments.length?(o="function"==typeof t?t:r(!!t),c):o},c.curve=function(t){return arguments.length?(l=t,null!=s&&(u=l(s)),c):l},c.context=function(t){return arguments.length?(null==t?s=u=null:u=l(s=t),c):s},c}function A(t,e){return et?1:e>=t?0:NaN}function S(t){return t}b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var E=D(w);function C(t){this._curve=t}function D(t){function e(e){return new C(t(e))}return e._curve=t,e}function P(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(D(t)):e()._curve},t}function O(){return P(T().curve(E))}function z(){var t=L().curve(E),e=t.curve,r=t.lineX0,n=t.lineX1,a=t.lineY0,i=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return P(r())},delete t.lineX0,t.lineEndAngle=function(){return P(n())},delete t.lineX1,t.lineInnerRadius=function(){return P(a())},delete t.lineY0,t.lineOuterRadius=function(){return P(i())},delete t.lineY1,t.curve=function(t){return arguments.length?e(D(t)):e()._curve},t}function I(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]}C.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var R=Array.prototype.slice;function F(t){return t.source}function N(t){return t.target}function Y(t){var n=F,a=N,i=M,o=k,s=null;function l(){var r,l=R.call(arguments),u=n.apply(this,l),c=a.apply(this,l);if(s||(s=r=e.path()),t(s,+i.apply(this,(l[0]=u,l)),+o.apply(this,l),+i.apply(this,(l[0]=c,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(t){return arguments.length?(n=t,l):n},l.target=function(t){return arguments.length?(a=t,l):a},l.x=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),l):i},l.y=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),l):o},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function j(t,e,r,n,a){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,a,n,a)}function B(t,e,r,n,a){t.moveTo(e,r),t.bezierCurveTo(e,r=(r+a)/2,n,r,n,a)}function H(t,e,r,n,a){var i=I(e,r),o=I(e,r=(r+a)/2),s=I(n,r),l=I(n,a);t.moveTo(i[0],i[1]),t.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var U={draw:function(t,e){var r=Math.sqrt(e/h);t.moveTo(r,0),t.arc(0,0,r,0,f)}},V={draw:function(t,e){var r=Math.sqrt(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},W=Math.sqrt(1/3),G=2*W,q={draw:function(t,e){var r=Math.sqrt(e/G),n=r*W;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Z=Math.sin(h/10)/Math.sin(7*h/10),X=Math.sin(f/10)*Z,J=-Math.cos(f/10)*Z,K={draw:function(t,e){var r=Math.sqrt(.8908130915292852*e),n=X*r,a=J*r;t.moveTo(0,-r),t.lineTo(n,a);for(var i=1;i<5;++i){var o=f*i/5,s=Math.cos(o),l=Math.sin(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*a,l*n+s*a)}t.closePath()}},$={draw:function(t,e){var r=Math.sqrt(e),n=-r/2;t.rect(n,n,r,r)}},Q=Math.sqrt(3),tt={draw:function(t,e){var r=-Math.sqrt(e/(3*Q));t.moveTo(0,2*r),t.lineTo(-Q*r,-r),t.lineTo(Q*r,-r),t.closePath()}},et=-.5,rt=Math.sqrt(3)/2,nt=1/Math.sqrt(12),at=3*(nt/2+1),it={draw:function(t,e){var r=Math.sqrt(e/at),n=r/2,a=r*nt,i=n,o=r*nt+r,s=-i,l=o;t.moveTo(n,a),t.lineTo(i,o),t.lineTo(s,l),t.lineTo(et*n-rt*a,rt*n+et*a),t.lineTo(et*i-rt*o,rt*i+et*o),t.lineTo(et*s-rt*l,rt*s+et*l),t.lineTo(et*n+rt*a,et*a-rt*n),t.lineTo(et*i+rt*o,et*o-rt*i),t.lineTo(et*s+rt*l,et*l-rt*s),t.closePath()}},ot=[U,V,q,$,K,tt,it];function st(){}function lt(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function ut(t){this._context=t}function ct(t){this._context=t}function ht(t){this._context=t}function dt(t,e){this._basis=new ut(t),this._beta=e}ut.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:lt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ct.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},ht.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},dt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,r=t.length-1;if(r>0)for(var n,a=t[0],i=e[0],o=t[r]-a,s=e[r]-i,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*t[l]+(1-this._beta)*(a+n*o),this._beta*e[l]+(1-this._beta)*(i+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var ft=function t(e){function r(t){return 1===e?new ut(t):new dt(t,e)}return r.beta=function(e){return t(+e)},r}(.85);function pt(t,e,r){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-r),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:pt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gt=function t(e){function r(t){return new mt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var vt=function t(e){function r(t){return new yt(t,e)}return r.tension=function(e){return t(+e)},r}(0);function _t(t,e){this._context=t,this._k=(1-e)/6}_t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:pt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xt=function t(e){function r(t){return new _t(t,e)}return r.tension=function(e){return t(+e)},r}(0);function bt(t,e,r){var n=t._x1,a=t._y1,i=t._x2,o=t._y2;if(t._l01_a>c){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,a=(a*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>c){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*u+t._x1*t._l23_2a-e*t._l12_2a)/h,o=(o*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,a,i,o,t._x2,t._y2)}function wt(t,e){this._context=t,this._alpha=e}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Mt=function t(e){function r(t){return e?new wt(t,e):new mt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function kt(t,e){this._context=t,this._alpha=e}kt.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Tt=function t(e){function r(t){return e?new kt(t,e):new yt(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function Lt(t,e){this._context=t,this._alpha=e}Lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var r=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:bt(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var At=function t(e){function r(t){return e?new Lt(t,e):new _t(t,0)}return r.alpha=function(e){return t(+e)},r}(.5);function St(t){this._context=t}function Et(t){return t<0?-1:1}function Ct(t,e,r){var n=t._x1-t._x0,a=e-t._x1,i=(t._y1-t._y0)/(n||a<0&&-0),o=(r-t._y1)/(a||n<0&&-0),s=(i*a+o*n)/(n+a);return(Et(i)+Et(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(s))||0}function Dt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Pt(t,e,r){var n=t._x0,a=t._y0,i=t._x1,o=t._y1,s=(i-n)/3;t._context.bezierCurveTo(n+s,a+s*e,i-s,o-s*r,i,o)}function Ot(t){this._context=t}function zt(t){this._context=new It(t)}function It(t){this._context=t}function Rt(t){this._context=t}function Ft(t){var e,r,n=t.length-1,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=t[0]+2*t[1],e=1;e=0;--e)a[e]=(o[e]-a[e+1])/i[e];for(i[n-1]=(t[n]+a[n-1])/2,e=0;e1)for(var r,n,a,i=1,o=t[e[0]],s=o.length;i=0;)r[e]=e;return r}function Bt(t,e){return t[e]}function Ht(t){var e=t.map(Ut);return jt(t).sort((function(t,r){return e[t]-e[r]}))}function Ut(t){for(var e,r=-1,n=0,a=t.length,i=-1/0;++ri&&(i=e,n=r);return n}function Vt(t){var e=t.map(Wt);return jt(t).sort((function(t,r){return e[t]-e[r]}))}function Wt(t){for(var e,r=0,n=-1,a=t.length;++n=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}},t.arc=function(){var t=m,o=g,b=r(0),w=null,M=y,k=v,T=_,L=null;function A(){var r,m,g,y=+t.apply(this,arguments),v=+o.apply(this,arguments),_=M.apply(this,arguments)-d,A=k.apply(this,arguments)-d,S=n(A-_),E=A>_;if(L||(L=r=e.path()),vc)if(S>f-c)L.moveTo(v*i(_),v*l(_)),L.arc(0,0,v,_,A,!E),y>c&&(L.moveTo(y*i(A),y*l(A)),L.arc(0,0,y,A,_,E));else{var C,D,P=_,O=A,z=_,I=A,R=S,F=S,N=T.apply(this,arguments)/2,Y=N>c&&(w?+w.apply(this,arguments):u(y*y+v*v)),j=s(n(v-y)/2,+b.apply(this,arguments)),B=j,H=j;if(Y>c){var U=p(Y/y*l(N)),V=p(Y/v*l(N));(R-=2*U)>c?(z+=U*=E?1:-1,I-=U):(R=0,z=I=(_+A)/2),(F-=2*V)>c?(P+=V*=E?1:-1,O-=V):(F=0,P=O=(_+A)/2)}var W=v*i(P),G=v*l(P),q=y*i(I),Z=y*l(I);if(j>c){var X,J=v*i(O),K=v*l(O),$=y*i(z),Q=y*l(z);if(S1?0:g<-1?h:Math.acos(g))/2),it=u(X[0]*X[0]+X[1]*X[1]);B=s(j,(y-it)/(at-1)),H=s(j,(v-it)/(at+1))}}F>c?H>c?(C=x($,Q,W,G,v,H,E),D=x(J,K,q,Z,v,H,E),L.moveTo(C.cx+C.x01,C.cy+C.y01),Hc&&R>c?B>c?(C=x(q,Z,J,K,y,-B,E),D=x(W,G,$,Q,y,-B,E),L.lineTo(C.cx+C.x01,C.cy+C.y01),B0&&(p+=h);for(null!=e?m.sort((function(t,r){return e(g[t],g[r])})):null!=n&&m.sort((function(t,e){return n(r[t],r[e])})),s=0,u=p?(v-d*x)/p:0;s0?h*u:0)+x,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:c,padAngle:_};return g}return s.value=function(e){return arguments.length?(t="function"==typeof e?e:r(+e),s):t},s.sortValues=function(t){return arguments.length?(e=t,n=null,s):e},s.sort=function(t){return arguments.length?(n=t,e=null,s):n},s.startAngle=function(t){return arguments.length?(a="function"==typeof t?t:r(+t),s):a},s.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:r(+t),s):i},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:r(+t),s):o},s},t.areaRadial=z,t.radialArea=z,t.lineRadial=O,t.radialLine=O,t.pointRadial=I,t.linkHorizontal=function(){return Y(j)},t.linkVertical=function(){return Y(B)},t.linkRadial=function(){var t=Y(H);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=r(U),n=r(64),a=null;function i(){var r;if(a||(a=r=e.path()),t.apply(this,arguments).draw(a,+n.apply(this,arguments)),r)return a=null,r+""||null}return i.type=function(e){return arguments.length?(t="function"==typeof e?e:r(e),i):t},i.size=function(t){return arguments.length?(n="function"==typeof t?t:r(+t),i):n},i.context=function(t){return arguments.length?(a=null==t?null:t,i):a},i},t.symbols=ot,t.symbolCircle=U,t.symbolCross=V,t.symbolDiamond=q,t.symbolSquare=$,t.symbolStar=K,t.symbolTriangle=tt,t.symbolWye=it,t.curveBasisClosed=function(t){return new ct(t)},t.curveBasisOpen=function(t){return new ht(t)},t.curveBasis=function(t){return new ut(t)},t.curveBundle=ft,t.curveCardinalClosed=vt,t.curveCardinalOpen=xt,t.curveCardinal=gt,t.curveCatmullRomClosed=Tt,t.curveCatmullRomOpen=At,t.curveCatmullRom=Mt,t.curveLinearClosed=function(t){return new St(t)},t.curveLinear=w,t.curveMonotoneX=function(t){return new Ot(t)},t.curveMonotoneY=function(t){return new zt(t)},t.curveNatural=function(t){return new Rt(t)},t.curveStep=function(t){return new Nt(t,.5)},t.curveStepAfter=function(t){return new Nt(t,1)},t.curveStepBefore=function(t){return new Nt(t,0)},t.stack=function(){var t=r([]),e=jt,n=Yt,a=Bt;function i(r){var i,o,s=t.apply(this,arguments),l=r.length,u=s.length,c=new Array(u);for(i=0;i0){for(var r,n,a,i=0,o=t[0].length;i1)for(var r,n,a,i,o,s,l=0,u=t[e[0]].length;l=0?(n[0]=i,n[1]=i+=a):a<0?(n[1]=o,n[0]=o+=a):n[0]=i},t.stackOffsetNone=Yt,t.stackOffsetSilhouette=function(t,e){if((r=t.length)>0){for(var r,n=0,a=t[e[0]],i=a.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,a,i=0,o=1;o=0&&r._call.call(null,t),r=r._next;--n}function g(){s=(o=u.now())+l,n=a=0;try{m()}finally{n=0,function(){for(var t,n,a=e,i=1/0;a;)a._call?(i>a._time&&(i=a._time),t=a,a=a._next):(n=a._next,a._next=null,a=t?t._next=n:e=n);r=t,v(i)}(),s=0}}function y(){var t=u.now(),e=t-o;e>1e3&&(l-=e,o=t)}function v(t){n||(a&&(a=clearTimeout(a)),t-s>24?(t<1/0&&(a=setTimeout(g,t-u.now()-l)),i&&(i=clearInterval(i))):(i||(o=u.now(),i=setInterval(y,1e3)),n=1,c(g)))}f.prototype=p.prototype={constructor:f,restart:function(t,n,a){if("function"!=typeof t)throw new TypeError("callback is not a function");a=(null==a?h():+a)+(null==n?0:+n),this._next||r===this||(r?r._next=this:e=this,r=this),this._call=t,this._time=a,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},t.now=h,t.timer=p,t.timerFlush=m,t.timeout=function(t,e,r){var n=new f;return e=null==e?0:+e,n.restart((function(r){n.stop(),t(r+e)}),e,r),n},t.interval=function(t,e,r){var n=new f,a=e;return null==e?(n.restart(t,e,r),n):(e=+e,r=null==r?h():+r,n.restart((function i(o){o+=a,n.restart(i,a+=e,r),t(o)}),e,r),n)},Object.defineProperty(t,"__esModule",{value:!0})})("object"==typeof r&&void 0!==e?r:this.d3=this.d3||{})},{}],163:[function(t,e,r){!function(){var t={version:"3.5.17"},r=[].slice,n=function(t){return r.call(t)},a=this.document;function i(t){return t&&(t.ownerDocument||t.document||t).documentElement}function o(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}if(a)try{n(a.documentElement.childNodes)[0].nodeType}catch(t){n=function(t){for(var e=t.length,r=new Array(e);e--;)r[e]=t[e];return r}}if(Date.now||(Date.now=function(){return+new Date}),a)try{a.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var s=this.Element.prototype,l=s.setAttribute,u=s.setAttributeNS,c=this.CSSStyleDeclaration.prototype,h=c.setProperty;s.setAttribute=function(t,e){l.call(this,t,e+"")},s.setAttributeNS=function(t,e,r){u.call(this,t,e,r+"")},c.setProperty=function(t,e,r){h.call(this,t,e+"",r)}}function d(t,e){return te?1:t>=e?0:NaN}function f(t){return null===t?NaN:+t}function p(t){return!isNaN(t)}function m(t){return{left:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)<0?n=i+1:a=i}return n},right:function(e,r,n,a){for(arguments.length<3&&(n=0),arguments.length<4&&(a=e.length);n>>1;t(e[i],r)>0?a=i:n=i+1}return n}}}t.ascending=d,t.descending=function(t,e){return et?1:e>=t?0:NaN},t.min=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++an&&(r=n)}else{for(;++a=n){r=n;break}for(;++an&&(r=n)}return r},t.max=function(t,e){var r,n,a=-1,i=t.length;if(1===arguments.length){for(;++a=n){r=n;break}for(;++ar&&(r=n)}else{for(;++a=n){r=n;break}for(;++ar&&(r=n)}return r},t.extent=function(t,e){var r,n,a,i=-1,o=t.length;if(1===arguments.length){for(;++i=n){r=a=n;break}for(;++in&&(r=n),a=n){r=a=n;break}for(;++in&&(r=n),a1)return o/(l-1)},t.deviation=function(){var e=t.variance.apply(this,arguments);return e?Math.sqrt(e):e};var g=m(d);function y(t){return t.length}t.bisectLeft=g.left,t.bisect=t.bisectRight=g.right,t.bisector=function(t){return m(1===t.length?function(e,r){return d(t(e),r)}:t)},t.shuffle=function(t,e,r){(i=arguments.length)<3&&(r=t.length,i<2&&(e=0));for(var n,a,i=r-e;i;)a=Math.random()*i--|0,n=t[i+e],t[i+e]=t[a+e],t[a+e]=n;return t},t.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},t.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],a=new Array(r<0?0:r);e=0;)for(e=(n=t[a]).length;--e>=0;)r[--o]=n[e];return r};var v=Math.abs;function _(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function x(){this._=Object.create(null)}t.range=function(t,e,r){if(arguments.length<3&&(r=1,arguments.length<2&&(e=t,t=0)),(e-t)/r==1/0)throw new Error("infinite range");var n,a=[],i=function(t){for(var e=1;t*e%1;)e*=10;return e}(v(r)),o=-1;if(t*=i,e*=i,(r*=i)<0)for(;(n=t+r*++o)>e;)a.push(n/i);else for(;(n=t+r*++o)=a.length)return r?r.call(n,i):e?i.sort(e):i;for(var l,u,c,h,d=-1,f=i.length,p=a[s++],m=new x;++d=a.length)return e;var n=[],o=i[r++];return e.forEach((function(e,a){n.push({key:e,values:t(a,r)})})),o?n.sort((function(t,e){return o(t.key,e.key)})):n}(o(t.map,e,0),0)},n.key=function(t){return a.push(t),n},n.sortKeys=function(t){return i[a.length-1]=t,n},n.sortValues=function(t){return e=t,n},n.rollup=function(t){return r=t,n},n},t.set=function(t){var e=new S;if(t)for(var r=0,n=t.length;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},t.event=null,t.requote=function(t){return t.replace(Y,"\\$&")};var Y=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,j={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]};function B(t){return j(t,W),t}var H=function(t,e){return e.querySelector(t)},U=function(t,e){return e.querySelectorAll(t)},V=function(t,e){var r=t.matches||t[D(t,"matchesSelector")];return(V=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(H=function(t,e){return Sizzle(t,e)[0]||null},U=Sizzle,V=Sizzle.matchesSelector),t.selection=function(){return t.select(a.documentElement)};var W=t.selection.prototype=[];function G(t){return"function"==typeof t?t:function(){return H(t,this)}}function q(t){return"function"==typeof t?t:function(){return U(t,this)}}W.select=function(t){var e,r,n,a,i=[];t=G(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),X.hasOwnProperty(r)?{space:X[r],local:t}:t}},W.attr=function(e,r){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=t.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(r in e)this.each(J(r,e[r]));return this}return this.each(J(e,r))},W.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=Q(t)).length,a=-1;if(e=r.classList){for(;++a=0;)(r=n[a])&&(i&&i!==r.nextSibling&&i.parentNode.insertBefore(r,i),i=r);return this},W.sort=function(t){t=function(t){return arguments.length||(t=d),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(e=e.slice(0,o));var l=dt.get(e);function u(){var t=this[i];t&&(this.removeEventListener(e,t,t.$),delete this[i])}return l&&(e=l,s=pt),o?r?function(){var t=s(r,n(arguments));u.call(this),this.addEventListener(e,this[i]=t,t.$=a),t._=r}:u:r?O:function(){var r,n=new RegExp("^__on([^.]+)"+t.requote(e)+"$");for(var a in this)if(r=a.match(n)){var i=this[a];this.removeEventListener(r[1],i,i.$),delete this[a]}}}t.selection.enter=ut,t.selection.enter.prototype=ct,ct.append=W.append,ct.empty=W.empty,ct.node=W.node,ct.call=W.call,ct.size=W.size,ct.select=function(t){for(var e,r,n,a,i,o=[],s=-1,l=this.length;++s=n&&(n=e+1);!(o=s[n])&&++n0?1:t<0?-1:0}function Ct(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function Dt(t){return t>1?0:t<-1?Mt:Math.acos(t)}function Pt(t){return t>1?Lt:t<-1?-Lt:Math.asin(t)}function Ot(t){return((t=Math.exp(t))+1/t)/2}function zt(t){return(t=Math.sin(t/2))*t}var It=Math.SQRT2;t.interpolateZoom=function(t,e){var r,n,a=t[0],i=t[1],o=t[2],s=e[0],l=e[1],u=e[2],c=s-a,h=l-i,d=c*c+h*h;if(d0&&(e=e.transition().duration(m)),e.call(w.event)}function A(){u&&u.domain(l.range().map((function(t){return(t-d.x)/d.k})).map(l.invert)),h&&h.domain(c.range().map((function(t){return(t-d.y)/d.k})).map(c.invert))}function S(t){g++||t({type:"zoomstart"})}function E(t){A(),t({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function C(t){--g||(t({type:"zoomend"}),r=null)}function D(){var e=this,r=b.of(e,arguments),n=0,a=t.select(o(e)).on(v,(function(){n=1,T(t.mouse(e),i),E(r)})).on(_,(function(){a.on(v,null).on(_,null),s(n),C(r)})),i=M(t.mouse(e)),s=yt(e);ls.call(e),S(r)}function P(){var e,r=this,n=b.of(r,arguments),a={},i=0,o=".zoom-"+t.event.changedTouches[0].identifier,l="touchmove"+o,u="touchend"+o,c=[],h=t.select(r),f=yt(r);function p(){var n=t.touches(r);return e=d.k,n.forEach((function(t){t.identifier in a&&(a[t.identifier]=M(t))})),n}function m(){var e=t.event.target;t.select(e).on(l,g).on(u,v),c.push(e);for(var n=t.event.changedTouches,o=0,h=n.length;o1){y=f[0];var _=f[1],x=y[0]-_[0],b=y[1]-_[1];i=x*x+b*b}}function g(){var o,l,u,c,h=t.touches(r);ls.call(r);for(var d=0,f=h.length;d360?t-=360:t<0&&(t+=360),t<60?n+(a-n)*t/60:t<180?a:t<240?n+(a-n)*(240-t)/60:n}(t))}return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)||e<0?0:e>1?1:e,n=2*(r=r<0?0:r>1?1:r)-(a=r<=.5?r*(1+e):r+e-r*e),new re(i(t+120),i(t),i(t-120))}function Ut(e,r,n){return this instanceof Ut?(this.h=+e,this.c=+r,void(this.l=+n)):arguments.length<2?e instanceof Ut?new Ut(e.h,e.c,e.l):$t(e instanceof Gt?e.l:(e=ue((e=t.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ut(e,r,n)}Bt.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new jt(this.h,this.s,this.l/t)},Bt.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new jt(this.h,this.s,t*this.l)},Bt.rgb=function(){return Ht(this.h,this.s,this.l)},t.hcl=Ut;var Vt=Ut.prototype=new Yt;function Wt(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new Gt(r,Math.cos(t*=At)*e,Math.sin(t)*e)}function Gt(t,e,r){return this instanceof Gt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof Gt?new Gt(t.l,t.a,t.b):t instanceof Ut?Wt(t.h,t.c,t.l):ue((t=re(t)).r,t.g,t.b):new Gt(t,e,r)}Vt.brighter=function(t){return new Ut(this.h,this.c,Math.min(100,this.l+qt*(arguments.length?t:1)))},Vt.darker=function(t){return new Ut(this.h,this.c,Math.max(0,this.l-qt*(arguments.length?t:1)))},Vt.rgb=function(){return Wt(this.h,this.c,this.l).rgb()},t.lab=Gt;var qt=18,Zt=.95047,Xt=1.08883,Jt=Gt.prototype=new Yt;function Kt(t,e,r){var n=(t+16)/116,a=n+e/500,i=n-r/200;return new re(ee(3.2404542*(a=Qt(a)*Zt)-1.5371385*(n=1*Qt(n))-.4985314*(i=Qt(i)*Xt)),ee(-.969266*a+1.8760108*n+.041556*i),ee(.0556434*a-.2040259*n+1.0572252*i))}function $t(t,e,r){return t>0?new Ut(Math.atan2(r,e)*St,Math.sqrt(e*e+r*r),t):new Ut(NaN,NaN,t)}function Qt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function te(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ee(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function re(t,e,r){return this instanceof re?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof re?new re(t.r,t.g,t.b):se(""+t,re,Ht):new re(t,e,r)}function ne(t){return new re(t>>16,t>>8&255,255&t)}function ae(t){return ne(t)+""}Jt.brighter=function(t){return new Gt(Math.min(100,this.l+qt*(arguments.length?t:1)),this.a,this.b)},Jt.darker=function(t){return new Gt(Math.max(0,this.l-qt*(arguments.length?t:1)),this.a,this.b)},Jt.rgb=function(){return Kt(this.l,this.a,this.b)},t.rgb=re;var ie=re.prototype=new Yt;function oe(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function se(t,e,r){var n,a,i,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(a=n[2].split(","),n[1]){case"hsl":return r(parseFloat(a[0]),parseFloat(a[1])/100,parseFloat(a[2])/100);case"rgb":return e(he(a[0]),he(a[1]),he(a[2]))}return(i=de.get(t))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(o=(3840&i)>>4,o|=o>>4,s=240&i,s|=s>>4,l=15&i,l|=l<<4):7===t.length&&(o=(16711680&i)>>16,s=(65280&i)>>8,l=255&i)),e(o,s,l))}function le(t,e,r){var n,a,i=Math.min(t/=255,e/=255,r/=255),o=Math.max(t,e,r),s=o-i,l=(o+i)/2;return s?(a=l<.5?s/(o+i):s/(2-o-i),n=t==o?(e-r)/s+(e0&&l<1?0:n),new jt(n,a,l)}function ue(t,e,r){var n=te((.4124564*(t=ce(t))+.3575761*(e=ce(e))+.1804375*(r=ce(r)))/Zt),a=te((.2126729*t+.7151522*e+.072175*r)/1);return Gt(116*a-16,500*(n-a),200*(a-te((.0193339*t+.119192*e+.9503041*r)/Xt)))}function ce(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function he(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}ie.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,r=this.g,n=this.b,a=30;return e||r||n?(e&&e=200&&e<300||304===e){try{t=a.call(o,u)}catch(t){return void s.error.call(o,t)}s.load.call(o,t)}else s.error.call(o,u)}return!this.XDomainRequest||"withCredentials"in u||!/^(http(s)?:)?\/\//.test(e)||(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=h:u.onreadystatechange=function(){u.readyState>3&&h()},u.onprogress=function(e){var r=t.event;t.event=e;try{s.progress.call(o,u)}finally{t.event=r}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?l[t]:(null==e?delete l[t]:l[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(r=null==t?null:t+"",o):r},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return a=t,o},["get","post"].forEach((function(t){o[t]=function(){return o.send.apply(o,[t].concat(n(arguments)))}})),o.send=function(t,n,a){if(2===arguments.length&&"function"==typeof n&&(a=n,n=null),u.open(t,e,!0),null==r||"accept"in l||(l.accept=r+",*/*"),u.setRequestHeader)for(var i in l)u.setRequestHeader(i,l[i]);return null!=r&&u.overrideMimeType&&u.overrideMimeType(r),null!=c&&(u.responseType=c),null!=a&&o.on("error",a).on("load",(function(t){a(null,t)})),s.beforesend.call(o,u),u.send(null==n?null:n),o},o.abort=function(){return u.abort(),o},t.rebind(o,s,"on"),null==i?o:o.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(i))}de.forEach((function(t,e){de.set(t,ne(e))})),t.functor=fe,t.xhr=pe(E),t.dsv=function(t,e){var r=new RegExp('["'+t+"\n]"),n=t.charCodeAt(0);function a(t,r,n){arguments.length<3&&(n=r,r=null);var a=me(t,e,null==r?i:o(r),n);return a.row=function(t){return arguments.length?a.response(null==(r=t)?i:o(t)):r},a}function i(t){return a.parse(t.responseText)}function o(t){return function(e){return a.parse(e.responseText,t)}}function s(e){return e.map(l).join(t)}function l(t){return r.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}return a.parse=function(t,e){var r;return a.parseRows(t,(function(t,n){if(r)return r(t,n-1);var a=new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+"]"})).join(",")+"}");r=e?function(t,r){return e(a(t),r)}:a}))},a.parseRows=function(t,e){var r,a,i={},o={},s=[],l=t.length,u=0,c=0;function h(){if(u>=l)return o;if(a)return a=!1,i;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++24?(isFinite(e)&&(clearTimeout(_e),_e=setTimeout(we,e)),ve=0):(ve=1,xe(we))}function Me(){for(var t=Date.now(),e=ge;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function ke(){for(var t,e=ge,r=1/0;e;)e.c?(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}}));t.formatPrefix=function(e,r){var n=0;return(e=+e)&&(e<0&&(e*=-1),r&&(e=t.round(e,Te(e,r))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Le[8+n/3]};var Ae=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Se=t.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(e,r){return(e=t.round(e,Te(e,r))).toFixed(Math.max(0,Math.min(20,Te(e*(1+1e-15),r))))}});function Ee(t){return t+""}var Ce=t.time={},De=Date;function Pe(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Pe.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(){Oe.setUTCDate.apply(this._,arguments)},setDay:function(){Oe.setUTCDay.apply(this._,arguments)},setFullYear:function(){Oe.setUTCFullYear.apply(this._,arguments)},setHours:function(){Oe.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Oe.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Oe.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Oe.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Oe.setUTCSeconds.apply(this._,arguments)},setTime:function(){Oe.setTime.apply(this._,arguments)}};var Oe=Date.prototype;function ze(t,e,r){function n(e){var r=t(e),n=i(r,1);return e-r1)for(;o68?1900:2e3),r+a[0].length):-1}function qe(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ze(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Xe(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Je(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function Ke(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function $e(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Qe(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function tr(t,e,r){Fe.lastIndex=0;var n=Fe.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function er(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=v(e)/60|0,a=v(e)%60;return r+Ye(n,"0",2)+Ye(a,"0",2)}function rr(t,e,r){Ne.lastIndex=0;var n=Ne.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function nr(t){for(var e=t.length,r=-1;++r0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),i.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=a[o=(o+1)%a.length];return i.reverse().join(n)}:E;return function(e){var n=Ae.exec(e),a=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],h=+n[6],d=n[7],f=n[8],p=n[9],m=1,g="",y="",v=!1,_=!0;switch(f&&(f=+f.substring(1)),(c||"0"===a&&"="===s)&&(c=a="0",s="="),p){case"n":d=!0,p="g";break;case"%":m=100,y="%",p="f";break;case"p":m=100,y="%",p="r";break;case"b":case"o":case"x":case"X":"#"===u&&(g="0"+p.toLowerCase());case"c":_=!1;case"d":v=!0,f=0;break;case"s":m=-1,p="r"}"$"===u&&(g=i[0],y=i[1]),"r"!=p||f||(p="g"),null!=f&&("g"==p?f=Math.max(1,Math.min(21,f)):"e"!=p&&"f"!=p||(f=Math.max(0,Math.min(20,f)))),p=Se.get(p)||Ee;var x=c&&d;return function(e){var n=y;if(v&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(m<0){var u=t.formatPrefix(e,f);e=u.scale(e),n=u.symbol+y}else e*=m;var b,w,M=(e=p(e,f)).lastIndexOf(".");if(M<0){var k=_?e.lastIndexOf("e"):-1;k<0?(b=e,w=""):(b=e.substring(0,k),w=e.substring(k))}else b=e.substring(0,M),w=r+e.substring(M+1);!c&&d&&(b=o(b,1/0));var T=g.length+b.length+w.length+(x?0:i.length),L=T"===s?L+i+e:"^"===s?L.substring(0,T>>=1)+i+e+L.substring(T):i+(x?e:L+e))+n}}}(e),timeFormat:function(e){var r=e.dateTime,n=e.date,a=e.time,i=e.periods,o=e.days,s=e.shortDays,l=e.months,u=e.shortMonths;function c(t){var e=t.length;function r(r){for(var n,a,i,o=[],s=-1,l=0;++s