@bugsnag/browser
Advanced tools
Comparing version 5.0.0-alpha.2 to 5.0.0-rc.0
@@ -1,2 +0,2 @@ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).bugsnag=e()}}(function(){var t=function(e,t,n){for(var r=n,i=0,o=e.length;i<o;i++)r=t(r,e[i],i,e);return r},o=!{toString:null}.propertyIsEnumerable("toString"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=function(e){return e<10?"0"+e:e},e=function(e,i){return t(e,function(e,t,n,r){return e.concat(i(t,n,r))},[])},r=t,i=function(e,i){return t(e,function(e,t,n,r){return i(t,n,r)?e.concat(t):e},[])},s=function(e,i){return t(e,function(e,t,n,r){return!0===e||t===i},!1)},u=function(e){return"[object Array]"===Object.prototype.toString.call(e)},c=function(){var e=new Date;return e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1)+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},f={intRange:function(t,n){return void 0===t&&(t=1),void 0===n&&(n=Infinity),function(e){return"number"==typeof e&&parseInt(""+e,10)===e&&t<=e&&e<=n}},stringWithLength:function(e){return"string"==typeof e&&!!e.length}},l={},d=i,p=r,g=function(e){var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);if(!o)return n;for(var r=0,i=a.length;r<i;r++)Object.prototype.hasOwnProperty.call(e,a[r])&&n.push(a[r]);return n},h=u,v=s,m=f.intRange,y=f.stringWithLength;function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}l.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:y},appVersion:{defaultValue:function(){return null},message:"should be a string",validate:function(e){return null===e||y(e)}},appType:{defaultValue:function(){return null},message:"should be a string",validate:function(e){return null===e||y(e)}},autoNotify:{defaultValue:function(){return!0},message:"should be true|false",validate:function(e){return!0===e||!1===e}},beforeSend:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:function(e){return"function"==typeof e||h(e)&&d(e,function(e){return"function"==typeof e}).length===e.length}},endpoints:{defaultValue:function(){return{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}},message:"should be an object containing endpoint URLs { notify, sessions }. sessions is optional if autoCaptureSessions=false",validate:function(e,t){return e&&"object"==typeof e&&y(e.notify)&&(!1===t.autoCaptureSessions||y(e.sessions))&&0===d(g(e),function(e){return!v(["notify","sessions"],e)}).length}},autoCaptureSessions:{defaultValue:function(e,t){return t.endpoints===undefined||!!t.endpoints&&!!t.endpoints.sessions},message:"should be true|false",validate:function(e){return!0===e||!1===e}},notifyReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(e){return null===e||h(e)&&d(e,function(e){return"string"==typeof e}).length===e.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(e){return"string"==typeof e&&e.length}},maxBreadcrumbs:{defaultValue:function(){return 20},message:"should be a number ≤40",validate:function(e){return m(0,40)(e)}},autoBreadcrumbs:{defaultValue:function(){return!0},message:"should be true|false",validate:function(e){return"boolean"==typeof e}},user:{defaultValue:function(){return null},message:"(object) user should be an object",validate:function(e){return"object"==typeof e}},metaData:{defaultValue:function(){return null},message:"should be an object",validate:function(e){return"object"==typeof e}},logger:{defaultValue:function(){return undefined},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(n){return!n||n&&p(["debug","info","warn","error"],function(e,t){return e&&"function"==typeof n[t]},!0)}},filters:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(e){return h(e)&&e.length===d(e,function(e){return"string"==typeof e||e&&"function"==typeof e.test}).length}}},l.mergeDefaults=function(n,r){if(!n||!r)throw new Error("opts and schema objects are required");return p(g(r),function(e,t){return e[t]=n[t]!==undefined?n[t]:r[t].defaultValue(n[t],n),e},{})},l.validate=function(n,r){if(!n||!r)throw new Error("opts and schema objects are required");var e=p(g(r),function(e,t){return r[t].validate(n[t],n)?e:e.concat({key:t,message:r[t].message,value:n[t]})},[]);return{valid:!e.length,errors:e}};var w=l.schema,S=e,O={releaseStage:{defaultValue:function(){return/^localhost(:\d+)?$/.test(window.location.host)?"development":"production"},message:"should be set",validate:f.stringWithLength},logger:b({},w.logger,{defaultValue:function(){return"undefined"!=typeof console&&"function"==typeof console.debug?N():undefined}})},N=function(){var n={},r=console.log;return S(["debug","info","warn","error"],function(e){var t=console[e];n[e]="function"==typeof t?t.bind(console,"[bugsnag]"):r.bind(console,"[bugsnag]")}),n},j=c,E=function(){function e(e,t,n,r){void 0===e&&(e="[anonymous]"),void 0===t&&(t={}),void 0===n&&(n="manual"),void 0===r&&(r=j()),this.type=n,this.name=e,this.metaData=t,this.timestamp=r}return e.prototype.toJSON=function(){return{type:this.type,name:this.name,timestamp:this.timestamp,metaData:this.metaData}},e}(),k=function(e){return e.app&&"string"==typeof e.app.releaseStage?e.app.releaseStage:e.config.releaseStage},R=function(e,t){return e.isIgnored()||!1===t},x=function It(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}};var _=function(e){return!(!e||!e.stack&&!e.stacktrace&&!e["opera#sourceloc"]||"string"!=typeof(e.stack||e.stacktrace||e["opera#sourceloc"])||e.stack===e.name+": "+e.message)},B={};!function(e,t){"use strict";"object"==typeof B?B=t():e.StackFrame=t()}(this,function(){"use strict";function n(e){return!isNaN(parseFloat(e))&&isFinite(e)}function r(e){return e.charAt(0).toUpperCase()+e.substring(1)}function e(e){return function(){return this[e]}}var t=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],o=["fileName","functionName","source"],a=t.concat(i,o,["args"]);function s(e){if(e instanceof Object)for(var t=0;t<a.length;t++)e.hasOwnProperty(a[t])&&e[a[t]]!==undefined&&this["set"+r(a[t])](e[a[t]])}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(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(n(this.getLineNumber())?":"+this.getLineNumber():"")+(n(this.getColumnNumber())?":"+this.getColumnNumber():"")}};for(var u=0;u<t.length;u++)s.prototype["get"+r(t[u])]=e(t[u]),s.prototype["set"+r(t[u])]=function(t){return function(e){this[t]=Boolean(e)}}(t[u]);for(var c=0;c<i.length;c++)s.prototype["get"+r(i[c])]=e(i[c]),s.prototype["set"+r(i[c])]=function(t){return function(e){if(!n(e))throw new TypeError(t+" must be a Number");this[t]=Number(e)}}(i[c]);for(var f=0;f<o.length;f++)s.prototype["get"+r(o[f])]=e(o[f]),s.prototype["set"+r(o[f])]=function(t){return function(e){this[t]=String(e)}}(o[f]);return s});var L={};!function(e,t){"use strict";"object"==typeof L?L=t(B):e.ErrorStackParser=t(e.StackFrame)}(this,function(s){"use strict";var t=/(^|@)\S+\:\d+/,n=/^\s*at .*(\S+\:\d+|\(native\))/m,r=/^(eval@)?(\[native code\])?$/;return{parse:function(e){if("undefined"!=typeof e.stacktrace||"undefined"!=typeof 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]||undefined,t[3]||undefined]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(n)},this).map(function(e){-1<e.indexOf("(eval ")&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),n=this.extractLocation(t.pop()),r=t.join(" ")||undefined,i=-1<["eval","<anonymous>"].indexOf(n[0])?undefined:n[0];return new s({functionName:r,fileName:i,lineNumber:n[1],columnNumber:n[2],source:e})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(r)},this).map(function(e){if(-1<e.indexOf(" > eval")&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new s({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:undefined,i=this.extractLocation(e.replace(t,""));return new s({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})},this)},parseOpera:function(e){return!e.stacktrace||-1<e.message.indexOf("\n")&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new s({fileName:a[2],lineNumber:a[1],source:n[i]}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new s({functionName:a[3]||undefined,fileName:a[2],lineNumber:a[1],source:n[i]}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(t)&&!e.match(/^Error created at/)},this).map(function(e){var t,n=e.split("@"),r=this.extractLocation(n.pop()),i=n.shift()||"",o=i.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||undefined;i.match(/\(([^\)]*)\)/)&&(t=i.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=t===undefined||"[arguments not available]"===t?undefined:t.split(",");return new s({functionName:o,args:a,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)}}});var D={};function C(){return(C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}!function(e,t){"use strict";"object"==typeof D?D=t(B):e.StackGenerator=t(e.StackFrame)}(this,function(s){return{backtrace:function(e){var t=[],n=10;"object"==typeof e&&"number"==typeof e.maxStackSize&&(n=e.maxStackSize);for(var r=arguments.callee;r&&t.length<n&&r.arguments;){for(var i=new Array(r.arguments.length),o=0;o<i.length;++o)i[o]=r.arguments[o];/function(?:\s+([\w$]+))+\s*\(/.test(r.toString())?t.push(new s({functionName:RegExp.$1||undefined,args:i})):t.push(new s({args:i}));try{r=r.caller}catch(a){break}}return t}}});var q=r,T=i,A=function(){function e(e,t,n,r){void 0===n&&(n=[]),void 0===r&&(r=V()),this.__isBugsnagReport=!0,this._ignored=!1,this._handledState=r,this.app=undefined,this.apiKey=undefined,this.breadcrumbs=[],this.context=undefined,this.device=undefined,this.errorClass=F(e,"[no error class]"),this.errorMessage=F(t,"[no error message]"),this.groupingHash=undefined,this.metaData={},this.request=undefined,this.severity=this._handledState.severity,this.stacktrace=q(n,function(e,t){var n=M(t);try{return"{}"===JSON.stringify(n)?e:e.concat(n)}catch(r){return e}},[]),this.user=undefined,this.session=undefined}var t=e.prototype;return t.ignore=function(){this._ignored=!0},t.isIgnored=function(){return this._ignored},t.updateMetaData=function(e){var t,n;return e?null===(arguments.length<=1?undefined:arguments[1])?this.removeMetaData(e):null===(arguments.length<=2?undefined:arguments[2])?this.removeMetaData(e,arguments.length<=1?undefined:arguments[1],arguments.length<=2?undefined:arguments[2]):("object"==typeof(arguments.length<=1?undefined:arguments[1])&&(n=arguments.length<=1?undefined:arguments[1]),"string"==typeof(arguments.length<=1?undefined:arguments[1])&&((t={})[arguments.length<=1?undefined:arguments[1]]=arguments.length<=2?undefined:arguments[2],n=t),n&&(this.metaData[e]||(this.metaData[e]={}),this.metaData[e]=C({},this.metaData[e],n)),this):this},t.removeMetaData=function(e,t){return"string"!=typeof e||(t?this.metaData[e]&&delete this.metaData[e][t]:delete this.metaData[e]),this},t.toJSON=function(){return{payloadVersion:"4",exceptions:[{errorClass:this.errorClass,message:this.errorMessage,stacktrace:this.stacktrace,type:"browserjs"}],severity:this.severity,unhandled:this._handledState.unhandled,severityReason:this._handledState.severityReason,app:this.app,device:this.device,breadcrumbs:this.breadcrumbs,context:this.context,user:this.user,metaData:this.metaData,groupingHash:this.groupingHash,request:this.request,session:this.session}},e}(),M=function(e){var t={file:e.fileName,method:P(e.functionName),lineNumber:e.lineNumber,columnNumber:e.columnNumber,code:undefined,inProject:undefined};return-1<t.lineNumber&&!t.file&&!t.method&&(t.file="global code"),t},P=function(e){return/^global code$/i.test(e)?"global code":e},V=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},F=function(e,t){return"string"==typeof e&&e?e:t};A.getStacktrace=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=0),_(e)?L.parse(e).slice(t):T(D.backtrace(),function(e){return-1===(e.functionName||"").indexOf("StackGenerator$$")}).slice(1+n)},A.ensureReport=function(e,t,n){if(void 0===t&&(t=0),void 0===n&&(n=0),e.__isBugsnagReport)return e;try{var r=A.getStacktrace(e,t,1+n);return new A(e.name,e.message,r)}catch(i){return new A(e.name,e.message,[])}};var $=A,H=function(e,t){var n="000000000"+e;return n.substr(n.length-t)},U="object"==typeof window?window:self,I=0;for(var K in U)Object.hasOwnProperty.call(U,K)&&I++;var X=navigator.mimeTypes?navigator.mimeTypes.length:0,J=H((X+navigator.userAgent.length).toString(36)+I.toString(36),4),z=function(){return J},G=0,W=4,Y=36,Z=Math.pow(Y,W);function Q(){return H((Math.random()*Z<<0).toString(Y),W)}function ee(){return"c"+(new Date).getTime().toString(Y)+H(function e(){return G=G<Z?G:0,++G-1}().toString(Y),W)+z()+(Q()+Q())}ee.fingerprint=z;var te=ee,ne=c,re=function(){function e(){this.id=te(),this.startedAt=ne(),this._handled=0,this._unhandled=0}var t=e.prototype;return t.toJSON=function(){return{id:this.id,startedAt:this.startedAt,events:{handled:this._handled,unhandled:this._unhandled}}},t.trackError=function(e){this[e._handledState.unhandled?"_unhandled":"_handled"]+=1},e}();function ie(){return(ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var oe=e,ae=s,se=u,ue="Usage error.",ce="Bugsnag usage error.",fe=function(){function t(e){if(!(e&&e.name&&e.version&&e.url))throw new Error("`notifier` argument is required");this.notifier=e,this._configured=!1,this._opts={},this.config={},this._delivery={sendSession:function(){},sendReport:function(){}},this._logger={debug:function(){},info:function(){},warn:function(){},error:function(){}},this._plugins={},this._session=null,this.breadcrumbs=[],this.app={},this.context=undefined,this.device=undefined,this.metaData=undefined,this.request=undefined,this.user={},this.BugsnagClient=t,this.BugsnagReport=$,this.BugsnagBreadcrumb=E,this.BugsnagSession=re}var e=t.prototype;return e.setOptions=function(e){this._opts=ie({},this._opts,e)},e.configure=function(e){void 0===e&&(e=l.schema);var t=l.mergeDefaults(this._opts,e),n=l.validate(t,e);if(!0==!n.valid)throw new Error(pe(n.errors));return"function"==typeof t.beforeSend&&(t.beforeSend=[t.beforeSend]),t.appVersion&&(this.app.version=t.appVersion),t.appType&&(this.app.type=t.appType),t.metaData&&(this.metaData=t.metaData),t.user&&(this.user=t.user),t.logger&&this.logger(t.logger),this.config=ie({},this.config,t),this._configured=!0,this},e.use=function(e){if(!this._configured)throw new Error("client not configured");e.configSchema&&this.configure(e.configSchema);for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=e.init.apply(e,[this].concat(n));return e.name&&(this._plugins["~"+e.name+"~"]=i),this},e.getPlugin=function(e){return this._plugins["~"+e+"~"]},e.delivery=function(e){return this._delivery=e,this},e.logger=function(e,t){return this._logger=e,this},e.sessionDelegate=function(e){return this._sessionDelegate=e,this},e.startSession=function(){return this._sessionDelegate?this._sessionDelegate.startSession(this):(this._logger.warn("No session implementation is installed"),this)},e.leaveBreadcrumb=function(e,t,n,r){if(!this._configured)throw new Error("client not configured");if(e=e||undefined,n="string"==typeof n?n:undefined,r="string"==typeof r?r:undefined,t="object"==typeof t&&null!==t?t:undefined,"string"==typeof e||t){var i=new E(e,t,n,r);return this.breadcrumbs.push(i),this.breadcrumbs.length>this.config.maxBreadcrumbs&&(this.breadcrumbs=this.breadcrumbs.slice(this.breadcrumbs.length-this.config.maxBreadcrumbs)),this}},e.notify=function(e,t,n){var r=this;if(void 0===t&&(t={}),void 0===n&&(n=function(){}),!this._configured)throw new Error("client not configured");var i=k(this),o=le(e,t,this._logger),a=o.err,s=o.errorFramesToSkip,u=o._opts;if(u&&(t=u),!a){var c=ge("nothing");this._logger.warn(ue+" "+c),a=new Error(ce+" "+c)}"object"==typeof t&&null!==t||(t={});var f=$.ensureReport(a,s,1);if(f.app=ie({},{releaseStage:i},f.app,this.app),f.context=f.context||t.context||this.context||undefined,f.device=ie({},f.device,this.device,t.device),f.request=ie({},f.request,this.request,t.request),f.user=ie({},f.user,this.user,t.user),f.metaData=ie({},f.metaData,this.metaData,t.metaData),f.breadcrumbs=this.breadcrumbs.slice(0),this._session&&(this._session.trackError(f),f.session=this._session),t.severity!==undefined&&(f.severity=t.severity,f._handledState.severityReason={type:"userSpecifiedSeverity"}),se(this.config.notifyReleaseStages)&&!ae(this.config.notifyReleaseStages,i))return this._logger.warn("Report not sent due to releaseStage/notifyReleaseStages configuration"),!1;var l,d,p,g,h,v,m,y,b=f.severity,w=[].concat(t.beforeSend).concat(this.config.beforeSend),S=function(e){r._logger.error("Error occurred in beforeSend callback, continuing anyway…"),r._logger.error(e)};m=f,y=S,d=function(e,n){if("function"!=typeof e)return n(null,!1);try{if(2!==e.length){var t=e(m);return t&&"function"==typeof t.then?t.then(function(e){return setTimeout(function(){return n(null,R(m,e))},0)},function(e){setTimeout(function(){return y(e),n(null,!1)})}):n(null,R(m,t))}e(m,function(e,t){if(e)return y(e),n(null,!1);n(null,R(m,t))})}catch(r){y(r),n(null,!1)}},p=function(e,t){if(e&&S(e),t)return r._logger.debug("Report not sent due to beforeSend callback"),!1;r.config.autoBreadcrumbs&&r.leaveBreadcrumb(f.errorClass,{errorClass:f.errorClass,errorMessage:f.errorMessage,severity:f.severity,stacktrace:f.stacktrace},"error"),b!==f.severity&&(f._handledState.severityReason={type:"userCallbackSetSeverity"}),r._delivery.sendReport(r._logger,r.config,{apiKey:f.apiKey||r.config.apiKey,notifier:r.notifier,events:[f]},function(e){return n(e,f)})},g=(l=w).length,h=0,(v=function(){if(g<=h)return p(null,!1);d(l[h],function(e,t){return e?p(e,!1):!0===t?p(null,!0):(h++,void v())})})()},t}(),le=function(e,t,n){var r,i,o=0;switch(typeof e){case"string":if("string"==typeof t){var a=ge("string/string");n.warn(ue+" "+a),r=new Error(ce+" "+a),i={metaData:{notifier:{notifyArgs:[e,t]}}}}else r=new Error(String(e)),o+=2;break;case"number":case"boolean":r=new Error(String(e));break;case"function":var s=ge("function");n.warn(ue+" "+s),r=new Error(ce+" "+s);break;case"object":if(null!==e&&(x(e)||e.__isBugsnagReport))r=e;else if(null!==e&&de(e))(r=new Error(e.message||e.errorMessage)).name=e.name||e.errorClass,o+=2;else{var u=ge("unsupported object");n.warn(ue+" "+u),r=new Error(ce+" "+u)}}return{err:r,errorFramesToSkip:o,_opts:i}},de=function(e){return!("string"!=typeof e.name&&"string"!=typeof e.errorClass||"string"!=typeof e.message&&"string"!=typeof e.errorMessage)},pe=function(e){return"Bugsnag configuration error\n"+oe(e,function(e){return'"'+e.key+'" '+e.message+" \n got "+he(e.value)}).join("\n\n")},ge=function(e){return"notify() expected error/opts parameters, got "+e},he=function(e){return"object"==typeof e?JSON.stringify(e):String(e)},ve=fe,me=function(e,t,n,r){var i=r&&r.filterKeys?r.filterKeys:[],o=r&&r.filterPaths?r.filterPaths:[];return JSON.stringify(function a(e,d,p){var g=[],h=0;return function v(e,t){function n(){return t.length>we&&be<h}h++;if(t.length>ye)return Se;if(n())return Se;if(null===e||"object"!=typeof e)return e;if(Ne(g,e))return"[Circular]";g.push(e);if("function"==typeof e.toJSON)try{h--;var r=v(e.toJSON(),t);return g.pop(),r}catch(f){return Oe(f)}if(s=e,"[object Array]"===Object.prototype.toString.call(s)){for(var i=[],o=0,a=e.length;o<a;o++){if(n()){i.push(Se);break}i.push(v(e[o],t.concat("[]")))}return g.pop(),i}var s;var u={};try{for(var c in e)if(Object.prototype.hasOwnProperty.call(e,c))if(je(p,t.join("."))&&Ee(d,c))u[c]="[Filtered]";else{if(n()){u[c]=Se;break}u[c]=v(ke(e,c),t.concat(c))}}catch(l){}g.pop();return u}(e,[])}(e,i,o),t,n)},ye=20,be=25e3,we=8,Se="...";function Oe(e){return"[Throws: "+(e?e.message:"?")+"]"}function Ne(e,t){for(var n=0,r=e.length;n<r;n++){if(e[n]===t)return true}return false}function je(e,t){for(var n=0,r=e.length;n<r;n++)if(0===t.indexOf(e[n]))return!0;return!1}function Ee(e,t){for(var n=0,r=e.length;n<r;n++){if("string"==typeof e[n]&&e[n]===t)return!0;if(e[n]&&"function"==typeof e[n].test&&e[n].test(t))return!0}return!1}function ke(e,t){try{return e[t]}catch(n){return Oe(n)}}var Re={},xe=["events.[].app","events.[].metaData","events.[].user","events.[].breadcrumbs","events.[].request","events.[].device"],_e=["device","app","user"];Re.report=function(e,t){var n=me(e,null,null,{filterPaths:xe,filterKeys:t});if(1e6<n.length&&(delete e.events[0].metaData,e.events[0].metaData={notifier:"WARNING!\nSerialized payload was "+n.length/1e6+"MB (limit = 1MB)\nmetaData was removed"},1e6<(n=me(e,null,null,{filterPaths:xe,filterKeys:t})).length))throw new Error("payload exceeded 1MB limit");return n},Re.session=function(e,t){var n=me(e,null,null,{filterPaths:_e,filterKeys:t});if(1e6<n.length)throw new Error("payload exceeded 1MB limit");return n};var Be,Le=c;Be=function(a){return void 0===a&&(a=window),{sendReport:function(t,n,r,i){void 0===i&&(i=function(){});var e=De(n,"notify","4.0",a),o=new a.XDomainRequest;o.onload=function(){i(null)},o.open("POST",e),setTimeout(function(){try{o.send(Re.report(r,n.filters))}catch(e){t.error(e),i(e)}},0)},sendSession:function(t,n,r,i){void 0===i&&(i=function(){});var e=De(n,"sessions","1.0",a),o=new a.XDomainRequest;o.onload=function(){i(null)},o.open("POST",e),setTimeout(function(){try{o.send(Re.session(r,n.filters))}catch(e){t.error(e),i(e)}},0)}}};var De=function(e,t,n,r){return Ce(e.endpoints[t],r.location.protocol)+"?apiKey="+encodeURIComponent(e.apiKey)+"&payloadVersion="+n+"&sentAt="+encodeURIComponent(Le())},Ce=Be._matchPageProtocol=function(e,t){return"http:"===t?e.replace(/^https:/,"http:"):e},qe=c,Te={init:function(e,t){void 0===t&&(t=window),e.config.beforeSend.unshift(function(e){e.context||(e.context=t.location.pathname)})}};function Ae(){return(Ae=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Me=c,Pe={init:function(e,t){void 0===t&&(t=navigator);var n={locale:t.browserLanguage||t.systemLanguage||t.userLanguage||t.language,userAgent:t.userAgent};e.device=Ae({},n,e.device),e.config.beforeSend.unshift(function(e){e.device=Ae({},e.device,{time:Me()})})}};function Ve(){return(Ve=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Fe={init:function(e,t){void 0===t&&(t=window),e.config.beforeSend.unshift(function(e){e.request&&e.request.url||(e.request=Ve({},e.request,{url:t.location.href}))})}};function $e(){return($e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var He=u,Ue=s,Ie={init:function(e){return e.sessionDelegate(Ke)}},Ke={startSession:function(e){var t=e;t._session=new e.BugsnagSession;var n=k(t);return He(t.config.notifyReleaseStages)&&!Ue(t.config.notifyReleaseStages,n)?t._logger.warn("Session not sent due to releaseStage/notifyReleaseStages configuration"):t.config.endpoints.sessions?t._delivery.sendSession(t._logger,t.config,{notifier:t.notifier,device:t.device,app:$e({},{releaseStage:n},t.app),sessions:[{id:t._session.id,startedAt:t._session.startedAt,user:t.user}]}):t._logger.warn("Session not sent due to missing endpoints.sessions configuration"),t}};function Xe(){return(Xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Je={init:function(e){e.config.collectUserIp||e.config.beforeSend.push(function(e){e.user=Xe({id:"[NOT COLLECTED]"},e.user),e.request=Xe({clientIp:"[NOT COLLECTED]"},e.request)})},configSchema:{collectUserIp:{defaultValue:function(){return!0},message:"should be true|false",validate:function(e){return!0===e||!1===e}}}},ze={},Ge=e,We=r,Ye=i;ze.init=function(o){Ge(Ze,function(r){var i=console[r];console[r]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];o.leaveBreadcrumb("Console output",We(t,function(e,t,n){var r=String(t);if("[object Object]"===r)try{r=JSON.stringify(t)}catch(i){}return e["["+n+"]"]=r,e},{severity:0===r.indexOf("group")?"log":r}),"log"),i.apply(console,t)},console[r]._restore=function(){console[r]=i}})},ze.configSchema={consoleBreadcrumbsEnabled:{defaultValue:function(){return undefined},validate:function(e){return!0===e||!1===e||e===undefined},message:"should be true|false"}};var Ze=Ye(["log","debug","info","warn","error"],function(e){return"undefined"!=typeof console&&"function"==typeof console[e]}),Qe={},et=r,tt=/^.*<script.*?>/,nt=/<\/script>.*$/,rt=(Qe={init:function(e,t,n){void 0===t&&(t=document),void 0===n&&(n=window);var s="",u=!1,c=function(){return t.documentElement.outerHTML},f=n.location.href;s=c(),t.onreadystatechange=function(){"interactive"===t.readyState&&(s=c(),u=!0)},e.config.beforeSend.unshift(function(e){var r=e.stacktrace[0];if(!r||!r.file||!r.lineNumber)return r;if(r.file.replace(/#.*$/,"")!==f.replace(/#.*$/,""))return r;u&&s||(s=c());var t=["\x3c!-- DOC START --\x3e"].concat(s.split("\n")),n=rt(t,r.lineNumber-1),i=n.script,o=n.start,a=et(i,function(e,t,n){return 10<Math.abs(o+n+1-r.lineNumber)||(e[""+(o+n+1)]=t),e},{});r.code=a,e.updateMetaData("script",{content:i.join("\n")})})}}).extractScriptContent=function(e,t){for(var n=t;n<e.length&&!nt.test(e[n]);)n++;for(var r=n;0<n&&!tt.test(e[n]);)n--;var i=n,o=e.slice(i,r+1);return o[0]=o[0].replace(tt,""),o[o.length-1]=o[o.length-1].replace(nt,""),{script:o,start:i}},it={init:function(i,a){void 0===a&&(a=window),"addEventListener"in a&&a.addEventListener("click",function(e){var t,n;try{t=ot(e.target),n=function o(e,t){var n=[e.tagName];e.id&&n.push("#"+e.id);e.className&&e.className.length&&n.push("."+e.className.split(" ").join("."));if(!t.document.querySelectorAll||!Array.prototype.indexOf)return n.join("");try{if(1===t.document.querySelectorAll(n.join("")).length)return n.join("")}catch(i){return n.join("")}if(1<e.parentNode.childNodes.length){var r=Array.prototype.indexOf.call(e.parentNode.childNodes,e)+1;n.push(":nth-child("+r+")")}if(1===t.document.querySelectorAll(n.join("")).length)return n.join("");if(e.parentNode)return o(e.parentNode,t)+" > "+n.join("");return n.join("")}(e.target,a)}catch(r){n=t="[hidden]",i._logger.error("Cross domain error when tracking click event. See docs: https://tinyurl.com/y94fq5zm")}i.leaveBreadcrumb("UI click",{targetText:t,targetSelector:n},"user")},!0)},configSchema:{interactionBreadcrumbsEnabled:{defaultValue:function(){return undefined},validate:function(e){return!0===e||!1===e||e===undefined},message:"should be true|false"}}},ot=function(e){var t=e.textContent||e.innerText||"";return t||"submit"!==e.type&&"button"!==e.type||(t=e.value),function n(e,t){return e&&e.length<=t?e:e.slice(0,t-"(...)".length)+"(...)"}(t=t.replace(/^\s+|\s+$/g,""),140)};var at={init:function(n,r){if(void 0===r&&(r=window),"addEventListener"in r){var e=function(e){return function(){return n.leaveBreadcrumb(e,{},"navigation")}};r.addEventListener("pagehide",e("Page hidden"),!0),r.addEventListener("pageshow",e("Page shown"),!0),r.addEventListener("load",e("Page loaded"),!0),r.document.addEventListener("DOMContentLoaded",e("DOMContentLoaded"),!0),r.addEventListener("load",function(){return r.addEventListener("popstate",e("Navigated back"),!0)}),r.addEventListener("hashchange",function(e){var t=e.oldURL?{from:ct(e.oldURL),to:ct(e.newURL),state:lt()}:{to:ct(r.location.href)};n.leaveBreadcrumb("Hash changed",t,"navigation")},!0),r.history.replaceState&&ft(n,r.history,"replaceState",r),r.history.pushState&&ft(n,r.history,"pushState",r),n.leaveBreadcrumb("Bugsnag loaded",{},"navigation")}}};at.configSchema={navigationBreadcrumbsEnabled:{defaultValue:function(){return undefined},validate:function(e){return!0===e||!1===e||e===undefined},message:"should be true|false"}};var st,ut,ct=function(e,t){var n=t.document.createElement("A");return n.href=e,""+n.pathname+n.search+n.hash},ft=function(u,c,f,l){var d=c[f];c[f]=function(e,t,n){var r,i,o,a,s;u.leaveBreadcrumb("History "+f,(i=e,o=t,a=n,s=ct((r=l).location.href,r),{title:o,state:i,prevState:lt(r),to:a||s,from:s}),"navigation"),"function"==typeof u.refresh&&u.refresh(),u.session&&u.startSession(),d.apply(c,[e,t].concat(n!==undefined?n:[]))},c[f]._restore=function(){c[f]=d}},lt=function(e){try{return e.history.state}catch(t){}},dt={},pt="request",gt="BS~~U",ht="BS~~M",vt=s,mt=function(){return[st.config.endpoints.notify,st.config.endpoints.sessions]};dt.init=function(e,t){void 0===t&&(t=window),st=e,ut=t,yt(),St()},dt.configSchema={networkBreadcrumbsEnabled:{defaultValue:function(){return undefined},validate:function(e){return!0===e||!1===e||e===undefined},message:"should be true|false"}};var yt=function(){if("addEventListener"in ut.XMLHttpRequest.prototype){var n=ut.XMLHttpRequest.prototype.open;ut.XMLHttpRequest.prototype.open=function(e,t){this[gt]=t,this[ht]=e,this["BS~~S"]&&(this.removeEventListener("load",bt),this.removeEventListener("error",wt)),this.addEventListener("load",bt),this.addEventListener("error",wt),this["BS~~S"]=!0,n.apply(this,arguments)}}};function bt(){if(!vt(mt(),this[gt])){var e={status:this.status,request:this[ht]+" "+this[gt]};400<=this.status?st.leaveBreadcrumb("XMLHttpRequest failed",e,pt):st.leaveBreadcrumb("XMLHttpRequest succeeded",e,pt)}}function wt(){vt(mt(),this[gt])||st.leaveBreadcrumb("XMLHttpRequest error",{request:this[ht]+" "+this[gt]},pt)}var St=function(){if("fetch"in ut){var a=ut.fetch;ut.fetch=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var i=r[0],n=r[1],o="GET";return n&&n.method&&(o=n.method),new Promise(function(t,n){a.apply(void 0,r).then(function(e){Ot(e,o,i),t(e)})["catch"](function(e){Nt(o,i),n(e)})})}}},Ot=function(e,t,n){var r={status:e.status,request:t+" "+n};400<=e.status?st.leaveBreadcrumb("fetch() failed",r,pt):st.leaveBreadcrumb("fetch() succeeded",r,pt)},Nt=function(e,t){st.leaveBreadcrumb("fetch() error",{request:e+" "+t},pt)},jt=f.intRange,Et={init:function(t){var n=0;t.config.beforeSend.push(function(e){if(n>=t.config.maxEvents)return e.ignore();n++}),t.refresh=function(){n=0}},configSchema:{maxEvents:{defaultValue:function(){return 10},message:"should be a positive integer ≤100",validate:function(e){return jt(1,100)(e)}}}},kt={};function Rt(){return(Rt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var xt=e,_t=(kt={init:function(e){e.config.beforeSend.push(function(e){e.stacktrace=xt(e.stacktrace,function(e){return Rt({},e,{file:_t(e.file)})})})}})._strip=function(e){return"string"==typeof e?e.replace(/\?.*$/,"").replace(/#.*$/,""):e},Bt={init:function(c,e){void 0===e&&(e=window);var f=e.onerror;e.onerror=function l(e,t,n,r,i){if(0===n&&/Script error\.?/.test(e))c._logger.warn("Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/y94fq5zm");else{var o,a={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}};if(i)i.name&&i.message?o=new c.BugsnagReport(i.name,i.message,Lt(c.BugsnagReport.getStacktrace(i),t,n,r),a):(o=new c.BugsnagReport("window.onerror",String(i),Lt(c.BugsnagReport.getStacktrace(i,1),t,n,r),a)).updateMetaData("window onerror",{error:i});else if("object"!=typeof e||null===e||t||n||r||i)(o=new c.BugsnagReport("window.onerror",String(e),Lt(c.BugsnagReport.getStacktrace(i,1),t,n,r),a)).updateMetaData("window onerror",{event:e});else{var s=e.type?"Event: "+e.type:"window.onerror",u=e.message||e.detail||"";(o=new c.BugsnagReport(s,u,c.BugsnagReport.getStacktrace(new Error,1).slice(1),a)).updateMetaData("window onerror",{event:e})}c.notify(o),"function"==typeof f&&f(e,t,n,r,i)}}}},Lt=function(e,t,n,r){var i=e[0];return i&&(i.fileName||i.setFileName(t),i.lineNumber||i.setLineNumber(n),i.columnNumber||(r!==undefined?i.setColumnNumber(r):window.event&&window.event.errorCharacter&&i.setColumnNumber(window.event&&window.event.errorCharacter))),e},Dt={};!function(e,t){"use strict";"object"==typeof Dt?Dt=t():e.StackFrame=t()}(this,function(){"use strict";function n(e){return!isNaN(parseFloat(e))&&isFinite(e)}function r(e){return e.charAt(0).toUpperCase()+e.substring(1)}function e(e){return function(){return this[e]}}var t=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],o=["fileName","functionName","source"],a=t.concat(i,o,["args"]);function s(e){if(e instanceof Object)for(var t=0;t<a.length;t++)e.hasOwnProperty(a[t])&&e[a[t]]!==undefined&&this["set"+r(a[t])](e[a[t]])}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(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(n(this.getLineNumber())?":"+this.getLineNumber():"")+(n(this.getColumnNumber())?":"+this.getColumnNumber():"")}};for(var u=0;u<t.length;u++)s.prototype["get"+r(t[u])]=e(t[u]),s.prototype["set"+r(t[u])]=function(t){return function(e){this[t]=Boolean(e)}}(t[u]);for(var c=0;c<i.length;c++)s.prototype["get"+r(i[c])]=e(i[c]),s.prototype["set"+r(i[c])]=function(t){return function(e){if(!n(e))throw new TypeError(t+" must be a Number");this[t]=Number(e)}}(i[c]);for(var f=0;f<o.length;f++)s.prototype["get"+r(o[f])]=e(o[f]),s.prototype["set"+r(o[f])]=function(t){return function(e){this[t]=String(e)}}(o[f]);return s});var Ct={};!function(e,t){"use strict";"object"==typeof Ct?Ct=t(Dt):e.ErrorStackParser=t(e.StackFrame)}(this,function(s){"use strict";var t=/(^|@)\S+\:\d+/,n=/^\s*at .*(\S+\:\d+|\(native\))/m,r=/^(eval@)?(\[native code\])?$/;return{parse:function(e){if("undefined"!=typeof e.stacktrace||"undefined"!=typeof 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]||undefined,t[3]||undefined]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(n)},this).map(function(e){-1<e.indexOf("(eval ")&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),n=this.extractLocation(t.pop()),r=t.join(" ")||undefined,i=-1<["eval","<anonymous>"].indexOf(n[0])?undefined:n[0];return new s({functionName:r,fileName:i,lineNumber:n[1],columnNumber:n[2],source:e})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(r)},this).map(function(e){if(-1<e.indexOf(" > eval")&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new s({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:undefined,i=this.extractLocation(e.replace(t,""));return new s({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})},this)},parseOpera:function(e){return!e.stacktrace||-1<e.message.indexOf("\n")&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new s({fileName:a[2],lineNumber:a[1],source:n[i]}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new s({functionName:a[3]||undefined,fileName:a[2],lineNumber:a[1],source:n[i]}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(t)&&!e.match(/^Error created at/)},this).map(function(e){var t,n=e.split("@"),r=this.extractLocation(n.pop()),i=n.shift()||"",o=i.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||undefined;i.match(/\(([^\)]*)\)/)&&(t=i.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=t===undefined||"[arguments not available]"===t?undefined:t.split(",");return new s({functionName:o,args:a,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)}}});var qt=function Kt(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}};var Tt={},At=r;Tt.init=function(o,e){void 0===e&&(e=window);var n=function(e){var t=e.reason,n=!1;e.detail&&e.detail.reason&&(t=e.detail.reason,n=!0);var r,i={severity:"error",unhandled:!0,severityReason:{type:"unhandledPromiseRejection"}};if(t&&_(t))r=new o.BugsnagReport(t.name,t.message,Ct.parse(t),i),n&&(r.stacktrace=At(r.stacktrace,Vt(t),[]));else{(r=new o.BugsnagReport(t&&t.name?t.name:"UnhandledRejection",t&&t.message?t.message:'Rejection reason was not an Error. See "Promise" tab for more detail.',[],i)).updateMetaData("promise","rejection reason",Pt(t))}o.notify(r)};"addEventListener"in e?e.addEventListener("unhandledrejection",n):e.onunhandledrejection=function(e,t){n({detail:{reason:e,promise:t}})},n};var Mt,Pt=function(e){return null===e||e===undefined?"undefined (or null)":qt(e)?((t={})[Object.prototype.toString.call(e)]={name:e.name,message:e.message,code:e.code,stack:e.stack},t):e;var t},Vt=function(n){return function(e,t){return t.file===n.toString()?e:(t.method&&(t.method=t.method.replace(/^\s+/,"")),e.concat(t))}};function Ft(){return(Ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var $t=e,Ht=Ft({},l.schema,O);Mt=function(e){"string"==typeof e&&(e={apiKey:e});var t=[];e.sessionTrackingEnabled&&(t.push("deprecated option sessionTrackingEnabled is now called autoCaptureSessions"),e.autoCaptureSessions=e.sessionTrackingEnabled),!e.endpoint&&!e.sessionEndpoint||e.endpoints||(t.push("deprecated options endpoint/sessionEndpoint are now configured in the endpoints object"),e.endpoints={notify:e.endpoint,sessions:e.sessionEndpoint}),e.endpoints&&e.endpoints.notify&&!e.endpoints.sessions&&t.push("notify endpoint is set but sessions endpoint is not. No sessions will be sent.");var s,n=new ve({name:"Bugsnag JavaScript",version:"5.0.0-alpha.1",url:"https://github.com/bugsnag/bugsnag-js"});return n.setOptions(e),n.delivery(window.XDomainRequest?Be():(void 0===s&&(s=window),{sendReport:function(e,t,n,r){void 0===r&&(r=function(){});try{var i=t.endpoints.notify,o=new s.XMLHttpRequest;o.onreadystatechange=function(){o.readyState===s.XMLHttpRequest.DONE&&r(null)},o.open("POST",i),o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Bugsnag-Api-Key",n.apiKey||t.apiKey),o.setRequestHeader("Bugsnag-Payload-Version","4.0"),o.setRequestHeader("Bugsnag-Sent-At",qe()),o.send(Re.report(n,t.filters))}catch(a){e.error(a)}},sendSession:function(e,t,n,r){void 0===r&&(r=function(){});try{var i=t.endpoints.sessions,o=new s.XMLHttpRequest;o.onreadystatechange=function(){o.readyState===s.XMLHttpRequest.DONE&&r(null)},o.open("POST",i),o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Bugsnag-Api-Key",t.apiKey),o.setRequestHeader("Bugsnag-Payload-Version","1.0"),o.setRequestHeader("Bugsnag-Sent-At",qe()),o.send(Re.session(n,t.filters))}catch(a){e.error(a)}}})),n.configure(Ht),$t(t,function(e){return n._logger.warn(e)}),n.use(Pe),n.use(Te),n.use(Fe),n.use(Qe),n.use(Et),n.use(Ie),n.use(Je),n.use(kt),!1!==n.config.autoNotify&&(n.use(Bt),n.use(Tt)),Ut(n.config,"navigationBreadcrumbsEnabled")&&n.use(at),Ut(n.config,"interactionBreadcrumbsEnabled")&&n.use(it),Ut(n.config,"networkBreadcrumbsEnabled")&&n.use(dt),Ut(n.config,"consoleBreadcrumbsEnabled",!1)&&n.use(ze),n._logger.debug("Loaded!"),n.config.autoCaptureSessions?n.startSession():n};var Ut=function(e,t,n){return void 0===n&&(n=!0),"boolean"==typeof e[t]?e[t]:e.autoBreadcrumbs&&(n||!/^dev(elopment)?$/.test(e.releaseStage))};return Mt.Bugsnag={Client:ve,Report:$,Session:re,Breadcrumb:E},Mt["default"]=Mt}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).bugsnag=e()}}(function(){var t=function(e,t,n){for(var r=n,i=0,o=e.length;i<o;i++)r=t(r,e[i],i,e);return r},o=!{toString:null}.propertyIsEnumerable("toString"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=function(e){return e<10?"0"+e:e},e=function(e,i){return t(e,function(e,t,n,r){return e.concat(i(t,n,r))},[])},r=t,i=function(e,i){return t(e,function(e,t,n,r){return i(t,n,r)?e.concat(t):e},[])},s=function(e,i){return t(e,function(e,t,n,r){return!0===e||t===i},!1)},u=function(e){return"[object Array]"===Object.prototype.toString.call(e)},c=function(){var e=new Date;return e.getUTCFullYear()+"-"+n(e.getUTCMonth()+1)+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},f={intRange:function(t,n){return void 0===t&&(t=1),void 0===n&&(n=Infinity),function(e){return"number"==typeof e&&parseInt(""+e,10)===e&&t<=e&&e<=n}},stringWithLength:function(e){return"string"==typeof e&&!!e.length}},l={},d=i,p=r,g=function(e){var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);if(!o)return n;for(var r=0,i=a.length;r<i;r++)Object.prototype.hasOwnProperty.call(e,a[r])&&n.push(a[r]);return n},h=u,v=s,m=f.intRange,y=f.stringWithLength;function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}l.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:y},appVersion:{defaultValue:function(){return null},message:"should be a string",validate:function(e){return null===e||y(e)}},appType:{defaultValue:function(){return null},message:"should be a string",validate:function(e){return null===e||y(e)}},autoNotify:{defaultValue:function(){return!0},message:"should be true|false",validate:function(e){return!0===e||!1===e}},beforeSend:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:function(e){return"function"==typeof e||h(e)&&d(e,function(e){return"function"==typeof e}).length===e.length}},endpoints:{defaultValue:function(){return{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}},message:"should be an object containing endpoint URLs { notify, sessions }. sessions is optional if autoCaptureSessions=false",validate:function(e,t){return e&&"object"==typeof e&&y(e.notify)&&(!1===t.autoCaptureSessions||y(e.sessions))&&0===d(g(e),function(e){return!v(["notify","sessions"],e)}).length}},autoCaptureSessions:{defaultValue:function(e,t){return t.endpoints===undefined||!!t.endpoints&&!!t.endpoints.sessions},message:"should be true|false",validate:function(e){return!0===e||!1===e}},notifyReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(e){return null===e||h(e)&&d(e,function(e){return"string"==typeof e}).length===e.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(e){return"string"==typeof e&&e.length}},maxBreadcrumbs:{defaultValue:function(){return 20},message:"should be a number ≤40",validate:function(e){return m(0,40)(e)}},autoBreadcrumbs:{defaultValue:function(){return!0},message:"should be true|false",validate:function(e){return"boolean"==typeof e}},user:{defaultValue:function(){return null},message:"(object) user should be an object",validate:function(e){return"object"==typeof e}},metaData:{defaultValue:function(){return null},message:"should be an object",validate:function(e){return"object"==typeof e}},logger:{defaultValue:function(){return undefined},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(n){return!n||n&&p(["debug","info","warn","error"],function(e,t){return e&&"function"==typeof n[t]},!0)}},filters:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(e){return h(e)&&e.length===d(e,function(e){return"string"==typeof e||e&&"function"==typeof e.test}).length}}},l.mergeDefaults=function(n,r){if(!n||!r)throw new Error("opts and schema objects are required");return p(g(r),function(e,t){return e[t]=n[t]!==undefined?n[t]:r[t].defaultValue(n[t],n),e},{})},l.validate=function(n,r){if(!n||!r)throw new Error("opts and schema objects are required");var e=p(g(r),function(e,t){return r[t].validate(n[t],n)?e:e.concat({key:t,message:r[t].message,value:n[t]})},[]);return{valid:!e.length,errors:e}};var w=l.schema,S=e,O={releaseStage:{defaultValue:function(){return/^localhost(:\d+)?$/.test(window.location.host)?"development":"production"},message:"should be set",validate:f.stringWithLength},logger:b({},w.logger,{defaultValue:function(){return"undefined"!=typeof console&&"function"==typeof console.debug?N():undefined}})},N=function(){var n={},r=console.log;return S(["debug","info","warn","error"],function(e){var t=console[e];n[e]="function"==typeof t?t.bind(console,"[bugsnag]"):r.bind(console,"[bugsnag]")}),n},j=c,E=function(){function e(e,t,n,r){void 0===e&&(e="[anonymous]"),void 0===t&&(t={}),void 0===n&&(n="manual"),void 0===r&&(r=j()),this.type=n,this.name=e,this.metaData=t,this.timestamp=r}return e.prototype.toJSON=function(){return{type:this.type,name:this.name,timestamp:this.timestamp,metaData:this.metaData}},e}(),k=function(e){return e.app&&"string"==typeof e.app.releaseStage?e.app.releaseStage:e.config.releaseStage},R=function(e,t){return e.isIgnored()||!1===t},x=function It(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}};var _=function(e){return!(!e||!e.stack&&!e.stacktrace&&!e["opera#sourceloc"]||"string"!=typeof(e.stack||e.stacktrace||e["opera#sourceloc"])||e.stack===e.name+": "+e.message)},B={};!function(e,t){"use strict";"object"==typeof B?B=t():e.StackFrame=t()}(this,function(){"use strict";function n(e){return!isNaN(parseFloat(e))&&isFinite(e)}function r(e){return e.charAt(0).toUpperCase()+e.substring(1)}function e(e){return function(){return this[e]}}var t=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],o=["fileName","functionName","source"],a=t.concat(i,o,["args"]);function s(e){if(e instanceof Object)for(var t=0;t<a.length;t++)e.hasOwnProperty(a[t])&&e[a[t]]!==undefined&&this["set"+r(a[t])](e[a[t]])}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(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(n(this.getLineNumber())?":"+this.getLineNumber():"")+(n(this.getColumnNumber())?":"+this.getColumnNumber():"")}};for(var u=0;u<t.length;u++)s.prototype["get"+r(t[u])]=e(t[u]),s.prototype["set"+r(t[u])]=function(t){return function(e){this[t]=Boolean(e)}}(t[u]);for(var c=0;c<i.length;c++)s.prototype["get"+r(i[c])]=e(i[c]),s.prototype["set"+r(i[c])]=function(t){return function(e){if(!n(e))throw new TypeError(t+" must be a Number");this[t]=Number(e)}}(i[c]);for(var f=0;f<o.length;f++)s.prototype["get"+r(o[f])]=e(o[f]),s.prototype["set"+r(o[f])]=function(t){return function(e){this[t]=String(e)}}(o[f]);return s});var L={};!function(e,t){"use strict";"object"==typeof L?L=t(B):e.ErrorStackParser=t(e.StackFrame)}(this,function(s){"use strict";var t=/(^|@)\S+\:\d+/,n=/^\s*at .*(\S+\:\d+|\(native\))/m,r=/^(eval@)?(\[native code\])?$/;return{parse:function(e){if("undefined"!=typeof e.stacktrace||"undefined"!=typeof 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]||undefined,t[3]||undefined]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(n)},this).map(function(e){-1<e.indexOf("(eval ")&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),n=this.extractLocation(t.pop()),r=t.join(" ")||undefined,i=-1<["eval","<anonymous>"].indexOf(n[0])?undefined:n[0];return new s({functionName:r,fileName:i,lineNumber:n[1],columnNumber:n[2],source:e})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(r)},this).map(function(e){if(-1<e.indexOf(" > eval")&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new s({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:undefined,i=this.extractLocation(e.replace(t,""));return new s({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})},this)},parseOpera:function(e){return!e.stacktrace||-1<e.message.indexOf("\n")&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new s({fileName:a[2],lineNumber:a[1],source:n[i]}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new s({functionName:a[3]||undefined,fileName:a[2],lineNumber:a[1],source:n[i]}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(t)&&!e.match(/^Error created at/)},this).map(function(e){var t,n=e.split("@"),r=this.extractLocation(n.pop()),i=n.shift()||"",o=i.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||undefined;i.match(/\(([^\)]*)\)/)&&(t=i.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=t===undefined||"[arguments not available]"===t?undefined:t.split(",");return new s({functionName:o,args:a,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)}}});var D={};function C(){return(C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}!function(e,t){"use strict";"object"==typeof D?D=t(B):e.StackGenerator=t(e.StackFrame)}(this,function(s){return{backtrace:function(e){var t=[],n=10;"object"==typeof e&&"number"==typeof e.maxStackSize&&(n=e.maxStackSize);for(var r=arguments.callee;r&&t.length<n&&r.arguments;){for(var i=new Array(r.arguments.length),o=0;o<i.length;++o)i[o]=r.arguments[o];/function(?:\s+([\w$]+))+\s*\(/.test(r.toString())?t.push(new s({functionName:RegExp.$1||undefined,args:i})):t.push(new s({args:i}));try{r=r.caller}catch(a){break}}return t}}});var q=r,T=i,A=function(){function e(e,t,n,r){void 0===n&&(n=[]),void 0===r&&(r=V()),this.__isBugsnagReport=!0,this._ignored=!1,this._handledState=r,this.app=undefined,this.apiKey=undefined,this.breadcrumbs=[],this.context=undefined,this.device=undefined,this.errorClass=F(e,"[no error class]"),this.errorMessage=F(t,"[no error message]"),this.groupingHash=undefined,this.metaData={},this.request=undefined,this.severity=this._handledState.severity,this.stacktrace=q(n,function(e,t){var n=M(t);try{return"{}"===JSON.stringify(n)?e:e.concat(n)}catch(r){return e}},[]),this.user=undefined,this.session=undefined}var t=e.prototype;return t.ignore=function(){this._ignored=!0},t.isIgnored=function(){return this._ignored},t.updateMetaData=function(e){var t,n;return e?null===(arguments.length<=1?undefined:arguments[1])?this.removeMetaData(e):null===(arguments.length<=2?undefined:arguments[2])?this.removeMetaData(e,arguments.length<=1?undefined:arguments[1],arguments.length<=2?undefined:arguments[2]):("object"==typeof(arguments.length<=1?undefined:arguments[1])&&(n=arguments.length<=1?undefined:arguments[1]),"string"==typeof(arguments.length<=1?undefined:arguments[1])&&((t={})[arguments.length<=1?undefined:arguments[1]]=arguments.length<=2?undefined:arguments[2],n=t),n&&(this.metaData[e]||(this.metaData[e]={}),this.metaData[e]=C({},this.metaData[e],n)),this):this},t.removeMetaData=function(e,t){return"string"!=typeof e||(t?this.metaData[e]&&delete this.metaData[e][t]:delete this.metaData[e]),this},t.toJSON=function(){return{payloadVersion:"4",exceptions:[{errorClass:this.errorClass,message:this.errorMessage,stacktrace:this.stacktrace,type:"browserjs"}],severity:this.severity,unhandled:this._handledState.unhandled,severityReason:this._handledState.severityReason,app:this.app,device:this.device,breadcrumbs:this.breadcrumbs,context:this.context,user:this.user,metaData:this.metaData,groupingHash:this.groupingHash,request:this.request,session:this.session}},e}(),M=function(e){var t={file:e.fileName,method:P(e.functionName),lineNumber:e.lineNumber,columnNumber:e.columnNumber,code:undefined,inProject:undefined};return-1<t.lineNumber&&!t.file&&!t.method&&(t.file="global code"),t},P=function(e){return/^global code$/i.test(e)?"global code":e},V=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},F=function(e,t){return"string"==typeof e&&e?e:t};A.getStacktrace=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=0),_(e)?L.parse(e).slice(t):T(D.backtrace(),function(e){return-1===(e.functionName||"").indexOf("StackGenerator$$")}).slice(1+n)},A.ensureReport=function(e,t,n){if(void 0===t&&(t=0),void 0===n&&(n=0),e.__isBugsnagReport)return e;try{var r=A.getStacktrace(e,t,1+n);return new A(e.name,e.message,r)}catch(i){return new A(e.name,e.message,[])}};var $=A,H=function(e,t){var n="000000000"+e;return n.substr(n.length-t)},U="object"==typeof window?window:self,I=0;for(var K in U)Object.hasOwnProperty.call(U,K)&&I++;var X=navigator.mimeTypes?navigator.mimeTypes.length:0,J=H((X+navigator.userAgent.length).toString(36)+I.toString(36),4),z=function(){return J},G=0,W=4,Y=36,Z=Math.pow(Y,W);function Q(){return H((Math.random()*Z<<0).toString(Y),W)}function ee(){return"c"+(new Date).getTime().toString(Y)+H(function e(){return G=G<Z?G:0,++G-1}().toString(Y),W)+z()+(Q()+Q())}ee.fingerprint=z;var te=ee,ne=c,re=function(){function e(){this.id=te(),this.startedAt=ne(),this._handled=0,this._unhandled=0}var t=e.prototype;return t.toJSON=function(){return{id:this.id,startedAt:this.startedAt,events:{handled:this._handled,unhandled:this._unhandled}}},t.trackError=function(e){this[e._handledState.unhandled?"_unhandled":"_handled"]+=1},e}();function ie(){return(ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var oe=e,ae=s,se=u,ue="Usage error.",ce="Bugsnag usage error.",fe=function(){function t(e){if(!(e&&e.name&&e.version&&e.url))throw new Error("`notifier` argument is required");this.notifier=e,this._configured=!1,this._opts={},this.config={},this._delivery={sendSession:function(){},sendReport:function(){}},this._logger={debug:function(){},info:function(){},warn:function(){},error:function(){}},this._plugins={},this._session=null,this.breadcrumbs=[],this.app={},this.context=undefined,this.device=undefined,this.metaData=undefined,this.request=undefined,this.user={},this.BugsnagClient=t,this.BugsnagReport=$,this.BugsnagBreadcrumb=E,this.BugsnagSession=re}var e=t.prototype;return e.setOptions=function(e){this._opts=ie({},this._opts,e)},e.configure=function(e){void 0===e&&(e=l.schema);var t=l.mergeDefaults(this._opts,e),n=l.validate(t,e);if(!0==!n.valid)throw new Error(pe(n.errors));return"function"==typeof t.beforeSend&&(t.beforeSend=[t.beforeSend]),t.appVersion&&(this.app.version=t.appVersion),t.appType&&(this.app.type=t.appType),t.metaData&&(this.metaData=t.metaData),t.user&&(this.user=t.user),t.logger&&this.logger(t.logger),this.config=ie({},this.config,t),this._configured=!0,this},e.use=function(e){if(!this._configured)throw new Error("client not configured");e.configSchema&&this.configure(e.configSchema);for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=e.init.apply(e,[this].concat(n));return e.name&&(this._plugins["~"+e.name+"~"]=i),this},e.getPlugin=function(e){return this._plugins["~"+e+"~"]},e.delivery=function(e){return this._delivery=e,this},e.logger=function(e,t){return this._logger=e,this},e.sessionDelegate=function(e){return this._sessionDelegate=e,this},e.startSession=function(){return this._sessionDelegate?this._sessionDelegate.startSession(this):(this._logger.warn("No session implementation is installed"),this)},e.leaveBreadcrumb=function(e,t,n,r){if(!this._configured)throw new Error("client not configured");if(e=e||undefined,n="string"==typeof n?n:undefined,r="string"==typeof r?r:undefined,t="object"==typeof t&&null!==t?t:undefined,"string"==typeof e||t){var i=new E(e,t,n,r);return this.breadcrumbs.push(i),this.breadcrumbs.length>this.config.maxBreadcrumbs&&(this.breadcrumbs=this.breadcrumbs.slice(this.breadcrumbs.length-this.config.maxBreadcrumbs)),this}},e.notify=function(e,t,n){var r=this;if(void 0===t&&(t={}),void 0===n&&(n=function(){}),!this._configured)throw new Error("client not configured");var i=k(this),o=le(e,t,this._logger),a=o.err,s=o.errorFramesToSkip,u=o._opts;if(u&&(t=u),!a){var c=ge("nothing");this._logger.warn(ue+" "+c),a=new Error(ce+" "+c)}"object"==typeof t&&null!==t||(t={});var f=$.ensureReport(a,s,1);if(f.app=ie({},{releaseStage:i},f.app,this.app),f.context=f.context||t.context||this.context||undefined,f.device=ie({},f.device,this.device,t.device),f.request=ie({},f.request,this.request,t.request),f.user=ie({},f.user,this.user,t.user),f.metaData=ie({},f.metaData,this.metaData,t.metaData),f.breadcrumbs=this.breadcrumbs.slice(0),this._session&&(this._session.trackError(f),f.session=this._session),t.severity!==undefined&&(f.severity=t.severity,f._handledState.severityReason={type:"userSpecifiedSeverity"}),se(this.config.notifyReleaseStages)&&!ae(this.config.notifyReleaseStages,i))return this._logger.warn("Report not sent due to releaseStage/notifyReleaseStages configuration"),!1;var l,d,p,g,h,v,m,y,b=f.severity,w=[].concat(t.beforeSend).concat(this.config.beforeSend),S=function(e){r._logger.error("Error occurred in beforeSend callback, continuing anyway…"),r._logger.error(e)};m=f,y=S,d=function(e,n){if("function"!=typeof e)return n(null,!1);try{if(2!==e.length){var t=e(m);return t&&"function"==typeof t.then?t.then(function(e){return setTimeout(function(){return n(null,R(m,e))},0)},function(e){setTimeout(function(){return y(e),n(null,!1)})}):n(null,R(m,t))}e(m,function(e,t){if(e)return y(e),n(null,!1);n(null,R(m,t))})}catch(r){y(r),n(null,!1)}},p=function(e,t){if(e&&S(e),t)return r._logger.debug("Report not sent due to beforeSend callback"),!1;r.config.autoBreadcrumbs&&r.leaveBreadcrumb(f.errorClass,{errorClass:f.errorClass,errorMessage:f.errorMessage,severity:f.severity,stacktrace:f.stacktrace},"error"),b!==f.severity&&(f._handledState.severityReason={type:"userCallbackSetSeverity"}),r._delivery.sendReport(r._logger,r.config,{apiKey:f.apiKey||r.config.apiKey,notifier:r.notifier,events:[f]},function(e){return n(e,f)})},g=(l=w).length,h=0,(v=function(){if(g<=h)return p(null,!1);d(l[h],function(e,t){return e?p(e,!1):!0===t?p(null,!0):(h++,void v())})})()},t}(),le=function(e,t,n){var r,i,o=0;switch(typeof e){case"string":if("string"==typeof t){var a=ge("string/string");n.warn(ue+" "+a),r=new Error(ce+" "+a),i={metaData:{notifier:{notifyArgs:[e,t]}}}}else r=new Error(String(e)),o+=2;break;case"number":case"boolean":r=new Error(String(e));break;case"function":var s=ge("function");n.warn(ue+" "+s),r=new Error(ce+" "+s);break;case"object":if(null!==e&&(x(e)||e.__isBugsnagReport))r=e;else if(null!==e&&de(e))(r=new Error(e.message||e.errorMessage)).name=e.name||e.errorClass,o+=2;else{var u=ge("unsupported object");n.warn(ue+" "+u),r=new Error(ce+" "+u)}}return{err:r,errorFramesToSkip:o,_opts:i}},de=function(e){return!("string"!=typeof e.name&&"string"!=typeof e.errorClass||"string"!=typeof e.message&&"string"!=typeof e.errorMessage)},pe=function(e){return"Bugsnag configuration error\n"+oe(e,function(e){return'"'+e.key+'" '+e.message+" \n got "+he(e.value)}).join("\n\n")},ge=function(e){return"notify() expected error/opts parameters, got "+e},he=function(e){return"object"==typeof e?JSON.stringify(e):String(e)},ve=fe,me=function(e,t,n,r){var i=r&&r.filterKeys?r.filterKeys:[],o=r&&r.filterPaths?r.filterPaths:[];return JSON.stringify(function a(e,d,p){var g=[],h=0;return function v(e,t){function n(){return t.length>we&&be<h}h++;if(t.length>ye)return Se;if(n())return Se;if(null===e||"object"!=typeof e)return e;if(Ne(g,e))return"[Circular]";g.push(e);if("function"==typeof e.toJSON)try{h--;var r=v(e.toJSON(),t);return g.pop(),r}catch(f){return Oe(f)}if(s=e,"[object Array]"===Object.prototype.toString.call(s)){for(var i=[],o=0,a=e.length;o<a;o++){if(n()){i.push(Se);break}i.push(v(e[o],t.concat("[]")))}return g.pop(),i}var s;var u={};try{for(var c in e)if(Object.prototype.hasOwnProperty.call(e,c))if(je(p,t.join("."))&&Ee(d,c))u[c]="[Filtered]";else{if(n()){u[c]=Se;break}u[c]=v(ke(e,c),t.concat(c))}}catch(l){}g.pop();return u}(e,[])}(e,i,o),t,n)},ye=20,be=25e3,we=8,Se="...";function Oe(e){return"[Throws: "+(e?e.message:"?")+"]"}function Ne(e,t){for(var n=0,r=e.length;n<r;n++){if(e[n]===t)return true}return false}function je(e,t){for(var n=0,r=e.length;n<r;n++)if(0===t.indexOf(e[n]))return!0;return!1}function Ee(e,t){for(var n=0,r=e.length;n<r;n++){if("string"==typeof e[n]&&e[n]===t)return!0;if(e[n]&&"function"==typeof e[n].test&&e[n].test(t))return!0}return!1}function ke(e,t){try{return e[t]}catch(n){return Oe(n)}}var Re={},xe=["events.[].app","events.[].metaData","events.[].user","events.[].breadcrumbs","events.[].request","events.[].device"],_e=["device","app","user"];Re.report=function(e,t){var n=me(e,null,null,{filterPaths:xe,filterKeys:t});if(1e6<n.length&&(delete e.events[0].metaData,e.events[0].metaData={notifier:"WARNING!\nSerialized payload was "+n.length/1e6+"MB (limit = 1MB)\nmetaData was removed"},1e6<(n=me(e,null,null,{filterPaths:xe,filterKeys:t})).length))throw new Error("payload exceeded 1MB limit");return n},Re.session=function(e,t){var n=me(e,null,null,{filterPaths:_e,filterKeys:t});if(1e6<n.length)throw new Error("payload exceeded 1MB limit");return n};var Be,Le=c;Be=function(a){return void 0===a&&(a=window),{sendReport:function(t,n,r,i){void 0===i&&(i=function(){});var e=De(n,"notify","4.0",a),o=new a.XDomainRequest;o.onload=function(){i(null)},o.open("POST",e),setTimeout(function(){try{o.send(Re.report(r,n.filters))}catch(e){t.error(e),i(e)}},0)},sendSession:function(t,n,r,i){void 0===i&&(i=function(){});var e=De(n,"sessions","1.0",a),o=new a.XDomainRequest;o.onload=function(){i(null)},o.open("POST",e),setTimeout(function(){try{o.send(Re.session(r,n.filters))}catch(e){t.error(e),i(e)}},0)}}};var De=function(e,t,n,r){return Ce(e.endpoints[t],r.location.protocol)+"?apiKey="+encodeURIComponent(e.apiKey)+"&payloadVersion="+n+"&sentAt="+encodeURIComponent(Le())},Ce=Be._matchPageProtocol=function(e,t){return"http:"===t?e.replace(/^https:/,"http:"):e},qe=c,Te={init:function(e,t){void 0===t&&(t=window),e.config.beforeSend.unshift(function(e){e.context||(e.context=t.location.pathname)})}};function Ae(){return(Ae=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Me=c,Pe={init:function(e,t){void 0===t&&(t=navigator);var n={locale:t.browserLanguage||t.systemLanguage||t.userLanguage||t.language,userAgent:t.userAgent};e.device=Ae({},n,e.device),e.config.beforeSend.unshift(function(e){e.device=Ae({},e.device,{time:Me()})})}};function Ve(){return(Ve=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Fe={init:function(e,t){void 0===t&&(t=window),e.config.beforeSend.unshift(function(e){e.request&&e.request.url||(e.request=Ve({},e.request,{url:t.location.href}))})}};function $e(){return($e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var He=u,Ue=s,Ie={init:function(e){return e.sessionDelegate(Ke)}},Ke={startSession:function(e){var t=e;t._session=new e.BugsnagSession;var n=k(t);return He(t.config.notifyReleaseStages)&&!Ue(t.config.notifyReleaseStages,n)?t._logger.warn("Session not sent due to releaseStage/notifyReleaseStages configuration"):t.config.endpoints.sessions?t._delivery.sendSession(t._logger,t.config,{notifier:t.notifier,device:t.device,app:$e({},{releaseStage:n},t.app),sessions:[{id:t._session.id,startedAt:t._session.startedAt,user:t.user}]}):t._logger.warn("Session not sent due to missing endpoints.sessions configuration"),t}};function Xe(){return(Xe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Je={init:function(e){e.config.collectUserIp||e.config.beforeSend.push(function(e){e.user=Xe({id:"[NOT COLLECTED]"},e.user),e.request=Xe({clientIp:"[NOT COLLECTED]"},e.request)})},configSchema:{collectUserIp:{defaultValue:function(){return!0},message:"should be true|false",validate:function(e){return!0===e||!1===e}}}},ze={},Ge=e,We=r,Ye=i;ze.init=function(o){Ge(Ze,function(r){var i=console[r];console[r]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];o.leaveBreadcrumb("Console output",We(t,function(e,t,n){var r=String(t);if("[object Object]"===r)try{r=JSON.stringify(t)}catch(i){}return e["["+n+"]"]=r,e},{severity:0===r.indexOf("group")?"log":r}),"log"),i.apply(console,t)},console[r]._restore=function(){console[r]=i}})},ze.configSchema={consoleBreadcrumbsEnabled:{defaultValue:function(){return undefined},validate:function(e){return!0===e||!1===e||e===undefined},message:"should be true|false"}};var Ze=Ye(["log","debug","info","warn","error"],function(e){return"undefined"!=typeof console&&"function"==typeof console[e]}),Qe={},et=r,tt=/^.*<script.*?>/,nt=/<\/script>.*$/,rt=(Qe={init:function(e,t,n){void 0===t&&(t=document),void 0===n&&(n=window);var s="",u=!1,c=function(){return t.documentElement.outerHTML},f=n.location.href;s=c(),t.onreadystatechange=function(){"interactive"===t.readyState&&(s=c(),u=!0)},e.config.beforeSend.unshift(function(e){var r=e.stacktrace[0];if(!r||!r.file||!r.lineNumber)return r;if(r.file.replace(/#.*$/,"")!==f.replace(/#.*$/,""))return r;u&&s||(s=c());var t=["\x3c!-- DOC START --\x3e"].concat(s.split("\n")),n=rt(t,r.lineNumber-1),i=n.script,o=n.start,a=et(i,function(e,t,n){return 10<Math.abs(o+n+1-r.lineNumber)||(e[""+(o+n+1)]=t),e},{});r.code=a,e.updateMetaData("script",{content:i.join("\n")})})}}).extractScriptContent=function(e,t){for(var n=t;n<e.length&&!nt.test(e[n]);)n++;for(var r=n;0<n&&!tt.test(e[n]);)n--;var i=n,o=e.slice(i,r+1);return o[0]=o[0].replace(tt,""),o[o.length-1]=o[o.length-1].replace(nt,""),{script:o,start:i}},it={init:function(i,a){void 0===a&&(a=window),"addEventListener"in a&&a.addEventListener("click",function(e){var t,n;try{t=ot(e.target),n=function o(e,t){var n=[e.tagName];e.id&&n.push("#"+e.id);e.className&&e.className.length&&n.push("."+e.className.split(" ").join("."));if(!t.document.querySelectorAll||!Array.prototype.indexOf)return n.join("");try{if(1===t.document.querySelectorAll(n.join("")).length)return n.join("")}catch(i){return n.join("")}if(1<e.parentNode.childNodes.length){var r=Array.prototype.indexOf.call(e.parentNode.childNodes,e)+1;n.push(":nth-child("+r+")")}if(1===t.document.querySelectorAll(n.join("")).length)return n.join("");if(e.parentNode)return o(e.parentNode,t)+" > "+n.join("");return n.join("")}(e.target,a)}catch(r){n=t="[hidden]",i._logger.error("Cross domain error when tracking click event. See docs: https://tinyurl.com/y94fq5zm")}i.leaveBreadcrumb("UI click",{targetText:t,targetSelector:n},"user")},!0)},configSchema:{interactionBreadcrumbsEnabled:{defaultValue:function(){return undefined},validate:function(e){return!0===e||!1===e||e===undefined},message:"should be true|false"}}},ot=function(e){var t=e.textContent||e.innerText||"";return t||"submit"!==e.type&&"button"!==e.type||(t=e.value),function n(e,t){return e&&e.length<=t?e:e.slice(0,t-"(...)".length)+"(...)"}(t=t.replace(/^\s+|\s+$/g,""),140)};var at={init:function(n,r){if(void 0===r&&(r=window),"addEventListener"in r){var e=function(e){return function(){return n.leaveBreadcrumb(e,{},"navigation")}};r.addEventListener("pagehide",e("Page hidden"),!0),r.addEventListener("pageshow",e("Page shown"),!0),r.addEventListener("load",e("Page loaded"),!0),r.document.addEventListener("DOMContentLoaded",e("DOMContentLoaded"),!0),r.addEventListener("load",function(){return r.addEventListener("popstate",e("Navigated back"),!0)}),r.addEventListener("hashchange",function(e){var t=e.oldURL?{from:ct(e.oldURL),to:ct(e.newURL),state:lt()}:{to:ct(r.location.href)};n.leaveBreadcrumb("Hash changed",t,"navigation")},!0),r.history.replaceState&&ft(n,r.history,"replaceState",r),r.history.pushState&&ft(n,r.history,"pushState",r),n.leaveBreadcrumb("Bugsnag loaded",{},"navigation")}}};at.configSchema={navigationBreadcrumbsEnabled:{defaultValue:function(){return undefined},validate:function(e){return!0===e||!1===e||e===undefined},message:"should be true|false"}};var st,ut,ct=function(e,t){var n=t.document.createElement("A");return n.href=e,""+n.pathname+n.search+n.hash},ft=function(u,c,f,l){var d=c[f];c[f]=function(e,t,n){var r,i,o,a,s;u.leaveBreadcrumb("History "+f,(i=e,o=t,a=n,s=ct((r=l).location.href,r),{title:o,state:i,prevState:lt(r),to:a||s,from:s}),"navigation"),"function"==typeof u.refresh&&u.refresh(),u.session&&u.startSession(),d.apply(c,[e,t].concat(n!==undefined?n:[]))},c[f]._restore=function(){c[f]=d}},lt=function(e){try{return e.history.state}catch(t){}},dt={},pt="request",gt="BS~~U",ht="BS~~M",vt=s,mt=function(){return[st.config.endpoints.notify,st.config.endpoints.sessions]};dt.init=function(e,t){void 0===t&&(t=window),st=e,ut=t,yt(),St()},dt.configSchema={networkBreadcrumbsEnabled:{defaultValue:function(){return undefined},validate:function(e){return!0===e||!1===e||e===undefined},message:"should be true|false"}};var yt=function(){if("addEventListener"in ut.XMLHttpRequest.prototype){var n=ut.XMLHttpRequest.prototype.open;ut.XMLHttpRequest.prototype.open=function(e,t){this[gt]=t,this[ht]=e,this["BS~~S"]&&(this.removeEventListener("load",bt),this.removeEventListener("error",wt)),this.addEventListener("load",bt),this.addEventListener("error",wt),this["BS~~S"]=!0,n.apply(this,arguments)}}};function bt(){if(!vt(mt(),this[gt])){var e={status:this.status,request:this[ht]+" "+this[gt]};400<=this.status?st.leaveBreadcrumb("XMLHttpRequest failed",e,pt):st.leaveBreadcrumb("XMLHttpRequest succeeded",e,pt)}}function wt(){vt(mt(),this[gt])||st.leaveBreadcrumb("XMLHttpRequest error",{request:this[ht]+" "+this[gt]},pt)}var St=function(){if("fetch"in ut){var a=ut.fetch;ut.fetch=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var i=r[0],n=r[1],o="GET";return n&&n.method&&(o=n.method),new Promise(function(t,n){a.apply(void 0,r).then(function(e){Ot(e,o,i),t(e)})["catch"](function(e){Nt(o,i),n(e)})})}}},Ot=function(e,t,n){var r={status:e.status,request:t+" "+n};400<=e.status?st.leaveBreadcrumb("fetch() failed",r,pt):st.leaveBreadcrumb("fetch() succeeded",r,pt)},Nt=function(e,t){st.leaveBreadcrumb("fetch() error",{request:e+" "+t},pt)},jt=f.intRange,Et={init:function(t){var n=0;t.config.beforeSend.push(function(e){if(n>=t.config.maxEvents)return e.ignore();n++}),t.refresh=function(){n=0}},configSchema:{maxEvents:{defaultValue:function(){return 10},message:"should be a positive integer ≤100",validate:function(e){return jt(1,100)(e)}}}},kt={};function Rt(){return(Rt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var xt=e,_t=(kt={init:function(e){e.config.beforeSend.push(function(e){e.stacktrace=xt(e.stacktrace,function(e){return Rt({},e,{file:_t(e.file)})})})}})._strip=function(e){return"string"==typeof e?e.replace(/\?.*$/,"").replace(/#.*$/,""):e},Bt={init:function(c,e){void 0===e&&(e=window);var f=e.onerror;e.onerror=function l(e,t,n,r,i){if(0===n&&/Script error\.?/.test(e))c._logger.warn("Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/y94fq5zm");else{var o,a={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}};if(i)i.name&&i.message?o=new c.BugsnagReport(i.name,i.message,Lt(c.BugsnagReport.getStacktrace(i),t,n,r),a):(o=new c.BugsnagReport("window.onerror",String(i),Lt(c.BugsnagReport.getStacktrace(i,1),t,n,r),a)).updateMetaData("window onerror",{error:i});else if("object"!=typeof e||null===e||t||n||r||i)(o=new c.BugsnagReport("window.onerror",String(e),Lt(c.BugsnagReport.getStacktrace(i,1),t,n,r),a)).updateMetaData("window onerror",{event:e});else{var s=e.type?"Event: "+e.type:"window.onerror",u=e.message||e.detail||"";(o=new c.BugsnagReport(s,u,c.BugsnagReport.getStacktrace(new Error,1).slice(1),a)).updateMetaData("window onerror",{event:e})}c.notify(o),"function"==typeof f&&f(e,t,n,r,i)}}}},Lt=function(e,t,n,r){var i=e[0];return i&&(i.fileName||i.setFileName(t),i.lineNumber||i.setLineNumber(n),i.columnNumber||(r!==undefined?i.setColumnNumber(r):window.event&&window.event.errorCharacter&&i.setColumnNumber(window.event&&window.event.errorCharacter))),e},Dt={};!function(e,t){"use strict";"object"==typeof Dt?Dt=t():e.StackFrame=t()}(this,function(){"use strict";function n(e){return!isNaN(parseFloat(e))&&isFinite(e)}function r(e){return e.charAt(0).toUpperCase()+e.substring(1)}function e(e){return function(){return this[e]}}var t=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],o=["fileName","functionName","source"],a=t.concat(i,o,["args"]);function s(e){if(e instanceof Object)for(var t=0;t<a.length;t++)e.hasOwnProperty(a[t])&&e[a[t]]!==undefined&&this["set"+r(a[t])](e[a[t]])}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(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(n(this.getLineNumber())?":"+this.getLineNumber():"")+(n(this.getColumnNumber())?":"+this.getColumnNumber():"")}};for(var u=0;u<t.length;u++)s.prototype["get"+r(t[u])]=e(t[u]),s.prototype["set"+r(t[u])]=function(t){return function(e){this[t]=Boolean(e)}}(t[u]);for(var c=0;c<i.length;c++)s.prototype["get"+r(i[c])]=e(i[c]),s.prototype["set"+r(i[c])]=function(t){return function(e){if(!n(e))throw new TypeError(t+" must be a Number");this[t]=Number(e)}}(i[c]);for(var f=0;f<o.length;f++)s.prototype["get"+r(o[f])]=e(o[f]),s.prototype["set"+r(o[f])]=function(t){return function(e){this[t]=String(e)}}(o[f]);return s});var Ct={};!function(e,t){"use strict";"object"==typeof Ct?Ct=t(Dt):e.ErrorStackParser=t(e.StackFrame)}(this,function(s){"use strict";var t=/(^|@)\S+\:\d+/,n=/^\s*at .*(\S+\:\d+|\(native\))/m,r=/^(eval@)?(\[native code\])?$/;return{parse:function(e){if("undefined"!=typeof e.stacktrace||"undefined"!=typeof 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]||undefined,t[3]||undefined]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(n)},this).map(function(e){-1<e.indexOf("(eval ")&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),n=this.extractLocation(t.pop()),r=t.join(" ")||undefined,i=-1<["eval","<anonymous>"].indexOf(n[0])?undefined:n[0];return new s({functionName:r,fileName:i,lineNumber:n[1],columnNumber:n[2],source:e})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(r)},this).map(function(e){if(-1<e.indexOf(" > eval")&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new s({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:undefined,i=this.extractLocation(e.replace(t,""));return new s({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})},this)},parseOpera:function(e){return!e.stacktrace||-1<e.message.indexOf("\n")&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new s({fileName:a[2],lineNumber:a[1],source:n[i]}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new s({functionName:a[3]||undefined,fileName:a[2],lineNumber:a[1],source:n[i]}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(t)&&!e.match(/^Error created at/)},this).map(function(e){var t,n=e.split("@"),r=this.extractLocation(n.pop()),i=n.shift()||"",o=i.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||undefined;i.match(/\(([^\)]*)\)/)&&(t=i.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=t===undefined||"[arguments not available]"===t?undefined:t.split(",");return new s({functionName:o,args:a,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)}}});var qt=function Kt(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return e instanceof Error}};var Tt={},At=r;Tt.init=function(o,e){void 0===e&&(e=window);var n=function(e){var t=e.reason,n=!1;e.detail&&e.detail.reason&&(t=e.detail.reason,n=!0);var r,i={severity:"error",unhandled:!0,severityReason:{type:"unhandledPromiseRejection"}};if(t&&_(t))r=new o.BugsnagReport(t.name,t.message,Ct.parse(t),i),n&&(r.stacktrace=At(r.stacktrace,Vt(t),[]));else{(r=new o.BugsnagReport(t&&t.name?t.name:"UnhandledRejection",t&&t.message?t.message:'Rejection reason was not an Error. See "Promise" tab for more detail.',[],i)).updateMetaData("promise","rejection reason",Pt(t))}o.notify(r)};"addEventListener"in e?e.addEventListener("unhandledrejection",n):e.onunhandledrejection=function(e,t){n({detail:{reason:e,promise:t}})},n};var Mt,Pt=function(e){return null===e||e===undefined?"undefined (or null)":qt(e)?((t={})[Object.prototype.toString.call(e)]={name:e.name,message:e.message,code:e.code,stack:e.stack},t):e;var t},Vt=function(n){return function(e,t){return t.file===n.toString()?e:(t.method&&(t.method=t.method.replace(/^\s+/,"")),e.concat(t))}};function Ft(){return(Ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var $t=e,Ht=Ft({},l.schema,O);Mt=function(e){"string"==typeof e&&(e={apiKey:e});var t=[];e.sessionTrackingEnabled&&(t.push("deprecated option sessionTrackingEnabled is now called autoCaptureSessions"),e.autoCaptureSessions=e.sessionTrackingEnabled),!e.endpoint&&!e.sessionEndpoint||e.endpoints||(t.push("deprecated options endpoint/sessionEndpoint are now configured in the endpoints object"),e.endpoints={notify:e.endpoint,sessions:e.sessionEndpoint}),e.endpoints&&e.endpoints.notify&&!e.endpoints.sessions&&t.push("notify endpoint is set but sessions endpoint is not. No sessions will be sent.");var s,n=new ve({name:"Bugsnag JavaScript",version:"5.0.0-rc.0",url:"https://github.com/bugsnag/bugsnag-js"});return n.setOptions(e),n.delivery(window.XDomainRequest?Be():(void 0===s&&(s=window),{sendReport:function(e,t,n,r){void 0===r&&(r=function(){});try{var i=t.endpoints.notify,o=new s.XMLHttpRequest;o.onreadystatechange=function(){o.readyState===s.XMLHttpRequest.DONE&&r(null)},o.open("POST",i),o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Bugsnag-Api-Key",n.apiKey||t.apiKey),o.setRequestHeader("Bugsnag-Payload-Version","4.0"),o.setRequestHeader("Bugsnag-Sent-At",qe()),o.send(Re.report(n,t.filters))}catch(a){e.error(a)}},sendSession:function(e,t,n,r){void 0===r&&(r=function(){});try{var i=t.endpoints.sessions,o=new s.XMLHttpRequest;o.onreadystatechange=function(){o.readyState===s.XMLHttpRequest.DONE&&r(null)},o.open("POST",i),o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Bugsnag-Api-Key",t.apiKey),o.setRequestHeader("Bugsnag-Payload-Version","1.0"),o.setRequestHeader("Bugsnag-Sent-At",qe()),o.send(Re.session(n,t.filters))}catch(a){e.error(a)}}})),n.configure(Ht),$t(t,function(e){return n._logger.warn(e)}),n.use(Pe),n.use(Te),n.use(Fe),n.use(Qe),n.use(Et),n.use(Ie),n.use(Je),n.use(kt),!1!==n.config.autoNotify&&(n.use(Bt),n.use(Tt)),Ut(n.config,"navigationBreadcrumbsEnabled")&&n.use(at),Ut(n.config,"interactionBreadcrumbsEnabled")&&n.use(it),Ut(n.config,"networkBreadcrumbsEnabled")&&n.use(dt),Ut(n.config,"consoleBreadcrumbsEnabled",!1)&&n.use(ze),n._logger.debug("Loaded!"),n.config.autoCaptureSessions?n.startSession():n};var Ut=function(e,t,n){return void 0===n&&(n=!0),"boolean"==typeof e[t]?e[t]:e.autoBreadcrumbs&&(n||!/^dev(elopment)?$/.test(e.releaseStage))};return Mt.Bugsnag={Client:ve,Report:$,Session:re,Breadcrumb:E},Mt["default"]=Mt}); | ||
//# sourceMappingURL=bugsnag.min.js.map |
{ | ||
"name": "@bugsnag/browser", | ||
"version": "5.0.0-alpha.2", | ||
"version": "5.0.0-rc.0", | ||
"main": "dist/bugsnag.js", | ||
@@ -27,3 +27,4 @@ "types": "types/bugsnag.d.ts", | ||
"test": "bundle exec maze-runner", | ||
"cdn-upload": "./bin/cdn-upload" | ||
"cdn-upload": "./bin/cdn-upload", | ||
"postversion": "npm run build" | ||
}, | ||
@@ -33,19 +34,19 @@ "author": "Bugsnag", | ||
"devDependencies": { | ||
"@bugsnag/core": "^5.0.0-alpha.1", | ||
"@bugsnag/delivery-x-domain-request": "^5.0.0-alpha.1", | ||
"@bugsnag/delivery-xml-http-request": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-browser-context": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-browser-device": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-browser-request": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-browser-session": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-client-ip": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-console-breadcrumbs": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-inline-script-content": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-interaction-breadcrumbs": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-navigation-breadcrumbs": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-network-breadcrumbs": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-simple-throttle": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-strip-query-string": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-window-onerror": "^5.0.0-alpha.1", | ||
"@bugsnag/plugin-window-unhandled-rejection": "^5.0.0-alpha.1", | ||
"@bugsnag/core": "^5.0.0-rc.0", | ||
"@bugsnag/delivery-x-domain-request": "^5.0.0-rc.0", | ||
"@bugsnag/delivery-xml-http-request": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-browser-context": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-browser-device": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-browser-request": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-browser-session": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-client-ip": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-console-breadcrumbs": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-inline-script-content": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-interaction-breadcrumbs": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-navigation-breadcrumbs": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-network-breadcrumbs": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-simple-throttle": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-strip-query-string": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-window-onerror": "^5.0.0-rc.0", | ||
"@bugsnag/plugin-window-unhandled-rejection": "^5.0.0-rc.0", | ||
"cloudfront": "^0.4.1", | ||
@@ -60,3 +61,3 @@ "jasmine": "^3.1.0", | ||
}, | ||
"gitHead": "26c3443da9093c87f4894fd52569645e3b9a33e6" | ||
"gitHead": "20bf54a6b5e141d861f03474e57bf71c86ffa77a" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
444189