Skip to content

Instantly share code, notes, and snippets.

@CrossEye
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CrossEye/971d896c1b1bd70343a9 to your computer and use it in GitHub Desktop.
Save CrossEye/971d896c1b1bd70343a9 to your computer and use it in GitHub Desktop.
requirebin sketch
var transform = function(n) {return 3 * n + 2;}
var log = function(n, idx, arr) {
return 'n: ' + n + ', idx: ' + idx + ', arr: ' + arr;
}
console.log('----------------------------------------');
var Fk = require('fkit');
console.log('fkit');
console.log(Fk.compose(Fk.map(log), Fk.map(transform))([0, 1, 2]).join('\n'));
console.log('----------------------------------------');
var Fn = require('fn.js');
console.log('fn.js');
console.log(Fn.map(log, (Fn.map(transform, [0, 1, 2]))).join('\n'));
console.log('----------------------------------------');
var H = require('highland');
console.log('highland');
H([0,1,2]).map(transform).map(log).toArray(function(a){console.log(a.join('\n'));});
console.log('----------------------------------------');
var La = require('lazy.js');
console.log('lazy.js');
console.log(La.range(3).map(transform).map(log).toArray().join('\n'));
console.log('----------------------------------------');
var Ld = require('lodash');
console.log('lodash');
console.log(Ld.range(3).map(transform).map(log).join('\n'));
console.log('----------------------------------------');
var Le = require('lemonad')
console.log('lemonad');
console.log(Le.map(log)((Le.map(transform)(([0, 1, 2])))).join('\n'));
console.log('----------------------------------------');
var Lz = require('lz');
console.log('lz');
console.log(Lz.range(0, 3).map(transform).map(log).toArray().join('\n'));
console.log('----------------------------------------');
var R = require('ramda');
console.log('ramda');
console.log(R.compose(R.map(log), R.map(transform))([0, 1, 2]).join('\n'));
console.log('----------------------------------------');
var T = require('transducers.js');
console.log('transducers.js');
console.log(T.seq([0,1,2], T.compose(T.map(transform), T.map(log))).join('\n'));
console.log('----------------------------------------');
var U = require('underscore');
console.log('underscore');
console.log(U.range(3).map(transform).map(log).join('\n'));
console.log('----------------------------------------');
require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";var util=require("./util");function flatten(as){return as.reduce(function(a,b){return a.concat(b)},[])}function curry(f){var arity=f.length;return arity<=1?f:given([],0);function given(args,applications){return function(){var newArgs=args.concat(arguments.length>0?util.slice.call(arguments,0):undefined);return newArgs.length>=arity?f.apply(this,newArgs):given(newArgs,applications+1)}}}function variadic(f){var arity=f.length;if(arity<1){return f}else if(arity===1){return function(){var args=util.slice.call(arguments,0),newArgs=arguments.length===1?flatten(args):args;return f.call(this,newArgs)}}else{return function(){var numMissingArgs=Math.max(arity-arguments.length-1,0),missingArgs=new Array(numMissingArgs),namedArgs=util.slice.call(arguments,0,arity-1),variadicArgs=util.slice.call(arguments,f.length-1);return f.apply(this,namedArgs.concat(missingArgs).concat([variadicArgs]))}}}var self;self=module.exports={flatten:flatten,apply:curry(function(f,a){return f(a)}),apply2:curry(function(f,a,b){return f(a,b)}),apply3:curry(function(f,a,b,c){return f(a,b,c)}),applyRight:curry(function(a,f){return f(a)}),compose:variadic(function(fs){return function(a){return fs.reduceRight(function(a,f){return f(a)},a)}}),flip:curry(function(f,a,b){return f(b,a)}),id:function(a){return a},"const":function(c){return function(){return c}},curry:curry,uncurry:curry(function(f,p){return f(p[0],p[1])}),unary:function(f){return f.length===1?f:self.apply(f)},binary:function(f){return f.length===2?f:self.apply2(f)},variadic:variadic,tap:curry(function(f,a){f(a);return a}),equal:curry(function(a,b){return b===a}),notEqual:curry(function(a,b){return b!==a}),compare:curry(function(a,b){if(a>b){return 1}else if(a<b){return-1}else{return 0}})}},{"./util":16}],2:[function(require,module,exports){"use strict";var util=require("./util");module.exports=util.extend({},[require("./list/base"),require("./list/build"),require("./list/fold"),require("./list/map"),require("./list/search"),require("./list/set"),require("./list/sort"),require("./list/sublist"),require("./list/zip")])},{"./list/base":3,"./list/build":4,"./list/fold":5,"./list/map":6,"./list/search":7,"./list/set":8,"./list/sort":9,"./list/sublist":10,"./list/zip":11,"./util":16}],3:[function(require,module,exports){"use strict";var fn=require("../fn");var self;self=module.exports={isString:function(as){return typeof as==="string"},isArrayOfStrings:function(as){return Array.isArray(as)&&as.length>0&&as.reduce(function(a,b){return a&&self.isString(b)},true)},mempty:function(as){return self.isString(as)||self.isArrayOfStrings(as)?"":[]},pure:function(a){return self.isString(a)||self.isArrayOfStrings(a)?a:[a]},toArray:function(as){return self.isString(as)?as.split(""):as},toList:function(as,t){return t==="string"?as.join(""):as},length:function(as){return as.length},empty:function(as){return as.length===0},append:fn.curry(function(a,bs){return self.isString(bs)?bs+a:bs.concat([a])}),prepend:fn.curry(function(a,bs){return self.isString(bs)?a+bs:[a].concat(bs)}),surround:fn.curry(function(a,b,cs){return self.append(b,self.prepend(a,cs))}),head:function(as){return as[0]},last:function(as){return as[as.length-1]},init:function(as){return as.slice(0,as.length-1)},tail:function(as){return as.slice(1)},inits:function inits(as){return self.prepend(self.mempty(as),self.empty(as)?[]:inits(self.tail(as)).map(self.prepend(self.head(as))))},tails:function tails(as){return self.prepend(as,self.empty(as)?[]:tails(self.tail(as)))}}},{"../fn":1}],4:[function(require,module,exports){"use strict";var base=require("./base"),fn=require("../fn"),fold=require("./fold"),math=require("../math"),sublist=require("./sublist");var self;self=module.exports={array:function(n){return Array.apply(null,Array(n))},string:function(n){return self.array(n+1).join(" ")},pair:fn.curry(function(a,b){return[a,b]}),range:fn.curry(function(a,n){return self.array(n).map(function(_,i){return a+i})}),replicate:fn.curry(function(n,a){var as=base.isString(a)?self.string(n):self.array(n);return fold.concatMap(function(){return[a]},as)}),sample:fn.curry(function(n,as){return sublist.take(n,self.shuffle(as))}),shuffle:function(as){var i=-1,r=self.array(as.length),bs=fold.fold(f,r,as),s=base.isString(as)?"":[];return fold.concatWith(s,bs);function f(b,a){var j=math.randomInt(0,++i);b[i]=b[j];b[j]=a;return b}}}},{"../fn":1,"../math":13,"./base":3,"./fold":5,"./sublist":10}],5:[function(require,module,exports){"use strict";var base=require("./base"),fn=require("../fn"),math=require("../math");var self;self=module.exports={flattenStrings:function flattenStrings(as){if(base.isArrayOfStrings(as)){return self.concat(as)}else{if(Array.isArray(as)){return as.map(flattenStrings)}else{return as}}},concatWith:fn.curry(function(s,as){return base.toArray(fn.flatten(as)).reduce(fn.flip(base.append),s)}),concat:fn.variadic(function(as){return self.concatWith(base.mempty(as),as)}),concatMap:fn.curry(function(f,as){var bs=base.toArray(as).map(fn.compose(self.flattenStrings,f)),cs=bs.length>0?bs:as;return self.concatWith(base.mempty(cs),bs)}),fold:fn.curry(function(f,s,as){return base.toArray(as).reduce(f,s)}),foldRight:fn.curry(function(f,s,as){return base.toArray(as).reduceRight(fn.flip(f),s)}),scan:fn.curry(function(f,s,as){var r=[s];self.fold(function(b,a){return fn.tap(r.push.bind(r),f(b,a))},s,as);return r}),scanRight:fn.curry(function(f,s,as){var r=[s];self.foldRight(function(a,b){return fn.tap(r.unshift.bind(r),f(a,b))},s,as);return r}),maximum:function(as){return self.fold(math.max,as[0],as)},minimum:function(as){return self.fold(math.min,as[0],as)},sum:function(as){return self.fold(math.add,0,as)},product:function(as){return self.fold(math.mul,1,as)}}},{"../fn":1,"../math":13,"./base":3}],6:[function(require,module,exports){"use strict";var base=require("./base"),fn=require("../fn"),fold=require("./fold");module.exports={map:fn.curry(function(f,as){return base.toArray(as).map(f)}),reverse:function(as){return base.toArray(as).reduce(fn.flip(base.prepend),base.mempty(as))},intersperse:fn.curry(function(s,as){return base.empty(as)?base.mempty(as):fold.concat(base.head(as),prependToAll(base.tail(as)));function prependToAll(bs){return base.empty(bs)?base.mempty(bs):fold.concat(s,base.head(bs),prependToAll(base.tail(bs)))}})}},{"../fn":1,"./base":3,"./fold":5}],7:[function(require,module,exports){"use strict";var base=require("./base"),fn=require("../fn"),fold=require("./fold"),logic=require("../logic"),map=require("./map");var self;self=module.exports={elem:fn.curry(function(a,as){return as.indexOf(a)>=0}),elemIndex:fn.curry(function(a,as){var i=as.indexOf(a);return i>=0?i:undefined}),elemIndices:fn.curry(function(a,as){return self.findIndices(fn.equal(a),as)}),find:fn.curry(function(p,as){return base.head(self.filter(p,as))}),findIndex:fn.curry(function(p,as){var n=as.length;for(var i=0;i<n;i++){if(p(as[i])){return i}}return undefined}),findIndices:fn.curry(function(p,as){var s=[],n=as.length;for(var i=0;i<n;i++){if(p(as[i])){s.push(i)}}return s}),filter:fn.curry(function(p,as){var f=logic.branch(p,fn.id,fn.const(""));return base.isString(as)?fold.concatMap(f,as):as.filter(p)}),partition:fn.curry(function(p,as){return[self.filter(p,as),self.filter(fn.compose(logic.not,p),as)]}),all:fn.curry(function(p,as){return self.filter(p,as).length===as.length}),any:fn.curry(function(p,as){return self.filter(p,as).length>0}),isPrefixOf:fn.curry(function isPrefixOf(as,bs){if(base.empty(as)){return true}else if(base.empty(bs)){return false}else{return base.head(as)===base.head(bs)&&isPrefixOf(base.tail(as),base.tail(bs))}}),isSuffixOf:fn.curry(function(as,bs){return self.isPrefixOf(map.reverse(as),map.reverse(bs))}),isInfixOf:fn.curry(function(as,bs){return self.any(self.isPrefixOf(as),base.tails(bs))})}},{"../fn":1,"../logic":12,"./base":3,"./fold":5,"./map":6}],8:[function(require,module,exports){"use strict";var base=require("./base"),build=require("./build"),fn=require("../fn"),fold=require("./fold"),map=require("./map"),search=require("./search");var self;self=module.exports={nub:function(as){return self.nubBy(fn.equal,as)},nubBy:fn.curry(function nubBy(f,as){var a=base.head(as);return base.empty(as)?base.mempty(as):base.prepend(a,nubBy(f,search.filter(function(b){return!f(a,b)},base.tail(as))))}),union:fn.curry(function(as,bs){return fold.fold(function(cs,b){return search.elem(b,cs)?cs:base.append(b,cs)},as,bs)}),intersect:fn.curry(function(as,bs){return fold.fold(function(cs,a){return search.elem(a,bs)?base.append(a,cs):cs},base.mempty(as),as)}),difference:fn.curry(function(as,bs){return fold.fold(fn.flip(self.remove),as,bs)}),remove:fn.curry(function(a,bs){return self.removeBy(fn.equal,a,bs)}),removeBy:fn.curry(function removeBy(f,a,bs_){var b=base.head(bs_),bs=base.tail(bs_);return base.empty(bs_)?base.mempty(bs_):f(a,b)?bs:base.prepend(b,removeBy(f,a,bs))}),cartesian:fn.curry(function cartesian(as,bs){return base.empty(as)?[]:fold.concat(map.map(build.pair(base.head(as)),bs),cartesian(base.tail(as),bs))}),subsequences:function(as){return base.prepend(base.mempty(as),subsequences_(as));function subsequences_(bs){var b=base.head(bs);if(base.empty(bs)){return[]}else{return base.prepend(base.pure(b),fold.foldRight(f,[],subsequences_(base.tail(bs))))}function f(ys,r){return fold.concat(base.pure(ys),base.pure(base.prepend(b,ys)),r)}}},permutations:function permutations(as){return base.prepend(as,permutations_(as,[]));function permutations_(bs_,cs){var b=base.head(bs_),bs=base.tail(bs_);return base.empty(bs_)?[]:fold.foldRight(interleave,permutations_(bs,base.prepend(b,cs)),permutations(cs));function interleave(ds,r){return interleave_(fn.id,ds)[1];function interleave_(f,es_){if(base.empty(es_)){return[bs,r]}else{var e=base.head(es_),es=base.tail(es_),s=interleave_(fn.compose(f,base.prepend(e)),es);return[base.prepend(e,s[0]),base.prepend(f(fold.concat(b,e,s[0])),s[1])]}}}}}}},{"../fn":1,"./base":3,"./build":4,"./fold":5,"./map":6,"./search":7}],9:[function(require,module,exports){"use strict";var base=require("./base"),fn=require("../fn"),util=require("../util");var self;self=module.exports={sort:function(as){return self.sortBy(fn.compare,as)},sortBy:function(c,as){var bs=base.toArray(as.slice(0));return base.toList(bs.sort(c),typeof as)}}},{"../fn":1,"../util":16,"./base":3}],10:[function(require,module,exports){"use strict";var base=require("./base"),fn=require("../fn"),fold=require("./fold");var self;self=module.exports={take:fn.curry(function(n,as){var s=base.isString(as)?"":[],m=as.length;for(var i=0;i<Math.min(m,n);i++){s=s.concat(as[i])}return s}),drop:fn.curry(function(n,as){var s=base.isString(as)?"":[],m=as.length;for(var i=n;i<m;i++){s=s.concat(as[i])}return s}),takeWhile:fn.curry(function(p,as){var s=base.isString(as)?"":[],n=as.length;for(var i=0;i<n&&p(as[i]);i++){s=s.concat(as[i])}return s}),dropWhile:fn.curry(function(p,as){var s=base.isString(as)?"":[],m=as.length,n=0;while(p(as[n])&&n<as.length){n++}for(var i=n;i<m;i++){s=s.concat(as[i])}return s}),splitAt:fn.curry(function(n,as){return[self.take(n,as),self.drop(n,as)]}),span:fn.curry(function(p,as){return[self.takeWhile(p,as),self.dropWhile(p,as)]}),group:function(as){return self.groupBy(fn.equal,as)},groupBy:fn.curry(function groupBy(f,as){var b=base.head(as),bs=self.span(f(b),base.tail(as));return base.empty(as)?[]:base.prepend(base.prepend(b,base.head(bs)),groupBy(f,base.last(bs)))})}},{"../fn":1,"./base":3,"./fold":5}],11:[function(require,module,exports){"use strict";var base=require("./base"),build=require("./build"),fn=require("../fn");var self;self=module.exports={zipWith:fn.curry(function(f,as,bs){var n=Math.min(as.length,bs.length);return base.toArray(as.slice(0,n)).map(function(a,i){return f(a,bs[i])})}),zip:fn.curry(function(as,bs){return self.zipWith(build.pair,as,bs)}),unzip:function(as){var s=base.mempty(as[0]);return as.reduceRight(function(p,ps){var a=ps[0],b=ps[1],as=p[0],bs=p[1];return[base.prepend(a,as),base.prepend(b,bs)]},[s,s])}}},{"../fn":1,"./base":3,"./build":4}],12:[function(require,module,exports){"use strict";var fn=require("./fn"),map=require("./list/map");var self;self=module.exports={and:fn.curry(function(a,b){return b&&a}),or:fn.curry(function(a,b){return b||a}),not:function(a){return!a},branch:fn.curry(function(p,f,g,a){return p(a)?f(a):g(a)}),whereAll:fn.curry(function(ps,a){return ps.map(fn.applyRight(a)).reduce(self.and,true)}),whereAny:fn.curry(function(ps,a){return ps.map(fn.applyRight(a)).reduce(self.or,false)})}},{"./fn":1,"./list/map":6}],13:[function(require,module,exports){"use strict";var fn=require("./fn");module.exports={add:fn.curry(function(a,b){return b+a}),sub:fn.curry(function(a,b){return b-a}),mul:fn.curry(function(a,b){return b*a}),div:fn.curry(function(a,b){return b/a}),mod:fn.curry(function(a,b){return b%a}),max:fn.curry(function(a,b){return b>a?b:a}),min:fn.curry(function(a,b){return a>b?b:a}),negate:function(a){return-a},eq:fn.curry(function(a,b){return b==a}),neq:fn.curry(function(a,b){return b!=a}),gt:fn.curry(function(a,b){return b>a}),gte:fn.curry(function(a,b){return b>=a}),lt:fn.curry(function(a,b){return b<a}),lte:fn.curry(function(a,b){return b<=a}),inc:function(a){return a+1},dec:function(a){return a-1},randomInt:fn.curry(function(a,b){return Math.floor(Math.random()*(b-a+1))+a}),randomFloat:fn.curry(function(a,b){return Math.random()*(b-a)+a})}},{"./fn":1}],14:[function(require,module,exports){"use strict";var fn=require("./fn"),set=require("./list/set"),util=require("./util");var self;self=module.exports={copy:fn.variadic(function(o,ps){return util.extend(new o.constructor,[o].concat(ps))}),get:fn.curry(function(k,o){return o[k]}),set:fn.curry(function(k,v,o){var p={};p[k]=v;return self.copy(o,p)}),update:fn.curry(function(k,f,o){return self.set(k,f(self.get(k,o)),o)}),pick:fn.curry(function(ks,o){return ks.reduce(function(p,k){return self.set(k,self.get(k,o),p)},{})}),omit:fn.curry(function(ks,o){return set.difference(self.keys(o),ks).reduce(function(p,k){return self.set(k,self.get(k,o),p)},{})}),pairs:function(o){return Object.keys(o).map(function(k){return[k,self.get(k,o)]})},keys:function(o){return Object.keys(o)},values:function(o){return Object.keys(o).map(fn.flip(self.get)(o))}}},{"./fn":1,"./list/set":8,"./util":16}],15:[function(require,module,exports){"use strict";var fn=require("./fn");module.exports={toUpper:function(s){return s.toUpperCase()},toLower:function(s){return s.toLowerCase()},replace:fn.curry(function(a,b,s){return s.replace(a,b)})}},{"./fn":1}],16:[function(require,module,exports){"use strict";module.exports={extend:function(target,objects){objects.forEach(function(object){Object.getOwnPropertyNames(object).forEach(function(property){target[property]=object[property]})});return target},slice:Array.prototype.slice}},{}],fkit:[function(require,module,exports){"use strict";var util=require("./util");module.exports=util.extend({},[require("./fn"),require("./list"),require("./logic"),require("./math"),require("./obj"),require("./string")])},{"./fn":1,"./list":2,"./logic":12,"./math":13,"./obj":14,"./string":15,"./util":16}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({"fn.js":[function(require,module,exports){(function(root,factory){if(typeof define==="function"&&define.amd){define(factory)}else if(typeof exports==="object"){module.exports=factory(require,exports,module)}else{root.fn=factory()}})(this,function(require,exports,module){"use strict";var fn={};fn.toArray=function(collection){return[].slice.call(collection)};fn.cloneArray=fn.toArray;fn.op={"+":function(value1,value2){return value1+value2},"-":function(value1,value2){return value1-value2},"*":function(value1,value2){return value1*value2},"/":function(value1,value2){return value1/value2},"==":function(value1,value2){return value1==value2},"===":function(value1,value2){return value1===value2}};fn.type=function(value){return value==null?""+value:{}.toString.call(value).slice(8,-1).toLowerCase()};fn.is=function(type,value){return type===fn.type(value)};fn.apply=function(handler,args){return handler.apply(null,args)};fn.concat=function(){var args=fn.toArray(arguments);var first=args[0];if(!fn.is("array",first)&&!fn.is("string",first)){first=args.length?[first]:[]}return first.concat.apply(first,args.slice(1))};fn.partial=function(){var args=fn.toArray(arguments);var handler=args[0];var partialArgs=args.slice(1);return function(){return fn.apply(handler,fn.concat(partialArgs,fn.toArray(arguments)))}};fn.identity=function(arg){return arg};var currier=function makeCurry(rightward){return function(handler,arity){if(handler.curried){return handler}arity=arity||handler.length;var curry=function curry(){var args=fn.toArray(arguments);if(args.length>=arity){var transform=rightward?"reverse":"identity";return fn.apply(handler,fn[transform](args))}var inner=function(){return fn.apply(curry,args.concat(fn.toArray(arguments)))};inner.curried=true;return inner};curry.curried=true;return curry}};fn.curry=currier(false);fn.curryRight=currier(true);fn.properties=function(object){var accumulator=[];for(var property in object){if(object.hasOwnProperty(property)){accumulator.push(property)}}return accumulator};fn.each=function(handler,collection,params){for(var index=0,collectionLength=collection.length;index<collectionLength;index++){fn.apply(handler,fn.concat([collection[index],index,collection],params))}};fn.reduce=function(handler,accumulator,collection,params){fn.each(function(value,index){accumulator=fn.apply(handler,fn.concat([accumulator,value,index],params))},collection);return accumulator};fn.filter=function(expression,collection){return fn.reduce(function(accumulator,item,index){expression(item,index)&&accumulator.push(item);return accumulator},[],collection)};fn.op["++"]=fn.partial(fn.op["+"],1);fn.op["--"]=fn.partial(fn.op["+"],-1);fn.map=function(handler,collection,params){return fn.reduce(function(accumulator,value,index){accumulator.push(fn.apply(handler,fn.concat([value,index,collection],params)));return accumulator},[],collection)};fn.reverse=function(collection){return fn.cloneArray(collection).reverse()};fn.pipeline=function(){var functions=fn.toArray(arguments);return function(){return fn.reduce(function(args,func){return[fn.apply(func,args)]},fn.toArray(arguments),functions)[0]}};fn.compose=function(){return fn.apply(fn.pipeline,fn.reverse(arguments))};fn.prop=fn.curry(function(name,object){return object[name]});fn.merge=function(){return fn.reduce(function(accumulator,value){fn.each(function(property){accumulator[property]=value[property]},fn.properties(value));return accumulator},{},fn.toArray(arguments))};fn.memoize=function memoize(handler,serializer){var cache={};return function(){var args=fn.toArray(arguments);var key=serializer?serializer(args):memoize.serialize(args);return key in cache?cache[key]:cache[key]=fn.apply(handler,args)}};fn.memoize.serialize=function(values){return fn.type(values[0])+"|"+JSON.stringify(values[0])};fn.flip=function(handler){return function(){return fn.apply(handler,fn.reverse(arguments))}};fn.delay=function(handler,msDelay){return setTimeout(handler,msDelay)};fn.delayFor=fn.flip(fn.delay);fn.delayed=function(handler,msDelay){return function(){return fn.delay(fn.partial(handler,fn.toArray(arguments)),msDelay)}};fn.delayedFor=fn.flip(fn.delayed);fn.async=fn.compose(fn.partial(fn.delayedFor,0));fn.throttle=function(handler,msDelay){var throttling;return function(){var args=fn.toArray(arguments);if(throttling){return}throttling=fn.delay(function(){throttling=false;fn.apply(handler,args)},msDelay)}};fn.debounce=function(handler,msDelay){var debouncing;return function(){var args=fn.toArray(arguments);if(debouncing){clearTimeout(debouncing)}debouncing=fn.delay(function(){debouncing=false;fn.apply(handler,args)},msDelay)}};return fn})},{}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}else{throw TypeError('Uncaught, unspecified "error" event.')}return false}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];handler.apply(this,args)}}else if(isObject(handler)){len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){var m;if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],2:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],3:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}if(canPost){var queue=[];window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],4:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],5:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);
var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":4,_process:3,inherits:2}],highland:[function(require,module,exports){(function(process,global){var inherits=require("util").inherits;var EventEmitter=require("events").EventEmitter;exports=module.exports=function(xs,ee,mappingHint){return new Stream(xs,ee,mappingHint)};var _=exports;var ArrayProto=Array.prototype,ObjProto=Object.prototype;var slice=ArrayProto.slice,toString=ObjProto.toString;_.isFunction=function(x){return typeof x==="function"};_.isObject=function(x){return typeof x==="object"&&x!==null};_.isString=function(x){return typeof x==="string"};_.isArray=Array.isArray||function(x){return toString.call(x)==="[object Array]"};if(typeof setImmediate==="undefined"){if(typeof process==="undefined"||!process.nextTick){_.setImmediate=function(fn){setTimeout(fn,0)}}else{_.setImmediate=process.nextTick}}else if(typeof process==="undefined"||!process.stdout){_.setImmediate=function(fn){setImmediate(fn)}}else{_.setImmediate=setImmediate}var _global=this;if(typeof global!=="undefined"){_global=global}else if(typeof window!=="undefined"){_global=window}if(!_global.nil){_global.nil={}}var nil=_.nil=_global.nil;_.curry=function(fn){var args=slice.call(arguments);return _.ncurry.apply(this,[fn.length].concat(args))};_.ncurry=function(n,fn){var largs=slice.call(arguments,2);if(largs.length>=n){return fn.apply(this,largs.slice(0,n))}return function(){var args=largs.concat(slice.call(arguments));if(args.length<n){return _.ncurry.apply(this,[n,fn].concat(args))}return fn.apply(this,args.slice(0,n))}};_.partial=function(f){var args=slice.call(arguments,1);return function(){return f.apply(this,args.concat(slice.call(arguments)))}};_.flip=_.curry(function(fn,x,y){return fn(y,x)});_.compose=function(){var fns=slice.call(arguments).reverse();return _.seq.apply(null,fns)};_.seq=function(){var fns=slice.call(arguments);return function(){if(!fns.length){return}var r=fns[0].apply(this,arguments);for(var i=1;i<fns.length;i++){r=fns[i].call(this,r)}return r}};function Stream(xs,ee,mappingHint){if(xs&&_.isStream(xs)){return xs}EventEmitter.call(this);var self=this;self.__HighlandStream__=true;self.id=(""+Math.random()).substr(2,6);this.paused=true;this._incoming=[];this._outgoing=[];this._consumers=[];this._observers=[];this._destructors=[];this._send_events=false;this._delegate=null;this.source=null;this.writable=true;self.on("newListener",function(ev){if(ev==="data"){self._send_events=true;_.setImmediate(self.resume.bind(self))}else if(ev==="end"){self._send_events=true}});self.on("removeListener",function(ev){if(ev==="end"||ev==="data"){var end_listeners=self.listeners("end").length;var data_listeners=self.listeners("data").length;if(end_listeners+data_listeners===0){self._send_events=false}}});if(xs===undefined){}else if(_.isArray(xs)){self._incoming=xs.concat([nil])}else if(typeof xs==="function"){this._generator=xs;this._generator_push=function(err,x){self.write(err?new StreamError(err):x)};this._generator_next=function(s){if(s){var _paused=self.paused;if(!_paused){self.pause()}self.write(new StreamRedirect(s));if(!_paused){self.resume()}}else{self._generator_running=false}if(!self.paused){self.resume()}}}else if(_.isObject(xs)){if(_.isFunction(xs.then)){return _(function(push){xs.then(function(value){push(null,value);return push(null,nil)},function(err){push(err);return push(null,nil)})})}else{xs.on("error",function(err){self.write(new StreamError(err))});xs.pipe(self)}}else if(typeof xs==="string"){var mappingHintType=typeof mappingHint;var mapper;if(mappingHintType==="function"){mapper=mappingHint}else if(mappingHintType==="number"){mapper=function(){return slice.call(arguments,0,mappingHint)}}else if(_.isArray(mappingHint)){mapper=function(){var args=arguments;return mappingHint.reduce(function(ctx,hint,idx){ctx[hint]=args[idx];return ctx},{})}}else{mapper=function(x){return x}}ee.on(xs,function(){var ctx=mapper.apply(this,arguments);self.write(ctx)})}else{throw new Error("Unexpected argument type to Stream(): "+typeof xs)}}inherits(Stream,EventEmitter);function exposeMethod(name){var f=Stream.prototype[name];var n=f.length;_[name]=_.ncurry(n+1,function(){var args=Array.prototype.slice.call(arguments);var s=_(args.pop());return f.apply(s,args)})}function StreamError(err){this.__HighlandStreamError__=true;this.error=err}function StreamRedirect(to){this.__HighlandStreamRedirect__=true;this.to=to}_.isStream=function(x){return _.isObject(x)&&x.__HighlandStream__};_._isStreamError=function(x){return _.isObject(x)&&x.__HighlandStreamError__};_._isStreamRedirect=function(x){return _.isObject(x)&&x.__HighlandStreamRedirect__};Stream.prototype._send=function(err,x){if(x===nil){this.ended=true}if(this._consumers.length){for(var i=0,len=this._consumers.length;i<len;i++){var c=this._consumers[i];if(err){c.write(new StreamError(err))}else{c.write(x)}}}if(this._observers.length){for(var j=0,len2=this._observers.length;j<len2;j++){this._observers[j].write(x)}}if(this._send_events){if(x===nil){this.emit("end")}else{this.emit("data",x)}}};Stream.prototype.pause=function(){this.paused=true;if(this.source){this.source._checkBackPressure()}};Stream.prototype._checkBackPressure=function(){if(!this._consumers.length){return this.pause()}for(var i=0,len=this._consumers.length;i<len;i++){if(this._consumers[i].paused){return this.pause()}}return this.resume()};Stream.prototype._readFromBuffer=function(){var len=this._incoming.length;var i=0;while(i<len&&!this.paused){var x=this._incoming[i];if(_._isStreamError(x)){this._send(x.error)}else if(_._isStreamRedirect(x)){this._redirect(x.to)}else{this._send(null,x)}i++}this._incoming.splice(0,i)};Stream.prototype._sendOutgoing=function(){var len=this._outgoing.length;var i=0;while(i<len&&!this.paused){var x=this._outgoing[i];if(_._isStreamError(x)){Stream.prototype._send.call(this,x.error)}else if(_._isStreamRedirect(x)){this._redirect(x.to)}else{Stream.prototype._send.call(this,null,x)}i++}this._outgoing.splice(0,i)};Stream.prototype.resume=function(){if(this._resume_running){this._repeat_resume=true;return}this._resume_running=true;do{this._repeat_resume=false;this.paused=false;this._sendOutgoing();this._readFromBuffer();if(!this.paused){if(this.source){this.source._checkBackPressure()}else if(this._generator){this._runGenerator()}else{this.emit("drain")}}}while(this._repeat_resume);this._resume_running=false};Stream.prototype.end=function(){this.write(nil)};Stream.prototype.pipe=function(dest){var self=this;var canClose=dest!==process.stdout&&dest!==process.stderr;var s=self.consume(function(err,x,push,next){if(err){self.emit("error",err);return}if(x===nil){if(canClose){dest.end()}}else if(dest.write(x)!==false){next()}});dest.on("drain",onConsumerDrain);this._destructors.push(function(){dest.removeListener("drain",onConsumerDrain)});s.resume();return dest;function onConsumerDrain(){s.resume()}};Stream.prototype.destroy=function(){var self=this;this.end();_(this._consumers).each(function(consumer){self._removeConsumer(consumer)});if(this.source){this.source._removeConsumer(this)}_(this._destructors).each(function(destructor){destructor()})};Stream.prototype._runGenerator=function(){if(this._generator_running){return}this._generator_running=true;this._generator(this._generator_push,this._generator_next)};Stream.prototype._redirect=function(to){to=_(to);while(to._delegate){to=to._delegate}to._consumers=this._consumers.map(function(c){c.source=to;return c});this._consumers=[];to._delegate_source=this._delegate_source||this;to._delegate_source._delegate=to;if(this.paused){to.pause()}else{this.pause();to._checkBackPressure()}};Stream.prototype._addConsumer=function(s){if(this._consumers.length){throw new Error("Stream already being consumed, you must either fork() or observe()")}s.source=this;this._consumers.push(s);this._checkBackPressure()};Stream.prototype._removeConsumer=function(s){var src=this;while(src._delegate){src=src._delegate}src._consumers=src._consumers.filter(function(c){return c!==s});if(s.source===src){s.source=null}src._checkBackPressure()};Stream.prototype.consume=function(f){var self=this;while(self._delegate){self=self._delegate}var s=new Stream;var _send=s._send;var push=function(err,x){if(x===nil){self._removeConsumer(s)}if(s.paused){if(err){s._outgoing.push(new StreamError(err))}else{s._outgoing.push(x)}}else{_send.call(s,err,x)}};var async;var next_called;var next=function(s2){if(s2){var _paused=s.paused;if(!_paused){s.pause()}s.write(new StreamRedirect(s2));if(!_paused){s.resume()}}else if(async){s.resume()}else{next_called=true}};s._send=function(err,x){async=false;next_called=false;f(err,x,push,next);async=true;if(!next_called){s.pause()}};self._addConsumer(s);return s};exposeMethod("consume");Stream.prototype.pull=function(f){var s=this.consume(function(err,x){s.source._removeConsumer(s);f(err,x)});s.id="pull:"+s.id;s.resume()};Stream.prototype.write=function(x){if(this.paused){this._incoming.push(x)}else{if(_._isStreamError(x)){this._send(x.error)}else{this._send(null,x)}}return!this.paused};Stream.prototype.fork=function(){var s=new Stream;s.id="fork:"+s.id;s.source=this;this._consumers.push(s);this._checkBackPressure();return s};Stream.prototype.observe=function(){var s=new Stream;s.id="observe:"+s.id;s.source=this;this._observers.push(s);return s};Stream.prototype.errors=function(f){return this.consume(function(err,x,push,next){if(err){f(err,push);next()}else if(x===nil){push(null,nil)}else{push(null,x);next()}})};exposeMethod("errors");Stream.prototype.stopOnError=function(f){return this.consume(function(err,x,push,next){if(err){f(err,push);push(null,nil)}else if(x===nil){push(null,nil)}else{push(null,x);next()}})};exposeMethod("stopOnError");Stream.prototype.each=function(f){var self=this;return this.consume(function(err,x,push,next){if(err){self.emit("error",err)}else if(x!==nil){f(x);next()}}).resume()};exposeMethod("each");Stream.prototype.apply=function(f){return this.toArray(function(args){f.apply(null,args)})};exposeMethod("apply");Stream.prototype.toArray=function(f){var self=this;var xs=[];var s=this.consume(function(err,x,push,next){if(err){self.emit("error",err)}else if(x===nil){f(xs)}else{xs.push(x);next()}});s.id="toArray:"+s.id;s.resume()};Stream.prototype.map=function(f){if(!_.isFunction(f)){var val=f;f=function(){return val}}return this.consume(function(err,x,push,next){if(err){push(err);next()}else if(x===nil){push(err,x)}else{var fnVal,fnErr;try{fnVal=f(x)}catch(e){fnErr=e}push(fnErr,fnVal);next()}})};exposeMethod("map");Stream.prototype.doto=function(f){return this.map(function(x){f(x);return x})};exposeMethod("doto");Stream.prototype.ratelimit=function(num,ms){if(num<1){throw new Error("Invalid number of operations per ms: "+num)}var sent=0;return this.consume(function(err,x,push,next){if(err){push(err);next()}else if(x===nil){push(null,nil)}else{if(sent<num){sent++;push(null,x);next()}else{setTimeout(function(){sent=1;push(null,x);next()},ms)}}})};exposeMethod("ratelimit");Stream.prototype.flatMap=function(f){return this.map(f).sequence()};exposeMethod("flatMap");Stream.prototype.pluck=function(prop){return this.consume(function(err,x,push,next){if(err){push(err);next()}else if(x===nil){push(err,x)}else if(_.isObject(x)){push(null,x[prop]);next()}else{push(new Error("Expected Object, got "+typeof x));next()}})};exposeMethod("pluck");Stream.prototype.filter=function(f){return this.consume(function(err,x,push,next){if(err){push(err);next()}else if(x===nil){push(err,x)}else{var fnVal,fnErr;try{fnVal=f(x)}catch(e){fnErr=e}if(fnErr){push(fnErr)}else if(fnVal){push(null,x)}next()}})};exposeMethod("filter");Stream.prototype.flatFilter=function(f){return this.flatMap(function(x){return f(x).take(1).otherwise(errorStream()).flatMap(function(bool){return _(bool?[x]:[])})});function errorStream(){return _(function(push){push(new Error("Stream returned by function was empty."));push(null,_.nil)})}};exposeMethod("flatFilter");Stream.prototype.reject=function(f){return this.filter(_.compose(_.not,f))};exposeMethod("reject");Stream.prototype.find=function(f){return this.filter(f).take(1)};exposeMethod("find");Stream.prototype.group=function(f){var lambda=_.isString(f)?_.get(f):f;return this.reduce({},function(m,o){var key=lambda(o);if(!m.hasOwnProperty(key)){m[key]=[]}m[key].push(o);return m}.bind(this))};exposeMethod("group");Stream.prototype.compact=function(){return this.filter(function(x){return x})};exposeMethod("compact");Stream.prototype.where=function(props){return this.filter(function(x){for(var k in props){if(x[k]!==props[k]){return false}}return true})};exposeMethod("where");Stream.prototype.zip=function(ys){ys=_(ys);var xs=this;var returned=0;var z=[];function nextValue(index,max,src,push,next){src.pull(function(err,x){if(err){push(err);nextValue(index,max,src,push,next)}else if(x===_.nil){push(null,nil)}else{returned++;z[index]=x;if(returned===max){push(null,z);next()}}})}return _(function(push,next){returned=0;z=[];nextValue(0,2,xs,push,next);nextValue(1,2,ys,push,next)})};exposeMethod("zip");Stream.prototype.batch=function(n){var batched=[];return this.consume(function(err,x,push,next){if(err){push(err);next()}if(x===nil){if(batched.length>0){push(null,batched)}push(null,nil)}else{batched.push(x);if(batched.length===n){push(null,batched);batched=[]}next()}})};exposeMethod("batch");Stream.prototype.take=function(n){if(n===0){return _([])}var s=this.consume(function(err,x,push,next){if(err){push(err);if(n>0){next()}else{push(null,nil)}}else if(x===nil){push(null,nil)}else{n--;push(null,x);if(n>0){next()}else{push(null,nil)}}});s.id="take:"+s.id;return s};exposeMethod("take");Stream.prototype.head=function(){return this.take(1)};exposeMethod("head");Stream.prototype.last=function(){var nothing={};var prev=nothing;return this.consume(function(err,x,push,next){if(err){push(err);next()}else if(x===nil){if(prev!==nothing){push(null,prev)}push(null,nil)}else{prev=x;next()}})};exposeMethod("last");Stream.prototype.through=function(target){if(_.isFunction(target)){return target(this)}else{var output=_();target.pause();this.pipe(target).pipe(output);return output}};exposeMethod("through");_.pipeline=function(){if(!arguments.length){return _()}var start=arguments[0],rest;if(!_.isStream(start)&&!_.isFunction(start.resume)){start=_();rest=slice.call(arguments)}else{start=_(start);rest=slice.call(arguments,1)}var end=rest.reduce(function(src,dest){return src.through(dest)},start);var wrapper=_(function(push,next){end.pull(function(err,x){if(err){wrapper._send(err);next()}else if(x===nil){wrapper._send(null,nil)}else{wrapper._send(null,x);next()}})});wrapper.write=function(x){start.write(x)};return wrapper};Stream.prototype.sequence=function(){var original=this;var curr=this;return _(function(push,next){curr.pull(function(err,x){if(err){push(err);return next()}else if(_.isArray(x)){if(onOriginalStream()){x.forEach(function(y){push(null,y)})}else{push(null,x)}return next()}else if(_.isStream(x)){if(onOriginalStream()){curr=x;return next()}else{push(null,x);return next()}}else if(x===nil){if(onOriginalStream()){push(null,nil)}else{curr=original;return next()}}else{if(onOriginalStream()){push(new Error("Expected Stream, got "+typeof x));return next()}else{push(null,x);return next()}}})});function onOriginalStream(){return curr===original}};exposeMethod("sequence");Stream.prototype.series=Stream.prototype.sequence;_.series=_.sequence;Stream.prototype.flatten=function(){var curr=this;var stack=[];return _(function(push,next){curr.pull(function(err,x){if(err){push(err);return next()}if(_.isArray(x)){x=_(x)}if(_.isStream(x)){stack.push(curr);curr=x;next()}else if(x===nil){if(stack.length){curr=stack.pop();next()}else{push(null,nil)}}else{push(null,x);next()}})})};exposeMethod("flatten");Stream.prototype.parallel=function(n){var source=this;var running=[];var ended=false;var reading_source=false;return _(function(push,next){if(running.length&&running[0].buffer.length){var buf=running[0].buffer;for(var i=0;i<buf.length;i++){if(buf[i][1]===nil){running.shift();return next()}else{push.apply(null,buf[i])}}}else if(running.length<n&&!ended&&!reading_source){reading_source=true;source.pull(function(err,x){reading_source=false;if(err){push(err)}else if(x===nil){ended=true}else{var run={stream:x,buffer:[]};running.push(run);x.consume(function(err,y,_push,_next){if(running[0]===run){if(y===nil){running.shift();next()}else{push(err,y)}}else{run.buffer.push([err,y])}if(y!==nil){_next()}}).resume()}return next()})}else if(!running.length&&ended){push(null,nil)}else{}})};exposeMethod("parallel");Stream.prototype.otherwise=function(ys){var xs=this;return xs.consume(function(err,x,push,next){if(err){push(err);next()}if(x===nil){next(ys)}else{push(null,x);next(xs)}})};exposeMethod("otherwise");Stream.prototype.append=function(y){return this.consume(function(err,x,push,next){if(x===nil){push(null,y);push(null,_.nil)}else{push(err,x);next()}})};exposeMethod("append");Stream.prototype.reduce=function(z,f){return this.consume(function(err,x,push,next){if(x===nil){push(null,z);push(null,_.nil)}else if(err){push(err);next()}else{try{z=f(z,x)}catch(e){push(e);push(null,_.nil);return}next()}})};exposeMethod("reduce");Stream.prototype.reduce1=function(f){var self=this;return _(function(push,next){self.pull(function(err,x){if(err){push(err);next()}if(x===nil){push(null,nil)}else{next(self.reduce(x,f))}})})};exposeMethod("reduce1");Stream.prototype.collect=function(){var xs=[];return this.consume(function(err,x,push,next){if(err){push(err);next()}else if(x===nil){push(null,xs);push(null,nil)}else{xs.push(x);next()}})};exposeMethod("collect");Stream.prototype.scan=function(z,f){var self=this;return _([z]).concat(self.consume(function(err,x,push,next){if(x===nil){push(null,_.nil)}else if(err){push(err);next()}else{try{z=f(z,x)}catch(e){push(e);push(null,_.nil);return}push(null,z);next()}}))};exposeMethod("scan");Stream.prototype.scan1=function(f){var self=this;return _(function(push,next){self.pull(function(err,x){if(err){push(err);next()}if(x===nil){push(null,nil)}else{next(self.scan(x,f))}})})};exposeMethod("scan1");Stream.prototype.concat=function(ys){ys=_(ys);return this.consume(function(err,x,push,next){if(x===nil){next(ys)}else{push(err,x);next()}})};exposeMethod("concat");Stream.prototype.merge=function(){var self=this;var resuming=false;var go_next=false;var srcs;return _(function(push,next){var safeNext=function(){if(!resuming){next()}else{go_next=true}};if(!srcs){self.errors(push).toArray(function(xs){srcs=xs;srcs.forEach(function(src){src.on("end",function(){srcs=srcs.filter(function(s){return s!==src});safeNext()});src.on("data",function(x){src.pause();push(null,x);safeNext()});src.on("error",function(err){push(err);safeNext()})});next()})}else if(srcs.length===0){push(null,nil)}else{go_next=false;resuming=true;srcs.forEach(function(src){src.resume()});resuming=false;if(go_next){next()}}})};exposeMethod("merge");Stream.prototype.invoke=function(method,args){return this.map(function(x){return x[method].apply(x,args)})};exposeMethod("invoke");Stream.prototype.throttle=function(ms){var s=new Stream;var last=0-ms;var _write=s.write;s.write=function(x){var now=(new Date).getTime();if(_._isStreamError(x)||x===nil){return _write.apply(this,arguments)}else if(now-ms>=last){last=now;return _write.apply(this,arguments)}};this._addConsumer(s);return s};exposeMethod("throttle");Stream.prototype.debounce=function(ms){var s=new Stream;var t=null;var nothing={};var last=nothing;var _write=s.write;s.write=function(x){if(_._isStreamError(x)){return _write.apply(this,arguments)}else if(x===nil){if(t){clearTimeout(t)}if(last!==nothing){_write.call(s,last)}return _write.apply(this,arguments)}else{last=x;if(t){clearTimeout(t)}t=setTimeout(function(){_write.call(s,last)},ms);return!this.paused}};this._addConsumer(s);return s};exposeMethod("debounce");Stream.prototype.latest=function(){var s=new Stream;var _write=s.write;s.pause=function(){this.paused=true};s.write=function(x){if(_._isStreamError(x)){_write.call(this,x)}else if(x===nil){_write.call(this,x)}else{if(this.paused){this._incoming=this._incoming.filter(function(x){return _._isStreamError(x)||x===nil});this._incoming.push(x)}else{_write.call(this,x)}}return true};this._addConsumer(s);s.resume();return s};exposeMethod("latest");_.values=function(obj){return _.keys(obj).map(function(k){return obj[k]})};_.keys=function(obj){var keys=[];for(var k in obj){if(obj.hasOwnProperty(k)){keys.push(k)}}return _(keys)};_.pairs=function(obj){return _.keys(obj).map(function(k){return[k,obj[k]]})};_.extend=_.curry(function(extensions,target){for(var k in extensions){if(extensions.hasOwnProperty(k)){target[k]=extensions[k]}}return target});_.get=_.curry(function(prop,obj){return obj[prop]});_.set=_.curry(function(prop,val,obj){obj[prop]=val;return obj});_.log=function(){console.log.apply(console,arguments)};_.wrapCallback=function(f){return function(){var args=slice.call(arguments);return _(function(push){var cb=function(err,x){if(err){push(err)}else{push(null,x)}push(null,nil)};f.apply(null,args.concat([cb]))})}};_.add=_.curry(function(a,b){return a+b});_.not=function(x){return!x}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{_process:3,events:1,util:5}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){var base64=require("base64-js");var ieee754=require("ieee754");exports.Buffer=Buffer;exports.SlowBuffer=Buffer;exports.INSPECT_MAX_BYTES=50;Buffer.poolSize=8192;var TYPED_ARRAY_SUPPORT=function(){try{var buf=new ArrayBuffer(0);var arr=new Uint8Array(buf);arr.foo=function(){return 42};return 42===arr.foo()&&typeof arr.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(e){return false}}();function Buffer(subject,encoding,noZero){if(!(this instanceof Buffer))return new Buffer(subject,encoding,noZero);var type=typeof subject;var length;if(type==="number")length=subject>0?subject>>>0:0;else if(type==="string"){if(encoding==="base64")subject=base64clean(subject);length=Buffer.byteLength(subject,encoding)}else if(type==="object"&&subject!==null){if(subject.type==="Buffer"&&isArray(subject.data))subject=subject.data;length=+subject.length>0?Math.floor(+subject.length):0}else throw new Error("First argument needs to be a number, array or string.");var buf;if(TYPED_ARRAY_SUPPORT){buf=Buffer._augment(new Uint8Array(length))}else{buf=this;buf.length=length;buf._isBuffer=true}var i;if(TYPED_ARRAY_SUPPORT&&typeof subject.byteLength==="number"){buf._set(subject)}else if(isArrayish(subject)){if(Buffer.isBuffer(subject)){for(i=0;i<length;i++)buf[i]=subject.readUInt8(i)}else{for(i=0;i<length;i++)buf[i]=(subject[i]%256+256)%256}}else if(type==="string"){buf.write(subject,0,encoding)}else if(type==="number"&&!TYPED_ARRAY_SUPPORT&&!noZero){for(i=0;i<length;i++){buf[i]=0}}return buf}Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.isBuffer=function(b){return!!(b!=null&&b._isBuffer)};Buffer.byteLength=function(str,encoding){var ret;str=str.toString();switch(encoding||"utf8"){case"hex":ret=str.length/2;break;case"utf8":case"utf-8":ret=utf8ToBytes(str).length;break;case"ascii":case"binary":case"raw":ret=str.length;break;case"base64":ret=base64ToBytes(str).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=str.length*2;break;default:throw new Error("Unknown encoding")}return ret};Buffer.concat=function(list,totalLength){assert(isArray(list),"Usage: Buffer.concat(list[, length])");if(list.length===0){return new Buffer(0)}else if(list.length===1){return list[0]}var i;if(totalLength===undefined){totalLength=0;for(i=0;i<list.length;i++){totalLength+=list[i].length}}var buf=new Buffer(totalLength);var pos=0;for(i=0;i<list.length;i++){var item=list[i];item.copy(buf,pos);pos+=item.length}return buf};Buffer.compare=function(a,b){assert(Buffer.isBuffer(a)&&Buffer.isBuffer(b),"Arguments must be Buffers");var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len&&a[i]===b[i];i++){}if(i!==len){x=a[i];y=b[i]}if(x<y){return-1}if(y<x){return 1}return 0};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;assert(strLen%2===0,"Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;i<length;i++){var byte=parseInt(string.substr(i*2,2),16);assert(!isNaN(byte),"Invalid hex string");buf[offset+i]=byte}return i}function utf8Write(buf,string,offset,length){var charsWritten=blitBuffer(utf8ToBytes(string),buf,offset,length);return charsWritten}function asciiWrite(buf,string,offset,length){var charsWritten=blitBuffer(asciiToBytes(string),buf,offset,length);return charsWritten}function binaryWrite(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){var charsWritten=blitBuffer(base64ToBytes(string),buf,offset,length);return charsWritten}function utf16leWrite(buf,string,offset,length){var charsWritten=blitBuffer(utf16leToBytes(string),buf,offset,length);return charsWritten}Buffer.prototype.write=function(string,offset,length,encoding){if(isFinite(offset)){if(!isFinite(length)){encoding=length;length=undefined}}else{var swap=encoding;encoding=offset;offset=length;length=swap}offset=Number(offset)||0;var remaining=this.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}encoding=String(encoding||"utf8").toLowerCase();var ret;switch(encoding){case"hex":ret=hexWrite(this,string,offset,length);break;case"utf8":case"utf-8":ret=utf8Write(this,string,offset,length);break;case"ascii":ret=asciiWrite(this,string,offset,length);break;case"binary":ret=binaryWrite(this,string,offset,length);break;case"base64":ret=base64Write(this,string,offset,length);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leWrite(this,string,offset,length);break;default:throw new Error("Unknown encoding")}return ret};Buffer.prototype.toString=function(encoding,start,end){var self=this;encoding=String(encoding||"utf8").toLowerCase();start=Number(start)||0;end=end===undefined?self.length:Number(end);if(end===start)return"";var ret;switch(encoding){case"hex":ret=hexSlice(self,start,end);break;case"utf8":case"utf-8":ret=utf8Slice(self,start,end);break;
case"ascii":ret=asciiSlice(self,start,end);break;case"binary":ret=binarySlice(self,start,end);break;case"base64":ret=base64Slice(self,start,end);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leSlice(self,start,end);break;default:throw new Error("Unknown encoding")}return ret};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Buffer.prototype.equals=function(b){assert(Buffer.isBuffer(b),"Argument must be a Buffer");return Buffer.compare(this,b)===0};Buffer.prototype.compare=function(b){assert(Buffer.isBuffer(b),"Argument must be a Buffer");return Buffer.compare(this,b)};Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(!start)start=0;if(!end&&end!==0)end=this.length;if(!target_start)target_start=0;if(end===start)return;if(target.length===0||source.length===0)return;assert(end>=start,"sourceEnd < sourceStart");assert(target_start>=0&&target_start<target.length,"targetStart out of bounds");assert(start>=0&&start<source.length,"sourceStart out of bounds");assert(end>=0&&end<=source.length,"sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-target_start<end-start)end=target.length-target_start+start;var len=end-start;if(len<100||!TYPED_ARRAY_SUPPORT){for(var i=0;i<len;i++){target[i+target_start]=this[i+start]}}else{target._set(this.subarray(start,start+len),target_start)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){var res="";var tmp="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){if(buf[i]<=127){res+=decodeUtf8Char(tmp)+String.fromCharCode(buf[i]);tmp=""}else{tmp+="%"+buf[i].toString(16)}}return res+decodeUtf8Char(tmp)}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i])}return ret}function binarySlice(buf,start,end){return asciiSlice(buf,start,end)}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;i++){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;if(TYPED_ARRAY_SUPPORT){return Buffer._augment(this.subarray(start,end))}else{var sliceLen=end-start;var newBuf=new Buffer(sliceLen,undefined,true);for(var i=0;i<sliceLen;i++){newBuf[i]=this[i+start]}return newBuf}};Buffer.prototype.get=function(offset){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(offset)};Buffer.prototype.set=function(v,offset){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(v,offset)};Buffer.prototype.readUInt8=function(offset,noAssert){if(!noAssert){assert(offset!==undefined&&offset!==null,"missing offset");assert(offset<this.length,"Trying to read beyond buffer length")}if(offset>=this.length)return;return this[offset]};function readUInt16(buf,offset,littleEndian,noAssert){if(!noAssert){assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset+1<buf.length,"Trying to read beyond buffer length")}var len=buf.length;if(offset>=len)return;var val;if(littleEndian){val=buf[offset];if(offset+1<len)val|=buf[offset+1]<<8}else{val=buf[offset]<<8;if(offset+1<len)val|=buf[offset+1]}return val}Buffer.prototype.readUInt16LE=function(offset,noAssert){return readUInt16(this,offset,true,noAssert)};Buffer.prototype.readUInt16BE=function(offset,noAssert){return readUInt16(this,offset,false,noAssert)};function readUInt32(buf,offset,littleEndian,noAssert){if(!noAssert){assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset+3<buf.length,"Trying to read beyond buffer length")}var len=buf.length;if(offset>=len)return;var val;if(littleEndian){if(offset+2<len)val=buf[offset+2]<<16;if(offset+1<len)val|=buf[offset+1]<<8;val|=buf[offset];if(offset+3<len)val=val+(buf[offset+3]<<24>>>0)}else{if(offset+1<len)val=buf[offset+1]<<16;if(offset+2<len)val|=buf[offset+2]<<8;if(offset+3<len)val|=buf[offset+3];val=val+(buf[offset]<<24>>>0)}return val}Buffer.prototype.readUInt32LE=function(offset,noAssert){return readUInt32(this,offset,true,noAssert)};Buffer.prototype.readUInt32BE=function(offset,noAssert){return readUInt32(this,offset,false,noAssert)};Buffer.prototype.readInt8=function(offset,noAssert){if(!noAssert){assert(offset!==undefined&&offset!==null,"missing offset");assert(offset<this.length,"Trying to read beyond buffer length")}if(offset>=this.length)return;var neg=this[offset]&128;if(neg)return(255-this[offset]+1)*-1;else return this[offset]};function readInt16(buf,offset,littleEndian,noAssert){if(!noAssert){assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset+1<buf.length,"Trying to read beyond buffer length")}var len=buf.length;if(offset>=len)return;var val=readUInt16(buf,offset,littleEndian,true);var neg=val&32768;if(neg)return(65535-val+1)*-1;else return val}Buffer.prototype.readInt16LE=function(offset,noAssert){return readInt16(this,offset,true,noAssert)};Buffer.prototype.readInt16BE=function(offset,noAssert){return readInt16(this,offset,false,noAssert)};function readInt32(buf,offset,littleEndian,noAssert){if(!noAssert){assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset+3<buf.length,"Trying to read beyond buffer length")}var len=buf.length;if(offset>=len)return;var val=readUInt32(buf,offset,littleEndian,true);var neg=val&2147483648;if(neg)return(4294967295-val+1)*-1;else return val}Buffer.prototype.readInt32LE=function(offset,noAssert){return readInt32(this,offset,true,noAssert)};Buffer.prototype.readInt32BE=function(offset,noAssert){return readInt32(this,offset,false,noAssert)};function readFloat(buf,offset,littleEndian,noAssert){if(!noAssert){assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset+3<buf.length,"Trying to read beyond buffer length")}return ieee754.read(buf,offset,littleEndian,23,4)}Buffer.prototype.readFloatLE=function(offset,noAssert){return readFloat(this,offset,true,noAssert)};Buffer.prototype.readFloatBE=function(offset,noAssert){return readFloat(this,offset,false,noAssert)};function readDouble(buf,offset,littleEndian,noAssert){if(!noAssert){assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset+7<buf.length,"Trying to read beyond buffer length")}return ieee754.read(buf,offset,littleEndian,52,8)}Buffer.prototype.readDoubleLE=function(offset,noAssert){return readDouble(this,offset,true,noAssert)};Buffer.prototype.readDoubleBE=function(offset,noAssert){return readDouble(this,offset,false,noAssert)};Buffer.prototype.writeUInt8=function(value,offset,noAssert){if(!noAssert){assert(value!==undefined&&value!==null,"missing value");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset<this.length,"trying to write beyond buffer length");verifuint(value,255)}if(offset>=this.length)return;this[offset]=value;return offset+1};function writeUInt16(buf,value,offset,littleEndian,noAssert){if(!noAssert){assert(value!==undefined&&value!==null,"missing value");assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset+1<buf.length,"trying to write beyond buffer length");verifuint(value,65535)}var len=buf.length;if(offset>=len)return;for(var i=0,j=Math.min(len-offset,2);i<j;i++){buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>(littleEndian?i:1-i)*8}return offset+2}Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return writeUInt16(this,value,offset,true,noAssert)};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return writeUInt16(this,value,offset,false,noAssert)};function writeUInt32(buf,value,offset,littleEndian,noAssert){if(!noAssert){assert(value!==undefined&&value!==null,"missing value");assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset+3<buf.length,"trying to write beyond buffer length");verifuint(value,4294967295)}var len=buf.length;if(offset>=len)return;for(var i=0,j=Math.min(len-offset,4);i<j;i++){buf[offset+i]=value>>>(littleEndian?i:3-i)*8&255}return offset+4}Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return writeUInt32(this,value,offset,true,noAssert)};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return writeUInt32(this,value,offset,false,noAssert)};Buffer.prototype.writeInt8=function(value,offset,noAssert){if(!noAssert){assert(value!==undefined&&value!==null,"missing value");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset<this.length,"Trying to write beyond buffer length");verifsint(value,127,-128)}if(offset>=this.length)return;if(value>=0)this.writeUInt8(value,offset,noAssert);else this.writeUInt8(255+value+1,offset,noAssert);return offset+1};function writeInt16(buf,value,offset,littleEndian,noAssert){if(!noAssert){assert(value!==undefined&&value!==null,"missing value");assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset+1<buf.length,"Trying to write beyond buffer length");verifsint(value,32767,-32768)}var len=buf.length;if(offset>=len)return;if(value>=0)writeUInt16(buf,value,offset,littleEndian,noAssert);else writeUInt16(buf,65535+value+1,offset,littleEndian,noAssert);return offset+2}Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return writeInt16(this,value,offset,true,noAssert)};Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return writeInt16(this,value,offset,false,noAssert)};function writeInt32(buf,value,offset,littleEndian,noAssert){if(!noAssert){assert(value!==undefined&&value!==null,"missing value");assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset+3<buf.length,"Trying to write beyond buffer length");verifsint(value,2147483647,-2147483648)}var len=buf.length;if(offset>=len)return;if(value>=0)writeUInt32(buf,value,offset,littleEndian,noAssert);else writeUInt32(buf,4294967295+value+1,offset,littleEndian,noAssert);return offset+4}Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return writeInt32(this,value,offset,true,noAssert)};Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return writeInt32(this,value,offset,false,noAssert)};function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert){assert(value!==undefined&&value!==null,"missing value");assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset+3<buf.length,"Trying to write beyond buffer length");verifIEEE754(value,3.4028234663852886e38,-3.4028234663852886e38)}var len=buf.length;if(offset>=len)return;ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert){assert(value!==undefined&&value!==null,"missing value");assert(typeof littleEndian==="boolean","missing or invalid endian");assert(offset!==undefined&&offset!==null,"missing offset");assert(offset+7<buf.length,"Trying to write beyond buffer length");verifIEEE754(value,1.7976931348623157e308,-1.7976931348623157e308)}var len=buf.length;if(offset>=len)return;ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.fill=function(value,start,end){if(!value)value=0;if(!start)start=0;if(!end)end=this.length;assert(end>=start,"end < start");if(end===start)return;if(this.length===0)return;assert(start>=0&&start<this.length,"start out of bounds");assert(end>=0&&end<=this.length,"end out of bounds");var i;if(typeof value==="number"){for(i=start;i<end;i++){this[i]=value}}else{var bytes=utf8ToBytes(value.toString());var len=bytes.length;for(i=start;i<end;i++){this[i]=bytes[i%len]}}return this};Buffer.prototype.inspect=function(){var out=[];var len=this.length;for(var i=0;i<len;i++){out[i]=toHex(this[i]);if(i===exports.INSPECT_MAX_BYTES){out[i+1]="...";break}}return"<Buffer "+out.join(" ")+">"};Buffer.prototype.toArrayBuffer=function(){if(typeof Uint8Array!=="undefined"){if(TYPED_ARRAY_SUPPORT){return new Buffer(this).buffer}else{var buf=new Uint8Array(this.length);for(var i=0,len=buf.length;i<len;i+=1){buf[i]=this[i]}return buf.buffer}}else{throw new Error("Buffer.toArrayBuffer not supported in this browser")}};var BP=Buffer.prototype;Buffer._augment=function(arr){arr._isBuffer=true;arr._get=arr.get;arr._set=arr.set;arr.get=BP.get;arr.set=BP.set;arr.write=BP.write;arr.toString=BP.toString;arr.toLocaleString=BP.toString;arr.toJSON=BP.toJSON;arr.equals=BP.equals;arr.compare=BP.compare;arr.copy=BP.copy;arr.slice=BP.slice;arr.readUInt8=BP.readUInt8;arr.readUInt16LE=BP.readUInt16LE;arr.readUInt16BE=BP.readUInt16BE;arr.readUInt32LE=BP.readUInt32LE;arr.readUInt32BE=BP.readUInt32BE;arr.readInt8=BP.readInt8;arr.readInt16LE=BP.readInt16LE;arr.readInt16BE=BP.readInt16BE;arr.readInt32LE=BP.readInt32LE;arr.readInt32BE=BP.readInt32BE;arr.readFloatLE=BP.readFloatLE;arr.readFloatBE=BP.readFloatBE;arr.readDoubleLE=BP.readDoubleLE;arr.readDoubleBE=BP.readDoubleBE;arr.writeUInt8=BP.writeUInt8;arr.writeUInt16LE=BP.writeUInt16LE;arr.writeUInt16BE=BP.writeUInt16BE;arr.writeUInt32LE=BP.writeUInt32LE;arr.writeUInt32BE=BP.writeUInt32BE;arr.writeInt8=BP.writeInt8;arr.writeInt16LE=BP.writeInt16LE;arr.writeInt16BE=BP.writeInt16BE;arr.writeInt32LE=BP.writeInt32LE;arr.writeInt32BE=BP.writeInt32BE;arr.writeFloatLE=BP.writeFloatLE;arr.writeFloatBE=BP.writeFloatBE;arr.writeDoubleLE=BP.writeDoubleLE;arr.writeDoubleBE=BP.writeDoubleBE;arr.fill=BP.fill;arr.inspect=BP.inspect;arr.toArrayBuffer=BP.toArrayBuffer;return arr};var INVALID_BASE64_RE=/[^+\/0-9A-z]/g;function base64clean(str){str=stringtrim(str).replace(INVALID_BASE64_RE,"");while(str.length%4!==0){str=str+"="}return str}function stringtrim(str){if(str.trim)return str.trim();return str.replace(/^\s+|\s+$/g,"")}function isArray(subject){return(Array.isArray||function(subject){return Object.prototype.toString.call(subject)==="[object Array]"})(subject)}function isArrayish(subject){return isArray(subject)||Buffer.isBuffer(subject)||subject&&typeof subject==="object"&&typeof subject.length==="number"}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){var b=str.charCodeAt(i);if(b<=127){byteArray.push(b)}else{var start=i;if(b>=55296&&b<=57343)i++;var h=encodeURIComponent(str.slice(start,i+1)).substr(1).split("%");for(var j=0;j<h.length;j++){byteArray.push(parseInt(h[j],16))}}}return byteArray}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;i++){c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(str)}function blitBuffer(src,dst,offset,length){for(var i=0;i<length;i++){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}function verifuint(value,max){assert(typeof value==="number","cannot write a non-number as a number");assert(value>=0,"specified a negative value for writing an unsigned value");assert(value<=max,"value is larger than maximum value for type");assert(Math.floor(value)===value,"value has a fractional component")}function verifsint(value,max,min){assert(typeof value==="number","cannot write a non-number as a number");assert(value<=max,"value larger than maximum allowed value");assert(value>=min,"value smaller than minimum allowed value");assert(Math.floor(value)===value,"value has a fractional component")}function verifIEEE754(value,max,min){assert(typeof value==="number","cannot write a non-number as a number");assert(value<=max,"value larger than maximum allowed value");assert(value>=min,"value smaller than minimum allowed value")}function assert(test,message){if(!test)throw new Error(message||"Failed assertion")}},{"base64-js":3,ieee754:4}],3:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(exports){"use strict";var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var PLUS="+".charCodeAt(0);var SLASH="/".charCodeAt(0);var NUMBER="0".charCodeAt(0);var LOWER="a".charCodeAt(0);var UPPER="A".charCodeAt(0);function decode(elt){var code=elt.charCodeAt(0);if(code===PLUS)return 62;if(code===SLASH)return 63;if(code<NUMBER)return-1;if(code<NUMBER+10)return code-NUMBER+26+26;if(code<UPPER+26)return code-UPPER;if(code<LOWER+26)return code-LOWER+26}function b64ToByteArray(b64){var i,j,l,tmp,placeHolders,arr;if(b64.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0;arr=new Arr(b64.length*3/4-placeHolders);l=placeHolders>0?b64.length-4:b64.length;var L=0;function push(v){arr[L++]=v}for(i=0,j=0;i<l;i+=4,j+=3){tmp=decode(b64.charAt(i))<<18|decode(b64.charAt(i+1))<<12|decode(b64.charAt(i+2))<<6|decode(b64.charAt(i+3));push((tmp&16711680)>>16);push((tmp&65280)>>8);push(tmp&255)}if(placeHolders===2){tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4;push(tmp&255)}else if(placeHolders===1){tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2;push(tmp>>8&255);push(tmp&255)}return arr}function uint8ToBase64(uint8){var i,extraBytes=uint8.length%3,output="",temp,length;function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(num&63)}for(i=0,length=uint8.length-extraBytes;i<length;i+=3){temp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output+=tripletToBase64(temp)}switch(extraBytes){case 1:temp=uint8[uint8.length-1];output+=encode(temp>>2);output+=encode(temp<<4&63);output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1];output+=encode(temp>>10);output+=encode(temp>>4&63);output+=encode(temp<<2&63);output+="=";break}return output}exports.toByteArray=b64ToByteArray;exports.fromByteArray=uint8ToBase64})(typeof exports==="undefined"?this.base64js={}:exports)},{}],4:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8);m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8);if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8);e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=s*128}},{}],5:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}else{throw TypeError('Uncaught, unspecified "error" event.')}return false}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];handler.apply(this,args)}}else if(isObject(handler)){len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){var m;if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],6:[function(require,module,exports){var http=module.exports;var EventEmitter=require("events").EventEmitter;var Request=require("./lib/request");var url=require("url");http.request=function(params,cb){if(typeof params==="string"){params=url.parse(params)}if(!params)params={};if(!params.host&&!params.port){params.port=parseInt(window.location.port,10)}if(!params.host&&params.hostname){params.host=params.hostname}if(!params.scheme)params.scheme=window.location.protocol.split(":")[0];if(!params.host){params.host=window.location.hostname||window.location.host}if(/:/.test(params.host)){if(!params.port){params.port=params.host.split(":")[1]}params.host=params.host.split(":")[0]}if(!params.port)params.port=params.scheme=="https"?443:80;var req=new Request(new xhrHttp,params);if(cb)req.on("response",cb);return req};http.get=function(params,cb){params.method="GET";var req=http.request(params,cb);req.end();return req};http.Agent=function(){};http.Agent.defaultMaxSockets=4;var xhrHttp=function(){if(typeof window==="undefined"){throw new Error("no window object present")}else if(window.XMLHttpRequest){return window.XMLHttpRequest}else if(window.ActiveXObject){var axs=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];for(var i=0;i<axs.length;i++){try{var ax=new window.ActiveXObject(axs[i]);return function(){if(ax){var ax_=ax;ax=null;return ax_}else{return new window.ActiveXObject(axs[i])}}}catch(e){}}throw new Error("ajax not supported in this browser")}else{throw new Error("ajax not supported in this browser")}}();http.STATUS_CODES={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{"./lib/request":7,events:5,url:31}],7:[function(require,module,exports){var Stream=require("stream");var Response=require("./response");var Base64=require("Base64");var inherits=require("inherits");var Request=module.exports=function(xhr,params){var self=this;self.writable=true;self.xhr=xhr;self.body=[];self.uri=(params.scheme||"http")+"://"+params.host+(params.port?":"+params.port:"")+(params.path||"/");if(typeof params.withCredentials==="undefined"){params.withCredentials=true}try{xhr.withCredentials=params.withCredentials}catch(e){}if(params.responseType)try{xhr.responseType=params.responseType}catch(e){}xhr.open(params.method||"GET",self.uri,true);xhr.onerror=function(event){self.emit("error",new Error("Network error"))};self._headers={};if(params.headers){var keys=objectKeys(params.headers);for(var i=0;i<keys.length;i++){var key=keys[i];if(!self.isSafeRequestHeader(key))continue;var value=params.headers[key];self.setHeader(key,value)}}if(params.auth){this.setHeader("Authorization","Basic "+Base64.btoa(params.auth))}var res=new Response;res.on("close",function(){self.emit("close")});res.on("ready",function(){self.emit("response",res)});res.on("error",function(err){self.emit("error",err)});xhr.onreadystatechange=function(){if(xhr.__aborted)return;res.handle(xhr)}};inherits(Request,Stream);Request.prototype.setHeader=function(key,value){this._headers[key.toLowerCase()]=value};Request.prototype.getHeader=function(key){return this._headers[key.toLowerCase()]};Request.prototype.removeHeader=function(key){delete this._headers[key.toLowerCase()]};Request.prototype.write=function(s){this.body.push(s)};Request.prototype.destroy=function(s){this.xhr.__aborted=true;this.xhr.abort();this.emit("close")};Request.prototype.end=function(s){if(s!==undefined)this.body.push(s);var keys=objectKeys(this._headers);for(var i=0;i<keys.length;i++){var key=keys[i];var value=this._headers[key];if(isArray(value)){for(var j=0;j<value.length;j++){this.xhr.setRequestHeader(key,value[j])}}else this.xhr.setRequestHeader(key,value)}if(this.body.length===0){this.xhr.send("")}else if(typeof this.body[0]==="string"){this.xhr.send(this.body.join(""))}else if(isArray(this.body[0])){var body=[];for(var i=0;i<this.body.length;i++){body.push.apply(body,this.body[i])}this.xhr.send(body)}else if(/Array/.test(Object.prototype.toString.call(this.body[0]))){var len=0;for(var i=0;i<this.body.length;i++){len+=this.body[i].length}var body=new this.body[0].constructor(len);var k=0;for(var i=0;i<this.body.length;i++){var b=this.body[i];for(var j=0;j<b.length;j++){body[k++]=b[j]}}this.xhr.send(body)}else{var body="";for(var i=0;i<this.body.length;i++){body+=this.body[i].toString()}this.xhr.send(body)}};Request.unsafeHeaders=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];Request.prototype.isSafeRequestHeader=function(headerName){if(!headerName)return false;return indexOf(Request.unsafeHeaders,headerName.toLowerCase())===-1};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"};var indexOf=function(xs,x){if(xs.indexOf)return xs.indexOf(x);
for(var i=0;i<xs.length;i++){if(xs[i]===x)return i}return-1}},{"./response":8,Base64:9,inherits:10,stream:30}],8:[function(require,module,exports){var Stream=require("stream");var util=require("util");var Response=module.exports=function(res){this.offset=0;this.readable=true};util.inherits(Response,Stream);var capable={streaming:true,status2:true};function parseHeaders(res){var lines=res.getAllResponseHeaders().split(/\r?\n/);var headers={};for(var i=0;i<lines.length;i++){var line=lines[i];if(line==="")continue;var m=line.match(/^([^:]+):\s*(.*)/);if(m){var key=m[1].toLowerCase(),value=m[2];if(headers[key]!==undefined){if(isArray(headers[key])){headers[key].push(value)}else{headers[key]=[headers[key],value]}}else{headers[key]=value}}else{headers[line]=true}}return headers}Response.prototype.getResponse=function(xhr){var respType=String(xhr.responseType).toLowerCase();if(respType==="blob")return xhr.responseBlob||xhr.response;if(respType==="arraybuffer")return xhr.response;return xhr.responseText};Response.prototype.getHeader=function(key){return this.headers[key.toLowerCase()]};Response.prototype.handle=function(res){if(res.readyState===2&&capable.status2){try{this.statusCode=res.status;this.headers=parseHeaders(res)}catch(err){capable.status2=false}if(capable.status2){this.emit("ready")}}else if(capable.streaming&&res.readyState===3){try{if(!this.statusCode){this.statusCode=res.status;this.headers=parseHeaders(res);this.emit("ready")}}catch(err){}try{this._emitData(res)}catch(err){capable.streaming=false}}else if(res.readyState===4){if(!this.statusCode){this.statusCode=res.status;this.emit("ready")}this._emitData(res);if(res.error){this.emit("error",this.getResponse(res))}else this.emit("end");this.emit("close")}};Response.prototype._emitData=function(res){var respBody=this.getResponse(res);if(respBody.toString().match(/ArrayBuffer/)){this.emit("data",new Uint8Array(respBody,this.offset));this.offset=respBody.byteLength;return}if(respBody.length>this.offset){this.emit("data",respBody.slice(this.offset));this.offset=respBody.length}};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"}},{stream:30,util:33}],9:[function(require,module,exports){(function(){var object=typeof exports!="undefined"?exports:this;var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function InvalidCharacterError(message){this.message=message}InvalidCharacterError.prototype=new Error;InvalidCharacterError.prototype.name="InvalidCharacterError";object.btoa||(object.btoa=function(input){for(var block,charCode,idx=0,map=chars,output="";input.charAt(idx|0)||(map="=",idx%1);output+=map.charAt(63&block>>8-idx%1*8)){charCode=input.charCodeAt(idx+=3/4);if(charCode>255){throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.")}block=block<<8|charCode}return output});object.atob||(object.atob=function(input){input=input.replace(/=+$/,"");if(input.length%4==1){throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.")}for(var bc=0,bs,buffer,idx=0,output="";buffer=input.charAt(idx++);~buffer&&(bs=bc%4?bs*64+buffer:buffer,bc++%4)?output+=String.fromCharCode(255&bs>>(-2*bc&6)):0){buffer=chars.indexOf(buffer)}return output})})()},{}],10:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],11:[function(require,module,exports){module.exports=Array.isArray||function(arr){return Object.prototype.toString.call(arr)=="[object Array]"}},{}],12:[function(require,module,exports){exports.endianness=function(){return"LE"};exports.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};exports.loadavg=function(){return[]};exports.uptime=function(){return 0};exports.freemem=function(){return Number.MAX_VALUE};exports.totalmem=function(){return Number.MAX_VALUE};exports.cpus=function(){return[]};exports.type=function(){return"Browser"};exports.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};exports.networkInterfaces=exports.getNetworkInterfaces=function(){return{}};exports.arch=function(){return"javascript"};exports.platform=function(){return"browser"};exports.tmpdir=exports.tmpDir=function(){return"/tmp"};exports.EOL="\n"},{}],13:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}if(canPost){var queue=[];window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],14:[function(require,module,exports){(function(global){(function(root){var freeExports=typeof exports=="object"&&exports;var freeModule=typeof module=="object"&&module&&module.exports==freeExports&&module;var freeGlobal=typeof global=="object"&&global;if(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal){root=freeGlobal}var punycode,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexPunycode=/^xn--/,regexNonASCII=/[^ -~]/,regexSeparators=/\x2E|\u3002|\uFF0E|\uFF61/g,errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode,key;function error(type){throw RangeError(errors[type])}function map(array,fn){var length=array.length;while(length--){array[length]=fn(array[length])}return array}function mapDomain(string,fn){return map(string.split(regexSeparators),fn).join(".")}function ucs2decode(string){var output=[],counter=0,length=string.length,value,extra;while(counter<length){value=string.charCodeAt(counter++);if(value>=55296&&value<=56319&&counter<length){extra=string.charCodeAt(counter++);if((extra&64512)==56320){output.push(((value&1023)<<10)+(extra&1023)+65536)}else{output.push(value);counter--}}else{output.push(value)}}return output}function ucs2encode(array){return map(array,function(value){var output="";if(value>65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value);return output}).join("")}function basicToDigit(codePoint){if(codePoint-48<10){return codePoint-22}if(codePoint-65<26){return codePoint-65}if(codePoint-97<26){return codePoint-97}return base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((flag!=0)<<5)}function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin)}return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var output=[],inputLength=input.length,out,i=0,n=initialN,bias=initialBias,basic,j,index,oldi,w,k,digit,t,baseMinusT;basic=input.lastIndexOf(delimiter);if(basic<0){basic=0}for(j=0;j<basic;++j){if(input.charCodeAt(j)>=128){error("not-basic")}output.push(input.charCodeAt(j))}for(index=basic>0?basic+1:0;index<inputLength;){for(oldi=i,w=1,k=base;;k+=base){if(index>=inputLength){error("invalid-input")}digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error("overflow")}i+=digit*w;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digit<t){break}baseMinusT=base-t;if(w>floor(maxInt/baseMinusT)){error("overflow")}w*=baseMinusT}out=output.length+1;bias=adapt(i-oldi,out,oldi==0);if(floor(i/out)>maxInt-n){error("overflow")}n+=floor(i/out);i%=out;output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,output=[],inputLength,handledCPCountPlusOne,baseMinusT,qMinusT;input=ucs2decode(input);inputLength=input.length;n=initialN;delta=0;bias=initialBias;for(j=0;j<inputLength;++j){currentValue=input[j];if(currentValue<128){output.push(stringFromCharCode(currentValue))}}handledCPCount=basicLength=output.length;if(basicLength){output.push(delimiter)}while(handledCPCount<inputLength){for(m=maxInt,j=0;j<inputLength;++j){currentValue=input[j];if(currentValue>=n&&currentValue<m){m=currentValue}}handledCPCountPlusOne=handledCPCount+1;if(m-n>floor((maxInt-delta)/handledCPCountPlusOne)){error("overflow")}delta+=(m-n)*handledCPCountPlusOne;n=m;for(j=0;j<inputLength;++j){currentValue=input[j];if(currentValue<n&&++delta>maxInt){error("overflow")}if(currentValue==n){for(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q<t){break}qMinusT=q-t;baseMinusT=base-t;output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0)));q=floor(qMinusT/baseMinusT)}output.push(stringFromCharCode(digitToBasic(q,0)));bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength);delta=0;++handledCPCount}}++delta;++n}return output.join("")}function toUnicode(domain){return mapDomain(domain,function(string){return regexPunycode.test(string)?decode(string.slice(4).toLowerCase()):string})}function toASCII(domain){return mapDomain(domain,function(string){return regexNonASCII.test(string)?"xn--"+encode(string):string})}punycode={version:"1.2.4",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:toASCII,toUnicode:toUnicode};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define("punycode",function(){return punycode})}else if(freeExports&&!freeExports.nodeType){if(freeModule){freeModule.exports=punycode}else{for(key in punycode){punycode.hasOwnProperty(key)&&(freeExports[key]=punycode[key])}}}else{root.punycode=punycode}})(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],15:[function(require,module,exports){"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}module.exports=function(qs,sep,eq,options){sep=sep||"&";eq=eq||"=";var obj={};if(typeof qs!=="string"||qs.length===0){return obj}var regexp=/\+/g;qs=qs.split(sep);var maxKeys=1e3;if(options&&typeof options.maxKeys==="number"){maxKeys=options.maxKeys}var len=qs.length;if(maxKeys>0&&len>maxKeys){len=maxKeys}for(var i=0;i<len;++i){var x=qs[i].replace(regexp,"%20"),idx=x.indexOf(eq),kstr,vstr,k,v;if(idx>=0){kstr=x.substr(0,idx);vstr=x.substr(idx+1)}else{kstr=x;vstr=""}k=decodeURIComponent(kstr);v=decodeURIComponent(vstr);if(!hasOwnProperty(obj,k)){obj[k]=v}else if(isArray(obj[k])){obj[k].push(v)}else{obj[k]=[obj[k],v]}}return obj};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"}},{}],16:[function(require,module,exports){"use strict";var stringifyPrimitive=function(v){switch(typeof v){case"string":return v;case"boolean":return v?"true":"false";case"number":return isFinite(v)?v:"";default:return""}};module.exports=function(obj,sep,eq,name){sep=sep||"&";eq=eq||"=";if(obj===null){obj=undefined}if(typeof obj==="object"){return map(objectKeys(obj),function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+eq;if(isArray(obj[k])){return map(obj[k],function(v){return ks+encodeURIComponent(stringifyPrimitive(v))}).join(sep)}else{return ks+encodeURIComponent(stringifyPrimitive(obj[k]))}}).join(sep)}if(!name)return"";return encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj))};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==="[object Array]"};function map(xs,f){if(xs.map)return xs.map(f);var res=[];for(var i=0;i<xs.length;i++){res.push(f(xs[i],i))}return res}var objectKeys=Object.keys||function(obj){var res=[];for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))res.push(key)}return res}},{}],17:[function(require,module,exports){"use strict";exports.decode=exports.parse=require("./decode");exports.encode=exports.stringify=require("./encode")},{"./decode":15,"./encode":16}],18:[function(require,module,exports){module.exports=require("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":19}],19:[function(require,module,exports){(function(process){module.exports=Duplex;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};var util=require("core-util-is");util.inherits=require("inherits");var Readable=require("./_stream_readable");var Writable=require("./_stream_writable");util.inherits(Duplex,Readable);forEach(objectKeys(Writable.prototype),function(method){if(!Duplex.prototype[method])Duplex.prototype[method]=Writable.prototype[method]});function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options);Writable.call(this,options);if(options&&options.readable===false)this.readable=false;if(options&&options.writable===false)this.writable=false;this.allowHalfOpen=true;if(options&&options.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}function onend(){if(this.allowHalfOpen||this._writableState.ended)return;process.nextTick(this.end.bind(this))}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}}).call(this,require("_process"))},{"./_stream_readable":21,"./_stream_writable":23,_process:13,"core-util-is":24,inherits:10}],20:[function(require,module,exports){module.exports=PassThrough;var Transform=require("./_stream_transform");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},{"./_stream_transform":22,"core-util-is":24,inherits:10}],21:[function(require,module,exports){(function(process){module.exports=Readable;var isArray=require("isarray");var Buffer=require("buffer").Buffer;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter;if(!EE.listenerCount)EE.listenerCount=function(emitter,type){return emitter.listeners(type).length};var Stream=require("stream");var util=require("core-util-is");util.inherits=require("inherits");var StringDecoder;util.inherits(Readable,Stream);function ReadableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=false;this.ended=false;this.endEmitted=false;this.reading=false;this.calledRead=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.objectMode=!!options.objectMode;this.defaultEncoding=options.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(options.encoding){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this.decoder=new StringDecoder(options.encoding);this.encoding=options.encoding}}function Readable(options){if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this);this.readable=true;Stream.call(this)}Readable.prototype.push=function(chunk,encoding){var state=this._readableState;if(typeof chunk==="string"&&!state.objectMode){encoding=encoding||state.defaultEncoding;if(encoding!==state.encoding){chunk=new Buffer(chunk,encoding);encoding=""}}return readableAddChunk(this,state,chunk,encoding,false)};Readable.prototype.unshift=function(chunk){var state=this._readableState;return readableAddChunk(this,state,chunk,"",true)};function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er){stream.emit("error",er)}else if(chunk===null||chunk===undefined){state.reading=false;if(!state.ended)onEofChunk(stream,state)}else if(state.objectMode||chunk&&chunk.length>0){if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else{if(state.decoder&&!addToFront&&!encoding)chunk=state.decoder.write(chunk);state.length+=state.objectMode?1:chunk.length;if(addToFront){state.buffer.unshift(chunk)}else{state.reading=false;state.buffer.push(chunk)}if(state.needReadable)emitReadable(stream);maybeReadMore(stream,state)}}else if(!addToFront){state.reading=false}return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.setEncoding=function(enc){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this._readableState.decoder=new StringDecoder(enc);this._readableState.encoding=enc};var MAX_HWM=8388608;function roundUpToNextPowerOf2(n){if(n>=MAX_HWM){n=MAX_HWM}else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){if(state.length===0&&state.ended)return 0;if(state.objectMode)return n===0?0:1;if(n===null||isNaN(n)){if(state.flowing&&state.buffer.length)return state.buffer[0].length;else return state.length}if(n<=0)return 0;if(n>state.highWaterMark)state.highWaterMark=roundUpToNextPowerOf2(n);if(n>state.length){if(!state.ended){state.needReadable=true;return 0}else return state.length}return n}Readable.prototype.read=function(n){var state=this._readableState;state.calledRead=true;var nOrig=n;var ret;if(typeof n!=="number"||n>0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){ret=null;if(state.length>0&&state.decoder){ret=fromList(n,state);state.length-=ret.length}if(state.length===0)endReadable(this);return ret}var doRead=state.needReadable;if(state.length-n<=state.highWaterMark)doRead=true;if(state.ended||state.reading)doRead=false;if(doRead){state.reading=true;state.sync=true;if(state.length===0)state.needReadable=true;this._read(state.highWaterMark);state.sync=false}if(doRead&&!state.reading)n=howMuchToRead(nOrig,state);if(n>0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}state.length-=n;if(state.length===0&&!state.ended)state.needReadable=true;if(state.ended&&!state.endEmitted&&state.length===0)endReadable(this);return ret};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;if(state.length>0)emitReadable(stream);else endReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(state.emittedReadable)return;state.emittedReadable=true;if(state.sync)process.nextTick(function(){emitReadable_(stream)});else emitReadable_(stream)}function emitReadable_(stream){stream.emit("readable")}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(function(){maybeReadMore_(stream,state)})}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark){stream.read(0);if(len===state.length)break;else len=state.length}state.readingMore=false}Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this;var state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1;var doEnd=(!pipeOpts||pipeOpts.end!==false)&&dest!==process.stdout&&dest!==process.stderr;var endFn=doEnd?onend:cleanup;if(state.endEmitted)process.nextTick(endFn);else src.once("end",endFn);dest.on("unpipe",onunpipe);function onunpipe(readable){if(readable!==src)return;cleanup()}function onend(){dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);function cleanup(){dest.removeListener("close",onclose);dest.removeListener("finish",onfinish);dest.removeListener("drain",ondrain);dest.removeListener("error",onerror);dest.removeListener("unpipe",onunpipe);src.removeListener("end",onend);src.removeListener("end",cleanup);if(!dest._writableState||dest._writableState.needDrain)ondrain()}function onerror(er){unpipe();dest.removeListener("error",onerror);if(EE.listenerCount(dest,"error")===0)dest.emit("error",er)}if(!dest._events||!dest._events.error)dest.on("error",onerror);else if(isArray(dest._events.error))dest._events.error.unshift(onerror);else dest._events.error=[onerror,dest._events.error];function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){this.on("readable",pipeOnReadable);state.flowing=true;process.nextTick(function(){flow(src)})}return dest};function pipeOnDrain(src){return function(){var dest=this;var state=src._readableState;state.awaitDrain--;if(state.awaitDrain===0)flow(src)}}function flow(src){var state=src._readableState;var chunk;state.awaitDrain=0;function write(dest,i,list){var written=dest.write(chunk);if(false===written){state.awaitDrain++}}while(state.pipesCount&&null!==(chunk=src.read())){if(state.pipesCount===1)write(state.pipes,0,null);else forEach(state.pipes,write);src.emit("data",chunk);if(state.awaitDrain>0)return}if(state.pipesCount===0){state.flowing=false;if(EE.listenerCount(src,"data")>0)emitDataEvents(src);return}state.ranOut=true}function pipeOnReadable(){if(this._readableState.ranOut){this._readableState.ranOut=false;flow(this)}}Readable.prototype.unpipe=function(dest){var state=this._readableState;if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;if(dest)dest.emit("unpipe",this);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;for(var i=0;i<len;i++)dests[i].emit("unpipe",this);return this}var i=indexOf(state.pipes,dest);if(i===-1)return this;state.pipes.splice(i,1);state.pipesCount-=1;if(state.pipesCount===1)state.pipes=state.pipes[0];dest.emit("unpipe",this);return this};Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if(ev==="data"&&!this._readableState.flowing)emitDataEvents(this);if(ev==="readable"&&this.readable){var state=this._readableState;if(!state.readableListening){state.readableListening=true;state.emittedReadable=false;state.needReadable=true;if(!state.reading){this.read(0)}else if(state.length){emitReadable(this,state)}}}return res};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.resume=function(){emitDataEvents(this);this.read(0);this.emit("resume")};Readable.prototype.pause=function(){emitDataEvents(this,true);this.emit("pause")};function emitDataEvents(stream,startPaused){var state=stream._readableState;if(state.flowing){throw new Error("Cannot switch to old mode now.")}var paused=startPaused||false;var readable=false;stream.readable=true;stream.pipe=Stream.prototype.pipe;stream.on=stream.addListener=Stream.prototype.on;stream.on("readable",function(){readable=true;var c;while(!paused&&null!==(c=stream.read()))stream.emit("data",c);if(c===null){readable=false;stream._readableState.needReadable=true}});stream.pause=function(){paused=true;this.emit("pause")};stream.resume=function(){paused=false;if(readable)process.nextTick(function(){stream.emit("readable")});else this.read(0);this.emit("resume")};stream.emit("readable")}Readable.prototype.wrap=function(stream){var state=this._readableState;var paused=false;var self=this;stream.on("end",function(){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length)self.push(chunk)}self.push(null)});stream.on("data",function(chunk){if(state.decoder)chunk=state.decoder.write(chunk);if(state.objectMode&&(chunk===null||chunk===undefined))return;else if(!state.objectMode&&(!chunk||!chunk.length))return;var ret=self.push(chunk);if(!ret){paused=true;stream.pause()}});for(var i in stream){if(typeof stream[i]==="function"&&typeof this[i]==="undefined"){this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i)}}var events=["error","close","destroy","pause","resume"];forEach(events,function(ev){stream.on(ev,self.emit.bind(self,ev))});self._read=function(n){if(paused){paused=false;stream.resume()}};return self};Readable._fromList=fromList;function fromList(n,state){var list=state.buffer;var length=state.length;var stringMode=!!state.decoder;var objectMode=!!state.objectMode;var ret;if(list.length===0)return null;if(length===0)ret=null;else if(objectMode)ret=list.shift();else if(!n||n>=length){if(stringMode)ret=list.join("");else ret=Buffer.concat(list,length);list.length=0}else{if(n<list[0].length){var buf=list[0];ret=buf.slice(0,n);list[0]=buf.slice(n)}else if(n===list[0].length){ret=list.shift()}else{if(stringMode)ret="";else ret=new Buffer(n);var c=0;for(var i=0,l=list.length;i<l&&c<n;i++){var buf=list[0];var cpy=Math.min(n-c,buf.length);if(stringMode)ret+=buf.slice(0,cpy);else buf.copy(ret,c,0,cpy);if(cpy<buf.length)list[0]=buf.slice(cpy);else list.shift();c+=cpy}}}return ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error("endReadable called on non-empty stream");if(!state.endEmitted&&state.calledRead){state.ended=true;process.nextTick(function(){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}})}}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i}return-1}}).call(this,require("_process"))},{_process:13,buffer:2,"core-util-is":24,events:5,inherits:10,isarray:11,stream:30,"string_decoder/":25}],22:[function(require,module,exports){module.exports=Transform;var Duplex=require("./_stream_duplex");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(Transform,Duplex);function TransformState(options,stream){this.afterTransform=function(er,data){return afterTransform(stream,er,data)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function afterTransform(stream,er,data){var ts=stream._transformState;ts.transforming=false;var cb=ts.writecb;if(!cb)return stream.emit("error",new Error("no writecb in Transform class"));ts.writechunk=null;ts.writecb=null;if(data!==null&&data!==undefined)stream.push(data);if(cb)cb(er);var rs=stream._readableState;rs.reading=false;if(rs.needReadable||rs.length<rs.highWaterMark){stream._read(rs.highWaterMark)}}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options);var ts=this._transformState=new TransformState(options,this);var stream=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("finish",function(){if("function"===typeof this._flush)this._flush(function(er){done(stream,er)});else done(stream)})}Transform.prototype.push=function(chunk,encoding){this._transformState.needTransform=false;return Duplex.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;ts.writecb=cb;ts.writechunk=chunk;ts.writeencoding=encoding;if(!ts.transforming){var rs=this._readableState;if(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)this._read(rs.highWaterMark)}};Transform.prototype._read=function(n){var ts=this._transformState;if(ts.writechunk!==null&&ts.writecb&&!ts.transforming){ts.transforming=true;this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)}else{ts.needTransform=true}};function done(stream,er){if(er)return stream.emit("error",er);var ws=stream._writableState;var rs=stream._readableState;var ts=stream._transformState;if(ws.length)throw new Error("calling transform done when ws.length != 0");if(ts.transforming)throw new Error("calling transform done when still transforming");return stream.push(null)}},{"./_stream_duplex":19,"core-util-is":24,inherits:10}],23:[function(require,module,exports){(function(process){module.exports=Writable;var Buffer=require("buffer").Buffer;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var Stream=require("stream");util.inherits(Writable,Stream);function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb}function WritableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.objectMode=!!options.objectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.buffer=[];this.errorEmitted=false}function Writable(options){var Duplex=require("./_stream_duplex");if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);this.writable=true;Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))};function writeAfterEnd(stream,state,cb){var er=new Error("write after end");stream.emit("error",er);process.nextTick(function(){cb(er)})}function validChunk(stream,state,chunk,cb){var valid=true;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){var er=new TypeError("Invalid non-string/buffer chunk");stream.emit("error",er);process.nextTick(function(){cb(er)});valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=function(){};if(state.ended)writeAfterEnd(this,state,cb);else if(validChunk(this,state,chunk,cb))ret=writeOrBuffer(this,state,chunk,encoding,cb);
return ret};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=new Buffer(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(!ret)state.needDrain=true;if(state.writing)state.buffer.push(new WriteReq(chunk,encoding,cb));else doWrite(stream,state,len,chunk,encoding,cb);return ret}function doWrite(stream,state,len,chunk,encoding,cb){state.writelen=len;state.writecb=cb;state.writing=true;state.sync=true;stream._write(chunk,encoding,state.onwrite);state.sync=false}function onwriteError(stream,state,sync,er,cb){if(sync)process.nextTick(function(){cb(er)});else cb(er);stream._writableState.errorEmitted=true;stream.emit("error",er)}function onwriteStateUpdate(state){state.writing=false;state.writecb=null;state.length-=state.writelen;state.writelen=0}function onwrite(stream,er){var state=stream._writableState;var sync=state.sync;var cb=state.writecb;onwriteStateUpdate(state);if(er)onwriteError(stream,state,sync,er,cb);else{var finished=needFinish(stream,state);if(!finished&&!state.bufferProcessing&&state.buffer.length)clearBuffer(stream,state);if(sync){process.nextTick(function(){afterWrite(stream,state,finished,cb)})}else{afterWrite(stream,state,finished,cb)}}}function afterWrite(stream,state,finished,cb){if(!finished)onwriteDrain(stream,state);cb();if(finished)finishMaybe(stream,state)}function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit("drain")}}function clearBuffer(stream,state){state.bufferProcessing=true;for(var c=0;c<state.buffer.length;c++){var entry=state.buffer[c];var chunk=entry.chunk;var encoding=entry.encoding;var cb=entry.callback;var len=state.objectMode?1:chunk.length;doWrite(stream,state,len,chunk,encoding,cb);if(state.writing){c++;break}}state.bufferProcessing=false;if(c<state.buffer.length)state.buffer=state.buffer.slice(c);else state.buffer.length=0}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("not implemented"))};Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;if(typeof chunk==="function"){cb=chunk;chunk=null;encoding=null}else if(typeof encoding==="function"){cb=encoding;encoding=null}if(typeof chunk!=="undefined"&&chunk!==null)this.write(chunk,encoding);if(!state.ending&&!state.finished)endWritable(this,state,cb)};function needFinish(stream,state){return state.ending&&state.length===0&&!state.finished&&!state.writing}function finishMaybe(stream,state){var need=needFinish(stream,state);if(need){state.finished=true;stream.emit("finish")}return need}function endWritable(stream,state,cb){state.ending=true;finishMaybe(stream,state);if(cb){if(state.finished)process.nextTick(cb);else stream.once("finish",cb)}state.ended=true}}).call(this,require("_process"))},{"./_stream_duplex":19,_process:13,buffer:2,"core-util-is":24,inherits:10,stream:30}],24:[function(require,module,exports){(function(Buffer){function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;function isBuffer(arg){return Buffer.isBuffer(arg)}exports.isBuffer=isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}}).call(this,require("buffer").Buffer)},{buffer:2}],25:[function(require,module,exports){var Buffer=require("buffer").Buffer;var isBufferEncoding=Buffer.isEncoding||function(encoding){switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function assertEncoding(encoding){if(encoding&&!isBufferEncoding(encoding)){throw new Error("Unknown encoding: "+encoding)}}var StringDecoder=exports.StringDecoder=function(encoding){this.encoding=(encoding||"utf8").toLowerCase().replace(/[-_]/,"");assertEncoding(encoding);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=base64DetectIncompleteChar;break;default:this.write=passThroughWrite;return}this.charBuffer=new Buffer(6);this.charReceived=0;this.charLength=0};StringDecoder.prototype.write=function(buffer){var charStr="";var offset=0;while(this.charLength){var i=buffer.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;buffer.copy(this.charBuffer,this.charReceived,offset,i);this.charReceived+=i-offset;offset=i;if(this.charReceived<this.charLength){return""}charStr=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var charCode=charStr.charCodeAt(charStr.length-1);if(charCode>=55296&&charCode<=56319){this.charLength+=this.surrogateSize;charStr="";continue}this.charReceived=this.charLength=0;if(i==buffer.length)return charStr;buffer=buffer.slice(i,buffer.length);break}var lenIncomplete=this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){buffer.copy(this.charBuffer,0,buffer.length-lenIncomplete,end);this.charReceived=lenIncomplete;end-=lenIncomplete}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);this.charBuffer.write(charStr.charAt(charStr.length-1),this.encoding);return charStr.substring(0,end)}return charStr};StringDecoder.prototype.detectIncompleteChar=function(buffer){var i=buffer.length>=3?3:buffer.length;for(;i>0;i--){var c=buffer[buffer.length-i];if(i==1&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}return i};StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res};function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){var incomplete=this.charReceived=buffer.length%2;this.charLength=incomplete?2:0;return incomplete}function base64DetectIncompleteChar(buffer){var incomplete=this.charReceived=buffer.length%3;this.charLength=incomplete?3:0;return incomplete}},{buffer:2}],26:[function(require,module,exports){module.exports=require("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":20}],27:[function(require,module,exports){exports=module.exports=require("./lib/_stream_readable.js");exports.Readable=exports;exports.Writable=require("./lib/_stream_writable.js");exports.Duplex=require("./lib/_stream_duplex.js");exports.Transform=require("./lib/_stream_transform.js");exports.PassThrough=require("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":19,"./lib/_stream_passthrough.js":20,"./lib/_stream_readable.js":21,"./lib/_stream_transform.js":22,"./lib/_stream_writable.js":23}],28:[function(require,module,exports){module.exports=require("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":22}],29:[function(require,module,exports){module.exports=require("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":23}],30:[function(require,module,exports){module.exports=Stream;var EE=require("events").EventEmitter;var inherits=require("inherits");inherits(Stream,EE);Stream.Readable=require("readable-stream/readable.js");Stream.Writable=require("readable-stream/writable.js");Stream.Duplex=require("readable-stream/duplex.js");Stream.Transform=require("readable-stream/transform.js");Stream.PassThrough=require("readable-stream/passthrough.js");Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(dest,options){var source=this;function ondata(chunk){if(dest.writable){if(false===dest.write(chunk)&&source.pause){source.pause()}}}source.on("data",ondata);function ondrain(){if(source.readable&&source.resume){source.resume()}}dest.on("drain",ondrain);if(!dest._isStdio&&(!options||options.end!==false)){source.on("end",onend);source.on("close",onclose)}var didOnEnd=false;function onend(){if(didOnEnd)return;didOnEnd=true;dest.end()}function onclose(){if(didOnEnd)return;didOnEnd=true;if(typeof dest.destroy==="function")dest.destroy()}function onerror(er){cleanup();if(EE.listenerCount(this,"error")===0){throw er}}source.on("error",onerror);dest.on("error",onerror);function cleanup(){source.removeListener("data",ondata);dest.removeListener("drain",ondrain);source.removeListener("end",onend);source.removeListener("close",onclose);source.removeListener("error",onerror);dest.removeListener("error",onerror);source.removeListener("end",cleanup);source.removeListener("close",cleanup);dest.removeListener("close",cleanup)}source.on("end",cleanup);source.on("close",cleanup);dest.on("close",cleanup);dest.emit("pipe",source);return dest}},{events:5,inherits:10,"readable-stream/duplex.js":18,"readable-stream/passthrough.js":26,"readable-stream/readable.js":27,"readable-stream/transform.js":28,"readable-stream/writable.js":29}],31:[function(require,module,exports){var punycode=require("punycode");exports.parse=urlParse;exports.resolve=urlResolve;exports.resolveObject=urlResolveObject;exports.format=urlFormat;exports.Url=Url;function Url(){this.protocol=null;this.slashes=null;this.auth=null;this.host=null;this.port=null;this.hostname=null;this.hash=null;this.search=null;this.query=null;this.pathname=null;this.path=null;this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,delims=["<",">",'"',"`"," ","\r","\n"," "],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:true,"javascript:":true},hostlessProtocol={javascript:true,"javascript:":true},slashedProtocol={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},querystring=require("querystring");function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&isObject(url)&&url instanceof Url)return url;var u=new Url;u.parse(url,parseQueryString,slashesDenoteHost);return u}Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!isString(url)){throw new TypeError("Parameter 'url' must be a string, not "+typeof url)}var rest=url;rest=rest.trim();var proto=protocolPattern.exec(rest);if(proto){proto=proto[0];var lowerProto=proto.toLowerCase();this.protocol=lowerProto;rest=rest.substr(proto.length)}if(slashesDenoteHost||proto||rest.match(/^\/\/[^@\/]+@[^@\/]+/)){var slashes=rest.substr(0,2)==="//";if(slashes&&!(proto&&hostlessProtocol[proto])){rest=rest.substr(2);this.slashes=true}}if(!hostlessProtocol[proto]&&(slashes||proto&&!slashedProtocol[proto])){var hostEnd=-1;for(var i=0;i<hostEndingChars.length;i++){var hec=rest.indexOf(hostEndingChars[i]);if(hec!==-1&&(hostEnd===-1||hec<hostEnd))hostEnd=hec}var auth,atSign;if(hostEnd===-1){atSign=rest.lastIndexOf("@")}else{atSign=rest.lastIndexOf("@",hostEnd)}if(atSign!==-1){auth=rest.slice(0,atSign);rest=rest.slice(atSign+1);this.auth=decodeURIComponent(auth)}hostEnd=-1;for(var i=0;i<nonHostChars.length;i++){var hec=rest.indexOf(nonHostChars[i]);if(hec!==-1&&(hostEnd===-1||hec<hostEnd))hostEnd=hec}if(hostEnd===-1)hostEnd=rest.length;this.host=rest.slice(0,hostEnd);rest=rest.slice(hostEnd);this.parseHost();this.hostname=this.hostname||"";var ipv6Hostname=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ipv6Hostname){var hostparts=this.hostname.split(/\./);for(var i=0,l=hostparts.length;i<l;i++){var part=hostparts[i];if(!part)continue;if(!part.match(hostnamePartPattern)){var newpart="";for(var j=0,k=part.length;j<k;j++){if(part.charCodeAt(j)>127){newpart+="x"}else{newpart+=part[j]}}if(!newpart.match(hostnamePartPattern)){var validParts=hostparts.slice(0,i);var notHost=hostparts.slice(i+1);var bit=part.match(hostnamePartStart);if(bit){validParts.push(bit[1]);notHost.unshift(bit[2])}if(notHost.length){rest="/"+notHost.join(".")+rest}this.hostname=validParts.join(".");break}}}}if(this.hostname.length>hostnameMaxLen){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!ipv6Hostname){var domainArray=this.hostname.split(".");var newOut=[];for(var i=0;i<domainArray.length;++i){var s=domainArray[i];newOut.push(s.match(/[^A-Za-z0-9_-]/)?"xn--"+punycode.encode(s):s)}this.hostname=newOut.join(".")}var p=this.port?":"+this.port:"";var h=this.hostname||"";this.host=h+p;this.href+=this.host;if(ipv6Hostname){this.hostname=this.hostname.substr(1,this.hostname.length-2);if(rest[0]!=="/"){rest="/"+rest}}}if(!unsafeProtocol[lowerProto]){for(var i=0,l=autoEscape.length;i<l;i++){var ae=autoEscape[i];var esc=encodeURIComponent(ae);if(esc===ae){esc=escape(ae)}rest=rest.split(ae).join(esc)}}var hash=rest.indexOf("#");if(hash!==-1){this.hash=rest.substr(hash);rest=rest.slice(0,hash)}var qm=rest.indexOf("?");if(qm!==-1){this.search=rest.substr(qm);this.query=rest.substr(qm+1);if(parseQueryString){this.query=querystring.parse(this.query)}rest=rest.slice(0,qm)}else if(parseQueryString){this.search="";this.query={}}if(rest)this.pathname=rest;if(slashedProtocol[lowerProto]&&this.hostname&&!this.pathname){this.pathname="/"}if(this.pathname||this.search){var p=this.pathname||"";var s=this.search||"";this.path=p+s}this.href=this.format();return this};function urlFormat(obj){if(isString(obj))obj=urlParse(obj);if(!(obj instanceof Url))return Url.prototype.format.call(obj);return obj.format()}Url.prototype.format=function(){var auth=this.auth||"";if(auth){auth=encodeURIComponent(auth);auth=auth.replace(/%3A/i,":");auth+="@"}var protocol=this.protocol||"",pathname=this.pathname||"",hash=this.hash||"",host=false,query="";if(this.host){host=auth+this.host}else if(this.hostname){host=auth+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]");if(this.port){host+=":"+this.port}}if(this.query&&isObject(this.query)&&Object.keys(this.query).length){query=querystring.stringify(this.query)}var search=this.search||query&&"?"+query||"";if(protocol&&protocol.substr(-1)!==":")protocol+=":";if(this.slashes||(!protocol||slashedProtocol[protocol])&&host!==false){host="//"+(host||"");if(pathname&&pathname.charAt(0)!=="/")pathname="/"+pathname}else if(!host){host=""}if(hash&&hash.charAt(0)!=="#")hash="#"+hash;if(search&&search.charAt(0)!=="?")search="?"+search;pathname=pathname.replace(/[?#]/g,function(match){return encodeURIComponent(match)});search=search.replace("#","%23");return protocol+host+pathname+search+hash};function urlResolve(source,relative){return urlParse(source,false,true).resolve(relative)}Url.prototype.resolve=function(relative){return this.resolveObject(urlParse(relative,false,true)).format()};function urlResolveObject(source,relative){if(!source)return relative;return urlParse(source,false,true).resolveObject(relative)}Url.prototype.resolveObject=function(relative){if(isString(relative)){var rel=new Url;rel.parse(relative,false,true);relative=rel}var result=new Url;Object.keys(this).forEach(function(k){result[k]=this[k]},this);result.hash=relative.hash;if(relative.href===""){result.href=result.format();return result}if(relative.slashes&&!relative.protocol){Object.keys(relative).forEach(function(k){if(k!=="protocol")result[k]=relative[k]});if(slashedProtocol[result.protocol]&&result.hostname&&!result.pathname){result.path=result.pathname="/"}result.href=result.format();return result}if(relative.protocol&&relative.protocol!==result.protocol){if(!slashedProtocol[relative.protocol]){Object.keys(relative).forEach(function(k){result[k]=relative[k]});result.href=result.format();return result}result.protocol=relative.protocol;if(!relative.host&&!hostlessProtocol[relative.protocol]){var relPath=(relative.pathname||"").split("/");while(relPath.length&&!(relative.host=relPath.shift()));if(!relative.host)relative.host="";if(!relative.hostname)relative.hostname="";if(relPath[0]!=="")relPath.unshift("");if(relPath.length<2)relPath.unshift("");result.pathname=relPath.join("/")}else{result.pathname=relative.pathname}result.search=relative.search;result.query=relative.query;result.host=relative.host||"";result.auth=relative.auth;result.hostname=relative.hostname||relative.host;result.port=relative.port;if(result.pathname||result.search){var p=result.pathname||"";var s=result.search||"";result.path=p+s}result.slashes=result.slashes||relative.slashes;result.href=result.format();return result}var isSourceAbs=result.pathname&&result.pathname.charAt(0)==="/",isRelAbs=relative.host||relative.pathname&&relative.pathname.charAt(0)==="/",mustEndAbs=isRelAbs||isSourceAbs||result.host&&relative.pathname,removeAllDots=mustEndAbs,srcPath=result.pathname&&result.pathname.split("/")||[],relPath=relative.pathname&&relative.pathname.split("/")||[],psychotic=result.protocol&&!slashedProtocol[result.protocol];if(psychotic){result.hostname="";result.port=null;if(result.host){if(srcPath[0]==="")srcPath[0]=result.host;else srcPath.unshift(result.host)}result.host="";if(relative.protocol){relative.hostname=null;relative.port=null;if(relative.host){if(relPath[0]==="")relPath[0]=relative.host;else relPath.unshift(relative.host)}relative.host=null}mustEndAbs=mustEndAbs&&(relPath[0]===""||srcPath[0]==="")}if(isRelAbs){result.host=relative.host||relative.host===""?relative.host:result.host;result.hostname=relative.hostname||relative.hostname===""?relative.hostname:result.hostname;result.search=relative.search;result.query=relative.query;srcPath=relPath}else if(relPath.length){if(!srcPath)srcPath=[];srcPath.pop();srcPath=srcPath.concat(relPath);result.search=relative.search;result.query=relative.query}else if(!isNullOrUndefined(relative.search)){if(psychotic){result.hostname=result.host=srcPath.shift();var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift()}}result.search=relative.search;result.query=relative.query;if(!isNull(result.pathname)||!isNull(result.search)){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.href=result.format();return result}if(!srcPath.length){result.pathname=null;if(result.search){result.path="/"+result.search}else{result.path=null}result.href=result.format();return result}var last=srcPath.slice(-1)[0];var hasTrailingSlash=(result.host||relative.host)&&(last==="."||last==="..")||last==="";var up=0;for(var i=srcPath.length;i>=0;i--){last=srcPath[i];if(last=="."){srcPath.splice(i,1)}else if(last===".."){srcPath.splice(i,1);up++}else if(up){srcPath.splice(i,1);up--}}if(!mustEndAbs&&!removeAllDots){for(;up--;up){srcPath.unshift("..")}}if(mustEndAbs&&srcPath[0]!==""&&(!srcPath[0]||srcPath[0].charAt(0)!=="/")){srcPath.unshift("")}if(hasTrailingSlash&&srcPath.join("/").substr(-1)!=="/"){srcPath.push("")}var isAbsolute=srcPath[0]===""||srcPath[0]&&srcPath[0].charAt(0)==="/";if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift()}}mustEndAbs=mustEndAbs||result.host&&srcPath.length;if(mustEndAbs&&!isAbsolute){srcPath.unshift("")}if(!srcPath.length){result.pathname=null;result.path=null}else{result.pathname=srcPath.join("/")}if(!isNull(result.pathname)||!isNull(result.search)){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host);if(port){port=port[0];if(port!==":"){this.port=port.substr(1)}host=host.substr(0,host.length-port.length)}if(host)this.hostname=host};function isString(arg){return typeof arg==="string"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isNull(arg){return arg===null}function isNullOrUndefined(arg){return arg==null}},{punycode:14,querystring:17}],32:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],33:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":32,_process:13,inherits:10}],34:[function(require,module,exports){(function(context){function Lazy(source){if(source instanceof Array){return new ArrayWrapper(source)}else if(typeof source==="string"){return new StringWrapper(source)}else if(source instanceof Sequence){return source}if(Lazy.extensions){var extensions=Lazy.extensions,length=extensions.length,result;while(!result&&length--){result=extensions[length](source)}if(result){return result}}return new ObjectWrapper(source)}Lazy.VERSION="0.3.2";Lazy.noop=function noop(){};Lazy.identity=function identity(x){return x};Lazy.strict=function strict(){function StrictLazy(source){if(source==null){throw"You cannot wrap null or undefined using Lazy."}if(typeof source==="number"||typeof source==="boolean"){throw"You cannot wrap primitive values using Lazy."}return Lazy(source)
}Lazy(Lazy).each(function(property,name){StrictLazy[name]=property});return StrictLazy};function Sequence(){}Sequence.define=function define(methodName,overrides){if(!overrides||!overrides.getIterator&&!overrides.each){throw"A custom sequence must implement *at least* getIterator or each!"}return defineSequenceType(Sequence,methodName,overrides)};Sequence.prototype.size=function size(){return this.getIndex().length()};Sequence.prototype.getIterator=function getIterator(){return new Iterator(this)};Sequence.prototype.root=function root(){return this.parent.root()};Sequence.prototype.value=function value(){return this.toArray()};Sequence.prototype.apply=function apply(source){var root=this.root(),previousSource=root.source,result;try{root.source=source;result=this.value()}finally{root.source=previousSource}return result};function Iterator(sequence){this.sequence=sequence;this.index=-1}Iterator.prototype.current=function current(){return this.cachedIndex&&this.cachedIndex.get(this.index)};Iterator.prototype.moveNext=function moveNext(){var cachedIndex=this.cachedIndex;if(!cachedIndex){cachedIndex=this.cachedIndex=this.sequence.getIndex()}if(this.index>=cachedIndex.length()-1){return false}++this.index;return true};Sequence.prototype.toArray=function toArray(){return this.reduce(function(arr,element){arr.push(element);return arr},[])};Sequence.prototype.getIndex=function getIndex(){if(!this.cachedIndex){this.cachedIndex=new ArrayWrapper(this.toArray())}return this.cachedIndex};Sequence.prototype.memoize=function memoize(){return new MemoizedSequence(this)};function MemoizedSequence(parent){this.parent=parent}Sequence.prototype.toObject=function toObject(){return this.reduce(function(object,pair){object[pair[0]]=pair[1];return object},{})};Sequence.prototype.each=function each(fn){var iterator=this.getIterator(),i=-1;while(iterator.moveNext()){if(fn(iterator.current(),++i)===false){return false}}return true};Sequence.prototype.forEach=function forEach(fn){return this.each(fn)};Sequence.prototype.map=function map(mapFn){return new MappedSequence(this,createCallback(mapFn))};Sequence.prototype.collect=function collect(mapFn){return this.map(mapFn)};function MappedSequence(parent,mapFn){this.parent=parent;this.mapFn=mapFn}MappedSequence.prototype=new Sequence;MappedSequence.prototype.getIterator=function getIterator(){return new MappingIterator(this.parent,this.mapFn)};MappedSequence.prototype.each=function each(fn){var mapFn=this.mapFn;return this.parent.each(function(e,i){return fn(mapFn(e,i),i)})};function MappingIterator(sequence,mapFn){this.iterator=sequence.getIterator();this.mapFn=mapFn;this.index=-1}MappingIterator.prototype.current=function current(){return this.mapFn(this.iterator.current(),this.index)};MappingIterator.prototype.moveNext=function moveNext(){if(this.iterator.moveNext()){++this.index;return true}return false};Sequence.prototype.pluck=function pluck(property){return this.map(property)};Sequence.prototype.invoke=function invoke(methodName){return this.map(function(e){return e[methodName]()})};Sequence.prototype.filter=function filter(filterFn){return new FilteredSequence(this,createCallback(filterFn))};Sequence.prototype.select=function select(filterFn){return this.filter(filterFn)};function FilteredSequence(parent,filterFn){this.parent=parent;this.filterFn=filterFn}FilteredSequence.prototype=new Sequence;FilteredSequence.prototype.getIterator=function getIterator(){return new FilteringIterator(this.parent,this.filterFn)};FilteredSequence.prototype.each=function each(fn){var filterFn=this.filterFn;return this.parent.each(function(e,i){if(filterFn(e,i)){return fn(e,i)}})};FilteredSequence.prototype.reverse=function reverse(){return this.parent.reverse().filter(this.filterFn)};function FilteringIterator(sequence,filterFn){this.iterator=sequence.getIterator();this.filterFn=filterFn;this.index=0}FilteringIterator.prototype.current=function current(){return this.value};FilteringIterator.prototype.moveNext=function moveNext(){var iterator=this.iterator,filterFn=this.filterFn,value;while(iterator.moveNext()){value=iterator.current();if(filterFn(value,this.index++)){this.value=value;return true}}this.value=undefined;return false};Sequence.prototype.reject=function reject(rejectFn){rejectFn=createCallback(rejectFn);return this.filter(function(e){return!rejectFn(e)})};Sequence.prototype.ofType=function ofType(type){return this.filter(function(e){return typeof e===type})};Sequence.prototype.where=function where(properties){return this.filter(properties)};Sequence.prototype.reverse=function reverse(){return new ReversedSequence(this)};function ReversedSequence(parent){this.parent=parent}ReversedSequence.prototype=new Sequence;ReversedSequence.prototype.getIterator=function getIterator(){return new ReversedIterator(this.parent)};function ReversedIterator(sequence){this.sequence=sequence}ReversedIterator.prototype.current=function current(){return this.sequence.getIndex().get(this.index)};ReversedIterator.prototype.moveNext=function moveNext(){var indexed=this.sequence.getIndex(),length=indexed.length();if(typeof this.index==="undefined"){this.index=length}return--this.index>=0};Sequence.prototype.concat=function concat(var_args){return new ConcatenatedSequence(this,arraySlice.call(arguments,0))};function ConcatenatedSequence(parent,arrays){this.parent=parent;this.arrays=arrays}ConcatenatedSequence.prototype=new Sequence;ConcatenatedSequence.prototype.each=function each(fn){var done=false,i=0;this.parent.each(function(e){if(fn(e,i++)===false){done=true;return false}});if(!done){Lazy(this.arrays).flatten().each(function(e){if(fn(e,i++)===false){return false}})}};Sequence.prototype.first=function first(count){if(typeof count==="undefined"){return getFirst(this)}return new TakeSequence(this,count)};Sequence.prototype.head=Sequence.prototype.take=function(count){return this.first(count)};function TakeSequence(parent,count){this.parent=parent;this.count=count}TakeSequence.prototype=new Sequence;TakeSequence.prototype.getIterator=function getIterator(){return new TakeIterator(this.parent,this.count)};TakeSequence.prototype.each=function each(fn){var count=this.count,i=0;this.parent.each(function(e){var result;if(i<count){result=fn(e,i)}if(++i>=count){return false}return result})};function TakeIterator(sequence,count){this.iterator=sequence.getIterator();this.count=count}TakeIterator.prototype.current=function current(){return this.iterator.current()};TakeIterator.prototype.moveNext=function moveNext(){return--this.count>=0&&this.iterator.moveNext()};Sequence.prototype.takeWhile=function takeWhile(predicate){return new TakeWhileSequence(this,predicate)};function TakeWhileSequence(parent,predicate){this.parent=parent;this.predicate=predicate}TakeWhileSequence.prototype=new Sequence;TakeWhileSequence.prototype.each=function each(fn){var predicate=this.predicate;this.parent.each(function(e){return predicate(e)&&fn(e)})};Sequence.prototype.initial=function initial(count){if(typeof count==="undefined"){count=1}return this.take(this.getIndex().length()-count)};Sequence.prototype.last=function last(count){if(typeof count==="undefined"){return this.reverse().first()}return this.reverse().take(count).reverse()};Sequence.prototype.findWhere=function findWhere(properties){return this.where(properties).first()};Sequence.prototype.rest=function rest(count){return new DropSequence(this,count)};Sequence.prototype.skip=Sequence.prototype.tail=Sequence.prototype.drop=function drop(count){return this.rest(count)};function DropSequence(parent,count){this.parent=parent;this.count=typeof count==="number"?count:1}DropSequence.prototype=new Sequence;DropSequence.prototype.each=function each(fn){var count=this.count,dropped=0,i=0;this.parent.each(function(e){if(dropped++<count){return}return fn(e,i++)})};Sequence.prototype.dropWhile=function dropWhile(predicate){return new DropWhileSequence(this,predicate)};Sequence.prototype.skipWhile=function skipWhile(predicate){return this.dropWhile(predicate)};function DropWhileSequence(parent,predicate){this.parent=parent;this.predicate=predicate}DropWhileSequence.prototype=new Sequence;DropWhileSequence.prototype.each=function each(fn){var predicate=this.predicate,done=false;this.parent.each(function(e){if(!done){if(predicate(e)){return}done=true}return fn(e)})};Sequence.prototype.sortBy=function sortBy(sortFn){return new SortedSequence(this,sortFn)};function SortedSequence(parent,sortFn){this.parent=parent;this.sortFn=sortFn}SortedSequence.prototype=new Sequence;SortedSequence.prototype.each=function each(fn){var sortFn=createCallback(this.sortFn),sorted=this.parent.toArray(),i=-1;sorted.sort(function(x,y){return compare(x,y,sortFn)});return forEach(sorted,fn)};Sequence.prototype.groupBy=function groupBy(keyFn){return new GroupedSequence(this,keyFn)};function GroupedSequence(parent,keyFn){this.parent=parent;this.keyFn=keyFn}Sequence.prototype.countBy=function countBy(keyFn){return new CountedSequence(this,keyFn)};function CountedSequence(parent,keyFn){this.parent=parent;this.keyFn=keyFn}Sequence.prototype.uniq=function uniq(keyFn){return new UniqueSequence(this,keyFn)};Sequence.prototype.unique=function unique(keyFn){return this.uniq(keyFn)};function UniqueSequence(parent,keyFn){this.parent=parent;this.keyFn=keyFn}UniqueSequence.prototype=new Sequence;UniqueSequence.prototype.each=function each(fn){var cache=new Set,keyFn=this.keyFn,i=0;if(keyFn){keyFn=createCallback(keyFn);return this.parent.each(function(e){if(cache.add(keyFn(e))){return fn(e,i++)}})}else{return this.parent.each(function(e){if(cache.add(e)){return fn(e,i++)}})}};Sequence.prototype.zip=function zip(var_args){if(arguments.length===1){return new SimpleZippedSequence(this,var_args)}else{return new ZippedSequence(this,arraySlice.call(arguments,0))}};function ZippedSequence(parent,arrays){this.parent=parent;this.arrays=arrays}ZippedSequence.prototype=new Sequence;ZippedSequence.prototype.each=function each(fn){var arrays=this.arrays,i=0;this.parent.each(function(e){var group=[e];for(var j=0;j<arrays.length;++j){if(arrays[j].length>i){group.push(arrays[j][i])}}return fn(group,i++)})};Sequence.prototype.shuffle=function shuffle(){return new ShuffledSequence(this)};function ShuffledSequence(parent){this.parent=parent}ShuffledSequence.prototype=new Sequence;ShuffledSequence.prototype.each=function each(fn){var shuffled=this.parent.toArray(),floor=Math.floor,random=Math.random,j=0;for(var i=shuffled.length-1;i>0;--i){swap(shuffled,i,floor(random()*i)+1);if(fn(shuffled[i],j++)===false){return}}fn(shuffled[0],j)};Sequence.prototype.flatten=function flatten(){return new FlattenedSequence(this)};function FlattenedSequence(parent){this.parent=parent}FlattenedSequence.prototype=new Sequence;FlattenedSequence.prototype.each=function each(fn){var index=0;return this.parent.each(function recurseVisitor(e){if(e instanceof Array){return forEach(e,recurseVisitor)}if(e instanceof Sequence){return e.each(recurseVisitor)}return fn(e,index++)})};Sequence.prototype.compact=function compact(){return this.filter(function(e){return!!e})};Sequence.prototype.without=function without(var_args){return new WithoutSequence(this,arraySlice.call(arguments,0))};Sequence.prototype.difference=function difference(var_args){return this.without.apply(this,arguments)};function WithoutSequence(parent,values){this.parent=parent;this.values=values}WithoutSequence.prototype=new Sequence;WithoutSequence.prototype.each=function each(fn){var set=createSet(this.values),i=0;return this.parent.each(function(e){if(!set.contains(e)){return fn(e,i++)}})};Sequence.prototype.union=function union(var_args){return this.concat(var_args).uniq()};Sequence.prototype.intersection=function intersection(var_args){if(arguments.length===1&&arguments[0]instanceof Array){return new SimpleIntersectionSequence(this,var_args)}else{return new IntersectionSequence(this,arraySlice.call(arguments,0))}};function IntersectionSequence(parent,arrays){this.parent=parent;this.arrays=arrays}IntersectionSequence.prototype=new Sequence;IntersectionSequence.prototype.each=function each(fn){var sets=Lazy(this.arrays).map(function(values){return new UniqueMemoizer(Lazy(values).getIterator())});var setIterator=new UniqueMemoizer(sets.getIterator()),i=0;return this.parent.each(function(e){var includedInAll=true;setIterator.each(function(set){if(!set.contains(e)){includedInAll=false;return false}});if(includedInAll){return fn(e,i++)}})};function UniqueMemoizer(iterator){this.iterator=iterator;this.set=new Set;this.memo=[];this.currentValue=undefined}UniqueMemoizer.prototype.current=function current(){return this.currentValue};UniqueMemoizer.prototype.moveNext=function moveNext(){var iterator=this.iterator,set=this.set,memo=this.memo,current;while(iterator.moveNext()){current=iterator.current();if(set.add(current)){memo.push(current);this.currentValue=current;return true}}return false};UniqueMemoizer.prototype.each=function each(fn){var memo=this.memo,length=memo.length,i=-1;while(++i<length){if(fn(memo[i],i)===false){return false}}while(this.moveNext()){if(fn(this.currentValue,i++)===false){break}}};UniqueMemoizer.prototype.contains=function contains(e){if(this.set.contains(e)){return true}while(this.moveNext()){if(this.currentValue===e){return true}}return false};Sequence.prototype.every=function every(predicate){predicate=createCallback(predicate);return this.each(function(e,i){return!!predicate(e,i)})};Sequence.prototype.all=function all(predicate){return this.every(predicate)};Sequence.prototype.some=function some(predicate){predicate=createCallback(predicate,true);var success=false;this.each(function(e){if(predicate(e)){success=true;return false}});return success};Sequence.prototype.any=function any(predicate){return this.some(predicate)};Sequence.prototype.none=function none(predicate){return!this.any(predicate)};Sequence.prototype.isEmpty=function isEmpty(){return!this.any()};Sequence.prototype.indexOf=function indexOf(value){var foundIndex=-1;this.each(function(e,i){if(e===value){foundIndex=i;return false}});return foundIndex};Sequence.prototype.lastIndexOf=function lastIndexOf(value){var index=this.reverse().indexOf(value);if(index!==-1){index=this.getIndex().length()-index-1}return index};Sequence.prototype.sortedIndex=function sortedIndex(value){var indexed=this.getIndex(),lower=0,upper=indexed.length(),i;while(lower<upper){i=lower+upper>>>1;if(compare(indexed.get(i),value)===-1){lower=i+1}else{upper=i}}return lower};Sequence.prototype.contains=function contains(value){return this.indexOf(value)!==-1};Sequence.prototype.reduce=function reduce(aggregator,memo){if(arguments.length<2){return this.tail().reduce(aggregator,this.head())}this.each(function(e,i){memo=aggregator(memo,e,i)});return memo};Sequence.prototype.inject=Sequence.prototype.foldl=function foldl(aggregator,memo){return this.reduce(aggregator,memo)};Sequence.prototype.reduceRight=function reduceRight(aggregator,memo){if(arguments.length<2){return this.initial(1).reduceRight(aggregator,this.last())}var i=this.getIndex().length()-1;return this.reverse().reduce(function(m,e){return aggregator(m,e,i--)},memo)};Sequence.prototype.foldr=function foldr(aggregator,memo){return this.reduceRight(aggregator,memo)};Sequence.prototype.consecutive=function consecutive(count){var queue=new Queue(count);var segments=this.map(function(element){if(queue.add(element).count===count){return queue.toArray()}});return segments.compact()};Sequence.prototype.chunk=function chunk(size){if(size<1){throw"You must specify a positive chunk size."}return new ChunkedSequence(this,size)};function ChunkedSequence(parent,size){this.parent=parent;this.chunkSize=size}ChunkedSequence.prototype=new Sequence;ChunkedSequence.prototype.getIterator=function getIterator(){return new ChunkedIterator(this.parent,this.chunkSize)};function ChunkedIterator(sequence,size){this.iterator=sequence.getIterator();this.size=size}ChunkedIterator.prototype.current=function current(){return this.currentChunk};ChunkedIterator.prototype.moveNext=function moveNext(){var iterator=this.iterator,chunkSize=this.size,chunk=[];while(chunk.length<chunkSize&&iterator.moveNext()){chunk.push(iterator.current())}if(chunk.length===0){return false}this.currentChunk=chunk;return true};Sequence.prototype.tap=function tap(callback){return new TappedSequence(this,callback)};function TappedSequence(parent,callback){this.parent=parent;this.callback=callback}TappedSequence.prototype=new Sequence;TappedSequence.prototype.each=function each(fn){var callback=this.callback;return this.parent.each(function(e,i){callback(e,i);return fn(e,i)})};Sequence.prototype.find=function find(predicate){return this.filter(predicate).first()};Sequence.prototype.detect=function detect(predicate){return this.find(predicate)};Sequence.prototype.min=function min(valueFn){if(typeof valueFn!=="undefined"){return this.minBy(valueFn)}return this.reduce(function(x,y){return y<x?y:x},Infinity)};Sequence.prototype.minBy=function minBy(valueFn){valueFn=createCallback(valueFn);return this.reduce(function(x,y){return valueFn(y)<valueFn(x)?y:x})};Sequence.prototype.max=function max(valueFn){if(typeof valueFn!=="undefined"){return this.maxBy(valueFn)}return this.reduce(function(x,y){return y>x?y:x},-Infinity)};Sequence.prototype.maxBy=function maxBy(valueFn){valueFn=createCallback(valueFn);return this.reduce(function(x,y){return valueFn(y)>valueFn(x)?y:x})};Sequence.prototype.sum=function sum(valueFn){if(typeof valueFn!=="undefined"){return this.sumBy(valueFn)}return this.reduce(function(x,y){return x+y},0)};Sequence.prototype.sumBy=function sumBy(valueFn){valueFn=createCallback(valueFn);return this.reduce(function(x,y){return x+valueFn(y)},0)};Sequence.prototype.join=function join(delimiter){delimiter=typeof delimiter==="string"?delimiter:",";return this.reduce(function(str,e){if(str.length>0){str+=delimiter}return str+e},"")};Sequence.prototype.toString=function toString(delimiter){return this.join(delimiter)};Sequence.prototype.async=function async(interval){return new AsyncSequence(this,interval)};function SimpleIntersectionSequence(parent,array){this.parent=parent;this.array=array;this.each=getEachForIntersection(array)}SimpleIntersectionSequence.prototype=new Sequence;SimpleIntersectionSequence.prototype.eachMemoizerCache=function eachMemoizerCache(fn){var iterator=new UniqueMemoizer(Lazy(this.array).getIterator()),i=0;return this.parent.each(function(e){if(iterator.contains(e)){return fn(e,i++)}})};SimpleIntersectionSequence.prototype.eachArrayCache=function eachArrayCache(fn){var array=this.array,find=arrayContains,i=0;return this.parent.each(function(e){if(find(array,e)){return fn(e,i++)}})};function getEachForIntersection(source){if(source.length<40){return SimpleIntersectionSequence.prototype.eachArrayCache}else{return SimpleIntersectionSequence.prototype.eachMemoizerCache}}function SimpleZippedSequence(parent,array){this.parent=parent;this.array=array}SimpleZippedSequence.prototype=new Sequence;SimpleZippedSequence.prototype.each=function each(fn){var array=this.array;return this.parent.each(function(e,i){return fn([e,array[i]],i)})};function ArrayLikeSequence(){}ArrayLikeSequence.prototype=new Sequence;ArrayLikeSequence.define=function define(methodName,overrides){if(!overrides||typeof overrides.get!=="function"){throw"A custom array-like sequence must implement *at least* get!"}return defineSequenceType(ArrayLikeSequence,methodName,overrides)};ArrayLikeSequence.prototype.get=function get(i){return this.parent.get(i)};ArrayLikeSequence.prototype.length=function length(){return this.parent.length()};ArrayLikeSequence.prototype.getIndex=function getIndex(){return this};ArrayLikeSequence.prototype.getIterator=function getIterator(){return new IndexedIterator(this)};function IndexedIterator(sequence){this.sequence=sequence;this.index=-1}IndexedIterator.prototype.current=function current(){return this.sequence.get(this.index)};IndexedIterator.prototype.moveNext=function moveNext(){if(this.index>=this.sequence.length()-1){return false}++this.index;return true};ArrayLikeSequence.prototype.each=function each(fn){var length=this.length(),i=-1;while(++i<length){if(fn(this.get(i),i)===false){return false}}return true};ArrayLikeSequence.prototype.pop=function pop(){return this.initial()};ArrayLikeSequence.prototype.shift=function shift(){return this.drop()};ArrayLikeSequence.prototype.slice=function slice(begin,end){var length=this.length();if(begin<0){begin=length+begin}var result=this.drop(begin);if(typeof end==="number"){if(end<0){end=length+end}result=result.take(end-begin)}return result};ArrayLikeSequence.prototype.map=function map(mapFn){return new IndexedMappedSequence(this,createCallback(mapFn))};function IndexedMappedSequence(parent,mapFn){this.parent=parent;this.mapFn=mapFn}IndexedMappedSequence.prototype=new ArrayLikeSequence;IndexedMappedSequence.prototype.get=function get(i){if(i<0||i>=this.parent.length()){return undefined}return this.mapFn(this.parent.get(i),i)};ArrayLikeSequence.prototype.filter=function filter(filterFn){return new IndexedFilteredSequence(this,createCallback(filterFn))};function IndexedFilteredSequence(parent,filterFn){this.parent=parent;this.filterFn=filterFn}IndexedFilteredSequence.prototype=new FilteredSequence;IndexedFilteredSequence.prototype.each=function each(fn){var parent=this.parent,filterFn=this.filterFn,length=this.parent.length(),i=-1,e;while(++i<length){e=parent.get(i);if(filterFn(e,i)&&fn(e,i)===false){return false}}return true};ArrayLikeSequence.prototype.reverse=function reverse(){return new IndexedReversedSequence(this)};function IndexedReversedSequence(parent){this.parent=parent}IndexedReversedSequence.prototype=new ArrayLikeSequence;IndexedReversedSequence.prototype.get=function get(i){return this.parent.get(this.length()-i-1)};ArrayLikeSequence.prototype.first=function first(count){if(typeof count==="undefined"){return this.get(0)}return new IndexedTakeSequence(this,count)};function IndexedTakeSequence(parent,count){this.parent=parent;this.count=count}IndexedTakeSequence.prototype=new ArrayLikeSequence;IndexedTakeSequence.prototype.length=function length(){var parentLength=this.parent.length();return this.count<=parentLength?this.count:parentLength};ArrayLikeSequence.prototype.rest=function rest(count){return new IndexedDropSequence(this,count)};function IndexedDropSequence(parent,count){this.parent=parent;this.count=typeof count==="number"?count:1}IndexedDropSequence.prototype=new ArrayLikeSequence;IndexedDropSequence.prototype.get=function get(i){return this.parent.get(this.count+i)};IndexedDropSequence.prototype.length=function length(){var parentLength=this.parent.length();return this.count<=parentLength?parentLength-this.count:0};ArrayLikeSequence.prototype.concat=function concat(var_args){if(arguments.length===1&&arguments[0]instanceof Array){return new IndexedConcatenatedSequence(this,var_args)}else{return Sequence.prototype.concat.apply(this,arguments)}};function IndexedConcatenatedSequence(parent,other){this.parent=parent;this.other=other}IndexedConcatenatedSequence.prototype=new ArrayLikeSequence;IndexedConcatenatedSequence.prototype.get=function get(i){var parentLength=this.parent.length();if(i<parentLength){return this.parent.get(i)}else{return this.other[i-parentLength]}};IndexedConcatenatedSequence.prototype.length=function length(){return this.parent.length()+this.other.length};ArrayLikeSequence.prototype.uniq=function uniq(keyFn){return new IndexedUniqueSequence(this,createCallback(keyFn))};function IndexedUniqueSequence(parent,keyFn){this.parent=parent;this.each=getEachForParent(parent);this.keyFn=keyFn}IndexedUniqueSequence.prototype=new Sequence;IndexedUniqueSequence.prototype.eachArrayCache=function eachArrayCache(fn){var parent=this.parent,keyFn=this.keyFn,length=parent.length(),cache=[],find=arrayContains,key,value,i=-1,j=0;while(++i<length){value=parent.get(i);key=keyFn(value);if(!find(cache,key)){cache.push(key);if(fn(value,j++)===false){return false}}}};IndexedUniqueSequence.prototype.eachSetCache=UniqueSequence.prototype.each;function getEachForParent(parent){if(parent.length()<100){return IndexedUniqueSequence.prototype.eachArrayCache}else{return UniqueSequence.prototype.each}}MemoizedSequence.prototype=new ArrayLikeSequence;MemoizedSequence.prototype.cache=function cache(){return this.cachedResult||(this.cachedResult=this.parent.toArray())};MemoizedSequence.prototype.get=function get(i){return this.cache()[i]};MemoizedSequence.prototype.length=function length(){return this.cache().length};MemoizedSequence.prototype.slice=function slice(begin,end){return this.cache().slice(begin,end)};MemoizedSequence.prototype.toArray=function toArray(){return this.cache().slice(0)};function ArrayWrapper(source){this.source=source}ArrayWrapper.prototype=new ArrayLikeSequence;ArrayWrapper.prototype.root=function root(){return this};ArrayWrapper.prototype.get=function get(i){return this.source[i]};ArrayWrapper.prototype.length=function length(){return this.source.length};ArrayWrapper.prototype.each=function each(fn){return forEach(this.source,fn)};ArrayWrapper.prototype.map=ArrayWrapper.prototype.collect=function collect(mapFn){return new MappedArrayWrapper(this,createCallback(mapFn))};ArrayWrapper.prototype.filter=ArrayWrapper.prototype.select=function select(filterFn){return new FilteredArrayWrapper(this,createCallback(filterFn))};ArrayWrapper.prototype.uniq=ArrayWrapper.prototype.unique=function unique(keyFn){return new UniqueArrayWrapper(this,keyFn)};ArrayWrapper.prototype.concat=function concat(var_args){if(arguments.length===1&&arguments[0]instanceof Array){return new ConcatArrayWrapper(this,var_args)}else{return ArrayLikeSequence.prototype.concat.apply(this,arguments)}};ArrayWrapper.prototype.toArray=function toArray(){return this.source.slice(0)};function MappedArrayWrapper(parent,mapFn){this.parent=parent;this.mapFn=mapFn}MappedArrayWrapper.prototype=new ArrayLikeSequence;MappedArrayWrapper.prototype.get=function get(i){var source=this.parent.source;if(i<0||i>=source.length){return undefined}return this.mapFn(source[i])};MappedArrayWrapper.prototype.length=function length(){return this.parent.source.length};MappedArrayWrapper.prototype.each=function each(fn){var source=this.parent.source,length=source.length,mapFn=this.mapFn,i=-1;while(++i<length){if(fn(mapFn(source[i],i),i)===false){return false}}return true};function FilteredArrayWrapper(parent,filterFn){this.parent=parent;this.filterFn=filterFn}FilteredArrayWrapper.prototype=new FilteredSequence;FilteredArrayWrapper.prototype.each=function each(fn){var source=this.parent.source,filterFn=this.filterFn,length=source.length,i=-1,e;while(++i<length){e=source[i];if(filterFn(e,i)&&fn(e,i)===false){return false}}return true};function UniqueArrayWrapper(parent,keyFn){this.parent=parent;this.each=getEachForSource(parent.source);this.keyFn=keyFn}UniqueArrayWrapper.prototype=new Sequence;UniqueArrayWrapper.prototype.eachNoCache=function eachNoCache(fn){var source=this.parent.source,keyFn=this.keyFn,length=source.length,find=arrayContainsBefore,value,i=-1,k=0;while(++i<length){value=source[i];if(!find(source,value,i,keyFn)&&fn(value,k++)===false){return false}}return true};UniqueArrayWrapper.prototype.eachArrayCache=function eachArrayCache(fn){var source=this.parent.source,keyFn=this.keyFn,length=source.length,cache=[],find=arrayContains,key,value,i=-1,j=0;if(keyFn){keyFn=createCallback(keyFn);while(++i<length){value=source[i];key=keyFn(value);if(!find(cache,key)){cache.push(key);if(fn(value,j++)===false){return false}}}}else{while(++i<length){value=source[i];if(!find(cache,value)){cache.push(value);if(fn(value,j++)===false){return false}}}}return true};UniqueArrayWrapper.prototype.eachSetCache=UniqueSequence.prototype.each;function getEachForSource(source){if(source.length<40){return UniqueArrayWrapper.prototype.eachNoCache}else if(source.length<100){return UniqueArrayWrapper.prototype.eachArrayCache}else{return UniqueArrayWrapper.prototype.eachSetCache}}function ConcatArrayWrapper(parent,other){this.parent=parent;this.other=other}ConcatArrayWrapper.prototype=new ArrayLikeSequence;ConcatArrayWrapper.prototype.get=function get(i){var source=this.parent.source,sourceLength=source.length;if(i<sourceLength){return source[i]}else{return this.other[i-sourceLength]}};ConcatArrayWrapper.prototype.length=function length(){return this.parent.source.length+this.other.length};ConcatArrayWrapper.prototype.each=function each(fn){var source=this.parent.source,sourceLength=source.length,other=this.other,otherLength=other.length,i=0,j=-1;while(++j<sourceLength){if(fn(source[j],i++)===false){return false}}j=-1;while(++j<otherLength){if(fn(other[j],i++)===false){return false}}return true};function ObjectLikeSequence(){}ObjectLikeSequence.prototype=new Sequence;ObjectLikeSequence.define=function define(methodName,overrides){if(!overrides||typeof overrides.each!=="function"){throw"A custom object-like sequence must implement *at least* each!"}return defineSequenceType(ObjectLikeSequence,methodName,overrides)};ObjectLikeSequence.prototype.value=function value(){return this.toObject()};ObjectLikeSequence.prototype.get=function get(key){var pair=this.pairs().find(function(pair){return pair[0]===key});return pair?pair[1]:undefined};ObjectLikeSequence.prototype.keys=function keys(){return this.map(function(v,k){return k})};ObjectLikeSequence.prototype.values=function values(){return this.map(function(v,k){return v})};ObjectLikeSequence.prototype.async=function async(){throw"An ObjectLikeSequence does not support asynchronous iteration."};ObjectLikeSequence.prototype.reverse=function reverse(){return this};ObjectLikeSequence.prototype.assign=function assign(other){return new AssignSequence(this,other)};ObjectLikeSequence.prototype.extend=function extend(other){return this.assign(other)};function AssignSequence(parent,other){this.parent=parent;this.other=other}AssignSequence.prototype=new ObjectLikeSequence;AssignSequence.prototype.get=function get(key){return this.other[key]||this.parent.get(key)};AssignSequence.prototype.each=function each(fn){var merged=new Set,done=false;Lazy(this.other).each(function(value,key){if(fn(value,key)===false){done=true;return false}merged.add(key)});if(!done){return this.parent.each(function(value,key){if(!merged.contains(key)&&fn(value,key)===false){return false}})}};ObjectLikeSequence.prototype.defaults=function defaults(defaults){return new DefaultsSequence(this,defaults)};function DefaultsSequence(parent,defaults){this.parent=parent;this.defaults=defaults}DefaultsSequence.prototype=new ObjectLikeSequence;DefaultsSequence.prototype.get=function get(key){return this.parent.get(key)||this.defaults[key]};DefaultsSequence.prototype.each=function each(fn){var merged=new Set,done=false;this.parent.each(function(value,key){if(fn(value,key)===false){done=true;return false}if(typeof value!=="undefined"){merged.add(key)}});if(!done){Lazy(this.defaults).each(function(value,key){if(!merged.contains(key)&&fn(value,key)===false){return false}})}};ObjectLikeSequence.prototype.invert=function invert(){return new InvertedSequence(this)};function InvertedSequence(parent){this.parent=parent}InvertedSequence.prototype=new ObjectLikeSequence;InvertedSequence.prototype.each=function each(fn){this.parent.each(function(value,key){return fn(key,value)})};ObjectLikeSequence.prototype.merge=function merge(var_args){var mergeFn=arguments.length>1&&typeof arguments[arguments.length-1]==="function"?arrayPop.call(arguments):null;return new MergedSequence(this,arraySlice.call(arguments,0),mergeFn)};function MergedSequence(parent,others,mergeFn){this.parent=parent;this.others=others;this.mergeFn=mergeFn}MergedSequence.prototype=new ObjectLikeSequence;MergedSequence.prototype.each=function each(fn){var others=this.others,mergeFn=this.mergeFn||mergeObjects,keys={};var iteratedFullSource=this.parent.each(function(value,key){var merged=value;forEach(others,function(other){if(key in other){merged=mergeFn(merged,other[key])
}});keys[key]=true;return fn(merged,key)});if(iteratedFullSource===false){return false}var remaining={};forEach(others,function(other){for(var k in other){if(!keys[k]){remaining[k]=mergeFn(remaining[k],other[k])}}});return Lazy(remaining).each(fn)};function mergeObjects(a,b){if(typeof b==="undefined"){return a}if(typeof a!=="object"||a===null||typeof b!=="object"||b===null){return b}var merged={},prop;for(prop in a){merged[prop]=mergeObjects(a[prop],b[prop])}for(prop in b){if(!merged[prop]){merged[prop]=b[prop]}}return merged}ObjectLikeSequence.prototype.functions=function functions(){return this.filter(function(v,k){return typeof v==="function"}).map(function(v,k){return k})};ObjectLikeSequence.prototype.methods=function methods(){return this.functions()};ObjectLikeSequence.prototype.pick=function pick(properties){return new PickSequence(this,properties)};function PickSequence(parent,properties){this.parent=parent;this.properties=properties}PickSequence.prototype=new ObjectLikeSequence;PickSequence.prototype.get=function get(key){return arrayContains(this.properties,key)?this.parent.get(key):undefined};PickSequence.prototype.each=function each(fn){var inArray=arrayContains,properties=this.properties;return this.parent.each(function(value,key){if(inArray(properties,key)){return fn(value,key)}})};ObjectLikeSequence.prototype.omit=function omit(properties){return new OmitSequence(this,properties)};function OmitSequence(parent,properties){this.parent=parent;this.properties=properties}OmitSequence.prototype=new ObjectLikeSequence;OmitSequence.prototype.get=function get(key){return arrayContains(this.properties,key)?undefined:this.parent.get(key)};OmitSequence.prototype.each=function each(fn){var inArray=arrayContains,properties=this.properties;return this.parent.each(function(value,key){if(!inArray(properties,key)){return fn(value,key)}})};ObjectLikeSequence.prototype.pairs=function pairs(){return this.map(function(v,k){return[k,v]})};ObjectLikeSequence.prototype.toArray=function toArray(){return this.pairs().toArray()};ObjectLikeSequence.prototype.toObject=function toObject(){return this.reduce(function(object,value,key){object[key]=value;return object},{})};GroupedSequence.prototype=new ObjectLikeSequence;GroupedSequence.prototype.each=function each(fn){var keyFn=createCallback(this.keyFn),grouped={};this.parent.each(function(e){var key=keyFn(e);if(!grouped[key]){grouped[key]=[e]}else{grouped[key].push(e)}});for(var key in grouped){if(fn(grouped[key],key)===false){return false}}return true};CountedSequence.prototype=new ObjectLikeSequence;CountedSequence.prototype.each=function each(fn){var keyFn=createCallback(this.keyFn),counted={};this.parent.each(function(e){var key=keyFn(e);if(!counted[key]){counted[key]=1}else{counted[key]+=1}});for(var key in counted){if(fn(counted[key],key)===false){return false}}return true};ObjectLikeSequence.prototype.watch=function watch(propertyNames){throw"You can only call #watch on a directly wrapped object."};function ObjectWrapper(source){this.source=source}ObjectWrapper.prototype=new ObjectLikeSequence;ObjectWrapper.prototype.root=function root(){return this};ObjectWrapper.prototype.get=function get(key){return this.source[key]};ObjectWrapper.prototype.each=function each(fn){var source=this.source,key;for(key in source){if(fn(source[key],key)===false){return false}}return true};function StringLikeSequence(){}StringLikeSequence.prototype=new ArrayLikeSequence;StringLikeSequence.define=function define(methodName,overrides){if(!overrides||typeof overrides.get!=="function"){throw"A custom string-like sequence must implement *at least* get!"}return defineSequenceType(StringLikeSequence,methodName,overrides)};StringLikeSequence.prototype.value=function value(){return this.toString()};StringLikeSequence.prototype.getIterator=function getIterator(){return new CharIterator(this)};function CharIterator(source){this.source=Lazy(source);this.index=-1}CharIterator.prototype.current=function current(){return this.source.charAt(this.index)};CharIterator.prototype.moveNext=function moveNext(){return++this.index<this.source.length()};StringLikeSequence.prototype.charAt=function charAt(i){return this.get(i)};StringLikeSequence.prototype.charCodeAt=function charCodeAt(i){var char=this.charAt(i);if(!char){return NaN}return char.charCodeAt(0)};StringLikeSequence.prototype.substring=function substring(start,stop){return new StringSegment(this,start,stop)};function StringSegment(parent,start,stop){this.parent=parent;this.start=Math.max(0,start);this.stop=stop}StringSegment.prototype=new StringLikeSequence;StringSegment.prototype.get=function get(i){return this.parent.get(i+this.start)};StringSegment.prototype.length=function length(){return(typeof this.stop==="number"?this.stop:this.parent.length())-this.start};StringLikeSequence.prototype.first=function first(count){if(typeof count==="undefined"){return this.charAt(0)}return this.substring(0,count)};StringLikeSequence.prototype.last=function last(count){if(typeof count==="undefined"){return this.charAt(this.length()-1)}return this.substring(this.length()-count)};StringLikeSequence.prototype.drop=function drop(count){return this.substring(count)};StringLikeSequence.prototype.indexOf=function indexOf(substring,startIndex){return this.toString().indexOf(substring,startIndex)};StringLikeSequence.prototype.lastIndexOf=function lastIndexOf(substring,startIndex){return this.toString().lastIndexOf(substring,startIndex)};StringLikeSequence.prototype.contains=function contains(substring){return this.indexOf(substring)!==-1};StringLikeSequence.prototype.endsWith=function endsWith(suffix){return this.substring(this.length()-suffix.length).toString()===suffix};StringLikeSequence.prototype.startsWith=function startsWith(prefix){return this.substring(0,prefix.length).toString()===prefix};StringLikeSequence.prototype.toUpperCase=function toUpperCase(){return this.mapString(function(char){return char.toUpperCase()})};StringLikeSequence.prototype.toLowerCase=function toLowerCase(){return this.mapString(function(char){return char.toLowerCase()})};StringLikeSequence.prototype.mapString=function mapString(mapFn){return new MappedStringLikeSequence(this,mapFn)};function MappedStringLikeSequence(parent,mapFn){this.parent=parent;this.mapFn=mapFn}MappedStringLikeSequence.prototype=new StringLikeSequence;MappedStringLikeSequence.prototype.get=IndexedMappedSequence.prototype.get;MappedStringLikeSequence.prototype.length=IndexedMappedSequence.prototype.length;StringLikeSequence.prototype.reverse=function reverse(){return new ReversedStringLikeSequence(this)};function ReversedStringLikeSequence(parent){this.parent=parent}ReversedStringLikeSequence.prototype=new StringLikeSequence;ReversedStringLikeSequence.prototype.get=IndexedReversedSequence.prototype.get;ReversedStringLikeSequence.prototype.length=IndexedReversedSequence.prototype.length;StringLikeSequence.prototype.toString=function toString(){return this.join("")};StringLikeSequence.prototype.match=function match(pattern){return new StringMatchSequence(this.source,pattern)};function StringMatchSequence(source,pattern){this.source=source;this.pattern=pattern}StringMatchSequence.prototype=new Sequence;StringMatchSequence.prototype.getIterator=function getIterator(){return new StringMatchIterator(this.source,this.pattern)};function StringMatchIterator(source,pattern){this.source=source;this.pattern=cloneRegex(pattern)}StringMatchIterator.prototype.current=function current(){return this.match[0]};StringMatchIterator.prototype.moveNext=function moveNext(){return!!(this.match=this.pattern.exec(this.source))};StringLikeSequence.prototype.split=function split(delimiter){return new SplitStringSequence(this.source,delimiter)};function SplitStringSequence(source,pattern){this.source=source;this.pattern=pattern}SplitStringSequence.prototype=new Sequence;SplitStringSequence.prototype.getIterator=function getIterator(){if(this.pattern instanceof RegExp){if(this.pattern.source===""||this.pattern.source==="(?:)"){return new CharIterator(this.source)}else{return new SplitWithRegExpIterator(this.source,this.pattern)}}else if(this.pattern===""){return new CharIterator(this.source)}else{return new SplitWithStringIterator(this.source,this.pattern)}};function SplitWithRegExpIterator(source,pattern){this.source=source;this.pattern=cloneRegex(pattern)}SplitWithRegExpIterator.prototype.current=function current(){return this.source.substring(this.start,this.end)};SplitWithRegExpIterator.prototype.moveNext=function moveNext(){if(!this.pattern){return false}var match=this.pattern.exec(this.source);if(match){this.start=this.nextStart?this.nextStart:0;this.end=match.index;this.nextStart=match.index+match[0].length;return true}else if(this.pattern){this.start=this.nextStart;this.end=undefined;this.nextStart=undefined;this.pattern=undefined;return true}return false};function SplitWithStringIterator(source,delimiter){this.source=source;this.delimiter=delimiter}SplitWithStringIterator.prototype.current=function current(){return this.source.substring(this.leftIndex,this.rightIndex)};SplitWithStringIterator.prototype.moveNext=function moveNext(){if(!this.finished){this.leftIndex=typeof this.leftIndex!=="undefined"?this.rightIndex+this.delimiter.length:0;this.rightIndex=this.source.indexOf(this.delimiter,this.leftIndex)}if(this.rightIndex===-1){this.finished=true;this.rightIndex=undefined;return true}return!this.finished};function StringWrapper(source){this.source=source}StringWrapper.prototype=new StringLikeSequence;StringWrapper.prototype.root=function root(){return this};StringWrapper.prototype.get=function get(i){return this.source.charAt(i)};StringWrapper.prototype.length=function length(){return this.source.length};function GeneratedSequence(generatorFn,length){this.get=generatorFn;this.fixedLength=length}GeneratedSequence.prototype=new Sequence;GeneratedSequence.prototype.length=function length(){return this.fixedLength};GeneratedSequence.prototype.each=function each(fn){var generatorFn=this.get,length=this.fixedLength,i=0;while(typeof length==="undefined"||i<length){if(fn(generatorFn(i++))===false){return false}}return true};GeneratedSequence.prototype.getIterator=function getIterator(){return new GeneratedIterator(this)};function GeneratedIterator(sequence){this.sequence=sequence;this.index=0;this.currentValue=null}GeneratedIterator.prototype.current=function current(){return this.currentValue};GeneratedIterator.prototype.moveNext=function moveNext(){var sequence=this.sequence;if(typeof sequence.fixedLength==="number"&&this.index>=sequence.fixedLength){return false}this.currentValue=sequence.get(this.index++);return true};function AsyncSequence(parent,interval){if(parent instanceof AsyncSequence){throw"Sequence is already asynchronous!"}this.parent=parent;this.interval=interval;this.onNextCallback=getOnNextCallback(interval)}AsyncSequence.prototype=new Sequence;AsyncSequence.prototype.getIterator=function getIterator(){throw"An AsyncSequence does not support synchronous iteration."};AsyncSequence.prototype.each=function each(fn){var iterator=this.parent.getIterator(),onNextCallback=this.onNextCallback,i=0;var handle=new AsyncHandle(this.interval);handle.id=onNextCallback(function iterate(){try{if(iterator.moveNext()&&fn(iterator.current(),i++)!==false){handle.id=onNextCallback(iterate)}else{handle.completeCallback()}}catch(e){handle.errorCallback(e)}});return handle};function AsyncHandle(interval){this.cancelCallback=getCancelCallback(interval)}AsyncHandle.prototype.cancel=function cancel(){var cancelCallback=this.cancelCallback;if(this.id){cancelCallback(this.id);this.id=null}};AsyncHandle.prototype.onError=function onError(callback){this.errorCallback=callback};AsyncHandle.prototype.errorCallback=Lazy.noop;AsyncHandle.prototype.onComplete=function onComplete(callback){this.completeCallback=callback};AsyncHandle.prototype.completeCallback=Lazy.noop;function getOnNextCallback(interval){if(typeof interval==="undefined"){if(typeof setImmediate==="function"){return setImmediate}}interval=interval||0;return function(fn){return setTimeout(fn,interval)}}function getCancelCallback(interval){if(typeof interval==="undefined"){if(typeof clearImmediate==="function"){return clearImmediate}}return clearTimeout}AsyncSequence.prototype.reverse=function reverse(){return this.parent.reverse().async()};AsyncSequence.prototype.reduce=function reduce(aggregator,memo){var handle=this.each(function(e,i){if(typeof memo==="undefined"&&i===0){memo=e}else{memo=aggregator(memo,e,i)}});handle.then=handle.onComplete=function(callback){handle.completeCallback=function(){callback(memo)}};return handle};AsyncSequence.prototype.find=function find(predicate){var found;var handle=this.each(function(e,i){if(predicate(e,i)){found=e;return false}});handle.then=handle.onComplete=function(callback){handle.completeCallback=function(){callback(found)}};return handle};AsyncSequence.prototype.indexOf=function indexOf(value){var foundIndex=-1;var handle=this.each(function(e,i){if(e===value){foundIndex=i;return false}});handle.then=handle.onComplete=function(callback){handle.completeCallback=function(){callback(foundIndex)}};return handle};AsyncSequence.prototype.contains=function contains(value){var found=false;var handle=this.each(function(e){if(e===value){found=true;return false}});handle.then=handle.onComplete=function(callback){handle.completeCallback=function(){callback(found)}};return handle};AsyncSequence.prototype.async=function async(){return this};ObjectWrapper.prototype.watch=function watch(propertyNames){return new WatchedPropertySequence(this.source,propertyNames)};function WatchedPropertySequence(object,propertyNames){this.listeners=[];if(!propertyNames){propertyNames=Lazy(object).keys().toArray()}else if(!(propertyNames instanceof Array)){propertyNames=[propertyNames]}var listeners=this.listeners,index=0;Lazy(propertyNames).each(function(propertyName){var propertyValue=object[propertyName];Object.defineProperty(object,propertyName,{get:function(){return propertyValue},set:function(value){for(var i=listeners.length-1;i>=0;--i){if(listeners[i]({property:propertyName,value:value},index)===false){listeners.splice(i,1)}}propertyValue=value;++index}})})}WatchedPropertySequence.prototype=new AsyncSequence;WatchedPropertySequence.prototype.each=function each(fn){this.listeners.push(fn)};function StreamLikeSequence(){}StreamLikeSequence.prototype=new AsyncSequence;StreamLikeSequence.prototype.split=function split(delimiter){return new SplitStreamSequence(this,delimiter)};function SplitStreamSequence(parent,delimiter){this.parent=parent;this.delimiter=delimiter}SplitStreamSequence.prototype=new Sequence;SplitStreamSequence.prototype.each=function each(fn){var delimiter=this.delimiter,done=false,i=0;return this.parent.each(function(chunk){Lazy(chunk).split(delimiter).each(function(piece){if(fn(piece,i++)===false){done=true;return false}});return!done})};StreamLikeSequence.prototype.lines=function lines(){return this.split("\n")};StreamLikeSequence.prototype.match=function match(pattern){return new MatchedStreamSequence(this,pattern)};function MatchedStreamSequence(parent,pattern){this.parent=parent;this.pattern=cloneRegex(pattern)}MatchedStreamSequence.prototype=new AsyncSequence;MatchedStreamSequence.prototype.each=function each(fn){var pattern=this.pattern,done=false,i=0;return this.parent.each(function(chunk){Lazy(chunk).match(pattern).each(function(match){if(fn(match,i++)===false){done=true;return false}});return!done})};Lazy.createWrapper=function createWrapper(initializer){var ctor=function(){this.listeners=[]};ctor.prototype=new StreamLikeSequence;ctor.prototype.each=function(listener){this.listeners.push(listener)};ctor.prototype.emit=function(data){var listeners=this.listeners;for(var len=listeners.length,i=len-1;i>=0;--i){if(listeners[i](data)===false){listeners.splice(i,1)}}};return function(){var sequence=new ctor;initializer.apply(sequence,arguments);return sequence}};Lazy.generate=function generate(generatorFn,length){return new GeneratedSequence(generatorFn,length)};Lazy.range=function range(){var start=arguments.length>1?arguments[0]:0,stop=arguments.length>1?arguments[1]:arguments[0],step=arguments.length>2?arguments[2]:1;return this.generate(function(i){return start+step*i}).take(Math.floor((stop-start)/step))};Lazy.repeat=function repeat(value,count){return Lazy.generate(function(){return value},count)};Lazy.Sequence=Sequence;Lazy.ArrayLikeSequence=ArrayLikeSequence;Lazy.ObjectLikeSequence=ObjectLikeSequence;Lazy.StringLikeSequence=StringLikeSequence;Lazy.StreamLikeSequence=StreamLikeSequence;Lazy.GeneratedSequence=GeneratedSequence;Lazy.AsyncSequence=AsyncSequence;Lazy.AsyncHandle=AsyncHandle;Lazy.deprecate=function deprecate(message,fn){return function(){console.warn(message);return fn.apply(this,arguments)}};var arrayPop=Array.prototype.pop,arraySlice=Array.prototype.slice;function createCallback(callback,defaultValue){switch(typeof callback){case"function":return callback;case"string":return function(e){return e[callback]};case"object":return function(e){return Lazy(callback).all(function(value,key){return e[key]===value})};case"undefined":return defaultValue?function(){return defaultValue}:Lazy.identity;default:throw"Don't know how to make a callback from a "+typeof callback+"!"}}function createSet(values){var set=new Set;Lazy(values||[]).flatten().each(function(e){set.add(e)});return set}function compare(x,y,fn){if(typeof fn==="function"){return compare(fn(x),fn(y))}if(x===y){return 0}return x>y?1:-1}function forEach(array,fn){var i=-1,len=array.length;while(++i<len){if(fn(array[i],i)===false){return false}}return true}function getFirst(sequence){var result;sequence.each(function(e){result=e;return false});return result}function arrayContains(array,element){var i=-1,length=array.length;if(element!==element){while(++i<length){if(array[i]!==array[i]){return true}}return false}while(++i<length){if(array[i]===element){return true}}return false}function arrayContainsBefore(array,element,index,keyFn){var i=-1;if(keyFn){keyFn=createCallback(keyFn);while(++i<index){if(keyFn(array[i])===keyFn(element)){return true}}}else{while(++i<index){if(array[i]===element){return true}}}return false}function swap(array,i,j){var temp=array[i];array[i]=array[j];array[j]=temp}function cloneRegex(pattern){return eval(""+pattern+(!pattern.global?"g":""))}function Set(){this.table={};this.objects=[]}Set.prototype.add=function add(value){var table=this.table,type=typeof value,firstChar,objects;switch(type){case"number":case"boolean":case"undefined":if(!table[value]){table[value]=true;return true}return false;case"string":switch(value.charAt(0)){case"_":case"f":case"t":case"c":case"u":case"@":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"N":value="@"+value}if(!table[value]){table[value]=true;return true}return false;default:objects=this.objects;if(!arrayContains(objects,value)){objects.push(value);return true}return false}};Set.prototype.contains=function contains(value){var type=typeof value,firstChar;switch(type){case"number":case"boolean":case"undefined":return!!this.table[value];case"string":switch(value.charAt(0)){case"_":case"f":case"t":case"c":case"u":case"@":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"N":value="@"+value}return!!this.table[value];default:return arrayContains(this.objects,value)}};function Queue(capacity){this.contents=new Array(capacity);this.start=0;this.count=0}Queue.prototype.add=function add(element){var contents=this.contents,capacity=contents.length,start=this.start;if(this.count===capacity){contents[start]=element;this.start=(start+1)%capacity}else{contents[this.count++]=element}return this};Queue.prototype.toArray=function toArray(){var contents=this.contents,start=this.start,count=this.count;var snapshot=contents.slice(start,start+count);if(snapshot.length<count){snapshot=snapshot.concat(contents.slice(0,count-snapshot.length))}return snapshot};function defineSequenceType(base,name,overrides){var ctor=function ctor(){};ctor.prototype=new base;for(var override in overrides){ctor.prototype[override]=overrides[override]}var factory=function factory(){var sequence=new ctor;sequence.parent=this;if(sequence.init){sequence.init.apply(sequence,arguments)}return sequence};var methodNames=typeof name==="string"?[name]:name;for(var i=0;i<methodNames.length;++i){base.prototype[methodNames[i]]=factory}return ctor}if(typeof module==="object"&&module&&module.exports===context){module.exports=Lazy}else{context.Lazy=Lazy}})(this)},{}],"lazy.js":[function(require,module,exports){var fs=require("fs");var http=require("http");var os=require("os");var Stream=require("stream");var URL=require("url");var util=require("util");var Lazy=require("./lazy.js");function StreamedSequence(stream){this.stream=stream}StreamedSequence.prototype=new Lazy.StreamLikeSequence;StreamedSequence.prototype.openStream=function(callback){this.stream.resume();callback(this.stream)};StreamedSequence.prototype.each=function(fn){var encoding=this.encoding||"utf-8";var handle=new Lazy.AsyncHandle;this.openStream(function(stream){var listener=function(e){try{if(fn(e)===false){stream.removeListener("data",listener)}}catch(e){handle.errorCallback(e)}};if(stream.setEncoding){stream.setEncoding(encoding)}stream.on("data",listener);stream.on("end",function(){handle.completeCallback()})});return handle};StreamedSequence.prototype.lines=function(){return this.split(os.EOL||"\n")};function FileStreamSequence(path,encoding){this.path=path;this.encoding=encoding}FileStreamSequence.prototype=new StreamedSequence;FileStreamSequence.prototype.openStream=function(callback){var stream=fs.createReadStream(this.path,{autoClose:true});callback(stream)};Lazy.readFile=function(path,encoding){return new FileStreamSequence(path,encoding)};function HttpStreamSequence(url,encoding){this.url=url;this.encoding=encoding}HttpStreamSequence.prototype=new StreamedSequence;HttpStreamSequence.prototype.openStream=function(callback){http.get(URL.parse(this.url),callback)};Lazy.makeHttpRequest=function(url){return new HttpStreamSequence(url)};if(typeof Stream.Readable!=="undefined"){Lazy.Sequence.prototype.toStream=function toStream(options){return new LazyStream(this,options)};Lazy.Sequence.prototype.pipe=function pipe(destination){this.toStream().pipe(destination)};function LazyStream(sequence,options){options=Lazy(options||{}).extend({objectMode:true}).toObject();Stream.Readable.call(this,options);this.sequence=sequence;this.started=false}util.inherits(LazyStream,Stream.Readable);LazyStream.prototype._read=function(){var self=this;if(!this.started){var handle=this.sequence.each(function(e,i){return self.push(e,i)});if(handle instanceof Lazy.AsyncHandle){handle.onComplete(function(){self.push(null)})}this.started=true}}}Lazy.extensions||(Lazy.extensions=[]);Lazy.extensions.push(function(source){if(source instanceof Stream){return new StreamedSequence(source)}});module.exports=Lazy},{"./lazy.js":34,fs:1,http:6,os:12,stream:30,url:31,util:33}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({lodash:[function(require,module,exports){(function(global){(function(){var undefined;var arrayPool=[],objectPool=[];var idCounter=0;var keyPrefix=+new Date+"";var largeArraySize=75;var maxPoolSize=40;var whitespace=" \f "+"\n\r\u2028\u2029"+" ᠎              ";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reInterpolate=/<%=([\s\S]+?)%>/g;var reLeadingSpacesAndZeros=RegExp("^["+whitespace+"]*0+(?=.$)");var reNoMatch=/($^)/;var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\t\u2028\u2029\\]/g;var contextProps=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"];var templateCounter=0;var argsClass="[object Arguments]",arrayClass="[object Array]",boolClass="[object Boolean]",dateClass="[object Date]",funcClass="[object Function]",numberClass="[object Number]",objectClass="[object Object]",regexpClass="[object RegExp]",stringClass="[object String]";var cloneableClasses={};cloneableClasses[funcClass]=false;cloneableClasses[argsClass]=cloneableClasses[arrayClass]=cloneableClasses[boolClass]=cloneableClasses[dateClass]=cloneableClasses[numberClass]=cloneableClasses[objectClass]=cloneableClasses[regexpClass]=cloneableClasses[stringClass]=true;var debounceOptions={leading:false,maxWait:0,trailing:false};var descriptor={configurable:false,enumerable:false,value:null,writable:false};var objectTypes={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window||this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;var freeGlobal=objectTypes[typeof global]&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal)){root=freeGlobal}function baseIndexOf(array,value,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0;while(++index<length){if(array[index]===value){return index}}return-1}function cacheIndexOf(cache,value){var type=typeof value;cache=cache.cache;if(type=="boolean"||value==null){return cache[value]?0:-1}if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value;cache=(cache=cache[type])&&cache[key];return type=="object"?cache&&baseIndexOf(cache,value)>-1?0:-1:cache?0:-1}function cachePush(value){var cache=this.cache,type=typeof value;if(type=="boolean"||value==null){cache[value]=true}else{if(type!="number"&&type!="string"){type="object"}var key=type=="number"?value:keyPrefix+value,typeCache=cache[type]||(cache[type]={});if(type=="object"){(typeCache[key]||(typeCache[key]=[])).push(value)}else{typeCache[key]=true}}}function charAtCallback(value){return value.charCodeAt(0)}function compareAscending(a,b){var ac=a.criteria,bc=b.criteria,index=-1,length=ac.length;while(++index<length){var value=ac[index],other=bc[index];if(value!==other){if(value>other||typeof value=="undefined"){return 1}if(value<other||typeof other=="undefined"){return-1}}}return a.index-b.index}function createCache(array){var index=-1,length=array.length,first=array[0],mid=array[length/2|0],last=array[length-1];if(first&&typeof first=="object"&&mid&&typeof mid=="object"&&last&&typeof last=="object"){return false}var cache=getObject();cache["false"]=cache["null"]=cache["true"]=cache["undefined"]=false;var result=getObject();result.array=array;result.cache=cache;result.push=cachePush;while(++index<length){result.push(array[index])}return result}function escapeStringChar(match){return"\\"+stringEscapes[match]}function getArray(){return arrayPool.pop()||[]}function getObject(){return objectPool.pop()||{array:null,cache:null,criteria:null,"false":false,index:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,value:null}}function releaseArray(array){array.length=0;if(arrayPool.length<maxPoolSize){arrayPool.push(array)}}function releaseObject(object){var cache=object.cache;if(cache){releaseObject(cache)}object.array=object.cache=object.criteria=object.object=object.number=object.string=object.value=null;if(objectPool.length<maxPoolSize){objectPool.push(object)}}function slice(array,start,end){start||(start=0);if(typeof end=="undefined"){end=array?array.length:0}var index=-1,length=end-start||0,result=Array(length<0?0:length);while(++index<length){result[index]=array[start+index]}return result}function runInContext(context){context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;var Array=context.Array,Boolean=context.Boolean,Date=context.Date,Function=context.Function,Math=context.Math,Number=context.Number,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;var arrayRef=[];var objectProto=Object.prototype;var oldDash=context._;var toString=objectProto.toString;var reNative=RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");var ceil=Math.ceil,clearTimeout=context.clearTimeout,floor=Math.floor,fnToString=Function.prototype.toString,getPrototypeOf=isNative(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,hasOwnProperty=objectProto.hasOwnProperty,push=arrayRef.push,setTimeout=context.setTimeout,splice=arrayRef.splice,unshift=arrayRef.unshift;var defineProperty=function(){try{var o={},func=isNative(func=Object.defineProperty)&&func,result=func(o,o,o)&&func}catch(e){}return result}();var nativeCreate=isNative(nativeCreate=Object.create)&&nativeCreate,nativeIsArray=isNative(nativeIsArray=Array.isArray)&&nativeIsArray,nativeIsFinite=context.isFinite,nativeIsNaN=context.isNaN,nativeKeys=isNative(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,nativeParseInt=context.parseInt,nativeRandom=Math.random;var ctorByClass={};ctorByClass[arrayClass]=Array;ctorByClass[boolClass]=Boolean;ctorByClass[dateClass]=Date;ctorByClass[funcClass]=Function;ctorByClass[objectClass]=Object;ctorByClass[numberClass]=Number;ctorByClass[regexpClass]=RegExp;ctorByClass[stringClass]=String;function lodash(value){return value&&typeof value=="object"&&!isArray(value)&&hasOwnProperty.call(value,"__wrapped__")?value:new lodashWrapper(value)}function lodashWrapper(value,chainAll){this.__chain__=!!chainAll;this.__wrapped__=value}lodashWrapper.prototype=lodash.prototype;var support=lodash.support={};support.funcDecomp=!isNative(context.WinRTError)&&reThis.test(runInContext);support.funcNames=typeof Function.name=="string";lodash.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function baseBind(bindData){var func=bindData[0],partialArgs=bindData[2],thisArg=bindData[4];function bound(){if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(this instanceof bound){var thisBinding=baseCreate(func.prototype),result=func.apply(thisBinding,args||arguments);return isObject(result)?result:thisBinding}return func.apply(thisArg,args||arguments)}setBindData(bound,bindData);return bound}function baseClone(value,isDeep,callback,stackA,stackB){if(callback){var result=callback(value);if(typeof result!="undefined"){return result}}var isObj=isObject(value);if(isObj){var className=toString.call(value);if(!cloneableClasses[className]){return value}var ctor=ctorByClass[className];switch(className){case boolClass:case dateClass:return new ctor(+value);case numberClass:case stringClass:return new ctor(value);case regexpClass:result=ctor(value.source,reFlags.exec(value));result.lastIndex=value.lastIndex;return result}}else{return value}var isArr=isArray(value);if(isDeep){var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}result=isArr?ctor(value.length):{}}else{result=isArr?slice(value):assign({},value)}if(isArr){if(hasOwnProperty.call(value,"index")){result.index=value.index}if(hasOwnProperty.call(value,"input")){result.input=value.input
}}if(!isDeep){return result}stackA.push(value);stackB.push(result);(isArr?forEach:forOwn)(value,function(objValue,key){result[key]=baseClone(objValue,isDeep,callback,stackA,stackB)});if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseCreate(prototype,properties){return isObject(prototype)?nativeCreate(prototype):{}}if(!nativeCreate){baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}()}function baseCreateCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"||!("prototype"in func)){return func}var bindData=func.__bindData__;if(typeof bindData=="undefined"){if(support.funcNames){bindData=!func.name}bindData=bindData||!support.funcDecomp;if(!bindData){var source=fnToString.call(func);if(!support.funcNames){bindData=!reFuncName.test(source)}if(!bindData){bindData=reThis.test(source);setBindData(func,bindData)}}}if(bindData===false||bindData!==true&&bindData[1]&1){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 2:return function(a,b){return func.call(thisArg,a,b)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)}}return bind(func,thisArg)}function baseCreateWrapper(bindData){var func=bindData[0],bitmask=bindData[1],partialArgs=bindData[2],partialRightArgs=bindData[3],thisArg=bindData[4],arity=bindData[5];var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,key=func;function bound(){var thisBinding=isBind?thisArg:this;if(partialArgs){var args=slice(partialArgs);push.apply(args,arguments)}if(partialRightArgs||isCurry){args||(args=slice(arguments));if(partialRightArgs){push.apply(args,partialRightArgs)}if(isCurry&&args.length<arity){bitmask|=16&~32;return baseCreateWrapper([func,isCurryBound?bitmask:bitmask&~3,args,null,thisArg,arity])}}args||(args=arguments);if(isBindKey){func=thisBinding[key]}if(this instanceof bound){thisBinding=baseCreate(func.prototype);var result=func.apply(thisBinding,args);return isObject(result)?result:thisBinding}return func.apply(thisBinding,args)}setBindData(bound,bindData);return bound}function baseDifference(array,values){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,isLarge=length>=largeArraySize&&indexOf===baseIndexOf,result=[];if(isLarge){var cache=createCache(values);if(cache){indexOf=cacheIndexOf;values=cache}else{isLarge=false}}while(++index<length){var value=array[index];if(indexOf(values,value)<0){result.push(value)}}if(isLarge){releaseObject(values)}return result}function baseFlatten(array,isShallow,isStrict,fromIndex){var index=(fromIndex||0)-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value&&typeof value=="object"&&typeof value.length=="number"&&(isArray(value)||isArguments(value))){if(!isShallow){value=baseFlatten(value,isShallow,isStrict)}var valIndex=-1,valLength=value.length,resIndex=result.length;result.length+=valLength;while(++valIndex<valLength){result[resIndex++]=value[valIndex]}}else if(!isStrict){result.push(value)}}return result}function baseIsEqual(a,b,callback,isWhere,stackA,stackB){if(callback){var result=callback(a,b);if(typeof result!="undefined"){return!!result}}if(a===b){return a!==0||1/a==1/b}var type=typeof a,otherType=typeof b;if(a===a&&!(a&&objectTypes[type])&&!(b&&objectTypes[otherType])){return false}if(a==null||b==null){return a===b}var className=toString.call(a),otherClass=toString.call(b);if(className==argsClass){className=objectClass}if(otherClass==argsClass){otherClass=objectClass}if(className!=otherClass){return false}switch(className){case boolClass:case dateClass:return+a==+b;case numberClass:return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case regexpClass:case stringClass:return a==String(b)}var isArr=className==arrayClass;if(!isArr){var aWrapped=hasOwnProperty.call(a,"__wrapped__"),bWrapped=hasOwnProperty.call(b,"__wrapped__");if(aWrapped||bWrapped){return baseIsEqual(aWrapped?a.__wrapped__:a,bWrapped?b.__wrapped__:b,callback,isWhere,stackA,stackB)}if(className!=objectClass){return false}var ctorA=a.constructor,ctorB=b.constructor;if(ctorA!=ctorB&&!(isFunction(ctorA)&&ctorA instanceof ctorA&&isFunction(ctorB)&&ctorB instanceof ctorB)&&("constructor"in a&&"constructor"in b)){return false}}var initedStack=!stackA;stackA||(stackA=getArray());stackB||(stackB=getArray());var length=stackA.length;while(length--){if(stackA[length]==a){return stackB[length]==b}}var size=0;result=true;stackA.push(a);stackB.push(b);if(isArr){length=a.length;size=b.length;result=size==length;if(result||isWhere){while(size--){var index=length,value=b[size];if(isWhere){while(index--){if(result=baseIsEqual(a[index],value,callback,isWhere,stackA,stackB)){break}}}else if(!(result=baseIsEqual(a[size],value,callback,isWhere,stackA,stackB))){break}}}}else{forIn(b,function(value,key,b){if(hasOwnProperty.call(b,key)){size++;return result=hasOwnProperty.call(a,key)&&baseIsEqual(a[key],value,callback,isWhere,stackA,stackB)}});if(result&&!isWhere){forIn(a,function(value,key,a){if(hasOwnProperty.call(a,key)){return result=--size>-1}})}}stackA.pop();stackB.pop();if(initedStack){releaseArray(stackA);releaseArray(stackB)}return result}function baseMerge(object,source,callback,stackA,stackB){(isArray(source)?forEach:forOwn)(source,function(source,key){var found,isArr,result=source,value=object[key];if(source&&((isArr=isArray(source))||isPlainObject(source))){var stackLength=stackA.length;while(stackLength--){if(found=stackA[stackLength]==source){value=stackB[stackLength];break}}if(!found){var isShallow;if(callback){result=callback(value,source);if(isShallow=typeof result!="undefined"){value=result}}if(!isShallow){value=isArr?isArray(value)?value:[]:isPlainObject(value)?value:{}}stackA.push(source);stackB.push(value);if(!isShallow){baseMerge(value,source,callback,stackA,stackB)}}}else{if(callback){result=callback(value,source);if(typeof result=="undefined"){result=source}}if(typeof result!="undefined"){value=result}}object[key]=value})}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseUniq(array,isSorted,callback){var index=-1,indexOf=getIndexOf(),length=array?array.length:0,result=[];var isLarge=!isSorted&&length>=largeArraySize&&indexOf===baseIndexOf,seen=callback||isLarge?getArray():result;if(isLarge){var cache=createCache(seen);indexOf=cacheIndexOf;seen=cache}while(++index<length){var value=array[index],computed=callback?callback(value,index,array):value;if(isSorted?!index||seen[seen.length-1]!==computed:indexOf(seen,computed)<0){if(callback||isLarge){seen.push(computed)}result.push(value)}}if(isLarge){releaseArray(seen.array);releaseObject(seen)}else if(callback){releaseArray(seen)}return result}function createAggregator(setter){return function(collection,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];setter(result,value,callback(value,index,collection),collection)}}else{forOwn(collection,function(value,key,collection){setter(result,value,callback(value,key,collection),collection)})}return result}}function createWrapper(func,bitmask,partialArgs,partialRightArgs,thisArg,arity){var isBind=bitmask&1,isBindKey=bitmask&2,isCurry=bitmask&4,isCurryBound=bitmask&8,isPartial=bitmask&16,isPartialRight=bitmask&32;if(!isBindKey&&!isFunction(func)){throw new TypeError}if(isPartial&&!partialArgs.length){bitmask&=~16;isPartial=partialArgs=false}if(isPartialRight&&!partialRightArgs.length){bitmask&=~32;isPartialRight=partialRightArgs=false}var bindData=func&&func.__bindData__;if(bindData&&bindData!==true){bindData=slice(bindData);if(bindData[2]){bindData[2]=slice(bindData[2])}if(bindData[3]){bindData[3]=slice(bindData[3])}if(isBind&&!(bindData[1]&1)){bindData[4]=thisArg}if(!isBind&&bindData[1]&1){bitmask|=8}if(isCurry&&!(bindData[1]&4)){bindData[5]=arity}if(isPartial){push.apply(bindData[2]||(bindData[2]=[]),partialArgs)}if(isPartialRight){unshift.apply(bindData[3]||(bindData[3]=[]),partialRightArgs)}bindData[1]|=bitmask;return createWrapper.apply(null,bindData)}var creater=bitmask==1||bitmask===17?baseBind:baseCreateWrapper;return creater([func,bitmask,partialArgs,partialRightArgs,thisArg,arity])}function escapeHtmlChar(match){return htmlEscapes[match]}function getIndexOf(){var result=(result=lodash.indexOf)===indexOf?baseIndexOf:result;return result}function isNative(value){return typeof value=="function"&&reNative.test(value)}var setBindData=!defineProperty?noop:function(func,value){descriptor.value=value;defineProperty(func,"__bindData__",descriptor)};function shimIsPlainObject(value){var ctor,result;if(!(value&&toString.call(value)==objectClass)||(ctor=value.constructor,isFunction(ctor)&&!(ctor instanceof ctor))){return false}forIn(value,function(value,key){result=key});return typeof result=="undefined"||hasOwnProperty.call(value,result)}function unescapeHtmlChar(match){return htmlUnescapes[match]}function isArguments(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==argsClass||false}var isArray=nativeIsArray||function(value){return value&&typeof value=="object"&&typeof value.length=="number"&&toString.call(value)==arrayClass||false};var shimKeys=function(object){var index,iterable=object,result=[];if(!iterable)return result;if(!objectTypes[typeof object])return result;for(index in iterable){if(hasOwnProperty.call(iterable,index)){result.push(index)}}return result};var keys=!nativeKeys?shimKeys:function(object){if(!isObject(object)){return[]}return nativeKeys(object)};var htmlEscapes={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var htmlUnescapes=invert(htmlEscapes);var reEscapedHtml=RegExp("("+keys(htmlUnescapes).join("|")+")","g"),reUnescapedHtml=RegExp("["+keys(htmlEscapes).join("")+"]","g");var assign=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;if(argsLength>3&&typeof args[argsLength-2]=="function"){var callback=baseCreateCallback(args[--argsLength-1],args[argsLength--],2)}else if(argsLength>2&&typeof args[argsLength-1]=="function"){callback=args[--argsLength]}while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];result[index]=callback?callback(result[index],iterable[index]):iterable[index]}}}return result};function clone(value,isDeep,callback,thisArg){if(typeof isDeep!="boolean"&&isDeep!=null){thisArg=callback;callback=isDeep;isDeep=false}return baseClone(value,isDeep,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function cloneDeep(value,callback,thisArg){return baseClone(value,true,typeof callback=="function"&&baseCreateCallback(callback,thisArg,1))}function create(prototype,properties){var result=baseCreate(prototype);return properties?assign(result,properties):result}var defaults=function(object,source,guard){var index,iterable=object,result=iterable;if(!iterable)return result;var args=arguments,argsIndex=0,argsLength=typeof guard=="number"?2:args.length;while(++argsIndex<argsLength){iterable=args[argsIndex];if(iterable&&objectTypes[typeof iterable]){var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(typeof result[index]=="undefined")result[index]=iterable[index]}}}return result};function findKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}function findLastKey(object,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forOwnRight(object,function(value,key,object){if(callback(value,key,object)){result=key;return false}});return result}var forIn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);for(index in iterable){if(callback(iterable[index],index,collection)===false)return result}return result};function forInRight(object,callback,thisArg){var pairs=[];forIn(object,function(value,key){pairs.push(key,value)});var length=pairs.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){if(callback(pairs[length--],pairs[length],object)===false){break}}return object}var forOwn=function(collection,callback,thisArg){var index,iterable=collection,result=iterable;if(!iterable)return result;if(!objectTypes[typeof iterable])return result;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);var ownIndex=-1,ownProps=objectTypes[typeof iterable]&&keys(iterable),length=ownProps?ownProps.length:0;while(++ownIndex<length){index=ownProps[ownIndex];if(callback(iterable[index],index,collection)===false)return result}return result};function forOwnRight(object,callback,thisArg){var props=keys(object),length=props.length;callback=baseCreateCallback(callback,thisArg,3);while(length--){var key=props[length];if(callback(object[key],key,object)===false){break}}return object}function functions(object){var result=[];forIn(object,function(value,key){if(isFunction(value)){result.push(key)}});return result.sort()}function has(object,key){return object?hasOwnProperty.call(object,key):false}function invert(object){var index=-1,props=keys(object),length=props.length,result={};while(++index<length){var key=props[index];result[object[key]]=key}return result}function isBoolean(value){return value===true||value===false||value&&typeof value=="object"&&toString.call(value)==boolClass||false}function isDate(value){return value&&typeof value=="object"&&toString.call(value)==dateClass||false}function isElement(value){return value&&value.nodeType===1||false}function isEmpty(value){var result=true;if(!value){return result}var className=toString.call(value),length=value.length;if(className==arrayClass||className==stringClass||className==argsClass||className==objectClass&&typeof length=="number"&&isFunction(value.splice)){return!length}forOwn(value,function(){return result=false});return result}function isEqual(a,b,callback,thisArg){return baseIsEqual(a,b,typeof callback=="function"&&baseCreateCallback(callback,thisArg,2))}function isFinite(value){return nativeIsFinite(value)&&!nativeIsNaN(parseFloat(value))}function isFunction(value){return typeof value=="function"}function isObject(value){return!!(value&&objectTypes[typeof value])}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return value===null}function isNumber(value){return typeof value=="number"||value&&typeof value=="object"&&toString.call(value)==numberClass||false}var isPlainObject=!getPrototypeOf?shimIsPlainObject:function(value){if(!(value&&toString.call(value)==objectClass)){return false}var valueOf=value.valueOf,objProto=isNative(valueOf)&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)};function isRegExp(value){return value&&typeof value=="object"&&toString.call(value)==regexpClass||false}function isString(value){return typeof value=="string"||value&&typeof value=="object"&&toString.call(value)==stringClass||false}function isUndefined(value){return typeof value=="undefined"}function mapValues(object,callback,thisArg){var result={};callback=lodash.createCallback(callback,thisArg,3);forOwn(object,function(value,key,object){result[key]=callback(value,key,object)});return result}function merge(object){var args=arguments,length=2;if(!isObject(object)){return object}if(typeof args[2]!="number"){length=args.length}if(length>3&&typeof args[length-2]=="function"){var callback=baseCreateCallback(args[--length-1],args[length--],2)}else if(length>2&&typeof args[length-1]=="function"){callback=args[--length]}var sources=slice(arguments,1,length),index=-1,stackA=getArray(),stackB=getArray();while(++index<length){baseMerge(object,sources[index],callback,stackA,stackB)}releaseArray(stackA);releaseArray(stackB);return object}function omit(object,callback,thisArg){var result={};if(typeof callback!="function"){var props=[];forIn(object,function(value,key){props.push(key)});props=baseDifference(props,baseFlatten(arguments,true,false,1));var index=-1,length=props.length;while(++index<length){var key=props[index];result[key]=object[key]}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(!callback(value,key,object)){result[key]=value}})}return result}function pairs(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){var key=props[index];result[index]=[key,object[key]]}return result}function pick(object,callback,thisArg){var result={};if(typeof callback!="function"){var index=-1,props=baseFlatten(arguments,true,false,1),length=isObject(object)?props.length:0;while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}}else{callback=lodash.createCallback(callback,thisArg,3);forIn(object,function(value,key,object){if(callback(value,key,object)){result[key]=value}})}return result}function transform(object,callback,accumulator,thisArg){var isArr=isArray(object);if(accumulator==null){if(isArr){accumulator=[]}else{var ctor=object&&object.constructor,proto=ctor&&ctor.prototype;accumulator=baseCreate(proto)}}if(callback){callback=lodash.createCallback(callback,thisArg,4);(isArr?forEach:forOwn)(object,function(value,index,object){return callback(accumulator,value,index,object)})}return accumulator}function values(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){result[index]=object[props[index]]}return result}function at(collection){var args=arguments,index=-1,props=baseFlatten(args,true,false,1),length=args[2]&&args[2][args[1]]===collection?1:props.length,result=Array(length);while(++index<length){result[index]=collection[props[index]]}return result}function contains(collection,target,fromIndex){var index=-1,indexOf=getIndexOf(),length=collection?collection.length:0,result=false;fromIndex=(fromIndex<0?nativeMax(0,length+fromIndex):fromIndex)||0;if(isArray(collection)){result=indexOf(collection,target,fromIndex)>-1}else if(typeof length=="number"){result=(isString(collection)?collection.indexOf(target,fromIndex):indexOf(collection,target,fromIndex))>-1}else{forOwn(collection,function(value){if(++index>=fromIndex){return!(result=value===target)}})}return result}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key]++:result[key]=1});function every(collection,callback,thisArg){var result=true;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(!(result=!!callback(collection[index],index,collection))){break}}}else{forOwn(collection,function(value,index,collection){return result=!!callback(value,index,collection)})}return result}function filter(collection,callback,thisArg){var result=[];callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){result.push(value)}}}else{forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result.push(value)}})}return result}function find(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){var value=collection[index];if(callback(value,index,collection)){return value}}}else{var result;forOwn(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}}function findLast(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);forEachRight(collection,function(value,index,collection){if(callback(value,index,collection)){result=value;return false}});return result}function forEach(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(++index<length){if(callback(collection[index],index,collection)===false){break}}}else{forOwn(collection,callback)}return collection}function forEachRight(collection,callback,thisArg){var length=collection?collection.length:0;callback=callback&&typeof thisArg=="undefined"?callback:baseCreateCallback(callback,thisArg,3);if(typeof length=="number"){while(length--){if(callback(collection[length],length,collection)===false){break}}}else{var props=keys(collection);length=props.length;forOwn(collection,function(value,key,collection){key=props?props[--length]:--length;return callback(collection[key],key,collection)})}return collection}var groupBy=createAggregator(function(result,value,key){(hasOwnProperty.call(result,key)?result[key]:result[key]=[]).push(value)});var indexBy=createAggregator(function(result,value,key){result[key]=value});function invoke(collection,methodName){var args=slice(arguments,2),index=-1,isFunc=typeof methodName=="function",length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){result[++index]=(isFunc?methodName:value[methodName]).apply(value,args)});return result}function map(collection,callback,thisArg){var index=-1,length=collection?collection.length:0;callback=lodash.createCallback(callback,thisArg,3);if(typeof length=="number"){var result=Array(length);while(++index<length){result[index]=callback(collection[index],index,collection)}}else{result=[];forOwn(collection,function(value,key,collection){result[++index]=callback(value,key,collection)})}return result}function max(collection,callback,thisArg){var computed=-Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value>result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current>computed){computed=current;result=value}})}return result}function min(collection,callback,thisArg){var computed=Infinity,result=computed;if(typeof callback!="function"&&thisArg&&thisArg[callback]===collection){callback=null}if(callback==null&&isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];if(value<result){result=value}}}else{callback=callback==null&&isString(collection)?charAtCallback:lodash.createCallback(callback,thisArg,3);forEach(collection,function(value,index,collection){var current=callback(value,index,collection);if(current<computed){computed=current;result=value}})}return result}var pluck=map;function reduce(collection,callback,accumulator,thisArg){if(!collection)return accumulator;var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);var index=-1,length=collection.length;if(typeof length=="number"){if(noaccum){accumulator=collection[++index]}while(++index<length){accumulator=callback(accumulator,collection[index],index,collection)}}else{forOwn(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)})}return accumulator}function reduceRight(collection,callback,accumulator,thisArg){var noaccum=arguments.length<3;callback=lodash.createCallback(callback,thisArg,4);forEachRight(collection,function(value,index,collection){accumulator=noaccum?(noaccum=false,value):callback(accumulator,value,index,collection)});return accumulator}function reject(collection,callback,thisArg){callback=lodash.createCallback(callback,thisArg,3);return filter(collection,function(value,index,collection){return!callback(value,index,collection)})}function sample(collection,n,guard){if(collection&&typeof collection.length!="number"){collection=values(collection)}if(n==null||guard){return collection?collection[baseRandom(0,collection.length-1)]:undefined}var result=shuffle(collection);result.length=nativeMin(nativeMax(0,n),result.length);return result}function shuffle(collection){var index=-1,length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);forEach(collection,function(value){var rand=baseRandom(0,++index);result[index]=result[rand];result[rand]=value});return result}function size(collection){var length=collection?collection.length:0;return typeof length=="number"?length:keys(collection).length}function some(collection,callback,thisArg){var result;callback=lodash.createCallback(callback,thisArg,3);var index=-1,length=collection?collection.length:0;if(typeof length=="number"){while(++index<length){if(result=callback(collection[index],index,collection)){break}}}else{forOwn(collection,function(value,index,collection){return!(result=callback(value,index,collection))})}return!!result}function sortBy(collection,callback,thisArg){var index=-1,isArr=isArray(callback),length=collection?collection.length:0,result=Array(typeof length=="number"?length:0);if(!isArr){callback=lodash.createCallback(callback,thisArg,3)}forEach(collection,function(value,key,collection){var object=result[++index]=getObject();if(isArr){object.criteria=map(callback,function(key){return value[key]})}else{(object.criteria=getArray())[0]=callback(value,key,collection)}object.index=index;object.value=value});length=result.length;result.sort(compareAscending);while(length--){var object=result[length];result[length]=object.value;if(!isArr){releaseArray(object.criteria)}releaseObject(object)}return result}function toArray(collection){if(collection&&typeof collection.length=="number"){return slice(collection)}return values(collection)}var where=filter;function compact(array){var index=-1,length=array?array.length:0,result=[];while(++index<length){var value=array[index];if(value){result.push(value)}}return result}function difference(array){return baseDifference(array,baseFlatten(arguments,true,true,1))}function findIndex(array,callback,thisArg){var index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length){if(callback(array[index],index,array)){return index}}return-1}function findLastIndex(array,callback,thisArg){var length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(length--){if(callback(array[length],length,array)){return length}}return-1}function first(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=-1;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[0]:undefined}}return slice(array,0,nativeMin(nativeMax(0,n),length))}function flatten(array,isShallow,callback,thisArg){if(typeof isShallow!="boolean"&&isShallow!=null){thisArg=callback;callback=typeof isShallow!="function"&&thisArg&&thisArg[isShallow]===array?null:isShallow;isShallow=false}if(callback!=null){array=map(array,callback,thisArg)}return baseFlatten(array,isShallow)}function indexOf(array,value,fromIndex){if(typeof fromIndex=="number"){var length=array?array.length:0;fromIndex=fromIndex<0?nativeMax(0,length+fromIndex):fromIndex||0}else if(fromIndex){var index=sortedIndex(array,value);return array[index]===value?index:-1}return baseIndexOf(array,value,fromIndex)}function initial(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:callback||n}return slice(array,0,nativeMin(nativeMax(0,length-n),length))}function intersection(){var args=[],argsIndex=-1,argsLength=arguments.length,caches=getArray(),indexOf=getIndexOf(),trustIndexOf=indexOf===baseIndexOf,seen=getArray();while(++argsIndex<argsLength){var value=arguments[argsIndex];if(isArray(value)||isArguments(value)){args.push(value);caches.push(trustIndexOf&&value.length>=largeArraySize&&createCache(argsIndex?args[argsIndex]:seen))}}var array=args[0],index=-1,length=array?array.length:0,result=[];outer:while(++index<length){var cache=caches[0];value=array[index];if((cache?cacheIndexOf(cache,value):indexOf(seen,value))<0){argsIndex=argsLength;(cache||seen).push(value);while(--argsIndex){cache=caches[argsIndex];if((cache?cacheIndexOf(cache,value):indexOf(args[argsIndex],value))<0){continue outer}}result.push(value)}}while(argsLength--){cache=caches[argsLength];if(cache){releaseObject(cache)}}releaseArray(caches);releaseArray(seen);return result}function last(array,callback,thisArg){var n=0,length=array?array.length:0;if(typeof callback!="number"&&callback!=null){var index=length;callback=lodash.createCallback(callback,thisArg,3);while(index--&&callback(array[index],index,array)){n++}}else{n=callback;if(n==null||thisArg){return array?array[length-1]:undefined}}return slice(array,nativeMax(0,length-n))}function lastIndexOf(array,value,fromIndex){var index=array?array.length:0;if(typeof fromIndex=="number"){index=(fromIndex<0?nativeMax(0,index+fromIndex):nativeMin(fromIndex,index-1))+1}while(index--){if(array[index]===value){return index}}return-1}function pull(array){var args=arguments,argsIndex=0,argsLength=args.length,length=array?array.length:0;while(++argsIndex<argsLength){var index=-1,value=args[argsIndex];while(++index<length){if(array[index]===value){splice.call(array,index--,1);length--}}}return array}function range(start,end,step){start=+start||0;step=typeof step=="number"?step:+step||1;if(end==null){end=start;start=0}var index=-1,length=nativeMax(0,ceil((end-start)/(step||1))),result=Array(length);while(++index<length){result[index]=start;start+=step}return result}function remove(array,callback,thisArg){var index=-1,length=array?array.length:0,result=[];callback=lodash.createCallback(callback,thisArg,3);while(++index<length){var value=array[index];if(callback(value,index,array)){result.push(value);splice.call(array,index--,1);length--}}return result}function rest(array,callback,thisArg){if(typeof callback!="number"&&callback!=null){var n=0,index=-1,length=array?array.length:0;callback=lodash.createCallback(callback,thisArg,3);while(++index<length&&callback(array[index],index,array)){n++}}else{n=callback==null||thisArg?1:nativeMax(0,callback)}return slice(array,n)}function sortedIndex(array,value,callback,thisArg){var low=0,high=array?array.length:low;callback=callback?lodash.createCallback(callback,thisArg,1):identity;value=callback(value);while(low<high){var mid=low+high>>>1;callback(array[mid])<value?low=mid+1:high=mid}return low}function union(){return baseUniq(baseFlatten(arguments,true,true))}function uniq(array,isSorted,callback,thisArg){if(typeof isSorted!="boolean"&&isSorted!=null){thisArg=callback;callback=typeof isSorted!="function"&&thisArg&&thisArg[isSorted]===array?null:isSorted;
isSorted=false}if(callback!=null){callback=lodash.createCallback(callback,thisArg,3)}return baseUniq(array,isSorted,callback)}function without(array){return baseDifference(array,slice(arguments,1))}function xor(){var index=-1,length=arguments.length;while(++index<length){var array=arguments[index];if(isArray(array)||isArguments(array)){var result=result?baseUniq(baseDifference(result,array).concat(baseDifference(array,result))):array}}return result||[]}function zip(){var array=arguments.length>1?arguments:arguments[0],index=-1,length=array?max(pluck(array,"length")):0,result=Array(length<0?0:length);while(++index<length){result[index]=pluck(array,index)}return result}function zipObject(keys,values){var index=-1,length=keys?keys.length:0,result={};if(!values&&length&&!isArray(keys[0])){values=[]}while(++index<length){var key=keys[index];if(values){result[key]=values[index]}else if(key){result[key[0]]=key[1]}}return result}function after(n,func){if(!isFunction(func)){throw new TypeError}return function(){if(--n<1){return func.apply(this,arguments)}}}function bind(func,thisArg){return arguments.length>2?createWrapper(func,17,slice(arguments,2),null,thisArg):createWrapper(func,1,null,null,thisArg)}function bindAll(object){var funcs=arguments.length>1?baseFlatten(arguments,true,false,1):functions(object),index=-1,length=funcs.length;while(++index<length){var key=funcs[index];object[key]=createWrapper(object[key],1,null,null,object)}return object}function bindKey(object,key){return arguments.length>2?createWrapper(key,19,slice(arguments,2),null,object):createWrapper(key,3,null,null,object)}function compose(){var funcs=arguments,length=funcs.length;while(length--){if(!isFunction(funcs[length])){throw new TypeError}}return function(){var args=arguments,length=funcs.length;while(length--){args=[funcs[length].apply(this,args)]}return args[0]}}function curry(func,arity){arity=typeof arity=="number"?arity:+arity||func.length;return createWrapper(func,4,null,null,null,arity)}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError}wait=nativeMax(0,wait)||0;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&(nativeMax(wait,options.maxWait)||0);trailing="trailing"in options?options.trailing:trailing}var delayed=function(){var remaining=wait-(now()-stamp);if(remaining<=0){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}};var maxDelayed=function(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}};return function(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}}function defer(func){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,1);return setTimeout(function(){func.apply(undefined,args)},1)}function delay(func,wait){if(!isFunction(func)){throw new TypeError}var args=slice(arguments,2);return setTimeout(function(){func.apply(undefined,args)},wait)}function memoize(func,resolver){if(!isFunction(func)){throw new TypeError}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):keyPrefix+arguments[0];return hasOwnProperty.call(cache,key)?cache[key]:cache[key]=func.apply(this,arguments)};memoized.cache={};return memoized}function once(func){var ran,result;if(!isFunction(func)){throw new TypeError}return function(){if(ran){return result}ran=true;result=func.apply(this,arguments);func=null;return result}}function partial(func){return createWrapper(func,16,slice(arguments,1))}function partialRight(func){return createWrapper(func,32,null,slice(arguments,1))}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?options.leading:leading;trailing="trailing"in options?options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){return createWrapper(wrapper,16,[value])}function constant(value){return function(){return value}}function createCallback(func,thisArg,argCount){var type=typeof func;if(func==null||type=="function"){return baseCreateCallback(func,thisArg,argCount)}if(type!="object"){return property(func)}var props=keys(func),key=props[0],a=func[key];if(props.length==1&&a===a&&!isObject(a)){return function(object){var b=object[key];return a===b&&(a!==0||1/a==1/b)}}return function(object){var length=props.length,result=false;while(length--){if(!(result=baseIsEqual(object[props[length]],func[props[length]],null,true))){break}}return result}}function escape(string){return string==null?"":String(string).replace(reUnescapedHtml,escapeHtmlChar)}function identity(value){return value}function mixin(object,source,options){var chain=true,methodNames=source&&functions(source);if(!source||!options&&!methodNames.length){if(options==null){options=source}ctor=lodashWrapper;source=object;object=lodash;methodNames=functions(source)}if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}var ctor=object,isFunc=isFunction(ctor);forEach(methodNames,function(methodName){var func=object[methodName]=source[methodName];if(isFunc){ctor.prototype[methodName]=function(){var chainAll=this.__chain__,value=this.__wrapped__,args=[value];push.apply(args,arguments);var result=func.apply(object,args);if(chain||chainAll){if(value===result&&isObject(result)){return this}result=new ctor(result);result.__chain__=chainAll}return result}}})}function noConflict(){context._=oldDash;return this}function noop(){}var now=isNative(now=Date.now)&&now||function(){return(new Date).getTime()};var parseInt=nativeParseInt(whitespace+"08")==8?nativeParseInt:function(value,radix){return nativeParseInt(isString(value)?value.replace(reLeadingSpacesAndZeros,""):value,radix||0)};function property(key){return function(object){return object[key]}}function random(min,max,floating){var noMin=min==null,noMax=max==null;if(floating==null){if(typeof min=="boolean"&&noMax){floating=min;min=1}else if(!noMax&&typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}function result(object,key){if(object){var value=object[key];return isFunction(value)?object[key]():value}}function template(text,data,options){var settings=lodash.templateSettings;text=String(text||"");options=defaults({},options,settings);var imports=defaults({},options.imports,settings.imports),importsKeys=keys(imports),importsValues=values(imports);var isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");text.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=text.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable,hasVariable=variable;if(!hasVariable){variable="obj";source="with ("+variable+") {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+variable+") {\n"+(hasVariable?"":variable+" || ("+variable+" = {});\n")+"var __t, __p = '', __e = _.escape"+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var sourceURL="\n/*\n//# sourceURL="+(options.sourceURL||"/lodash/template/source["+templateCounter++ +"]")+"\n*/";try{var result=Function(importsKeys,"return "+source+sourceURL).apply(undefined,importsValues)}catch(e){e.source=source;throw e}if(data){return result(data)}result.source=source;return result}function times(n,callback,thisArg){n=(n=+n)>-1?n:0;var index=-1,result=Array(n);callback=baseCreateCallback(callback,thisArg,1);while(++index<n){result[index]=callback(index)}return result}function unescape(string){return string==null?"":String(string).replace(reEscapedHtml,unescapeHtmlChar)}function uniqueId(prefix){var id=++idCounter;return String(prefix==null?"":prefix)+id}function chain(value){value=new lodashWrapper(value);value.__chain__=true;return value}function tap(value,interceptor){interceptor(value);return value}function wrapperChain(){this.__chain__=true;return this}function wrapperToString(){return String(this.__wrapped__)}function wrapperValueOf(){return this.__wrapped__}lodash.after=after;lodash.assign=assign;lodash.at=at;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.chain=chain;lodash.compact=compact;lodash.compose=compose;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.createCallback=createCallback;lodash.curry=curry;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.filter=filter;lodash.flatten=flatten;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.functions=functions;lodash.groupBy=groupBy;lodash.indexBy=indexBy;lodash.initial=initial;lodash.intersection=intersection;lodash.invert=invert;lodash.invoke=invoke;lodash.keys=keys;lodash.map=map;lodash.mapValues=mapValues;lodash.max=max;lodash.memoize=memoize;lodash.merge=merge;lodash.min=min;lodash.omit=omit;lodash.once=once;lodash.pairs=pairs;lodash.partial=partial;lodash.partialRight=partialRight;lodash.pick=pick;lodash.pluck=pluck;lodash.property=property;lodash.pull=pull;lodash.range=range;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.shuffle=shuffle;lodash.sortBy=sortBy;lodash.tap=tap;lodash.throttle=throttle;lodash.times=times;lodash.toArray=toArray;lodash.transform=transform;lodash.union=union;lodash.uniq=uniq;lodash.values=values;lodash.where=where;lodash.without=without;lodash.wrap=wrap;lodash.xor=xor;lodash.zip=zip;lodash.zipObject=zipObject;lodash.collect=map;lodash.drop=rest;lodash.each=forEach;lodash.eachRight=forEachRight;lodash.extend=assign;lodash.methods=functions;lodash.object=zipObject;lodash.select=filter;lodash.tail=rest;lodash.unique=uniq;lodash.unzip=zip;mixin(lodash);lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.contains=contains;lodash.escape=escape;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.has=has;lodash.identity=identity;lodash.indexOf=indexOf;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isBoolean=isBoolean;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isNaN=isNaN;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isString=isString;lodash.isUndefined=isUndefined;lodash.lastIndexOf=lastIndexOf;lodash.mixin=mixin;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.result=result;lodash.runInContext=runInContext;lodash.size=size;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.template=template;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.all=every;lodash.any=some;lodash.detect=find;lodash.findWhere=find;lodash.foldl=reduce;lodash.foldr=reduceRight;lodash.include=contains;lodash.inject=reduce;mixin(function(){var source={};forOwn(lodash,function(func,methodName){if(!lodash.prototype[methodName]){source[methodName]=func}});return source}(),false);lodash.first=first;lodash.last=last;lodash.sample=sample;lodash.take=first;lodash.head=first;forOwn(lodash,function(func,methodName){var callbackable=methodName!=="sample";if(!lodash.prototype[methodName]){lodash.prototype[methodName]=function(n,guard){var chainAll=this.__chain__,result=func(this.__wrapped__,n,guard);return!chainAll&&(n==null||guard&&!(callbackable&&typeof n=="function"))?result:new lodashWrapper(result,chainAll)}}});lodash.VERSION="2.4.1";lodash.prototype.chain=wrapperChain;lodash.prototype.toString=wrapperToString;lodash.prototype.value=wrapperValueOf;lodash.prototype.valueOf=wrapperValueOf;forEach(["join","pop","shift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){var chainAll=this.__chain__,result=func.apply(this.__wrapped__,arguments);return chainAll?new lodashWrapper(result,chainAll):result}});forEach(["push","reverse","sort","unshift"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){func.apply(this.__wrapped__,arguments);return this}});forEach(["concat","slice","splice"],function(methodName){var func=arrayRef[methodName];lodash.prototype[methodName]=function(){return new lodashWrapper(func.apply(this.__wrapped__,arguments),this.__chain__)}});return lodash}var _=runInContext();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){root._=_;define(function(){return _})}else if(freeExports&&freeModule){if(moduleExports){(freeModule.exports=_)._=_}else{freeExports._=_}}else{root._=_}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({lemonad:[function(require,module,exports){(function(){var root=this;var L=function(fun){var args=L.tail(arguments);if(L.has(args)){return function(){return fun.apply(null,args.concat(L.toArray(arguments)))}}else return L.curry(fun)};L.VERSION="0.7.4";var _slice=Array.prototype.slice;var _concat=Array.prototype.concat;var _ary=function(){var head=arguments[0];if(arguments.length==1)if(L.isArguments(head))return _slice.call(head);else if(L.isArray(head))return head;return _slice.call(arguments)};function fail(str){throw new Error(str)}function _nom(fun){var src=fun.toString();src=src.substr("function ".length);var n=src.substr(0,src.indexOf("("));if(!L.isFunction(fun))fail("Cannot derive the name of a non-function.");if(fun.name&&fun.name===n)return fun.name;if(n)return n;fail("Anonymous function has no name.")}var snapshot=function(thing){if(L.existy(thing)&&L.existy(thing.snapshot))return thing.snapshot();else fail("snapshot not currently implemented")};L.not=function(pred){return function(){return!L.truthy(pred.apply(null,arguments))}};var _existy=function(x){return x!=null};var _truthy=function(x){return x!==false&&_existy(x)};L.existy=_existy;L.truthy=_truthy;L.falsey=L.not(L.truthy);var _kind=function(thing){return Object.prototype.toString.call(thing).slice(8,-1)};var _existyKind=function(type,thing){return _existy(thing)&&_kind(thing)===type};var _nanKind=function(_,thing){return _existy(thing)&&_kind(thing)==="Number"&&thing!=+thing};var _isa=function(type){if(type==="NaN")return _nanKind.bind(undefined,type);return _existyKind.bind(undefined,type)};L.id=function(x){return x};L.len=function(thing){var count=0;if(!L.existy(thing))fail("Cannot check the length of a non-existent thing");if(L.isArray(thing)||L.isString(thing))return thing.length;for(var key in thing){if(L.existy(thing[key]))count++}return count};var _eq=function(lhs,rhs,sawL,sawR,compare){var lhsClass=Object.prototype.toString.call(lhs);var rhsClass=Object.prototype.toString.call(rhs);var result=true;if(compare)return L.truthy(compare(lhs,rhs));if(lhsClass!=rhsClass)return false;if(lhs===rhs)return lhs!==0||1/lhs==1/rhs;if(lhs==null||rhs==null)return lhs===rhs;switch(lhsClass){case"[object Date]":case"[object Boolean]":return+lhs==+rhs;case"[object RegExp]":case"[object String]":return lhs==String(rhs);case"[object Number]":return lhs!=+lhs?rhs!=+rhs:lhs===0?1/lhs==1/rhs:lhs==+rhs}if(typeof lhs!="object"||typeof rhs!="object")return false;var length=sawL.length;while(length--)if(sawL[length]==lhs)return sawR[length]==rhs;sawL.push(lhs);sawR.push(rhs);var size=0;if(lhsClass=="[object Array]"){size=lhs.length;result=size==rhs.length;if(result){while(size--){if(!(result=_eq(lhs[size],rhs[size],sawL,sawR,compare)))break}}}else{var lhsCtor=lhs.constructor;var rhsCtor=rhs.constructor;if(lhsCtor!==rhsCtor&&!(L.isFunction(lhsCtor)&&lhsCtor instanceof lhsCtor&&L.isFunction(rhsCtor)&&rhsCtor instanceof rhsCtor)){return false}for(var key in lhs){if(lhs.hasOwnProperty(key)){size++;if(!(result=rhs.hasOwnProperty(key)&&_eq(lhs[key],rhs[key],sawL,sawR,compare)))break}}if(result){for(key in rhs){if(rhs.hasOwnProperty(key)&&!size--)break}result=!size}}sawL.pop();sawR.pop();return result};L.isNumber=_isa("Number");L.isString=_isa("String");L.isNan=_isa("NaN");L.isArray=_isa("Array");L.isArguments=_isa("Arguments");L.isFunction=_isa("Function");L.isObject=_isa("Object");L.isInstanceOf=function(x,t){return x instanceof t};L.isEmpty=function(thing){return L.len(thing)===0};L.isEven=function(n){if(!L.isNumber(n))fail("It doesn't make sense to ask if a non-number is even. Got: "+n);return n%2===0?true:false};L.isOdd=L.not(L.isEven);L.fail=function(msg){throw new Error(msg)};L.comp=function(){var funs=arguments;var length=funs.length;for(fun in funs){if(!L.isFunction(funs[fun]))fail("L.comp expects a chain of functions, but received "+funs[fun])}return function(){var args=arguments;var length=funs.length;while(length--){args=[funs[length].apply(this,args)]}return args[0]}};var _filter=function(fun){return function(coll){var results=[];if(coll==null)return results;coll.forEach(function(value,index,list){if(_truthy(fun.call(null,value)))results.push(value)});return results}};L.filter=function(fun){var coll=arguments[1];if(_existy(coll))return _filter(fun)(coll);return _filter(fun)};var _map=function(fun){return function(coll){var results=[];if(coll==null)return results;coll.forEach(function(value,index,list){results.push(fun.call(null,value))});return results}};L.map=function(fun){var coll=arguments[1];if(_existy(coll))return _map(fun)(coll);return _map(fun)};var _reduce=function(fun){return function(seed){var acc=seed;return function(coll){coll.forEach(function(value){acc=fun.call(null,acc,value)});return acc}}};L.reduce=function(fun){var count=arguments.length;var seed=arguments[1];var coll=arguments[2];var result;switch(count){case 1:result=_reduce(fun);break;case 2:result=_reduce(fun)(seed);break;case 3:result=_reduce(fun)(seed)(coll);break}return result};var _first=function(array){if(array==null)return void 0;return array[0]};var _head=function(array){if(array==null)return void 0;return _slice.call(array,0,1)};var _tail=function(array){return _slice.call(array,1)};L.first=_first;L.head=_head;L.tail=_tail;L.end=function(n){return function(array){return _slice.call(array,Math.max(array.length-n,0))}};L.last=L.comp(L.first,L.end(1));var _nth=function(index){return function(array){if(index<0||index>array.length-1)L.fail("L.nth failure: attempting to index outside the bounds of the given array.");return array[index]}};L.nth=function(index){var array=arguments[1];if(!L.isNumber(index))L.fail("L.nth expects a number as its index argument.");if(_existy(array))return _nth(index)(array);return _nth(index)};var _has=function(pred){return function(coll){for(var key in coll){if(_truthy(pred(coll[key])))return coll[key]}return undefined}};L.has=_has;var _cat=function(left){return function(right){if(!L.isArray(right))L.fail("L.cat expects an array argument on the RHS");return _concat.call(left,right)}};L.cat=function(l,r){if(!L.isArray(l))L.fail("L.cat expects an array argument on the LHS");if(!L.existy(r))_cat(l);return _cat(l)(r)};var _cons=function(elem){return function(array){return _cat([elem])(array)}};L.cons=function(elem){var array=arguments[1];if(_existy(array))return _cons(elem)(array);return _cons(elem)};L.toArray=_ary;L.ctor=function(obj){return L.existy(obj)?obj.constructor:null};L.isReference=function(x){return x instanceof L.Hole||x instanceof L.CAS};L.meth=L.walterWhite=L.invoker=function(method){var pargs=_tail(arguments);return function(target){if(!_existy(target)){return undefined}var methodName=_nom(method).trim();var targetMethod=target[methodName];var args=_tail(arguments);if(_existy(targetMethod)&&method===targetMethod){return targetMethod.apply(target,_cat(pargs)(args))}else{return undefined}}};L.dispatcher=function(){var funs=L.toArray(arguments);var size=funs.length;return function(target){var ret=undefined;var args=L.tail(arguments);for(var funIndex=0;funIndex<size;funIndex++){var fun=funs[funIndex];ret=fun.apply(fun,cons(target,args));if(existy(ret))return ret}return ret}};L._={cthulhu:true};var _fix=function(fun){var fixedArgs=L.tail(arguments);var fixedLength=L.reduce(function(total,a){if(a===L._)return total+1;else return total},0,fixedArgs);var f=function(){var args=fixedArgs.slice();var arg=0;if(fixedLength!==arguments.length)fail("Expected "+fixedLength+" arguments.");for(var i=0;i<args.length||arg<arguments.length;i++){if(args[i]===L._)args[i]=arguments[arg++]}return fun.apply(null,args)};f.Lemonad={};f.Lemonad.original=fun;return f};L.fix=_fix;L.fix1=_fix(_fix,L._,L._);L.fix2=_fix(_fix,L._,L._,L._);L.fix3=_fix(_fix,L._,L._,L._,L._);L.fix4=_fix(_fix,L._,L._,L._,L._,L._);L.L={direction:"left"};L.R={direction:"right"};var bindRight=function(fun,arg){return function(){return fun.apply({},[].slice.call(arguments).concat(arg))}};var bindLeft=function(fun,arg){return function(){return fun.apply({},[arg].concat(L.toArray(arguments)))}};var currier=function(direction){var binder=direction==L.L?bindLeft:bindRight;return function(fun,count){if(count===undefined){count=fun.length}if(count===0){return fun()}return function(arg){return L.curry(binder(fun,arg),count-1)}}};L.curry=currier(L.L);L.rcurry=currier(L.R);L.partial=L;L.uncurry=function(fun){return function(){var resp=fun;[].forEach.call(arguments,function(arg){resp=resp(arg)});return resp}};L.curry1=L.schonfinkel=function(f){return function(x){return f(x)}};L.curry2=L.schonfinkel2=function(f){return function(a){return function(b){return f(a,b)}}};L.curry3=L.schonfinkel3=function(f){return function(a){return function(b){return function(c){return f(a,b,c)}}}};L.curry4=L.schonfinkel4=function(f){return function(a){return function(b){return function(c){return function(d){return f(a,b,c,d)}}}}};L.rcurry1=L.rschonfinkel=function(f){return function(x){return f(x)}};L.rcurry2=L.rschonfinkel2=function(f){return function(b){return function(a){return f(a,b)}}};L.rcurry3=L.rschonfinkel3=function(f){return function(c){return function(b){return function(a){return f(a,b,c)}}}};L.rcurry4=L.rschonfinkel4=function(f){return function(d){return function(c){return function(b){return function(a){return f(a,b,c,d)}}}}};L.parseInt=L.rcurry2(parseInt);L.gt=L.rcurry2(function(lhs,rhs){return lhs>rhs});L.lt=L.rcurry2(function(lhs,rhs){return lhs<rhs});L.gte=L.rcurry2(function(lhs,rhs){return lhs>=rhs});L.lte=L.rcurry2(function(lhs,rhs){return lhs<=rhs});L.is=L.curry2(function(lhs,rhs){return lhs===rhs});L.oneOf=L.curry2(function(lhs,set){return L.has(L.eq(lhs))(set)});L.eq=function(lhs){return function(rhs){return _eq(lhs,rhs,[],[],undefined)}};L.add=L.rcurry2(function(x,y){return x+y});L.sub=L.rcurry2(function(x,y){return x-y});L.mul=L.rcurry2(function(x,y){return x*y});L.div=L.rcurry2(function(x,y){return x/y});L.inc=function(n){return n+1};L.dec=function(n){return n-1};L.halve=function(n){return n/2};L.partial1=L.partial;L.partial2=L.partial;L.rot=function(fun){return function(){var last=L.end(1)(arguments);var butLast=_slice.call(arguments,0,arguments.length-1);return fun.apply(fun,L.cat(last,butLast))}};L.rotL=function(fun){return function(){var first=L.head(arguments);var rest=L.tail(arguments);return fun.apply(fun,L.cat(rest,first))}};L.cede=function(fun){return function(){var args=L.tail(arguments);return fun.apply(fun,args)}};L.flip=function(fun){return function(){var tmp=arguments[0];arguments[0]=arguments[1];arguments[1]=tmp;return fun.apply(fun,arguments)}};L.lift=function(answerFun,stateFun){return function(){var args=L.toArray(arguments);return function(state){var ans=answerFun.apply(null,L.cons(state)(args));var s=L.existy(stateFun)?stateFun(state):ans;return{answer:ans,state:s}}}};L.actions=function(acts,done){return function(seed){var init={values:[],state:seed};var intermediate=L.reduce(function(stateObj,action){var result=action(stateObj.state);var values=L.cat(stateObj.values,[result.answer]);return{values:values,state:result.state}},init,acts);var keep=L.filter(L.existy,intermediate.values);return done(keep,intermediate.state)}};var _destructiveMerge=function(target,mixins){mixins.forEach(function(mixin){if(mixin){for(var prop in mixin){target[prop]=mixin[prop]}}})};L.mix=function(target){var args=_tail(arguments);_destructiveMerge(target,args);return target};L.merge=function(){var dest=arguments[0];if(L.truthy(dest))_destructiveMerge.apply(null,[dest,L.tail(arguments)]);return dest};L.WatchableMixin=function(){var watchers={};return{notify:function notify(oldVal,newVal){var count=0;for(var key in watchers){var watcher=watchers[key];watcher.call(this,key,oldVal,newVal);count++}return count},watch:function watch(key,fun){watchers[key]=fun;return key},unwatch:function unwatch(key){var old=watchers[key];delete watchers[key];return old}}}();L.addWatch=L.meth(L.WatchableMixin.watch);L.removeWatch=L.meth(L.WatchableMixin.unwatch);L.Hole=function(init,validator){if(validator&&!validator(init))fail("Attempted to set invalid value "+init+" on construction");this._value=init;this._validator=validator};L.HoleMixin={setValue:function setValue(newVal){var validate=this._validator;var oldVal=this._value;if(L.existy(validate))if(!validate(newVal))fail("Attempted to set invalid value "+newVal);this._value=newVal;this.notify(oldVal,newVal);return this._value}};L.SwapMixin={swap:function swap(fun){return this.setValue(fun.apply(this,L.cons(this._value)(L.tail(arguments))))},snapshot:function snapshot(){return snapshot(this._value)}};L.mix(L.Hole.prototype,L.HoleMixin,L.SwapMixin,L.WatchableMixin);L.setValue=L.meth(L.Hole.prototype.setValue);L.swap=L.meth(L.Hole.prototype.swap);L.CAS=function(){L.Hole.apply(this,arguments)};L.CASMixin={compareAndSwap:function compareAndSwap(oldVal,f){if(this._value===oldVal){this.setValue(f(this._value));return true}else{return undefined}}};L.mix(L.CAS.prototype,L.CASMixin,L.HoleMixin,L.SwapMixin,L.WatchableMixin);L.compareAndSwap=L.meth(L.CAS.prototype.compareAndSwap);L.checker=function(message,fun){var f=function(){return fun.apply(fun,arguments)};f["message"]=message;return f};function mapcat(f,xs){return xs.map(f).reduce(function(a,b){return a.concat(b)},[])}function condition1(){var checkers=L.toArray(arguments);return function(fun,arg){var errors=mapcat(function(isValid){return isValid(arg)?[]:[isValid.message]},checkers);if(!L.isEmpty(errors))throw new Error(errors.join(", "));return fun(arg)}}function getType(type){if(typeof type=="function"){if(type==Number){return{name:"Number",fun:function(x){return typeof x=="number"}}}else if(type==String){return{name:"String",fun:function(x){return typeof x=="string"}}}else{return{name:type.name,fun:function(x){return x instanceof type}}}}else if(typeof type=="object"&&type.map){return{name:"["+getType(type[0].name)+"]",fun:function(xs){return xs.map(getType(type[0]).fun).reduce(function(a,b){return a&&b})}}}else if(typeof type=="object"){var valType=getType(type[Object.keys(type)[0]]);return{name:"{String => "+valType.name+"}",fun:function(xs){var passed=!xs.map;for(var k in xs){passed=passed&&valType.fun(xs[k])}return passed}}}}function argTypeChecker(type,argNum){var checker=getType(type);var msg=["Expected argument at index ",argNum," to be of type ",checker.name,"."].join("");return L.checker(msg,checker.fun)}L.typed=function(fun){var types=L.toArray(arguments).slice(1).map(argTypeChecker);return function(){var args=L.toArray(arguments);var errors=mapcat(function(isValid){var arg=args[0];args=args.slice(1);return isValid(arg)?[]:[isValid.message]},types);if(!L.isEmpty(errors))throw new Error(errors.join(", "));return fun.apply({},arguments)}};L.pipeline=function(seed){return L.reduce(function(l,r){return r(l)},seed,L.tail(arguments))};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports){exports=module.exports=L}exports.L=L}else{root.L=L}}).call(this)},{}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({lz:[function(require,module,exports){(function(name,definition){"use strict";if(typeof define=="function"){define(definition)}else if(typeof module!="undefined"&&module.exports){module.exports=definition()}else{var Module=definition(),global=this,old=global[name];Module.noConflict=function(){global[name]=old;return Module};global[name]=Module}}).call(this,"lz",function(){"use strict";var UNDEFINED={};var FALSE={};function _n(){var _this=this;if(_this._p)_this._p(_this._i);var item=_this._l[_this._i++];if(_this._i>_this.length)return UNDEFINED;for(var j=0;j<_this._f.length;j+=1){item=_this._f[j](item);if(item===FALSE)return _this._n()}return item}function _p(list,x){return typeof list==="string"?list.concat(x):(list.push(x),list)}function lz(list){var _this=this;if(!(_this instanceof lz)){return new lz(list)}_this._f=[];_this._i=0;_this._l=list;_this.length=list.length}Object.defineProperty(Array.prototype,"lz",{value:function(){return new lz(this)}});var lz_prototype=lz.prototype;
lz_prototype._r=function(value){this._i=0;return value};lz_prototype._n=_n;lz_prototype.compact=function(){var _this=this;_this._v=null;_this._f.push(function(x){if(!x)return FALSE;return x});return _this};lz_prototype.concat=function(arr){var _this=this;var length=_this.length;_this.length+=arr.length;if(arr instanceof lz){_this._f.push(function(x){if(_this._i>length){x=arr._n();_this._l=_p(_this._l,x)}return x})}else{_this._f.push(function(x){if(_this._i>length){x=arr[_this._i-length-1];_this._l=_p(_this._l,x)}return x})}return _this};lz_prototype.cycle=function(){return lz.cycle(this._l)};lz_prototype.drop=function(n){var _this=this;_this._v=null;var item;while(n-->0){item=_this._n();if(item===UNDEFINED){_this._v=[];return _this}}_this._l=_this._l.slice(_this._i);_this._i=0;_this.length=_this._l.length;return _this};lz_prototype.dropWhile=function(fn){var _this=this;_this._v=null;var item;while(true){item=_this._n();if(item===UNDEFINED){_this._v=[];return _this}if(fn(item)===false)break}_this._l=_this._l.slice(_this._i-1);_this._i=0;_this.length=_this._l.length;return _this};lz_prototype.filter=function(f){var _this=this;_this._v=null;_this._f.push(function(x){if(f(x)===true)return x;else return FALSE});return _this};lz_prototype.flatten=function(shallow){return lz.flatten(this.$(),shallow)};lz_prototype.init=function(){var _this=this;var results=[];var item;var n=_this.length;while(--n>0){item=_this._n();if(item===UNDEFINED)break;results.push(item)}_this._l=_this._v=results;_this._f=[];_this._i=0;_this.length=_this._l.length;return _this};lz_prototype.map=function(f){var _this=this;_this._v=null;_this._f.push(function(x){return f(x)});return _this};lz_prototype.of=function(b){return new lz(b)};lz_prototype.scanl=function(fn){var _this=this;_this._v=null;var prev;_this._f.push(function(x){return prev=fn(prev,x)||x});return _this};lz_prototype.sort=function(fn){var _this=this;_this._v=_this._l=Array.prototype.sort.call(_this._l,fn);return _this};lz_prototype.tail=function(){var _this=this;var results=[];var item;var n=_this.length;_this._n();while(--n>0){item=_this._n();if(item===UNDEFINED)break;results.push(item)}_this._l=_this._v=results;_this._f=[];_this._i=0;_this.length=_this._l.length;return _this};lz_prototype.take=function(n){var _this=this;var results=[];var item;while(n-->0){item=_this._n();if(item===UNDEFINED)break;results.push(item)}_this._l=_this._v=results;_this._f=[];_this._i=0;_this.length=_this._l.length;return _this};lz_prototype.takeWhile=function(fn){var _this=this;var results=[];var result;var item;while(true){item=_this._n();if(item===UNDEFINED)break;result=fn(item);if(result===true)results.push(item);else break}_this._l=_this._v=results;_this._f=[];_this._i=0;_this.length=_this._l.length;return _this};lz_prototype.empty=function(){return new lz([])};lz_prototype.zipWith=function(fn,list){return lz.zipWith(fn,list,this._l)};lz_prototype.all=function(fn){var _this=this;var item;var i=_this.length;while(i-->0){item=_this._n();if(item===UNDEFINED)break;if(fn(item)===false)return _this._r(false)}return _this._r(true)};lz_prototype.and=function(){var _this=this;var item;var i=_this.length;while(i-->0){item=_this._n();if(item===UNDEFINED)break;if(!item)return _this._r(false)}return _this._r(true)};lz_prototype.any=function(fn){var _this=this;var item;var i=_this.length;while(i-->0){item=_this._n();if(item===UNDEFINED)break;if(fn(item)===true)return _this._r(true)}return _this._r(false)};lz_prototype.at=function(n){var _this=this;n=n<0?_this.length+n:n;if(n<0)return _this._r(null);while(--n>=0){if(_this._n()===UNDEFINED)return _this._r(null)}var item=_this._n();return _this._r(item===UNDEFINED?null:item)};lz_prototype.chain=function(f){var _this=this;if(typeof f!=="function"){throw new TypeError("Chain argument must be a function")}var result=f(_this._v||_this._l);if(result instanceof lz){return result}else{return new lz(result.length?result:[result])}};lz_prototype.foldl=function(fn){var _this=this;var result,next;var i=_this.length;result=_this._n();if(result===UNDEFINED)return _this._r(null);while(i-->0){next=_this._n();if(next===UNDEFINED)break;result=fn(result,next)}return _this._r(result)};lz_prototype.elem=function(x){var _this=this;var item;var i=_this.length;var notANumber=isNaN(x);while(i-->0){item=_this._n();if(item===UNDEFINED)break;if(item===x){return _this._r(x!==0||1/x===1/item)}else if(notANumber&&x!==x&&item!==item){return _this._r(true)}}return _this._r(false)};lz_prototype.head=function(){var _this=this;var item=_this._n();return _this._r(item===UNDEFINED?null:item)};lz_prototype.last=function(){var _this=this;var n=-1;var result;var item;while(++n<_this.length){item=_this._n();if(item===UNDEFINED)break;result=item}return _this._r(result)};lz_prototype.nil=function(){var _this=this;var item;if(_this.length===0)return _this._r(true);var i=_this.length;while(i-->0){item=_this._n();if(item===UNDEFINED)break;if(item!=null)return _this._r(false)}return _this._r(true)};lz_prototype.max=function(fn){return lz.max(this.$(),fn)};lz_prototype.min=function(fn){return lz.min(this.$(),fn)};lz_prototype.or=function(){var _this=this;var item;var i=_this.length;while(i-->0){item=_this._n();if(item===UNDEFINED)break;if(!!item)return _this._r(true)}return _this._r(false)};lz_prototype.$=lz_prototype.toArray=function(){var _this=this;if(_this._v){return _this._v}var results=[];var item;var n=_this.length;while(n>0){item=_this._n();if(item===UNDEFINED)break;results.push(item);n-=1}_this._v=results;_this._f=[];_this._i=0;return results};lz_prototype.toString=function(joinBy){var _this=this;if(typeof joinBy!=="string"){joinBy=""}if(_this._v){return typeof _this._v==="string"?_this._v:_this._v.join(joinBy)}var result="";var item,next;while(true){item=_this._n();if(item===UNDEFINED)break;result+=item;next=_this._n();if(next===UNDEFINED)break;result+=joinBy+next}_this._v=result;_this._f=[];_this._i=0;return result};lz_prototype.unlines=function(){var _this=this;var result="";var item,next;while(true){item=_this._n();if(item===UNDEFINED)break;result+=item;next=_this._n();if(next===UNDEFINED)break;result+="\n"+next}return result};lz_prototype.unwords=function(){var _this=this;var result="";var item,next;while(true){item=_this._n();if(item===UNDEFINED)break;result+=item;next=_this._n();if(next===UNDEFINED)break;result+=" "+next}return result};lz.concatMap=function(fn,coll){var l=coll.length;var i=-1;var results=[];while(++i<l){results.push.apply(results,fn(coll[i]))}var instance=new lz(results);instance._v=results;return instance};lz.cycle=function(list){var z=new lz(list);var length=list.length;z.length=Infinity;z._n=function(){if(this._i===length){this._i=0}return _n.call(this)};return z};lz.flatten=function(arr,shallow){var result=[];if(!arr)return result;var value,index=-1,length=arr.length;while(++index<length){value=arr[index];if(Array.isArray(value))result.push.apply(result,shallow?value:lz.flatten(value));else result.push(value)}return result};lz.foldl=function(fn,arr){if(!arr)return null;var item,value=arr[0],index=0,length=arr.length;if(arr instanceof lz){index=arr.length;value=arr._n();if(value===UNDEFINED)return null;while(index-->0){item=arr._n();if(item===UNDEFINED)break;value=fn(value,item)}}else{while(++index<length){value=fn(value,arr[index])}}return value};lz.iterate=function(fn,n){var z=new lz([]);var result;z.length=Infinity;z._n=function(){result=fn(result)||n;this._l.push(result);return _n.call(this)};return z};lz.lines=function(str){return new lz(str.split("\n"))};lz.max=function(arr,fn){if(!arr)return null;var item,value=-Infinity,index=-1,length=arr.length;if(fn){while(++index<length){item=fn(arr[index]);if(item>value)value=item}}else{while(++index<length){item=arr[index];if(item>value)value=item}}return value};lz.min=function(arr,fn){if(!arr)return null;var item,value=Infinity,index=-1,length=arr.length;if(fn){while(++index<length){item=fn(arr[index]);if(item<value)value=item}}else{while(++index<length){item=arr[index];if(item<value)value=item}}return value};lz.of=function(b){return new lz(b)};lz.range=function(start,end){var z=new lz([]);z.length=end;z._p=function(i){this._l[i]=i+start};return z};lz.repeat=function(n){var z=new lz([]);z.length=Infinity;z._n=function(){this._l.push(n);return _n.call(this)};return z};lz.replicate=function(times,n){var z=new lz([]);z.length=times;z._p=function(i){this._l[i]=n};return z};lz.words=function(str){return new lz(str.split(" "))};lz.empty=function(){return new lz([])};lz.zipWith=function(fn,list1,list2){var z=new lz([]);z.length=list1.length<list2.length?list1.length:list2.length;if(!(list1 instanceof lz)&&!(list2 instanceof lz)){z._n=function(){if(this._i>=this.length)return UNDEFINED;return fn(list1[this._i],list2[this._i++])};return z}else{if(!(list1 instanceof lz))list1=lz(list1);if(!(list2 instanceof lz))list2=lz(list2);z._n=function(){this._l.push(fn(list1._n(),list2._n()));return _n.call(this)};return z}};lz.flip=function(a,b){return b};lz.identity=function(a){return a};lz.not=function(b){return!b};return lz})},{}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({ramda:[function(require,module,exports){(function(factory){if(typeof exports==="object"){module.exports=factory(this)}else if(typeof define==="function"&&define.amd){define(factory)}else{this.R=this.ramda=factory(this)}})(function(){"use strict";var R={version:"0.5.0"};function _slice(args,from,to){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return _slice(args,0,args.length);case 2:return _slice(args,from,args.length);default:var length=to-from,list=new Array(length),idx=-1;while(++idx<length){list[idx]=args[from+idx]}return list}}var concat=function _concat(set1,set2){set1=set1||[];set2=set2||[];var length1=set1.length,length2=set2.length,result=new Array(length1+length2);for(var idx=0;idx<length1;idx++){result[idx]=set1[idx]}for(idx=0;idx<length2;idx++){result[idx+length1]=set2[idx]}return result};var toString=Object.prototype.toString;var isArray=Array.isArray||function _isArray(val){return val&&val.length>=0&&toString.call(val)==="[object Array]"};R.isArrayLike=function isArrayLike(x){return isArray(x)||!!x&&typeof x==="object"&&!(x instanceof String)&&(!!(x.nodeType===1&&x.length)||x.length>=0)};var NO_ARGS_EXCEPTION=new TypeError("Function called with no arguments");function curry2(fn){return function(a,b){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return function(b){return fn(a,b)};default:return fn(a,b)}}}function curry3(fn){return function(a,b,c){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return curry2(function(b,c){return fn(a,b,c)});case 2:return function(c){return fn(a,b,c)};default:return fn(a,b,c)}}}if(typeof Object.defineProperty==="function"){try{Object.defineProperty(R,"_",{writable:false,value:void 0})}catch(e){}}var _=R._;void _;var op=R.op=function op(fn){var length=fn.length;if(length<2){throw new Error("Expected binary function.")}var left=curry(fn),right=curry(R.flip(fn));return function(a,b){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return right(a);case 2:return b===R._?left(a):left.apply(null,arguments);default:return left.apply(null,arguments)}}};var curryN=R.curryN=function curryN(length,fn){return function recurry(args){return arity(Math.max(length-(args&&args.length||0),0),function(){if(arguments.length===0){throw NO_ARGS_EXCEPTION}var newArgs=concat(args,arguments);if(newArgs.length>=length){return fn.apply(this,newArgs)}else{return recurry(newArgs)}})}([])};var curry=R.curry=function curry(fn){return curryN(fn.length,fn)};var hasMethod=function _hasMethod(methodName,obj){return obj&&!isArray(obj)&&typeof obj[methodName]==="function"};function checkForMethod(methodname,fn){return function(a,b,c){var length=arguments.length;var obj=arguments[length-1],callBound=obj&&!isArray(obj)&&typeof obj[methodname]==="function";switch(arguments.length){case 0:return fn();case 1:return callBound?obj[methodname]():fn(a);case 2:return callBound?obj[methodname](a):fn(a,b);case 3:return callBound?obj[methodname](a,b):fn(a,b,c)}}}var nAry=R.nAry=function(n,fn){switch(n){case 0:return function(){return fn.call(this)};case 1:return function(a0){return fn.call(this,a0)};case 2:return function(a0,a1){return fn.call(this,a0,a1)};case 3:return function(a0,a1,a2){return fn.call(this,a0,a1,a2)};case 4:return function(a0,a1,a2,a3){return fn.call(this,a0,a1,a2,a3)};case 5:return function(a0,a1,a2,a3,a4){return fn.call(this,a0,a1,a2,a3,a4)};case 6:return function(a0,a1,a2,a3,a4,a5){return fn.call(this,a0,a1,a2,a3,a4,a5)};case 7:return function(a0,a1,a2,a3,a4,a5,a6){return fn.call(this,a0,a1,a2,a3,a4,a5,a6)};case 8:return function(a0,a1,a2,a3,a4,a5,a6,a7){return fn.call(this,a0,a1,a2,a3,a4,a5,a6,a7)};case 9:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8){return fn.call(this,a0,a1,a2,a3,a4,a5,a6,a7,a8)};case 10:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9){return fn.call(this,a0,a1,a2,a3,a4,a5,a6,a7,a8,a9)};default:return fn}};R.unary=function _unary(fn){return nAry(1,fn)};var binary=R.binary=function _binary(fn){return nAry(2,fn)};var arity=R.arity=function(n,fn){switch(n){case 0:return function(){return fn.apply(this,arguments)};case 1:return function(a0){void a0;return fn.apply(this,arguments)};case 2:return function(a0,a1){void a1;return fn.apply(this,arguments)};case 3:return function(a0,a1,a2){void a2;return fn.apply(this,arguments)};case 4:return function(a0,a1,a2,a3){void a3;return fn.apply(this,arguments)};case 5:return function(a0,a1,a2,a3,a4){void a4;return fn.apply(this,arguments)};case 6:return function(a0,a1,a2,a3,a4,a5){void a5;return fn.apply(this,arguments)};case 7:return function(a0,a1,a2,a3,a4,a5,a6){void a6;return fn.apply(this,arguments)};case 8:return function(a0,a1,a2,a3,a4,a5,a6,a7){void a7;return fn.apply(this,arguments)};case 9:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8){void a8;return fn.apply(this,arguments)};case 10:return function(a0,a1,a2,a3,a4,a5,a6,a7,a8,a9){void a9;return fn.apply(this,arguments)};default:return fn}};var invoker=R.invoker=function _invoker(name,obj,len){var method=obj[name];var length=len===void 0?method.length:len;return method&&curryN(length+1,function(){if(arguments.length){var target=Array.prototype.pop.call(arguments);var targetMethod=target[name];if(targetMethod==method){return targetMethod.apply(target,arguments)}}})};var useWith=R.useWith=function _useWith(fn){var transformers=_slice(arguments,1);var tlen=transformers.length;return curry(arity(tlen,function(){var args=[],idx=-1;while(++idx<tlen){args.push(transformers[idx](arguments[idx]))}return fn.apply(this,args.concat(_slice(arguments,tlen)))}))};function forEach(fn,list){var idx=-1,len=list.length;while(++idx<len){fn(list[idx])}return list}R.forEach=curry2(forEach);R.forEach.idx=curry2(function forEachIdx(fn,list){var idx=-1,len=list.length;while(++idx<len){fn(list[idx],idx,list)}return list});var clone=R.clone=function _clone(list){return _slice(list)};function isEmpty(list){return!list||!list.length}R.isEmpty=isEmpty;R.prepend=curry2(function prepend(el,list){return concat([el],list)});R.cons=R.prepend;R.head=function head(list){list=list||[];return list[0]};R.car=R.head;R.last=function _last(list){list=list||[];return list[list.length-1]};R.tail=checkForMethod("tail",function(list){list=list||[];return list.length>1?_slice(list,1):[]});R.cdr=R.tail;var append=R.append=curry2(function _append(el,list){return concat(list,[el])});R.push=R.append;R.concat=curry2(function(set1,set2){if(isArray(set2)){return concat(set1,set2)}else if(R.is(String,set1)){return set1.concat(set2)}else if(hasMethod("concat",set2)){return set2.concat(set1)}else{throw new TypeError("can't concat "+typeof set2)}});var identity=R.identity=function _I(x){return x};R.I=R.identity;R.times=curry2(function _times(fn,n){var list=new Array(n);var idx=-1;while(++idx<n){list[idx]=fn(idx)}return list});R.repeatN=curry2(function _repeatN(value,n){return R.times(R.always(value),n)});function internalCompose(f,g){return function(){return f.call(this,g.apply(this,arguments))}}var compose=R.compose=function _compose(){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return arguments[0];default:var idx=arguments.length-1,fn=arguments[idx],length=fn.length;while(idx--){fn=internalCompose(arguments[idx],fn)}return arity(length,fn)}};R.pipe=function _pipe(){return compose.apply(this,_slice(arguments).reverse())};var flip=R.flip=function _flip(fn){return function(a,b){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return function(b){return fn.apply(this,[b,a].concat(_slice(arguments,1)))};default:return fn.apply(this,concat([b,a],_slice(arguments,2)))}}};R.lPartial=function _lPartial(fn){var args=_slice(arguments,1);return arity(Math.max(fn.length-args.length,0),function(){return fn.apply(this,concat(args,arguments))})};R.rPartial=function _rPartial(fn){var args=_slice(arguments,1);return arity(Math.max(fn.length-args.length,0),function(){return fn.apply(this,concat(arguments,args))})};R.memoize=function _memoize(fn){if(!fn.length){return once(fn)}var cache={};return function(){if(!arguments.length){return}var position=foldl(function(cache,arg){return cache[arg]||(cache[arg]={})},cache,_slice(arguments,0,arguments.length-1));var arg=arguments[arguments.length-1];return position[arg]||(position[arg]=fn.apply(this,arguments))}};var once=R.once=function _once(fn){var called=false,result;return function(){if(called){return result}called=true;result=fn.apply(this,arguments);return result}};R.wrap=function _wrap(fn,wrapper){return function(){return wrapper.apply(this,concat([fn],arguments))}};var constructN=R.constructN=curry2(function _constructN(n,Fn){var f=function(){var Temp=function(){},inst,ret;Temp.prototype=Fn.prototype;inst=new Temp;ret=Fn.apply(inst,arguments);return Object(ret)===ret?ret:inst};return n>1?curry(nAry(n,f)):f});R.construct=function _construct(Fn){return constructN(Fn.length,Fn)};R.converge=function(after){var fns=_slice(arguments,1);return function(){var args=arguments;return after.apply(this,map(function(fn){return fn.apply(this,args)},fns))}};R.reduce=curry3(function _reduce(fn,acc,list){var idx=-1,len=list.length;while(++idx<len){acc=fn(acc,list[idx])}return acc});var foldl=R.foldl=R.reduce;R.reduce.idx=curry3(function _reduceIdx(fn,acc,list){var idx=-1,len=list.length;while(++idx<len){acc=fn(acc,list[idx],idx,list)}return acc});R.foldl.idx=R.reduce.idx;R.reduceRight=curry3(checkForMethod("reduceRight",function _reduceRight(fn,acc,list){var idx=list.length;while(idx--){acc=fn(acc,list[idx])}return acc}));R.foldr=R.reduceRight;R.reduceRight.idx=curry3(function _reduceRightIdx(fn,acc,list){var idx=list.length;while(idx--){acc=fn(acc,list[idx],idx,list)}return acc});R.foldr.idx=R.reduceRight.idx;R.unfoldr=curry2(function _unfoldr(fn,seed){var pair=fn(seed);var result=[];while(pair&&pair.length){result.push(pair[0]);pair=fn(pair[1])}return result});function map(fn,list){var idx=-1,len=list.length,result=new Array(len);while(++idx<len){result[idx]=fn(list[idx])}return result}R.map=curry2(checkForMethod("map",map));R.map.idx=curry2(function _mapIdx(fn,list){var idx=-1,len=list.length,result=new Array(len);while(++idx<len){result[idx]=fn(list[idx],idx,list)}return result});R.mapObj=curry2(function _mapObject(fn,obj){return foldl(function(acc,key){acc[key]=fn(obj[key]);return acc},{},keys(obj))});R.mapObj.idx=curry2(function mapObjectIdx(fn,obj){return foldl(function(acc,key){acc[key]=fn(obj[key],key,obj);return acc},{},keys(obj))});R.ap=curry2(function _ap(fns,vs){return hasMethod("ap",fns)?fns.ap(vs):foldl(function(acc,fn){return concat(acc,map(fn,vs))},[],fns)});R.of=function _of(x,container){return hasMethod("of",container)?container.of(x):[x]};R.empty=function _empty(x){return hasMethod("empty",x)?x.empty():[]};R.chain=curry2(checkForMethod("chain",function _chain(f,list){return unnest(map(f,list))}));R.size=function _size(list){return list.length};R.length=R.size;var filter=function _filter(fn,list){var idx=-1,len=list.length,result=[];while(++idx<len){if(fn(list[idx])){result.push(list[idx])}}return result};R.filter=curry2(checkForMethod("filter",filter));function filterIdx(fn,list){var idx=-1,len=list.length,result=[];while(++idx<len){if(fn(list[idx],idx,list)){result.push(list[idx])}}return result}R.filter.idx=curry2(filterIdx);var reject=function _reject(fn,list){return filter(not(fn),list)};R.reject=curry2(reject);R.reject.idx=curry2(function _rejectIdx(fn,list){return filterIdx(not(fn),list)});R.takeWhile=curry2(checkForMethod("takeWhile",function(fn,list){var idx=-1,len=list.length;while(++idx<len&&fn(list[idx])){}return _slice(list,0,idx)}));R.take=curry2(checkForMethod("take",function(n,list){return _slice(list,0,Math.min(n,list.length))}));R.skipUntil=curry2(function _skipUntil(fn,list){var idx=-1,len=list.length;while(++idx<len&&!fn(list[idx])){}return _slice(list,idx)});R.skip=curry2(checkForMethod("skip",function _skip(n,list){if(n<list.length){return _slice(list,n)}else{return[]}}));R.find=curry2(function find(fn,list){var idx=-1;var len=list.length;while(++idx<len){if(fn(list[idx])){return list[idx]}}});R.findIndex=curry2(function _findIndex(fn,list){var idx=-1;var len=list.length;while(++idx<len){if(fn(list[idx])){return idx}}return-1});R.findLast=curry2(function _findLast(fn,list){var idx=list.length;while(idx--){if(fn(list[idx])){return list[idx]}}});R.findLastIndex=curry2(function _findLastIndex(fn,list){var idx=list.length;while(idx--){if(fn(list[idx])){return idx}}return-1});function every(fn,list){var idx=-1;while(++idx<list.length){if(!fn(list[idx])){return false}}return true}R.every=curry2(every);function some(fn,list){var idx=-1;while(++idx<list.length){if(fn(list[idx])){return true}}return false}R.some=curry2(some);var indexOf=function _indexOf(list,item,from){var idx=0,length=list.length;if(typeof from=="number"){idx=from<0?Math.max(0,length+from):from}for(;idx<length;idx++){if(list[idx]===item){return idx}}return-1};var lastIndexOf=function _lastIndexOf(list,item,from){var idx=list.length;if(typeof from=="number"){idx=from<0?idx+from+1:Math.min(idx,from+1)}while(--idx>=0){if(list[idx]===item){return idx}}return-1};R.indexOf=curry2(function _indexOf(target,list){return indexOf(list,target)});R.indexOf.from=curry3(function indexOfFrom(target,fromIdx,list){return indexOf(list,target,fromIdx)});R.lastIndexOf=curry2(function _lastIndexOf(target,list){return lastIndexOf(list,target)});R.lastIndexOf.from=curry3(function lastIndexOfFrom(target,fromIdx,list){return lastIndexOf(list,target,fromIdx)});function contains(a,list){return indexOf(list,a)>-1}R.contains=curry2(contains);function containsWith(pred,x,list){var idx=-1,len=list.length;while(++idx<len){if(pred(x,list[idx])){return true}}return false}R.containsWith=curry3(containsWith);var uniq=R.uniq=function uniq(list){var idx=-1,len=list.length;var result=[],item;while(++idx<len){item=list[idx];if(!contains(item,result)){result.push(item)}}return result};R.isSet=function _isSet(list){var len=list.length;var idx=-1;while(++idx<len){if(indexOf(list,list[idx],idx+1)>=0){return false}}return true};var uniqWith=R.uniqWith=curry2(function _uniqWith(pred,list){var idx=-1,len=list.length;var result=[],item;while(++idx<len){item=list[idx];if(!containsWith(pred,item,result)){result.push(item)}}return result});var pluck=R.pluck=curry2(function _pluck(p,list){return map(prop(p),list)});var makeFlat=function _makeFlat(recursive){return function __flatt(list){var value,result=[],idx=-1,j,ilen=list.length,jlen;while(++idx<ilen){if(R.isArrayLike(list[idx])){value=recursive?__flatt(list[idx]):list[idx];j=-1;jlen=value.length;while(++j<jlen){result.push(value[j])}}else{result.push(list[idx])}}return result}};R.flatten=makeFlat(true);var unnest=R.unnest=makeFlat(false);R.zipWith=curry3(function _zipWith(fn,a,b){var rv=[],idx=-1,len=Math.min(a.length,b.length);while(++idx<len){rv[idx]=fn(a[idx],b[idx])}return rv});R.zip=curry2(function _zip(a,b){var rv=[];var idx=-1;var len=Math.min(a.length,b.length);while(++idx<len){rv[idx]=[a[idx],b[idx]]}return rv});R.zipObj=curry2(function _zipObj(keys,values){var idx=-1,len=keys.length,out={};while(++idx<len){out[keys[idx]]=values[idx]}return out});R.fromPairs=function _fromPairs(pairs){var idx=-1,len=pairs.length,out={};while(++idx<len){if(isArray(pairs[idx])&&pairs[idx].length){out[pairs[idx][0]]=pairs[idx][1]}}return out};R.xprodWith=curry3(function _xprodWith(fn,a,b){if(isEmpty(a)||isEmpty(b)){return[]}var idx=-1,ilen=a.length,j,jlen=b.length,result=[];while(++idx<ilen){j=-1;while(++j<jlen){result.push(fn(a[idx],b[j]))}}return result});R.xprod=curry2(function _xprod(a,b){if(isEmpty(a)||isEmpty(b)){return[]}var idx=-1;var ilen=a.length;var j;var jlen=b.length;var result=[];while(++idx<ilen){j=-1;while(++j<jlen){result.push([a[idx],b[j]])}}return result});R.reverse=function _reverse(list){return clone(list||[]).reverse()};R.range=curry2(function _range(from,to){if(from>=to){return[]}var idx=0,result=new Array(Math.floor(to)-Math.ceil(from));for(;from<to;idx++,from++){result[idx]=from}return result});R.join=invoker("join",Array.prototype);R.slice=invoker("slice",Array.prototype);R.slice.from=curry2(function(a,xs){return xs.slice(a,xs.length)});R.remove=curry3(function _remove(start,count,list){return concat(_slice(list,0,Math.min(start,list.length)),_slice(list,Math.min(list.length,start+count)))});R.insert=curry3(function _insert(idx,elt,list){idx=idx<list.length&&idx>=0?idx:list.length;return concat(append(elt,_slice(list,0,idx)),_slice(list,idx))});R.insert.all=curry3(function _insertAll(idx,elts,list){idx=idx<list.length&&idx>=0?idx:list.length;return concat(concat(_slice(list,0,idx),elts),_slice(list,idx))});var comparator=R.comparator=function _comparator(pred){return function(a,b){return pred(a,b)?-1:pred(b,a)?1:0}};R.sort=curry2(function sort(comparator,list){return clone(list).sort(comparator)});R.groupBy=curry2(function _groupBy(fn,list){return foldl(function(acc,elt){var key=fn(elt);acc[key]=append(elt,acc[key]||(acc[key]=[]));return acc},{},list)});R.partition=curry2(function _partition(pred,list){return foldl(function(acc,elt){acc[pred(elt)?0:1].push(elt);return acc},[[],[]],list)});R.tap=curry2(function _tap(x,fn){if(typeof fn==="function"){fn(x)}return x});R.eq=curry2(function _eq(a,b){return a===b});var prop=R.prop=function prop(p,obj){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return function _prop(obj){return obj[p]}}return obj[p]};R.get=R.prop;R.props=flip(R.prop);var hasOwnProperty=Object.prototype.hasOwnProperty;R.propOrDefault=curry3(function _propOrDefault(p,val,obj){return hasOwnProperty.call(obj,p)?obj[p]:val});R.func=function _func(funcName,obj){switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return function(obj){return obj[funcName].apply(obj,_slice(arguments,1))};default:return obj[funcName].apply(obj,_slice(arguments,2))}};var always=R.always=function _always(val){return function(){return val}};var nativeKeys=Object.keys;var keys=R.keys=function(){var hasEnumBug=!{toString:null}.propertyIsEnumerable("toString");var nonEnumerableProps=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];return function _keys(obj){if(!R.is(Object,obj)){return[]}if(nativeKeys){return nativeKeys(Object(obj))}var prop,ks=[],nIdx;for(prop in obj){if(hasOwnProperty.call(obj,prop)){ks.push(prop)}}if(hasEnumBug){nIdx=nonEnumerableProps.length;while(nIdx--){prop=nonEnumerableProps[nIdx];if(hasOwnProperty.call(obj,prop)&&!R.contains(prop,ks)){ks.push(prop)}}}return ks}}();R.keysIn=function _keysIn(obj){var prop,ks=[];for(prop in obj){ks.push(prop)}return ks};var pairWith=function(fn){return function(obj){return R.map(function(key){return[key,obj[key]]},fn(obj))}};R.toPairs=pairWith(R.keys);R.toPairsIn=pairWith(R.keysIn);R.values=function _values(obj){var props=keys(obj),length=props.length,vals=new Array(length);for(var idx=0;idx<length;idx++){vals[idx]=obj[props[idx]]}return vals};R.valuesIn=function _valuesIn(obj){var prop,vs=[];for(prop in obj){vs.push(obj[prop])}return vs};function pickWith(test,obj){var copy={},props=keys(obj),prop,val;for(var idx=0,len=props.length;idx<len;idx++){prop=props[idx];val=obj[prop];if(test(val,prop,obj)){copy[prop]=val}}return copy}R.pick=curry2(function pick(names,obj){return pickWith(function(val,key){return contains(key,names)},obj)});R.omit=curry2(function omit(names,obj){return pickWith(function(val,key){return!contains(key,names)},obj)});R.pickWith=curry2(pickWith);var pickAll=function _pickAll(names,obj){var copy={};forEach(function(name){copy[name]=obj[name]},names);return copy};R.pickAll=curry2(pickAll);function extend(destination,other){var props=keys(other),idx=-1,length=props.length;while(++idx<length){destination[props[idx]]=other[props[idx]]}return destination}R.mixin=curry2(function _mixin(a,b){return extend(extend({},a),b)});R.cloneObj=function(obj){return extend({},obj)};R.eqProps=curry3(function eqProps(prop,obj1,obj2){return obj1[prop]===obj2[prop]});function satisfiesSpec(spec,parsedSpec,testObj){if(spec===testObj){return true}if(testObj==null){return false}parsedSpec.fn=parsedSpec.fn||[];parsedSpec.obj=parsedSpec.obj||[];var key,val,idx=-1,fnLen=parsedSpec.fn.length,j=-1,objLen=parsedSpec.obj.length;while(++idx<fnLen){key=parsedSpec.fn[idx];val=spec[key];if(!(key in testObj)){return false}if(!val(testObj[key],testObj)){return false}}while(++j<objLen){key=parsedSpec.obj[j];if(spec[key]!==testObj[key]){return false}}return true}R.where=function where(spec,testObj){var parsedSpec=R.groupBy(function(key){return typeof spec[key]==="function"?"fn":"obj"},keys(spec));switch(arguments.length){case 0:throw NO_ARGS_EXCEPTION;case 1:return function(testObj){return satisfiesSpec(spec,parsedSpec,testObj)}}return satisfiesSpec(spec,parsedSpec,testObj)};R.installTo=function(obj){return extend(obj,R)};R.is=curry2(function is(ctor,val){return val!=null&&val.constructor===ctor||val instanceof ctor});R.alwaysZero=always(0);R.alwaysFalse=always(false);R.alwaysTrue=always(true);R.and=curry2(function and(f,g){return function _and(){return!!(f.apply(this,arguments)&&g.apply(this,arguments))}});R.or=curry2(function or(f,g){return function _or(){return!!(f.apply(this,arguments)||g.apply(this,arguments))}});var not=R.not=function _not(f){return function(){return!f.apply(this,arguments)}};var predicateWrap=function _predicateWrap(predPicker){return function(preds){var predIterator=function(){var args=arguments;return predPicker(function(predicate){return predicate.apply(null,args)},preds)};return arguments.length>1?predIterator.apply(null,_slice(arguments,1)):arity(max(pluck("length",preds)),predIterator)}};R.allPredicates=predicateWrap(every);R.anyPredicates=predicateWrap(some);var add=R.add=curry2(function _add(a,b){return a+b});var multiply=R.multiply=curry2(function _multiply(a,b){return a*b});R.subtract=op(function _subtract(a,b){return a-b});R.divide=op(function _divide(a,b){return a/b});R.modulo=op(function _modulo(a,b){return a%b});var isInteger=Number.isInteger||function isInteger(n){return n<<0===n};R.mathMod=op(function _mathMod(m,p){if(!isInteger(m)){return NaN}if(!isInteger(p)||p<1){return NaN}return(m%p+p)%p});R.sum=foldl(add,0);R.product=foldl(multiply,1);R.lt=op(function _lt(a,b){return a<b});R.lte=op(function _lte(a,b){return a<=b});R.gt=op(function _gt(a,b){return a>b});R.gte=op(function _gte(a,b){return a>=b});var max=R.max=function _max(list){return foldl(binary(Math.max),-Infinity,list)};R.maxWith=curry2(function _maxWith(keyFn,list){if(!(list&&list.length>0)){return
}var idx=0,winner=list[idx],max=keyFn(winner),testKey;while(++idx<list.length){testKey=keyFn(list[idx]);if(testKey>max){max=testKey;winner=list[idx]}}return winner});R.min=function _min(list){return foldl(binary(Math.min),Infinity,list)};R.minWith=curry2(function _minWith(keyFn,list){if(!(list&&list.length>0)){return}var idx=0,winner=list[idx],min=keyFn(list[idx]),testKey;while(++idx<list.length){testKey=keyFn(list[idx]);if(testKey<min){min=testKey;winner=list[idx]}}return winner});var substring=R.substring=invoker("substring",String.prototype);R.substringFrom=flip(substring)(void 0);R.substringTo=substring(0);R.charAt=invoker("charAt",String.prototype);R.charCodeAt=invoker("charCodeAt",String.prototype);R.match=invoker("match",String.prototype);R.strIndexOf=curry2(function _strIndexOf(c,str){return str.indexOf(c)});R.strLastIndexOf=curry2(function(c,str){return str.lastIndexOf(c)});R.toUpperCase=invoker("toUpperCase",String.prototype);R.toLowerCase=invoker("toLowerCase",String.prototype);R.split=invoker("split",String.prototype,1);function path(paths,obj){var idx=-1,length=paths.length,val;if(obj==null){return}val=obj;while(val!=null&&++idx<length){val=val[paths[idx]]}return val}R.pathOn=curry3(function pathOn(sep,str,obj){return path(str.split(sep),obj)});R.path=R.pathOn(".");R.project=useWith(map,R.pickAll,identity);R.propEq=curry3(function propEq(name,val,obj){return obj[name]===val});R.union=compose(uniq,R.concat);R.unionWith=curry3(function _unionWith(pred,list1,list2){return uniqWith(pred,concat(list1,list2))});R.difference=curry2(function _difference(first,second){return uniq(reject(flip(contains)(second),first))});R.differenceWith=curry3(function differenceWith(pred,first,second){return uniqWith(pred)(reject(flip(R.containsWith(pred))(second),first))});R.intersection=curry2(function intersection(list1,list2){return uniq(filter(flip(contains)(list1),list2))});R.intersectionWith=curry3(function intersectionWith(pred,list1,list2){var results=[],idx=-1;while(++idx<list1.length){if(containsWith(pred,list1[idx],list2)){results[results.length]=list1[idx]}}return uniqWith(pred,results)});function keyValue(fn,list){return map(function(item){return{key:fn(item),val:item}},list)}R.sortBy=curry2(function sortBy(fn,list){return pluck("val",keyValue(fn,list).sort(comparator(function(a,b){return a.key<b.key})))});R.countBy=curry2(function countBy(fn,list){return foldl(function(counts,obj){counts[obj.key]=(counts[obj.key]||0)+1;return counts},{},keyValue(fn,list))});var functionsWith=function(fn){return function(obj){return R.filter(function(key){return typeof obj[key]==="function"},fn(obj))}};R.functions=functionsWith(R.keys);R.functionsIn=functionsWith(R.keysIn);return R})},{}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({"transducers.js":[function(require,module,exports){var symbolExists=typeof Symbol!=="undefined";var protocols={iterator:symbolExists?Symbol.iterator:"@@iterator",transformer:symbolExists?Symbol("transformer"):"@@transformer"};function throwProtocolError(name,coll){throw new Error("don't know how to "+name+" collection: "+coll)}function fulfillsProtocol(obj,name){if(name==="iterator"){return obj[protocols.iterator]||obj.next}return obj[protocols[name]]}function getProtocolProperty(obj,name){return obj[protocols[name]]}function iterator(coll){var iter=getProtocolProperty(coll,"iterator");if(iter){return iter.call(coll)}else if(coll.next){return coll}else if(isArray(coll)){return new ArrayIterator(coll)}else if(isObject(coll)){return new ObjectIterator(coll)}}function ArrayIterator(arr){this.arr=arr;this.index=0}ArrayIterator.prototype.next=function(){if(this.index<this.arr.length){return{value:this.arr[this.index++],done:false}}return{done:true}};function ObjectIterator(obj){this.obj=obj;this.keys=Object.keys(obj);this.index=0}ObjectIterator.prototype.next=function(){if(this.index<this.keys.length){var k=this.keys[this.index++];return{value:[k,this.obj[k]],done:false}}return{done:true}};var toString=Object.prototype.toString;var isArray=typeof Array.isArray==="function"?Array.isArray:function(obj){return toString.call(obj)=="[object Array]"};function isFunction(x){return typeof x==="function"}function isObject(x){return x instanceof Object&&Object.getPrototypeOf(x)===Object.getPrototypeOf({})}function isNumber(x){return typeof x==="number"}function Reduced(val){this.val=val}function reduce(coll,xform,init){if(isArray(coll)){var result=init;var index=-1;var len=coll.length;while(++index<len){result=xform.step(result,coll[index]);if(result instanceof Reduced){return result.val}}return xform.result(result)}else if(isObject(coll)||fulfillsProtocol(coll,"iterator")){var result=init;var iter=iterator(coll);var val=iter.next();while(!val.done){result=xform.step(result,val.value);if(result instanceof Reduced){return result.val}val=iter.next()}return xform.result(result)}throwProtocolError("iterate",coll)}function transduce(coll,xform,reducer,init){xform=xform(reducer);if(init===undefined){init=xform.init()}return reduce(coll,xform,init)}function compose(){var funcs=Array.prototype.slice.call(arguments);return function(r){var value=r;for(var i=funcs.length-1;i>=0;i--){value=funcs[i](value)}return value}}function transformer(f){return{init:function(){throw new Error("init value unavailable")},result:function(v){return v},step:f}}function bound(f,ctx,count){count=count!=null?count:1;if(!ctx){return f}else{switch(count){case 1:return function(x){return f.call(ctx,x)};case 2:return function(x,y){return f.call(ctx,x,y)};default:return f.bind(ctx)}}}function arrayMap(arr,f,ctx){var index=-1;var length=arr.length;var result=Array(length);f=bound(f,ctx,2);while(++index<length){result[index]=f(arr[index],index)}return result}function arrayFilter(arr,f,ctx){var len=arr.length;var result=[];f=bound(f,ctx,2);for(var i=0;i<len;i++){if(f(arr[i],i)){result.push(arr[i])}}return result}function Map(f,xform){this.xform=xform;this.f=f}Map.prototype.init=function(){return this.xform.init()};Map.prototype.result=function(v){return this.xform.result(v)};Map.prototype.step=function(res,input){return this.xform.step(res,this.f(input))};function map(coll,f,ctx){if(isFunction(coll)){ctx=f;f=coll;coll=null}f=bound(f,ctx);if(coll){if(isArray(coll)){return arrayMap(coll,f,ctx)}return seq(coll,map(f))}return function(xform){return new Map(f,xform)}}function Filter(f,xform){this.xform=xform;this.f=f}Filter.prototype.init=function(){return this.xform.init()};Filter.prototype.result=function(v){return this.xform.result(v)};Filter.prototype.step=function(res,input){if(this.f(input)){return this.xform.step(res,input)}return res};function filter(coll,f,ctx){if(isFunction(coll)){ctx=f;f=coll;coll=null}f=bound(f,ctx);if(coll){if(isArray(coll)){return arrayFilter(coll,f,ctx)}return seq(coll,filter(f))}return function(xform){return new Filter(f,xform)}}function remove(coll,f,ctx){if(isFunction(coll)){ctx=f;f=coll;coll=null}f=bound(f,ctx);return filter(coll,function(x){return!f(x)})}function keep(coll){return filter(coll,function(x){return x!=null})}function Dedupe(xform){this.xform=xform;this.last=undefined}Dedupe.prototype.init=function(){return this.xform.init()};Dedupe.prototype.result=function(v){return this.xform.result(v)};Dedupe.prototype.step=function(result,input){if(input!==this.last){this.last=input;return this.xform.step(result,input)}return result};function dedupe(coll){if(coll){return seq(coll,dedupe())}return function(xform){return new Dedupe(xform)}}function TakeWhile(f,xform){this.xform=xform;this.f=f}TakeWhile.prototype.init=function(){return this.xform.init()};TakeWhile.prototype.result=function(v){return this.xform.result(v)};TakeWhile.prototype.step=function(result,input){if(this.f(input)){return this.xform.step(result,input)}return new Reduced(result)};function takeWhile(coll,f,ctx){if(isFunction(coll)){ctx=f;f=coll;coll=null}f=bound(f,ctx);if(coll){return seq(coll,takeWhile(f))}return function(xform){return new TakeWhile(f,xform)}}function Take(n,xform){this.n=n;this.i=0;this.xform=xform}Take.prototype.init=function(){return this.xform.init()};Take.prototype.result=function(v){return this.xform.result(v)};Take.prototype.step=function(result,input){if(this.i++<this.n){return this.xform.step(result,input)}return new Reduced(result)};function take(coll,n){if(isNumber(coll)){n=coll;coll=null}if(coll){return seq(coll,take(n))}return function(xform){return new Take(n,xform)}}function Drop(n,xform){this.n=n;this.i=0;this.xform=xform}Drop.prototype.init=function(){return this.xform.init()};Drop.prototype.result=function(v){return this.xform.result(v)};Drop.prototype.step=function(result,input){if(this.i++<this.n){return result}return this.xform.step(result,input)};function drop(coll,n){if(isNumber(coll)){n=coll;coll=null}if(coll){return seq(coll,drop(n))}return function(xform){return new Drop(n,xform)}}function DropWhile(f,xform){this.xform=xform;this.f=f;this.dropping=true}DropWhile.prototype.init=function(){return this.xform.init()};DropWhile.prototype.result=function(v){return this.xform.result(v)};DropWhile.prototype.step=function(result,input){if(this.dropping){if(this.f(input)){return result}else{this.dropping=false}}return this.xform.step(result,input)};function dropWhile(coll,f,ctx){if(isFunction(coll)){ctx=f;f=coll;coll=null}f=bound(f,ctx);if(coll){return seq(coll,dropWhile(f))}return function(xform){return new DropWhile(f,xform)}}function Cat(xform){this.xform=xform}Cat.prototype.init=function(){return this.xform.init()};Cat.prototype.result=function(v){return this.xform.result(v)};Cat.prototype.step=function(result,input){var xform=this.xform;var newxform={init:function(){return xform.init()},result:function(v){return v},step:function(result,input){var val=xform.step(result,input);return val instanceof Reduced?new Reduced(val):val}};return reduce(input,newxform,result)};function cat(xform){return new Cat(xform)}function mapcat(f,ctx){f=bound(f,ctx);return compose(map(f),cat)}function push(arr,x){arr.push(x);return arr}function merge(obj,x){if(isArray(x)&&x.length===2){obj[x[0]]=x[1]}else{var keys=Object.keys(x);var len=keys.length;for(var i=0;i<len;i++){obj[keys[i]]=x[keys[i]]}}return obj}var arrayReducer={init:function(){return[]},result:function(v){return v},step:push};var objReducer={init:function(){return{}},result:function(v){return v},step:merge};function getReducer(coll){if(isArray(coll)){return arrayReducer}else if(isObject(coll)){return objReducer}else if(fulfillsProtocol(coll,"transformer")){return getProtocolProperty(coll,"transformer")}throwProtocolError("getReducer",coll)}function toArray(coll,xform){if(!xform){return reduce(coll,arrayReducer,[])}return transduce(coll,xform,arrayReducer,[])}function toObj(coll,xform){if(!xform){return reduce(coll,objReducer,{})}return transduce(coll,xform,objReducer,{})}function toIter(coll,xform){if(!xform){return iterator(coll)}return new LazyTransformer(xform,coll)}function seq(coll,xform){if(isArray(coll)){return transduce(coll,xform,arrayReducer,[])}else if(isObject(coll)){return transduce(coll,xform,objReducer,{})}else if(fulfillsProtocol(coll,"transformer")){var transformer=getProtocolProperty(coll,"transformer");return transduce(coll,xform,transformer,transformer.init())}else if(fulfillsProtocol(coll,"iterator")){return new LazyTransformer(xform,coll)}throwProtocolError("sequence",coll)}function into(to,xform,from){if(isArray(to)){return transduce(from,xform,arrayReducer,to)}else if(isObject(to)){return transduce(from,xform,objReducer,to)}else if(fulfillsProtocol(to,"transformer")){return transduce(from,xform,getProtocolProperty(to,"transformer"),to)}throwProtocolError("into",to)}var stepper={result:function(v){return v instanceof Reduced?v.val:v},step:function(lt,x){lt.items.push(x);return lt.rest}};function Stepper(xform,iter){this.xform=xform(stepper);this.iter=iter}Stepper.prototype.step=function(lt){var len=lt.items.length;while(lt.items.length===len){var n=this.iter.next();if(n.done||n.value instanceof Reduced){this.xform.result(this);break}this.xform.step(lt,n.value)}};function LazyTransformer(xform,coll){this.iter=iterator(coll);this.items=[];this.stepper=new Stepper(xform,iterator(coll))}LazyTransformer.prototype[protocols.iterator]=function(){return this};LazyTransformer.prototype.next=function(){this.step();if(this.items.length){return{value:this.items.pop(),done:false}}else{return{done:true}}};LazyTransformer.prototype.step=function(){if(!this.items.length){this.stepper.step(this)}};function range(n){var arr=new Array(n);for(var i=0;i<arr.length;i++){arr[i]=i}return arr}module.exports={reduce:reduce,transformer:transformer,Reduced:Reduced,iterator:iterator,push:push,merge:merge,transduce:transduce,seq:seq,toArray:toArray,toObj:toObj,toIter:toIter,into:into,compose:compose,map:map,filter:filter,remove:remove,cat:cat,mapcat:mapcat,keep:keep,dedupe:dedupe,take:take,takeWhile:takeWhile,drop:drop,dropWhile:dropWhile,range:range,protocols:protocols,LazyTransformer:LazyTransformer}},{}]},{},[]);require=function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({underscore:[function(require,module,exports){(function(){var root=this;var previousUnderscore=root._;var ArrayProto=Array.prototype,ObjProto=Object.prototype,FuncProto=Function.prototype;var push=ArrayProto.push,slice=ArrayProto.slice,concat=ArrayProto.concat,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty;var nativeIsArray=Array.isArray,nativeKeys=Object.keys,nativeBind=FuncProto.bind;var _=function(obj){if(obj instanceof _)return obj;if(!(this instanceof _))return new _(obj);this._wrapped=obj};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports){exports=module.exports=_}exports._=_}else{root._=_}_.VERSION="1.7.0";var createCallback=function(func,context,argCount){if(context===void 0)return func;switch(argCount==null?3:argCount){case 1:return function(value){return func.call(context,value)};case 2:return function(value,other){return func.call(context,value,other)};case 3:return function(value,index,collection){return func.call(context,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(context,accumulator,value,index,collection)}}return function(){return func.apply(context,arguments)}};_.iteratee=function(value,context,argCount){if(value==null)return _.identity;if(_.isFunction(value))return createCallback(value,context,argCount);if(_.isObject(value))return _.matches(value);return _.property(value)};_.each=_.forEach=function(obj,iteratee,context){if(obj==null)return obj;iteratee=createCallback(iteratee,context);var i,length=obj.length;if(length===+length){for(i=0;i<length;i++){iteratee(obj[i],i,obj)}}else{var keys=_.keys(obj);for(i=0,length=keys.length;i<length;i++){iteratee(obj[keys[i]],keys[i],obj)}}return obj};_.map=_.collect=function(obj,iteratee,context){if(obj==null)return[];iteratee=_.iteratee(iteratee,context);var keys=obj.length!==+obj.length&&_.keys(obj),length=(keys||obj).length,results=Array(length),currentKey;for(var index=0;index<length;index++){currentKey=keys?keys[index]:index;results[index]=iteratee(obj[currentKey],currentKey,obj)}return results};var reduceError="Reduce of empty array with no initial value";_.reduce=_.foldl=_.inject=function(obj,iteratee,memo,context){if(obj==null)obj=[];iteratee=createCallback(iteratee,context,4);var keys=obj.length!==+obj.length&&_.keys(obj),length=(keys||obj).length,index=0,currentKey;if(arguments.length<3){if(!length)throw new TypeError(reduceError);memo=obj[keys?keys[index++]:index++]}for(;index<length;index++){currentKey=keys?keys[index]:index;memo=iteratee(memo,obj[currentKey],currentKey,obj)}return memo};_.reduceRight=_.foldr=function(obj,iteratee,memo,context){if(obj==null)obj=[];iteratee=createCallback(iteratee,context,4);var keys=obj.length!==+obj.length&&_.keys(obj),index=(keys||obj).length,currentKey;if(arguments.length<3){if(!index)throw new TypeError(reduceError);memo=obj[keys?keys[--index]:--index]}while(index--){currentKey=keys?keys[index]:index;memo=iteratee(memo,obj[currentKey],currentKey,obj)}return memo};_.find=_.detect=function(obj,predicate,context){var result;predicate=_.iteratee(predicate,context);_.some(obj,function(value,index,list){if(predicate(value,index,list)){result=value;return true}});return result};_.filter=_.select=function(obj,predicate,context){var results=[];if(obj==null)return results;predicate=_.iteratee(predicate,context);_.each(obj,function(value,index,list){if(predicate(value,index,list))results.push(value)});return results};_.reject=function(obj,predicate,context){return _.filter(obj,_.negate(_.iteratee(predicate)),context)};_.every=_.all=function(obj,predicate,context){if(obj==null)return true;predicate=_.iteratee(predicate,context);var keys=obj.length!==+obj.length&&_.keys(obj),length=(keys||obj).length,index,currentKey;for(index=0;index<length;index++){currentKey=keys?keys[index]:index;if(!predicate(obj[currentKey],currentKey,obj))return false}return true};_.some=_.any=function(obj,predicate,context){if(obj==null)return false;predicate=_.iteratee(predicate,context);var keys=obj.length!==+obj.length&&_.keys(obj),length=(keys||obj).length,index,currentKey;for(index=0;index<length;index++){currentKey=keys?keys[index]:index;if(predicate(obj[currentKey],currentKey,obj))return true}return false};_.contains=_.include=function(obj,target){if(obj==null)return false;if(obj.length!==+obj.length)obj=_.values(obj);return _.indexOf(obj,target)>=0};_.invoke=function(obj,method){var args=slice.call(arguments,2);var isFunc=_.isFunction(method);return _.map(obj,function(value){return(isFunc?method:value[method]).apply(value,args)})};_.pluck=function(obj,key){return _.map(obj,_.property(key))};_.where=function(obj,attrs){return _.filter(obj,_.matches(attrs))};_.findWhere=function(obj,attrs){return _.find(obj,_.matches(attrs))};_.max=function(obj,iteratee,context){var result=-Infinity,lastComputed=-Infinity,value,computed;if(iteratee==null&&obj!=null){obj=obj.length===+obj.length?obj:_.values(obj);for(var i=0,length=obj.length;i<length;i++){value=obj[i];if(value>result){result=value}}}else{iteratee=_.iteratee(iteratee,context);_.each(obj,function(value,index,list){computed=iteratee(value,index,list);if(computed>lastComputed||computed===-Infinity&&result===-Infinity){result=value;lastComputed=computed}})}return result};_.min=function(obj,iteratee,context){var result=Infinity,lastComputed=Infinity,value,computed;if(iteratee==null&&obj!=null){obj=obj.length===+obj.length?obj:_.values(obj);for(var i=0,length=obj.length;i<length;i++){value=obj[i];if(value<result){result=value}}}else{iteratee=_.iteratee(iteratee,context);_.each(obj,function(value,index,list){computed=iteratee(value,index,list);if(computed<lastComputed||computed===Infinity&&result===Infinity){result=value;lastComputed=computed}})}return result};_.shuffle=function(obj){var set=obj&&obj.length===+obj.length?obj:_.values(obj);var length=set.length;var shuffled=Array(length);for(var index=0,rand;index<length;index++){rand=_.random(0,index);if(rand!==index)shuffled[index]=shuffled[rand];shuffled[rand]=set[index]}return shuffled};_.sample=function(obj,n,guard){if(n==null||guard){if(obj.length!==+obj.length)obj=_.values(obj);return obj[_.random(obj.length-1)]}return _.shuffle(obj).slice(0,Math.max(0,n))};_.sortBy=function(obj,iteratee,context){iteratee=_.iteratee(iteratee,context);return _.pluck(_.map(obj,function(value,index,list){return{value:value,index:index,criteria:iteratee(value,index,list)}}).sort(function(left,right){var a=left.criteria;var b=right.criteria;if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)return-1}return left.index-right.index}),"value")};var group=function(behavior){return function(obj,iteratee,context){var result={};iteratee=_.iteratee(iteratee,context);_.each(obj,function(value,index){var key=iteratee(value,index,obj);behavior(result,value,key)});return result}};_.groupBy=group(function(result,value,key){if(_.has(result,key))result[key].push(value);else result[key]=[value]});_.indexBy=group(function(result,value,key){result[key]=value});_.countBy=group(function(result,value,key){if(_.has(result,key))result[key]++;else result[key]=1});_.sortedIndex=function(array,obj,iteratee,context){iteratee=_.iteratee(iteratee,context,1);var value=iteratee(obj);var low=0,high=array.length;while(low<high){var mid=low+high>>>1;if(iteratee(array[mid])<value)low=mid+1;else high=mid}return low};_.toArray=function(obj){if(!obj)return[];if(_.isArray(obj))return slice.call(obj);if(obj.length===+obj.length)return _.map(obj,_.identity);return _.values(obj)};_.size=function(obj){if(obj==null)return 0;return obj.length===+obj.length?obj.length:_.keys(obj).length};_.partition=function(obj,predicate,context){predicate=_.iteratee(predicate,context);var pass=[],fail=[];_.each(obj,function(value,key,obj){(predicate(value,key,obj)?pass:fail).push(value)});return[pass,fail]};_.first=_.head=_.take=function(array,n,guard){if(array==null)return void 0;if(n==null||guard)return array[0];if(n<0)return[];return slice.call(array,0,n)};_.initial=function(array,n,guard){return slice.call(array,0,Math.max(0,array.length-(n==null||guard?1:n)))};_.last=function(array,n,guard){if(array==null)return void 0;if(n==null||guard)return array[array.length-1];return slice.call(array,Math.max(array.length-n,0))};_.rest=_.tail=_.drop=function(array,n,guard){return slice.call(array,n==null||guard?1:n)};_.compact=function(array){return _.filter(array,_.identity)};var flatten=function(input,shallow,strict,output){if(shallow&&_.every(input,_.isArray)){return concat.apply(output,input)}for(var i=0,length=input.length;i<length;i++){var value=input[i];if(!_.isArray(value)&&!_.isArguments(value)){if(!strict)output.push(value)}else if(shallow){push.apply(output,value)}else{flatten(value,shallow,strict,output)}}return output};_.flatten=function(array,shallow){return flatten(array,shallow,false,[])};_.without=function(array){return _.difference(array,slice.call(arguments,1))};_.uniq=_.unique=function(array,isSorted,iteratee,context){if(array==null)return[];if(!_.isBoolean(isSorted)){context=iteratee;iteratee=isSorted;isSorted=false}if(iteratee!=null)iteratee=_.iteratee(iteratee,context);var result=[];var seen=[];for(var i=0,length=array.length;i<length;i++){var value=array[i];if(isSorted){if(!i||seen!==value)result.push(value);seen=value}else if(iteratee){var computed=iteratee(value,i,array);if(_.indexOf(seen,computed)<0){seen.push(computed);result.push(value)}}else if(_.indexOf(result,value)<0){result.push(value)}}return result};_.union=function(){return _.uniq(flatten(arguments,true,true,[]))};_.intersection=function(array){if(array==null)return[];var result=[];var argsLength=arguments.length;for(var i=0,length=array.length;i<length;i++){var item=array[i];if(_.contains(result,item))continue;for(var j=1;j<argsLength;j++){if(!_.contains(arguments[j],item))break}if(j===argsLength)result.push(item)}return result};_.difference=function(array){var rest=flatten(slice.call(arguments,1),true,true,[]);return _.filter(array,function(value){return!_.contains(rest,value)})};_.zip=function(array){if(array==null)return[];var length=_.max(arguments,"length").length;var results=Array(length);for(var i=0;i<length;i++){results[i]=_.pluck(arguments,i)}return results};_.object=function(list,values){if(list==null)return{};var result={};for(var i=0,length=list.length;i<length;i++){if(values){result[list[i]]=values[i]}else{result[list[i][0]]=list[i][1]}}return result};_.indexOf=function(array,item,isSorted){if(array==null)return-1;var i=0,length=array.length;if(isSorted){if(typeof isSorted=="number"){i=isSorted<0?Math.max(0,length+isSorted):isSorted}else{i=_.sortedIndex(array,item);return array[i]===item?i:-1}}for(;i<length;i++)if(array[i]===item)return i;return-1};_.lastIndexOf=function(array,item,from){if(array==null)return-1;var idx=array.length;if(typeof from=="number"){idx=from<0?idx+from+1:Math.min(idx,from+1)}while(--idx>=0)if(array[idx]===item)return idx;return-1};_.range=function(start,stop,step){if(arguments.length<=1){stop=start||0;start=0}step=step||1;var length=Math.max(Math.ceil((stop-start)/step),0);var range=Array(length);for(var idx=0;idx<length;idx++,start+=step){range[idx]=start}return range};var Ctor=function(){};_.bind=function(func,context){var args,bound;if(nativeBind&&func.bind===nativeBind)return nativeBind.apply(func,slice.call(arguments,1));if(!_.isFunction(func))throw new TypeError("Bind must be called on a function");args=slice.call(arguments,2);bound=function(){if(!(this instanceof bound))return func.apply(context,args.concat(slice.call(arguments)));Ctor.prototype=func.prototype;var self=new Ctor;Ctor.prototype=null;var result=func.apply(self,args.concat(slice.call(arguments)));if(_.isObject(result))return result;return self};return bound};_.partial=function(func){var boundArgs=slice.call(arguments,1);return function(){var position=0;var args=boundArgs.slice();for(var i=0,length=args.length;i<length;i++){if(args[i]===_)args[i]=arguments[position++]}while(position<arguments.length)args.push(arguments[position++]);return func.apply(this,args)}};_.bindAll=function(obj){var i,length=arguments.length,key;if(length<=1)throw new Error("bindAll must be passed function names");for(i=1;i<length;i++){key=arguments[i];obj[key]=_.bind(obj[key],obj)}return obj};_.memoize=function(func,hasher){var memoize=function(key){var cache=memoize.cache;var address=hasher?hasher.apply(this,arguments):key;if(!_.has(cache,address))cache[address]=func.apply(this,arguments);return cache[address]};memoize.cache={};return memoize};_.delay=function(func,wait){var args=slice.call(arguments,2);return setTimeout(function(){return func.apply(null,args)},wait)};_.defer=function(func){return _.delay.apply(_,[func,1].concat(slice.call(arguments,1)))};_.throttle=function(func,wait,options){var context,args,result;var timeout=null;var previous=0;if(!options)options={};var later=function(){previous=options.leading===false?0:_.now();timeout=null;result=func.apply(context,args);if(!timeout)context=args=null};return function(){var now=_.now();if(!previous&&options.leading===false)previous=now;var remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0||remaining>wait){clearTimeout(timeout);timeout=null;previous=now;result=func.apply(context,args);if(!timeout)context=args=null}else if(!timeout&&options.trailing!==false){timeout=setTimeout(later,remaining)}return result}};_.debounce=function(func,wait,immediate){var timeout,args,context,timestamp,result;var later=function(){var last=_.now()-timestamp;if(last<wait&&last>0){timeout=setTimeout(later,wait-last)}else{timeout=null;if(!immediate){result=func.apply(context,args);if(!timeout)context=args=null}}};return function(){context=this;args=arguments;timestamp=_.now();var callNow=immediate&&!timeout;if(!timeout)timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args);context=args=null}return result}};_.wrap=function(func,wrapper){return _.partial(wrapper,func)};_.negate=function(predicate){return function(){return!predicate.apply(this,arguments)}};_.compose=function(){var args=arguments;var start=args.length-1;return function(){var i=start;var result=args[start].apply(this,arguments);while(i--)result=args[i].call(this,result);return result}};_.after=function(times,func){return function(){if(--times<1){return func.apply(this,arguments)}}};_.before=function(times,func){var memo;return function(){if(--times>0){memo=func.apply(this,arguments)}else{func=null}return memo}};_.once=_.partial(_.before,2);_.keys=function(obj){if(!_.isObject(obj))return[];if(nativeKeys)return nativeKeys(obj);var keys=[];for(var key in obj)if(_.has(obj,key))keys.push(key);return keys};_.values=function(obj){var keys=_.keys(obj);var length=keys.length;var values=Array(length);for(var i=0;i<length;i++){values[i]=obj[keys[i]]}return values};_.pairs=function(obj){var keys=_.keys(obj);var length=keys.length;var pairs=Array(length);for(var i=0;i<length;i++){pairs[i]=[keys[i],obj[keys[i]]]}return pairs};_.invert=function(obj){var result={};var keys=_.keys(obj);for(var i=0,length=keys.length;i<length;i++){result[obj[keys[i]]]=keys[i]}return result};_.functions=_.methods=function(obj){var names=[];for(var key in obj){if(_.isFunction(obj[key]))names.push(key)}return names.sort()};_.extend=function(obj){if(!_.isObject(obj))return obj;var source,prop;for(var i=1,length=arguments.length;i<length;i++){source=arguments[i];for(prop in source){if(hasOwnProperty.call(source,prop)){obj[prop]=source[prop]}}}return obj};_.pick=function(obj,iteratee,context){var result={},key;if(obj==null)return result;if(_.isFunction(iteratee)){iteratee=createCallback(iteratee,context);for(key in obj){var value=obj[key];if(iteratee(value,key,obj))result[key]=value}}else{var keys=concat.apply([],slice.call(arguments,1));obj=new Object(obj);for(var i=0,length=keys.length;i<length;i++){key=keys[i];if(key in obj)result[key]=obj[key]}}return result};_.omit=function(obj,iteratee,context){if(_.isFunction(iteratee)){iteratee=_.negate(iteratee)}else{var keys=_.map(concat.apply([],slice.call(arguments,1)),String);iteratee=function(value,key){return!_.contains(keys,key)}}return _.pick(obj,iteratee,context)};_.defaults=function(obj){if(!_.isObject(obj))return obj;for(var i=1,length=arguments.length;i<length;i++){var source=arguments[i];for(var prop in source){if(obj[prop]===void 0)obj[prop]=source[prop]}}return obj};_.clone=function(obj){if(!_.isObject(obj))return obj;return _.isArray(obj)?obj.slice():_.extend({},obj)};_.tap=function(obj,interceptor){interceptor(obj);return obj};var eq=function(a,b,aStack,bStack){if(a===b)return a!==0||1/a===1/b;if(a==null||b==null)return a===b;if(a instanceof _)a=a._wrapped;if(b instanceof _)b=b._wrapped;var className=toString.call(a);if(className!==toString.call(b))return false;switch(className){case"[object RegExp]":case"[object String]":return""+a===""+b;case"[object Number]":if(+a!==+a)return+b!==+b;return+a===0?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}if(typeof a!="object"||typeof b!="object")return false;var length=aStack.length;while(length--){if(aStack[length]===a)return bStack[length]===b}var aCtor=a.constructor,bCtor=b.constructor;if(aCtor!==bCtor&&"constructor"in a&&"constructor"in b&&!(_.isFunction(aCtor)&&aCtor instanceof aCtor&&_.isFunction(bCtor)&&bCtor instanceof bCtor)){return false}aStack.push(a);bStack.push(b);var size,result;if(className==="[object Array]"){size=a.length;result=size===b.length;if(result){while(size--){if(!(result=eq(a[size],b[size],aStack,bStack)))break}}}else{var keys=_.keys(a),key;size=keys.length;result=_.keys(b).length===size;if(result){while(size--){key=keys[size];if(!(result=_.has(b,key)&&eq(a[key],b[key],aStack,bStack)))break}}}aStack.pop();bStack.pop();return result};_.isEqual=function(a,b){return eq(a,b,[],[])};_.isEmpty=function(obj){if(obj==null)return true;if(_.isArray(obj)||_.isString(obj)||_.isArguments(obj))return obj.length===0;for(var key in obj)if(_.has(obj,key))return false;return true};_.isElement=function(obj){return!!(obj&&obj.nodeType===1)};_.isArray=nativeIsArray||function(obj){return toString.call(obj)==="[object Array]"
};_.isObject=function(obj){var type=typeof obj;return type==="function"||type==="object"&&!!obj};_.each(["Arguments","Function","String","Number","Date","RegExp"],function(name){_["is"+name]=function(obj){return toString.call(obj)==="[object "+name+"]"}});if(!_.isArguments(arguments)){_.isArguments=function(obj){return _.has(obj,"callee")}}if(typeof/./!=="function"){_.isFunction=function(obj){return typeof obj=="function"||false}}_.isFinite=function(obj){return isFinite(obj)&&!isNaN(parseFloat(obj))};_.isNaN=function(obj){return _.isNumber(obj)&&obj!==+obj};_.isBoolean=function(obj){return obj===true||obj===false||toString.call(obj)==="[object Boolean]"};_.isNull=function(obj){return obj===null};_.isUndefined=function(obj){return obj===void 0};_.has=function(obj,key){return obj!=null&&hasOwnProperty.call(obj,key)};_.noConflict=function(){root._=previousUnderscore;return this};_.identity=function(value){return value};_.constant=function(value){return function(){return value}};_.noop=function(){};_.property=function(key){return function(obj){return obj[key]}};_.matches=function(attrs){var pairs=_.pairs(attrs),length=pairs.length;return function(obj){if(obj==null)return!length;obj=new Object(obj);for(var i=0;i<length;i++){var pair=pairs[i],key=pair[0];if(pair[1]!==obj[key]||!(key in obj))return false}return true}};_.times=function(n,iteratee,context){var accum=Array(Math.max(0,n));iteratee=createCallback(iteratee,context,1);for(var i=0;i<n;i++)accum[i]=iteratee(i);return accum};_.random=function(min,max){if(max==null){max=min;min=0}return min+Math.floor(Math.random()*(max-min+1))};_.now=Date.now||function(){return(new Date).getTime()};var escapeMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};var unescapeMap=_.invert(escapeMap);var createEscaper=function(map){var escaper=function(match){return map[match]};var source="(?:"+_.keys(map).join("|")+")";var testRegexp=RegExp(source);var replaceRegexp=RegExp(source,"g");return function(string){string=string==null?"":""+string;return testRegexp.test(string)?string.replace(replaceRegexp,escaper):string}};_.escape=createEscaper(escapeMap);_.unescape=createEscaper(unescapeMap);_.result=function(object,property){if(object==null)return void 0;var value=object[property];return _.isFunction(value)?object[property]():value};var idCounter=0;_.uniqueId=function(prefix){var id=++idCounter+"";return prefix?prefix+id:id};_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/;var escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"};var escaper=/\\|'|\r|\n|\u2028|\u2029/g;var escapeChar=function(match){return"\\"+escapes[match]};_.template=function(text,settings,oldSettings){if(!settings&&oldSettings)settings=oldSettings;settings=_.defaults({},settings,_.templateSettings);var matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join("|")+"|$","g");var index=0;var source="__p+='";text.replace(matcher,function(match,escape,interpolate,evaluate,offset){source+=text.slice(index,offset).replace(escaper,escapeChar);index=offset+match.length;if(escape){source+="'+\n((__t=("+escape+"))==null?'':_.escape(__t))+\n'"}else if(interpolate){source+="'+\n((__t=("+interpolate+"))==null?'':__t)+\n'"}else if(evaluate){source+="';\n"+evaluate+"\n__p+='"}return match});source+="';\n";if(!settings.variable)source="with(obj||{}){\n"+source+"}\n";source="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+source+"return __p;\n";try{var render=new Function(settings.variable||"obj","_",source)}catch(e){e.source=source;throw e}var template=function(data){return render.call(this,data,_)};var argument=settings.variable||"obj";template.source="function("+argument+"){\n"+source+"}";return template};_.chain=function(obj){var instance=_(obj);instance._chain=true;return instance};var result=function(obj){return this._chain?_(obj).chain():obj};_.mixin=function(obj){_.each(_.functions(obj),function(name){var func=_[name]=obj[name];_.prototype[name]=function(){var args=[this._wrapped];push.apply(args,arguments);return result.call(this,func.apply(_,args))}})};_.mixin(_);_.each(["pop","push","reverse","shift","sort","splice","unshift"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){var obj=this._wrapped;method.apply(obj,arguments);if((name==="shift"||name==="splice")&&obj.length===0)delete obj[0];return result.call(this,obj)}});_.each(["concat","join","slice"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){return result.call(this,method.apply(this._wrapped,arguments))}});_.prototype.value=function(){return this._wrapped};if(typeof define==="function"&&define.amd){define("underscore",[],function(){return _})}}).call(this)},{}]},{},[]);var transform=function(n){return 3*n+2};var log=function(n,idx,arr){return"n: "+n+", idx: "+idx+", arr: "+arr};console.log("----------------------------------------");var Fk=require("fkit");console.log("fkit");console.log(Fk.compose(Fk.map(log),Fk.map(transform))([0,1,2]).join("\n"));console.log("----------------------------------------");var Fn=require("fn.js");console.log("fn.js");console.log(Fn.map(log,Fn.map(transform,[0,1,2])).join("\n"));console.log("----------------------------------------");var H=require("highland");console.log("highland");H([0,1,2]).map(transform).map(log).toArray(function(a){console.log(a.join("\n"))});console.log("----------------------------------------");var La=require("lazy.js");console.log("lazy.js");console.log(La.range(3).map(transform).map(log).toArray().join("\n"));console.log("----------------------------------------");var Ld=require("lodash");console.log("lodash");console.log(Ld.range(3).map(transform).map(log).join("\n"));console.log("----------------------------------------");var Le=require("lemonad");console.log("lemonad");console.log(Le.map(log)(Le.map(transform)([0,1,2])).join("\n"));console.log("----------------------------------------");var Lz=require("lz");console.log("lz");console.log(Lz.range(0,3).map(transform).map(log).toArray().join("\n"));console.log("----------------------------------------");var R=require("ramda");console.log("ramda");console.log(R.compose(R.map(log),R.map(transform))([0,1,2]).join("\n"));console.log("----------------------------------------");var T=require("transducers.js");console.log("transducers.js");console.log(T.seq([0,1,2],T.compose(T.map(transform),T.map(log))).join("\n"));console.log("----------------------------------------");var U=require("underscore");console.log("underscore");console.log(U.range(3).map(transform).map(log).join("\n"));console.log("----------------------------------------");
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"fkit": "0.13.1",
"fn.js": "0.8.1",
"highland": "2.0.0",
"lazy.js": "0.3.2",
"lodash": "2.4.1",
"lemonad": "0.7.4",
"lz": "0.1.1",
"ramda": "0.5.0",
"transducers.js": "0.2.2",
"underscore": "1.7.0"
}
}
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; }
body, html { height: 100%; width: 100%; }</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment