function chordMpr(n,t){var r={},u={},o=0,f=[],e=[],s,h,c=new Hash;return r.setFilter=function(n){return s=n,this},r.setAccessor=function(n){return h=n,this},r.setMetaAccessor=function(n){return metaAccessor=n,this},r.getCountryMetaData=function(){for(i=0;i<t.length;i++)c.setItem(t[i].Country,t[i].MetaData);return c},r.getMetaMatrix=function(){return e},r.getMatrix=function(){return f=[],_.each(u,function(t){f[t.id]||(f[t.id]=[],e[t.id]=[]);_.each(u,function(i){var r=_.filter(n,function(n){return s(n,t,i)});f[t.id][i.id]=h(r,t,i);e[t.id][i.id]=metaAccessor(r,t,i)})}),f},r.getMap=function(){return u},r.printMatrix=function(){_.each(f,function(n){console.log(n)})},r.addToMap=function(n,t){u[n]||(u[n]={name:n,id:o++,data:t})},r.addValuesToMap=function(t,i){var r=_.uniq(_.pluck(n,t));return _.map(r,function(n){u[n]||(u[n]={name:n,id:o++,data:i})}),this},r}function chordRdr(n,t,i,r){return function(u){var o,s,l,a,h,f={},e,v,c;return u.source?(o=u.source.index,s=u.target.index,l=_.where(t,{id:o}),a=_.where(t,{id:s}),e=i[o][s].split("~"),f.INbrOfProduct=e[0],f.IPartnerShare=e[1],f.ENbrOfProduct=e[2],f.EPartnerShare=e[3],f.TradeBalance=e[4],f.sIndex=o,f.tIndex=s,f.sname=l[0].name,f.sdata=u.source.value,f.svalue=+u.source.value,f.stotal=_.reduce(n[o],function(n,t){return n+t},0),f.tname=a[0].name,f.tdata=u.target.value,f.tvalue=+u.target.value,f.ttotal=_.reduce(n[s],function(n,t){return n+t},0)):(v=r,h=_.where(t,{id:u.index}),f.gname=h[0].name,f.imports="",f.exports="",f.balance="",r.getItem(h[0].name)!=undefined&&(c=r.getItem(h[0].name).split("~"),c.length==3&&(f.imports=c[0],f.exports=c[1],f.balance=c[2])),f.gdata=h[0].data,f.gvalue=u.value),f.mtotal=_.reduce(n,function(n,t){return n+_.reduce(t,function(n,t){return n+t},0)},0),f}}function getChordData(n,t,i,r){$.ajax({type:"POST",url:Svrpath+"Country-Partner.aspx/GetJsonStringForChord",contentType:"application/json; charset=utf-8",data:"{ChordReporterId:'"+n+"' ,ChordYear:'"+t+"' ,ChordRecordscount:'"+i+"' ,Chordlang:'"+r+"'}",dataType:"json",success:function(n){paintchordchart(n.d)},error:function(n,t,i){alert(i+" "+t+" "+n)}})}function paintchordchart(n){var i,t;i='{"data": [{"Reporter": "United States","Partner": "Aruba","Import":1309214.273,"Export": 446132.430,"MetaData":"46~0.0817~1690~0.0422~-863081.843"},{"Reporter": "United States","Partner": "Afghanistan","Import":124107.600,"Export": 1511460.170,"MetaData":"106~0.0077~1166~0.143~1387352.570"},{"Reporter": "United States","Partner": "Angola","Import":9703060.917,"Export": 1422873.066,"MetaData":"18~0.6057~1358~0.1347~-8280187.851"},{"Reporter": "United States","Partner": "Anguila","Import":5922.443,"Export": 52934.466,"MetaData":"20~0.0004~739~0.005~47012.023"},{"Reporter": "United States","Partner": "Albania","Import":15804.487,"Export": 47529.397,"MetaData":"81~0.001~322~0.0045~31724.910"}]}';i='{"data": [{"Reporter": "United States","Partner": "Aruba","Import":1309214.273,"Export": 446132.430,"MetaData":"46~0.0817~1690~0.0422~-863081.843"},{"Reporter": "United States","Partner": "Afghanistan","Import":124107.600,"Export": 1511460.170,"MetaData":"106~0.0077~1166~0.143~1387352.570"},{"Reporter": "United States","Partner": "Angola","Import":9703060.917,"Export": 1422873.066,"MetaData":"18~0.6057~1358~0.1347~-8280187.851"},{"Reporter": "United States","Partner": "Anguila","Import":5922.443,"Export": 52934.466,"MetaData":"20~0.0004~739~0.005~47012.023"},{"Reporter": "United States","Partner": "Albania","Import":15804.487,"Export": 47529.397,"MetaData":"81~0.001~322~0.0045~31724.910"}],"MetaData": [{"Country": "Aruba","MetaData":"1149199.674~135747.078~-1013452.596"},{"Country": "Afghanistan","MetaData":"3336434.781~403441.006~-2932993.775"},{"Country": "Angola","MetaData":"23918854.361~40639411.732~16720557.371"},{"Country": "Albania","MetaData":"4548287.875~1087914.902~-3460372.973"},{"Country": "Andorra","MetaData":"1610110.578~100477.876~-1509632.702"}]}';i='{"data": [{"Reporter": "United States","Partner": "Brazil","Import":21017804.644,"Export": 26175324.386,"MetaData":"2,366~1.31~3,383~2.48~5,157,519.74"},{"Reporter": "United States","Partner": "Canada","Import":227577354.210,"Export": 204720827.311,"MetaData":"3,991~14.21~4,479~19.37~-22,856,526.90"},{"Reporter": "United States","Partner": "China","Import":309530233.196,"Export": 69575613.274,"MetaData":"4,008~19.32~3,913~6.58~-239,954,619.92"},{"Reporter": "United States","Partner": "Germany","Import":72632756.092,"Export": 43220924.954,"MetaData":"3,713~4.53~3,792~4.09~-29,411,831.14"},{"Reporter": "United States","Partner": "France","Import":34582355.372,"Export": 27043697.294,"MetaData":"3,394~2.16~3,458~2.56~-7,538,658.08"},{"Reporter": "United States","Partner": "United Kingdom","Import":48249946.912,"Export": 45707871.116,"MetaData":"3,518~3.01~3,947~4.33~-2,542,075.80"},{"Reporter": "United States","Partner": "Japan","Import":98401031.288,"Export": 51178320.341,"MetaData":"3,491~6.14~3,883~4.84~-47,222,710.95"},{"Reporter": "United States","Partner": "Korea, Rep.","Import":40543872.268,"Export": 28639747.634,"MetaData":"2,956~2.53~3,675~2.71~-11,904,124.63"},{"Reporter": "United States","Partner": "Mexico","Import":178321648.369,"Export": 128997663.332,"MetaData":"3,290~11.13~4,393~12.21~-49,323,985.04"},{"Reporter": "United States","Partner": "Netherlands","Import":16573999.196,"Export": 32346735.106,"MetaData":"2,659~1.03~3,373~3.06~15,772,735.91"},{"Reporter": "United States","Partner": "Other Asia, nes","Import":29349133.093,"Export": 18432345.885,"MetaData":"2,928~1.83~3,366~1.74~-10,916,787.21"},{"Reporter": "United States","Partner": "Venezuela","Import":28780266.837,"Export": 9359766.682,"MetaData":"498~1.80~3,028~0.89~-19,420,500.16"},{"Reporter": "United States","Partner": "Others (208)","Import":496335413.653,"Export": 371071327.615,"MetaData":"N/A~30.98~N/A~35.12~-125,264,086.04"}],"MetaData": [{"Country": "Brazil","MetaData":"127,647,330.79~152,994,742.81~25,347,412.02"},{"Country": "Canada","MetaData":"321,227,567.71~315,176,831.39~-6,050,736.32"},{"Country": "China","MetaData":"1,005,555,225.21~1,201,646,758.08~196,091,532.87"},{"Country": "Germany","MetaData":"938,363,080.00~1,127,839,933.00~189,476,853.00"},{"Country": "France","MetaData":"540,502,282.88~464,112,810.97~-76,389,471.91"},{"Country": "United Kingdom","MetaData":"552,042,034.59~359,615,540.06~-192,426,494.53"},{"Country": "Japan","MetaData":"551,984,750.86~580,718,733.73~28,733,982.87"},{"Country": "Korea, Rep.","MetaData":"323,081,674.75~363,531,063.38~40,449,388.63"},{"Country": "Mexico","MetaData":"234,384,531.89~229,712,337.31~-4,672,194.58"},{"Country": "Netherlands","MetaData":"382,190,421.77~431,502,452.47~49,312,030.70"},{"Country": "Other Asia, nes","MetaData":"174,942,558.83~203,493,849.50~28,551,290.68"},{"Country": "United States","MetaData":"1,601,895,815.13~1,056,712,078.25~-545,183,736.89"},{"Country": "Venezuela","MetaData":"38,676,637.47~56,583,100.32~17,906,462.85"},{"Country": "Others (208)","MetaData":"496,335,413.65~371,071,327.62~-125,264,086.04"}]}';var r=JSON.parse(n),u=r.data,f=r.MetaData;typeof u!="undefined"&&typeof f!="undefined"&&(t=chordMpr(u,f),t.addValuesToMap("Reporter").addValuesToMap("Partner").setFilter(function(n,t,i){return n.Reporter===t.name&&n.Partner===i.name||n.Reporter===i.name&&n.Partner===t.name}).setMetaAccessor(function(n){return n[0]?n[0].MetaData:0}).setAccessor(function(n,t){return n[0]?n[0].Reporter===t.name?+n[0].Import:+n[0].Export:0}),drawChordss(t.getMatrix(),t.getMap(),t.getMetaMatrix(),t.getCountryMetaData()))}function drawChordss(n,t,i,r){function p(n){var r=d3.format(".1%"),i=d3.format(",.2f"),t;return t=n.sIndex!=0?"<b>"+n.tname+" - "+n.sname+" Trade Stats<\/b>:<br/> Imports "+i(n.tvalue)+" (US$ Thousand), Share "+n.IPartnerShare+"%.<br/> Exports "+i(n.svalue)+" (US$ Thousand), Share "+n.EPartnerShare+"%.<br/> Trade balance "+n.TradeBalance+" (US$ Thousand).<br/>":"<b>"+n.sname+" - "+n.tname+" Trade Stats<\/b>:<br/> Imports "+i(n.svalue)+" (US$ Thousand), Share "+n.IPartnerShare+"%.<br/> Exports "+i(n.tvalue)+" (US$ Thousand), Share "+n.EPartnerShare+"%.<br/> Trade balance "+n.TradeBalance+" (US$ Thousand).<br/>",t.indexOf("N/A products")>1&&(t=t.replace("N/A products","").replace("N/A products","")),t}function w(n){var t=d3.format(".1%"),i=d3.format(",.2f");return"<b>"+n.gname+" Trade Stats<\/b>:<br/> <b>Trade Balance (US$ Thousand)<\/b>  : "+n.balance+"<br/> <b>Export (US$ Thousand)<\/b>  : "+n.exports+"<br/> <b>Import (US$ Thousand)<\/b>  : "+n.imports+"<br/>"}function b(n,t){d3.select("#tooltip").style("visibility","visible").html(w(u(n))).style("top",function(){return d3.event.pageY-80+"px"});v.classed("fade",function(n){return n.source.index!=t&&n.target.index!=t})}var u,a,v;if($(window).width()<768)var o=document.getElementById("productImportChart").offsetWidth-5,e=550,s=e/2,f=s-190;else var o=document.getElementById("productImportChart").offsetWidth-5,e=550,s=e/2,f=s-140;var h=d3.scale.ordinal().range(["#c7b570","#c6cdc7","#335c64","#768935","#507282","#5c4a56","#aa7455","#574109","#837722","#73342d","#0a5564","#9c8f57","#7895a4","#4a5456","#b0a690","#0a3542",]),c=d3.layout.chord().padding(.02).sortSubgroups(d3.descending).sortChords(d3.descending),y=d3.svg.arc().innerRadius(f).outerRadius(f+20),l=d3.select("#productImportChart").append("svg:svg").attr("width",o).attr("height",e).append("svg:g").attr("id","circle").attr("transform","translate("+o/2+","+e/2+")");l.append("circle").attr("r",f+20);u=chordRdr(n,t,i,r);c.matrix(n);a=l.selectAll("g.group").data(c.groups()).enter().append("svg:g").attr("class","group").on("mouseover",b).on("mouseout",function(){d3.select("#tooltip").style("visibility","hidden")});a.append("svg:path").style("stroke","black").style("fill",function(n){return h(u(n).gname)}).attr("d",y);a.append("svg:text").each(function(n){n.angle=(n.startAngle+n.endAngle)/2}).attr("dy",".35em").style("font-family","helvetica, arial, sans-serif").style("font-size","9px").attr("text-anchor",function(n){return n.angle>Math.PI?"end":null}).attr("transform",function(n){return"rotate("+(n.angle*180/Math.PI-90)+")translate("+(f+26)+")"+(n.angle>Math.PI?"rotate(180)":"")}).text(function(n){return u(n).gname});v=l.selectAll("path.chord").data(c.chords()).enter().append("svg:path").attr("class","chord").style("stroke",function(n){return d3.rgb(h(u(n).sname)).darker()}).style("fill",function(n){return h(u(n).sname)}).attr("d",d3.svg.chord().radius(f)).on("mouseover",function(n){d3.select("#tooltip").style("visibility","visible").html(p(u(n))).style("top",function(){return d3.event.pageY-80+"px"})}).on("mouseout",function(){d3.select("#tooltip").style("visibility","hidden")})}d3=function(){function uo(n){return n!=null&&!isNaN(n)}function ak(n){return n.length}function vk(n){for(var t=1;n*t%1;)t*=10;return t}function wl(n,t){try{for(var i in t)Object.defineProperty(n.prototype,i,{value:t[i],enumerable:!1})}catch(r){n.prototype=t}}function ut(){}function fo(){}function yk(n,t,i){return function(){var r=i.apply(t,arguments);return r===t?n:r}}function eo(n,t){var i,u,r;if(t in n)return t;for(t=t.charAt(0).toUpperCase()+t.substring(1),i=0,u=nc.length;i<u;++i)if(r=nc[i]+t,r in n)return r}function c(){}function oo(){}function bl(n){function r(){for(var i=t,r=-1,f=i.length,u;++r<f;)(u=i[r].on)&&u.apply(this,arguments);return n}var t=[],i=new ut;return r.on=function(r,u){var f=i.get(r),e;return arguments.length<2?f&&f.on:(f&&(f.on=null,t=t.slice(0,e=t.indexOf(f)).concat(t.slice(e+1)),i.remove(r)),u&&t.push(i.set(r,{on:u})),n)},r}function bt(){n.event.preventDefault()}function kl(){for(var t=n.event,i;i=t.sourceEvent;)t=i;return t}function so(t){for(var i=new oo,r=0,u=arguments.length;++r<u;)i[arguments[r]]=bl(i);return i.of=function(r,u){return function(f){try{var e=f.sourceEvent=n.event;f.target=t;n.event=f;i[f.type].apply(r,u)}finally{n.event=e}}},i}function kt(n){return uu(n,e),n}function ho(n){return typeof n=="function"?n:function(){return fl(n,this)}}function dl(n){return typeof n=="function"?n:function(){return el(n,this)}}function gl(t,i){function r(){this.removeAttribute(t)}function u(){this.removeAttributeNS(t.space,t.local)}function f(){this.setAttribute(t,i)}function e(){this.setAttributeNS(t.space,t.local,i)}function o(){var n=i.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}function s(){var n=i.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}return t=n.ns.qualify(t),i==null?t.local?u:r:typeof i=="function"?t.local?s:o:t.local?e:f}function na(n){return n.trim().replace(/\s+/g," ")}function ta(t){return new RegExp("(?:^|\\s+)"+n.requote(t)+"(?:\\s+|$)","g")}function ia(n,t){function r(){for(var r=-1;++r<i;)n[r](this,t)}function u(){for(var r=-1,u=t.apply(this,arguments);++r<i;)n[r](this,u)}n=n.trim().split(/\s+/).map(pk);var i=n.length;return typeof t=="function"?u:r}function pk(n){var t=ta(n);return function(i,r){if(u=i.classList)return r?u.add(n):u.remove(n);var u=i.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||i.setAttribute("class",na(u+" "+n))):i.setAttribute("class",na(u.replace(t," ")))}}function ra(n,t,i){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,i)}function f(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(n):this.style.setProperty(n,r,i)}return t==null?r:typeof t=="function"?f:u}function ua(n,t){function i(){delete this[n]}function r(){this[n]=t}function u(){var i=t.apply(this,arguments);i==null?delete this[n]:this[n]=i}return t==null?i:typeof t=="function"?u:r}function fa(t){return typeof t=="function"?t:(t=n.ns.qualify(t)).local?function(){return this.ownerDocument.createElementNS(t.space,t.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,t)}}function co(n){return{__data__:n}}function ea(n){return function(){return kb(this,n)}}function wk(t){return arguments.length||(t=n.ascending),function(n,i){return n&&i?t(n.__data__,i.__data__):!n-!i}}function dt(n,t){for(var i=0,u=n.length;i<u;i++)for(var f=n[i],r=0,o=f.length,e;r<o;r++)(e=f[r])&&t(e,r,i);return n}function oa(n){return uu(n,et),n}function bk(n){var t,i;return function(r,u,f){var e=n[f].update,s=e.length,o;for(f!=i&&(i=f,t=0),u>=t&&(t=u+1);!(o=e[t])&&++t<s;);return o}}function pu(){var n=this.__transition__;n&&++n.active}function sa(t,i,r){function o(){var n=this[u];n&&(this.removeEventListener(t,n,n.$),delete this[u])}function h(){var n=s(i,fi(arguments));o.call(this);this.addEventListener(t,this[u]=n,n.$=r);n._=i}function l(){var f=new RegExp("^__on([^.]+)"+n.requote(t)+"$"),u,i,r;for(i in this)(u=i.match(f))&&(r=this[i],this.removeEventListener(u[1],r,r.$),delete this[i])}var u="__on"+t,f=t.indexOf("."),s=ha,e;return f>0&&(t=t.substring(0,f)),e=te.get(t),e&&(t=e,s=kk),f?i?h:o:i?c:l}function ha(t,i){return function(r){var u=n.event;n.event=r;i[0]=this.__data__;try{t.apply(this,i)}finally{n.event=u}}}function kk(n,t){var i=ha(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||r.compareDocumentPosition(t)&8)||i.call(t,n)}}function wu(){var t=".dragsuppress-"+ ++nb,u="click"+t,r=n.select(v).on("touchmove"+t,bt).on("dragstart"+t,bt).on("selectstart"+t,bt),i,f;return cr&&(i=ei.style,f=i[cr],i[cr]="none"),function(n){r.on(t,null);if(cr&&(i[cr]=f),n){function e(){r.on(u,null)}r.on(u,function(){bt();e()},!0);setTimeout(e,0)}}}function ca(t,i){var u,r,f,e;return(i.changedTouches&&(i=i.changedTouches[0]),u=t.ownerSVGElement||t,u.createSVGPoint)?(r=u.createSVGPoint(),ie<0&&(v.scrollX||v.scrollY)&&(u=n.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"),f=u[0][0].getScreenCTM(),ie=!(f.f||f.e),u.remove()),ie?(r.x=i.pageX,r.y=i.pageY):(r.x=i.clientX,r.y=i.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]):(e=t.getBoundingClientRect(),[i.clientX-e.left-t.clientLeft,i.clientY-e.top-t.clientTop])}function la(n){return n>0?1:n<0?-1:0}function aa(n){return n>1?0:n<-1?f:Math.acos(n)}function si(n){return n>1?d:n<-1?-d:Math.asin(n)}function va(n){return((n=Math.exp(n))-1/n)/2}function lo(n){return((n=Math.exp(n))+1/n)/2}function dk(n){return((n=Math.exp(2*n))-1)/(n+1)}function ya(n){return(n=Math.sin(n/2))*n}function gi(){}function nr(n,t,i){return new ao(n,t,i)}function ao(n,t,i){this.h=n;this.s=t;this.l=i}function vo(n,t,i){function e(n){return(n>360?n-=360:n<0&&(n+=360),n<60)?r+(u-r)*n/60:n<180?u:n<240?r+(u-r)*(240-n)/60:r}function f(n){return Math.round(e(n)*255)}var r,u;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,u=i<=.5?i*(1+t):i+t-i*t,r=2*i-u,st(f(n+120),f(n),f(n-120))}function tr(n,t,i){return new bu(n,t,i)}function bu(n,t,i){this.h=n;this.c=t;this.l=i}function yo(n,t,i){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),ir(i,Math.cos(n*=r)*t,Math.sin(n)*t)}function ir(n,t,i){return new ku(n,t,i)}function ku(n,t,i){this.l=n;this.a=t;this.b=i}function pa(n,t,i){var r=(n+16)/116,u=r+t/500,f=r-i/200;return u=po(u)*gb,r=po(r)*nk,f=po(f)*tk,st(bo(3.2404542*u-1.5371385*r-.4985314*f),bo(-.969266*u+1.8760108*r+.041556*f),bo(.0556434*u-.2040259*r+1.0572252*f))}function wa(n,t,i){return n>0?tr(Math.atan2(i,t)*s,Math.sqrt(t*t+i*i),n):tr(NaN,NaN,n)}function po(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function wo(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function bo(n){return Math.round(255*(n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function ba(n){return st(n>>16,n>>8&255,n&255)}function du(n){return ba(n)+""}function st(n,t,i){return new ko(n,t,i)}function ko(n,t,i){this.r=n;this.g=t;this.b=i}function rr(n){return n<16?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function ka(n,t,i){var r=0,u=0,f=0,o,e,s;if(o=/([a-z]+)\((.*)\)/i.exec(n),o){e=o[2].split(",");switch(o[1]){case"hsl":return i(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100);case"rgb":return t(ns(e[0]),ns(e[1]),ns(e[2]))}}return(s=eu.get(n))?t(s.r,s.g,s.b):(n!=null&&n.charAt(0)==="#"&&(n.length===4?(r=n.charAt(1),r+=r,u=n.charAt(2),u+=u,f=n.charAt(3),f+=f):n.length===7&&(r=n.substring(1,3),u=n.substring(3,5),f=n.substring(5,7)),r=parseInt(r,16),u=parseInt(u,16),f=parseInt(f,16)),t(r,u,f))}function da(n,t,i){var f=Math.min(n/=255,t/=255,i/=255),r=Math.max(n,t,i),u=r-f,e,s,o=(r+f)/2;return u?(s=o<.5?u/(r+f):u/(2-r-f),e=(n==r?(t-i)/u+(t<i?6:0):t==r?(i-n)/u+2:(n-t)/u+4)*60):(e=NaN,s=o>0&&o<1?0:e),nr(e,s,o)}function ga(n,t,i){n=go(n);t=go(t);i=go(i);var u=wo((.4124564*n+.3575761*t+.1804375*i)/gb),r=wo((.2126729*n+.7151522*t+.072175*i)/nk),f=wo((.0193339*n+.119192*t+.9503041*i)/tk);return ir(116*r-16,500*(u-r),200*(r-f))}function go(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function ns(n){var t=parseFloat(n);return n.charAt(n.length-1)==="%"?Math.round(t*2.55):t}function o(n){return typeof n=="function"?n:function(){return n}}function a(n){return n}function ts(n){return function(t,i,r){return arguments.length===2&&typeof i=="function"&&(r=i,i=null),is(t,i,n,r)}}function is(t,i,r,u){function c(){var n=e.status,t;if(!n&&e.responseText||n>=200&&n<300||n===304){try{t=r.call(f,e)}catch(i){s.error.call(f,i);return}s.load.call(f,t)}else s.error.call(f,e)}var f={},s=n.dispatch("beforesend","progress","load","error"),o={},e=new XMLHttpRequest,h=null;return!v.XDomainRequest||"withCredentials"in e||!/^(http(s)?:)?\/\//.test(t)||(e=new XDomainRequest),"onload"in e?e.onload=e.onerror=c:e.onreadystatechange=function(){e.readyState>3&&c()},e.onprogress=function(t){var i=n.event;n.event=t;try{s.progress.call(f,e)}finally{n.event=i}},f.header=function(n,t){return(n=(n+"").toLowerCase(),arguments.length<2)?o[n]:(t==null?delete o[n]:o[n]=t+"",f)},f.mimeType=function(n){return arguments.length?(i=n==null?null:n+"",f):i},f.responseType=function(n){return arguments.length?(h=n,f):h},f.response=function(n){return r=n,f},["get","post"].forEach(function(n){f[n]=function(){return f.send.apply(f,[n].concat(fi(arguments)))}}),f.send=function(n,r,u){if(arguments.length===2&&typeof r=="function"&&(u=r,r=null),e.open(n,t,!0),i==null||"accept"in o||(o.accept=i+",*/*"),e.setRequestHeader)for(var c in o)e.setRequestHeader(c,o[c]);if(i!=null&&e.overrideMimeType&&e.overrideMimeType(i),h!=null&&(e.responseType=h),u!=null)f.on("error",u).on("load",function(n){u(null,n)});return s.beforesend.call(f,e),e.send(r==null?null:r),f},f.abort=function(){return e.abort(),f},n.rebind(f,s,"on"),u==null?f:f.get(gk(u))}function gk(n){return n.length===1?function(t,i){n(t==null?i:null)}:n}function rs(){var t=nv(),n=tv()-t;n>24?(isFinite(n)&&(clearTimeout(he),he=setTimeout(rs,n)),se=0):(se=1,rc(rs))}function nv(){var n=Date.now();for(vt=ee;vt;)n>=vt.t&&(vt.f=vt.c(n-vt.t)),vt=vt.n;return n}function tv(){for(var t,n=ee,i=Infinity;n;)n.f?n=t?t.n=n.n:ee=n.n:(n.t<i&&(i=n.t),n=(t=n).n);return oe=t,i}function nd(n,t){var i=Math.pow(10,u(8-t)*3);return{scale:t>8?function(n){return n/i}:function(n){return n*i},symbol:n}}function us(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function td(n){return n+""}function fs(){}function iv(n,t,i){var r=i.s=n+t,u=r-n,f=r-u;i.t=n-f+(t-u)}function gu(n,t){n&&ec.hasOwnProperty(n.type)&&ec[n.type](n,t)}function es(n,t,i){var u=-1,f=n.length-i,r;for(t.lineStart();++u<f;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function rv(n,t){var i=-1,r=n.length;for(t.polygonStart();++i<r;)es(n[i],t,1);t.polygonEnd()}function id(){function u(u,e){u*=r;e=e*r/2+f/4;var o=u-n,s=Math.cos(e),h=Math.sin(e),c=i*h,l=t*s+c*Math.cos(o),a=c*Math.sin(o);ni.add(Math.atan2(a,l));n=u;t=s;i=h}var e,o,n,t,i;b.point=function(s,h){b.point=u;n=(e=s)*r;t=Math.cos(h=(o=h)*r/2+f/4);i=Math.sin(h)};b.lineEnd=function(){u(e,o)}}function hi(n){var t=n[0],i=n[1],r=Math.cos(i);return[r*Math.cos(t),r*Math.sin(t),Math.sin(i)]}function nf(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function ur(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function os(n,t){n[0]+=t[0];n[1]+=t[1];n[2]+=t[2]}function tf(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function rf(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t;n[1]/=t;n[2]/=t}function uf(n){return[Math.atan2(n[1],n[0]),si(n[2])]}function ff(n,i){return u(n[0]-i[0])<t&&u(n[1]-i[1])<t}function ss(n,t){n*=r;var i=Math.cos(t*=r);pr(i*Math.cos(n),i*Math.sin(n),Math.sin(t))}function pr(n,t,i){++su;pi+=(n-pi)/su;wi+=(t-wi)/su;yt+=(i-yt)/su}function uv(){function u(u,f){u*=r;var c=Math.cos(f*=r),o=c*Math.cos(u),s=c*Math.sin(u),h=Math.sin(f),e=Math.atan2(Math.sqrt((e=t*h-i*s)*e+(e=i*o-n*h)*e+(e=n*s-t*o)*e),n*o+t*s+i*h);ae+=e;ti+=e*(n+(n=o));ii+=e*(t+(t=s));ot+=e*(i+(i=h));pr(n,t,i)}var n,t,i;tt.point=function(f,e){f*=r;var o=Math.cos(e*=r);n=o*Math.cos(f);t=o*Math.sin(f);i=Math.sin(e);tt.point=u;pr(n,t,i)}}function fv(){tt.point=ss}function rd(){function u(u,f){u*=r;var p=Math.cos(f*=r),e=p*Math.cos(u),o=p*Math.sin(u),s=Math.sin(f),c=t*s-i*o,l=i*e-n*s,a=n*o-t*e,v=Math.sqrt(c*c+l*l+a*a),w=n*e+t*o+i*s,y=v&&-aa(w)/v,h=Math.atan2(v,w);lr+=y*c;ar+=y*l;ri+=y*a;ae+=h;ti+=h*(n+(n=e));ii+=h*(t+(t=o));ot+=h*(i+(i=s));pr(n,t,i)}var f,e,n,t,i;tt.point=function(o,s){f=o;e=s;tt.point=u;o*=r;var h=Math.cos(s*=r);n=h*Math.cos(o);t=h*Math.sin(o);i=Math.sin(s);pr(n,t,i)};tt.lineEnd=function(){u(f,e);tt.lineEnd=fv;tt.point=ss}}function fr(){return!0}function ev(n,t,i,r,u){var h=[],s=[],v,o,l,f,c,a,e;if(n.forEach(function(n){var o,i,f,e,t,r;if(!((o=n.length-1)<=0)){if(i=n[0],f=n[o],ff(i,f)){for(u.lineStart(),e=0;e<o;++e)u.point((i=n[e])[0],i[1]);u.lineEnd();return}t=new ef(i,n,null,!0);r=new ef(i,null,t,!1);t.o=r;h.push(t);s.push(r);t=new ef(f,n,null,!1);r=new ef(f,null,t,!0);t.o=r;h.push(t);s.push(r)}}),s.sort(t),ov(h),ov(s),h.length){for(var e=0,y=i,a=s.length;e<a;++e)s[e].e=y=!y;for(v=h[0];;){for(f=v,c=!0;f.v;)if((f=f.n)===v)return;o=f.z;u.lineStart();do{if(f.v=f.o.v=!0,f.e){if(c)for(e=0,a=o.length;e<a;++e)u.point((l=o[e])[0],l[1]);else r(f.x,f.n.x,1,u);f=f.n}else{if(c)for(o=f.p.z,e=o.length-1;e>=0;--e)u.point((l=o[e])[0],l[1]);else r(f.x,f.p.x,-1,u);f=f.p}f=f.o;o=f.z;c=!c}while(!f.v);u.lineEnd()}}}function ov(n){if(r=n.length){for(var r,u=0,t=n[0],i;++u<r;)t.n=i=n[u],i.p=t,t=i;t.n=i=n[0];i.p=t}}function ef(n,t,i,r){this.x=n;this.z=t;this.o=i;this.e=r;this.v=!1;this.n=this.p=null}function sv(t,i,r,u){return function(f,e){function a(n,i){var r=f(n,i);t(n=r[0],i=r[1])&&e.point(n,i)}function k(n,t){var i=f(n,t);v.point(i[0],i[1])}function y(){o.point=k;v.lineStart()}function p(){o.point=a;v.lineEnd()}function w(n,t){h.push([n,t]);var i=f(n,t);c.point(i[0],i[1])}function d(){c.lineStart();h=[]}function g(){var t,i,u;w(h[0][0],h[0][1]);c.lineEnd();var f=c.clean(),n=b.buffer(),r,t=n.length;if(h.pop(),l.push(h),h=null,t){if(f&1){for(r=n[0],t=r.length-1,i=-1,e.lineStart();++i<t;)e.point((u=r[i])[0],u[1]);e.lineEnd();return}t>1&&f&2&&n.push(n.pop().concat(n.shift()));s.push(n.filter(ud))}}var v=i(e),nt=f.invert(u[0],u[1]),o={point:a,lineStart:y,lineEnd:p,polygonStart:function(){o.point=w;o.lineStart=d;o.lineEnd=g;s=[];l=[];e.polygonStart()},polygonEnd:function(){o.point=a;o.lineStart=y;o.lineEnd=p;s=n.merge(s);var t=ed(nt,l);s.length?ev(s,fd,t,r,e):t&&(e.lineStart(),r(null,null,1,e),e.lineEnd());e.polygonEnd();s=l=null},sphere:function(){e.polygonStart();e.lineStart();r(null,null,1,e);e.lineEnd();e.polygonEnd()}},s,b=hv(),c=i(b),l,h;return o}}function ud(n){return n.length>1}function hv(){var n=[],t;return{lineStart:function(){n.push(t=[])},point:function(n,i){t.push([n,i])},lineEnd:c,buffer:function(){var i=n;return n=[],t=null,i},rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))}}}function fd(n,i){return((n=n.x)[0]<0?n[1]-d-t:d-n[1])-((i=i.x)[0]<0?i[1]-d-t:d-i[1])}function ed(n,i){var o=n[0],g=n[1],ht=[Math.sin(o),-Math.cos(o),0],v=0,nt=0,s,tt,h,y,e,p,w;for(ni.reset(),s=0,tt=i.length;s<tt;++s)if(h=i[s],y=h.length,y)for(var c=h[0],b=c[0],it=c[1]/2+f/4,rt=Math.sin(it),ut=Math.cos(it),l=1;;){l===y&&(l=0);n=h[l];var d=n[0],ft=n[1]/2+f/4,et=Math.sin(ft),ot=Math.cos(ft),r=d-b,a=u(r)>f,st=rt*et;if(ni.add(Math.atan2(st*Math.sin(r),ut*ot+st*Math.cos(r))),v+=a?r+(r>=0?k:-k):r,a^b>=o^d>=o&&(e=ur(hi(c),hi(n)),rf(e),p=ur(ht,e),rf(p),w=(a^r>=0?-1:1)*si(p[2]),(g>w||g===w&&(e[0]||e[1]))&&(nt+=a^r>=0?1:-1)),!l++)break;b=d;rt=et;ut=ot;c=n}return(v<-t||v<t&&ni<0)^nt&1}function od(n){var r=NaN,i=NaN,e=NaN,o;return{lineStart:function(){n.lineStart();o=1},point:function(s,h){var c=s>0?f:-f,l=u(s-r);u(l-f)<t?(n.point(r,i=(i+h)/2>0?d:-d),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(c,i),n.point(s,i),o=0):e!==c&&l>=f&&(u(r-e)<t&&(r-=e*t),u(s-c)<t&&(s-=c*t),i=sd(r,i,s,h),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(c,i),o=0);n.point(r=s,i=h);e=c},lineEnd:function(){n.lineEnd();r=i=NaN},clean:function(){return 2-o}}}function sd(n,i,r,f){var e,o,s=Math.sin(n-r);return u(s)>t?Math.atan((Math.sin(i)*(o=Math.cos(f))*Math.sin(r)-Math.sin(f)*(e=Math.cos(i))*Math.sin(n))/(e*o*s)):(i+f)/2}function hd(n,i,r,e){var o,s;n==null?(o=r*d,e.point(-f,o),e.point(0,o),e.point(f,o),e.point(f,0),e.point(f,-o),e.point(0,-o),e.point(-f,-o),e.point(-f,0),e.point(-f,o)):u(n[0]-i[0])>t?(s=n[0]<i[0]?f:-f,o=r*s/2,e.point(-s,o),e.point(0,o),e.point(s,o)):e.point(i[0],i[1])}function cd(n){function s(n,t){return Math.cos(n)*Math.cos(t)>i}function c(n){var i,a,r,c,u;return{lineStart:function(){c=r=!1;u=1},point:function(v,y){var p=[v,y],w,b=s(v,y),d=e?b?0:h(v,y):b?h(v+(v<0?f:-f),y):0,k;!i&&(c=r=b)&&n.lineStart();b!==r&&(w=o(i,p),(ff(i,w)||ff(p,w))&&(p[0]+=t,p[1]+=t,b=s(p[0],p[1])));b!==r?(u=0,b?(n.lineStart(),w=o(p,i),n.point(w[0],w[1])):(w=o(i,p),n.point(w[0],w[1]),n.lineEnd()),i=w):l&&i&&e^b&&(d&a||!(k=o(p,i,!0))||(u=0,e?(n.lineStart(),n.point(k[0][0],k[0][1]),n.point(k[1][0],k[1][1]),n.lineEnd()):(n.point(k[1][0],k[1][1]),n.lineEnd(),n.lineStart(),n.point(k[0][0],k[0][1]))));!b||i&&ff(i,p)||n.point(p[0],p[1]);i=p;r=b;a=d},lineEnd:function(){r&&n.lineEnd();i=null},clean:function(){return u|(c&&r)<<1}}}function o(n,r,e){var et=hi(n),ot=hi(r),rt=[1,0,0],a=ur(et,ot),ut=nf(a,a),b=a[0],k=ut-b*b,d,o,g;if(!k)return!e&&n;var st=i*ut/k,ht=-i*b/k,ct=ur(rt,a),s=tf(rt,st),lt=tf(a,ht);os(s,lt);var v=ct,p=nf(s,v),nt=nf(v,v),ft=p*p-nt*(nf(s,s)-1);if(!(ft<0)){if(d=Math.sqrt(ft),o=tf(v,(-p-d)/nt),os(o,s),o=uf(o),!e)return o;var h=n[0],y=r[0],c=n[1],l=r[1],w;y<h&&(w=h,h=y,y=w);var tt=y-h,it=u(tt-f)<t,at=it||tt<t;return!it&&l<c&&(w=c,c=l,l=w),(at?it?c+l>0^o[1]<(u(o[0]-h)<t?c:l):c<=o[1]&&o[1]<=l:tt>f^(h<=o[0]&&o[0]<=y))?(g=tf(v,(-p+d)/nt),os(g,s),[o,uf(g)]):void 0}}function h(t,i){var u=e?n:f-n,r=0;return t<-u?r|=1:t>u&&(r|=2),i<-u?r|=4:i>u&&(r|=8),r}var i=Math.cos(n),e=i>0,l=u(i)>t,a=as(n,6*r);return sv(s,c,a,e?[0,-n]:[-f,n-f])}function cv(n,t,i,r){return function(u){var a=u.a,v=u.b,c=a.x,l=a.y,y=v.x,p=v.y,e=0,o=1,s=y-c,h=p-l,f;if(f=n-c,s||!(f>0)){if(f/=s,s<0){if(f<e)return;f<o&&(o=f)}else if(s>0){if(f>o)return;f>e&&(e=f)}if(f=i-c,s||!(f<0)){if(f/=s,s<0){if(f>o)return;f>e&&(e=f)}else if(s>0){if(f<e)return;f<o&&(o=f)}if(f=t-l,h||!(f>0)){if(f/=h,h<0){if(f<e)return;f<o&&(o=f)}else if(h>0){if(f>o)return;f>e&&(e=f)}if(f=r-l,h||!(f<0)){if(f/=h,h<0){if(f>o)return;f>e&&(e=f)}else if(h>0){if(f<e)return;f<o&&(o=f)}return e>0&&(u.a={x:c+e*s,y:l+e*h}),o<1&&(u.b={x:c+o*s,y:l+o*h}),u}}}}}}function lv(i,r,f,e){function o(n,e){return u(n[0]-i)<t?e>0?0:3:u(n[0]-f)<t?e>0?2:1:u(n[1]-r)<t?e>0?1:0:e>0?3:2}function h(n,t){return s(n.x,t.x)}function s(n,t){var i=o(n,1),r=o(t,1);return i!==r?i-r:i===0?t[1]-n[1]:i===1?n[0]-t[0]:i===2?n[1]-t[1]:t[0]-n[0]}return function(t){function et(n){for(var r=0,s=c.length,u=n[1],f=0;f<s;++f)for(var e=1,o=c[f],h=o.length,i=o[0],t;e<h;++e)t=o[e],i[1]<=u?t[1]>u&&d(i,t,n)>0&&++r:t[1]<=u&&d(i,t,n)<0&&--r,i=t;return r!==0}function d(n,t,i){return(t[0]-n[0])*(i[1]-n[1])-(i[0]-n[0])*(t[1]-n[1])}function g(n,t,u,h){var c=0,l=0;if(n==null||(c=o(n,u))!==(l=o(t,u))||s(n,t)<0^u>0){do h.point(c===0||c===3?i:f,c>1?e:r);while((c=(c+u+4)%4)!==l)}else h.point(t[0],t[1])}function nt(n,t){return i<=n&&n<=f&&r<=t&&t<=e}function tt(n,i){nt(n,i)&&t.point(n,i)}function ot(){p.point=it;c&&c.push(y=[]);k=!0;l=!1;w=b=NaN}function st(){u&&(it(rt,ut),ft&&l&&v.rejoin(),u.push(v.buffer()));p.point=tt;l&&t.lineEnd()}function it(n,i){var r,u;n=Math.max(-hu,Math.min(hu,n));i=Math.max(-hu,Math.min(hu,i));r=nt(n,i);c&&y.push([n,i]);k?(rt=n,ut=i,ft=r,k=!1,r&&(t.lineStart(),t.point(n,i))):r&&l?t.point(n,i):(u={a:{x:w,y:b},b:{x:n,y:i}},ct(u)?(l||(t.lineStart(),t.point(u.a.x,u.a.y)),t.point(u.b.x,u.b.y),r||t.lineEnd(),a=!1):r&&(t.lineStart(),t.point(n,i),a=!1));w=n;b=i;l=r}var ht=t,v=hv(),ct=cv(i,r,f,e),u,c,y,p={point:tt,lineStart:ot,lineEnd:st,polygonStart:function(){t=v;u=[];c=[];a=!0},polygonEnd:function(){t=ht;u=n.merge(u);var r=et([i,e]),f=a&&r,o=u.length;(f||o)&&(t.polygonStart(),f&&(t.lineStart(),g(null,null,1,t),t.lineEnd()),o&&ev(u,h,r,g,t),t.polygonEnd());u=c=y=null}},rt,ut,ft,w,b,l,k,a;return p}}function av(n,t){function i(i,r){return i=n(i,r),t(i[0],i[1])}return n.invert&&t.invert&&(i.invert=function(i,r){return i=t.invert(i,r),i&&n.invert(i[0],i[1])}),i}function hs(n){var t=0,i=f/3,r=cs(n),u=r(t,i);return u.parallels=function(n){return arguments.length?r(t=n[0]*f/180,i=n[1]*f/180):[t/f*180,i/f*180]},u}function vv(n,t){function f(n,t){var r=Math.sqrt(u-2*i*Math.sin(t))/i;return[r*Math.sin(n*=i),e-r*Math.cos(n)]}var r=Math.sin(n),i=(r+Math.sin(t))/2,u=1+r*(2*i-r),e=Math.sqrt(u)/i;return f.invert=function(n,t){var r=e-t;return[Math.atan2(n,r)/i,si((u-(n*n+r*r)*i*i)/(2*i))]},f}function ld(){function i(i,r){hc+=t*i-n*r;n=i;t=r}var r,u,n,t;pt.point=function(f,e){pt.point=i;r=n=f;u=t=e};pt.lineEnd=function(){i(r,u)}}function ad(n,t){n<ve&&(ve=n);n>pe&&(pe=n);t<ye&&(ye=t);t>we&&(we=t)}function vd(){function i(n,i){t.push("M",n,",",i,u)}function f(i,r){t.push("M",i,",",r);n.point=e}function e(n,i){t.push("L",n,",",i)}function r(){n.point=i}function o(){t.push("Z")}var u=yv(4.5),t=[],n={point:i,lineStart:function(){n.point=f},lineEnd:r,polygonStart:function(){n.lineEnd=o},polygonEnd:function(){n.lineEnd=r;n.point=i},pointRadius:function(t){return u=yv(t),n},result:function(){if(t.length){var n=t.join("");return t=[],n}}};return n}function yv(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function ci(n,t){pi+=n;wi+=t;++yt}function pv(){function i(i,r){var f=i-n,e=r-t,u=Math.sqrt(f*f+e*e);ti+=u*(n+i)/2;ii+=u*(t+r)/2;ot+=u;ci(n=i,t=r)}var n,t;it.point=function(r,u){it.point=i;ci(n=r,t=u)}}function wv(){it.point=ci}function yd(){function i(i,r){var f=i-n,e=r-t,u=Math.sqrt(f*f+e*e);ti+=u*(n+i)/2;ii+=u*(t+r)/2;ot+=u;u=t*i-n*r;lr+=u*(n+i);ar+=u*(t+r);ri+=u*3;ci(n=i,t=r)}var r,u,n,t;it.point=function(f,e){it.point=i;ci(r=n=f,u=t=e)};it.lineEnd=function(){i(r,u)}}function pd(n){function i(t,i){n.moveTo(t,i);n.arc(t,i,u,0,k)}function f(i,r){n.moveTo(i,r);t.point=e}function e(t,i){n.lineTo(t,i)}function r(){t.point=i}function o(){n.closePath()}var u=4.5,t={point:i,lineStart:function(){t.point=f},lineEnd:r,polygonStart:function(){t.lineEnd=o},polygonEnd:function(){t.lineEnd=r;t.point=i},pointRadius:function(n){return u=n,t},result:c};return t}function bv(n){function o(n){return(e?h:s)(n)}function s(t){return dv(t,function(i,r){i=n(i,r);t.point(i[0],i[1])})}function h(t){function y(i,r){i=n(i,r);t.point(i[0],i[1])}function c(){u=NaN;r.point=l;t.lineStart()}function l(r,c){var l=hi([r,c]),a=n(r,c);i(u,f,v,o,s,h,u=a[0],f=a[1],v=r,o=l[0],s=l[1],h=l[2],e,t);t.point(u,f)}function a(){r.point=y;t.lineEnd()}function nt(){c();r.point=tt;r.lineEnd=it}function tt(n,t){l(p=n,rt=t);w=u;b=f;k=o;d=s;g=h;r.point=l}function it(){i(u,f,v,o,s,h,w,b,p,k,d,g,e,t);r.lineEnd=a;a()}var p,rt,w,b,k,d,g,v,u,f,o,s,h,r={point:y,lineStart:c,lineEnd:a,polygonStart:function(){t.polygonStart();r.lineStart=nt},polygonEnd:function(){t.polygonEnd();r.lineStart=c}};return r}function i(r,e,o,s,h,l,a,v,y,p,w,b,k,d){var it=a-r,rt=v-e,et=it*it+rt*rt;if(et>4*f&&k--){var nt=s+p,tt=h+w,g=l+b,ot=Math.sqrt(nt*nt+tt*tt+g*g),vt=Math.asin(g/=ot),st=u(u(g)-1)<t||u(o-y)<t?(o+y)/2:Math.atan2(tt,nt),ht=n(st,vt),ut=ht[0],ft=ht[1],ct=ut-r,lt=ft-e,at=rt*ct-it*lt;(at*at/et>f||u((it*ct+rt*lt)/et-.5)>.3||s*p+h*w+l*b<c)&&(i(r,e,o,s,h,l,ut,ft,st,nt/=ot,tt/=ot,g,k,d),d.point(ut,ft),i(ut,ft,st,nt,tt,g,a,v,y,p,w,b,k,d))}}var f=.5,c=Math.cos(30*r),e=16;return o.precision=function(n){return arguments.length?(e=(f=n*n)>0&&16,o):Math.sqrt(f)},o}function wd(n){var t=bv(function(t,i){return n([t*s,i*s])});return function(n){return gv(t(n))}}function kv(n){this.stream=n}function dv(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function gt(n){return cs(function(){return n})()}function cs(t){function i(n){return n=v(n[0]*r,n[1]*r),[n[0]*u+h,c-n[1]*u]}function et(n){return n=v.invert((n[0]-h)/u,(c-n[1])/u),n&&[n[0]*s,n[1]*s]}function e(){v=av(tt=ls(k,d,g),o);var n=o(w,b);return h=y-n[0]*u,c=p+n[1]*u,l()}function l(){return f&&(f.valid=!1,f=null),i}var o,tt,v,it=bv(function(n,t){return n=o(n,t),[n[0]*u+h,c-n[1]*u]}),u=150,y=480,p=250,w=0,b=0,k=0,d=0,g=0,h,c,rt=oc,ut=a,nt=null,ft=null,f;return i.stream=function(n){return f&&(f.valid=!1),f=gv(rt(tt,it(ut(n)))),f.valid=!0,f},i.clipAngle=function(n){return arguments.length?(rt=n==null?(nt=n,oc):cd((nt=+n)*r),l()):nt},i.clipExtent=function(n){return arguments.length?(ft=n,ut=n?lv(n[0][0],n[0][1],n[1][0],n[1][1]):a,l()):ft},i.scale=function(n){return arguments.length?(u=+n,e()):u},i.translate=function(n){return arguments.length?(y=+n[0],p=+n[1],e()):[y,p]},i.center=function(n){return arguments.length?(w=n[0]%360*r,b=n[1]%360*r,e()):[w*s,b*s]},i.rotate=function(n){return arguments.length?(k=n[0]%360*r,d=n[1]%360*r,g=n.length>2?n[2]%360*r:0,e()):[k*s,d*s,g*s]},n.rebind(i,it,"precision"),function(){return o=t.apply(this,arguments),i.invert=o.invert&&et,e()}}function gv(n){return dv(n,function(t,i){n.point(t*r,i*r)})}function wr(n,t){return[n,t]}function ny(n,t){return[n>f?n-k:n<-f?n+k:n,t]}function ls(n,t,i){return n?t||i?av(iy(n),ry(t,i)):iy(n):t||i?ry(t,i):ny}function ty(n){return function(t,i){return t+=n,[t>f?t-k:t<-f?t+k:t,i]}}function iy(n){var t=ty(n);return t.invert=ty(-n),t}function ry(n,t){function e(n,t){var e=Math.cos(t),o=Math.cos(n)*e,s=Math.sin(n)*e,h=Math.sin(t),c=h*i+o*r;return[Math.atan2(s*u-c*f,o*i-h*r),si(c*u+s*f)]}var i=Math.cos(n),r=Math.sin(n),u=Math.cos(t),f=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),o=Math.cos(n)*e,s=Math.sin(n)*e,h=Math.sin(t),c=h*u-s*f;return[Math.atan2(s*u+h*f,o*i+c*r),si(c*i-o*r)]},e}function as(n,t){var i=Math.cos(n),r=Math.sin(n);return function(u,f,e,o){var h=e*t,c,s;for(u!=null?(u=uy(i,u),f=uy(i,f),(e>0?u<f:u>f)&&(u+=e*k)):(u=n+e*k,f=n-.5*h),s=u;e>0?s>f:s<f;s-=h)o.point((c=uf([i,-r*Math.cos(s),-r*Math.sin(s)]))[0],c[1])}}function uy(n,i){var r=hi(i),u;return r[0]-=n,rf(r),u=aa(-r[1]),((-r[2]<0?-u:u)+2*Math.PI-t)%(2*Math.PI)}function fy(i,r,u){var f=n.range(i,r-t,u).concat(r);return function(n){return f.map(function(t){return[n,t]})}}function ey(i,r,u){var f=n.range(i,r-t,u).concat(r);return function(n){return f.map(function(t){return[t,n]})}}function vs(n){return n.source}function ys(n){return n.target}function bd(n,t,i,r){var f=Math.cos(t),c=Math.sin(t),e=Math.cos(r),l=Math.sin(r),a=f*Math.cos(n),v=f*Math.sin(n),y=e*Math.cos(i),p=e*Math.sin(i),u=2*Math.asin(Math.sqrt(ya(r-t)+f*e*ya(i-n))),o=1/Math.sin(u),h=u?function(n){var t=Math.sin(n*=u)*o,i=Math.sin(u-n)*o,r=i*a+t*y,f=i*v+t*p,e=i*c+t*l;return[Math.atan2(f,r)*s,Math.atan2(e,Math.sqrt(r*r+f*f))*s]}:function(){return[n*s,t*s]};return h.distance=u,h}function kd(){function f(f,e){var h=Math.sin(e*=r),s=Math.cos(e),o=u((f*=r)-i),c=Math.cos(o);cc+=Math.atan2(Math.sqrt((o=s*Math.sin(o))*o+(o=t*h-n*s*c)*o),n*h+t*s*c);i=f;n=h;t=s}var i,n,t;bi.point=function(u,e){i=u*r;n=Math.sin(e*=r);t=Math.cos(e);bi.point=f};bi.lineEnd=function(){bi.point=bi.lineEnd=c}}function br(n,t){function i(t,i){var f=Math.cos(t),r=Math.cos(i),u=n(f*r);return[u*r*Math.sin(t),u*Math.sin(i)]}return i.invert=function(n,i){var r=Math.sqrt(n*n+i*i),u=t(r),f=Math.sin(u),e=Math.cos(u);return[Math.atan2(n*f,r*e),Math.asin(r&&i*f/r)]},i}function oy(n,i){function s(n,i){var f=u(u(i)-d)<t?0:o/Math.pow(e(i),r);return[f*Math.sin(r*n),o-f*Math.cos(r*n)]}var h=Math.cos(n),e=function(n){return Math.tan(f/4+n/2)},r=n===i?Math.sin(n):Math.log(h/Math.cos(i))/Math.log(e(i)/e(n)),o=h*Math.pow(e(n),r)/r;return r?(s.invert=function(n,t){var i=o-t,u=la(r)*Math.sqrt(n*n+i*i);return[Math.atan2(n,i)/r,2*Math.atan(Math.pow(o/u,1/r))-d]},s):of}function sy(n,i){function e(n,t){var i=f-t;return[i*Math.sin(r*n),f-i*Math.cos(r*n)]}var o=Math.cos(n),r=n===i?Math.sin(n):(o-Math.cos(i))/(i-n),f=o/r+n;return u(r)<t?wr:(e.invert=function(n,t){var i=f-t;return[Math.atan2(n,i)/r,f-la(r)*Math.sqrt(n*n+i*i)]},e)}function of(n,t){return[n,Math.log(Math.tan(f/4+t/2))]}function hy(n){var t=gt(n),r=t.scale,u=t.translate,e=t.clipExtent,i;return t.scale=function(){var n=r.apply(t,arguments);return n===t?i?t.clipExtent(null):t:n},t.translate=function(){var n=u.apply(t,arguments);return n===t?i?t.clipExtent(null):t:n},t.clipExtent=function(n){var h=e.apply(t,arguments),o,s;return h===t?(i=n==null)&&(o=f*r(),s=u(),e([[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]])):i&&(h=null),h},t.clipExtent(null)}function ps(n,t){var i=Math.cos(t)*Math.sin(n);return[Math.log((1+i)/(1-i))/2,Math.atan2(Math.tan(t),Math.cos(n))]}function li(n){return n[0]}function er(n){return n[1]}function dd(n,t,i,r){var u,f,e,o,s,h,c;return u=r[n],f=u[0],e=u[1],u=r[t],o=u[0],s=u[1],u=r[i],h=u[0],c=u[1],(c-e)*(o-f)-(s-e)*(h-f)>0}function ws(n,t,i){return(i[0]-t[0])*(n[1]-t[1])<(i[1]-t[1])*(n[0]-t[0])}function cy(n,t,i,r){var u=n[0],e=i[0],o=t[0]-u,s=r[0]-e,f=n[1],h=i[1],c=t[1]-f,l=r[1]-h,a=(s*(f-h)-l*(u-e))/(l*o-s*c);return[u+a*o,f+a*c]}function ly(n){var t=n[0],i=n[n.length-1];return!(t[0]-i[0]||t[1]-i[1])}function gd(){cf(this);this.edge=this.site=this.circle=null}function ay(n){var t=wc.pop()||new gd;return t.site=n,t}function bs(n){sr(n);yr.remove(n);wc.push(n);cf(n)}function ng(n){var a=n.circle,o=a.x,s=a.cy,v={x:o,y:s},h=n.P,c=n.N,f=[n],r,i,l,e;for(bs(n),r=h;r.circle&&u(o-r.circle.x)<t&&u(s-r.circle.cy)<t;)h=r.P,f.unshift(r),bs(r),r=h;for(f.unshift(r),sr(r),i=c;i.circle&&u(o-i.circle.x)<t&&u(s-i.circle.cy)<t;)c=i.N,f.push(i),bs(i),i=c;for(f.push(i),sr(i),l=f.length,e=1;e<l;++e)i=f[e],r=f[e-1],sf(i.edge,r.site,i.site,v);r=f[0];i=f[l-1];i.edge=kr(r.site,i.site,null,v);or(r);or(i)}function tg(n){for(var b=n.x,k=n.y,i,r,a,v,u=yr._,f;u;)if(a=vy(u,k)-b,a>t)u=u.L;else if(v=b-ig(u,k),v>t){if(!u.R){i=u;break}u=u.R}else{a>-t?(i=u.P,r=u):v>-t?(i=u,r=u.N):i=r=u;break}if(f=ay(n),yr.insert(i,f),i||r){if(i===r){sr(i);r=ay(i.site);yr.insert(f,r);f.edge=r.edge=kr(i.site,f.site);or(i);or(r);return}if(!r){f.edge=kr(i.site,f.site);return}sr(i);sr(r);var e=i.site,y=e.x,p=e.y,o=n.x-y,s=n.y-p,h=r.site,c=h.x-y,l=h.y-p,d=2*(o*l-s*c),g=o*o+s*s,nt=c*c+l*l,w={x:(l*g-s*nt)/d+y,y:(o*nt-c*g)/d+p};sf(r.edge,e,h,w);f.edge=kr(e,n,null,w);r.edge=kr(n,h,null,w);or(i);or(r)}}function vy(n,t){var i=n.site,u=i.x,l=i.y,f=l-t,e;if(!f)return u;if(e=n.P,!e)return-Infinity;i=e.site;var o=i.x,a=i.y,r=a-t;if(!r)return o;var s=o-u,h=1/f-1/r,c=s/r;return h?(-c+Math.sqrt(c*c-2*h*(s*s/(-2*r)-a+r/2+l-f/2)))/h+u:(u+o)/2}function ig(n,t){var r=n.N,i;return r?vy(r,t):(i=n.site,i.y===t?i.x:Infinity)}function yy(n){this.site=n;this.edges=[]}function rg(n){for(var s=n[0][0],h=n[1][0],c=n[0][1],l=n[1][1],i,r,f,e,b=ki,k=b.length,o,a,v,y,w,p;k--;)if(o=b[k],o&&o.prepare())for(v=o.edges,y=v.length,a=0;a<y;)p=v[a].end(),f=p.x,e=p.y,w=v[++a%y].start(),i=w.x,r=w.y,(u(f-i)>t||u(e-r)>t)&&(v.splice(a,0,new hf(og(o.site,p,u(f-s)<t&&l-e>t?{x:s,y:u(i-s)<t?r:l}:u(e-l)<t&&h-f>t?{x:u(r-l)<t?i:h,y:l}:u(f-h)<t&&e-c>t?{x:h,y:u(i-h)<t?r:c}:u(e-c)<t&&f-s>t?{x:u(r-c)<t?i:s,y:c}:null),o.site,null)),++y)}function py(n,t){return t.angle-n.angle}function ug(){cf(this);this.x=this.y=this.arc=this.site=this.cy=null}function or(n){var w=n.P,b=n.N,u,t;if(w&&b){var s=w.site,h=n.site,c=b.site;if(s!==c){var l=h.x,a=h.y,f=s.x-l,e=s.y-a,o=c.x-l,r=c.y-a,v=2*(f*r-e*o);if(!(v>=-ol)){var k=f*f+e*e,d=o*o+r*r,y=(r*k-e*d)/v,p=(f*d-o*k)/v,r=p+a,i=kc.pop()||new ug;for(i.arc=n,i.site=h,i.x=y+l,i.y=r+Math.sqrt(y*y+p*p),i.cy=r,n.circle=i,u=null,t=lu._;t;)if(i.y<t.y||i.y===t.y&&i.x<=t.x)if(t.L)t=t.L;else{u=t.P;break}else if(t.R)t=t.R;else{u=t;break}lu.insert(u,i);u||(bc=i)}}}}function sr(n){var t=n.circle;t&&(t.P||(bc=t.N),lu.remove(t),kc.push(t),cf(t),n.circle=null)}function fg(n){for(var r=vr,e=cv(n[0][0],n[0][1],n[1][0],n[1][1]),f=r.length,i;f--;)i=r[f],(!eg(i,n)||!e(i)||u(i.a.x-i.b.x)<t&&u(i.a.y-i.b.y)<t)&&(i.a=i.b=null,r.splice(f,1))}function eg(n,t){var f=n.b;if(f)return!0;var i=n.a,h=t[0][0],c=t[1][0],e=t[0][1],o=t[1][1],p=n.l,w=n.r,l=p.x,a=p.y,v=w.x,y=w.y,s=(l+v)/2,b=(a+y)/2,r,u;if(y===a){if(s<h||s>=c)return;if(l>v){if(i){if(i.y>=o)return}else i={x:s,y:e};f={x:s,y:o}}else{if(i){if(i.y<e)return}else i={x:s,y:o};f={x:s,y:e}}}else if(r=(l-v)/(y-a),u=b-r*s,r<-1||r>1)if(l>v){if(i){if(i.y>=o)return}else i={x:(e-u)/r,y:e};f={x:(o-u)/r,y:o}}else{if(i){if(i.y<e)return}else i={x:(o-u)/r,y:o};f={x:(e-u)/r,y:e}}else if(a<y){if(i){if(i.x>=c)return}else i={x:h,y:r*h+u};f={x:c,y:r*c+u}}else{if(i){if(i.x<h)return}else i={x:c,y:r*c+u};f={x:h,y:r*h+u}}return n.a=i,n.b=f,!0}function wy(n,t){this.l=n;this.r=t;this.a=this.b=null}function kr(n,t,i,r){var u=new wy(n,t);return vr.push(u),i&&sf(u,n,t,i),r&&sf(u,t,n,r),ki[n.i].edges.push(new hf(u,n,t)),ki[t.i].edges.push(new hf(u,t,n)),u}function og(n,t,i){var r=new wy(n,null);return r.a=t,r.b=i,vr.push(r),r}function sf(n,t,i,r){n.a||n.b?n.l===i?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=i)}function hf(n,t,i){var r=n.a,u=n.b;this.edge=n;this.site=t;this.angle=i?Math.atan2(i.y-t.y,i.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function ks(){this._=null}function cf(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function dr(n,t){var i=t,r=t.R,u=i.U;u?u.L===i?u.L=r:u.R=r:n._=r;r.U=u;i.U=r;i.R=r.L;i.R&&(i.R.U=i);r.L=i}function gr(n,t){var i=t,r=t.L,u=i.U;u?u.L===i?u.L=r:u.R=r:n._=r;r.U=u;i.U=r;i.L=r.R;i.L&&(i.L.U=i);r.R=i}function by(n){while(n.L)n=n.L;return n}function ds(n,t){var i=n.sort(sg).pop(),u,f,r,e;for(vr=[],ki=new Array(n.length),yr=new ks,lu=new ks;;)if(r=bc,i&&(!r||i.y<r.y||i.y===r.y&&i.x<r.x))(i.x!==u||i.y!==f)&&(ki[i.i]=new yy(i),tg(i),u=i.x,f=i.y),i=n.pop();else if(r)ng(r.arc);else break;return t&&(fg(t),rg(t)),e={cells:ki,edges:vr},yr=lu=vr=ki=null,e}function sg(n,t){return t.y-n.y||t.x-n.x}function hg(n,t,i){return(n.x-i.x)*(t.y-n.y)-(n.x-t.x)*(i.y-n.y)}function cg(n){return n.x}function lg(n){return n.y}function ky(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function nu(n,t,i,r,u,f){if(!n(t,i,r,u,f)){var o=(i+u)*.5,s=(r+f)*.5,e=t.nodes;e[0]&&nu(n,e[0],i,r,o,s);e[1]&&nu(n,e[1],o,r,u,s);e[2]&&nu(n,e[2],i,s,o,f);e[3]&&nu(n,e[3],o,s,u,f)}}function gs(t,i){t=n.rgb(t);i=n.rgb(i);var r=t.r,u=t.g,f=t.b,e=i.r-r,o=i.g-u,s=i.b-f;return function(n){return"#"+rr(Math.round(r+e*n))+rr(Math.round(u+o*n))+rr(Math.round(f+s*n))}}function dy(n,t){var u={},r={},i;for(i in n)i in t?u[i]=ai(n[i],t[i]):r[i]=n[i];for(i in t)i in n||(r[i]=t[i]);return function(n){for(i in u)r[i]=u[i](n);return r}}function ht(n,t){return t-=n=+n,function(i){return n+t*i}}function gy(n,t){var s,u,f,h=0,c=0,r=[],e=[],o,i;for(n=n+"",t=t+"",vu.lastIndex=0,u=0;s=vu.exec(t);++u)s.index&&r.push(t.substring(h,c=s.index)),e.push({i:r.length,x:s[0]}),r.push(null),h=vu.lastIndex;for(h<t.length&&r.push(t.substring(h)),u=0,o=e.length;(s=vu.exec(n))&&u<o;++u)if(i=e[u],i.x==s[0]){if(i.i)if(r[i.i+1]==null)for(r[i.i-1]+=i.x,r.splice(i.i,1),f=u+1;f<o;++f)e[f].i--;else for(r[i.i-1]+=i.x+r[i.i+1],r.splice(i.i,2),f=u+1;f<o;++f)e[f].i-=2;else if(r[i.i+1]==null)r[i.i]=i.x;else for(r[i.i]=i.x+r[i.i+1],r.splice(i.i+1,1),f=u+1;f<o;++f)e[f].i--;e.splice(u,1);o--;u--}else i.x=ht(parseFloat(s[0]),parseFloat(i.x));while(u<o)i=e.pop(),r[i.i+1]==null?r[i.i]=i.x:(r[i.i]=i.x+r[i.i+1],r.splice(i.i+1,1)),o--;return r.length===1?r[0]==null?(i=e[0].x,function(n){return i(n)+""}):function(){return t}:function(n){for(u=0;u<o;++u)r[(i=e[u]).i]=i.x(n);return r.join("")}}function ai(t,i){for(var r=n.interpolators.length,u;--r>=0&&!(u=n.interpolators[r](t,i)););return u}function lf(n,t){for(var u=[],r=[],e=n.length,o=t.length,f=Math.min(n.length,t.length),i=0;i<f;++i)u.push(ai(n[i],t[i]));for(;i<e;++i)r[i]=n[i];for(;i<o;++i)r[i]=t[i];return function(n){for(i=0;i<f;++i)r[i]=u[i](n);return r}}function ag(n){return function(t){return t<=0?0:t>=1?1:n(t)}}function np(n){return function(t){return 1-n(1-t)}}function tp(n){return function(t){return.5*(t<.5?n(2*t):2-n(2-2*t))}}function vg(n){return n*n}function yg(n){return n*n*n}function pg(n){if(n<=0)return 0;if(n>=1)return 1;var t=n*n,i=t*n;return 4*(n<.5?i:3*(n-t)+i-.75)}function wg(n){return function(t){return Math.pow(t,n)}}function bg(n){return 1-Math.cos(n*d)}function kg(n){return Math.pow(2,10*(n-1))}function dg(n){return 1-Math.sqrt(1-n*n)}function gg(n,t){var i;return arguments.length<2&&(t=.45),arguments.length?i=t/k*Math.asin(1/n):(n=1,i=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-i)*k/t)}}function nn(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function tn(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function rn(t,i){t=n.hcl(t);i=n.hcl(i);var u=t.h,f=t.c,o=t.l,r=i.h-u,e=i.c-f,s=i.l-o;return isNaN(e)&&(e=0,f=isNaN(f)?i.c:f),isNaN(r)?(r=0,u=isNaN(u)?i.h:u):r>180?r-=360:r<-180&&(r+=360),function(n){return yo(u+r*n,f+e*n,o+s*n)+""}}function un(t,i){t=n.hsl(t);i=n.hsl(i);var u=t.h,f=t.s,o=t.l,r=i.h-u,e=i.s-f,s=i.l-o;return isNaN(e)&&(e=0,f=isNaN(f)?i.s:f),isNaN(r)?(r=0,u=isNaN(u)?i.h:u):r>180?r-=360:r<-180&&(r+=360),function(n){return vo(u+r*n,f+e*n,o+s*n)+""}}function fn(t,i){t=n.lab(t);i=n.lab(i);var r=t.l,u=t.a,f=t.b,e=i.l-r,o=i.a-u,s=i.b-f;return function(n){return pa(r+e*n,u+o*n,f+s*n)+""}}function ip(n,t){return t-=n,function(i){return Math.round(n+t*i)}}function rp(n){var t=[n.a,n.b],i=[n.c,n.d],r=fp(t),u=up(t,i),f=fp(en(i,t,-u))||0;t[0]*i[1]<i[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1);this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-i[0],i[1]))*s;this.translate=[n.e,n.f];this.scale=[r,f];this.skew=f?Math.atan2(u,f)*s:0}function up(n,t){return n[0]*t[0]+n[1]*t[1]}function fp(n){var t=Math.sqrt(up(n,n));return t&&(n[0]/=t,n[1]/=t),t}function en(n,t,i){return n[0]+=i*t[0],n[1]+=i*t[1],n}function ep(t,i){var r=[],o=[],s,c=n.transform(t),l=n.transform(i),a=c.translate,u=l.translate,h=c.rotate,f=l.rotate,p=c.skew,v=l.skew,y=c.scale,e=l.scale;return a[0]!=u[0]||a[1]!=u[1]?(r.push("translate(",null,",",null,")"),o.push({i:1,x:ht(a[0],u[0])},{i:3,x:ht(a[1],u[1])})):u[0]||u[1]?r.push("translate("+u+")"):r.push(""),h!=f?(h-f>180?f+=360:f-h>180&&(h+=360),o.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:ht(h,f)})):f&&r.push(r.pop()+"rotate("+f+")"),p!=v?o.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:ht(p,v)}):v&&r.push(r.pop()+"skewX("+v+")"),y[0]!=e[0]||y[1]!=e[1]?(s=r.push(r.pop()+"scale(",null,",",null,")"),o.push({i:s-4,x:ht(y[0],e[0])},{i:s-2,x:ht(y[1],e[1])})):(e[0]!=1||e[1]!=1)&&r.push(r.pop()+"scale("+e+")"),s=o.length,function(n){for(var t=-1,i;++t<s;)r[(i=o[t]).i]=i.x(n);return r.join("")}}function on(n,t){return t=t-(n=+n)?1/(t-n):0,function(i){return(i-n)*t}}function sn(n,t){return t=t-(n=+n)?1/(t-n):0,function(i){return Math.max(0,Math.min(1,(i-n)*t))}}function hn(n){for(var t=n.source,i=n.target,u=cn(t,i),r=[t],f;t!==u;)t=t.parent,r.push(t);for(f=r.length;i!==u;)r.splice(f,0,i),i=i.parent;return r}function op(n){for(var i=[],t=n.parent;t!=null;)i.push(n),n=t,t=t.parent;return i.push(n),i}function cn(n,t){if(n===t)return n;for(var r=op(n),u=op(t),i=r.pop(),f=u.pop(),e=null;i===f;)e=i,i=r.pop(),f=u.pop();return e}function ln(n){n.fixed|=2}function an(n){n.fixed&=-7}function vn(n){n.fixed|=4;n.px=n.x;n.py=n.y}function yn(n){n.fixed&=-5}function sp(n,t,i){var f=0,e=0,u;if(n.charge=0,!n.leaf)for(var o=n.nodes,h=o.length,s=-1,r;++s<h;)(r=o[s],r!=null)&&(sp(r,t,i),n.charge+=r.charge,f+=r.charge*r.cx,e+=r.charge*r.cy);n.point&&(n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5),u=t*i[n.point.index],n.charge+=n.pointCharge=u,f+=u*n.point.x,e+=u*n.point.y);n.cx=f/n.charge;n.cy=e/n.charge}function tu(t,i){return n.rebind(t,i,"sort","children","value"),t.nodes=t,t.links=kn,t}function pn(n){return n.children}function wn(n){return n.value}function bn(n,t){return t.value-n.value}function kn(t){return n.merge(t.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function dn(n){return n.x}function gn(n){return n.y}function ntt(n,t,i){n.y0=t;n.y=i}function nh(t){return n.range(t.length)}function th(n){for(var t=-1,r=n[0].length,i=[];++t<r;)i[t]=0;return i}function ttt(n){for(var t=1,i=0,r=n[0][1],u,f=n.length;t<f;++t)(u=n[t][1])>r&&(i=t,r=u);return i}function itt(n){return n.reduce(rtt,0)}function rtt(n,t){return n+t[1]}function utt(n,t){return hp(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function hp(n,t){for(var i=-1,r=+n[0],f=(n[1]-r)/t,u=[];++i<=t;)u[i]=f*i+r;return u}function ftt(t){return[n.min(t),n.max(t)]}function cp(n,t){return n.parent==t.parent?1:2}function ih(n){var t=n.children;return t&&t.length?t[0]:n._tree.thread}function rh(n){var t=n.children,i;return t&&(i=t.length)?t[i-1]:n._tree.thread}function af(n,t){var i=n.children,u,f,r;if(i&&(f=i.length))for(r=-1;++r<f;)t(u=af(i[r],t),n)>0&&(n=u);return n}function ett(n,t){return n.x-t.x}function ott(n,t){return t.x-n.x}function stt(n,t){return n.depth-t.depth}function ct(n,t){function i(n,r){var u=n.children,f,e,o,s;if(u&&(s=u.length))for(e=null,o=-1;++o<s;)f=u[o],i(f,e),e=f;t(n,r)}i(n,null)}function htt(n){for(var i=0,f=0,r=n.children,u=r.length,t;--u>=0;)t=r[u]._tree,t.prelim+=i,t.mod+=i,i+=t.shift+(f+=t.change)}function ctt(n,t,i){n=n._tree;t=t._tree;var r=i/(t.number-n.number);n.change+=r;t.change-=r;t.shift+=i;t.prelim+=i;t.mod+=i}function ltt(n,t,i){return n._tree.ancestor.parent==t.parent?n._tree.ancestor:i}function att(n,t){return n.value-t.value}function uh(n,t){var i=n._pack_next;n._pack_next=t;t._pack_prev=n;t._pack_next=i;i._pack_prev=t}function lp(n,t){n._pack_next=t;t._pack_prev=n}function ap(n,t){var i=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>i*i+r*r}function vp(n){function h(n){c=Math.min(n.x-n.r,c);l=Math.max(n.x+n.r,l);a=Math.min(n.y-n.r,a);v=Math.max(n.y+n.r,v)}if((u=n.children)&&(s=u.length)){var u,c=Infinity,l=-Infinity,a=Infinity,v=-Infinity,i,r,t,f,e,o,s;if(u.forEach(vtt),i=u[0],i.x=-i.r,i.y=0,h(i),s>1&&(r=u[1],r.x=r.r,r.y=0,h(r),s>2))for(t=u[2],pp(i,r,t),h(t),uh(i,t),i._pack_prev=t,uh(t,r),r=i._pack_next,f=3;f<s;f++){pp(i,r,t=u[f]);var y=0,p=1,w=1;for(e=r._pack_next;e!==r;e=e._pack_next,p++)if(ap(e,t)){y=1;break}if(y==1)for(o=i._pack_prev;o!==e._pack_prev;o=o._pack_prev,w++)if(ap(o,t))break;y?(p<w||p==w&&r.r<i.r?lp(i,r=e):lp(i=o,r),f--):(uh(i,t),r=t,h(t))}var k=(c+l)/2,d=(a+v)/2,b=0;for(f=0;f<s;f++)t=u[f],t.x-=k,t.y-=d,b=Math.max(b,t.r+Math.sqrt(t.x*t.x+t.y*t.y));n.r=b;u.forEach(ytt)}}function vtt(n){n._pack_next=n._pack_prev=n}function ytt(n){delete n._pack_next;delete n._pack_prev}function yp(n,t,i,r){var u=n.children,f,e;if(n.x=t+=r*n.x,n.y=i+=r*n.y,n.r*=r,u)for(f=-1,e=u.length;++f<e;)yp(u[f],t,i,r)}function pp(n,t,i){var r=n.r+i.r,f=t.x-n.x,e=t.y-n.y,u,o,s,h;r&&(f||e)?(u=t.r+i.r,o=f*f+e*e,u*=u,r*=r,s=.5+(r-u)/(2*o),h=Math.sqrt(Math.max(0,2*u*(r+o)-(r-=o)*r-u*u))/(2*o),i.x=n.x+s*f+h*e,i.y=n.y+s*e-h*f):(i.x=n.x+r,i.y=n.y)}function ptt(t){return 1+n.max(t,function(n){return n.y})}function wtt(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function wp(n){var t=n.children;return t&&t.length?wp(t[0]):n}function bp(n){var t=n.children,i;return t&&(i=t.length)?bp(t[i-1]):n}function fh(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function kp(n,t){var u=n.x+t[3],f=n.y+t[0],i=n.dx-t[1]-t[3],r=n.dy-t[0]-t[2];return i<0&&(u+=i/2,i=0),r<0&&(f+=r/2,r=0),{x:u,y:f,dx:i,dy:r}}function hr(n){var t=n[0],i=n[n.length-1];return t<i?[t,i]:[i,t]}function vf(n){return n.rangeExtent?n.rangeExtent():hr(n.range())}function btt(n,t,i,r){var u=i(n[0],n[1]),f=r(t[0],t[1]);return function(n){return f(u(n))}}function eh(n,t){var i=0,r=n.length-1,u=n[i],f=n[r],e;return f<u&&(e=i,i=r,r=e,e=u,u=f,f=e),n[i]=t.floor(u),n[r]=t.ceil(f),n}function ktt(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:cb}function dtt(t,i,r,u){var o=[],s=[],f=0,e=Math.min(t.length,i.length)-1;for(t[e]<t[0]&&(t=t.slice().reverse(),i=i.slice().reverse());++f<=e;)o.push(r(t[f-1],t[f])),s.push(u(i[f-1],i[f]));return function(i){var r=n.bisect(t,i,1,e)-1;return s[r](o[r](i))}}function dp(n,t,i,r){function f(){var f=Math.min(n.length,t.length)>2?dtt:btt,s=r?sn:on;return e=f(n,t,s,i),o=f(t,n,s,ai),u}function u(n){return e(n)}var e,o;return u.invert=function(n){return o(n)},u.domain=function(t){return arguments.length?(n=t.map(Number),f()):n},u.range=function(n){return arguments.length?(t=n,f()):t},u.rangeRound=function(n){return u.range(n).interpolate(ip)},u.clamp=function(n){return arguments.length?(r=n,f()):r},u.interpolate=function(n){return arguments.length?(i=n,f()):i},u.ticks=function(t){return sh(n,t)},u.tickFormat=function(t,i){return hh(n,t,i)},u.nice=function(t){return gp(n,t),f()},u.copy=function(){return dp(n,t,i,r)},f()}function oh(t,i){return n.rebind(t,i,"range","rangeRound","interpolate","clamp")}function gp(n,t){return eh(n,ktt(iu(n,t)[2]))}function iu(n,t){t==null&&(t=10);var r=hr(n),f=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(f/t)/Math.LN10)),u=t/f*i;return u<=.15?i*=10:u<=.35?i*=5:u<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+i*.5,r[2]=i,r}function sh(t,i){return n.range.apply(n,iu(t,i))}function hh(t,i,r){var u=iu(t,i);return n.format(r?r.replace(uc,function(n,t,i,r,f,e,o,s,h,c){return[t,i,r,f,e,o,s,h||"."+gtt(c,u),c].join("")}):",."+ch(u[2])+"f")}function ch(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function gtt(n,t){var i=ch(t[2]);return n in lb?Math.abs(i-ch(Math.max(Math.abs(t[0]),Math.abs(t[1]))))+ +(n!=="e"):i-(n==="%")*2}function nw(t,i,r,u){function e(n){return(r?Math.log(n<0?0:n):-Math.log(n>0?0:-n))/Math.log(i)}function o(n){return r?Math.pow(i,n):-Math.pow(i,-n)}function f(n){return t(e(n))}return f.invert=function(n){return o(t.invert(n))},f.domain=function(n){return arguments.length?(r=n[0]>=0,t.domain((u=n.map(Number)).map(e)),f):u},f.base=function(n){return arguments.length?(i=+n,t.domain(u.map(e)),f):i},f.nice=function(){var n=eh(u.map(e),r?Math:ab);return t.domain(n),u=n.map(o),f},f.ticks=function(){var h=hr(u),t=[],c=h[0],l=h[1],n=Math.floor(e(c)),s=Math.ceil(e(l)),a=i%1?2:i,f;if(isFinite(s-n)){if(r){for(;n<s;n++)for(f=1;f<a;f++)t.push(o(n)*f);t.push(o(n))}else for(t.push(o(n));n++<s;)for(f=a-1;f>0;f--)t.push(o(n)*f);for(n=0;t[n]<c;n++);for(s=t.length;t[s-1]>l;s--);t=t.slice(n,s)}return t},f.tickFormat=function(t,i){if(!arguments.length)return gc;arguments.length<2?i=gc:typeof i!="function"&&(i=n.format(i));var s=Math.max(.1,t/f.ticks().length),h=r?(u=1e-12,Math.ceil):(u=-1e-12,Math.floor),u;return function(n){return n/o(h(e(n)+u))<=s?i(n):""}},f.copy=function(){return nw(t.copy(),i,r,u)},oh(f,t)}function tw(n,t,i){function r(t){return n(u(t))}var u=yf(t),f=yf(1/t);return r.invert=function(t){return f(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((i=t.map(Number)).map(u)),r):i},r.ticks=function(n){return sh(i,n)},r.tickFormat=function(n,t){return hh(i,n,t)},r.nice=function(n){return r.domain(gp(i,n))},r.exponent=function(e){return arguments.length?(u=yf(t=e),f=yf(1/t),n.domain(i.map(u)),r):t},r.copy=function(){return tw(n.copy(),t,i)},oh(r,n)}function yf(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function iw(t,i){function r(n){return u[((f.get(n)||i.t==="range"&&f.set(n,t.push(n)))-1)%u.length]}function o(i,r){return n.range(t.length).map(function(n){return i+r*n})}var f,u,e;return r.domain=function(n){if(!arguments.length)return t;t=[];f=new ut;for(var e=-1,o=n.length,u;++e<o;)f.has(u=n[e])||f.set(u,t.push(u));return r[i.t].apply(r,i.a)},r.range=function(n){return arguments.length?(u=n,e=0,i={t:"range",a:arguments},r):u},r.rangePoints=function(n,f){arguments.length<2&&(f=0);var s=n[0],h=n[1],c=(h-s)/(Math.max(1,t.length-1)+f);return u=o(t.length<2?(s+h)/2:s+c*f/2,c),e=0,i={t:"rangePoints",a:arguments},r},r.rangeBands=function(n,f,s){arguments.length<2&&(f=0);arguments.length<3&&(s=f);var h=n[1]<n[0],l=n[+h],a=n[1-h],c=(a-l)/(t.length-f+2*s);return u=o(l+c*s,c),h&&u.reverse(),e=c*(1-f),i={t:"rangeBands",a:arguments},r},r.rangeRoundBands=function(n,f,s){arguments.length<2&&(f=0);arguments.length<3&&(s=f);var h=n[1]<n[0],c=n[+h],a=n[1-h],l=Math.floor((a-c)/(t.length-f+2*s)),v=a-c-(t.length-f)*l;return u=o(c+Math.round(v/2),l),h&&u.reverse(),e=Math.round(l*(1-f)),i={t:"rangeRoundBands",a:arguments},r},r.rangeBand=function(){return e},r.rangeExtent=function(){return hr(i.a[0])},r.copy=function(){return iw(t,i)},r.domain(t)}function rw(t,i){function f(){var f=0,e=i.length;for(r=[];++f<e;)r[f-1]=n.quantile(t,f/e);return u}function u(t){if(!isNaN(t=+t))return i[n.bisect(r,t)]}var r;return u.domain=function(i){return arguments.length?(t=i.filter(function(n){return!isNaN(n)}).sort(n.ascending),f()):t},u.range=function(n){return arguments.length?(i=n,f()):i},u.quantiles=function(){return r},u.invertExtent=function(n){return n=i.indexOf(n),n<0?[NaN,NaN]:[n>0?r[n-1]:t[0],n<r.length?r[n]:t[t.length-1]]},u.copy=function(){return rw(t,i)},f()}function uw(n,t,i){function r(t){return i[Math.max(0,Math.min(e,Math.floor(u*(t-n))))]}function f(){return u=i.length/(t-n),e=i.length-1,r}var u,e;return r.domain=function(i){return arguments.length?(n=+i[0],t=+i[i.length-1],f()):[n,t]},r.range=function(n){return arguments.length?(i=n,f()):i},r.invertExtent=function(t){return t=i.indexOf(t),t=t<0?NaN:t/u+n,[t,t+1/u]},r.copy=function(){return uw(n,t,i)},f()}function fw(t,i){function r(r){if(r<=r)return i[n.bisect(t,r)]}return r.domain=function(n){return arguments.length?(t=n,r):t},r.range=function(n){return arguments.length?(i=n,r):i},r.invertExtent=function(n){return n=i.indexOf(n),[t[n-1],t[n]]},r.copy=function(){return fw(t,i)},r}function ew(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(i){return arguments.length?(n=i.map(t),t):n},t.ticks=function(t){return sh(n,t)},t.tickFormat=function(t,i){return hh(n,t,i)},t.copy=function(){return ew(n)},t}function nit(n){return n.innerRadius}function tit(n){return n.outerRadius}function ow(n){return n.startAngle}function sw(n){return n.endAngle}function hw(n){function t(t){function a(){c.push("M",i(n(s),e))}for(var c=[],s=[],h=-1,v=t.length,l,y=o(r),p=o(u);++h<v;)f.call(this,l=t[h],h)?s.push([+y.call(this,l,h),+p.call(this,l,h)]):s.length&&(a(),s=[]);return s.length&&a(),c.length?c.join(""):null}var r=li,u=er,f=fr,i=g,s=i.key,e=.7;return t.x=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(u=n,t):u},t.defined=function(n){return arguments.length?(f=n,t):f},t.interpolate=function(n){return arguments.length?(s=typeof n=="function"?i=n:(i=be.get(n)||g).key,t):s},t.tension=function(n){return arguments.length?(e=n,t):e},t}function g(n){return n.join("L")}function iit(n){return g(n)+"Z"}function rit(n){for(var r=0,u=n.length,t=n[0],i=[t[0],",",t[1]];++r<u;)i.push("H",(t[0]+(t=n[r])[0])/2,"V",t[1]);return u>1&&i.push("H",t[0]),i.join("")}function lh(n){for(var i=0,u=n.length,t=n[0],r=[t[0],",",t[1]];++i<u;)r.push("V",(t=n[i])[1],"H",t[0]);return r.join("")}function ah(n){for(var i=0,u=n.length,t=n[0],r=[t[0],",",t[1]];++i<u;)r.push("H",(t=n[i])[0],"V",t[1]);return r.join("")}function uit(n,t){return n.length<4?g(n):n[1]+pf(n.slice(1,n.length-1),vh(n,t))}function fit(n,t){return n.length<3?g(n):n[0]+pf((n.push(n[0]),n),vh([n[n.length-2]].concat(n,[n[1]]),t))}function eit(n,t){return n.length<3?g(n):n[0]+pf(n,vh(n,t))}function pf(n,t){var o,s;if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return g(n);var c=n.length!=t.length,f="",h=n[0],i=n[1],e=t[0],r=e,u=1;if(c&&(f+="Q"+(i[0]-e[0]*2/3)+","+(i[1]-e[1]*2/3)+","+i[0]+","+i[1],h=n[1],u=2),t.length>1)for(r=t[1],i=n[u],u++,f+="C"+(h[0]+e[0])+","+(h[1]+e[1])+","+(i[0]-r[0])+","+(i[1]-r[1])+","+i[0]+","+i[1],o=2;o<t.length;o++,u++)i=n[u],r=t[o],f+="S"+(i[0]-r[0])+","+(i[1]-r[1])+","+i[0]+","+i[1];return c&&(s=n[u],f+="Q"+(i[0]+r[0]*2/3)+","+(i[1]+r[1]*2/3)+","+s[0]+","+s[1]),f}function vh(n,t){for(var u=[],f=(1-t)/2,r,e=n[0],i=n[1],o=1,s=n.length;++o<s;)r=e,e=i,i=n[o],u.push([f*(i[0]-r[0]),f*(i[1]-r[1])]);return u}function cw(n){if(n.length<3)return g(n);var o=1,s=n.length,t=n[0],i=t[0],r=t[1],u=[i,i,i,(t=n[1])[0]],f=[r,r,r,t[1]],e=[i,",",r,"L",nt(oi,u),",",nt(oi,f)];for(n.push(n[s-1]);++o<=s;)t=n[o],u.shift(),u.push(t[0]),f.shift(),f.push(t[1]),yh(e,u,f);return n.pop(),e.push("L",t),e.join("")}function oit(n){if(n.length<4)return g(n);for(var f=[],i=-1,e=n.length,t,r=[0],u=[0];++i<3;)t=n[i],r.push(t[0]),u.push(t[1]);for(f.push(nt(oi,r)+","+nt(oi,u)),--i;++i<e;)t=n[i],r.shift(),r.push(t[0]),u.shift(),u.push(t[1]),yh(f,r,u);return f.join("")}function sit(n){for(var f,i=-1,e=n.length,o=e+4,t,r=[],u=[];++i<4;)t=n[i%e],r.push(t[0]),u.push(t[1]);for(f=[nt(oi,r),",",nt(oi,u)],--i;++i<o;)t=n[i%e],r.shift(),r.push(t[0]),u.shift(),u.push(t[1]),yh(f,r,u);return f.join("")}function hit(n,t){var i=n.length-1;if(i)for(var e=n[0][0],o=n[0][1],s=n[i][0]-e,h=n[i][1]-o,u=-1,r,f;++u<=i;)r=n[u],f=u/i,r[0]=t*r[0]+(1-t)*(e+f*s),r[1]=t*r[1]+(1-t)*(o+f*h);return cw(n)}function nt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function yh(n,t,i){n.push("C",nt(rk,t),",",nt(rk,i),",",nt(uk,t),",",nt(uk,i),",",nt(oi,t),",",nt(oi,i))}function ph(n,t){return(t[1]-n[1])/(t[0]-n[0])}function cit(n){for(var t=0,e=n.length-1,i=[],f=n[0],r=n[1],u=i[0]=ph(f,r);++t<e;)i[t]=(u+(u=ph(f=r,r=n[t+1])))/2;return i[t]=u,i}function lit(n){for(var c=[],e,o,s,r,f=cit(n),i=-1,h=n.length-1;++i<h;)e=ph(n[i],n[i+1]),u(e)<t?f[i]=f[i+1]=0:(o=f[i]/e,s=f[i+1]/e,r=o*o+s*s,r>9&&(r=e*3/Math.sqrt(r),f[i]=r*o,f[i+1]=r*s));for(i=-1;++i<=h;)r=(n[Math.min(h,i+1)][0]-n[Math.max(0,i-1)][0])/(6*(1+f[i]*f[i])),c.push([r||0,f[i]*r||0]);return c}function ait(n){return n.length<3?g(n):n[0]+pf(n,lit(n))}function lw(n){for(var t,u=-1,f=n.length,i,r;++u<f;)t=n[u],i=t[0],r=t[1]+ui,t[0]=i*Math.cos(r),t[1]=i*Math.sin(r);return n}function aw(n){function t(t){function b(){p.push("M",i(n(w),s),a,l(n(v.reverse()),s),"Z")}for(var p=[],v=[],w=[],c=-1,g=t.length,y,nt=o(f),tt=o(e),it=f===r?function(){return k}:o(r),rt=e===u?function(){return d}:o(u),k,d;++c<g;)h.call(this,y=t[c],c)?(v.push([k=+nt.call(this,y,c),d=+tt.call(this,y,c)]),w.push([+it.call(this,y,c),+rt.call(this,y,c)])):v.length&&(b(),v=[],w=[]);return v.length&&b(),p.length?p.join(""):null}var f=li,r=li,e=0,u=er,h=fr,i=g,c=i.key,l=i,a="L",s=.7;return t.x=function(n){return arguments.length?(f=r=n,t):r},t.x0=function(n){return arguments.length?(f=n,t):f},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(e=u=n,t):u},t.y0=function(n){return arguments.length?(e=n,t):e},t.y1=function(n){return arguments.length?(u=n,t):u},t.defined=function(n){return arguments.length?(h=n,t):h},t.interpolate=function(n){return arguments.length?(c=typeof n=="function"?i=n:(i=be.get(n)||g).key,l=i.reverse||i,a=i.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(s=n,t):s},t}function vit(n){return n.radius}function vw(n){return[n.x,n.y]}function yit(n){return function(){var t=n.apply(this,arguments),i=t[0],r=t[1]+ui;return[i*Math.cos(r),i*Math.sin(r)]}}function pit(){return 64}function wit(){return"circle"}function yw(n){var t=Math.sqrt(n/f);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function ru(n,t){return uu(n,l),n.id=t,n}function wh(n,t,i,r){var u=n.id;return dt(n,typeof i=="function"?function(n,f,e){n.__transition__[u].tween.set(t,r(i.call(n,n.__data__,f,e)))}:(i=r(i),function(n){n.__transition__[u].tween.set(t,i)}))}function bit(n){return n==null&&(n=""),function(){this.textContent=n}}function wf(t,i,r,u){var e=t.__transition__||(t.__transition__={active:0,count:0}),f=e[r],o;f||(o=u.time,f=e[r]={tween:new ut,time:o,ease:u.ease,delay:u.delay,duration:u.duration},++e.count,n.timer(function(u){function v(u){if(e.active>r)return s();e.active=r;f.event&&f.event.start.call(t,h,i);f.tween.forEach(function(n,r){(r=r.call(t,h,i))&&a.push(r)});n.timer(function(){return l.c=y(u||1)?fr:y,1},0,o)}function y(n){if(e.active!==r)return s();for(var u=n/w,c=p(u),o=a.length;o>0;)a[--o].call(t,c);if(u>=1)return f.event&&f.event.end.call(t,h,i),s()}function s(){return--e.count?delete e[r]:delete t.__transition__,1}var h=t.__data__,p=f.ease,c=f.delay,w=f.duration,l=vt,a=[];if(l.t=c+o,c<=u)return v(u-c);l.c=v},0,o))}function pw(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function ww(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function lt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function vi(n,t,i){function e(t){var i=n(t),r=f(i,1);return t-i<r-t?i:r}function u(i){return t(i=n(new y(i-1)),1),i}function f(n,i){return t(n=new y(+n),i),n}function o(n,r,f){var e=u(n),o=[];if(f>1)while(e<r)i(e)%f||o.push(new Date(+e)),t(e,1);else while(e<r)o.push(new Date(+e)),t(e,1);return o}function s(n,t,i){try{y=lt;var r=new lt;return r._=n,o(r,t,i)}finally{y=Date}}n.floor=n;n.round=e;n.ceil=u;n.offset=f;n.range=o;var r=n.utc=bf(n);return r.floor=r,r.round=bf(e),r.ceil=bf(u),r.offset=bf(f),r.range=s,n}function bf(n){return function(t,i){try{y=lt;var r=new lt;return r._=t,n(r,i)._}finally{y=Date}}}function p(n){function t(t){for(var f=[],r=-1,e=0,u,o,s;++r<i;)n.charCodeAt(r)===37&&(f.push(n.substring(e,r)),(o=ck[u=n.charAt(++r)])!=null&&(u=n.charAt(++r)),(s=io[u])&&(u=s(t,o==null?u==="e"?" ":"0":o)),f.push(u),e=r+1);return f.push(n.substring(e,r)),f.join("")}var i=n.length;return t.parse=function(t){var i={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},f=kf(i,n,t,0),u,r;return f!=t.length?null:("p"in i&&(i.H=i.H%12+i.p*12),u=i.Z!=null&&y!==lt,r=new(u?lt:y),"j"in i?r.setFullYear(i.y,0,i.j):"w"in i&&("W"in i||"U"in i)?(r.setFullYear(i.y,0,1),r.setFullYear(i.y,0,"W"in i?(i.w+6)%7+i.W*7-(r.getDay()+5)%7:i.w+i.U*7-(r.getDay()+6)%7)):r.setFullYear(i.y,i.m,i.d),r.setHours(i.H+Math.floor(i.Z/100),i.M+i.Z%100,i.S,i.L),u?r._:r)},t.toString=function(){return n},t}function kf(n,t,i,r){for(var f,e,o,u=0,s=t.length,h=i.length;u<s;){if(r>=h)return-1;if(f=t.charCodeAt(u++),f===37){if(o=t.charAt(u++),e=dut[o in ck?t.charAt(u++):o],!e||(r=e(n,i,r))<0)return-1}else if(f!=i.charCodeAt(r++))return-1}return r}function df(t){return new RegExp("^(?:"+t.map(n.requote).join("|")+")","i")}function gf(n){for(var i=new ut,t=-1,r=n.length;++t<r;)i.set(n[t].toLowerCase(),t);return i}function w(n,t,i){var u=n<0?"-":"",r=(u?-n:n)+"",f=r.length;return u+(f<i?new Array(i-f+1).join(t)+r:r)}function kit(n,t,i){ek.lastIndex=0;var r=ek.exec(t.substring(i));return r?(n.w=wut.get(r[0].toLowerCase()),i+r[0].length):-1}function dit(n,t,i){fk.lastIndex=0;var r=fk.exec(t.substring(i));return r?(n.w=put.get(r[0].toLowerCase()),i+r[0].length):-1}function git(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i,i+1));return r?(n.w=+r[0],i+r[0].length):-1}function nrt(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i));return r?(n.U=+r[0],i+r[0].length):-1}function trt(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i));return r?(n.W=+r[0],i+r[0].length):-1}function irt(n,t,i){sk.lastIndex=0;var r=sk.exec(t.substring(i));return r?(n.m=kut.get(r[0].toLowerCase()),i+r[0].length):-1}function rrt(n,t,i){ok.lastIndex=0;var r=ok.exec(t.substring(i));return r?(n.m=but.get(r[0].toLowerCase()),i+r[0].length):-1}function urt(n,t,i){return kf(n,io.c.toString(),t,i)}function frt(n,t,i){return kf(n,io.x.toString(),t,i)}function ert(n,t,i){return kf(n,io.X.toString(),t,i)}function ort(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i,i+4));return r?(n.y=+r[0],i+r[0].length):-1}function srt(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i,i+2));return r?(n.y=crt(+r[0]),i+r[0].length):-1}function hrt(n,t,i){return/^[+-]\d{4}$/.test(t=t.substring(i,i+5))?(n.Z=+t,i+5):-1}function crt(n){return n+(n>68?1900:2e3)}function lrt(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i,i+2));return r?(n.m=r[0]-1,i+r[0].length):-1}function bw(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i,i+2));return r?(n.d=+r[0],i+r[0].length):-1}function art(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i,i+3));return r?(n.j=+r[0],i+r[0].length):-1}function kw(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i,i+2));return r?(n.H=+r[0],i+r[0].length):-1}function vrt(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i,i+2));return r?(n.M=+r[0],i+r[0].length):-1}function yrt(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i,i+2));return r?(n.S=+r[0],i+r[0].length):-1}function prt(n,t,i){h.lastIndex=0;var r=h.exec(t.substring(i,i+3));return r?(n.L=+r[0],i+r[0].length):-1}function wrt(n,t,i){var r=pb.get(t.substring(i,i+=2).toLowerCase());return r==null?-1:(n.p=r,i)}function brt(n){var t=n.getTimezoneOffset(),i=t>0?"-":"+",r=~~(u(t)/60),f=u(t)%60;return i+w(r,"0",2)+w(f,"0",2)}function krt(n,t,i){hk.lastIndex=0;var r=hk.exec(t.substring(i,i+1));return r?i+r[0].length:-1}function ft(n){function t(n){try{y=lt;var t=new y;return t._=n,i(t)}finally{y=Date}}var i=p(n);return t.parse=function(n){try{y=lt;var t=i.parse(n);return t&&t._}finally{y=Date}},t.toString=i.toString,t}function bh(n){return n.toISOString()}function kh(t,i,r){function u(n){return t(n)}function f(t,r){var e=t[1]-t[0],f=e/r,u=n.bisect(ro,f);return u==ro.length?[i.year,iu(t.map(function(n){return n/31536e6}),r)[2]]:u?i[f/ro[u-1]<ro[u]/f?u-1:u]:[tft,iu(t,r)[2]]}return u.invert=function(n){return yi(t.invert(n))},u.domain=function(n){return arguments.length?(t.domain(n),u):t.domain().map(yi)},u.nice=function(n,t){function r(i){return!isNaN(i)&&!n.range(i,yi(+i+1),t).length}var e=u.domain(),o=hr(e),i=n==null?f(o,10):typeof n=="number"&&f(o,n);return i&&(n=i[0],t=i[1]),u.domain(eh(e,t>1?{floor:function(t){while(r(t=n.floor(t)))t=yi(t-1);return t},ceil:function(t){while(r(t=n.ceil(t)))t=yi(+t+1);return t}}:n))},u.ticks=function(n,t){var i=hr(u.domain()),r=n==null?f(i,10):typeof n=="number"?f(i,n):!n.range&&[{range:n},t];return r&&(n=r[0],t=r[1]),n.range(i[0],yi(+i[1]+1),t<1?1:t)},u.tickFormat=function(){return r},u.copy=function(){return kh(t.copy(),i,r)},oh(u,t)}function yi(n){return new Date(n)}function dw(n){return function(t){for(var r=n.length-1,i=n[r];!i[1](t);)i=n[--r];return i[0](t)}}function drt(n){return JSON.parse(n.responseText)}function grt(n){var t=rt.createRange();return t.selectNode(rt.body),t.createContextualFragment(n.responseText)}var n={version:"3.3.10"},dh,u,at,gh,nc,gw,uu,e,ne,et,tc,te,cr,nb,ie,ic,re,tb,ue,fe,fu,eu,ee,oe,se,he,vt,rc,uc,ib,ce,rb,ou,fc,ec,le,ni,b,su,ae,pi,wi,yt,ti,ii,ot,lr,ar,ri,tt,oc,hu,sc,hc,pt,ve,ye,pe,we,ub,it,cc,bi,lc,ac,vc,yc,pc,cu,vr,ki,yr,wc,bc,lu,kc,au,vu,fb,eb,ob,dc,sb,hb,cb,lb,gc,ab,ui,vb,be,nl,yu,tl,l,il,di,ke,rl,yb,h,pb,ul;Date.now||(Date.now=function(){return+new Date});var wb=[].slice,fi=function(n){return wb.call(n)},rt=document,ei=rt.documentElement,v=window;try{fi(ei.childNodes)[0].nodeType}catch(uft){fi=function(n){for(var t=n.length,i=new Array(t);t--;)i[t]=n[t];return i}}try{rt.createElement("div").style.setProperty("opacity",0,"")}catch(fft){var de=v.Element.prototype,nut=de.setAttribute,tut=de.setAttributeNS,bb=v.CSSStyleDeclaration.prototype,iut=bb.setProperty;de.setAttribute=function(n,t){nut.call(this,n,t+"")};de.setAttributeNS=function(n,t,i){tut.call(this,n,t,i+"")};bb.setProperty=function(n,t,i){iut.call(this,n,t+"",i)}}n.ascending=function(n,t){return n<t?-1:n>t?1:n>=t?0:NaN};n.descending=function(n,t){return t<n?-1:t>n?1:t>=n?0:NaN};n.min=function(n,t){var r=-1,f=n.length,i,u;if(arguments.length===1){while(++r<f&&!((i=n[r])!=null&&i<=i))i=undefined;while(++r<f)(u=n[r])!=null&&i>u&&(i=u)}else{while(++r<f&&!((i=t.call(n,n[r],r))!=null&&i<=i))i=undefined;while(++r<f)(u=t.call(n,n[r],r))!=null&&i>u&&(i=u)}return i};n.max=function(n,t){var r=-1,f=n.length,i,u;if(arguments.length===1){while(++r<f&&!((i=n[r])!=null&&i<=i))i=undefined;while(++r<f)(u=n[r])!=null&&u>i&&(i=u)}else{while(++r<f&&!((i=t.call(n,n[r],r))!=null&&i<=i))i=undefined;while(++r<f)(u=t.call(n,n[r],r))!=null&&u>i&&(i=u)}return i};n.extent=function(n,t){var r=-1,e=n.length,i,u,f;if(arguments.length===1){while(++r<e&&!((i=f=n[r])!=null&&i<=i))i=f=undefined;while(++r<e)(u=n[r])!=null&&(i>u&&(i=u),f<u&&(f=u))}else{while(++r<e&&!((i=f=t.call(n,n[r],r))!=null&&i<=i))i=undefined;while(++r<e)(u=t.call(n,n[r],r))!=null&&(i>u&&(i=u),f<u&&(f=u))}return[i,f]};n.sum=function(n,t){var u=0,f=n.length,r,i=-1;if(arguments.length===1)while(++i<f)isNaN(r=+n[i])||(u+=r);else while(++i<f)isNaN(r=+t.call(n,n[i],i))||(u+=r);return u};n.mean=function(n,t){var e=n.length,u,i=0,r=-1,f=0;if(arguments.length===1)while(++r<e)uo(u=n[r])&&(i+=(u-i)/++f);else while(++r<e)uo(u=t.call(n,n[r],r))&&(i+=(u-i)/++f);return f?i:undefined};n.quantile=function(n,t){var u=(n.length-1)*t+1,i=Math.floor(u),r=+n[i-1],f=u-i;return f?r+f*(n[i]-r):r};n.median=function(t,i){return arguments.length>1&&(t=t.map(i)),t=t.filter(uo),t.length?n.quantile(t.sort(n.ascending),.5):undefined};n.bisector=function(n){return{left:function(t,i,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);r<u;){var f=r+u>>>1;n.call(t,t[f],f)<i?r=f+1:u=f}return r},right:function(t,i,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);r<u;){var f=r+u>>>1;i<n.call(t,t[f],f)?u=f:r=f+1}return r}}};dh=n.bisector(function(n){return n});n.bisectLeft=dh.left;n.bisect=n.bisectRight=dh.right;n.shuffle=function(n){for(var t=n.length,r,i;t;)i=Math.random()*t--|0,r=n[t],n[t]=n[i],n[i]=r;return n};n.permute=function(n,t){for(var i=t.length,r=new Array(i);i--;)r[i]=n[t[i]];return r};n.pairs=function(n){for(var t=0,i=n.length-1,f,r=n[0],u=new Array(i<0?0:i);t<i;)u[t]=[f=r,r=n[++t]];return u};n.zip=function(){var t,i,u;if(!(i=arguments.length))return[];for(var r=-1,f=n.min(arguments,ak),e=new Array(f);++r<f;)for(t=-1,u=e[r]=new Array(i);++t<i;)u[t]=arguments[t][r];return e};n.transpose=function(t){return n.zip.apply(n,t)};n.keys=function(n){var t=[],i;for(i in n)t.push(i);return t};n.values=function(n){var t=[],i;for(i in n)t.push(n[i]);return t};n.entries=function(n){var i=[],t;for(t in n)i.push({key:t,value:n[t]});return i};n.merge=function(n){for(var t=n.length,i,e=-1,r=0,u,f;++e<t;)r+=n[e].length;for(u=new Array(r);--t>=0;)for(f=n[t],i=f.length;--i>=0;)u[--r]=f[i];return u};u=Math.abs;n.range=function(n,t,i){if(arguments.length<3&&(i=1,arguments.length<2&&(t=n,n=0)),(t-n)/i==Infinity)throw new Error("infinite range");var e=[],r=vk(u(i)),o=-1,f;if(n*=r,t*=r,i*=r,i<0)while((f=n+i*++o)>t)e.push(f/r);else while((f=n+i*++o)<t)e.push(f/r);return e};n.map=function(n){var t=new ut,i;if(n instanceof ut)n.forEach(function(n,i){t.set(n,i)});else for(i in n)t.set(i,n[i]);return t};wl(ut,{has:function(n){return at+n in this},get:function(n){return this[at+n]},set:function(n,t){return this[at+n]=t},remove:function(n){return n=at+n,n in this&&delete this[n]},keys:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},values:function(){var n=[];return this.forEach(function(t,i){n.push(i)}),n},entries:function(){var n=[];return this.forEach(function(t,i){n.push({key:t,value:i})}),n},forEach:function(n){for(var t in this)t.charCodeAt(0)===gh&&n.call(this,t.substring(1),this[t])}});at="\x00";gh=at.charCodeAt(0);n.nest=function(){function r(n,e,o){if(o>=i.length)return f?f.call(t,e):u?e.sort(u):e;for(var l=-1,y=e.length,p=i[o++],a,s,h,c=new ut,v;++l<y;)(v=c.get(a=p(s=e[l])))?v.push(s):c.set(a,[s]);return n?(s=n(),h=function(t,i){s.set(t,r(n,i,o))}):(s={},h=function(t,i){s[t]=r(n,i,o)}),c.forEach(h),s}function e(n,t){if(t>=i.length)return n;var r=[],u=o[t++];return n.forEach(function(n,i){r.push({key:n,values:e(i,t)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var t={},i=[],o=[],u,f;return t.map=function(n,t){return r(t,n,0)},t.entries=function(t){return e(r(n.map,t,0),0)},t.key=function(n){return i.push(n),t},t.sortKeys=function(n){return o[i.length-1]=n,t},t.sortValues=function(n){return u=n,t},t.rollup=function(n){return f=n,t},t};n.set=function(n){var i=new fo,t,r;if(n)for(t=0,r=n.length;t<r;++t)i.add(n[t]);return i};wl(fo,{has:function(n){return at+n in this},add:function(n){return this[at+n]=!0,n},remove:function(n){return n=at+n,n in this&&delete this[n]},values:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},forEach:function(n){for(var t in this)t.charCodeAt(0)===gh&&n.call(this,t.substring(1))}});n.behavior={};n.rebind=function(n,t){for(var i=1,u=arguments.length,r;++i<u;)n[r=arguments[i]]=yk(n,t,t[r]);return n};nc=["webkit","ms","moz","Moz","o","O"];n.dispatch=function(){for(var n=new oo,t=-1,i=arguments.length;++t<i;)n[arguments[t]]=bl(n);return n};oo.prototype.on=function(n,t){var r=n.indexOf("."),i="";if(r>=0&&(i=n.substring(r+1),n=n.substring(0,r)),n)return arguments.length<2?this[n].on(i):this[n].on(i,t);if(arguments.length===2){if(t==null)for(n in this)if(this.hasOwnProperty(n))this[n].on(i,null);return this}};n.event=null;n.requote=function(n){return n.replace(gw,"\\$&")};gw=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;uu={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var i in t)n[i]=t[i]};var fl=function(n,t){return t.querySelector(n)},el=function(n,t){return t.querySelectorAll(n)},rut=ei[eo(ei,"matchesSelector")],kb=function(n,t){return rut.call(n,t)};typeof Sizzle=="function"&&(fl=function(n,t){return Sizzle(n,t)[0]||null},el=function(n,t){return Sizzle.uniqueSort(Sizzle(n,t))},kb=Sizzle.matchesSelector);n.selection=function(){return tc};e=n.selection.prototype=[];e.select=function(n){var o=[],i,f,e,t,r,s,u,h;for(n=ho(n),r=-1,s=this.length;++r<s;)for(o.push(i=[]),i.parentNode=(e=this[r]).parentNode,u=-1,h=e.length;++u<h;)(t=e[u])?(i.push(f=n.call(t,t.__data__,u,r)),f&&"__data__"in t&&(f.__data__=t.__data__)):i.push(null);return kt(o)};e.selectAll=function(n){var u=[],f,t,i,e;for(n=dl(n),i=-1,e=this.length;++i<e;)for(var o=this[i],r=-1,s=o.length;++r<s;)(t=o[r])&&(u.push(f=fi(n.call(t,t.__data__,r,i))),f.parentNode=t);return kt(u)};ne={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};n.ns={prefix:ne,qualify:function(n){var t=n.indexOf(":"),i=n;return t>=0&&(i=n.substring(0,t),n=n.substring(t+1)),ne.hasOwnProperty(i)?{space:ne[i],local:n}:n}};e.attr=function(t,i){if(arguments.length<2){if(typeof t=="string"){var r=this.node();return t=n.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(i in t)this.each(gl(i,t[i]));return this}return this.each(gl(t,i))};e.classed=function(n,t){if(arguments.length<2){if(typeof n=="string"){var r=this.node(),u=(n=n.trim().split(/^|\s+/g)).length,i=-1;if(t=r.classList){while(++i<u)if(!t.contains(n[i]))return!1}else for(t=r.getAttribute("class");++i<u;)if(!ta(n[i]).test(t))return!1;return!0}for(t in n)this.each(ia(t,n[t]));return this}return this.each(ia(n,t))};e.style=function(n,t,i){var r=arguments.length;if(r<3){if(typeof n!="string"){r<2&&(t="");for(i in n)this.each(ra(i,n[i],t));return this}if(r<2)return v.getComputedStyle(this.node(),null).getPropertyValue(n);i=""}return this.each(ra(n,t,i))};e.property=function(n,t){if(arguments.length<2){if(typeof n=="string")return this.node()[n];for(t in n)this.each(ua(t,n[t]));return this}return this.each(ua(n,t))};e.text=function(n){return arguments.length?this.each(typeof n=="function"?function(){var t=n.apply(this,arguments);this.textContent=t==null?"":t}:n==null?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent};e.html=function(n){return arguments.length?this.each(typeof n=="function"?function(){var t=n.apply(this,arguments);this.innerHTML=t==null?"":t}:n==null?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML};e.append=function(n){return n=fa(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})};e.insert=function(n,t){return n=fa(n),t=ho(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})};e.remove=function(){return this.each(function(){var n=this.parentNode;n&&n.removeChild(this)})};e.data=function(n,t){function e(n,i){var r,l=n.length,a=i.length,k=Math.min(l,a),v=new Array(a),c=new Array(a),y=new Array(l),u,o;if(t){var p=new ut,w=new ut,b=[],e;for(r=-1;++r<l;)e=t.call(u=n[r],u.__data__,r),p.has(e)?y[r]=u:p.set(e,u),b.push(e);for(r=-1;++r<a;)e=t.call(i,o=i[r],r),(u=p.get(e))?(v[r]=u,u.__data__=o):w.has(e)||(c[r]=co(o)),w.set(e,o),p.remove(e);for(r=-1;++r<l;)p.has(b[r])&&(y[r]=n[r])}else{for(r=-1;++r<k;)u=n[r],o=i[r],u?(u.__data__=o,v[r]=u):c[r]=co(o);for(;r<a;++r)c[r]=co(i[r]);for(;r<l;++r)y[r]=n[r]}c.update=v;c.parentNode=v.parentNode=y.parentNode=n.parentNode;s.push(c);f.push(v);h.push(y)}var i=-1,u=this.length,r,o;if(!arguments.length){for(n=new Array(u=(r=this[0]).length);++i<u;)(o=r[i])&&(n[i]=o.__data__);return n}var s=oa([]),f=kt([]),h=kt([]);if(typeof n=="function")while(++i<u)e(r=this[i],n.call(r,r.parentNode.__data__,i));else while(++i<u)e(r=this[i],n);return f.enter=function(){return s},f.exit=function(){return h},f};e.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")};e.filter=function(n){var e=[],u,f,r,t,o,i,s;for(typeof n!="function"&&(n=ea(n)),t=0,o=this.length;t<o;t++)for(e.push(u=[]),u.parentNode=(f=this[t]).parentNode,i=0,s=f.length;i<s;i++)(r=f[i])&&n.call(r,r.__data__,i,t)&&u.push(r);return kt(e)};e.order=function(){for(var i=-1,f=this.length;++i<f;)for(var r=this[i],u=r.length-1,n=r[u],t;--u>=0;)(t=r[u])&&(n&&n!==t.nextSibling&&n.parentNode.insertBefore(t,n),n=t);return this};e.sort=function(n){n=wk.apply(this,arguments);for(var t=-1,i=this.length;++t<i;)this[t].sort(n);return this.order()};e.each=function(n){return dt(this,function(t,i,r){n.call(t,t.__data__,i,r)})};e.call=function(n){var t=fi(arguments);return n.apply(t[0]=this,t),this};e.empty=function(){return!this.node()};e.node=function(){for(var t,n=0,r=this.length;n<r;n++)for(var u=this[n],i=0,f=u.length;i<f;i++)if(t=u[i],t)return t;return null};e.size=function(){var n=0;return this.each(function(){++n}),n};et=[];n.selection.enter=oa;n.selection.enter.prototype=et;et.append=e.append;et.empty=e.empty;et.node=e.node;et.call=e.call;et.size=e.size;et.select=function(n){for(var t,e,o=[],r,s,h,i,u,f=-1,c=this.length;++f<c;)for(h=(i=this[f]).update,o.push(r=[]),r.parentNode=i.parentNode,t=-1,e=i.length;++t<e;)(u=i[t])?(r.push(h[t]=s=n.call(i.parentNode,u.__data__,t,f)),s.__data__=u.__data__):r.push(null);return kt(o)};et.insert=function(n,t){return arguments.length<2&&(t=bk(this)),e.insert.call(this,n,t)};e.transition=function(){for(var i=di||++il,r=[],u,n,o=ke||{time:Date.now(),ease:pg,delay:0,duration:250},f=-1,s=this.length;++f<s;){r.push(u=[]);for(var e=this[f],t=-1,h=e.length;++t<h;)(n=e[t])&&wf(n,t,i,o),u.push(n)}return ru(r,i)};e.interrupt=function(){return this.each(pu)};n.select=function(n){var t=[typeof n=="string"?fl(n,rt):n];return t.parentNode=ei,kt([t])};n.selectAll=function(n){var t=fi(typeof n=="string"?el(n,rt):n);return t.parentNode=ei,kt([t])};tc=n.select(ei);e.on=function(n,t,i){var r=arguments.length;if(r<3){if(typeof n!="string"){r<2&&(t=!1);for(i in n)this.each(sa(i,n[i],t));return this}if(r<2)return(r=this.node()["__on"+n])&&r._;i=!1}return this.each(sa(n,t,i))};te=n.map({mouseenter:"mouseover",mouseleave:"mouseout"});te.forEach(function(n){"on"+n in rt&&te.remove(n)});cr="onselectstart"in rt?null:eo(ei.style,"userSelect");nb=0;n.mouse=function(n){return ca(n,kl())};ie=/WebKit/.test(v.navigator.userAgent)?-1:0;n.touches=function(n,t){return arguments.length<2&&(t=kl().touches),t?fi(t).map(function(t){var i=ca(n,t);return i.identifier=t.identifier,i}):[]};n.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",s)}function f(){return n.event.changedTouches[0].identifier}function e(t,i){return n.touches(t).filter(function(n){return n.identifier===i})[0]}function r(t,r,f,e){return function(){function w(){var n=r(y,h),t=n[0]-s[0],i=n[1]-s[1];p|=t|i;s=n;a({type:"drag",x:n[0]+o[0],y:n[1]+o[1],dx:t,dy:i})}function b(){d.on(f+"."+c,null).on(e+"."+c,null);g(p&&n.event.target===k);a({type:"dragend"})}var l=this,y=l.parentNode,a=u.of(l,arguments),k=n.event.target,h=t(),c=h==null?"drag":"drag-"+h,s=r(y,h),p=0,o,d=n.select(v).on(f+"."+c,w).on(e+"."+c,b),g=wu();i?(o=i.apply(l,arguments),o=[o.x-s[0],o.y-s[1]]):o=[0,0];a({type:"dragstart"})}}var u=so(t,"drag","dragstart","dragend"),i=null,o=r(c,n.mouse,"mousemove","mouseup"),s=r(f,e,"touchmove","touchend");return t.origin=function(n){return arguments.length?(i=n,t):i},n.rebind(t,u,"on")};var f=Math.PI,k=2*f,d=f/2,t=1e-6,ol=t*t,r=f/180,s=180/f,ge=Math.SQRT2,sl=2,db=4;n.interpolateZoom=function(n,t){function v(n){var t=n*p,r,h;return y?(r=lo(u),h=i/(sl*c)*(r*dk(ge*t+u)-va(u)),[o+h*f,s+h*e,i*r/lo(ge*t+u)]):[o+n*f,s+n*e,i*Math.exp(ge*t)]}var o=n[0],s=n[1],i=n[2],w=t[0],b=t[1],r=t[2],f=w-o,e=b-s,h=f*f+e*e,c=Math.sqrt(h),l=(r*r-i*i+db*h)/(2*i*sl*c),a=(r*r-i*i-db*h)/(2*r*sl*c),u=Math.log(Math.sqrt(l*l+1)-l),k=Math.log(Math.sqrt(a*a+1)-a),y=k-u,p=(y||Math.log(r/i))/ge;return v.duration=p*1e3,v};n.behavior.zoom=function(){function i(n){n.on(d,ut).on(tb+".zoom",ht).on(g,et).on("dblclick.zoom",ct).on(nt,ft)}function s(n){return[(n[0]-t.x)/t.k,(n[1]-t.y)/t.k]}function st(n){return[n[0]*t.k+t.x,n[1]*t.k+t.y]}function h(n){t.k=Math.max(a[0],Math.min(a[1],n))}function o(n,i){i=st(i);t.x+=n[0]-i[0];t.y+=n[1]-i[1]}function b(){p&&p.domain(it.range().map(function(n){return(n-t.x)/t.k}).map(it.invert));w&&w.domain(rt.range().map(function(n){return(n-t.y)/t.k}).map(rt.invert))}function u(n){n({type:"zoomstart"})}function r(n){b();n({type:"zoom",scale:t.k,translate:[t.x,t.y]})}function f(n){n({type:"zoomend"})}function ut(){function c(){h=1;o(n.mouse(t),p);r(i)}function l(){y.on(g,v===t?et:null).on(ot,null);w(h&&n.event.target===a);f(i)}var t=this,i=e.of(t,arguments),a=n.event.target,h=0,y=n.select(v).on(g,c).on(ot,l),p=s(n.mouse(t)),w=wu();pu.call(t);u(i)}function ft(){function y(){var r=n.touches(c);return w=t.k,r.forEach(function(n){n.identifier in i&&(i[n.identifier]=s(n))}),r}function p(){for(var u,e,f,c,v=n.event.changedTouches,s=0,k=v.length;s<k;++s)i[v[s].identifier]=null;if(u=y(),e=Date.now(),u.length===1)e-tt<500&&(f=u[0],c=i[f.identifier],h(t.k*2),o(f,c),bt(),r(l)),tt=e;else if(u.length>1){var f=u[0],p=u[1],w=f[0]-p[0],b=f[1]-p[1];a=w*w+b*b}}function it(){for(var f,y,p=n.touches(c),t,e,u,s,v=0,b=p.length;v<b;++v,s=null)if(u=p[v],s=i[u.identifier]){if(e)break;t=u;e=s}s&&(f=(f=u[0]-t[0])*f+(f=u[1]-t[1])*f,y=a&&Math.sqrt(f/a),t=[(t[0]+u[0])/2,(t[1]+u[1])/2],e=[(e[0]+s[0])/2,(e[1]+s[1])/2],h(y*w));tt=null;o(t,e);r(l)}function rt(){var r,t,u,e;if(n.event.touches.length){for(r=n.event.changedTouches,t=0,u=r.length;t<u;++t)delete i[r[t].identifier];for(e in i)return void y()}et.on(k,null).on(g,null);ot.on(d,ut).on(nt,ft);st();f(l)}var c=this,l=e.of(c,arguments),i={},a=0,w,b=n.event.changedTouches[0].identifier,k="touchmove.zoom-"+b,g="touchend.zoom-"+b,et=n.select(v).on(k,it).on(g,rt),ot=n.select(c).on(d,null).on(nt,p),st=wu();pu.call(c);p();u(l)}function ht(){var i=e.of(this,arguments),l;y?clearTimeout(y):(pu.call(this),u(i));y=setTimeout(function(){y=null;f(i)},50);bt();l=k||n.mouse(this);c||(c=s(l));h(Math.pow(2,re()*.002)*t.k);o(l,c);r(i)}function et(){c=null}function ct(){var i=e.of(this,arguments),c=n.mouse(this),a=s(c),l=Math.log(t.k)/Math.LN2;u(i);h(Math.pow(2,n.event.shiftKey?Math.ceil(l)-1:Math.floor(l)+1));o(c,a);r(i);f(i)}var t={x:0,y:0,k:1},c,k,l=[960,500],a=ic,d="mousedown.zoom",g="mousemove.zoom",ot="mouseup.zoom",y,nt="touchstart.zoom",tt,e=so(i,"zoomstart","zoom","zoomend"),it,p,rt,w;return i.event=function(i){i.each(function(){var i=e.of(this,arguments),o=t;di?n.select(this).transition().each("start.zoom",function(){t=this.__chart__||{x:0,y:0,k:1};u(i)}).tween("zoom:zoom",function(){var u=l[0],s=l[1],f=u/2,e=s/2,h=n.interpolateZoom([(f-t.x)/t.k,(e-t.y)/t.k,u/t.k],[(f-o.x)/o.k,(e-o.y)/o.k,u/o.k]);return function(n){var o=h(n),s=u/o[2];this.__chart__=t={x:f-o[0]*s,y:e-o[1]*s,k:s};r(i)}}).each("end.zoom",function(){f(i)}):(this.__chart__=t,u(i),r(i),f(i))})},i.translate=function(n){return arguments.length?(t={x:+n[0],y:+n[1],k:t.k},b(),i):[t.x,t.y]},i.scale=function(n){return arguments.length?(t={x:t.x,y:t.y,k:+n},b(),i):t.k},i.scaleExtent=function(n){return arguments.length?(a=n==null?ic:[+n[0],+n[1]],i):a},i.center=function(n){return arguments.length?(k=n&&[+n[0],+n[1]],i):k},i.size=function(n){return arguments.length?(l=n&&[+n[0],+n[1]],i):l},i.x=function(n){return arguments.length?(p=n,it=n.copy(),t={x:0,y:0,k:1},i):p},i.y=function(n){return arguments.length?(w=n,rt=n.copy(),t={x:0,y:0,k:1},i):w},n.rebind(i,e,"on")};ic=[0,Infinity];tb="onwheel"in rt?(re=function(){return-n.event.deltaY*(n.event.deltaMode?120:1)},"wheel"):"onmousewheel"in rt?(re=function(){return n.event.wheelDelta},"mousewheel"):(re=function(){return-n.event.detail},"MozMousePixelScroll");gi.prototype.toString=function(){return this.rgb()+""};n.hsl=function(n,t,i){return arguments.length===1?n instanceof ao?nr(n.h,n.s,n.l):ka(""+n,da,nr):nr(+n,+t,+i)};ue=ao.prototype=new gi;ue.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),nr(this.h,this.s,this.l/n)};ue.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),nr(this.h,this.s,n*this.l)};ue.rgb=function(){return vo(this.h,this.s,this.l)};n.hcl=function(t,i,r){return arguments.length===1?t instanceof bu?tr(t.h,t.c,t.l):t instanceof ku?wa(t.l,t.a,t.b):wa((t=ga((t=n.rgb(t)).r,t.g,t.b)).l,t.a,t.b):tr(+t,+i,+r)};fe=bu.prototype=new gi;fe.brighter=function(n){return tr(this.h,this.c,Math.min(100,this.l+no*(arguments.length?n:1)))};fe.darker=function(n){return tr(this.h,this.c,Math.max(0,this.l-no*(arguments.length?n:1)))};fe.rgb=function(){return yo(this.h,this.c,this.l).rgb()};n.lab=function(t,i,r){return arguments.length===1?t instanceof ku?ir(t.l,t.a,t.b):t instanceof bu?yo(t.l,t.c,t.h):ga((t=n.rgb(t)).r,t.g,t.b):ir(+t,+i,+r)};var no=18,gb=.95047,nk=1,tk=1.08883,hl=ku.prototype=new gi;hl.brighter=function(n){return ir(Math.min(100,this.l+no*(arguments.length?n:1)),this.a,this.b)};hl.darker=function(n){return ir(Math.max(0,this.l-no*(arguments.length?n:1)),this.a,this.b)};hl.rgb=function(){return pa(this.l,this.a,this.b)};n.rgb=function(n,t,i){return arguments.length===1?n instanceof ko?st(n.r,n.g,n.b):ka(""+n,st,vo):st(~~n,~~t,~~i)};fu=ko.prototype=new gi;fu.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var i=this.r,r=this.g,u=this.b,t=30;return!i&&!r&&!u?st(t,t,t):(i&&i<t&&(i=t),r&&r<t&&(r=t),u&&u<t&&(u=t),st(Math.min(255,~~(i/n)),Math.min(255,~~(r/n)),Math.min(255,~~(u/n))))};fu.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),st(~~(n*this.r),~~(n*this.g),~~(n*this.b))};fu.hsl=function(){return da(this.r,this.g,this.b)};fu.toString=function(){return"#"+rr(this.r)+rr(this.g)+rr(this.b)};eu=n.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});eu.forEach(function(n,t){eu.set(n,ba(t))});n.functor=o;n.xhr=ts(a);n.dsv=function(t,i){function r(t,r,u){arguments.length<3&&(u=r,r=null);var o=n.xhr(t,i,u);return o.row=function(n){return arguments.length?o.response((r=n)==null?f:e(n)):r},o.row(r)}function f(n){return r.parse(n.responseText)}function e(n){return function(t){return r.parse(t.responseText,n)}}function o(n){return n.map(u).join(t)}function u(n){return s.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var s=new RegExp('["'+t+"\n]"),h=t.charCodeAt(0);return r.parse=function(n,t){var i;return r.parseRows(n,function(n,r){if(i)return i(n,r-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");i=t?function(n,i){return t(u(n),i)}:u})},r.parseRows=function(n,t){function s(){var f,t,u,s;if(i>=o)return e;if(r)return r=!1,c;if(f=i,n.charCodeAt(f)===34){for(t=f;t++<o;)if(n.charCodeAt(t)===34){if(n.charCodeAt(t+1)!==34)break;++t}return i=t+2,u=n.charCodeAt(t+1),u===13?(r=!0,n.charCodeAt(t+2)===10&&++i):u===10&&(r=!0),n.substring(f+1,t).replace(/""/g,'"')}while(i<o){if(u=n.charCodeAt(i++),s=1,u===10)r=!0;else if(u===13)r=!0,n.charCodeAt(i)===10&&(++i,++s);else if(u!==h)continue;return n.substring(f,i-s)}return n.substring(f)}for(var c={},e={},l=[],o=n.length,i=0,a=0,u,r,f;(u=s())!==e;){for(f=[];u!==c&&u!==e;)f.push(u),u=s();(!t||(f=t(f,a++)))&&l.push(f)}return l},r.format=function(n){if(Array.isArray(n[0]))return r.formatRows(n);var f=new fo,i=[];return n.forEach(function(n){for(var t in n)f.has(t)||i.push(f.add(t))}),[i.map(u).join(t)].concat(n.map(function(n){return i.map(function(t){return u(n[t])}).join(t)})).join("\n")},r.formatRows=function(n){return n.map(o).join("\n")},r};n.csv=n.dsv(",","text/csv");n.tsv=n.dsv("\t","text/tab-separated-values");rc=v[eo(v,"requestAnimationFrame")]||function(n){setTimeout(n,17)};n.timer=function(n,t,i){var u=arguments.length,f,r;u<2&&(t=0);u<3&&(i=Date.now());f=i+t;r={c:n,t:f,f:!1,n:null};oe?oe.n=r:ee=r;oe=r;se||(he=clearTimeout(he),se=1,rc(rs))};n.timer.flush=function(){nv();tv()};var uut=".",fut=",",to=[3,3],eut="$",out=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(nd);n.formatPrefix=function(t,i){var r=0;return t&&(t<0&&(t*=-1),i&&(t=n.round(t,us(t,i))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,Math.floor((r<=0?r+1:r-1)/3)*3))),out[8+r/3]};n.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};n.format=function(t){var u=uc.exec(t),v=u[1]||" ",e=u[2]||">",p=u[3]||"",f=u[4]||"",s=u[5],h=+u[6],c=u[7],r=u[8],i=u[9],o=1,l="",y=!1,a;r&&(r=+r.substring(1));(s||v==="0"&&e==="=")&&(s=v="0",e="=",c&&(h-=Math.floor((h-1)/4)));switch(i){case"n":c=!0;i="g";break;case"%":o=100;l="%";i="f";break;case"p":o=100;l="%";i="r";break;case"b":case"o":case"x":case"X":f==="#"&&(f="0"+i.toLowerCase());case"c":case"d":y=!0;r=0;break;case"s":o=-1;i="r"}return f==="#"?f="":f==="$"&&(f=eut),i!="r"||r||(i="g"),r!=null&&(i=="g"?r=Math.max(1,Math.min(21,r)):(i=="e"||i=="f")&&(r=Math.max(0,Math.min(20,r)))),i=ib.get(i)||td,a=s&&c,function(t){var u,g,b,w;if(y&&t%1)return"";u=t<0||t===0&&1/t<0?(t=-t,"-"):p;o<0?(g=n.formatPrefix(t,r),t=g.scale(t),l=g.symbol):t*=o;t=i(t,r);var d=t.lastIndexOf("."),k=d<0?t:t.substring(0,d),nt=d<0?"":uut+t.substring(d+1);return!s&&c&&(k=ce(k)),b=f.length+k.length+nt.length+(a?0:u.length),w=b<h?new Array(b=h-b+1).join(v):"",a&&(k=ce(w+k)),u+=f,t=k+nt,(e==="<"?u+t+w:e===">"?w+u+t:e==="^"?w.substring(0,b>>=1)+u+t+w.substring(b):u+(a?t:w+t))+l}};uc=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i;ib=n.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(t,i){return(t=n.round(t,us(t,i))).toFixed(Math.max(0,Math.min(20,us(t*(1+1e-15),i))))}});ce=a;to&&(rb=to.length,ce=function(n){for(var i=n.length,r=[],u=0,t=to[0];i>0&&t>0;)r.push(n.substring(i-=t,i+t)),t=to[u=(u+1)%rb];return r.reverse().join(fut)});n.geo={};fs.prototype={s:0,t:0,add:function(n){iv(n,this.t,ou);iv(ou.s,this.s,this);this.s?this.t+=ou.t:this.s=ou.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};ou=new fs;n.geo.stream=function(n,t){n&&fc.hasOwnProperty(n.type)?fc[n.type](n,t):gu(n,t)};fc={Feature:function(n,t){gu(n.geometry,t)},FeatureCollection:function(n,t){for(var i=n.features,r=-1,u=i.length;++r<u;)gu(i[r].geometry,t)}};ec={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates;t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var i=n.coordinates,r=-1,u=i.length;++r<u;)n=i[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){es(n.coordinates,t,0)},MultiLineString:function(n,t){for(var i=n.coordinates,r=-1,u=i.length;++r<u;)es(i[r],t,0)},Polygon:function(n,t){rv(n.coordinates,t)},MultiPolygon:function(n,t){for(var i=n.coordinates,r=-1,u=i.length;++r<u;)rv(i[r],t)},GeometryCollection:function(n,t){for(var i=n.geometries,r=-1,u=i.length;++r<u;)gu(i[r],t)}};n.geo.area=function(t){return le=0,n.geo.stream(t,b),le};ni=new fs;b={sphere:function(){le+=4*f},point:c,lineStart:c,lineEnd:c,polygonStart:function(){ni.reset();b.lineStart=id},polygonEnd:function(){var n=2*ni;le+=n<0?4*f+n:n;b.lineStart=b.lineEnd=b.point=c}};n.geo.bounds=function(){function w(n,t){v.push(l=[i=n,f=n]);t<o&&(o=t);t>h&&(h=t)}function k(n,t){var d=hi([n*r,t*r]),c;if(y){var b=ur(y,d),nt=[b[1],-b[0],0],l=ur(nt,b);rf(l);l=uf(l);var g=n-a,p=g>0?1:-1,v=l[0]*s*p,k=u(g)>180;k^(p*a<v&&v<p*n)?(c=l[1]*s,c>h&&(h=c)):(v=(v+360)%360-180,k^(p*a<v&&v<p*n))?(c=-l[1]*s,c<o&&(o=c)):(t<o&&(o=t),t>h&&(h=t));k?n<a?e(i,n)>e(i,f)&&(f=n):e(n,f)>e(i,f)&&(i=n):f>=i?(n<i&&(i=n),n>f&&(f=n)):n>a?e(i,n)>e(i,f)&&(f=n):e(n,f)>e(i,f)&&(i=n)}else w(n,t);y=d;a=n}function d(){c.point=k}function g(){l[0]=i;l[1]=f;c.point=w;y=null}function nt(n,t){if(y){var i=n-a;p+=u(i)>180?i+(i>0?360:-360):i}else it=n,rt=t;b.point(n,t);k(n,t)}function ut(){b.lineStart()}function ft(){nt(it,rt);b.lineEnd();u(p)>t&&(i=-(f=180));l[0]=i;l[1]=f;y=null}function e(n,t){return(t-=n)<0?t+360:t}function et(n,t){return n[0]-t[0]}function tt(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var i,o,f,h,a,it,rt,y,p,v,l,c={point:w,lineStart:d,lineEnd:g,polygonStart:function(){c.point=nt;c.lineStart=ut;c.lineEnd=ft;p=0;b.polygonStart()},polygonEnd:function(){b.polygonEnd();c.point=w;c.lineStart=d;c.lineEnd=g;ni<0?(i=-(f=180),o=-(h=90)):p>t?h=90:p<-t&&(o=-90);l[0]=i;l[1]=f}};return function(t){var a,p,w;if(h=f=-(i=o=Infinity),v=[],n.geo.stream(t,c),a=v.length,a){v.sort(et);for(var s=1,r=v[0],u,y=[r];s<a;++s)u=v[s],tt(u[0],r)||tt(u[1],r)?(e(r[0],u[1])>e(r[0],r[1])&&(r[1]=u[1]),e(u[0],r[1])>e(r[0],r[1])&&(r[0]=u[0])):y.push(r=u);p=-Infinity;for(var a=y.length-1,s=0,r=y[a],u;s<=a;r=u,++s)u=y[s],(w=e(r[1],u[0]))>p&&(p=w,i=u[0],f=r[1])}return v=l=null,i===Infinity||o===Infinity?[[NaN,NaN],[NaN,NaN]]:[[i,o],[f,h]]}}();n.geo.centroid=function(i){su=ae=pi=wi=yt=ti=ii=ot=lr=ar=ri=0;n.geo.stream(i,tt);var r=lr,u=ar,f=ri,e=r*r+u*u+f*f;return e<ol&&(r=ti,u=ii,f=ot,ae<t&&(r=pi,u=wi,f=yt),e=r*r+u*u+f*f,e<ol)?[NaN,NaN]:[Math.atan2(u,r)*s,si(f/Math.sqrt(e))*s]};tt={sphere:c,point:ss,lineStart:uv,lineEnd:fv,polygonStart:function(){tt.lineStart=rd},polygonEnd:function(){tt.lineStart=uv}};oc=sv(fr,od,hd,[-f,-f/2]);hu=1e9;n.geo.clipExtent=function(){var t,i,r,u,n,f,e={stream:function(t){return n&&(n.valid=!1),n=f(t),n.valid=!0,n},extent:function(o){return arguments.length?(f=lv(t=+o[0][0],i=+o[0][1],r=+o[1][0],u=+o[1][1]),n&&(n.valid=!1,n=null),e):[[t,i],[r,u]]}};return e.extent([[0,0],[960,500]])};(n.geo.conicEqualArea=function(){return hs(vv)}).raw=vv;n.geo.albers=function(){return n.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)};n.geo.albersUsa=function(){function r(n){var t=n[0],i=n[1];return e=null,(s(t,i),e)||(h(t,i),e)||c(t,i),e}var i=n.geo.albers(),u=n.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),f=n.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),e,o={point:function(n,t){e=[n,t]}},s,h,c;return r.invert=function(n){var e=i.scale(),o=i.translate(),t=(n[0]-o[0])/e,r=(n[1]-o[1])/e;return(r>=.12&&r<.234&&t>=-.425&&t<-.214?u:r>=.166&&r<.234&&t>=-.214&&t<-.115?f:i).invert(n)},r.stream=function(n){var t=i.stream(n),r=u.stream(n),e=f.stream(n);return{point:function(n,i){t.point(n,i);r.point(n,i);e.point(n,i)},sphere:function(){t.sphere();r.sphere();e.sphere()},lineStart:function(){t.lineStart();r.lineStart();e.lineStart()},lineEnd:function(){t.lineEnd();r.lineEnd();e.lineEnd()},polygonStart:function(){t.polygonStart();r.polygonStart();e.polygonStart()},polygonEnd:function(){t.polygonEnd();r.polygonEnd();e.polygonEnd()}}},r.precision=function(n){return arguments.length?(i.precision(n),u.precision(n),f.precision(n),r):i.precision()},r.scale=function(n){return arguments.length?(i.scale(n),u.scale(n*.35),f.scale(n),r.translate(i.translate())):i.scale()},r.translate=function(n){if(!arguments.length)return i.translate();var e=i.scale(),l=+n[0],a=+n[1];return s=i.translate(n).clipExtent([[l-.455*e,a-.238*e],[l+.455*e,a+.238*e]]).stream(o).point,h=u.translate([l-.307*e,a+.201*e]).clipExtent([[l-.425*e+t,a+.12*e+t],[l-.214*e-t,a+.234*e-t]]).stream(o).point,c=f.translate([l-.205*e,a+.212*e]).clipExtent([[l-.214*e+t,a+.166*e+t],[l-.115*e-t,a+.234*e-t]]).stream(o).point,r},r.scale(1070)};pt={point:c,lineStart:c,lineEnd:c,polygonStart:function(){hc=0;pt.lineStart=ld},polygonEnd:function(){pt.lineStart=pt.lineEnd=pt.point=c;sc+=u(hc/2)}};ub={point:ad,lineStart:c,lineEnd:c,polygonStart:c,polygonEnd:c};it={point:ci,lineStart:pv,lineEnd:wv,polygonStart:function(){it.lineStart=yd},polygonEnd:function(){it.point=ci;it.lineStart=pv;it.lineEnd=wv}};n.geo.path=function(){function t(t){return t&&(typeof i=="function"&&r.pointRadius(+i.apply(this,arguments)),f&&f.valid||(f=u(r)),n.geo.stream(t,f)),r.result()}function e(){return f=null,t}var i=4.5,o,s,u,r,f;return t.area=function(t){return sc=0,n.geo.stream(t,u(pt)),sc},t.centroid=function(t){return pi=wi=yt=ti=ii=ot=lr=ar=ri=0,n.geo.stream(t,u(it)),ri?[lr/ri,ar/ri]:ot?[ti/ot,ii/ot]:yt?[pi/yt,wi/yt]:[NaN,NaN]},t.bounds=function(t){return pe=we=-(ve=ye=Infinity),n.geo.stream(t,u(ub)),[[ve,ye],[pe,we]]},t.projection=function(n){return arguments.length?(u=(o=n)?n.stream||wd(n):a,e()):o},t.context=function(n){return arguments.length?(r=(s=n)==null?new vd:new pd(n),typeof i!="function"&&r.pointRadius(i),e()):s},t.pointRadius=function(n){return arguments.length?(i=typeof n=="function"?n:(r.pointRadius(+n),+n),t):i},t.projection(n.geo.albersUsa()).context(null)};n.geo.transform=function(n){return{stream:function(t){var r=new kv(t),i;for(i in n)r[i]=n[i];return r}}};kv.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};n.geo.projection=gt;n.geo.projectionMutator=cs;(n.geo.equirectangular=function(){return gt(wr)}).raw=wr.invert=wr;n.geo.rotation=function(n){function t(t){return t=n(t[0]*r,t[1]*r),t[0]*=s,t[1]*=s,t}return n=ls(n[0]%360*r,n[1]*r,n.length>2?n[2]*r:0),t.invert=function(t){return t=n.invert(t[0]*r,t[1]*r),t[0]*=s,t[1]*=s,t},t};ny.invert=wr;n.geo.circle=function(){function n(){var n=typeof t=="function"?t.apply(this,arguments):t,u=ls(-n[0]*r,-n[1]*r,0).invert,i=[];return f(null,null,1,{point:function(n,t){i.push(n=u(n,t));n[0]*=s;n[1]*=s}}),{type:"Polygon",coordinates:[i]}}var t=[0,0],i,u=6,f;return n.origin=function(i){return arguments.length?(t=i,n):t},n.angle=function(t){return arguments.length?(f=as((i=+t)*r,u*r),n):i},n.precision=function(t){return arguments.length?(f=as(i*r,(u=+t)*r),n):u},n.angle(90)};n.geo.distance=function(n,t){var f=(t[0]-n[0])*r,e=n[1]*r,o=t[1]*r,a=Math.sin(f),s=Math.cos(f),h=Math.sin(e),c=Math.cos(e),l=Math.sin(o),u=Math.cos(o),i;return Math.atan2(Math.sqrt((i=u*a)*i+(i=c*l-h*u*s)*i),h*l+c*u*s)};n.geo.graticule=function(){function i(){return{type:"MultiLineString",coordinates:d()}}function d(){return n.range(Math.ceil(f/v)*v,r,v).map(b).concat(n.range(Math.ceil(o/y)*y,e,y).map(k)).concat(n.range(Math.ceil(h/a)*a,s,a).filter(function(n){return u(n%v)>t}).map(g)).concat(n.range(Math.ceil(l/w)*w,c,w).filter(function(n){return u(n%y)>t}).map(nt))}var s,h,r,f,c,l,e,o,a=10,w=a,v=90,y=360,g,nt,b,k,p=2.5;return i.lines=function(){return d().map(function(n){return{type:"LineString",coordinates:n}})},i.outline=function(){return{type:"Polygon",coordinates:[b(f).concat(k(e).slice(1),b(r).reverse().slice(1),k(o).reverse().slice(1))]}},i.extent=function(n){return arguments.length?i.majorExtent(n).minorExtent(n):i.minorExtent()},i.majorExtent=function(n){return arguments.length?(f=+n[0][0],r=+n[1][0],o=+n[0][1],e=+n[1][1],f>r&&(n=f,f=r,r=n),o>e&&(n=o,o=e,e=n),i.precision(p)):[[f,o],[r,e]]},i.minorExtent=function(n){return arguments.length?(h=+n[0][0],s=+n[1][0],l=+n[0][1],c=+n[1][1],h>s&&(n=h,h=s,s=n),l>c&&(n=l,l=c,c=n),i.precision(p)):[[h,l],[s,c]]},i.step=function(n){return arguments.length?i.majorStep(n).minorStep(n):i.minorStep()},i.majorStep=function(n){return arguments.length?(v=+n[0],y=+n[1],i):[v,y]},i.minorStep=function(n){return arguments.length?(a=+n[0],w=+n[1],i):[a,w]},i.precision=function(n){return arguments.length?(p=+n,g=fy(l,c,90),nt=ey(h,s,p),b=fy(o,e,90),k=ey(f,r,p),i):p},i.majorExtent([[-180,-90+t],[180,90-t]]).minorExtent([[-180,-80-t],[180,80+t]])};n.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[u||i.apply(this,arguments),f||r.apply(this,arguments)]}}var i=vs,u,r=ys,f;return t.distance=function(){return n.geo.distance(u||i.apply(this,arguments),f||r.apply(this,arguments))},t.source=function(n){return arguments.length?(i=n,u=typeof n=="function"?null:n,t):i},t.target=function(n){return arguments.length?(r=n,f=typeof n=="function"?null:n,t):r},t.precision=function(){return arguments.length?t:0},t};n.geo.interpolate=function(n,t){return bd(n[0]*r,n[1]*r,t[0]*r,t[1]*r)};n.geo.length=function(t){return cc=0,n.geo.stream(t,bi),cc};bi={sphere:c,point:c,lineStart:kd,lineEnd:c,polygonStart:c,polygonEnd:c};lc=br(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(n.geo.azimuthalEqualArea=function(){return gt(lc)}).raw=lc;ac=br(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},a);(n.geo.azimuthalEquidistant=function(){return gt(ac)}).raw=ac;(n.geo.conicConformal=function(){return hs(oy)}).raw=oy;(n.geo.conicEquidistant=function(){return hs(sy)}).raw=sy;vc=br(function(n){return 1/n},Math.atan);(n.geo.gnomonic=function(){return gt(vc)}).raw=vc;of.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-d]};(n.geo.mercator=function(){return hy(of)}).raw=of;yc=br(function(){return 1},Math.asin);(n.geo.orthographic=function(){return gt(yc)}).raw=yc;pc=br(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(n.geo.stereographic=function(){return gt(pc)}).raw=pc;ps.invert=function(n,t){return[Math.atan2(va(n),Math.cos(t)),si(Math.sin(t)/lo(n))]};(n.geo.transverseMercator=function(){return hy(ps)}).raw=ps;n.geom={};n.geom.hull=function(n){function t(n){var p;if(n.length<3)return[];var g=o(r),it=o(i),v=n.length,u,nt=v-1,f=[],h=[],tt,t,e,s=0,l,a,w,b,k,y,d,c;if(g===li&&i===er)u=n;else for(t=0,u=[];t<v;++t)u.push([+g.call(this,tt=n[t],t),+it.call(this,tt,t)]);for(t=1;t<v;++t)(u[t][1]<u[s][1]||u[t][1]==u[s][1]&&u[t][0]<u[s][0])&&(s=t);for(t=0;t<v;++t)t!==s&&(a=u[t][1]-u[s][1],l=u[t][0]-u[s][0],f.push({angle:Math.atan2(a,l),index:t}));for(f.sort(function(n,t){return n.angle-t.angle}),d=f[0].angle,y=f[0].index,k=0,t=1;t<nt;++t){if(e=f[t].index,d==f[t].angle)if(l=u[y][0]-u[s][0],a=u[y][1]-u[s][1],w=u[e][0]-u[s][0],b=u[e][1]-u[s][1],l*l+a*a>=w*w+b*b){f[t].index=-1;continue}else f[k].index=-1;d=f[t].angle;k=t;y=e}for(h.push(s),t=0,e=0;t<2;++e)f[e].index>-1&&(h.push(f[e].index),t++);for(c=h.length;e<nt;++e)if(!(f[e].index<0)){while(!dd(h[c-2],h[c-1],f[e].index,u))--c;h[c++]=f[e].index}for(p=[],t=c-1;t>=0;--t)p.push(n[h[t]]);return p}var r=li,i=er;return arguments.length?t(n):(t.x=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(i=n,t):i},t)};n.geom.polygon=function(n){return uu(n,cu),n};cu=n.geom.polygon.prototype=[];cu.area=function(){for(var i=-1,r=this.length,t,n=this[r-1],u=0;++i<r;)t=n,n=this[i],u+=t[1]*n[0]-t[0]*n[1];return u*.5};cu.centroid=function(n){var u=-1,f=this.length,e=0,o=0,i,t=this[f-1],r;for(arguments.length||(n=-1/(6*this.area()));++u<f;)i=t,t=this[u],r=i[0]*t[1]-t[0]*i[1],e+=(i[0]+t[0])*r,o+=(i[1]+t[1])*r;return[e*n,o*n]};cu.clip=function(n){for(var f,o=ly(n),s=-1,h=this.length-ly(this),e,c,i=this[h-1],t,r,u;++s<h;){for(f=n.slice(),n.length=0,t=this[s],r=f[(c=f.length-o)-1],e=-1;++e<c;)u=f[e],ws(u,i,t)?(ws(r,i,t)||n.push(cy(r,u,i,t)),n.push(u)):ws(r,i,t)&&n.push(cy(r,u,i,t)),r=u;o&&n.push(n[0]);i=t}return n};wc=[];kc=[];yy.prototype.prepare=function(){for(var n=this.edges,t=n.length,i;t--;)i=n[t].edge,i.b&&i.a||n.splice(t,1);return n.sort(py),n.length};hf.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}};ks.prototype={insert:function(n,t){var i,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;i=n}else this._?(n=by(this._),t.P=null,t.N=n,n.P=n.L=t,i=n):(t.P=t.N=null,this._=t,i=null);for(t.L=t.R=null,t.U=i,t.C=!0,n=t;i&&i.C;)r=i.U,i===r.L?(u=r.R,u&&u.C?(i.C=u.C=!1,r.C=!0,n=r):(n===i.R&&(dr(this,i),n=i,i=n.U),i.C=!1,r.C=!0,gr(this,r))):(u=r.L,u&&u.C?(i.C=u.C=!1,r.C=!0,n=r):(n===i.L&&(gr(this,i),n=i,i=n.U),i.C=!1,r.C=!0,dr(this,r))),i=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P);n.P&&(n.P.N=n.N);n.N=n.P=null;var i=n.U,t,f=n.L,u=n.R,r,e;if(r=f?u?by(u):f:u,i?i.L===n?i.L=r:i.R=r:this._=r,f&&u?(e=r.C,r.C=n.C,r.L=f,f.U=r,r!==u?(i=r.U,r.U=n.U,n=r.R,i.L=n,r.R=u,u.U=r):(r.U=i,i=r,n=r.R)):(e=n.C,n=r),n&&(n.U=i),!e){if(n&&n.C){n.C=!1;return}do{if(n===this._)break;if(n===i.L){if(t=i.R,t.C&&(t.C=!1,i.C=!0,dr(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,gr(this,t),t=i.R);t.C=i.C;i.C=t.R.C=!1;dr(this,i);n=this._;break}}else if(t=i.L,t.C&&(t.C=!1,i.C=!0,gr(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,dr(this,t),t=i.L);t.C=i.C;i.C=t.L.C=!1;gr(this,i);n=this._;break}t.C=!0;n=i;i=i.U}while(!n.C);n&&(n.C=!1)}}};n.geom.voronoi=function(n){function i(n){var o=new Array(n.length),t=r[0][0],i=r[0][1],f=r[1][0],e=r[1][1];return ds(u(n),r).cells.forEach(function(r,u){var h=r.edges,s=r.site,c=o[u]=h.length?h.map(function(n){var t=n.start();return[t.x,t.y]}):s.x>=t&&s.x<=f&&s.y>=i&&s.y<=e?[[t,e],[f,e],[f,i],[t,i]]:[];c.point=n[u]}),o}function u(n){return n.map(function(n,i){return{x:Math.round(s(n,i)/t)*t,y:Math.round(h(n,i)/t)*t,i:i}})}var f=li,e=er,s=f,h=e,r=au;return n?i(n):(i.links=function(n){return ds(u(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},i.triangles=function(n){var t=[];return ds(u(n)).cells.forEach(function(i,r){for(var o=i.site,s=i.edges.sort(py),h=-1,c=s.length,l,e,u=s[c-1].edge,f=u.l===o?u.r:u.l;++h<c;)l=u,e=f,u=s[h].edge,f=u.l===o?u.r:u.l,r<e.i&&r<f.i&&hg(o,e,f)<0&&t.push([n[r],n[e.i],n[f.i]])}),t},i.x=function(n){return arguments.length?(s=o(f=n),i):f},i.y=function(n){return arguments.length?(h=o(e=n),i):e},i.clipExtent=function(n){return arguments.length?(r=n==null?au:n,i):r===au?null:r},i.size=function(n){return arguments.length?i.clipExtent(n&&[[0,0],n]):r===au?null:r&&r[1]},i)};au=[[-1e6,-1e6],[1e6,1e6]];n.geom.delaunay=function(t){return n.geom.voronoi().triangles(t)};n.geom.quadtree=function(n,t,i,r,f){function e(n){function it(n,t,i,r,f,e,o,s){var h,c,l;isNaN(i)||isNaN(r)||(n.leaf?(h=n.x,c=n.y,h!=null?u(h-i)+u(c-r)<.01?nt(n,t,i,r,f,e,o,s):(l=n.point,n.x=n.y=n.point=null,nt(n,l,h,c,f,e,o,s),nt(n,t,i,r,f,e,o,s)):(n.x=i,n.y=r,n.point=t)):nt(n,t,i,r,f,e,o,s))}function nt(n,t,i,r,u,f,e,o){var s=(u+e)*.5,h=(f+o)*.5,c=i>=s,l=r>=h,a=(l<<1)+c;n.leaf=!1;n=n.nodes[a]||(n.nodes[a]=ky());c?u=s:e=s;l?f=h:o=h;it(n,t,i,r,u,f,e,o)}var l,ft=o(s),et=o(h),d,g,e,tt,a,v,y,p,b,k,rt,ut,w;if(t!=null)a=t,v=i,y=r,p=f;else if(y=p=-(a=v=Infinity),d=[],g=[],tt=n.length,c)for(e=0;e<tt;++e)l=n[e],l.x<a&&(a=l.x),l.y<v&&(v=l.y),l.x>y&&(y=l.x),l.y>p&&(p=l.y),d.push(l.x),g.push(l.y);else for(e=0;e<tt;++e)b=+ft(l=n[e],e),k=+et(l,e),b<a&&(a=b),k<v&&(v=k),b>y&&(y=b),k>p&&(p=k),d.push(b),g.push(k);if(rt=y-a,ut=p-v,rt>ut?p=v+rt:y=a+ut,w=ky(),w.add=function(n){it(w,n,+ft(n,++e),+et(n,e),a,v,y,p)},w.visit=function(n){nu(n,w,a,v,y,p)},e=-1,t==null){while(++e<tt)it(w,n[e],d[e],g[e],a,v,y,p);--e}else n.forEach(w.add);return d=g=n=l=null,w}var s=li,h=er,c;return(c=arguments.length)?(s=cg,h=lg,c===3&&(f=i,r=t,i=t=0),e(n)):(e.x=function(n){return arguments.length?(s=n,e):s},e.y=function(n){return arguments.length?(h=n,e):h},e.extent=function(n){return arguments.length?(n==null?t=i=r=f=null:(t=+n[0][0],i=+n[0][1],r=+n[1][0],f=+n[1][1]),e):t==null?null:[[t,i],[r,f]]},e.size=function(n){return arguments.length?(n==null?t=i=r=f=null:(t=i=0,r=+n[0],f=+n[1]),e):t==null?null:[r-t,f-i]},e)};n.interpolateRgb=gs;n.interpolateObject=dy;n.interpolateNumber=ht;n.interpolateString=gy;vu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;n.interpolate=ai;n.interpolators=[function(n,t){var i=typeof t;return(i==="string"?eu.has(t)||/^(#|rgb\(|hsl\()/.test(t)?gs:gy:t instanceof gi?gs:i==="object"?Array.isArray(t)?lf:dy:ht)(n,t)}];n.interpolateArray=lf;var ik=function(){return a},sut=n.map({linear:ik,poly:wg,quad:function(){return vg},cubic:function(){return yg},sin:function(){return bg},exp:function(){return kg},circle:function(){return dg},elastic:gg,back:nn,bounce:function(){return tn}}),hut=n.map({"in":a,out:np,"in-out":tp,"out-in":function(n){return tp(np(n))}});n.ease=function(n){var t=n.indexOf("-"),i=t>=0?n.substring(0,t):n,r=t>=0?n.substring(t+1):"in";return i=sut.get(i)||ik,r=hut.get(r)||a,ag(r(i.apply(null,wb.call(arguments,1))))};n.interpolateHcl=rn;n.interpolateHsl=un;n.interpolateLab=fn;n.interpolateRound=ip;n.transform=function(t){var i=rt.createElementNS(n.ns.prefix.svg,"g");return(n.transform=function(n){if(n!=null){i.setAttribute("transform",n);var t=i.transform.baseVal.consolidate()}return new rp(t?t.matrix:fb)})(t)};rp.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};fb={a:1,b:0,c:0,d:1,e:0,f:0};n.interpolateTransform=ep;n.layout={};n.layout.bundle=function(){return function(n){for(var t=[],i=-1,r=n.length;++i<r;)t.push(hn(n[i]));return t}};n.layout.chord=function(){function c(){var b={},d=[],it=n.range(r),g=[],v,t,nt,c,a,p,w;for(i=[],u=[],v=0,c=-1;++c<r;){for(t=0,a=-1;++a<r;)t+=f[c][a];d.push(t);g.push(n.range(r));v+=t}for(o&&it.sort(function(n,t){return o(d[n],d[t])}),s&&g.forEach(function(n,t){n.sort(function(n,i){return s(f[t][n],f[t][i])})}),v=(k-e*r)/v,t=0,c=-1;++c<r;){for(nt=t,a=-1;++a<r;){var y=it[c],tt=g[y][a],rt=f[y][tt],ut=t,ft=t+=rt*v;b[y+"-"+tt]={index:y,subindex:tt,startAngle:ut,endAngle:ft,value:rt}}u[y]={index:y,startAngle:nt,endAngle:t,value:(t-nt)/v};t+=e}for(c=-1;++c<r;)for(a=c-1;++a<r;)p=b[c+"-"+a],w=b[a+"-"+c],(p.value||w.value)&&i.push(p.value<w.value?{source:w,target:p}:{source:p,target:w});h&&l()}function l(){i.sort(function(n,t){return h((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var t={},i,u,f,r,e=0,o,s,h;return t.matrix=function(n){return arguments.length?(r=(f=n)&&f.length,i=u=null,t):f},t.padding=function(n){return arguments.length?(e=n,i=u=null,t):e},t.sortGroups=function(n){return arguments.length?(o=n,i=u=null,t):o},t.sortSubgroups=function(n){return arguments.length?(s=n,i=null,t):s},t.sortChords=function(n){return arguments.length?(h=n,i&&l(),t):h},t.chords=function(){return i||c(),i},t.groups=function(){return u||c(),u},t};n.layout.force=function(){function k(n){return function(t,i,r,u){var f;if(t.point!==n){var o=t.cx-n.x,s=t.cy-n.y,e=1/Math.sqrt(o*o+s*s);if((u-i)*e<b)return f=t.charge*e*e,n.px-=o*f,n.py-=s*f,!0;t.point&&isFinite(e)&&(f=t.pointCharge*e*e,n.px-=o*f,n.py-=s*f)}return!t.charge}}function d(i){i.px=n.event.x;i.py=n.event.y;t.resume()}var t={},h=n.dispatch("start","tick","end"),f=[1,1],c,r,l=.9,o=eb,s=ob,e=-30,w=.1,b=.8,i=[],u=[],v,y,p;return t.tick=function(){if((r*=.99)<.005)return h.end({type:"end",alpha:r=0}),!0;for(var nt=i.length,it=u.length,tt,t,b,g,d,s,c,a,o=0;o<it;++o)t=u[o],b=t.source,g=t.target,c=g.x-b.x,a=g.y-b.y,(d=c*c+a*a)&&(d=r*y[o]*((d=Math.sqrt(d))-v[o])/d,c*=d,a*=d,g.x-=c*(s=b.weight/(g.weight+b.weight)),g.y-=a*s,b.x+=c*(s=1-s),b.y+=a*s);if((s=r*w)&&(c=f[0]/2,a=f[1]/2,o=-1,s))while(++o<nt)t=i[o],t.x+=(c-t.x)*s,t.y+=(a-t.y)*s;if(e)for(sp(tt=n.geom.quadtree(i),r,p),o=-1;++o<nt;)(t=i[o]).fixed||tt.visit(k(t));for(o=-1;++o<nt;)t=i[o],t.fixed?(t.x=t.px,t.y=t.py):(t.x-=(t.px-(t.px=t.x))*l,t.y-=(t.py-(t.py=t.y))*l);h.tick({type:"tick",alpha:r})},t.nodes=function(n){return arguments.length?(i=n,t):i},t.links=function(n){return arguments.length?(u=n,t):u},t.size=function(n){return arguments.length?(f=n,t):f},t.linkDistance=function(n){return arguments.length?(o=typeof n=="function"?n:+n,t):o},t.distance=t.linkDistance,t.linkStrength=function(n){return arguments.length?(s=typeof n=="function"?n:+n,t):s},t.friction=function(n){return arguments.length?(l=+n,t):l},t.charge=function(n){return arguments.length?(e=typeof n=="function"?n:+n,t):e},t.gravity=function(n){return arguments.length?(w=+n,t):w},t.theta=function(n){return arguments.length?(b=+n,t):b},t.alpha=function(i){return arguments.length?(i=+i,r?r=i>0?i:0:i>0&&(h.start({type:"start",alpha:r=i}),n.timer(t.tick)),t):r},t.start=function(){function a(t,i){var f;if(!c){for(c=new Array(h),r=0;r<h;++r)c[r]=[];for(r=0;r<o;++r)f=u[r],c[f.source.index].push(f.target),c[f.target.index].push(f.source)}for(var e=c[n],r=-1,o=e.length,s;++r<o;)if(!isNaN(s=e[r][t]))return s;return Math.random()*i}for(var h=i.length,l=u.length,w=f[0],b=f[1],c,r,n=0;n<h;++n)(r=i[n]).index=n,r.weight=0;for(n=0;n<l;++n)r=u[n],typeof r.source=="number"&&(r.source=i[r.source]),typeof r.target=="number"&&(r.target=i[r.target]),++r.source.weight,++r.target.weight;for(n=0;n<h;++n)r=i[n],isNaN(r.x)&&(r.x=a("x",w)),isNaN(r.y)&&(r.y=a("y",b)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(v=[],typeof o=="function")for(n=0;n<l;++n)v[n]=+o.call(this,u[n],n);else for(n=0;n<l;++n)v[n]=o;if(y=[],typeof s=="function")for(n=0;n<l;++n)y[n]=+s.call(this,u[n],n);else for(n=0;n<l;++n)y[n]=s;if(p=[],typeof e=="function")for(n=0;n<h;++n)p[n]=+e.call(this,i[n],n);else for(n=0;n<h;++n)p[n]=e;return t.resume()},t.resume=function(){return t.alpha(.1)},t.stop=function(){return t.alpha(0)},t.drag=function(){if(c||(c=n.behavior.drag().origin(a).on("dragstart.force",ln).on("drag.force",d).on("dragend.force",an)),!arguments.length)return c;this.on("mouseover.force",vn).on("mouseout.force",yn).call(c)},n.rebind(t,h,"on")};eb=20;ob=1;n.layout.hierarchy=function(){function u(f,e,o){var s=r.call(n,f,e);if(f.depth=e,o.push(f),s&&(c=s.length)){for(var h=-1,c,a=f.children=new Array(c),v=0,y=e+1,l;++h<c;)l=a[h]=u(s[h],y,o),l.parent=f,v+=l.value;i&&a.sort(i);t&&(f.value=v)}else delete f.children,t&&(f.value=+t.call(n,f,e)||0);return f}function f(i,r){var e=i.children,u=0,o,s,h;if(e&&(s=e.length))for(o=-1,h=r+1;++o<s;)u+=f(e[o],h);else t&&(u=+t.call(n,i,r)||0);return t&&(i.value=u),u}function n(n){var t=[];return u(n,0,t),t}var i=bn,r=pn,t=wn;return n.sort=function(t){return arguments.length?(i=t,n):i},n.children=function(t){return arguments.length?(r=t,n):r},n.value=function(i){return arguments.length?(t=i,n):t},n.revalue=function(n){return f(n,0),n},n};n.layout.partition=function(){function r(n,t,i,u){var f=n.children,e,o,s,h;if(n.x=t,n.y=n.depth*u,n.dx=i,n.dy=u,f&&(o=f.length))for(e=-1,i=n.value?i/n.value:0;++e<o;)r(s=f[e],t,h=s.value*i,u),t+=h}function u(n){var t=n.children,i=0,r,f;if(t&&(f=t.length))for(r=-1;++r<f;)i=Math.max(i,u(t[r]));return 1+i}function i(n,i){var e=f.call(this,n,i);return r(e[0],0,t[0],t[1]/u(e[0])),e}var f=n.layout.hierarchy(),t=[1,1];return i.size=function(n){return arguments.length?(t=n,i):t},tu(i,f)};n.layout.pie=function(){function t(e){var o=e.map(function(n,i){return+f.call(t,n,i)}),s=+(typeof r=="function"?r.apply(this,arguments):r),l=((typeof u=="function"?u.apply(this,arguments):u)-s)/n.sum(o),c=n.range(e.length),h;return i!=null&&c.sort(i===dc?function(n,t){return o[t]-o[n]}:function(n,t){return i(e[n],e[t])}),h=[],c.forEach(function(n){var t;h[n]={data:e[n],value:t=o[n],startAngle:s,endAngle:s+=t*l}}),h}var f=Number,i=dc,r=0,u=k;return t.value=function(n){return arguments.length?(f=n,t):f},t.sort=function(n){return arguments.length?(i=n,t):i},t.startAngle=function(n){return arguments.length?(r=n,t):r},t.endAngle=function(n){return arguments.length?(u=n,t):u},t};dc={};n.layout.stack=function(){function t(s,h){var l=s.map(function(n,i){return r.call(t,n,i)}),a=l.map(function(n){return n.map(function(n,i){return[e.call(t,n,i),o.call(t,n,i)]})}),y=u.call(t,a,h);l=n.permute(l,y);a=n.permute(a,y);for(var w=f.call(t,a,h),b=l.length,k=l[0].length,v,p,c=0;c<k;++c)for(i.call(t,l[0][c],p=w[c],a[0][c][1]),v=1;v<b;++v)i.call(t,l[v][c],p+=a[v-1][c][1],a[v][c][1]);return s}var r=a,u=nh,f=th,i=ntt,e=dn,o=gn;return t.values=function(n){return arguments.length?(r=n,t):r},t.order=function(n){return arguments.length?(u=typeof n=="function"?n:sb.get(n)||nh,t):u},t.offset=function(n){return arguments.length?(f=typeof n=="function"?n:hb.get(n)||th,t):f},t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(o=n,t):o},t.out=function(n){return arguments.length?(i=n,t):i},t};sb=n.map({"inside-out":function(t){for(var u=t.length,i,f=t.map(ttt),e=t.map(itt),l=n.range(u).sort(function(n,t){return f[n]-f[t]}),o=0,s=0,h=[],c=[],r=0;r<u;++r)i=l[r],o<s?(o+=e[i],h.push(i)):(s+=e[i],c.push(i));return c.reverse().concat(h)},reverse:function(t){return n.range(t.length).reverse()},"default":nh});hb=n.map({silhouette:function(n){for(var s=n.length,f=n[0].length,e=[],u=0,r,i,o=[],t=0;t<f;++t){for(r=0,i=0;r<s;r++)i+=n[r][t][1];i>u&&(u=i);e.push(i)}for(t=0;t<f;++t)o[t]=(u-e[t])/2;return o},wiggle:function(n){var a=n.length,h=n[0],v=h.length,i,t,r,u,c,l,f,e,o,s=[];for(s[0]=e=o=0,t=1;t<v;++t){for(i=0,u=0;i<a;++i)u+=n[i][t][1];for(i=0,c=0,f=h[t][0]-h[t-1][0];i<a;++i){for(r=0,l=(n[i][t][1]-n[i][t-1][1])/(2*f);r<i;++r)l+=(n[r][t][1]-n[r][t-1][1])/f;c+=l*n[i][t][1]}s[t]=e-=u?c/u*f:0;e<o&&(o=e)}for(t=0;t<v;++t)s[t]-=o;return s},expand:function(n){for(var r=n.length,f=n[0].length,o=1/r,t,u,e=[],i=0;i<f;++i){for(t=0,u=0;t<r;t++)u+=n[t][i][1];if(u)for(t=0;t<r;t++)n[t][i][1]/=u;else for(t=0;t<r;t++)n[t][i][1]=o}for(i=0;i<f;++i)e[i]=0;return e},zero:th});n.layout.histogram=function(){function t(t,e){for(var l=[],s=t.map(r,this),a=u.call(this,s,e),h=f.call(this,a,s,e),o,e=-1,y=s.length,v=h.length-1,p=i?1:1/y,c;++e<v;)o=l[e]=[],o.dx=h[e+1]-(o.x=h[e]),o.y=0;if(v>0)for(e=-1;++e<y;)c=s[e],c>=a[0]&&c<=a[1]&&(o=l[n.bisect(h,c,1,v)-1],o.y+=p,o.push(t[e]));return l}var i=!0,r=Number,u=ftt,f=utt;return t.value=function(n){return arguments.length?(r=n,t):r},t.range=function(n){return arguments.length?(u=o(n),t):u},t.bins=function(n){return arguments.length?(f=typeof n=="number"?function(t){return hp(t,n)}:o(n),t):f},t.frequency=function(n){return arguments.length?(i=!!n,t):i},t};n.layout.tree=function(){function i(n,i){function h(n,t){var f=n.children,i=n._tree,e;if(f&&(s=f.length)){for(var s,c=f[0],o,l=c,u,a=-1;++a<s;)u=f[a],h(u,o),l=v(u,o,l),o=u;htt(n);e=.5*(c._tree.prelim+u._tree.prelim);t?(i.prelim=t._tree.prelim+r(n,t),i.mod=i.prelim-e):i.prelim=e}else t&&(i.prelim=t._tree.prelim+r(n,t))}function c(n,t){var i,r,u;if(n.x=n._tree.prelim+t,i=n.children,i&&(u=i.length))for(r=-1,t+=n._tree.mod;++r<u;)c(i[r],t)}function v(n,t,i){if(t){for(var f=n,e=n,u=t,o=n.parent.children[0],h=f._tree.mod,c=e._tree.mod,l=u._tree.mod,a=o._tree.mod,s;u=rh(u),f=ih(f),u&&f;)o=ih(o),e=rh(e),e._tree.ancestor=n,s=u._tree.prelim+l-f._tree.prelim-h+r(u,f),s>0&&(ctt(ltt(u,n,i),n,s),h+=s,c+=s),l+=u._tree.mod,h+=f._tree.mod,a+=o._tree.mod,c+=e._tree.mod;u&&!rh(e)&&(e._tree.thread=u,e._tree.mod+=l-c);f&&!ih(o)&&(o._tree.thread=f,o._tree.mod+=h-a,i=n)}return i}var l=f.call(this,n,i),e=l[0];ct(e,function(n,t){n._tree={ancestor:n,prelim:0,mod:0,change:0,shift:0,number:t?t._tree.number+1:0}});h(e);c(e,-e._tree.prelim);var o=af(e,ott),s=af(e,ett),y=af(e,stt),a=o.x-r(o,s)/2,p=s.x+r(s,o)/2,w=y.depth||1;return ct(e,u?function(n){n.x*=t[0];n.y=n.depth*t[1];delete n._tree}:function(n){n.x=(n.x-a)/(p-a)*t[0];n.y=n.depth/w*t[1];delete n._tree}),l}var f=n.layout.hierarchy().sort(null).value(null),r=cp,t=[1,1],u=!1;return i.separation=function(n){return arguments.length?(r=n,i):r},i.size=function(n){return arguments.length?(u=(t=n)==null,i):u?null:t},i.nodeSize=function(n){return arguments.length?(u=(t=n)!=null,i):u?t:null},tu(i,f)};n.layout.pack=function(){function i(n,i){var c=f.call(this,n,i),e=c[0],o=u[0],s=u[1],l=t==null?Math.sqrt:typeof t=="function"?t:function(){return t},h;return e.x=e.y=0,ct(e,function(n){n.r=+l(n.value)}),ct(e,vp),r&&(h=r*(t?1:Math.max(2*e.r/o,2*e.r/s))/2,ct(e,function(n){n.r+=h}),ct(e,vp),ct(e,function(n){n.r-=h})),yp(e,o/2,s/2,t?1:1/Math.max(2*e.r/o,2*e.r/s)),c}var f=n.layout.hierarchy().sort(att),r=0,u=[1,1],t;return i.size=function(n){return arguments.length?(u=n,i):u},i.radius=function(n){return arguments.length?(t=n==null||typeof n=="function"?n:+n,i):t},i.padding=function(n){return arguments.length?(r=+n,i):r},tu(i,f)};n.layout.cluster=function(){function i(n,i){var c=f.call(this,n,i),e=c[0],o,a=0;ct(e,function(n){var t=n.children;t&&t.length?(n.x=wtt(t),n.y=ptt(t)):(n.x=o?a+=r(n,o):0,n.y=0,o=n)});var s=wp(e),h=bp(e),l=s.x-r(s,h)/2,v=h.x+r(h,s)/2;return ct(e,u?function(n){n.x=(n.x-e.x)*t[0];n.y=(e.y-n.y)*t[1]}:function(n){n.x=(n.x-l)/(v-l)*t[0];n.y=(1-(e.y?n.y/e.y:1))*t[1]}),c}var f=n.layout.hierarchy().sort(null).value(null),r=cp,t=[1,1],u=!1;return i.separation=function(n){return arguments.length?(r=n,i):r},i.size=function(n){return arguments.length?(u=(t=n)==null,i):u?null:t},i.nodeSize=function(n){return arguments.length?(u=(t=n)!=null,i):u?t:null},tu(i,f)};n.layout.treemap=function(){function o(n,t){for(var r=-1,f=n.length,u,i;++r<f;)i=(u=n[r]).value*(t<0?0:t),u.area=isNaN(i)||i<=0?0:i}function a(n){var u=n.children;if(u&&u.length){var r=c(n),t=[],f=u.slice(),l,h=Infinity,v,e=i==="slice"?r.dx:i==="dice"?r.dy:i==="slice-dice"?n.depth&1?r.dy:r.dx:Math.min(r.dx,r.dy),y;for(o(f,r.dx*r.dy/n.value),t.area=0;(y=f.length)>0;)t.push(l=f[y-1]),t.area+=l.area,i!=="squarify"||(v=p(t,e))<=h?(f.pop(),h=v):(t.area-=t.pop().area,s(t,e,r,!1),e=Math.min(r.dx,r.dy),t.length=t.area=0,h=Infinity);t.length&&(s(t,e,r,!0),t.length=t.area=0);u.forEach(a)}}function v(n){var u=n.children;if(u&&u.length){var i=c(n),f=u.slice(),r,t=[];for(o(f,i.dx*i.dy/n.value),t.area=0;r=f.pop();)t.push(r),t.area+=r.area,r.z!=null&&(s(t,r.z?i.dx:i.dy,i,!f.length),t.length=t.area=0);u.forEach(v)}}function p(n,t){for(var i=n.area,r,u=0,f=Infinity,o=-1,s=n.length;++o<s;)(r=n[o].area)&&(r<f&&(f=r),r>u&&(u=r));return i*=i,t*=t,i?Math.max(t*u*e/i,i/(t*f*e)):Infinity}function s(n,t,i,u){var h=-1,c=n.length,o=i.x,s=i.y,e=t?r(n.area/t):0,f;if(t==i.dx){for((u||e>i.dy)&&(e=i.dy);++h<c;)f=n[h],f.x=o,f.y=s,f.dy=e,o+=f.dx=Math.min(i.x+i.dx-o,e?r(f.area/e):0);f.z=!0;f.dx+=i.x+i.dx-o;i.y+=e;i.dy-=e}else{for((u||e>i.dx)&&(e=i.dx);++h<c;)f=n[h],f.x=o,f.y=s,f.dx=e,s+=f.dy=Math.min(i.y+i.dy-s,e?r(f.area/e):0);f.z=!1;f.dy+=i.y+i.dy-s;i.x+=e;i.dx-=e}}function t(n){var i=u||h(n),t=i[0];return t.x=0,t.y=0,t.dx=f[0],t.dy=f[1],u&&h.revalue(t),o([t],t.dx*t.dy/t.value),(u?v:a)(t),l&&(u=i),i}var h=n.layout.hierarchy(),r=Math.round,f=[1,1],y=null,c=fh,l=!1,u,i="squarify",e=.5*(1+Math.sqrt(5));return t.size=function(n){return arguments.length?(f=n,t):f},t.padding=function(n){function u(i){var r=n.call(t,i,i.depth);return r==null?fh(i):kp(i,typeof r=="number"?[r,r,r,r]:r)}function i(t){return kp(t,n)}if(!arguments.length)return y;var r;return c=(y=n)==null?fh:(r=typeof n)=="function"?u:r==="number"?(n=[n,n,n,n],i):i,t},t.round=function(n){return arguments.length?(r=n?Math.round:Number,t):r!=Number},t.sticky=function(n){return arguments.length?(l=n,u=null,t):l},t.ratio=function(n){return arguments.length?(e=n,t):e},t.mode=function(n){return arguments.length?(i=n+"",t):i},tu(t,h)};n.random={normal:function(n,t){var i=arguments.length;return i<2&&(t=1),i<1&&(n=0),function(){var r,u,i;do r=Math.random()*2-1,u=Math.random()*2-1,i=r*r+u*u;while(!i||i>1);return n+t*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=n.random.normal.apply(n,arguments);return function(){return Math.exp(t())}},irwinHall:function(n){return function(){for(var t=0,i=0;i<n;i++)t+=Math.random();return t/n}}};n.scale={};cb={floor:a,ceil:a};n.scale.linear=function(){return dp([0,1],[0,1],ai,!1)};lb={s:1,g:1,p:1,r:1,e:1};n.scale.log=function(){return nw(n.scale.linear().domain([0,1]),10,!0,[1,10])};gc=n.format(".0e");ab={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};n.scale.pow=function(){return tw(n.scale.linear(),1,[0,1])};n.scale.sqrt=function(){return n.scale.pow().exponent(.5)};n.scale.ordinal=function(){return iw([],{t:"range",a:[[]]})};n.scale.category10=function(){return n.scale.ordinal().range(cut)};n.scale.category20=function(){return n.scale.ordinal().range(lut)};n.scale.category20b=function(){return n.scale.ordinal().range(aut)};n.scale.category20c=function(){return n.scale.ordinal().range(vut)};var cut=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(du),lut=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(du),aut=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(du),vut=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(du);n.scale.quantile=function(){return rw([],[])};n.scale.quantize=function(){return uw(0,1,[0,1])};n.scale.threshold=function(){return fw([.5],[0,1])};n.scale.identity=function(){return ew([0,1])};n.svg={};n.svg.arc=function(){function n(){var e=t.apply(this,arguments),n=i.apply(this,arguments),o=r.apply(this,arguments)+ui,s=u.apply(this,arguments)+ui,h=(s<o&&(h=o,o=s,s=h),s-o),c=h<f?"0":"1",l=Math.cos(o),a=Math.sin(o),v=Math.cos(s),y=Math.sin(s);return h>=vb?e?"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+-e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z":e?"M"+n*l+","+n*a+"A"+n+","+n+" 0 "+c+",1 "+n*v+","+n*y+"L"+e*v+","+e*y+"A"+e+","+e+" 0 "+c+",0 "+e*l+","+e*a+"Z":"M"+n*l+","+n*a+"A"+n+","+n+" 0 "+c+",1 "+n*v+","+n*y+"L0,0Z"}var t=nit,i=tit,r=ow,u=sw;return n.innerRadius=function(i){return arguments.length?(t=o(i),n):t},n.outerRadius=function(t){return arguments.length?(i=o(t),n):i},n.startAngle=function(t){return arguments.length?(r=o(t),n):r},n.endAngle=function(t){return arguments.length?(u=o(t),n):u},n.centroid=function(){var n=(t.apply(this,arguments)+i.apply(this,arguments))/2,f=(r.apply(this,arguments)+u.apply(this,arguments))/2+ui;return[Math.cos(f)*n,Math.sin(f)*n]},n};ui=-d;vb=k-t;n.svg.line=function(){return hw(a)};be=n.map({linear:g,"linear-closed":iit,step:rit,"step-before":lh,"step-after":ah,basis:cw,"basis-open":oit,"basis-closed":sit,bundle:hit,cardinal:eit,"cardinal-open":uit,"cardinal-closed":fit,monotone:ait});be.forEach(function(n,t){t.key=n;t.closed=/-closed$/.test(n)});var rk=[0,2/3,1/3,0],uk=[0,1/3,2/3,0],oi=[0,1/6,2/3,1/6];n.svg.line.radial=function(){var n=hw(lw);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n};lh.reverse=ah;ah.reverse=lh;n.svg.area=function(){return aw(a)};n.svg.area.radial=function(){var n=aw(lw);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n};n.svg.chord=function(){function n(n,u){var f=h(this,i,n,u),e=h(this,r,n,u);return"M"+f.p0+c(f.r,f.p1,f.a1-f.a0)+(l(f,e)?t(f.r,f.p1,f.r,f.p0):t(f.r,f.p1,e.r,e.p0)+c(e.r,e.p1,e.a1-e.a0)+t(e.r,e.p1,f.r,f.p0))+"Z"}function h(n,t,i,r){var o=t.call(n,i,r),f=u.call(n,o,r),h=e.call(n,o,r)+ui,c=s.call(n,o,r)+ui;return{r:f,a0:h,a1:c,p0:[f*Math.cos(h),f*Math.sin(h)],p1:[f*Math.cos(c),f*Math.sin(c)]}}function l(n,t){return n.a0==t.a0&&n.a1==t.a1}function c(n,t,i){return"A"+n+","+n+" 0 "+ +(i>f)+",1 "+t}function t(n,t,i,r){return"Q 0,0 "+r}var i=vs,r=ys,u=vit,e=ow,s=sw;return n.radius=function(t){return arguments.length?(u=o(t),n):u},n.source=function(t){return arguments.length?(i=o(t),n):i},n.target=function(t){return arguments.length?(r=o(t),n):r},n.startAngle=function(t){return arguments.length?(e=o(t),n):e},n.endAngle=function(t){return arguments.length?(s=o(t),n):s},n};n.svg.diagonal=function(){function n(n,u){var e=t.call(this,n,u),o=i.call(this,n,u),s=(e.y+o.y)/2,f=[e,{x:e.x,y:s},{x:o.x,y:s},o];return f=f.map(r),"M"+f[0]+"C"+f[1]+" "+f[2]+" "+f[3]}var t=vs,i=ys,r=vw;return n.source=function(i){return arguments.length?(t=o(i),n):t},n.target=function(t){return arguments.length?(i=o(t),n):i},n.projection=function(t){return arguments.length?(r=t,n):r},n};n.svg.diagonal.radial=function(){var t=n.svg.diagonal(),i=vw,r=t.projection;return t.projection=function(n){return arguments.length?r(yit(i=n)):i},t};n.svg.symbol=function(){function n(n,r){return(nl.get(t.call(this,n,r))||yw)(i.call(this,n,r))}var t=wit,i=pit;return n.type=function(i){return arguments.length?(t=o(i),n):t},n.size=function(t){return arguments.length?(i=o(t),n):i},n};nl=n.map({circle:yw,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*tl)),i=t*tl;return"M0,"+-t+"L"+i+",0 0,"+t+" "+-i+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/yu),i=t*yu/2;return"M0,"+i+"L"+t+","+-i+" "+-t+","+-i+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/yu),i=t*yu/2;return"M0,"+-i+"L"+t+","+i+" "+-t+","+i+"Z"}});n.svg.symbolTypes=nl.keys();yu=Math.sqrt(3);tl=Math.tan(30*r);l=[];il=0;l.call=e.call;l.empty=e.empty;l.node=e.node;l.size=e.size;n.transition=function(n){return arguments.length?di?n.transition():n:tc.transition()};n.transition.prototype=l;l.select=function(n){var f=this.id,o=[],e,i,t,r,s;for(n=ho(n),r=-1,s=this.length;++r<s;){o.push(e=[]);for(var h=this[r],u=-1,c=h.length;++u<c;)(t=h[u])&&(i=n.call(t,t.__data__,u,r))?("__data__"in t&&(i.__data__=t.__data__),wf(i,u,f,t.__transition__[f]),e.push(i)):e.push(null)}return ru(o,f)};l.selectAll=function(n){var u=this.id,s=[],h,f,t,e,c,i,l,r,a;for(n=dl(n),i=-1,l=this.length;++i<l;)for(var v=this[i],o=-1,y=v.length;++o<y;)if(t=v[o])for(c=t.__transition__[u],f=n.call(t,t.__data__,o,i),s.push(h=[]),r=-1,a=f.length;++r<a;)(e=f[r])&&wf(e,r,u,c),h.push(e);return ru(s,u)};l.filter=function(n){var f=[],e,u,i,t,o;for(typeof n!="function"&&(n=ea(n)),t=0,o=this.length;t<o;t++){f.push(e=[]);for(var u=this[t],r=0,s=u.length;r<s;r++)(i=u[r])&&n.call(i,i.__data__,r,t)&&e.push(i)}return ru(f,this.id)};l.tween=function(n,t){var i=this.id;return arguments.length<2?this.node().__transition__[i].tween.get(n):dt(this,t==null?function(t){t.__transition__[i].tween.remove(n)}:function(r){r.__transition__[i].tween.set(n,t)})};l.attr=function(t,i){function f(){this.removeAttribute(r)}function e(){this.removeAttributeNS(r.space,r.local)}function o(n){return n==null?f:(n+="",function(){var t=this.getAttribute(r),i;return t!==n&&(i=u(t,n),function(n){this.setAttribute(r,i(n))})})}function s(n){return n==null?e:(n+="",function(){var t=this.getAttributeNS(r.space,r.local),i;return t!==n&&(i=u(t,n),function(n){this.setAttributeNS(r.space,r.local,i(n))})})}if(arguments.length<2){for(i in t)this.attr(i,t[i]);return this}var u=t=="transform"?ep:ai,r=n.ns.qualify(t);return wh(this,"attr."+t,i,r.local?s:o)};l.attrTween=function(t,i){function u(n,t){var u=i.call(this,n,t,this.getAttribute(r));return u&&function(n){this.setAttribute(r,u(n))}}function f(n,t){var u=i.call(this,n,t,this.getAttributeNS(r.space,r.local));return u&&function(n){this.setAttributeNS(r.space,r.local,u(n))}}var r=n.ns.qualify(t);return this.tween("attr."+t,r.local?f:u)};l.style=function(n,t,i){function u(){this.style.removeProperty(n)}function f(t){return t==null?u:(t+="",function(){var r=v.getComputedStyle(this,null).getPropertyValue(n),u;return r!==t&&(u=ai(r,t),function(t){this.style.setProperty(n,u(t),i)})})}var r=arguments.length;if(r<3){if(typeof n!="string"){r<2&&(t="");for(i in n)this.style(i,n[i],t);return this}i=""}return wh(this,"style."+n,t,f)};l.styleTween=function(n,t,i){function r(r,u){var f=t.call(this,r,u,v.getComputedStyle(this,null).getPropertyValue(n));return f&&function(t){this.style.setProperty(n,f(t),i)}}return arguments.length<3&&(i=""),this.tween("style."+n,r)};l.text=function(n){return wh(this,"text",n,bit)};l.remove=function(){return this.each("end.transition",function(){var n;this.__transition__.count<2&&(n=this.parentNode)&&n.removeChild(this)})};l.ease=function(t){var i=this.id;return arguments.length<1?this.node().__transition__[i].ease:(typeof t!="function"&&(t=n.ease.apply(n,arguments)),dt(this,function(n){n.__transition__[i].ease=t}))};l.delay=function(n){var t=this.id;return dt(this,typeof n=="function"?function(i,r,u){i.__transition__[t].delay=+n.call(i,i.__data__,r,u)}:(n=+n,function(i){i.__transition__[t].delay=n}))};l.duration=function(n){var t=this.id;return dt(this,typeof n=="function"?function(i,r,u){i.__transition__[t].duration=Math.max(1,n.call(i,i.__data__,r,u))}:(n=Math.max(1,n),function(i){i.__transition__[t].duration=n}))};l.each=function(t,i){var r=this.id,u,f;return arguments.length<2?(u=ke,f=di,di=r,dt(this,function(n,i,u){ke=n.__transition__[r];t.call(n,n.__data__,i,u)}),ke=u,di=f):dt(this,function(u){var f=u.__transition__[r];(f.event||(f.event=n.dispatch("start","end"))).on(t,i)}),this};l.transition=function(){for(var s=this.id,f=++il,e=[],o,r,n,t,u=0,h=this.length;u<h;u++){e.push(o=[]);for(var r=this[u],i=0,c=r.length;i<c;i++)(n=r[i])&&(t=Object.create(n.__transition__[s]),t.delay+=t.duration,wf(n,i,f,t)),o.push(n)}return ru(e,f)};n.svg.axis=function(){function i(i){i.each(function(){var ut=n.select(this),p=this.__chart__||e,i=this.__chart__=e.copy(),ot=s==null?i.ticks?i.ticks.apply(i,o):i.domain():s,st=h==null?i.tickFormat?i.tickFormat.apply(i,o):a:h,w=ut.selectAll(".tick").data(ot,i),y=w.enter().insert("g",".domain").attr("class","tick").style("opacity",t),ht=n.transition(w.exit()).style("opacity",t).remove(),it=n.transition(w).style("opacity",1),v,l=vf(i),ft=ut.selectAll(".domain").data([0]),b=(ft.enter().append("path").attr("class","domain"),n.transition(ft)),rt,et;y.append("line");y.append("text");var k=y.select("line"),d=it.select("line"),g=w.select("text").text(st),nt=y.select("text"),tt=it.select("text");switch(c){case"bottom":v=pw;k.attr("y2",r);nt.attr("y",Math.max(r,0)+f);d.attr("x2",0).attr("y2",r);tt.attr("x",0).attr("y",Math.max(r,0)+f);g.attr("dy",".71em").style("text-anchor","middle");b.attr("d","M"+l[0]+","+u+"V0H"+l[1]+"V"+u);break;case"top":v=pw;k.attr("y2",-r);nt.attr("y",-(Math.max(r,0)+f));d.attr("x2",0).attr("y2",-r);tt.attr("x",0).attr("y",-(Math.max(r,0)+f));g.attr("dy","0em").style("text-anchor","middle");b.attr("d","M"+l[0]+","+-u+"V0H"+l[1]+"V"+-u);break;case"left":v=ww;k.attr("x2",-r);nt.attr("x",-(Math.max(r,0)+f));d.attr("x2",-r).attr("y2",0);tt.attr("x",-(Math.max(r,0)+f)).attr("y",0);g.attr("dy",".32em").style("text-anchor","end");b.attr("d","M"+-u+","+l[0]+"H0V"+l[1]+"H"+-u);break;case"right":v=ww;k.attr("x2",r);nt.attr("x",Math.max(r,0)+f);d.attr("x2",r).attr("y2",0);tt.attr("x",Math.max(r,0)+f).attr("y",0);g.attr("dy",".32em").style("text-anchor","start");b.attr("d","M"+u+","+l[0]+"H0V"+l[1]+"H"+u)}i.rangeBand?(rt=i,et=rt.rangeBand()/2,p=i=function(n){return rt(n)+et}):p.rangeBand?p=i:ht.call(v,i);y.call(v,p);it.call(v,i)})}var e=n.scale.linear(),c=rl,r=6,u=6,f=3,o=[10],s=null,h;return i.scale=function(n){return arguments.length?(e=n,i):e},i.orient=function(n){return arguments.length?(c=n in yb?n+"":rl,i):c},i.ticks=function(){return arguments.length?(o=arguments,i):o},i.tickValues=function(n){return arguments.length?(s=n,i):s},i.tickFormat=function(n){return arguments.length?(h=n,i):h},i.tickSize=function(n){var t=arguments.length;return t?(r=+n,u=+arguments[t-1],i):r},i.innerTickSize=function(n){return arguments.length?(r=+n,i):r},i.outerTickSize=function(n){return arguments.length?(u=+n,i):u},i.tickPadding=function(n){return arguments.length?(f=+n,i):f},i.tickSubdivide=function(){return arguments.length&&i},i};rl="bottom";yb={top:1,right:1,bottom:1,left:1};n.svg.brush=function(){function f(t){t.each(function(){var i=n.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",b).on("touchstart.brush",b),h=i.selectAll(".background").data([0]),e,o,s,t;h.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair");i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");e=i.selectAll(".resize").data(l,a);e.exit().remove();e.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return yut[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden");e.style("display",f.empty()?"none":null);o=n.transition(i);s=n.transition(h);r&&(t=vf(r),s.attr("x",t[0]).attr("width",t[1]-t[0]),p(o));u&&(t=vf(u),s.attr("y",t[0]).attr("height",t[1]-t[0]),w(o));y(o)})}function y(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+t[+/e$/.test(n)]+","+i[+/^s/.test(n)]+")"})}function p(n){n.select(".extent").attr("x",t[0]);n.selectAll(".extent,.n>rect,.s>rect").attr("width",t[1]-t[0])}function w(n){n.select(".extent").attr("y",i[0]);n.selectAll(".extent,.e>rect,.w>rect").attr("height",i[1]-i[0])}function b(){function ht(){n.event.keyCode==32&&(a||(b=null,l[0]-=t[1],l[1]-=i[1],a=2),bt())}function ct(){n.event.keyCode==32&&a==2&&(l[0]+=t[1],l[1]+=i[1],a=0,bt())}function g(){var f=n.mouse(nt),e=!1;tt&&(f[0]+=tt[0],f[1]+=tt[1]);a||(n.event.altKey?(b||(b=[(t[0]+t[1])/2,(i[0]+i[1])/2]),l[0]=t[+(f[0]<b[0])],l[1]=i[+(f[1]<b[1])]):b=null);lt&&ot(f,r,0)&&(p(k),e=!0);at&&ot(f,u,1)&&(w(k),e=!0);e&&(y(k),rt({type:"brush",mode:a?"move":"resize"}))}function ot(n,r,u){var k=vf(r),p=k[0],w=k[1],c=l[u],v=u?i:t,d=v[1]-v[0],f,y;return a&&(p-=c,w-=d+c),f=(u?h:s)?Math.max(p,Math.min(w,n[u])):n[u],a?y=(f+=c)+d:(b&&(c=Math.max(p,Math.min(w,2*b[u]-f))),c<f?(y=f,f=c):y=c),v[0]!=f||v[1]!=y?(u?o=null:e=null,v[0]=f,v[1]=y,!0):void 0}function st(){g();k.style("pointer-events","all").selectAll(".resize").style("display",f.empty()?"none":null);n.select("body").style("cursor",null);ut.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null);vt();rt({type:"brushend"})}var nt=this,it=n.select(n.event.target),rt=c.of(nt,arguments),k=n.select(nt),d=it.datum(),lt=!/^(n|s)$/.test(d)&&r,at=!/^(e|w)$/.test(d)&&u,a=it.classed("extent"),vt=wu(),b,l=n.mouse(nt),tt,ut=n.select(v).on("keydown.brush",ht).on("keyup.brush",ct),ft,et;if(n.event.changedTouches)ut.on("touchmove.brush",g).on("touchend.brush",st);else ut.on("mousemove.brush",g).on("mouseup.brush",st);k.interrupt().selectAll("*").interrupt();a?(l[0]=t[0]-l[0],l[1]=i[0]-l[1]):d?(ft=+/w$/.test(d),et=+/^n/.test(d),tt=[t[1-ft]-l[0],i[1-et]-l[1]],l[0]=t[ft],l[1]=i[et]):n.event.altKey&&(b=l.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null);n.select("body").style("cursor",it.style("cursor"));rt({type:"brushstart"});g()}var c=so(f,"brushstart","brush","brushend"),r=null,u=null,t=[0,0],i=[0,0],e,o,s=!0,h=!0,l=cl[0];return f.event=function(r){r.each(function(){var u=c.of(this,arguments),r={x:t,y:i,i:e,j:o},f=this.__chart__||r;this.__chart__=r;di?n.select(this).transition().each("start.brush",function(){e=f.i;o=f.j;t=f.x;i=f.y;u({type:"brushstart"})}).tween("brush:brush",function(){var n=lf(t,r.x),f=lf(i,r.y);return e=o=null,function(e){t=r.x=n(e);i=r.y=f(e);u({type:"brush",mode:"resize"})}}).each("end.brush",function(){e=r.i;o=r.j;u({type:"brush",mode:"resize"});u({type:"brushend"})}):(u({type:"brushstart"}),u({type:"brush",mode:"resize"}),u({type:"brushend"}))})},f.x=function(n){return arguments.length?(r=n,l=cl[!r<<1|!u],f):r},f.y=function(n){return arguments.length?(u=n,l=cl[!r<<1|!u],f):u},f.clamp=function(n){return arguments.length?(r&&u?(s=!!n[0],h=!!n[1]):r?s=!!n:u&&(h=!!n),f):r&&u?[s,h]:r?s:u?h:null},f.extent=function(n){var s,h,c,l,a;return arguments.length?(r&&(s=n[0],h=n[1],u&&(s=s[0],h=h[0]),e=[s,h],r.invert&&(s=r(s),h=r(h)),h<s&&(a=s,s=h,h=a),(s!=t[0]||h!=t[1])&&(t=[s,h])),u&&(c=n[0],l=n[1],r&&(c=c[1],l=l[1]),o=[c,l],u.invert&&(c=u(c),l=u(l)),l<c&&(a=c,c=l,l=a),(c!=i[0]||l!=i[1])&&(i=[c,l])),f):(r&&(e?(s=e[0],h=e[1]):(s=t[0],h=t[1],r.invert&&(s=r.invert(s),h=r.invert(h)),h<s&&(a=s,s=h,h=a))),u&&(o?(c=o[0],l=o[1]):(c=i[0],l=i[1],u.invert&&(c=u.invert(c),l=u.invert(l)),l<c&&(a=c,c=l,l=a))),r&&u?[[s,c],[h,l]]:r?[s,h]:u&&[c,l])},f.clear=function(){return f.empty()||(t=[0,0],i=[0,0],e=o=null),f},f.empty=function(){return!!r&&t[0]==t[1]||!!u&&i[0]==i[1]},n.rebind(f,c,"on")};var yut={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},cl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],i=n.time={},y=Date;lt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){wt.setUTCDate.apply(this._,arguments)},setDay:function(){wt.setUTCDay.apply(this._,arguments)},setFullYear:function(){wt.setUTCFullYear.apply(this._,arguments)},setHours:function(){wt.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){wt.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){wt.setUTCMinutes.apply(this._,arguments)},setMonth:function(){wt.setUTCMonth.apply(this._,arguments)},setSeconds:function(){wt.setUTCSeconds.apply(this._,arguments)},setTime:function(){wt.setTime.apply(this._,arguments)}};var wt=Date.prototype,ll=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],al=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],vl=["January","February","March","April","May","June","July","August","September","October","November","December"],yl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];i.year=vi(function(n){return n=i.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()});i.years=i.year.range;i.years.utc=i.year.utc.range;i.day=vi(function(n){var t=new y(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1});i.days=i.day.range;i.days.utc=i.day.utc.range;i.dayOfYear=function(n){var t=i.year(n);return Math.floor((n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5)};["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].forEach(function(n,t){n=n.toLowerCase();t=7-t;var r=i[n]=vi(function(n){return(n=i.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+Math.floor(t)*7)},function(n){var r=i.year(n).getDay();return Math.floor((i.dayOfYear(n)+(r+t)%7)/7)-(r!==t)});i[n+"s"]=r.range;i[n+"s"].utc=r.utc.range;i[n+"OfYear"]=function(n){var r=i.year(n).getDay();return Math.floor((i.dayOfYear(n)+(r+t)%7)/7)}});i.week=i.sunday;i.weeks=i.sunday.range;i.weeks.utc=i.sunday.utc.range;i.weekOfYear=i.sundayOfYear;i.format=p;var fk=df(ll),put=gf(ll),ek=df(al),wut=gf(al),ok=df(vl),but=gf(vl),sk=df(yl),kut=gf(yl),hk=/^%/,ck={"-":"",_:" ","0":"0"},io={a:function(n){return al[n.getDay()]},A:function(n){return ll[n.getDay()]},b:function(n){return yl[n.getMonth()]},B:function(n){return vl[n.getMonth()]},c:p("%a %b %e %X %Y"),d:function(n,t){return w(n.getDate(),t,2)},e:function(n,t){return w(n.getDate(),t,2)},H:function(n,t){return w(n.getHours(),t,2)},I:function(n,t){return w(n.getHours()%12||12,t,2)},j:function(n,t){return w(1+i.dayOfYear(n),t,3)},L:function(n,t){return w(n.getMilliseconds(),t,3)},m:function(n,t){return w(n.getMonth()+1,t,2)},M:function(n,t){return w(n.getMinutes(),t,2)},p:function(n){return n.getHours()>=12?"PM":"AM"},S:function(n,t){return w(n.getSeconds(),t,2)},U:function(n,t){return w(i.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return w(i.mondayOfYear(n),t,2)},x:p("%m/%d/%Y"),X:p("%H:%M:%S"),y:function(n,t){return w(n.getFullYear()%100,t,2)},Y:function(n,t){return w(n.getFullYear()%1e4,t,4)},Z:brt,"%":function(){return"%"}},dut={a:kit,A:dit,b:irt,B:rrt,c:urt,d:bw,e:bw,H:kw,I:kw,j:art,L:prt,m:lrt,M:vrt,p:wrt,S:yrt,U:nrt,w:git,W:trt,x:frt,X:ert,y:srt,Y:ort,Z:hrt,"%":krt};h=/^\s*\d+/;pb=n.map({am:0,pm:1});p.utc=ft;ul=ft("%Y-%m-%dT%H:%M:%S.%LZ");p.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?bh:ul;bh.parse=function(n){var t=new Date(n);return isNaN(t)?null:t};bh.toString=ul.toString;i.second=vi(function(n){return new y(Math.floor(n/1e3)*1e3)},function(n,t){n.setTime(n.getTime()+Math.floor(t)*1e3)},function(n){return n.getSeconds()});i.seconds=i.second.range;i.seconds.utc=i.second.utc.range;i.minute=vi(function(n){return new y(Math.floor(n/6e4)*6e4)},function(n,t){n.setTime(n.getTime()+Math.floor(t)*6e4)},function(n){return n.getMinutes()});i.minutes=i.minute.range;i.minutes.utc=i.minute.utc.range;i.hour=vi(function(n){var t=n.getTimezoneOffset()/60;return new y((Math.floor(n/36e5-t)+t)*36e5)},function(n,t){n.setTime(n.getTime()+Math.floor(t)*36e5)},function(n){return n.getHours()});i.hours=i.hour.range;i.hours.utc=i.hour.utc.range;i.month=vi(function(n){return n=i.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()});i.months=i.month.range;i.months.utc=i.month.utc.range;var ro=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],pl=[[i.second,1],[i.second,5],[i.second,15],[i.second,30],[i.minute,1],[i.minute,5],[i.minute,15],[i.minute,30],[i.hour,1],[i.hour,3],[i.hour,6],[i.hour,12],[i.day,1],[i.day,2],[i.week,1],[i.month,1],[i.month,3],[i.year,1]],gut=[[p("%Y"),fr],[p("%B"),function(n){return n.getMonth()}],[p("%b %d"),function(n){return n.getDate()!=1}],[p("%a %d"),function(n){return n.getDay()&&n.getDate()!=1}],[p("%I %p"),function(n){return n.getHours()}],[p("%I:%M"),function(n){return n.getMinutes()}],[p(":%S"),function(n){return n.getSeconds()}],[p(".%L"),function(n){return n.getMilliseconds()}]],nft=dw(gut);pl.year=i.year;i.scale=function(){return kh(n.scale.linear(),pl,nft)};var tft={range:function(t,i,r){return n.range(+t,+i,r).map(yi)}},lk=pl.map(function(n){return[n[0].utc,n[1]]}),ift=[[ft("%Y"),fr],[ft("%B"),function(n){return n.getUTCMonth()}],[ft("%b %d"),function(n){return n.getUTCDate()!=1}],[ft("%a %d"),function(n){return n.getUTCDay()&&n.getUTCDate()!=1}],[ft("%I %p"),function(n){return n.getUTCHours()}],[ft("%I:%M"),function(n){return n.getUTCMinutes()}],[ft(":%S"),function(n){return n.getUTCSeconds()}],[ft(".%L"),function(n){return n.getUTCMilliseconds()}]],rft=dw(ift);return lk.year=i.year.utc,i.scale.utc=function(){return kh(n.scale.linear(),lk,rft)},n.text=ts(function(n){return n.responseText}),n.json=function(n,t){return is(n,"application/json",drt,t)},n.html=function(n,t){return is(n,"text/html",grt,t)},n.xml=ts(function(n){return n.responseXML}),n}(),function(){var p=this,at=p._,e={},r=Array.prototype,nt=Object.prototype,vt=Function.prototype,o=Date.now||function(){return(new Date).getTime()},tt=r.push,t=r.slice,s=r.concat,f=nt.toString,yt=nt.hasOwnProperty,it=r.forEach,rt=r.map,ut=r.reduce,ft=r.reduceRight,et=r.filter,ot=r.every,st=r.some,h=r.indexOf,ht=r.lastIndexOf,pt=Array.isArray,wt=Object.keys,w=vt.bind,n=function(t){if(t instanceof n)return t;if(!(this instanceof n))return new n(t);this._wrapped=t},i,b,k,c,l,d,a,v,u,ct,lt,y;typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=n),exports._=n):p._=n;n.VERSION="1.5.2";i=n.each=n.forEach=function(t,i,r){var f,u,o;if(t!=null)if(it&&t.forEach===it)t.forEach(i,r);else if(t.length===+t.length){for(u=0,o=t.length;u<o;u++)if(i.call(r,t[u],u,t)===e)return}else for(f=n.keys(t),u=0,o=f.length;u<o;u++)if(i.call(r,t[f[u]],f[u],t)===e)return};n.map=n.collect=function(n,t,r){var u=[];return n==null?u:rt&&n.map===rt?n.map(t,r):(i(n,function(n,i,f){u.push(t.call(r,n,i,f))}),u)};b="Reduce of empty array with no initial value";n.reduce=n.foldl=n.inject=function(t,r,u,f){var e=arguments.length>2;if(t==null&&(t=[]),ut&&t.reduce===ut)return f&&(r=n.bind(r,f)),e?t.reduce(r,u):t.reduce(r);if(i(t,function(n,t,i){e?u=r.call(f,u,n,t,i):(u=n,e=!0)}),!e)throw new TypeError(b);return u};n.reduceRight=n.foldr=function(t,r,u,f){var o=arguments.length>2,e,s;if(t==null&&(t=[]),ft&&t.reduceRight===ft)return f&&(r=n.bind(r,f)),o?t.reduceRight(r,u):t.reduceRight(r);if(e=t.length,e!==+e&&(s=n.keys(t),e=s.length),i(t,function(n,i,h){i=s?s[--e]:--e;o?u=r.call(f,u,t[i],i,h):(u=t[i],o=!0)}),!o)throw new TypeError(b);return u};n.find=n.detect=function(n,t,i){var r;return k(n,function(n,u,f){if(t.call(i,n,u,f))return r=n,!0}),r};n.filter=n.select=function(n,t,r){var u=[];return n==null?u:et&&n.filter===et?n.filter(t,r):(i(n,function(n,i,f){t.call(r,n,i,f)&&u.push(n)}),u)};n.reject=function(t,i,r){return n.filter(t,function(n,t,u){return!i.call(r,n,t,u)},r)};n.every=n.all=function(t,r,u){r||(r=n.identity);var f=!0;return t==null?f:ot&&t.every===ot?t.every(r,u):(i(t,function(n,t,i){if(!(f=f&&r.call(u,n,t,i)))return e}),!!f)};k=n.some=n.any=function(t,r,u){r||(r=n.identity);var f=!1;return t==null?f:st&&t.some===st?t.some(r,u):(i(t,function(n,t,i){if(f||(f=r.call(u,n,t,i)))return e}),!!f)};n.contains=n.include=function(n,t){return n==null?!1:h&&n.indexOf===h?n.indexOf(t)!=-1:k(n,function(n){return n===t})};n.invoke=function(i,r){var u=t.call(arguments,2),f=n.isFunction(r);return n.map(i,function(n){return(f?r:n[r]).apply(n,u)})};n.pluck=function(t,i){return n.map(t,function(n){return n[i]})};n.where=function(t,i,r){return n.isEmpty(i)?r?void 0:[]:n[r?"find":"filter"](t,function(n){for(var t in i)if(i[t]!==n[t])return!1;return!0})};n.findWhere=function(t,i){return n.where(t,i,!0)};n.max=function(t,r,u){if(!r&&n.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!r&&n.isEmpty(t))return-Infinity;var f={computed:-Infinity,value:-Infinity};return i(t,function(n,t,i){var e=r?r.call(u,n,t,i):n;e>f.computed&&(f={value:n,computed:e})}),f.value};n.min=function(t,r,u){if(!r&&n.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!r&&n.isEmpty(t))return Infinity;var f={computed:Infinity,value:Infinity};return i(t,function(n,t,i){var e=r?r.call(u,n,t,i):n;e<f.computed&&(f={value:n,computed:e})}),f.value};n.shuffle=function(t){var u,f=0,r=[];return i(t,function(t){u=n.random(f++);r[f-1]=r[u];r[u]=t}),r};n.sample=function(t,i,r){return i==null||r?(t.length!==+t.length&&(t=n.values(t)),t[n.random(t.length-1)]):n.shuffle(t).slice(0,Math.max(0,i))};c=function(t){return n.isFunction(t)?t:function(n){return n[t]}};n.sortBy=function(t,i,r){var u=i==null?n.identity:c(i);return n.pluck(n.map(t,function(n,t,i){return{value:n,index:t,criteria:u.call(r,n,t,i)}}).sort(function(n,t){var i=n.criteria,r=t.criteria;if(i!==r){if(i>r||i===void 0)return 1;if(i<r||r===void 0)return-1}return n.index-t.index}),"value")};l=function(t){return function(r,u,f){var e={},o=u==null?n.identity:c(u);return i(r,function(n,i){var u=o.call(f,n,i,r);t(e,u,n)}),e}};n.groupBy=l(function(t,i,r){(n.has(t,i)?t[i]:t[i]=[]).push(r)});n.indexBy=l(function(n,t,i){n[t]=i});n.countBy=l(function(t,i){n.has(t,i)?t[i]++:t[i]=1});n.sortedIndex=function(t,i,r,u){var f;r=r==null?n.identity:c(r);for(var s=r.call(u,i),e=0,o=t.length;e<o;)f=e+o>>>1,r.call(u,t[f])<s?e=f+1:o=f;return e};n.toArray=function(i){return i?n.isArray(i)?t.call(i):i.length===+i.length?n.map(i,n.identity):n.values(i):[]};n.size=function(t){return t==null?0:t.length===+t.length?t.length:n.keys(t).length};n.first=n.head=n.take=function(n,i,r){if(n!=null)return i==null||r?n[0]:t.call(n,0,i)};n.initial=function(n,i,r){return t.call(n,0,n.length-(i==null||r?1:i))};n.last=function(n,i,r){if(n!=null)return i==null||r?n[n.length-1]:t.call(n,Math.max(n.length-i,0))};n.rest=n.tail=n.drop=function(n,i,r){return t.call(n,i==null||r?1:i)};n.compact=function(t){return n.filter(t,n.identity)};d=function(t,r,u){return r&&n.every(t,n.isArray)?s.apply(u,t):(i(t,function(t){n.isArray(t)||n.isArguments(t)?r?tt.apply(u,t):d(t,r,u):u.push(t)}),u)};n.flatten=function(n,t){return d(n,t,[])};n.without=function(i){return n.difference(i,t.call(arguments,1))};n.uniq=n.unique=function(t,r,u,f){n.isFunction(r)&&(f=u,u=r,r=!1);var s=u?n.map(t,u,f):t,o=[],e=[];return i(s,function(i,u){(r?u&&e[e.length-1]===i:n.contains(e,i))||(e.push(i),o.push(t[u]))}),o};n.union=function(){return n.uniq(n.flatten(arguments,!0))};n.intersection=function(i){var r=t.call(arguments,1);return n.filter(n.uniq(i),function(t){return n.every(r,function(i){return n.indexOf(i,t)>=0})})};n.difference=function(i){var u=s.apply(r,t.call(arguments,1));return n.filter(i,function(t){return!n.contains(u,t)})};n.zip=function(){for(var i=n.max(n.pluck(arguments,"length").concat(0)),r=new Array(i),t=0;t<i;t++)r[t]=n.pluck(arguments,""+t);return r};n.object=function(n,t){var r,i,u;if(n==null)return{};for(r={},i=0,u=n.length;i<u;i++)t?r[n[i]]=t[i]:r[n[i][0]]=n[i][1];return r};n.indexOf=function(t,i,r){if(t==null)return-1;var u=0,f=t.length;if(r)if(typeof r=="number")u=r<0?Math.max(0,f+r):r;else return u=n.sortedIndex(t,i),t[u]===i?u:-1;if(h&&t.indexOf===h)return t.indexOf(i,r);for(;u<f;u++)if(t[u]===i)return u;return-1};n.lastIndexOf=function(n,t,i){var u,r;if(n==null)return-1;if(u=i!=null,ht&&n.lastIndexOf===ht)return u?n.lastIndexOf(t,i):n.lastIndexOf(t);for(r=u?i:n.length;r--;)if(n[r]===t)return r;return-1};n.range=function(n,t,i){arguments.length<=1&&(t=n||0,n=0);i=arguments[2]||1;for(var r=Math.max(Math.ceil((t-n)/i),0),u=0,f=new Array(r);u<r;)f[u++]=n,n+=i;return f};a=function(){};n.bind=function(i,r){var u,f;if(w&&i.bind===w)return w.apply(i,t.call(arguments,1));if(!n.isFunction(i))throw new TypeError;return u=t.call(arguments,2),f=function(){var e,n;return this instanceof f?(a.prototype=i.prototype,e=new a,a.prototype=null,n=i.apply(e,u.concat(t.call(arguments))),Object(n)===n)?n:e:i.apply(r,u.concat(t.call(arguments)))}};n.partial=function(n){var i=t.call(arguments,1);return function(){return n.apply(this,i.concat(t.call(arguments)))}};n.bindAll=function(r){var u=t.call(arguments,1);if(u.length===0)throw new Error("bindAll must be passed function names");return i(u,function(t){r[t]=n.bind(r[t],r)}),r};n.memoize=function(t,i){var r={};return i||(i=n.identity),function(){var u=i.apply(this,arguments);return n.has(r,u)?r[u]:r[u]=t.apply(this,arguments)}};n.delay=function(n,i){var r=t.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},i)};n.defer=function(i){return n.delay.apply(n,[i,1].concat(t.call(arguments,1)))};n.throttle=function(n,t,i){var r,u,s,f=null,e=0,h;return i||(i={}),h=function(){e=i.leading===!1?0:o();f=null;s=n.apply(r,u);r=u=null},function(){var c=o(),l;return e||i.leading!==!1||(e=c),l=t-(c-e),r=this,u=arguments,l<=0?(clearTimeout(f),f=null,e=c,s=n.apply(r,u),r=u=null):f||i.trailing===!1||(f=setTimeout(h,l)),s}};n.debounce=function(n,t,i){var r,u,f,s,e;return function(){f=this;u=arguments;s=o();var h=function(){var c=o()-s;c<t?r=setTimeout(h,t-c):(r=null,i||(e=n.apply(f,u),f=u=null))},c=i&&!r;return r||(r=setTimeout(h,t)),c&&(e=n.apply(f,u),f=u=null),e}};n.once=function(n){var i=!1,t;return function(){return i?t:(i=!0,t=n.apply(this,arguments),n=null,t)}};n.wrap=function(t,i){return n.partial(i,t)};n.compose=function(){var n=arguments;return function(){for(var t=arguments,i=n.length-1;i>=0;i--)t=[n[i].apply(this,t)];return t[0]}};n.after=function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}};n.keys=wt||function(t){var i,r;if(t!==Object(t))throw new TypeError("Invalid object");i=[];for(r in t)n.has(t,r)&&i.push(r);return i};n.values=function(t){for(var r=n.keys(t),u=r.length,f=new Array(u),i=0;i<u;i++)f[i]=t[r[i]];return f};n.pairs=function(t){for(var r=n.keys(t),u=r.length,f=new Array(u),i=0;i<u;i++)f[i]=[r[i],t[r[i]]];return f};n.invert=function(t){for(var u={},r=n.keys(t),i=0,f=r.length;i<f;i++)u[t[r[i]]]=r[i];return u};n.functions=n.methods=function(t){var r=[],i;for(i in t)n.isFunction(t[i])&&r.push(i);return r.sort()};n.extend=function(n){return i(t.call(arguments,1),function(t){if(t)for(var i in t)n[i]=t[i]}),n};n.pick=function(n){var u={},f=s.apply(r,t.call(arguments,1));return i(f,function(t){t in n&&(u[t]=n[t])}),u};n.omit=function(i){var f={},e=s.apply(r,t.call(arguments,1)),u;for(u in i)n.contains(e,u)||(f[u]=i[u]);return f};n.defaults=function(n){return i(t.call(arguments,1),function(t){if(t)for(var i in t)n[i]===void 0&&(n[i]=t[i])}),n};n.clone=function(t){return n.isObject(t)?n.isArray(t)?t.slice():n.extend({},t):t};n.tap=function(n,t){return t(n),n};v=function(t,i,r,u){var l,a,h,c,e,o,s;if(t===i)return t!==0||1/t==1/i;if(t==null||i==null)return t===i;if(t instanceof n&&(t=t._wrapped),i instanceof n&&(i=i._wrapped),l=f.call(t),l!=f.call(i))return!1;switch(l){case"[object String]":return t==String(i);case"[object Number]":return t!=+t?i!=+i:t==0?1/t==1/i:t==+i;case"[object Date]":case"[object Boolean]":return+t==+i;case"[object RegExp]":return t.source==i.source&&t.global==i.global&&t.multiline==i.multiline&&t.ignoreCase==i.ignoreCase}if(typeof t!="object"||typeof i!="object")return!1;for(a=r.length;a--;)if(r[a]==t)return u[a]==i;if(h=t.constructor,c=i.constructor,h!==c&&!(n.isFunction(h)&&h instanceof h&&n.isFunction(c)&&c instanceof c)&&"constructor"in t&&"constructor"in i)return!1;if(r.push(t),u.push(i),e=0,o=!0,l=="[object Array]"){if(e=t.length,o=e==i.length,o)while(e--)if(!(o=v(t[e],i[e],r,u)))break}else{for(s in t)if(n.has(t,s)&&(e++,!(o=n.has(i,s)&&v(t[s],i[s],r,u))))break;if(o){for(s in i)if(n.has(i,s)&&!e--)break;o=!e}}return r.pop(),u.pop(),o};n.isEqual=function(n,t){return v(n,t,[],[])};n.isEmpty=function(t){if(t==null)return!0;if(n.isArray(t)||n.isString(t))return t.length===0;for(var i in t)if(n.has(t,i))return!1;return!0};n.isElement=function(n){return!!(n&&n.nodeType===1)};n.isArray=pt||function(n){return f.call(n)=="[object Array]"};n.isObject=function(n){return n===Object(n)};i(["Arguments","Function","String","Number","Date","RegExp"],function(t){n["is"+t]=function(n){return f.call(n)=="[object "+t+"]"}});n.isArguments(arguments)||(n.isArguments=function(t){return!!(t&&n.has(t,"callee"))});typeof/./!="function"&&(n.isFunction=function(n){return typeof n=="function"});n.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))};n.isNaN=function(t){return n.isNumber(t)&&t!=+t};n.isBoolean=function(n){return n===!0||n===!1||f.call(n)=="[object Boolean]"};n.isNull=function(n){return n===null};n.isUndefined=function(n){return n===void 0};n.has=function(n,t){return yt.call(n,t)};n.noConflict=function(){return p._=at,this};n.identity=function(n){return n};n.times=function(n,t,i){for(var u=Array(Math.max(0,n)),r=0;r<n;r++)u[r]=t.call(i,r);return u};n.random=function(n,t){return t==null&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};u={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};u.unescape=n.invert(u.escape);ct={escape:new RegExp("["+n.keys(u.escape).join("")+"]","g"),unescape:new RegExp("("+n.keys(u.unescape).join("|")+")","g")};n.each(["escape","unescape"],function(t){n[t]=function(n){return n==null?"":(""+n).replace(ct[t],function(n){return u[t][n]})}});n.result=function(t,i){if(t==null)return void 0;var r=t[i];return n.isFunction(r)?r.call(t):r};n.mixin=function(t){i(n.functions(t),function(i){var r=n[i]=t[i];n.prototype[i]=function(){var t=[this._wrapped];return tt.apply(t,arguments),y.call(this,r.apply(n,t))}})};lt=0;n.uniqueId=function(n){var t=++lt+"";return n?n+t:t};n.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var g=/(.)^/,bt={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},kt=/\\|'|\r|\n|\t|\u2028|\u2029/g;n.template=function(t,i,r){var f,e;r=n.defaults({},r,n.templateSettings);var h=new RegExp([(r.escape||g).source,(r.interpolate||g).source,(r.evaluate||g).source].join("|")+"|$","g"),o=0,u="__p+='";t.replace(h,function(n,i,r,f,e){return u+=t.slice(o,e).replace(kt,function(n){return"\\"+bt[n]}),i&&(u+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'"),r&&(u+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),f&&(u+="';\n"+f+"\n__p+='"),o=e+n.length,n});u+="';\n";r.variable||(u="with(obj||{}){\n"+u+"}\n");u="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+u+"return __p;\n";try{f=new Function(r.variable||"obj","_",u)}catch(s){s.source=u;throw s;}return i?f(i,n):(e=function(t){return f.call(this,t,n)},e.source="function("+(r.variable||"obj")+"){\n"+u+"}",e)};n.chain=function(t){return n(t).chain()};y=function(t){return this._chain?n(t).chain():t};n.mixin(n);i(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var i=r[t];n.prototype[t]=function(){var n=this._wrapped;return i.apply(n,arguments),(t=="shift"||t=="splice")&&n.length===0&&delete n[0],y.call(this,n)}});i(["concat","join","slice"],function(t){var i=r[t];n.prototype[t]=function(){return y.call(this,i.apply(this._wrapped,arguments))}});n.extend(n.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}});typeof define=="function"&&define.amd&&define("underscore",[],function(){return n})}.call(this)