{"version":3,"sources":["webpack:////home/runner/work/frontend-monorepo/frontend-monorepo/node_modules/@bugsnag/js/browser/notifier.js","webpack:////home/runner/work/frontend-monorepo/frontend-monorepo/node_modules/@bugsnag/browser/dist/bugsnag.js","webpack:////home/runner/work/frontend-monorepo/frontend-monorepo/node_modules/@bugsnag/plugin-react/dist/bugsnag-react.js"],"names":["module","exports","_$breadcrumbTypes_8","_$reduce_17","arr","fn","accum","val","i","len","length","_$filter_12","item","concat","_$includes_13","x","_$isArray_14","obj","Object","prototype","toString","call","_hasDontEnumBug","propertyIsEnumerable","_dontEnums","_$keys_15","prop","result","hasOwnProperty","push","_$intRange_24","min","max","Infinity","value","parseInt","_$listOfFunctions_25","f","_$stringWithLength_26","_$config_5","schema","apiKey","defaultValue","message","validate","appVersion","undefined","appType","autoDetectErrors","enabledErrorTypes","unhandledExceptions","unhandledRejections","allowPartialObject","providedKeys","defaultKeys","k","onError","onSession","onBreadcrumb","endpoints","notify","sessions","autoTrackSessions","enabledReleaseStages","releaseStage","maxBreadcrumbs","enabledBreadcrumbTypes","join","maybeType","context","user","key","metadata","logger","method","redactedKeys","s","test","plugins","p","load","featureFlags","feature","name","_$assign_11","target","arguments","source","_$map_16","_extends","assign","bind","apply","this","_$config_1","window","location","host","console","debug","getPrefixedConsole","consoleLog","log","consoleMethod","_$Breadcrumb_3","Breadcrumb","type","timestamp","Date","toJSON","metaData","_$stackframe_34","root","factory","StackFrame","_isNumber","n","isNaN","parseFloat","isFinite","_capitalize","str","charAt","toUpperCase","substring","_getter","booleanProps","numericProps","stringProps","props","getArgs","args","setArgs","v","TypeError","getEvalOrigin","evalOrigin","setEvalOrigin","getFunctionName","getFileName","getLineNumber","getColumnNumber","Boolean","j","Number","String","_$errorStackParser_31","ErrorStackParser","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","parse","error","stacktrace","parseOpera","stack","match","parseV8OrIE","parseFFOrSafari","Error","extractLocation","urlLike","indexOf","parts","exec","replace","split","filter","line","map","sanitizedLine","tokens","slice","locationParts","pop","functionName","fileName","lineNumber","columnNumber","functionNameRegex","matches","e","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","argsRaw","functionCall","shift","_$errorStackParser_10","_$safeJsonStringify_30","data","replacer","space","opts","redactedPaths","JSON","stringify","seen","edges","visit","path","edgesExceeded","haystack","needle","find","fResult","err","throwsMessage","o","eResult","__isArray_30","aResult","isDescendent","shouldRedact","safelyGetProp","prepareObjForSerialization","paths","patterns","toLowerCase","add","existingFeatures","existingFeatureKeys","variant","existingIndex","_$featureFlagDelegate_18","clear","features","featuresIndex","merge","newFeatures","toEventApi","_ref","flag","featureFlag","_$hasStack_19","_$iserror_20","__clear_22","state","section","_$metadataDelegate_22","keyOrObj","maybeVal","_updates","updates","get","_$stackGenerator_33","StackGenerator","backtrace","maxStackSize","curr","callee","Array","RegExp","$1","caller","Event","errorClass","errorMessage","handledState","originalError","defaultHandledState","groupingHash","_handledState","severity","unhandled","app","device","request","breadcrumbs","threads","_metadata","_features","_featuresIndex","_user","_session","errors","createBugsnagError","__type","_proto","addMetadata","getMetadata","clearMetadata","addFeatureFlag","addFeatureFlags","getFeatureFlags","clearFeatureFlag","clearFeatureFlags","getUser","setUser","id","email","payloadVersion","exceptions","er","severityReason","session","normaliseFunctionName","ensureString","frame","file","code","inProject","formatStackframe","getStacktrace","errorFramesToSkip","backtraceFramesToSkip","create","maybeError","tolerateNonErrors","component","event","_normaliseError","normaliseError","internalFrames","makeSerialisable","cause","_event$errors","causes","getCauseStack","normalisedCauses","createAndLogInputError","reason","verb","warn","hasNecessaryFields","_$Event_6","_$syncCallbackRunner_23","callbacks","callbackArg","callbackType","ignore","cbs","_$pad_29","num","size","substr","env","self","globalCount","mimeTypesLength","navigator","mimeTypes","clientId","userAgent","_$fingerprint_28","c","discreteValues","Math","pow","randomBlock","random","cuid","getTime","fingerprint","_$delivery_36","_$cuid_27","_$Session_35","Session","startedAt","_handled","_unhandled","events","handled","_track","__add_4","__clear_4","__merge_4","noop","Client","configuration","internalPlugins","notifier","_this","_notifier","_config","_schema","_delivery","sendSession","sendEvent","_logger","info","_plugins","_breadcrumbs","_context","_cbs","sp","b","_configure","pl","_loadPlugin","_depth","getContext","setContext","plugin","configSchema","_reduce","config","generateConfigErrorMessage","getPlugin","_setDelivery","d","startSession","version","_sessionDelegate","addOnError","front","removeOnError","_addOnSessionPayload","addOnSession","removeOnSession","addOnBreadcrumb","removeOnBreadcrumb","pauseSession","resumeSession","leaveBreadcrumb","crumb","_isBreadcrumbTypeEnabled","types","postReportCallback","_notify","_this2","originalSeverity","onCallbackError","cb","index","next","_$asyncEvery_7","ret","then","setTimeout","_$callbackRunner_9","shouldSend","unhandledOverridden","rawInput","_$Client_4","_$jsonPayload_21","EVENT_REDACTION_PATHS","payload","client","win","url","getApiUrl","body","req","XDomainRequest","onload","onerror","toFixed","open","send","endpoint","isoDate","matchPageProtocol","protocol","encodeURIComponent","_matchPageProtocol","pageProtocol","_$delivery_37","XMLHttpRequest","onreadystatechange","readyState","DONE","status","setRequestHeader","toISOString","appStart","reset","_$app_38","now","duration","_$pad_43","__env_42","__globalCount_42","__prop_42","__mimeTypesLength_42","__clientId_42","_$fingerprint_42","__c_41","__discreteValues_41","__randomBlock_41","__cuid_41","_$cuid_41","_$device_40","nav","locale","browserLanguage","systemLanguage","userLanguage","language","screen","orientation","document","documentElement","clientWidth","clientHeight","generateAnonymousId","storage","localStorage","getItem","setItem","getDeviceId","collectUserIp","setDefaultUserId","time","eventOrSession","_$request_44","href","_$session_45","sessionDelegate","sessionClient","_pausedSession","_$clientIp_46","clientIp","_$consoleBreadcrumbs_47","CONSOLE_LOG_METHODS","original","_len","_key","arg","stringified","_restore","_$inlineScriptContent_48","doc","trackInlineScripts","originalLocation","html","DOMContentLoaded","attachEvent","getHtml","outerHTML","prev","_lastScript","updateLastScript","script","getCurrentScript","currentScript","scripts","getElementsByTagName","cleanUrl","content","innerHTML","htmlLines","zeroBasedLine","start","end","addSurroundingCode","_setTimeout","__proxy","__traceOriginalScript","eventTargetCallbackAccessor","callbackAccessor","alsoCallOriginal","cba","__trace__","replacement","isEventHandlerObj","handleEvent","_$navigationBreadcrumbs_50","_$interactionBreadcrumbs_49","addEventListener","targetText","targetSelector","el","text","textContent","innerText","trimStart","trimEnd","getNodeSelector","tagName","className","querySelectorAll","parentNode","childNodes","drop","oldURL","from","relativeLocation","to","newURL","getCurrentState","history","replaceState","wrapHistoryFn","pushState","a","createElement","pathname","search","hash","orig","title","currentPath","prevState","stateChangeToMetadata","resetEventCount","_$networkBreadcrumbs_51","_ignoredUrls","ignoredUrls","nativeOpen","requestSetupKey","handleXHRError","handleXHRLoad","removeEventListener","monkeyPatchXMLHttpRequest","fetch","polyfill","oldFetch","_arguments","urlOrRequest","options","Promise","resolve","reject","response","handleFetchSuccess","handleFetchError","monkeyPatchFetch","_$throttle_52","maxEvents","_$stripQueryString_53","strip","allFrames","_strip","_$onerror_54","prevOnError","messageOrEvent","lineNo","charNo","decorateStack","detail","extraParameters","culprit","isActualNumber","errorCharacter","_$unhandledRejection_55","listener","evt","isBluebird","fixBluebirdStacktrace","_event$addMetadata","onunhandledrejection","promise","_$notifier_2","__schema_2","Bugsnag","_client","createClient","bugsnag","isStarted","m","_$src_1","_setPrototypeOf","setPrototypeOf","__proto__","BugsnagPluginReact","globalReact","React","lazy","ErrorBoundary","createClass","createErrorBoundary","BugsnagPluginReactLazyInitializer","formatComponentStack","_React$Component","subClass","superClass","handleClearError","ReferenceError","_assertThisInitialized","constructor","_proto2","setState","componentDidCatch","componentStack","render","FallbackComponent","clearError","children","Component"],"mappings":"8FAAAA,EAAOC,QAAU,EAAQ,yB,qCCA+CD,EAAOC,QAAoP,WAAW,IAC1UC,EAAsB,CAAC,aAAc,UAAW,UAAW,MAAO,OAAQ,QAAS,QAAS,UAG5FC,EAAc,SAAUC,EAAKC,EAAIC,GAEnC,IADA,IAAIC,EAAMD,EACDE,EAAI,EAAGC,EA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AAQY,qBAAuBA,EAC/BZ,EAAiB,QAAIA,EAEdA,EAjIgFxmB","file":"npm.bugsnag.63f8c80e5e846543a6fa.chunk.js","sourcesContent":["module.exports = require('@bugsnag/browser')\n","(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.Bugsnag = f()}})(function(){var define,module,exports;\nvar _$breadcrumbTypes_8 = ['navigation', 'request', 'process', 'log', 'user', 'state', 'error', 'manual'];\n\n// Array#reduce\nvar _$reduce_17 = function (arr, fn, accum) {\n var val = accum;\n for (var i = 0, len = arr.length; i < len; i++) val = fn(val, arr[i], i, arr);\n return val;\n};\n\n/* removed: var _$reduce_17 = require('./reduce'); */;\n\n// Array#filter\nvar _$filter_12 = function (arr, fn) {\n return _$reduce_17(arr, function (accum, item, i, arr) {\n return !fn(item, i, arr) ? accum : accum.concat(item);\n }, []);\n};\n\n/* removed: var _$reduce_17 = require('./reduce'); */;\n// Array#includes\nvar _$includes_13 = function (arr, x) {\n return _$reduce_17(arr, function (accum, item, i, arr) {\n return accum === true || item === x;\n }, false);\n};\n\n// Array#isArray\nvar _$isArray_14 = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n};\n\n/* eslint-disable-next-line no-prototype-builtins */\nvar _hasDontEnumBug = !{\n toString: null\n}.propertyIsEnumerable('toString');\nvar _dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'];\n\n// Object#keys\nvar _$keys_15 = function (obj) {\n // stripped down version of\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/Keys\n var result = [];\n var prop;\n for (prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) result.push(prop);\n }\n if (!_hasDontEnumBug) return result;\n for (var i = 0, len = _dontEnums.length; i < len; i++) {\n if (Object.prototype.hasOwnProperty.call(obj, _dontEnums[i])) result.push(_dontEnums[i]);\n }\n return result;\n};\n\nvar _$intRange_24 = function (min, max) {\n if (min === void 0) {\n min = 1;\n }\n if (max === void 0) {\n max = Infinity;\n }\n return function (value) {\n return typeof value === 'number' && parseInt('' + value, 10) === value && value >= min && value <= max;\n };\n};\n\n/* removed: var _$filter_12 = require('../es-utils/filter'); */;\n/* removed: var _$isArray_14 = require('../es-utils/is-array'); */;\nvar _$listOfFunctions_25 = function (value) {\n return typeof value === 'function' || _$isArray_14(value) && _$filter_12(value, function (f) {\n return typeof f === 'function';\n }).length === value.length;\n};\n\nvar _$stringWithLength_26 = function (value) {\n return typeof value === 'string' && !!value.length;\n};\n\nvar _$config_5 = {};\n/* removed: var _$filter_12 = require('./lib/es-utils/filter'); */;\n/* removed: var _$reduce_17 = require('./lib/es-utils/reduce'); */;\n/* removed: var _$keys_15 = require('./lib/es-utils/keys'); */;\n/* removed: var _$isArray_14 = require('./lib/es-utils/is-array'); */;\n/* removed: var _$includes_13 = require('./lib/es-utils/includes'); */;\n/* removed: var _$intRange_24 = require('./lib/validators/int-range'); */;\n/* removed: var _$stringWithLength_26 = require('./lib/validators/string-with-length'); */;\n/* removed: var _$listOfFunctions_25 = require('./lib/validators/list-of-functions'); */;\n/* removed: var _$breadcrumbTypes_8 = require('./lib/breadcrumb-types'); */;\nvar defaultErrorTypes = function () {\n return {\n unhandledExceptions: true,\n unhandledRejections: true\n };\n};\n_$config_5.schema = {\n apiKey: {\n defaultValue: function () {\n return null;\n },\n message: 'is required',\n validate: _$stringWithLength_26\n },\n appVersion: {\n defaultValue: function () {\n return undefined;\n },\n message: 'should be a string',\n validate: function (value) {\n return value === undefined || _$stringWithLength_26(value);\n }\n },\n appType: {\n defaultValue: function () {\n return undefined;\n },\n message: 'should be a string',\n validate: function (value) {\n return value === undefined || _$stringWithLength_26(value);\n }\n },\n autoDetectErrors: {\n defaultValue: function () {\n return true;\n },\n message: 'should be true|false',\n validate: function (value) {\n return value === true || value === false;\n }\n },\n enabledErrorTypes: {\n defaultValue: function () {\n return defaultErrorTypes();\n },\n message: 'should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }',\n allowPartialObject: true,\n validate: function (value) {\n // ensure we have an object\n if (typeof value !== 'object' || !value) return false;\n var providedKeys = _$keys_15(value);\n var defaultKeys = _$keys_15(defaultErrorTypes());\n // ensure it only has a subset of the allowed keys\n if (_$filter_12(providedKeys, function (k) {\n return _$includes_13(defaultKeys, k);\n }).length < providedKeys.length) return false;\n // ensure all of the values are boolean\n if (_$filter_12(_$keys_15(value), function (k) {\n return typeof value[k] !== 'boolean';\n }).length > 0) return false;\n return true;\n }\n },\n onError: {\n defaultValue: function () {\n return [];\n },\n message: 'should be a function or array of functions',\n validate: _$listOfFunctions_25\n },\n onSession: {\n defaultValue: function () {\n return [];\n },\n message: 'should be a function or array of functions',\n validate: _$listOfFunctions_25\n },\n onBreadcrumb: {\n defaultValue: function () {\n return [];\n },\n message: 'should be a function or array of functions',\n validate: _$listOfFunctions_25\n },\n endpoints: {\n defaultValue: function () {\n return {\n notify: 'https://notify.bugsnag.com',\n sessions: 'https://sessions.bugsnag.com'\n };\n },\n message: 'should be an object containing endpoint URLs { notify, sessions }',\n validate: function (val) {\n return (\n // first, ensure it's an object\n val && typeof val === 'object' &&\n // notify and sessions must always be set\n _$stringWithLength_26(val.notify) && _$stringWithLength_26(val.sessions) &&\n // ensure no keys other than notify/session are set on endpoints object\n _$filter_12(_$keys_15(val), function (k) {\n return !_$includes_13(['notify', 'sessions'], k);\n }).length === 0\n );\n }\n },\n autoTrackSessions: {\n defaultValue: function (val) {\n return true;\n },\n message: 'should be true|false',\n validate: function (val) {\n return val === true || val === false;\n }\n },\n enabledReleaseStages: {\n defaultValue: function () {\n return null;\n },\n message: 'should be an array of strings',\n validate: function (value) {\n return value === null || _$isArray_14(value) && _$filter_12(value, function (f) {\n return typeof f === 'string';\n }).length === value.length;\n }\n },\n releaseStage: {\n defaultValue: function () {\n return 'production';\n },\n message: 'should be a string',\n validate: function (value) {\n return typeof value === 'string' && value.length;\n }\n },\n maxBreadcrumbs: {\n defaultValue: function () {\n return 25;\n },\n message: 'should be a number ≤100',\n validate: function (value) {\n return _$intRange_24(0, 100)(value);\n }\n },\n enabledBreadcrumbTypes: {\n defaultValue: function () {\n return _$breadcrumbTypes_8;\n },\n message: \"should be null or a list of available breadcrumb types (\" + _$breadcrumbTypes_8.join(',') + \")\",\n validate: function (value) {\n return value === null || _$isArray_14(value) && _$reduce_17(value, function (accum, maybeType) {\n if (accum === false) return accum;\n return _$includes_13(_$breadcrumbTypes_8, maybeType);\n }, true);\n }\n },\n context: {\n defaultValue: function () {\n return undefined;\n },\n message: 'should be a string',\n validate: function (value) {\n return value === undefined || typeof value === 'string';\n }\n },\n user: {\n defaultValue: function () {\n return {};\n },\n message: 'should be an object with { id, email, name } properties',\n validate: function (value) {\n return value === null || value && _$reduce_17(_$keys_15(value), function (accum, key) {\n return accum && _$includes_13(['id', 'email', 'name'], key);\n }, true);\n }\n },\n metadata: {\n defaultValue: function () {\n return {};\n },\n message: 'should be an object',\n validate: function (value) {\n return typeof value === 'object' && value !== null;\n }\n },\n logger: {\n defaultValue: function () {\n return undefined;\n },\n message: 'should be null or an object with methods { debug, info, warn, error }',\n validate: function (value) {\n return !value || value && _$reduce_17(['debug', 'info', 'warn', 'error'], function (accum, method) {\n return accum && typeof value[method] === 'function';\n }, true);\n }\n },\n redactedKeys: {\n defaultValue: function () {\n return ['password'];\n },\n message: 'should be an array of strings|regexes',\n validate: function (value) {\n return _$isArray_14(value) && value.length === _$filter_12(value, function (s) {\n return typeof s === 'string' || s && typeof s.test === 'function';\n }).length;\n }\n },\n plugins: {\n defaultValue: function () {\n return [];\n },\n message: 'should be an array of plugin objects',\n validate: function (value) {\n return _$isArray_14(value) && value.length === _$filter_12(value, function (p) {\n return p && typeof p === 'object' && typeof p.load === 'function';\n }).length;\n }\n },\n featureFlags: {\n defaultValue: function () {\n return [];\n },\n message: 'should be an array of objects that have a \"name\" property',\n validate: function (value) {\n return _$isArray_14(value) && value.length === _$filter_12(value, function (feature) {\n return feature && typeof feature === 'object' && typeof feature.name === 'string';\n }).length;\n }\n }\n};\n\n// extends helper from babel\n// https://github.com/babel/babel/blob/916429b516e6466fd06588ee820e40e025d7f3a3/packages/babel-helpers/src/helpers.js#L377-L393\nvar _$assign_11 = function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n};\n\n/* removed: var _$reduce_17 = require('./reduce'); */;\n\n// Array#map\nvar _$map_16 = function (arr, fn) {\n return _$reduce_17(arr, function (accum, item, i, arr) {\n return accum.concat(fn(item, i, arr));\n }, []);\n};\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nvar schema = _$config_5.schema;\n/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$assign_11 = require('@bugsnag/core/lib/es-utils/assign'); */;\nvar _$config_1 = {\n releaseStage: _$assign_11({}, schema.releaseStage, {\n defaultValue: function () {\n if (/^localhost(:\\d+)?$/.test(window.location.host)) return 'development';\n return 'production';\n }\n }),\n appType: _extends({}, schema.appType, {\n defaultValue: function () {\n return 'browser';\n }\n }),\n logger: _$assign_11({}, schema.logger, {\n defaultValue: function () {\n return (\n // set logger based on browser capability\n typeof console !== 'undefined' && typeof console.debug === 'function' ? getPrefixedConsole() : undefined\n );\n }\n })\n};\nvar getPrefixedConsole = function () {\n var logger = {};\n var consoleLog = console.log;\n _$map_16(['debug', 'info', 'warn', 'error'], function (method) {\n var consoleMethod = console[method];\n logger[method] = typeof consoleMethod === 'function' ? consoleMethod.bind(console, '[bugsnag]') : consoleLog.bind(console, '[bugsnag]');\n });\n return logger;\n};\n\nvar Breadcrumb = /*#__PURE__*/function () {\n function Breadcrumb(message, metadata, type, timestamp) {\n if (timestamp === void 0) {\n timestamp = new Date();\n }\n this.type = type;\n this.message = message;\n this.metadata = metadata;\n this.timestamp = timestamp;\n }\n var _proto = Breadcrumb.prototype;\n _proto.toJSON = function toJSON() {\n return {\n type: this.type,\n name: this.message,\n timestamp: this.timestamp,\n metaData: this.metadata\n };\n };\n return Breadcrumb;\n}();\nvar _$Breadcrumb_3 = Breadcrumb;\n\nvar _$stackframe_34 = {};\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof _$stackframe_34 === 'object') {\n _$stackframe_34 = factory();\n } else {\n root.StackFrame = factory();\n }\n})(this, function () {\n 'use strict';\n\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n function _getter(p) {\n return function () {\n return this[p];\n };\n }\n var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel'];\n var numericProps = ['columnNumber', 'lineNumber'];\n var stringProps = ['fileName', 'functionName', 'source'];\n var arrayProps = ['args'];\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n function StackFrame(obj) {\n if (obj instanceof Object) {\n for (var i = 0; i < props.length; i++) {\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\n this['set' + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n }\n StackFrame.prototype = {\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n getEvalOrigin: function () {\n return this.evalOrigin;\n },\n setEvalOrigin: function (v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError('Eval Origin must be an Object or StackFrame');\n }\n },\n toString: function () {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? '@' + this.getFileName() : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? ':' + this.getLineNumber() : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? ':' + this.getColumnNumber() : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype['set' + _capitalize(booleanProps[i])] = function (p) {\n return function (v) {\n this[p] = Boolean(v);\n };\n }(booleanProps[i]);\n }\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype['set' + _capitalize(numericProps[j])] = function (p) {\n return function (v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + ' must be a Number');\n }\n this[p] = Number(v);\n };\n }(numericProps[j]);\n }\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype['set' + _capitalize(stringProps[k])] = function (p) {\n return function (v) {\n this[p] = String(v);\n };\n }(stringProps[k]);\n }\n return StackFrame;\n});\n\nvar _$errorStackParser_31 = {};\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof _$errorStackParser_31 === 'object') {\n _$errorStackParser_31 = factory(_$stackframe_34);\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n})(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n var regExp = /(.+?)(?:\\:(\\d+))?(?:\\:(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[\\(\\)]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n return filtered.map(function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(');\n\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\((.+):(\\d+):(\\d+)\\)$)/);\n\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n var tokens = sanitizedLine.split(/\\s+/).slice(1);\n // if a location was matched, pass it to extractLocation() otherwise pop the last token\n var locationParts = this.extractLocation(location ? location[1] : tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n return filtered.map(function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || e.message.indexOf('\\n') > -1 && e.message.split('\\n').length > e.stacktrace.split('\\n').length) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n return filtered.map(function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = tokens.shift() || '';\n var functionName = functionCall.replace(//, '$2').replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = argsRaw === undefined || argsRaw === '[arguments not available]' ? undefined : argsRaw.split(',');\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n});\n\nvar _$errorStackParser_10 = _$errorStackParser_31;\n\nvar _$safeJsonStringify_30 = function (data, replacer, space, opts) {\n var redactedKeys = opts && opts.redactedKeys ? opts.redactedKeys : [];\n var redactedPaths = opts && opts.redactedPaths ? opts.redactedPaths : [];\n return JSON.stringify(prepareObjForSerialization(data, redactedKeys, redactedPaths), replacer, space);\n};\nvar MAX_DEPTH = 20;\nvar MAX_EDGES = 25000;\nvar MIN_PRESERVED_DEPTH = 8;\nvar REPLACEMENT_NODE = '...';\nfunction isError(o) {\n return o instanceof Error || /^\\[object (Error|(Dom)?Exception)\\]$/.test(Object.prototype.toString.call(o));\n}\nfunction throwsMessage(err) {\n return '[Throws: ' + (err ? err.message : '?') + ']';\n}\nfunction find(haystack, needle) {\n for (var i = 0, len = haystack.length; i < len; i++) {\n if (haystack[i] === needle) return true;\n }\n return false;\n}\n\n// returns true if the string `path` starts with any of the provided `paths`\nfunction isDescendent(paths, path) {\n for (var i = 0, len = paths.length; i < len; i++) {\n if (path.indexOf(paths[i]) === 0) return true;\n }\n return false;\n}\nfunction shouldRedact(patterns, key) {\n for (var i = 0, len = patterns.length; i < len; i++) {\n if (typeof patterns[i] === 'string' && patterns[i].toLowerCase() === key.toLowerCase()) return true;\n if (patterns[i] && typeof patterns[i].test === 'function' && patterns[i].test(key)) return true;\n }\n return false;\n}\nfunction __isArray_30(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n}\nfunction safelyGetProp(obj, prop) {\n try {\n return obj[prop];\n } catch (err) {\n return throwsMessage(err);\n }\n}\nfunction prepareObjForSerialization(obj, redactedKeys, redactedPaths) {\n var seen = []; // store references to objects we have seen before\n var edges = 0;\n function visit(obj, path) {\n function edgesExceeded() {\n return path.length > MIN_PRESERVED_DEPTH && edges > MAX_EDGES;\n }\n edges++;\n if (path.length > MAX_DEPTH) return REPLACEMENT_NODE;\n if (edgesExceeded()) return REPLACEMENT_NODE;\n if (obj === null || typeof obj !== 'object') return obj;\n if (find(seen, obj)) return '[Circular]';\n seen.push(obj);\n if (typeof obj.toJSON === 'function') {\n try {\n // we're not going to count this as an edge because it\n // replaces the value of the currently visited object\n edges--;\n var fResult = visit(obj.toJSON(), path);\n seen.pop();\n return fResult;\n } catch (err) {\n return throwsMessage(err);\n }\n }\n var er = isError(obj);\n if (er) {\n edges--;\n var eResult = visit({\n name: obj.name,\n message: obj.message\n }, path);\n seen.pop();\n return eResult;\n }\n if (__isArray_30(obj)) {\n var aResult = [];\n for (var i = 0, len = obj.length; i < len; i++) {\n if (edgesExceeded()) {\n aResult.push(REPLACEMENT_NODE);\n break;\n }\n aResult.push(visit(obj[i], path.concat('[]')));\n }\n seen.pop();\n return aResult;\n }\n var result = {};\n try {\n for (var prop in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, prop)) continue;\n if (isDescendent(redactedPaths, path.join('.')) && shouldRedact(redactedKeys, prop)) {\n result[prop] = '[REDACTED]';\n continue;\n }\n if (edgesExceeded()) {\n result[prop] = REPLACEMENT_NODE;\n break;\n }\n result[prop] = visit(safelyGetProp(obj, prop), path.concat(prop));\n }\n } catch (e) {}\n seen.pop();\n return result;\n }\n return visit(obj, []);\n}\n\n/* removed: var _$map_16 = require('./es-utils/map'); */;\n/* removed: var _$filter_12 = require('./es-utils/filter'); */;\n/* removed: var _$isArray_14 = require('./es-utils/is-array'); */;\n/* removed: var _$safeJsonStringify_30 = require('@bugsnag/safe-json-stringify'); */;\nfunction add(existingFeatures, existingFeatureKeys, name, variant) {\n if (typeof name !== 'string') {\n return;\n }\n if (variant === undefined) {\n variant = null;\n } else if (variant !== null && typeof variant !== 'string') {\n variant = _$safeJsonStringify_30(variant);\n }\n var existingIndex = existingFeatureKeys[name];\n if (typeof existingIndex === 'number') {\n existingFeatures[existingIndex] = {\n name: name,\n variant: variant\n };\n return;\n }\n existingFeatures.push({\n name: name,\n variant: variant\n });\n existingFeatureKeys[name] = existingFeatures.length - 1;\n}\nfunction merge(existingFeatures, newFeatures, existingFeatureKeys) {\n if (!_$isArray_14(newFeatures)) {\n return;\n }\n for (var i = 0; i < newFeatures.length; ++i) {\n var feature = newFeatures[i];\n if (feature === null || typeof feature !== 'object') {\n continue;\n }\n\n // 'add' will handle if 'name' doesn't exist & 'variant' is optional\n add(existingFeatures, existingFeatureKeys, feature.name, feature.variant);\n }\n return existingFeatures;\n}\n\n// convert feature flags from a map of 'name -> variant' into the format required\n// by the Bugsnag Event API:\n// [{ featureFlag: 'name', variant: 'variant' }, { featureFlag: 'name 2' }]\nfunction toEventApi(featureFlags) {\n return _$map_16(_$filter_12(featureFlags, Boolean), function (_ref) {\n var name = _ref.name,\n variant = _ref.variant;\n var flag = {\n featureFlag: name\n };\n\n // don't add a 'variant' property unless there's actually a value\n if (typeof variant === 'string') {\n flag.variant = variant;\n }\n return flag;\n });\n}\nfunction clear(features, featuresIndex, name) {\n var existingIndex = featuresIndex[name];\n if (typeof existingIndex === 'number') {\n features[existingIndex] = null;\n delete featuresIndex[name];\n }\n}\nvar _$featureFlagDelegate_18 = {\n add: add,\n clear: clear,\n merge: merge,\n toEventApi: toEventApi\n};\n\n// Given `err` which may be an error, does it have a stack property which is a string?\nvar _$hasStack_19 = function (err) {\n return !!err && (!!err.stack || !!err.stacktrace || !!err['opera#sourceloc']) && typeof (err.stack || err.stacktrace || err['opera#sourceloc']) === 'string' && err.stack !== err.name + \": \" + err.message;\n};\n\n/**\n * Expose `isError`.\n */\n\nvar _$isError_32 = __isError_32;\n\n/**\n * Test whether `value` is error object.\n *\n * @param {*} value\n * @returns {boolean}\n */\n\nfunction __isError_32(value) {\n switch (Object.prototype.toString.call(value)) {\n case '[object Error]':\n return true;\n case '[object Exception]':\n return true;\n case '[object DOMException]':\n return true;\n default:\n return value instanceof Error;\n }\n}\n\nvar _$iserror_20 = _$isError_32;\n\n/* removed: var _$assign_11 = require('./es-utils/assign'); */;\nvar __add_22 = function (state, section, keyOrObj, maybeVal) {\n var _updates;\n if (!section) return;\n var updates;\n\n // addMetadata(\"section\", null) -> clears section\n if (keyOrObj === null) return __clear_22(state, section);\n\n // normalise the two supported input types into object form\n if (typeof keyOrObj === 'object') updates = keyOrObj;\n if (typeof keyOrObj === 'string') updates = (_updates = {}, _updates[keyOrObj] = maybeVal, _updates);\n\n // exit if we don't have an updates object at this point\n if (!updates) return;\n\n // ensure a section with this name exists\n if (!state[section]) state[section] = {};\n\n // merge the updates with the existing section\n state[section] = _$assign_11({}, state[section], updates);\n};\nvar get = function (state, section, key) {\n if (typeof section !== 'string') return undefined;\n if (!key) {\n return state[section];\n }\n if (state[section]) {\n return state[section][key];\n }\n return undefined;\n};\nvar __clear_22 = function (state, section, key) {\n if (typeof section !== 'string') return;\n\n // clear an entire section\n if (!key) {\n delete state[section];\n return;\n }\n\n // clear a single value from a section\n if (state[section]) {\n delete state[section][key];\n }\n};\nvar _$metadataDelegate_22 = {\n add: __add_22,\n get: get,\n clear: __clear_22\n};\n\nvar _$stackGenerator_33 = {};\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stack-generator', ['stackframe'], factory);\n } else if (typeof _$stackGenerator_33 === 'object') {\n _$stackGenerator_33 = factory(_$stackframe_34);\n } else {\n root.StackGenerator = factory(root.StackFrame);\n }\n})(this, function (StackFrame) {\n return {\n backtrace: function StackGenerator$$backtrace(opts) {\n var stack = [];\n var maxStackSize = 10;\n if (typeof opts === 'object' && typeof opts.maxStackSize === 'number') {\n maxStackSize = opts.maxStackSize;\n }\n var curr = arguments.callee;\n while (curr && stack.length < maxStackSize && curr['arguments']) {\n // Allow V8 optimizations\n var args = new Array(curr['arguments'].length);\n for (var i = 0; i < args.length; ++i) {\n args[i] = curr['arguments'][i];\n }\n if (/function(?:\\s+([\\w$]+))+\\s*\\(/.test(curr.toString())) {\n stack.push(new StackFrame({\n functionName: RegExp.$1 || undefined,\n args: args\n }));\n } else {\n stack.push(new StackFrame({\n args: args\n }));\n }\n try {\n curr = curr.caller;\n } catch (e) {\n break;\n }\n }\n return stack;\n }\n };\n});\n\n/* removed: var _$errorStackParser_10 = require('./lib/error-stack-parser'); */;\n/* removed: var _$stackGenerator_33 = require('stack-generator'); */;\n/* removed: var _$hasStack_19 = require('./lib/has-stack'); */;\n/* removed: var _$map_16 = require('./lib/es-utils/map'); */;\n/* removed: var _$reduce_17 = require('./lib/es-utils/reduce'); */;\n/* removed: var _$filter_12 = require('./lib/es-utils/filter'); */;\n/* removed: var _$assign_11 = require('./lib/es-utils/assign'); */;\n/* removed: var _$metadataDelegate_22 = require('./lib/metadata-delegate'); */;\n/* removed: var _$featureFlagDelegate_18 = require('./lib/feature-flag-delegate'); */;\n/* removed: var _$iserror_20 = require('./lib/iserror'); */;\nvar Event = /*#__PURE__*/function () {\n function Event(errorClass, errorMessage, stacktrace, handledState, originalError) {\n if (stacktrace === void 0) {\n stacktrace = [];\n }\n if (handledState === void 0) {\n handledState = defaultHandledState();\n }\n this.apiKey = undefined;\n this.context = undefined;\n this.groupingHash = undefined;\n this.originalError = originalError;\n this._handledState = handledState;\n this.severity = this._handledState.severity;\n this.unhandled = this._handledState.unhandled;\n this.app = {};\n this.device = {};\n this.request = {};\n this.breadcrumbs = [];\n this.threads = [];\n this._metadata = {};\n this._features = [];\n this._featuresIndex = {};\n this._user = {};\n this._session = undefined;\n this.errors = [createBugsnagError(errorClass, errorMessage, Event.__type, stacktrace)];\n\n // Flags.\n // Note these are not initialised unless they are used\n // to save unnecessary bytes in the browser bundle\n\n /* this.attemptImmediateDelivery, default: true */\n }\n var _proto = Event.prototype;\n _proto.addMetadata = function addMetadata(section, keyOrObj, maybeVal) {\n return _$metadataDelegate_22.add(this._metadata, section, keyOrObj, maybeVal);\n };\n _proto.getMetadata = function getMetadata(section, key) {\n return _$metadataDelegate_22.get(this._metadata, section, key);\n };\n _proto.clearMetadata = function clearMetadata(section, key) {\n return _$metadataDelegate_22.clear(this._metadata, section, key);\n };\n _proto.addFeatureFlag = function addFeatureFlag(name, variant) {\n if (variant === void 0) {\n variant = null;\n }\n _$featureFlagDelegate_18.add(this._features, this._featuresIndex, name, variant);\n };\n _proto.addFeatureFlags = function addFeatureFlags(featureFlags) {\n _$featureFlagDelegate_18.merge(this._features, featureFlags, this._featuresIndex);\n };\n _proto.getFeatureFlags = function getFeatureFlags() {\n return _$featureFlagDelegate_18.toEventApi(this._features);\n };\n _proto.clearFeatureFlag = function clearFeatureFlag(name) {\n _$featureFlagDelegate_18.clear(this._features, this._featuresIndex, name);\n };\n _proto.clearFeatureFlags = function clearFeatureFlags() {\n this._features = [];\n this._featuresIndex = {};\n };\n _proto.getUser = function getUser() {\n return this._user;\n };\n _proto.setUser = function setUser(id, email, name) {\n this._user = {\n id: id,\n email: email,\n name: name\n };\n };\n _proto.toJSON = function toJSON() {\n return {\n payloadVersion: '4',\n exceptions: _$map_16(this.errors, function (er) {\n return _$assign_11({}, er, {\n message: er.errorMessage\n });\n }),\n severity: this.severity,\n unhandled: this._handledState.unhandled,\n severityReason: this._handledState.severityReason,\n app: this.app,\n device: this.device,\n request: this.request,\n breadcrumbs: this.breadcrumbs,\n context: this.context,\n groupingHash: this.groupingHash,\n metaData: this._metadata,\n user: this._user,\n session: this._session,\n featureFlags: this.getFeatureFlags()\n };\n };\n return Event;\n}(); // takes a stacktrace.js style stackframe (https://github.com/stacktracejs/stackframe)\n// and returns a Bugsnag compatible stackframe (https://docs.bugsnag.com/api/error-reporting/#json-payload)\nvar formatStackframe = function (frame) {\n var f = {\n file: frame.fileName,\n method: normaliseFunctionName(frame.functionName),\n lineNumber: frame.lineNumber,\n columnNumber: frame.columnNumber,\n code: undefined,\n inProject: undefined\n };\n // Some instances result in no file:\n // - calling notify() from chrome's terminal results in no file/method.\n // - non-error exception thrown from global code in FF\n // This adds one.\n if (f.lineNumber > -1 && !f.file && !f.method) {\n f.file = 'global code';\n }\n return f;\n};\nvar normaliseFunctionName = function (name) {\n return /^global code$/i.test(name) ? 'global code' : name;\n};\nvar defaultHandledState = function () {\n return {\n unhandled: false,\n severity: 'warning',\n severityReason: {\n type: 'handledException'\n }\n };\n};\nvar ensureString = function (str) {\n return typeof str === 'string' ? str : '';\n};\nfunction createBugsnagError(errorClass, errorMessage, type, stacktrace) {\n return {\n errorClass: ensureString(errorClass),\n errorMessage: ensureString(errorMessage),\n type: type,\n stacktrace: _$reduce_17(stacktrace, function (accum, frame) {\n var f = formatStackframe(frame);\n // don't include a stackframe if none of its properties are defined\n try {\n if (JSON.stringify(f) === '{}') return accum;\n return accum.concat(f);\n } catch (e) {\n return accum;\n }\n }, [])\n };\n}\nfunction getCauseStack(error) {\n if (error.cause) {\n return [error].concat(getCauseStack(error.cause));\n } else {\n return [error];\n }\n}\n\n// Helpers\n\nEvent.getStacktrace = function (error, errorFramesToSkip, backtraceFramesToSkip) {\n if (_$hasStack_19(error)) return _$errorStackParser_10.parse(error).slice(errorFramesToSkip);\n // error wasn't provided or didn't have a stacktrace so try to walk the callstack\n try {\n return _$filter_12(_$stackGenerator_33.backtrace(), function (frame) {\n return (frame.functionName || '').indexOf('StackGenerator$$') === -1;\n }).slice(1 + backtraceFramesToSkip);\n } catch (e) {\n return [];\n }\n};\nEvent.create = function (maybeError, tolerateNonErrors, handledState, component, errorFramesToSkip, logger) {\n if (errorFramesToSkip === void 0) {\n errorFramesToSkip = 0;\n }\n var _normaliseError = normaliseError(maybeError, tolerateNonErrors, component, logger),\n error = _normaliseError[0],\n internalFrames = _normaliseError[1];\n var event;\n try {\n var stacktrace = Event.getStacktrace(error,\n // if an error was created/throw in the normaliseError() function, we need to\n // tell the getStacktrace() function to skip the number of frames we know will\n // be from our own functions. This is added to the number of frames deep we\n // were told about\n internalFrames > 0 ? 1 + internalFrames + errorFramesToSkip : 0,\n // if there's no stacktrace, the callstack may be walked to generated one.\n // this is how many frames should be removed because they come from our library\n 1 + errorFramesToSkip);\n event = new Event(error.name, error.message, stacktrace, handledState, maybeError);\n } catch (e) {\n event = new Event(error.name, error.message, [], handledState, maybeError);\n }\n if (error.name === 'InvalidError') {\n event.addMetadata(\"\" + component, 'non-error parameter', makeSerialisable(maybeError));\n }\n if (error.cause) {\n var _event$errors;\n var causes = getCauseStack(error).slice(1);\n var normalisedCauses = _$map_16(causes, function (cause) {\n // Only get stacktrace for error causes that are a valid JS Error and already have a stack\n var stacktrace = _$iserror_20(cause) && _$hasStack_19(cause) ? _$errorStackParser_10.parse(cause) : [];\n var _normaliseError2 = normaliseError(cause, true, 'error cause'),\n error = _normaliseError2[0];\n if (error.name === 'InvalidError') event.addMetadata('error cause', makeSerialisable(cause));\n return createBugsnagError(error.name, error.message, Event.__type, stacktrace);\n });\n (_event$errors = event.errors).push.apply(_event$errors, normalisedCauses);\n }\n return event;\n};\nvar makeSerialisable = function (err) {\n if (err === null) return 'null';\n if (err === undefined) return 'undefined';\n return err;\n};\nvar normaliseError = function (maybeError, tolerateNonErrors, component, logger) {\n var error;\n var internalFrames = 0;\n var createAndLogInputError = function (reason) {\n var verb = component === 'error cause' ? 'was' : 'received';\n if (logger) logger.warn(component + \" \" + verb + \" a non-error: \\\"\" + reason + \"\\\"\");\n var err = new Error(component + \" \" + verb + \" a non-error. See \\\"\" + component + \"\\\" tab for more detail.\");\n err.name = 'InvalidError';\n return err;\n };\n\n // In some cases:\n //\n // - the promise rejection handler (both in the browser and node)\n // - the node uncaughtException handler\n //\n // We are really limited in what we can do to get a stacktrace. So we use the\n // tolerateNonErrors option to ensure that the resulting error communicates as\n // such.\n if (!tolerateNonErrors) {\n if (_$iserror_20(maybeError)) {\n error = maybeError;\n } else {\n error = createAndLogInputError(typeof maybeError);\n internalFrames += 2;\n }\n } else {\n switch (typeof maybeError) {\n case 'string':\n case 'number':\n case 'boolean':\n error = new Error(String(maybeError));\n internalFrames += 1;\n break;\n case 'function':\n error = createAndLogInputError('function');\n internalFrames += 2;\n break;\n case 'object':\n if (maybeError !== null && _$iserror_20(maybeError)) {\n error = maybeError;\n } else if (maybeError !== null && hasNecessaryFields(maybeError)) {\n error = new Error(maybeError.message || maybeError.errorMessage);\n error.name = maybeError.name || maybeError.errorClass;\n internalFrames += 1;\n } else {\n error = createAndLogInputError(maybeError === null ? 'null' : 'unsupported object');\n internalFrames += 2;\n }\n break;\n default:\n error = createAndLogInputError('nothing');\n internalFrames += 2;\n }\n }\n if (!_$hasStack_19(error)) {\n // in IE10/11 a new Error() doesn't have a stacktrace until you throw it, so try that here\n try {\n throw error;\n } catch (e) {\n if (_$hasStack_19(e)) {\n error = e;\n // if the error only got a stacktrace after we threw it here, we know it\n // will only have one extra internal frame from this function, regardless\n // of whether it went through createAndLogInputError() or not\n internalFrames = 1;\n }\n }\n }\n return [error, internalFrames];\n};\n\n// default value for stacktrace.type\nEvent.__type = 'browserjs';\nvar hasNecessaryFields = function (error) {\n return (typeof error.name === 'string' || typeof error.errorClass === 'string') && (typeof error.message === 'string' || typeof error.errorMessage === 'string');\n};\nvar _$Event_6 = Event;\n\n// This is a heavily modified/simplified version of\n// https://github.com/othiym23/async-some\n// with the logic flipped so that it is akin to the\n// synchronous \"every\" method instead of \"some\".\n\n// run the asynchronous test function (fn) over each item in the array (arr)\n// in series until:\n// - fn(item, cb) => calls cb(null, false)\n// - or the end of the array is reached\n// the callback (cb) will be passed (null, false) if any of the items in arr\n// caused fn to call back with false, otherwise it will be passed (null, true)\nvar _$asyncEvery_7 = function (arr, fn, cb) {\n var index = 0;\n var next = function () {\n if (index >= arr.length) return cb(null, true);\n fn(arr[index], function (err, result) {\n if (err) return cb(err);\n if (result === false) return cb(null, false);\n index++;\n next();\n });\n };\n next();\n};\n\n/* removed: var _$asyncEvery_7 = require('./async-every'); */;\nvar _$callbackRunner_9 = function (callbacks, event, onCallbackError, cb) {\n // This function is how we support different kinds of callback:\n // - synchronous - return value\n // - node-style async with callback - cb(err, value)\n // - promise/thenable - resolve(value)\n // It normalises each of these into the lowest common denominator – a node-style callback\n var runMaybeAsyncCallback = function (fn, cb) {\n if (typeof fn !== 'function') return cb(null);\n try {\n // if function appears sync…\n if (fn.length !== 2) {\n var ret = fn(event);\n // check if it returned a \"thenable\" (promise)\n if (ret && typeof ret.then === 'function') {\n return ret.then(\n // resolve\n function (val) {\n return setTimeout(function () {\n return cb(null, val);\n });\n },\n // reject\n function (err) {\n setTimeout(function () {\n onCallbackError(err);\n return cb(null, true);\n });\n });\n }\n return cb(null, ret);\n }\n // if function is async…\n fn(event, function (err, result) {\n if (err) {\n onCallbackError(err);\n return cb(null);\n }\n cb(null, result);\n });\n } catch (e) {\n onCallbackError(e);\n cb(null);\n }\n };\n _$asyncEvery_7(callbacks, runMaybeAsyncCallback, cb);\n};\n\nvar _$syncCallbackRunner_23 = function (callbacks, callbackArg, callbackType, logger) {\n var ignore = false;\n var cbs = callbacks.slice();\n while (!ignore) {\n if (!cbs.length) break;\n try {\n ignore = cbs.pop()(callbackArg) === false;\n } catch (e) {\n logger.error(\"Error occurred in \" + callbackType + \" callback, continuing anyway\\u2026\");\n logger.error(e);\n }\n }\n return ignore;\n};\n\nvar _$pad_29 = function pad(num, size) {\n var s = '000000000' + num;\n return s.substr(s.length - size);\n};\n\n/* removed: var _$pad_29 = require('./pad.js'); */;\nvar env = typeof window === 'object' ? window : self;\nvar globalCount = 0;\nfor (var prop in env) {\n if (Object.hasOwnProperty.call(env, prop)) globalCount++;\n}\nvar mimeTypesLength = navigator.mimeTypes ? navigator.mimeTypes.length : 0;\nvar clientId = _$pad_29((mimeTypesLength + navigator.userAgent.length).toString(36) + globalCount.toString(36), 4);\nvar _$fingerprint_28 = function fingerprint() {\n return clientId;\n};\n\n/**\n * cuid.js\n * Collision-resistant UID generator for browsers and node.\n * Sequential for fast db lookups and recency sorting.\n * Safe for element IDs and server-side lookups.\n *\n * Extracted from CLCTR\n *\n * Copyright (c) Eric Elliott 2012\n * MIT License\n */\n\n/* removed: var _$fingerprint_28 = require('./lib/fingerprint.js'); */;\n/* removed: var _$pad_29 = require('./lib/pad.js'); */;\nvar c = 0,\n blockSize = 4,\n base = 36,\n discreteValues = Math.pow(base, blockSize);\nfunction randomBlock() {\n return _$pad_29((Math.random() * discreteValues << 0).toString(base), blockSize);\n}\nfunction safeCounter() {\n c = c < discreteValues ? c : 0;\n c++; // this is not subliminal\n return c - 1;\n}\nfunction cuid() {\n // Starting with a lowercase letter makes\n // it HTML element ID friendly.\n var letter = 'c',\n // hard-coded allows for sequential access\n\n // timestamp\n // warning: this exposes the exact date and time\n // that the uid was created.\n timestamp = new Date().getTime().toString(base),\n // Prevent same-machine collisions.\n counter = _$pad_29(safeCounter().toString(base), blockSize),\n // A few chars to generate distinct ids for different\n // clients (so different computers are far less\n // likely to generate the same id)\n print = _$fingerprint_28(),\n // Grab some more chars from Math.random()\n random = randomBlock() + randomBlock();\n return letter + timestamp + counter + print + random;\n}\ncuid.fingerprint = _$fingerprint_28;\nvar _$cuid_27 = cuid;\n\n/* removed: var _$cuid_27 = require('@bugsnag/cuid'); */;\nvar Session = /*#__PURE__*/function () {\n function Session() {\n this.id = _$cuid_27();\n this.startedAt = new Date();\n this._handled = 0;\n this._unhandled = 0;\n this._user = {};\n this.app = {};\n this.device = {};\n }\n var _proto = Session.prototype;\n _proto.getUser = function getUser() {\n return this._user;\n };\n _proto.setUser = function setUser(id, email, name) {\n this._user = {\n id: id,\n email: email,\n name: name\n };\n };\n _proto.toJSON = function toJSON() {\n return {\n id: this.id,\n startedAt: this.startedAt,\n events: {\n handled: this._handled,\n unhandled: this._unhandled\n }\n };\n };\n _proto._track = function _track(event) {\n this[event._handledState.unhandled ? '_unhandled' : '_handled'] += 1;\n };\n return Session;\n}();\nvar _$Session_35 = Session;\n\n/* removed: var _$config_5 = require('./config'); */;\n/* removed: var _$Event_6 = require('./event'); */;\n/* removed: var _$Breadcrumb_3 = require('./breadcrumb'); */;\n/* removed: var _$Session_35 = require('./session'); */;\n/* removed: var _$map_16 = require('./lib/es-utils/map'); */;\n/* removed: var _$includes_13 = require('./lib/es-utils/includes'); */;\n/* removed: var _$filter_12 = require('./lib/es-utils/filter'); */;\n/* removed: var _$reduce_17 = require('./lib/es-utils/reduce'); */;\n/* removed: var _$keys_15 = require('./lib/es-utils/keys'); */;\n/* removed: var _$assign_11 = require('./lib/es-utils/assign'); */;\n/* removed: var _$callbackRunner_9 = require('./lib/callback-runner'); */;\n/* removed: var _$metadataDelegate_22 = require('./lib/metadata-delegate'); */;\n/* removed: var _$syncCallbackRunner_23 = require('./lib/sync-callback-runner'); */;\n/* removed: var _$breadcrumbTypes_8 = require('./lib/breadcrumb-types'); */;\nvar __add_4 = _$featureFlagDelegate_18.add,\n __clear_4 = _$featureFlagDelegate_18.clear,\n __merge_4 = _$featureFlagDelegate_18.merge;\nvar noop = function () {};\nvar Client = /*#__PURE__*/function () {\n function Client(configuration, schema, internalPlugins, notifier) {\n var _this = this;\n if (schema === void 0) {\n schema = _$config_5.schema;\n }\n if (internalPlugins === void 0) {\n internalPlugins = [];\n }\n // notifier id\n this._notifier = notifier;\n\n // intialise opts and config\n this._config = {};\n this._schema = schema;\n\n // i/o\n this._delivery = {\n sendSession: noop,\n sendEvent: noop\n };\n this._logger = {\n debug: noop,\n info: noop,\n warn: noop,\n error: noop\n };\n\n // plugins\n this._plugins = {};\n\n // state\n this._breadcrumbs = [];\n this._session = null;\n this._metadata = {};\n this._featuresIndex = {};\n this._features = [];\n this._context = undefined;\n this._user = {};\n\n // callbacks:\n // e: onError\n // s: onSession\n // sp: onSessionPayload\n // b: onBreadcrumb\n // (note these names are minified by hand because object\n // properties are not safe to minify automatically)\n this._cbs = {\n e: [],\n s: [],\n sp: [],\n b: []\n };\n\n // expose internal constructors\n this.Client = Client;\n this.Event = _$Event_6;\n this.Breadcrumb = _$Breadcrumb_3;\n this.Session = _$Session_35;\n this._config = this._configure(configuration, internalPlugins);\n _$map_16(internalPlugins.concat(this._config.plugins), function (pl) {\n if (pl) _this._loadPlugin(pl);\n });\n\n // when notify() is called we need to know how many frames are from our own source\n // this inital value is 1 not 0 because we wrap notify() to ensure it is always\n // bound to have the client as its `this` value – see below.\n this._depth = 1;\n var self = this;\n var notify = this.notify;\n this.notify = function () {\n return notify.apply(self, arguments);\n };\n }\n var _proto = Client.prototype;\n _proto.addMetadata = function addMetadata(section, keyOrObj, maybeVal) {\n return _$metadataDelegate_22.add(this._metadata, section, keyOrObj, maybeVal);\n };\n _proto.getMetadata = function getMetadata(section, key) {\n return _$metadataDelegate_22.get(this._metadata, section, key);\n };\n _proto.clearMetadata = function clearMetadata(section, key) {\n return _$metadataDelegate_22.clear(this._metadata, section, key);\n };\n _proto.addFeatureFlag = function addFeatureFlag(name, variant) {\n if (variant === void 0) {\n variant = null;\n }\n __add_4(this._features, this._featuresIndex, name, variant);\n };\n _proto.addFeatureFlags = function addFeatureFlags(featureFlags) {\n __merge_4(this._features, featureFlags, this._featuresIndex);\n };\n _proto.clearFeatureFlag = function clearFeatureFlag(name) {\n __clear_4(this._features, this._featuresIndex, name);\n };\n _proto.clearFeatureFlags = function clearFeatureFlags() {\n this._features = [];\n this._featuresIndex = {};\n };\n _proto.getContext = function getContext() {\n return this._context;\n };\n _proto.setContext = function setContext(c) {\n this._context = c;\n };\n _proto._configure = function _configure(opts, internalPlugins) {\n var schema = _$reduce_17(internalPlugins, function (schema, plugin) {\n if (plugin && plugin.configSchema) return _$assign_11({}, schema, plugin.configSchema);\n return schema;\n }, this._schema);\n\n // accumulate configuration and error messages\n var _reduce = _$reduce_17(_$keys_15(schema), function (accum, key) {\n var defaultValue = schema[key].defaultValue(opts[key]);\n if (opts[key] !== undefined) {\n var valid = schema[key].validate(opts[key]);\n if (!valid) {\n accum.errors[key] = schema[key].message;\n accum.config[key] = defaultValue;\n } else {\n if (schema[key].allowPartialObject) {\n accum.config[key] = _$assign_11(defaultValue, opts[key]);\n } else {\n accum.config[key] = opts[key];\n }\n }\n } else {\n accum.config[key] = defaultValue;\n }\n return accum;\n }, {\n errors: {},\n config: {}\n }),\n errors = _reduce.errors,\n config = _reduce.config;\n if (schema.apiKey) {\n // missing api key is the only fatal error\n if (!config.apiKey) throw new Error('No Bugsnag API Key set');\n // warn about an apikey that is not of the expected format\n if (!/^[0-9a-f]{32}$/i.test(config.apiKey)) errors.apiKey = 'should be a string of 32 hexadecimal characters';\n }\n\n // update and elevate some options\n this._metadata = _$assign_11({}, config.metadata);\n __merge_4(this._features, config.featureFlags, this._featuresIndex);\n this._user = _$assign_11({}, config.user);\n this._context = config.context;\n if (config.logger) this._logger = config.logger;\n\n // add callbacks\n if (config.onError) this._cbs.e = this._cbs.e.concat(config.onError);\n if (config.onBreadcrumb) this._cbs.b = this._cbs.b.concat(config.onBreadcrumb);\n if (config.onSession) this._cbs.s = this._cbs.s.concat(config.onSession);\n\n // finally warn about any invalid config where we fell back to the default\n if (_$keys_15(errors).length) {\n this._logger.warn(generateConfigErrorMessage(errors, opts));\n }\n return config;\n };\n _proto.getUser = function getUser() {\n return this._user;\n };\n _proto.setUser = function setUser(id, email, name) {\n this._user = {\n id: id,\n email: email,\n name: name\n };\n };\n _proto._loadPlugin = function _loadPlugin(plugin) {\n var result = plugin.load(this);\n // JS objects are not the safest way to store arbitrarily keyed values,\n // so bookend the key with some characters that prevent tampering with\n // stuff like __proto__ etc. (only store the result if the plugin had a\n // name)\n if (plugin.name) this._plugins[\"~\" + plugin.name + \"~\"] = result;\n return this;\n };\n _proto.getPlugin = function getPlugin(name) {\n return this._plugins[\"~\" + name + \"~\"];\n };\n _proto._setDelivery = function _setDelivery(d) {\n this._delivery = d(this);\n };\n _proto.startSession = function startSession() {\n var session = new _$Session_35();\n session.app.releaseStage = this._config.releaseStage;\n session.app.version = this._config.appVersion;\n session.app.type = this._config.appType;\n session._user = _$assign_11({}, this._user);\n\n // run onSession callbacks\n var ignore = _$syncCallbackRunner_23(this._cbs.s, session, 'onSession', this._logger);\n if (ignore) {\n this._logger.debug('Session not started due to onSession callback');\n return this;\n }\n return this._sessionDelegate.startSession(this, session);\n };\n _proto.addOnError = function addOnError(fn, front) {\n if (front === void 0) {\n front = false;\n }\n this._cbs.e[front ? 'unshift' : 'push'](fn);\n };\n _proto.removeOnError = function removeOnError(fn) {\n this._cbs.e = _$filter_12(this._cbs.e, function (f) {\n return f !== fn;\n });\n };\n _proto._addOnSessionPayload = function _addOnSessionPayload(fn) {\n this._cbs.sp.push(fn);\n };\n _proto.addOnSession = function addOnSession(fn) {\n this._cbs.s.push(fn);\n };\n _proto.removeOnSession = function removeOnSession(fn) {\n this._cbs.s = _$filter_12(this._cbs.s, function (f) {\n return f !== fn;\n });\n };\n _proto.addOnBreadcrumb = function addOnBreadcrumb(fn, front) {\n if (front === void 0) {\n front = false;\n }\n this._cbs.b[front ? 'unshift' : 'push'](fn);\n };\n _proto.removeOnBreadcrumb = function removeOnBreadcrumb(fn) {\n this._cbs.b = _$filter_12(this._cbs.b, function (f) {\n return f !== fn;\n });\n };\n _proto.pauseSession = function pauseSession() {\n return this._sessionDelegate.pauseSession(this);\n };\n _proto.resumeSession = function resumeSession() {\n return this._sessionDelegate.resumeSession(this);\n };\n _proto.leaveBreadcrumb = function leaveBreadcrumb(message, metadata, type) {\n // coerce bad values so that the defaults get set\n message = typeof message === 'string' ? message : '';\n type = typeof type === 'string' && _$includes_13(_$breadcrumbTypes_8, type) ? type : 'manual';\n metadata = typeof metadata === 'object' && metadata !== null ? metadata : {};\n\n // if no message, discard\n if (!message) return;\n var crumb = new _$Breadcrumb_3(message, metadata, type);\n\n // run onBreadcrumb callbacks\n var ignore = _$syncCallbackRunner_23(this._cbs.b, crumb, 'onBreadcrumb', this._logger);\n if (ignore) {\n this._logger.debug('Breadcrumb not attached due to onBreadcrumb callback');\n return;\n }\n\n // push the valid crumb onto the queue and maintain the length\n this._breadcrumbs.push(crumb);\n if (this._breadcrumbs.length > this._config.maxBreadcrumbs) {\n this._breadcrumbs = this._breadcrumbs.slice(this._breadcrumbs.length - this._config.maxBreadcrumbs);\n }\n };\n _proto._isBreadcrumbTypeEnabled = function _isBreadcrumbTypeEnabled(type) {\n var types = this._config.enabledBreadcrumbTypes;\n return types === null || _$includes_13(types, type);\n };\n _proto.notify = function notify(maybeError, onError, postReportCallback) {\n if (postReportCallback === void 0) {\n postReportCallback = noop;\n }\n var event = _$Event_6.create(maybeError, true, undefined, 'notify()', this._depth + 1, this._logger);\n this._notify(event, onError, postReportCallback);\n };\n _proto._notify = function _notify(event, onError, postReportCallback) {\n var _this2 = this;\n if (postReportCallback === void 0) {\n postReportCallback = noop;\n }\n event.app = _$assign_11({}, event.app, {\n releaseStage: this._config.releaseStage,\n version: this._config.appVersion,\n type: this._config.appType\n });\n event.context = event.context || this._context;\n event._metadata = _$assign_11({}, event._metadata, this._metadata);\n event._user = _$assign_11({}, event._user, this._user);\n event.breadcrumbs = this._breadcrumbs.slice();\n __merge_4(event._features, this._features, event._featuresIndex);\n\n // exit early if events should not be sent on the current releaseStage\n if (this._config.enabledReleaseStages !== null && !_$includes_13(this._config.enabledReleaseStages, this._config.releaseStage)) {\n this._logger.warn('Event not sent due to releaseStage/enabledReleaseStages configuration');\n return postReportCallback(null, event);\n }\n var originalSeverity = event.severity;\n var onCallbackError = function (err) {\n // errors in callbacks are tolerated but we want to log them out\n _this2._logger.error('Error occurred in onError callback, continuing anyway…');\n _this2._logger.error(err);\n };\n var callbacks = [].concat(this._cbs.e).concat(onError);\n _$callbackRunner_9(callbacks, event, onCallbackError, function (err, shouldSend) {\n if (err) onCallbackError(err);\n if (!shouldSend) {\n _this2._logger.debug('Event not sent due to onError callback');\n return postReportCallback(null, event);\n }\n if (_this2._isBreadcrumbTypeEnabled('error')) {\n // only leave a crumb for the error if actually got sent\n Client.prototype.leaveBreadcrumb.call(_this2, event.errors[0].errorClass, {\n errorClass: event.errors[0].errorClass,\n errorMessage: event.errors[0].errorMessage,\n severity: event.severity\n }, 'error');\n }\n if (originalSeverity !== event.severity) {\n event._handledState.severityReason = {\n type: 'userCallbackSetSeverity'\n };\n }\n if (event.unhandled !== event._handledState.unhandled) {\n event._handledState.severityReason.unhandledOverridden = true;\n event._handledState.unhandled = event.unhandled;\n }\n if (_this2._session) {\n _this2._session._track(event);\n event._session = _this2._session;\n }\n _this2._delivery.sendEvent({\n apiKey: event.apiKey || _this2._config.apiKey,\n notifier: _this2._notifier,\n events: [event]\n }, function (err) {\n return postReportCallback(err, event);\n });\n });\n };\n return Client;\n}();\nvar generateConfigErrorMessage = function (errors, rawInput) {\n var er = new Error(\"Invalid configuration\\n\" + _$map_16(_$keys_15(errors), function (key) {\n return \" - \" + key + \" \" + errors[key] + \", got \" + stringify(rawInput[key]);\n }).join('\\n\\n'));\n return er;\n};\nvar stringify = function (val) {\n switch (typeof val) {\n case 'string':\n case 'number':\n case 'object':\n return JSON.stringify(val);\n default:\n return String(val);\n }\n};\nvar _$Client_4 = Client;\n\nvar _$jsonPayload_21 = {};\n/* removed: var _$safeJsonStringify_30 = require('@bugsnag/safe-json-stringify'); */;\nvar EVENT_REDACTION_PATHS = ['events.[].metaData', 'events.[].breadcrumbs.[].metaData', 'events.[].request'];\n_$jsonPayload_21.event = function (event, redactedKeys) {\n var payload = _$safeJsonStringify_30(event, null, null, {\n redactedPaths: EVENT_REDACTION_PATHS,\n redactedKeys: redactedKeys\n });\n if (payload.length > 10e5) {\n event.events[0]._metadata = {\n notifier: \"WARNING!\\nSerialized payload was \" + payload.length / 10e5 + \"MB (limit = 1MB)\\nmetadata was removed\"\n };\n payload = _$safeJsonStringify_30(event, null, null, {\n redactedPaths: EVENT_REDACTION_PATHS,\n redactedKeys: redactedKeys\n });\n }\n return payload;\n};\n_$jsonPayload_21.session = function (session, redactedKeys) {\n var payload = _$safeJsonStringify_30(session, null, null);\n return payload;\n};\n\nvar _$delivery_36 = {};\n/* removed: var _$jsonPayload_21 = require('@bugsnag/core/lib/json-payload'); */;\n_$delivery_36 = function (client, win) {\n if (win === void 0) {\n win = window;\n }\n return {\n sendEvent: function (event, cb) {\n if (cb === void 0) {\n cb = function () {};\n }\n var url = getApiUrl(client._config, 'notify', '4', win);\n var body = _$jsonPayload_21.event(event, client._config.redactedKeys);\n var req = new win.XDomainRequest();\n req.onload = function () {\n cb(null);\n };\n req.onerror = function () {\n var err = new Error('Event failed to send');\n client._logger.error('Event failed to send…', err);\n if (body.length > 10e5) {\n client._logger.warn(\"Event oversized (\" + (body.length / 10e5).toFixed(2) + \" MB)\");\n }\n cb(err);\n };\n req.open('POST', url);\n setTimeout(function () {\n try {\n req.send(body);\n } catch (e) {\n client._logger.error(e);\n cb(e);\n }\n }, 0);\n },\n sendSession: function (session, cb) {\n if (cb === void 0) {\n cb = function () {};\n }\n var url = getApiUrl(client._config, 'sessions', '1', win);\n var req = new win.XDomainRequest();\n req.onload = function () {\n cb(null);\n };\n req.open('POST', url);\n setTimeout(function () {\n try {\n req.send(_$jsonPayload_21.session(session, client._config.redactedKeys));\n } catch (e) {\n client._logger.error(e);\n cb(e);\n }\n }, 0);\n }\n };\n};\nvar getApiUrl = function (config, endpoint, version, win) {\n // IE8 doesn't support Date.prototype.toISOstring(), but it does convert a date\n // to an ISO string when you use JSON stringify. Simply parsing the result of\n // JSON.stringify is smaller than using a toISOstring() polyfill.\n var isoDate = JSON.parse(JSON.stringify(new Date()));\n var url = matchPageProtocol(config.endpoints[endpoint], win.location.protocol);\n return url + \"?apiKey=\" + encodeURIComponent(config.apiKey) + \"&payloadVersion=\" + version + \"&sentAt=\" + encodeURIComponent(isoDate);\n};\nvar matchPageProtocol = _$delivery_36._matchPageProtocol = function (endpoint, pageProtocol) {\n return pageProtocol === 'http:' ? endpoint.replace(/^https:/, 'http:') : endpoint;\n};\n\n/* removed: var _$jsonPayload_21 = require('@bugsnag/core/lib/json-payload'); */;\nvar _$delivery_37 = function (client, win) {\n if (win === void 0) {\n win = window;\n }\n return {\n sendEvent: function (event, cb) {\n if (cb === void 0) {\n cb = function () {};\n }\n try {\n var url = client._config.endpoints.notify;\n var req = new win.XMLHttpRequest();\n var body = _$jsonPayload_21.event(event, client._config.redactedKeys);\n req.onreadystatechange = function () {\n if (req.readyState === win.XMLHttpRequest.DONE) {\n var status = req.status;\n if (status === 0 || status >= 400) {\n var err = new Error(\"Request failed with status \" + status);\n client._logger.error('Event failed to send…', err);\n if (body.length > 10e5) {\n client._logger.warn(\"Event oversized (\" + (body.length / 10e5).toFixed(2) + \" MB)\");\n }\n cb(err);\n } else {\n cb(null);\n }\n }\n };\n req.open('POST', url);\n req.setRequestHeader('Content-Type', 'application/json');\n req.setRequestHeader('Bugsnag-Api-Key', event.apiKey || client._config.apiKey);\n req.setRequestHeader('Bugsnag-Payload-Version', '4');\n req.setRequestHeader('Bugsnag-Sent-At', new Date().toISOString());\n req.send(body);\n } catch (e) {\n client._logger.error(e);\n }\n },\n sendSession: function (session, cb) {\n if (cb === void 0) {\n cb = function () {};\n }\n try {\n var url = client._config.endpoints.sessions;\n var req = new win.XMLHttpRequest();\n req.onreadystatechange = function () {\n if (req.readyState === win.XMLHttpRequest.DONE) {\n var status = req.status;\n if (status === 0 || status >= 400) {\n var err = new Error(\"Request failed with status \" + status);\n client._logger.error('Session failed to send…', err);\n cb(err);\n } else {\n cb(null);\n }\n }\n };\n req.open('POST', url);\n req.setRequestHeader('Content-Type', 'application/json');\n req.setRequestHeader('Bugsnag-Api-Key', client._config.apiKey);\n req.setRequestHeader('Bugsnag-Payload-Version', '1');\n req.setRequestHeader('Bugsnag-Sent-At', new Date().toISOString());\n req.send(_$jsonPayload_21.session(session, client._config.redactedKeys));\n } catch (e) {\n client._logger.error(e);\n }\n }\n };\n};\n\nvar appStart = new Date();\nvar reset = function () {\n appStart = new Date();\n};\nvar _$app_38 = {\n name: 'appDuration',\n load: function (client) {\n client.addOnError(function (event) {\n var now = new Date();\n event.app.duration = now - appStart;\n }, true);\n return {\n reset: reset\n };\n }\n};\n\n/*\n * Sets the default context to be the current URL\n */\nvar _$context_39 = function (win) {\n if (win === void 0) {\n win = window;\n }\n return {\n load: function (client) {\n client.addOnError(function (event) {\n if (event.context !== undefined) return;\n event.context = win.location.pathname;\n }, true);\n }\n };\n};\n\nvar _$pad_43 = function pad(num, size) {\n var s = '000000000' + num;\n return s.substr(s.length - size);\n};\n\n/* removed: var _$pad_43 = require('./pad.js'); */;\nvar __env_42 = typeof window === 'object' ? window : self;\nvar __globalCount_42 = 0;\nfor (var __prop_42 in __env_42) {\n if (Object.hasOwnProperty.call(__env_42, __prop_42)) __globalCount_42++;\n}\nvar __mimeTypesLength_42 = navigator.mimeTypes ? navigator.mimeTypes.length : 0;\nvar __clientId_42 = _$pad_43((__mimeTypesLength_42 + navigator.userAgent.length).toString(36) + __globalCount_42.toString(36), 4);\nvar _$fingerprint_42 = function fingerprint() {\n return __clientId_42;\n};\n\n/**\n * cuid.js\n * Collision-resistant UID generator for browsers and node.\n * Sequential for fast db lookups and recency sorting.\n * Safe for element IDs and server-side lookups.\n *\n * Extracted from CLCTR\n *\n * Copyright (c) Eric Elliott 2012\n * MIT License\n */\n\n/* removed: var _$fingerprint_42 = require('./lib/fingerprint.js'); */;\n/* removed: var _$pad_43 = require('./lib/pad.js'); */;\nvar __c_41 = 0,\n __blockSize_41 = 4,\n __base_41 = 36,\n __discreteValues_41 = Math.pow(__base_41, __blockSize_41);\nfunction __randomBlock_41() {\n return _$pad_43((Math.random() * __discreteValues_41 << 0).toString(__base_41), __blockSize_41);\n}\nfunction __safeCounter_41() {\n __c_41 = __c_41 < __discreteValues_41 ? __c_41 : 0;\n __c_41++; // this is not subliminal\n return __c_41 - 1;\n}\nfunction __cuid_41() {\n // Starting with a lowercase letter makes\n // it HTML element ID friendly.\n var letter = 'c',\n // hard-coded allows for sequential access\n\n // timestamp\n // warning: this exposes the exact date and time\n // that the uid was created.\n timestamp = new Date().getTime().toString(__base_41),\n // Prevent same-machine collisions.\n counter = _$pad_43(__safeCounter_41().toString(__base_41), __blockSize_41),\n // A few chars to generate distinct ids for different\n // clients (so different computers are far less\n // likely to generate the same id)\n print = _$fingerprint_42(),\n // Grab some more chars from Math.random()\n random = __randomBlock_41() + __randomBlock_41();\n return letter + timestamp + counter + print + random;\n}\n__cuid_41.fingerprint = _$fingerprint_42;\nvar _$cuid_41 = __cuid_41;\n\n/* removed: var _$assign_11 = require('@bugsnag/core/lib/es-utils/assign'); */;\nvar BUGSNAG_ANONYMOUS_ID_KEY = 'bugsnag-anonymous-id';\nvar getDeviceId = function (win) {\n try {\n var storage = win.localStorage;\n var id = storage.getItem(BUGSNAG_ANONYMOUS_ID_KEY);\n\n // If we get an ID, make sure it looks like a valid cuid. The length can\n // fluctuate slightly, so some leeway is built in\n if (id && /^c[a-z0-9]{20,32}$/.test(id)) {\n return id;\n }\n /* removed: var _$cuid_41 = require('@bugsnag/cuid'); */;\n id = _$cuid_41();\n storage.setItem(BUGSNAG_ANONYMOUS_ID_KEY, id);\n return id;\n } catch (err) {\n // If localStorage is not available (e.g. because it's disabled) then give up\n }\n};\n\n/*\n * Automatically detects browser device details\n */\nvar _$device_40 = function (nav, win) {\n if (nav === void 0) {\n nav = navigator;\n }\n if (win === void 0) {\n win = window;\n }\n return {\n load: function (client) {\n var device = {\n locale: nav.browserLanguage || nav.systemLanguage || nav.userLanguage || nav.language,\n userAgent: nav.userAgent\n };\n if (win && win.screen && win.screen.orientation && win.screen.orientation.type) {\n device.orientation = win.screen.orientation.type;\n } else if (win && win.document) {\n device.orientation = win.document.documentElement.clientWidth > win.document.documentElement.clientHeight ? 'landscape' : 'portrait';\n }\n if (client._config.generateAnonymousId) {\n device.id = getDeviceId(win);\n }\n client.addOnSession(function (session) {\n session.device = _$assign_11({}, session.device, device);\n // only set device id if collectUserIp is false\n if (!client._config.collectUserIp) setDefaultUserId(session);\n });\n\n // add time just as the event is sent\n client.addOnError(function (event) {\n event.device = _$assign_11({}, event.device, device, {\n time: new Date()\n });\n if (!client._config.collectUserIp) setDefaultUserId(event);\n }, true);\n },\n configSchema: {\n generateAnonymousId: {\n validate: function (value) {\n return value === true || value === false;\n },\n defaultValue: function () {\n return true;\n },\n message: 'should be true|false'\n }\n }\n };\n};\nvar setDefaultUserId = function (eventOrSession) {\n // device id is also used to populate the user id field, if it's not already set\n var user = eventOrSession.getUser();\n if (!user || !user.id) {\n eventOrSession.setUser(eventOrSession.device.id);\n }\n};\n\n/* removed: var _$assign_11 = require('@bugsnag/core/lib/es-utils/assign'); */;\n\n/*\n * Sets the event request: { url } to be the current href\n */\nvar _$request_44 = function (win) {\n if (win === void 0) {\n win = window;\n }\n return {\n load: function (client) {\n client.addOnError(function (event) {\n if (event.request && event.request.url) return;\n event.request = _$assign_11({}, event.request, {\n url: win.location.href\n });\n }, true);\n }\n };\n};\n\n/* removed: var _$includes_13 = require('@bugsnag/core/lib/es-utils/includes'); */;\nvar _$session_45 = {\n load: function (client) {\n client._sessionDelegate = sessionDelegate;\n }\n};\nvar sessionDelegate = {\n startSession: function (client, session) {\n var sessionClient = client;\n sessionClient._session = session;\n sessionClient._pausedSession = null;\n\n // exit early if the current releaseStage is not enabled\n if (sessionClient._config.enabledReleaseStages !== null && !_$includes_13(sessionClient._config.enabledReleaseStages, sessionClient._config.releaseStage)) {\n sessionClient._logger.warn('Session not sent due to releaseStage/enabledReleaseStages configuration');\n return sessionClient;\n }\n sessionClient._delivery.sendSession({\n notifier: sessionClient._notifier,\n device: session.device,\n app: session.app,\n sessions: [{\n id: session.id,\n startedAt: session.startedAt,\n user: session._user\n }]\n });\n return sessionClient;\n },\n resumeSession: function (client) {\n // Do nothing if there's already an active session\n if (client._session) {\n return client;\n }\n\n // If we have a paused session then make it the active session\n if (client._pausedSession) {\n client._session = client._pausedSession;\n client._pausedSession = null;\n return client;\n }\n\n // Otherwise start a new session\n return client.startSession();\n },\n pauseSession: function (client) {\n client._pausedSession = client._session;\n client._session = null;\n }\n};\n\n/* removed: var _$assign_11 = require('@bugsnag/core/lib/es-utils/assign'); */;\n\n/*\n * Prevent collection of user IPs\n */\nvar _$clientIp_46 = {\n load: function (client) {\n if (client._config.collectUserIp) return;\n client.addOnError(function (event) {\n // If user.id is explicitly undefined, it will be missing from the payload. It needs\n // removing so that the following line replaces it\n if (event._user && typeof event._user.id === 'undefined') delete event._user.id;\n event._user = _$assign_11({\n id: '[REDACTED]'\n }, event._user);\n event.request = _$assign_11({\n clientIp: '[REDACTED]'\n }, event.request);\n });\n },\n configSchema: {\n collectUserIp: {\n defaultValue: function () {\n return true;\n },\n message: 'should be true|false',\n validate: function (value) {\n return value === true || value === false;\n }\n }\n }\n};\n\nvar _$consoleBreadcrumbs_47 = {};\n/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$reduce_17 = require('@bugsnag/core/lib/es-utils/reduce'); */;\n/* removed: var _$filter_12 = require('@bugsnag/core/lib/es-utils/filter'); */;\n\n/*\n * Leaves breadcrumbs when console log methods are called\n */\n_$consoleBreadcrumbs_47.load = function (client) {\n var isDev = /^(local-)?dev(elopment)?$/.test(client._config.releaseStage);\n if (isDev || !client._isBreadcrumbTypeEnabled('log')) return;\n _$map_16(CONSOLE_LOG_METHODS, function (method) {\n var original = console[method];\n console[method] = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n client.leaveBreadcrumb('Console output', _$reduce_17(args, function (accum, arg, i) {\n // do the best/simplest stringification of each argument\n var stringified = '[Unknown value]';\n // this may fail if the input is:\n // - an object whose [[Prototype]] is null (no toString)\n // - an object with a broken toString or @@toPrimitive implementation\n try {\n stringified = String(arg);\n } catch (e) {}\n // if it stringifies to [object Object] attempt to JSON stringify\n if (stringified === '[object Object]') {\n // catch stringify errors and fallback to [object Object]\n try {\n stringified = JSON.stringify(arg);\n } catch (e) {}\n }\n accum[\"[\" + i + \"]\"] = stringified;\n return accum;\n }, {\n severity: method.indexOf('group') === 0 ? 'log' : method\n }), 'log');\n original.apply(console, args);\n };\n console[method]._restore = function () {\n console[method] = original;\n };\n });\n};\nif (\"production\" !== 'production') {\n _$consoleBreadcrumbs_47.destroy = function () {\n return CONSOLE_LOG_METHODS.forEach(function (method) {\n if (typeof console[method]._restore === 'function') console[method]._restore();\n });\n };\n}\nvar CONSOLE_LOG_METHODS = _$filter_12(['log', 'debug', 'info', 'warn', 'error'], function (method) {\n return typeof console !== 'undefined' && typeof console[method] === 'function';\n});\n\n/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$reduce_17 = require('@bugsnag/core/lib/es-utils/reduce'); */;\n/* removed: var _$filter_12 = require('@bugsnag/core/lib/es-utils/filter'); */;\nvar MAX_LINE_LENGTH = 200;\nvar MAX_SCRIPT_LENGTH = 500000;\nvar _$inlineScriptContent_48 = function (doc, win) {\n if (doc === void 0) {\n doc = document;\n }\n if (win === void 0) {\n win = window;\n }\n return {\n load: function (client) {\n if (!client._config.trackInlineScripts) return;\n var originalLocation = win.location.href;\n var html = '';\n\n // in IE8-10 the 'interactive' state can fire too soon (before scripts have finished executing), so in those\n // we wait for the 'complete' state before assuming that synchronous scripts are no longer executing\n var isOldIe = !!doc.attachEvent;\n var DOMContentLoaded = isOldIe ? doc.readyState === 'complete' : doc.readyState !== 'loading';\n var getHtml = function () {\n return doc.documentElement.outerHTML;\n };\n\n // get whatever HTML exists at this point in time\n html = getHtml();\n var prev = doc.onreadystatechange;\n // then update it when the DOM content has loaded\n doc.onreadystatechange = function () {\n // IE8 compatible alternative to document#DOMContentLoaded\n if (doc.readyState === 'interactive') {\n html = getHtml();\n DOMContentLoaded = true;\n }\n try {\n prev.apply(this, arguments);\n } catch (e) {}\n };\n var _lastScript = null;\n var updateLastScript = function (script) {\n _lastScript = script;\n };\n var getCurrentScript = function () {\n var script = doc.currentScript || _lastScript;\n if (!script && !DOMContentLoaded) {\n var scripts = doc.scripts || doc.getElementsByTagName('script');\n script = scripts[scripts.length - 1];\n }\n return script;\n };\n var addSurroundingCode = function (lineNumber) {\n // get whatever html has rendered at this point\n if (!DOMContentLoaded || !html) html = getHtml();\n // simulate the raw html\n var htmlLines = [''].concat(html.split('\\n'));\n var zeroBasedLine = lineNumber - 1;\n var start = Math.max(zeroBasedLine - 3, 0);\n var end = Math.min(zeroBasedLine + 3, htmlLines.length);\n return _$reduce_17(htmlLines.slice(start, end), function (accum, line, i) {\n accum[start + 1 + i] = line.length <= MAX_LINE_LENGTH ? line : line.substr(0, MAX_LINE_LENGTH);\n return accum;\n }, {});\n };\n client.addOnError(function (event) {\n // remove any of our own frames that may be part the stack this\n // happens before the inline script check as it happens for all errors\n event.errors[0].stacktrace = _$filter_12(event.errors[0].stacktrace, function (f) {\n return !/__trace__$/.test(f.method);\n });\n var frame = event.errors[0].stacktrace[0];\n\n // remove hash and query string from url\n var cleanUrl = function (url) {\n return url.replace(/#.*$/, '').replace(/\\?.*$/, '');\n };\n\n // if frame.file exists and is not the original location of the page, this can't be an inline script\n if (frame && frame.file && cleanUrl(frame.file) !== cleanUrl(originalLocation)) return;\n\n // grab the last script known to have run\n var currentScript = getCurrentScript();\n if (currentScript) {\n var content = currentScript.innerHTML;\n event.addMetadata('script', 'content', content.length <= MAX_SCRIPT_LENGTH ? content : content.substr(0, MAX_SCRIPT_LENGTH));\n\n // only attempt to grab some surrounding code if we have a line number\n if (frame && frame.lineNumber) {\n frame.code = addSurroundingCode(frame.lineNumber);\n }\n }\n }, true);\n\n // Proxy all the timer functions whose callback is their 0th argument.\n // Keep a reference to the original setTimeout because we need it later\n var _map = _$map_16(['setTimeout', 'setInterval', 'setImmediate', 'requestAnimationFrame'], function (fn) {\n return __proxy(win, fn, function (original) {\n return __traceOriginalScript(original, function (args) {\n return {\n get: function () {\n return args[0];\n },\n replace: function (fn) {\n args[0] = fn;\n }\n };\n });\n });\n }),\n _setTimeout = _map[0];\n\n // Proxy all the host objects whose prototypes have an addEventListener function\n _$map_16(['EventTarget', 'Window', 'Node', 'ApplicationCache', 'AudioTrackList', 'ChannelMergerNode', 'CryptoOperation', 'EventSource', 'FileReader', 'HTMLUnknownElement', 'IDBDatabase', 'IDBRequest', 'IDBTransaction', 'KeyOperation', 'MediaController', 'MessagePort', 'ModalWindow', 'Notification', 'SVGElementInstance', 'Screen', 'TextTrack', 'TextTrackCue', 'TextTrackList', 'WebSocket', 'WebSocketWorker', 'Worker', 'XMLHttpRequest', 'XMLHttpRequestEventTarget', 'XMLHttpRequestUpload'], function (o) {\n if (!win[o] || !win[o].prototype || !Object.prototype.hasOwnProperty.call(win[o].prototype, 'addEventListener')) return;\n __proxy(win[o].prototype, 'addEventListener', function (original) {\n return __traceOriginalScript(original, eventTargetCallbackAccessor);\n });\n __proxy(win[o].prototype, 'removeEventListener', function (original) {\n return __traceOriginalScript(original, eventTargetCallbackAccessor, true);\n });\n });\n function __traceOriginalScript(fn, callbackAccessor, alsoCallOriginal) {\n if (alsoCallOriginal === void 0) {\n alsoCallOriginal = false;\n }\n return function () {\n // this is required for removeEventListener to remove anything added with\n // addEventListener before the functions started being wrapped by Bugsnag\n var args = [].slice.call(arguments);\n try {\n var cba = callbackAccessor(args);\n var cb = cba.get();\n if (alsoCallOriginal) fn.apply(this, args);\n if (typeof cb !== 'function') return fn.apply(this, args);\n if (cb.__trace__) {\n cba.replace(cb.__trace__);\n } else {\n var script = getCurrentScript();\n // this function mustn't be annonymous due to a bug in the stack\n // generation logic, meaning it gets tripped up\n // see: https://github.com/stacktracejs/stack-generator/issues/6\n cb.__trace__ = function __trace__() {\n // set the script that called this function\n updateLastScript(script);\n // immediately unset the currentScript synchronously below, however\n // if this cb throws an error the line after will not get run so schedule\n // an almost-immediate aysnc update too\n _setTimeout(function () {\n updateLastScript(null);\n }, 0);\n var ret = cb.apply(this, arguments);\n updateLastScript(null);\n return ret;\n };\n cb.__trace__.__trace__ = cb.__trace__;\n cba.replace(cb.__trace__);\n }\n } catch (e) {\n // swallow these errors on Selenium:\n // Permission denied to access property '__trace__'\n // WebDriverException: Message: Permission denied to access property \"handleEvent\"\n }\n // IE8 doesn't let you call .apply() on setTimeout/setInterval\n if (fn.apply) return fn.apply(this, args);\n switch (args.length) {\n case 1:\n return fn(args[0]);\n case 2:\n return fn(args[0], args[1]);\n default:\n return fn();\n }\n };\n }\n },\n configSchema: {\n trackInlineScripts: {\n validate: function (value) {\n return value === true || value === false;\n },\n defaultValue: function () {\n return true;\n },\n message: 'should be true|false'\n }\n }\n };\n};\nfunction __proxy(host, name, replacer) {\n var original = host[name];\n if (!original) return original;\n var replacement = replacer(original);\n host[name] = replacement;\n return original;\n}\nfunction eventTargetCallbackAccessor(args) {\n var isEventHandlerObj = !!args[1] && typeof args[1].handleEvent === 'function';\n return {\n get: function () {\n return isEventHandlerObj ? args[1].handleEvent : args[1];\n },\n replace: function (fn) {\n if (isEventHandlerObj) {\n args[1].handleEvent = fn;\n } else {\n args[1] = fn;\n }\n }\n };\n}\n\n/*\n * Leaves breadcrumbs when the user interacts with the DOM\n */\nvar _$interactionBreadcrumbs_49 = function (win) {\n if (win === void 0) {\n win = window;\n }\n return {\n load: function (client) {\n if (!('addEventListener' in win)) return;\n if (!client._isBreadcrumbTypeEnabled('user')) return;\n win.addEventListener('click', function (event) {\n var targetText, targetSelector;\n try {\n targetText = getNodeText(event.target);\n targetSelector = getNodeSelector(event.target, win);\n } catch (e) {\n targetText = '[hidden]';\n targetSelector = '[hidden]';\n client._logger.error('Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z');\n }\n client.leaveBreadcrumb('UI click', {\n targetText: targetText,\n targetSelector: targetSelector\n }, 'user');\n }, true);\n }\n };\n};\nvar trimStart = /^\\s+/;\nvar trimEnd = /(^|[^\\s])\\s+$/;\nfunction getNodeText(el) {\n var text = el.textContent || el.innerText || '';\n if (!text && (el.type === 'submit' || el.type === 'button')) {\n text = el.value;\n }\n text = text.replace(trimStart, '').replace(trimEnd, '$1');\n if (text.length > 140) {\n return text.slice(0, 135) + '(...)';\n }\n return text;\n}\n\n// Create a label from tagname, id and css class of the element\nfunction getNodeSelector(el, win) {\n var parts = [el.tagName];\n if (el.id) parts.push('#' + el.id);\n if (el.className && el.className.length) parts.push(\".\" + el.className.split(' ').join('.'));\n // Can't get much more advanced with the current browser\n if (!win.document.querySelectorAll || !Array.prototype.indexOf) return parts.join('');\n try {\n if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join('');\n } catch (e) {\n // Sometimes the query selector can be invalid just return it as-is\n return parts.join('');\n }\n // try to get a more specific selector if this one matches more than one element\n if (el.parentNode.childNodes.length > 1) {\n var index = Array.prototype.indexOf.call(el.parentNode.childNodes, el) + 1;\n parts.push(\":nth-child(\" + index + \")\");\n }\n if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join('');\n // try prepending the parent node selector\n if (el.parentNode) return getNodeSelector(el.parentNode, win) + \" > \" + parts.join('');\n return parts.join('');\n}\n\nvar _$navigationBreadcrumbs_50 = {};\n/*\n* Leaves breadcrumbs when navigation methods are called or events are emitted\n*/\n_$navigationBreadcrumbs_50 = function (win) {\n if (win === void 0) {\n win = window;\n }\n var plugin = {\n load: function (client) {\n if (!('addEventListener' in win)) return;\n if (!client._isBreadcrumbTypeEnabled('navigation')) return;\n\n // returns a function that will drop a breadcrumb with a given name\n var drop = function (name) {\n return function () {\n return client.leaveBreadcrumb(name, {}, 'navigation');\n };\n };\n\n // simple drops – just names, no meta\n win.addEventListener('pagehide', drop('Page hidden'), true);\n win.addEventListener('pageshow', drop('Page shown'), true);\n win.addEventListener('load', drop('Page loaded'), true);\n win.document.addEventListener('DOMContentLoaded', drop('DOMContentLoaded'), true);\n // some browsers like to emit popstate when the page loads, so only add the popstate listener after that\n win.addEventListener('load', function () {\n return win.addEventListener('popstate', drop('Navigated back'), true);\n });\n\n // hashchange has some metadata that we care about\n win.addEventListener('hashchange', function (event) {\n var metadata = event.oldURL ? {\n from: relativeLocation(event.oldURL, win),\n to: relativeLocation(event.newURL, win),\n state: getCurrentState(win)\n } : {\n to: relativeLocation(win.location.href, win)\n };\n client.leaveBreadcrumb('Hash changed', metadata, 'navigation');\n }, true);\n\n // the only way to know about replaceState/pushState is to wrap them… >_<\n\n if (win.history.replaceState) wrapHistoryFn(client, win.history, 'replaceState', win);\n if (win.history.pushState) wrapHistoryFn(client, win.history, 'pushState', win);\n }\n };\n if (\"production\" !== 'production') {\n plugin.destroy = function (win) {\n if (win === void 0) {\n win = window;\n }\n win.history.replaceState._restore();\n win.history.pushState._restore();\n };\n }\n return plugin;\n};\nif (\"production\" !== 'production') {\n _$navigationBreadcrumbs_50.destroy = function (win) {\n if (win === void 0) {\n win = window;\n }\n win.history.replaceState._restore();\n win.history.pushState._restore();\n };\n}\n\n// takes a full url like http://foo.com:1234/pages/01.html?yes=no#section-2 and returns\n// just the path and hash parts, e.g. /pages/01.html?yes=no#section-2\nvar relativeLocation = function (url, win) {\n var a = win.document.createElement('A');\n a.href = url;\n return \"\" + a.pathname + a.search + a.hash;\n};\nvar stateChangeToMetadata = function (win, state, title, url) {\n var currentPath = relativeLocation(win.location.href, win);\n return {\n title: title,\n state: state,\n prevState: getCurrentState(win),\n to: url || currentPath,\n from: currentPath\n };\n};\nvar wrapHistoryFn = function (client, target, fn, win) {\n var orig = target[fn];\n target[fn] = function (state, title, url) {\n client.leaveBreadcrumb(\"History \" + fn, stateChangeToMetadata(win, state, title, url), 'navigation');\n // if throttle plugin is in use, reset the event sent count\n if (typeof client.resetEventCount === 'function') client.resetEventCount();\n // if the client is operating in auto session-mode, a new route should trigger a new session\n if (client._config.autoTrackSessions) client.startSession();\n // Internet Explorer will convert `undefined` to a string when passed, causing an unintended redirect\n // to '/undefined'. therefore we only pass the url if it's not undefined.\n orig.apply(target, [state, title].concat(url !== undefined ? url : []));\n };\n if (\"production\" !== 'production') {\n target[fn]._restore = function () {\n target[fn] = orig;\n };\n }\n};\nvar getCurrentState = function (win) {\n try {\n return win.history.state;\n } catch (e) {}\n};\n\nvar BREADCRUMB_TYPE = 'request';\n/* removed: var _$includes_13 = require('@bugsnag/core/lib/es-utils/includes'); */;\n\n/*\n * Leaves breadcrumbs when network requests occur\n */\nvar _$networkBreadcrumbs_51 = function (_ignoredUrls, win) {\n if (_ignoredUrls === void 0) {\n _ignoredUrls = [];\n }\n if (win === void 0) {\n win = window;\n }\n var restoreFunctions = [];\n var plugin = {\n load: function (client) {\n if (!client._isBreadcrumbTypeEnabled('request')) return;\n var ignoredUrls = [client._config.endpoints.notify, client._config.endpoints.sessions].concat(_ignoredUrls);\n monkeyPatchXMLHttpRequest();\n monkeyPatchFetch();\n\n // XMLHttpRequest monkey patch\n function monkeyPatchXMLHttpRequest() {\n if (!('addEventListener' in win.XMLHttpRequest.prototype)) return;\n var nativeOpen = win.XMLHttpRequest.prototype.open;\n\n // override native open()\n win.XMLHttpRequest.prototype.open = function open(method, url) {\n var _this = this;\n var requestSetupKey = false;\n var error = function () {\n return handleXHRError(method, url);\n };\n var load = function () {\n return handleXHRLoad(method, url, _this.status);\n };\n\n // if we have already setup listeners, it means open() was called twice, we need to remove\n // the listeners and recreate them\n if (requestSetupKey) {\n this.removeEventListener('load', load);\n this.removeEventListener('error', error);\n }\n\n // attach load event listener\n this.addEventListener('load', load);\n // attach error event listener\n this.addEventListener('error', error);\n requestSetupKey = true;\n nativeOpen.apply(this, arguments);\n };\n if (\"production\" !== 'production') {\n restoreFunctions.push(function () {\n win.XMLHttpRequest.prototype.open = nativeOpen;\n });\n }\n }\n function handleXHRLoad(method, url, status) {\n if (url === undefined) {\n client._logger.warn('The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.');\n return;\n }\n\n // an XMLHttpRequest's URL can be an object as long as its 'toString'\n // returns a URL, e.g. a HTMLAnchorElement\n if (typeof url === 'string' && _$includes_13(ignoredUrls, url.replace(/\\?.*$/, ''))) {\n // don't leave a network breadcrumb from bugsnag notify calls\n return;\n }\n var metadata = {\n status: status,\n request: method + \" \" + url\n };\n if (status >= 400) {\n // contacted server but got an error response\n client.leaveBreadcrumb('XMLHttpRequest failed', metadata, BREADCRUMB_TYPE);\n } else {\n client.leaveBreadcrumb('XMLHttpRequest succeeded', metadata, BREADCRUMB_TYPE);\n }\n }\n function handleXHRError(method, url) {\n if (url === undefined) {\n client._logger.warn('The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.');\n return;\n }\n if (typeof url === 'string' && _$includes_13(ignoredUrls, url.replace(/\\?.*$/, ''))) {\n // don't leave a network breadcrumb from bugsnag notify calls\n return;\n }\n\n // failed to contact server\n client.leaveBreadcrumb('XMLHttpRequest error', {\n request: method + \" \" + url\n }, BREADCRUMB_TYPE);\n }\n\n // window.fetch monkey patch\n function monkeyPatchFetch() {\n // only patch it if it exists and if it is not a polyfill (patching a polyfilled\n // fetch() results in duplicate breadcrumbs for the same request because the\n // implementation uses XMLHttpRequest which is also patched)\n if (!('fetch' in win) || win.fetch.polyfill) return;\n var oldFetch = win.fetch;\n win.fetch = function fetch() {\n var _arguments = arguments;\n var urlOrRequest = arguments[0];\n var options = arguments[1];\n var method;\n var url = null;\n if (urlOrRequest && typeof urlOrRequest === 'object') {\n url = urlOrRequest.url;\n if (options && 'method' in options) {\n method = options.method;\n } else if (urlOrRequest && 'method' in urlOrRequest) {\n method = urlOrRequest.method;\n }\n } else {\n url = urlOrRequest;\n if (options && 'method' in options) {\n method = options.method;\n }\n }\n if (method === undefined) {\n method = 'GET';\n }\n return new Promise(function (resolve, reject) {\n // pass through to native fetch\n oldFetch.apply(void 0, _arguments).then(function (response) {\n handleFetchSuccess(response, method, url);\n resolve(response);\n })[\"catch\"](function (error) {\n handleFetchError(method, url);\n reject(error);\n });\n });\n };\n if (\"production\" !== 'production') {\n restoreFunctions.push(function () {\n win.fetch = oldFetch;\n });\n }\n }\n var handleFetchSuccess = function (response, method, url) {\n var metadata = {\n status: response.status,\n request: method + \" \" + url\n };\n if (response.status >= 400) {\n // when the request comes back with a 4xx or 5xx status it does not reject the fetch promise,\n client.leaveBreadcrumb('fetch() failed', metadata, BREADCRUMB_TYPE);\n } else {\n client.leaveBreadcrumb('fetch() succeeded', metadata, BREADCRUMB_TYPE);\n }\n };\n var handleFetchError = function (method, url) {\n client.leaveBreadcrumb('fetch() error', {\n request: method + \" \" + url\n }, BREADCRUMB_TYPE);\n };\n }\n };\n if (\"production\" !== 'production') {\n plugin.destroy = function () {\n restoreFunctions.forEach(function (fn) {\n return fn();\n });\n restoreFunctions = [];\n };\n }\n return plugin;\n};\n\n/* removed: var _$intRange_24 = require('@bugsnag/core/lib/validators/int-range'); */;\n\n/*\n * Throttles and dedupes events\n */\n\nvar _$throttle_52 = {\n load: function (client) {\n // track sent events for each init of the plugin\n var n = 0;\n\n // add onError hook\n client.addOnError(function (event) {\n // have max events been sent already?\n if (n >= client._config.maxEvents) {\n client._logger.warn(\"Cancelling event send due to maxEvents per session limit of \" + client._config.maxEvents + \" being reached\");\n return false;\n }\n n++;\n });\n client.resetEventCount = function () {\n n = 0;\n };\n },\n configSchema: {\n maxEvents: {\n defaultValue: function () {\n return 10;\n },\n message: 'should be a positive integer ≤100',\n validate: function (val) {\n return _$intRange_24(1, 100)(val);\n }\n }\n }\n};\n\nvar _$stripQueryString_53 = {};\n/*\n * Remove query strings (and fragments) from stacktraces\n */\n/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$reduce_17 = require('@bugsnag/core/lib/es-utils/reduce'); */;\n_$stripQueryString_53 = {\n load: function (client) {\n client.addOnError(function (event) {\n var allFrames = _$reduce_17(event.errors, function (accum, er) {\n return accum.concat(er.stacktrace);\n }, []);\n _$map_16(allFrames, function (frame) {\n frame.file = strip(frame.file);\n });\n });\n }\n};\nvar strip = _$stripQueryString_53._strip = function (str) {\n return typeof str === 'string' ? str.replace(/\\?.*$/, '').replace(/#.*$/, '') : str;\n};\n\n/*\n * Automatically notifies Bugsnag when window.onerror is called\n */\n\nvar _$onerror_54 = function (win, component) {\n if (win === void 0) {\n win = window;\n }\n if (component === void 0) {\n component = 'window onerror';\n }\n return {\n load: function (client) {\n if (!client._config.autoDetectErrors) return;\n if (!client._config.enabledErrorTypes.unhandledExceptions) return;\n function onerror(messageOrEvent, url, lineNo, charNo, error) {\n // Ignore errors with no info due to CORS settings\n if (lineNo === 0 && /Script error\\.?/.test(messageOrEvent)) {\n client._logger.warn('Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z');\n } else {\n // any error sent to window.onerror is unhandled and has severity=error\n var handledState = {\n severity: 'error',\n unhandled: true,\n severityReason: {\n type: 'unhandledException'\n }\n };\n var event;\n\n // window.onerror can be called in a number of ways. This big if-else is how we\n // figure out which arguments were supplied, and what kind of values it received.\n\n if (error) {\n // if the last parameter (error) was supplied, this is a modern browser's\n // way of saying \"this value was thrown and not caught\"\n event = client.Event.create(error, true, handledState, component, 1);\n decorateStack(event.errors[0].stacktrace, url, lineNo, charNo);\n } else if (\n // This complex case detects \"error\" events that are typically synthesised\n // by jquery's trigger method (although can be created in other ways). In\n // order to detect this:\n // - the first argument (message) must exist and be an object (most likely it's a jQuery event)\n // - the second argument (url) must either not exist or be something other than a string (if it\n // exists and is not a string, it'll be the extraParameters argument from jQuery's trigger()\n // function)\n // - the third, fourth and fifth arguments must not exist (lineNo, charNo and error)\n typeof messageOrEvent === 'object' && messageOrEvent !== null && (!url || typeof url !== 'string') && !lineNo && !charNo && !error) {\n // The jQuery event may have a \"type\" property, if so use it as part of the error message\n var name = messageOrEvent.type ? \"Event: \" + messageOrEvent.type : 'Error';\n // attempt to find a message from one of the conventional properties, but\n // default to empty string (the event will fill it with a placeholder)\n var message = messageOrEvent.message || messageOrEvent.detail || '';\n event = client.Event.create({\n name: name,\n message: message\n }, true, handledState, component, 1);\n\n // provide the original thing onerror received – not our error-like object we passed to _notify\n event.originalError = messageOrEvent;\n\n // include the raw input as metadata – it might contain more info than we extracted\n event.addMetadata(component, {\n event: messageOrEvent,\n extraParameters: url\n });\n } else {\n // Lastly, if there was no \"error\" parameter this event was probably from an old\n // browser that doesn't support that. Instead we need to generate a stacktrace.\n event = client.Event.create(messageOrEvent, true, handledState, component, 1);\n decorateStack(event.errors[0].stacktrace, url, lineNo, charNo);\n }\n client._notify(event);\n }\n if (typeof prevOnError === 'function') prevOnError.apply(this, arguments);\n }\n var prevOnError = win.onerror;\n win.onerror = onerror;\n }\n };\n};\n\n// Sometimes the stacktrace has less information than was passed to window.onerror.\n// This function will augment the first stackframe with any useful info that was\n// received as arguments to the onerror callback.\nvar decorateStack = function (stack, url, lineNo, charNo) {\n if (!stack[0]) stack.push({});\n var culprit = stack[0];\n if (!culprit.file && typeof url === 'string') culprit.file = url;\n if (!culprit.lineNumber && isActualNumber(lineNo)) culprit.lineNumber = lineNo;\n if (!culprit.columnNumber) {\n if (isActualNumber(charNo)) {\n culprit.columnNumber = charNo;\n } else if (window.event && isActualNumber(window.event.errorCharacter)) {\n culprit.columnNumber = window.event.errorCharacter;\n }\n }\n};\nvar isActualNumber = function (n) {\n return typeof n === 'number' && String.call(n) !== 'NaN';\n};\n\n/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$iserror_20 = require('@bugsnag/core/lib/iserror'); */;\nvar _listener;\n/*\n * Automatically notifies Bugsnag when window.onunhandledrejection is called\n */\nvar _$unhandledRejection_55 = function (win) {\n if (win === void 0) {\n win = window;\n }\n var plugin = {\n load: function (client) {\n if (!client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections) return;\n var listener = function (evt) {\n var error = evt.reason;\n var isBluebird = false;\n\n // accessing properties on evt.detail can throw errors (see #394)\n try {\n if (evt.detail && evt.detail.reason) {\n error = evt.detail.reason;\n isBluebird = true;\n }\n } catch (e) {}\n var event = client.Event.create(error, false, {\n severity: 'error',\n unhandled: true,\n severityReason: {\n type: 'unhandledPromiseRejection'\n }\n }, 'unhandledrejection handler', 1, client._logger);\n if (isBluebird) {\n _$map_16(event.errors[0].stacktrace, fixBluebirdStacktrace(error));\n }\n client._notify(event, function (event) {\n if (_$iserror_20(event.originalError) && !event.originalError.stack) {\n var _event$addMetadata;\n event.addMetadata('unhandledRejection handler', (_event$addMetadata = {}, _event$addMetadata[Object.prototype.toString.call(event.originalError)] = {\n name: event.originalError.name,\n message: event.originalError.message,\n code: event.originalError.code\n }, _event$addMetadata));\n }\n });\n };\n if ('addEventListener' in win) {\n win.addEventListener('unhandledrejection', listener);\n } else {\n win.onunhandledrejection = function (reason, promise) {\n listener({\n detail: {\n reason: reason,\n promise: promise\n }\n });\n };\n }\n _listener = listener;\n }\n };\n if (\"production\" !== 'production') {\n plugin.destroy = function (win) {\n if (win === void 0) {\n win = window;\n }\n if (_listener) {\n if ('addEventListener' in win) {\n win.removeEventListener('unhandledrejection', _listener);\n } else {\n win.onunhandledrejection = null;\n }\n }\n _listener = null;\n };\n }\n return plugin;\n};\n\n// The stack parser on bluebird stacks in FF get a suprious first frame:\n//\n// Error: derp\n// b@http://localhost:5000/bluebird.html:22:24\n// a@http://localhost:5000/bluebird.html:18:9\n// @http://localhost:5000/bluebird.html:14:9\n//\n// results in\n// […]\n// 0: Object { file: \"Error: derp\", method: undefined, lineNumber: undefined, … }\n// 1: Object { file: \"http://localhost:5000/bluebird.html\", method: \"b\", lineNumber: 22, … }\n// 2: Object { file: \"http://localhost:5000/bluebird.html\", method: \"a\", lineNumber: 18, … }\n// 3: Object { file: \"http://localhost:5000/bluebird.html\", lineNumber: 14, columnNumber: 9, … }\n//\n// so the following reduce/accumulator function removes such frames\n//\n// Bluebird pads method names with spaces so trim that too…\n// https://github.com/petkaantonov/bluebird/blob/b7f21399816d02f979fe434585334ce901dcaf44/src/debuggability.js#L568-L571\nvar fixBluebirdStacktrace = function (error) {\n return function (frame) {\n if (frame.file === error.toString()) return;\n if (frame.method) {\n frame.method = frame.method.replace(/^\\s+/, '');\n }\n };\n};\n\nvar _$notifier_2 = {};\nvar name = 'Bugsnag JavaScript';\nvar version = '7.22.4';\nvar url = 'https://github.com/bugsnag/bugsnag-js';\n/* removed: var _$Client_4 = require('@bugsnag/core/client'); */;\n/* removed: var _$Event_6 = require('@bugsnag/core/event'); */;\n/* removed: var _$Session_35 = require('@bugsnag/core/session'); */;\n/* removed: var _$Breadcrumb_3 = require('@bugsnag/core/breadcrumb'); */;\n/* removed: var _$map_16 = require('@bugsnag/core/lib/es-utils/map'); */;\n/* removed: var _$keys_15 = require('@bugsnag/core/lib/es-utils/keys'); */;\n/* removed: var _$assign_11 = require('@bugsnag/core/lib/es-utils/assign'); */;\n\n// extend the base config schema with some browser-specific options\nvar __schema_2 = _$assign_11({}, _$config_5.schema, _$config_1);\n/* removed: var _$onerror_54 = require('@bugsnag/plugin-window-onerror'); */;\n/* removed: var _$unhandledRejection_55 = require('@bugsnag/plugin-window-unhandled-rejection'); */;\n/* removed: var _$app_38 = require('@bugsnag/plugin-app-duration'); */;\n/* removed: var _$device_40 = require('@bugsnag/plugin-browser-device'); */;\n/* removed: var _$context_39 = require('@bugsnag/plugin-browser-context'); */;\n/* removed: var _$request_44 = require('@bugsnag/plugin-browser-request'); */;\n/* removed: var _$throttle_52 = require('@bugsnag/plugin-simple-throttle'); */;\n/* removed: var _$consoleBreadcrumbs_47 = require('@bugsnag/plugin-console-breadcrumbs'); */;\n/* removed: var _$networkBreadcrumbs_51 = require('@bugsnag/plugin-network-breadcrumbs'); */;\n/* removed: var _$navigationBreadcrumbs_50 = require('@bugsnag/plugin-navigation-breadcrumbs'); */;\n/* removed: var _$interactionBreadcrumbs_49 = require('@bugsnag/plugin-interaction-breadcrumbs'); */;\n/* removed: var _$inlineScriptContent_48 = require('@bugsnag/plugin-inline-script-content'); */;\n/* removed: var _$session_45 = require('@bugsnag/plugin-browser-session'); */;\n/* removed: var _$clientIp_46 = require('@bugsnag/plugin-client-ip'); */;\n/* removed: var _$stripQueryString_53 = require('@bugsnag/plugin-strip-query-string'); */;\n\n// delivery mechanisms\n/* removed: var _$delivery_36 = require('@bugsnag/delivery-x-domain-request'); */;\n/* removed: var _$delivery_37 = require('@bugsnag/delivery-xml-http-request'); */;\nvar Bugsnag = {\n _client: null,\n createClient: function (opts) {\n // handle very simple use case where user supplies just the api key as a string\n if (typeof opts === 'string') opts = {\n apiKey: opts\n };\n if (!opts) opts = {};\n var internalPlugins = [\n // add browser-specific plugins\n _$app_38, _$device_40(), _$context_39(), _$request_44(), _$throttle_52, _$session_45, _$clientIp_46, _$stripQueryString_53, _$onerror_54(), _$unhandledRejection_55(), _$navigationBreadcrumbs_50(), _$interactionBreadcrumbs_49(), _$networkBreadcrumbs_51(), _$consoleBreadcrumbs_47,\n // this one added last to avoid wrapping functionality before bugsnag uses it\n _$inlineScriptContent_48()];\n\n // configure a client with user supplied options\n var bugsnag = new _$Client_4(opts, __schema_2, internalPlugins, {\n name: name,\n version: version,\n url: url\n });\n\n // set delivery based on browser capability (IE 8+9 have an XDomainRequest object)\n bugsnag._setDelivery(window.XDomainRequest ? _$delivery_36 : _$delivery_37);\n bugsnag._logger.debug('Loaded!');\n bugsnag.leaveBreadcrumb('Bugsnag loaded', {}, 'state');\n return bugsnag._config.autoTrackSessions ? bugsnag.startSession() : bugsnag;\n },\n start: function (opts) {\n if (Bugsnag._client) {\n Bugsnag._client._logger.warn('Bugsnag.start() was called more than once. Ignoring.');\n return Bugsnag._client;\n }\n Bugsnag._client = Bugsnag.createClient(opts);\n return Bugsnag._client;\n },\n isStarted: function () {\n return Bugsnag._client != null;\n }\n};\n_$map_16(['resetEventCount'].concat(_$keys_15(_$Client_4.prototype)), function (m) {\n if (/^_/.test(m)) return;\n Bugsnag[m] = function () {\n if (!Bugsnag._client) return console.log(\"Bugsnag.\" + m + \"() was called before Bugsnag.start()\");\n Bugsnag._client._depth += 1;\n var ret = Bugsnag._client[m].apply(Bugsnag._client, arguments);\n Bugsnag._client._depth -= 1;\n return ret;\n };\n});\n_$notifier_2 = Bugsnag;\n_$notifier_2.Client = _$Client_4;\n_$notifier_2.Event = _$Event_6;\n_$notifier_2.Session = _$Session_35;\n_$notifier_2.Breadcrumb = _$Breadcrumb_3;\n\n// Export a \"default\" property for compatibility with ESM imports\n_$notifier_2[\"default\"] = Bugsnag;\n\nreturn _$notifier_2;\n\n});\n//# sourceMappingURL=bugsnag.js.map\n","(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.BugsnagPluginReact = f()}})(function(){var define,module,exports;\nvar _$src_1 = {};\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n_$src_1 = /*#__PURE__*/function () {\n function BugsnagPluginReact() {\n // Fetch React from the window object, if it exists\n var globalReact = typeof window !== 'undefined' && window.React;\n this.name = 'react';\n this.lazy = arguments.length === 0 && !globalReact;\n\n if (!this.lazy) {\n this.React = (arguments.length <= 0 ? undefined : arguments[0]) || globalReact;\n if (!this.React) throw new Error('@bugsnag/plugin-react reference to `React` was undefined');\n }\n }\n\n var _proto = BugsnagPluginReact.prototype;\n\n _proto.load = function load(client) {\n if (!this.lazy) {\n var ErrorBoundary = createClass(this.React, client);\n\n ErrorBoundary.createErrorBoundary = function () {\n return ErrorBoundary;\n };\n\n return ErrorBoundary;\n }\n\n var BugsnagPluginReactLazyInitializer = function () {\n throw new Error(\"@bugsnag/plugin-react was used incorrectly. Valid usage is as follows:\\nPass React to the plugin constructor\\n\\n `Bugsnag.start({ plugins: [new BugsnagPluginReact(React)] })`\\nand then call `const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary()`\\n\\nOr if React is not available until after Bugsnag has started,\\nconstruct the plugin with no arguments\\n `Bugsnag.start({ plugins: [new BugsnagPluginReact()] })`,\\nthen pass in React when available to construct your error boundary\\n `const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary(React)`\");\n };\n\n BugsnagPluginReactLazyInitializer.createErrorBoundary = function (React) {\n if (!React) throw new Error('@bugsnag/plugin-react reference to `React` was undefined');\n return createClass(React, client);\n };\n\n return BugsnagPluginReactLazyInitializer;\n };\n\n return BugsnagPluginReact;\n}();\n\nvar formatComponentStack = function (str) {\n var lines = str.split(/\\s*\\n\\s*/g);\n var ret = '';\n\n for (var line = 0, len = lines.length; line < len; line++) {\n if (lines[line].length) ret += \"\" + (ret.length ? '\\n' : '') + lines[line];\n }\n\n return ret;\n};\n\nvar createClass = function (React, client) {\n return /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(ErrorBoundary, _React$Component);\n\n function ErrorBoundary(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.state = {\n error: null,\n info: null\n };\n _this.handleClearError = _this.handleClearError.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto2 = ErrorBoundary.prototype;\n\n _proto2.handleClearError = function handleClearError() {\n this.setState({\n error: null,\n info: null\n });\n };\n\n _proto2.componentDidCatch = function componentDidCatch(error, info) {\n var onError = this.props.onError;\n var handledState = {\n severity: 'error',\n unhandled: true,\n severityReason: {\n type: 'unhandledException'\n }\n };\n var event = client.Event.create(error, true, handledState, 1);\n if (info && info.componentStack) info.componentStack = formatComponentStack(info.componentStack);\n event.addMetadata('react', info);\n\n client._notify(event, onError);\n\n this.setState({\n error: error,\n info: info\n });\n };\n\n _proto2.render = function render() {\n var error = this.state.error;\n\n if (error) {\n var FallbackComponent = this.props.FallbackComponent;\n if (FallbackComponent) return React.createElement(FallbackComponent, _extends({}, this.state, {\n clearError: this.handleClearError\n }));\n return null;\n }\n\n return this.props.children;\n };\n\n return ErrorBoundary;\n }(React.Component);\n};\n\n_$src_1.formatComponentStack = formatComponentStack;\n_$src_1[\"default\"] = _$src_1;\n\nreturn _$src_1;\n\n});\n//# sourceMappingURL=bugsnag-react.js.map\n"],"sourceRoot":""}