!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.StackTrace=e()}}(function(){var e;return function(){function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n||e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var n=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=n.match(/ (\((.+):(\d+):(\d+)\)$)/);n=r?n.replace(r[0],""):n;var o=n.split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:o.pop()),a=o.join(" ")||void 0,s=["eval",""].indexOf(i[0])>-1?void 0:i[0];return new e({functionName:a,fileName:s,lineNumber:i[1],columnNumber:i[2],source:t})},this)},parseFFOrSafari:function(t){var n=t.stack.split("\n").filter(function(e){return!e.match(r)},this);return n.map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.indexOf("@")===-1&&t.indexOf(":")===-1)return new e({functionName:t});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(n),o=r&&r[1]?r[1]:void 0,i=this.extractLocation(t.replace(n,""));return new e({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t})},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(t){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),o=[],i=2,a=r.length;i/,"$2").replace(/\([^)]*\)/g,"")||void 0;i.match(/\(([^)]*)\)/)&&(n=i.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new e({functionName:a,args:s,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:t})},this)}}})},{stackframe:2}],2:[function(t,n,r){!function(t,o){"use strict";"function"==typeof e&&e.amd?e("stackframe",[],o):"object"==typeof r?n.exports=o():t.StackFrame=o()}(this,function(){"use strict";function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function n(e){return function(){return this[e]}}function r(e){if(e)for(var n=0;n1)))/4)-T((e-1901+t)/100)+T((e-1601+t)/400)};if((g=v.hasOwnProperty)||(g=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=y?g=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,g=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,g.call(this,e)}),d=function(e,t){var n,r,o,i=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,r=new n;for(o in r)g.call(r,o)&&i++;return n=r=null,i?d=2==i?function(e,t){var n,r={},o=y.call(e)==b;for(n in e)o&&"prototype"==n||g.call(r,n)||!(r[n]=1)||!g.call(e,n)||t(n)}:function(e,t){var n,r,o=y.call(e)==b;for(n in e)o&&"prototype"==n||!g.call(e,n)||(r="constructor"===n)||t(n);(r||g.call(e,n="constructor"))&&t(n)}:(r=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],d=function(e,t){var n,o,i=y.call(e)==b,s=!i&&"function"!=typeof e.constructor&&a[typeof e.hasOwnProperty]&&e.hasOwnProperty||g;for(n in e)i&&"prototype"==n||!s.call(e,n)||t(n);for(o=r.length;n=r[--o];s.call(e,n)&&t(n));}),d(e,t)},!n("json-stringify")){var j={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},k="000000",x=function(e,t){return(k+(t||0)).slice(-e)},P="\\u00",R=function(e){for(var t='"',n=0,r=e.length,o=!N||r>10,i=o&&(N?e.split(""):e);n-1/0&&s<1/0){if(M){for(p=T(s/864e5),c=T(p/365.2425)+1970-1;M(c+1,0)<=p;c++);for(l=T((p-M(c,0))/30.42);M(c,l+1)<=p;l++);p=1+p-M(c,l),h=(s%864e5+864e5)%864e5,v=T(h/36e5)%24,_=T(h/6e4)%60,w=T(h/1e3)%60,b=h%1e3}else c=s.getUTCFullYear(),l=s.getUTCMonth(),p=s.getUTCDate(),v=s.getUTCHours(),_=s.getUTCMinutes(),w=s.getUTCSeconds(),b=s.getUTCMilliseconds();s=(c<=0||c>=1e4?(c<0?"-":"+")+x(6,c<0?-c:c):x(4,c))+"-"+x(2,l+1)+"-"+x(2,p)+"T"+x(2,v)+":"+x(2,_)+":"+x(2,w)+"."+x(3,b)+"Z"}else s=null;if(n&&(s=n.call(t,e,s)),null===s)return"null";if(u=y.call(s),u==E)return""+s;if(u==A)return s>-1/0&&s<1/0?""+s:"null";if(u==O)return R(""+s);if("object"==typeof s){for(k=a.length;k--;)if(a[k]===s)throw f();if(a.push(s),N=[],P=i,i+=o,u==S){for(j=0,k=s.length;j0)for(r="",n>10&&(n=10);r.length=48&&o<=57||o>=97&&o<=102||o>=65&&o<=70||B();e+=G("0x"+i.slice(t,U));break;default:B()}else{if(34==o)break;for(o=i.charCodeAt(U),t=U;o>=32&&92!=o&&34!=o;)o=i.charCodeAt(++U);e+=i.slice(t,U)}if(34==i.charCodeAt(U))return U++,e;B();default:if(t=U,45==o&&(r=!0,o=i.charCodeAt(++U)),o>=48&&o<=57){for(48==o&&(o=i.charCodeAt(U+1),o>=48&&o<=57)&&B(),r=!1;U=48&&o<=57);U++);if(46==i.charCodeAt(U)){for(n=++U;n=48&&o<=57);n++);n==U&&B(),U=n}if(o=i.charCodeAt(U),101==o||69==o){for(o=i.charCodeAt(++U),43!=o&&45!=o||U++,n=U;n=48&&o<=57);n++);n==U&&B(),U=n}return+i.slice(t,U)}if(r&&B(),"true"==i.slice(U,U+4))return U+=4,!0;if("false"==i.slice(U,U+5))return U+=5,!1;if("null"==i.slice(U,U+4))return U+=4,null;B()}return"$"},q=function(e){var t,n;if("$"==e&&B(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=J(),"]"!=e;n||(n=!0))n&&(","==e?(e=J(),"]"==e&&B()):B()),","==e&&B(),t.push(q(e));return t}if("{"==e){for(t={};e=J(),"}"!=e;n||(n=!0))n&&(","==e?(e=J(),"}"==e&&B()):B()),","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==J()||B(),t[e.slice(1)]=q(J());return t}B()}return e},I=function(e,t,n){var r=z(e,t,n);r===m?delete e[t]:e[t]=r},z=function(e,t,n){var r,o=e[t];if("object"==typeof o&&o)if(y.call(o)==S)for(r=o.length;r--;)I(o,r,n);else d(o,function(e){I(o,e,n)});return n.call(e,t,o)};t.parse=function(e,t){var n,r;return U=0,$=""+e,n=q(J()),"$"!=J()&&B(),U=$=null,t&&y.call(t)==b?z((r={},r[""]=n,r),"",t):n}}}return t.runInContext=o,t}var i="function"==typeof e&&e.amd,a={"function":!0,object:!0},s=a[typeof r]&&r&&!r.nodeType&&r,u=a[typeof window]&&window||this,c=s&&a[typeof n]&&n&&!n.nodeType&&"object"==typeof t&&t;if(!c||c.global!==c&&c.window!==c&&c.self!==c||(u=c),s&&!i)o(u,s);else{var l=u.JSON,f=u.JSON3,p=!1,h=o(u,u.JSON3={noConflict:function(){return p||(p=!0,u.JSON=l,u.JSON3=f,l=f=null),h}});u.JSON={parse:h.parse,stringify:h.stringify}}i&&e(function(){return h})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(f===setTimeout)return setTimeout(e,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function a(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function s(){m&&g&&(m=!1,g.length?d=g.concat(d):v=-1,d.length&&u())}function u(){if(!m){var e=i(s);m=!0;for(var t=d.length;t;){for(g=d,d=[];++v1)for(var n=1;n=0&&e>1;return t?-n:n}var i=e("./base64"),a=5,s=1<>>=a,o>0&&(t|=c),n+=i.encode(t);while(o>0);return n},n.decode=function(e,t,n){var r,s,l=e.length,f=0,p=0;do{if(t>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(s=i.decode(e.charCodeAt(t++)),s===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(s&c),s&=u,f+=s<0?t-u>1?r(u,t,o,i,a,s):s==n.LEAST_UPPER_BOUND?t1?r(e,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var a=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===o(t[a],t[a-1],!0);)--a;return a}},{}],10:[function(e,t,n){function r(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function o(e,t){return Math.round(e+Math.random()*(t-e))}function i(e,t,n,a){if(n=0){var i=this._originalMappings[o];if(void 0===e.column)for(var a=i.originalLine;i&&i.originalLine===a;)r.push({line:s.getArg(i,"generatedLine",null),column:s.getArg(i,"generatedColumn",null),lastColumn:s.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var c=i.originalColumn;i&&i.originalLine===t&&i.originalColumn==c;)r.push({line:s.getArg(i,"generatedLine",null),column:s.getArg(i,"generatedColumn",null),lastColumn:s.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return r},n.SourceMapConsumer=r,o.prototype=Object.create(r.prototype),o.prototype.consumer=r,o.fromSourceMap=function(e){var t=Object.create(o.prototype),n=t._names=c.fromArray(e._names.toArray(),!0),r=t._sources=c.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),u=t.__generatedMappings=[],l=t.__originalMappings=[],p=0,h=a.length;p1&&(n.source=d+o[1],d+=o[1],n.originalLine=h+o[2],h=n.originalLine,n.originalLine+=1,n.originalColumn=g+o[3],g=n.originalColumn,o.length>4&&(n.name=m+o[4],m+=o[4])),C.push(n),"number"==typeof n.originalLine&&b.push(n)}f(C,s.compareByGeneratedPositionsDeflated),this.__generatedMappings=C,f(b,s.compareByOriginalPositions),this.__originalMappings=b},o.prototype._findMapping=function(e,t,n,r,o,i){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return u.search(e,t,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=s.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=s.join(this.sourceRoot,i)));var a=s.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:i,line:s.getArg(o,"originalLine",null),column:s.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null; if(null!=this.sourceRoot&&(e=s.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=s.urlParse(this.sourceRoot))){var r=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!n.path||"/"==n.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var t=s.getArg(e,"source");if(null!=this.sourceRoot&&(t=s.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var n={source:t,originalLine:s.getArg(e,"line"),originalColumn:s.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:s.getArg(i,"generatedLine",null),column:s.getArg(i,"generatedColumn",null),lastColumn:s.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,a.prototype=Object.create(r.prototype),a.prototype.constructor=r,a.prototype._version=3,Object.defineProperty(a.prototype,"sources",{get:function(){for(var e=[],t=0;t=0;l--)a=u[l],"."===a?u.splice(l,1):".."===a?c++:c>0&&(""===a?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return t=u.join("/"),""===t&&(t=s?"/":"."),r?(r.path=t,i(r)):t}function s(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),r=o(e);if(r&&(e=r.path||"/"),n&&!n.scheme)return r&&(n.scheme=r.scheme),i(n);if(n||t.match(y))return t;if(r&&!r.host&&!r.path)return r.host=t,i(r);var s="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return r?(r.path=s,i(r)):s}function u(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}function c(e){return e}function l(e){return p(e)?"$"+e:e}function f(e){return p(e)?e.slice(1):e}function p(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function h(e,t,n){var r=e.source-t.source;return 0!==r?r:(r=e.originalLine-t.originalLine,0!==r?r:(r=e.originalColumn-t.originalColumn,0!==r||n?r:(r=e.generatedColumn-t.generatedColumn,0!==r?r:(r=e.generatedLine-t.generatedLine,0!==r?r:e.name-t.name))))}function g(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:(r=e.generatedColumn-t.generatedColumn,0!==r||n?r:(r=e.source-t.source,0!==r?r:(r=e.originalLine-t.originalLine,0!==r?r:(r=e.originalColumn-t.originalColumn,0!==r?r:e.name-t.name))))}function d(e,t){return e===t?0:e>t?1:-1}function m(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:(n=e.generatedColumn-t.generatedColumn,0!==n?n:(n=d(e.source,t.source),0!==n?n:(n=e.originalLine-t.originalLine,0!==n?n:(n=e.originalColumn-t.originalColumn,0!==n?n:d(e.name,t.name)))))}n.getArg=r;var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,y=/^data:.+\,.+$/;n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(v)},n.relative=u;var _=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=_?c:l,n.fromSetString=_?c:f,n.compareByOriginalPositions=h,n.compareByGeneratedPositionsDeflated=g,n.compareByGeneratedPositionsInflated=m},{}],13:[function(e,t,n){arguments[4][2][0].apply(n,arguments)},{dup:2}],14:[function(t,n,r){!function(o,i){"use strict";"function"==typeof e&&e.amd?e("stack-generator",["stackframe"],i):"object"==typeof r?n.exports=i(t("stackframe")):o.StackGenerator=i(o.StackFrame)}(this,function(e){return{backtrace:function(t){var n=[],r=10;"object"==typeof t&&"number"==typeof t.maxStackSize&&(r=t.maxStackSize);for(var o=arguments.callee;o&&n.length=200&&r.status<300||"file://"===e.substr(0,7)&&r.responseText?t(r.responseText):n(new Error("HTTP status: "+r.status+" retrieving "+e)))},r.send()})}function r(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 o(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")}function i(e,t){for(var n=[/['"]?([$_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(t,20),a=0;a=0&&(s=s.substr(0,u)),s){o=s+o;for(var c=n.length,l=0;l>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");arguments.length>1&&(n=t);for(var i=new Array(o),a=0;a>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(var r=[],o=arguments.length>=2?arguments[1]:void 0,i=0;i>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(n=t),r=0;r=200&&a.status<400?o(a.responseText):i(new Error("POST to "+t+" failed with status: "+a.status)))},a.open("post",t),a.setRequestHeader("Content-Type","application/json"),r&&"object"==typeof r.headers){var s=r.headers;for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&a.setRequestHeader(u,s[u])}var c={stack:e};void 0!==n&&null!==n&&(c.message=n),a.send(JSON.stringify(c))})}}})},{"error-stack-parser":1,"stack-generator":14,"stacktrace-gps":16}]},{},[3,4,17,18])(18)}); //# sourceMappingURL=stacktrace-with-promises-and-json-polyfills.min.js.map