diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 7aab3ca..56db039 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -48,6 +48,13 @@ module.exports = (grunt) -> 'public/css/app.min.css': 'public/css/app.css' 'public/css/app.bundle.min.css': 'public/css/app.bundle.css' + 'watch': + css: + files: [ 'src/styles/**/*.styl' ] + tasks: [ 'stylus', 'concat' ] + options: + spawn: no + 'gh-pages': options: base: 'public' @@ -68,7 +75,8 @@ module.exports = (grunt) -> grunt.loadNpmTasks('grunt-contrib-concat') grunt.loadNpmTasks('grunt-contrib-uglify') grunt.loadNpmTasks('grunt-contrib-cssmin') - grunt.loadNpmTasks('grunt-gh-pages'); + grunt.loadNpmTasks('grunt-contrib-watch') + grunt.loadNpmTasks('grunt-gh-pages') # Stylus to CSS, concat all CSS. grunt.registerTask('css', [ diff --git a/Makefile b/Makefile index 868955b..a97f554 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,53 @@ +BROWSERIFY = ./node_modules/.bin/browserify +WATCH = ./node_modules/.bin/watchify +SERVER = ./node_modules/.bin/static +MOCHA = ./node_modules/.bin/mocha +COVERALLS = ./node_modules/.bin/coveralls +GRUNT = grunt + # Install dependencies. install: npm install -# Watch the app sources and build with source maps. watch: - ./node_modules/.bin/watchify -e ./src/app.coffee -o public/js/app.bundle.js -d -v + $(MAKE) watch-js & $(MAKE) watch-css + +# Watch the app. +watch-js: + $(WATCH) -e ./src/app.coffee -o public/js/app.bundle.js -d -v + +# Watch the styles. +watch-css: + $(GRUNT) watch # Serve locally. serve: - ./node_modules/.bin/static public -H '{"Cache-Control": "no-cache, must-revalidate"}' + $(SERVER) public -H '{"Cache-Control": "no-cache, must-revalidate"}' # Make a minified package. build: - grunt init - ./node_modules/.bin/browserify -e ./src/app.coffee -o public/js/app.bundle.js - grunt css - grunt minify + $(GRUNT) init + $(BROWSERIFY) -e ./src/app.coffee -o public/js/app.bundle.js + $(GRUNT) css + $(GRUNT) minify # Publish to GitHub Pages. publish: - grunt gh-pages + $(GRUNT) gh-pages + +OPTS = --compilers coffee:coffee-script/register --ui exports --timeout 20000 --slow 15000 --bail # Run mocha test. test: - ./node_modules/.bin/mocha --compilers coffee:coffee-script/register --reporter spec --ui exports --timeout 20000 --slow 15000 --bail + REPORTER = spec + $(MOCHA) $(OPTS) --reporter $(REPORTER) + +# Run code coverage. +coverage: + $(MOCHA) $(OPTS) --reporter $(REPORTER) --require blanket > docs/COVERAGE.html + +# Run code coverage and publish to coveralls. +coveralls: + $(MOCHA) $(OPTS) --reporter $(REPORTER) --require blanket | COVERALLS_SERVICE_NAME=MOCHA $(COVERALLS) .PHONY: test \ No newline at end of file diff --git a/README.md b/README.md index 38b1e3e..3ef0633 100644 --- a/README.md +++ b/README.md @@ -3,5 +3,6 @@ GitHub Burndown Chart as a service. Answers the question "are my projects on track"? [![Build Status](http://img.shields.io/codeship/.svg?style=flat)]() +[![Coverage](http://img.shields.io/coveralls/radekstepan/burnchart/assembly.svg?style=flat)]() [![Dependencies](http://img.shields.io/david/radekstepan/burnchart.svg?style=flat)](https://david-dm.org/radekstepan/burnchart) [![License](http://img.shields.io/badge/license-AGPL--3.0-red.svg?style=flat)](LICENSE) \ No newline at end of file diff --git a/docs/COVERAGE.html b/docs/COVERAGE.html new file mode 100644 index 0000000..92284dd --- /dev/null +++ b/docs/COVERAGE.html @@ -0,0 +1,355 @@ +Coverage + +

Coverage

32%
469
153
316

/home/radek/dev/burnchart/src/models/config.coffee

100%
4
4
0
LineHitsSource
11(function() {
21 var Model;
3
41 Model = require('../utils/ractive/model.coffee');
5
61 module.exports = new Model({
7 'name': 'models/config',
8 "data": {
9 "firebase": "burnchart",
10 "provider": "github",
11 "fields": {
12 "milestone": ["closed_issues", "created_at", "description", "due_on", "number", "open_issues", "title", "updated_at"]
13 },
14 "chart": {
15 "off_days": [],
16 "datetime": /^(\d{4}-\d{2}-\d{2})T(.*)/,
17 "size_label": /^size (\d+)$/,
18 "location": /^#!((\/[^\/]+){2,3})$/,
19 "points": 'ONE_SIZE'
20 }
21 }
22 });
23
24}).call(this);
25

/home/radek/dev/burnchart/src/models/projects.coffee

13%
122
16
106
LineHitsSource
11(function() {
21 var Model, config, lscache, semver, sortedIndex, stats, user, _,
3 __slice = [].slice;
4
51 _ = require('lodash');
6
71 lscache = require('lscache');
8
91 sortedIndex = require('sortedindex-compare');
10
111 semver = require('semver');
12
131 Model = require('../utils/ractive/model.coffee');
14
151 config = require('../models/config.coffee');
16
171 stats = require('../modules/stats.coffee');
18
191 user = require('./user.coffee');
20
211 module.exports = new Model({
22 'name': 'models/projects',
23 'data': {
24 'sortBy': 'priority',
25 'sortFns': ['progress', 'priority', 'name']
26 },
27 comparator: function() {
280 var deIdx, defaults, list, sortBy, _ref;
290 _ref = this.data, list = _ref.list, sortBy = _ref.sortBy;
300 deIdx = (function(_this) {
310 return function(fn) {
320 return function() {
330 var i, j, rest, _arg;
340 _arg = arguments[0], rest = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
350 i = _arg[0], j = _arg[1];
360 return fn.apply(_this, [[list[i], list[i].milestones[j]]].concat(rest));
37 };
38 };
39 })(this);
400 defaults = function(arr, hash) {
410 var i, item, k, keys, p, ref, v, _i, _len, _results;
420 _results = [];
430 for (_i = 0, _len = arr.length; _i < _len; _i++) {
440 item = arr[_i];
450 _results.push((function() {
460 var _results1;
470 _results1 = [];
480 for (k in hash) {
490 v = hash[k];
500 ref = item;
510 _results1.push((function() {
520 var _j, _len1, _ref1, _results2;
530 _ref1 = keys = k.split('.');
540 _results2 = [];
550 for (i = _j = 0, _len1 = _ref1.length; _j < _len1; i = ++_j) {
560 p = _ref1[i];
570 if (i === keys.length - 1) {
580 _results2.push(ref[p] != null ? ref[p] : ref[p] = v);
59 } else {
600 _results2.push(ref = ref[p] != null ? ref[p] : ref[p] = {});
61 }
62 }
630 return _results2;
64 })());
65 }
660 return _results1;
67 })());
68 }
690 return _results;
70 };
710 switch (sortBy) {
72 case 'progress':
730 return deIdx(function(_arg, _arg1) {
740 var aM, aP, bM, bP;
750 aP = _arg[0], aM = _arg[1];
760 bP = _arg1[0], bM = _arg1[1];
770 defaults([aM, bM], {
78 'stats.progress.points': 0
79 });
800 return aM.stats.progress.points - bM.stats.progress.points;
81 });
82 case 'priority':
830 return deIdx(function(_arg, _arg1) {
840 var $a, $b, aM, aP, bM, bP, _ref1;
850 aP = _arg[0], aM = _arg[1];
860 bP = _arg1[0], bM = _arg1[1];
870 defaults([aM, bM], {
88 'stats.progress.time': 0,
89 'stats.days': 1e3
90 });
910 _ref1 = _.map([aM, bM], function(_arg2) {
920 var stats;
930 stats = _arg2.stats;
940 return (stats.progress.points - stats.progress.time) * stats.days;
95 }), $a = _ref1[0], $b = _ref1[1];
960 return $b - $a;
97 });
98 case 'name':
990 return deIdx(function(_arg, _arg1) {
1000 var aM, aP, bM, bP, name, owner;
1010 aP = _arg[0], aM = _arg[1];
1020 bP = _arg1[0], bM = _arg1[1];
1030 if (owner = bP.owner.localeCompare(aP.owner)) {
1040 return owner;
105 }
1060 if (name = bP.name.localeCompare(aP.name)) {
1070 return name;
108 }
1090 if (semver.valid(bM.title) && semver.valid(aM.title)) {
1100 return semver.gt(bM.title, aM.title);
111 } else {
1120 return bM.title.localeCompare(aM.title);
113 }
114 });
115 default:
1160 return function() {
1170 return 0;
118 };
119 }
120 },
121 find: function(project) {
1220 return _.find(this.data.list, project);
123 },
124 exists: function() {
1250 return !!this.find.apply(this, arguments);
126 },
127 add: function(project) {
1280 if (!this.exists(project)) {
1290 return this.push('list', project);
130 }
131 },
132 findIndex: function(_arg) {
1330 var name, owner;
1340 owner = _arg.owner, name = _arg.name;
1350 return _.findIndex(this.data.list, {
136 owner: owner,
137 name: name
138 });
139 },
140 addMilestone: function(project, milestone) {
1410 var i, j;
1420 _.extend(milestone, {
143 'stats': stats(milestone)
144 });
1450 if ((i = this.findIndex(project)) < 0) {
1460 throw 500;
147 }
1480 if (project.milestones != null) {
1490 this.push("list." + i + ".milestones", milestone);
1500 j = this.data.list[i].milestones.length - 1;
151 } else {
1520 this.set("list." + i + ".milestones", [milestone]);
1530 j = 0;
154 }
1550 return this.sort([i, j], [project, milestone]);
156 },
157 saveError: function(project, err) {
1580 var idx;
1590 if ((idx = this.findIndex(project)) > -1) {
1600 if (project.errors != null) {
1610 return this.push("list." + idx + ".errors", err);
162 } else {
1630 return this.set("list." + idx + ".errors", [err]);
164 }
165 } else {
1660 throw 500;
167 }
168 },
169 demo: function() {
1700 return this.set({
171 'list': [
172 {
173 'owner': 'mbostock',
174 'name': 'd3'
175 }, {
176 'owner': 'medic',
177 'name': 'medic-webapp'
178 }, {
179 'owner': 'ractivejs',
180 'name': 'ractive'
181 }, {
182 'owner': 'radekstepan',
183 'name': 'disposable'
184 }, {
185 'owner': 'rails',
186 'name': 'rails'
187 }, {
188 'owner': 'rails',
189 'name': 'spring'
190 }
191 ],
192 'index': []
193 });
194 },
195 clear: function() {
1960 return this.set({
197 'list': [],
198 'index': []
199 });
200 },
201 sort: function(ref, data) {
2020 var i, idx, index, j, m, p, _i, _j, _len, _len1, _ref, _ref1;
2030 index = this.data.index || [];
2040 if (ref) {
2050 idx = sortedIndex(index, data, this.comparator());
2060 index.splice(idx, 0, ref);
207 } else {
2080 _ref = this.data.list;
2090 for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
2100 p = _ref[i];
2110 if (p.milestones == null) {
2120 continue;
213 }
2140 _ref1 = p.milestones;
2150 for (j = _j = 0, _len1 = _ref1.length; _j < _len1; j = ++_j) {
2160 m = _ref1[j];
2170 idx = sortedIndex(index, [p, m], this.comparator());
2180 index.splice(idx, 0, [i, j]);
219 }
220 }
221 }
2220 return this.set('index', index);
223 },
224 onconstruct: function() {
2251 this.subscribe('!projects/add', this.add, this);
2261 return this.subscribe('!projects/demo', this.demo, this);
227 },
228 onrender: function() {
2291 this.set('list', lscache.get('projects') || []);
2301 this.observe('list', function(projects) {
2310 return lscache.set('projects', _.pluckMany(projects, ['owner', 'name']));
232 }, {
233 'init': false
234 });
2351 return this.observe('sortBy', function() {
2360 this.set('index', null);
2370 return this.sort();
238 }, {
239 'init': false
240 });
241 }
242 });
243
244}).call(this);
245

/home/radek/dev/burnchart/src/models/user.coffee

100%
4
4
0
LineHitsSource
11(function() {
21 var Model;
3
41 Model = require('../utils/ractive/model.coffee');
5
61 module.exports = new Model({
7 'name': 'models/user'
8 });
9
10}).call(this);
11

/home/radek/dev/burnchart/src/modules/chart/lines.coffee

6%
88
6
82
LineHitsSource
11(function() {
21 var config, d3, _,
30 __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
4
51 _ = require('lodash');
6
71 d3 = require('d3');
8
91 config = require('../../models/config.coffee');
10
111 module.exports = {
12 actual: function(issues, created_at, total) {
130 var head, max, min, range, rest;
140 head = [
15 {
16 'date': new Date(created_at),
17 'points': total
18 }
19 ];
200 min = +Infinity;
210 max = -Infinity;
220 rest = _.map(issues, function(issue) {
230 var closed_at, size;
240 size = issue.size, closed_at = issue.closed_at;
250 if (size < min) {
260 min = size;
27 }
280 if (size > max) {
290 max = size;
30 }
310 issue.date = new Date(closed_at);
320 issue.points = total -= size;
330 return issue;
34 });
350 range = d3.scale.linear().domain([min, max]).range([5, 8]);
360 rest = _.map(rest, function(issue) {
370 issue.radius = range(issue.size);
380 return issue;
39 });
400 return [].concat(head, rest);
41 },
42 ideal: function(a, b, total) {
430 var cutoff, d, days, length, m, now, once, velocity, y, _ref, _ref1;
440 if (b < a) {
450 _ref = [a, b], b = _ref[0], a = _ref[1];
46 }
470 _ref1 = _.map(a.match(config.data.chart.datetime)[1].split('-'), function(v) {
480 return parseInt(v);
49 }), y = _ref1[0], m = _ref1[1], d = _ref1[2];
500 cutoff = new Date(b);
510 days = [];
520 length = 0;
530 (once = function(inc) {
540 var day, day_of;
550 day = new Date(y, m - 1, d + inc);
560 if (!(day_of = day.getDay())) {
570 day_of = 7;
58 }
590 if (__indexOf.call(config.data.chart.off_days, day_of) >= 0) {
600 days.push({
61 date: day,
62 off_day: true
63 });
64 } else {
650 length += 1;
660 days.push({
67 date: day
68 });
69 }
700 if (!(day > cutoff)) {
710 return once(inc + 1);
72 }
73 })(0);
740 velocity = total / (length - 1);
750 days = _.map(days, function(day, i) {
760 day.points = total;
770 if (days[i] && !days[i].off_day) {
780 total -= velocity;
79 }
800 return day;
81 });
820 if ((now = new Date) > cutoff) {
830 days.push({
84 date: now,
85 points: 0
86 });
87 }
880 return days;
89 },
90 trend: function(actual, created_at, due_on) {
910 var a, b, b1, c1, e, fn, intercept, l, last, now, slope, start, values;
920 if (!actual.length) {
930 return [];
94 }
950 start = +actual[0].date;
960 values = _.map(actual, function(_arg) {
970 var date, points;
980 date = _arg.date, points = _arg.points;
990 return [+date - start, points];
100 });
1010 last = actual[actual.length - 1];
1020 values.push([+(new Date) - start, last.points]);
1030 b1 = 0;
1040 e = 0;
1050 c1 = 0;
1060 a = (l = values.length) * _.reduce(values, function(sum, _arg) {
1070 var a, b;
1080 a = _arg[0], b = _arg[1];
1090 b1 += a;
1100 e += b;
1110 c1 += Math.pow(a, 2);
1120 return sum + (a * b);
113 }, 0);
1140 slope = (a - (b1 * e)) / ((l * c1) - (Math.pow(b1, 2)));
1150 intercept = (e - (slope * b1)) / l;
1160 fn = function(x) {
1170 return slope * x + intercept;
118 };
1190 created_at = new Date(created_at);
1200 now = new Date;
1210 if (due_on) {
1220 due_on = new Date(due_on);
1230 if (now > due_on) {
1240 due_on = now;
125 }
126 } else {
1270 due_on = now;
128 }
1290 a = created_at - start;
1300 b = due_on - start;
1310 return [
132 {
133 'date': created_at,
134 'points': fn(a)
135 }, {
136 'date': due_on,
137 'points': fn(b)
138 }
139 ];
140 }
141 };
142
143}).call(this);
144

/home/radek/dev/burnchart/src/modules/github/issues.coffee

42%
45
19
26
LineHitsSource
11(function() {
21 var async, calcSize, config, oneStatus, request, _;
3
41 _ = require('lodash');
5
61 async = require('async');
7
81 config = require('../../models/config.coffee');
9
101 request = require('./request.coffee');
11
121 module.exports = {
13 fetchAll: function(repo, cb) {
141 return async.parallel([_.partial(async.waterfall, [_.partial(oneStatus, repo, 'open'), calcSize]), _.partial(async.waterfall, [_.partial(oneStatus, repo, 'closed'), calcSize])], function(err, _arg) {
151 var closed, open;
161 open = _arg[0], closed = _arg[1];
171 return cb(err, {
18 open: open,
19 closed: closed
20 });
21 });
22 }
23 };
24
251 calcSize = function(list, cb) {
260 var issue, size, _i, _len;
270 switch (config.data.chart.points) {
28 case 'ONE_SIZE':
290 size = list.length;
300 for (_i = 0, _len = list.length; _i < _len; _i++) {
310 issue = list[_i];
320 issue.size = 1;
33 }
340 return cb(null, {
35 list: list,
36 size: size
37 });
38 case 'LABELS':
390 size = 0;
400 list = _.filter(list, function(issue) {
410 var labels;
420 if (!(labels = issue.labels)) {
430 return false;
44 }
450 issue.size = _.reduce(labels, function(sum, label) {
460 var matches;
470 if (!(matches = label.name.match(config.data.chart.size_label))) {
480 return sum;
49 }
500 return sum += parseInt(matches[1]);
51 }, 0);
520 size += issue.size;
530 return !!issue.size;
54 });
550 return cb(null, {
56 list: list,
57 size: size
58 });
59 }
60 };
61
621 oneStatus = function(repo, state, cb) {
632 var fetchPage, results;
642 results = [];
652 return (fetchPage = function(page) {
662 return request.allIssues(repo, {
67 state: state,
68 page: page
69 }, function(err, data) {
701 if (err) {
711 return cb(err);
72 }
730 if (!data.length) {
740 return cb(null, results);
75 }
760 results = results.concat(_.sortBy(data, 'closed_at'));
770 if (data.length < 100) {
780 return cb(null, results);
79 }
800 return fetchPage(page + 1);
81 });
82 })(1);
83 };
84
85}).call(this);
86

/home/radek/dev/burnchart/src/modules/github/request.coffee

56%
123
69
54
LineHitsSource
12(function() {
22 var defaults, error, headers, isReady, isValid, ready, request, response, stack, superagent, user, _;
3
42 _ = require('lodash');
5
62 superagent = require('superagent');
7
82 require('../../utils/mixins.coffee');
9
102 user = require('../../models/user.coffee');
11
122 superagent.parse = {
13 'application/json': function(res) {
142 var e;
152 try {
162 return JSON.parse(res);
17 } catch (_error) {
182 e = _error;
192 return {};
20 }
21 }
22 };
23
242 defaults = {
25 'github': {
26 'host': 'api.github.com',
27 'protocol': 'https'
28 }
29 };
30
312 module.exports = {
32 repo: function(_arg, cb) {
330 var name, owner;
340 owner = _arg.owner, name = _arg.name;
350 if (!isValid({
36 owner: owner,
37 name: name
38 })) {
390 return cb('Request is malformed');
40 }
410 return ready(function() {
420 var data;
430 data = _.defaults({
44 'path': "/repos/" + owner + "/" + name,
45 'headers': headers(user.data.accessToken)
46 }, defaults.github);
470 return request(data, cb);
48 });
49 },
50 allMilestones: function(_arg, cb) {
510 var name, owner;
520 owner = _arg.owner, name = _arg.name;
530 if (!isValid({
54 owner: owner,
55 name: name
56 })) {
570 return cb('Request is malformed');
58 }
590 return ready(function() {
600 var data;
610 data = _.defaults({
62 'path': "/repos/" + owner + "/" + name + "/milestones",
63 'query': {
64 'state': 'open',
65 'sort': 'due_date',
66 'direction': 'asc'
67 },
68 'headers': headers(user.data.accessToken)
69 }, defaults.github);
700 return request(data, cb);
71 });
72 },
73 oneMilestone: function(_arg, cb) {
740 var milestone, name, owner;
750 owner = _arg.owner, name = _arg.name, milestone = _arg.milestone;
760 if (!isValid({
77 owner: owner,
78 name: name,
79 milestone: milestone
80 })) {
810 return cb('Request is malformed');
82 }
830 return ready(function() {
840 var data;
850 data = _.defaults({
86 'path': "/repos/" + owner + "/" + name + "/milestones/" + milestone,
87 'query': {
88 'state': 'open',
89 'sort': 'due_date',
90 'direction': 'asc'
91 },
92 'headers': headers(user.data.accessToken)
93 }, defaults.github);
940 return request(data, cb);
95 });
96 },
97 allIssues: function(_arg, query, cb) {
982 var milestone, name, owner;
992 owner = _arg.owner, name = _arg.name, milestone = _arg.milestone;
1002 if (!isValid({
101 owner: owner,
102 name: name,
103 milestone: milestone
104 })) {
1050 return cb('Request is malformed');
106 }
1072 return ready(function() {
1082 var data;
1092 data = _.defaults({
110 'path': "/repos/" + owner + "/" + name + "/issues",
111 'query': _.extend(query, {
112 milestone: milestone,
113 'per_page': '100'
114 }),
115 'headers': headers(user.data.accessToken)
116 }, defaults.github);
1172 return request(data, cb);
118 });
119 }
120 };
121
1222 request = function(_arg, cb) {
1232 var exited, headers, host, k, path, protocol, q, query, req, timeout, v;
1242 protocol = _arg.protocol, host = _arg.host, path = _arg.path, query = _arg.query, headers = _arg.headers;
1252 exited = false;
1262 q = query ? '?' + ((function() {
1272 var _results;
1282 _results = [];
1292 for (k in query) {
1308 v = query[k];
1318 _results.push("" + k + "=" + v);
132 }
1332 return _results;
134 })()).join('&') : '';
1352 req = superagent.get("" + protocol + "://" + host + path + q);
1362 for (k in headers) {
1374 v = headers[k];
1384 req.set(k, v);
139 }
1402 timeout = setTimeout(function() {
1411 exited = true;
1421 return cb('Request has timed out');
143 }, 5e3);
1442 return req.end(function(err, data) {
1450 if (exited) {
1460 return;
147 }
1480 exited = true;
1490 clearTimeout(timeout);
1500 return response(err, data, cb);
151 });
152 };
153
1542 response = function(err, data, cb) {
1550 var _ref;
1560 if (err) {
1570 return cb(error(err));
158 }
1590 if (data.statusType !== 2) {
1600 if ((data != null ? (_ref = data.body) != null ? _ref.message : void 0 : void 0) != null) {
1610 return cb(data.body.message);
162 }
1630 return cb(data.error.message);
164 }
1650 return cb(null, data.body);
166 };
167
1682 headers = function(token) {
1692 var h;
1702 h = {
171 'Content-Type': 'application/json',
172 'Accept': 'application/vnd.github.v3'
173 };
1742 if (token != null) {
1750 h.Authorization = "token " + token;
176 }
1772 return h;
178 };
179
1802 isValid = function(obj) {
1812 var key, rules, val;
1822 rules = {
183 'owner': function(val) {
1842 return val != null;
185 },
186 'name': function(val) {
1872 return val != null;
188 },
189 'milestone': function(val) {
1902 return _.isInt(val);
191 }
192 };
1932 for (key in obj) {
1946 val = obj[key];
1956 if (key in rules && !rules[key](val)) {
1960 return false;
197 }
198 }
1992 return true;
200 };
201
2022 isReady = user.data.ready;
203
2042 stack = [];
205
2062 ready = function(cb) {
2072 if (isReady) {
2082 return cb();
209 } else {
2100 return stack.push(cb);
211 }
212 };
213
2142 user.observe('ready', function(val) {
2154 var _results;
2164 isReady = val;
2174 if (val) {
2182 _results = [];
2192 while (stack.length) {
2200 _results.push(stack.shift()());
221 }
2222 return _results;
223 }
224 });
225
2262 error = function(err) {
2270 var message;
2280 switch (false) {
229 case !_.isString(err):
2300 message = err;
2310 break;
232 case !_.isArray(err):
2330 message = err[1];
2340 break;
235 case !(_.isObject(err) && _.isString(err.message)):
2360 message = err.message;
237 }
2380 if (!message) {
2390 try {
2400 message = JSON.stringify(err);
241 } catch (_error) {
2420 message = err.toString();
243 }
244 }
2450 return message;
246 };
247
248}).call(this);
249

/home/radek/dev/burnchart/src/modules/mediator.coffee

100%
5
5
0
LineHitsSource
11(function() {
21 var Mediator, Ractive;
3
41 Ractive = require('ractive');
5
61 Mediator = Ractive.extend({});
7
81 module.exports = new Mediator();
9
10}).call(this);
11

/home/radek/dev/burnchart/src/modules/stats.coffee

15%
32
5
27
LineHitsSource
11(function() {
21 var moment, progress;
3
41 moment = require('moment');
5
61 progress = function(a, b) {
70 if (a + b === 0) {
80 return 0;
9 } else {
100 return 100 * (a / (b + a));
11 }
12 };
13
141 module.exports = function(milestone) {
150 var a, b, c, days, isDone, isEmpty, isOnTime, isOverdue, points, time;
160 isDone = false;
170 isOnTime = true;
180 isOverdue = false;
190 isEmpty = true;
200 points = 0;
210 a = milestone.issues.closed.size;
220 b = milestone.issues.open.size;
230 if (a + b > 0) {
240 isEmpty = false;
250 points = progress(a, b);
260 if (points === 100) {
270 isDone = true;
28 }
29 }
300 if (!milestone.due_on) {
310 return {
32 isOverdue: isOverdue,
33 isOnTime: isOnTime,
34 isDone: isDone,
35 isEmpty: isEmpty,
36 'progress': {
37 points: points
38 }
39 };
40 }
410 a = +new Date(milestone.created_at);
420 b = +(new Date);
430 c = +new Date(milestone.due_on);
440 if (b > c) {
450 isOverdue = true;
46 }
470 time = progress(b - a, c - b);
480 days = (moment(b).diff(moment(a), 'days')) / 100;
490 isOnTime = points > time;
500 return {
51 isDone: isDone,
52 days: days,
53 isOnTime: isOnTime,
54 isOverdue: isOverdue,
55 'progress': {
56 points: points,
57 time: time
58 }
59 };
60 };
61
62}).call(this);
63

/home/radek/dev/burnchart/src/utils/mixins.coffee

38%
13
5
8
LineHitsSource
11(function() {
21 var _;
3
41 _ = require('lodash');
5
61 _.mixin({
7 'pluckMany': function(source, keys) {
80 if (!_.isArray(keys)) {
90 throw '`keys` needs to be an Array';
10 }
110 return _.map(source, function(item) {
120 var obj;
130 obj = {};
140 _.each(keys, function(key) {
150 return obj[key] = item[key];
16 });
170 return obj;
18 });
19 },
20 'isInt': function(val) {
212 return !isNaN(val) && parseInt(Number(val)) === val && !isNaN(parseInt(val, 10));
22 }
23 });
24
25}).call(this);
26

/home/radek/dev/burnchart/src/utils/ractive/eventful.coffee

45%
24
11
13
LineHitsSource
11(function() {
21 var Ractive, mediator, _;
3
41 _ = require('lodash');
5
61 Ractive = require('ractive');
7
81 mediator = require('../../modules/mediator.coffee');
9
101 module.exports = Ractive.extend({
11 subscribe: function(name, cb, ctx) {
122 if (ctx == null) {
130 ctx = this;
14 }
152 if (!_.isArray(this._subs)) {
161 this._subs = [];
17 }
182 if (_.isFunction(cb)) {
192 return this._subs.push(mediator.on(name, _.bind(cb, ctx)));
20 } else {
210 return console.log("Warning: `cb` is not a function");
22 }
23 },
24 publish: function() {
250 return mediator.fire.apply(mediator, arguments);
26 },
27 onteardown: function() {
280 var sub, _i, _len, _ref, _results;
290 if (_.isArray(this._subs)) {
300 _ref = this._subs;
310 _results = [];
320 for (_i = 0, _len = _ref.length; _i < _len; _i++) {
330 sub = _ref[_i];
340 if (_.isFunction(sub.cancel)) {
350 _results.push(sub.cancel());
36 } else {
370 _results.push(console.log("Warning: `sub.cancel` is not a function"));
38 }
39 }
400 return _results;
41 }
42 }
43 });
44
45}).call(this);
46

/home/radek/dev/burnchart/src/utils/ractive/model.coffee

100%
9
9
0
LineHitsSource
11(function() {
21 var Eventful;
3
41 Eventful = require('./eventful.coffee');
5
61 module.exports = function(opts) {
73 var Model, model;
83 Model = Eventful.extend(opts);
93 model = new Model();
103 model.render();
113 return model;
12 };
13
14}).call(this);
15
\ No newline at end of file diff --git a/docs/TODO.md b/docs/TODO.md index 28fc71f..5dd8572 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -1,6 +1,5 @@ #Tasks to do -- [ ] watch CSS too - [ ] add some product screenshots - [ ] create notes about how original people can upgrade to burnchart - [ ] clean up docs, track them on git or using Assembly system? @@ -8,7 +7,6 @@ - [ ] check with austin@assembly.com if my repo looks good to be forked to Assembly - [ ] move domain to Assembly - [ ] fork it to Assembly -- [ ] move tests from `radekstepan/github-burndown-chart` - [ ] landing page for the project and put message on `github-burndown-chart` repo - [ ] provide a documentation site (because we ref it from hero) - [ ] track users/make it easy for people to leave feedback @@ -19,6 +17,7 @@ ##Backlog +- [ ] one click to go from a project or milestone view to github - [ ] be able to specify milestone by name (will nicely show in title) - [ ] focus on form fields style (blue outline etc) - [ ] switch off `user-select` on buttons diff --git a/package.json b/package.json index d200cbf..9861ac1 100644 --- a/package.json +++ b/package.json @@ -27,20 +27,24 @@ "grunt-contrib-concat": "~0.5.0", "grunt-contrib-uglify": "~0.6.0", "grunt-contrib-cssmin": "~0.10.0", + "grunt-contrib-watch": "~0.6.1", "grunt-gh-pages": "~0.9.1", "coffeeify": "~0.7.0L", "ractivate": "~0.2.0", "browserify": "~6.1.0", "watchify": "~2.1.0", "node-static": "~0.7.6", - + "mocha": "~2.0.1", + "mocha-lcov-reporter": "0.0.1", + "blanket": "~1.1.6", + "coveralls": "~2.11.2", + "proxyquire": "~1.0.1", "coffee-script": "~1.8.0", "async": "~0.9.0", "d3": "~3.4.13", "d3-tip": "Caged/d3-tip", - "proxyquire": "~1.0.1", "lodash": "~2.4.1", "director": "~1.2.3", "firebase": "~1.1.2", @@ -60,5 +64,15 @@ "coffeeify", "ractivate" ] + }, + "config": { + "blanket": { + "loader": "./node-loaders/coffee-script", + "pattern": "src", + "data-cover-never": "node_modules", + "data-cover-flags": { + "engineOnly": true + } + } } } diff --git a/public/js/app.bundle.min.js b/public/js/app.bundle.min.js index 92723ed..3e31939 100644 --- a/public/js/app.bundle.min.js +++ b/public/js/app.bundle.min.js @@ -14,5 +14,5 @@ var t;if(k.t===a.PARTIAL&&n&&(t=c.readExpression())&&(k={contextPartialExpressio }}}}(J,sc,vc),xc=function(a,b){return function(c,d,e){var f,g,h,i;if(a(c)){e=d,g=c,f=[];for(c in g)g.hasOwnProperty(c)&&(d=g[c],f.push(this.observe(c,d,e)));return{cancel:function(){for(;f.length;)f.pop().cancel()}}}if("function"==typeof c)return e=d,d=c,c="",b(this,c,d,e);if(h=c.split(" "),1===h.length)return b(this,c,d,e);for(f=[],i=h.length;i--;)c=h[i],c&&f.push(b(this,c,d,e));return{cancel:function(){for(;f.length;)f.pop().cancel()}}}}(i,wc),yc=function(a){return a.trim()},zc=function(a){return""!==a},Ac=function(a,b){return function(c,d){var e,f=this;if(c)e=c.split(" ").map(a).filter(b),e.forEach(function(a){var b,c;(b=f._subs[a])&&(d?(c=b.indexOf(d),-1!==c&&b.splice(c,1)):f._subs[a]=[])});else for(c in this._subs)delete this._subs[c];return this}}(yc,zc),Bc=function(a,b){return function(c,d){var e,f,g,h=this,i=this;if("object"==typeof c){e=[];for(f in c)c.hasOwnProperty(f)&&e.push(this.on(f,c[f]));return{cancel:function(){for(var a;a=e.pop();)a.cancel()}}}return g=c.split(" ").map(a).filter(b),g.forEach(function(a){(h._subs[a]||(h._subs[a]=[])).push(d)}),{cancel:function(){i.off(c,d)}}}}(yc,zc),Cc=function(){function a(a,b,c){switch(b){case"splice":for(void 0!==c[0]&&c[0]<0&&(c[0]=a.length+Math.max(c[0],-a.length));c.length<2;)c.push(0);return c[1]=Math.min(c[1],a.length-c[0]),c;case"sort":case"reverse":return null;case"pop":return a.length?[a.length-1,1]:null;case"push":return[a.length,0].concat(c);case"shift":return[0,1];case"unshift":return[0,0].concat(c)}}var b;return b=function(b,c,d){var e,f,g,h,i,j,k=[];if(e=a(b,c,d),!e)return null;for(f=b.length,i=e.length-2-e[1],g=Math.min(f,e[0]),h=g+e[1],j=0;g>j;j+=1)k.push(j);for(;h>j;j+=1)k.push(-1);for(;f>j;j+=1)k.push(j+i);return k}}(),Dc=function(a,b,c){var d=Array.prototype;return function(e){return function(f){var g,h,i,j,k=Array.prototype.slice,l=k.call(arguments,1),m=[];if(g=this.get(f),h=g.length,!a(g))throw new Error("Called ractive."+e+"('"+f+"'), but '"+f+"' does not refer to an array");return m=c(g,e,l),j=d[e].apply(g,l),i=b.start(this,!0).then(function(){return j}),m?this.viewmodel.smartUpdate(f,g,m):this.viewmodel.mark(f),b.end(),i}}}(h,y,Cc),Ec=function(a){return a("pop")}(Dc),Fc=function(a){return a("push")}(Dc),Gc=function(a,b,c){var d,e,f,g,h,i,j,k="/* Ractive.js component styles */\n",l={},m=[];return b?(a.push(function(){f=a.runloop}),g=document.createElement("style"),g.type="text/css",h=document.getElementsByTagName("head")[0],j=!1,i=g.styleSheet,e=function(){var a;m.length?(a=k+m.join(" "),i?i.cssText=a:g.innerHTML=a,j||(h.appendChild(g),j=!0)):j&&(h.removeChild(g),j=!1)},d={add:function(a){a.css&&(l[a._guid]||(l[a._guid]=0,m.push(a.css),e()),l[a._guid]+=1)},remove:function(a){a.css&&(l[a._guid]-=1,l[a._guid]||(c(m,a.css),f.scheduleTask(e)))}}):d=null,d}(f,E,q),Hc=function(a,b,c,d){var e=new b("render"),f=new b("complete");return function(b,g){var h,i,j,k=this;if(j=this.transitionsEnabled,this.noIntro&&(this.transitionsEnabled=!1),h=d.start(this,!0),d.scheduleTask(function(){return e.fire(k)},!0),this.fragment.rendered)throw new Error("You cannot call ractive.render() on an already rendered instance! Call ractive.unrender() first");return b=c(b)||this.el,g=c(g)||this.anchor,this.el=b,this.anchor=g,this.constructor.css&&a.add(this.constructor),b&&((i=b.__ractive_instances__)?i.push(this):b.__ractive_instances__=[this],g?b.insertBefore(this.fragment.render(),g):b.appendChild(this.fragment.render())),d.end(),this.transitionsEnabled=j,h.then(function(){return f.fire(k)}),h}}(Gc,p,pc,y),Ic=function(){this.dirtyValue=this.dirtyArgs=!0,this.bound&&"function"==typeof this.owner.bubble&&this.owner.bubble()},Jc=function(){var a;return 1===this.items.length?this.items[0].detach():(a=document.createDocumentFragment(),this.items.forEach(function(b){var c=b.detach();c&&a.appendChild(c)}),a)},Kc=function(a){var b,c,d,e;if(this.items){for(c=this.items.length,b=0;c>b;b+=1)if(d=this.items[b],d.find&&(e=d.find(a)))return e;return null}},Lc=function(a,b){var c,d,e;if(this.items)for(d=this.items.length,c=0;d>c;c+=1)e=this.items[c],e.findAll&&e.findAll(a,b);return b},Mc=function(a,b){var c,d,e;if(this.items)for(d=this.items.length,c=0;d>c;c+=1)e=this.items[c],e.findAllComponents&&e.findAllComponents(a,b);return b},Nc=function(a){var b,c,d,e;if(this.items){for(b=this.items.length,c=0;b>c;c+=1)if(d=this.items[c],d.findComponent&&(e=d.findComponent(a)))return e;return null}},Oc=function(a){var b,c=a.index;return b=this.items[c+1]?this.items[c+1].firstNode():this.owner===this.root?this.owner.component?this.owner.component.findNextNode():null:this.owner.findNextNode(this)},Pc=function(){return this.items&&this.items[0]?this.items[0].firstNode():null},Qc=function(){var a=this;do if(a.pElement)return a.pElement.node;while(a=a.parent);return this.root.detached||this.root.el},Rc=function(a){function b(a,c,d,e){return e=e||0,a.map(function(a){var f,g,h;return a.text?a.text:a.fragments?a.fragments.map(function(a){return b(a.items,c,d,e)}).join(""):(f=d+"-"+e++,h=(g=a.root.viewmodel.wrapped[a.keypath])?g.value:a.getValue(),c[f]=h,"${"+f+"}")}).join("")}var c,d={};return c=function(){var c=arguments[0];void 0===c&&(c=d);var e,f,g,h,i,j,k;return e=c.args,i=e?"argsList":"value",j=e?"dirtyArgs":"dirtyValue",this[j]&&(g=b(this.items,f={},this.root._guid),h=a(e?"["+g+"]":g,f),k=h?h.value:e?[this.toString()]:this.toString(),this[i]=k,this[j]=!1),this[i]}}(Fb),Sc=function(){var a=//g,c=/&/g;return function(d){return d.replace(c,"&").replace(a,"<").replace(b,">")}}(),Tc=function(a){return a&&a.parentNode&&a.parentNode.removeChild(a),a},Uc=function(a){return function(){return a(this.node)}}(Tc),Vc=function(a,b,c){var d=function(b){this.type=a.TEXT,this.text=b.template};return d.prototype={detach:c,firstNode:function(){return this.node},render:function(){return this.node||(this.node=document.createTextNode(this.text)),this.node},toString:function(a){return a?b(this.text):this.text},unrender:function(a){return a?this.detach():void 0}},d}(S,Sc,Uc),Wc=function(){this.registered&&this.root.viewmodel.unregister(this.keypath,this),this.resolver&&this.resolver.unbind()},Xc=function(){return this.value},Yc=function(a,b){return a&&b&&a.substr(0,b.length+1)===b+"."},Zc=function(a){return function(b,c,d){return b===c?void 0!==d?d:null:a(b,c)?null===d?d:b.replace(c+".",d+"."):void 0}}(Yc),$c=function(a,b,c){var d=function(c,d,e){var f;this.ref=d,this.resolved=!1,this.root=c.root,this.parentFragment=c.parentFragment,this.callback=e,f=b(c.root,d,c.parentFragment),void 0!==f?this.resolve(f):a.addUnresolved(this)};return d.prototype={resolve:function(a){this.resolved=!0,this.keypath=a,this.callback(a)},forceResolution:function(){this.resolve(this.ref)},rebind:function(a,b,d,e){var f;void 0!==this.keypath&&(f=c(this.keypath,d,e),void 0!==f&&this.resolve(f))},unbind:function(){this.resolved||a.removeUnresolved(this)}},d}(y,w,Zc),_c=function(){var a=function(a,b,c){this.parentFragment=a.parentFragment,this.ref=b,this.callback=c,this.rebind()};return a.prototype={rebind:function(){var a=this.ref,b=this.parentFragment;if("@keypath"===a)for(;b;){if(b.context)return this.callback("@"+b.context);b=b.parent}if("@index"===a||"@key"===a)for(;b;){if(void 0!==b.index)return this.callback("@"+b.index);b=b.parent}throw new Error('Unknown special reference "'+a+'" - valid references are @index, @key and @keypath')},unbind:function(){}},a}(),ad=function(){var a=function(a,b,c){this.parentFragment=a.parentFragment,this.ref=b,this.callback=c,this.rebind()};return a.prototype={rebind:function(){var a=this.ref,b=this.parentFragment.indexRefs,c=b[a];void 0!==c&&this.callback("@"+c)},unbind:function(){}},a}(),bd=function(a,b,c){return function(d,e,f){var g,h;return"@"===e.charAt(0)?new b(d,e,f):(g=d.parentFragment.indexRefs,g&&void 0!==(h=g[e])?new c(d,e,f):new a(d,e,f))}}($c,_c,ad),cd=function(){var a={};return function(b,c){var d,e;if(a[b])return a[b];for(e=[];c--;)e[c]="_"+c;return d=new Function(e.join(","),"return("+b+")"),a[b]=d,d}}(),dd=function(a,b,c,d){function e(a){return a.call()}function f(a,c){return a.replace(/_([0-9]+)/g,function(a,d){var e,f;return e=c[d],void 0===e?"undefined":"@"===e[0]?(f=e.slice(1),b(f)?f:'"'+f+'"'):e})}function g(a){return"${"+a.replace(/[\.\[\]]/g,"-")+"}"}function h(a){return void 0!==a&&"@"!==a[0]}function i(b,c){var d,e,f;if(b._noWrap)return b;if(e="__ractive_"+c._guid,d=b[e])return d;if(/this/.test(b.toString())){a(b,e,{value:l.call(b,c)});for(f in b)b.hasOwnProperty(f)&&(b[e][f]=b[f]);return b[e]}return a(b,"__ractive_nowrap",{value:b}),b.__ractive_nowrap}var j,k,l=Function.prototype.bind;return k=function(a,b,d,e){var f,g,h=this;f=a.root,h.root=f,h.parentFragment=b,h.callback=e,h.owner=a,h.str=d.s,h.keypaths=[],g=b.indexRefs,h.pending=d.r.length,h.refResolvers=d.r.map(function(a,b){return c(h,a,function(a){h.resolve(b,a)})}),h.ready=!0,h.bubble()},k.prototype={bubble:function(){this.ready&&(this.uniqueString=f(this.str,this.keypaths),this.keypath=g(this.uniqueString),this.createEvaluator(),this.callback(this.keypath))},unbind:function(){for(var a;a=this.refResolvers.pop();)a.unbind()},resolve:function(a,b){this.keypaths[a]=b,this.bubble()},createEvaluator:function(){var a,c,f,g,j=this,k=this;a=this.root.viewmodel.computations[this.keypath],a?this.root.viewmodel.mark(this.keypath):(g=d(this.str,this.refResolvers.length),c=this.keypaths.map(function(a){var c;return"undefined"===a?function(){return void 0}:"@"===a[0]?(c=a.slice(1),b(c)?function(){return+c}:function(){return c}):function(){var b=j.root.viewmodel.get(a);return"function"==typeof b&&(b=i(b,k.root)),b}}),f={deps:this.keypaths.filter(h),get:function(){var a=c.map(e);return g.apply(null,a)}},a=this.root.viewmodel.compute(this.keypath,f))},rebind:function(a,b,c,d){this.refResolvers.forEach(function(e){return e.rebind(a,b,c,d)})}},j=k}(F,j,bd,cd,vb),ed=function(a,b,c){var d=function(d,e,f){var g=this;g.resolver=e,g.root=e.root,g.parentFragment=f,g.viewmodel=e.root.viewmodel,"string"==typeof d?g.value=d:d.t===a.REFERENCE?g.refResolver=b(this,d.n,function(a){g.resolve(a)}):new c(e,f,d,function(a){g.resolve(a)})};return d.prototype={resolve:function(a){this.keypath&&this.viewmodel.unregister(this.keypath,this),this.keypath=a,this.value=this.viewmodel.get(a),this.bind(),this.resolver.bubble()},bind:function(){this.viewmodel.register(this.keypath,this)},rebind:function(a,b,c,d){this.refResolver&&this.refResolver.rebind(a,b,c,d)},setValue:function(a){this.value=a,this.resolver.bubble()},unbind:function(){this.keypath&&this.viewmodel.unregister(this.keypath,this),this.unresolved&&this.unresolved.unbind()},forceResolution:function(){this.refResolver&&this.refResolver.forceResolution()}},d}(S,bd,dd),fd=function(a,b,c){function d(a){return a.value}function e(a){return void 0!=a}function f(a){a.unbind()}var g=function(d,e,f){var g,h,i,j,k=this,l=this;l.parentFragment=j=d.parentFragment,l.root=g=d.root,l.mustache=d,l.ref=h=e.r,l.callback=f,l.unresolved=[],(i=a(g,h,j))?l.base=i:l.baseResolver=new b(this,h,function(a){l.base=a,l.baseResolver=null,l.bubble()}),l.members=e.m.map(function(a){return new c(a,k,j)}),l.ready=!0,l.bubble()};return g.prototype={getKeypath:function(){var a=this.members.map(d);return!a.every(e)||this.baseResolver?null:this.base+"."+a.join(".")},bubble:function(){this.ready&&!this.baseResolver&&this.callback(this.getKeypath())},unbind:function(){this.members.forEach(f)},rebind:function(a,b,c,d){var e;this.members.forEach(function(f){f.rebind(a,b,c,d)&&(e=!0)}),e&&this.bubble()},forceResolution:function(){this.baseResolver&&(this.base=this.ref,this.baseResolver.unbind(),this.baseResolver=null),this.members.forEach(function(a){return a.forceResolution()}),this.bubble()}},g}(w,$c,ed),gd=function(a,b,c,d){return function(e,f){function g(a){e.resolve(a)}function h(a){var b=e.keypath;a!==b&&(e.resolve(a),void 0!==b&&e.fragments&&e.fragments.forEach(function(c){c.rebind(null,null,b,a)}))}var i,j,k;j=f.parentFragment,k=f.template,e.root=j.root,e.parentFragment=j,e.pElement=j.pElement,e.template=f.template,e.index=f.index||0,e.isStatic=f.template.s,e.type=f.template.t,e.registered=!1,(i=k.r)&&(e.resolver=new b(e,i,g)),f.template.x&&(e.resolver=new d(e,j,f.template.x,h)),f.template.rx&&(e.resolver=new c(e,f.template.rx,h)),e.template.n!==a.SECTION_UNLESS||e.hasOwnProperty("value")||e.setValue(void 0)}}(S,bd,fd,dd),hd=function(a){return function(b){var c,d,e;return b&&"@"===b[0]?(d=b.slice(1),a(d)&&(d=+d),this.keypath=b,void this.setValue(d)):(this.registered&&(this.root.viewmodel.unregister(this.keypath,this),this.registered=!1,c=!0),this.keypath=b,void 0!=b&&(d=this.root.viewmodel.get(b),this.root.viewmodel.register(b,this),this.registered=!0),this.setValue(d),void(c&&(e=this.twowayBinding)&&e.rebound()))}}(j),id=function(a,b,c,d){this.fragments&&this.fragments.forEach(function(e){return e.rebind(a,b,c,d)}),this.resolver&&this.resolver.rebind(a,b,c,d)},jd=function(a,b,c,d){return{getValue:a,init:b,resolve:c,rebind:d}}(Xc,gd,hd,id),kd=function(a,b,c,d,e,f,g,h){var i=function(b){this.type=a.INTERPOLATOR,g.init(this,b)};return i.prototype={update:function(){this.node.data=void 0==this.value?"":this.value},resolve:g.resolve,rebind:g.rebind,detach:h,unbind:f,render:function(){return this.node||(this.node=document.createTextNode(void 0!=this.value?this.value:"")),this.node},unrender:function(a){a&&d(this.node)},getValue:g.getValue,setValue:function(a){var c;(c=this.root.viewmodel.wrapped[this.keypath])&&(a=c.get()),e(a,this.value)||(this.value=a,this.parentFragment.bubble(),this.node&&b.addView(this))},firstNode:function(){return this.node},toString:function(a){var b=void 0!=this.value?""+this.value:"";return a?c(b):b}},i}(S,y,Sc,Tc,u,Wc,jd,Uc),ld=function(){this.parentFragment.bubble()},md=function(){var a;return 1===this.fragments.length?this.fragments[0].detach():(a=document.createDocumentFragment(),this.fragments.forEach(function(b){a.appendChild(b.detach())}),a)},nd=function(a){var b,c,d;for(c=this.fragments.length,b=0;c>b;b+=1)if(d=this.fragments[b].find(a))return d;return null},od=function(a,b){var c,d;for(d=this.fragments.length,c=0;d>c;c+=1)this.fragments[c].findAll(a,b)},pd=function(a,b){var c,d;for(d=this.fragments.length,c=0;d>c;c+=1)this.fragments[c].findAllComponents(a,b)},qd=function(a){var b,c,d;for(c=this.fragments.length,b=0;c>b;b+=1)if(d=this.fragments[b].findComponent(a))return d;return null},rd=function(a){return this.fragments[a.index+1]?this.fragments[a.index+1].firstNode():this.parentFragment.findNextNode(this)},sd=function(){var a,b,c;if(a=this.fragments.length)for(b=0;a>b;b+=1)if(c=this.fragments[b].firstNode())return c;return this.parentFragment.findNextNode(this)},td=function(a,b,c){var d;return c.push(function(){d=c.Fragment}),function(c){var d,e,f,g,h,i,j,k=this,l=this;if(!(this.shuffling||this.unbound||this.subtype&&this.subtype!==a.SECTION_EACH)){if(this.shuffling=!0,b.scheduleTask(function(){return k.shuffling=!1}),d=this.parentFragment,h=[],c.forEach(function(a,b){var c,d,f,g;return a===b?void(h[a]=l.fragments[b]):(c=l.fragments[b],void 0===e&&(e=b),-1===a?(l.fragmentsToUnrender.push(c),void c.unbind()):(d=a-b,f=l.keypath+"."+b,g=l.keypath+"."+a,c.rebind(l.template.i,a,f,g),c.index=a,void(h[a]=c)))}),g=this.root.get(this.keypath).length,void 0===e){if(this.length===g)return;e=this.length}for(this.length=this.fragments.length=g,this.rendered&&b.addView(this),i={template:this.template.f,root:this.root,owner:this},this.template.i&&(i.indexRef=this.template.i),f=e;g>f;f+=1)j=h[f],j||this.fragmentsToCreate.push(f),this.fragments[f]=j}}}(S,y,f),ud=function(){var a;return a=this.docFrag=document.createDocumentFragment(),this.update(),this.rendered=!0,a},vd=function(){var a=/^\[object (?:Array|FileList)\]$/,b=Object.prototype.toString;return function(c){return a.test(b.call(c))}}(),wd=function(a,b,c,d,e){function f(d,e){var f={template:d.template.f,root:d.root,pElement:d.parentFragment.pElement,owner:d};if(d.subtype)switch(d.subtype){case a.SECTION_IF:return k(d,e,!1,f);case a.SECTION_UNLESS:return k(d,e,!0,f);case a.SECTION_WITH:return j(d,f);case a.SECTION_IF_WITH:return i(d,e,f);case a.SECTION_EACH:if(c(e))return h(d,e,f)}return d.ordered=!!b(e),d.ordered?g(d,e,f):c(e)||"function"==typeof e?d.template.i?h(d,e,f):j(d,f):k(d,e,!1,f)}function g(a,b,c){var d,e,f;if(e=b.length,e===a.length)return!1;if(ea.length)for(d=a.length;e>d;d+=1)c.context=a.keypath+"."+d,c.index=d,a.template.i&&(c.indexRef=a.template.i),f=new p(c),a.fragmentsToRender.push(a.fragments[d]=f);return a.length=e,!0}function h(a,b,c){var d,e,f,g,h;for(f=a.hasKey||(a.hasKey={}),e=a.fragments.length;e--;)g=a.fragments[e],g.index in b||(h=!0,g.unbind(),a.fragmentsToUnrender.push(g),a.fragments.splice(e,1),f[g.index]=!1);for(d in b)f[d]||(h=!0,c.context=a.keypath+"."+d,c.index=d,a.template.i&&(c.indexRef=a.template.i),g=new p(c),a.fragmentsToRender.push(g),a.fragments.push(g),f[d]=!0);return a.length=a.fragments.length,h}function i(a,b,c){return b?j(a,c):l(a)}function j(a,b){var c;return a.length?void 0:(b.context=a.keypath,b.index=0,c=new p(b),a.fragmentsToRender.push(a.fragments[0]=c),a.length=1,!0)}function k(a,d,e,f){var g,h,i,j,k;if(h=b(d)&&0===d.length,i=!1,!b(d)&&c(d)){i=!0;for(k in d){i=!1;break}}return g=e?h||i||!d:d&&!h&&!i,g?a.length?a.length>1?(a.fragmentsToUnrender=a.fragments.splice(1),a.fragmentsToUnrender.forEach(m),!0):void 0:(f.index=0,j=new p(f),a.fragmentsToRender.push(a.fragments[0]=j),a.length=1,!0):l(a)}function l(a){return a.length?(a.fragmentsToUnrender=a.fragments.splice(0,a.fragments.length).filter(n),a.fragmentsToUnrender.forEach(m),a.length=a.fragmentsToRender.length=0,!0):void 0}function m(a){a.unbind()}function n(a){return a.rendered}var o,p;return e.push(function(){p=e.Fragment}),o=function(a){var b,c,e=this;this.updating||(this.updating=!0,(b=this.root.viewmodel.wrapped[this.keypath])&&(a=b.get()),this.fragmentsToCreate.length?(c={template:this.template.f,root:this.root,pElement:this.pElement,owner:this,indexRef:this.template.i},this.fragmentsToCreate.forEach(function(a){var b;c.context=e.keypath+"."+a,c.index=a,b=new p(c),e.fragmentsToRender.push(e.fragments[a]=b)}),this.fragmentsToCreate.length=0):f(this,a)&&(this.bubble(),this.rendered&&d.addView(this)),this.value=a,this.updating=!1)}}(S,vd,i,y,f),xd=function(a){var b,c,d;for(b="",c=0,d=this.length,c=0;d>c;c+=1)b+=this.fragments[c].toString(a);return b},yd=function(a){function b(a){a.unbind()}var c;return c=function(){this.fragments.forEach(b),a.call(this),this.length=0,this.unbound=!0}}(Wc),zd=function(){function a(a){a.unrender(!0)}function b(a){a.unrender(!1)}var c;return c=function(c){this.fragments.forEach(c?a:b)}}(),Ad=function(){var a,b,c,d,e,f,g;for(c=this.renderedFragments;a=this.fragmentsToUnrender.pop();)a.unrender(!0),c.splice(c.indexOf(a),1);for(;a=this.fragmentsToRender.shift();)a.render();for(this.rendered&&(e=this.parentFragment.getNode()),g=this.fragments.length,f=0;g>f;f+=1)a=this.fragments[f],b=c.indexOf(a,f),b!==f?(this.docFrag.appendChild(a.detach()),-1!==b&&c.splice(b,1),c.splice(f,0,a)):this.docFrag.childNodes.length&&(d=a.firstNode(),e.insertBefore(this.docFrag,d));this.rendered&&this.docFrag.childNodes.length&&(d=this.parentFragment.findNextNode(this),e.insertBefore(this.docFrag,d)),this.renderedFragments=this.fragments.slice()},Bd=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){var r=function(c){this.type=a.SECTION,this.subtype=c.template.n,this.inverted=this.subtype===a.SECTION_UNLESS,this.pElement=c.pElement,this.fragments=[],this.fragmentsToCreate=[],this.fragmentsToRender=[],this.fragmentsToUnrender=[],this.renderedFragments=[],this.length=0,b.init(this,c)};return r.prototype={bubble:c,detach:d,find:e,findAll:f,findAllComponents:g,findComponent:h,findNextNode:i,firstNode:j,getValue:b.getValue,shuffle:k,rebind:b.rebind,render:l,resolve:b.resolve,setValue:m,toString:n,unbind:o,unrender:p,update:q},r}(S,jd,ld,md,nd,od,pd,qd,rd,sd,td,ud,wd,xd,yd,zd,Ad),Cd=function(){var a,b;if(this.docFrag){for(a=this.nodes.length,b=0;a>b;b+=1)this.docFrag.appendChild(this.nodes[b]);return this.docFrag}},Dd=function(a){return function(b){var c,d,e,f;for(d=this.nodes.length,c=0;d>c;c+=1)if(e=this.nodes[c],1===e.nodeType){if(a(e,b))return e;if(f=e.querySelector(b))return f}return null}}(_b),Ed=function(a){return function(b,c){var d,e,f,g,h,i;for(e=this.nodes.length,d=0;e>d;d+=1)if(f=this.nodes[d],1===f.nodeType&&(a(f,b)&&c.push(f),g=f.querySelectorAll(b)))for(h=g.length,i=0;h>i;i+=1)c.push(g[i])}}(_b),Fd=function(){return this.rendered&&this.nodes[0]?this.nodes[0]:this.parentFragment.findNextNode(this)},Gd=function(a,b){function c(a){return g[a]||(g[a]=b(a))}var d,e,f,g={};try{b("table").innerHTML="foo"}catch(h){e=!0,f={TABLE:['',"
"],THEAD:['',"
"],TBODY:['',"
"],TR:['',"
"],SELECT:['"]}}return d=function(b,d,g){var h,i,j,k,l,m=[];if(null!=b&&""!==b){for(e&&(i=f[d.tagName])?(h=c("DIV"),h.innerHTML=i[0]+b+i[1],h=h.querySelector(".x"),"SELECT"===h.tagName&&(j=h.options[h.selectedIndex])):d.namespaceURI===a.svg?(h=c("DIV"),h.innerHTML=''+b+"",h=h.querySelector(".x")):(h=c(d.tagName),h.innerHTML=b,"SELECT"===h.tagName&&(j=h.options[h.selectedIndex]));k=h.firstChild;)m.push(k),g.appendChild(k);if("SELECT"===d.tagName)for(l=m.length;l--;)m[l]!==j&&(m[l].selected=!1)}return m}}(C,D),Hd=function(a){for(var b=[],c=a.length;c--;)b[c]=a[c];return b},Id=function(a){function b(a){return a.selected}var c;return c=function(c){var d,e,f;c&&"select"===c.name&&c.binding&&(d=a(c.node.options).filter(b),c.getAttribute("multiple")?f=d.map(function(a){return a.value}):(e=d[0])&&(f=e.value),void 0!==f&&c.binding.setValue(f),c.bubble())}}(Hd),Jd=function(a,b){return function(){if(this.rendered)throw new Error("Attempted to render an item that was already rendered");return this.docFrag=document.createDocumentFragment(),this.nodes=a(this.value,this.parentFragment.getNode(),this.docFrag),b(this.pElement),this.rendered=!0,this.docFrag}}(Gd,Id),Kd=function(a){return function(b){var c;(c=this.root.viewmodel.wrapped[this.keypath])&&(b=c.get()),b!==this.value&&(this.value=b,this.parentFragment.bubble(),this.rendered&&a.addView(this))}}(y),Ld=function(a){return function(){return void 0!=this.value?a(""+this.value):""}}(Bb),Md=function(a){return function(b){this.rendered&&b&&(this.nodes.forEach(a),this.rendered=!1)}}(Tc),Nd=function(a,b){return function(){var c,d;if(this.rendered){for(;this.nodes&&this.nodes.length;)c=this.nodes.pop(),c.parentNode.removeChild(c);d=this.parentFragment.getNode(),this.nodes=a(this.value,d,this.docFrag),d.insertBefore(this.docFrag,this.parentFragment.findNextNode(this)),b(this.pElement)}}}(Gd,Id),Od=function(a,b,c,d,e,f,g,h,i,j,k,l){var m=function(c){this.type=a.TRIPLE,b.init(this,c)};return m.prototype={detach:c,find:d,findAll:e,firstNode:f,getValue:b.getValue,rebind:b.rebind,render:g,resolve:b.resolve,setValue:h,toString:i,unbind:l,unrender:j,update:k},m}(S,jd,Cd,Dd,Ed,Fd,Jd,Kd,Ld,Md,Nd,Wc),Pd=function(){this.parentFragment.bubble()},Qd=function(){var a,b=this.node;return b?((a=b.parentNode)&&a.removeChild(b),b):void 0},Rd=function(a){return function(b){return a(this.node,b)?this.node:this.fragment&&this.fragment.find?this.fragment.find(b):void 0}}(_b),Sd=function(a,b){b._test(this,!0)&&b.live&&(this.liveQueries||(this.liveQueries=[])).push(b),this.fragment&&this.fragment.findAll(a,b)},Td=function(a,b){this.fragment&&this.fragment.findAllComponents(a,b)},Ud=function(a){return this.fragment?this.fragment.findComponent(a):void 0},Vd=function(){return null},Wd=function(){return this.node},Xd=function(a){return this.attributes&&this.attributes[a]?this.attributes[a].value:void 0},Yd=function(){var a,b,c,d;return a="altGlyph altGlyphDef altGlyphItem animateColor animateMotion animateTransform clipPath feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence foreignObject glyphRef linearGradient radialGradient textPath vkern".split(" "),b="attributeName attributeType baseFrequency baseProfile calcMode clipPathUnits contentScriptType contentStyleType diffuseConstant edgeMode externalResourcesRequired filterRes filterUnits glyphRef gradientTransform gradientUnits kernelMatrix kernelUnitLength keyPoints keySplines keyTimes lengthAdjust limitingConeAngle markerHeight markerUnits markerWidth maskContentUnits maskUnits numOctaves pathLength patternContentUnits patternTransform patternUnits pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits refX refY repeatCount repeatDur requiredExtensions requiredFeatures specularConstant specularExponent spreadMethod startOffset stdDeviation stitchTiles surfaceScale systemLanguage tableValues targetX targetY textLength viewBox viewTarget xChannelSelector yChannelSelector zoomAndPan".split(" "),c=function(a){for(var b={},c=a.length;c--;)b[a[c].toLowerCase()]=a[c];return b},d=c(a.concat(b)),function(a){var b=a.toLowerCase();return d[b]||b}}(),Zd=function(a,b){return function(){var c=this.fragment.getValue();b(c,this.value)||("id"===this.name&&this.value&&delete this.root.nodes[this.value],this.value=c,"value"===this.name&&this.node&&(this.node._ractive.value=c),this.rendered&&a.addView(this))}}(y,u),$d=function(){var a=/^(allowFullscreen|async|autofocus|autoplay|checked|compact|controls|declare|default|defaultChecked|defaultMuted|defaultSelected|defer|disabled|draggable|enabled|formNoValidate|hidden|indeterminate|inert|isMap|itemScope|loop|multiple|muted|noHref|noResize|noShade|noValidate|noWrap|open|pauseOnExit|readOnly|required|reversed|scoped|seamless|selected|sortable|translate|trueSpeed|typeMustMatch|visible)$/i;return a}(),_d=function(a,b){return function(c,d){var e,f;if(e=d.indexOf(":"),-1===e||(f=d.substr(0,e),"xmlns"===f))c.name=c.element.namespace!==a.html?b(d):d;else if(d=d.substring(e+1),c.name=b(d),c.namespace=a[f.toLowerCase()],c.namespacePrefix=f,!c.namespace)throw'Unknown namespace ("'+f+'")'}}(C,Yd),ae=function(a){return function(b){var c=b.fragment.items;if(1===c.length)return c[0].type===a.INTERPOLATOR?c[0]:void 0}}(S),be=function(a,b){var c={"accept-charset":"acceptCharset",accesskey:"accessKey",bgcolor:"bgColor","class":"className",codebase:"codeBase",colspan:"colSpan",contenteditable:"contentEditable",datetime:"dateTime",dirname:"dirName","for":"htmlFor","http-equiv":"httpEquiv",ismap:"isMap",maxlength:"maxLength",novalidate:"noValidate",pubdate:"pubDate",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return function(d,e){var f;!d.pNode||d.namespace||e.pNode.namespaceURI&&e.pNode.namespaceURI!==a.html||(f=c[d.name]||d.name,void 0!==e.pNode[f]&&(d.propertyName=f),(b.test(f)||"value"===f)&&(d.useProperty=!0))}}(C,$d),ce=function(a,b,c,d,e,f){var g;return f.push(function(){g=f.Fragment}),function(f){return this.type=a.ATTRIBUTE,this.element=f.element,this.root=f.root,c(this,f.name),f.value&&"string"!=typeof f.value?(this.parentFragment=this.element.parentFragment,this.fragment=new g({template:f.value,root:this.root,owner:this}),this.value=this.fragment.getValue(),this.interpolator=d(this),this.isBindable=!!this.interpolator&&!this.interpolator.isStatic,e(this,f),void(this.ready=!0)):void(this.value=b.test(this.name)?!0:f.value||"")}}(S,$d,_d,ae,be,f),de=function(a,b,c,d){this.fragment&&this.fragment.rebind(a,b,c,d)},ee=function(a,b){var c={"accept-charset":"acceptCharset",accesskey:"accessKey",bgcolor:"bgColor","class":"className",codebase:"codeBase",colspan:"colSpan",contenteditable:"contentEditable",datetime:"dateTime",dirname:"dirName","for":"htmlFor","http-equiv":"httpEquiv",ismap:"isMap",maxlength:"maxLength",novalidate:"noValidate",pubdate:"pubDate",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return function(d){var e;this.node=d,d.namespaceURI&&d.namespaceURI!==a.html||(e=c[this.name]||this.name,void 0!==d[e]&&(this.propertyName=e),(b.test(e)||"value"===e)&&(this.useProperty=!0),"value"===e&&(this.useProperty=!0,d._ractive.value=this.value)),this.rendered=!0,this.update()}}(C,$d),fe=function(a){function b(a){return a.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'")}var c;return c=function(){var c=(g=this).name,d=g.namespacePrefix,e=g.value,f=g.interpolator,g=g.fragment;if(("value"!==c||"select"!==this.element.name&&"textarea"!==this.element.name)&&("value"!==c||void 0===this.element.getAttribute("contenteditable")))return"name"===c&&"input"===this.element.name&&f?"name={{"+(f.keypath||f.ref)+"}}":a.test(c)?e?c:"":(g&&(e=g.toString()),d&&(c=d+":"+c),e?c+'="'+b(e)+'"':c)}}($d),ge=function(){this.fragment&&this.fragment.unbind(),"id"===this.name&&delete this.root.nodes[this.value]},he=function(){var a,b,c,d,e=this.value;if(!this.locked)for(this.node._ractive.value=e,a=this.node.options,d=a.length;d--;)if(b=a[d],c=b._ractive?b._ractive.value:b.value,c==e){b.selected=!0;break}},ie=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]==b)return!0;return!1},je=function(a,b){return function(){var c,d,e,f,g=this.value;for(b(g)||(g=[g]),c=this.node.options,d=c.length;d--;)e=c[d],f=e._ractive?e._ractive.value:e.value,e.selected=a(g,f)}}(ie,h),ke=function(){var a=(b=this).node,b=b.value;a.checked=b==a._ractive.value},le=function(a){return function(){var b,c,d,e,f=this.node;if(b=f.checked,f.value=this.element.getAttribute("value"),f.checked=this.element.getAttribute("value")===this.element.getAttribute("name"),b&&!f.checked&&this.element.binding&&(d=this.element.binding.siblings,e=d.length)){for(;e--;){if(c=d[e],!c.element.node)return;if(c.element.node.checked)return a.addViewmodel(c.root.viewmodel),c.handleChange()}a.addViewmodel(c.root.viewmodel),this.root.viewmodel.set(c.keypath,void 0)}}}(y),me=function(a){return function(){var b,c,d=(f=this).element,e=f.node,f=f.value;if(b=d.getAttribute("value"),a(f)){for(c=f.length;c--;)if(b==f[c])return void(e.checked=!0);e.checked=!1}else e.checked=f==b}}(h),ne=function(){var a,b;a=this.node,b=this.value,void 0===b&&(b=""),a.className=b},oe=function(){var a=(b=this).node,b=b.value;this.root.nodes[b]=a,a.id=b},pe=function(){var a,b;a=this.node,b=this.value,void 0===b&&(b=""),a.style.setAttribute("cssText",b)},qe=function(){var a=this.value;void 0===a&&(a=""),this.locked||(this.node.innerHTML=a)},re=function(){var a=(b=this).node,b=b.value;a._ractive.value=b,this.locked||(a.value=void 0==b?"":b)},se=function(){this.locked||(this.node[this.propertyName]=this.value)},te=function(a){return function(){var b=(f=this).node,c=f.namespace,d=f.name,e=f.value,f=f.fragment;c?b.setAttributeNS(c,d,(f||e).toString()):a.test(d)?e?b.setAttribute(d,""):b.removeAttribute(d):b.setAttribute(d,(f||e).toString())}}($d),ue=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){return function(){var o,p,q=(s=this).name,r=s.element,s=s.node;"id"===q?p=i:"value"===q?"select"===r.name&&"value"===q?p=r.getAttribute("multiple")?d:c:"textarea"===r.name?p=l:null!=r.getAttribute("contenteditable")?p=k:"input"===r.name&&(o=r.getAttribute("type"),p="file"===o?b:"radio"===o&&r.binding&&"name"===r.binding.name?f:l):this.twoway&&"name"===q?"radio"===s.type?p=e:"checkbox"===s.type&&(p=g):"style"===q&&s.style.setAttribute?p=j:"class"!==q||s.namespaceURI&&s.namespaceURI!==a.html?this.useProperty&&(p=m):p=h,p||(p=n),this.update=p,this.update()}}(C,Sb,he,je,ke,le,me,ne,oe,pe,qe,re,se,te),ve=function(a,b,c,d,e,f,g){var h=function(a){this.init(a)};return h.prototype={bubble:a,init:b,rebind:c,render:d,toString:e,unbind:f,update:g},h}(Zd,ce,de,ee,fe,ge,ue),we=function(a){return function(b,c){var d,e,f=[];for(d in c)c.hasOwnProperty(d)&&(e=new a({element:b,name:d,value:c[d],root:b.root}),f.push(f[d]=e)); return f}}(ve),xe=function(a,b,c,d){function e(a,b){var c=b?"svg":"div";return i.innerHTML="<"+c+" "+a+">",d(i.childNodes[0].attributes)}function f(a,b){for(var c=a.length;c--;)if(a[c].name===b.name)return!1;return!0}var g,h,i;"undefined"!=typeof document&&(i=c("div")),a.push(function(){h=a.Fragment});var j=function(a,b){this.element=a,this.root=a.root,this.parentFragment=a.parentFragment,this.attributes=[],this.fragment=new h({root:a.root,owner:this,template:[b]})};return j.prototype={bubble:function(){this.node&&this.update(),this.element.bubble()},rebind:function(a,b,c,d){this.fragment.rebind(a,b,c,d)},render:function(a){this.node=a,this.isSvg=a.namespaceURI===b.svg,this.update()},unbind:function(){this.fragment.unbind()},update:function(){var a,b,c=this;a=this.fragment.toString(),b=e(a,this.isSvg),this.attributes.filter(function(a){return f(b,a)}).forEach(function(a){c.node.removeAttribute(a.name)}),b.forEach(function(a){c.node.setAttribute(a.name,a.value)}),this.attributes=b},toString:function(){return this.fragment.toString()}},g=j}(f,C,D,Hd),ye=function(a){return function(b,c){return c?c.map(function(c){return new a(b,c)}):[]}}(xe),ze=function(a){for(var b,c,d=Array.prototype.slice,e=d.call(arguments,1);c=e.shift();)for(b in c)c.hasOwnProperty(b)&&(a[b]=c[b]);return a},Ae=function(a,b,c,d,e){var f=function(a){var c,d,e;return this.element=a,this.root=a.root,this.attribute=a.attributes[this.name||"value"],c=this.attribute.interpolator,c.twowayBinding=this,c.keypath&&"${"===c.keypath.substr(0,2)?(b("Two-way binding does not work with expressions (`"+c.keypath.slice(2,-1)+"`)"),!1):(c.keypath||c.resolver.forceResolution(),this.keypath=d=c.keypath,void(void 0===this.root.viewmodel.get(d)&&this.getInitialValue&&(e=this.getInitialValue(),void 0!==e&&this.root.viewmodel.set(d,e))))};return f.prototype={handleChange:function(){var b=this;a.start(this.root),this.attribute.locked=!0,this.root.viewmodel.set(this.keypath,this.getValue()),a.scheduleTask(function(){return b.attribute.locked=!1}),a.end()},rebound:function(){var a,b,c;b=this.keypath,c=this.attribute.interpolator.keypath,b!==c&&(e(this.root._twowayBindings[b],this),this.keypath=c,a=this.root._twowayBindings[c]||(this.root._twowayBindings[c]=[]),a.push(this))},unbind:function(){}},f.extend=function(a){var b,e=this;return b=function(a){f.call(this,a),this.init&&this.init()},b.prototype=c(e.prototype),d(b.prototype,a),b.extend=f.extend,b},f}(y,m,T,ze,q),Be=function(){this._ractive.binding.handleChange()},Ce=function(a,b){var c=a.extend({getInitialValue:function(){return this.element.fragment?this.element.fragment.toString():""},render:function(){var a=this.element.node;a.addEventListener("change",b,!1),this.root.lazy||(a.addEventListener("input",b,!1),a.attachEvent&&a.addEventListener("keyup",b,!1))},unrender:function(){var a=this.element.node;a.removeEventListener("change",b,!1),a.removeEventListener("input",b,!1),a.removeEventListener("keyup",b,!1)},getValue:function(){return this.element.node.innerHTML}});return c}(Ae,Be),De=function(){var a={};return function(b,c,d){var e=b+c+d;return a[e]||(a[e]=[])}}(),Ee=function(a,b,c,d,e){var f=c.extend({name:"checked",init:function(){this.siblings=d(this.root._guid,"radio",this.element.getAttribute("name")),this.siblings.push(this)},render:function(){var a=this.element.node;a.addEventListener("change",e,!1),a.attachEvent&&a.addEventListener("click",e,!1)},unrender:function(){var a=this.element.node;a.removeEventListener("change",e,!1),a.removeEventListener("click",e,!1)},handleChange:function(){a.start(this.root),this.siblings.forEach(function(a){a.root.viewmodel.set(a.keypath,a.getValue())}),a.end()},getValue:function(){return this.element.node.checked},unbind:function(){b(this.siblings,this)}});return f}(y,q,Ae,De,Be),Fe=function(a,b,c,d){var e=b.extend({name:"name",init:function(){this.siblings=d(this.root._guid,"radioname",this.keypath),this.siblings.push(this),this.radioName=!0,this.attribute.twoway=!0},getInitialValue:function(){return this.element.getAttribute("checked")?this.element.getAttribute("value"):void 0},render:function(){var a=this.element.node;a.name="{{"+this.keypath+"}}",a.checked=this.root.viewmodel.get(this.keypath)==this.element.getAttribute("value"),a.addEventListener("change",c,!1),a.attachEvent&&a.addEventListener("click",c,!1)},unrender:function(){var a=this.element.node;a.removeEventListener("change",c,!1),a.removeEventListener("click",c,!1)},getValue:function(){var a=this.element.node;return a._ractive?a._ractive.value:a.value},handleChange:function(){this.element.node.checked&&b.prototype.handleChange.call(this)},rebound:function(a,c,d,e){var f;b.prototype.rebound.call(this,a,c,d,e),(f=this.element.node)&&(f.name="{{"+this.keypath+"}}")},unbind:function(){a(this.siblings,this)}});return e}(q,Ae,Be,De),Ge=function(a,b,c,d,e,f){function g(a){return a.isChecked}function h(a){return a.element.getAttribute("value")}var i=d.extend({name:"name",getInitialValue:function(){return this.noInitialValue=!0,[]},init:function(){var a,b;this.checkboxName=!0,this.attribute.twoway=!0,this.siblings=e(this.root._guid,"checkboxes",this.keypath),this.siblings.push(this),this.noInitialValue&&(this.siblings.noInitialValue=!0),this.siblings.noInitialValue&&this.element.getAttribute("checked")&&(a=this.root.viewmodel.get(this.keypath),b=this.element.getAttribute("value"),a.push(b))},unbind:function(){c(this.siblings,this)},render:function(){var c,d,e=this.element.node;c=this.root.viewmodel.get(this.keypath),d=this.element.getAttribute("value"),this.isChecked=a(c)?b(c,d):c==d,e.name="{{"+this.keypath+"}}",e.checked=this.isChecked,e.addEventListener("change",f,!1),e.attachEvent&&e.addEventListener("click",f,!1)},unrender:function(){var a=this.element.node;a.removeEventListener("change",f,!1),a.removeEventListener("click",f,!1)},changed:function(){var a=!!this.isChecked;return this.isChecked=this.element.node.checked,this.isChecked===a},handleChange:function(){this.isChecked=this.element.node.checked,d.prototype.handleChange.call(this)},getValue:function(){return this.siblings.filter(g).map(h)}});return i}(h,ie,q,Ae,De,Be),He=function(a,b){var c=a.extend({name:"checked",render:function(){var a=this.element.node;a.addEventListener("change",b,!1),a.attachEvent&&a.addEventListener("click",b,!1)},unrender:function(){var a=this.element.node;a.removeEventListener("change",b,!1),a.removeEventListener("click",b,!1)},getValue:function(){return this.element.node.checked}});return c}(Ae,Be),Ie=function(a,b,c){var d=b.extend({getInitialValue:function(){var a,b,c,d,e=this.element.options;if(void 0===this.element.getAttribute("value")&&(b=a=e.length,a)){for(;b--;)if(e[b].getAttribute("selected")){c=e[b].getAttribute("value"),d=!0;break}if(!d)for(;++bb;b+=1)if(d=a[b],a[b].selected)return e=d._ractive?d._ractive.value:d.value},forceUpdate:function(){var b=this,c=this.getValue();void 0!==c&&(this.attribute.locked=!0,a.addViewmodel(this.root.viewmodel),a.scheduleTask(function(){return b.attribute.locked=!1}),this.root.viewmodel.set(this.keypath,c))}});return d}(y,Ae,Be),Je=function(a){return function(b,c){var d;if(!a(b)||!a(c))return!1;if(b.length!==c.length)return!1;for(d=b.length;d--;)if(b[d]!==c[d])return!1;return!0}}(h),Ke=function(a,b,c,d){var e=c.extend({getInitialValue:function(){return this.element.options.filter(function(a){return a.getAttribute("selected")}).map(function(a){return a.getAttribute("value")})},render:function(){var a;this.element.node.addEventListener("change",d,!1),a=this.root.viewmodel.get(this.keypath),void 0===a&&this.handleChange()},unrender:function(){this.element.node.removeEventListener("change",d,!1)},setValue:function(){throw new Error("TODO not implemented yet")},getValue:function(){var a,b,c,d,e,f;for(a=[],b=this.element.node.options,d=b.length,c=0;d>c;c+=1)e=b[c],e.selected&&(f=e._ractive?e._ractive.value:e.value,a.push(f));return a},handleChange:function(){var a,d,e;return a=this.attribute,d=a.value,e=this.getValue(),void 0!==d&&b(e,d)||c.prototype.handleChange.call(this),this},forceUpdate:function(){var b=this,c=this.getValue();void 0!==c&&(this.attribute.locked=!0,a.addViewmodel(this.root.viewmodel),a.scheduleTask(function(){return b.attribute.locked=!1}),this.root.viewmodel.set(this.keypath,c))},updateModel:function(){void 0!==this.attribute.value&&this.attribute.value.length||this.root.viewmodel.set(this.keypath,this.initialValue)}});return e}(y,Je,Ie,Be),Le=function(a,b){var c=a.extend({render:function(){this.element.node.addEventListener("change",b,!1)},unrender:function(){this.element.node.removeEventListener("change",b,!1)},getValue:function(){return this.element.node.files}});return c}(Ae,Be),Me=function(a,b){function c(){var a;b.call(this),a=this._ractive.root.viewmodel.get(this._ractive.binding.keypath,f),this.value=void 0==a?"":a}var d,e,f;return f={evaluateWrapped:!0},e=a.extend({getInitialValue:function(){return""},getValue:function(){return this.element.node.value},render:function(){var a=this.element.node;a.addEventListener("change",b,!1),this.root.lazy||(a.addEventListener("input",b,!1),a.attachEvent&&a.addEventListener("keyup",b,!1)),a.addEventListener("blur",c,!1)},unrender:function(){var a=this.element.node;a.removeEventListener("change",b,!1),a.removeEventListener("input",b,!1),a.removeEventListener("keyup",b,!1),a.removeEventListener("blur",c,!1)}}),d=e}(Ae,Be),Ne=function(a){return a.extend({getInitialValue:function(){return void 0},getValue:function(){var a=parseFloat(this.element.node.value);return isNaN(a)?void 0:a}})}(Me),Oe=function(a,b,c,d,e,f,g,h,i,j,k){function l(a){return a&&a.isBindable}var m;return m=function(m){var n,o,p,q,r=m.attributes;return m.binding&&(m.binding.teardown(),m.binding=null),(m.getAttribute("contenteditable")||r.contenteditable&&l(r.contenteditable))&&l(r.value)?o=b:"input"===m.name?(n=m.getAttribute("type"),"radio"===n||"checkbox"===n?(p=l(r.name),q=l(r.checked),p&&q&&a.error({message:"badRadioInputBinding"}),p?o="radio"===n?d:e:q&&(o="radio"===n?c:f)):"file"===n&&l(r.value)?o=i:l(r.value)&&(o="number"===n||"range"===n?j:k)):"select"===m.name&&l(r.value)?o=m.getAttribute("multiple")?h:g:"textarea"===m.name&&l(r.value)&&(o=k),o?new o(m):void 0}}(o,Ce,Ee,Fe,Ge,He,Ie,Ke,Le,Ne,Me),Pe=function(){var a=this.getAction();a&&!this.hasListener?this.listen():!a&&this.hasListener&&this.unrender()},Qe=function(a){return function(b){a(this.root,this.getAction(),{event:b})}}(mc),Re=function(){return this.action.toString().trim()},Se=function(a,b,c,d,e){function f(a){var b,c,d;if(b=this.root,"function"!=typeof b[this.method])throw new Error('Attempted to call a non-existent method ("'+this.method+'")');c=this.keypaths.map(function(c){var d,e,f;if(void 0===c)return void 0;if(c.eventObject){if(d=a,e=c.refinements.length)for(f=0;e>f;f+=1)d=d[c.refinements[f]]}else d=b.viewmodel.get(c);return d}),b.event=a,d=this.fn.apply(null,c),b[this.method].apply(b,d),delete b.event}function g(a){d(this.root,this.getAction(),{event:a,args:this.params})}function h(a){var b=this.dynamicParams.getValue(k);"string"==typeof b&&(b=b.substr(1,b.length-2)),d(this.root,this.getAction(),{event:a,args:b})}var i,j,k={args:!0},l=/^event(?:\.(.+))?/;return c.push(function(){j=c.Fragment}),i=function(c,d,i){var k,m,n,o=this;o.element=c,o.root=c.root,o.name=d,-1!==d.indexOf("*")&&(e.error({debug:this.root.debug,message:"noElementProxyEventWildcards",args:{element:c.tagName,event:d}}),this.invalid=!0),i.m?(m=i.a.r,o.method=i.m,o.keypaths=[],o.fn=a(i.a.s,m.length),o.parentFragment=c.parentFragment,n=o.root,o.refResolvers=m.map(function(a,c){var d;return(d=l.exec(a))?(o.keypaths[c]={eventObject:!0,refinements:d[1]?d[1].split("."):[]},null):b(o,a,function(a){o.resolve(c,a)})}),this.fire=f):(k=i.n||i,"string"!=typeof k&&(k=new j({template:k,root:this.root,owner:this})),this.action=k,i.d?(this.dynamicParams=new j({template:i.d,root:this.root,owner:this.element}),this.fire=h):i.a&&(this.params=i.a,this.fire=g))}}(cd,bd,f,mc,o),Te=function(a){var b,c;b=this._ractive,c=b.events[a.type],c.fire({node:this,original:a,index:b.index,keypath:b.keypath,context:b.root.get(b.keypath)})},Ue=function(a,b,c){function d(a){return f[a]||(f[a]=function(b){var c=b.node._ractive;b.index=c.index,b.keypath=c.keypath,b.context=c.root.get(c.keypath),c.events[a].fire(b)}),f[a]}var e,f={},g={touchstart:!0,touchmove:!0,touchend:!0,touchcancel:!0,touchleave:!0};return e=function(){var e,f=this.name;if(!this.invalid){if(e=a.registries.events.find(this.root,f))this.custom=e(this.node,d(f));else{if(!("on"+f in this.node||window&&"on"+f in window))return void(g[f]||c.error({debug:this.root.debug,message:"missingPlugin",args:{plugin:"event",name:f}}));this.node.addEventListener(f,b,!1)}this.hasListener=!0}}}(Vb,Te,o),Ve=function(a,b,c,d){function e(e){e&&e.rebind(a,b,c,d)}var f;return this.method?(f=this.element.parentFragment,void this.refResolvers.forEach(e)):("string"!=typeof this.action&&e(this.action),void(this.dynamicParams&&e(this.dynamicParams)))},We=function(){this.node=this.element.node,this.node._ractive.events[this.name]=this,(this.method||this.getAction())&&this.listen()},Xe=function(a,b){this.keypaths[a]=b},Ye=function(){function a(a){a.unbind()}var b;return b=function(){return this.method?void this.refResolvers.forEach(a):("string"!=typeof this.action&&this.action.unbind(),void(this.dynamicParams&&this.dynamicParams.unbind()))}}(),Ze=function(a){return function(){this.custom?this.custom.teardown():this.node.removeEventListener(this.name,a,!1),this.hasListener=!1}}(Te),$e=function(a,b,c,d,e,f,g,h,i,j){var k=function(a,b,c){this.init(a,b,c)};return k.prototype={bubble:a,fire:b,getAction:c,init:d,listen:e,rebind:f,render:g,resolve:h,unbind:i,unrender:j},k}(Pe,Qe,Re,Se,Ue,Ve,We,Xe,Ye,Ze),_e=function(a){return function(b,c){var d,e,f,g,h=[];for(e in c)if(c.hasOwnProperty(e))for(f=e.split("-"),d=f.length;d--;)g=new a(b,f[d],c[e]),h.push(g);return h}}($e),af=function(a,b,c){var d,e,f;return b.push(function(){d=b.Fragment}),e={args:!0},f=function(b,f){var g,h,i,j=this;j.element=b,j.root=g=b.root,h=f.n||f,"string"!=typeof h&&(i=new d({template:h,root:g,owner:b}),h=i.toString(),i.unbind()),f.a?j.params=f.a:f.d&&(j.fragment=new d({template:f.d,root:g,owner:b}),j.params=j.fragment.getValue(e),j.fragment.bubble=function(){this.dirtyArgs=this.dirtyValue=!0,j.params=this.getValue(e),j.ready&&j.update()}),j.fn=c.registries.decorators.find(g,h),j.fn||a.error({debug:g.debug,message:"missingPlugin",args:{plugin:"decorator",name:h}})},f.prototype={init:function(){var a,b,c,d=this;if(a=d.element.node,d.params?(c=[a].concat(d.params),b=d.fn.apply(d.root,c)):b=d.fn.call(d.root,a),!b||!b.teardown)throw new Error("Decorator definition must return an object with a teardown method");d.actual=b,d.ready=!0},update:function(){this.actual.update?this.actual.update.apply(this.root,this.params):(this.actual.teardown(!0),this.init())},rebind:function(a,b,c,d){this.fragment&&this.fragment.rebind(a,b,c,d)},teardown:function(a){this.actual.teardown(),!a&&this.fragment&&this.fragment.unbind()}},f}(o,f,Vb),bf=function(a){function b(a,b){for(var c=a.length;c--;)if(a[c]==b)return!0}var c;return c=function(c){var d,e,f,g,h;d=c.node,d&&(g=a(d.options),e=c.getAttribute("value"),f=c.getAttribute("multiple"),void 0!==e?(g.forEach(function(a){var c,d;c=a._ractive?a._ractive.value:a.value,d=f?b(e,c):e==c,d&&(h=!0),a.selected=d}),h||(g[0]&&(g[0].selected=!0),c.binding&&c.binding.forceUpdate())):c.binding&&c.binding.forceUpdate())}}(Hd),cf=function(a,b){return function(){var c=this;this.dirty||(this.dirty=!0,a.scheduleTask(function(){b(c),c.dirty=!1})),this.parentFragment.bubble()}}(y,bf),df=function(a){do if("select"===a.name)return a;while(a=a.parent)},ef=function(a){return function(b,c){b.select=a(b.parent),b.select&&(b.select.options.push(b),c.a||(c.a={}),void 0!==c.a.value||c.a.hasOwnProperty("disabled")||(c.a.value=c.f),"selected"in c.a&&void 0!==b.select.getAttribute("value")&&delete c.a.selected)}}(df),ff=function(a,b,c,d,e,f,g,h,i,j){var k;return j.push(function(){k=j.Fragment}),function(j){var l,m,n,o,p;this.type=a.ELEMENT,l=this.parentFragment=j.parentFragment,m=this.template=j.template,this.parent=j.pElement||l.pElement,this.root=n=l.root,this.index=j.index,this.name=b(m.e),"option"===this.name&&i(this,m),"select"===this.name&&(this.options=[],this.bubble=h),this.attributes=c(this,m.a),this.conditionalAttributes=d(this,m.m),m.f&&(this.fragment=new k({template:m.f,root:n,owner:this,pElement:this})),n.twoway&&(o=e(this,m.a))&&(this.binding=o,p=this.root._twowayBindings[o.keypath]||(this.root._twowayBindings[o.keypath]=[]),p.push(o)),m.v&&(this.eventHandlers=f(this,m.v)),m.o&&(this.decorator=new g(this,m.o)),this.intro=m.t0||m.t1,this.outro=m.t0||m.t2}}(S,Yd,we,ye,Oe,_e,af,cf,ef,f),gf=function(a){return function(b,c){return b===c||a(b,c)}}(Yc),hf=function(a,b){return function(c,d,e,f){var g=c[d];g&&!a(g,f)&&a(g,e)&&(c[d]=b(g,e,f))}}(gf,Zc),jf=function(a){return function(b,c,d,e){function f(a){a.rebind(b,c,d,e)}var g,h,i,j;if(this.attributes&&this.attributes.forEach(f),this.conditionalAttributes&&this.conditionalAttributes.forEach(f),this.eventHandlers&&this.eventHandlers.forEach(f),this.decorator&&f(this.decorator),this.fragment&&f(this.fragment),i=this.liveQueries)for(j=this.root,g=i.length;g--;)i[g]._makeDirty();this.node&&(h=this.node._ractive)&&(a(h,"keypath",d,e),void 0!=b&&(h.index[b]=c))}}(hf),kf=function(a){var b;(a.attributes.width||a.attributes.height)&&a.node.addEventListener("load",b=function(){var c=a.getAttribute("width"),d=a.getAttribute("height");void 0!==c&&a.node.setAttribute("width",c),void 0!==d&&a.node.setAttribute("height",d),a.node.removeEventListener("load",b,!1)},!1)},lf=function(a,b,c){var d,e={};return c.push(function(){d=c.Fragment}),function(c,f,g){var h,i,j,k=this;return k.element=c,k.root=h=c.root,k.isIntro=g,i=f.n||f,"string"!=typeof i&&(j=new d({template:i,root:h,owner:c}),i=j.toString(),j.unbind()),k.name=i,f.a?k.params=f.a:f.d&&(j=new d({template:f.d,root:h,owner:c}),k.params=j.getValue(e),j.unbind()),k._fn=b.registries.transitions.find(h,i),k._fn?void 0:void a.error({debug:h.debug,message:"missingPlugin",args:{plugin:"transition",name:i}})}}(o,Vb,f),mf=function(a){return a.replace(/-([a-zA-Z])/g,function(a,b){return b.toUpperCase()})},nf=function(a,b,c,d){var e,f,g;return a?(f={},g=c("div").style,e=function(a){var c,e,h;if(a=d(a),!f[a])if(void 0!==g[a])f[a]=a;else for(h=a.charAt(0).toUpperCase()+a.substring(1),c=b.length;c--;)if(e=b[c],void 0!==g[e+h]){f[a]=e+h;break}return f[a]}):e=null,e}(E,K,D,mf),of=function(a,b,c,d){var e,f;return b?(f=window.getComputedStyle||a.getComputedStyle,e=function(a){var b,e,g,h,i;if(b=f(this.node),"string"==typeof a)return i=b[d(a)],"0px"===i&&(i=0),i;if(!c(a))throw new Error("Transition$getStyle must be passed a string, or an array of strings representing CSS properties");for(e={},g=a.length;g--;)h=a[g],i=b[d(h)],"0px"===i&&(i=0),e[h]=i;return e}):e=null,e}(vb,E,h,nf),pf=function(a){return function(b,c){var d;if("string"==typeof b)this.node.style[a(b)]=c;else for(d in b)b.hasOwnProperty(d)&&(this.node.style[a(d)]=b[d]);return this}}(nf),qf=function(a,b,c){function d(a){return a}var e,f=function(e){var f;this.duration=e.duration,this.step=e.step,this.complete=e.complete,"string"==typeof e.easing?(f=e.root.easing[e.easing],f||(a('Missing easing function ("'+e.easing+'"). You may need to download a plugin from [TODO]'),f=d)):f="function"==typeof e.easing?e.easing:d,this.easing=f,this.start=b(),this.end=this.start+this.duration,this.running=!0,c.add(this)};return f.prototype={tick:function(a){var b,c;return this.running?a>this.end?(this.step&&this.step(1),this.complete&&this.complete(1),!1):(b=a-this.start,c=this.easing(b/this.duration),this.step&&this.step(c),!0):!1},stop:function(){this.abort&&this.abort(),this.running=!1}},e=f}(m,M,N),rf=function(a){var b=new RegExp("^-(?:"+a.join("|")+")-");return function(a){return a.replace(b,"")}}(K),sf=function(a){var b=new RegExp("^(?:"+a.join("|")+")([A-Z])");return function(a){var c;return a?(b.test(a)&&(a="-"+a),c=a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})):""}}(K),tf=function(a,b,c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r={},s={};return a?(k=c("div").style,function(){void 0!==k.transition?(l="transition",m="transitionend",n=!0):void 0!==k.webkitTransition?(l="webkitTransition",m="webkitTransitionEnd",n=!0):n=!1}(),l&&(o=l+"Duration",p=l+"Property",q=l+"TimingFunction"),j=function(a,c,j,k,l){setTimeout(function(){var t,u,v,w,x;w=function(){u&&v&&(a.root.fire(a.name+":end",a.node,a.isIntro),l())},t=(a.node.namespaceURI||"")+a.node.tagName,a.node.style[p]=k.map(g).map(i).join(","),a.node.style[q]=i(j.easing||"linear"),a.node.style[o]=j.duration/1e3+"s",x=function(b){var c;c=k.indexOf(d(h(b.propertyName))),-1!==c&&k.splice(c,1),k.length||(a.node.removeEventListener(m,x,!1),v=!0,w())},a.node.addEventListener(m,x,!1),setTimeout(function(){for(var h,i,l,o,p,q=k.length,y=[];q--;)o=k[q],h=t+o,n&&!s[h]&&(a.node.style[g(o)]=c[o],r[h]||(i=a.getStyle(o),r[h]=a.getStyle(o)!=c[o],s[h]=!r[h],s[h]&&(a.node.style[g(o)]=i))),(!n||s[h])&&(void 0===i&&(i=a.getStyle(o)),l=k.indexOf(o),-1===l?b("Something very strange happened with transitions. If you see this message, please let @RactiveJS know. Thanks!"):k.splice(l,1),p=/[^\d]*$/.exec(c[o])[0],y.push({name:g(o),interpolator:e(parseFloat(i),parseFloat(c[o])),suffix:p}));y.length?new f({root:a.root,duration:j.duration,easing:d(j.easing||""),step:function(b){var c,d;for(d=y.length;d--;)c=y[d],a.node.style[c.name]=c.interpolator(b)+c.suffix},complete:function(){u=!0,w()}}):u=!0,k.length||(a.node.removeEventListener(m,x,!1),v=!0,w())},0)},j.delay||0)}):j=null,j}(E,m,D,mf,Wb,qf,nf,rf,sf),uf=function(a){function b(){i.hidden=document[e]}function c(){i.hidden=!0}function d(){i.hidden=!1}var e,f,g,h,i;if("undefined"!=typeof document){if(e="hidden",i={},e in document)g="";else for(h=a.length;h--;)f=a[h],e=f+"Hidden",e in document&&(g=f);void 0!==g?(document.addEventListener(g+"visibilitychange",b),b()):("onfocusout"in document?(document.addEventListener("focusout",c),document.addEventListener("focusin",d)):(window.addEventListener("pagehide",c),window.addEventListener("blur",c),window.addEventListener("pageshow",d),window.addEventListener("focus",d)),i.hidden=!1)}return i}(K),vf=function(a,b,c,d,e,f,g){var h,i,j;return b?(i=window.getComputedStyle||a.getComputedStyle,h=function(a,b,h,k){var l,m=this;if(g.hidden)return this.setStyle(a,b),j||(j=d.resolve());"string"==typeof a?(l={},l[a]=b):(l=a,k=h,h=b),h||(c('The "'+m.name+'" transition does not supply an options object to `t.animateStyle()`. This will break in a future version of Ractive. For more info see https://github.com/RactiveJS/Ractive/issues/340'),h=m,k=m.complete);var n=new d(function(a){var b,c,d,g,j,k,n;if(!h.duration)return m.setStyle(l),void a();for(b=Object.keys(l),c=[],d=i(m.node),j={},k=b.length;k--;)n=b[k],g=d[e(n)],"0px"===g&&(g=0),g!=l[n]&&(c.push(n),m.node.style[e(n)]=g);return c.length?void f(m,l,h,c,a):void a()});return k&&(c("t.animateStyle returns a Promise as of 0.4.0. Transition authors should do t.animateStyle(...).then(callback)"),n.then(k)),n}):h=null,h}(vb,E,m,r,nf,tf,uf),wf=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);return c.forEach(function(b){for(var c in b)!b.hasOwnProperty(c)||c in a||(a[c]=b[c])}),a},xf=function(a){return function(b,c){return"number"==typeof b?b={duration:b}:"string"==typeof b?b="slow"===b?{duration:600}:"fast"===b?{duration:200}:{duration:400}:b||(b={}),a({},b,c)}}(wf),yf=function(){function a(a,b){b?a.setAttribute("style",b):(a.getAttribute("style"),a.removeAttribute("style"))}var b;return b=function(){var b,c,d,e=this;return b=e.node=e.element.node,c=b.getAttribute("style"),e.complete=function(f){d||(!f&&e.isIntro&&a(b,c),b._ractive.transition=null,e._manager.remove(e),d=!0)},e._fn?void e._fn.apply(e.root,[e].concat(e.params)):void e.complete()}}(),zf=function(a,b,c,d,e,f,g){var h,i;return g.push(function(){h=g.Fragment}),i=function(a,b,c){this.init(a,b,c)},i.prototype={init:a,start:f,getStyle:b,setStyle:c,animateStyle:d,processParams:e},i}(lf,of,pf,vf,xf,yf,f),Af=function(a,b,c,d,e,f,g,h,i,j,k){function l(b){var c,d,e;return c=(d=b.getAttribute("xmlns"))?d:"svg"===b.name?a.svg:(e=b.parent)?"foreignObject"===e.name?a.html:e.node.namespaceURI:b.root.el.namespaceURI}function m(a){var c,d,e;if(a.select&&(d=a.select.getAttribute("value"),void 0!==d))if(c=a.getAttribute("value"),a.select.node.multiple&&b(d)){for(e=d.length;e--;)if(c==d[e]){a.node.selected=!0;break}}else a.node.selected=c==d}function n(a){var b,c,d,e,f;b=a.root;do for(c=b._liveQueries,d=c.length;d--;)e=c[d],f=c["_"+e],f._test(a)&&(a.liveQueries||(a.liveQueries=[])).push(f);while(b=b._parent)}var o,p,q;return p=function(){var a=this.node,b=this.fragment.toString(!1);if(window&&window.appearsToBeIELessEqual8&&(a.type="text/css"),a.styleSheet)a.styleSheet.cssText=b;else{for(;a.hasChildNodes();)a.removeChild(a.firstChild);a.appendChild(document.createTextNode(b))}},q=function(){this.node.type&&"text/javascript"!==this.node.type||c("Script tag was updated. This does not cause the code to be re-evaluated!"),this.node.text=this.fragment.toString(!1)},o=function(){var a,b,c=this,o=this.root;if(a=l(this),b=this.node=e(this.name,a),o.constructor.css&&this.parentFragment.getNode()===o.el&&this.node.setAttribute("data-rvcguid",o.constructor._guid),f(this.node,"_ractive",{value:{proxy:this,keypath:i(this.parentFragment),index:this.parentFragment.indexRefs,events:d(null),root:o}}),this.attributes.forEach(function(a){return a.render(b)}),this.conditionalAttributes.forEach(function(a){return a.render(b)}),this.fragment&&("script"===this.name?(this.bubble=q,this.node.text=this.fragment.toString(!1),this.fragment.unrender=g):"style"===this.name?(this.bubble=p,this.bubble(),this.fragment.unrender=g):this.binding&&this.getAttribute("contenteditable")?this.fragment.unrender=g:this.node.appendChild(this.fragment.render())),this.eventHandlers&&this.eventHandlers.forEach(function(a){return a.render()}),this.binding&&(this.binding.render(),this.node._ractive.binding=this.binding),"img"===this.name&&j(this),this.decorator&&this.decorator.fn&&h.scheduleTask(function(){return c.decorator.init()},!0),o.transitionsEnabled&&this.intro){var r=new k(this,this.intro,!0);h.registerTransition(r),h.scheduleTask(function(){return r.start()},!0),this.transition=r}return"option"===this.name&&m(this),this.node.autofocus&&h.scheduleTask(function(){return c.node.focus()},!0),n(this),this.node}}(C,h,m,T,D,F,Sb,y,t,kf,zf),Bf=function(a,b,c){function d(a){var c,d,e;if(c=a.getAttribute("value"),void 0===c||!a.select)return!1;if(d=a.select.getAttribute("value"),d==c)return!0;if(a.select.getAttribute("multiple")&&b(d))for(e=d.length;e--;)if(d[e]==c)return!0}function e(a){var b,c,d,e;return b=a.attributes,c=b.type,d=b.value,e=b.name,c&&"radio"===c.value&&d&&e.interpolator&&d.value===e.interpolator.value?!0:void 0}function f(a){var b=a.toString();return b?" "+b:""}var g;return g=function(){var b,g;return b="<"+(this.template.y?"!DOCTYPE":this.template.e),b+=this.attributes.map(f).join("")+this.conditionalAttributes.map(f).join(""),"option"===this.name&&d(this)&&(b+=" selected"),"input"===this.name&&e(this)&&(b+=" checked"),b+=">","textarea"===this.name&&void 0!==this.getAttribute("value")?b+=c(this.getAttribute("value")):void 0!==this.getAttribute("contenteditable")&&(b+=this.getAttribute("value")),this.fragment&&(g="script"!==this.name&&"style"!==this.name,b+=this.fragment.toString(g)),a.test(this.template.e)||(b+=""),b}}(zb,h,Sc),Cf=function(a){return function(b){b.select&&a(b.select.options,b)}}(q),Df=function(a){function b(a){a.unbind()}var c;return c=function(){this.fragment&&this.fragment.unbind(),this.binding&&this.binding.unbind(),this.eventHandlers&&this.eventHandlers.forEach(b),"option"===this.name&&a(this),this.attributes.forEach(b),this.conditionalAttributes.forEach(b)}}(Cf),Ef=function(a,b){function c(a){var b,c,d;for(d=a.liveQueries.length;d--;)b=a.liveQueries[d],c=b.selector,b._remove(a.node)}var d;return d=function(d){var e,f;if(this.transition&&this.transition.complete(),"option"===this.name?this.detach():d&&a.detachWhenReady(this),this.fragment&&this.fragment.unrender(!1),(e=this.binding)&&(this.binding.unrender(),this.node._ractive.binding=null,f=this.root._twowayBindings[e.keypath],f.splice(f.indexOf(e),1)),this.eventHandlers&&this.eventHandlers.forEach(function(a){return a.unrender()}),this.decorator&&this.decorator.teardown(),this.root.transitionsEnabled&&this.outro){var g=new b(this,this.outro,!1);a.registerTransition(g),a.scheduleTask(function(){return g.start()})}this.liveQueries&&c(this)}}(y,zf),Ff=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=function(a){this.init(a)};return p.prototype={bubble:a,detach:b,find:c,findAll:d,findAllComponents:e,findComponent:f,findNextNode:g,firstNode:h,getAttribute:i,init:j,rebind:k,render:l,toString:m,unbind:n,unrender:o},p}(Pd,Qd,Rd,Sd,Td,Ud,Vd,Wd,Xd,ff,jf,Af,Bf,Df,Ef),Gf=function(){function a(a,b){var c=d.exec(b)[0];return null===a||c.length"},unrender:function(a){a&&this.node.parentNode.removeChild(this.node)}},c}(S,Uc),fg=function(a,b,c){var d;c.push(function(){d=c.Fragment});var e=function(b){var c,e;c=b.parentFragment.root,this.component=e=c.component,this.surrogateParent=b.parentFragment,this.parentFragment=e.parentFragment,this.fragment=new d({owner:this,root:c.yield.instance,template:c.yield.template,pElement:this.surrogateParent.pElement}),e.yielders.push(this),a.scheduleTask(function(){if(e.yielders.length>1)throw new Error("A component template can only have one {{yield}} declaration at a time")})};return e.prototype={detach:function(){return this.fragment.detach()},find:function(a){return this.fragment.find(a)},findAll:function(a,b){return this.fragment.findAll(a,b)},findComponent:function(a){return this.fragment.findComponent(a)},findAllComponents:function(a,b){return this.fragment.findAllComponents(a,b)},findNextNode:function(){return this.surrogateParent.findNextNode(this)},firstNode:function(){return this.fragment.firstNode()},getValue:function(a){return this.fragment.getValue(a)},render:function(){return this.fragment.render()},unbind:function(){this.fragment.unbind()},unrender:function(a){this.fragment.unrender(a),b(this.component.yielders,this)},rebind:function(a,b,c,d){this.fragment.rebind(a,b,c,d)},toString:function(){return this.fragment.toString()}},e}(y,q,f),gg=function(a,b,c,d,e,f,g,h,i,j,k){return function(l){if("string"==typeof l.template)return new b(l);switch(l.template.t){case a.INTERPOLATOR:return"yield"===l.template.r?new k(l):new c(l);case a.SECTION:return new d(l);case a.TRIPLE:return new e(l);case a.ELEMENT:var m;return(m=h(l.parentFragment.root,l.template.e))?new i(l,m):new f(l);case a.PARTIAL:return new g(l);case a.COMMENT:return new j(l);default:throw new Error("Something very strange happened. Please file an issue at https://github.com/ractivejs/ractive/issues. Thanks!")}}}(S,Vc,kd,Bd,Od,Ff,Jf,Kf,dg,eg,fg),hg=function(a,b,c){return function(d){var e,f,g,h=this;if(this.owner=d.owner,e=this.parent=this.owner.parentFragment,this.root=d.root,this.pElement=d.pElement,this.context=d.context,this.owner.type===a.SECTION&&(this.index=d.index),e&&(f=e.indexRefs)){this.indexRefs=b(null);for(g in f)this.indexRefs[g]=f[g]}d.indexRef&&(this.indexRefs||(this.indexRefs={}),this.indexRefs[d.indexRef]=d.index),"string"==typeof d.template?d.template=[d.template]:d.template||(d.template=[]),this.items=d.template.map(function(a,b){return c({parentFragment:h,pElement:d.pElement,template:a,index:b})}),this.value=this.argsList=null,this.dirtyArgs=this.dirtyValue=!0,this.bound=!0}}(S,T,gg),ig=function(a){return function(b,c,d,e){this.index=c,a(this,"context",d,e),this.indexRefs&&void 0!==this.indexRefs[b]&&(this.indexRefs[b]=c),this.items.forEach(function(a){a.rebind&&a.rebind(b,c,d,e)})}}(hf),jg=function(){var a;return 1===this.items.length?a=this.items[0].render():(a=document.createDocumentFragment(),this.items.forEach(function(b){a.appendChild(b.render())})),this.rendered=!0,a},kg=function(a){return this.items?this.items.map(function(b){return b.toString(a)}).join(""):""},lg=function(){function a(a){a.unbind&&a.unbind()}var b;return b=function(){this.bound&&(this.items.forEach(a),this.bound=!1)}}(),mg=function(a){if(!this.rendered)throw new Error("Attempted to unrender a fragment that was not rendered");this.items.forEach(function(b){return b.unrender(a)}),this.rendered=!1},ng=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){var r=function(a){this.init(a)};return r.prototype={bubble:a,detach:b,find:c,findAll:d,findAllComponents:e,findComponent:f,findNextNode:g,firstNode:h,getNode:i,getValue:j,init:k,rebind:l,render:m,toString:n,unbind:o,unrender:p},q.Fragment=r,r}(Ic,Jc,Kc,Lc,Mc,Nc,Oc,Pc,Qc,Rc,hg,ig,jg,kg,lg,mg,f),og=function(a,b,c,d){var e=["template","partials","components","decorators","events"],f=new a("reset");return function(a,g){var h,i,j,k,l;if("function"!=typeof a||g?a=a||{}:(g=a,a={}),"object"!=typeof a)throw new Error("The reset method takes either no arguments, or an object containing new data");for((i=this.viewmodel.wrapped[""])&&i.reset?i.reset(a)===!1&&(this.data=a):this.data=a,j=d.reset(this),k=j.length;k--;)if(e.indexOf(j[k])>-1){l=!0;break}if(l){var m;this.viewmodel.mark(""),(m=this.component)&&(m.shouldDestroy=!0),this.unrender(),m&&(m.shouldDestroy=!1),this.fragment.template!==this.template&&(this.fragment.unbind(),this.fragment=new c({template:this.template,root:this,owner:this})),h=this.render(this.el,this.anchor)}else h=b.start(this,!0),this.viewmodel.mark(""),b.end();return f.fire(this,a),g&&h.then(g),h}}(p,y,ng,Vb),pg=function(a,b){return function(c){var d,e;a.template.init(null,this,{template:c}),d=this.transitionsEnabled,this.transitionsEnabled=!1,(e=this.component)&&(e.shouldDestroy=!0),this.unrender(),e&&(e.shouldDestroy=!1),this.fragment.unbind(),this.fragment=new b({template:this.template,root:this,owner:this}),this.render(this.el,this.anchor),this.transitionsEnabled=d}}(Vb,ng),qg=function(a){return a("reverse")}(Dc),rg=function(a,b,c,d){var e=/\*/;return function(f,g,h){var i,j,k=this;if(j=a.start(this,!0),b(f)){i=f,h=g;for(f in i)i.hasOwnProperty(f)&&(g=i[f],f=c(f),this.viewmodel.set(f,g))}else f=c(f),e.test(f)?d(this,f).forEach(function(a){k.viewmodel.set(a,g)}):this.viewmodel.set(f,g);return a.end(),h&&j.then(h.bind(this)),j}}(y,i,J,tc),sg=function(a){return a("shift")}(Dc),tg=function(a){return a("sort")}(Dc),ug=function(a){return a("splice")}(Dc),vg=function(a){return function(b,c){return a(this,b,void 0===c?-1:-c)}}(H),wg=function(a,b,c){var d=new a("teardown");return function(a){var e;return this.fragment.unbind(),this.viewmodel.teardown(),this.fragment.rendered&&this.el.__ractive_instances__&&c(this.el.__ractive_instances__,this),this.shouldDestroy=!0,e=this.fragment.rendered?this.unrender():b.resolve(),d.fire(this),a&&e.then(a.bind(this)),e}}(p,r,q),xg=function(a){return function(b,c){var d;return"string"!=typeof b&&a.errorOnly({debug:this.debug,messsage:"badArguments",arg:{arguments:b}}),d=this.get(b),this.set(b,!d,c)}}(o),yg=function(){return this.fragment.toString(!0)},zg=function(a,b,c,d,e,f){var g=new b("unrender");return function(){var b,h,i=this;if(!this.fragment.rendered)return c.warn({debug:this.debug,message:"ractive.unrender() was called on a Ractive instance that was not rendered"}),d.resolve();for(b=f.start(this,!0),h=!this.component||this.component.shouldDestroy||this.shouldDestroy,this.constructor.css&&b.then(function(){a.remove(i.constructor)});this._animations[0];)this._animations[0].stop();return this.fragment.unrender(h),e(this.el.__ractive_instances__,this),g.fire(this),f.end(),b}}(Gc,p,o,r,q,y),Ag=function(a){return a("unshift")}(Dc),Bg=function(a,b){var c=new a("update");return function(a,d){var e;return"function"==typeof a?(d=a,a=""):a=a||"",e=b.start(this,!0),this.viewmodel.mark(a),b.end(),c.fire(this,a),d&&e.then(d.bind(this)),e}}(p,y),Cg=function(a,b){function c(d,e,f,g){var h,i,j,k,l,m,n=[];if(h=d._twowayBindings[e],h&&(j=h.length))for(;j--;)k=h[j],(!k.radioName||k.element.node.checked)&&(k.checkboxName?n[k.keypath]||k.changed()||(n.push(k.keypath),n[k.keypath]=k):(l=k.attribute.value,m=k.getValue(),a(l,m)||b(l,m)||(f[e]=m)));if(n.length&&n.forEach(function(b){var c,d,e;c=n[b],d=c.attribute.value,e=c.getValue(),a(d,e)||(f[b]=e)}),g&&(i=d.viewmodel.depsMap["default"][e]))for(j=i.length;j--;)c(d,i[j],f,g)}var d;return d=function(a,b){var d;return"string"!=typeof a&&(a="",b=!0),c(this,a,d={},b),this.set(d)}}(Je,u),Dg=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F){return{add:a,animate:b,detach:c,find:d,findAll:e,findAllComponents:f,findComponent:g,fire:h,get:i,insert:j,merge:k,observe:l,off:m,on:n,pop:o,push:p,render:q,reset:r,resetTemplate:s,reverse:t,set:u,shift:v,sort:w,splice:x,subtract:y,teardown:z,toggle:A,toHTML:B,unrender:C,unshift:D,update:E,updateModel:F}}(I,Yb,Zb,$b,ic,jc,kc,nc,oc,qc,rc,xc,Ac,Bc,Ec,Fc,Hc,og,pg,qg,rg,sg,tg,ug,vg,wg,xg,yg,zg,Ag,Bg,Cg),Eg=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b,c;return b=16*Math.random()|0,c="x"==a?b:3&b|8,c.toString(16)})},Fg=function(){var a=0;return function(){return"r-"+a++}}(),Gg=function(a){function b(b){this.hook=new a(b),this.inProcess={},this.queue={}}function c(a,b){return a[b._guid]||(a[b._guid]=[])}function d(a,b){var e=c(a.queue,b);for(a.hook.fire(b);e.length;)d(a,e.shift());delete a.queue[b._guid]}return b.prototype={constructor:b,begin:function(a){this.inProcess[a._guid]=!0},end:function(a){var b=a._parent;b&&this.inProcess[b._guid]?c(this.queue,b).push(a):d(this,a),delete this.inProcess[a._guid]}},b}(p),Hg=function(a,b,c,d){var e=a.root,f=a.keypath;return"sort"===c||"reverse"===c?void e.viewmodel.set(f,b):void e.viewmodel.smartUpdate(f,b,d)},Ig=function(a,b,c,d){var e,f,g,h=[],i=["pop","push","reverse","shift","sort","splice","unshift"];return i.forEach(function(e){var f=function(){var b,f,g,h,i=Array.prototype.slice,j=i.call(arguments,0);for(b=c(this,e,j),f=Array.prototype[e].apply(this,arguments),a.start(),this._ractive.setting=!0,h=this._ractive.wrappers.length;h--;)g=this._ractive.wrappers[h],a.addViewmodel(g.root.viewmodel),d(g,this,e,b);return a.end(),this._ractive.setting=!1,f};b(h,e,{value:f})}),e={},e.__proto__?(f=function(a){a.__proto__=h},g=function(a){a.__proto__=Array.prototype}):(f=function(a){var c,d;for(c=i.length;c--;)d=i[c],b(a,d,{value:h[d],configurable:!0})},g=function(a){var b;for(b=i.length;b--;)delete a[i[b]]}),f.unpatch=g,f}(y,F,Cc,Hg),Jg=function(a,b,c){var d,e,f;return d={filter:function(a){return b(a)&&(!a._ractive||!a._ractive.setting)},wrap:function(a,b,c){return new e(a,b,c)}},e=function(b,d,e){this.root=b,this.value=d,this.keypath=e,d._ractive||(a(d,"_ractive",{value:{wrappers:[],instances:[],setting:!1},configurable:!0}),c(d)),d._ractive.instances[b._guid]||(d._ractive.instances[b._guid]=0,d._ractive.instances.push(b)),d._ractive.instances[b._guid]+=1,d._ractive.wrappers.push(this)},e.prototype={get:function(){return this.value},teardown:function(){var a,b,d,e,g;if(a=this.value,b=a._ractive,d=b.wrappers,e=b.instances,b.setting)return!1;if(g=d.indexOf(this),-1===g)throw new Error(f);if(d.splice(g,1),d.length){if(e[this.root._guid]-=1,!e[this.root._guid]){if(g=e.indexOf(this.root),-1===g)throw new Error(f);e.splice(g,1)}}else delete a._ractive,c.unpatch(this.value)}},f="Something went wrong in a rather interesting way",d}(F,h,Ig),Kg=function(a,b){var c,d;return a&&(c={filter:function(c,d,e){return a.filter(c,d,e)&&b.filter(c)},wrap:function(a,b,c){return new d(a,b,c)}},d=function(c,d,e){this.value=d,this.magic=!0,this.magicWrapper=a.wrap(c,d,e),this.arrayWrapper=b.wrap(c,d,e)},d.prototype={get:function(){return this.value},teardown:function(){this.arrayWrapper.teardown(),this.magicWrapper.teardown()},reset:function(a){return this.magicWrapper.reset(a)}}),c}(A,Jg),Lg=function(a,b,c,d,e){function f(a,b){var c,d={};if(!b)return a;b+=".";for(c in a)a.hasOwnProperty(c)&&(d[b+c]=a[c]);return d}function g(a){var b;return i[a]||(b=a?a+".":"",i[a]=function(c,d){var e;return"string"==typeof c?(e={},e[b+c]=d,e):"object"==typeof c?b?f(c,a):c:void 0}),i[a]}var h,i={};return h=function(f,h){var i,j,k,l,m=this.ractive;for(i=m.adapt.length,j=0;i>j;j+=1){if(k=m.adapt[j],"string"==typeof k){var n=a.registries.adaptors.find(m,k);if(!n)return c.critical({debug:m.debug,message:"missingPlugin",args:{plugin:"adaptor",name:k}});k=m.adapt[j]=n}if(k.filter(h,f,m))return l=this.wrapped[f]=k.wrap(m,h,f,g(f)),l.value=h,h}return m.magic?e.filter(h,f,m)?this.wrapped[f]=e.wrap(m,h,f):d.filter(h,f,m)&&(this.wrapped[f]=d.wrap(m,h,f)):m.modifyArrays&&b.filter(h,f,m)&&(this.wrapped[f]=b.wrap(m,h,f)),h}}(Vb,Jg,o,A,Kg),Mg=function(a){var b,c,d,e,f=[""];for(b=a.length;b--;)for(c=a[b],d=c.split(".");d.length>1;)d.pop(),e=d.join("."),-1===f.indexOf(e)&&f.push(e);return f},Ng=function(){function a(a){var b,d,e,f,g,h="";if(!c[a]){for(e=[];h.length=g;g+=1){for(d=g.toString(2);d.lengthe;){var h=c[e];if(h===b.keypath){d=!0;break}h.slice(0,b.keypath.length)===b.keypath&&g.push(h),e++}d&&b.setValue(a.get(b.keypath)),g.length&&b.refineValue(g)})}function g(a,b,c){function d(a){a.forEach(e),a.forEach(f)}function e(b){var d=h(a,b,c);d&&i.push({keypath:b,deps:d})}function f(b){var e;(e=a.depsMap[c][b])&&d(e)}function g(b){var c=a.get(b.keypath);b.deps.forEach(function(a){return a.setValue(c)})}var i=[];d(b),i.forEach(g)}function h(a,b,c){var d=a.deps[c];return d?d[b]:null}var i;return i=function(){function h(a){var b,e,f;m.noCascade.hasOwnProperty(a)||((e=m.deps.computed[a])&&(e.forEach(c),f=e.map(d),f.forEach(i),f.forEach(h)),(b=m.depsMap.computed[a])&&b.forEach(h))}function i(a){m.mark(a)}var j,k,l=this,m=this,n={};if(j=this.changes,j.length){if(j.forEach(h),k=a(j),k.forEach(function(a){var b,e;(b=m.deps.computed[a])&&(b.forEach(c),e=b.map(d),e.forEach(i),e.forEach(h))}),this.changes=[],this.patternObservers.length&&(k.forEach(function(a){return b(l,a,!0)}),j.forEach(function(a){return b(l,a)})),this.deps.observers&&(k.forEach(function(a){return e(l,null,a,"observers")}),g(this,j,"observers")),this.deps["default"]){var o=[];k.forEach(function(a){return e(l,o,a,"default")}),o.length&&f(this,o,j),g(this,j,"default")}return j.forEach(function(a){n[a]=l.get(a)}),this.implicitChanges={},this.noCascade={},n}}}(Mg,Og),Qg=function(){this.captureGroups.push([])},Rg=function(a,b){var c,d;if(b||(d=this.wrapped[a])&&d.teardown()!==!1&&(this.wrapped[a]=null),this.cache[a]=void 0,c=this.cacheMap[a])for(;c.length;)this.clearCache(c.pop())},Sg=function(){function a(a){var b="var __ractive=this;return("+a.replace(c,function(a,b){return'__ractive.get("'+b+'")'})+")";return new Function(b)}var b,c=/\$\{([^\}]+)\}/g;return b=function(b){return"function"==typeof b?{get:b}:"string"==typeof b?{get:a(b)}:("object"==typeof b&&"string"==typeof b.get&&(b={get:a(b.get),set:b.set}),b)}}(),Tg=function(a,b){var c=function(a,b,c){var d=this;this.ractive=a,this.viewmodel=a.viewmodel,this.key=b,this.getter=c.get,this.setter=c.set,this.hardDeps=c.deps||[],this.softDeps=[],this.depValues={},this.hardDeps&&this.hardDeps.forEach(function(b){return a.viewmodel.register(b,d,"computed")}),this._dirty=this._firstRun=!0};return c.prototype={constructor:c,init:function(){var a;this.bypass=!0,a=this.ractive.viewmodel.get(this.key),this.ractive.viewmodel.clearCache(this.key),this.bypass=!1,this.setter&&void 0!==a&&this.set(a)},invalidate:function(){this._dirty=!0},get:function(){var c,d,e,f=this,g=!1;if(!this.getting){if(this.getting=!0,this._dirty){if(c=this.ractive,this._firstRun||!this.hardDeps.length&&!this.softDeps.length?g=!0:[this.hardDeps,this.softDeps].forEach(function(a){var d,e,h;if(!g)for(h=a.length;h--;)if(d=a[h],e=c.viewmodel.get(d),!b(e,f.depValues[d]))return f.depValues[d]=e,void(g=!0)}),g){c.viewmodel.capture();try{this.value=this.getter.call(c)}catch(h){a.warn({debug:c.debug,message:"failedComputation",args:{key:this.key,err:h.message||h}}),this.value=void 0}d=c.viewmodel.release(),e=this.updateDependencies(d),e&&[this.hardDeps,this.softDeps].forEach(function(a){a.forEach(function(a){f.depValues[a]=c.viewmodel.get(a)})})}this._dirty=!1}return this.getting=this._firstRun=!1,this.value}},set:function(a){if(this.setting)return void(this.value=a);if(!this.setter)throw new Error("Computed properties without setters are read-only. (This may change in a future version of Ractive!)");this.setter.call(this.ractive,a)},updateDependencies:function(a){var b,c,d,e;for(c=this.softDeps,b=c.length;b--;)d=c[b],-1===a.indexOf(d)&&(e=!0,this.viewmodel.unregister(d,this,"computed"));for(b=a.length;b--;)d=a[b],-1!==c.indexOf(d)||this.hardDeps&&-1!==this.hardDeps.indexOf(d)||(e=!0,this.viewmodel.register(d,this,"computed"));return e&&(this.softDeps=a.slice()),e}},c}(o,u),Ug=function(a,b){return function(c,d){return d=a(d),this.computations[c]=new b(this.ractive,c,d)}}(Sg,Tg),Vg={FAILED_LOOKUP:!0},Wg=function(a,b){var c={},d=function(a,d){this.viewmodel=a,this.root=a.ractive,this.ref=d,this.parentFragment=c,a.unresolvedImplicitDependencies[d]=!0,a.unresolvedImplicitDependencies.push(this),b.addUnresolved(this)};return d.prototype={resolve:function(){this.viewmodel.mark(this.ref),this.viewmodel.unresolvedImplicitDependencies[this.ref]=!1,a(this.viewmodel.unresolvedImplicitDependencies,this)},teardown:function(){b.removeUnresolved(this)}},d}(q,y),Xg=function(a,b,c){function d(a,c){var d,e,f,g,h,i,j;return d=c.split("."),e=d.pop(),f=d.join("."),g=a.get(f),(j=a.wrapped[f])&&(g=j.get()),null!==g&&void 0!==g?((h=a.cacheMap[f])?-1===h.indexOf(c)&&h.push(c):a.cacheMap[f]=[c],"object"!=typeof g||e in g?(i=g[e],a.adapt(c,i,!1),a.cache[c]=i,i):a.cache[c]=b):void 0}var e,f={};return e=function(e){var g=arguments[1];void 0===g&&(g=f);var h,i,j,k,l=this.ractive,m=this.cache;return"@"===e[0]?(h=e.slice(1),a(h)?+h:h):(void 0===m[e]?((i=this.computations[e])&&!i.bypass?(h=i.get(),this.adapt(e,h)):(j=this.wrapped[e])?h=j.value:e?h=d(this,e):(this.adapt("",l.data),h=l.data),m[e]=h):h=m[e],g.evaluateWrapped&&(j=this.wrapped[e])&&(h=j.get()),g.capture&&(k=this.captureGroups[this.captureGroups.length-1])&&(~k.indexOf(e)||(k.push(e),h===b&&this.unresolvedImplicitDependencies[e]!==!0&&new c(this,e))),h===b?void 0:h)}}(j,Vg,Wg),Yg=function(){function a(a){a.init()}var b;return b=function(){var b,c,d=[];for(b in this.ractive.computed)c=this.compute(b,this.ractive.computed[b]),d.push(c);d.forEach(a)}}(),Zg=function(a,b){var c;b&&(b.implicit&&(this.implicitChanges[a]=!0),b.noCascade&&(this.noCascade[a]=!0)),(c=this.computations[a])&&c.invalidate(),-1===this.changes.indexOf(a)&&this.changes.push(a),this.clearCache(a)},$g=function(a,b){var c,d,e,f;return c={},d=0,e=a.map(function(a,e){var g,h,i;h=d,i=b.length;do{if(g=b.indexOf(a,h),-1===g)return f=!0,-1;h=g+1}while(c[g]&&i>h);return g===d&&(d+=1),g!==e&&(f=!0),c[g]=!0,g})},_g=function(a,b){function c(a){return JSON.stringify(a)}function d(a){if(a===!0)return c;if("string"==typeof a)return f[a]||(f[a]=function(b){return b[a]}),f[a];if("function"==typeof a)return a;throw new Error("The `compare` option must be a function, or a string representing an identifying field (or `true` to use JSON.stringify)")}var e,f={};return e=function(c,e,f,g){var h,i,j,k;if(this.mark(c),g&&g.compare){j=d(g.compare);try{h=e.map(j),i=f.map(j)}catch(l){if(this.debug)throw l;a("Merge operation: comparison failed. Falling back to identity checking"),h=e,i=f}}else h=e,i=f;k=b(h,i),this.smartUpdate(c,f,k,e.length!==f.length)}}(m,$g),ah=function(){function a(a,b,c){var d,e,f,g;for(d=b.split(".");d.length;)d.pop(),e=d.join("."),f=a.depsMap[c]||(a.depsMap[c]={}),g=f[e]||(f[e]=[]),void 0===g[b]&&(g[b]=0,g.push(b)),g[b]+=1,b=e}var b;return b=function(b,c){var d=arguments[2];void 0===d&&(d="default");var e,f;c.isStatic||(e=this.deps[d]||(this.deps[d]={}),f=e[b]||(e[b]=[]),f.push(c),b&&a(this,b,d))}}(),bh=function(){return this.captureGroups.pop()},ch=function(a,b){function c(a,c,d){var e,f,g,h,i,j,k;j=function(){h.set?h.set(f,d):(i=h.get(),k())},k=function(){i||(i=b(f),a.set(g,i,!0)),i[f]=d},e=c.split("."),f=e.pop(),g=e.join("."),h=a.wrapped[g],h?j():(i=a.get(g),(h=a.wrapped[g])?j():k())}var d;return d=function(b,d,e){var f,g,h;if(f=this.computations[b]){if(f.setting)return;f.set(d),d=f.get()}a(this.cache[b],d)||(g=this.wrapped[b],g&&g.reset&&(h=g.reset(d)!==!1,h&&(d=g.get())),f||h||c(this,b,d),e?this.clearCache(b):this.mark(b))}}(u,z),dh=function(){function a(a){return"function"==typeof a.shuffle}var b,c={implicit:!0},d={noCascade:!0};return b=function(b,e,f){var g,h,i=this;if(h=f.length,f.forEach(function(a,c){-1===a&&i.mark(b+"."+c,d)}),this.set(b,e,!0),(g=this.deps["default"][b])&&g.filter(a).forEach(function(a){return a.shuffle(f,e)}),h!==e.length){this.mark(b+".length",c);for(var j=h;jk;k+=1)this.mark(b+"."+k,d)}}}(),eh=function(){var a,b=this;for(Object.keys(this.cache).forEach(function(a){return b.clearCache(a)});a=this.unresolvedImplicitDependencies.pop();)a.teardown()},fh=function(){function a(a,b,c){var d,e,f,g;for(d=b.split(".");d.length;)d.pop(),e=d.join("."),f=a.depsMap[c],g=f[e],g[b]-=1,g[b]||(g.splice(g.indexOf(b),1),g[b]=void 0),b=e}var b;return b=function(b,c){var d=arguments[2];void 0===d&&(d="default");var e,f;if(!c.isStatic){if(e=this.deps[d][b],f=e.indexOf(c),-1===f)throw new Error("Attempted to remove a dependant that was no longer registered! This should not happen. If you are seeing this bug in development please raise an issue at https://github.com/RactiveJS/Ractive/issues - thanks");e.splice(f,1),b&&a(this,b,d)}}}(),gh=function(){function a(a){return"string"==typeof a&&(a=[a]),a}var b={lookup:function(a,b){var c,d=a.adapt;if(!d||!d.length)return d;if(b&&Object.keys(b).length&&(c=d.length))for(;c--;){var e=d[c];"string"==typeof e&&(d[c]=b[e]||e)}return d},combine:function(b,c){return b=a(b),c=a(c),b&&b.length?c&&c.length?(b.forEach(function(a){-1===c.indexOf(a)&&c.push(a)}),c):b.slice():c}};return b}(),hh=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){var r;try{Object.defineProperty({},"test",{value:0})}catch(s){r=!0}var t=function(b){this.ractive=b,t.extend(b.constructor,b),this.cache={},this.cacheMap=a(null),this.deps={computed:{},"default":{}},this.depsMap={computed:{},"default":{}},this.patternObservers=[],this.wrapped=a(null),this.computations=a(null),this.captureGroups=[],this.unresolvedImplicitDependencies=[],this.changes=[],this.implicitChanges={},this.noCascade={}};return t.extend=function(a,b){if(b.magic&&r)throw new Error("Getters and setters (magic mode) are not supported in this browser");b.adapt=q.combine(a.prototype.adapt,b.adapt)||[],b.adapt=q.lookup(b,b.adaptors)},t.prototype={adapt:b,applyChanges:c,capture:d,clearCache:e,compute:f,get:g,init:h,mark:i,merge:j,register:k,release:l,set:m,smartUpdate:n,teardown:o,unregister:p},t}(T,Lg,Pg,Qg,Rg,Ug,Xg,Yg,Zg,_g,ah,bh,ch,dh,eh,fh,gh),ih=function(a,b,c,d,e,f,g,h){function i(a,c){a._guid=e(),a._subs=b(null),a._config={},a._twowayBindings=b(null),a._animations=[],a.nodes={},a._liveQueries=[],a._liveComponentQueries=[],c._parent&&c._component&&(a._parent=c._parent,a.component=c._component,c._component.instance=a)}var j,k=new f("construct"),l=new f("config"),m=new g("init");return j=function(b){var e=arguments[1];void 0===e&&(e={});var f;if(i(b,e),k.fire(a.getConstructTarget(b,e),e),a.init(b.constructor,b,e),l.fire(b),(f=d(b.el))&&!b.append){if(f.__ractive_instances__)try{f.__ractive_instances__.splice(0,f.__ractive_instances__.length).forEach(function(a){return a.teardown()})}catch(g){}f.innerHTML=""}m.begin(b),b.viewmodel=new h(b),b.viewmodel.init(),b.template&&(b.fragment=new c({template:b.template,root:b,owner:b})),m.end(b),f&&b.render(f,b.append)}}(Vb,T,ng,pc,Fg,p,Gg,hh),jh=function(a,b,c){function d(a,b,c){var d,e=Object.keys(a[c]);e.length&&((d=b[c])||(d=b[c]={}),e.filter(function(a){return!(a in d)}).forEach(function(b){return d[b]=a[c][b]}))}var e,f;return c.push(function(){f=c.Ractive}),e=function(c){if(!(c.prototype instanceof f))return c;for(var e={};c;)b.registries.forEach(function(a){d(a.useDefaults?c.prototype:c,e,a.name)}),Object.keys(c.prototype).forEach(function(b){if("computed"!==b){var d=c.prototype[b];if(b in e){if("function"==typeof e[b]&&"function"==typeof d&&e[b]._method){var f,g=d._method;g&&(d=d._method),f=a(e[b]._method,d),g&&(f._method=f),e[b]=f}}else e[b]=d._method?d._method:d}}),c=c._parent!==f?c._parent:!1;return e}}(Q,Vb,f),kh=function(a,b,c,d,e,f,g){return function h(){var i=arguments[0];void 0===i&&(i={});var j,k,l,m=this;return i=g(i),j=function(a){e(this,a)},k=a(m.prototype),k.constructor=j,l={_guid:{value:c()},defaults:{value:k},extend:{value:h,writable:!0,configurable:!0},_parent:{value:m}},b(j,l),d.extend(m,k,i),f.extend(m,k),j.prototype=k,j}}(T,G,Eg,Vb,ih,hh,jh),lh=function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n,o; -for(n=function(a){l(this,a)},o={extend:{value:j},parse:{value:k},Promise:{value:h},svg:{value:d},magic:{value:e},VERSION:{value:"0.6.1"},adaptors:{writable:!0,value:{}},components:{writable:!0,value:{}},decorators:{writable:!0,value:{}},easing:{writable:!0,value:b},events:{writable:!0,value:{}},interpolators:{writable:!0,value:c},partials:{writable:!0,value:{}},transitions:{writable:!0,value:{}}},f(n,o),n.prototype=i(g,a),n.prototype.constructor=n,n.defaults=n.prototype,m.Ractive=n;m.length;)m.pop()();var p="function";if(typeof Date.now!==p||typeof String.prototype.trim!==p||typeof Object.keys!==p||typeof Array.prototype.indexOf!==p||typeof Array.prototype.forEach!==p||typeof Array.prototype.map!==p||typeof Array.prototype.filter!==p||"undefined"!=typeof window&&typeof window.addEventListener!==p)throw new Error("It looks like you're attempting to use Ractive.js in an older browser. You'll need to use one of the 'legacy builds' in order to continue - see http://docs.ractivejs.org/latest/legacy-builds for more information.");return n}(d,e,k,l,B,G,Dg,r,ze,kh,Lb,ih,f);"undefined"!=typeof b&&b.exports?b.exports=lh:"function"==typeof define&&define.amd&&define(function(){return lh}),a.Ractive=lh,lh.noConflict=function(){return a.Ractive=c,lh}}("undefined"!=typeof window?window:this)},{}],14:[function(a,b,c){!function(a){function c(a,b){var c=b?P[eb]:P[bb];return c.test(a)?new f(a,b):null}function d(a,b){var d=c(a,b);return d?d.version:null}function e(a,b){var d=c(a.trim().replace(/^[=v]+/,""),b);return d?d.version:null}function f(a,b){if(a instanceof f){if(a.loose===b)return a;a=a.version}else if("string"!=typeof a)throw new TypeError("Invalid Version: "+a);if(!(this instanceof f))return new f(a,b);this.loose=b;var c=a.trim().match(b?P[eb]:P[bb]);if(!c)throw new TypeError("Invalid Version: "+a);this.raw=a,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.prerelease=c[4]?c[4].split(".").map(function(a){return/^[0-9]+$/.test(a)?+a:a}):[],this.build=c[5]?c[5].split("."):[],this.format()}function g(a,b,c,d){"string"==typeof c&&(d=c,c=void 0);try{return new f(a,c).inc(b,d).version}catch(e){return null}}function h(a,b){var c=Eb.test(a),d=Eb.test(b);return c&&d&&(a=+a,b=+b),c&&!d?-1:d&&!c?1:b>a?-1:a>b?1:0}function i(a,b){return h(b,a)}function j(a,b,c){return new f(a,c).compare(b)}function k(a,b){return j(a,b,!0)}function l(a,b,c){return j(b,a,c)}function m(b,c){return b.sort(function(b,d){return a.compare(b,d,c)})}function n(b,c){return b.sort(function(b,d){return a.rcompare(b,d,c)})}function o(a,b,c){return j(a,b,c)>0}function p(a,b,c){return j(a,b,c)<0}function q(a,b,c){return 0===j(a,b,c)}function r(a,b,c){return 0!==j(a,b,c)}function s(a,b,c){return j(a,b,c)>=0}function t(a,b,c){return j(a,b,c)<=0}function u(a,b,c,d){var e;switch(b){case"===":"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),e=a===c;break;case"!==":"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),e=a!==c;break;case"":case"=":case"==":e=q(a,c,d);break;case"!=":e=r(a,c,d);break;case">":e=o(a,c,d);break;case">=":e=s(a,c,d);break;case"<":e=p(a,c,d);break;case"<=":e=t(a,c,d);break;default:throw new TypeError("Invalid operator: "+b)}return e}function v(a,b){if(a instanceof v){if(a.loose===b)return a;a=a.value}return this instanceof v?(this.loose=b,this.parse(a),void(this.value=this.semver===Fb?"":this.operator+this.semver.version)):new v(a,b)}function w(a,b){if(a instanceof w&&a.loose===b)return a;if(!(this instanceof w))return new w(a,b);if(this.loose=b,this.raw=a,this.set=a.split(/\s*\|\|\s*/).map(function(a){return this.parseRange(a.trim())},this).filter(function(a){return a.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+a);this.format()}function x(a,b){return new w(a,b).set.map(function(a){return a.map(function(a){return a.value}).join(" ").trim().split(" ")})}function y(a,b){return a=C(a,b),a=A(a,b),a=E(a,b),a=G(a,b)}function z(a){return!a||"x"===a.toLowerCase()||"*"===a}function A(a,b){return a.trim().split(/\s+/).map(function(a){return B(a,b)}).join(" ")}function B(a,b){var c=b?P[qb]:P[pb];return a.replace(c,function(a,b,c,d,e){var f;return z(b)?f="":z(c)?f=">="+b+".0.0 <"+(+b+1)+".0.0":z(d)?f=">="+b+"."+c+".0 <"+b+"."+(+c+1)+".0":e?("-"!==e.charAt(0)&&(e="-"+e),f=">="+b+"."+c+"."+d+e+" <"+b+"."+(+c+1)+".0"):f=">="+b+"."+c+"."+d+" <"+b+"."+(+c+1)+".0",f})}function C(a,b){return a.trim().split(/\s+/).map(function(a){return D(a,b)}).join(" ")}function D(a,b){var c=b?P[vb]:P[ub];return a.replace(c,function(a,b,c,d,e){var f;return z(b)?f="":z(c)?f=">="+b+".0.0 <"+(+b+1)+".0.0":z(d)?f="0"===b?">="+b+"."+c+".0 <"+b+"."+(+c+1)+".0":">="+b+"."+c+".0 <"+(+b+1)+".0.0":e?("-"!==e.charAt(0)&&(e="-"+e),f="0"===b?"0"===c?">="+b+"."+c+"."+d+e+" <"+b+"."+c+"."+(+d+1):">="+b+"."+c+"."+d+e+" <"+b+"."+(+c+1)+".0":">="+b+"."+c+"."+d+e+" <"+(+b+1)+".0.0"):f="0"===b?"0"===c?">="+b+"."+c+"."+d+" <"+b+"."+c+"."+(+d+1):">="+b+"."+c+"."+d+" <"+b+"."+(+c+1)+".0":">="+b+"."+c+"."+d+" <"+(+b+1)+".0.0",f})}function E(a,b){return a.split(/\s+/).map(function(a){return F(a,b)}).join(" ")}function F(a,b){a=a.trim();var c=b?P[lb]:P[kb];return a.replace(c,function(a,b,c,d,e){var f=z(c),g=f||z(d),h=g||z(e),i=h;return"="===b&&i&&(b=""),f?a=">"===b||"<"===b?"<0.0.0":"*":b&&i?(g&&(d=0),h&&(e=0),">"===b?(b=">=",g?(c=+c+1,d=0,e=0):h&&(d=+d+1,e=0)):"<="===b&&(b="<",g?c=+c+1:d=+d+1),a=b+c+"."+d+"."+e):g?a=">="+c+".0.0 <"+(+c+1)+".0.0":h&&(a=">="+c+"."+d+".0 <"+c+"."+(+d+1)+".0"),a})}function G(a){return a.trim().replace(P[Cb],"")}function H(a,b,c,d,e,f,g,h,i,j,k,l){return b=z(c)?"":z(d)?">="+c+".0.0":z(e)?">="+c+"."+d+".0":">="+b,h=z(i)?"":z(j)?"<"+(+i+1)+".0.0":z(k)?"<"+i+"."+(+j+1)+".0":l?"<="+i+"."+j+"."+k+"-"+l:"<="+h,(b+" "+h).trim()}function I(a,b){for(var c=0;c0){var d=a[c].semver;if(d.major===b.major&&d.minor===b.minor&&d.patch===b.patch)return!0}}return!1}return!0}function J(a,b,c){try{b=new w(b,c)}catch(d){return!1}return b.test(a)}function K(a,b,c){return a.filter(function(a){return J(a,b,c)}).sort(function(a,b){return l(a,b,c)})[0]||null}function L(a,b){try{return new w(a,b).range||"*"}catch(c){return null}}function M(a,b,c){return O(a,b,"<",c)}function N(a,b,c){return O(a,b,">",c)}function O(a,b,c,d){a=new f(a,d),b=new w(b,d);var e,g,h,i,j;switch(c){case">":e=o,g=t,h=p,i=">",j=">=";break;case"<":e=p,g=s,h=o,i="<",j="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(J(a,b,d))return!1;for(var k=0;k)?=?)";var gb=R++;Q[gb]=Q[T]+"|x|X|\\*";var hb=R++;Q[hb]=Q[S]+"|x|X|\\*";var ib=R++;Q[ib]="[v=\\s]*("+Q[hb]+")(?:\\.("+Q[hb]+")(?:\\.("+Q[hb]+")(?:"+Q[Z]+")?"+Q[ab]+"?)?)?";var jb=R++;Q[jb]="[v=\\s]*("+Q[gb]+")(?:\\.("+Q[gb]+")(?:\\.("+Q[gb]+")(?:"+Q[$]+")?"+Q[ab]+"?)?)?";var kb=R++;Q[kb]="^"+Q[fb]+"\\s*"+Q[ib]+"$";var lb=R++;Q[lb]="^"+Q[fb]+"\\s*"+Q[jb]+"$";var mb=R++;Q[mb]="(?:~>?)";var nb=R++;Q[nb]="(\\s*)"+Q[mb]+"\\s+",P[nb]=new RegExp(Q[nb],"g");var ob="$1~",pb=R++;Q[pb]="^"+Q[mb]+Q[ib]+"$";var qb=R++;Q[qb]="^"+Q[mb]+Q[jb]+"$";var rb=R++;Q[rb]="(?:\\^)";var sb=R++;Q[sb]="(\\s*)"+Q[rb]+"\\s+",P[sb]=new RegExp(Q[sb],"g");var tb="$1^",ub=R++;Q[ub]="^"+Q[rb]+Q[ib]+"$";var vb=R++;Q[vb]="^"+Q[rb]+Q[jb]+"$";var wb=R++;Q[wb]="^"+Q[fb]+"\\s*("+db+")$|^$";var xb=R++;Q[xb]="^"+Q[fb]+"\\s*("+cb+")$|^$";var yb=R++;Q[yb]="(\\s*)"+Q[fb]+"\\s*("+db+"|"+Q[ib]+")",P[yb]=new RegExp(Q[yb],"g");var zb="$1$2$3",Ab=R++;Q[Ab]="^\\s*("+Q[ib]+")\\s+-\\s+("+Q[ib]+")\\s*$";var Bb=R++;Q[Bb]="^\\s*("+Q[jb]+")\\s+-\\s+("+Q[jb]+")\\s*$";var Cb=R++;Q[Cb]="(<|>)?=?\\s*\\*";for(var Db=0;R>Db;Db++)P[Db]||(P[Db]=new RegExp(Q[Db]));a.parse=c,a.valid=d,a.clean=e,a.SemVer=f,f.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},f.prototype.inspect=function(){return''},f.prototype.toString=function(){return this.version},f.prototype.compare=function(a){return a instanceof f||(a=new f(a,this.loose)),this.compareMain(a)||this.comparePre(a)},f.prototype.compareMain=function(a){return a instanceof f||(a=new f(a,this.loose)),h(this.major,a.major)||h(this.minor,a.minor)||h(this.patch,a.patch)},f.prototype.comparePre=function(a){if(a instanceof f||(a=new f(a,this.loose)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;var b=0;do{var c=this.prerelease[b],d=a.prerelease[b];if(void 0===c&&void 0===d)return 0;if(void 0===d)return 1;if(void 0===c)return-1;if(c!==d)return h(c,d)}while(++b)},f.prototype.inc=function(a,b){switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",b);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",b);break;case"prepatch":this.prerelease.length=0,this.inc("patch",b),this.inc("pre",b);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",b),this.inc("pre",b);break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var c=this.prerelease.length;--c>=0;)"number"==typeof this.prerelease[c]&&(this.prerelease[c]++,c=-2);-1===c&&this.prerelease.push(0)}b&&(this.prerelease[0]===b?isNaN(this.prerelease[1])&&(this.prerelease=[b,0]):this.prerelease=[b,0]);break;default:throw new Error("invalid increment argument: "+a)}return this.format(),this},a.inc=g,a.compareIdentifiers=h;var Eb=/^[0-9]+$/;a.rcompareIdentifiers=i,a.compare=j,a.compareLoose=k,a.rcompare=l,a.sort=m,a.rsort=n,a.gt=o,a.lt=p,a.eq=q,a.neq=r,a.gte=s,a.lte=t,a.cmp=u,a.Comparator=v;var Fb={};v.prototype.parse=function(a){var b=this.loose?P[wb]:P[xb],c=a.match(b);if(!c)throw new TypeError("Invalid comparator: "+a);this.operator=c[1],"="===this.operator&&(this.operator=""),this.semver=c[2]?new f(c[2],this.loose):Fb},v.prototype.inspect=function(){return''},v.prototype.toString=function(){return this.value},v.prototype.test=function(a){return this.semver===Fb?!0:("string"==typeof a&&(a=new f(a,this.loose)),u(a,this.operator,this.semver,this.loose))},a.Range=w,w.prototype.inspect=function(){return''},w.prototype.format=function(){return this.range=this.set.map(function(a){return a.join(" ").trim()}).join("||").trim(),this.range},w.prototype.toString=function(){return this.range},w.prototype.parseRange=function(a){var b=this.loose;a=a.trim();var c=b?P[Bb]:P[Ab];a=a.replace(c,H),a=a.replace(P[yb],zb),a=a.replace(P[nb],ob),a=a.replace(P[sb],tb),a=a.split(/\s+/).join(" ");var d=b?P[wb]:P[xb],e=a.split(" ").map(function(a){return y(a,b)}).join(" ").split(/\s+/);return this.loose&&(e=e.filter(function(a){return!!a.match(d)})),e=e.map(function(a){return new v(a,b)})},a.toComparators=x,w.prototype.test=function(a){if(!a)return!1;"string"==typeof a&&(a=new f(a,this.loose));for(var b=0;bd;){var f=d+e>>>1;c(a[f],b)>0?d=f+1:e=f}return d}"function"==typeof define&&define.amd?define("sortedindex-compare",[],function(){return d}):"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=d),c.sortedIndex=d):a.sortedIndex=d}(this)},{}],16:[function(a,b){function c(){}function d(a){var b={}.toString.call(a);switch(b){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function e(){if(q.XMLHttpRequest&&("file:"!=q.location.protocol||!q.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 f(a){return a===Object(a)}function g(a){if(!f(a))return a;var b=[];for(var c in a)null!=a[c]&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")}function h(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 i(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=r(c.slice(b+1)),g[d]=e;return g}function j(a){return a.split(/ *; */).shift()}function k(a){return p(a.split(/ *; */),function(a,b){var c=b.split(/ *= */),d=c.shift(),e=c.shift();return d&&e&&(a[d]=e),a},{})}function l(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=i(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 m(a,b){var c=this;o.call(this),this._query=this._query||[],this.method=a,this.url=b,this.header={},this._header={},this.on("end",function(){try{var b=new l(c);"HEAD"==a&&(b.text=null),c.callback(null,b)}catch(d){var e=new Error("Parser is unable to parse the response");e.parse=!0,e.original=d,c.callback(e)}})}function n(a,b){return"function"==typeof b?new m("GET",a).end(b):1==arguments.length?new m("GET",a):new m(a,b)}var o=a("emitter"),p=a("reduce"),q="undefined"==typeof window?this:window,r="".trim?function(a){return a.trim()}:function(a){return a.replace(/(^\s*|\s*$)/g,"")};n.serializeObject=g,n.parseString=h,n.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"},n.serialize={"application/x-www-form-urlencoded":g,"application/json":JSON.stringify},n.parse={"application/x-www-form-urlencoded":h,"application/json":JSON.parse},l.prototype.get=function(a){return this.header[a.toLowerCase()]},l.prototype.setHeaderProperties=function(){var a=this.header["content-type"]||"";this.type=j(a);var b=k(a);for(var c in b)this[c]=b[c]},l.prototype.parseBody=function(a){var b=n.parse[this.type];return b&&a&&a.length?b(a):null},l.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},l.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},n.Response=l,o(m.prototype),m.prototype.use=function(a){return a(this),this},m.prototype.timeout=function(a){return this._timeout=a,this},m.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},m.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},m.prototype.set=function(a,b){if(f(a)){for(var c in a)this.set(c,a[c]);return this}return this._header[a.toLowerCase()]=b,this.header[a]=b,this},m.prototype.unset=function(a){return delete this._header[a.toLowerCase()],delete this.header[a],this},m.prototype.getHeader=function(a){return this._header[a.toLowerCase()]},m.prototype.type=function(a){return this.set("Content-Type",n.types[a]||a),this},m.prototype.accept=function(a){return this.set("Accept",n.types[a]||a),this},m.prototype.auth=function(a,b){var c=btoa(a+":"+b);return this.set("Authorization","Basic "+c),this},m.prototype.query=function(a){return"string"!=typeof a&&(a=g(a)),a&&this._query.push(a),this},m.prototype.field=function(a,b){return this._formData||(this._formData=new FormData),this._formData.append(a,b),this},m.prototype.attach=function(a,b,c){return this._formData||(this._formData=new FormData),this._formData.append(a,b,c),this},m.prototype.send=function(a){var b=f(a),c=this.getHeader("Content-Type");if(b&&f(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},m.prototype.callback=function(a,b){var c=this._callback;return 2==c.length?c(a,b):a?this.emit("error",a):void c(b)},m.prototype.crossDomainError=function(){var a=new Error("Origin is not allowed by Access-Control-Allow-Origin");a.crossDomain=!0,this.callback(a)},m.prototype.timeoutError=function(){var a=this._timeout,b=new Error("timeout of "+a+"ms exceeded");b.timeout=a,this.callback(b)},m.prototype.withCredentials=function(){return this._withCredentials=!0,this},m.prototype.end=function(a){var b=this,f=this.xhr=e(),g=this._query.join("&"),h=this._timeout,i=this._formData||this._data;if(this._callback=a||c,f.onreadystatechange=function(){return 4==f.readyState?0==f.status?b.aborted?b.timeoutError():b.crossDomainError():void b.emit("end"):void 0},f.upload&&(f.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=n.serializeObject(g),this.url+=~this.url.indexOf("?")?"&"+g:"?"+g),f.open(this.method,this.url,!0),this._withCredentials&&(f.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof i&&!d(i)){var j=n.serialize[this.getHeader("Content-Type")];j&&(i=j(i))}for(var k in this.header)null!=this.header[k]&&f.setRequestHeader(k,this.header[k]);return this.emit("request",this),f.send(i),this},n.Request=m,n.get=function(a,b,c){var d=n("GET",a);return"function"==typeof b&&(c=b,b=null),b&&d.query(b),c&&d.end(c),d},n.head=function(a,b,c){var d=n("HEAD",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},n.del=function(a,b){var c=n("DELETE",a);return b&&c.end(b),c},n.patch=function(a,b,c){var d=n("PATCH",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},n.post=function(a,b,c){var d=n("POST",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},n.put=function(a,b,c){var d=n("PUT",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},b.exports=n},{emitter:17,reduce:18}],17:[function(a,b){function c(a){return a?d(a):void 0}function d(a){for(var b in c.prototype)a[b]=c.prototype[b];return a}b.exports=c,c.prototype.on=c.prototype.addEventListener=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks[a]=this._callbacks[a]||[]).push(b),this},c.prototype.once=function(a,b){function c(){d.off(a,c),b.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},c.fn=b,this.on(a,c),this},c.prototype.off=c.prototype.removeListener=c.prototype.removeAllListeners=c.prototype.removeEventListener=function(a,b){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var c=this._callbacks[a];if(!c)return this;if(1==arguments.length)return delete this._callbacks[a],this;for(var d,e=0;ed;++d)c[d].apply(this,b)}return this},c.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},c.prototype.hasListeners=function(a){return!!this.listeners(a).length}},{}],18:[function(a,b){b.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}},{}],19:[function(a){var b,c,d,e;d=a("ractive"),a("ractive-transitions-fade"),a("ractive-ractive"),a("./utils/mixins.coffee"),a("./models/projects.coffee"),b=a("./views/header.coffee"),c=a("./views/notify.coffee"),e=a("./modules/router.coffee"),new d({template:a("./templates/app.html"),el:"body",components:{Header:b,Notify:c},onrender:function(){return e.init("/")}})},{"./models/projects.coffee":22,"./modules/router.coffee":31,"./templates/app.html":33,"./utils/mixins.coffee":48,"./views/header.coffee":52,"./views/notify.coffee":55,ractive:13,"ractive-ractive":11,"ractive-transitions-fade":12}],20:[function(a,b){var c;c=a("../utils/ractive/model.coffee"),b.exports=new c({name:"models/config",data:{firebase:"burnchart",provider:"github",fields:{milestone:["closed_issues","created_at","description","due_on","number","open_issues","title","updated_at"]},chart:{off_days:[],datetime:/^(\d{4}-\d{2}-\d{2})T(.*)/,size_label:/^size (\d+)$/,location:/^#!((\/[^\/]+){2,3})$/,points:"ONE_SIZE"}}})},{"../utils/ractive/model.coffee":50}],21:[function(a,b){var c,d,e,f;c=a("firebase"),d=a("../utils/ractive/model.coffee"),f=a("./user.coffee"),e=a("./config.coffee"),b.exports=new d({name:"models/firebase",login:function(a){return this.data.client||a("Not ready yet"),this.data.client.authWithOAuthPopup("github",function(a){return function(b,c){return b?a.publish("!app/notify",{text:b.toString(),type:"alert",system:!0}):a.onAuth(c)}}(this),{rememberMe:!0,scope:"private_repo"})},onAuth:function(a){return f.set(a),f.set("ready",!0)},logout:function(){throw"Implement"},onrender:function(){var a;return this.set("client",a=new c("https://"+e.data.firebase+".firebaseio.com")),a.onAuth(this.onAuth)}})},{"../utils/ractive/model.coffee":50,"./config.coffee":20,"./user.coffee":24,firebase:6}],22:[function(a,b){var c,d,e,f,g,h,i,j,k,l=[].slice;k=a("lodash"),f=a("lscache"),h=a("sortedindex-compare"),g=a("semver"),c=a("../utils/ractive/model.coffee"),d=a("../models/config.coffee"),i=a("../modules/stats.coffee"),e=a("../utils/date.coffee"),j=a("./user.coffee"),b.exports=new c({name:"models/projects",data:{sortBy:"priority",sortFns:["progress","priority","name"]},comparator:function(){var a,b,c,d,e;switch(e=this.data,c=e.list,d=e.sortBy,a=function(a){return function(b){return function(){var d,e,f,g;return g=arguments[0],f=2<=arguments.length?l.call(arguments,1):[],d=g[0],e=g[1],b.apply(a,[[c[d],c[d].milestones[e]]].concat(f))}}}(this),b=function(a,b){var c,d,e,f,g,h,i,j,k,l;for(l=[],j=0,k=a.length;k>j;j++)d=a[j],l.push(function(){var a;a=[];for(e in b)i=b[e],h=d,a.push(function(){var a,b,d,j;for(d=f=e.split("."),j=[],c=a=0,b=d.length;b>a;c=++a)g=d[c],j.push(c===f.length-1?null!=h[g]?h[g]:h[g]=i:h=null!=h[g]?h[g]:h[g]={});return j}());return a}());return l},d){case"progress":return a(function(a,c){var d,e,f,g;return e=a[0],d=a[1],g=c[0],f=c[1],b([d,f],{"stats.progress.points":0}),d.stats.progress.points-f.stats.progress.points});case"priority":return a(function(a,c){var d,e,f,g,h,i,j;return g=a[0],f=a[1],i=c[0],h=c[1],b([f,h],{"stats.progress.time":0,"stats.days":1e3}),j=k.map([f,h],function(a){var b;return b=a.stats,(b.progress.points-b.progress.time)*b.days}),d=j[0],e=j[1],e-d});case"name":return a(function(a,b){var c,d,e,f,h,i;return d=a[0],c=a[1],f=b[0],e=b[1],(i=f.owner.localeCompare(d.owner))?i:(h=f.name.localeCompare(d.name))?h:g.valid(e.title)&&g.valid(c.title)?g.gt(e.title,c.title):e.title.localeCompare(c.title)});default:return function(){return 0}}},find:function(a){return k.find(this.data.list,a)},exists:function(){return!!this.find.apply(this,arguments)},add:function(a){return this.exists(a)?void 0:this.push("list",a)},findIndex:function(a){var b,c;return c=a.owner,b=a.name,k.findIndex(this.data.list,{owner:c,name:b})},addMilestone:function(a,b){var c,d;if(k.extend(b,{stats:i(b)}),(c=this.findIndex(a))<0)throw 500;return null!=a.milestones?(this.push("list."+c+".milestones",b),d=this.data.list[c].milestones.length-1):(this.set("list."+c+".milestones",[b]),d=0),this.sort([c,d],[a,b])},saveError:function(a,b){var c;if((c=this.findIndex(a))>-1)return null!=a.errors?this.push("list."+c+".errors",b):this.set("list."+c+".errors",[b]);throw 500},demo:function(){return this.set({list:[{owner:"mbostock",name:"d3"},{owner:"medic",name:"medic-webapp"},{owner:"ractivejs",name:"ractive"},{owner:"radekstepan",name:"disposable"},{owner:"rails",name:"rails"},{owner:"rails",name:"spring"}],index:[]})},clear:function(){return this.set({list:[],index:[]})},sort:function(a,b){var c,d,e,f,g,i,j,k,l,m,n,o;if(e=this.data.index||[],a)d=h(e,b,this.comparator()),e.splice(d,0,a);else for(n=this.data.list,c=j=0,l=n.length;l>j;c=++j)if(i=n[c],null!=i.milestones)for(o=i.milestones,f=k=0,m=o.length;m>k;f=++k)g=o[f],d=h(e,[i,g],this.comparator()),e.splice(d,0,[c,f]);return this.set("index",e)},onconstruct:function(){return this.subscribe("!projects/add",this.add,this),this.subscribe("!projects/demo",this.demo,this)},onrender:function(){return this.set("list",f.get("projects")||[]),this.observe("list",function(a){return f.set("projects",k.pluckMany(a,["owner","name"]))},{init:!1}),this.observe("sortBy",function(){return this.set("index",null),this.sort()},{init:!1})}})},{"../models/config.coffee":20,"../modules/stats.coffee":32,"../utils/date.coffee":45,"../utils/ractive/model.coffee":50,"./user.coffee":24,lodash:7,lscache:8,semver:14,"sortedindex-compare":15}],23:[function(a,b){var c,d,e,f;c=a("../utils/ractive/model.coffee"),f=new c({name:"models/system",data:{loading:!1}}),e=0,d=function(){return e+=1,f.set("loading",!0),function(){return e-=1,f.set("loading",+e)}},b.exports={system:f,async:d}},{"../utils/ractive/model.coffee":50}],24:[function(a,b){var c;c=a("../utils/ractive/model.coffee"),b.exports=new c({name:"models/user"})},{"../utils/ractive/model.coffee":50}],25:[function(a,b){var c;c=a("d3"),b.exports={horizontal:function(a,b){return c.svg.axis().scale(b).orient("bottom").tickSize(-a).tickFormat(function(a){return a.getDate()}).tickPadding(10)},vertical:function(a,b){return c.svg.axis().scale(b).orient("left").tickSize(-a).ticks(5).tickPadding(10)}}},{d3:4}],26:[function(a,b){var c,d,e,f=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};e=a("lodash"),d=a("d3"),c=a("../../models/config.coffee"),b.exports={actual:function(a,b,c){var f,g,h,i,j;return f=[{date:new Date(b),points:c}],h=+1/0,g=-1/0,j=e.map(a,function(a){var b,d;return d=a.size,b=a.closed_at,h>d&&(h=d),d>g&&(g=d),a.date=new Date(b),a.points=c-=d,a}),i=d.scale.linear().domain([h,g]).range([5,8]),j=e.map(j,function(a){return a.radius=i(a.size),a}),[].concat(f,j)},ideal:function(a,b,d){var g,h,i,j,k,l,m,n,o,p,q;return a>b&&(p=[a,b],b=p[0],a=p[1]),q=e.map(a.match(c.data.chart.datetime)[1].split("-"),function(a){return parseInt(a)}),o=q[0],k=q[1],h=q[2],g=new Date(b),i=[],j=0,(m=function(a){var b,d;return b=new Date(o,k-1,h+a),(d=b.getDay())||(d=7),f.call(c.data.chart.off_days,d)>=0?i.push({date:b,off_day:!0}):(j+=1,i.push({date:b})),b>g?void 0:m(a+1)})(0),n=d/(j-1),i=e.map(i,function(a,b){return a.points=d,i[b]&&!i[b].off_day&&(d-=n),a}),(l=new Date)>g&&i.push({date:l,points:0}),i},trend:function(a,b,c){var d,f,g,h,i,j,k,l,m,n,o,p,q;return a.length?(p=+a[0].date,q=e.map(a,function(a){var b,c;return b=a.date,c=a.points,[+b-p,c]}),m=a[a.length-1],q.push([+new Date-p,m.points]),g=0,i=0,h=0,d=(l=q.length)*e.reduce(q,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),o=(d-g*i)/(l*h-Math.pow(g,2)),k=(i-o*g)/l,j=function(a){return o*a+k},b=new Date(b),n=new Date,c?(c=new Date(c),n>c&&(c=n)):c=n,d=b-p,f=c-p,[{date:b,points:j(d)},{date:c,points:j(f)}]):[]}}},{"../../models/config.coffee":20,d3:4,lodash:7}],27:[function(a,b){var c,d,e,f;f=a("lodash"),c=a("async"),d=a("../../models/config.coffee"),e=a("./request.coffee"),b.exports={fetchAll:function(a,b){var g,h;return g=function(a,b){var c,e,g,h;switch(d.data.chart.points){case"ONE_SIZE":for(e=a.length,g=0,h=a.length;h>g;g++)c=a[g],c.size=1;return b(null,{list:a,size:e});case"LABELS":return e=0,a=f.filter(a,function(a){var b;return(b=a.labels)?(a.size=f.reduce(b,function(a,b){var c;return(c=b.name.match(d.data.chart.size_label))?a+=parseInt(c[1]):a},0),e+=a.size,!!a.size):!1}),b(null,{list:a,size:e})}},h=function(b,c){var d,g;return g=[],(d=function(h){return e.allIssues(a,{state:b,page:h},function(a,b){return a?c(a):b.length?(g=g.concat(f.sortBy(b,"closed_at")),b.length<100?c(null,g):d(h+1)):c(null,g)})})(1)},c.parallel([f.partial(c.waterfall,[f.partial(h,"open"),g]),f.partial(c.waterfall,[f.partial(h,"closed"),g])],function(a,c){var d,e;return e=c[0],d=c[1],b(a,{open:e,closed:d})})}}},{"../../models/config.coffee":20,"./request.coffee":29,async:1,lodash:7}],28:[function(a,b){var c;c=a("./request.coffee"),b.exports={fetch:c.oneMilestone,fetchAll:c.allMilestones}},{"./request.coffee":29}],29:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n;n=a("lodash"),l=a("superagent"),m=a("../../models/user.coffee"),l.parse={"application/json":function(a){var b;try{return JSON.parse(a)}catch(c){return b=c,{}}}},c={github:{host:"api.github.com",protocol:"https"}},b.exports={repo:function(a,b){var d,f;return f=a.owner,d=a.name,g({owner:f,name:d})?h(function(){var a;return a=n.defaults({path:"/repos/"+f+"/"+d,headers:e(m.data.accessToken)},c.github),i(a,b)}):b("Request is malformed")},allMilestones:function(a,b){var d,f;return f=a.owner,d=a.name,g({owner:f,name:d})?h(function(){var a;return a=n.defaults({path:"/repos/"+f+"/"+d+"/milestones",query:{state:"open",sort:"due_date",direction:"asc"},headers:e(m.data.accessToken)},c.github),i(a,b)}):b("Request is malformed")},oneMilestone:function(a,b){var d,f,j;return j=a.owner,f=a.name,d=a.milestone,g({owner:j,name:f,milestone:d})?h(function(){var a;return a=n.defaults({path:"/repos/"+j+"/"+f+"/milestones/"+d,query:{state:"open",sort:"due_date",direction:"asc"},headers:e(m.data.accessToken)},c.github),i(a,b)}):b("Request is malformed")},allIssues:function(a,b,d){var f,j,k;return k=a.owner,j=a.name,f=a.milestone,g({owner:k,name:j,milestone:f})?h(function(){var a;return a=n.defaults({path:"/repos/"+k+"/"+j+"/issues",query:n.extend(b,{milestone:f,per_page:"100"}),headers:e(m.data.accessToken)},c.github),i(a,d)}):d("Request is malformed")}},i=function(a,b){var c,d,e,f,g,h,i,k,m,n,o;h=a.protocol,e=a.host,g=a.path,k=a.query,d=a.headers,c=!1,i=k?"?"+function(){var a;a=[];for(f in k)o=k[f],a.push(""+f+"="+o);return a}().join("&"):"",m=l.get(""+h+"://"+e+g+i);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),j(a,d,b)) -})},j=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={"Content-Type":"application/json",Accept:"application/vnd.github.v3"},null!=a&&(b.Authorization="token "+a),b},g=function(a){var b,c,d;c={owner:function(a){return null!=a},name:function(a){return null!=a},milestone:function(a){return n.isInt(a)}};for(b in a)if(d=a[b],b in c&&!c[b](d))return!1;return!0},f=m.data.ready,k=[],h=function(a){return f?a():k.push(a)},m.observe("ready",function(a){var b;if(f=a,a){for(b=[];k.length;)b.push(k.shift()());return b}}),d=function(a){var b;switch(!1){case!n.isString(a):b=a;break;case!n.isArray(a):b=a[1];break;case!(n.isObject(a)&&n.isString(a.message)):b=a.message}if(!b)try{b=JSON.stringify(a)}catch(c){b=a.toString()}return b}},{"../../models/user.coffee":24,lodash:7,superagent:16}],30:[function(a,b){var c,d;d=a("ractive"),c=d.extend({}),b.exports=new c},{ractive:13}],31:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=[].slice;m=a("lodash"),e=a("director"),g=a("./mediator.coffee"),k=a("../models/system.coffee"),f="#page",h={index:a("../views/pages/index.coffee"),milestone:a("../views/pages/milestone.coffee"),"new":a("../views/pages/new.coffee"),project:a("../views/pages/project.coffee")},c=function(a,b,c){return g.fire("!projects/add",{owner:b,name:c})},d=function(a,b){var c,d,e,f;for(null==b&&(b=[]),f=[],d=0,e=b.length;e>d;d++)c=b[d],f.push(m.partial(c,a));return f},l=null,i=function(){var a,b,c;return c=arguments[0],b=2<=arguments.length?n.call(arguments,1):[],null!=l&&l.teardown(),g.fire("!app/notify/hide"),a=h[c],l=new a({el:f,data:{route:b}})},j={"/":d("index",[i]),"/new/project":d("new",[i]),"/:owner/:name":d("project",[c,i]),"/:owner/:name/:milestone":d("milestone",[c,i]),"/demo":function(){return g.fire("!projects/demo"),window.location.hash="#"}},b.exports=e.Router(j).configure({strict:!1,notfound:function(){throw 404}})},{"../models/system.coffee":23,"../views/pages/index.coffee":56,"../views/pages/milestone.coffee":57,"../views/pages/new.coffee":58,"../views/pages/project.coffee":59,"./mediator.coffee":30,director:5,lodash:7}],32:[function(a,b){var c,d;c=a("moment"),d=function(a,b){return a+b===0?0:100*(a/(b+a))},b.exports=function(a){var b,e,f,g,h,i,j,k,l,m;return h=!1,j=!0,k=!1,i=!0,l=0,b=a.issues.closed.size,e=a.issues.open.size,b+e>0&&(i=!1,l=d(b,e),100===l&&(h=!0)),a.due_on?(b=+new Date(a.created_at),e=+new Date,f=+new Date(a.due_on),e>f&&(k=!0),m=d(e-b,f-e),g=c(e).diff(c(b),"days")/100,j=l>m,{isDone:h,days:g,isOnTime:j,isOverdue:k,progress:{points:l,time:m}}):{isOverdue:k,isOnTime:j,isDone:h,isEmpty:i,progress:{points:l}}}},{moment:10}],33:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"app"},f:[{t:7,e:"Notify"}," ",{t:7,e:"Header"}," ",{t:7,e:"div",a:{id:"page"},f:[]}," ",{t:7,e:"div",a:{id:"footer"},f:[{t:7,e:"div",a:{"class":"wrap"},f:["© 2012-2014 ",{t:7,e:"a",a:{href:"http://cloudfi.re"},f:["Cloudfire Systems"]}]}]}]}]}},{}],34:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"chart"}}]}},{}],35:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"head"},f:[{t:4,n:53,r:"user",f:[{t:4,r:"ready",f:[{t:7,e:"div",a:{"class":"right"},t1:"fade",f:[{t:4,r:"uid",f:[{t:2,r:"github.displayName"}," logged in"]},{t:4,n:51,f:[{t:7,e:"a",a:{"class":"github"},v:{click:"!login"},f:[{t:7,e:"Icons",a:{icon:"github"}}," Sign In"]}],r:"uid"}]}]}]}," ",{t:7,e:"a",a:{id:"icon",href:"#"},f:[{t:7,e:"Icons",a:{icon:[{t:2,r:"icon"}]}}]}," ",{t:7,e:"ul",f:[{t:7,e:"li",f:[{t:7,e:"a",a:{href:"#new/project","class":"add"},f:[{t:7,e:"Icons",a:{icon:"plus-circled"}}," Add a Project"]}]}," ",{t:7,e:"li",f:[{t:7,e:"a",a:{href:"#demo"},f:[{t:7,e:"Icons",a:{icon:"download-cloud"}}," Demo Projects"]}]}]}]}]}},{}],36:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"hero"},f:[{t:7,e:"div",a:{"class":"content"},f:[{t:7,e:"Icons",a:{icon:"address"}}," ",{t:7,e:"h2",f:["See your project progress"]}," ",{t:7,e:"p",f:["Not sure where to start? Just add a demo repo to see a chart. There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable."]}," ",{t:7,e:"div",a:{"class":"cta"},f:[{t:7,e:"a",a:{href:"#new/project","class":"primary"},f:[{t:7,e:"Icons",a:{icon:"plus-circled"}}," Add your project"]}," ",{t:7,e:"a",a:{href:"#","class":"secondary"},f:["Read the Guide"]}]}]}]}]}},{}],37:[function(a,b){b.exports={v:1,t:[{t:4,r:"code",f:[{t:7,e:"span",a:{"class":["icon ",{t:2,r:"icon"}]},f:[{t:3,x:{r:["code"],s:'"&#"+_0+";"'}}]}]}]}},{}],38:[function(a,b){b.exports={v:1,t:[{t:4,r:"text",f:[{t:4,r:"system",f:[{t:7,e:"div",a:{id:"notify","class":[{t:2,r:"type"}," system"],style:["top:",{t:2,r:"top"},"%"]},f:[{t:7,e:"Icons",a:{icon:[{t:2,r:"icon"}]}}," ",{t:7,e:"p",f:[{t:2,r:"text"}]}]}]},{t:4,n:51,f:[{t:7,e:"div",a:{id:"notify","class":[{t:2,r:"type"}],style:["top:",{t:2,x:{r:["top"],s:"-_0"}},"px"]},f:[{t:7,e:"span",a:{"class":"close"},v:{click:"close"}}," ",{t:7,e:"Icons",a:{icon:[{t:2,r:"icon"}]}}," ",{t:7,e:"p",f:[{t:2,r:"text"}]}]}],r:"system"}]}]}},{}],39:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:4,n:50,r:"projects.list",f:[{t:4,r:"ready",f:[{t:7,e:"div",t1:"fade",f:[{t:7,e:"Projects",a:{projects:[{t:2,r:"projects"}]}}]}]}]},{t:4,n:51,f:[{t:7,e:"Hero"}],r:"projects.list"}]}]}},{}],40:[function(a,b){b.exports={v:1,t:[{t:4,r:"ready",f:[{t:7,e:"div",t1:"fade",f:[{t:7,e:"div",a:{id:"title"},f:[{t:7,e:"div",a:{"class":"wrap"},f:[{t:7,e:"h2",a:{"class":"title"},f:[{t:2,x:{r:["format","milestone.title"],s:"_0.title(_1)"}}]}," ",{t:7,e:"span",a:{"class":"sub"},f:[{t:3,x:{r:["format","milestone.due_on"],s:"_0.due(_1)"}}]}," ",{t:7,e:"div",a:{"class":"description"},f:[{t:3,x:{r:["format","milestone.description"],s:"_0.markdown(_1)"}}]}]}]}," ",{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:7,e:"Chart",a:{milestone:[{t:2,r:"milestone"}]}}]}]}]}]}},{}],41:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:7,e:"div",a:{id:"add"},f:[{t:7,e:"div",a:{"class":"header"},f:[{t:7,e:"h2",f:["Add a Project"]}," ",{t:7,e:"p",f:["Type in the name of the repository as you would normally. ",{t:4,n:53,r:"user",f:[{t:4,r:"ready",f:[{t:4,r:"uid",f:["If you'd like to add a private GitHub project, ",{t:7,e:"a",v:{click:"!login"},f:["Sign In"]}," first."],n:51}]}]}]}]}," ",{t:7,e:"div",a:{"class":"form"},f:[{t:7,e:"table",f:[{t:7,e:"tr",f:[{t:7,e:"td",f:[{t:7,e:"input",a:{type:"text",placeholder:"user/repo",autocomplete:"off",value:[{t:2,r:"value"}]},v:{keyup:{n:"submit",d:[{t:2,r:"value"}]}}}]}," ",{t:7,e:"td",f:[{t:7,e:"a",v:{click:{n:"submit",d:[{t:2,r:"value"}]}},f:["Add"]}]}]}]}]}]}]}]}},{}],42:[function(a,b){b.exports={v:1,t:[{t:4,r:"ready",f:[{t:7,e:"div",t1:"fade",f:[{t:7,e:"div",a:{id:"title"},f:[{t:7,e:"div",a:{"class":"wrap"},f:[{t:7,e:"h2",a:{"class":"title"},f:[{t:2,x:{r:["route"],s:'_0.join("/")'}}]}]}]}," ",{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:7,e:"Milestones",a:{project:[{t:2,r:"project"}]}}]}]}]}]}},{}],43:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"projects"},f:[{t:7,e:"div",a:{"class":"header"},f:[{t:7,e:"a",a:{"class":"sort"},v:{click:"sortBy"},f:[{t:7,e:"Icons",a:{icon:"sort-alphabet"}}," Sorted by ",{t:2,r:"projects.sortBy"}]}," ",{t:7,e:"h2",f:["Milestones"]}]}," ",{t:7,e:"table",f:[{t:4,r:"projects.index",f:[{t:4,x:{r:["."],s:"{index:_0}"},f:[{t:4,x:{r:["index.0","projects.list"],s:"{p:_1[_0]}"},f:[{t:4,n:50,x:{r:["p.owner","project.owner","p.name","project.name"],s:"_0==_1&&_2==_3"},f:[{t:4,x:{r:["index.1","project.milestones"],s:"{milestone:_1[_0]}"},f:[{t:7,e:"tr",a:{"class":[{t:4,n:50,r:"milestone.stats.isDone",f:["done"]}]},f:[{t:7,e:"td",f:[{t:7,e:"a",a:{"class":"milestone",href:["#",{t:2,r:"project.owner"},"/",{t:2,r:"project.name"},"/",{t:2,r:"milestone.number"}]},f:[{t:2,r:"milestone.title"}]}]}," ",{t:7,e:"td",a:{style:"width:1%"},f:[{t:7,e:"div",a:{"class":"progress"},f:[{t:7,e:"span",a:{"class":"percent"},f:[{t:2,x:{r:["milestone.stats.progress.points"],s:"Math.floor(_0)"}},"%"]}," ",{t:7,e:"span",a:{"class":["due ",{t:4,n:50,r:"milestone.stats.isOverdue",f:["red"]}]},f:[{t:3,x:{r:["format","milestone.due_on"],s:"_0.due(_1)"}}]}," ",{t:7,e:"div",a:{"class":"outer bar"},f:[{t:7,e:"div",a:{"class":["inner bar ",{t:2,x:{r:["milestone.stats.isOnTime"],s:'(_0)?"green":"red"'}}],style:["width:",{t:2,r:"milestone.stats.progress.points"},"%"]}}]}]}]}]}]}]}]}]}]}]}," ",{t:7,e:"div",a:{"class":"footer"},f:[]}]}]}},{}],44:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"projects"},f:[{t:7,e:"div",a:{"class":"header"},f:[{t:7,e:"a",a:{"class":"sort"},v:{click:"sortBy"},f:[{t:7,e:"Icons",a:{icon:"sort-alphabet"}}," Sorted by ",{t:2,r:"projects.sortBy"}]}," ",{t:7,e:"h2",f:["Projects"]}]}," ",{t:7,e:"table",f:[{t:4,r:"projects.list",f:[{t:4,n:50,r:"errors",f:[{t:7,e:"tr",f:[{t:7,e:"td",a:{colspan:"3","class":"repo"},f:[{t:7,e:"div",a:{"class":"project"},f:[{t:2,r:"owner"},"/",{t:2,r:"name"}," ",{t:7,e:"span",a:{"class":"error",title:[{t:2,x:{r:["errors"],s:'_0.join("\\n")'}}]},f:[{t:7,e:"Icons",a:{icon:"attention"}}]}]}]}]}]}]}," ",{t:4,r:"projects.index",f:[{t:4,x:{r:["."],s:"{index:_0}"},f:[{t:4,x:{r:["index.0","projects.list"],s:"{project:_1[_0]}"},f:[{t:4,n:53,r:"project",f:[{t:4,x:{r:["index.1","project.milestones"],s:"{milestone:_1[_0]}"},f:[{t:7,e:"tr",a:{"class":[{t:4,n:50,r:"milestone.stats.isDone",f:["done"]}]},f:[{t:7,e:"td",a:{"class":"repo"},f:[{t:7,e:"a",a:{"class":"project",href:["#",{t:2,r:"owner"},"/",{t:2,r:"name"}]},f:[{t:2,r:"owner"},"/",{t:2,r:"name"}]}]}," ",{t:7,e:"td",f:[{t:7,e:"a",a:{"class":"milestone",href:["#",{t:2,r:"owner"},"/",{t:2,r:"name"},"/",{t:2,r:"milestone.number"}]},f:[{t:2,r:"milestone.title"}]}]}," ",{t:7,e:"td",a:{style:"width:1%"},f:[{t:7,e:"div",a:{"class":"progress"},f:[{t:7,e:"span",a:{"class":"percent"},f:[{t:2,x:{r:["milestone.stats.progress.points"],s:"Math.floor(_0)"}},"%"]}," ",{t:7,e:"span",a:{"class":["due ",{t:4,n:50,r:"milestone.stats.isOverdue",f:["red"]}]},f:[{t:3,x:{r:["format","milestone.due_on"],s:"_0.due(_1)"}}]}," ",{t:7,e:"div",a:{"class":"outer bar"},f:[{t:7,e:"div",a:{"class":["inner bar ",{t:2,x:{r:["milestone.stats.isOnTime"],s:'(_0)?"green":"red"'}}],style:["width:",{t:2,r:"milestone.stats.progress.points"},"%"]}}]}]}]}]}]}]}]}]}]}]}," ",{t:7,e:"div",a:{"class":"footer"},f:[]}]}]}},{}],45:[function(a,b){b.exports={now:function(){return(new Date).toJSON()}}},{}],46:[function(a,b){var c,d,e;e=a("lodash"),d=a("moment"),c=a("marked"),b.exports={fromNow:e.memoize(function(a){return d(new Date(a)).fromNow()}),due:function(a){return a?["due",this.fromNow(a)].join(" "):" "},markdown:function(a){return c(a)},title:function(a){return a.toLowerCase().indexOf("milestone")>-1?a:["Milestone",a].join(" ")},hexToDec:function(a){return parseInt(a,16)}}},{lodash:7,marked:9,moment:10}],47:[function(a,b){b.exports={is:function(a){var b;return"keyup"===(b=a.original.type)||"keydown"===b},isEnter:function(a){return 13===a.original.which}}},{}],48:[function(a){var b;b=a("lodash"),b.mixin({pluckMany:function(a,c){if(!b.isArray(c))throw"`keys` needs to be an Array";return b.map(a,function(a){var d;return d={},b.each(c,function(b){return d[b]=a[b]}),d})},isInt:function(a){return!isNaN(a)&&parseInt(Number(a))===a&&!isNaN(parseInt(a,10))}})},{lodash:7}],49:[function(a,b){var c,d,e;e=a("lodash"),c=a("ractive"),d=a("../../modules/mediator.coffee"),b.exports=c.extend({subscribe:function(a,b,c){return null==c&&(c=this),e.isArray(this._subs)||(this._subs=[]),e.isFunction(b)?this._subs.push(d.on(a,e.bind(b,c))):console.log("Warning: `cb` is not a function")},publish:function(){return d.fire.apply(d,arguments)},onteardown:function(){var a,b,c,d,f;if(e.isArray(this._subs)){for(d=this._subs,f=[],b=0,c=d.length;c>b;b++)a=d[b],f.push(e.isFunction(a.cancel)?a.cancel():console.log("Warning: `sub.cancel` is not a function"));return f}}})},{"../../modules/mediator.coffee":30,lodash:7,ractive:13}],50:[function(a,b){var c;c=a("./eventful.coffee"),b.exports=function(a){var b,d;return b=c.extend(a),d=new b,d.render(),d}},{"./eventful.coffee":49}],51:[function(a,b){var c,d,e,f;c=a("ractive"),e=a("d3"),a("d3-tip")(e),f=a("../modules/chart/lines.coffee"),d=a("../modules/chart/axes.coffee"),b.exports=c.extend({name:"views/chart",template:a("../templates/chart.html"),oncomplete:function(){var a,b,c,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;return m=this.data.milestone,h=m.issues,p=h.open.size+h.closed.size,b=h.closed.list[0].closed_at,h.length&&m.created_at>b&&(m.created_at=b),a=f.actual(h.closed.list,m.created_at,p),g=f.ideal(m.created_at,m.due_on,p),q=f.trend(a,m.created_at,m.due_on),w=this.el.getBoundingClientRect(),c=w.height,r=w.width,l={top:30,right:30,bottom:40,left:50},r-=l.left+l.right,c-=l.top+l.bottom,s=e.time.scale().range([0,r]),u=e.scale.linear().range([c,0]),t=d.horizontal(c,s),v=d.vertical(r,u),i=e.svg.line().interpolate("linear").x(function(a){return s(a.date)}).y(function(a){return u(a.points)}),s.domain([g[0].date,g[g.length-1].date]),u.domain([0,g[0].points]).nice(),n=e.select(this.el.querySelector("#chart")).append("svg").attr("width",r+l.left+l.right).attr("height",c+l.top+l.bottom).append("g").attr("transform","translate("+l.left+","+l.top+")"),n.append("g").attr("class","x axis day").attr("transform","translate(0,"+c+")").call(t),j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],k=t.orient("top").tickSize(c).tickFormat(function(a){return j[a.getMonth()]}).ticks(2),n.append("g").attr("class","x axis month").attr("transform","translate(0,"+c+")").call(k),n.append("g").attr("class","y axis").call(v),n.append("svg:line").attr("class","today").attr("x1",s(new Date)).attr("y1",0).attr("x2",s(new Date)).attr("y2",c),n.append("path").attr("class","ideal line").attr("d",i.interpolate("linear")(g)),n.append("path").attr("class","trendline line").attr("d",i.interpolate("linear")(q)),n.append("path").attr("class","actual line").attr("d",i.interpolate("linear").y(function(a){return u(a.points)})(a)),o=e.tip().attr("class","d3-tip").html(function(a){var b,c;return b=a.number,c=a.title,"#"+b+": "+c}),n.call(o),n.selectAll("a.issue").data(a.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,s(b)}).attr("cy",function(a){var b;return b=a.points,u(b)}).attr("r",function(a){var b;return b=a.radius,5}).on("mouseover",o.show).on("mouseout",o.hide)}})},{"../modules/chart/axes.coffee":25,"../modules/chart/lines.coffee":26,"../templates/chart.html":34,d3:4,"d3-tip":3,ractive:13}],52:[function(a,b){var c,d,e,f,g;d=a("ractive"),f=a("../models/system.coffee").system,e=a("../models/firebase.coffee"),g=a("../models/user.coffee"),c=a("./icons.coffee"),b.exports=d.extend({name:"views/header",template:a("../templates/header.html"),data:{user:g,icon:"fire-station"},components:{Icons:c},adapt:[d.adaptors.Ractive],onconstruct:function(){return this.on("!login",function(){return e.login()})},onrender:function(){return f.observe("loading",function(a){return function(b){return a.set("icon",b?"spinner1":"fire-station")}}(this))}})},{"../models/firebase.coffee":21,"../models/system.coffee":23,"../models/user.coffee":24,"../templates/header.html":35,"./icons.coffee":54,ractive:13}],53:[function(a,b){var c,d;d=a("ractive"),c=a("./icons.coffee"),b.exports=d.extend({name:"views/hero",template:a("../templates/hero.html"),components:{Icons:c},adapt:[d.adaptors.Ractive]})},{"../templates/hero.html":36,"./icons.coffee":54,ractive:13}],54:[function(a,b){var c,d,e;c=a("ractive"),e=a("../utils/format.coffee"),d={cog:"e800",search:"e801",github:"e802",address:"e803","plus-circled":"e804","fire-station":"e805","sort-alphabet":"e806","down-open":"e807",spin6:"e808",megaphone:"e809",spin4:"e80a",spinner1:"e80b",attention:"e80c","download-cloud":"e80d"},b.exports=c.extend({name:"views/icons",template:a("../templates/icons.html"),isolated:!0,onrender:function(){return this.observe("icon",function(a){var b;return a&&(b=d[a])?this.set("code",e.hexToDec(b)):this.set("code",null)})}})},{"../templates/icons.html":37,"../utils/format.coffee":46,ractive:13}],55:[function(a,b){var c,d,e,f,g,h;h=a("lodash"),f=a("ractive"),g=a("d3"),c=a("../utils/ractive/eventful.coffee"),e=a("./icons.coffee"),d=68,b.exports=c.extend({name:"views/notify",template:a("../templates/notify.html"),data:{top:d,hidden:!0,defaults:{text:"",type:"",system:!1,icon:"megaphone",ttl:5e3}},components:{Icons:e},adapt:[f.adaptors.Ractive],show:function(a){var b;return this.set("hidden",!1),this.set(a=h.defaults(a,this.data.defaults)),b=[0,50][+a.system],this.animate("top",b,{easing:g.ease("bounce"),duration:800}),a.ttl?h.delay(h.bind(this.hide,this),a.ttl):void 0},hide:function(){return this.data.hidden?void 0:(this.set("hidden",!0),this.animate("top",d,{easing:g.ease("back"),complete:function(a){return function(){return a.set("text",null)}}(this)}))},onconstruct:function(){return this.subscribe("!app/notify",this.show,this),this.subscribe("!app/notify/hide",this.hide,this),this.on("close",this.hide)}})},{"../templates/notify.html":38,"../utils/ractive/eventful.coffee":49,"./icons.coffee":54,d3:4,lodash:7,ractive:13}],56:[function(a,b){var c,d,e,f,g,h,i,j,k;k=a("lodash"),e=a("ractive"),f=a("async"),c=a("../hero.coffee"),d=a("../tables/projects.coffee"),i=a("../../models/projects.coffee"),j=a("../../models/system.coffee"),h=a("../../modules/github/milestones.coffee"),g=a("../../modules/github/issues.coffee"),b.exports=e.extend({name:"views/pages/index",template:a("../../templates/pages/index.html"),components:{Hero:c,Projects:d},data:{projects:i,ready:!1},adapt:[e.adaptors.Ractive],cb:function(){return this.set("ready",!0)},onrender:function(){var a;return document.title="Burnchart: GitHub Burndown Chart as a Service",i.list.length?(a=j.async(),f.map(i.data.list,function(a,b){return h.fetchAll(a,function(c,d){return c?(i.saveError(a,c),b()):f.each(d,function(b,c){return k.find(a.milestones,function(a){var c;return c=a.number,b.number===c})?c(null):g.fetchAll({owner:a.owner,name:a.name,milestone:b.number},function(d,e){return d?(i.saveError(a,d),c()):(k.extend(b,{issues:e}),i.addMilestone(a,b),c())})},b)})},function(b){return function(){return a(),b.cb()}}(this))):this.cb()}})},{"../../models/projects.coffee":22,"../../models/system.coffee":23,"../../modules/github/issues.coffee":27,"../../modules/github/milestones.coffee":28,"../../templates/pages/index.html":39,"../hero.coffee":53,"../tables/projects.coffee":61,async:1,lodash:7,ractive:13}],57:[function(a,b){var c,d,e,f,g,h,i,j,k;k=a("lodash"),e=a("async"),c=a("../chart.coffee"),d=a("../../utils/ractive/eventful.coffee"),i=a("../../models/projects.coffee"),j=a("../../models/system.coffee"),h=a("../../modules/github/milestones.coffee"),g=a("../../modules/github/issues.coffee"),f=a("../../utils/format.coffee"),b.exports=d.extend({name:"views/pages/chart",template:a("../../templates/pages/milestone.html"),components:{Chart:c},data:{format:f,ready:!1},cb:function(a,b){return a?this.publish("!app/notify",{text:a.toString(),type:"alert",system:!0,ttl:null}):b.stats.isEmpty?this.publish("!app/notify",{text:"The milestone has no issues",type:"warn",system:!0,ttl:null}):(b.stats.isDone&&this.publish("!app/notify",{text:"The milestone is complete",type:"success"}),b.stats.isOverdue&&this.publish("!app/notify",{text:"The milestone is overdue",type:"warn"}),this.set({milestone:b,ready:!0}))},onrender:function(){var a,b,c,d,f,l,m,n,o;return o=this.get("route"),m=o[0],l=o[1],f=o[2],f=parseInt(f),document.title=""+m+"/"+l+"/"+f,(n=i.find({owner:m,name:l}))?(a=k.find(n.milestones,{number:f}),null!=a?this.cb(null,a):(b=j.async(),d=function(a){return h.fetch({owner:m,name:l,milestone:f},a)},c=function(a,b){return g.fetchAll({owner:m,name:l,milestone:f},function(c,d){return b(c,k.extend(a,{issues:d}))})},e.waterfall([d,c],function(a){return function(c,d){return b(),c||i.addMilestone(n,d),a.cb.apply(a,arguments)}}(this)))):this.cb("Project not found")}})},{"../../models/projects.coffee":22,"../../models/system.coffee":23,"../../modules/github/issues.coffee":27,"../../modules/github/milestones.coffee":28,"../../templates/pages/milestone.html":40,"../../utils/format.coffee":46,"../../utils/ractive/eventful.coffee":49,"../chart.coffee":51,async:1,lodash:7}],58:[function(a,b){var c,d,e,f,g,h,i;i=a("lodash"),d=a("ractive"),c=a("../../utils/ractive/eventful.coffee"),e=a("../../models/firebase.coffee"),g=a("../../models/system.coffee"),h=a("../../models/user.coffee"),f=a("../../utils/key.coffee"),b.exports=c.extend({name:"views/pages/new",template:a("../../templates/pages/new.html"),data:{value:"radekstepan/disposable",user:h},adapt:[d.adaptors.Ractive],submit:function(a,b){var c,d,e;if(!f.is(a)||f.isEnter(a))return e=b.split("/"),d=e[0],c=e[1],this.publish("!projects/add",{owner:d,name:c}),window.location.hash="#"},onconstruct:function(){return this.on("!login",function(){return e.login()})},onrender:function(){var a;return document.title="Add a new project",a=function(){},this.observe("value",i.debounce(a,200),{init:!1}),this.el.querySelector("input").focus(),this.on("submit",this.submit)}})},{"../../models/firebase.coffee":21,"../../models/system.coffee":23,"../../models/user.coffee":24,"../../templates/pages/new.html":41,"../../utils/key.coffee":47,"../../utils/ractive/eventful.coffee":49,lodash:7,ractive:13}],59:[function(a,b){var c,d,e,f,g,h,i,j;j=a("lodash"),e=a("async"),d=a("../tables/milestones.coffee"),c=a("../../utils/ractive/eventful.coffee"),h=a("../../models/projects.coffee"),i=a("../../models/system.coffee"),g=a("../../modules/github/milestones.coffee"),f=a("../../modules/github/issues.coffee"),b.exports=c.extend({name:"views/pages/project",template:a("../../templates/pages/project.html"),components:{Milestones:d},data:{projects:h,ready:!1},cb:function(a){return a?this.publish("!app/notify",{text:a.toString(),type:"alert",system:!0,ttl:null}):this.set("ready",!0)},onrender:function(){var a,b,c,d,k,l,m,n;return n=this.get("route"),l=n[0],k=n[1],document.title=""+l+"/"+k,this.set("project",m=h.find({owner:l,name:k})),m?(a=i.async(),d=function(a){return j.find(m.milestones||[],{number:a})},c=function(a){return g.fetchAll(m,a)},b=function(a,b){return a.length?e.each(a,function(a,b){return d(a.number)?b(null):f.fetchAll({owner:l,name:k,milestone:a.number},function(c,d){return c?b(c):(h.addMilestone(m,j.extend(a,{issues:d})),b())})},b):b("The project has no milestones")},e.waterfall([c,b],function(b){return function(){return a(),b.cb.apply(b,arguments)}}(this))):this.cb("Project not found")}})},{"../../models/projects.coffee":22,"../../models/system.coffee":23,"../../modules/github/issues.coffee":27,"../../modules/github/milestones.coffee":28,"../../templates/pages/project.html":42,"../../utils/ractive/eventful.coffee":49,"../tables/milestones.coffee":60,async:1,lodash:7}],60:[function(a,b){var c;c=a("./table.coffee"),b.exports=c.extend({name:"views/milestones",template:a("../../templates/tables/milestones.html")})},{"../../templates/tables/milestones.html":43,"./table.coffee":62}],61:[function(a,b){var c;c=a("./table.coffee"),b.exports=c.extend({name:"views/projects",template:a("../../templates/tables/projects.html")})},{"../../templates/tables/projects.html":44,"./table.coffee":62}],62:[function(a,b){var c,d,e,f;d=a("ractive"),e=a("../../utils/format.coffee"),c=a("../icons.coffee"),f=a("../../models/projects.coffee"),b.exports=d.extend({name:"views/table",data:{format:e},components:{Icons:c},adapt:[d.adaptors.Ractive],onconstruct:function(){return this.on("sortBy",function(){var a,b;return a=f.data.sortFns,b=1+a.indexOf(f.data.sortBy),b===a.length&&(b=0),f.set("sortBy",a[b])})}})},{"../../models/projects.coffee":22,"../../utils/format.coffee":46,"../icons.coffee":54,ractive:13}]},{},[19]); \ No newline at end of file +for(n=function(a){l(this,a)},o={extend:{value:j},parse:{value:k},Promise:{value:h},svg:{value:d},magic:{value:e},VERSION:{value:"0.6.1"},adaptors:{writable:!0,value:{}},components:{writable:!0,value:{}},decorators:{writable:!0,value:{}},easing:{writable:!0,value:b},events:{writable:!0,value:{}},interpolators:{writable:!0,value:c},partials:{writable:!0,value:{}},transitions:{writable:!0,value:{}}},f(n,o),n.prototype=i(g,a),n.prototype.constructor=n,n.defaults=n.prototype,m.Ractive=n;m.length;)m.pop()();var p="function";if(typeof Date.now!==p||typeof String.prototype.trim!==p||typeof Object.keys!==p||typeof Array.prototype.indexOf!==p||typeof Array.prototype.forEach!==p||typeof Array.prototype.map!==p||typeof Array.prototype.filter!==p||"undefined"!=typeof window&&typeof window.addEventListener!==p)throw new Error("It looks like you're attempting to use Ractive.js in an older browser. You'll need to use one of the 'legacy builds' in order to continue - see http://docs.ractivejs.org/latest/legacy-builds for more information.");return n}(d,e,k,l,B,G,Dg,r,ze,kh,Lb,ih,f);"undefined"!=typeof b&&b.exports?b.exports=lh:"function"==typeof define&&define.amd&&define(function(){return lh}),a.Ractive=lh,lh.noConflict=function(){return a.Ractive=c,lh}}("undefined"!=typeof window?window:this)},{}],14:[function(a,b,c){!function(a){function c(a,b){var c=b?P[eb]:P[bb];return c.test(a)?new f(a,b):null}function d(a,b){var d=c(a,b);return d?d.version:null}function e(a,b){var d=c(a.trim().replace(/^[=v]+/,""),b);return d?d.version:null}function f(a,b){if(a instanceof f){if(a.loose===b)return a;a=a.version}else if("string"!=typeof a)throw new TypeError("Invalid Version: "+a);if(!(this instanceof f))return new f(a,b);this.loose=b;var c=a.trim().match(b?P[eb]:P[bb]);if(!c)throw new TypeError("Invalid Version: "+a);this.raw=a,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.prerelease=c[4]?c[4].split(".").map(function(a){return/^[0-9]+$/.test(a)?+a:a}):[],this.build=c[5]?c[5].split("."):[],this.format()}function g(a,b,c,d){"string"==typeof c&&(d=c,c=void 0);try{return new f(a,c).inc(b,d).version}catch(e){return null}}function h(a,b){var c=Eb.test(a),d=Eb.test(b);return c&&d&&(a=+a,b=+b),c&&!d?-1:d&&!c?1:b>a?-1:a>b?1:0}function i(a,b){return h(b,a)}function j(a,b,c){return new f(a,c).compare(b)}function k(a,b){return j(a,b,!0)}function l(a,b,c){return j(b,a,c)}function m(b,c){return b.sort(function(b,d){return a.compare(b,d,c)})}function n(b,c){return b.sort(function(b,d){return a.rcompare(b,d,c)})}function o(a,b,c){return j(a,b,c)>0}function p(a,b,c){return j(a,b,c)<0}function q(a,b,c){return 0===j(a,b,c)}function r(a,b,c){return 0!==j(a,b,c)}function s(a,b,c){return j(a,b,c)>=0}function t(a,b,c){return j(a,b,c)<=0}function u(a,b,c,d){var e;switch(b){case"===":"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),e=a===c;break;case"!==":"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),e=a!==c;break;case"":case"=":case"==":e=q(a,c,d);break;case"!=":e=r(a,c,d);break;case">":e=o(a,c,d);break;case">=":e=s(a,c,d);break;case"<":e=p(a,c,d);break;case"<=":e=t(a,c,d);break;default:throw new TypeError("Invalid operator: "+b)}return e}function v(a,b){if(a instanceof v){if(a.loose===b)return a;a=a.value}return this instanceof v?(this.loose=b,this.parse(a),void(this.value=this.semver===Fb?"":this.operator+this.semver.version)):new v(a,b)}function w(a,b){if(a instanceof w&&a.loose===b)return a;if(!(this instanceof w))return new w(a,b);if(this.loose=b,this.raw=a,this.set=a.split(/\s*\|\|\s*/).map(function(a){return this.parseRange(a.trim())},this).filter(function(a){return a.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+a);this.format()}function x(a,b){return new w(a,b).set.map(function(a){return a.map(function(a){return a.value}).join(" ").trim().split(" ")})}function y(a,b){return a=C(a,b),a=A(a,b),a=E(a,b),a=G(a,b)}function z(a){return!a||"x"===a.toLowerCase()||"*"===a}function A(a,b){return a.trim().split(/\s+/).map(function(a){return B(a,b)}).join(" ")}function B(a,b){var c=b?P[qb]:P[pb];return a.replace(c,function(a,b,c,d,e){var f;return z(b)?f="":z(c)?f=">="+b+".0.0 <"+(+b+1)+".0.0":z(d)?f=">="+b+"."+c+".0 <"+b+"."+(+c+1)+".0":e?("-"!==e.charAt(0)&&(e="-"+e),f=">="+b+"."+c+"."+d+e+" <"+b+"."+(+c+1)+".0"):f=">="+b+"."+c+"."+d+" <"+b+"."+(+c+1)+".0",f})}function C(a,b){return a.trim().split(/\s+/).map(function(a){return D(a,b)}).join(" ")}function D(a,b){var c=b?P[vb]:P[ub];return a.replace(c,function(a,b,c,d,e){var f;return z(b)?f="":z(c)?f=">="+b+".0.0 <"+(+b+1)+".0.0":z(d)?f="0"===b?">="+b+"."+c+".0 <"+b+"."+(+c+1)+".0":">="+b+"."+c+".0 <"+(+b+1)+".0.0":e?("-"!==e.charAt(0)&&(e="-"+e),f="0"===b?"0"===c?">="+b+"."+c+"."+d+e+" <"+b+"."+c+"."+(+d+1):">="+b+"."+c+"."+d+e+" <"+b+"."+(+c+1)+".0":">="+b+"."+c+"."+d+e+" <"+(+b+1)+".0.0"):f="0"===b?"0"===c?">="+b+"."+c+"."+d+" <"+b+"."+c+"."+(+d+1):">="+b+"."+c+"."+d+" <"+b+"."+(+c+1)+".0":">="+b+"."+c+"."+d+" <"+(+b+1)+".0.0",f})}function E(a,b){return a.split(/\s+/).map(function(a){return F(a,b)}).join(" ")}function F(a,b){a=a.trim();var c=b?P[lb]:P[kb];return a.replace(c,function(a,b,c,d,e){var f=z(c),g=f||z(d),h=g||z(e),i=h;return"="===b&&i&&(b=""),f?a=">"===b||"<"===b?"<0.0.0":"*":b&&i?(g&&(d=0),h&&(e=0),">"===b?(b=">=",g?(c=+c+1,d=0,e=0):h&&(d=+d+1,e=0)):"<="===b&&(b="<",g?c=+c+1:d=+d+1),a=b+c+"."+d+"."+e):g?a=">="+c+".0.0 <"+(+c+1)+".0.0":h&&(a=">="+c+"."+d+".0 <"+c+"."+(+d+1)+".0"),a})}function G(a){return a.trim().replace(P[Cb],"")}function H(a,b,c,d,e,f,g,h,i,j,k,l){return b=z(c)?"":z(d)?">="+c+".0.0":z(e)?">="+c+"."+d+".0":">="+b,h=z(i)?"":z(j)?"<"+(+i+1)+".0.0":z(k)?"<"+i+"."+(+j+1)+".0":l?"<="+i+"."+j+"."+k+"-"+l:"<="+h,(b+" "+h).trim()}function I(a,b){for(var c=0;c0){var d=a[c].semver;if(d.major===b.major&&d.minor===b.minor&&d.patch===b.patch)return!0}}return!1}return!0}function J(a,b,c){try{b=new w(b,c)}catch(d){return!1}return b.test(a)}function K(a,b,c){return a.filter(function(a){return J(a,b,c)}).sort(function(a,b){return l(a,b,c)})[0]||null}function L(a,b){try{return new w(a,b).range||"*"}catch(c){return null}}function M(a,b,c){return O(a,b,"<",c)}function N(a,b,c){return O(a,b,">",c)}function O(a,b,c,d){a=new f(a,d),b=new w(b,d);var e,g,h,i,j;switch(c){case">":e=o,g=t,h=p,i=">",j=">=";break;case"<":e=p,g=s,h=o,i="<",j="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(J(a,b,d))return!1;for(var k=0;k)?=?)";var gb=R++;Q[gb]=Q[T]+"|x|X|\\*";var hb=R++;Q[hb]=Q[S]+"|x|X|\\*";var ib=R++;Q[ib]="[v=\\s]*("+Q[hb]+")(?:\\.("+Q[hb]+")(?:\\.("+Q[hb]+")(?:"+Q[Z]+")?"+Q[ab]+"?)?)?";var jb=R++;Q[jb]="[v=\\s]*("+Q[gb]+")(?:\\.("+Q[gb]+")(?:\\.("+Q[gb]+")(?:"+Q[$]+")?"+Q[ab]+"?)?)?";var kb=R++;Q[kb]="^"+Q[fb]+"\\s*"+Q[ib]+"$";var lb=R++;Q[lb]="^"+Q[fb]+"\\s*"+Q[jb]+"$";var mb=R++;Q[mb]="(?:~>?)";var nb=R++;Q[nb]="(\\s*)"+Q[mb]+"\\s+",P[nb]=new RegExp(Q[nb],"g");var ob="$1~",pb=R++;Q[pb]="^"+Q[mb]+Q[ib]+"$";var qb=R++;Q[qb]="^"+Q[mb]+Q[jb]+"$";var rb=R++;Q[rb]="(?:\\^)";var sb=R++;Q[sb]="(\\s*)"+Q[rb]+"\\s+",P[sb]=new RegExp(Q[sb],"g");var tb="$1^",ub=R++;Q[ub]="^"+Q[rb]+Q[ib]+"$";var vb=R++;Q[vb]="^"+Q[rb]+Q[jb]+"$";var wb=R++;Q[wb]="^"+Q[fb]+"\\s*("+db+")$|^$";var xb=R++;Q[xb]="^"+Q[fb]+"\\s*("+cb+")$|^$";var yb=R++;Q[yb]="(\\s*)"+Q[fb]+"\\s*("+db+"|"+Q[ib]+")",P[yb]=new RegExp(Q[yb],"g");var zb="$1$2$3",Ab=R++;Q[Ab]="^\\s*("+Q[ib]+")\\s+-\\s+("+Q[ib]+")\\s*$";var Bb=R++;Q[Bb]="^\\s*("+Q[jb]+")\\s+-\\s+("+Q[jb]+")\\s*$";var Cb=R++;Q[Cb]="(<|>)?=?\\s*\\*";for(var Db=0;R>Db;Db++)P[Db]||(P[Db]=new RegExp(Q[Db]));a.parse=c,a.valid=d,a.clean=e,a.SemVer=f,f.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},f.prototype.inspect=function(){return''},f.prototype.toString=function(){return this.version},f.prototype.compare=function(a){return a instanceof f||(a=new f(a,this.loose)),this.compareMain(a)||this.comparePre(a)},f.prototype.compareMain=function(a){return a instanceof f||(a=new f(a,this.loose)),h(this.major,a.major)||h(this.minor,a.minor)||h(this.patch,a.patch)},f.prototype.comparePre=function(a){if(a instanceof f||(a=new f(a,this.loose)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.length&&!a.prerelease.length)return 0;var b=0;do{var c=this.prerelease[b],d=a.prerelease[b];if(void 0===c&&void 0===d)return 0;if(void 0===d)return 1;if(void 0===c)return-1;if(c!==d)return h(c,d)}while(++b)},f.prototype.inc=function(a,b){switch(a){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",b);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",b);break;case"prepatch":this.prerelease.length=0,this.inc("patch",b),this.inc("pre",b);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",b),this.inc("pre",b);break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var c=this.prerelease.length;--c>=0;)"number"==typeof this.prerelease[c]&&(this.prerelease[c]++,c=-2);-1===c&&this.prerelease.push(0)}b&&(this.prerelease[0]===b?isNaN(this.prerelease[1])&&(this.prerelease=[b,0]):this.prerelease=[b,0]);break;default:throw new Error("invalid increment argument: "+a)}return this.format(),this},a.inc=g,a.compareIdentifiers=h;var Eb=/^[0-9]+$/;a.rcompareIdentifiers=i,a.compare=j,a.compareLoose=k,a.rcompare=l,a.sort=m,a.rsort=n,a.gt=o,a.lt=p,a.eq=q,a.neq=r,a.gte=s,a.lte=t,a.cmp=u,a.Comparator=v;var Fb={};v.prototype.parse=function(a){var b=this.loose?P[wb]:P[xb],c=a.match(b);if(!c)throw new TypeError("Invalid comparator: "+a);this.operator=c[1],"="===this.operator&&(this.operator=""),this.semver=c[2]?new f(c[2],this.loose):Fb},v.prototype.inspect=function(){return''},v.prototype.toString=function(){return this.value},v.prototype.test=function(a){return this.semver===Fb?!0:("string"==typeof a&&(a=new f(a,this.loose)),u(a,this.operator,this.semver,this.loose))},a.Range=w,w.prototype.inspect=function(){return''},w.prototype.format=function(){return this.range=this.set.map(function(a){return a.join(" ").trim()}).join("||").trim(),this.range},w.prototype.toString=function(){return this.range},w.prototype.parseRange=function(a){var b=this.loose;a=a.trim();var c=b?P[Bb]:P[Ab];a=a.replace(c,H),a=a.replace(P[yb],zb),a=a.replace(P[nb],ob),a=a.replace(P[sb],tb),a=a.split(/\s+/).join(" ");var d=b?P[wb]:P[xb],e=a.split(" ").map(function(a){return y(a,b)}).join(" ").split(/\s+/);return this.loose&&(e=e.filter(function(a){return!!a.match(d)})),e=e.map(function(a){return new v(a,b)})},a.toComparators=x,w.prototype.test=function(a){if(!a)return!1;"string"==typeof a&&(a=new f(a,this.loose));for(var b=0;bd;){var f=d+e>>>1;c(a[f],b)>0?d=f+1:e=f}return d}"function"==typeof define&&define.amd?define("sortedindex-compare",[],function(){return d}):"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=d),c.sortedIndex=d):a.sortedIndex=d}(this)},{}],16:[function(a,b){function c(){}function d(a){var b={}.toString.call(a);switch(b){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function e(){if(q.XMLHttpRequest&&("file:"!=q.location.protocol||!q.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 f(a){return a===Object(a)}function g(a){if(!f(a))return a;var b=[];for(var c in a)null!=a[c]&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")}function h(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 i(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=r(c.slice(b+1)),g[d]=e;return g}function j(a){return a.split(/ *; */).shift()}function k(a){return p(a.split(/ *; */),function(a,b){var c=b.split(/ *= */),d=c.shift(),e=c.shift();return d&&e&&(a[d]=e),a},{})}function l(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=i(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 m(a,b){var c=this;o.call(this),this._query=this._query||[],this.method=a,this.url=b,this.header={},this._header={},this.on("end",function(){try{var b=new l(c);"HEAD"==a&&(b.text=null),c.callback(null,b)}catch(d){var e=new Error("Parser is unable to parse the response");e.parse=!0,e.original=d,c.callback(e)}})}function n(a,b){return"function"==typeof b?new m("GET",a).end(b):1==arguments.length?new m("GET",a):new m(a,b)}var o=a("emitter"),p=a("reduce"),q="undefined"==typeof window?this:window,r="".trim?function(a){return a.trim()}:function(a){return a.replace(/(^\s*|\s*$)/g,"")};n.serializeObject=g,n.parseString=h,n.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"},n.serialize={"application/x-www-form-urlencoded":g,"application/json":JSON.stringify},n.parse={"application/x-www-form-urlencoded":h,"application/json":JSON.parse},l.prototype.get=function(a){return this.header[a.toLowerCase()]},l.prototype.setHeaderProperties=function(){var a=this.header["content-type"]||"";this.type=j(a);var b=k(a);for(var c in b)this[c]=b[c]},l.prototype.parseBody=function(a){var b=n.parse[this.type];return b&&a&&a.length?b(a):null},l.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},l.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},n.Response=l,o(m.prototype),m.prototype.use=function(a){return a(this),this},m.prototype.timeout=function(a){return this._timeout=a,this},m.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},m.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},m.prototype.set=function(a,b){if(f(a)){for(var c in a)this.set(c,a[c]);return this}return this._header[a.toLowerCase()]=b,this.header[a]=b,this},m.prototype.unset=function(a){return delete this._header[a.toLowerCase()],delete this.header[a],this},m.prototype.getHeader=function(a){return this._header[a.toLowerCase()]},m.prototype.type=function(a){return this.set("Content-Type",n.types[a]||a),this},m.prototype.accept=function(a){return this.set("Accept",n.types[a]||a),this},m.prototype.auth=function(a,b){var c=btoa(a+":"+b);return this.set("Authorization","Basic "+c),this},m.prototype.query=function(a){return"string"!=typeof a&&(a=g(a)),a&&this._query.push(a),this},m.prototype.field=function(a,b){return this._formData||(this._formData=new FormData),this._formData.append(a,b),this},m.prototype.attach=function(a,b,c){return this._formData||(this._formData=new FormData),this._formData.append(a,b,c),this},m.prototype.send=function(a){var b=f(a),c=this.getHeader("Content-Type");if(b&&f(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},m.prototype.callback=function(a,b){var c=this._callback;return 2==c.length?c(a,b):a?this.emit("error",a):void c(b)},m.prototype.crossDomainError=function(){var a=new Error("Origin is not allowed by Access-Control-Allow-Origin");a.crossDomain=!0,this.callback(a)},m.prototype.timeoutError=function(){var a=this._timeout,b=new Error("timeout of "+a+"ms exceeded");b.timeout=a,this.callback(b)},m.prototype.withCredentials=function(){return this._withCredentials=!0,this},m.prototype.end=function(a){var b=this,f=this.xhr=e(),g=this._query.join("&"),h=this._timeout,i=this._formData||this._data;if(this._callback=a||c,f.onreadystatechange=function(){return 4==f.readyState?0==f.status?b.aborted?b.timeoutError():b.crossDomainError():void b.emit("end"):void 0},f.upload&&(f.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=n.serializeObject(g),this.url+=~this.url.indexOf("?")?"&"+g:"?"+g),f.open(this.method,this.url,!0),this._withCredentials&&(f.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof i&&!d(i)){var j=n.serialize[this.getHeader("Content-Type")];j&&(i=j(i))}for(var k in this.header)null!=this.header[k]&&f.setRequestHeader(k,this.header[k]);return this.emit("request",this),f.send(i),this},n.Request=m,n.get=function(a,b,c){var d=n("GET",a);return"function"==typeof b&&(c=b,b=null),b&&d.query(b),c&&d.end(c),d},n.head=function(a,b,c){var d=n("HEAD",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},n.del=function(a,b){var c=n("DELETE",a);return b&&c.end(b),c},n.patch=function(a,b,c){var d=n("PATCH",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},n.post=function(a,b,c){var d=n("POST",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},n.put=function(a,b,c){var d=n("PUT",a);return"function"==typeof b&&(c=b,b=null),b&&d.send(b),c&&d.end(c),d},b.exports=n},{emitter:17,reduce:18}],17:[function(a,b){function c(a){return a?d(a):void 0}function d(a){for(var b in c.prototype)a[b]=c.prototype[b];return a}b.exports=c,c.prototype.on=c.prototype.addEventListener=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks[a]=this._callbacks[a]||[]).push(b),this},c.prototype.once=function(a,b){function c(){d.off(a,c),b.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},c.fn=b,this.on(a,c),this},c.prototype.off=c.prototype.removeListener=c.prototype.removeAllListeners=c.prototype.removeEventListener=function(a,b){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var c=this._callbacks[a];if(!c)return this;if(1==arguments.length)return delete this._callbacks[a],this;for(var d,e=0;ed;++d)c[d].apply(this,b)}return this},c.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},c.prototype.hasListeners=function(a){return!!this.listeners(a).length}},{}],18:[function(a,b){b.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}},{}],19:[function(a){var b,c,d,e;d=a("ractive"),a("ractive-transitions-fade"),a("ractive-ractive"),a("./models/projects.coffee"),b=a("./views/header.coffee"),c=a("./views/notify.coffee"),e=a("./modules/router.coffee"),new d({template:a("./templates/app.html"),el:"body",components:{Header:b,Notify:c},onrender:function(){return e.init("/")}})},{"./models/projects.coffee":22,"./modules/router.coffee":31,"./templates/app.html":33,"./views/header.coffee":51,"./views/notify.coffee":54,ractive:13,"ractive-ractive":11,"ractive-transitions-fade":12}],20:[function(a,b){var c;c=a("../utils/ractive/model.coffee"),b.exports=new c({name:"models/config",data:{firebase:"burnchart",provider:"github",fields:{milestone:["closed_issues","created_at","description","due_on","number","open_issues","title","updated_at"]},chart:{off_days:[],datetime:/^(\d{4}-\d{2}-\d{2})T(.*)/,size_label:/^size (\d+)$/,location:/^#!((\/[^\/]+){2,3})$/,points:"ONE_SIZE"}}})},{"../utils/ractive/model.coffee":49}],21:[function(a,b){var c,d,e,f;c=a("firebase"),d=a("../utils/ractive/model.coffee"),f=a("./user.coffee"),e=a("./config.coffee"),b.exports=new d({name:"models/firebase",login:function(a){return this.data.client||a("Not ready yet"),this.data.client.authWithOAuthPopup("github",function(a){return function(b,c){return b?a.publish("!app/notify",{text:b.toString(),type:"alert",system:!0}):a.onAuth(c)}}(this),{rememberMe:!0,scope:"private_repo"})},onAuth:function(a){return f.set(a),f.set("ready",!0)},logout:function(){throw"Implement"},onrender:function(){var a;return this.set("client",a=new c("https://"+e.data.firebase+".firebaseio.com")),a.onAuth(this.onAuth)}})},{"../utils/ractive/model.coffee":49,"./config.coffee":20,"./user.coffee":24,firebase:6}],22:[function(a,b){var c,d,e,f,g,h,i,j,k=[].slice;j=a("lodash"),e=a("lscache"),g=a("sortedindex-compare"),f=a("semver"),c=a("../utils/ractive/model.coffee"),d=a("../models/config.coffee"),h=a("../modules/stats.coffee"),i=a("./user.coffee"),b.exports=new c({name:"models/projects",data:{sortBy:"priority",sortFns:["progress","priority","name"]},comparator:function(){var a,b,c,d,e;switch(e=this.data,c=e.list,d=e.sortBy,a=function(a){return function(b){return function(){var d,e,f,g;return g=arguments[0],f=2<=arguments.length?k.call(arguments,1):[],d=g[0],e=g[1],b.apply(a,[[c[d],c[d].milestones[e]]].concat(f))}}}(this),b=function(a,b){var c,d,e,f,g,h,i,j,k,l;for(l=[],j=0,k=a.length;k>j;j++)d=a[j],l.push(function(){var a;a=[];for(e in b)i=b[e],h=d,a.push(function(){var a,b,d,j;for(d=f=e.split("."),j=[],c=a=0,b=d.length;b>a;c=++a)g=d[c],j.push(c===f.length-1?null!=h[g]?h[g]:h[g]=i:h=null!=h[g]?h[g]:h[g]={});return j}());return a}());return l},d){case"progress":return a(function(a,c){var d,e,f,g;return e=a[0],d=a[1],g=c[0],f=c[1],b([d,f],{"stats.progress.points":0}),d.stats.progress.points-f.stats.progress.points});case"priority":return a(function(a,c){var d,e,f,g,h,i,k;return g=a[0],f=a[1],i=c[0],h=c[1],b([f,h],{"stats.progress.time":0,"stats.days":1e3}),k=j.map([f,h],function(a){var b;return b=a.stats,(b.progress.points-b.progress.time)*b.days}),d=k[0],e=k[1],e-d});case"name":return a(function(a,b){var c,d,e,g,h,i;return d=a[0],c=a[1],g=b[0],e=b[1],(i=g.owner.localeCompare(d.owner))?i:(h=g.name.localeCompare(d.name))?h:f.valid(e.title)&&f.valid(c.title)?f.gt(e.title,c.title):e.title.localeCompare(c.title)});default:return function(){return 0}}},find:function(a){return j.find(this.data.list,a)},exists:function(){return!!this.find.apply(this,arguments)},add:function(a){return this.exists(a)?void 0:this.push("list",a)},findIndex:function(a){var b,c;return c=a.owner,b=a.name,j.findIndex(this.data.list,{owner:c,name:b})},addMilestone:function(a,b){var c,d;if(j.extend(b,{stats:h(b)}),(c=this.findIndex(a))<0)throw 500;return null!=a.milestones?(this.push("list."+c+".milestones",b),d=this.data.list[c].milestones.length-1):(this.set("list."+c+".milestones",[b]),d=0),this.sort([c,d],[a,b])},saveError:function(a,b){var c;if((c=this.findIndex(a))>-1)return null!=a.errors?this.push("list."+c+".errors",b):this.set("list."+c+".errors",[b]);throw 500},demo:function(){return this.set({list:[{owner:"mbostock",name:"d3"},{owner:"medic",name:"medic-webapp"},{owner:"ractivejs",name:"ractive"},{owner:"radekstepan",name:"disposable"},{owner:"rails",name:"rails"},{owner:"rails",name:"spring"}],index:[]})},clear:function(){return this.set({list:[],index:[]})},sort:function(a,b){var c,d,e,f,h,i,j,k,l,m,n,o;if(e=this.data.index||[],a)d=g(e,b,this.comparator()),e.splice(d,0,a);else for(n=this.data.list,c=j=0,l=n.length;l>j;c=++j)if(i=n[c],null!=i.milestones)for(o=i.milestones,f=k=0,m=o.length;m>k;f=++k)h=o[f],d=g(e,[i,h],this.comparator()),e.splice(d,0,[c,f]);return this.set("index",e)},onconstruct:function(){return this.subscribe("!projects/add",this.add,this),this.subscribe("!projects/demo",this.demo,this)},onrender:function(){return this.set("list",e.get("projects")||[]),this.observe("list",function(a){return e.set("projects",j.pluckMany(a,["owner","name"]))},{init:!1}),this.observe("sortBy",function(){return this.set("index",null),this.sort()},{init:!1})}})},{"../models/config.coffee":20,"../modules/stats.coffee":32,"../utils/ractive/model.coffee":49,"./user.coffee":24,lodash:7,lscache:8,semver:14,"sortedindex-compare":15}],23:[function(a,b){var c,d,e,f;c=a("../utils/ractive/model.coffee"),f=new c({name:"models/system",data:{loading:!1}}),e=0,d=function(){return e+=1,f.set("loading",!0),function(){return e-=1,f.set("loading",+e)}},b.exports={system:f,async:d}},{"../utils/ractive/model.coffee":49}],24:[function(a,b){var c;c=a("../utils/ractive/model.coffee"),b.exports=new c({name:"models/user"})},{"../utils/ractive/model.coffee":49}],25:[function(a,b){var c;c=a("d3"),b.exports={horizontal:function(a,b){return c.svg.axis().scale(b).orient("bottom").tickSize(-a).tickFormat(function(a){return a.getDate()}).tickPadding(10)},vertical:function(a,b){return c.svg.axis().scale(b).orient("left").tickSize(-a).ticks(5).tickPadding(10)}}},{d3:4}],26:[function(a,b){var c,d,e,f=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};e=a("lodash"),d=a("d3"),c=a("../../models/config.coffee"),b.exports={actual:function(a,b,c){var f,g,h,i,j;return f=[{date:new Date(b),points:c}],h=+1/0,g=-1/0,j=e.map(a,function(a){var b,d;return d=a.size,b=a.closed_at,h>d&&(h=d),d>g&&(g=d),a.date=new Date(b),a.points=c-=d,a}),i=d.scale.linear().domain([h,g]).range([5,8]),j=e.map(j,function(a){return a.radius=i(a.size),a}),[].concat(f,j)},ideal:function(a,b,d){var g,h,i,j,k,l,m,n,o,p,q;return a>b&&(p=[a,b],b=p[0],a=p[1]),q=e.map(a.match(c.data.chart.datetime)[1].split("-"),function(a){return parseInt(a)}),o=q[0],k=q[1],h=q[2],g=new Date(b),i=[],j=0,(m=function(a){var b,d;return b=new Date(o,k-1,h+a),(d=b.getDay())||(d=7),f.call(c.data.chart.off_days,d)>=0?i.push({date:b,off_day:!0}):(j+=1,i.push({date:b})),b>g?void 0:m(a+1)})(0),n=d/(j-1),i=e.map(i,function(a,b){return a.points=d,i[b]&&!i[b].off_day&&(d-=n),a}),(l=new Date)>g&&i.push({date:l,points:0}),i},trend:function(a,b,c){var d,f,g,h,i,j,k,l,m,n,o,p,q;return a.length?(p=+a[0].date,q=e.map(a,function(a){var b,c;return b=a.date,c=a.points,[+b-p,c]}),m=a[a.length-1],q.push([+new Date-p,m.points]),g=0,i=0,h=0,d=(l=q.length)*e.reduce(q,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),o=(d-g*i)/(l*h-Math.pow(g,2)),k=(i-o*g)/l,j=function(a){return o*a+k},b=new Date(b),n=new Date,c?(c=new Date(c),n>c&&(c=n)):c=n,d=b-p,f=c-p,[{date:b,points:j(d)},{date:c,points:j(f)}]):[]}}},{"../../models/config.coffee":20,d3:4,lodash:7}],27:[function(a,b){var c,d,e,f,g,h;h=a("lodash"),c=a("async"),e=a("../../models/config.coffee"),g=a("./request.coffee"),b.exports={fetchAll:function(a,b){return c.parallel([h.partial(c.waterfall,[h.partial(f,a,"open"),d]),h.partial(c.waterfall,[h.partial(f,a,"closed"),d])],function(a,c){var d,e;return e=c[0],d=c[1],b(a,{open:e,closed:d})})}},d=function(a,b){var c,d,f,g;switch(e.data.chart.points){case"ONE_SIZE":for(d=a.length,f=0,g=a.length;g>f;f++)c=a[f],c.size=1;return b(null,{list:a,size:d});case"LABELS":return d=0,a=h.filter(a,function(a){var b;return(b=a.labels)?(a.size=h.reduce(b,function(a,b){var c;return(c=b.name.match(e.data.chart.size_label))?a+=parseInt(c[1]):a},0),d+=a.size,!!a.size):!1}),b(null,{list:a,size:d})}},f=function(a,b,c){var d,e;return e=[],(d=function(f){return g.allIssues(a,{state:b,page:f},function(a,b){return a?c(a):b.length?(e=e.concat(h.sortBy(b,"closed_at")),b.length<100?c(null,e):d(f+1)):c(null,e)})})(1)}},{"../../models/config.coffee":20,"./request.coffee":29,async:1,lodash:7}],28:[function(a,b){var c;c=a("./request.coffee"),b.exports={fetch:c.oneMilestone,fetchAll:c.allMilestones}},{"./request.coffee":29}],29:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n;n=a("lodash"),l=a("superagent"),a("../../utils/mixins.coffee"),m=a("../../models/user.coffee"),l.parse={"application/json":function(a){var b;try{return JSON.parse(a)}catch(c){return b=c,{}}}},c={github:{host:"api.github.com",protocol:"https"}},b.exports={repo:function(a,b){var d,f;return f=a.owner,d=a.name,g({owner:f,name:d})?h(function(){var a;return a=n.defaults({path:"/repos/"+f+"/"+d,headers:e(m.data.accessToken)},c.github),i(a,b)}):b("Request is malformed")},allMilestones:function(a,b){var d,f;return f=a.owner,d=a.name,g({owner:f,name:d})?h(function(){var a;return a=n.defaults({path:"/repos/"+f+"/"+d+"/milestones",query:{state:"open",sort:"due_date",direction:"asc"},headers:e(m.data.accessToken)},c.github),i(a,b)}):b("Request is malformed")},oneMilestone:function(a,b){var d,f,j;return j=a.owner,f=a.name,d=a.milestone,g({owner:j,name:f,milestone:d})?h(function(){var a;return a=n.defaults({path:"/repos/"+j+"/"+f+"/milestones/"+d,query:{state:"open",sort:"due_date",direction:"asc"},headers:e(m.data.accessToken)},c.github),i(a,b)}):b("Request is malformed")},allIssues:function(a,b,d){var f,j,k;return k=a.owner,j=a.name,f=a.milestone,g({owner:k,name:j,milestone:f})?h(function(){var a;return a=n.defaults({path:"/repos/"+k+"/"+j+"/issues",query:n.extend(b,{milestone:f,per_page:"100"}),headers:e(m.data.accessToken)},c.github),i(a,d)}):d("Request is malformed")}},i=function(a,b){var c,d,e,f,g,h,i,k,m,n,o;h=a.protocol,e=a.host,g=a.path,k=a.query,d=a.headers,c=!1,i=k?"?"+function(){var a;a=[];for(f in k)o=k[f],a.push(""+f+"="+o);return a}().join("&"):"",m=l.get(""+h+"://"+e+g+i);for(f in d)o=d[f],m.set(f,o);return n=setTimeout(function(){return c=!0,b("Request has timed out")},5e3),m.end(function(a,d){return c?void 0:(c=!0,clearTimeout(n),j(a,d,b))})},j=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={"Content-Type":"application/json",Accept:"application/vnd.github.v3"},null!=a&&(b.Authorization="token "+a),b},g=function(a){var b,c,d;c={owner:function(a){return null!=a},name:function(a){return null!=a},milestone:function(a){return n.isInt(a)}};for(b in a)if(d=a[b],b in c&&!c[b](d))return!1;return!0},f=m.data.ready,k=[],h=function(a){return f?a():k.push(a)},m.observe("ready",function(a){var b;if(f=a,a){for(b=[];k.length;)b.push(k.shift()());return b}}),d=function(a){var b;switch(!1){case!n.isString(a):b=a;break;case!n.isArray(a):b=a[1];break;case!(n.isObject(a)&&n.isString(a.message)):b=a.message}if(!b)try{b=JSON.stringify(a)}catch(c){b=a.toString()}return b}},{"../../models/user.coffee":24,"../../utils/mixins.coffee":47,lodash:7,superagent:16}],30:[function(a,b){var c,d;d=a("ractive"),c=d.extend({}),b.exports=new c},{ractive:13}],31:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=[].slice;m=a("lodash"),e=a("director"),g=a("./mediator.coffee"),k=a("../models/system.coffee"),f="#page",h={index:a("../views/pages/index.coffee"),milestone:a("../views/pages/milestone.coffee"),"new":a("../views/pages/new.coffee"),project:a("../views/pages/project.coffee")},c=function(a,b,c){return g.fire("!projects/add",{owner:b,name:c})},d=function(a,b){var c,d,e,f;for(null==b&&(b=[]),f=[],d=0,e=b.length;e>d;d++)c=b[d],f.push(m.partial(c,a));return f},l=null,i=function(){var a,b,c;return c=arguments[0],b=2<=arguments.length?n.call(arguments,1):[],null!=l&&l.teardown(),g.fire("!app/notify/hide"),a=h[c],l=new a({el:f,data:{route:b}})},j={"/":d("index",[i]),"/new/project":d("new",[i]),"/:owner/:name":d("project",[c,i]),"/:owner/:name/:milestone":d("milestone",[c,i]),"/demo":function(){return g.fire("!projects/demo"),window.location.hash="#"}},b.exports=e.Router(j).configure({strict:!1,notfound:function(){throw 404}})},{"../models/system.coffee":23,"../views/pages/index.coffee":55,"../views/pages/milestone.coffee":56,"../views/pages/new.coffee":57,"../views/pages/project.coffee":58,"./mediator.coffee":30,director:5,lodash:7}],32:[function(a,b){var c,d;c=a("moment"),d=function(a,b){return a+b===0?0:100*(a/(b+a))},b.exports=function(a){var b,e,f,g,h,i,j,k,l,m;return h=!1,j=!0,k=!1,i=!0,l=0,b=a.issues.closed.size,e=a.issues.open.size,b+e>0&&(i=!1,l=d(b,e),100===l&&(h=!0)),a.due_on?(b=+new Date(a.created_at),e=+new Date,f=+new Date(a.due_on),e>f&&(k=!0),m=d(e-b,f-e),g=c(e).diff(c(b),"days")/100,j=l>m,{isDone:h,days:g,isOnTime:j,isOverdue:k,progress:{points:l,time:m}}):{isOverdue:k,isOnTime:j,isDone:h,isEmpty:i,progress:{points:l}}}},{moment:10}],33:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"app"},f:[{t:7,e:"Notify"}," ",{t:7,e:"Header"}," ",{t:7,e:"div",a:{id:"page"},f:[]}," ",{t:7,e:"div",a:{id:"footer"},f:[{t:7,e:"div",a:{"class":"wrap"},f:["© 2012-2014 ",{t:7,e:"a",a:{href:"http://cloudfi.re"},f:["Cloudfire Systems"]}]}]}]}]}},{}],34:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"chart"}}]}},{}],35:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"head"},f:[{t:4,n:53,r:"user",f:[{t:4,r:"ready",f:[{t:7,e:"div",a:{"class":"right"},t1:"fade",f:[{t:4,r:"uid",f:[{t:2,r:"github.displayName"}," logged in"]},{t:4,n:51,f:[{t:7,e:"a",a:{"class":"github"},v:{click:"!login"},f:[{t:7,e:"Icons",a:{icon:"github"}}," Sign In"]}],r:"uid"}]}]}]}," ",{t:7,e:"a",a:{id:"icon",href:"#"},f:[{t:7,e:"Icons",a:{icon:[{t:2,r:"icon"}]}}]}," ",{t:7,e:"ul",f:[{t:7,e:"li",f:[{t:7,e:"a",a:{href:"#new/project","class":"add"},f:[{t:7,e:"Icons",a:{icon:"plus-circled"}}," Add a Project"]}]}," ",{t:7,e:"li",f:[{t:7,e:"a",a:{href:"#demo"},f:[{t:7,e:"Icons",a:{icon:"download-cloud"}}," Demo Projects"]}]}]}]}]}},{}],36:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"hero"},f:[{t:7,e:"div",a:{"class":"content"},f:[{t:7,e:"Icons",a:{icon:"address"}}," ",{t:7,e:"h2",f:["See your project progress"]}," ",{t:7,e:"p",f:["Not sure where to start? Just add a demo repo to see a chart. There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable."]}," ",{t:7,e:"div",a:{"class":"cta"},f:[{t:7,e:"a",a:{href:"#new/project","class":"primary"},f:[{t:7,e:"Icons",a:{icon:"plus-circled"}}," Add your project"]}," ",{t:7,e:"a",a:{href:"#","class":"secondary"},f:["Read the Guide"]}]}]}]}]}},{}],37:[function(a,b){b.exports={v:1,t:[{t:4,r:"code",f:[{t:7,e:"span",a:{"class":["icon ",{t:2,r:"icon"}]},f:[{t:3,x:{r:["code"],s:'"&#"+_0+";"'}}]}]}]}},{}],38:[function(a,b){b.exports={v:1,t:[{t:4,r:"text",f:[{t:4,r:"system",f:[{t:7,e:"div",a:{id:"notify","class":[{t:2,r:"type"}," system"],style:["top:",{t:2,r:"top"},"%"]},f:[{t:7,e:"Icons",a:{icon:[{t:2,r:"icon"}]}}," ",{t:7,e:"p",f:[{t:2,r:"text"}]}]}]},{t:4,n:51,f:[{t:7,e:"div",a:{id:"notify","class":[{t:2,r:"type"}],style:["top:",{t:2,x:{r:["top"],s:"-_0"}},"px"]},f:[{t:7,e:"span",a:{"class":"close"},v:{click:"close"}}," ",{t:7,e:"Icons",a:{icon:[{t:2,r:"icon"}]}}," ",{t:7,e:"p",f:[{t:2,r:"text"}]}]}],r:"system"}]}]}},{}],39:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:4,n:50,r:"projects.list",f:[{t:4,r:"ready",f:[{t:7,e:"div",t1:"fade",f:[{t:7,e:"Projects",a:{projects:[{t:2,r:"projects"}]}}]}]}]},{t:4,n:51,f:[{t:7,e:"Hero"}],r:"projects.list"}]}]}},{}],40:[function(a,b){b.exports={v:1,t:[{t:4,r:"ready",f:[{t:7,e:"div",t1:"fade",f:[{t:7,e:"div",a:{id:"title"},f:[{t:7,e:"div",a:{"class":"wrap"},f:[{t:7,e:"h2",a:{"class":"title"},f:[{t:2,x:{r:["format","milestone.title"],s:"_0.title(_1)"}}]}," ",{t:7,e:"span",a:{"class":"sub"},f:[{t:3,x:{r:["format","milestone.due_on"],s:"_0.due(_1)"}}]}," ",{t:7,e:"div",a:{"class":"description"},f:[{t:3,x:{r:["format","milestone.description"],s:"_0.markdown(_1)"}}]}]}]}," ",{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:7,e:"Chart",a:{milestone:[{t:2,r:"milestone"}]}}]}]}]}]}},{}],41:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:7,e:"div",a:{id:"add"},f:[{t:7,e:"div",a:{"class":"header"},f:[{t:7,e:"h2",f:["Add a Project"]}," ",{t:7,e:"p",f:["Type in the name of the repository as you would normally. ",{t:4,n:53,r:"user",f:[{t:4,r:"ready",f:[{t:4,r:"uid",f:["If you'd like to add a private GitHub project, ",{t:7,e:"a",v:{click:"!login"},f:["Sign In"]}," first."],n:51}]}]}]}]}," ",{t:7,e:"div",a:{"class":"form"},f:[{t:7,e:"table",f:[{t:7,e:"tr",f:[{t:7,e:"td",f:[{t:7,e:"input",a:{type:"text",placeholder:"user/repo",autocomplete:"off",value:[{t:2,r:"value"}]},v:{keyup:{n:"submit",d:[{t:2,r:"value"}]}}}]}," ",{t:7,e:"td",f:[{t:7,e:"a",v:{click:{n:"submit",d:[{t:2,r:"value"}]}},f:["Add"]}]}]}]}]}]}]}]}},{}],42:[function(a,b){b.exports={v:1,t:[{t:4,r:"ready",f:[{t:7,e:"div",t1:"fade",f:[{t:7,e:"div",a:{id:"title"},f:[{t:7,e:"div",a:{"class":"wrap"},f:[{t:7,e:"h2",a:{"class":"title"},f:[{t:2,x:{r:["route"],s:'_0.join("/")'}}]}]}]}," ",{t:7,e:"div",a:{id:"content","class":"wrap"},f:[{t:7,e:"Milestones",a:{project:[{t:2,r:"project"}]}}]}]}]}]}},{}],43:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"projects"},f:[{t:7,e:"div",a:{"class":"header"},f:[{t:7,e:"a",a:{"class":"sort"},v:{click:"sortBy"},f:[{t:7,e:"Icons",a:{icon:"sort-alphabet"}}," Sorted by ",{t:2,r:"projects.sortBy"}]}," ",{t:7,e:"h2",f:["Milestones"]}]}," ",{t:7,e:"table",f:[{t:4,r:"projects.index",f:[{t:4,x:{r:["."],s:"{index:_0}"},f:[{t:4,x:{r:["index.0","projects.list"],s:"{p:_1[_0]}"},f:[{t:4,n:50,x:{r:["p.owner","project.owner","p.name","project.name"],s:"_0==_1&&_2==_3"},f:[{t:4,x:{r:["index.1","project.milestones"],s:"{milestone:_1[_0]}"},f:[{t:7,e:"tr",a:{"class":[{t:4,n:50,r:"milestone.stats.isDone",f:["done"]}]},f:[{t:7,e:"td",f:[{t:7,e:"a",a:{"class":"milestone",href:["#",{t:2,r:"project.owner"},"/",{t:2,r:"project.name"},"/",{t:2,r:"milestone.number"}]},f:[{t:2,r:"milestone.title"}]}]}," ",{t:7,e:"td",a:{style:"width:1%"},f:[{t:7,e:"div",a:{"class":"progress"},f:[{t:7,e:"span",a:{"class":"percent"},f:[{t:2,x:{r:["milestone.stats.progress.points"],s:"Math.floor(_0)"}},"%"]}," ",{t:7,e:"span",a:{"class":["due ",{t:4,n:50,r:"milestone.stats.isOverdue",f:["red"]}]},f:[{t:3,x:{r:["format","milestone.due_on"],s:"_0.due(_1)"}}]}," ",{t:7,e:"div",a:{"class":"outer bar"},f:[{t:7,e:"div",a:{"class":["inner bar ",{t:2,x:{r:["milestone.stats.isOnTime"],s:'(_0)?"green":"red"'}}],style:["width:",{t:2,r:"milestone.stats.progress.points"},"%"]}}]}]}]}]}]}]}]}]}]}]}," ",{t:7,e:"div",a:{"class":"footer"},f:[]}]}]}},{}],44:[function(a,b){b.exports={v:1,t:[{t:7,e:"div",a:{id:"projects"},f:[{t:7,e:"div",a:{"class":"header"},f:[{t:7,e:"a",a:{"class":"sort"},v:{click:"sortBy"},f:[{t:7,e:"Icons",a:{icon:"sort-alphabet"}}," Sorted by ",{t:2,r:"projects.sortBy"}]}," ",{t:7,e:"h2",f:["Projects"]}]}," ",{t:7,e:"table",f:[{t:4,r:"projects.list",f:[{t:4,n:50,r:"errors",f:[{t:7,e:"tr",f:[{t:7,e:"td",a:{colspan:"3","class":"repo"},f:[{t:7,e:"div",a:{"class":"project"},f:[{t:2,r:"owner"},"/",{t:2,r:"name"}," ",{t:7,e:"span",a:{"class":"error",title:[{t:2,x:{r:["errors"],s:'_0.join("\\n")'}}]},f:[{t:7,e:"Icons",a:{icon:"attention"}}]}]}]}]}]}]}," ",{t:4,r:"projects.index",f:[{t:4,x:{r:["."],s:"{index:_0}"},f:[{t:4,x:{r:["index.0","projects.list"],s:"{project:_1[_0]}"},f:[{t:4,n:53,r:"project",f:[{t:4,x:{r:["index.1","project.milestones"],s:"{milestone:_1[_0]}"},f:[{t:7,e:"tr",a:{"class":[{t:4,n:50,r:"milestone.stats.isDone",f:["done"]}]},f:[{t:7,e:"td",a:{"class":"repo"},f:[{t:7,e:"a",a:{"class":"project",href:["#",{t:2,r:"owner"},"/",{t:2,r:"name"}]},f:[{t:2,r:"owner"},"/",{t:2,r:"name"}]}]}," ",{t:7,e:"td",f:[{t:7,e:"a",a:{"class":"milestone",href:["#",{t:2,r:"owner"},"/",{t:2,r:"name"},"/",{t:2,r:"milestone.number"}]},f:[{t:2,r:"milestone.title"}]}]}," ",{t:7,e:"td",a:{style:"width:1%"},f:[{t:7,e:"div",a:{"class":"progress"},f:[{t:7,e:"span",a:{"class":"percent"},f:[{t:2,x:{r:["milestone.stats.progress.points"],s:"Math.floor(_0)"}},"%"]}," ",{t:7,e:"span",a:{"class":["due ",{t:4,n:50,r:"milestone.stats.isOverdue",f:["red"]}]},f:[{t:3,x:{r:["format","milestone.due_on"],s:"_0.due(_1)"}}]}," ",{t:7,e:"div",a:{"class":"outer bar"},f:[{t:7,e:"div",a:{"class":["inner bar ",{t:2,x:{r:["milestone.stats.isOnTime"],s:'(_0)?"green":"red"'}}],style:["width:",{t:2,r:"milestone.stats.progress.points"},"%"]}}]}]}]}]}]}]}]}]}]}]}," ",{t:7,e:"div",a:{"class":"footer"},f:[]}]}]}},{}],45:[function(a,b){var c,d,e;e=a("lodash"),d=a("moment"),c=a("marked"),b.exports={fromNow:e.memoize(function(a){return d(new Date(a)).fromNow()}),due:function(a){return a?["due",this.fromNow(a)].join(" "):" "},markdown:function(a){return c(a)},title:function(a){return a.toLowerCase().indexOf("milestone")>-1?a:["Milestone",a].join(" ")},hexToDec:function(a){return parseInt(a,16)}}},{lodash:7,marked:9,moment:10}],46:[function(a,b){b.exports={is:function(a){var b;return"keyup"===(b=a.original.type)||"keydown"===b},isEnter:function(a){return 13===a.original.which}}},{}],47:[function(a){var b;b=a("lodash"),b.mixin({pluckMany:function(a,c){if(!b.isArray(c))throw"`keys` needs to be an Array";return b.map(a,function(a){var d;return d={},b.each(c,function(b){return d[b]=a[b]}),d})},isInt:function(a){return!isNaN(a)&&parseInt(Number(a))===a&&!isNaN(parseInt(a,10))}})},{lodash:7}],48:[function(a,b){var c,d,e;e=a("lodash"),c=a("ractive"),d=a("../../modules/mediator.coffee"),b.exports=c.extend({subscribe:function(a,b,c){return null==c&&(c=this),e.isArray(this._subs)||(this._subs=[]),e.isFunction(b)?this._subs.push(d.on(a,e.bind(b,c))):console.log("Warning: `cb` is not a function")},publish:function(){return d.fire.apply(d,arguments)},onteardown:function(){var a,b,c,d,f;if(e.isArray(this._subs)){for(d=this._subs,f=[],b=0,c=d.length;c>b;b++)a=d[b],f.push(e.isFunction(a.cancel)?a.cancel():console.log("Warning: `sub.cancel` is not a function"));return f}}})},{"../../modules/mediator.coffee":30,lodash:7,ractive:13}],49:[function(a,b){var c;c=a("./eventful.coffee"),b.exports=function(a){var b,d;return b=c.extend(a),d=new b,d.render(),d}},{"./eventful.coffee":48}],50:[function(a,b){var c,d,e,f;c=a("ractive"),e=a("d3"),a("d3-tip")(e),f=a("../modules/chart/lines.coffee"),d=a("../modules/chart/axes.coffee"),b.exports=c.extend({name:"views/chart",template:a("../templates/chart.html"),oncomplete:function(){var a,b,c,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;return m=this.data.milestone,h=m.issues,p=h.open.size+h.closed.size,b=h.closed.list[0].closed_at,h.length&&m.created_at>b&&(m.created_at=b),a=f.actual(h.closed.list,m.created_at,p),g=f.ideal(m.created_at,m.due_on,p),q=f.trend(a,m.created_at,m.due_on),w=this.el.getBoundingClientRect(),c=w.height,r=w.width,l={top:30,right:30,bottom:40,left:50},r-=l.left+l.right,c-=l.top+l.bottom,s=e.time.scale().range([0,r]),u=e.scale.linear().range([c,0]),t=d.horizontal(c,s),v=d.vertical(r,u),i=e.svg.line().interpolate("linear").x(function(a){return s(a.date)}).y(function(a){return u(a.points)}),s.domain([g[0].date,g[g.length-1].date]),u.domain([0,g[0].points]).nice(),n=e.select(this.el.querySelector("#chart")).append("svg").attr("width",r+l.left+l.right).attr("height",c+l.top+l.bottom).append("g").attr("transform","translate("+l.left+","+l.top+")"),n.append("g").attr("class","x axis day").attr("transform","translate(0,"+c+")").call(t),j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],k=t.orient("top").tickSize(c).tickFormat(function(a){return j[a.getMonth()]}).ticks(2),n.append("g").attr("class","x axis month").attr("transform","translate(0,"+c+")").call(k),n.append("g").attr("class","y axis").call(v),n.append("svg:line").attr("class","today").attr("x1",s(new Date)).attr("y1",0).attr("x2",s(new Date)).attr("y2",c),n.append("path").attr("class","ideal line").attr("d",i.interpolate("linear")(g)),n.append("path").attr("class","trendline line").attr("d",i.interpolate("linear")(q)),n.append("path").attr("class","actual line").attr("d",i.interpolate("linear").y(function(a){return u(a.points)})(a)),o=e.tip().attr("class","d3-tip").html(function(a){var b,c;return b=a.number,c=a.title,"#"+b+": "+c}),n.call(o),n.selectAll("a.issue").data(a.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,s(b)}).attr("cy",function(a){var b;return b=a.points,u(b)}).attr("r",function(a){var b;return b=a.radius,5}).on("mouseover",o.show).on("mouseout",o.hide)}})},{"../modules/chart/axes.coffee":25,"../modules/chart/lines.coffee":26,"../templates/chart.html":34,d3:4,"d3-tip":3,ractive:13}],51:[function(a,b){var c,d,e,f,g;d=a("ractive"),f=a("../models/system.coffee").system,e=a("../models/firebase.coffee"),g=a("../models/user.coffee"),c=a("./icons.coffee"),b.exports=d.extend({name:"views/header",template:a("../templates/header.html"),data:{user:g,icon:"fire-station"},components:{Icons:c},adapt:[d.adaptors.Ractive],onconstruct:function(){return this.on("!login",function(){return e.login()})},onrender:function(){return f.observe("loading",function(a){return function(b){return a.set("icon",b?"spinner1":"fire-station")}}(this))}})},{"../models/firebase.coffee":21,"../models/system.coffee":23,"../models/user.coffee":24,"../templates/header.html":35,"./icons.coffee":53,ractive:13}],52:[function(a,b){var c,d;d=a("ractive"),c=a("./icons.coffee"),b.exports=d.extend({name:"views/hero",template:a("../templates/hero.html"),components:{Icons:c},adapt:[d.adaptors.Ractive]})},{"../templates/hero.html":36,"./icons.coffee":53,ractive:13}],53:[function(a,b){var c,d,e;c=a("ractive"),e=a("../utils/format.coffee"),d={cog:"e800",search:"e801",github:"e802",address:"e803","plus-circled":"e804","fire-station":"e805","sort-alphabet":"e806","down-open":"e807",spin6:"e808",megaphone:"e809",spin4:"e80a",spinner1:"e80b",attention:"e80c","download-cloud":"e80d"},b.exports=c.extend({name:"views/icons",template:a("../templates/icons.html"),isolated:!0,onrender:function(){return this.observe("icon",function(a){var b;return a&&(b=d[a])?this.set("code",e.hexToDec(b)):this.set("code",null)})}})},{"../templates/icons.html":37,"../utils/format.coffee":45,ractive:13}],54:[function(a,b){var c,d,e,f,g,h;h=a("lodash"),f=a("ractive"),g=a("d3"),c=a("../utils/ractive/eventful.coffee"),e=a("./icons.coffee"),d=68,b.exports=c.extend({name:"views/notify",template:a("../templates/notify.html"),data:{top:d,hidden:!0,defaults:{text:"",type:"",system:!1,icon:"megaphone",ttl:5e3}},components:{Icons:e},adapt:[f.adaptors.Ractive],show:function(a){var b;return this.set("hidden",!1),this.set(a=h.defaults(a,this.data.defaults)),b=[0,50][+a.system],this.animate("top",b,{easing:g.ease("bounce"),duration:800}),a.ttl?h.delay(h.bind(this.hide,this),a.ttl):void 0},hide:function(){return this.data.hidden?void 0:(this.set("hidden",!0),this.animate("top",d,{easing:g.ease("back"),complete:function(a){return function(){return a.set("text",null)}}(this)}))},onconstruct:function(){return this.subscribe("!app/notify",this.show,this),this.subscribe("!app/notify/hide",this.hide,this),this.on("close",this.hide)}})},{"../templates/notify.html":38,"../utils/ractive/eventful.coffee":48,"./icons.coffee":53,d3:4,lodash:7,ractive:13}],55:[function(a,b){var c,d,e,f,g,h,i,j,k;k=a("lodash"),e=a("ractive"),f=a("async"),c=a("../hero.coffee"),d=a("../tables/projects.coffee"),i=a("../../models/projects.coffee"),j=a("../../models/system.coffee"),h=a("../../modules/github/milestones.coffee"),g=a("../../modules/github/issues.coffee"),b.exports=e.extend({name:"views/pages/index",template:a("../../templates/pages/index.html"),components:{Hero:c,Projects:d},data:{projects:i,ready:!1},adapt:[e.adaptors.Ractive],cb:function(){return this.set("ready",!0)},onrender:function(){var a;return document.title="Burnchart: GitHub Burndown Chart as a Service",i.list.length?(a=j.async(),f.map(i.data.list,function(a,b){return h.fetchAll(a,function(c,d){return c?(i.saveError(a,c),b()):f.each(d,function(b,c){return k.find(a.milestones,function(a){var c;return c=a.number,b.number===c})?c(null):g.fetchAll({owner:a.owner,name:a.name,milestone:b.number},function(d,e){return d?(i.saveError(a,d),c()):(k.extend(b,{issues:e}),i.addMilestone(a,b),c())})},b)})},function(b){return function(){return a(),b.cb()}}(this))):this.cb()}})},{"../../models/projects.coffee":22,"../../models/system.coffee":23,"../../modules/github/issues.coffee":27,"../../modules/github/milestones.coffee":28,"../../templates/pages/index.html":39,"../hero.coffee":52,"../tables/projects.coffee":60,async:1,lodash:7,ractive:13}],56:[function(a,b){var c,d,e,f,g,h,i,j,k;k=a("lodash"),e=a("async"),c=a("../chart.coffee"),d=a("../../utils/ractive/eventful.coffee"),i=a("../../models/projects.coffee"),j=a("../../models/system.coffee"),h=a("../../modules/github/milestones.coffee"),g=a("../../modules/github/issues.coffee"),f=a("../../utils/format.coffee"),b.exports=d.extend({name:"views/pages/chart",template:a("../../templates/pages/milestone.html"),components:{Chart:c},data:{format:f,ready:!1},cb:function(a,b){return a?this.publish("!app/notify",{text:a.toString(),type:"alert",system:!0,ttl:null}):b.stats.isEmpty?this.publish("!app/notify",{text:"The milestone has no issues",type:"warn",system:!0,ttl:null}):(b.stats.isDone&&this.publish("!app/notify",{text:"The milestone is complete",type:"success"}),b.stats.isOverdue&&this.publish("!app/notify",{text:"The milestone is overdue",type:"warn"}),this.set({milestone:b,ready:!0}))},onrender:function(){var a,b,c,d,f,l,m,n,o;return o=this.get("route"),m=o[0],l=o[1],f=o[2],f=parseInt(f),document.title=""+m+"/"+l+"/"+f,(n=i.find({owner:m,name:l}))?(a=k.find(n.milestones,{number:f}),null!=a?this.cb(null,a):(b=j.async(),d=function(a){return h.fetch({owner:m,name:l,milestone:f},a)},c=function(a,b){return g.fetchAll({owner:m,name:l,milestone:f},function(c,d){return b(c,k.extend(a,{issues:d}))})},e.waterfall([d,c],function(a){return function(c,d){return b(),c||i.addMilestone(n,d),a.cb.apply(a,arguments)}}(this)))):this.cb("Project not found")}})},{"../../models/projects.coffee":22,"../../models/system.coffee":23,"../../modules/github/issues.coffee":27,"../../modules/github/milestones.coffee":28,"../../templates/pages/milestone.html":40,"../../utils/format.coffee":45,"../../utils/ractive/eventful.coffee":48,"../chart.coffee":50,async:1,lodash:7}],57:[function(a,b){var c,d,e,f,g,h,i;i=a("lodash"),d=a("ractive"),c=a("../../utils/ractive/eventful.coffee"),e=a("../../models/firebase.coffee"),g=a("../../models/system.coffee"),h=a("../../models/user.coffee"),f=a("../../utils/key.coffee"),b.exports=c.extend({name:"views/pages/new",template:a("../../templates/pages/new.html"),data:{value:"radekstepan/disposable",user:h},adapt:[d.adaptors.Ractive],submit:function(a,b){var c,d,e;if(!f.is(a)||f.isEnter(a))return e=b.split("/"),d=e[0],c=e[1],this.publish("!projects/add",{owner:d,name:c}),window.location.hash="#"},onconstruct:function(){return this.on("!login",function(){return e.login()})},onrender:function(){var a;return document.title="Add a new project",a=function(){},this.observe("value",i.debounce(a,200),{init:!1}),this.el.querySelector("input").focus(),this.on("submit",this.submit)}})},{"../../models/firebase.coffee":21,"../../models/system.coffee":23,"../../models/user.coffee":24,"../../templates/pages/new.html":41,"../../utils/key.coffee":46,"../../utils/ractive/eventful.coffee":48,lodash:7,ractive:13}],58:[function(a,b){var c,d,e,f,g,h,i,j;j=a("lodash"),e=a("async"),d=a("../tables/milestones.coffee"),c=a("../../utils/ractive/eventful.coffee"),h=a("../../models/projects.coffee"),i=a("../../models/system.coffee"),g=a("../../modules/github/milestones.coffee"),f=a("../../modules/github/issues.coffee"),b.exports=c.extend({name:"views/pages/project",template:a("../../templates/pages/project.html"),components:{Milestones:d},data:{projects:h,ready:!1},cb:function(a){return a?this.publish("!app/notify",{text:a.toString(),type:"alert",system:!0,ttl:null}):this.set("ready",!0)},onrender:function(){var a,b,c,d,k,l,m,n;return n=this.get("route"),l=n[0],k=n[1],document.title=""+l+"/"+k,this.set("project",m=h.find({owner:l,name:k})),m?(a=i.async(),d=function(a){return j.find(m.milestones||[],{number:a})},c=function(a){return g.fetchAll(m,a)},b=function(a,b){return a.length?e.each(a,function(a,b){return d(a.number)?b(null):f.fetchAll({owner:l,name:k,milestone:a.number},function(c,d){return c?b(c):(h.addMilestone(m,j.extend(a,{issues:d})),b())})},b):b("The project has no milestones")},e.waterfall([c,b],function(b){return function(){return a(),b.cb.apply(b,arguments)}}(this))):this.cb("Project not found")}})},{"../../models/projects.coffee":22,"../../models/system.coffee":23,"../../modules/github/issues.coffee":27,"../../modules/github/milestones.coffee":28,"../../templates/pages/project.html":42,"../../utils/ractive/eventful.coffee":48,"../tables/milestones.coffee":59,async:1,lodash:7}],59:[function(a,b){var c;c=a("./table.coffee"),b.exports=c.extend({name:"views/milestones",template:a("../../templates/tables/milestones.html")})},{"../../templates/tables/milestones.html":43,"./table.coffee":61}],60:[function(a,b){var c;c=a("./table.coffee"),b.exports=c.extend({name:"views/projects",template:a("../../templates/tables/projects.html")})},{"../../templates/tables/projects.html":44,"./table.coffee":61}],61:[function(a,b){var c,d,e,f;d=a("ractive"),e=a("../../utils/format.coffee"),c=a("../icons.coffee"),f=a("../../models/projects.coffee"),b.exports=d.extend({name:"views/table",data:{format:e},components:{Icons:c},adapt:[d.adaptors.Ractive],onconstruct:function(){return this.on("sortBy",function(){var a,b;return a=f.data.sortFns,b=1+a.indexOf(f.data.sortBy),b===a.length&&(b=0),f.set("sortBy",a[b])})}})},{"../../models/projects.coffee":22,"../../utils/format.coffee":45,"../icons.coffee":53,ractive:13}]},{},[19]); \ No newline at end of file diff --git a/src/models/projects.coffee b/src/models/projects.coffee index 66a63ac..d639df2 100644 --- a/src/models/projects.coffee +++ b/src/models/projects.coffee @@ -3,11 +3,10 @@ lscache = require 'lscache' sortedIndex = require 'sortedindex-compare' semver = require 'semver' -Model = require '../utils/ractive/model.coffee' -config = require '../models/config.coffee' -stats = require '../modules/stats.coffee' -date = require '../utils/date.coffee' -user = require './user.coffee' +Model = require '../utils/ractive/model.coffee' +config = require '../models/config.coffee' +stats = require '../modules/stats.coffee' +user = require './user.coffee' module.exports = new Model diff --git a/src/modules/github/milestones.coffee b/src/modules/github/milestones.coffee index 67896f2..7d8901d 100644 --- a/src/modules/github/milestones.coffee +++ b/src/modules/github/milestones.coffee @@ -6,23 +6,4 @@ module.exports = 'fetch': request.oneMilestone # Fetch all milestones. - 'fetchAll': request.allMilestones - - # # Get the current milestone out of many. - # else - # request.allMilestones repo, (err, data) -> - # # Errors? - # return cb err if err - # # Empty warning? - # return cb null, "No open milestones for repo #{repo.path}" unless data.length - # # The first milestone should be ending soonest. - # m = data[0] - # # Filter milestones without due date. - # m = _.rest data, { 'due_on' : null } - # # The first milestone should be ending soonest. Prefer milestones with due dates. - # m = if m[0] then m[0] else data[0] - # # Empty milestone? - # if m.open_issues + m.closed_issues is 0 - # return cb null, "No issues for milestone `#{m.title}`" - - # cb null, null, m \ No newline at end of file + 'fetchAll': request.allMilestones \ No newline at end of file diff --git a/src/utils/date.coffee b/src/utils/date.coffee deleted file mode 100644 index f447e3b..0000000 --- a/src/utils/date.coffee +++ /dev/null @@ -1,2 +0,0 @@ -module.exports = - now: -> new Date().toJSON() \ No newline at end of file diff --git a/test/issues.coffee b/test/issues.coffee index 1d600e9..945e2bc 100644 --- a/test/issues.coffee +++ b/test/issues.coffee @@ -1,6 +1,7 @@ proxy = do require('proxyquire').noCallThru assert = require 'assert' path = require 'path' +require 'blanket' request = {} diff --git a/test/lines.coffee b/test/lines.coffee new file mode 100644 index 0000000..36047e7 --- /dev/null +++ b/test/lines.coffee @@ -0,0 +1,12 @@ +proxy = do require('proxyquire').noCallThru +assert = require 'assert' +path = require 'path' +require 'blanket' + +lines = require '../src/modules/chart/lines.coffee' + +module.exports = + + 'lines - na': (done) -> + assert.equal 1, 1 + do done \ No newline at end of file diff --git a/test/milestones.coffee.bak b/test/milestones.coffee.bak deleted file mode 100644 index 6272f6f..0000000 --- a/test/milestones.coffee.bak +++ /dev/null @@ -1,187 +0,0 @@ -proxy = do require('proxyquire').noCallThru -assert = require 'assert' -path = require 'path' - -req = {} - -milestones = proxy path.resolve(__dirname, '../src/modules/milestones.coffee'), - './request': req - './require': - '_': require 'lodash' - 'superagent': null - 'd3': null - 'async': null - 'marked': require 'marked' - -module.exports = - - 'milestones - get current from 1': (done) -> - req.all_milestones = (opts, cb) -> - cb null, [ - { - 'number': 1 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': '2013-02-01T00:00:00Z' - } - ] - - milestones {}, (err, warn, milestone) -> - assert.ifError err - assert.equal milestone.number, 1 - do done - - 'milestones - get current from 1 when milestone has no due date': (done) -> - req.all_milestones = (opts, cb) -> - cb null, [ - { - 'number': 1 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': null - } - ] - - milestones {}, (err, warn, milestone) -> - assert.ifError err - assert.equal milestone.number, 1 - do done - - # We always take from head because of request params. - 'milestones - get current from > 1': (done) -> - req.all_milestones = (opts, cb) -> - cb null, [ - { - 'number': 2 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': '2013-01-15T00:00:00Z' - } - { - 'number': 1 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': '2013-02-01T00:00:00Z' - } - { - 'number': 3 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': '2013-02-15T00:00:00Z' - } - ] - - milestones {}, (err, warn, milestone) -> - assert.ifError err - assert.equal milestone.number, 2 - do done - - 'milestones - get current from > 1 when there are milestones without due date': (done) -> - req.all_milestones = (opts, cb) -> - cb null, [ - { - 'number': 2 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': null - } - { - 'number': 1 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': '2013-02-01T00:00:00Z' - } - { - 'number': 3 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': '2013-02-15T00:00:00Z' - } - ] - - milestones {}, (err, warn, milestone) -> - assert.ifError err - assert.equal milestone.number, 1 - do done - - 'milestones - get current when empty': (done) -> - req.all_milestones = (opts, cb) -> - cb null, [] - - milestones { 'path': 'some/repo' }, (err, warn, milestone) -> - assert.ifError err - assert.equal warn, 'No open milestones for repo some/repo' - do done - - 'milestones - get current when not found': (done) -> - req.all_milestones = (opts, cb) -> - cb 'Not Found' - - milestones {}, (err, warn, milestone) -> - assert.equal err, 'Not Found' - do done - - 'milestones - get current when no issues': (done) -> - req.all_milestones = (opts, cb) -> - cb null, [ - { - 'title': 'No issues' - 'number': 1 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': '2013-02-01T00:00:00Z', - 'open_issues': 0, - 'closed_issues': 0 - } - ] - - milestones {}, (err, warn, milestone) -> - assert.ifError err - assert.equal warn, 'No issues for milestone `No issues`' - do done - - 'milestones - get one': (done) -> - m = - 'number': 1 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': '2013-02-01T00:00:00Z' - - req.one_milestone = (opts, number, cb) -> - cb null, m - - milestones { 'milestone': 1 }, (err, warn, milestone) -> - assert.ifError err - assert.equal warn, null - assert.deepEqual milestone, m - do done - - 'milestones - get one (404)': (done) -> - req.one_milestone = (opts, number, cb) -> - cb 'Not Found' - - milestones { 'milestone': 9 }, (err, warn, milestone) -> - assert.equal err, 'Not Found' - do done - - 'milestones - get one when no issues': (done) -> - req.one_milestone = (opts, number, cb) -> - cb null, { - 'title': 'No issues' - 'number': 1 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': '2013-02-01T00:00:00Z', - 'open_issues': 0, - 'closed_issues': 0 - } - - milestones { 'milestone': 9 }, (err, warn, milestone) -> - assert.ifError err - assert.equal warn, 'No issues for milestone `No issues`' - do done - - 'milestones - has description': (done) -> - req.all_milestones = (opts, cb) -> - cb null, [ - { - 'number': 1 - 'created_at': '2013-01-01T00:00:00Z' - 'due_on': '2013-02-01T00:00:00Z' - 'description': 'A description of this milestone goes *here*' - } - ] - - milestones {}, (err, warn, milestone) -> - assert.ifError err - assert.equal milestone.description, 'A description of this milestone goes here' - do done \ No newline at end of file diff --git a/test/projects.coffee b/test/projects.coffee new file mode 100644 index 0000000..891a9c2 --- /dev/null +++ b/test/projects.coffee @@ -0,0 +1,12 @@ +proxy = do require('proxyquire').noCallThru +assert = require 'assert' +path = require 'path' +require 'blanket' + +projects = require '../src/models/projects.coffee' + +module.exports = + + 'projects - initializes empty': (done) -> + assert.deepEqual projects.data.list, [ ] + do done \ No newline at end of file diff --git a/test/request.coffee b/test/request.coffee index 0420a78..e6b50ff 100644 --- a/test/request.coffee +++ b/test/request.coffee @@ -1,6 +1,7 @@ proxy = do require('proxyquire').noCallThru assert = require 'assert' path = require 'path' +require 'blanket' class Sa diff --git a/test/stats.coffee b/test/stats.coffee new file mode 100644 index 0000000..504ebfe --- /dev/null +++ b/test/stats.coffee @@ -0,0 +1,18 @@ +proxy = do require('proxyquire').noCallThru +assert = require 'assert' +path = require 'path' +require 'blanket' + +stats = require '../src/modules/stats.coffee' + +module.exports = + + 'stats - empty milestone': (done) -> + milestone = + 'issues': + 'open': { 'size': 0 } + 'closed': { 'size': 0 } + + { isEmpty } = stats milestone + assert.equal isEmpty, yes + do done \ No newline at end of file