@gibraltarsoftware/loupe-typescript
Version:
Loupe Agent for Web clients
1 lines • 54.2 kB
JavaScript
(()=>{var e={180:function(e,t,n){var r,o,i;!function(s,a){"use strict";o=[n(829)],void 0===(i="function"==typeof(r=function(e){var t=/(^|@)\S+:\d+/,n=/^\s*at .*(\S+:\d+|\(native\))/m,r=/^(eval@)?(\[native code])?$/;return{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(n))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(e){return!!e.match(n)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var n=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=n.match(/ (\(.+\)$)/);n=r?n.replace(r[0],""):n;var o=this.extractLocation(r?r[1]:n),i=r&&n||void 0,s=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new e({functionName:i,fileName:s,lineNumber:o[1],columnNumber:o[2],source:t})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(e){return!e.match(r)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))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,s=r.length;i<s;i+=2){var a=n.exec(r[i]);a&&o.push(new e({fileName:a[2],lineNumber:a[1],source:r[i]}))}return o},parseOpera10:function(t){for(var n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),o=[],i=0,s=r.length;i<s;i+=2){var a=n.exec(r[i]);a&&o.push(new e({functionName:a[3]||void 0,fileName:a[2],lineNumber:a[1],source:r[i]}))}return o},parseOpera11:function(n){return n.stack.split("\n").filter((function(e){return!!e.match(t)&&!e.match(/^Error created at/)}),this).map((function(t){var n,r=t.split("@"),o=this.extractLocation(r.pop()),i=r.shift()||"",s=i.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;i.match(/\(([^)]*)\)/)&&(n=i.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var a=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new e({functionName:s,args:a,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:t})}),this)}}})?r.apply(t,o):r)||(e.exports=i)}()},595:function(e,t,n){var r,o,i;!function(s,a){"use strict";o=[n(829)],r=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<r&&o.arguments;){for(var i=new Array(o.arguments.length),s=0;s<i.length;++s)i[s]=o.arguments[s];/function(?:\s+([\w$]+))+\s*\(/.test(o.toString())?n.push(new e({functionName:RegExp.$1||void 0,args:i})):n.push(new e({args:i}));try{o=o.caller}catch(e){break}}return n}}},void 0===(i=r.apply(t,o))||(e.exports=i)}()},829:function(e,t){var n,r,o;!function(i,s){"use strict";r=[],void 0===(o="function"==typeof(n=function(){function e(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(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"],["evalOrigin"]);function s(t){if(t)for(var n=0;n<i.length;n++)void 0!==t[i[n]]&&this["set"+e(i[n])](t[i[n]])}s.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 s)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new s(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",r=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:r?r+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}},s.fromString=function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),r=e.substring(0,t),o=e.substring(t+1,n).split(","),i=e.substring(n+1);if(0===i.indexOf("@"))var a=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(i,""),u=a[1],l=a[2],c=a[3];return new s({functionName:r,args:o||void 0,fileName:u,lineNumber:l||void 0,columnNumber:c||void 0})};for(var a=0;a<n.length;a++)s.prototype["get"+e(n[a])]=t(n[a]),s.prototype["set"+e(n[a])]=function(e){return function(t){this[e]=Boolean(t)}}(n[a]);for(var u=0;u<r.length;u++)s.prototype["get"+e(r[u])]=t(r[u]),s.prototype["set"+e(r[u])]=function(e){return function(t){if(n=t,isNaN(parseFloat(n))||!isFinite(n))throw new TypeError(e+" must be a Number");var n;this[e]=Number(t)}}(r[u]);for(var l=0;l<o.length;l++)s.prototype["get"+e(o[l])]=t(o[l]),s.prototype["set"+e(o[l])]=function(e){return function(t){this[e]=String(t)}}(o[l]);return s})?n.apply(t,r):n)||(e.exports=o)}()},817:(e,t,n)=>{var r=n(479),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,t){for(var n=new i,r=0,o=e.length;r<o;r++)n.add(e[r],t);return n},i.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(e,t){var n=r.toSetString(e),i=o.call(this._set,n),s=this._array.length;i&&!t||this._array.push(e),i||(this._set[n]=s)},i.prototype.has=function(e){var t=r.toSetString(e);return o.call(this._set,t)},i.prototype.indexOf=function(e){var t=r.toSetString(e);if(o.call(this._set,t))return this._set[t];throw new Error('"'+e+'" is not in the set.')},i.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},i.prototype.toArray=function(){return this._array.slice()},t.I=i},647:(e,t,n)=>{var r=n(855);t.encode=function(e){var t,n="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&o,(o>>>=5)>0&&(t|=32),n+=r.encode(t)}while(o>0);return n},t.decode=function(e,t,n){var o,i,s,a,u=e.length,l=0,c=0;do{if(t>=u)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),l+=(i&=31)<<c,c+=5}while(o);n.value=(a=(s=l)>>1,1==(1&s)?-a:a),n.rest=t}},855:(e,t)=>{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},t.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}},274:(e,t)=>{function n(e,r,o,i,s,a){var u=Math.floor((r-e)/2)+e,l=s(o,i[u],!0);return 0===l?u:l>0?r-u>1?n(u,r,o,i,s,a):a==t.LEAST_UPPER_BOUND?r<i.length?r:-1:u:u-e>1?n(e,u,o,i,s,a):a==t.LEAST_UPPER_BOUND?u:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,r,o,i){if(0===r.length)return-1;var s=n(-1,r.length,e,r,o,i||t.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(r[s],r[s-1],!0);)--s;return s}},27:(e,t,n)=>{var r=n(479);function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){var t,n,o,i,s,a;n=e,o=(t=this._last).generatedLine,i=n.generatedLine,s=t.generatedColumn,a=n.generatedColumn,i>o||i==o&&a>=s||r.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.H=o},956:(e,t)=>{function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t,o,i){if(o<i){var s=o-1;n(e,(c=o,g=i,Math.round(c+Math.random()*(g-c))),i);for(var a=e[i],u=o;u<i;u++)t(e[u],a)<=0&&n(e,s+=1,u);n(e,s+1,u);var l=s+1;r(e,t,o,l-1),r(e,t,l+1,i)}var c,g}t.U=function(e,t){r(e,t,0,e.length-1)}},667:(e,t,n)=>{var r=n(479),o=n(274),i=n(817).I,s=n(647),a=n(956).U;function u(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new g(t):new l(t)}function l(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=r.getArg(t,"version"),o=r.getArg(t,"sources"),s=r.getArg(t,"names",[]),a=r.getArg(t,"sourceRoot",null),u=r.getArg(t,"sourcesContent",null),l=r.getArg(t,"mappings"),c=r.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o=o.map(String).map(r.normalize).map((function(e){return a&&r.isAbsolute(a)&&r.isAbsolute(e)?r.relative(a,e):e})),this._names=i.fromArray(s.map(String),!0),this._sources=i.fromArray(o,!0),this.sourceRoot=a,this.sourcesContent=u,this._mappings=l,this.file=c}function c(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function g(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=r.getArg(t,"version"),o=r.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new i,this._names=new i;var s={line:-1,column:0};this._sections=o.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=r.getArg(e,"offset"),n=r.getArg(t,"line"),o=r.getArg(t,"column");if(n<s.line||n===s.line&&o<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=t,{generatedOffset:{generatedLine:n+1,generatedColumn:o+1},consumer:new u(r.getArg(e,"map"))}}))}u.fromSourceMap=function(e){return l.fromSourceMap(e)},u.prototype._version=3,u.prototype.__generatedMappings=null,Object.defineProperty(u.prototype,"_generatedMappings",{get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),u.prototype.__originalMappings=null,Object.defineProperty(u.prototype,"_originalMappings",{get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),u.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},u.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},u.GENERATED_ORDER=1,u.ORIGINAL_ORDER=2,u.GREATEST_LOWER_BOUND=1,u.LEAST_UPPER_BOUND=2,u.prototype.eachMapping=function(e,t,n){var o,i=t||null;switch(n||u.GENERATED_ORDER){case u.GENERATED_ORDER:o=this._generatedMappings;break;case u.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;o.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return null!=t&&null!=s&&(t=r.join(s,t)),{source:t,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,i)},u.prototype.allGeneratedPositionsFor=function(e){var t=r.getArg(e,"line"),n={source:r.getArg(e,"source"),originalLine:t,originalColumn:r.getArg(e,"column",0)};if(null!=this.sourceRoot&&(n.source=r.relative(this.sourceRoot,n.source)),!this._sources.has(n.source))return[];n.source=this._sources.indexOf(n.source);var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(s>=0){var a=this._originalMappings[s];if(void 0===e.column)for(var u=a.originalLine;a&&a.originalLine===u;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s];else for(var l=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==l;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s]}return i},t.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var t=Object.create(l.prototype),n=t._names=i.fromArray(e._names.toArray(),!0),o=t._sources=i.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var s=e._mappings.toArray().slice(),u=t.__generatedMappings=[],g=t.__originalMappings=[],h=0,p=s.length;h<p;h++){var f=s[h],d=new c;d.generatedLine=f.generatedLine,d.generatedColumn=f.generatedColumn,f.source&&(d.source=o.indexOf(f.source),d.originalLine=f.originalLine,d.originalColumn=f.originalColumn,f.name&&(d.name=n.indexOf(f.name)),g.push(d)),u.push(d)}return a(t.__originalMappings,r.compareByOriginalPositions),t},l.prototype._version=3,Object.defineProperty(l.prototype,"sources",{get:function(){return this._sources.toArray().map((function(e){return null!=this.sourceRoot?r.join(this.sourceRoot,e):e}),this)}}),l.prototype._parseMappings=function(e,t){for(var n,o,i,u,l,g=1,h=0,p=0,f=0,d=0,m=0,v=e.length,y=0,S={},_={},w=[],b=[];y<v;)if(";"===e.charAt(y))g++,y++,h=0;else if(","===e.charAt(y))y++;else{for((n=new c).generatedLine=g,u=y;u<v&&!this._charIsMappingSeparator(e,u);u++);if(i=S[o=e.slice(y,u)])y+=o.length;else{for(i=[];y<u;)s.decode(e,y,_),l=_.value,y=_.rest,i.push(l);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");S[o]=i}n.generatedColumn=h+i[0],h=n.generatedColumn,i.length>1&&(n.source=d+i[1],d+=i[1],n.originalLine=p+i[2],p=n.originalLine,n.originalLine+=1,n.originalColumn=f+i[3],f=n.originalColumn,i.length>4&&(n.name=m+i[4],m+=i[4])),b.push(n),"number"==typeof n.originalLine&&w.push(n)}a(b,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=b,a(w,r.compareByOriginalPositions),this.__originalMappings=w},l.prototype._findMapping=function(e,t,n,r,i,s){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 o.search(e,t,i,s)},l.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},l.prototype.originalPositionFor=function(e){var t={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",r.compareByGeneratedPositionsDeflated,r.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=r.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=r.join(this.sourceRoot,i)));var s=r.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:r.getArg(o,"originalLine",null),column:r.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e}))},l.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=r.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=r.urlParse(this.sourceRoot))){var o=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];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.')},l.prototype.generatedPositionFor=function(e){var t=r.getArg(e,"source");if(null!=this.sourceRoot&&(t=r.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};var n={source:t=this._sources.indexOf(t),originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,r.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null),lastColumn:r.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},g.prototype=Object.create(u.prototype),g.prototype.constructor=u,g.prototype._version=3,Object.defineProperty(g.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),g.prototype.originalPositionFor=function(e){var t={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")},n=o.search(t,this._sections,(function(e,t){return e.generatedLine-t.generatedOffset.generatedLine||e.generatedColumn-t.generatedOffset.generatedColumn})),i=this._sections[n];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},g.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},g.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var r=this._sections[n].consumer.sourceContentFor(e,!0);if(r)return r}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},g.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(-1!==n.consumer.sources.indexOf(r.getArg(e,"source"))){var o=n.consumer.generatedPositionFor(e);if(o)return{line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},g.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var u=i[s],l=o.consumer._sources.at(u.source);null!==o.consumer.sourceRoot&&(l=r.join(o.consumer.sourceRoot,l)),this._sources.add(l),l=this._sources.indexOf(l);var c=o.consumer._names.at(u.name);this._names.add(c),c=this._names.indexOf(c);var g={source:l,generatedLine:u.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(o.generatedOffset.generatedLine===u.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:c};this.__generatedMappings.push(g),"number"==typeof g.originalLine&&this.__originalMappings.push(g)}a(this.__generatedMappings,r.compareByGeneratedPositionsDeflated),a(this.__originalMappings,r.compareByOriginalPositions)}},902:(e,t,n)=>{var r=n(647),o=n(479),i=n(817).I,s=n(27).H;function a(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new i,this._names=new i,this._mappings=new s,this._sourcesContents=null}a.prototype._version=3,a.fromSourceMap=function(e){var t=e.sourceRoot,n=new a({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=o.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)})),e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&n.setSourceContent(t,r)})),n},a.prototype.addMapping=function(e){var t=o.getArg(e,"generated"),n=o.getArg(e,"original",null),r=o.getArg(e,"source",null),i=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i})},a.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=o.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},a.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var s=this._sourceRoot;null!=s&&(r=o.relative(s,r));var a=new i,u=new i;this._mappings.unsortedForEach((function(t){if(t.source===r&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=n&&(t.source=o.join(n,t.source)),null!=s&&(t.source=o.relative(s,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var l=t.source;null==l||a.has(l)||a.add(l);var c=t.name;null==c||u.has(c)||u.add(c)}),this),this._sources=a,this._names=u,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=o.join(n,t)),null!=s&&(t=o.relative(s,t)),this.setSourceContent(t,r))}),this)},a.prototype._validateMapping=function(e,t,n,r){if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},a.prototype._serializeMappings=function(){for(var e,t,n,i,s=0,a=1,u=0,l=0,c=0,g=0,h="",p=this._mappings.toArray(),f=0,d=p.length;f<d;f++){if(e="",(t=p[f]).generatedLine!==a)for(s=0;t.generatedLine!==a;)e+=";",a++;else if(f>0){if(!o.compareByGeneratedPositionsInflated(t,p[f-1]))continue;e+=","}e+=r.encode(t.generatedColumn-s),s=t.generatedColumn,null!=t.source&&(i=this._sources.indexOf(t.source),e+=r.encode(i-g),g=i,e+=r.encode(t.originalLine-1-l),l=t.originalLine-1,e+=r.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=r.encode(n-c),c=n)),h+=e}return h},a.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},a.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=a},786:(e,t,n)=>{var r=n(902).SourceMapGenerator,o=n(479),i=/(\r?\n)/,s="$$$isSourceNode$$$";function a(e,t,n,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==o?null:o,this[s]=!0,null!=r&&this.add(r)}a.fromStringWithSourceMap=function(e,t,n){var r=new a,s=e.split(i),u=function(){return s.shift()+(s.shift()||"")},l=1,c=0,g=null;return t.eachMapping((function(e){if(null!==g){if(!(l<e.generatedLine)){var t=(n=s[0]).substr(0,e.generatedColumn-c);return s[0]=n.substr(e.generatedColumn-c),c=e.generatedColumn,h(g,t),void(g=e)}h(g,u()),l++,c=0}for(;l<e.generatedLine;)r.add(u()),l++;if(c<e.generatedColumn){var n=s[0];r.add(n.substr(0,e.generatedColumn)),s[0]=n.substr(e.generatedColumn),c=e.generatedColumn}g=e}),this),s.length>0&&(g&&h(g,u()),r.add(s.join(""))),t.sources.forEach((function(e){var i=t.sourceContentFor(e);null!=i&&(null!=n&&(e=o.join(n,e)),r.setSourceContent(e,i))})),r;function h(e,t){if(null===e||void 0===e.source)r.add(t);else{var i=n?o.join(n,e.source):e.source;r.add(new a(e.originalLine,e.originalColumn,i,t,e.name))}}},a.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},a.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},a.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n<r;n++)(t=this.children[n])[s]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},a.prototype.join=function(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;n<r-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},a.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[s]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},a.prototype.setSourceContent=function(e,t){this.sourceContents[o.toSetString(e)]=t},a.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][s]&&this.children[t].walkSourceContents(e);var r=Object.keys(this.sourceContents);for(t=0,n=r.length;t<n;t++)e(o.fromSetString(r[t]),this.sourceContents[r[t]])},a.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},a.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new r(e),o=!1,i=null,s=null,a=null,u=null;return this.walk((function(e,r){t.code+=e,null!==r.source&&null!==r.line&&null!==r.column?(i===r.source&&s===r.line&&a===r.column&&u===r.name||n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name}),i=r.source,s=r.line,a=r.column,u=r.name,o=!0):o&&(n.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var l=0,c=e.length;l<c;l++)10===e.charCodeAt(l)?(t.line++,t.column=0,l+1===c?(i=null,o=!1):o&&n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name})):t.column++})),this.walkSourceContents((function(e,t){n.setSourceContent(e,t)})),{code:t.code,map:n}},t.SourceNode=a},479:(e,t)=>{t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,r=/^data:.+\,.+$/;function o(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function s(e){var n=e,r=o(e);if(r){if(!r.path)return e;n=r.path}for(var s,a=t.isAbsolute(n),u=n.split(/\/+/),l=0,c=u.length-1;c>=0;c--)"."===(s=u[c])?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return""===(n=u.join("/"))&&(n=a?"/":"."),r?(r.path=n,i(r)):n}t.urlParse=o,t.urlGenerate=i,t.normalize=s,t.join=function(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),a=o(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var u="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=u,i(a)):u},t.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(n)},t.relative=function(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)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var a=!("__proto__"in Object.create(null));function u(e){return e}function l(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 c(e,t){return e===t?0:e>t?1:-1}t.toSetString=a?u:function(e){return l(e)?"$"+e:e},t.fromSetString=a?u:function(e){return l(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=e.source-t.source;return 0!==r||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)||n||0!=(r=e.generatedColumn-t.generatedColumn)||0!=(r=e.generatedLine-t.generatedLine)?r:e.name-t.name},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!=(r=e.generatedColumn-t.generatedColumn)||n||0!=(r=e.source-t.source)||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r:e.name-t.name},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!=(n=e.generatedColumn-t.generatedColumn)||0!==(n=c(e.source,t.source))||0!=(n=e.originalLine-t.originalLine)||0!=(n=e.originalColumn-t.originalColumn)?n:c(e.name,t.name)}},252:(e,t,n)=>{t.SourceMapGenerator=n(902).SourceMapGenerator,t.SourceMapConsumer=n(667).SourceMapConsumer,t.SourceNode=n(786).SourceNode},358:function(e,t,n){var r,o,i;!function(s,a){"use strict";o=[n(252),n(829)],void 0===(i="function"==typeof(r=function(e,t){function n(e){return new Promise((function(t,n){var r=new XMLHttpRequest;r.open("get",e),r.onerror=n,r.onreadystatechange=function(){4===r.readyState&&(r.status>=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("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 i(s){if(!(this instanceof i))return new i(s);s=s||{},this.sourceCache=s.sourceCache||{},this.sourceMapConsumerCache=s.sourceMapConsumerCache||{},this.ajax=s.ajax||n,this._atob=s.atob||r,this._get=function(e){return new Promise(function(t,n){var r="data:"===e.substr(0,5);if(this.sourceCache[e])t(this.sourceCache[e]);else if(s.offline&&!r)n(new Error("Cannot make network requests in offline mode"));else if(r){var o=e.match(/^data:application\/json;([\w=:"-]+;)*base64,/);if(o){var i=o[0].length,a=e.substr(i),u=this._atob(a);this.sourceCache[e]=u,t(u)}else n(new Error("The encoding of the inline sourcemap is not supported"))}else{var l=this.ajax(e,{method:"get"});this.sourceCache[e]=l,l.then(t,n)}}.bind(this))},this._getSourceMapConsumer=function(t,n){return new Promise(function(r){if(this.sourceMapConsumerCache[t])r(this.sourceMapConsumerCache[t]);else{var o=new Promise(function(r,o){return this._get(t).then((function(t){"string"==typeof t&&(t=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")}(t.replace(/^\)\]\}'/,""))),void 0===t.sourceRoot&&(t.sourceRoot=n),r(new e.SourceMapConsumer(t))})).catch(o)}.bind(this));this.sourceMapConsumerCache[t]=o,r(o)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(t,n){this.getMappedLocation(e).then(function(e){function n(){t(e)}this.findFunctionName(e).then(t,n).catch(n)}.bind(this),n)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(n,r){o(e),this._get(e.fileName).then((function(r){var o=e.lineNumber,i=e.columnNumber,s=function(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),s=0;s<i;++s){var a=r[t-s-1],u=a.indexOf("//");if(u>=0&&(a=a.substr(0,u)),a){o=a+o;for(var l=n.length,c=0;c<l;c++){var g=n[c].exec(o);if(g&&g[1])return g[1]}}}}(r,o);n(s?new t({functionName:s,args:e.args,fileName:e.fileName,lineNumber:o,columnNumber:i}):e)}),r).catch(r)}.bind(this))},this.getMappedLocation=function(e){return new Promise(function(n,r){(function(){if("function"!=typeof Object.defineProperty||"function"!=typeof Object.create)throw new Error("Unable to consume source maps in older browsers")})(),o(e);var i=this.sourceCache,s=e.fileName;this._get(s).then(function(r){var o=function(e){for(var t,n,r=/\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;n=r.exec(e);)t=n[1];if(t)return t;throw new Error("sourceMappingURL not found")}(r),a="data:"===o.substr(0,5),u=s.substring(0,s.lastIndexOf("/")+1);return"/"===o[0]||a||/^https?:\/\/|^\/\//i.test(o)||(o=u+o),this._getSourceMapConsumer(o,u).then((function(r){return function(e,n,r){return new Promise((function(o,i){var s=n.originalPositionFor({line:e.lineNumber,column:e.columnNumber});if(s.source){var a=n.sourceContentFor(s.source);a&&(r[s.source]=a),o(new t({functionName:s.name||e.functionName,args:e.args,fileName:s.source,lineNumber:s.line,columnNumber:s.column}))}else i(new Error("Could not get original source for given stackframe and source map"))}))}(e,r,i).then(n).catch((function(){n(e)}))}))}.bind(this),r).catch(r)}.bind(this))}}})?r.apply(t,o):r)||(e.exports=i)}()},401:function(e,t,n){var r,o,i;!function(s,a){"use strict";o=[n(180),n(595),n(358)],r=function(e,t,n){var r={filter:function(e){return-1===(e.functionName||"").indexOf("StackTrace$$")&&-1===(e.functionName||"").indexOf("ErrorStackParser$$")&&-1===(e.functionName||"").indexOf("StackTraceGPS$$")&&-1===(e.functionName||"").indexOf("StackGenerator$$")},sourceCache:{}},o=function(){try{throw new Error}catch(e){return e}};function i(e,t){var n={};return[e,t].forEach((function(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n})),n}function s(e){return e.stack||e["opera#sourceloc"]}function a(e,t){return"function"==typeof t?e.filter(t):e}return{get:function(e){var t=o();return s(t)?this.fromError(t,e):this.generateArtificially(e)},getSync:function(n){n=i(r,n);var u=o();return a(s(u)?e.parse(u):t.backtrace(n),n.filter)},fromError:function(t,o){o=i(r,o);var s=new n(o);return new Promise(function(n){var r=a(e.parse(t),o.filter);n(Promise.all(r.map((function(e){return new Promise((function(t){function n(){t(e)}s.pinpoint(e).then(t,n).catch(n)}))}))))}.bind(this))},generateArtificially:function(e){e=i(r,e);var n=t.backtrace(e);return"function"==typeof e.filter&&(n=n.filter(e.filter)),Promise.resolve(n)},instrument:function(e,t,n,r){if("function"!=typeof e)throw new Error("Cannot instrument non-function object");if("function"==typeof e.__stacktraceOriginalFn)return e;var o=function(){try{return this.get().then(t,n).catch(n),e.apply(r||this,arguments)}catch(e){throw s(e)&&this.fromError(e).then(t,n).catch(n),e}}.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,t,n,r){return new Promise((function(o,i){var s=new XMLHttpRequest;if(s.onerror=i,s.onreadystatechange=function(){4===s.readyState&&(s.status>=200&&s.status<400?o(s.responseText):i(new Error("POST to "+t+" failed with status: "+s.status)))},s.open("post",t),s.setRequestHeader("Content-Type","application/json"),r&&"object"==typeof r.headers){var a=r.headers;for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&s.setRequestHeader(u,a[u])}var l={stack:e};null!=n&&(l.message=n),s.send(JSON.stringify(l))}))}}},void 0===(i=r.apply(t,o))||(e.exports=i)}()},535:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Header=void 0;t.Header=function(e,t){this.name=e,this.value=t}},54:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LogMessageSeverity=void 0,function(e){e[e.none=0]="none",e[e.critical=1]="critical",e[e.error=2]="error",e[e.warning=4]="warning",e[e.information=8]="information",e[e.verbose=16]="verbose"}(n||(t.LogMessageSeverity=n={}))},169:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MethodSourceInfo=void 0;t.MethodSourceInfo=function(e,t,n,r){this.file=e,this.method=t,this.line=n,this.column=r}},519:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Exception=void 0;t.Exception=function(e,t,n,r,o,i){this.cause=e,this.column=t,this.line=n,this.message=r,this.stackTrace=o,this.url=i}},628:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocalStorageMessage=void 0;t.LocalStorageMessage=function(e,t,n,r,o,i,s,a,u,l,c,g){void 0===o&&(o=null),void 0===i&&(i=null),void 0===s&&(s=null),void 0===a&&(a=null),this.severity=e,this.category=t,this.caption=n,this.description=r,this.parameters=o,this.exception=i,this.details=s,this.methodSourceInfo=a,this.timestamp=u,this.sequence=l,this.agentSessionId=c,this.sessionId=g}},110:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LoupeAgent=void 0;var s=i(n(401)),a=n(519),u=n(535),l=n(628),c=n(54),g=n(169),h=function(){function e(e,t,n){var r;this.window=e,this.document=t,this.clientPlatform=n,this.propagateError=!1,this.loupeAgentSessionIdHeader="loupe-agent-sessionId",this.loupeSessionIdHeader="LoupeSessionId",this.maxRequestSize=204800,this.messageInterval=10,this.exceptionCategory="Javascript.Exception",this.loupeAgentSessionIdKey="LoupeAgentSessionId",this.sequenceNumber=0,this.messageStorage=[],this.storageAvailable=!0,this.storageFull=!1,this.corsOrigin=null,this.globalKeyList=[],this.headers=[],this.debounce=function(e,t){var n=0;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];clearTimeout(n),n=setTimeout((function(){return e.apply(void 0,r)}),t)}},void 0!==this.window&&void 0!==(null===(r=this.window)||void 0===r?void 0:r.onerror)&&(this.existingOnError=this.window.onerror,this.setUpOnError(this.window)),this.storageAvailable=this.storageSupported(),this.setUpClientSessionId(),this.setUpSequenceNumber(),this.flushToServer()}return e.prototype.verbose=function(e,t,n,r,o,i,s){this.write(c.LogMessageSeverity.verbose,e,t,n,r,o,i,s)},e.prototype.information=function(e,t,n,r,o,i,s){this.write(c.LogMessageSeverity.information,e,t,n,r,o,i,s)},e.prototype.warning=function(e,t,n,r,o,i,s){this.write(c.LogMessageSeverity.warning,e,t,n,r,o,i,s)},e.prototype.error=function(e,t,n,r,o,i,s){this.write(c.LogMessageSeverity.error,e,t,n,r,o,i,s)},e.prototype.critical=function(e,t,n,r,o,i,s){this.write(c.LogMessageSeverity.critical,e,t,n,r,o,i,s)},e.prototype.recordException=function(e,t,n){var r=this,o=e.caption||e.name;n||(n=this.exceptionCategory),e.stack&&"string"==typeof e.stack?this.createStackFromMessage(e.stack).then((function(i){e.stack=i,r.write(c.LogMessageSeverity.error,n,o,e.description,null,e,t,null)})):this.write(c.LogMessageSeverity.error,n,o,e.description,null,e,t,null)},e.prototype.write=function(e,t,n,r,o,i,s,a){this.getOrigin(),i=this.sanitiseArgument(i),(s=this.sanitiseArgument(s))&&"string"!=typeof s&&(s=JSON.stringify(s)),!(a=this.sanitiseArgument(a))||a instanceof g.MethodSourceInfo||(a=this.buildMessageSourceInfo(a)),this.createMessage(e,t,n,r,o,i,s,a),this.flushToServer()},e.prototype.flushToServer=function(){var e=this;(this.storageAvailable&&localStorage.length||this.messageStorage.length)&&setTimeout((function(){return e.logMessageToServer()}),this.messageInterval)},e.prototype.setSessionId=function(e){this.sessionId=e},e.prototype.setLogServer=function(e,t){void 0===t&&(t="include"),this.corsOrigin=e,this.credentialsType=t},e.prototype.addHeader=function(e){if(e)if(e.name&&e.value){if(e.name===this.loupeAgentSessionIdHeader)return void this.consoleLog("Custom header cannot be named "+this.loupeAgentSessionIdHeader);if(e.name===this.loupeSessionIdHeader)return void this.consoleLog("Custom header cannot be named "+this.loupeSessionIdHeader);this.headers.push(e)}else this.consoleLog("addHeader failed. The header provided appears invalid as it doesn't have name & value");else this.consoleLog("addHeader failed. No header object provided")},e.prototype.clientSessionHeader=function(){return new u.Header(this.loupeAgentSessionIdHeader,this.agentSessionId)},e.prototype.resetMessageInterval=function(e){var t=e||10;t<10&&(t=10),t<this.messageInterval&&(this.messageInterval=t)},e.prototype.storageSupported=function(){if(!this.window)return!1;var e="_loupe_storage_test_";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}},e.prototype.sanitiseArgument=function(e){return void 0===e?null:e},e.prototype.buildMessageSourceInfo=function(e){return new g.MethodSourceInfo(e.file||null,e.method||null,e.line||null,e.column||null)},e.prototype.setUpOnError=function(e){var t,n=this;void 0!==(null===(t=this.window)||void 0===t?void 0:t.onerror)?this.window.onerror=function(e,t,r,o,i){return n.existingOnError&&n.existingOnError(e,t,r,o,i),setTimeout((function(){return n.logError(e,t,r,o,i)}),10),!n.propagateError}:this.consoleLog("Gibraltar Loupe JavaScript Logger: No onerror event; errors cannot be logged to Loupe")},e.prototype.getPlatform=function(){var e,t,n,r;return this.clientPlatform?(this.document&&(this.clientPlatform.size={height:(null===(e=this.window)||void 0===e?void 0:e.innerHeight)||(null===(t=this.document)||void 0===t?void 0:t.body.clientHeight),width:(null===(n=this.window)||void 0===n?void 0:n.innerWidth)||(null===(r=this.document)||void 0===r?void 0:r.body.clientWidth)}),this.clientPlatform):null},e.prototype.getStackTrace=function(e,t){return null!=e&&e.stack?Promise.resolve(this.createStackFromError(e)):this.createStackFromMessage(t)},e.prototype.createStackFromMessage=function(e){var t=this;if(s)try{return s.fromError(new Error(e)).then((function(e){return t.stripLoupeStackFrames(e.reverse()).map((function(e){return e.toString()}))}))}catch(e){}return Promise.resolve([])},e.prototype.createStackFromError=function(e){return"\n"===e.stack.substring(e.stack.length-1)&&(e.stack=e.stack.substring(0,e.stack.length-1)),e.stack.split("\n")},e.prototype.stripLoupeStackFrames=function(e){if(e){var t=this.userFramesStartAt(e);t>0&&(e=e.slice(t))}return e},e.prototype.userFramesStartAt=function(e){var t=["logError","getStackTrace","createStackFromMessage","createStackTrace"],n=0;for(e[0].toString().indexOf("Cannot access caller")>-1&&n++;n<t.length&&!(e.length<n);n++){var r=e[n].functionName;if(r||(r=e[n].toString()),-1===r.indexOf(t[n]))break}return n},e.prototype.logError=function(e,t,n,r,o){var i=this,s="";o&&(s=o.name||"Exception"),this.getStackTrace(o,e).then((function(o){var a={cause:s,column:r,line:n,message:e,stackTrace:o,url:t};i.createMessage(c.LogMessageSeverity.error,"JavaScript",s,"",null,a,null,null),i.logMessageToServer()}))},e.prototype.isStorageQuotaReached=function(e){return("QUOTA_EXCEEDED_ERR"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name||"QuotaExceededError"===e.name)&&(this.storageFull=!0,!0)},e.prototype.setUpClientSessionId=function(){if(this.sessionId=this.generateUUID(),this.storageAvailable){var e=this.getClientSessionHeader();e?this.agentSessionId=e:(this.agentSessionId=this.generateUUID(),this.storeClientSessionId(this.agentSessionId))}else this.agentSessionId=this.generateUUID()},e.prototype.storeClientSessionId=function(e){if(this.storageAvailable&&!this.storageFull)try{sessionStorage.setItem(this.loupeAgentSessionIdKey,e)}catch(e){if(this.isStorageQuotaReached(e))return;this.consoleLog("Unable to store clientSessionId in session storage. "+e.message)}},e.prototype.getClientSessionHeader=function(){try{var e=sessionStorage.getItem(this.loupeAgentSessionIdKey);if(e)return e}catch(e){this.consoleLog("Unable to retrieve clientSessionId number from session storage. "+e.message)}return null},e.prototype.setUpSequenceNumber=function(){var e=this.getSequenceNumber();-1===e&&this.storageAvailable?this.sequenceNumber=0:this.sequenceNumber=e},e.prototype.getNextSequenceNumber=function(){var e;return this.storageAvailable&&((e=this.getSequenceNumber())<this.sequenceNumber&&(e=this.sequenceNumber),-1!==e&&(e++,this.setSequenceNumber(e)))?(this.sequenceNumber=e,this.sequenceNumber):(this.sequenceNumber++,this.sequenceNumber)},e.prototype.getSequenceNumber=function(){if(this.storageAvailable)try{var e=sessionStorage.getItem("LoupeSequenceNumber");return e?parseInt(e):0}catch(e){this.consoleLog("Unable to retrieve sequence number from session storage. "+e.message)}return-1},e.prototype.setSequenceNumber=function(e){try{return sessionStorage.setItem("LoupeSequenceNumber",e.toString()),!0}catch(e){return this.isStorageQuotaReached(e)?(this.consoleLog("Unable to store sequence number as storage quote reached: "+e.message),!1):(this.consoleLog("Unable to store sequence number: "+e.message),!1)}},e.prototype.createMessage=function(e,t,n,r,o,i,s,a){var u=this.getNextSequenceNumber(),c=this.createTimeStamp();i&&(i=this.createExceptionFromError(i,null));var g=new l.LocalStorageMessage(e,t,n,r,o,i,s,a,c,u,this.agentSessionId,this.sessionId);this.storeMessage(g)},e.prototype.storeMessage=function(e){if(this.storageAvailable&&!this.storageFull)try{localStorage.setItem("Loupe-message-"+this.generateUUID(),JSON.stringify(e))}catch(t){this.isStorageQuotaReached(t),this.consoleLog("Error occured trying to add item to localStorage: "+t.message),this.messageStorage.push(e)}else 5e3===this.messageStorage.length&&this.messageStorage.shift(),this.messageStorage.push(e)},e.prototype.createExceptionFromError=function(e,t){var n=this.window?this.window.location.href:"";if("string"==typeof e)return new a.Exception(t||"",null,null,e,[],n);if("url"in e)return e;var r=e.stackTrace||e.stack||null;return r&&"string"==typeof r&&(r=r.split("\n")),new a.Exception(t||"",e.columnNumber||null,e.lineNumber||null,e.message,r,n)},e.prototype.createTimeStamp=function(){var e=new Date,t=-e.getTimezoneOffset(),n=t>=0?"+":"-",r=function(e){var t=Math.abs(Math.floor(e));return(t<10?"0":"")+t};return e.getFullYear()+"-"+r(e.getMonth()+1)+"-"+r(e.getDate())+"T"+r(e.getHours())+":"+r(e.getMinutes())+":"+r(e.getSeconds())+"."+r(e.getMilliseconds())+n+r(t/60)+":"+r(t%60)},e.prototype.generateUUID=function(){var e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))},e.prototype.truncateDetails=function(e){if(e.message.details&&e.size-e.message.details.length<this.maxRequestSize){e.message.details=JSON.stringify({message:"User supplied details truncated as log message exceeded maximum size."});var t=JSON.stringify(e);e.size=t.length}return e},e.prototype.dropMessage=function(e){this.removeMessagesFromStorage([e.key]);var t=e.message.caption,n=e.message.description;t.length+n.length<this.maxRequestSize-400?this.createMessage(c.LogMessageSeverity.error,"Loupe","Dropped message","Message was dropped as its size exceeded our max request size. Caption was {0} and description {1}",[t,n]):t.length<this.maxRequestSize-400?this.createMessage(c.LogMessageSeverity.error,"Loupe","Dropped message","Message was dropped as its size exceeded our max request size. Caption was {0}",[t]):this.createMessage(c.LogMessageSeverity.error,"Loupe","Dropped message","Message was dropped as its size exceeded our max request size.\nUnable to log caption or description as they exceed max request size")},e.prototype.overSizeMessage=function(e){var t=!1;return e.size>this.maxRequestSize&&(e=this.truncateDetails(e)).size>this.maxRequestSize&&(this.dropMessage(e),t=!0),t},e.prototyp