Mid-Simulator/node_modules/stacktrace-gps/dist/stacktrace-gps-with-polyfills.min.js
2022-04-18 01:14:39 +00:00

2 lines
No EOL
30 KiB
JavaScript

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.ES6Promise=n()}(this,function(){"use strict";function c(e){return"function"==typeof e}var t=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,n=void 0,o=void 0,a=function(e,n){p[r]=e,p[r+1]=n,2===(r+=2)&&(o?o(g):v())};var e="undefined"!=typeof window?window:void 0,i=e||{},s=i.MutationObserver||i.WebKitMutationObserver,u="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),l="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function f(){var e=setTimeout;return function(){return e(g,1)}}var p=new Array(1e3);function g(){for(var e=0;e<r;e+=2){(0,p[e])(p[e+1]),p[e]=void 0,p[e+1]=void 0}r=0}var h,m,d,_,v=void 0;function y(e,n){var t=arguments,r=this,o=new this.constructor(C);void 0===o[w]&&k(o);var i,s=r._state;return s?(i=t[s-1],a(function(){return D(s,o,i,r._result)})):x(r,o,e,n),o}function b(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var n=new this(C);return P(n,e),n}v=u?function(){return process.nextTick(g)}:s?(m=0,d=new s(g),_=document.createTextNode(""),d.observe(_,{characterData:!0}),function(){_.data=m=++m%2}):l?((h=new MessageChannel).port1.onmessage=g,function(){return h.port2.postMessage(0)}):(void 0===e&&"function"==typeof require?function(){try{var e=require("vertx");return n=e.runOnLoop||e.runOnContext,function(){n(g)}}catch(e){return f()}}:f)();var w=Math.random().toString(36).substring(16);function C(){}var A=void 0,O=1,E=2,M=new G;function S(e){try{return e.then}catch(e){return M.error=e,M}}function L(e,r,o){a(function(n){var t=!1,e=function(e,n,t,r){try{e.call(n,t,r)}catch(e){return e}}(o,r,function(e){t||(t=!0,(r!==e?P:j)(n,e))},function(e){t||(t=!0,T(n,e))},n._label);!t&&e&&(t=!0,T(n,e))},e)}function N(e,n,t){var r,o;n.constructor===e.constructor&&t===y&&n.constructor.resolve===b?(r=e,(o=n)._state===O?j(r,o._result):o._state===E?T(r,o._result):x(o,void 0,function(e){return P(r,e)},function(e){return T(r,e)})):t===M?T(e,M.error):void 0===t?j(e,n):c(t)?L(e,n,t):j(e,n)}function P(e,n){var t;e===n?T(e,new TypeError("You cannot resolve a promise with itself")):"function"==typeof(t=n)||"object"==typeof t&&null!==t?N(e,n,S(n)):j(e,n)}function R(e){e._onerror&&e._onerror(e._result),F(e)}function j(e,n){e._state===A&&(e._result=n,e._state=O,0!==e._subscribers.length&&a(F,e))}function T(e,n){e._state===A&&(e._state=E,e._result=n,a(R,e))}function x(e,n,t,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=n,o[i+O]=t,o[i+E]=r,0===i&&e._state&&a(F,e)}function F(e){var n=e._subscribers,t=e._state;if(0!==n.length){for(var r=void 0,o=void 0,i=e._result,s=0;s<n.length;s+=3)r=n[s],o=n[s+t],r?D(t,r,o,i):o(i);e._subscribers.length=0}}function G(){this.error=null}var B=new G;function D(e,n,t,r){var o=c(t),i=void 0,s=void 0,a=void 0,u=void 0;if(o){if((i=function(e,n){try{return e(n)}catch(e){return B.error=e,B}}(t,r))===B?(u=!0,s=i.error,i=null):a=!0,n===i)return void T(n,new TypeError("A promises callback cannot return that same promise."))}else i=r,a=!0;n._state!==A||(o&&a?P(n,i):u?T(n,s):e===O?j(n,i):e===E&&T(n,i))}var U=0;function k(e){e[w]=U++,e._state=void 0,e._result=void 0,e._subscribers=[]}function I(e,n){this._instanceConstructor=e,this.promise=new e(C),this.promise[w]||k(this.promise),t(n)?(this._input=n,this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&j(this.promise,this._result))):T(this.promise,new Error("Array Methods must be provided an Array"))}function $(e){this[w]=U++,this._result=this._state=void 0,this._subscribers=[],C!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof $?function(n,e){try{e(function(e){P(n,e)},function(e){T(n,e)})}catch(e){T(n,e)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}function q(){var e=void 0;if("undefined"!=typeof global)e=global;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=e.Promise;if(n){var t=null;try{t=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===t&&!n.cast)return}e.Promise=$}return I.prototype._enumerate=function(){for(var e=this.length,n=this._input,t=0;this._state===A&&t<e;t++)this._eachEntry(n[t],t)},I.prototype._eachEntry=function(n,e){var t=this._instanceConstructor,r=t.resolve;if(r===b){var o=S(n);if(o===y&&n._state!==A)this._settledAt(n._state,e,n._result);else if("function"!=typeof o)this._remaining--,this._result[e]=n;else if(t===$){var i=new t(C);N(i,n,o),this._willSettleAt(i,e)}else this._willSettleAt(new t(function(e){return e(n)}),e)}else this._willSettleAt(r(n),e)},I.prototype._settledAt=function(e,n,t){var r=this.promise;r._state===A&&(this._remaining--,e===E?T(r,t):this._result[n]=t),0===this._remaining&&j(r,this._result)},I.prototype._willSettleAt=function(e,n){var t=this;x(e,void 0,function(e){return t._settledAt(O,n,e)},function(e){return t._settledAt(E,n,e)})},$.all=function(e){return new I(this,e).promise},$.race=function(o){var i=this;return t(o)?new i(function(e,n){for(var t=o.length,r=0;r<t;r++)i.resolve(o[r]).then(e,n)}):new i(function(e,n){return n(new TypeError("You must pass an array to race."))})},$.resolve=b,$.reject=function(e){var n=new this(C);return T(n,e),n},$._setScheduler=function(e){o=e},$._setAsap=function(e){a=e},$._asap=a,$.prototype={constructor:$,then:y,catch:function(e){return this.then(null,e)}},q(),$.polyfill=q,$.Promise=$}),"undefined"==typeof Promise&&ES6Promise.polyfill(),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 t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function e(e){return function(){return this[e]}}var n=["isConstructor","isEval","isNative","isToplevel"],r=["columnNumber","lineNumber"],o=["fileName","functionName","source"],i=n.concat(r,o,["args"]);function l(e){if(e)for(var n=0;n<i.length;n++)void 0!==e[i[n]]&&this["set"+t(i[n])](e[i[n]])}l.prototype={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},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof l)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new l(e)}},toString:function(){var e=this.getFileName()||"",n=this.getLineNumber()||"",t=this.getColumnNumber()||"",r=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+n+":"+t+")":"[eval]:"+n+":"+t:r?r+" ("+e+":"+n+":"+t+")":e+":"+n+":"+t}},l.fromString=function(e){var n=e.indexOf("("),t=e.lastIndexOf(")"),r=e.substring(0,n),o=e.substring(n+1,t).split(","),i=e.substring(t+1);if(0===i.indexOf("@"))var s=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(i,""),a=s[1],u=s[2],c=s[3];return new l({functionName:r,args:o||void 0,fileName:a,lineNumber:u||void 0,columnNumber:c||void 0})};for(var s=0;s<n.length;s++)l.prototype["get"+t(n[s])]=e(n[s]),l.prototype["set"+t(n[s])]=function(n){return function(e){this[n]=Boolean(e)}}(n[s]);for(var a=0;a<r.length;a++)l.prototype["get"+t(r[a])]=e(r[a]),l.prototype["set"+t(r[a])]=function(t){return function(e){if(n=e,isNaN(parseFloat(n))||!isFinite(n))throw new TypeError(t+" must be a Number");var n;this[t]=Number(e)}}(r[a]);for(var u=0;u<o.length;u++)l.prototype["get"+t(o[u])]=e(o[u]),l.prototype["set"+t(o[u])]=function(n){return function(e){this[n]=String(e)}}(o[u]);return l});var SourceMap=function(t){var r={};function o(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=r,o.d=function(e,n,t){o.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(n,e){if(1&e&&(n=o(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var r in n)o.d(t,r,function(e){return n[e]}.bind(null,r));return t},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="",o(o.s=1)}([function(e,u){u.getArg=function(e,n,t){if(n in e)return e[n];if(3===arguments.length)return t;throw new Error('"'+n+'" is a required argument.')};var t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,i=/^data:.+\,.+$/;function c(e){var n=e.match(t);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function l(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 s(e){var n=e,t=c(e);if(t){if(!t.path)return e;n=t.path}for(var r,o=u.isAbsolute(n),i=n.split(/\/+/),s=0,a=i.length-1;0<=a;a--)"."===(r=i[a])?i.splice(a,1):".."===r?s++:0<s&&(""===r?(i.splice(a+1,s),s=0):(i.splice(a,2),s--));return""===(n=i.join("/"))&&(n=o?"/":"."),t?(t.path=n,l(t)):n}u.urlParse=c,u.urlGenerate=l,u.normalize=s,u.join=function(e,n){""===e&&(e="."),""===n&&(n=".");var t=c(n),r=c(e);if(r&&(e=r.path||"/"),t&&!t.scheme)return r&&(t.scheme=r.scheme),l(t);if(t||n.match(i))return n;if(r&&!r.host&&!r.path)return r.host=n,l(r);var o="/"===n.charAt(0)?n:s(e.replace(/\/+$/,"")+"/"+n);return r?(r.path=o,l(r)):o},u.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(t)},u.relative=function(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var t=0;0!==n.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return n;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return n;++t}return Array(t+1).join("../")+n.substr(e.length+1)};var n=!("__proto__"in Object.create(null));function r(e){return e}function o(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var t=n-10;0<=t;t--)if(36!==e.charCodeAt(t))return!1;return!0}function a(e,n){return e===n?0:n<e?1:-1}u.toSetString=n?r:function(e){return o(e)?"$"+e:e},u.fromSetString=n?r:function(e){return o(e)?e.slice(1):e},u.compareByOriginalPositions=function(e,n,t){var r=e.source-n.source;return 0!==r||0!=(r=e.originalLine-n.originalLine)||0!=(r=e.originalColumn-n.originalColumn)||t||0!=(r=e.generatedColumn-n.generatedColumn)||0!=(r=e.generatedLine-n.generatedLine)?r:e.name-n.name},u.compareByGeneratedPositionsDeflated=function(e,n,t){var r=e.generatedLine-n.generatedLine;return 0!==r||0!=(r=e.generatedColumn-n.generatedColumn)||t||0!=(r=e.source-n.source)||0!=(r=e.originalLine-n.originalLine)||0!=(r=e.originalColumn-n.originalColumn)?r:e.name-n.name},u.compareByGeneratedPositionsInflated=function(e,n){var t=e.generatedLine-n.generatedLine;return 0!==t||0!=(t=e.generatedColumn-n.generatedColumn)||0!==(t=a(e.source,n.source))||0!=(t=e.originalLine-n.originalLine)||0!=(t=e.originalColumn-n.originalColumn)?t:a(e.name,n.name)}},function(e,n,t){var y=t(0),u=t(2),f=t(3).ArraySet,b=t(4),w=t(6).quickSort;function s(e){var n=e;return"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,""))),new(null!=n.sections?r:p)(n)}function p(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var t=y.getArg(n,"version"),r=y.getArg(n,"sources"),o=y.getArg(n,"names",[]),i=y.getArg(n,"sourceRoot",null),s=y.getArg(n,"sourcesContent",null),a=y.getArg(n,"mappings"),u=y.getArg(n,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);r=r.map(String).map(y.normalize).map(function(e){return i&&y.isAbsolute(i)&&y.isAbsolute(e)?y.relative(i,e):e}),this._names=f.fromArray(o.map(String),!0),this._sources=f.fromArray(r,!0),this.sourceRoot=i,this.sourcesContent=s,this._mappings=a,this.file=u}function C(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function r(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var t=y.getArg(n,"version"),r=y.getArg(n,"sections");if(t!=this._version)throw new Error("Unsupported version: "+t);this._sources=new f,this._names=new f;var o={line:-1,column:0};this._sections=r.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=y.getArg(e,"offset"),t=y.getArg(n,"line"),r=y.getArg(n,"column");if(t<o.line||t===o.line&&r<o.column)throw new Error("Section offsets must be ordered and non-overlapping.");return o=n,{generatedOffset:{generatedLine:t+1,generatedColumn:r+1},consumer:new s(y.getArg(e,"map"))}})}s.fromSourceMap=function(e){return p.fromSourceMap(e)},s.prototype._version=3,s.prototype.__generatedMappings=null,Object.defineProperty(s.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),s.prototype.__originalMappings=null,Object.defineProperty(s.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),s.prototype._charIsMappingSeparator=function(e,n){var t=e.charAt(n);return";"===t||","===t},s.prototype._parseMappings=function(e,n){throw new Error("Subclasses must implement _parseMappings")},s.GENERATED_ORDER=1,s.ORIGINAL_ORDER=2,s.GREATEST_LOWER_BOUND=1,s.LEAST_UPPER_BOUND=2,s.prototype.eachMapping=function(e,n,t){var r,o=n||null;switch(t||s.GENERATED_ORDER){case s.GENERATED_ORDER:r=this._generatedMappings;break;case s.ORIGINAL_ORDER:r=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var i=this.sourceRoot;r.map(function(e){var n=null===e.source?null:this._sources.at(e.source);return null!=n&&null!=i&&(n=y.join(i,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)},s.prototype.allGeneratedPositionsFor=function(e){var n=y.getArg(e,"line"),t={source:y.getArg(e,"source"),originalLine:n,originalColumn:y.getArg(e,"column",0)};if(null!=this.sourceRoot&&(t.source=y.relative(this.sourceRoot,t.source)),!this._sources.has(t.source))return[];t.source=this._sources.indexOf(t.source);var r=[],o=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",y.compareByOriginalPositions,u.LEAST_UPPER_BOUND);if(0<=o){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)r.push({line:y.getArg(i,"generatedLine",null),column:y.getArg(i,"generatedColumn",null),lastColumn:y.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var a=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==a;)r.push({line:y.getArg(i,"generatedLine",null),column:y.getArg(i,"generatedColumn",null),lastColumn:y.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return r},n.SourceMapConsumer=s,(p.prototype=Object.create(s.prototype)).consumer=s,p.fromSourceMap=function(e){var n=Object.create(p.prototype),t=n._names=f.fromArray(e._names.toArray(),!0),r=n._sources=f.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var o=e._mappings.toArray().slice(),i=n.__generatedMappings=[],s=n.__originalMappings=[],a=0,u=o.length;a<u;a++){var c=o[a],l=new C;l.generatedLine=c.generatedLine,l.generatedColumn=c.generatedColumn,c.source&&(l.source=r.indexOf(c.source),l.originalLine=c.originalLine,l.originalColumn=c.originalColumn,c.name&&(l.name=t.indexOf(c.name)),s.push(l)),i.push(l)}return w(n.__originalMappings,y.compareByOriginalPositions),n},p.prototype._version=3,Object.defineProperty(p.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?y.join(this.sourceRoot,e):e},this)}}),p.prototype._parseMappings=function(e,n){for(var t,r,o,i,s,a=1,u=0,c=0,l=0,f=0,p=0,g=e.length,h=0,m={},d={},_=[],v=[];h<g;)if(";"===e.charAt(h))a++,h++,u=0;else if(","===e.charAt(h))h++;else{for((t=new C).generatedLine=a,i=h;i<g&&!this._charIsMappingSeparator(e,i);i++);if(o=m[r=e.slice(h,i)])h+=r.length;else{for(o=[];h<i;)b.decode(e,h,d),s=d.value,h=d.rest,o.push(s);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");m[r]=o}t.generatedColumn=u+o[0],u=t.generatedColumn,1<o.length&&(t.source=f+o[1],f+=o[1],t.originalLine=c+o[2],c=t.originalLine,t.originalLine+=1,t.originalColumn=l+o[3],l=t.originalColumn,4<o.length&&(t.name=p+o[4],p+=o[4])),v.push(t),"number"==typeof t.originalLine&&_.push(t)}w(v,y.compareByGeneratedPositionsDeflated),this.__generatedMappings=v,w(_,y.compareByOriginalPositions),this.__originalMappings=_},p.prototype._findMapping=function(e,n,t,r,o,i){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,o,i)},p.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}},p.prototype.originalPositionFor=function(e){var n={generatedLine:y.getArg(e,"line"),generatedColumn:y.getArg(e,"column")},t=this._findMapping(n,this._generatedMappings,"generatedLine","generatedColumn",y.compareByGeneratedPositionsDeflated,y.getArg(e,"bias",s.GREATEST_LOWER_BOUND));if(0<=t){var r=this._generatedMappings[t];if(r.generatedLine===n.generatedLine){var o=y.getArg(r,"source",null);null!==o&&(o=this._sources.at(o),null!=this.sourceRoot&&(o=y.join(this.sourceRoot,o)));var i=y.getArg(r,"name",null);return null!==i&&(i=this._names.at(i)),{source:o,line:y.getArg(r,"originalLine",null),column:y.getArg(r,"originalColumn",null),name:i}}}return{source:null,line:null,column:null,name:null}},p.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e})},p.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=y.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var t;if(null!=this.sourceRoot&&(t=y.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.')},p.prototype.generatedPositionFor=function(e){var n=y.getArg(e,"source");if(null!=this.sourceRoot&&(n=y.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};var t={source:n=this._sources.indexOf(n),originalLine:y.getArg(e,"line"),originalColumn:y.getArg(e,"column")},r=this._findMapping(t,this._originalMappings,"originalLine","originalColumn",y.compareByOriginalPositions,y.getArg(e,"bias",s.GREATEST_LOWER_BOUND));if(0<=r){var o=this._originalMappings[r];if(o.source===t.source)return{line:y.getArg(o,"generatedLine",null),column:y.getArg(o,"generatedColumn",null),lastColumn:y.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=p,(r.prototype=Object.create(s.prototype)).constructor=s,r.prototype._version=3,Object.defineProperty(r.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}}),r.prototype.originalPositionFor=function(e){var n={generatedLine:y.getArg(e,"line"),generatedColumn:y.getArg(e,"column")},t=u.search(n,this._sections,function(e,n){return e.generatedLine-n.generatedOffset.generatedLine||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}},r.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},r.prototype.sourceContentFor=function(e,n){for(var t=0;t<this._sections.length;t++){var r=this._sections[t].consumer.sourceContentFor(e,!0);if(r)return r}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},r.prototype.generatedPositionFor=function(e){for(var n=0;n<this._sections.length;n++){var t=this._sections[n];if(-1!==t.consumer.sources.indexOf(y.getArg(e,"source"))){var r=t.consumer.generatedPositionFor(e);if(r)return{line:r.line+(t.generatedOffset.generatedLine-1),column:r.column+(t.generatedOffset.generatedLine===r.line?t.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},r.prototype._parseMappings=function(e,n){this.__generatedMappings=[],this.__originalMappings=[];for(var t=0;t<this._sections.length;t++)for(var r=this._sections[t],o=r.consumer._generatedMappings,i=0;i<o.length;i++){var s=o[i],a=r.consumer._sources.at(s.source);null!==r.consumer.sourceRoot&&(a=y.join(r.consumer.sourceRoot,a)),this._sources.add(a),a=this._sources.indexOf(a);var u=r.consumer._names.at(s.name);this._names.add(u),u=this._names.indexOf(u);var c={source:a,generatedLine:s.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(r.generatedOffset.generatedLine===s.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:u};this.__generatedMappings.push(c),"number"==typeof c.originalLine&&this.__originalMappings.push(c)}w(this.__generatedMappings,y.compareByGeneratedPositionsDeflated),w(this.__originalMappings,y.compareByOriginalPositions)},n.IndexedSourceMapConsumer=r},function(e,c){c.GREATEST_LOWER_BOUND=1,c.LEAST_UPPER_BOUND=2,c.search=function(e,n,t,r){if(0===n.length)return-1;var o=function e(n,t,r,o,i,s){var a=Math.floor((t-n)/2)+n,u=i(r,o[a],!0);return 0===u?a:0<u?1<t-a?e(a,t,r,o,i,s):s==c.LEAST_UPPER_BOUND?t<o.length?t:-1:a:1<a-n?e(n,a,r,o,i,s):s==c.LEAST_UPPER_BOUND?a:n<0?-1:n}(-1,n.length,e,n,t,r||c.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;0<=o-1&&0===t(n[o],n[o-1],!0);)--o;return o}},function(e,n,t){var i=t(0),s=Object.prototype.hasOwnProperty;function a(){this._array=[],this._set=Object.create(null)}a.fromArray=function(e,n){for(var t=new a,r=0,o=e.length;r<o;r++)t.add(e[r],n);return t},a.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},a.prototype.add=function(e,n){var t=i.toSetString(e),r=s.call(this._set,t),o=this._array.length;r&&!n||this._array.push(e),r||(this._set[t]=o)},a.prototype.has=function(e){var n=i.toSetString(e);return s.call(this._set,n)},a.prototype.indexOf=function(e){var n=i.toSetString(e);if(s.call(this._set,n))return this._set[n];throw new Error('"'+e+'" is not in the set.')},a.prototype.at=function(e){if(0<=e&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},a.prototype.toArray=function(){return this._array.slice()},n.ArraySet=a},function(e,n,t){var c=t(5);n.encode=function(e){for(var n,t="",r=e<0?1+(-e<<1):0+(e<<1);n=31&r,0<(r>>>=5)&&(n|=32),t+=c.encode(n),0<r;);return t},n.decode=function(e,n,t){var r,o,i,s=e.length,a=0,u=0;do{if(s<=n)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(o=c.decode(e.charCodeAt(n++))))throw new Error("Invalid base64 digit: "+e.charAt(n-1));r=!!(32&o),a+=(o&=31)<<u,u+=5}while(r);t.value=(i=a>>1,1==(1&a)?-i:i),t.rest=n}},function(e,n){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(e){if(0<=e&&e<t.length)return t[e];throw new TypeError("Must be between 0 and 63: "+e)},n.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},function(e,n){function f(e,n,t){var r=e[n];e[n]=e[t],e[t]=r}n.quickSort=function(e,n){!function e(n,t,r,o){if(r<o){var i=r-1;f(n,(c=r,l=o,Math.round(c+Math.random()*(l-c))),o);for(var s=n[o],a=r;a<o;a++)t(n[a],s)<=0&&f(n,i+=1,a);f(n,i+1,a);var u=i+1;e(n,t,r,u-1),e(n,t,u+1,o)}var c,l}(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.sourceMap,e.StackFrame)}(this,function(o,l){"use strict";function n(r){return new Promise(function(e,n){var t=new XMLHttpRequest;t.open("get",r),t.onerror=n,t.onreadystatechange=function(){4===t.readyState&&(200<=t.status&&t.status<300||"file://"===r.substr(0,7)&&t.responseText?e(t.responseText):n(new Error("HTTP status: "+t.status+" retrieving "+r)))},t.send()})}function t(e){if("undefined"!=typeof window&&window.atob)return window.atob(e);throw new Error("You must supply a polyfill for window.atob in this environment")}function r(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}return function e(c){if(!(this instanceof e))return new e(c);c=c||{},this.sourceCache=c.sourceCache||{},this.sourceMapConsumerCache=c.sourceMapConsumerCache||{},this.ajax=c.ajax||n,this._atob=c.atob||t,this._get=function(u){return new Promise(function(e,n){var t="data:"===u.substr(0,5);if(this.sourceCache[u])e(this.sourceCache[u]);else if(c.offline&&!t)n(new Error("Cannot make network requests in offline mode"));else if(t){var r=u.match(/^data:application\/json;([\w=:"-]+;)*base64,/);if(r){var o=r[0].length,i=u.substr(o),s=this._atob(i);e(this.sourceCache[u]=s)}else n(new Error("The encoding of the inline sourcemap is not supported"))}else{var a=this.ajax(u,{method:"get"});(this.sourceCache[u]=a).then(e,n)}}.bind(this))},this._getSourceMapConsumer=function(t,r){return new Promise(function(e){if(this.sourceMapConsumerCache[t])e(this.sourceMapConsumerCache[t]);else{var n=new Promise(function(n,e){return this._get(t).then(function(e){"string"==typeof e&&(e=function(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}(e.replace(/^\)\]\}'/,""))),void 0===e.sourceRoot&&(e.sourceRoot=r),n(new o.SourceMapConsumer(e))},e)}.bind(this));e(this.sourceMapConsumerCache[t]=n)}}.bind(this))},this.pinpoint=function(n){return new Promise(function(t,e){this.getMappedLocation(n).then(function(e){function n(){t(e)}this.findFunctionName(e).then(t,n).catch(n)}.bind(this),e)}.bind(this))},this.findFunctionName=function(i){return new Promise(function(o,e){r(i),this._get(i.fileName).then(function(e){var n=i.lineNumber,t=i.columnNumber,r=function(e,n){for(var t=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],r=e.split("\n"),o="",i=Math.min(n,20),s=0;s<i;++s){var a=r[n-s-1],u=a.indexOf("//");if(0<=u&&(a=a.substr(0,u)),a){o=a+o;for(var c=t.length,l=0;l<c;l++){var f=t[l].exec(o);if(f&&f[1])return f[1]}}}}(e,n);o(r?new l({functionName:r,args:i.args,fileName:i.fileName,lineNumber:n,columnNumber:t}):i)},e).catch(e)}.bind(this))},this.getMappedLocation=function(c){return new Promise(function(a,e){!function(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")}(),r(c);var u=this.sourceCache,o=c.fileName;this._get(o).then(function(e){var n=function(e){for(var n,t,r=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;t=r.exec(e);)n=t[1];if(n)return n;throw new Error("sourceMappingURL not found")}(e),t="data:"===n.substr(0,5),r=o.substring(0,o.lastIndexOf("/")+1);return"/"===n[0]||t||/^https?:\/\/|^\/\//i.test(n)||(n=r+n),this._getSourceMapConsumer(n,r).then(function(e){return(o=c,i=e,s=u,new Promise(function(e,n){var t=i.originalPositionFor({line:o.lineNumber,column:o.columnNumber});if(t.source){var r=i.sourceContentFor(t.source);r&&(s[t.source]=r),e(new l({functionName:t.name||o.functionName,args:o.args,fileName:t.source,lineNumber:t.line,columnNumber:t.column}))}else n(new Error("Could not get original source for given stackframe and source map"))})).then(a).catch(function(){a(c)});var o,i,s})}.bind(this),e).catch(e)}.bind(this))}}});
//# sourceMappingURL=stacktrace-gps-polyfilled.min.js.map