From a012a326c8ff1793f2bb256282f833c6df2d7c65 Mon Sep 17 00:00:00 2001 From: Radek Stepan Date: Wed, 30 Jul 2014 09:55:46 +0100 Subject: [PATCH] better documentation and info; refs #45 --- README.md | 20 +++++++++++++++----- build/app.bundle.js | 2 +- build/app.bundle.min.js | 2 +- build/app.js | 2 +- build/app.min.js | 2 +- src/templates/info.eco | 6 +++++- 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index df213fe..21451d2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ #GitHub Burndown Chart [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/) -**The original app got completely rewritten, see [notes](#rewrite), thank you.** - -Displays a burndown chart from a set of GitHub issues in the current milestone. +Displays a burndown chart from a set of GitHub issues in a milestone. [ ![Codeship Status for radekstepan/github-burndown-chart](https://www.codeship.io/projects/d69f4420-e5b0-0130-bbae-1632ddfb80f8/status)](https://www.codeship.io/projects/5855) @@ -101,7 +99,19 @@ $ make install $ make build ``` -We are using the [Bower](http://bower.io/) package manager and [Grunt](http://gruntjs.com/) task runner. +When you are done developing, you may want to create a minified build: + +```bash +$ make minify +``` + +We are using the [Bower](http://bower.io/) package manager and [Grunt](http://gruntjs.com/) task runner. To [install Bower](http://bower.io/#install-bower) and [install Grunt](http://gruntjs.com/installing-grunt) run the following commands: + +```bash +$ sudo npm install bower -g +$ sudo npm install grunt -g +$ sudo npm install grunt-cli -g +``` ##Publish It @@ -132,4 +142,4 @@ If you would like to use the original app, please refer to the `original` branch ##Thanks -Thank you for using the app and your feedback/comments are very much welcome. Radek +Thank you for using the app and your feedback/comments are very much welcome. Radek \ No newline at end of file diff --git a/build/app.bundle.js b/build/app.bundle.js index 15f87e2..1482043 100644 --- a/build/app.bundle.js +++ b/build/app.bundle.js @@ -21299,7 +21299,7 @@ require.alias("superagent/lib/client.js", "superagent/index.js");if (typeof expo } (function() { (function() { - __out.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
'); + __out.push('
\n

GitHub Burndown Chart

\n \n

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

\n \n

You can choose a specific milestone by its number: #!/radekstepan/disposable/1.

\n\n

To get the milestone number, fetch all your milestones using GitHub API.

\n
'); }).call(this); diff --git a/build/app.bundle.min.js b/build/app.bundle.min.js index b388db4..c83ef98 100644 --- a/build/app.bundle.min.js +++ b/build/app.bundle.min.js @@ -5,4 +5,4 @@ Uh.forEach(function(a,b){Uh.set(a,qb(b))}),Wg.functor=Ab,Wg.xhr=Cb(Bb),Wg.dsv=fu }),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 Wg.range(a.length).reverse()},"default":gf}),lj=Wg.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:hf});Wg.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[Wg.bisect(l,h,1,n)-1],g.y+=o,g.push(a[f]));return i}var b=!0,c=Number,d=of,e=mf;return a.value=function(b){return arguments.length?(c=b,a):c},a.range=function(b){return arguments.length?(d=Ab(b),a):d},a.bins=function(b){return arguments.length?(e="number"==typeof b?function(a){return nf(a,b)}:Ab(b),a):e},a.frequency=function(c){return arguments.length?(b=!!c,a):b},a},Wg.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,$e(h,function(a){a.r=+k(a.value)}),$e(h,tf),d){var l=d*(b?1:Math.max(2*h.r/i,2*h.r/j))/2;$e(h,function(a){a.r+=l}),$e(h,tf),$e(h,function(a){a.r-=l})}return wf(h,i/2,j/2,b?1:1/Math.max(2*h.r/i,2*h.r/j)),g}var b,c=Wg.layout.hierarchy().sort(pf),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},Ye(a,c)},Wg.layout.tree=function(){function a(a,e){var k=g.call(this,a,e),l=k[0],m=b(l);if($e(m,c),m.parent.m=-m.z,Ze(m,d),j)Ze(l,f);else{var n=l,o=l,p=l;Ze(l,function(a){a.xo.x&&(o=a),a.depth>p.depth&&(p=a)});var q=h(n,o)/2-n.x,r=i[0]/(o.x+h(o,n)/2+q),s=i[1]/(p.depth||1);Ze(l,function(a){a.x=(a.x+q)*r,a.y=a.depth*s})}return k}function b(a){for(var b,c={A:null,children:[a]},d=[c];null!=(b=d.pop());)for(var e,f=b.children,g=0,h=f.length;h>g;++g)d.push((f[g]=e={_:f[g],parent:b,children:(e=f[g].children)&&e.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:g}).a=e);return c.children[0]}function c(a){var b=a.children,c=a.parent.children,d=a.i?c[a.i-1]:null;if(b.length){Cf(a);var f=(b[0].z+b[b.length-1].z)/2;d?(a.z=d.z+h(a._,d._),a.m=a.z-f):a.z=f}else d&&(a.z=d.z+h(a._,d._));a.parent.A=e(a,d,a.parent.A||c[0])}function d(a){a._.x=a.z+a.parent.m,a.m+=a.parent.m}function e(a,b,c){if(b){for(var d,e=a,f=a,g=b,i=e.parent.children[0],j=e.m,k=f.m,l=g.m,m=i.m;g=Af(g),e=zf(e),g&&e;)i=zf(i),f=Af(f),f.a=a,d=g.z+l-e.z-j+h(g._,e._),d>0&&(Bf(Df(g,a,c),a,d),j+=d,k+=d),l+=g.m,j+=e.m,m+=i.m,k+=f.m;g&&!Af(f)&&(f.t=g,f.m+=l-k),e&&!zf(i)&&(i.t=e,i.m+=j-m,c=a)}return c}function f(a){a.x*=i[0],a.y=a.depth*i[1]}var g=Wg.layout.hierarchy().sort(null).value(null),h=yf,i=[1,1],j=null;return a.separation=function(b){return arguments.length?(h=b,a):h},a.size=function(b){return arguments.length?(j=null==(i=b)?f:null,a):j?null:i},a.nodeSize=function(b){return arguments.length?(j=null==(i=b)?null:f,a):j?i:null},Ye(a,g)},Wg.layout.cluster=function(){function a(a,f){var g,h=b.call(this,a,f),i=h[0],j=0;$e(i,function(a){var b=a.children;b&&b.length?(a.x=Ff(b),a.y=Ef(b)):(a.x=g?j+=c(a,g):0,a.y=0,g=a)});var k=Gf(i),l=Hf(i),m=k.x-c(k,l)/2,n=l.x+c(l,k)/2;return $e(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=Wg.layout.hierarchy().sort(null).value(null),c=yf,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},Ye(a,b)},Wg.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=Wg.random.normal.apply(Wg,arguments);return function(){return Math.exp(a())}},bates:function(a){var b=Wg.random.irwinHall(a);return function(){return b()/a}},irwinHall:function(a){return function(){for(var b=0,c=0;a>c;c++)b+=Math.random();return b}}},Wg.scale={};var mj={floor:Bb,ceil:Bb};Wg.scale.linear=function(){return Qf([0,1],[0,1],qe,!1)};var nj={s:1,g:1,p:1,r:1,e:1};Wg.scale.log=function(){return Yf(Wg.scale.linear().domain([0,1]),10,!0,[1,10])};var oj=Wg.format(".0e"),pj={floor:function(a){return-Math.ceil(-a)},ceil:function(a){return-Math.floor(-a)}};Wg.scale.pow=function(){return Zf(Wg.scale.linear(),1,[0,1])},Wg.scale.sqrt=function(){return Wg.scale.pow().exponent(.5)},Wg.scale.ordinal=function(){return _f([],{t:"range",a:[[]]})},Wg.scale.category10=function(){return Wg.scale.ordinal().range(qj)},Wg.scale.category20=function(){return Wg.scale.ordinal().range(rj)},Wg.scale.category20b=function(){return Wg.scale.ordinal().range(sj)},Wg.scale.category20c=function(){return Wg.scale.ordinal().range(tj)};var qj=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(rb),rj=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(rb),sj=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(rb),tj=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(rb);Wg.scale.quantile=function(){return ag([],[])},Wg.scale.quantize=function(){return bg(0,1,[0,1])},Wg.scale.threshold=function(){return cg([.5],[0,1])},Wg.scale.identity=function(){return dg([0,1])},Wg.svg={},Wg.svg.arc=function(){function a(){var a=b.apply(this,arguments),f=c.apply(this,arguments),g=d.apply(this,arguments)+uj,h=e.apply(this,arguments)+uj,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>=vj?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=eg,c=fg,d=gg,e=hg;return a.innerRadius=function(c){return arguments.length?(b=Ab(c),a):b},a.outerRadius=function(b){return arguments.length?(c=Ab(b),a):c},a.startAngle=function(b){return arguments.length?(d=Ab(b),a):d},a.endAngle=function(b){return arguments.length?(e=Ab(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+uj;return[Math.cos(f)*a,Math.sin(f)*a]},a};var uj=-Bh,vj=Ah-Ch;Wg.svg.line=function(){return ig(Bb)};var wj=Wg.map({linear:jg,"linear-closed":kg,step:lg,"step-before":mg,"step-after":ng,basis:tg,"basis-open":ug,"basis-closed":vg,bundle:wg,cardinal:qg,"cardinal-open":og,"cardinal-closed":pg,monotone:Cg});wj.forEach(function(a,b){b.key=a,b.closed=/-closed$/.test(a)});var xj=[0,2/3,1/3,0],yj=[0,1/3,2/3,0],zj=[0,1/6,2/3,1/6];Wg.svg.line.radial=function(){var a=ig(Dg);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},mg.reverse=ng,ng.reverse=mg,Wg.svg.area=function(){return Eg(Bb)},Wg.svg.area.radial=function(){var a=Eg(Dg);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},Wg.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)+uj,k=j.call(a,e,d)+uj;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=rd,g=sd,h=Fg,i=gg,j=hg;return a.radius=function(b){return arguments.length?(h=Ab(b),a):h},a.source=function(b){return arguments.length?(f=Ab(b),a):f},a.target=function(b){return arguments.length?(g=Ab(b),a):g},a.startAngle=function(b){return arguments.length?(i=Ab(b),a):i},a.endAngle=function(b){return arguments.length?(j=Ab(b),a):j},a},Wg.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=rd,c=sd,d=Gg;return a.source=function(c){return arguments.length?(b=Ab(c),a):b},a.target=function(b){return arguments.length?(c=Ab(b),a):c},a.projection=function(b){return arguments.length?(d=b,a):d},a},Wg.svg.diagonal.radial=function(){var a=Wg.svg.diagonal(),b=Gg,c=a.projection;return a.projection=function(a){return arguments.length?c(Hg(b=a)):b},a},Wg.svg.symbol=function(){function a(a,d){return(Aj.get(b.call(this,a,d))||Kg)(c.call(this,a,d))}var b=Jg,c=Ig;return a.type=function(c){return arguments.length?(b=Ab(c),a):b},a.size=function(b){return arguments.length?(c=Ab(b),a):c},a};var Aj=Wg.map({circle:Kg,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*Ej)),c=b*Ej;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/Dj),c=b*Dj/2;return"M0,"+c+"L"+b+","+-c+" "+-b+","+-c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/Dj),c=b*Dj/2;return"M0,"+-c+"L"+b+","+c+" "+-b+","+c+"Z"}});Wg.svg.symbolTypes=Aj.keys();var Bj,Cj,Dj=Math.sqrt(3),Ej=Math.tan(30*Eh),Fj=[],Gj=0;Fj.call=sh.call,Fj.empty=sh.empty,Fj.node=sh.node,Fj.size=sh.size,Wg.transition=function(a){return arguments.length?Bj?a.transition():a:vh.transition()},Wg.transition.prototype=Fj,Fj.select=function(a){var b,c,d,e=this.id,f=[];a=w(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,f)&&b.push(d)}return Lg(e,this.id)},Fj.tween=function(a,b){var c=this.id;return arguments.length<2?this.node().__transition__[c].tween.get(a):K(this,null==b?function(b){b.__transition__[c].tween.remove(a)}:function(d){d.__transition__[c].tween.set(a,b)})},Fj.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?Ne:qe,h=Wg.ns.qualify(a);return Mg(this,"attr."+a,b,h.local?f:e)},Fj.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=Wg.ns.qualify(a);return this.tween("attr."+a,e.local?d:c)},Fj.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=qe(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 Mg(this,"style."+a,b,e)},Fj.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)},Fj.text=function(a){return Mg(this,"text",a,Ng)},Fj.remove=function(){return this.each("end.transition",function(){var a;this.__transition__.count<2&&(a=this.parentNode)&&a.removeChild(this)})},Fj.ease=function(a){var b=this.id;return arguments.length<1?this.node().__transition__[b].ease:("function"!=typeof a&&(a=Wg.ease.apply(Wg,arguments)),K(this,function(c){c.__transition__[b].ease=a}))},Fj.delay=function(a){var b=this.id;return arguments.length<1?this.node().__transition__[b].delay:K(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}))},Fj.duration=function(a){var b=this.id;return arguments.length<1?this.node().__transition__[b].duration:K(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}))},Fj.each=function(a,b){var c=this.id;if(arguments.length<2){var d=Cj,e=Bj;Bj=c,K(this,function(b,d,e){Cj=b.__transition__[c],a.call(b,b.__data__,d,e)}),Cj=d,Bj=e}else K(this,function(d){var e=d.__transition__[c];(e.event||(e.event=Wg.dispatch("start","end"))).on(a,b)});return this},Fj.transition=function(){for(var a,b,c,d,e=this.id,f=++Gj,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,Og(c,j,f,d)),a.push(c)}return Lg(g,f)},Wg.svg.axis=function(){function a(a){a.each(function(){var a,j=Wg.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):Bb:b,o=j.selectAll(".tick").data(m,l),p=o.enter().insert("g",".domain").attr("class","tick").style("opacity",Ch),q=Wg.transition(o.exit()).style("opacity",Ch).remove(),r=Wg.transition(o.order()).style("opacity",1),s=Lf(l),t=j.selectAll(".domain").data([0]),u=(t.enter().append("path").attr("class","domain"),Wg.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=Pg,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=Pg,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=Qg,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=Qg,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,B=A.rangeBand()/2;k=l=function(a){return A(a)+B}}else k.rangeBand?k=l:q.call(a,l);p.call(a,k),r.call(a,l)})}var b,c=Wg.scale.linear(),d=Hj,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 Ij?b+"":Hj,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 Hj="bottom",Ij={top:1,right:1,bottom:1,left:1};Wg.svg.brush=function(){function a(f){f.each(function(){var f=Wg.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(o,Bb);h.exit().remove(),h.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return Jj[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=Wg.transition(f),m=Wg.transition(g);i&&(k=Lf(i),m.attr("x",k[0]).attr("width",k[1]-k[0]),c(l)),j&&(k=Lf(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)]+","+l[+/^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",l[0]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function e(){function e(){32==Wg.event.keyCode&&(C||(t=null,E[0]-=k[1],E[1]-=l[1],C=2),s())}function o(){32==Wg.event.keyCode&&2==C&&(E[0]+=k[1],E[1]+=l[1],C=0,s())}function p(){var a=Wg.mouse(v),e=!1;u&&(a[0]+=u[0],a[1]+=u[1]),C||(Wg.event.altKey?(t||(t=[(k[0]+k[1])/2,(l[0]+l[1])/2]),E[0]=k[+(a[0]o?(e=d,d=o):e=o),p[0]!=d||p[1]!=e?(c?g=null:f=null,p[0]=d,p[1]=e,!0):void 0}function r(){p(),y.style("pointer-events","all").selectAll(".resize").style("display",a.empty()?"none":null),Wg.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=Wg.select(Wg.event.target),x=h.of(v,arguments),y=Wg.select(v),z=w.datum(),A=!/^(n|s)$/.test(z)&&i,B=!/^(e|w)$/.test(z)&&j,C=w.classed("extent"),D=R(),E=Wg.mouse(v),F=Wg.select(_g).on("keydown.brush",e).on("keyup.brush",o);if(Wg.event.changedTouches?F.on("touchmove.brush",p).on("touchend.brush",r):F.on("mousemove.brush",p).on("mouseup.brush",r),y.interrupt().selectAll("*").interrupt(),C)E[0]=k[0]-E[0],E[1]=l[0]-E[1];else if(z){var G=+/w$/.test(z),H=+/^n/.test(z);u=[k[1-G]-E[0],l[1-H]-E[1]],E[0]=k[G],E[1]=l[H]}else Wg.event.altKey&&(t=E.slice());y.style("pointer-events","none").selectAll(".resize").style("display",null),Wg.select("body").style("cursor",w.style("cursor")),x({type:"brushstart"}),p()}var f,g,h=u(a,"brushstart","brush","brushend"),i=null,j=null,k=[0,0],l=[0,0],m=!0,n=!0,o=Kj[0];return a.event=function(a){a.each(function(){var a=h.of(this,arguments),b={x:k,y:l,i:f,j:g},c=this.__chart__||b;this.__chart__=b,Bj?Wg.select(this).transition().each("start.brush",function(){f=c.i,g=c.j,k=c.x,l=c.y,a({type:"brushstart"})}).tween("brush:brush",function(){var c=re(k,b.x),d=re(l,b.y);return f=g=null,function(e){k=b.x=c(e),l=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,o=Kj[!i<<1|!j],a):i},a.y=function(b){return arguments.length?(j=b,o=Kj[!i<<1|!j],a):j},a.clamp=function(b){return arguments.length?(i&&j?(m=!!b[0],n=!!b[1]):i?m=!!b:j&&(n=!!b),a):i&&j?[m,n]:i?m:j?n:null},a.extent=function(b){var c,d,e,h,m;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&&(m=c,c=d,d=m),(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&&(m=e,e=h,h=m),(e!=l[0]||h!=l[1])&&(l=[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&&(m=c,c=d,d=m))),j&&(g?(e=g[0],h=g[1]):(e=l[0],h=l[1],j.invert&&(e=j.invert(e),h=j.invert(h)),e>h&&(m=e,e=h,h=m))),i&&j?[[c,e],[d,h]]:i?[c,d]:j&&[e,h])},a.clear=function(){return a.empty()||(k=[0,0],l=[0,0],f=g=null),a},a.empty=function(){return!!i&&k[0]==k[1]||!!j&&l[0]==l[1]},Wg.rebind(a,h,"on")};var Jj={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Kj=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Lj=ci.format=ii.timeFormat,Mj=Lj.utc,Nj=Mj("%Y-%m-%dT%H:%M:%S.%LZ");Lj.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Rg:Nj,Rg.parse=function(a){var b=new Date(a);return isNaN(b)?null:b},Rg.toString=Nj.toString,ci.second=Nb(function(a){return new di(1e3*Math.floor(a/1e3))},function(a,b){a.setTime(a.getTime()+1e3*Math.floor(b))},function(a){return a.getSeconds()}),ci.seconds=ci.second.range,ci.seconds.utc=ci.second.utc.range,ci.minute=Nb(function(a){return new di(6e4*Math.floor(a/6e4))},function(a,b){a.setTime(a.getTime()+6e4*Math.floor(b))},function(a){return a.getMinutes()}),ci.minutes=ci.minute.range,ci.minutes.utc=ci.minute.utc.range,ci.hour=Nb(function(a){var b=a.getTimezoneOffset()/60;return new di(36e5*(Math.floor(a/36e5-b)+b))},function(a,b){a.setTime(a.getTime()+36e5*Math.floor(b))},function(a){return a.getHours()}),ci.hours=ci.hour.range,ci.hours.utc=ci.hour.utc.range,ci.month=Nb(function(a){return a=ci.day(a),a.setDate(1),a},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()}),ci.months=ci.month.range,ci.months.utc=ci.month.utc.range;var Oj=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Pj=[[ci.second,1],[ci.second,5],[ci.second,15],[ci.second,30],[ci.minute,1],[ci.minute,5],[ci.minute,15],[ci.minute,30],[ci.hour,1],[ci.hour,3],[ci.hour,6],[ci.hour,12],[ci.day,1],[ci.day,2],[ci.week,1],[ci.month,1],[ci.month,3],[ci.year,1]],Qj=Lj.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%a %d",function(a){return a.getDay()&&1!=a.getDate()}],["%b %d",function(a){return 1!=a.getDate()}],["%B",function(a){return a.getMonth()}],["%Y",Bc]]),Rj={range:function(a,b,c){return Wg.range(Math.ceil(a/c)*c,+b,c).map(Tg)},floor:Bb,ceil:Bb};Pj.year=ci.year,ci.scale=function(){return Sg(Wg.scale.linear(),Pj,Qj)};var Sj=Pj.map(function(a){return[a[0].utc,a[1]]}),Tj=Mj.multi([[".%L",function(a){return a.getUTCMilliseconds()}],[":%S",function(a){return a.getUTCSeconds()}],["%I:%M",function(a){return a.getUTCMinutes()}],["%I %p",function(a){return a.getUTCHours()}],["%a %d",function(a){return a.getUTCDay()&&1!=a.getUTCDate()}],["%b %d",function(a){return 1!=a.getUTCDate()}],["%B",function(a){return a.getUTCMonth()}],["%Y",Bc]]);Sj.year=ci.year.utc,ci.scale.utc=function(){return Sg(Wg.scale.linear(),Sj,Tj)},Wg.text=Cb(function(a){return a.responseText}),Wg.json=function(a,b){return Db(a,"application/json",Ug,b)},Wg.html=function(a,b){return Db(a,"text/html",Vg,b)},Wg.xml=Cb(function(a){return a.responseXML}),"function"==typeof define&&define.amd?define(Wg):"object"==typeof module&&module.exports?module.exports=Wg:this.d3=Wg}(),function(a,b){"function"==typeof define&&define.amd?define(["d3"],b):a.d3.tip=b(a.d3)}(this,function(a){return function(){function b(a){u=o(a),v=u.createSVGPoint(),document.body.appendChild(t)}function c(){return"n"}function d(){return[0,0]}function e(){return" "}function f(){var a=p();return{top:a.n.y-t.offsetHeight,left:a.n.x-t.offsetWidth/2}}function g(){var a=p();return{top:a.s.y,left:a.s.x-t.offsetWidth/2}}function h(){var a=p();return{top:a.e.y-t.offsetHeight/2,left:a.e.x}}function i(){var a=p();return{top:a.w.y-t.offsetHeight/2,left:a.w.x-t.offsetWidth}}function j(){var a=p();return{top:a.nw.y-t.offsetHeight,left:a.nw.x-t.offsetWidth}}function k(){var a=p();return{top:a.ne.y-t.offsetHeight,left:a.ne.x}}function l(){var a=p();return{top:a.sw.y,left:a.sw.x-t.offsetWidth}}function m(){var a=p();return{top:a.se.y,left:a.e.x}}function n(){var b=a.select(document.createElement("div"));return b.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),b.node()}function o(a){return a=a.node(),"svg"==a.tagName.toLowerCase()?a:a.ownerSVGElement}function p(){var b=w||a.event.target,c={},d=b.getScreenCTM(),e=b.getBBox(),f=e.width,g=e.height,h=e.x,i=e.y;return v.x=h,v.y=i,c.nw=v.matrixTransform(d),v.x+=f,c.ne=v.matrixTransform(d),v.y+=g,c.se=v.matrixTransform(d),v.x-=f,c.sw=v.matrixTransform(d),v.y-=g/2,c.w=v.matrixTransform(d),v.x+=f,c.e=v.matrixTransform(d),v.x-=f/2,v.y-=g/2,c.n=v.matrixTransform(d),v.y+=g,c.s=v.matrixTransform(d),c}var q=c,r=d,s=e,t=n(),u=null,v=null,w=null;b.show=function(){var c=Array.prototype.slice.call(arguments);c[c.length-1]instanceof SVGElement&&(w=c.pop());var d,e=s.apply(this,c),f=r.apply(this,c),g=q.apply(this,c),h=a.select(t),i=y.length,j=document.documentElement.scrollTop||document.body.scrollTop,k=document.documentElement.scrollLeft||document.body.scrollLeft;for(h.html(e).style({opacity:1,"pointer-events":"all"});i--;)h.classed(y[i],!1);return d=x.get(g).apply(this),h.classed(g,!0).style({top:d.top+f[0]+j+"px",left:d.left+f[1]+k+"px"}),b},b.hide=function(){return nodel=a.select(t),nodel.style({opacity:0,"pointer-events":"none"}),b},b.attr=function(c){if(arguments.length<2&&"string"==typeof c)return a.select(t).attr(c);var d=Array.prototype.slice.call(arguments);return a.selection.prototype.attr.apply(a.select(t),d),b},b.style=function(c){if(arguments.length<2&&"string"==typeof c)return a.select(t).style(c);var d=Array.prototype.slice.call(arguments);return a.selection.prototype.style.apply(a.select(t),d),b},b.direction=function(c){return arguments.length?(q=null==c?c:a.functor(c),b):q},b.offset=function(c){return arguments.length?(r=null==c?c:a.functor(c),b):r},b.html=function(c){return arguments.length?(s=null==c?c:a.functor(c),b):s};var x=a.map({n:f,s:g,e:h,w:i,nw:j,ne:k,sw:l,se:m}),y=x.keys();return b}}),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){for(var c=a.criteria,d=b.criteria,e=-1,f=c.length;++eh||"undefined"==typeof g)return 1;if(h>g||"undefined"==typeof h)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});return e.pop(),f.pop(),s&&(j(e),j(f)),g}function cb(a,b,c,d,e){(Zd(b)?Yb:he)(b,function(b,f){var g,h,i=b,j=a[f];if(b&&((h=Zd(b))||ie(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?Zd(j)?j:[]:ie(j)?j:{}),d.push(b),e.push(j),l||cb(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 db(a,b){return a+Ed(Vd()*(b-a+1))}function eb(c,d,e){var g=-1,i=ib(),l=c?c.length:0,m=[],n=!d&&l>=s&&i===a,o=e||n?h():m;if(n){var p=f(o);i=b,o=p}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?Sd(0,f+c):c)||0,Zd(a)?g=e(a,b,c)>-1:"number"==typeof f?g=(Jb(a)?a.indexOf(b,c):e(a,b,c))>-1:he(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&&Jb(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&&Zd(a))for(var g=-1,h=a.length;++gi&&(f=i)}else b=null==b&&Jb(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,c,d){if(!a)return c;var e=arguments.length<3;b=o.createCallback(b,d,4);var f=-1,g=a.length;if("number"==typeof g)for(e&&(c=a[++f]);++fd?Sd(0,e+d):d||0}else if(d){var f=Ac(b,c);return b[f]===c?f:-1}return a(b,c,d)}function sc(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,Td(Sd(0,e-d),e))}function tc(){for(var c=[],d=-1,e=arguments.length,g=h(),i=ib(),l=i===a,m=h();++d=s&&f(d?c[d]:m)))}var o=c[0],p=-1,q=o?o.length:0,r=[];a:for(;++pc?Sd(0,d+c):Td(c,d-1))+1);d--;)if(a[d]===b)return d;return-1}function wc(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(me(a,"length")):0,d=nd(0>c?0:c);++b2?gb(a,17,l(arguments,2),null,b):gb(a,1,null,null,b)}function Jc(a){for(var b=arguments.length>1?ab(arguments,!0,!1,1):ub(a),c=-1,d=b.length;++c2?gb(b,19,l(arguments,2),null,a):gb(b,3,null,null,a)}function Lc(){for(var a=arguments,b=a.length;b--;)if(!Db(a[b]))throw new wd;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}}function Mc(a,b){return b="number"==typeof b?b:+b||a.length,gb(a,4,null,null,null,b)}function Nc(a,b,c){var d,e,f,g,h,i,j,k=0,l=!1,m=!0;if(!Db(a))throw new wd;if(b=Sd(0,b)||0,c===!0){var o=!0;m=!1}else Eb(c)&&(o=c.leading,l="maxWait"in c&&(Sd(b,c.maxWait)||0),m="trailing"in c?c.trailing:m);var p=function(){var c=b-(oe()-g);if(0>=c){e&&Dd(e);var l=j;e=i=j=n,l&&(k=oe(),f=a.apply(h,d),i||e||(d=h=null))}else i=Jd(p,c)},q=function(){i&&Dd(i),e=i=j=n,(m||l!==b)&&(k=oe(),f=a.apply(h,d),i||e||(d=h=null))};return function(){if(d=arguments,g=oe(),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=Dd(e)),k=g,f=a.apply(h,d)):e||(e=Jd(q,n))}return r&&i?i=Dd(i):i||b===l||(i=Jd(p,b)),c&&(r=!0,f=a.apply(h,d)),!r||i||e||(d=h=null),f}}function Oc(a){if(!Db(a))throw new wd;var b=l(arguments,1);return Jd(function(){a.apply(n,b)},1)}function Pc(a,b){if(!Db(a))throw new wd;var c=l(arguments,2);return Jd(function(){a.apply(n,c)},b)}function Qc(a,b){if(!Db(a))throw new wd;var c=function(){var d=c.cache,e=b?b.apply(this,arguments):r+arguments[0];return Hd.call(d,e)?d[e]:d[e]=a.apply(this,arguments)};return c.cache={},c}function Rc(a){var b,c;if(!Db(a))throw new wd;return function(){return b?c:(b=!0,c=a.apply(this,arguments),a=null,c)}}function Sc(a){return gb(a,16,l(arguments,1))}function Tc(a){return gb(a,32,null,l(arguments,1))}function Uc(a,b,c){var d=!0,e=!0;if(!Db(a))throw new wd;return c===!1?d=!1:Eb(c)&&(d="leading"in c?c.leading:d,e="trailing"in c?c.trailing:e),S.leading=d,S.maxWait=b,S.trailing=e,Nc(a,b,S)}function Vc(a,b){return gb(b,16,[a])}function Wc(a){return function(){return a}}function Xc(a,b,c){var d=typeof a;if(null==a||"function"==d)return Y(a,b,c);if("object"!=d)return bd(a);var e=_d(a),f=e[0],g=a[f];return 1!=e.length||g!==g||Eb(g)?function(b){for(var c=e.length,d=!1;c--&&(d=bb(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 Yc(a){return null==a?"":vd(a).replace(de,hb)}function Zc(a){return a}function $c(a,b,c){var d=!0,e=b&&ub(b);b&&(c||e.length)||(null==c&&(c=b),f=p,b=a,a=o,e=ub(b)),c===!1?d=!1:Eb(c)&&"chain"in c&&(d=c.chain);var f=a,g=Db(f);Yb(e,function(c){var e=a[c]=b[c];g&&(f.prototype[c]=function(){var b=this.__chain__,c=this.__wrapped__,g=[c];Id.apply(g,arguments);var h=e.apply(a,g);if(d||b){if(c===h&&Eb(h))return this;h=new f(h),h.__chain__=b}return h})})}function _c(){return c._=zd,this}function ad(){}function bd(a){return function(b){return b[a]}}function cd(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=Vd();return Td(a+f*(b-a+parseFloat("1e-"+((f+"").length-1))),b)}return db(a,b)}function dd(a,b){if(a){var c=a[b];return Db(c)?a[b]():c}}function ed(a,b,c){var d=o.templateSettings;a=vd(a||""),c=fe({},c,d);var e,f=fe({},c.imports,d.imports),h=_d(f),i=Rb(f),j=0,k=c.interpolate||D,l="__p += '",m=ud((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=qd(h,"return "+l+r).apply(n,i)}catch(t){throw t.source=l,t}return b?s(b):(s.source=l,s)}function fd(a,b,c){a=(a=+a)>-1?a:0;var d=-1,e=nd(a);for(b=Y(b,c,1);++d/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:B,variable:"",imports:{_:o}},Nd||(X=function(){function a(){}return function(b){if(Eb(b)){a.prototype=b;var d=new a;a.prototype=null}return d||c.Object()}}());var Yd=Md?function(a,b){T.value=b,Md(a,"__bindData__",T)}:ad,Zd=Od||function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Ad.call(a)==J||!1},$d=function(a){var b,c=a,d=[];if(!c)return d;if(!U[typeof a])return d;for(b in c)Hd.call(c,b)&&d.push(b);return d},_d=Rd?function(a){return Eb(a)?Rd(a):[]}:$d,ae={"&":"&","<":"<",">":">",'"':""","'":"'"},be=wb(ae),ce=ud("("+_d(be).join("|")+")","g"),de=ud("["+_d(ae).join("")+"]","g"),ee=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","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||j.defaults,this.rules=k.normal,this.options.gfm&&(this.rules=this.options.tables?k.tables:k.gfm)}function b(a,b){if(this.options=b||j.defaults,this.links=a,this.rules=l.normal,this.renderer=this.options.renderer||new c,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?l.breaks:l.gfm:this.options.pedantic&&(this.rules=l.pedantic)}function c(a){this.options=a||{}}function d(a){this.tokens=[],this.token=null,this.options=a||j.defaults,this.options.renderer=this.options.renderer||new c,this.renderer=this.options.renderer,this.renderer.options=this.options}function e(a,b){return a.replace(b?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function f(a){return a.replace(/&([#\w]+);/g,function(a,b){return b=b.toLowerCase(),"colon"===b?":":"#"===b.charAt(0)?String.fromCharCode("x"===b.charAt(1)?parseInt(b.substring(2),16):+b.substring(1)):""})}function g(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 h(){}function i(a){for(var b,c,d=1;dAn error occured:

"+e(m.message+"",!0)+"
";throw m}}var k={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:h,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:h,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:h,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};k.bullet=/(?:[*+-]|\d+\.)/,k.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,k.item=g(k.item,"gm")(/bull/g,k.bullet)(),k.list=g(k.list)(/bull/g,k.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+k.def.source+")")(),k.blockquote=g(k.blockquote)("def",k.def)(),k._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+(?!:/|[^\\w\\s@]*@)\\b",k.html=g(k.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,k._tag)(),k.paragraph=g(k.paragraph)("hr",k.hr)("heading",k.heading)("lheading",k.lheading)("blockquote",k.blockquote)("tag","<"+k._tag)("def",k.def)(),k.normal=i({},k),k.gfm=i({},k.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/}),k.gfm.paragraph=g(k.paragraph)("(?!","(?!"+k.gfm.fences.source.replace("\\1","\\2")+"|"+k.list.source.replace("\\1","\\3")+"|")(),k.tables=i({},k.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),a.rules=k,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,c){for(var d,e,f,g,h,i,j,l,m,a=a.replace(/^ +$/gm,"");a;)if((f=this.rules.newline.exec(a))&&(a=a.substring(f[0].length),f[0].length>1&&this.tokens.push({type:"space"})),f=this.rules.code.exec(a))a=a.substring(f[0].length),f=f[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?f:f.replace(/\n+$/,"")});else if(f=this.rules.fences.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"code",lang:f[2],text:f[3]});else if(f=this.rules.heading.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"heading",depth:f[1].length,text:f[2]});else if(b&&(f=this.rules.nptable.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/\n$/,"").split("\n")},l=0;l ?/gm,""),this.token(f,b,!0),this.tokens.push({type:"blockquote_end"});else if(f=this.rules.list.exec(a)){for(a=a.substring(f[0].length),g=f[2],this.tokens.push({type:"list_start",ordered:g.length>1}),f=f[0].match(this.rules.item),d=!1,m=f.length,l=0;m>l;l++)i=f[l],j=i.length,i=i.replace(/^ *([*+-]|\d+\.) +/,""),~i.indexOf("\n ")&&(j-=i.length,i=this.options.pedantic?i.replace(/^ {1,4}/gm,""):i.replace(new RegExp("^ {1,"+j+"}","gm"),"")),this.options.smartLists&&l!==m-1&&(h=k.bullet.exec(f[l+1])[0],g===h||g.length>1&&h.length>1||(a=f.slice(l+1).join("\n")+a,l=m-1)),e=d||/\n\n(?!\s*$)/.test(i),l!==m-1&&(d="\n"===i.charAt(i.length-1),e||(e=d)),this.tokens.push({type:e?"loose_item_start":"list_item_start"}),this.token(i,!1,c),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(f=this.rules.html.exec(a))a=a.substring(f[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===f[1]||"script"===f[1]||"style"===f[1],text:f[0]});else if(!c&&b&&(f=this.rules.def.exec(a)))a=a.substring(f[0].length),this.tokens.links[f[1].toLowerCase()]={href:f[2],title:f[3]};else if(b&&(f=this.rules.table.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/(?: *\| *)?\n$/,"").split("\n")},l=0;l])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:h,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:h,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,l.link=g(l.link)("inside",l._inside)("href",l._href)(),l.reflink=g(l.reflink)("inside",l._inside)(),l.normal=i({},l),l.pedantic=i({},l.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),l.gfm=i({},l.normal,{escape:g(l.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:g(l.text)("]|","~]|")("|","|https?://|")()}),l.breaks=i({},l.gfm,{br:g(l.br)("{2,}","*")(),text:g(l.gfm.text)("{2,}","*")()}),b.rules=l,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,d,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=this.mangle(":"===f[1].charAt(6)?f[1].substring(7):f[1]),d=this.mangle("mailto:")+c):(c=e(f[1]),d=c),g+=this.renderer.link(d,null,c);else if(this.inLink||!(f=this.rules.url.exec(a))){if(f=this.rules.tag.exec(a))!this.inLink&&/^/i.test(f[0])&&(this.inLink=!1),a=a.substring(f[0].length),g+=this.options.sanitize?e(f[0]):f[0];else if(f=this.rules.link.exec(a))a=a.substring(f[0].length),this.inLink=!0,g+=this.outputLink(f,{href:f[2],title:f[3]}),this.inLink=!1;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}this.inLink=!0,g+=this.outputLink(f,b),this.inLink=!1}else if(f=this.rules.strong.exec(a))a=a.substring(f[0].length),g+=this.renderer.strong(this.output(f[2]||f[1]));else if(f=this.rules.em.exec(a))a=a.substring(f[0].length),g+=this.renderer.em(this.output(f[2]||f[1]));else if(f=this.rules.code.exec(a))a=a.substring(f[0].length),g+=this.renderer.codespan(e(f[2],!0));else if(f=this.rules.br.exec(a))a=a.substring(f[0].length),g+=this.renderer.br();else if(f=this.rules.del.exec(a))a=a.substring(f[0].length),g+=this.renderer.del(this.output(f[1]));else if(f=this.rules.text.exec(a))a=a.substring(f[0].length),g+=e(this.smartypants(f[0]));else if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0))}else a=a.substring(f[0].length),c=e(f[1]),d=c,g+=this.renderer.link(d,null,c);return g},b.prototype.outputLink=function(a,b){var c=e(b.href),d=b.title?e(b.title):null;return"!"!==a[0].charAt(0)?this.renderer.link(c,d,this.output(a[1])):this.renderer.image(c,d,e(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.prototype.code=function(a,b,c){if(this.options.highlight){var d=this.options.highlight(a,b);null!=d&&d!==a&&(c=!0,a=d)}return b?'
'+(c?a:e(a,!0))+"\n
\n":"
"+(c?a:e(a,!0))+"\n
"},c.prototype.blockquote=function(a){return"
\n"+a+"
\n"},c.prototype.html=function(a){return a},c.prototype.heading=function(a,b,c){return"'+a+"\n"},c.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},c.prototype.list=function(a,b){var c=b?"ol":"ul";return"<"+c+">\n"+a+"\n"},c.prototype.listitem=function(a){return"
  • "+a+"
  • \n"},c.prototype.paragraph=function(a){return"

    "+a+"

    \n"},c.prototype.table=function(a,b){return"\n\n"+a+"\n\n"+b+"\n
    \n"},c.prototype.tablerow=function(a){return"\n"+a+"\n"},c.prototype.tablecell=function(a,b){var c=b.header?"th":"td",d=b.align?"<"+c+' style="text-align:'+b.align+'">':"<"+c+">";return d+a+"\n"},c.prototype.strong=function(a){return""+a+""},c.prototype.em=function(a){return""+a+""},c.prototype.codespan=function(a){return""+a+""},c.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},c.prototype.del=function(a){return""+a+""},c.prototype.link=function(a,b,c){if(this.options.sanitize){try{var d=decodeURIComponent(f(a)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===d.indexOf("javascript:"))return""}var g='
    "},c.prototype.image=function(a,b,c){var d=''+c+'":">"},d.parse=function(a,b,c){var e=new d(b,c);return e.parse(a)},d.prototype.parse=function(a){this.inline=new b(a.links,this.options,this.renderer),this.tokens=a.reverse();for(var c="";this.next();)c+=this.tok();return c},d.prototype.next=function(){return this.token=this.tokens.pop()},d.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},d.prototype.parseText=function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;return this.inline.output(a)},d.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var a,b,c,d,e,f="",g="";for(c="",a=0;ad;++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("component-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)null!=a[c]&&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.req=a,this.xhr=this.req.xhr,this.text=this.xhr.responseText,this.setStatusProperties(this.xhr.status),this.header=this.headers=j(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text):null}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.on("end",function(){var b=new m(c);"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",xml:"application/xml",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=this.req,b=a.method,c=a.url,d="cannot "+b+" "+c+" ("+this.status+")",e=new Error(d);return e.status=this.status,e.method=b,e.url=c,e},o.Response=m,p(n.prototype),n.prototype.use=function(a){return a(this),this},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.accept=function(a){return this.set("Accept",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.field=function(a,b){return this._formData||(this._formData=new FormData),this._formData.append(a,b),this},n.prototype.attach=function(a,b,c){return this._formData||(this._formData=new FormData),this._formData.append(a,b,c),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):void c(b)},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._formData||this._data;if(this._callback=a||d,c.onreadystatechange=function(){return 4==c.readyState?0==c.status?b.aborted?b.timeoutError():b.crossDomainError():void b.emit("end"):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),this._withCredentials&&(c.withCredentials=!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 this.emit("request",this),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-reduce/index.js","superagent/deps/reduce/index.js"),a.alias("component-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?c(null!=(null!=b&&null!=(e=b.body)?e.message:void 0)?b.body.message: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('
    ')}).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 "),c.push(1===a?"\n 1 point left\n ":"\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 +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 \n

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

    \n \n

    You can choose a specific milestone by its number: #!/radekstepan/disposable/1.

    \n\n

    To get the milestone number, fetch all your milestones using GitHub API.

    \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 "),c.push(1===a?"\n 1 point left\n ":"\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 aa91d9d..77c1984 100644 --- a/build/app.js +++ b/build/app.js @@ -1116,7 +1116,7 @@ } (function() { (function() { - __out.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
    '); + __out.push('
    \n

    GitHub Burndown Chart

    \n \n

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

    \n \n

    You can choose a specific milestone by its number: #!/radekstepan/disposable/1.

    \n\n

    To get the milestone number, fetch all your milestones using GitHub API.

    \n
    '); }).call(this); diff --git a/build/app.min.js b/build/app.min.js index 6644577..126b78e 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")},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?c(null!=(null!=b&&null!=(e=b.body)?e.message:void 0)?b.body.message: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 "),c.push(1===a?"\n 1 point left\n ":"\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?c(null!=(null!=b&&null!=(e=b.body)?e.message:void 0)?b.body.message: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 \n

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

    \n \n

    You can choose a specific milestone by its number: #!/radekstepan/disposable/1.

    \n\n

    To get the milestone number, fetch all your milestones using GitHub API.

    \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 "),c.push(1===a?"\n 1 point left\n ":"\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/src/templates/info.eco b/src/templates/info.eco index 84ed654..21e61aa 100644 --- a/src/templates/info.eco +++ b/src/templates/info.eco @@ -1,5 +1,9 @@

    GitHub Burndown Chart

    +

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

    -

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

    + +

    You can choose a specific milestone by its number: #!/radekstepan/disposable/1.

    + +

    To get the milestone number, fetch all your milestones using GitHub API.

    \ No newline at end of file