From eea7eac6bcb3d40eb9b00b0466daf6ca67f017b0 Mon Sep 17 00:00:00 2001 From: David Bushong Date: Sun, 22 Dec 2013 14:28:04 -0800 Subject: [PATCH] separate source display from uncaughtException If you have your own uncaughtException handler, you might still like the pretty source display from handleUncaughtExceptions: true; therefore expose it as exports.getErrorSource(err) --- browser-source-map-support.js | 230 +++++++++++++++++----------------- source-map-support.js | 45 ++++--- test.js | 16 +++ 3 files changed, 157 insertions(+), 134 deletions(-) diff --git a/browser-source-map-support.js b/browser-source-map-support.js index 7cc5a81..0afdb8e 100644 --- a/browser-source-map-support.js +++ b/browser-source-map-support.js @@ -2,118 +2,118 @@ * Support for source maps in V8 stack traces * https://github.com/evanw/node-source-map-support */ -(this.define||function(M,N){this.sourceMapSupport=N()})("browser-source-map-support",function(M){(function m(x,h,w){function B(b,k){if(!h[b]){if(!x[b]){var g="function"==typeof require&&require;if(!k&&g)return g(b,!0);if(D)return D(b,!0);throw Error("Cannot find module '"+b+"'");}g=h[b]={exports:{}};x[b][0].call(g.exports,function(f){var a=x[b][1][f];return B(a?a:f)},g,g.exports,m,x,h,w)}return h[b].exports}for(var D="function"==typeof require&&require,q=0;qd;++d)a.hasOwnProperty(d)&&(t? -f=b(f,a[d],d,a):(f=a[d],t=!0));return f};"b"!=="ab".substr(-1)?h.substr=function(a,b,e){0>b&&(b=a.length+b);return a.substr(b,e)}:h.substr=function(a,b,e){return a.substr(b,e)};h.trim=function(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")};h.bind=function(){var a=Array.prototype.slice.call(arguments),b=a.shift();if(b.bind)return b.bind.apply(b,a);var e=a.shift();return function(){b.apply(e,a.concat([Array.prototype.slice.call(arguments)]))}};h.create="function"===typeof Object.create?Object.create: -B;var a="function"===typeof Object.keys?Object.keys:q,e="function"===typeof Object.getOwnPropertyNames?Object.getOwnPropertyNames:b;if(Error().hasOwnProperty("description")){var p=function(a,b){"[object Error]"===g.call(a)&&(b=h.filter(b,function(a){return"description"!==a&&"number"!==a&&"message"!==a}));return b};h.keys=function(b){return p(b,a(b))};h.getOwnPropertyNames=function(a){return p(a,e(a))}}else h.keys=a,h.getOwnPropertyNames=e;if("function"===typeof Object.getOwnPropertyDescriptor)try{Object.getOwnPropertyDescriptor({a:1}, -"a"),h.getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor}catch(n){h.getOwnPropertyDescriptor=function(a,b){try{return Object.getOwnPropertyDescriptor(a,b)}catch(e){return k(a,b)}}}else h.getOwnPropertyDescriptor=k},{}],3:[function(m,x,h){},{}],4:[function(m,x,h){function w(b,g){for(var f=0,a=b.length-1;0<=a;a--){var e=b[a];"."===e?b.splice(a,1):".."===e?(b.splice(a,1),f++):f&&(b.splice(a,1),f--)}if(g)for(;f--;f)b.unshift("..");return b}var B=m("__browserify_process"),D=m("util"),q=m("_shims"), -b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;h.resolve=function(){for(var b="",g=!1,f=arguments.length-1;-1<=f&&!g;f--){var a=0<=f?arguments[f]:B.cwd();if(!D.isString(a))throw new TypeError("Arguments to path.resolve must be strings");a&&(b=a+"/"+b,g="/"===a.charAt(0))}b=w(q.filter(b.split("/"),function(a){return!!a}),!g).join("/");return(g?"/":"")+b||"."};h.normalize=function(b){var g=h.isAbsolute(b),f="/"===q.substr(b,-1);(b=w(q.filter(b.split("/"),function(a){return!!a}),!g).join("/"))|| -g||(b=".");b&&f&&(b+="/");return(g?"/":"")+b};h.isAbsolute=function(b){return"/"===b.charAt(0)};h.join=function(){var b=Array.prototype.slice.call(arguments,0);return h.normalize(q.filter(b,function(b,f){if(!D.isString(b))throw new TypeError("Arguments to path.join must be strings");return b}).join("/"))};h.relative=function(b,g){function f(a){for(var b=0;be?[]:a.slice(b,e-b+1)}b=h.resolve(b).substr(1);g=h.resolve(g).substr(1); -for(var a=f(b.split("/")),e=f(g.split("/")),p=Math.min(a.length,e.length),n=p,v=0;vp)return A(n)?u.stylize(RegExp.prototype.toString.call(n), -"regexp"):u.stylize("[Object]","special");u.seen.push(n);l=K?g(u,n,p,C,l):l.map(function(l){return f(u,n,p,C,l,K)});u.seen.pop();return a(l,z,L)}function k(c,a){if(s(a))return c.stylize("undefined","undefined");if(v(a)){var d="'"+JSON.stringify(a).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return c.stylize(d,"string")}if(n(a))return c.stylize(""+a,"number");if(p(a))return c.stylize(""+a,"boolean");if(null===a)return c.stylize("null","null")}function g(c,a,d,z,l){for(var C=[], -b=0,e=a.length;bF.indexOf(a.seen,c.value)?(f=null===d? -b(a,c.value,null):b(a,c.value,d-1),-1a?"0"+a.toString(10):a.toString(10)}function G(){var a=new Date,c=[u(a.getHours()),u(a.getMinutes()),u(a.getSeconds())].join(":");return[a.getDate(),H[a.getMonth()],c].join(" ")}var F=m("_shims"),I=/%[sdj%]/g;h.format=function(a){if(!v(a)){for(var c=[],d=0;d=l)return a;switch(a){case "%s":return String(z[d++]);case "%d":return Number(z[d++]);case "%j":try{return JSON.stringify(z[d++])}catch(c){return"[Circular]"}default:return a}}),C=z[d];d>1,v=-7;a=g?0:a-1;var s=g?1:-1,h=b[k+a];a+=s;g=h&(1<<-v)-1;h>>=-v;for(v+=e;0>=-v;for(v+=f;0>1,h=23===a?Math.pow(2,-24)- -Math.pow(2,-77):0;e=f?e-1:0;var y=f?-1:1,t=0>k||0===k&&0>1/k?1:0;k=Math.abs(k);isNaN(k)||Infinity===k?(k=isNaN(k)?1:0,f=v):(f=Math.floor(Math.log(k)/Math.LN2),1>k*(p=Math.pow(2,-f))&&(f--,p*=2),k=1<=f+s?k+h/p:k+h*Math.pow(2,1-s),2<=k*p&&(f++,p/=2),f+s>=v?(k=0,f=v):1<=f+s?(k=(k*p-1)*Math.pow(2,a),f+=s):(k=k*Math.pow(2,s-1)*Math.pow(2,a),f=0));for(;8<=a;b[g+e]=k&255,e+=y,k/=256,a-=8);f=f<=l)return l;if(0<=a)return a;a+=l;return 0<=a?a:0}function g(a){a=~~Math.ceil(+a);return 0>a?0:a}function f(a){return(Array.isArray||function(a){return"[object Array]"=={}.toString.apply(a)})(a)} -function a(a){for(var l=[],c=0;c=a.charCodeAt(c))l.push(a.charCodeAt(c));else for(var d=encodeURIComponent(a.charAt(c)).substr(1).split("%"),b=0;b=l.length||b>=a.length);)l[b+c]=a[b],b++;return b}function p(a){try{return decodeURIComponent(a)}catch(l){return String.fromCharCode(65533)}}function n(a,l,c,d){var b=0;d||(r.ok("boolean"===typeof c,"missing or invalid endian"),r.ok(void 0!== -l&&null!==l,"missing offset"),r.ok(l+1=a.length)return 0;c?(b=a[l]<<8,l+1=a.length)return 0;c?(l+1>>0):(l+2>>0));return b}function s(a,l,c,d){d||(r.ok("boolean"===typeof c,"missing or invalid endian"),r.ok(void 0!==l&&null!==l,"missing offset"),r.ok(l+1>>8*(b?1-e:e)} -function u(a,l,c,b,e){e||(r.ok(void 0!==l&&null!==l,"missing value"),r.ok("boolean"===typeof b,"missing or invalid endian"),r.ok(void 0!==c&&null!==c,"missing offset"),r.ok(c+3>>8*(b?3-e:e)&255}function G(a,l,c){r.ok("number"==typeof a,"cannot write a non-number as a number");r.ok(a<=l,"value larger than maximum allowed value");r.ok(a>=c,"value smaller than minimum allowed value");r.ok(Math.floor(a)=== -a,"value has a fractional component")}function F(a,l,c){r.ok("number"==typeof a,"cannot write a non-number as a number");r.ok(a<=l,"value larger than maximum allowed value");r.ok(a>=c,"value smaller than minimum allowed value")}function x(a,l,d,b,e){e||(r.ok(void 0!==l&&null!==l,"missing value"),r.ok("boolean"===typeof b,"missing or invalid endian"),r.ok(void 0!==d&&null!==d,"missing offset"),r.ok(d+1a||a>=this.length)throw Error("oob");return this[a]};b.prototype.set=function(a,c){if(0>a||a>=this.length)throw Error("oob");return this[a]=c};b.byteLength=function(c,l){switch(l||"utf8"){case "hex":return c.length/2;case "utf8":case "utf-8":return a(c).length;case "ascii":case "binary":return c.length;case "base64":return h("base64-js").toByteArray(c).length;default:throw Error("Unknown encoding");}};b.prototype.utf8Write=function(c,l,d){return b._charsWritten=e(a(c),this,l,d)}; -b.prototype.asciiWrite=function(a,c,d){for(var f=b,t=[],n=0;n=a[b]?(c+=p(d)+String.fromCharCode(a[b]),d=""):d+="%"+a[b].toString(16),b++;return c+p(d)};b.prototype.asciiSlice=function(){for(var a=Array.prototype.slice.apply(this,arguments),c="",d=0;dthis[d]?"0"+this[d].toString(16):this[d].toString(16),d==q.INSPECT_MAX_BYTES){a[d+1]="...";break}return""};b.prototype.hexSlice=function(a,c){var d=this.length;if(!a||0>a)a=0;if(!c||0>c||c>d)c=d;for(var d="",b=a;bthis[b]?"0"+this[b].toString(16):this[b].toString(16);return d};b.prototype.toString=function(a,c,d){a=String(a||"utf8").toLowerCase();c=+c||0;"undefined"==typeof d&&(d=this.length);if(+d==c)return"";switch(a){case "hex":return this.hexSlice(c,d);case "utf8":case "utf-8":return this.utf8Slice(c,d);case "ascii":return this.asciiSlice(c,d);case "binary":return this.binarySlice(c, -d);case "base64":return this.base64Slice(c,d);case "ucs2":case "ucs-2":return this.ucs2Slice(c,d);default:throw Error("Unknown encoding");}};b.prototype.hexWrite=function(a,c,d){c=+c||0;var e=this.length-c;d?(d=+d,d>e&&(d=e)):d=e;e=a.length;if(e%2)throw Error("Invalid hex string");d>e/2&&(d=e/2);for(e=0;ee&&(d=e)):d=e;b=String(b||"utf8").toLowerCase();switch(b){case "hex":return this.hexWrite(a,c,d);case "utf8":case "utf-8":return this.utf8Write(a,c,d);case "ascii":return this.asciiWrite(a,c,d);case "binary":return this.binaryWrite(a,c,d);case "base64":return this.base64Write(a,c,d);case "ucs2":case "ucs-2":return this.ucs2Write(a,c,d);default:throw Error("Unknown encoding");}};b.prototype.slice=function(a,c){var d=this.length; -a=k(a,d,0);c=k(c,d,d);return new b(this,c-a,+a)};b.prototype.copy=function(a,c,d,b){d||(d=0);if(void 0===b||isNaN(b))b=this.length;c||(c=0);if(bc||c>=a.length)throw Error("targetStart out of bounds");if(0>d||d>=this.length)throw Error("sourceStart out of bounds");if(0>b||b>this.length)throw Error("sourceEnd out of bounds");b>this.length&&(b=this.length);a.length-cc||c>=this.length)throw Error("start out of bounds");if(0>d||d>this.length)throw Error("end out of bounds");for(;c=this.length))return this[a]};b.prototype.readUInt16LE=function(a,c){return n(this,a,!1,c)};b.prototype.readUInt16BE=function(a,c){return n(this,a,!0,c)};b.prototype.readUInt32LE=function(a,c){return v(this,a,!1,c)};b.prototype.readUInt32BE=function(a,c){return v(this,a,!0,c)};b.prototype.readInt8=function(a,c){var d;c||(r.ok(void 0!== -a&&null!==a,"missing offset"),r.ok(a=this.length))return(d=this[a]&128)?-1*(255-this[a]+1):this[a]};b.prototype.readInt16LE=function(a,c){return s(this,a,!1,c)};b.prototype.readInt16BE=function(a,c){return s(this,a,!0,c)};b.prototype.readInt32LE=function(a,c){return A(this,a,!1,c)};b.prototype.readInt32BE=function(a,c){return A(this,a,!0,c)};b.prototype.readFloatLE=function(a,c){return y(this,a,!1,c)};b.prototype.readFloatBE=function(a,c){return y(this, -a,!0,c)};b.prototype.readDoubleLE=function(a,c){return t(this,a,!1,c)};b.prototype.readDoubleBE=function(a,c){return t(this,a,!0,c)};b.prototype.writeUInt8=function(a,c,b){b||(r.ok(void 0!==a&&null!==a,"missing value"),r.ok(void 0!==c&&null!==c,"missing offset"),r.ok(c>16),p.push((a&65280)>>8),p.push(a&255);2===e?(a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b[g])<<2|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b[g+1])>>4,p.push(a&255)):1===e&&(a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b[g])<<10|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b[g+1])<<4|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b[g+ -2])>>2,p.push(a>>8&255),p.push(a&255));return p};m.exports.fromByteArray=function(b){var g,f=b.length%3,a="",e,p;g=0;for(p=b.length-f;g>18&63]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e>>12&63]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e>>6&63]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e&63];switch(f){case 1:e=b[b.length- -1];a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e>>2];a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e<<4&63];a+="==";break;case 2:e=(b[b.length-2]<<8)+b[b.length-1],a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e>>10],a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e>>4&63],a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e<<2&63],a+="="}return a}})()},{}],5:[function(h,m,q){function b(a){return"[object Array]"=== -p.call(a)}function k(a,d){var c;if(null===a)c={__proto__:null};else{if("object"!==typeof a)throw new TypeError("typeof prototype["+typeof a+"] != 'object'");c=function(){};c.prototype=a;c=new c;c.__proto__=a}"undefined"!==typeof d&&Object.defineProperties&&Object.defineProperties(c,d);return c}function g(a){return"object"!=typeof a&&"function"!=typeof a||null===a}function f(a){if(g(a))throw new TypeError("Object.keys called on a non-object");var d=[],c;for(c in a)n.call(a,c)&&d.push(c);return d}function a(a){if(g(a))throw new TypeError("Object.getOwnPropertyNames called on a non-object"); -var d=f(a);q.isArray(a)&&-1===q.indexOf(a,"length")&&d.push("length");return d}function e(a,d){return{value:a[d]}}var p=Object.prototype.toString,n=Object.prototype.hasOwnProperty;q.isArray="function"===typeof Array.isArray?Array.isArray:b;q.indexOf=function(a,d){if(a.indexOf)return a.indexOf(d);for(var c=0;cf;++f)a.hasOwnProperty(f)&&(e?b=d(b,a[f],f,a):(b=a[f],e=!0));return b};"b"!=="ab".substr(-1)?q.substr=function(a,d,c){0>d&&(d=a.length+d);return a.substr(d,c)}:q.substr=function(a,d,c){return a.substr(d,c)};q.trim= -function(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")};q.bind=function(){var a=Array.prototype.slice.call(arguments),d=a.shift();if(d.bind)return d.bind.apply(d,a);var c=a.shift();return function(){d.apply(c,a.concat([Array.prototype.slice.call(arguments)]))}};q.create="function"===typeof Object.create?Object.create:k;var v="function"===typeof Object.keys?Object.keys:f,s="function"===typeof Object.getOwnPropertyNames?Object.getOwnPropertyNames:a;if(Error().hasOwnProperty("description")){var A= -function(a,d){"[object Error]"===p.call(a)&&(d=q.filter(d,function(a){return"description"!==a&&"number"!==a&&"message"!==a}));return d};q.keys=function(a){return A(a,v(a))};q.getOwnPropertyNames=function(a){return A(a,s(a))}}else q.keys=v,q.getOwnPropertyNames=s;if("function"===typeof Object.getOwnPropertyDescriptor)try{Object.getOwnPropertyDescriptor({a:1},"a"),q.getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor}catch(y){q.getOwnPropertyDescriptor=function(a,d){try{return Object.getOwnPropertyDescriptor(a, -d)}catch(c){return e(a,d)}}}else q.getOwnPropertyDescriptor=e},{}],6:[function(h,m,q){function b(a,c){return s.isUndefined(c)?""+c:s.isNumber(c)&&(isNaN(c)||!isFinite(c))||s.isFunction(c)||s.isRegExp(c)?c.toString():c}function k(a,c){return s.isString(a)?a.lengthg)return c(d)?b.stylize(RegExp.prototype.toString.call(d),"regexp"):b.stylize("[Object]","special");b.seen.push(d);y=u?p(b,d,g,h,y):y.map(function(a){return n(b,d,g,h,a,u)});b.seen.pop();return v(y,k,m)}function e(a,c){if(d(c))return a.stylize("undefined","undefined");if(t(c)){var b="'"+JSON.stringify(c).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(b,"string")}if(y(c))return a.stylize(""+c,"number");if(A(c))return a.stylize(""+c,"boolean");if(null=== -c)return a.stylize("null","null")}function p(a,c,b,d,e){for(var f=[],g=0,p=c.length;gE.indexOf(c.seen,b.value)?(k=null===e?a(c,b.value,null):a(c,b.value,e-1),-1a?"0"+a.toString(10):a.toString(10)}function J(){var a=new Date,c=[H(a.getHours()),H(a.getMinutes()),H(a.getSeconds())].join(":");return[a.getDate(),z[a.getMonth()],c].join(" ")}var E=h("_shims"),r=/%[sdj%]/g; -q.format=function(a){if(!t(a)){for(var c=[],d=0;d=f)return a;switch(a){case "%s":return String(e[d++]);case "%d":return Number(e[d++]);case "%j":try{return JSON.stringify(e[d++])}catch(c){return"[Circular]"}default:return a}}),n=e[d];dk?(-k<<1)+1:(k<<1)+0;do k=f&31,f>>>=5,0=f)throw Error("Expected more digits in base 64 VLQ value.");n=b.decode(k.charAt(g++));p=!!(n&32);n&=31;a+=n<>1;return{value:1===(a&1)?-f:f,rest:k.slice(g)}}})}, -{"./base64":11,amdefine:17}],11:[function(m,x,h){if("function"!==typeof w)var w=m("amdefine")(x,m);w(function(h,m,q){var b={},k={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach(function(g,f){b[g]=f;k[f]=g});m.encode=function(b){if(b in k)return k[b];throw new TypeError("Must be between 0 and 63: "+b);};m.decode=function(g){if(g in b)return b[g];throw new TypeError("Not a valid base 64 digit: "+g);}})},{amdefine:17}],12:[function(m,x,h){if("function"!==typeof w)var w= -m("amdefine")(x,m);w(function(h,m,q){function b(k,g,f,a,e){var p=Math.floor((g-k)/2)+k,n=e(f,a[p]);return 0===n?a[p]:0k?null:a[k]}m.search=function(k,g,f){return 0b.source)return 1;if(a.source=a[f])throw new TypeError("Line must be greater than or equal to 1, got "+ -a[f]);if(0>a[k])throw new TypeError("Column must be greater than or equal to 0, got "+a[k]);return g.search(a,b,h)};b.prototype.originalPositionFor=function(a){a={generatedLine:k.getArg(a,"line"),generatedColumn:k.getArg(a,"column")};if(a=this._findMapping(a,this._generatedMappings,"generatedLine","generatedColumn",this._compareGeneratedPositions)){var b=k.getArg(a,"source",null);b&&this.sourceRoot&&(b=k.join(this.sourceRoot,b));return{source:b,line:k.getArg(a,"originalLine",null),column:k.getArg(a, -"originalColumn",null),name:k.getArg(a,"name",null)}}return{source:null,line:null,column:null,name:null}};b.prototype.sourceContentFor=function(a){if(!this.sourcesContent)return null;this.sourceRoot&&(a=k.relative(this.sourceRoot,a));if(this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];var b;if(this.sourceRoot&&(b=k.urlParse(this.sourceRoot))){var f=a.replace(/^file:\/\//,"");if("file"==b.scheme&&this._sources.has(f))return this.sourcesContent[this._sources.indexOf(f)];if((!b.path|| -"/"==b.path)&&this._sources.has("/"+a))return this.sourcesContent[this._sources.indexOf("/"+a)]}throw Error('"'+a+'" is not in the SourceMap.');};b.prototype.generatedPositionFor=function(a){a={source:k.getArg(a,"source"),originalLine:k.getArg(a,"line"),originalColumn:k.getArg(a,"column")};this.sourceRoot&&(a.source=k.relative(this.sourceRoot,a.source));return(a=this._findMapping(a,this._originalMappings,"originalLine","originalColumn",this._compareOriginalPositions))?{line:k.getArg(a,"generatedLine", -null),column:k.getArg(a,"generatedColumn",null)}:{line:null,column:null}};b.GENERATED_ORDER=1;b.ORIGINAL_ORDER=2;b.prototype.eachMapping=function(a,f,n){f=f||null;switch(n||b.GENERATED_ORDER){case b.GENERATED_ORDER:n=this._generatedMappings;break;case b.ORIGINAL_ORDER:n=this._originalMappings;break;default:throw Error("Unknown order of iteration.");}var g=this.sourceRoot;n.map(function(a){var b=a.source;b&&g&&(b=k.join(g,b));return{source:b,generatedLine:a.generatedLine,generatedColumn:a.generatedColumn, -originalLine:a.originalLine,originalColumn:a.originalColumn,name:a.name}}).forEach(a,f)};m.SourceMapConsumer=b})},{"./array-set":9,"./base64-vlq":10,"./binary-search":12,"./util":16,amdefine:17}],14:[function(m,x,h){if("function"!==typeof w)var w=m("amdefine")(x,m);w(function(h,m,q){function b(a){this._file=e.getArg(a,"file");this._sourceRoot=e.getArg(a,"sourceRoot",null);this._sources=new p;this._names=new p;this._mappings=[];this._sourcesContents=null}function k(a,b){var e=(a&&a.line)-(b&&b.line); -return e?e:(a&&a.column)-(b&&b.column)}function g(a,b){a=a||"";b=b||"";return(a>b)-(ah;++h)a.hasOwnProperty(h)&&(r? +e=b(e,a[h],h,a):(e=a[h],r=!0));return e};"b"!=="ab".substr(-1)?g.substr=function(a,b,d){0>b&&(b=a.length+b);return a.substr(b,d)}:g.substr=function(a,b,d){return a.substr(b,d)};g.trim=function(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")};g.bind=function(){var a=Array.prototype.slice.call(arguments),b=a.shift();if(b.bind)return b.bind.apply(b,a);var d=a.shift();return function(){b.apply(d,a.concat([Array.prototype.slice.call(arguments)]))}};g.create="function"===typeof Object.create?Object.create: +C;var a="function"===typeof Object.keys?Object.keys:p,d="function"===typeof Object.getOwnPropertyNames?Object.getOwnPropertyNames:b;if(Error().hasOwnProperty("description")){var n=function(a,b){"[object Error]"===f.call(a)&&(b=g.filter(b,function(a){return"description"!==a&&"number"!==a&&"message"!==a}));return b};g.keys=function(b){return n(b,a(b))};g.getOwnPropertyNames=function(a){return n(a,d(a))}}else g.keys=a,g.getOwnPropertyNames=d;if("function"===typeof Object.getOwnPropertyDescriptor)try{Object.getOwnPropertyDescriptor({a:1}, +"a"),g.getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor}catch(l){g.getOwnPropertyDescriptor=function(a,b){try{return Object.getOwnPropertyDescriptor(a,b)}catch(d){return m(a,b)}}}else g.getOwnPropertyDescriptor=m},{}],3:[function(k,y,g){},{}],4:[function(k,y,g){function v(b,f){for(var e=0,a=b.length-1;0<=a;a--){var d=b[a];"."===d?b.splice(a,1):".."===d?(b.splice(a,1),e++):e&&(b.splice(a,1),e--)}if(f)for(;e--;e)b.unshift("..");return b}var C=k("__browserify_process"),E=k("util"),p=k("_shims"), +b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;g.resolve=function(){for(var b="",f=!1,e=arguments.length-1;-1<=e&&!f;e--){var a=0<=e?arguments[e]:C.cwd();if(!E.isString(a))throw new TypeError("Arguments to path.resolve must be strings");a&&(b=a+"/"+b,f="/"===a.charAt(0))}b=v(p.filter(b.split("/"),function(a){return!!a}),!f).join("/");return(f?"/":"")+b||"."};g.normalize=function(b){var f=g.isAbsolute(b),e="/"===p.substr(b,-1);(b=v(p.filter(b.split("/"),function(a){return!!a}),!f).join("/"))|| +f||(b=".");b&&e&&(b+="/");return(f?"/":"")+b};g.isAbsolute=function(b){return"/"===b.charAt(0)};g.join=function(){var b=Array.prototype.slice.call(arguments,0);return g.normalize(p.filter(b,function(b,e){if(!E.isString(b))throw new TypeError("Arguments to path.join must be strings");return b}).join("/"))};g.relative=function(b,f){function e(a){for(var b=0;bd?[]:a.slice(b,d-b+1)}b=g.resolve(b).substr(1);f=g.resolve(f).substr(1); +for(var a=e(b.split("/")),d=e(f.split("/")),n=Math.min(a.length,d.length),l=n,w=0;wn)return A(l)?t.stylize(RegExp.prototype.toString.call(l), +"regexp"):t.stylize("[Object]","special");t.seen.push(l);s=x?f(t,l,n,z,s):s.map(function(c){return e(t,l,n,z,c,x)});t.seen.pop();return a(s,q,B)}function m(c,a){if(u(a))return c.stylize("undefined","undefined");if(w(a)){var b="'"+JSON.stringify(a).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return c.stylize(b,"string")}if(l(a))return c.stylize(""+a,"number");if(n(a))return c.stylize(""+a,"boolean");if(null===a)return c.stylize("null","null")}function f(c,a,b,d,h){for(var z=[], +x=0,B=a.length;xD.indexOf(c.seen,a.value)?(B=null===d? +b(c,a.value,null):b(c,a.value,d-1),-1c?"0"+c.toString(10):c.toString(10)}function G(){var c=new Date,a=[t(c.getHours()),t(c.getMinutes()),t(c.getSeconds())].join(":");return[c.getDate(),H[c.getMonth()],a].join(" ")}var D=k("_shims"),I=/%[sdj%]/g;g.format=function(c){if(!w(c)){for(var a=[],b=0;b=h)return z;switch(z){case "%s":return String(d[b++]);case "%d":return Number(d[b++]);case "%j":try{return JSON.stringify(d[b++])}catch(c){return"[Circular]"}default:return z}}),z=d[b];b>1,w=-7;a=f?0:a-1;var u=f?1:-1,g=b[m+a];a+=u;f=g&(1<<-w)-1;g>>=-w;for(w+=d;0>=-w;for(w+=e;0>1,g=23===a?Math.pow(2,-24)- +Math.pow(2,-77):0;d=e?d-1:0;var q=e?-1:1,r=0>m||0===m&&0>1/m?1:0;m=Math.abs(m);isNaN(m)||Infinity===m?(m=isNaN(m)?1:0,e=w):(e=Math.floor(Math.log(m)/Math.LN2),1>m*(n=Math.pow(2,-e))&&(e--,n*=2),m=1<=e+u?m+g/n:m+g*Math.pow(2,1-u),2<=m*n&&(e++,n/=2),e+u>=w?(m=0,e=w):1<=e+u?(m=(m*n-1)*Math.pow(2,a),e+=u):(m=m*Math.pow(2,u-1)*Math.pow(2,a),e=0));for(;8<=a;b[f+d]=m&255,d+=q,m/=256,a-=8);e=e<=a)return a;if(0<=c)return c;c+=a;return 0<=c?c:0}function f(c){c=~~Math.ceil(+c);return 0>c?0:c}function e(c){return(Array.isArray||function(c){return"[object Array]"=={}.toString.apply(c)})(c)} +function a(c){return 16>c?"0"+c.toString(16):c.toString(16)}function d(c){for(var a=[],b=0;b=c.charCodeAt(b))a.push(c.charCodeAt(b));else for(var d=encodeURIComponent(c.charAt(b)).substr(1).split("%"),h=0;h=a.length||h>=c.length);)a[h+b]=c[h],h++;return h}function w(c){try{return decodeURIComponent(c)}catch(a){return String.fromCharCode(65533)}} +function u(c,a,b,d){var h=0;d||(s.ok("boolean"===typeof b,"missing or invalid endian"),s.ok(void 0!==a&&null!==a,"missing offset"),s.ok(a+1=c.length)return 0;b?(h=c[a]<<8,a+1=c.length)return 0; +b?(a+1>>0):(a+2>>0));return h}function q(c,a,b,d){d||(s.ok("boolean"===typeof b,"missing or invalid endian"),s.ok(void 0!==a&&null!==a,"missing offset"),s.ok(a+1>>8*(d?1-h:h)}function D(c,a,b,d,h){h||(s.ok(void 0!==a&&null!==a,"missing value"),s.ok("boolean"===typeof d,"missing or invalid endian"),s.ok(void 0!==b&&null!==b,"missing offset"),s.ok(b+3>>8*(d?3-h:h)&255}function y(c,a,b){s.ok("number"==typeof c,"cannot write a non-number as a number");s.ok(c<=a,"value larger than maximum allowed value"); +s.ok(c>=b,"value smaller than minimum allowed value");s.ok(Math.floor(c)===c,"value has a fractional component")}function H(c,a,b){s.ok("number"==typeof c,"cannot write a non-number as a number");s.ok(c<=a,"value larger than maximum allowed value");s.ok(c>=b,"value smaller than minimum allowed value")}function J(c,a,b,d,h){h||(s.ok(void 0!==a&&null!==a,"missing value"),s.ok("boolean"===typeof d,"missing or invalid endian"),s.ok(void 0!==b&&null!==b,"missing offset"),s.ok(b+1c||c>=this.length)throw Error("oob");return this[c]};b.prototype.set=function(c,a){if(0>c||c>=this.length)throw Error("oob");return this[c]=a};b.byteLength=function(c,a){switch(a||"utf8"){case "hex":return c.length/2;case "utf8":case "utf-8":return d(c).length;case "ascii":case "binary":return c.length;case "base64":return n(c).length;default:throw Error("Unknown encoding");}};b.prototype.utf8Write= +function(c,a,h){return b._charsWritten=l(d(c),this,a,h)};b.prototype.asciiWrite=function(c,a,d){for(var h=b,e=[],r=0;r=c[d]?(a+=w(b)+String.fromCharCode(c[d]),b=""):b+="%"+c[d].toString(16),d++;return a+w(b)};b.prototype.asciiSlice=function(){for(var c=Array.prototype.slice.apply(this,arguments),a="",b=0;b"};b.prototype.hexSlice= +function(c,b){var d=this.length;if(!c||0>c)c=0;if(!b||0>b||b>d)b=d;for(var d="",h=c;hh&&(d=h)):d=h;h=c.length;if(h%2)throw Error("Invalid hex string");d>h/2&&(d=h/2);for(h=0;hh&&(b=h)):b=h;d=String(d|| +"utf8").toLowerCase();switch(d){case "hex":return this.hexWrite(c,a,b);case "utf8":case "utf-8":return this.utf8Write(c,a,b);case "ascii":return this.asciiWrite(c,a,b);case "binary":return this.binaryWrite(c,a,b);case "base64":return this.base64Write(c,a,b);case "ucs2":case "ucs-2":return this.ucs2Write(c,a,b);default:throw Error("Unknown encoding");}};b.prototype.slice=function(c,a){var d=this.length;c=m(c,d,0);a=m(a,d,d);return new b(this,a-c,+c)};b.prototype.copy=function(c,a,b,d){b||(b=0);if(void 0=== +d||isNaN(d))d=this.length;a||(a=0);if(da||a>=c.length)throw Error("targetStart out of bounds");if(0>b||b>=this.length)throw Error("sourceStart out of bounds");if(0>d||d>this.length)throw Error("sourceEnd out of bounds");d>this.length&&(d=this.length);c.length-aa||a>=this.length)throw Error("start out of bounds");if(0>b||b>this.length)throw Error("end out of bounds");for(;a=this.length))return this[c]};b.prototype.readUInt16LE=function(c,a){return u(this,c,!1,a)};b.prototype.readUInt16BE=function(c,a){return u(this,c,!0,a)};b.prototype.readUInt32LE=function(c,a){return A(this,c,!1,a)};b.prototype.readUInt32BE=function(c,a){return A(this,c,!0,a)};b.prototype.readInt8=function(c,a){var b;a||(s.ok(void 0!==c&&null!==c,"missing offset"),s.ok(c=this.length))return(b=this[c]&128)?-1*(255-this[c]+1):this[c]};b.prototype.readInt16LE=function(c,a){return q(this,c,!1,a)};b.prototype.readInt16BE=function(c,a){return q(this,c,!0,a)};b.prototype.readInt32LE=function(c,a){return r(this,c,!1,a)};b.prototype.readInt32BE=function(c,a){return r(this,c,!0,a)};b.prototype.readFloatLE=function(c,a){return h(this,c,!1,a)};b.prototype.readFloatBE=function(c,a){return h(this,c,!0,a)};b.prototype.readDoubleLE=function(a,b){return c(this,a,!1,b)};b.prototype.readDoubleBE= +function(a,b){return c(this,a,!0,b)};b.prototype.writeUInt8=function(c,a,b){b||(s.ok(void 0!==c&&null!==c,"missing value"),s.ok(void 0!==a&&null!==a,"missing offset"),s.ok(a>16),n.push((a&65280)>>8),n.push(a&255);2===d?(a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b[f])<< +2|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b[f+1])>>4,n.push(a&255)):1===d&&(a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b[f])<<10|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b[f+1])<<4|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b[f+2])>>2,n.push(a>>8&255),n.push(a&255));return n};k.exports.fromByteArray=function(b){var f,e=b.length%3,a="",d,n;f=0;for(n=b.length-e;f>18&63]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[d>>12&63]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[d>>6&63]+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[d&63];switch(e){case 1:d=b[b.length-1];a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[d>>2];a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[d<< +4&63];a+="==";break;case 2:d=(b[b.length-2]<<8)+b[b.length-1],a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[d>>10],a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[d>>4&63],a+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[d<<2&63],a+="="}return a}})()},{}],5:[function(g,k,p){function b(a){return"[object Array]"===n.call(a)}function m(a,b){var c;if(null===a)c={__proto__:null};else{if("object"!==typeof a)throw new TypeError("typeof prototype["+ +typeof a+"] != 'object'");c=function(){};c.prototype=a;c=new c;c.__proto__=a}"undefined"!==typeof b&&Object.defineProperties&&Object.defineProperties(c,b);return c}function f(a){return"object"!=typeof a&&"function"!=typeof a||null===a}function e(a){if(f(a))throw new TypeError("Object.keys called on a non-object");var b=[],c;for(c in a)l.call(a,c)&&b.push(c);return b}function a(a){if(f(a))throw new TypeError("Object.getOwnPropertyNames called on a non-object");var b=e(a);p.isArray(a)&&-1===p.indexOf(a, +"length")&&b.push("length");return b}function d(a,b){return{value:a[b]}}var n=Object.prototype.toString,l=Object.prototype.hasOwnProperty;p.isArray="function"===typeof Array.isArray?Array.isArray:b;p.indexOf=function(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0;cl;++l)a.hasOwnProperty(l)&&(e?d=b(d,a[l],l,a):(d=a[l],e=!0));return d};"b"!=="ab".substr(-1)?p.substr=function(a,b,c){0>b&&(b=a.length+b);return a.substr(b,c)}:p.substr=function(a,b,c){return a.substr(b,c)};p.trim=function(a){return a.trim? +a.trim():a.replace(/^\s+|\s+$/g,"")};p.bind=function(){var a=Array.prototype.slice.call(arguments),b=a.shift();if(b.bind)return b.bind.apply(b,a);var c=a.shift();return function(){b.apply(c,a.concat([Array.prototype.slice.call(arguments)]))}};p.create="function"===typeof Object.create?Object.create:m;var w="function"===typeof Object.keys?Object.keys:e,u="function"===typeof Object.getOwnPropertyNames?Object.getOwnPropertyNames:a;if(Error().hasOwnProperty("description")){var A=function(a,b){"[object Error]"=== +n.call(a)&&(b=p.filter(b,function(c){return"description"!==c&&"number"!==c&&"message"!==c}));return b};p.keys=function(a){return A(a,w(a))};p.getOwnPropertyNames=function(a){return A(a,u(a))}}else p.keys=w,p.getOwnPropertyNames=u;if("function"===typeof Object.getOwnPropertyDescriptor)try{Object.getOwnPropertyDescriptor({a:1},"a"),p.getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor}catch(q){p.getOwnPropertyDescriptor=function(a,b){try{return Object.getOwnPropertyDescriptor(a,b)}catch(c){return d(a, +b)}}}else p.getOwnPropertyDescriptor=d},{}],6:[function(g,k,p){function b(a,c){return u.isUndefined(c)?""+c:u.isNumber(c)&&(isNaN(c)||!isFinite(c))||u.isFunction(c)||u.isRegExp(c)?c.toString():c}function m(a,c){return u.isString(a)?a.lengthf)return c(h)?b.stylize(RegExp.prototype.toString.call(h),"regexp"):b.stylize("[Object]","special");b.seen.push(h);t=g?n(b,h,f,m,t):t.map(function(a){return l(b,h,f,m,a,g)});b.seen.pop();return w(t,q,k)}function d(a,c){if(h(c))return a.stylize("undefined","undefined");if(r(c)){var b="'"+JSON.stringify(c).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(b,"string")}if(q(c))return a.stylize(""+c,"number");if(A(c))return a.stylize(""+c,"boolean");if(null=== +c)return a.stylize("null","null")}function n(a,c,b,d,e){for(var h=[],f=0,q=c.length;fF.indexOf(c.seen,b.value)?(n=null===d?a(c,b.value,null):a(c,b.value,d-1),-1a?"0"+a.toString(10):a.toString(10)}function J(){var a=new Date,c=[H(a.getHours()),H(a.getMinutes()),H(a.getSeconds())].join(":");return[a.getDate(),L[a.getMonth()],c].join(" ")}var F=g("_shims"),K=/%[sdj%]/g; +p.format=function(a){if(!r(a)){for(var c=[],d=0;d=h)return a;switch(a){case "%s":return String(e[d++]);case "%d":return Number(e[d++]);case "%j":try{return JSON.stringify(e[d++])}catch(c){return"[Circular]"}default:return a}}),l=e[d];dg?(-g<<1)+1:(g<<1)+0;do g=e&31,e>>>=5,0=e)throw Error("Expected more digits in base 64 VLQ value.");l=b.decode(g.charAt(f++));n=!!(l&32);l&=31;a+=l<>1;return{value:1===(a&1)?-e:e,rest:g.slice(f)}}})}, +{"./base64":11,amdefine:17}],11:[function(k,y,g){if("function"!==typeof v)var v=k("amdefine")(y,k);v(function(g,k,p){var b={},m={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach(function(f,e){b[f]=e;m[e]=f});k.encode=function(b){if(b in m)return m[b];throw new TypeError("Must be between 0 and 63: "+b);};k.decode=function(f){if(f in b)return b[f];throw new TypeError("Not a valid base 64 digit: "+f);}})},{amdefine:17}],12:[function(k,y,g){if("function"!==typeof v)var v= +k("amdefine")(y,k);v(function(g,k,p){function b(g,f,e,a,d){var n=Math.floor((f-g)/2)+g,l=d(e,a[n]);return 0===l?a[n]:0g?null:a[g]}k.search=function(g,f,e){return 0b.source)return 1;if(a.source=a[e])throw new TypeError("Line must be greater than or equal to 1, got "+ +a[e]);if(0>a[g])throw new TypeError("Column must be greater than or equal to 0, got "+a[g]);return f.search(a,b,m)};b.prototype.originalPositionFor=function(a){a={generatedLine:m.getArg(a,"line"),generatedColumn:m.getArg(a,"column")};if(a=this._findMapping(a,this._generatedMappings,"generatedLine","generatedColumn",this._compareGeneratedPositions)){var b=m.getArg(a,"source",null);b&&this.sourceRoot&&(b=m.join(this.sourceRoot,b));return{source:b,line:m.getArg(a,"originalLine",null),column:m.getArg(a, +"originalColumn",null),name:m.getArg(a,"name",null)}}return{source:null,line:null,column:null,name:null}};b.prototype.sourceContentFor=function(a){if(!this.sourcesContent)return null;this.sourceRoot&&(a=m.relative(this.sourceRoot,a));if(this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];var b;if(this.sourceRoot&&(b=m.urlParse(this.sourceRoot))){var e=a.replace(/^file:\/\//,"");if("file"==b.scheme&&this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];if((!b.path|| +"/"==b.path)&&this._sources.has("/"+a))return this.sourcesContent[this._sources.indexOf("/"+a)]}throw Error('"'+a+'" is not in the SourceMap.');};b.prototype.generatedPositionFor=function(a){a={source:m.getArg(a,"source"),originalLine:m.getArg(a,"line"),originalColumn:m.getArg(a,"column")};this.sourceRoot&&(a.source=m.relative(this.sourceRoot,a.source));return(a=this._findMapping(a,this._originalMappings,"originalLine","originalColumn",this._compareOriginalPositions))?{line:m.getArg(a,"generatedLine", +null),column:m.getArg(a,"generatedColumn",null)}:{line:null,column:null}};b.GENERATED_ORDER=1;b.ORIGINAL_ORDER=2;b.prototype.eachMapping=function(a,e,l){e=e||null;switch(l||b.GENERATED_ORDER){case b.GENERATED_ORDER:l=this._generatedMappings;break;case b.ORIGINAL_ORDER:l=this._originalMappings;break;default:throw Error("Unknown order of iteration.");}var f=this.sourceRoot;l.map(function(a){var b=a.source;b&&f&&(b=m.join(f,b));return{source:b,generatedLine:a.generatedLine,generatedColumn:a.generatedColumn, +originalLine:a.originalLine,originalColumn:a.originalColumn,name:a.name}}).forEach(a,e)};k.SourceMapConsumer=b})},{"./array-set":9,"./base64-vlq":10,"./binary-search":12,"./util":16,amdefine:17}],14:[function(k,y,g){if("function"!==typeof v)var v=k("amdefine")(y,k);v(function(g,k,p){function b(a){this._file=d.getArg(a,"file");this._sourceRoot=d.getArg(a,"sourceRoot",null);this._sources=new n;this._names=new n;this._mappings=[];this._sourcesContents=null}function m(a,b){var d=(a&&a.line)-(b&&b.line); +return d?d:(a&&a.column)-(b&&b.column)}function f(a,b){a=a||"";b=b||"";return(a>b)-(a