# HG changeset patch # User cpt # Date 1656997652 0 # Node ID b4d7351df1ff83794dbd436caa17784744793b76 Uploaded diff -r 000000000000 -r b4d7351df1ff cpt_xmfa/cpt-macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpt_xmfa/cpt-macros.xml Tue Jul 05 05:07:32 2022 +0000 @@ -0,0 +1,115 @@ + + + + + python + biopython + requests + + + + + + + + 10.1371/journal.pcbi.1008214 + @unpublished{galaxyTools, + author = {E. Mijalis, H. Rasche}, + title = {CPT Galaxy Tools}, + year = {2013-2017}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + 10.1371/journal.pcbi.1008214 + + @unpublished{galaxyTools, + author = {E. Mijalis, H. Rasche}, + title = {CPT Galaxy Tools}, + year = {2013-2017}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + + + 10.1371/journal.pcbi.1008214 + + @unpublished{galaxyTools, + author = {C. Ross}, + title = {CPT Galaxy Tools}, + year = {2020-}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + + + 10.1371/journal.pcbi.1008214 + + @unpublished{galaxyTools, + author = {E. Mijalis, H. Rasche}, + title = {CPT Galaxy Tools}, + year = {2013-2017}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + @unpublished{galaxyTools, + author = {A. Criscione}, + title = {CPT Galaxy Tools}, + year = {2019-2021}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + + + 10.1371/journal.pcbi.1008214 + + @unpublished{galaxyTools, + author = {A. Criscione}, + title = {CPT Galaxy Tools}, + year = {2019-2021}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + + + 10.1371/journal.pcbi.1008214 + + @unpublished{galaxyTools, + author = {C. Maughmer}, + title = {CPT Galaxy Tools}, + year = {2017-2020}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + + + + @unpublished{galaxyTools, + author = {C. Maughmer}, + title = {CPT Galaxy Tools}, + year = {2017-2020}, + note = {https://github.com/tamu-cpt/galaxy-tools/} + } + + + + diff -r 000000000000 -r b4d7351df1ff cpt_xmfa/macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpt_xmfa/macros.xml Tue Jul 05 05:07:32 2022 +0000 @@ -0,0 +1,61 @@ + + + + + progressivemauve + python + biopython + cpt_gffparser + + + + 2.4.0 + + 10.1371/journal.pone.0011147 + + + 10.1093/bioinformatics/btm039 + + + + "$xmfa" + + + + + + + "$sequences" + + + + + + + + + + + + + + + + + "$gff3_data" + + + genomeref.fa + + + ln -s $genome_fasta genomeref.fa; + + + genomeref.fa + + + + + diff -r 000000000000 -r b4d7351df1ff cpt_xmfa/mauve.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpt_xmfa/mauve.js Tue Jul 05 05:07:32 2022 +0000 @@ -0,0 +1,33 @@ +!function(t){function n(r){if(e[r])return e[r].exports;var i=e[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var e={};return n.m=t,n.c=e,n.p="build/",n(0)}([function(t,n,e){t.exports=e(1)},function(t,n,e){function r(t){return t/P*E}function i(){if(tx=k.event.transform,txf="translate("+tx.x+") scale("+tx.k+",1)",container.attr("transform",txf),1e3==tx.k){var t=tx.x;console.log(t),g()}}function o(){M=container.selectAll("genomes").data(F).enter().append("rect").attr("width",function(t){return t.length}).attr("height",j).attr("x",N.left).attr("y",function(t,n){return N.top+n*q}).attr("id",function(t,n){return t.name}).style("fill","green");$.selectAll("text").data(F).enter().append("text").attr("y",function(t,n){return N.top+n*q+L}).text(function(t){return t.name}).attr("font-family","sans-serif").attr("font-size","20px")}function a(t){colors={"%23FFFF00":"DNA replication/recombination","%23FFA500":"regulation","%2387CEFA":"structural/morphogenesis","%23FF00FF":"lysis","%2371BC78":"packaging",black:"other"},metadata=[t.seqid+" "+t.attributes.num,t.attributes.product,colors[t.attributes.color]],console.log(metadata.join(" | ")),sizes=["20px","15px","15px","15px"],U.length?U.map(function(t){t.text(function(t,n){return metadata[n]})}):(text=X.selectAll("text").data(metadata).enter().append("text").attr("x","100").attr("y",function(t,n){return 20*n+(A-80)/2}).text(function(t){return t}).attr("font-family","sans-serif").attr("font-size",function(t,n){return sizes[n]}),U.push(text))}function u(t,n){for(var e in R[t])if(R[t][e].indexOf(n)>-1)return 10*e}function s(t){for(var n in F)if(t==F[n].name)return n}function c(t,n,e){var i=s(n[0].seqid),o=t+N.left+r(n[e].start),a=D+N.top+j+L/2+u(i,e)+i*q,c=r(n[e].end-n[e].start),l=10;return c<5?"-"==n[e].strand?(o+=c,[[o,a],[o-c,a+l/2],[o,a+l]].join(" ")):[[o,a],[o+c,a+l/2],[o,a+l]].join(" "):"-"==n[e].strand?(o+=c,[[o,a],[o,a+l],[o-c+5,a+l],[o-c,a+l/2],[o-c+5,a]].join(" ")):[[o,a],[o,a+l],[o+c-5,a+l],[o+c,a+l/2],[o+c-5,a]].join(" ")}function l(t){var n=s(t[0].seqid),e=container.selectAll("gene"+n).data(t).enter().append("polygon").attr("points",function(n,e){return c(0,t,e)}).style("fill",function(t,n){return t.attributes.color?t.attributes.color.replace("%23","#"):"black"}).on("click",a);H.push(e)}function f(t,n){w[n].map(function(n){F[n.id-1].x_offset=r(t.start-n.start)})}function h(){M.attr("x",function(t){return N.left+t.x_offset}),I.map(function(t){t.attr("x",function(t,n){return F[t.id-1].x_offset+N.left+r(t.start)})}),B.map(function(t,n){t.attr("points",function(t,e){return p(w[n],e)})}),H.map(function(t,n){t.attr("points",function(t,e){return c(F[z[t.seqid]].x_offset,O[n],e)})})}function p(t,n){var e=function(){var t=1;for(var n in R)Object.keys(R[n]).length-1>t&&(t=Object.keys(R[n]).length-1);return t},r=(F[t[n].id-1].x_offset+N.left+t[n].start/P*E).toString(),i=(N.top+j+L/2+(t[n].id-1)*q).toString(),o=(F[t[n].id-1].x_offset+N.left+t[n].end/P*E).toString(),a=(N.top+j+L/2+(t[n].id-1)*q).toString(),u=o,s=(N.top+j+L/2+(t[n].id-1)*q+2*D+10*e()).toString(),c=(F[t[n+1].id-1].x_offset+N.left+t[n+1].end/P*E).toString(),l=(N.top-L/2+(t[n+1].id-1)*q).toString(),f=(F[t[n+1].id-1].x_offset+N.left+t[n+1].start/P*E).toString(),h=(N.top-L/2+(t[n+1].id-1)*q).toString(),p=r,d=s;return t[n].strand!=t[n+1].strand?[[r,i],[o,a],[u,s],[f,h],[c,l],[p,d]].join(" "):[[r,i],[o,a],[u,s],[c,l],[f,h],[p,d]].join(" ")}function d(t,n,e,i){var o=container.selectAll("lcb"+n).data(t).enter().append("rect").attr("width",function(t,n){return r(t.end-t.start)}).attr("height",j+L).attr("x",function(t,n){return N.left+r(t.start)}).attr("y",function(t,n){return N.top-L/2+(t.id-1)*q}).attr("id",function(t,n){return t.rid}).style("fill","blue").style("opacity",.5).on("click",function(t){f(t,n),h()});I.push(o),sliced_lcb=t.slice(0,t.length-1);var a=container.selectAll("lcb_area"+n).data(sliced_lcb).enter().append("polygon").attr("points",function(n,e){return p(t,e)}).style("fill","#c5c4c4").style("opacity",.65);B.push(a)}function g(){}function v(t){return Math.max.apply(null,t.map(function(t){return t.length}))}function y(t){q=A/t}function m(t){T.each(t,function(t,n,e){F.push({name:n.name,length:r(n.length),x_offset:0,seq:""}),z[n.name]=t})}function _(t){var n={};return t.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function(t,e,r,i){n[e]=i}),n}function x(t){last_placed=[null];var n={0:[]};return t.map(function(t,e){for(locs in last_placed)if(null==last_placed[locs]||r(t.start)>1+last_placed[locs])return null==last_placed[locs]&&(last_placed.push(null),n[parseInt(locs)+1]=[]),last_placed[locs]=r(t.end),void n[locs].push(e)}),n}function b(t,n){return t.sort(function(t,e){var r=t[n],i=e[n];return ri?1:0})}var w,M,k=e(2),T=e(3),S=e(4),C=e(5),N={top:30,right:30,bottom:30,left:30},E=960-N.left-N.right,A=660-N.top-N.bottom,q=0,D=5,j=10,L=10,P=0,O=[],F=[],z={},R={},H=[],I=[],U=[],B=[],W=k.zoom().scaleExtent([1,1e3]).on("zoom",i),Y=k.select("body").append("svg").attr("width",E+N.left+N.right).attr("height",A+N.top+N.bottom).call(W),$=(Y.append("rect").attr("width",E+N.left+N.right).attr("height",A+N.top+N.bottom).style("fill","white").style("opacity",.4).style("pointer-events","all"),k.select("body").append("svg").attr("width",100).attr("height",A+N.top+N.bottom)),X=k.select("body").append("svg").attr("width",500).attr("height",A+N.top+N.bottom);container=Y.append("g");var V=_(location.search).url;V||(V="data.json"),T.getJSON(V,function(t){P=v(t.fasta),y(t.fasta.length),m(t.fasta),o();var n=["#a6cee3","#b2df8a","#fb9a99","#fdbf6f","#cab2d6","#ffff99"];n=n.map(function(t){return C(t)}),T.getJSON(t.xmfa,function(e){promises=[];var r=t.gff3.map(function(t){var n=T.get(t,function(t){var n=S.process(t,["CDS"]);O.push(n),R[s(n[0].seqid)]=x(b(n,"start"))});promises.push(n)});promises.push(r),Promise.all(promises).then(function(t){w=e;var r=e.map(function(t,e){var r=n[e%n.length];d(t,e,r.rgb().string(),r.darken(.5).rgb().string())});promises.push(r),Promise.all(promises).then(function(t){for(var n in O)l(O[n])})})}),t.fasta.map(function(t){T.get(t.path,function(n){F[z[t.name]].seq=n})})})},function(t,n,e){!function(t,e){e(n)}(this,function(t){"use strict";function n(t){return function(n,e){return Mc(t(n),e)}}function e(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Rc?i*=10:o>=Hc?i*=5:o>=Ic&&(i*=2),n1&&$l(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function j(){this._x0=this._y0=this._x1=this._y1=null,this._=[]}function L(){return new j}function P(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,a,u,s,c,l,f,h,p=t._root,d={data:r},g=t._x0,v=t._y0,y=t._x1,m=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((c=n>=(o=(g+y)/2))?g=o:y=o,(l=e>=(a=(v+m)/2))?v=a:m=a,i=p,!(p=p[f=l<<1|c]))return i[f]=d,t;if(u=+t._x.call(null,p.data),s=+t._y.call(null,p.data),n===u&&e===s)return d.next=p,i?i[f]=d:t._root=d,t;do i=i?i[f]=new Array(4):t._root=new Array(4),(c=n>=(o=(g+y)/2))?g=o:y=o,(l=e>=(a=(v+m)/2))?v=a:m=a;while((f=l<<1|c)===(h=(s>=a)<<1|u>=o));return i[h]=p,i[f]=d,t}function O(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,c=1/0,l=-(1/0),f=-(1/0);for(e=0;el&&(l=r),if&&(f=i));for(l=1))throw new Error;this._size=t,this._call=this._error=null,this._tasks=[],this._data=[],this._waiting=this._active=this._ended=this._start=0}function W(t){if(!t._start)try{Y(t)}catch(n){if(t._tasks[t._ended+t._active-1])X(t,n);else if(!t._data)throw n}}function Y(t){for(;t._start=t._waiting&&t._active=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(t){}t._active=NaN,V(t)}function V(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function G(t){return new B(arguments.length?+t:1/0)}function J(t){return t.innerRadius}function Z(t){return t.outerRadius}function Q(t){return t.startAngle}function K(t){return t.endAngle}function tt(t){return t&&t.padAngle}function nt(t){return t>=1?xf:t<=-1?-xf:Math.asin(t)}function et(t,n,e,r,i,o,a,u){var s=e-t,c=r-n,l=a-i,f=u-o,h=(l*(n-o)-f*(t-i))/(f*s-l*c);return[t+h*s,n+h*c]}function rt(t,n,e,r,i,o,a){var u=t-e,s=n-r,c=(a?o:-o)/Math.sqrt(u*u+s*s),l=c*s,f=-c*u,h=t+l,p=n+f,d=e+l,g=r+f,v=(h+d)/2,y=(p+g)/2,m=d-h,_=g-p,x=m*m+_*_,b=i-o,w=h*g-d*p,M=(_<0?-1:1)*Math.sqrt(Math.max(0,b*b*x-w*w)),k=(w*_-m*M)/x,T=(-w*m-_*M)/x,S=(w*_+m*M)/x,C=(-w*m+_*M)/x,N=k-v,E=T-y,A=S-v,q=C-y;return N*N+E*E>A*A+q*q&&(k=S,T=C),{cx:k,cy:T,x01:-l,y01:-f,x11:k*(i/b-1),y11:T*(i/b-1)}}function it(t){this._context=t}function ot(t){return t[0]}function at(t){return t[1]}function ut(t){this._curve=t}function st(t){function n(n){return new ut(t(n))}return n._curve=t,n}function ct(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(st(t)):n()._curve},t}function lt(t,n,e){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+n)/6,(t._y0+4*t._y1+e)/6)}function ft(t){this._context=t}function ht(t){this._context=t}function pt(t){this._context=t}function dt(t,n){this._basis=new ft(t),this._beta=n}function gt(t,n,e){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-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function vt(t,n){this._context=t,this._k=(1-n)/6}function yt(t,n){this._context=t,this._k=(1-n)/6}function mt(t,n){this._context=t,this._k=(1-n)/6}function _t(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>mf){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>mf){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-n*t._l12_2a)/l,a=(a*c+t._y1*t._l23_2a-e*t._l12_2a)/l}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function xt(t,n){this._context=t,this._alpha=n}function bt(t,n){this._context=t,this._alpha=n}function wt(t,n){this._context=t,this._alpha=n}function Mt(t){this._context=t}function kt(t){return t<0?-1:1}function Tt(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(kt(o)+kt(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function St(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Ct(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function Nt(t){this._context=t}function Et(t){this._context=new At(t)}function At(t){this._context=t}function qt(t){return new Nt(t)}function Dt(t){return new Et(t)}function jt(t){this._context=t}function Lt(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=Ch.exec(t))?Bt(parseInt(n[1],16)):(n=Nh.exec(t))?new Xt(n[1],n[2],n[3],1):(n=Eh.exec(t))?new Xt(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Ah.exec(t))?Wt(n[1],n[2],n[3],n[4]):(n=qh.exec(t))?Wt(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Dh.exec(t))?Vt(n[1],n[2]/100,n[3]/100,1):(n=jh.exec(t))?Vt(n[1],n[2]/100,n[3]/100,n[4]):Lh.hasOwnProperty(t)?Bt(Lh[t]):"transparent"===t?new Xt(NaN,NaN,NaN,0):null}function Bt(t){return new Xt(t>>16&255,t>>8&255,255&t,1)}function Wt(t,n,e,r){return r<=0&&(t=n=e=NaN),new Xt(t,n,e,r)}function Yt(t){return t instanceof It||(t=Ut(t)),t?(t=t.rgb(),new Xt(t.r,t.g,t.b,t.opacity)):new Xt}function $t(t,n,e,r){return 1===arguments.length?Yt(t):new Xt(t,n,e,null==r?1:r)}function Xt(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Vt(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Zt(t,n,e,r)}function Gt(t){if(t instanceof Zt)return new Zt(t.h,t.s,t.l,t.opacity);if(t instanceof It||(t=Ut(t)),!t)return new Zt;if(t instanceof Zt)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&s<1?0:a,new Zt(a,u,s,t.opacity)}function Jt(t,n,e,r){return 1===arguments.length?Gt(t):new Zt(t,n,e,null==r?1:r)}function Zt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Qt(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Kt(t){if(t instanceof nn)return new nn(t.l,t.a,t.b,t.opacity);if(t instanceof cn){var n=t.h*Ph;return new nn(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof Xt||(t=Yt(t));var e=an(t.r),r=an(t.g),i=an(t.b),o=en((.4124564*e+.3575761*r+.1804375*i)/zh),a=en((.2126729*e+.7151522*r+.072175*i)/Rh),u=en((.0193339*e+.119192*r+.9503041*i)/Hh);return new nn(116*a-16,500*(o-a),200*(a-u),t.opacity)}function tn(t,n,e,r){return 1===arguments.length?Kt(t):new nn(t,n,e,null==r?1:r)}function nn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function en(t){return t>Wh?Math.pow(t,1/3):t/Bh+Ih}function rn(t){return t>Uh?t*t*t:Bh*(t-Ih)}function on(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function an(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function un(t){if(t instanceof cn)return new cn(t.h,t.c,t.l,t.opacity);t instanceof nn||(t=Kt(t));var n=Math.atan2(t.b,t.a)*Oh;return new cn(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function sn(t,n,e,r){return 1===arguments.length?un(t):new cn(t,n,e,null==r?1:r)}function cn(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function ln(t){if(t instanceof hn)return new hn(t.h,t.s,t.l,t.opacity);t instanceof Xt||(t=Yt(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Qh*r+Jh*n-Zh*e)/(Qh+Jh-Zh),o=r-i,a=(Gh*(e-i)-Xh*o)/Vh,u=Math.sqrt(a*a+o*o)/(Gh*i*(1-i)),s=u?Math.atan2(a,o)*Oh-120:NaN;return new hn(s<0?s+360:s,u,i,t.opacity)}function fn(t,n,e,r){return 1===arguments.length?ln(t):new hn(t,n,e,null==r?1:r)}function hn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function pn(t,n,e,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*n+(4-6*o+3*a)*e+(1+3*t+3*o-3*a)*r+a*i)/6}function dn(t,n){return function(e){return t+e*n}}function gn(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function vn(t,n){var e=n-t;return e?dn(t,e>180||e<-180?e-360*Math.round(e/360):e):op(isNaN(t)?n:t)}function yn(t){return 1===(t=+t)?mn:function(n,e){return e-n?gn(n,e,t):op(isNaN(n)?e:n)}}function mn(t,n){var e=n-t;return e?dn(t,e):op(isNaN(t)?n:t)}function _n(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;e180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:fp(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}function u(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:fp(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}function s(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:fp(t,e)},{i:u-2,x:fp(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}return function(n,e){var r=[],i=[];return n=t(n),e=t(e),o(n.translateX,n.translateY,e.translateX,e.translateY,r,i),a(n.rotate,e.rotate,r,i),u(n.skewX,e.skewX,r,i),s(n.scaleX,n.scaleY,e.scaleX,e.scaleY,r,i),n=e=null,function(t){for(var n,e=-1,o=i.length;++e=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function Pn(t,n){for(var e,r=0,i=t.length;r=0&&n._call.call(null,t),n=n._next;--id}function Vn(){cd=(sd=fd.now())+ld,id=od=0;try{Xn()}finally{id=0,Jn(),cd=0}}function Gn(){var t=fd.now(),n=t-sd;n>ud&&(ld-=n,sd=t)}function Jn(){for(var t,n,e=Op,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Op=n);Fp=t,Zn(r)}function Zn(t){if(!id){od&&(od=clearTimeout(od));var n=t-cd;n>24?(t<1/0&&(od=setTimeout(Vn,n)),ad&&(ad=clearInterval(ad))):(ad||(ad=setInterval(Gn,ud)),id=1,hd(Vn))}}function Qn(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return a;do a.push(new Date(+e));while(n(e,o),t(e),e=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return gd.setTime(+n),vd.setTime(+r),t(gd),t(vd),Math.floor(e(gd,vd))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t===0}:function(n){return i.count(0,n)%t===0}):i:null}),i}function Kn(t){return Qn(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*xd)/Md})}function te(t){return Qn(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/Md})}function ne(t){if(!(n=Ng.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",o=n[4]||"",a=!!n[5],u=n[6]&&+n[6],s=!!n[7],c=n[8]&&+n[8].slice(1),l=n[9]||"";"n"===l?(s=!0,l="g"):Cg[l]||(l=""),(a||"0"===e&&"="===r)&&(a=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=o,this.zero=a,this.width=u,this.comma=s,this.precision=c,this.type=l}function ee(t){return t}function re(n){return Ag=Dg(n),t.format=Ag.format,t.formatPrefix=Ag.formatPrefix,Ag}function ie(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function oe(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ae(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function ue(t){function n(t,n){return function(e){var r,i,o,a=[],u=-1,s=0,c=t.length;for(e instanceof Date||(e=new Date(+e));++u=s)return-1;if(i=n.charCodeAt(a++),37===i){if(i=n.charAt(a++),o=U[i in Fg?n.charAt(a++):i],!o||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function i(t,n,e){var r=A.exec(n.slice(e));return r?(t.p=q[r[0].toLowerCase()],e+r[0].length):-1}function o(t,n,e){var r=L.exec(n.slice(e));return r?(t.w=P[r[0].toLowerCase()],e+r[0].length):-1}function a(t,n,e){var r=D.exec(n.slice(e));return r?(t.w=j[r[0].toLowerCase()],e+r[0].length):-1}function u(t,n,e){var r=z.exec(n.slice(e));return r?(t.m=R[r[0].toLowerCase()],e+r[0].length):-1}function s(t,n,e){var r=O.exec(n.slice(e));return r?(t.m=F[r[0].toLowerCase()],e+r[0].length):-1}function c(t,n,e){return r(t,w,n,e)}function l(t,n,e){return r(t,M,n,e)}function f(t,n,e){return r(t,k,n,e)}function h(t){return C[t.getDay()]}function p(t){return S[t.getDay()]}function d(t){return E[t.getMonth()]}function g(t){return N[t.getMonth()]}function v(t){return T[+(t.getHours()>=12)]}function y(t){return C[t.getUTCDay()]}function m(t){return S[t.getUTCDay()]}function _(t){return E[t.getUTCMonth()]}function x(t){return N[t.getUTCMonth()]}function b(t){return T[+(t.getUTCHours()>=12)]}var w=t.dateTime,M=t.date,k=t.time,T=t.periods,S=t.days,C=t.shortDays,N=t.months,E=t.shortMonths,A=le(T),q=fe(T),D=le(S),j=fe(S),L=le(C),P=fe(C),O=le(N),F=fe(N),z=le(E),R=fe(E),H={a:h,A:p,b:d,B:g,c:null,d:Se,e:Se,H:Ce,I:Ne,j:Ee,L:Ae,m:qe,M:De,p:v,S:je,U:Le,w:Pe,W:Oe,x:null,X:null,y:Fe,Y:ze,Z:Re,"%":tr},I={a:y,A:m,b:_,B:x,c:null,d:He,e:He,H:Ie,I:Ue,j:Be,L:We,m:Ye,M:$e,p:b,S:Xe,U:Ve,w:Ge,W:Je,x:null,X:null,y:Ze,Y:Qe,Z:Ke,"%":tr},U={a:o,A:a,b:u,B:s,c:c,d:_e,e:_e,H:be,I:be,j:xe,L:ke,m:me,M:we,p:i,S:Me,U:pe,w:he,W:de,x:l,X:f,y:ve,Y:ge,Z:ye,"%":Te};return H.x=n(M,H),H.X=n(k,H),H.c=n(w,H),I.x=n(M,I),I.X=n(k,I),I.c=n(w,I),{format:function(t){var e=n(t+="",H);return e.toString=function(){return t},e},parse:function(t){var n=e(t+="",ie);return n.toString=function(){return t},n},utcFormat:function(t){var e=n(t+="",I);return e.toString=function(){return t},e},utcParse:function(t){var n=e(t,oe);return n.toString=function(){return t},n}}}function se(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function ye(t,n,e){var r=/^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function me(t,n,e){var r=zg.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function _e(t,n,e){var r=zg.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function xe(t,n,e){var r=zg.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function be(t,n,e){var r=zg.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function we(t,n,e){var r=zg.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Me(t,n,e){var r=zg.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function ke(t,n,e){var r=zg.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Te(t,n,e){var r=Rg.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Se(t,n){return se(t.getDate(),n,2)}function Ce(t,n){return se(t.getHours(),n,2)}function Ne(t,n){return se(t.getHours()%12||12,n,2)}function Ee(t,n){return se(1+Ad.count(Vd(t),t),n,3)}function Ae(t,n){return se(t.getMilliseconds(),n,3)}function qe(t,n){return se(t.getMonth()+1,n,2)}function De(t,n){return se(t.getMinutes(),n,2)}function je(t,n){return se(t.getSeconds(),n,2)}function Le(t,n){return se(Dd.count(Vd(t),t),n,2)}function Pe(t){return t.getDay()}function Oe(t,n){return se(jd.count(Vd(t),t),n,2)}function Fe(t,n){return se(t.getFullYear()%100,n,2)}function ze(t,n){return se(t.getFullYear()%1e4,n,4)}function Re(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+se(n/60|0,"0",2)+se(n%60,"0",2)}function He(t,n){return se(t.getUTCDate(),n,2)}function Ie(t,n){return se(t.getUTCHours(),n,2)}function Ue(t,n){return se(t.getUTCHours()%12||12,n,2)}function Be(t,n){return se(1+tg.count(mg(t),t),n,3)}function We(t,n){return se(t.getUTCMilliseconds(),n,3)}function Ye(t,n){return se(t.getUTCMonth()+1,n,2)}function $e(t,n){return se(t.getUTCMinutes(),n,2)}function Xe(t,n){return se(t.getUTCSeconds(),n,2)}function Ve(t,n){return se(eg.count(mg(t),t),n,2)}function Ge(t){return t.getUTCDay()}function Je(t,n){return se(rg.count(mg(t),t),n,2)}function Ze(t,n){return se(t.getUTCFullYear()%100,n,2)}function Qe(t,n){return se(t.getUTCFullYear()%1e4,n,4)}function Ke(){return"+0000"}function tr(){return"%"}function nr(n){return jg=ue(n),t.timeFormat=jg.format,t.timeParse=jg.parse,t.utcFormat=jg.utcFormat,t.utcParse=jg.utcParse,jg}function er(t){return t.toISOString()}function rr(t){var n=new Date(t);return isNaN(n)?null:n}function ir(t){function n(n){var o=n+"",a=e.get(o);if(!a){if(i!==Xg)return i;e.set(o,a=r.push(n))}return t[(a-1)%t.length]}var e=o(),r=[],i=Xg;return t=null==t?[]:$g.call(t),n.domain=function(t){if(!arguments.length)return r.slice();r=[],e=o();for(var i,a,u=-1,s=t.length;++u=e?1:r(t)}}}function lr(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}function fr(t,n,e,r){var i=t[0],o=t[1],a=n[0],u=n[1];return o2?hr:fr,o=a=null,r}function r(n){return(o||(o=i(u,s,l?cr(t):t,c)))(+n)}var i,o,a,u=Jg,s=Jg,c=vp,l=!1;return r.invert=function(t){return(a||(a=i(s,u,sr,l?lr(n):n)))(+t)},r.domain=function(t){return arguments.length?(u=Yg.call(t,Gg),e()):u.slice()},r.range=function(t){return arguments.length?(s=$g.call(t),e()):s.slice()},r.rangeRound=function(t){return s=$g.call(t),c=yp,e()},r.clamp=function(t){return arguments.length?(l=!!t,e()):l},r.interpolate=function(t){return arguments.length?(c=t,e()):c},e()}function gr(t){var n=t.domain;return t.ticks=function(t){var e=n();return Uc(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return Zg(n(),t,e)},t.nice=function(r){var i=n(),o=i.length-1,a=null==r?10:r,u=i[0],s=i[o],c=e(u,s,a);return c&&(c=e(Math.floor(u/c)*c,Math.ceil(s/c)*c,a),i[0]=Math.floor(u/c)*c,i[o]=Math.ceil(s/c)*c,n(i)),t},t}function vr(){var t=dr(sr,fp);return t.copy=function(){return pr(t,vr())},gr(t)}function yr(){function t(t){return+t}var n=[0,1];return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=Yg.call(e,Gg),t):n.slice()},t.copy=function(){return yr().domain(n)},gr(t)}function mr(t,n){return(n=Math.log(n/t))?function(e){return Math.log(e/t)/n}:Vg(n)}function _r(t,n){return t<0?function(e){return-Math.pow(-n,e)*Math.pow(-t,1-e)}:function(e){return Math.pow(n,e)*Math.pow(t,1-e)}}function xr(t){return isFinite(t)?+("1e"+t):t<0?0:t}function br(t){return 10===t?xr:t===Math.E?Math.exp:function(n){return Math.pow(t,n)}}function wr(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(n){return Math.log(n)/t})}function Mr(t){return function(n){return-t(-n)}}function kr(){function n(){return o=wr(i),a=br(i),r()[0]<0&&(o=Mr(o),a=Mr(a)),e}var e=dr(mr,_r).domain([1,10]),r=e.domain,i=10,o=wr(10),a=br(10);return e.base=function(t){return arguments.length?(i=+t,n()):i},e.domain=function(t){return arguments.length?(r(t),n()):r()},e.ticks=function(t){var n,e=r(),u=e[0],s=e[e.length-1];(n=s0){for(;hs)break;g.push(f)}}else for(;h=1;--l)if(f=c*l,!(fs)break;g.push(f)}}else g=Uc(h,p,Math.min(p-h,d)).map(a);return n?g.reverse():g},e.tickFormat=function(n,r){if(null==r&&(r=10===i?".0e":","),"function"!=typeof r&&(r=t.format(r)),n===1/0)return r;null==n&&(n=10);var u=Math.max(1,i*n/e.ticks().length);return function(t){var n=t/a(Math.round(o(t)));return n*i0?i[n-1]:e[0],n=i?[o[i-1],r]:[o[n-1],o[n]]},t.copy=function(){return Er().domain([e,r]).range(a)},gr(t)}function Ar(){function t(t){if(t<=t)return e[Sc(n,t,0,r)]}var n=[.5],e=[0,1],r=1;return t.domain=function(i){return arguments.length?(n=$g.call(i),r=Math.min(n.length,e.length-1),t):n.slice()},t.range=function(i){return arguments.length?(e=$g.call(i),r=Math.min(n.length,e.length-1),t):e.slice()},t.invertExtent=function(t){var r=e.indexOf(t);return[n[r-1],n[r]]},t.copy=function(){return Ar().domain(n).range(e)},t}function qr(t){return new Date(t)}function Dr(t){return t instanceof Date?+t:+new Date(+t)}function jr(t,n,r,i,o,a,u,s,c){function l(e){return(u(e)=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function Br(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;rn?1:t>=n?0:NaN}function Qr(t){return function(){this.removeAttribute(t)}}function Kr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ti(t,n){return function(){this.setAttribute(t,n)}}function ni(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function ei(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function ri(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function ii(t){return function(){this.style.removeProperty(t)}}function oi(t,n,e){return function(){this.style.setProperty(t,n,e)}}function ai(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function ui(t){return function(){delete this[t]}}function si(t,n){return function(){this[t]=n}}function ci(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function li(t){return t.trim().split(/^|\s+/)}function fi(t){return t.classList||new hi(t)}function hi(t){this._node=t,this._names=li(t.getAttribute("class")||"")}function pi(t,n){for(var e=fi(t),r=-1,i=n.length;++rky)throw new Error("too late");return e}function Li(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Sy)throw new Error("too late");return e}function Pi(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function Oi(t,n,e){function r(t){e.state=Ty,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}function i(r){var c,l,f,h;if(e.state!==Ty)return a();for(c in s)if(h=s[c],h.name===e.name){if(h.state===Cy)return pd(i);h.state===Ny?(h.state=Ay,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete s[c]):+c=0&&(t=t.slice(0,n)),!t||"start"===t})}function to(t,n,e){var r,i,o=Ki(n)?ji:Li;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}function no(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function eo(t,n){var e,r,i;return function(){var o=iy(this).getComputedStyle(this,null),a=o.getPropertyValue(t),u=(this.style.removeProperty(t),o.getPropertyValue(t));return a===u?null:a===e&&u===r?i:i=n(e=a,r=u)}}function ro(t){return function(){this.style.removeProperty(t)}}function io(t,n,e){var r,i;return function(){var o=iy(this).getComputedStyle(this,null).getPropertyValue(t);return o===e?null:o===r?i:i=n(r=o,e)}}function oo(t,n,e){var r,i,o;return function(){var a=iy(this).getComputedStyle(this,null),u=a.getPropertyValue(t),s=e(this);return null==s&&(this.style.removeProperty(t),s=a.getPropertyValue(t)),u===s?null:u===r&&s===i?o:o=n(r=u,i=s)}}function ao(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function uo(t){return function(){this.textContent=t}}function so(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function co(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function lo(t){return Di().transition(t)}function fo(){return++Ky}function ho(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return nm.time=Bn(),nm;return e}function po(t,n,e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"}function go(t,n,e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"}function vo(t){var n=t.bandwidth()/2;return t.round()&&(n=Math.round(n)),function(e){return t(e)+n}}function yo(){return!this.__axis}function mo(t,n){function e(e){var c,l=null==i?n.ticks?n.ticks.apply(n,r):n.domain():i,f=null==o?n.tickFormat?n.tickFormat.apply(n,r):am:o,h=Math.max(a,0)+s,p=t===um||t===cm?po:go,d=n.range(),g=d[0]+.5,v=d[d.length-1]+.5,y=(n.bandwidth?vo:am)(n.copy()),m=e.selection?e.selection():e,_=m.selectAll(".domain").data([null]),x=m.selectAll(".tick").data(l,n).order(),b=x.exit(),w=x.enter().append("g").attr("class","tick"),M=x.select("line"),k=x.select("text"),T=t===um||t===lm?-1:1,S=t===lm||t===sm?(c="x","y"):(c="y","x");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),x=x.merge(w),M=M.merge(w.append("line").attr("stroke","#000").attr(c+"2",T*a).attr(S+"1",.5).attr(S+"2",.5)),k=k.merge(w.append("text").attr("fill","#000").attr(c,T*h).attr(S,.5).attr("dy",t===um?"0em":t===cm?"0.71em":"0.32em")),e!==m&&(_=_.transition(e),x=x.transition(e),M=M.transition(e),k=k.transition(e),b=b.transition(e).attr("opacity",fm).attr("transform",function(t){return p(y,this.parentNode.__axis||y,t)}),w.attr("opacity",fm).attr("transform",function(t){return p(this.parentNode.__axis||y,y,t)})),b.remove(),_.attr("d",t===lm||t==sm?"M"+T*u+","+g+"H0.5V"+v+"H"+T*u:"M"+g+","+T*u+"V0.5H"+v+"V"+T*u),x.attr("opacity",1).attr("transform",function(t){return p(y,y,t)}),M.attr(c+"2",T*a),k.attr(c,T*h).text(f),m.filter(yo).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===sm?"start":t===lm?"end":"middle"),m.each(function(){this.__axis=y})}var r=[],i=null,o=null,a=6,u=6,s=3;return e.scale=function(t){return arguments.length?(n=t,e):n},e.ticks=function(){return r=om.call(arguments),e},e.tickArguments=function(t){return arguments.length?(r=null==t?[]:om.call(t),e):r.slice()},e.tickValues=function(t){return arguments.length?(i=null==t?null:om.call(t),e):i&&i.slice()},e.tickFormat=function(t){return arguments.length?(o=t,e):o},e.tickSize=function(t){return arguments.length?(a=u=+t,e):a},e.tickSizeInner=function(t){return arguments.length?(a=+t,e):a},e.tickSizeOuter=function(t){return arguments.length?(u=+t,e):u},e.tickPadding=function(t){return arguments.length?(s=+t,e):s},e}function _o(t){return mo(um,t)}function xo(t){return mo(sm,t)}function bo(t){return mo(cm,t)}function wo(t){return mo(lm,t)}function Mo(t,n){return t.parent===n.parent?1:2}function ko(t){return t.reduce(To,0)/t.length}function To(t,n){return t+n.x}function So(t){return 1+t.reduce(Co,0)}function Co(t,n){return Math.max(t,n.y)}function No(t){for(var n;n=t.children;)t=n[0];return t}function Eo(t){for(var n;n=t.children;)t=n[n.length-1];return t}function Ao(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}function qo(t,n){var e,r,i,o,a,u=new Oo(t),s=+t.value&&(u.value=t.value),c=[u];for(null==n&&(n=jo);e=c.pop();)if(s&&(e.value=+e.data.value),(i=n(e.data))&&(a=i.length))for(e.children=new Array(a),o=a-1;o>=0;--o)c.push(r=e.children[o]=new Oo(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(Po)}function Do(){return qo(this).eachBefore(Lo)}function jo(t){return t.children}function Lo(t){t.data=t.data.data}function Po(t){var n=0;do t.height=n;while((t=t.parent)&&t.height<++n)}function Oo(t){this.data=t,this.depth=this.height=0,this.parent=null}function Fo(t){this._=t,this.next=null}function zo(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r-n.r;return i*i+1e-6>e*e+r*r}function Ro(t,n){var e,r,i,o=null,a=t.head;switch(n.length){case 1:e=Ho(n[0]);break;case 2:e=Io(n[0],n[1]);break;case 3:e=Uo(n[0],n[1],n[2])}for(;a;)i=a._,r=a.next,e&&zo(e,i)?o=a:(o?(t.tail=o,o.next=null):t.head=t.tail=null,n.push(i),e=Ro(t,n),n.pop(),t.head?(a.next=t.head,t.head=a):(a.next=null,t.head=t.tail=a),o=t.tail,o.next=r),a=r;return t.tail=o,e}function Ho(t){return{x:t.x,y:t.y,r:t.r}}function Io(t,n){var e=t.x,r=t.y,i=t.r,o=n.x,a=n.y,u=n.r,s=o-e,c=a-r,l=u-i,f=Math.sqrt(s*s+c*c);return{x:(e+o+s/f*l)/2,y:(r+a+c/f*l)/2,r:(f+i+u)/2}}function Uo(t,n,e){var r=t.x,i=t.y,o=t.r,a=n.x,u=n.y,s=n.r,c=e.x,l=e.y,f=e.r,h=2*(r-a),p=2*(i-u),d=2*(s-o),g=r*r+i*i-o*o-a*a-u*u+s*s,v=2*(r-c),y=2*(i-l),m=2*(f-o),_=r*r+i*i-o*o-c*c-l*l+f*f,x=v*p-h*y,b=(p*_-y*g)/x-r,w=(y*d-p*m)/x,M=(v*g-h*_)/x-i,k=(h*m-v*d)/x,T=w*w+k*k-1,S=2*(b*w+M*k+o),C=b*b+M*M-o*o,N=(-S-Math.sqrt(S*S-4*T*C))/(2*T);return{x:b+w*N+r,y:M+k*N+i,r:N}}function Bo(t,n,e){var r=t.x,i=t.y,o=n.r+e.r,a=t.r+e.r,u=n.x-r,s=n.y-i,c=u*u+s*s;if(c){var l=.5+((a*=a)-(o*=o))/(2*c),f=Math.sqrt(Math.max(0,2*o*(a+c)-(a-=c)*a-o*o))/(2*c);e.x=r+l*u+f*s,e.y=i+l*s-f*u}else e.x=r+a,e.y=i}function Wo(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r+n.r;return i*i>e*e+r*r}function Yo(t,n,e){var r=t.x-n,i=t.y-e;return r*r+i*i}function $o(t){this._=t,this.next=null,this.previous=null}function Xo(t){if(!(i=t.length))return 0;var n,e,r,i;if(n=t[0],n.x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;Bo(e,n,r=t[2]);var o,a,u,s,c,l,f,h=n.r*n.r,p=e.r*e.r,d=r.r*r.r,g=h+p+d,v=h*n.x+p*e.x+d*r.x,y=h*n.y+p*e.y+d*r.y;n=new $o(n),e=new $o(e),r=new $o(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(u=3;u=0;)n=i[o],n.z+=e,n.m+=e,e+=n.s+(r+=n.c)}function sa(t,n,e){return t.a.parent===n.parent?t.a:e}function ca(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function la(t){for(var n,e,r,i,o,a=new ca(t,0),u=[a];n=u.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(e=n.children[i]=new ca(r[i],i)),e.parent=n;return(a.parent=new ca(null,0)).children=[a],a}function fa(t,n,e,r,i,o){for(var a,u,s,c,l,f,h,p,d,g,v,y,m=[],_=n.children,x=0,b=_.length,w=n.value;xp&&(p=u),y=f*f*v,d=Math.max(p/y,y/h),d>g){f-=u;break}g=d}m.push(a={value:f,dice:c0)){if(o/=d,d<0){if(o0){if(o>p)return;o>h&&(h=o)}if(o=r-s,d||!(o<0)){if(o/=d,d<0){if(o>p)return;o>h&&(h=o)}else if(d>0){if(o0)){if(o/=g,g<0){if(o0){if(o>p)return;o>h&&(h=o)}if(o=i-c,g||!(o<0)){if(o/=g,g<0){if(o>p)return;o>h&&(h=o)}else if(g>0){if(o0||p<1)||(h>0&&(t[0]=[s+h*d,c+h*g]),p<1&&(t[1]=[s+p*d,c+p*g]),!0)}}}}}function Pa(t,n,e,r,i){var o=t[1];if(o)return!0;var a,u,s=t[0],c=t.left,l=t.right,f=c[0],h=c[1],p=l[0],d=l[1],g=(f+p)/2,v=(h+d)/2;if(d===h){if(g=r)return;if(f>p){if(s){if(s[1]>=i)return}else s=[g,e];o=[g,i]}else{if(s){if(s[1]1)if(f>p){if(s){if(s[1]>=i)return}else s=[(e-u)/a,e];o=[(i-u)/a,i]}else{if(s){if(s[1]=r)return}else s=[n,a*n+u];o=[r,a*r+u]}else{if(s){if(s[0]h_||Math.abs(i[0][1]-i[1][1])>h_)||delete c_[o]}function Fa(t){return u_[t.index]={site:t,halfedges:[]}}function za(t,n){var e=t.site,r=n.left,i=n.right;return e===i&&(i=r,r=e),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(e===r?(r=n[1],i=n[0]):(r=n[0],i=n[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function Ra(t,n){return n[+(n.left!==t.site)]}function Ha(t,n){return n[+(n.left===t.site)]}function Ia(){for(var t,n,e,r,i=0,o=u_.length;ih_||Math.abs(g-h)>h_)&&(s.splice(u,0,c_.push(Da(a,p,Math.abs(d-t)h_?[t,Math.abs(f-t)h_?[Math.abs(h-r)h_?[e,Math.abs(f-e)h_?[Math.abs(h-n)=-p_)){var p=s*s+c*c,d=l*l+f*f,g=(f*p-c*d)/h,v=(s*d-l*p)/h,y=l_.pop()||new Ba;y.arc=t,y.site=i,y.x=g+a,y.y=(y.cy=v+u)+Math.sqrt(g*g+v*v),t.circle=y;for(var m=null,_=s_._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}s_.insert(m,y),m||(o_=y)}}}}function Ya(t){var n=t.circle;n&&(n.P||(o_=n.N),s_.remove(n),l_.push(n),Ca(n),t.circle=null)}function $a(){Ca(this),this.edge=this.site=this.circle=null}function Xa(t){var n=f_.pop()||new $a;return n.site=t,n}function Va(t){Ya(t),a_.remove(t),f_.push(t),Ca(t)}function Ga(t){var n=t.circle,e=n.x,r=n.cy,i=[e,r],o=t.P,a=t.N,u=[t];Va(t);for(var s=o;s.circle&&Math.abs(e-s.circle.x)h_)u=u.L;else{if(i=o-Qa(u,a),!(i>h_)){r>-h_?(n=u.P,e=u):i>-h_?(n=u,e=u.N):n=e=u;break}if(!u.R){n=u;break}u=u.R}Fa(t);var s=Xa(t);if(a_.insert(n,s),n||e){if(n===e)return Ya(n),e=Xa(n.site),a_.insert(s,e),s.edge=e.edge=qa(n.site,s.site),Wa(n),void Wa(e);if(!e)return void(s.edge=qa(n.site,s.site));Ya(n),Ya(e);var c=n.site,l=c[0],f=c[1],h=t[0]-l,p=t[1]-f,d=e.site,g=d[0]-l,v=d[1]-f,y=2*(h*v-p*g),m=h*h+p*p,_=g*g+v*v,x=[(v*m-p*_)/y+l,(h*_-g*m)/y+f];ja(e.edge,c,d,x),s.edge=qa(c,t,null,x),e.edge=qa(t,d,null,x),Wa(n),Wa(e)}}function Za(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var a=t.P;if(!a)return-(1/0);e=a.site;var u=e[0],s=e[1],c=s-n;if(!c)return u;var l=u-r,f=1/o-1/c,h=l/c;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*c)-s+c/2+i-o/2)))/f+r:(r+u)/2}function Qa(t,n){var e=t.N;if(e)return Za(e,n);var r=t.site;return r[1]===n?r[0]:1/0}function Ka(t,n,e){return(t[0]-e[0])*(n[1]-t[1])-(t[0]-n[0])*(e[1]-t[1])}function tu(t,n){return n[1]-t[1]||n[0]-t[0]}function nu(t,n){var e,r,i,o=t.sort(tu).pop();for(c_=[],u_=new Array(t.length),a_=new Sa,s_=new Sa;;)if(i=o_,o&&(!i||o[1]Math.abs(t[1]-z[1])?M=!0:w=!0),z=t,b=!0,b_(),o()}function o(){var t;switch(_=z[0]-F[0],x=z[1]-F[1],S){case M_:case w_:C&&(_=Math.max(D-f,Math.min(L-g,_)),h=f+_,v=g+_),N&&(x=Math.max(j-p,Math.min(P-y,x)),d=p+x,m=y+x);break;case k_:C<0?(_=Math.max(D-f,Math.min(L-f,_)),h=f+_,v=g):C>0&&(_=Math.max(D-g,Math.min(L-g,_)),h=f,v=g+_),N<0?(x=Math.max(j-p,Math.min(P-p,x)),d=p+x,m=y):N>0&&(x=Math.max(j-y,Math.min(P-y,x)),d=p,m=y+x);break;case T_:C&&(h=Math.max(D,Math.min(L,f-_*C)),v=Math.max(D,Math.min(L,g+_*C))),N&&(d=Math.max(j,Math.min(P,p-x*N)),m=Math.max(j,Math.min(P,y+x*N)))}v0&&(f=h-_),N<0?y=m-x:N>0&&(p=d-x),S=M_,I.attr("cursor",E_.selection),o());break;default:return}b_()}function c(){switch(t.event.keyCode){case 16:O&&(w=M=O=!1,o());break;case 18:S===T_&&(C<0?g=v:C>0&&(f=h),N<0?y=m:N>0&&(p=d),S=k_,o());break;case 32:S===M_&&(t.event.altKey?(C&&(g=v-_*C,f=h+_*C),N&&(y=m-x*N,p=d+x*N),S=T_):(C<0?g=v:C>0&&(f=h),N<0?y=m:N>0&&(p=d),S=k_),I.attr("cursor",E_[T]),o());break;default:return}b_()}if(t.event.touches){if(t.event.changedTouches.length1?0:t<-1?Sx:Math.acos(t)}function Nu(t){return t>1?Cx:t<-1?-Cx:Math.asin(t)}function Eu(t){return(t=Hx(t/2))*t}function Au(){}function qu(t,n){t&&Yx.hasOwnProperty(t.type)&&Yx[t.type](t,n)}function Du(t,n,e){var r,i=-1,o=t.length-e;for(n.lineStart();++i=0?1:-1,i=r*e,o=Px(n),a=Hx(n),u=J_*a,s=G_*o+u*Px(i),c=u*r*Hx(i);Xx.add(Lx(c,s)),V_=t,G_=o,J_=a}function zu(t){return[Lx(t[1],t[0]),Nu(t[2])]}function Ru(t){var n=t[0],e=t[1],r=Px(e);return[r*Px(n),r*Hx(n),Hx(e)]}function Hu(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Iu(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Uu(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Bu(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Wu(t){var n=Ux(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function Yu(t,n){ox.push(ax=[Z_=t,K_=t]),ntx&&(tx=n)}function $u(t,n){var e=Ru([t*qx,n*qx]);if(ix){var r=Iu(ix,e),i=[r[1],-r[0],0],o=Iu(i,r);Wu(o),o=zu(o);var a,u=t-nx,s=u>0?1:-1,c=o[0]*Ax*s,l=Dx(u)>180;l^(s*nxtx&&(tx=a)):(c=(c+360)%360-180,l^(s*nxtx&&(tx=n))),l?tQu(Z_,K_)&&(K_=t):Qu(t,K_)>Qu(Z_,K_)&&(Z_=t):K_>=Z_?(tK_&&(K_=t)):t>nx?Qu(Z_,t)>Qu(Z_,K_)&&(K_=t):Qu(t,K_)>Qu(Z_,K_)&&(Z_=t)}else Yu(t,n);ix=e,nx=t}function Xu(){Qx.point=$u}function Vu(){ax[0]=Z_,ax[1]=K_,Qx.point=Yu,ix=null}function Gu(t,n){if(ix){var e=t-nx;Zx.add(Dx(e)>180?e+(e>0?360:-360):e)}else ex=t,rx=n;Gx.point(t,n),$u(t,n)}function Ju(){Gx.lineStart()}function Zu(){Gu(ex,rx),Gx.lineEnd(),Dx(Zx)>kx&&(Z_=-(K_=180)),ax[0]=Z_,ax[1]=K_,ix=null}function Qu(t,n){return(n-=t)<0?n+360:n}function Ku(t,n){return t[0]-n[0]}function ts(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nSx?t-Ex:t<-Sx?t+Ex:t,n]}function hs(t,n,e){return(t%=Ex)?n||e?rb(ds(t),gs(n,e)):ds(t):n||e?gs(n,e):fs}function ps(t){return function(n,e){return n+=t,[n>Sx?n-Ex:n<-Sx?n+Ex:n,e]}}function ds(t){var n=ps(t);return n.invert=ps(-t),n}function gs(t,n){function e(t,n){var e=Px(n),u=Px(t)*e,s=Hx(t)*e,c=Hx(n),l=c*r+u*i;return[Lx(s*o-l*a,u*r-c*i),Nu(l*o+s*a)]}var r=Px(t),i=Hx(t),o=Px(n),a=Hx(n);return e.invert=function(t,n){var e=Px(n),u=Px(t)*e,s=Hx(t)*e,c=Hx(n),l=c*o-s*a;return[Lx(s*o+c*a,u*r+l*i),Nu(l*r-u*i)]},e}function vs(t,n,e,r,i,o){if(e){var a=Px(n),u=Hx(n),s=r*e;null==i?(i=n+r*Ex,o=n-s/2):(i=ys(a,i),o=ys(a,o),(r>0?io)&&(i+=r*Ex));for(var c,l=i;r>0?l>o:l0){do c.point(0===l||3===l?t:e,l>1?r:n);while((l=(l+u+4)%4)!==f)}else c.point(o[0],o[1])}function a(r,i){return Dx(r[0]-t)0?0:3:Dx(r[0]-e)0?2:1:Dx(r[1]-n)0?1:0:i>0?3:2}function u(t,n){return s(t.x,n.x)}function s(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){function s(t,n){i(t,n)&&S.point(t,n)}function c(){for(var n=0,e=0,i=v.length;er&&(f-o)*(r-a)>(h-a)*(t-o)&&++n:h<=r&&(f-o)*(r-a)<(h-a)*(t-o)&&--n;return n}function l(){S=C,g=[],v=[],T=!0}function f(){var t=c(),n=T&&t,e=(g=Zc(g)).length;(n||e)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),e&&xb(g,u,t,o,a),a.polygonEnd()),S=a,g=v=y=null}function h(){N.point=d,v&&v.push(y=[]),k=!0,M=!1,b=w=NaN}function p(){g&&(d(m,_),x&&M&&C.rejoin(),g.push(C.result())),N.point=s,M&&S.lineEnd()}function d(o,a){var u=i(o,a);if(v&&y.push([o,a]),k)m=o,_=a,x=u,k=!1,u&&(S.lineStart(),S.point(o,a));else if(u&&M)S.point(o,a);else{var s=[b=Math.max(wb,Math.min(bb,b)),w=Math.max(wb,Math.min(bb,w))],c=[o=Math.max(wb,Math.min(bb,o)),a=Math.max(wb,Math.min(bb,a))];mb(s,c,t,n,e,r)?(M||(S.lineStart(),S.point(s[0],s[1])),S.point(c[0],c[1]),u||S.lineEnd(),T=!1):u&&(S.lineStart(),S.point(o,a),T=!1)}b=o,w=a,M=u}var g,v,y,m,_,x,b,w,M,k,T,S=a,C=yb(),N={point:s,lineStart:h,lineEnd:p,polygonStart:l,polygonEnd:f};return N}}function bs(){Tb.point=Ms,Tb.lineEnd=ws}function ws(){Tb.point=Tb.lineEnd=Au}function Ms(t,n){t*=qx,n*=qx,ib=t,ob=Hx(n),ab=Px(n),Tb.point=ks}function ks(t,n){t*=qx,n*=qx;var e=Hx(n),r=Px(n),i=Dx(t-ib),o=Px(i),a=Hx(i),u=r*a,s=ab*e-ob*r*o,c=ob*e+ab*r*o;kb.add(Lx(Ux(u*u+s*s),c)),ib=t,ob=e,ab=r}function Ts(t,n,e){var r=zc(t,n-kx,e).concat(n);return function(t){return r.map(function(n){return[t,n]})}}function Ss(t,n,e){var r=zc(t,n-kx,e).concat(n);return function(t){return r.map(function(n){return[n,t]})}}function Cs(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return zc(Ox(o/v)*v,i,v).map(h).concat(zc(Ox(c/y)*y,s,y).map(p)).concat(zc(Ox(r/d)*d,e,d).filter(function(t){return Dx(t%v)>kx}).map(l)).concat(zc(Ox(u/g)*g,a,g).filter(function(t){return Dx(t%y)>kx}).map(f))}var e,r,i,o,a,u,s,c,l,f,h,p,d=10,g=d,v=90,y=360,m=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(p(s).slice(1),h(i).reverse().slice(1),p(c).reverse().slice(1))]}},t.extent=function(n){return arguments.length?t.extentMajor(n).extentMinor(n):t.extentMinor()},t.extentMajor=function(n){return arguments.length?(o=+n[0][0],i=+n[1][0],c=+n[0][1],s=+n[1][1],o>i&&(n=o,o=i,i=n),c>s&&(n=c,c=s,s=n),t.precision(m)):[[o,c],[i,s]]},t.extentMinor=function(n){return arguments.length?(r=+n[0][0],e=+n[1][0],u=+n[0][1],a=+n[1][1],r>e&&(n=r,r=e,e=n),u>a&&(n=u,u=a,a=n),t.precision(m)):[[r,u],[e,a]]},t.step=function(n){return arguments.length?t.stepMajor(n).stepMinor(n):t.stepMinor()},t.stepMajor=function(n){return arguments.length?(v=+n[0],y=+n[1],t):[v,y]},t.stepMinor=function(n){return arguments.length?(d=+n[0],g=+n[1],t):[d,g]},t.precision=function(n){return arguments.length?(m=+n,l=Ts(u,a,90),f=Ss(r,e,m),h=Ts(c,s,90),p=Ss(o,i,m),t):m},t.extentMajor([[-180,-90+kx],[180,90-kx]]).extentMinor([[-180,-80-kx],[180,80+kx]])}function Ns(){return Cs()()}function Es(){Lb.point=As}function As(t,n){Lb.point=qs,ub=cb=t,sb=lb=n}function qs(t,n){jb.add(lb*t-cb*n),cb=t,lb=n}function Ds(){qs(ub,sb)}function js(t,n){tFb&&(Fb=t),nzb&&(zb=n)}function Ls(t,n){Hb+=t,Ib+=n,++Ub}function Ps(){Gb.point=Os}function Os(t,n){Gb.point=Fs,Ls(pb=t,db=n)}function Fs(t,n){var e=t-pb,r=n-db,i=Ux(e*e+r*r);Bb+=i*(pb+t)/2,Wb+=i*(db+n)/2,Yb+=i,Ls(pb=t,db=n)}function zs(){Gb.point=Ls}function Rs(){Gb.point=Is}function Hs(){Us(fb,hb)}function Is(t,n){Gb.point=Us,Ls(fb=pb=t,hb=db=n)}function Us(t,n){var e=t-pb,r=n-db,i=Ux(e*e+r*r);Bb+=i*(pb+t)/2,Wb+=i*(db+n)/2,Yb+=i,i=db*t-pb*n,$b+=i*(pb+t),Xb+=i*(db+n),Vb+=3*i,Ls(pb=t,db=n)}function Bs(t){this._context=t}function Ws(){this._string=[]}function Ys(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function $s(t){return t.length>1}function Xs(t,n){return((t=t.x)[0]<0?t[1]-Cx-kx:Cx-t[1])-((n=n.x)[0]<0?n[1]-Cx-kx:Cx-n[1])}function Vs(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,a){var u=o>0?Sx:-Sx,s=Dx(o-e);Dx(s-Sx)0?Cx:-Cx),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),n=0):i!==u&&s>=Sx&&(Dx(e-i)kx?jx((Hx(n)*(o=Px(r))*Hx(e)-Hx(r)*(i=Px(n))*Hx(t))/(i*o*a)):(n+r)/2}function Js(t,n,e,r){var i;if(null==t)i=e*Cx,r.point(-Sx,i),r.point(0,i),r.point(Sx,i),r.point(Sx,0),r.point(Sx,-i),r.point(0,-i),r.point(-Sx,-i),r.point(-Sx,0),r.point(-Sx,i);else if(Dx(t[0]-n[0])>kx){var o=t[0]4*n&&g--){var x=a+h,b=u+p,w=s+d,M=Ux(x*x+b*b+w*w),k=Nu(w/=M),T=Dx(Dx(w)-1)n||Dx((y*E+m*A)/_-.5)>.3||a*h+u*p+s*d2?t[2]%360*qx:0,i()):[b*Ax,w*Ax,M*Ax]},n.precision=function(t){return arguments.length?(E=ow(r,N=t*t),o()):Ux(N)},n.fitExtent=function(t,e){return Ks(n,t,e)},n.fitSize=function(t,e){return tc(n,t,e)},function(){return a=t.apply(this,arguments),n.invert=a.invert&&e,i()}}function oc(t){var n=0,e=Sx/3,r=ic(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*qx,e=t[1]*qx):[n*Ax,e*Ax]},i}function ac(t){function n(t,n){return[t*e,Hx(n)/e]}var e=Px(t);return n.invert=function(t,n){return[t/e,Nu(n*e)]},n}function uc(t,n){function e(t,n){var e=Ux(o-2*i*Hx(n))/i;return[e*Hx(t*=i),a-e*Px(t)]}var r=Hx(t),i=(r+Hx(n))/2;if(Dx(i)0?n<-Cx+kx&&(n=-Cx+kx):n>Cx-kx&&(n=Cx-kx);var e=o/Rx(pc(n),i);return[e*Hx(i*t),o-e*Px(i*t)]}var r=Px(t),i=t===n?Hx(t):zx(r/Px(n))/zx(pc(n)/pc(t)),o=r*Rx(pc(t),i)/i;return i?(e.invert=function(t,n){var e=o-n,r=Ix(i)*Ux(t*t+e*e);return[Lx(t,Dx(e))/i*Ix(e),2*jx(Rx(o/r,1/i))-Cx]},e):fc}function gc(t,n){return[t,n]}function vc(t,n){function e(t,n){var e=o-n,r=i*t;return[e*Hx(r),o-e*Px(r)]}var r=Px(t),i=t===n?Hx(t):(r-Px(n))/(n-t),o=r/i+t;return Dx(i)n?1:t>=n?0:NaN},kc=function(t){return 1===t.length&&(t=n(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}},Tc=kc(Mc),Sc=Tc.right,Cc=Tc.left,Nc=function(t,n){return nt?1:n>=t?0:NaN},Ec=function(t){return null===t?NaN:+t},Ac=function(t,n){var e,r,i=t.length,o=0,a=0,u=-1,s=0;if(null==n)for(;++u1)return a/(s-1)},qc=function(t,n){var e=Ac(t,n);return e?Math.sqrt(e):e},Dc=function(t,n){var e,r,i,o=-1,a=t.length;if(null==n){for(;++o=r){e=i=r;break}for(;++or&&(e=r),i=r){e=i=r;break}for(;++or&&(e=r),i=l;)f.pop(),--h;var p,d=new Array(h+1);for(i=0;i<=h;++i)p=d[i]=[],p.x0=i>0?f[i-1]:c,p.x1=i=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),a=+e(t[o],o,t),u=+e(t[o+1],o+1,t);return a+(u-a)*(i-o)}},$c=function(t,n,e){return t=Pc.call(t,Ec).sort(Mc),Math.ceil((e-n)/(2*(Yc(t,.75)-Yc(t,.25))*Math.pow(t.length,-1/3)))},Xc=function(t,n,e){return Math.ceil((e-n)/(3.5*qc(t)*Math.pow(t.length,-1/3)))},Vc=function(t,n){var e,r,i=-1,o=t.length;if(null==n){for(;++i=r){e=r;break}for(;++ie&&(e=r)}else{for(;++i=r){e=r;break}for(;++ie&&(e=r)}return e},Gc=function(t,n){var e,r=0,i=t.length,o=-1,a=i;if(null==n)for(;++o=0;)for(r=t[i],n=r.length;--n>=0;)e[--a]=r[n];return e},Qc=function(t,n){var e,r,i=-1,o=t.length;if(null==n){for(;++i=r){e=r;break}for(;++ir&&(e=r)}else{for(;++i=r){e=r;break}for(;++ir&&(e=r)}return e},Kc=function(t){for(var n=0,e=t.length-1,r=t[0],i=new Array(e<0?0:e);n=l.length)return null!=r?r(n):null!=e?n.sort(e):n;for(var s,c,f,h=-1,p=n.length,d=l[i++],g=o(),v=a();++hl.length)return t;var i,o=f[e-1];return null!=r&&e>=l.length?i=t.entries():(i=[],t.each(function(t,r){i.push({key:r,values:n(t,e)})})),null!=o?i.sort(function(t,n){return o(t.key,n.key)}):i}var e,r,i,l=[],f=[];return i={object:function(n){return t(n,0,a,u)},map:function(n){return t(n,0,s,c)},entries:function(e){return n(t(e,0,s,c),0)},key:function(t){return l.push(t),i},sortKeys:function(t){return f[l.length-1]=t,i},sortValues:function(t){return e=t,i},rollup:function(t){return r=t,i}}},sl=o.prototype;l.prototype=f.prototype={constructor:l,has:sl.has,add:function(t){return t+="",this[al+t]=t,this},remove:sl.remove,clear:sl.clear,values:sl.keys,size:sl.size,empty:sl.empty,each:sl.each};var cl=function(t){var n=[];for(var e in t)n.push(e);return n},ll=function(t){var n=[];for(var e in t)n.push(t[e]);return n},fl=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},hl=function(t,n){return t=null==t?0:+t,n=null==n?1:+n,1===arguments.length?(n=t,t=0):n-=t,function(){return Math.random()*n+t}},pl=function(t,n){var e,r;return t=null==t?0:+t,n=null==n?1:+n,function(){var i;if(null!=e)i=e,e=null;else do e=2*Math.random()-1,i=2*Math.random()-1,r=e*e+i*i;while(!r||r>1);return t+n*i*Math.sqrt(-2*Math.log(r)/r)}},dl=function(){var t=pl.apply(this,arguments);return function(){return Math.exp(t())}},gl=function(t){return function(){for(var n=0,e=0;e=0;--n)c.push(t[r[o[n]][2]]);for(n=+u;nu!=c>u&&a<(s-e)*(u-r)/(c-r)+e&&(l=!l),s=e,c=r;return l},Gl=function(t){for(var n,e,r=-1,i=t.length,o=t[i-1],a=o[0],u=o[1],s=0;++rQl)if(Math.abs(l*u-s*c)>Ql&&i){var h=e-o,p=r-a,d=u*u+s*s,g=h*h+p*p,v=Math.sqrt(d),y=Math.sqrt(f),m=i*Math.tan((Jl-Math.acos((d+f-g)/(2*v*y)))/2),_=m/y,x=m/v;Math.abs(_-1)>Ql&&this._.push("L",t+_*c,",",n+_*l),this._.push("A",i,",",i,",0,0,",+(l*h>c*p),",",this._x1=t+x*u,",",this._y1=n+x*s)}else this._.push("L",this._x1=t,",",this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,e=+e;var a=e*Math.cos(r),u=e*Math.sin(r),s=t+a,c=n+u,l=1^o,f=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._.push("M",s,",",c):(Math.abs(this._x1-s)>Ql||Math.abs(this._y1-c)>Ql)&&this._.push("L",s,",",c),e&&(f>Kl?this._.push("A",e,",",e,",0,1,",l,",",t-a,",",n-u,"A",e,",",e,",0,1,",l,",",this._x1=s,",",this._y1=c):(f<0&&(f=f%Zl+Zl),this._.push("A",e,",",e,",0,",+(f>=Jl),",",l,",",this._x1=t+e*Math.cos(i),",",this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._.push("M",this._x0=this._x1=+t,",",this._y0=this._y1=+n,"h",+e,"v",+r,"h",-e,"Z")},toString:function(){return this._.join("")}};var tf=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return P(this.cover(n,e),n,e,t)},nf=function(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,o=(r=Math.floor(n))+1;else{if(!(e>t||t>i||r>n||n>o))return this;var a,u,s=i-e,c=this._root;switch(u=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do a=new Array(4),a[u]=c,c=a;while(s*=2,i=e+s,o=r+s,t>i||n>o);break;case 1:do a=new Array(4),a[u]=c,c=a;while(s*=2,e=i-s,o=r+s,e>t||n>o);break;case 2:do a=new Array(4),a[u]=c,c=a;while(s*=2,i=e+s,r=o-s,t>i||r>n);break;case 3:do a=new Array(4),a[u]=c,c=a;while(s*=2,e=i-s,r=o-s,e>t||r>n)}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},ef=function(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t},rf=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]]},of=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i},af=function(t,n,e){var r,i,o,a,u,s,c,l=this._x0,f=this._y0,h=this._x1,p=this._y1,d=[],g=this._root;for(g&&d.push(new of(g,l,f,h,p)),null==e?e=1/0:(l=t-e,f=n-e,h=t+e,p=n+e,e*=e);s=d.pop();)if(!(!(g=s.node)||(i=s.x0)>h||(o=s.y0)>p||(a=s.x1)=y)<<1|t>=v)&&(s=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=s)}else{var m=t-+this._x.call(null,g.data),_=n-+this._y.call(null,g.data),x=m*m+_*_;if(x=(u=(d+v)/2))?d=u:v=u,(l=a>=(s=(g+y)/2))?g=s:y=s,n=p,!(p=p[f=l<<1|c]))return this;if(!p.length)break;(n[f+1&3]||n[f+2&3]||n[f+3&3])&&(e=n,h=f)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):n?(i?n[f]=i:delete n[f],(p=n[0]||n[1]||n[2]||n[3])&&p===(n[3]||n[2]||n[1]||n[0])&&!p.length&&(e?e[h]=p:this._root=p),this):(this._root=i,this)},sf=function(){return this._root},cf=function(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t},lf=function(t){var n,e,r,i,o,a,u=[],s=this._root;for(s&&u.push(new of(s,this._x0,this._y0,this._x1,this._y1));n=u.pop();)if(!t(s=n.node,r=n.x0,i=n.y0,o=n.x1,a=n.y1)&&s.length){var c=(r+o)/2,l=(i+a)/2;(e=s[3])&&u.push(new of(e,c,l,o,a)),(e=s[2])&&u.push(new of(e,r,l,c,a)),(e=s[1])&&u.push(new of(e,c,i,o,l)),(e=s[0])&&u.push(new of(e,r,i,c,l))}return this},ff=function(t){var n,e=[],r=[];for(this._root&&e.push(new of(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,a=n.x0,u=n.y0,s=n.x1,c=n.y1,l=(a+s)/2,f=(u+c)/2;(o=i[0])&&e.push(new of(o,a,u,l,f)),(o=i[1])&&e.push(new of(o,l,u,s,f)),(o=i[2])&&e.push(new of(o,a,f,l,c)),(o=i[3])&&e.push(new of(o,l,f,s,c))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},hf=function(t){return arguments.length?(this._x=t,this):this._x},pf=function(t){return arguments.length?(this._y=t,this):this._y},df=H.prototype=I.prototype;df.copy=function(){var t,n,e=new I(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=U(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=U(n));return e},df.add=tf,df.addAll=O,df.cover=nf,df.data=ef,df.extent=rf,df.find=af,df.remove=uf,df.removeAll=F,df.root=sf,df.size=cf,df.visit=lf,df.visitAfter=ff,df.x=hf,df.y=pf;var gf=[].slice,vf={};B.prototype=G.prototype={constructor:B,defer:function(t){if("function"!=typeof t||this._call)throw new Error;if(null!=this._error)return this;var n=gf.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),W(this),this},abort:function(){return null==this._error&&X(this,new Error("abort")),this},await:function(t){if("function"!=typeof t||this._call)throw new Error;return this._call=function(n,e){t.apply(null,[n].concat(e))},V(this),this},awaitAll:function(t){if("function"!=typeof t||this._call)throw new Error;return this._call=t,V(this),this}};var yf=function(t){return function(){return t}},mf=1e-12,_f=Math.PI,xf=_f/2,bf=2*_f,wf=function(){function t(){var t,c,l=+n.apply(this,arguments),f=+e.apply(this,arguments),h=o.apply(this,arguments)-xf,p=a.apply(this,arguments)-xf,d=Math.abs(p-h),g=p>h;if(s||(s=t=L()),fmf)if(d>bf-mf)s.moveTo(f*Math.cos(h),f*Math.sin(h)),s.arc(0,0,f,h,p,!g),l>mf&&(s.moveTo(l*Math.cos(p),l*Math.sin(p)),s.arc(0,0,l,p,h,g));else{var v,y,m=h,_=p,x=h,b=p,w=d,M=d,k=u.apply(this,arguments)/2,T=k>mf&&(i?+i.apply(this,arguments):Math.sqrt(l*l+f*f)),S=Math.min(Math.abs(f-l)/2,+r.apply(this,arguments)),C=S,N=S;if(T>mf){var E=nt(T/l*Math.sin(k)),A=nt(T/f*Math.sin(k));(w-=2*E)>mf?(E*=g?1:-1,x+=E,b-=E):(w=0,x=b=(h+p)/2),(M-=2*A)>mf?(A*=g?1:-1,m+=A,_-=A):(M=0,m=_=(h+p)/2)}var q=f*Math.cos(m),D=f*Math.sin(m),j=l*Math.cos(b),P=l*Math.sin(b);if(S>mf){var O=f*Math.cos(_),F=f*Math.sin(_),z=l*Math.cos(x),R=l*Math.sin(x);if(d<_f){var H=w>mf?et(q,D,z,R,O,F,j,P):[j,P],I=q-H[0],U=D-H[1],B=O-H[0],W=F-H[1],Y=1/Math.sin(Math.acos((I*B+U*W)/(Math.sqrt(I*I+U*U)*Math.sqrt(B*B+W*W)))/2),$=Math.sqrt(H[0]*H[0]+H[1]*H[1]);C=Math.min(S,(l-$)/(Y-1)),N=Math.min(S,(f-$)/(Y+1))}}M>mf?N>mf?(v=rt(z,R,q,D,f,N,g),y=rt(O,F,j,P,f,N,g),s.moveTo(v.cx+v.x01,v.cy+v.y01),Nmf&&w>mf?C>mf?(v=rt(j,P,O,F,l,-C,g),y=rt(q,D,z,R,l,-C,g),s.lineTo(v.cx+v.x01,v.cy+v.y01),C=l;--f)c.point(v[f],y[f]);c.lineEnd(),c.areaEnd()}g&&(v[n]=+e(h,n,t),y[n]=+i(h,n,t),c.point(r?+r(h,n,t):v[n],o?+o(h,n,t):y[n]))}if(p)return c=null,p+""||null}function n(){return kf().defined(a).curve(s).context(u)}var e=ot,r=null,i=yf(0),o=at,a=yf(!0),u=null,s=Mf,c=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:yf(+n),r=null,t):e},t.x0=function(n){return arguments.length?(e="function"==typeof n?n:yf(+n),t):e},t.x1=function(n){return arguments.length?(r=null==n?null:"function"==typeof n?n:yf(+n),t):r},t.y=function(n){return arguments.length?(i="function"==typeof n?n:yf(+n),o=null,t):i},t.y0=function(n){return arguments.length?(i="function"==typeof n?n:yf(+n),t):i},t.y1=function(n){return arguments.length?(o=null==n?null:"function"==typeof n?n:yf(+n),t):o},t.lineX0=t.lineY0=function(){return n().x(e).y(i)},t.lineY1=function(){return n().x(e).y(o)},t.lineX1=function(){return n().x(r).y(i)},t.defined=function(n){return arguments.length?(a="function"==typeof n?n:yf(!!n),t):a},t.curve=function(n){return arguments.length?(s=n,null!=u&&(c=s(u)),t):s},t.context=function(n){return arguments.length?(null==n?u=c=null:c=s(u=n),t):u},t},Sf=function(t,n){return nt?1:n>=t?0:NaN},Cf=function(t){return t},Nf=function(){function t(t){var u,s,c,l,f,h=t.length,p=0,d=new Array(h),g=new Array(h),v=+i.apply(this,arguments),y=Math.min(bf,Math.max(-bf,o.apply(this,arguments)-v)),m=Math.min(Math.abs(y)/h,a.apply(this,arguments)),_=m*(y<0?-1:1);for(u=0;u0&&(p+=f);for(null!=e?d.sort(function(t,n){return e(g[t],g[n])}):null!=r&&d.sort(function(n,e){return r(t[n],t[e])}),u=0,c=p?(y-h*_)/p:0;u0?f*c:0)+_,g[s]={data:t[s],index:u,value:f,startAngle:v,endAngle:l,padAngle:m};return g}var n=Cf,e=Sf,r=null,i=yf(0),o=yf(bf),a=yf(0);return t.value=function(e){return arguments.length?(n="function"==typeof e?e:yf(+e),t):n},t.sortValues=function(n){return arguments.length?(e=n,r=null,t):e},t.sort=function(n){return arguments.length?(r=n,e=null,t):r},t.startAngle=function(n){return arguments.length?(i="function"==typeof n?n:yf(+n),t):i},t.endAngle=function(n){return arguments.length?(o="function"==typeof n?n:yf(+n),t):o},t.padAngle=function(n){return arguments.length?(a="function"==typeof n?n:yf(+n),t):a},t},Ef=st(Mf);ut.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var Af=function(){return ct(kf().curve(Ef))},qf=function(){var t=Tf().curve(Ef),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=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 ct(e())},delete t.lineX0,t.lineEndAngle=function(){return ct(r())},delete t.lineX1,t.lineInnerRadius=function(){return ct(i())},delete t.lineY0,t.lineOuterRadius=function(){return ct(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(st(t)):n()._curve},t},Df={draw:function(t,n){var e=Math.sqrt(n/_f);t.moveTo(e,0),t.arc(0,0,e,0,bf)}},jf={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},Lf=Math.sqrt(1/3),Pf=2*Lf,Of={draw:function(t,n){var e=Math.sqrt(n/Pf),r=e*Lf;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Ff=.8908130915292852,zf=Math.sin(_f/10)/Math.sin(7*_f/10),Rf=Math.sin(bf/10)*zf,Hf=-Math.cos(bf/10)*zf,If={draw:function(t,n){var e=Math.sqrt(n*Ff),r=Rf*e,i=Hf*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var a=bf*o/5,u=Math.cos(a),s=Math.sin(a);t.lineTo(s*e,-u*e),t.lineTo(u*r-s*i,s*r+u*i)}t.closePath()}},Uf={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},Bf=Math.sqrt(3),Wf={draw:function(t,n){var e=-Math.sqrt(n/(3*Bf));t.moveTo(0,2*e),t.lineTo(-Bf*e,-e),t.lineTo(Bf*e,-e),t.closePath()}},Yf=-.5,$f=Math.sqrt(3)/2,Xf=1/Math.sqrt(12),Vf=3*(Xf/2+1),Gf={draw:function(t,n){var e=Math.sqrt(n/Vf),r=e/2,i=e*Xf,o=r,a=e*Xf+e,u=-o,s=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,s),t.lineTo(Yf*r-$f*i,$f*r+Yf*i),t.lineTo(Yf*o-$f*a,$f*o+Yf*a),t.lineTo(Yf*u-$f*s,$f*u+Yf*s),t.lineTo(Yf*r+$f*i,Yf*i-$f*r),t.lineTo(Yf*o+$f*a,Yf*a-$f*o),t.lineTo(Yf*u+$f*s,Yf*s-$f*u),t.closePath()}},Jf=[Df,jf,Of,Uf,If,Wf,Gf],Zf=function(){function t(){var t;if(r||(r=t=L()),n.apply(this,arguments).draw(r,+e.apply(this,arguments)),t)return r=null,t+""||null}var n=yf(Df),e=yf(64),r=null;return t.type=function(e){return arguments.length?(n="function"==typeof e?e:yf(e),t):n},t.size=function(n){return arguments.length?(e="function"==typeof n?n:yf(+n),t):e},t.context=function(n){return arguments.length?(r=null==n?null:n,t):r},t},Qf=function(){};ft.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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);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,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Kf=function(t){return new ft(t)};ht.prototype={areaStart:Qf,areaEnd:Qf,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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:lt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var th=function(t){return new ht(t)};pt.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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:lt(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var nh=function(t){return new pt(t)};dt.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,s=-1;++s<=e;)r=s/e,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+r*a),this._beta*n[s]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var eh=function t(n){function e(t){return 1===n?new ft(t):new dt(t,n)}return e.beta=function(n){return t(+n)},e}(.85);vt.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:gt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:gt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var rh=function t(n){function e(t){return new vt(t,n)}return e.tension=function(n){return t(+n)},e}(0);yt.prototype={areaStart:Qf,areaEnd:Qf,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,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:gt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var ih=function t(n){function e(t){return new yt(t,n)}return e.tension=function(n){return t(+n)},e}(0);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(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,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:gt(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var oh=function t(n){function e(t){return new mt(t,n)}return e.tension=function(n){return t(+n)},e}(0);xt.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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:_t(this,t,n)}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=n}};var ah=function t(n){function e(t){return n?new xt(t,n):new vt(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);bt.prototype={areaStart:Qf,areaEnd:Qf,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,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:_t(this,t,n)}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=n}};var uh=function t(n){function e(t){return n?new bt(t,n):new yt(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);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(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,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:_t(this,t,n)}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=n}};var sh=function t(n){function e(t){return n?new wt(t,n):new mt(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);Mt.prototype={areaStart:Qf,areaEnd:Qf,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var ch=function(t){return new Mt(t)};Nt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ct(this,this._t0,St(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,t!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,Ct(this,St(this,e=Tt(this,t,n)),e);break;default:Ct(this,this._t0,e=Tt(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},(Et.prototype=Object.create(Nt.prototype)).point=function(t,n){Nt.prototype.point.call(this,n,t)},At.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,o){this._context.bezierCurveTo(n,t,r,e,o,i)}},jt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),2===e)this._context.lineTo(t[1],n[1]);else for(var r=Lt(t),i=Lt(n),o=0,a=1;a=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var fh=function(t){return new Pt(t,.5)},hh=Array.prototype.slice,ph=function(t,n){if((r=t.length)>1)for(var e,r,i=1,o=t[n[0]],a=o.length;i=0;)e[n]=n;return e},gh=function(){function t(t){var o,a,u=n.apply(this,arguments),s=t.length,c=u.length,l=new Array(c);for(o=0;o0){for(var e,r,i,o=0,a=t[0].length;o0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,a=1;a=240?t-240:t+120,i,r),Qt(t,i,r),Qt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Ph=Math.PI/180,Oh=180/Math.PI,Fh=18,zh=.95047,Rh=1,Hh=1.08883,Ih=4/29,Uh=6/29,Bh=3*Uh*Uh,Wh=Uh*Uh*Uh;Mh(nn,tn,Ht(It,{brighter:function(t){return new nn(this.l+Fh*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new nn(this.l-Fh*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=Rh*rn(t),n=zh*rn(n),e=Hh*rn(e),new Xt(on(3.2404542*n-1.5371385*t-.4985314*e),on(-.969266*n+1.8760108*t+.041556*e),on(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),Mh(cn,sn,Ht(It,{brighter:function(t){return new cn(this.h,this.c,this.l+Fh*(null==t?1:t),this.opacity)},darker:function(t){return new cn(this.h,this.c,this.l-Fh*(null==t?1:t),this.opacity)},rgb:function(){return Kt(this).rgb()}}));var Yh=-.14861,$h=1.78277,Xh=-.29227,Vh=-.90649,Gh=1.97294,Jh=Gh*Vh,Zh=Gh*$h,Qh=$h*Xh-Vh*Yh;Mh(hn,fn,Ht(It,{brighter:function(t){return t=null==t?Th:Math.pow(Th,t),new hn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?kh:Math.pow(kh,t),new hn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Ph,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new Xt(255*(n+e*(Yh*r+$h*i)),255*(n+e*(Xh*r+Vh*i)),255*(n+e*(Gh*r)),this.opacity)}}));var Kh,tp,np,ep,rp=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=ro&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:fp(e,r)})),o=dp.lastIndex;return o0)for(var e,r,i=new Array(e),o=0;o=c)return a;if(i)return i=!1,o;var n,e=l;if(34===t.charCodeAt(e)){for(var r=e;r++=200&&e<300||304===e){if(a)try{n=a.call(r,l)}catch(t){return void s.call("error",r,t)}else n=l;s.call("load",r,n)}else s.call("error",r,t)}var r,i,a,u,s=Dn("beforesend","progress","load","error"),c=o(),l=new XMLHttpRequest,f=null,h=null,p=0;if("undefined"==typeof XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=l.ontimeout=e:l.onreadystatechange=function(t){l.readyState>3&&e(t)},l.onprogress=function(t){s.call("progress",r,t)},r={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?c.get(t):(null==n?c.remove(t):c.set(t,n+""),r)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",r):i},responseType:function(t){return arguments.length?(u=t,r):u},timeout:function(t){return arguments.length?(p=+t,r):p},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",r)},password:function(t){return arguments.length<1?h:(h=null==t?null:t+"",r)},response:function(t){return a=t,r},get:function(t,n){return r.send("GET",t,n)},post:function(t,n){return r.send("POST",t,n)},send:function(n,e,o){return l.open(n,t,!0,f,h),null==i||c.has("accept")||c.set("accept",i+",*/*"),l.setRequestHeader&&c.each(function(t,n){l.setRequestHeader(n,t)}),null!=i&&l.overrideMimeType&&l.overrideMimeType(i),null!=u&&(l.responseType=u),p>0&&(l.timeout=p),null==o&&"function"==typeof e&&(o=e,e=null),null!=o&&1===o.length&&(o=Hn(o)),null!=o&&r.on("error",o).on("load",function(t){o(null,t)}),s.call("beforesend",r,l),l.send(null==e?null:e),r},abort:function(){return l.abort(),r},on:function(){var t=s.on.apply(s,arguments);return t===s?r:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return r.get(n)}return r},Jp=function(t,n){return function(e,r){var i=Gp(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}},Zp=Jp("text/html",function(t){return document.createRange().createContextualFragment(t.responseText)}),Qp=Jp("application/json",function(t){return JSON.parse(t.responseText)}),Kp=Jp("text/plain",function(t){return t.responseText}),td=Jp("application/xml",function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n}),nd=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var o=Gp(e).mimeType(t);return o.row=function(t){return arguments.length?o.response(Un(n,r=t)):r},o.row(r),i?o.get(i):o}},ed=nd("text/csv",Hp),rd=nd("text/tab-separated-values",Yp),id=0,od=0,ad=0,ud=1e3,sd=0,cd=0,ld=0,fd="object"==typeof performance&&performance.now?performance:Date,hd="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};Yn.prototype=$n.prototype={constructor:Yn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Bn():+e)+(null==n?0:+n),this._next||Fp===this||(Fp?Fp._next=this:Op=this,Fp=this),this._call=t,this._time=e,Zn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zn())}};var pd=function(t,n,e){var r=new Yn;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r},dd=function(t,n,e){var r=new Yn,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?Bn():+e,r.restart(function o(a){a+=i,r.restart(o,i+=n,e),t(a)},n,e),r)},gd=new Date,vd=new Date,yd=Qn(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});yd.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Qn(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):yd:null};var md=yd.range,_d=1e3,xd=6e4,bd=36e5,wd=864e5,Md=6048e5,kd=Qn(function(t){t.setTime(Math.floor(t/_d)*_d)},function(t,n){t.setTime(+t+n*_d)},function(t,n){return(n-t)/_d},function(t){return t.getUTCSeconds()}),Td=kd.range,Sd=Qn(function(t){t.setTime(Math.floor(t/xd)*xd)},function(t,n){t.setTime(+t+n*xd)},function(t,n){return(n-t)/xd},function(t){return t.getMinutes()}),Cd=Sd.range,Nd=Qn(function(t){var n=t.getTimezoneOffset()*xd%bd;n<0&&(n+=bd),t.setTime(Math.floor((+t-n)/bd)*bd+n)},function(t,n){t.setTime(+t+n*bd)},function(t,n){return(n-t)/bd},function(t){return t.getHours()}),Ed=Nd.range,Ad=Qn(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*xd)/wd},function(t){return t.getDate()-1}),qd=Ad.range,Dd=Kn(0),jd=Kn(1),Ld=Kn(2),Pd=Kn(3),Od=Kn(4),Fd=Kn(5),zd=Kn(6),Rd=Dd.range,Hd=jd.range,Id=Ld.range,Ud=Pd.range,Bd=Od.range,Wd=Fd.range,Yd=zd.range,$d=Qn(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),Xd=$d.range,Vd=Qn(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});Vd.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Qn(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var Gd=Vd.range,Jd=Qn(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*xd)},function(t,n){return(n-t)/xd},function(t){return t.getUTCMinutes()}),Zd=Jd.range,Qd=Qn(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+n*bd)},function(t,n){return(n-t)/bd},function(t){return t.getUTCHours()}),Kd=Qd.range,tg=Qn(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/wd},function(t){return t.getUTCDate()-1}),ng=tg.range,eg=te(0),rg=te(1),ig=te(2),og=te(3),ag=te(4),ug=te(5),sg=te(6),cg=eg.range,lg=rg.range,fg=ig.range,hg=og.range,pg=ag.range,dg=ug.range,gg=sg.range,vg=Qn(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),yg=vg.range,mg=Qn(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});mg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Qn(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var _g,xg=mg.range,bg=function(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]},wg=function(t){return t=bg(Math.abs(t)),t?t[1]:NaN},Mg=function(t,n){return function(e,r){for(var i=e.length,o=[],a=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),o.push(e.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[a=(a+1)%t.length];return o.reverse().join(n)}},kg=function(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,o=-1;i0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t},Tg=function(t,n){var e=bg(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(_g=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+bg(t,Math.max(0,n+o-1))[0]},Sg=function(t,n){var e=bg(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Cg={"":kg,"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Sg(100*t,n)},r:Sg,s:Tg,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Ng=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i,Eg=function(t){return new ne(t)};ne.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var Ag,qg=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Dg=function(t){function n(t){function n(t){var n,i,s,m=d,_=g;if("c"===p)_=v(t)+_,t="";else{t=+t;var x=(t<0||1/t<0)&&(t*=-1,!0);if(t=v(t,h),x)for(n=-1,i=t.length,x=!1;++ns||s>57){_=(46===s?o+t.slice(n+1):t.slice(n))+_,t=t.slice(0,n);break}}f&&!c&&(t=r(t,1/0));var b=m.length+t.length+_.length,w=b>1)+m+t+_+w.slice(b)}return w+m+t+_}t=Eg(t);var e=t.fill,a=t.align,u=t.sign,s=t.symbol,c=t.zero,l=t.width,f=t.comma,h=t.precision,p=t.type,d="$"===s?i[0]:"#"===s&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",g="$"===s?i[1]:/[%p]/.test(p)?"%":"",v=Cg[p],y=!p||/[defgprs%]/.test(p);return h=null==h?p?6:12:/[gprs]/.test(p)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h)),n.toString=function(){return t+""},n}function e(t,e){var r=n((t=Eg(t),t.type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(wg(e)/3))),o=Math.pow(10,-i),a=qg[8+i/3];return function(t){return r(o*t)+a}}var r=t.grouping&&t.thousands?Mg(t.grouping,t.thousands):ee,i=t.currency,o=t.decimal;return{format:n,formatPrefix:e}};re({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var jg,Lg=function(t){return Math.max(0,-wg(Math.abs(t)))},Pg=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(wg(n)/3)))-wg(Math.abs(t)))},Og=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,wg(n)-wg(t))+1},Fg={"-":"",_:" ",0:"0"},zg=/^\s*\d+/,Rg=/^%/,Hg=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;nr({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Ig="%Y-%m-%dT%H:%M:%S.%LZ",Ug=Date.prototype.toISOString?er:t.utcFormat(Ig),Bg=+new Date("2000-01-01T00:00:00.000Z")?rr:t.utcParse(Ig),Wg=Array.prototype,Yg=Wg.map,$g=Wg.slice,Xg={name:"implicit"},Vg=function(t){return function(){return t}},Gg=function(t){return+t},Jg=[0,1],Zg=function(n,r,i){var o,a=n[0],u=n[n.length-1],s=e(a,u,null==r?10:r);switch(i=Eg(null==i?",f":i),i.type){case"s":var c=Math.max(Math.abs(a),Math.abs(u));return null!=i.precision||isNaN(o=Pg(s,c))||(i.precision=o),t.formatPrefix(i,c);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=Og(s,Math.max(Math.abs(a),Math.abs(u))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=Lg(s))||(i.precision=o-2*("%"===i.type))}return t.format(i)},Qg=function(t,n){t=t.slice();var e,r=0,i=t.length-1,o=t[r],a=t[i];return a1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return vv.h=360*t-100,vv.s=1.5-1.5*n,vv.l=.8-.9*n,vv+""},mv=Lr(sv("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),_v=Lr(sv("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),xv=Lr(sv("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),bv=Lr(sv("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),wv="http://www.w3.org/1999/xhtml",Mv={svg:"http://www.w3.org/2000/svg",xhtml:wv,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},kv=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Mv.hasOwnProperty(n)?{space:Mv[n],local:t}:t},Tv=function(t){var n=kv(t);return(n.local?Fr:Or)(n)},Sv=0;Rr.prototype=zr.prototype={constructor:Rr,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var Cv=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var Nv=document.documentElement;if(!Nv.matches){var Ev=Nv.webkitMatchesSelector||Nv.msMatchesSelector||Nv.mozMatchesSelector||Nv.oMatchesSelector;Cv=function(t){return function(){return Ev.call(this,t)}}}}var Av=Cv,qv={};if(t.event=null,"undefined"!=typeof document){var Dv=document.documentElement;"onmouseenter"in Dv||(qv={mouseenter:"mouseover",mouseleave:"mouseout"})}var jv=function(t,n,e){var r,i,o=Ur(t+""),a=o.length;{if(!(arguments.length<2)){for(u=n?Wr:Br,null==e&&(e=!1),r=0;r=b&&(b=x+1);!(_=v[b])&&++b=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},Jv=function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=Zr);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?ii:"function"==typeof n?ai:oi)(t,n,null==e?"":e)):iy(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)},ay=function(t,n){return arguments.length>1?this.each((null==n?ui:"function"==typeof n?ci:si)(t,n)):this.node()[t]};hi.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var uy=function(t,n){var e=li(t+"");if(arguments.length<2){for(var r=fi(this.node()),i=-1,o=e.length;++iSy&&e.stateTy&&e.name===n)return new co([[t]],rm,n,+r)}return null},om=Array.prototype.slice,am=function(t){return t},um=1,sm=2,cm=3,lm=4,fm=1e-6,hm=function(){function t(t){var o,a=0;t.eachAfter(function(t){var e=t.children;e?(t.x=ko(e),t.y=So(e)):(t.x=o?a+=n(t,o):0,t.y=0,o=t)});var u=No(t),s=Eo(t),c=u.x-n(u,s)/2,l=s.x+n(s,u)/2;return t.eachAfter(i?function(n){n.x=(n.x-t.x)*e,n.y=(t.y-n.y)*r}:function(n){n.x=(n.x-c)/(l-c)*e,n.y=(1-(t.y?n.y/t.y:1))*r})}var n=Mo,e=1,r=1,i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(n){return arguments.length?(i=!1,e=+n[0],r=+n[1],t):i?null:[e,r]},t.nodeSize=function(n){return arguments.length?(i=!0,e=+n[0],r=+n[1],t):i?[e,r]:null},t},pm=function(t){var n,e,r,i,o=this,a=[o];do for(n=a.reverse(),a=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},gm=function(t){for(var n,e,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),n=i.children)for(e=0,r=n.length;e=0;)e+=r[i].value;n.value=e})},ym=function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},mm=function(t){for(var n=this,e=Ao(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},_m=function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},xm=function(){var t=[];return this.each(function(n){t.push(n)}),t},bm=function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},wm=function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n};Oo.prototype=qo.prototype={constructor:Oo,each:pm,eachAfter:gm,eachBefore:dm,sum:vm,sort:ym,path:mm,ancestors:_m,descendants:xm,leaves:bm,links:wm,copy:Do};var Mm=function(t){for(var n,e=(t=t.slice()).length,r=null,i=r;e;){var o=new Fo(t[e-1]);i=i?i.next=o:r=o,t[n]=t[--e]}return{head:r,tail:i}},km=function(t){return Ro(Mm(t),[])},Tm=function(t){return Xo(t),t},Sm=function(t){return function(){return t}},Cm=function(){function t(t){return t.x=e/2,t.y=r/2,n?t.eachBefore(Qo(n)).eachAfter(Ko(i,.5)).eachBefore(ta(1)):t.eachBefore(Qo(Zo)).eachAfter(Ko(Jo,1)).eachAfter(Ko(i,t.r/Math.min(e,r))).eachBefore(ta(Math.min(e,r)/(2*t.r))),t}var n=null,e=1,r=1,i=Jo;return t.radius=function(e){return arguments.length?(n=Vo(e),t):n},t.size=function(n){return arguments.length?(e=+n[0],r=+n[1],t):[e,r]},t.padding=function(n){return arguments.length?(i="function"==typeof n?n:Sm(+n),t):i},t},Nm=function(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)},Em=function(t,n,e,r,i){for(var o,a=t.children,u=-1,s=a.length,c=t.value&&(r-n)/t.value;++u0)throw new Error("cycle");return o}var n=na,e=ea;return t.id=function(e){return arguments.length?(n=Go(e),t):n},t.parentId=function(n){return arguments.length?(e=Go(n),t):e},t};ca.prototype=Object.create(Oo.prototype);var Pm=function(){function t(t){var r=la(t);if(r.eachAfter(n),r.parent.m=-r.z,r.eachBefore(e),s)t.eachBefore(i);else{var c=t,l=t,f=t;t.eachBefore(function(t){t.xl.x&&(l=t),t.depth>f.depth&&(f=t)});var h=c===l?1:o(c,l)/2,p=h-c.x,d=a/(l.x+h+p),g=u/(f.depth||1);t.eachBefore(function(t){t.x=(t.x+p)*d,t.y=t.depth*g})}return t}function n(t){var n=t.children,e=t.parent.children,i=t.i?e[t.i-1]:null;if(n){ua(t);var a=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+o(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+o(t._,i._));t.parent.A=r(t,i,t.parent.A||e[0])}function e(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function r(t,n,e){if(n){for(var r,i=t,a=t,u=n,s=i.parent.children[0],c=i.m,l=a.m,f=u.m,h=s.m;u=oa(u),i=ia(i),u&&i;)s=ia(s),a=oa(a),a.a=t,r=u.z+f-i.z-c+o(u._,i._),r>0&&(aa(sa(u,t,e),t,r),c+=r,l+=r),f+=u.m,c+=i.m,h+=s.m,l+=a.m;u&&!oa(a)&&(a.t=u,a.m+=f-l),i&&!ia(s)&&(s.t=i,s.m+=c-h,e=t)}return e}function i(t){t.x*=a,t.y=t.depth*u}var o=ra,a=1,u=1,s=null;return t.separation=function(n){return arguments.length?(o=n,t):o},t.size=function(n){return arguments.length?(s=!1,a=+n[0],u=+n[1],t):s?null:[a,u]},t.nodeSize=function(n){return arguments.length?(s=!0,a=+n[0],u=+n[1],t):s?[a,u]:null},t},Om=function(t,n,e,r,i){for(var o,a=t.children,u=-1,s=a.length,c=t.value&&(i-e)/t.value;++u1?n:1)},e}(Fm),Rm=function(){function t(t){return t.x0=t.y0=0,t.x1=i,t.y1=o,t.eachBefore(n),a=[0],r&&t.eachBefore(Nm),t}function n(t){var n=a[t.depth],r=t.x0+n,i=t.y0+n,o=t.x1-n,h=t.y1-n;o=n-1){var c=s[t];return c.x0=r,c.y0=i,c.x1=a,c.y1=u,void 0}for(var f=l[t],h=e/2+f,p=t+1,d=n-1;p>>1;l[g]a-r){var m=(i*y+u*v)/e;o(t,p,v,r,i,a,m),o(p,n,y,r,m,a,u)}else{var _=(r*y+a*v)/e;o(t,p,v,r,i,_,u),o(p,n,y,_,i,a,u)}}var a,u,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=u=a=0;a1?n:1)},e}(Fm),Bm=function(t,n){function e(){var e,i,o=r.length,a=0,u=0;for(e=0;ec+d||il+d||on){var g=c-u.x-u.vx,v=l-u.y-u.vy,y=g*g+v*v;yt.r&&(t.r=t[n].r)}function r(){if(i){var n,e=i.length;for(o=new Array(e),n=0;n1?(null==n?h.remove(t):h.set(t,i(n)),a):h.get(t)},find:function(n,e,r){var i,o,a,u,s,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(d.on(t,n),a):d.on(t)}}},Zm=function(){function t(t){var n,u=i.length,s=H(i,va,ya).visitAfter(e);for(a=t,n=0;n=l)){(t.data!==o||t.next)&&(0===i&&(i=Ym(),p+=i*i),0===s&&(s=Ym(),p+=s*s),p0?my(this).transition().duration(T).call(a,l,u):my(this).call(n.transform,l)}}function h(){if(y.apply(this,arguments)){var n,e,r,i=u(this,arguments),o=t.event.changedTouches,a=o.length;for(ou(),n=0;n0?1:t<0?-1:0},Ux=Math.sqrt,Bx=Math.tan,Wx={Feature:function(t,n){qu(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++rkx?tx=90:Zx<-kx&&(Q_=-90),ax[0]=Z_,ax[1]=K_}},Kx=function(t){var n,e,r,i,o,a,u;if(tx=K_=-(Z_=Q_=1/0),ox=[],$x(t,Qx),e=ox.length){for(ox.sort(Ku),n=1,r=ox[0],o=[r];nQu(r[0],r[1])&&(r[1]=i[1]),Qu(i[0],r[1])>Qu(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-(1/0),e=o.length-1,n=0,r=o[e];n<=e;r=i,++n)i=o[n],(u=Qu(r[1],i[0]))>a&&(a=u,Z_=i[0],K_=r[1])}return ox=ax=null,Z_===1/0||Q_===1/0?[[NaN,NaN],[NaN,NaN]]:[[Z_,Q_],[K_,tx]]},tb={sphere:Au,point:ns,lineStart:rs,lineEnd:as,polygonStart:function(){tb.lineStart=us,tb.lineEnd=ss},polygonEnd:function(){tb.lineStart=rs,tb.lineEnd=as}},nb=function(t){ux=sx=cx=lx=fx=hx=px=dx=gx=vx=yx=0,$x(t,tb);var n=gx,e=vx,r=yx,i=n*n+e*e+r*r;return i2?t[2]*qx:0),n.invert=function(n){return n=t.invert(n[0]*qx,n[1]*qx),n[0]*=Ax,n[1]*=Ax,n},n},vb=function(){function t(t,n){e.push(t=r(t,n)),t[0]*=Ax,t[1]*=Ax}function n(){var t=i.apply(this,arguments),n=o.apply(this,arguments)*qx,s=a.apply(this,arguments)*qx;return e=[],r=hs(-t[0]*qx,-t[1]*qx,0).invert,vs(u,n,s,1),t={type:"Polygon",coordinates:[e]},e=r=null,t}var e,r,i=eb([0,0]),o=eb(90),a=eb(6),u={point:t};return n.center=function(t){return arguments.length?(i="function"==typeof t?t:eb([+t[0],+t[1]]),n):i},n.radius=function(t){return arguments.length?(o="function"==typeof t?t:eb(+t),n):o},n.precision=function(t){return arguments.length?(a="function"==typeof t?t:eb(+t),n):a},n},yb=function(){var t,n=[];return{point:function(n,e){t.push([n,e])},lineStart:function(){n.push(t=[])},lineEnd:Au,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}},mb=function(t,n,e,r,i,o){var a,u=t[0],s=t[1],c=n[0],l=n[1],f=0,h=1,p=c-u,d=l-s;if(a=e-u,p||!(a>0)){if(a/=p,p<0){if(a0){if(a>h)return;a>f&&(f=a)}if(a=i-u,p||!(a<0)){if(a/=p,p<0){if(a>h)return;a>f&&(f=a)}else if(p>0){if(a0)){if(a/=d,d<0){if(a0){if(a>h)return;a>f&&(f=a)}if(a=o-s,d||!(a<0)){if(a/=d,d<0){if(a>h)return;a>f&&(f=a)}else if(d>0){if(a0&&(t[0]=u+f*p,t[1]=s+f*d),h<1&&(n[0]=u+h*p,n[1]=s+h*d),!0}}}}},_b=function(t,n){return Dx(t[0]-n[0])=0;--o)i.point((l=c[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,p=!p}while(!h.v);i.lineEnd()}}},bb=1e9,wb=-bb,Mb=function(){var t,n,e,r=0,i=0,o=960,a=500;return e={stream:function(e){return t&&n===e?t:t=xs(r,i,o,a)(n=e)},extent:function(u){return arguments.length?(r=+u[0][0],i=+u[0][1],o=+u[1][0],a=+u[1][1],t=n=null,e):[[r,i],[o,a]]}}},kb=Y_(),Tb={sphere:Au,point:Au,lineStart:bs,lineEnd:Au,polygonStart:Au,polygonEnd:Au},Sb=function(t){return kb.reset(),$x(t,Tb),+kb},Cb=[null,null],Nb={type:"LineString",coordinates:Cb},Eb=function(t,n){return Cb[0]=t,Cb[1]=n,Sb(Nb)},Ab=function(t,n){var e=t[0]*qx,r=t[1]*qx,i=n[0]*qx,o=n[1]*qx,a=Px(r),u=Hx(r),s=Px(o),c=Hx(o),l=a*Px(e),f=a*Hx(e),h=s*Px(i),p=s*Hx(i),d=2*Nu(Ux(Eu(o-r)+a*s*Eu(i-e))),g=Hx(d),v=d?function(t){var n=Hx(t*=d)/g,e=Hx(d-t)/g,r=e*l+n*h,i=e*f+n*p,o=e*u+n*c;return[Lx(i,r)*Ax,Lx(o,Ux(r*r+i*i))*Ax]}:function(){return[e*Ax,r*Ax]};return v.distance=d,v},qb=function(t){return t},Db=Y_(),jb=Y_(),Lb={point:Au,lineStart:Au,lineEnd:Au,polygonStart:function(){Lb.lineStart=Es,Lb.lineEnd=Ds},polygonEnd:function(){Lb.lineStart=Lb.lineEnd=Lb.point=Au,Db.add(Dx(jb)),jb.reset()},result:function(){var t=Db/2;return Db.reset(),t}},Pb=1/0,Ob=Pb,Fb=-Pb,zb=Fb,Rb={point:js,lineStart:Au,lineEnd:Au,polygonStart:Au,polygonEnd:Au,result:function(){var t=[[Pb,Ob],[Fb,zb]];return Fb=zb=-(Ob=Pb=1/0),t}},Hb=0,Ib=0,Ub=0,Bb=0,Wb=0,Yb=0,$b=0,Xb=0,Vb=0,Gb={point:Ls,lineStart:Ps,lineEnd:zs,polygonStart:function(){Gb.lineStart=Rs,Gb.lineEnd=Hs},polygonEnd:function(){Gb.point=Ls,Gb.lineStart=Ps,Gb.lineEnd=zs},result:function(){var t=Vb?[$b/Vb,Xb/Vb]:Yb?[Bb/Yb,Wb/Yb]:Ub?[Hb/Ub,Ib/Ub]:[NaN,NaN];return Hb=Ib=Ub=Bb=Wb=Yb=$b=Xb=Vb=0,t}};Bs.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,Ex)}},result:Au},Ws.prototype={_circle:Ys(4.5),pointRadius:function(t){return this._circle=Ys(t),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}}};var Jb=function(t,n){function e(t){return t&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),$x(t,r(i))),i.result()}var r,i,o=4.5;return e.area=function(t){return $x(t,r(Lb)),Lb.result()},e.bounds=function(t){return $x(t,r(Rb)),Rb.result()},e.centroid=function(t){return $x(t,r(Gb)),Gb.result()},e.projection=function(n){return arguments.length?(r=null==(t=n)?qb:n.stream,e):t},e.context=function(t){return arguments.length?(i=null==(n=t)?new Ws:new Bs(t),"function"!=typeof o&&i.pointRadius(o),e):n},e.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(i.pointRadius(+t),+t),e):o},e.projection(t).context(n)},Zb=Y_(),Qb=function(t,n){var e=n[0],r=n[1],i=[Hx(e),-Px(e),0],o=0,a=0;Zb.reset();for(var u=0,s=t.length;u=0?1:-1,k=M*w,T=k>Sx,S=d*x;if(Zb.add(Lx(S*M*Hx(k),g*b+S*Px(k))),o+=T?w+M*Ex:w,T^h>=e^m>=e){var C=Iu(Ru(f),Ru(y));Wu(C);var N=Iu(i,C);Wu(N);var E=(T^w>=0?-1:1)*Nu(N[2]);(r>E||r===E&&(C[0]||C[1]))&&(a+=T^w>=0?1:-1)}}return(o<-kx||o0){for(x||(o.polygonStart(),x=!0),o.lineStart(),t=0;t1&&2&i&&a.push(a.pop().concat(a.shift())),d.push(a.filter($s))}var p,d,g,v=n(o),y=i.invert(r[0],r[1]),m=yb(),_=n(m),x=!1,b={point:a,lineStart:s,lineEnd:c,polygonStart:function(){b.point=l,b.lineStart=f,b.lineEnd=h,d=[],p=[]},polygonEnd:function(){b.point=a,b.lineStart=s,b.lineEnd=c,d=Zc(d);var t=Qb(p,y);d.length?(x||(o.polygonStart(),x=!0),xb(d,Xs,t,e,o)):t&&(x||(o.polygonStart(),x=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),d=p=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return b}},tw=Kb(function(){return!0},Vs,Js,[-Sx,-Cx]),nw=function(t,n){function e(e,r,i,o){vs(o,t,n,i,e,r)}function r(t,n){return Px(t)*Px(n)>u}function i(t){var n,e,i,u,l;return{lineStart:function(){u=i=!1,l=1},point:function(f,h){var p,d=[f,h],g=r(f,h),v=s?g?0:a(f,h):g?a(f+(f<0?Sx:-Sx),h):0;if(!n&&(u=i=g)&&t.lineStart(),g!==i&&(p=o(n,d),(_b(n,p)||_b(d,p))&&(d[0]+=kx,d[1]+=kx,g=r(d[0],d[1]))),g!==i)l=0,g?(t.lineStart(),p=o(d,n),t.point(p[0],p[1])):(p=o(n,d),t.point(p[0],p[1]),t.lineEnd()),n=p;else if(c&&n&&s^g){var y;v&e||!(y=o(d,n,!0))||(l=0,s?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||n&&_b(n,d)||t.point(d[0],d[1]),n=d,i=g,e=v},lineEnd:function(){i&&t.lineEnd(),n=null},clean:function(){return l|(u&&i)<<1}}}function o(t,n,e){var r=Ru(t),i=Ru(n),o=[1,0,0],a=Iu(r,i),s=Hu(a,a),c=a[0],l=s-c*c;if(!l)return!e&&t;var f=u*s/l,h=-u*c/l,p=Iu(o,a),d=Bu(o,f),g=Bu(a,h);Uu(d,g);var v=p,y=Hu(d,v),m=Hu(v,v),_=y*y-m*(Hu(d,d)-1);if(!(_<0)){var x=Ux(_),b=Bu(v,(-y-x)/m);if(Uu(b,d),b=zu(b),!e)return b;var w,M=t[0],k=n[0],T=t[1],S=n[1];k0^b[1]<(Dx(b[0]-M)Sx^(M<=b[0]&&b[0]<=k)){var A=Bu(v,(-y+x)/m);return Uu(A,d),[b,zu(A)]}}}function a(n,e){var r=s?t:Sx-t,i=0;return n<-r?i|=1:n>r&&(i|=2),e<-r?i|=4:e>r&&(i|=8),i}var u=Px(t),s=u>0,c=Dx(u)>kx;return Kb(r,i,e,s?[0,-t]:[-Sx,t-Sx])},ew=function(t){return{stream:Zs(t)}};Qs.prototype={constructor:Qs,point:function(t,n){this.stream.point(t,n)},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()}};var rw=16,iw=Px(30*qx),ow=function(t,n){return+n?ec(t,n):nc(t)},aw=Zs({point:function(t,n){this.stream.point(t*qx,n*qx)}}),uw=function(){return oc(uc).scale(155.424).center([0,33.6442])},sw=function(){return uw().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},cw=function(){function t(t){var n=t[0],e=t[1];return u=null,i.point(n,e),u||(o.point(n,e),u)||(a.point(n,e),u)}function n(){return e=r=null,t}var e,r,i,o,a,u,s=sw(),c=uw().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=uw().rotate([157,0]).center([-3,19.9]).parallels([8,18]),f={point:function(t,n){u=[t,n]}};return t.invert=function(t){var n=s.scale(),e=s.translate(),r=(t[0]-e[0])/n,i=(t[1]-e[1])/n;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?c:i>=.166&&i<.234&&r>=-.214&&r<-.115?l:s).invert(t)},t.stream=function(t){return e&&r===t?e:e=sc([s.stream(r=t),c.stream(t),l.stream(t)])},t.precision=function(t){return arguments.length?(s.precision(t),c.precision(t),l.precision(t),n()):s.precision()},t.scale=function(n){return arguments.length?(s.scale(n),c.scale(.35*n),l.scale(n),t.translate(s.translate())):s.scale()},t.translate=function(t){if(!arguments.length)return s.translate();var e=s.scale(),r=+t[0],u=+t[1];return i=s.translate(t).clipExtent([[r-.455*e,u-.238*e],[r+.455*e,u+.238*e]]).stream(f),o=c.translate([r-.307*e,u+.201*e]).clipExtent([[r-.425*e+kx,u+.12*e+kx],[r-.214*e-kx,u+.234*e-kx]]).stream(f),a=l.translate([r-.205*e,u+.212*e]).clipExtent([[r-.214*e+kx,u+.166*e+kx],[r-.115*e-kx,u+.234*e-kx]]).stream(f),n()},t.fitExtent=function(n,e){return Ks(t,n,e)},t.fitSize=function(n,e){return tc(t,n,e)},t.scale(1070)},lw=cc(function(t){return Ux(2/(1+t))});lw.invert=lc(function(t){return 2*Nu(t/2)});var fw=function(){return rc(lw).scale(124.75).clipAngle(179.999)},hw=cc(function(t){return(t=Cu(t))&&t/Hx(t)});hw.invert=lc(function(t){return t});var pw=function(){return rc(hw).scale(79.4188).clipAngle(179.999)};fc.invert=function(t,n){return[t,2*jx(Fx(n))-Cx]};var dw=function(){return hc(fc).scale(961/Ex)},gw=function(){return oc(dc).scale(109.5).parallels([30,30])};gc.invert=gc;var vw=function(){return rc(gc).scale(152.63)},yw=function(){return oc(vc).scale(131.154).center([0,13.9389])};yc.invert=lc(jx);var mw=function(){return rc(yc).scale(144.049).clipAngle(60)},_w=function(){function t(){return i=o=null,a}var n,e,r,i,o,a,u=1,s=0,c=0,l=qb,f=null,h=qb;return a={stream:function(t){return i&&o===t?i:i=l(h(o=t))},clipExtent:function(i){return arguments.length?(h=null==i?(f=n=e=r=null,qb):xs(f=+i[0][0],n=+i[0][1],e=+i[1][0],r=+i[1][1]),t()):null==f?null:[[f,n],[e,r]]},scale:function(n){return arguments.length?(l=mc(u=+n,s,c),t()):u},translate:function(n){return arguments.length?(l=mc(u,s=+n[0],c=+n[1]),t()):[s,c]},fitExtent:function(t,n){return Ks(a,t,n)},fitSize:function(t,n){return tc(a,t,n)}}};_c.invert=lc(Nu);var xw=function(){return rc(_c).scale(249.5).clipAngle(90+kx)};xc.invert=lc(function(t){return 2*jx(t)});var bw=function(){return rc(xc).scale(250).clipAngle(142)};bc.invert=function(t,n){return[-n,2*jx(Fx(t))-Cx]};var ww=function(){var t=hc(bc),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):(t=n(),[t[1],-t[0]])},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):(t=e(),[t[0],t[1],t[2]-90])},e([0,0,90]).scale(159.155)};t.version=wc,t.bisect=Sc,t.bisectRight=Sc,t.bisectLeft=Cc,t.ascending=Mc,t.bisector=kc,t.descending=Nc,t.deviation=qc,t.extent=Dc,t.histogram=Wc,t.thresholdFreedmanDiaconis=$c,t.thresholdScott=Xc,t.thresholdSturges=Bc,t.max=Vc,t.mean=Gc,t.median=Jc,t.merge=Zc,t.min=Qc,t.pairs=Kc,t.permute=tl,t.quantile=Yc,t.range=zc,t.scan=nl,t.shuffle=el,t.sum=rl,t.ticks=Uc,t.tickStep=e,t.transpose=il,t.variance=Ac,t.zip=ol,t.entries=fl,t.keys=cl,t.values=ll,t.map=o,t.set=f,t.nest=ul,t.randomUniform=hl,t.randomNormal=pl,t.randomLogNormal=dl,t.randomBates=vl,t.randomIrwinHall=gl,t.randomExponential=yl,t.easeLinear=h,t.easeQuad=g,t.easeQuadIn=p,t.easeQuadOut=d,t.easeQuadInOut=g,t.easeCubic=m,t.easeCubicIn=v,t.easeCubicOut=y,t.easeCubicInOut=m,t.easePoly=bl,t.easePolyIn=_l,t.easePolyOut=xl,t.easePolyInOut=bl,t.easeSin=b,t.easeSinIn=_,t.easeSinOut=x,t.easeSinInOut=b,t.easeExp=k,t.easeExpIn=w,t.easeExpOut=M,t.easeExpInOut=k,t.easeCircle=C,t.easeCircleIn=T,t.easeCircleOut=S,t.easeCircleInOut=C,t.easeBounce=E,t.easeBounceIn=N,t.easeBounceOut=E,t.easeBounceInOut=A,t.easeBack=Fl,t.easeBackIn=Pl,t.easeBackOut=Ol,t.easeBackInOut=Fl,t.easeElastic=Ul,t.easeElasticIn=Il,t.easeElasticOut=Ul,t.easeElasticInOut=Bl,t.polygonArea=Wl,t.polygonCentroid=Yl,t.polygonHull=Xl,t.polygonContains=Vl,t.polygonLength=Gl,t.path=L,t.quadtree=H,t.queue=G,t.arc=wf,t.area=Tf,t.line=kf,t.pie=Nf,t.radialArea=qf,t.radialLine=Af,t.symbol=Zf,t.symbols=Jf,t.symbolCircle=Df,t.symbolCross=jf,t.symbolDiamond=Of,t.symbolSquare=Uf,t.symbolStar=If,t.symbolTriangle=Wf,t.symbolWye=Gf,t.curveBasisClosed=th,t.curveBasisOpen=nh,t.curveBasis=Kf,t.curveBundle=eh,t.curveCardinalClosed=ih,t.curveCardinalOpen=oh,t.curveCardinal=rh,t.curveCatmullRomClosed=uh,t.curveCatmullRomOpen=sh,t.curveCatmullRom=ah,t.curveLinearClosed=ch,t.curveLinear=Mf,t.curveMonotoneX=qt,t.curveMonotoneY=Dt,t.curveNatural=lh,t.curveStep=fh,t.curveStepAfter=Ft,t.curveStepBefore=Ot,t.stack=gh,t.stackOffsetExpand=vh,t.stackOffsetNone=ph,t.stackOffsetSilhouette=yh,t.stackOffsetWiggle=mh,t.stackOrderAscending=_h,t.stackOrderDescending=xh,t.stackOrderInsideOut=bh,t.stackOrderNone=dh,t.stackOrderReverse=wh,t.color=Ut,t.rgb=$t,t.hsl=Jt,t.lab=tn,t.hcl=sn,t.cubehelix=fn,t.interpolate=vp,t.interpolateArray=cp,t.interpolateDate=lp,t.interpolateNumber=fp,t.interpolateObject=hp,t.interpolateRound=yp,t.interpolateString=gp,t.interpolateTransformCss=bp,t.interpolateTransformSvg=wp,t.interpolateZoom=Cp,t.interpolateRgb=ap,t.interpolateRgbBasis=up,t.interpolateRgbBasisClosed=sp,t.interpolateHsl=Np,t.interpolateHslLong=Ep,t.interpolateLab=En,t.interpolateHcl=Ap,t.interpolateHclLong=qp,t.interpolateCubehelix=Dp,t.interpolateCubehelixLong=jp,t.interpolateBasis=rp,t.interpolateBasisClosed=ip,t.quantize=Lp,t.dispatch=Dn,t.dsvFormat=zp,t.csvParse=Hp,t.csvParseRows=Ip,t.csvFormat=Up,t.csvFormatRows=Bp,t.tsvParse=Yp,t.tsvParseRows=$p,t.tsvFormat=Xp,t.tsvFormatRows=Vp,t.request=Gp,t.html=Zp,t.json=Qp,t.text=Kp,t.xml=td,t.csv=ed,t.tsv=rd,t.now=Bn,t.timer=$n,t.timerFlush=Xn,t.timeout=pd,t.interval=dd,t.timeInterval=Qn,t.timeMillisecond=yd,t.timeMilliseconds=md,t.timeSecond=kd,t.timeSeconds=Td,t.timeMinute=Sd,t.timeMinutes=Cd,t.timeHour=Nd,t.timeHours=Ed,t.timeDay=Ad,t.timeDays=qd,t.timeWeek=Dd,t.timeWeeks=Rd,t.timeSunday=Dd,t.timeSundays=Rd,t.timeMonday=jd,t.timeMondays=Hd,t.timeTuesday=Ld,t.timeTuesdays=Id;t.timeWednesday=Pd;t.timeWednesdays=Ud,t.timeThursday=Od,t.timeThursdays=Bd,t.timeFriday=Fd,t.timeFridays=Wd,t.timeSaturday=zd,t.timeSaturdays=Yd,t.timeMonth=$d,t.timeMonths=Xd,t.timeYear=Vd,t.timeYears=Gd,t.utcMillisecond=yd,t.utcMilliseconds=md,t.utcSecond=kd,t.utcSeconds=Td,t.utcMinute=Jd,t.utcMinutes=Zd,t.utcHour=Qd,t.utcHours=Kd,t.utcDay=tg,t.utcDays=ng,t.utcWeek=eg,t.utcWeeks=cg,t.utcSunday=eg,t.utcSundays=cg,t.utcMonday=rg,t.utcMondays=lg,t.utcTuesday=ig,t.utcTuesdays=fg,t.utcWednesday=og,t.utcWednesdays=hg,t.utcThursday=ag,t.utcThursdays=pg,t.utcFriday=ug,t.utcFridays=dg,t.utcSaturday=sg,t.utcSaturdays=gg,t.utcMonth=vg,t.utcMonths=yg,t.utcYear=mg,t.utcYears=xg,t.formatLocale=Dg,t.formatDefaultLocale=re,t.formatSpecifier=Eg,t.precisionFixed=Lg,t.precisionPrefix=Pg,t.precisionRound=Og,t.isoFormat=Ug,t.isoParse=Bg,t.timeFormatLocale=ue,t.timeFormatDefaultLocale=nr,t.scaleBand=or,t.scalePoint=ur,t.scaleIdentity=yr,t.scaleLinear=vr,t.scaleLog=kr,t.scaleOrdinal=ir,t.scaleImplicit=Xg,t.scalePow=Sr,t.scaleSqrt=Cr,t.scaleQuantile=Nr,t.scaleQuantize=Er,t.scaleThreshold=Ar,t.scaleTime=av,t.scaleUtc=uv,t.schemeCategory10=cv,t.schemeCategory20b=lv,t.schemeCategory20c=fv,t.schemeCategory20=hv,t.scaleSequential=Pr,t.interpolateCubehelixDefault=pv,t.interpolateRainbow=yv,t.interpolateWarm=dv,t.interpolateCool=gv,t.interpolateViridis=mv,t.interpolateMagma=_v,t.interpolateInferno=xv,t.interpolatePlasma=bv,t.creator=Tv,t.customEvent=Yr,t.local=zr,t.matcher=Av,t.mouse=Ov,t.namespace=kv,t.namespaces=Mv,t.select=my,t.selectAll=_y,t.selection=Di,t.selector=Fv,t.selectorAll=Rv,t.touch=xy,t.touches=by,t.window=iy,t.active=im,t.interrupt=Dy,t.transition=lo,t.axisTop=_o,t.axisRight=xo,t.axisBottom=bo,t.axisLeft=wo,t.cluster=hm,t.hierarchy=qo,t.pack=Cm,t.packSiblings=Tm,t.packEnclose=km,t.partition=Am,t.stratify=Lm,t.tree=Pm,t.treemap=Rm,t.treemapBinary=Hm,t.treemapDice=Em,t.treemapSlice=Om,t.treemapSliceDice=Im,t.treemapSquarify=zm,t.treemapResquarify=Um,t.forceCenter=Bm,t.forceCollide=$m,t.forceLink=Xm,t.forceManyBody=Zm,t.forceSimulation=Jm,t.forceX=Qm,t.forceY=Km,t.drag=r_,t.dragDisable=n_,t.dragEnable=_a,t.voronoi=d_,t.zoom=m_,t.zoomIdentity=v_,t.zoomTransform=iu,t.brush=L_,t.brushX=vu,t.brushY=yu,t.brushSelection=gu,t.chord=I_,t.ribbon=W_,t.geoAlbers=sw,t.geoAlbersUsa=cw,t.geoArea=Jx,t.geoAzimuthalEqualArea=fw,t.geoAzimuthalEqualAreaRaw=lw,t.geoAzimuthalEquidistant=pw,t.geoAzimuthalEquidistantRaw=hw,t.geoBounds=Kx,t.geoCentroid=nb,t.geoCircle=vb,t.geoClipExtent=Mb,t.geoConicConformal=gw,t.geoConicConformalRaw=dc,t.geoConicEqualArea=uw,t.geoConicEqualAreaRaw=uc,t.geoConicEquidistant=yw,t.geoConicEquidistantRaw=vc,t.geoDistance=Eb,t.geoEquirectangular=vw,t.geoEquirectangularRaw=gc,t.geoGnomonic=mw,t.geoGnomonicRaw=yc,t.geoGraticule=Cs,t.geoGraticule10=Ns,t.geoIdentity=_w,t.geoInterpolate=Ab,t.geoLength=Sb,t.geoMercator=dw,t.geoMercatorRaw=fc,t.geoOrthographic=xw,t.geoOrthographicRaw=_c,t.geoPath=Jb,t.geoProjection=rc,t.geoProjectionMutator=ic,t.geoRotation=gb,t.geoStereographic=bw,t.geoStereographicRaw=xc,t.geoStream=$x,t.geoTransform=ew,t.geoTransverseMercator=ww,t.geoTransverseMercatorRaw=bc,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,n,e){var r,i;/*! + * jQuery JavaScript Library v3.1.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2016-09-22T22:30Z + */ +!function(n,e){"use strict";"object"==typeof t&&"object"==typeof t.exports?t.exports=n.document?e(n,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(n)}("undefined"!=typeof window?window:this,function(e,o){"use strict";function a(t,n){n=n||ot;var e=n.createElement("script");e.text=t,n.head.appendChild(e).parentNode.removeChild(e)}function u(t){var n=!!t&&"length"in t&&t.length,e=mt.type(t);return"function"!==e&&!mt.isWindow(t)&&("array"===e||0===n||"number"==typeof n&&n>0&&n-1 in t)}function s(t,n,e){return mt.isFunction(n)?mt.grep(t,function(t,r){return!!n.call(t,r,t)!==e}):n.nodeType?mt.grep(t,function(t){return t===n!==e}):"string"!=typeof n?mt.grep(t,function(t){return lt.call(n,t)>-1!==e}):Nt.test(n)?mt.filter(n,t,e):(n=mt.filter(n,t),mt.grep(t,function(t){return lt.call(n,t)>-1!==e&&1===t.nodeType}))}function c(t,n){for(;(t=t[n])&&1!==t.nodeType;);return t}function l(t){var n={};return mt.each(t.match(Lt)||[],function(t,e){n[e]=!0}),n}function f(t){return t}function h(t){throw t}function p(t,n,e){var r;try{t&&mt.isFunction(r=t.promise)?r.call(t).done(n).fail(e):t&&mt.isFunction(r=t.then)?r.call(t,n,e):n.call(void 0,t)}catch(t){e.call(void 0,t)}}function d(){ot.removeEventListener("DOMContentLoaded",d),e.removeEventListener("load",d),mt.ready()}function g(){this.expando=mt.expando+g.uid++}function v(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:It.test(t)?JSON.parse(t):t)}function y(t,n,e){var r;if(void 0===e&&1===t.nodeType)if(r="data-"+n.replace(Ut,"-$&").toLowerCase(),e=t.getAttribute(r),"string"==typeof e){try{e=v(e)}catch(t){}Ht.set(t,n,e)}else e=void 0;return e}function m(t,n,e,r){var i,o=1,a=20,u=r?function(){return r.cur()}:function(){return mt.css(t,n,"")},s=u(),c=e&&e[3]||(mt.cssNumber[n]?"":"px"),l=(mt.cssNumber[n]||"px"!==c&&+s)&&Wt.exec(mt.css(t,n));if(l&&l[3]!==c){c=c||l[3],e=e||[],l=+s||1;do o=o||".5",l/=o,mt.style(t,n,l+c);while(o!==(o=u()/s)&&1!==o&&--a)}return e&&(l=+l||+s||0,i=e[1]?l+(e[1]+1)*e[2]:+e[2],r&&(r.unit=c,r.start=l,r.end=i)),i}function _(t){var n,e=t.ownerDocument,r=t.nodeName,i=Vt[r];return i?i:(n=e.body.appendChild(e.createElement(r)),i=mt.css(n,"display"),n.parentNode.removeChild(n),"none"===i&&(i="block"),Vt[r]=i,i)}function x(t,n){for(var e,r,i=[],o=0,a=t.length;o-1)i&&i.push(o);else if(c=mt.contains(o.ownerDocument,o),a=b(f.appendChild(o),"script"),c&&w(a),e)for(l=0;o=a[l++];)Zt.test(o.type||"")&&e.push(o);return f}function k(){return!0}function T(){return!1}function S(){try{return ot.activeElement}catch(t){}}function C(t,n,e,r,i,o){var a,u;if("object"==typeof n){"string"!=typeof e&&(r=r||e,e=void 0);for(u in n)C(t,u,e,r,n[u],o);return t}if(null==r&&null==i?(i=e,r=e=void 0):null==i&&("string"==typeof e?(i=r,r=void 0):(i=r,r=e,e=void 0)),i===!1)i=T;else if(!i)return t;return 1===o&&(a=i,i=function(t){return mt().off(t),a.apply(this,arguments)},i.guid=a.guid||(a.guid=mt.guid++)),t.each(function(){mt.event.add(this,n,i,r,e)})}function N(t,n){return mt.nodeName(t,"table")&&mt.nodeName(11!==n.nodeType?n:n.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t:t}function E(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function A(t){var n=sn.exec(t.type);return n?t.type=n[1]:t.removeAttribute("type"),t}function q(t,n){var e,r,i,o,a,u,s,c;if(1===n.nodeType){if(Rt.hasData(t)&&(o=Rt.access(t),a=Rt.set(n,o),c=o.events)){delete a.handle,a.events={};for(i in c)for(e=0,r=c[i].length;e1&&"string"==typeof d&&!vt.checkClone&&un.test(d))return t.each(function(i){var o=t.eq(i);g&&(n[0]=d.call(this,i,o.html())),j(o,n,e,r)});if(h&&(i=M(n,t[0].ownerDocument,!1,t,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=mt.map(b(i,"script"),E),s=u.length;f=0&&eM.cacheLength&&delete t[n.shift()],t[e+" "]=r}var n=[];return t}function r(t){return t[H]=!0,t}function i(t){var n=j.createElement("fieldset");try{return!!t(n)}catch(t){return!1}finally{n.parentNode&&n.parentNode.removeChild(n),n=null}}function o(t,n){for(var e=t.split("|"),r=e.length;r--;)M.attrHandle[e[r]]=n}function a(t,n){var e=n&&t,r=e&&1===t.nodeType&&1===n.nodeType&&t.sourceIndex-n.sourceIndex;if(r)return r;if(e)for(;e=e.nextSibling;)if(e===n)return-1;return t?1:-1}function u(t){return function(n){var e=n.nodeName.toLowerCase();return"input"===e&&n.type===t}}function s(t){return function(n){var e=n.nodeName.toLowerCase();return("input"===e||"button"===e)&&n.type===t}}function c(t){return function(n){return"form"in n?n.parentNode&&n.disabled===!1?"label"in n?"label"in n.parentNode?n.parentNode.disabled===t:n.disabled===t:n.isDisabled===t||n.isDisabled!==!t&&kt(n)===t:n.disabled===t:"label"in n&&n.disabled===t}}function l(t){return r(function(n){return n=+n,r(function(e,r){for(var i,o=t([],e.length,n),a=o.length;a--;)e[i=o[a]]&&(e[i]=!(r[i]=e[i]))})})}function f(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function h(){}function p(t){for(var n=0,e=t.length,r="";n1?function(n,e,r){for(var i=t.length;i--;)if(!t[i](n,e,r))return!1;return!0}:t[0]}function v(t,e,r){for(var i=0,o=e.length;i-1&&(r[c]=!(a[c]=f))}}else _=y(_===a?_.splice(d,_.length):_),o?o(null,a,_,s):Q.apply(a,_)})}function _(t){for(var n,e,r,i=t.length,o=M.relative[t[0].type],a=o||M.relative[" "],u=o?1:0,s=d(function(t){return t===n},a,!0),c=d(function(t){return tt(n,t)>-1},a,!0),l=[function(t,e,r){var i=!o&&(r||e!==E)||((n=e).nodeType?s(t,e,r):c(t,e,r));return n=null,i}];u1&&g(l),u>1&&p(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(ut,"$1"),e,u0,o=t.length>0,a=function(r,a,u,s,c){var l,f,h,p=0,d="0",g=r&&[],v=[],m=E,_=r||o&&M.find.TAG("*",c),x=U+=null==m?1:Math.random()||.1,b=_.length;for(c&&(E=a===j||a||c);d!==b&&null!=(l=_[d]);d++){if(o&&l){for(f=0,a||l.ownerDocument===j||(D(l),u=!P);h=t[f++];)if(h(l,a||j,u)){s.push(l);break}c&&(U=x)}i&&((l=!h&&l)&&p--,r&&g.push(l))}if(p+=d,i&&d!==p){for(f=0;h=e[f++];)h(g,v,a,u);if(r){if(p>0)for(;d--;)g[d]||v[d]||(v[d]=J.call(s));v=y(v)}Q.apply(s,v),c&&!r&&v.length>0&&p+e.length>1&&n.uniqueSort(s)}return c&&(U=x,E=m),g};return i?r(a):a}var b,w,M,k,T,S,C,N,E,A,q,D,j,L,P,O,F,z,R,H="sizzle"+1*new Date,I=t.document,U=0,B=0,W=e(),Y=e(),$=e(),X=function(t,n){return t===n&&(q=!0),0},V={}.hasOwnProperty,G=[],J=G.pop,Z=G.push,Q=G.push,K=G.slice,tt=function(t,n){for(var e=0,r=t.length;e+~]|"+et+")"+et+"*"),lt=new RegExp("="+et+"*([^\\]'\"]*?)"+et+"*\\]","g"),ft=new RegExp(ot),ht=new RegExp("^"+rt+"$"),pt={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),TAG:new RegExp("^("+rt+"|[*])"),ATTR:new RegExp("^"+it),PSEUDO:new RegExp("^"+ot),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+et+"*(even|odd|(([+-]|)(\\d*)n|)"+et+"*(?:([+-]|)"+et+"*(\\d+)|))"+et+"*\\)|)","i"),bool:new RegExp("^(?:"+nt+")$","i"),needsContext:new RegExp("^"+et+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+et+"*((?:-\\d)?\\d*)"+et+"*\\)|)(?=[^-]|$)","i")},dt=/^(?:input|select|textarea|button)$/i,gt=/^h\d$/i,vt=/^[^{]+\{\s*\[native \w/,yt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,mt=/[+~]/,_t=new RegExp("\\\\([\\da-f]{1,6}"+et+"?|("+et+")|.)","ig"),xt=function(t,n,e){var r="0x"+n-65536;return r!==r||e?n:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},bt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,wt=function(t,n){return n?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},Mt=function(){D()},kt=d(function(t){return t.disabled===!0&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{Q.apply(G=K.call(I.childNodes),I.childNodes),G[I.childNodes.length].nodeType}catch(t){Q={apply:G.length?function(t,n){Z.apply(t,K.call(n))}:function(t,n){for(var e=t.length,r=0;t[e++]=n[r++];);t.length=e-1}}}w=n.support={},T=n.isXML=function(t){var n=t&&(t.ownerDocument||t).documentElement;return!!n&&"HTML"!==n.nodeName},D=n.setDocument=function(t){var n,e,r=t?t.ownerDocument||t:I;return r!==j&&9===r.nodeType&&r.documentElement?(j=r,L=j.documentElement,P=!T(j),I!==j&&(e=j.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",Mt,!1):e.attachEvent&&e.attachEvent("onunload",Mt)),w.attributes=i(function(t){return t.className="i",!t.getAttribute("className")}),w.getElementsByTagName=i(function(t){return t.appendChild(j.createComment("")),!t.getElementsByTagName("*").length}),w.getElementsByClassName=vt.test(j.getElementsByClassName),w.getById=i(function(t){return L.appendChild(t).id=H,!j.getElementsByName||!j.getElementsByName(H).length}),w.getById?(M.filter.ID=function(t){var n=t.replace(_t,xt);return function(t){return t.getAttribute("id")===n}},M.find.ID=function(t,n){if("undefined"!=typeof n.getElementById&&P){var e=n.getElementById(t);return e?[e]:[]}}):(M.filter.ID=function(t){var n=t.replace(_t,xt);return function(t){var e="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return e&&e.value===n}},M.find.ID=function(t,n){if("undefined"!=typeof n.getElementById&&P){var e,r,i,o=n.getElementById(t);if(o){if(e=o.getAttributeNode("id"),e&&e.value===t)return[o];for(i=n.getElementsByName(t),r=0;o=i[r++];)if(e=o.getAttributeNode("id"),e&&e.value===t)return[o]}return[]}}),M.find.TAG=w.getElementsByTagName?function(t,n){return"undefined"!=typeof n.getElementsByTagName?n.getElementsByTagName(t):w.qsa?n.querySelectorAll(t):void 0}:function(t,n){var e,r=[],i=0,o=n.getElementsByTagName(t);if("*"===t){for(;e=o[i++];)1===e.nodeType&&r.push(e);return r}return o},M.find.CLASS=w.getElementsByClassName&&function(t,n){if("undefined"!=typeof n.getElementsByClassName&&P)return n.getElementsByClassName(t)},F=[],O=[],(w.qsa=vt.test(j.querySelectorAll))&&(i(function(t){L.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&O.push("[*^$]="+et+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||O.push("\\["+et+"*(?:value|"+nt+")"),t.querySelectorAll("[id~="+H+"-]").length||O.push("~="),t.querySelectorAll(":checked").length||O.push(":checked"),t.querySelectorAll("a#"+H+"+*").length||O.push(".#.+[+~]")}),i(function(t){t.innerHTML="";var n=j.createElement("input");n.setAttribute("type","hidden"),t.appendChild(n).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&O.push("name"+et+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&O.push(":enabled",":disabled"),L.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&O.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),O.push(",.*:")})),(w.matchesSelector=vt.test(z=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(t){w.disconnectedMatch=z.call(t,"*"),z.call(t,"[s!='']:x"),F.push("!=",ot)}),O=O.length&&new RegExp(O.join("|")),F=F.length&&new RegExp(F.join("|")),n=vt.test(L.compareDocumentPosition),R=n||vt.test(L.contains)?function(t,n){var e=9===t.nodeType?t.documentElement:t,r=n&&n.parentNode;return t===r||!(!r||1!==r.nodeType||!(e.contains?e.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,n){if(n)for(;n=n.parentNode;)if(n===t)return!0;return!1},X=n?function(t,n){if(t===n)return q=!0,0;var e=!t.compareDocumentPosition-!n.compareDocumentPosition;return e?e:(e=(t.ownerDocument||t)===(n.ownerDocument||n)?t.compareDocumentPosition(n):1,1&e||!w.sortDetached&&n.compareDocumentPosition(t)===e?t===j||t.ownerDocument===I&&R(I,t)?-1:n===j||n.ownerDocument===I&&R(I,n)?1:A?tt(A,t)-tt(A,n):0:4&e?-1:1)}:function(t,n){if(t===n)return q=!0,0;var e,r=0,i=t.parentNode,o=n.parentNode,u=[t],s=[n];if(!i||!o)return t===j?-1:n===j?1:i?-1:o?1:A?tt(A,t)-tt(A,n):0;if(i===o)return a(t,n);for(e=t;e=e.parentNode;)u.unshift(e);for(e=n;e=e.parentNode;)s.unshift(e);for(;u[r]===s[r];)r++;return r?a(u[r],s[r]):u[r]===I?-1:s[r]===I?1:0},j):j},n.matches=function(t,e){return n(t,null,null,e)},n.matchesSelector=function(t,e){if((t.ownerDocument||t)!==j&&D(t),e=e.replace(lt,"='$1']"),w.matchesSelector&&P&&!$[e+" "]&&(!F||!F.test(e))&&(!O||!O.test(e)))try{var r=z.call(t,e);if(r||w.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){}return n(e,j,null,[t]).length>0},n.contains=function(t,n){return(t.ownerDocument||t)!==j&&D(t),R(t,n)},n.attr=function(t,n){(t.ownerDocument||t)!==j&&D(t);var e=M.attrHandle[n.toLowerCase()],r=e&&V.call(M.attrHandle,n.toLowerCase())?e(t,n,!P):void 0;return void 0!==r?r:w.attributes||!P?t.getAttribute(n):(r=t.getAttributeNode(n))&&r.specified?r.value:null},n.escape=function(t){return(t+"").replace(bt,wt)},n.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},n.uniqueSort=function(t){var n,e=[],r=0,i=0;if(q=!w.detectDuplicates,A=!w.sortStable&&t.slice(0),t.sort(X),q){for(;n=t[i++];)n===t[i]&&(r=e.push(i));for(;r--;)t.splice(e[r],1)}return A=null,t},k=n.getText=function(t){var n,e="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)e+=k(t)}else if(3===i||4===i)return t.nodeValue}else for(;n=t[r++];)e+=k(n);return e},M=n.selectors={cacheLength:50,createPseudo:r,match:pt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(_t,xt),t[3]=(t[3]||t[4]||t[5]||"").replace(_t,xt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||n.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&n.error(t[0]),t},PSEUDO:function(t){var n,e=!t[6]&&t[2];return pt.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":e&&ft.test(e)&&(n=S(e,!0))&&(n=e.indexOf(")",e.length-n)-e.length)&&(t[0]=t[0].slice(0,n),t[2]=e.slice(0,n)),t.slice(0,3))}},filter:{TAG:function(t){var n=t.replace(_t,xt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===n}},CLASS:function(t){var n=W[t+" "];return n||(n=new RegExp("(^|"+et+")"+t+"("+et+"|$)"))&&W(t,function(t){return n.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,r){return function(i){var o=n.attr(i,t);return null==o?"!="===e:!e||(o+="","="===e?o===r:"!="===e?o!==r:"^="===e?r&&0===o.indexOf(r):"*="===e?r&&o.indexOf(r)>-1:"$="===e?r&&o.slice(-r.length)===r:"~="===e?(" "+o.replace(at," ")+" ").indexOf(r)>-1:"|="===e&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(t,n,e,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===n;return 1===r&&0===i?function(t){return!!t.parentNode}:function(n,e,s){var c,l,f,h,p,d,g=o!==a?"nextSibling":"previousSibling",v=n.parentNode,y=u&&n.nodeName.toLowerCase(),m=!s&&!u,_=!1;if(v){if(o){for(;g;){for(h=n;h=h[g];)if(u?h.nodeName.toLowerCase()===y:1===h.nodeType)return!1;d=g="only"===t&&!d&&"nextSibling"}return!0}if(d=[a?v.firstChild:v.lastChild],a&&m){for(h=v,f=h[H]||(h[H]={}),l=f[h.uniqueID]||(f[h.uniqueID]={}),c=l[t]||[],p=c[0]===U&&c[1],_=p&&c[2],h=p&&v.childNodes[p];h=++p&&h&&h[g]||(_=p=0)||d.pop();)if(1===h.nodeType&&++_&&h===n){l[t]=[U,p,_];break}}else if(m&&(h=n,f=h[H]||(h[H]={}),l=f[h.uniqueID]||(f[h.uniqueID]={}),c=l[t]||[],p=c[0]===U&&c[1],_=p),_===!1)for(;(h=++p&&h&&h[g]||(_=p=0)||d.pop())&&((u?h.nodeName.toLowerCase()!==y:1!==h.nodeType)||!++_||(m&&(f=h[H]||(h[H]={}),l=f[h.uniqueID]||(f[h.uniqueID]={}),l[t]=[U,_]),h!==n)););return _-=i,_===r||_%r===0&&_/r>=0}}},PSEUDO:function(t,e){var i,o=M.pseudos[t]||M.setFilters[t.toLowerCase()]||n.error("unsupported pseudo: "+t);return o[H]?o(e):o.length>1?(i=[t,t,"",e],M.setFilters.hasOwnProperty(t.toLowerCase())?r(function(t,n){for(var r,i=o(t,e),a=i.length;a--;)r=tt(t,i[a]),t[r]=!(n[r]=i[a])}):function(t){return o(t,0,i)}):o}},pseudos:{not:r(function(t){var n=[],e=[],i=C(t.replace(ut,"$1"));return i[H]?r(function(t,n,e,r){for(var o,a=i(t,null,r,[]),u=t.length;u--;)(o=a[u])&&(t[u]=!(n[u]=o))}):function(t,r,o){return n[0]=t,i(n,null,o,e),n[0]=null,!e.pop()}}),has:r(function(t){return function(e){return n(t,e).length>0}}),contains:r(function(t){return t=t.replace(_t,xt),function(n){return(n.textContent||n.innerText||k(n)).indexOf(t)>-1}}),lang:r(function(t){return ht.test(t||"")||n.error("unsupported lang: "+t),t=t.replace(_t,xt).toLowerCase(),function(n){var e;do if(e=P?n.lang:n.getAttribute("xml:lang")||n.getAttribute("lang"))return e=e.toLowerCase(),e===t||0===e.indexOf(t+"-");while((n=n.parentNode)&&1===n.nodeType);return!1}}),target:function(n){var e=t.location&&t.location.hash;return e&&e.slice(1)===n.id},root:function(t){return t===L},focus:function(t){return t===j.activeElement&&(!j.hasFocus||j.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:c(!1),disabled:c(!0),checked:function(t){var n=t.nodeName.toLowerCase();return"input"===n&&!!t.checked||"option"===n&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!M.pseudos.empty(t)},header:function(t){return gt.test(t.nodeName)},input:function(t){return dt.test(t.nodeName)},button:function(t){var n=t.nodeName.toLowerCase();return"input"===n&&"button"===t.type||"button"===n},text:function(t){var n;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(n=t.getAttribute("type"))||"text"===n.toLowerCase())},first:l(function(){return[0]}),last:l(function(t,n){return[n-1]}),eq:l(function(t,n,e){return[e<0?e+n:e]}),even:l(function(t,n){for(var e=0;e=0;)t.push(r);return t}),gt:l(function(t,n,e){for(var r=e<0?e+n:e;++r2&&"ID"===(a=o[0]).type&&9===n.nodeType&&P&&M.relative[o[1].type]){if(n=(M.find.ID(a.matches[0].replace(_t,xt),n)||[])[0],!n)return e;c&&(n=n.parentNode),t=t.slice(o.shift().value.length)}for(i=pt.needsContext.test(t)?0:o.length;i--&&(a=o[i],!M.relative[u=a.type]);)if((s=M.find[u])&&(r=s(a.matches[0].replace(_t,xt),mt.test(o[0].type)&&f(n.parentNode)||n))){if(o.splice(i,1),t=r.length&&p(o),!t)return Q.apply(e,r),e;break}}return(c||C(t,l))(r,n,!P,e,!n||mt.test(t)&&f(n.parentNode)||n),e},w.sortStable=H.split("").sort(X).join("")===H,w.detectDuplicates=!!q,D(),w.sortDetached=i(function(t){return 1&t.compareDocumentPosition(j.createElement("fieldset"))}),i(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,n,e){if(!e)return t.getAttribute(n,"type"===n.toLowerCase()?1:2)}),w.attributes&&i(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,n,e){if(!e&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),i(function(t){return null==t.getAttribute("disabled")})||o(nt,function(t,n,e){var r;if(!e)return t[n]===!0?n.toLowerCase():(r=t.getAttributeNode(n))&&r.specified?r.value:null}),n}(e);mt.find=Mt,mt.expr=Mt.selectors,mt.expr[":"]=mt.expr.pseudos,mt.uniqueSort=mt.unique=Mt.uniqueSort,mt.text=Mt.getText,mt.isXMLDoc=Mt.isXML,mt.contains=Mt.contains,mt.escapeSelector=Mt.escape;var kt=function(t,n,e){for(var r=[],i=void 0!==e;(t=t[n])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&mt(t).is(e))break;r.push(t)}return r},Tt=function(t,n){for(var e=[];t;t=t.nextSibling)1===t.nodeType&&t!==n&&e.push(t);return e},St=mt.expr.match.needsContext,Ct=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,Nt=/^.[^:#\[\.,]*$/;mt.filter=function(t,n,e){var r=n[0];return e&&(t=":not("+t+")"),1===n.length&&1===r.nodeType?mt.find.matchesSelector(r,t)?[r]:[]:mt.find.matches(t,mt.grep(n,function(t){return 1===t.nodeType}))},mt.fn.extend({find:function(t){var n,e,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(mt(t).filter(function(){for(n=0;n1?mt.uniqueSort(e):e},filter:function(t){return this.pushStack(s(this,t||[],!1))},not:function(t){return this.pushStack(s(this,t||[],!0))},is:function(t){return!!s(this,"string"==typeof t&&St.test(t)?mt(t):t||[],!1).length}});var Et,At=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,qt=mt.fn.init=function(t,n,e){var r,i;if(!t)return this;if(e=e||Et,"string"==typeof t){if(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:At.exec(t),!r||!r[1]&&n)return!n||n.jquery?(n||e).find(t):this.constructor(n).find(t);if(r[1]){if(n=n instanceof mt?n[0]:n,mt.merge(this,mt.parseHTML(r[1],n&&n.nodeType?n.ownerDocument||n:ot,!0)),Ct.test(r[1])&&mt.isPlainObject(n))for(r in n)mt.isFunction(this[r])?this[r](n[r]):this.attr(r,n[r]);return this}return i=ot.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):mt.isFunction(t)?void 0!==e.ready?e.ready(t):t(mt):mt.makeArray(t,this)};qt.prototype=mt.fn,Et=mt(ot);var Dt=/^(?:parents|prev(?:Until|All))/,jt={children:!0,contents:!0,next:!0,prev:!0};mt.fn.extend({has:function(t){var n=mt(t,this),e=n.length;return this.filter(function(){for(var t=0;t-1:1===e.nodeType&&mt.find.matchesSelector(e,t))){o.push(e);break}return this.pushStack(o.length>1?mt.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?lt.call(mt(t),this[0]):lt.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,n){return this.pushStack(mt.uniqueSort(mt.merge(this.get(),mt(t,n))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),mt.each({parent:function(t){var n=t.parentNode;return n&&11!==n.nodeType?n:null},parents:function(t){return kt(t,"parentNode")},parentsUntil:function(t,n,e){return kt(t,"parentNode",e)},next:function(t){return c(t,"nextSibling")},prev:function(t){return c(t,"previousSibling")},nextAll:function(t){return kt(t,"nextSibling")},prevAll:function(t){return kt(t,"previousSibling")},nextUntil:function(t,n,e){return kt(t,"nextSibling",e)},prevUntil:function(t,n,e){return kt(t,"previousSibling",e)},siblings:function(t){return Tt((t.parentNode||{}).firstChild,t)},children:function(t){return Tt(t.firstChild)},contents:function(t){return t.contentDocument||mt.merge([],t.childNodes)}},function(t,n){mt.fn[t]=function(e,r){var i=mt.map(this,n,e);return"Until"!==t.slice(-5)&&(r=e),r&&"string"==typeof r&&(i=mt.filter(r,i)),this.length>1&&(jt[t]||mt.uniqueSort(i),Dt.test(t)&&i.reverse()),this.pushStack(i)}});var Lt=/[^\x20\t\r\n\f]+/g;mt.Callbacks=function(t){t="string"==typeof t?l(t):mt.extend({},t);var n,e,r,i,o=[],a=[],u=-1,s=function(){for(i=t.once,r=n=!0;a.length;u=-1)for(e=a.shift();++u-1;)o.splice(e,1),e<=u&&u--}),this},has:function(t){return t?mt.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=e="",this},disabled:function(){return!o},lock:function(){return i=a=[],e||n||(o=e=""),this},locked:function(){return!!i},fireWith:function(t,e){return i||(e=e||[],e=[t,e.slice?e.slice():e],a.push(e),n||s()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},mt.extend({Deferred:function(t){var n=[["notify","progress",mt.Callbacks("memory"),mt.Callbacks("memory"),2],["resolve","done",mt.Callbacks("once memory"),mt.Callbacks("once memory"),0,"resolved"],["reject","fail",mt.Callbacks("once memory"),mt.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return mt.Deferred(function(e){mt.each(n,function(n,r){var i=mt.isFunction(t[r[4]])&&t[r[4]];o[r[1]](function(){var t=i&&i.apply(this,arguments);t&&mt.isFunction(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[r[0]+"With"](this,i?[t]:arguments)})}),t=null}).promise()},then:function(t,r,i){function o(t,n,r,i){return function(){var u=this,s=arguments,c=function(){var e,c;if(!(t=a&&(r!==h&&(u=void 0,s=[e]),n.rejectWith(u,s))}};t?l():(mt.Deferred.getStackHook&&(l.stackTrace=mt.Deferred.getStackHook()),e.setTimeout(l))}}var a=0;return mt.Deferred(function(e){n[0][3].add(o(0,e,mt.isFunction(i)?i:f,e.notifyWith)),n[1][3].add(o(0,e,mt.isFunction(t)?t:f)),n[2][3].add(o(0,e,mt.isFunction(r)?r:h))}).promise()},promise:function(t){return null!=t?mt.extend(t,i):i}},o={};return mt.each(n,function(t,e){var a=e[2],u=e[5];i[e[1]]=a.add,u&&a.add(function(){r=u},n[3-t][2].disable,n[0][2].lock),a.add(e[3].fire),o[e[0]]=function(){return o[e[0]+"With"](this===o?void 0:this,arguments),this},o[e[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(t){var n=arguments.length,e=n,r=Array(e),i=ut.call(arguments),o=mt.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=arguments.length>1?ut.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(p(t,o.done(a(e)).resolve,o.reject),"pending"===o.state()||mt.isFunction(i[e]&&i[e].then)))return o.then();for(;e--;)p(i[e],a(e),o.reject);return o.promise()}});var Pt=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;mt.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Pt.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},mt.readyException=function(t){e.setTimeout(function(){throw t})};var Ot=mt.Deferred();mt.fn.ready=function(t){return Ot.then(t).catch(function(t){mt.readyException(t)}),this},mt.extend({isReady:!1,readyWait:1,holdReady:function(t){t?mt.readyWait++:mt.ready(!0)},ready:function(t){(t===!0?--mt.readyWait:mt.isReady)||(mt.isReady=!0,t!==!0&&--mt.readyWait>0||Ot.resolveWith(ot,[mt]))}}),mt.ready.then=Ot.then,"complete"===ot.readyState||"loading"!==ot.readyState&&!ot.documentElement.doScroll?e.setTimeout(mt.ready):(ot.addEventListener("DOMContentLoaded",d),e.addEventListener("load",d));var Ft=function(t,n,e,r,i,o,a){var u=0,s=t.length,c=null==e;if("object"===mt.type(e)){i=!0;for(u in e)Ft(t,n,u,e[u],!0,o,a)}else if(void 0!==r&&(i=!0,mt.isFunction(r)||(a=!0),c&&(a?(n.call(t,r),n=null):(c=n,n=function(t,n,e){return c.call(mt(t),e)})),n))for(;u1,null,!0)},removeData:function(t){return this.each(function(){Ht.remove(this,t)})}}),mt.extend({queue:function(t,n,e){var r;if(t)return n=(n||"fx")+"queue",r=Rt.get(t,n),e&&(!r||mt.isArray(e)?r=Rt.access(t,n,mt.makeArray(e)):r.push(e)),r||[]},dequeue:function(t,n){n=n||"fx";var e=mt.queue(t,n),r=e.length,i=e.shift(),o=mt._queueHooks(t,n),a=function(){mt.dequeue(t,n)};"inprogress"===i&&(i=e.shift(),r--),i&&("fx"===n&&e.unshift("inprogress"),delete o.stop,i.call(t,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,n){var e=n+"queueHooks";return Rt.get(t,e)||Rt.access(t,e,{empty:mt.Callbacks("once memory").add(function(){Rt.remove(t,[n+"queue",e])})})}}),mt.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length\x20\t\r\n\f]+)/i,Zt=/^$|\/(?:java|ecma)script/i,Qt={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Qt.optgroup=Qt.option,Qt.tbody=Qt.tfoot=Qt.colgroup=Qt.caption=Qt.thead,Qt.th=Qt.td; +var Kt=/<|&#?\w+;/;!function(){var t=ot.createDocumentFragment(),n=t.appendChild(ot.createElement("div")),e=ot.createElement("input");e.setAttribute("type","radio"),e.setAttribute("checked","checked"),e.setAttribute("name","t"),n.appendChild(e),vt.checkClone=n.cloneNode(!0).cloneNode(!0).lastChild.checked,n.innerHTML="",vt.noCloneChecked=!!n.cloneNode(!0).lastChild.defaultValue}();var tn=ot.documentElement,nn=/^key/,en=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rn=/^([^.]*)(?:\.(.+)|)/;mt.event={global:{},add:function(t,n,e,r,i){var o,a,u,s,c,l,f,h,p,d,g,v=Rt.get(t);if(v)for(e.handler&&(o=e,e=o.handler,i=o.selector),i&&mt.find.matchesSelector(tn,i),e.guid||(e.guid=mt.guid++),(s=v.events)||(s=v.events={}),(a=v.handle)||(a=v.handle=function(n){return"undefined"!=typeof mt&&mt.event.triggered!==n.type?mt.event.dispatch.apply(t,arguments):void 0}),n=(n||"").match(Lt)||[""],c=n.length;c--;)u=rn.exec(n[c])||[],p=g=u[1],d=(u[2]||"").split(".").sort(),p&&(f=mt.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=mt.event.special[p]||{},l=mt.extend({type:p,origType:g,data:r,handler:e,guid:e.guid,selector:i,needsContext:i&&mt.expr.match.needsContext.test(i),namespace:d.join(".")},o),(h=s[p])||(h=s[p]=[],h.delegateCount=0,f.setup&&f.setup.call(t,r,d,a)!==!1||t.addEventListener&&t.addEventListener(p,a)),f.add&&(f.add.call(t,l),l.handler.guid||(l.handler.guid=e.guid)),i?h.splice(h.delegateCount++,0,l):h.push(l),mt.event.global[p]=!0)},remove:function(t,n,e,r,i){var o,a,u,s,c,l,f,h,p,d,g,v=Rt.hasData(t)&&Rt.get(t);if(v&&(s=v.events)){for(n=(n||"").match(Lt)||[""],c=n.length;c--;)if(u=rn.exec(n[c])||[],p=g=u[1],d=(u[2]||"").split(".").sort(),p){for(f=mt.event.special[p]||{},p=(r?f.delegateType:f.bindType)||p,h=s[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)l=h[o],!i&&g!==l.origType||e&&e.guid!==l.guid||u&&!u.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(h.splice(o,1),l.selector&&h.delegateCount--,f.remove&&f.remove.call(t,l));a&&!h.length&&(f.teardown&&f.teardown.call(t,d,v.handle)!==!1||mt.removeEvent(t,p,v.handle),delete s[p])}else for(p in s)mt.event.remove(t,p+n[c],e,r,!0);mt.isEmptyObject(s)&&Rt.remove(t,"handle events")}},dispatch:function(t){var n,e,r,i,o,a,u=mt.event.fix(t),s=new Array(arguments.length),c=(Rt.get(this,"events")||{})[u.type]||[],l=mt.event.special[u.type]||{};for(s[0]=u,n=1;n=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||c.disabled!==!0)){for(o=[],a={},e=0;e-1:mt.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&u.push({elem:c,handlers:o})}return c=this,s\x20\t\r\n\f]*)[^>]*)\/>/gi,an=/\s*$/g;mt.extend({htmlPrefilter:function(t){return t.replace(on,"<$1>")},clone:function(t,n,e){var r,i,o,a,u=t.cloneNode(!0),s=mt.contains(t.ownerDocument,t);if(!(vt.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||mt.isXMLDoc(t)))for(a=b(u),o=b(t),r=0,i=o.length;r0&&w(a,!s&&b(t,"script")),u},cleanData:function(t){for(var n,e,r,i=mt.event.special,o=0;void 0!==(e=t[o]);o++)if(zt(e)){if(n=e[Rt.expando]){if(n.events)for(r in n.events)i[r]?mt.event.remove(e,r):mt.removeEvent(e,r,n.handle);e[Rt.expando]=void 0}e[Ht.expando]&&(e[Ht.expando]=void 0)}}}),mt.fn.extend({detach:function(t){return L(this,t,!0)},remove:function(t){return L(this,t)},text:function(t){return Ft(this,function(t){return void 0===t?mt.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return j(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var n=N(this,t);n.appendChild(t)}})},prepend:function(){return j(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var n=N(this,t);n.insertBefore(t,n.firstChild)}})},before:function(){return j(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return j(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,n=0;null!=(t=this[n]);n++)1===t.nodeType&&(mt.cleanData(b(t,!1)),t.textContent="");return this},clone:function(t,n){return t=null!=t&&t,n=null==n?t:n,this.map(function(){return mt.clone(this,t,n)})},html:function(t){return Ft(this,function(t){var n=this[0]||{},e=0,r=this.length;if(void 0===t&&1===n.nodeType)return n.innerHTML;if("string"==typeof t&&!an.test(t)&&!Qt[(Jt.exec(t)||["",""])[1].toLowerCase()]){t=mt.htmlPrefilter(t);try{for(;e1)}}),mt.Tween=I,I.prototype={constructor:I,init:function(t,n,e,r,i,o){this.elem=t,this.prop=e,this.easing=i||mt.easing._default,this.options=n,this.start=this.now=this.cur(),this.end=r,this.unit=o||(mt.cssNumber[e]?"":"px")},cur:function(){var t=I.propHooks[this.prop];return t&&t.get?t.get(this):I.propHooks._default.get(this)},run:function(t){var n,e=I.propHooks[this.prop];return this.options.duration?this.pos=n=mt.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=n=t,this.now=(this.end-this.start)*n+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),e&&e.set?e.set(this):I.propHooks._default.set(this),this}},I.prototype.init.prototype=I.prototype,I.propHooks={_default:{get:function(t){var n;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(n=mt.css(t.elem,t.prop,""),n&&"auto"!==n?n:0)},set:function(t){mt.fx.step[t.prop]?mt.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[mt.cssProps[t.prop]]&&!mt.cssHooks[t.prop]?t.elem[t.prop]=t.now:mt.style(t.elem,t.prop,t.now+t.unit)}}},I.propHooks.scrollTop=I.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},mt.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},mt.fx=I.prototype.init,mt.fx.step={};var mn,_n,xn=/^(?:toggle|show|hide)$/,bn=/queueHooks$/;mt.Animation=mt.extend(V,{tweeners:{"*":[function(t,n){var e=this.createTween(t,n);return m(e.elem,t,Wt.exec(n),e),e}]},tweener:function(t,n){mt.isFunction(t)?(n=t,t=["*"]):t=t.match(Lt);for(var e,r=0,i=t.length;r1)},removeAttr:function(t){return this.each(function(){mt.removeAttr(this,t)})}}),mt.extend({attr:function(t,n,e){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof t.getAttribute?mt.prop(t,n,e):(1===o&&mt.isXMLDoc(t)||(i=mt.attrHooks[n.toLowerCase()]||(mt.expr.match.bool.test(n)?wn:void 0)),void 0!==e?null===e?void mt.removeAttr(t,n):i&&"set"in i&&void 0!==(r=i.set(t,e,n))?r:(t.setAttribute(n,e+""),e):i&&"get"in i&&null!==(r=i.get(t,n))?r:(r=mt.find.attr(t,n),null==r?void 0:r))},attrHooks:{type:{set:function(t,n){if(!vt.radioValue&&"radio"===n&&mt.nodeName(t,"input")){var e=t.value;return t.setAttribute("type",n),e&&(t.value=e),n}}}},removeAttr:function(t,n){var e,r=0,i=n&&n.match(Lt);if(i&&1===t.nodeType)for(;e=i[r++];)t.removeAttribute(e)}}),wn={set:function(t,n,e){return n===!1?mt.removeAttr(t,e):t.setAttribute(e,e),e}},mt.each(mt.expr.match.bool.source.match(/\w+/g),function(t,n){var e=Mn[n]||mt.find.attr;Mn[n]=function(t,n,r){var i,o,a=n.toLowerCase();return r||(o=Mn[a],Mn[a]=i,i=null!=e(t,n,r)?a:null,Mn[a]=o),i}});var kn=/^(?:input|select|textarea|button)$/i,Tn=/^(?:a|area)$/i;mt.fn.extend({prop:function(t,n){return Ft(this,mt.prop,t,n,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[mt.propFix[t]||t]})}}),mt.extend({prop:function(t,n,e){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&mt.isXMLDoc(t)||(n=mt.propFix[n]||n,i=mt.propHooks[n]),void 0!==e?i&&"set"in i&&void 0!==(r=i.set(t,e,n))?r:t[n]=e:i&&"get"in i&&null!==(r=i.get(t,n))?r:t[n]},propHooks:{tabIndex:{get:function(t){var n=mt.find.attr(t,"tabindex");return n?parseInt(n,10):kn.test(t.nodeName)||Tn.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),vt.optSelected||(mt.propHooks.selected={get:function(t){var n=t.parentNode;return n&&n.parentNode&&n.parentNode.selectedIndex,null},set:function(t){var n=t.parentNode;n&&(n.selectedIndex,n.parentNode&&n.parentNode.selectedIndex)}}),mt.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){mt.propFix[this.toLowerCase()]=this}),mt.fn.extend({addClass:function(t){var n,e,r,i,o,a,u,s=0;if(mt.isFunction(t))return this.each(function(n){mt(this).addClass(t.call(this,n,J(this)))});if("string"==typeof t&&t)for(n=t.match(Lt)||[];e=this[s++];)if(i=J(e),r=1===e.nodeType&&" "+G(i)+" "){for(a=0;o=n[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");u=G(r),i!==u&&e.setAttribute("class",u)}return this},removeClass:function(t){var n,e,r,i,o,a,u,s=0;if(mt.isFunction(t))return this.each(function(n){mt(this).removeClass(t.call(this,n,J(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(n=t.match(Lt)||[];e=this[s++];)if(i=J(e),r=1===e.nodeType&&" "+G(i)+" "){for(a=0;o=n[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");u=G(r),i!==u&&e.setAttribute("class",u)}return this},toggleClass:function(t,n){var e=typeof t;return"boolean"==typeof n&&"string"===e?n?this.addClass(t):this.removeClass(t):mt.isFunction(t)?this.each(function(e){mt(this).toggleClass(t.call(this,e,J(this),n),n)}):this.each(function(){var n,r,i,o;if("string"===e)for(r=0,i=mt(this),o=t.match(Lt)||[];n=o[r++];)i.hasClass(n)?i.removeClass(n):i.addClass(n);else void 0!==t&&"boolean"!==e||(n=J(this),n&&Rt.set(this,"__className__",n),this.setAttribute&&this.setAttribute("class",n||t===!1?"":Rt.get(this,"__className__")||""))})},hasClass:function(t){var n,e,r=0;for(n=" "+t+" ";e=this[r++];)if(1===e.nodeType&&(" "+G(J(e))+" ").indexOf(n)>-1)return!0;return!1}});var Sn=/\r/g;mt.fn.extend({val:function(t){var n,e,r,i=this[0];{if(arguments.length)return r=mt.isFunction(t),this.each(function(e){var i;1===this.nodeType&&(i=r?t.call(this,e,mt(this).val()):t,null==i?i="":"number"==typeof i?i+="":mt.isArray(i)&&(i=mt.map(i,function(t){return null==t?"":t+""})),n=mt.valHooks[this.type]||mt.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&void 0!==n.set(this,i,"value")||(this.value=i))});if(i)return n=mt.valHooks[i.type]||mt.valHooks[i.nodeName.toLowerCase()],n&&"get"in n&&void 0!==(e=n.get(i,"value"))?e:(e=i.value,"string"==typeof e?e.replace(Sn,""):null==e?"":e)}}}),mt.extend({valHooks:{option:{get:function(t){var n=mt.find.attr(t,"value");return null!=n?n:G(mt.text(t))}},select:{get:function(t){var n,e,r,i=t.options,o=t.selectedIndex,a="select-one"===t.type,u=a?null:[],s=a?o+1:i.length;for(r=o<0?s:a?o:0;r-1)&&(e=!0);return e||(t.selectedIndex=-1),o}}}}),mt.each(["radio","checkbox"],function(){mt.valHooks[this]={set:function(t,n){if(mt.isArray(n))return t.checked=mt.inArray(mt(t).val(),n)>-1}},vt.checkOn||(mt.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Cn=/^(?:focusinfocus|focusoutblur)$/;mt.extend(mt.event,{trigger:function(t,n,r,i){var o,a,u,s,c,l,f,h=[r||ot],p=pt.call(t,"type")?t.type:t,d=pt.call(t,"namespace")?t.namespace.split("."):[];if(a=u=r=r||ot,3!==r.nodeType&&8!==r.nodeType&&!Cn.test(p+mt.event.triggered)&&(p.indexOf(".")>-1&&(d=p.split("."),p=d.shift(),d.sort()),c=p.indexOf(":")<0&&"on"+p,t=t[mt.expando]?t:new mt.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=d.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:mt.makeArray(n,[t]),f=mt.event.special[p]||{},i||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!i&&!f.noBubble&&!mt.isWindow(r)){for(s=f.delegateType||p,Cn.test(s+p)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||ot)&&h.push(u.defaultView||u.parentWindow||e)}for(o=0;(a=h[o++])&&!t.isPropagationStopped();)t.type=o>1?s:f.bindType||p,l=(Rt.get(a,"events")||{})[t.type]&&Rt.get(a,"handle"),l&&l.apply(a,n),l=c&&a[c],l&&l.apply&&zt(a)&&(t.result=l.apply(a,n),t.result===!1&&t.preventDefault());return t.type=p,i||t.isDefaultPrevented()||f._default&&f._default.apply(h.pop(),n)!==!1||!zt(r)||c&&mt.isFunction(r[p])&&!mt.isWindow(r)&&(u=r[c],u&&(r[c]=null),mt.event.triggered=p,r[p](),mt.event.triggered=void 0,u&&(r[c]=u)),t.result}},simulate:function(t,n,e){var r=mt.extend(new mt.Event,e,{type:t,isSimulated:!0});mt.event.trigger(r,null,n)}}),mt.fn.extend({trigger:function(t,n){return this.each(function(){mt.event.trigger(t,n,this)})},triggerHandler:function(t,n){var e=this[0];if(e)return mt.event.trigger(t,n,e,!0)}}),mt.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,n){mt.fn[n]=function(t,e){return arguments.length>0?this.on(n,null,t,e):this.trigger(n)}}),mt.fn.extend({hover:function(t,n){return this.mouseenter(t).mouseleave(n||t)}}),vt.focusin="onfocusin"in e,vt.focusin||mt.each({focus:"focusin",blur:"focusout"},function(t,n){var e=function(t){mt.event.simulate(n,t.target,mt.event.fix(t))};mt.event.special[n]={setup:function(){var r=this.ownerDocument||this,i=Rt.access(r,n);i||r.addEventListener(t,e,!0),Rt.access(r,n,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Rt.access(r,n)-1;i?Rt.access(r,n,i):(r.removeEventListener(t,e,!0),Rt.remove(r,n))}}});var Nn=e.location,En=mt.now(),An=/\?/;mt.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(t){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||mt.error("Invalid XML: "+t),n};var qn=/\[\]$/,Dn=/\r?\n/g,jn=/^(?:submit|button|image|reset|file)$/i,Ln=/^(?:input|select|textarea|keygen)/i;mt.param=function(t,n){var e,r=[],i=function(t,n){var e=mt.isFunction(n)?n():n;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==e?"":e)};if(mt.isArray(t)||t.jquery&&!mt.isPlainObject(t))mt.each(t,function(){i(this.name,this.value)});else for(e in t)Z(e,t[e],n,i);return r.join("&")},mt.fn.extend({serialize:function(){return mt.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=mt.prop(this,"elements");return t?mt.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!mt(this).is(":disabled")&&Ln.test(this.nodeName)&&!jn.test(t)&&(this.checked||!Gt.test(t))}).map(function(t,n){var e=mt(this).val();return null==e?null:mt.isArray(e)?mt.map(e,function(t){return{name:n.name,value:t.replace(Dn,"\r\n")}}):{name:n.name,value:e.replace(Dn,"\r\n")}}).get()}});var Pn=/%20/g,On=/#.*$/,Fn=/([?&])_=[^&]*/,zn=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Hn=/^(?:GET|HEAD)$/,In=/^\/\//,Un={},Bn={},Wn="*/".concat("*"),Yn=ot.createElement("a");Yn.href=Nn.href,mt.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Nn.href,type:"GET",isLocal:Rn.test(Nn.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Wn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":mt.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,n){return n?tt(tt(t,mt.ajaxSettings),n):tt(mt.ajaxSettings,t)},ajaxPrefilter:Q(Un),ajaxTransport:Q(Bn),ajax:function(t,n){function r(t,n,r,u){var c,h,p,x,b,w=n;l||(l=!0,s&&e.clearTimeout(s),i=void 0,a=u||"",M.readyState=t>0?4:0,c=t>=200&&t<300||304===t,r&&(x=nt(d,M,r)),x=et(d,x,M,c),c?(d.ifModified&&(b=M.getResponseHeader("Last-Modified"),b&&(mt.lastModified[o]=b),b=M.getResponseHeader("etag"),b&&(mt.etag[o]=b)),204===t||"HEAD"===d.type?w="nocontent":304===t?w="notmodified":(w=x.state,h=x.data,p=x.error,c=!p)):(p=w,!t&&w||(w="error",t<0&&(t=0))),M.status=t,M.statusText=(n||w)+"",c?y.resolveWith(g,[h,w,M]):y.rejectWith(g,[M,w,p]),M.statusCode(_),_=void 0,f&&v.trigger(c?"ajaxSuccess":"ajaxError",[M,d,c?h:p]),m.fireWith(g,[M,w]),f&&(v.trigger("ajaxComplete",[M,d]),--mt.active||mt.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,u,s,c,l,f,h,p,d=mt.ajaxSetup({},n),g=d.context||d,v=d.context&&(g.nodeType||g.jquery)?mt(g):mt.event,y=mt.Deferred(),m=mt.Callbacks("once memory"),_=d.statusCode||{},x={},b={},w="canceled",M={readyState:0,getResponseHeader:function(t){var n;if(l){if(!u)for(u={};n=zn.exec(a);)u[n[1].toLowerCase()]=n[2];n=u[t.toLowerCase()]}return null==n?null:n},getAllResponseHeaders:function(){return l?a:null},setRequestHeader:function(t,n){return null==l&&(t=b[t.toLowerCase()]=b[t.toLowerCase()]||t,x[t]=n),this},overrideMimeType:function(t){return null==l&&(d.mimeType=t),this},statusCode:function(t){var n;if(t)if(l)M.always(t[M.status]);else for(n in t)_[n]=[_[n],t[n]];return this},abort:function(t){var n=t||w;return i&&i.abort(n),r(0,n),this}};if(y.promise(M),d.url=((t||d.url||Nn.href)+"").replace(In,Nn.protocol+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(Lt)||[""],null==d.crossDomain){c=ot.createElement("a");try{c.href=d.url,c.href=c.href,d.crossDomain=Yn.protocol+"//"+Yn.host!=c.protocol+"//"+c.host}catch(t){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=mt.param(d.data,d.traditional)),K(Un,d,n,M),l)return M;f=mt.event&&d.global,f&&0===mt.active++&&mt.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Hn.test(d.type),o=d.url.replace(On,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Pn,"+")):(p=d.url.slice(o.length),d.data&&(o+=(An.test(o)?"&":"?")+d.data,delete d.data),d.cache===!1&&(o=o.replace(Fn,"$1"),p=(An.test(o)?"&":"?")+"_="+En++ +p),d.url=o+p),d.ifModified&&(mt.lastModified[o]&&M.setRequestHeader("If-Modified-Since",mt.lastModified[o]),mt.etag[o]&&M.setRequestHeader("If-None-Match",mt.etag[o])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&M.setRequestHeader("Content-Type",d.contentType),M.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Wn+"; q=0.01":""):d.accepts["*"]);for(h in d.headers)M.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(d.beforeSend.call(g,M,d)===!1||l))return M.abort();if(w="abort",m.add(d.complete),M.done(d.success),M.fail(d.error),i=K(Bn,d,n,M)){if(M.readyState=1,f&&v.trigger("ajaxSend",[M,d]),l)return M;d.async&&d.timeout>0&&(s=e.setTimeout(function(){M.abort("timeout")},d.timeout));try{l=!1,i.send(x,r)}catch(t){if(l)throw t;r(-1,t)}}else r(-1,"No Transport");return M},getJSON:function(t,n,e){return mt.get(t,n,e,"json")},getScript:function(t,n){return mt.get(t,void 0,n,"script")}}),mt.each(["get","post"],function(t,n){mt[n]=function(t,e,r,i){return mt.isFunction(e)&&(i=i||r,r=e,e=void 0),mt.ajax(mt.extend({url:t,type:n,dataType:i,data:e,success:r},mt.isPlainObject(t)&&t))}}),mt._evalUrl=function(t){return mt.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},mt.fn.extend({wrapAll:function(t){var n;return this[0]&&(mt.isFunction(t)&&(t=t.call(this[0])),n=mt(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&n.insertBefore(this[0]),n.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return mt.isFunction(t)?this.each(function(n){mt(this).wrapInner(t.call(this,n))}):this.each(function(){var n=mt(this),e=n.contents();e.length?e.wrapAll(t):n.append(t)})},wrap:function(t){var n=mt.isFunction(t);return this.each(function(e){mt(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){ +mt(this).replaceWith(this.childNodes)}),this}}),mt.expr.pseudos.hidden=function(t){return!mt.expr.pseudos.visible(t)},mt.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},mt.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(t){}};var $n={0:200,1223:204},Xn=mt.ajaxSettings.xhr();vt.cors=!!Xn&&"withCredentials"in Xn,vt.ajax=Xn=!!Xn,mt.ajaxTransport(function(t){var n,r;if(vt.cors||Xn&&!t.crossDomain)return{send:function(i,o){var a,u=t.xhr();if(u.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)u[a]=t.xhrFields[a];t.mimeType&&u.overrideMimeType&&u.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)u.setRequestHeader(a,i[a]);n=function(t){return function(){n&&(n=r=u.onload=u.onerror=u.onabort=u.onreadystatechange=null,"abort"===t?u.abort():"error"===t?"number"!=typeof u.status?o(0,"error"):o(u.status,u.statusText):o($n[u.status]||u.status,u.statusText,"text"!==(u.responseType||"text")||"string"!=typeof u.responseText?{binary:u.response}:{text:u.responseText},u.getAllResponseHeaders()))}},u.onload=n(),r=u.onerror=n("error"),void 0!==u.onabort?u.onabort=r:u.onreadystatechange=function(){4===u.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{u.send(t.hasContent&&t.data||null)}catch(t){if(n)throw t}},abort:function(){n&&n()}}}),mt.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),mt.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return mt.globalEval(t),t}}}),mt.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),mt.ajaxTransport("script",function(t){if(t.crossDomain){var n,e;return{send:function(r,i){n=mt(" + + +#else: + + + + + + + X-Vis + + + + + + +#end if + ]]> + + + + "$output.files_path/data.json"; +mv out "$output.files_path/"; + +cp $__tool_directory__/mauve.js $output.files_path/; +cp $index "$output" +]]> + + + + + + + + + + + + diff -r 000000000000 -r b4d7351df1ff cpt_xmfa/xmfa_process.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpt_xmfa/xmfa_process.py Tue Jul 05 05:07:32 2022 +0000 @@ -0,0 +1,118 @@ +#!/usr/bin/env python +from Bio import SeqIO +import argparse +import json +import os +from CPT_GFFParser import gffParse, gffWrite + + +def parse_xmfa(xmfa): + """Simple XMFA parser until https://github.com/biopython/biopython/pull/544 + """ + current_lcb = [] + current_seq = {} + for line in xmfa.readlines(): + if line.startswith("#"): + continue + + if line.strip() == "=": + if "id" in current_seq: + current_lcb.append(current_seq) + current_seq = {} + yield current_lcb + current_lcb = [] + else: + line = line.strip() + if line.startswith(">"): + if "id" in current_seq: + current_lcb.append(current_seq) + current_seq = {} + data = line.strip().split() + # 0 1 2 3 4 5 + # > 1:5986-6406 + CbK.fa # CbK_gp011 + id, loc = data[1].split(":") + start, end = loc.split("-") + current_seq = { + "rid": "_".join(data[1:]), + "id": id, + "start": int(start), + "end": int(end), + "strand": 1 if data[2] == "+" else -1, + "seq": "", + "comment": "", + } + if len(data) > 5: + current_seq["comment"] = " ".join(data[5:]) + # else: + # current_seq['seq'] += line.strip() + + +def percent_identity(a, b): + """Calculate % identity, ignoring gaps in the host sequence + """ + match = 0 + mismatch = 0 + for char_a, char_b in zip(list(a), list(b)): + if char_a == "-": + continue + if char_a == char_b: + match += 1 + else: + mismatch += 1 + + if match + mismatch == 0: + return 0.0 + return 100 * float(match) / (match + mismatch) + + +def get_fasta_ids(sequences): + """Returns a list of fasta records in the order they appear + """ + ids = [] + for seq in SeqIO.parse(sequences, "fasta"): + ids.append(seq.id) + return ids + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="parse xmfa file") + parser.add_argument("gff3", type=argparse.FileType("r"), help="Multi-GFF3 File") + parser.add_argument("fasta", type=argparse.FileType("r"), help="Multi-FA file") + parser.add_argument("xmfa", type=argparse.FileType("r"), help="XMFA File") + parser.add_argument("output_dir", type=str, help="output directory") + args = parser.parse_args() + + fasta_list = get_fasta_ids(args.fasta) + lcbs = parse_xmfa(args.xmfa) + + if not os.path.exists(args.output_dir): + os.makedirs(args.output_dir) + + output = {"fasta": [], "gff3": [], "xmfa": None} + + processed_xmfa = os.path.join(args.output_dir, "regions.json") + with open(processed_xmfa, "w") as handle: + json.dump([lcb for lcb in lcbs if len(lcb) > 1], handle, sort_keys=True) + + output["xmfa"] = processed_xmfa + + # Have to seek because we already access args.fasta once in id_tn_dict + args.fasta.seek(0) + # Load up sequence(s) for GFF3 data + seq_dict = SeqIO.to_dict(SeqIO.parse(args.fasta, "fasta")) + # Parse GFF3 records + gffs = gffParse(args.gff3, base_dict=seq_dict) + for record in sorted(gffs, key=lambda rec: fasta_list.index(rec.id)): + gff_output = os.path.join(args.output_dir, record.id + ".gff") + with open(gff_output, "w") as handle: + gffWrite([record], handle) + output["gff3"].append(gff_output) + + fa_output = os.path.join(args.output_dir, record.id + ".txt") + with open(fa_output, "w") as handle: + handle.write(str(record.seq)) + output["fasta"].append( + {"path": fa_output, "length": len(record.seq), "name": record.id} + ) + + print(json.dumps(output, sort_keys=True))