-
Notifications
You must be signed in to change notification settings - Fork 25
/
stacktrace.min.js
2 lines (2 loc) · 26.2 KB
/
stacktrace.min.js
1
2
!function(e,n){"use strict";"function"==typeof define&&define.amd?define("stackframe",[],n):"object"==typeof exports?module.exports=n():e.StackFrame=n()}(this,function(){"use strict";function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function n(e,n,t,r,i,o){void 0!==e&&this.setFunctionName(e),void 0!==n&&this.setArgs(n),void 0!==t&&this.setFileName(t),void 0!==r&&this.setLineNumber(r),void 0!==i&&this.setColumnNumber(i),void 0!==o&&this.setSource(o)}return n.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(e){this.functionName=String(e)},getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getFileName:function(){return this.fileName},setFileName:function(e){this.fileName=String(e)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(n){if(!e(n))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(n)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(n){if(!e(n))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(n)},getSource:function(){return this.source},setSource:function(e){this.source=String(e)},toString:function(){var n=this.getFunctionName()||"{anonymous}",t="("+(this.getArgs()||[]).join(",")+")",r=this.getFileName()?"@"+this.getFileName():"",i=e(this.getLineNumber())?":"+this.getLineNumber():"",o=e(this.getColumnNumber())?":"+this.getColumnNumber():"";return n+t+r+i+o}},n});var SourceMap=function(e){function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(e,n,t){function r(e){var n=e;return"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=n.sections?new s(n):new i(n)}function i(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var t=a.getArg(n,"version"),r=a.getArg(n,"sources"),i=a.getArg(n,"names",[]),o=a.getArg(n,"sourceRoot",null),s=a.getArg(n,"sourcesContent",null),u=a.getArg(n,"mappings"),l=a.getArg(n,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);r=r.map(a.normalize).map(function(e){return o&&a.isAbsolute(o)&&a.isAbsolute(e)?a.relative(o,e):e}),this._names=c.fromArray(i,!0),this._sources=c.fromArray(r,!0),this.sourceRoot=o,this.sourcesContent=s,this._mappings=u,this.file=l}function o(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var t=a.getArg(n,"version"),i=a.getArg(n,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new c,this._names=new c;var o={line:-1,column:0};this._sections=i.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=a.getArg(e,"offset"),t=a.getArg(n,"line"),i=a.getArg(n,"column");if(t<o.line||t===o.line&&i<o.column)throw new Error("Section offsets must be ordered and non-overlapping.");return o=n,{generatedOffset:{generatedLine:t+1,generatedColumn:i+1},consumer:new r(a.getArg(e,"map"))}})}var a=t(1),u=t(2),c=t(3).ArraySet,l=t(4),f=t(6).quickSort;r.fromSourceMap=function(e){return i.fromSourceMap(e)},r.prototype._version=3,r.prototype.__generatedMappings=null,Object.defineProperty(r.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),r.prototype.__originalMappings=null,Object.defineProperty(r.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),r.prototype._charIsMappingSeparator=function(e,n){var t=e.charAt(n);return";"===t||","===t},r.prototype._parseMappings=function(e,n){throw new Error("Subclasses must implement _parseMappings")},r.GENERATED_ORDER=1,r.ORIGINAL_ORDER=2,r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.prototype.eachMapping=function(e,n,t){var i,o=n||null,s=t||r.GENERATED_ORDER;switch(s){case r.GENERATED_ORDER:i=this._generatedMappings;break;case r.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;i.map(function(e){var n=null===e.source?null:this._sources.at(e.source);return null!=n&&null!=u&&(n=a.join(u,n)),{source:n,generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}},this).forEach(e,o)},r.prototype.allGeneratedPositionsFor=function(e){var n=a.getArg(e,"line"),t={source:a.getArg(e,"source"),originalLine:n,originalColumn:a.getArg(e,"column",0)};if(null!=this.sourceRoot&&(t.source=a.relative(this.sourceRoot,t.source)),!this._sources.has(t.source))return[];t.source=this._sources.indexOf(t.source);var r=[],i=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(i>=0){var o=this._originalMappings[i];if(void 0===e.column)for(var s=o.originalLine;o&&o.originalLine===s;)r.push({line:a.getArg(o,"generatedLine",null),column:a.getArg(o,"generatedColumn",null),lastColumn:a.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++i];else for(var c=o.originalColumn;o&&o.originalLine===n&&o.originalColumn==c;)r.push({line:a.getArg(o,"generatedLine",null),column:a.getArg(o,"generatedColumn",null),lastColumn:a.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++i]}return r},n.SourceMapConsumer=r,i.prototype=Object.create(r.prototype),i.prototype.consumer=r,i.fromSourceMap=function(e){var n=Object.create(i.prototype),t=n._names=c.fromArray(e._names.toArray(),!0),r=n._sources=c.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var s=e._mappings.toArray().slice(),u=n.__generatedMappings=[],l=n.__originalMappings=[],p=0,g=s.length;g>p;p++){var h=s[p],m=new o;m.generatedLine=h.generatedLine,m.generatedColumn=h.generatedColumn,h.source&&(m.source=r.indexOf(h.source),m.originalLine=h.originalLine,m.originalColumn=h.originalColumn,h.name&&(m.name=t.indexOf(h.name)),l.push(m)),u.push(m)}return f(n.__originalMappings,a.compareByOriginalPositions),n},i.prototype._version=3,Object.defineProperty(i.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?a.join(this.sourceRoot,e):e},this)}}),i.prototype._parseMappings=function(e,n){for(var t,r,i,s,u,c=1,p=0,g=0,h=0,m=0,d=0,_=e.length,v=0,y={},w={},b=[],C=[];_>v;)if(";"===e.charAt(v))c++,v++,p=0;else if(","===e.charAt(v))v++;else{for(t=new o,t.generatedLine=c,s=v;_>s&&!this._charIsMappingSeparator(e,s);s++);if(r=e.slice(v,s),i=y[r])v+=r.length;else{for(i=[];s>v;)l.decode(e,v,w),u=w.value,v=w.rest,i.push(u);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");y[r]=i}t.generatedColumn=p+i[0],p=t.generatedColumn,i.length>1&&(t.source=m+i[1],m+=i[1],t.originalLine=g+i[2],g=t.originalLine,t.originalLine+=1,t.originalColumn=h+i[3],h=t.originalColumn,i.length>4&&(t.name=d+i[4],d+=i[4])),C.push(t),"number"==typeof t.originalLine&&b.push(t)}f(C,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=C,f(b,a.compareByOriginalPositions),this.__originalMappings=b},i.prototype._findMapping=function(e,n,t,r,i,o){if(e[t]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[t]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return u.search(e,n,i,o)},i.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var n=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var t=this._generatedMappings[e+1];if(n.generatedLine===t.generatedLine){n.lastGeneratedColumn=t.generatedColumn-1;continue}}n.lastGeneratedColumn=1/0}},i.prototype.originalPositionFor=function(e){var n={generatedLine:a.getArg(e,"line"),generatedColumn:a.getArg(e,"column")},t=this._findMapping(n,this._generatedMappings,"generatedLine","generatedColumn",a.compareByGeneratedPositionsDeflated,a.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(t>=0){var i=this._generatedMappings[t];if(i.generatedLine===n.generatedLine){var o=a.getArg(i,"source",null);null!==o&&(o=this._sources.at(o),null!=this.sourceRoot&&(o=a.join(this.sourceRoot,o)));var s=a.getArg(i,"name",null);return null!==s&&(s=this._names.at(s)),{source:o,line:a.getArg(i,"originalLine",null),column:a.getArg(i,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}):!1},i.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=a.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var t;if(null!=this.sourceRoot&&(t=a.urlParse(this.sourceRoot))){var r=e.replace(/^file:\/\//,"");if("file"==t.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!t.path||"/"==t.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};n=this._sources.indexOf(n);var t={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},i=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var o=this._originalMappings[i];if(o.source===t.source)return{line:a.getArg(o,"generatedLine",null),column:a.getArg(o,"generatedColumn",null),lastColumn:a.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=i,s.prototype=Object.create(r.prototype),s.prototype.constructor=r,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n<this._sections.length;n++)for(var t=0;t<this._sections[n].consumer.sources.length;t++)e.push(this._sections[n].consumer.sources[t]);return e}}),s.prototype.originalPositionFor=function(e){var n={generatedLine:a.getArg(e,"line"),generatedColumn:a.getArg(e,"column")},t=u.search(n,this._sections,function(e,n){var t=e.generatedLine-n.generatedOffset.generatedLine;return t?t:e.generatedColumn-n.generatedOffset.generatedColumn}),r=this._sections[t];return r?r.consumer.originalPositionFor({line:n.generatedLine-(r.generatedOffset.generatedLine-1),column:n.generatedColumn-(r.generatedOffset.generatedLine===n.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},s.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},s.prototype.sourceContentFor=function(e,n){for(var t=0;t<this._sections.length;t++){var r=this._sections[t],i=r.consumer.sourceContentFor(e,!0);if(i)return i}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},s.prototype.generatedPositionFor=function(e){for(var n=0;n<this._sections.length;n++){var t=this._sections[n];if(-1!==t.consumer.sources.indexOf(a.getArg(e,"source"))){var r=t.consumer.generatedPositionFor(e);if(r){var i={line:r.line+(t.generatedOffset.generatedLine-1),column:r.column+(t.generatedOffset.generatedLine===r.line?t.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}},s.prototype._parseMappings=function(e,n){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var r=this._sections[t],i=r.consumer._generatedMappings,o=0;o<i.length;o++){var s=i[t],u=r.consumer._sources.at(s.source);null!==r.consumer.sourceRoot&&(u=a.join(r.consumer.sourceRoot,u)),this._sources.add(u),u=this._sources.indexOf(u);var c=r.consumer._names.at(s.name);this._names.add(c),c=this._names.indexOf(c);var l={source:u,generatedLine:s.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:s.column+(r.generatedOffset.generatedLine===s.generatedLine)?r.generatedOffset.generatedColumn-1:0,originalLine:s.originalLine,originalColumn:s.originalColumn,name:c};this.__generatedMappings.push(l),"number"==typeof l.originalLine&&this.__originalMappings.push(l)}f(this.__generatedMappings,a.compareByGeneratedPositionsDeflated),f(this.__originalMappings,a.compareByOriginalPositions)},n.IndexedSourceMapConsumer=s},function(e,n){function t(e,n,t){if(n in e)return e[n];if(3===arguments.length)return t;throw new Error('"'+n+'" is a required argument.')}function r(e){var n=e.match(h);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function i(e){var n="";return e.scheme&&(n+=e.scheme+":"),n+="//",e.auth&&(n+=e.auth+"@"),e.host&&(n+=e.host),e.port&&(n+=":"+e.port),e.path&&(n+=e.path),n}function o(e){var t=e,o=r(e);if(o){if(!o.path)return e;t=o.path}for(var s,a=n.isAbsolute(t),u=t.split(/\/+/),c=0,l=u.length-1;l>=0;l--)s=u[l],"."===s?u.splice(l,1):".."===s?c++:c>0&&(""===s?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return t=u.join("/"),""===t&&(t=a?"/":"."),o?(o.path=t,i(o)):t}function s(e,n){""===e&&(e="."),""===n&&(n=".");var t=r(n),s=r(e);if(s&&(e=s.path||"/"),t&&!t.scheme)return s&&(t.scheme=s.scheme),i(t);if(t||n.match(m))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);var a="/"===n.charAt(0)?n:o(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,i(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var t=0;0!==n.indexOf(e+"/");){var r=e.lastIndexOf("/");if(0>r)return n;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return n;++t}return Array(t+1).join("../")+n.substr(e.length+1)}function u(e){return"$"+e}function c(e){return e.substr(1)}function l(e,n,t){var r=e.source-n.source;return 0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r||t?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=e.generatedLine-n.generatedLine,0!==r?r:e.name-n.name))))}function f(e,n,t){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r||t?r:(r=e.source-n.source,0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:e.name-n.name))))}function p(e,n){return e===n?0:e>n?1:-1}function g(e,n){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=p(e.source,n.source),0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:p(e.name,n.name)))))}n.getArg=t;var h=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,m=/^data:.+\,.+$/;n.urlParse=r,n.urlGenerate=i,n.normalize=o,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(h)},n.relative=a,n.toSetString=u,n.fromSetString=c,n.compareByOriginalPositions=l,n.compareByGeneratedPositionsDeflated=f,n.compareByGeneratedPositionsInflated=g},function(e,n){function t(e,r,i,o,s,a){var u=Math.floor((r-e)/2)+e,c=s(i,o[u],!0);return 0===c?u:c>0?r-u>1?t(u,r,i,o,s,a):a==n.LEAST_UPPER_BOUND?r<o.length?r:-1:u:u-e>1?t(e,u,i,o,s,a):a==n.LEAST_UPPER_BOUND?u:0>e?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,r,i,o){if(0===r.length)return-1;var s=t(-1,r.length,e,r,i,o||n.GREATEST_LOWER_BOUND);if(0>s)return-1;for(;s-1>=0&&0===i(r[s],r[s-1],!0);)--s;return s}},function(e,n,t){function r(){this._array=[],this._set={}}var i=t(1);r.fromArray=function(e,n){for(var t=new r,i=0,o=e.length;o>i;i++)t.add(e[i],n);return t},r.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},r.prototype.add=function(e,n){var t=i.toSetString(e),r=this._set.hasOwnProperty(t),o=this._array.length;(!r||n)&&this._array.push(e),r||(this._set[t]=o)},r.prototype.has=function(e){var n=i.toSetString(e);return this._set.hasOwnProperty(n)},r.prototype.indexOf=function(e){var n=i.toSetString(e);if(this._set.hasOwnProperty(n))return this._set[n];throw new Error('"'+e+'" is not in the set.')},r.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},r.prototype.toArray=function(){return this._array.slice()},n.ArraySet=r},function(e,n,t){function r(e){return 0>e?(-e<<1)+1:(e<<1)+0}function i(e){var n=1===(1&e),t=e>>1;return n?-t:t}var o=t(5),s=5,a=1<<s,u=a-1,c=a;n.encode=function(e){var n,t="",i=r(e);do n=i&u,i>>>=s,i>0&&(n|=c),t+=o.encode(n);while(i>0);return t},n.decode=function(e,n,t){var r,a,l=e.length,f=0,p=0;do{if(n>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(a=o.decode(e.charCodeAt(n++)),-1===a)throw new Error("Invalid base64 digit: "+e.charAt(n-1));r=!!(a&c),a&=u,f+=a<<p,p+=s}while(r);t.value=i(f),t.rest=n}},function(e,n){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(e>=0&&e<t.length)return t[e];throw new TypeError("Must be between 0 and 63: "+e)},n.decode=function(e){var n=65,t=90,r=97,i=122,o=48,s=57,a=43,u=47,c=26,l=52;return e>=n&&t>=e?e-n:e>=r&&i>=e?e-r+c:e>=o&&s>=e?e-o+l:e==a?62:e==u?63:-1}},function(e,n){function t(e,n,t){var r=e[n];e[n]=e[t],e[t]=r}function r(e,n){return Math.round(e+Math.random()*(n-e))}function i(e,n,o,s){if(s>o){var a=r(o,s),u=o-1;t(e,a,s);for(var c=e[s],l=o;s>l;l++)n(e[l],c)<=0&&(u+=1,t(e,u,l));t(e,u+1,l);var f=u+1;i(e,n,o,f-1),i(e,n,f+1,s)}}n.quickSort=function(e,n){i(e,n,0,e.length-1)}}]);!function(e,n){"use strict";"function"==typeof define&&define.amd?define("stacktrace-gps",["source-map","stackframe"],n):"object"==typeof exports?module.exports=n(require("source-map/lib/source-map-consumer"),require("stackframe")):e.StackTraceGPS=n(e.SourceMap,e.StackFrame)}(this,function(e,n){"use strict";function t(e){return new Promise(function(n,t){var r=new XMLHttpRequest;r.open("get",e),r.onerror=t,r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300?n(r.responseText):t(new Error("HTTP status: "+r.status+" retrieving "+e)))},r.send()})}function r(e,n,t){for(var r,i,o,s=/function\s+([^(]*?)\s*\(([^)]*)\)/,a=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,u=/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,c=e.split("\n"),l="",f=Math.min(n,20),p=0;f>p;++p)if(r=c[n-p-1],o=r.indexOf("//"),o>=0&&(r=r.substr(0,o)),r){if(l=r+l,i=a.exec(l),i&&i[1])return i[1];if(i=s.exec(l),i&&i[1])return i[1];if(i=u.exec(l),i&&i[1])return i[1]}return void 0}function i(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")}function o(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!==0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!==0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}function s(e){var n=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)$/.exec(e);if(n&&n[1])return n[1];throw new Error("sourceMappingURL not found")}function a(t,r,i,o,s){var a=new e.SourceMapConsumer(t),u=a.originalPositionFor({line:i,column:o}),c=a.sourceContentFor(u.source);return c&&(s[u.source]=c),new n(u.name,r,u.source,u.line,u.column)}return function u(e){return this instanceof u?(e=e||{},this.sourceCache=e.sourceCache||{},this.ajax=t,this._get=function(n){return new Promise(function(t,r){var i="data:"===n.substr(0,5);if(this.sourceCache[n])t(this.sourceCache[n]);else if(e.offline&&!i)r(new Error("Cannot make network requests in offline mode"));else if(i){var o="application/json;base64";if(n.substr(5,o.length)!==o)r(new Error("The encoding of the inline sourcemap is not supported"));else{var s="data:".length+o.length+",".length,a=n.substr(s),u=window.atob(a);this.sourceCache[n]=u,t(u)}}else{var c=this.ajax(n,{method:"get"});this.sourceCache[n]=c,c.then(t,r)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(n,t){this.getMappedLocation(e).then(function(e){function t(){n(e)}this.findFunctionName(e).then(n,t)["catch"](t)}.bind(this),t)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(t,i){o(e),this._get(e.fileName).then(function(i){var o=r(i,e.lineNumber,e.columnNumber);t(new n(o,e.args,e.fileName,e.lineNumber,e.columnNumber))},i)["catch"](i)}.bind(this))},void(this.getMappedLocation=function(e){return new Promise(function(n,t){i(),o(e);var r=this.sourceCache,u=e.fileName;this._get(u).then(function(i){var o=s(i),c="data:"===o.substr(0,5);"/"===o[0]||c||(o=u.substring(0,u.lastIndexOf("/")+1)+o),this._get(o).then(function(t){var i=e.lineNumber,o=e.columnNumber;n(a(t,e.args,i,o,r))},t)["catch"](t)}.bind(this),t)["catch"](t)}.bind(this))})):new u(e)}}),function(e,n){"use strict";"function"==typeof define&&define.amd?define("stack-generator",["stackframe"],n):"object"==typeof exports?module.exports=n(require("stackframe")):e.StackGenerator=n(e.StackFrame)}(this,function(e){return{backtrace:function(n){var t=[],r=10;"object"==typeof n&&"number"==typeof n.maxStackSize&&(r=n.maxStackSize);for(var i=arguments.callee;i&&t.length<r;){for(var o=new Array(i.arguments.length),s=0;s<o.length;++s)o[s]=i.arguments[s];/function(?:\s+([\w$]+))+\s*\(/.test(i.toString())?t.push(new e(RegExp.$1||void 0,o)):t.push(new e(void 0,o));try{i=i.caller}catch(a){break}}return t}}}),function(e,n){"use strict";"function"==typeof define&&define.amd?define("error-stack-parser",["stackframe"],n):"object"==typeof exports?module.exports=n(require("stackframe")):e.ErrorStackParser=n(e.StackFrame)}(this,function(e){"use strict";var n=/(^|@)\S+\:\d+/,t=/\s+at .*(\S+\:\d+|\(native\))/;return{parse:function(e){if("undefined"!=typeof e.stacktrace||"undefined"!=typeof e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(t))return this.parseV8OrIE(e);if(e.stack&&e.stack.match(n))return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var n=e.replace(/[\(\)\s]/g,"").split(":"),t=n.pop(),r=n[n.length-1];if(!isNaN(parseFloat(r))&&isFinite(r)){var i=n.pop();return[n.join(":"),i,t]}return[n.join(":"),t,void 0]},parseV8OrIE:function(n){return n.stack.split("\n").filter(function(e){return!!e.match(t)},this).map(function(n){var t=n.replace(/^\s+/,"").split(/\s+/).slice(1),r=this.extractLocation(t.pop()),i=t[0]&&"Anonymous"!==t[0]?t[0]:void 0;return new e(i,void 0,r[0],r[1],r[2],n)},this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter(function(e){return!!e.match(n)},this).map(function(n){var t=n.split("@"),r=this.extractLocation(t.pop()),i=t.shift()||void 0;return new e(i,void 0,r[0],r[1],r[2],n)},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(n){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=n.message.split("\n"),i=[],o=2,s=r.length;s>o;o+=2){var a=t.exec(r[o]);a&&i.push(new e(void 0,void 0,a[2],a[1],void 0,r[o]))}return i},parseOpera10:function(n){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=n.stacktrace.split("\n"),i=[],o=0,s=r.length;s>o;o+=2){var a=t.exec(r[o]);a&&i.push(new e(a[3]||void 0,void 0,a[2],a[1],void 0,r[o]))}return i},parseOpera11:function(t){return t.stack.split("\n").filter(function(e){return!!e.match(n)&&!e.match(/^Error created at/)},this).map(function(n){var t,r=n.split("@"),i=this.extractLocation(r.pop()),o=r.shift()||"",s=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(t=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=void 0===t||"[arguments not available]"===t?void 0:t.split(",");return new e(s,a,i[0],i[1],i[2],n)},this)}}}),function(e,n){"use strict";"function"==typeof define&&define.amd?define("stacktrace",["error-stack-parser","stack-generator","stacktrace-gps"],n):"object"==typeof exports?module.exports=n(require("error-stack-parser"),require("stack-generator"),require("stacktrace-gps")):e.StackTrace=n(e.ErrorStackParser,e.StackGenerator,e.StackTraceGPS)}(this,function(e,n,t){function r(e,n){var t={};return[e,n].forEach(function(e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}),t}function i(e){return e.stack||e["opera#sourceloc"]}var o={filter:function(e){return-1===(e.functionName||"").indexOf("StackTrace$$")&&-1===(e.functionName||"").indexOf("ErrorStackParser$$")&&-1===(e.functionName||"").indexOf("StackTraceGPS$$")&&-1===(e.functionName||"").indexOf("StackGenerator$$")}};return{get:function(e){try{throw new Error}catch(n){return i(n)?this.fromError(n,e):this.generateArtificially(e)}},fromError:function(n,i){return i=r(o,i),new Promise(function(r){var o=e.parse(n);"function"==typeof i.filter&&(o=o.filter(i.filter)),r(Promise.all(o.map(function(e){return new Promise(function(n){function r(t){n(e)}new t(i).pinpoint(e).then(n,r)["catch"](r)})})))}.bind(this))},generateArtificially:function(e){e=r(o,e);var t=n.backtrace(e);return"function"==typeof e.filter&&(t=t.filter(e.filter)),Promise.resolve(t)},instrument:function(e,n,t,r){if("function"!=typeof e)throw new Error("Cannot instrument non-function object");if("function"==typeof e.__stacktraceOriginalFn)return e;var o=function(){try{this.get().then(n,t)["catch"](t),e.apply(r||this,arguments)}catch(o){throw i(o)&&this.fromError(o).then(n,t)["catch"](t),o}}.bind(this);return o.__stacktraceOriginalFn=e,o},deinstrument:function(e){if("function"!=typeof e)throw new Error("Cannot de-instrument non-function object");return"function"==typeof e.__stacktraceOriginalFn?e.__stacktraceOriginalFn:e},report:function(e,n){return new Promise(function(t,r){var i=new XMLHttpRequest;i.onerror=r,i.onreadystatechange=function(){4===i.readyState&&(i.status>=200&&i.status<400?t(i.responseText):r(new Error("POST to "+n+" failed with status: "+i.status)))},i.open("post",n),i.setRequestHeader("Content-Type","application/json"),i.send(JSON.stringify({stack:e}))})}}});
//# sourceMappingURL=stacktrace.min.js.map