diff --git a/build/app.bundle.js b/build/app.bundle.js index cdeac63..9bce3bc 100644 --- a/build/app.bundle.js +++ b/build/app.bundle.js @@ -20514,7 +20514,7 @@ if (typeof exports == "object") { timeout = setTimeout(function() { exited = true; return cb('Request has timed out'); - }, 3e3); + }, 1e4); return req.end(function(err, data) { if (exited) { return; diff --git a/build/app.bundle.min.js b/build/app.bundle.min.js index a595f0f..d3d5426 100644 --- a/build/app.bundle.min.js +++ b/build/app.bundle.min.js @@ -4,5 +4,5 @@ }),[e.map(h).join(a)].concat(b.map(function(b){return e.map(function(a){return h(b[a])}).join(a)})).join("\n")},c.formatRows=function(a){return a.map(g).join("\n")},c},Vg.csv=Vg.dsv(",","text/csv"),Vg.tsv=Vg.dsv(" ","text/tab-separated-values");var Vh,Wh,Xh,Yh,Zh,$h=$g[h($g,"requestAnimationFrame")]||function(a){setTimeout(a,17)};Vg.timer=function(a,b,c){var d=arguments.length;2>d&&(b=0),3>d&&(c=Date.now());var e=c+b,f={c:a,t:e,f:!1,n:null};Wh?Wh.n=f:Vh=f,Wh=f,Xh||(Yh=clearTimeout(Yh),Xh=1,$h(tb))},Vg.timer.flush=function(){ub(),vb()};var _h=".",ai=",",bi=[3,3],ci="$",di=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"].map(wb);Vg.formatPrefix=function(a,b){var c=0;return a&&(0>a&&(a*=-1),b&&(a=Vg.round(a,xb(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,3*Math.floor((0>=c?c+1:c-1)/3)))),di[8+c/3]},Vg.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)},Vg.format=function(a){var b=ei.exec(a),c=b[1]||" ",d=b[2]||">",e=b[3]||"",f=b[4]||"",g=b[5],h=+b[6],i=b[7],j=b[8],k=b[9],l=1,m="",n=!1;switch(j&&(j=+j.substring(1)),(g||"0"===c&&"="===d)&&(g=c="0",d="=",i&&(h-=Math.floor((h-1)/4))),k){case"n":i=!0,k="g";break;case"%":l=100,m="%",k="f";break;case"p":l=100,m="%",k="r";break;case"b":case"o":case"x":case"X":"#"===f&&(f="0"+k.toLowerCase());case"c":case"d":n=!0,j=0;break;case"s":l=-1,k="r"}"#"===f?f="":"$"===f&&(f=ci),"r"!=k||j||(k="g"),null!=j&&("g"==k?j=Math.max(1,Math.min(21,j)):("e"==k||"f"==k)&&(j=Math.max(0,Math.min(20,j)))),k=fi.get(k)||yb;var o=g&&i;return function(a){if(n&&a%1)return"";var b=0>a||0===a&&0>1/a?(a=-a,"-"):e;if(0>l){var p=Vg.formatPrefix(a,j);a=p.scale(a),m=p.symbol}else a*=l;a=k(a,j);var q=a.lastIndexOf("."),r=0>q?a:a.substring(0,q),s=0>q?"":_h+a.substring(q+1);!g&&i&&(r=gi(r));var t=f.length+r.length+s.length+(o?0:b.length),u=h>t?new Array(t=h-t+1).join(c):"";return o&&(r=gi(u+r)),b+=f,a=r+s,("<"===d?b+a+u:">"===d?u+b+a:"^"===d?u.substring(0,t>>=1)+b+a+u.substring(t):b+(o?a:u+a))+m}};var ei=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fi=Vg.map({b:function(a){return a.toString(2)},c:function(a){return String.fromCharCode(a)},o:function(a){return a.toString(8)},x:function(a){return a.toString(16)},X:function(a){return a.toString(16).toUpperCase()},g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return(a=Vg.round(a,xb(a,b))).toFixed(Math.max(0,Math.min(20,xb(a*(1+1e-15),b))))}}),gi=pb;if(bi){var hi=bi.length;gi=function(a){for(var b=a.length,c=[],d=0,e=bi[0];b>0&&e>0;)c.push(a.substring(b-=e,b+e)),e=bi[d=(d+1)%hi];return c.reverse().join(ai)}}Vg.geo={},zb.prototype={s:0,t:0,add:function(a){Ab(a,this.t,ii),Ab(ii.s,this.s,this),this.s?this.t+=ii.t:this.s=ii.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ii=new zb;Vg.geo.stream=function(a,b){a&&ji.hasOwnProperty(a.type)?ji[a.type](a,b):Bb(a,b)};var ji={Feature:function(a,b){Bb(a.geometry,b)},FeatureCollection:function(a,b){for(var c=a.features,d=-1,e=c.length;++da?4*zh+a:a,ni.lineStart=ni.lineEnd=ni.point=i}};Vg.geo.bounds=function(){function a(a,b){t.push(u=[k=a,m=a]),l>b&&(l=b),b>n&&(n=b)}function b(b,c){var d=Fb([b*Eh,c*Eh]);if(r){var e=Hb(r,d),f=[e[1],-e[0],0],g=Hb(f,e);Kb(g),g=Lb(g);var i=b-o,j=i>0?1:-1,p=g[0]*Fh*j,q=hh(i)>180;if(q^(p>j*o&&j*b>p)){var s=g[1]*Fh;s>n&&(n=s)}else if(p=(p+360)%360-180,q^(p>j*o&&j*b>p)){var s=-g[1]*Fh;l>s&&(l=s)}else l>c&&(l=c),c>n&&(n=c);q?o>b?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b):m>=k?(k>b&&(k=b),b>m&&(m=b)):b>o?h(k,b)>h(k,m)&&(m=b):h(b,m)>h(k,m)&&(k=b)}else a(b,c);r=d,o=b}function c(){v.point=b}function d(){u[0]=k,u[1]=m,v.point=a,r=null}function e(a,c){if(r){var d=a-o;s+=hh(d)>180?d+(d>0?360:-360):d}else p=a,q=c;ni.point(a,c),b(a,c)}function f(){ni.lineStart()}function g(){e(p,q),ni.lineEnd(),hh(s)>Ch&&(k=-(m=180)),u[0]=k,u[1]=m,r=null}function h(a,b){return(b-=a)<0?b+360:b}function i(a,b){return a[0]-b[0]}function j(a,b){return b[0]<=b[1]?b[0]<=a&&a<=b[1]:ami?(k=-(m=180),l=-(n=90)):s>Ch?n=90:-Ch>s&&(l=-90),u[0]=k,u[1]=m}};return function(a){n=m=-(k=l=1/0),t=[],Vg.geo.stream(a,v);var b=t.length;if(b){t.sort(i);for(var c,d=1,e=t[0],f=[e];b>d;++d)c=t[d],j(c[0],e)||j(c[1],e)?(h(e[0],c[1])>h(e[0],e[1])&&(e[1]=c[1]),h(c[0],e[1])>h(e[0],e[1])&&(e[0]=c[0])):f.push(e=c);for(var g,c,o=-1/0,b=f.length-1,d=0,e=f[b];b>=d;e=c,++d)c=f[d],(g=h(e[1],c[0]))>o&&(o=g,k=c[0],m=e[1])}return t=u=null,1/0===k||1/0===l?[[0/0,0/0],[0/0,0/0]]:[[k,l],[m,n]]}}(),Vg.geo.centroid=function(a){oi=pi=qi=ri=si=ti=ui=vi=wi=xi=yi=0,Vg.geo.stream(a,zi);var b=wi,c=xi,d=yi,e=b*b+c*c+d*d;return Dh>e&&(b=ti,c=ui,d=vi,Ch>pi&&(b=qi,c=ri,d=si),e=b*b+c*c+d*d,Dh>e)?[0/0,0/0]:[Math.atan2(c,b)*Fh,N(d/Math.sqrt(e))*Fh]};var oi,pi,qi,ri,si,ti,ui,vi,wi,xi,yi,zi={sphere:i,point:Nb,lineStart:Pb,lineEnd:Qb,polygonStart:function(){zi.lineStart=Rb},polygonEnd:function(){zi.lineStart=Pb}},Ai=Wb(Sb,_b,bc,[-zh,-zh/2]),Bi=1e9;Vg.geo.clipExtent=function(){var a,b,c,d,e,f,g={stream:function(a){return e&&(e.valid=!1),e=f(a),e.valid=!0,e},extent:function(h){return arguments.length?(f=ec(a=+h[0][0],b=+h[0][1],c=+h[1][0],d=+h[1][1]),e&&(e.valid=!1,e=null),g):[[a,b],[c,d]]}};return g.extent([[0,0],[960,500]])},(Vg.geo.conicEqualArea=function(){return gc(hc)}).raw=hc,Vg.geo.albers=function(){return Vg.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Vg.geo.albersUsa=function(){function a(a){var f=a[0],g=a[1];return b=null,c(f,g),b||(d(f,g),b)||e(f,g),b}var b,c,d,e,f=Vg.geo.albers(),g=Vg.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),h=Vg.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),i={point:function(a,c){b=[a,c]}};return a.invert=function(a){var b=f.scale(),c=f.translate(),d=(a[0]-c[0])/b,e=(a[1]-c[1])/b;return(e>=.12&&.234>e&&d>=-.425&&-.214>d?g:e>=.166&&.234>e&&d>=-.214&&-.115>d?h:f).invert(a)},a.stream=function(a){var b=f.stream(a),c=g.stream(a),d=h.stream(a);return{point:function(a,e){b.point(a,e),c.point(a,e),d.point(a,e)},sphere:function(){b.sphere(),c.sphere(),d.sphere()},lineStart:function(){b.lineStart(),c.lineStart(),d.lineStart()},lineEnd:function(){b.lineEnd(),c.lineEnd(),d.lineEnd()},polygonStart:function(){b.polygonStart(),c.polygonStart(),d.polygonStart()},polygonEnd:function(){b.polygonEnd(),c.polygonEnd(),d.polygonEnd()}}},a.precision=function(b){return arguments.length?(f.precision(b),g.precision(b),h.precision(b),a):f.precision()},a.scale=function(b){return arguments.length?(f.scale(b),g.scale(.35*b),h.scale(b),a.translate(f.translate())):f.scale()},a.translate=function(b){if(!arguments.length)return f.translate();var j=f.scale(),k=+b[0],l=+b[1];return c=f.translate(b).clipExtent([[k-.455*j,l-.238*j],[k+.455*j,l+.238*j]]).stream(i).point,d=g.translate([k-.307*j,l+.201*j]).clipExtent([[k-.425*j+Ch,l+.12*j+Ch],[k-.214*j-Ch,l+.234*j-Ch]]).stream(i).point,e=h.translate([k-.205*j,l+.212*j]).clipExtent([[k-.214*j+Ch,l+.166*j+Ch],[k-.115*j-Ch,l+.234*j-Ch]]).stream(i).point,a},a.scale(1070)};var Ci,Di,Ei,Fi,Gi,Hi,Ii={point:i,lineStart:i,lineEnd:i,polygonStart:function(){Di=0,Ii.lineStart=ic},polygonEnd:function(){Ii.lineStart=Ii.lineEnd=Ii.point=i,Ci+=hh(Di/2)}},Ji={point:jc,lineStart:i,lineEnd:i,polygonStart:i,polygonEnd:i},Ki={point:mc,lineStart:nc,lineEnd:oc,polygonStart:function(){Ki.lineStart=pc},polygonEnd:function(){Ki.point=mc,Ki.lineStart=nc,Ki.lineEnd=oc}};Vg.geo.path=function(){function a(a){return a&&("function"==typeof h&&f.pointRadius(+h.apply(this,arguments)),g&&g.valid||(g=e(f)),Vg.geo.stream(a,g)),f.result()}function b(){return g=null,a}var c,d,e,f,g,h=4.5;return a.area=function(a){return Ci=0,Vg.geo.stream(a,e(Ii)),Ci},a.centroid=function(a){return qi=ri=si=ti=ui=vi=wi=xi=yi=0,Vg.geo.stream(a,e(Ki)),yi?[wi/yi,xi/yi]:vi?[ti/vi,ui/vi]:si?[qi/si,ri/si]:[0/0,0/0]},a.bounds=function(a){return Gi=Hi=-(Ei=Fi=1/0),Vg.geo.stream(a,e(Ji)),[[Ei,Fi],[Gi,Hi]]},a.projection=function(a){return arguments.length?(e=(c=a)?a.stream||sc(a):pb,b()):c},a.context=function(a){return arguments.length?(f=null==(d=a)?new kc:new qc(a),"function"!=typeof h&&f.pointRadius(h),b()):d},a.pointRadius=function(b){return arguments.length?(h="function"==typeof b?b:(f.pointRadius(+b),+b),a):h},a.projection(Vg.geo.albersUsa()).context(null)},Vg.geo.transform=function(a){return{stream:function(b){var c=new tc(b);for(var d in a)c[d]=a[d];return c}}},tc.prototype={point:function(a,b){this.stream.point(a,b)},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()}},Vg.geo.projection=vc,Vg.geo.projectionMutator=wc,(Vg.geo.equirectangular=function(){return vc(yc)}).raw=yc.invert=yc,Vg.geo.rotation=function(a){function b(b){return b=a(b[0]*Eh,b[1]*Eh),b[0]*=Fh,b[1]*=Fh,b}return a=Ac(a[0]%360*Eh,a[1]*Eh,a.length>2?a[2]*Eh:0),b.invert=function(b){return b=a.invert(b[0]*Eh,b[1]*Eh),b[0]*=Fh,b[1]*=Fh,b},b},zc.invert=yc,Vg.geo.circle=function(){function a(){var a="function"==typeof d?d.apply(this,arguments):d,b=Ac(-a[0]*Eh,-a[1]*Eh,0).invert,e=[];return c(null,null,1,{point:function(a,c){e.push(a=b(a,c)),a[0]*=Fh,a[1]*=Fh}}),{type:"Polygon",coordinates:[e]}}var b,c,d=[0,0],e=6;return a.origin=function(b){return arguments.length?(d=b,a):d},a.angle=function(d){return arguments.length?(c=Ec((b=+d)*Eh,e*Eh),a):b},a.precision=function(d){return arguments.length?(c=Ec(b*Eh,(e=+d)*Eh),a):e},a.angle(90)},Vg.geo.distance=function(a,b){var c,d=(b[0]-a[0])*Eh,e=a[1]*Eh,f=b[1]*Eh,g=Math.sin(d),h=Math.cos(d),i=Math.sin(e),j=Math.cos(e),k=Math.sin(f),l=Math.cos(f);return Math.atan2(Math.sqrt((c=l*g)*c+(c=j*k-i*l*h)*c),i*k+j*l*h)},Vg.geo.graticule=function(){function a(){return{type:"MultiLineString",coordinates:b()}}function b(){return Vg.range(Math.ceil(f/q)*q,e,q).map(m).concat(Vg.range(Math.ceil(j/r)*r,i,r).map(n)).concat(Vg.range(Math.ceil(d/o)*o,c,o).filter(function(a){return hh(a%q)>Ch}).map(k)).concat(Vg.range(Math.ceil(h/p)*p,g,p).filter(function(a){return hh(a%r)>Ch}).map(l))}var c,d,e,f,g,h,i,j,k,l,m,n,o=10,p=o,q=90,r=360,s=2.5;return a.lines=function(){return b().map(function(a){return{type:"LineString",coordinates:a}})},a.outline=function(){return{type:"Polygon",coordinates:[m(f).concat(n(i).slice(1),m(e).reverse().slice(1),n(j).reverse().slice(1))]}},a.extent=function(b){return arguments.length?a.majorExtent(b).minorExtent(b):a.minorExtent()},a.majorExtent=function(b){return arguments.length?(f=+b[0][0],e=+b[1][0],j=+b[0][1],i=+b[1][1],f>e&&(b=f,f=e,e=b),j>i&&(b=j,j=i,i=b),a.precision(s)):[[f,j],[e,i]]},a.minorExtent=function(b){return arguments.length?(d=+b[0][0],c=+b[1][0],h=+b[0][1],g=+b[1][1],d>c&&(b=d,d=c,c=b),h>g&&(b=h,h=g,g=b),a.precision(s)):[[d,h],[c,g]]},a.step=function(b){return arguments.length?a.majorStep(b).minorStep(b):a.minorStep()},a.majorStep=function(b){return arguments.length?(q=+b[0],r=+b[1],a):[q,r]},a.minorStep=function(b){return arguments.length?(o=+b[0],p=+b[1],a):[o,p]},a.precision=function(b){return arguments.length?(s=+b,k=Gc(h,g,90),l=Hc(d,c,s),m=Gc(j,i,90),n=Hc(f,e,s),a):s},a.majorExtent([[-180,-90+Ch],[180,90-Ch]]).minorExtent([[-180,-80-Ch],[180,80+Ch]])},Vg.geo.greatArc=function(){function a(){return{type:"LineString",coordinates:[b||d.apply(this,arguments),c||e.apply(this,arguments)]}}var b,c,d=Ic,e=Jc;return a.distance=function(){return Vg.geo.distance(b||d.apply(this,arguments),c||e.apply(this,arguments))},a.source=function(c){return arguments.length?(d=c,b="function"==typeof c?null:c,a):d},a.target=function(b){return arguments.length?(e=b,c="function"==typeof b?null:b,a):e},a.precision=function(){return arguments.length?a:0},a},Vg.geo.interpolate=function(a,b){return Kc(a[0]*Eh,a[1]*Eh,b[0]*Eh,b[1]*Eh)},Vg.geo.length=function(a){return Li=0,Vg.geo.stream(a,Mi),Li};var Li,Mi={sphere:i,point:i,lineStart:Lc,lineEnd:i,polygonStart:i,polygonEnd:i},Ni=Mc(function(a){return Math.sqrt(2/(1+a))},function(a){return 2*Math.asin(a/2)});(Vg.geo.azimuthalEqualArea=function(){return vc(Ni)}).raw=Ni;var Oi=Mc(function(a){var b=Math.acos(a);return b&&b/Math.sin(b)},pb);(Vg.geo.azimuthalEquidistant=function(){return vc(Oi)}).raw=Oi,(Vg.geo.conicConformal=function(){return gc(Nc)}).raw=Nc,(Vg.geo.conicEquidistant=function(){return gc(Oc)}).raw=Oc;var Pi=Mc(function(a){return 1/a},Math.atan);(Vg.geo.gnomonic=function(){return vc(Pi)}).raw=Pi,Pc.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-Bh]},(Vg.geo.mercator=function(){return Qc(Pc)}).raw=Pc;var Qi=Mc(function(){return 1},Math.asin);(Vg.geo.orthographic=function(){return vc(Qi)}).raw=Qi;var Ri=Mc(function(a){return 1/(1+a)},function(a){return 2*Math.atan(a)});(Vg.geo.stereographic=function(){return vc(Ri)}).raw=Ri,Rc.invert=function(a,b){return[Math.atan2(O(a),Math.cos(b)),N(Math.sin(b)/P(a))]},(Vg.geo.transverseMercator=function(){return Qc(Rc)}).raw=Rc,Vg.geom={},Vg.geom.hull=function(a){function b(a){if(a.length<3)return[];var b,e,f,g,h,i,j,k,l,m,n,o,p=ob(c),q=ob(d),r=a.length,s=r-1,t=[],u=[],v=0;if(p===Sc&&d===Tc)b=a;else for(f=0,b=[];r>f;++f)b.push([+p.call(this,e=a[f],f),+q.call(this,e,f)]);for(f=1;r>f;++f)(b[f][1]f;++f)f!==v&&(i=b[f][1]-b[v][1],h=b[f][0]-b[v][0],t.push({angle:Math.atan2(i,h),index:f}));for(t.sort(function(a,b){return a.angle-b.angle}),n=t[0].angle,m=t[0].index,l=0,f=1;s>f;++f){if(g=t[f].index,n==t[f].angle){if(h=b[m][0]-b[v][0],i=b[m][1]-b[v][1],j=b[g][0]-b[v][0],k=b[g][1]-b[v][1],h*h+i*i>=j*j+k*k){t[f].index=-1;continue}t[l].index=-1}n=t[f].angle,l=f,m=g}for(u.push(v),f=0,g=0;2>f;++g)t[g].index>-1&&(u.push(t[g].index),f++);for(o=u.length;s>g;++g)if(!(t[g].index<0)){for(;!Uc(u[o-2],u[o-1],t[g].index,b);)--o;u[o++]=t[g].index}var w=[];for(f=o-1;f>=0;--f)w.push(a[u[f]]);return w}var c=Sc,d=Tc;return arguments.length?b(a):(b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b)},Vg.geom.polygon=function(a){return mh(a,Si),a};var Si=Vg.geom.polygon.prototype=[];Si.area=function(){for(var a,b=-1,c=this.length,d=this[c-1],e=0;++b=d&&j.x<=f&&j.y>=e&&j.y<=g?[[d,g],[f,g],[f,e],[d,e]]:[];k.point=a[h]}),b}function c(a){return a.map(function(a,b){return{x:Math.round(f(a,b)/Ch)*Ch,y:Math.round(g(a,b)/Ch)*Ch,i:b}})}var d=Sc,e=Tc,f=d,g=e,h=$i;return a?b(a):(b.links=function(a){return vd(c(a)).edges.filter(function(a){return a.l&&a.r}).map(function(b){return{source:a[b.l.i],target:a[b.r.i]}})},b.triangles=function(a){var b=[];return vd(c(a)).cells.forEach(function(c,d){for(var e,f,g=c.site,h=c.edges.sort(fd),i=-1,j=h.length,k=h[j-1].edge,l=k.l===g?k.r:k.l;++i=j,m=d>=k,n=(m<<1)+l;a.leaf=!1,a=a.nodes[n]||(a.nodes[n]=Ad()),l?e=j:h=j,m?g=k:i=k,f(a,b,c,d,e,g,h,i)}var k,l,m,n,o,p,q,r,s,t=ob(h),u=ob(i);if(null!=b)p=b,q=c,r=d,s=e;else if(r=s=-(p=q=1/0),l=[],m=[],o=a.length,g)for(n=0;o>n;++n)k=a[n],k.xr&&(r=k.x),k.y>s&&(s=k.y),l.push(k.x),m.push(k.y);else for(n=0;o>n;++n){var v=+t(k=a[n],n),w=+u(k,n);p>v&&(p=v),q>w&&(q=w),v>r&&(r=v),w>s&&(s=w),l.push(v),m.push(w)}var x=r-p,y=s-q;x>y?s=q+x:r=p+y;var z=Ad();if(z.add=function(a){f(z,a,+t(a,++n),+u(a,n),p,q,r,s)},z.visit=function(a){Bd(a,z,p,q,r,s)},n=-1,null==b){for(;++n=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return c=bj.get(c)||aj,d=cj.get(d)||pb,Id(d(c.apply(null,Wg.call(arguments,1))))},Vg.interpolateHcl=Vd,Vg.interpolateHsl=Wd,Vg.interpolateLab=Xd,Vg.interpolateRound=Yd,Vg.transform=function(a){var b=Yg.createElementNS(Vg.ns.prefix.svg,"g");return(Vg.transform=function(a){if(null!=a){b.setAttribute("transform",a);var c=b.transform.baseVal.consolidate()}return new Zd(c?c.matrix:dj)})(a)},Zd.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var dj={a:1,b:0,c:0,d:1,e:0,f:0};Vg.interpolateTransform=be,Vg.layout={},Vg.layout.bundle=function(){return function(a){for(var b=[],c=-1,d=a.length;++c(e-c)*h){var i=b.charge*h*h;return a.px-=f*i,a.py-=g*i,!0}if(b.point&&isFinite(h)){var i=b.pointCharge*h*h;a.px-=f*i,a.py-=g*i}}return!b.charge}}function b(a){a.px=Vg.event.x,a.py=Vg.event.y,h.resume()}var c,d,e,f,g,h={},i=Vg.dispatch("start","tick","end"),j=[1,1],k=.9,l=ej,m=fj,n=-30,o=.1,p=.8,q=[],r=[];return h.tick=function(){if((d*=.99)<.005)return i.end({type:"end",alpha:d=0}),!0;var b,c,h,l,m,p,s,t,u,v=q.length,w=r.length;for(c=0;w>c;++c)h=r[c],l=h.source,m=h.target,t=m.x-l.x,u=m.y-l.y,(p=t*t+u*u)&&(p=d*f[c]*((p=Math.sqrt(p))-e[c])/p,t*=p,u*=p,m.x-=t*(s=l.weight/(m.weight+l.weight)),m.y-=u*s,l.x+=t*(s=1-s),l.y+=u*s);if((s=d*o)&&(t=j[0]/2,u=j[1]/2,c=-1,s))for(;++c0?a:0:a>0&&(i.start({type:"start",alpha:d=a}),Vg.timer(h.tick)),h):d},h.start=function(){function a(a,d){if(!c){for(c=new Array(i),h=0;i>h;++h)c[h]=[];for(h=0;j>h;++h){var e=r[h];c[e.source.index].push(e.target),c[e.target.index].push(e.source)}}for(var f,g=c[b],h=-1,j=g.length;++hb;++b)(d=q[b]).index=b,d.weight=0;for(b=0;k>b;++b)d=r[b],"number"==typeof d.source&&(d.source=q[d.source]),"number"==typeof d.target&&(d.target=q[d.target]),++d.source.weight,++d.target.weight;for(b=0;i>b;++b)d=q[b],isNaN(d.x)&&(d.x=a("x",o)),isNaN(d.y)&&(d.y=a("y",p)),isNaN(d.px)&&(d.px=d.x),isNaN(d.py)&&(d.py=d.y);if(e=[],"function"==typeof l)for(b=0;k>b;++b)e[b]=+l.call(this,r[b],b);else for(b=0;k>b;++b)e[b]=l;if(f=[],"function"==typeof m)for(b=0;k>b;++b)f[b]=+m.call(this,r[b],b);else for(b=0;k>b;++b)f[b]=m;if(g=[],"function"==typeof n)for(b=0;i>b;++b)g[b]=+n.call(this,q[b],b);else for(b=0;i>b;++b)g[b]=n;return h.resume()},h.resume=function(){return h.alpha(.1)},h.stop=function(){return h.alpha(0)},h.drag=function(){return c||(c=Vg.behavior.drag().origin(pb).on("dragstart.force",he).on("drag.force",b).on("dragend.force",ie)),arguments.length?(this.on("mouseover.force",je).on("mouseout.force",ke).call(c),void 0):c},Vg.rebind(h,i,"on")};var ej=20,fj=1;Vg.layout.hierarchy=function(){function a(b,g,h){var i=e.call(c,b,g);if(b.depth=g,h.push(b),i&&(j=i.length)){for(var j,k,l=-1,m=b.children=new Array(j),n=0,o=g+1;++ln;++n)for(e.call(a,j[0][n],o=p[n],k[0][n][1]),m=1;q>m;++m)e.call(a,j[m][n],o+=k[m-1][n][1],k[m][n][1]);return h}var b=pb,c=ue,d=ve,e=te,f=re,g=se;return a.values=function(c){return arguments.length?(b=c,a):b},a.order=function(b){return arguments.length?(c="function"==typeof b?b:hj.get(b)||ue,a):c},a.offset=function(b){return arguments.length?(d="function"==typeof b?b:ij.get(b)||ve,a):d},a.x=function(b){return arguments.length?(f=b,a):f},a.y=function(b){return arguments.length?(g=b,a):g},a.out=function(b){return arguments.length?(e=b,a):e},a};var hj=Vg.map({"inside-out":function(a){var b,c,d=a.length,e=a.map(we),f=a.map(xe),g=Vg.range(d).sort(function(a,b){return e[a]-e[b]}),h=0,i=0,j=[],k=[];for(b=0;d>b;++b)c=g[b],i>h?(h+=f[c],j.push(c)):(i+=f[c],k.push(c));return k.reverse().concat(j)},reverse:function(a){return Vg.range(a.length).reverse()},"default":ue}),ij=Vg.map({silhouette:function(a){var b,c,d,e=a.length,f=a[0].length,g=[],h=0,i=[];for(c=0;f>c;++c){for(b=0,d=0;e>b;b++)d+=a[b][c][1];d>h&&(h=d),g.push(d)}for(c=0;f>c;++c)i[c]=(h-g[c])/2;return i},wiggle:function(a){var b,c,d,e,f,g,h,i,j,k=a.length,l=a[0],m=l.length,n=[];for(n[0]=i=j=0,c=1;m>c;++c){for(b=0,e=0;k>b;++b)e+=a[b][c][1];for(b=0,f=0,h=l[c][0]-l[c-1][0];k>b;++b){for(d=0,g=(a[b][c][1]-a[b][c-1][1])/(2*h);b>d;++d)g+=(a[d][c][1]-a[d][c-1][1])/h;f+=g*a[b][c][1]}n[c]=i-=e?f/e*h:0,j>i&&(j=i)}for(c=0;m>c;++c)n[c]-=j;return n},expand:function(a){var b,c,d,e=a.length,f=a[0].length,g=1/e,h=[];for(c=0;f>c;++c){for(b=0,d=0;e>b;b++)d+=a[b][c][1];if(d)for(b=0;e>b;b++)a[b][c][1]/=d;else for(b=0;e>b;b++)a[b][c][1]=g}for(c=0;f>c;++c)h[c]=0;return h},zero:ve});Vg.layout.histogram=function(){function a(a,f){for(var g,h,i=[],j=a.map(c,this),k=d.call(this,j,f),l=e.call(this,k,j,f),f=-1,m=j.length,n=l.length-1,o=b?1:1/m;++f0)for(f=-1;++f=k[0]&&h<=k[1]&&(g=i[Vg.bisect(l,h,1,n)-1],g.y+=o,g.push(a[f]));return i}var b=!0,c=Number,d=Be,e=ze;return a.value=function(b){return arguments.length?(c=b,a):c},a.range=function(b){return arguments.length?(d=ob(b),a):d},a.bins=function(b){return arguments.length?(e="number"==typeof b?function(a){return Ae(a,b)}:ob(b),a):e},a.frequency=function(c){return arguments.length?(b=!!c,a):b},a},Vg.layout.tree=function(){function a(a,f){function g(a,b){var d=a.children,e=a._tree;if(d&&(f=d.length)){for(var f,h,j,k=d[0],l=k,m=-1;++m0&&(Le(Me(h,a,d),a,e),j+=e,k+=e),l+=h._tree.mod,j+=f._tree.mod,m+=i._tree.mod,k+=g._tree.mod;h&&!Ee(g)&&(g._tree.thread=h,g._tree.mod+=l-k),f&&!De(i)&&(i._tree.thread=f,i._tree.mod+=j-m,d=a)}return d}var j=b.call(this,a,f),k=j[0];Je(k,function(a,b){a._tree={ancestor:a,prelim:0,mod:0,change:0,shift:0,number:b?b._tree.number+1:0}}),g(k),h(k,-k._tree.prelim);var l=Fe(k,He),m=Fe(k,Ge),n=Fe(k,Ie),o=l.x-c(l,m)/2,p=m.x+c(m,l)/2,q=n.depth||1;return Je(k,e?function(a){a.x*=d[0],a.y=a.depth*d[1],delete a._tree}:function(a){a.x=(a.x-o)/(p-o)*d[0],a.y=a.depth/q*d[1],delete a._tree}),j}var b=Vg.layout.hierarchy().sort(null).value(null),c=Ce,d=[1,1],e=!1;return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(e=null==(d=b),a):e?null:d},a.nodeSize=function(b){return arguments.length?(e=null!=(d=b),a):e?d:null},me(a,b)},Vg.layout.pack=function(){function a(a,f){var g=c.call(this,a,f),h=g[0],i=e[0],j=e[1],k=null==b?Math.sqrt:"function"==typeof b?b:function(){return b };if(h.x=h.y=0,Je(h,function(a){a.r=+k(a.value)}),Je(h,Re),d){var l=d*(b?1:Math.max(2*h.r/i,2*h.r/j))/2;Je(h,function(a){a.r+=l}),Je(h,Re),Je(h,function(a){a.r-=l})}return Ue(h,i/2,j/2,b?1:1/Math.max(2*h.r/i,2*h.r/j)),g}var b,c=Vg.layout.hierarchy().sort(Ne),d=0,e=[1,1];return a.size=function(b){return arguments.length?(e=b,a):e},a.radius=function(c){return arguments.length?(b=null==c||"function"==typeof c?c:+c,a):b},a.padding=function(b){return arguments.length?(d=+b,a):d},me(a,c)},Vg.layout.cluster=function(){function a(a,f){var g,h=b.call(this,a,f),i=h[0],j=0;Je(i,function(a){var b=a.children;b&&b.length?(a.x=Xe(b),a.y=We(b)):(a.x=g?j+=c(a,g):0,a.y=0,g=a)});var k=Ye(i),l=Ze(i),m=k.x-c(k,l)/2,n=l.x+c(l,k)/2;return Je(i,e?function(a){a.x=(a.x-i.x)*d[0],a.y=(i.y-a.y)*d[1]}:function(a){a.x=(a.x-m)/(n-m)*d[0],a.y=(1-(i.y?a.y/i.y:1))*d[1]}),h}var b=Vg.layout.hierarchy().sort(null).value(null),c=Ce,d=[1,1],e=!1;return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(e=null==(d=b),a):e?null:d},a.nodeSize=function(b){return arguments.length?(e=null!=(d=b),a):e?d:null},me(a,b)},Vg.layout.treemap=function(){function a(a,b){for(var c,d,e=-1,f=a.length;++eb?0:b),c.area=isNaN(d)||0>=d?0:d}function b(c){var f=c.children;if(f&&f.length){var g,h,i,j=l(c),k=[],m=f.slice(),o=1/0,p="slice"===n?j.dx:"dice"===n?j.dy:"slice-dice"===n?1&c.depth?j.dy:j.dx:Math.min(j.dx,j.dy);for(a(m,j.dx*j.dy/c.value),k.area=0;(i=m.length)>0;)k.push(g=m[i-1]),k.area+=g.area,"squarify"!==n||(h=d(k,p))<=o?(m.pop(),o=h):(k.area-=k.pop().area,e(k,p,j,!1),p=Math.min(j.dx,j.dy),k.length=k.area=0,o=1/0);k.length&&(e(k,p,j,!0),k.length=k.area=0),f.forEach(b)}}function c(b){var d=b.children;if(d&&d.length){var f,g=l(b),h=d.slice(),i=[];for(a(h,g.dx*g.dy/b.value),i.area=0;f=h.pop();)i.push(f),i.area+=f.area,null!=f.z&&(e(i,f.z?g.dx:g.dy,g,!h.length),i.length=i.area=0);d.forEach(c)}}function d(a,b){for(var c,d=a.area,e=0,f=1/0,g=-1,h=a.length;++gc&&(f=c),c>e&&(e=c));return d*=d,b*=b,d?Math.max(b*e*o/d,d/(b*f*o)):1/0}function e(a,b,c,d){var e,f=-1,g=a.length,h=c.x,j=c.y,k=b?i(a.area/b):0;if(b==c.dx){for((d||k>c.dy)&&(k=c.dy);++fc.dx)&&(k=c.dx);++fc&&(b=1),1>c&&(a=0),function(){var c,d,e;do c=2*Math.random()-1,d=2*Math.random()-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(){var a=Vg.random.normal.apply(Vg,arguments);return function(){return Math.exp(a())}},irwinHall:function(a){return function(){for(var b=0,c=0;a>c;c++)b+=Math.random();return b/a}}},Vg.scale={};var jj={floor:pb,ceil:pb};Vg.scale.linear=function(){return gf([0,1],[0,1],Gd,!1)};var kj={s:1,g:1,p:1,r:1,e:1};Vg.scale.log=function(){return pf(Vg.scale.linear().domain([0,1]),10,!0,[1,10])};var lj=Vg.format(".0e"),mj={floor:function(a){return-Math.ceil(-a)},ceil:function(a){return-Math.floor(-a)}};Vg.scale.pow=function(){return qf(Vg.scale.linear(),1,[0,1])},Vg.scale.sqrt=function(){return Vg.scale.pow().exponent(.5)},Vg.scale.ordinal=function(){return sf([],{t:"range",a:[[]]})},Vg.scale.category10=function(){return Vg.scale.ordinal().range(nj)},Vg.scale.category20=function(){return Vg.scale.ordinal().range(oj)},Vg.scale.category20b=function(){return Vg.scale.ordinal().range(pj)},Vg.scale.category20c=function(){return Vg.scale.ordinal().range(qj)};var nj=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(fb),oj=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(fb),pj=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(fb),qj=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(fb);Vg.scale.quantile=function(){return tf([],[])},Vg.scale.quantize=function(){return uf(0,1,[0,1])},Vg.scale.threshold=function(){return vf([.5],[0,1])},Vg.scale.identity=function(){return wf([0,1])},Vg.svg={},Vg.svg.arc=function(){function a(){var a=b.apply(this,arguments),f=c.apply(this,arguments),g=d.apply(this,arguments)+rj,h=e.apply(this,arguments)+rj,i=(g>h&&(i=g,g=h,h=i),h-g),j=zh>i?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=sj?a?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+a+"A"+a+","+a+" 0 1,0 0,"+-a+"A"+a+","+a+" 0 1,0 0,"+a+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":a?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+a*m+","+a*n+"A"+a+","+a+" 0 "+j+",0 "+a*k+","+a*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0Z"}var b=xf,c=yf,d=zf,e=Af;return a.innerRadius=function(c){return arguments.length?(b=ob(c),a):b},a.outerRadius=function(b){return arguments.length?(c=ob(b),a):c},a.startAngle=function(b){return arguments.length?(d=ob(b),a):d},a.endAngle=function(b){return arguments.length?(e=ob(b),a):e},a.centroid=function(){var a=(b.apply(this,arguments)+c.apply(this,arguments))/2,f=(d.apply(this,arguments)+e.apply(this,arguments))/2+rj;return[Math.cos(f)*a,Math.sin(f)*a]},a};var rj=-Bh,sj=Ah-Ch;Vg.svg.line=function(){return Bf(pb)};var tj=Vg.map({linear:Cf,"linear-closed":Df,step:Ef,"step-before":Ff,"step-after":Gf,basis:Mf,"basis-open":Nf,"basis-closed":Of,bundle:Pf,cardinal:Jf,"cardinal-open":Hf,"cardinal-closed":If,monotone:Vf});tj.forEach(function(a,b){b.key=a,b.closed=/-closed$/.test(a)});var uj=[0,2/3,1/3,0],vj=[0,1/3,2/3,0],wj=[0,1/6,2/3,1/6];Vg.svg.line.radial=function(){var a=Bf(Wf);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},Ff.reverse=Gf,Gf.reverse=Ff,Vg.svg.area=function(){return Xf(pb)},Vg.svg.area.radial=function(){var a=Xf(Wf);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},Vg.svg.chord=function(){function a(a,h){var i=b(this,f,a,h),j=b(this,g,a,h);return"M"+i.p0+d(i.r,i.p1,i.a1-i.a0)+(c(i,j)?e(i.r,i.p1,i.r,i.p0):e(i.r,i.p1,j.r,j.p0)+d(j.r,j.p1,j.a1-j.a0)+e(j.r,j.p1,i.r,i.p0))+"Z"}function b(a,b,c,d){var e=b.call(a,c,d),f=h.call(a,e,d),g=i.call(a,e,d)+rj,k=j.call(a,e,d)+rj;return{r:f,a0:g,a1:k,p0:[f*Math.cos(g),f*Math.sin(g)],p1:[f*Math.cos(k),f*Math.sin(k)]}}function c(a,b){return a.a0==b.a0&&a.a1==b.a1}function d(a,b,c){return"A"+a+","+a+" 0 "+ +(c>zh)+",1 "+b}function e(a,b,c,d){return"Q 0,0 "+d}var f=Ic,g=Jc,h=Yf,i=zf,j=Af;return a.radius=function(b){return arguments.length?(h=ob(b),a):h},a.source=function(b){return arguments.length?(f=ob(b),a):f},a.target=function(b){return arguments.length?(g=ob(b),a):g},a.startAngle=function(b){return arguments.length?(i=ob(b),a):i},a.endAngle=function(b){return arguments.length?(j=ob(b),a):j},a},Vg.svg.diagonal=function(){function a(a,e){var f=b.call(this,a,e),g=c.call(this,a,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(d),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var b=Ic,c=Jc,d=Zf;return a.source=function(c){return arguments.length?(b=ob(c),a):b},a.target=function(b){return arguments.length?(c=ob(b),a):c},a.projection=function(b){return arguments.length?(d=b,a):d},a},Vg.svg.diagonal.radial=function(){var a=Vg.svg.diagonal(),b=Zf,c=a.projection;return a.projection=function(a){return arguments.length?c($f(b=a)):b},a},Vg.svg.symbol=function(){function a(a,d){return(xj.get(b.call(this,a,d))||bg)(c.call(this,a,d))}var b=ag,c=_f;return a.type=function(c){return arguments.length?(b=ob(c),a):b},a.size=function(b){return arguments.length?(c=ob(b),a):c},a};var xj=Vg.map({circle:bg,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+-3*b+","+-b+"H"+-b+"V"+-3*b+"H"+b+"V"+-b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+-b+"V"+b+"H"+-3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*Bj)),c=b*Bj;return"M0,"+-b+"L"+c+",0 0,"+b+" "+-c+",0Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+-b+","+-b+"L"+b+","+-b+" "+b+","+b+" "+-b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/Aj),c=b*Aj/2;return"M0,"+c+"L"+b+","+-c+" "+-b+","+-c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/Aj),c=b*Aj/2;return"M0,"+-c+"L"+b+","+c+" "+-b+","+c+"Z"}});Vg.svg.symbolTypes=xj.keys();var yj,zj,Aj=Math.sqrt(3),Bj=Math.tan(30*Eh),Cj=[],Dj=0;Cj.call=rh.call,Cj.empty=rh.empty,Cj.node=rh.node,Cj.size=rh.size,Vg.transition=function(a){return arguments.length?yj?a.transition():a:uh.transition()},Vg.transition.prototype=Cj,Cj.select=function(a){var b,c,d,e=this.id,f=[];a=p(a);for(var g=-1,h=this.length;++gf;f++){e.push(b=[]);for(var c=this[f],h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h)&&b.push(d)}return cg(e,this.id)},Cj.tween=function(a,b){var c=this.id;return arguments.length<2?this.node().__transition__[c].tween.get(a):C(this,null==b?function(b){b.__transition__[c].tween.remove(a)}:function(d){d.__transition__[c].tween.set(a,b)})},Cj.attr=function(a,b){function c(){this.removeAttribute(h)}function d(){this.removeAttributeNS(h.space,h.local)}function e(a){return null==a?c:(a+="",function(){var b,c=this.getAttribute(h);return c!==a&&(b=g(c,a),function(a){this.setAttribute(h,b(a))})})}function f(a){return null==a?d:(a+="",function(){var b,c=this.getAttributeNS(h.space,h.local);return c!==a&&(b=g(c,a),function(a){this.setAttributeNS(h.space,h.local,b(a))})})}if(arguments.length<2){for(b in a)this.attr(b,a[b]);return this}var g="transform"==a?be:Gd,h=Vg.ns.qualify(a);return dg(this,"attr."+a,b,h.local?f:e)},Cj.attrTween=function(a,b){function c(a,c){var d=b.call(this,a,c,this.getAttribute(e));return d&&function(a){this.setAttribute(e,d(a))}}function d(a,c){var d=b.call(this,a,c,this.getAttributeNS(e.space,e.local));return d&&function(a){this.setAttributeNS(e.space,e.local,d(a))}}var e=Vg.ns.qualify(a);return this.tween("attr."+a,e.local?d:c)},Cj.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(b){return null==b?d:(b+="",function(){var d,e=$g.getComputedStyle(this,null).getPropertyValue(a);return e!==b&&(d=Gd(e,b),function(b){this.style.setProperty(a,d(b),c)})})}var f=arguments.length;if(3>f){if("string"!=typeof a){2>f&&(b="");for(c in a)this.style(c,a[c],b);return this}c=""}return dg(this,"style."+a,b,e)},Cj.styleTween=function(a,b,c){function d(d,e){var f=b.call(this,d,e,$g.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),c)}}return arguments.length<3&&(c=""),this.tween("style."+a,d)},Cj.text=function(a){return dg(this,"text",a,eg)},Cj.remove=function(){return this.each("end.transition",function(){var a;this.__transition__.count<2&&(a=this.parentNode)&&a.removeChild(this)})},Cj.ease=function(a){var b=this.id;return arguments.length<1?this.node().__transition__[b].ease:("function"!=typeof a&&(a=Vg.ease.apply(Vg,arguments)),C(this,function(c){c.__transition__[b].ease=a}))},Cj.delay=function(a){var b=this.id;return C(this,"function"==typeof a?function(c,d,e){c.__transition__[b].delay=+a.call(c,c.__data__,d,e)}:(a=+a,function(c){c.__transition__[b].delay=a}))},Cj.duration=function(a){var b=this.id;return C(this,"function"==typeof a?function(c,d,e){c.__transition__[b].duration=Math.max(1,a.call(c,c.__data__,d,e))}:(a=Math.max(1,a),function(c){c.__transition__[b].duration=a}))},Cj.each=function(a,b){var c=this.id;if(arguments.length<2){var d=zj,e=yj;yj=c,C(this,function(b,d,e){zj=b.__transition__[c],a.call(b,b.__data__,d,e)}),zj=d,yj=e}else C(this,function(d){var e=d.__transition__[c];(e.event||(e.event=Vg.dispatch("start","end"))).on(a,b)});return this},Cj.transition=function(){for(var a,b,c,d,e=this.id,f=++Dj,g=[],h=0,i=this.length;i>h;h++){g.push(a=[]);for(var b=this[h],j=0,k=b.length;k>j;j++)(c=b[j])&&(d=Object.create(c.__transition__[e]),d.delay+=d.duration,fg(c,j,f,d)),a.push(c)}return cg(g,f)},Vg.svg.axis=function(){function a(a){a.each(function(){var a,j=Vg.select(this),k=this.__chart__||c,l=this.__chart__=c.copy(),m=null==i?l.ticks?l.ticks.apply(l,h):l.domain():i,n=null==b?l.tickFormat?l.tickFormat.apply(l,h):pb:b,o=j.selectAll(".tick").data(m,l),p=o.enter().insert("g",".domain").attr("class","tick").style("opacity",Ch),q=Vg.transition(o.exit()).style("opacity",Ch).remove(),r=Vg.transition(o).style("opacity",1),s=bf(l),t=j.selectAll(".domain").data([0]),u=(t.enter().append("path").attr("class","domain"),Vg.transition(t));p.append("line"),p.append("text");var v=p.select("line"),w=r.select("line"),x=o.select("text").text(n),y=p.select("text"),z=r.select("text");switch(d){case"bottom":a=gg,v.attr("y2",e),y.attr("y",Math.max(e,0)+g),w.attr("x2",0).attr("y2",e),z.attr("x",0).attr("y",Math.max(e,0)+g),x.attr("dy",".71em").style("text-anchor","middle"),u.attr("d","M"+s[0]+","+f+"V0H"+s[1]+"V"+f);break;case"top":a=gg,v.attr("y2",-e),y.attr("y",-(Math.max(e,0)+g)),w.attr("x2",0).attr("y2",-e),z.attr("x",0).attr("y",-(Math.max(e,0)+g)),x.attr("dy","0em").style("text-anchor","middle"),u.attr("d","M"+s[0]+","+-f+"V0H"+s[1]+"V"+-f);break;case"left":a=hg,v.attr("x2",-e),y.attr("x",-(Math.max(e,0)+g)),w.attr("x2",-e).attr("y2",0),z.attr("x",-(Math.max(e,0)+g)).attr("y",0),x.attr("dy",".32em").style("text-anchor","end"),u.attr("d","M"+-f+","+s[0]+"H0V"+s[1]+"H"+-f);break;case"right":a=hg,v.attr("x2",e),y.attr("x",Math.max(e,0)+g),w.attr("x2",e).attr("y2",0),z.attr("x",Math.max(e,0)+g).attr("y",0),x.attr("dy",".32em").style("text-anchor","start"),u.attr("d","M"+f+","+s[0]+"H0V"+s[1]+"H"+f)}if(l.rangeBand){var A=l.rangeBand()/2,B=function(a){return l(a)+A};p.call(a,B),r.call(a,B)}else p.call(a,k),r.call(a,l),q.call(a,l)})}var b,c=Vg.scale.linear(),d=Ej,e=6,f=6,g=3,h=[10],i=null;return a.scale=function(b){return arguments.length?(c=b,a):c},a.orient=function(b){return arguments.length?(d=b in Fj?b+"":Ej,a):d},a.ticks=function(){return arguments.length?(h=arguments,a):h},a.tickValues=function(b){return arguments.length?(i=b,a):i},a.tickFormat=function(c){return arguments.length?(b=c,a):b},a.tickSize=function(b){var c=arguments.length;return c?(e=+b,f=+arguments[c-1],a):e},a.innerTickSize=function(b){return arguments.length?(e=+b,a):e},a.outerTickSize=function(b){return arguments.length?(f=+b,a):f},a.tickPadding=function(b){return arguments.length?(g=+b,a):g},a.tickSubdivide=function(){return arguments.length&&a},a};var Ej="bottom",Fj={top:1,right:1,bottom:1,left:1};Vg.svg.brush=function(){function a(f){f.each(function(){var f=Vg.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",e).on("touchstart.brush",e),g=f.selectAll(".background").data([0]);g.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),f.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var h=f.selectAll(".resize").data(q,pb);h.exit().remove(),h.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return Gj[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",a.empty()?"none":null);var k,l=Vg.transition(f),m=Vg.transition(g);i&&(k=bf(i),m.attr("x",k[0]).attr("width",k[1]-k[0]),c(l)),j&&(k=bf(j),m.attr("y",k[0]).attr("height",k[1]-k[0]),d(l)),b(l)})}function b(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+k[+/e$/.test(a)]+","+m[+/^s/.test(a)]+")"})}function c(a){a.select(".extent").attr("x",k[0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",k[1]-k[0])}function d(a){a.select(".extent").attr("y",m[0]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",m[1]-m[0])}function e(){function e(){32==Vg.event.keyCode&&(C||(t=null,E[0]-=k[1],E[1]-=m[1],C=2),l())}function n(){32==Vg.event.keyCode&&2==C&&(E[0]+=k[1],E[1]+=m[1],C=0,l())}function q(){var a=Vg.mouse(v),e=!1;u&&(a[0]+=u[0],a[1]+=u[1]),C||(Vg.event.altKey?(t||(t=[(k[0]+k[1])/2,(m[0]+m[1])/2]),E[0]=k[+(a[0]l?(e=d,d=l):e=l),n[0]!=d||n[1]!=e?(c?g=null:f=null,n[0]=d,n[1]=e,!0):void 0}function s(){q(),y.style("pointer-events","all").selectAll(".resize").style("display",a.empty()?"none":null),Vg.select("body").style("cursor",null),F.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),D(),x({type:"brushend"})}var t,u,v=this,w=Vg.select(Vg.event.target),x=h.of(v,arguments),y=Vg.select(v),z=w.datum(),A=!/^(n|s)$/.test(z)&&i,B=!/^(e|w)$/.test(z)&&j,C=w.classed("extent"),D=J(),E=Vg.mouse(v),F=Vg.select($g).on("keydown.brush",e).on("keyup.brush",n);if(Vg.event.changedTouches?F.on("touchmove.brush",q).on("touchend.brush",s):F.on("mousemove.brush",q).on("mouseup.brush",s),y.interrupt().selectAll("*").interrupt(),C)E[0]=k[0]-E[0],E[1]=m[0]-E[1];else if(z){var G=+/w$/.test(z),H=+/^n/.test(z);u=[k[1-G]-E[0],m[1-H]-E[1]],E[0]=k[G],E[1]=m[H]}else Vg.event.altKey&&(t=E.slice());y.style("pointer-events","none").selectAll(".resize").style("display",null),Vg.select("body").style("cursor",w.style("cursor")),x({type:"brushstart"}),q()}var f,g,h=n(a,"brushstart","brush","brushend"),i=null,j=null,k=[0,0],m=[0,0],o=!0,p=!0,q=Hj[0];return a.event=function(a){a.each(function(){var a=h.of(this,arguments),b={x:k,y:m,i:f,j:g},c=this.__chart__||b;this.__chart__=b,yj?Vg.select(this).transition().each("start.brush",function(){f=c.i,g=c.j,k=c.x,m=c.y,a({type:"brushstart"})}).tween("brush:brush",function(){var c=Hd(k,b.x),d=Hd(m,b.y);return f=g=null,function(e){k=b.x=c(e),m=b.y=d(e),a({type:"brush",mode:"resize"})}}).each("end.brush",function(){f=b.i,g=b.j,a({type:"brush",mode:"resize"}),a({type:"brushend"})}):(a({type:"brushstart"}),a({type:"brush",mode:"resize"}),a({type:"brushend"}))})},a.x=function(b){return arguments.length?(i=b,q=Hj[!i<<1|!j],a):i},a.y=function(b){return arguments.length?(j=b,q=Hj[!i<<1|!j],a):j},a.clamp=function(b){return arguments.length?(i&&j?(o=!!b[0],p=!!b[1]):i?o=!!b:j&&(p=!!b),a):i&&j?[o,p]:i?o:j?p:null},a.extent=function(b){var c,d,e,h,l;return arguments.length?(i&&(c=b[0],d=b[1],j&&(c=c[0],d=d[0]),f=[c,d],i.invert&&(c=i(c),d=i(d)),c>d&&(l=c,c=d,d=l),(c!=k[0]||d!=k[1])&&(k=[c,d])),j&&(e=b[0],h=b[1],i&&(e=e[1],h=h[1]),g=[e,h],j.invert&&(e=j(e),h=j(h)),e>h&&(l=e,e=h,h=l),(e!=m[0]||h!=m[1])&&(m=[e,h])),a):(i&&(f?(c=f[0],d=f[1]):(c=k[0],d=k[1],i.invert&&(c=i.invert(c),d=i.invert(d)),c>d&&(l=c,c=d,d=l))),j&&(g?(e=g[0],h=g[1]):(e=m[0],h=m[1],j.invert&&(e=j.invert(e),h=j.invert(h)),e>h&&(l=e,e=h,h=l))),i&&j?[[c,e],[d,h]]:i?[c,d]:j&&[e,h])},a.clear=function(){return a.empty()||(k=[0,0],m=[0,0],f=g=null),a},a.empty=function(){return!!i&&k[0]==k[1]||!!j&&m[0]==m[1]},Vg.rebind(a,h,"on")};var Gj={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Hj=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Ij=Vg.time={},Jj=Date,Kj=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];ig.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(){Lj.setUTCDate.apply(this._,arguments)},setDay:function(){Lj.setUTCDay.apply(this._,arguments)},setFullYear:function(){Lj.setUTCFullYear.apply(this._,arguments)},setHours:function(){Lj.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Lj.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Lj.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Lj.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Lj.setUTCSeconds.apply(this._,arguments)},setTime:function(){Lj.setTime.apply(this._,arguments)}};var Lj=Date.prototype,Mj="%a %b %e %X %Y",Nj="%m/%d/%Y",Oj="%H:%M:%S",Pj=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Qj=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Rj=["January","February","March","April","May","June","July","August","September","October","November","December"],Sj=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Ij.year=jg(function(a){return a=Ij.day(a),a.setMonth(0,1),a},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()}),Ij.years=Ij.year.range,Ij.years.utc=Ij.year.utc.range,Ij.day=jg(function(a){var b=new Jj(2e3,0);return b.setFullYear(a.getFullYear(),a.getMonth(),a.getDate()),b},function(a,b){a.setDate(a.getDate()+b)},function(a){return a.getDate()-1}),Ij.days=Ij.day.range,Ij.days.utc=Ij.day.utc.range,Ij.dayOfYear=function(a){var b=Ij.year(a);return Math.floor((a-b-6e4*(a.getTimezoneOffset()-b.getTimezoneOffset()))/864e5)},Kj.forEach(function(a,b){a=a.toLowerCase(),b=7-b;var c=Ij[a]=jg(function(a){return(a=Ij.day(a)).setDate(a.getDate()-(a.getDay()+b)%7),a},function(a,b){a.setDate(a.getDate()+7*Math.floor(b))},function(a){var c=Ij.year(a).getDay();return Math.floor((Ij.dayOfYear(a)+(c+b)%7)/7)-(c!==b)});Ij[a+"s"]=c.range,Ij[a+"s"].utc=c.utc.range,Ij[a+"OfYear"]=function(a){var c=Ij.year(a).getDay();return Math.floor((Ij.dayOfYear(a)+(c+b)%7)/7)}}),Ij.week=Ij.sunday,Ij.weeks=Ij.sunday.range,Ij.weeks.utc=Ij.sunday.utc.range,Ij.weekOfYear=Ij.sundayOfYear,Ij.format=lg;var Tj=ng(Pj),Uj=og(Pj),Vj=ng(Qj),Wj=og(Qj),Xj=ng(Rj),Yj=og(Rj),Zj=ng(Sj),$j=og(Sj),_j=/^%/,ak={"-":"",_:" ",0:"0"},bk={a:function(a){return Qj[a.getDay()]},A:function(a){return Pj[a.getDay()]},b:function(a){return Sj[a.getMonth()]},B:function(a){return Rj[a.getMonth()]},c:lg(Mj),d:function(a,b){return pg(a.getDate(),b,2)},e:function(a,b){return pg(a.getDate(),b,2)},H:function(a,b){return pg(a.getHours(),b,2)},I:function(a,b){return pg(a.getHours()%12||12,b,2)},j:function(a,b){return pg(1+Ij.dayOfYear(a),b,3)},L:function(a,b){return pg(a.getMilliseconds(),b,3)},m:function(a,b){return pg(a.getMonth()+1,b,2)},M:function(a,b){return pg(a.getMinutes(),b,2)},p:function(a){return a.getHours()>=12?"PM":"AM"},S:function(a,b){return pg(a.getSeconds(),b,2)},U:function(a,b){return pg(Ij.sundayOfYear(a),b,2)},w:function(a){return a.getDay()},W:function(a,b){return pg(Ij.mondayOfYear(a),b,2)},x:lg(Nj),X:lg(Oj),y:function(a,b){return pg(a.getFullYear()%100,b,2)},Y:function(a,b){return pg(a.getFullYear()%1e4,b,4)},Z:Mg,"%":function(){return"%"}},ck={a:qg,A:rg,b:vg,B:wg,c:xg,d:Fg,e:Fg,H:Hg,I:Hg,j:Gg,L:Kg,m:Eg,M:Ig,p:Lg,S:Jg,U:tg,w:sg,W:ug,x:yg,X:zg,y:Bg,Y:Ag,Z:Cg,"%":Ng},dk=/^\s*\d+/,ek=Vg.map({am:0,pm:1});lg.utc=Og;var fk=Og("%Y-%m-%dT%H:%M:%S.%LZ");lg.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Pg:fk,Pg.parse=function(a){var b=new Date(a);return isNaN(b)?null:b},Pg.toString=fk.toString,Ij.second=jg(function(a){return new Jj(1e3*Math.floor(a/1e3))},function(a,b){a.setTime(a.getTime()+1e3*Math.floor(b))},function(a){return a.getSeconds()}),Ij.seconds=Ij.second.range,Ij.seconds.utc=Ij.second.utc.range,Ij.minute=jg(function(a){return new Jj(6e4*Math.floor(a/6e4))},function(a,b){a.setTime(a.getTime()+6e4*Math.floor(b))},function(a){return a.getMinutes()}),Ij.minutes=Ij.minute.range,Ij.minutes.utc=Ij.minute.utc.range,Ij.hour=jg(function(a){var b=a.getTimezoneOffset()/60;return new Jj(36e5*(Math.floor(a/36e5-b)+b))},function(a,b){a.setTime(a.getTime()+36e5*Math.floor(b))},function(a){return a.getHours()}),Ij.hours=Ij.hour.range,Ij.hours.utc=Ij.hour.utc.range,Ij.month=jg(function(a){return a=Ij.day(a),a.setDate(1),a},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()}),Ij.months=Ij.month.range,Ij.months.utc=Ij.month.utc.range;var gk=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],hk=[[Ij.second,1],[Ij.second,5],[Ij.second,15],[Ij.second,30],[Ij.minute,1],[Ij.minute,5],[Ij.minute,15],[Ij.minute,30],[Ij.hour,1],[Ij.hour,3],[Ij.hour,6],[Ij.hour,12],[Ij.day,1],[Ij.day,2],[Ij.week,1],[Ij.month,1],[Ij.month,3],[Ij.year,1]],ik=[[lg("%Y"),Sb],[lg("%B"),function(a){return a.getMonth()}],[lg("%b %d"),function(a){return 1!=a.getDate()}],[lg("%a %d"),function(a){return a.getDay()&&1!=a.getDate()}],[lg("%I %p"),function(a){return a.getHours()}],[lg("%I:%M"),function(a){return a.getMinutes()}],[lg(":%S"),function(a){return a.getSeconds()}],[lg(".%L"),function(a){return a.getMilliseconds()}]],jk=Sg(ik);hk.year=Ij.year,Ij.scale=function(){return Qg(Vg.scale.linear(),hk,jk)};var kk={range:function(a,b,c){return Vg.range(+a,+b,c).map(Rg)}},lk=hk.map(function(a){return[a[0].utc,a[1]]}),mk=[[Og("%Y"),Sb],[Og("%B"),function(a){return a.getUTCMonth()}],[Og("%b %d"),function(a){return 1!=a.getUTCDate()}],[Og("%a %d"),function(a){return a.getUTCDay()&&1!=a.getUTCDate()}],[Og("%I %p"),function(a){return a.getUTCHours()}],[Og("%I:%M"),function(a){return a.getUTCMinutes()}],[Og(":%S"),function(a){return a.getUTCSeconds()}],[Og(".%L"),function(a){return a.getUTCMilliseconds()}]],nk=Sg(mk);return lk.year=Ij.year.utc,Ij.scale.utc=function(){return Qg(Vg.scale.linear(),lk,nk)},Vg.text=qb(function(a){return a.responseText}),Vg.json=function(a,b){return rb(a,"application/json",Tg,b)},Vg.html=function(a,b){return rb(a,"text/html",Ug,b)},Vg.xml=qb(function(a){return a.responseXML}),Vg}(),d3.tip=function(){function a(a){t=n(a),u=t.createSVGPoint(),document.body.appendChild(s)}function b(){return"n"}function c(){return[0,0]}function d(){return" "}function e(){var a=o();return{top:a.n.y-s.offsetHeight,left:a.n.x-s.offsetWidth/2}}function f(){var a=o();return{top:a.s.y,left:a.s.x-s.offsetWidth/2}}function g(){var a=o();return{top:a.e.y-s.offsetHeight/2,left:a.e.x}}function h(){var a=o();return{top:a.w.y-s.offsetHeight/2,left:a.w.x-s.offsetWidth}}function i(){var a=o();return{top:a.nw.y-s.offsetHeight,left:a.nw.x-s.offsetWidth}}function j(){var a=o();return{top:a.ne.y-s.offsetHeight,left:a.ne.x}}function k(){var a=o();return{top:a.sw.y,left:a.sw.x-s.offsetWidth}}function l(){var a=o();return{top:a.se.y,left:a.e.x}}function m(){var a=d3.select(document.createElement("div"));return a.style({position:"absolute",opacity:0,pointerEvents:"none",boxSizing:"border-box"}),a.node()}function n(a){return a=a.node(),"svg"==a.tagName.toLowerCase()?a:a.ownerSVGElement}function o(){var a=d3.event.target,b={},c=a.getScreenCTM(),d=a.getBBox(),e=d.width,f=d.height,g=d.x,h=d.y,i=document.documentElement.scrollTop||document.body.scrollTop,j=document.documentElement.scrollLeft||document.body.scrollLeft;return u.x=g+j,u.y=h+i,b.nw=u.matrixTransform(c),u.x+=e,b.ne=u.matrixTransform(c),u.y+=f,b.se=u.matrixTransform(c),u.x-=e,b.sw=u.matrixTransform(c),u.y-=f/2,b.w=u.matrixTransform(c),u.x+=e,b.e=u.matrixTransform(c),u.x-=e/2,u.y-=f/2,b.n=u.matrixTransform(c),u.y+=f,b.s=u.matrixTransform(c),b}var p=b,q=c,r=d,s=m(),t=null,u=null;a.show=function(){var b,c=r.apply(this,arguments),d=q.apply(this,arguments),e=p.apply(this,arguments),f=d3.select(s),g=0;for(f.html(c).style({opacity:1,"pointer-events":"all"});g--;)f.classed(w[g],!1);return b=v.get(e).apply(this),f.classed(e,!0).style({top:b.top+d[0]+"px",left:b.left+d[1]+"px"}),a},a.hide=function(){return nodel=d3.select(s),nodel.style({opacity:0,"pointer-events":"none"}),a},a.attr=function(b){if(arguments.length<2&&"string"==typeof b)return d3.select(s).attr(b);var c=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d3.select(s),c),a},a.style=function(b){if(arguments.length<2&&"string"==typeof b)return d3.select(s).style(b);var c=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d3.select(s),c),a},a.direction=function(b){return arguments.length?(p=null==b?b:d3.functor(b),a):p},a.offset=function(b){return arguments.length?(q=null==b?b:d3.functor(b),a):q},a.html=function(b){return arguments.length?(r=null==b?b:d3.functor(b),a):r};var v=d3.map({n:e,s:f,e:g,w:h,nw:i,ne:j,sw:k,se:l}),w=v.keys();return a},function(){function a(a,b,c){for(var d=(c||0)-1,e=a?a.length:0;++d-1?0:-1:b?0:-1}function c(a){var b=this.cache,c=typeof a;if("boolean"==c||null==a)b[a]=!0;else{"number"!=c&&"string"!=c&&(c="object");var d="number"==c?a:r+a,e=b[c]||(b[c]={});"object"==c?(e[d]||(e[d]=[])).push(a):e[d]=!0}}function d(a){return a.charCodeAt(0)}function e(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||"undefined"==typeof c)return 1;if(d>c||"undefined"==typeof d)return-1}return a.index-b.index}function f(a){var b=-1,d=a.length,e=a[0],f=a[d/2|0],g=a[d-1];if(e&&"object"==typeof e&&f&&"object"==typeof f&&g&&"object"==typeof g)return!1;var h=i();h["false"]=h["null"]=h["true"]=h.undefined=!1;var j=i();for(j.array=a,j.cache=h,j.push=c;++be?0:e);++d=s&&g===a,j=[];if(i){var l=f(d);l?(g=b,d=l):i=!1}for(;++e-1:void 0}),s&&(j(e),j(f)),g}function eb(a,b,c,d,e){(Yd(b)?Yb:ge)(b,function(b,f){var g,h,i=b,j=a[f];if(b&&((h=Yd(b))||he(b))){for(var k=d.length;k--;)if(g=d[k]==b){j=e[k];break}if(!g){var l;c&&(i=c(j,b),(l="undefined"!=typeof i)&&(j=i)),l||(j=h?Yd(j)?j:[]:he(j)?j:{}),d.push(b),e.push(j),l||eb(j,b,c,d,e)}}else c&&(i=c(j,b),"undefined"==typeof i&&(i=b)),"undefined"!=typeof i&&(j=i);a[f]=j})}function fb(a,b){return a+Cd(Ud()*(b-a+1))}function gb(c,d,e){var g=-1,i=kb(),l=c?c.length:0,m=[],n=!d&&l>=s&&i===a,o=e||n?h():m;if(n){var p=f(o);p?(i=b,o=p):(n=!1,o=e?o:(j(o),m))}for(;++g3&&"function"==typeof b[c-2])var d=Y(b[--c-1],b[c--],2);else c>2&&"function"==typeof b[c-1]&&(d=b[--c]);for(var e=l(arguments,1,c),f=-1,g=h(),i=h();++fc?Rd(0,f+c):c)||0,Yd(a)?g=e(a,b,c)>-1:"number"==typeof f?g=(Kb(a)?a.indexOf(b,c):e(a,b,c))>-1:ge(a,function(a){return++d>=c?!(g=a===b):void 0}),g}function Ub(a,b,c){var d=!0;b=o.createCallback(b,c,3);var e=-1,f=a?a.length:0;if("number"==typeof f)for(;++ef&&(f=i)}else b=null==b&&Kb(a)?d:o.createCallback(b,c,3),Yb(a,function(a,c,d){var g=b(a,c,d);g>e&&(e=g,f=a)});return f}function bc(a,b,c){var e=1/0,f=e;if("function"!=typeof b&&c&&c[b]===a&&(b=null),null==b&&Yd(a))for(var g=-1,h=a.length;++gi&&(f=i)}else b=null==b&&Kb(a)?d:o.createCallback(b,c,3),Yb(a,function(a,c,d){var g=b(a,c,d);e>g&&(e=g,f=a)});return f}function cc(a,b){var c=-1,d=a?a.length:0;if("number"==typeof d)for(var e=ld(d);++cd?Rd(0,e+d):d||0}else if(d){var f=Bc(b,c);return b[f]===c?f:-1}return a(b,c,d)}function tc(a,b,c){var d=0,e=a?a.length:0;if("number"!=typeof b&&null!=b){var f=e;for(b=o.createCallback(b,c,3);f--&&b(a[f],f,a);)d++}else d=null==b||c?1:b||d;return l(a,0,Sd(Rd(0,e-d),e))}function uc(c){for(var d=arguments,e=d.length,g=-1,i=h(),l=-1,m=kb(),n=c?c.length:0,o=[],p=h();++g=s&&f(g?d[g]:p)}a:for(;++lc?Rd(0,d+c):Sd(c,d-1))+1);d--;)if(a[d]===b)return d;return-1}function xc(a){for(var b=arguments,c=0,d=b.length,e=a?a.length:0;++ce;){var g=e+f>>>1;c(a[g])1?arguments:arguments[0],b=-1,c=a?ac(cc(a,"length")):0,d=ld(0>c?0:c);++b2?ib(a,17,l(arguments,2),null,b):ib(a,1,null,null,b)}function Jc(a){for(var b=arguments.length>1?cb(arguments,!0,!1,1):vb(a),c=-1,d=b.length;++c2?ib(b,19,l(arguments,2),null,a):ib(b,3,null,null,a)}function Lc(){for(var a=arguments,b=a.length;b--;)if(!Eb(a[b]))throw new ud;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}}function Mc(a,b,c){var d=typeof a;if(null==a||"function"==d)return Y(a,b,c);if("object"!=d)return function(b){return b[a]};var e=$d(a),f=e[0],g=a[f];return 1!=e.length||g!==g||Fb(g)?function(b){for(var c=e.length,d=!1;c--&&(d=db(b[e[c]],a[e[c]],null,!0)););return d}:function(a){var b=a[f];return g===b&&(0!==g||1/g==1/b)}}function Nc(a,b){return b="number"==typeof b?b:+b||a.length,ib(a,4,null,null,null,b)}function Oc(a,b,c){var d,e,f,g,h,i,j,k=0,l=!1,m=!0;if(!Eb(a))throw new ud;if(b=Rd(0,b)||0,c===!0){var o=!0;m=!1}else Fb(c)&&(o=c.leading,l="maxWait"in c&&(Rd(b,c.maxWait)||0),m="trailing"in c?c.trailing:m);var p=function(){var c=b-(Gd()-g);if(0>=c){e&&Bd(e);var l=j;e=i=j=n,l&&(k=Gd(),f=a.apply(h,d),i||e||(d=h=null))}else i=Id(p,c)},q=function(){i&&Bd(i),e=i=j=n,(m||l!==b)&&(k=Gd(),f=a.apply(h,d),i||e||(d=h=null))};return function(){if(d=arguments,g=Gd(),h=this,j=m&&(i||!o),l===!1)var c=o&&!i;else{e||o||(k=g);var n=l-(g-k),r=0>=n;r?(e&&(e=Bd(e)),k=g,f=a.apply(h,d)):e||(e=Id(q,n))}return r&&i?i=Bd(i):i||b===l||(i=Id(p,b)),c&&(r=!0,f=a.apply(h,d)),!r||i||e||(d=h=null),f}}function Pc(a){if(!Eb(a))throw new ud;var b=l(arguments,1);return Id(function(){a.apply(n,b)},1)}function Qc(a,b){if(!Eb(a))throw new ud;var c=l(arguments,2);return Id(function(){a.apply(n,c)},b)}function Rc(a,b){if(!Eb(a))throw new ud;var c=function(){var d=c.cache,e=b?b.apply(this,arguments):r+arguments[0];return Fd.call(d,e)?d[e]:d[e]=a.apply(this,arguments)};return c.cache={},c}function Sc(a){var b,c;if(!Eb(a))throw new ud;return function(){return b?c:(b=!0,c=a.apply(this,arguments),a=null,c)}}function Tc(a){return ib(a,16,l(arguments,1))}function Uc(a){return ib(a,32,null,l(arguments,1))}function Vc(a,b,c){var d=!0,e=!0;if(!Eb(a))throw new ud;return c===!1?d=!1:Fb(c)&&(d="leading"in c?c.leading:d,e="trailing"in c?c.trailing:e),S.leading=d,S.maxWait=b,S.trailing=e,Oc(a,b,S)}function Wc(a,b){return ib(b,16,[a])}function Xc(a){return null==a?"":td(a).replace(ce,jb)}function Yc(a){return a}function Zc(a,b){var c=a,d=!b||Eb(c);b||(c=p,b=a,a=o),Yb(vb(b),function(e){var f=a[e]=b[e];d&&(c.prototype[e]=function(){var b=this.__wrapped__,d=[b];Hd.apply(d,arguments);var e=f.apply(a,d);return b&&"object"==typeof b&&b===e?this:(e=new c(e),e.__chain__=this.__chain__,e)})})}function $c(){return c._=xd,this}function _c(){}function ad(a,b,c){var d=null==a,e=null==b;if(null==c&&("boolean"==typeof a&&e?(c=a,a=1):e||"boolean"!=typeof b||(c=b,e=!0)),d&&e&&(b=1),a=+a||0,e?(b=a,a=0):b=+b||0,c||a%1||b%1){var f=Ud();return Sd(a+f*(b-a+parseFloat("1e-"+((f+"").length-1))),b)}return fb(a,b)}function bd(a,b){if(a){var c=a[b];return Eb(c)?a[b]():c}}function cd(a,b,c){var d=o.templateSettings;a=td(a||""),c=ee({},c,d);var e,f=ee({},c.imports,d.imports),h=$d(f),i=Rb(f),j=0,k=c.interpolate||D,l="__p += '",m=sd((c.escape||D).source+"|"+k.source+"|"+(k===B?y:D).source+"|"+(c.evaluate||D).source+"|$","g");a.replace(m,function(b,c,d,f,h,i){return d||(d=f),l+=a.slice(j,i).replace(F,g),c&&(l+="' +\n__e("+c+") +\n'"),h&&(e=!0,l+="';\n"+h+";\n__p += '"),d&&(l+="' +\n((__t = ("+d+")) == null ? '' : __t) +\n'"),j=i+b.length,b}),l+="';\n";var p=c.variable,q=p;q||(p="obj",l="with ("+p+") {\n"+l+"\n}\n"),l=(e?l.replace(v,""):l).replace(w,"$1").replace(x,"$1;"),l="function("+p+") {\n"+(q?"":p+" || ("+p+" = {});\n")+"var __t, __p = '', __e = _.escape"+(e?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var r="\n/*\n//# sourceURL="+(c.sourceURL||"/lodash/template/source["+H++ +"]")+"\n*/";try{var s=od(h,"return "+l+r).apply(n,i)}catch(t){throw t.source=l,t}return b?s(b):(s.source=l,s)}function dd(a,b,c){a=(a=+a)>-1?a:0;var d=-1,e=ld(a);for(b=Y(b,c,1);++d/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:B,variable:"",imports:{_:o}},Md||(X=function(){function a(){}return function(b){if(Fb(b)){a.prototype=b;var d=new a;a.prototype=null}return d||c.Object()}}());var Xd=Ld?function(a,b){T.value=b,Ld(a,"__bindData__",T)}:_c,Yd=Nd||function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&yd.call(a)==J||!1},Zd=function(a){var b,c=a,d=[];if(!c)return d;if(!U[typeof a])return d;for(b in c)Fd.call(c,b)&&d.push(b);return d},$d=Qd?function(a){return Fb(a)?Qd(a):[]}:Zd,_d={"&":"&","<":"<",">":">",'"':""","'":"'"},ae=xb(_d),be=sd("("+$d(ae).join("|")+")","g"),ce=sd("["+$d(_d).join("")+"]","g"),de=function(a,b,c){var d,e=a,f=e;if(!e)return f;var g=arguments,h=0,i="number"==typeof c?2:g.length;if(i>3&&"function"==typeof g[i-2])var j=Y(g[--i-1],g[i--],2);else i>2&&"function"==typeof g[i-1]&&(j=g[--i]);for(;++h/g,C=RegExp("^["+u+"]*0+(?=.$)"),D=/($^)/,E=/\bthis\b/,F=/['\n\r\t\u2028\u2029\\]/g,G=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setImmediate","setTimeout"],H=0,I="[object Arguments]",J="[object Array]",K="[object Boolean]",L="[object Date]",M="[object Function]",N="[object Number]",O="[object Object]",P="[object RegExp]",Q="[object String]",R={};R[M]=!1,R[I]=R[J]=R[K]=R[L]=R[N]=R[O]=R[P]=R[Q]=!0;var S={leading:!1,maxWait:0,trailing:!1},T={configurable:!1,enumerable:!1,value:null,writable:!1},U={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},V={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},W=U[typeof window]&&window||this,X=U[typeof exports]&&exports&&!exports.nodeType&&exports,Y=U[typeof module]&&module&&!module.nodeType&&module,Z=Y&&Y.exports===X&&X,$=U[typeof global]&&global;!$||$.global!==$&&$.window!==$||(W=$);var _=m();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(W._=_,define(function(){return _})):X&&Y?Z?(Y.exports=_)._=_:X._=_:W._=_}.call(this),function(){function a(a){this.tokens=[],this.tokens.links={},this.options=a||h.defaults,this.rules=i.normal,this.options.gfm&&(this.rules=this.options.tables?i.tables:i.gfm)}function b(a,b){if(this.options=b||h.defaults,this.links=a,this.rules=j.normal,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?j.breaks:j.gfm:this.options.pedantic&&(this.rules=j.pedantic)}function c(a){this.tokens=[],this.token=null,this.options=a||h.defaults}function d(a,b){return a.replace(b?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function e(a,b){return a=a.source,b=b||"",function c(d,e){return d?(e=e.source||e,e=e.replace(/(^|[^\[])\^/g,"$1"),a=a.replace(d,e),c):new RegExp(a,b)}}function f(){}function g(a){for(var b,c,d=1;dAn error occured:

"+d(m.message+"",!0)+"
";throw m}}var i={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:f,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};i.bullet=/(?:[*+-]|\d+\.)/,i.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,i.item=e(i.item,"gm")(/bull/g,i.bullet)(),i.list=e(i.list)(/bull/g,i.bullet)("hr",/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)(),i._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b",i.html=e(i.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,i._tag)(),i.paragraph=e(i.paragraph)("hr",i.hr)("heading",i.heading)("lheading",i.lheading)("blockquote",i.blockquote)("tag","<"+i._tag)("def",i.def)(),i.normal=g({},i),i.gfm=g({},i.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/}),i.gfm.paragraph=e(i.paragraph)("(?!","(?!"+i.gfm.fences.source.replace("\\1","\\2")+"|"+i.list.source.replace("\\1","\\3")+"|")(),i.tables=g({},i.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),a.rules=i,a.lex=function(b,c){var d=new a(c);return d.lex(b)},a.prototype.lex=function(a){return a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(a,!0)},a.prototype.token=function(a,b){for(var c,d,e,f,g,h,j,k,l,a=a.replace(/^ +$/gm,"");a;)if((e=this.rules.newline.exec(a))&&(a=a.substring(e[0].length),e[0].length>1&&this.tokens.push({type:"space"})),e=this.rules.code.exec(a))a=a.substring(e[0].length),e=e[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?e:e.replace(/\n+$/,"")});else if(e=this.rules.fences.exec(a))a=a.substring(e[0].length),this.tokens.push({type:"code",lang:e[2],text:e[3]});else if(e=this.rules.heading.exec(a))a=a.substring(e[0].length),this.tokens.push({type:"heading",depth:e[1].length,text:e[2]});else if(b&&(e=this.rules.nptable.exec(a))){for(a=a.substring(e[0].length),h={type:"table",header:e[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3].replace(/\n$/,"").split("\n")},k=0;k ?/gm,""),this.token(e,b),this.tokens.push({type:"blockquote_end"});else if(e=this.rules.list.exec(a)){for(a=a.substring(e[0].length),f=e[2],this.tokens.push({type:"list_start",ordered:f.length>1}),e=e[0].match(this.rules.item),c=!1,l=e.length,k=0;l>k;k++)h=e[k],j=h.length,h=h.replace(/^ *([*+-]|\d+\.) +/,""),~h.indexOf("\n ")&&(j-=h.length,h=this.options.pedantic?h.replace(/^ {1,4}/gm,""):h.replace(new RegExp("^ {1,"+j+"}","gm"),"")),this.options.smartLists&&k!==l-1&&(g=i.bullet.exec(e[k+1])[0],f===g||f.length>1&&g.length>1||(a=e.slice(k+1).join("\n")+a,k=l-1)),d=c||/\n\n(?!\s*$)/.test(h),k!==l-1&&(c="\n"===h.charAt(h.length-1),d||(d=c)),this.tokens.push({type:d?"loose_item_start":"list_item_start"}),this.token(h,!1),this.tokens.push({type:"list_item_end"}); -this.tokens.push({type:"list_end"})}else if(e=this.rules.html.exec(a))a=a.substring(e[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]});else if(b&&(e=this.rules.def.exec(a)))a=a.substring(e[0].length),this.tokens.links[e[1].toLowerCase()]={href:e[2],title:e[3]};else if(b&&(e=this.rules.table.exec(a))){for(a=a.substring(e[0].length),h={type:"table",header:e[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3].replace(/(?: *\| *)?\n$/,"").split("\n")},k=0;k])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:f,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,j.link=e(j.link)("inside",j._inside)("href",j._href)(),j.reflink=e(j.reflink)("inside",j._inside)(),j.normal=g({},j),j.pedantic=g({},j.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),j.gfm=g({},j.normal,{escape:e(j.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:e(j.text)("]|","~]|")("|","|https?://|")()}),j.breaks=g({},j.gfm,{br:e(j.br)("{2,}","*")(),text:e(j.gfm.text)("{2,}","*")()}),b.rules=j,b.output=function(a,c,d){var e=new b(c,d);return e.output(a)},b.prototype.output=function(a){for(var b,c,e,f,g="";a;)if(f=this.rules.escape.exec(a))a=a.substring(f[0].length),g+=f[1];else if(f=this.rules.autolink.exec(a))a=a.substring(f[0].length),"@"===f[2]?(c=":"===f[1].charAt(6)?this.mangle(f[1].substring(7)):this.mangle(f[1]),e=this.mangle("mailto:")+c):(c=d(f[1]),e=c),g+=''+c+"";else if(f=this.rules.url.exec(a))a=a.substring(f[0].length),c=d(f[1]),e=c,g+=''+c+"";else if(f=this.rules.tag.exec(a))a=a.substring(f[0].length),g+=this.options.sanitize?d(f[0]):f[0];else if(f=this.rules.link.exec(a))a=a.substring(f[0].length),g+=this.outputLink(f,{href:f[2],title:f[3]});else if((f=this.rules.reflink.exec(a))||(f=this.rules.nolink.exec(a))){if(a=a.substring(f[0].length),b=(f[2]||f[1]).replace(/\s+/g," "),b=this.links[b.toLowerCase()],!b||!b.href){g+=f[0].charAt(0),a=f[0].substring(1)+a;continue}g+=this.outputLink(f,b)}else if(f=this.rules.strong.exec(a))a=a.substring(f[0].length),g+=""+this.output(f[2]||f[1])+"";else if(f=this.rules.em.exec(a))a=a.substring(f[0].length),g+=""+this.output(f[2]||f[1])+"";else if(f=this.rules.code.exec(a))a=a.substring(f[0].length),g+=""+d(f[2],!0)+"";else if(f=this.rules.br.exec(a))a=a.substring(f[0].length),g+="
";else if(f=this.rules.del.exec(a))a=a.substring(f[0].length),g+=""+this.output(f[1])+"";else if(f=this.rules.text.exec(a))a=a.substring(f[0].length),g+=d(this.smartypants(f[0]));else if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0));return g},b.prototype.outputLink=function(a,b){return"!"!==a[0].charAt(0)?'"+this.output(a[1])+"":''+d(a[1])+'"},b.prototype.smartypants=function(a){return this.options.smartypants?a.replace(/--/g,"โ€”").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1โ€˜").replace(/'/g,"โ€™").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1โ€œ").replace(/"/g,"โ€").replace(/\.{3}/g,"โ€ฆ"):a},b.prototype.mangle=function(a){for(var b,c="",d=a.length,e=0;d>e;e++)b=a.charCodeAt(e),Math.random()>.5&&(b="x"+b.toString(16)),c+="&#"+b+";";return c},c.parse=function(a,b){var d=new c(b);return d.parse(a)},c.prototype.parse=function(a){this.inline=new b(a.links,this.options),this.tokens=a.reverse();for(var c="";this.next();)c+=this.tok();return c},c.prototype.next=function(){return this.token=this.tokens.pop()},c.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},c.prototype.parseText=function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;return this.inline.output(a)},c.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return"
\n";case"heading":return"'+this.inline.output(this.token.text)+"\n";case"code":if(this.options.highlight){var a=this.options.highlight(this.token.text,this.token.lang);null!=a&&a!==this.token.text&&(this.token.escaped=!0,this.token.text=a)}return this.token.escaped||(this.token.text=d(this.token.text,!0)),"
"+this.token.text+"
\n";case"table":var b,c,e,f,g,h="";for(h+="\n\n",c=0;c\n";for(h+="\n\n",h+="\n",c=0;c\n",g=0;g\n";h+="\n"}return h+="\n","\n"+h+"
\n";case"blockquote_start":for(var h="";"blockquote_end"!==this.next().type;)h+=this.tok();return"
\n"+h+"
\n";case"list_start":for(var i=this.token.ordered?"ol":"ul",h="";"list_end"!==this.next().type;)h+=this.tok();return"<"+i+">\n"+h+"\n";case"list_item_start":for(var h="";"list_item_end"!==this.next().type;)h+="text"===this.token.type?this.parseText():this.tok();return"
  • "+h+"
  • \n";case"loose_item_start":for(var h="";"list_item_end"!==this.next().type;)h+=this.tok();return"
  • "+h+"
  • \n";case"html":return this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);case"paragraph":return"

    "+this.inline.output(this.token.text)+"

    \n";case"text":return"

    "+this.parseText()+"

    \n"}},f.exec=f,h.options=h.setOptions=function(a){return g(h.defaults,a),h},h.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1},h.Parser=c,h.parser=c.parse,h.Lexer=a,h.lexer=a.lex,h.InlineLexer=b,h.inlineLexer=b.output,h.parse=h,"object"==typeof exports?module.exports=h:"function"==typeof define&&define.amd?define(function(){return h}):this.marked=h}.call(function(){return this||("undefined"!=typeof window?window:global)}()),function(){function a(b,c,d){var e=a.resolve(b);if(null==e){d=d||b,c=c||"root";var f=new Error('Failed to require "'+d+'" from "'+c+'"');throw f.path=d,f.parent=c,f.require=!0,f}var g=a.modules[e];return g.exports||(g.exports={},g.client=g.component=!0,g.call(this,g.exports,a.relative(e),g)),g.exports}a.modules={},a.aliases={},a.resolve=function(b){"/"===b.charAt(0)&&(b=b.slice(1));for(var c=b+"/index.js",d=[b,b+".js",b+".json",b+"/index.js",b+"/index.json"],e=0;ed;++d)c[d].apply(this,b)}return this},d.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},d.prototype.hasListeners=function(a){return!!this.listeners(a).length}}),a.register("RedVentures-reduce/index.js",function(a,b,c){c.exports=function(a,b,c){for(var d=0,e=a.length,f=3==arguments.length?c:a[d++];e>d;)f=b.call(null,f,a[d],++d,a);return f}}),a.register("superagent/lib/client.js",function(a,b,c){function d(){}function e(a){var b={}.toString.call(a);switch(b){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function f(){if(r.XMLHttpRequest&&("file:"!=r.location.protocol||!r.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){}return!1}function g(a){return a===Object(a)}function h(a){if(!g(a))return a;var b=[];for(var c in a)b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")}function i(a){for(var b,c,d={},e=a.split("&"),f=0,g=e.length;g>f;++f)c=e[f],b=c.split("="),d[decodeURIComponent(b[0])]=decodeURIComponent(b[1]);return d}function j(a){var b,c,d,e,f=a.split(/\r?\n/),g={};f.pop();for(var h=0,i=f.length;i>h;++h)c=f[h],b=c.indexOf(":"),d=c.slice(0,b).toLowerCase(),e=s(c.slice(b+1)),g[d]=e;return g}function k(a){return a.split(/ *; */).shift()}function l(a){return q(a.split(/ *; */),function(a,b){var c=b.split(/ *= */),d=c.shift(),e=c.shift();return d&&e&&(a[d]=e),a},{})}function m(a,b){b=b||{},this.xhr=a,this.text=a.responseText,this.setStatusProperties(a.status),this.header=this.headers=j(a.getAllResponseHeaders()),this.header["content-type"]=a.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body=this.parseBody(this.text)}function n(a,b){var c=this;p.call(this),this._query=this._query||[],this.method=a,this.url=b,this.header={},this._header={},this.set("X-Requested-With","XMLHttpRequest"),this.on("end",function(){var b=new m(c.xhr);"HEAD"==a&&(b.text=null),c.callback(null,b)})}function o(a,b){return"function"==typeof b?new n("GET",a).end(b):1==arguments.length?new n("GET",a):new n(a,b)}var p=b("emitter"),q=b("reduce"),r="undefined"==typeof window?this:window,s="".trim?function(a){return a.trim()}:function(a){return a.replace(/(^\s*|\s*$)/g,"")};o.serializeObject=h,o.parseString=i,o.types={html:"text/html",json:"application/json",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},o.serialize={"application/x-www-form-urlencoded":h,"application/json":JSON.stringify},o.parse={"application/x-www-form-urlencoded":i,"application/json":JSON.parse},m.prototype.get=function(a){return this.header[a.toLowerCase()]},m.prototype.setHeaderProperties=function(){var a=this.header["content-type"]||"";this.type=k(a);var b=l(a);for(var c in b)this[c]=b[c]},m.prototype.parseBody=function(a){var b=o.parse[this.type];return b?b(a):null},m.prototype.setStatusProperties=function(a){var b=a/100|0;this.status=a,this.statusType=b,this.info=1==b,this.ok=2==b,this.clientError=4==b,this.serverError=5==b,this.error=4==b||5==b?this.toError():!1,this.accepted=202==a,this.noContent=204==a||1223==a,this.badRequest=400==a,this.unauthorized=401==a,this.notAcceptable=406==a,this.notFound=404==a,this.forbidden=403==a},m.prototype.toError=function(){var a="got "+this.status+" response",b=new Error(a);return b.status=this.status,b},o.Response=m,n.prototype=new p,n.prototype.constructor=n,n.prototype.timeout=function(a){return this._timeout=a,this},n.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},n.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},n.prototype.set=function(a,b){if(g(a)){for(var c in a)this.set(c,a[c]);return this}return this._header[a.toLowerCase()]=b,this.header[a]=b,this},n.prototype.getHeader=function(a){return this._header[a.toLowerCase()]},n.prototype.type=function(a){return this.set("Content-Type",o.types[a]||a),this},n.prototype.auth=function(a,b){var c=btoa(a+":"+b);return this.set("Authorization","Basic "+c),this},n.prototype.query=function(a){return"string"!=typeof a&&(a=h(a)),a&&this._query.push(a),this},n.prototype.send=function(a){var b=g(a),c=this.getHeader("Content-Type");if(b&&g(this._data))for(var d in a)this._data[d]=a[d];else"string"==typeof a?(c||this.type("form"),c=this.getHeader("Content-Type"),this._data="application/x-www-form-urlencoded"==c?this._data?this._data+"&"+a:a:(this._data||"")+a):this._data=a;return b?(c||this.type("json"),this):this},n.prototype.callback=function(a,b){var c=this._callback;return 2==c.length?c(a,b):a?this.emit("error",a):(c(b),void 0)},n.prototype.crossDomainError=function(){var a=new Error("Origin is not allowed by Access-Control-Allow-Origin");a.crossDomain=!0,this.callback(a)},n.prototype.timeoutError=function(){var a=this._timeout,b=new Error("timeout of "+a+"ms exceeded");b.timeout=a,this.callback(b)},n.prototype.withCredentials=function(){return this._withCredentials=!0,this},n.prototype.end=function(a){var b=this,c=this.xhr=f(),g=this._query.join("&"),h=this._timeout,i=this._data;if(this._callback=a||d,this._withCredentials&&(c.withCredentials=!0),c.onreadystatechange=function(){return 4==c.readyState?0==c.status?b.aborted?b.timeoutError():b.crossDomainError():(b.emit("end"),void 0):void 0},c.upload&&(c.upload.onprogress=function(a){a.percent=a.loaded/a.total*100,b.emit("progress",a)}),h&&!this._timer&&(this._timer=setTimeout(function(){b.abort()},h)),g&&(g=o.serializeObject(g),this.url+=~this.url.indexOf("?")?"&"+g:"?"+g),c.open(this.method,this.url,!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof i&&!e(i)){var j=o.serialize[this.getHeader("Content-Type")];j&&(i=j(i))}for(var k in this.header)null!=this.header[k]&&c.setRequestHeader(k,this.header[k]);return c.send(i),this},o.Request=n,o.get=function(a,b,c){var d=o("GET",a);return"function"==typeof b&&(c=b,b=null),b&&d.query(b),c&&d.end(c),d},o.head=function(a,b,c){var d=o("HEAD",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},o.del=function(a,b){var c=o("DELETE",a);return b&&c.end(b),c},o.patch=function(a,b,c){var d=o("PATCH",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},o.post=function(a,b,c){var d=o("POST",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},o.put=function(a,b,c){var d=o("PUT",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},c.exports=o}),a.alias("component-emitter/index.js","superagent/deps/emitter/index.js"),a.alias("component-emitter/index.js","emitter/index.js"),a.alias("component-indexof/index.js","component-emitter/deps/indexof/index.js"),a.alias("RedVentures-reduce/index.js","superagent/deps/reduce/index.js"),a.alias("RedVentures-reduce/index.js","reduce/index.js"),a.alias("superagent/lib/client.js","superagent/index.js"),"object"==typeof exports?module.exports=a("superagent"):"function"==typeof define&&define.amd?define(function(){return a("superagent")}):this.superagent=a("superagent")}(),function(){var a=function(b,c,d){var e=a.resolve(b);if(null===e){d=d||b,c=c||"root";var f=new Error('Failed to require "'+d+'" from "'+c+'"');throw f.path=d,f.parent=c,f.require=!0,f}var g=a.modules[e];if(!g._resolving&&!g.exports){var h={};h.exports={},h.client=h.component=!0,g._resolving=!0,g.call(this,h.exports,a.relative(e),h),delete g._resolving,g.exports=h.exports}return g.exports};a.modules={},a.aliases={},a.resolve=function(b){"/"===b.charAt(0)&&(b=b.slice(1));for(var c=[b,b+".js",b+".json",b+"/index.js",b+"/index.json"],d=0;db;b++)if(b in this&&this[b]===a)return b;return-1};k=b("./require")._,h=b("./request"),g=b("./regex"),d=null,j=!1,f=[],e={host:"api.github.com",protocol:"https"},i={host:function(a){return k.isString(a)},protocol:function(a){return k.isString(a)&&a.match(/^http(s?)$/)},token:function(a){return k.isString(a)},off_days:function(a){var b,c,d;if(!k.isArray(a))return!1;for(c=0,d=a.length;d>c;c++)if(b=a[c],l.call([1,2,3,4,5,6,7],b)<0)return!1;return!0}},c.exports=function(a){return"undefined"==typeof window&&(d=null),d?a(null,d):(f.push(a),j?void 0:(j=!0,h.config(function(b,c){var h,l,m;j=!1,d=k.defaults(c||{},e),d.size_label=d.size_label?new RegExp(d.size_label):g.size_label;for(h in i)if(l=i[h],d[h]&&!l(d[h]))return a("Config field `"+h+"` misconfigured");for(m=[];f.length;)m.push(f.pop()(null,d));return m})))}}),b.require.register("ghbc/src/modules/graph.js",function(a,b,c){var d,e,f,g,h=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};g=b("./require"),f=g._,d=g.d3,e=b("./regex"),c.exports={actual:function(a,b,c,e){var g,h,i,j,k;return g=[{date:new Date(b),points:c}],i=+1/0,h=-1/0,k=f.map(a,function(a){var b,d;return d=a.size,b=a.closed_at,i>d&&(i=d),d>h&&(h=d),f.extend({},a,{date:new Date(b),points:c-=d})}),j=d.scale.linear().domain([i,h]).range([5,8]),k=f.map(k,function(a){return a.radius=j(a.size),a}),e(null,[].concat(g,k))},ideal:function(a,b,c,d,g){var i,j,k,l,m,n,o,p,q,r,s;return a>b&&(r=[a,b],b=r[0],a=r[1]),s=f.map(a.match(e.datetime)[1].split("-"),function(a){return parseInt(a)}),q=s[0],m=s[1],j=s[2],i=new Date(b),k=[],l=0,(o=function(a){var b,d;return b=new Date(q,m-1,j+a),(d=b.getDay())||(d=7),h.call(c,d)>=0?k.push({date:b,off_day:!0}):(l+=1,k.push({date:b})),b>i?void 0:o(a+1)})(0),p=d/(l-1),k=f.map(k,function(a,b){return a.points=d,k[b]&&!k[b].off_day&&(d-=p),a}),(n=new Date)>i&&k.push({date:n,points:0}),g(null,k)},trendline:function(a,b,c){var d,e,g,h,i,j,k,l,m,n,o,p;return o=+a[0].date,p=f.map(a,function(a){var b,c;return b=a.date,c=a.points,[+b-o,c]}),m=a[a.length-1],p.push([+new Date-o,m.points]),g=0,i=0,h=0,d=(l=p.length)*f.reduce(p,function(a,b){var c,d;return c=b[0],d=b[1],g+=c,i+=d,h+=Math.pow(c,2),a+c*d},0),n=(d-g*i)/(l*h-Math.pow(g,2)),k=(i-n*g)/l,j=function(a){return n*a+k},b=new Date(b),c=c?new Date(c):new Date,d=b-o,e=c-o,[{date:b,points:j(d)},{date:c,points:j(e)}]},render:function(a,b){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;return c=a[0],f=a[1],m=a[2],document.querySelector("#svg").innerHTML="",s=document.querySelector("#graph").getBoundingClientRect(),e=s.height,n=s.width,j={top:30,right:30,bottom:40,left:50},n-=j.left+j.right,e-=j.top+j.bottom,o=d.time.scale().range([0,n]),q=d.scale.linear().range([e,0]),p=d.svg.axis().scale(o).orient("bottom").tickSize(-e).tickFormat(function(a){return a.getDate()}).tickPadding(10),r=d.svg.axis().scale(q).orient("left").tickSize(-n).ticks(5).tickPadding(10),g=d.svg.line().interpolate("linear").x(function(a){return o(a.date)}).y(function(a){return q(a.points)}),o.domain([f[0].date,f[f.length-1].date]),q.domain([0,f[0].points]).nice(),k=d.select("#svg").append("svg").attr("width",n+j.left+j.right).attr("height",e+j.top+j.bottom).append("g").attr("transform","translate("+j.left+","+j.top+")"),k.append("g").attr("class","x axis day").attr("transform","translate(0,"+e+")").call(p),h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=p.orient("top").tickSize(e).tickFormat(function(a){return h[a.getMonth()]}).ticks(2),k.append("g").attr("class","x axis month").attr("transform","translate(0,"+e+")").call(i),k.append("g").attr("class","y axis").call(r),k.append("svg:line").attr("class","today").attr("x1",o(new Date)).attr("y1",0).attr("x2",o(new Date)).attr("y2",e),k.append("path").attr("class","ideal line").attr("d",g.interpolate("basis")(f)),k.append("path").attr("class","trendline line").attr("d",g.interpolate("linear")(m)),k.append("path").attr("class","actual line").attr("d",g.interpolate("linear").y(function(a){return q(a.points)})(c)),l=d.tip().attr("class","d3-tip").html(function(a){var b,c;return b=a.number,c=a.title,"#"+b+": "+c}),k.call(l),k.selectAll("a.issue").data(c.slice(1)).enter().append("svg:a").attr("xlink:href",function(a){var b;return b=a.html_url}).attr("xlink:show","new").append("svg:circle").attr("cx",function(a){var b;return b=a.date,o(b)}).attr("cy",function(a){var b;return b=a.points,q(b)}).attr("r",function(a){var b;return b=a.radius,5}).on("mouseover",l.show).on("mouseout",l.hide),b(null)}}}),b.require.register("ghbc/src/modules/issues.js",function(a,b,c){var d,e,f,g,h;h=b("./require"),g=h._,d=h.async,f=b("./request"),e=b("./regex"),c.exports={get_all:function(a,b){var c;return c=function(b,c){var d,e;return e=[],(d=function(h){return f.all_issues(a,{milestone:a.milestone.number,state:b,page:h},function(a,b){return a?c(a):b.length?(e=e.concat(g.sortBy(b,"closed_at")),b.length<100?c(null,e):d(h+1)):c(null,e)})})(1)},d.parallel([g.partial(c,"open"),g.partial(c,"closed")],b)},filter:function(a,b,c){var d,e;return e=0,d=g.filter(a,function(a){var c;return(c=a.labels)?(a.size=g.reduce(c,function(a,c){var d;return(d=c.name.match(b))?a+=parseInt(d[1]):a},0),e+=a.size,!!a.size):!1}),c(null,d,e)}}}),b.require.register("ghbc/src/modules/milestones.js",function(a,b,c){var d,e,f,g;g=b("./require"),f=g._,d=g.marked,e=b("./request"),c.exports=function(a,b){var c;return c=function(a){return a.description&&(a.description=d(a.description).slice(3,-5)),a},a.milestone?e.one_milestone(a,a.milestone,function(a,d){return a?b(a):d.open_issues+d.closed_issues===0?b(null,"No issues for milestone `"+d.title+"`"):(d=c(d),b(null,null,d))}):e.all_milestones(a,function(d,e){var g;return d?b(d):e.length?(g=e[0],g=f.rest(e,{due_on:null}),g=g[0]?g[0]:e[0],g.open_issues+g.closed_issues===0?b(null,"No issues for milestone `"+g.title+"`"):(g=c(g),b(null,null,g))):b(null,"No open milestones for repo "+a.path)})}}),b.require.register("ghbc/src/modules/regex.js",function(a,b,c){c.exports={datetime:/^(\d{4}-\d{2}-\d{2})T(.*)/,size_label:/^size (\d+)$/,location:/^#!((\/[^\/]+){2,3})$/}}),b.require.register("ghbc/src/modules/render.js",function(a,b,c){c.exports=function(a,c,d){var e;return null==d&&(d={}),e=b("../templates/"+c),document.querySelector(a).innerHTML=e(d)}}),b.require.register("ghbc/src/modules/repo.js",function(a,b,c){var d,e,f,g,h,i,j,k;k=b("./require"),j=k._,d=k.async,g=b("./milestones"),f=b("./issues"),e=b("./graph"),h=b("./regex"),i=b("./render"),c.exports=function(a,b){return d.waterfall([function(b){return g(a,function(c,d,e){return c?b(c):d?b(d):(a.milestone=e,b(null))})},function(b){return f.get_all(a,b)},function(b,c){return d.map(b,function(b,c){return f.filter(b,a.size_label,function(a,b,d){return c(a,[b,d])})},function(b,d){var e,f;return f=d[0],e=d[1],b?c(b):f[1]+e[1]===0?c("No matching issues found"):(a.issues={closed:{points:e[1],data:e[0]},open:{points:f[1],data:f[0]}},c(null))})},function(b){var c,f;return c=100*a.issues.closed.points/(f=a.issues.open.points+a.issues.closed.points),d.parallel([j.partial(e.actual,a.issues.closed.data,a.milestone.created_at,f),j.partial(e.ideal,a.milestone.created_at,a.milestone.due_on,a.off_days||[],f)],function(d,f){var g;return i("body","graph",{repo:a.path,milestone:a.milestone}),i("#progress","progress",{progress:c}),f[0].length&&f.push(e.trendline(f[0],a.milestone.created_at,a.milestone.due_on)),(g=function(){return e.render(f,b)})(),"onresize"in window?window.onresize=g:void 0})}],b)}}),b.require.register("ghbc/src/modules/request.js",function(a,b,c){var d,e,f,g,h,i,j;j=b("./require"),h=j.superagent,i=j._,h.parse={"application/json":function(a){var b;try{return JSON.parse(a)}catch(c){return b=c,{}}}},c.exports={all_milestones:function(a,b){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/milestones",query:{state:"open",sort:"due_date",direction:"asc"},headers:e(a.token)},b)},one_milestone:function(a,b,c){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/milestones/"+b,query:{state:"open",sort:"due_date",direction:"asc"},headers:e(a.token)},c)},all_issues:function(a,b,c){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/issues",query:i.extend(b,{per_page:"100"}),headers:e(a.token)},c)},config:function(a){return f({protocol:"http",host:window.location.host,path:""+window.location.pathname+"config.json",headers:i.extend(e(),{Accept:"application/json"})},a)}},f=function(a,b){var c,d,e,f,i,j,k,l,m,n,o;j=a.protocol,e=a.host,i=a.path,l=a.query,d=a.headers,c=!1,k=l?"?"+function(){var a;a=[];for(f in l)o=l[f],a.push(""+f+"="+o);return a}().join("&"):"",m=h.get(""+j+"://"+e+i+k);for(f in d)o=d[f],m.set(f,o);return n=setTimeout(function(){return c=!0,b("Request has timed out")},3e3),m.end(function(a,d){return c?void 0:(c=!0,clearTimeout(n),g(a,d,b))})},g=function(a,b,c){var e;return a?c(d(a)):2!==b.statusType?null!=(null!=b?null!=(e=b.body)?e.message:void 0:void 0)?c(b.body.message):c(b.error.message):c(null,b.body)},e=function(a){var b;return b=i.extend({},{"Content-Type":"application/json",Accept:"application/vnd.github.v3"}),null!=a&&(b.Authorization="token "+a),b},d=function(a){var b;switch(!1){case!i.isString(a):b=a;break;case!i.isArray(a):b=a[1];break;case!(i.isObject(a)&&i.isString(a.message)):b=a.message}if(!b)try{b=JSON.stringify(a)}catch(c){b=a.toString()}return b}}),b.require.register("ghbc/src/modules/require.js",function(a,b,c){c.exports={_:_,superagent:superagent,d3:d3,async:async,marked:marked}}),b.require.register("ghbc/src/templates/error.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    Trouble

    \n

    '),c.push(this.text),c.push("

    \n
    ")}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/graph.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    '),c.push(this.milestone.title),c.push("@"),c.push(this.repo),c.push("

    \n "),this.milestone.description&&(c.push('\n

    '),c.push(this.milestone.description),c.push("

    \n ")),c.push('\n
    \n
    \n
    \n
    \n
    \n
    ')}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/info.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    GitHub Burndown Chart

    \n

    Use your browser\'s location hash to specify a repo: #!/radekstepan/disposable.

    \n

    You can choose a specific milestone like so: #!/radekstepan/disposable/1.

    \n
    ')}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/label.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""") +this.tokens.push({type:"list_end"})}else if(e=this.rules.html.exec(a))a=a.substring(e[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]});else if(b&&(e=this.rules.def.exec(a)))a=a.substring(e[0].length),this.tokens.links[e[1].toLowerCase()]={href:e[2],title:e[3]};else if(b&&(e=this.rules.table.exec(a))){for(a=a.substring(e[0].length),h={type:"table",header:e[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3].replace(/(?: *\| *)?\n$/,"").split("\n")},k=0;k])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:f,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,j.link=e(j.link)("inside",j._inside)("href",j._href)(),j.reflink=e(j.reflink)("inside",j._inside)(),j.normal=g({},j),j.pedantic=g({},j.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),j.gfm=g({},j.normal,{escape:e(j.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:e(j.text)("]|","~]|")("|","|https?://|")()}),j.breaks=g({},j.gfm,{br:e(j.br)("{2,}","*")(),text:e(j.gfm.text)("{2,}","*")()}),b.rules=j,b.output=function(a,c,d){var e=new b(c,d);return e.output(a)},b.prototype.output=function(a){for(var b,c,e,f,g="";a;)if(f=this.rules.escape.exec(a))a=a.substring(f[0].length),g+=f[1];else if(f=this.rules.autolink.exec(a))a=a.substring(f[0].length),"@"===f[2]?(c=":"===f[1].charAt(6)?this.mangle(f[1].substring(7)):this.mangle(f[1]),e=this.mangle("mailto:")+c):(c=d(f[1]),e=c),g+=''+c+"";else if(f=this.rules.url.exec(a))a=a.substring(f[0].length),c=d(f[1]),e=c,g+=''+c+"";else if(f=this.rules.tag.exec(a))a=a.substring(f[0].length),g+=this.options.sanitize?d(f[0]):f[0];else if(f=this.rules.link.exec(a))a=a.substring(f[0].length),g+=this.outputLink(f,{href:f[2],title:f[3]});else if((f=this.rules.reflink.exec(a))||(f=this.rules.nolink.exec(a))){if(a=a.substring(f[0].length),b=(f[2]||f[1]).replace(/\s+/g," "),b=this.links[b.toLowerCase()],!b||!b.href){g+=f[0].charAt(0),a=f[0].substring(1)+a;continue}g+=this.outputLink(f,b)}else if(f=this.rules.strong.exec(a))a=a.substring(f[0].length),g+=""+this.output(f[2]||f[1])+"";else if(f=this.rules.em.exec(a))a=a.substring(f[0].length),g+=""+this.output(f[2]||f[1])+"";else if(f=this.rules.code.exec(a))a=a.substring(f[0].length),g+=""+d(f[2],!0)+"";else if(f=this.rules.br.exec(a))a=a.substring(f[0].length),g+="
    ";else if(f=this.rules.del.exec(a))a=a.substring(f[0].length),g+=""+this.output(f[1])+"";else if(f=this.rules.text.exec(a))a=a.substring(f[0].length),g+=d(this.smartypants(f[0]));else if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0));return g},b.prototype.outputLink=function(a,b){return"!"!==a[0].charAt(0)?'"+this.output(a[1])+"":''+d(a[1])+'"},b.prototype.smartypants=function(a){return this.options.smartypants?a.replace(/--/g,"โ€”").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1โ€˜").replace(/'/g,"โ€™").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1โ€œ").replace(/"/g,"โ€").replace(/\.{3}/g,"โ€ฆ"):a},b.prototype.mangle=function(a){for(var b,c="",d=a.length,e=0;d>e;e++)b=a.charCodeAt(e),Math.random()>.5&&(b="x"+b.toString(16)),c+="&#"+b+";";return c},c.parse=function(a,b){var d=new c(b);return d.parse(a)},c.prototype.parse=function(a){this.inline=new b(a.links,this.options),this.tokens=a.reverse();for(var c="";this.next();)c+=this.tok();return c},c.prototype.next=function(){return this.token=this.tokens.pop()},c.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},c.prototype.parseText=function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;return this.inline.output(a)},c.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return"
    \n";case"heading":return"'+this.inline.output(this.token.text)+"\n";case"code":if(this.options.highlight){var a=this.options.highlight(this.token.text,this.token.lang);null!=a&&a!==this.token.text&&(this.token.escaped=!0,this.token.text=a)}return this.token.escaped||(this.token.text=d(this.token.text,!0)),"
    "+this.token.text+"
    \n";case"table":var b,c,e,f,g,h="";for(h+="\n\n",c=0;c\n";for(h+="\n\n",h+="\n",c=0;c\n",g=0;g\n";h+="\n"}return h+="\n","\n"+h+"
    \n";case"blockquote_start":for(var h="";"blockquote_end"!==this.next().type;)h+=this.tok();return"
    \n"+h+"
    \n";case"list_start":for(var i=this.token.ordered?"ol":"ul",h="";"list_end"!==this.next().type;)h+=this.tok();return"<"+i+">\n"+h+"\n";case"list_item_start":for(var h="";"list_item_end"!==this.next().type;)h+="text"===this.token.type?this.parseText():this.tok();return"
  • "+h+"
  • \n";case"loose_item_start":for(var h="";"list_item_end"!==this.next().type;)h+=this.tok();return"
  • "+h+"
  • \n";case"html":return this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);case"paragraph":return"

    "+this.inline.output(this.token.text)+"

    \n";case"text":return"

    "+this.parseText()+"

    \n"}},f.exec=f,h.options=h.setOptions=function(a){return g(h.defaults,a),h},h.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1},h.Parser=c,h.parser=c.parse,h.Lexer=a,h.lexer=a.lex,h.InlineLexer=b,h.inlineLexer=b.output,h.parse=h,"object"==typeof exports?module.exports=h:"function"==typeof define&&define.amd?define(function(){return h}):this.marked=h}.call(function(){return this||("undefined"!=typeof window?window:global)}()),function(){function a(b,c,d){var e=a.resolve(b);if(null==e){d=d||b,c=c||"root";var f=new Error('Failed to require "'+d+'" from "'+c+'"');throw f.path=d,f.parent=c,f.require=!0,f}var g=a.modules[e];return g.exports||(g.exports={},g.client=g.component=!0,g.call(this,g.exports,a.relative(e),g)),g.exports}a.modules={},a.aliases={},a.resolve=function(b){"/"===b.charAt(0)&&(b=b.slice(1));for(var c=b+"/index.js",d=[b,b+".js",b+".json",b+"/index.js",b+"/index.json"],e=0;ed;++d)c[d].apply(this,b)}return this},d.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},d.prototype.hasListeners=function(a){return!!this.listeners(a).length}}),a.register("RedVentures-reduce/index.js",function(a,b,c){c.exports=function(a,b,c){for(var d=0,e=a.length,f=3==arguments.length?c:a[d++];e>d;)f=b.call(null,f,a[d],++d,a);return f}}),a.register("superagent/lib/client.js",function(a,b,c){function d(){}function e(a){var b={}.toString.call(a);switch(b){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function f(){if(r.XMLHttpRequest&&("file:"!=r.location.protocol||!r.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){}return!1}function g(a){return a===Object(a)}function h(a){if(!g(a))return a;var b=[];for(var c in a)b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")}function i(a){for(var b,c,d={},e=a.split("&"),f=0,g=e.length;g>f;++f)c=e[f],b=c.split("="),d[decodeURIComponent(b[0])]=decodeURIComponent(b[1]);return d}function j(a){var b,c,d,e,f=a.split(/\r?\n/),g={};f.pop();for(var h=0,i=f.length;i>h;++h)c=f[h],b=c.indexOf(":"),d=c.slice(0,b).toLowerCase(),e=s(c.slice(b+1)),g[d]=e;return g}function k(a){return a.split(/ *; */).shift()}function l(a){return q(a.split(/ *; */),function(a,b){var c=b.split(/ *= */),d=c.shift(),e=c.shift();return d&&e&&(a[d]=e),a},{})}function m(a,b){b=b||{},this.xhr=a,this.text=a.responseText,this.setStatusProperties(a.status),this.header=this.headers=j(a.getAllResponseHeaders()),this.header["content-type"]=a.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body=this.parseBody(this.text)}function n(a,b){var c=this;p.call(this),this._query=this._query||[],this.method=a,this.url=b,this.header={},this._header={},this.set("X-Requested-With","XMLHttpRequest"),this.on("end",function(){var b=new m(c.xhr);"HEAD"==a&&(b.text=null),c.callback(null,b)})}function o(a,b){return"function"==typeof b?new n("GET",a).end(b):1==arguments.length?new n("GET",a):new n(a,b)}var p=b("emitter"),q=b("reduce"),r="undefined"==typeof window?this:window,s="".trim?function(a){return a.trim()}:function(a){return a.replace(/(^\s*|\s*$)/g,"")};o.serializeObject=h,o.parseString=i,o.types={html:"text/html",json:"application/json",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},o.serialize={"application/x-www-form-urlencoded":h,"application/json":JSON.stringify},o.parse={"application/x-www-form-urlencoded":i,"application/json":JSON.parse},m.prototype.get=function(a){return this.header[a.toLowerCase()]},m.prototype.setHeaderProperties=function(){var a=this.header["content-type"]||"";this.type=k(a);var b=l(a);for(var c in b)this[c]=b[c]},m.prototype.parseBody=function(a){var b=o.parse[this.type];return b?b(a):null},m.prototype.setStatusProperties=function(a){var b=a/100|0;this.status=a,this.statusType=b,this.info=1==b,this.ok=2==b,this.clientError=4==b,this.serverError=5==b,this.error=4==b||5==b?this.toError():!1,this.accepted=202==a,this.noContent=204==a||1223==a,this.badRequest=400==a,this.unauthorized=401==a,this.notAcceptable=406==a,this.notFound=404==a,this.forbidden=403==a},m.prototype.toError=function(){var a="got "+this.status+" response",b=new Error(a);return b.status=this.status,b},o.Response=m,n.prototype=new p,n.prototype.constructor=n,n.prototype.timeout=function(a){return this._timeout=a,this},n.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},n.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},n.prototype.set=function(a,b){if(g(a)){for(var c in a)this.set(c,a[c]);return this}return this._header[a.toLowerCase()]=b,this.header[a]=b,this},n.prototype.getHeader=function(a){return this._header[a.toLowerCase()]},n.prototype.type=function(a){return this.set("Content-Type",o.types[a]||a),this},n.prototype.auth=function(a,b){var c=btoa(a+":"+b);return this.set("Authorization","Basic "+c),this},n.prototype.query=function(a){return"string"!=typeof a&&(a=h(a)),a&&this._query.push(a),this},n.prototype.send=function(a){var b=g(a),c=this.getHeader("Content-Type");if(b&&g(this._data))for(var d in a)this._data[d]=a[d];else"string"==typeof a?(c||this.type("form"),c=this.getHeader("Content-Type"),this._data="application/x-www-form-urlencoded"==c?this._data?this._data+"&"+a:a:(this._data||"")+a):this._data=a;return b?(c||this.type("json"),this):this},n.prototype.callback=function(a,b){var c=this._callback;return 2==c.length?c(a,b):a?this.emit("error",a):(c(b),void 0)},n.prototype.crossDomainError=function(){var a=new Error("Origin is not allowed by Access-Control-Allow-Origin");a.crossDomain=!0,this.callback(a)},n.prototype.timeoutError=function(){var a=this._timeout,b=new Error("timeout of "+a+"ms exceeded");b.timeout=a,this.callback(b)},n.prototype.withCredentials=function(){return this._withCredentials=!0,this},n.prototype.end=function(a){var b=this,c=this.xhr=f(),g=this._query.join("&"),h=this._timeout,i=this._data;if(this._callback=a||d,this._withCredentials&&(c.withCredentials=!0),c.onreadystatechange=function(){return 4==c.readyState?0==c.status?b.aborted?b.timeoutError():b.crossDomainError():(b.emit("end"),void 0):void 0},c.upload&&(c.upload.onprogress=function(a){a.percent=a.loaded/a.total*100,b.emit("progress",a)}),h&&!this._timer&&(this._timer=setTimeout(function(){b.abort()},h)),g&&(g=o.serializeObject(g),this.url+=~this.url.indexOf("?")?"&"+g:"?"+g),c.open(this.method,this.url,!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof i&&!e(i)){var j=o.serialize[this.getHeader("Content-Type")];j&&(i=j(i))}for(var k in this.header)null!=this.header[k]&&c.setRequestHeader(k,this.header[k]);return c.send(i),this},o.Request=n,o.get=function(a,b,c){var d=o("GET",a);return"function"==typeof b&&(c=b,b=null),b&&d.query(b),c&&d.end(c),d},o.head=function(a,b,c){var d=o("HEAD",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},o.del=function(a,b){var c=o("DELETE",a);return b&&c.end(b),c},o.patch=function(a,b,c){var d=o("PATCH",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},o.post=function(a,b,c){var d=o("POST",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},o.put=function(a,b,c){var d=o("PUT",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},c.exports=o}),a.alias("component-emitter/index.js","superagent/deps/emitter/index.js"),a.alias("component-emitter/index.js","emitter/index.js"),a.alias("component-indexof/index.js","component-emitter/deps/indexof/index.js"),a.alias("RedVentures-reduce/index.js","superagent/deps/reduce/index.js"),a.alias("RedVentures-reduce/index.js","reduce/index.js"),a.alias("superagent/lib/client.js","superagent/index.js"),"object"==typeof exports?module.exports=a("superagent"):"function"==typeof define&&define.amd?define(function(){return a("superagent")}):this.superagent=a("superagent")}(),function(){var a=function(b,c,d){var e=a.resolve(b);if(null===e){d=d||b,c=c||"root";var f=new Error('Failed to require "'+d+'" from "'+c+'"');throw f.path=d,f.parent=c,f.require=!0,f}var g=a.modules[e];if(!g._resolving&&!g.exports){var h={};h.exports={},h.client=h.component=!0,g._resolving=!0,g.call(this,h.exports,a.relative(e),h),delete g._resolving,g.exports=h.exports}return g.exports};a.modules={},a.aliases={},a.resolve=function(b){"/"===b.charAt(0)&&(b=b.slice(1));for(var c=[b,b+".js",b+".json",b+"/index.js",b+"/index.json"],d=0;db;b++)if(b in this&&this[b]===a)return b;return-1};k=b("./require")._,h=b("./request"),g=b("./regex"),d=null,j=!1,f=[],e={host:"api.github.com",protocol:"https"},i={host:function(a){return k.isString(a)},protocol:function(a){return k.isString(a)&&a.match(/^http(s?)$/)},token:function(a){return k.isString(a)},off_days:function(a){var b,c,d;if(!k.isArray(a))return!1;for(c=0,d=a.length;d>c;c++)if(b=a[c],l.call([1,2,3,4,5,6,7],b)<0)return!1;return!0}},c.exports=function(a){return"undefined"==typeof window&&(d=null),d?a(null,d):(f.push(a),j?void 0:(j=!0,h.config(function(b,c){var h,l,m;j=!1,d=k.defaults(c||{},e),d.size_label=d.size_label?new RegExp(d.size_label):g.size_label;for(h in i)if(l=i[h],d[h]&&!l(d[h]))return a("Config field `"+h+"` misconfigured");for(m=[];f.length;)m.push(f.pop()(null,d));return m})))}}),b.require.register("ghbc/src/modules/graph.js",function(a,b,c){var d,e,f,g,h=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};g=b("./require"),f=g._,d=g.d3,e=b("./regex"),c.exports={actual:function(a,b,c,e){var g,h,i,j,k;return g=[{date:new Date(b),points:c}],i=+1/0,h=-1/0,k=f.map(a,function(a){var b,d;return d=a.size,b=a.closed_at,i>d&&(i=d),d>h&&(h=d),f.extend({},a,{date:new Date(b),points:c-=d})}),j=d.scale.linear().domain([i,h]).range([5,8]),k=f.map(k,function(a){return a.radius=j(a.size),a}),e(null,[].concat(g,k))},ideal:function(a,b,c,d,g){var i,j,k,l,m,n,o,p,q,r,s;return a>b&&(r=[a,b],b=r[0],a=r[1]),s=f.map(a.match(e.datetime)[1].split("-"),function(a){return parseInt(a)}),q=s[0],m=s[1],j=s[2],i=new Date(b),k=[],l=0,(o=function(a){var b,d;return b=new Date(q,m-1,j+a),(d=b.getDay())||(d=7),h.call(c,d)>=0?k.push({date:b,off_day:!0}):(l+=1,k.push({date:b})),b>i?void 0:o(a+1)})(0),p=d/(l-1),k=f.map(k,function(a,b){return a.points=d,k[b]&&!k[b].off_day&&(d-=p),a}),(n=new Date)>i&&k.push({date:n,points:0}),g(null,k)},trendline:function(a,b,c){var d,e,g,h,i,j,k,l,m,n,o,p;return o=+a[0].date,p=f.map(a,function(a){var b,c;return b=a.date,c=a.points,[+b-o,c]}),m=a[a.length-1],p.push([+new Date-o,m.points]),g=0,i=0,h=0,d=(l=p.length)*f.reduce(p,function(a,b){var c,d;return c=b[0],d=b[1],g+=c,i+=d,h+=Math.pow(c,2),a+c*d},0),n=(d-g*i)/(l*h-Math.pow(g,2)),k=(i-n*g)/l,j=function(a){return n*a+k},b=new Date(b),c=c?new Date(c):new Date,d=b-o,e=c-o,[{date:b,points:j(d)},{date:c,points:j(e)}]},render:function(a,b){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;return c=a[0],f=a[1],m=a[2],document.querySelector("#svg").innerHTML="",s=document.querySelector("#graph").getBoundingClientRect(),e=s.height,n=s.width,j={top:30,right:30,bottom:40,left:50},n-=j.left+j.right,e-=j.top+j.bottom,o=d.time.scale().range([0,n]),q=d.scale.linear().range([e,0]),p=d.svg.axis().scale(o).orient("bottom").tickSize(-e).tickFormat(function(a){return a.getDate()}).tickPadding(10),r=d.svg.axis().scale(q).orient("left").tickSize(-n).ticks(5).tickPadding(10),g=d.svg.line().interpolate("linear").x(function(a){return o(a.date)}).y(function(a){return q(a.points)}),o.domain([f[0].date,f[f.length-1].date]),q.domain([0,f[0].points]).nice(),k=d.select("#svg").append("svg").attr("width",n+j.left+j.right).attr("height",e+j.top+j.bottom).append("g").attr("transform","translate("+j.left+","+j.top+")"),k.append("g").attr("class","x axis day").attr("transform","translate(0,"+e+")").call(p),h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=p.orient("top").tickSize(e).tickFormat(function(a){return h[a.getMonth()]}).ticks(2),k.append("g").attr("class","x axis month").attr("transform","translate(0,"+e+")").call(i),k.append("g").attr("class","y axis").call(r),k.append("svg:line").attr("class","today").attr("x1",o(new Date)).attr("y1",0).attr("x2",o(new Date)).attr("y2",e),k.append("path").attr("class","ideal line").attr("d",g.interpolate("basis")(f)),k.append("path").attr("class","trendline line").attr("d",g.interpolate("linear")(m)),k.append("path").attr("class","actual line").attr("d",g.interpolate("linear").y(function(a){return q(a.points)})(c)),l=d.tip().attr("class","d3-tip").html(function(a){var b,c;return b=a.number,c=a.title,"#"+b+": "+c}),k.call(l),k.selectAll("a.issue").data(c.slice(1)).enter().append("svg:a").attr("xlink:href",function(a){var b;return b=a.html_url}).attr("xlink:show","new").append("svg:circle").attr("cx",function(a){var b;return b=a.date,o(b)}).attr("cy",function(a){var b;return b=a.points,q(b)}).attr("r",function(a){var b;return b=a.radius,5}).on("mouseover",l.show).on("mouseout",l.hide),b(null)}}}),b.require.register("ghbc/src/modules/issues.js",function(a,b,c){var d,e,f,g,h;h=b("./require"),g=h._,d=h.async,f=b("./request"),e=b("./regex"),c.exports={get_all:function(a,b){var c;return c=function(b,c){var d,e;return e=[],(d=function(h){return f.all_issues(a,{milestone:a.milestone.number,state:b,page:h},function(a,b){return a?c(a):b.length?(e=e.concat(g.sortBy(b,"closed_at")),b.length<100?c(null,e):d(h+1)):c(null,e)})})(1)},d.parallel([g.partial(c,"open"),g.partial(c,"closed")],b)},filter:function(a,b,c){var d,e;return e=0,d=g.filter(a,function(a){var c;return(c=a.labels)?(a.size=g.reduce(c,function(a,c){var d;return(d=c.name.match(b))?a+=parseInt(d[1]):a},0),e+=a.size,!!a.size):!1}),c(null,d,e)}}}),b.require.register("ghbc/src/modules/milestones.js",function(a,b,c){var d,e,f,g;g=b("./require"),f=g._,d=g.marked,e=b("./request"),c.exports=function(a,b){var c;return c=function(a){return a.description&&(a.description=d(a.description).slice(3,-5)),a},a.milestone?e.one_milestone(a,a.milestone,function(a,d){return a?b(a):d.open_issues+d.closed_issues===0?b(null,"No issues for milestone `"+d.title+"`"):(d=c(d),b(null,null,d))}):e.all_milestones(a,function(d,e){var g;return d?b(d):e.length?(g=e[0],g=f.rest(e,{due_on:null}),g=g[0]?g[0]:e[0],g.open_issues+g.closed_issues===0?b(null,"No issues for milestone `"+g.title+"`"):(g=c(g),b(null,null,g))):b(null,"No open milestones for repo "+a.path)})}}),b.require.register("ghbc/src/modules/regex.js",function(a,b,c){c.exports={datetime:/^(\d{4}-\d{2}-\d{2})T(.*)/,size_label:/^size (\d+)$/,location:/^#!((\/[^\/]+){2,3})$/}}),b.require.register("ghbc/src/modules/render.js",function(a,b,c){c.exports=function(a,c,d){var e;return null==d&&(d={}),e=b("../templates/"+c),document.querySelector(a).innerHTML=e(d)}}),b.require.register("ghbc/src/modules/repo.js",function(a,b,c){var d,e,f,g,h,i,j,k;k=b("./require"),j=k._,d=k.async,g=b("./milestones"),f=b("./issues"),e=b("./graph"),h=b("./regex"),i=b("./render"),c.exports=function(a,b){return d.waterfall([function(b){return g(a,function(c,d,e){return c?b(c):d?b(d):(a.milestone=e,b(null))})},function(b){return f.get_all(a,b)},function(b,c){return d.map(b,function(b,c){return f.filter(b,a.size_label,function(a,b,d){return c(a,[b,d])})},function(b,d){var e,f;return f=d[0],e=d[1],b?c(b):f[1]+e[1]===0?c("No matching issues found"):(a.issues={closed:{points:e[1],data:e[0]},open:{points:f[1],data:f[0]}},c(null))})},function(b){var c,f;return c=100*a.issues.closed.points/(f=a.issues.open.points+a.issues.closed.points),d.parallel([j.partial(e.actual,a.issues.closed.data,a.milestone.created_at,f),j.partial(e.ideal,a.milestone.created_at,a.milestone.due_on,a.off_days||[],f)],function(d,f){var g;return i("body","graph",{repo:a.path,milestone:a.milestone}),i("#progress","progress",{progress:c}),f[0].length&&f.push(e.trendline(f[0],a.milestone.created_at,a.milestone.due_on)),(g=function(){return e.render(f,b)})(),"onresize"in window?window.onresize=g:void 0})}],b)}}),b.require.register("ghbc/src/modules/request.js",function(a,b,c){var d,e,f,g,h,i,j;j=b("./require"),h=j.superagent,i=j._,h.parse={"application/json":function(a){var b;try{return JSON.parse(a)}catch(c){return b=c,{}}}},c.exports={all_milestones:function(a,b){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/milestones",query:{state:"open",sort:"due_date",direction:"asc"},headers:e(a.token)},b)},one_milestone:function(a,b,c){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/milestones/"+b,query:{state:"open",sort:"due_date",direction:"asc"},headers:e(a.token)},c)},all_issues:function(a,b,c){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/issues",query:i.extend(b,{per_page:"100"}),headers:e(a.token)},c)},config:function(a){return f({protocol:"http",host:window.location.host,path:""+window.location.pathname+"config.json",headers:i.extend(e(),{Accept:"application/json"})},a)}},f=function(a,b){var c,d,e,f,i,j,k,l,m,n,o;j=a.protocol,e=a.host,i=a.path,l=a.query,d=a.headers,c=!1,k=l?"?"+function(){var a;a=[];for(f in l)o=l[f],a.push(""+f+"="+o);return a}().join("&"):"",m=h.get(""+j+"://"+e+i+k);for(f in d)o=d[f],m.set(f,o);return n=setTimeout(function(){return c=!0,b("Request has timed out")},1e4),m.end(function(a,d){return c?void 0:(c=!0,clearTimeout(n),g(a,d,b))})},g=function(a,b,c){var e;return a?c(d(a)):2!==b.statusType?null!=(null!=b?null!=(e=b.body)?e.message:void 0:void 0)?c(b.body.message):c(b.error.message):c(null,b.body)},e=function(a){var b;return b=i.extend({},{"Content-Type":"application/json",Accept:"application/vnd.github.v3"}),null!=a&&(b.Authorization="token "+a),b},d=function(a){var b;switch(!1){case!i.isString(a):b=a;break;case!i.isArray(a):b=a[1];break;case!(i.isObject(a)&&i.isString(a.message)):b=a.message}if(!b)try{b=JSON.stringify(a)}catch(c){b=a.toString()}return b}}),b.require.register("ghbc/src/modules/require.js",function(a,b,c){c.exports={_:_,superagent:superagent,d3:d3,async:async,marked:marked}}),b.require.register("ghbc/src/templates/error.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    Trouble

    \n

    '),c.push(this.text),c.push("

    \n
    ")}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/graph.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    '),c.push(this.milestone.title),c.push("@"),c.push(this.repo),c.push("

    \n "),this.milestone.description&&(c.push('\n

    '),c.push(this.milestone.description),c.push("

    \n ")),c.push('\n
    \n
    \n
    \n
    \n
    \n
    ')}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/info.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    GitHub Burndown Chart

    \n

    Use your browser\'s location hash to specify a repo: #!/radekstepan/disposable.

    \n

    You can choose a specific milestone like so: #!/radekstepan/disposable/1.

    \n
    ')}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/label.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""") }),function(){(function(){var a;a=Math.ceil(this.points),c.push("\n"),a>1?(c.push("\n "),c.push(a),c.push(" points left\n")):(c.push("\n "),1===a?c.push("\n 1 point left\n "):c.push("\n Done\n "),c.push("\n"))}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/loading.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    GitHub Burndown Chart

    \n

    Loading #!/'),c.push(this.path),c.push(".

    \n
    ")}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/progress.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=function(a){return a&&a.ecoSafe?a:"undefined"!=typeof a&&null!=a?f(a):""},e=a.safe,f=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},f||(f=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n '),100===this.progress?c.push('\n
    \n '):(c.push('\n
    \n ')),c.push('\n
    \n
    \n

    Closed / '),c.push(d(Math.floor(this.progress))),c.push('%

    \n

    Open / '),c.push(d(100-Math.floor(this.progress))),c.push("%

    ")}).call(this)}.call(a),a.safe=e,a.escape=f,c.join("")}})}();var c=b.require("ghbc/src/app.js");"undefined"!=typeof define&&define.amd?(define("ghbc",[],function(){return c}),define("ghb",[],function(){return c}),define("github-burndown-chart",[],function(){return c})):"undefined"!=typeof module&&module.exports?module.exports=c:(b.ghbc=c,b.ghb=c,b["github-burndown-chart"]=c),b.require.alias("ghbc/src/app.js","ghbc/index.js"),b.require.alias("ghbc/src/app.js","ghb/index.js"),b.require.alias("ghbc/src/app.js","github-burndown-chart/index.js")}(); \ No newline at end of file diff --git a/build/app.js b/build/app.js index 6044c6c..aa91d9d 100644 --- a/build/app.js +++ b/build/app.js @@ -872,7 +872,7 @@ timeout = setTimeout(function() { exited = true; return cb('Request has timed out'); - }, 3e3); + }, 1e4); return req.end(function(err, data) { if (exited) { return; diff --git a/build/app.min.js b/build/app.min.js index 62d5b8c..5d64320 100644 --- a/build/app.min.js +++ b/build/app.min.js @@ -1 +1 @@ -!function(){var a=function(b,c,d){var e=a.resolve(b);if(null===e){d=d||b,c=c||"root";var f=new Error('Failed to require "'+d+'" from "'+c+'"');throw f.path=d,f.parent=c,f.require=!0,f}var g=a.modules[e];if(!g._resolving&&!g.exports){var h={};h.exports={},h.client=h.component=!0,g._resolving=!0,g.call(this,h.exports,a.relative(e),h),delete g._resolving,g.exports=h.exports}return g.exports};a.modules={},a.aliases={},a.resolve=function(b){"/"===b.charAt(0)&&(b=b.slice(1));for(var c=[b,b+".js",b+".json",b+"/index.js",b+"/index.json"],d=0;db;b++)if(b in this&&this[b]===a)return b;return-1};k=b("./require")._,h=b("./request"),g=b("./regex"),d=null,j=!1,f=[],e={host:"api.github.com",protocol:"https"},i={host:function(a){return k.isString(a)},protocol:function(a){return k.isString(a)&&a.match(/^http(s?)$/)},token:function(a){return k.isString(a)},off_days:function(a){var b,c,d;if(!k.isArray(a))return!1;for(c=0,d=a.length;d>c;c++)if(b=a[c],l.call([1,2,3,4,5,6,7],b)<0)return!1;return!0}},c.exports=function(a){return"undefined"==typeof window&&(d=null),d?a(null,d):(f.push(a),j?void 0:(j=!0,h.config(function(b,c){var h,l,m;j=!1,d=k.defaults(c||{},e),d.size_label=d.size_label?new RegExp(d.size_label):g.size_label;for(h in i)if(l=i[h],d[h]&&!l(d[h]))return a("Config field `"+h+"` misconfigured");for(m=[];f.length;)m.push(f.pop()(null,d));return m})))}}),b.require.register("ghbc/src/modules/graph.js",function(a,b,c){var d,e,f,g,h=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};g=b("./require"),f=g._,d=g.d3,e=b("./regex"),c.exports={actual:function(a,b,c,e){var g,h,i,j,k;return g=[{date:new Date(b),points:c}],i=+1/0,h=-1/0,k=f.map(a,function(a){var b,d;return d=a.size,b=a.closed_at,i>d&&(i=d),d>h&&(h=d),f.extend({},a,{date:new Date(b),points:c-=d})}),j=d.scale.linear().domain([i,h]).range([5,8]),k=f.map(k,function(a){return a.radius=j(a.size),a}),e(null,[].concat(g,k))},ideal:function(a,b,c,d,g){var i,j,k,l,m,n,o,p,q,r,s;return a>b&&(r=[a,b],b=r[0],a=r[1]),s=f.map(a.match(e.datetime)[1].split("-"),function(a){return parseInt(a)}),q=s[0],m=s[1],j=s[2],i=new Date(b),k=[],l=0,(o=function(a){var b,d;return b=new Date(q,m-1,j+a),(d=b.getDay())||(d=7),h.call(c,d)>=0?k.push({date:b,off_day:!0}):(l+=1,k.push({date:b})),b>i?void 0:o(a+1)})(0),p=d/(l-1),k=f.map(k,function(a,b){return a.points=d,k[b]&&!k[b].off_day&&(d-=p),a}),(n=new Date)>i&&k.push({date:n,points:0}),g(null,k)},trendline:function(a,b,c){var d,e,g,h,i,j,k,l,m,n,o,p;return o=+a[0].date,p=f.map(a,function(a){var b,c;return b=a.date,c=a.points,[+b-o,c]}),m=a[a.length-1],p.push([+new Date-o,m.points]),g=0,i=0,h=0,d=(l=p.length)*f.reduce(p,function(a,b){var c,d;return c=b[0],d=b[1],g+=c,i+=d,h+=Math.pow(c,2),a+c*d},0),n=(d-g*i)/(l*h-Math.pow(g,2)),k=(i-n*g)/l,j=function(a){return n*a+k},b=new Date(b),c=c?new Date(c):new Date,d=b-o,e=c-o,[{date:b,points:j(d)},{date:c,points:j(e)}]},render:function(a,b){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;return c=a[0],f=a[1],m=a[2],document.querySelector("#svg").innerHTML="",s=document.querySelector("#graph").getBoundingClientRect(),e=s.height,n=s.width,j={top:30,right:30,bottom:40,left:50},n-=j.left+j.right,e-=j.top+j.bottom,o=d.time.scale().range([0,n]),q=d.scale.linear().range([e,0]),p=d.svg.axis().scale(o).orient("bottom").tickSize(-e).tickFormat(function(a){return a.getDate()}).tickPadding(10),r=d.svg.axis().scale(q).orient("left").tickSize(-n).ticks(5).tickPadding(10),g=d.svg.line().interpolate("linear").x(function(a){return o(a.date)}).y(function(a){return q(a.points)}),o.domain([f[0].date,f[f.length-1].date]),q.domain([0,f[0].points]).nice(),k=d.select("#svg").append("svg").attr("width",n+j.left+j.right).attr("height",e+j.top+j.bottom).append("g").attr("transform","translate("+j.left+","+j.top+")"),k.append("g").attr("class","x axis day").attr("transform","translate(0,"+e+")").call(p),h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=p.orient("top").tickSize(e).tickFormat(function(a){return h[a.getMonth()]}).ticks(2),k.append("g").attr("class","x axis month").attr("transform","translate(0,"+e+")").call(i),k.append("g").attr("class","y axis").call(r),k.append("svg:line").attr("class","today").attr("x1",o(new Date)).attr("y1",0).attr("x2",o(new Date)).attr("y2",e),k.append("path").attr("class","ideal line").attr("d",g.interpolate("basis")(f)),k.append("path").attr("class","trendline line").attr("d",g.interpolate("linear")(m)),k.append("path").attr("class","actual line").attr("d",g.interpolate("linear").y(function(a){return q(a.points)})(c)),l=d.tip().attr("class","d3-tip").html(function(a){var b,c;return b=a.number,c=a.title,"#"+b+": "+c}),k.call(l),k.selectAll("a.issue").data(c.slice(1)).enter().append("svg:a").attr("xlink:href",function(a){var b;return b=a.html_url}).attr("xlink:show","new").append("svg:circle").attr("cx",function(a){var b;return b=a.date,o(b)}).attr("cy",function(a){var b;return b=a.points,q(b)}).attr("r",function(a){var b;return b=a.radius,5}).on("mouseover",l.show).on("mouseout",l.hide),b(null)}}}),b.require.register("ghbc/src/modules/issues.js",function(a,b,c){var d,e,f,g,h;h=b("./require"),g=h._,d=h.async,f=b("./request"),e=b("./regex"),c.exports={get_all:function(a,b){var c;return c=function(b,c){var d,e;return e=[],(d=function(h){return f.all_issues(a,{milestone:a.milestone.number,state:b,page:h},function(a,b){return a?c(a):b.length?(e=e.concat(g.sortBy(b,"closed_at")),b.length<100?c(null,e):d(h+1)):c(null,e)})})(1)},d.parallel([g.partial(c,"open"),g.partial(c,"closed")],b)},filter:function(a,b,c){var d,e;return e=0,d=g.filter(a,function(a){var c;return(c=a.labels)?(a.size=g.reduce(c,function(a,c){var d;return(d=c.name.match(b))?a+=parseInt(d[1]):a},0),e+=a.size,!!a.size):!1}),c(null,d,e)}}}),b.require.register("ghbc/src/modules/milestones.js",function(a,b,c){var d,e,f,g;g=b("./require"),f=g._,d=g.marked,e=b("./request"),c.exports=function(a,b){var c;return c=function(a){return a.description&&(a.description=d(a.description).slice(3,-5)),a},a.milestone?e.one_milestone(a,a.milestone,function(a,d){return a?b(a):d.open_issues+d.closed_issues===0?b(null,"No issues for milestone `"+d.title+"`"):(d=c(d),b(null,null,d))}):e.all_milestones(a,function(d,e){var g;return d?b(d):e.length?(g=e[0],g=f.rest(e,{due_on:null}),g=g[0]?g[0]:e[0],g.open_issues+g.closed_issues===0?b(null,"No issues for milestone `"+g.title+"`"):(g=c(g),b(null,null,g))):b(null,"No open milestones for repo "+a.path)})}}),b.require.register("ghbc/src/modules/regex.js",function(a,b,c){c.exports={datetime:/^(\d{4}-\d{2}-\d{2})T(.*)/,size_label:/^size (\d+)$/,location:/^#!((\/[^\/]+){2,3})$/}}),b.require.register("ghbc/src/modules/render.js",function(a,b,c){c.exports=function(a,c,d){var e;return null==d&&(d={}),e=b("../templates/"+c),document.querySelector(a).innerHTML=e(d)}}),b.require.register("ghbc/src/modules/repo.js",function(a,b,c){var d,e,f,g,h,i,j,k;k=b("./require"),j=k._,d=k.async,g=b("./milestones"),f=b("./issues"),e=b("./graph"),h=b("./regex"),i=b("./render"),c.exports=function(a,b){return d.waterfall([function(b){return g(a,function(c,d,e){return c?b(c):d?b(d):(a.milestone=e,b(null))})},function(b){return f.get_all(a,b)},function(b,c){return d.map(b,function(b,c){return f.filter(b,a.size_label,function(a,b,d){return c(a,[b,d])})},function(b,d){var e,f;return f=d[0],e=d[1],b?c(b):f[1]+e[1]===0?c("No matching issues found"):(a.issues={closed:{points:e[1],data:e[0]},open:{points:f[1],data:f[0]}},c(null))})},function(b){var c,f;return c=100*a.issues.closed.points/(f=a.issues.open.points+a.issues.closed.points),d.parallel([j.partial(e.actual,a.issues.closed.data,a.milestone.created_at,f),j.partial(e.ideal,a.milestone.created_at,a.milestone.due_on,a.off_days||[],f)],function(d,f){var g;return i("body","graph",{repo:a.path,milestone:a.milestone}),i("#progress","progress",{progress:c}),f[0].length&&f.push(e.trendline(f[0],a.milestone.created_at,a.milestone.due_on)),(g=function(){return e.render(f,b)})(),"onresize"in window?window.onresize=g:void 0})}],b)}}),b.require.register("ghbc/src/modules/request.js",function(a,b,c){var d,e,f,g,h,i,j;j=b("./require"),h=j.superagent,i=j._,h.parse={"application/json":function(a){var b;try{return JSON.parse(a)}catch(c){return b=c,{}}}},c.exports={all_milestones:function(a,b){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/milestones",query:{state:"open",sort:"due_date",direction:"asc"},headers:e(a.token)},b)},one_milestone:function(a,b,c){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/milestones/"+b,query:{state:"open",sort:"due_date",direction:"asc"},headers:e(a.token)},c)},all_issues:function(a,b,c){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/issues",query:i.extend(b,{per_page:"100"}),headers:e(a.token)},c)},config:function(a){return f({protocol:"http",host:window.location.host,path:""+window.location.pathname+"config.json",headers:i.extend(e(),{Accept:"application/json"})},a)}},f=function(a,b){var c,d,e,f,i,j,k,l,m,n,o;j=a.protocol,e=a.host,i=a.path,l=a.query,d=a.headers,c=!1,k=l?"?"+function(){var a;a=[];for(f in l)o=l[f],a.push(""+f+"="+o);return a}().join("&"):"",m=h.get(""+j+"://"+e+i+k);for(f in d)o=d[f],m.set(f,o);return n=setTimeout(function(){return c=!0,b("Request has timed out")},3e3),m.end(function(a,d){return c?void 0:(c=!0,clearTimeout(n),g(a,d,b))})},g=function(a,b,c){var e;return a?c(d(a)):2!==b.statusType?null!=(null!=b?null!=(e=b.body)?e.message:void 0:void 0)?c(b.body.message):c(b.error.message):c(null,b.body)},e=function(a){var b;return b=i.extend({},{"Content-Type":"application/json",Accept:"application/vnd.github.v3"}),null!=a&&(b.Authorization="token "+a),b},d=function(a){var b;switch(!1){case!i.isString(a):b=a;break;case!i.isArray(a):b=a[1];break;case!(i.isObject(a)&&i.isString(a.message)):b=a.message}if(!b)try{b=JSON.stringify(a)}catch(c){b=a.toString()}return b}}),b.require.register("ghbc/src/modules/require.js",function(a,b,c){c.exports={_:_,superagent:superagent,d3:d3,async:async,marked:marked}}),b.require.register("ghbc/src/templates/error.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    Trouble

    \n

    '),c.push(this.text),c.push("

    \n
    ")}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/graph.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    '),c.push(this.milestone.title),c.push("@"),c.push(this.repo),c.push("

    \n "),this.milestone.description&&(c.push('\n

    '),c.push(this.milestone.description),c.push("

    \n ")),c.push('\n
    \n
    \n
    \n
    \n
    \n
    ')}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/info.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    GitHub Burndown Chart

    \n

    Use your browser\'s location hash to specify a repo: #!/radekstepan/disposable.

    \n

    You can choose a specific milestone like so: #!/radekstepan/disposable/1.

    \n
    ')}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/label.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){var a;a=Math.ceil(this.points),c.push("\n"),a>1?(c.push("\n "),c.push(a),c.push(" points left\n")):(c.push("\n "),1===a?c.push("\n 1 point left\n "):c.push("\n Done\n "),c.push("\n"))}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/loading.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    GitHub Burndown Chart

    \n

    Loading #!/'),c.push(this.path),c.push(".

    \n
    ")}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/progress.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=function(a){return a&&a.ecoSafe?a:"undefined"!=typeof a&&null!=a?f(a):""},e=a.safe,f=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},f||(f=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n '),100===this.progress?c.push('\n
    \n '):(c.push('\n
    \n ')),c.push('\n
    \n
    \n

    Closed / '),c.push(d(Math.floor(this.progress))),c.push('%

    \n

    Open / '),c.push(d(100-Math.floor(this.progress))),c.push("%

    ")}).call(this)}.call(a),a.safe=e,a.escape=f,c.join("")}})}();var c=b.require("ghbc/src/app.js");"undefined"!=typeof define&&define.amd?(define("ghbc",[],function(){return c}),define("ghb",[],function(){return c}),define("github-burndown-chart",[],function(){return c})):"undefined"!=typeof module&&module.exports?module.exports=c:(b.ghbc=c,b.ghb=c,b["github-burndown-chart"]=c),b.require.alias("ghbc/src/app.js","ghbc/index.js"),b.require.alias("ghbc/src/app.js","ghb/index.js"),b.require.alias("ghbc/src/app.js","github-burndown-chart/index.js")}(); \ No newline at end of file +!function(){var a=function(b,c,d){var e=a.resolve(b);if(null===e){d=d||b,c=c||"root";var f=new Error('Failed to require "'+d+'" from "'+c+'"');throw f.path=d,f.parent=c,f.require=!0,f}var g=a.modules[e];if(!g._resolving&&!g.exports){var h={};h.exports={},h.client=h.component=!0,g._resolving=!0,g.call(this,h.exports,a.relative(e),h),delete g._resolving,g.exports=h.exports}return g.exports};a.modules={},a.aliases={},a.resolve=function(b){"/"===b.charAt(0)&&(b=b.slice(1));for(var c=[b,b+".js",b+".json",b+"/index.js",b+"/index.json"],d=0;db;b++)if(b in this&&this[b]===a)return b;return-1};k=b("./require")._,h=b("./request"),g=b("./regex"),d=null,j=!1,f=[],e={host:"api.github.com",protocol:"https"},i={host:function(a){return k.isString(a)},protocol:function(a){return k.isString(a)&&a.match(/^http(s?)$/)},token:function(a){return k.isString(a)},off_days:function(a){var b,c,d;if(!k.isArray(a))return!1;for(c=0,d=a.length;d>c;c++)if(b=a[c],l.call([1,2,3,4,5,6,7],b)<0)return!1;return!0}},c.exports=function(a){return"undefined"==typeof window&&(d=null),d?a(null,d):(f.push(a),j?void 0:(j=!0,h.config(function(b,c){var h,l,m;j=!1,d=k.defaults(c||{},e),d.size_label=d.size_label?new RegExp(d.size_label):g.size_label;for(h in i)if(l=i[h],d[h]&&!l(d[h]))return a("Config field `"+h+"` misconfigured");for(m=[];f.length;)m.push(f.pop()(null,d));return m})))}}),b.require.register("ghbc/src/modules/graph.js",function(a,b,c){var d,e,f,g,h=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};g=b("./require"),f=g._,d=g.d3,e=b("./regex"),c.exports={actual:function(a,b,c,e){var g,h,i,j,k;return g=[{date:new Date(b),points:c}],i=+1/0,h=-1/0,k=f.map(a,function(a){var b,d;return d=a.size,b=a.closed_at,i>d&&(i=d),d>h&&(h=d),f.extend({},a,{date:new Date(b),points:c-=d})}),j=d.scale.linear().domain([i,h]).range([5,8]),k=f.map(k,function(a){return a.radius=j(a.size),a}),e(null,[].concat(g,k))},ideal:function(a,b,c,d,g){var i,j,k,l,m,n,o,p,q,r,s;return a>b&&(r=[a,b],b=r[0],a=r[1]),s=f.map(a.match(e.datetime)[1].split("-"),function(a){return parseInt(a)}),q=s[0],m=s[1],j=s[2],i=new Date(b),k=[],l=0,(o=function(a){var b,d;return b=new Date(q,m-1,j+a),(d=b.getDay())||(d=7),h.call(c,d)>=0?k.push({date:b,off_day:!0}):(l+=1,k.push({date:b})),b>i?void 0:o(a+1)})(0),p=d/(l-1),k=f.map(k,function(a,b){return a.points=d,k[b]&&!k[b].off_day&&(d-=p),a}),(n=new Date)>i&&k.push({date:n,points:0}),g(null,k)},trendline:function(a,b,c){var d,e,g,h,i,j,k,l,m,n,o,p;return o=+a[0].date,p=f.map(a,function(a){var b,c;return b=a.date,c=a.points,[+b-o,c]}),m=a[a.length-1],p.push([+new Date-o,m.points]),g=0,i=0,h=0,d=(l=p.length)*f.reduce(p,function(a,b){var c,d;return c=b[0],d=b[1],g+=c,i+=d,h+=Math.pow(c,2),a+c*d},0),n=(d-g*i)/(l*h-Math.pow(g,2)),k=(i-n*g)/l,j=function(a){return n*a+k},b=new Date(b),c=c?new Date(c):new Date,d=b-o,e=c-o,[{date:b,points:j(d)},{date:c,points:j(e)}]},render:function(a,b){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;return c=a[0],f=a[1],m=a[2],document.querySelector("#svg").innerHTML="",s=document.querySelector("#graph").getBoundingClientRect(),e=s.height,n=s.width,j={top:30,right:30,bottom:40,left:50},n-=j.left+j.right,e-=j.top+j.bottom,o=d.time.scale().range([0,n]),q=d.scale.linear().range([e,0]),p=d.svg.axis().scale(o).orient("bottom").tickSize(-e).tickFormat(function(a){return a.getDate()}).tickPadding(10),r=d.svg.axis().scale(q).orient("left").tickSize(-n).ticks(5).tickPadding(10),g=d.svg.line().interpolate("linear").x(function(a){return o(a.date)}).y(function(a){return q(a.points)}),o.domain([f[0].date,f[f.length-1].date]),q.domain([0,f[0].points]).nice(),k=d.select("#svg").append("svg").attr("width",n+j.left+j.right).attr("height",e+j.top+j.bottom).append("g").attr("transform","translate("+j.left+","+j.top+")"),k.append("g").attr("class","x axis day").attr("transform","translate(0,"+e+")").call(p),h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=p.orient("top").tickSize(e).tickFormat(function(a){return h[a.getMonth()]}).ticks(2),k.append("g").attr("class","x axis month").attr("transform","translate(0,"+e+")").call(i),k.append("g").attr("class","y axis").call(r),k.append("svg:line").attr("class","today").attr("x1",o(new Date)).attr("y1",0).attr("x2",o(new Date)).attr("y2",e),k.append("path").attr("class","ideal line").attr("d",g.interpolate("basis")(f)),k.append("path").attr("class","trendline line").attr("d",g.interpolate("linear")(m)),k.append("path").attr("class","actual line").attr("d",g.interpolate("linear").y(function(a){return q(a.points)})(c)),l=d.tip().attr("class","d3-tip").html(function(a){var b,c;return b=a.number,c=a.title,"#"+b+": "+c}),k.call(l),k.selectAll("a.issue").data(c.slice(1)).enter().append("svg:a").attr("xlink:href",function(a){var b;return b=a.html_url}).attr("xlink:show","new").append("svg:circle").attr("cx",function(a){var b;return b=a.date,o(b)}).attr("cy",function(a){var b;return b=a.points,q(b)}).attr("r",function(a){var b;return b=a.radius,5}).on("mouseover",l.show).on("mouseout",l.hide),b(null)}}}),b.require.register("ghbc/src/modules/issues.js",function(a,b,c){var d,e,f,g,h;h=b("./require"),g=h._,d=h.async,f=b("./request"),e=b("./regex"),c.exports={get_all:function(a,b){var c;return c=function(b,c){var d,e;return e=[],(d=function(h){return f.all_issues(a,{milestone:a.milestone.number,state:b,page:h},function(a,b){return a?c(a):b.length?(e=e.concat(g.sortBy(b,"closed_at")),b.length<100?c(null,e):d(h+1)):c(null,e)})})(1)},d.parallel([g.partial(c,"open"),g.partial(c,"closed")],b)},filter:function(a,b,c){var d,e;return e=0,d=g.filter(a,function(a){var c;return(c=a.labels)?(a.size=g.reduce(c,function(a,c){var d;return(d=c.name.match(b))?a+=parseInt(d[1]):a},0),e+=a.size,!!a.size):!1}),c(null,d,e)}}}),b.require.register("ghbc/src/modules/milestones.js",function(a,b,c){var d,e,f,g;g=b("./require"),f=g._,d=g.marked,e=b("./request"),c.exports=function(a,b){var c;return c=function(a){return a.description&&(a.description=d(a.description).slice(3,-5)),a},a.milestone?e.one_milestone(a,a.milestone,function(a,d){return a?b(a):d.open_issues+d.closed_issues===0?b(null,"No issues for milestone `"+d.title+"`"):(d=c(d),b(null,null,d))}):e.all_milestones(a,function(d,e){var g;return d?b(d):e.length?(g=e[0],g=f.rest(e,{due_on:null}),g=g[0]?g[0]:e[0],g.open_issues+g.closed_issues===0?b(null,"No issues for milestone `"+g.title+"`"):(g=c(g),b(null,null,g))):b(null,"No open milestones for repo "+a.path)})}}),b.require.register("ghbc/src/modules/regex.js",function(a,b,c){c.exports={datetime:/^(\d{4}-\d{2}-\d{2})T(.*)/,size_label:/^size (\d+)$/,location:/^#!((\/[^\/]+){2,3})$/}}),b.require.register("ghbc/src/modules/render.js",function(a,b,c){c.exports=function(a,c,d){var e;return null==d&&(d={}),e=b("../templates/"+c),document.querySelector(a).innerHTML=e(d)}}),b.require.register("ghbc/src/modules/repo.js",function(a,b,c){var d,e,f,g,h,i,j,k;k=b("./require"),j=k._,d=k.async,g=b("./milestones"),f=b("./issues"),e=b("./graph"),h=b("./regex"),i=b("./render"),c.exports=function(a,b){return d.waterfall([function(b){return g(a,function(c,d,e){return c?b(c):d?b(d):(a.milestone=e,b(null))})},function(b){return f.get_all(a,b)},function(b,c){return d.map(b,function(b,c){return f.filter(b,a.size_label,function(a,b,d){return c(a,[b,d])})},function(b,d){var e,f;return f=d[0],e=d[1],b?c(b):f[1]+e[1]===0?c("No matching issues found"):(a.issues={closed:{points:e[1],data:e[0]},open:{points:f[1],data:f[0]}},c(null))})},function(b){var c,f;return c=100*a.issues.closed.points/(f=a.issues.open.points+a.issues.closed.points),d.parallel([j.partial(e.actual,a.issues.closed.data,a.milestone.created_at,f),j.partial(e.ideal,a.milestone.created_at,a.milestone.due_on,a.off_days||[],f)],function(d,f){var g;return i("body","graph",{repo:a.path,milestone:a.milestone}),i("#progress","progress",{progress:c}),f[0].length&&f.push(e.trendline(f[0],a.milestone.created_at,a.milestone.due_on)),(g=function(){return e.render(f,b)})(),"onresize"in window?window.onresize=g:void 0})}],b)}}),b.require.register("ghbc/src/modules/request.js",function(a,b,c){var d,e,f,g,h,i,j;j=b("./require"),h=j.superagent,i=j._,h.parse={"application/json":function(a){var b;try{return JSON.parse(a)}catch(c){return b=c,{}}}},c.exports={all_milestones:function(a,b){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/milestones",query:{state:"open",sort:"due_date",direction:"asc"},headers:e(a.token)},b)},one_milestone:function(a,b,c){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/milestones/"+b,query:{state:"open",sort:"due_date",direction:"asc"},headers:e(a.token)},c)},all_issues:function(a,b,c){return f({protocol:a.protocol,host:a.host,path:"/repos/"+a.path+"/issues",query:i.extend(b,{per_page:"100"}),headers:e(a.token)},c)},config:function(a){return f({protocol:"http",host:window.location.host,path:""+window.location.pathname+"config.json",headers:i.extend(e(),{Accept:"application/json"})},a)}},f=function(a,b){var c,d,e,f,i,j,k,l,m,n,o;j=a.protocol,e=a.host,i=a.path,l=a.query,d=a.headers,c=!1,k=l?"?"+function(){var a;a=[];for(f in l)o=l[f],a.push(""+f+"="+o);return a}().join("&"):"",m=h.get(""+j+"://"+e+i+k);for(f in d)o=d[f],m.set(f,o);return n=setTimeout(function(){return c=!0,b("Request has timed out")},1e4),m.end(function(a,d){return c?void 0:(c=!0,clearTimeout(n),g(a,d,b))})},g=function(a,b,c){var e;return a?c(d(a)):2!==b.statusType?null!=(null!=b?null!=(e=b.body)?e.message:void 0:void 0)?c(b.body.message):c(b.error.message):c(null,b.body)},e=function(a){var b;return b=i.extend({},{"Content-Type":"application/json",Accept:"application/vnd.github.v3"}),null!=a&&(b.Authorization="token "+a),b},d=function(a){var b;switch(!1){case!i.isString(a):b=a;break;case!i.isArray(a):b=a[1];break;case!(i.isObject(a)&&i.isString(a.message)):b=a.message}if(!b)try{b=JSON.stringify(a)}catch(c){b=a.toString()}return b}}),b.require.register("ghbc/src/modules/require.js",function(a,b,c){c.exports={_:_,superagent:superagent,d3:d3,async:async,marked:marked}}),b.require.register("ghbc/src/templates/error.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    Trouble

    \n

    '),c.push(this.text),c.push("

    \n
    ")}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/graph.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    '),c.push(this.milestone.title),c.push("@"),c.push(this.repo),c.push("

    \n "),this.milestone.description&&(c.push('\n

    '),c.push(this.milestone.description),c.push("

    \n ")),c.push('\n
    \n
    \n
    \n
    \n
    \n
    ')}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/info.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    GitHub Burndown Chart

    \n

    Use your browser\'s location hash to specify a repo: #!/radekstepan/disposable.

    \n

    You can choose a specific milestone like so: #!/radekstepan/disposable/1.

    \n
    ')}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/label.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){var a;a=Math.ceil(this.points),c.push("\n"),a>1?(c.push("\n "),c.push(a),c.push(" points left\n")):(c.push("\n "),1===a?c.push("\n 1 point left\n "):c.push("\n Done\n "),c.push("\n"))}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/loading.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=a.safe,e=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},e||(e=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n

    GitHub Burndown Chart

    \n

    Loading #!/'),c.push(this.path),c.push(".

    \n
    ")}).call(this)}.call(a),a.safe=d,a.escape=e,c.join("")}}),b.require.register("ghbc/src/templates/progress.js",function(a,b,c){c.exports=function(a){a||(a={});var b,c=[],d=function(a){return a&&a.ecoSafe?a:"undefined"!=typeof a&&null!=a?f(a):""},e=a.safe,f=a.escape;return b=a.safe=function(a){if(a&&a.ecoSafe)return a;("undefined"==typeof a||null==a)&&(a="");var b=new String(a);return b.ecoSafe=!0,b},f||(f=a.escape=function(a){return(""+a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}),function(){(function(){c.push('
    \n '),100===this.progress?c.push('\n
    \n '):(c.push('\n
    \n ')),c.push('\n
    \n
    \n

    Closed / '),c.push(d(Math.floor(this.progress))),c.push('%

    \n

    Open / '),c.push(d(100-Math.floor(this.progress))),c.push("%

    ")}).call(this)}.call(a),a.safe=e,a.escape=f,c.join("")}})}();var c=b.require("ghbc/src/app.js");"undefined"!=typeof define&&define.amd?(define("ghbc",[],function(){return c}),define("ghb",[],function(){return c}),define("github-burndown-chart",[],function(){return c})):"undefined"!=typeof module&&module.exports?module.exports=c:(b.ghbc=c,b.ghb=c,b["github-burndown-chart"]=c),b.require.alias("ghbc/src/app.js","ghbc/index.js"),b.require.alias("ghbc/src/app.js","ghb/index.js"),b.require.alias("ghbc/src/app.js","github-burndown-chart/index.js")}(); \ No newline at end of file diff --git a/proxy.coffee b/proxy.coffee index ae14990..df62c0b 100644 --- a/proxy.coffee +++ b/proxy.coffee @@ -13,40 +13,47 @@ config.host ?= 'api.github.com' _.extend scrubbed = {}, config, { 'protocol': 'http', 'token': null } proxy = (req, res, next) -> - write = (code, body) -> + end = (code, body) -> res.writeHead code, {'Content-Type': 'application/json; charset=utf-8'} res.end body + # Log it. + console.log new Date(), req.url + # Config? if req.url is '/config.json' # Refer to us like so. # Prefer custom header x-forwarded-host if defined. scrubbed.host = req.headers['x-forwarded-host'] or req.headers.host - return write 200, JSON.stringify scrubbed, null, 4 + return end 200, JSON.stringify scrubbed, null, 4 - # API request? + # GitHub API request? if req.url.match /^\/repos/ - # The new headers. + # The default headers. headers = # See http://developer.github.com/v3/media/#beta-v3-and-the-future 'Accept': 'application/vnd.github.v3' # See http://developer.github.com/v3/#user-agent-required 'User-Agent': 'GitHub-Burndown-Chart' # Add a token? - headers.Authorization = 'token ' + config.token if config.token + headers.Authorization = "token #{config.token}" if config.token? + # Make the HTTPS request. return request { - 'uri': 'https://' + config.host + req.url + 'uri': "https://#{config.host}#{req.url}" headers - }, (_err, _res, body) -> - return write(500) if _err - write _res.statusCode, body + # Handle the response. + }, (err, _res, body) -> + return end(500) if err + end _res.statusCode, body # Get handled by Connect. do next app = connect() .use(proxy) +# Serve the public directory with the app, no need to launch another service. .use(connect.static(__dirname + '/public')) +# Connect on an env port or go random. .listen process.env.PORT, -> console.log 'Proxy listening on port', app.address().port \ No newline at end of file diff --git a/public/.gitignore b/public/.gitignore new file mode 100644 index 0000000..dad3495 --- /dev/null +++ b/public/.gitignore @@ -0,0 +1 @@ +!config.json \ No newline at end of file diff --git a/public/config.json b/public/config.json new file mode 120000 index 0000000..28e1485 --- /dev/null +++ b/public/config.json @@ -0,0 +1 @@ +../config.json \ No newline at end of file diff --git a/src/modules/request.coffee b/src/modules/request.coffee index 25f3273..1d4675e 100644 --- a/src/modules/request.coffee +++ b/src/modules/request.coffee @@ -66,7 +66,7 @@ request = ({ protocol, host, path, query, headers }, cb) -> timeout = setTimeout -> exited = yes cb 'Request has timed out' - , 3e3 + , 1e4 # give us 10s # Send. req.end (err, data) ->