/*! * jQuery JavaScript Library v2.0.3 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03T13:30Z */ !function(e,t){function n(e){var t=e.length,n=ot.type(e);return ot.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e){var t=dt[e]={};return ot.each(e.match(st)||[],function(e,n){t[n]=!0}),t}function i(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=ot.expando+Math.random()}function o(e,n,r){var i;if(r===t&&1===e.nodeType)if(i="data-"+n.replace(yt,"-$1").toLowerCase(),r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:vt.test(r)?JSON.parse(r):r}catch(o){}gt.set(e,n,r)}else r=t;return r}function a(){return!0}function s(){return!1}function u(){try{return W.activeElement}catch(e){}}function c(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function l(e,t,n){if(ot.isFunction(t))return ot.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return ot.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(Mt.test(t))return ot.filter(t,e,n);t=ot.filter(t,e)}return ot.grep(e,function(e){return tt.call(t,e)>=0!==n})}function f(e,t){return ot.nodeName(e,"table")&&ot.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function p(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function h(e){var t=Ft.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function d(e,t){for(var n=e.length,r=0;n>r;r++)mt.set(e[r],"globalEval",!t||mt.get(t[r],"globalEval"))}function g(e,t){var n,r,i,o,a,s,u,c;if(1===t.nodeType){if(mt.hasData(e)&&(o=mt.access(e),a=mt.set(t,o),c=o.events)){delete a.handle,a.events={};for(i in c)for(n=0,r=c[i].length;r>n;n++)ot.event.add(t,i,c[i][n])}gt.hasData(e)&&(s=gt.access(e),u=ot.extend({},s),gt.set(t,u))}}function m(e,n){var r=e.getElementsByTagName?e.getElementsByTagName(n||"*"):e.querySelectorAll?e.querySelectorAll(n||"*"):[];return n===t||n&&ot.nodeName(e,n)?ot.merge([e],r):r}function v(e,t){var n=t.nodeName.toLowerCase();"input"===n&&qt.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function y(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Kt.length;i--;)if(t=Kt[i]+n,t in e)return t;return r}function x(e,t){return e=t||e,"none"===ot.css(e,"display")||!ot.contains(e.ownerDocument,e)}function b(t){return e.getComputedStyle(t,null)}function $(e,t){for(var n,r,i,o=[],a=0,s=e.length;s>a;a++)r=e[a],r.style&&(o[a]=mt.get(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&x(r)&&(o[a]=mt.access(r,"olddisplay",k(r.nodeName)))):o[a]||(i=x(r),(n&&"none"!==n||!i)&&mt.set(r,"olddisplay",i?n:ot.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}function w(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function C(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=ot.css(e,n+Gt[o],!0,i)),r?("content"===n&&(a-=ot.css(e,"padding"+Gt[o],!0,i)),"margin"!==n&&(a-=ot.css(e,"border"+Gt[o]+"Width",!0,i))):(a+=ot.css(e,"padding"+Gt[o],!0,i),"padding"!==n&&(a+=ot.css(e,"border"+Gt[o]+"Width",!0,i)));return a}function S(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=b(e),a=ot.support.boxSizing&&"border-box"===ot.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Ut(e,t,o),(0>i||null==i)&&(i=e.style[t]),Xt.test(i))return i;r=a&&(ot.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+C(e,t,n||(a?"border":"content"),r,o)+"px"}function k(e){var t=W,n=Qt[e];return n||(n=T(e,t),"none"!==n&&n||(zt=(zt||ot("',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(U),C("BeforeChange",function(e,t,n){t!==n&&(t===U?B():n===U&&B(!0))}),C(u+"."+U,function(){B()})},getIframe:function(n,r){var i=n.src,o=t.st.iframe;e.each(o.patterns,function(){return i.indexOf(this.index)>-1?(this.id&&(i="string"==typeof this.id?i.substr(i.lastIndexOf(this.id)+this.id.length,i.length):this.id.call(this,i)),i=this.src.replace("%id%",i),!1):void 0});var a={};return o.srcAction&&(a[o.srcAction]=i),t._parseMarkup(r,a,n),t.updateStatus("ready"),r}}});var W=function(e){var n=t.items.length;return e>n-1?e-n:0>e?n+e:e},V=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,r=".mfp-gallery",o=Boolean(e.fn.mfpFastClick);return t.direction=!0,n&&n.enabled?(a+=" mfp-gallery",C(h+r,function(){n.navigateByImgClick&&t.wrap.on("click"+r,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),i.on("keydown"+r,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),C("UpdateStatus"+r,function(e,n){n.text&&(n.text=V(n.text,t.currItem.index,t.items.length))}),C(p+r,function(e,r,i,o){var a=t.items.length;i.counter=a>1?V(n.tCounter,o.index,a):""}),C("BuildControls"+r,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var r=n.arrowMarkup,i=t.arrowLeft=e(r.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(x),a=t.arrowRight=e(r.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(x),s=o?"mfpFastClick":"click";i[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(S("b",i[0],!1,!0),S("a",i[0],!1,!0),S("b",a[0],!1,!0),S("a",a[0],!1,!0)),t.container.append(i.add(a))}}),C(d+r,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),C(u+r,function(){i.off(r),t.wrap.off("click"+r),t.arrowLeft&&o&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=W(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=W(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,r=Math.min(n[0],t.items.length),i=Math.min(n[1],t.items.length);for(e=1;(t.direction?i:r)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?r:i)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=W(n),!t.items[n].preloaded){var r=t.items[n];r.parsed||(r=t.parseEl(n)),k("LazyLoad",r),"image"===r.type&&(r.img=e('').on("load.mfploader",function(){r.hasSize=!0}).on("error.mfploader",function(){r.hasSize=!0,r.loadError=!0,k("LazyLoadError",r)}).attr("src",r.src)),r.preloaded=!0}}}});var X="retina";e.magnificPopup.registerModule(X,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;n=isNaN(n)?n():n,n>1&&(C("ImageHasSize."+X,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),C("ElementParse."+X,function(t,r){r.src=e.replaceSrc(r,n)}))}}}}),function(){var t=1e3,n="ontouchstart"in window,r=function(){w.off("touchmove"+o+" touchend"+o)},i="mfpFastClick",o="."+i;e.fn.mfpFastClick=function(i){return e(this).each(function(){var a,s=e(this);if(n){var u,c,l,f,p,h;s.on("touchstart"+o,function(e){f=!1,h=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,l=p.clientY,w.on("touchmove"+o,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,h=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-l)>10)&&(f=!0,r())}).on("touchend"+o,function(e){r(),f||h>1||(a=!0,e.preventDefault(),clearTimeout(u),u=setTimeout(function(){a=!1},t),i())})})}s.on("click"+o,function(){a||i()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+o+" click"+o),n&&w.off("touchmove"+o+" touchend"+o)}}(),E()}(window.jQuery||window.Zepto),!function(){function e(e,t){return t>e?-1:e>t?1:e>=t?0:0/0}function t(e){return null!=e&&!isNaN(e)}function n(e){return{left:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}function r(e){return e.length}function i(e){for(var t=1;e*t%1;)t*=10;return t}function o(e,t){try{for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}catch(r){e.prototype=t}}function a(){}function s(e){return as+e in this}function u(e){return e=as+e,e in this&&delete this[e]}function c(){var e=[];return this.forEach(function(t){e.push(t)}),e}function l(){var e=0;for(var t in this)t.charCodeAt(0)===ss&&++e;return e}function f(){for(var e in this)if(e.charCodeAt(0)===ss)return!1;return!0}function p(){}function h(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}function d(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var n=0,r=us.length;r>n;++n){var i=us[n]+t;if(i in e)return i}}function g(){}function m(){}function v(e){function t(){for(var t,r=n,i=-1,o=r.length;++in;n++)for(var i,o=e[n],a=0,s=o.length;s>a;a++)(i=o[a])&&t(i,a,n);return e}function L(e){return ls(e,vs),e}function H(e){var t,n;return function(r,i,o){var a,s=e[o].update,u=s.length;for(o!=n&&(n=o,t=0),i>=t&&(t=i+1);!(a=s[t])&&++t0&&(e=e.substring(0,s));var c=xs.get(e);return c&&(e=c,u=U),s?t?i:r:t?g:o}function R(e,t){return function(n){var r=Wa.event;Wa.event=n,t[0]=this.__data__;try{e.apply(this,t)}finally{Wa.event=r}}}function U(e,t){var n=R(e,t);return function(e){var t=this,r=e.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||n.call(t,e)}}function z(){var e=".dragsuppress-"+ ++$s,t="click"+e,n=Wa.select(Za).on("touchmove"+e,y).on("dragstart"+e,y).on("selectstart"+e,y);if(bs){var r=Qa.style,i=r[bs];r[bs]="none"}return function(o){function a(){n.on(t,null)}n.on(e,null),bs&&(r[bs]=i),o&&(n.on(t,function(){y(),a()},!0),setTimeout(a,0))}}function B(e,t){t.changedTouches&&(t=t.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();if(0>ws&&(Za.scrollX||Za.scrollY)){n=Wa.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var i=n[0][0].getScreenCTM();ws=!(i.f||i.e),n.remove()}return ws?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}function W(){return Wa.event.changedTouches[0].identifier}function V(){return Wa.event.target}function X(){return Za}function Y(e){return e>0?1:0>e?-1:0}function Q(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function Z(e){return e>1?0:-1>e?Cs:Math.acos(e)}function J(e){return e>1?ks:-1>e?-ks:Math.asin(e)}function G(e){return((e=Math.exp(e))-1/e)/2}function K(e){return((e=Math.exp(e))+1/e)/2}function et(e){return((e=Math.exp(2*e))-1)/(e+1)}function tt(e){return(e=Math.sin(e/2))*e}function nt(){}function rt(e,t,n){return this instanceof rt?(this.h=+e,this.s=+t,void(this.l=+n)):arguments.length<2?e instanceof rt?new rt(e.h,e.s,e.l):vt(""+e,yt,rt):new rt(e,t,n)}function it(e,t,n){function r(e){return e>360?e-=360:0>e&&(e+=360),60>e?o+(a-o)*e/60:180>e?a:240>e?o+(a-o)*(240-e)/60:o}function i(e){return Math.round(255*r(e))}var o,a;return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)?0:0>t?0:t>1?1:t,n=0>n?0:n>1?1:n,a=.5>=n?n*(1+t):n+t-n*t,o=2*n-a,new ht(i(e+120),i(e),i(e-120))}function ot(e,t,n){return this instanceof ot?(this.h=+e,this.c=+t,void(this.l=+n)):arguments.length<2?e instanceof ot?new ot(e.h,e.c,e.l):e instanceof st?ct(e.l,e.a,e.b):ct((e=xt((e=Wa.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new ot(e,t,n)}function at(e,t,n){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new st(n,Math.cos(e*=Ms)*t,Math.sin(e)*t)}function st(e,t,n){return this instanceof st?(this.l=+e,this.a=+t,void(this.b=+n)):arguments.length<2?e instanceof st?new st(e.l,e.a,e.b):e instanceof ot?at(e.l,e.c,e.h):xt((e=ht(e)).r,e.g,e.b):new st(e,t,n)}function ut(e,t,n){var r=(e+16)/116,i=r+t/500,o=r-n/200;return i=lt(i)*Fs,r=lt(r)*Is,o=lt(o)*Rs,new ht(pt(3.2404542*i-1.5371385*r-.4985314*o),pt(-.969266*i+1.8760108*r+.041556*o),pt(.0556434*i-.2040259*r+1.0572252*o))}function ct(e,t,n){return e>0?new ot(Math.atan2(n,t)*As,Math.sqrt(t*t+n*n),e):new ot(0/0,0/0,e)}function lt(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function ft(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function pt(e){return Math.round(255*(.00304>=e?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function ht(e,t,n){return this instanceof ht?(this.r=~~e,this.g=~~t,void(this.b=~~n)):arguments.length<2?e instanceof ht?new ht(e.r,e.g,e.b):vt(""+e,ht,it):new ht(e,t,n)}function dt(e){return new ht(e>>16,255&e>>8,255&e)}function gt(e){return dt(e)+""}function mt(e){return 16>e?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function vt(e,t,n){var r,i,o,a=0,s=0,u=0;if(r=/([a-z]+)\((.*)\)/i.exec(e))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t($t(i[0]),$t(i[1]),$t(i[2]))}return(o=Bs.get(e))?t(o.r,o.g,o.b):(null==e||"#"!==e.charAt(0)||isNaN(o=parseInt(e.substring(1),16))||(4===e.length?(a=(3840&o)>>4,a=a>>4|a,s=240&o,s=s>>4|s,u=15&o,u=u<<4|u):7===e.length&&(a=(16711680&o)>>16,s=(65280&o)>>8,u=255&o)),t(a,s,u))}function yt(e,t,n){var r,i,o=Math.min(e/=255,t/=255,n/=255),a=Math.max(e,t,n),s=a-o,u=(a+o)/2;return s?(i=.5>u?s/(a+o):s/(2-a-o),r=e==a?(t-n)/s+(n>t?6:0):t==a?(n-e)/s+2:(e-t)/s+4,r*=60):(r=0/0,i=u>0&&1>u?0:r),new rt(r,i,u)}function xt(e,t,n){e=bt(e),t=bt(t),n=bt(n);var r=ft((.4124564*e+.3575761*t+.1804375*n)/Fs),i=ft((.2126729*e+.7151522*t+.072175*n)/Is),o=ft((.0193339*e+.119192*t+.9503041*n)/Rs);return st(116*i-16,500*(r-i),200*(i-o))}function bt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function $t(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}function wt(e){return"function"==typeof e?e:function(){return e}}function Ct(e){return e}function St(e){return function(t,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),kt(t,n,e,r)}}function kt(e,t,n,r){function i(){var e,t=u.status;if(!t&&u.responseText||t>=200&&300>t||304===t){try{e=n.call(o,u)}catch(r){return a.error.call(o,r),void 0}a.load.call(o,e)}else a.error.call(o,u)}var o={},a=Wa.dispatch("beforesend","progress","load","error"),s={},u=new XMLHttpRequest,c=null;return!Za.XDomainRequest||"withCredentials"in u||!/^(http(s)?:)?\/\//.test(e)||(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=i:u.onreadystatechange=function(){u.readyState>3&&i()},u.onprogress=function(e){var t=Wa.event;Wa.event=e;try{a.progress.call(o,u)}finally{Wa.event=t}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?s[e]:(null==t?delete s[e]:s[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",o):t},o.responseType=function(e){return arguments.length?(c=e,o):c},o.response=function(e){return n=e,o},["get","post"].forEach(function(e){o[e]=function(){return o.send.apply(o,[e].concat(Xa(arguments)))}}),o.send=function(n,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),u.open(n,e,!0),null==t||"accept"in s||(s.accept=t+",*/*"),u.setRequestHeader)for(var l in s)u.setRequestHeader(l,s[l]);return null!=t&&u.overrideMimeType&&u.overrideMimeType(t),null!=c&&(u.responseType=c),null!=i&&o.on("error",i).on("load",function(e){i(null,e)}),a.beforesend.call(o,u),u.send(null==r?null:r),o},o.abort=function(){return u.abort(),o},Wa.rebind(o,a,"on"),null==r?o:o.get(Tt(r))}function Tt(e){return 1===e.length?function(t,n){e(null==t?n:null)}:e}function Et(){var e=Mt(),t=At()-e;t>24?(isFinite(t)&&(clearTimeout(Ys),Ys=setTimeout(Et,t)),Xs=0):(Xs=1,Zs(Et))}function Mt(){var e=Date.now();for(Qs=Ws;Qs;)e>=Qs.t&&(Qs.f=Qs.c(e-Qs.t)),Qs=Qs.n;return e}function At(){for(var e,t=Ws,n=1/0;t;)t.f?t=e?e.n=t.n:Ws=t.n:(t.t8?function(e){return e/n}:function(e){return e*n},symbol:e}}function _t(e){var t=e.decimal,n=e.thousands,r=e.grouping,i=e.currency,o=r?function(e){for(var t=e.length,i=[],o=0,a=r[0];t>0&&a>0;)i.push(e.substring(t-=a,t+a)),a=r[o=(o+1)%r.length];return i.reverse().join(n)}:Ct;return function(e){var n=Gs.exec(e),r=n[1]||" ",a=n[2]||">",s=n[3]||"",u=n[4]||"",c=n[5],l=+n[6],f=n[7],p=n[8],h=n[9],d=1,g="",m="",v=!1;switch(p&&(p=+p.substring(1)),(c||"0"===r&&"="===a)&&(c=r="0",a="=",f&&(l-=Math.floor((l-1)/4))),h){case"n":f=!0,h="g"; break;case"%":d=100,m="%",h="f";break;case"p":d=100,m="%",h="r";break;case"b":case"o":case"x":case"X":"#"===u&&(g="0"+h.toLowerCase());case"c":case"d":v=!0,p=0;break;case"s":d=-1,h="r"}"$"===u&&(g=i[0],m=i[1]),"r"!=h||p||(h="g"),null!=p&&("g"==h?p=Math.max(1,Math.min(21,p)):("e"==h||"f"==h)&&(p=Math.max(0,Math.min(20,p)))),h=Ks.get(h)||jt;var y=c&&f;return function(e){var n=m;if(v&&e%1)return"";var i=0>e||0===e&&0>1/e?(e=-e,"-"):s;if(0>d){var u=Wa.formatPrefix(e,p);e=u.scale(e),n=u.symbol+m}else e*=d;e=h(e,p);var x=e.lastIndexOf("."),b=0>x?e:e.substring(0,x),$=0>x?"":t+e.substring(x+1);!c&&f&&(b=o(b));var w=g.length+b.length+$.length+(y?0:i.length),C=l>w?new Array(w=l-w+1).join(r):"";return y&&(b=o(C+b)),i+=g,e=b+$,("<"===a?i+e+C:">"===a?C+i+e:"^"===a?C.substring(0,w>>=1)+i+e+C.substring(w):i+(y?e:C+e))+n}}}function jt(e){return e+""}function Ot(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Pt(e,t,n){function r(t){var n=e(t),r=o(n,1);return r-t>t-n?n:r}function i(n){return t(n=e(new tu(n-1)),1),n}function o(e,n){return t(e=new tu(+e),n),e}function a(e,r,o){var a=i(e),s=[];if(o>1)for(;r>a;)n(a)%o||s.push(new Date(+a)),t(a,1);else for(;r>a;)s.push(new Date(+a)),t(a,1);return s}function s(e,t,n){try{tu=Ot;var r=new Ot;return r._=e,a(r,t,n)}finally{tu=Date}}e.floor=e,e.round=r,e.ceil=i,e.offset=o,e.range=a;var u=e.utc=qt(e);return u.floor=u,u.round=qt(r),u.ceil=qt(i),u.offset=qt(o),u.range=s,e}function qt(e){return function(t,n){try{tu=Ot;var r=new Ot;return r._=t,e(r,n)._}finally{tu=Date}}}function Lt(e){function t(e){function t(t){for(var n,i,o,a=[],s=-1,u=0;++ss;){if(r>=c)return-1;if(i=t.charCodeAt(s++),37===i){if(a=t.charAt(s++),o=A[a in ru?t.charAt(s++):a],!o||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(e,t,n){w.lastIndex=0;var r=w.exec(t.substring(n));return r?(e.w=C.get(r[0].toLowerCase()),n+r[0].length):-1}function i(e,t,n){b.lastIndex=0;var r=b.exec(t.substring(n));return r?(e.w=$.get(r[0].toLowerCase()),n+r[0].length):-1}function o(e,t,n){T.lastIndex=0;var r=T.exec(t.substring(n));return r?(e.m=E.get(r[0].toLowerCase()),n+r[0].length):-1}function a(e,t,n){S.lastIndex=0;var r=S.exec(t.substring(n));return r?(e.m=k.get(r[0].toLowerCase()),n+r[0].length):-1}function s(e,t,r){return n(e,M.c.toString(),t,r)}function u(e,t,r){return n(e,M.x.toString(),t,r)}function c(e,t,r){return n(e,M.X.toString(),t,r)}function l(e,t,n){var r=x.get(t.substring(n,n+=2).toLowerCase());return null==r?-1:(e.p=r,n)}var f=e.dateTime,p=e.date,h=e.time,d=e.periods,g=e.days,m=e.shortDays,v=e.months,y=e.shortMonths;t.utc=function(e){function n(e){try{tu=Ot;var t=new tu;return t._=e,r(t)}finally{tu=Date}}var r=t(e);return n.parse=function(e){try{tu=Ot;var t=r.parse(e);return t&&t._}finally{tu=Date}},n.toString=r.toString,n},t.multi=t.utc.multi=rn;var x=Wa.map(),b=Ft(g),$=It(g),w=Ft(m),C=It(m),S=Ft(v),k=It(v),T=Ft(y),E=It(y);d.forEach(function(e,t){x.set(e.toLowerCase(),t)});var M={a:function(e){return m[e.getDay()]},A:function(e){return g[e.getDay()]},b:function(e){return y[e.getMonth()]},B:function(e){return v[e.getMonth()]},c:t(f),d:function(e,t){return Ht(e.getDate(),t,2)},e:function(e,t){return Ht(e.getDate(),t,2)},H:function(e,t){return Ht(e.getHours(),t,2)},I:function(e,t){return Ht(e.getHours()%12||12,t,2)},j:function(e,t){return Ht(1+eu.dayOfYear(e),t,3)},L:function(e,t){return Ht(e.getMilliseconds(),t,3)},m:function(e,t){return Ht(e.getMonth()+1,t,2)},M:function(e,t){return Ht(e.getMinutes(),t,2)},p:function(e){return d[+(e.getHours()>=12)]},S:function(e,t){return Ht(e.getSeconds(),t,2)},U:function(e,t){return Ht(eu.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return Ht(eu.mondayOfYear(e),t,2)},x:t(p),X:t(h),y:function(e,t){return Ht(e.getFullYear()%100,t,2)},Y:function(e,t){return Ht(e.getFullYear()%1e4,t,4)},Z:tn,"%":function(){return"%"}},A={a:r,A:i,b:o,B:a,c:s,d:Qt,e:Qt,H:Jt,I:Jt,j:Zt,L:en,m:Yt,M:Gt,p:l,S:Kt,U:Ut,w:Rt,W:zt,x:u,X:c,y:Wt,Y:Bt,Z:Vt,"%":nn};return t}function Ht(e,t,n){var r=0>e?"-":"",i=(r?-e:e)+"",o=i.length;return r+(n>o?new Array(n-o+1).join(t)+i:i)}function Ft(e){return new RegExp("^(?:"+e.map(Wa.requote).join("|")+")","i")}function It(e){for(var t=new a,n=-1,r=e.length;++n68?1900:2e3)}function Yt(e,t,n){iu.lastIndex=0;var r=iu.exec(t.substring(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Qt(e,t,n){iu.lastIndex=0;var r=iu.exec(t.substring(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Zt(e,t,n){iu.lastIndex=0;var r=iu.exec(t.substring(n,n+3));return r?(e.j=+r[0],n+r[0].length):-1}function Jt(e,t,n){iu.lastIndex=0;var r=iu.exec(t.substring(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Gt(e,t,n){iu.lastIndex=0;var r=iu.exec(t.substring(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Kt(e,t,n){iu.lastIndex=0;var r=iu.exec(t.substring(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function en(e,t,n){iu.lastIndex=0;var r=iu.exec(t.substring(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function tn(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=~~(os(t)/60),i=os(t)%60;return n+Ht(r,"0",2)+Ht(i,"0",2)}function nn(e,t,n){ou.lastIndex=0;var r=ou.exec(t.substring(n,n+1));return r?n+r[0].length:-1}function rn(e){for(var t=e.length,n=-1;++n=0?1:-1,s=a*n,u=Math.cos(t),c=Math.sin(t),l=o*c,f=i*u+l*Math.cos(s),p=l*a*Math.sin(s);fu.add(Math.atan2(p,f)),r=e,i=u,o=c}var t,n,r,i,o;pu.point=function(a,s){pu.point=e,r=(t=a)*Ms,i=Math.cos(s=(n=s)*Ms/2+Cs/4),o=Math.sin(s)},pu.lineEnd=function(){e(t,n)}}function fn(e){var t=e[0],n=e[1],r=Math.cos(n);return[r*Math.cos(t),r*Math.sin(t),Math.sin(n)]}function pn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function hn(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function dn(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function gn(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function mn(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function vn(e){return[Math.atan2(e[1],e[0]),J(e[2])]}function yn(e,t){return os(e[0]-t[0])s;++s)i.point((n=e[s])[0],n[1]);return i.lineEnd(),void 0}var u=new En(n,e,null,!0),c=new En(n,null,u,!1);u.o=c,o.push(u),a.push(c),u=new En(r,e,null,!1),c=new En(r,null,u,!0),u.o=c,o.push(u),a.push(c)}}),a.sort(t),Tn(o),Tn(a),o.length){for(var s=0,u=n,c=a.length;c>s;++s)a[s].e=u=!u;for(var l,f,p=o[0];;){for(var h=p,d=!0;h.v;)if((h=h.n)===p)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(var s=0,c=l.length;c>s;++s)i.point((f=l[s])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d){l=h.p.z;for(var s=l.length-1;s>=0;--s)i.point((f=l[s])[0],f[1])}else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,l=h.z,d=!d}while(!h.v);i.lineEnd()}}}function Tn(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r0){for($||(o.polygonStart(),$=!0),o.lineStart();++a1&&2&t&&n.push(n.pop().concat(n.shift())),h.push(n.filter(An))}var h,d,g,m=t(o),v=i.invert(r[0],r[1]),y={point:a,lineStart:u,lineEnd:c,polygonStart:function(){y.point=l,y.lineStart=f,y.lineEnd=p,h=[],d=[]},polygonEnd:function(){y.point=a,y.lineStart=u,y.lineEnd=c,h=Wa.merge(h);var e=_n(v,d);h.length?($||(o.polygonStart(),$=!0),kn(h,Dn,e,n,o)):e&&($||(o.polygonStart(),$=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),$&&(o.polygonEnd(),$=!1),h=d=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}},x=Nn(),b=t(x),$=!1;return y}}function An(e){return e.length>1}function Nn(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,n){e.push([t,n])},lineEnd:g,buffer:function(){var n=t;return t=[],e=null,n},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Dn(e,t){return((e=e.x)[0]<0?e[1]-ks-Ts:ks-e[1])-((t=t.x)[0]<0?t[1]-ks-Ts:ks-t[1])}function _n(e,t){var n=e[0],r=e[1],i=[Math.sin(n),-Math.cos(n),0],o=0,a=0;fu.reset();for(var s=0,u=t.length;u>s;++s){var c=t[s],l=c.length;if(l)for(var f=c[0],p=f[0],h=f[1]/2+Cs/4,d=Math.sin(h),g=Math.cos(h),m=1;;){m===l&&(m=0),e=c[m];var v=e[0],y=e[1]/2+Cs/4,x=Math.sin(y),b=Math.cos(y),$=v-p,w=$>=0?1:-1,C=w*$,S=C>Cs,k=d*x;if(fu.add(Math.atan2(k*w*Math.sin(C),g*b+k*Math.cos(C))),o+=S?$+w*Ss:$,S^p>=n^v>=n){var T=hn(fn(f),fn(e));mn(T);var E=hn(i,T);mn(E);var M=(S^$>=0?-1:1)*J(E[2]);(r>M||r===M&&(T[0]||T[1]))&&(a+=S^$>=0?1:-1)}if(!m++)break;p=v,d=x,g=b,f=e}}return(-Ts>o||Ts>o&&0>fu)^1&a}function jn(e){var t,n=0/0,r=0/0,i=0/0;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?Cs:-Cs,u=os(o-n);os(u-Cs)0?ks:-ks),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&u>=Cs&&(os(n-i)Ts?Math.atan((Math.sin(t)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(t))*Math.sin(e))/(i*o*a)):(t+r)/2}function Pn(e,t,n,r){var i;if(null==e)i=n*ks,r.point(-Cs,i),r.point(0,i),r.point(Cs,i),r.point(Cs,0),r.point(Cs,-i),r.point(0,-i),r.point(-Cs,-i),r.point(-Cs,0),r.point(-Cs,i);else if(os(e[0]-t[0])>Ts){var o=e[0]o}function n(e){var n,o,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,p){var h,d=[f,p],g=t(f,p),m=a?g?0:i(f,p):g?i(f+(0>f?Cs:-Cs),p):0;if(!n&&(c=u=g)&&e.lineStart(),g!==u&&(h=r(n,d),(yn(n,h)||yn(d,h))&&(d[0]+=Ts,d[1]+=Ts,g=t(d[0],d[1]))),g!==u)l=0,g?(e.lineStart(),h=r(d,n),e.point(h[0],h[1])):(h=r(n,d),e.point(h[0],h[1]),e.lineEnd()),n=h;else if(s&&n&&a^g){var v;m&o||!(v=r(d,n,!0))||(l=0,a?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1])))}!g||n&&yn(n,d)||e.point(d[0],d[1]),n=d,u=g,o=m},lineEnd:function(){u&&e.lineEnd(),n=null},clean:function(){return l|(c&&u)<<1}}}function r(e,t,n){var r=fn(e),i=fn(t),a=[1,0,0],s=hn(r,i),u=pn(s,s),c=s[0],l=u-c*c;if(!l)return!n&&e;var f=o*u/l,p=-o*c/l,h=hn(a,s),d=gn(a,f),g=gn(s,p);dn(d,g);var m=h,v=pn(d,m),y=pn(m,m),x=v*v-y*(pn(d,d)-1);if(!(0>x)){var b=Math.sqrt(x),$=gn(m,(-v-b)/y);if(dn($,d),$=vn($),!n)return $;var w,C=e[0],S=t[0],k=e[1],T=t[1];C>S&&(w=C,C=S,S=w);var E=S-C,M=os(E-Cs)E;if(!M&&k>T&&(w=k,k=T,T=w),A?M?k+T>0^$[1]<(os($[0]-C)Cs^(C<=$[0]&&$[0]<=S)){var N=gn(m,(-v+b)/y);return dn(N,d),[$,vn(N)]}}}function i(t,n){var r=a?e:Cs-e,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>n?i|=4:n>r&&(i|=8),i}var o=Math.cos(e),a=o>0,s=os(o)>Ts,u=lr(e,6*Ms);return Mn(t,n,u,a?[0,-e]:[-Cs,e-Cs])}function Ln(e,t,n,r){return function(i){var o,a=i.a,s=i.b,u=a.x,c=a.y,l=s.x,f=s.y,p=0,h=1,d=l-u,g=f-c;if(o=e-u,d||!(o>0)){if(o/=d,0>d){if(p>o)return;h>o&&(h=o)}else if(d>0){if(o>h)return;o>p&&(p=o)}if(o=n-u,d||!(0>o)){if(o/=d,0>d){if(o>h)return;o>p&&(p=o)}else if(d>0){if(p>o)return;h>o&&(h=o)}if(o=t-c,g||!(o>0)){if(o/=g,0>g){if(p>o)return;h>o&&(h=o)}else if(g>0){if(o>h)return;o>p&&(p=o)}if(o=r-c,g||!(0>o)){if(o/=g,0>g){if(o>h)return;o>p&&(p=o)}else if(g>0){if(p>o)return;h>o&&(h=o)}return p>0&&(i.a={x:u+p*d,y:c+p*g}),1>h&&(i.b={x:u+h*d,y:c+h*g}),i}}}}}}function Hn(e,t,n,r){function i(r,i){return os(r[0]-e)0?0:3:os(r[0]-n)0?2:1:os(r[1]-t)0?1:0:i>0?3:2}function o(e,t){return a(e.x,t.x)}function a(e,t){var n=i(e,1),r=i(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(s){function u(e){for(var t=0,n=m.length,r=e[1],i=0;n>i;++i)for(var o,a=1,s=m[i],u=s.length,c=s[0];u>a;++a)o=s[a],c[1]<=r?o[1]>r&&Q(c,o,e)>0&&++t:o[1]<=r&&Q(c,o,e)<0&&--t,c=o;return 0!==t}function c(o,s,u,c){var l=0,f=0;if(null==o||(l=i(o,u))!==(f=i(s,u))||a(o,s)<0^u>0){do c.point(0===l||3===l?e:n,l>1?r:t);while((l=(l+u+4)%4)!==f)}else c.point(s[0],s[1])}function l(i,o){return i>=e&&n>=i&&o>=t&&r>=o}function f(e,t){l(e,t)&&s.point(e,t)}function p(){A.point=d,m&&m.push(v=[]),S=!0,C=!1,$=w=0/0}function h(){g&&(d(y,x),b&&C&&E.rejoin(),g.push(E.buffer())),A.point=f,C&&s.lineEnd()}function d(e,t){e=Math.max(-Tu,Math.min(Tu,e)),t=Math.max(-Tu,Math.min(Tu,t));var n=l(e,t);if(m&&v.push([e,t]),S)y=e,x=t,b=n,S=!1,n&&(s.lineStart(),s.point(e,t));else if(n&&C)s.point(e,t);else{var r={a:{x:$,y:w},b:{x:e,y:t}};M(r)?(C||(s.lineStart(),s.point(r.a.x,r.a.y)),s.point(r.b.x,r.b.y),n||s.lineEnd(),k=!1):n&&(s.lineStart(),s.point(e,t),k=!1)}$=e,w=t,C=n}var g,m,v,y,x,b,$,w,C,S,k,T=s,E=Nn(),M=Ln(e,t,n,r),A={point:f,lineStart:p,lineEnd:h,polygonStart:function(){s=E,g=[],m=[],k=!0},polygonEnd:function(){s=T,g=Wa.merge(g);var t=u([e,r]),n=k&&t,i=g.length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),c(null,null,1,s),s.lineEnd()),i&&kn(g,o,t,c,s),s.polygonEnd()),g=m=v=null}};return A}}function Fn(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}function In(e){var t=0,n=Cs/3,r=nr(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*Cs/180,n=e[1]*Cs/180):[180*(t/Cs),180*(n/Cs)]},i}function Rn(e,t){function n(e,t){var n=Math.sqrt(o-2*i*Math.sin(t))/i;return[n*Math.sin(e*=i),a-n*Math.cos(e)]}var r=Math.sin(e),i=(r+Math.sin(t))/2,o=1+r*(2*i-r),a=Math.sqrt(o)/i;return n.invert=function(e,t){var n=a-t;return[Math.atan2(e,n)/i,J((o-(e*e+n*n)*i*i)/(2*i))]},n}function Un(){function e(e,t){Mu+=i*e-r*t,r=e,i=t}var t,n,r,i;ju.point=function(o,a){ju.point=e,t=r=o,n=i=a},ju.lineEnd=function(){e(t,n)}}function zn(e,t){Au>e&&(Au=e),e>Du&&(Du=e),Nu>t&&(Nu=t),t>_u&&(_u=t)}function Bn(){function e(e,t){a.push("M",e,",",t,o)}function t(e,t){a.push("M",e,",",t),s.point=n}function n(e,t){a.push("L",e,",",t)}function r(){s.point=e}function i(){a.push("Z")}var o=Wn(4.5),a=[],s={point:e,lineStart:function(){s.point=t},lineEnd:r,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=r,s.point=e},pointRadius:function(e){return o=Wn(e),s},result:function(){if(a.length){var e=a.join("");return a=[],e}}};return s}function Wn(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Vn(e,t){gu+=e,mu+=t,++vu}function Xn(){function e(e,r){var i=e-t,o=r-n,a=Math.sqrt(i*i+o*o);yu+=a*(t+e)/2,xu+=a*(n+r)/2,bu+=a,Vn(t=e,n=r)}var t,n;Pu.point=function(r,i){Pu.point=e,Vn(t=r,n=i)}}function Yn(){Pu.point=Vn}function Qn(){function e(e,t){var n=e-r,o=t-i,a=Math.sqrt(n*n+o*o);yu+=a*(r+e)/2,xu+=a*(i+t)/2,bu+=a,a=i*e-r*t,$u+=a*(r+e),wu+=a*(i+t),Cu+=3*a,Vn(r=e,i=t)}var t,n,r,i;Pu.point=function(o,a){Pu.point=e,Vn(t=r=o,n=i=a)},Pu.lineEnd=function(){e(t,n)}}function Zn(e){function t(t,n){e.moveTo(t,n),e.arc(t,n,a,0,Ss)}function n(t,n){e.moveTo(t,n),s.point=r}function r(t,n){e.lineTo(t,n)}function i(){s.point=t}function o(){e.closePath()}var a=4.5,s={point:t,lineStart:function(){s.point=n},lineEnd:i,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=i,s.point=t},pointRadius:function(e){return a=e,s},result:g};return s}function Jn(e){function t(e){return(s?r:n)(e)}function n(t){return er(t,function(n,r){n=e(n,r),t.point(n[0],n[1])})}function r(t){function n(n,r){n=e(n,r),t.point(n[0],n[1])}function r(){x=0/0,S.point=o,t.lineStart()}function o(n,r){var o=fn([n,r]),a=e(n,r);i(x,b,y,$,w,C,x=a[0],b=a[1],y=n,$=o[0],w=o[1],C=o[2],s,t),t.point(x,b)}function a(){S.point=n,t.lineEnd()}function u(){r(),S.point=c,S.lineEnd=l}function c(e,t){o(f=e,p=t),h=x,d=b,g=$,m=w,v=C,S.point=o}function l(){i(x,b,y,$,w,C,h,d,f,g,m,v,s,t),S.lineEnd=a,a()}var f,p,h,d,g,m,v,y,x,b,$,w,C,S={point:n,lineStart:r,lineEnd:a,polygonStart:function(){t.polygonStart(),S.lineStart=u},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function i(t,n,r,s,u,c,l,f,p,h,d,g,m,v){var y=l-t,x=f-n,b=y*y+x*x;if(b>4*o&&m--){var $=s+h,w=u+d,C=c+g,S=Math.sqrt($*$+w*w+C*C),k=Math.asin(C/=S),T=os(os(C)-1)o||os((y*N+x*D)/b-.5)>.3||a>s*h+u*d+c*g)&&(i(t,n,r,s,u,c,M,A,T,$/=S,w/=S,C,m,v),v.point(M,A),i(M,A,T,$,w,C,l,f,p,h,d,g,m,v))}}var o=.5,a=Math.cos(30*Ms),s=16;return t.precision=function(e){return arguments.length?(s=(o=e*e)>0&&16,t):Math.sqrt(o)},t}function Gn(e){var t=Jn(function(t,n){return e([t*As,n*As])});return function(e){return rr(t(e))}}function Kn(e){this.stream=e}function er(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function tr(e){return nr(function(){return e})()}function nr(e){function t(e){return e=s(e[0]*Ms,e[1]*Ms),[e[0]*p+u,c-e[1]*p]}function n(e){return e=s.invert((e[0]-u)/p,(c-e[1])/p),e&&[e[0]*As,e[1]*As]}function r(){s=Fn(a=ar(v,y,x),o);var e=o(g,m);return u=h-e[0]*p,c=d+e[1]*p,i()}function i(){return l&&(l.valid=!1,l=null),t}var o,a,s,u,c,l,f=Jn(function(e,t){return e=o(e,t),[e[0]*p+u,c-e[1]*p]}),p=150,h=480,d=250,g=0,m=0,v=0,y=0,x=0,b=ku,$=Ct,w=null,C=null;return t.stream=function(e){return l&&(l.valid=!1),l=rr(b(a,f($(e)))),l.valid=!0,l},t.clipAngle=function(e){return arguments.length?(b=null==e?(w=e,ku):qn((w=+e)*Ms),i()):w},t.clipExtent=function(e){return arguments.length?(C=e,$=e?Hn(e[0][0],e[0][1],e[1][0],e[1][1]):Ct,i()):C},t.scale=function(e){return arguments.length?(p=+e,r()):p},t.translate=function(e){return arguments.length?(h=+e[0],d=+e[1],r()):[h,d]},t.center=function(e){return arguments.length?(g=e[0]%360*Ms,m=e[1]%360*Ms,r()):[g*As,m*As]},t.rotate=function(e){return arguments.length?(v=e[0]%360*Ms,y=e[1]%360*Ms,x=e.length>2?e[2]%360*Ms:0,r()):[v*As,y*As,x*As]},Wa.rebind(t,f,"precision"),function(){return o=e.apply(this,arguments),t.invert=o.invert&&n,r()}}function rr(e){return er(e,function(t,n){e.point(t*Ms,n*Ms)})}function ir(e,t){return[e,t]}function or(e,t){return[e>Cs?e-Ss:-Cs>e?e+Ss:e,t]}function ar(e,t,n){return e?t||n?Fn(ur(e),cr(t,n)):ur(e):t||n?cr(t,n):or}function sr(e){return function(t,n){return t+=e,[t>Cs?t-Ss:-Cs>t?t+Ss:t,n]}}function ur(e){var t=sr(e);return t.invert=sr(-e),t}function cr(e,t){function n(e,t){var n=Math.cos(t),s=Math.cos(e)*n,u=Math.sin(e)*n,c=Math.sin(t),l=c*r+s*i;return[Math.atan2(u*o-l*a,s*r-c*i),J(l*o+u*a)]}var r=Math.cos(e),i=Math.sin(e),o=Math.cos(t),a=Math.sin(t);return n.invert=function(e,t){var n=Math.cos(t),s=Math.cos(e)*n,u=Math.sin(e)*n,c=Math.sin(t),l=c*o-u*a;return[Math.atan2(u*o+c*a,s*r+l*i),J(l*r-s*i)]},n}function lr(e,t){var n=Math.cos(e),r=Math.sin(e);return function(i,o,a,s){var u=a*t;null!=i?(i=fr(n,i),o=fr(n,o),(a>0?o>i:i>o)&&(i+=a*Ss)):(i=e+a*Ss,o=e-.5*u);for(var c,l=i;a>0?l>o:o>l;l-=u)s.point((c=vn([n,-r*Math.cos(l),-r*Math.sin(l)]))[0],c[1])}}function fr(e,t){var n=fn(t);n[0]-=e,mn(n);var r=Z(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Ts)%(2*Math.PI)}function pr(e,t,n){var r=Wa.range(e,t-Ts,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function hr(e,t,n){var r=Wa.range(e,t-Ts,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function dr(e){return e.source}function gr(e){return e.target}function mr(e,t,n,r){var i=Math.cos(t),o=Math.sin(t),a=Math.cos(r),s=Math.sin(r),u=i*Math.cos(e),c=i*Math.sin(e),l=a*Math.cos(n),f=a*Math.sin(n),p=2*Math.asin(Math.sqrt(tt(r-t)+i*a*tt(n-e))),h=1/Math.sin(p),d=p?function(e){var t=Math.sin(e*=p)*h,n=Math.sin(p-e)*h,r=n*u+t*l,i=n*c+t*f,a=n*o+t*s;return[Math.atan2(i,r)*As,Math.atan2(a,Math.sqrt(r*r+i*i))*As]}:function(){return[e*As,t*As]};return d.distance=p,d}function vr(){function e(e,i){var o=Math.sin(i*=Ms),a=Math.cos(i),s=os((e*=Ms)-t),u=Math.cos(s);qu+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=r*o-n*a*u)*s),n*o+r*a*u),t=e,n=o,r=a}var t,n,r;Lu.point=function(i,o){t=i*Ms,n=Math.sin(o*=Ms),r=Math.cos(o),Lu.point=e},Lu.lineEnd=function(){Lu.point=Lu.lineEnd=g}}function yr(e,t){function n(t,n){var r=Math.cos(t),i=Math.cos(n),o=e(r*i);return[o*i*Math.sin(t),o*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),i=t(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(e*o,r*a),Math.asin(r&&n*o/r)]},n}function xr(e,t){function n(e,t){a>0?-ks+Ts>t&&(t=-ks+Ts):t>ks-Ts&&(t=ks-Ts);var n=a/Math.pow(i(t),o);return[n*Math.sin(o*e),a-n*Math.cos(o*e)]}var r=Math.cos(e),i=function(e){return Math.tan(Cs/4+e/2)},o=e===t?Math.sin(e):Math.log(r/Math.cos(t))/Math.log(i(t)/i(e)),a=r*Math.pow(i(e),o)/o;return o?(n.invert=function(e,t){var n=a-t,r=Y(o)*Math.sqrt(e*e+n*n);return[Math.atan2(e,n)/o,2*Math.atan(Math.pow(a/r,1/o))-ks]},n):$r}function br(e,t){function n(e,t){var n=o-t;return[n*Math.sin(i*e),o-n*Math.cos(i*e)]}var r=Math.cos(e),i=e===t?Math.sin(e):(r-Math.cos(t))/(t-e),o=r/i+e;return os(i)i;i++){for(;r>1&&Q(e[n[r-2]],e[n[r-1]],e[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Er(e,t){return e[0]-t[0]||e[1]-t[1]}function Mr(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function Ar(e,t,n,r){var i=e[0],o=n[0],a=t[0]-i,s=r[0]-o,u=e[1],c=n[1],l=t[1]-u,f=r[1]-c,p=(s*(u-c)-f*(i-o))/(f*a-s*l);return[i+p*a,u+p*l]}function Nr(e){var t=e[0],n=e[e.length-1];return!(t[0]-n[0]||t[1]-n[1])}function Dr(){Gr(this),this.edge=this.site=this.circle=null}function _r(e){var t=Qu.pop()||new Dr;return t.site=e,t}function jr(e){zr(e),Vu.remove(e),Qu.push(e),Gr(e)}function Or(e){var t=e.circle,n=t.x,r=t.cy,i={x:n,y:r},o=e.P,a=e.N,s=[e];jr(e);for(var u=o;u.circle&&os(n-u.circle.x)l;++l)c=s[l],u=s[l-1],Qr(c.edge,u.site,c.site,i);u=s[0],c=s[f-1],c.edge=Xr(u.site,c.site,null,i),Ur(u),Ur(c)}function Pr(e){for(var t,n,r,i,o=e.x,a=e.y,s=Vu._;s;)if(r=qr(s,a)-o,r>Ts)s=s.L;else{if(i=o-Lr(s,a),!(i>Ts)){r>-Ts?(t=s.P,n=s):i>-Ts?(t=s,n=s.N):t=n=s;break}if(!s.R){t=s;break}s=s.R}var u=_r(e);if(Vu.insert(t,u),t||n){if(t===n)return zr(t),n=_r(t.site),Vu.insert(u,n),u.edge=n.edge=Xr(t.site,u.site),Ur(t),Ur(n),void 0;if(!n)return u.edge=Xr(t.site,u.site),void 0;zr(t),zr(n);var c=t.site,l=c.x,f=c.y,p=e.x-l,h=e.y-f,d=n.site,g=d.x-l,m=d.y-f,v=2*(p*m-h*g),y=p*p+h*h,x=g*g+m*m,b={x:(m*y-h*x)/v+l,y:(p*x-g*y)/v+f};Qr(n.edge,c,d,b),u.edge=Xr(c,e,null,b),n.edge=Xr(e,d,null,b),Ur(t),Ur(n)}}function qr(e,t){var n=e.site,r=n.x,i=n.y,o=i-t;if(!o)return r;var a=e.P;if(!a)return-1/0;n=a.site;var s=n.x,u=n.y,c=u-t;if(!c)return s;var l=s-r,f=1/o-1/c,p=l/c;return f?(-p+Math.sqrt(p*p-2*f*(l*l/(-2*c)-u+c/2+i-o/2)))/f+r:(r+s)/2}function Lr(e,t){var n=e.N;if(n)return qr(n,t);var r=e.site;return r.y===t?r.x:1/0}function Hr(e){this.site=e,this.edges=[]}function Fr(e){for(var t,n,r,i,o,a,s,u,c,l,f=e[0][0],p=e[1][0],h=e[0][1],d=e[1][1],g=Wu,m=g.length;m--;)if(o=g[m],o&&o.prepare())for(s=o.edges,u=s.length,a=0;u>a;)l=s[a].end(),r=l.x,i=l.y,c=s[++a%u].start(),t=c.x,n=c.y,(os(r-t)>Ts||os(i-n)>Ts)&&(s.splice(a,0,new Zr(Yr(o.site,l,os(r-f)Ts?{x:f,y:os(t-f)Ts?{x:os(n-d)Ts?{x:p,y:os(t-p)Ts?{x:os(n-h)=-Es)){var h=u*u+c*c,d=l*l+f*f,g=(f*h-c*d)/p,m=(u*d-l*h)/p,f=m+s,v=Zu.pop()||new Rr;v.arc=e,v.site=i,v.x=g+a,v.y=f+Math.sqrt(g*g+m*m),v.cy=f,e.circle=v;for(var y=null,x=Yu._;x;)if(v.ym||m>=s)return;if(p>d){if(o){if(o.y>=c)return}else o={x:m,y:u};n={x:m,y:c}}else{if(o){if(o.yr||r>1)if(p>d){if(o){if(o.y>=c)return}else o={x:(u-i)/r,y:u};n={x:(c-i)/r,y:c}}else{if(o){if(o.yh){if(o){if(o.x>=s)return}else o={x:a,y:r*a+i};n={x:s,y:r*s+i}}else{if(o){if(o.xo&&(i=t.substring(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:fi(n,r)})),o=Ku.lastIndex;return or;++r)s[(n=u[r]).i]=n.x(e);return s.join("")})}function hi(e,t){for(var n,r=Wa.interpolators.length;--r>=0&&!(n=Wa.interpolators[r](e,t)););return n}function di(e,t){var n,r=[],i=[],o=e.length,a=t.length,s=Math.min(e.length,t.length);for(n=0;s>n;++n)r.push(hi(e[n],t[n]));for(;o>n;++n)i[n]=e[n];for(;a>n;++n)i[n]=t[n];return function(e){for(n=0;s>n;++n)i[n]=r[n](e);return i}}function gi(e){return function(t){return 0>=t?0:t>=1?1:e(t)}}function mi(e){return function(t){return 1-e(1-t)}}function vi(e){return function(t){return.5*(.5>t?e(2*t):2-e(2-2*t))}}function yi(e){return e*e}function xi(e){return e*e*e}function bi(e){if(0>=e)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(.5>e?n:3*(e-t)+n-.75)}function $i(e){return function(t){return Math.pow(t,e)}}function wi(e){return 1-Math.cos(e*ks)}function Ci(e){return Math.pow(2,10*(e-1))}function Si(e){return 1-Math.sqrt(1-e*e)}function ki(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/Ss*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*Math.pow(2,-10*r)*Math.sin((r-n)*Ss/t)}}function Ti(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}}function Ei(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375 }function Mi(e,t){e=Wa.hcl(e),t=Wa.hcl(t);var n=e.h,r=e.c,i=e.l,o=t.h-n,a=t.c-r,s=t.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?t.c:r),isNaN(o)?(o=0,n=isNaN(n)?t.h:n):o>180?o-=360:-180>o&&(o+=360),function(e){return at(n+o*e,r+a*e,i+s*e)+""}}function Ai(e,t){e=Wa.hsl(e),t=Wa.hsl(t);var n=e.h,r=e.s,i=e.l,o=t.h-n,a=t.s-r,s=t.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?t.s:r),isNaN(o)?(o=0,n=isNaN(n)?t.h:n):o>180?o-=360:-180>o&&(o+=360),function(e){return it(n+o*e,r+a*e,i+s*e)+""}}function Ni(e,t){e=Wa.lab(e),t=Wa.lab(t);var n=e.l,r=e.a,i=e.b,o=t.l-n,a=t.a-r,s=t.b-i;return function(e){return ut(n+o*e,r+a*e,i+s*e)+""}}function Di(e,t){return t-=e,function(n){return Math.round(e+t*n)}}function _i(e){var t=[e.a,e.b],n=[e.c,e.d],r=Oi(t),i=ji(t,n),o=Oi(Pi(n,t,-i))||0;t[0]*n[1]180?l+=360:l-c>180&&(c+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:fi(c,l)})):l&&r.push(r.pop()+"rotate("+l+")"),f!=p?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:fi(f,p)}):p&&r.push(r.pop()+"skewX("+p+")"),h[0]!=d[0]||h[1]!=d[1]?(n=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:n-4,x:fi(h[0],d[0])},{i:n-2,x:fi(h[1],d[1])})):(1!=d[0]||1!=d[1])&&r.push(r.pop()+"scale("+d+")"),n=i.length,function(e){for(var t,o=-1;++o=0;)n.push(i[r])}function Qi(e,t){for(var n=[e],r=[];null!=(e=n.pop());)if(r.push(e),(o=e.children)&&(i=o.length))for(var i,o,a=-1;++an;++n)(t=e[n][1])>i&&(r=n,i=t);return r}function ao(e){return e.reduce(so,0)}function so(e,t){return e+t[1]}function uo(e,t){return co(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function co(e,t){for(var n=-1,r=+e[0],i=(e[1]-r)/t,o=[];++n<=t;)o[n]=i*n+r;return o}function lo(e){return[Wa.min(e),Wa.max(e)]}function fo(e,t){return e.value-t.value}function po(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function ho(e,t){e._pack_next=t,t._pack_prev=e}function go(e,t){var n=t.x-e.x,r=t.y-e.y,i=e.r+t.r;return.999*i*i>n*n+r*r}function mo(e){function t(e){l=Math.min(e.x-e.r,l),f=Math.max(e.x+e.r,f),p=Math.min(e.y-e.r,p),h=Math.max(e.y+e.r,h)}if((n=e.children)&&(c=n.length)){var n,r,i,o,a,s,u,c,l=1/0,f=-1/0,p=1/0,h=-1/0;if(n.forEach(vo),r=n[0],r.x=-r.r,r.y=0,t(r),c>1&&(i=n[1],i.x=i.r,i.y=0,t(i),c>2))for(o=n[2],bo(r,i,o),t(o),po(r,o),r._pack_prev=o,po(o,i),i=r._pack_next,a=3;c>a;a++){bo(r,i,o=n[a]);var d=0,g=1,m=1;for(s=i._pack_next;s!==i;s=s._pack_next,g++)if(go(s,o)){d=1;break}if(1==d)for(u=r._pack_prev;u!==s._pack_prev&&!go(u,o);u=u._pack_prev,m++);d?(m>g||g==m&&i.ra;a++)o=n[a],o.x-=v,o.y-=y,x=Math.max(x,o.r+Math.sqrt(o.x*o.x+o.y*o.y));e.r=x,n.forEach(yo)}}function vo(e){e._pack_next=e._pack_prev=e}function yo(e){delete e._pack_next,delete e._pack_prev}function xo(e,t,n,r){var i=e.children;if(e.x=t+=r*e.x,e.y=n+=r*e.y,e.r*=r,i)for(var o=-1,a=i.length;++o=0;)t=i[o],t.z+=n,t.m+=n,n+=t.s+(r+=t.c)}function To(e,t,n){return e.a.parent===t.parent?e.a:n}function Eo(e){return 1+Wa.max(e,function(e){return e.y})}function Mo(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}function Ao(e){var t=e.children;return t&&t.length?Ao(t[0]):e}function No(e){var t,n=e.children;return n&&(t=n.length)?No(n[t-1]):e}function Do(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function _o(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],o=e.dy-t[0]-t[2];return 0>i&&(n+=i/2,i=0),0>o&&(r+=o/2,o=0),{x:n,y:r,dx:i,dy:o}}function jo(e){var t=e[0],n=e[e.length-1];return n>t?[t,n]:[n,t]}function Oo(e){return e.rangeExtent?e.rangeExtent():jo(e.range())}function Po(e,t,n,r){var i=n(e[0],e[1]),o=r(t[0],t[1]);return function(e){return o(i(e))}}function qo(e,t){var n,r=0,i=e.length-1,o=e[r],a=e[i];return o>a&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}function Lo(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:lc}function Ho(e,t,n,r){var i=[],o=[],a=0,s=Math.min(e.length,t.length)-1;for(e[s]2?Ho:Po,u=r?Hi:Li;return a=i(e,t,u,n),s=i(t,e,u,hi),o}function o(e){return a(e)}var a,s;return o.invert=function(e){return s(e)},o.domain=function(t){return arguments.length?(e=t.map(Number),i()):e},o.range=function(e){return arguments.length?(t=e,i()):t},o.rangeRound=function(e){return o.range(e).interpolate(Di)},o.clamp=function(e){return arguments.length?(r=e,i()):r},o.interpolate=function(e){return arguments.length?(n=e,i()):n},o.ticks=function(t){return zo(e,t)},o.tickFormat=function(t,n){return Bo(e,t,n)},o.nice=function(t){return Ro(e,t),i()},o.copy=function(){return Fo(e,t,n,r)},i()}function Io(e,t){return Wa.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Ro(e,t){return qo(e,Lo(Uo(e,t)[2]))}function Uo(e,t){null==t&&(t=10);var n=jo(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),o=t/r*i;return.15>=o?i*=10:.35>=o?i*=5:.75>=o&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function zo(e,t){return Wa.range.apply(Wa,Uo(e,t))}function Bo(e,t,n){var r=Uo(e,t);if(n){var i=Gs.exec(n);if(i.shift(),"s"===i[8]){var o=Wa.formatPrefix(Math.max(os(r[0]),os(r[1])));return i[7]||(i[7]="."+Wo(o.scale(r[2]))),i[8]="f",n=Wa.format(i.join("")),function(e){return n(o.scale(e))+o.symbol}}i[7]||(i[7]="."+Vo(i[8],r)),n=i.join("")}else n=",."+Wo(r[2])+"f";return Wa.format(n)}function Wo(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}function Vo(e,t){var n=Wo(t[2]);return e in fc?Math.abs(n-Wo(Math.max(os(t[0]),os(t[1]))))+ +("e"!==e):n-2*("%"===e)}function Xo(e,t,n,r){function i(e){return(n?Math.log(0>e?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function o(e){return n?Math.pow(t,e):-Math.pow(t,-e)}function a(t){return e(i(t))}return a.invert=function(t){return o(e.invert(t))},a.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((r=t.map(Number)).map(i)),a):r},a.base=function(n){return arguments.length?(t=+n,e.domain(r.map(i)),a):t},a.nice=function(){var t=qo(r.map(i),n?Math:hc);return e.domain(t),r=t.map(o),a},a.ticks=function(){var e=jo(r),a=[],s=e[0],u=e[1],c=Math.floor(i(s)),l=Math.ceil(i(u)),f=t%1?2:t;if(isFinite(l-c)){if(n){for(;l>c;c++)for(var p=1;f>p;p++)a.push(o(c)*p);a.push(o(c))}else for(a.push(o(c));c++0;p--)a.push(o(c)*p);for(c=0;a[c]u;l--);a=a.slice(c,l)}return a},a.tickFormat=function(e,t){if(!arguments.length)return pc;arguments.length<2?t=pc:"function"!=typeof t&&(t=Wa.format(t));var r,s=Math.max(.1,e/a.ticks().length),u=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(e){return e/o(u(i(e)+r))<=s?t(e):""}},a.copy=function(){return Xo(e.copy(),t,n,r)},Io(a,e)}function Yo(e,t,n){function r(t){return e(i(t))}var i=Qo(t),o=Qo(1/t);return r.invert=function(t){return o(e.invert(t))},r.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(i)),r):n},r.ticks=function(e){return zo(n,e)},r.tickFormat=function(e,t){return Bo(n,e,t)},r.nice=function(e){return r.domain(Ro(n,e))},r.exponent=function(a){return arguments.length?(i=Qo(t=a),o=Qo(1/t),e.domain(n.map(i)),r):t},r.copy=function(){return Yo(e.copy(),t,n)},Io(r,e)}function Qo(e){return function(t){return 0>t?-Math.pow(-t,e):Math.pow(t,e)}}function Zo(e,t){function n(n){return o[((i.get(n)||("range"===t.t?i.set(n,e.push(n)):0/0))-1)%o.length]}function r(t,n){return Wa.range(e.length).map(function(e){return t+n*e})}var i,o,s;return n.domain=function(r){if(!arguments.length)return e;e=[],i=new a;for(var o,s=-1,u=r.length;++se?[0/0,0/0]:[e>0?a[e-1]:n[0],et?0/0:t/o+e,[t,t+1/o]},r.copy=function(){return Go(e,t,n)},i()}function Ko(e,t){function n(n){return n>=n?t[Wa.bisect(e,n)]:void 0}return n.domain=function(t){return arguments.length?(e=t,n):e},n.range=function(e){return arguments.length?(t=e,n):t},n.invertExtent=function(n){return n=t.indexOf(n),[e[n-1],e[n]]},n.copy=function(){return Ko(e,t)},n}function ea(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=n.map(t),t):e},t.ticks=function(t){return zo(e,t)},t.tickFormat=function(t,n){return Bo(e,t,n)},t.copy=function(){return ea(e)},t}function ta(e){return e.innerRadius}function na(e){return e.outerRadius}function ra(e){return e.startAngle}function ia(e){return e.endAngle}function oa(e){function t(t){function a(){c.push("M",o(e(l),s))}for(var u,c=[],l=[],f=-1,p=t.length,h=wt(n),d=wt(r);++f1&&i.push("H",r[0]),i.join("")}function ca(e){for(var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];++t1){s=t[1],o=e[u],u++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var c=2;c9&&(i=3*t/Math.sqrt(i),a[s]=i*n,a[s+1]=i*r));for(s=-1;++s<=u;)i=(e[Math.min(u,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([i||0,a[s]*i||0]);return o}function ka(e){return e.length<3?aa(e):e[0]+da(e,Sa(e))}function Ta(e){for(var t,n,r,i=-1,o=e.length;++in?c():(i.active=n,o.event&&o.event.start.call(e,l,t),o.tween.forEach(function(n,r){(r=r.call(e,l,t))&&g.push(r)}),Wa.timer(function(){return d.c=u(r||1)?Sn:u,1},0,s),void 0)}function u(r){if(i.active!==n)return c();for(var a=r/h,s=f(a),u=g.length;u>0;)g[--u].call(e,s);return a>=1?(o.event&&o.event.end.call(e,l,t),c()):void 0}function c(){return--i.count?delete i[n]:delete e.__transition__,1}var l=e.__data__,f=o.ease,p=o.delay,h=o.duration,d=Qs,g=[];return d.t=p+s,r>=p?a(r-p):(d.c=a,void 0)},0,s)}}function Ha(e,t){e.attr("transform",function(e){return"translate("+t(e)+",0)"})}function Fa(e,t){e.attr("transform",function(e){return"translate(0,"+t(e)+")"})}function Ia(e){return e.toISOString()}function Ra(e,t,n){function r(t){return e(t)}function i(e,n){var r=e[1]-e[0],i=r/n,o=Wa.bisect(Hc,i);return o==Hc.length?[t.year,Uo(e.map(function(e){return e/31536e6}),n)[2]]:o?t[i/Hc[o-1]1?{floor:function(t){for(;n(t=e.floor(t));)t=Ua(t-1);return t},ceil:function(t){for(;n(t=e.ceil(t));)t=Ua(+t+1);return t}}:e))},r.ticks=function(e,t){var n=jo(r.domain()),o=null==e?i(n,10):"number"==typeof e?i(n,e):!e.range&&[{range:e},t];return o&&(e=o[0],t=o[1]),e.range(n[0],Ua(+n[1]+1),1>t?1:t)},r.tickFormat=function(){return n},r.copy=function(){return Ra(e.copy(),t,n)},Io(r,e)}function Ua(e){return new Date(e)}function za(e){return JSON.parse(e.responseText)}function Ba(e){var t=Ya.createRange();return t.selectNode(Ya.body),t.createContextualFragment(e.responseText)}var Wa={version:"3.4.11"};Date.now||(Date.now=function(){return+new Date});var Va=[].slice,Xa=function(e){return Va.call(e)},Ya=document,Qa=Ya.documentElement,Za=window;try{Xa(Qa.childNodes)[0].nodeType}catch(Ja){Xa=function(e){for(var t=e.length,n=new Array(t);t--;)n[t]=e[t];return n}}try{Ya.createElement("div").style.setProperty("opacity",0,"")}catch(Ga){var Ka=Za.Element.prototype,es=Ka.setAttribute,ts=Ka.setAttributeNS,ns=Za.CSSStyleDeclaration.prototype,rs=ns.setProperty;Ka.setAttribute=function(e,t){es.call(this,e,t+"")},Ka.setAttributeNS=function(e,t,n){ts.call(this,e,t,n+"")},ns.setProperty=function(e,t,n){rs.call(this,e,t+"",n)}}Wa.ascending=e,Wa.descending=function(e,t){return e>t?-1:t>e?1:t>=e?0:0/0},Wa.min=function(e,t){var n,r,i=-1,o=e.length;if(1===arguments.length){for(;++i=n);)n=void 0;for(;++ir&&(n=r)}else{for(;++i=n);)n=void 0;for(;++ir&&(n=r)}return n},Wa.max=function(e,t){var n,r,i=-1,o=e.length;if(1===arguments.length){for(;++i=n);)n=void 0;for(;++in&&(n=r)}else{for(;++i=n);)n=void 0;for(;++in&&(n=r)}return n},Wa.extent=function(e,t){var n,r,i,o=-1,a=e.length;if(1===arguments.length){for(;++o=n);)n=i=void 0;for(;++or&&(n=r),r>i&&(i=r))}else{for(;++o=n);)n=void 0;for(;++or&&(n=r),r>i&&(i=r))}return[n,i]},Wa.sum=function(e,t){var n,r=0,i=e.length,o=-1;if(1===arguments.length)for(;++o1&&(n=n.map(r)),n=n.filter(t),n.length?Wa.quantile(n.sort(e),.5):void 0};var is=n(e);Wa.bisectLeft=is.left,Wa.bisect=Wa.bisectRight=is.right,Wa.bisector=function(t){return n(1===t.length?function(n,r){return e(t(n),r)}:t)},Wa.shuffle=function(e){for(var t,n,r=e.length;r;)n=0|Math.random()*r--,t=e[r],e[r]=e[n],e[n]=t;return e},Wa.permute=function(e,t){for(var n=t.length,r=new Array(n);n--;)r[n]=e[t[n]];return r},Wa.pairs=function(e){for(var t,n=0,r=e.length-1,i=e[0],o=new Array(0>r?0:r);r>n;)o[n]=[t=i,i=e[++n]];return o},Wa.zip=function(){if(!(i=arguments.length))return[];for(var e=-1,t=Wa.min(arguments,r),n=new Array(t);++e=0;)for(r=e[i],t=r.length;--t>=0;)n[--a]=r[t];return n};var os=Math.abs;Wa.range=function(e,t,n){if(arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0)),1/0===(t-e)/n)throw new Error("infinite range");var r,o=[],a=i(os(n)),s=-1;if(e*=a,t*=a,n*=a,0>n)for(;(r=e+n*++s)>t;)o.push(r/a);else for(;(r=e+n*++s)=o.length)return r?r.call(i,s):n?s.sort(n):s;for(var c,l,f,p,h=-1,d=s.length,g=o[u++],m=new a;++h=o.length)return e;var r=[],i=s[n++];return e.forEach(function(e,i){r.push({key:e,values:t(i,n)})}),i?r.sort(function(e,t){return i(e.key,t.key)}):r}var n,r,i={},o=[],s=[];return i.map=function(t,n){return e(n,t,0)},i.entries=function(n){return t(e(Wa.map,n,0),0)},i.key=function(e){return o.push(e),i},i.sortKeys=function(e){return s[o.length-1]=e,i},i.sortValues=function(e){return n=e,i},i.rollup=function(e){return r=e,i},i},Wa.set=function(e){var t=new p;if(e)for(var n=0,r=e.length;r>n;++n)t.add(e[n]);return t},o(p,{has:s,add:function(e){return this[as+e]=!0,e},remove:function(e){return e=as+e,e in this&&delete this[e]},values:c,size:l,empty:f,forEach:function(e){for(var t in this)t.charCodeAt(0)===ss&&e.call(this,t.substring(1))}}),Wa.behavior={},Wa.rebind=function(e,t){for(var n,r=1,i=arguments.length;++r=0&&(r=e.substring(n+1),e=e.substring(0,n)),e)return arguments.length<2?this[e].on(r):this[e].on(r,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(r,null);return this}},Wa.event=null,Wa.requote=function(e){return e.replace(cs,"\\$&")};var cs=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ls={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]},fs=function(e,t){return t.querySelector(e)},ps=function(e,t){return t.querySelectorAll(e)},hs=Qa.matches||Qa[d(Qa,"matchesSelector")],ds=function(e,t){return hs.call(e,t)};"function"==typeof Sizzle&&(fs=function(e,t){return Sizzle(e,t)[0]||null},ps=Sizzle,ds=Sizzle.matchesSelector),Wa.selection=function(){return ys};var gs=Wa.selection.prototype=[];gs.select=function(e){var t,n,r,i,o=[];e=w(e);for(var a=-1,s=this.length;++a=0&&(n=e.substring(0,t),e=e.substring(t+1)),ms.hasOwnProperty(n)?{space:ms[n],local:e}:e}},gs.attr=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node();return e=Wa.ns.qualify(e),e.local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(t in e)this.each(S(t,e[t]));return this}return this.each(S(e,t))},gs.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node(),r=(e=E(e)).length,i=-1;if(t=n.classList){for(;++ir){if("string"!=typeof e){2>r&&(t="");for(n in e)this.each(N(n,e[n],t));return this}if(2>r)return Za.getComputedStyle(this.node(),null).getPropertyValue(e);n=""}return this.each(N(e,t,n))},gs.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(D(t,e[t]));return this}return this.each(D(e,t))},gs.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},gs.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},gs.append=function(e){return e=_(e),this.select(function(){return this.appendChild(e.apply(this,arguments))})},gs.insert=function(e,t){return e=_(e),t=w(t),this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})},gs.remove=function(){return this.each(function(){var e=this.parentNode;e&&e.removeChild(this)})},gs.data=function(e,t){function n(e,n){var r,i,o,s=e.length,f=n.length,p=Math.min(s,f),h=new Array(f),d=new Array(f),g=new Array(s);if(t){var m,v=new a,y=new a,x=[];for(r=-1;++rr;++r)d[r]=j(n[r]);for(;s>r;++r)g[r]=e[r]}d.update=h,d.parentNode=h.parentNode=g.parentNode=e.parentNode,u.push(d),c.push(h),l.push(g)}var r,i,o=-1,s=this.length;if(!arguments.length){for(e=new Array(s=(r=this[0]).length);++oo;o++){i.push(t=[]),t.parentNode=(n=this[o]).parentNode;for(var s=0,u=n.length;u>s;s++)(r=n[s])&&e.call(r,r.__data__,s,o)&&t.push(r)}return $(i)},gs.order=function(){for(var e=-1,t=this.length;++e=0;)(n=r[i])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},gs.sort=function(e){e=P.apply(this,arguments);for(var t=-1,n=this.length;++te;e++)for(var n=this[e],r=0,i=n.length;i>r;r++){var o=n[r];if(o)return o}return null},gs.size=function(){var e=0;return this.each(function(){++e}),e};var vs=[];Wa.selection.enter=L,Wa.selection.enter.prototype=vs,vs.append=gs.append,vs.empty=gs.empty,vs.node=gs.node,vs.call=gs.call,vs.size=gs.size,vs.select=function(e){for(var t,n,r,i,o,a=[],s=-1,u=this.length;++sr){if("string"!=typeof e){2>r&&(t=!1);for(n in e)this.each(I(n,e[n],t));return this}if(2>r)return(r=this.node()["__on"+e])&&r._;n=!1}return this.each(I(e,t,n))};var xs=Wa.map({mouseenter:"mouseover",mouseleave:"mouseout"}); xs.forEach(function(e){"on"+e in Ya&&xs.remove(e)});var bs="onselectstart"in Ya?null:d(Qa.style,"userSelect"),$s=0;Wa.mouse=function(e){return B(e,x())};var ws=/WebKit/.test(Za.navigator.userAgent)?-1:0;Wa.touches=function(e,t){return arguments.length<2&&(t=x().touches),t?Xa(t).map(function(t){var n=B(e,t);return n.identifier=t.identifier,n}):[]},Wa.behavior.drag=function(){function e(){this.on("mousedown.drag",i).on("touchstart.drag",o)}function t(e,t,i,o,a){return function(){function s(){var e,n,r=t(p,g);r&&(e=r[0]-x[0],n=r[1]-x[1],d|=e|n,x=r,h({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:e,dy:n}))}function u(){t(p,g)&&(v.on(o+m,null).on(a+m,null),y(d&&Wa.event.target===f),h({type:"dragend"}))}var c,l=this,f=Wa.event.target,p=l.parentNode,h=n.of(l,arguments),d=0,g=e(),m=".drag"+(null==g?"":"-"+g),v=Wa.select(i()).on(o+m,s).on(a+m,u),y=z(),x=t(p,g);r?(c=r.apply(l,arguments),c=[c.x-x[0],c.y-x[1]]):c=[0,0],h({type:"dragstart"})}}var n=b(e,"drag","dragstart","dragend"),r=null,i=t(g,Wa.mouse,X,"mousemove","mouseup"),o=t(W,Wa.touch,V,"touchmove","touchend");return e.origin=function(t){return arguments.length?(r=t,e):r},Wa.rebind(e,n,"on")};var Cs=Math.PI,Ss=2*Cs,ks=Cs/2,Ts=1e-6,Es=Ts*Ts,Ms=Cs/180,As=180/Cs,Ns=Math.SQRT2,Ds=2,_s=4;Wa.interpolateZoom=function(e,t){function n(e){var t=e*y;if(v){var n=K(g),a=o/(Ds*p)*(n*et(Ns*t+g)-G(g));return[r+a*c,i+a*l,o*n/K(Ns*t+g)]}return[r+e*c,i+e*l,o*Math.exp(Ns*t)]}var r=e[0],i=e[1],o=e[2],a=t[0],s=t[1],u=t[2],c=a-r,l=s-i,f=c*c+l*l,p=Math.sqrt(f),h=(u*u-o*o+_s*f)/(2*o*Ds*p),d=(u*u-o*o-_s*f)/(2*u*Ds*p),g=Math.log(Math.sqrt(h*h+1)-h),m=Math.log(Math.sqrt(d*d+1)-d),v=m-g,y=(v||Math.log(u/o))/Ns;return n.duration=1e3*y,n},Wa.behavior.zoom=function(){function e(e){e.on(E,c).on(Ps+".zoom",f).on("dblclick.zoom",p).on(N,l)}function t(e){return[(e[0]-S.x)/S.k,(e[1]-S.y)/S.k]}function n(e){return[e[0]*S.k+S.x,e[1]*S.k+S.y]}function r(e){S.k=Math.max(T[0],Math.min(T[1],e))}function i(e,t){t=n(t),S.x+=e[0]-t[0],S.y+=e[1]-t[1]}function o(){$&&$.domain(x.range().map(function(e){return(e-S.x)/S.k}).map(x.invert)),C&&C.domain(w.range().map(function(e){return(e-S.y)/S.k}).map(w.invert))}function a(e){e({type:"zoomstart"})}function s(e){o(),e({type:"zoom",scale:S.k,translate:[S.x,S.y]})}function u(e){e({type:"zoomend"})}function c(){function e(){l=1,i(Wa.mouse(r),p),s(c)}function n(){f.on(M,null).on(A,null),h(l&&Wa.event.target===o),u(c)}var r=this,o=Wa.event.target,c=D.of(r,arguments),l=0,f=Wa.select(Za).on(M,e).on(A,n),p=t(Wa.mouse(r)),h=z();F.call(r),a(c)}function l(){function e(){var e=Wa.touches(h);return p=S.k,e.forEach(function(e){e.identifier in g&&(g[e.identifier]=t(e))}),e}function n(){var t=Wa.event.target;Wa.select(t).on(b,o).on($,f),w.push(t);for(var n=Wa.event.changedTouches,a=0,u=n.length;u>a;++a)g[n[a].identifier]=null;var c=e(),l=Date.now();if(1===c.length){if(500>l-v){var p=c[0],h=g[p.identifier];r(2*S.k),i(p,h),y(),s(d)}v=l}else if(c.length>1){var p=c[0],x=c[1],C=p[0]-x[0],k=p[1]-x[1];m=C*C+k*k}}function o(){for(var e,t,n,o,a=Wa.touches(h),u=0,c=a.length;c>u;++u,o=null)if(n=a[u],o=g[n.identifier]){if(t)break;e=n,t=o}if(o){var l=(l=n[0]-e[0])*l+(l=n[1]-e[1])*l,f=m&&Math.sqrt(l/m);e=[(e[0]+n[0])/2,(e[1]+n[1])/2],t=[(t[0]+o[0])/2,(t[1]+o[1])/2],r(f*p)}v=null,i(e,t),s(d)}function f(){if(Wa.event.touches.length){for(var t=Wa.event.changedTouches,n=0,r=t.length;r>n;++n)delete g[t[n].identifier];for(var i in g)return void e()}Wa.selectAll(w).on(x,null),C.on(E,c).on(N,l),k(),u(d)}var p,h=this,d=D.of(h,arguments),g={},m=0,x=".zoom-"+Wa.event.changedTouches[0].identifier,b="touchmove"+x,$="touchend"+x,w=[],C=Wa.select(h).on(E,null).on(N,n),k=z();F.call(h),n(),a(d)}function f(){var e=D.of(this,arguments);m?clearTimeout(m):(h=t(d=g||Wa.mouse(this)),F.call(this),a(e)),m=setTimeout(function(){m=null,u(e)},50),y(),r(Math.pow(2,.002*js())*S.k),i(d,h),s(e)}function p(){var e=D.of(this,arguments),n=Wa.mouse(this),o=t(n),c=Math.log(S.k)/Math.LN2;a(e),r(Math.pow(2,Wa.event.shiftKey?Math.ceil(c)-1:Math.floor(c)+1)),i(n,o),s(e),u(e)}var h,d,g,m,v,x,$,w,C,S={x:0,y:0,k:1},k=[960,500],T=Os,E="mousedown.zoom",M="mousemove.zoom",A="mouseup.zoom",N="touchstart.zoom",D=b(e,"zoomstart","zoom","zoomend");return e.event=function(e){e.each(function(){var e=D.of(this,arguments),t=S;kc?Wa.select(this).transition().each("start.zoom",function(){S=this.__chart__||{x:0,y:0,k:1},a(e)}).tween("zoom:zoom",function(){var n=k[0],r=k[1],i=n/2,o=r/2,a=Wa.interpolateZoom([(i-S.x)/S.k,(o-S.y)/S.k,n/S.k],[(i-t.x)/t.k,(o-t.y)/t.k,n/t.k]);return function(t){var r=a(t),u=n/r[2];this.__chart__=S={x:i-r[0]*u,y:o-r[1]*u,k:u},s(e)}}).each("end.zoom",function(){u(e)}):(this.__chart__=S,a(e),s(e),u(e))})},e.translate=function(t){return arguments.length?(S={x:+t[0],y:+t[1],k:S.k},o(),e):[S.x,S.y]},e.scale=function(t){return arguments.length?(S={x:S.x,y:S.y,k:+t},o(),e):S.k},e.scaleExtent=function(t){return arguments.length?(T=null==t?Os:[+t[0],+t[1]],e):T},e.center=function(t){return arguments.length?(g=t&&[+t[0],+t[1]],e):g},e.size=function(t){return arguments.length?(k=t&&[+t[0],+t[1]],e):k},e.x=function(t){return arguments.length?($=t,x=t.copy(),S={x:0,y:0,k:1},e):$},e.y=function(t){return arguments.length?(C=t,w=t.copy(),S={x:0,y:0,k:1},e):C},Wa.rebind(e,D,"on")};var js,Os=[0,1/0],Ps="onwheel"in Ya?(js=function(){return-Wa.event.deltaY*(Wa.event.deltaMode?120:1)},"wheel"):"onmousewheel"in Ya?(js=function(){return Wa.event.wheelDelta},"mousewheel"):(js=function(){return-Wa.event.detail},"MozMousePixelScroll");Wa.color=nt,nt.prototype.toString=function(){return this.rgb()+""},Wa.hsl=rt;var qs=rt.prototype=new nt;qs.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new rt(this.h,this.s,this.l/e)},qs.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new rt(this.h,this.s,e*this.l)},qs.rgb=function(){return it(this.h,this.s,this.l)},Wa.hcl=ot;var Ls=ot.prototype=new nt;Ls.brighter=function(e){return new ot(this.h,this.c,Math.min(100,this.l+Hs*(arguments.length?e:1)))},Ls.darker=function(e){return new ot(this.h,this.c,Math.max(0,this.l-Hs*(arguments.length?e:1)))},Ls.rgb=function(){return at(this.h,this.c,this.l).rgb()},Wa.lab=st;var Hs=18,Fs=.95047,Is=1,Rs=1.08883,Us=st.prototype=new nt;Us.brighter=function(e){return new st(Math.min(100,this.l+Hs*(arguments.length?e:1)),this.a,this.b)},Us.darker=function(e){return new st(Math.max(0,this.l-Hs*(arguments.length?e:1)),this.a,this.b)},Us.rgb=function(){return ut(this.l,this.a,this.b)},Wa.rgb=ht;var zs=ht.prototype=new nt;zs.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,n=this.g,r=this.b,i=30;return t||n||r?(t&&i>t&&(t=i),n&&i>n&&(n=i),r&&i>r&&(r=i),new ht(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e))):new ht(i,i,i)},zs.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new ht(e*this.r,e*this.g,e*this.b)},zs.hsl=function(){return yt(this.r,this.g,this.b)},zs.toString=function(){return"#"+mt(this.r)+mt(this.g)+mt(this.b)};var Bs=Wa.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});Bs.forEach(function(e,t){Bs.set(e,dt(t))}),Wa.functor=wt,Wa.xhr=St(Ct),Wa.dsv=function(e,t){function n(e,n,o){arguments.length<3&&(o=n,n=null);var a=kt(e,t,null==n?r:i(n),o);return a.row=function(e){return arguments.length?a.response(null==(n=e)?r:i(e)):n},a}function r(e){return n.parse(e.responseText)}function i(e){return function(t){return n.parse(t.responseText,e)}}function o(t){return t.map(a).join(e)}function a(e){return s.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}var s=new RegExp('["'+e+"\n]"),u=e.charCodeAt(0);return n.parse=function(e,t){var r;return n.parseRows(e,function(e,n){if(r)return r(e,n-1);var i=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");r=t?function(e,n){return t(i(e),n)}:i})},n.parseRows=function(e,t){function n(){if(l>=c)return a;if(i)return i=!1,o;var t=l;if(34===e.charCodeAt(t)){for(var n=t;n++l;){var r=e.charCodeAt(l++),s=1;if(10===r)i=!0;else if(13===r)i=!0,10===e.charCodeAt(l)&&(++l,++s);else if(r!==u)continue;return e.substring(t,l-s)}return e.substring(t)}for(var r,i,o={},a={},s=[],c=e.length,l=0,f=0;(r=n())!==a;){for(var p=[];r!==o&&r!==a;)p.push(r),r=n();(!t||(p=t(p,f++)))&&s.push(p)}return s},n.format=function(t){if(Array.isArray(t[0]))return n.formatRows(t);var r=new p,i=[];return t.forEach(function(e){for(var t in e)r.has(t)||i.push(r.add(t))}),[i.map(a).join(e)].concat(t.map(function(t){return i.map(function(e){return a(t[e])}).join(e)})).join("\n")},n.formatRows=function(e){return e.map(o).join("\n")},n},Wa.csv=Wa.dsv(",","text/csv"),Wa.tsv=Wa.dsv(" ","text/tab-separated-values"),Wa.touch=function(e,t,n){if(arguments.length<3&&(n=t,t=x().changedTouches),t)for(var r,i=0,o=t.length;o>i;++i)if((r=t[i]).identifier===n)return B(e,r)};var Ws,Vs,Xs,Ys,Qs,Zs=Za[d(Za,"requestAnimationFrame")]||function(e){setTimeout(e,17)};Wa.timer=function(e,t,n){var r=arguments.length;2>r&&(t=0),3>r&&(n=Date.now());var i=n+t,o={c:e,t:i,f:!1,n:null};Vs?Vs.n=o:Ws=o,Vs=o,Xs||(Ys=clearTimeout(Ys),Xs=1,Zs(Et))},Wa.timer.flush=function(){Mt(),At()},Wa.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var Js=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"].map(Dt);Wa.formatPrefix=function(e,t){var n=0;return e&&(0>e&&(e*=-1),t&&(e=Wa.round(e,Nt(e,t))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),Js[8+n/3]};var Gs=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ks=Wa.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(e,t){return(e=Wa.round(e,Nt(e,t))).toFixed(Math.max(0,Math.min(20,Nt(e*(1+1e-15),t))))}}),eu=Wa.time={},tu=Date;Ot.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(){nu.setUTCDate.apply(this._,arguments)},setDay:function(){nu.setUTCDay.apply(this._,arguments)},setFullYear:function(){nu.setUTCFullYear.apply(this._,arguments)},setHours:function(){nu.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){nu.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){nu.setUTCMinutes.apply(this._,arguments)},setMonth:function(){nu.setUTCMonth.apply(this._,arguments)},setSeconds:function(){nu.setUTCSeconds.apply(this._,arguments)},setTime:function(){nu.setTime.apply(this._,arguments)}};var nu=Date.prototype;eu.year=Pt(function(e){return e=eu.day(e),e.setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),eu.years=eu.year.range,eu.years.utc=eu.year.utc.range,eu.day=Pt(function(e){var t=new tu(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1}),eu.days=eu.day.range,eu.days.utc=eu.day.utc.range,eu.dayOfYear=function(e){var t=eu.year(e);return Math.floor((e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,t){t=7-t;var n=eu[e]=Pt(function(e){return(e=eu.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+7*Math.floor(t))},function(e){var n=eu.year(e).getDay();return Math.floor((eu.dayOfYear(e)+(n+t)%7)/7)-(n!==t)});eu[e+"s"]=n.range,eu[e+"s"].utc=n.utc.range,eu[e+"OfYear"]=function(e){var n=eu.year(e).getDay();return Math.floor((eu.dayOfYear(e)+(n+t)%7)/7)}}),eu.week=eu.sunday,eu.weeks=eu.sunday.range,eu.weeks.utc=eu.sunday.utc.range,eu.weekOfYear=eu.sundayOfYear;var ru={"-":"",_:" ",0:"0"},iu=/^\s*\d+/,ou=/^%/;Wa.locale=function(e){return{numberFormat:_t(e),timeFormat:Lt(e)}};var au=Wa.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Wa.format=au.numberFormat,Wa.geo={},on.prototype={s:0,t:0,add:function(e){an(e,this.t,su),an(su.s,this.s,this),this.s?this.t+=su.t:this.s=su.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var su=new on;Wa.geo.stream=function(e,t){e&&uu.hasOwnProperty(e.type)?uu[e.type](e,t):sn(e,t)};var uu={Feature:function(e,t){sn(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++re?4*Cs+e:e,pu.lineStart=pu.lineEnd=pu.point=g}};Wa.geo.bounds=function(){function e(e,t){x.push(b=[l=e,p=e]),f>t&&(f=t),t>h&&(h=t)}function t(t,n){var r=fn([t*Ms,n*Ms]);if(v){var i=hn(v,r),o=[i[1],-i[0],0],a=hn(o,i);mn(a),a=vn(a);var u=t-d,c=u>0?1:-1,g=a[0]*As*c,m=os(u)>180;if(m^(g>c*d&&c*t>g)){var y=a[1]*As;y>h&&(h=y)}else if(g=(g+360)%360-180,m^(g>c*d&&c*t>g)){var y=-a[1]*As;f>y&&(f=y)}else f>n&&(f=n),n>h&&(h=n);m?d>t?s(l,t)>s(l,p)&&(p=t):s(t,p)>s(l,p)&&(l=t):p>=l?(l>t&&(l=t),t>p&&(p=t)):t>d?s(l,t)>s(l,p)&&(p=t):s(t,p)>s(l,p)&&(l=t)}else e(t,n);v=r,d=t}function n(){$.point=t}function r(){b[0]=l,b[1]=p,$.point=e,v=null}function i(e,n){if(v){var r=e-d;y+=os(r)>180?r+(r>0?360:-360):r}else g=e,m=n;pu.point(e,n),t(e,n)}function o(){pu.lineStart()}function a(){i(g,m),pu.lineEnd(),os(y)>Ts&&(l=-(p=180)),b[0]=l,b[1]=p,v=null}function s(e,t){return(t-=e)<0?t+360:t}function u(e,t){return e[0]-t[0]}function c(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:efu?(l=-(p=180),f=-(h=90)):y>Ts?h=90:-Ts>y&&(f=-90),b[0]=l,b[1]=p}};return function(e){h=p=-(l=f=1/0),x=[],Wa.geo.stream(e,$);var t=x.length;if(t){x.sort(u);for(var n,r=1,i=x[0],o=[i];t>r;++r)n=x[r],c(n[0],i)||c(n[1],i)?(s(i[0],n[1])>s(i[0],i[1])&&(i[1]=n[1]),s(n[0],i[1])>s(i[0],i[1])&&(i[0]=n[0])):o.push(i=n);for(var a,n,d=-1/0,t=o.length-1,r=0,i=o[t];t>=r;i=n,++r)n=o[r],(a=s(i[1],n[0]))>d&&(d=a,l=n[0],p=i[1])}return x=b=null,1/0===l||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[l,f],[p,h]]}}(),Wa.geo.centroid=function(e){hu=du=gu=mu=vu=yu=xu=bu=$u=wu=Cu=0,Wa.geo.stream(e,Su);var t=$u,n=wu,r=Cu,i=t*t+n*n+r*r;return Es>i&&(t=yu,n=xu,r=bu,Ts>du&&(t=gu,n=mu,r=vu),i=t*t+n*n+r*r,Es>i)?[0/0,0/0]:[Math.atan2(n,t)*As,J(r/Math.sqrt(i))*As]};var hu,du,gu,mu,vu,yu,xu,bu,$u,wu,Cu,Su={sphere:g,point:xn,lineStart:$n,lineEnd:wn,polygonStart:function(){Su.lineStart=Cn},polygonEnd:function(){Su.lineStart=$n}},ku=Mn(Sn,jn,Pn,[-Cs,-Cs/2]),Tu=1e9;Wa.geo.clipExtent=function(){var e,t,n,r,i,o,a={stream:function(e){return i&&(i.valid=!1),i=o(e),i.valid=!0,i},extent:function(s){return arguments.length?(o=Hn(e=+s[0][0],t=+s[0][1],n=+s[1][0],r=+s[1][1]),i&&(i.valid=!1,i=null),a):[[e,t],[n,r]]}};return a.extent([[0,0],[960,500]])},(Wa.geo.conicEqualArea=function(){return In(Rn)}).raw=Rn,Wa.geo.albers=function(){return Wa.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Wa.geo.albersUsa=function(){function e(e){var o=e[0],a=e[1];return t=null,n(o,a),t||(r(o,a),t)||i(o,a),t}var t,n,r,i,o=Wa.geo.albers(),a=Wa.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=Wa.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,n){t=[e,n]}};return e.invert=function(e){var t=o.scale(),n=o.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?a:i>=.166&&.234>i&&r>=-.214&&-.115>r?s:o).invert(e)},e.stream=function(e){var t=o.stream(e),n=a.stream(e),r=s.stream(e);return{point:function(e,i){t.point(e,i),n.point(e,i),r.point(e,i)},sphere:function(){t.sphere(),n.sphere(),r.sphere()},lineStart:function(){t.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},e.precision=function(t){return arguments.length?(o.precision(t),a.precision(t),s.precision(t),e):o.precision()},e.scale=function(t){return arguments.length?(o.scale(t),a.scale(.35*t),s.scale(t),e.translate(o.translate())):o.scale()},e.translate=function(t){if(!arguments.length)return o.translate();var c=o.scale(),l=+t[0],f=+t[1];return n=o.translate(t).clipExtent([[l-.455*c,f-.238*c],[l+.455*c,f+.238*c]]).stream(u).point,r=a.translate([l-.307*c,f+.201*c]).clipExtent([[l-.425*c+Ts,f+.12*c+Ts],[l-.214*c-Ts,f+.234*c-Ts]]).stream(u).point,i=s.translate([l-.205*c,f+.212*c]).clipExtent([[l-.214*c+Ts,f+.166*c+Ts],[l-.115*c-Ts,f+.234*c-Ts]]).stream(u).point,e},e.scale(1070)};var Eu,Mu,Au,Nu,Du,_u,ju={point:g,lineStart:g,lineEnd:g,polygonStart:function(){Mu=0,ju.lineStart=Un},polygonEnd:function(){ju.lineStart=ju.lineEnd=ju.point=g,Eu+=os(Mu/2)}},Ou={point:zn,lineStart:g,lineEnd:g,polygonStart:g,polygonEnd:g},Pu={point:Vn,lineStart:Xn,lineEnd:Yn,polygonStart:function(){Pu.lineStart=Qn},polygonEnd:function(){Pu.point=Vn,Pu.lineStart=Xn,Pu.lineEnd=Yn}};Wa.geo.path=function(){function e(e){return e&&("function"==typeof s&&o.pointRadius(+s.apply(this,arguments)),a&&a.valid||(a=i(o)),Wa.geo.stream(e,a)),o.result()}function t(){return a=null,e}var n,r,i,o,a,s=4.5;return e.area=function(e){return Eu=0,Wa.geo.stream(e,i(ju)),Eu},e.centroid=function(e){return gu=mu=vu=yu=xu=bu=$u=wu=Cu=0,Wa.geo.stream(e,i(Pu)),Cu?[$u/Cu,wu/Cu]:bu?[yu/bu,xu/bu]:vu?[gu/vu,mu/vu]:[0/0,0/0]},e.bounds=function(e){return Du=_u=-(Au=Nu=1/0),Wa.geo.stream(e,i(Ou)),[[Au,Nu],[Du,_u]]},e.projection=function(e){return arguments.length?(i=(n=e)?e.stream||Gn(e):Ct,t()):n},e.context=function(e){return arguments.length?(o=null==(r=e)?new Bn:new Zn(e),"function"!=typeof s&&o.pointRadius(s),t()):r},e.pointRadius=function(t){return arguments.length?(s="function"==typeof t?t:(o.pointRadius(+t),+t),e):s},e.projection(Wa.geo.albersUsa()).context(null)},Wa.geo.transform=function(e){return{stream:function(t){var n=new Kn(t);for(var r in e)n[r]=e[r];return n}}},Kn.prototype={point:function(e,t){this.stream.point(e,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()}},Wa.geo.projection=tr,Wa.geo.projectionMutator=nr,(Wa.geo.equirectangular=function(){return tr(ir)}).raw=ir.invert=ir,Wa.geo.rotation=function(e){function t(t){return t=e(t[0]*Ms,t[1]*Ms),t[0]*=As,t[1]*=As,t}return e=ar(e[0]%360*Ms,e[1]*Ms,e.length>2?e[2]*Ms:0),t.invert=function(t){return t=e.invert(t[0]*Ms,t[1]*Ms),t[0]*=As,t[1]*=As,t},t},or.invert=ir,Wa.geo.circle=function(){function e(){var e="function"==typeof r?r.apply(this,arguments):r,t=ar(-e[0]*Ms,-e[1]*Ms,0).invert,i=[];return n(null,null,1,{point:function(e,n){i.push(e=t(e,n)),e[0]*=As,e[1]*=As}}),{type:"Polygon",coordinates:[i]}}var t,n,r=[0,0],i=6;return e.origin=function(t){return arguments.length?(r=t,e):r},e.angle=function(r){return arguments.length?(n=lr((t=+r)*Ms,i*Ms),e):t},e.precision=function(r){return arguments.length?(n=lr(t*Ms,(i=+r)*Ms),e):i},e.angle(90)},Wa.geo.distance=function(e,t){var n,r=(t[0]-e[0])*Ms,i=e[1]*Ms,o=t[1]*Ms,a=Math.sin(r),s=Math.cos(r),u=Math.sin(i),c=Math.cos(i),l=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((n=f*a)*n+(n=c*l-u*f*s)*n),u*l+c*f*s)},Wa.geo.graticule=function(){function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return Wa.range(Math.ceil(o/m)*m,i,m).map(p).concat(Wa.range(Math.ceil(c/v)*v,u,v).map(h)).concat(Wa.range(Math.ceil(r/d)*d,n,d).filter(function(e){return os(e%m)>Ts}).map(l)).concat(Wa.range(Math.ceil(s/g)*g,a,g).filter(function(e){return os(e%v)>Ts}).map(f))}var n,r,i,o,a,s,u,c,l,f,p,h,d=10,g=d,m=90,v=360,y=2.5;return e.lines=function(){return t().map(function(e){return{type:"LineString",coordinates:e}})},e.outline=function(){return{type:"Polygon",coordinates:[p(o).concat(h(u).slice(1),p(i).reverse().slice(1),h(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.majorExtent(t).minorExtent(t):e.minorExtent()},e.majorExtent=function(t){return arguments.length?(o=+t[0][0],i=+t[1][0],c=+t[0][1],u=+t[1][1],o>i&&(t=o,o=i,i=t),c>u&&(t=c,c=u,u=t),e.precision(y)):[[o,c],[i,u]]},e.minorExtent=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),e.precision(y)):[[r,s],[n,a]]},e.step=function(t){return arguments.length?e.majorStep(t).minorStep(t):e.minorStep()},e.majorStep=function(t){return arguments.length?(m=+t[0],v=+t[1],e):[m,v]},e.minorStep=function(t){return arguments.length?(d=+t[0],g=+t[1],e):[d,g]},e.precision=function(t){return arguments.length?(y=+t,l=pr(s,a,90),f=hr(r,n,y),p=pr(c,u,90),h=hr(o,i,y),e):y},e.majorExtent([[-180,-90+Ts],[180,90-Ts]]).minorExtent([[-180,-80-Ts],[180,80+Ts]])},Wa.geo.greatArc=function(){function e(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),n||i.apply(this,arguments)]}}var t,n,r=dr,i=gr;return e.distance=function(){return Wa.geo.distance(t||r.apply(this,arguments),n||i.apply(this,arguments))},e.source=function(n){return arguments.length?(r=n,t="function"==typeof n?null:n,e):r},e.target=function(t){return arguments.length?(i=t,n="function"==typeof t?null:t,e):i},e.precision=function(){return arguments.length?e:0},e},Wa.geo.interpolate=function(e,t){return mr(e[0]*Ms,e[1]*Ms,t[0]*Ms,t[1]*Ms)},Wa.geo.length=function(e){return qu=0,Wa.geo.stream(e,Lu),qu};var qu,Lu={sphere:g,point:g,lineStart:vr,lineEnd:g,polygonStart:g,polygonEnd:g},Hu=yr(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(Wa.geo.azimuthalEqualArea=function(){return tr(Hu)}).raw=Hu;var Fu=yr(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},Ct);(Wa.geo.azimuthalEquidistant=function(){return tr(Fu)}).raw=Fu,(Wa.geo.conicConformal=function(){return In(xr)}).raw=xr,(Wa.geo.conicEquidistant=function(){return In(br)}).raw=br;var Iu=yr(function(e){return 1/e},Math.atan);(Wa.geo.gnomonic=function(){return tr(Iu)}).raw=Iu,$r.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-ks]},(Wa.geo.mercator=function(){return wr($r)}).raw=$r;var Ru=yr(function(){return 1},Math.asin);(Wa.geo.orthographic=function(){return tr(Ru)}).raw=Ru;var Uu=yr(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});(Wa.geo.stereographic=function(){return tr(Uu)}).raw=Uu,Cr.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-ks]},(Wa.geo.transverseMercator=function(){var e=wr(Cr),t=e.center,n=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return e?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90])}).raw=Cr,Wa.geom={},Wa.geom.hull=function(e){function t(e){if(e.length<3)return[];var t,i=wt(n),o=wt(r),a=e.length,s=[],u=[];for(t=0;a>t;t++)s.push([+i.call(this,e[t],t),+o.call(this,e[t],t),t]);for(s.sort(Er),t=0;a>t;t++)u.push([s[t][0],-s[t][1]]);var c=Tr(s),l=Tr(u),f=l[0]===c[0],p=l[l.length-1]===c[c.length-1],h=[];for(t=c.length-1;t>=0;--t)h.push(e[s[c[t]][2]]);for(t=+f;t=r&&c.x<=o&&c.y>=i&&c.y<=a?[[r,a],[o,a],[o,i],[r,i]]:[];l.point=e[s]}),t}function n(e){return e.map(function(e,t){return{x:Math.round(o(e,t)/Ts)*Ts,y:Math.round(a(e,t)/Ts)*Ts,i:t}})}var r=Sr,i=kr,o=r,a=i,s=Ju;return e?t(e):(t.links=function(e){return ni(n(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},t.triangles=function(e){var t=[];return ni(n(e)).cells.forEach(function(n,r){for(var i,o,a=n.site,s=n.edges.sort(Ir),u=-1,c=s.length,l=s[c-1].edge,f=l.l===a?l.r:l.l;++u=c,p=r>=l,h=(p<<1)+f;e.leaf=!1,e=e.nodes[h]||(e.nodes[h]=si()),f?i=c:s=c,p?a=l:u=l,o(e,t,n,r,i,a,s,u)}var l,f,p,h,d,g,m,v,y,x=wt(s),b=wt(u);if(null!=t)g=t,m=n,v=r,y=i;else if(v=y=-(g=m=1/0),f=[],p=[],d=e.length,a)for(h=0;d>h;++h)l=e[h],l.xv&&(v=l.x),l.y>y&&(y=l.y),f.push(l.x),p.push(l.y);else for(h=0;d>h;++h){var $=+x(l=e[h],h),w=+b(l,h);g>$&&(g=$),m>w&&(m=w),$>v&&(v=$),w>y&&(y=w),f.push($),p.push(w)}var C=v-g,S=y-m;C>S?y=m+C:v=g+S;var k=si();if(k.add=function(e){o(k,e,+x(e,++h),+b(e,h),g,m,v,y)},k.visit=function(e){ui(e,k,g,m,v,y)},h=-1,null==t){for(;++h=0?e.substring(0,t):e,r=t>=0?e.substring(t+1):"in";return n=tc.get(n)||ec,r=nc.get(r)||Ct,gi(r(n.apply(null,Va.call(arguments,1))))},Wa.interpolateHcl=Mi,Wa.interpolateHsl=Ai,Wa.interpolateLab=Ni,Wa.interpolateRound=Di,Wa.transform=function(e){var t=Ya.createElementNS(Wa.ns.prefix.svg,"g");return(Wa.transform=function(e){if(null!=e){t.setAttribute("transform",e);var n=t.transform.baseVal.consolidate()}return new _i(n?n.matrix:rc)})(e)},_i.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var rc={a:1,b:0,c:0,d:1,e:0,f:0};Wa.interpolateTransform=qi,Wa.layout={},Wa.layout.bundle=function(){return function(e){for(var t=[],n=-1,r=e.length;++ns*s/m){if(d>u){var c=t.charge/u;e.px-=o*c,e.py-=a*c}return!0}if(t.point&&u&&d>u){var c=t.pointCharge/u;e.px-=o*c,e.py-=a*c}}return!t.charge}}function t(e){e.px=Wa.event.x,e.py=Wa.event.y,s.resume()}var n,r,i,o,a,s={},u=Wa.dispatch("start","tick","end"),c=[1,1],l=.9,f=ic,p=oc,h=-30,d=ac,g=.1,m=.64,v=[],y=[];return s.tick=function(){if((r*=.99)<.005)return u.end({type:"end",alpha:r=0}),!0;var t,n,s,f,p,d,m,x,b,$=v.length,w=y.length;for(n=0;w>n;++n)s=y[n],f=s.source,p=s.target,x=p.x-f.x,b=p.y-f.y,(d=x*x+b*b)&&(d=r*o[n]*((d=Math.sqrt(d))-i[n])/d,x*=d,b*=d,p.x-=x*(m=f.weight/(p.weight+f.weight)),p.y-=b*m,f.x+=x*(m=1-m),f.y+=b*m);if((m=r*g)&&(x=c[0]/2,b=c[1]/2,n=-1,m))for(;++n<$;)s=v[n],s.x+=(x-s.x)*m,s.y+=(b-s.y)*m;if(h)for(Vi(t=Wa.geom.quadtree(v),r,a),n=-1;++n<$;)(s=v[n]).fixed||t.visit(e(s));for(n=-1;++n<$;)s=v[n],s.fixed?(s.x=s.px,s.y=s.py):(s.x-=(s.px-(s.px=s.x))*l,s.y-=(s.py-(s.py=s.y))*l);u.tick({type:"tick",alpha:r})},s.nodes=function(e){return arguments.length?(v=e,s):v},s.links=function(e){return arguments.length?(y=e,s):y},s.size=function(e){return arguments.length?(c=e,s):c},s.linkDistance=function(e){return arguments.length?(f="function"==typeof e?e:+e,s):f},s.distance=s.linkDistance,s.linkStrength=function(e){return arguments.length?(p="function"==typeof e?e:+e,s):p},s.friction=function(e){return arguments.length?(l=+e,s):l},s.charge=function(e){return arguments.length?(h="function"==typeof e?e:+e,s):h},s.chargeDistance=function(e){return arguments.length?(d=e*e,s):Math.sqrt(d)},s.gravity=function(e){return arguments.length?(g=+e,s):g},s.theta=function(e){return arguments.length?(m=e*e,s):Math.sqrt(m)},s.alpha=function(e){return arguments.length?(e=+e,r?r=e>0?e:0:e>0&&(u.start({type:"start",alpha:r=e}),Wa.timer(s.tick)),s):r},s.start=function(){function e(e,r){if(!n){for(n=new Array(u),s=0;u>s;++s)n[s]=[];for(s=0;c>s;++s){var i=y[s];n[i.source.index].push(i.target),n[i.target.index].push(i.source)}}for(var o,a=n[t],s=-1,c=a.length;++st;++t)(r=v[t]).index=t,r.weight=0;for(t=0;l>t;++t)r=y[t],"number"==typeof r.source&&(r.source=v[r.source]),"number"==typeof r.target&&(r.target=v[r.target]),++r.source.weight,++r.target.weight;for(t=0;u>t;++t)r=v[t],isNaN(r.x)&&(r.x=e("x",d)),isNaN(r.y)&&(r.y=e("y",g)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof f)for(t=0;l>t;++t)i[t]=+f.call(this,y[t],t);else for(t=0;l>t;++t)i[t]=f;if(o=[],"function"==typeof p)for(t=0;l>t;++t)o[t]=+p.call(this,y[t],t);else for(t=0;l>t;++t)o[t]=p;if(a=[],"function"==typeof h)for(t=0;u>t;++t)a[t]=+h.call(this,v[t],t);else for(t=0;u>t;++t)a[t]=h;return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){return n||(n=Wa.behavior.drag().origin(Ct).on("dragstart.force",Ui).on("drag.force",t).on("dragend.force",zi)),arguments.length?(this.on("mouseover.force",Bi).on("mouseout.force",Wi).call(n),void 0):n},Wa.rebind(s,u,"on")};var ic=20,oc=1,ac=1/0;Wa.layout.hierarchy=function(){function e(i){var o,a=[i],s=[];for(i.depth=0;null!=(o=a.pop());)if(s.push(o),(c=n.call(e,o,o.depth))&&(u=c.length)){for(var u,c,l;--u>=0;)a.push(l=c[u]),l.parent=o,l.depth=o.depth+1;r&&(o.value=0),o.children=c}else r&&(o.value=+r.call(e,o,o.depth)||0),delete o.children;return Qi(i,function(e){var n,i;t&&(n=e.children)&&n.sort(t),r&&(i=e.parent)&&(i.value+=e.value)}),s}var t=Gi,n=Zi,r=Ji;return e.sort=function(n){return arguments.length?(t=n,e):t},e.children=function(t){return arguments.length?(n=t,e):n},e.value=function(t){return arguments.length?(r=t,e):r},e.revalue=function(t){return r&&(Yi(t,function(e){e.children&&(e.value=0)}),Qi(t,function(t){var n;t.children||(t.value=+r.call(e,t,t.depth)||0),(n=t.parent)&&(n.value+=t.value)})),t},e},Wa.layout.partition=function(){function e(t,n,r,i){var o=t.children;if(t.x=n,t.y=t.depth*i,t.dx=r,t.dy=i,o&&(a=o.length)){var a,s,u,c=-1;for(r=t.value?r/t.value:0;++ch;++h)for(i.call(e,c[0][h],d=g[h],l[0][h][1]),p=1;m>p;++p)i.call(e,c[p][h],d+=l[p-1][h][1],l[p][h][1]);return s}var t=Ct,n=ro,r=io,i=no,o=eo,a=to;return e.values=function(n){return arguments.length?(t=n,e):t},e.order=function(t){return arguments.length?(n="function"==typeof t?t:uc.get(t)||ro,e):n},e.offset=function(t){return arguments.length?(r="function"==typeof t?t:cc.get(t)||io,e):r},e.x=function(t){return arguments.length?(o=t,e):o},e.y=function(t){return arguments.length?(a=t,e):a},e.out=function(t){return arguments.length?(i=t,e):i},e};var uc=Wa.map({"inside-out":function(e){var t,n,r=e.length,i=e.map(oo),o=e.map(ao),a=Wa.range(r).sort(function(e,t){return i[e]-i[t]}),s=0,u=0,c=[],l=[];for(t=0;r>t;++t)n=a[t],u>s?(s+=o[n],c.push(n)):(u+=o[n],l.push(n));return l.reverse().concat(c)},reverse:function(e){return Wa.range(e.length).reverse()},"default":ro}),cc=Wa.map({silhouette:function(e){var t,n,r,i=e.length,o=e[0].length,a=[],s=0,u=[];for(n=0;o>n;++n){for(t=0,r=0;i>t;t++)r+=e[t][n][1];r>s&&(s=r),a.push(r)}for(n=0;o>n;++n)u[n]=(s-a[n])/2;return u},wiggle:function(e){var t,n,r,i,o,a,s,u,c,l=e.length,f=e[0],p=f.length,h=[];for(h[0]=u=c=0,n=1;p>n;++n){for(t=0,i=0;l>t;++t)i+=e[t][n][1];for(t=0,o=0,s=f[n][0]-f[n-1][0];l>t;++t){for(r=0,a=(e[t][n][1]-e[t][n-1][1])/(2*s);t>r;++r)a+=(e[r][n][1]-e[r][n-1][1])/s;o+=a*e[t][n][1]}h[n]=u-=i?o/i*s:0,c>u&&(c=u)}for(n=0;p>n;++n)h[n]-=c;return h},expand:function(e){var t,n,r,i=e.length,o=e[0].length,a=1/i,s=[];for(n=0;o>n;++n){for(t=0,r=0;i>t;t++)r+=e[t][n][1];if(r)for(t=0;i>t;t++)e[t][n][1]/=r;else for(t=0;i>t;t++)e[t][n][1]=a}for(n=0;o>n;++n)s[n]=0;return s},zero:io});Wa.layout.histogram=function(){function e(e,o){for(var a,s,u=[],c=e.map(n,this),l=r.call(this,c,o),f=i.call(this,l,c,o),o=-1,p=c.length,h=f.length-1,d=t?1:1/p;++o0)for(o=-1;++o=l[0]&&s<=l[1]&&(a=u[Wa.bisect(f,s,1,h)-1],a.y+=d,a.push(e[o]));return u}var t=!0,n=Number,r=lo,i=uo;return e.value=function(t){return arguments.length?(n=t,e):n},e.range=function(t){return arguments.length?(r=wt(t),e):r},e.bins=function(t){return arguments.length?(i="number"==typeof t?function(e){return co(e,t)}:wt(t),e):i},e.frequency=function(n){return arguments.length?(t=!!n,e):t},e},Wa.layout.pack=function(){function e(e,o){var a=n.call(this,e,o),s=a[0],u=i[0],c=i[1],l=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(s.x=s.y=0,Qi(s,function(e){e.r=+l(e.value)}),Qi(s,mo),r){var f=r*(t?1:Math.max(2*s.r/u,2*s.r/c))/2;Qi(s,function(e){e.r+=f}),Qi(s,mo),Qi(s,function(e){e.r-=f})}return xo(s,u/2,c/2,t?1:1/Math.max(2*s.r/u,2*s.r/c)),a}var t,n=Wa.layout.hierarchy().sort(fo),r=0,i=[1,1];return e.size=function(t){return arguments.length?(i=t,e):i},e.radius=function(n){return arguments.length?(t=null==n||"function"==typeof n?n:+n,e):t},e.padding=function(t){return arguments.length?(r=+t,e):r},Xi(e,n)},Wa.layout.tree=function(){function e(e,i){var l=a.call(this,e,i),f=l[0],p=t(f);if(Qi(p,n),p.parent.m=-p.z,Yi(p,r),c)Yi(f,o);else{var h=f,d=f,g=f;Yi(f,function(e){e.xd.x&&(d=e),e.depth>g.depth&&(g=e)});var m=s(h,d)/2-h.x,v=u[0]/(d.x+s(d,h)/2+m),y=u[1]/(g.depth||1);Yi(f,function(e){e.x=(e.x+m)*v,e.y=e.depth*y})}return l}function t(e){for(var t,n={A:null,children:[e]},r=[n];null!=(t=r.pop());)for(var i,o=t.children,a=0,s=o.length;s>a;++a)r.push((o[a]=i={_:o[a],parent:t,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}function n(e){var t=e.children,n=e.parent.children,r=e.i?n[e.i-1]:null;if(t.length){ko(e);var o=(t[0].z+t[t.length-1].z)/2;r?(e.z=r.z+s(e._,r._),e.m=e.z-o):e.z=o}else r&&(e.z=r.z+s(e._,r._));e.parent.A=i(e,r,e.parent.A||n[0])}function r(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function i(e,t,n){if(t){for(var r,i=e,o=e,a=t,u=i.parent.children[0],c=i.m,l=o.m,f=a.m,p=u.m;a=Co(a),i=wo(i),a&&i;)u=wo(u),o=Co(o),o.a=e,r=a.z+f-i.z-c+s(a._,i._),r>0&&(So(To(a,e,n),e,r),c+=r,l+=r),f+=a.m,c+=i.m,p+=u.m,l+=o.m;a&&!Co(o)&&(o.t=a,o.m+=f-l),i&&!wo(u)&&(u.t=i,u.m+=c-p,n=e)}return n}function o(e){e.x*=u[0],e.y=e.depth*u[1]}var a=Wa.layout.hierarchy().sort(null).value(null),s=$o,u=[1,1],c=null;return e.separation=function(t){return arguments.length?(s=t,e):s},e.size=function(t){return arguments.length?(c=null==(u=t)?o:null,e):c?null:u},e.nodeSize=function(t){return arguments.length?(c=null==(u=t)?null:o,e):c?u:null},Xi(e,a)},Wa.layout.cluster=function(){function e(e,o){var a,s=t.call(this,e,o),u=s[0],c=0;Qi(u,function(e){var t=e.children;t&&t.length?(e.x=Mo(t),e.y=Eo(t)):(e.x=a?c+=n(e,a):0,e.y=0,a=e)});var l=Ao(u),f=No(u),p=l.x-n(l,f)/2,h=f.x+n(f,l)/2;return Qi(u,i?function(e){e.x=(e.x-u.x)*r[0],e.y=(u.y-e.y)*r[1]}:function(e){e.x=(e.x-p)/(h-p)*r[0],e.y=(1-(u.y?e.y/u.y:1))*r[1]}),s}var t=Wa.layout.hierarchy().sort(null).value(null),n=$o,r=[1,1],i=!1;return e.separation=function(t){return arguments.length?(n=t,e):n},e.size=function(t){return arguments.length?(i=null==(r=t),e):i?null:r},e.nodeSize=function(t){return arguments.length?(i=null!=(r=t),e):i?r:null},Xi(e,t)},Wa.layout.treemap=function(){function e(e,t){for(var n,r,i=-1,o=e.length;++it?0:t),n.area=isNaN(r)||0>=r?0:r}function t(n){var o=n.children;if(o&&o.length){var a,s,u,c=f(n),l=[],p=o.slice(),d=1/0,g="slice"===h?c.dx:"dice"===h?c.dy:"slice-dice"===h?1&n.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(e(p,c.dx*c.dy/n.value),l.area=0;(u=p.length)>0;)l.push(a=p[u-1]),l.area+=a.area,"squarify"!==h||(s=r(l,g))<=d?(p.pop(),d=s):(l.area-=l.pop().area,i(l,g,c,!1),g=Math.min(c.dx,c.dy),l.length=l.area=0,d=1/0);l.length&&(i(l,g,c,!0),l.length=l.area=0),o.forEach(t)}}function n(t){var r=t.children;if(r&&r.length){var o,a=f(t),s=r.slice(),u=[];for(e(s,a.dx*a.dy/t.value),u.area=0;o=s.pop();)u.push(o),u.area+=o.area,null!=o.z&&(i(u,o.z?a.dx:a.dy,a,!s.length),u.length=u.area=0);r.forEach(n)}}function r(e,t){for(var n,r=e.area,i=0,o=1/0,a=-1,s=e.length;++an&&(o=n),n>i&&(i=n));return r*=r,t*=t,r?Math.max(t*i*d/r,r/(t*o*d)):1/0}function i(e,t,n,r){var i,o=-1,a=e.length,s=n.x,c=n.y,l=t?u(e.area/t):0;if(t==n.dx){for((r||l>n.dy)&&(l=n.dy);++on.dx)&&(l=n.dx);++on&&(t=1),1>n&&(e=0),function(){var n,r,i;do n=2*Math.random()-1,r=2*Math.random()-1,i=n*n+r*r;while(!i||i>1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=Wa.random.normal.apply(Wa,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=Wa.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,n=0;e>n;n++)t+=Math.random();return t}}},Wa.scale={};var lc={floor:Ct,ceil:Ct};Wa.scale.linear=function(){return Fo([0,1],[0,1],hi,!1)};var fc={s:1,g:1,p:1,r:1,e:1};Wa.scale.log=function(){return Xo(Wa.scale.linear().domain([0,1]),10,!0,[1,10])};var pc=Wa.format(".0e"),hc={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};Wa.scale.pow=function(){return Yo(Wa.scale.linear(),1,[0,1])},Wa.scale.sqrt=function(){return Wa.scale.pow().exponent(.5)},Wa.scale.ordinal=function(){return Zo([],{t:"range",a:[[]]})},Wa.scale.category10=function(){return Wa.scale.ordinal().range(dc)},Wa.scale.category20=function(){return Wa.scale.ordinal().range(gc)},Wa.scale.category20b=function(){return Wa.scale.ordinal().range(mc)},Wa.scale.category20c=function(){return Wa.scale.ordinal().range(vc)};var dc=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(gt),gc=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(gt),mc=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(gt),vc=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(gt);Wa.scale.quantile=function(){return Jo([],[])},Wa.scale.quantize=function(){return Go(0,1,[0,1])},Wa.scale.threshold=function(){return Ko([.5],[0,1])},Wa.scale.identity=function(){return ea([0,1])},Wa.svg={},Wa.svg.arc=function(){function e(){var e=t.apply(this,arguments),o=n.apply(this,arguments),a=r.apply(this,arguments)+yc,s=i.apply(this,arguments)+yc,u=(a>s&&(u=a,a=s,s=u),s-a),c=Cs>u?"0":"1",l=Math.cos(a),f=Math.sin(a),p=Math.cos(s),h=Math.sin(s);return u>=xc?e?"M0,"+o+"A"+o+","+o+" 0 1,1 0,"+-o+"A"+o+","+o+" 0 1,1 0,"+o+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+-e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+o+"A"+o+","+o+" 0 1,1 0,"+-o+"A"+o+","+o+" 0 1,1 0,"+o+"Z":e?"M"+o*l+","+o*f+"A"+o+","+o+" 0 "+c+",1 "+o*p+","+o*h+"L"+e*p+","+e*h+"A"+e+","+e+" 0 "+c+",0 "+e*l+","+e*f+"Z":"M"+o*l+","+o*f+"A"+o+","+o+" 0 "+c+",1 "+o*p+","+o*h+"L0,0"+"Z"}var t=ta,n=na,r=ra,i=ia;return e.innerRadius=function(n){return arguments.length?(t=wt(n),e):t},e.outerRadius=function(t){return arguments.length?(n=wt(t),e):n},e.startAngle=function(t){return arguments.length?(r=wt(t),e):r},e.endAngle=function(t){return arguments.length?(i=wt(t),e):i},e.centroid=function(){var e=(t.apply(this,arguments)+n.apply(this,arguments))/2,o=(r.apply(this,arguments)+i.apply(this,arguments))/2+yc;return[Math.cos(o)*e,Math.sin(o)*e]},e};var yc=-ks,xc=Ss-Ts;Wa.svg.line=function(){return oa(Ct)};var bc=Wa.map({linear:aa,"linear-closed":sa,step:ua,"step-before":ca,"step-after":la,basis:ma,"basis-open":va,"basis-closed":ya,bundle:xa,cardinal:ha,"cardinal-open":fa,"cardinal-closed":pa,monotone:ka});bc.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});var $c=[0,2/3,1/3,0],wc=[0,1/3,2/3,0],Cc=[0,1/6,2/3,1/6];Wa.svg.line.radial=function(){var e=oa(Ta);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},ca.reverse=la,la.reverse=ca,Wa.svg.area=function(){return Ea(Ct)},Wa.svg.area.radial=function(){var e=Ea(Ta);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},Wa.svg.chord=function(){function e(e,s){var u=t(this,o,e,s),c=t(this,a,e,s);return"M"+u.p0+r(u.r,u.p1,u.a1-u.a0)+(n(u,c)?i(u.r,u.p1,u.r,u.p0):i(u.r,u.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,u.r,u.p0))+"Z"}function t(e,t,n,r){var i=t.call(e,n,r),o=s.call(e,i,r),a=u.call(e,i,r)+yc,l=c.call(e,i,r)+yc;return{r:o,a0:a,a1:l,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(l),o*Math.sin(l)]}}function n(e,t){return e.a0==t.a0&&e.a1==t.a1}function r(e,t,n){return"A"+e+","+e+" 0 "+ +(n>Cs)+",1 "+t}function i(e,t,n,r){return"Q 0,0 "+r}var o=dr,a=gr,s=Ma,u=ra,c=ia;return e.radius=function(t){return arguments.length?(s=wt(t),e):s},e.source=function(t){return arguments.length?(o=wt(t),e):o},e.target=function(t){return arguments.length?(a=wt(t),e):a},e.startAngle=function(t){return arguments.length?(u=wt(t),e):u},e.endAngle=function(t){return arguments.length?(c=wt(t),e):c},e},Wa.svg.diagonal=function(){function e(e,i){var o=t.call(this,e,i),a=n.call(this,e,i),s=(o.y+a.y)/2,u=[o,{x:o.x,y:s},{x:a.x,y:s},a];return u=u.map(r),"M"+u[0]+"C"+u[1]+" "+u[2]+" "+u[3]}var t=dr,n=gr,r=Aa;return e.source=function(n){return arguments.length?(t=wt(n),e):t},e.target=function(t){return arguments.length?(n=wt(t),e):n},e.projection=function(t){return arguments.length?(r=t,e):r},e},Wa.svg.diagonal.radial=function(){var e=Wa.svg.diagonal(),t=Aa,n=e.projection;return e.projection=function(e){return arguments.length?n(Na(t=e)):t},e},Wa.svg.symbol=function(){function e(e,r){return(Sc.get(t.call(this,e,r))||ja)(n.call(this,e,r))}var t=_a,n=Da;return e.type=function(n){return arguments.length?(t=wt(n),e):t},e.size=function(t){return arguments.length?(n=wt(t),e):n},e};var Sc=Wa.map({circle:ja,cross:function(e){var t=Math.sqrt(e/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(e){var t=Math.sqrt(e/(2*Mc)),n=t*Mc;return"M0,"+-t+"L"+n+",0"+" 0,"+t+" "+-n+",0"+"Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Ec),n=t*Ec/2;return"M0,"+n+"L"+t+","+-n+" "+-t+","+-n+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Ec),n=t*Ec/2;return"M0,"+-n+"L"+t+","+n+" "+-t+","+n+"Z"}});Wa.svg.symbolTypes=Sc.keys();var kc,Tc,Ec=Math.sqrt(3),Mc=Math.tan(30*Ms),Ac=[],Nc=0;Ac.call=gs.call,Ac.empty=gs.empty,Ac.node=gs.node,Ac.size=gs.size,Wa.transition=function(e){return arguments.length?kc?e.transition():e:ys.transition()},Wa.transition.prototype=Ac,Ac.select=function(e){var t,n,r,i=this.id,o=[];e=w(e);for(var a=-1,s=this.length;++ao;o++){i.push(t=[]);for(var n=this[o],s=0,u=n.length;u>s;s++)(r=n[s])&&e.call(r,r.__data__,s,o)&&t.push(r)}return Oa(i,this.id)},Ac.tween=function(e,t){var n=this.id;return arguments.length<2?this.node().__transition__[n].tween.get(e):q(this,null==t?function(t){t.__transition__[n].tween.remove(e)}:function(r){r.__transition__[n].tween.set(e,t)})},Ac.attr=function(e,t){function n(){this.removeAttribute(s)}function r(){this.removeAttributeNS(s.space,s.local)}function i(e){return null==e?n:(e+="",function(){var t,n=this.getAttribute(s);return n!==e&&(t=a(n,e),function(e){this.setAttribute(s,t(e))})})}function o(e){return null==e?r:(e+="",function(){var t,n=this.getAttributeNS(s.space,s.local);return n!==e&&(t=a(n,e),function(e){this.setAttributeNS(s.space,s.local,t(e))})})}if(arguments.length<2){for(t in e)this.attr(t,e[t]);return this}var a="transform"==e?qi:hi,s=Wa.ns.qualify(e);return Pa(this,"attr."+e,t,s.local?o:i)},Ac.attrTween=function(e,t){function n(e,n){var r=t.call(this,e,n,this.getAttribute(i));return r&&function(e){this.setAttribute(i,r(e))}}function r(e,n){var r=t.call(this,e,n,this.getAttributeNS(i.space,i.local));return r&&function(e){this.setAttributeNS(i.space,i.local,r(e))}}var i=Wa.ns.qualify(e);return this.tween("attr."+e,i.local?r:n)},Ac.style=function(e,t,n){function r(){this.style.removeProperty(e)}function i(t){return null==t?r:(t+="",function(){var r,i=Za.getComputedStyle(this,null).getPropertyValue(e);return i!==t&&(r=hi(i,t),function(t){this.style.setProperty(e,r(t),n)})})}var o=arguments.length;if(3>o){if("string"!=typeof e){2>o&&(t="");for(n in e)this.style(n,e[n],t);return this}n=""}return Pa(this,"style."+e,t,i)},Ac.styleTween=function(e,t,n){function r(r,i){var o=t.call(this,r,i,Za.getComputedStyle(this,null).getPropertyValue(e));return o&&function(t){this.style.setProperty(e,o(t),n)}}return arguments.length<3&&(n=""),this.tween("style."+e,r)},Ac.text=function(e){return Pa(this,"text",e,qa)},Ac.remove=function(){return this.each("end.transition",function(){var e;this.__transition__.count<2&&(e=this.parentNode)&&e.removeChild(this)})},Ac.ease=function(e){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:("function"!=typeof e&&(e=Wa.ease.apply(Wa,arguments)),q(this,function(n){n.__transition__[t].ease=e}))},Ac.delay=function(e){var t=this.id;return arguments.length<1?this.node().__transition__[t].delay:q(this,"function"==typeof e?function(n,r,i){n.__transition__[t].delay=+e.call(n,n.__data__,r,i)}:(e=+e,function(n){n.__transition__[t].delay=e}))},Ac.duration=function(e){var t=this.id;return arguments.length<1?this.node().__transition__[t].duration:q(this,"function"==typeof e?function(n,r,i){n.__transition__[t].duration=Math.max(1,e.call(n,n.__data__,r,i))}:(e=Math.max(1,e),function(n){n.__transition__[t].duration=e}))},Ac.each=function(e,t){var n=this.id;if(arguments.length<2){var r=Tc,i=kc;kc=n,q(this,function(t,r,i){Tc=t.__transition__[n],e.call(t,t.__data__,r,i)}),Tc=r,kc=i}else q(this,function(r){var i=r.__transition__[n];(i.event||(i.event=Wa.dispatch("start","end"))).on(e,t)});return this},Ac.transition=function(){for(var e,t,n,r,i=this.id,o=++Nc,a=[],s=0,u=this.length;u>s;s++){a.push(e=[]);for(var t=this[s],c=0,l=t.length;l>c;c++)(n=t[c])&&(r=Object.create(n.__transition__[i]),r.delay+=r.duration,La(n,c,o,r)),e.push(n)}return Oa(a,o)},Wa.svg.axis=function(){function e(e){e.each(function(){var e,c=Wa.select(this),l=this.__chart__||n,f=this.__chart__=n.copy(),p=null==u?f.ticks?f.ticks.apply(f,s):f.domain():u,h=null==t?f.tickFormat?f.tickFormat.apply(f,s):Ct:t,d=c.selectAll(".tick").data(p,f),g=d.enter().insert("g",".domain").attr("class","tick").style("opacity",Ts),m=Wa.transition(d.exit()).style("opacity",Ts).remove(),v=Wa.transition(d.order()).style("opacity",1),y=Oo(f),x=c.selectAll(".domain").data([0]),b=(x.enter().append("path").attr("class","domain"),Wa.transition(x));g.append("line"),g.append("text");var $=g.select("line"),w=v.select("line"),C=d.select("text").text(h),S=g.select("text"),k=v.select("text");switch(r){case"bottom":e=Ha,$.attr("y2",i),S.attr("y",Math.max(i,0)+a),w.attr("x2",0).attr("y2",i),k.attr("x",0).attr("y",Math.max(i,0)+a),C.attr("dy",".71em").style("text-anchor","middle"),b.attr("d","M"+y[0]+","+o+"V0H"+y[1]+"V"+o);break;case"top":e=Ha,$.attr("y2",-i),S.attr("y",-(Math.max(i,0)+a)),w.attr("x2",0).attr("y2",-i),k.attr("x",0).attr("y",-(Math.max(i,0)+a)),C.attr("dy","0em").style("text-anchor","middle"),b.attr("d","M"+y[0]+","+-o+"V0H"+y[1]+"V"+-o);break;case"left":e=Fa,$.attr("x2",-i),S.attr("x",-(Math.max(i,0)+a)),w.attr("x2",-i).attr("y2",0),k.attr("x",-(Math.max(i,0)+a)).attr("y",0),C.attr("dy",".32em").style("text-anchor","end"),b.attr("d","M"+-o+","+y[0]+"H0V"+y[1]+"H"+-o);break;case"right":e=Fa,$.attr("x2",i),S.attr("x",Math.max(i,0)+a),w.attr("x2",i).attr("y2",0),k.attr("x",Math.max(i,0)+a).attr("y",0),C.attr("dy",".32em").style("text-anchor","start"),b.attr("d","M"+o+","+y[0]+"H0V"+y[1]+"H"+o)}if(f.rangeBand){var T=f,E=T.rangeBand()/2;l=f=function(e){return T(e)+E}}else l.rangeBand?l=f:m.call(e,f);g.call(e,l),v.call(e,f)})}var t,n=Wa.scale.linear(),r=Dc,i=6,o=6,a=3,s=[10],u=null;return e.scale=function(t){return arguments.length?(n=t,e):n},e.orient=function(t){return arguments.length?(r=t in _c?t+"":Dc,e):r},e.ticks=function(){return arguments.length?(s=arguments,e):s},e.tickValues=function(t){return arguments.length?(u=t,e):u},e.tickFormat=function(n){return arguments.length?(t=n,e):t},e.tickSize=function(t){var n=arguments.length;return n?(i=+t,o=+arguments[n-1],e):i},e.innerTickSize=function(t){return arguments.length?(i=+t,e):i},e.outerTickSize=function(t){return arguments.length?(o=+t,e):o},e.tickPadding=function(t){return arguments.length?(a=+t,e):a},e.tickSubdivide=function(){return arguments.length&&e},e};var Dc="bottom",_c={top:1,right:1,bottom:1,left:1};Wa.svg.brush=function(){function e(o){o.each(function(){var o=Wa.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),a=o.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),o.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=o.selectAll(".resize").data(d,Ct);s.exit().remove(),s.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return jc[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",e.empty()?"none":null);var l,f=Wa.transition(o),p=Wa.transition(a);u&&(l=Oo(u),p.attr("x",l[0]).attr("width",l[1]-l[0]),n(f)),c&&(l=Oo(c),p.attr("y",l[0]).attr("height",l[1]-l[0]),r(f)),t(f)})}function t(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+l[+/e$/.test(e)]+","+f[+/^s/.test(e)]+")"})}function n(e){e.select(".extent").attr("x",l[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function r(e){e.select(".extent").attr("y",f[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function i(){function i(){32==Wa.event.keyCode&&(M||(x=null,N[0]-=l[1],N[1]-=f[1],M=2),y())}function d(){32==Wa.event.keyCode&&2==M&&(N[0]+=l[1],N[1]+=f[1],M=0,y())}function g(){var e=Wa.mouse($),i=!1;b&&(e[0]+=b[0],e[1]+=b[1]),M||(Wa.event.altKey?(x||(x=[(l[0]+l[1])/2,(f[0]+f[1])/2]),N[0]=l[+(e[0]d?(i=r,r=d):i=d),g[0]!=r||g[1]!=i?(n?a=null:o=null,g[0]=r,g[1]=i,!0):void 0}function v(){g(),S.style("pointer-events","all").selectAll(".resize").style("display",e.empty()?"none":null),Wa.select("body").style("cursor",null),D.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),A(),C({type:"brushend"})}var x,b,$=this,w=Wa.select(Wa.event.target),C=s.of($,arguments),S=Wa.select($),k=w.datum(),T=!/^(n|s)$/.test(k)&&u,E=!/^(e|w)$/.test(k)&&c,M=w.classed("extent"),A=z(),N=Wa.mouse($),D=Wa.select(Za).on("keydown.brush",i).on("keyup.brush",d);if(Wa.event.changedTouches?D.on("touchmove.brush",g).on("touchend.brush",v):D.on("mousemove.brush",g).on("mouseup.brush",v),S.interrupt().selectAll("*").interrupt(),M)N[0]=l[0]-N[0],N[1]=f[0]-N[1];else if(k){var _=+/w$/.test(k),j=+/^n/.test(k);b=[l[1-_]-N[0],f[1-j]-N[1]],N[0]=l[_],N[1]=f[j]}else Wa.event.altKey&&(x=N.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),Wa.select("body").style("cursor",w.style("cursor")),C({type:"brushstart"}),g()}var o,a,s=b(e,"brushstart","brush","brushend"),u=null,c=null,l=[0,0],f=[0,0],p=!0,h=!0,d=Oc[0];return e.event=function(e){e.each(function(){var e=s.of(this,arguments),t={x:l,y:f,i:o,j:a},n=this.__chart__||t;this.__chart__=t,kc?Wa.select(this).transition().each("start.brush",function(){o=n.i,a=n.j,l=n.x,f=n.y,e({type:"brushstart"})}).tween("brush:brush",function(){var n=di(l,t.x),r=di(f,t.y);return o=a=null,function(i){l=t.x=n(i),f=t.y=r(i),e({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,e({type:"brush",mode:"resize"}),e({type:"brushend"})}):(e({type:"brushstart"}),e({type:"brush",mode:"resize"}),e({type:"brushend"}))})},e.x=function(t){return arguments.length?(u=t,d=Oc[!u<<1|!c],e):u},e.y=function(t){return arguments.length?(c=t,d=Oc[!u<<1|!c],e):c},e.clamp=function(t){return arguments.length?(u&&c?(p=!!t[0],h=!!t[1]):u?p=!!t:c&&(h=!!t),e):u&&c?[p,h]:u?p:c?h:null},e.extent=function(t){var n,r,i,s,p;return arguments.length?(u&&(n=t[0],r=t[1],c&&(n=n[0],r=r[0]),o=[n,r],u.invert&&(n=u(n),r=u(r)),n>r&&(p=n,n=r,r=p),(n!=l[0]||r!=l[1])&&(l=[n,r])),c&&(i=t[0],s=t[1],u&&(i=i[1],s=s[1]),a=[i,s],c.invert&&(i=c(i),s=c(s)),i>s&&(p=i,i=s,s=p),(i!=f[0]||s!=f[1])&&(f=[i,s])),e):(u&&(o?(n=o[0],r=o[1]):(n=l[0],r=l[1],u.invert&&(n=u.invert(n),r=u.invert(r)),n>r&&(p=n,n=r,r=p))),c&&(a?(i=a[0],s=a[1]):(i=f[0],s=f[1],c.invert&&(i=c.invert(i),s=c.invert(s)),i>s&&(p=i,i=s,s=p))),u&&c?[[n,i],[r,s]]:u?[n,r]:c&&[i,s]) },e.clear=function(){return e.empty()||(l=[0,0],f=[0,0],o=a=null),e},e.empty=function(){return!!u&&l[0]==l[1]||!!c&&f[0]==f[1]},Wa.rebind(e,s,"on")};var jc={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Oc=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Pc=eu.format=au.timeFormat,qc=Pc.utc,Lc=qc("%Y-%m-%dT%H:%M:%S.%LZ");Pc.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ia:Lc,Ia.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Ia.toString=Lc.toString,eu.second=Pt(function(e){return new tu(1e3*Math.floor(e/1e3))},function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))},function(e){return e.getSeconds()}),eu.seconds=eu.second.range,eu.seconds.utc=eu.second.utc.range,eu.minute=Pt(function(e){return new tu(6e4*Math.floor(e/6e4))},function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))},function(e){return e.getMinutes()}),eu.minutes=eu.minute.range,eu.minutes.utc=eu.minute.utc.range,eu.hour=Pt(function(e){var t=e.getTimezoneOffset()/60;return new tu(36e5*(Math.floor(e/36e5-t)+t))},function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))},function(e){return e.getHours()}),eu.hours=eu.hour.range,eu.hours.utc=eu.hour.utc.range,eu.month=Pt(function(e){return e=eu.day(e),e.setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),eu.months=eu.month.range,eu.months.utc=eu.month.utc.range;var Hc=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Fc=[[eu.second,1],[eu.second,5],[eu.second,15],[eu.second,30],[eu.minute,1],[eu.minute,5],[eu.minute,15],[eu.minute,30],[eu.hour,1],[eu.hour,3],[eu.hour,6],[eu.hour,12],[eu.day,1],[eu.day,2],[eu.week,1],[eu.month,1],[eu.month,3],[eu.year,1]],Ic=Pc.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",Sn]]),Rc={range:function(e,t,n){return Wa.range(Math.ceil(e/n)*n,+t,n).map(Ua)},floor:Ct,ceil:Ct};Fc.year=eu.year,eu.scale=function(){return Ra(Wa.scale.linear(),Fc,Ic)};var Uc=Fc.map(function(e){return[e[0].utc,e[1]]}),zc=qc.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",Sn]]);Uc.year=eu.year.utc,eu.scale.utc=function(){return Ra(Wa.scale.linear(),Uc,zc)},Wa.text=St(function(e){return e.responseText}),Wa.json=function(e,t){return kt(e,"application/json",za,t)},Wa.html=function(e,t){return kt(e,"text/html",Ba,t)},Wa.xml=St(function(e){return e.responseXML}),"function"==typeof define&&define.amd?define(Wa):"object"==typeof module&&module.exports&&(module.exports=Wa),this.d3=Wa}(),function(){var e;$(function(){return $("a.modal-help-link").on("click",function(e){return e.preventDefault(),$(this).magnificPopup({type:"ajax"}),$(this).magnificPopup("open")})}),e=angular.module("adminApp",[]),e.controller("AdminIndexCtrl",["$scope","$location","$q",function(e,t,n){return e.data=[],e.readQuery=null,e.writeSeriesName=null,e.writeValues=null,e.successMessage="OK",e.alertMessage="Error",e.authMessage="",e.queryMessage="",e.selectedPane="data",e.writeData=function(){var t;if(!e.writeSeriesName)return e.error("Time Series Name is required."),void 0;try{t=JSON.parse(e.writeValues)}catch(r){return e.alertMessage="Unable to parse JSON.",$("span#writeFailure").show().delay(1500).fadeOut(500),void 0}return n.when(parent.influxdb.writePoint(e.writeSeriesName,t)).then(function(){return e.success("200 OK")})},e.readData=function(){return e.data=[],n.when(window.parent.influxdb.query(e.readQuery)).then(function(t){var n;return n=t,n.forEach(function(t){return e.data.push({name:t.name,columns:t.columns,points:t.points,graphs:e.filteredColumns(t).map(function(n){return e.columnPoints(t,n)})})})},function(t){return e.queryMessage="ERROR: "+t.responseText,$("span#queryFailure").show().delay(2500).fadeOut(1e3)})},e.error=function(t){return e.alertMessage=t,$("span#writeFailure").show().delay(1500).fadeOut(500)},e.success=function(t){return e.successMessage=t,$("span#writeSuccess").show().delay(1500).fadeOut(500)},e.filteredColumns=function(e){var t;return t=[],e.points.length>0?e.points[0].forEach(function(n,r){return"string"==typeof n||n instanceof String?void 0:t.push(e.columns[r])}):t=e.columns,t.filter(function(e){return"time"!==e&&"sequence_number"!==e})},e.columnPoints=function(e,t){var n;return n=e.columns.indexOf(t),{name:t,points:e.points.map(function(e){return{time:new Date(e[0]),value:e[n]}})}},e.username&&e.password&&e.database?e.authenticate():void 0}]),e.directive("lineChart",[function(){return{restrict:"E",replace:!1,scope:{data:"=data",seriesName:"=seriesName"},link:function(e,t,n){var r,i,o;return o=parseInt(n.margin)||20,r=parseInt(n.barHeight)||20,i=parseInt(n.barPadding)||5,e.render=function(e,n){var r,i,a,s,u,c,l,f;if(e)return o={top:10,right:0,bottom:30,left:50},s=970-o.left-o.right,r=200-o.top-o.bottom,u=d3.time.scale().range([0,s]),l=d3.scale.linear().range([r,0]),c=d3.svg.axis().scale(u).orient("bottom"),f=d3.svg.axis().scale(l).orient("left").ticks(5).tickFormat(d3.format("1.2s")),i=d3.svg.line().x(function(e){return u(e.time)}).y(function(e){return l(e.value)}),a=d3.select(t[0]).append("svg").attr("width",s+o.left+o.right).attr("height",r+o.top+o.bottom).append("g").attr("transform","translate("+o.left+","+o.top+")"),u.domain(d3.extent(e,function(e){return e.time})),l.domain(d3.extent(e,function(e){return e.value})),a.append("g").attr("class","x axis").attr("transform","translate(0,"+r+")").call(c),a.append("g").attr("class","y axis").call(f),a.append("text").attr("class","y label").attr("text-anchor","end").attr("y",6).attr("dy",".75em").attr("transform","rotate(-90)").text(n),a.append("path").datum(e).attr("class","line").attr("d",i)},e.render(e.data,e.seriesName)}}}])}.call(this);